mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-07 06:36:44 +08:00
Compare commits
11 Commits
master_new
...
feature/FM
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8bd3044808 | ||
|
|
4be5c68957 | ||
|
|
cb2ed8ede2 | ||
|
|
fd8f17a18f | ||
|
|
8974bf9e14 | ||
|
|
77ebee1efe | ||
|
|
04f6a287eb | ||
|
|
9b067a1821 | ||
|
|
8092c2b2c5 | ||
|
|
378f9669e1 | ||
|
|
264b83f27c |
@@ -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
|
||||
|
||||
@@ -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('“证件类型”为“港澳台居民居住证”,“国籍”请选择“中国香港”、“中国澳门”或“中国台湾”~')
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
@@ -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('“证件类型”为“港澳台居民居住证”,“国籍”请选择“中国香港”、“中国澳门”或“中国台湾”~')
|
||||
}
|
||||
|
||||
@@ -35,20 +35,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:''
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user