mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-11 10:56:44 +08:00
选择多种试算类型产品后点击编辑功能页面是算报错问题修改
This commit is contained in:
@@ -362,7 +362,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { Tag, Icon, Dialog, ActionSheet, Popup, Picker, Stepper, Field, Checkbox, RadioGroup, Radio } from 'vant'
|
import { Tag, Icon, Dialog, ActionSheet, Popup, Picker, Stepper, Field, Checkbox, RadioGroup, Radio } from 'vant'
|
||||||
import { trial, mainRiskList, mainRiskListProposal, calculatePremium } from '@/api/ebiz/common/common'
|
import { trial } from '@/api/ebiz/common/common'
|
||||||
import { saveOrUpdateOrderInfo, getOrderDetail,orderTrial } from '@/api/ebiz/sale/sale'
|
import { saveOrUpdateOrderInfo, getOrderDetail,orderTrial } from '@/api/ebiz/sale/sale'
|
||||||
import { saveProposal, getTrialRecordInfo, saveOrUpdateTrialRecordInfo } from '@/api/ebiz/proposal/proposal.js'
|
import { saveProposal, getTrialRecordInfo, saveOrUpdateTrialRecordInfo } from '@/api/ebiz/proposal/proposal.js'
|
||||||
import { getAgentInfo } from '@/api/ebiz/my/my.js'
|
import { getAgentInfo } from '@/api/ebiz/my/my.js'
|
||||||
@@ -716,7 +716,6 @@ export default {
|
|||||||
this.$toast(res.resultMessage)
|
this.$toast(res.resultMessage)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.getMainRiskList(riskProductCode)
|
|
||||||
}else{
|
}else{
|
||||||
this.chooseProducts = JSON.parse(localStorage.chooseProducts)
|
this.chooseProducts = JSON.parse(localStorage.chooseProducts)
|
||||||
}
|
}
|
||||||
@@ -952,234 +951,6 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
//获取主险列表--普通产品
|
|
||||||
async getMainRiskList(riskProductCode) {
|
|
||||||
let mainRiskCodes = localStorage.mainRiskCodes && JSON.parse(localStorage.mainRiskCodes)
|
|
||||||
let mainListDate = { platform: 'app' }
|
|
||||||
switch (this.isFrom) {
|
|
||||||
case 'proposal':
|
|
||||||
mainListDate.platform = 'proposal'
|
|
||||||
break
|
|
||||||
case 'sale':
|
|
||||||
mainListDate.platform = 'app'
|
|
||||||
break
|
|
||||||
}
|
|
||||||
if (this.isCrossChannel == '1') {
|
|
||||||
mainListDate.platform = 'cross'
|
|
||||||
}
|
|
||||||
let resultData
|
|
||||||
if(this.isFrom == 'proposal'){
|
|
||||||
resultData = await mainRiskListProposal(mainListDate)
|
|
||||||
}else{
|
|
||||||
resultData = await mainRiskList(mainListDate)
|
|
||||||
}
|
|
||||||
if (resultData.result == 0) {
|
|
||||||
if (resultData.mainRiskDTOS && resultData.mainRiskDTOS.length > 0){
|
|
||||||
resultData.mainRiskDTOS.forEach(item=>{
|
|
||||||
if (item.riskProductCode == riskProductCode) {
|
|
||||||
this.result = item
|
|
||||||
}
|
|
||||||
})
|
|
||||||
this.addMainRisk()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
//储存主险
|
|
||||||
async addMainRisk() {
|
|
||||||
localStorage.setItem('isTrial', '1')
|
|
||||||
let riskProductCode = this.result.riskProductCode
|
|
||||||
let resultData = await calculatePremium({ productCodes: [riskProductCode], platform: 'app', type: '1' })
|
|
||||||
if (resultData.result == 0) {
|
|
||||||
resultData = resultData.trialDTOS[0]
|
|
||||||
localStorage.isTrial = resultData.productTrialInfoDTO.productTrialYearDTOS != null ? '0' : '1'
|
|
||||||
localStorage.hint = resultData.hint
|
|
||||||
if (resultData.productTrialInfoDTO.dutyGroup != null) {
|
|
||||||
resultData.productTrialInfoDTO.dutyGroup.map(item => {
|
|
||||||
if (item.dutyName == '意外身故/伤残保险金') {
|
|
||||||
item.defaultDutyAmt = item.minDutyAmt
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
if (resultData.productTrialInfoDTO.ruleExpression) {
|
|
||||||
let ruleExpression = localStorage.ruleExpression ? JSON.parse(localStorage.ruleExpression) : {}
|
|
||||||
ruleExpression[resultData.productCode] = resultData.productTrialInfoDTO.ruleExpression
|
|
||||||
localStorage.ruleExpression = JSON.stringify(ruleExpression)
|
|
||||||
}
|
|
||||||
|
|
||||||
/********start 主险选择限制 start******/
|
|
||||||
|
|
||||||
// 检验投被人关系 惠企保特殊校验
|
|
||||||
if (riskProductCode == 'GFRS_M0040') {
|
|
||||||
if (riskRules.relationLimit(resultData, JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')).relationToAppnt, this)) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 检验投被人关系 国富人寿特定疾病药品费用医疗保险特殊校验
|
|
||||||
if (riskProductCode == 'GFRS_M0045') {
|
|
||||||
if (riskRules.relationCommonLimit(resultData, JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')).relationToAppnt, this)) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (riskRules.ageLimit(resultData, this, null,riskProductCode)) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if (riskRules.medicalLimit(resultData, this)) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if (riskRules.healthGradeLimit(resultData, this)) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// if (riskRules.lifeGradeLimit(resultData, this)) {
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
//validateAppntFlag 0-职业寿险等级需校验主合同的投保人;1-职业寿险等级无需校验主合同的投保人
|
|
||||||
if (resultData.productInsuredDTO.validateAppntFlag == '0') {
|
|
||||||
//校验主合同投保人寿险职业等级
|
|
||||||
if (riskRules.lifeGradeLimitForBaby(resultData, this)) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
//校验主合同被保险人寿险职业等级
|
|
||||||
if (riskRules.lifeGradeLimit(resultData, this)) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let flagPermission = await riskRules.getProductSellPermissionList(resultData.productCode, this,this.isCrossChannel)
|
|
||||||
if (flagPermission.flag && localStorage.isFrom != 'proposal') {
|
|
||||||
//校验该代理人是否有该产品的售卖权限
|
|
||||||
return this.$toast(flagPermission.resultMessage)
|
|
||||||
}
|
|
||||||
let flagCompany = await riskRules.checkCompany(resultData.productCode, JSON.parse(this.$CacheUtils.getLocItem('saleInsuredInfo')).workcompany, JSON.parse(this.$CacheUtils.getLocItem('saleInsuredInfo')).isAsync,this)
|
|
||||||
if (flagCompany && localStorage.isFrom != 'proposal') {
|
|
||||||
//校验该投保人的工作单位是否能够投保该产品
|
|
||||||
return this.$toast('该投保人工作单位不能投保该产品')
|
|
||||||
}
|
|
||||||
/********end 主险选择限制 end******/
|
|
||||||
|
|
||||||
//保存附加险
|
|
||||||
localStorage.addtionRiskLst = JSON.stringify(resultData.productTrialInfoDTO.addtionRiskLst)
|
|
||||||
localStorage.isAutoPay = resultData.isAutoPay
|
|
||||||
localStorage.isRenew = resultData.isRenew
|
|
||||||
localStorage.isForceRenew = resultData.isForceRenew
|
|
||||||
localStorage.isRelated = resultData.isRelated
|
|
||||||
|
|
||||||
let calFactorLst = this.getFactorList(resultData)
|
|
||||||
let productTrialYearDTOS = resultData.productTrialInfoDTO.productTrialYearDTOS != null ? resultData.productTrialInfoDTO.productTrialYearDTOS : null
|
|
||||||
let hasAddtionRisk = (resultData.productTrialInfoDTO.addtionRiskLst != null && resultData.productTrialInfoDTO.addtionRiskLst.length) ? true : false
|
|
||||||
let currentProductInfo = localStorage.isTrial == '1' ? {
|
|
||||||
isCrossChannel:this.isCrossChannel,
|
|
||||||
calFactorLst,
|
|
||||||
hasAddtionRisk,
|
|
||||||
isMainRisk: 0,
|
|
||||||
hint: resultData.hint,
|
|
||||||
riskType: resultData.riskType,
|
|
||||||
riskName: this.result.riskName,
|
|
||||||
productCode: this.result.riskProductCode,
|
|
||||||
mainRiskCode: this.result.riskProductCode,
|
|
||||||
documentDTOS: resultData.productTrialInfoDTO.documentDTOS,
|
|
||||||
influences: resultData.productTrialInfoDTO.influences,
|
|
||||||
isRemit: resultData.productTrialInfoDTO.isRemit,
|
|
||||||
hasPredictTransferPrem: resultData.productTrialInfoDTO.hasPredictTransferPrem, //建议书使用 是否展示预计转入保费
|
|
||||||
predictTransferPrem: null //建议书使用 预计转入保费字段
|
|
||||||
} : {
|
|
||||||
isCrossChannel:this.isCrossChannel,
|
|
||||||
productTrialYearDTOS,
|
|
||||||
calFactorLst,
|
|
||||||
hasAddtionRisk,
|
|
||||||
isMainRisk: 0,
|
|
||||||
hint: resultData.hint,
|
|
||||||
riskType: resultData.riskType,
|
|
||||||
riskName: this.result.riskName,
|
|
||||||
productCode: this.result.riskProductCode,
|
|
||||||
mainRiskCode: this.result.riskProductCode,
|
|
||||||
documentDTOS: resultData.productTrialInfoDTO.documentDTOS,
|
|
||||||
influences: resultData.productTrialInfoDTO.influences,
|
|
||||||
isRemit: resultData.productTrialInfoDTO.isRemit,
|
|
||||||
hasPredictTransferPrem: resultData.productTrialInfoDTO.hasPredictTransferPrem, //建议书使用 是否展示预计转入保费
|
|
||||||
predictTransferPrem: null //建议书使用 预计转入保费字段
|
|
||||||
}
|
|
||||||
|
|
||||||
//构建险种数组
|
|
||||||
let productsData
|
|
||||||
if (localStorage.chooseProducts) {
|
|
||||||
productsData = JSON.parse(localStorage.chooseProducts)
|
|
||||||
productsData.push(currentProductInfo)
|
|
||||||
} else {
|
|
||||||
productsData = [currentProductInfo]
|
|
||||||
}
|
|
||||||
//保存选择险种
|
|
||||||
productsData = this.$utils.unrepeatObj(productsData, 'productCode') //产品数组去重,跳转试算页面未成功重复添加同一产品的情况
|
|
||||||
localStorage.chooseProducts = JSON.stringify(productsData)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
//构建险种因子列表
|
|
||||||
getFactorList(resultData) {
|
|
||||||
let productTrialInfoDTO = resultData.productTrialInfoDTO
|
|
||||||
console.log(productTrialInfoDTO, 'wode')
|
|
||||||
let calFactorLst = resultData.productTrialInfoDTO.calFactorLst
|
|
||||||
console.log('calFactorLst', calFactorLst)
|
|
||||||
|
|
||||||
calFactorLst.forEach(item => {
|
|
||||||
item['isMainRisk'] = 0
|
|
||||||
item.columns = []
|
|
||||||
if (item.type == 0) {
|
|
||||||
//1、type=0 select 2、type=1 input+stepper
|
|
||||||
productTrialInfoDTO[item.code].forEach(factor => {
|
|
||||||
if (factor.defaultValue == 0) {
|
|
||||||
item.showContent = factor.showContent
|
|
||||||
if (factor[item.code + 'Flag'] != undefined) {
|
|
||||||
item[item.code] = factor[item.code]
|
|
||||||
item[item.code + 'Flag'] = factor[item.code + 'Flag']
|
|
||||||
item.hasFlag = '1'
|
|
||||||
}else if(item.code == 'pensionAge'){
|
|
||||||
//养老保险金领取年龄
|
|
||||||
item[item.code] = factor[item.code]
|
|
||||||
item['sex'] = factor.sex
|
|
||||||
}else {
|
|
||||||
item[item.code] = factor[item.code]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
let itemColumns = { text: factor.showContent, value: factor[item.code], flag: factor[item.code + 'Flag'],sex:factor.sex}
|
|
||||||
if (factor.medical !== undefined) {
|
|
||||||
itemColumns.medical = factor.medical
|
|
||||||
}
|
|
||||||
item.columns.push(itemColumns)
|
|
||||||
})
|
|
||||||
} else if (item.type == 1) {
|
|
||||||
//按年龄选择
|
|
||||||
if (productTrialInfoDTO[item.code] != null) {
|
|
||||||
productTrialInfoDTO[item.code].forEach(factor => {
|
|
||||||
// item = Object.assign(item, factor)
|
|
||||||
if(JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')).insuredAge >= Number(factor.minAge) && JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')).insuredAge <= Number(factor.maxAge)){
|
|
||||||
// if(JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')).age >= Number(factor.minAge) && JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')).age <= Number(factor.maxAge)){
|
|
||||||
item = Object.assign(item, factor)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
if (item.code == 'inputPrem') {
|
|
||||||
item['inputPrem'] = Number(item.minPrem) * Number(item.moneyUnit)
|
|
||||||
} else {
|
|
||||||
item['amt'] = Number(item.minAmt) * Number(item.moneyUnit)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//规则储存
|
|
||||||
item['rules'] = productTrialInfoDTO[item.code]
|
|
||||||
})
|
|
||||||
// // 用于意外险初始化保额
|
|
||||||
// calFactorLst.map(item => {
|
|
||||||
// if (item.code == '"dutyGroup"') {
|
|
||||||
// item.rules.map(factor => {
|
|
||||||
// factor[0].defaultDutyAmt = 50
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
return calFactorLst
|
|
||||||
},
|
|
||||||
//特殊处理 GFRS_M0016 GFRS_A0004 GFRS_A0005 赔付比例处理
|
//特殊处理 GFRS_M0016 GFRS_A0004 GFRS_A0005 赔付比例处理
|
||||||
async dogetLimitAndGetRate() {
|
async dogetLimitAndGetRate() {
|
||||||
const orderNo = this.$route.query.orderNo
|
const orderNo = this.$route.query.orderNo
|
||||||
|
|||||||
@@ -119,7 +119,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { Tag, SubmitBar, Icon, Dialog, RadioGroup, Radio, Image } from 'vant'
|
import { Tag, SubmitBar, Icon, Dialog, RadioGroup, Radio, Image } from 'vant'
|
||||||
import FieldPicker from '@/components/ebiz/FieldPicker'
|
import FieldPicker from '@/components/ebiz/FieldPicker'
|
||||||
import { orderDetail, deleteOrderInfo } from '@/api/ebiz/common/common'
|
import { orderDetail, deleteOrderInfo, mainRiskList, mainRiskListProposal, calculatePremium } from '@/api/ebiz/common/common'
|
||||||
import { formatAllRisk } from '@/assets/js/utils/formatRiskList'
|
import { formatAllRisk } from '@/assets/js/utils/formatRiskList'
|
||||||
import { getDetail, deleteProposal } from '@/api/ebiz/proposal/proposal.js'
|
import { getDetail, deleteProposal } from '@/api/ebiz/proposal/proposal.js'
|
||||||
import { saveOrderActiveType,getActivityList } from '@/api/ebiz/sale/sale.js'
|
import { saveOrderActiveType,getActivityList } from '@/api/ebiz/sale/sale.js'
|
||||||
@@ -422,8 +422,236 @@ export default {
|
|||||||
this.$toast(resultData.resultMessage)
|
this.$toast(resultData.resultMessage)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//编辑
|
//获取主险列表--普通产品
|
||||||
editInsure(index,data){
|
async getMainRiskList(riskProductCode) {
|
||||||
|
let mainRiskCodes = localStorage.mainRiskCodes && JSON.parse(localStorage.mainRiskCodes)
|
||||||
|
let mainListDate = { platform: 'app' }
|
||||||
|
switch (this.isFrom) {
|
||||||
|
case 'proposal':
|
||||||
|
mainListDate.platform = 'proposal'
|
||||||
|
break
|
||||||
|
case 'sale':
|
||||||
|
mainListDate.platform = 'app'
|
||||||
|
break
|
||||||
|
}
|
||||||
|
if (this.isCrossChannel == '1') {
|
||||||
|
mainListDate.platform = 'cross'
|
||||||
|
}
|
||||||
|
let resultData
|
||||||
|
if(this.isFrom == 'proposal'){
|
||||||
|
resultData = await mainRiskListProposal(mainListDate)
|
||||||
|
}else{
|
||||||
|
resultData = await mainRiskList(mainListDate)
|
||||||
|
}
|
||||||
|
if (resultData.result == 0) {
|
||||||
|
if (resultData.mainRiskDTOS && resultData.mainRiskDTOS.length > 0){
|
||||||
|
resultData.mainRiskDTOS.forEach(item=>{
|
||||||
|
if (item.riskProductCode == riskProductCode) {
|
||||||
|
this.result = item
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.addMainRisk()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//储存主险
|
||||||
|
async addMainRisk() {
|
||||||
|
localStorage.setItem('isTrial', '1')
|
||||||
|
let riskProductCode = this.result.riskProductCode
|
||||||
|
let resultData = await calculatePremium({ productCodes: [riskProductCode], platform: 'app', type: '1' })
|
||||||
|
if (resultData.result == 0) {
|
||||||
|
resultData = resultData.trialDTOS[0]
|
||||||
|
localStorage.isTrial = resultData.productTrialInfoDTO.productTrialYearDTOS != null ? '0' : '1'
|
||||||
|
localStorage.hint = resultData.hint
|
||||||
|
if (resultData.productTrialInfoDTO.dutyGroup != null) {
|
||||||
|
resultData.productTrialInfoDTO.dutyGroup.map(item => {
|
||||||
|
if (item.dutyName == '意外身故/伤残保险金') {
|
||||||
|
item.defaultDutyAmt = item.minDutyAmt
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
if (resultData.productTrialInfoDTO.ruleExpression) {
|
||||||
|
let ruleExpression = localStorage.ruleExpression ? JSON.parse(localStorage.ruleExpression) : {}
|
||||||
|
ruleExpression[resultData.productCode] = resultData.productTrialInfoDTO.ruleExpression
|
||||||
|
localStorage.ruleExpression = JSON.stringify(ruleExpression)
|
||||||
|
}
|
||||||
|
|
||||||
|
/********start 主险选择限制 start******/
|
||||||
|
|
||||||
|
// 检验投被人关系 惠企保特殊校验
|
||||||
|
if (riskProductCode == 'GFRS_M0040') {
|
||||||
|
if (riskRules.relationLimit(resultData, JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')).relationToAppnt, this)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 检验投被人关系 国富人寿特定疾病药品费用医疗保险特殊校验
|
||||||
|
if (riskProductCode == 'GFRS_M0045') {
|
||||||
|
if (riskRules.relationCommonLimit(resultData, JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')).relationToAppnt, this)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (riskRules.ageLimit(resultData, this, null,riskProductCode)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (riskRules.medicalLimit(resultData, this)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (riskRules.healthGradeLimit(resultData, this)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// if (riskRules.lifeGradeLimit(resultData, this)) {
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
//validateAppntFlag 0-职业寿险等级需校验主合同的投保人;1-职业寿险等级无需校验主合同的投保人
|
||||||
|
if (resultData.productInsuredDTO.validateAppntFlag == '0') {
|
||||||
|
//校验主合同投保人寿险职业等级
|
||||||
|
if (riskRules.lifeGradeLimitForBaby(resultData, this)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
//校验主合同被保险人寿险职业等级
|
||||||
|
if (riskRules.lifeGradeLimit(resultData, this)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let flagPermission = await riskRules.getProductSellPermissionList(resultData.productCode, this,this.isCrossChannel)
|
||||||
|
if (flagPermission.flag && localStorage.isFrom != 'proposal') {
|
||||||
|
//校验该代理人是否有该产品的售卖权限
|
||||||
|
return this.$toast(flagPermission.resultMessage)
|
||||||
|
}
|
||||||
|
let flagCompany = await riskRules.checkCompany(resultData.productCode, JSON.parse(this.$CacheUtils.getLocItem('saleInsuredInfo')).workcompany, JSON.parse(this.$CacheUtils.getLocItem('saleInsuredInfo')).isAsync,this)
|
||||||
|
if (flagCompany && localStorage.isFrom != 'proposal') {
|
||||||
|
//校验该投保人的工作单位是否能够投保该产品
|
||||||
|
return this.$toast('该投保人工作单位不能投保该产品')
|
||||||
|
}
|
||||||
|
/********end 主险选择限制 end******/
|
||||||
|
|
||||||
|
//保存附加险
|
||||||
|
localStorage.addtionRiskLst = JSON.stringify(resultData.productTrialInfoDTO.addtionRiskLst)
|
||||||
|
localStorage.isAutoPay = resultData.isAutoPay
|
||||||
|
localStorage.isRenew = resultData.isRenew
|
||||||
|
localStorage.isForceRenew = resultData.isForceRenew
|
||||||
|
localStorage.isRelated = resultData.isRelated
|
||||||
|
|
||||||
|
let calFactorLst = this.getFactorList(resultData)
|
||||||
|
let productTrialYearDTOS = resultData.productTrialInfoDTO.productTrialYearDTOS != null ? resultData.productTrialInfoDTO.productTrialYearDTOS : null
|
||||||
|
let hasAddtionRisk = (resultData.productTrialInfoDTO.addtionRiskLst != null && resultData.productTrialInfoDTO.addtionRiskLst.length) ? true : false
|
||||||
|
let currentProductInfo = localStorage.isTrial == '1' ? {
|
||||||
|
isCrossChannel:this.isCrossChannel,
|
||||||
|
calFactorLst,
|
||||||
|
hasAddtionRisk,
|
||||||
|
isMainRisk: 0,
|
||||||
|
hint: resultData.hint,
|
||||||
|
riskType: resultData.riskType,
|
||||||
|
riskName: this.result.riskName,
|
||||||
|
productCode: this.result.riskProductCode,
|
||||||
|
mainRiskCode: this.result.riskProductCode,
|
||||||
|
documentDTOS: resultData.productTrialInfoDTO.documentDTOS,
|
||||||
|
influences: resultData.productTrialInfoDTO.influences,
|
||||||
|
isRemit: resultData.productTrialInfoDTO.isRemit,
|
||||||
|
hasPredictTransferPrem: resultData.productTrialInfoDTO.hasPredictTransferPrem, //建议书使用 是否展示预计转入保费
|
||||||
|
predictTransferPrem: null //建议书使用 预计转入保费字段
|
||||||
|
} : {
|
||||||
|
isCrossChannel:this.isCrossChannel,
|
||||||
|
productTrialYearDTOS,
|
||||||
|
calFactorLst,
|
||||||
|
hasAddtionRisk,
|
||||||
|
isMainRisk: 0,
|
||||||
|
hint: resultData.hint,
|
||||||
|
riskType: resultData.riskType,
|
||||||
|
riskName: this.result.riskName,
|
||||||
|
productCode: this.result.riskProductCode,
|
||||||
|
mainRiskCode: this.result.riskProductCode,
|
||||||
|
documentDTOS: resultData.productTrialInfoDTO.documentDTOS,
|
||||||
|
influences: resultData.productTrialInfoDTO.influences,
|
||||||
|
isRemit: resultData.productTrialInfoDTO.isRemit,
|
||||||
|
hasPredictTransferPrem: resultData.productTrialInfoDTO.hasPredictTransferPrem, //建议书使用 是否展示预计转入保费
|
||||||
|
predictTransferPrem: null //建议书使用 预计转入保费字段
|
||||||
|
}
|
||||||
|
|
||||||
|
//构建险种数组
|
||||||
|
let productsData
|
||||||
|
if (localStorage.chooseProducts) {
|
||||||
|
productsData = JSON.parse(localStorage.chooseProducts)
|
||||||
|
productsData.push(currentProductInfo)
|
||||||
|
} else {
|
||||||
|
productsData = [currentProductInfo]
|
||||||
|
}
|
||||||
|
//保存选择险种
|
||||||
|
productsData = this.$utils.unrepeatObj(productsData, 'productCode') //产品数组去重,跳转试算页面未成功重复添加同一产品的情况
|
||||||
|
localStorage.chooseProducts = JSON.stringify(productsData)
|
||||||
|
this.jumpTo(this.thisEditIndex,this.thisEditData)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//构建险种因子列表
|
||||||
|
getFactorList(resultData) {
|
||||||
|
let productTrialInfoDTO = resultData.productTrialInfoDTO
|
||||||
|
console.log(productTrialInfoDTO, 'wode')
|
||||||
|
let calFactorLst = resultData.productTrialInfoDTO.calFactorLst
|
||||||
|
console.log('calFactorLst', calFactorLst)
|
||||||
|
|
||||||
|
calFactorLst.forEach(item => {
|
||||||
|
item['isMainRisk'] = 0
|
||||||
|
item.columns = []
|
||||||
|
if (item.type == 0) {
|
||||||
|
//1、type=0 select 2、type=1 input+stepper
|
||||||
|
productTrialInfoDTO[item.code].forEach(factor => {
|
||||||
|
if (factor.defaultValue == 0) {
|
||||||
|
item.showContent = factor.showContent
|
||||||
|
if (factor[item.code + 'Flag'] != undefined) {
|
||||||
|
item[item.code] = factor[item.code]
|
||||||
|
item[item.code + 'Flag'] = factor[item.code + 'Flag']
|
||||||
|
item.hasFlag = '1'
|
||||||
|
}else if(item.code == 'pensionAge'){
|
||||||
|
//养老保险金领取年龄
|
||||||
|
item[item.code] = factor[item.code]
|
||||||
|
item['sex'] = factor.sex
|
||||||
|
}else {
|
||||||
|
item[item.code] = factor[item.code]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let itemColumns = { text: factor.showContent, value: factor[item.code], flag: factor[item.code + 'Flag'],sex:factor.sex}
|
||||||
|
if (factor.medical !== undefined) {
|
||||||
|
itemColumns.medical = factor.medical
|
||||||
|
}
|
||||||
|
item.columns.push(itemColumns)
|
||||||
|
})
|
||||||
|
} else if (item.type == 1) {
|
||||||
|
//按年龄选择
|
||||||
|
if (productTrialInfoDTO[item.code] != null) {
|
||||||
|
productTrialInfoDTO[item.code].forEach(factor => {
|
||||||
|
// item = Object.assign(item, factor)
|
||||||
|
if(JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')).insuredAge >= Number(factor.minAge) && JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')).insuredAge <= Number(factor.maxAge)){
|
||||||
|
// if(JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')).age >= Number(factor.minAge) && JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')).age <= Number(factor.maxAge)){
|
||||||
|
item = Object.assign(item, factor)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (item.code == 'inputPrem') {
|
||||||
|
item['inputPrem'] = Number(item.minPrem) * Number(item.moneyUnit)
|
||||||
|
} else {
|
||||||
|
item['amt'] = Number(item.minAmt) * Number(item.moneyUnit)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//规则储存
|
||||||
|
item['rules'] = productTrialInfoDTO[item.code]
|
||||||
|
})
|
||||||
|
// // 用于意外险初始化保额
|
||||||
|
// calFactorLst.map(item => {
|
||||||
|
// if (item.code == '"dutyGroup"') {
|
||||||
|
// item.rules.map(factor => {
|
||||||
|
// factor[0].defaultDutyAmt = 50
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
return calFactorLst
|
||||||
|
},
|
||||||
|
jumpTo(index,data){
|
||||||
let insuanceIdInfo = [{insuanceId: data.insuanceId, riskCode: data.riskCode, isMainRisk: 0 }]
|
let insuanceIdInfo = [{insuanceId: data.insuanceId, riskCode: data.riskCode, isMainRisk: 0 }]
|
||||||
if(data.addtion && data.addtion.length != 0){
|
if(data.addtion && data.addtion.length != 0){
|
||||||
data.addtion.forEach(item=>{
|
data.addtion.forEach(item=>{
|
||||||
@@ -454,6 +682,12 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
//编辑
|
||||||
|
editInsure(index,data){
|
||||||
|
this.thisEditIndex = index
|
||||||
|
this.thisEditData = data
|
||||||
|
this.getMainRiskList(data.riskCode)
|
||||||
|
},
|
||||||
//下一步
|
//下一步
|
||||||
async nextStep() {
|
async nextStep() {
|
||||||
if (!this.$route.query.salePageFlag) {
|
if (!this.$route.query.salePageFlag) {
|
||||||
|
|||||||
Reference in New Issue
Block a user