4 天以前 f38a383fee2a1484948d9c5a66078c31e0a5e43a
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>