From 24375d6d00f243e6f68d1344a3921a81b8181034 Mon Sep 17 00:00:00 2001 From: Agent Date: Tue, 24 Mar 2026 04:18:12 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=BA=93=E5=AD=98=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=89=8D=E7=AB=AF=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/stock.js | 41 +++++++ src/pages.json | 22 ++++ src/pages/stock/flow.vue | 252 +++++++++++++++++++++++++++++++++++++++ src/pages/stock/in.vue | 162 +++++++++++++++++++++++++ src/pages/stock/list.vue | 229 +++++++++++++++++++++++++++++++++++ 5 files changed, 706 insertions(+) create mode 100644 src/api/stock.js create mode 100644 src/pages/stock/flow.vue create mode 100644 src/pages/stock/in.vue create mode 100644 src/pages/stock/list.vue diff --git a/src/api/stock.js b/src/api/stock.js new file mode 100644 index 0000000..42fa3b0 --- /dev/null +++ b/src/api/stock.js @@ -0,0 +1,41 @@ +import api from './index' + +/** + * 库存相关API + */ +export default { + /** + * 获取库存列表 + */ + getStockList(params) { + return api.request('/stock', 'GET', params) + }, + + /** + * 获取单商品库存 + */ + getStock(productId) { + return api.request(`/stock/${productId}`, 'GET') + }, + + /** + * 入库 + */ + stockIn(data) { + return api.request('/stock/in', 'POST', null, data) + }, + + /** + * 库存调整 + */ + adjustStock(data) { + return api.request('/stock/adjust', 'POST', null, data) + }, + + /** + * 获取库存流水 + */ + getStockFlow(params) { + return api.request('/stock/flow', 'GET', params) + } +} diff --git a/src/pages.json b/src/pages.json index 5ea2792..26c0109 100644 --- a/src/pages.json +++ b/src/pages.json @@ -35,6 +35,24 @@ "style": { "navigationBarTitleText": "订单列表" } + }, + { + "path": "pages/stock/list", + "style": { + "navigationBarTitleText": "库存管理" + } + }, + { + "path": "pages/stock/in", + "style": { + "navigationBarTitleText": "入库" + } + }, + { + "path": "pages/stock/flow", + "style": { + "navigationBarTitleText": "库存流水" + } } ], "globalStyle": { @@ -57,6 +75,10 @@ "pagePath": "pages/product/list", "text": "商品" }, + { + "pagePath": "pages/stock/list", + "text": "库存" + }, { "pagePath": "pages/order/list", "text": "订单" diff --git a/src/pages/stock/flow.vue b/src/pages/stock/flow.vue new file mode 100644 index 0000000..605c704 --- /dev/null +++ b/src/pages/stock/flow.vue @@ -0,0 +1,252 @@ + + + + + diff --git a/src/pages/stock/in.vue b/src/pages/stock/in.vue new file mode 100644 index 0000000..eee09c1 --- /dev/null +++ b/src/pages/stock/in.vue @@ -0,0 +1,162 @@ + + + + + diff --git a/src/pages/stock/list.vue b/src/pages/stock/list.vue new file mode 100644 index 0000000..45bd468 --- /dev/null +++ b/src/pages/stock/list.vue @@ -0,0 +1,229 @@ + + + + +