mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-09 16:56:43 +08:00
GFRS-454【0326】 建议书优化2.0 初版代码备份提交_2 --提交人:阳华祥
This commit is contained in:
@@ -181,7 +181,7 @@
|
||||
import { Cell, RadioGroup, Radio, CellGroup, Collapse, CollapseItem, Slider, Row, Col, Tag, Divider, Toast, Swipe, SwipeItem, Sticky, Tab, Tabs } from 'vant'
|
||||
import SelectRadio from '@/components/ebiz/SelectRadio'
|
||||
import { getDemo, toInsurance, getDemoByProposalNo } from '@/api/ebiz/proposal/proposal.js'
|
||||
import { haveTap, getTapIndex, relevance } from './js/exhibitionMethod.js'
|
||||
import { haveTap, getTapIndex, relevanceByInsure } from './js/exhibitionMethod.js'
|
||||
import { formatRiskList } from '@/assets/js/utils/formatRiskList.js'
|
||||
import { weixinShare } from '@/assets/js/utils/wxShare.js'
|
||||
import { getAgentInfo } from '@/api/ebiz/my/my.js'
|
||||
@@ -204,9 +204,9 @@ export default {
|
||||
pageShowInfo: {
|
||||
insuredSlider: {}, // 滑动条
|
||||
appntDTO: {}, //投保人信息
|
||||
insuredDTOs: [{}] //被保人信息
|
||||
insuredDTOs: [{}], //被保人信息
|
||||
showInsuredDTO: {} //页面显示配保人数据
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -282,12 +282,7 @@ export default {
|
||||
} else {
|
||||
//在app端
|
||||
params.proposalInfoDTO.proposalNo = localStorage.orderNo
|
||||
this.mainRiskCodes.push(localStorage.mainRiskCode)
|
||||
console.log(localStorage.mainRiskCode)
|
||||
// if (localStorage.mainRiskCodes) {
|
||||
// this.mainRiskCodes = JSON.parse(localStorage.mainRiskCodes)
|
||||
// }
|
||||
console.log(this.mainRiskCodes[0])
|
||||
console.log(params)
|
||||
getDemo(params).then(res => {
|
||||
this.formatLocal(res)
|
||||
})
|
||||
@@ -335,16 +330,12 @@ export default {
|
||||
formatLocal(res) {
|
||||
if (res.result == '0') {
|
||||
let orderDTO = res.content.orderDTO
|
||||
this.createDate = res.content.orderDTO.orderInfoDTO.appntDateLabel
|
||||
let { insuredLabelResult, insuredResult, insuredInfoResult } = res.content.calculusResDTO
|
||||
|
||||
orderDTO.insuredDTOs.forEach(v => {
|
||||
//根据数据字典 获取当前值
|
||||
v.age = getAge.getAge(v.birthdayLabel, new Date())
|
||||
v.riskDTOLst.forEach(risk => {
|
||||
// if (risk.planCode) {
|
||||
// risk.planCode = '计划' + NumberToChinese(Number(risk.planCode))
|
||||
// }
|
||||
if (risk.insuYear == 106 && risk.insuYearFlag == 'A') {
|
||||
risk.insureName = '终身'
|
||||
} else {
|
||||
@@ -354,21 +345,16 @@ export default {
|
||||
risk.insureName = '至' + risk.insuYear + '周岁的保单周年日'
|
||||
}
|
||||
}
|
||||
|
||||
if (risk.payEndYearFlag == 'Y') {
|
||||
console.log(111)
|
||||
if (risk.payEndYear == '1000') {
|
||||
risk.payName = '一次交清'
|
||||
} else {
|
||||
console.log(222)
|
||||
risk.payName = risk.payEndYear + '年'
|
||||
}
|
||||
} else {
|
||||
console.log(333)
|
||||
risk.payName = risk.payEndYear + '岁'
|
||||
}
|
||||
// risk.demoValue[demoLabel.content] == dutyLst.dutyCode
|
||||
this.dutyLst = risk.dutyLst
|
||||
// todo责任显示处理
|
||||
})
|
||||
})
|
||||
this.appntDTO = orderDTO.appntDTO
|
||||
@@ -376,11 +362,10 @@ export default {
|
||||
insuredDTOs[0].insuredDTOs = orderDTO.insuredDTOs
|
||||
insuredDTOs = formatRiskList(insuredDTOs, 'insuredDTOs', 'riskDTOLst')
|
||||
this.insuredDTOs = insuredDTOs[0].insuredDTOs
|
||||
this.insuredDTOs = relevance(this.insuredDTOs, insuredLabelResult, insuredResult, insuredInfoResult, this.amtFormat, this.dutyLst) //进行数据关联
|
||||
// console.log('insuredDTOs',insuredDTOs)
|
||||
this.insuredDTOs = relevanceByInsure(this.insuredDTOs, insuredLabelResult, insuredResult, insuredInfoResult) //进行数据关联
|
||||
this.getWXTitle(this.insuredDTOs) //获取微信标题
|
||||
let active = this.insuredDTOs.length //默认展开项
|
||||
this.activeNames = [active]
|
||||
console.log("this.insuredDTOs",this.insuredDTOs)
|
||||
// 建议书名称
|
||||
this.insuredDTOs.forEach(item => {
|
||||
if (item.riskDTOLst && item.riskDTOLst.length > 0) {
|
||||
item.riskDTOLst.forEach(ele => {
|
||||
@@ -394,11 +379,6 @@ export default {
|
||||
//获取微信分享的标题
|
||||
getWXTitle(insuredDTOs) {
|
||||
dataDictionary.riskType.forEach(dataRisk => {
|
||||
//根据数字字典来找到 险种简称
|
||||
// console.log(insuredDTOs)
|
||||
// console.log(insuredDTOs[0].mainRisk[0].riskCode)
|
||||
// console.log(dataRisk.code)
|
||||
|
||||
if (insuredDTOs[0].mainRisk[0].riskCode == dataRisk.code) {
|
||||
this.wxTitle = dataRisk.shortName + '计划书'
|
||||
}
|
||||
|
||||
@@ -112,3 +112,53 @@ export function relevance(insured, insuredLabelResult, insuredResult, insuredInf
|
||||
})
|
||||
return insured
|
||||
}
|
||||
|
||||
//将被保人与利益演示相关联(被保人维度)
|
||||
export function relevanceByInsure(insured, insuredLabelResult, insuredResult, insuredInfoResult) {
|
||||
insured.forEach(insure => {
|
||||
insure.radios = []
|
||||
insure.demoLabel = insuredLabelResult[insure.insuredId]['GFRS_M0003']
|
||||
insure.demoValue = insuredResult[insure.insuredId]['GFRS_M0003']
|
||||
insure.demoLabel.forEach(v => {
|
||||
v.value = insure.demoValue['1'][v.content] //设置初始值
|
||||
})
|
||||
insure.sliderValue = 1
|
||||
let policyYear = 1 //初始化保单年度 确定滑动条最大值
|
||||
for (let key in insure.demoValue) {
|
||||
if (Number(key) > policyYear) {
|
||||
policyYear = key
|
||||
}
|
||||
}
|
||||
insure.policyYear = Number(policyYear)
|
||||
|
||||
insure.riskDTOLst.forEach(risk => {
|
||||
let currentInsuredInfo = insuredInfoResult[insure.insuredId][risk.riskCode]
|
||||
if (currentInsuredInfo.plan && currentInsuredInfo.plan === '0') {
|
||||
let defaulValue = 'M' //档位默认值
|
||||
let radios = [
|
||||
{
|
||||
label: '低档' + currentInsuredInfo.L,
|
||||
value: 'L'
|
||||
},
|
||||
{
|
||||
label: '中档' + currentInsuredInfo.M,
|
||||
value: 'M'
|
||||
},
|
||||
{
|
||||
label: '高档' + currentInsuredInfo.H,
|
||||
value: 'H'
|
||||
}
|
||||
]
|
||||
insure.tap = defaulValue
|
||||
radios.forEach(item => {
|
||||
insure.radios.push(item)
|
||||
})
|
||||
}
|
||||
})
|
||||
//档位去重 默认显示中档 L低档 M中档 H高档
|
||||
if (insure.tap) {
|
||||
insure.demoLabel = formLabel(insure.demoLabel, insure.tap)
|
||||
}
|
||||
})
|
||||
return insured
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user