From 9d80412e83cc7f887f2b544c38e0d14e6bac1ab8 Mon Sep 17 00:00:00 2001 From: zzyuan <781948537@qq.com> Date: Wed, 28 Jan 2026 16:27:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=90=9C=E7=B4=A2=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entryApply/components/AddEquip.vue | 7 +- src/views/system/project/index.vue | 183 ++++++++++++------ 2 files changed, 132 insertions(+), 58 deletions(-) diff --git a/src/views/stockManagement/entryApply/components/AddEquip.vue b/src/views/stockManagement/entryApply/components/AddEquip.vue index 1fba9ff1..167a4d7f 100644 --- a/src/views/stockManagement/entryApply/components/AddEquip.vue +++ b/src/views/stockManagement/entryApply/components/AddEquip.vue @@ -288,7 +288,6 @@ v-else-if="item.inputType == 'SELECT'" v-model="form[item.propertyCode]" clearable - filterable style="width: 100%" > - - - - - - - + + - - - - - - + + - - - - - - - - - - - 重置 - - 查询 - - - + + + + + + + + + + + + + + + + + + + + + + + + + + 重置 + + 查询 + + + @@ -301,7 +326,7 @@ import { getProjectTypeList, delProjectBatch // 新增:导入批量删除API } from '@/api/system/project' - +import { deptTreeSelect } from '@/api/system/user' export default { name: 'ProjectManagement', dicts: ['voltage_type', 'project_status', 'project_type', 'project_source'], @@ -312,10 +337,15 @@ export default { pageNum: 1, pageSize: 10, pro_name: '', + pro_code: '', + project_source: '', + project_type: '', project_status: '', voltage: '' }, + propertyUnitIds:[], + propertyUnitList: [], // 施工单位 // 列表数据 projectList: [], total: 0, @@ -353,12 +383,54 @@ export default { } }, created() { + this.getDeptTreeSelect() this.getProjectListData() }, + computed: { + hasChildrenPropertyUnit() { + const check = (list = []) => { + return list.some(item => { + return ( + Array.isArray(item.children) && + item.children.length > 0 + ) || check(item.children) + }) + } + return check(this.propertyUnitList) + } + }, methods: { + handleUnitChange(value) { + if (value.length === 0) { + this.queryParams.propertyUnitId = undefined + return + } + this.queryParams.propertyUnitId = value[value.length - 1] + }, + // 获取产权单位 + async getDeptTreeSelect() { + const res = await deptTreeSelect() + this.propertyUnitList = this.filterTree(res.data) + console.log('🚀 ~ this.propertyUnitList:', this.propertyUnitList) + }, + filterTree(nodes) { + return nodes + .map((node) => { + if (node.children) { + node.children = this.filterTree(node.children) + } + return node + }) + .filter((node) => node.status !== '1') + }, // 获取列表数据 async getProjectListData() { try { + if(this.propertyUnitIds&&this.propertyUnitIds.length>0){ + this.searchParams.org_id = this.propertyUnitIds[this.propertyUnitIds.length-1] + }else{ + this.searchParams.org_id = null + } const res = await listProject(this.searchParams) if (res.code === 200) { this.projectList = res.data.rows || [] @@ -485,6 +557,7 @@ export default { // 重置搜索 onReset() { this.$refs.searchFormRef.resetFields() + this.propertyUnitIds=[] this.searchParams = { pageNum: 1, pageSize: 10,