Browse Source

ss

shibei_master
dai 4 years ago
parent
commit
b85fb087cb
  1. 145
      src/views/modules/visual/basicinfo/cpts/people-more.vue

145
src/views/modules/visual/basicinfo/cpts/people-more.vue

@ -18,19 +18,19 @@
<div class="list">
<div class="item" v-if="index == 0">
<span class="item-field">所属网格</span>
<span>{{gridName}}</span>
<span>{{ gridName }}</span>
</div>
<div class="item" v-if="index == 0">
<span class="item-field">所属小区</span>
<span></span>
<span>{{ xiaoquName }}</span>
</div>
<div class="item" v-if="index == 0">
<span class="item-field">所属楼宇</span>
<span></span>
<span>{{ louName }}-{{ danyuanName }}</span>
</div>
<div class="item" v-if="index == 0">
<span class="item-field">所属家庭</span>
<span></span>
<span>{{ homeName }}</span>
</div>
<div class="item" :key="field.itemId" v-for="field in fieldSubList">
<span class="item-field">{{ field.label }}</span>
@ -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);
}
},
},
};
</script>

Loading…
Cancel
Save