Commit d50159fd authored by 季圣华's avatar 季圣华
Browse files

给计量单位录入增加校验

parent a60cc936
...@@ -67,7 +67,8 @@ ...@@ -67,7 +67,8 @@
]}, ]},
ratio:{ ratio:{
rules: [ rules: [
{ required: true, message: '请输入比例!' } { required: true, message: '请输入比例!' },
{ validator: this.validateRatio}
]} ]}
}, },
} }
...@@ -118,6 +119,13 @@ ...@@ -118,6 +119,13 @@
}, },
handleCancel () { handleCancel () {
this.close() this.close()
},
validateRatio(rule, value, callback) {
if (value > 1) {
callback();
} else {
callback("比例必须大于1");
}
} }
} }
} }
......
Supports Markdown
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