This commit is contained in:
邓晓坤
2019-09-12 16:22:38 +08:00
parent 90ea054ae0
commit ff8a261f79
195 changed files with 65268 additions and 0 deletions

View File

@@ -0,0 +1,62 @@
export default {
//投、被保人年龄对险种的限制
ageLimit(resultData, vm, isApplicant) {
let age, tips
if (isApplicant) {
age = this.getSaleInsuredInfo().age
tips = '投保人年龄不适合此款险种,请选择其他险种!'
} else {
age = this.getSaleInsuredPersonInfo().age
tips = '被保人年龄不适合此款险种,请选择其他险种!'
}
let minAge = resultData.productTrialInfoDTO.ageRange && resultData.productTrialInfoDTO.ageRange.minAge
let maxAge = resultData.productTrialInfoDTO.ageRange && resultData.productTrialInfoDTO.ageRange.maxAge
;[age, minAge, maxAge] = [Number(age), Number(minAge), Number(maxAge)]
if (age > maxAge || age < minAge) {
vm.$toast(tips)
return true
}
return false
},
//社保对附加险的影响 0 无影响 1无社保 2有社保
medicalLimit(resultData, vm) {
let currentMedical = this.getSaleInsuredPersonInfo().medical == 0 ? 2 : 1
let socialInsurance = resultData.productInsuredDTO.socialInsurance
if (socialInsurance == 0) return false
if (currentMedical != socialInsurance) {
vm.$toast('被保人社保情况不适合此款险种,请选择其他险种!')
return true
}
return false
},
//健康等级对附加险的影响
healthGradeLimit(resultData, vm) {
let cuttentHealthGrade = this.getSaleInsuredPersonInfo().healthGrade
let healthGrade = resultData.productInsuredDTO.healthGrade
if (healthGrade == 0) return false
if (Number(cuttentHealthGrade) > Number(healthGrade)) {
vm.$toast('健康等级不适合此款险种,请选择其他险种!')
return true
}
return false
},
//寿险等级对附加险的影响
lifeGradeLimit(resultData, vm) {
let cuttentLifeGrade = this.getSaleInsuredPersonInfo().lifeGrade
let lifeGrade = resultData.productInsuredDTO.lifeGrade
if (lifeGrade == 0) return false
if (Number(cuttentLifeGrade) > Number(lifeGrade)) {
vm.$toast('寿险等级不适合此款险种,请选择其他险种!')
return true
}
return false
},
//获取被保人信息
getSaleInsuredPersonInfo() {
return localStorage.saleInsuredPersonInfo && JSON.parse(localStorage.saleInsuredPersonInfo)
},
//获取投保人信息
getSaleInsuredInfo() {
return localStorage.saleInsuredInfo && JSON.parse(localStorage.saleInsuredInfo)
}
}