2 Commits 63daeaa39d ... 046e950dea

Author SHA1 Message Date
  lxh 046e950dea Merge branch 'master' of http://182.92.126.35:3000/msx/Vent-App 6 days ago
  lxh 1b6d56ed7c 瓦斯日报界面功能修改-提交 6 days ago
3 changed files with 65 additions and 50 deletions
  1. 5 5
      api/api.js
  2. 59 44
      pages/gasreport/gasreport.vue
  3. 1 1
      pages/index/index.vue

+ 5 - 5
api/api.js

@@ -90,7 +90,7 @@ const apiService = {
     return http.get(url);
   },
 
-  //瓦斯报列表数据
+  //瓦斯报列表数据
   getGas(params) {
     const url = buildURL(
       "/safety/gasDayReport/list",
@@ -98,7 +98,7 @@ const apiService = {
     );
     return http.get(url);
   },
-  //瓦斯报-下拉选项
+  //瓦斯报-下拉选项
   getSelect(params) {
     const url = buildURL(
       "/safety/gasDayReport/getGasAddressList",
@@ -106,15 +106,15 @@ const apiService = {
     );
     return http.get(url);
   },
-  //瓦斯报-新增保存
+  //瓦斯报-新增保存
   getAdd(params) {
     return http.post("/safety/gasDayReport/add", params);
   },
-  //瓦斯报-编辑保存
+  //瓦斯报-编辑保存
   getEdit(params) {
     return http.post("/safety/gasDayReport/edit", params);
   },
-  //瓦斯报-删除
+  //瓦斯报-删除
   delGas(params) {
     const url = buildURL("/safety/gasDayReport/delete", params);
     return http.delete(url);

+ 59 - 44
pages/gasreport/gasreport.vue

@@ -1,6 +1,6 @@
 <template>
     <view class="gas-report" name="gasreport">
-        <u-navbar title="瓦斯报" :safeAreaInsetTop="true" leftIcon=""> </u-navbar>
+        <u-navbar title="瓦斯报" :safeAreaInsetTop="true" leftIcon=""> </u-navbar>
         <view class="gas-content">
             <!-- 瓦斯上报列表 -->
             <view v-if="!isShowAdd">
@@ -29,37 +29,37 @@
                             <view class="content-item">
                                 <view class="item-l">
                                     <view class="item-value">{{ item.timeNight1 || '--' }}</view>
-                                    <view class="item-label">夜班测时间一</view>
+                                    <view class="item-label">夜班测时间一</view>
                                 </view>
                                 <view class="item-c"></view>
                                 <view class="item-r">
                                     <view class="item-value">{{ item.timeNight2 || '--' }}</view>
-                                    <view class="item-label">夜班测时间二</view>
+                                    <view class="item-label">夜班测时间二</view>
                                 </view>
                             </view>
                             <view class="content-item">
                                 <view class="item-l">
                                     <view class="item-value">{{ item.timeEarly1 || '--' }}</view>
-                                    <view class="item-label">早班测时间一</view>
+                                    <view class="item-label">早班测时间一</view>
                                 </view>
                                 <view class="item-c"></view>
                                 <view class="item-r">
                                     <view class="item-value">{{ item.timeEarly2 || '--' }}</view>
-                                    <view class="item-label">早班测时间二</view>
+                                    <view class="item-label">早班测时间二</view>
                                 </view>
                             </view>
                             <view class="content-item">
                                 <view class="item-l">
                                     <view class="item-value">{{ item.timeNoon1 || '--' }}</view>
-                                    <view class="item-label">中班测时间一</view>
+                                    <view class="item-label">中班测时间一</view>
                                 </view>
                                 <view class="item-c"></view>
                                 <view class="item-r">
                                     <view class="item-value">{{ item.timeNoon2 || '--' }}</view>
-                                    <view class="item-label">中班测时间二</view>
+                                    <view class="item-label">中班测时间二</view>
                                 </view>
                             </view>
-                         
+
                         </view>
 
                     </view>
@@ -114,29 +114,30 @@
                         <view class="dialog-item">
                             <text class="dialog-label">CH₄:</text>
                             <u--input inputAlign="center" :disabled="isDisabled" v-model="formState.ch4"
-                                placeholder="请输入"></u--input>
+                                :placeholder="isRule2 ? '请输入' : '数据有误'" type="number" @blur="getBlurCH4"
+                                :placeholderStyle="isRule2 ? 'color:#c0c4cc' : 'color:#ff0000'"></u--input>
                         </view>
                         <view class="dialog-item">
                             <text class="dialog-label">CO₂:</text>
                             <u--input inputAlign="center" :disabled="isDisabled" v-model="formState.co2"
-                                :placeholder="isRule ? '请输入' : '请输入偶数'" type="number" @blur="getBlurCO2"
+                                :placeholder="isRule ? '请输入' : '数据有误'" type="number" @blur="getBlurCO2"
                                 :placeholderStyle="isRule ? 'color:#c0c4cc' : 'color:#ff0000'"></u--input>
                         </view>
                         <view class="dialog-item">
                             <text class="dialog-label">CO:</text>
                             <u--input inputAlign="center" :disabled="isDisabled" v-model="formState.co"
-                                :placeholder="isRule14 ? '请输入' : '最大可输入值为24'"
+                                :placeholder="isRule14 ? '请输入' : '数据有误'"
                                 :placeholderStyle="isRule14 ? 'color:#c0c4cc' : 'color:#ff0000'" type="number"
                                 @blur="getBlurCO"></u--input>
                         </view>
                         <view class="dialog-item">
                             <text class="dialog-label">O₂:</text>
-                            <u--input inputAlign="center" :disabled="isDisabled" v-model="formState.o2"
+                            <u--input inputAlign="center" :disabled="isDisabled" type="number" v-model="formState.o2"
                                 placeholder="请输入"></u--input>
                         </view>
                         <view class="dialog-item">
                             <text class="dialog-label">温度:</text>
-                            <u--input inputAlign="center" :disabled="isDisabled" v-model="formState.temp"
+                            <u--input inputAlign="center" :disabled="isDisabled" type="number" v-model="formState.temp"
                                 placeholder="请输入"></u--input>
                         </view>
                     </view>
@@ -144,18 +145,20 @@
                         <div class="dialog-title">三对照数据</div>
                         <view class="dialog-item">
                             <text class="dialog-label">甲烷传感器:</text>
-                            <u--input inputAlign="center" :disabled="isDisabled" v-model="formState.jw"
+                            <!-- <u--input inputAlign="center" :disabled="isDisabled" type="number" v-model="formState.jw"
+                                placeholder="请输入"></u--input> -->
+                                <u--input inputAlign="center" :disabled="isDisabled" type="number" v-model="formState.ch4"
                                 placeholder="请输入"></u--input>
                         </view>
                         <view class="dialog-item">
                             <text class="dialog-label">光瓦测量数据:</text>
                             <u--input inputAlign="center" :disabled="isDisabled" v-model="formState.gw"
-                                :placeholder="isRule1 ? '请输入' : '请输入偶数'" type="number" @blur="getBlur"
+                                :placeholder="isRule1 ? '请输入' : '数据有误'" type="number" @blur="getBlur"
                                 :placeholderStyle="isRule1 ? 'color:#c0c4cc' : 'color:#ff0000'"></u--input>
                         </view>
                         <view class="dialog-item">
                             <text class="dialog-label">便携仪测量数据:</text>
-                            <u--input inputAlign="center" :disabled="isDisabled" v-model="formState.bxy"
+                            <u--input inputAlign="center" :disabled="isDisabled" type="number" v-model="formState.bxy"
                                 placeholder="请输入"></u--input>
                         </view>
 
@@ -199,6 +202,7 @@ export default {
             isRule: true,
             isRule1: true,
             isRule14: true,
+            isRule2: true,
             //新增参数信息
             isShowAdd: false,//是否显示新增弹窗
 
@@ -241,7 +245,7 @@ export default {
     methods: {
         //班次下拉选项切换
         changeBc(e) {
-            let that=this
+            let that = this
             console.log(e, '班次----------')
             this.formState.bc = e
             if (that.formState.bc == '早班' && that.formState.count == '第一次') {
@@ -329,7 +333,7 @@ export default {
                     that.isDisabled = false
                 }
             } else if (that.formState.bc == '中班' && that.formState.count == '第一次') {
-                if (that.saveShowList.bxySdzNoon1 || that.saveShowList.ch4Noon1 || that.saveShowList.co2Noon1 || that.saveShowList.coNoon1 || that.saveShowList.gwSdzNoon1 || that.saveShowList.jwSdzNoon1 || that.saveShowList.o2Noon1 || that.saveShowList.tnoon1 ) {
+                if (that.saveShowList.bxySdzNoon1 || that.saveShowList.ch4Noon1 || that.saveShowList.co2Noon1 || that.saveShowList.coNoon1 || that.saveShowList.gwSdzNoon1 || that.saveShowList.jwSdzNoon1 || that.saveShowList.o2Noon1 || that.saveShowList.tnoon1) {
                     that.formState = {
                         id: that.saveShowList.id || '',
                         bc: that.formState.bc,
@@ -345,7 +349,7 @@ export default {
                         gw: that.saveShowList.gwSdzNoon1 || '',
                         bxy: that.saveShowList.bxySdzNoon1 || '',
                         tbrq: that.formState.tbrq,
-                        temp: that.saveShowList.tnoon1  || '',
+                        temp: that.saveShowList.tnoon1 || '',
                         mcgzm: that.formState.mcgzm,
                     }
                     that.isDisabled = true
@@ -587,7 +591,7 @@ export default {
                     that.isDisabled = false
                 }
             } else if (that.formState.bc == '中班' && that.formState.count == '第一次') {
-                if (that.saveShowList.bxySdzNoon1 || that.saveShowList.ch4Noon1 || that.saveShowList.co2Noon1 || that.saveShowList.coNoon1 || that.saveShowList.gwSdzNoon1 || that.saveShowList.jwSdzNoon1 || that.saveShowList.o2Noon1 || that.saveShowList.tnoon1 ) {
+                if (that.saveShowList.bxySdzNoon1 || that.saveShowList.ch4Noon1 || that.saveShowList.co2Noon1 || that.saveShowList.coNoon1 || that.saveShowList.gwSdzNoon1 || that.saveShowList.jwSdzNoon1 || that.saveShowList.o2Noon1 || that.saveShowList.tnoon1) {
                     that.formState = {
                         id: that.saveShowList.id || '',
                         bc: that.formState.bc,
@@ -603,7 +607,7 @@ export default {
                         gw: that.saveShowList.gwSdzNoon1 || '',
                         bxy: that.saveShowList.bxySdzNoon1 || '',
                         tbrq: that.formState.tbrq,
-                        temp: that.saveShowList.tnoon1  || '',
+                        temp: that.saveShowList.tnoon1 || '',
                         mcgzm: that.formState.mcgzm,
                     }
                     that.isDisabled = true
@@ -854,7 +858,7 @@ export default {
                                         that.isDisabled = false
                                     }
                                 } else if (that.formState.bc == '中班' && that.formState.count == '第一次') {
-                                    if (that.saveShowList.bxySdzNoon1 || that.saveShowList.ch4Noon1 || that.saveShowList.co2Noon1 || that.saveShowList.coNoon1 || that.saveShowList.gwSdzNoon1 || that.saveShowList.jwSdzNoon1 || that.saveShowList.o2Noon1 || that.saveShowList.tnoon1 ) {
+                                    if (that.saveShowList.bxySdzNoon1 || that.saveShowList.ch4Noon1 || that.saveShowList.co2Noon1 || that.saveShowList.coNoon1 || that.saveShowList.gwSdzNoon1 || that.saveShowList.jwSdzNoon1 || that.saveShowList.o2Noon1 || that.saveShowList.tnoon1) {
                                         that.formState = {
                                             id: that.saveShowList.id || '',
                                             bc: that.formState.bc,
@@ -870,7 +874,7 @@ export default {
                                             gw: that.saveShowList.gwSdzNoon1 || '',
                                             bxy: that.saveShowList.bxySdzNoon1 || '',
                                             tbrq: that.formState.tbrq,
-                                            temp: that.saveShowList.tnoon1  || '',
+                                            temp: that.saveShowList.tnoon1 || '',
                                             mcgzm: that.formState.mcgzm,
                                         }
                                         that.isDisabled = true
@@ -1157,7 +1161,7 @@ export default {
                                         that.isDisabled = false
                                     }
                                 } else if (that.formState.bc == '中班' && that.formState.count == '第一次') {
-                                    if (that.saveShowList.bxySdzNoon1 || that.saveShowList.ch4Noon1 || that.saveShowList.co2Noon1 || that.saveShowList.coNoon1 || that.saveShowList.gwSdzNoon1 || that.saveShowList.jwSdzNoon1 || that.saveShowList.o2Noon1 || that.saveShowList.tnoon1 ) {
+                                    if (that.saveShowList.bxySdzNoon1 || that.saveShowList.ch4Noon1 || that.saveShowList.co2Noon1 || that.saveShowList.coNoon1 || that.saveShowList.gwSdzNoon1 || that.saveShowList.jwSdzNoon1 || that.saveShowList.o2Noon1 || that.saveShowList.tnoon1) {
                                         that.formState = {
                                             id: that.saveShowList.id || '',
                                             bc: that.formState.bc,
@@ -1173,7 +1177,7 @@ export default {
                                             gw: that.saveShowList.gwSdzNoon1 || '',
                                             bxy: that.saveShowList.bxySdzNoon1 || '',
                                             tbrq: that.formState.tbrq,
-                                            temp: that.saveShowList.tnoon1  || '',
+                                            temp: that.saveShowList.tnoon1 || '',
                                             mcgzm: that.formState.mcgzm,
                                         }
                                         that.isDisabled = true
@@ -1393,6 +1397,16 @@ export default {
                 this.isRule = false
             }
         },
+        //新增CH4失去焦点时参数校验
+        getBlurCH4(val) {
+            if (val.slice(-1) == '0' || val.slice(-1) == '2' || val.slice(-1) == '4' || val.slice(-1) == '6' || val.slice(-1) == '8') {
+                this.formState.ch4 = val
+                this.isRule2 = true
+            } else {
+                this.formState.ch4 = ''
+                this.isRule2 = false
+            }
+        },
         getBlurCO(val) {
             if (parseFloat(val) <= 24) {
                 this.formState.co = val
@@ -1423,7 +1437,7 @@ export default {
                     co2Early1: that.formState.co2,
                     coEarly1: that.formState.co,
                     gwSdzEarly1: that.formState.gw,
-                    jwSdzEarly1: that.formState.jw,
+                    jwSdzEarly1:that.formState.ch4,
                     o2Early1: that.formState.o2,
                     strInstallPos: that.formState.jcdd,
                     timeEarly1: that.formState.time,
@@ -1441,7 +1455,7 @@ export default {
                     co2Early2: that.formState.co2,
                     coEarly2: that.formState.co,
                     gwSdzEarly2: that.formState.gw,
-                    jwSdzEarly2: that.formState.jw,
+                    jwSdzEarly2: that.formState.ch4,
                     o2Early2: that.formState.o2,
                     strInstallPos: that.formState.jcdd,
                     timeEarly2: that.formState.time,
@@ -1458,12 +1472,12 @@ export default {
                     co2Noon1: that.formState.co2,
                     coNoon1: that.formState.co,
                     gwSdzNoon1: that.formState.gw,
-                    jwSdzNoon1: that.formState.jw,
+                    jwSdzNoon1: that.formState.ch4,
                     o2Noon1: that.formState.o2,
                     strInstallPos: that.formState.jcdd,
                     timeNoon1: that.formState.time,
                     reportTime: that.formState.tbrq,
-                    tnoon1 : that.formState.temp
+                    tnoon1: that.formState.temp
                 }
 
             } else if (that.formState.bc == '中班' && that.formState.count == '第二次') {
@@ -1476,7 +1490,7 @@ export default {
                     co2Noon2: that.formState.co2,
                     coNoon2: that.formState.co,
                     gwSdzNoon2: that.formState.gw,
-                    jwSdzNoon2: that.formState.jw,
+                    jwSdzNoon2: that.formState.ch4,
                     o2Noon2: that.formState.o2,
                     strInstallPos: that.formState.jcdd,
                     timeNoon2: that.formState.time,
@@ -1494,7 +1508,7 @@ export default {
                     co2Night1: that.formState.co2,
                     coNight1: that.formState.co,
                     gwSdzNight1: that.formState.gw,
-                    jwSdzNight1: that.formState.jw,
+                    jwSdzNight1: that.formState.ch4,
                     o2Night1: that.formState.o2,
                     strInstallPos: that.formState.jcdd,
                     timeNight1: that.formState.time,
@@ -1511,7 +1525,7 @@ export default {
                     co2Night2: that.formState.co2,
                     coNight2: that.formState.co,
                     gwSdzNight2: that.formState.gw,
-                    jwSdzNight2: that.formState.jw,
+                    jwSdzNight2: that.formState.ch4,
                     o2Night2: that.formState.o2,
                     strInstallPos: that.formState.jcdd,
                     timeNight2: that.formState.time,
@@ -1553,7 +1567,7 @@ export default {
                     co2Early1: that.formState.co2,
                     coEarly1: that.formState.co,
                     gwSdzEarly1: that.formState.gw,
-                    jwSdzEarly1: that.formState.jw,
+                    jwSdzEarly1: that.formState.ch4,
                     o2Early1: that.formState.o2,
                     strInstallPos: that.formState.jcdd,
                     timeEarly1: that.formState.time,
@@ -1579,7 +1593,7 @@ export default {
                     o2Noon1: that.saveShowList.o2Noon1,
                     strInstallPos: that.saveShowList.strInstallPos,
                     timeNoon1: that.saveShowList.timeNoon1,
-                    tnoon1 : that.saveShowList.tnoon1 ,
+                    tnoon1: that.saveShowList.tnoon1,
 
                     bxySdzNoon2: that.saveShowList.bxySdzNoon2,
                     ch4Noon2: that.saveShowList.ch4Noon2,
@@ -1635,7 +1649,7 @@ export default {
                     co2Early2: that.formState.co2,
                     coEarly2: that.formState.co,
                     gwSdzEarly2: that.formState.gw,
-                    jwSdzEarly2: that.formState.jw,
+                    jwSdzEarly2: that.formState.ch4,
                     o2Early2: that.formState.o2,
                     strInstallPos: that.formState.jcdd,
                     timeEarly2: that.formState.time,
@@ -1651,7 +1665,7 @@ export default {
                     o2Noon1: that.saveShowList.o2Noon1,
                     strInstallPos: that.saveShowList.strInstallPos,
                     timeNoon1: that.saveShowList.timeNoon1,
-                    tnoon1 : that.saveShowList.tnoon1 ,
+                    tnoon1: that.saveShowList.tnoon1,
 
                     bxySdzNoon2: that.saveShowList.bxySdzNoon2,
                     ch4Noon2: that.saveShowList.ch4Noon2,
@@ -1718,11 +1732,11 @@ export default {
                     co2Noon1: that.formState.co2,
                     coNoon1: that.formState.co,
                     gwSdzNoon1: that.formState.gw,
-                    jwSdzNoon1: that.formState.jw,
+                    jwSdzNoon1: that.formState.ch4,
                     o2Noon1: that.formState.o2,
                     strInstallPos: that.formState.jcdd,
                     timeNoon1: that.formState.time,
-                    tnoon1 : that.formState.temp,
+                    tnoon1: that.formState.temp,
 
                     bxySdzNoon2: that.saveShowList.bxySdzNoon2,
                     ch4Noon2: that.saveShowList.ch4Noon2,
@@ -1792,7 +1806,7 @@ export default {
                     jwSdzNoon1: that.saveShowList.jwSdzNoon1,
                     o2Noon1: that.saveShowList.o2Noon1,
                     timeNoon1: that.saveShowList.timeNoon1,
-                    tnoon1 : that.saveShowList.tnoon1 ,
+                    tnoon1: that.saveShowList.tnoon1,
 
                     bxySdzNoon2: that.formState.bxy,
                     ch4Noon2: that.formState.ch4,
@@ -1800,7 +1814,7 @@ export default {
                     co2Noon2: that.formState.co2,
                     coNoon2: that.formState.co,
                     gwSdzNoon2: that.formState.gw,
-                    jwSdzNoon2: that.formState.jw,
+                    jwSdzNoon2:that.formState.ch4,
                     o2Noon2: that.formState.o2,
                     strInstallPos: that.formState.jcdd,
                     timeNoon2: that.formState.time,
@@ -1865,7 +1879,7 @@ export default {
                     jwSdzNoon1: that.saveShowList.jwSdzNoon1,
                     o2Noon1: that.saveShowList.o2Noon1,
                     timeNoon1: that.saveShowList.timeNoon1,
-                    tnoon1 : that.saveShowList.tnoon1 ,
+                    tnoon1: that.saveShowList.tnoon1,
 
                     bxySdzNoon2: that.saveShowList.bxySdzNoon2,
                     ch4Noon2: that.saveShowList.ch4Noon2,
@@ -1886,7 +1900,7 @@ export default {
                     co2Night1: that.formState.co2,
                     coNight1: that.formState.co,
                     gwSdzNight1: that.formState.gw,
-                    jwSdzNight1: that.formState.jw,
+                    jwSdzNight1: that.formState.ch4,
                     o2Night1: that.formState.o2,
                     strInstallPos: that.formState.jcdd,
                     timeNight1: that.formState.time,
@@ -1936,7 +1950,7 @@ export default {
                     jwSdzNoon1: that.saveShowList.jwSdzNoon1,
                     o2Noon1: that.saveShowList.o2Noon1,
                     timeNoon1: that.saveShowList.timeNoon1,
-                    tnoon1 : that.saveShowList.tnoon1 ,
+                    tnoon1: that.saveShowList.tnoon1,
 
                     bxySdzNoon2: that.saveShowList.bxySdzNoon2,
                     ch4Noon2: that.saveShowList.ch4Noon2,
@@ -1968,7 +1982,7 @@ export default {
                     co2Night2: that.formState.co2,
                     coNight2: that.formState.co,
                     gwSdzNight2: that.formState.gw,
-                    jwSdzNight2: that.formState.jw,
+                    jwSdzNight2: that.formState.ch4,
                     o2Night2: that.formState.o2,
                     strInstallPos: that.formState.jcdd,
                     timeNight2: that.formState.time,
@@ -2028,6 +2042,7 @@ export default {
                 temp: '',
             }
             this.isRule = true
+            this.isRule2 = true
             this.isRule1 = true
             this.isRule14 = true
         },

+ 1 - 1
pages/index/index.vue

@@ -60,7 +60,7 @@
         icon="file-text"
       ></u-tabbar-item>
       <u-tabbar-item
-        text="瓦斯报"
+        text="瓦斯报"
         name="gasreport"
         icon="bell"
       ></u-tabbar-item>