|
@@ -13,7 +13,7 @@
|
|
|
@confirm="confirmTb" @cancel="showCalendarTb = false" @change="changeTb"
|
|
|
@close="showCalendarTb = false"></u-datetime-picker>
|
|
|
</view>
|
|
|
- <u-button type="primary" size="small" style="margin: 2px 0px;" @click="getAdd">新增</u-button>
|
|
|
+ <u-button v-if="hasPermission('gasReport:add')" type="primary" size="small" style="margin: 2px 0px;" @click="getAdd">新增</u-button>
|
|
|
</view>
|
|
|
<view class="bot-gas-list">
|
|
|
<view class="top-title">
|
|
@@ -109,35 +109,38 @@
|
|
|
</view>
|
|
|
<view>
|
|
|
<view class="center-dialog-area">
|
|
|
- <div class="dialog-title">气体监测数据</div>
|
|
|
+ <div class="dialog-title">气体检测数据</div>
|
|
|
|
|
|
<view class="dialog-item">
|
|
|
- <text class="dialog-label">CH₄:</text>
|
|
|
+ <text class="dialog-label">CH₄(%):</text>
|
|
|
<u--input inputAlign="center" :disabled="isDisabled" v-model="formState.ch4"
|
|
|
:placeholder="isRule2 ? '请输入' : '数据有误'" type="number" @blur="getBlurCH4"
|
|
|
+ @input="changeInput($event, 'ch4')" clearable
|
|
|
:placeholderStyle="isRule2 ? 'color:#c0c4cc' : 'color:#ff0000'"></u--input>
|
|
|
</view>
|
|
|
<view class="dialog-item">
|
|
|
- <text class="dialog-label">CO₂:</text>
|
|
|
+ <text class="dialog-label">CO₂(%):</text>
|
|
|
<u--input inputAlign="center" :disabled="isDisabled" v-model="formState.co2"
|
|
|
:placeholder="isRule ? '请输入' : '数据有误'" type="number" @blur="getBlurCO2"
|
|
|
+ @input="changeInput($event, 'co2')" clearable
|
|
|
:placeholderStyle="isRule ? 'color:#c0c4cc' : 'color:#ff0000'"></u--input>
|
|
|
</view>
|
|
|
<view class="dialog-item">
|
|
|
- <text class="dialog-label">CO:</text>
|
|
|
+ <text class="dialog-label">CO(ppm):</text>
|
|
|
<u--input inputAlign="center" :disabled="isDisabled" v-model="formState.co"
|
|
|
- :placeholder="isRule14 ? '请输入' : '数据有误'"
|
|
|
+ :placeholder="isRule14 ? '请输入' : '数据有误'" clearable
|
|
|
:placeholderStyle="isRule14 ? 'color:#c0c4cc' : 'color:#ff0000'" type="number"
|
|
|
- @blur="getBlurCO"></u--input>
|
|
|
+ @blur="getBlurCO" @input="changeInput($event, 'co')"></u--input>
|
|
|
</view>
|
|
|
<view class="dialog-item">
|
|
|
- <text class="dialog-label">O₂:</text>
|
|
|
- <u--input inputAlign="center" :disabled="isDisabled" type="number" v-model="formState.o2"
|
|
|
- placeholder="请输入"></u--input>
|
|
|
+ <text class="dialog-label">O₂(%):</text>
|
|
|
+ <u--input inputAlign="center" :disabled="isDisabled" clearable type="number"
|
|
|
+ v-model="formState.o2" placeholder="请输入" @input="changeInput($event, 'o2')"></u--input>
|
|
|
</view>
|
|
|
<view class="dialog-item">
|
|
|
- <text class="dialog-label">温度:</text>
|
|
|
- <u--input inputAlign="center" :disabled="isDisabled" type="number" v-model="formState.temp"
|
|
|
+ <text class="dialog-label">T(℃):</text>
|
|
|
+ <u--input inputAlign="center" :disabled="isDisabled" clearable type="number"
|
|
|
+ @input="changeInput($event, 'temp')" v-model="formState.temp"
|
|
|
placeholder="请输入"></u--input>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -147,19 +150,22 @@
|
|
|
<text class="dialog-label">甲烷传感器:</text>
|
|
|
<!-- <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>
|
|
|
+ <u--input inputAlign="center" :disabled="isDisabled" type="number" v-model="formState.ch4"
|
|
|
+ placeholder="请输入" clearable @input="changeInput($event, 'ch4')"></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" clearable
|
|
|
+ @input="changeInput($event, 'gw')"
|
|
|
:placeholderStyle="isRule1 ? 'color:#c0c4cc' : 'color:#ff0000'"></u--input>
|
|
|
</view>
|
|
|
<view class="dialog-item">
|
|
|
<text class="dialog-label">便携仪测量数据:</text>
|
|
|
- <u--input inputAlign="center" :disabled="isDisabled" type="number" v-model="formState.bxy"
|
|
|
- placeholder="请输入"></u--input>
|
|
|
+ <u--input inputAlign="center" :disabled="isDisabled"
|
|
|
+ :placeholderStyle="isRule3 ? 'color:#c0c4cc' : 'color:#ff0000'"
|
|
|
+ :placeholder="isRule3 ? '请输入' : '数据有误'" type="number" v-model="formState.bxy" clearable
|
|
|
+ @blur="getBlurBxy" @input="changeInput($event, 'bxy')"></u--input>
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
@@ -203,6 +209,7 @@ export default {
|
|
|
isRule1: true,
|
|
|
isRule14: true,
|
|
|
isRule2: true,
|
|
|
+ isRule3: true,
|
|
|
//新增参数信息
|
|
|
isShowAdd: false,//是否显示新增弹窗
|
|
|
|
|
@@ -235,7 +242,7 @@ export default {
|
|
|
computed: {
|
|
|
username: function () {
|
|
|
return uni.getStorageSync('login_user_info')['realname']
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
mounted() {
|
|
|
console.log(uni.getStorageSync('login_user_info'), 'ceshi00-----------')
|
|
@@ -243,6 +250,10 @@ export default {
|
|
|
this.getMcList()
|
|
|
},
|
|
|
methods: {
|
|
|
+ hasPermission(param){
|
|
|
+ let permission= uni.getStorageSync('btnPermission')
|
|
|
+ return permission.filter(v=>v.action==param).length!=0 ? true : false
|
|
|
+ },
|
|
|
//班次下拉选项切换
|
|
|
changeBc(e) {
|
|
|
let that = this
|
|
@@ -1376,12 +1387,44 @@ export default {
|
|
|
this.showCalendarTb = false
|
|
|
this.getGasList()
|
|
|
},
|
|
|
-
|
|
|
+ //输入框内容变换
|
|
|
+ changeInput(val, data) {
|
|
|
+ if (/^00/.test(val)) {
|
|
|
+ this.formState[data] = val.replace(/^00/, '0');
|
|
|
+ } else {
|
|
|
+ this.formState[data] = val
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //便携仪失去焦点时参数校验
|
|
|
+ getBlurBxy(val) {
|
|
|
+ let str = val.substring(val.indexOf('.') + 1).split('')
|
|
|
+ if (/^(\-|\+)?\d+$/.test(val)) {
|
|
|
+ this.formState.bxy = val
|
|
|
+ this.isRule3 = true
|
|
|
+ } else if (/^-?([1-9]\d*\.\d*|0\.\d*[1-9]\d*|0?\.0+|0)$/.test(val) && str.length <= 2) {
|
|
|
+ this.formState.bxy = val
|
|
|
+ this.isRule3 = true
|
|
|
+ } else {
|
|
|
+ this.formState.bxy = ''
|
|
|
+ this.isRule3 = false
|
|
|
+ }
|
|
|
+ },
|
|
|
//新增光瓦失去焦点时参数校验
|
|
|
getBlur(val) {
|
|
|
- if (val.slice(-1) === '0' || val.slice(-1) === '2' || val.slice(-1) === '4' || val.slice(-1) === '6' || val.slice(-1) === '8') {
|
|
|
- this.formState.gw = val
|
|
|
- this.isRule1 = true
|
|
|
+ let str = val.substring(val.indexOf('.') + 1).split('')
|
|
|
+ if (val.slice(-1) == '0' || val.slice(-1) == '2' || val.slice(-1) == '4' || val.slice(-1) == '6' || val.slice(-1) == '8') {
|
|
|
+ if (/^-?([1-9]\d*\.\d*|0\.\d*[1-9]\d*|0?\.0+|0)$/.test(val)) {
|
|
|
+ if (str.length <= 2) {
|
|
|
+ this.formState.gw = val
|
|
|
+ this.isRule1 = true
|
|
|
+ } else {
|
|
|
+ this.formState.gw = ''
|
|
|
+ this.isRule1 = false
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.formState.gw = val
|
|
|
+ this.isRule1 = true
|
|
|
+ }
|
|
|
} else {
|
|
|
this.formState.gw = ''
|
|
|
this.isRule1 = false
|
|
@@ -1389,26 +1432,55 @@ export default {
|
|
|
},
|
|
|
//新增CO2失去焦点时参数校验
|
|
|
getBlurCO2(val) {
|
|
|
+ console.log(val, '000')
|
|
|
+ let str = val.substring(val.indexOf('.') + 1).split('')
|
|
|
if (val.slice(-1) == '0' || val.slice(-1) == '2' || val.slice(-1) == '4' || val.slice(-1) == '6' || val.slice(-1) == '8') {
|
|
|
- this.formState.co2 = val
|
|
|
- this.isRule = true
|
|
|
+ if (/^-?([1-9]\d*\.\d*|0\.\d*[1-9]\d*|0?\.0+|0)$/.test(val)) {
|
|
|
+ if (str.length <= 2) {
|
|
|
+ this.formState.co2 = val
|
|
|
+ this.isRule = true
|
|
|
+ } else {
|
|
|
+ console.log(111)
|
|
|
+ this.formState.co2 = ''
|
|
|
+ this.isRule = false
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.formState.co2 = val
|
|
|
+ this.isRule = true
|
|
|
+ }
|
|
|
} else {
|
|
|
+ console.log(222)
|
|
|
this.formState.co2 = ''
|
|
|
this.isRule = false
|
|
|
}
|
|
|
},
|
|
|
//新增CH4失去焦点时参数校验
|
|
|
getBlurCH4(val) {
|
|
|
+ let str = val.substring(val.indexOf('.') + 1).split('')
|
|
|
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
|
|
|
+ if (/^-?([1-9]\d*\.\d*|0\.\d*[1-9]\d*|0?\.0+|0)$/.test(val)) {
|
|
|
+ if (str.length <= 2) {
|
|
|
+ this.formState.ch4 = val
|
|
|
+ this.isRule2 = true
|
|
|
+ } else {
|
|
|
+ this.formState.ch4 = ''
|
|
|
+ this.isRule2 = false
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.formState.ch4 = val
|
|
|
+ this.isRule2 = true
|
|
|
+ }
|
|
|
} else {
|
|
|
this.formState.ch4 = ''
|
|
|
this.isRule2 = false
|
|
|
}
|
|
|
},
|
|
|
getBlurCO(val) {
|
|
|
- if (parseFloat(val) <= 24) {
|
|
|
+ let str = val.substring(val.indexOf('.') + 1).split('')
|
|
|
+ if (/^(\-|\+)?\d+$/.test(val) && parseFloat(val) <= 24) {
|
|
|
+ this.formState.co = val
|
|
|
+ this.isRule14 = true
|
|
|
+ } else if (/^-?([1-9]\d*\.\d*|0\.\d*[1-9]\d*|0?\.0+|0)$/.test(val) && str.length <= 2 && parseFloat(val) <= 24) {
|
|
|
this.formState.co = val
|
|
|
this.isRule14 = true
|
|
|
} else {
|
|
@@ -1437,7 +1509,7 @@ export default {
|
|
|
co2Early1: that.formState.co2,
|
|
|
coEarly1: that.formState.co,
|
|
|
gwSdzEarly1: that.formState.gw,
|
|
|
- jwSdzEarly1:that.formState.ch4,
|
|
|
+ jwSdzEarly1: that.formState.ch4,
|
|
|
o2Early1: that.formState.o2,
|
|
|
strInstallPos: that.formState.jcdd,
|
|
|
timeEarly1: that.formState.time,
|
|
@@ -1814,7 +1886,7 @@ export default {
|
|
|
co2Noon2: that.formState.co2,
|
|
|
coNoon2: that.formState.co,
|
|
|
gwSdzNoon2: that.formState.gw,
|
|
|
- jwSdzNoon2:that.formState.ch4,
|
|
|
+ jwSdzNoon2: that.formState.ch4,
|
|
|
o2Noon2: that.formState.o2,
|
|
|
strInstallPos: that.formState.jcdd,
|
|
|
timeNoon2: that.formState.time,
|
|
@@ -2044,6 +2116,7 @@ export default {
|
|
|
this.isRule = true
|
|
|
this.isRule2 = true
|
|
|
this.isRule1 = true
|
|
|
+ this.isRule3 = true
|
|
|
this.isRule14 = true
|
|
|
},
|
|
|
|