gasManage.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  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/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/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/icon_04.png">
  21. </view>
  22. </view>
  23. <view v-if="dataList2.length>0" class="small_title" @click="handleClick('gasList')">气瓶信息<img src="@/images/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="@/images/Version3.0/icon_qpgl_syl.png">
  29. <view>余量: {{item2.pressure==null?'-':item2.pressure}}Mpa</view>
  30. <img src="@/images/Version2.2/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/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="@/images/Version3.0/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/Version2.2/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/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/examination/examination'
  88. });
  89. }else if(doType=='gas'){//用气申请
  90. uni.navigateTo({
  91. url:'/pages_manage/useGasApply/useGasApply'
  92. });
  93. }else if(doType=='audit'){//资格审核
  94. uni.navigateTo({
  95. url:'/pages_manage/aptitudeAudit/aptitudeAudit'
  96. });
  97. }else if(doType=='useRecord'){//使用记录
  98. uni.navigateTo({
  99. url:'/pages_manage/useRecord/useRecord'
  100. });
  101. }else if(doType=='gasApply'){//气瓶申请
  102. uni.navigateTo({
  103. url:'/pages_manage/gasApply/gasApply'
  104. });
  105. }else if(doType=='gasList'){//气瓶列表
  106. uni.navigateTo({
  107. url:'/pages_manage/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/useRecord/useRecordDetail?item='+encodeURIComponent(JSON.stringify(d))
  123. });
  124. },
  125. //气瓶信息跳转详情
  126. goInfo2(d){
  127. uni.navigateTo({
  128. url:'/pages_manage/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){
  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/useRegister/giveRegister?code='+_this.electronicTag
  140. });
  141. }else{
  142. uni.navigateTo({
  143. url:'/pages_manage/useRegister/useRegister?code='+_this.electronicTag
  144. });
  145. }
  146. }
  147. },
  148. //获取使用记录列表
  149. async getList(){
  150. let _this = this;
  151. const {data} = await useRecordList(_this.getData)
  152. if(data.code==200){
  153. let res=data.rows
  154. _this.dataList=res
  155. }
  156. },
  157. //获取气瓶信息列表
  158. async getList2(){
  159. let _this = this;
  160. const {data} = await listuseRecordByUserId(_this.getData)
  161. if(data.code==200){
  162. let res=data.rows
  163. _this.dataList2=res
  164. }
  165. },
  166. //获取数量
  167. async getCount(){
  168. let _this = this;
  169. const {data} = await getUserApplyCount()
  170. if(data.code==200){
  171. let res=data.data
  172. _this.yqCount=res.yqCount;
  173. _this.zgCount=res.zgCount;
  174. _this.userApplyNumberYq=res.userApplyNumberYq;
  175. _this.userApplyNumberZg=res.userApplyNumberZg;
  176. }
  177. },
  178. },
  179. mounted() {
  180. this.getList();
  181. this.getList2();
  182. this.getCount();
  183. }
  184. }
  185. </script>
  186. <style lang="stylus" scoped>
  187. #register{
  188. height:auto;
  189. width:100%;
  190. display flex;
  191. flex-direction column;
  192. padding-bottom: 220rpx;
  193. .register_li{
  194. background #fff;
  195. border-radius:20rpx;
  196. margin:20rpx 20rpx 0;
  197. padding:20rpx 0;
  198. box-sizing: border-box;
  199. .register_li_min{
  200. margin:0 26rpx;
  201. display flex;
  202. align-items center;
  203. border-bottom: 1px solid #F5F5F5;
  204. view{
  205. line-height:100rpx;
  206. }
  207. view:nth-child(1){
  208. font-size: 28rpx;
  209. font-family: PingFang SC;
  210. font-weight: 500;
  211. color: #333333;
  212. line-height:100rpx;
  213. }
  214. view:nth-child(2){
  215. flex:1;
  216. color: #0183FA;
  217. text-align: right;
  218. margin-right: 38rpx;
  219. }
  220. >img{
  221. width: 12rpx;
  222. height: 24rpx;
  223. }
  224. }
  225. }
  226. .small_title{
  227. font-size: 30rpx;
  228. font-family: PingFang SC;
  229. font-weight: 500;
  230. color: #999999;
  231. line-height: 100rpx;
  232. margin: 0 40rpx;
  233. display: flex;
  234. justify-content: space-between;
  235. align-items: center;
  236. >img{
  237. width: 24rpx;
  238. height: 24rpx;
  239. }
  240. }
  241. .register_li2{
  242. background #fff;
  243. border-radius:20rpx;
  244. margin:0 20rpx 0;
  245. padding:0 20rpx;
  246. box-sizing: border-box;
  247. .register_li2_min{
  248. .register_li2_t{
  249. font-size: 28rpx;
  250. font-family: PingFang SC;
  251. font-weight: 500;
  252. color: #333333;
  253. line-height: 28rpx;
  254. margin-top: 28rpx;
  255. }
  256. .register_li2_b{
  257. display: flex;
  258. justify-content: flex-start;
  259. align-items: center;
  260. margin-top: 42rpx;
  261. padding-bottom: 28rpx;
  262. border-bottom: 1rpx solid #f5f5f5;
  263. >img{
  264. width: 28rpx;
  265. height: 28rpx;
  266. margin-right: 10rpx;
  267. }
  268. >view{
  269. font-size: 24rpx;
  270. font-family: PingFang SC;
  271. font-weight: 500;
  272. color: #666666;
  273. line-height: 26rpx;
  274. }
  275. >view:nth-of-type(1){
  276. width: 180rpx;
  277. }
  278. >view:nth-child(2){
  279. }
  280. }
  281. .register_li2_b2{
  282. display: flex;
  283. justify-content: flex-start;
  284. align-items: center;
  285. padding-bottom: 28rpx;
  286. >img{
  287. width: 28rpx;
  288. height: 28rpx;
  289. margin-right: 10rpx;
  290. }
  291. >view{
  292. font-size: 24rpx;
  293. font-family: PingFang SC;
  294. font-weight: 500;
  295. color: #666666;
  296. line-height: 26rpx;
  297. }
  298. >view:nth-child(1){
  299. width: 200rpx;
  300. }
  301. >view:nth-child(2){
  302. flex: 1;
  303. }
  304. }
  305. }
  306. }
  307. /* 按钮 */
  308. .btn{
  309. display: flex;
  310. position: fixed;
  311. bottom: 0;
  312. .btn_l{
  313. width: 250rpx;
  314. background: #F28E26;
  315. font-size: 28rpx;
  316. font-family: PingFang SC;
  317. font-weight: 500;
  318. color: #FFFFFF;
  319. line-height: 100rpx;
  320. text-align: center;
  321. }
  322. .btn_r{
  323. width: 500rpx;
  324. background: #0183FA;
  325. font-size: 28rpx;
  326. font-family: PingFang SC;
  327. font-weight: 500;
  328. color: #FFFFFF;
  329. line-height: 100rpx;
  330. text-align: center;
  331. }
  332. }
  333. }
  334. /deep/.input-value-border{
  335. display :none !important;
  336. }
  337. </style>