From 1c759f0b22e932f6d6c70e77f3d09842d9a78b36 Mon Sep 17 00:00:00 2001 From: huangjinysf Date: Sat, 27 Dec 2025 05:02:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=B2=E5=AE=8C=E6=88=90=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=8C=E7=8E=B0=E5=9C=A8=E7=82=B9=E5=87=BB"=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B"=E6=8C=89=E9=92=AE=E6=97=B6=EF=BC=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 如果机台筛选为"全部机台",图表将在对话框中显示 - 如果筛选为特定机台,图表将在表格下方显示 修改内容总结: 1. 新增状态变量 : - showChartDialog - 控制对话框显示 - salesChartDialogRef - 对话框图表的 ref 2. 修改 showSalesHistory 函数 : EnamellingMachineStatus.vue:484-493 - 根据 selectedEquipment 判断显示位置 3. 新增对话框组件 : EnamellingMachineStatus.vue:181-210 - 使用 el-dialog 组件,包含完整的图表控制元素 4. 更新 initSalesChart 函数 : EnamellingMachineStatus.vue:645-662 - 根据显示位置选择正确的图表 ref --- src/views/plan/EnamellingMachineStatus.vue | 53 +++++++++++++++++++--- 1 file changed, 47 insertions(+), 6 deletions(-) diff --git a/src/views/plan/EnamellingMachineStatus.vue b/src/views/plan/EnamellingMachineStatus.vue index d96b988..9c81685 100644 --- a/src/views/plan/EnamellingMachineStatus.vue +++ b/src/views/plan/EnamellingMachineStatus.vue @@ -177,7 +177,36 @@ - + + +
+ 时间范围: + + + + + + + 显示单位: + + 箱数 + 重量 + +
+
+
+ 暂无销售和库存数据 +
+
+
+ +

销售历史 - {{ salesChartTitle }}

@@ -230,8 +259,6 @@ const selectedEquipment = ref('all') // 完成度筛选相关状态 const selectedCompletionLevel = ref('all') // 默认显示全部 -// 销售图表相关状态 -const showChart = ref(false) const salesChartLoading = ref(false) const historyChartLoading = ref(false) const salesData = ref([]) @@ -243,8 +270,13 @@ const chartUnit = ref('box') const salesChartTitle = ref('') const currentSalesAxle = ref(null) const salesChartRef = ref(null) +const salesChartDialogRef = ref(null) let salesChart = null +// 销售图表相关状态 +const showChart = ref(false) +const showChartDialog = ref(false) + // 当组件加载时,使用父组件传递的数据 equipmentData.value = props.equipmentData @@ -480,7 +512,12 @@ const showSalesHistory = (row) => { currentSalesAxle.value = { ...row }; salesChartTitle.value = `${row.equipment_code} - ${row.axle_number} - ${row.specification} - ${row.model}`; - showChart.value = true; + + if (selectedEquipment.value === 'all') { + showChartDialog.value = true; + } else { + showChart.value = true; + } salesData.value = []; historyData.value = []; @@ -494,6 +531,7 @@ const showSalesHistory = (row) => { // 方法:关闭图表 const closeChart = () => { showChart.value = false; + showChartDialog.value = false; if (salesChart) { salesChart.dispose(); salesChart = null; @@ -603,7 +641,10 @@ const initSalesChart = (retryCount = 0) => { return; } - if (!salesChartRef.value) { + const isDialog = showChartDialog.value; + const chartRef = isDialog ? salesChartDialogRef.value : salesChartRef.value; + + if (!chartRef) { if (retryCount >= 20) { return; } @@ -617,7 +658,7 @@ const initSalesChart = (retryCount = 0) => { salesChart.dispose(); } - salesChart = echarts.init(salesChartRef.value); + salesChart = echarts.init(chartRef); const salesDateMap = new Map(); const historyDateMap = new Map();