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