Merge branch 'feature/富娃娃+一年定寿' into dev

# Conflicts:
#	src/views/ebiz/common/CalculatePremium.vue
This commit is contained in:
mengxiaolong
2020-09-28 13:42:28 +08:00
2 changed files with 46 additions and 30 deletions

View File

@@ -275,7 +275,7 @@
首期保费
</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>
<span class="fee red" v-if="trialList && trialList.length > 0">{{ trialList[index].showPrem | moneyFormat }}</span>
</div>
</div>
<div class="bottom-btn bg-white">
@@ -390,7 +390,8 @@ export default {
// 后台配置的校验规则
ruleExpression: {},
mainRiskCode: '',
renewal: '-1'
renewal: '-1',
richChildrenFlag: false
}
},
mounted() {
@@ -464,7 +465,6 @@ export default {
item.calFactorLst.map(item2 => {
if (item2.code == 'dutyGroup') {
item2.rules.map(item3 => {
console.log(item3)
if (item3.duty == '320205') {
item3.maxDutyAmt = '1'
}
@@ -495,7 +495,6 @@ export default {
this.ruleExpression = ruleExpression
let productCodes = Object.keys(ruleExpression)
productCodes.forEach(itemKey => {
// console.log(ruleExpression[itemKey]);
let rules = ruleExpression[itemKey]
rules.eventList = []
rules.forEach(item => {
@@ -555,7 +554,6 @@ export default {
// '}'],
// funPar: ['par','ParKey','Par'],
// }
// console.log("config",config);
// config = {
// eventName: 'GFRS_A0003_noMainCode',
// eventType: 'init',
@@ -706,9 +704,6 @@ export default {
}
}
},
// blur(value) {
// console.log('哈哈哈',value)
// },
//弹框选择
toSelect(index, index1, columns) {
;[this.popupShow, this.productIndex, this.calFactorIndex] = [true, index, index1]
@@ -725,9 +720,6 @@ export default {
// let productCode = this.chooseProducts[this.productIndex].productCode
let currentFactor = this.chooseProducts[this.productIndex].calFactorLst
let currentEle = currentFactor[this.calFactorIndex]
console.log('value', value)
console.log('currentFactor', currentFactor)
console.log('currentEle', currentEle)
//特殊设置:如果需要填写的保费/保额校验规则跟缴费期间挂钩当改变缴费期间时将输入框的值恢复默认值1
if (currentEle.code == 'payEndYear' && this.isTrial == '0') {
@@ -738,7 +730,6 @@ export default {
})
this.defalutAmt = 1
}
console.log('payEndYearColumnsIndex == ', this.payEndYearColumnsIndex)
if (currentEle.showContent != value.text) {
//通用规则校验
@@ -754,7 +745,6 @@ export default {
this.popupShow = false
return false
}
// console.log("productCode ==>" , productCode)
// if(this.ruleExpression[productCode]){
// this.errorMsg = []
@@ -909,6 +899,9 @@ export default {
//通用规则1交费方式为一次交情无交费期限
hiddenPayEndYear(currentEle) {
if (currentEle.code == 'payIntv') {
if (this.chooseProducts[0].productCode === 'GFRS_M0015' && this.chooseProducts[this.productIndex].productCode === 'GFRS_A0006') {
return
}
this.chooseProducts[this.productIndex]['isHidden'] = currentEle.payIntv == '0' ? true : false
}
},
@@ -1050,7 +1043,6 @@ export default {
setRemitRisk() {
//1、一次性交清和交费期间单位为A时删除豁免险
let mainRiskInfo = this.getMainRiskInfo()
console.log(mainRiskInfo)
let mainRiskPayIntv = mainRiskInfo.payIntv.payIntv
let mainRiskPayEndYearFlag = mainRiskInfo.payEndYear.payEndYearFlag
if (mainRiskPayIntv == 0 || mainRiskPayEndYearFlag == 'A') {
@@ -1128,6 +1120,23 @@ export default {
}
})
}
let product = this.chooseProducts.find(item => {
return item.productCode === 'GFRS_A0006'
})
if (product) {
product.calFactorLst[0].showContent = '月交'
product.calFactorLst[2].showContent = '月交'
product.calFactorLst[0].columns[0].text = '月交'
product.calFactorLst[2].columns[0].text = '月交'
let remitProduct = this.trialList.find(item => {
return item.productCode === 'GFRS_A0006'
})
if (remitProduct) {
remitProduct.showPrem = '从万能账户中扣除'
remitProduct.prem = 0
remitProduct.payIntv = 1
}
}
},
getRemitIndex() {
let remitIndex = []
@@ -1223,8 +1232,10 @@ export default {
//试算成功,信息返显
if (resultData.result == 0) {
if (resultData.flag) {
this.richChildrenFlag = true
}
this.trialList = resultData.trialList
console.log(resultData.trialList)
localStorage.trialList = JSON.stringify(resultData.trialList)
//设置豁免险保额
this.setRemitRisk()
@@ -1287,7 +1298,6 @@ export default {
}
})
console.log('trialInfo == ', trialInfo)
//通用规则1交费方式为一次交情无交费期限
if (trialInfo['payIntv'] == '0') {
trialInfo['payEndYear'] = '1000'
@@ -1368,9 +1378,6 @@ export default {
},
//保额份数变化
stepperChange(defalutValue, productIndex, calFactorIndex, min, max, riskFactor) {
console.log(defalutValue, productIndex, calFactorIndex, min, max)
console.log(this.saleInsuredPersonInfo.age)
console.log(riskFactor)
let currentEle =
localStorage.isTrial !== '1' && this.chooseProducts[productIndex].isMainRisk == '0'
? this.chooseProducts[productIndex].productTrialYearDTOS[calFactorIndex]
@@ -1418,7 +1425,6 @@ export default {
//isTrial为0 ---暂时为富娃娃两全保险(万能型)专配 输入保费校验
} else if (this.isTrial === '0' && this.chooseProducts[productIndex].isMainRisk == '0') {
if (Number(defalutValue) < Number(min)) {
console.log('校验 == ', Number(defalutValue), Number(min), Number(min) * Number(riskFactor.moneyUnit))
this.$toast(`交费期间为${riskFactor.yearWay}年交时,最低保费为${Number(min) * Number(riskFactor.moneyUnit)}`)
this.nextStepFlag = true
} else {
@@ -1558,14 +1564,9 @@ export default {
}
}
//保费算保额
console.log('this.trialList', this.trialList[index].trialType)
// debugger
if (this.trialList[index].trialType == '1' || this.trialList[index].trialType == '2') {
// console.log('11111111111111111')
// console.log(this.trialList[index].amt)
riskItem['amt'] = this.trialList[index].amt
}
// console.log(riskItem)
//万能型产品保费赋值给保额
//增加判断是否是从建议书跳转过来了的
if (localStorage.isFrom != 'proposal') {
@@ -1602,7 +1603,6 @@ export default {
// console.log(riskItem)
riskItem = Object.assign(riskItem, this.trialInfos[index])
// console.log(riskItem)
riskDTOLst.push(riskItem)
}
})
@@ -1617,7 +1617,6 @@ export default {
}
})
// console.log('riskDTOLst', riskDTOLst)
//建议书需要添加全部投保人信息电投只需要投保人ID
let insuredDTOItem = Object.assign(this.saleInsuredPersonInfo, { riskDTOLst: riskDTOLst })
let params = {
@@ -1631,6 +1630,22 @@ export default {
}
}
// 富娃娃&一年定寿交费方式,交费区间固定为月交
if (this.richChildrenFlag) {
let product = params.orderDTO.insuredDTOs[0].riskDTOLst.find(item => {
return item.productCode === 'GFRS_M0015'
})
if (product) {
let trialProduct = params.orderDTO.insuredDTOs[0].riskDTOLst.find(item => {
return item.productCode === 'GFRS_A0006'
})
if (trialProduct) {
trialProduct.prem = 0
trialProduct.payIntv = 1
}
}
}
let resultData
if (localStorage.isFrom == 'proposal') {
let product = params.orderDTO.insuredDTOs[0].riskDTOLst.find(item => {
@@ -1644,7 +1659,6 @@ export default {
product.amt = trialProduct.amt
}
}
console.dir(params)
resultData = await saveProposal(params)
} else {
console.dir(params)
@@ -1692,7 +1706,6 @@ export default {
// chooseProducts: {
// deep: true,
// handler: function(newVal) {
// // console.log('xin', newVal)
// this.chooseProducts = newVal
// }
// }