mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-12 03:16:43 +08:00
fix: 修复保费试算错误信息
1. 修复保费试算一直使用第一次选择的投保人的问题 2. 清除进入的时候 localstorage 的变量,防止后续流程变量出现异常问题 3. 修复获取被保人的信息校验异常的问题 4. 修复获取投保人的问题,当前试算无需获取(待定),明日讨论后修正
This commit is contained in:
@@ -42,6 +42,10 @@ export default {
|
|||||||
showNext: {
|
showNext: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true
|
default: true
|
||||||
|
},
|
||||||
|
trialTest: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
@@ -51,10 +55,7 @@ export default {
|
|||||||
title: '附加险选择列表'
|
title: '附加险选择列表'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
//获取投保人信息
|
|
||||||
if (this.$CacheUtils.getLocItem('saleInsuredPersonInfo')) {
|
|
||||||
this.saleInsuredPersonInfo = JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo'))
|
|
||||||
}
|
|
||||||
getAgentInfo({}).then(res => {
|
getAgentInfo({}).then(res => {
|
||||||
// branchType N1、1代表个险渠道 和 N5、5 代表中介渠道,N代表内勤
|
// branchType N1、1代表个险渠道 和 N5、5 代表中介渠道,N代表内勤
|
||||||
if (res.branchType === 'N1' || res.branchType == '1') {
|
if (res.branchType === 'N1' || res.branchType == '1') {
|
||||||
@@ -64,12 +65,20 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
//获取主产品code
|
this.loadStorageData()
|
||||||
let chooseProducts = JSON.parse(window.localStorage.getItem('chooseProducts'))
|
|
||||||
this.mainRiskCode = chooseProducts.find(item => item.isMainRisk === 0).mainRiskCode
|
|
||||||
this.filterAddRisk()
|
this.filterAddRisk()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
loadStorageData(){
|
||||||
|
//获取投保人信息
|
||||||
|
if (this.$CacheUtils.getLocItem('saleInsuredPersonInfo')) {
|
||||||
|
this.saleInsuredPersonInfo = JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo'))
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取主产品code
|
||||||
|
let chooseProducts = JSON.parse(window.localStorage.getItem('chooseProducts'))
|
||||||
|
this.mainRiskCode = chooseProducts.find(item => item.isMainRisk === 0).mainRiskCode
|
||||||
|
},
|
||||||
//过滤已选附加险
|
//过滤已选附加险
|
||||||
filterAddRisk() {
|
filterAddRisk() {
|
||||||
if (localStorage.addtionRiskLst) {
|
if (localStorage.addtionRiskLst) {
|
||||||
@@ -102,7 +111,7 @@ export default {
|
|||||||
nextStep() {
|
nextStep() {
|
||||||
if (!this.result) {
|
if (!this.result) {
|
||||||
this.$toast('请选择产品')
|
this.$toast('请选择产品')
|
||||||
return
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
//添加附加险
|
//添加附加险
|
||||||
@@ -110,6 +119,8 @@ export default {
|
|||||||
},
|
},
|
||||||
//储存附加险
|
//储存附加险
|
||||||
async addAdditionRisk() {
|
async addAdditionRisk() {
|
||||||
|
// 重新加载 storage 里面的信息
|
||||||
|
this.loadStorageData()
|
||||||
let riskProductCode = this.result.productCode
|
let riskProductCode = this.result.productCode
|
||||||
let resultData = await calculatePremium({ productCodes: [riskProductCode], platform: 'app', type: '1' })
|
let resultData = await calculatePremium({ productCodes: [riskProductCode], platform: 'app', type: '1' })
|
||||||
if (resultData.result === '0') {
|
if (resultData.result === '0') {
|
||||||
@@ -117,30 +128,28 @@ export default {
|
|||||||
localStorage.isAutoPay = localStorage.isAutoPay === '0' ? '0' : resultData.isAutoPay //自动垫交
|
localStorage.isAutoPay = localStorage.isAutoPay === '0' ? '0' : resultData.isAutoPay //自动垫交
|
||||||
localStorage.isRenew = localStorage.isRenew === '0' ? '0' : resultData.isRenew //自动续保
|
localStorage.isRenew = localStorage.isRenew === '0' ? '0' : resultData.isRenew //自动续保
|
||||||
localStorage.isForceRenew = localStorage.isForceRenew === '0' ? '0' : resultData.isForceRenew //自动续保默认是否选中 0-是 1-否
|
localStorage.isForceRenew = localStorage.isForceRenew === '0' ? '0' : resultData.isForceRenew //自动续保默认是否选中 0-是 1-否
|
||||||
if (resultData.productTrialInfoDTO.ruleExpression) {
|
// todo : 取消 rule 校验
|
||||||
|
if (resultData.productTrialInfoDTO.ruleExpression && false) {
|
||||||
let ruleExpression = localStorage.ruleExpression ? JSON.parse(localStorage.ruleExpression) : {}
|
let ruleExpression = localStorage.ruleExpression ? JSON.parse(localStorage.ruleExpression) : {}
|
||||||
ruleExpression[resultData.productCode] = resultData.productTrialInfoDTO.ruleExpression
|
ruleExpression[resultData.productCode] = resultData.productTrialInfoDTO.ruleExpression
|
||||||
localStorage.ruleExpression = JSON.stringify(ruleExpression)
|
localStorage.ruleExpression = JSON.stringify(ruleExpression)
|
||||||
let ttThis = this
|
let ttThis = this
|
||||||
for (let item of ruleExpression[resultData.productCode]) {
|
for (let item of ruleExpression[resultData.productCode]) {
|
||||||
let config = JSON.parse(item.ruleExpression)
|
let config = JSON.parse(item.ruleExpression)
|
||||||
switch (config.eventType) {
|
if (config.eventType === 'loadFormat') {
|
||||||
case 'loadFormat':
|
let initFn = new Function(...config.funPar, config.funBody.join(''))
|
||||||
let initFn = new Function(...config.funPar, config.funBody.join(''))
|
let str = initFn.call(ttThis, resultData)
|
||||||
let str = initFn.call(ttThis, resultData)
|
if (str) {
|
||||||
if (str) {
|
return this.$toast(str)
|
||||||
return this.$toast(str)
|
}
|
||||||
}
|
} else if (config.eventType === 'checkMainRisk') {
|
||||||
break
|
let checkMainRiskFn = new Function(...config.funPar, config.funBody.join(''))
|
||||||
case 'checkMainRisk':
|
let checkMainRiskStr = checkMainRiskFn.call(ttThis)
|
||||||
let checkMainRiskFn = new Function(...config.funPar, config.funBody.join(''))
|
if (checkMainRiskStr) {
|
||||||
let checkMainRiskStr = checkMainRiskFn.call(ttThis)
|
return this.$toast(checkMainRiskStr)
|
||||||
if (checkMainRiskStr) {
|
}
|
||||||
return this.$toast(checkMainRiskStr)
|
} else {
|
||||||
}
|
//
|
||||||
break
|
|
||||||
default:
|
|
||||||
break
|
|
||||||
}
|
}
|
||||||
// if(config.eventType == 'loadFormat'){
|
// if(config.eventType == 'loadFormat'){
|
||||||
// let initFn = new Function(...config.funPar, config.funBody.join(''))
|
// let initFn = new Function(...config.funPar, config.funBody.join(''))
|
||||||
@@ -213,24 +222,26 @@ export default {
|
|||||||
}
|
}
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
//豁免险与其他附加险年龄险种
|
if (this.trialTest) {
|
||||||
if (resultData.productTrialInfoDTO.isRemit == '0' && resultData.productTrialInfoDTO.remitType == '0') {
|
//豁免险与其他附加险年龄险种
|
||||||
if (riskRules.ageLimit(resultData, this, 1)) {
|
if (resultData.productTrialInfoDTO.isRemit == '0' && resultData.productTrialInfoDTO.remitType == '0') {
|
||||||
|
if (riskRules.ageLimit(resultData, this, 1)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (riskRules.ageLimit(resultData, this)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (riskRules.medicalLimit(resultData, this)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
if (riskRules.ageLimit(resultData, this)) {
|
if (riskRules.healthGradeLimit(resultData, this)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (riskRules.medicalLimit(resultData, this)) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if (riskRules.healthGradeLimit(resultData, this)) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// if (riskRules.lifeGradeLimit(resultData, this)) {
|
// if (riskRules.lifeGradeLimit(resultData, this)) {
|
||||||
// return
|
// return
|
||||||
// }
|
// }
|
||||||
|
|||||||
@@ -178,6 +178,13 @@ export default {
|
|||||||
beforeRouteLeave(to, from, next) {
|
beforeRouteLeave(to, from, next) {
|
||||||
document.body.style.backgroundColor = ''
|
document.body.style.backgroundColor = ''
|
||||||
next()
|
next()
|
||||||
|
},
|
||||||
|
beforeRouteEnter(to, from, next) {
|
||||||
|
/*当进入的时候清清除 localstorage 的内容*/
|
||||||
|
;['saleInsuredInfo', 'saleInsuredPersonInfo', 'chooseProducts', "hint"].forEach(type => {
|
||||||
|
localStorage.removeItem(type)
|
||||||
|
})
|
||||||
|
next()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -8,7 +8,13 @@
|
|||||||
<van-tag type="primary" v-if="item.isMainRisk === 0" class="mr5 green" plain>主险</van-tag>
|
<van-tag type="primary" v-if="item.isMainRisk === 0" class="mr5 green" plain>主险</van-tag>
|
||||||
<van-tag type="primary" v-else class="mr5 green" plain>附加险</van-tag>
|
<van-tag type="primary" v-else class="mr5 green" plain>附加险</van-tag>
|
||||||
<span class="ml5 center fs13 flex1">{{ item.riskName }}</span>
|
<span class="ml5 center fs13 flex1">{{ item.riskName }}</span>
|
||||||
<van-tag type="primary" v-if="Number(item.isMainRisk) === 0 && item.hasAddtionRisk && isEnterAddtionRisk" plain @click="selectAddtionRisk" class="green mr8">
|
<van-tag
|
||||||
|
type="primary"
|
||||||
|
v-if="Number(item.isMainRisk) === 0 && item.hasAddtionRisk && isEnterAddtionRisk"
|
||||||
|
plain
|
||||||
|
@click="selectAddtionRisk"
|
||||||
|
class="green mr8"
|
||||||
|
>
|
||||||
附
|
附
|
||||||
</van-tag>
|
</van-tag>
|
||||||
<van-icon name="search" size="20" v-if="item.documentDTOS && item.documentDTOS.length > 0" @click="seeDocument(index)" class="green mr5" />
|
<van-icon name="search" size="20" v-if="item.documentDTOS && item.documentDTOS.length > 0" @click="seeDocument(index)" class="green mr5" />
|
||||||
@@ -382,7 +388,7 @@
|
|||||||
<van-popup v-model="showAdditionRiskPopup" round position="bottom" class="addtion-risk">
|
<van-popup v-model="showAdditionRiskPopup" round position="bottom" class="addtion-risk">
|
||||||
<van-picker show-toolbar @confirm="handleSubmitAddAdditionRisk" @cancel="handleSubmitAddAdditionRisk({ submit: false })">
|
<van-picker show-toolbar @confirm="handleSubmitAddAdditionRisk" @cancel="handleSubmitAddAdditionRisk({ submit: false })">
|
||||||
<template #columns-top>
|
<template #columns-top>
|
||||||
<addtion-risk-list ref="additionRiskList" :show-next="false" />
|
<addtion-risk-list ref="additionRiskList" :show-next="false" :trial-test="false" />
|
||||||
</template>
|
</template>
|
||||||
</van-picker>
|
</van-picker>
|
||||||
</van-popup>
|
</van-popup>
|
||||||
@@ -435,6 +441,7 @@ import SelectRadio from '@/components/ebiz/SelectRadio'
|
|||||||
import riskRules from '@/views/ebiz/commonFlowImprove/risk-rules'
|
import riskRules from '@/views/ebiz/commonFlowImprove/risk-rules'
|
||||||
import AddtionRiskList from '@/views/ebiz/commonFlowImprove/AddRiskList.vue'
|
import AddtionRiskList from '@/views/ebiz/commonFlowImprove/AddRiskList.vue'
|
||||||
import { trial } from '@/api/ebiz/common/common'
|
import { trial } from '@/api/ebiz/common/common'
|
||||||
|
import { syncLocalstorageData } from '@/assets/js/syncLocalstorageData'
|
||||||
|
|
||||||
const DUTY_DEFAULT_MUTIPLE = 1000
|
const DUTY_DEFAULT_MUTIPLE = 1000
|
||||||
const DUTY_DEFAULT_MIN = 10000
|
const DUTY_DEFAULT_MIN = 10000
|
||||||
@@ -503,9 +510,13 @@ export default {
|
|||||||
calFactorIndex: '',
|
calFactorIndex: '',
|
||||||
premiumData: [], //试算
|
premiumData: [], //试算
|
||||||
saleInsuredInfo: {},
|
saleInsuredInfo: {},
|
||||||
saleInsuredPersonInfo: {
|
saleInsuredPersonInfo: syncLocalstorageData(
|
||||||
sex: '0'
|
{
|
||||||
}, //投保人信息
|
sex: '0',
|
||||||
|
birthday: ""
|
||||||
|
}, //投保人信息,
|
||||||
|
{ name: 'saleInsuredPersonInfo', encrypt: true}
|
||||||
|
),
|
||||||
trialList: [],
|
trialList: [],
|
||||||
popupShow: false,
|
popupShow: false,
|
||||||
columns: [],
|
columns: [],
|
||||||
@@ -558,13 +569,17 @@ export default {
|
|||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
passUserInfoCheck() {
|
passUserInfoCheck() {
|
||||||
const keys = Object.keys(this.userInfo)
|
const info = this.saleInsuredPersonInfo
|
||||||
return (
|
const keys = Object.keys(info)
|
||||||
keys.filter(key => {
|
const res = keys.filter(key => {
|
||||||
const msg = this.userInfo[key]
|
const msg = info[key]
|
||||||
return msg !== undefined && msg !== null && msg !== ''
|
return msg != null && msg !== ''
|
||||||
}).length === keys.length
|
})
|
||||||
)
|
// debugger
|
||||||
|
console.log(res, info)
|
||||||
|
if (res !== -1) {
|
||||||
|
return res.length === keys.length
|
||||||
|
}else return false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
@@ -747,7 +762,6 @@ export default {
|
|||||||
async init() {
|
async init() {
|
||||||
let that = this
|
let that = this
|
||||||
|
|
||||||
localStorage.setItem('isTrial', '1')
|
|
||||||
const { productCode: productDetailCode, productName } = this.productDTOS[0]
|
const { productCode: productDetailCode, productName } = this.productDTOS[0]
|
||||||
const productDetail = await information({
|
const productDetail = await information({
|
||||||
productCodes: [productDetailCode],
|
productCodes: [productDetailCode],
|
||||||
@@ -2701,6 +2715,11 @@ export default {
|
|||||||
|
|
||||||
//选择附加险
|
//选择附加险
|
||||||
selectAddtionRisk() {
|
selectAddtionRisk() {
|
||||||
|
if (!this.passUserInfoCheck) {
|
||||||
|
this.$toast('请补充完整相应的信息内容')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
//存储附加险列表
|
//存储附加险列表
|
||||||
let addRiskCodes = []
|
let addRiskCodes = []
|
||||||
this.chooseProducts.forEach(item => {
|
this.chooseProducts.forEach(item => {
|
||||||
@@ -3543,10 +3562,12 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleSubmitAddAdditionRisk({ submit = true } = {}) {
|
handleSubmitAddAdditionRisk({ submit = true } = {}) {
|
||||||
|
const ele = this.$refs.additionRiskList
|
||||||
if (submit) {
|
if (submit) {
|
||||||
const ele = this.$refs.additionRiskList
|
const error = ele.nextStep()
|
||||||
ele.nextStep()
|
if (!error) return
|
||||||
}
|
}
|
||||||
|
ele.result = ''
|
||||||
this.showAdditionRiskPopup = false
|
this.showAdditionRiskPopup = false
|
||||||
},
|
},
|
||||||
submitOrder(riskDTO = []) {
|
submitOrder(riskDTO = []) {
|
||||||
|
|||||||
Reference in New Issue
Block a user