Commit 6db8ed24 by Chao Sun

批量页面计算跳转页面

parent 07019ae9
...@@ -219,9 +219,12 @@ ...@@ -219,9 +219,12 @@
// this.resultShowFlag = true; // this.resultShowFlag = true;
//计算成功返回上一页 //计算成功返回上一页
uni.setStorageSync('resIrrAndSimpleResInfos',this.irrAndSimpleResInfos); uni.setStorageSync('resIrrAndSimpleResInfos',this.irrAndSimpleResInfos);
uni.navigateBack({ // uni.navigateBack({
delta:1,//返回层数,2则上上页 // delta:1,//返回层数,2则上上页
}) // })
uni.navigateTo({
url: '/pages/index/index?isBack=1'
});
}else{ }else{
uni.showToast({ uni.showToast({
title: res['message'], title: res['message'],
......
...@@ -235,8 +235,18 @@ ...@@ -235,8 +235,18 @@
dataImport dataImport
}, },
onLoad() { onLoad() {
//初始化删除上次批量计算结果 if(dataHandling.getQueryString('isBack') == 1){
uni.removeStorageSync('resIrrAndSimpleResInfos'); console.log(dataHandling.getQueryString('isBack'));
this.irrAndSimpleCalcuteParam.paymentPeriod = uni.getStorageSync('calcuteData').paymentPeriod;
this.irrAndSimpleCalcuteParam.annualPremium = uni.getStorageSync('calcuteData').annualPremium;
this.irrAndSimpleCalcuteParam.allFirstPayment = uni.getStorageSync('calcuteData').allFirstPayment;
this.businessType = uni.getStorageSync('calcuteData').businessType;
this.calcuteType = uni.getStorageSync('calcuteData').calcuteType;
this.yearWithdrawalInfos = uni.getStorageSync('calcuteData').yearWithdrawalInfos;
}else{
//初始化删除上次批量计算结果
uni.removeStorageSync('resIrrAndSimpleResInfos');
}
if(!uni.getStorageSync('businessNo')){ if(!uni.getStorageSync('businessNo')){
uni.setStorageSync('businessNo', nanoid().replace(/\_/g,"")); uni.setStorageSync('businessNo', nanoid().replace(/\_/g,""));
}else{ }else{
...@@ -302,7 +312,7 @@ ...@@ -302,7 +312,7 @@
this.irrAndSimpleCalte(); this.irrAndSimpleCalte();
}else if(this.calcuteMethod === '2'){ }else if(this.calcuteMethod === '2'){
//批量 //批量
if(!this.irrAndSimpleCalcuteParam.paymentPeriod ){ if(!this.irrAndSimpleCalcuteParam.paymentPeriod || this.irrAndSimpleCalcuteParam.paymentPeriod==0){
uni.showToast({ uni.showToast({
title: '请填写交费年限且交费年限必须大于0', title: '请填写交费年限且交费年限必须大于0',
duration: 2000, duration: 2000,
...@@ -319,6 +329,58 @@ ...@@ -319,6 +329,58 @@
}) })
return; return;
} }
if(this.yearWithdrawalInfos.length>0){
for (let i = 0; i < this.yearWithdrawalInfos.length; i++) {
//增额提领信息校验
if(this.calcuteType == 1){
if(!this.yearWithdrawalInfos[i].withdrawalStart || !this.yearWithdrawalInfos[i].withdrawalEnd){
uni.showToast({
title: `请输入第${i+1}行提领开始日期和结束日期,且该日期必须大于0`,
duration: 2000,
icon: 'none'
})
return;
}else{
if(this.yearWithdrawalInfos[i].withdrawalEnd < this.yearWithdrawalInfos[i].withdrawalStart){
uni.showToast({
title: `第${i+1}行,提领开始日期必须小于等于提领结束日期!`,
duration: 2000,
icon: 'none'
})
return;
}
}
if(this.yearWithdrawalInfos[i]['yearWithdrawalAmount'] && this.yearWithdrawalInfos[i]['yearWithdrawalAmount']<0){
uni.showToast({
title: `第${i+1}行,提领金额必须大于0`,
duration: 2000,
icon: 'none'
})
return;
}else{
if(!this.yearWithdrawalInfos[i]['yearWithdrawalAmount']){
uni.showToast({
title: `请输入第${i+1}行,提领金额`,
duration: 2000,
icon: 'none'
})
return;
}
}
}
//年金提领信息校验
if(this.calcuteType == 2){
if(!this.yearWithdrawalInfos[i]['withdrawalStart'] || this.yearWithdrawalInfos[i]['withdrawalStart']<0){
uni.showToast({
title: '请输入提领信息保单年度,且年度值必须大于0',
duration: 2000,
icon: 'none'
})
return;
}
}
}
}
// 输入批量数据,缓存当页数据 // 输入批量数据,缓存当页数据
const calcuteData = { const calcuteData = {
paymentPeriod:this.irrAndSimpleCalcuteParam.paymentPeriod, paymentPeriod:this.irrAndSimpleCalcuteParam.paymentPeriod,
...@@ -398,7 +460,7 @@ ...@@ -398,7 +460,7 @@
}) })
return; return;
} }
if(this.irrAndSimpleCalcuteParam.paymentPeriod < 0 ){ if(this.irrAndSimpleCalcuteParam.paymentPeriod <= 0 ){
uni.showToast({ uni.showToast({
title: '交费年限必须大于0', title: '交费年限必须大于0',
duration: 2000, duration: 2000,
...@@ -423,7 +485,7 @@ ...@@ -423,7 +485,7 @@
}) })
return; return;
} }
if(this.irrAndSimpleCalcuteParam.annualPremium < 0){ if(this.irrAndSimpleCalcuteParam.annualPremium <= 0){
uni.showToast({ uni.showToast({
title: '年交保费必须大于0', title: '年交保费必须大于0',
duration: 2000, duration: 2000,
...@@ -463,7 +525,7 @@ ...@@ -463,7 +525,7 @@
}) })
return; return;
}else{ }else{
if(this.yearWithdrawalInfos[i].withdrawalEnd > this.yearWithdrawalInfos[i].withdrawalStart){ if(this.yearWithdrawalInfos[i].withdrawalEnd < this.yearWithdrawalInfos[i].withdrawalStart){
uni.showToast({ uni.showToast({
title: `第${i+1}行,提领开始日期必须小于等于提领结束日期!`, title: `第${i+1}行,提领开始日期必须小于等于提领结束日期!`,
duration: 2000, duration: 2000,
...@@ -480,12 +542,14 @@ ...@@ -480,12 +542,14 @@
}) })
return; return;
}else{ }else{
uni.showToast({ if(!this.yearWithdrawalInfos[i]['yearWithdrawalAmount']){
title: `请输入第${i+1}行,提领金额`, uni.showToast({
duration: 2000, title: `请输入第${i+1}行,提领金额`,
icon: 'none' duration: 2000,
}) icon: 'none'
return; })
return;
}
} }
} }
//年金提领信息校验 //年金提领信息校验
...@@ -500,7 +564,6 @@ ...@@ -500,7 +564,6 @@
} }
} }
} }
} }
if(this.calcuteMethod == 1){ if(this.calcuteMethod == 1){
if(!this.irrAndSimple.nyear && this.irrAndSimple.nyear!=0){ if(!this.irrAndSimple.nyear && this.irrAndSimple.nyear!=0){
...@@ -511,15 +574,15 @@ ...@@ -511,15 +574,15 @@
}) })
return; return;
}else{ }else{
if(this.irrAndSimple.nyear>100){ if(this.irrAndSimple.nyear>105){
uni.showToast({ uni.showToast({
title: '现金价值年度不能大于100!', title: '现金价值年度不能大于105!',
duration: 2000, duration: 2000,
icon: 'none' icon: 'none'
}) })
return; return;
} }
if(this.irrAndSimple.nyear<0){ if(this.irrAndSimple.nyear<=0){
uni.showToast({ uni.showToast({
title: '现金价值年度必须大于0!', title: '现金价值年度必须大于0!',
duration: 2000, duration: 2000,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment