diff --git a/src/views/ebiz/preserve/bc/BeneficiaryInfo.vue b/src/views/ebiz/preserve/bc/BeneficiaryInfo.vue index f6cd3c9c7..e8e6ec898 100644 --- a/src/views/ebiz/preserve/bc/BeneficiaryInfo.vue +++ b/src/views/ebiz/preserve/bc/BeneficiaryInfo.vue @@ -59,6 +59,7 @@ import { RadioGroup, Radio, Icon, Dialog } from 'vant' import { changeEdor, policyInfo } from '@/api/ebiz/preserve/preserve' import filters from '@/views/ebiz/preserve/filters' import businessCommon from '../js/business-common' +import utilsAge from '@/assets/js/utils/age' export default { name: 'BeneficiaryInfo', @@ -148,21 +149,35 @@ export default { }, //下一步 nextStep() { - let checkIdExpDate = true, //校验证件有效期是否过期 true-已过期 false-未过期 - overdueName = '' if (this.type == 2 && this.beneficiariesNew.length < 1) { this.$toast('受益人列表不能为空') return - } else if (this.beneficiariesNew.length > 0) { - checkIdExpDate = this.beneficiariesNew.some(i => { - overdueName = i.name - return Date.parse(i.idExpDate) < Date.parse(new Date()) - }) - } else { - checkIdExpDate = false } - if (checkIdExpDate) { - return this.$toast(`受益人${overdueName}的身份证件已过期`) + + //校验身份证有效期 + for (let i of this.beneficiariesNew) { + if (i.idType == '1') { + let age = utilsAge.getAge(i.birthday, new Date()) + if (Date.parse(i.idExpDate) < Date.parse(new Date())) { + return this.$toast(`受益人${i.name}的身份证件已过期`) + } + if (age < 46 && i.idExpDate == '9999-01-01') { + return this.$toast(`受益人${i.name}证件有效期不正常,年龄小于46周岁,证件有效期不能为长期`) + } + if (age < 16) { + if (Date.parse(i.idExpDate) - Date.parse(new Date()) > Date.parse('1975-01-01')) { + return this.$toast(`受益人${i.name}证件有效期不正常,未满16周岁的公民身份证有效期应小于等于5年`) + } + } else if (age >= 16 && age <= 25) { + if (Date.parse(i.idExpDate) - Date.parse(new Date()) > Date.parse('1980-01-01')) { + return this.$toast(`受益人${i.name}证件有效期不正常,16周岁至25周岁公民身份证有效期应小于等于10年`) + } + } else if (age >= 26 && age <= 45) { + if (Date.parse(i.idExpDate) - Date.parse(new Date()) > Date.parse('1980-01-01')) { + return this.$toast(`受益人${i.name}证件有效期不正常,26周岁至45周岁公民身份证有效期应小于等于20年`) + } + } + } } let beneRatio = 0 this.beneficiariesNew.forEach(item => { diff --git a/src/views/ebiz/preserve/common/Search.vue b/src/views/ebiz/preserve/common/Search.vue index 9c9d652a4..effe7912b 100644 --- a/src/views/ebiz/preserve/common/Search.vue +++ b/src/views/ebiz/preserve/common/Search.vue @@ -46,7 +46,11 @@ export default { list: [], // 客户列表 selected: 0, // 搜索类型 0 客户姓名 1 证件号码 2 手机号 isSearch: true, // 是否显示搜索按钮 - options: [{ text: '客户姓名', value: 0 }, { text: '证件号码', value: 1 }, { text: '手机号', value: 2 }], + options: [ + { text: '客户姓名', value: 0 }, + { text: '证件号码', value: 1 }, + { text: '手机号', value: 2 } + ], entry: '', // 入口 surrenderType: '' } @@ -102,8 +106,8 @@ export default { }, // 点击客户 handleClick(params) { - if (this.checkValidity(params) == '0') { - return this.$toast('当前客户的身份证件已过期') + if (this.checkValidity(params) == '0' && this.entry != 'CM') { + return this.$toast('您的证件有效期已过期,请立即更新您的证件有效期。如有问题,请致电400-694-6688') } this.entry = this.$route.query.entry let url = ''