gasListDetail.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395
  1. <!--气瓶列表-->
  2. <template>
  3. <view id="gasRecycle">
  4. <view class="title">{{form.gasName}}-{{form.levelName}}({{form.sizeName}})</view>
  5. <view class="register_li">
  6. <view class="register_li_min">
  7. <view>余量:</view>
  8. <input v-model="form.gasPressure" disabled style="color: #D60000;" type="text" >
  9. </view>
  10. <view class="register_li_min">
  11. <view>学院:</view>
  12. <input v-model="form.collegeName" disabled type="text" >
  13. </view>
  14. <view class="register_li_min">
  15. <view>实验地点:</view>
  16. <input v-model="form.subjectName" disabled type="text" >
  17. </view>
  18. <view class="register_li_min" style="border: none;">
  19. <view>电子标签:</view>
  20. <input v-model="form.beaconTag" disabled type="text" >
  21. <view class="binding" @click="binding()">更换电子标签</view>
  22. </view>
  23. </view>
  24. <scroll-view scroll-y @scrolltolower="scrollGet" class="scroll-box">
  25. <view class="small_title" @click="handleClick('useRecord')">使用记录</view>
  26. <view class="register_li2" >
  27. <viwe class="register_li2_min" @tap="useRecordInfo(item)" v-for="(item,index) in form.dbUsageRecordList">
  28. <view class="register_li2_t">{{item.operator?item.operator:'--'}}</view>
  29. <view class="register_li2_b">
  30. <img src="@/pages_manage/images/Version3.0/icon_qpgl_syl.png">
  31. <view>使用量: {{item.usageAmount}}Mpa</view>
  32. </view>
  33. <view class="register_li2_b2">
  34. <img src="@/pages_manage/images/Version2.2/icon_wtzg_sj.png">
  35. <view>使用时间: {{item.usageStartTime==null?'':item.usageStartTime}}-{{item.usageEndTime==null?'':item.usageEndTime}}</view>
  36. </view>
  37. </viwe>
  38. </view>
  39. </scroll-view>
  40. <view class="empty" v-if="form.dbUsageRecordList.length==0">
  41. <img class="for-back-img" src="@/pages_manage/images/Version3.0/img_ysrygl_zwsj.png">
  42. <view>暂无数据</view>
  43. </view>
  44. <view class="btn">
  45. <view class="btn_l" @click="handleClick('QRcode')">使用</view>
  46. <view class="btn_r" @click="handleClick('outStock')">申请出库</view>
  47. </view>
  48. </view>
  49. </template>
  50. <script>
  51. import {gasDetailRecord,airbottleStockFindById,airbottleStockFindByBeaconTag} from '@/api/index.js'
  52. export default {
  53. name: "gasRecycle",
  54. data() {
  55. return {
  56. pageType:0,
  57. //列表请求参数
  58. getData:{
  59. pageNum:1,
  60. pageSize:10,
  61. },
  62. gasBottleLevel:uni.getStorageSync('gasBottleLevel'),// 气瓶级别
  63. gasBottleSpecification:uni.getStorageSync('gasBottleSpecification'), // 气瓶规格
  64. form:{
  65. },
  66. dataList:[],
  67. id:'',
  68. item:{},
  69. specificationName:{},
  70. }
  71. },
  72. onLoad(option) {
  73. if(option.id){
  74. this.id=option.id;
  75. }
  76. },
  77. onShow() {
  78. },
  79. mounted(){
  80. this.getInfo();
  81. this.getList();
  82. },
  83. methods: {
  84. //滚动加载事件
  85. scrollGet(){
  86. if(this.getData.getType){
  87. this.getData.pageNum += 1;
  88. this.getList();
  89. }
  90. },
  91. handleClick(doType) {
  92. let _this=this;
  93. if(doType=='outStock'){//申请出库
  94. uni.navigateTo({
  95. url:'/pages/gasBottle/gasOutstock/gasOutstock?id='+this.form.id
  96. });
  97. }else if(doType=='QRcode'){//使用
  98. this.getBeaconTag();
  99. }
  100. },
  101. //校验当前信标是否可用
  102. async getBeaconTag(){
  103. let self=this;
  104. const {data} = await airbottleStockFindByBeaconTag({BeaconTag:self.form.beaconTag});
  105. if(data.code==200){
  106. uni.navigateTo({
  107. url:'/pages/gasBottle/gasUse/gasUse?beaconTag='+self.form.beaconTag
  108. });
  109. }else{
  110. }
  111. },
  112. //使用记录详情
  113. useRecordInfo(d){
  114. uni.navigateTo({
  115. url:'/pages/gasBottle/stockList/useRecordDetail?id='+d.id
  116. });
  117. },
  118. //标签绑定
  119. binding(){
  120. uni.navigateTo({
  121. url:'/pages/gasBottle/stockList/gasListBinding?form='+encodeURIComponent(JSON.stringify(this.form))
  122. });
  123. },
  124. //查询详情
  125. async getInfo(){
  126. let self = this;
  127. const {data} = await airbottleStockFindById({id:this.id});
  128. if(data.code == 200){
  129. for(let b=0;b<this.gasBottleSpecification.length;b++){
  130. if(this.gasBottleSpecification[b].dictValue==data.data.size){
  131. data.data.sizeName=this.gasBottleSpecification[b].dictLabel
  132. }
  133. }
  134. for(let t=0;t<this.gasBottleLevel.length;t++){
  135. if(this.gasBottleLevel[t].dictValue==data.data.level){
  136. data.data.levelName=this.gasBottleLevel[t].dictLabel
  137. }
  138. }
  139. this.form=data.data;
  140. }
  141. },
  142. //获取列表数据
  143. async getList(){
  144. let _this = this;
  145. const {data} = await gasDetailRecord(this.getData);
  146. if(data.code==200){
  147. let res=data.rows
  148. _this.dataList=res
  149. }
  150. },
  151. }
  152. }
  153. </script>
  154. <style lang="stylus" scoped>
  155. #gasRecycle {
  156. height: auto;
  157. width: 100%;
  158. flex :1;
  159. display flex;
  160. flex-direction column
  161. overflow hidden;
  162. padding-bottom: 220rpx;
  163. .empty{
  164. text-align: center;
  165. margin-top: 46rpx;
  166. >img{
  167. width: 336rpx;
  168. height: 222rpx;
  169. margin-left: 208rpx;
  170. }
  171. >view{
  172. font-size: 30rpx;
  173. font-family: PingFang SC;
  174. font-weight: 500;
  175. color: #E0E0E0;
  176. line-height: 30rpx;
  177. margin-top: 48rpx;
  178. }
  179. }
  180. .title{
  181. width: 750rpx;
  182. height: 100rpx;
  183. background: #FFFFFF;
  184. font-size: 28rpx;
  185. font-family: PingFang SC;
  186. font-weight: 500;
  187. color: #333333;
  188. line-height: 100rpx;
  189. padding-left: 40rpx;
  190. }
  191. .register_li{
  192. background #fff;
  193. border-radius:20rpx;
  194. margin:20rpx 20rpx 0;
  195. padding:20rpx 0;
  196. box-sizing: border-box;
  197. .register_li_min{
  198. height: 100rpx;
  199. margin:0 26rpx;
  200. display flex;
  201. align-items center;
  202. border-bottom: 1px solid #F5F5F5;
  203. .icon_img{
  204. width: 30rpx;
  205. height: 30rpx;
  206. margin-right: 12rpx;
  207. }
  208. view{
  209. //width:140rpx;
  210. font-size: 28rpx;
  211. font-family: PingFang SC;
  212. font-weight: 500;
  213. color: #999999;
  214. }
  215. >input{
  216. flex:1;
  217. text-align: right;
  218. font-size: 24rpx;
  219. font-family: PingFang SC;
  220. font-weight: 500;
  221. color: #333333;
  222. }
  223. .binding{
  224. font-size: 24rpx;
  225. font-family: PingFang SC;
  226. font-weight: 500;
  227. color: #0183FA;
  228. line-height: 24rpx;
  229. margin-left: 24rpx;
  230. }
  231. }
  232. .issue_li{
  233. margin:34rpx 26rpx 0;
  234. display flex;
  235. border-bottom: 1px solid #F5F5F5;
  236. view:nth-child(1){
  237. color:red;
  238. line-height:28rpx;
  239. margin-right: 12rpx;
  240. }
  241. view:nth-child(2){
  242. //width:140rpx;
  243. font-size: 28rpx;
  244. font-family: PingFang SC;
  245. font-weight: 500;
  246. color: #999999;
  247. }
  248. .issue_img{
  249. width: 210rpx;
  250. height: 210rpx;
  251. border-radius: 10rpx;
  252. margin-left:250rpx;
  253. }
  254. }
  255. }
  256. .scroll-box{
  257. // flex:1;
  258. overflow-y scroll;
  259. margin-top: 20rpx;
  260. .small_title{
  261. font-size: 30rpx;
  262. font-family: PingFang SC;
  263. font-weight: 500;
  264. color: #333333;
  265. line-height: 80rpx;
  266. margin: 0 40rpx;
  267. display: flex;
  268. justify-content: space-between;
  269. align-items: center;
  270. >img{
  271. width: 24rpx;
  272. height: 24rpx;
  273. }
  274. }
  275. .register_li2{
  276. overflow: hidden
  277. background #fff;
  278. border-radius:20rpx;
  279. margin:0 20rpx 0;
  280. padding:0 20rpx;
  281. box-sizing: border-box;
  282. .register_li2_min{
  283. .register_li2_t{
  284. font-size: 28rpx;
  285. font-family: PingFang SC;
  286. font-weight: 500;
  287. color: #333333;
  288. line-height: 28rpx;
  289. margin-top: 28rpx;
  290. }
  291. .register_li2_b{
  292. display: flex;
  293. justify-content: flex-start;
  294. align-items: center;
  295. margin-top: 42rpx;
  296. padding-bottom: 28rpx;
  297. >img{
  298. width: 28rpx;
  299. height: 28rpx;
  300. margin-right: 10rpx;
  301. }
  302. >view{
  303. font-size: 26rpx;
  304. font-family: PingFang SC;
  305. font-weight: 500;
  306. color: #666666;
  307. line-height: 26rpx;
  308. }
  309. >view:nth-child(1){
  310. width: 200rpx;
  311. }
  312. >view:nth-child(2){
  313. flex: 1;
  314. }
  315. }
  316. .register_li2_b2{
  317. display: flex;
  318. justify-content: flex-start;
  319. align-items: center;
  320. padding-bottom: 28rpx;
  321. border-bottom: 1rpx solid #f5f5f5;
  322. >img{
  323. width: 28rpx;
  324. height: 28rpx;
  325. margin-right: 10rpx;
  326. }
  327. >view{
  328. font-size: 26rpx;
  329. font-family: PingFang SC;
  330. font-weight: 500;
  331. color: #666666;
  332. line-height: 26rpx;
  333. }
  334. >view:nth-child(1){
  335. width: 200rpx;
  336. }
  337. >view:nth-child(2){
  338. flex: 1;
  339. }
  340. }
  341. }
  342. }
  343. }
  344. /* 按钮 */
  345. .btn{
  346. display: flex;
  347. position: fixed;
  348. bottom: 40rpx;
  349. left: 50rpx;
  350. .btn_l{
  351. width: 324rpx;
  352. height: 100rpx;
  353. background: #F28E26;
  354. border-radius: 50rpx 0rpx 0rpx 50rpx;
  355. font-size: 28rpx;
  356. font-family: PingFang SC;
  357. font-weight: 500;
  358. color: #FFFFFF;
  359. line-height: 100rpx;
  360. text-align: center;
  361. }
  362. .btn_r{
  363. width: 324rpx;
  364. height: 100rpx;
  365. background: #0183FA;
  366. border-radius: 0rpx 50rpx 50rpx 0rpx;
  367. font-size: 28rpx;
  368. font-family: PingFang SC;
  369. font-weight: 500;
  370. color: #FFFFFF;
  371. line-height: 100rpx;
  372. text-align: center;
  373. }
  374. }
  375. }
  376. </style>