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 @@ + + + + +