diff --git a/inventory-web/src/views/material/list.vue b/inventory-web/src/views/material/list.vue index 01ca739..d9af0e8 100644 --- a/inventory-web/src/views/material/list.vue +++ b/inventory-web/src/views/material/list.vue @@ -597,6 +597,8 @@ import { Plus, Document, Refresh, Setting, Rank, Camera, Link, Download, Bell, C import { ElMessage, ElMessageBox, ElLoading } from 'element-plus'; import type { FormInstance, FormRules } from 'element-plus'; import { useUserStore } from '@/stores/user'; +import { useRoute } from 'vue-router'; +const route = useRoute(); import { listMaterialBase, @@ -1589,6 +1591,21 @@ onMounted(() => { initColumnPermissions(); getList(); getOptionsList(); + + // 【新增】:处理外部跳转自动打开编辑弹窗(来自入库编辑的'前往修改基础信息') + if (route.query.edit_id) { + const editId = Number(route.query.edit_id); + listMaterialBase({ id: editId }).then((res: any) => { + const rows = res?.data?.list ?? res?.data ?? []; + if (rows.length > 0) { + setTimeout(() => { + handleEdit(rows[0]); + }, 300); + } + }).catch((error: any) => { + console.error('自动获取物料详情失败', error); + }); + } });