【国富惠桂保团体医疗保险产品上线金掌桂投保开发需求】编辑时走试算接口,取ageRangeDTO定义给详情接口的trialList

This commit is contained in:
li.yuetong
2022-09-07 11:08:47 +08:00
parent a1097a5f43
commit f5affdeaaa

View File

@@ -532,6 +532,8 @@ export default {
let age = utilsAge.getAge(this.insuredInfo.birthday, new Date())
this.effectiveDateTypeAbleInsured = !(age >= 45)
}
//编辑时走试算接口
this.insureTrial(1)
}
})
} else {
@@ -779,7 +781,7 @@ export default {
this.proScheme = value.text
this.proSchemeCode = value.id
//选择保障方案时走试算接口
await this.insureTrial()
await this.insureTrial(0)
} else if (this.pickerType == '22') {
this.idLimitInsured = false
//选择证件类型后,清空证件号,证件截止日期,出生日期
@@ -823,7 +825,7 @@ export default {
}
},
//试算逻辑
insureTrial() {
insureTrial(type) {
let that = this
// if(this.insuredInfo.birthday || that.$route.query.relationToAppnt == '1'){
if(this.insuredInfo.birthday){
@@ -836,8 +838,12 @@ export default {
insureTrial(data)
.then((res) => {
if (res.result == 0) {
this.trialList = res.trialList
this.allPrice = res.trialList[0].prem
if(type == 0){ //选择保障方案
this.trialList = res.trialList
this.allPrice = res.trialList[0].prem
}else if(type == 1){ //编辑时
this.trialList[0].ageRangeDTO = res.trialList[0].ageRangeDTO
}
} else {
this.$toast(res.resultMessage)
}
@@ -1250,25 +1256,31 @@ export default {
// return this.$toast('投保人必须是具有民事行为能力且有固定职业和收入的自然人请确定')
// }
if (this.itemProductDTOS.productCode === 'GFRS_M0049') {
//幼儿园2岁≤被保险人≤7岁
if (insuredAge < 2 || insuredAge > 7) {
return this.$toast('被保险人年龄应为2岁-7请重新选择')
}
} else if (this.itemProductDTOS.productCode === 'GFRS_M0048') {
//义务教育5岁≤被保险人≤18岁
if (insuredAge < 5 || insuredAge > 18) {
return this.$toast('被保险人年龄应为5岁-18请重新选择')
}
} else if (this.itemProductDTOS.productCode === 'GFRS_M0050') {
//高中及高等教育15岁≤被保险人≤40岁
if (insuredAge < 15 || insuredAge > 40) {
return this.$toast('被保险人年龄应为15岁-40请重新选择')
}
} else if (this.itemProductDTOS.productCode === 'GFRS_M0052') {
//GFRS-2641--少儿安康17岁≤被保险人
if (insuredAge > 17) {
return this.$toast('被保险人年龄应为0岁-17请重新选择')
// if (this.itemProductDTOS.productCode === 'GFRS_M0049') {
// //幼儿园2岁≤被保险人≤7岁
// if (insuredAge < 2 || insuredAge > 7) {
// return this.$toast('被保险人年龄应为2岁-7请重新选择')
// }
// } else if (this.itemProductDTOS.productCode === 'GFRS_M0048') {
// //义务教育5岁≤被保险人≤18岁
// if (insuredAge < 5 || insuredAge > 18) {
// return this.$toast('被保险人年龄应为5岁-18请重新选择')
// }
// } else if (this.itemProductDTOS.productCode === 'GFRS_M0050') {
// //高中及高等教育15岁≤被保险人≤40岁
// if (insuredAge < 15 || insuredAge > 40) {
// return this.$toast('被保险人年龄应为15岁-40请重新选择')
// }
// } else if (this.itemProductDTOS.productCode === 'GFRS_M0052') {
// //GFRS-2641--少儿安康17岁≤被保险人
// if (insuredAge > 17) {
// return this.$toast('被保险人年龄应为0岁-17请重新选择')
// }
// }
console.log(insuredAge,'insuredAge')
if(this.itemProductDTOS.productCode == 'GFRS_M0058' ){
if (insuredAge < this.trialList[0].ageRangeDTO.minAge || insuredAge > this.trialList[0].ageRangeDTO.maxAge) {
return this.$toast('被保险人年龄应为'+this.trialList[0].ageRangeDTO.minAge+'-'+this.trialList[0].ageRangeDTO.maxAge+'请重新选择')
}
}
let age = utilsAge.getAge(this.userInfo.birthday, new Date())