From dac6aca24067fa940507429514cb3e9b7c0ed112 Mon Sep 17 00:00:00 2001 From: SZCJW <792430652@qq.com> Date: Tue, 17 Mar 2026 22:40:57 +0800 Subject: [PATCH] x --- static/vue-app.js | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/static/vue-app.js b/static/vue-app.js index 1daa8c7..797fcf7 100644 --- a/static/vue-app.js +++ b/static/vue-app.js @@ -1472,6 +1472,7 @@ const InventoryView = { const route = useRoute(); const state = reactive({ activeTab: 'dashboard', + productCategory: 'finished', dashboard: null, financeSummary: null, financePeriod: { @@ -1746,6 +1747,24 @@ const InventoryView = { } }; + const switchProductCategory = (category) => { + state.productCategory = category; + }; + + const openCreateProduct = (itemType) => { + state.modalType = 'product'; + state.editingItem = null; + state.form = { + item_type: itemType, + unit: itemType === 'material' ? 'kg' : '件', + min_stock: 0, + max_stock: 1000, + cost_price: 0, + sale_price: 0 + }; + state.showModal = true; + }; + const loadOrderProductionPlan = async (orderId) => { try { state.productionPlan = await apiRequest(`/api/sales-orders/${orderId}/production-plan`); @@ -2243,6 +2262,8 @@ const InventoryView = { formatCurrency, formatDateTime, openModal, + switchProductCategory, + openCreateProduct, closeModal, saveProduct, deleteProduct, @@ -2345,8 +2366,15 @@ const InventoryView = {
+
+
+ + +
+
- + +
@@ -2364,7 +2392,7 @@ const InventoryView = { - +
{{ product.item_type === 'material' ? '物料' : '成品' }} {{ product.sku }} {{ product.name }}