From 6d9289cca9788d8342ecd388393440168c222631 Mon Sep 17 00:00:00 2001 From: xuyuncong <3422692813@qq.com> Date: Tue, 18 Nov 2025 14:10:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/repair/inventory/inventory.js | 68 ++ src/api/repair/vo/InventoryStatisticsVO.js | 37 + .../repair/statistics/InventoryStatistics.vue | 672 ++++++++++++++++++ .../tickets/Components/TicketItemShow.vue | 1 + 4 files changed, 778 insertions(+) create mode 100644 src/api/repair/inventory/inventory.js create mode 100644 src/api/repair/vo/InventoryStatisticsVO.js create mode 100644 src/views/repair/statistics/InventoryStatistics.vue diff --git a/src/api/repair/inventory/inventory.js b/src/api/repair/inventory/inventory.js new file mode 100644 index 0000000..d443ae7 --- /dev/null +++ b/src/api/repair/inventory/inventory.js @@ -0,0 +1,68 @@ +import request from '@/utils/request'; + +const preUrl = '/repair/statistics'; + +/** + * 获取库存统计数据 + * @param {Object} params - 查询参数 + * @param {Array} params.dateRange - 日期范围 [开始日期, 结束日期] + * @returns {Promise} - 返回Promise对象 + */ +export function getInventoryStatistics(params) { + return request({ + url: preUrl + '/inventoryStatistics', + method: 'get', + params + }); +} + +/** + * 获取库存明细统计 + * @param {Object} params - 查询参数 + * @param {Array} params.dateRange - 日期范围 [开始日期, 结束日期] + * @param {number} params.pageNum - 页码 + * @param {number} params.pageSize - 每页数量 + * @returns {Promise} - 返回Promise对象 + */ +export function getInventoryDetails(params) { + return request({ + url: preUrl + '/details', + method: 'get', + params + }); +} + +/** + * 获取库存预警信息 + * @param {Object} params - 查询参数 + * @returns {Promise} - 返回Promise对象 + */ +export function getInventoryAlerts(params) { + return request({ + url: preUrl + '/alerts', + method: 'get', + params + }); +} + +/** + * 导出库存统计报表 + * @param {Object} params - 查询参数 + * @param {Array} params.dateRange - 日期范围 [开始日期, 结束日期] + * @returns {Promise} - 返回Promise对象 + */ +export function exportInventoryStatistics(params) { + return request({ + url: preUrl + '/export', + method: 'get', + params, + responseType: 'blob' + }); +} + +export default { + getInventoryStatistics, + getInventoryDetails, + getInventoryAlerts, + exportInventoryStatistics +}; \ No newline at end of file diff --git a/src/api/repair/vo/InventoryStatisticsVO.js b/src/api/repair/vo/InventoryStatisticsVO.js new file mode 100644 index 0000000..52a53fb --- /dev/null +++ b/src/api/repair/vo/InventoryStatisticsVO.js @@ -0,0 +1,37 @@ +/** + * 库存统计VO + * + * @author AI助手 + * @date 2025年1月 + */ + +/** + * 库存统计VO + * @typedef {Object} InventoryStatisticsVO + * @property {number} beginningStock - 期初库存数量 + * @property {number} beginningAmount - 期初库存金额 + * @property {number} currentPurchaseStock - 当期购进数量 + * @property {number} currentPurchaseAmount - 当期购进金额 + * @property {number} currentPickingStock - 当期领出数量 + * @property {number} currentPickingAmount - 当期领出金额 + */ + +/** + * 创建库存统计VO对象 + * @param {Object} data - 初始化数据 + * @returns {InventoryStatisticsVO} + */ +export function createInventoryStatisticsVO(data = {}) { + return { + beginningStock: data.beginningStock || 0, + beginningAmount: data.beginningAmount || 0, + currentPurchaseStock: data.currentPurchaseStock || 0, + currentPurchaseAmount: data.currentPurchaseAmount || 0, + currentPickingStock: data.currentPickingStock || 0, + currentPickingAmount: data.currentPickingAmount || 0 + }; +} + +export default { + createInventoryStatisticsVO +}; \ No newline at end of file diff --git a/src/views/repair/statistics/InventoryStatistics.vue b/src/views/repair/statistics/InventoryStatistics.vue new file mode 100644 index 0000000..e99153f --- /dev/null +++ b/src/views/repair/statistics/InventoryStatistics.vue @@ -0,0 +1,672 @@ + + + + + 库存统计报表 + + + + + + + + 查询 + + 重置 + + + + + + + + + + 期初库存 + + + + + 数量: + {{ formatNumber(statisticsData.beginningStock) }} + + + 金额: + {{ formatCurrency(statisticsData.beginningAmount) }} + + + + + + + + 当期购进 + + + + + 数量: + {{ formatNumber(statisticsData.currentPurchaseStock) }} + + + 金额: + {{ formatCurrency(statisticsData.currentPurchaseAmount) }} + + + + + + + + 当期领出 + + + + + 数量: + {{ formatNumber(statisticsData.currentPickingStock) }} + + + 金额: + {{ formatCurrency(statisticsData.currentPickingAmount) }} + + + + + + + + 期末库存 + + + + + 数量: + {{ formatNumber(getEndingStock()) }} + + + 金额: + {{ formatCurrency(getEndingAmount()) }} + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/views/repair/tickets/Components/TicketItemShow.vue b/src/views/repair/tickets/Components/TicketItemShow.vue index 5cc4ef9..0679ebd 100644 --- a/src/views/repair/tickets/Components/TicketItemShow.vue +++ b/src/views/repair/tickets/Components/TicketItemShow.vue @@ -17,6 +17,7 @@ {{ scope.row[listType]?.model }} +