From 585fb0bbd4a7bc7f8f333ecba7c5fecd2ee5cbc2 Mon Sep 17 00:00:00 2001
From: qushaowei <qushaowei@163.com>
Date: 星期四, 28 三月 2024 09:46:44 +0800
Subject: [PATCH] Merge branch 'master' of http://117.34.109.166:18448/r/vue_mdc_430 into develop

---
 src/views/eam/modules/dailyInspectionOrder/DailyInspectionOrderExeDrawer.vue |  316 +++++++++++++++++++++++++++++++---------------------
 1 files changed, 188 insertions(+), 128 deletions(-)

diff --git a/src/views/eam/modules/dailyInspectionOrder/DailyInspectionOrderExeDrawer.vue b/src/views/eam/modules/dailyInspectionOrder/DailyInspectionOrderExeDrawer.vue
index e5a0ffc..8888f42 100644
--- a/src/views/eam/modules/dailyInspectionOrder/DailyInspectionOrderExeDrawer.vue
+++ b/src/views/eam/modules/dailyInspectionOrder/DailyInspectionOrderExeDrawer.vue
@@ -19,6 +19,14 @@
                 type="primary"
                 v-has="'dailyInspectionOrder:SW'"
               >寮�宸�</a-button>
+
+              <a-button
+                :style="{marginRight: '8px'}"
+                @click="handleNormalReport"
+                :disabled="buttonDistable"
+                type="primary"
+                v-has="'dailyInspectionOrder:normalReport'"
+              >缁撴灉鍏ㄩ儴姝e父</a-button>
               <a-button
                 :style="{marginRight: '8px'}"
                 @click="handleReport"
@@ -41,7 +49,7 @@
                 <a-form-item
                   :labelCol="labelCol"
                   :wrapperCol="wrapperCol"
-                  label="璁惧缂栫爜"
+                  label="缁熶竴缂栫爜"
                   class="hightColor"
                 >
                   <span
@@ -129,15 +137,15 @@
                   :pagination="ipagination"
                   :loading="loading"
                   @change="handleTableChange"
-                  :scroll="{ x: 'calc(1200px + 50%)', y: 900 }"
                 >
+                  <!-- :scroll="{ x: 'calc(1000px + 50%)', y: 900 }" -->
                   <template
                     v-for="col in columns"
                     :slot="col.dataIndex"
                     slot-scope='text, record, index'
                   >
                     <div :key="col.dataIndex">
-                      <span
+                      <!-- <span
                         v-if=" col.dataIndex == 'photo' && !text"
                         style="font-size: 12px;font-style: italic;"
                       >鏃犲浘鐗�</span>
@@ -148,19 +156,30 @@
                         height="25px"
                         alt=""
                         style="max-width:80px;font-size: 12px;font-style: italic;"
-                      />
+                      /> -->
+                      <!-- <j-dict-select-tag
+                        v-if="col.dataIndex == 'inspectionProjectResult' "
+                        allow-clear
+                        @input="handleChange()"
+                        :disabled="record.disabled"
+                        :placeholder="'璇烽�夋嫨鐐规缁撴灉'"
+                        :triggerChange="true"
+                        style="width: 100%"
+                        dictCode="inspection_project_result"
+                      /> -->
                       <a-select
-                        v-if="col.dataIndex == 'inspectionProjectResult' && record.testValueType == '2'"
+                        v-if="col.dataIndex == 'inspectionProjectResult' "
                         :value="text"
                         @change="(e) => handleChange(e, record.key, col, index)"
                         style="width: 100%"
                         :disabled="record.disabled"
                       >
-                        <!-- :options="record.inspectionCycles" -->
                         <a-select-option value="1">姝e父</a-select-option>
                         <a-select-option value="2">寮傚父</a-select-option>
+                        <a-select-option value="3">鏁呴殰鍋滄満</a-select-option>
+                        <a-select-option value="4">娌″紑鏈�</a-select-option>
                       </a-select>
-                      <a-input-number
+                      <!-- <a-input-number
                         :value="text"
                         v-if="col.dataIndex == 'inspectionProjectResult' && record.testValueType == '1'"
                         :min="0"
@@ -168,7 +187,7 @@
                         @change="(e)=>handleChange(e, record.key, col, index,record)"
                         style="width: 100%"
                         :disabled="record.disabled"
-                      />
+                      /> -->
                       <a-textarea
                         :value="text"
                         v-if="col.dataIndex == 'abnormalDesc'"
@@ -187,7 +206,7 @@
                         :disabled="record.disabled"
                       />
 
-                      <j-image-upload
+                      <!-- <j-image-upload
                         :value="text"
                         v-if="col.dataIndex == 'abnormalPhoto'"
                         :isMultiple="false"
@@ -196,7 +215,7 @@
                         @change="(e)=>handleChange(e, record.key, col, index)"
                         :disabled="record.disabled"
                       >
-                      </j-image-upload>
+                      </j-image-upload> -->
 
                       <!-- <Tooltip
                         placement="top"
@@ -309,7 +328,7 @@
   },
   data() {
     return {
-      title: "鏃ュ父鐐规宸ュ崟鎵ц",
+      title: "鑷富缁存姢鐐规鎵ц",
       visible: false,
       maskClosable: true,
       confirmLoading: false,
@@ -327,6 +346,18 @@
         xs: { span: 24 },
         sm: { span: 18 },
       },
+      /* 鍒嗛〉鍙傛暟 */
+      ipagination: {
+        current: 1,
+        pageSize: 99,
+        pageSizeOptions: ['99'],
+        showTotal: (total, range) => {
+          return range[0] + "-" + range[1] + " 鍏�" + total + "鏉�"
+        },
+        showQuickJumper: true,
+        showSizeChanger: true,
+        total: 0
+      },
       columns: [
         {
           title: '#',
@@ -338,18 +369,18 @@
           },
           width: 50,
         },
-        {
-          title: '閮ㄤ綅',
-          align: 'center',
-          dataIndex: 'location',
-        },
-        // class: "notshow"
-        {
-          title: '绀烘剰鍥�',
-          align: 'center',
-          dataIndex: 'photo',
-          scopedSlots: { customRender: 'photo' },
-        },
+        // {
+        //   title: '閮ㄤ綅',
+        //   align: 'center',
+        //   dataIndex: 'location',
+        // },
+        // // class: "notshow"
+        // {
+        //   title: '绀烘剰鍥�',
+        //   align: 'center',
+        //   dataIndex: 'photo',
+        //   scopedSlots: { customRender: 'photo' },
+        // },
         // class: "notshow"
         {
           title: '鐐规椤圭洰',
@@ -361,46 +392,47 @@
           align: 'center',
           dataIndex: 'detectionStandard',
         },
-        {
-          title: '鍚堟牸鑼冨洿',
-          align: 'center',
-          dataIndex: 'acceptabilityLimit',
-        },
-        {
-          title: '鏂规硶',
-          align: 'center',
-          dataIndex: 'inspectionMethod_dictText',
-        },
-        {
-          title: '宸ュ叿',
-          align: 'center',
-          dataIndex: 'inspectionTool',
-        },
+        // {
+        //   title: '鍚堟牸鑼冨洿',
+        //   align: 'center',
+        //   dataIndex: 'acceptabilityLimit',
+        // },
+        // {
+        //   title: '鏂规硶',
+        //   align: 'center',
+        //   dataIndex: 'inspectionMethod_dictText',
+        // },
+        // {
+        //   title: '宸ュ叿',
+        //   align: 'center',
+        //   dataIndex: 'inspectionTool',
+        // },
         {
           title: '*鐐规缁撴灉',
           align: 'center',
           dataIndex: 'inspectionProjectResult',
           scopedSlots: { customRender: 'inspectionProjectResult' },
-          className: 'red',
         },
+        // className: 'red',
+        // {
+        //   title: '鍒ゅ畾',
+        //   align: 'center',
+        //   dataIndex: 'judgmentResult',
+        //   customRender: (text) => {
+        //     if (text == 'pass') {
+        //       return "姝e父";
+        //     } else if (text == 'fail') {
+        //       return "寮傚父";
+        //     }
+        //   },
+        // },
         {
-          title: '鍒ゅ畾',
-          align: 'center',
-          dataIndex: 'judgmentResult',
-          customRender: (text) => {
-            if (text == 'pass') {
-              return "姝e父";
-            } else if (text == 'fail') {
-              return "寮傚父";
-            }
-          },
-        },
-        {
-          title: '寮傚父鎻忚堪',
+          title: '*寮傚父鎻忚堪',
           align: 'center',
           dataIndex: 'abnormalDesc',
           scopedSlots: { customRender: 'abnormalDesc' },
         },
+        // className: 'red',
         // {
         //   title: '寮傚父鎷嶇収',
         //   align: 'center',
@@ -411,9 +443,9 @@
           title: '*寮傚父澶勭疆',
           align: 'center',
           dataIndex: 'treatmentMeasure',
-          className: 'red',
           scopedSlots: { customRender: 'treatmentMeasure' },
         },
+        // className: 'red',
       ],
       url: {
         list: "/eam/inspectionOrderDetail/list",
@@ -424,6 +456,7 @@
         editStatus: "/eam/inspectionOrder/editStatus",
         revocation: "/eam/inspectionOrder/revocation",
         report: "/eam/inspectionOrder/report",
+        normalReport: "/eam/inspectionOrder/normalReport",
       },
     }
   },
@@ -464,11 +497,11 @@
           // }
           //update-begin---author:zhangyafei    Date:20201118  for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------
           this.dataSource = res.result.records || res.result;
-          if (res.result.total) {
-            this.ipagination.total = res.result.total;
-          } else {
-            this.ipagination.total = 0;
-          }
+          // if (res.result.total) {
+          //   this.ipagination.total = res.result.total;
+          // } else {
+          //   this.ipagination.total = 0;
+          // }
           //update-end---author:zhangyafei    Date:20201118  for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------
         } else {
           this.$message.warning(res.message)
@@ -484,7 +517,7 @@
       this.loadData1(1)
     },
     loadData() {
-      this.loadData1(1)
+      // this.loadData1(1)
     },
     getBackground() {
       return "background-color:rgba(127, 127, 127,0.08)";
@@ -559,14 +592,21 @@
       for (let i = 0; i < that.dataSource.length; i++) {
         let o = this.dataSource[i]
         if (o.inspectionProjectResult == null || o.inspectionProjectResult == '') {
-          that.$message.warning('璇疯緭鍏ョ偣妫�缁撴灉锛�')
+          that.$message.warning("璇峰~鍐欑" + (i + 1) + "鐐规缁撴灉锛�");
           that.confirmLoading = false;
           return
         }
-        if (o.treatmentMeasure == null || o.treatmentMeasure == '') {
-          that.$message.warning('璇烽�夋嫨寮傚父澶勭疆锛�')
-          that.confirmLoading = false;
-          return
+        if (o.inspectionProjectResult == '2' || o.inspectionProjectResult == '3') {
+          if (o.abnormalDesc == null || o.abnormalDesc == '') {
+            that.$message.warning("璇峰~鍐欑" + (i + 1) + "寮傚父鎻忚堪锛�");
+            that.confirmLoading = false;
+            return
+          }
+          if (o.treatmentMeasure == null || o.treatmentMeasure == '') {
+            that.$message.warning("璇峰~鍐欑" + (i + 1) + "寮傚父澶勭疆锛�");
+            that.confirmLoading = false;
+            return
+          }
         }
       }
       formData.inspectionOrderDetailList = that.dataSource;
@@ -600,6 +640,55 @@
       })
     },
 
+    //鎵�鏈夌粨鏋滄甯�
+    handleNormalReport() {
+      const that = this;
+      for (let i = 0; i < that.dataSource.length; i++) {
+        let o = this.dataSource[i]
+        o.inspectionProjectResult = "1"
+        o.abnormalDesc = ""
+        o.treatmentMeasure = null
+      }
+    },
+
+
+    //鎶ュ伐
+    handleNormalReport1() {
+      const that = this;
+      that.confirmLoading = true;
+      let formData = Object.assign(this.model);
+      formData.inspectionOrderDetailList = that.dataSource;
+      formData.id = that.model.id;
+      formData.status = "5";
+      formData.equipmentId = that.model.equipmentId;
+      this.$confirm({
+        title: '鐐规宸ュ崟鎶ュ伐',
+        content: '鎻愮ず锛氱偣妫�缁撴灉鍏ㄩ儴姝e父锛屾姤宸ュ悗鐐规宸ュ崟瀹屽伐锛岃璋ㄦ厧鎿嶄綔锛�',
+        okText: '纭',
+        cancelText: '鍙栨秷',
+        onOk() {
+          requestPut(that.url.normalReport, formData).then((res) => {
+            if (res.success) {
+              that.model.status = '5'
+              that.$message.success(res.message)
+              that.buttonDistable = false
+              that.revocationDistable = true
+              that.SWbuttonDistable = true
+              that.$emit('ok');
+              that.alterFlag = new Date();
+              that.close();
+            } else {
+              that.$message.warning(res.message)
+            }
+          }).finally(() => {
+            that.confirmLoading = false;
+            // 
+          })
+        },
+      })
+    },
+
+
     //淇濆瓨
     handleOk() {
       const that = this;
@@ -608,14 +697,21 @@
       for (let i = 0; i < that.dataSource.length; i++) {
         let o = this.dataSource[i]
         if (o.inspectionProjectResult == null || o.inspectionProjectResult == '') {
-          that.$message.warning('璇疯緭鍏ョ偣妫�缁撴灉锛�')
+          that.$message.warning("璇峰~鍐欑" + (i + 1) + "鐐规缁撴灉锛�");
           that.confirmLoading = false;
           return
         }
-        if (o.treatmentMeasure == null || o.treatmentMeasure == '') {
-          that.$message.warning('璇烽�夋嫨寮傚父澶勭疆锛�')
-          that.confirmLoading = false;
-          return
+        if (o.inspectionProjectResult == '2' || o.inspectionProjectResult == '3') {
+          if (o.abnormalDesc == null || o.abnormalDesc == '') {
+            that.$message.warning("璇峰~鍐欑" + (i + 1) + "寮傚父鎻忚堪锛�");
+            that.confirmLoading = false;
+            return
+          }
+          if (o.treatmentMeasure == null || o.treatmentMeasure == '') {
+            that.$message.warning("璇峰~鍐欑" + (i + 1) + "寮傚父澶勭疆锛�");
+            that.confirmLoading = false;
+            return
+          }
         }
       }
       formData.inspectionOrderDetails = that.dataSource
@@ -669,29 +765,29 @@
       if (target) {
 
         if (column.dataIndex == 'inspectionProjectResult') {
-          if (target.testValueType === "1") {
-            target[column.dataIndex] = value;
-            let maxValue = target.maxValue
-            let minValue = target.minValue
-            if (value > minValue && value < maxValue) {
-              target['judgmentResult'] = "pass";
-            } else {
-              target['judgmentResult'] = "fail";
-            }
-            if (value == null || value == "") {
-              target['judgmentResult'] = "";
-            }
-          } else {
-            target[column.dataIndex] = value;
-            if (value == "1") {
-              target['judgmentResult'] = "pass";
-            } else {
-              target['judgmentResult'] = "fail";
-            }
-            if (value == null || value == "") {
-              target['judgmentResult'] = "";
-            }
+          // if (target.testValueType === "1") {
+          //   target[column.dataIndex] = value;
+          //   let maxValue = target.maxValue
+          //   let minValue = target.minValue
+          //   if (value > minValue && value < maxValue) {
+          //     target['judgmentResult'] = "pass";
+          //   } else {
+          //     target['judgmentResult'] = "fail";
+          //   }
+          //   if (value == null || value == "") {
+          //     target['judgmentResult'] = "";
+          //   }
+          // } else {
+          target[column.dataIndex] = value;
+          if (value == 1) {
+            target['abnormalDesc'] = null;
           }
+          target['treatmentMeasure'] = null;
+
+          // if (value == null || value == "") {
+          //   target['judgmentResult'] = "";
+          // }
+          // }
         }
         if (column.dataIndex == 'abnormalDesc') {
           target[column.dataIndex] = value.target.value;
@@ -735,43 +831,7 @@
       })
     },
 
-    getSrc(record) {
-      if (!record.path) {
-        return '';
-      }
-      //鏈湴锛歭ocal\Minio锛歮inio\闃块噷浜戯細alioss
-      if (record.uploadType == 'local') {
 
-        let ssoLoginFlag = Vue.ls.get("ssoLoginFlag");
-        let deployMode = Vue.ls.get("deployMode");
-
-        if (ssoLoginFlag && deployMode == "container") {
-          var baseProject = Vue.ls.get("baseProject");
-          console.log("baseProject==>" + baseProject)
-
-          var hostname = window.location.protocol + "//" + window.location.host;
-          var url = hostname + '/' + baseProject + '/sys/common/static';
-          return getFileAccessHttpUrl(record.path + record.encodeName, url, window._CONFIG['hyperTextTransfer'])
-        } else {
-          //鏍规嵁鍙戝竷鐘舵�佷慨鏀筯ttps 鎴� http
-          return getFileAccessHttpUrl(record.path + record.encodeName, this.url.urlDownload, window._CONFIG['hyperTextTransfer'])
-        }
-
-      } else if (record.uploadType == 'alioss') {
-
-        const OSS = require('ali-oss')
-        const client = new OSS({
-          // region浠ユ澀宸炰负渚嬶紙oss-cn-hangzhou锛夛紝鍏朵粬region鎸夊疄闄呮儏鍐靛~鍐欍��
-          region: window._CONFIG['region'],
-          // 闃块噷浜戜富璐﹀彿AccessKey鎷ユ湁鎵�鏈堿PI鐨勮闂潈闄愶紝椋庨櫓寰堥珮銆傚己鐑堝缓璁偍鍒涘缓骞朵娇鐢≧AM璐﹀彿杩涜API璁块棶鎴栨棩甯歌繍缁达紝璇风櫥褰昍AM鎺у埗鍙板垱寤篟AM璐﹀彿銆�
-          accessKeyId: window._CONFIG['accessKeyId'],
-          accessKeySecret: window._CONFIG['accessKeySecret'],
-          bucket: window._CONFIG['bucket'],
-        })
-        // object-key琛ㄧず浠嶰SS涓嬭浇鏂囦欢鏃堕渶瑕佹寚瀹氬寘鍚枃浠跺悗缂�鍦ㄥ唴鐨勫畬鏁磋矾寰勶紝渚嬪abc/efg/123.jpg銆�
-        return client.signatureUrl(record.path)
-      }
-    },
   },
 
 }
@@ -794,7 +854,7 @@
 .hight {
   color: #f5222d;
 }
-/deep/ .red {
+.red {
   color: red;
 }
 </style>
\ No newline at end of file

--
Gitblit v1.9.3