Commit 22db6457 authored by 郭志伟's avatar 郭志伟

fix: 定寿险下单问题修复

parent 44d4bd78
...@@ -39,7 +39,7 @@ export default { ...@@ -39,7 +39,7 @@ export default {
}, },
watch: { watch: {
value(val) { value(val) {
this.radioVal = val; this.radioVal = val || "";
this.$emit(CHANGE_EVENT, val); this.$emit(CHANGE_EVENT, val);
}, },
radioVal(val) { radioVal(val) {
......
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
</template> </template>
</cr-field> </cr-field>
<cr-field <cr-field
v-if="formData.insuredUserInfo.longTerm === '1'" v-if="showHolderTermOption"
v-model="formData.holderUserInfo.validEnd" v-model="formData.holderUserInfo.validEnd"
name="holderUserInfo_validEnd" name="holderUserInfo_validEnd"
label="有效期至" label="有效期至"
...@@ -244,7 +244,7 @@ ...@@ -244,7 +244,7 @@
</template> </template>
</cr-field> </cr-field>
<cr-field <cr-field
v-if="formData.insuredUserInfo.longTerm === '1'" v-if="showHolderTermOption"
v-model="formData.insuredUserInfo.validEnd" v-model="formData.insuredUserInfo.validEnd"
name="insuredUserInfo_validEnd" name="insuredUserInfo_validEnd"
label="有效期至" label="有效期至"
...@@ -281,7 +281,7 @@ ...@@ -281,7 +281,7 @@
</template> </template>
</cr-field> </cr-field>
<cr-field <cr-field
v-model="formData.payPeriod" v-model="formData.productItem.payType"
name="payPeriod" name="payPeriod"
label="交费方式" label="交费方式"
:rules="[{ required: true, message: '请选择交费方式' }]" :rules="[{ required: true, message: '请选择交费方式' }]"
...@@ -401,12 +401,16 @@ export default { ...@@ -401,12 +401,16 @@ export default {
policyFormData: JSON.parse(sessionStorage.getItem("policyFormData") || "{}"), policyFormData: JSON.parse(sessionStorage.getItem("policyFormData") || "{}"),
formData: { formData: {
insuredUserInfo: { insuredUserInfo: {
relation: "" relation: "",
longTerm: "2"
},
holderUserInfo: {
longTerm: "2"
}, },
holderUserInfo: {},
productItem: { productItem: {
insuredAmount: "500000" insuredAmount: "500000"
} },
payPeriod: "1"
}, },
subFromData: {}, subFromData: {},
familyList: [], familyList: [],
...@@ -481,6 +485,12 @@ export default { ...@@ -481,6 +485,12 @@ export default {
const { relation } = this.formData.insuredUserInfo; const { relation } = this.formData.insuredUserInfo;
const { selfInfoReadonly, infoReadonly } = this; const { selfInfoReadonly, infoReadonly } = this;
return (relation === "1" && selfInfoReadonly) || (relation !== "1" && infoReadonly); return (relation === "1" && selfInfoReadonly) || (relation !== "1" && infoReadonly);
},
showHolderTermOption() {
return this.formData.holderUserInfo.longTerm === "1";
},
showTermOption() {
return this.formData.insuredUserInfo.longTerm === "1";
} }
}, },
mounted() { mounted() {
...@@ -505,21 +515,23 @@ export default { ...@@ -505,21 +515,23 @@ export default {
}, },
nextStep() { nextStep() {
this.subFromData = JSON.parse(JSON.stringify(this.formData)); this.subFromData = JSON.parse(JSON.stringify(this.formData));
this.subFromData.insuredUserInfo.socialSecurity = const { socialSecurity, longTerm } = this.subFromData.insuredUserInfo;
this.subFromData.insuredUserInfo.socialSecurity === "1" ? true : false; const { longTerm: holderLongTerm } = this.subFromData.holderUserInfo;
this.subFromData.insuredUserInfo.longTerm = this.subFromData.insuredUserInfo.socialSecurity = socialSecurity === "1" ? true : false;
this.subFromData.insuredUserInfo.longTerm === "2" ? true : false; this.subFromData.insuredUserInfo.longTerm = longTerm === "2" ? true : false;
this.subFromData.holderUserInfo.longTerm = this.subFromData.holderUserInfo.longTerm = holderLongTerm === "2" ? true : false;
this.subFromData.holderUserInfo.longTerm === "2" ? true : false;
this.generateOrder(); this.generateOrder();
}, },
relationChange(relation = this.formData.insuredUserInfo.relation) { relationChange(relation = this.formData.insuredUserInfo.relation) {
this.formData.insuredUserInfo = {
relation
};
this.familyList.forEach(item => { this.familyList.forEach(item => {
const { relation, nameMask: name, idNoMask: idNo, userInfoSecId, socialSecurity } = item; const { relation, nameMask: name, idNoMask: idNo, userInfoSecId } = item;
if (+relation === 1) { if (+relation === 1) {
this.formData.holderUserInfo = { this.formData.holderUserInfo = {
...this.formData.holderUserInfo, ...this.formData.holderUserInfo,
...{ name, idNo, userInfoSecId, socialSecurity: socialSecurity ? "1" : "0" } ...{ name, idNo, userInfoSecId }
}; };
this.selfInfoReadonly = true; this.selfInfoReadonly = true;
} }
...@@ -527,12 +539,15 @@ export default { ...@@ -527,12 +539,15 @@ export default {
const userArray = this.familyList.filter( const userArray = this.familyList.filter(
item => item.relation === +relation && item.relation !== 1 item => item.relation === +relation && item.relation !== 1
); );
let [name, idNo, userInfoSecId, socialSecurity] = ["", "", "", "0"]; let [name, idNo, userInfoSecId, socialSecurity] = [undefined, undefined, undefined, ""];
if (userArray.length) { if (userArray.length) {
let { nameMask, idNoMask, userInfoSecId: id, socialSecurity: ss } = userArray[0]; let { nameMask, idNoMask, userInfoSecId: id, socialSecurity: ss } = userArray[0];
[name, idNo, userInfoSecId, socialSecurity] = [nameMask, idNoMask, id, ss]; [name, idNo, userInfoSecId, socialSecurity] = [nameMask, idNoMask, id, ss];
this.infoReadonly = true; this.infoReadonly = true;
} else { } else {
if (relation === "1") {
userInfoSecId = this.formData.holderUserInfo.userInfoSecId;
}
this.infoReadonly = false; this.infoReadonly = false;
} }
this.formData.insuredUserInfo = { this.formData.insuredUserInfo = {
...@@ -599,10 +614,13 @@ export default { ...@@ -599,10 +614,13 @@ export default {
payType payType
} = this.formData.productItem; } = this.formData.productItem;
let idNo = ""; let idNo = "";
let userInfoSecId = undefined;
const { socialSecurity } = this.formData.insuredUserInfo; const { socialSecurity } = this.formData.insuredUserInfo;
if (this.formData.insuredUserInfo.relation !== "1") { if (this.formData.insuredUserInfo.relation !== "1") {
userInfoSecId = this.formData.insuredUserInfo.userInfoSecId;
idNo = this.formData.insuredUserInfo.idNo; idNo = this.formData.insuredUserInfo.idNo;
} else { } else {
userInfoSecId = this.formData.holderUserInfo.userInfoSecId;
idNo = this.formData.holderUserInfo.idNo; idNo = this.formData.holderUserInfo.idNo;
} }
if (!amountInsured || !policyPeriod || !payPeriod || !payType || !idNo || !socialSecurity) if (!amountInsured || !policyPeriod || !payPeriod || !payType || !idNo || !socialSecurity)
...@@ -612,6 +630,7 @@ export default { ...@@ -612,6 +630,7 @@ export default {
productUserInfo: { productUserInfo: {
userInfo: { userInfo: {
idNo, idNo,
userInfoSecId,
socialSecurity: socialSecurity === "1" ? true : false socialSecurity: socialSecurity === "1" ? true : false
}, },
productItem: { productItem: {
......
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