Quellcode durchsuchen

fix(库存管理): 修复包装单位与重量单位相等时单重计算问题

yusheng vor 7 Monaten
Ursprung
Commit
aaf5d44d1d
1 geänderte Dateien mit 9 neuen und 4 gelöschten Zeilen
  1. 9 4
      src/views/warehouseManagement/stockManagement/add.vue

+ 9 - 4
src/views/warehouseManagement/stockManagement/add.vue

@@ -1663,9 +1663,14 @@
           let weight = 0;
           if (row.measureUnit == row.weightUnit) {
             weight = row.measureQuantity;
-            row.singleWeight =
-              Math.trunc((row.measureQuantity / row.packingQuantity) * 100) /
-              100;
+            //包装单位与重量单位相等时,单重重量为0
+            if (row.packingUnit == row.weightUnit) {
+              row.singleWeight = 0;
+            } else {
+              row.singleWeight =
+                Math.trunc((row.measureQuantity / row.packingQuantity) * 100) /
+                100;
+            }
           } else if (row.singleWeight) {
             weight = row.measureQuantity * Number(row.singleWeight);
           }
@@ -3292,7 +3297,7 @@
                 measureQuantity =
                   Math.trunc((row.weight / packingCodeList.length) * 100) / 100;
               } else {
-                 measureQuantity = row.packingSpecificationOption[1].packageCell;
+                measureQuantity = row.packingSpecificationOption[1].packageCell;
               }
             }
             console.log(