Kaynağa Gözat

修改仓库数量输入限制

huang_an 1 yıl önce
ebeveyn
işleme
8c16dd10c6

+ 10 - 8
src/views/bpm/stockManagement/storage.vue

@@ -250,6 +250,7 @@
                   >
                     <el-input
                       :ref="'packingQuantity' + $index"
+                      type="number"
                       @keyup.native="
                         moveFocus(
                           $event,
@@ -963,7 +964,7 @@
             trigger: 'change'
           }
         },
-        qualityResultsOptions, // 质检结果下拉选项 0无 1合格 2不合格
+        qualityResultsOptions, // 质检结果选项
         qualityStatus, // 质检状态 0未检 1已检
         qualityResults, // 质检结果 0无 1合格 2不合格
         productList: [], // 产品列表
@@ -1042,17 +1043,18 @@
         if (isClear) {
           this.$set(this.productList[index], 'warehouseId', '');
           this.$set(this.productList[index], 'warehouseName', '');
-          if (row.packingQuantity < 1) {
+          if (row.packingQuantity < 0) {
             this.$set(this.productList[index], 'packingQuantity', 1);
           } else if (row.packingQuantity > 9999) {
             this.$set(this.productList[index], 'packingQuantity', 9999);
-          } else {
-            this.$set(
-              this.productList[index],
-              'packingQuantity',
-              row.packingQuantity.replace(/[^\d\.{2,}]/g, '')
-            );
           }
+          // else {
+          //   this.$set(
+          //     this.productList[index],
+          //     'packingQuantity',
+          //     row.packingQuantity.replace(/[^\d\.{2,}]/g, '')
+          //   );
+          // }
         }
         if (row.packingQuantity && row.packingUnit) {
           console.log(index);

+ 21 - 16
src/views/bpm/stockManagement/storage_2.vue

@@ -1782,22 +1782,27 @@
       // 包装维度最小包装单元改变——>总重量
       minPackingQuantityChange(row, value, index) {
         console.log(value);
-        if (row.measureUnit !== 'KG') {
-          if (value.replace(/^(0+)|[^\d]+/g, '') > 999999) {
-            this.$set(this.productList[index], 'minPackingQuantity', 999999);
-          } else {
-            this.$set(
-              this.productList[index],
-              'minPackingQuantity',
-              value.replace(/^(0+)|[^\d]+/g, '')
-            );
-          }
-        } else {
-          if (value < 1) {
-            this.$set(this.productList[index], 'minPackingQuantity', 1);
-          } else if (value > 999999) {
-            this.$set(this.productList[index], 'minPackingQuantity', 999999);
-          }
+        // if (row.measureUnit !== 'KG') {
+        //   if (value.replace(/^(0+)|[^\d]+/g, '') > 999999) {
+        //     this.$set(this.productList[index], 'minPackingQuantity', 999999);
+        //   } else {
+        //     this.$set(
+        //       this.productList[index],
+        //       'minPackingQuantity',
+        //       value.replace(/^(0+)|[^\d]+/g, '')
+        //     );
+        //   }
+        // } else {
+        //   if (value < 0) {
+        //     this.$set(this.productList[index], 'minPackingQuantity', 1);
+        //   } else if (value > 999999) {
+        //     this.$set(this.productList[index], 'minPackingQuantity', 999999);
+        //   }
+        // }
+        if (value < 0) {
+          this.$set(this.productList[index], 'minPackingQuantity', 1);
+        } else if (value > 999999) {
+          this.$set(this.productList[index], 'minPackingQuantity', 999999);
         }
         if (row.packingQuantity >= 0 && value >= 0) {
           this.packNum(row, row.packingQuantity, index);

+ 9 - 7
src/views/bpm/stockManagement/storage_3.vue

@@ -250,6 +250,7 @@
                   >
                     <el-input
                       :ref="'packingQuantity' + $index"
+                      type="number"
                       @keyup.native="
                         moveFocus(
                           $event,
@@ -1042,17 +1043,18 @@
         if (isClear) {
           this.$set(this.productList[index], 'warehouseId', '');
           this.$set(this.productList[index], 'warehouseName', '');
-          if (row.packingQuantity < 1) {
+          if (row.packingQuantity < 0) {
             this.$set(this.productList[index], 'packingQuantity', 1);
           } else if (row.packingQuantity > 9999) {
             this.$set(this.productList[index], 'packingQuantity', 9999);
-          } else {
-            this.$set(
-              this.productList[index],
-              'packingQuantity',
-              row.packingQuantity.replace(/[^\d\.{2,}]/g, '')
-            );
           }
+          // else {
+          //   this.$set(
+          //     this.productList[index],
+          //     'packingQuantity',
+          //     row.packingQuantity.replace(/[^\d\.{2,}]/g, '')
+          //   );
+          // }
         }
         if (row.packingQuantity && row.packingUnit) {
           console.log(index);