diff --git a/src/views/ebiz/cardList/information.vue b/src/views/ebiz/cardList/information.vue index e4fb25466..38a725655 100644 --- a/src/views/ebiz/cardList/information.vue +++ b/src/views/ebiz/cardList/information.vue @@ -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') {