From 195770f92f7d739ffba6447fdbf3a3d5b9e009fa Mon Sep 17 00:00:00 2001
From: 张诺 <zhang_12370@163.com>
Date: 星期五, 24 四月 2026 16:32:57 +0800
Subject: [PATCH] fix(生产订单): 修复绑定工艺路线时的材料规格验证和显示问题

---
 src/views/productionManagement/productionOrder/BindRouteDialog.vue |   24 ++++++++++++++++++++----
 1 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/src/views/productionManagement/productionOrder/BindRouteDialog.vue b/src/views/productionManagement/productionOrder/BindRouteDialog.vue
index 484b950..1922689 100644
--- a/src/views/productionManagement/productionOrder/BindRouteDialog.vue
+++ b/src/views/productionManagement/productionOrder/BindRouteDialog.vue
@@ -61,7 +61,7 @@
         <template #default="{ row }" >
           <el-tree-select
           v-if="!isDetail"
-            v-model="row.productId"
+            v-model="row.productById"
             placeholder="璇烽�夋嫨"
             clearable
             check-strictly
@@ -71,10 +71,13 @@
             :disabled="isDetail"
             style="width: 100%"
           />
-            <span v-else>{{ row.name }}</span>
+            <span v-else>{{ row.name }}</span>  
         </template> 
       </el-table-column>
-      <el-table-column label="瑙勬牸">
+      <el-table-column>
+        <template #header>
+          <span class="required">*</span>瑙勬牸
+        </template>
         <template #default="{ row }">
           <el-select
           v-if="!isDetail"
@@ -140,8 +143,9 @@
       </el-descriptions-item>
     </el-descriptions>
     <!-- ================= 鍒囨枡鍥剧ず ================= -->
-    <div class="section-title">鍒囨枡鍥剧ず</div>
+    <div class="section-title" v-if="formData.cuttingFileVo.length > 0">鍒囨枡鍥剧ず</div>
     <ActionFileUpload
+    v-if="formData.cuttingFileVo.length > 0"
         style="width: 50%;float: left;"
         v-model:file-list="formData.cuttingFileVo"
         :action="upload.url"
@@ -822,6 +826,8 @@
 
 const getModels = (val, row) => {
   row.productId = val || ""
+  row.productById = val || ""
+  row.productName = row.name || ""
   row.name = val ? findProductLabelById(productOptions.value, val) : ""
   row.productModelId = ""
   row.model = ""
@@ -838,6 +844,7 @@
 const handleMaterialModelChange = (val, row) => {
   const currentModel = (row.modelOptions || []).find(item => item.id === val)
   row.productModelId = val || ""
+  row.productId = currentModel?.id || ""
   row.model = currentModel?.model || ""
   row.unit = currentModel?.unit || ""
 }
@@ -906,6 +913,15 @@
   if (isDetail.value) {
     return
   }
+  const materialRows = Array.isArray(formData.materialInfo) ? formData.materialInfo : []
+  for (let i = 0; i < materialRows.length; i++) {
+    const row = materialRows[i] || {}
+    if (!row.productId) {
+      ElMessage.warning(`鏉愭枡淇℃伅绗�${i + 1}琛岋細	瑙勬牸蹇呭~`)
+      return
+    }
+
+  }
   const rows = Array.isArray(formData.processContent) ? formData.processContent : []
   for (let i = 0; i < rows.length; i++) {
     const row = rows[i] || {}

--
Gitblit v1.9.3