GFRS-2641【前端】修改卡单投保的bug --提交人:张齐

This commit is contained in:
zhangqi1
2021-08-24 19:22:10 +08:00
committed by bai.jinyan
parent a9d2452c44
commit a676b7dbee
2 changed files with 119 additions and 64 deletions

View File

@@ -1,48 +1,52 @@
<template>
<div class="product-detail-container pb50" style="overflow: hidden">
<van-cell-group class="mt10">
<p style="border-bottom: 1px solid #ebedf0" class="fs15 fwb pl10 pv12">投保人信息</p>
<van-field :value="appntInfo.name" label="姓名" name="姓名" readonly />
<van-field :value="appntInfo.idType | idToText('insuredIdType')" label="证件类型" name="证件类型" readonly />
<van-field :value="appntInfo.idNo" label="证件号码" name="证件号码" readonly />
<van-field :value="appntInfo.mobile" label="手机号码" name="手机号码" readonly />
<van-field :value="appntInfo.email" label="电子邮箱" name="电子邮箱" readonly />
<van-field :value="appntInfo.homeName" label="联系地址" name="联系地址" readonly />
<van-field :value="appntInfo.homeAddress" label="详细地址" name="详细地址" readonly />
<div class='product-detail-container pb50' style='overflow: hidden'>
<van-cell-group class='mt10'>
<p style='border-bottom: 1px solid #ebedf0' class='fs15 fwb pl10 pv12'>投保人信息</p>
<van-field :value='appntInfo.name' label='姓名' name='姓名' readonly />
<van-field :value="appntInfo.idType | idToText('insuredIdType')" label='证件类型' name='证件类型' readonly />
<van-field :value='appntInfo.idNo' label='证件号码' name='证件号码' readonly />
<van-field :value='appntInfo.mobile' label='手机号码' name='手机号码' readonly />
<van-field :value='appntInfo.email' label='电子邮箱' name='电子邮箱' readonly />
<van-field :value='appntInfo.homeName' label='联系地址' name='联系地址' readonly />
<van-field :value='appntInfo.homeAddress' label='详细地址' name='详细地址' readonly />
</van-cell-group>
<van-cell-group class="mt10">
<p style="border-bottom: 1px solid #ebedf0" class="fs15 fwb pl10 pv12">被保人信息</p>
<van-field :value="insuredInfo.name" label="姓名" name="姓名" readonly />
<van-field :value="insuredInfo.idType | idToText('insuredIdType')" label="证件类型" name="证件类型" readonly />
<van-field :value="insuredInfo.idNo" label="证件号码" name="证件号码" readonly />
<van-field :value="insuredInfo.mobile" label="手机号码" name="手机号码" readonly />
<van-field :value="insuredInfo.email" label="电子邮箱" name="电子邮箱" readonly />
<van-field :value="insuredInfo.homeName" label="联系地址" name="联系地址" readonly />
<van-field :value="insuredInfo.homeAddress" label="详细地址" name="详细地址" readonly />
<van-cell-group class='mt10'>
<p style='border-bottom: 1px solid #ebedf0' class='fs15 fwb pl10 pv12'>被保人信息</p>
<van-field :value='insuredInfo.name' label='姓名' name='姓名' readonly />
<van-field :value="insuredInfo.idType | idToText('insuredIdType')" label='证件类型' name='证件类型' readonly />
<van-field :value='insuredInfo.idNo' label='证件号码' name='证件号码' readonly />
<van-field v-if='isLessEighteen' :value='insuredInfo.mobile' label='手机号码' name='手机号码' readonly />
<van-field v-if='isLessEighteen' :value='insuredInfo.email' label='电子邮箱' name='电子邮箱' readonly />
<van-field :value='insuredInfo.homeName' label='联系地址' name='联系地址' readonly />
<van-field :value='insuredInfo.homeAddress' label='详细地址' name='详细地址' readonly />
</van-cell-group>
<van-cell-group class="mt10">
<p style="border-bottom: 1px solid #ebedf0" class="fs15 fwb pl10 pv12">受益人信息</p>
<van-field readonly v-model="bnfTypeVal" clearable label="受益人类型" v-validate="'required'" style="border-bottom: 1px solid #ebedf0" />
<van-cell-group class='mt10'>
<p style='border-bottom: 1px solid #ebedf0' class='fs15 fwb pl10 pv12'>受益人信息</p>
<van-field readonly v-model='bnfTypeVal' clearable label='受益人类型' v-validate="'required'"
style='border-bottom: 1px solid #ebedf0' />
</van-cell-group>
<van-cell-group class="mt10">
<p style="border-bottom: 1px solid #ebedf0" class="fs15 fwb pl10 pv12">产品信息</p>
<van-field :value="riskDTO.proScheme" label="保障方案" name="保障方案" readonly />
<div class="duty">
<van-field value="保额" label="保险责任" name="保险责任" readonly />
<van-cell-group class='mt10'>
<p style='border-bottom: 1px solid #ebedf0' class='fs15 fwb pl10 pv12'>产品信息</p>
<van-field :value='riskDTO.proScheme' label='保障方案' name='保障方案' readonly />
<div class='duty'>
<van-field value='保额' label='保险责任' name='保险责任' readonly />
</div>
<div v-if="riskDTO.dutyLst && riskDTO.dutyLst.length>0">
<div class="duty" v-for="(item, index) in riskDTO.dutyLst" :key="index">
<van-field :value="item.amtContain" :label="item.dutyName" :name="item.dutyName" readonly />
<div v-if='riskDTO.dutyLst && riskDTO.dutyLst.length>0'>
<div class='duty' v-for='(item, index) in riskDTO.dutyLst' :key='index'>
<van-field :value='item.amtContain' :label='item.dutyName' :name='item.dutyName' readonly />
</div>
</div>
<van-field :value="riskDTO.prem+'元'" label="保费" name="保费" readonly />
<van-field :value="riskDTO.insuYear + riskDTO.dateCN" label="保险期间" name="保险期间" readonly />
<van-field :value="riskDTO.prem+''" label='保费' name='保费' readonly />
<van-field :value='riskDTO.insuYear + riskDTO.dateCN' label='保险期间' name='保险期间' readonly />
</van-cell-group>
<div class="tips">{{productDate}}</div>
<van-goods-action style="z-index: 99">
<van-button type="default" style="width: 50%; font-size: 14px; height: 40px; background: white">总保费:<span style="color: red; font-weight: bold; font-size: 18px; font-weight: 400">{{
riskDTO.prem }}</span></van-button>
<van-goods-action-button type="danger" text="确认" @click="nextStep" v-no-more-click="1000" style="border-radius: 0em; width: 50%; height: 40px" />
<div class='tips'>注:{{ productDate }}</div>
<van-goods-action style='z-index: 99'>
<van-button type='default' style='width: 50%; font-size: 14px; height: 40px; background: white'>总保费:<span
style='color: red; font-weight: bold; font-size: 18px; font-weight: 400'>{{
riskDTO.prem }}</span>元
</van-button>
<van-goods-action-button type='danger' text='确认' @click='nextStep' v-no-more-click='1000'
style='border-radius: 0em; width: 50%; height: 40px' />
</van-goods-action>
</div>
</template>
@@ -52,6 +56,8 @@ import { Field, GoodsAction, GoodsActionIcon, GoodsActionButton, Icon } from 'va
import { getOrderDetail, information, underWrite } from '@/api/ebiz/sale/sale'
import getAreaName from '@/assets/js/utils/getAreaNameForSale'
import afterDate from '@/assets/js/utils/getAfterDate.js'
import utilsAge from '@/assets/js/utils/age'
export default {
name: 'cardDetail',
components: {
@@ -75,7 +81,8 @@ export default {
insuredInfo: {},
bnfTypeVal: '法定受益人', //受益人类型文字展示
riskDTO: {},
productDate: ''
productDate: '',
isLessEighteen: true // 被保人手机号和邮箱默认展示
}
},
created() {
@@ -83,16 +90,23 @@ export default {
this.appntInfo.homeName = getAreaName([{ code: this.appntInfo.homeProvince }, { code: this.appntInfo.homeCity }, { code: this.appntInfo.homeArea }])
this.insuredInfo = this.orderDTO.insuredDTOs[0]
this.insuredInfo.homeName = getAreaName([{ code: this.insuredInfo.homeProvince }, { code: this.insuredInfo.homeCity }, { code: this.insuredInfo.homeArea }])
if (this.insuredInfo.birthday) {
let age = utilsAge.getAge(this.insuredInfo.birthday, new Date())
if (age <= 17) {
this.isLessEighteen = false //是否小于18周岁不含
} else {
this.isLessEighteen = true //是否小于18周岁不含
}
}
let insuYear = (this.riskDTO = this.orderDTO.insuredDTOs[0].riskDTOLst[0])
if (this.riskDTO.dutyLst && this.riskDTO.dutyLst.length>0) {
if (this.riskDTO.dutyLst && this.riskDTO.dutyLst.length > 0) {
this.riskDTO.dutyLst.forEach(val => {
if(val.dutyCode === 'C006') {
if (val.dutyCode === 'C006') {
val.amtContain = val.amt + '/'
} else {
val.amtContain = val.amt + ''
}
});
})
}
let currentDataArr = insuYear.cvaliDate.split('-')
let currentData = currentDataArr[0] + '' + currentDataArr[1] + '' + currentDataArr[2] + ''
@@ -130,20 +144,23 @@ export default {
}
</script>
<style lang="scss">
<style lang='scss'>
.product-detail-container .van-collapse-item__content {
padding: 0 15px;
}
.tips {
font-size: 14px;
color: #333;
padding: 15px;
}
.duty{
.van-field__label{
.duty {
.van-field__label {
width: 60vw;
}
.van-field__control{
.van-field__control {
text-align: center;
}
}

View File

@@ -157,7 +157,7 @@
clearable maxlength='30' />
<!-- </template> -->
</van-cell-group>
<!-- 被保险人信息 -->
<!-- 被保险人信息 (投保人与被保险人非同一人的情况)-->
<van-cell-group class='mt10' v-if='userInfo.relationToInsured != 1'>
<p style='border-bottom: 1px solid #ebedf0' class='fs15 fwb pl10 pv12'>被保人信息</p>
<customer-picker
@@ -237,11 +237,11 @@
label='手机号码'
name='手机号码'
placeholder='请输入'
v-validate="'required|mobile'"
v-validate="'mobile'"
maxlength='11'
/>
<van-field v-if='isLessEighteen' v-model='insuredInfo.email' label='邮箱' name='邮箱' placeholder='请输入'
v-validate="'required|email'" clearable />
v-validate="'email'" clearable />
<van-field
required
@click="openOccupation('2')"
@@ -308,12 +308,14 @@
placeholder='请选择'
@click="areaSelect('2')"
/>
<van-field v-model='insuredInfo.homeAddress' label name='详细地址' placeholder='请输入详细地址' clearable maxlength='30' />
<van-field v-model='insuredInfo.homeAddress' label name='详细地址'
placeholder='请输入详细地址' clearable maxlength='30' />
<div class='pl10 pt10 pb10 pr10 address fs14 redRadioCheckbox'>
<van-checkbox v-model='withRootUser.value'>同投保人</van-checkbox>
</div>
</van-cell-group>
<!-- 被保险人信息 (投保人与被保险人是同一人的情况)-->
<van-cell-group class='mt10' v-else>
<p style='border-bottom: 1px solid #ebedf0' class='fs15 fwb pl10 pv12'>被保人信息</p>
<customer-picker v-validate="'required|name'" name='被保险人姓名' label='被保险人姓名' required readonly
@@ -368,13 +370,13 @@
:maxDate='maxDate'
></FieldDatePicter>
<van-field
required
v-if='isLessEighteen'
v-model='userInfo.mobile'
clearable
label='手机号码'
name='手机号码'
placeholder='请输入'
v-validate="'required|mobile'"
v-validate="'mobile'"
maxlength='11'
readonly
/>
@@ -682,8 +684,8 @@ export default {
healthGrade: '', //健康等级
nativeplace: '1', //国家地区
marriageStatus: '', //婚姻状况
homeProvince: '', //家庭省
homeCity: '', //家庭市
homeProvince: '450000', //家庭省
homeCity: '450100', //家庭市
homeArea: '450101', //家庭区
homeName: '', //联系地址
homeAddress: '', //详细地址
@@ -710,8 +712,8 @@ export default {
nativeplace: '', //国家地区
marriageStatus: '', //婚姻状况
marriage: '',
homeProvince: '', //家庭省
homeCity: '', //家庭市
homeProvince: '450000', //家庭省
homeCity: '450100', //家庭市
homeArea: '450101', //家庭区
homeName: '', //联系地址
homeAddress: '', //详细地址
@@ -775,14 +777,14 @@ export default {
if (this.itemProductDTOS.productCode === 'GFRS_M0048' || this.itemProductDTOS.productCode === 'GFRS_M0049' || this.itemProductDTOS.productCode === 'GFRS_M0050') {
this.userInfo.relationToInsured = ''
this.showField = true
let currentTime = dateUtils.formatDate(new Date(),'yyyy-MM-dd')
let currentTime = dateUtils.formatDate(new Date(), 'yyyy-MM-dd')
let currentDataArr = currentTime.split('-')
if (currentDataArr[1] >= 6 && currentDataArr[1] <= 8) {
this.cvaliDate = currentDataArr[0]+'-09-01'
this.onDateConfirm(this.cvaliDate,'6')
}else{
this.cvaliDate = dateUtils.formatDate(afterDate.getAfterDays(1),'yyyy-MM-dd')
this.onDateConfirm(this.cvaliDate,'6')
this.cvaliDate = currentDataArr[0] + '-09-01'
this.onDateConfirm(this.cvaliDate, '6')
} else {
this.cvaliDate = dateUtils.formatDate(afterDate.getAfterDays(1), 'yyyy-MM-dd')
this.onDateConfirm(this.cvaliDate, '6')
}
}
//GFRS-2641 少儿安康
@@ -793,8 +795,7 @@ export default {
//GFRS-2641 被保险人去掉电子邮箱、手机号码字段
this.isLessEighteen = false
}
this.userInfo.homeName = getAreaName([{ code: 450000 }, { code: 450100 }, { code: 620201 }]) //家庭地址
this.userInfo.homeName = getAreaName([{ code: this.userInfo.homeProvince = 450000 }, { code: this.userInfo.homeCity = 450100 }, { code: this.userInfo.homeArea = 620201 }]) //家庭地址
this.userInfo.homeName = getAreaName([{ code: 450000 }, { code: 450100 }, { code: 450101 }]) //家庭地址
},
mounted() {
// 2516--除万福卡投保人、被保险人年收入默认为0允许修改
@@ -2005,6 +2006,17 @@ export default {
email: '', //电子邮箱
effectiveDateType: false //是否长期
}
// 设置选中‘同投保人’的勾选项
this.withRootUser.value = true
this.insuredInfo.homeName = getAreaName([
{ code: this.userInfo.homeProvince },
{ code: this.userInfo.homeCity },
{ code: this.userInfo.homeArea }
])
this.insuredInfo.homeProvince = this.userInfo.homeProvince
this.insuredInfo.homeCity = this.userInfo.homeCity
this.insuredInfo.homeArea = this.userInfo.homeArea
this.insuredInfo.homeAddress = this.userInfo.homeAddress
// 2516--三款学平险-- 0048义务教育 0049 幼儿园 0050 高中
// GFRS-2641--被保险人职业:幼儿园版默认学龄前儿童,义务教育、高中/高等教育默认一般学生
@@ -2067,6 +2079,32 @@ export default {
immediate: true,
deep: true
},
'userInfo.homeName': {
handler(newV) {
if (this.withRootUser.value) {
this.insuredInfo.homeName = getAreaName([
{ code: this.userInfo.homeProvince },
{ code: this.userInfo.homeCity },
{ code: this.userInfo.homeArea }
])
this.insuredInfo.homeProvince = this.userInfo.homeProvince
this.insuredInfo.homeCity = this.userInfo.homeCity
this.insuredInfo.homeArea = this.userInfo.homeArea
this.insuredInfo.homeAddress = this.userInfo.homeAddress
}
},
immediate: true,
deep: true
},
'userInfo.homeAddress': {
handler(newV) {
if (this.withRootUser.value) {
this.insuredInfo.homeAddress = this.userInfo.homeAddress
}
},
immediate: true,
deep: true
},
async 'withRootUser.value'(n) {
if (n) {
this.insuredInfo.homeName = getAreaName([