Browse Source

取消弹框,修复重复选中标签表单充值的问题

v1.1
mk 1 year ago
parent
commit
fae29d9c5a
  1. 1
      src/assets/scss/pages/resiInfo.scss
  2. 160
      src/views/components/editResi.vue
  3. 51
      src/views/components/resiExpand/editExpand.vue
  4. 2
      src/views/modules/base/resi.vue
  5. 43
      src/views/modules/portrayal/jumin/cpts/staffTag.vue
  6. 142
      src/views/modules/portrayal/jumin/index.vue

1
src/assets/scss/pages/resiInfo.scss

@ -89,6 +89,7 @@
position: relative; position: relative;
padding-bottom: 16px; padding-bottom: 16px;
.editBtn{ .editBtn{
z-index: 10;
position: absolute; position: absolute;
right: 16px; right: 16px;
top: 16px; top: 16px;

160
src/views/components/editResi.vue

@ -44,7 +44,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="性别"> <el-form-item label="性别" prop="baseInfoDto.gender">
<el-select v-model="form.baseInfoDto.gender" placeholder="请选择" size="small" <el-select v-model="form.baseInfoDto.gender" placeholder="请选择" size="small"
class="list_item_width_1" clearable> class="list_item_width_1" clearable>
<el-option v-for="(item, index) in genderList" :key="index" :label="item.label" <el-option v-for="(item, index) in genderList" :key="index" :label="item.label"
@ -53,7 +53,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="出生日期"> <el-form-item label="出生日期" prop="baseInfoDto.birthday">
<el-date-picker v-model.trim="form.baseInfoDto.birthday" class="list_item_width_1" <el-date-picker v-model.trim="form.baseInfoDto.birthday" class="list_item_width_1"
type="date" size="small" clearable placeholder="选择日期" format="yyyy 年 MM 月 dd 日" type="date" size="small" clearable placeholder="选择日期" format="yyyy 年 MM 月 dd 日"
value-format="yyyy-MM-dd"> value-format="yyyy-MM-dd">
@ -91,7 +91,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6" <el-col :span="6"
v-if="form.familyInfoDto.marriage == 'chuhun' || form.familyInfoDto.marriage == 'zaihun' || form.familyInfoDto.marriage == 'fuhun'"> v-if="form.familyInfoDto && form.familyInfoDto.marriage == 'chuhun' || form.familyInfoDto.marriage == 'zaihun' || form.familyInfoDto.marriage == 'fuhun'">
<el-form-item label="配偶情况"> <el-form-item label="配偶情况">
<el-select v-model="form.familyInfoDto.spouseSituation" placeholder="请选择" size="small" <el-select v-model="form.familyInfoDto.spouseSituation" placeholder="请选择" size="small"
class="list_item_width_1" clearable> class="list_item_width_1" clearable>
@ -404,9 +404,8 @@
<el-row style="margin:24px"> <el-row style="margin:24px">
<el-col :span="24" align="center"> <el-col :span="24" align="center">
<el-button size="small" class="diy-button--white" @click="handlerCancle" plain>取消</el-button> <el-button size="small" class="diy-button--white" @click="handlerCancle" plain>取消</el-button>
<el-button type="primary" size="small" :loading="btnLoading" <el-button type="primary" size="small" @click="handleClickSubmit">保存</el-button>
@click="handleClickSubmit">保存</el-button> <el-button type="primary" size="small"
<el-button type="primary" size="small" :loading="btnLoading"
@click="handleClickSubmit('house')">提交并补充家庭人员信息</el-button> @click="handleClickSubmit('house')">提交并补充家庭人员信息</el-button>
</el-col> </el-col>
</el-row> </el-row>
@ -428,6 +427,8 @@ export default {
data() { data() {
return { return {
loading: true, loading: true,
houseType: true,
formList: [], formList: [],
orgOptions: [], orgOptions: [],
orgOptionProps: { orgOptionProps: {
@ -926,7 +927,7 @@ export default {
id: 'specialSupportDto', id: 'specialSupportDto',
children: [ children: [
{//0 {
label: "特扶类别", label: "特扶类别",
itemType: "select1", itemType: "select1",
formName: "specialSupportType", formName: "specialSupportType",
@ -1057,7 +1058,6 @@ export default {
await this.getDicts() await this.getDicts()
await this.getOrgTreeList() await this.getOrgTreeList()
await this.getResiDetail() await this.getResiDetail()
this.loading = false;
}, },
methods: { methods: {
getResiDetail() { getResiDetail() {
@ -1079,6 +1079,37 @@ export default {
this.form.baseInfoDto.idNum = this.$route.params.idNum; this.form.baseInfoDto.idNum = this.$route.params.idNum;
this.form.baseInfoDto.mobile = this.$route.params.mobile; this.form.baseInfoDto.mobile = this.$route.params.mobile;
if (!res.data.data.familyInfoDto) {
this.form.familyInfoDto = {
marriage: null,//
spouseSituation: null,//
elderlyFlag: null,//
elderlyRelation: null,//
dependantMobile: null,//
}
}
if (!res.data.data.religionDto) {
this.form.religionDto = {
religion: null,//
}
}
if (!res.data.data.workInfoDto) {
this.form.workInfoDto = {
careerStatus: null,//
workUnit: null,//
occupation: null,//
}
}
if (!res.data.data.eduInfoDto) {
this.form.eduInfoDto = {
cultureLevel: null
}
}
if (!res.data.data.specialDto) {
this.form.specialDto = {
specialCategoryCodes: []
}
}
for (const key in this.form.baseInfoDto.categoryInfo) { for (const key in this.form.baseInfoDto.categoryInfo) {
if (this.form.baseInfoDto.categoryInfo[key] === 1 && this.incidence[key] || (this.form.baseInfoDto.categoryInfo.partyFlag == 1 && key === 'partyFlag')) { if (this.form.baseInfoDto.categoryInfo[key] === 1 && this.incidence[key] || (this.form.baseInfoDto.categoryInfo.partyFlag == 1 && key === 'partyFlag')) {
const formId = key === 'partyFlag' ? 'parymemberInfoDto' : key; const formId = key === 'partyFlag' ? 'parymemberInfoDto' : key;
@ -1099,6 +1130,7 @@ export default {
} }
} }
} }
console.log(this.footerInputList);
return Promise.all(promises); return Promise.all(promises);
} else if (res.data.code >= 8000) { } else if (res.data.code >= 8000) {
this.$message.error(res.data.msg); this.$message.error(res.data.msg);
@ -1109,6 +1141,8 @@ export default {
.catch((err) => { .catch((err) => {
console.log(err); console.log(err);
}); });
this.loading = false;
}, },
async getDicts() { async getDicts() {
try { try {
@ -1396,13 +1430,13 @@ export default {
}, },
async submitForm(house) { async submitForm(house) {
try { try {
let url = '/actual/base/residentBaseInfo/update' let url = this.houseType ? '/actual/base/residentBaseInfo/update' : '/actual/base/residentBaseInfo/save';
let parm = { let parm = {
...this.form ...this.form
} }
let { code, data, msg } = await requestPost(url, parm) let { code, data, msg } = await requestPost(url, parm)
if (code == 0) { if (code == 0) {
if (house!= 'house') { if (house != 'house') {
this.$message.success('保存成功'); this.$message.success('保存成功');
this.$refs['editForm'].resetFields(); this.$refs['editForm'].resetFields();
this.handlerCancle(); this.handlerCancle();
@ -1410,10 +1444,12 @@ export default {
this.$message.success('保存成功'); this.$message.success('保存成功');
let homeArr = JSON.parse(JSON.stringify(this.form.resideInfoDtos)); let homeArr = JSON.parse(JSON.stringify(this.form.resideInfoDtos));
this.$refs['editForm'].resetFields(); this.$refs['editForm'].resetFields();
this.form.resideInfoDtos = homeArr this.form.resideInfoDtos = homeArr;
this.removeIdKey(this.form)
this.houseType = false
} }
}else if(code >= 8000){ } else if (code >= 8000) {
this.$message.error(msg); this.$message.error(msg);
} }
} }
@ -1421,57 +1457,105 @@ export default {
this.$message.error(msg); this.$message.error(msg);
} }
}, },
removeIdKey(obj) {
if (!obj || typeof obj !== 'object') {
return;
}
for (const key in obj) {
if (obj.hasOwnProperty(key)) {
if (typeof obj[key] === 'object') {
this.removeIdKey(obj[key]);
}
if (key === 'id' || key === 'resiId' || key === 'createdTime' || key === 'updatedTime') {
delete obj[key];
}
}
}
},
showDialog({ index, value }, event) { showDialog({ index, value }, event) {
console.log(value); // partyFlag
if (value == 1) { if (value === 1 || value === 0 || value === 2) {
value = 'parymemberInfoDto' this.form.baseInfoDto.categoryInfo.partyFlag = value;
this.form.baseInfoDto.categoryInfo.partyFlag = 1; value = value === 1 ? 'parymemberInfoDto' : value;
} else if (value == 0) { if (value === 0 || value === 2) {
this.form.baseInfoDto.categoryInfo.partyFlag = 0; this.form.parymemberInfoDto = null;
this.form.parymemberInfoDto = null this.footerInputList.forEach(item => {
this.$nextTick(() => { if (item.id === 'parymemberInfoDto') {
this.$refs['resiExpand'].formList = this.$refs['resiExpand'].formList.filter(item => item.formId !== 'parymemberInfoDto'); item.children.forEach(child => {
}) child.value = child.itemType === "checkbox" ? [] : null;
});
}
});
} else if (value == 2) {
this.form.baseInfoDto.categoryInfo.partyFlag = 2;
this.form.parymemberInfoDto = null
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['resiExpand'].formList = this.$refs['resiExpand'].formList.filter(item => item.formId !== 'parymemberInfoDto'); this.$refs['resiExpand'].formList = this.$refs['resiExpand'].formList.filter(item => item.formId !== 'parymemberInfoDto');
}) });
}
} }
if (index != 3 && index) {
//
if (index !== 3 && index) {
this.form.baseInfoDto.categoryInfo[value] = event ? 1 : 0; this.form.baseInfoDto.categoryInfo[value] = event ? 1 : 0;
} else if (index == 3) { } else if (index === 3) {
if (event) { if (event) {
this.form.baseInfoDto.categoryInfo.specialCrowdFlag = 1; this.form.baseInfoDto.categoryInfo.specialCrowdFlag = 1;
this.form.specialDto.specialCategoryCodes.push(value); this.form.specialDto.specialCategoryCodes.push(value);
} else { } else {
this.form.specialDto.specialCategoryCodes = this.form.specialDto.specialCategoryCodes.filter(item => item != value); this.form.specialDto.specialCategoryCodes = this.form.specialDto.specialCategoryCodes.filter(item => item !== value);
} }
} }
// incidence
if (this.incidence[value]) { if (this.incidence[value]) {
if (event) { if (event) {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['resiExpand'].formList.push({ this.$refs['resiExpand'].formList.push({
'form': [this.footerInputList.find(item => item.id === this.incidence[value].formId)], 'title': this.incidence[value].title, formId: this.incidence[value].formId form: [this.footerInputList.find(item => item.id === this.incidence[value].formId)],
title: this.incidence[value].title,
formId: this.incidence[value].formId
}); });
this.$refs['resiExpand'].formType = this.incidence[value].formType; this.$refs['resiExpand'].formType = this.incidence[value].formType;
this.$refs['resiExpand'].showForm() this.$refs['resiExpand'].showForm();
}); });
} else { } else {
this.$refs['resiExpand'].formList = this.$refs['resiExpand'].formList.filter(item => item.formId !== this.incidence[value].formId); this.$refs['resiExpand'].formList = this.$refs['resiExpand'].formList.filter(item => item.formId !== this.incidence[value].formId);
// delete this.$refs['resiExpand'].form[this.incidence[value].formType];
delete this.form[this.incidence[value].formType]
// console.log(this.form, '');
}
this.footerInputList.forEach(item => {
if (item.id === this.incidence[value].formId) {
item.children.forEach(child => {
child.value = child.itemType === "checkbox" ? [] : null;
});
}
});
delete this.form[this.incidence[value].formType];
}
} }
}, },
// //
submitExpand(_form) { submitExpand(_form, { changId, changPid, changType }) {
this.form = { ...this.form, ..._form }; if (changType == 'checkbox') {
// console.log(this.form, ''); this.form[changPid][changId] = [];
this.form[changPid][changId].push(..._form[changPid][changId])
} else {
if (!this.form[changPid]) {
this.$set(this.form, changPid, {});
}
this.$set(this.form[changPid], changId, _form[changPid][changId]);
}
for (let i in this.footerInputList) {
if (this.footerInputList[i].id === changPid) {
for (let index in this.footerInputList[i].children) {
const formName = this.footerInputList[i].children[index].formName;
const formData = this.form[changPid];
if (formData && Object.keys(formData).includes(formName)) {
this.footerInputList[i].children[index].value = formData[formName] || null;
}
}
}
}
}, },
}, },
components: { stafftag, resiExpand }, components: { stafftag, resiExpand },

51
src/views/components/resiExpand/editExpand.vue

@ -10,58 +10,68 @@
<template v-if="itemk.itemType == 'radio1'"> <template v-if="itemk.itemType == 'radio1'">
<section class="list_item_width_1"> <section class="list_item_width_1">
<el-radio v-for="ns in itemk.opction" :key="ns.value" size="small" <el-radio v-for="ns in itemk.opction" :key="ns.value" size="small"
v-model.trim="form[itemj.id][itemk.formName]" :label="ns.value"> v-model.trim="form[itemj.id][itemk.formName]" :label="ns.value"
@click.native="handleFormChange(itemj.id,itemk.formName,itemk.itemType)">
{{ ns.label }} {{ ns.label }}
</el-radio> </el-radio>
</section> </section>
</template> </template>
<template v-else-if="itemk.itemType == 'select1' && itemk.showFlag !== '0'"> <template v-else-if="itemk.itemType == 'select1' && itemk.showFlag !== '0'">
<el-select v-model="form[itemj.id][itemk.formName]" :placeholder="`请选择${itemk.label}`" <el-select v-model="form[itemj.id][itemk.formName]" :placeholder="`请选择${itemk.label}`"
size="small" :multiple="itemk.multiple" :collapse-tags="itemk.collapseTags" clearable size="small" :multiple="itemk.multiple" :collapse-tags="itemk.collapseTags"
clearable
:style="{ 'width': itemk.formName == 'specialCategoryCode' ? '183px' : '' }" :style="{ 'width': itemk.formName == 'specialCategoryCode' ? '183px' : '' }"
class="list_item_width_1"> class="list_item_width_1">
<el-option v-for="items in itemk.opction" :key="items.value" :label="items.label" <el-option v-for="items in itemk.opction" :key="items.value" :label="items.label"
:value="items.value"> :value="items.value" @click.native="handleFormChange(itemj.id,itemk.formName,itemk.itemType)">
</el-option> </el-option>
</el-select> </el-select>
</template> </template>
<template v-else-if="itemk.itemType == 'textarea1'"> <template v-else-if="itemk.itemType == 'textarea1'">
<el-input type="textarea" :placeholder="`请输入${itemk.label}`" class="item-width-textarea" <el-input type="textarea" :placeholder="`请输入${itemk.label}`" class="item-width-textarea"
maxlength="120" size="small" show-word-limit resize="none" rows="3" maxlength="120" size="small" show-word-limit resize="none" rows="3"
v-model.trim="form[itemj.id][itemk.formName]"> v-model.trim="form[itemj.id][itemk.formName]" @change.native="handleFormChange(itemj.id,itemk.formName,itemk.itemType)">
</el-input> </el-input>
</template> </template>
<template v-else-if="itemk.itemType == 'input1'"> <template v-else-if="itemk.itemType == 'input1'">
<el-input :placeholder="`请输入${itemk.label}`" class="list_item_width_1" size="small" <el-input :placeholder="`请输入${itemk.label}`" class="list_item_width_1" size="small"
:style="{ 'margin-right': itemk.label == '备注' ? '50px' : '' }" :style="{ 'margin-right': itemk.label == '备注' ? '50px' : '' }"
v-model.trim="form[itemj.id][itemk.formName]" clearable> v-model.trim="form[itemj.id][itemk.formName]" clearable @change.native="handleFormChange(itemj.id,itemk.formName,itemk.itemType)">
</el-input> </el-input>
</template> </template>
<template v-else-if="itemk.itemType == 'inputNum'"> <template v-else-if="itemk.itemType == 'inputNum'">
<el-input :placeholder="`请输入${itemk.label}`" size="small" class="list_item_width_1-text" <el-input :placeholder="`请输入${itemk.label}`" size="small" class="list_item_width_1-text"
:style="{ 'margin-right': itemk.label == '备注' ? '50px' : '' }" :style="{ 'margin-right': itemk.label == '备注' ? '50px' : '' }"
v-model.trim="form[itemj.id][itemk.formName]" clearable v-model.trim="form[itemj.id][itemk.formName]" clearable
@blur="checkNumberInput(itemj.id, itemk.formName)"> @blur="checkNumberInput(itemj.id, itemk.formName)" @change.native="handleFormChange(itemj.id,itemk.formName,itemk.itemType)">
</el-input><span class="u-data-tag"></span> </el-input><span class="u-data-tag"></span>
</template> </template>
<template v-else-if="itemk.itemType == 'checkbox'"> <template v-else-if="itemk.itemType == 'checkbox'">
<el-checkbox-group size="small" v-model="form[itemj.id][itemk.formName]"> <el-checkbox-group size="small" v-model="form[itemj.id][itemk.formName]">
<el-checkbox v-for="items in itemk.opction" :label="items.value" <el-checkbox v-for="items in itemk.opction" :label="items.value"
:style="{ 'margin-right': items.label != itemk.label ? '' : '19px' }" :style="{ 'margin-right': items.label != itemk.label ? '' : '19px' }"
:key="items.value" :value="items.value">{{ items.label }}</el-checkbox> :key="items.value" :value="items.value" @click.native="handleFormChange(itemj.id,itemk.formName,itemk.itemType)">{{ items.label }}</el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</template> </template>
<template v-else-if="itemk.itemType == 'datepicker1' && itemk.showFlag !== '0'"> <template v-else-if="itemk.itemType == 'datepicker1' && itemk.showFlag !== '0'">
<el-date-picker v-model.trim="form[itemj.id][itemk.formName]" class="list_item_width_1" <el-date-picker v-model.trim="form[itemj.id][itemk.formName]" class="list_item_width_1"
type="date" size="small" clearable placeholder="选择日期" format="yyyy 年 MM 月 dd 日" type="date" size="small" clearable placeholder="选择日期" format="yyyy 年 MM 月 dd 日"
value-format="yyyy-MM-dd"> value-format="yyyy-MM-dd" @change="handleFormChange(itemj.id,itemk.formName,itemk.itemType)">
</el-date-picker> </el-date-picker>
</template> </template>
<template v-else-if="itemk.itemType == 'cascader1'"> <template v-else-if="itemk.itemType == 'cascader1'">
<el-cascader v-model="form[itemj.id].partyOrgId" :props="casProps" :options="itemk.opction" <el-cascader v-model="form[itemj.id].partyOrgId" :props="casProps"
class="list_item_width_1" clearable size="small" :options="itemk.opction" class="list_item_width_1" clearable size="small"
@change="handlePartyOrgCascadarChange"></el-cascader> @change="handlePartyOrgCascadarChange" @change.native="handleFormChange(itemj.id,itemk.formName,itemk.itemType)"></el-cascader>
</template> </template>
<template v-else-if="itemk.itemType == 'number'"> <template v-else-if="itemk.itemType == 'number'">
<el-input-number class="list_item_width_1" size="small" :min="1" :max="10" <el-input-number class="list_item_width_1" size="small" :min="1" :max="10"
v-model.trim="form[itemj.id][itemk.formName]"></el-input-number> v-model.trim="form[itemj.id][itemk.formName]"></el-input-number>
@ -78,6 +88,7 @@
<script> <script>
import { requestPost, requestGet } from "@/js/dai/request"; import { requestPost, requestGet } from "@/js/dai/request";
import nextTick from "dai-js/tools/nextTick";
export default { export default {
data() { data() {
@ -188,6 +199,9 @@ export default {
checkStrictly: true, checkStrictly: true,
multiple: false, multiple: false,
}, },
changId:null,
changPid:null,
changType:null
}; };
}, },
props: { props: {
@ -198,6 +212,13 @@ export default {
mounted() { mounted() {
}, },
methods: { methods: {
handleFormChange(pid,id,type){
this.changPid = pid;
this.changId = id;
this.changType = type;
nextTick(1000)
this.$emit('submitExpand', this.form,{changId:this.changId,changPid:this.changPid,changType:this.changType})
},
checkNumberInput(itemj, itemk) { checkNumberInput(itemj, itemk) {
if (this.form[itemj][itemk]) { if (this.form[itemj][itemk]) {
if (isNaN(this.form[itemj][itemk])) { if (isNaN(this.form[itemj][itemk])) {
@ -242,8 +263,6 @@ export default {
}).catch((error) => { }).catch((error) => {
console.error('Error fetching options:', error); console.error('Error fetching options:', error);
}); });
console.log(this.form, '子组件form');
console.log(this.formList, '子组件formList');
}) })
}, },
async getDictDataForm(url, params) { async getDictDataForm(url, params) {
@ -262,7 +281,8 @@ export default {
await this.getTreeChildenList(node, resolve) await this.getTreeChildenList(node, resolve)
}, },
async getTreeChildenList(node, resolve) { async getTreeChildenList(node, resolve) {
if (node.data.partyOrgLevel === 7) { console.log(node);
if (node.data.partyOrgLevel <= 8) {
resolve(null); resolve(null);
return; return;
} }
@ -298,14 +318,13 @@ export default {
console.log(error); console.log(error);
} }
}, },
}, },
components: {}, components: {},
computed: {}, computed: {},
watch: { watch: {
'form': { 'form': {
handler(newVal, oldVal) { handler(newVal, oldVal) {
this.$emit('submitExpand', this.form) this.$emit('submitExpand', this.form,{changId:this.changId,changPid:this.changPid,changType:this.changType})
}, },
deep: true, deep: true,
immediate: true immediate: true

2
src/views/modules/base/resi.vue

@ -302,7 +302,7 @@ export default {
// { columnName: "agencyName", label: "", width: 150 }, // { columnName: "agencyName", label: "", width: 150 },
{ columnName: "idTypeName", label: "证件类型", width: 80 }, { columnName: "idTypeName", label: "证件类型", width: 80 },
{ columnName: "idNum", label: "证件号", width: 170 }, { columnName: "idNum", label: "证件号", width: 170 },
{ columnName: "categoryNames", label: "居民分类" , width: 180}, { columnName: "categoryNames", label: "居民分类" },
{ columnName: "nationalityName", label: "国籍", width: 50 }, { columnName: "nationalityName", label: "国籍", width: 50 },
{ columnName: "nationName", label: "民族", width: 50 }, { columnName: "nationName", label: "民族", width: 50 },
{ columnName: "householdSituationName", label: "人户状况", width: 100 }, { columnName: "householdSituationName", label: "人户状况", width: 100 },

43
src/views/modules/portrayal/jumin/cpts/staffTag.vue

@ -8,18 +8,19 @@
<el-table-column prop="city" label="内容" min-width="70" align="left"> <el-table-column prop="city" label="内容" min-width="70" align="left">
<template slot-scope="scope"> <template slot-scope="scope">
<el-form-item v-if="scope.row.type == 'radio'"> <el-form-item v-if="scope.row.type == 'radio'">
<el-radio-group v-model="scope.row.value" v-for="(item, index) in scope.row.option" :key="index" <el-radio-group v-model="scope.row.value" v-for="(item, index) in scope.row.option"
@change="handeleClickRadio(item.value)"> :key="index" @change="handeleClickRadio(item.value)">
<el-radio :label="item.value" :disabled="formType == 'detail'"><span <el-radio :label="item.value" :disabled="formType == 'detail'"><span
style="margin-right: 50px;">{{ item.label style="margin-right: 50px;">{{ item.label
}}</span></el-radio> }}</span></el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item :prop="'tableData.' + scope.$index + '.value'" v-if="scope.row.type == 'checkbox'"> <el-form-item :prop="'tableData.' + scope.$index + '.value'"
v-if="scope.row.type == 'checkbox'">
<el-checkbox-group v-model="scope.row.value"> <el-checkbox-group v-model="scope.row.value">
<el-checkbox @change="handeleClickchckbox(item, $event, scope.$index)" <el-checkbox @change="handeleClickchckbox(item, $event, scope.$index)"
:disabled="formType == 'detail'" v-for="(item, index) in scope.row.option" :key="index" :disabled="formType == 'detail'" v-for="(item, index) in scope.row.option"
:label="item.value">{{ item.label :key="index" :label="item.value">{{ item.label
}}</el-checkbox> }}</el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</el-form-item> </el-form-item>
@ -42,7 +43,7 @@ export default {
{ {
index: 0, index: 0,
province: '政治面貌', province: '政治面貌',
value: '', value: 0,
type: 'radio', type: 'radio',
option: [ option: [
{ label: '群众', value: 0 }, { label: '群众', value: 0 },
@ -180,6 +181,7 @@ export default {
this.formData.tableData[0].value = this.userInfo.baseInfoDto.categoryInfo.partyFlag; this.formData.tableData[0].value = this.userInfo.baseInfoDto.categoryInfo.partyFlag;
//keyindex(formData.tableData) //keyindex(formData.tableData)
updateValue('disabilityFlag', 1); updateValue('disabilityFlag', 1);
updateValue('deathFlag', 1);
updateValue('seriousIllnessFlag', 1); updateValue('seriousIllnessFlag', 1);
updateValue('chronicDiseaseFlag', 1); updateValue('chronicDiseaseFlag', 1);
updateValue('emptyNesterFlag', 2); updateValue('emptyNesterFlag', 2);
@ -197,11 +199,38 @@ export default {
updateValue('publicWelfareFlag', 4); updateValue('publicWelfareFlag', 4);
}, },
handeleClickRadio(val) { handeleClickRadio(val) {
this.$emit('showDialog', { value: val === '1' ? 'parymemberInfoDto' : val }, val === 1) if (val === 1) {
this.$emit('showDialog', { value: val }, val === 1)
this.formData.tableData[0].value= 1
}else{
this.$confirm(`确认取消党员标签`, '确认信息', {
confirmButtonText: '确认取消',
cancelButtonText: '暂不取消',
type: 'warning'
}).then(() => {
this.$emit('showDialog', { value: val }, val === 1)
}).catch(() => {
this.formData.tableData[0].value= 1
});
}
}, },
handeleClickchckbox(item, event, index) { handeleClickchckbox(item, event, index) {
item.index = index item.index = index
if (event) {
this.$emit('showDialog', item, event)
} else {
this.$confirm(`确认取消${item.label}标签`, '确认信息', {
confirmButtonText: '确认取消',
cancelButtonText: '暂不取消',
type: 'warning'
}).then(() => {
this.$emit('showDialog', item, event) this.$emit('showDialog', item, event)
}).catch(() => {
this.formData.tableData[index].value.push(item.value)
});
}
} }
}, },
components: {}, components: {},

142
src/views/modules/portrayal/jumin/index.vue

@ -1,5 +1,5 @@
<template> <template>
<div class='g-main' v-loading="loading" v-if="showFlag"> <div class='g-main' v-loading="loading">
<div class="left"> <div class="left">
<div class="user"> <div class="user">
<img src="@/assets/images/index/nan.png" alt=""> <img src="@/assets/images/index/nan.png" alt="">
@ -26,20 +26,20 @@
</div> </div>
<div class="right"> <div class="right">
<div class="editBtn"> <div class="editBtn">
<el-button type="primary" size="small" @click="handelClickJumpEdit">编辑</el-button> <el-button class="diy-button--add" type="primary" size="small" @click.native="handelClickJumpEdit">编辑</el-button>
</div> </div>
<div class="title-small">基础信息</div> <div class="title-small">基础信息</div>
<el-row type="flex" justify="" class="f-m-top23"> <el-row type="flex" justify="" class="f-m-top23">
<el-col :span="6" class="f-flex"> <el-col :span="6" class="f-flex">
<div class="f-label "><b>国籍</b></div> <div class="f-label "><b>国籍</b></div>
<div class="f-left8 f-font-color"> <div class="f-left8 f-font-color">
{{ nationalityText }} {{ nationalityText() }}
</div> </div>
</el-col> </el-col>
<el-col :span="6" class="f-flex"> <el-col :span="6" class="f-flex">
<div class="f-label"><b>证件类型</b></div> <div class="f-label"><b>证件类型</b></div>
<div class="f-left8 f-font-color"> <div class="f-left8 f-font-color">
{{ idTypeText }} {{ idTypeText() }}
</div> </div>
</el-col> </el-col>
<el-col :span="6" class="f-flex"> <el-col :span="6" class="f-flex">
@ -90,7 +90,7 @@
</el-col> </el-col>
<el-col :span="6" class="f-flex"> <el-col :span="6" class="f-flex">
<div class="f-label">出生日期</div> <div class="f-label">出生日期</div>
<div class="f-left8 f-font-color">{{ resiDetailObj.baseInfoDto.birthday }}</div> <!-- <div class="f-left8 f-font-color">{{ resiDetailObj.baseInfoDto.birthday || '--'}}</div> -->
</el-col> </el-col>
<el-col :span="6" class="f-flex"> <el-col :span="6" class="f-flex">
<div class="f-label">民族</div> <div class="f-label">民族</div>
@ -105,19 +105,21 @@
resiDetailObj.eduInfoDto.cultureLevelName ? resiDetailObj.eduInfoDto.cultureLevelName ?
resiDetailObj.eduInfoDto.cultureLevelName : "--" }}</span> resiDetailObj.eduInfoDto.cultureLevelName : "--" }}</span>
</el-col> </el-col>
</el-row> </el-row>
<el-row type="flex" justify="" class="f-m-top23"> <el-row type="flex" justify="" class="f-m-top23">
<el-col :span="6" class="f-flex"> <el-col :span="6" class="f-flex">
<div class="f-flex "> <div class="f-flex ">
<div class="f-label">婚姻状况</div> <div class="f-label">婚姻状况</div>
<span class="f-left8 f-font-color">{{ categoryDictText }}</span> <span class="f-left8 f-font-color" v-if="resiDetailObj.familyInfoDto">
{{ categoryDictText() }}</span>
<span v-else> -- </span>
</div> </div>
</el-col> </el-col>
<el-col :span="6" class="f-flex"> <el-col :span="6" class="f-flex">
<div class="f-flex "> <div class="f-flex ">
<div class="f-label">配偶情况</div> <div class="f-label">配偶情况</div>
<span class="f-left8 f-font-color">{{ spouseText }}</span> <span class="f-left8 f-font-color" v-if="resiDetailObj.familyInfoDto">{{ spouseText() }}</span>
<span v-else> -- </span>
</div> </div>
</el-col> </el-col>
<el-col :span="6" class="f-flex"> <el-col :span="6" class="f-flex">
@ -218,9 +220,9 @@
</el-col> </el-col>
<el-col :span="6" class="f-flex"> <el-col :span="6" class="f-flex">
<div class="f-label"><b>就业状态:</b></div> <div class="f-label"><b>就业状态:</b></div>
<div class="f-left8 f-font-color"> <span class="f-left8 f-font-color" v-if="resiDetailObj.workInfoDto">
{{ careerStatusText }} {{ careerStatusText() }}
</div> </span>
</el-col> </el-col>
<el-col :span="6" class="f-flex"> <el-col :span="6" class="f-flex">
<div class="f-label">工作单位:</div> <div class="f-label">工作单位:</div>
@ -324,7 +326,6 @@ export default {
loading: true, loading: true,
checkType: 'edit',//editview checkType: 'edit',//editview
changeRecordList: [],// changeRecordList: [],//
showFlag: true,
resiDetailObj: {},// resiDetailObj: {},//
showFlagIdCardBtn: true, showFlagIdCardBtn: true,
showFlagMobileBtn: true, showFlagMobileBtn: true,
@ -818,7 +819,6 @@ export default {
.get(`/actual/base/residentIntegratedInfo/detail/masked/${this.resiId}`) .get(`/actual/base/residentIntegratedInfo/detail/masked/${this.resiId}`)
.then(async (res) => { .then(async (res) => {
if (res.data.code === 0) { if (res.data.code === 0) {
this.showFlag = true;
this.resiDetailObj = res.data.data || {}; this.resiDetailObj = res.data.data || {};
const nameMap = { const nameMap = {
ext: '拓展信息', ext: '拓展信息',
@ -879,21 +879,16 @@ export default {
this.score = res.data.data.integrityData.score; this.score = res.data.data.integrityData.score;
const birthdayTimestamp = Date.parse(res.data.data.baseInfoDto.birthday); const birthdayTimestamp = Date.parse(res.data.data.baseInfoDto.birthday);
this.age = this.calculateAge(birthdayTimestamp); this.age = this.calculateAge(birthdayTimestamp);
this.nationalityList.forEach(element => {
if (element.value === res.data.data.nationality) {
this.resiDetailObj.baseInfoDto.nationalityName = element.label;
}
});
} else if (res.data.code >= 8000) { } else if (res.data.code >= 8000) {
this.resiDetailObj = {}; this.resiDetailObj = {};
this.showFlag = false
this.$message.error(res.data.msg); this.$message.error(res.data.msg);
} }
}) })
.catch((err) => { .catch((err) => {
this.loading = false;
console.log(err); console.log(err);
}); });
this.loading = false;
}, },
handelClickJumpEdit() { handelClickJumpEdit() {
this.checkType = 'edit'; this.checkType = 'edit';
@ -905,15 +900,21 @@ export default {
const { data } = await this.$http.post(url, params); const { data } = await this.$http.post(url, params);
const dictData = data.data; const dictData = data.data;
if (itemType == 'checkbox') { if (itemType == 'checkbox') {
const matchedItem = dictData.find(item => value.includes(item.value.toString())); const matchedLabels = value.map(item => {
return matchedItem ? matchedItem.label : '--'; const matchedItems = dictData.filter(obj => obj.value === item);
if (matchedItems.length > 0) {
return matchedItems.map(matchedItem => matchedItem.label).join(',');
} else {
return "";
}
}).join(',');
return matchedLabels ? matchedLabels : '--';
} else if (itemType == 'select1') { } else if (itemType == 'select1') {
const matchedItem = dictData.find(item => item.value === value); const matchedItem = dictData.find(item => item.value === value);
return matchedItem ? matchedItem.label : '--'; return matchedItem ? matchedItem.label : '--';
} }
} else { } else {
if (itemType == 'radio1') { if (itemType == 'radio1') {
console.log(opction, value, '单元中心户');
const matchedItem = opction.find(item => item.value === value) const matchedItem = opction.find(item => item.value === value)
return matchedItem ? matchedItem.label : '--'; return matchedItem ? matchedItem.label : '--';
} else if (itemType == 'input1' || itemType == "datepicker1" || itemType == 'cascader1') { } else if (itemType == 'input1' || itemType == "datepicker1" || itemType == 'cascader1') {
@ -959,7 +960,51 @@ export default {
} }
this.tuominType = type; this.tuominType = type;
}, },
nationalityText() {
let text = "--";
this.nationalityList.forEach((item) => {
if (item.value == this.resiDetailObj.baseInfoDto.nationality) {
text = item.label;
}
});
return text;
},
categoryDictText() {
let text = "--";
this.marriageArr.forEach((item) => {
if (item.value == this.resiDetailObj.familyInfoDto.marriage) {
text = item.label;
}
});
return text;
},
spouseText() {
let text = "--";
this.spouseArr.forEach((item) => {
if (item.value == this.resiDetailObj.familyInfoDto.spouseSituation) {
text = item.label;
}
});
return text;
},
careerStatusText() {
let text = "--";
this.careerStatusArr.forEach((item) => {
if (item.value == this.resiDetailObj.workInfoDto.careerStatus) {
text = item.label;
}
});
return text;
},
idTypeText() {
let text = "--";
this.idTypeList.forEach((item) => {
if (item.value == this.resiDetailObj.baseInfoDto.idType) {
text = item.label;
}
});
return text;
},
handelClickCheckPassword() { handelClickCheckPassword() {
this.$refs.form.validate(vali => { this.$refs.form.validate(vali => {
if (vali) { if (vali) {
@ -1070,54 +1115,7 @@ export default {
return text; return text;
} }
}, },
computed: { computed: {},
categoryDictText() {
let text = "--";
this.marriageArr.forEach((item) => {
if (item.value == this.resiDetailObj.familyInfoDto.marriage) {
text = item.label;
}
});
return text;
},
spouseText() {
let text = "--";
this.spouseArr.forEach((item) => {
if (item.value == this.resiDetailObj.familyInfoDto.spouseSituation) {
text = item.label;
}
});
return text;
},
nationalityText() {
let text = "--";
this.nationalityList.forEach((item) => {
if (item.value == this.resiDetailObj.baseInfoDto.nationality) {
text = item.label;
}
});
return text;
},
idTypeText() {
let text = "--";
this.idTypeList.forEach((item) => {
if (item.value == this.resiDetailObj.baseInfoDto.idType) {
text = item.label;
}
});
return text;
},
careerStatusText() {
let text = "--";
this.careerStatusArr.forEach((item) => {
if (item.value == this.resiDetailObj.workInfoDto.careerStatus) {
text = item.label;
}
});
return text;
}
},
watch: { watch: {
'$store.state.huaXiang.userInfo.resiId': { '$store.state.huaXiang.userInfo.resiId': {
handler(newValue, oldValue) { handler(newValue, oldValue) {

Loading…
Cancel
Save