|
|
@ -44,7 +44,7 @@ |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<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" |
|
|
|
class="list_item_width_1" clearable> |
|
|
|
<el-option v-for="(item, index) in genderList" :key="index" :label="item.label" |
|
|
@ -53,7 +53,7 @@ |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<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" |
|
|
|
type="date" size="small" clearable placeholder="选择日期" format="yyyy 年 MM 月 dd 日" |
|
|
|
value-format="yyyy-MM-dd"> |
|
|
@ -91,7 +91,7 @@ |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<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-select v-model="form.familyInfoDto.spouseSituation" placeholder="请选择" size="small" |
|
|
|
class="list_item_width_1" clearable> |
|
|
@ -404,9 +404,8 @@ |
|
|
|
<el-row style="margin:24px"> |
|
|
|
<el-col :span="24" align="center"> |
|
|
|
<el-button size="small" class="diy-button--white" @click="handlerCancle" plain>取消</el-button> |
|
|
|
<el-button type="primary" size="small" :loading="btnLoading" |
|
|
|
@click="handleClickSubmit">保存</el-button> |
|
|
|
<el-button type="primary" size="small" :loading="btnLoading" |
|
|
|
<el-button type="primary" size="small" @click="handleClickSubmit">保存</el-button> |
|
|
|
<el-button type="primary" size="small" |
|
|
|
@click="handleClickSubmit('house')">提交并补充家庭人员信息</el-button> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
@ -428,6 +427,8 @@ export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
loading: true, |
|
|
|
|
|
|
|
houseType: true, |
|
|
|
formList: [], |
|
|
|
orgOptions: [], |
|
|
|
orgOptionProps: { |
|
|
@ -926,7 +927,7 @@ export default { |
|
|
|
id: 'specialSupportDto', |
|
|
|
children: [ |
|
|
|
|
|
|
|
{//0 |
|
|
|
{ |
|
|
|
label: "特扶类别", |
|
|
|
itemType: "select1", |
|
|
|
formName: "specialSupportType", |
|
|
@ -1057,7 +1058,6 @@ export default { |
|
|
|
await this.getDicts() |
|
|
|
await this.getOrgTreeList() |
|
|
|
await this.getResiDetail() |
|
|
|
this.loading = false; |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
getResiDetail() { |
|
|
@ -1079,6 +1079,37 @@ export default { |
|
|
|
|
|
|
|
this.form.baseInfoDto.idNum = this.$route.params.idNum; |
|
|
|
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) { |
|
|
|
if (this.form.baseInfoDto.categoryInfo[key] === 1 && this.incidence[key] || (this.form.baseInfoDto.categoryInfo.partyFlag == 1 && key === 'partyFlag')) { |
|
|
|
const formId = key === 'partyFlag' ? 'parymemberInfoDto' : key; |
|
|
@ -1099,6 +1130,7 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
console.log(this.footerInputList); |
|
|
|
return Promise.all(promises); |
|
|
|
} else if (res.data.code >= 8000) { |
|
|
|
this.$message.error(res.data.msg); |
|
|
@ -1109,6 +1141,8 @@ export default { |
|
|
|
.catch((err) => { |
|
|
|
console.log(err); |
|
|
|
}); |
|
|
|
this.loading = false; |
|
|
|
|
|
|
|
}, |
|
|
|
async getDicts() { |
|
|
|
try { |
|
|
@ -1396,13 +1430,13 @@ export default { |
|
|
|
}, |
|
|
|
async submitForm(house) { |
|
|
|
try { |
|
|
|
let url = '/actual/base/residentBaseInfo/update' |
|
|
|
let url = this.houseType ? '/actual/base/residentBaseInfo/update' : '/actual/base/residentBaseInfo/save'; |
|
|
|
let parm = { |
|
|
|
...this.form |
|
|
|
} |
|
|
|
let { code, data, msg } = await requestPost(url, parm) |
|
|
|
if (code == 0) { |
|
|
|
if (house!= 'house') { |
|
|
|
if (house != 'house') { |
|
|
|
this.$message.success('保存成功'); |
|
|
|
this.$refs['editForm'].resetFields(); |
|
|
|
this.handlerCancle(); |
|
|
@ -1410,10 +1444,12 @@ export default { |
|
|
|
this.$message.success('保存成功'); |
|
|
|
let homeArr = JSON.parse(JSON.stringify(this.form.resideInfoDtos)); |
|
|
|
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); |
|
|
|
} |
|
|
|
} |
|
|
@ -1421,57 +1457,105 @@ export default { |
|
|
|
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) { |
|
|
|
console.log(value); |
|
|
|
if (value == 1) { |
|
|
|
value = 'parymemberInfoDto' |
|
|
|
this.form.baseInfoDto.categoryInfo.partyFlag = 1; |
|
|
|
} else if (value == 0) { |
|
|
|
this.form.baseInfoDto.categoryInfo.partyFlag = 0; |
|
|
|
this.form.parymemberInfoDto = null |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs['resiExpand'].formList = this.$refs['resiExpand'].formList.filter(item => item.formId !== 'parymemberInfoDto'); |
|
|
|
}) |
|
|
|
// 设置 partyFlag |
|
|
|
if (value === 1 || value === 0 || value === 2) { |
|
|
|
this.form.baseInfoDto.categoryInfo.partyFlag = value; |
|
|
|
value = value === 1 ? 'parymemberInfoDto' : value; |
|
|
|
if (value === 0 || value === 2) { |
|
|
|
this.form.parymemberInfoDto = null; |
|
|
|
this.footerInputList.forEach(item => { |
|
|
|
if (item.id === '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.$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; |
|
|
|
} else if (index == 3) { |
|
|
|
} else if (index === 3) { |
|
|
|
if (event) { |
|
|
|
this.form.baseInfoDto.categoryInfo.specialCrowdFlag = 1; |
|
|
|
this.form.specialDto.specialCategoryCodes.push(value); |
|
|
|
} 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 (event) { |
|
|
|
this.$nextTick(() => { |
|
|
|
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'].showForm() |
|
|
|
this.$refs['resiExpand'].showForm(); |
|
|
|
}); |
|
|
|
} else { |
|
|
|
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) { |
|
|
|
this.form = { ...this.form, ..._form }; |
|
|
|
// console.log(this.form, '父组件提交'); |
|
|
|
submitExpand(_form, { changId, changPid, changType }) { |
|
|
|
if (changType == 'checkbox') { |
|
|
|
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 }, |
|
|
|