代码提交

This commit is contained in:
userName 2024-02-22 10:52:07 +08:00
parent e975f49b6e
commit fe14279ce9
3 changed files with 81 additions and 23 deletions

View File

@ -1,5 +1,7 @@
package com.ruoyi.mts.domain.bo; package com.ruoyi.mts.domain.bo;
import cn.hutool.core.date.DatePattern;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.BaseEntity; import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.common.core.validate.AddGroup; import com.ruoyi.common.core.validate.AddGroup;
import com.ruoyi.common.core.validate.EditGroup; import com.ruoyi.common.core.validate.EditGroup;
@ -37,7 +39,8 @@ public class MesPlanRecordBo extends BaseEntity {
/** /**
* 记录日期 * 记录日期
*/ */
@DateTimeFormat(pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = DatePattern.NORM_DATE_PATTERN)
@JsonFormat(pattern = DatePattern.NORM_DATE_PATTERN)
private Date recordDate; private Date recordDate;
/** /**
@ -46,7 +49,7 @@ public class MesPlanRecordBo extends BaseEntity {
private String remark; private String remark;
private String ganttColor; private String ganttColor;
private String flag; private String flag;
/** /**
* oss_id * oss_id

View File

@ -1,7 +1,9 @@
package com.ruoyi.mts.domain.vo; package com.ruoyi.mts.domain.vo;
import cn.hutool.core.date.DatePattern;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
@ -34,6 +36,7 @@ public class MesPlanRecordVo implements Serializable {
/** /**
* 记录日期 * 记录日期
*/ */
@JsonFormat(pattern = DatePattern.NORM_DATE_PATTERN)
private Date recordDate; private Date recordDate;
/** /**

View File

@ -55,8 +55,8 @@
</router-link> </router-link>
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item @click="handleDate(scope.row)">任务备注</el-dropdown-item> <el-dropdown-item @click="handleDate(scope.row)">任务备注</el-dropdown-item>
<el-dropdown-item @click="handleAdd(scope.row)">新增</el-dropdown-item> <el-dropdown-item @click="handleAdd(scope.row)" v-if="scope.row.parentId == 0">新增</el-dropdown-item>
<el-dropdown-item @click="handleUpdate(scope.row)">修改</el-dropdown-item> <!-- <el-dropdown-item @click="handleUpdate(scope.row)">修改</el-dropdown-item> -->
</el-dropdown-menu> </el-dropdown-menu>
</template> </template>
</el-dropdown> </el-dropdown>
@ -134,29 +134,24 @@
</template> </template>
</el-dialog> </el-dialog>
<!-- 点击日期对话框 --> <!-- 点击日期对话框 -->
<el-dialog title="任务备注" v-model="openDate" width="550px" append-to-body> <el-dialog title="任务备注" v-model="openDate" width="550px" append-to-body :before-close="cancelDate">
<el-form ref="openDateRef" :model="formDate" label-width="90px"> <el-form ref="planRecordRef" :model="formDate" label-width="90px">
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input v-model="formDate.remark" placeholder="请输入备注" autosize type="textarea" /> <el-input v-model="formDate.remark" placeholder="请输入备注" autosize type="textarea" />
</el-form-item> </el-form-item>
<el-form-item label="开始时间" prop="startDate">
<el-date-picker clearable v-model="formDate.startDate" type="datetime" value-format="YYYY-MM-DD HH:mm:ss"
style="width: 100%;" placeholder="请选择开始时间">
</el-date-picker>
</el-form-item>
<el-form-item label="结束时间" prop="endDate">
<el-date-picker clearable v-model="formDate.endDate" type="datetime" value-format="YYYY-MM-DD HH:mm:ss"
style="width: 100%;" placeholder="请选择结束时间">
</el-date-picker>
</el-form-item>
<el-form-item label="附件" prop="ossId"> <el-form-item label="附件" prop="ossId">
<file-upload v-model="formDate.ossId" /> <file-upload v-model="formDate.ossId" />
</el-form-item> </el-form-item>
<el-form-item label="甘特图颜色" prop="ganttColor">
<el-color-picker v-model="formDate.ganttColor" size="large" />
</el-form-item>
</el-form> </el-form>
<template #footer> <template #footer>
<div class="dialog-footer"> <div class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" @click="submitFormDate"> </el-button>
<el-button @click="cancel"> </el-button> <el-button @click="cancelDate"> </el-button>
</div> </div>
</template> </template>
</el-dialog> </el-dialog>
@ -170,6 +165,7 @@ import dayjs from 'dayjs'
import { listPlanDetail, getPlanDetail, delPlanDetail, addPlanDetail, updatePlanDetail } from "@/api/mts/planDetail"; import { listPlanDetail, getPlanDetail, delPlanDetail, addPlanDetail, updatePlanDetail } from "@/api/mts/planDetail";
import { getPlanMain } from "@/api/mts/planMain"; import { getPlanMain } from "@/api/mts/planMain";
import { queryByBo } from "@/api/mts/planrecord"; import { queryByBo } from "@/api/mts/planrecord";
import { addPlanRecord, updatePlanRecord } from "@/api/mts/planRecord";
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const route = useRoute(); const route = useRoute();
@ -251,7 +247,7 @@ function getDays(start, end) {
*/ */
function handleChangeCellStyle({ row, column, rowIndex, columnIndex }) { function handleChangeCellStyle({ row, column, rowIndex, columnIndex }) {
// //
const planDates = getDays(row.planStartDate, row.planEndDate) const planDates = row.record.map(v => v.recordDate)
let arr = planDates.filter(v => allDates.indexOf(v) > -1) let arr = planDates.filter(v => allDates.indexOf(v) > -1)
let cellStyle = {} //column.label == dayjs(row.planStartDate).format('YYYY-MM-DD') let cellStyle = {} //column.label == dayjs(row.planStartDate).format('YYYY-MM-DD')
@ -279,7 +275,7 @@ const nbsp = "&nbsp;&nbsp;&nbsp;&nbsp;"
function handleName(row) { function handleName(row) {
let res = '' let res = ''
if (row.parentId != 0) { if (row.parentId != 0) {
res = res + nbsp res = res + nbsp
} }
return res return res
} }
@ -361,13 +357,69 @@ function resetQuery() {
} }
const openDate = ref(false) const openDate = ref(false)
const openDateRef = ref(null)
const formDate = ref({}) const formDate = ref({})
async function handleDate(column, row) { async function handleDate(column, row) {
const res = await queryByBo({recordDate: column.label, detailId: row.id}) console.log('handleDate', column.label, row.id)
const res = await queryByBo({ recordDate: column.label, detailId: row.id })
console.log('res', res) console.log('res', res)
openDate.value = true openDate.value = true
formDate.value = res.data if (res.data) {
formDate.value = res.data
}
formDate.value.flag = row.flag
formDate.value.recordDate = column.label
formDate.value.detailId = row.id
}
function submitFormDate() {
proxy.$refs["planRecordRef"].validate(valid => {
if (valid) {
buttonLoading.value = true;
if (formDate.value.id != null) {
updatePlanRecord(formDate.value).then(response => {
proxy.$modal.msgSuccess("修改成功");
openDate.value = false;
getList();
}).finally(() => {
buttonLoading.value = false;
});
} else {
addPlanRecord(formDate.value).then(response => {
proxy.$modal.msgSuccess("新增成功");
openDate.value = false;
getList();
}).finally(() => {
buttonLoading.value = false;
});
}
}
});
}
//
function cancelDate() {
openDate.value = false;
resetDate();
}
//
function resetDate() {
formDate.value = {
id: null,
detailId: null,
recordDate: null,
startDate: null,
remark: null,
flag: null,
ganttColor: null,
ossId: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
delFlag: null
};
proxy.resetForm("planRecordRef");
} }
/** 新增按钮操作 */ /** 新增按钮操作 */