diff --git a/src/views/ebiz/common/CalculatePremium.vue b/src/views/ebiz/common/CalculatePremium.vue index 9f3459779..593b5f604 100644 --- a/src/views/ebiz/common/CalculatePremium.vue +++ b/src/views/ebiz/common/CalculatePremium.vue @@ -48,7 +48,7 @@ :show-plus="false" :show-minus="false" class="ml30" - @change="stepperChange(item.calFactorLst[riskFactorIndex].defaultValue, index, riskFactorIndex, (riskFactor.minAmt || riskFactor.minPrem), (riskFactor.maxAmt || riskFactor.maxPrem) )" + @change="stepperChange(item.calFactorLst[riskFactorIndex].defaultValue, index, riskFactorIndex, (riskFactor.minAmt || riskFactor.minPrem), (riskFactor.maxAmt || riskFactor.maxPrem),riskFactor )" input-width="100" :integer="false" /> @@ -782,21 +782,67 @@ export default { }) }, //保额份数变化 - stepperChange(defalutValue, productIndex, calFactorIndex, min, max) { + stepperChange(defalutValue, productIndex, calFactorIndex, min, max, riskFactor) { + console.log(defalutValue, productIndex, calFactorIndex, min, max) + console.log(this.saleInsuredPersonInfo.age) + console.log(riskFactor) + console.log(JSON.parse(localStorage.trialList)[0].productCode) // debugger let currentEle = this.chooseProducts[productIndex].calFactorLst[calFactorIndex] - if (Number(this.defalutAmt) < Number(min) || Number(this.defalutAmt) > Number(max)) { - this.$toast(localStorage.hint) - this.nextStepFlag = true + + //改动原因:孝心保产品有对年龄的特殊要求 + //添加判断,是否是孝心保产品 + if (JSON.parse(localStorage.trialList)[0].productCode == 'GFRS_M0014') { + //被保人年龄如果在50-65区间 + if (this.saleInsuredPersonInfo.age >= 50 && this.saleInsuredPersonInfo.age <= 65) { + //使用rules规则里的第二条控制保额份数 + if (Number(this.defalutAmt) < Number(riskFactor.rules[1].minPrem) || Number(this.defalutAmt) > Number(riskFactor.rules[1].maxPrem)) { + this.$toast(localStorage.hint) + this.nextStepFlag = true + } else { + if ((Number(this.defalutAmt) * 10000) % (Number(currentEle.limit) * 10000) != 0) { + // this.defalutAmt = currentEle.rules[productIndex].displayAmount + this.$toast(localStorage.hint) + this.nextStepFlag = true + } else { + this.mainRiskInfluenceAddRisk() + currentEle['amt'] = Number(this.defalutAmt) * Number(currentEle.moneyUnit) + this.getTrial() + } + } + //被保人年龄如果在66-75之间 + } else if (this.saleInsuredPersonInfo.age >= 66 && this.saleInsuredPersonInfo.age <= 75) { + //使用rules规则里的第一条控制保额份数 + if (Number(this.defalutAmt) < Number(riskFactor.rules[0].minPrem) || Number(this.defalutAmt) > Number(riskFactor.rules[0].maxPrem)) { + this.$toast(localStorage.hint) + this.nextStepFlag = true + } else { + if ((Number(this.defalutAmt) * 10000) % (Number(currentEle.limit) * 10000) != 0) { + // this.defalutAmt = currentEle.rules[productIndex].displayAmount + this.$toast(localStorage.hint) + this.nextStepFlag = true + } else { + this.mainRiskInfluenceAddRisk() + currentEle['amt'] = Number(this.defalutAmt) * Number(currentEle.moneyUnit) + this.getTrial() + } + } + } + //其他产品按照原先的逻辑判断 } else { - if ((Number(this.defalutAmt) * 10000) % (Number(currentEle.limit) * 10000) != 0) { - // this.defalutAmt = currentEle.rules[productIndex].displayAmount + if (Number(this.defalutAmt) < Number(min) || Number(this.defalutAmt) > Number(max)) { this.$toast(localStorage.hint) this.nextStepFlag = true } else { - this.mainRiskInfluenceAddRisk() - currentEle['amt'] = Number(this.defalutAmt) * Number(currentEle.moneyUnit) - this.getTrial() + if ((Number(this.defalutAmt) * 10000) % (Number(currentEle.limit) * 10000) != 0) { + // this.defalutAmt = currentEle.rules[productIndex].displayAmount + this.$toast(localStorage.hint) + this.nextStepFlag = true + } else { + this.mainRiskInfluenceAddRisk() + currentEle['amt'] = Number(this.defalutAmt) * Number(currentEle.moneyUnit) + this.getTrial() + } } } // let currentEle = this.chooseProducts[this.productIndex].calFactorLst[this.calFactorIndex] diff --git a/src/views/ebiz/common/SelectedProduct.vue b/src/views/ebiz/common/SelectedProduct.vue index 5924ec6f9..133735de5 100644 --- a/src/views/ebiz/common/SelectedProduct.vue +++ b/src/views/ebiz/common/SelectedProduct.vue @@ -240,13 +240,13 @@ export default { let routerUrl if (localStorage.isFrom == 'proposal') { routerUrl = '/proposal/chooseInsuredPerson' - let index = this.$route.query.proposalEdit == '1' ? '-1' : '-2' + let page = this.$route.query.proposalEdit == '1' ? '-1' : '-2' this.$jump({ flag: 'goBack', extra: { refresh: '1', - index + index:page }, routerInfo: { path: routerUrl