【中介渠道鑫享金生养老年金保险】被保人年龄小于30天未校验

This commit is contained in:
li.yuetong
2022-06-09 09:49:34 +08:00
parent 0f247228df
commit 59bb9debb1
3 changed files with 32 additions and 3 deletions

View File

@@ -30,6 +30,30 @@ export default {
return age
}
},
getAge29: function(value = '', today) {
// value: 身份证号码获取的生日, today: 当前的时间
var b = value.match(/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/)
if (b == null) {
return null
} else {
var month = b[3] * 1
var day = b[4] * 1
var nowY = today.getFullYear()
var age = nowY - b[1]
if (today.getMonth() + 1 < month) {
age--
} else if (today.getMonth() + 1 == month && today.getDate() < day) {
age--
}
if (age < 1) {
var dayNum = this.getDateDiff(value, nowY + '-' + (today.getMonth() + 1) + '-' + today.getDate())
if (dayNum <= 29) {
age--
}
}
return age
}
},
/**
* 取得两个日期的时间差

View File

@@ -353,7 +353,7 @@ export default {
}
}
if (riskRules.ageLimit(resultData, this)) {
if (riskRules.ageLimit(resultData, this, null,riskProductCode)) {
return
}

View File

@@ -1,6 +1,7 @@
import { productCheck } from '@/api/ebiz/common/common'
import { getCompany } from '@/api/ebiz/sale/sale'
import { getAgentInfo } from '@/api/ebiz/my/my.js'
import utilsAge from '@/assets/js/utils/age'
import CacheUtils from '@/assets/js/utils/cacheUtils'
import DataDictionary from '@/assets/js/utils/data-dictionary'
export default {
@@ -41,13 +42,17 @@ export default {
return false
},
//投、被保险人年龄对险种的限制
ageLimit(resultData, vm, isApplicant) {
ageLimit(resultData, vm, isApplicant,riskProductCode) {
let age, tips
if (isApplicant) {
age = this.getSaleInsuredInfo().age
tips = '投保人年龄不适合此款险种,请选择其他险种!'
} else {
if(riskProductCode == 'GFRS_M0061'){
age = utilsAge.getAge29(this.getSaleInsuredPersonInfo().birthday, new Date())
}else{
age = this.getSaleInsuredPersonInfo().age
}
tips = '被保险人年龄不适合此款险种,请选择其他险种!'
}
let minAge = resultData.productTrialInfoDTO.ageRange && resultData.productTrialInfoDTO.ageRange.minAge