From ed702dac689a4ec90fab47a301d007bc493998fe Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期三, 15 四月 2026 09:46:28 +0800
Subject: [PATCH] 中兴实强 1.新增工艺路线的时候产品可以多选

---
 src/views/productionManagement/processRoute/New.vue |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/views/productionManagement/processRoute/New.vue b/src/views/productionManagement/processRoute/New.vue
index 69a8eed..9e876dd 100644
--- a/src/views/productionManagement/processRoute/New.vue
+++ b/src/views/productionManagement/processRoute/New.vue
@@ -41,7 +41,7 @@
             v-model="formState.bomId"
             placeholder="璇烽�夋嫨BOM"
             clearable
-            :disabled="formState.selectedProducts.length !== 1 || bomOptions.length === 0"
+            :disabled="bomOptions.length === 0"
             style="width: 100%"
           >
             <el-option
@@ -75,7 +75,7 @@
 <script setup>
 import { computed, getCurrentInstance, ref } from "vue";
 import { add } from "@/api/productionManagement/processRoute.js";
-import { getByModel } from "@/api/productionManagement/productBom.js";
+import { getByModelList } from "@/api/productionManagement/productBom.js";
 import ProductSelectDialog from "@/views/basicData/product/ProductSelectDialog.vue";
 
 const props = defineProps({
@@ -131,14 +131,14 @@
   isShow.value = false;
 };
 
-const loadBomList = async (productModelId) => {
-  if (!productModelId) {
+const loadBomList = async (productModelIds) => {
+  if (!productModelIds?.length) {
     bomOptions.value = [];
     return;
   }
 
   try {
-    const res = await getByModel(productModelId);
+    const res = await getByModelList(productModelIds);
     if (Array.isArray(res)) {
       bomOptions.value = res;
       return;
@@ -168,13 +168,13 @@
     formState.value.productModelId = product.id;
     formState.value.productName = product.productName;
     formState.value.productModelName = product.model;
-    await loadBomList(product.id);
+    await loadBomList([product.id]);
   } else {
     formState.value.productId = undefined;
     formState.value.productModelId = undefined;
     formState.value.productName = "";
     formState.value.productModelName = "";
-    bomOptions.value = [];
+    await loadBomList(products.map((product) => product.id));
   }
 
   showProductSelectDialog.value = false;
@@ -205,7 +205,7 @@
       productModelName: formState.value.selectedProducts.length === 1
         ? formState.value.selectedProducts[0].model
         : undefined,
-      bomId: formState.value.selectedProducts.length === 1 ? formState.value.bomId : undefined,
+      bomId: formState.value.bomId,
       description: formState.value.description,
     })
       .then(() => {

--
Gitblit v1.9.3