GFRS-729【0326】国富人寿国富民安重大疾病保险(2020版)_1 保费试算修改 --提交人:阳华祥

This commit is contained in:
阳华祥
2020-03-13 13:12:10 +08:00
parent 0343aeb2a4
commit 2fb0da3cd7

View File

@@ -77,7 +77,7 @@
:show-minus="false" :show-minus="false"
class="ml10 mr10" class="ml10 mr10"
@focus="focusStep" @focus="focusStep"
@blur="blurStep(dutyItem)" @blur="blurStep(dutyItem, index)"
@change=" @change="
dutyStepperChange( dutyStepperChange(
item.calFactorLst[riskFactorIndex].rules[dutyItemIndex].defaultDutyAmt, item.calFactorLst[riskFactorIndex].rules[dutyItemIndex].defaultDutyAmt,
@@ -163,7 +163,7 @@
:show-minus="false" :show-minus="false"
class="ml10 mr10" class="ml10 mr10"
@focus="focusStep" @focus="focusStep"
@blur="blurStep(dutyItem)" @blur="blurStep(dutyItem, index)"
@change=" @change="
dutyStepperChange( dutyStepperChange(
item.calFactorLst[riskFactorIndex].rules[dutyItemIndex].defaultDutyAmt, item.calFactorLst[riskFactorIndex].rules[dutyItemIndex].defaultDutyAmt,
@@ -216,7 +216,7 @@
class="ml10 mr10" class="ml10 mr10"
:disabled="dutyItem.changeWithMainRisk === true ? 'disabled' : ''" :disabled="dutyItem.changeWithMainRisk === true ? 'disabled' : ''"
@focus="focusStep" @focus="focusStep"
@blur="blurStep(dutyItem)" @blur="blurStep(dutyItem, index)"
@change=" @change="
dutyStepperChange( dutyStepperChange(
item.calFactorLst[riskFactorIndex].rules[dutyItemIndex].defaultDutyAmt, item.calFactorLst[riskFactorIndex].rules[dutyItemIndex].defaultDutyAmt,
@@ -407,25 +407,52 @@ export default {
// } // }
// }) // })
// } // }
//保存险种编号 //保存主险险种编号
if (item.isMainRisk == 0) {
this.mainRiskCode = item.mainRiskCode this.mainRiskCode = item.mainRiskCode
}
}) })
//GFRS_M0016需要展示免赔额和赔付比例并需要根据是否有社保调整数值 //GFRS_M0016需要展示免赔额和赔付比例并需要根据是否有社保调整数值
// let mainRiskCode = chooseProducts[0].mainRiskCode // let mainRiskCode = chooseProducts[0].mainRiskCode
this.chooseProducts.map(item => { // eslint-disable-next-line no-unused-vars
if (item.mainRiskCode === 'GFRS_M0016') { this.dogetLimitAndGetRate().then(res => {
if (this.chooseProducts[0].influences && this.chooseProducts[0].influences.length > 0) {
this.influences = this.chooseProducts[0].influences
this.chooseProducts[0].influences.forEach(item => {
this.influenceAddRiskCodes.push(item.productCode)
})
}
this.mainRiskInfluenceAddRisk()
//初始化数据试算
this.getTrial()
})
},
//特殊处理 GFRS_M0016 GFRS_A0004 GFRS_A0005 赔付比例处理
async dogetLimitAndGetRate() {
const orderNo = localStorage.getItem('orderNo') const orderNo = localStorage.getItem('orderNo')
let detailPromise = this.isFrom === 'proposal' ? new Promise(r => r(localStorage.getItem('proposalMedical'))) : getOrderDetail({ orderNo }) let detailPromise = this.isFrom === 'proposal' ? new Promise(r => r(localStorage.getItem('proposalMedical'))) : await getOrderDetail({ orderNo })
detailPromise.then(res => { this.chooseProducts.map(item => {
if (!(item.mainRiskCode === 'GFRS_M0016' || item.productCode === 'GFRS_A0004' || item.productCode === 'GFRS_A0005')) {
//其他产品删掉两个字段
let calFactorLst = item.calFactorLst
for (let i = calFactorLst.length - 1; i >= 0; i--) {
let item = calFactorLst[i]
if (item.code === 'getLimit' || item.code === 'getRate') {
calFactorLst.splice(i, 1)
}
}
return
}
if (item.mainRiskCode === 'GFRS_M0016' || item.productCode === 'GFRS_A0004') {
let isMedical = null let isMedical = null
if (this.isFrom === 'proposal') { if (this.isFrom === 'proposal') {
isMedical = res === '1' isMedical = detailPromise === '1'
} else { } else {
isMedical = res.orderDTO.insuredDTOs[0].medical === '0' isMedical = detailPromise.orderDTO.insuredDTOs[0].medical === '0'
} }
//根据社保写死两个字段 赔付比例和免赔额 //根据社保写死两个字段 赔付比例和免赔额
item.calFactorLst.map(i => { item.calFactorLst.map(i => {
//免赔额 if (item.mainRiskCode === 'GFRS_M0016') {
if (i.code === 'getLimit') { if (i.code === 'getLimit') {
const text = isMedical ? '0元意外医疗' : '100元意外医疗' const text = isMedical ? '0元意外医疗' : '100元意外医疗'
const value = isMedical ? '0' : '100' const value = isMedical ? '0' : '100'
@@ -451,38 +478,46 @@ export default {
i.getRate = value i.getRate = value
i.columns = [{ text, value }] i.columns = [{ text, value }]
} }
} else if (item.productCode === 'GFRS_A0004') {
if (i.code === 'getLimit') {
const text2 = isMedical ? '0元住院医疗' : '100元住院医疗'
const value2 = isMedical ? '0' : '100'
//保存数据
this.medicalInfo = this.medicalInfo || {}
this.medicalInfo.getLimit = text2
i.showContent = text2
i.getLimit = value2
i.columns = [{ text2, value2 }]
}
//赔付比例
if (i.code === 'getRate') {
const text = isMedical ? '80%(住院医疗)' : '60%(住院医疗)'
const value = isMedical ? '0.8' : '0.6'
//保存数据
this.medicalInfo = this.medicalInfo || {}
this.medicalInfo.getRate = text
i.showContent = text
i.getRate = value
i.columns = [{ text, value }]
}
} else if (item.productCode === 'GFRS_A0005') {
// 设置默认值?
}
}) })
this.$forceUpdate() this.$forceUpdate()
})
} else {
//其他产品删掉两个字段
let calFactorLst = item.calFactorLst
for (let i = calFactorLst.length - 1; i >= 0; i--) {
let item = calFactorLst[i]
if (item.code === 'getLimit' || item.code === 'getRate') {
calFactorLst.splice(i, 1)
}
}
} }
}) })
// this.influenceAddRiskCodes
if (this.chooseProducts[0].influences && this.chooseProducts[0].influences.length > 0) {
this.influences = this.chooseProducts[0].influences
this.chooseProducts[0].influences.forEach(item => {
this.influenceAddRiskCodes.push(item.productCode)
})
}
this.mainRiskInfluenceAddRisk()
//初始化数据试算
this.getTrial()
}, },
// 责任保额份数变化 // 责任保额份数变化
dutyStepperChange(value, productIndex, calFactorIndex, dutyItemIndex, isChecked, min, max) { dutyStepperChange(value, productIndex, calFactorIndex, dutyItemIndex, isChecked, min, max) {
//这个险种使用其他验证方式 //这个险种使用其他验证方式
if (this.mainRiskCode === 'GFRS_M0016') return if (this.chooseProducts[productIndex].productCode === 'GFRS_M0016') return
// 004险种其他验证方式
if (this.chooseProducts[productIndex].productCode === 'GFRS_A0004') return
if (this.chooseProducts[productIndex].productCode === 'GFRS_A0003') { if (this.chooseProducts[productIndex].productCode === 'GFRS_A0003') {
this.getTrial() this.getTrial()
return return
@@ -594,15 +629,20 @@ export default {
].rules[dutyItemIndex]['necess'] ].rules[dutyItemIndex]['necess']
return false return false
} }
this.valiAndSend(dutyItem) this.valiAndSend(dutyItem, productIndex)
}, },
valiAndSend(dutyItem) { valiAndSend(dutyItem, productIndex) {
//验证责任 //验证责任
let validateRiskCode = this.chooseProducts[productIndex].productCode
let showHint = this.chooseProducts[productIndex].hint
let inputValue = dutyItem.defaultDutyAmt, let inputValue = dutyItem.defaultDutyAmt,
duty = dutyItem.duty duty = dutyItem.duty
if (this.mainRiskCode === 'GFRS_M0016' && !this.valiDuty(inputValue, duty)) { if (validateRiskCode === 'GFRS_M0016' && !this.valiDuty(inputValue, duty)) {
//验证不通过 //验证不通过
return return
} else if (validateRiskCode === 'GFRS_A0004' && duty == '210100' && !this.valiA0004Duty(inputValue, showHint, dutyItem)) {
//验证不通过 险种为GFRS_A0004 责任编码为320205
return
} else { } else {
this.mainRiskInfluenceAddRisk() this.mainRiskInfluenceAddRisk()
this.getTrial() this.getTrial()
@@ -612,13 +652,13 @@ export default {
focusStep() { focusStep() {
this.nextStepFlag = true this.nextStepFlag = true
}, },
blurStep(dutyItem) { blurStep(dutyItem, productIndex) {
this.nextStepFlag = false this.nextStepFlag = false
//失去焦点时做验证 //失去焦点时做验证
if (dutyItem.necess) { if (dutyItem.necess) {
//勾选时才做验证 //勾选时才做验证
this.valiAndSend(dutyItem) this.valiAndSend(dutyItem, productIndex)
} }
}, },
//险种GFRS_M0016的责任的验证规则 //险种GFRS_M0016的责任的验证规则
@@ -638,6 +678,27 @@ export default {
} }
} }
}, },
//险种 GFRS_A0004 险种验证规则
valiA0004Duty(value, showHint, currentEle) {
// 保额只能为5000 10000 15000 200000
if (currentEle.duty == '210100') {
if (!(value == '0.5' || value == '1' || value == '1.5' || value == '2')) {
this.$toast(showHint)
this.nextStepFlag = true
return false
}
if (this.mainRiskCode === 'GFRS_M0005') {
if (!(value == '0.5' || value == '1')) {
this.$toast(showHint)
this.nextStepFlag = true
return false
}
}
this.nextStepFlag = false
return true
}
return true
},
/********start 通用规则、特殊规则处理 start******/ /********start 通用规则、特殊规则处理 start******/
//通用规则1交费方式为一次交情无交费期限 //通用规则1交费方式为一次交情无交费期限
hiddenPayEndYear(currentEle) { hiddenPayEndYear(currentEle) {
@@ -1183,6 +1244,25 @@ export default {
} }
} }
//GFRS_A0004需要验证责任
for (let m = 0; m < this.chooseProducts.length; m++) {
if (this.chooseProducts[m].productCode == 'GFRS_A0004') {
let showHint = this.chooseProducts[m].hint
let calFactorLst = this.chooseProducts[m].calFactorLst
for (let i = 0; i < calFactorLst.length; i++) {
if (calFactorLst[i].code === 'dutyGroup') {
let duties = calFactorLst[i].rules
for (let j = 0; j < duties.length; j++) {
let item = duties[j]
if (!this.valiA0004Duty(item.defaultDutyAmt, showHint, item)) {
return
}
}
}
}
}
}
//组装险种提交数据 //组装险种提交数据
let [mainRiskCode, riskDTOLst] = ['', []] let [mainRiskCode, riskDTOLst] = ['', []]
let rollInResult = '' //校验预计转入保费结果 let rollInResult = '' //校验预计转入保费结果