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

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

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