Compare commits

...

21 Commits

Author SHA1 Message Date
liu.xiaofeng@ebiz-digits.com
0615088cae 被保人人脸识别增加外国人永久居住证校验 2024-03-14 13:51:47 +08:00
liu.xiaofeng@ebiz-digits.com
5a95805d87 外国人永久居住证人脸识别的时候传递证件类型 2024-03-14 13:51:44 +08:00
liu.xiaofeng@ebiz-digits.com
256eefb80e 签字确认页面增加证件类型判断确定是否需要进行人脸识别 2024-03-14 13:51:39 +08:00
liu.xiaofeng@ebiz-digits.com
bf74ade0a4 投被受 增加规则校验 2024-03-14 13:48:17 +08:00
liu.xiaofeng@ebiz-digits.com
a8c66abbcd 外国人永久居留身份证增加长度校验 2024-03-14 13:47:48 +08:00
liu.xiaofeng@ebiz-digits.com
c0118b6cf0 学平险和万福卡增加外国人永久居住证需求内容 2024-03-14 13:45:39 +08:00
liu.xiaofeng@ebiz-digits.com
f9bcf7d771 学平险和意外险卡单投保流程增加外国人永久居住证的规则校验 2024-03-14 13:45:34 +08:00
liu.xiaofeng@ebiz-digits.com
6813ad8ab4 健康险支持外国人永久居留身份证办理的业务功能及非功能性需求 2024-03-14 13:45:29 +08:00
liu.xiaofeng@ebiz-digits.com
c86107aaaf 投被受 增加规则校验 2024-03-14 13:40:34 +08:00
liu.xiaofeng@ebiz-digits.com
c1dfd27604 外国人永久居留身份证增加长度校验 2024-03-14 13:39:41 +08:00
liu.xiaofeng@ebiz-digits.com
da88573133 证件有效期检验提示语修改 2024-03-14 13:35:55 +08:00
liu.xiaofeng@ebiz-digits.com
9d6105f0ed 外国人证件有效期计算补零操作 2024-03-14 13:35:51 +08:00
liu.xiaofeng@ebiz-digits.com
d06b794cbc 外国人永久居住证校验位检测去掉小写x 2024-03-14 13:35:47 +08:00
liu.xiaofeng@ebiz-digits.com
f7b7936dee 卡单证件有效期计算增加与当前日期对比的逻辑 2024-03-14 13:35:43 +08:00
liu.xiaofeng@ebiz-digits.com
280ec19892 卡单证件有效期计算增加与当前日期对比的逻辑 2024-03-14 13:35:39 +08:00
liu.xiaofeng@ebiz-digits.com
464ca95731 外国人永久居住证证件号码长度为15位的时候去掉生日和性别校验 2024-03-14 13:35:36 +08:00
liu.xiaofeng@ebiz-digits.com
55e200e36e 外国人证件有效期计算逻辑修改 2024-03-14 13:35:28 +08:00
liu.xiaofeng@ebiz-digits.com
47fb573cd6 外国人永久居住证15性别校验修改 2024-03-14 13:35:24 +08:00
liu.xiaofeng@ebiz-digits.com
fc68b2aab3 外国人永久居住证15日期校验修改 2024-03-14 13:35:21 +08:00
liu.xiaofeng@ebiz-digits.com
4fbb0e9470 投被受 增加规则校验 2024-03-14 13:35:18 +08:00
liu.xiaofeng@ebiz-digits.com
a10e6d29a4 外国人永久居留身份证增加长度校验 2024-03-14 13:35:14 +08:00
9 changed files with 375 additions and 80 deletions

View File

@@ -1046,6 +1046,10 @@ export default {
{
id: 2,
text: '户口本'
},
{
id: 8,
text: '外国人永久居留身份证'
}
],
// 卡单投保人证件类型
@@ -1055,8 +1059,8 @@ export default {
text: '居民身份证'
},
{
id: 2,
text: '户口本'
id: 8,
text: '外国人永久居留身份证'
}
],
// 新市民身份

View File

@@ -246,6 +246,7 @@ import { selectComp, getIdentityInfo } from './js/methods'
import Vue from 'vue'
import { GoodsAction, GoodsActionIcon, GoodsActionButton } from 'vant'
import riskRules from '@/views/ebiz/common/risk-rules'
import {idNoCheck8} from "../sale/js/verification";
DataDictionary.relationToAppnt = DataDictionary.relationToAppnt.slice(0, 4)
Vue.use(Checkbox).use(CheckboxGroup)
@@ -550,7 +551,7 @@ export default {
this.columns = DataDictionary.nativeplace
this.pickerIndex = this.userInfo.nativeplace - 1 > 0 ? this.userInfo.nativeplace - 1 : 0
} else if (pickerType == '2') {
this.columns = DataDictionary.cardListInsuredIdType.slice(0, 1)
this.columns = DataDictionary.cardListInsuredIdType
console.log(this.columns, '=======================this.columns==================')
} else if (pickerType == '3') {
this.columns = DataDictionary.degree
@@ -852,6 +853,11 @@ export default {
}
}
}
else if (this.userInfo.idType == '8') {
if (idNoCheck8(this.userInfo,'cardList').text){
return this.$toast(idNoCheck8(this.userInfo,'cardList').text)
}
}
if (this.manageComCode == '45' && (this.userInfo.isNewPeopleFlag == '' || this.userInfo.isNewPeopleFlag == null || this.userInfo.isNewPeopleFlag == undefined)) {
return this.$toast('投保人新市民身份不能为空')
}

View File

@@ -313,6 +313,7 @@ import dateUtils from '@/assets/js/utils/date-utils'
import Vue from 'vue'
import { GoodsAction, GoodsActionIcon, GoodsActionButton } from 'vant'
import riskRules from '@/views/ebiz/common/risk-rules'
import {idNoCheck8} from "../sale/js/verification";
DataDictionary.relationToAppnt = DataDictionary.relationToAppnt.slice(0, 4)
Vue.use(Checkbox).use(CheckboxGroup)
@@ -1267,11 +1268,17 @@ export default {
return this.$toast('证件有效期不正常26周岁至45周岁公民身份证有效期应小于等于20年')
}
}
}else if(this.insuredInfo.idType == '2'){
}
else if(this.insuredInfo.idType == '2'){
if (idToData(this.insuredInfo.idNo).age >= 16) {
return this.$toast('客户年龄在16周岁以上不能使用户口本作为有效证件')
}
}
else if (this.insuredInfo.idType == '8') {
if (idNoCheck8(this.insuredInfo,'cardList').text){
return this.$toast(idNoCheck8(this.insuredInfo,'cardList').text)
}
}
if (this.itemProductDTOS.productCode === 'GFRS_M0022') {
// return
// 如果是未成年人

View File

@@ -601,8 +601,7 @@
>元
</van-button
>
<van-goods-action-button type='danger' text='立即投保' @click='nextStep' v-no-more-click='1000'
style='border-radius: 0em; width: 50%; height: 40px' />
<van-goods-action-button type='danger' text='立即投保' @click='nextStep' v-no-more-click='1000' style='border-radius: 0em; width: 50%; height: 40px' />
</van-goods-action>
<!-- <van-dialog v-model="showDialog" title="温馨提示" message="被保险人年龄与所投保的方案不一致,请核实。" show-cancel-button @confirm="nextStep" confirmButtonText="继续投保" cancelButtonText="核对信息"> -->
@@ -675,6 +674,7 @@ import Vue from 'vue'
import { GoodsAction, GoodsActionIcon, GoodsActionButton } from 'vant'
import riskRules from '../common/risk-rules'
import occupationList from '@/components/ebiz/occipation/data/occupation'
import {idNoCheck8} from "../sale/js/verification";
DataDictionary.relationToAppnt = DataDictionary.relationToAppnt.slice(0, 4)
Vue.use(Checkbox).use(CheckboxGroup)
@@ -2055,6 +2055,16 @@ export default {
// return this.$toast('户口本的证件号码长度应等于18位')
// }
}
else if (this.userInfo.idType == '8') {
if (idNoCheck8(this.userInfo,'cardList').text){
return this.$toast(idNoCheck8(this.userInfo,'cardList').text)
}
}
else if (this.insuredInfo.idType == '8') {
if (idNoCheck8(this.insuredInfo,'cardList').text){
return this.$toast(idNoCheck8(this.insuredInfo,'cardList').text)
}
}
let insuredAge = utilsAge.getAge(this.insuredInfo.birthday, new Date())
console.log('计算年龄', insuredAge)
//如果证件类型是身份证或户口本

View File

@@ -247,7 +247,7 @@ import utilsAge from '@/assets/js/utils/age'
import IdentityCardScan from '@/components/ebiz/sale/IdentityCardScan'
import CustomerPicker from '@/components/ebiz/customer/CustomerPicker'
import idNoCheck from '@/assets/js/utils/idNoCheck'
import { idToData } from './js/verification'
import {idNoCheck8, idToData} from './js/verification'
import { selectComp } from './js/methods'
import getAreaName from '@/assets/js/utils/getAreaNameForSale'
import { getOrderDetail, checkAppointBnf } from '@/api/ebiz/sale/sale'
@@ -961,7 +961,8 @@ export default {
}
}
//证件类型是户口本
} else if (this.userInfo.idType == '2') {
}
else if (this.userInfo.idType == '2') {
if (age >= 16) {
return this.$toast('客户年龄在16周岁以上不能使用户口本作为有效证件')
}
@@ -1009,7 +1010,8 @@ export default {
return this.$toast('您填写的证件号码有误')
}
//证件类型是出生证明
} else if (this.userInfo.idType == '3') {
}
else if (this.userInfo.idType == '3') {
if (age >= 2) {
return this.$toast('客户年龄在2周岁及以上不能使用出生证作为有效证件')
}
@@ -1019,20 +1021,29 @@ export default {
return this.$toast('您填写的证件号码有误')
}
//证件类型是护照
} else if (this.userInfo.idType == '4') {
}
else if (this.userInfo.idType == '4') {
if (this.userInfo.nativeplace == '1') {
return this.$toast('“证件类型”为“外国人护照”,“国籍”不能选择为“中国”哦~')
}
} else if (this.userInfo.idType == '5') {
}
else if (this.userInfo.idType == '5') {
console.log(this.userInfo.nativeplace, 'nativeplace')
if (this.userInfo.nativeplace != '2' && this.userInfo.nativeplace != '3') {
return this.$toast('“证件类型”为“港澳居民来往内地通行证”,“国籍”请选择“中国香港”或“中国澳门”哦~')
}
} else if (this.userInfo.idType == '6') {
}
else if (this.userInfo.idType == '6') {
if (this.userInfo.nativeplace != '4') {
return this.$toast('“证件类型”为“台湾居民来往大陆通行证”,“国籍”请选择“中国台湾”~')
}
} else if (this.userInfo.idType == '9') {
}
else if (this.userInfo.idType == '8') {
if (idNoCheck8(this.userInfo).text){
return this.$toast(idNoCheck8(this.userInfo).text)
}
}
else if (this.userInfo.idType == '9') {
if (this.userInfo.nativeplace != '2' && this.userInfo.nativeplace != '3' && this.userInfo.nativeplace != '4') {
return this.$toast('“证件类型”为“港澳台居民居住证”,“国籍”请选择“中国香港”、“中国澳门”或“中国台湾”~')
}

View File

@@ -460,7 +460,7 @@
import IdentityCardScan from '@/components/ebiz/sale/IdentityCardScan'
import idNoCheck from '@/assets/js/utils/idNoCheck'
import beforeDate from '@/assets/js/utils/getBeforeDate.js'
import { idToData } from './js/verification'
import { idToData, idNoCheck8 } from './js/verification'
import { selectComp, getIdentityInfo } from './js/methods'
import SearchField from '@/components/common/SearchField'
import riskRules from '@/views/ebiz/common/risk-rules'
@@ -773,8 +773,6 @@
this.isNewPeopleFlagTipshow = true
},
workcompanys(list) {
// 单位数据
console.log(list)
this.userWorkcompanys = list
},
setCustomerMarriage(marriageCode) {
@@ -1243,28 +1241,39 @@
}
}
//证件类型是户口本
} else if (this.userInfo.idType == '2') {
}
else if (this.userInfo.idType == '2') {
if (age > 16) {
return this.$toast('客户年龄在16周岁以上不能使用户口本作为有效证件')
}
} else if (this.userInfo.idType == '3') {
}
else if (this.userInfo.idType == '3') {
if (age >= 2) {
return this.$toast('客户年龄在2周岁及以上不能使用出生证作为有效证件')
}
} else if (this.userInfo.idType == '4') {
}
else if (this.userInfo.idType == '4') {
if (this.userInfo.nativeplace == '1') {
return this.$toast('“证件类型”为“外国人护照”,“国籍”不能选择为“中国”哦~')
}
} else if (this.userInfo.idType == '5') {
}
else if (this.userInfo.idType == '5') {
console.log(this.userInfo.nativeplace, 'nativeplace')
if (this.userInfo.nativeplace != 2 && this.userInfo.nativeplace != 3) {
return this.$toast('“证件类型”为“港澳居民来往内地通行证”,“国籍”请选择“中国香港”或“中国澳门”哦~')
}
} else if (this.userInfo.idType == '6') {
}
else if (this.userInfo.idType == '6') {
if (this.userInfo.nativeplace != 4) {
return this.$toast('“证件类型”为“台湾居民来往大陆通行证”,“国籍”请选择“中国台湾”~')
}
} else if (this.userInfo.idType == '9') {
}
else if (this.userInfo.idType == '8') {
if (idNoCheck8(this.userInfo).text){
return this.$toast(idNoCheck8(this.userInfo).text)
}
}
else if (this.userInfo.idType == '9') {
if (this.userInfo.nativeplace != 2 && this.userInfo.nativeplace != 3 && this.userInfo.nativeplace != 4) {
return this.$toast('“证件类型”为“港澳台居民居住证”,“国籍”请选择“中国香港”、“中国澳门”或“中国台湾”~')
}
@@ -1606,35 +1615,37 @@
}
},
getRelatedData(val, source) {
if (this.userInfo.idType != '1') {
if (this.userInfo.idType != '1' && this.userInfo.idType != '8') {
return
}
//如果证件校验不通过,恢复默认值
if (idToData(val).text) {
;[this.userInfo.idNo, this.userInfo.sex, this.userInfo.birthday, this.effectiveDateTypeAble] = ['', '0', '', false]
return this.$toast(idToData(val).text)
}
// // 判断投保人年龄是否大于16周岁
// if (idToData(val).age <= 16) {
// ;[this.userInfo.idNo, this.userInfo.sex, this.userInfo.birthday, this.effectiveDateTypeAble] = ['', '0', '', false]
// return this.$toast('亲投保人年龄必须大于等于16周岁哦~')
// }
this.userInfo.effectiveDateType = false
this.effectiveDateTypeAble = idToData(val).age <= 45
this.userInfo.birthday = idToData(val).birthday
this.userInfo.sex = idToData(val).sex
//年龄小于18周岁工作单位默认值为
if (idToData(val).age < 18) {
this.userInfo.workcompany = this.userInfo.workcompany || '无'
}
if (idToData(val).age > 45) {
if (source) {
this.userInfo.effectiveDateType = true
if(this.userInfo.idType == '1'){
//如果证件校验不通过,恢复默认值
if (idToData(val).text) {
;[this.userInfo.idNo, this.userInfo.sex, this.userInfo.birthday, this.effectiveDateTypeAble] = ['', '0', '', false]
return this.$toast(idToData(val).text)
}
// // 判断投保人年龄是否大于16周岁
// if (idToData(val).age <= 16) {
// ;[this.userInfo.idNo, this.userInfo.sex, this.userInfo.birthday, this.effectiveDateTypeAble] = ['', '0', '', false]
// return this.$toast('亲投保人年龄必须大于等于16周岁哦~')
// }
this.userInfo.effectiveDateType = false
this.effectiveDateTypeAble = idToData(val).age <= 45
this.userInfo.birthday = idToData(val).birthday
this.userInfo.sex = idToData(val).sex
//年龄小于18周岁工作单位默认值为
if (idToData(val).age < 18) {
this.userInfo.workcompany = this.userInfo.workcompany || '无'
}
if (idToData(val).age > 45) {
if (source) {
this.userInfo.effectiveDateType = true
}
this.effectiveDateTypeAble = false
} else {
// this.userInfo.effectiveDateType = false
}
this.effectiveDateTypeAble = false
} else {
// this.userInfo.effectiveDateType = false
}
},
},

View File

@@ -493,7 +493,7 @@
import IdentityCardScan from '@/components/ebiz/sale/IdentityCardScan'
import idNoCheck from '@/assets/js/utils/idNoCheck'
import beforeDate from '@/assets/js/utils/getBeforeDate.js'
import { idToData } from './js/verification'
import {idNoCheck8, idToData} from './js/verification'
import { selectComp, getIdentityInfo } from './js/methods'
import IndexBar from '@/components/ebiz/sale/IndexBar'
import SearchField from '@/components/common/SearchField'
@@ -1540,7 +1540,8 @@
// }
//证件类型是户口本
} else if (this.userInfo.idType == '2') {
}
else if (this.userInfo.idType == '2') {
if (this.userInfo.nativeplace != '1') {
return this.$toast('证件类型”为“身份证,国籍必须为中国哦')
}
@@ -1591,7 +1592,8 @@
// return this.$toast('户口本的证件号码长度应等于18位')
// }
//证件类型是出生证明
} else if (this.userInfo.idType == '3') {
}
else if (this.userInfo.idType == '3') {
if (age >= 2) {
return this.$toast('客户年龄在2周岁及以上不能使用出生证作为有效证件')
}
@@ -1604,20 +1606,29 @@
// return this.$toast('出生证须大于等于3个字符')
// }
//证件类型是护照
} else if (this.userInfo.idType == '4') {
}
else if (this.userInfo.idType == '4') {
if (this.userInfo.nativeplace == '1') {
return this.$toast('“证件类型”为“外国人护照”,“国籍”不能选择为“中国”哦~')
}
} else if (this.userInfo.idType == '5') {
}
else if (this.userInfo.idType == '5') {
console.log(this.userInfo.nativeplace, 'nativeplace')
if (this.userInfo.nativeplace != 2 && this.userInfo.nativeplace != 3) {
return this.$toast('“证件类型”为“港澳居民来往内地通行证”,“国籍”请选择“中国香港”或“中国澳门”哦~')
}
} else if (this.userInfo.idType == '6') {
}
else if (this.userInfo.idType == '6') {
if (this.userInfo.nativeplace != 4) {
return this.$toast('“证件类型”为“台湾居民来往大陆通行证”,“国籍”请选择“中国台湾”~')
}
} else if (this.userInfo.idType == '9') {
}
else if (this.userInfo.idType == '8') {
if (idNoCheck8(this.userInfo).text){
return this.$toast(idNoCheck8(this.userInfo).text)
}
}
else if (this.userInfo.idType == '9') {
if (this.userInfo.nativeplace != 2 && this.userInfo.nativeplace != 3 && this.userInfo.nativeplace != 4) {
return this.$toast('“证件类型”为“港澳台居民居住证”,“国籍”请选择“中国香港”、“中国澳门”或“中国台湾”~')
}

View File

@@ -769,7 +769,7 @@ export default {
window.localStorage.setItem('sign-appnt', JSON.stringify(that.appntSign))
if (val == '0' || val == '2') {
//idtype不为身份证跳过人脸识别
if (JSON.parse(this.$CacheUtils.getLocItem('saleInsuredInfo')).idType != '1') {
if (JSON.parse(this.$CacheUtils.getLocItem('saleInsuredInfo')).idType != '1' && JSON.parse(this.$CacheUtils.getLocItem('saleInsuredInfo')).idType != '8') {
that.goUrl()
} else {
// 白名单校验
@@ -801,9 +801,10 @@ export default {
if (localStorage['faceAuthWeXin-requestId'] && localStorage['faceAuthWeXin-bizToken'] && this.$route.query.faceAuthCountWeixin != undefined) {
this.getRecognitionResult(JSON.parse(localStorage['faceAuthWeXin-requestId']), JSON.parse(localStorage['faceAuthWeXin-bizToken']))
} else {
this.idcardData.realName = JSON.parse(this.$CacheUtils.getLocItem('saleInsuredInfo')).name
this.idcardData.idno = JSON.parse(this.$CacheUtils.getLocItem('saleInsuredInfo')).idNo
this.recognition()
this.idcardData.realName = JSON.parse(this.$CacheUtils.getLocItem('saleInsuredInfo')).name
this.idcardData.idno = JSON.parse(this.$CacheUtils.getLocItem('saleInsuredInfo')).idNo
this.idcardData.idType = JSON.parse(this.$CacheUtils.getLocItem('saleInsuredInfo')).idType
this.recognition()
}
// if (this.faceAuthCount.appnt < this.smsAuthNum) {
// this.idcardData.realName = JSON.parse(this.$CacheUtils.getLocItem('saleInsuredInfo')).name
@@ -824,9 +825,7 @@ export default {
} else {
thismyage = thismysaleInsuredPersonInfo.insuredAge
}
if (
JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')).idType != '1' || thismyage < '18'
) {
if ((JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')).idType != '1' && JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')).idType != '8') || thismyage < '18') {
that.goUrl()
} else {
// 白名单校验
@@ -858,9 +857,10 @@ export default {
if (localStorage['faceAuthWeXin-requestId'] && localStorage['faceAuthWeXin-bizToken'] && this.$route.query.faceAuthCountWeixin != undefined) {
this.getRecognitionResult(JSON.parse(localStorage['faceAuthWeXin-requestId']), JSON.parse(localStorage['faceAuthWeXin-bizToken']))
} else {
this.idcardData.realName = JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')).name
this.idcardData.idno = JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')).idNo
this.recognition()
this.idcardData.realName = JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')).name
this.idcardData.idno = JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')).idNo
this.idcardData.idType = JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')).idType
this.recognition()
}
// if (this.faceAuthCount.insured < this.smsAuthNum) {
// this.idcardData.realName = JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')).name
@@ -876,7 +876,7 @@ export default {
if (val == '0' || val == '2') {
window.localStorage.setItem('sign-val', val)
window.localStorage.setItem('sign-appnt', JSON.stringify(that.appntSign))
if (this.saleInsuredInfo.idType != '1') {
if (this.saleInsuredInfo.idType != '1' && this.saleInsuredInfo.idType != '8') {
that.goUrl()
} else {
//RID 状态--有效
@@ -905,11 +905,16 @@ export default {
}
if (this.faceAuthCount.appnt < this.smsAuthNum) {
// 人脸识别
let thisidType = ''
if(that.saleInsuredInfo.idType == 8) {
thisidType = '05'
}
//eslint-disable-next-line no-undef
const authRes = await EWebBridge.webCallAppInJs('face_auth', {
businessSource: '1', //业务来源:1-电投2-入司3-理赔4-保全
number: that.saleInsuredInfo.idNo, //身份证号码
name: that.saleInsuredInfo.name //姓名
name: that.saleInsuredInfo.name, //姓名
idType: thisidType, //证件类型
}).then((data) => {
if (JSON.parse(data).state == '1') {
// 保存rid 数据
@@ -937,7 +942,7 @@ export default {
} else {
thismyage = this.saleInsuredPersonInfo.insuredAge
}
if (this.saleInsuredPersonInfo.idType != '1' || thismyage < '18') {
if ((this.saleInsuredPersonInfo.idType != '1' && this.saleInsuredPersonInfo.idType != '8') || thismyage < '18') {
that.goUrl()
} else {
//RID 状态--有效
@@ -969,11 +974,16 @@ export default {
// 人脸识别
if (this.faceAuthCount.insured < this.smsAuthNum) {
let thisidType = ''
if(that.saleInsuredPersonInfo.idType == 8) {
thisidType = '05'
}
// 调原生人脸识别
const authRes = await EWebBridge.webCallAppInJs('face_auth', {
businessSource: '1', //业务来源:1-电投2-入司3-理赔4-保全
number: that.saleInsuredPersonInfo.idNo, //身份证号码
name: that.saleInsuredPersonInfo.name //姓名
name: that.saleInsuredPersonInfo.name, //姓名
idType: thisidType, //证件类型
}).then((data) => {
if (JSON.parse(data).state == '1') {
that.saveCustomerRidInfo('insured_rid', 'B')
@@ -1746,6 +1756,9 @@ export default {
redirectUrl: this.idcardData.redirectUrl,
businessSource: this.idcardData.businessSource
}
if(this.idcardData.idType == 8) {
data.idType = '05'
}
getRecognitionUrl(data).then(
(res) => {
if (res.result == '0') {

View File

@@ -24,6 +24,30 @@ export function idToData(idNo) {
text: '您填写的证件号码有误'
}
}
console.log('12321321321')
let birthday = getBirthById(idNo)
let age = utilsAge.getAge(birthday, new Date())
let sex = getSexById(idNo)
return {
birthday,
age,
sex
}
}
//外国人永久居留身份证带出出生日期,性别,年龄
export function idToData8(idNo) {
//非空
if (!idNo.trim()) {
return {
text: '证件号码不能为空'
}
}
if (idNo.length != 15 && idNo.length != 18) {
return {
text: '外国人永久居留身份证位数有误'
}
}
let birthday = getBirthById(idNo)
let age = utilsAge.getAge(birthday, new Date())
let sex = getSexById(idNo)
@@ -35,20 +59,218 @@ export function idToData(idNo) {
}
function getBirthById(idNo) {
// 获取生日
var year = idNo.substr(6, 4)
var month = idNo.substr(10, 2)
var day = idNo.substr(12, 2)
return year + '-' + month + '-' + day
if(idNo.length == 15) {
// 获取生日
let year = '19' + idNo.substr(6, 2)
let month = idNo.substr(8, 2)
let day = idNo.substr(10, 2)
return year + '-' + month + '-' + day
}
if(idNo.length == 18) {
// 获取生日
let year = idNo.substr(6, 4)
let month = idNo.substr(10, 2)
let day = idNo.substr(12, 2)
return year + '-' + month + '-' + day
}
}
function getSexById(idNo) {
// 获取性别
if (idNo.charAt(16) >= '0' && idNo.charAt(16) <= '9') {
if (parseInt(idNo.charAt(16)) % 2 == 0) {
return '1'
} else {
return '0'
// if(idNo.length == 15){
// // 获取性别
// if (idNo.charAt(13) >= '0' && idNo.charAt(13) <= '9') {
// if (parseInt(idNo.charAt(13)) % 2 == 0) {
// return '1'
// } else {
// return '0'
// }
// }
// }
if(idNo.length == 18) {
// 获取性别
if (idNo.charAt(16) >= '0' && idNo.charAt(16) <= '9') {
if (parseInt(idNo.charAt(16)) % 2 == 0) {
return '1'
} else {
return '0'
}
}
}
}
function js_date_time(unixtime) {
var dateTime = new Date(parseInt(unixtime))
var year = dateTime.getFullYear();
var month = dateTime.getMonth() + 1;
var day = dateTime.getDate();
var timeSpanStr = year + '-' + month.toString().padStart(2, '0') + '-' + day.toString().padStart(2, '0');
return timeSpanStr;
}
export function idNoCheck8(userInfo,type) {
if(!userInfo.idNo) {
return {
text: '证件号码不能为空'
}
}
if(userInfo.idNo.length != 15 && userInfo.idNo.length != 18) {
return {
text: '外国人永久居留身份证位数有误'
}
}
if(userInfo.idNo.length == 15) {
let reg = /^[A-Za-z]{3}\d{12}$/
if(!reg.test(userInfo.idNo)) {
return {
text: '外国人永久居留身份证位数有误'
}
}
}
if(userInfo.idNo.length == 18) {
let reg = / (^9\d{17}$)|(^9\d{16}(\d|X)$)/
if(!reg.test(userInfo.idNo)) {
return {
text: '外国人永久居留身份证位数有误'
}
}
}
// if(userInfo.idNo.length == 15) {
// // 获取生日
// let year = '19' + userInfo.idNo.substr(7, 2)
// let month = userInfo.idNo.substr(9, 2)
// let day = userInfo.idNo.substr(11, 2)
// let thisBirthday = year + '-' + month + '-' + day
// if(thisBirthday != userInfo.birthday) {
// console.log('12321321321',thisBirthday)
// return {
// text: '出生日期必须与证件号码中的生日一致'
// }
// }
// }
if(userInfo.idNo.length == 18) {
// 获取生日
let year = userInfo.idNo.substr(6, 4)
let month = userInfo.idNo.substr(10, 2)
let day = userInfo.idNo.substr(12, 2)
let thisBirthday = year + '-' + month + '-' + day
if(thisBirthday != userInfo.birthday) {
return {
text: '出生日期必须与证件号码中的生日一致'
}
}
}
if(userInfo.idNo.length == 18){
let thisSex = getSexById(userInfo.idNo)
if(thisSex != userInfo.sex) {
return {
text: '性别必须与证件号码中的一致'
}
}
}
if (userInfo.nativeplace == '1' || userInfo.nativeplace == '2' || userInfo.nativeplace == '3' || userInfo.nativeplace == '4') {
return {
text: '外国人永久居留身份证不能选择中国国籍'
}
}
if(!userInfo.certiexpiredate) {
return {
text: '证件截止日期不能为空'
}
}
if(type == 'cardList') {
let thisAge = utilsAge.getAge(userInfo.birthday, new Date())
if(thisAge < 18) {
let date1 = new Date(userInfo.certiexpiredate.replace(/-/g,'/'));
let date2 = date1.setFullYear(date1.getFullYear() - 5);
let date3 = date2+(1000*60*60*24)
let date4 = js_date_time(date3)
let thisAge = utilsAge.getAge(userInfo.birthday, new Date(date4.replace(/-/g,'/')))
if(thisAge > 18) {
return {
text: '外国人永久居留身份证证件有效期有误'
}
}
if(date3 > new Date().getTime()) {
return {
text: '外国人永久居留身份证证件有效期有误'
}
}
}
if(thisAge >= 18 && thisAge <= 22) {
let date1 = new Date(userInfo.certiexpiredate.replace(/-/g,'/'));
let date2 = date1.setFullYear(date1.getFullYear() - 5);
let date3 = date2+(1000*60*60*24)
let date4 = js_date_time(date3)
let date5 = new Date(userInfo.certiexpiredate.replace(/-/g,'/'));
let date6 = date5.setFullYear(date5.getFullYear() - 10);
let date7 = date6+(1000*60*60*24)
let date8 = js_date_time(date7)
let thisAge1 = utilsAge.getAge(userInfo.birthday, new Date(date4.replace(/-/g,'/')))
let thisAge2 = utilsAge.getAge(userInfo.birthday, new Date(date8.replace(/-/g,'/')))
if(thisAge1 >= 18 && thisAge2 < 18){
return {
text: '外国人永久居留身份证证件有效期有误'
}
}
if(thisAge1 < 18 && date3 > new Date().getTime()) {
return {
text: '外国人永久居留身份证证件有效期有误'
}
}
if(thisAge2 >= 18 &&date7 > new Date().getTime()) {
return {
text: '外国人永久居留身份证证件有效期有误'
}
}
}
if(thisAge >= 23) {
let date1 = new Date(userInfo.certiexpiredate.replace(/-/g,'/'));
let date2 = date1.setFullYear(date1.getFullYear() - 10);
let date3 = date2+(1000*60*60*24)
let date4 = js_date_time(date3)
let thisAge = utilsAge.getAge(userInfo.birthday, new Date(date4.replace(/-/g,'/')))
if(thisAge < 18) {
return {
text: '外国人永久居留身份证证件有效期有误'
}
}
if(date3 > new Date().getTime()) {
return {
text: '外国人永久居留身份证证件有效期有误'
}
}
}
} else {
let thisAge = utilsAge.getAge(userInfo.birthday, new Date(userInfo.certificateValidate))
if(thisAge < 18) {
let date1 = new Date(userInfo.certificateValidate.replace(/-/g,'/'));
let date2 = date1.setFullYear(date1.getFullYear() + 5);
let date3 = date2-(1000*60*60*24)
let date4 = js_date_time(date3)
console.log(date4+'-'+userInfo.certiexpiredate)
if(date4 != userInfo.certiexpiredate) {
return {
text: '外国人永久居留身份证证件有效期有误'
}
}
}
if(thisAge >= 18) {
let date1 = new Date(userInfo.certificateValidate.replace(/-/g,'/'));
let date2 = date1.setFullYear(date1.getFullYear() + 10);
let date3 = date2-(1000*60*60*24)
let date4 = js_date_time(date3)
if(date4 != userInfo.certiexpiredate) {
return {
text: '外国人永久居留身份证证件有效期有误'
}
}
}
}
return {
text:''
}
}