|
@@ -1289,12 +1289,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
|
|
|
}
|
|
|
}
|
|
@@ -1566,12 +1567,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
|
|
|
}
|
|
|
}
|
|
@@ -2173,12 +2175,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
|
|
|
}
|
|
|
}
|