Browse Source

修改了合同页面备件明细新增价格校验条件

duanxiaoduan 1 năm trước cách đây
mục cha
commit
206382b025

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
dist/index.html


+ 9 - 24
src/views/custom/contractManagement/index.vue

@@ -2144,15 +2144,10 @@ export default {
               this.$message({ type: 'error', message: '计划量请输入正整数', duration: 2000 })
               this.$message({ type: 'error', message: '计划量请输入正整数', duration: 2000 })
               return false
               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
               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 })
               this.$message({ type: 'error', message: '计划量请输入正整数', duration: 2000 })
               return false
               return false
             } else {
             } 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
                 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 })
                 this.$message({ type: 'error', message: '计划量请输入正整数', duration: 2000 })
                 return false
                 return false
               } else {
               } 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
                   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
-                  }
                 }
                 }
               }
               }
             }
             }

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác