lxh 3 месяцев назад
Родитель
Сommit
547f07aada

+ 84 - 227
pages/gasreport/components/gasImgIdentify.vue

@@ -1,62 +1,29 @@
 <template>
   <view class="gas-fill">
-    <u-navbar
-      :bgStatusImage="backPic0"
-      :bgImage="backPic"
-      :title="gasTitle"
-      :safeAreaInsetTop="true"
-      leftIcon="arrow-left"
-      @leftClick="handlerToggle"
-    >
+    <u-navbar :bgStatusImage="backPic0" :bgImage="backPic" :title="gasTitle" :safeAreaInsetTop="true"
+      leftIcon="arrow-left" @leftClick="handlerToggle">
     </u-navbar>
     <!-- 瓦斯上报列表 -->
     <view v-if="statusShow != 'edit'">
       <view class="top-gas-list">
-        <u-button
-          type="primary"
-          icon="camera-fill"
-          size="small"
-          @click="GalleryFile"
-          style="margin: 2px 0px"
-          >图片选取</u-button
-        >
+        <u-button type="primary" icon="camera-fill" size="small" @click="GalleryFile"
+          style="margin: 2px 0px">图片选取</u-button>
         <!-- 图片预览 -->
         <view class="imgView">
-           <image
-            v-if="saveImg || imageSrc"
-            style="width: 100%"
-            :src="imageSrc ? imageSrc : saveImg"
-            @click="getPreview"
-          >
+          <image v-if="saveImg || imageSrc" style="width: 100%" :src="imageSrc ? imageSrc : saveImg"
+            @click="getPreview">
           </image>
         </view>
 
-        <view
-          style="
+        <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
-          >
-          <u-button
-            icon="trash"
-            type="primary"
-            size="small"
-            style="width: 49%; margin: 0"
-            @click="delSb"
-            >删除</u-button
-          >
+          ">
+          <u-button icon="eye" type="primary" size="small" :loading="loading" loadingText="识别中"
+            style="width: 49%; margin: 0" @click="getGasIdentify">识别</u-button>
+          <u-button icon="trash" type="primary" size="small" style="width: 49%; margin: 0" @click="delSb">删除</u-button>
         </view>
         <helang-compress ref="helangCompress"></helang-compress>
       </view>
@@ -64,108 +31,56 @@
 
     <view v-if="statusShow == 'edit'">
       <view class="top-gas-list">
-        <u-button
-          type="primary"
-          icon="camera-fill"
-          size="small"
-          @click="GalleryFile"
-          style="margin: 2px 0px"
-          >图片更新</u-button
-        >
+        <u-button type="primary" icon="camera-fill" size="small" @click="GalleryFile"
+          style="margin: 2px 0px">图片更新</u-button>
         <!-- 图片预览 -->
         <view class="imgView">
-          <image
-            v-if="imageSrcView"
-            style="width: 100%"
-            :src="imageSrcView"
-            @click="getPreview"
-          >
+          <image v-if="imageSrcView" style="width: 100%" :src="imageSrcView" @click="getPreview">
           </image>
         </view>
       </view>
     </view>
 
     <!-- 新增弹窗 -->
-    <view
-      v-if="isShowAdd"
-      :style="{
-        padding: imageSrcView
-          ? '295px 0px 10px 0px'
-          : imageSrc
+    <view v-if="isShowAdd" :style="{
+      padding: imageSrcView
+        ? '295px 0px 10px 0px'
+        : imageSrc
           ? '330px 0px 10px 0px'
           : saveImg
-          ? '330px 0px 10px 0px'
-          : '54px 0px 10px 0px',
-      }"
-      :class="statusShow == 'edit' ? 'bot-gas-list1' : 'bot-gas-list'"
-    >
+            ? '330px 0px 10px 0px'
+            : '54px 0px 10px 0px',
+    }" :class="statusShow == 'edit' ? 'bot-gas-list1' : 'bot-gas-list'">
       <view class="top-dialog-area">
         <view class="dialog-item">
           <text class="dialog-label">班次:</text>
-          <u--input
-            inputAlign="center"
-            disabled
-            v-model="formState.bc"
-            clearable
-          ></u--input>
+          <u--input inputAlign="center" disabled v-model="formState.bc" clearable></u--input>
         </view>
         <view class="dialog-item">
           <text class="dialog-label">检测次数:</text>
-          <u--input
-            inputAlign="center"
-            disabled
-            v-model="formState.count"
-            clearable
-          ></u--input>
+          <u--input inputAlign="center" disabled v-model="formState.count" clearable></u--input>
         </view>
         <view class="dialog-item">
           <text class="dialog-label">检测地点:</text>
 
-          <u--textarea
-            v-model="formState.jcdd"
-            :height="14"
-            disabled
-          ></u--textarea>
+          <u--textarea v-model="formState.jcdd" :height="14" disabled></u--textarea>
         </view>
         <view class="dialog-item" @click="getChangeTime">
           <text class="dialog-label">检测时间:</text>
-          <u--input
-            readonly
-            v-model="formState.time"
-            placeholder="请选择检测时间"
-            inputAlign="center"
-            :disabled="statusShow == 'edit'"
-            suffixIcon="arrow-right"
-          ></u--input>
-          <u-datetime-picker
-            :show="showCalendar"
-            v-model="timeRan"
-            mode="datetime"
-            closeOnClickOverlay
-            @confirm="showCalendar = false"
-            @cancel="showCalendar = false"
-            @change="change"
-            @close="showCalendar = false"
-          ></u-datetime-picker>
+          <u--input readonly v-model="formState.time" placeholder="请选择检测时间" inputAlign="center"
+            :disabled="statusShow == 'edit'" suffixIcon="arrow-right"></u--input>
+          <u-datetime-picker :show="showCalendar" v-model="timeRan" mode="datetime" closeOnClickOverlay
+            @confirm="showCalendar = false" @cancel="showCalendar = false" @change="change"
+            @close="showCalendar = false"></u-datetime-picker>
         </view>
         <view class="dialog-item">
           <text class="dialog-label">填报日期:</text>
-          <u--input
-            inputAlign="center"
-            readonly
-            v-model="formState.tbrq"
-            placeholder="请选择填报日期"
-            :disabled="statusShow == 'edit'"
-          ></u--input>
+          <u--input inputAlign="center" readonly v-model="formState.tbrq" placeholder="请选择填报日期"
+            :disabled="statusShow == 'edit'"></u--input>
         </view>
         <view class="dialog-item">
           <text class="dialog-label">检查工:</text>
-          <u--input
-            inputAlign="center"
-            disabled
-            v-model="formState.jcy"
-            placeholder="请输入"
-          ></u--input>
+          <u--input inputAlign="center" disabled v-model="formState.jcy" placeholder="请输入"></u--input>
         </view>
       </view>
       <view>
@@ -174,113 +89,57 @@
 
           <view class="dialog-item">
             <text class="dialog-label">CH₄(%):</text>
-            <u--input
-              inputAlign="center"
-              v-model="formState.ch4"
-              :placeholder="isRule2 ? '请输入' : '数据有误'"
-              type="number"
-              @blur="getBlurCH4"
-              @input="changeInput($event, 'ch4')"
-              clearable
-              :placeholderStyle="isRule2 ? 'color:#c0c4cc' : 'color:#ff0000'"
-            ></u--input>
+            <u--input inputAlign="center" 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>
-            <u--input
-              inputAlign="center"
-              v-model="formState.co2"
-              :placeholder="isRule ? '请输入' : '数据有误'"
-              type="number"
-              @blur="getBlurCO2"
-              @input="changeInput($event, 'co2')"
-              clearable
-              :placeholderStyle="isRule ? 'color:#c0c4cc' : 'color:#ff0000'"
-            ></u--input>
+            <u--input inputAlign="center" 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(ppm):</text>
-            <u--input
-              inputAlign="center"
-              v-model="formState.co"
-              :placeholder="isRule14 ? '请输入' : '数据有误'"
-              clearable
-              :placeholderStyle="isRule14 ? 'color:#c0c4cc' : 'color:#ff0000'"
-              type="number"
-              @blur="getBlurCO"
-              @input="changeInput($event, 'co')"
-            ></u--input>
+            <u--input inputAlign="center" v-model="formState.co" :placeholder="isRule14 ? '请输入' : '数据有误'" clearable
+              :placeholderStyle="isRule14 ? 'color:#c0c4cc' : 'color:#ff0000'" type="number" @blur="getBlurCO"
+              @input="changeInput($event, 'co')"></u--input>
           </view>
           <view class="dialog-item">
             <text class="dialog-label">O₂(%):</text>
-            <u--input
-              inputAlign="center"
-              clearable
-              type="number"
-              v-model="formState.o2"
-              placeholder="请输入"
-              @input="changeInput($event, 'o2')"
-            ></u--input>
+            <u--input inputAlign="center" clearable type="number" v-model="formState.o2" placeholder="请输入"
+              @input="changeInput($event, 'o2')"></u--input>
           </view>
           <view class="dialog-item">
             <text class="dialog-label">T(℃):</text>
-            <u--input
-              inputAlign="center"
-              clearable
-              type="number"
-              @input="changeInput($event, 'temp')"
-              v-model="formState.temp"
-              placeholder="请输入"
-            ></u--input>
+            <u--input inputAlign="center" clearable type="number" @input="changeInput($event, 'temp')"
+              v-model="formState.temp" placeholder="请输入"></u--input>
           </view>
         </view>
         <view class="bottom-dialog-area">
           <div class="dialog-title">三对照数据</div>
           <view class="dialog-item">
             <text class="dialog-label">甲烷传感器:</text>
-            <u--input
-              inputAlign="center"
-              v-model="formState.jw"
-              placeholder="请输入"
-              clearable
-              @input="changeInput($event, 'jw')"
-            ></u--input>
+            <u--input inputAlign="center" v-model="formState.jw" placeholder="请输入" clearable
+              @input="changeInput($event, 'jw')"></u--input>
           </view>
           <view class="dialog-item">
             <text class="dialog-label">光瓦:</text>
 
-            <u--input
-              inputAlign="center"
-              type="number"
-              v-model="formState.ch4"
-              placeholder="请输入"
-              clearable
-              @input="changeInput($event, 'ch4')"
-            ></u--input>
+            <u--input inputAlign="center" 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"
-              :placeholderStyle="isRule3 ? 'color:#c0c4cc' : 'color:#ff0000'"
-              :placeholder="isRule3 ? '请输入' : '数据有误'"
-              type="number"
-              v-model="formState.bxy"
-              clearable
-              @blur="getBlurBxy"
-              @input="changeInput($event, 'bxy')"
-            ></u--input>
+            <u--input inputAlign="center" :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>
       </view>
       <view class="dialog-btn">
-        <u-button
-          type="success"
-          v-if="statusShow == 'add' || statusShow == 'edit'"
-          size="small"
-          @click="getConfirm"
-          >保存</u-button
-        >
+        <u-button type="success" v-if="statusShow == 'add' || statusShow == 'edit'" size="small"
+          @click="getConfirm">保存</u-button>
         <u-button type="primary" size="small" @click="getCancel">取消</u-button>
       </view>
     </view>
@@ -339,7 +198,7 @@ export default {
       type: String,
       default: "",
     },
-     saveImg: {
+    saveImg: {
       type: String,
       default: "",
     },
@@ -428,17 +287,20 @@ export default {
           //获取任务详情图片
           this.getTaskImg();
         } else {
-          that.isShowAdd = true;
+          that.isShowAdd = false;
           that.statusShow = "add";
           that.gasTitle = "数据填报";
           //识别数据填充
-          that.getSbFill();
+          if (that.sbData.length) {
+            that.getSbFill();
+          }
+
         }
       },
       immediate: true,
     },
   },
-  mounted() {},
+  mounted() { },
   methods: {
     //打开选择器选择
     GalleryFile() {
@@ -515,7 +377,7 @@ export default {
       let that = this;
       that.deviceId = that.deviceID;
       that.imageSrc = that.urlData;
-      let status = that.sbData[0].status;
+      let status = that.sbData.length ? that.sbData[0].status : '';
       if (status != "2") {
         if (that.sbData.length != 0) {
           that.indexParam = that.sbData[0];
@@ -526,8 +388,8 @@ export default {
               that.checkNum == "1"
                 ? "第一次"
                 : that.checkNum == "2"
-                ? "第二次"
-                : "",
+                  ? "第二次"
+                  : "",
             jcdd: that.deviceName || "",
             jcy:
               that.indexParam && that.indexParam["检查人"]
@@ -558,9 +420,9 @@ export default {
             tbrq:
               that.indexParam && that.indexParam["检查时间"]
                 ? that.indexParam["检查时间"].substring(
-                    0,
-                    that.indexParam["检查时间"].indexOf(" ")
-                  )
+                  0,
+                  that.indexParam["检查时间"].indexOf(" ")
+                )
                 : "",
             temp:
               that.indexParam && that.indexParam["温度(℃)"]
@@ -901,8 +763,8 @@ export default {
               that.checkNum == "1"
                 ? "第一次"
                 : that.checkNum == "2"
-                ? "第二次"
-                : "",
+                  ? "第二次"
+                  : "",
             jcdd: that.deviceName || "",
             jcy: that.username,
             time: "",
@@ -924,8 +786,8 @@ export default {
             that.checkNum == "1"
               ? "第一次"
               : that.checkNum == "2"
-              ? "第二次"
-              : "",
+                ? "第二次"
+                : "",
           jcdd: that.deviceName || "",
           jcy: that.username,
           time: "",
@@ -993,8 +855,8 @@ export default {
                       that.checkNum == "1"
                         ? "第一次"
                         : that.checkNum == "2"
-                        ? "第二次"
-                        : "",
+                          ? "第二次"
+                          : "",
                     jcdd: that.deviceName || "",
                     jcy:
                       that.indexParam && that.indexParam["检查人"]
@@ -1025,9 +887,9 @@ export default {
                     tbrq:
                       that.indexParam && that.indexParam["检查时间"]
                         ? that.indexParam["检查时间"].substring(
-                            0,
-                            that.indexParam["检查时间"].indexOf(" ")
-                          )
+                          0,
+                          that.indexParam["检查时间"].indexOf(" ")
+                        )
                         : "",
                     temp:
                       that.indexParam && that.indexParam["温度(℃)"]
@@ -1368,8 +1230,8 @@ export default {
                       that.checkNum == "1"
                         ? "第一次"
                         : that.checkNum == "2"
-                        ? "第二次"
-                        : "",
+                          ? "第二次"
+                          : "",
                     jcdd: that.deviceName || "",
                     jcy: that.username,
                     time: "",
@@ -3364,12 +3226,10 @@ export default {
         display: flex;
         justify-content: space-between;
         align-items: center;
-        background: linear-gradient(
-          to right,
-          rgba(55, 135, 254, 0.08),
-          rgba(4, 184, 255, 0.08),
-          rgba(60, 161, 237, 0.08)
-        );
+        background: linear-gradient(to right,
+            rgba(55, 135, 254, 0.08),
+            rgba(4, 184, 255, 0.08),
+            rgba(60, 161, 237, 0.08));
         border-radius: 10px;
         margin-bottom: 5px;
 
@@ -3389,13 +3249,10 @@ export default {
           width: 4px;
           height: 70%;
           border-left: 2px solid;
-          border-image: linear-gradient(
-              to bottom,
+          border-image: linear-gradient(to bottom,
               transparent,
               rgba(140, 203, 254, 1),
-              transparent
-            )
-            1 1 1;
+              transparent) 1 1 1;
         }
 
         .item-r {

+ 2 - 2
pages/gasreport/components/taskBoard.vue

@@ -52,9 +52,9 @@ export default {
             searchTime: '',//检测时间
             showCalendar: false,//控制日期选型下拉开启
             // timeRan: Number(new Date()),
-            minDate: moment().subtract(30, 'days').format('YYYY-MM-DD'),
+            minDate: moment().subtract(30*10, 'days').format('YYYY-MM-DD'),
             // minDate: moment().subtract(160, 'days').format('YYYY-MM-DD'),
-            maxDate:moment().add(30, 'days').format('YYYY-MM-DD'),
+            maxDate:moment().add(30*10, 'days').format('YYYY-MM-DD'),
             isShow: true,
             loadComponent: '',
             taskId: '',

+ 2 - 2
pages/gasreport/gasreport.vue

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