Commit 79ebf587 authored by dragondean@qq.com's avatar dragondean@qq.com

货值要大于0

parent 9cd7c401
......@@ -1586,13 +1586,16 @@ export default {
},
data() {
const validatorPositiveNumber = (rule, value, callback) => {
if (!value || value == '') return callback()
if (value === null || value === undefined || value === '') return callback()
if (!value) return callback(new Error(this.$t('请输入数字')))
if (!Number(value)) return callback(new Error(this.$t('请输入有效数字')))
const reg = /((^[1-9]\d*)|^0)(\.\d*){0,1}$/
if (!reg.test(value)) {
return callback(new Error(this.$t('请输入有效数字')))
}
if (value <= 0) {
return callback(new Error(this.$t('请输入大于0的数字')))
}
callback()
}
return {
......
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