代码提交
This commit is contained in:
parent
97ba82f7bd
commit
e1b6e08dd8
|
@ -0,0 +1,108 @@
|
|||
package com.ruoyi.mts.controller;
|
||||
|
||||
import java.util.List;
|
||||
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;
|
||||
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.validate.AddGroup;
|
||||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
import com.ruoyi.common.core.validate.QueryGroup;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.mts.domain.vo.MesPlanRecordVo;
|
||||
import com.ruoyi.mts.domain.bo.MesPlanRecordBo;
|
||||
import com.ruoyi.mts.service.IMesPlanRecordService;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 生产计划明细日期记录
|
||||
*
|
||||
* @author jiangzhe
|
||||
* @date 2024-02-20
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/mts/planRecord")
|
||||
public class MesPlanRecordController extends BaseController {
|
||||
|
||||
private final IMesPlanRecordService iMesPlanRecordService;
|
||||
|
||||
/**
|
||||
* 查询生产计划明细日期记录列表
|
||||
*/
|
||||
@SaCheckPermission("mts:planRecord:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<MesPlanRecordVo> list(MesPlanRecordBo bo, PageQuery pageQuery) {
|
||||
return iMesPlanRecordService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出生产计划明细日期记录列表
|
||||
*/
|
||||
@SaCheckPermission("mts:planRecord:export")
|
||||
@Log(title = "生产计划明细日期记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(MesPlanRecordBo bo, HttpServletResponse response) {
|
||||
List<MesPlanRecordVo> list = iMesPlanRecordService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "生产计划明细日期记录", MesPlanRecordVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取生产计划明细日期记录详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("mts:planRecord:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<MesPlanRecordVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(iMesPlanRecordService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增生产计划明细日期记录
|
||||
*/
|
||||
@SaCheckPermission("mts:planRecord:add")
|
||||
@Log(title = "生产计划明细日期记录", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody MesPlanRecordBo bo) {
|
||||
return toAjax(iMesPlanRecordService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改生产计划明细日期记录
|
||||
*/
|
||||
@SaCheckPermission("mts:planRecord:edit")
|
||||
@Log(title = "生产计划明细日期记录", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody MesPlanRecordBo bo) {
|
||||
return toAjax(iMesPlanRecordService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除生产计划明细日期记录
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("mts:planRecord:remove")
|
||||
@Log(title = "生产计划明细日期记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(iMesPlanRecordService.deleteWithValidByIds(Arrays.asList(ids), true));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
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;
|
||||
|
||||
/**
|
||||
* 生产计划明细日期记录对象 mes_plan_record
|
||||
*
|
||||
* @author jiangzhe
|
||||
* @date 2024-02-20
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("mes_plan_record")
|
||||
public class MesPlanRecord extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
/**
|
||||
* 任务id
|
||||
*/
|
||||
private Long detailId;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private Date startDate;
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private Date endDate;
|
||||
/**
|
||||
* oss_id
|
||||
*/
|
||||
private Long ossId;
|
||||
/**
|
||||
* 删除标志(0存在,2删除)
|
||||
*/
|
||||
@TableLogic
|
||||
private String delFlag;
|
||||
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
package com.ruoyi.mts.domain.bo;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 生产计划明细日期记录业务对象 mes_plan_record
|
||||
*
|
||||
* @author jiangzhe
|
||||
* @date 2024-02-20
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class MesPlanRecordBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "主键不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 任务id
|
||||
*/
|
||||
@NotNull(message = "任务id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long detailId;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@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;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
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;
|
||||
|
||||
/**
|
||||
* 生产计划明细日期记录视图对象 mes_plan_record
|
||||
*
|
||||
* @author jiangzhe
|
||||
* @date 2024-02-20
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class MesPlanRecordVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ExcelProperty(value = "主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 任务id
|
||||
*/
|
||||
@ExcelProperty(value = "任务id")
|
||||
private Long detailId;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@ExcelProperty(value = "开始时间")
|
||||
private Date startDate;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@ExcelProperty(value = "结束时间")
|
||||
private Date endDate;
|
||||
|
||||
/**
|
||||
* oss_id
|
||||
*/
|
||||
@ExcelProperty(value = "oss_id")
|
||||
private Long ossId;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
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;
|
||||
|
||||
/**
|
||||
* 生产计划明细日期记录Mapper接口
|
||||
*
|
||||
* @author jiangzhe
|
||||
* @date 2024-02-20
|
||||
*/
|
||||
public interface MesPlanRecordMapper extends BaseMapperPlus<MesPlanRecordMapper, MesPlanRecord, MesPlanRecordVo> {
|
||||
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
package com.ruoyi.mts.service;
|
||||
|
||||
import com.ruoyi.mts.domain.MesPlanRecord;
|
||||
import com.ruoyi.mts.domain.vo.MesPlanRecordVo;
|
||||
import com.ruoyi.mts.domain.bo.MesPlanRecordBo;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 生产计划明细日期记录Service接口
|
||||
*
|
||||
* @author jiangzhe
|
||||
* @date 2024-02-20
|
||||
*/
|
||||
public interface IMesPlanRecordService {
|
||||
|
||||
/**
|
||||
* 查询生产计划明细日期记录
|
||||
*/
|
||||
MesPlanRecordVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询生产计划明细日期记录列表
|
||||
*/
|
||||
TableDataInfo<MesPlanRecordVo> queryPageList(MesPlanRecordBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询生产计划明细日期记录列表
|
||||
*/
|
||||
List<MesPlanRecordVo> queryList(MesPlanRecordBo bo);
|
||||
|
||||
/**
|
||||
* 新增生产计划明细日期记录
|
||||
*/
|
||||
Boolean insertByBo(MesPlanRecordBo bo);
|
||||
|
||||
/**
|
||||
* 修改生产计划明细日期记录
|
||||
*/
|
||||
Boolean updateByBo(MesPlanRecordBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除生产计划明细日期记录信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
|
@ -0,0 +1,112 @@
|
|||
package com.ruoyi.mts.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.mts.domain.bo.MesPlanRecordBo;
|
||||
import com.ruoyi.mts.domain.vo.MesPlanRecordVo;
|
||||
import com.ruoyi.mts.domain.MesPlanRecord;
|
||||
import com.ruoyi.mts.mapper.MesPlanRecordMapper;
|
||||
import com.ruoyi.mts.service.IMesPlanRecordService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 生产计划明细日期记录Service业务层处理
|
||||
*
|
||||
* @author jiangzhe
|
||||
* @date 2024-02-20
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class MesPlanRecordServiceImpl implements IMesPlanRecordService {
|
||||
|
||||
private final MesPlanRecordMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询生产计划明细日期记录
|
||||
*/
|
||||
@Override
|
||||
public MesPlanRecordVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询生产计划明细日期记录列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<MesPlanRecordVo> queryPageList(MesPlanRecordBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<MesPlanRecord> lqw = buildQueryWrapper(bo);
|
||||
Page<MesPlanRecordVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询生产计划明细日期记录列表
|
||||
*/
|
||||
@Override
|
||||
public List<MesPlanRecordVo> queryList(MesPlanRecordBo bo) {
|
||||
LambdaQueryWrapper<MesPlanRecord> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<MesPlanRecord> buildQueryWrapper(MesPlanRecordBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<MesPlanRecord> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getDetailId() != null, MesPlanRecord::getDetailId, bo.getDetailId());
|
||||
lqw.eq(bo.getStartDate() != null, MesPlanRecord::getStartDate, bo.getStartDate());
|
||||
lqw.eq(bo.getEndDate() != null, MesPlanRecord::getEndDate, bo.getEndDate());
|
||||
lqw.eq(bo.getOssId() != null, MesPlanRecord::getOssId, bo.getOssId());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增生产计划明细日期记录
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(MesPlanRecordBo bo) {
|
||||
MesPlanRecord add = BeanUtil.toBean(bo, MesPlanRecord.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改生产计划明细日期记录
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(MesPlanRecordBo bo) {
|
||||
MesPlanRecord update = BeanUtil.toBean(bo, MesPlanRecord.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(MesPlanRecord entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除生产计划明细日期记录
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.mts.mapper.MesPlanRecordMapper">
|
||||
|
||||
<resultMap type="com.ruoyi.mts.domain.MesPlanRecord" id="MesPlanRecordResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="detailId" column="detail_id"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="startDate" column="start_date"/>
|
||||
<result property="endDate" column="end_date"/>
|
||||
<result property="ossId" column="oss_id"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
|
@ -30,14 +30,29 @@
|
|||
<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"
|
||||
<el-table v-if="refreshTable" v-loading="loading" :data="planDetailList" row-key="id" height="700"
|
||||
:default-expand-all="isExpandAll" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
||||
:cell-style="handleChangeCellStyle">
|
||||
<el-table-column fixed="left" label="名称" align="left" prop="name" width="180">
|
||||
<template #default="scope">
|
||||
<router-link :to="'/mts/detail-bom/index/' + scope.row.id" class="link-type">
|
||||
<span>{{ scope.row.name }}</span>
|
||||
</router-link>
|
||||
<el-dropdown>
|
||||
<span class="el-dropdown-link">
|
||||
{{ scope.row.name }}
|
||||
<el-icon class="el-icon--right">
|
||||
<arrow-down />
|
||||
</el-icon>
|
||||
</span>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item>
|
||||
<router-link :to="'/mts/detail-bom/index/' + scope.row.id" class="link-type">
|
||||
<span>物料清单</span>
|
||||
</router-link>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click="handleDate(scope.row)">任务备注</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="计划时间" align="center" prop="planDate" width="180">
|
||||
|
@ -50,7 +65,10 @@
|
|||
<span>{{ parseTime(scope.row.actualDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column v-for="item in dateColumns" :label="item.label" align="left" :prop="item.prop" width="100">
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column fixed="right" label="操作" align="center" class-name="small-padding fixed-width" width="210">
|
||||
<template #default="scope">
|
||||
|
@ -95,8 +113,32 @@
|
|||
value-format="YYYY-MM-DD HH:mm:ss" placeholder="选择时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="甘特图颜色" prop="ganttColor">
|
||||
<el-color-picker v-model="form.ganttColor" size="large" />
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<!-- 点击日期对话框 -->
|
||||
<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-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="请选择开始时间">
|
||||
</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="请选择结束时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="oss_id" prop="ossId">
|
||||
<file-upload v-model="formDate.ossId" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
|
@ -163,16 +205,9 @@ const data = reactive({
|
|||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
|
||||
const dateColumns = ref([])
|
||||
const allDates = [];
|
||||
onMounted(() => {
|
||||
// 定义起始和结束日期
|
||||
const startDate = dayjs('2024-02-01');
|
||||
const endDate = dayjs('2024-02-25');
|
||||
// 获取并打印两个日期之间的所有日期
|
||||
|
||||
|
||||
for (const date of getDays('2024-02-01', '2024-02-25')) {
|
||||
allDates.push(date);
|
||||
dateColumns.value.push({
|
||||
|
@ -182,15 +217,6 @@ onMounted(() => {
|
|||
}
|
||||
})
|
||||
|
||||
// 创建一个生成器函数,用于遍历日期范围
|
||||
function* datesBetween(start, end) {
|
||||
let currentDate = start;
|
||||
while (currentDate.isBefore(end)) {
|
||||
yield currentDate;
|
||||
currentDate = currentDate.add(1, 'day');
|
||||
}
|
||||
}
|
||||
|
||||
// 获取日期间隔之间的天数
|
||||
function getDays(start, end) {
|
||||
const startDate = dayjs(start);
|
||||
|
@ -206,7 +232,6 @@ function getDays(start, end) {
|
|||
/**
|
||||
* 改变表格单元格颜色
|
||||
*/
|
||||
|
||||
function handleChangeCellStyle({ row, column, rowIndex, columnIndex }) {
|
||||
// 获取两个日期之间的所有日期
|
||||
const planDates = getDays(row.planStartDate, row.planEndDate)
|
||||
|
@ -233,8 +258,6 @@ function handleChangeCellStyle({ row, column, rowIndex, columnIndex }) {
|
|||
return cellStyle
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** 查询生产计划明细列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
|
@ -289,6 +312,14 @@ function resetQuery() {
|
|||
handleQuery();
|
||||
}
|
||||
|
||||
const openDate = ref(false)
|
||||
const openDateRef = ref(null)
|
||||
const formDate = ref({})
|
||||
function handleDate(row) {
|
||||
console.log('handleDate', row)
|
||||
openDate.value = true
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd(row) {
|
||||
reset();
|
||||
|
|
Loading…
Reference in New Issue