From 72780bc3f7a4b47ebba49f28f4ffe219c14349ba Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期三, 01 七月 2026 11:16:01 +0800
Subject: [PATCH] 不合格处理调整&合格率统计调整

---
 src/views/business/inspectionTask/inspection.vue |   93 +++++++++++++++++++++++-----------------------
 1 files changed, 47 insertions(+), 46 deletions(-)

diff --git a/src/views/business/inspectionTask/inspection.vue b/src/views/business/inspectionTask/inspection.vue
index 84f0671..bf77e81 100644
--- a/src/views/business/inspectionTask/inspection.vue
+++ b/src/views/business/inspectionTask/inspection.vue
@@ -1150,7 +1150,7 @@
     <UnPassDialog
       v-if="unPassDialog"
       ref="unPassDialog"
-      :orderId="orderId"
+      :selectOrderIds="[orderId]"
       :unPassDialog="unPassDialog"
       @resetForm="resetForm"
     ></UnPassDialog>
@@ -2787,7 +2787,7 @@
                 }
               }
             });
-            if (str != "") {
+            if (str !== "") {
               let count2 = 0;
               for (let i in this.currentSample.insProduct) {
                 let inspectionItemClass =
@@ -3079,24 +3079,27 @@
               this.param[a.id].insValue.find(
                 (m) => m.c == insValue[i].c && m.r == insValue[i].r
               ).u = insValue[i].u;
-              // this.param[a.id].insValue[i].v.v = insValue[i].v
-              // this.param[a.id].insValue[i].u = insValue[i].u
             }
           }
         } catch (e) {}
         try {
-          // 璁惧缂栧彿璧嬪��
-          let equipValue = JSON.parse(a.insProductResult.equipValue);
-          for (let i = 0; i < equipValue.length; i++) {
-            // 鏅�氳澶囪祴鍊�
-            this.param[a.id].equipValue[i].v.v = equipValue[i].v;
+          if(a.insProductResult){
+            // 璁惧缂栧彿璧嬪��
+            let equipValue = JSON.parse(a.insProductResult.equipValue);
+            for (let i = 0; i < equipValue.length; i++) {
+              // 鏅�氳澶囪祴鍊�
+              this.param[a.id].equipValue[i].v.v = equipValue[i].v;
+            }
           }
-        } catch (e) {}
+        } catch (e) {
+          console.log("璁惧缂栧彿璧嬪��----", e);
+        }
         try {
           // 璁惧鍚嶇О璧嬪��
-          let equipName = JSON.parse(a.insProductResult.equipName);
-          for (let i = 0; i < equipName.length; i++) {
-            equipName[i].v !== "" &&
+          if(a.insProductResult){
+            let equipName = JSON.parse(a.insProductResult.equipName);
+            for (let i = 0; i < equipName.length; i++) {
+              equipName[i].v !== "" &&
               equipName[i].v.map((val) => {
                 const index = this.equipOptions.findIndex(
                   (item) => item.value === val
@@ -3106,10 +3109,11 @@
                   val = this.equipOptions[index].deviceName;
                 }
               });
-          }
-          for (let i = 0; i < equipName.length; i++) {
-            // 鏅�氳澶囧悕绉拌祴鍊�
-            this.param[a.id].equipName[i].v.v = equipName[i].v;
+            }
+            for (let i = 0; i < equipName.length; i++) {
+              // 鏅�氳澶囧悕绉拌祴鍊�
+              this.param[a.id].equipName[i].v.v = equipName[i].v;
+            }
           }
         } catch (e) {
           console.log("璁惧鍚嶇О璧嬪��----", e);
@@ -3557,31 +3561,33 @@
       })
         .then((res) => {
           if (res.code === 200) {
-            if (!res.data || res.data.errorMsg.length == 0) {
+            if (!res.data || res.data.errorMsg.length === 0) {
               this.submitLoading = true;
+              this.confirmSubmit(true);
+              //鍘婚櫎鎷嗗垎璁㈠崟鏄惁鐧昏妫�楠岀粨鏋滅‘璁わ紝榛樿鏄�
               //妫�楠岀被鍨嬩负鍘熸潗鏂�
-              if (
-                this.typeSource == 1 &&
-                res.data.unInsOrderCount == 0 &&
-                this.isSplit == 1
-              ) {
-                const htmlStr =
-                  "鏄惁鐧昏IFS閲囪喘妫�楠岀粨鏋滃苟绉诲簱锛熻鎿嶄綔浼氱櫥璁�<span style='color:#ff4949'>鍚屼竴闆朵欢鍚屼竴璁㈠崟鐨勬墍鏈夋媶鍒嗘壒娆�</span>锛岃璋ㄦ厧閫夋嫨銆�";
-                this.$confirm(htmlStr, "鎻愮ず", {
-                  confirmButtonText: "鏄�",
-                  cancelButtonText: "鍚�",
-                  type: "warning",
-                  dangerouslyUseHTMLString: true,
-                })
-                  .then(() => {
-                    this.confirmSubmit(true);
-                  })
-                  .catch(() => {
-                    this.confirmSubmit(false);
-                  });
-              } else {
-                this.confirmSubmit(true);
-              }
+              // if (
+              //   this.typeSource == 1 &&
+              //   res.data.unInsOrderCount == 0 &&
+              //   this.isSplit == 1
+              // ) {
+              //   const htmlStr =
+              //     "鏄惁鐧昏IFS閲囪喘妫�楠岀粨鏋滃苟绉诲簱锛熻鎿嶄綔浼氱櫥璁�<span style='color:#ff4949'>鍚屼竴闆朵欢鍚屼竴璁㈠崟鐨勬墍鏈夋媶鍒嗘壒娆�</span>锛岃璋ㄦ厧閫夋嫨銆�";
+              //   this.$confirm(htmlStr, "鎻愮ず", {
+              //     confirmButtonText: "鏄�",
+              //     cancelButtonText: "鍚�",
+              //     type: "warning",
+              //     dangerouslyUseHTMLString: true,
+              //   })
+              //     .then(() => {
+              //       this.confirmSubmit(true);
+              //     })
+              //     .catch(() => {
+              //       this.confirmSubmit(false);
+              //     });
+              // } else {
+              //   this.confirmSubmit(true);
+              // }
             } else {
               let newData = [];
               const h = this.$createElement;
@@ -3843,7 +3849,7 @@
     toFixed(v, ct) {
       if (v && ct && ct.fa) {
         if (ct.fa.includes(".")) {
-          let num = ct.fa.slice(4).length;
+          let num = ct.fa.split(".")[1].length;
           return Number(v).toFixed(num);
         } else {
           return v;
@@ -4061,11 +4067,6 @@
   display: inline-flex;
   align-items: center;
 }
-</style>
-<style scoped>
-/* .inspection .el-form-item__label {
-  color: #000;
-} */
 
 .inspection .el-drawer__header::before {
   content: "";

--
Gitblit v1.9.3