From 8ef070c84a703c4a8b838bf9320d68d00a7d6dca Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期四, 28 五月 2026 11:15:32 +0800
Subject: [PATCH] 设备巡检去掉高度限制

---
 src/views/productionManagement/productionOrder/index.vue |   37 +++++++++++++++++++++++++++++--------
 1 files changed, 29 insertions(+), 8 deletions(-)

diff --git a/src/views/productionManagement/productionOrder/index.vue b/src/views/productionManagement/productionOrder/index.vue
index 4470b7d..e1aeced 100644
--- a/src/views/productionManagement/productionOrder/index.vue
+++ b/src/views/productionManagement/productionOrder/index.vue
@@ -111,7 +111,11 @@
 const BindRouteDialogRef = ref(null)
 
 const handleBindRouteSubmit = async (data) => {
-  const res = await saveProductionProductInput(data)
+  const payload = { ...(data || {}) }
+  if (bindDialogType.value === "edit" && !payload.id) {
+    payload.id = rowData.value?.printId || rowData.value?.id || null
+  }
+  const res = await saveProductionProductInput(payload)
   if (res.code === 200) {
     proxy.$modal.msgSuccess("缁戝畾鎴愬姛");
     bindRouteDialogVisible.value = false
@@ -229,9 +233,17 @@
       {
         name: "鏌ョ湅宸ヨ壓璺嚎",
         type: "text",
-        showHide: row => row.printId,
+        showHide: row => row.printId && Number(row?.hasProduct) > 0,
         clickFun: row => {
           openBindRouteDialog(row, "view");
+        },
+      },
+      {
+        name: "淇敼宸ヨ壓璺嚎",
+        type: "text",
+        showHide: row => row.printId && !(Number(row?.hasProduct) > 0),
+        clickFun: row => {
+          openBindRouteDialog(row, "edit");
         },
       },
       {
@@ -324,15 +336,24 @@
   bindRouteLoading.value = true;
   try {
     BindRouteDialogRef.value?.resetForm?.()
-    if (type === "view") {
-      bindDialogType.value = "detail"
+    if (type === "view" || type === "edit") {
+      bindDialogType.value = type === "view" ? "detail" : "edit"
       const res = await viewGetByProductWordId(row.id)
-      if (res?.cuttingFileVo?.id == null) {
-        res.cuttingFileVo = []
+
+      const detail = res?.data || res || {}
+      if (detail?.cuttingFileVo?.id == null) {
+        detail.cuttingFileVo = []
       } else {
-        res.cuttingFileVo = [res.cuttingFileVo]
+        detail.cuttingFileVo = [detail.cuttingFileVo]
       }
-      rowData.value = res?.data || res
+
+      if (detail.productOrderId == null) {
+        detail.productOrderId = row.id
+      }
+      if (type === "edit" && (detail.id == null || detail.id === "") && row?.printId) {
+        detail.id = row.printId
+      }
+      rowData.value = detail
     } else {
       bindDialogType.value = "add"
       rowData.value = deepClone( row)

--
Gitblit v1.9.3