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 {