Merge branch 'feature/GFRS-834【0402】国富人寿国富栋梁定期寿险' into release/0421

# Conflicts:
#	src/views/ebiz/sale/SignatureConfirmation.vue
This commit is contained in:
tian.guangyuan
2020-04-21 19:54:22 +08:00
3 changed files with 159 additions and 9 deletions

View File

@@ -375,7 +375,9 @@ export default {
//是否需存在特殊配置 0-是 1-否
isTrial: localStorage.isTrial,
//缴费期间对应index索引
payEndYearColumnsIndex: 0
payEndYearColumnsIndex: 0,
// 后台配置的校验规则
ruleExpression: {}
}
},
mounted() {
@@ -465,6 +467,79 @@ export default {
//初始化数据试算
this.getTrial()
})
// 判断是否 含有 后台配置js验证函数
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 config = ''
config = JSON.parse(item.ruleExpression);
// let errorMsg = item.errorMsg;
// config = {
// eventName: 'GFRS_M0020_payEndYear_insuYear',
// eventType: 'onConfirm',
// funBody: [
// 'let ageMap = {',
// ' "10Y":{"30Y": 55,"70A": 55,"88A": 55},',
// ' "20Y":{ "30Y": 55, "70A": 50, "88A": 55 }, ',
// ' "30Y":{ "30Y": 45, "70A": 40, "88A": 45 },',
// '};',
// 'let payEndYear = "";',
// 'let insuYear = "";',
// 'let age = this.saleInsuredPersonInfo.age;',
// 'let parObj = {};',
// 'par.map(item => {',
// ' parObj[item.code] = item;',
// '});',
// 'if(ParKey == "payEndYear"){',
// ' payEndYear = Par.value + Par.flag;',
// ' lintAgeObj = ageMap[payEndYear];',
// ' let flag = true, num = parObj.insuYear.columns.length;',
// ' parObj.insuYear.columns.forEach(item => {',
// ' let lintAge = lintAgeObj[ item.value + item.flag ];',
// ' if( age > lintAge ){',
// ' item.disabled = true;',
// ' num = num - 1 ;',
// ' }else{',
// ' if(flag){',
// ' parObj.insuYear.insuYear = item.value;',
// ' parObj.insuYear.insuYearFlag = item.flag;',
// ' parObj.insuYear.showContent = item.text;',
// ' flag = false;',
// ' };',
// ' item.disabled = false;',
// ' };',
// ' });',
// ' if(!num){',
// ' this.errorMsg.push("被保险人年龄不符合当前所选交费期间");',
// ' payEndYear = parObj.payEndYear.payEndYear + parObj.payEndYear.payEndYearFlag;',
// ' lintAgeObj = ageMap[payEndYear];',
// ' parObj.insuYear.columns.forEach(item => {',
// ' let lintAge = lintAgeObj[ item.value + item.flag ];',
// ' if( age > lintAge ){',
// ' item.disabled = true;',
// ' }else{',
// ' item.disabled = false;',
// ' };',
// ' });',
// ' return false;',
// ' };',
// ' return true;',
// '}'],
// funPar: ['par','ParKey','Par'],
// }
// console.log("config",config);
this.$on(config.eventName, new Function( ...config.funPar, config.funBody.join('')));
rules.eventList.push(config.eventName)
})
})
}
},
//特殊处理 GFRS_M0016 GFRS_A0004 GFRS_A0005 赔付比例处理
async dogetLimitAndGetRate() {
@@ -580,6 +655,7 @@ export default {
//确认选择字段
onConfirm(value) {
this.columns = []
// let productCode = this.chooseProducts[this.productIndex].productCode
let currentFactor = this.chooseProducts[this.productIndex].calFactorLst
let currentEle = currentFactor[this.calFactorIndex]
console.log('value', value)
@@ -611,6 +687,41 @@ export default {
this.popupShow = false
return false
}
// console.log("productCode ==>" , productCode)
// if(this.ruleExpression[productCode]){
// this.errorMsg = []
// this.ruleExpression[productCode].eventList.forEach(item => {
// this.$emit(item,currentFactor,currentEle.code,value);
// })
// if(this.errorMsg.length > 0){
// this.$toast(this.errorMsg[0]);
// this.popupShow = false
// return false
// }
// }
let productCode = this.chooseProducts[this.productIndex].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);
})
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

View File

@@ -111,6 +111,12 @@ export default {
})
}
if(resultData.productTrialInfoDTO.ruleExpression){
let ruleExpression = localStorage.ruleExpression ? JSON.parse(localStorage.ruleExpression) : {};
ruleExpression[resultData.productCode] = resultData.productTrialInfoDTO.ruleExpression
localStorage.ruleExpression = JSON.stringify(ruleExpression)
}
/********start 主险选择限制 start******/
if (riskRules.ageLimit(resultData, this)) {

View File

@@ -932,13 +932,46 @@ export default {
!!res.orderDTO.productDTO.special.content &&
res.orderDTO.productDTO.special.content !== ''
) {
const message = '  ' + res.orderDTO.productDTO.special.content
// const message = res.orderDTO.productDTO.special.content
// Dialog({ message })
let content = res.orderDTO.productDTO.special.content
// {
// title: '标题',
// message: '内容',
// confirmButtonText: '确认',
// messageAlign: 'left'
// }
// title 需要标题则配置,不需要则不要配置
// message 内容,\n换行
// confirmButtonText确认按钮的文字
// messageAlign 对齐方式,固定左对齐,为'left'
try {
const config = JSON.parse(content);
config.message = '  ' + config.message
config.message = config.message.split('\\n').join('\n  ')
// {
// title: '', //需要标题则配置,不需要则不要配置
// message: '提示的主体文本',
// confirmButtonText: '确认按钮的问题',
// messageAlign: 'left' //对齐方式,左对齐
// }
Dialog(config)
} catch (error) {
const message = '  ' + content
Dialog({
message: message.split('\\n').join('\n  '),
confirmButtonText: '本人已阅读并同意上述特别约定内容',
messageAlign: 'left'
})
}
// const message = '  ' + res.orderDTO.productDTO.special.content
// Dialog({
// message: message.split('\\n').join('\n  '),
// confirmButtonText: '本人已阅读并同意上述特别约定内容',
// messageAlign: 'left'
// })
}
/* if (isShowDialog) {
//记录每次弹框的订单号。再次进入页面,订单号改变才会弹窗。
let lastOrderNo = localStorage.lastOrderNo