Browse Source

瓦斯巡检-图片识别更新

lxh 3 days ago
parent
commit
83d8b62ce6

+ 2 - 2
common/service/config.service.js

@@ -12,8 +12,8 @@ if (process.env.NODE_ENV == "development") {
   // BASE_URL = "http://10.120.120.164:9999"; // 察哈素
   // BASE_URL = "http://182.92.126.35:9999"; // 生产环境
   // BASE_URL = "http://172.16.53.16:9999"; // 
-  // BASE_URL = "http://10.246.167.205:9999"; //上湾
-  BASE_URL = "172.30.157.9:9999"; //元子沟
+  BASE_URL = "http://10.246.167.205:9999"; //上湾
+  // BASE_URL = "http://172.30.157.9:9999"; //元子沟
 
 }
 let staticDomainURL = BASE_URL + "/sys/common/static";

+ 146 - 69
pages/gasreport/components/gasImgIdentify.vue

@@ -156,19 +156,20 @@
             <view class="top-dialog-area">
                 <view class="dialog-item">
                     <text class="dialog-label">班次:</text>
-                    <uni-data-select placeholder="请选择班次" disabled align="center" :clear="true" v-model="formState.bc"
-                        :localdata="rangeBc"></uni-data-select>
+                    <uni-data-select placeholder="请选择班次" disabled style="text-align: center;" :clear="true"
+                        v-model="formState.bc" :localdata="rangeBc"></uni-data-select>
                 </view>
                 <view class="dialog-item">
                     <text class="dialog-label">检测次数:</text>
-                    <uni-data-select placeholder="请选择检测次数" align="center" :clear="true" v-model="formState.count"
-                        :disabled="statusShow == 'edit'" :localdata="rangeCount"
+                    <uni-data-select placeholder="请选择检测次数" style="text-align: center;" :clear="true"
+                        v-model="formState.count" :disabled="statusShow == 'edit'" :localdata="rangeCount"
                         @change="changeCount"></uni-data-select>
                 </view>
                 <view class="dialog-item">
                     <text class="dialog-label">检测地点:</text>
-                    <uni-data-select placeholder="请选择检测地点" align="center" :clear="true" v-model="formState.jcdd"
-                        :disabled="statusShow == 'edit'" :localdata="rangeJcdd" @change="changeJc"></uni-data-select>
+                    <uni-data-select placeholder="请选择检测地点" style="text-align: center;" :clear="true"
+                        v-model="formState.jcdd" :disabled="statusShow == 'edit'" :localdata="rangeJcdd"
+                        @change="changeJc"></uni-data-select>
                 </view>
                 <view class="dialog-item" @click="getChangeTime">
                     <text class="dialog-label">检测时间:</text>
@@ -225,8 +226,8 @@
                     <div class="dialog-title">三对照数据</div>
                     <view class="dialog-item">
                         <text class="dialog-label">甲烷传感器:</text>
-                        <uni-data-select placeholder="请选择检测地点" align="center" :clear="true" v-model="formState.jw"
-                            :localdata="rangeJw" @change="changeJw"></uni-data-select>
+                        <uni-data-select placeholder="请选择检测地点" style="text-align: center;" :clear="true"
+                            v-model="formState.jw" :localdata="rangeJw" @change="changeJw"></uni-data-select>
                     </view>
                     <view class="dialog-item">
                         <text class="dialog-label">光瓦测量数据:</text>
@@ -350,7 +351,7 @@ export default {
                     break;
                 case '最近':
                     that.toggleTitle = '全部'
-                    that.gasList = that.tableData.slice(that.tableData.length - 1)
+                    that.gasList = that.tableData.filter(v => v.deviceId == that.deviceId)
                     break;
             }
         },
@@ -438,58 +439,131 @@ export default {
                 temp: that.indexParam['温度(℃)'],
                 // mcgzm: '',
             }
-            if (that.formState.bc == '早班') {
-                that.paramData = {
-                    deviceId: that.deviceId,
-                    bxySdzEarly1: that.formState.bxy,
-                    ch4Early1: that.formState.ch4,
-                    checkPersonEarly: that.formState.jcy,
-                    co2Early1: that.formState.co2,
-                    coEarly1: that.formState.co,
-                    gwSdzEarly1: that.formState.gw,
-                    jwSdzEarly1: that.formState.jw,
-                    o2Early1: that.formState.o2,
-                    strInstallPos: that.formState.jcdd,
-                    timeEarly1: that.formState.time,
-                    reportTime: that.formState.tbrq,
-                    tearly1: that.formState.temp,
-                }
-
-            } else if (that.formState.bc == '中班') {
-                that.paramData = {
-                    deviceId: that.deviceId,
-                    bxySdzNoon1: that.formState.bxy,
-                    ch4Noon1: that.formState.ch4,
-                    checkPersonNoon: that.formState.jcy,
-                    co2Noon1: that.formState.co2,
-                    coNoon1: that.formState.co,
-                    gwSdzNoon1: that.formState.gw,
-                    jwSdzNoon1: that.formState.jw,
-                    o2Noon1: that.formState.o2,
-                    strInstallPos: that.formState.jcdd,
-                    timeNoon1: that.formState.time,
-                    reportTime: that.formState.tbrq,
-                    tnoon1: that.formState.temp,
-                }
-
-            } else if (that.formState.bc == '夜班') {
-                that.paramData = {
-                    deviceId: that.deviceId,
-                    bxySdzNight1: that.formState.bxy,
-                    ch4Night1: that.formState.ch4,
-                    checkPersonNight: that.formState.jcy,
-                    co2Night1: that.formState.co2,
-                    coNight1: that.formState.co,
-                    gwSdzNight1: that.formState.gw,
-                    jwSdzNight1: that.formState.jw,
-                    o2Night1: that.formState.o2,
-                    strInstallPos: that.formState.jcdd,
-                    timeNight1: that.formState.time,
-                    reportTime: that.formState.tbrq,
-                    tnight1: that.formState.temp,
-                }
 
-            }
+            new Promise((resolve, reject) => {
+                api
+                    .getGas({ reportTime: that.formState.tbrq, deviceId: that.deviceId })
+                    .then((response) => {
+                        if (response.data.code == 200) {
+                            let data = response.data.result.records
+                            if (data.length != 0) {
+                                that.saveShowList = data[0]
+                                if (that.formState.bc == '早班') {
+                                    let param = {
+                                        deviceId: that.deviceId,
+                                        bxySdzEarly1: that.formState.bxy,
+                                        ch4Early1: that.formState.ch4,
+                                        checkPersonEarly: that.formState.jcy,
+                                        co2Early1: that.formState.co2,
+                                        coEarly1: that.formState.co,
+                                        gwSdzEarly1: that.formState.gw,
+                                        jwSdzEarly1: that.formState.jw,
+                                        o2Early1: that.formState.o2,
+                                        strInstallPos: that.formState.jcdd,
+                                        timeEarly1: that.formState.time,
+                                        reportTime: that.formState.tbrq,
+                                        tearly1: that.formState.temp,
+                                    }
+                                    that.paramData = Object.assign({}, that.saveShowList, param)
+                                } else if (that.formState.bc == '中班') {
+                                    let param = {
+                                        deviceId: that.deviceId,
+                                        bxySdzNoon1: that.formState.bxy,
+                                        ch4Noon1: that.formState.ch4,
+                                        checkPersonNoon: that.formState.jcy,
+                                        co2Noon1: that.formState.co2,
+                                        coNoon1: that.formState.co,
+                                        gwSdzNoon1: that.formState.gw,
+                                        jwSdzNoon1: that.formState.jw,
+                                        o2Noon1: that.formState.o2,
+                                        strInstallPos: that.formState.jcdd,
+                                        timeNoon1: that.formState.time,
+                                        reportTime: that.formState.tbrq,
+                                        tnoon1: that.formState.temp,
+                                    }
+                                    that.paramData = Object.assign({}, that.saveShowList, param)
+                                } else if (that.formState.bc == '夜班') {
+                                    let param = {
+                                        deviceId: that.deviceId,
+                                        bxySdzNight1: that.formState.bxy,
+                                        ch4Night1: that.formState.ch4,
+                                        checkPersonNight: that.formState.jcy,
+                                        co2Night1: that.formState.co2,
+                                        coNight1: that.formState.co,
+                                        gwSdzNight1: that.formState.gw,
+                                        jwSdzNight1: that.formState.jw,
+                                        o2Night1: that.formState.o2,
+                                        strInstallPos: that.formState.jcdd,
+                                        timeNight1: that.formState.time,
+                                        reportTime: that.formState.tbrq,
+                                        tnight1: that.formState.temp,
+                                    }
+                                    that.paramData = Object.assign({}, that.saveShowList, param)
+                                }
+                            } else {
+                                that.saveShowList = {}
+                                if (that.formState.bc == '早班') {
+                                    let param = {
+                                        deviceId: that.deviceId,
+                                        bxySdzEarly1: that.formState.bxy,
+                                        ch4Early1: that.formState.ch4,
+                                        checkPersonEarly: that.formState.jcy,
+                                        co2Early1: that.formState.co2,
+                                        coEarly1: that.formState.co,
+                                        gwSdzEarly1: that.formState.gw,
+                                        jwSdzEarly1: that.formState.jw,
+                                        o2Early1: that.formState.o2,
+                                        strInstallPos: that.formState.jcdd,
+                                        timeEarly1: that.formState.time,
+                                        reportTime: that.formState.tbrq,
+                                        tearly1: that.formState.temp,
+                                    }
+                                    that.paramData = Object.assign({}, that.saveShowList, param)
+                                } else if (that.formState.bc == '中班') {
+                                    let param = {
+                                        deviceId: that.deviceId,
+                                        bxySdzNoon1: that.formState.bxy,
+                                        ch4Noon1: that.formState.ch4,
+                                        checkPersonNoon: that.formState.jcy,
+                                        co2Noon1: that.formState.co2,
+                                        coNoon1: that.formState.co,
+                                        gwSdzNoon1: that.formState.gw,
+                                        jwSdzNoon1: that.formState.jw,
+                                        o2Noon1: that.formState.o2,
+                                        strInstallPos: that.formState.jcdd,
+                                        timeNoon1: that.formState.time,
+                                        reportTime: that.formState.tbrq,
+                                        tnoon1: that.formState.temp,
+                                    }
+                                    that.paramData = Object.assign({}, that.saveShowList, param)
+                                } else if (that.formState.bc == '夜班') {
+                                    let param = {
+                                        deviceId: that.deviceId,
+                                        bxySdzNight1: that.formState.bxy,
+                                        ch4Night1: that.formState.ch4,
+                                        checkPersonNight: that.formState.jcy,
+                                        co2Night1: that.formState.co2,
+                                        coNight1: that.formState.co,
+                                        gwSdzNight1: that.formState.gw,
+                                        jwSdzNight1: that.formState.jw,
+                                        o2Night1: that.formState.o2,
+                                        strInstallPos: that.formState.jcdd,
+                                        timeNight1: that.formState.time,
+                                        reportTime: that.formState.tbrq,
+                                        tnight1: that.formState.temp,
+                                    }
+                                    that.paramData = Object.assign({}, that.saveShowList, param)
+                                }
+                            }
+                        } else {
+                            reject(response);
+                        }
+                    })
+                    .catch((error) => {
+                        console.log("catch===>response", response);
+                        reject(error);
+                    });
+            });
         },
         //删除
         delSb() {
@@ -505,7 +579,7 @@ export default {
             if (that.formState.bc == '早班' && that.formState.count == '第一次') {
 
                 let param = {
-                    // deviceId: that.deviceId,
+                    deviceId: that.deviceId,
                     bxySdzEarly1: that.formState.bxy,
                     ch4Early1: that.formState.ch4,
                     checkPersonEarly: that.formState.jcy,
@@ -522,7 +596,7 @@ export default {
                 that.paramData = Object.assign({}, that.saveShowList, param)
             } else if (that.formState.bc == '早班' && that.formState.count == '第二次') {
                 let param = {
-                    // deviceId: that.deviceId,
+                    deviceId: that.deviceId,
                     bxySdzEarly2: that.formState.bxy,
                     ch4Early2: that.formState.ch4,
                     checkPersonEarly: that.formState.jcy,
@@ -540,7 +614,7 @@ export default {
 
             } else if (that.formState.bc == '中班' && that.formState.count == '第一次') {
                 let param = {
-                    // deviceId: that.deviceId,
+                    deviceId: that.deviceId,
                     bxySdzNoon1: that.formState.bxy,
                     ch4Noon1: that.formState.ch4,
                     checkPersonNoon: that.formState.jcy,
@@ -559,7 +633,7 @@ export default {
 
             } else if (that.formState.bc == '中班' && that.formState.count == '第二次') {
                 let param = {
-                    // deviceId: that.deviceId,
+                    deviceId: that.deviceId,
                     bxySdzNoon2: that.formState.bxy,
                     ch4Noon2: that.formState.ch4,
                     checkPersonNoon: that.formState.jcy,
@@ -577,7 +651,7 @@ export default {
 
             } else if (that.formState.bc == '夜班' && that.formState.count == '第一次') {
                 let param = {
-                    // deviceId: that.deviceId,
+                    deviceId: that.deviceId,
                     bxySdzNight1: that.formState.bxy,
                     ch4Night1: that.formState.ch4,
                     checkPersonNight: that.formState.jcy,
@@ -596,7 +670,7 @@ export default {
 
             } else if (that.formState.bc == '夜班' && that.formState.count == '第二次') {
                 let param = {
-                    // deviceId: that.deviceId,
+                    deviceId: that.deviceId,
                     bxySdzNight2: that.formState.bxy,
                     ch4Night2: that.formState.ch4,
                     checkPersonNight: that.formState.jcy,
@@ -1798,7 +1872,7 @@ export default {
                         if (response.data.code == 200) {
                             that.getGasList()
                             that.isShowAdd = false
-                            that.editData = {}
+                            // that.editData = {}
                             that.clearData()
                         } else {
                             reject(response);
@@ -1865,8 +1939,11 @@ export default {
                     .then((response) => {
                         if (response.data.code == 200) {
                             that.tableData = response.data.result.records
-                            that.gasList = that.tableData.slice(that.tableData.length - 1)
-
+                            if (that.statusShow == 'edit') {
+                                that.gasList = that.tableData.filter(v => v.deviceId == that.editData.deviceId)
+                            } else {
+                                that.gasList = that.tableData.filter(v => v.deviceId == that.deviceId)
+                            }
                         } else {
                             reject(response);
                         }

+ 3 - 3
pages/gasreport/components/popupModal.vue

@@ -32,8 +32,8 @@ export default {
     data() {
         return {
             indexList: [
-                { id: 1, label: '瓦斯巡检记录卡管理', },
-                // { id: 1, label: '图片识别', },
+                // { id: 1, label: '瓦斯巡检记录卡管理', },
+                { id: 1, label: '图片识别', },
                 {
                     id: 2, label: '巡检任务面板', children: [
                         { label: '早班', },
@@ -41,7 +41,7 @@ export default {
                         { label: '夜班' },
                     ]
                 },
-                { id: 3, label: '瓦斯巡检填报' },
+                // { id: 3, label: '瓦斯巡检填报' },
             ],
         }
     },

+ 2 - 2
pages/gasreport/gasreport.vue

@@ -32,8 +32,8 @@ export default {
         return {
             gasTitle: '',//标题
             showModel: false,//是否打开弹出层
-            loadComponent: 'gasFill',//默认加载组件
-            // loadComponent: 'gasImgIdentify',//默认加载组件
+            // loadComponent: 'gasFill',//默认加载组件
+            loadComponent: 'gasImgIdentify',//默认加载组件
             taskTj: {},
             firstAddress: '',//一次线路
             secondAddress: '',//二次线路