【国富人寿】保费试算页面有关代码冲突解决

This commit is contained in:
liu.xiaofeng@ebiz-digits.com
2023-05-19 09:33:08 +08:00
parent dba9c2059b
commit 9effbfeb71

View File

@@ -4,7 +4,7 @@
<div class="flex justify-content-s align-items-c border-bottom pb10">
<span class="mr10">{{ saleInsuredPersonInfo.name }}</span>
<span class="mr10">{{ saleInsuredPersonInfo.sex == 0 ? '男' : '女' }}</span>
<span class="mr10">{{ saleInsuredPersonInfo.age }}</span>
<span class="mr10">{{ saleInsuredPersonInfo.insuredAge }}</span>
<span class="mr10 flex1 van-ellipsis">{{ saleInsuredPersonInfo.occupationName }}</span>
</div>
</div>
@@ -108,6 +108,7 @@
item.productCode == 'GFRS_M0046' ||
item.productCode == 'GFRS_M0051' ||
item.productCode == 'GFRS_M0054' ||
item.productCode == 'GFRS_M0073' ||
item.productCode == 'GFRS_M0057'
)
"
@@ -125,6 +126,7 @@
item.productCode == 'GFRS_M0046' ||
item.productCode == 'GFRS_M0051' ||
item.productCode == 'GFRS_M0054' ||
item.productCode == 'GFRS_M0073' ||
item.productCode == 'GFRS_M0057'
)
"
@@ -362,7 +364,7 @@
import { Tag, Icon, Dialog, ActionSheet, Popup, Picker, Stepper, Field, Checkbox, RadioGroup, Radio } from 'vant'
import { trial } from '@/api/ebiz/common/common'
import { saveOrUpdateOrderInfo, getOrderDetail,orderTrial } from '@/api/ebiz/sale/sale'
import { saveProposal } from '@/api/ebiz/proposal/proposal.js'
import { saveProposal,saveOrUpdateTrialRecordInfo,getTrialRecordInfo } from '@/api/ebiz/proposal/proposal.js'
import { getAgentInfo } from '@/api/ebiz/my/my.js'
import occupationList from '@/components/ebiz/occipation/data/occupation'
@@ -557,6 +559,27 @@
}
},
mounted() {
this.isFrom = window.localStorage.isFrom
this.$jump({
flag: 'navigation',
extra: {
title: '保费计算'
},
})
if(this.isFrom === 'proposal'){
// eslint-disable-next-line no-undef
setTimeout(() => {
EWebBridge.webCallAppInJs('webview_right_button', {
btns: [
{
img: this.$assetsUrl + 'images/del-close.png',
route: { flag: '', extra: {} }
}
]
})
}, 500)
}
window.appCallBack = this.appCallBack
getAgentInfo({}).then(res => {
// branchType N1、1代表个险渠道 和 N5、5 代表中介渠道N代表内勤
if (res.branchType == 'N1' || res.branchType == '1') {
@@ -584,6 +607,35 @@
}
},
methods: {
appCallBack(data) {
if (data.trigger == 'right_button_click' && localStorage.isFrom == 'proposal') {
return this.$dialog
.confirm({
className: 'dialog-delete',
title: '提示',
message: '退出流程可能会丢失部分数据,是否确认退出?',
cancelButtonColor: '#E9332E',
confirmButtonColor: '#FFFFFF'
})
.then(() => {
this.$jump({
flag: 'h5',
extra: {
title: '建议书列表',
forbidSwipeBack: 1, //当前页面禁止右滑返回
url: location.origin + `/#/proposal/list`
},
routerInfo: {
path: `/proposal/list`,
type: '1'
}
})
})
.catch(() => {
return
})
}
},
renewalShow(productCode) {
let codes = ['GFRS_M0016', 'GFRS_M0005', 'GFRS_M0018','GFRS_M0070']
return codes.find((item) => {
@@ -594,7 +646,6 @@
async init() {
// 获取是否从建议书过来的
let that = this
this.isFrom = window.localStorage.isFrom
//获取投保人信息
if (this.$CacheUtils.getLocItem('saleInsuredInfo')) {
this.saleInsuredInfo = JSON.parse(this.$CacheUtils.getLocItem('saleInsuredInfo'))
@@ -602,7 +653,13 @@
//获取被保险人信息
if (this.$CacheUtils.getLocItem('saleInsuredPersonInfo')) {
this.saleInsuredPersonInfo = JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo'))
if (this.isFrom == 'proposal' && !this.saleInsuredPersonInfo.name) {
// 建议书投保人/被保人姓名不必填, 填写姓名时展示姓名(落库),不填写姓名时展示性别+年龄,如:男30岁(不落库)
let sex = this.saleInsuredPersonInfo.sex == '0'?'男':'女'
this.saleInsuredPersonInfo.name = sex + this.saleInsuredPersonInfo.insuredAge+'岁'
}
}
// this.cvalidateFlag = (this.activeType == 'KMH'||this.activeType == 'SQY') && this.isFrom != 'proposal'
// this.cvalidateStr = this.cvalidateFlag?this.activeType == 'KMH'?'2021-01-01':this.activeType == 'SQY'?'2021-06-01':'':''
//GFRS-2552【需求】关于金掌桂投保流程增设指定生效日按钮的申请
@@ -632,7 +689,19 @@
this.cvalidateFlag = this.activeType && this.isFrom != 'proposal'
//构建提交数据、渲染险种
this.chooseProducts = JSON.parse(localStorage.chooseProducts)
if(this.$route.query.insuanceId && this.isFrom == 'proposal'){
// 获取试算记录详情
await getTrialRecordInfo({
serialNo:this.$CacheUtils.getLocItem('proposalNo'),
mainRiskId:this.$route.query.insuanceId
}).then(res => {
if (res.result == '0') {
this.chooseProducts = JSON.parse(res.content.trialJsonStr)
}
})
}else{
this.chooseProducts = JSON.parse(localStorage.chooseProducts)
}
this.chooseProducts.forEach((item, index) => {
if (item.isCrossChannel == '1') {
this.isCrossChannel = item.isCrossChannel
@@ -764,7 +833,7 @@
// '};',
// 'let payEndYear = "";',
// 'let insuYear = "";',
// 'let age = this.saleInsuredPersonInfo.age;',
// 'let age = this.saleInsuredPersonInfo.insuredAge;',
// 'let parObj = {};',
// 'par.map(item => {',
// ' parObj[item.code] = item;',
@@ -1136,6 +1205,22 @@
})
}
}
if (validateRiskCode === 'GFRS_M0073'){
if(dutyItem.duty == '100035' || dutyItem.duty == '100036'){
this.chooseProducts[productIndex].calFactorLst[calFactorIndex].rules.map((i) => {
if(i.duty == '100035' || i.duty == '100036'){
i.necess = dutyItem.necess
}
})
}
if(dutyItem.duty == '100037' || dutyItem.duty == '100038' || dutyItem.duty == '100039' || dutyItem.duty == '100040' || dutyItem.duty == '100041'){
this.chooseProducts[productIndex].calFactorLst[calFactorIndex].rules.map((i) => {
if(i.duty == '100037' || i.duty == '100038' || i.duty == '100039' || i.duty == '100040' || i.duty == '100041'){
i.necess = dutyItem.necess
}
})
}
}
this.valiAndSend(dutyItem, productIndex)
},
valiAndSend(dutyItem, productIndex) {
@@ -1355,7 +1440,7 @@
},
//特殊规则1、交费期间跟年龄的关系
ageInfluencePayEndYear(value, currentEle) {
let age = Number(this.saleInsuredPersonInfo.age)
let age = Number(this.saleInsuredPersonInfo.insuredAge)
for (let i = 0; i < currentEle.rules.length; i++) {
if (currentEle.rules[i].payEndYear == value && age > currentEle.rules[i].maxAge) {
this.$toast('被保险人年龄不适合该交费期间!')
@@ -1374,7 +1459,7 @@
},
//年龄对保险期间的影响
ageInfluenceInsuYear(value, currentEle) {
let age = Number(this.saleInsuredPersonInfo.age)
let age = Number(this.saleInsuredPersonInfo.insuredAge)
for (let i = 0; i < currentEle.rules.length; i++) {
if (currentEle.rules[i].insuYear == value && age > currentEle.rules[i].maxAge) {
this.$toast('被保险人年龄不适合该保险期间!')
@@ -1923,7 +2008,7 @@
}
//国富人寿富桂金生养老年金保险
let age = this.saleInsuredPersonInfo.age
let age = this.saleInsuredPersonInfo.insuredAge
let sex = this.saleInsuredPersonInfo.sex //0男 1女
let trialFlag = true
params.trialInfos.forEach((item) => {
@@ -2204,20 +2289,22 @@
// trialInfo.duty = [{ dutyCode: trialInfo.duty }]
// }
//获取投被保生日、性别
let birthday, sex, occupationCode, occupationName
let birthday, sex, occupationCode, occupationName, age
if (item.isRemit == '0' && item.remitType == '0') {
;[birthday, sex, occupationCode, occupationName] = [
;[birthday, sex, occupationCode, occupationName, age] = [
this.saleInsuredInfo.birthday,
this.saleInsuredInfo.sex,
this.saleInsuredInfo.occupationCode,
this.saleInsuredInfo.occupationName
this.saleInsuredInfo.occupationName,
this.saleInsuredInfo.insuredAge,
]
} else {
;[birthday, sex, occupationCode, occupationName] = [
;[birthday, sex, occupationCode, occupationName, age] = [
this.saleInsuredPersonInfo.birthday,
this.saleInsuredPersonInfo.sex,
this.saleInsuredPersonInfo.occupationCode,
this.saleInsuredPersonInfo.occupationName
this.saleInsuredPersonInfo.occupationName,
this.saleInsuredPersonInfo.insuredAge
]
}
trialInfo = Object.assign(trialInfo, {
@@ -2225,6 +2312,7 @@
sex,
occupationCode,
occupationName,
age,
platformType: 'app',
productCode: item.productCode,
medical: JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')).medical,
@@ -2255,19 +2343,13 @@
})
localStorage.addRiskCodes = JSON.stringify(addRiskCodes)
let thismyurl = ''
if (this.$route.query.orderNo) {
thismyurl = '/?orderNo=' + this.$route.query.orderNo
} else if (this.$route.query.proposalOrderNo) {
thismyurl = '?proposalOrderNo=' + this.$route.query.proposalOrderNo
}
this.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/common/addRiskList' + thismyurl
url: location.origin + '/#/common/addRiskList'
},
routerInfo: {
path: '/common/addRiskList' + thismyurl
path: '/common/addRiskList'
}
})
},
@@ -2475,7 +2557,11 @@
// 国富人寿富桂金生养老年金保险GFRS_M0053中介渠道鑫享金生养老年金保险GFRS_M0061
} else if (productCode == 'GFRS_M0053' || productCode == 'GFRS_M0061') {
if (Number(defalutValue) < Number(min)) {
this.$toast(`交费期间为${riskFactor.yearWay}年交时,最低保费为${Number(min) * Number(riskFactor.moneyUnit)}元`)
if (riskFactor.yearWay == "一次性交清") {
this.$toast(`交费期间为${riskFactor.yearWay}时,最低保费为${Number(min) * Number(riskFactor.moneyUnit)}元`)
} else {
this.$toast(`交费期间为${riskFactor.yearWay}年交时,最低保费为${Number(min) * Number(riskFactor.moneyUnit)}元`)
}
this.nextStepFlag = true
}else{
this.nextStepFlag = false
@@ -2485,7 +2571,11 @@
}
} else if (this.isTrial === '0' && this.chooseProducts[productIndex].isMainRisk == '0') {
if (Number(defalutValue) < Number(min)) {
this.$toast(`交费期间为${riskFactor.yearWay}年交时,最低保费为${Number(min) * Number(riskFactor.moneyUnit)}元`)
if (riskFactor.yearWay == "一次性交清") {
this.$toast(`交费期间为${riskFactor.yearWay}时,最低保费为${Number(min) * Number(riskFactor.moneyUnit)}元`)
} else {
this.$toast(`交费期间为${riskFactor.yearWay}年交时,最低保费为${Number(min) * Number(riskFactor.moneyUnit)}元`)
}
this.nextStepFlag = true
} else {
if ((Number(defalutValue) * 10000) % (Number(currentEle.limit) * 10000) != 0) {
@@ -2603,7 +2693,8 @@
prem: this.trialList[index] && this.trialList[index].prem,
standPrem: this.trialList[index] && this.trialList[index].standPrem,
predictTransferPrem: item.predictTransferPrem,
thirdInsuraceNo: this.policyNo
thirdInsuraceNo: this.policyNo,
insuanceId:this.$route.query.insuanceId //编辑时添加主险id
// mult: this.mult
}
if (item.hasPredictTransferPrem && item.hasPredictTransferPrem === '0') {
@@ -2626,6 +2717,7 @@
this.trialList[index].productCode == 'GFRS_M0046' ||
this.trialList[index].productCode == 'GFRS_M0051' ||
this.trialList[index].productCode == 'GFRS_M0054' ||
this.trialList[index].productCode == 'GFRS_M0073' ||
this.trialList[index].productCode == 'GFRS_M0057'
) {
riskItem['dutyLst'] = this.trialInfos[index].duty
@@ -2693,6 +2785,7 @@
delete riskDTOLst[i].duty
}
})
// this.saleInsuredPersonInfo.insuredAge = this.saleInsuredPersonInfo.insuredAge
//建议书需要添加全部投保人信息电投只需要投保人ID
let insuredDTOItem = Object.assign(this.saleInsuredPersonInfo, { riskDTOLst: riskDTOLst })