From ea945f154a16a1a3dd6d0126f127bbac19564f77 Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期六, 16 五月 2026 16:22:07 +0800
Subject: [PATCH] 更新质量管理,新增合格数量和不合格数量字段,修改数量标签为总数量,计算合格率展示

---
 src/pages/qualityManagement/processInspection/detail.vue  |   37 ++-
 src/pages/qualityManagement/processInspection/index.vue   |   26 +-
 src/pages/qualityManagement/finalInspection/index.vue     |   26 +-
 src/pages/qualityManagement/finalInspection/add.vue       |   95 +++++------
 src/pages/qualityManagement/materialInspection/add.vue    |   95 +++++------
 src/pages/qualityManagement/materialInspection/detail.vue |   39 +++-
 src/pages/qualityManagement/materialInspection/index.vue  |   26 +-
 src/pages/qualityManagement/processInspection/add.vue     |   95 +++++------
 src/pages/qualityManagement/finalInspection/detail.vue    |   37 ++-
 9 files changed, 238 insertions(+), 238 deletions(-)

diff --git a/src/pages/qualityManagement/finalInspection/add.vue b/src/pages/qualityManagement/finalInspection/add.vue
index 94321dd..9bae6c6 100644
--- a/src/pages/qualityManagement/finalInspection/add.vue
+++ b/src/pages/qualityManagement/finalInspection/add.vue
@@ -68,14 +68,32 @@
                   placeholder="璇疯緭鍏ュ崟浣�"
                   disabled />
       </up-form-item>
-      <up-form-item label="鏁伴噺"
+      <up-form-item label="鎬绘暟閲�"
                     prop="quantity"
                     required
                     border-bottom>
         <up-input v-model="form.quantity"
                   type="number"
-                  placeholder="璇疯緭鍏ユ暟閲�"
+                  placeholder="璇疯緭鍏ユ�绘暟閲�"
                   :disabled="processQuantityDisabled" />
+      </up-form-item>
+      <up-form-item label="鍚堟牸鏁伴噺"
+                    prop="qualifiedQuantity"
+                    required
+                    border-bottom>
+        <up-input v-model="form.qualifiedQuantity"
+                  type="number"
+                  placeholder="璇疯緭鍏ュ悎鏍兼暟閲�"
+                  clearable />
+      </up-form-item>
+      <up-form-item label="涓嶅悎鏍兼暟閲�"
+                    prop="unqualifiedQuantity"
+                    required
+                    border-bottom>
+        <up-input v-model="form.unqualifiedQuantity"
+                  type="number"
+                  placeholder="璇疯緭鍏ヤ笉鍚堟牸鏁伴噺"
+                  clearable />
       </up-form-item>
       <up-form-item label="妫�娴嬪崟浣�"
                     prop="checkCompany"
@@ -83,19 +101,6 @@
         <up-input v-model="form.checkCompany"
                   placeholder="璇疯緭鍏ユ娴嬪崟浣�"
                   clearable />
-      </up-form-item>
-      <up-form-item label="妫�娴嬬粨鏋�"
-                    prop="checkResult"
-                    required
-                    border-bottom>
-        <up-input v-model="form.checkResult"
-                  placeholder="璇烽�夋嫨妫�娴嬬粨鏋�"
-                  readonly
-                  @click="showResultSheet" />
-        <template #right>
-          <up-icon @click="showResultSheet = true"
-                   name="arrow-right" />
-        </template>
       </up-form-item>
       <up-form-item label="妫�楠屽憳"
                     prop="checkName"
@@ -208,12 +213,6 @@
                      @select="selectModel"
                      @close="showModelSheet = false"
                      title="閫夋嫨瑙勬牸鍨嬪彿" />
-    <!-- 妫�娴嬬粨鏋滈�夋嫨 -->
-    <up-action-sheet :show="showResultSheet"
-                     :actions="resultSheetOptions"
-                     @select="selectResult"
-                     @close="showResultSheet = false"
-                     title="閫夋嫨妫�娴嬬粨鏋�" />
     <!-- 妫�楠屽憳閫夋嫨 -->
     <up-action-sheet :show="showInspectorSheet"
                      :actions="userSheetOptions"
@@ -340,8 +339,6 @@
   const showProductTree = ref(false);
   // 瑙勬牸鍨嬪彿閫夋嫨
   const showModelSheet = ref(false);
-  // 妫�娴嬬粨鏋滈�夋嫨
-  const showResultSheet = ref(false);
   // 妫�楠屽憳閫夋嫨
   const showInspectorSheet = ref(false);
   // 鎸囨爣閫夋嫨
@@ -359,8 +356,9 @@
     testStandardId: "",
     unit: "",
     quantity: "",
+    qualifiedQuantity: "",
+    unqualifiedQuantity: "",
     checkCompany: "",
-    checkResult: "",
     productMainId: null,
     purchaseLedgerId: null,
   });
@@ -380,11 +378,6 @@
   const modelOptions = ref([]);
   // 妫�楠屽憳鍒楄〃
   const userList = ref([]);
-  // 妫�娴嬬粨鏋滈�夐」
-  const resultOptions = ref([
-    { label: "鍚堟牸", value: "鍚堟牸" },
-    { label: "涓嶅悎鏍�", value: "涓嶅悎鏍�" },
-  ]);
   // 鎸囨爣閫夐」
   const testStandardOptions = ref([]);
   // 褰撳墠浜у搧ID
@@ -409,13 +402,6 @@
     return modelOptions.value.map(item => ({
       name: item.model,
       value: item.id,
-    }));
-  });
-
-  const resultSheetOptions = computed(() => {
-    return resultOptions.value.map(item => ({
-      name: item.label,
-      value: item.value,
     }));
   });
 
@@ -447,10 +433,9 @@
     ],
     unit: [{ required: false, message: "璇疯緭鍏�", trigger: "blur" }],
     quantity: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
+    qualifiedQuantity: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
+    unqualifiedQuantity: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
     checkCompany: [{ required: false, message: "璇疯緭鍏�", trigger: "blur" }],
-    checkResult: [
-      { required: true, message: "璇烽�夋嫨妫�娴嬬粨鏋�", trigger: "change" },
-    ],
   };
 
   // 鏄惁涓虹紪杈戞ā寮�
@@ -555,12 +540,6 @@
       modelOptions.value.find(item => item.id == value)?.model || "";
     form.value.unit =
       modelOptions.value.find(item => item.id == value)?.unit || "";
-  };
-
-  // 閫夋嫨妫�娴嬬粨鏋�
-  const selectResult = e => {
-    form.value.checkResult = e.value;
-    showResultSheet.value = false;
   };
 
   // 閫夋嫨妫�楠屽憳
@@ -685,7 +664,15 @@
       //   return;
       // }
       if (!form.value.quantity) {
-        showToast("璇疯緭鍏ユ暟閲�");
+        showToast("璇疯緭鍏ユ�绘暟閲�");
+        return;
+      }
+      if (!form.value.qualifiedQuantity && form.value.qualifiedQuantity !== 0) {
+        showToast("璇疯緭鍏ュ悎鏍兼暟閲�");
+        return;
+      }
+      if (!form.value.unqualifiedQuantity && form.value.unqualifiedQuantity !== 0) {
+        showToast("璇疯緭鍏ヤ笉鍚堟牸鏁伴噺");
         return;
       }
       if (!form.value.productId) {
@@ -696,11 +683,6 @@
         showToast("璇烽�夋嫨鎸囨爣");
         return;
       }
-      if (!form.value.checkResult) {
-        showToast("璇烽�夋嫨妫�娴嬬粨鏋�");
-        return;
-      }
-
       loading.value = true;
 
       form.value.inspectType = 2;
@@ -712,6 +694,8 @@
 
       const data = { ...form.value, qualityInspectParams: tableData.value };
       data.quantity = Number(data.quantity);
+      data.qualifiedQuantity = Number(data.qualifiedQuantity);
+      data.unqualifiedQuantity = Number(data.unqualifiedQuantity);
       if (isEdit.value) {
         const res = await qualityInspectUpdate(data);
         showToast("淇濆瓨鎴愬姛");
@@ -751,7 +735,8 @@
         unit: "",
         quantity: "",
         checkCompany: "",
-        checkResult: "",
+        qualifiedQuantity: "",
+        unqualifiedQuantity: "",
         productMainId: null,
         purchaseLedgerId: null,
       };
@@ -773,7 +758,8 @@
         unit: "kg",
         quantity: 1000,
         checkCompany: "绗笁鏂规娴嬫満鏋�",
-        checkResult: "鍚堟牸",
+        qualifiedQuantity: 0,
+        unqualifiedQuantity: 0,
         productMainId: null,
         purchaseLedgerId: null,
       };
@@ -852,8 +838,9 @@
         testStandardId: "",
         unit: "",
         quantity: "",
+        qualifiedQuantity: "",
+        unqualifiedQuantity: "",
         checkCompany: "",
-        checkResult: "",
         productMainId: null,
         purchaseLedgerId: null,
       };
diff --git a/src/pages/qualityManagement/finalInspection/detail.vue b/src/pages/qualityManagement/finalInspection/detail.vue
index d274a28..316d2fd 100644
--- a/src/pages/qualityManagement/finalInspection/detail.vue
+++ b/src/pages/qualityManagement/finalInspection/detail.vue
@@ -15,11 +15,11 @@
           </view>
           <text class="header-title">{{ detailData.productName || '-' }}</text>
           <view class="status-tags">
-            <u-tag v-if="detailData.checkResult"
-                   :type="getTagType(detailData.checkResult)"
+            <u-tag v-if="detailData.passRate != null && detailData.passRate !== ''"
+                   type="primary"
                    size="small"
                    class="status-tag">
-              {{ detailData.checkResult || '-' }}
+              鍚堟牸鐜� {{ formatPassRate(detailData.passRate) }}
             </u-tag>
             <u-tag :type="getStateTagType(detailData.inspectState)"
                    size="small"
@@ -59,8 +59,20 @@
             <text class="detail-value">{{ detailData.unit || '-' }}</text>
           </view>
           <view class="detail-row">
-            <text class="detail-label">鏁伴噺</text>
-            <text class="detail-value">{{ detailData.quantity || 0 }}</text>
+            <text class="detail-label">鎬绘暟閲�</text>
+            <text class="detail-value">{{ detailData.quantity ?? 0 }}</text>
+          </view>
+          <view class="detail-row">
+            <text class="detail-label">鍚堟牸鏁伴噺</text>
+            <text class="detail-value">{{ detailData.qualifiedQuantity ?? 0 }}</text>
+          </view>
+          <view class="detail-row">
+            <text class="detail-label">涓嶅悎鏍兼暟閲�</text>
+            <text class="detail-value">{{ detailData.unqualifiedQuantity ?? 0 }}</text>
+          </view>
+          <view class="detail-row">
+            <text class="detail-label">鍚堟牸鐜�</text>
+            <text class="detail-value">{{ formatPassRate(detailData.passRate) }}</text>
           </view>
           <view class="detail-row">
             <text class="detail-label">妫�娴嬪崟浣�</text>
@@ -162,15 +174,12 @@
   };
 
   // 鑾峰彇鏍囩绫诲瀷
-  const getTagType = result => {
-    switch (result) {
-      case "鍚堟牸":
-        return "success";
-      case "涓嶅悎鏍�":
-        return "error";
-      default:
-        return "info";
-    }
+  const formatPassRate = rate => {
+    if (rate === null || rate === undefined || rate === "") return "-";
+    const num = Number(rate);
+    if (isNaN(num)) return rate;
+    if (num <= 1) return `${(num * 100).toFixed(2)}%`;
+    return `${num}%`;
   };
 
   // 鑾峰彇鐘舵�佹爣绛剧被鍨�
diff --git a/src/pages/qualityManagement/finalInspection/index.vue b/src/pages/qualityManagement/finalInspection/index.vue
index 0e860ff..7eebf01 100644
--- a/src/pages/qualityManagement/finalInspection/index.vue
+++ b/src/pages/qualityManagement/finalInspection/index.vue
@@ -76,11 +76,11 @@
               </view>
             </view>
             <view class="status-tags">
-              <u-tag v-if="item.checkResult"
-                     :type="getTagType(item.checkResult)"
+              <u-tag v-if="item.passRate != null && item.passRate !== ''"
+                     type="primary"
                      size="mini"
                      class="status-tag">
-                {{ item.checkResult }}
+                鍚堟牸鐜� {{ formatPassRate(item.passRate) }}
               </u-tag>
               <u-tag :type="getStateTagType(item.inspectState)"
                      size="mini"
@@ -316,11 +316,13 @@
     return inspectState ? "checkmark-circle" : "time";
   };
 
-  // 鑾峰彇鏍囩绫诲瀷
-  const getTagType = checkResult => {
-    if (checkResult === "鍚堟牸") return "success";
-    if (checkResult === "涓嶅悎鏍�") return "error";
-    return "default";
+  // 鏍煎紡鍖栧悎鏍肩巼
+  const formatPassRate = rate => {
+    if (rate === null || rate === undefined || rate === "") return "-";
+    const num = Number(rate);
+    if (isNaN(num)) return rate;
+    if (num <= 1) return `${(num * 100).toFixed(2)}%`;
+    return `${num}%`;
   };
 
   // 鑾峰彇鐘舵�佹爣绛剧被鍨�
@@ -383,9 +385,11 @@
         pendingCount.value = inspectionList.value.filter(
           item => !item.inspectState
         ).length;
-        qualifiedCount.value = inspectionList.value.filter(
-          item => item.checkResult === "鍚堟牸"
-        ).length;
+        qualifiedCount.value = inspectionList.value.filter(item => {
+          const rate = Number(item.passRate);
+          if (isNaN(rate)) return false;
+          return rate <= 1 ? rate >= 1 : rate >= 100;
+        }).length;
       })
       .catch(err => {
         tableLoading.value = false;
diff --git a/src/pages/qualityManagement/materialInspection/add.vue b/src/pages/qualityManagement/materialInspection/add.vue
index e04391f..fec83fd 100644
--- a/src/pages/qualityManagement/materialInspection/add.vue
+++ b/src/pages/qualityManagement/materialInspection/add.vue
@@ -68,14 +68,32 @@
                   placeholder="璇疯緭鍏ュ崟浣�"
                   disabled />
       </up-form-item>
-      <up-form-item label="鏁伴噺"
+      <up-form-item label="鎬绘暟閲�"
                     prop="quantity"
                     required
                     border-bottom>
         <up-input v-model="form.quantity"
                   type="number"
-                  placeholder="璇疯緭鍏ユ暟閲�"
+                  placeholder="璇疯緭鍏ユ�绘暟閲�"
                   :disabled="supplierQuantityDisabled" />
+      </up-form-item>
+      <up-form-item label="鍚堟牸鏁伴噺"
+                    prop="qualifiedQuantity"
+                    required
+                    border-bottom>
+        <up-input v-model="form.qualifiedQuantity"
+                  type="number"
+                  placeholder="璇疯緭鍏ュ悎鏍兼暟閲�"
+                  clearable />
+      </up-form-item>
+      <up-form-item label="涓嶅悎鏍兼暟閲�"
+                    prop="unqualifiedQuantity"
+                    required
+                    border-bottom>
+        <up-input v-model="form.unqualifiedQuantity"
+                  type="number"
+                  placeholder="璇疯緭鍏ヤ笉鍚堟牸鏁伴噺"
+                  clearable />
       </up-form-item>
       <up-form-item label="妫�娴嬪崟浣�"
                     prop="checkCompany"
@@ -83,19 +101,6 @@
         <up-input v-model="form.checkCompany"
                   placeholder="璇疯緭鍏ユ娴嬪崟浣�"
                   clearable />
-      </up-form-item>
-      <up-form-item label="妫�娴嬬粨鏋�"
-                    prop="checkResult"
-                    required
-                    border-bottom>
-        <up-input v-model="form.checkResult"
-                  placeholder="璇烽�夋嫨妫�娴嬬粨鏋�"
-                  readonly
-                  @click="showResultSheet" />
-        <template #right>
-          <up-icon @click="showResultSheet = true"
-                   name="arrow-right" />
-        </template>
       </up-form-item>
       <up-form-item label="妫�楠屽憳"
                     prop="checkName"
@@ -220,12 +225,6 @@
                      @select="selectModel"
                      @close="showModelSheet = false"
                      title="閫夋嫨瑙勬牸鍨嬪彿" />
-    <!-- 妫�娴嬬粨鏋滈�夋嫨 -->
-    <up-action-sheet :show="showResultSheet"
-                     :actions="resultSheetOptions"
-                     @select="selectResult"
-                     @close="showResultSheet = false"
-                     title="閫夋嫨妫�娴嬬粨鏋�" />
     <!-- 妫�楠屽憳閫夋嫨 -->
     <up-action-sheet :show="showInspectorSheet"
                      :actions="userSheetOptions"
@@ -352,8 +351,6 @@
   const showProductTree = ref(false);
   // 瑙勬牸鍨嬪彿閫夋嫨
   const showModelSheet = ref(false);
-  // 妫�娴嬬粨鏋滈�夋嫨
-  const showResultSheet = ref(false);
   // 妫�楠屽憳閫夋嫨
   const showInspectorSheet = ref(false);
   // 鎸囨爣閫夋嫨
@@ -371,8 +368,9 @@
     testStandardId: "",
     unit: "",
     quantity: "",
+    qualifiedQuantity: "",
+    unqualifiedQuantity: "",
     checkCompany: "",
-    checkResult: "",
     productMainId: null,
     purchaseLedgerId: null,
   });
@@ -392,11 +390,6 @@
   const modelOptions = ref([]);
   // 妫�楠屽憳鍒楄〃
   const userList = ref([]);
-  // 妫�娴嬬粨鏋滈�夐」
-  const resultOptions = ref([
-    { label: "鍚堟牸", value: "鍚堟牸" },
-    { label: "涓嶅悎鏍�", value: "涓嶅悎鏍�" },
-  ]);
   // 鎸囨爣閫夐」
   const testStandardOptions = ref([]);
   // 褰撳墠浜у搧ID
@@ -421,13 +414,6 @@
     return modelOptions.value.map(item => ({
       name: item.model,
       value: item.id,
-    }));
-  });
-
-  const resultSheetOptions = computed(() => {
-    return resultOptions.value.map(item => ({
-      name: item.label,
-      value: item.value,
     }));
   });
 
@@ -459,10 +445,9 @@
     ],
     unit: [{ required: false, message: "璇疯緭鍏�", trigger: "blur" }],
     quantity: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
+    qualifiedQuantity: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
+    unqualifiedQuantity: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
     checkCompany: [{ required: false, message: "璇疯緭鍏�", trigger: "blur" }],
-    checkResult: [
-      { required: true, message: "璇烽�夋嫨妫�娴嬬粨鏋�", trigger: "change" },
-    ],
   };
 
   // 鏄惁涓虹紪杈戞ā寮�
@@ -568,12 +553,6 @@
       modelOptions.value.find(item => item.id == value)?.model || "";
     form.value.unit =
       modelOptions.value.find(item => item.id == value)?.unit || "";
-  };
-
-  // 閫夋嫨妫�娴嬬粨鏋�
-  const selectResult = e => {
-    form.value.checkResult = e.value;
-    showResultSheet.value = false;
   };
 
   // 閫夋嫨妫�楠屽憳
@@ -698,7 +677,15 @@
         return;
       }
       if (!form.value.quantity) {
-        showToast("璇疯緭鍏ユ暟閲�");
+        showToast("璇疯緭鍏ユ�绘暟閲�");
+        return;
+      }
+      if (!form.value.qualifiedQuantity && form.value.qualifiedQuantity !== 0) {
+        showToast("璇疯緭鍏ュ悎鏍兼暟閲�");
+        return;
+      }
+      if (!form.value.unqualifiedQuantity && form.value.unqualifiedQuantity !== 0) {
+        showToast("璇疯緭鍏ヤ笉鍚堟牸鏁伴噺");
         return;
       }
       if (!form.value.productId) {
@@ -709,11 +696,6 @@
         showToast("璇烽�夋嫨鎸囨爣");
         return;
       }
-      if (!form.value.checkResult) {
-        showToast("璇烽�夋嫨妫�娴嬬粨鏋�");
-        return;
-      }
-
       loading.value = true;
 
       form.value.inspectType = 0;
@@ -725,6 +707,8 @@
 
       const data = { ...form.value, qualityInspectParams: tableData.value };
       data.quantity = Number(data.quantity);
+      data.qualifiedQuantity = Number(data.qualifiedQuantity);
+      data.unqualifiedQuantity = Number(data.unqualifiedQuantity);
       if (isEdit.value) {
         const res = await qualityInspectUpdate(data);
         showToast("淇濆瓨鎴愬姛");
@@ -764,7 +748,8 @@
         unit: "",
         quantity: "",
         checkCompany: "",
-        checkResult: "",
+        qualifiedQuantity: "",
+        unqualifiedQuantity: "",
         productMainId: null,
         purchaseLedgerId: null,
       };
@@ -786,7 +771,8 @@
         unit: "kg",
         quantity: 1000,
         checkCompany: "绗笁鏂规娴嬫満鏋�",
-        checkResult: "鍚堟牸",
+        qualifiedQuantity: 0,
+        unqualifiedQuantity: 0,
         productMainId: null,
         purchaseLedgerId: null,
       };
@@ -865,8 +851,9 @@
         testStandardId: "",
         unit: "",
         quantity: "",
+        qualifiedQuantity: "",
+        unqualifiedQuantity: "",
         checkCompany: "",
-        checkResult: "",
         productMainId: null,
         purchaseLedgerId: null,
       };
diff --git a/src/pages/qualityManagement/materialInspection/detail.vue b/src/pages/qualityManagement/materialInspection/detail.vue
index 12ff7a3..8ae3970 100644
--- a/src/pages/qualityManagement/materialInspection/detail.vue
+++ b/src/pages/qualityManagement/materialInspection/detail.vue
@@ -15,11 +15,11 @@
           </view>
           <text class="header-title">{{ detailData.productName || '-' }}</text>
           <view class="status-tags">
-            <u-tag v-if="detailData.checkResult"
-                   :type="getTagType(detailData.checkResult)"
+            <u-tag v-if="detailData.passRate != null && detailData.passRate !== ''"
+                   type="primary"
                    size="small"
                    class="status-tag">
-              {{ detailData.checkResult || '-' }}
+              鍚堟牸鐜� {{ formatPassRate(detailData.passRate) }}
             </u-tag>
             <u-tag :type="getStateTagType(detailData.inspectState)"
                    size="small"
@@ -59,8 +59,20 @@
             <text class="detail-value">{{ detailData.unit || '-' }}</text>
           </view>
           <view class="detail-row">
-            <text class="detail-label">鏁伴噺</text>
-            <text class="detail-value">{{ detailData.quantity || 0 }}</text>
+            <text class="detail-label">鎬绘暟閲�</text>
+            <text class="detail-value">{{ detailData.quantity ?? 0 }}</text>
+          </view>
+          <view class="detail-row">
+            <text class="detail-label">鍚堟牸鏁伴噺</text>
+            <text class="detail-value">{{ detailData.qualifiedQuantity ?? 0 }}</text>
+          </view>
+          <view class="detail-row">
+            <text class="detail-label">涓嶅悎鏍兼暟閲�</text>
+            <text class="detail-value">{{ detailData.unqualifiedQuantity ?? 0 }}</text>
+          </view>
+          <view class="detail-row">
+            <text class="detail-label">鍚堟牸鐜�</text>
+            <text class="detail-value">{{ formatPassRate(detailData.passRate) }}</text>
           </view>
           <view class="detail-row">
             <text class="detail-label">妫�娴嬪崟浣�</text>
@@ -161,16 +173,13 @@
     return dayjs(date).format("YYYY-MM-DD");
   };
 
-  // 鑾峰彇鏍囩绫诲瀷
-  const getTagType = result => {
-    switch (result) {
-      case "鍚堟牸":
-        return "success";
-      case "涓嶅悎鏍�":
-        return "error";
-      default:
-        return "info";
-    }
+  // 鏍煎紡鍖栧悎鏍肩巼
+  const formatPassRate = rate => {
+    if (rate === null || rate === undefined || rate === "") return "-";
+    const num = Number(rate);
+    if (isNaN(num)) return rate;
+    if (num <= 1) return `${(num * 100).toFixed(2)}%`;
+    return `${num}%`;
   };
 
   // 鑾峰彇鐘舵�佹爣绛剧被鍨�
diff --git a/src/pages/qualityManagement/materialInspection/index.vue b/src/pages/qualityManagement/materialInspection/index.vue
index eb4a140..571e68f 100644
--- a/src/pages/qualityManagement/materialInspection/index.vue
+++ b/src/pages/qualityManagement/materialInspection/index.vue
@@ -76,11 +76,11 @@
               </view>
             </view>
             <view class="status-tags">
-              <u-tag v-if="item.checkResult"
-                     :type="getTagType(item.checkResult)"
+              <u-tag v-if="item.passRate != null && item.passRate !== ''"
+                     type="primary"
                      size="mini"
                      class="status-tag">
-                {{ item.checkResult }}
+                鍚堟牸鐜� {{ formatPassRate(item.passRate) }}
               </u-tag>
               <u-tag :type="getStateTagType(item.inspectState)"
                      size="mini"
@@ -316,11 +316,13 @@
     return inspectState ? "checkmark-circle" : "time";
   };
 
-  // 鑾峰彇鏍囩绫诲瀷
-  const getTagType = checkResult => {
-    if (checkResult === "鍚堟牸") return "success";
-    if (checkResult === "涓嶅悎鏍�") return "error";
-    return "default";
+  // 鏍煎紡鍖栧悎鏍肩巼
+  const formatPassRate = rate => {
+    if (rate === null || rate === undefined || rate === "") return "-";
+    const num = Number(rate);
+    if (isNaN(num)) return rate;
+    if (num <= 1) return `${(num * 100).toFixed(2)}%`;
+    return `${num}%`;
   };
 
   // 鑾峰彇鐘舵�佹爣绛剧被鍨�
@@ -383,9 +385,11 @@
         pendingCount.value = inspectionList.value.filter(
           item => !item.inspectState
         ).length;
-        qualifiedCount.value = inspectionList.value.filter(
-          item => item.checkResult === "鍚堟牸"
-        ).length;
+        qualifiedCount.value = inspectionList.value.filter(item => {
+          const rate = Number(item.passRate);
+          if (isNaN(rate)) return false;
+          return rate <= 1 ? rate >= 1 : rate >= 100;
+        }).length;
       })
       .catch(err => {
         tableLoading.value = false;
diff --git a/src/pages/qualityManagement/processInspection/add.vue b/src/pages/qualityManagement/processInspection/add.vue
index 2f6a6d0..f546fcb 100644
--- a/src/pages/qualityManagement/processInspection/add.vue
+++ b/src/pages/qualityManagement/processInspection/add.vue
@@ -68,14 +68,32 @@
                   placeholder="璇疯緭鍏ュ崟浣�"
                   disabled />
       </up-form-item>
-      <up-form-item label="鏁伴噺"
+      <up-form-item label="鎬绘暟閲�"
                     prop="quantity"
                     required
                     border-bottom>
         <up-input v-model="form.quantity"
                   type="number"
-                  placeholder="璇疯緭鍏ユ暟閲�"
+                  placeholder="璇疯緭鍏ユ�绘暟閲�"
                   :disabled="processQuantityDisabled" />
+      </up-form-item>
+      <up-form-item label="鍚堟牸鏁伴噺"
+                    prop="qualifiedQuantity"
+                    required
+                    border-bottom>
+        <up-input v-model="form.qualifiedQuantity"
+                  type="number"
+                  placeholder="璇疯緭鍏ュ悎鏍兼暟閲�"
+                  clearable />
+      </up-form-item>
+      <up-form-item label="涓嶅悎鏍兼暟閲�"
+                    prop="unqualifiedQuantity"
+                    required
+                    border-bottom>
+        <up-input v-model="form.unqualifiedQuantity"
+                  type="number"
+                  placeholder="璇疯緭鍏ヤ笉鍚堟牸鏁伴噺"
+                  clearable />
       </up-form-item>
       <up-form-item label="妫�娴嬪崟浣�"
                     prop="checkCompany"
@@ -83,19 +101,6 @@
         <up-input v-model="form.checkCompany"
                   placeholder="璇疯緭鍏ユ娴嬪崟浣�"
                   clearable />
-      </up-form-item>
-      <up-form-item label="妫�娴嬬粨鏋�"
-                    prop="checkResult"
-                    required
-                    border-bottom>
-        <up-input v-model="form.checkResult"
-                  placeholder="璇烽�夋嫨妫�娴嬬粨鏋�"
-                  readonly
-                  @click="showResultSheet" />
-        <template #right>
-          <up-icon @click="showResultSheet = true"
-                   name="arrow-right" />
-        </template>
       </up-form-item>
       <up-form-item label="妫�楠屽憳"
                     prop="checkName"
@@ -212,12 +217,6 @@
                      @select="selectModel"
                      @close="showModelSheet = false"
                      title="閫夋嫨瑙勬牸鍨嬪彿" />
-    <!-- 妫�娴嬬粨鏋滈�夋嫨 -->
-    <up-action-sheet :show="showResultSheet"
-                     :actions="resultSheetOptions"
-                     @select="selectResult"
-                     @close="showResultSheet = false"
-                     title="閫夋嫨妫�娴嬬粨鏋�" />
     <!-- 妫�楠屽憳閫夋嫨 -->
     <up-action-sheet :show="showInspectorSheet"
                      :actions="userSheetOptions"
@@ -344,8 +343,6 @@
   const showProductTree = ref(false);
   // 瑙勬牸鍨嬪彿閫夋嫨
   const showModelSheet = ref(false);
-  // 妫�娴嬬粨鏋滈�夋嫨
-  const showResultSheet = ref(false);
   // 妫�楠屽憳閫夋嫨
   const showInspectorSheet = ref(false);
   // 鎸囨爣閫夋嫨
@@ -363,8 +360,9 @@
     testStandardId: "",
     unit: "",
     quantity: "",
+    qualifiedQuantity: "",
+    unqualifiedQuantity: "",
     checkCompany: "",
-    checkResult: "",
     productMainId: null,
     purchaseLedgerId: null,
   });
@@ -384,11 +382,6 @@
   const modelOptions = ref([]);
   // 妫�楠屽憳鍒楄〃
   const userList = ref([]);
-  // 妫�娴嬬粨鏋滈�夐」
-  const resultOptions = ref([
-    { label: "鍚堟牸", value: "鍚堟牸" },
-    { label: "涓嶅悎鏍�", value: "涓嶅悎鏍�" },
-  ]);
   // 鎸囨爣閫夐」
   const testStandardOptions = ref([]);
   // 褰撳墠浜у搧ID
@@ -413,13 +406,6 @@
     return modelOptions.value.map(item => ({
       name: item.model,
       value: item.id,
-    }));
-  });
-
-  const resultSheetOptions = computed(() => {
-    return resultOptions.value.map(item => ({
-      name: item.label,
-      value: item.value,
     }));
   });
 
@@ -451,10 +437,9 @@
     ],
     unit: [{ required: false, message: "璇疯緭鍏�", trigger: "blur" }],
     quantity: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
+    qualifiedQuantity: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
+    unqualifiedQuantity: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
     checkCompany: [{ required: false, message: "璇疯緭鍏�", trigger: "blur" }],
-    checkResult: [
-      { required: true, message: "璇烽�夋嫨妫�娴嬬粨鏋�", trigger: "change" },
-    ],
   };
 
   // 鏄惁涓虹紪杈戞ā寮�
@@ -559,12 +544,6 @@
       modelOptions.value.find(item => item.id == value)?.model || "";
     form.value.unit =
       modelOptions.value.find(item => item.id == value)?.unit || "";
-  };
-
-  // 閫夋嫨妫�娴嬬粨鏋�
-  const selectResult = e => {
-    form.value.checkResult = e.value;
-    showResultSheet.value = false;
   };
 
   // 閫夋嫨妫�楠屽憳
@@ -689,7 +668,15 @@
         return;
       }
       if (!form.value.quantity) {
-        showToast("璇疯緭鍏ユ暟閲�");
+        showToast("璇疯緭鍏ユ�绘暟閲�");
+        return;
+      }
+      if (!form.value.qualifiedQuantity && form.value.qualifiedQuantity !== 0) {
+        showToast("璇疯緭鍏ュ悎鏍兼暟閲�");
+        return;
+      }
+      if (!form.value.unqualifiedQuantity && form.value.unqualifiedQuantity !== 0) {
+        showToast("璇疯緭鍏ヤ笉鍚堟牸鏁伴噺");
         return;
       }
       if (!form.value.productId) {
@@ -700,11 +687,6 @@
         showToast("璇烽�夋嫨鎸囨爣");
         return;
       }
-      if (!form.value.checkResult) {
-        showToast("璇烽�夋嫨妫�娴嬬粨鏋�");
-        return;
-      }
-
       loading.value = true;
 
       form.value.inspectType = 1;
@@ -716,6 +698,8 @@
 
       const data = { ...form.value, qualityInspectParams: tableData.value };
       data.quantity = Number(data.quantity);
+      data.qualifiedQuantity = Number(data.qualifiedQuantity);
+      data.unqualifiedQuantity = Number(data.unqualifiedQuantity);
       if (isEdit.value) {
         const res = await qualityInspectUpdate(data);
         showToast("淇濆瓨鎴愬姛");
@@ -755,7 +739,8 @@
         unit: "",
         quantity: "",
         checkCompany: "",
-        checkResult: "",
+        qualifiedQuantity: "",
+        unqualifiedQuantity: "",
         productMainId: null,
         purchaseLedgerId: null,
       };
@@ -777,7 +762,8 @@
         unit: "kg",
         quantity: 1000,
         checkCompany: "绗笁鏂规娴嬫満鏋�",
-        checkResult: "鍚堟牸",
+        qualifiedQuantity: 0,
+        unqualifiedQuantity: 0,
         productMainId: null,
         purchaseLedgerId: null,
       };
@@ -856,8 +842,9 @@
         testStandardId: "",
         unit: "",
         quantity: "",
+        qualifiedQuantity: "",
+        unqualifiedQuantity: "",
         checkCompany: "",
-        checkResult: "",
         productMainId: null,
         purchaseLedgerId: null,
       };
diff --git a/src/pages/qualityManagement/processInspection/detail.vue b/src/pages/qualityManagement/processInspection/detail.vue
index 798aeee..ee368e4 100644
--- a/src/pages/qualityManagement/processInspection/detail.vue
+++ b/src/pages/qualityManagement/processInspection/detail.vue
@@ -15,11 +15,11 @@
           </view>
           <text class="header-title">{{ detailData.productName || '-' }}</text>
           <view class="status-tags">
-            <u-tag v-if="detailData.checkResult"
-                   :type="getTagType(detailData.checkResult)"
+            <u-tag v-if="detailData.passRate != null && detailData.passRate !== ''"
+                   type="primary"
                    size="small"
                    class="status-tag">
-              {{ detailData.checkResult }}
+              鍚堟牸鐜� {{ formatPassRate(detailData.passRate) }}
             </u-tag>
             <u-tag :type="getStateTagType(detailData.inspectState)"
                    size="small"
@@ -59,8 +59,20 @@
             <text class="detail-value">{{ detailData.unit || '-' }}</text>
           </view>
           <view class="detail-row">
-            <text class="detail-label">鏁伴噺</text>
-            <text class="detail-value">{{ detailData.quantity || 0 }}</text>
+            <text class="detail-label">鎬绘暟閲�</text>
+            <text class="detail-value">{{ detailData.quantity ?? 0 }}</text>
+          </view>
+          <view class="detail-row">
+            <text class="detail-label">鍚堟牸鏁伴噺</text>
+            <text class="detail-value">{{ detailData.qualifiedQuantity ?? 0 }}</text>
+          </view>
+          <view class="detail-row">
+            <text class="detail-label">涓嶅悎鏍兼暟閲�</text>
+            <text class="detail-value">{{ detailData.unqualifiedQuantity ?? 0 }}</text>
+          </view>
+          <view class="detail-row">
+            <text class="detail-label">鍚堟牸鐜�</text>
+            <text class="detail-value">{{ formatPassRate(detailData.passRate) }}</text>
           </view>
           <view class="detail-row">
             <text class="detail-label">妫�娴嬪崟浣�</text>
@@ -162,15 +174,12 @@
   };
 
   // 鑾峰彇鏍囩绫诲瀷
-  const getTagType = result => {
-    switch (result) {
-      case "鍚堟牸":
-        return "success";
-      case "涓嶅悎鏍�":
-        return "error";
-      default:
-        return "info";
-    }
+  const formatPassRate = rate => {
+    if (rate === null || rate === undefined || rate === "") return "-";
+    const num = Number(rate);
+    if (isNaN(num)) return rate;
+    if (num <= 1) return `${(num * 100).toFixed(2)}%`;
+    return `${num}%`;
   };
 
   // 鑾峰彇鐘舵�佹爣绛剧被鍨�
diff --git a/src/pages/qualityManagement/processInspection/index.vue b/src/pages/qualityManagement/processInspection/index.vue
index 40358ef..8f0d064 100644
--- a/src/pages/qualityManagement/processInspection/index.vue
+++ b/src/pages/qualityManagement/processInspection/index.vue
@@ -76,11 +76,11 @@
               </view>
             </view>
             <view class="status-tags">
-              <u-tag v-if="item.checkResult"
-                     :type="getTagType(item.checkResult)"
+              <u-tag v-if="item.passRate != null && item.passRate !== ''"
+                     type="primary"
                      size="mini"
                      class="status-tag">
-                {{ item.checkResult }}
+                鍚堟牸鐜� {{ formatPassRate(item.passRate) }}
               </u-tag>
               <u-tag :type="getStateTagType(item.inspectState)"
                      size="mini"
@@ -316,11 +316,13 @@
     return inspectState ? "checkmark-circle" : "time";
   };
 
-  // 鑾峰彇鏍囩绫诲瀷
-  const getTagType = checkResult => {
-    if (checkResult === "鍚堟牸") return "success";
-    if (checkResult === "涓嶅悎鏍�") return "error";
-    return "default";
+  // 鏍煎紡鍖栧悎鏍肩巼
+  const formatPassRate = rate => {
+    if (rate === null || rate === undefined || rate === "") return "-";
+    const num = Number(rate);
+    if (isNaN(num)) return rate;
+    if (num <= 1) return `${(num * 100).toFixed(2)}%`;
+    return `${num}%`;
   };
 
   // 鑾峰彇鐘舵�佹爣绛剧被鍨�
@@ -383,9 +385,11 @@
         pendingCount.value = inspectionList.value.filter(
           item => !item.inspectState
         ).length;
-        qualifiedCount.value = inspectionList.value.filter(
-          item => item.checkResult === "鍚堟牸"
-        ).length;
+        qualifiedCount.value = inspectionList.value.filter(item => {
+          const rate = Number(item.passRate);
+          if (isNaN(rate)) return false;
+          return rate <= 1 ? rate >= 1 : rate >= 100;
+        }).length;
       })
       .catch(err => {
         tableLoading.value = false;

--
Gitblit v1.9.3