From e3bf21045fc29371449c7e888d786370dc962ae1 Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期一, 07 九月 2026 15:42:09 +0800
Subject: [PATCH] feat(inspection): 优化检验数据保存逻辑

---
 src/workers/InspectionWorker.worker.js |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/src/workers/InspectionWorker.worker.js b/src/workers/InspectionWorker.worker.js
index 4a60ecd..5cd696e 100644
--- a/src/workers/InspectionWorker.worker.js
+++ b/src/workers/InspectionWorker.worker.js
@@ -30,6 +30,9 @@
 let getDataTypeId = null;
 //褰撳墠妫�楠岄」
 let currentInsItem = null;
+// 褰撳墠杩欐杈撳叆瀵瑰簲鐨勫師濮嬫楠岄」銆傝绠楄繃绋嬩腑 pId 浼氬垏鎹㈠埌涓嬫父璁$畻椤癸紝
+// 淇濆瓨鏃跺繀椤诲悓鏃跺甫鍥炲師濮嬫楠岄」锛屽惁鍒欏彧浼氫繚瀛樿绠楃粨鏋溿��
+let sourceInsItemId = null;
 // 鎺ユ敹鍒颁富绾跨▼澶勭悊閫昏緫鐨勬秷鎭�
 self.onmessage = function (event) {
   // 淇濆瓨涓荤嚎绋嬩紶杩囨潵鐨勫��
@@ -54,6 +57,11 @@
   }
   modelType = data.modelType;
   code = data.code;
+  const codeParts = typeof code === "string" ? code.split("-") : [];
+  sourceInsItemId =
+    data.currentInsItem && data.currentInsItem.i != null
+      ? data.currentInsItem.i
+      : codeParts[3];
   if (data.getDataTypeId) {
     // 璁板綍 浼樺寲鏁伴噰杈冨鏁版嵁鏃�-璁板綍鏈�鍚庝竴涓楠岄」鐨刬d
     getDataTypeId = data.getDataTypeId;
@@ -490,6 +498,7 @@
                 param: getParam(), //浼犵粰鍚庣鐨勫弬鏁�
                 getDataTypeId: getDataTypeId,
                 currentInsItemId: item.i,
+                sourceInsItemId: sourceInsItemId,
               },
             };
             // 鍙戞秷鎭粰涓荤嚎绋�
@@ -703,6 +712,7 @@
         param: getParam(), //浼犵粰鍚庣鐨勫弬鏁�
         getDataTypeId: getDataTypeId,
         currentInsItemId: currentInsItemId,
+        sourceInsItemId: sourceInsItemId,
       },
     };
     // 鍙戞秷鎭粰涓荤嚎绋�
@@ -847,7 +857,11 @@
         b.v.ps.value.includes("妫�楠屽��")
       ) {
         // 璧嬪�兼楠屽��
-        b.i && b.v.v && param[b.i].insValue.push(b);
+        b.i &&
+          b.v.v !== "" &&
+          b.v.v !== null &&
+          b.v.v !== undefined &&
+          param[b.i].insValue.push(b);
       }
       if (b.v.ps != undefined && b.v.ps.value === "璁$畻鍊�") {
         // 璧嬪�艰绠楀��

--
Gitblit v1.9.3