|
@@ -1190,12 +1190,13 @@ export default {
|
|
|
return false
|
|
|
} else {
|
|
|
if (parseFloat(this.listAdd[j].price) == 0) {
|
|
|
- this.$message({ type: 'warning', message: '价格请输入正数,最多保留小数点后两位', duration: 2000 })
|
|
|
+ this.$message({ type: 'warning', message: '价格请输入正数,最多保留小数点后五位', duration: 2000 })
|
|
|
return false
|
|
|
} else {
|
|
|
- var rulesPrice = /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/
|
|
|
+ // var rulesPrice = /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/
|
|
|
+ var rulesPrice = /(^[1-9](\d+)?(\.\d{1,5})?$)|(^\d\.\d{1,5}$)/
|
|
|
if (rulesPrice.test(this.listAdd[j].price) == false) {
|
|
|
- this.$message({ type: 'error', message: '价格请输入正数,最多保留小数点后两位', duration: 2000 })
|
|
|
+ this.$message({ type: 'error', message: '价格请输入正数,最多保留小数点后五位', duration: 2000 })
|
|
|
return false
|
|
|
}
|
|
|
}
|
|
@@ -1467,12 +1468,13 @@ export default {
|
|
|
return false
|
|
|
} else {
|
|
|
if (parseFloat(this.listAdd[j].price) == 0) {
|
|
|
- this.$message({ type: 'warning', message: '价格请输入正数,最多保留小数点后两位', duration: 2000 })
|
|
|
+ this.$message({ type: 'warning', message: '价格请输入正数,最多保留小数点后五位', duration: 2000 })
|
|
|
return false
|
|
|
} else {
|
|
|
- var rulesPrice = /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/
|
|
|
+ // var rulesPrice = /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/
|
|
|
+ var rulesPrice = /(^[1-9](\d+)?(\.\d{1,5})?$)|(^\d\.\d{1,5}$)/
|
|
|
if (rulesPrice.test(this.listAdd[j].price) == false) {
|
|
|
- this.$message({ type: 'error', message: '价格请输入正数,最多保留小数点后两位', duration: 2000 })
|
|
|
+ this.$message({ type: 'error', message: '价格请输入正数,最多保留小数点后五位', duration: 2000 })
|
|
|
return false
|
|
|
}
|
|
|
}
|
|
@@ -2074,12 +2076,13 @@ export default {
|
|
|
return false
|
|
|
} else {
|
|
|
if (parseFloat(this.listAdd[j].price) == 0) {
|
|
|
- this.$message({ type: 'warning', message: '价格请输入正数,最多保留小数点后两位', duration: 2000 })
|
|
|
+ this.$message({ type: 'warning', message: '价格请输入正数,最多保留小数点后五位', duration: 2000 })
|
|
|
return false
|
|
|
} else {
|
|
|
- var rulesPrice = /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/
|
|
|
+ // var rulesPrice = /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/
|
|
|
+ var rulesPrice = /(^[1-9](\d+)?(\.\d{1,5})?$)|(^\d\.\d{1,5}$)/
|
|
|
if (rulesPrice.test(this.listAdd[j].price) == false) {
|
|
|
- this.$message({ type: 'error', message: '价格请输入正数,最多保留小数点后两位', duration: 2000 })
|
|
|
+ this.$message({ type: 'error', message: '价格请输入正数,最多保留小数点后五位', duration: 2000 })
|
|
|
return false
|
|
|
}
|
|
|
}
|