فهرست منبع

上湾-瓦斯巡检图片更新

lxh 1 هفته پیش
والد
کامیت
5bb9cb35c5

+ 4 - 3
common/service/config.service.js

@@ -3,24 +3,25 @@ let BASE_URL = "";
 if (process.env.NODE_ENV == "development") {
   BASE_URL = "http://182.92.126.35:9999"; // 开发环境
 } else {
-  BASE_URL = "http://182.92.126.35:9999"; // 开发环境
+  // BASE_URL = "http://182.92.126.35:9999"; // 开发环境
   // BASE_URL = "http://10.246.95.4:9999"; // 布尔台
   // BASE_URL = "http://10.248.135.10:9999"; // 大柳塔进
   // BASE_URL = "http://10.248.135.121:9999"; // 活鸡兔井
   // BASE_URL = "http://10.246.63.125:9999"; // 寸草塔二矿
-  BASE_URL = "http://10.246.183.35:9999"; // 乌兰木伦
+  // BASE_URL = "http://10.246.183.35:9999"; // 乌兰木伦
   // 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 = "http://172.30.157.9:9999"; //元子沟
-  // BASE_URL = "http://10.246.167.205:9999"; //上湾
+  BASE_URL = "http://10.246.167.205:9999"; //上湾
 }
 let staticDomainURL = BASE_URL + "/sys/common/static";
 
 const configService = {
   apiUrl: BASE_URL,
   apiUrlP: 'http://10.246.167.205:6006',
+  // apiUrlP: 'http://182.92.126.35:6006',
   staticDomainURL: staticDomainURL,
 };
 

+ 105 - 89
pages/gasreport/components/gasImgIdentify.vue

@@ -12,7 +12,7 @@
                     <image v-if="imageSrc" style="width:300px;" :src="imageSrc" mode="aspectFit" @click="getPreview">
                     </image>
                 </view>
-                <view>
+                <!-- <view>
                     <u-modal :show="imgPreShow" @confirm="closePreImg">
                         <view class="slot-content">
                             <image @touchmove="touchEvent" @touchend="touchEnd" @dblclick="dblclickEvent"
@@ -20,7 +20,7 @@
                                 :src="imageSrc" mode="aspectFit"></image>
                         </view>
                     </u-modal>
-                </view>
+                </view> -->
                 <view style="width:100%;display: flex;justify-content: space-between;margin: 2px 0px;">
                     <u-button icon="eye" type="primary" size="small" :loading="loading" loadingText="识别中"
                         style="width:49%;margin:0" @click="getGasIdentify">识别</u-button>
@@ -269,6 +269,7 @@ import api from "@/api/api";
 import moment from 'moment'
 import configService from '@/common/service/config.service.js'
 // import stringSimilarity from 'string-similarity'
+
 export default {
     name: 'gasFill',
     props: {
@@ -306,6 +307,7 @@ export default {
 
     data() {
         return {
+            tempFilePaths: [],
             gasTitle: '数据采集',//标题
             backPic0: "url(/static/topnavbar0.png)",
             backPic: "url(../../static/topnavbar.png)",
@@ -328,7 +330,7 @@ export default {
             },
             isFirst: true, // 是否是第一次缩放
             loading: false,
-            imgPreShow: false,
+            // imgPreShow: false,
             paramData: {},
             statusShow: '',
             editData: {},
@@ -372,7 +374,7 @@ export default {
                 count: '第一次',
                 jcdd: '',
                 jcy: '',
-                time: moment(new Date()).format('YYYY-MM-DD HH:mm:ss'),
+                time: '',
                 ch4: '',
                 co2: '',
                 co: '',
@@ -380,7 +382,7 @@ export default {
                 jw: '',
                 gw: '',
                 bxy: '',
-                tbrq: moment(new Date()).format('YYYY-MM-DD'),
+                tbrq: '',
                 temp: '',
                 // mcgzm: '',
             },
@@ -390,6 +392,7 @@ export default {
         username: function () {
             return uni.getStorageSync('login_user_info')['realname']
         },
+      
     },
     watch: {
         checkState: {
@@ -436,79 +439,84 @@ export default {
         handlerToggle() {
             this.$emit('getBackAddress')
         },
-        touchEvent(e) {
-            let that = this
-            // 双指缩放
-            if (e.touches.length === 2) {
-                that.fingers = true
-                // 需要动画可以自行设置时间,个人觉得不需要动画更丝滑,所以设置为0
-                that.animationTime = 0
-                let touch1 = e.touches[0]
-                let touch2 = e.touches[1]
-                let distance = Math.floor(Math.sqrt(Math.pow(touch1.clientX - touch2.clientX, 2) + Math.pow(touch1.clientY - touch2.clientY, 2)))
-                if (that.isFirst) {
-                    // 首次缩放 给予初始值
-                    that.lastDistance = distance
-                    that.isFirst = false
-                } else {
-                    // 非首次缩放 计算缩放比例
-                    let scale = distance / that.lastDistance
-                    if (scale > 1) {
-                        if (that.scaleImg < 3) that.scaleImg = that.scaleImg + 0.05
-                    } else {
-                        if (that.scaleImg > 0.5) that.scaleImg = that.scaleImg - 0.05
-                    }
-                }
-            }
-            // 单指移动  fingers(解决双指缩放,手指松开时会导致图片乱移动问题)
-            if (e.touches.length === 1 && that.fingers === false) {
-                that.animationTime = 0
-                const touch = e.touches[0]
-                if (that.isFirst) {
-                    // 记录初始位置
-                    that.move.x = touch.clientX
-                    that.move.y = touch.clientY
-                    that.isFirst = false
-                } else {
-                    //计算偏移量 (当前位置 - 上一次位置)
-                    that.offset.x = touch.clientX - that.move.x
-                    that.offset.y = touch.clientY - that.move.y
-                    that.move.x = touch.clientX
-                    that.move.y = touch.clientY
-                    // 通过偏移量设置图片位置
-                    that.imgLocation.x = that.imgLocation.x + that.offset.x
-                    that.imgLocation.y = that.imgLocation.y + that.offset.y
-                }
-            }
-        },
-        touchEnd(e) {
-            let that = this
-            // 手指离开时重置
-            if (e.touches.length == 0) {
-                that.isFirst = true
-                that.fingers = false
-            }
-        },
-        dblclickEvent() {
-            let that = this
-            that.animationTime = 1
-            if (that.scaleImg > 1) {
-                that.scaleImg = 1
-                that.imgLocation.x = 0
-                that.imgLocation.y = 0
-            } else {
-                that.scaleImg = 2
-                that.imgLocation.x = 0
-                that.imgLocation.y = 0
-            }
-        },
-        //图片点击
+        // touchEvent(e) {
+        //     let that = this
+        //     // 双指缩放
+        //     if (e.touches.length === 2) {
+        //         that.fingers = true
+        //         // 需要动画可以自行设置时间,个人觉得不需要动画更丝滑,所以设置为0
+        //         that.animationTime = 0
+        //         let touch1 = e.touches[0]
+        //         let touch2 = e.touches[1]
+        //         let distance = Math.floor(Math.sqrt(Math.pow(touch1.clientX - touch2.clientX, 2) + Math.pow(touch1.clientY - touch2.clientY, 2)))
+        //         if (that.isFirst) {
+        //             // 首次缩放 给予初始值
+        //             that.lastDistance = distance
+        //             that.isFirst = false
+        //         } else {
+        //             // 非首次缩放 计算缩放比例
+        //             let scale = distance / that.lastDistance
+        //             if (scale > 1) {
+        //                 if (that.scaleImg < 3) that.scaleImg = that.scaleImg + 0.05
+        //             } else {
+        //                 if (that.scaleImg > 0.5) that.scaleImg = that.scaleImg - 0.05
+        //             }
+        //         }
+        //     }
+        //     // 单指移动  fingers(解决双指缩放,手指松开时会导致图片乱移动问题)
+        //     if (e.touches.length === 1 && that.fingers === false) {
+        //         that.animationTime = 0
+        //         const touch = e.touches[0]
+        //         if (that.isFirst) {
+        //             // 记录初始位置
+        //             that.move.x = touch.clientX
+        //             that.move.y = touch.clientY
+        //             that.isFirst = false
+        //         } else {
+        //             //计算偏移量 (当前位置 - 上一次位置)
+        //             that.offset.x = touch.clientX - that.move.x
+        //             that.offset.y = touch.clientY - that.move.y
+        //             that.move.x = touch.clientX
+        //             that.move.y = touch.clientY
+        //             // 通过偏移量设置图片位置
+        //             that.imgLocation.x = that.imgLocation.x + that.offset.x
+        //             that.imgLocation.y = that.imgLocation.y + that.offset.y
+        //         }
+        //     }
+        // },
+        // touchEnd(e) {
+        //     let that = this
+        //     // 手指离开时重置
+        //     if (e.touches.length == 0) {
+        //         that.isFirst = true
+        //         that.fingers = false
+        //     }
+        // },
+        // dblclickEvent() {
+        //     let that = this
+        //     that.animationTime = 1
+        //     if (that.scaleImg > 1) {
+        //         that.scaleImg = 1
+        //         that.imgLocation.x = 0
+        //         that.imgLocation.y = 0
+        //     } else {
+        //         that.scaleImg = 2
+        //         that.imgLocation.x = 0
+        //         that.imgLocation.y = 0
+        //     }
+        // },
+        //图片点击预览
         getPreview() {
-            this.imgPreShow = true
-        },
-        closePreImg() {
-            this.imgPreShow = false
+            // this.imgPreShow = true
+            // 预览图片
+            uni.previewImage({
+                urls: this.tempFilePaths,
+                current: 0
+            });
         },
+        // closePreImg() {
+        //     // this.imgPreShow = false
+        // },
         //获取图片识别数据
         getGasIdentify() {
             let that = this
@@ -539,21 +547,20 @@ export default {
                             that.deviceId = that.deviceID
                             that.formState = {
                                 id: '',
-                                bc: that.classType,
+                                bc: that.classType || '',
                                 count: that.checkNum == '1' ? '第一次' : that.checkNum == '2' ? '第二次' : '',
-                                jcdd: that.deviceName,
-                                jcy: that.indexParam['检查人'],
-                                time: that.indexParam['检查时间'],
-                                ch4: that.indexParam['CH4%'],
-                                co2: that.indexParam['CO2%'],
-                                co: that.indexParam['CO(ppm)'],
-                                o2: that.indexParam['O2%'],
+                                jcdd: that.deviceName || '',
+                                jcy: that.indexParam && that.indexParam['检查人'] ? that.indexParam['检查人'] : that.username,
+                                time:that.indexParam && that.indexParam['检查时间'] ?  that.indexParam['检查时间'] : '',
+                                ch4: that.indexParam && that.indexParam['CH4%'] ? that.indexParam['CH4%'] : '',
+                                co2: that.indexParam && that.indexParam['CO2%'] ? that.indexParam['CO2%'] : '',
+                                co: that.indexParam && that.indexParam['CO(ppm)'] ? that.indexParam['CO(ppm)'] : '',
+                                o2: that.indexParam && that.indexParam['O2%'] ? that.indexParam['O2%'] : '',
                                 jw: that.isSensor == '1' ? '0' : '-',
-                                gw: that.indexParam['CH4%'],
+                                gw: that.indexParam && that.indexParam['CH4%'] ? that.indexParam['CH4%'] : '',
                                 bxy: '0',
-                                tbrq: that.indexParam['检查时间'].substring(0, that.indexParam['检查时间'].indexOf(' ')),
-                                temp: that.indexParam['温度(℃)'],
-                                // mcgzm: '',
+                                tbrq: that.indexParam && that.indexParam['检查时间'] ? that.indexParam['检查时间'].substring(0,  that.indexParam['检查时间'].indexOf(' ')) : '',
+                                temp: that.indexParam && that.indexParam['温度(℃)'] ? that.indexParam['温度(℃)'] : '',
                             }
 
                             new Promise((resolve, reject) => {
@@ -798,7 +805,7 @@ export default {
                         }
 
                     },
-                    fail: (errpr) => {
+                    fail: (error) => {
                         uni.showToast({
                             title: '识别失败!',
                             icon: 'none' // 可选图标,'success', 'loading', 'none'
@@ -823,6 +830,7 @@ export default {
                     console.log(res, 'res===')
                     // 获取选中的图片路径,这里我们只取第一张图进行预览
                     this.imageSrc = res.tempFilePaths[0];
+                    this.tempFilePaths = res.tempFilePaths
                     this.imageSrcList = res.tempFiles
                 },
                 fail: (err) => {
@@ -2234,11 +2242,19 @@ export default {
                             that.$emit('getBackAddress')
                         } else {
                             reject(response);
+                            uni.showToast({
+                                title: response.data,
+                                icon: 'none' // 可选图标,'success', 'loading', 'none'
+                            });
                         }
                     })
                     .catch((error) => {
                         console.log("catch===>response", response);
                         reject(error);
+                        uni.showToast({
+                            title: '保存失败!',
+                            icon: 'none' // 可选图标,'success', 'loading', 'none'
+                        });
                     });
             });
 

+ 81 - 9
pages/gasreport/components/taskBoard.vue

@@ -1,12 +1,15 @@
 <template>
     <view class="taskBoard">
-        <u-navbar :bgStatusImage="backPic0" :bgImage="backPic" :title="gasTitle" :safeAreaInsetTop="true"
-            leftIcon="" @leftClick="handlerToggle"> </u-navbar>
+        <u-navbar :bgStatusImage="backPic0" :bgImage="backPic" :title="gasTitle" :safeAreaInsetTop="true" leftIcon=""
+            @leftClick="handlerToggle"> </u-navbar>
         <u-list :height="708" v-if="isShow">
             <u-list-item v-for="(item, index) in indexList" :key="index">
                 <u-cell icon="share" @click="getBorad(item)">
                     <view slot="title" class="u-slot-title">
-                        <text class="u-cell-text">{{ item.name }}</text>
+                        <text class="u-cell-text">
+                            <text>{{ item.name }}</text>
+                            <text style="margin-left:10px">{{  item.checkPerson ? `(${item.checkPerson})` : '' }}</text>
+                        </text>
                     </view>
                     <view slot="value" class="u-slot-title">
                         <u-tag :text="item.classType_dictText" plain size="mini"
@@ -16,6 +19,18 @@
                 </u-cell>
             </u-list-item>
         </u-list>
+        <!-- 填报日期弹窗 -->
+        <u-modal v-if="isShow" showCancelButton showConfirmButton confirmText="确定" cancelText="取消" :show="showTime"
+            :title="titleTime" @confirm="confirmTime" @cancel="cancelTime">
+            <view class="dialog-item" @click="getChangeTime">
+                <text class="dialog-label">任务日期:</text>
+                <u--input v-model="searchTime" placeholder="请选择任务日期" inputAlign="center"
+                    suffixIcon="arrow-right"></u--input>
+                <u-calendar :show="showCalendar" v-model="timeRan" mode="single" closeOnClickOverlay
+                    @confirm="changeTime" @cancel="showCalendar = false"
+                   ></u-calendar>
+            </view>
+        </u-modal>
         <component v-else :is="loadComponent" :taskId="taskId" @getBackBoard="getBackBoard"></component>
     </view>
 </template>
@@ -23,7 +38,7 @@
 <script>
 import api from "@/api/api";
 import taskBoardAddress from './taskBoardAddress.vue'
-
+import moment from 'moment'
 export default {
     name: 'taskBoard',
     components: {
@@ -33,6 +48,11 @@ export default {
 
     data() {
         return {
+            showTime: false,//是否显示填报日期弹窗
+            titleTime: '',
+            searchTime: '',//检测时间
+            showCalendar: false,//控制日期选型下拉开启
+            timeRan: Number(new Date()),
             isShow: true,
             loadComponent: '',
             taskId: '',
@@ -42,30 +62,58 @@ export default {
             backPic: "url(../../static/topnavbar.png)",
         }
     },
-    computed: {},
+    computed: {
+        teamCode: function () {
+            return uni.getStorageSync('login_user_info')['districtTeam']
+        },
+    },
     mounted() {
         this.getTimeList()
     },
     methods: {
+        //点击弹出日期下拉选项
+        getChangeTime() {
+            this.showCalendar = true
+        },
+        changeTime(e) {
+            let that = this
+            that.searchTime = moment(e.value).format('YYYY-MM-DD')
+            uni.setStorageSync("searchTime", that.searchTime);
+            that.showCalendar=false
+        },
         //点击返回上一级
         getBackBoard() {
-            let that=this
+            let that = this
             that.isShow = true
             that.loadComponent = ''
         },
         //点击跳转到识别看板
         getBorad(item) {
             let that = this
-            that.isShow = false
             that.taskId = item.id
-            that.loadComponent = 'taskBoardAddress'
+            that.showTime = true
+        },
+        //选择检测时间-确定
+        confirmTime() {
+            let that = this
+            if (that.searchTime) {
+                that.isShow = false
+                that.showTime=false
+                that.loadComponent = 'taskBoardAddress'
+            }
+        },
+        //选择检测时间-取消
+        cancelTime() {
+            let that=this
+            that.isShow = true
+            that.showTime=false
         },
         //获取任务管理列表数据
         getTimeList() {
             let that = this
             new Promise((resolve, reject) => {
                 api
-                    .teamList({ pageNo: 1, pageSize: 100 })
+                    .teamList({ pageNo: 1, pageSize: 100,teamCode:that.teamCode })
                     .then((response) => {
                         if (response.data.code == 200) {
                             that.indexList = response.data.result.records
@@ -93,6 +141,30 @@ export default {
 
 }
 
+.dialog-item {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+
+    .dialog-label {
+        width: 70px;
+        text-align: center;
+    }
+}
+
+::v-deep .u-input {
+    display: flex;
+    flex-direction: row;
+    align-items: center;
+    justify-content: space-between;
+    padding: 3px 9px !important;
+    width: 180px;
+}
+
+::v-deep .u-popup {
+    flex: 0
+}
+
 ::v-deep .u-slot-title {
     display: flex;
 }

+ 8 - 4
pages/gasreport/components/taskBoardAddress.vue

@@ -6,7 +6,7 @@
             <u-list-item v-for="(item, index) in indexList" :key="index">
                 <u-cell icon="share" @click="getBoradAddress(item)">
                     <view slot="title" class="u-slot-title">
-                        <text class="u-cell-text">{{ item.deviceName }}</text>
+                        <text class="u-cell-text">{{`${ item.deviceName} (${item.checkNum=='1' ? '第一次' : item.checkNum=='2' ? '第二次' : ''})` }}</text>
                         <!-- <u-tag text="查看" plain size="mini" type="warning">
                         </u-tag> -->
                     </view>
@@ -32,7 +32,7 @@ export default {
         taskId: {
             type: String,
             default: ''
-        }
+        },
     },
 
     data() {
@@ -52,7 +52,11 @@ export default {
             backPic: "url(../../static/topnavbar.png)",
         }
     },
-    computed: {},
+    computed: {
+        searchTime: function () {
+            return uni.getStorageSync('searchTime')
+        }
+    },
     mounted() {
         this.taskDetailsLists()
     },
@@ -93,7 +97,7 @@ export default {
             let that = this
             new Promise((resolve, reject) => {
                 api
-                    .taskDetailsList({ pageNo: 1, pageSize: 100, taskId: that.taskId })
+                    .taskDetailsList({ pageNo: 1, pageSize: 100, taskId: that.taskId,taskTime:that.searchTime })
                     .then((response) => {
                         if (response.data.code == 200) {
                             console.log(response, '地点列表---')