From fa0af40ec7e25fe0c72465e92fc011477bf9c316 Mon Sep 17 00:00:00 2001 From: DXC Date: Fri, 24 Apr 2026 14:47:59 +0800 Subject: [PATCH] =?UTF-8?q?feat(material):=20=E7=89=A9=E6=96=99=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E9=A1=B5=E6=94=AF=E6=8C=81URL=E5=8F=82=E6=95=B0edit?= =?UTF-8?q?=5Fid=E8=87=AA=E5=8A=A8=E5=BC=B9=E5=87=BA=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inventory-web/src/views/material/list.vue | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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); + }); + } });