Commit 78c915a3 by wangzhihui

fixed

1 parent 46a4b572
...@@ -473,15 +473,15 @@ export default { ...@@ -473,15 +473,15 @@ export default {
}, },
// 验证数字输入 // 验证数字输入
validateNumber(item, field, maxLimit = 31) { validateNumber(item, field, maxLimit = 31) {
// console.log(item, field)
let value = item[field] let value = item[field]
value = parseInt(value) || "" value = parseInt(value)
value = isNaN(value) || "" if (isNaN(value)) value = ""
// 限制最大值 // 限制最大值
if (parseInt(value) > maxLimit) { if (parseInt(value) > maxLimit) {
value = "" value = ""
this.$message.warning(`输入值不能超过 ${maxLimit}`) this.$message.warning(`输入值不能超过 ${maxLimit}`)
} }
console.log(parseInt(value) < 0, "parseInt(value) < 0")
if (parseInt(value) < 0) { if (parseInt(value) < 0) {
value = "" value = ""
this.$message.warning(`输入值不能小于0`) this.$message.warning(`输入值不能小于0`)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!