Commit 3494c8b2 authored by honghy's avatar honghy Committed by wux

会员等级积分范围校验调整

parent c5007308
......@@ -199,14 +199,14 @@ export default {
lowerCount: [
{
required: true,
validator: this.validatePositiveInteger,
validator: this.validatePositiveInteger2,
trigger: "blur"
}
],
upperCount: [
{
required: true,
validator: this.validatePositiveInteger,
validator: this.validatePositiveInteger2,
trigger: "blur"
}
],
......@@ -289,6 +289,18 @@ export default {
}
}
},
validatePositiveInteger2(rule, value, callback) {
if (!value) {
return callback(new Error(this.$t("请输入整数")));
} else {
const regex = /^(?:0|[1-9]\d*)$/;
if (regex.test(value)) {
callback();
} else {
callback(new Error(this.$t("请输入整数")));
}
}
},
validatePositiveIntegerorNull(rule, value, callback) {
if (value === ''||value === null) {
callback();
......
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