gasManage.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  1. <!-- 用气管理 -->
  2. <template>
  3. <view class="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.usageStartTime==null?'-':item.usageStartTime}} - {{item.usageEndTime==null?'-':item.usageEndTime}}</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,airbottleStockFindByBeaconTag,airbottleUsageRecordList,warningNoticeLogGetDisposeCount,getDicts} 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.warningNoticeLogGetDisposeCount()
  65. this.getList();
  66. this.bottleColourFun();
  67. },
  68. methods: {
  69. handleClick(doType) {
  70. let _this=this;
  71. if(doType=='stockList'){//库存列表
  72. uni.redirectTo({
  73. url:'/pages/gasBottle/stockList/stockList'
  74. });
  75. }else if(doType=='earlyWarning'){//预警记录
  76. uni.navigateTo({
  77. url:'/pages/earlyWarningManage/earlyWarningList'
  78. });
  79. }else if(doType=='gasEnter'){//气瓶入库
  80. uni.navigateTo({
  81. url:'/pages/gasBottle/stockList/storageAdd'
  82. });
  83. }if(doType=='useRecord'){//使用记录
  84. uni.navigateTo({
  85. url:'/pages/gasBottle/gasManage/useRecordList'
  86. });
  87. }else if(doType=='QRcode'){//使用
  88. uni.scanCode({
  89. onlyFromCamera: true,
  90. success: function (res) {
  91. _this.getBeaconTag(res.result)
  92. }
  93. });
  94. }
  95. },
  96. //气瓶颜色
  97. async bottleColourFun(){
  98. const {data} = await getDicts('bottle_db_colour');
  99. if(data.code == 200){
  100. if(data.data[0]){
  101. uni.setStorageSync('bottleColor', data.data)
  102. }
  103. }
  104. },
  105. //使用记录跳转详情
  106. goInfo(d){
  107. uni.navigateTo({
  108. url:'/pages/gasBottle/stockList/useRecordDetail?id='+d.id
  109. });
  110. },
  111. async getBeaconTag(result){
  112. let _this=this;
  113. const {data} = await airbottleStockFindByBeaconTag({BeaconTag:result});
  114. if(data.code==200){
  115. uni.navigateTo({
  116. url:'/pages/gasBottle/gasUse/gasUse?beaconTag='+result
  117. });
  118. }
  119. },
  120. //气瓶预警
  121. async warningNoticeLogGetDisposeCount(){
  122. let self = this;
  123. const {data} = await warningNoticeLogGetDisposeCount();
  124. if(data.code==200){
  125. this.sirenNum=data.data;
  126. }
  127. },
  128. //获取使用记录列表
  129. async getList(){
  130. let _this = this;
  131. const {data} = await airbottleUsageRecordList(_this.getData)
  132. if(data.code==200){
  133. for(let i=0;i<data.data.records.length;i++){
  134. for(let b=0;b<this.gasBottleSpecification.length;b++){
  135. if(this.gasBottleSpecification[b].dictValue==data.data.records[i].size){
  136. data.data.records[i].sizeName=this.gasBottleSpecification[b].dictLabel
  137. }
  138. }
  139. for(let t=0;t<this.gasBottleLevel.length;t++){
  140. if(this.gasBottleLevel[t].dictValue==data.data.records[i].level){
  141. data.data.records[i].levelName=this.gasBottleLevel[t].dictLabel
  142. }
  143. }
  144. }
  145. _this.dataList=data.data.records
  146. }
  147. },
  148. },
  149. }
  150. </script>
  151. <style lang="stylus" scoped>
  152. .register{
  153. height:auto;
  154. width:100%;
  155. display flex;
  156. flex-direction column;
  157. padding-bottom: 220rpx;
  158. .register_li{
  159. background #fff;
  160. border-radius:20rpx;
  161. margin:20rpx 20rpx 0;
  162. padding:20rpx 0;
  163. box-sizing: border-box;
  164. .register_li_min{
  165. margin:0 26rpx;
  166. display flex;
  167. align-items center;
  168. border-bottom: 1px solid #F5F5F5;
  169. view{
  170. line-height:100rpx;
  171. }
  172. view:nth-child(1){
  173. font-size: 28rpx;
  174. font-family: PingFang SC;
  175. font-weight: 500;
  176. color: #333333;
  177. line-height:100rpx;
  178. }
  179. view:nth-child(2){
  180. flex:1;
  181. color: #0183FA;
  182. text-align: right;
  183. margin-right: 38rpx;
  184. .sirenNum{
  185. height: 40rpx;
  186. display: inline-block;
  187. font-size: 28rpx;
  188. font-family: PingFang SC;
  189. font-weight: 600;
  190. color: #D40000;
  191. // background: #D40000;
  192. border-radius: 50%;
  193. line-height: 40rpx;
  194. text-align: center;
  195. }
  196. }
  197. >img{
  198. width: 12rpx;
  199. height: 24rpx;
  200. }
  201. }
  202. }
  203. .small_title{
  204. font-size: 30rpx;
  205. font-family: PingFang SC;
  206. font-weight: 500;
  207. color: #999999;
  208. line-height: 100rpx;
  209. margin: 0 40rpx;
  210. display: flex;
  211. justify-content: space-between;
  212. align-items: center;
  213. >img{
  214. width: 24rpx;
  215. height: 24rpx;
  216. }
  217. }
  218. .register_li2{
  219. background #fff;
  220. border-radius:20rpx;
  221. margin:0 20rpx 0;
  222. padding:0 20rpx;
  223. box-sizing: border-box;
  224. .register_li2_min{
  225. .register_li2_t{
  226. font-size: 28rpx;
  227. font-family: PingFang SC;
  228. font-weight: 500;
  229. color: #333333;
  230. line-height: 28rpx;
  231. margin-top: 28rpx;
  232. }
  233. .register_li2_b{
  234. display: flex;
  235. justify-content: flex-start;
  236. align-items: center;
  237. margin-top: 42rpx;
  238. padding-bottom: 28rpx;
  239. border-bottom: 1rpx solid #f5f5f5;
  240. >img{
  241. width: 28rpx;
  242. height: 28rpx;
  243. margin-right: 10rpx;
  244. }
  245. >view{
  246. font-size: 24rpx;
  247. font-family: PingFang SC;
  248. font-weight: 500;
  249. color: #666666;
  250. line-height: 26rpx;
  251. }
  252. >view:nth-of-type(1){
  253. width: 280rpx;
  254. }
  255. >view:nth-child(2){
  256. }
  257. }
  258. .register_li2_b2{
  259. display: flex;
  260. justify-content: flex-start;
  261. align-items: center;
  262. padding-bottom: 28rpx;
  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-child(1){
  276. width: 200rpx;
  277. }
  278. >view:nth-child(2){
  279. flex: 1;
  280. }
  281. }
  282. }
  283. }
  284. /* 按钮 */
  285. .btn{
  286. display: flex;
  287. position: fixed;
  288. bottom: 40rpx;
  289. left: 50rpx;
  290. .btn_l{
  291. width: 324rpx;
  292. height: 100rpx;
  293. background: #F28E26;
  294. border-radius: 50rpx 0rpx 0rpx 50rpx;
  295. font-size: 28rpx;
  296. font-family: PingFang SC;
  297. font-weight: 500;
  298. color: #FFFFFF;
  299. line-height: 100rpx;
  300. text-align: center;
  301. }
  302. .btn_r{
  303. width: 324rpx;
  304. height: 100rpx;
  305. background: #0183FA;
  306. border-radius: 0rpx 50rpx 50rpx 0rpx;
  307. font-size: 28rpx;
  308. font-family: PingFang SC;
  309. font-weight: 500;
  310. color: #FFFFFF;
  311. line-height: 100rpx;
  312. text-align: center;
  313. }
  314. }
  315. }
  316. /deep/.input-value-border{
  317. display :none !important;
  318. }
  319. </style>