证件类型是居民身份证的,客户填写或修改证件起始日期或证件止期时,另一项自动计算带出(增加组件)

This commit is contained in:
liu.xiaofeng@ebiz-digits.com
2023-07-04 16:13:56 +08:00
parent c40a141141
commit 217afc6ce0
3 changed files with 75 additions and 0 deletions

View File

@@ -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
}
}

View File

@@ -388,6 +388,7 @@ import OccupationPicker from '@/components/ebiz/occipation/OccupationPicker'
import CustomerPicker from '@/components/ebiz/customer/CustomerPicker' import CustomerPicker from '@/components/ebiz/customer/CustomerPicker'
import DataDictionary from '@/assets/js/utils/data-dictionary' import DataDictionary from '@/assets/js/utils/data-dictionary'
import areaList from '@/assets/js/utils/areaForSale' import areaList from '@/assets/js/utils/areaForSale'
import countCredentialValidity from '@/assets/js/utils/countCredentialValidity'
import areaLists from '@/assets/js/utils/areaNewForSale' import areaLists from '@/assets/js/utils/areaNewForSale'
import { saveOrUpdateOrderInfo, getAuthCode, getOrderDetail, getCompany } from '@/api/ebiz/sale/sale' import { saveOrUpdateOrderInfo, getAuthCode, getOrderDetail, getCompany } from '@/api/ebiz/sale/sale'
import utilsAge from '@/assets/js/utils/age' import utilsAge from '@/assets/js/utils/age'
@@ -860,6 +861,9 @@ export default {
this.effectiveDateTypeAble = age <= 45 this.effectiveDateTypeAble = age <= 45
} }
} }
if(this.userInfo.idNo){
countCredentialValidity.getEndDate(this.userInfo.idNo,val)
}
break break
case '1': case '1':
{ {

View File

@@ -148,6 +148,11 @@ export default {
if (res.result == '0') { if (res.result == '0') {
res.orderDTO.insuredDTOs[0].riskDTOLst.forEach(item => { res.orderDTO.insuredDTOs[0].riskDTOLst.forEach(item => {
if(item.isMainRisk == '0'){ if(item.isMainRisk == '0'){
/**
* @Author: LiuXiaoFeng
* @Description: 保险期间大于1年或者是保终身的才展示产品说明书
* @Date: 2023/7/4
**/
if(item.insuYearFlag == 'Y' && item.insuYear > 1){ if(item.insuYearFlag == 'Y' && item.insuYear > 1){
this.hasProductTip = true this.hasProductTip = true
} }