mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-11 20:16:44 +08:00
GFRS-2504 指定生效日需求-修改localstorage取值为空问题-提交人:白金岩
This commit is contained in:
@@ -38,14 +38,14 @@ export default {
|
||||
result: '',
|
||||
delList: [],
|
||||
radioVal: '',
|
||||
isFrom: localStorage.isFrom,
|
||||
isFrom: this.$CacheUtils.getLocItem('isFrom'),
|
||||
activeFlag: ''
|
||||
}
|
||||
},
|
||||
async mounted() {
|
||||
if (localStorage.isFrom == 'sale') {
|
||||
if (this.$CacheUtils.getLocItem('isFrom') == 'sale') {
|
||||
return new Promise((resolve, reject) => {
|
||||
getOrderDetail({ orderNo: localStorage.orderNo }).then(
|
||||
getOrderDetail({ orderNo: this.$CacheUtils.getLocItem('orderNo') }).then(
|
||||
res => {
|
||||
if (res.result == 0) {
|
||||
//------------------------专为桂/惠企写死--begin---------------//
|
||||
@@ -97,7 +97,7 @@ export default {
|
||||
},
|
||||
//获取主险列表
|
||||
async getMainRiskList() {
|
||||
let mainRiskCodes = localStorage.mainRiskCodes && JSON.parse(localStorage.mainRiskCodes)
|
||||
let mainRiskCodes = this.$CacheUtils.getLocItem('mainRiskCodes') && JSON.parse(this.$CacheUtils.getLocItem('mainRiskCodes'))
|
||||
let mainListDate = { platform: 'app' }
|
||||
switch (this.isFrom) {
|
||||
case 'proposal':
|
||||
@@ -127,7 +127,7 @@ export default {
|
||||
}
|
||||
this.list = resultData.mainRiskDTOS
|
||||
//------------------------专为惠企写死--begin---------------//
|
||||
if (this.list.length > 0 && this.specilFlag == '1' && localStorage.isFrom == 'sale') {
|
||||
if (this.list.length > 0 && this.specilFlag == '1' && this.$CacheUtils.getLocItem('isFrom') == 'sale') {
|
||||
this.result = this.list.find(v => {
|
||||
return v.riskProductCode == 'GFRS_M0040'
|
||||
})
|
||||
@@ -159,20 +159,20 @@ export default {
|
||||
return
|
||||
}
|
||||
//置空产品
|
||||
localStorage.chooseProducts = ''
|
||||
this.$CacheUtils.setLocItem('chooseProducts','')
|
||||
|
||||
//添加主险
|
||||
this.addMainRisk()
|
||||
},
|
||||
//储存主险
|
||||
async addMainRisk() {
|
||||
localStorage.setItem('isTrial', '1')
|
||||
this.$CacheUtils.setLocItem('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
|
||||
this.$CacheUtils.setLocItem('isTrial',resultData.productTrialInfoDTO.productTrialYearDTOS != null ? '0' : '1')
|
||||
this.$CacheUtils.setLocItem('hint',resultData.hint)
|
||||
if (resultData.productTrialInfoDTO.dutyGroup != null) {
|
||||
resultData.productTrialInfoDTO.dutyGroup.map(item => {
|
||||
if (item.dutyName == '意外身故/伤残保险金') {
|
||||
@@ -182,9 +182,9 @@ export default {
|
||||
}
|
||||
|
||||
if (resultData.productTrialInfoDTO.ruleExpression) {
|
||||
let ruleExpression = localStorage.ruleExpression ? JSON.parse(localStorage.ruleExpression) : {}
|
||||
let ruleExpression = this.$CacheUtils.getLocItem('ruleExpression') ? JSON.parse(this.$CacheUtils.getLocItem('ruleExpression')) : {}
|
||||
ruleExpression[resultData.productCode] = resultData.productTrialInfoDTO.ruleExpression
|
||||
localStorage.ruleExpression = JSON.stringify(ruleExpression)
|
||||
this.$CacheUtils.setLocItem('ruleExpression',JSON.stringify(ruleExpression))
|
||||
}
|
||||
|
||||
/********start 主险选择限制 start******/
|
||||
@@ -224,30 +224,30 @@ export default {
|
||||
}
|
||||
|
||||
let flagPermission = await riskRules.getProductSellPermissionList(resultData.productCode, this)
|
||||
if (flagPermission && localStorage.isFrom != 'proposal') {
|
||||
if (flagPermission && this.$CacheUtils.getLocItem('isFrom') != 'proposal') {
|
||||
//校验该代理人是否有该产品的售卖权限
|
||||
return this.$toast('抱歉,您没有该产品的销售权限!')
|
||||
}
|
||||
|
||||
let flagCompany = await riskRules.checkCompany(resultData.productCode, JSON.parse(this.$CacheUtils.getLocItem('saleInsuredInfo')).workcompany, this)
|
||||
if (flagCompany && localStorage.isFrom != 'proposal') {
|
||||
if (flagCompany && this.$CacheUtils.getLocItem('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
|
||||
this.$CacheUtils.setLocItem('addtionRiskLst',JSON.stringify(resultData.productTrialInfoDTO.addtionRiskLst))
|
||||
this.$CacheUtils.setLocItem('isAutoPay',resultData.isAutoPay)
|
||||
this.$CacheUtils.setLocItem('isRenew',resultData.isRenew)
|
||||
this.$CacheUtils.setLocItem('isForceRenew',resultData.isForceRenew)
|
||||
this.$CacheUtils.setLocItem('isRelated',resultData.isRelated)
|
||||
|
||||
let calFactorLst = this.getFactorList(resultData)
|
||||
let productTrialYearDTOS = resultData.productTrialInfoDTO.productTrialYearDTOS != null ? resultData.productTrialInfoDTO.productTrialYearDTOS : null
|
||||
let hasAddtionRisk = resultData.productTrialInfoDTO.addtionRiskLst ? true : false
|
||||
let currentProductInfo =
|
||||
localStorage.isTrial == '1'
|
||||
this.$CacheUtils.getLocItem('isTrial') == '1'
|
||||
? {
|
||||
calFactorLst,
|
||||
hasAddtionRisk,
|
||||
@@ -282,15 +282,15 @@ export default {
|
||||
|
||||
//构建险种数组
|
||||
let productsData
|
||||
if (localStorage.chooseProducts) {
|
||||
productsData = JSON.parse(localStorage.chooseProducts)
|
||||
if (this.$CacheUtils.getLocItem('chooseProducts')) {
|
||||
productsData = JSON.parse(this.$CacheUtils.getLocItem('chooseProducts'))
|
||||
productsData.push(currentProductInfo)
|
||||
} else {
|
||||
productsData = [currentProductInfo]
|
||||
}
|
||||
//保存选择险种
|
||||
productsData = this.$utils.unrepeatObj(productsData, 'productCode') //产品数组去重,跳转试算页面未成功重复添加同一产品的情况
|
||||
localStorage.chooseProducts = JSON.stringify(productsData)
|
||||
this.$CacheUtils.setLocItem('chooseProducts',JSON.stringify(productsData))
|
||||
this.jumpTo()
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user