From f1dbf12b968625532664ac9988d14e25493c2235 Mon Sep 17 00:00:00 2001 From: userName <244140623@qq.com> Date: Fri, 23 Feb 2024 16:45:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mts/domain/vo/MesPlanRecordHistoryVo.java | 3 +++ .../impl/MesPlanRecordHistoryServiceImpl.java | 1 - ruoyi-ui-vue3/src/views/mts/planBom/index.vue | 2 +- .../src/views/mts/planDetail/index.vue | 25 ++++++++++++------- 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/ruoyi-demo/src/main/java/com/ruoyi/mts/domain/vo/MesPlanRecordHistoryVo.java b/ruoyi-demo/src/main/java/com/ruoyi/mts/domain/vo/MesPlanRecordHistoryVo.java index 125b210..693455f 100644 --- a/ruoyi-demo/src/main/java/com/ruoyi/mts/domain/vo/MesPlanRecordHistoryVo.java +++ b/ruoyi-demo/src/main/java/com/ruoyi/mts/domain/vo/MesPlanRecordHistoryVo.java @@ -1,7 +1,9 @@ package com.ruoyi.mts.domain.vo; +import cn.hutool.core.date.DatePattern; import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; import com.alibaba.excel.annotation.ExcelProperty; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.io.Serializable; @@ -49,5 +51,6 @@ public class MesPlanRecordHistoryVo implements Serializable { @ExcelProperty(value = "oss_id") private Long ossId; + @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN) private Date createTime; } diff --git a/ruoyi-demo/src/main/java/com/ruoyi/mts/service/impl/MesPlanRecordHistoryServiceImpl.java b/ruoyi-demo/src/main/java/com/ruoyi/mts/service/impl/MesPlanRecordHistoryServiceImpl.java index 8d5c718..c3650df 100644 --- a/ruoyi-demo/src/main/java/com/ruoyi/mts/service/impl/MesPlanRecordHistoryServiceImpl.java +++ b/ruoyi-demo/src/main/java/com/ruoyi/mts/service/impl/MesPlanRecordHistoryServiceImpl.java @@ -57,7 +57,6 @@ public class MesPlanRecordHistoryServiceImpl implements IMesPlanRecordHistorySer } private LambdaQueryWrapper buildQueryWrapper(MesPlanRecordHistoryBo bo) { - Map params = bo.getParams(); LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); lqw.eq(bo.getRecordId() != null, MesPlanRecordHistory::getRecordId, bo.getRecordId()); lqw.orderByDesc(MesPlanRecordHistory::getCreateTime); diff --git a/ruoyi-ui-vue3/src/views/mts/planBom/index.vue b/ruoyi-ui-vue3/src/views/mts/planBom/index.vue index 9fafb7f..6a9a6d7 100644 --- a/ruoyi-ui-vue3/src/views/mts/planBom/index.vue +++ b/ruoyi-ui-vue3/src/views/mts/planBom/index.vue @@ -143,7 +143,7 @@ const buttonLoading = ref(false); const loading = ref(true); const showSearch = ref(true); const title = ref(""); -const isExpandAll = ref(true); +const isExpandAll = ref(false); const refreshTable = ref(true); const data = reactive({ diff --git a/ruoyi-ui-vue3/src/views/mts/planDetail/index.vue b/ruoyi-ui-vue3/src/views/mts/planDetail/index.vue index 719e10b..b7c5ea3 100644 --- a/ruoyi-ui-vue3/src/views/mts/planDetail/index.vue +++ b/ruoyi-ui-vue3/src/views/mts/planDetail/index.vue @@ -31,7 +31,7 @@ + placement="bottom" title="修改历史留痕" :width="400" trigger="hover"> @@ -271,12 +276,14 @@ function getDays(start, end) { */ function handleChangeCellStyle({ row, column, rowIndex, columnIndex }) { let cellStyle = {} - - for (const item of row.record) { - if (item.recordDate == column.label) { - cellStyle.backgroundColor = item.ganttColor + if (row.record) { + for (const item of row.record) { + if (item.recordDate == column.label) { + cellStyle.backgroundColor = item.ganttColor + } } } + // 获取两个日期之间的所有日期 //column.label == dayjs(row.planStartDate).format('YYYY-MM-DD') // const planDates = row.record.map(v => v.recordDate) @@ -315,7 +322,7 @@ function handleDateColumn(row, column) { } function handleHisShow(row, column) { - if (row.record.length > 0) { + if (row.record && row.record.length > 0) { for (const item of row.record) { if (item.recordDate == column.label) { return true @@ -328,7 +335,7 @@ function handleHisShow(row, column) { const hisRecord = ref([]) async function handleHistory(row, column) { let res = [] - if (row.record.length > 0) { + if (row.record && row.record.length > 0) { for (const item of row.record) { if (item.recordDate == column.label) { const hisList = await listPlanRecordHistory({ recordId: item.id })