diff --git a/src/views/ebiz/common/CalculatePremium.vue b/src/views/ebiz/common/CalculatePremium.vue index d2f81cb5c..822afce41 100644 --- a/src/views/ebiz/common/CalculatePremium.vue +++ b/src/views/ebiz/common/CalculatePremium.vue @@ -349,6 +349,7 @@ import { Tag, Icon, Dialog, ActionSheet, Popup, Picker, Stepper, Field, Checkbox import { trial } from '@/api/ebiz/common/common' import { saveOrUpdateOrderInfo, getOrderDetail } from '@/api/ebiz/sale/sale' import { saveProposal } from '@/api/ebiz/proposal/proposal.js' +import { getAgentInfo } from '@/api/ebiz/my/my.js' //险种GFRS_M0016的责任的验证规则 //默认 最低基本保险金额min 10000 整数倍要求mutiple 1000 @@ -433,6 +434,7 @@ export default { }, data() { return { + branchTypeVal: '', //个险渠道G 中介渠道Z isEnterAddtionRisk: true, //附加险list activeRadio: '1', // activeType: localStorage.getItem('active_type'), 现在从订单详情接口取值了 @@ -476,6 +478,14 @@ export default { } }, mounted() { + getAgentInfo({}).then(res => { + // branchType N1、1代表个险渠道 和 N5、5 代表中介渠道,N代表内勤 + if (res.branchType == 'N1' || res.branchType == '1') { + this.branchTypeVal = 'G' + } else if (res.branchType == 'N5' || res.branchType == '5') { + this.branchTypeVal = 'Z' + } + }) this.init() Array.prototype.min = function () { var min = this[0] @@ -1344,10 +1354,7 @@ export default { }) } }) - - if(this.chooseProducts[0].productCode == 'GFRS_M0035' || this.chooseProducts[0].productCode == 'GFRS_M0044' - || this.chooseProducts[0].productCode == 'GFRS_M0040' - ){ + if(this.chooseProducts[0].productCode == 'GFRS_M0035' || this.chooseProducts[0].productCode == 'GFRS_M0044' || this.chooseProducts[0].productCode == 'GFRS_M0040'|| this.chooseProducts[0].productCode == 'GFRS_M0046'){ if (this.trialList.length) { let showPrem //计算后的保费 //(被保险人)国富人寿附加豁免保险费重大疾病保险(B款)GFRS_A0010 @@ -2161,37 +2168,75 @@ export default { //isTrial为0 ---暂时为富娃娃两全保险(万能型)专配 输入保费校验 } else if (productCode == 'GFRS_M0046') { //被保险人年龄如果在50-65区间 - if (this.saleInsuredPersonInfo.age >= 51 && this.saleInsuredPersonInfo.age <= 60) { - //使用rules规则里的第二条控制保额份数 - // 年龄在51周岁及以上被保险人,投保本险种时,最低基本保险金额为10000元。超过最低基本保险金额为10000元整数倍。 - if (Number(defalutValue) < Number(riskFactor.rules[1].minPrem) || Number(defalutValue) > Number(riskFactor.rules[1].maxPrem)) { - this.$toast('51周岁-60周岁最低基本保险金额为10000元。超过最低基本保险金额为10000元整数倍。') - this.nextStepFlag = true - } else { - if ((Number(defalutValue) * 10000) % (Number(currentEle.limit) * 10000) != 0) { - // this.defalutAmt = currentEle.rules[productIndex].displayAmount - this.$toast('51周岁-60周岁最低基本保险金额为10000元。超过最低基本保险金额为10000元整数倍。') + if(this.branchTypeVal == 'Z'){ //中介渠道规则 + if (this.saleInsuredPersonInfo.age >= 51 && this.saleInsuredPersonInfo.age <= 60) { + //使用rules规则里的第二条控制保额份数 + // 年龄在51周岁及以上被保险人,投保本险种时,最低基本保险金额为10000元。超过最低基本保险金额为10000元整数倍。 + if (Number(defalutValue) < Number(riskFactor.rules[1].minPrem) || Number(defalutValue) > Number(riskFactor.rules[1].maxPrem)) { + this.$toast('51周岁-60周岁最低基本保险金额为'+ (Number(riskFactor.rules[0].minPrem) * 10000) +'元。超过最低基本保险金额为10000元整数倍。') this.nextStepFlag = true } else { - this.mainRiskInfluenceAddRisk() - currentEle['amt'] = Number(defalutValue) * Number(currentEle.moneyUnit) - this.getTrial() + if ((Number(defalutValue) * 10000) % (Number(currentEle.limit) * 10000) != 0) { + // this.defalutAmt = currentEle.rules[productIndex].displayAmount + this.$toast('51周岁-60周岁最低基本保险金额为'+ (Number(riskFactor.rules[0].minPrem) * 10000) +'元。超过最低基本保险金额为10000元整数倍。') + this.nextStepFlag = true + } else { + this.mainRiskInfluenceAddRisk() + currentEle['amt'] = Number(defalutValue) * Number(currentEle.moneyUnit) + this.getTrial() + } + } + //年龄在0-50周岁被保险人,投保本险种时,最低基本保险金额为50000元,超过最低基本保险金额为10000元整数倍。 + } else if (this.saleInsuredPersonInfo.age >= 0 && this.saleInsuredPersonInfo.age <= 50) { + //使用rules规则里的第一条控制保额份数 + if (Number(defalutValue) < Number(riskFactor.rules[0].minPrem) || Number(defalutValue) > Number(riskFactor.rules[0].maxPrem)) { + this.$toast('0周岁-50周岁最低基本保险金额为'+ (Number(riskFactor.rules[0].minPrem) * 10000) +'元。超过最低基本保险金额为10000元整数倍。') + this.nextStepFlag = true + } else { + if ((Number(defalutValue) * 10000) % (Number(currentEle.limit) * 10000) != 0) { + this.$toast('0周岁-50周岁最低基本保险金额为'+ (Number(riskFactor.rules[0].minPrem) * 10000) +'元。超过最低基本保险金额为10000元整数倍。') + this.nextStepFlag = true + } else { + this.mainRiskInfluenceAddRisk() + currentEle['amt'] = Number(defalutValue) * Number(currentEle.moneyUnit) + this.getTrial() + } } } - //年龄在0-50周岁被保险人,投保本险种时,最低基本保险金额为50000元,超过最低基本保险金额为10000元整数倍。 - } else if (this.saleInsuredPersonInfo.age >= 0 && this.saleInsuredPersonInfo.age <= 50) { - //使用rules规则里的第一条控制保额份数 - if (Number(defalutValue) < Number(riskFactor.rules[0].minPrem) || Number(defalutValue) > Number(riskFactor.rules[0].maxPrem)) { - this.$toast('0周岁-50周岁最低基本保险金额为50000元。超过最低基本保险金额为10000元整数倍。') - this.nextStepFlag = true - } else { - if ((Number(defalutValue) * 10000) % (Number(currentEle.limit) * 10000) != 0) { - this.$toast('0周岁-50周岁最低基本保险金额为50000元。超过最低基本保险金额为10000元整数倍。') + }else if(this.branchTypeVal == 'G'){ //个险渠道规则 + //被保险人年龄如果在50-65区间 + if (this.saleInsuredPersonInfo.age >= 56 && this.saleInsuredPersonInfo.age <= 60) { + //使用rules规则里的第二条控制保额份数 + // 年龄在51周岁及以上被保险人,投保本险种时,最低基本保险金额为10000元。超过最低基本保险金额为10000元整数倍。 + if (Number(defalutValue) < Number(riskFactor.rules[1].minPrem) || Number(defalutValue) > Number(riskFactor.rules[1].maxPrem)) { + this.$toast('56周岁-60周岁最低基本保险金额为'+ (Number(riskFactor.rules[1].minPrem) * 10000) +'元。超过最低基本保险金额为10000元整数倍。') this.nextStepFlag = true } else { - this.mainRiskInfluenceAddRisk() - currentEle['amt'] = Number(defalutValue) * Number(currentEle.moneyUnit) - this.getTrial() + if ((Number(defalutValue) * 10000) % (Number(currentEle.limit) * 10000) != 0) { + // this.defalutAmt = currentEle.rules[productIndex].displayAmount + this.$toast('56周岁-60周岁最低基本保险金额为'+ (Number(riskFactor.rules[1].minPrem) * 10000) +'元。超过最低基本保险金额为10000元整数倍。') + this.nextStepFlag = true + } else { + this.mainRiskInfluenceAddRisk() + currentEle['amt'] = Number(defalutValue) * Number(currentEle.moneyUnit) + this.getTrial() + } + } + //年龄在0-50周岁被保险人,投保本险种时,最低基本保险金额为50000元,超过最低基本保险金额为10000元整数倍。 + } else if (this.saleInsuredPersonInfo.age >= 0 && this.saleInsuredPersonInfo.age <= 55) { + //使用rules规则里的第一条控制保额份数 + if (Number(defalutValue) < Number(riskFactor.rules[0].minPrem) || Number(defalutValue) > Number(riskFactor.rules[0].maxPrem)) { + this.$toast('0周岁-55周岁最低基本保险金额为'+ (Number(riskFactor.rules[0].minPrem) * 10000) +'元。超过最低基本保险金额为10000元整数倍。') + this.nextStepFlag = true + } else { + if ((Number(defalutValue) * 10000) % (Number(currentEle.limit) * 10000) != 0) { + this.$toast('0周岁-55周岁最低基本保险金额为'+ (Number(riskFactor.rules[0].minPrem) * 10000) +'元。超过最低基本保险金额为10000元整数倍。') + this.nextStepFlag = true + } else { + this.mainRiskInfluenceAddRisk() + currentEle['amt'] = Number(defalutValue) * Number(currentEle.moneyUnit) + this.getTrial() + } } } }