gasManage.vue 8.6 KB

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