From d8f4bb523d8eb35b1e80e6ba080271cb075a0386 Mon Sep 17 00:00:00 2001
From: yuan <123@>
Date: 星期六, 13 六月 2026 09:16:50 +0800
Subject: [PATCH] fix: 增加质检提交loading,移除所有数据更新,只更新提交状态

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

diff --git a/src/views/qualityManagement/finalInspection/index.vue b/src/views/qualityManagement/finalInspection/index.vue
index b0e222b..4055c8e 100644
--- a/src/views/qualityManagement/finalInspection/index.vue
+++ b/src/views/qualityManagement/finalInspection/index.vue
@@ -226,6 +226,7 @@
         clickFun: (row) => {
           submit(row.id);
         },
+        loading: (row) => submitLoadingId.value === row.id,
         disabled: (row) => {
           // 宸叉彁浜ゅ垯绂佺敤
           if (row.inspectState == 1) return true;
@@ -263,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,
@@ -375,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