|
@@ -2144,15 +2144,10 @@ export default {
|
|
|
this.$message({ type: 'error', message: '计划量请输入正整数', duration: 2000 })
|
|
|
return false
|
|
|
}
|
|
|
- if (parseFloat(this.tab1.detailsSpareParts.listAdd[i].price) == 0) {
|
|
|
- this.$message({ type: 'warning', message: '价格请输入正数,最多保留小数点后五位', duration: 2000 })
|
|
|
+ var rulesPrice = /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/
|
|
|
+ if (rulesPrice.test(this.tab1.detailsSpareParts.listAdd[i].price) == false) {
|
|
|
+ this.$message({ type: 'error', message: '价格请输入正数,最多保留小数点后两位', duration: 2000 })
|
|
|
return false
|
|
|
- } else {
|
|
|
- var rulesPrice = /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,5})?$/
|
|
|
- if (rulesPrice.test(this.tab1.detailsSpareParts.listAdd[i].price) == false) {
|
|
|
- this.$message({ type: 'error', message: '价格请输入正数,最多保留小数点后五位', duration: 2000 })
|
|
|
- return false
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -2247,15 +2242,10 @@ export default {
|
|
|
this.$message({ type: 'error', message: '计划量请输入正整数', duration: 2000 })
|
|
|
return false
|
|
|
} else {
|
|
|
- if (parseFloat(this.tab1.detailsSpareParts.listAdd[i].price) == 0) {
|
|
|
- this.$message({ type: 'warning', message: '价格请输入正数,最多保留小数点后五位', duration: 2000 })
|
|
|
+ var rulesPrice = /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/
|
|
|
+ if (rulesPrice.test(this.tab1.detailsSpareParts.listAdd[i].price) == false) {
|
|
|
+ this.$message({ type: 'error', message: '价格请输入正数,最多保留小数点后两位', duration: 2000 })
|
|
|
return false
|
|
|
- } else {
|
|
|
- var rulesPrice = /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,5})?$/
|
|
|
- if (rulesPrice.test(this.tab1.detailsSpareParts.listAdd[i].price) == false) {
|
|
|
- this.$message({ type: 'error', message: '价格请输入正数,最多保留小数点后五位', duration: 2000 })
|
|
|
- return false
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -2561,15 +2551,10 @@ export default {
|
|
|
this.$message({ type: 'error', message: '计划量请输入正整数', duration: 2000 })
|
|
|
return false
|
|
|
} else {
|
|
|
- if (parseFloat(this.tab1.detailsSpareParts.listAdd[i].price) == 0) {
|
|
|
- this.$message({ type: 'warning', message: '价格请输入正数,最多保留小数点后五位', duration: 2000 })
|
|
|
+ var rulesPrice = /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/
|
|
|
+ if (rulesPrice.test(this.tab1.detailsSpareParts.listAdd[i].price) == false) {
|
|
|
+ this.$message({ type: 'error', message: '价格请输入正数,最多保留小数点后两位', duration: 2000 })
|
|
|
return false
|
|
|
- } else {
|
|
|
- var rulesPrice = /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,5})?$/
|
|
|
- if (rulesPrice.test(this.tab1.detailsSpareParts.listAdd[i].price) == false) {
|
|
|
- this.$message({ type: 'error', message: '价格请输入正数,最多保留小数点后五位', duration: 2000 })
|
|
|
- return false
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
}
|