diff --git a/src/views/modules/visual/basicinfo/cpts/people-more.vue b/src/views/modules/visual/basicinfo/cpts/people-more.vue index b0615e19..8c7e2dcb 100644 --- a/src/views/modules/visual/basicinfo/cpts/people-more.vue +++ b/src/views/modules/visual/basicinfo/cpts/people-more.vue @@ -18,19 +18,19 @@
所属网格: - {{gridName}} + {{ gridName }}
所属小区: - + {{ xiaoquName }}
所属楼宇: - + {{ louName }}-{{ danyuanName }}
所属家庭: - + {{ homeName }}
{{ field.label }}: @@ -112,7 +112,7 @@ export default { gridName: { type: String, default: "", - } + }, }, components: { @@ -126,10 +126,81 @@ export default { groupIndex: 0, info: {}, - + xiaoquList: [], + louList: [], + danyuanList: [], + homeList: [], }; }, + computed: { + xiaoquName() { + const { + xiaoquList, + info: { VILLAGE_ID }, + } = this; + if (Array.isArray(xiaoquList) && xiaoquList.length > 0 && VILLAGE_ID) { + let item = xiaoquList.find((item) => item.value == VILLAGE_ID); + if (item) { + return item.label; + } + } + return ""; + }, + louName() { + const { + louList, + info: { BUILD_ID }, + } = this; + if (Array.isArray(louList) && louList.length > 0 && BUILD_ID) { + let item = louList.find((item) => item.value == BUILD_ID); + if (item) { + return item.label; + } + } + return ""; + }, + danyuanName() { + const { + danyuanList, + info: { UNIT_ID }, + } = this; + if (Array.isArray(danyuanList) && danyuanList.length > 0 && UNIT_ID) { + let item = danyuanList.find((item) => item.value == UNIT_ID); + if (item) { + return item.label; + } + } + return ""; + }, + danyuanName() { + const { + danyuanList, + info: { UNIT_ID }, + } = this; + if (Array.isArray(danyuanList) && danyuanList.length > 0 && UNIT_ID) { + let item = danyuanList.find((item) => item.value == UNIT_ID); + if (item) { + return item.label; + } + } + return ""; + }, + homeName() { + const { + homeList, + info: { HOME_ID }, + } = this; + if (Array.isArray(homeList) && homeList.length > 0 && HOME_ID) { + let item = homeList.find((item) => item.value == HOME_ID); + if (item) { + return item.label; + } + } + return ""; + }, + }, + watch: { userId() { this.getInfo(); @@ -145,9 +216,13 @@ export default { this.$emit("close"); }, - getApiData() { + async getApiData() { this.getField(); - this.getInfo(); + await this.getInfo(); + this.getXiaoquList(); + this.getLouList(); + this.getDanyuanList(); + this.getHomeList(); }, getOptionLabel(options, value) { @@ -240,6 +315,60 @@ export default { return []; } }, + + async getXiaoquList() { + const url = "/gov/org/icneighborhood/neighborhoodoption"; + + const { data, code, msg } = await requestPost(url, { + agencyId: this.info.AGENCY_ID, + gridId: this.info.GRID_ID, + }); + + if (code === 0) { + this.xiaoquList = data; + } else { + this.$message.error(msg); + } + }, + async getLouList() { + const url = "/gov/org/icbuilding/buildingoption"; + + const { data, code, msg } = await requestPost(url, { + neighborHoodId: this.info.VILLAGE_ID, + }); + + if (code === 0) { + this.louList = data; + } else { + this.$message.error(msg); + } + }, + async getDanyuanList() { + const url = "/gov/org/icbuildingunit/unitoption"; + + const { data, code, msg } = await requestPost(url, { + buildingId: this.info.BUILD_ID, + }); + + if (code === 0) { + this.danyuanList = data; + } else { + this.$message.error(msg); + } + }, + async getHomeList() { + const url = "/gov/org/ichouse/houseoption"; + + const { data, code, msg } = await requestPost(url, { + unitId: this.info.UNIT_ID, + }); + + if (code === 0) { + this.homeList = data; + } else { + this.$message.error(msg); + } + }, }, };