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 ++++++++++--
 src/views/productionManagement/productionOrder/index.vue           |   39 +++++++++++++++++--
 2 files changed, 54 insertions(+), 9 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] || {}
diff --git a/src/views/productionManagement/productionOrder/index.vue b/src/views/productionManagement/productionOrder/index.vue
index d2cf5f1..0ad9ba4 100644
--- a/src/views/productionManagement/productionOrder/index.vue
+++ b/src/views/productionManagement/productionOrder/index.vue
@@ -94,7 +94,6 @@
   import { listMain as getOrderProcessRouteMain } from "@/api/productionManagement/productProcessRoute.js";
   import PIMTable from "@/components/PIMTable/PIMTable.vue";
   import BindRouteDialog from "./BindRouteDialog.vue";
-  import {getDeviceLedger} from "@/api/equipmentManagement/ledger.js";
   const NewProductOrder = defineAsyncComponent(() => import("@/views/productionManagement/productionOrder/New.vue"));
 
   const { proxy } = getCurrentInstance();
@@ -132,7 +131,7 @@
       width: '150px',
     },
     {
-      label: "瀹㈡埛鍚嶇О",
+      label: "鍘傚",
       prop: "customerName",
       width: '200px',
     },
@@ -142,7 +141,7 @@
       width: '120px',
     },
     {
-      label: "瑙勬牸",
+      label: "绾稿紶瑙勬牸",
       prop: "specificationModel",
       width: '120px',
     },
@@ -152,8 +151,28 @@
       width: '200px',
     },
     {
-      label: "闇�姹傛暟閲�",
+      label: "鍗板埛鏁伴噺",
       prop: "quantity",
+    },
+    {
+      label: "灏哄",
+      prop: "cutSize",
+      width: '120px',
+    },
+    {
+      label: "灏忕洅鏁伴噺",
+      prop: "smallBoxQty",
+      width: '120px',
+    },
+    {
+      label: "涓洅鏁伴噺",
+      prop: "mediumBoxQty",
+      width: '120px',
+    },
+    {
+      label: "鑹叉暟",
+      prop: "printColorCount",
+      width: '120px',
     },
     {
       label: "瀹屾垚鏁伴噺",
@@ -179,9 +198,14 @@
       width: 120,
     },
     {
-      label: "浜や粯鏃ユ湡",
+      label: "璁″垝浜よ揣鏃ユ湡",
       prop: "deliveryDate",
       formatData: val => (val ? dayjs(val).format("YYYY-MM-DD") : ""),
+      width: 120,
+    },
+    {
+      label: "澶囨敞",
+      prop: "remark",
       width: 120,
     },
     {
@@ -292,6 +316,11 @@
       if (type === "view") {
         bindDialogType.value = "detail"
         const res = await viewGetByProductWordId(row.id)
+        if(res?.cuttingFileVo?.id ==null){
+          res.cuttingFileVo = []
+        }else{
+          res.cuttingFileVo = [res.cuttingFileVo]
+        }
         rowData.value = res?.data || res
       } else {
         bindDialogType.value = "add"

--
Gitblit v1.9.3