diff --git a/src/components/WmsTable/index.vue b/src/components/WmsTable/index.vue new file mode 100644 index 0000000..eabb829 --- /dev/null +++ b/src/components/WmsTable/index.vue @@ -0,0 +1,233 @@ + + + + + diff --git a/src/views/plan/EnamellingMachineStatus.vue b/src/views/plan/EnamellingMachineStatus.vue index e0c7cd9..969809c 100644 --- a/src/views/plan/EnamellingMachineStatus.vue +++ b/src/views/plan/EnamellingMachineStatus.vue @@ -185,54 +185,14 @@ destroy-on-close @close="closeChart" > -
- - - - - - - - - - - - - - - - - +
时间范围: @@ -260,6 +220,14 @@

销售历史 - {{ salesChartTitle }}

关闭
+
时间范围: @@ -288,6 +256,7 @@ import { ref, computed, onMounted, nextTick, watch } from 'vue' import { API_CONFIG } from "@/config/api" import { getDateRangeByTimeRange } from '@/utils/dateFormat'; import * as echarts from 'echarts'; +import WmsTable from '@/components/WmsTable/index.vue' // 接收从父组件传递的数据 const props = defineProps({ @@ -323,6 +292,8 @@ const salesChartTitle = ref('') const currentSalesAxle = ref(null) const salesChartRef = ref(null) const salesChartDialogRef = ref(null) +const wmsTableRef = ref(null) +const wmsTableDialogRef = ref(null) let salesChart = null // 销售图表相关状态 @@ -556,7 +527,7 @@ const onCompletionLevelChange = () => { }; // 方法:显示销售历史图表 -const showSalesHistory = (row) => { +const showSalesHistory = async (row) => { if (!row.update_time || !row.model || !row.specification) { console.error('缺少必要的数据参数'); return; @@ -579,7 +550,13 @@ const showSalesHistory = (row) => { fetchSalesData(row.model, row.specification); fetchHistoryData(row.model, row.specification, row.wire_disc); - fetchWmsData(row.model, row.specification); + + await nextTick() + if (selectedEquipment.value === 'all' && wmsTableDialogRef.value) { + wmsTableDialogRef.value.fetchData() + } else if (showChart.value && wmsTableRef.value) { + wmsTableRef.value.fetchData() + } }; // 方法:关闭图表 @@ -592,6 +569,12 @@ const closeChart = () => { } }; +// WmsTable组件数据加载完成回调 +const onWmsDataLoaded = (loadedData) => { + wmsData.value = loadedData + recordWmsOriginalData() +}; + // 方法:图表时间范围变化 const onChartTimeRangeChange = () => { if (currentSalesAxle.value) {