mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-19 21:56:45 +08:00
增加建议书利益演示档位
This commit is contained in:
@@ -51,6 +51,7 @@ export default {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.$emit('update:value', value)
|
this.$emit('update:value', value)
|
||||||
|
this.$emit('radioChange', value)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|||||||
@@ -62,7 +62,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- 只有万能险且只有建议书才展示 -->
|
||||||
|
<van-field class="pv10" v-if="item.hasPredictTransferPrem === '0'" v-model="item.predictTransferPrem" label="预计转入保费" placeholder="请输入" />
|
||||||
<div class="flex justify-content-s pv10 border-bottom prem">
|
<div class="flex justify-content-s pv10 border-bottom prem">
|
||||||
<span style="font-weight:bold" v-if="trialList.length > 0 && trialList[index].trialType == 0">
|
<span style="font-weight:bold" v-if="trialList.length > 0 && trialList[index].trialType == 0">
|
||||||
首期保费(元):
|
首期保费(元):
|
||||||
@@ -87,7 +88,6 @@ import { Tag, Icon, Dialog, ActionSheet, Popup, Picker, Stepper, Field } from 'v
|
|||||||
import { trial } from '@/api/ebiz/common/common'
|
import { trial } from '@/api/ebiz/common/common'
|
||||||
import { saveOrUpdateOrderInfo } from '@/api/ebiz/sale/sale'
|
import { saveOrUpdateOrderInfo } from '@/api/ebiz/sale/sale'
|
||||||
import { saveProposal } from '@/api/ebiz/proposal/proposal.js'
|
import { saveProposal } from '@/api/ebiz/proposal/proposal.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'calculatePremium',
|
name: 'calculatePremium',
|
||||||
components: {
|
components: {
|
||||||
@@ -155,7 +155,6 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
this.mainRiskInfluenceAddRisk()
|
this.mainRiskInfluenceAddRisk()
|
||||||
|
|
||||||
//初始化数据试算
|
//初始化数据试算
|
||||||
this.getTrial()
|
this.getTrial()
|
||||||
},
|
},
|
||||||
@@ -586,6 +585,7 @@ export default {
|
|||||||
async nextStep() {
|
async nextStep() {
|
||||||
//组装险种提交数据
|
//组装险种提交数据
|
||||||
let [mainRiskCode, riskDTOLst] = ['', []]
|
let [mainRiskCode, riskDTOLst] = ['', []]
|
||||||
|
let rollInResult = '' //校验预计转入保费结果
|
||||||
this.chooseProducts.forEach((item, index) => {
|
this.chooseProducts.forEach((item, index) => {
|
||||||
if (item.isMainRisk == 0) {
|
if (item.isMainRisk == 0) {
|
||||||
mainRiskCode = item.productCode
|
mainRiskCode = item.productCode
|
||||||
@@ -597,7 +597,14 @@ export default {
|
|||||||
riskCode: item.productCode,
|
riskCode: item.productCode,
|
||||||
mainRiskCode: mainRiskCode,
|
mainRiskCode: mainRiskCode,
|
||||||
prem: this.trialList[index] && this.trialList[index].prem,
|
prem: this.trialList[index] && this.trialList[index].prem,
|
||||||
standPrem: this.trialList[index] && this.trialList[index].standPrem
|
standPrem: this.trialList[index] && this.trialList[index].standPrem,
|
||||||
|
predictTransferPrem: item.predictTransferPrem
|
||||||
|
}
|
||||||
|
if (item.hasPredictTransferPrem && item.hasPredictTransferPrem === '0') {
|
||||||
|
//增加万能险 预计转入保费校验
|
||||||
|
rollInResult = this.rollInCheck(item.predictTransferPrem)
|
||||||
|
} else {
|
||||||
|
rollInResult = true
|
||||||
}
|
}
|
||||||
//责任险保存参数构建
|
//责任险保存参数构建
|
||||||
if (this.trialList[index].duty) {
|
if (this.trialList[index].duty) {
|
||||||
@@ -616,7 +623,10 @@ export default {
|
|||||||
riskItem = Object.assign(riskItem, this.trialInfos[index])
|
riskItem = Object.assign(riskItem, this.trialInfos[index])
|
||||||
riskDTOLst.push(riskItem)
|
riskDTOLst.push(riskItem)
|
||||||
})
|
})
|
||||||
console.log('riskDTOLst', riskDTOLst)
|
if (!rollInResult) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 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 = {
|
||||||
@@ -643,7 +653,6 @@ export default {
|
|||||||
this.saleInsuredPersonInfo.insuredId = resultData.content.id
|
this.saleInsuredPersonInfo.insuredId = resultData.content.id
|
||||||
localStorage.saleInsuredPersonInfo = JSON.stringify(this.saleInsuredPersonInfo)
|
localStorage.saleInsuredPersonInfo = JSON.stringify(this.saleInsuredPersonInfo)
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$jump({
|
this.$jump({
|
||||||
flag: 'goBack',
|
flag: 'goBack',
|
||||||
extra: {
|
extra: {
|
||||||
@@ -659,13 +668,23 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.$toast(resultData.resultMessage)
|
this.$toast(resultData.resultMessage)
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
rollInCheck(value) {
|
||||||
|
let regExp = /^[1-9]+[0-9]*$/
|
||||||
|
let result = regExp.test(value)
|
||||||
|
if (result) {
|
||||||
|
return true
|
||||||
|
} else {
|
||||||
|
this.$toast.fail('请输入正确的预计转入保费')
|
||||||
|
return false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
chooseProducts: {
|
chooseProducts: {
|
||||||
deep: true,
|
deep: true,
|
||||||
handler: function(newVal) {
|
handler: function(newVal) {
|
||||||
console.log('xin', newVal)
|
// console.log('xin', newVal)
|
||||||
this.chooseProducts = newVal
|
this.chooseProducts = newVal
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,6 +98,7 @@ export default {
|
|||||||
resultData = resultData.trialDTOS[0]
|
resultData = resultData.trialDTOS[0]
|
||||||
|
|
||||||
/********start 主险选择限制 start******/
|
/********start 主险选择限制 start******/
|
||||||
|
|
||||||
if (riskRules.ageLimit(resultData, this)) {
|
if (riskRules.ageLimit(resultData, this)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -128,7 +129,9 @@ export default {
|
|||||||
mainRiskCode: this.result.riskProductCode,
|
mainRiskCode: this.result.riskProductCode,
|
||||||
documentDTOS: resultData.productTrialInfoDTO.documentDTOS,
|
documentDTOS: resultData.productTrialInfoDTO.documentDTOS,
|
||||||
influences: resultData.productTrialInfoDTO.influences,
|
influences: resultData.productTrialInfoDTO.influences,
|
||||||
isRemit: resultData.productTrialInfoDTO.isRemit
|
isRemit: resultData.productTrialInfoDTO.isRemit,
|
||||||
|
hasPredictTransferPrem: resultData.productTrialInfoDTO.hasPredictTransferPrem, //建议书使用 是否展示预计转入保费
|
||||||
|
predictTransferPrem: null //建议书使用 预计转入保费字段
|
||||||
}
|
}
|
||||||
|
|
||||||
//构建险种数组
|
//构建险种数组
|
||||||
@@ -140,6 +143,7 @@ export default {
|
|||||||
productsData = [currentProductInfo]
|
productsData = [currentProductInfo]
|
||||||
}
|
}
|
||||||
//保存选择险种
|
//保存选择险种
|
||||||
|
|
||||||
localStorage.chooseProducts = JSON.stringify(productsData)
|
localStorage.chooseProducts = JSON.stringify(productsData)
|
||||||
this.jumpTo()
|
this.jumpTo()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -131,6 +131,8 @@
|
|||||||
|
|
||||||
<img class="w20" @click="exhibitionAdd(risk)" src="@/assets/images/add.png" />
|
<img class="w20" @click="exhibitionAdd(risk)" src="@/assets/images/add.png" />
|
||||||
</div>
|
</div>
|
||||||
|
<select-radio v-if="risk.tap" @radioChange="radioChange(risk)" :required="false" :radios="risk.radios" :value.sync="risk.tap"></select-radio>
|
||||||
|
|
||||||
<div class="green fs12 text-center pb15">拖动按钮查看不同年龄的保单利益</div>
|
<div class="green fs12 text-center pb15">拖动按钮查看不同年龄的保单利益</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -150,8 +152,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Cell, CellGroup, Collapse, CollapseItem, Slider, Row, Col, Tag, Divider, Toast, Swipe, SwipeItem } from 'vant'
|
import { Cell, RadioGroup, Radio, CellGroup, Collapse, CollapseItem, Slider, Row, Col, Tag, Divider, Toast, Swipe, SwipeItem } from 'vant'
|
||||||
|
import SelectRadio from '@/components/ebiz/SelectRadio'
|
||||||
import { getDemo, toInsurance, getDemoByProposalNo, makePdf } from '@/api/ebiz/proposal/proposal.js'
|
import { getDemo, toInsurance, getDemoByProposalNo, makePdf } from '@/api/ebiz/proposal/proposal.js'
|
||||||
|
import { haveTap, getTapIndex, formLabel, relevance } from './js/exhibitionMethod.js'
|
||||||
import { formatRiskList } from '@/assets/js/utils/formatRiskList.js'
|
import { formatRiskList } from '@/assets/js/utils/formatRiskList.js'
|
||||||
import { weixinShare } from '@/assets/js/utils/wxShare.js'
|
import { weixinShare } from '@/assets/js/utils/wxShare.js'
|
||||||
import { getAgentInfo } from '@/api/ebiz/my/my.js'
|
import { getAgentInfo } from '@/api/ebiz/my/my.js'
|
||||||
@@ -163,12 +167,11 @@ import dataDictionary from '@/assets/js/utils/data-dictionary' //使用数据字
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
let isWeixin = this.$utils.device().isWeixin //判断环境
|
let isWeixin = this.$utils.device().isWeixin //判断环境
|
||||||
console.log(filters)
|
|
||||||
return {
|
return {
|
||||||
// 折叠面板
|
// 折叠面板
|
||||||
activeNames: [],
|
activeNames: [],
|
||||||
appntDTO: {}, //投保人信息
|
appntDTO: {}, //投保人信息
|
||||||
insuredDTOs: [], //被保人信息
|
insuredDTOs: [{}], //被保人信息
|
||||||
isWeixin,
|
isWeixin,
|
||||||
agent: {
|
agent: {
|
||||||
//代理人信息
|
//代理人信息
|
||||||
@@ -243,7 +246,6 @@ export default {
|
|||||||
//在app端
|
//在app端
|
||||||
params.proposalInfoDTO.proposalNo = localStorage.orderNo
|
params.proposalInfoDTO.proposalNo = localStorage.orderNo
|
||||||
getDemo(params).then(res => {
|
getDemo(params).then(res => {
|
||||||
console.log(res)
|
|
||||||
this.formatLocal(res)
|
this.formatLocal(res)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -263,6 +265,22 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
//档位更换时
|
||||||
|
radioChange(risk) {
|
||||||
|
let that = this
|
||||||
|
let key = risk.tap
|
||||||
|
risk.demoLabel.forEach(demo => {
|
||||||
|
let result = haveTap(demo.content, '_')
|
||||||
|
if (result) {
|
||||||
|
let index = getTapIndex(demo.content, '_') + 1
|
||||||
|
demo.content = demo.content.slice(0, index) + key //更换content中的值(确保滑动的时候 找到相对应的值)
|
||||||
|
demo.value = risk.demoValue[risk.sliderValue][demo.content] //更换label中的对应的值
|
||||||
|
}
|
||||||
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
that.$forceUpdate() //解决页面不刷新问题
|
||||||
|
}, 0)
|
||||||
|
},
|
||||||
//将后端返回的数据格式化为本地
|
//将后端返回的数据格式化为本地
|
||||||
formatLocal(res) {
|
formatLocal(res) {
|
||||||
if (res.result == '0') {
|
if (res.result == '0') {
|
||||||
@@ -299,9 +317,9 @@ export default {
|
|||||||
insuredDTOs[0].insuredDTOs = orderDTO.insuredDTOs
|
insuredDTOs[0].insuredDTOs = orderDTO.insuredDTOs
|
||||||
insuredDTOs = formatRiskList(insuredDTOs, 'insuredDTOs', 'riskDTOLst')
|
insuredDTOs = formatRiskList(insuredDTOs, 'insuredDTOs', 'riskDTOLst')
|
||||||
this.insuredDTOs = insuredDTOs[0].insuredDTOs
|
this.insuredDTOs = insuredDTOs[0].insuredDTOs
|
||||||
this.insuredDTOs = this.relevance(this.insuredDTOs, insuredLabelResult, insuredResult, insuredInfoResult)
|
this.insuredDTOs = relevance(this.insuredDTOs, insuredLabelResult, insuredResult, insuredInfoResult, this.amtFormat) //进行数据关联
|
||||||
this.getWXTitle(this.insuredDTOs)
|
this.getWXTitle(this.insuredDTOs) //获取微信标题
|
||||||
let active = this.insuredDTOs.length
|
let active = this.insuredDTOs.length //默认展开项
|
||||||
this.activeNames = [active]
|
this.activeNames = [active]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -314,37 +332,7 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
//将被保人与利益演示相关联
|
|
||||||
relevance(insured, insuredLabelResult, insuredResult, insuredInfoResult) {
|
|
||||||
insured.forEach(insure => {
|
|
||||||
insure.productFeatures = ''
|
|
||||||
insure.riskDTOLst.forEach(risk => {
|
|
||||||
console.log(risk)
|
|
||||||
if (!isNaN(Number(risk.planCodeLabel))) {
|
|
||||||
//如果当前 计划编码为 数字的话 进行格式化
|
|
||||||
risk.planCodeLabel = this.amtFormat(Number(risk.planCodeLabel))
|
|
||||||
}
|
|
||||||
risk.sliderValue = 1
|
|
||||||
let insuredId = risk.insuredId
|
|
||||||
let riskCode = risk.riskCode
|
|
||||||
risk.demoLabel = insuredLabelResult[insuredId][riskCode]
|
|
||||||
risk.demoValue = insuredResult[insuredId][riskCode]
|
|
||||||
insure.productFeatures = insure.productFeatures + insuredInfoResult[insuredId][riskCode].productFeatures //所有产品特色
|
|
||||||
risk.demoLabel.forEach(v => {
|
|
||||||
// v.value = '' //设置初始值
|
|
||||||
v.value = risk.demoValue['1'][v.content] //设置初始值
|
|
||||||
})
|
|
||||||
let policyYear = 1 //初始化保单年度 确定滑动条最大值
|
|
||||||
for (let key in risk.demoValue) {
|
|
||||||
if (Number(key) > policyYear) {
|
|
||||||
policyYear = key
|
|
||||||
}
|
|
||||||
}
|
|
||||||
risk.policyYear = Number(policyYear)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
return insured
|
|
||||||
},
|
|
||||||
//转投保
|
//转投保
|
||||||
insure() {
|
insure() {
|
||||||
let params = {
|
let params = {
|
||||||
@@ -371,6 +359,7 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// 滑动块发生变化时
|
// 滑动块发生变化时
|
||||||
input(value, demoValue, demoLabel) {
|
input(value, demoValue, demoLabel) {
|
||||||
this.$forceUpdate() //强制组件更新 解决值更改之后 滑块不滑动的问题
|
this.$forceUpdate() //强制组件更新 解决值更改之后 滑块不滑动的问题
|
||||||
@@ -452,6 +441,8 @@ export default {
|
|||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
[Cell.name]: Cell,
|
[Cell.name]: Cell,
|
||||||
|
[RadioGroup.name]: RadioGroup,
|
||||||
|
[Radio.name]: Radio,
|
||||||
[CellGroup.name]: CellGroup,
|
[CellGroup.name]: CellGroup,
|
||||||
[Collapse.name]: Collapse,
|
[Collapse.name]: Collapse,
|
||||||
[CollapseItem.name]: CollapseItem,
|
[CollapseItem.name]: CollapseItem,
|
||||||
@@ -461,13 +452,19 @@ export default {
|
|||||||
[Tag.name]: Tag,
|
[Tag.name]: Tag,
|
||||||
[Divider.name]: Divider,
|
[Divider.name]: Divider,
|
||||||
[Swipe.name]: Swipe,
|
[Swipe.name]: Swipe,
|
||||||
[SwipeItem.name]: SwipeItem
|
[SwipeItem.name]: SwipeItem,
|
||||||
|
SelectRadio
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss">
|
||||||
.proposal-exhibition-container {
|
.proposal-exhibition-container {
|
||||||
|
.sex-radio {
|
||||||
|
.ph30 {
|
||||||
|
padding: 0px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
&::before {
|
&::before {
|
||||||
content: '';
|
content: '';
|
||||||
display: table;
|
display: table;
|
||||||
|
|||||||
99
src/views/ebiz/proposal/js/exhibitionMethod.js
Normal file
99
src/views/ebiz/proposal/js/exhibitionMethod.js
Normal file
@@ -0,0 +1,99 @@
|
|||||||
|
export function haveTap(content,keys) { //判断是否含有档位
|
||||||
|
if (content.indexOf(keys) === -1) {
|
||||||
|
return false
|
||||||
|
} else {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
export function getTapIndex(content,keys) { //获取关键字的位置
|
||||||
|
let index = null ;
|
||||||
|
index = content.indexOf(keys)
|
||||||
|
return index
|
||||||
|
}
|
||||||
|
export function formLabel(label, key) { //格式化label
|
||||||
|
let obj = {}
|
||||||
|
let result = [] //进行去重
|
||||||
|
for (var i = 0; i < label.length; i++) {
|
||||||
|
if (!obj[label[i].contentLabel]) {
|
||||||
|
result.push(label[i])
|
||||||
|
obj[label[i].contentLabel] = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let defaultArr = []
|
||||||
|
//找出默认值
|
||||||
|
label.forEach(v => {
|
||||||
|
let indexPlace = getTapIndex(v.content, '_') + 1
|
||||||
|
let keyPlcae = getTapIndex(v.content, key)
|
||||||
|
if (keyPlcae === indexPlace) {
|
||||||
|
defaultArr.push(v)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
//进行默认值 赋值
|
||||||
|
result.forEach(r => {
|
||||||
|
defaultArr.forEach(d => {
|
||||||
|
if (r.contentLabel === d.contentLabel) {
|
||||||
|
r.content = d.content
|
||||||
|
r.value = d.value
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
//将被保人与利益演示相关联
|
||||||
|
export function relevance(insured, insuredLabelResult, insuredResult, insuredInfoResult, amtFormat) {
|
||||||
|
insured.forEach(insure => {
|
||||||
|
insure.productFeatures = ''
|
||||||
|
insure.riskDTOLst.forEach(risk => {
|
||||||
|
if (!isNaN(Number(risk.planCodeLabel))) {
|
||||||
|
//如果当前 计划编码为 数字的话 进行格式化
|
||||||
|
risk.planCodeLabel = amtFormat(Number(risk.planCodeLabel))
|
||||||
|
}
|
||||||
|
risk.sliderValue = 1
|
||||||
|
let insuredId = risk.insuredId
|
||||||
|
let riskCode = risk.riskCode
|
||||||
|
let currentInsuredInfo = insuredInfoResult[insuredId][riskCode]
|
||||||
|
risk.demoLabel = insuredLabelResult[insuredId][riskCode]
|
||||||
|
risk.demoValue = insuredResult[insuredId][riskCode]
|
||||||
|
insure.productFeatures = insure.productFeatures + currentInsuredInfo.productFeatures //所有产品特色
|
||||||
|
|
||||||
|
risk.demoLabel.forEach(v => {
|
||||||
|
// v.value = '' //设置初始值
|
||||||
|
v.value = risk.demoValue['1'][v.content] //设置初始值
|
||||||
|
})
|
||||||
|
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'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
risk.tap = defaulValue
|
||||||
|
risk.radios = []
|
||||||
|
|
||||||
|
radios.forEach(item => {
|
||||||
|
risk.radios.push(item)
|
||||||
|
})
|
||||||
|
//档位去重 默认显示中档 L低档 M中档 H高档
|
||||||
|
risk.demoLabel = formLabel(risk.demoLabel, defaulValue)
|
||||||
|
}
|
||||||
|
let policyYear = 1 //初始化保单年度 确定滑动条最大值
|
||||||
|
for (let key in risk.demoValue) {
|
||||||
|
if (Number(key) > policyYear) {
|
||||||
|
policyYear = key
|
||||||
|
}
|
||||||
|
}
|
||||||
|
risk.policyYear = Number(policyYear)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
return insured
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user