gasManage.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  1. <!-- 回收申请 -->
  2. <template>
  3. <view id="register">
  4. <view class="register_li" >
  5. <view class="register_li_min" @click="handleClick('audit')" style="border-bottom:none;">
  6. <view>资格审核</view>
  7. <view></view>
  8. <img src="@/images/basicsModules/icon_04.png">
  9. </view>
  10. </view>
  11. <view class="register_li">
  12. <view class="register_li_min" @click="handleClick('examination')">
  13. <view>资格申请</view>
  14. <view></view>
  15. <img src="@/images/basicsModules/icon_04.png">
  16. </view>
  17. <view class="register_li_min" @click="handleClick('gas')" style="border: none;">
  18. <view>用气申请</view>
  19. <view></view>
  20. <img src="@/images/basicsModules/icon_04.png">
  21. </view>
  22. </view>
  23. <view v-if="dataList2.length>0" class="small_title" @click="handleClick('gasList')">气瓶信息<img src="@/images/basicsModules/icon_wdwg_gd.png"></view>
  24. <view v-if="dataList2.length>0" class="register_li2" >
  25. <viwe class="register_li2_min" @tap="goInfo2(item2)" v-for="(item2,index2) in dataList2" :key="index2">
  26. <view class="register_li2_t">{{item2.airName}}-{{item2.configName}}</view>
  27. <view class="register_li2_b">
  28. <img src="@/pages_manage/images/icon_qpgl_syl.png">
  29. <view>余量: {{item2.pressure==null?'-':item2.pressure}}Mpa</view>
  30. <img src="@/images/basicsModules/icon_wtzg_sj.png">
  31. <view>最近使用时间: {{item2.useTimeApp==null?'-':item2.useTimeApp}}</view>
  32. </view>
  33. </viwe>
  34. </view>
  35. <view v-if="dataList.length>0" class="small_title" @click="handleClick('useRecord')">使用记录<img src="@/images/basicsModules/icon_wdwg_gd.png"></view>
  36. <view v-if="dataList.length>0" class="register_li2">
  37. <viwe class="register_li2_min" @tap="goInfo(item)" v-for="(item,index) in dataList" :key="index">
  38. <view class="register_li2_t">{{item.airName}}-{{item.configName}}</view>
  39. <view class="register_li2_b" style="border:none">
  40. <img src="@/pages_manage/images/icon_qpgl_syl.png">
  41. <view>使用量: {{item.pressure==null?'-':item.pressure}}Mpa</view>
  42. </view>
  43. <view class="register_li2_b2" style="border-bottom: 1rpx solid #f5f5f5;">
  44. <img src="@/images/basicsModules/icon_wtzg_sj.png">
  45. <view>使用时间: {{item.useTimeApp==null?'-':item.useTimeApp}} - {{item.backTimeApp==null?'-':item.backTimeApp}}</view>
  46. </view>
  47. </viwe>
  48. </view>
  49. <view class="btn" v-if="userApplyNumberYq || userApplyNumberZg">
  50. <view class="btn_l" @click="handleClick('gasApply')">气瓶申请</view>
  51. <view class="btn_r" @click="handleClick('QRcode')">使用/归还</view>
  52. </view>
  53. </view>
  54. </template>
  55. <script>
  56. import {useRecordList,listuseRecordByUserId,getUserApplyCount,useRegisterDetail } from '@/api/apiDemo/index.js'
  57. import { config } from '@/api/request/config.js'
  58. export default {
  59. data() {
  60. return {
  61. form:{
  62. name:'',
  63. },
  64. //列表请求参数
  65. getData:{
  66. pageNum:1,
  67. pageSize:3,
  68. },
  69. dataList:[],
  70. dataList2:[],
  71. yqCount:null,
  72. zgCount:null,
  73. userApplyNumberYq:null,//大于0显示使用人,等于零显示规格
  74. userApplyNumberZg:null,//大于0显示使用人,等于零显示规格
  75. electronicTag:'',
  76. }
  77. },
  78. onLoad(option) {
  79. },
  80. onShow(){
  81. },
  82. methods: {
  83. handleClick(doType) {
  84. let _this=this;
  85. if(doType=='examination'){//资格申请
  86. uni.navigateTo({
  87. url:'/pages_manage/gasBottle/examination/examination'
  88. });
  89. }else if(doType=='gas'){//用气申请
  90. uni.navigateTo({
  91. url:'/pages_manage/gasBottle/useGasApply/useGasApply'
  92. });
  93. }else if(doType=='audit'){//资格审核
  94. uni.navigateTo({
  95. url:'/pages_manage/gasBottle/aptitudeAudit/aptitudeAudit'
  96. });
  97. }else if(doType=='useRecord'){//使用记录
  98. uni.navigateTo({
  99. url:'/pages_manage/gasBottle/useRecord/useRecord'
  100. });
  101. }else if(doType=='gasApply'){//气瓶申请
  102. uni.navigateTo({
  103. url:'/pages_manage/gasBottle/gasApply/gasApply'
  104. });
  105. }else if(doType=='gasList'){//气瓶列表
  106. uni.navigateTo({
  107. url:'/pages_manage/gasBottle/gasList/gasList'
  108. });
  109. }else if(doType=='QRcode'){//
  110. uni.scanCode({
  111. onlyFromCamera: true,
  112. success: function (res) {
  113. _this.electronicTag=res.result
  114. _this.getInfo()
  115. }
  116. });
  117. }
  118. },
  119. //使用记录跳转详情
  120. goInfo(d){
  121. uni.navigateTo({
  122. url:'/pages_manage/gasBottle/useRecord/useRecordDetail?item='+encodeURIComponent(JSON.stringify(d))
  123. });
  124. },
  125. //气瓶信息跳转详情
  126. goInfo2(d){
  127. uni.navigateTo({
  128. url:'/pages_manage/gasBottle/gasList/gasListDetail?item='+encodeURIComponent(JSON.stringify(d))
  129. });
  130. },
  131. async getInfo(){
  132. let _this=this;
  133. const {data} = await useRegisterDetail({electronicTag:_this.electronicTag});
  134. if(data.code==200 && data.data){
  135. let res = data.data;
  136. let userId=uni.getStorageSync('userId');
  137. if(res.currentStatus==4 && res.currentUserId==userId){
  138. uni.navigateTo({
  139. url:'/pages_manage/gasBottle/useRegister/giveRegister?code='+_this.electronicTag
  140. });
  141. }else{
  142. uni.navigateTo({
  143. url:'/pages_manage/gasBottle/useRegister/useRegister?code='+_this.electronicTag
  144. });
  145. }
  146. }else{
  147. uni.showToast({
  148. title: '当前气瓶不存在!',
  149. icon:"none",
  150. mask:true,
  151. duration: 2000
  152. });
  153. }
  154. },
  155. //获取使用记录列表
  156. async getList(){
  157. let _this = this;
  158. const {data} = await useRecordList(_this.getData)
  159. if(data.code==200){
  160. let res=data.rows
  161. _this.dataList=res
  162. }
  163. },
  164. //获取气瓶信息列表
  165. async getList2(){
  166. let _this = this;
  167. const {data} = await listuseRecordByUserId(_this.getData)
  168. if(data.code==200){
  169. let res=data.rows
  170. _this.dataList2=res
  171. }
  172. },
  173. //获取数量
  174. async getCount(){
  175. let _this = this;
  176. const {data} = await getUserApplyCount()
  177. if(data.code==200){
  178. let res=data.data
  179. _this.yqCount=res.yqCount;
  180. _this.zgCount=res.zgCount;
  181. _this.userApplyNumberYq=res.userApplyNumberYq;
  182. _this.userApplyNumberZg=res.userApplyNumberZg;
  183. }
  184. },
  185. },
  186. mounted() {
  187. this.getList();
  188. this.getList2();
  189. this.getCount();
  190. }
  191. }
  192. </script>
  193. <style lang="stylus" scoped>
  194. #register{
  195. height:auto;
  196. width:100%;
  197. display flex;
  198. flex-direction column;
  199. padding-bottom: 220rpx;
  200. .register_li{
  201. background #fff;
  202. border-radius:20rpx;
  203. margin:20rpx 20rpx 0;
  204. padding:20rpx 0;
  205. box-sizing: border-box;
  206. .register_li_min{
  207. margin:0 26rpx;
  208. display flex;
  209. align-items center;
  210. border-bottom: 1px solid #F5F5F5;
  211. view{
  212. line-height:100rpx;
  213. }
  214. view:nth-child(1){
  215. font-size: 28rpx;
  216. font-family: PingFang SC;
  217. font-weight: 500;
  218. color: #333333;
  219. line-height:100rpx;
  220. }
  221. view:nth-child(2){
  222. flex:1;
  223. color: #0183FA;
  224. text-align: right;
  225. margin-right: 38rpx;
  226. }
  227. >img{
  228. width: 12rpx;
  229. height: 24rpx;
  230. }
  231. }
  232. }
  233. .small_title{
  234. font-size: 30rpx;
  235. font-family: PingFang SC;
  236. font-weight: 500;
  237. color: #999999;
  238. line-height: 100rpx;
  239. margin: 0 40rpx;
  240. display: flex;
  241. justify-content: space-between;
  242. align-items: center;
  243. >img{
  244. width: 24rpx;
  245. height: 24rpx;
  246. }
  247. }
  248. .register_li2{
  249. background #fff;
  250. border-radius:20rpx;
  251. margin:0 20rpx 0;
  252. padding:0 20rpx;
  253. box-sizing: border-box;
  254. .register_li2_min{
  255. .register_li2_t{
  256. font-size: 28rpx;
  257. font-family: PingFang SC;
  258. font-weight: 500;
  259. color: #333333;
  260. line-height: 28rpx;
  261. margin-top: 28rpx;
  262. }
  263. .register_li2_b{
  264. display: flex;
  265. justify-content: flex-start;
  266. align-items: center;
  267. margin-top: 42rpx;
  268. padding-bottom: 28rpx;
  269. border-bottom: 1rpx solid #f5f5f5;
  270. >img{
  271. width: 28rpx;
  272. height: 28rpx;
  273. margin-right: 10rpx;
  274. }
  275. >view{
  276. font-size: 24rpx;
  277. font-family: PingFang SC;
  278. font-weight: 500;
  279. color: #666666;
  280. line-height: 26rpx;
  281. }
  282. >view:nth-of-type(1){
  283. width: 180rpx;
  284. }
  285. >view:nth-child(2){
  286. }
  287. }
  288. .register_li2_b2{
  289. display: flex;
  290. justify-content: flex-start;
  291. align-items: center;
  292. padding-bottom: 28rpx;
  293. >img{
  294. width: 28rpx;
  295. height: 28rpx;
  296. margin-right: 10rpx;
  297. }
  298. >view{
  299. font-size: 24rpx;
  300. font-family: PingFang SC;
  301. font-weight: 500;
  302. color: #666666;
  303. line-height: 26rpx;
  304. }
  305. >view:nth-child(1){
  306. width: 200rpx;
  307. }
  308. >view:nth-child(2){
  309. flex: 1;
  310. }
  311. }
  312. }
  313. }
  314. /* 按钮 */
  315. .btn{
  316. display: flex;
  317. position: fixed;
  318. bottom: 0;
  319. .btn_l{
  320. width: 250rpx;
  321. background: #F28E26;
  322. font-size: 28rpx;
  323. font-family: PingFang SC;
  324. font-weight: 500;
  325. color: #FFFFFF;
  326. line-height: 100rpx;
  327. text-align: center;
  328. }
  329. .btn_r{
  330. width: 500rpx;
  331. background: #0183FA;
  332. font-size: 28rpx;
  333. font-family: PingFang SC;
  334. font-weight: 500;
  335. color: #FFFFFF;
  336. line-height: 100rpx;
  337. text-align: center;
  338. }
  339. }
  340. }
  341. /deep/.input-value-border{
  342. display :none !important;
  343. }
  344. </style>