From 97e7618bf35a2b3e8d5fb92cfa86d87c07524dba Mon Sep 17 00:00:00 2001 From: DXC Date: Tue, 28 Apr 2026 10:10:45 +0800 Subject: [PATCH] =?UTF-8?q?feat(bom+inbound):=20BOM=E5=AD=90=E4=BB=B6?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E8=A7=84=E6=A0=BC=E4=BF=AE=E5=A4=8D=20+=20?= =?UTF-8?q?=E6=88=90=E5=93=81/=E5=8D=8A=E6=88=90=E5=93=81=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E8=BF=81=E7=A7=BB=E5=88=B0=E6=A0=87=E9=A2=98=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inventory-web/src/views/bom/BomManage.vue | 103 +++++++++++++----- .../src/views/stock/inbound/product.vue | 27 ++++- .../src/views/stock/inbound/semi.vue | 27 ++++- 3 files changed, 127 insertions(+), 30 deletions(-) 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 @@ /> - + @@ -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 @@