Commit 55650228 authored by 郭志伟's avatar 郭志伟

Merge branch 'fix/policy_fix' into 'master'

Fix/policy fix

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