From 9ccc2eaa07f56c8d3fbc0fce675e2c233cb980b1 Mon Sep 17 00:00:00 2001 From: 17630416519 Date: Fri, 30 Jan 2026 17:41:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=BF=AE=E6=94=B9=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../productionProcessParameterQuery/index.vue | 72 +++++++++++++++---- 1 file changed, 58 insertions(+), 14 deletions(-) diff --git a/src/views/productionProcessParameterQuery/index.vue b/src/views/productionProcessParameterQuery/index.vue index 8fab714..a6aa24b 100644 --- a/src/views/productionProcessParameterQuery/index.vue +++ b/src/views/productionProcessParameterQuery/index.vue @@ -1,6 +1,22 @@ --> - + - + @@ -140,11 +158,11 @@ - + @@ -158,7 +176,7 @@ - + @@ -682,11 +700,20 @@ import { listPlcProductionData, updatePlcProductionData,getPlcProductionData, } from '@/api/mes/plcproductiondata.js' +import { start } from 'nprogress'; const { proxy } = getCurrentInstance() const ids = ref([]) const loading = ref(false) const showSearch = ref(true) +function getCurrentDate() { + const now = new Date(); + const year = now.getFullYear(); + const month = String(now.getMonth() + 1).padStart(2, '0'); + const day = String(now.getDate()).padStart(2, '0'); + return new Date(`${year}-${month}-${day}`); +} const queryParams = reactive({ + timeRange: [getCurrentDate(), getCurrentDate()], pageNum: 1, pageSize: 10, sort: '', @@ -790,10 +817,28 @@ const defaultTime = ref([new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, var dictParams = [ ] +function getList() { + const formatDateTime = (date) => { + if (!date) return ''; + const d = new Date(date); + const year = d.getFullYear(); + const month = String(d.getMonth() + 1).padStart(2, '0'); + const day = String(d.getDate()).padStart(2, '0'); + + return `${year}-${month}-${day}`; + }; -function getList(){ - loading.value = true - listPlcProductionData(queryParams).then(res => { + let params = { + ...queryParams, + startTime: queryParams.timeRange && queryParams.timeRange[0] ? formatDateTime(queryParams.timeRange[0]) : '', + endTime: queryParams.timeRange && queryParams.timeRange[1] ? formatDateTime(queryParams.timeRange[1]) : '' + }; + + delete params.timeRange; + + loading.value = true, + + listPlcProductionData(params).then(res => { const { code, data } = res if (code == 200) { dataList.value = data.result @@ -802,7 +847,6 @@ function getList(){ } }) } - // 查询 function handleQuery() { queryParams.pageNum = 1