【关于官微、金掌桂卡单产品生效日规则调整的申请】金掌桂无忧卡,少儿安康卡两款卡单产品关闭指定生效日功能--保险期间计算逻辑

This commit is contained in:
li.yuetong
2022-03-03 13:51:37 +08:00
parent 833bc471a4
commit 7e71c93ab6

View File

@@ -798,6 +798,29 @@ export default {
//GFRS_M0052 国富人寿少儿安康保险产品组合、GFRS_M0041 国富无忧卡-国富人寿综合意外伤害保险计划
if (this.itemProductDTOS.productCode === 'GFRS_M0052' || this.itemProductDTOS.productCode === 'GFRS_M0041') {
this.cvaliDate = dateUtils.formatDate(afterDate.getAfterDays(Number(this.trialList[0].timeliness)), 'yyyy-MM-dd')
//保险期间计算逻辑
let val = this.cvaliDate
if (Date.parse(val) < Date.parse(new Date())) {
return this.$toast('当前日期早于当日')
}
let currentDataArr = val.split('-')
let currentData = currentDataArr[0] + '' + currentDataArr[1] + '' + currentDataArr[2] + ''
let insuYear = JSON.parse(localStorage.insuYear)
let insuYearM, productDate, productDateTime
let insuYearD, hoDate
switch (insuYear.insuYearFlag) {
case 'D':
hoDate = Date.parse(val) / 1000 + (insuYear['insuYear'] - 1) * 24 * 3600
break
case 'Y':
hoDate = Date.parse(val) / 1000 + insuYear['insuYear'] * 24 * 3600 * (afterDate.isLeapYear(new Date(val).getFullYear()) - 1)
break
}
productDate = new Date(parseInt(hoDate) * 1000)
insuYearM = productDate.getMonth() + 1 < 10 ? '0' + (productDate.getMonth() + 1) : productDate.getMonth() + 1
insuYearD = productDate.getDate() < 10 ? '0' + productDate.getDate() : productDate.getDate()
productDateTime = productDate.getFullYear() + '' + insuYearM + '' + insuYearD + ''
this.productDate = currentData + '0时至' + productDateTime + '24时止'
}
//GFRS-2641 少儿安康
if (this.itemProductDTOS.productCode === 'GFRS_M0052') {