diff --git a/inventory-web/src/views/bom/BomManage.vue b/inventory-web/src/views/bom/BomManage.vue index 21ab127..c7c2f3e 100644 --- a/inventory-web/src/views/bom/BomManage.vue +++ b/inventory-web/src/views/bom/BomManage.vue @@ -83,13 +83,26 @@ + + 前往修改基础信息 + + + + + @@ -135,34 +148,45 @@ /> - + - handleVisibleChange(visible, 'child', $index)" - > - + handleVisibleChange(visible, 'child', $index)" > - - {{ item.name }} - {{ item.spec }} - - - + + + {{ item.name }} + {{ item.spec }} + + + + + + + @@ -204,7 +228,8 @@ import { ref, reactive, onMounted, computed, nextTick } from 'vue' import { useRoute } from 'vue-router' import { ElMessage, ElMessageBox, FormInstance, FormRules } from 'element-plus' -import { Plus, Search } from '@element-plus/icons-vue' +import { Plus, Search, EditPen } from '@element-plus/icons-vue' +import { useRouter } from 'vue-router' import { getBomList, getBomDetail, saveBom, deleteBom } from '@/api/bom' import { getMaterialBaseList } from '@/api/inbound/stock' import { useUserStore } from '@/stores/user' @@ -233,6 +258,7 @@ interface ChildRow { const userStore = useUserStore() const route = useRoute() +const router = useRouter() const loading = ref(false) const dialogVisible = ref(false) const saving = ref(false) @@ -467,6 +493,31 @@ const filteredChildren = computed(() => { }) }) +// 获取子件规格(从 childDropdownStates 缓存中查找) +const getChildSpec = (index: number): string => { + const state = childDropdownStates.value.get(index) + if (!state || !form.children[index]?.child_id) return '' + const material = state.options.find((m: MaterialBase) => m.id === form.children[index].child_id) + return material?.spec || '' +} + +// 在新标签页打开基础信息编辑 +const openMaterialInNewTab = (targetId: number | null, keyword: string = '') => { + if (!targetId) return ElMessage.warning('请先选择物料') + const routeUrl = router.resolve({ + path: '/material', + query: { edit_id: targetId, keyword } + }) + window.open(routeUrl.href, '_blank') +} + +const openParentMaterial = () => { + if (!form.parent_id) return ElMessage.warning('请先选择父件') + const parent = parentOptions.value.find((p: MaterialBase) => p.id === form.parent_id) + const keyword = parent?.spec || parent?.name || '' + openMaterialInNewTab(form.parent_id, keyword) +} + // 列与权限Code的映射关系(数据库中的code) const permissionMap: Record = { bom_no: 'bom_manage:bom_no', diff --git a/inventory-web/src/views/stock/inbound/product.vue b/inventory-web/src/views/stock/inbound/product.vue index b43cac1..8fd8bd1 100644 --- a/inventory-web/src/views/stock/inbound/product.vue +++ b/inventory-web/src/views/stock/inbound/product.vue @@ -250,9 +250,18 @@ - + 1. 基础信息 + + 前往修改基础信息 + @@ -561,7 +570,7 @@