mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-15 03:36:43 +08:00
GFRS-729【0326】国富人寿国富民安重大疾病保险(2020版)_1 保费试算修改 --提交人:阳华祥
This commit is contained in:
@@ -77,7 +77,7 @@
|
||||
:show-minus="false"
|
||||
class="ml10 mr10"
|
||||
@focus="focusStep"
|
||||
@blur="blurStep(dutyItem)"
|
||||
@blur="blurStep(dutyItem, index)"
|
||||
@change="
|
||||
dutyStepperChange(
|
||||
item.calFactorLst[riskFactorIndex].rules[dutyItemIndex].defaultDutyAmt,
|
||||
@@ -163,7 +163,7 @@
|
||||
:show-minus="false"
|
||||
class="ml10 mr10"
|
||||
@focus="focusStep"
|
||||
@blur="blurStep(dutyItem)"
|
||||
@blur="blurStep(dutyItem, index)"
|
||||
@change="
|
||||
dutyStepperChange(
|
||||
item.calFactorLst[riskFactorIndex].rules[dutyItemIndex].defaultDutyAmt,
|
||||
@@ -216,7 +216,7 @@
|
||||
class="ml10 mr10"
|
||||
:disabled="dutyItem.changeWithMainRisk === true ? 'disabled' : ''"
|
||||
@focus="focusStep"
|
||||
@blur="blurStep(dutyItem)"
|
||||
@blur="blurStep(dutyItem, index)"
|
||||
@change="
|
||||
dutyStepperChange(
|
||||
item.calFactorLst[riskFactorIndex].rules[dutyItemIndex].defaultDutyAmt,
|
||||
@@ -407,25 +407,52 @@ export default {
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
//保存险种编号
|
||||
this.mainRiskCode = item.mainRiskCode
|
||||
//保存主险险种编号
|
||||
if (item.isMainRisk == 0) {
|
||||
this.mainRiskCode = item.mainRiskCode
|
||||
}
|
||||
})
|
||||
//GFRS_M0016需要展示免赔额和赔付比例,并需要根据是否有社保调整数值
|
||||
// let mainRiskCode = chooseProducts[0].mainRiskCode
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
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')
|
||||
let detailPromise = this.isFrom === 'proposal' ? new Promise(r => r(localStorage.getItem('proposalMedical'))) : await getOrderDetail({ orderNo })
|
||||
this.chooseProducts.map(item => {
|
||||
if (item.mainRiskCode === 'GFRS_M0016') {
|
||||
const orderNo = localStorage.getItem('orderNo')
|
||||
let detailPromise = this.isFrom === 'proposal' ? new Promise(r => r(localStorage.getItem('proposalMedical'))) : getOrderDetail({ orderNo })
|
||||
detailPromise.then(res => {
|
||||
let isMedical = null
|
||||
if (this.isFrom === 'proposal') {
|
||||
isMedical = res === '1'
|
||||
} else {
|
||||
isMedical = res.orderDTO.insuredDTOs[0].medical === '0'
|
||||
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)
|
||||
}
|
||||
//根据社保写死两个字段 赔付比例和免赔额
|
||||
item.calFactorLst.map(i => {
|
||||
//免赔额
|
||||
}
|
||||
return
|
||||
}
|
||||
if (item.mainRiskCode === 'GFRS_M0016' || item.productCode === 'GFRS_A0004') {
|
||||
let isMedical = null
|
||||
if (this.isFrom === 'proposal') {
|
||||
isMedical = detailPromise === '1'
|
||||
} else {
|
||||
isMedical = detailPromise.orderDTO.insuredDTOs[0].medical === '0'
|
||||
}
|
||||
//根据社保写死两个字段 赔付比例和免赔额
|
||||
item.calFactorLst.map(i => {
|
||||
if (item.mainRiskCode === 'GFRS_M0016') {
|
||||
if (i.code === 'getLimit') {
|
||||
const text = isMedical ? '0元(意外医疗)' : '100元(意外医疗)'
|
||||
const value = isMedical ? '0' : '100'
|
||||
@@ -451,38 +478,46 @@ export default {
|
||||
i.getRate = value
|
||||
i.columns = [{ text, value }]
|
||||
}
|
||||
})
|
||||
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)
|
||||
} 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.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) {
|
||||
//这个险种使用其他验证方式
|
||||
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') {
|
||||
this.getTrial()
|
||||
return
|
||||
@@ -594,15 +629,20 @@ export default {
|
||||
].rules[dutyItemIndex]['necess']
|
||||
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,
|
||||
duty = dutyItem.duty
|
||||
if (this.mainRiskCode === 'GFRS_M0016' && !this.valiDuty(inputValue, duty)) {
|
||||
if (validateRiskCode === 'GFRS_M0016' && !this.valiDuty(inputValue, duty)) {
|
||||
//验证不通过
|
||||
return
|
||||
} else if (validateRiskCode === 'GFRS_A0004' && duty == '210100' && !this.valiA0004Duty(inputValue, showHint, dutyItem)) {
|
||||
//验证不通过 险种为GFRS_A0004 责任编码为320205
|
||||
return
|
||||
} else {
|
||||
this.mainRiskInfluenceAddRisk()
|
||||
this.getTrial()
|
||||
@@ -612,13 +652,13 @@ export default {
|
||||
focusStep() {
|
||||
this.nextStepFlag = true
|
||||
},
|
||||
blurStep(dutyItem) {
|
||||
blurStep(dutyItem, productIndex) {
|
||||
this.nextStepFlag = false
|
||||
|
||||
//失去焦点时做验证
|
||||
if (dutyItem.necess) {
|
||||
//勾选时才做验证
|
||||
this.valiAndSend(dutyItem)
|
||||
this.valiAndSend(dutyItem, productIndex)
|
||||
}
|
||||
},
|
||||
//险种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******/
|
||||
//通用规则1:交费方式为一次交情,无交费期限
|
||||
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 rollInResult = '' //校验预计转入保费结果
|
||||
|
||||
Reference in New Issue
Block a user