From cca940a6460bc4ec4266df4e413b05921d1f2e1d Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 16 四月 2026 09:55:16 +0800
Subject: [PATCH] 中兴实强 1.新增生产订单时候查询工序接口传参修改

---
 src/views/productionManagement/productionOrder/New.vue   |   16 ++++++++++------
 src/views/productionManagement/productionOrder/index.vue |   13 +++++++++++--
 2 files changed, 21 insertions(+), 8 deletions(-)

diff --git a/src/views/productionManagement/productionOrder/New.vue b/src/views/productionManagement/productionOrder/New.vue
index edd8bb8..8da949a 100644
--- a/src/views/productionManagement/productionOrder/New.vue
+++ b/src/views/productionManagement/productionOrder/New.vue
@@ -148,6 +148,7 @@
 import { addProductOrder, listProcessRoute } from "@/api/productionManagement/productionOrder.js";
 import { processList } from "@/api/productionManagement/productionProcess.js";
 import { userListNoPageByTenantId } from "@/api/system/user.js";
+import {findProcessRouteItemList} from "@/api/productionManagement/processRouteItem.js";
 
 const props = defineProps({
   visible: {
@@ -194,11 +195,11 @@
 const { proxy } = getCurrentInstance();
 const formRef = ref();
 
-const validateProcessUserField = async () => {
+const validateProcessUserField = async (shouldValidate = false) => {
   await nextTick();
   if (!formRef.value) return;
 
-  if (processListData.value.length) {
+  if (processListData.value.length && shouldValidate) {
     formRef.value.validateField("processUserList");
     return;
   }
@@ -245,7 +246,10 @@
     return;
   }
 
-  processList({ routeId })
+  findProcessRouteItemList({
+    routeId,
+    productModelId: formState.value.productModelId,
+  })
     .then(res => {
       processListData.value = res.data || [];
       formState.value.processUserList = createProcessUserList(processListData.value);
@@ -264,13 +268,13 @@
 const handleProcessUserChange = (index, userIds) => {
   const selectedUsers = userOptions.value.filter(user => Array.isArray(userIds) && userIds.includes(user.userId));
   formState.value.processUserList[index].userNames = selectedUsers.map(user => user.nickName).join(",");
-  validateProcessUserField();
+  validateProcessUserField(true);
 };
 
 const removeProcessItem = index => {
   processListData.value.splice(index, 1);
   formState.value.processUserList.splice(index, 1);
-  validateProcessUserField();
+  validateProcessUserField(true);
 };
 
 const validateProcessUsers = (_, value, callback) => {
@@ -299,7 +303,7 @@
   if (!products?.length) return;
 
   const product = products[0];
-  formState.value.productId = product.productId;
+  formState.value.productId = product.id;
   formState.value.productName = product.productName;
   formState.value.productModelName = product.model;
   formState.value.productModelId = product.id;
diff --git a/src/views/productionManagement/productionOrder/index.vue b/src/views/productionManagement/productionOrder/index.vue
index 451dc34..686d397 100644
--- a/src/views/productionManagement/productionOrder/index.vue
+++ b/src/views/productionManagement/productionOrder/index.vue
@@ -178,6 +178,7 @@
 import { processList } from "@/api/productionManagement/productionProcess.js";
 import { userListNoPageByTenantId } from "@/api/system/user.js";
 import PIMTable from "@/components/PIMTable/PIMTable.vue";
+import {findProcessRouteItemList} from "@/api/productionManagement/processRouteItem.js";
 
 const NewProductOrder = defineAsyncComponent(() => import("@/views/productionManagement/productionOrder/New.vue"));
 
@@ -337,6 +338,7 @@
 const userLoading = ref(false);
 const bindForm = reactive({
   orderId: null,
+  productId: null,
   productModelId: null,
   routeId: null,
   processUserList: [],
@@ -389,7 +391,10 @@
   }
 
   try {
-    const res = await processList({ routeId });
+    const res = await findProcessRouteItemList({
+      routeId,
+			productModelId: bindForm.productModelId,
+    });
     bindProcessList.value = res.data || [];
     bindForm.processUserList = createBindProcessUserList(bindProcessList.value);
     ensureUserOptions();
@@ -416,6 +421,7 @@
 
 const openBindRouteDialog = async row => {
   bindForm.orderId = row.id;
+  bindForm.productId = row.id ?? null;
   bindForm.productModelId = row.productModelId ?? null;
   bindForm.routeId = null;
   bindForm.processUserList = [];
@@ -431,7 +437,10 @@
 
   bindRouteLoading.value = true;
   try {
-    const res = await listProcessRoute({ productModelId: row.productModelId });
+    const res = await listProcessRoute({
+      productId: bindForm.productId,
+      productModelId: row.productModelId,
+    });
     routeOptions.value = res.data || [];
   } catch (error) {
     console.error("鑾峰彇宸ヨ壓璺嚎鍒楄〃澶辫触", error);

--
Gitblit v1.9.3