Commit 6db8ed24 by Chao Sun

批量页面计算跳转页面

parent 07019ae9
......@@ -219,9 +219,12 @@
// this.resultShowFlag = true;
//计算成功返回上一页
uni.setStorageSync('resIrrAndSimpleResInfos',this.irrAndSimpleResInfos);
uni.navigateBack({
delta:1,//返回层数,2则上上页
})
// uni.navigateBack({
// delta:1,//返回层数,2则上上页
// })
uni.navigateTo({
url: '/pages/index/index?isBack=1'
});
}else{
uni.showToast({
title: res['message'],
......
......@@ -235,8 +235,18 @@
dataImport
},
onLoad() {
//初始化删除上次批量计算结果
uni.removeStorageSync('resIrrAndSimpleResInfos');
if(dataHandling.getQueryString('isBack') == 1){
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')){
uni.setStorageSync('businessNo', nanoid().replace(/\_/g,""));
}else{
......@@ -302,7 +312,7 @@
this.irrAndSimpleCalte();
}else if(this.calcuteMethod === '2'){
//批量
if(!this.irrAndSimpleCalcuteParam.paymentPeriod ){
if(!this.irrAndSimpleCalcuteParam.paymentPeriod || this.irrAndSimpleCalcuteParam.paymentPeriod==0){
uni.showToast({
title: '请填写交费年限且交费年限必须大于0',
duration: 2000,
......@@ -319,6 +329,58 @@
})
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 = {
paymentPeriod:this.irrAndSimpleCalcuteParam.paymentPeriod,
......@@ -398,7 +460,7 @@
})
return;
}
if(this.irrAndSimpleCalcuteParam.paymentPeriod < 0 ){
if(this.irrAndSimpleCalcuteParam.paymentPeriod <= 0 ){
uni.showToast({
title: '交费年限必须大于0',
duration: 2000,
......@@ -423,7 +485,7 @@
})
return;
}
if(this.irrAndSimpleCalcuteParam.annualPremium < 0){
if(this.irrAndSimpleCalcuteParam.annualPremium <= 0){
uni.showToast({
title: '年交保费必须大于0',
duration: 2000,
......@@ -463,7 +525,7 @@
})
return;
}else{
if(this.yearWithdrawalInfos[i].withdrawalEnd > this.yearWithdrawalInfos[i].withdrawalStart){
if(this.yearWithdrawalInfos[i].withdrawalEnd < this.yearWithdrawalInfos[i].withdrawalStart){
uni.showToast({
title: `第${i+1}行,提领开始日期必须小于等于提领结束日期!`,
duration: 2000,
......@@ -480,12 +542,14 @@
})
return;
}else{
uni.showToast({
title: `请输入第${i+1}行,提领金额`,
duration: 2000,
icon: 'none'
})
return;
if(!this.yearWithdrawalInfos[i]['yearWithdrawalAmount']){
uni.showToast({
title: `请输入第${i+1}行,提领金额`,
duration: 2000,
icon: 'none'
})
return;
}
}
}
//年金提领信息校验
......@@ -500,7 +564,6 @@
}
}
}
}
if(this.calcuteMethod == 1){
if(!this.irrAndSimple.nyear && this.irrAndSimple.nyear!=0){
......@@ -511,15 +574,15 @@
})
return;
}else{
if(this.irrAndSimple.nyear>100){
if(this.irrAndSimple.nyear>105){
uni.showToast({
title: '现金价值年度不能大于100!',
title: '现金价值年度不能大于105!',
duration: 2000,
icon: 'none'
})
return;
}
if(this.irrAndSimple.nyear<0){
if(this.irrAndSimple.nyear<=0){
uni.showToast({
title: '现金价值年度必须大于0!',
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