From 0a251e40e30e7c8a96d71b3b9b6c459d4dfa4b22 Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期三, 08 七月 2026 23:04:45 +0800
Subject: [PATCH] 暂存

---
 src/views/qualityManagement/finalInspection/index.vue |   63 ++++++++++++++++++++++++-------
 1 files changed, 48 insertions(+), 15 deletions(-)

diff --git a/src/views/qualityManagement/finalInspection/index.vue b/src/views/qualityManagement/finalInspection/index.vue
index d87c453..181f8bb 100644
--- a/src/views/qualityManagement/finalInspection/index.vue
+++ b/src/views/qualityManagement/finalInspection/index.vue
@@ -40,7 +40,7 @@
     </div>
     <InspectionFormDia ref="inspectionFormDia" @close="handleQuery"></InspectionFormDia>
     <FormDia ref="formDia" @close="handleQuery"></FormDia>
-    <files-dia ref="filesDia" @close="handleQuery"></files-dia>
+    <files-dia ref="filesDia" ></files-dia>
     <el-dialog v-model="dialogFormVisible" title="缂栬緫妫�楠屽憳" width="30%"
                @close="closeDia">
       <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef">
@@ -143,27 +143,43 @@
     width: 120
   },
   {
-    label: "妫�娴嬬粨鏋�",
-    prop: "checkResult",
+    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 == '涓嶅悎鏍�') {
-        return "danger";
-      } else if (params == '鍚堟牸') {
-        return "success";
-      } else {
-        return 'danger';
-      }
+      if (params == null || params === '') return 'info';
+      const n = Number(params);
+      if (Number.isNaN(n)) return 'info';
+      if (n === 100) return 'success';
+      if (n >= 75) return 'primary';
+      if (n >= 50) return 'warning';
+      if (n >= 25) return 'danger';
+      return 'danger';
     },
   },
   {
     label: "鎻愪氦鐘舵��",
     prop: "inspectState",
+    dataType: "tag",
     formatData: (params) => {
       if (params) {
         return "宸叉彁浜�";
       } else {
         return "鏈彁浜�";
+      }
+    },
+    formatType: (params) => {
+      if (params) {
+        return "success";
+      } else {
+        return "info";
       }
     },
   },
@@ -191,6 +207,13 @@
         }
       },
       {
+        name: "鏌ョ湅",
+        type: "text",
+        clickFun: (row) => {
+          openForm("view", row);
+        },
+      },
+      {
         name: "闄勪欢",
         type: "text",
         clickFun: (row) => {
@@ -203,6 +226,7 @@
         clickFun: (row) => {
           submit(row.id);
         },
+        loading: (row) => submitLoadingId.value === row.id,
         disabled: (row) => {
           // 宸叉彁浜ゅ垯绂佺敤
           if (row.inspectState == 1) return true;
@@ -240,6 +264,7 @@
 const tableData = ref([]);
 const selectedRows = ref([]);
 const tableLoading = ref(false);
+const submitLoadingId = ref(null);
 const currentRow = ref(null)
 const page = reactive({
   current: 1,
@@ -352,12 +377,20 @@
       });
 };
 
-// 鎻愪环
+// 鎻愪氦
 const submit = async (id) => {
-  const res = await submitQualityInspect({id: id})
-  if (res.code === 200) {
-    proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
-    getList();
+  submitLoadingId.value = id;
+  try {
+    const res = await submitQualityInspect({ id });
+    if (res.code === 200) {
+      proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
+      const row = tableData.value.find(item => item.id === id);
+      if (row) {
+        row.inspectState = 1;
+      }
+    }
+  } finally {
+    submitLoadingId.value = null;
   }
 }
 

--
Gitblit v1.9.3