解决和文奇的冲突

This commit is contained in:
liyuetong
2021-09-30 10:32:18 +08:00
parent 2e085b6136
commit da4f68673c

View File

@@ -23,6 +23,7 @@
<div v-if="(item.isRemit == 1 && isTrial == '1') || (item.isRemit == 1 && isTrial != '1' && item.isMainRisk == 1)">
<!-- <div v-if="item.isRemit == 1 && isTrial == '1'"> -->
<div v-for="(riskFactor, riskFactorIndex) in item.calFactorLst" :key="riskFactorIndex">
<!--riskFactor.type 1输入框和步进器 0 下拉选 -->
<div class="flex justify-content-s pv10 border-bottom" v-if="riskFactor.type == 1">
<div class="flex align-items-c">
<span v-if="riskFactor.suffix" class="fs14">{{ riskFactor.name + '(' + riskFactor.suffix + ')' }}</span>
@@ -51,9 +52,10 @@
/>
</div>
</div>
<!-- //主险的交费期间联动国富人寿附加两全(GFRS_A0011)保险的交费期间 -->
<div
class="flex justify-content-s pv10 border-bottom"
v-if="riskFactor.type == 0"
v-if="riskFactor.type == 0 && item.productCode != 'GFRS_A0011'"
:class="{ hidden: riskFactor.code == 'payEndYear' && item.isHidden }"
>
<van-field
@@ -65,6 +67,22 @@
@click="toSelect(index, riskFactorIndex, riskFactor.columns)"
/>
</div>
<div
class="flex justify-content-s pv10 border-bottom"
v-else-if="riskFactor.type == 0 && item.productCode == 'GFRS_A0011'"
:class="{ hidden: riskFactor.code == 'payEndYear' && item.isHidden }"
>
<van-field
v-if="riskFactor.code != 'payEndYear'"
v-model="riskFactor.showContent"
readonly
:label="riskFactor.name"
right-icon="arrow"
placeholder="请选择"
@click="toSelect(index, riskFactorIndex, riskFactor.columns)"
/>
<van-field v-if="riskFactor.code == 'payEndYear'" v-model="riskFactor.showContent" readonly :label="riskFactor.name" />
</div>
<div class="border-bottom renewalWrappser fs14" v-if="riskFactor.type == 4 && !renewalShow(mainRiskCode)">
<span>{{ riskFactor.name }}</span>
<van-radio-group class="renewal" v-model="renewal" direction="horizontal">
@@ -1357,6 +1375,7 @@ export default {
})
}
}
//之所以catch是因为有些参数值不存在导致报错豁免险除国富人寿附加投保人豁免保险费定期寿险B款保险条款 GFRS_A0007试算拼参数时amt保额都重置为null
if (this.chooseProducts[itemRemitIndex].productCode == 'GFRS_A0001' || this.chooseProducts[itemRemitIndex].productCode == 'GFRS_A0007') {
try {
if (mainRiskInfo.inputPrem.displayAmount && mainRiskInfo.inputPrem.moneyUnit) {
@@ -1387,6 +1406,22 @@ export default {
item.amt = trialList[0].prem
}
item.defaultDutyAmt = (Number(item.amt) / item.moneyUnit).toFixed(6)
// 国富人寿附加投保人豁免保险费定期寿险B款保险条款 GFRS_A0007
// 保额----豁免主险+附加两全的保费
// 国富人寿附加两全保险条款 GFRS_A0011
//重新再调一次试算因保额为文本框没有change事件所以保额变化后少一次调用试算所以特此手动重新调用一次
let trialList = JSON.parse(localStorage.trialList)
let showPrem
trialList.forEach((item, index) => {
if (item.productCode == 'GFRS_A0011') {
showPrem = item.showPrem //获取两全险的保费
}
})
if (this.chooseProducts[itemRemitIndex].productCode == 'GFRS_A0007' && showPrem) {
item.amt = trialList[0].prem + showPrem
item.defaultValue = trialList[0].prem + showPrem
}
}
})
}
@@ -1425,15 +1460,15 @@ export default {
if (this.trialList.length) {
let showPrem //计算后的保费
let showPrem001 //两全险的保费
this.chooseProducts.forEach((item, index) => {
//(被保险人)国富人寿附加豁免保险费重大疾病保险(B款GFRS_A0010
//(投保人)国富人寿附加豁免保险费重大疾病保险(B款 GFRS_A0009
//国富人寿附加两全保险条款 GFRS_A0011
//只有在搭配附加两全时才能搭配被保险人附加豁免重疾B;
//获取两全险的保费
//(被保险人)国富人寿附加豁免保险费重大疾病保险(B款GFRS_A0010
//(投保人)国富人寿附加豁免保险费重大疾病保险(B款 GFRS_A0009
//国富人寿附加两全保险条款 GFRS_A0011
//只有在搭配附加两全时才能搭配被保险人附加豁免重疾B;
//获取两全险的保费
let showPrem001
this.trialList.forEach((item, index) => {
if (item.productCode == 'GFRS_A0011') {
showPrem001 = that.trialList[index].showPrem
showPrem001 = item.showPrem //获取两全险的保费
}
})
this.chooseProducts.forEach((item, index) => {
@@ -1468,6 +1503,26 @@ export default {
})
}
},
//获取当前产品编码下的索引值
getProductCodeIndex(productCode) {
let remitIndex = ''
this.chooseProducts.forEach((item, index) => {
if (item.productCode == productCode) {
remitIndex = index
}
})
return remitIndex
},
//获取当前产品编码下的整条数据
getProductCodeItem(productCode) {
let remitItem = {}
this.chooseProducts.forEach((item, index) => {
if (item.productCode == productCode) {
remitItem = item
}
})
return remitItem
},
getRemitIndex() {
let remitIndex = []
this.chooseProducts.forEach((item, index) => {
@@ -1682,18 +1737,40 @@ export default {
this.nextStepFlag = false
}
}
this.againGetTrial()
} else {
this.nextStepFlag = true
this.$toast(resultData.resultMessage)
}
localStorage.chooseProducts = JSON.stringify(this.chooseProducts)
},
//重新再调一次试算因保额为文本框没有change事件所以保额变化后少一次调用试算所以特此手动重新调用一次
async againGetTrial() {
// ---------国富人寿附加两全保险条款---
let getProductCodeIndex = this.getProductCodeIndex('GFRS_A0007')
if (getProductCodeIndex !='') { //是否有两全
let params = this.getParams()
let resultData01 = await trial(params)
if (resultData01.result == 0) {
if (resultData01.flag === '1') {
this.richChildrenFlag = true
}
this.trialList = resultData01.trialList
localStorage.trialList = JSON.stringify(resultData01.trialList)
//设置豁免险保额
this.setRemitRisk()
this.nextStepFlag = false
} else {
this.nextStepFlag = true
this.$toast(resultData01.resultMessage)
}
}
},
//获取试算参数
getParams() {
let params = {
trialInfos: []
}
this.chooseProducts.forEach((item) => {
let trialInfo = {}
item.calFactorLst.forEach((factor) => {
@@ -1714,7 +1791,13 @@ export default {
: Number(factor.displayAmount) * Number(factor.moneyUnit)
} else {
if (item.isRemit == 0) {
trialInfo['amt'] = null
if (item.productCode == 'GFRS_A0007') {
if (factor.code == 'amt') {
trialInfo['amt'] = factor.amt
}
} else {
trialInfo['amt'] = null
}
} else {
trialInfo['amt'] = Number(factor.displayAmount) * Number(factor.moneyUnit)
}