【2022版学平险三款产品】学平险的指定生效日期需要根据这个规则调整一下,分了三个时间段判断

This commit is contained in:
li.yuetong
2022-05-25 15:36:23 +08:00
parent 248a21e260
commit efa2cb74ec
2 changed files with 46 additions and 2 deletions

View File

@@ -27,5 +27,16 @@ export default {
} else {
return 365
}
},
dateDiffer: function(Date_end) {
//date1结束时间
let date1 = new Date(Date_end);
//date2当前时间
let date2 = new Date();
date1 = new Date(date1.getFullYear(), date1.getMonth(), date1.getDate());
date2 = new Date(date2.getFullYear(), date2.getMonth(), date2.getDate());
const diff = date1.getTime() - date2.getTime(); //目标时间减去当前时间
const diffDate = diff / (24 * 60 * 60 * 1000); //计算当前时间与结束时间之间相差天数
return diffDate
}
}

View File

@@ -627,6 +627,8 @@ export default {
proSchemeCode: '',
productDate: '', //保险期间
now: afterDate.getAfterDays(1), //指定生效日期最小值
currentMonth: new Date().getMonth() + 1, //当前月份
currentYear: new Date().getFullYear(), //当前年份
certiexpiredateMin: afterDate.getAfterDays(1), //证件截止日期最小值
insuredSex: '',
isScan: false, //是否显示证件扫描组件
@@ -780,8 +782,7 @@ export default {
// })
// }
if (this.itemProductDTOS.productCode === 'GFRS_M0048' || this.itemProductDTOS.productCode === 'GFRS_M0049' || this.itemProductDTOS.productCode === 'GFRS_M0050'
|| this.itemProductDTOS.productCode === 'GFRS_M0062' || this.itemProductDTOS.productCode === 'GFRS_M0063'||this.itemProductDTOS.productCode === 'GFRS_M0064') {
if (this.itemProductDTOS.productCode === 'GFRS_M0048' || this.itemProductDTOS.productCode === 'GFRS_M0049' || this.itemProductDTOS.productCode === 'GFRS_M0050') {
//金掌桂学平险产品指定生效日规则调整的申请,学平险+60
this.filterMaxDate = afterDate.getAfterDays(Number(this.trialList[0].timeliness))
this.userInfo.relationToInsured = ''
@@ -796,6 +797,32 @@ export default {
this.onDateConfirm(this.cvaliDate, '6')
}
}
//学平险62、63、64
// 1、8月31日24时前投保
// 1若9月1日-投保日期60指定生效日期可选范围【T+1至T+60】
// 2若9月1日-投保日期≤60指定生效日期默认为2022年9月1日指定生效日期支持修改可选范围【T+1至T+60】
// 2、9月1日0时至9月30日24时投保指定生效日期默认为2022年9月1日指定生效日期支持修改可选范围【9月1日至T+60日】
// 3、10月1日起到12月31指定生效日期可选范围【T+1至T+60】。
if (this.itemProductDTOS.productCode === 'GFRS_M0062' || this.itemProductDTOS.productCode === 'GFRS_M0063'||this.itemProductDTOS.productCode === 'GFRS_M0064') {
//金掌桂学平险产品指定生效日规则调整的申请,学平险+60
this.filterMaxDate = afterDate.getAfterDays(Number(this.trialList[0].timeliness))
this.userInfo.relationToInsured = ''
this.showField = true
let dateDifferNumber = afterDate.dateDiffer(this.currentYear + '-09-01')
console.log(dateDifferNumber,'dateDifferNumber')
if(this.currentMonth == 9){
this.cvaliDate = this.currentYear + '-09-01'
} else if(1 <= this.currentMonth && this.currentMonth <= 8) {
if(dateDifferNumber <= 60){
this.cvaliDate = this.currentYear + '-09-01'
}else{
this.cvaliDate = dateUtils.formatDate(afterDate.getAfterDays(1), 'yyyy-MM-dd')
}
} else if(10 <= this.currentMonth && this.currentMonth <= 12) {
this.cvaliDate = dateUtils.formatDate(afterDate.getAfterDays(1), 'yyyy-MM-dd')
}
this.onDateConfirm(this.cvaliDate, '6')
}
//金掌桂无忧卡,少儿安康卡两款卡单产品关闭指定生效日功能,默认自承保之日起第四日零时生效
//GFRS_M0052 国富人寿少儿安康保险产品组合、GFRS_M0041 国富无忧卡-国富人寿综合意外伤害保险计划
if (this.itemProductDTOS.productCode === 'GFRS_M0052' || this.itemProductDTOS.productCode === 'GFRS_M0041') {
@@ -851,6 +878,12 @@ export default {
this.chooseKind = this.trialList[0].chooseKind
this.allPrice = this.trialList[0].prem
this.now = afterDate.getAfterDays(Number(this.trialList[0].timeliness))
} else if (this.itemProductDTOS.productCode === 'GFRS_M0062' ||this.itemProductDTOS.productCode === 'GFRS_M0063' || this.itemProductDTOS.productCode === 'GFRS_M0064'){
if(this.currentMonth == 9){
this.now = new Date(this.currentYear + "-09-01")
}else{
this.now = afterDate.getAfterDays(1)
}
}else {
// this.proScheme = this.trialList[0].proScheme
// this.proSchemeCode = this.trialList[0].proSchemeCode