From 7726b6cdab80596d2e2f7dd3fe1ec3dfbdeee155 Mon Sep 17 00:00:00 2001
From: yuan <123@>
Date: 星期五, 12 六月 2026 09:42:40 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_pro_河南鹤壁' into dev_pro_河南鹤壁

---
 src/views/qualityManagement/processInspection/components/formDia.vue |   50 +++++++++++++++++++++++++++++++++++---------------
 1 files changed, 35 insertions(+), 15 deletions(-)

diff --git a/src/views/qualityManagement/processInspection/components/formDia.vue b/src/views/qualityManagement/processInspection/components/formDia.vue
index 635360f..f28cec2 100644
--- a/src/views/qualityManagement/processInspection/components/formDia.vue
+++ b/src/views/qualityManagement/processInspection/components/formDia.vue
@@ -139,16 +139,8 @@
             </el-form-item>
           </el-col>
           <el-col :span="12">
-            <el-form-item label="妫�娴嬬粨鏋滐細"
-                          prop="checkResult">
-              <el-select v-model="form.checkResult" :disabled="isViewMode">
-                <el-option label="鍚堟牸"
-                           value="鍚堟牸" />
-                <el-option label="涓嶅悎鏍�"
-                           value="涓嶅悎鏍�" />
-                <el-option label="閮ㄥ垎鍚堟牸"
-                           value="閮ㄥ垎鍚堟牸" />
-              </el-select>
+            <el-form-item label="鍚堟牸鐜囷細">
+              <el-tag :type="passRateTagType">{{ passRateDisplayText }}</el-tag>
             </el-form-item>
           </el-col>
         </el-row>
@@ -250,7 +242,6 @@
       qualifiedQuantity: "",
       unqualifiedQuantity: "",
       checkCompany: "",
-      checkResult: "",
     },
     rules: {
       checkTime: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
@@ -264,13 +255,43 @@
       qualifiedQuantity: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
       unqualifiedQuantity: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
       checkCompany: [{ required: false, message: "璇疯緭鍏�", trigger: "blur" }],
-      checkResult: [{ required: true, message: "璇疯緭鍏�", trigger: "change" }],
     },
   });
   const userList = ref([]);
   const { form, rules } = toRefs(data);
   // 鏄惁涓烘煡鐪嬫ā寮�
   const isViewMode = computed(() => operationType.value === 'view');
+
+  const passRateValue = computed(() => {
+    const fromApi = form.value.passRate;
+    if (fromApi != null && fromApi !== '') {
+      const n = Number(fromApi);
+      if (!Number.isNaN(n)) return n;
+    }
+    const qualified = Number(form.value.qualifiedQuantity) || 0;
+    const unqualified = Number(form.value.unqualifiedQuantity) || 0;
+    const total = qualified + unqualified;
+    if (!total || total === 0) return null;
+    return (qualified / total) * 100;
+  });
+
+  const passRateDisplayText = computed(() => {
+    const params = passRateValue.value;
+    if (params == null || params === '') return '鈥�';
+    const n = Number(params);
+    if (Number.isNaN(n)) return '鈥�';
+    return `${n.toFixed(2)}%`;
+  });
+
+  const passRateTagType = computed(() => {
+    const params = passRateValue.value;
+    if (params == null || params === '') return 'info';
+    const n = Number(params);
+    if (Number.isNaN(n)) return 'info';
+    if (n >= 100) return 'success';
+    if (n >= 90) return 'warning';
+    return 'danger';
+  });
   // 缂栬緫鏃讹細productMainId 鎴� purchaseLedgerId 浠讳竴鏈夊�煎垯宸ュ簭銆佹暟閲忕疆鐏�
   const processQuantityDisabled = computed(() => {
     const v = form.value || {};
@@ -338,7 +359,6 @@
       unit: "",
       quantity: "",
       checkCompany: "",
-      checkResult: "",
     };
     testStandardOptions.value = [];
     tableData.value = [];
@@ -347,8 +367,8 @@
     if (operationType.value === "edit" || operationType.value === "view") {
       // 鍏堜繚瀛� testStandardId锛岄伩鍏嶈娓呯┖
       const savedTestStandardId = row.testStandardId;
-      // 鍏堣缃〃鍗曟暟鎹紝浣嗘殏鏃舵竻绌� testStandardId锛岀瓑閫夐」鍔犺浇瀹屾垚鍚庡啀璁剧疆
-      form.value = { ...row, testStandardId: "" };
+      const { passRate, ...rowWithoutPassRate } = row;
+      form.value = { ...rowWithoutPassRate, testStandardId: "" };
       currentProductId.value = row.productId || 0;
       // 鍏抽敭锛氱紪杈戞椂鍔犺浇瑙勬牸鍨嬪彿涓嬫媺閫夐」锛屾墠鑳藉弽鏄� productModelId
       if (currentProductId.value) {

--
Gitblit v1.9.3