更新证件类型
This commit is contained in:
parent
577e3ebef0
commit
c869599d0b
@ -59,7 +59,7 @@
|
|||||||
<include refid="selectSysWxUserLogVo"/>
|
<include refid="selectSysWxUserLogVo"/>
|
||||||
<where>
|
<where>
|
||||||
<if test="appid != null and appid != ''"> and appid = #{appid}</if>
|
<if test="appid != null and appid != ''"> and appid = #{appid}</if>
|
||||||
<if test="phone != null and phone != ''"> or phone = #{phone}</if>
|
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
|
||||||
</where>
|
</where>
|
||||||
order by create_time asc
|
order by create_time asc
|
||||||
</select>
|
</select>
|
||||||
|
@ -210,7 +210,8 @@ export function digitUppercase(n) {
|
|||||||
* 十五,十六,十七都是数字0-9
|
* 十五,十六,十七都是数字0-9
|
||||||
* 十八位可能是数字0-9,也可能是X
|
* 十八位可能是数字0-9,也可能是X
|
||||||
* */
|
* */
|
||||||
export function validatorIDCard(idcode) {
|
export function validatorIDCard(idcode, type) {
|
||||||
|
if (type === 1) {
|
||||||
if (typeof idcode !== 'string') {
|
if (typeof idcode !== 'string') {
|
||||||
return {
|
return {
|
||||||
code: -1,
|
code: -1,
|
||||||
@ -247,7 +248,35 @@ export function validatorIDCard(idcode) {
|
|||||||
const result = last === last_no ? true : false;
|
const result = last === last_no ? true : false;
|
||||||
return {
|
return {
|
||||||
code: result ? 1 : -1,
|
code: result ? 1 : -1,
|
||||||
msg: !result ? "身份证号码格式错误" : ""
|
msg: !result ? "身份证号码不合规" : "校验通过"
|
||||||
|
}
|
||||||
|
} else if (type === 2) {
|
||||||
|
const reg = /^([A-Z]\d{6,10}(\(\w{1}\))?)$/;
|
||||||
|
if (reg.test(idcode) === false) {
|
||||||
|
return {code: -1, msg: '港澳居民来往内地通行证号码不合规'};
|
||||||
|
} else {
|
||||||
|
return {code: 1, msg: '校验通过'};
|
||||||
|
}
|
||||||
|
} else if (type === 3) {
|
||||||
|
// 台湾居民来往大陆通行证
|
||||||
|
// 规则: 新版8位或18位数字, 旧版10位数字 + 英文字母
|
||||||
|
// 样本: 12345678 或 1234567890B
|
||||||
|
const reg = /^\d{8}|^[a-zA-Z0-9]{10}|^\d{18}$/;
|
||||||
|
if (reg.test(card) === false) {
|
||||||
|
return {code: -1, msg: '台湾居民来往大陆通行证号码不合规'};
|
||||||
|
} else {
|
||||||
|
return {code: 1, msg: '校验通过'};
|
||||||
|
}
|
||||||
|
} else if (type === 4) {
|
||||||
|
// 军官证
|
||||||
|
// 规则: 军/兵/士/文/职/广/(其他中文) + "字第" + 4到8位字母或数字 + "号"
|
||||||
|
// 样本: 军字第2001988号, 士字第P011816X号
|
||||||
|
const reg = /^[\u4E00-\u9FA5](字第)([0-9a-zA-Z]{4,8})(号?)$/;
|
||||||
|
if (reg.test(card) === false) {
|
||||||
|
return {code: -1, msg: '军官证号不合规'};
|
||||||
|
} else {
|
||||||
|
return {code: 1, msg: '校验通过'};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,6 +23,15 @@
|
|||||||
<el-form-item label="姓名" prop="signName">
|
<el-form-item label="姓名" prop="signName">
|
||||||
<el-input v-model="form.signName" placeholder="请输入客户姓名"/>
|
<el-input v-model="form.signName" placeholder="请输入客户姓名"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="证件类型">
|
||||||
|
<el-select v-model="idType">
|
||||||
|
<el-option
|
||||||
|
v-for="opt in idTypeOptions"
|
||||||
|
:key="opt.value"
|
||||||
|
:label="opt.label"
|
||||||
|
:value="opt.value"/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="证件号" prop="cusId">
|
<el-form-item label="证件号" prop="cusId">
|
||||||
<el-input v-model="form.cusId" placeholder="请输入证件号"/>
|
<el-input v-model="form.cusId" placeholder="请输入证件号"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -148,7 +157,7 @@
|
|||||||
return callback(new Error('证件号码不能为空'))
|
return callback(new Error('证件号码不能为空'))
|
||||||
}
|
}
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const {code, msg} = validatorIDCard(value);
|
const {code, msg} = validatorIDCard(value, this.idType);
|
||||||
if (code === 1) {
|
if (code === 1) {
|
||||||
callback()
|
callback()
|
||||||
} else {
|
} else {
|
||||||
@ -162,6 +171,14 @@
|
|||||||
form: {},
|
form: {},
|
||||||
read: false,
|
read: false,
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
|
idType: 1,
|
||||||
|
idTypeOptions: [
|
||||||
|
{label: '身份证', value: 1},
|
||||||
|
{label: '港澳身份证', value: 2},
|
||||||
|
{label: '台湾身份证', value: 3},
|
||||||
|
{label: '护照', value: 4},
|
||||||
|
{label: '军官证', value: 5},
|
||||||
|
],
|
||||||
serveTimeIdOption: [
|
serveTimeIdOption: [
|
||||||
{label: '7天', value: 7},
|
{label: '7天', value: 7},
|
||||||
{label: '1个月', value: 30},
|
{label: '1个月', value: 30},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user