Browse Source

Merge branch 'dev-jmlb0908' into yantai_master

dev-烟台0301
jiangyy 3 years ago
parent
commit
70a61fd43b
  1. 253
      src/views/modules/visual/basicinfo/cpts/people-more.vue

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

@ -7,43 +7,45 @@
<span>更多信息</span> <span>更多信息</span>
</div> </div>
<div class="btn-close" @click="handleClose"> <div class="btn-close"
@click="handleClose">
<img src="@/assets/img/shuju/people/close.png" /> <img src="@/assets/img/shuju/people/close.png" />
</div> </div>
<div <div :key="'fieldSubList' + index"
:key="'fieldSubList' + index" v-for="(fieldSubList, index) in fieldList">
v-for="(fieldSubList, index) in fieldList"
>
<div class="list"> <div class="list">
<div class="item" <div class="item"
v-if="index == 0 && gridName"> v-if="index == 0 && gridName">
<span class="item-field">所属网格</span> <span class="item-field">所属网格</span>
<span>{{ gridName }}</span> <span>{{ gridName }}</span>
</div> </div>
<div class="item" v-if="index == 0"> <div class="item"
v-if="index == 0">
<span class="item-field">所属小区</span> <span class="item-field">所属小区</span>
<span>{{ xiaoquName }}</span> <span>{{ xiaoquName }}</span>
</div> </div>
<div class="item" v-if="index == 0"> <div class="item"
v-if="index == 0">
<span class="item-field">所属楼栋</span> <span class="item-field">所属楼栋</span>
<span>{{ louName }}-{{ danyuanName }}</span> <span>{{ louName }}-{{ danyuanName }}</span>
</div> </div>
<div class="item" v-if="index == 0"> <div class="item"
v-if="index == 0">
<span class="item-field">所属家庭</span> <span class="item-field">所属家庭</span>
<span>{{ homeName }}</span> <span>{{ homeName }}</span>
</div> </div>
<div class="item" :key="field.itemId" v-for="field in fieldSubList"> <div class="item"
:key="field.itemId"
v-for="field in fieldSubList">
<span class="item-field">{{ field.label }}</span> <span class="item-field">{{ field.label }}</span>
<span <span v-if="
v-if="
field.itemType == 'select' || field.itemType == 'select' ||
field.itemType == 'radio' || field.itemType == 'radio' ||
field.itemType == 'checkbox' || field.itemType == 'checkbox' ||
field.itemType == 'cascader' field.itemType == 'cascader'
" ">{{
>{{
info[field.columnName] == null info[field.columnName] == null
? "--" ? "--"
: getOptionLabel( : getOptionLabel(
@ -51,8 +53,7 @@
info[field.columnName], info[field.columnName],
field.itemType field.itemType
) )
}}</span }}</span>
>
<span v-else>{{ <span v-else>{{
info[field.columnName] == null ? "--" : info[field.columnName] info[field.columnName] == null ? "--" : info[field.columnName]
@ -64,63 +65,47 @@
</div> </div>
<div class="tabs"> <div class="tabs">
<div <div class="tab-btn"
class="tab-btn" @click="subStartGroupIndex"
@click="subStartGroupIndex" v-if="groupList.length > 9">
v-if="groupList.length > 9"
>
<img src="@/assets/img/shuju/people/arrow-double-left.png" /> <img src="@/assets/img/shuju/people/arrow-double-left.png" />
</div> </div>
<div <div v-show="index >= startGroupIndex && index < startGroupIndex + 9"
v-show="index >= startGroupIndex && index < startGroupIndex + 9" class="tab"
class="tab" :class="groupIndex % groupList.length == index ? 'z-on' : ''"
:class="groupIndex % groupList.length == index ? 'z-on' : ''" :key="'tab' + index"
:key="'tab' + index" @click="groupIndex = index"
@click="groupIndex = index" v-for="(item, index) in groupList">
v-for="(item, index) in groupList"
>
{{ item.label }} {{ item.label }}
</div> </div>
<div <div class="tab-btn"
class="tab-btn" @click="addStartGroupIndex"
@click="addStartGroupIndex" v-if="groupList.length > 9">
v-if="groupList.length > 9"
>
<img src="@/assets/img/shuju/people/arrow-double-right.png" /> <img src="@/assets/img/shuju/people/arrow-double-right.png" />
</div> </div>
</div> </div>
<div <div :key="'group' + index"
:key="'group' + index" v-show="groupIndex % groupList.length == index"
v-show="groupIndex % groupList.length == index" v-for="(group, index) in groupList">
v-for="(group, index) in groupList" <div v-if="
>
<div
v-if="
group.tableName == 'ic_resi_demand' && group.tableName == 'ic_resi_demand' &&
Array.isArray(allInfo.ic_resi_demand) && Array.isArray(allInfo.ic_resi_demand) &&
allInfo.ic_resi_demand.length > 0 allInfo.ic_resi_demand.length > 0
" ">
> <div class="list"
<div :key="'ic_resi_demand' + infoIndex"
class="list" v-for="(infoItem, infoIndex) in allInfo.ic_resi_demand">
:key="'ic_resi_demand' + infoIndex" <div class="item"
v-for="(infoItem, infoIndex) in allInfo.ic_resi_demand" :key="field.itemId"
> v-for="field in group.itemList">
<div
class="item"
:key="field.itemId"
v-for="field in group.itemList"
>
<span class="item-field">{{ field.label }}</span> <span class="item-field">{{ field.label }}</span>
<span <span v-if="
v-if="
field.itemType == 'select' || field.itemType == 'select' ||
field.itemType == 'radio' || field.itemType == 'radio' ||
field.itemType == 'checkbox' || field.itemType == 'checkbox' ||
field.itemType == 'cascader' field.itemType == 'cascader'
" ">{{
>{{
infoItem[field.columnName] == null infoItem[field.columnName] == null
? "--" ? "--"
: getOptionLabel( : getOptionLabel(
@ -128,8 +113,7 @@
infoItem[field.columnName], infoItem[field.columnName],
field.itemType field.itemType
) )
}}</span }}</span>
>
<span v-else>{{ <span v-else>{{
infoItem[field.columnName] == null infoItem[field.columnName] == null
@ -139,60 +123,45 @@
</div> </div>
</div> </div>
</div> </div>
<div <div v-else-if="group.tableName == 'ic_hs'"
v-else-if="group.tableName == 'ic_hs'" style="margin-top: 10px; padding: 0 20px">
style="margin-top: 10px; padding: 0 20px"
>
<div class="tb"> <div class="tb">
<cpt-tb <cpt-tb :col-list="natDemand.colList"
:col-list="natDemand.colList" :loading="natDemand.loading"
:loading="natDemand.loading" :header="natDemand.header"
:header="natDemand.header" :list="natDemand.list"></cpt-tb>
:list="natDemand.list"
></cpt-tb>
</div> </div>
</div> </div>
<div <div v-else-if="group.tableName == 'ic_xc'"
v-else-if="group.tableName == 'ic_xc'" style="margin-top: 10px; padding: 0 20px">
style="margin-top: 10px; padding: 0 20px"
>
<div class="tb"> <div class="tb">
<cpt-tb <cpt-tb :col-list="tripDemand.colList"
:col-list="tripDemand.colList" :loading="tripDemand.loading"
:loading="tripDemand.loading" :header="tripDemand.header"
:header="tripDemand.header" :list="tripDemand.list"></cpt-tb>
:list="tripDemand.list"
></cpt-tb>
</div> </div>
</div> </div>
<div <div v-else-if="group.tableName == 'ic_ym'"
v-else-if="group.tableName == 'ic_ym'" style="margin-top: 10px; padding: 0 20px">
style="margin-top: 10px; padding: 0 20px"
>
<div class="tb"> <div class="tb">
<cpt-tb <cpt-tb :col-list="vaccineDemand.colList"
:col-list="vaccineDemand.colList" :loading="vaccineDemand.loading"
:loading="vaccineDemand.loading" :header="vaccineDemand.header"
:header="vaccineDemand.header" :list="vaccineDemand.list"></cpt-tb>
:list="vaccineDemand.list"
></cpt-tb>
</div> </div>
</div> </div>
<div class="list" v-else> <div class="list"
<div v-else>
class="item" <div class="item"
:key="field.itemId" :key="field.itemId"
v-for="field in group.itemList" v-for="field in group.itemList">
>
<span class="item-field">{{ field.label }}</span> <span class="item-field">{{ field.label }}</span>
<span <span v-if="
v-if="
field.itemType == 'select' || field.itemType == 'select' ||
field.itemType == 'radio' || field.itemType == 'radio' ||
field.itemType == 'checkbox' || field.itemType == 'checkbox' ||
field.itemType == 'cascader' field.itemType == 'cascader'
" ">{{
>{{
!allInfo[group.tableName] || !allInfo[group.tableName] ||
allInfo[group.tableName][0][field.columnName] == null allInfo[group.tableName][0][field.columnName] == null
? "--" ? "--"
@ -201,8 +170,7 @@
allInfo[group.tableName][0][field.columnName], allInfo[group.tableName][0][field.columnName],
field.itemType field.itemType
) )
}}</span }}</span>
>
<span v-else>{{ <span v-else>{{
!allInfo[group.tableName] || !allInfo[group.tableName] ||
@ -241,7 +209,7 @@ export default {
cptTb, cptTb,
}, },
data() { data () {
return { return {
fieldList: [], fieldList: [],
groupList: [], groupList: [],
@ -349,7 +317,7 @@ export default {
}, },
computed: { computed: {
xiaoquName() { xiaoquName () {
const { const {
xiaoquList, xiaoquList,
info: { VILLAGE_ID }, info: { VILLAGE_ID },
@ -362,7 +330,7 @@ export default {
} }
return ""; return "";
}, },
louName() { louName () {
const { const {
louList, louList,
info: { BUILD_ID }, info: { BUILD_ID },
@ -375,7 +343,7 @@ export default {
} }
return ""; return "";
}, },
danyuanName() { danyuanName () {
const { const {
danyuanList, danyuanList,
info: { UNIT_ID }, info: { UNIT_ID },
@ -388,7 +356,7 @@ export default {
} }
return ""; return "";
}, },
danyuanName() { danyuanName () {
const { const {
danyuanList, danyuanList,
info: { UNIT_ID }, info: { UNIT_ID },
@ -401,7 +369,7 @@ export default {
} }
return ""; return "";
}, },
homeName() { homeName () {
const { const {
homeList, homeList,
info: { HOME_ID }, info: { HOME_ID },
@ -417,17 +385,17 @@ export default {
}, },
watch: { watch: {
userId() { userId () {
this.getApiData(); this.getApiData();
}, },
}, },
mounted() { mounted () {
this.getApiData(); this.getApiData();
}, },
methods: { methods: {
addStartGroupIndex() { addStartGroupIndex () {
const { startGroupIndex, groupList } = this; const { startGroupIndex, groupList } = this;
if (startGroupIndex < groupList.length - 9) { if (startGroupIndex < groupList.length - 9) {
this.startGroupIndex = startGroupIndex + 1; this.startGroupIndex = startGroupIndex + 1;
@ -435,7 +403,7 @@ export default {
this.startGroupIndex = groupList.length - 9; this.startGroupIndex = groupList.length - 9;
} }
}, },
subStartGroupIndex() { subStartGroupIndex () {
const { startGroupIndex, groupList } = this; const { startGroupIndex, groupList } = this;
if (startGroupIndex > 0) { if (startGroupIndex > 0) {
this.startGroupIndex = startGroupIndex - 1; this.startGroupIndex = startGroupIndex - 1;
@ -443,11 +411,11 @@ export default {
this.startGroupIndex = 0; this.startGroupIndex = 0;
} }
}, },
handleClose() { handleClose () {
this.$emit("close"); this.$emit("close");
}, },
async getApiData() { async getApiData () {
await this.getField(); await this.getField();
await this.getInfo(); await this.getInfo();
this.getDetailList(); this.getDetailList();
@ -457,24 +425,14 @@ export default {
this.getHomeList(); this.getHomeList();
}, },
getOptionLabel(options, value, type = "") { getOptionLabel (options, value, type = "") {
console.log(options, value, type)
if (Array.isArray(options)) { if (Array.isArray(options)) {
let valueArr = value.split(","); let valueArr = value.split(",");
if (type == "cascader") { if (type == "cascader") {
if (valueArr.length > 0) { let finalValue = [];
let level1 = options.find((item) => item.value == valueArr[0]); this.getNodePath(options, value, finalValue);
if (level1) { return finalValue.join("-");
if (valueArr.length > 1 && level1.children) {
let level2 = level1.children.find(
(item) => item.value == valueArr[1]
);
if (level2) {
return level1.label + "-" + level2.label;
}
}
return level1.label;
}
}
} else { } else {
return valueArr return valueArr
.map((val) => { .map((val) => {
@ -490,8 +448,28 @@ export default {
return "--"; return "--";
}, },
getNodePath (node, val, path) {
// node:val:id, path:id
for (let i = 0; i < node.length; i++) {
const ele = node[i];
if (ele.value === val) {
path.push(ele.label);
return path;
} else if (ele.children && ele.children.length > 0) {
if (ele.children.some((row) => row.value === val)) {
path.unshift(ele.label);
this.getNodePath(ele.children, val, path);
} else {
this.getNodePath(ele.children, val, path);
}
}
}
return path;
},
// //
async getField() { async getField () {
const url = "/oper/customize/icform/getcustomerform"; const url = "/oper/customize/icform/getcustomerform";
const { data, code, msg } = await requestPost(url, { const { data, code, msg } = await requestPost(url, {
@ -531,7 +509,7 @@ export default {
}, },
// //
async getInfo() { async getInfo () {
const url = "/epmetuser/icresiuser/detail"; const url = "/epmetuser/icresiuser/detail";
const { data, code, msg } = await requestPost(url, { const { data, code, msg } = await requestPost(url, {
@ -560,11 +538,16 @@ export default {
this.groupList.forEach((subList, index) => { this.groupList.forEach((subList, index) => {
subList.itemList.forEach(async (item, subIndex) => { subList.itemList.forEach(async (item, subIndex) => {
if (item.optionSourceType == "remote" && item.optionSourceValue) { if (item.optionSourceType == "remote" && item.optionSourceValue) {
console.log(item.optionSourceValue)
console.log(this.getOptions(item.optionSourceValue))
this.groupList[index].itemList[subIndex].options = this.groupList[index].itemList[subIndex].options =
await this.getOptions(item.optionSourceValue); await this.getOptions(item.optionSourceValue);
} }
}); });
}); });
const arr = [ const arr = [
{ {
groupId: "hs123", groupId: "hs123",
@ -597,7 +580,7 @@ export default {
} }
}, },
async getDetailList() { async getDetailList () {
const url = "/epmetuser/epidemicPrevention/info"; const url = "/epmetuser/epidemicPrevention/info";
let params = { let params = {
id: this.userId, id: this.userId,
@ -643,7 +626,7 @@ export default {
}, },
// //
async getOptions(url) { async getOptions (url) {
if (!url) return []; if (!url) return [];
const { data, code, msg } = await requestPost(url, {}); const { data, code, msg } = await requestPost(url, {});
@ -655,7 +638,7 @@ export default {
} }
}, },
async getXiaoquList() { async getXiaoquList () {
const url = "/gov/org/icneighborhood/neighborhoodoption"; const url = "/gov/org/icneighborhood/neighborhoodoption";
const { data, code, msg } = await requestPost(url, { const { data, code, msg } = await requestPost(url, {
@ -669,7 +652,7 @@ export default {
this.$message.error(msg); this.$message.error(msg);
} }
}, },
async getLouList() { async getLouList () {
const url = "/gov/org/icbuilding/buildingoption"; const url = "/gov/org/icbuilding/buildingoption";
const { data, code, msg } = await requestPost(url, { const { data, code, msg } = await requestPost(url, {
@ -682,7 +665,7 @@ export default {
this.$message.error(msg); this.$message.error(msg);
} }
}, },
async getDanyuanList() { async getDanyuanList () {
const url = "/gov/org/icbuildingunit/unitoption"; const url = "/gov/org/icbuildingunit/unitoption";
const { data, code, msg } = await requestPost(url, { const { data, code, msg } = await requestPost(url, {
@ -695,7 +678,7 @@ export default {
this.$message.error(msg); this.$message.error(msg);
} }
}, },
async getHomeList() { async getHomeList () {
const url = "/gov/org/ichouse/houseoption"; const url = "/gov/org/ichouse/houseoption";
const { data, code, msg } = await requestPost(url, { const { data, code, msg } = await requestPost(url, {

Loading…
Cancel
Save