Przeglądaj źródła

合同编辑 修改验证 sdy

zhongtianhaoyuan 3 lat temu
rodzic
commit
959d0bcbff

+ 53 - 68
src/views/contractManagement/purchaseContractEdit.vue

@@ -1025,13 +1025,13 @@
           })
           return
         }
-        if (!this.deptBudgetList.contractGoodsInfo.impurity) {
-          this.$message({
-            message: '请输入杂质',
-            type: 'warning',
-          })
-          return
-        }
+        // if (!this.deptBudgetList.contractGoodsInfo.impurity) {
+        //   this.$message({
+        //     message: '请输入杂质',
+        //     type: 'warning',
+        //   })
+        //   return
+        // }
         if (
           this.deptBudgetList.contractGoodsInfo.impurity &&
           String(this.deptBudgetList.contractGoodsInfo.impurity).indexOf('.') != -1 &&
@@ -1045,13 +1045,13 @@
           })
           return
         }
-        if (!this.deptBudgetList.contractGoodsInfo.bulkDensity) {
-          this.$message({
-            message: '请输入容重',
-            type: 'warning',
-          })
-          return
-        }
+        // if (!this.deptBudgetList.contractGoodsInfo.bulkDensity) {
+        //   this.$message({
+        //     message: '请输入容重',
+        //     type: 'warning',
+        //   })
+        //   return
+        // }
         if (
           (this.deptBudgetList.contractGoodsInfo.bulkDensity &&
             String(this.deptBudgetList.contractGoodsInfo.bulkDensity).indexOf('.') != -1 &&
@@ -1066,25 +1066,19 @@
           })
           return
         }
-        if (!this.deptBudgetList.contractGoodsInfo.mildewGrain) {
-          this.$message({
-            message: '请输入霉变粒',
-            type: 'warning',
-          })
-          return
-        }
-        if (
-          !this.deptBudgetList.contractGoodsInfo.mildewGrain ||
-          (String(this.deptBudgetList.contractGoodsInfo.mildewGrain).indexOf(
-              '.'
-            ) != -1 &&
-            String(this.deptBudgetList.contractGoodsInfo.mildewGrain).length -
-            (String(this.deptBudgetList.contractGoodsInfo.mildewGrain).indexOf(
-                '.'
-              ) +
-              1) >
-            2 || this.deptBudgetList.contractGoodsInfo.mildewGrain > 40 || this.deptBudgetList.contractGoodsInfo
-            .mildewGrain < 0)
+        // if (!this.deptBudgetList.contractGoodsInfo.mildewGrain) {
+        //   this.$message({
+        //     message: '请输入霉变粒',
+        //     type: 'warning',
+        //   })
+        //   return
+        // }
+         if (
+          this.deptBudgetList.contractGoodsInfo.mildewGrain &&
+          String(this.deptBudgetList.contractGoodsInfo.mildewGrain).indexOf('.') != -1 &&
+          String(this.deptBudgetList.contractGoodsInfo.mildewGrain).length -
+          (String(this.deptBudgetList.contractGoodsInfo.mildewGrain).indexOf('.') + 1) >
+          2 || this.deptBudgetList.contractGoodsInfo.mildewGrain > 40 || this.deptBudgetList.contractGoodsInfo.mildewGrain < 0
         ) {
           this.$message({
             message: '霉变粒输入错误',
@@ -1092,24 +1086,19 @@
           })
           return
         }
-        if (!this.deptBudgetList.contractGoodsInfo.jiaorenli) {
-          this.$message({
-            message: '请输入热损伤',
-            type: 'warning',
-          })
-          return
-        }
+        // if (!this.deptBudgetList.contractGoodsInfo.jiaorenli) {
+        //   this.$message({
+        //     message: '请输入热损伤',
+        //     type: 'warning',
+        //   })
+        //   return
+        // }
         if (
-          !this.deptBudgetList.contractGoodsInfo.jiaorenli ||
-          (String(this.deptBudgetList.contractGoodsInfo.jiaorenli).indexOf('.') !=
-            -1 &&
-            String(this.deptBudgetList.contractGoodsInfo.jiaorenli).length -
-            (String(this.deptBudgetList.contractGoodsInfo.jiaorenli).indexOf(
-                '.'
-              ) +
-              1) >
-            2 || this.deptBudgetList.contractGoodsInfo.jiaorenli > 40 || this.deptBudgetList.contractGoodsInfo
-            .jiaorenli < 0)
+          this.deptBudgetList.contractGoodsInfo.jiaorenli &&
+          String(this.deptBudgetList.contractGoodsInfo.jiaorenli).indexOf('.') != -1 &&
+          String(this.deptBudgetList.contractGoodsInfo.jiaorenli).length -
+          (String(this.deptBudgetList.contractGoodsInfo.jiaorenli).indexOf('.') + 1) >
+          2 || this.deptBudgetList.contractGoodsInfo.jiaorenli > 40 || this.deptBudgetList.contractGoodsInfo.jiaorenli < 0
         ) {
           this.$message({
             message: '热损伤输入错误',
@@ -1117,25 +1106,19 @@
           })
           return
         }
-        if (!this.deptBudgetList.contractGoodsInfo.imperfectGrain) {
-          this.$message({
-            message: '请输入不完善粒',
-            type: 'warning',
-          })
-          return
-        }
+        // if (!this.deptBudgetList.contractGoodsInfo.imperfectGrain) {
+        //   this.$message({
+        //     message: '请输入不完善粒',
+        //     type: 'warning',
+        //   })
+        //   return
+        // }
         if (
-          !this.deptBudgetList.contractGoodsInfo.imperfectGrain ||
-          (String(this.deptBudgetList.contractGoodsInfo.imperfectGrain).indexOf(
-              '.'
-            ) != -1 &&
-            String(this.deptBudgetList.contractGoodsInfo.imperfectGrain).length -
-            (String(
-                this.deptBudgetList.contractGoodsInfo.imperfectGrain
-              ).indexOf('.') +
-              1) >
-            2 || this.deptBudgetList.contractGoodsInfo.imperfectGrain > 40 || this.deptBudgetList.contractGoodsInfo
-            .imperfectGrain < 0)
+          this.deptBudgetList.contractGoodsInfo.imperfectGrain &&
+          String(this.deptBudgetList.contractGoodsInfo.imperfectGrain).indexOf('.') != -1 &&
+          String(this.deptBudgetList.contractGoodsInfo.imperfectGrain).length -
+          (String(this.deptBudgetList.contractGoodsInfo.imperfectGrain).indexOf('.') + 1) >
+          2 || this.deptBudgetList.contractGoodsInfo.imperfectGrain > 40 || this.deptBudgetList.contractGoodsInfo.imperfectGrain < 0
         ) {
           this.$message({
             message: '不完善粒输入错误',
@@ -1143,6 +1126,8 @@
           })
           return
         }
+
+
         if (
           (this.deptBudgetList.contractProcessInfo.waterContent > 10000000) ||
           (this.deptBudgetList.contractProcessInfo.waterContent < 0) ||

+ 52 - 66
src/views/contractManagement/salesContractEdit.vue

@@ -1070,13 +1070,13 @@
           })
           return
         }
-        if (!this.deptBudgetList.contractGoodsInfo.impurity) {
-          this.$message({
-            message: '请输入杂质',
-            type: 'warning',
-          })
-          return
-        }
+        // if (!this.deptBudgetList.contractGoodsInfo.impurity) {
+        //   this.$message({
+        //     message: '请输入杂质',
+        //     type: 'warning',
+        //   })
+        //   return
+        // }
         if (
           this.deptBudgetList.contractGoodsInfo.impurity &&
           String(this.deptBudgetList.contractGoodsInfo.impurity).indexOf('.') != -1 &&
@@ -1090,13 +1090,13 @@
           })
           return
         }
-        if (!this.deptBudgetList.contractGoodsInfo.bulkDensity) {
-          this.$message({
-            message: '请输入容重',
-            type: 'warning',
-          })
-          return
-        }
+        // if (!this.deptBudgetList.contractGoodsInfo.bulkDensity) {
+        //   this.$message({
+        //     message: '请输入容重',
+        //     type: 'warning',
+        //   })
+        //   return
+        // }
         if (
           (this.deptBudgetList.contractGoodsInfo.bulkDensity &&
             String(this.deptBudgetList.contractGoodsInfo.bulkDensity).indexOf('.') != -1 &&
@@ -1111,25 +1111,20 @@
           })
           return
         }
-        if (!this.deptBudgetList.contractGoodsInfo.mildewGrain) {
-          this.$message({
-            message: '请输入霉变粒',
-            type: 'warning',
-          })
-          return
-        }
+        // if (!this.deptBudgetList.contractGoodsInfo.mildewGrain) {
+        //   this.$message({
+        //     message: '请输入霉变粒',
+        //     type: 'warning',
+        //   })
+        //   return
+        // }
         if (
-          !this.deptBudgetList.contractGoodsInfo.mildewGrain ||
-          (String(this.deptBudgetList.contractGoodsInfo.mildewGrain).indexOf(
-              '.'
-            ) != -1 &&
+          (this.deptBudgetList.contractGoodsInfo.mildewGrain &&
+            String(this.deptBudgetList.contractGoodsInfo.mildewGrain).indexOf('.') != -1 &&
             String(this.deptBudgetList.contractGoodsInfo.mildewGrain).length -
-            (String(this.deptBudgetList.contractGoodsInfo.mildewGrain).indexOf(
-                '.'
-              ) +
-              1) >
-            2 || this.deptBudgetList.contractGoodsInfo.mildewGrain > 40 || this.deptBudgetList.contractGoodsInfo
-            .mildewGrain < 0)
+            (String(this.deptBudgetList.contractGoodsInfo.mildewGrain).indexOf('.') + 1) >
+            2) || this.deptBudgetList.contractGoodsInfo.mildewGrain > 40|| this.deptBudgetList.contractGoodsInfo
+          .mildewGrain < 0
         ) {
           this.$message({
             message: '霉变粒输入错误',
@@ -1137,24 +1132,19 @@
           })
           return
         }
-        if (!this.deptBudgetList.contractGoodsInfo.jiaorenli) {
-          this.$message({
-            message: '请输入热损伤',
-            type: 'warning',
-          })
-          return
-        }
-        if (
-          !this.deptBudgetList.contractGoodsInfo.jiaorenli ||
-          (String(this.deptBudgetList.contractGoodsInfo.jiaorenli).indexOf('.') !=
-            -1 &&
+        // if (!this.deptBudgetList.contractGoodsInfo.jiaorenli) {
+        //   this.$message({
+        //     message: '请输入热损伤',
+        //     type: 'warning',
+        //   })
+        //   return
+        // }
+         if (
+          (this.deptBudgetList.contractGoodsInfo.jiaorenli &&
+            String(this.deptBudgetList.contractGoodsInfo.jiaorenli).indexOf('.') != -1 &&
             String(this.deptBudgetList.contractGoodsInfo.jiaorenli).length -
-            (String(this.deptBudgetList.contractGoodsInfo.jiaorenli).indexOf(
-                '.'
-              ) +
-              1) >
-            2 || this.deptBudgetList.contractGoodsInfo.jiaorenli > 40 || this.deptBudgetList.contractGoodsInfo
-            .jiaorenli < 0)
+            (String(this.deptBudgetList.contractGoodsInfo.jiaorenli).indexOf('.') + 1) >
+            2) || this.deptBudgetList.contractGoodsInfo.jiaorenli > 40|| this.deptBudgetList.contractGoodsInfo.jiaorenli < 0
         ) {
           this.$message({
             message: '热损伤输入错误',
@@ -1162,25 +1152,19 @@
           })
           return
         }
-        if (!this.deptBudgetList.contractGoodsInfo.imperfectGrain) {
-          this.$message({
-            message: '请输入不完善粒',
-            type: 'warning',
-          })
-          return
-        }
-        if (
-          !this.deptBudgetList.contractGoodsInfo.imperfectGrain ||
-          (String(this.deptBudgetList.contractGoodsInfo.imperfectGrain).indexOf(
-              '.'
-            ) != -1 &&
+        // if (!this.deptBudgetList.contractGoodsInfo.imperfectGrain) {
+        //   this.$message({
+        //     message: '请输入不完善粒',
+        //     type: 'warning',
+        //   })
+        //   return
+        // }
+         if (
+          (this.deptBudgetList.contractGoodsInfo.imperfectGrain &&
+            String(this.deptBudgetList.contractGoodsInfo.imperfectGrain).indexOf('.') != -1 &&
             String(this.deptBudgetList.contractGoodsInfo.imperfectGrain).length -
-            (String(
-                this.deptBudgetList.contractGoodsInfo.imperfectGrain
-              ).indexOf('.') +
-              1) >
-            2 || this.deptBudgetList.contractGoodsInfo.imperfectGrain > 40 || this.deptBudgetList.contractGoodsInfo
-            .imperfectGrain < 0)
+            (String(this.deptBudgetList.contractGoodsInfo.imperfectGrain).indexOf('.') + 1) >
+            2) || this.deptBudgetList.contractGoodsInfo.imperfectGrain > 40|| this.deptBudgetList.contractGoodsInfo.imperfectGrain < 0
         ) {
           this.$message({
             message: '不完善粒输入错误',
@@ -1188,6 +1172,8 @@
           })
           return
         }
+
+
         if(this.deptBudgetList.contractProcessInfo.goodsNameKey){
 
         if (