From 10428e06d5adbc9d0175bd238ca3e6b9b1b816a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=AF=E5=B0=8F=E7=8E=8B=E5=91=80=5C24601?= <819653817@qq.com> Date: Tue, 14 May 2024 13:19:41 +0800 Subject: [PATCH] =?UTF-8?q?level=E5=80=BC=E7=AD=89=E4=BA=8E"district",=20"?= =?UTF-8?q?street",=20"community"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resourceManagement/enterprise/addForm.vue | 41 ++++++++++++------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/src/views/modules/resourceManagement/enterprise/addForm.vue b/src/views/modules/resourceManagement/enterprise/addForm.vue index 413e1bc2a..015d05bc4 100644 --- a/src/views/modules/resourceManagement/enterprise/addForm.vue +++ b/src/views/modules/resourceManagement/enterprise/addForm.vue @@ -414,21 +414,32 @@ export default { this.formData.agencyId = val.length ? val[val.length - 1] : val[0]; }, getOrgTreeList() { - this.$http - .post('/gov/org/customeragency/agencygridtree', {}) - .then(({ data: res }) => { - if (res.code !== 0) { - return this.$message.error(res.msg) - } else { - console.log('获取组织树成功', res.data) - this.orgOptions = [] - this.orgOptions.push(res.data) - } - }) - .catch(() => { - return this.$message.error('网络错误') - }) - }, + this.$http +                .post('/gov/org/customeragency/agencygridtree', {}) +                .then(({ data: res }) => { +                    if (res.code !== 0) { +                        return this.$message.error(res.msg) +                    } else { +                        console.log('获取组织树成功', res.data) +                        // this.orgOptions = [] +                        // this.orgOptions.push(res.data) +                        const filteredData = { +                            ...res.data, +                            subAgencyList: res.data.subAgencyList.filter(item => ["district", "street", "community"].includes(item.level)) +                        }; +                        this.orgOptions = [] +                        this.orgOptions.push(filteredData) +                        filteredData.subAgencyList.forEach(item => { +                            console.log(item.level); +                        }); +                        console.log('获取组织树成功111', this.orgOptions) +                    } + +                }) +                .catch(() => { +                    return this.$message.error('网络错误') +                }) +        }, addInput() { if (this.inputList.some(item => item.hazardDesc.trim() === '')) { } else {