Prechádzať zdrojové kódy

fix:5351【库存调拨】之前的入库台账的数据去调拨数量跟库存对不上

mlchen 2 dní pred
rodič
commit
3548455324

+ 6 - 2
src/views/warehouseManagement/inventoryAllocation/add.vue

@@ -585,6 +585,7 @@
             label: '计量数量',
             align: 'center',
             showOverflowTooltip: true,
+            formatter: (row) => row.stockCountBase
           },
           {
             prop: 'measureUnit',
@@ -861,6 +862,7 @@
             label: '计量数量',
             align: 'center',
             showOverflowTooltip: true,
+            formatter: (row) => row.stockCountBase
           },
           {
             prop: 'quantity',
@@ -981,9 +983,11 @@
         });
         console.log('data------', data);
         data.list = data.list.map(item => {
-          const measure = Number(item.measureQuantity) || 0;
+          // 入库计量数量不会随出库变化,可用数量使用当前批次库存余额计算
+          const inventoryBalance = Number(item.availableCountBase) || 0;
           const lock = Number(item.lockQuantity) || 0;
-          item.availableQuantity = (measure * 100 - lock * 100) / 100;
+          const result = (inventoryBalance * 100 - lock * 100) / 100;
+          item.availableQuantity = Math.round(result * 100) / 100;
           return item;
         })
         return data;