合并鼎诚919

This commit is contained in:
邓晓坤
2019-09-19 18:04:30 +08:00
parent 1c4edae07f
commit d5ca72a7fc
73 changed files with 3805 additions and 2281 deletions

View File

@@ -1,5 +1,5 @@
<template>
<div class="calculate-premium-container pb50">
<div class="calculate-premium-container pb50 pt10">
<div class="bg-white ph10 pt10">
<div class="flex justify-content-s align-items-c border-bottom pb10">
<span class="mr10">{{ saleInsuredPersonInfo.name }}</span>
@@ -22,7 +22,8 @@
<div v-for="(riskFactor, riskFactorIndex) in item.calFactorLst" :key="riskFactorIndex">
<div class="flex justify-content-s pv10 border-bottom" v-if="riskFactor.type == 1">
<div class="flex">
<span> {{ riskFactor.name + '(' + riskFactor.suffix + ')' }} </span>
<span v-if="riskFactor.suffix" class="fs14"> {{ riskFactor.name + '(' + riskFactor.suffix + ')' }} </span>
<span v-else class="fs14"> {{ riskFactor.name }} &nbsp;&nbsp; &nbsp;&nbsp;</span>
<van-stepper
v-model="item.calFactorLst[riskFactorIndex].defaultValue"
:min="riskFactor.minAmt"
@@ -69,7 +70,7 @@
<span style="font-weight:bold">
首期保费(
</span>
<span class="fee red" v-if="trialList && trialList.length > 0">{{ trialList[index].prem.toFixed(2) }}</span>
<span class="fee red" v-if="trialList && trialList.length > 0">{{ trialList[index].prem.toFixed(2) | moneyFormat }}</span>
</div>
</div>
<van-button type="danger" class="bottom-btn" @click="nextStep" :disabled="nextStepFlag">完成</van-button>
@@ -77,7 +78,7 @@
<!-- 字段选择 -->
<van-popup v-model="popupShow" position="bottom">
<van-picker show-toolbar :columns="columns" @confirm="onConfirm" @cancel="popupShow = false" />
<van-picker show-toolbar :columns="columns" @confirm="onConfirm" @cancel="onCancel" />
</van-popup>
</div>
</template>
@@ -145,7 +146,7 @@ export default {
}
//构建提交数据、渲染险种
this.chooseProducts = JSON.parse(localStorage.chooseProducts)
this.influenceAddRiskCodes
// this.influenceAddRiskCodes
if (this.chooseProducts[0].influences && this.chooseProducts[0].influences.length > 0) {
this.influences = this.chooseProducts[0].influences
@@ -163,8 +164,14 @@ export default {
;[this.popupShow, this.productIndex, this.calFactorIndex] = [true, index, index1]
this.columns = columns
},
//取消picker
onCancel() {
this.columns = []
this.popupShow = false
},
//确认选择字段
onConfirm(value) {
this.columns = []
let currentFactor = this.chooseProducts[this.productIndex].calFactorLst
let currentEle = currentFactor[this.calFactorIndex]
@@ -231,7 +238,7 @@ export default {
let age = Number(this.saleInsuredPersonInfo.age)
for (let i = 0; i < currentEle.rules.length; i++) {
if (currentEle.rules[i].payEndYear == value && age > currentEle.rules[i].maxAge) {
this.$toast('被保人年龄不适合该交费期限!')
this.$toast('被保人年龄不适合该交费期限!')
return true
}
}
@@ -258,30 +265,41 @@ export default {
},
setAddtionRiskMaxAmt(mainRiskAmt, index) {
this.chooseProducts[index].calFactorLst.forEach(item => {
if (item.code == 'amt') {
if (item.code == 'amt' || item.code == 'planCode') {
let columnsValArr = []
item.columns.forEach(option => {
columnsValArr.push(Number(option.value))
if (Number(option.value) > mainRiskAmt * 10000) {
columnsValArr.push(Number(option.amt))
if (Number(option.amt) > mainRiskAmt * 10000) {
option.disabled = true
} else {
option.disabled = false
}
})
//主险减,附加险变化
//主险减,附加险变化,取最小
if (mainRiskAmt * 10000 < item.amt) {
let currentAmt = this.getAmtByPlanCode(item.columns, item.planCode)
if (mainRiskAmt * 10000 < currentAmt) {
let minVal = columnsValArr.min()
item.columns.forEach(option => {
if (option.value == minVal) {
if (option.amt == minVal) {
item.showContent = option.text
item.amt = option.value
item.planCode = option.value
item.amt = option.amt
}
})
}
}
})
},
getAmtByPlanCode(columns, planCode) {
let amt = ''
columns.forEach(item => {
if (item.value == planCode) {
amt = item.amt
}
})
return amt
},
setInputAddtionRiskMaxAmt(mainRiskAmt, index) {
this.chooseProducts[index].calFactorLst.forEach(item => {
if (item.type == 1) {
@@ -386,34 +404,56 @@ export default {
},
//打开文档
openDocument(item) {
localStorage.documentInfo = JSON.stringify({ documentUrl: item.url, documentType: item.type })
let pdfUrl = encodeURIComponent(item.url)
this.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/product/productDocument'
},
routerInfo: {
path: `/product/productDocument`
title: item.name,
// url: 'http://47.96.143.111/pdfjs/web/viewer.html?file=' + item.url //测试代码
url: location.origin + '/pdfjs/web/viewer.html?file=' + pdfUrl
}
})
// localStorage.documentInfo = JSON.stringify({ documentUrl: item.url, documentType: item.type })
// this.$jump({
// flag: 'h5',
// extra: {
// url: location.origin + '/#/product/productDocument'
// },
// routerInfo: {
// path: `/product/productDocument`
// }
// })
},
//删除所选产品
deleteRisk(index) {
Dialog.confirm({
title: '提示',
message: '确认删除该险种?',
cancelButtonColor: '#E9332E',
cancelButtonColor: '#4FC6B3',
confirmButtonColor: '#FFFFFF',
className: 'dialog-delete'
})
.then(() => {
if (this.chooseProducts[index].isMainRisk == 0) {
this.chooseProducts = []
this.$jump({
flag: 'goBack',
extra: {
refresh: '1',
index: '-2'
},
routerInfo: {
type: 2,
index: -2,
path: '/common/selectedProduct'
}
})
} else {
this.chooseProducts.splice(index, 1)
}
localStorage.chooseProducts = JSON.stringify(this.chooseProducts)
this.getTrial()
})
.catch(() => {})
},
@@ -445,6 +485,7 @@ export default {
this.chooseProducts.forEach(item => {
let trialInfo = {}
item.calFactorLst.forEach(factor => {
//type 类型 0为picker 1计步器 2
if (factor.type == 0) {
if (factor.hasFlag == '1') {
trialInfo[factor.code] = factor[factor.code]
@@ -498,6 +539,10 @@ export default {
if (localStorage.oldAddRiskCodes && JSON.parse(localStorage.oldAddRiskCodes)) {
addRiskCodes = addRiskCodes.concat(JSON.parse(localStorage.oldAddRiskCodes))
}
//930折中方案豁免险挂订单
addRiskCodes = addRiskCodes.filter(riskCode => {
return riskCode != 'DCRS_A0001'
})
localStorage.addRiskCodes = JSON.stringify(addRiskCodes)
this.$jump({
@@ -546,6 +591,8 @@ export default {
//责任险保存参数构建
if (this.trialList[index].duty) {
riskItem['dutyLst'] = this.trialList[index].duty
//930折中方案责任险分档
riskItem['amt'] = this.trialList[index].amt
}
riskItem = Object.assign(riskItem, this.trialInfos[index])
riskDTOLst.push(riskItem)