删除险种时,删除两全时,(被保险人)国富人寿附加豁免保险费重大疾病保险(B款)一并删除

This commit is contained in:
liyuetong
2021-10-26 15:16:39 +08:00
parent 74910727a5
commit e6bc912ec6

View File

@@ -1588,8 +1588,10 @@ export default {
className: 'dialog-delete'
})
.then(() => {
let currentGFRS_A0011
if (this.chooseProducts[index].isMainRisk == 0) {
this.chooseProducts = []
localStorage.chooseProducts = JSON.stringify(this.chooseProducts)
this.$jump({
flag: 'goBack',
extra: {
@@ -1603,10 +1605,10 @@ export default {
}
})
localStorage.trialList = ''
} else {
}else{
currentGFRS_A0011 = this.chooseProducts[index].productCode == 'GFRS_A0011'?true:false //当前删除的是否是两全
this.chooseProducts.splice(index, 1)
}
if (
this.chooseProducts[0].mainRiskCode == 'GFRS_M0051' ||
this.chooseProducts[0].mainRiskCode == 'GFRS_M0044' ||
@@ -1614,53 +1616,54 @@ export default {
this.chooseProducts[0].mainRiskCode == 'GFRS_M0038' ||
this.chooseProducts[0].mainRiskCode == 'GFRS_M0040'
) {
let risks = this.chooseProducts
let longRisks = []
//拿到长险附加险数组
for (let i = 1; i < risks.length; i++) {
for (let j = 0; j < risks[i].calFactorLst.length; j++) {
if (risks[i].calFactorLst[j].code === 'insuYear') {
if (
((risks[i].calFactorLst[j].insuYearFlag == 'Y' && risks[i].calFactorLst[j].insuYear > 1) || risks[i].calFactorLst[j].insuYearFlag == 'A') &&
risks[i].productCode != 'GFRS_A0010'
) {
longRisks.push(risks[i].productCode)
}
if (currentGFRS_A0011 && JSON.stringify(this.chooseProducts).includes('GFRS_A0010')) {
this.chooseProducts.forEach((item, index01) => {
if(item.productCode == 'GFRS_A0010'){
this.chooseProducts.splice(index01, 1)
}
}
}
if (
(this.chooseProducts.length == 2 && this.chooseProducts[1].productCode == 'GFRS_A0010') ||
(this.chooseProducts.length == 3 &&
JSON.stringify(this.chooseProducts).includes('GFRS_A0010') &&
JSON.stringify(this.chooseProducts).includes('GFRS_A0009')) ||
(longRisks.length <= 0 && this.chooseProducts.length > 1)
) {
Dialog.alert({
title: '提示',
message: '当前未投保其他长险附加险,将删除该险种重新选择附加险!'
}).then(() => {
this.chooseProducts.splice(1, 1)
localStorage.chooseProducts = JSON.stringify(this.chooseProducts)
this.getTrial()
})
// this.$toast('当前未投保其他长险附加险,请删除该险种重新选择附加险!')
// this.nextStepFlag = true
// Dialog.alert({
// title: '提示',
// message: '当前未投保其他长险附加险,将删除该险种重新选择附加险!'
// }).then(() => {
// })
}
if (
(this.chooseProducts.length == 3 &&
JSON.stringify(this.chooseProducts).includes('GFRS_A0010') &&
JSON.stringify(this.chooseProducts).includes('GFRS_A0009')) ||
(longRisks.length <= 0 && this.chooseProducts.length > 1)
) {
this.$toast('当前未投保其他长险附加险,请删除该险种重新选择附加险!')
this.nextStepFlag = true
this.chooseProducts.splice(1, 2)
localStorage.chooseProducts = JSON.stringify(this.chooseProducts)
// this.getTrial()
}
}
// let risks = this.chooseProducts
// let longRisks = []
// //拿到长险附加险数组
// for (let i = 1; i < risks.length; i++) {
// for (let j = 0; j < risks[i].calFactorLst.length; j++) {
// if (risks[i].calFactorLst[j].code === 'insuYear') {
// if (
// ((risks[i].calFactorLst[j].insuYearFlag == 'Y' && risks[i].calFactorLst[j].insuYear > 1) || risks[i].calFactorLst[j].insuYearFlag == 'A') &&
// risks[i].productCode != 'GFRS_A0010'
// ) {
// longRisks.push(risks[i].productCode)
// }
// }
// }
// }
// if (
// (this.chooseProducts.length == 2 && this.chooseProducts[1].productCode == 'GFRS_A0010') ||
// (this.chooseProducts.length == 3 &&
// JSON.stringify(this.chooseProducts).includes('GFRS_A0010') &&
// JSON.stringify(this.chooseProducts).includes('GFRS_A0009')) ||
// (longRisks.length <= 0 && this.chooseProducts.length > 1)
// ) {
// Dialog.alert({
// title: '提示',
// message: '当前未投保其他长险附加险,将删除该险种重新选择附加险!'
// }).then(() => {
// this.chooseProducts.splice(1, 1)
// localStorage.chooseProducts = JSON.stringify(this.chooseProducts)
// this.getTrial()
// })
// // this.$toast('当前未投保其他长险附加险,请删除该险种重新选择附加险!')
// // this.nextStepFlag = true
// }
}
localStorage.chooseProducts = JSON.stringify(this.chooseProducts)
this.getTrial()
})
@@ -1788,34 +1791,32 @@ export default {
//设置豁免险保额
this.setRemitRisk()
this.nextStepFlag = false
//针对八桂D产品 计算被保人重疾B附加险保额 ==其他附加险的保额 重新试算后面添加的其他附加险
if ( this.chooseProducts[0].mainRiskCode == 'GFRS_M0051'||this.chooseProducts[0].mainRiskCode == 'GFRS_M0044') {
let tParams = this.getParams()
// 开门红产品试算增加标识
if (this.activeType == 'KMH' && this.isFrom != 'proposal') {
for (let product of tParams.trialInfos) {
product.isKmh = '1'
}
}
let tResult = await trial(tParams)
if (tResult.result == 0) {
if (tResult.flag === '1') {
this.richChildrenFlag = true
}
this.trialList = tResult.trialList
localStorage.trialList = JSON.stringify(tResult.trialList)
//设置豁免险保额
this.setRemitRisk()
this.nextStepFlag = false
}
if(this.chooseProducts.length==2&&this.chooseProducts[1].productCode=='GFRS_A0010'){
this.$toast('当前未投保其他长险附加险,请删除该险种重新选择附加险!')
this.nextStepFlag = true
}
//针对八桂D产品 计算被保人重疾B附加险保额 ==其他附加险的保额 重新试算后面添加的其他附加险
if ( this.chooseProducts[0].mainRiskCode == 'GFRS_M0051'||this.chooseProducts[0].mainRiskCode == 'GFRS_M0044') {
let tParams = this.getParams()
// 开门红产品试算增加标识
if (this.activeType == 'KMH' && this.isFrom != 'proposal') {
for (let product of tParams.trialInfos) {
product.isKmh = '1'
}
this.againGetTrial()
}
let tResult = await trial(tParams)
if (tResult.result == 0) {
if (tResult.flag === '1') {
this.richChildrenFlag = true
}
this.trialList = tResult.trialList
localStorage.trialList = JSON.stringify(tResult.trialList)
//设置豁免险保额
this.setRemitRisk()
this.nextStepFlag = false
}
if(this.chooseProducts.length==2&&this.chooseProducts[1].productCode=='GFRS_A0010'){
this.$toast('当前未投保其他长险附加险,请删除该险种重新选择附加险!')
this.nextStepFlag = true
}
}
// this.againGetTrial()
} else {
this.nextStepFlag = true
this.$toast(resultData.resultMessage)