From 2edd25b3963c7c41b575e507ed25ea5cbc3ccb45 Mon Sep 17 00:00:00 2001 From: qiuyt Date: Wed, 19 Mar 2025 17:11:02 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=8D=95=E6=8D=AE=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E9=80=BB=E8=BE=91=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/collect/CollectOrderStatsNew.vue | 33 ++++++++++++++++------ 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/src/views/collect/CollectOrderStatsNew.vue b/src/views/collect/CollectOrderStatsNew.vue index 020d5496..4ba18658 100644 --- a/src/views/collect/CollectOrderStatsNew.vue +++ b/src/views/collect/CollectOrderStatsNew.vue @@ -364,7 +364,13 @@ export default { } uploadCount(this.filterQuery).then(res => { console.log('res111',res) - + // 显示加载状态 + const loading = this.$loading({ + lock: true, + text: '正在统计请稍等...', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }); if (res.code === 20000) { // this.loading = false // this.list = res.data || [] @@ -391,21 +397,20 @@ export default { } this.initStatsChart1(); - this.initStatsChart2(); + // this.initStatsChart2(); this.initStatsChart3(); + loading.close(); }else { // this.loading = false this.$message.error(res.message); - + loading.close(); } // this.total = res.data.total || 0 // this.panelALive = false }).catch(() => { - // this.loading = false - // this.list = [] - // this.total = 0 + loading.close(); }) }, linkPage(path) { @@ -607,9 +612,9 @@ export default { // 模拟数据,可根据实际情况修改 var data = [ { name: '销售退货', uploaded: this.stats.salesScanCountReturn, total: this.stats.salesScanSumCountReturn }, - { name: '销售出库', uploaded: this.stats.salesScanSumCount, total: this.stats.salesScanSumCount }, - { name: '采购退货', uploaded: this.stats.buyerScanSumCountReturn, total: this.stats.buyerScanSumCountReturn }, - { name: '采购入库', uploaded: this.stats.buyerScanSumCount, total: this.stats.buyerScanSumCount }, + { name: '销售出库', uploaded: this.stats.salesScanCount, total: this.stats.salesScanSumCount }, + { name: '采购退货', uploaded: this.stats.buyerScanCountReturn, total: this.stats.buyerScanSumCountReturn }, + { name: '采购入库', uploaded: this.stats.buyerScanCount, total: this.stats.buyerScanSumCount }, ]; // 处理 y 轴数据 @@ -646,6 +651,16 @@ export default { fontWeight: 'bold' // 字体设置为粗体 } }, + tooltip: { + trigger: 'item', + formatter: function (params) { + var index = Math.floor(params.dataIndex / 2); + var item = data[index]; + var isUploaded = params.dataIndex % 2!== 0; + var count = isUploaded? item.uploaded : (item.total - item.uploaded); + return `${params.name}: ${count}`; + } + }, grid: { left: '15%', top: '5%', // 减小顶部空白区域,可根据需求调整