gasManage.vue 8.3 KB

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