feat: 添加投保人信息补充

This commit is contained in:
hz
2025-10-28 17:26:21 +08:00
parent 351c7a7fa8
commit 027802e834
2 changed files with 37 additions and 17 deletions

View File

@@ -1,7 +1,9 @@
<template> <template>
<div class="calculate-premium-container pt10 pb100 redRadioCheckbox"> <div class="calculate-premium-container pt10 pb100 redRadioCheckbox">
<!--用户信息详情--> <!--投保人信息详情-->
<insured-message-info :insuredInfo="saleInsuredPersonInfo" v-if="showSaleInsuredPersionInfo"/> <insured-message-info :insuredInfo="saleInsuredInfo" v-if="persionMessageInfo" type="applicant" />
<!--被保人信息详情-->
<insured-message-info :insuredInfo="saleInsuredPersonInfo" v-if="persionMessageInfo" type="insured" />
<div v-for="(item, index) in chooseProducts" :key="index" class="ph10 bg-white"> <div v-for="(item, index) in chooseProducts" :key="index" class="ph10 bg-white">
<div class="flex justify-content-s align-items-c border-bottom pv10"> <div class="flex justify-content-s align-items-c border-bottom pv10">
@@ -470,7 +472,7 @@ export default {
} }
} }
}, },
components:{ components: {
AddtionRiskList, AddtionRiskList,
[Tag.name]: Tag, [Tag.name]: Tag,
[Icon.name]: Icon, [Icon.name]: Icon,
@@ -492,7 +494,7 @@ export default {
type: Array, type: Array,
default: () => [] default: () => []
}, },
showSaleInsuredPersionInfo:{ persionMessageInfo: {
type: Boolean, type: Boolean,
default: true default: true
} }
@@ -513,13 +515,13 @@ export default {
productIndex: '', productIndex: '',
calFactorIndex: '', calFactorIndex: '',
premiumData: [], //试算 premiumData: [], //试算
saleInsuredInfo: {}, saleInsuredInfo: syncLocalstorageData(
{ sex: '0', birthday: '' }, //投保人信息
{ name: 'saleInsuredInfo' }
),
saleInsuredPersonInfo: syncLocalstorageData( saleInsuredPersonInfo: syncLocalstorageData(
{ { sex: '0', birthday: '' }, //投保人信息
sex: '0', { name: 'saleInsuredPersonInfo' }
birthday: ""
}, //投保人信息,
{ name: 'saleInsuredPersonInfo'}
), ),
trialList: [], trialList: [],
popupShow: false, popupShow: false,
@@ -583,7 +585,7 @@ export default {
console.log(res, info) console.log(res, info)
if (res !== -1) { if (res !== -1) {
return res.length === keys.length return res.length === keys.length
}else return false } else return false
} }
}, },
mounted() { mounted() {
@@ -3607,7 +3609,15 @@ export default {
handler: function(obj) { handler: function(obj) {
const { birthday } = obj const { birthday } = obj
this.saleInsuredPersonInfo.insuredAge = utilsAge.getAge(birthday, new Date()) this.saleInsuredPersonInfo.insuredAge = utilsAge.getAge(birthday, new Date())
console.log('当前年龄是 ', this.saleInsuredPersonInfo.insuredAge) console.log('投保人当前年龄是 ', this.saleInsuredPersonInfo.insuredAge)
}
},
saleInsuredInfo: {
deep: true,
handler: function(obj) {
const { birthday } = obj
this.saleInsuredInfo.insuredAge = utilsAge.getAge(birthday, new Date())
console.log('被保人当前年龄是 ', this.saleInsuredPersonInfo.insuredAge)
} }
} }
} }

View File

@@ -24,6 +24,10 @@ export default {
sex: '0', sex: '0',
relationToAppnt: '' relationToAppnt: ''
}) })
},
type: {
type: String,
default: 'insured'
} }
}, },
components: { components: {
@@ -32,8 +36,13 @@ export default {
}, },
watch: { watch: {
insuredInfo: { insuredInfo: {
handler: function() { handler: function() {},
}, deep: true deep: true
}
},
computed: {
factorLabel() {
return this.type === "applicant" ? "" :"投保人"
} }
}, },
methods: { methods: {
@@ -52,6 +61,7 @@ export default {
<template> <template>
<div class="insured-message-container"> <div class="insured-message-container">
<van-field <van-field
v-if="type === 'insured'"
:value="insuredInfo.relationToAppnt | idToText('relationToAppnt')" :value="insuredInfo.relationToAppnt | idToText('relationToAppnt')"
readonly readonly
required required
@@ -64,16 +74,16 @@ export default {
/> />
<FieldDatePicter <FieldDatePicter
v-validate="'required'" v-validate="'required'"
label="出生日期" :label=" factorLabel + '出生日期'"
required required
name="出生日期" :name="factorLabel+'出生日期'"
:value.sync="insuredInfo.birthday" :value.sync="insuredInfo.birthday"
:maxDate="new Date()" :maxDate="new Date()"
type="date" type="date"
:flag="true" :flag="true"
@confirm="handleApplyBirthday" @confirm="handleApplyBirthday"
/> />
<select-radio required :radios="sexRadio" label="性别" name="性别" :value.sync="insuredInfo.sex" /> <select-radio required :radios="sexRadio" :label="factorLabel+'性别'" :name="factorLabel+'性别'" :value.sync="insuredInfo.sex" />
<!-- 字段选择 --> <!-- 字段选择 -->
<van-popup v-model="popupShow" position="bottom"> <van-popup v-model="popupShow" position="bottom">