liujt 4 өдөр өмнө
parent
commit
491145d17c

+ 6 - 3
src/api/saleManage/saleorder.js

@@ -52,7 +52,10 @@ export async function getWarehouseOutStock(params) {
     params
   });
   if (res.data.code == 0) {
-    return res.data.data;
+    const data = res.data.data;
+    return data && typeof data === 'object'
+      ? data.availableCountBase || 0
+      : data;
   }
   return Promise.reject(new Error(res.data.message));
 }
@@ -189,7 +192,7 @@ export async function updateOrderInfo(data) {
     return res.data.data;
   }
   return Promise.reject(new Error(res.data.message));
-  
+
 }
 
 //选择物品获取价格
@@ -208,4 +211,4 @@ export async function saleOrderAdd(data) {
     return res.data.data;
   }
   return Promise.reject(new Error(res.data.message));
-}
+}

+ 6 - 4
src/views/warehouseManagement/stockLedger/components/item-list.vue

@@ -452,10 +452,11 @@
             align: 'center',
             showOverflowTooltip: true,
             formatter: (row) => {
-              // 使用整数运算避免浮点数精度丢失
-              const measure = Number(row.measureQuantity) || 0;
+              // 入库计量数量不会随出库变化,可用数量必须使用当前批次库存余额计算
+              const inventoryBalance = Number(row.availableCountBase) || 0;
               const lock = Number(row.lockQuantity) || 0;
-              const result = (measure * 100 - lock * 100) / 100;
+              const result =
+                (inventoryBalance * 100 - lock * 100) / 100;
               return Math.round(result * 100) / 100;
             }
           },
@@ -465,7 +466,8 @@
             sortable: 'custom',
             showOverflowTooltip: true,
             width: 130,
-            align: 'center'
+            align: 'center',
+            formatter: (row) => row.stockCountBase
           },
           // {
           //   prop: 'supplierName',