Просмотр исходного кода

如果只配置最小包装单元

yijing 1 год назад
Родитель
Сommit
4ac171a01b
1 измененных файлов с 45 добавлено и 22 удалено
  1. 45 22
      src/views/warehouseManagement/stockManagement/add.vue

+ 45 - 22
src/views/warehouseManagement/stockManagement/add.vue

@@ -1179,6 +1179,7 @@ export default {
     clearSourceBizNo() {
       this.$set(this.formData, 'sourceBizNo', '');
       this.productList = []
+      this.packingList = []
     },
     // 返回
     back() {
@@ -2253,9 +2254,14 @@ export default {
               );
             }
           } else {
-            num = Math.ceil(
-              row.measureQuantity / row.packingSpecificationOption[1]?.packageCell
-            );
+            if (row.packingSpecificationOption[1]?.packageCell) {
+              num = Math.ceil(
+                row.measureQuantity / row.packingSpecificationOption[1]?.packageCell
+              );
+            } else {
+              num = row.packingQuantity;
+            }
+
           }
           console.log(packingNum, measureNum, num, '加油加油加油')
 
@@ -2388,15 +2394,17 @@ export default {
             );
           }
         } else {
-          num = Math.ceil(
-            row.measureQuantity / row.packingSpecificationOption[1]?.packageCell
-          );
-          filterArr = row.packingSpecificationOption.filter((item) => {
-            return (
-              item.packageUnit == row.packingUnit &&
-              item.packageUnit != item.conversionUnit
+          if (row.packingSpecificationOption[1]?.packageCell) {
+            num = Math.ceil(
+              row.measureQuantity / row.packingSpecificationOption[1]?.packageCell
             );
-          });
+            filterArr = row.packingSpecificationOption.filter((item) => {
+              return (
+                item.packageUnit == row.packingUnit &&
+                item.packageUnit != item.conversionUnit
+              );
+            });
+          }
         }
       }
       console.log('num-----------', num);
@@ -2815,6 +2823,9 @@ export default {
                   row.categoryLevelPathIdParent
                 );
               } else {
+                console.log(row.measureType, 'row.measureType')
+                console.log(row.measureUnit, 'row.measureUnit')
+                console.log(row.packingUnit, 'row.packingUnit')
                 if (row.measureType != 1 && row.measureUnit == row.packingUnit) {
                   let pNum = 0;
                   let mNum = row.measureQuantity
@@ -2827,17 +2838,29 @@ export default {
                     row.categoryLevelPathIdParent
                   );
                 } else {
-                  let num = Math.ceil(
-                    row.measureQuantity / row.packingSpecificationOption[1]?.packageCell
-                  );
-                  console.log(num, 'num')
-                  this.$refs.wareHouseDailogRef.open(
-                    num,
-                    row.measureQuantity,
-                    idx,
-                    row.warehouseId,
-                    row.warehouseName + '',
-                    row.categoryLevelPathIdParent);
+                  console.log(row.packingSpecificationOption[1]?.packageCell, 'row.packingSpecificationOption[1]?.packageCell')
+                  if (row.packingSpecificationOption[1]?.packageCell) {
+                    let num = Math.ceil(
+                      row.measureQuantity / row.packingSpecificationOption[1]?.packageCell
+                    );
+                    console.log(num, 'num')
+                    this.$refs.wareHouseDailogRef.open(
+                      num,
+                      row.measureQuantity,
+                      idx,
+                      row.warehouseId,
+                      row.warehouseName + '',
+                      row.categoryLevelPathIdParent);
+                  } else {
+                    console.log(num, 'numnumnumnum')
+                    this.$refs.wareHouseDailogRef.open(
+                      num,
+                      row.measureQuantity,
+                      idx,
+                      row.warehouseId,
+                      row.warehouseName + '',
+                      row.categoryLevelPathIdParent);
+                  }
                 }
               }
             }