Commit 0835ae66 authored by 郭志伟's avatar 郭志伟

Merge branch 'fix/policy_fix' into 'master'

fix: 华贵试算弹框兼容问题修复,其他险种试算不触发问题修复

See merge request !51
parents a4657e29 a6fdf212
<template>
<div class="picker-wrap">
<div class="picker-wrap-txt" @click="show = true">
<input type="text" disabled :value="pickerValShow" :placeholder="placeholder" />
<!-- <span>{{ pickerValShow || placeholder }}</span> -->
<input type="text" readonly :value="pickerValShow" :placeholder="placeholder" />
<svg-icon icon-class="triangle-right" slot="button" />
</div>
<cr-popup v-model="show" position="bottom" get-container="body">
......@@ -83,10 +82,8 @@ export default {
width: 16px;
}
input {
color: #333;
width: 90%;
&:disabled {
background-color: transparent;
}
}
}
</style>
<template>
<div class="jobs-wrap">
<div class="jobs-wrap-txt" @click="show = true">
<input type="text" disabled :value="selectedTexts[2]" :placeholder="placeholder" />
<input type="text" readonly :value="selectedTexts[2]" :placeholder="placeholder" />
<svg-icon icon-class="triangle-right" slot="button" />
</div>
<cr-popup v-model="show" get-container="body" round closeable position="bottom" class="jobs">
......@@ -286,10 +286,8 @@ export default {
justify-content: space-between;
align-items: center;
input {
color: #333;
width: 90%;
&:disabled {
background-color: transparent;
}
}
}
}
......
<template>
<div class="picker-wrap">
<div class="picker-wrap-txt" @click="show = true">
<input type="text" disabled :value="pickerValShow" :placeholder="placeholder" />
<input type="text" readonly :value="pickerValShow" :placeholder="placeholder" />
<svg-icon icon-class="triangle-right" slot="button" />
</div>
<cr-popup v-model="show" position="bottom" get-container="body">
......@@ -87,10 +87,8 @@ export default {
align-items: center;
}
input {
color: #333;
width: 90%;
&:disabled {
background-color: transparent;
}
}
.svg-icon {
height: 16px;
......
<template>
<div class="picker-wrap">
<div class="picker-wrap-txt" @click="show = true">
<input type="text" disabled :value="pickerValShow" :placeholder="placeholder" />
<input type="text" readonly :value="pickerValShow" :placeholder="placeholder" />
<svg-icon icon-class="triangle-right" slot="button" />
</div>
<cr-popup v-model="show" position="bottom" get-container="body">
......@@ -49,10 +49,8 @@ export default {
align-items: center;
}
input {
color: #333;
width: 90%;
&:disabled {
background-color: transparent;
}
}
.svg-icon {
height: 16px;
......
......@@ -60,6 +60,15 @@ export function isInteger(str) {
return false;
}
// 判断输入的字符是否为身份证号
export function isIdNo(str) {
if (!isNull(str)) {
const reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
return reg.test(str);
}
return false;
}
// 判断输入的字符是否以数字开头
export function isStartWithInteger(str) {
if (!isNull(str)) {
......
......@@ -13,6 +13,7 @@
v-model="formData"
:radio-options="personFormOptions"
ref="insureForm"
:detail-type="type"
/>
<auto-deduct
v-model="formData.autoRenewPolicy"
......@@ -98,6 +99,7 @@ import detailLoginMixin from "./modules/detailLogin.mixin";
import Detail from "@/api/detail.zhongan.yiwai";
import { trail, list } from "@/api/product";
import { isIdNo } from "@/service/validation";
export default {
name: "GoodsDetail-AI",
......@@ -163,12 +165,12 @@ export default {
if (this.calTimer) {
clearTimeout(this.calTimer);
}
const { idNo } = val;
const { idNo: oldNo } = oldVal;
if (idNo === oldNo) return;
const { idNo, amountInsured } = val;
const { idNo: oldidNo, amountInsured: oldamountInsured } = oldVal;
if (!isIdNo(idNo) && idNo === oldidNo && amountInsured === oldamountInsured) return;
this.calTimer = setTimeout(() => {
this.calFee();
}, 1200);
}, 1000);
}
}
},
......
......@@ -13,6 +13,7 @@
v-model="formData"
:radio-options="personFormOptions"
ref="insureForm"
:detail-type="type"
/>
<auto-deduct
v-model="formData.autoRenewPolicy"
......@@ -95,6 +96,7 @@ import detailLoginMixin from "./modules/detailLogin.mixin";
import Detail from "@/api/detail.huatai.zhongjixian";
import { trail, list } from "@/api/product";
import { isIdNo } from "@/service/validation";
export default {
name: "GoodsDetail-CII",
......@@ -166,19 +168,24 @@ export default {
if (this.calTimer) {
clearTimeout(this.calTimer);
}
const { idNo } = val;
const { idNo: oldNo } = oldVal;
const { idNo, payType, amountInsured } = val;
const { idNo: oldidNo, payType: oldpayType, amountInsured: oldamountInsured } = oldVal;
if (this.goInsureState) {
sessionStorage.setItem(
"policyFormData",
JSON.stringify(Object.assign(this.formData, { productNo: this.goodId }))
);
}
console.log(idNo, oldNo);
if (idNo === oldNo) return;
if (
!isIdNo(idNo) &&
idNo === oldidNo &&
payType === oldpayType &&
amountInsured === oldamountInsured
)
return;
this.calTimer = setTimeout(() => {
this.calFee();
}, 1200);
}, 1000);
}
}
},
......
......@@ -78,8 +78,17 @@
:content="pupopData.content"
:url="pupopData.url"
>
<cal-insured-fee v-model="formData" v-if="currentPupopIndex === 6" />
<cal-insured-fee
v-model="formData"
@select-date="showBirthPickerHandler"
v-if="currentPupopIndex === 6"
/>
</popup-with-iframe>
<div style="position: relative;z-index: 204;">
<cr-popup v-model="showCalDate" position="bottom">
<cr-date-picker @confirm="onBirthConfirm" ref="birthDatePicker" />
</cr-popup>
</div>
</cr-form>
</template>
......@@ -141,9 +150,13 @@ export default {
goodActionShow: false,
popupShow: false,
currentPupopIndex: null,
formData: {},
formData: {
payType: "1"
},
read: true,
showLayer: false
showLayer: false,
showCalDate: false,
calDateRefresh: false
};
},
watch: {
......@@ -186,6 +199,19 @@ export default {
this.getDetail();
},
methods: {
showBirthPickerHandler() {
if (!this.calDateRefresh && this.$refs["birthDatePicker"]) {
this.calDateRefresh = true;
setTimeout(() => {
this.$refs["birthDatePicker"].refreshColumns();
});
}
this.showCalDate = true;
},
onBirthConfirm(p, e) {
this.showCalDate = false;
this.$set(this.formData, "birth", e);
},
openIframePupop(index) {
if (index === 4) {
this.$router.push({ path: "/goods/plan", query: { type: this.type } });
......
......@@ -12,6 +12,7 @@
v-model="formData"
:radio-options="personFormOptions"
ref="insureForm"
:detail-type="type"
/>
<auto-deduct
v-model="formData.autoRenewPolicy"
......@@ -96,6 +97,7 @@ import detailLoginMixin from "./modules/detailLogin.mixin";
import { trail, list } from "@/api/product";
import localStorage from "@/service/localStorage";
import Detail from "@/api/detail.taikang.yiliaobaozhang";
import { isIdNo } from "@/service/validation";
export default {
name: "GoodsDetail-MI",
......@@ -163,15 +165,18 @@ export default {
];
}
},
formData: {
formDataCpu: {
deep: true,
handler() {
handler(val, oldVal) {
if (this.calTimer) {
clearTimeout(this.calTimer);
}
const { idNo } = val;
const { idNo: oldidNo } = oldVal;
if (!isIdNo(idNo) && idNo === oldidNo) return;
this.calTimer = setTimeout(() => {
this.calFee();
}, 1200);
}, 1000);
}
}
},
......@@ -187,6 +192,9 @@ export default {
paywayOptions,
medicalOptions
};
},
formDataCpu() {
return JSON.parse(JSON.stringify(this.formData));
}
},
mounted() {
......
<template>
<cr-form ref="calFeeForm" class="policy-form" @submit="onFormSubmit">
<cr-form ref="calFeeForm" class="policy-form" :show-error="false" @submit="onFormSubmit">
<cr-cell-group title="被保人年龄需满足18周岁~60周岁">
<cr-field
v-model="formData.birth"
name="birth"
label="出生日期"
placeholder="请选择出生日期"
:error="false"
readonly
:rules="[{ required: true, message: 'required' }]"
>
<template #input>
<popup-date-picker
:before="60"
:later="0"
v-model="formData.birth"
class="cal-fee-date"
placeholder="请选择被保人出生日期"
/>
</template>
</cr-field>
@click.native="$emit('select-date')"
/>
<cr-field
name="amountInsured"
label="保障额度"
......@@ -60,15 +54,13 @@
<script>
import CrRadioBtn from "@/components/CrRadioBtn";
import PopupDatePicker from "@/components/PopupDatePicker";
const DATA_CHANGE_EVENT = "input";
import liDetail from "@/api/detail.huagui.shouxian";
const { paywayOptions, sexOptions, insuredAmountOptions, termOptions, benefitOptions } = liDetail;
export default {
name: "CalInsuredFee",
components: {
CrRadioBtn,
PopupDatePicker
CrRadioBtn
},
props: {
value: {
......@@ -91,6 +83,7 @@ export default {
watch: {
value: {
deep: true,
immediate: true,
handler(val) {
this.formData = val;
}
......@@ -115,6 +108,9 @@ export default {
.policy-form {
padding: 0;
@{deep} .cr-cell {
&__title {
width: 75px !important;
}
&-group {
&__title {
font-size: @font-size-16;
......
......@@ -155,7 +155,8 @@ export default {
default() {
return {};
}
}
},
detailType: String
},
data() {
return {
......@@ -164,6 +165,7 @@ export default {
showCount: false,
count: "",
timer: null,
autoSaveKey: AUTO_SAVE_KEY,
mongoToken: localStorage.get("mongoToken"),
xyqbAuthState: localStorage.get("xyqbAuthState"),
selfInfoReadonly: false,
......@@ -172,6 +174,12 @@ export default {
};
},
watch: {
detailType: {
immediate: true,
handler(val) {
this.autoSaveKey = val + AUTO_SAVE_KEY;
}
},
value: {
deep: true,
immediate: true,
......@@ -192,7 +200,7 @@ export default {
immediate: true,
deep: true,
handler(val) {
this.autoSaveHandler(AUTO_SAVE_TARGET, AUTO_SAVE_KEY);
this.autoSaveHandler(AUTO_SAVE_TARGET, this.autoSaveKey);
this.$emit(DATA_CHANGE_EVENT, val);
this.$forceUpdate();
}
......@@ -292,8 +300,8 @@ export default {
const res = await getFamilyList();
if (res) {
this.familyList = res;
if (this.hasAutoSaveData(AUTO_SAVE_KEY)) {
this.getSaveInfoHandler(AUTO_SAVE_KEY, AUTO_SAVE_TARGET);
if (this.hasAutoSaveData(this.autoSaveKey)) {
this.getSaveInfoHandler(this.autoSaveKey, AUTO_SAVE_TARGET);
} else {
const queryId = this.$route.query.userInfoSecId;
let relation = this.formData.relation;
......
......@@ -61,7 +61,7 @@
</div>
</div>
<div class="report-container-retest" @click="goBack">
<svg-icon icon-class="retest" class-name="Rc-retest-svg"/>
<svg-icon icon-class="retest" class-name="Rc-retest-svg" />
<span class="Rc-retest-text">重测一遍</span>
</div>
<div class="report-container-explain" @click="$router.push('/consultant')"></div>
......
......@@ -102,7 +102,7 @@
</template>
</cr-field>
<cr-field
v-if="showHolderTermOption"
v-if="formData.holderUserInfo.longTerm === '1'"
v-model="formData.holderUserInfo.validEnd"
name="holderUserInfo_validEnd"
label="有效期至"
......@@ -244,7 +244,7 @@
</template>
</cr-field>
<cr-field
v-if="showHolderTermOption"
v-if="formData.insuredUserInfo.longTerm === '1'"
v-model="formData.insuredUserInfo.validEnd"
name="insuredUserInfo_validEnd"
label="有效期至"
......@@ -389,6 +389,7 @@ import Detail from "@/api/detail.huagui.shouxian";
import { list, trail } from "@/api/product";
import { getFamilyList } from "@/api/user";
import { parseTime } from "@/service/utils";
import { isIdNo } from "@/service/validation";
const AUTO_SAVE_KEY = "PolicyFormData";
const AUTO_SAVE_TARGET = "formData";
......@@ -441,8 +442,7 @@ export default {
productItem: {
amountInsured: "500000"
},
payPeriod: "1",
autoRenewPolicy: true
payPeriod: "1"
},
subFromData: {},
familyList: [],
......@@ -481,16 +481,29 @@ export default {
this.goodBuyModalInfo = [{ title: `${price[2]}保费`, value: `${price[0]}${price[1]}` }];
}
},
formData: {
formDataCpu: {
deep: true,
handler() {
handler(val, oldVal) {
this.autoSaveHandler(AUTO_SAVE_TARGET, AUTO_SAVE_KEY);
if (this.calTimer) {
clearTimeout(this.calTimer);
}
const { relation, idNo } = val.insuredUserInfo;
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) {
return;
}
}
this.calTimer = setTimeout(() => {
this.calFee();
}, 1200);
}, 1000);
}
},
showAuthXyqb: {
......@@ -519,11 +532,8 @@ export default {
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";
formDataCpu() {
return JSON.parse(JSON.stringify(this.formData));
}
},
mounted() {
......@@ -604,6 +614,7 @@ export default {
: "0"
}
};
this.calFee();
this.$forceUpdate();
},
openIframePupop(index) {
......@@ -664,8 +675,7 @@ export default {
userInfoSecId = this.formData.holderUserInfo.userInfoSecId;
idNo = this.formData.holderUserInfo.idNo;
}
if (!amountInsured || !policyPeriod || !payPeriod || !payType || !idNo || !socialSecurity)
return;
if (!amountInsured || !policyPeriod || !payPeriod || !payType || !idNo) return;
const _param = {
productNo: this.formData.productNo,
productUserInfo: {
......
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