Commit 9fac1871 authored by 郭志伟's avatar 郭志伟

fix: 未登录填写关系人信息重复添加问题

parent 65ebd718
......@@ -442,11 +442,31 @@ export default {
this.familyList = res;
if (this.hasAutoSaveData(this.autoSaveKey) && !reset) {
this.getSaveInfoHandler(this.autoSaveKey, AUTO_SAVE_TARGET);
if (this.formData.relation) {
const userArray = this.familyList.filter(
item => item.relation === +this.formData.relation
);
const { idNo, userInfoSecId, relation } = this.formData;
if (relation) {
const userArray = this.familyList.filter(item => item.relation === +relation);
this.relationList = userArray.length > 1 ? userArray : [];
if (idNo && !userInfoSecId) {
this.familyList.forEach(item => {
if (item.idNo === idNo) {
const { idNoMask, nameMask, socialSecurity, userInfoSecId } = item;
this.formData = {
...this.formData,
...{
idNo: idNoMask,
name: nameMask,
userInfoSecId,
socialSecurity:
typeof socialSecurity === undefined || socialSecurity === ""
? ""
: socialSecurity
? "1"
: "0"
}
};
}
});
}
} else {
this.formData.relation = "1";
}
......
......@@ -997,11 +997,31 @@ export default {
this.familyList = res;
if (this.hasAutoSaveData(AUTO_SAVE_KEY)) {
this.getSaveInfoHandler(AUTO_SAVE_KEY, AUTO_SAVE_TARGET);
if (this.formData.insuredUserInfo.relation) {
const userArray = this.familyList.filter(
item => item.relation === +this.formData.insuredUserInfo.relation
);
const { relation, idNo, userInfoSecId } = this.formData.insuredUserInfo;
if (relation) {
const userArray = this.familyList.filter(item => item.relation === +relation);
this.relationList = userArray.length > 1 ? userArray : [];
if (idNo && !userInfoSecId) {
this.familyList.forEach(item => {
if (item.idNo === idNo) {
const { idNoMask, nameMask, socialSecurity, userInfoSecId } = item;
this.formData.insuredUserInfo = {
...this.formData.insuredUserInfo,
...{
idNo: idNoMask,
name: nameMask,
userInfoSecId,
socialSecurity:
typeof socialSecurity === undefined || socialSecurity === ""
? ""
: socialSecurity
? "1"
: "0"
}
};
}
});
}
}
if (!this.formData.holderUserInfo.name) {
const selfInfo = this.familyList.find(item => item.relation === 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment