diff --git a/src/filters/index.js b/src/filters/index.js index eea697b0f..3e3a4382b 100644 --- a/src/filters/index.js +++ b/src/filters/index.js @@ -157,9 +157,12 @@ export default { // return str //摘自国富群:这个在报文转换的时候,核心返回“—”的时候,直接返回空。 @于维琦(于维琦) 前端如果保额为空,直接展示“—”@皮伟(皮伟) 你跟她碰一下怎么改 - if (moneyStr === null || moneyStr == '' || moneyStr === 'null') { + if (moneyStr === null || moneyStr === '' || moneyStr === 'null') { return '—' } + if (Number.isNaN(Number(moneyStr))) { + return moneyStr + } let str = '' if (flag) { str = (moneyStr + '').replace(/\d{1,3}(?=(\d{3})+$)/g, '$&,') diff --git a/src/views/ebiz/common/CalculatePremium.vue b/src/views/ebiz/common/CalculatePremium.vue index 37c8bed3a..5d68cba8c 100644 --- a/src/views/ebiz/common/CalculatePremium.vue +++ b/src/views/ebiz/common/CalculatePremium.vue @@ -268,7 +268,7 @@ 首期保费(元): 保额(元): - {{ trialList[index].showPrem.toFixed(2) | moneyFormat }} + {{ trialList[index].showPrem | moneyFormat }}
@@ -380,7 +380,8 @@ export default { payEndYearColumnsIndex: 0, // 后台配置的校验规则 ruleExpression: {}, - mainRiskCode: '' + mainRiskCode: '', + richChildrenFlag: false } }, mounted() { @@ -448,7 +449,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' } @@ -479,7 +479,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 => { @@ -539,7 +538,6 @@ export default { // '}'], // funPar: ['par','ParKey','Par'], // } - // console.log("config",config); // config = { // eventName: 'GFRS_A0003_noMainCode', // eventType: 'init', @@ -690,9 +688,6 @@ export default { } } }, - // blur(value) { - // console.log('哈哈哈',value) - // }, //弹框选择 toSelect(index, index1, columns) { ;[this.popupShow, this.productIndex, this.calFactorIndex] = [true, index, index1] @@ -709,9 +704,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') { @@ -722,7 +714,6 @@ export default { }) this.defalutAmt = 1 } - console.log('payEndYearColumnsIndex == ', this.payEndYearColumnsIndex) if (currentEle.showContent != value.text) { //通用规则校验 @@ -738,7 +729,6 @@ export default { this.popupShow = false return false } - // console.log("productCode ==>" , productCode) // if(this.ruleExpression[productCode]){ // this.errorMsg = [] @@ -893,6 +883,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 } }, @@ -1034,7 +1027,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') { @@ -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() { let remitIndex = [] @@ -1207,8 +1216,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() @@ -1271,7 +1282,6 @@ export default { } }) - console.log('trialInfo == ', trialInfo) //通用规则1:交费方式为一次交情,无交费期限 if (trialInfo['payIntv'] == '0') { trialInfo['payEndYear'] = '1000' @@ -1352,9 +1362,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] @@ -1402,7 +1409,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 { @@ -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') { - // console.log('11111111111111111') - // console.log(this.trialList[index].amt) riskItem['amt'] = this.trialList[index].amt } - // console.log(riskItem) //万能型产品保费赋值给保额 //增加判断是否是从建议书跳转过来了的 if (localStorage.isFrom != 'proposal') { @@ -1575,9 +1576,7 @@ export default { this.trialInfos[index].amt = this.trialList[index].amt } - // console.log(riskItem) riskItem = Object.assign(riskItem, this.trialInfos[index]) - // console.log(riskItem) riskDTOLst.push(riskItem) } }) @@ -1592,7 +1591,6 @@ export default { } }) - // console.log('riskDTOLst', riskDTOLst) //建议书需要添加全部投保人信息,电投只需要投保人ID let insuredDTOItem = Object.assign(this.saleInsuredPersonInfo, { riskDTOLst: riskDTOLst }) 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 if (localStorage.isFrom == 'proposal') { let product = params.orderDTO.insuredDTOs[0].riskDTOLst.find(item => { @@ -1619,7 +1633,6 @@ export default { product.amt = trialProduct.amt } } - console.dir(params) resultData = await saveProposal(params) } else { resultData = await saveOrUpdateOrderInfo(params) @@ -1666,7 +1679,6 @@ export default { // chooseProducts: { // deep: true, // handler: function(newVal) { - // // console.log('xin', newVal) // this.chooseProducts = newVal // } // }