From f0d123e013ce534d392e54feb706c00af7c62e9d Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期二, 19 五月 2026 15:21:53 +0800
Subject: [PATCH] bom同一层级只能选一样的工序
---
src/views/productionManagement/processRoute/processRouteItem/index.vue | 29 ++++++++++++++++++++++++++++-
1 files changed, 28 insertions(+), 1 deletions(-)
diff --git a/src/views/productionManagement/processRoute/processRouteItem/index.vue b/src/views/productionManagement/processRoute/processRouteItem/index.vue
index 83ee60a..92a2fa1 100644
--- a/src/views/productionManagement/processRoute/processRouteItem/index.vue
+++ b/src/views/productionManagement/processRoute/processRouteItem/index.vue
@@ -1146,9 +1146,36 @@
});
};
+ const findSiblings = (items, tempId) => {
+ if (!items || items.length === 0) return null;
+ // 妫�鏌ュ綋鍓嶅眰绾�
+ if (items.some(item => item.tempId === tempId)) {
+ return items;
+ }
+ // 閫掑綊鏌ユ壘瀛愮骇
+ for (const item of items) {
+ if (item.children && item.children.length > 0) {
+ const result = findSiblings(item.children, tempId);
+ if (result) return result;
+ }
+ }
+ return null;
+ };
+
const handleBomProcessChange = (row, value) => {
row.processId = value || "";
syncProcessOperationFields(row);
+
+ // 鍚屼竴灞傜骇鍙兘閫変竴鏍风殑宸ュ簭
+ const siblings = findSiblings(bomDataValue.value.dataList, row.tempId);
+ if (siblings && value) {
+ siblings.forEach(sibling => {
+ if (sibling.tempId !== row.tempId) {
+ sibling.processId = value;
+ syncProcessOperationFields(sibling);
+ }
+ });
+ }
};
const openBomDialog = tempId => {
@@ -1692,4 +1719,4 @@
line-height: 1.5;
word-break: break-all;
}
-</style>
+</style>
\ No newline at end of file
--
Gitblit v1.9.3