Compare commits

...

7 Commits

Author SHA1 Message Date
liu.xiaofeng@ebiz-digits.com
8cb0cf848b 被保人人脸识别增加外国人永久居住证校验 2024-02-29 14:03:12 +08:00
liu.xiaofeng@ebiz-digits.com
360d5c220d 外国人永久居住证人脸识别的时候传递证件类型 2024-02-23 14:44:38 +08:00
liu.xiaofeng@ebiz-digits.com
c9aee2240b 签字确认页面增加证件类型判断确定是否需要进行人脸识别 2024-01-29 13:06:59 +08:00
liu.xiaofeng@ebiz-digits.com
ada2531e86 学平险和意外险卡单投保流程增加外国人永久居住证的规则校验 2024-01-25 15:05:58 +08:00
liu.xiaofeng@ebiz-digits.com
5a9ad7561e 健康险支持外国人永久居留身份证办理的业务功能及非功能性需求 2024-01-23 10:57:04 +08:00
liu.xiaofeng@ebiz-digits.com
378f9669e1 投被受 增加规则校验 2024-01-22 11:35:01 +08:00
liu.xiaofeng@ebiz-digits.com
264b83f27c 外国人永久居留身份证增加长度校验 2024-01-18 15:08:27 +08:00
10 changed files with 368 additions and 104 deletions

View File

@@ -1055,8 +1055,8 @@ export default {
text: '居民身份证'
},
{
id: 2,
text: '户口本'
id: 8,
text: '外国人永久居留身份证'
}
],
// 新市民身份

View File

@@ -29,29 +29,29 @@ function getSearchString (key) {
}
return obj[key]
}
let apiVersion = 'v2'
var ua = window.navigator.userAgent.toLowerCase()
//通过正则表达式匹配ua中是否含有MicroMessenger字符串, 在微信
if (localStorage.getItem('apiVersion')) {
apiVersion = localStorage.getItem('apiVersion')
} else {
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
//report/reportList数据报表页面在浏览器可以打开了但在微信或企业微信中打开不了,接口请求不需要token
if (window.location.href.indexOf('apiVersion') > 0) {
apiVersion = getSearchString('apiVersion') == 'V3' ? 'v3' : 'v2';//url中apiVersion没有时为v2
} else {
apiVersion = 'v3'
}
} else {
// 在app
if (navigator.userAgent.indexOf('JZG_') > 0) {
apiVersion = navigator.userAgent.split('JZG_')[1].split('/')[0].split('_')[1] == 'V3' ? 'v3' : 'v2'
}
}
window.localStorage.setItem('apiVersion', apiVersion)
}
// 可以多个接口域名,按需添加
console.log('环境:', process.env.VUE_APP_FLAG)
let apiVersion = 'v1'
// var ua = window.navigator.userAgent.toLowerCase()
// //通过正则表达式匹配ua中是否含有MicroMessenger字符串, 在微信
// if (localStorage.getItem('apiVersion')) {
// apiVersion = localStorage.getItem('apiVersion')
// } else {
// if (ua.match(/MicroMessenger/i) == 'micromessenger') {
// //report/reportList数据报表页面在浏览器可以打开了但在微信或企业微信中打开不了,接口请求不需要token
// if (window.location.href.indexOf('apiVersion') > 0) {
// apiVersion = getSearchString('apiVersion') == 'V3' ? 'v3' : 'v2';//url中apiVersion没有时为v2
// } else {
// apiVersion = 'v3'
// }
// } else {
// // 在app
// if (navigator.userAgent.indexOf('JZG_') > 0) {
// apiVersion = navigator.userAgent.split('JZG_')[1].split('/')[0].split('_')[1] == 'V3' ? 'v3' : 'v2'
// }
// }
// window.localStorage.setItem('apiVersion', apiVersion)
// }
// // 可以多个接口域名,按需添加
// console.log('环境:', process.env.VUE_APP_FLAG)
switch (process.env.VUE_APP_FLAG) {
case 'dev':
apiDomain = 'https://iagentsales-test2.e-guofu.com:5200/api/' + apiVersion // 国富api ///api/v1

View File

@@ -211,6 +211,7 @@ import OccupationForLoop from '@/components/ebiz/occipation/OccupationForLoop'
import { selectComp, getIdentityInfo } from './js/methods'
import Vue from 'vue'
import { GoodsAction, GoodsActionIcon, GoodsActionButton } from 'vant'
import {idNoCheck8} from "../sale/js/verification";
DataDictionary.relationToAppnt = DataDictionary.relationToAppnt.slice(0, 4)
Vue.use(Checkbox).use(CheckboxGroup)
@@ -530,7 +531,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
@@ -826,6 +827,11 @@ export default {
}
}
}
else if (this.userInfo.idType == '8') {
if (idNoCheck8(this.userInfo,'cardList').text){
return this.$toast(idNoCheck8(this.userInfo,'cardList').text)
}
}
this.infoUpdate()
// console.log('success')
} else {

View File

@@ -278,6 +278,7 @@ import { selectComp, getIdentityInfo } from './js/methods'
import dateUtils from '@/assets/js/utils/date-utils'
import Vue from 'vue'
import { GoodsAction, GoodsActionIcon, GoodsActionButton } from 'vant'
import {idNoCheck8} from "../sale/js/verification";
DataDictionary.relationToAppnt = DataDictionary.relationToAppnt.slice(0, 4)
Vue.use(Checkbox).use(CheckboxGroup)
@@ -1220,11 +1221,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

@@ -532,8 +532,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="核对信息"> -->
@@ -595,6 +594,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)
@@ -1891,7 +1891,8 @@ export default {
}
}
//如果证件类型是户口本
}else if(this.userInfo.idType == '2'){
}
else if(this.userInfo.idType == '2'){
if (this.userInfo.nativeplace != '1') {
return this.$toast('证件类型”为“身份证,国籍必须为中国哦')
}
@@ -1942,6 +1943,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')
@@ -1737,6 +1747,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

@@ -35,20 +35,214 @@ 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(14) >= '0' && idNo.charAt(14) <= '9') {
if (parseInt(idNo.charAt(14)) % 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'
}
}
}
}
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|x)$)/
if(!reg.test(userInfo.idNo)) {
return {
text: '外国人永久居留身份证位数有误'
}
}
}
if(userInfo.idNo.length == 15) {
// 获取生日
let year = '19' + userInfo.idNo.substr(6, 2)
let month = userInfo.idNo.substr(8, 2)
let day = userInfo.idNo.substr(10, 2)
let thisBirthday = year + '-' + month + '-' + day
if(thisBirthday != userInfo.birthday) {
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: '出生日期必须与证件号码中的生日一致'
}
}
}
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 certiexpiredate = new Date(userInfo.certiexpiredate);
certiexpiredate.setFullYear(certiexpiredate.getFullYear() - 5); // 添加年份
certiexpiredate.setMonth(certiexpiredate.getMonth(), certiexpiredate.getDate() - 1);
let thisDate = certiexpiredate.toLocaleString().replace(/\//g, "-")
let date = new Date(thisDate);
let options = { year: 'numeric', month: '2-digit', day: '2-digit' };
let localizedStr = date.toLocaleString('zh-CN', options);
let thislocalizedStr = localizedStr.replace(/\//g, "-")
console.log(thislocalizedStr)
let thisAge = utilsAge.getAge(userInfo.birthday, new Date(thislocalizedStr))
if(thisAge > 18) {
return {
text: '外国人永久居留身份证证件有效期有误'
}
}
}
if(thisAge >= 18 && thisAge <= 22) {
let certiexpiredate1 = new Date(userInfo.certiexpiredate);
certiexpiredate1.setFullYear(certiexpiredate1.getFullYear() - 5); // 添加年份
certiexpiredate1.setMonth(certiexpiredate1.getMonth(), certiexpiredate1.getDate() - 1);
let thisDate1 = certiexpiredate1.toLocaleString().replace(/\//g, "-")
let mydate1 = new Date(thisDate1);
let options1 = { year: 'numeric', month: '2-digit', day: '2-digit' };
let localizedStr1 = mydate1.toLocaleString('zh-CN', options1);
let thislocalizedStr1 = localizedStr1.replace(/\//g, "-")
console.log(thislocalizedStr1)
let certiexpiredate2 = new Date(userInfo.certiexpiredate);
certiexpiredate2.setFullYear(certiexpiredate2.getFullYear() - 10); // 添加年份
certiexpiredate2.setMonth(certiexpiredate2.getMonth(), certiexpiredate2.getDate() - 1);
let thisDate2 = certiexpiredate2.toLocaleString().replace(/\//g, "-")
let mydate2 = new Date(thisDate2);
let options2 = { year: 'numeric', month: '2-digit', day: '2-digit' };
let localizedStr2 = mydate2.toLocaleString('zh-CN', options2);
let thislocalizedStr2 = localizedStr2.replace(/\//g, "-")
console.log(thislocalizedStr2)
let thisAge1 = utilsAge.getAge(userInfo.birthday, new Date(thislocalizedStr1))
let thisAge2 = utilsAge.getAge(userInfo.birthday, new Date(thislocalizedStr2))
if(thisAge1 >= 18 && thisAge2 < 18){
return {
text: '外国人永久居留身份证证件有效期有误'
}
}
}
if(thisAge >= 23) {
let certiexpiredate = new Date(userInfo.certiexpiredate);
certiexpiredate.setFullYear(certiexpiredate.getFullYear() - 10); // 添加年份
certiexpiredate.setMonth(certiexpiredate.getMonth(), certiexpiredate.getDate() - 1);
let thisDate = certiexpiredate.toLocaleString().replace(/\//g, "-")
let date = new Date(thisDate);
let options = { year: 'numeric', month: '2-digit', day: '2-digit' };
let localizedStr = date.toLocaleString('zh-CN', options);
let thislocalizedStr = localizedStr.replace(/\//g, "-")
console.log(thislocalizedStr)
let thisAge = utilsAge.getAge(userInfo.birthday, new Date(thislocalizedStr))
if(thisAge < 18) {
return {
text: '外国人永久居留身份证证件有效期有误'
}
}
}
} else {
let thisAge = utilsAge.getAge(userInfo.birthday, new Date(userInfo.certificateValidate))
if(thisAge < 18) {
let currentDate = new Date(userInfo.certificateValidate);
currentDate.setFullYear(currentDate.getFullYear() + 5); // 添加年份
currentDate.setMonth(currentDate.getMonth(), currentDate.getDate() - 1);
let thisDate = currentDate.toLocaleString().replace(/\//g, "-")
let date = new Date(thisDate);
let options = { year: 'numeric', month: '2-digit', day: '2-digit' };
let localizedStr = date.toLocaleString('zh-CN', options);
let thislocalizedStr = localizedStr.replace(/\//g, "-")
if(thislocalizedStr != userInfo.certiexpiredate) {
return {
text: '外国人永久居留身份证证件有效期有误'
}
}
}
if(thisAge >= 18) {
let currentDate = new Date(userInfo.certificateValidate);
currentDate.setFullYear(currentDate.getFullYear() + 10); // 添加年份
currentDate.setMonth(currentDate.getMonth(), currentDate.getDate() - 1);
let thisDate = currentDate.toLocaleString().replace(/\//g, "-")
let date = new Date(thisDate);
let options = { year: 'numeric', month: '2-digit', day: '2-digit' };
let localizedStr = date.toLocaleString('zh-CN', options);
let thislocalizedStr = localizedStr.replace(/\//g, "-")
if(thislocalizedStr != userInfo.certiexpiredate) {
return {
text: '外国人永久居留身份证证件有效期有误'
}
}
}
}
return {
text:''
}
}