diff --git a/src/views/modules/orderIssure/soIssueNotify/searchIssureNotifyForCK.vue b/src/views/modules/orderIssure/soIssueNotify/searchIssureNotifyForCK.vue index a0a5aea..ef08462 100644 --- a/src/views/modules/orderIssure/soIssueNotify/searchIssureNotifyForCK.vue +++ b/src/views/modules/orderIssure/soIssueNotify/searchIssureNotifyForCK.vue @@ -140,8 +140,6 @@ @click="resetSearch"> 重置 - -
+ class="el-button el-button--success el-button--medium"> 导出
+
+ + 申请数量: + {{ formatSummaryQty(summaryData.qtyToIssue) }} + + + 累计出库数量: + {{ formatSummaryQty(summaryData.actualOutQty) }} + +
@@ -240,6 +248,11 @@ export default { pageIndex: 1, pageSize: 50, totalPage: 0, + // 汇总数据(按当前查询条件,全量) + summaryData: { + qtyToIssue: 0, + actualOutQty: 0 + }, columnList: [ { columnProp: "notifyNo", @@ -482,6 +495,7 @@ export default { warehouseIdList: [] } this.pageIndex = 1 + this.resetSummaryData() this.searchTable() }, // 获取用户BU列表 @@ -539,22 +553,73 @@ export default { this.pageIndex = data.page.currPage this.pageSize = data.page.pageSize this.totalPage = data.page.totalCount + this.loadSummaryData() } else { this.dataList = [] + this.resetSummaryData() this.$message.error(data.msg || '查询失败') } }).catch(() => { this.dataListLoading = false this.dataList = [] + this.resetSummaryData() }) }, // 导出相关方法 async createExportData() { - this.searchData.limit = -1 - this.searchData.page = 1 - const {data} = await searchIssueNotifyReport(this.searchData) + const params = { + ...this.searchData, + page: 1, + limit: -1 + } + const {data} = await searchIssueNotifyReport(params) return data && data.page ? data.page.list : [] }, + // 获取汇总数据(当前条件下全量) + async loadSummaryData() { + const params = { + ...this.searchData, + page: 1, + limit: -1 + } + try { + const {data} = await searchIssueNotifyReport(params) + if (data && data.code === 0) { + this.calculateSummary(data.page && data.page.list ? data.page.list : []) + } else { + this.resetSummaryData() + } + } catch (err) { + console.error('查询汇总失败:', err) + this.resetSummaryData() + } + }, + calculateSummary(list) { + const summary = list.reduce((acc, item) => { + acc.qtyToIssue += this.normalizeQty(item.qtyToIssue) + acc.actualOutQty += this.normalizeQty(item.actualOutQty) + return acc + }, { + qtyToIssue: 0, + actualOutQty: 0 + }) + this.summaryData = summary + }, + normalizeQty(value) { + const numberValue = Number(value) + return Number.isFinite(numberValue) ? numberValue : 0 + }, + formatSummaryQty(value) { + const numberValue = this.normalizeQty(value) + const fixedValue = numberValue.toFixed(6).replace(/\.?0+$/, '') + return fixedValue || '0' + }, + resetSummaryData() { + this.summaryData = { + qtyToIssue: 0, + actualOutQty: 0 + } + }, startDownload() { this._exportLoading = this.$loading({ lock: true, @@ -736,10 +801,29 @@ export default { padding-top: 0; } -.action-left, -.action-right { +.action-left { display: flex; gap: 8px; + align-items: center; +} + +.action-right { + display: flex; + align-items: center; + gap: 18px; + margin-left: auto; + color: #606266; + font-size: 12px; +} + +.summary-item { + white-space: nowrap; +} + +.summary-value { + margin-left: 4px; + color: #303133; + font-weight: 600; } .search-actions .el-button { @@ -765,6 +849,16 @@ export default { border-color: #7dbdff; } +.search-actions .el-button--success { + background: #67C23A; + border-color: #67C23A; +} + +.search-actions .el-button--success:hover { + background: #85ce61; + border-color: #85ce61; +} + /* 响应式设计 */ @media (max-width: 1200px) { .search-actions { @@ -772,10 +866,15 @@ export default { gap: 10px; } - .action-left, + .action-left { + width: 100%; + justify-content: center; + } + .action-right { width: 100%; justify-content: center; + margin-left: 0; } } diff --git a/src/views/modules/report/inboundNotificationReport.vue b/src/views/modules/report/inboundNotificationReport.vue index ee8c352..9c7261b 100644 --- a/src/views/modules/report/inboundNotificationReport.vue +++ b/src/views/modules/report/inboundNotificationReport.vue @@ -180,6 +180,16 @@ 导出 +
+ + 要求数量: + {{ formatSummaryQty(summaryData.requiredQty) }} + + + 实际入库数量: + {{ formatSummaryQty(summaryData.actualInQty) }} + +
@@ -295,6 +305,11 @@ export default { pageIndex: 1, pageSize: 50, totalPage: 0, + // 汇总数据(按当前查询条件,全量) + summaryData: { + requiredQty: 0, + actualInQty: 0 + }, // 表格高度 tableHeight: 400, // 列定义 @@ -403,15 +418,18 @@ export default { if (data && data.code === 0) { this.dataList = data.page.list || []; this.totalPage = data.page.totalCount || 0; + this.loadSummaryData(); } else { this.dataList = []; this.totalPage = 0; + this.resetSummaryData(); this.$message.error(data.msg || '查询失败'); } }).catch(err => { console.error(err); this.searchLoading = false; this.dataListLoading = false; + this.resetSummaryData(); this.$message.error('查询异常:' + err.message); }); }, @@ -434,6 +452,7 @@ export default { departmentNo: '' }; this.pageIndex = 1; + this.resetSummaryData(); }, // 分页处理 sizeChangeHandle(val) { @@ -455,6 +474,51 @@ export default { const { data } = await searchInboundNotificationReport(params); return (data && data.page && data.page.list) || []; }, + // 获取汇总数据(当前条件下全量) + async loadSummaryData() { + const params = { + ...this.searchData, + page: 1, + limit: -1 + }; + try { + const { data } = await searchInboundNotificationReport(params); + if (data && data.code === 0) { + this.calculateSummary(data.page && data.page.list ? data.page.list : []); + } else { + this.resetSummaryData(); + } + } catch (err) { + console.error('查询汇总失败:', err); + this.resetSummaryData(); + } + }, + calculateSummary(list) { + const summary = list.reduce((acc, item) => { + acc.requiredQty += this.normalizeQty(item.requiredQty); + acc.actualInQty += this.normalizeQty(item.actualInQty); + return acc; + }, { + requiredQty: 0, + actualInQty: 0 + }); + this.summaryData = summary; + }, + normalizeQty(value) { + const numberValue = Number(value); + return Number.isFinite(numberValue) ? numberValue : 0; + }, + formatSummaryQty(value) { + const numberValue = this.normalizeQty(value); + const fixedValue = numberValue.toFixed(6).replace(/\.?0+$/, ''); + return fixedValue || '0'; + }, + resetSummaryData() { + this.summaryData = { + requiredQty: 0, + actualInQty: 0 + }; + }, startDownload() { this._exportLoading = this.$loading({ lock: true, @@ -631,6 +695,25 @@ export default { align-items: center; } +.action-right { + display: flex; + align-items: center; + gap: 18px; + margin-left: auto; + color: #606266; + font-size: 12px; +} + +.summary-item { + white-space: nowrap; +} + +.summary-value { + margin-left: 4px; + color: #303133; + font-weight: 600; +} + .search-actions .el-button { border-radius: 4px; padding: 5px 10px; @@ -733,5 +816,11 @@ export default { width: 100%; justify-content: center; } + + .action-right { + width: 100%; + justify-content: center; + margin-left: 0; + } } diff --git a/src/views/modules/report/outboundNotificationReport.vue b/src/views/modules/report/outboundNotificationReport.vue index b7abf76..8da07ac 100644 --- a/src/views/modules/report/outboundNotificationReport.vue +++ b/src/views/modules/report/outboundNotificationReport.vue @@ -181,6 +181,16 @@ 导出 +
+ + 要求数量: + {{ formatSummaryQty(summaryData.requiredQty) }} + + + 实际出库数量: + {{ formatSummaryQty(summaryData.actualOutQty) }} + +
@@ -296,6 +306,11 @@ export default { pageIndex: 1, pageSize: 50, totalPage: 0, + // 汇总数据(按当前查询条件,全量) + summaryData: { + requiredQty: 0, + actualOutQty: 0 + }, // 表格高度 tableHeight: 400, // 列定义 @@ -408,15 +423,18 @@ export default { if (data && data.code === 0) { this.dataList = data.page.list || []; this.totalPage = data.page.totalCount || 0; + this.loadSummaryData(); } else { this.dataList = []; this.totalPage = 0; + this.resetSummaryData(); this.$message.error(data.msg || '查询失败'); } }).catch(err => { console.error(err); this.searchLoading = false; this.dataListLoading = false; + this.resetSummaryData(); this.$message.error('查询异常:' + err.message); }); }, @@ -439,6 +457,7 @@ export default { departmentNo: '' }; this.pageIndex = 1; + this.resetSummaryData(); }, // 分页处理 sizeChangeHandle(val) { @@ -460,6 +479,51 @@ export default { const { data } = await searchOutboundNotificationReport(params); return (data && data.page && data.page.list) || []; }, + // 获取汇总数据(当前条件下全量) + async loadSummaryData() { + const params = { + ...this.searchData, + page: 1, + limit: -1 + }; + try { + const { data } = await searchOutboundNotificationReport(params); + if (data && data.code === 0) { + this.calculateSummary(data.page && data.page.list ? data.page.list : []); + } else { + this.resetSummaryData(); + } + } catch (err) { + console.error('查询汇总失败:', err); + this.resetSummaryData(); + } + }, + calculateSummary(list) { + const summary = list.reduce((acc, item) => { + acc.requiredQty += this.normalizeQty(item.requiredQty); + acc.actualOutQty += this.normalizeQty(item.actualOutQty); + return acc; + }, { + requiredQty: 0, + actualOutQty: 0 + }); + this.summaryData = summary; + }, + normalizeQty(value) { + const numberValue = Number(value); + return Number.isFinite(numberValue) ? numberValue : 0; + }, + formatSummaryQty(value) { + const numberValue = this.normalizeQty(value); + const fixedValue = numberValue.toFixed(6).replace(/\.?0+$/, ''); + return fixedValue || '0'; + }, + resetSummaryData() { + this.summaryData = { + requiredQty: 0, + actualOutQty: 0 + }; + }, startDownload() { this._exportLoading = this.$loading({ lock: true, @@ -636,6 +700,25 @@ export default { align-items: center; } +.action-right { + display: flex; + align-items: center; + gap: 18px; + margin-left: auto; + color: #606266; + font-size: 12px; +} + +.summary-item { + white-space: nowrap; +} + +.summary-value { + margin-left: 4px; + color: #303133; + font-weight: 600; +} + .search-actions .el-button { border-radius: 4px; padding: 5px 10px; @@ -738,5 +821,11 @@ export default { width: 100%; justify-content: center; } + + .action-right { + width: 100%; + justify-content: center; + margin-left: 0; + } }