From eb48d3bada053e26def2a94d46dbe115a5a7bb2f Mon Sep 17 00:00:00 2001
From: qushaowei <qushaowei@163.com>
Date: 星期六, 18 十一月 2023 16:46:18 +0800
Subject: [PATCH] 问题项修改

---
 src/views/eam/modules/dailyInspectionOrder/DailyInspectionOrderExeDrawer.vue |  228 +++++++++++++++++++++++++++++++-------------------------
 1 files changed, 126 insertions(+), 102 deletions(-)

diff --git a/src/views/eam/modules/dailyInspectionOrder/DailyInspectionOrderExeDrawer.vue b/src/views/eam/modules/dailyInspectionOrder/DailyInspectionOrderExeDrawer.vue
index 9131ded..51a61f3 100644
--- a/src/views/eam/modules/dailyInspectionOrder/DailyInspectionOrderExeDrawer.vue
+++ b/src/views/eam/modules/dailyInspectionOrder/DailyInspectionOrderExeDrawer.vue
@@ -28,6 +28,13 @@
               >鎶ュ伐</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="handleReset"
                 :disabled="revocationDistable"
                 type="primary"
@@ -129,8 +136,8 @@
                   :pagination="ipagination"
                   :loading="loading"
                   @change="handleTableChange"
-                  :scroll="{ x: 'calc(1000px + 50%)', y: 900 }"
                 >
+                  <!-- :scroll="{ x: 'calc(1000px + 50%)', y: 900 }" -->
                   <template
                     v-for="col in columns"
                     :slot="col.dataIndex"
@@ -150,7 +157,7 @@
                         style="max-width:80px;font-size: 12px;font-style: italic;"
                       />
                       <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%"
@@ -162,7 +169,7 @@
                         <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"
@@ -170,7 +177,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'"
@@ -311,7 +318,7 @@
   },
   data() {
     return {
-      title: "鏃ュ父鐐规宸ュ崟鎵ц",
+      title: "鑷富缁存姢鐐规鎵ц",
       visible: false,
       maskClosable: true,
       confirmLoading: false,
@@ -340,18 +347,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: '鐐规椤圭洰',
@@ -383,25 +390,26 @@
           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: '寮傚父鎷嶇収',
@@ -414,8 +422,8 @@
           align: 'center',
           dataIndex: 'treatmentMeasure',
           scopedSlots: { customRender: 'treatmentMeasure' },
+          className: 'red',
         },
-        // className: 'red',
       ],
       url: {
         list: "/eam/inspectionOrderDetail/list",
@@ -426,6 +434,7 @@
         editStatus: "/eam/inspectionOrder/editStatus",
         revocation: "/eam/inspectionOrder/revocation",
         report: "/eam/inspectionOrder/report",
+        normalReport: "/eam/inspectionOrder/normalReport",
       },
     }
   },
@@ -561,14 +570,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;
@@ -602,6 +618,43 @@
       })
     },
 
+    //鎶ュ伐
+    handleNormalReport() {
+      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;
@@ -610,14 +663,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
@@ -671,29 +731,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['judgmentResult'] = "pass";
+          // } else {
+          //   target['judgmentResult'] = "fail";
+          // }
+          // if (value == null || value == "") {
+          //   target['judgmentResult'] = "";
+          // }
+          // }
         }
         if (column.dataIndex == 'abnormalDesc') {
           target[column.dataIndex] = value.target.value;
@@ -737,43 +797,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)
-      }
-    },
   },
 
 }
@@ -796,7 +820,7 @@
 .hight {
   color: #f5222d;
 }
-/deep/ .red {
+.red {
   color: red;
 }
 </style>
\ No newline at end of file

--
Gitblit v1.9.3