代码提交
This commit is contained in:
parent
6be2ec8054
commit
b339f85451
|
@ -5,8 +5,10 @@ import java.util.Arrays;
|
|||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
@ -67,10 +69,15 @@ public class MesPlanRecordController extends BaseController {
|
|||
@SaCheckPermission("mts:planRecord:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<MesPlanRecordVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
@PathVariable Long id) {
|
||||
return R.ok(iMesPlanRecordService.queryById(id));
|
||||
}
|
||||
|
||||
@GetMapping("/queryByBo")
|
||||
public R<MesPlanRecordVo> queryByBo(MesPlanRecordBo bo) {
|
||||
return R.ok(iMesPlanRecordService.queryByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增生产计划明细日期记录
|
||||
*/
|
||||
|
|
|
@ -3,11 +3,13 @@ package com.ruoyi.mts.domain;
|
|||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
|
@ -22,7 +24,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
|
|||
@TableName("mes_plan_record")
|
||||
public class MesPlanRecord extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
|
@ -33,6 +35,10 @@ public class MesPlanRecord extends BaseEntity {
|
|||
* 任务id
|
||||
*/
|
||||
private Long detailId;
|
||||
/**
|
||||
* 记录日期
|
||||
*/
|
||||
private Date recordDate;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
|
|
|
@ -4,13 +4,16 @@ import com.ruoyi.common.core.validate.AddGroup;
|
|||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* 生产计划明细日期记录业务对象 mes_plan_record
|
||||
|
@ -26,37 +29,39 @@ public class MesPlanRecordBo extends BaseEntity {
|
|||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "主键不能为空", groups = { EditGroup.class })
|
||||
@NotNull(message = "主键不能为空", groups = {EditGroup.class})
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 任务id
|
||||
*/
|
||||
@NotNull(message = "任务id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
@NotNull(message = "任务id不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private Long detailId;
|
||||
|
||||
/**
|
||||
* 记录日期
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date recordDate;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@NotBlank(message = "备注不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@NotNull(message = "开始时间不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Date startDate;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@NotNull(message = "结束时间不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Date endDate;
|
||||
|
||||
/**
|
||||
* oss_id
|
||||
*/
|
||||
@NotNull(message = "oss_id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long ossId;
|
||||
|
||||
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
package com.ruoyi.mts.domain.vo;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.ruoyi.common.annotation.ExcelDictFormat;
|
||||
import com.ruoyi.common.convert.ExcelDictConvert;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
@ -35,6 +37,11 @@ public class MesPlanRecordVo implements Serializable {
|
|||
@ExcelProperty(value = "任务id")
|
||||
private Long detailId;
|
||||
|
||||
/**
|
||||
* 记录日期
|
||||
*/
|
||||
private Date recordDate;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
|
@ -58,6 +65,4 @@ public class MesPlanRecordVo implements Serializable {
|
|||
*/
|
||||
@ExcelProperty(value = "oss_id")
|
||||
private Long ossId;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.ruoyi.mts.mapper;
|
|||
import com.ruoyi.mts.domain.MesPlanRecord;
|
||||
import com.ruoyi.mts.domain.vo.MesPlanRecordVo;
|
||||
import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 生产计划明细日期记录Mapper接口
|
||||
|
@ -10,6 +11,7 @@ import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
|||
* @author jiangzhe
|
||||
* @date 2024-02-20
|
||||
*/
|
||||
@Mapper
|
||||
public interface MesPlanRecordMapper extends BaseMapperPlus<MesPlanRecordMapper, MesPlanRecord, MesPlanRecordVo> {
|
||||
|
||||
}
|
||||
|
|
|
@ -22,6 +22,8 @@ public interface IMesPlanRecordService {
|
|||
*/
|
||||
MesPlanRecordVo queryById(Long id);
|
||||
|
||||
MesPlanRecordVo queryByBo(MesPlanRecordBo bo);
|
||||
|
||||
/**
|
||||
* 查询生产计划明细日期记录列表
|
||||
*/
|
||||
|
|
|
@ -35,10 +35,18 @@ public class MesPlanRecordServiceImpl implements IMesPlanRecordService {
|
|||
* 查询生产计划明细日期记录
|
||||
*/
|
||||
@Override
|
||||
public MesPlanRecordVo queryById(Long id){
|
||||
public MesPlanRecordVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MesPlanRecordVo queryByBo(MesPlanRecordBo bo) {
|
||||
return baseMapper.selectVoOne(Wrappers.lambdaQuery(MesPlanRecord.class)
|
||||
.eq(MesPlanRecord::getDetailId, bo.getDetailId())
|
||||
.eq(MesPlanRecord::getRecordDate, bo.getRecordDate())
|
||||
.last("limit 1"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询生产计划明细日期记录列表
|
||||
*/
|
||||
|
@ -95,7 +103,7 @@ public class MesPlanRecordServiceImpl implements IMesPlanRecordService {
|
|||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(MesPlanRecord entity){
|
||||
private void validEntityBeforeSave(MesPlanRecord entity) {
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
|
@ -104,7 +112,7 @@ public class MesPlanRecordServiceImpl implements IMesPlanRecordService {
|
|||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
if (isValid) {
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
|
|
|
@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<resultMap type="com.ruoyi.mts.domain.MesPlanRecord" id="MesPlanRecordResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="detailId" column="detail_id"/>
|
||||
<result property="recordDate" column="record_date"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="startDate" column="start_date"/>
|
||||
<result property="endDate" column="end_date"/>
|
||||
|
|
|
@ -1,19 +1,8 @@
|
|||
<template>
|
||||
<div class="upload-file">
|
||||
<el-upload
|
||||
multiple
|
||||
:action="uploadFileUrl"
|
||||
:before-upload="handleBeforeUpload"
|
||||
:file-list="fileList"
|
||||
:limit="limit"
|
||||
:on-error="handleUploadError"
|
||||
:on-exceed="handleExceed"
|
||||
:on-success="handleUploadSuccess"
|
||||
:show-file-list="false"
|
||||
:headers="headers"
|
||||
class="upload-file-uploader"
|
||||
ref="fileUpload"
|
||||
>
|
||||
<el-upload multiple :action="uploadFileUrl" :before-upload="handleBeforeUpload" :file-list="fileList" :limit="limit"
|
||||
:on-error="handleUploadError" :on-exceed="handleExceed" :on-success="handleUploadSuccess" :show-file-list="false"
|
||||
:headers="headers" class="upload-file-uploader" ref="fileUpload">
|
||||
<!-- 上传按钮 -->
|
||||
<el-button type="primary">选取文件</el-button>
|
||||
</el-upload>
|
||||
|
@ -21,6 +10,7 @@
|
|||
<div class="el-upload__tip" v-if="showTip">
|
||||
请上传
|
||||
<template v-if="fileSize"> 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b> </template>
|
||||
<br>
|
||||
<template v-if="fileType"> 格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b> </template>
|
||||
的文件
|
||||
</div>
|
||||
|
@ -57,7 +47,7 @@ const props = defineProps({
|
|||
// 文件类型, 例如['png', 'jpg', 'jpeg']
|
||||
fileType: {
|
||||
type: Array,
|
||||
default: () => ["doc", "xls", "ppt", "txt", "pdf"],
|
||||
default: () => ["doc", "docx", "xls", "xlsx", "ppt", "pptx", "txt", "pdf", 'png', 'jpg', 'jpeg'],
|
||||
},
|
||||
// 是否显示提示
|
||||
isShowTip: {
|
||||
|
@ -95,7 +85,7 @@ watch(() => props.modelValue, async val => {
|
|||
}
|
||||
// 然后将数组转为对象数组
|
||||
fileList.value = list.map(item => {
|
||||
item = {name: item.name, url: item.url, ossId: item.ossId};
|
||||
item = { name: item.name, url: item.url, ossId: item.ossId };
|
||||
item.uid = item.uid || new Date().getTime() + temp++;
|
||||
return item;
|
||||
});
|
||||
|
@ -103,7 +93,7 @@ watch(() => props.modelValue, async val => {
|
|||
fileList.value = [];
|
||||
return [];
|
||||
}
|
||||
},{ deep: true, immediate: true });
|
||||
}, { deep: true, immediate: true });
|
||||
|
||||
// 上传前校检格式和大小
|
||||
function handleBeforeUpload(file) {
|
||||
|
@ -188,7 +178,7 @@ function listToString(list, separator) {
|
|||
let strs = "";
|
||||
separator = separator || ",";
|
||||
for (let i in list) {
|
||||
if(list[i].ossId) {
|
||||
if (list[i].ossId) {
|
||||
strs += list[i].ossId + separator;
|
||||
}
|
||||
}
|
||||
|
@ -200,18 +190,21 @@ function listToString(list, separator) {
|
|||
.upload-file-uploader {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.upload-file-list .el-upload-list__item {
|
||||
border: 1px solid #e4e7ed;
|
||||
line-height: 2;
|
||||
margin-bottom: 10px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.upload-file-list .ele-upload-list__item-content {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.ele-upload-list__item-content-action .el-link {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
|
|
@ -24,14 +24,15 @@
|
|||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['mts:planDetail:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button type="info" plain icon="Sort" @click="toggleExpandAll">展开/折叠</el-button>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-if="refreshTable" v-loading="loading" :data="planDetailList" row-key="id" height="800"
|
||||
:default-expand-all="isExpandAll" :span-method="objectSpanMethod" :cell-style="handleChangeCellStyle" border>
|
||||
<el-table v-if="refreshTable" v-loading="loading" :data="planDetailList" :row-key="(row, index) => row.id + index"
|
||||
height="800" :default-expand-all="isExpandAll" :span-method="objectSpanMethod" :cell-style="handleChangeCellStyle"
|
||||
border>
|
||||
<el-table-column fixed="left" label="名称" align="left" prop="name" width="180">
|
||||
<!-- <template #default="scope">
|
||||
<span v-html="handleName(scope.row)"></span>
|
||||
|
@ -54,6 +55,8 @@
|
|||
</router-link>
|
||||
</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="handleUpdate(scope.row)">修改</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
|
@ -76,7 +79,7 @@
|
|||
</el-table-column> -->
|
||||
<el-table-column v-for="item in dateColumns" :label="item.label" align="left" :prop="item.prop" width="110">
|
||||
<template #default="scope">
|
||||
<el-button link @click="handleDate(scope.row)" style="opacity: 0;">{{ item.label }}</el-button>
|
||||
<el-button link @click="handleDate(scope.column, scope.row)" style="opacity: 0;">{{ item.label }}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column fixed="right" label="操作" align="center" class-name="small-padding fixed-width" width="210">
|
||||
|
@ -134,19 +137,19 @@
|
|||
<el-dialog title="任务备注" v-model="openDate" width="550px" append-to-body>
|
||||
<el-form ref="openDateRef" :model="formDate" label-width="90px">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="formDate.remark" placeholder="请输入备注" />
|
||||
<el-input v-model="formDate.remark" placeholder="请输入备注" autosize type="textarea" />
|
||||
</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"
|
||||
placeholder="请选择开始时间">
|
||||
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"
|
||||
placeholder="请选择结束时间">
|
||||
style="width: 100%;" placeholder="请选择结束时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="oss_id" prop="ossId">
|
||||
<el-form-item label="附件" prop="ossId">
|
||||
<file-upload v-model="formDate.ossId" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
@ -166,6 +169,7 @@ import { useRoute } from 'vue-router'
|
|||
import dayjs from 'dayjs'
|
||||
import { listPlanDetail, getPlanDetail, delPlanDetail, addPlanDetail, updatePlanDetail } from "@/api/mts/planDetail";
|
||||
import { getPlanMain } from "@/api/mts/planMain";
|
||||
import { queryByBo } from "@/api/mts/planrecord";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const route = useRoute();
|
||||
|
@ -362,9 +366,11 @@ function resetQuery() {
|
|||
const openDate = ref(false)
|
||||
const openDateRef = ref(null)
|
||||
const formDate = ref({})
|
||||
function handleDate(row) {
|
||||
console.log('handleDate', row)
|
||||
async function handleDate(column, row) {
|
||||
const res = await queryByBo({recordDate: column.label, detailId: row.id})
|
||||
console.log('res', res)
|
||||
openDate.value = true
|
||||
formDate.value = res.data
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
|
|
Loading…
Reference in New Issue