diff --git a/src/views/ebiz/common/AddRiskList.vue b/src/views/ebiz/common/AddRiskList.vue index 79fa868d2..668f6dc67 100644 --- a/src/views/ebiz/common/AddRiskList.vue +++ b/src/views/ebiz/common/AddRiskList.vue @@ -19,6 +19,8 @@ import { Cell, CellGroup, Tag, Radio, RadioGroup } from 'vant' import { calculatePremium } from '@/api/ebiz/common/common' import riskRules from './risk-rules' +import { getAgentInfo } from '@/api/ebiz/my/my.js' + export default { name: 'addtionRiskList', components: { @@ -30,6 +32,7 @@ export default { }, data() { return { + branchTypeVal: '', //个险渠道G 中介渠道Z list: [], result: '', saleInsuredPersonInfo: null //投保人信息 @@ -40,7 +43,14 @@ export default { if (this.$CacheUtils.getLocItem('saleInsuredPersonInfo')) { this.saleInsuredPersonInfo = JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')) } - + 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.filterAddRisk() }, methods: { @@ -49,9 +59,18 @@ export default { if (localStorage.addtionRiskLst) { let addRiskCodes = localStorage.addRiskCodes && JSON.parse(localStorage.addRiskCodes) let addtionRiskLst = JSON.parse(localStorage.addtionRiskLst) + let currentMainRiskInfo = this.getCurrentMainRiskInfo() addtionRiskLst.forEach(item => { if (addRiskCodes.includes(item.productCode)) { item.isHidden = 1 + } else { + if ( + currentMainRiskInfo.mainRiskPayEndYearFlag == 'Y' && + currentMainRiskInfo.mainRiskPayEndYear == '1000' && + (item.productCode == 'GFRS_A0007' || item.productCode == 'GFRS_A0009') + ) { + item.isHidden = 1 + } } }) this.list = addtionRiskLst @@ -80,13 +99,13 @@ export default { let ruleExpression = localStorage.ruleExpression ? JSON.parse(localStorage.ruleExpression) : {} ruleExpression[resultData.productCode] = resultData.productTrialInfoDTO.ruleExpression localStorage.ruleExpression = JSON.stringify(ruleExpression) - let ttThis = this; + let ttThis = this for (let item of ruleExpression[resultData.productCode]) { let config = JSON.parse(item.ruleExpression) switch (config.eventType) { case 'loadFormat': let initFn = new Function(...config.funPar, config.funBody.join('')) - let str = initFn.call(ttThis,resultData) + let str = initFn.call(ttThis, resultData) if (str) { return this.$toast(str) } @@ -283,6 +302,7 @@ export default { let remitTypeLimit = resultData.productTrialInfoDTO.remitTypeLimit let relationToAppnt = this.saleInsuredPersonInfo.relationToAppnt let currentMainRiskInfo = this.getCurrentMainRiskInfo() + let productCode = resultData.productCode if (relationToAppnt == 1 && remitType == '0' && !remitTypeLimit) { this.$toast('投被同人不能选取此款险种!') return true @@ -295,11 +315,20 @@ export default { this.$toast('目前主险交费期间类型,不适合选取此款险种!') return true } + // branchTypeVal: '', //个险渠道G 中介渠道Z + //国富人寿附加投保人豁免保险费定期寿险(B款) GFRS_A0007 + //国富人寿附加豁免保险费重大疾病保险(B款) GFRS_A0009 + if (this.branchTypeVal == 'Z' && (productCode == 'GFRS_A0007' || productCode == 'GFRS_A0009')) { + if (relationToAppnt == 1) { + this.$toast('投被同人不能选取此款险种!') + return true + } + } return false }, //获取主险的保险期间、交费方式 getCurrentMainRiskInfo() { - let mainRiskPayIntv, mainRiskPayEndYearFlag + let mainRiskPayIntv, mainRiskPayEndYearFlag, mainRiskPayEndYear let chooseProducts = JSON.parse(localStorage.chooseProducts) chooseProducts[0].calFactorLst.forEach(item => { if (item.code == 'payIntv') { @@ -307,11 +336,13 @@ export default { } if (item.code == 'payEndYear') { mainRiskPayEndYearFlag = item.payEndYearFlag + mainRiskPayEndYear = item.payEndYear } }) return { mainRiskPayIntv, - mainRiskPayEndYearFlag + mainRiskPayEndYearFlag, + mainRiskPayEndYear } }, //页面跳转 diff --git a/src/views/ebiz/common/CalculatePremium.vue b/src/views/ebiz/common/CalculatePremium.vue index 5444a91db..9fd31ddfa 100644 --- a/src/views/ebiz/common/CalculatePremium.vue +++ b/src/views/ebiz/common/CalculatePremium.vue @@ -75,7 +75,9 @@