From c6c1caafba75438cc0eff215f19e9e0b900778d7 Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期五, 15 五月 2026 15:54:06 +0800
Subject: [PATCH] feat: 质检数量区分合格/不合格

---
 src/views/qualityManagement/processInspection/index.vue |   64 ++++++++++++++++++++------------
 1 files changed, 40 insertions(+), 24 deletions(-)

diff --git a/src/views/qualityManagement/processInspection/index.vue b/src/views/qualityManagement/processInspection/index.vue
index 68eda91..85ca0c4 100644
--- a/src/views/qualityManagement/processInspection/index.vue
+++ b/src/views/qualityManagement/processInspection/index.vue
@@ -131,34 +131,46 @@
     width: 100
   },
   {
+    label: "鍚堟牸鏁伴噺",
+    prop: "qualifiedQuantity",
+    width: 100
+  },
+  {
+    label: "涓嶅悎鏍兼暟閲�",
+    prop: "unqualifiedQuantity",
+    width: 100
+  },
+  {
+    label: "鍚堟牸鐜�",
+    prop: "passRate",
+    width: 100,
+    dataType: "tag",
+    formatData: (params) => {
+      if (params == null || params === '') return '鈥�';
+      const n = Number(params);
+      if (Number.isNaN(n)) return '鈥�';
+      return `${n.toFixed(2)}%`;
+    },
+    formatType: (params) => {
+      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';
+    },
+  },
+  {
     label: "妫�娴嬪崟浣�",
     prop: "checkCompany",
     width: 120
   },
-  {
-    label: "妫�娴嬬粨鏋�",
-    prop: "checkResult",
-    dataType: "tag",
-    formatType: (params) => {
-      if (params == '涓嶅悎鏍�') {
-        return "danger";
-      } else if (params == '鍚堟牸') {
-        return "success";
-      } else {
-        return null;
-      }
-    },
-  },
 	{
 		label: "鎻愪氦鐘舵��",
 		prop: "inspectState",
-		formatData: (params) => {
-			if (params) {
-				return "宸叉彁浜�";
-			} else {
-				return "鏈彁浜�";
-			}
-		},
+    dataType: "tag",
+    formatData: (params) => (params == 1 || params === true ? '宸叉彁浜�' : '鏈彁浜�'),
+    formatType: (params) => (params == 1 || params === true ? 'success' : 'info'),
 	},
   {
     dataType: "action",
@@ -194,7 +206,7 @@
 				name: "鎻愪氦",
 				type: "text",
 				clickFun: (row) => {
-					submit(row.id);
+					submit(row);
 				},
 				disabled: (row) => {
 					// 宸叉彁浜ゅ垯绂佺敤
@@ -305,8 +317,12 @@
   })
 };
 // 鎻愪环
-const submit = async (id) => {
-	const res = await submitQualityInspect({id: id})
+const submit = async (row) => {
+	const res = await submitQualityInspect({
+    id: row.id,
+    qualifiedQuantity: row.qualifiedQuantity,
+    unqualifiedQuantity: row.unqualifiedQuantity
+  })
 	if (res.code === 200) {
 		proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
 		getList();

--
Gitblit v1.9.3