[FIX]电投-桂企-责任保费保存产品接口请求参数问题修复

This commit is contained in:
yuweiqi
2020-05-22 14:26:09 +08:00
parent 7d19f07a6d
commit 5d13235c8f

View File

@@ -49,7 +49,7 @@
/>
</div>
</div>
<div
<div
class="flex justify-content-s pv10 border-bottom"
v-if="riskFactor.type == 0"
:class="{ hidden: riskFactor.code == 'payEndYear' && item.isHidden }"
@@ -467,19 +467,19 @@ export default {
//初始化数据试算
this.getTrial()
})
// 判断是否 含有 后台配置js验证函数
if(localStorage.ruleExpression){
let ruleExpression = JSON.parse(localStorage.ruleExpression);
if (localStorage.ruleExpression) {
let ruleExpression = JSON.parse(localStorage.ruleExpression)
this.ruleExpression = ruleExpression
let productCodes = Object.keys(ruleExpression)
productCodes.forEach(itemKey => {
// console.log(ruleExpression[itemKey]);
let rules = ruleExpression[itemKey];
rules.eventList = [];
rules.forEach( item => {
let rules = ruleExpression[itemKey]
rules.eventList = []
rules.forEach(item => {
let config = ''
config = JSON.parse(item.ruleExpression);
config = JSON.parse(item.ruleExpression)
// let errorMsg = item.errorMsg;
// config = {
// eventName: 'GFRS_M0020_payEndYear_insuYear',
@@ -534,8 +534,8 @@ export default {
// '}'],
// funPar: ['par','ParKey','Par'],
// }
// console.log("config",config);
this.$on(config.eventName, new Function( ...config.funPar, config.funBody.join('')));
// console.log("config",config);
this.$on(config.eventName, new Function(...config.funPar, config.funBody.join('')))
rules.eventList.push(config.eventName)
})
})
@@ -688,7 +688,7 @@ export default {
return false
}
// console.log("productCode ==>" , productCode)
// if(this.ruleExpression[productCode]){
// this.errorMsg = []
// this.ruleExpression[productCode].eventList.forEach(item => {
@@ -701,28 +701,28 @@ export default {
// }
// }
let productCode = this.chooseProducts[this.productIndex].productCode
if(this.ruleExpression[productCode]){
if (this.ruleExpression[productCode]) {
this.errorMsg = []
let currentFactor = this.chooseProducts[this.productIndex].calFactorLst
let currentEle = currentFactor[this.calFactorIndex]
this.ruleExpression[productCode].eventList.forEach(item => {
this.$emit(item,currentFactor,currentEle.code,value);
this.$emit(item, currentFactor, currentEle.code, value)
})
if(this.errorMsg.length > 0){
this.$toast(this.errorMsg[0]);
if (this.errorMsg.length > 0) {
this.$toast(this.errorMsg[0])
this.errorMsg = []
this.popupShow = false
return false
}
}
// 后台配置 的 js函数 验证
// if(hasR){
// if(currentEle.code == 'payEndYear' || currentEle.code == 'insuYear'){
// this.payEndYear(currentEle.code,value.value,this.tmpInsuYear.insuYear + this.tmpInsuYear.insuYearFlag)
// }
// }
currentEle.showContent = value.text
let name = currentEle.code
currentEle[name] = value.value
@@ -1457,6 +1457,11 @@ export default {
riskItem['dutyLst'] = this.trialList[index].duty
//930折中方案责任险分档
riskItem['amt'] = this.trialList[index].amt
} else {
//国富人寿桂企保重大疾病保险产品专写
if (this.trialList[index].productCode == 'GFRS_M0024') {
riskItem['dutyLst'] = this.trialInfos[index].duty
}
}
//保费算保额
console.log('this.trialList', this.trialList[index].trialType)
@@ -1485,7 +1490,6 @@ export default {
this.trialInfos[index].amt = this.trialList[0].prem
}
// console.log(riskItem)
console.log(this.trialInfos[index])
riskItem = Object.assign(riskItem, this.trialInfos[index])
// console.log(riskItem)
riskDTOLst.push(riskItem)
@@ -1494,6 +1498,14 @@ export default {
if (!rollInResult) {
return
}
//国富人寿桂企保重大疾病保险产品专写
this.trialInfos.map((v, i) => {
if (v.productCode == 'GFRS_M0024') {
delete riskDTOLst[i].duty
}
})
// console.log('riskDTOLst', riskDTOLst)
//建议书需要添加全部投保人信息电投只需要投保人ID
let insuredDTOItem = Object.assign(this.saleInsuredPersonInfo, { riskDTOLst: riskDTOLst })