流程+任务分发+报销功能完成
This commit is contained in:
@@ -69,6 +69,18 @@ public class SysOaClaimController extends BaseController {
|
||||
return R.ok(iSysOaClaimService.queryById(claimId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过实例id查询报销表单
|
||||
*
|
||||
* @param procInsId 主键
|
||||
*/
|
||||
@SaCheckPermission("system:oaClaim:query")
|
||||
@GetMapping("/process/{procInsId}")
|
||||
public R<SysOaClaimVo> getInfoByProcInsId(@NotNull(message = "主键不能为空")
|
||||
@PathVariable String procInsId) {
|
||||
return R.ok(iSysOaClaimService.queryByProcInsId(procInsId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增差旅费报销
|
||||
*/
|
||||
|
||||
@@ -21,6 +21,7 @@ import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -211,11 +212,11 @@ public class WfProcessController extends BaseController {
|
||||
/**
|
||||
* 根据流程定义id启动流程实例
|
||||
*
|
||||
* @param variables 变量集合,json对象
|
||||
*/
|
||||
@SaCheckPermission("workflow:process:start")
|
||||
@PostMapping("/startClaim")
|
||||
public R<String> startClaim(@RequestBody Map<String, Object> variables) {
|
||||
public R<String> startClaim() {
|
||||
Map<String, Object> variables = new HashMap<String, Object>();
|
||||
String procInsId = processService.startClaim(variables);
|
||||
return R.ok("流程启动成功",procInsId);
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ ruoyi:
|
||||
# 缓存懒加载
|
||||
cacheLazy: false
|
||||
# 文件路径
|
||||
profile: /home/wangyu/oa/uploadPath
|
||||
profile: F:\work\fad_oa系统\fad_oa\temp
|
||||
|
||||
captcha:
|
||||
# 页面 <参数设置> 可开启关闭 验证码校验
|
||||
|
||||
@@ -41,9 +41,13 @@ public class RuoYiConfig {
|
||||
*/
|
||||
private boolean cacheLazy;
|
||||
|
||||
// /** 上传路径 */
|
||||
// @Getter
|
||||
// private static String profile = "/home/wangyu/oa/uploadPath";
|
||||
|
||||
/** 上传路径 */
|
||||
@Getter
|
||||
private static String profile = "/home/wangyu/oa/uploadPath";
|
||||
private static String profile = "F:\\work\\fad_oa系统\\fad_oa\\temp";
|
||||
|
||||
/**
|
||||
* 获取地址开关
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
package com.ruoyi.oa.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* 差旅费报销对象 sys_oa_claim
|
||||
@@ -41,10 +43,14 @@ public class SysOaClaim extends BaseEntity {
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date startTime;
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date endTime;
|
||||
/**
|
||||
* 出差天数
|
||||
@@ -74,6 +80,12 @@ public class SysOaClaim extends BaseEntity {
|
||||
/**
|
||||
* 报销时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date completedTime;
|
||||
/**
|
||||
* 出差地点
|
||||
*/
|
||||
private String address;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
package com.ruoyi.oa.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* 报销明细对象 sys_oa_claim_detail
|
||||
@@ -37,10 +39,14 @@ public class SysOaClaimDetail extends BaseEntity {
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date beginTime;
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date endTime;
|
||||
/**
|
||||
* 入住地点
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package com.ruoyi.oa.domain.bo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.core.validate.AddGroup;
|
||||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
import com.ruoyi.oa.domain.SysOaClaimDetail;
|
||||
import com.ruoyi.oa.domain.SysOaFile;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import javax.validation.constraints.*;
|
||||
@@ -11,6 +13,7 @@ import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* 差旅费报销业务对象 sys_oa_claim
|
||||
@@ -46,11 +49,15 @@ public class SysOaClaimBo extends BaseEntity {
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date endTime;
|
||||
|
||||
/**
|
||||
@@ -72,6 +79,10 @@ public class SysOaClaimBo extends BaseEntity {
|
||||
* 关联项目
|
||||
*/
|
||||
private Long projectId;
|
||||
/**
|
||||
* 关联项目
|
||||
*/
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 关联流程id
|
||||
@@ -81,6 +92,8 @@ public class SysOaClaimBo extends BaseEntity {
|
||||
/**
|
||||
* 报销时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date completedTime;
|
||||
|
||||
/**
|
||||
@@ -88,5 +101,10 @@ public class SysOaClaimBo extends BaseEntity {
|
||||
*/
|
||||
private List<SysOaClaimDetailBo> claimDetailList;
|
||||
|
||||
/**
|
||||
* 文件列表
|
||||
*/
|
||||
private List<SysOaFileBo> fileList;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.ruoyi.oa.domain.bo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.core.validate.AddGroup;
|
||||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
import lombok.Data;
|
||||
@@ -9,6 +10,7 @@ import javax.validation.constraints.*;
|
||||
import java.util.Date;
|
||||
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* 报销明细业务对象 sys_oa_claim_detail
|
||||
@@ -24,61 +26,55 @@ public class SysOaClaimDetailBo extends BaseEntity {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@NotNull(message = "主键id不能为空", groups = { EditGroup.class })
|
||||
private Long claimDetailId;
|
||||
|
||||
/**
|
||||
* 外键id
|
||||
*/
|
||||
@NotNull(message = "外键id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long claimId;
|
||||
|
||||
/**
|
||||
* 报销类型
|
||||
*/
|
||||
@NotNull(message = "报销类型不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long claimType;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@NotNull(message = "开始时间不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date beginTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@NotNull(message = "结束时间不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date endTime;
|
||||
|
||||
/**
|
||||
* 入住地点
|
||||
*/
|
||||
@NotBlank(message = "入住地点不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String lodgingAddress;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@NotBlank(message = "备注不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 文件id列表
|
||||
*/
|
||||
@NotBlank(message = "文件id列表不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String fileIds;
|
||||
|
||||
/**
|
||||
* 报销金额
|
||||
*/
|
||||
@NotNull(message = "报销金额不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Double cost;
|
||||
|
||||
/**
|
||||
* 报销金额大写
|
||||
*/
|
||||
@NotBlank(message = "报销金额大写不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String bigCost;
|
||||
|
||||
|
||||
|
||||
@@ -26,25 +26,21 @@ public class SysOaFileBo extends BaseEntity {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@NotNull(message = "主键id不能为空", groups = { EditGroup.class })
|
||||
private Long fileId;
|
||||
|
||||
/**
|
||||
* 文件存储路径
|
||||
*/
|
||||
@NotBlank(message = "文件存储路径不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String fileUrl;
|
||||
|
||||
/**
|
||||
* 文件类型0打卡1出入库
|
||||
*/
|
||||
@NotNull(message = "文件类型0打卡1出入库不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long status;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@NotBlank(message = "备注不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String remark;
|
||||
|
||||
|
||||
|
||||
@@ -4,9 +4,11 @@ import java.util.Date;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.annotation.ExcelDictFormat;
|
||||
import com.ruoyi.common.convert.ExcelDictConvert;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
|
||||
/**
|
||||
@@ -43,12 +45,16 @@ public class SysOaClaimDetailVo {
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@ExcelProperty(value = "开始时间")
|
||||
private Date beginTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@ExcelProperty(value = "结束时间")
|
||||
private Date endTime;
|
||||
|
||||
|
||||
@@ -5,9 +5,11 @@ import java.util.List;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.oa.domain.SysOaClaim;
|
||||
import com.ruoyi.oa.domain.SysOaFile;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
|
||||
/**
|
||||
@@ -49,12 +51,16 @@ public class SysOaClaimVo extends SysOaClaim {
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@ExcelProperty(value = "开始时间")
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@ExcelProperty(value = "结束时间")
|
||||
private Date endTime;
|
||||
|
||||
@@ -91,6 +97,8 @@ public class SysOaClaimVo extends SysOaClaim {
|
||||
/**
|
||||
* 报销时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@ExcelProperty(value = "报销时间")
|
||||
private Date completedTime;
|
||||
|
||||
@@ -109,4 +117,13 @@ public class SysOaClaimVo extends SysOaClaim {
|
||||
*/
|
||||
private Long status;
|
||||
|
||||
/**
|
||||
* 关联项目
|
||||
*/
|
||||
private String projectName;
|
||||
/**
|
||||
* 出差地点
|
||||
*/
|
||||
private String address;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
package com.ruoyi.oa.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.oa.domain.SysOaClaim;
|
||||
import com.ruoyi.oa.domain.vo.SysOaClaimVo;
|
||||
import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 差旅费报销Mapper接口
|
||||
@@ -16,5 +20,7 @@ public interface SysOaClaimMapper extends BaseMapperPlus<SysOaClaimMapper, SysOa
|
||||
|
||||
SysOaClaimVo selectSysOaClaimVoById(Long claimId);
|
||||
|
||||
Page<SysOaClaimVo> selectPageVo(Page<Object> build, LambdaQueryWrapper<SysOaClaim> lqw);
|
||||
Page<SysOaClaimVo> selectPageVo(Page<Object> build, @Param(Constants.WRAPPER) Wrapper<SysOaClaim> lqw);
|
||||
|
||||
SysOaClaimVo selectSysOaClaimVoByProcInsId(String procInsId);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.ruoyi.oa.domain.bo.SysOaClaimBo;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@@ -45,4 +46,11 @@ public interface ISysOaClaimService {
|
||||
* 校验并批量删除差旅费报销信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* 查询报销表单
|
||||
* @param procInsId 实例id
|
||||
* @return vo对象
|
||||
*/
|
||||
SysOaClaimVo queryByProcInsId(String procInsId);
|
||||
}
|
||||
|
||||
@@ -46,4 +46,6 @@ public interface ISysOaFileService {
|
||||
* 校验并批量删除文件存储信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
Long insertByBoReturnId(SysOaFileBo bo);
|
||||
}
|
||||
|
||||
@@ -8,9 +8,10 @@ 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 com.ruoyi.oa.domain.SysOaClaimDetail;
|
||||
import com.ruoyi.oa.domain.bo.SysOaClaimDetailBo;
|
||||
import com.ruoyi.oa.domain.bo.SysOaFileBo;
|
||||
import com.ruoyi.oa.service.ISysOaClaimDetailService;
|
||||
import com.ruoyi.oa.service.ISysOaFileService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -20,6 +21,8 @@ import com.ruoyi.oa.domain.SysOaClaim;
|
||||
import com.ruoyi.oa.mapper.SysOaClaimMapper;
|
||||
import com.ruoyi.oa.service.ISysOaClaimService;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
@@ -39,6 +42,9 @@ public class SysOaClaimServiceImpl implements ISysOaClaimService {
|
||||
@Autowired
|
||||
private ISysOaClaimDetailService sysOaClaimDetailService;
|
||||
|
||||
@Autowired
|
||||
private ISysOaFileService sysOaFileService;
|
||||
|
||||
/**
|
||||
* 查询差旅费报销
|
||||
*/
|
||||
@@ -47,11 +53,22 @@ public class SysOaClaimServiceImpl implements ISysOaClaimService {
|
||||
return baseMapper.selectSysOaClaimVoById(claimId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据实例id返回vo
|
||||
* @param procInsId 实例id
|
||||
* @return vo
|
||||
*/
|
||||
@Override
|
||||
public SysOaClaimVo queryByProcInsId(String procInsId) {
|
||||
return baseMapper.selectSysOaClaimVoByProcInsId(procInsId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询差旅费报销列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<SysOaClaimVo> queryPageList(SysOaClaimBo bo, PageQuery pageQuery) {
|
||||
bo.setUserId(LoginHelper.getUserId());
|
||||
LambdaQueryWrapper<SysOaClaim> lqw = buildQueryWrapper(bo);
|
||||
Page<SysOaClaimVo> result = baseMapper.selectPageVo(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
@@ -79,6 +96,7 @@ public class SysOaClaimServiceImpl implements ISysOaClaimService {
|
||||
lqw.eq(bo.getProjectId() != null, SysOaClaim::getProjectId, bo.getProjectId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getProcInsId()), SysOaClaim::getProcInsId, bo.getProcInsId());
|
||||
lqw.eq(bo.getCompletedTime() != null, SysOaClaim::getCompletedTime, bo.getCompletedTime());
|
||||
lqw.eq(SysOaClaim::getDelFlag, 0L);
|
||||
return lqw;
|
||||
}
|
||||
|
||||
@@ -90,10 +108,26 @@ public class SysOaClaimServiceImpl implements ISysOaClaimService {
|
||||
bo.setUserId(LoginHelper.getUserId());
|
||||
SysOaClaim add = BeanUtil.toBean(bo, SysOaClaim.class);
|
||||
validEntityBeforeSave(add);
|
||||
|
||||
// 处理文件
|
||||
List<Long> fileIds = new ArrayList<>();
|
||||
for (SysOaFileBo sysOaFile : bo.getFileList()) {
|
||||
Long fileId = sysOaFileService.insertByBoReturnId(sysOaFile);
|
||||
fileIds.add(fileId);
|
||||
}
|
||||
String fileIdsString = fileIds.stream()
|
||||
.map(String::valueOf) // 将 Long 转换为 String
|
||||
.reduce((id1, id2) -> id1 + "," + id2) // 合并为一个逗号分隔的字符串
|
||||
.orElse(""); // 如果列表为空,返回空字符串
|
||||
add.setFileIds(fileIdsString);
|
||||
add.setUserId(LoginHelper.getUserId());
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
|
||||
for (SysOaClaimDetailBo sysOaClaimDetail : bo.getClaimDetailList()) {
|
||||
sysOaClaimDetail.setClaimId(add.getClaimId());
|
||||
sysOaClaimDetailService.insertByBo(sysOaClaimDetail);
|
||||
}
|
||||
|
||||
if (flag) {
|
||||
bo.setClaimId(add.getClaimId());
|
||||
}
|
||||
@@ -127,4 +161,6 @@ public class SysOaClaimServiceImpl implements ISysOaClaimService {
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -81,6 +81,21 @@ public class SysOaFileServiceImpl implements ISysOaFileService {
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增文件存储
|
||||
*/
|
||||
@Override
|
||||
public Long insertByBoReturnId(SysOaFileBo bo) {
|
||||
SysOaFile add = BeanUtil.toBean(bo, SysOaFile.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setFileId(add.getFileId());
|
||||
}
|
||||
return add.getFileId();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改文件存储
|
||||
*/
|
||||
|
||||
@@ -23,8 +23,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="procInsId" column="proc_ins_id"/>
|
||||
<result property="status" column="status_"/>
|
||||
<result property="completedTime" column="completed_time"/>
|
||||
<result property="projectName" column="project_name"/>
|
||||
<result property="address" column="address"/>
|
||||
<collection property="detailList" javaType="list" resultMap="SysOaClaimDetailResult"/>
|
||||
<collection property="fileList" javaType="list" resultMap="SysOaClaimDetailResult"/>
|
||||
<collection property="fileList" javaType="list" resultMap="SysOaFileResult"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="com.ruoyi.oa.domain.SysOaClaimDetail" id="SysOaClaimDetailResult">
|
||||
@@ -32,16 +34,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="claimId" column="claim_id"/>
|
||||
<result property="claimType" column="claim_type"/>
|
||||
<result property="beginTime" column="begin_time"/>
|
||||
<result property="endTime" column="end_time"/>
|
||||
<result property="endTime" column="detail_end"/>
|
||||
<result property="lodgingAddress" column="lodging_address"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="fileIds" column="file_ids"/>
|
||||
<result property="cost" column="cost"/>
|
||||
<result property="cost" column="detail_cost"/>
|
||||
<result property="bigCost" column="big_cost"/>
|
||||
</resultMap>
|
||||
|
||||
@@ -58,13 +54,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="remark" column="remark"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectSysOaClaimVoById" resultMap="SysOaClaimResult">
|
||||
<select id="selectSysOaClaimVoById" resultMap="SysOaClaimResult" parameterType="Long">
|
||||
SELECT soc.claim_id,
|
||||
soc.user_id,
|
||||
soc.file_ids,
|
||||
soc.remark,
|
||||
soc.start_time,
|
||||
soc.end_time,
|
||||
soc.address,
|
||||
soc.trip_days,
|
||||
soc.cost,
|
||||
soc.detail_number,
|
||||
@@ -81,8 +78,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
status,
|
||||
socd.claim_detail_id,
|
||||
claim_type,
|
||||
begin_time,
|
||||
socd.end_time,
|
||||
socd.begin_time ,
|
||||
socd.end_time as detail_end,
|
||||
socd.lodging_address,
|
||||
socd.create_time,
|
||||
socd.create_by,
|
||||
@@ -91,11 +88,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
socd.del_flag,
|
||||
socd.remark,
|
||||
socd.file_ids,
|
||||
socd.cost,
|
||||
socd.big_cost
|
||||
socd.cost as detail_cost,
|
||||
socd.big_cost,
|
||||
sop.project_name
|
||||
FROM sys_oa_claim soc
|
||||
left join sys_oa_claim_detail socd on soc.claim_id = socd.claim_detail_id
|
||||
left join sys_oa_claim_detail socd on soc.claim_id = socd.claim_id
|
||||
left JOIN sys_oa_file sof ON FIND_IN_SET(sof.file_id, soc.file_ids) > 0
|
||||
left join sys_oa_project sop on soc.project_id = sop.project_id
|
||||
where soc.claim_id = #{claimId}
|
||||
</select>
|
||||
|
||||
<select id="selectPageVo" resultMap="SysOaClaimResult">
|
||||
@@ -109,6 +109,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
soc.cost,
|
||||
soc.detail_number,
|
||||
soc.project_id,
|
||||
soc.address,
|
||||
soc.create_time,
|
||||
soc.create_by,
|
||||
soc.update_time,
|
||||
@@ -116,11 +117,57 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
soc.del_flag,
|
||||
soc.proc_ins_id,
|
||||
soc.completed_time,
|
||||
sop.project_name,
|
||||
IF(ahp.END_TIME_ IS NULL, 0, 1) AS status_
|
||||
FROM sys_oa_claim soc
|
||||
left join ACT_HI_PROCINST ahp on soc.proc_ins_id = ahp.PROC_INST_ID_
|
||||
left join sys_oa_project sop on sop.project_id = soc.project_id
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
<select id="selectSysOaClaimVoByProcInsId" resultMap="SysOaClaimResult" parameterType="String">
|
||||
SELECT soc.claim_id,
|
||||
soc.user_id,
|
||||
soc.file_ids,
|
||||
soc.remark,
|
||||
soc.start_time,
|
||||
soc.end_time,
|
||||
soc.address,
|
||||
soc.trip_days,
|
||||
soc.cost,
|
||||
soc.detail_number,
|
||||
soc.project_id,
|
||||
soc.create_time,
|
||||
soc.create_by,
|
||||
soc.update_time,
|
||||
soc.update_by,
|
||||
soc.del_flag,
|
||||
soc.proc_ins_id,
|
||||
soc.completed_time,
|
||||
sof.file_id,
|
||||
file_url,
|
||||
status,
|
||||
socd.claim_detail_id,
|
||||
claim_type,
|
||||
socd.begin_time ,
|
||||
socd.end_time as detail_end,
|
||||
socd.lodging_address,
|
||||
socd.create_time,
|
||||
socd.create_by,
|
||||
socd.update_time,
|
||||
socd.update_by,
|
||||
socd.del_flag,
|
||||
socd.remark,
|
||||
socd.file_ids,
|
||||
socd.cost as detail_cost,
|
||||
socd.big_cost,
|
||||
sop.project_name
|
||||
FROM sys_oa_claim soc
|
||||
left join sys_oa_claim_detail socd on soc.claim_id = socd.claim_id
|
||||
left JOIN sys_oa_file sof ON FIND_IN_SET(sof.file_id, soc.file_ids) > 0
|
||||
left join sys_oa_project sop on soc.project_id = sop.project_id
|
||||
where soc.proc_ins_id = #{procInsId}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -345,6 +345,7 @@ public class WfProcessServiceImpl extends FlowServiceFactory implements IWfProce
|
||||
taskVo.setCreateTime(task.getCreateTime());
|
||||
taskVo.setProcDefId(task.getProcessDefinitionId());
|
||||
taskVo.setTaskName(task.getName());
|
||||
|
||||
// 流程定义信息
|
||||
ProcessDefinition pd = repositoryService.createProcessDefinitionQuery()
|
||||
.processDefinitionId(task.getProcessDefinitionId())
|
||||
@@ -353,7 +354,7 @@ public class WfProcessServiceImpl extends FlowServiceFactory implements IWfProce
|
||||
taskVo.setProcDefName(pd.getName());
|
||||
taskVo.setProcDefVersion(pd.getVersion());
|
||||
taskVo.setProcInsId(task.getProcessInstanceId());
|
||||
|
||||
taskVo.setCategory(pd.getCategory());
|
||||
// 流程发起人信息
|
||||
HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery()
|
||||
.processInstanceId(task.getProcessInstanceId())
|
||||
@@ -479,6 +480,7 @@ public class WfProcessServiceImpl extends FlowServiceFactory implements IWfProce
|
||||
WfTaskVo flowTask = new WfTaskVo();
|
||||
// 当前流程信息
|
||||
flowTask.setTaskId(histTask.getId());
|
||||
flowTask.setCategory(histTask.getCategory());
|
||||
// 审批人员信息
|
||||
flowTask.setCreateTime(histTask.getCreateTime());
|
||||
flowTask.setFinishTime(histTask.getEndTime());
|
||||
@@ -496,6 +498,7 @@ public class WfProcessServiceImpl extends FlowServiceFactory implements IWfProce
|
||||
flowTask.setProcDefVersion(pd.getVersion());
|
||||
flowTask.setProcInsId(histTask.getProcessInstanceId());
|
||||
flowTask.setHisProcInsId(histTask.getProcessInstanceId());
|
||||
flowTask.setCategory(pd.getCategory());
|
||||
|
||||
// 流程发起人信息
|
||||
HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery()
|
||||
@@ -518,9 +521,6 @@ public class WfProcessServiceImpl extends FlowServiceFactory implements IWfProce
|
||||
}
|
||||
page.setTotal(taskInstanceQuery.count());
|
||||
page.setRecords(hisTaskList);
|
||||
// Map<String, Object> result = new HashMap<>();
|
||||
// result.put("result",page);
|
||||
// result.put("finished",true);
|
||||
return TableDataInfo.build(page);
|
||||
}
|
||||
|
||||
@@ -632,9 +632,12 @@ public class WfProcessServiceImpl extends FlowServiceFactory implements IWfProce
|
||||
public String startClaim(Map<String, Object> variables) {
|
||||
try {
|
||||
|
||||
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
|
||||
.processDefinitionCategory("claim").singleResult();
|
||||
return startProcess(processDefinition, variables);
|
||||
List<ProcessDefinition> processDefinition = repositoryService.createProcessDefinitionQuery()
|
||||
.processDefinitionCategory("claim").list();
|
||||
|
||||
// 拿到最新版本的模型
|
||||
return startProcess(processDefinition.get(processDefinition.size()-1), variables);
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new ServiceException("流程启动错误");
|
||||
@@ -697,6 +700,7 @@ public class WfProcessServiceImpl extends FlowServiceFactory implements IWfProce
|
||||
@Override
|
||||
public WfDetailVo queryProcessDetail(String procInsId, String taskId) {
|
||||
WfDetailVo detailVo = new WfDetailVo();
|
||||
|
||||
// 获取流程实例
|
||||
HistoricProcessInstance historicProcIns = historyService.createHistoricProcessInstanceQuery()
|
||||
.processInstanceId(procInsId)
|
||||
@@ -715,6 +719,8 @@ public class WfProcessServiceImpl extends FlowServiceFactory implements IWfProce
|
||||
detailVo.setTaskFormData(currTaskFormData(historicProcIns.getDeploymentId(), taskIns));
|
||||
}
|
||||
// 获取Bpmn模型信息
|
||||
System.out.println("--------------------------");
|
||||
System.out.println(historicProcIns);
|
||||
InputStream inputStream = repositoryService.getProcessModel(historicProcIns.getProcessDefinitionId());
|
||||
String bpmnXmlStr = StrUtil.utf8Str(IoUtil.readBytes(inputStream, false));
|
||||
BpmnModel bpmnModel = ModelUtils.getBpmnModel(bpmnXmlStr);
|
||||
@@ -971,6 +977,7 @@ public class WfProcessServiceImpl extends FlowServiceFactory implements IWfProce
|
||||
} else if (identityLink.getGroupId().startsWith(TaskConstants.DEPT_GROUP_PREFIX)) {
|
||||
Long deptId = Long.parseLong(StringUtils.stripStart(identityLink.getGroupId(), TaskConstants.DEPT_GROUP_PREFIX));
|
||||
SysDept dept = deptService.selectDeptById(deptId);
|
||||
System.out.println(dept);
|
||||
stringBuilder.append(dept.getDeptName()).append(",");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,15 @@ export function getOaClaim(claimId) {
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 查询差旅费报销详细
|
||||
export function getOaClaimByProcInsId(procInsId) {
|
||||
return request({
|
||||
url: '/system/oaClaim/process/' + procInsId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增差旅费报销
|
||||
export function addOaClaim(data) {
|
||||
return request({
|
||||
|
||||
@@ -27,6 +27,15 @@ export function startProcess(processDefId, data) {
|
||||
})
|
||||
}
|
||||
|
||||
// 部署流程实例
|
||||
export function startClaim(data) {
|
||||
return request({
|
||||
url: '/workflow/process/startClaim',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除流程实例
|
||||
export function delProcess(ids) {
|
||||
return request({
|
||||
|
||||
@@ -60,7 +60,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
uploadUrl: process.env.VUE_APP_BASE_API + "/system/oss/upload", // 上传的图片服务器地址
|
||||
uploadUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址
|
||||
headers: {
|
||||
Authorization: "Bearer " + getToken()
|
||||
},
|
||||
|
||||
@@ -60,7 +60,7 @@ export default {
|
||||
// 文件类型, 例如['png', 'jpg', 'jpeg']
|
||||
fileType: {
|
||||
type: Array,
|
||||
default: () => ["doc", "xls", "ppt", "txt", "pdf","docx", "xlsx"],
|
||||
default: () => ["doc", "xls", "ppt", "txt", "pdf","docx", "xlsx",'png', 'jpg', 'jpeg'],
|
||||
},
|
||||
// 是否显示提示
|
||||
isShowTip: {
|
||||
|
||||
@@ -131,6 +131,26 @@ export const constantRoutes = [
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
path: '/claim',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
children: [
|
||||
{
|
||||
path: 'addTripClaim',
|
||||
component: () => import('@/views/oa/claim/add'),
|
||||
name: 'addTripClaim',
|
||||
meta: { title: '新增差旅报销' ,activeMenu: '/claim/oaClaim' }
|
||||
},
|
||||
{
|
||||
path: 'detail/:claimId(\\d+)',
|
||||
component: () => import('@/views/oa/claim/detail'),
|
||||
name: 'detail',
|
||||
meta: { title: '报销单审批' ,activeMenu: '/claim/oaClaim' }
|
||||
},
|
||||
]
|
||||
},
|
||||
|
||||
// {
|
||||
// path: '/people/updateOffboarding/:offboardingId(\\d+)',
|
||||
// component: () => import('@/views/oa/offboarding/update'),
|
||||
|
||||
@@ -499,7 +499,7 @@ export const selectComponents = [
|
||||
__slot__: {
|
||||
'list-type': true
|
||||
},
|
||||
action: process.env.VUE_APP_BASE_API + "/system/oss/upload",
|
||||
action: process.env.VUE_APP_BASE_API + "/common/upload",
|
||||
disabled: false,
|
||||
accept: '',
|
||||
name: 'file',
|
||||
|
||||
203
ruoyi-ui/src/views/components/ClaimDetail/index.vue
Normal file
203
ruoyi-ui/src/views/components/ClaimDetail/index.vue
Normal file
@@ -0,0 +1,203 @@
|
||||
<template>
|
||||
<div >
|
||||
<div class="main">
|
||||
<div class="">
|
||||
<div class="">
|
||||
<el-card style="">
|
||||
<el-row>
|
||||
<div>
|
||||
<h1>差旅费报销申请单</h1>
|
||||
</div>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<div class="header">
|
||||
基本信息
|
||||
</div>
|
||||
<el-divider></el-divider>
|
||||
<div>
|
||||
<el-form :form="form" label-width="100px">
|
||||
<el-form-item label="报销描述:" prop="remark">
|
||||
<el-input type="textarea" v-model="form.remark" :rows="5" disabled></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开始时间:" prop="startTime">
|
||||
<el-date-picker
|
||||
v-model="form.startTime"
|
||||
align="right"
|
||||
type="date"
|
||||
placeholder="选择日期"
|
||||
value-format="yyyy-MM-dd"
|
||||
disabled
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="出差天数:" prop="tripDays">
|
||||
<el-input type="number" v-model="form.tripDays" placeholder="请输入出差天数" disabled></el-input>
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="结束时间:" prop="endTime">
|
||||
<el-date-picker
|
||||
v-model="form.endTime"
|
||||
align="right"
|
||||
type="date"
|
||||
placeholder="选择日期"
|
||||
value-format="yyyy-MM-dd"
|
||||
disabled
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="报销总额:" prop="cost">
|
||||
<el-input v-model="form.cost" placeholder="请输入报销总额" disabled>
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="关联项目:" prop="projectId">
|
||||
<el-select v-model="form.projectId" filterable placeholder="请选择" disabled>
|
||||
<el-option
|
||||
v-for="item in projectList"
|
||||
:key="item.projectId"
|
||||
:label="item.projectName"
|
||||
:value="item.projectId">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="票据总数:" prop="detailNumber">
|
||||
<el-input v-model="form.detailNumber" placeholder="请输入票据总数" disabled>
|
||||
<template slot="append">张</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<el-divider></el-divider>
|
||||
<div style="font-weight: 900;display: flex;">
|
||||
<div style="width: 50%">
|
||||
最终报销金额:
|
||||
<span style="color: red">{{ form.cost === "" ? '请输入金额' : form.cost }}</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
大写:<span style="color: red">{{ numberToCNY(form.cost) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
报销明细
|
||||
<el-divider></el-divider>
|
||||
<div>
|
||||
<el-table
|
||||
:data="detailList"
|
||||
style="width: 100%"
|
||||
border
|
||||
stripe
|
||||
v-loading="loading"
|
||||
highlight-current-row
|
||||
>
|
||||
<el-table-column label="序号" width="80" type="index"></el-table-column>
|
||||
<el-table-column label="报销类型">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.claim_detail_type" :value="scope.row.claimType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="开始时间">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.beginTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="结束时间">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="入住地点" prop="lodgingAddress"></el-table-column>
|
||||
<el-table-column label="款项金额" prop="cost"></el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card>
|
||||
票据留存
|
||||
<el-divider></el-divider>
|
||||
<div style="display: flex">
|
||||
<div style="margin-right: 20px">
|
||||
上传票据:
|
||||
</div>
|
||||
<div>
|
||||
<!-- 文件列表 -->
|
||||
<transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear"
|
||||
tag="ul">
|
||||
<li :key="file.fileUrl" class="el-upload-list__item ele-upload-list__item-content"
|
||||
v-for="(file, index) in form.fileList">
|
||||
<el-link :href="`${baseUrl}${file.fileUrl}`" :underline="false" target="_blank">
|
||||
<span class="el-icon-document"> {{ getFileName(file.fileUrl) }} </span>
|
||||
</el-link>
|
||||
</li>
|
||||
</transition-group>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</el-card>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import {numberToCNY} from "../../../utils/currencyFormatter";
|
||||
|
||||
export default {
|
||||
name: "ClaimDetail",
|
||||
dicts:['claim_detail_type'],
|
||||
methods: {
|
||||
numberToCNY,
|
||||
// 获取文件名称
|
||||
getFileName(name) {
|
||||
// 如果是url那么取最后的名字 如果不是直接返回
|
||||
if (name.lastIndexOf("/") > -1) {
|
||||
return name.slice(name.lastIndexOf("/") + 1);
|
||||
} else {
|
||||
return name;
|
||||
}
|
||||
},
|
||||
},
|
||||
props: {
|
||||
form: {
|
||||
type: Object,
|
||||
default: {}
|
||||
},
|
||||
detailList:{
|
||||
type: Array,
|
||||
default: []
|
||||
}
|
||||
|
||||
},
|
||||
data(){
|
||||
return{
|
||||
baseUrl: process.env.VUE_APP_BASE_API,
|
||||
uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传文件服务器地址
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
</style>
|
||||
314
ruoyi-ui/src/views/oa/claim/add.vue
Normal file
314
ruoyi-ui/src/views/oa/claim/add.vue
Normal file
@@ -0,0 +1,314 @@
|
||||
<template>
|
||||
<div class="main" v-loading="loading">
|
||||
<div class="">
|
||||
<div class="">
|
||||
<el-card style="">
|
||||
<el-row>
|
||||
<div>
|
||||
<h1>差旅费报销申请单</h1>
|
||||
</div>
|
||||
<el-button type="primary">
|
||||
<i class="el-icon-check" @click="addTripClaim">提交</i>
|
||||
</el-button>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<div class="header">
|
||||
基本信息
|
||||
</div>
|
||||
<el-divider></el-divider>
|
||||
<div>
|
||||
<el-form :form="form" label-width="100px" :rules="rules">
|
||||
<el-form-item label="报销描述:" prop="remark">
|
||||
<el-input type="textarea" v-model="form.remark" :rows="5"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开始时间:" prop="startTime">
|
||||
<el-date-picker
|
||||
v-model="form.startTime"
|
||||
align="right"
|
||||
type="date"
|
||||
placeholder="选择日期"
|
||||
value-format="yyyy-MM-dd"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="出差天数:" prop="tripDays">
|
||||
<el-input type="number" v-model="form.tripDays"placeholder="请输入出差天数" ></el-input>
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="结束时间:" prop="endTime" >
|
||||
<el-date-picker
|
||||
v-model="form.endTime"
|
||||
align="right"
|
||||
type="date"
|
||||
placeholder="选择日期"
|
||||
value-format="yyyy-MM-dd"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="报销总额:" prop="cost">
|
||||
<el-input v-model="form.cost" placeholder="请输入报销总额">
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="关联项目:" prop="projectId">
|
||||
<el-select v-model="form.projectId" filterable placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in projectList"
|
||||
:key="item.projectId"
|
||||
:label="item.projectName"
|
||||
:value="item.projectId">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="票据总数:" prop="detailNumber">
|
||||
<el-input v-model="form.detailNumber" placeholder="请输入票据总数">
|
||||
<template slot="append">张</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<el-divider></el-divider>
|
||||
<div style="font-weight: 900;display: flex;">
|
||||
<div style="width: 50%">
|
||||
最终报销金额:
|
||||
<span style="color: red">{{form.cost===""?'请输入金额':form.cost}}</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
大写:<span style="color: red">{{numberToCNY(form.cost)}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
报销明细补充
|
||||
<el-divider></el-divider>
|
||||
<div>
|
||||
<div style="margin-bottom: 10px">
|
||||
<el-button @click="addRow" type="primary">添加</el-button>
|
||||
<el-button @click="deleteRows" type="danger" :disabled="selectedRows.length === 0">删除</el-button>
|
||||
<el-button @click="co" type="danger">打印</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
:data="form.claimDetailList"
|
||||
style="width: 100%"
|
||||
border
|
||||
stripe
|
||||
v-loading="loading"
|
||||
highlight-current-row
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55"></el-table-column>
|
||||
<el-table-column label="序号" width="80" type="index"></el-table-column>
|
||||
<el-table-column label="报销类型">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.claimType" placeholder="请选择报销类型">
|
||||
<el-option
|
||||
v-for="dict in dict.type.claim_detail_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="parseInt(dict.value)"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="开始时间">
|
||||
<template slot-scope="scope">
|
||||
<el-date-picker
|
||||
v-model="scope.row.beginTime"
|
||||
align="right"
|
||||
type="date"
|
||||
placeholder="选择日期"
|
||||
value-format="yyyy-MM-dd"
|
||||
>
|
||||
</el-date-picker>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="结束时间">
|
||||
<template slot-scope="scope">
|
||||
|
||||
<el-date-picker
|
||||
v-model="scope.row.endTime"
|
||||
align="right"
|
||||
type="date"
|
||||
placeholder="选择日期"
|
||||
value-format="yyyy-MM-dd"
|
||||
>
|
||||
</el-date-picker>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="入住地点">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.lodgingAddress" placeholder="请输入入住地点" :disabled="scope.row.claimType!==1"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="款项金额">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.cost" size="small" placeholder="请输入" >
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card>
|
||||
票据留存
|
||||
<el-divider></el-divider>
|
||||
<div style="display: flex">
|
||||
<div style="margin-right: 20px">
|
||||
上传票据:
|
||||
</div>
|
||||
<div>
|
||||
<fileUpload v-model="files"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</el-card>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {addUser, deptTreeSelect, listUser} from "@/api/system/user";
|
||||
import {addOnboarding} from "@/api/oa/onboarding";
|
||||
import {listProject} from "../../../api/oa/project";
|
||||
import {numberToCNY} from "../../../utils/currencyFormatter";
|
||||
import {startClaim} from "../../../api/workflow/process";
|
||||
import {addOaClaim} from "../../../api/oa/claim";
|
||||
|
||||
export default {
|
||||
dicts: ['claim_detail_type'],
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
// 表单参数
|
||||
form: {
|
||||
claimDetailList: [],
|
||||
fileList:[]
|
||||
},
|
||||
// 表单校验
|
||||
rules: {
|
||||
|
||||
startTime: [
|
||||
{ required: true, message: "开始时间不能为空", trigger: "blur" }
|
||||
],
|
||||
endTime: [
|
||||
{ required: true, message: "结束时间不能为空", trigger: "blur" }
|
||||
],
|
||||
tripDays: [
|
||||
{ required: true, message: "出差天数不能为空", trigger: "blur" }
|
||||
],
|
||||
cost: [
|
||||
{ required: true, message: "报销金额不能为空", trigger: "blur" }
|
||||
],
|
||||
detailNumber: [
|
||||
{ required: true, message: "票据总数不能为空", trigger: "blur" }
|
||||
]
|
||||
},
|
||||
// 项目列表
|
||||
projectList: [],
|
||||
selectedRows: [],
|
||||
files:[]
|
||||
|
||||
};
|
||||
|
||||
},
|
||||
|
||||
created() {
|
||||
this.getProjectList();
|
||||
},
|
||||
methods: {
|
||||
// 提交报销表单
|
||||
addTripClaim(){
|
||||
this.loading = true
|
||||
// 将文件列表进行处理
|
||||
this.form.fileList = this.files.split(',').map(file=>({fileUrl:file.trim()}))
|
||||
startClaim().then(res=>{
|
||||
this.form.procInsId = res.data
|
||||
addOaClaim(this.form).then(res => {
|
||||
this.loading = false
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.goBack()
|
||||
})
|
||||
})
|
||||
},
|
||||
co(){
|
||||
console.log(this.files)
|
||||
},
|
||||
|
||||
// 添加新的一行
|
||||
addRow() {
|
||||
this.form.claimDetailList.push({
|
||||
claimType: '',
|
||||
beginTime: '',
|
||||
endTime: '',
|
||||
cost: '',
|
||||
lodgingAddress:''
|
||||
});
|
||||
},
|
||||
// 删除勾选的行
|
||||
deleteRows() {
|
||||
this.form.claimDetailList = this.form.claimDetailList.filter(row => !this.selectedRows.includes(row));
|
||||
this.selectedRows = []; // 清空选中的行
|
||||
},
|
||||
// 处理表格头部的序号显示
|
||||
renderHeader(h, { column }) {
|
||||
return h('span', column.label);
|
||||
},
|
||||
|
||||
getProjectList(){
|
||||
let query = {
|
||||
pageSize:9999,
|
||||
pageNum:1,
|
||||
}
|
||||
listProject(query).then(res => {
|
||||
this.projectList = res.rows
|
||||
})
|
||||
},
|
||||
/** 返回页面 */
|
||||
goBack() {
|
||||
// 关闭当前标签页并返回上个页面
|
||||
this.$tab.closePage(this.$route)
|
||||
this.$router.back()
|
||||
},
|
||||
numberToCNY,
|
||||
// 处理表格选择变化,更新选中的行
|
||||
handleSelectionChange(val) {
|
||||
this.selectedRows = val;
|
||||
}
|
||||
},
|
||||
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.main {
|
||||
padding: 10px;
|
||||
background-color: #f6f6f6;
|
||||
}
|
||||
|
||||
.container {
|
||||
margin: 10px;
|
||||
padding: 10px;
|
||||
background-color: white;
|
||||
border-radius: 10px;
|
||||
}
|
||||
</style>
|
||||
764
ruoyi-ui/src/views/oa/claim/detail.vue
Normal file
764
ruoyi-ui/src/views/oa/claim/detail.vue
Normal file
@@ -0,0 +1,764 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-tabs tab-position="top" :value="processed === true ? 'approval' : 'form'">
|
||||
|
||||
<el-tab-pane label="任务办理" name="approval" v-if="processed === true">
|
||||
<el-card class="box-card" shadow="hover" v-if="taskFormOpen">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>填写表单</span>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="box-card" shadow="hover">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>审批流程</span>
|
||||
</div>
|
||||
<el-row>
|
||||
<el-col :span="20" :offset="2">
|
||||
<el-form ref="taskForm" :model="taskForm" :rules="rules" label-width="120px">
|
||||
<el-form-item label="审批意见" prop="comment">
|
||||
<el-input type="textarea" :rows="5" v-model="taskForm.comment" placeholder="请输入 审批意见" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="10" type="flex" justify="center" >
|
||||
<el-col :span="1.5">
|
||||
<el-button icon="el-icon-circle-check" type="success" @click="handleComplete">通过</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<!-- <el-button icon="el-icon-chat-line-square" type="primary" @click="handleDelegate">委派</el-button>-->
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<!-- <el-button icon="el-icon-thumb" type="success" @click="handleTransfer">转办</el-button>-->
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button icon="el-icon-refresh-left" type="warning" @click="handleReturn">退回</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<!-- <el-button icon="el-icon-circle-close" type="danger" @click="handleReject">拒绝</el-button>-->
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane label="表单信息" name="form">
|
||||
<div>
|
||||
<div class="main" v-loading="loading">
|
||||
<div class="">
|
||||
<div class="">
|
||||
<el-card style="">
|
||||
<el-row>
|
||||
<div>
|
||||
<h1>差旅费报销申请单</h1>
|
||||
</div>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<div class="header">
|
||||
基本信息
|
||||
</div>
|
||||
<el-divider></el-divider>
|
||||
<div>
|
||||
<el-form :form="form" label-width="100px" :rules="rules">
|
||||
<el-form-item label="报销描述:" prop="remark">
|
||||
<el-input type="textarea" v-model="form.remark" :rows="5" disabled></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开始时间:" prop="startTime">
|
||||
<el-date-picker
|
||||
v-model="form.startTime"
|
||||
align="right"
|
||||
type="date"
|
||||
placeholder="选择日期"
|
||||
value-format="yyyy-MM-dd"
|
||||
disabled
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="出差天数:" prop="tripDays">
|
||||
<el-input type="number" v-model="form.tripDays"placeholder="请输入出差天数" disabled></el-input>
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="结束时间:" prop="endTime" >
|
||||
<el-date-picker
|
||||
v-model="form.endTime"
|
||||
align="right"
|
||||
type="date"
|
||||
placeholder="选择日期"
|
||||
value-format="yyyy-MM-dd"
|
||||
disabled
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="报销总额:" prop="cost">
|
||||
<el-input v-model="form.cost" placeholder="请输入报销总额" disabled>
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="关联项目:" prop="projectId">
|
||||
<el-select v-model="form.projectId" filterable placeholder="请选择" disabled>
|
||||
<el-option
|
||||
v-for="item in projectList"
|
||||
:key="item.projectId"
|
||||
:label="item.projectName"
|
||||
:value="item.projectId">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="票据总数:" prop="detailNumber">
|
||||
<el-input v-model="form.detailNumber" placeholder="请输入票据总数" disabled>
|
||||
<template slot="append">张</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<el-divider></el-divider>
|
||||
<div style="font-weight: 900;display: flex;">
|
||||
<div style="width: 50%">
|
||||
最终报销金额:
|
||||
<span style="color: red">{{form.cost===""?'请输入金额':form.cost}}</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
大写:<span style="color: red">{{numberToCNY(form.cost)}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
报销明细
|
||||
<el-divider></el-divider>
|
||||
<div>
|
||||
<el-table
|
||||
:data="detailList"
|
||||
style="width: 100%"
|
||||
border
|
||||
stripe
|
||||
v-loading="loading"
|
||||
highlight-current-row
|
||||
>
|
||||
<el-table-column label="序号" width="80" type="index"></el-table-column>
|
||||
<el-table-column label="报销类型">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.claim_detail_type" :value="scope.row.claimType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="开始时间">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.beginTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="结束时间">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="入住地点" prop="lodgingAddress"></el-table-column>
|
||||
<el-table-column label="款项金额" prop="cost"></el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card>
|
||||
票据留存
|
||||
<el-divider></el-divider>
|
||||
<div style="display: flex">
|
||||
<div style="margin-right: 20px">
|
||||
上传票据:
|
||||
</div>
|
||||
<div>
|
||||
<!-- 文件列表 -->
|
||||
<transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul">
|
||||
<li :key="file.fileUrl" class="el-upload-list__item ele-upload-list__item-content" v-for="(file, index) in form.fileList">
|
||||
<el-link :href="`${baseUrl}${file.fileUrl}`" :underline="false" target="_blank">
|
||||
<span class="el-icon-document"> {{ getFileName(file.fileUrl) }} </span>
|
||||
</el-link>
|
||||
</li>
|
||||
</transition-group>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</el-card>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-tab-pane >
|
||||
|
||||
<el-tab-pane label="流转记录" name="record">
|
||||
|
||||
<div class="title-record">流程标题:{{processTitleValue}}</div>
|
||||
|
||||
<el-card class="box-card" shadow="never">
|
||||
<el-col :span="20" :offset="2">
|
||||
<div class="block">
|
||||
<el-timeline>
|
||||
<el-timeline-item v-for="(item,index) in historyProcNodeList" :key="index" :icon="setIcon(item.endTime)" :color="setColor(item.endTime)">
|
||||
<p style="font-weight: 700">{{ item.activityName }}</p>
|
||||
<el-card v-if="item.activityType === 'startEvent'" class="box-card" shadow="hover">
|
||||
{{ item.assigneeName }} 在 {{ item.createTime }} 发起流程
|
||||
</el-card>
|
||||
<el-card v-if="item.activityType === 'userTask'" class="box-card" shadow="hover">
|
||||
<el-descriptions :column="5" :labelStyle="{'font-weight': 'bold'}">
|
||||
<el-descriptions-item label="实际办理">{{ item.assigneeName || '-'}}</el-descriptions-item>
|
||||
<!-- <el-descriptions-item label="候选办理">{{ item.candidate || '-'}}</el-descriptions-item>-->
|
||||
<el-descriptions-item label="接收时间">{{ item.createTime || '-'}}</el-descriptions-item>
|
||||
<el-descriptions-item label="办结时间">{{ item.endTime || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="耗时">{{ item.duration || '-'}}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<div v-if="item.commentList && item.commentList.length > 0">
|
||||
<el-divider content-position="left">
|
||||
<el-tag :type="approveTypeTag(item.commentList[0].type)" size="mini">{{ commentType(item.commentList[0].type) }}</el-tag>
|
||||
<el-tag type="info" effect="plain" size="mini">{{ item.commentList[0].time }}</el-tag>
|
||||
</el-divider>
|
||||
<span>{{ item.commentList[0].fullMessage }}</span>
|
||||
<!-- <div v-for="(comment, index) in item.commentList" :key="index">
|
||||
<el-divider content-position="left">
|
||||
<el-tag :type="approveTypeTag(comment.type)" size="mini">{{ commentType(comment.type) }}</el-tag>
|
||||
<el-tag type="info" effect="plain" size="mini">{{ comment.time }}</el-tag>
|
||||
</el-divider>
|
||||
<span>{{ comment.fullMessage }}</span>
|
||||
</div>-->
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card v-if="item.activityType === 'endEvent'" class="box-card" shadow="hover">
|
||||
{{ item.createTime }} 结束流程
|
||||
</el-card>
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-card>
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane label="流程跟踪" name="track">
|
||||
<el-card class="box-card" shadow="never">
|
||||
<process-viewer :key="`designer-${loadIndex}`" :style="'height:' + height" :xml="xmlData"
|
||||
:finishedInfo="finishedInfo" :allCommentList="historyProcNodeList"
|
||||
/>
|
||||
</el-card>
|
||||
</el-tab-pane>
|
||||
|
||||
|
||||
</el-tabs>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { detailProcess } from '@/api/workflow/process'
|
||||
import Parser from '@/utils/generator/parser'
|
||||
import { complete, delegate, transfer, rejectTask, returnList, returnTask } from '@/api/workflow/task'
|
||||
import { selectUser, deptTreeSelect } from '@/api/system/user'
|
||||
import ProcessViewer from '@/components/ProcessViewer'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import Treeselect from '@riophae/vue-treeselect'
|
||||
import {getOaClaim} from "../../../api/oa/claim";
|
||||
import {numberToCNY} from "../../../utils/currencyFormatter";
|
||||
import {listProject} from "../../../api/oa/project";
|
||||
|
||||
export default {
|
||||
name: "WorkDetail",
|
||||
dicts:['claim_detail_type'],
|
||||
components: {
|
||||
ProcessViewer,
|
||||
Parser,
|
||||
Treeselect
|
||||
},
|
||||
props: {},
|
||||
computed: {
|
||||
commentType() {
|
||||
return val => {
|
||||
switch (val) {
|
||||
case '1': return '通过'
|
||||
case '2': return '退回'
|
||||
case '3': return '驳回'
|
||||
case '4': return '委派'
|
||||
case '5': return '转办'
|
||||
case '6': return '终止'
|
||||
case '7': return '撤回'
|
||||
}
|
||||
}
|
||||
},
|
||||
approveTypeTag() {
|
||||
return val => {
|
||||
switch (val) {
|
||||
case '1': return 'success'
|
||||
case '2': return 'warning'
|
||||
case '3': return 'danger'
|
||||
case '4': return 'primary'
|
||||
case '5': return 'success'
|
||||
case '6': return 'danger'
|
||||
case '7': return 'info'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
baseUrl: process.env.VUE_APP_BASE_API,
|
||||
uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传文件服务器地址
|
||||
height: document.documentElement.clientHeight - 205 + 'px;',
|
||||
// 模型xml数据
|
||||
loadIndex: 0,
|
||||
xmlData: undefined,
|
||||
detailList:[],
|
||||
finishedInfo: {
|
||||
finishedSequenceFlowSet: [],
|
||||
finishedTaskSet: [],
|
||||
unfinishedTaskSet: [],
|
||||
rejectedTaskSet: []
|
||||
},
|
||||
historyProcNodeList: [],
|
||||
// 部门名称
|
||||
deptName: undefined,
|
||||
// 部门树选项
|
||||
deptOptions: undefined,
|
||||
userLoading: false,
|
||||
// 用户表格数据
|
||||
userList: null,
|
||||
deptProps: {
|
||||
children: "children",
|
||||
label: "label"
|
||||
},
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
deptId: undefined
|
||||
},
|
||||
total: 0,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
taskForm: {
|
||||
comment: "", // 意见内容
|
||||
procInsId: "", // 流程实例编号
|
||||
taskId: "",// 流程任务编号
|
||||
copyUserIds: "", // 抄送人Id
|
||||
vars: "",
|
||||
targetKey: ""
|
||||
},
|
||||
rules: {
|
||||
comment: [{required: true, message: '请输入审批意见', trigger: 'blur'}],
|
||||
},
|
||||
currentUserId: null,
|
||||
variables: [], // 流程变量数据
|
||||
taskFormOpen: false,
|
||||
taskFormData: {}, // 流程变量数据
|
||||
processFormList: [], // 流程变量数据
|
||||
processTitleValue: null,
|
||||
formOpen: false, // 是否加载流程变量数据
|
||||
returnTaskList: [], // 回退列表数据
|
||||
processed: false,
|
||||
returnTitle: null,
|
||||
returnOpen: false,
|
||||
rejectOpen: false,
|
||||
rejectTitle: null,
|
||||
userData: {
|
||||
title: '',
|
||||
type: '',
|
||||
open: false,
|
||||
},
|
||||
copyUser: [],
|
||||
nextUser: [],
|
||||
userMultipleSelection: [],
|
||||
userDialogTitle: '',
|
||||
userOpen: false,
|
||||
form:{}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getClaimDetail();
|
||||
|
||||
},
|
||||
methods: {
|
||||
numberToCNY,
|
||||
getProjectList(){
|
||||
let params = {
|
||||
pageSize:999,
|
||||
pageNum:1
|
||||
}
|
||||
listProject(params).then(response => {
|
||||
this.projectList = response.rows
|
||||
})
|
||||
},
|
||||
/** 获取报销单详情 */
|
||||
getClaimDetail() {
|
||||
getOaClaim(this.$route.params.claimId).then(res => {
|
||||
this.form = res.data;
|
||||
this.detailList = res.data.detailList
|
||||
console.log(this.detailList)
|
||||
this.initData();
|
||||
this.loading=false
|
||||
})
|
||||
},
|
||||
|
||||
/** 初始化流程数据 */
|
||||
initData() {
|
||||
this.taskForm.procInsId = this.form.procInsId
|
||||
|
||||
this.processed = this.$route.query && eval(this.$route.query.processed || false);
|
||||
// 流程任务重获取变量表单
|
||||
this.getProcessDetails(this.form.procInsId);
|
||||
this.loadIndex = this.taskForm.procInsId;
|
||||
},
|
||||
/** 查询部门下拉树结构 */
|
||||
getTreeSelect() {
|
||||
deptTreeSelect().then(response => {
|
||||
this.deptOptions = response.data;
|
||||
});
|
||||
},
|
||||
/** 查询用户列表 */
|
||||
getList() {
|
||||
this.userLoading = true;
|
||||
selectUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||
this.userList = response.rows;
|
||||
this.total = response.total;
|
||||
this.toggleSelection(this.userMultipleSelection);
|
||||
this.userLoading = false;
|
||||
});
|
||||
},
|
||||
// 筛选节点
|
||||
filterNode(value, data) {
|
||||
if (!value) return true;
|
||||
return data.label.indexOf(value) !== -1;
|
||||
},
|
||||
// 节点单击事件
|
||||
handleNodeClick(data) {
|
||||
this.queryParams.deptId = data.id;
|
||||
this.getList();
|
||||
},
|
||||
setIcon(val) {
|
||||
if (val) {
|
||||
return "el-icon-check";
|
||||
} else {
|
||||
return "el-icon-time";
|
||||
}
|
||||
},
|
||||
setColor(val) {
|
||||
if (val) {
|
||||
return "#2bc418";
|
||||
} else {
|
||||
return "#b3bdbb";
|
||||
}
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.userMultipleSelection = selection
|
||||
},
|
||||
toggleSelection(selection) {
|
||||
if (selection && selection.length > 0) {
|
||||
this.$nextTick(() => {
|
||||
selection.forEach(item => {
|
||||
let row = this.userList.find(k => k.userId === item.userId);
|
||||
this.$refs.userTable.toggleRowSelection(row);
|
||||
})
|
||||
})
|
||||
} else {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.userTable.clearSelection();
|
||||
});
|
||||
}
|
||||
},
|
||||
// 关闭标签
|
||||
handleClose(type, tag) {
|
||||
let userObj = this.userMultipleSelection.find(item => item.userId === tag.id);
|
||||
this.userMultipleSelection.splice(this.userMultipleSelection.indexOf(userObj), 1);
|
||||
if (type === 'copy') {
|
||||
this.copyUser = this.userMultipleSelection;
|
||||
// 设置抄送人ID
|
||||
if (this.copyUser && this.copyUser.length > 0) {
|
||||
const val = this.copyUser.map(item => item.id);
|
||||
this.taskForm.copyUserIds = val instanceof Array ? val.join(',') : val;
|
||||
} else {
|
||||
this.taskForm.copyUserIds = '';
|
||||
}
|
||||
} else if (type === 'next') {
|
||||
this.nextUser = this.userMultipleSelection;
|
||||
// 设置抄送人ID
|
||||
if (this.nextUser && this.nextUser.length > 0) {
|
||||
const val = this.nextUser.map(item => item.id);
|
||||
this.taskForm.nextUserIds = val instanceof Array ? val.join(',') : val;
|
||||
} else {
|
||||
this.taskForm.nextUserIds = '';
|
||||
}
|
||||
}
|
||||
},
|
||||
/** 流程变量赋值 */
|
||||
handleCheckChange(val) {
|
||||
if (val instanceof Array) {
|
||||
this.taskForm.values = {
|
||||
"approval": val.join(',')
|
||||
}
|
||||
} else {
|
||||
this.taskForm.values = {
|
||||
"approval": val
|
||||
}
|
||||
}
|
||||
},
|
||||
//获取的表单信息、流转记录、流程跟踪信息
|
||||
getProcessDetails(procInsId) {
|
||||
const params = {procInsId: procInsId, taskId: null}
|
||||
detailProcess(params).then(res => {
|
||||
const data = res.data;
|
||||
this.xmlData = data.bpmnXml;
|
||||
this.processFormList = data.processFormList;
|
||||
this.historyProcNodeList = data.historyProcNodeList;
|
||||
this.finishedInfo = data.flowViewer;
|
||||
this.formOpen = true
|
||||
this.processTitleValue = data.processFormList[0].fields[0].__config__.defaultValue;
|
||||
})
|
||||
},
|
||||
onSelectCopyUsers() {
|
||||
this.userMultipleSelection = this.copyUser;
|
||||
this.onSelectUsers('添加抄送人', 'copy')
|
||||
},
|
||||
onSelectNextUsers() {
|
||||
this.userMultipleSelection = this.nextUser;
|
||||
this.onSelectUsers('指定审批人', 'next')
|
||||
},
|
||||
onSelectUsers(title, type) {
|
||||
this.userData.title = title;
|
||||
this.userData.type = type;
|
||||
this.getTreeSelect();
|
||||
this.getList()
|
||||
this.userData.open = true;
|
||||
},
|
||||
/** 通过任务 */
|
||||
handleComplete() {
|
||||
// 校验表单
|
||||
const taskFormRef = this.$refs.taskFormParser;
|
||||
const isExistTaskForm = taskFormRef !== undefined;
|
||||
// 若无任务表单,则 taskFormPromise 为 true,即不需要校验
|
||||
const taskFormPromise = !isExistTaskForm ? true : new Promise((resolve, reject) => {
|
||||
taskFormRef.$refs[taskFormRef.formConfCopy.formRef].validate(valid => {
|
||||
valid ? resolve() : reject()
|
||||
})
|
||||
});
|
||||
const approvalPromise = new Promise((resolve, reject) => {
|
||||
this.$refs['taskForm'].validate(valid => {
|
||||
valid ? resolve() : reject()
|
||||
})
|
||||
});
|
||||
Promise.all([taskFormPromise, approvalPromise]).then(() => {
|
||||
if (isExistTaskForm) {
|
||||
this.taskForm.variables = taskFormRef[taskFormRef.formConfCopy.formModel]
|
||||
}
|
||||
//执行是否同意的任务
|
||||
complete(this.taskForm).then(response => {
|
||||
this.$modal.msgSuccess(response.msg);
|
||||
this.goBack();
|
||||
});
|
||||
})
|
||||
},
|
||||
/** 委派任务 */
|
||||
handleDelegate() {
|
||||
this.$refs["taskForm"].validate(valid => {
|
||||
if (valid) {
|
||||
this.userData.type = 'delegate';
|
||||
this.userData.title = '委派任务'
|
||||
this.userData.open = true;
|
||||
this.getTreeSelect();
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 转办任务 */
|
||||
handleTransfer() {
|
||||
this.$refs["taskForm"].validate(valid => {
|
||||
if (valid) {
|
||||
this.userData.type = 'transfer';
|
||||
this.userData.title = '转办任务';
|
||||
this.userData.open = true;
|
||||
this.getTreeSelect();
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 拒绝任务 */
|
||||
handleReject() {
|
||||
this.$refs["taskForm"].validate(valid => {
|
||||
if (valid) {
|
||||
const _this = this;
|
||||
this.$modal.confirm('拒绝审批单流程会终止,是否继续?').then(function () {
|
||||
return rejectTask(_this.taskForm);
|
||||
}).then(res => {
|
||||
this.$modal.msgSuccess(res.msg);
|
||||
this.goBack();
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
changeCurrentUser(val) {
|
||||
this.currentUserId = val.userId
|
||||
},
|
||||
/** 返回页面 */
|
||||
goBack() {
|
||||
// 关闭当前标签页并返回上个页面
|
||||
this.$tab.closePage(this.$route)
|
||||
this.$router.back()
|
||||
},
|
||||
/** 接收子组件传的值 */
|
||||
getData(data) {
|
||||
if (data) {
|
||||
const variables = [];
|
||||
data.fields.forEach(item => {
|
||||
let variableData = {};
|
||||
variableData.label = item.__config__.label
|
||||
// 表单值为多个选项时
|
||||
if (item.__config__.defaultValue instanceof Array) {
|
||||
const array = [];
|
||||
item.__config__.defaultValue.forEach(val => {
|
||||
array.push(val)
|
||||
})
|
||||
variableData.val = array;
|
||||
} else {
|
||||
variableData.val = item.__config__.defaultValue
|
||||
}
|
||||
variables.push(variableData)
|
||||
})
|
||||
this.variables = variables;
|
||||
}
|
||||
},
|
||||
submitUserData() {
|
||||
let type = this.userData.type;
|
||||
if (type === 'copy' || type === 'next') {
|
||||
if (!this.userMultipleSelection || this.userMultipleSelection.length <= 0) {
|
||||
this.$modal.msgError("请选择用户");
|
||||
return false;
|
||||
}
|
||||
let userIds = this.userMultipleSelection.map(k => k.userId);
|
||||
if (type === 'copy') {
|
||||
// 设置抄送人ID信息
|
||||
this.copyUser = this.userMultipleSelection;
|
||||
this.taskForm.copyUserIds = userIds instanceof Array ? userIds.join(',') : userIds;
|
||||
} else if (type === 'next') {
|
||||
// 设置下一级审批人ID信息
|
||||
this.nextUser = this.userMultipleSelection;
|
||||
this.taskForm.nextUserIds = userIds instanceof Array ? userIds.join(',') : userIds;
|
||||
}
|
||||
this.userData.open = false;
|
||||
} else {
|
||||
if (!this.taskForm.comment) {
|
||||
this.$modal.msgError("请输入审批意见");
|
||||
return false;
|
||||
}
|
||||
if (!this.currentUserId) {
|
||||
this.$modal.msgError("请选择用户");
|
||||
return false;
|
||||
}
|
||||
this.taskForm.userId = this.currentUserId;
|
||||
if (type === 'delegate') {
|
||||
delegate(this.taskForm).then(res => {
|
||||
this.$modal.msgSuccess(res.msg);
|
||||
this.goBack();
|
||||
});
|
||||
}
|
||||
if (type === 'transfer') {
|
||||
transfer(this.taskForm).then(res => {
|
||||
this.$modal.msgSuccess(res.msg);
|
||||
this.goBack();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
/** 可退回任务列表 */
|
||||
handleReturn() {
|
||||
this.$refs['taskForm'].validate(valid => {
|
||||
if (valid) {
|
||||
this.returnTitle = "退回流程";
|
||||
returnList(this.taskForm).then(res => {
|
||||
this.returnTaskList = res.data;
|
||||
this.taskForm.values = null;
|
||||
this.returnOpen = true;
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
// 获取文件名称
|
||||
getFileName(name) {
|
||||
// 如果是url那么取最后的名字 如果不是直接返回
|
||||
if (name.lastIndexOf("/") > -1) {
|
||||
return name.slice(name.lastIndexOf("/") + 1);
|
||||
} else {
|
||||
return name;
|
||||
}
|
||||
},
|
||||
/** 提交退回任务 */
|
||||
submitReturn() {
|
||||
this.$refs["taskForm"].validate(valid => {
|
||||
if (valid) {
|
||||
if (!this.taskForm.targetKey) {
|
||||
this.$modal.msgError("请选择退回节点!");
|
||||
}
|
||||
returnTask(this.taskForm).then(res => {
|
||||
this.$modal.msgSuccess(res.msg);
|
||||
this.goBack()
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.clearfix:before,
|
||||
.clearfix:after {
|
||||
display: table;
|
||||
content: "";
|
||||
}
|
||||
|
||||
.clearfix:after {
|
||||
clear: both
|
||||
}
|
||||
|
||||
.box-card {
|
||||
width: 100%;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.el-tag + .el-tag {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.el-row {
|
||||
margin-bottom: 20px;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.el-col {
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.button-new-tag {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.title-record {
|
||||
font-size: 16px;
|
||||
padding: 10px 0;
|
||||
color: #1ab394
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
@@ -17,17 +17,6 @@
|
||||
v-hasPermi="['system:oaClaim:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['system:oaClaim:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
@@ -55,12 +44,19 @@
|
||||
<el-table v-loading="loading" :data="oaClaimList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="序号" align="center" type="index" v-if="true"/>
|
||||
<el-table-column label="报销缘由/备注" align="center" prop="remark" />
|
||||
<el-table-column label="描述" align="center" prop="remark" />
|
||||
<el-table-column label="出差天数" align="center" prop="tripDays" />
|
||||
<el-table-column label="报销金额" align="center" prop="cost" />
|
||||
<el-table-column label="票据总数" align="center" prop="detailNumber" />
|
||||
<el-table-column label="关联项目" align="center" prop="projectId" />
|
||||
<el-table-column label="关联流程id" align="center" prop="procInsId" />
|
||||
<el-table-column label="关联项目" align="center" prop="projectName" >
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" >{{ scope.row.projectName!==null?scope.row.projectName:'未关联项目' }}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" prop="projectId">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.status_===1?'success':'warning'">{{scope.row.status_===1?'完成':'进行中'}}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="报销时间" align="center" prop="completedTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.completedTime, '{y}-{m}-{d}') }}</span>
|
||||
@@ -72,9 +68,9 @@
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
@click="handleDetail(scope.row)"
|
||||
v-hasPermi="['system:oaClaim:edit']"
|
||||
>修改</el-button>
|
||||
>详情</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
@@ -241,6 +237,7 @@ export default {
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listOaClaim(this.queryParams).then(response => {
|
||||
console.log(response.rows)
|
||||
this.oaClaimList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
@@ -292,9 +289,7 @@ export default {
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加差旅费报销";
|
||||
this.$router.push('/claim/addTripClaim')
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
@@ -353,6 +348,11 @@ export default {
|
||||
this.download('system/oaClaim/export', {
|
||||
...this.queryParams
|
||||
}, `oaClaim_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
|
||||
/******************路由*******************/
|
||||
handleDetail(row){
|
||||
this.$router.push('/claim/detail/'+row.claimId);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -714,7 +714,6 @@ export default {
|
||||
methods: {
|
||||
|
||||
updateBigPrice(index, row) {
|
||||
console.log(index, row);
|
||||
if (row.price !== '') {
|
||||
row.bigPrice = numberToCNY(parseFloat(row.price) || 0);
|
||||
} else {
|
||||
|
||||
@@ -21,28 +21,6 @@
|
||||
<el-form-item label="审批意见" prop="comment">
|
||||
<el-input type="textarea" :rows="5" v-model="taskForm.comment" placeholder="请输入 审批意见" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="抄送人" prop="copyUserIds">
|
||||
<el-tag
|
||||
:key="index"
|
||||
v-for="(item, index) in copyUser"
|
||||
closable
|
||||
:disable-transitions="false"
|
||||
@close="handleClose('copy', item)">
|
||||
{{ item.nickName }}
|
||||
</el-tag>
|
||||
<el-button class="button-new-tag" type="primary" icon="el-icon-plus" size="mini" circle @click="onSelectCopyUsers" />
|
||||
</el-form-item>
|
||||
<el-form-item label="指定审批人" prop="copyUserIds">
|
||||
<el-tag
|
||||
:key="index"
|
||||
v-for="(item, index) in nextUser"
|
||||
closable
|
||||
:disable-transitions="false"
|
||||
@close="handleClose('next', item)">
|
||||
{{ item.nickName }}
|
||||
</el-tag>
|
||||
<el-button class="button-new-tag" type="primary" icon="el-icon-plus" size="mini" circle @click="onSelectNextUsers" />
|
||||
</el-form-item>-->
|
||||
</el-form>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -67,15 +45,15 @@
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane label="表单信息" name="form">
|
||||
<div v-if="formOpen">
|
||||
<div v-loading="loading">
|
||||
<el-card class="box-card" shadow="never" v-for="(formInfo, index) in processFormList" :key="index">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>{{ formInfo.title }}</span>
|
||||
</div>
|
||||
<!--流程处理表单模块-->
|
||||
<el-col :span="20" :offset="2">
|
||||
<parser :form-conf="formInfo"/>
|
||||
|
||||
<parser :form-conf="formInfo" v-if="formType===''"/>
|
||||
<claim-detail :form="form" :detailList="detailList" v-if="formType ==='claim'"></claim-detail>
|
||||
</el-col>
|
||||
</el-card>
|
||||
</div>
|
||||
@@ -108,13 +86,6 @@
|
||||
<el-tag type="info" effect="plain" size="mini">{{ item.commentList[0].time }}</el-tag>
|
||||
</el-divider>
|
||||
<span>{{ item.commentList[0].fullMessage }}</span>
|
||||
<!-- <div v-for="(comment, index) in item.commentList" :key="index">
|
||||
<el-divider content-position="left">
|
||||
<el-tag :type="approveTypeTag(comment.type)" size="mini">{{ commentType(comment.type) }}</el-tag>
|
||||
<el-tag type="info" effect="plain" size="mini">{{ comment.time }}</el-tag>
|
||||
</el-divider>
|
||||
<span>{{ comment.fullMessage }}</span>
|
||||
</div>-->
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card v-if="item.activityType === 'endEvent'" class="box-card" shadow="hover">
|
||||
@@ -222,10 +193,13 @@ import { selectUser, deptTreeSelect } from '@/api/system/user'
|
||||
import ProcessViewer from '@/components/ProcessViewer'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import Treeselect from '@riophae/vue-treeselect'
|
||||
import ClaimDetail from "../../components/ClaimDetail/index.vue";
|
||||
import {getOaClaim, getOaClaimByProcInsId} from "../../../api/oa/claim";
|
||||
|
||||
export default {
|
||||
name: "WorkDetail",
|
||||
components: {
|
||||
ClaimDetail,
|
||||
ProcessViewer,
|
||||
Parser,
|
||||
Treeselect
|
||||
@@ -325,7 +299,10 @@ export default {
|
||||
nextUser: [],
|
||||
userMultipleSelection: [],
|
||||
userDialogTitle: '',
|
||||
userOpen: false
|
||||
userOpen: false,
|
||||
formType:"",
|
||||
form:{},
|
||||
detailList:[]
|
||||
};
|
||||
},
|
||||
created() {
|
||||
@@ -333,9 +310,18 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
this.loading=true
|
||||
this.taskForm.procInsId = this.$route.params && this.$route.params.procInsId;
|
||||
this.taskForm.taskId = this.$route.query && this.$route.query.taskId;
|
||||
this.formType = this.$route.query.category;
|
||||
this.processed = this.$route.query && eval(this.$route.query.processed || false);
|
||||
if (this.$route.query.category==='claim'){
|
||||
getOaClaimByProcInsId(this.$route.params.procInsId).then(res=>{
|
||||
this.form = res.data
|
||||
this.detailList = res.data.detailList
|
||||
this.loading=false
|
||||
})
|
||||
}
|
||||
// 流程任务重获取变量表单
|
||||
this.getProcessDetails(this.taskForm.procInsId, this.taskForm.taskId);
|
||||
this.loadIndex = this.taskForm.procInsId;
|
||||
|
||||
@@ -19,18 +19,6 @@
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="审批时间">
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
style="width: 240px"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="['00:00:00', '23:59:59']"
|
||||
></el-date-picker>
|
||||
</el-form-item>-->
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
@@ -169,7 +157,7 @@ export default {
|
||||
}else {
|
||||
this.finishedList =response.rows;
|
||||
}
|
||||
|
||||
console.log(this.finishedList)
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
@@ -247,10 +235,12 @@ export default {
|
||||
},
|
||||
/** 流程流转记录 */
|
||||
handleFlowRecord(row){
|
||||
console.log(row)
|
||||
this.$router.push({
|
||||
path: '/workflow/process/detail/' + row.procInsId,
|
||||
query: {
|
||||
processed: false
|
||||
processed: false,
|
||||
category:row.category
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
@@ -54,11 +54,6 @@
|
||||
<el-table v-loading="loading" :data="todoList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center"/>
|
||||
<!-- <el-table-column label="任务编号" align="center" prop="taskId" :show-overflow-tooltip="true"/>-->
|
||||
<el-table-column label="流程标题" align="left">
|
||||
<template slot-scope="scope">
|
||||
<label>{{scope.row.procVars.description}}</label>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="流程名称" align="center" width="180" prop="procDefName"/>
|
||||
<el-table-column label="任务节点" align="center" width="155" prop="taskName"/>
|
||||
<el-table-column label="流程版本" align="center" width="80">
|
||||
@@ -138,10 +133,7 @@ export default {
|
||||
rules: {}
|
||||
};
|
||||
},
|
||||
/* created() {
|
||||
console.log(9999)
|
||||
this.getList();
|
||||
},*/
|
||||
|
||||
beforeRouteEnter(to, from, next) {
|
||||
next(vm => {
|
||||
vm.getList()
|
||||
@@ -173,11 +165,13 @@ export default {
|
||||
},
|
||||
// 跳转到处理页面
|
||||
handleProcess(row) {
|
||||
console.log(row)
|
||||
this.$router.push({
|
||||
path: '/workflow/process/detail/' + row.procInsId,
|
||||
query: {
|
||||
taskId: row.taskId,
|
||||
processed: true
|
||||
processed: true,
|
||||
category:row.category,
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
68
ruoyi-ui/temp.txt
Normal file
68
ruoyi-ui/temp.txt
Normal file
@@ -0,0 +1,68 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-row :gutter="15">
|
||||
<el-form ref="financeTaskForm" :model="financeTaskFormData" :rules="rules" size="medium"
|
||||
label-width="120px">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="上传" prop="field101" required>
|
||||
<el-upload ref="field101" :file-list="field101fileList" :action="field101Action"
|
||||
:before-upload="field101BeforeUpload" list-type="picture-card">
|
||||
<i class="el-icon-plus"></i>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item size="large">
|
||||
<el-button type="primary" @click="submitForm">提交</el-button>
|
||||
<el-button @click="resetForm">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
components: {},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
financeTaskFormData: {
|
||||
field101: null,
|
||||
},
|
||||
rules: {},
|
||||
field101Action: '/dev-api/common/upload',
|
||||
field101fileList: [],
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {},
|
||||
mounted() {},
|
||||
methods: {
|
||||
submitForm() {
|
||||
this.$refs['financeTaskForm'].validate(valid => {
|
||||
if (!valid) return
|
||||
// TODO 提交表单
|
||||
})
|
||||
},
|
||||
resetForm() {
|
||||
this.$refs['financeTaskForm'].resetFields()
|
||||
},
|
||||
field101BeforeUpload(file) {
|
||||
let isRightSize = file.size / 1024 / 1024 < 2
|
||||
if (!isRightSize) {
|
||||
this.$message.error('文件大小超过 2MB')
|
||||
}
|
||||
return isRightSize
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
<style>
|
||||
.el-upload__tip {
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user