Commit d5d480ff authored by ‘yangmengxue’'s avatar ‘yangmengxue’

11

parent b5ed7e99
File added
......@@ -38,13 +38,19 @@ export default {
},
validateid_card: function (rule, value, callback) {
// console.log(value, 'sss')
console.log(value, 'sss')
if (value) {
if (value == '大陆居民身份证') {
if (!/(^\d{15}$)|(^\d{17}(\d|X|x)$)/.test(value)) {
return callback(new Error("你输入的身份证长度或格式错误"));
}
}else{
callback()
}
} else {
callback()
}
callback();
},
// 数字验证
......@@ -65,7 +71,7 @@ export default {
},
// 邮箱验证
validateEmail: function (rule, value, callback) {
console.log(value, 'ssss')
// console.log(value, 'ssss')
if (!emailReg.test(value)) {
callback(new Error('邮箱格式错误!'))
} else {
......
......@@ -172,7 +172,7 @@
<el-form-item
:rules="
configJson.idCard == 1
? referInfoRules.idCard
? referInfoRules.id_card
: [{ required: false }]
"
label="证件号"
......@@ -1323,6 +1323,14 @@ export default {
callback();
}
};
const validateid_card = (rule, value, callback) => {
if (this.referForm.id_type == "大陆居民身份证") {
if (!/(^\d{15}$)|(^\d{17}(\d|X|x)$)/.test(value)) {
return callback(new Error("你输入的身份证长度或格式错误"));
}
}
callback();
};
return {
cueDialogVisible: false,
msg: null,
......@@ -1383,8 +1391,8 @@ export default {
{ required: true, message: "证件类型不能为空!", trigger: "change" },
],
id_card: [
// { required: true, message: "证件号不能为空!", trigger: "blur" },
{ validator: validator.validateid_card, trigger: "blur" },
{ required: true, message: "证件号不能为空!", trigger: "blur" },
{ validator: validateid_card, trigger: "blur" },
],
birthday: [
{
......@@ -1741,7 +1749,7 @@ export default {
"护照",
],
isIDtype: false, //是否可以修改证件号
isIDtypeRule: false, //是否校验证件号
// 中学(模糊搜索)
// timeout: null,
// school: "",
......@@ -1905,11 +1913,21 @@ export default {
},
mounted() {},
methods: {
// 判断证件类型-证件号是否需要校验
// IDtypeRule(val) {
// if (val == "大陆居民身份证") {
// this.isIDtypeRule = true;
// } else {
// this.isIDtypeRule = false;
// }
// },
// 证件类型
changeIDType(val) {
// console.log(val);
if (!val) {
this.isIDtype = true;
} else {
// this.IDtypeRule(val);
this.isIDtype = false;
}
},
......@@ -1964,6 +1982,11 @@ export default {
referForm[k] = info[k];
}
this.referForm = referForm;
// if (res.data.info.id_type) {
// this.IDtypeRule(this.referForm.id_type);
// }
if (res.data.info.jiguan_province && res.data.info.jiguan_city) {
this.referForm.jiguan_code =
res.data.info.jiguan_province.toString() +
......
......@@ -9,6 +9,6 @@ export const SERVER_WS_URL = "wss://tgwapi.campcenter.cn"; // websocket
// export const SERVER_WS_URL = "wss://gwapi.campcenter.cn"; // websocket
// 测试
// export const SERVER_URL = "http://192.168.1.145:8088/modules-campsite"; // 正式环境
// export const DEVELOPMENT_SERVER_URL = "http://192.168.1.145:8088/modules-campsite"; //开发环境
// export const SERVER_WS_URL = "wss://192.168.1.145:8088"; // websocket
// export const SERVER_URL = "http://192.168.1.146:8088/modules-campsite"; // 正式环境
// export const DEVELOPMENT_SERVER_URL = "http://192.168.1.146:8088/modules-campsite"; //开发环境
// export const SERVER_WS_URL = "wss://192.168.1.146:8088"; // websocket
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment