Commit 11a63104 authored by 郭志伟's avatar 郭志伟

Merge branch 'fix/policy_fix' into 'master'

fix: 华贵保单填写回显; #MANGO-27; #MANGO-41;#MANGO-47;#MANGO-48

See merge request !53
parents dbb1e9d7 dc2ce9ec
......@@ -13,7 +13,7 @@ export default {
avator: "",
serveNum: "-",
rate: "-%",
tel: "13888888888",
tel: "16710080673",
date: "9:00 ~ 21:00"
}
};
......@@ -20,10 +20,6 @@
<script>
import popupPickerMixin from "../mixins/popupPicker.mixin.js";
import { parseTime } from "@/service/utils";
const CURRENT_TIME = new Date();
const CURRENT_YEAR = CURRENT_TIME.getFullYear();
// const START_YEAR = 1949;
const END_YEAR = CURRENT_YEAR;
export default {
name: "PopupDatePicker",
mixins: [popupPickerMixin],
......@@ -34,27 +30,44 @@ export default {
return 100;
}
},
needInit: {
type: Boolean,
default: true
},
later: {
type: Number,
default() {
return END_YEAR - CURRENT_YEAR;
return 60;
}
}
},
data() {
return {
refName: "datepicker",
initVal: parseTime("", "{y}-{m}-{d}")
initVal: ""
};
},
watch: {
value(val) {
value: {
immediate: true,
handler(val) {
if (val) {
this.initVal = val;
this.handleResult(val);
}
}
},
needInit: {
immediate: true,
handler(val) {
if (!val) {
this.initVal = "";
} else {
this.initVal = parseTime("", "{y}-{m}-{d}");
}
}
}
},
methods: {
handleResult(res) {
......
......@@ -23,6 +23,14 @@ import popupPickerMixin from "../mixins/popupPicker.mixin.js";
export default {
name: "PopupPicker",
mixins: [popupPickerMixin],
watch: {
value(val) {
if (val) {
this.setDefaultVal();
this.handleResult([this.pickerData.find(item => item.value === this.value)]);
}
}
},
methods: {
handleResult(res) {
this.pickerValShow = res[0].title;
......@@ -31,7 +39,10 @@ export default {
setDefaultVal() {
setTimeout(() => {
const $picker = this.$refs.picker;
$picker.setColumnIndex(0, this.pickerData.indexOf(this.value));
$picker.setColumnIndex(
0,
this.pickerData.findIndex(item => item.value === this.value)
);
});
}
}
......
......@@ -2,7 +2,7 @@
* @Description: PopupPicker mixin
* @Date: 2020-07-28 19:46:31
* @LastEditors: gzw
* @LastEditTime: 2020-08-17 16:52:26
* @LastEditTime: 2020-08-19 18:08:05
*/
// TODO 默认值需要处理
......@@ -34,9 +34,11 @@ export default {
watch: {
show(val) {
if (val && !this.refreshed && this.$refs[this.refName]) {
setTimeout(() => {
this.refreshed = true;
this.$refs[this.refName].refreshColumns();
this.setDefaultVal();
}, 500);
}
}
// value: {
......
......@@ -165,9 +165,13 @@ export default {
if (this.calTimer) {
clearTimeout(this.calTimer);
}
const { idNo, amountInsured } = val;
const { idNo: oldidNo, amountInsured: oldamountInsured } = oldVal;
if (!isIdNo(idNo) && idNo === oldidNo && amountInsured === oldamountInsured) return;
const { idNo, amountInsured, relation, selfIdNo } = val;
const { idNo: oldidNo, amountInsured: oldamountInsured, selfIdNo: oldselfIdNo } = oldVal;
let idNoWho = !relation || relation === "1" ? selfIdNo : idNo;
let oldidNoWho = !relation || relation === "1" ? oldselfIdNo : oldidNo;
if (!isIdNo(idNoWho) && idNoWho === oldidNoWho && amountInsured === oldamountInsured) {
return;
}
this.calTimer = setTimeout(() => {
this.calFee();
}, 1000);
......@@ -297,13 +301,14 @@ export default {
},
async calFee() {
let { price } = this.headerInfo;
const { idNo, amountInsured, userInfoSecId } = this.formData;
if (!idNo || !amountInsured) return;
const { idNo, selfIdNo, relation, amountInsured, userInfoSecId } = this.formData;
let idNoWho = !relation || relation === "1" ? selfIdNo : idNo;
if (!idNoWho || !amountInsured) return;
const _param = {
productNo: this.goodId,
productUserInfo: {
insuredUserInfo: {
idNo,
idNo: idNoWho,
userInfoSecId: userInfoSecId ? userInfoSecId : undefined
},
productItem: {
......
......@@ -138,7 +138,7 @@ export default {
name: "",
idNo: "",
relation: "",
payType: "",
payType: "2",
amountInsured: "300000",
autoRenewPolicy: false,
read: true
......@@ -168,8 +168,22 @@ export default {
if (this.calTimer) {
clearTimeout(this.calTimer);
}
const { idNo, payType, amountInsured } = val;
const { idNo: oldidNo, payType: oldpayType, amountInsured: oldamountInsured } = oldVal;
const { idNo, payType, amountInsured, relation, selfIdNo } = val;
const {
idNo: oldidNo,
payType: oldpayType,
amountInsured: oldamountInsured,
selfIdNo: oldselfIdNo
} = oldVal;
let idNoWho = !relation || relation === "1" ? selfIdNo : idNo;
let oldidNoWho = !relation || relation === "1" ? oldselfIdNo : oldidNo;
if (!relation && relation === "1") {
idNoWho = selfIdNo;
oldidNoWho = oldselfIdNo;
} else {
idNoWho = idNo;
oldidNoWho = oldidNo;
}
if (this.goInsureState) {
sessionStorage.setItem(
"policyFormData",
......@@ -177,8 +191,8 @@ export default {
);
}
if (
!isIdNo(idNo) &&
idNo === oldidNo &&
!isIdNo(idNoWho) &&
idNoWho === oldidNoWho &&
payType === oldpayType &&
amountInsured === oldamountInsured
)
......@@ -275,18 +289,27 @@ export default {
},
async calFee() {
let { price, subPrice } = this.headerInfo;
const { idNo, socialSecurity, payType, amountInsured, userInfoSecId } = this.formData;
if (!idNo) return;
const {
idNo,
socialSecurity,
relation,
selfIdNo,
payType,
amountInsured,
userInfoSecId
} = this.formData;
let idNoWho = !relation || relation === "1" ? selfIdNo : idNo;
if (!idNoWho || !socialSecurity || !payType) return;
const _param = {
productNo: this.goodId,
productUserInfo: {
insuredUserInfo: {
idNo,
socialSecurity: socialSecurity ? !!Number(socialSecurity) : true,
socialSecurity: socialSecurity ? !!Number(socialSecurity) : undefined,
userInfoSecId: userInfoSecId ? userInfoSecId : undefined
},
productItem: {
payType: payType || "2",
payType: payType || undefined,
amountInsured
}
}
......
......@@ -222,6 +222,7 @@ export default {
},
onSubmit() {
this.showLoginPopup();
this.popupShow = false;
},
onFailed(errorInfo) {
const { errors } = errorInfo;
......
......@@ -140,7 +140,7 @@ export default {
idNo: "",
socialSecurity: "",
relation: "",
payType: "",
payType: "2",
planValue: "3",
autoRenewPolicy: false,
read: true
......@@ -171,9 +171,11 @@ export default {
if (this.calTimer) {
clearTimeout(this.calTimer);
}
const { idNo } = val;
const { idNo: oldidNo } = oldVal;
if (!isIdNo(idNo) && idNo === oldidNo) return;
const { idNo, relation, selfIdNo } = val;
const { idNo: oldidNo, selfIdNo: oldselfIdNo } = oldVal;
let idNoWho = !relation || relation === "1" ? selfIdNo : idNo;
let oldidNoWho = !relation || relation === "1" ? oldselfIdNo : oldidNo;
if (!isIdNo(idNoWho) && idNoWho === oldidNoWho) return;
this.calTimer = setTimeout(() => {
this.calFee();
}, 1000);
......@@ -301,19 +303,20 @@ export default {
},
async calFee() {
let { price, subPrice } = this.headerInfo;
const { idNo, socialSecurity, payType, userInfoSecId } = this.formData;
if (!idNo) return;
const { idNo, socialSecurity, payType, userInfoSecId, relation, selfIdNo } = this.formData;
let idNoWho = !relation || relation === "1" ? selfIdNo : idNo;
if (!idNoWho || !payType || !socialSecurity) return;
const _param = {
productNo: this.goodId,
productUserInfo: {
insuredUserInfo: {
idNo,
socialSecurity: socialSecurity ? !!Number(socialSecurity) : true,
socialSecurity: socialSecurity ? !!Number(socialSecurity) : undefined,
userInfoSecId: userInfoSecId ? userInfoSecId : undefined
},
productItem: {
payType: payType || "2",
socialSecurity: socialSecurity ? !!Number(socialSecurity) : true
payType: payType || undefined,
socialSecurity: socialSecurity ? !!Number(socialSecurity) : undefined
}
}
};
......
......@@ -111,6 +111,8 @@
<template #input>
<popup-date-picker
v-model="formData.holderUserInfo.validEnd"
:before="0"
:later="100"
placeholder="请选择您的证件有效止期"
/>
</template>
......@@ -125,7 +127,7 @@
<template #input>
<cr-radio-btn
v-model="formData.insuredUserInfo.relation"
@input="relationChange"
@input="relationOptionChange"
:radio-data="insuredOptions"
/>
</template>
......@@ -253,6 +255,8 @@
<template #input>
<popup-date-picker
v-model="formData.insuredUserInfo.validEnd"
:before="0"
:later="100"
placeholder="请选择您的证件有效止期"
/>
</template>
......@@ -424,6 +428,7 @@ export default {
popupArray,
headerInfo,
calTimer: null,
clearInsured: false,
goInsureState: false,
popupShow: false,
currentPupopIndex: null,
......@@ -440,7 +445,8 @@ export default {
longTerm: "1"
},
productItem: {
amountInsured: "500000"
amountInsured: "500000",
payType: "1"
},
payPeriod: "1"
},
......@@ -489,18 +495,26 @@ export default {
clearTimeout(this.calTimer);
}
const { relation, idNo } = val.insuredUserInfo;
const { amountInsured, policyPeriod, payPeriod, payType } = val.productItem;
const { idNo: oldIdNo } = oldVal.insuredUserInfo;
if (relation === "1") {
const { idNo: holderIdNo } = val.holderUserInfo;
const { idNo: oldHolderIdNo } = oldVal.holderUserInfo;
if (!isIdNo(holderIdNo) || holderIdNo === oldHolderIdNo) {
return;
}
} else {
if (!isIdNo(idNo) || idNo === oldIdNo) {
const {
amountInsured: oldamountInsured,
policyPeriod: oldpolicyPeriod,
payPeriod: oldpayPeriod,
payType: oldpayType
} = val.productItem;
let idNoWho = !relation || relation === "1" ? val.holderUserInfo.idNo : idNo;
let oldidNoWho = !relation || relation === "1" ? oldVal.holderUserInfo.idNo : oldIdNo;
if (
!isIdNo(idNoWho) ||
(idNoWho === oldidNoWho &&
amountInsured === oldamountInsured &&
policyPeriod === oldpolicyPeriod &&
payPeriod === oldpayPeriod &&
payType === oldpayType)
)
return;
}
}
this.calTimer = setTimeout(() => {
this.calFee();
}, 1000);
......@@ -571,11 +585,19 @@ export default {
}
this.generateOrder();
},
relationChange(relation = this.formData.insuredUserInfo.relation) {
relationOptionChange(relation) {
this.relationChange(relation, this.clearInsured);
setTimeout(() => {
this.clearInsured = true;
}, 1000);
},
relationChange(relation = this.formData.insuredUserInfo.relation, clear = false) {
if (clear) {
this.formData.insuredUserInfo = {
relation,
longTerm: "1"
};
}
this.familyList.forEach(item => {
const { relation, nameMask: name, idNoMask: idNo, userInfoSecId } = item;
if (+relation === 1) {
......@@ -658,22 +680,27 @@ export default {
if (queryId) {
relation = this.familyList.filter(item => item.userInfoSecId === queryId)[0].relation;
}
(this.showAuthXyqb || this.mongoToken) && this.relationChange(relation);
(this.showAuthXyqb || this.mongoToken) && this.relationChange(relation, false);
}
}
},
async calFee() {
let { price } = this.headerInfo;
const { amountInsured, policyPeriod, payPeriod, payType } = this.formData.productItem;
const {
relation,
userInfoSecId: insureidId,
idNo: insureidNo,
socialSecurity
} = this.formData.insuredUserInfo;
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 {
if (!relation || relation === "1") {
userInfoSecId = this.formData.holderUserInfo.userInfoSecId;
idNo = this.formData.holderUserInfo.idNo;
} else {
userInfoSecId = insureidId;
idNo = insureidNo;
}
if (!amountInsured || !policyPeriod || !payPeriod || !payType || !idNo) return;
const _param = {
......
......@@ -3,7 +3,9 @@
<p class="Pdb-insurance-name">{{ productTitle }}</p>
<p class="Pdb-insurance-no">NO.{{ policyNo }}<br />{{ productCompany }}承保</p>
<div class="Pdb-insurance-operation">
<cr-button class="Pdbi-operation-button" v-if="isShowRenewalButton" @click="goNext">{{ buttonText }}</cr-button>
<cr-button class="Pdbi-operation-button" v-if="isShowRenewalButton" @click="goNext">
{{ buttonText }}
</cr-button>
<cr-button class="Pdbi-operation-button">申请理赔</cr-button>
</div>
</div>
......
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