From 8d24d963f8b82163685c34b816998a904f08234d Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期四, 17 九月 2026 13:39:35 +0800
Subject: [PATCH] feat: 新聚-下单到检验

---
 src/views/business/inspectionTask/inspection.vue |   49 +++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 43 insertions(+), 6 deletions(-)

diff --git a/src/views/business/inspectionTask/inspection.vue b/src/views/business/inspectionTask/inspection.vue
index eac01ab..342b500 100644
--- a/src/views/business/inspectionTask/inspection.vue
+++ b/src/views/business/inspectionTask/inspection.vue
@@ -91,7 +91,7 @@
         </template>
         <template v-else>
           <el-descriptions-item label="濮旀墭缂栧彿">{{ insOrder.entrustCode }}</el-descriptions-item>
-          <el-descriptions-item label="妫�娴嬩緷鎹�">{{ insOrder.sample || '-' }}</el-descriptions-item>
+          <el-descriptions-item label="妫�娴嬩緷鎹�">{{ standardDisplayName(insOrder.sample) }}</el-descriptions-item>
           <el-descriptions-item label="鏍峰搧鍚嶇О">{{ insOrder.sampleView || '-' }}</el-descriptions-item>
           <el-descriptions-item label="鏍峰搧缂栧彿">{{ currentSample.sampleCode }}</el-descriptions-item>
           <el-descriptions-item label="鏍峰搧鏁伴噺">{{ insOrder.testQuantity }}</el-descriptions-item>
@@ -968,6 +968,11 @@
     this.stopWorker();
   },
   methods: {
+    standardDisplayName(value) {
+      if (!value) return '-';
+      const separatorIndex = value.indexOf(' - ');
+      return separatorIndex > -1 ? value.slice(0, separatorIndex) : value;
+    },
     validateQuality(){
       let inboundLength = Number(this.calcInbondLength(this.ifsMaterialPropsForm.startMeterMark,this.ifsMaterialPropsForm.endMeterMark));
       let testQuantity = Number(this.insOrder.testQuantity);
@@ -1683,9 +1688,17 @@
           payload[type] = Number(m);
         }
       }
-      write(payload).then((res) => {
-        this.$message.success("淇濆瓨鎴愬姛");
-      });
+      const previousSave = this.saveQueue || Promise.resolve();
+      this.saveQueue = previousSave
+        .catch(() => undefined)
+        .then(() => write(payload))
+        .then(() => {
+          this.$message.success("淇濆瓨鎴愬姛");
+        })
+        .catch((error) => {
+          console.error("妫�楠屾潯浠朵繚瀛樺け璐�", error);
+          this.$message.error("妫�楠屾潯浠朵繚瀛樺け璐ワ紝璇烽噸璇�");
+        });
     },
     exportTable(tableId) {
       // 鑾峰彇table鍏冪礌
@@ -2197,6 +2210,11 @@
     },
     // 瀵硅緭鍏ュ�艰繘琛屾牸寮忔牎楠�
     handleInput(n) {
+      // 鐩寸粦妯℃澘鏈厤缃楠屽�肩被鍨嬫椂鎸夎嚜鐢辨枃鏈鐞嗭紝鍏佽褰曞叆澶栬绛変腑鏂囩粨鏋溿��
+      const inspectionValueType = this.getInspectionValueType(n.i);
+      if (inspectionValueType === undefined || inspectionValueType === null) {
+        return;
+      }
       try {
         const v = n.v.v;
         // 鑳藉姏鑼冨洿宸插簾寮�,妫�楠屽�肩被鍨嬩笉鍐嶄綔涓哄垽鏂緷鎹�傛暣涓插彧鐢辩畻寮忓瓧绗︾粍鎴愭椂鎵嶈鑼冨寲鏍煎紡,
@@ -2362,6 +2380,24 @@
         return;
       }
       await this.waitForPendingSaves();
+      try {
+        await Promise.all(this.tableLists.map((template) => {
+          const form = this.otherForm[template.templateId] || {};
+          return write({
+            id: this.insOrder.id,
+            templateId: template.templateId,
+            temperature: form.temperature == null ? null : form.temperature,
+            humidity: form.humidity == null ? null : form.humidity,
+            detectionTime: form.detectionTime || null,
+            detectionPlace: form.detectionPlace || null,
+            deviceIds: Array.isArray(form.deviceIds) ? [...form.deviceIds] : [],
+          });
+        }));
+      } catch (error) {
+        console.error("妫�楠屾潯浠朵繚瀛樺け璐�", error);
+        this.$message.error("妫�楠屾潯浠朵繚瀛樺け璐ワ紝璇烽噸璇�");
+        return;
+      }
       this.submitLoading = true;
       checkSubmitPlan({
         orderId: this.orderId,
@@ -2578,8 +2614,9 @@
       this.saveInsContext();
     },
     isDirectTemplateOrder() {
-      return this.sonLaboratory === "鏂拌仛" && this.currentSample &&
-        (this.currentSample.insProduct || []).some((product) => product.templateRowIndex != null);
+      return this.sonLaboratory === "鏂拌仛" &&
+        Array.isArray(this.insOrder.templateConditions) &&
+        this.insOrder.templateConditions.length > 0;
     },
     loadDeviceOptions() {
       search({ status: 0 }).then((devices) => {

--
Gitblit v1.9.3