【fix】 修复 国富人寿附加豁免保险费重大疾病保险在试算页面,责任取保费时,数值取错的问题

This commit is contained in:
tian.guangyuan
2020-04-29 10:40:37 +08:00
parent 591a1d86d9
commit 275674c776

View File

@@ -109,9 +109,9 @@
<div v-for="(riskFactor, riskFactorIndex) in item.calFactorLst" :key="riskFactorIndex">
<div class="flex justify-content-s pv10 border-bottom" v-if="riskFactor.type == 1">
<div class="flex align-items-c">
<span v-if="item.productTrialYearDTOS[payEndYearColumnsIndex].suffix" class="fs14">{{
riskFactor.name + '(' + item.productTrialYearDTOS[payEndYearColumnsIndex]['suffix'] + ')'
}}</span>
<span v-if="item.productTrialYearDTOS[payEndYearColumnsIndex].suffix" class="fs14">
{{ riskFactor.name + '(' + item.productTrialYearDTOS[payEndYearColumnsIndex]['suffix'] + ')' }}
</span>
<span v-else class="fs14">{{ riskFactor.name }} &nbsp;&nbsp; &nbsp;&nbsp;</span>
<van-stepper
v-model="item.productTrialYearDTOS[payEndYearColumnsIndex].displayAmount"
@@ -261,8 +261,9 @@
<span
style="font-weight:bold"
v-if="(trialList.length > 0 && trialList[index].trialType == 0) || (trialList.length > 0 && trialList[index].trialType == 2) || isTrial === '0'"
>首期保费</span
>
首期保费
</span>
<span style="font-weight:bold" v-else>保额</span>
<span class="fee red" v-if="trialList && trialList.length > 0">{{ trialList[index].showPrem.toFixed(2) | moneyFormat }}</span>
</div>
@@ -273,16 +274,14 @@
<van-action-sheet v-model="show" cancel-text="取消" :actions="policyInfo" @select="openDocument" />
<!-- 字段选择 -->
<van-popup v-model="popupShow" position="bottom">
<van-picker show-toolbar :columns="columns" @confirm="onConfirm" @cancel="onCancel" />
</van-popup>
<van-popup v-model="popupShow" position="bottom"><van-picker show-toolbar :columns="columns" @confirm="onConfirm" @cancel="onCancel"/></van-popup>
</div>
</template>
<script>
import { Tag, Icon, Dialog, ActionSheet, Popup, Picker, Stepper, Field, Checkbox } from 'vant'
import { trial } from '@/api/ebiz/common/common'
import { saveOrUpdateOrderInfo, getOrderDetail } from '@/api/ebiz/sale/sale'
import { saveProposal, getDemo } from '@/api/ebiz/proposal/proposal.js'
import { saveProposal } from '@/api/ebiz/proposal/proposal.js'
//险种GFRS_M0016的责任的验证规则
//默认 最低基本保险金额min 10000 整数倍要求mutiple 1000
@@ -408,7 +407,7 @@ export default {
this.saleInsuredPersonInfo = JSON.parse(localStorage.saleInsuredPersonInfo)
}
//构建提交数据、渲染险种
let chooseProducts = (this.chooseProducts = JSON.parse(localStorage.chooseProducts))
this.chooseProducts = JSON.parse(localStorage.chooseProducts)
this.chooseProducts.map(item => {
if (item.mainRiskCode == 'GFRS_M0006') {
item.isHidden = true
@@ -416,7 +415,7 @@ export default {
if (item.mainRiskCode != 'GFRS_M0008') {
item.calFactorLst.map(i => {
// this.defalutAmt = i.displayAmount || 1
if(i.code == 'inputPrem'){
if (i.code == 'inputPrem') {
this.mult = Math.ceil(Number(i.displayAmount) / Number(i.defaultValue))
}
})
@@ -470,19 +469,19 @@ export default {
//初始化数据试算
this.getTrial()
})
// 判断是否 含有 后台配置js验证函数
if(localStorage.ruleExpression){
let ruleExpression = JSON.parse(localStorage.ruleExpression);
if (localStorage.ruleExpression) {
let ruleExpression = JSON.parse(localStorage.ruleExpression)
this.ruleExpression = ruleExpression
let productCodes = Object.keys(ruleExpression)
productCodes.forEach(itemKey => {
// console.log(ruleExpression[itemKey]);
let rules = ruleExpression[itemKey];
rules.eventList = [];
rules.forEach( item => {
let rules = ruleExpression[itemKey]
rules.eventList = []
rules.forEach(item => {
let config = ''
config = JSON.parse(item.ruleExpression);
config = JSON.parse(item.ruleExpression)
// let errorMsg = item.errorMsg;
// config = {
// eventName: 'GFRS_M0020_payEndYear_insuYear',
@@ -537,7 +536,7 @@ export default {
// '}'],
// funPar: ['par','ParKey','Par'],
// }
// console.log("config",config);
// console.log("config",config);
// config = {
// eventName: 'GFRS_A0003_noMainCode',
// eventType: 'init',
@@ -569,9 +568,9 @@ export default {
// ],
// funPar:['dutyItem', 'mainRiskCode'],
// }
this.$on(config.eventName, new Function( ...config.funPar, config.funBody.join('')));
if(config.eventType == 'init'){
let initFn = new Function('that', config.initBody.join(''));
this.$on(config.eventName, new Function(...config.funPar, config.funBody.join('')))
if (config.eventType == 'init') {
let initFn = new Function('that', config.initBody.join(''))
initFn(this)
}
rules.eventList.push(config.eventName)
@@ -726,7 +725,7 @@ export default {
return false
}
// console.log("productCode ==>" , productCode)
// if(this.ruleExpression[productCode]){
// this.errorMsg = []
// this.ruleExpression[productCode].eventList.forEach(item => {
@@ -739,28 +738,28 @@ export default {
// }
// }
let productCode = this.chooseProducts[this.productIndex].productCode
if(this.ruleExpression[productCode]){
if (this.ruleExpression[productCode]) {
this.errorMsg = []
let currentFactor = this.chooseProducts[this.productIndex].calFactorLst
let currentEle = currentFactor[this.calFactorIndex]
this.ruleExpression[productCode].eventList.forEach(item => {
this.$emit(item,currentFactor,currentEle.code,value);
this.$emit(item, currentFactor, currentEle.code, value)
})
if(this.errorMsg.length > 0){
this.$toast(this.errorMsg[0]);
if (this.errorMsg.length > 0) {
this.$toast(this.errorMsg[0])
this.errorMsg = []
this.popupShow = false
return false
}
}
// 后台配置 的 js函数 验证
// if(hasR){
// if(currentEle.code == 'payEndYear' || currentEle.code == 'insuYear'){
// this.payEndYear(currentEle.code,value.value,this.tmpInsuYear.insuYear + this.tmpInsuYear.insuYearFlag)
// }
// }
currentEle.showContent = value.text
let name = currentEle.code
currentEle[name] = value.value
@@ -1072,12 +1071,17 @@ export default {
item.showContent = mainRiskInfo.insuYear.showContent
}
if (item.code == 'dutyGroup') {
let trialList = JSON.parse(localStorage.trialList)
item.rules.forEach(v => {
v.amt = trialList[0].prem
v.defaultDutyAmt = (Number(trialList[0].prem) / 10000).toFixed(6)
v.moneyUnit = 10000
v.suffix = '万元'
try {
v.amt = mainRiskInfo.inputPrem.displayAmount * mainRiskInfo.inputPrem.moneyUnit
} catch (e) {
let trialList = JSON.parse(localStorage.trialList)
v.amt = trialList[0].prem
// v.amt = mainRiskInfo.inputAmt.displayAmount * mainRiskInfo.inputAmt.moneyUnit
}
v.defaultDutyAmt = (Number(v.amt) / v.moneyUnit).toFixed(6)
// v.moneyUnit = 10000
// v.suffix = '万元'
})
}
}
@@ -1189,7 +1193,7 @@ export default {
trialInfos: []
}
this.chooseProducts.forEach((item, index) => {
this.chooseProducts.forEach(item => {
let trialInfo = {}
item.calFactorLst.forEach(factor => {
if (factor.type == 0) {