oa初步完成
This commit is contained in:
@@ -157,6 +157,8 @@ public class SysUser extends BaseEntity {
|
|||||||
|
|
||||||
private Long laborCost;
|
private Long laborCost;
|
||||||
|
|
||||||
|
private Double workTime;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据权限 当前角色ID
|
* 数据权限 当前角色ID
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
package com.ruoyi.oa.controller;
|
package com.ruoyi.oa.controller;
|
||||||
|
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
|
import com.ruoyi.oa.domain.LaborCostData;
|
||||||
import com.ruoyi.oa.domain.vo.SysUserVo;
|
import com.ruoyi.oa.domain.vo.SysUserVo;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
@@ -38,10 +42,35 @@ public class SysOaAttendanceController extends BaseController {
|
|||||||
|
|
||||||
private final ISysOaAttendanceService iSysOaAttendanceService;
|
private final ISysOaAttendanceService iSysOaAttendanceService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前月的天数
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/date")
|
||||||
|
public R<Long> date() {
|
||||||
|
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTime(DateUtils.getNowDate());
|
||||||
|
Long dateLength = (long) calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
|
||||||
|
|
||||||
|
return R.ok(dateLength);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前月的天数
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/calc/{time}")
|
||||||
|
public R<List<LaborCostData>> calc(@PathVariable("time") Date time) {
|
||||||
|
return R.ok(iSysOaAttendanceService.workerCalc(time));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询人员考勤列表
|
* 查询人员考勤列表
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:oaAttendance:list")
|
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo<SysOaAttendanceVo> list(SysOaAttendanceBo bo, PageQuery pageQuery) {
|
public TableDataInfo<SysOaAttendanceVo> list(SysOaAttendanceBo bo, PageQuery pageQuery) {
|
||||||
return iSysOaAttendanceService.queryPageList(bo, pageQuery);
|
return iSysOaAttendanceService.queryPageList(bo, pageQuery);
|
||||||
@@ -52,7 +81,6 @@ public class SysOaAttendanceController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* 查询人员考勤列表
|
* 查询人员考勤列表
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:oaAttendance:list")
|
|
||||||
@GetMapping("/worker/list")
|
@GetMapping("/worker/list")
|
||||||
public R<List<SysUserVo>> workerList(SysOaAttendanceBo bo) {
|
public R<List<SysUserVo>> workerList(SysOaAttendanceBo bo) {
|
||||||
|
|
||||||
@@ -63,7 +91,6 @@ public class SysOaAttendanceController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* 导出人员考勤列表
|
* 导出人员考勤列表
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:oaAttendance:export")
|
|
||||||
@Log(title = "人员考勤", businessType = BusinessType.EXPORT)
|
@Log(title = "人员考勤", businessType = BusinessType.EXPORT)
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void export(SysOaAttendanceBo bo, HttpServletResponse response) {
|
public void export(SysOaAttendanceBo bo, HttpServletResponse response) {
|
||||||
@@ -76,7 +103,6 @@ public class SysOaAttendanceController extends BaseController {
|
|||||||
*
|
*
|
||||||
* @param id 主键
|
* @param id 主键
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:oaAttendance:query")
|
|
||||||
@GetMapping("/{id}")
|
@GetMapping("/{id}")
|
||||||
public R<SysOaAttendanceVo> getInfo(@NotNull(message = "主键不能为空")
|
public R<SysOaAttendanceVo> getInfo(@NotNull(message = "主键不能为空")
|
||||||
@PathVariable Long id) {
|
@PathVariable Long id) {
|
||||||
@@ -86,7 +112,6 @@ public class SysOaAttendanceController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* 新增人员考勤
|
* 新增人员考勤
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:oaAttendance:add")
|
|
||||||
@Log(title = "人员考勤", businessType = BusinessType.INSERT)
|
@Log(title = "人员考勤", businessType = BusinessType.INSERT)
|
||||||
@RepeatSubmit()
|
@RepeatSubmit()
|
||||||
@PostMapping()
|
@PostMapping()
|
||||||
@@ -97,7 +122,6 @@ public class SysOaAttendanceController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* 修改人员考勤
|
* 修改人员考勤
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:oaAttendance:edit")
|
|
||||||
@Log(title = "人员考勤", businessType = BusinessType.UPDATE)
|
@Log(title = "人员考勤", businessType = BusinessType.UPDATE)
|
||||||
@RepeatSubmit()
|
@RepeatSubmit()
|
||||||
@PutMapping()
|
@PutMapping()
|
||||||
@@ -110,7 +134,6 @@ public class SysOaAttendanceController extends BaseController {
|
|||||||
*
|
*
|
||||||
* @param ids 主键串
|
* @param ids 主键串
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:oaAttendance:remove")
|
|
||||||
@Log(title = "人员考勤", businessType = BusinessType.DELETE)
|
@Log(title = "人员考勤", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{ids}")
|
@DeleteMapping("/{ids}")
|
||||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||||
@@ -122,7 +145,6 @@ public class SysOaAttendanceController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* 新增人员考勤
|
* 新增人员考勤
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:oaAttendance:add")
|
|
||||||
@Log(title = "人员考勤", businessType = BusinessType.INSERT)
|
@Log(title = "人员考勤", businessType = BusinessType.INSERT)
|
||||||
@RepeatSubmit()
|
@RepeatSubmit()
|
||||||
@PostMapping("/insertBatch")
|
@PostMapping("/insertBatch")
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.ruoyi.oa.domain;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
import com.ruoyi.oa.domain.vo.SysOaAttendanceVo;
|
||||||
|
import com.ruoyi.oa.domain.vo.SysOaProjectVo;
|
||||||
|
import com.ruoyi.oa.domain.vo.SysUserVo;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class LaborCostData extends BaseEntity {
|
||||||
|
|
||||||
|
// 对应用户
|
||||||
|
private SysUserVo sysUser;
|
||||||
|
|
||||||
|
// 计算月份
|
||||||
|
private Long generateMonth;
|
||||||
|
|
||||||
|
// 当前月的工作量
|
||||||
|
private Double workTimes;
|
||||||
|
|
||||||
|
// 捆绑的项目列表
|
||||||
|
private List<SysOaProjectVo> projects;
|
||||||
|
|
||||||
|
// 当月的所有签到信息
|
||||||
|
private List<SysOaAttendanceVo> attendances;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -39,11 +39,11 @@ public class SysOaAttendance extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 时长(天)1|0.5
|
* 时长(天)1|0.5
|
||||||
*/
|
*/
|
||||||
private Long dayLength;
|
private Double dayLength;
|
||||||
/**
|
/**
|
||||||
* 时长(小时)
|
* 时长(小时)
|
||||||
*/
|
*/
|
||||||
private Long hour;
|
private Double hour;
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ public class SysOaOutWarehouseBo extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 出库后对应的项目id
|
* 出库后对应的项目id
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "项目id不能为空",groups = { AddGroup.class })
|
|
||||||
private Long projectId;
|
private Long projectId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import com.alibaba.excel.annotation.ExcelProperty;
|
|||||||
import com.ruoyi.common.annotation.ExcelDictFormat;
|
import com.ruoyi.common.annotation.ExcelDictFormat;
|
||||||
import com.ruoyi.common.convert.ExcelDictConvert;
|
import com.ruoyi.common.convert.ExcelDictConvert;
|
||||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||||
|
import com.ruoyi.oa.domain.SysOaAttendance;
|
||||||
import com.ruoyi.oa.domain.SysOaProject;
|
import com.ruoyi.oa.domain.SysOaProject;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@@ -17,7 +18,7 @@ import lombok.Data;
|
|||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@ExcelIgnoreUnannotated
|
@ExcelIgnoreUnannotated
|
||||||
public class SysOaAttendanceVo {
|
public class SysOaAttendanceVo extends SysOaAttendance {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@@ -50,14 +51,14 @@ public class SysOaAttendanceVo {
|
|||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "时长", converter = ExcelDictConvert.class)
|
@ExcelProperty(value = "时长", converter = ExcelDictConvert.class)
|
||||||
@ExcelDictFormat(readConverterExp = "天=")
|
@ExcelDictFormat(readConverterExp = "天=")
|
||||||
private Long dayLength;
|
private Double dayLength;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 时长(小时)
|
* 时长(小时)
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "时长", converter = ExcelDictConvert.class)
|
@ExcelProperty(value = "时长", converter = ExcelDictConvert.class)
|
||||||
@ExcelDictFormat(readConverterExp = "小=时")
|
@ExcelDictFormat(readConverterExp = "小=时")
|
||||||
private Long hour;
|
private Double hour;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
@@ -71,5 +72,11 @@ public class SysOaAttendanceVo {
|
|||||||
|
|
||||||
private String color;
|
private String color;
|
||||||
|
|
||||||
|
private Long count;
|
||||||
|
|
||||||
|
// 单个工作时间
|
||||||
|
private Double workTimes;
|
||||||
|
|
||||||
|
private String projectName;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.ruoyi.oa.domain.vo;
|
|||||||
|
|
||||||
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.ruoyi.common.core.domain.BaseEntity;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -15,7 +16,7 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@ExcelIgnoreUnannotated
|
@ExcelIgnoreUnannotated
|
||||||
public class SysOaOutWarehouseListVo {
|
public class SysOaOutWarehouseListVo extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* ID 编号
|
* ID 编号
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -55,5 +55,10 @@ public class SysOaOutWarehouseVo extends BaseEntity {
|
|||||||
/** 项目名 */
|
/** 项目名 */
|
||||||
private String projectName;
|
private String projectName;
|
||||||
|
|
||||||
|
/** 库存信息 */
|
||||||
|
private SysOaWarehouseVo warehouse;
|
||||||
|
|
||||||
|
/** 项目信息 */
|
||||||
|
private SysOaProjectVo project;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -186,4 +186,9 @@ public class SysOaProjectVo {
|
|||||||
*/
|
*/
|
||||||
private String color;
|
private String color;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 此项目数量 用户报工功能
|
||||||
|
*/
|
||||||
|
private Long count;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,5 +108,9 @@ public class SysOaTaskVo {
|
|||||||
* */
|
* */
|
||||||
private List<SysUser> workerList;
|
private List<SysUser> workerList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 此任务总成本
|
||||||
|
*/
|
||||||
|
private Double projectCostTotal;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
|||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
import com.ruoyi.common.annotation.ExcelDictFormat;
|
import com.ruoyi.common.annotation.ExcelDictFormat;
|
||||||
import com.ruoyi.common.convert.ExcelDictConvert;
|
import com.ruoyi.common.convert.ExcelDictConvert;
|
||||||
|
import com.ruoyi.oa.domain.SysOaWarehouse;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
@@ -17,7 +18,7 @@ import java.util.Date;
|
|||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@ExcelIgnoreUnannotated
|
@ExcelIgnoreUnannotated
|
||||||
public class SysOaWarehouseVo {
|
public class SysOaWarehouseVo extends SysOaWarehouse {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,10 @@ package com.ruoyi.oa.mapper;
|
|||||||
import com.ruoyi.oa.domain.SysOaAttendance;
|
import com.ruoyi.oa.domain.SysOaAttendance;
|
||||||
import com.ruoyi.oa.domain.vo.SysOaAttendanceVo;
|
import com.ruoyi.oa.domain.vo.SysOaAttendanceVo;
|
||||||
import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 人员考勤Mapper接口
|
* 人员考勤Mapper接口
|
||||||
@@ -12,4 +16,5 @@ import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
|||||||
*/
|
*/
|
||||||
public interface SysOaAttendanceMapper extends BaseMapperPlus<SysOaAttendanceMapper, SysOaAttendance, SysOaAttendanceVo> {
|
public interface SysOaAttendanceMapper extends BaseMapperPlus<SysOaAttendanceMapper, SysOaAttendance, SysOaAttendanceVo> {
|
||||||
|
|
||||||
|
List<SysOaAttendanceVo> selectVoListAndTime(@Param("userId") Long userId, @Param("firstDay") Date firstDay, @Param("lastDay") Date lastDay);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,4 +22,5 @@ public interface SysOaProjectMapper extends BaseMapperPlus<SysOaProjectMapper, S
|
|||||||
|
|
||||||
Page<SysOaOutWarehouseListVo> selectPageOutList(@Param("page") Page<SysOaOutWarehouseListVo> page,@Param(Constants.WRAPPER) Wrapper<SysOaProject> queryWrapper);
|
Page<SysOaOutWarehouseListVo> selectPageOutList(@Param("page") Page<SysOaOutWarehouseListVo> page,@Param(Constants.WRAPPER) Wrapper<SysOaProject> queryWrapper);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,4 +12,11 @@ import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
|||||||
*/
|
*/
|
||||||
public interface SysOaWarehouseMapper extends BaseMapperPlus<SysOaWarehouseMapper, SysOaWarehouse, SysOaWarehouseVo> {
|
public interface SysOaWarehouseMapper extends BaseMapperPlus<SysOaWarehouseMapper, SysOaWarehouse, SysOaWarehouseVo> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* 查询已经被逻辑删除的数据
|
||||||
|
* @param warehouseId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
SysOaWarehouseVo selectVoByIdAndXml(Long warehouseId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.ruoyi.oa.service;
|
package com.ruoyi.oa.service;
|
||||||
|
|
||||||
|
import com.ruoyi.oa.domain.LaborCostData;
|
||||||
import com.ruoyi.oa.domain.vo.SysOaAttendanceVo;
|
import com.ruoyi.oa.domain.vo.SysOaAttendanceVo;
|
||||||
import com.ruoyi.oa.domain.bo.SysOaAttendanceBo;
|
import com.ruoyi.oa.domain.bo.SysOaAttendanceBo;
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
@@ -7,6 +8,7 @@ import com.ruoyi.common.core.domain.PageQuery;
|
|||||||
import com.ruoyi.oa.domain.vo.SysUserVo;
|
import com.ruoyi.oa.domain.vo.SysUserVo;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -47,7 +49,25 @@ public interface ISysOaAttendanceService {
|
|||||||
*/
|
*/
|
||||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工人列表
|
||||||
|
* @param bo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
List<SysUserVo> workerList(SysOaAttendanceBo bo);
|
List<SysUserVo> workerList(SysOaAttendanceBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量插入
|
||||||
|
* @param bo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
int insertBatch(SysOaAttendanceBo bo);
|
int insertBatch(SysOaAttendanceBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人力成本计算接口
|
||||||
|
*
|
||||||
|
* @param time 时间
|
||||||
|
*/
|
||||||
|
List<LaborCostData> workerCalc(Date time);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,4 +49,6 @@ public interface ISysOaProjectService {
|
|||||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
|
||||||
TableDataInfo<SysOaOutWarehouseListVo> queryOutWarePageList(SysOaOutWarehouseBo bo, PageQuery pageQuery);
|
TableDataInfo<SysOaOutWarehouseListVo> queryOutWarePageList(SysOaOutWarehouseBo bo, PageQuery pageQuery);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,12 +6,15 @@ import com.ruoyi.common.core.domain.PageQuery;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
|
import com.ruoyi.oa.domain.LaborCostData;
|
||||||
import com.ruoyi.oa.domain.vo.SysOaProjectVo;
|
import com.ruoyi.oa.domain.vo.SysOaProjectVo;
|
||||||
import com.ruoyi.oa.domain.vo.SysUserVo;
|
import com.ruoyi.oa.domain.vo.SysUserVo;
|
||||||
import com.ruoyi.oa.service.ISysOaProjectService;
|
import com.ruoyi.oa.service.ISysOaProjectService;
|
||||||
import com.ruoyi.system.mapper.SysUserRoleMapper;
|
import com.ruoyi.system.mapper.SysUserRoleMapper;
|
||||||
import com.ruoyi.system.service.ISysUserService;
|
import com.ruoyi.system.service.ISysUserService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.ruoyi.oa.domain.bo.SysOaAttendanceBo;
|
import com.ruoyi.oa.domain.bo.SysOaAttendanceBo;
|
||||||
@@ -22,6 +25,7 @@ import com.ruoyi.oa.service.ISysOaAttendanceService;
|
|||||||
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 人员考勤Service业务层处理
|
* 人员考勤Service业务层处理
|
||||||
@@ -29,6 +33,7 @@ import java.util.*;
|
|||||||
* @author hdka
|
* @author hdka
|
||||||
* @date 2024-11-05
|
* @date 2024-11-05
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@Service
|
@Service
|
||||||
public class SysOaAttendanceServiceImpl implements ISysOaAttendanceService {
|
public class SysOaAttendanceServiceImpl implements ISysOaAttendanceService {
|
||||||
@@ -182,4 +187,64 @@ public class SysOaAttendanceServiceImpl implements ISysOaAttendanceService {
|
|||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计算人力成本
|
||||||
|
*
|
||||||
|
* @param time 月份
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<LaborCostData> workerCalc(Date time) {
|
||||||
|
|
||||||
|
String firstDay = DateUtils.parseDateToStr("yyyy-MM-01", time);
|
||||||
|
|
||||||
|
String format = "yyyy-MM-";
|
||||||
|
// 计算某月的天数
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTime(time);
|
||||||
|
String dateLength = String.valueOf(calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
|
||||||
|
// 将字符串拼接
|
||||||
|
format +=dateLength;
|
||||||
|
String lastDay = DateUtils.parseDateToStr(format, time);
|
||||||
|
// 查询所有的工人
|
||||||
|
List<Long> userIds = sysUserRoleMapper.selectUserIdsByRoleId(1852970465740505090L);
|
||||||
|
|
||||||
|
|
||||||
|
List<LaborCostData> costDataList = new ArrayList<>();
|
||||||
|
for (Long userId : userIds) {
|
||||||
|
SysUserVo sysUser = BeanUtil.toBean(sysUserService.selectUserById(userId), SysUserVo.class);
|
||||||
|
SysOaAttendanceVo sysOaAttendanceVo = new SysOaAttendanceVo();
|
||||||
|
sysOaAttendanceVo.setUserId(sysUser.getUserId());
|
||||||
|
|
||||||
|
// 查询某月记录
|
||||||
|
List<SysOaAttendanceVo> sysOaAttendanceVos = baseMapper.selectVoListAndTime(userId, DateUtils.parseDate(firstDay),DateUtils.parseDate(lastDay));
|
||||||
|
|
||||||
|
List<SysOaProjectVo> projectVos = new ArrayList<>();
|
||||||
|
|
||||||
|
Double workTimes = 0.0;
|
||||||
|
System.out.println(sysOaAttendanceVos);
|
||||||
|
for (SysOaAttendanceVo oaAttendanceVo : sysOaAttendanceVos) {
|
||||||
|
SysOaProjectVo sysOaProjectVo = projectService.queryById(oaAttendanceVo.getProjectId());
|
||||||
|
oaAttendanceVo.setColor(sysOaProjectVo.getColor());
|
||||||
|
oaAttendanceVo.setSysOaProjectVo(sysOaProjectVo);
|
||||||
|
oaAttendanceVo.setProjectName(sysOaProjectVo.getProjectName());
|
||||||
|
projectVos.add(sysOaProjectVo);
|
||||||
|
workTimes+=oaAttendanceVo.getWorkTimes();
|
||||||
|
|
||||||
|
}
|
||||||
|
projectVos.stream().distinct().collect(Collectors.toList());
|
||||||
|
LaborCostData laborCostData = new LaborCostData();
|
||||||
|
laborCostData.setProjects(projectVos);
|
||||||
|
laborCostData.setAttendances(sysOaAttendanceVos);
|
||||||
|
laborCostData.setSysUser(sysUser);
|
||||||
|
laborCostData.setWorkTimes(workTimes);
|
||||||
|
costDataList.add(laborCostData);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return costDataList;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,11 +15,14 @@ import com.ruoyi.oa.domain.SysOaWarehouse;
|
|||||||
import com.ruoyi.oa.domain.bo.SysOaOutWarehouseBo2;
|
import com.ruoyi.oa.domain.bo.SysOaOutWarehouseBo2;
|
||||||
import com.ruoyi.oa.domain.bo.SysOaOutWarehouseBoList;
|
import com.ruoyi.oa.domain.bo.SysOaOutWarehouseBoList;
|
||||||
import com.ruoyi.oa.domain.vo.SysOaOutWarehouseListVo;
|
import com.ruoyi.oa.domain.vo.SysOaOutWarehouseListVo;
|
||||||
|
import com.ruoyi.oa.domain.vo.SysOaProjectVo;
|
||||||
|
import com.ruoyi.oa.domain.vo.SysOaWarehouseVo;
|
||||||
import com.ruoyi.oa.mapper.SysOaProjectMapper;
|
import com.ruoyi.oa.mapper.SysOaProjectMapper;
|
||||||
import com.ruoyi.oa.mapper.SysOaWarehouseMapper;
|
import com.ruoyi.oa.mapper.SysOaWarehouseMapper;
|
||||||
import com.ruoyi.oa.service.ISysOaWarehouseService;
|
import com.ruoyi.oa.service.ISysOaWarehouseService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.catalina.security.SecurityUtil;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.ruoyi.oa.domain.bo.SysOaOutWarehouseBo;
|
import com.ruoyi.oa.domain.bo.SysOaOutWarehouseBo;
|
||||||
@@ -28,10 +31,7 @@ import com.ruoyi.oa.domain.SysOaOutWarehouse;
|
|||||||
import com.ruoyi.oa.mapper.SysOaOutWarehouseMapper;
|
import com.ruoyi.oa.mapper.SysOaOutWarehouseMapper;
|
||||||
import com.ruoyi.oa.service.ISysOaOutWarehouseService;
|
import com.ruoyi.oa.service.ISysOaOutWarehouseService;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Collection;
|
|
||||||
|
|
||||||
import static cn.hutool.core.bean.BeanUtil.*;
|
import static cn.hutool.core.bean.BeanUtil.*;
|
||||||
|
|
||||||
@@ -61,7 +61,16 @@ public class SysOaOutWarehouseServiceImpl implements ISysOaOutWarehouseService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public SysOaOutWarehouseVo queryById(Long id){
|
public SysOaOutWarehouseVo queryById(Long id){
|
||||||
return baseMapper.selectVoById(id);
|
SysOaOutWarehouseVo sysOaOutWarehouseVo = baseMapper.selectVoById(id);
|
||||||
|
SysOaWarehouseVo sysOaWarehouse = warehouseMapper.selectVoByIdAndXml(sysOaOutWarehouseVo.getWarehouseId());
|
||||||
|
SysOaProjectVo sysOaProject = projectMapper.selectVoById(sysOaOutWarehouseVo.getProjectId());
|
||||||
|
sysOaOutWarehouseVo.setWarehouse(sysOaWarehouse);
|
||||||
|
|
||||||
|
// 出库可能不关联项目
|
||||||
|
if (Objects.nonNull(sysOaProject)){
|
||||||
|
sysOaOutWarehouseVo.setProject(sysOaProject);
|
||||||
|
}
|
||||||
|
return sysOaOutWarehouseVo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -104,13 +113,11 @@ public class SysOaOutWarehouseServiceImpl implements ISysOaOutWarehouseService {
|
|||||||
pageQuery.setPageSize(Integer.MAX_VALUE);
|
pageQuery.setPageSize(Integer.MAX_VALUE);
|
||||||
}
|
}
|
||||||
pageQuery.setPageNum((pageQuery.getPageNum() - 1)*pageQuery.getPageSize());
|
pageQuery.setPageNum((pageQuery.getPageNum() - 1)*pageQuery.getPageSize());
|
||||||
|
|
||||||
List<SysOaOutWarehouseListVo> selectList = baseMapper.defineSelectList(bo, pageQuery);
|
List<SysOaOutWarehouseListVo> selectList = baseMapper.defineSelectList(bo, pageQuery);
|
||||||
|
|
||||||
IPage<SysOaOutWarehouseListVo> page = new Page<>(pageQuery.getPageNum(), pageQuery.getPageSize());
|
IPage<SysOaOutWarehouseListVo> page = new Page<>(pageQuery.getPageNum(), pageQuery.getPageSize());
|
||||||
page.setRecords(selectList);
|
page.setRecords(selectList);
|
||||||
page.setTotal(total);
|
page.setTotal(total);
|
||||||
log.info(String.valueOf(total));
|
|
||||||
|
|
||||||
return TableDataInfo.build(page);
|
return TableDataInfo.build(page);
|
||||||
}
|
}
|
||||||
@@ -140,7 +147,10 @@ public class SysOaOutWarehouseServiceImpl implements ISysOaOutWarehouseService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Boolean insertByBo(SysOaOutWarehouseBo bo) {
|
public Boolean insertByBo(SysOaOutWarehouseBo bo) {
|
||||||
|
bo.setCreateTime(new Date());
|
||||||
|
bo.setUpdateTime(new Date());
|
||||||
SysOaOutWarehouse decrease = toBean(bo, SysOaOutWarehouse.class);
|
SysOaOutWarehouse decrease = toBean(bo, SysOaOutWarehouse.class);
|
||||||
|
|
||||||
validEntityBeforeSave(decrease);
|
validEntityBeforeSave(decrease);
|
||||||
SysOaWarehouse warehouse = warehouseMapper.selectById(decrease.getWarehouseId());
|
SysOaWarehouse warehouse = warehouseMapper.selectById(decrease.getWarehouseId());
|
||||||
// 1 如果对应仓库表项目数量-将要出库数量<0,出库失败, 繁殖 , 增加该条
|
// 1 如果对应仓库表项目数量-将要出库数量<0,出库失败, 繁殖 , 增加该条
|
||||||
@@ -152,6 +162,7 @@ public class SysOaOutWarehouseServiceImpl implements ISysOaOutWarehouseService {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
warehouse.setInventory(warehouse.getInventory() - decrease.getAmount());
|
warehouse.setInventory(warehouse.getInventory() - decrease.getAmount());
|
||||||
|
warehouse.setUpdateTime(new Date());
|
||||||
warehouseMapper.updateById(warehouse);
|
warehouseMapper.updateById(warehouse);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -167,17 +178,21 @@ public class SysOaOutWarehouseServiceImpl implements ISysOaOutWarehouseService {
|
|||||||
|
|
||||||
|
|
||||||
Long projectId = boList.getProjectId();
|
Long projectId = boList.getProjectId();
|
||||||
if (projectId == null) {
|
|
||||||
throw new Error("项目ID不能为空,新增出库失败");
|
|
||||||
}
|
|
||||||
List<SysOaOutWarehouseBo2> list = boList.getOutWareHouseList();
|
List<SysOaOutWarehouseBo2> list = boList.getOutWareHouseList();
|
||||||
|
if (projectId != null) {
|
||||||
|
list.forEach((sysOaOutWarehouseBo2 -> {
|
||||||
|
sysOaOutWarehouseBo2.setProjectId(projectId);
|
||||||
|
SysOaOutWarehouseBo sysOaOutWarehouse = toBean(sysOaOutWarehouseBo2, SysOaOutWarehouseBo.class);
|
||||||
|
insertByBo(sysOaOutWarehouse);
|
||||||
|
}));
|
||||||
|
|
||||||
list.forEach((sysOaOutWarehouseBo2 -> {
|
}else{
|
||||||
|
list.forEach((sysOaOutWarehouseBo2 -> {
|
||||||
|
SysOaOutWarehouseBo sysOaOutWarehouse = toBean(sysOaOutWarehouseBo2, SysOaOutWarehouseBo.class);
|
||||||
|
insertByBo(sysOaOutWarehouse);
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
sysOaOutWarehouseBo2.setProjectId(projectId);
|
|
||||||
SysOaOutWarehouseBo sysOaOutWarehouse = toBean(sysOaOutWarehouseBo2, SysOaOutWarehouseBo.class);
|
|
||||||
insertByBo(sysOaOutWarehouse);
|
|
||||||
}));
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -251,12 +266,10 @@ public class SysOaOutWarehouseServiceImpl implements ISysOaOutWarehouseService {
|
|||||||
//需要增加的对应物料数量
|
//需要增加的对应物料数量
|
||||||
LambdaQueryWrapper<SysOaOutWarehouse> lqw = Wrappers.lambdaQuery();
|
LambdaQueryWrapper<SysOaOutWarehouse> lqw = Wrappers.lambdaQuery();
|
||||||
lqw.in(SysOaOutWarehouse::getId, ids.toArray());
|
lqw.in(SysOaOutWarehouse::getId, ids.toArray());
|
||||||
|
//出库表中的所有删除的数据
|
||||||
List<SysOaOutWarehouse> sysOaOutWarehouses = baseMapper.selectList(lqw); //出库表中的所有删除的数据
|
List<SysOaOutWarehouse> sysOaOutWarehouses = baseMapper.selectList(lqw);
|
||||||
|
//其中一条
|
||||||
sysOaOutWarehouses.forEach(sysOaOutWarehouse -> { //其中一条
|
sysOaOutWarehouses.forEach(sysOaOutWarehouse -> {
|
||||||
|
|
||||||
|
|
||||||
//选出相对应的 库存表中那一条的数据
|
//选出相对应的 库存表中那一条的数据
|
||||||
LambdaQueryWrapper<SysOaWarehouse> lqw2 = Wrappers.lambdaQuery();
|
LambdaQueryWrapper<SysOaWarehouse> lqw2 = Wrappers.lambdaQuery();
|
||||||
lqw2.eq(SysOaWarehouse::getId, sysOaOutWarehouse.getWarehouseId());
|
lqw2.eq(SysOaWarehouse::getId, sysOaOutWarehouse.getWarehouseId());
|
||||||
@@ -266,8 +279,7 @@ public class SysOaOutWarehouseServiceImpl implements ISysOaOutWarehouseService {
|
|||||||
warehouse.setInventory(warehouse.getInventory() + sysOaOutWarehouse.getAmount());
|
warehouse.setInventory(warehouse.getInventory() + sysOaOutWarehouse.getAmount());
|
||||||
warehouseMapper.updateById(warehouse);
|
warehouseMapper.updateById(warehouse);
|
||||||
});
|
});
|
||||||
boolean flag = baseMapper.deleteBatchIds(ids) > 0;
|
return baseMapper.deleteBatchIds(ids) > 0;
|
||||||
return flag;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -281,7 +293,7 @@ public class SysOaOutWarehouseServiceImpl implements ISysOaOutWarehouseService {
|
|||||||
lqw.eq(SysOaOutWarehouse::getProjectId, projectId);
|
lqw.eq(SysOaOutWarehouse::getProjectId, projectId);
|
||||||
List<SysOaOutWarehouseVo> sysOaOutWarehouseVos = baseMapper.selectVoList(lqw);
|
List<SysOaOutWarehouseVo> sysOaOutWarehouseVos = baseMapper.selectVoList(lqw);
|
||||||
for (SysOaOutWarehouseVo sysOaOutWarehouseVo :sysOaOutWarehouseVos) {
|
for (SysOaOutWarehouseVo sysOaOutWarehouseVo :sysOaOutWarehouseVos) {
|
||||||
sysOaOutWarehouseVo.setWarehouseName(warehouseMapper.selectById(sysOaOutWarehouseVo.getWarehouseId()).getName());
|
sysOaOutWarehouseVo.setWarehouseName(warehouseMapper.selectVoByIdAndXml((sysOaOutWarehouseVo.getWarehouseId())).getName());
|
||||||
}
|
}
|
||||||
return TableDataInfo.build(sysOaOutWarehouseVos);
|
return TableDataInfo.build(sysOaOutWarehouseVos);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,11 +14,15 @@ import com.ruoyi.common.core.domain.PageQuery;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.ruoyi.oa.domain.SysOaAttendance;
|
||||||
import com.ruoyi.oa.domain.SysOaTaskUser;
|
import com.ruoyi.oa.domain.SysOaTaskUser;
|
||||||
|
import com.ruoyi.oa.domain.bo.SysOaAttendanceBo;
|
||||||
import com.ruoyi.oa.domain.bo.SysOaTaskUserBo;
|
import com.ruoyi.oa.domain.bo.SysOaTaskUserBo;
|
||||||
|
import com.ruoyi.oa.domain.vo.SysOaAttendanceVo;
|
||||||
import com.ruoyi.oa.domain.vo.SysOaTaskUserVo;
|
import com.ruoyi.oa.domain.vo.SysOaTaskUserVo;
|
||||||
import com.ruoyi.oa.domain.vo.SysUserVo;
|
import com.ruoyi.oa.domain.vo.SysUserVo;
|
||||||
import com.ruoyi.oa.mapper.SysOaTaskUserMapper;
|
import com.ruoyi.oa.mapper.SysOaTaskUserMapper;
|
||||||
|
import com.ruoyi.oa.service.ISysOaAttendanceService;
|
||||||
import com.ruoyi.oa.service.ISysOaTaskUserService;
|
import com.ruoyi.oa.service.ISysOaTaskUserService;
|
||||||
import com.ruoyi.system.service.ISysDictTypeService;
|
import com.ruoyi.system.service.ISysDictTypeService;
|
||||||
import com.ruoyi.system.service.ISysUserService;
|
import com.ruoyi.system.service.ISysUserService;
|
||||||
@@ -58,6 +62,9 @@ public class SysOaTaskServiceImpl implements ISysOaTaskService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ISysUserService userService;
|
private ISysUserService userService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysOaAttendanceService attendanceService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询任务管理
|
* 查询任务管理
|
||||||
*/
|
*/
|
||||||
@@ -129,6 +136,7 @@ public class SysOaTaskServiceImpl implements ISysOaTaskService {
|
|||||||
lqw.eq(StringUtils.isNotEmpty(bo.getProjectId().toString()), SysOaTask::getProjectId, bo.getProjectId());
|
lqw.eq(StringUtils.isNotEmpty(bo.getProjectId().toString()), SysOaTask::getProjectId, bo.getProjectId());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getTaskType()),SysOaTask::getTaskType, bo.getTaskType());
|
lqw.eq(StringUtils.isNotBlank(bo.getTaskType()),SysOaTask::getTaskType, bo.getTaskType());
|
||||||
List<SysOaTaskVo> sysOaTaskVos = baseMapper.selectVoList(lqw);
|
List<SysOaTaskVo> sysOaTaskVos = baseMapper.selectVoList(lqw);
|
||||||
|
Long projectId = bo.getProjectId();
|
||||||
|
|
||||||
// 添加负责人列表
|
// 添加负责人列表
|
||||||
for (SysOaTaskVo sysOaTaskVo : sysOaTaskVos) {
|
for (SysOaTaskVo sysOaTaskVo : sysOaTaskVos) {
|
||||||
@@ -136,11 +144,33 @@ public class SysOaTaskServiceImpl implements ISysOaTaskService {
|
|||||||
lambdaQueryWrapper.eq(SysOaTaskUser::getTaskId, sysOaTaskVo.getTaskId());
|
lambdaQueryWrapper.eq(SysOaTaskUser::getTaskId, sysOaTaskVo.getTaskId());
|
||||||
List<SysOaTaskUserVo> sysOaTaskUserVos = taskUserMapper.selectVoList(lambdaQueryWrapper);
|
List<SysOaTaskUserVo> sysOaTaskUserVos = taskUserMapper.selectVoList(lambdaQueryWrapper);
|
||||||
List<SysUser> sysUserList = new ArrayList<>();
|
List<SysUser> sysUserList = new ArrayList<>();
|
||||||
|
|
||||||
|
// 计算总成本
|
||||||
|
Double projectCostTotal = 0.0;
|
||||||
|
|
||||||
for (SysOaTaskUserVo sysOaTaskUserVo : sysOaTaskUserVos) {
|
for (SysOaTaskUserVo sysOaTaskUserVo : sysOaTaskUserVos) {
|
||||||
SysUser sysUser = userService.selectUserById(sysOaTaskUserVo.getUserId());
|
SysUser sysUser = userService.selectUserById(sysOaTaskUserVo.getUserId());
|
||||||
|
|
||||||
|
// 查询当前用户对于此项目的工作时长
|
||||||
|
SysOaAttendanceBo attendance = new SysOaAttendanceBo();
|
||||||
|
attendance.setUserId(sysOaTaskUserVo.getUserId());
|
||||||
|
attendance.setProjectId(projectId);
|
||||||
|
|
||||||
|
List<SysOaAttendanceVo> sysOaAttendanceVos = attendanceService.queryList(attendance);
|
||||||
|
|
||||||
|
// 写入时间
|
||||||
|
Double workTime = 0.0;
|
||||||
|
for (SysOaAttendanceVo sysOaAttendanceVo : sysOaAttendanceVos) {
|
||||||
|
workTime+=sysOaAttendanceVo.getDayLength();
|
||||||
|
}
|
||||||
|
|
||||||
|
projectCostTotal+=workTime*sysUser.getLaborCost();
|
||||||
|
sysUser.setWorkTime(workTime);
|
||||||
|
|
||||||
sysUserList.add(sysUser);
|
sysUserList.add(sysUser);
|
||||||
}
|
}
|
||||||
sysOaTaskVo.setWorkerList(sysUserList);
|
sysOaTaskVo.setWorkerList(sysUserList);
|
||||||
|
sysOaTaskVo.setProjectCostTotal(projectCostTotal);
|
||||||
}
|
}
|
||||||
return sysOaTaskVos;
|
return sysOaTaskVos;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -127,13 +127,7 @@ public class SysOaWarehouseServiceImpl implements ISysOaWarehouseService {
|
|||||||
if(isValid){
|
if(isValid){
|
||||||
//TODO 做一些业务上的校验,判断是否需要校验
|
//TODO 做一些业务上的校验,判断是否需要校验
|
||||||
}
|
}
|
||||||
LambdaQueryWrapper<SysOaWarehouse> lqw = Wrappers.lambdaQuery();
|
|
||||||
lqw.in(SysOaWarehouse::getId, ids);
|
|
||||||
List<SysOaWarehouse> sysOaWarehouses = baseMapper.selectList(lqw);
|
|
||||||
sysOaWarehouses.forEach(sysOaWarehouse -> {
|
|
||||||
sysOaWarehouse.setDelFlag(1L);
|
|
||||||
});
|
|
||||||
|
|
||||||
return baseMapper.updateBatchById(sysOaWarehouses);
|
return baseMapper.deleteBatchIds(ids)>0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.ruoyi.oa.mapper.SysOaAttendanceMapper">
|
<mapper namespace="com.ruoyi.oa.mapper.SysOaAttendanceMapper">
|
||||||
|
|
||||||
<resultMap type="com.ruoyi.oa.domain.SysOaAttendance" id="SysOaAttendanceResult">
|
<resultMap type="com.ruoyi.oa.domain.vo.SysOaAttendanceVo" id="SysOaAttendanceResult">
|
||||||
<result property="id" column="id"/>
|
<result property="id" column="id"/>
|
||||||
<result property="userId" column="user_id"/>
|
<result property="userId" column="user_id"/>
|
||||||
<result property="attendanceDay" column="attendance_day"/>
|
<result property="attendanceDay" column="attendance_day"/>
|
||||||
@@ -17,7 +17,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<result property="updateBy" column="update_by"/>
|
<result property="updateBy" column="update_by"/>
|
||||||
<result property="remark" column="remark"/>
|
<result property="remark" column="remark"/>
|
||||||
<result property="delFlag" column="del_flag"/>
|
<result property="delFlag" column="del_flag"/>
|
||||||
|
<result property="count" column="count"/>
|
||||||
|
<result property="workTimes" column="work_times"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectVoListAndTime" resultType="com.ruoyi.oa.domain.vo.SysOaAttendanceVo">
|
||||||
|
select ANY_VALUE(id),
|
||||||
|
user_id,
|
||||||
|
ANY_VALUE(attendance_day),
|
||||||
|
project_id,
|
||||||
|
ANY_VALUE(day_length),
|
||||||
|
ANY_VALUE(hour),
|
||||||
|
ANY_VALUE(create_time),
|
||||||
|
ANY_VALUE(create_by),
|
||||||
|
ANY_VALUE(update_time),
|
||||||
|
ANY_VALUE(update_by),
|
||||||
|
ANY_VALUE(remark),
|
||||||
|
ANY_VALUE(del_flag),
|
||||||
|
count(*) as count,
|
||||||
|
sum(day_length) as work_times
|
||||||
|
from sys_oa_attendance soa
|
||||||
|
where user_id = #{userId}
|
||||||
|
and #{lastDay} > create_time
|
||||||
|
and create_time > #{firstDay}
|
||||||
|
group by soa.project_id
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -27,15 +27,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
ware.remark as remark,
|
ware.remark as remark,
|
||||||
ware.warehouse_id as warehouseId,
|
ware.warehouse_id as warehouseId,
|
||||||
project.project_name as projectName,
|
project.project_name as projectName,
|
||||||
warehouse.name as warehouseName
|
warehouse.name as warehouseName,
|
||||||
|
ware.create_time,
|
||||||
|
ware.create_by
|
||||||
from
|
from
|
||||||
sys_oa_out_warehouse ware
|
sys_oa_out_warehouse ware
|
||||||
join
|
left join sys_oa_project project on ware.project_id = project.project_id
|
||||||
sys_oa_project project on ware.project_id = project.project_id
|
left join sys_oa_warehouse warehouse on warehouse.id = ware.warehouse_id
|
||||||
|
|
||||||
join sys_oa_warehouse warehouse on warehouse.id = ware.warehouse_id
|
|
||||||
|
|
||||||
<where>
|
<where>
|
||||||
|
ware.del_flag='0'
|
||||||
<if test="bo.projectName != null and bo.projectName != ''">
|
<if test="bo.projectName != null and bo.projectName != ''">
|
||||||
and project.project_name like concat('%', #{bo.projectName}, '%')
|
and project.project_name like concat('%', #{bo.projectName}, '%')
|
||||||
</if>
|
</if>
|
||||||
@@ -68,12 +68,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
count(*)
|
count(*)
|
||||||
from
|
from
|
||||||
sys_oa_out_warehouse ware
|
sys_oa_out_warehouse ware
|
||||||
join
|
left join sys_oa_project project on ware.project_id = project.project_id
|
||||||
sys_oa_project project on ware.project_id = project.project_id
|
|
||||||
|
|
||||||
join sys_oa_warehouse warehouse on warehouse.id = ware.warehouse_id
|
left join sys_oa_warehouse warehouse on warehouse.id = ware.warehouse_id
|
||||||
<if test="bo != null">
|
<if test="bo != null">
|
||||||
<where>
|
<where>
|
||||||
|
ware.del_flag = '0'
|
||||||
<if test="bo.projectName != null and bo.projectName != ''">
|
<if test="bo.projectName != null and bo.projectName != ''">
|
||||||
and project.project_name like concat('%', #{bo.projectName}, '%')
|
and project.project_name like concat('%', #{bo.projectName}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
@@ -33,6 +33,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<result property="updateTime" column="update_time"/>
|
<result property="updateTime" column="update_time"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
<resultMap type="com.ruoyi.oa.domain.vo.SysOaProjectVo" id="SysOaProjectVoResult">
|
||||||
|
<result property="projectId" column="project_id"/>
|
||||||
|
<result property="projectName" column="project_name"/>
|
||||||
|
<result property="projectNum" column="project_num"/>
|
||||||
|
<result property="projectType" column="project_type"/>
|
||||||
|
<result property="address" column="address"/>
|
||||||
|
<result property="funds" column="funds"/>
|
||||||
|
<result property="functionary" column="functionary"/>
|
||||||
|
<result property="beginTime" column="begin_time"/>
|
||||||
|
<result property="finishTime" column="finish_time"/>
|
||||||
|
<result property="delivery" column="delivery"/>
|
||||||
|
<result property="guarantee" column="guarantee"/>
|
||||||
|
<result property="introduction" column="introduction"/>
|
||||||
|
<result property="projectGrade" column="project_grade"/>
|
||||||
|
<result property="projectStatus" column="project_status"/>
|
||||||
|
<result property="contractId" column="contract_id"/>
|
||||||
|
<result property="invoiceName" column="invoice_name"/>
|
||||||
|
<result property="invoiceNumber" column="invoice_number"/>
|
||||||
|
<result property="invoiceAddress" column="invoice_address"/>
|
||||||
|
<result property="invoiceBank" column="invoice_bank"/>
|
||||||
|
<result property="accessory" column="accessory"/>
|
||||||
|
<result property="bail" column="bail"/>
|
||||||
|
<result property="remark" column="remark"/>
|
||||||
|
<result property="createBy" column="create_by"/>
|
||||||
|
<result property="createTime" column="create_time"/>
|
||||||
|
<result property="count" column="count"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
<resultMap type="com.ruoyi.oa.domain.vo.SysOaOutWarehouseListVo" id="SysOaOutWarehouseListVoResult">
|
<resultMap type="com.ruoyi.oa.domain.vo.SysOaOutWarehouseListVo" id="SysOaOutWarehouseListVoResult">
|
||||||
<result property="projectId" column="project_id"/>
|
<result property="projectId" column="project_id"/>
|
||||||
@@ -60,4 +88,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.ruoyi.oa.mapper.SysOaWarehouseMapper">
|
<mapper namespace="com.ruoyi.oa.mapper.SysOaWarehouseMapper">
|
||||||
|
|
||||||
<resultMap type="com.ruoyi.oa.domain.SysOaWarehouse" id="SysOaWarehouseResult">
|
<resultMap type="com.ruoyi.oa.domain.vo.SysOaWarehouseVo" id="SysOaWarehouseResult">
|
||||||
<result property="id" column="id"/>
|
<result property="id" column="id"/>
|
||||||
<result property="inventory" column="inventory"/>
|
<result property="inventory" column="inventory"/>
|
||||||
<result property="model" column="model"/>
|
<result property="model" column="model"/>
|
||||||
@@ -20,5 +20,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<result property="delFlag" column="del_flag"/>
|
<result property="delFlag" column="del_flag"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="selectVoByIdAndXml" resultMap="SysOaWarehouseResult" parameterType="Long">
|
||||||
|
select id, inventory, model, unit, name, brand, specifications, remark, create_time, create_by, update_time, update_by, del_flag from sys_oa_warehouse where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -65,8 +65,11 @@
|
|||||||
u.del_flag,
|
u.del_flag,
|
||||||
u.login_ip,
|
u.login_ip,
|
||||||
u.login_date,
|
u.login_date,
|
||||||
|
u.labor_cost,
|
||||||
u.create_by,
|
u.create_by,
|
||||||
u.create_time,
|
u.create_time,
|
||||||
|
u.bank_card,
|
||||||
|
u.id_card,
|
||||||
u.remark,
|
u.remark,
|
||||||
d.dept_id,
|
d.dept_id,
|
||||||
d.parent_id,
|
d.parent_id,
|
||||||
|
|||||||
@@ -9,6 +9,25 @@ export function listOaAttendance(query) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 查询人员考勤列表
|
||||||
|
export function workCalc(time) {
|
||||||
|
return request({
|
||||||
|
url: '/oa/oaAttendance/calc/'+time,
|
||||||
|
method: 'get',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 查询人员考勤列表
|
||||||
|
export function getDateLength() {
|
||||||
|
return request({
|
||||||
|
url: '/oa/oaAttendance/date',
|
||||||
|
method: 'get',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 查询人员考勤详细
|
// 查询人员考勤详细
|
||||||
export function getOaAttendance(id) {
|
export function getOaAttendance(id) {
|
||||||
return request({
|
return request({
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 142 KiB |
@@ -147,6 +147,7 @@ export const dynamicRoutes = [
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
path: '/system/dict-data',
|
path: '/system/dict-data',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
@@ -161,6 +162,21 @@ export const dynamicRoutes = [
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
path: '/oa/warehouse-data',
|
||||||
|
component: Layout,
|
||||||
|
hidden: true,
|
||||||
|
permissions: ['system:dict:list'],
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: 'index/:warehouseId(\\d+)',
|
||||||
|
component: () => import('@/views/oa/oaWarehouse/data'),
|
||||||
|
name: 'Data',
|
||||||
|
meta: { title: '出库数据', activeMenu: '/oa/oaWarehouse' }
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/remind',
|
path: '/remind',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
@@ -251,6 +267,20 @@ export const dynamicRoutes = [
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/project/closure',
|
||||||
|
component: Layout,
|
||||||
|
hidden: true,
|
||||||
|
permissions: ['workflow:process:query'],
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: 'detail/:projectId(\\d+)',
|
||||||
|
component: () => import('@/views/oa/closure/index'),
|
||||||
|
name: 'closure',
|
||||||
|
meta: { title: '项目结项', activeMenu: '/project/project' }
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
// 防止连续点击多次路由报错
|
// 防止连续点击多次路由报错
|
||||||
|
|||||||
@@ -7,34 +7,35 @@
|
|||||||
<el-col :span="16">
|
<el-col :span="16">
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<div @click="goTarget('work/create')" class="work">
|
<div @click="goTarget('project/project')" class="work">
|
||||||
<el-badge class="item-ico" type="warning">
|
<el-badge class="item-ico" type="warning">
|
||||||
<i class="el-icon-s-operation fz cl1"></i>
|
<i class="el-icon-s-operation fz cl1"></i>
|
||||||
<div size="small">流程发起</div>
|
<div size="small">项目管理</div>
|
||||||
</el-badge>
|
</el-badge>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<div @click="goTarget('work/own')" class="work">
|
<div @click="goTarget('produce/attendance')" class="work">
|
||||||
<el-badge :value="ownCount" class="item-ico" type="warning">
|
<!-- :value="ownCount" -->
|
||||||
|
<el-badge class="item-ico" type="warning">
|
||||||
<i class="el-icon-date fz cl2"></i>
|
<i class="el-icon-date fz cl2"></i>
|
||||||
<div size="small">我的流程</div>
|
<div size="small">人员考勤</div>
|
||||||
</el-badge>
|
</el-badge>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<div @click="goTarget('work/todo')" class="work">
|
<div @click="goTarget('notice/notice')" class="work">
|
||||||
<el-badge :value="todoListCount" class="item-ico" type="warning">
|
<el-badge class="item-ico" type="warning">
|
||||||
<i class="el-icon-chat-line-round fz cl3"></i>
|
<i class="el-icon-chat-line-round fz cl3"></i>
|
||||||
<div size="small">待办任务</div>
|
<div size="small">通知公告</div>
|
||||||
</el-badge>
|
</el-badge>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<div @click="goTarget('work/finished')" class="work">
|
<div @click="goTarget('finance/costing')" class="work">
|
||||||
<el-badge :value="finishedCount" class="item-ico" type="warning" v-on:click="goTarget('work/finished')">
|
<el-badge class="item-ico" type="warning" v-on:click="goTarget('finance/costing')">
|
||||||
<i class="el-icon-set-up fz cl4"></i>
|
<i class="el-icon-set-up fz cl4"></i>
|
||||||
<div size="small">已办任务</div>
|
<div size="small">财务管理</div>
|
||||||
</el-badge>
|
</el-badge>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th width="80"></th>
|
<th width="80"></th>
|
||||||
<th v-for="(item,index) in 31" :class="selectHead===index+1?'selectBox':''" @click="selectMany(index+1)">
|
<th v-for="(item,index) in dateLength" :class="selectHead===index+1?'selectBox':''" @click="selectMany(index+1)">
|
||||||
{{ index + 1 }}
|
{{ index + 1 }}
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<tr v-for="(item,index) in userList">
|
<tr v-for="(item,index) in userList">
|
||||||
<td :class="(item.userId===selectUser.userId || selectAll)?'selectBox':''">{{ item.nickName }}</td>
|
<td :class="(item.userId===selectUser.userId || selectAll)?'selectBox':''">{{ item.nickName }}</td>
|
||||||
<td v-for="(item2,index2) in 31" @click="selectAttendDay(item,index,index2+1)"
|
<td v-for="(item2,index2) in dateLength" @click="selectAttendDay(item,index,index2+1)"
|
||||||
:style="{backgroundColor:(item.attendances.length>0 && item.attendances.findIndex(i=>i.attendanceDay === index2+1) >-1) ?item.attendances[item.attendances.findIndex(i=>i.attendanceDay === index2+1)].color:(index2+1===selectIndex&&(item.userId===selectUser.userId || selectAll)?'#f3ff52':'')}"></td>
|
:style="{backgroundColor:(item.attendances.length>0 && item.attendances.findIndex(i=>i.attendanceDay === index2+1) >-1) ?item.attendances[item.attendances.findIndex(i=>i.attendanceDay === index2+1)].color:(index2+1===selectIndex&&(item.userId===selectUser.userId || selectAll)?'#f3ff52':'')}"></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
@@ -72,6 +72,152 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
|
<el-row :gutter="20" class="mb8">
|
||||||
|
<el-col :span="2">
|
||||||
|
|
||||||
|
|
||||||
|
<span class="demonstration">计算月份:</span>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<div class="block">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="date"
|
||||||
|
type="month"
|
||||||
|
placeholder="选择日期">
|
||||||
|
</el-date-picker>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
|
||||||
|
<el-button @click="calcWork">计算</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row :gutter="20" >
|
||||||
|
|
||||||
|
<el-table
|
||||||
|
:data="userList"
|
||||||
|
stripe
|
||||||
|
style="width: 60%">
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
type="index"
|
||||||
|
label="序号"
|
||||||
|
width="180">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="nickName"
|
||||||
|
label="员工姓名"
|
||||||
|
width="180">
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
|
<template slot-scope="scope" >
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
v-if="calcFlag"
|
||||||
|
@click="handleCalc(scope.row)"
|
||||||
|
v-hasPermi="['oa:oaWarehouse:edit']"
|
||||||
|
>查看考勤结果</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
v-else
|
||||||
|
disabled
|
||||||
|
icon="el-icon-edit"
|
||||||
|
@click="handleCalc(scope.row)"
|
||||||
|
v-hasPermi="['oa:oaWarehouse:edit']"
|
||||||
|
>请选择日期计算</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
|
||||||
|
<el-dialog
|
||||||
|
title="计算结果"
|
||||||
|
:visible.sync="showCalc"
|
||||||
|
width="70%"
|
||||||
|
>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<h1>员工个人财务与签到报告 - {{calcUser.nickName}}</h1>
|
||||||
|
|
||||||
|
<!-- 员工基本信息 -->
|
||||||
|
<div class="employee-info">
|
||||||
|
<p><strong>员工姓名:</strong> {{calcUser.nickName}}</p>
|
||||||
|
<p><strong>职位:</strong> 员工</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 月度工作情况表格 -->
|
||||||
|
<h2>{{date.getMonth()}} 月度工作签到情况</h2>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<el-descriptions class="margin-top" title="报告详情" :column="3" :size="size" border>
|
||||||
|
<template slot="extra">
|
||||||
|
<div>总工作时长(天):{{calcResultItem.workTimes}}</div>
|
||||||
|
</template>
|
||||||
|
<el-descriptions-item>
|
||||||
|
<template slot="label">
|
||||||
|
<i class="el-icon-user"></i>
|
||||||
|
员工姓名
|
||||||
|
</template>
|
||||||
|
{{calcUser.nickName}}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item>
|
||||||
|
<template slot="label">
|
||||||
|
<i class="el-icon-mobile-phone"></i>
|
||||||
|
人力成本
|
||||||
|
</template>
|
||||||
|
{{calcUser.laborCost}}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item>
|
||||||
|
<template slot="label">
|
||||||
|
|
||||||
|
当月估计(¥)
|
||||||
|
</template>
|
||||||
|
{{calcUser.laborCost*calcResultItem.workTimes}}
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
|
||||||
|
|
||||||
|
<el-table
|
||||||
|
:data="calcResultAttendances"
|
||||||
|
stripe
|
||||||
|
style="width: 100%">
|
||||||
|
<el-table-column
|
||||||
|
prop="projectName"
|
||||||
|
label="项目名"
|
||||||
|
width="180">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="count"
|
||||||
|
label="签到(天)"
|
||||||
|
width="180">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="workTimes"
|
||||||
|
label="工作时长(天)">
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="footer">
|
||||||
|
<p>© 2024 财务与签到报告 | 由公司财务部门生成</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="showCalc = false">关闭</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -80,7 +226,8 @@
|
|||||||
import {listWorker} from "@/api/system/user";
|
import {listWorker} from "@/api/system/user";
|
||||||
import {listProject, updateProject} from "@/api/oa/project";
|
import {listProject, updateProject} from "@/api/oa/project";
|
||||||
import {listOaAttendance} from "@/api/oa/oaAttendance";
|
import {listOaAttendance} from "@/api/oa/oaAttendance";
|
||||||
import {addBatchOaAttendance, addOaAttendance} from "../../../api/oa/oaAttendance";
|
import {addBatchOaAttendance, addOaAttendance, getDateLength, workCalc} from "../../../api/oa/oaAttendance";
|
||||||
|
import item from "../../../layout/components/Sidebar/Item.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Project",
|
name: "Project",
|
||||||
@@ -91,12 +238,19 @@ export default {
|
|||||||
selectIndex: new Date().getDate(),
|
selectIndex: new Date().getDate(),
|
||||||
// 用户列表
|
// 用户列表
|
||||||
userList: [],
|
userList: [],
|
||||||
|
// 计算结果
|
||||||
|
calcFlag:false,
|
||||||
// 项目列表
|
// 项目列表
|
||||||
projectList: [],
|
projectList: [],
|
||||||
loading: true,
|
loading: true,
|
||||||
selectHead: new Date().getDate(),
|
selectHead: new Date().getDate(),
|
||||||
|
// 当前月的天数
|
||||||
|
dateLength:31,
|
||||||
|
// 计算提交月份
|
||||||
|
date:new Date(),
|
||||||
// 提交表单
|
// 提交表单
|
||||||
form: {},
|
form: {},
|
||||||
|
showCalc:false,
|
||||||
// 查询参数
|
// 查询参数
|
||||||
userQueryParams: {
|
userQueryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
@@ -106,6 +260,8 @@ export default {
|
|||||||
status: undefined,
|
status: undefined,
|
||||||
deptId: undefined
|
deptId: undefined
|
||||||
},
|
},
|
||||||
|
calcUser:{
|
||||||
|
},
|
||||||
queryParams:{
|
queryParams:{
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 50,
|
pageSize: 50,
|
||||||
@@ -116,6 +272,7 @@ export default {
|
|||||||
projectQueryParams: {
|
projectQueryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
projectStatus:0,
|
||||||
projectName: undefined,
|
projectName: undefined,
|
||||||
projectNum: undefined,
|
projectNum: undefined,
|
||||||
beginTime: undefined,
|
beginTime: undefined,
|
||||||
@@ -125,17 +282,48 @@ export default {
|
|||||||
// 日期范围
|
// 日期范围
|
||||||
dateRange: [],
|
dateRange: [],
|
||||||
selectAll: true,
|
selectAll: true,
|
||||||
|
calcResult:[],
|
||||||
|
calcResultItem:{},
|
||||||
|
calcResultUser:{},
|
||||||
|
calcResultAttendances:[],
|
||||||
|
calcResultProject:{},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
const day = new Date().getDate();
|
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
this.getDate();
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
|
// 查看计算结果
|
||||||
|
handleCalc(row){
|
||||||
|
this.showCalc = true;
|
||||||
|
this.calcUser = row
|
||||||
|
|
||||||
|
this.calcResultItem = this.calcResult.filter(item=>item.sysUser.userId===this.calcUser.userId)[0]
|
||||||
|
this.calcResultAttendances = this.calcResultItem.attendances
|
||||||
|
console.log(this.calcResultItem)
|
||||||
|
},
|
||||||
|
|
||||||
|
// 计算
|
||||||
|
calcWork(){
|
||||||
|
|
||||||
|
workCalc(this.date).then(res=>{
|
||||||
|
this.calcResult = res.data;
|
||||||
|
this.calcFlag = true;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
getDate(){
|
||||||
|
getDateLength().then(res => {
|
||||||
|
this.dateLength = res.data;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
selectAttendDay(item,index, index2) {
|
selectAttendDay(item,index, index2) {
|
||||||
this.selectIndex = index2;
|
this.selectIndex = index2;
|
||||||
this.selectAll = false;
|
this.selectAll = false;
|
||||||
@@ -153,7 +341,6 @@ export default {
|
|||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listOaAttendance(this.queryParams).then(res=>{
|
listOaAttendance(this.queryParams).then(res=>{
|
||||||
console.log(res.data)
|
|
||||||
this.userList = res.data;
|
this.userList = res.data;
|
||||||
this.total = res.total;
|
this.total = res.total;
|
||||||
});
|
});
|
||||||
|
|||||||
160
ruoyi-ui/src/views/oa/closure/index.vue
Normal file
160
ruoyi-ui/src/views/oa/closure/index.vue
Normal file
@@ -0,0 +1,160 @@
|
|||||||
|
<template>
|
||||||
|
<div class="container">
|
||||||
|
<h1>项目结项报告</h1>
|
||||||
|
<p><strong>项目名称:</strong> {{ project.projectName }}</p>
|
||||||
|
<p><strong>项目总成本:</strong> ¥{{ project.funds }}</p>
|
||||||
|
<p><strong>项目用时:</strong> {{ (new Date(project.postponeTime)-new Date(project.beginTime))/1000/60/60/24 }}天</p>
|
||||||
|
|
||||||
|
<div v-for="(item,index) in stepsList" :key="index">
|
||||||
|
<h2>{{item.dictLabel}}-人员情况</h2>
|
||||||
|
<div v-for="(task,index) in item.taskList" :key="index">
|
||||||
|
<h3>负责人-{{task.collaborator}}</h3>
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<th>姓名</th>
|
||||||
|
|
||||||
|
<th>工作时长 (天)</th>
|
||||||
|
<th>人力成本 (元/天)</th>
|
||||||
|
<th>总成本 (元)</th>
|
||||||
|
</tr>
|
||||||
|
<tr v-for="member in task.workerList" :key="member.name">
|
||||||
|
<td>{{ member.nickName }}</td>
|
||||||
|
|
||||||
|
<td>{{ member.workTime }}</td>
|
||||||
|
<td>{{ member.laborCost }}</td>
|
||||||
|
<td>{{ (member.workTime * member.laborCost).toLocaleString() }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr class="summary">
|
||||||
|
<td colspan="3">总计</td>
|
||||||
|
<td>¥{{ task.projectCostTotal }}</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="footer">
|
||||||
|
<p>© 2024 项目结项报告 | 由项目团队生成</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
import {getProject} from "@/api/oa/project";
|
||||||
|
import {getTaskByDictType} from "@/api/oa/task";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "closure",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 项目名
|
||||||
|
projectName: "AI 数据分析系统开发",
|
||||||
|
|
||||||
|
// 项目涉及人员
|
||||||
|
teamMembers: [
|
||||||
|
{name: '李某某', role: '项目经理', hours: 160, rate: 300, completed: '已完成'},
|
||||||
|
{name: '王某', role: '前端开发', hours: 150, rate: 250, completed: '已完成'},
|
||||||
|
{name: '张某', role: '后端开发', hours: 170, rate: 280, completed: '进行中'},
|
||||||
|
{name: '陈某', role: '测试工程师', hours: 140, rate: 220, completed: '已完成'},
|
||||||
|
{name: '赵某', role: '产品经理', hours: 130, rate: 350, completed: '已完成'}
|
||||||
|
],
|
||||||
|
|
||||||
|
// 项目花费
|
||||||
|
projectCost: 990000,
|
||||||
|
totalHumanCost: 10000,
|
||||||
|
project:{},
|
||||||
|
stepsList:[],
|
||||||
|
active:{}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
|
||||||
|
this.projectId = this.$route.params.projectId;
|
||||||
|
|
||||||
|
this.getProject()
|
||||||
|
this.getTaskByDictType(this.projectId);
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
getProject(){
|
||||||
|
getProject(this.projectId).then(response => {
|
||||||
|
this.project = response.data;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/**new-工作类型进度**/
|
||||||
|
getTaskByDictType(pid) {
|
||||||
|
getTaskByDictType(pid).then(res => {
|
||||||
|
//排序
|
||||||
|
this.stepsList = res.data.data.taskList.sort((a, b) => parseInt(a.dictValue) - parseInt(b.dictValue));
|
||||||
|
this.active = res.data.data.active;
|
||||||
|
console.log(this.stepsList)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
* {
|
||||||
|
margin: 15px auto;
|
||||||
|
padding: 0;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
font-family: Arial, sans-serif;
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
max-width: 800px;
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 8px;
|
||||||
|
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
||||||
|
padding: 20px;
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
text-align: center;
|
||||||
|
color: #333;
|
||||||
|
margin-bottom: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
table {
|
||||||
|
width: 100%;
|
||||||
|
border-collapse: collapse;
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
th, td {
|
||||||
|
padding: 12px;
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
th {
|
||||||
|
background-color: #007bff;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
tr:nth-child(even) {
|
||||||
|
background-color: #f9f9f9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.summary {
|
||||||
|
font-weight: bold;
|
||||||
|
color: #007bff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer {
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 30px;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -53,20 +53,35 @@
|
|||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="projectList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="outWareHouseList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" align="center"/>
|
<el-table-column type="selection" width="55" align="center"/>
|
||||||
<el-table-column label="序号" align="center" type="index"/>
|
<el-table-column label="序号" align="center" type="index"/>
|
||||||
<el-table-column label="项目名" align="center" prop="projectName"/>
|
<el-table-column label="出库单" align="center" prop="id"/>
|
||||||
<el-table-column label="创建时间" align="center" prop="createtime"/>
|
<el-table-column label="物料名" align="center" prop="warehouseName"/>
|
||||||
|
<el-table-column label="出库数量" align="center" prop="amount"/>
|
||||||
|
<el-table-column label="关联项目" align="center" prop="projectName">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div v-if="scope.row.projectName!==null">
|
||||||
|
<el-tooltip class="item" effect="dark" content="点击查看该项目出库情况" placement="bottom">
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
@click="handleSearch(scope.row)"
|
||||||
|
> {{ scope.row.projectName }}
|
||||||
|
</el-button>
|
||||||
|
</el-tooltip>
|
||||||
|
</div>
|
||||||
|
<div v-else>未关联项目</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="出库时间" align="center" prop="createTime"/>
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-search"
|
icon="el-icon-search"
|
||||||
@click="handleSearch(scope.row)"
|
@click="showDetail(scope.row)"
|
||||||
v-hasPermi="['oa:oaOutWarehouse:remove']"
|
|
||||||
>查看详情
|
>查看详情
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
@@ -81,10 +96,128 @@
|
|||||||
@pagination="getList"
|
@pagination="getList"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 详情描述弹窗 -->
|
||||||
|
<el-dialog title="出库物料详情" :visible.sync="detail" width="800px" append-to-body>
|
||||||
|
|
||||||
|
<!-- 物料数据 -->
|
||||||
|
<el-descriptions class="margin-top" title="物料数据" :column="3" border>
|
||||||
|
<el-descriptions-item>
|
||||||
|
<template slot="label">
|
||||||
|
<i class="el-icon-s-order"></i>
|
||||||
|
出库单
|
||||||
|
</template>
|
||||||
|
{{outDetail.id}}
|
||||||
|
</el-descriptions-item>
|
||||||
|
|
||||||
|
<el-descriptions-item>
|
||||||
|
<template slot="label">
|
||||||
|
<i class="el-icon-postcard"></i>
|
||||||
|
出库数量({{warehouseDetail.unit}})
|
||||||
|
</template>
|
||||||
|
{{ outDetail.amount }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
|
||||||
|
<el-descriptions-item>
|
||||||
|
<template slot="label">
|
||||||
|
<i class="el-icon-collection"></i>
|
||||||
|
物料名
|
||||||
|
</template>
|
||||||
|
{{ warehouseDetail.name }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
|
||||||
|
<el-descriptions-item>
|
||||||
|
<template slot="label">
|
||||||
|
<i class="el-icon-user"></i>
|
||||||
|
操作人
|
||||||
|
</template>
|
||||||
|
{{ outDetail.createBy }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
|
||||||
|
<el-descriptions-item>
|
||||||
|
<template slot="label">
|
||||||
|
<i class="el-icon-date"></i>
|
||||||
|
出库时间
|
||||||
|
</template>
|
||||||
|
{{ outDetail.createTime }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
|
||||||
|
<el-descriptions-item>
|
||||||
|
<template slot="label">
|
||||||
|
<i class="el-icon-collection"></i>
|
||||||
|
关联项目
|
||||||
|
</template>
|
||||||
|
{{projectDetail==null?'未关联项目':projectDetail.projectName}}
|
||||||
|
</el-descriptions-item>
|
||||||
|
|
||||||
|
<el-descriptions-item>
|
||||||
|
<template slot="label">
|
||||||
|
<i class="el-icon-tickets"></i>
|
||||||
|
备注
|
||||||
|
</template>
|
||||||
|
{{outDetail.remark==null?'空':outDetail.remark}}
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
|
||||||
|
<!-- 项目数据 如果有的话显示 -->
|
||||||
|
<el-descriptions v-if="projectDetail!==null" class="margin-top" title="项目数据" :column="3" border>
|
||||||
|
|
||||||
|
<el-descriptions-item>
|
||||||
|
<template slot="label">
|
||||||
|
<i class="el-icon-s-order"></i>
|
||||||
|
项目编号
|
||||||
|
</template>
|
||||||
|
{{ projectDetail.projectNum }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
|
||||||
|
<el-descriptions-item>
|
||||||
|
<template slot="label">
|
||||||
|
<i class="el-icon-s-flag"></i>
|
||||||
|
项目名
|
||||||
|
</template>
|
||||||
|
{{outDetail.id}}
|
||||||
|
</el-descriptions-item>
|
||||||
|
|
||||||
|
<el-descriptions-item>
|
||||||
|
<template slot="label">
|
||||||
|
<i class="el-icon-s-opportunity"></i>
|
||||||
|
项目状态
|
||||||
|
</template>
|
||||||
|
<el-tag> {{projectDetail.projectStatus==0?'未完结':'结项'}} </el-tag>
|
||||||
|
</el-descriptions-item>
|
||||||
|
|
||||||
|
<el-descriptions-item>
|
||||||
|
<template slot="label">
|
||||||
|
<i class="el-icon-tickets"></i>
|
||||||
|
备注
|
||||||
|
</template>
|
||||||
|
{{projectDetail.remark==null?'空':projectDetail.remark}}
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="detail = false">关闭</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- 添加或修改仓库出库对话框 -->
|
<!-- 添加或修改仓库出库对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
|
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
|
|
||||||
|
|
||||||
<el-form-item
|
<el-form-item
|
||||||
|
label="绑定项目"
|
||||||
|
|
||||||
|
>
|
||||||
|
<el-radio-group v-model="projectFlag">
|
||||||
|
<el-radio :label="true">是</el-radio>
|
||||||
|
<el-radio :label="false">否</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item
|
||||||
|
v-if="projectFlag"
|
||||||
prop="projectId"
|
prop="projectId"
|
||||||
label="项目名"
|
label="项目名"
|
||||||
>
|
>
|
||||||
@@ -98,6 +231,19 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item
|
||||||
|
v-else
|
||||||
|
prop="remark"
|
||||||
|
label="备注"
|
||||||
|
>
|
||||||
|
<el-input
|
||||||
|
type="textarea"
|
||||||
|
:autosize="{ minRows: 2, maxRows: 4}"
|
||||||
|
placeholder="请输入内容"
|
||||||
|
v-model="form.remark">
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item
|
<el-form-item
|
||||||
v-for="(item, index) in form.outWareHouseList"
|
v-for="(item, index) in form.outWareHouseList"
|
||||||
:label="'出库物料' + index"
|
:label="'出库物料' + index"
|
||||||
@@ -132,7 +278,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="4">
|
<el-col :span="4">
|
||||||
<el-tag type="info" v-if="item.inventory===undefined">请选择物料</el-tag>
|
<el-tag type="info" v-if="item.inventory===undefined">请选择物料</el-tag>
|
||||||
<el-tag type="info" v-else>{{item.inventory}}</el-tag>
|
<el-tag type="info" v-else>{{ item.inventory }}</el-tag>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-input-number v-model="item.amount" :min="1" :max="item.inventory"></el-input-number>
|
<el-input-number v-model="item.amount" :min="1" :max="item.inventory"></el-input-number>
|
||||||
@@ -187,7 +333,7 @@
|
|||||||
<el-table v-loading="loading" :data="oaOutWarehouseList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="oaOutWarehouseList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" align="center"/>
|
<el-table-column type="selection" width="55" align="center"/>
|
||||||
<el-table-column label="序号" align="center" type="index"/>
|
<el-table-column label="序号" align="center" type="index"/>
|
||||||
<el-table-column label="物料名" align="center" prop="warehouseName"/>
|
<el-table-column label="出库单" align="center" prop="id"/>
|
||||||
<el-table-column label="出库数量" align="center" prop="amount"/>
|
<el-table-column label="出库数量" align="center" prop="amount"/>
|
||||||
<el-table-column label="出库时间" align="center" prop="createTime"/>
|
<el-table-column label="出库时间" align="center" prop="createTime"/>
|
||||||
<el-table-column label="备注" align="center" prop="remark"/>
|
<el-table-column label="备注" align="center" prop="remark"/>
|
||||||
@@ -229,7 +375,16 @@ export default {
|
|||||||
return {
|
return {
|
||||||
// 抽屉
|
// 抽屉
|
||||||
drawer: false,
|
drawer: false,
|
||||||
|
// 查看详情弹窗
|
||||||
|
outDetail:{},
|
||||||
|
// 弹窗标志
|
||||||
|
detail:false,
|
||||||
|
// 绑定项目详情
|
||||||
|
projectDetail:{},
|
||||||
|
// 物料信息详情
|
||||||
|
warehouseDetail:{},
|
||||||
|
// 出库列表
|
||||||
|
outWareHouseList: [],
|
||||||
// 按钮loading
|
// 按钮loading
|
||||||
buttonLoading: false,
|
buttonLoading: false,
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
@@ -254,8 +409,11 @@ export default {
|
|||||||
title: "",
|
title: "",
|
||||||
// 选择对象
|
// 选择对象
|
||||||
searchItem: {},
|
searchItem: {},
|
||||||
|
|
||||||
// 是否显示弹出层
|
// 是否显示弹出层
|
||||||
open: false,
|
open: false,
|
||||||
|
// 是否绑定项目
|
||||||
|
projectFlag: false,
|
||||||
// 库存查询参数
|
// 库存查询参数
|
||||||
warehouseParams: {
|
warehouseParams: {
|
||||||
pageSize: 999,
|
pageSize: 999,
|
||||||
@@ -264,11 +422,12 @@ export default {
|
|||||||
// 查询参数
|
// 查询参数
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10
|
||||||
projectName: undefined,
|
|
||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {
|
||||||
|
productId: ''
|
||||||
|
},
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
amount: [
|
amount: [
|
||||||
@@ -287,10 +446,15 @@ export default {
|
|||||||
/** 查询仓库出库列表 */
|
/** 查询仓库出库列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
|
||||||
|
listOaOutWarehouse(this.queryParams).then(res => {
|
||||||
|
this.outWareHouseList = res.rows
|
||||||
|
this.total = res.total
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
|
|
||||||
listProject(this.queryParams).then(response => {
|
listProject(this.queryParams).then(response => {
|
||||||
this.projectList = response.rows
|
this.projectList = response.rows
|
||||||
this.total = response.total;
|
|
||||||
this.loading = false;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
@@ -400,6 +564,7 @@ export default {
|
|||||||
addDomain() {
|
addDomain() {
|
||||||
this.form.outWareHouseList.push({
|
this.form.outWareHouseList.push({
|
||||||
value: '',
|
value: '',
|
||||||
|
warehouseId: '',
|
||||||
key: Date.now()
|
key: Date.now()
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -410,8 +575,8 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
handleGetInventory(e,index){
|
handleGetInventory(e, index) {
|
||||||
this.form.outWareHouseList[index].inventory = this.oaWarehouseList[this.oaWarehouseList.findIndex(item=>item.id===e)].inventory
|
this.form.outWareHouseList[index].inventory = this.oaWarehouseList[this.oaWarehouseList.findIndex(item => item.id === e)].inventory
|
||||||
console.log(this.form.outWareHouseList[index])
|
console.log(this.form.outWareHouseList[index])
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -432,6 +597,12 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getOaOutWarehouseList(){
|
||||||
|
listOaWarehouse(this.warehouseParams).then(res => {
|
||||||
|
this.oaWarehouseList = res.rows
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
remoteMethod(query) {
|
remoteMethod(query) {
|
||||||
this.warehouseParams.name = query
|
this.warehouseParams.name = query
|
||||||
this.selectLoading = true;
|
this.selectLoading = true;
|
||||||
@@ -454,6 +625,19 @@ export default {
|
|||||||
this.drawer = true;
|
this.drawer = true;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 查看出库单独条目详情
|
||||||
|
showDetail(row){
|
||||||
|
getOaOutWarehouse(row.id).then(response => {
|
||||||
|
console.log(response.data);
|
||||||
|
this.outDetail = response.data;
|
||||||
|
|
||||||
|
this.projectDetail = response.data.project;
|
||||||
|
this.warehouseDetail = response.data.warehouse;
|
||||||
|
})
|
||||||
|
this.detail=true;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
180
ruoyi-ui/src/views/oa/oaWarehouse/data.vue
Normal file
180
ruoyi-ui/src/views/oa/oaWarehouse/data.vue
Normal file
@@ -0,0 +1,180 @@
|
|||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-row :gutter="20" class="mb8">
|
||||||
|
|
||||||
|
<el-col >
|
||||||
|
<el-card class="box-card">
|
||||||
|
<!-- <div slot="header" class="clearfix">-->
|
||||||
|
<!-- <span>卡片名称</span>-->
|
||||||
|
<!-- <el-button style="float: right; padding: 3px 0" type="text">操作按钮</el-button>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<div class="text item">
|
||||||
|
物料:<strong>{{warehouse.name}}</strong>
|
||||||
|
的出库详情
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
@click="handleAdd"
|
||||||
|
v-hasPermi="['oa:oaOutWarehouse:add']"
|
||||||
|
>新增
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
plain
|
||||||
|
icon="el-icon-delete"
|
||||||
|
size="mini"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleDelete"
|
||||||
|
v-hasPermi="['oa:oaOutWarehouse:remove']"
|
||||||
|
>删除
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="warning"
|
||||||
|
plain
|
||||||
|
icon="el-icon-download"
|
||||||
|
size="mini"
|
||||||
|
@click="handleExport"
|
||||||
|
v-hasPermi="['oa:oaOutWarehouse:export']"
|
||||||
|
>导出
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="outWarehouseList" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" align="center"/>
|
||||||
|
<el-table-column label="序号" align="center" type="index"/>
|
||||||
|
<el-table-column label="出库单" align="center" prop="id"/>
|
||||||
|
<el-table-column :label="'出库数量('+warehouse.unit+')'" align="center" prop="amount"/>
|
||||||
|
<el-table-column label="出库时间" align="center" prop="createTime"/>
|
||||||
|
<el-table-column label="关联项目" align="center" prop="projectName"/>
|
||||||
|
<el-table-column label="备注" align="center" prop="remark"/>
|
||||||
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-search"
|
||||||
|
@click="handleSearch(scope.row)"
|
||||||
|
v-hasPermi="['oa:oaOutWarehouse:remove']"
|
||||||
|
>查看详情
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="total>0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageNum"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<el-drawer
|
||||||
|
size="70%"
|
||||||
|
title="我是标题"
|
||||||
|
:visible.sync="drawer"
|
||||||
|
:with-header="false">
|
||||||
|
<el-button
|
||||||
|
style="margin: 25px"
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
@click="handleAdd"
|
||||||
|
v-hasPermi="['oa:oaOutWarehouse:add']"
|
||||||
|
>新增
|
||||||
|
</el-button>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="outWarehouseList" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" align="center"/>
|
||||||
|
<el-table-column label="序号" align="center" type="index"/>
|
||||||
|
<el-table-column label="物料名" align="center" prop="warehouseName"/>
|
||||||
|
<el-table-column label="出库数量" align="center" prop="amount"/>
|
||||||
|
<el-table-column label="出库时间" align="center" prop="createTime"/>
|
||||||
|
<el-table-column label="备注" align="center" prop="remark"/>
|
||||||
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['oa:oaOutWarehouse:remove']"
|
||||||
|
>删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
</el-drawer>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import {listOaOutWarehouse} from "@/api/oa/oaOutWarehouse";
|
||||||
|
import {getOaWarehouse} from "@/api/oa/oaWarehouse";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "data",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 出库列表
|
||||||
|
outWarehouseList: [],
|
||||||
|
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
warehouseId: this.$route.params.warehouseId,
|
||||||
|
},
|
||||||
|
|
||||||
|
// 物料信息
|
||||||
|
warehouse:{},
|
||||||
|
|
||||||
|
// 加载
|
||||||
|
loading:false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getWarehouse();
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
|
||||||
|
getWarehouse() {
|
||||||
|
getOaWarehouse(this.queryParams.warehouseId).then(res => {
|
||||||
|
this.warehouse = res.data;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 获取列表
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
listOaOutWarehouse(this.queryParams).then(res => {
|
||||||
|
this.outWarehouseList = res.rows;
|
||||||
|
this.total = res.total;
|
||||||
|
this.loading = false;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -91,7 +91,16 @@
|
|||||||
<el-table v-loading="loading" :data="oaWarehouseList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="oaWarehouseList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="序号" align="center" type="index"/>
|
<el-table-column label="序号" align="center" type="index"/>
|
||||||
<el-table-column label="物料名称" align="center" prop="name" />
|
<el-table-column label="物料" align="center" prop="name" :show-overflow-tooltip="true">
|
||||||
|
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<router-link :to="'/oa/warehouse-data/index/' + scope.row.id" class="link-type">
|
||||||
|
<span>{{ scope.row.name }}</span>
|
||||||
|
</router-link>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="型号" align="center" prop="model" />
|
<el-table-column label="型号" align="center" prop="model" />
|
||||||
<el-table-column label="库存数量" align="center" prop="inventory" />
|
<el-table-column label="库存数量" align="center" prop="inventory" />
|
||||||
<el-table-column label="单位" align="center" prop="unit" />
|
<el-table-column label="单位" align="center" prop="unit" />
|
||||||
|
|||||||
@@ -166,11 +166,22 @@
|
|||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
|
v-if="scope.row.projectStatus === '0'"
|
||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
@click="handleUpdate(scope.row)"
|
@click="handleUpdate(scope.row)"
|
||||||
v-hasPermi="['oa:project:edit']"
|
v-hasPermi="['oa:project:edit']"
|
||||||
>实施
|
>实施
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
v-if="scope.row.projectStatus === '0'"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
@click="handleClosure(scope.row)"
|
||||||
|
v-hasPermi="['oa:project:edit']"
|
||||||
|
>结项
|
||||||
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
@@ -1757,6 +1768,14 @@ export default {
|
|||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/** 前往结项页面 */
|
||||||
|
handleClosure(row){
|
||||||
|
const projectId = row.projectId;
|
||||||
|
// 前往项目结项报告
|
||||||
|
this.$router.push('/project/closure/detail/'+projectId)
|
||||||
|
|
||||||
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
handleExport() {
|
handleExport() {
|
||||||
this.download('oa/project/export', {
|
this.download('oa/project/export', {
|
||||||
@@ -1769,7 +1788,6 @@ export default {
|
|||||||
if (query !== '') {
|
if (query !== '') {
|
||||||
this.queryLoading = true;
|
this.queryLoading = true;
|
||||||
listWorker().then(res=>{
|
listWorker().then(res=>{
|
||||||
console.log(res.rows)
|
|
||||||
this.workerList = res.rows.filter(item => {
|
this.workerList = res.rows.filter(item => {
|
||||||
return item.nickName.toLowerCase()
|
return item.nickName.toLowerCase()
|
||||||
.indexOf(query.toLowerCase()) > -1;
|
.indexOf(query.toLowerCase()) > -1;
|
||||||
|
|||||||
Reference in New Issue
Block a user