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]; this.formData.agencyId = val.length ? val[val.length - 1] : val[0];
}, },
getOrgTreeList() { getOrgTreeList() {
this.$http this.$http
.post('/gov/org/customeragency/agencygridtree', {})                 .post('/gov/org/customeragency/agencygridtree', {})
.then(({ data: res }) => {                 .then(({ data: res }) => {
if (res.code !== 0) {                     if (res.code !== 0) {
return this.$message.error(res.msg)                         return this.$message.error(res.msg)
} else {                     } else {
console.log('获取组织树成功', res.data)                         console.log('获取组织树成功', res.data)
this.orgOptions = []                         // this.orgOptions = []
this.orgOptions.push(res.data)                         // this.orgOptions.push(res.data)
}                         const filteredData = {
})                             ...res.data,
.catch(() => {                             subAgencyList: res.data.subAgencyList.filter(item => ["district", "street", "community"].includes(item.level))
return this.$message.error('网络错误')                         };
})                         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() { addInput() {
if (this.inputList.some(item => item.hazardDesc.trim() === '')) { if (this.inputList.some(item => item.hazardDesc.trim() === '')) {
} else { } else {

Loading…
Cancel
Save