x
This commit is contained in:
+6
-4
@@ -2510,7 +2510,7 @@ const InventoryView = {
|
|||||||
apiRequest('/api/sales-orders?limit=100'),
|
apiRequest('/api/sales-orders?limit=100'),
|
||||||
apiRequest('/api/warehouses')
|
apiRequest('/api/warehouses')
|
||||||
]);
|
]);
|
||||||
state.productionOrders = orders || [];
|
state.productionOrders = orders?.items || [];
|
||||||
state.warehouses = warehouses || [];
|
state.warehouses = warehouses || [];
|
||||||
if (!state.productionWarehouseId) {
|
if (!state.productionWarehouseId) {
|
||||||
state.productionWarehouseId = state.warehouses.find(w => w.is_default)?.id || state.warehouses[0]?.id || null;
|
state.productionWarehouseId = state.warehouses.find(w => w.is_default)?.id || state.warehouses[0]?.id || null;
|
||||||
@@ -2529,7 +2529,7 @@ const InventoryView = {
|
|||||||
apiRequest('/api/purchase-orders?limit=100'),
|
apiRequest('/api/purchase-orders?limit=100'),
|
||||||
apiRequest('/api/warehouses')
|
apiRequest('/api/warehouses')
|
||||||
]);
|
]);
|
||||||
state.purchaseOrders = orders || [];
|
state.purchaseOrders = orders?.items || [];
|
||||||
state.warehouses = warehouses || [];
|
state.warehouses = warehouses || [];
|
||||||
if (!state.purchaseWarehouseId) {
|
if (!state.purchaseWarehouseId) {
|
||||||
state.purchaseWarehouseId = state.warehouses.find(w => w.is_default)?.id || state.warehouses[0]?.id || null;
|
state.purchaseWarehouseId = state.warehouses.find(w => w.is_default)?.id || state.warehouses[0]?.id || null;
|
||||||
@@ -2555,7 +2555,8 @@ const InventoryView = {
|
|||||||
const loadInventory = async () => {
|
const loadInventory = async () => {
|
||||||
state.loading = true;
|
state.loading = true;
|
||||||
try {
|
try {
|
||||||
state.inventory = await apiRequest('/api/inventory');
|
const data = await apiRequest('/api/inventory');
|
||||||
|
state.inventory = data?.items || [];
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
handleApiError(e, '加载库存');
|
handleApiError(e, '加载库存');
|
||||||
} finally {
|
} finally {
|
||||||
@@ -2566,7 +2567,8 @@ const InventoryView = {
|
|||||||
const loadMovements = async () => {
|
const loadMovements = async () => {
|
||||||
state.loading = true;
|
state.loading = true;
|
||||||
try {
|
try {
|
||||||
state.movements = await apiRequest('/api/stock-movements');
|
const data = await apiRequest('/api/stock-movements');
|
||||||
|
state.movements = data?.items || [];
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
handleApiError(e, '加载变动记录');
|
handleApiError(e, '加载变动记录');
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
Reference in New Issue
Block a user