master
lion 2 months ago
parent 6fb402184d
commit eec33547cf

@ -859,14 +859,24 @@ export default {
idcard: {
rules: [
{
required: true,
errorMessage:
"身份证号码不能为空 / ID card number cannot be empty",
},
{
pattern:
"^[1-9]\\d{5}(18|19|20)\\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]",
errorMessage: "身份证格式错误 / Invalid ID card format",
// 访
validateFunction: (rule, value, data, callback) => {
const pattern =
/^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
if (!value) {
callback();
return;
}
if (!pattern.test(value)) {
callback(
new Error(
"身份证格式错误 / Invalid ID card format"
)
);
return;
}
callback();
},
},
],
},
@ -961,14 +971,24 @@ export default {
idcard: {
rules: [
{
required: true,
errorMessage:
"身份证号码不能为空 / ID card number cannot be empty",
},
{
pattern:
"^[1-9]\\d{5}(18|19|20)\\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]",
errorMessage: "身份证格式错误 / Invalid ID card format",
validateFunction: (rule, value, data, callback) => {
const pattern =
/^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
// 访
if (!value) {
callback();
return;
}
if (!pattern.test(value)) {
callback(
new Error(
"身份证格式错误 / Invalid ID card format"
)
);
return;
}
callback();
},
},
],
},
@ -1389,6 +1409,20 @@ export default {
if (this.follw_people_obj.credent == 2) {
this.follw_people_obj.idcard = this.follw_people_obj.passcard;
}
// 访(credent == 1)
if (
this.follw_people_obj.credent == 1 &&
this.follw_people_obj.idcard
) {
const pattern =
/^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
if (!pattern.test(this.follw_people_obj.idcard)) {
this.util.alert(
"身份证格式错误 / Invalid ID card format"
);
return;
}
}
this.$refs["peopleform"]
.validate()
.then((res) => {
@ -1459,6 +1493,26 @@ export default {
this.form.date = this.form.start_date;
}
// 使(credent=1) 访//
if (this.form.credent == 1 && this.form.idcard) {
const pattern =
/^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
if (!pattern.test(this.form.idcard)) {
this.util.alert(
"身份证格式错误 / Invalid ID card format"
);
return;
}
}
// (type=2) / (type=3) 使(credent=1)
if (this.form.type != 1 && this.form.credent == 1 && !this.form.idcard) {
this.util.alert(
"身份证号码不能为空 / ID card number cannot be empty"
);
return;
}
this.$refs["formdata"]
.validate()
.then(() => {
@ -1525,6 +1579,26 @@ export default {
this.form.date = this.form.start_date;
}
// 使(credent=1) 访//
if (this.form.credent == 1 && this.form.idcard) {
const pattern =
/^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
if (!pattern.test(this.form.idcard)) {
this.util.alert(
"身份证格式错误 / Invalid ID card format"
);
return;
}
}
// (type=2) / (type=3) 使(credent=1)
if (this.form.type != 1 && this.form.credent == 1 && !this.form.idcard) {
this.util.alert(
"身份证号码不能为空 / ID card number cannot be empty"
);
return;
}
this.$refs["formdata"]
.validate()
.then((res) => {

Loading…
Cancel
Save