From d9cebcecd8b093f31595e2dedf9d8b23cbab31ca Mon Sep 17 00:00:00 2001 From: huangjinysf Date: Mon, 29 Dec 2025 15:44:00 +0800 Subject: [PATCH] =?UTF-8?q?feat(EnamellingMachineStatus):=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0WMS=E6=95=B0=E6=8D=AE=E5=B1=95=E7=A4=BA=E8=A1=A8?= =?UTF-8?q?=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在图表弹窗中新增WMS数据表格展示,包含型号、规格、线盘等字段信息 --- src/views/plan/EnamellingMachineStatus.vue | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/src/views/plan/EnamellingMachineStatus.vue b/src/views/plan/EnamellingMachineStatus.vue index 9c81685..9d7f155 100644 --- a/src/views/plan/EnamellingMachineStatus.vue +++ b/src/views/plan/EnamellingMachineStatus.vue @@ -185,6 +185,23 @@ destroy-on-close @close="closeChart" > +
+ + + + + + + + +
时间范围: @@ -261,6 +278,8 @@ const selectedCompletionLevel = ref('all') // 默认显示全部 const salesChartLoading = ref(false) const historyChartLoading = ref(false) +const wmsData = ref([]) +const wmsDataLoading = ref(false) const salesData = ref([]) const historyData = ref([]) const hasSalesData = ref(false) @@ -521,11 +540,13 @@ const showSalesHistory = (row) => { salesData.value = []; historyData.value = []; + wmsData.value = []; hasSalesData.value = false; hasHistoryData.value = false; fetchSalesData(row.model, row.specification); fetchHistoryData(row.model, row.specification, row.wire_disc); + fetchWmsData(row.model, row.specification); }; // 方法:关闭图表 @@ -635,6 +656,34 @@ const fetchHistoryData = (model, specification, wireDisc) => { }); }; +// 获取WMS数据 +const fetchWmsData = (model, specification) => { + wmsDataLoading.value = true; + + const apiUrl = `${API_CONFIG.BASE_URL}/api/wms/records/model-spec?model=${model}&specification=${specification}`; + console.log('WMS API URL:', apiUrl); + + fetch(apiUrl) + .then(response => response.json()) + .then(data => { + console.log('WMS API Response:', data); + if (data.code === 200 && data.data && data.data.records) { + wmsData.value = data.data.records; + console.log('WMS Data:', wmsData.value); + } else { + wmsData.value = []; + console.log('WMS data is empty or error'); + } + }) + .catch(error => { + console.error('WMS数据API调用失败:', error); + wmsData.value = []; + }) + .finally(() => { + wmsDataLoading.value = false; + }); +}; + // 初始化销售图表 const initSalesChart = (retryCount = 0) => { if (!hasSalesData.value && !hasHistoryData.value) {