diff --git a/src/views/modules/communityParty/regionalParty/activitys.vue b/src/views/modules/communityParty/regionalParty/activitys.vue index bbd1009ae..75c2db368 100644 --- a/src/views/modules/communityParty/regionalParty/activitys.vue +++ b/src/views/modules/communityParty/regionalParty/activitys.vue @@ -23,22 +23,17 @@ - - - - - - - - + + + { + if (res.code !== 0) { + return this.$message.error(res.msg); + } else { + this.searchdemandOptions = this.getTreeData(res.data); + } + }) + .catch(() => { + return this.$message.error("网络错误"); + }); + }, + getTreeData(data) { + if (!Array.isArray(data)) return []; + let arr = data.map((item) => { + let _item = {}; + if (item.childCateList) { + if (item.childCateList.length === 0) + _item = { ...item, childCateList: undefined }; + else _item = { ...item, childCateList: this.getTreeData(item.childCateList) }; + } else { + _item = { ...item }; + } + return _item; + }); + return arr; + }, handleSearch () { this.loadTable() }, diff --git a/src/views/modules/communityParty/regionalParty/units.vue b/src/views/modules/communityParty/regionalParty/units.vue index a84106e31..852205cd4 100644 --- a/src/views/modules/communityParty/regionalParty/units.vue +++ b/src/views/modules/communityParty/regionalParty/units.vue @@ -18,21 +18,15 @@ - - - - + @@ -413,7 +407,9 @@ export default { unitId: "", formData: { unitName: "", - serviceMatter: "", + // categoryCode:"", + // parentCategoryCode:"", + serviceMatter:'', type: "", contact: "", contactMobile: "", @@ -436,6 +432,7 @@ export default { files: "", fileName: "", uploadUlr: window.SITE_CONFIG["apiURL"] + "/gov/org/neighborhood/import", + searchdemandOptions:[] }; }, components: { @@ -447,7 +444,7 @@ export default { async created() {}, async mounted() { //获取服务事项 - await this.loadService(); + await this.getDemandOptions() //获取分类 await this.loadType(); @@ -459,6 +456,42 @@ export default { }, methods: { + handleCateCHange(val) { + if (val.length === 1) { + this.formData.serviceMatter = val[1]; + } else { + this.formData.serviceMatter = val[0]; + } + }, + async getDemandOptions() { + this.$http + .post("/actual/base/serviceitem/listAllCategory") + .then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg); + } else { + this.searchdemandOptions = this.getTreeData(res.data); + } + }) + .catch(() => { + return this.$message.error("网络错误"); + }); + }, + getTreeData(data) { + if (!Array.isArray(data)) return []; + let arr = data.map((item) => { + let _item = {}; + if (item.childCateList) { + if (item.childCateList.length === 0) + _item = { ...item, childCateList: undefined }; + else _item = { ...item, childCateList: this.getTreeData(item.childCateList) }; + } else { + _item = { ...item }; + } + return _item; + }); + return arr; + }, handleSearch() { this.loadTable(); },