富娃娃+一年定寿组合修改

This commit is contained in:
mengxiaolong
2020-09-28 13:38:14 +08:00
parent 1ec0529e04
commit 28fa3b40fe
2 changed files with 46 additions and 31 deletions

View File

@@ -157,9 +157,12 @@ export default {
// return str // return str
//摘自国富群:这个在报文转换的时候,核心返回“—”的时候,直接返回空。 @于维琦(于维琦) 前端如果保额为空,直接展示“—”@皮伟(皮伟) 你跟她碰一下怎么改 //摘自国富群:这个在报文转换的时候,核心返回“—”的时候,直接返回空。 @于维琦(于维琦) 前端如果保额为空,直接展示“—”@皮伟(皮伟) 你跟她碰一下怎么改
if (moneyStr === null || moneyStr == '' || moneyStr === 'null') { if (moneyStr === null || moneyStr === '' || moneyStr === 'null') {
return '—' return '—'
} }
if (Number.isNaN(Number(moneyStr))) {
return moneyStr
}
let str = '' let str = ''
if (flag) { if (flag) {
str = (moneyStr + '').replace(/\d{1,3}(?=(\d{3})+$)/g, '$&,') str = (moneyStr + '').replace(/\d{1,3}(?=(\d{3})+$)/g, '$&,')

View File

@@ -268,7 +268,7 @@
首期保费 首期保费
</span> </span>
<span style="font-weight:bold" v-else>保额</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> </div>
<div class="bottom-btn bg-white"> <div class="bottom-btn bg-white">
@@ -380,7 +380,8 @@ export default {
payEndYearColumnsIndex: 0, payEndYearColumnsIndex: 0,
// 后台配置的校验规则 // 后台配置的校验规则
ruleExpression: {}, ruleExpression: {},
mainRiskCode: '' mainRiskCode: '',
richChildrenFlag: false
} }
}, },
mounted() { mounted() {
@@ -448,7 +449,6 @@ export default {
item.calFactorLst.map(item2 => { item.calFactorLst.map(item2 => {
if (item2.code == 'dutyGroup') { if (item2.code == 'dutyGroup') {
item2.rules.map(item3 => { item2.rules.map(item3 => {
console.log(item3)
if (item3.duty == '320205') { if (item3.duty == '320205') {
item3.maxDutyAmt = '1' item3.maxDutyAmt = '1'
} }
@@ -479,7 +479,6 @@ export default {
this.ruleExpression = ruleExpression this.ruleExpression = ruleExpression
let productCodes = Object.keys(ruleExpression) let productCodes = Object.keys(ruleExpression)
productCodes.forEach(itemKey => { productCodes.forEach(itemKey => {
// console.log(ruleExpression[itemKey]);
let rules = ruleExpression[itemKey] let rules = ruleExpression[itemKey]
rules.eventList = [] rules.eventList = []
rules.forEach(item => { rules.forEach(item => {
@@ -539,7 +538,6 @@ export default {
// '}'], // '}'],
// funPar: ['par','ParKey','Par'], // funPar: ['par','ParKey','Par'],
// } // }
// console.log("config",config);
// config = { // config = {
// eventName: 'GFRS_A0003_noMainCode', // eventName: 'GFRS_A0003_noMainCode',
// eventType: 'init', // eventType: 'init',
@@ -690,9 +688,6 @@ export default {
} }
} }
}, },
// blur(value) {
// console.log('哈哈哈',value)
// },
//弹框选择 //弹框选择
toSelect(index, index1, columns) { toSelect(index, index1, columns) {
;[this.popupShow, this.productIndex, this.calFactorIndex] = [true, index, index1] ;[this.popupShow, this.productIndex, this.calFactorIndex] = [true, index, index1]
@@ -709,9 +704,6 @@ export default {
// let productCode = this.chooseProducts[this.productIndex].productCode // let productCode = this.chooseProducts[this.productIndex].productCode
let currentFactor = this.chooseProducts[this.productIndex].calFactorLst let currentFactor = this.chooseProducts[this.productIndex].calFactorLst
let currentEle = currentFactor[this.calFactorIndex] let currentEle = currentFactor[this.calFactorIndex]
console.log('value', value)
console.log('currentFactor', currentFactor)
console.log('currentEle', currentEle)
//特殊设置:如果需要填写的保费/保额校验规则跟缴费期间挂钩当改变缴费期间时将输入框的值恢复默认值1 //特殊设置:如果需要填写的保费/保额校验规则跟缴费期间挂钩当改变缴费期间时将输入框的值恢复默认值1
if (currentEle.code == 'payEndYear' && this.isTrial == '0') { if (currentEle.code == 'payEndYear' && this.isTrial == '0') {
@@ -722,7 +714,6 @@ export default {
}) })
this.defalutAmt = 1 this.defalutAmt = 1
} }
console.log('payEndYearColumnsIndex == ', this.payEndYearColumnsIndex)
if (currentEle.showContent != value.text) { if (currentEle.showContent != value.text) {
//通用规则校验 //通用规则校验
@@ -738,7 +729,6 @@ export default {
this.popupShow = false this.popupShow = false
return false return false
} }
// console.log("productCode ==>" , productCode)
// if(this.ruleExpression[productCode]){ // if(this.ruleExpression[productCode]){
// this.errorMsg = [] // this.errorMsg = []
@@ -893,6 +883,9 @@ export default {
//通用规则1交费方式为一次交情无交费期限 //通用规则1交费方式为一次交情无交费期限
hiddenPayEndYear(currentEle) { hiddenPayEndYear(currentEle) {
if (currentEle.code == 'payIntv') { 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 this.chooseProducts[this.productIndex]['isHidden'] = currentEle.payIntv == '0' ? true : false
} }
}, },
@@ -1034,7 +1027,6 @@ export default {
setRemitRisk() { setRemitRisk() {
//1、一次性交清和交费期间单位为A时删除豁免险 //1、一次性交清和交费期间单位为A时删除豁免险
let mainRiskInfo = this.getMainRiskInfo() let mainRiskInfo = this.getMainRiskInfo()
console.log(mainRiskInfo)
let mainRiskPayIntv = mainRiskInfo.payIntv.payIntv let mainRiskPayIntv = mainRiskInfo.payIntv.payIntv
let mainRiskPayEndYearFlag = mainRiskInfo.payEndYear.payEndYearFlag let mainRiskPayEndYearFlag = mainRiskInfo.payEndYear.payEndYearFlag
if (mainRiskPayIntv == 0 || mainRiskPayEndYearFlag == 'A') { if (mainRiskPayIntv == 0 || mainRiskPayEndYearFlag == 'A') {
@@ -1112,6 +1104,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() { getRemitIndex() {
let remitIndex = [] let remitIndex = []
@@ -1207,8 +1216,10 @@ export default {
//试算成功,信息返显 //试算成功,信息返显
if (resultData.result == 0) { if (resultData.result == 0) {
if (resultData.flag) {
this.richChildrenFlag = true
}
this.trialList = resultData.trialList this.trialList = resultData.trialList
console.log(resultData.trialList)
localStorage.trialList = JSON.stringify(resultData.trialList) localStorage.trialList = JSON.stringify(resultData.trialList)
//设置豁免险保额 //设置豁免险保额
this.setRemitRisk() this.setRemitRisk()
@@ -1271,7 +1282,6 @@ export default {
} }
}) })
console.log('trialInfo == ', trialInfo)
//通用规则1交费方式为一次交情无交费期限 //通用规则1交费方式为一次交情无交费期限
if (trialInfo['payIntv'] == '0') { if (trialInfo['payIntv'] == '0') {
trialInfo['payEndYear'] = '1000' trialInfo['payEndYear'] = '1000'
@@ -1352,9 +1362,6 @@ export default {
}, },
//保额份数变化 //保额份数变化
stepperChange(defalutValue, productIndex, calFactorIndex, min, max, riskFactor) { stepperChange(defalutValue, productIndex, calFactorIndex, min, max, riskFactor) {
console.log(defalutValue, productIndex, calFactorIndex, min, max)
console.log(this.saleInsuredPersonInfo.age)
console.log(riskFactor)
let currentEle = let currentEle =
localStorage.isTrial !== '1' && this.chooseProducts[productIndex].isMainRisk == '0' localStorage.isTrial !== '1' && this.chooseProducts[productIndex].isMainRisk == '0'
? this.chooseProducts[productIndex].productTrialYearDTOS[calFactorIndex] ? this.chooseProducts[productIndex].productTrialYearDTOS[calFactorIndex]
@@ -1402,7 +1409,6 @@ export default {
//isTrial为0 ---暂时为富娃娃两全保险(万能型)专配 输入保费校验 //isTrial为0 ---暂时为富娃娃两全保险(万能型)专配 输入保费校验
} else if (this.isTrial === '0' && this.chooseProducts[productIndex].isMainRisk == '0') { } else if (this.isTrial === '0' && this.chooseProducts[productIndex].isMainRisk == '0') {
if (Number(defalutValue) < Number(min)) { 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.$toast(`交费期间为${riskFactor.yearWay}年交时,最低保费为${Number(min) * Number(riskFactor.moneyUnit)}`)
this.nextStepFlag = true this.nextStepFlag = true
} else { } else {
@@ -1541,14 +1547,9 @@ export default {
} }
} }
//保费算保额 //保费算保额
console.log('this.trialList', this.trialList[index].trialType)
// debugger
if (this.trialList[index].trialType == '1' || this.trialList[index].trialType == '2') { 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 riskItem['amt'] = this.trialList[index].amt
} }
// console.log(riskItem)
//万能型产品保费赋值给保额 //万能型产品保费赋值给保额
//增加判断是否是从建议书跳转过来了的 //增加判断是否是从建议书跳转过来了的
if (localStorage.isFrom != 'proposal') { if (localStorage.isFrom != 'proposal') {
@@ -1575,9 +1576,7 @@ export default {
this.trialInfos[index].amt = this.trialList[index].amt this.trialInfos[index].amt = this.trialList[index].amt
} }
// console.log(riskItem)
riskItem = Object.assign(riskItem, this.trialInfos[index]) riskItem = Object.assign(riskItem, this.trialInfos[index])
// console.log(riskItem)
riskDTOLst.push(riskItem) riskDTOLst.push(riskItem)
} }
}) })
@@ -1592,7 +1591,6 @@ export default {
} }
}) })
// console.log('riskDTOLst', riskDTOLst)
//建议书需要添加全部投保人信息电投只需要投保人ID //建议书需要添加全部投保人信息电投只需要投保人ID
let insuredDTOItem = Object.assign(this.saleInsuredPersonInfo, { riskDTOLst: riskDTOLst }) let insuredDTOItem = Object.assign(this.saleInsuredPersonInfo, { riskDTOLst: riskDTOLst })
let params = { let params = {
@@ -1606,6 +1604,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 let resultData
if (localStorage.isFrom == 'proposal') { if (localStorage.isFrom == 'proposal') {
let product = params.orderDTO.insuredDTOs[0].riskDTOLst.find(item => { let product = params.orderDTO.insuredDTOs[0].riskDTOLst.find(item => {
@@ -1619,7 +1633,6 @@ export default {
product.amt = trialProduct.amt product.amt = trialProduct.amt
} }
} }
console.dir(params)
resultData = await saveProposal(params) resultData = await saveProposal(params)
} else { } else {
resultData = await saveOrUpdateOrderInfo(params) resultData = await saveOrUpdateOrderInfo(params)
@@ -1666,7 +1679,6 @@ export default {
// chooseProducts: { // chooseProducts: {
// deep: true, // deep: true,
// handler: function(newVal) { // handler: function(newVal) {
// // console.log('xin', newVal)
// this.chooseProducts = newVal // this.chooseProducts = newVal
// } // }
// } // }