Browse Source

level值等于"district", "street", "community"

feature
是小王呀\24601 2 years ago
parent
commit
10428e06d5
  1. 41
      src/views/modules/resourceManagement/enterprise/addForm.vue

41
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 {

Loading…
Cancel
Save