From cb4cea8a525dd120337a710d5bf539dd17e00b55 Mon Sep 17 00:00:00 2001
From: chenhj <1263187585@qq.com>
Date: 星期五, 24 四月 2026 18:25:00 +0800
Subject: [PATCH] Merge branch 'dev_NEW_pro' of http://114.132.189.42:9002/r/product-inventory-management into dev_NEW_pro

---
 src/views/inventoryManagement/stockManagement/New.vue                  |   13 +++++-
 src/api/productionManagement/productStructure.js                       |   19 ++++++---
 src/views/productionManagement/processRoute/processRouteItem/index.vue |   20 ++++++---
 src/views/productionManagement/productionOrder/index.vue               |   44 +++++++++++++---------
 4 files changed, 62 insertions(+), 34 deletions(-)

diff --git a/src/api/productionManagement/productStructure.js b/src/api/productionManagement/productStructure.js
index 3b189e1..f09d91a 100644
--- a/src/api/productionManagement/productStructure.js
+++ b/src/api/productionManagement/productStructure.js
@@ -8,6 +8,13 @@
     method: "get",
   });
 }
+// 鍒嗛〉鏌ヨ-浜у搧璁㈠崟
+export function queryList2(id) {
+  return request({
+    url: "/productionBomStructure/listByBomId/" + id,
+    method: "get",
+  });
+}
 export function add(data) {
   return request({
     url: "/productStructure/" + data.bomId,
@@ -24,12 +31,12 @@
   });
 }
 // 鍒嗛〉鏌ヨ-浜у搧璁㈠崟
-export function queryList2(id) {
-  return request({
-    url: "/productionOrderStructure/getBomStructs/" + id,
-    method: "get",
-  });
-}
+// export function queryList2(id) {
+//   return request({
+//     url: "/productionOrderStructure/getBomStructs/" + id,
+//     method: "get",
+//   });
+// }
 
 export function add2(data) {
   return request({
diff --git a/src/views/inventoryManagement/stockManagement/New.vue b/src/views/inventoryManagement/stockManagement/New.vue
index 653e027..c5976b6 100644
--- a/src/views/inventoryManagement/stockManagement/New.vue
+++ b/src/views/inventoryManagement/stockManagement/New.vue
@@ -99,7 +99,7 @@
 </template>
 
 <script setup>
-import {ref, computed, getCurrentInstance} from "vue";
+import {ref, computed, watch, getCurrentInstance} from "vue";
 import ProductSelectDialog from "@/views/basicData/product/ProductSelectDialog.vue";
 import {createStockInventory} from "@/api/inventoryManagement/stockInventory.js";
 import {createStockUnInventory} from "@/api/inventoryManagement/stockUninventory.js";
@@ -127,7 +127,7 @@
   unit: "",
   type: undefined,
   qualitity: 0,
-  batchNo: "",
+  batchNo: null,
   warnNum: 0,
   remark: '',
 });
@@ -143,6 +143,13 @@
 
 const showProductSelectDialog = ref(false);
 
+// 鎵瑰彿涓虹┖鏃惰浆涓� null
+watch(() => formState.value.batchNo, (val) => {
+  if (val === '') {
+    formState.value.batchNo = null;
+  }
+});
+
 let { proxy } = getCurrentInstance()
 
 const closeModal = () => {
@@ -155,7 +162,7 @@
     unit: "",
     type: undefined,
     qualitity: 0,
-    batchNo: "",
+    batchNo: null,
     warnNum: 0,
     remark: '',
   };
diff --git a/src/views/productionManagement/processRoute/processRouteItem/index.vue b/src/views/productionManagement/processRoute/processRouteItem/index.vue
index b78caad..734d34c 100644
--- a/src/views/productionManagement/processRoute/processRouteItem/index.vue
+++ b/src/views/productionManagement/processRoute/processRouteItem/index.vue
@@ -80,7 +80,7 @@
                        prop="technologyOperationId"
                        width="200">
         <template #default="scope">
-          {{ getProcessName(scope.row.technologyOperationId) || '-' }}
+          {{ scope.row.technologyOperationName || scope.row.operationName || '-' }}
         </template>
       </el-table-column>
       <el-table-column label="鍙傛暟鍒楄〃"
@@ -158,7 +158,7 @@
             <!-- 搴忓彿鍦嗗湀 -->
             <div class="card-header">
               <div class="card-number">{{ index + 1 }}</div>
-              <div class="card-process-name">{{ getProcessName(item.technologyOperationId) || '-' }}</div>
+              <div class="card-process-name">{{ item.technologyOperationName || item.operationName || '-' }}</div>
             </div>
             <!-- 浜у搧淇℃伅 -->
             <div class="card-content">
@@ -424,7 +424,7 @@
     <!-- 鍙傛暟鍒楄〃瀵硅瘽妗� -->
     <!-- :editable="!routeInfo.status" -->
     <ProcessParamListDialog v-model="showParamListDialog"
-                            :title="`${currentProcess ? (currentProcess.processName || getProcessName(currentProcess.technologyOperationId)) : ''} - 鍙傛暟鍒楄〃`"
+                            :title="`${currentProcess ? (currentProcess.processName || currentProcess.technologyOperationName || currentProcess.operationName) : ''} - 鍙傛暟鍒楄〃`"
                             :route-id="routeId"
                             :order-id="orderId"
                             :process="currentProcess"
@@ -470,6 +470,7 @@
   import { listProcessBom } from "@/api/productionManagement/productionOrder.js";
   import {
     queryList,
+    queryList2,
     addBomDetail,
   } from "@/api/productionManagement/productStructure.js";
 
@@ -720,8 +721,8 @@
 
           const addPromise = isOrderPage
             ? addRouteItem({
-                productOrderId: orderId.value,
-                productRouteId: routeId.value,
+                productOrderId: Number(orderId.value),
+                productRouteId: Number(routeId.value),
                 technologyOperationId: form.value.technologyOperationId,
                 productModelId: form.value.productModelId,
                 isQuality: form.value.isQuality,
@@ -1041,7 +1042,10 @@
 
   const fetchBomData = async () => {
     try {
-      const { data } = await queryList(routeInfo.value.bomId);
+      const isOrderPage = pageType.value === "order";
+      const { data } = await (isOrderPage ? queryList2 : queryList)(
+        routeInfo.value.bomId
+      );
       bomDataValue.value.dataList = data || [];
       normalizeTreeData(bomDataValue.value.dataList);
     } catch (err) {
@@ -1260,12 +1264,14 @@
 
   const handleSaveBom = () => {
     bomDataValue.value.loading = true;
+    console.log(bomDataValue.value.dataList, "bomDataValue.value.dataList");
+
     normalizeTreeData(bomDataValue.value.dataList);
 
     const valid = validateAllBom();
     if (valid) {
       addBomDetail({
-        bomId: routeInfo.value.bomId,
+        bomId: Number(routeInfo.value.bomId),
         children: buildSubmitTree(bomDataValue.value.dataList || []),
       })
         .then(() => {
diff --git a/src/views/productionManagement/productionOrder/index.vue b/src/views/productionManagement/productionOrder/index.vue
index 6480990..02e75eb 100644
--- a/src/views/productionManagement/productionOrder/index.vue
+++ b/src/views/productionManagement/productionOrder/index.vue
@@ -227,7 +227,15 @@
           type: "text",
           showHide: row => !row.processRouteCode,
           clickFun: row => {
-            openBindRouteDialog(row);
+            openBindRouteDialog(row, "add");
+          },
+        },
+        {
+          name: "鏇存崲宸ヨ壓璺嚎",
+          type: "text",
+          showHide: row => row.processRouteCode,
+          clickFun: row => {
+            openBindRouteDialog(row, "change");
           },
         },
         // {
@@ -237,20 +245,20 @@
         //     showProductStructure(row);
         //   },
         // },
-        {
-          name: "棰嗘枡",
-          type: "text",
-          clickFun: row => {
-            openMaterialDialog(row);
-          },
-        },
-        {
-          name: "棰嗘枡璇︽儏",
-          type: "text",
-          clickFun: row => {
-            openMaterialDetailDialog(row);
-          },
-        },
+        // {
+        //   name: "棰嗘枡",
+        //   type: "text",
+        //   clickFun: row => {
+        //     openMaterialDialog(row);
+        //   },
+        // },
+        // {
+        //   name: "棰嗘枡璇︽儏",
+        //   type: "text",
+        //   clickFun: row => {
+        //     openMaterialDetailDialog(row);
+        //   },
+        // },
       ],
     },
   ]);
@@ -323,9 +331,9 @@
   const materialDetailDialogVisible = ref(false);
   const currentMaterialDetailOrder = ref(null);
 
-  const openBindRouteDialog = async row => {
+  const openBindRouteDialog = async (row, type) => {
     bindForm.orderId = row.id;
-    bindForm.routeId = null;
+    bindForm.routeId = type === "add" ? null : row.processRouteCode;
     bindRouteDialogVisible.value = true;
     routeOptions.value = [];
     if (!row.productModelId) {
@@ -427,7 +435,7 @@
         path: "/productionManagement/processRouteItem",
         query: {
           id: data.id,
-          bomId: data.bomId,
+          bomId: data.orderBomId,
           processRouteCode: data.processRouteCode || "",
           productName: row.productName || "",
           model: row.model || "",

--
Gitblit v1.9.3