From efa2cb74ecbe2fc09b1cba74959bf45af6dcebf3 Mon Sep 17 00:00:00 2001 From: "li.yuetong" Date: Wed, 25 May 2022 15:36:23 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=902022=E7=89=88=E5=AD=A6=E5=B9=B3?= =?UTF-8?q?=E9=99=A9=E4=B8=89=E6=AC=BE=E4=BA=A7=E5=93=81=E3=80=91=E5=AD=A6?= =?UTF-8?q?=E5=B9=B3=E9=99=A9=E7=9A=84=E6=8C=87=E5=AE=9A=E7=94=9F=E6=95=88?= =?UTF-8?q?=E6=97=A5=E6=9C=9F=E9=9C=80=E8=A6=81=E6=A0=B9=E6=8D=AE=E8=BF=99?= =?UTF-8?q?=E4=B8=AA=E8=A7=84=E5=88=99=E8=B0=83=E6=95=B4=E4=B8=80=E4=B8=8B?= =?UTF-8?q?=EF=BC=8C=E5=88=86=E4=BA=86=E4=B8=89=E4=B8=AA=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E6=AE=B5=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/js/utils/getAfterDate.js | 11 ++++++++ src/views/ebiz/cardList/information.vue | 37 +++++++++++++++++++++++-- 2 files changed, 46 insertions(+), 2 deletions(-) diff --git a/src/assets/js/utils/getAfterDate.js b/src/assets/js/utils/getAfterDate.js index af4a7d5a0..eae0b5e01 100644 --- a/src/assets/js/utils/getAfterDate.js +++ b/src/assets/js/utils/getAfterDate.js @@ -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 } } diff --git a/src/views/ebiz/cardList/information.vue b/src/views/ebiz/cardList/information.vue index 044cb4c35..add56c06f 100644 --- a/src/views/ebiz/cardList/information.vue +++ b/src/views/ebiz/cardList/information.vue @@ -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