gasManage.vue 7.8 KB

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