重新投保页面--被保人,受益人证件类型如果是身份证时,证件截止日期证件截止日期应为第16周岁的生日日期

This commit is contained in:
liyuetong
2021-12-02 17:18:17 +08:00
parent 9421776514
commit b24792d68a

View File

@@ -353,6 +353,8 @@ import CacheUtils from '@/assets/js/utils/cacheUtils'
import SelectBankName from '@/components/ebiz/account/SelectBankName'
import areaList from '@/assets/js/utils/area'
import occupationList from '@/components/ebiz/occipation/data/occupation'
import { idToData } from './js/verification'
export default {
name: 'InsureInformation',
components: {
@@ -575,9 +577,23 @@ export default {
})
this.setInsuredCustomerMarriage(this.insuredPersonInfo.marriage)
//是否长期
// this.insuredPersonInfo.effectiveDateType = res.orderDTO.insuredDTOs[0].effectiveDateType == 'false' ? false : true
this.insuredPersonInfo.effectiveDateType = res.orderDTO.insuredDTOs[0].effectiveDateType == 'true' ? true : false
//被保人证件类型如果是身份证时证件截止日期证件截止日期应为第16周岁的生日日期。
if(this.insuredPersonInfo.idType == '2' && idToData(this.insuredPersonInfo.idNo).age <16){
// 获取当前年份
const currentYear = new Date().getFullYear()
if(this.insuredPersonInfo.birthday.substr(5,5) == '02-29'){
// 获取某年某月一共多少天
let year = currentYear + Number(16-idToData(this.insuredPersonInfo.idNo).age)
let date = new Date(year, 2, 1)
let dayEnd = new Date(date.getTime() - 864e5).getDate()
this.insuredPersonInfo.certiexpiredate = currentYear + Number(16-idToData(this.insuredPersonInfo.idNo).age)+'-02-'+ dayEnd
}else{
this.insuredPersonInfo.certiexpiredate = currentYear + Number(16-idToData(this.insuredPersonInfo.idNo).age)+'-'+ this.insuredPersonInfo.birthday.substr(5,5)
}
}else{
//是否长期
this.insuredPersonInfo.effectiveDateType = this.insuredPersonInfo.effectiveDateType == 'true' ? true : false
}
if (this.insuredPersonInfo.homeProvince.length) {
this.insuredHomeName = getAreaName([
{ code: this.insuredPersonInfo.homeProvince },
@@ -609,6 +625,20 @@ export default {
}
})
})
//受益人证件类型如果是身份证时证件截止日期证件截止日期应为第16周岁的生日日期。
if(item.idType == '2' && idToData(item.idNo).age <16){
// 获取当前年份
const currentYear = new Date().getFullYear()
if(item.birthday.substr(5,5) == '02-29'){
// 获取某年某月一共多少天
let year = currentYear + Number(16-idToData(item.idNo).age)
let date = new Date(year, 2, 1)
let dayEnd = new Date(date.getTime() - 864e5).getDate()
item.certiexpiredate = currentYear + Number(16-idToData(item.idNo).age)+'-02-'+ dayEnd
}else{
item.certiexpiredate = currentYear + Number(16-idToData(item.idNo).age)+'-'+ item.birthday.substr(5,5)
}
}
})
} else {
this.bnftype = '0'