From 217afc6ce0dba539fef97ff921b3e0fd0b47c49b Mon Sep 17 00:00:00 2001 From: "liu.xiaofeng@ebiz-digits.com" Date: Tue, 4 Jul 2023 16:13:56 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=81=E4=BB=B6=E7=B1=BB=E5=9E=8B=E6=98=AF?= =?UTF-8?q?=E5=B1=85=E6=B0=91=E8=BA=AB=E4=BB=BD=E8=AF=81=E7=9A=84=EF=BC=8C?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E5=A1=AB=E5=86=99=E6=88=96=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E8=AF=81=E4=BB=B6=E8=B5=B7=E5=A7=8B=E6=97=A5=E6=9C=9F=E6=88=96?= =?UTF-8?q?=E8=AF=81=E4=BB=B6=E6=AD=A2=E6=9C=9F=E6=97=B6=EF=BC=8C=E5=8F=A6?= =?UTF-8?q?=E4=B8=80=E9=A1=B9=E8=87=AA=E5=8A=A8=E8=AE=A1=E7=AE=97=E5=B8=A6?= =?UTF-8?q?=E5=87=BA(=E5=A2=9E=E5=8A=A0=E7=BB=84=E4=BB=B6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../js/utils/countCredentialValidity.js | 66 +++++++++++++++++++ src/views/ebiz/sale/InsuredInfo.vue | 4 ++ src/views/ebiz/sale/insuranceClauses.vue | 5 ++ 3 files changed, 75 insertions(+) create mode 100644 src/assets/js/utils/countCredentialValidity.js diff --git a/src/assets/js/utils/countCredentialValidity.js b/src/assets/js/utils/countCredentialValidity.js new file mode 100644 index 000000000..09e1ada70 --- /dev/null +++ b/src/assets/js/utils/countCredentialValidity.js @@ -0,0 +1,66 @@ +import { idToData } from '@/views/ebiz/sale/js/verification' +import utilsAge from '@/assets/js/utils/age' + +export default { + getStartDate: function(idNo, endDate) { + //计算身份证起始日期 + let startDate = '' + + return startDate + }, + getEndDate: function(idNo, startDate) { + let thisbirthday = idToData(idNo).birthday + let age = utilsAge.getAge(thisbirthday, new Date()) + if (age < 16) { + /** + * @Author: LiuXiaoFeng + * @Description: 16周岁以下的证件有效期为5年 + * @Date: 2023/7/4 + **/ + + } else if (age >= 16 && age <= 21) { + /** + * @Author: LiuXiaoFeng + * @Description: 16周岁~21周岁的证件有效期为10年或5年 + * @Date: 2023/7/4 + **/ + + } else if(age >= 22 && age <= 25) { + /** + * @Author: LiuXiaoFeng + * @Description: 22周岁~25周岁的证件有效期为10年 + * @Date: 2023/7/4 + **/ + } else if (age >= 26 && age <= 35) { + /** + * @Author: LiuXiaoFeng + * @Description: 26周岁~35周岁的证件有效期为20年或10年 + * @Date: 2023/7/4 + **/ + + } else if (age >= 36 && age <= 45) { + /** + * @Author: LiuXiaoFeng + * @Description: 36周岁~45周岁的证件有效期为20年 + * @Date: 2023/7/4 + **/ + } else if (age >= 46 && age <= 65) { + /** + * @Author: LiuXiaoFeng + * @Description: 46周岁~65周岁的证件有效期为20年或长期 + * @Date: 2023/7/4 + **/ + } else if (age > 65) { + /** + * @Author: LiuXiaoFeng + * @Description: 65周岁以上的证件有效期为长期 + * @Date: 2023/7/4 + **/ + } + debugger + //计算身份证截止日期 + let endDate = '' + + return endDate + } +} diff --git a/src/views/ebiz/sale/InsuredInfo.vue b/src/views/ebiz/sale/InsuredInfo.vue index c3a1a431e..913c93807 100644 --- a/src/views/ebiz/sale/InsuredInfo.vue +++ b/src/views/ebiz/sale/InsuredInfo.vue @@ -388,6 +388,7 @@ import OccupationPicker from '@/components/ebiz/occipation/OccupationPicker' import CustomerPicker from '@/components/ebiz/customer/CustomerPicker' import DataDictionary from '@/assets/js/utils/data-dictionary' import areaList from '@/assets/js/utils/areaForSale' +import countCredentialValidity from '@/assets/js/utils/countCredentialValidity' import areaLists from '@/assets/js/utils/areaNewForSale' import { saveOrUpdateOrderInfo, getAuthCode, getOrderDetail, getCompany } from '@/api/ebiz/sale/sale' import utilsAge from '@/assets/js/utils/age' @@ -860,6 +861,9 @@ export default { this.effectiveDateTypeAble = age <= 45 } } + if(this.userInfo.idNo){ + countCredentialValidity.getEndDate(this.userInfo.idNo,val) + } break case '1': { diff --git a/src/views/ebiz/sale/insuranceClauses.vue b/src/views/ebiz/sale/insuranceClauses.vue index 4dc458d92..756a7f530 100644 --- a/src/views/ebiz/sale/insuranceClauses.vue +++ b/src/views/ebiz/sale/insuranceClauses.vue @@ -148,6 +148,11 @@ export default { if (res.result == '0') { res.orderDTO.insuredDTOs[0].riskDTOLst.forEach(item => { if(item.isMainRisk == '0'){ + /** + * @Author: LiuXiaoFeng + * @Description: 保险期间大于1年或者是保终身的才展示产品说明书 + * @Date: 2023/7/4 + **/ if(item.insuYearFlag == 'Y' && item.insuYear > 1){ this.hasProductTip = true }