From 92f3361adf3ade3cf9c5bafff523a46216e6bef6 Mon Sep 17 00:00:00 2001
From: yuan <123@>
Date: 星期五, 03 四月 2026 10:24:18 +0800
Subject: [PATCH] Revert "fix: 终检表单优化检验用粉剂/液数据加载"

---
 src/views/qualityManagement/finalInspection/components/formDia.vue |   50 ++++++++++++++++----------------------------------
 1 files changed, 16 insertions(+), 34 deletions(-)

diff --git a/src/views/qualityManagement/finalInspection/components/formDia.vue b/src/views/qualityManagement/finalInspection/components/formDia.vue
index c94f061..d9d0b66 100644
--- a/src/views/qualityManagement/finalInspection/components/formDia.vue
+++ b/src/views/qualityManagement/finalInspection/components/formDia.vue
@@ -502,14 +502,9 @@
           // 缂栬緫鍦烘櫙淇濈暀宸叉湁妫�楠屽�硷紝鐩存帴鎷夊彇鍘熷弬鏁版暟鎹�
           getQualityInspectParamList(row.id);
         });
-
-        // 缂栬緫妯″紡涓嬶紝鍔犺浇妫�楠岀敤绮夊墏/娑茬浉鍏虫暟鎹�
-        loadInspectMaterialData();
       });
     } else {
       getQualityInspectParamList(row.id);
-      // 鍗充娇娌℃湁涓讳骇鍝侊紝涔熷皾璇曞姞杞芥楠岀敤绮夊墏/娑叉暟鎹�
-      loadInspectMaterialData();
     }
   }
 }
@@ -657,45 +652,31 @@
   }
 };
 
-// 鍔犺浇妫�楠岀敤绮夊墏/娑叉儏鍐电浉鍏虫暟鎹紙缂栬緫妯″紡鍥炴樉鐢級
-const loadInspectMaterialData = () => {
-  // 濡傛灉鏈夋楠岀敤绮夊墏/娑蹭骇鍝両D锛屽姞杞藉搴旂殑瑙勬牸鍨嬪彿
-  if (form.value.inspectMaterialConditionId) {
-    modelList({ id: form.value.inspectMaterialConditionId }).then((res) => {
-      inspectProductModel.value = res || [];
-      // 濡傛灉鏈夎鏍煎瀷鍙稩D锛屽姞杞芥壒鍙峰垪琛�
-      if (form.value.inspectProductModelId && inspectProductModel.value.length > 0) {
-        const selectedModel = inspectProductModel.value.find(item => item.id == form.value.inspectProductModelId);
-        if (selectedModel) {
-          form.value.inspectProductModel = selectedModel.model || '';
-        }
-        // 鏍规嵁瑙勬牸鍨嬪彿鏌ヨ鎵瑰彿鍒楄〃
-        getStockInventoryListPage({
-          model: form.value.inspectProductModel,
-          pageNum: 1,
-          pageSize: -1
-        }).then((res) => {
-          inspectBatchOptions.value = res.data.records || [];
-        });
-      }
-    });
-  }
-};
-
 // 閫夋嫨妫�楠岀敤绮夊墏/娑叉儏鍐靛悗锛屾牴鎹骇鍝両D鏌ヨ搴撳瓨鎵瑰彿鍒楄〃
 const handleInspectMaterialChange = (productId) => {
   inspectBatchOptions.value = [];
   form.value.inspectBatchNo = "";
   form.value.inspectProductModel = "";
-  form.value.inspectProductModelId = "";
   form.value.inspectProductionDate = "";
   form.value.inspectValidityDate = "";
   form.value.inspectValidityPeriod = "";
-  form.value.inspectMaterialCondition = findNodeById(productOptions.value, productId);
+  // let productName = findNodeById(productOptions.value, productId);
 
   modelList({ id: productId }).then((res) => {
     inspectProductModel.value = res;
   })
+  /*getStockInventoryListPage({
+    productName: productName,
+    pageNum: 1,
+    pageSize: -1
+  }).then(res => {
+    inspectBatchOptions.value = res.data || []
+    // 娓呯┖宸查�夋嫨鐨勬壒鍙峰拰鏂板瓧娈�
+    form.value.inspectBatchNo = "";
+    form.value.inspectProductModel = "";
+    form.value.inspectProductionDate = "";
+    form.value.inspectValidityDate = "";
+  });*/
 };
 
 const handleChangeModels = (value) => {
@@ -706,12 +687,13 @@
     pageNum: 1,
     pageSize: -1
   }).then(res => {
-    inspectBatchOptions.value = res.data.records || []
+    inspectBatchOptions.value = res.data || []
     // 娓呯┖宸查�夋嫨鐨勬壒鍙峰拰鏂板瓧娈�
     form.value.inspectBatchNo = "";
     form.value.inspectProductionDate = "";
     form.value.inspectValidityDate = "";
   });
+
   if (form.value.productionDate) {
     calculateInspectValidityDate();
   }
@@ -727,7 +709,7 @@
   const selectedModel = inspectProductModel.value.find(item => item.id == form.value.inspectProductModelId);
   if (selectedModel && selectedModel.validityPeriod) {
     const inspectProductionDate = new Date(form.value.inspectProductionDate);
-    const validityPeriod = parseFloat(selectedModel.validityPeriod);
+    const validityPeriod = parseFloat(selectedModel.inspectValidityDate);
     const validityDate = new Date(inspectProductionDate);
     validityDate.setFullYear(validityDate.getFullYear() + Math.floor(validityPeriod));
     validityDate.setMonth(validityDate.getMonth() + Math.round((validityPeriod % 1) * 12));

--
Gitblit v1.9.3