From b35aad7a51f2ee2a8e2fe2f7c1bddde8ba99303c Mon Sep 17 00:00:00 2001 From: bb_pan Date: Tue, 13 Jan 2026 17:39:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../home/components/ProvincialCompany.vue | 2 ++ .../toolsManage/codeToolsLedger/index.vue | 21 +++++++++++++------ src/views/toolsManage/toolsLedger/index.vue | 21 +++++++++++++------ 3 files changed, 32 insertions(+), 12 deletions(-) diff --git a/src/views/home/components/ProvincialCompany.vue b/src/views/home/components/ProvincialCompany.vue index 689453e6..f5434b97 100644 --- a/src/views/home/components/ProvincialCompany.vue +++ b/src/views/home/components/ProvincialCompany.vue @@ -258,10 +258,12 @@ export default { }); this.$router.push({ path: '/equipment/codeToolsLedger', + query: { parentId: rowData.parentId, deptId: rowData.companyId } }); } else if (type === 'toolNum') { this.$router.push({ path: '/equipment/toolsLedger', + query: { parentId: rowData.parentId, deptId: rowData.companyId } }); } }, diff --git a/src/views/toolsManage/codeToolsLedger/index.vue b/src/views/toolsManage/codeToolsLedger/index.vue index 0a2f7d46..5254713f 100644 --- a/src/views/toolsManage/codeToolsLedger/index.vue +++ b/src/views/toolsManage/codeToolsLedger/index.vue @@ -515,8 +515,18 @@ export default { number: 0, // 上传文件计数 } }, - created() { - this.getDeptTreeSelect() + async created() { + await this.getDeptTreeSelect() + const params = this.$route.query + this.queryParams.propertyUnitId = params?.deptId || '' + const ids = [] + if (params?.parentId) { + ids.push(params.parentId) + } + if (params?.deptId) { + ids.push(params.deptId) + } + this.queryParams.propertyUnitIds = [...ids.map(Number)] this.getList() this.getSelectList() }, @@ -529,10 +539,9 @@ export default { this.queryParams.propertyUnitId = value[value.length - 1] }, // 获取产权单位 - getDeptTreeSelect() { - deptTreeSelect().then((res) => { - this.propertyUnitList = this.filterTree(res.data) - }) + async getDeptTreeSelect() { + const res = await deptTreeSelect() + this.propertyUnitList = this.filterTree(res.data) }, filterTree(nodes) { return nodes diff --git a/src/views/toolsManage/toolsLedger/index.vue b/src/views/toolsManage/toolsLedger/index.vue index d61d0743..ff02c730 100644 --- a/src/views/toolsManage/toolsLedger/index.vue +++ b/src/views/toolsManage/toolsLedger/index.vue @@ -395,8 +395,18 @@ export default { dialogList: [] } }, - created() { - this.getDeptTreeSelect() + async created() { + await this.getDeptTreeSelect() + const params = this.$route.query + this.queryParams.propertyUnitId = params?.deptId || '' + const ids = [] + if (params?.parentId) { + ids.push(params.parentId) + } + if (params?.deptId) { + ids.push(params.deptId) + } + this.queryParams.propertyUnitIds = [...ids.map(Number)] this.getList() this.getSelectList() this.getToolTree() @@ -410,10 +420,9 @@ export default { this.queryParams.propertyUnitId = value[value.length - 1] }, // 获取产权单位 - getDeptTreeSelect() { - deptTreeSelect().then((res) => { - this.propertyUnitList = this.filterTree(res.data) - }) + async getDeptTreeSelect() { + const res = await deptTreeSelect() + this.propertyUnitList = this.filterTree(res.data) }, filterTree(nodes) { return nodes