From 2a5821805c918be36c2aa99ff88bacb87e4bfa34 Mon Sep 17 00:00:00 2001 From: SZCJW <792430652@qq.com> Date: Tue, 17 Mar 2026 22:50:09 +0800 Subject: [PATCH] x --- static/index.html | 2 +- static/vue-app.js | 94 ++++++++++++++++++++++++++++++++--------------- 2 files changed, 66 insertions(+), 30 deletions(-) diff --git a/static/index.html b/static/index.html index c0581ff..4c8b3ad 100644 --- a/static/index.html +++ b/static/index.html @@ -18,6 +18,6 @@ - + diff --git a/static/vue-app.js b/static/vue-app.js index 797fcf7..f562f94 100644 --- a/static/vue-app.js +++ b/static/vue-app.js @@ -1488,6 +1488,7 @@ const InventoryView = { supplierProductStatement: [], products: [], materials: [], + finishedProducts: [], purchaseOrders: [], purchaseWarehouseId: null, purchaseReceiveItems: [], @@ -1545,17 +1546,22 @@ const InventoryView = { } }; - const loadProducts = async () => { + const loadFinishedProducts = async () => { state.loading = true; try { - state.products = await apiRequest('/api/products?limit=100'); + state.finishedProducts = await apiRequest('/api/products?item_type=finished&limit=100'); } catch (e) { - handleApiError(e, '加载产品'); + handleApiError(e, '加载成品'); } finally { state.loading = false; } }; + const loadProducts = async () => { + // Compatibility wrapper if needed, or just load finished products + await loadFinishedProducts(); + }; + const loadMaterials = async () => { state.loading = true; try { @@ -1736,14 +1742,15 @@ const InventoryView = { state.activeTab = tab; switch (tab) { case 'dashboard': loadDashboard(); break; - case 'products': loadProducts(); break; - case 'suppliers': loadSuppliers(); break; - case 'customers': loadCustomers(); break; - case 'inventory': loadInventory(); break; - case 'movements': loadMovements(); break; + case 'sales_orders': loadProductionOrders(); break; + case 'products': loadFinishedProducts(); break; + case 'materials': loadMaterials(); break; case 'purchases': loadPurchaseOrders(); break; - case 'production': loadProductionOrders(); break; + case 'inventory': loadInventory(); break; + case 'customers': loadCustomers(); break; + case 'suppliers': loadSuppliers(); break; case 'finance': loadFinance(); break; + case 'movements': loadMovements(); break; } }; @@ -2304,14 +2311,15 @@ const InventoryView = {
- - - - + + + + + - - + +
@@ -2366,21 +2374,13 @@ const InventoryView = {
-
-
- - -
-
- - +
- @@ -2392,18 +2392,54 @@ const InventoryView = { - - + - + + + + +
类型 SKU 名称 分类
{{ product.item_type === 'material' ? '物料' : '成品' }}
{{ product.sku }} {{ product.name }} {{ product.category || '-' }} {{ product.unit }} {{ formatCurrency(product.cost_price) }} {{ formatCurrency(product.sale_price) }}{{ product.item_type === 'finished' ? formatCurrency(product.material_cost || 0) : '-' }}{{ formatCurrency(product.material_cost || 0) }} +
+ + + +
+
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + +
SKU名称分类单位成本价最低库存操作
{{ product.sku }}{{ product.name }}{{ product.category || '-' }}{{ product.unit }}{{ formatCurrency(product.cost_price) }}{{ product.min_stock || '-' }}
-
@@ -2566,7 +2602,7 @@ const InventoryView = { -
+