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 }