提交代码
parent
1490c32d5e
commit
cd4eae7450
|
@ -1,95 +1,96 @@
|
|||
//package com.ruoyi.flowable.config;
|
||||
//
|
||||
//import com.sun.prism.paint.Color;
|
||||
//import org.flowable.bpmn.model.AssociationDirection;
|
||||
//import org.flowable.image.impl.DefaultProcessDiagramCanvas;
|
||||
//
|
||||
//import java.awt.*;
|
||||
//import java.awt.geom.Line2D;
|
||||
//import java.awt.geom.RoundRectangle2D;
|
||||
//
|
||||
///**
|
||||
// * @author Tony
|
||||
// * @date 2021-04-03
|
||||
// */
|
||||
//public class MyDefaultProcessDiagramCanvas extends DefaultProcessDiagramCanvas {
|
||||
// //设置高亮线的颜色 这里我设置成绿色
|
||||
// protected static Color HIGHLIGHT_SEQUENCEFLOW_COLOR = Color.GREEN;
|
||||
//
|
||||
// public MyDefaultProcessDiagramCanvas(int width, int height, int minX, int minY, String imageType, String activityFontName, String labelFontName, String annotationFontName, ClassLoader customClassLoader) {
|
||||
// super(width, height, minX, minY, imageType, activityFontName, labelFontName, annotationFontName, customClassLoader);
|
||||
// }
|
||||
//
|
||||
// public MyDefaultProcessDiagramCanvas(int width, int height, int minX, int minY, String imageType) {
|
||||
// super(width, height, minX, minY, imageType);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 画线颜色设置
|
||||
// */
|
||||
// @Override
|
||||
// public void drawConnection(int[] xPoints, int[] yPoints, boolean conditional, boolean isDefault, String connectionType,
|
||||
// AssociationDirection associationDirection, boolean highLighted, double scaleFactor) {
|
||||
//
|
||||
// Paint originalPaint = g.getPaint();
|
||||
// Stroke originalStroke = g.getStroke();
|
||||
//
|
||||
// g.setPaint(CONNECTION_COLOR);
|
||||
// if (connectionType.equals("association")) {
|
||||
// g.setStroke(ASSOCIATION_STROKE);
|
||||
// } else if (highLighted) {
|
||||
// //设置线的颜色
|
||||
// g.setPaint(originalPaint);
|
||||
// g.setStroke(HIGHLIGHT_FLOW_STROKE);
|
||||
// }
|
||||
//
|
||||
// for (int i = 1; i < xPoints.length; i++) {
|
||||
// Integer sourceX = xPoints[i - 1];
|
||||
// Integer sourceY = yPoints[i - 1];
|
||||
// Integer targetX = xPoints[i];
|
||||
// Integer targetY = yPoints[i];
|
||||
// Line2D.Double line = new Line2D.Double(sourceX, sourceY, targetX, targetY);
|
||||
// g.draw(line);
|
||||
// }
|
||||
//
|
||||
// if (isDefault) {
|
||||
// Line2D.Double line = new Line2D.Double(xPoints[0], yPoints[0], xPoints[1], yPoints[1]);
|
||||
// drawDefaultSequenceFlowIndicator(line, scaleFactor);
|
||||
// }
|
||||
//
|
||||
// if (conditional) {
|
||||
// Line2D.Double line = new Line2D.Double(xPoints[0], yPoints[0], xPoints[1], yPoints[1]);
|
||||
// drawConditionalSequenceFlowIndicator(line, scaleFactor);
|
||||
// }
|
||||
//
|
||||
// if (associationDirection == AssociationDirection.ONE || associationDirection == AssociationDirection.BOTH) {
|
||||
// Line2D.Double line = new Line2D.Double(xPoints[xPoints.length - 2], yPoints[xPoints.length - 2], xPoints[xPoints.length - 1], yPoints[xPoints.length - 1]);
|
||||
// drawArrowHead(line, scaleFactor);
|
||||
// }
|
||||
// if (associationDirection == AssociationDirection.BOTH) {
|
||||
// Line2D.Double line = new Line2D.Double(xPoints[1], yPoints[1], xPoints[0], yPoints[0]);
|
||||
// drawArrowHead(line, scaleFactor);
|
||||
// }
|
||||
// g.setPaint(originalPaint);
|
||||
// g.setStroke(originalStroke);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 高亮节点设置
|
||||
// */
|
||||
// @Override
|
||||
// public void drawHighLight(int x, int y, int width, int height) {
|
||||
// Paint originalPaint = g.getPaint();
|
||||
// Stroke originalStroke = g.getStroke();
|
||||
// //设置高亮节点的颜色
|
||||
// g.setPaint(HIGHLIGHT_COLOR);
|
||||
// g.setStroke(THICK_TASK_BORDER_STROKE);
|
||||
//
|
||||
// RoundRectangle2D rect = new RoundRectangle2D.Double(x, y, width, height, 20, 20);
|
||||
// g.draw(rect);
|
||||
//
|
||||
// g.setPaint(originalPaint);
|
||||
// g.setStroke(originalStroke);
|
||||
// }
|
||||
//}
|
||||
package com.ruoyi.flowable.config;
|
||||
|
||||
import com.sun.prism.paint.Color;
|
||||
import org.flowable.bpmn.model.AssociationDirection;
|
||||
import org.flowable.image.impl.DefaultProcessDiagramCanvas;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.geom.Line2D;
|
||||
import java.awt.geom.RoundRectangle2D;
|
||||
|
||||
/**
|
||||
* @author Tony
|
||||
* @date 2021-04-03
|
||||
*/
|
||||
public class MyDefaultProcessDiagramCanvas extends DefaultProcessDiagramCanvas {
|
||||
|
||||
//设置高亮线的颜色 这里我设置成绿色
|
||||
protected static Color HIGHLIGHT_SEQUENCEFLOW_COLOR = Color.GREEN;
|
||||
|
||||
public MyDefaultProcessDiagramCanvas(int width, int height, int minX, int minY, String imageType, String activityFontName, String labelFontName, String annotationFontName, ClassLoader customClassLoader) {
|
||||
super(width, height, minX, minY, imageType, activityFontName, labelFontName, annotationFontName, customClassLoader);
|
||||
}
|
||||
|
||||
public MyDefaultProcessDiagramCanvas(int width, int height, int minX, int minY, String imageType) {
|
||||
super(width, height, minX, minY, imageType);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 画线颜色设置
|
||||
*/
|
||||
@Override
|
||||
public void drawConnection(int[] xPoints, int[] yPoints, boolean conditional, boolean isDefault, String connectionType,
|
||||
AssociationDirection associationDirection, boolean highLighted, double scaleFactor) {
|
||||
|
||||
Paint originalPaint = g.getPaint();
|
||||
Stroke originalStroke = g.getStroke();
|
||||
|
||||
g.setPaint(CONNECTION_COLOR);
|
||||
if (connectionType.equals("association")) {
|
||||
g.setStroke(ASSOCIATION_STROKE);
|
||||
} else if (highLighted) {
|
||||
//设置线的颜色
|
||||
g.setPaint(originalPaint);
|
||||
g.setStroke(HIGHLIGHT_FLOW_STROKE);
|
||||
}
|
||||
|
||||
for (int i = 1; i < xPoints.length; i++) {
|
||||
Integer sourceX = xPoints[i - 1];
|
||||
Integer sourceY = yPoints[i - 1];
|
||||
Integer targetX = xPoints[i];
|
||||
Integer targetY = yPoints[i];
|
||||
Line2D.Double line = new Line2D.Double(sourceX, sourceY, targetX, targetY);
|
||||
g.draw(line);
|
||||
}
|
||||
|
||||
if (isDefault) {
|
||||
Line2D.Double line = new Line2D.Double(xPoints[0], yPoints[0], xPoints[1], yPoints[1]);
|
||||
drawDefaultSequenceFlowIndicator(line, scaleFactor);
|
||||
}
|
||||
|
||||
if (conditional) {
|
||||
Line2D.Double line = new Line2D.Double(xPoints[0], yPoints[0], xPoints[1], yPoints[1]);
|
||||
drawConditionalSequenceFlowIndicator(line, scaleFactor);
|
||||
}
|
||||
|
||||
if (associationDirection == AssociationDirection.ONE || associationDirection == AssociationDirection.BOTH) {
|
||||
Line2D.Double line = new Line2D.Double(xPoints[xPoints.length - 2], yPoints[xPoints.length - 2], xPoints[xPoints.length - 1], yPoints[xPoints.length - 1]);
|
||||
drawArrowHead(line, scaleFactor);
|
||||
}
|
||||
if (associationDirection == AssociationDirection.BOTH) {
|
||||
Line2D.Double line = new Line2D.Double(xPoints[1], yPoints[1], xPoints[0], yPoints[0]);
|
||||
drawArrowHead(line, scaleFactor);
|
||||
}
|
||||
g.setPaint(originalPaint);
|
||||
g.setStroke(originalStroke);
|
||||
}
|
||||
|
||||
/**
|
||||
* 高亮节点设置
|
||||
*/
|
||||
@Override
|
||||
public void drawHighLight(int x, int y, int width, int height) {
|
||||
Paint originalPaint = g.getPaint();
|
||||
Stroke originalStroke = g.getStroke();
|
||||
//设置高亮节点的颜色
|
||||
g.setPaint(HIGHLIGHT_COLOR);
|
||||
g.setStroke(THICK_TASK_BORDER_STROKE);
|
||||
|
||||
RoundRectangle2D rect = new RoundRectangle2D.Double(x, y, width, height, 20, 20);
|
||||
g.draw(rect);
|
||||
|
||||
g.setPaint(originalPaint);
|
||||
g.setStroke(originalStroke);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,15 +5,13 @@ import com.ruoyi.common.core.domain.AjaxResult;
|
|||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import com.ruoyi.common.enums.SysRoleEnum;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.flowable.service.IFlowBusinessKeyService;
|
||||
import com.ruoyi.system.domain.FlowProcDefDto;
|
||||
import com.ruoyi.system.domain.FlowTaskEntity;
|
||||
import com.ruoyi.system.service.ISysDeptService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
@ -72,4 +70,54 @@ public class FlowBusinessKeyController extends BaseController {
|
|||
flowTaskEntity.setNowUser(Convert.toStr(getUserId()));
|
||||
return success(flowBusinessKeyService.quueryCount(flowTaskEntity));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据流程Id查询操作日志
|
||||
* @param procInsId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/findCommentByProcInsId")
|
||||
public AjaxResult findCommentByProcInsId(String procInsId) {
|
||||
return success(flowBusinessKeyService.selectCommentByProcInsId(procInsId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据流程Id查询表单数据
|
||||
* @param procInsId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/findFormDatasByProcInsId")
|
||||
public AjaxResult findFormDatasByProcInsId(String procInsId) {
|
||||
return success(flowBusinessKeyService.selectFormDatasByProcInsId(procInsId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据条件查询我的代办任务
|
||||
* @param flowTaskEntity
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/myAwaitFlowTaskList")
|
||||
public TableDataInfo myAwaitFlowTaskList(FlowTaskEntity flowTaskEntity) {
|
||||
startPage();
|
||||
flowTaskEntity.setNowRole(Convert.toStr(getUserFirstRole()));
|
||||
if(SysRoleEnum.ZGS.getCode().equals(flowTaskEntity.getNowRole())){
|
||||
flowTaskEntity.setNowDept(Convert.toStr(sysDeptService.getZGSDeptId(getDeptId())));
|
||||
}else{
|
||||
flowTaskEntity.setNowDept(Convert.toStr(getDeptId()));
|
||||
}
|
||||
flowTaskEntity.setNowUser(Convert.toStr(SecurityUtils.getUserId()));
|
||||
return getDataTable(flowBusinessKeyService.selectMyAwaitFlowTask(flowTaskEntity));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据条件查询我的已办任务
|
||||
* @param flowTaskEntity
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/myFinishedFlowTaskList")
|
||||
public TableDataInfo myFinishedFlowTaskList(FlowTaskEntity flowTaskEntity) {
|
||||
startPage();
|
||||
flowTaskEntity.setNowUser(Convert.toStr(SecurityUtils.getUserId()));
|
||||
return getDataTable(flowBusinessKeyService.selectMyFinishedFlowTask(flowTaskEntity));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,4 +24,32 @@ public interface IFlowBusinessKeyService {
|
|||
* @return
|
||||
*/
|
||||
public Map<String,Object> quueryCount(FlowTaskEntity flowTaskEntity);
|
||||
|
||||
/**
|
||||
* 根据条件流程Id查询操作日志
|
||||
* @param procInsId
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> selectCommentByProcInsId(String procInsId);
|
||||
|
||||
/**
|
||||
* 根据流程Id查询表单数据
|
||||
* @param procInsId
|
||||
* @return
|
||||
*/
|
||||
public Map<String, Object> selectFormDatasByProcInsId(String procInsId);
|
||||
|
||||
/**
|
||||
* 查询我的代办任务
|
||||
* @param flowTaskEntity
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> selectMyAwaitFlowTask(FlowTaskEntity flowTaskEntity);
|
||||
|
||||
/**
|
||||
* 查询我的已办任务
|
||||
* @param flowTaskEntity
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> selectMyFinishedFlowTask(FlowTaskEntity flowTaskEntity);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package com.ruoyi.flowable.service.impl;
|
||||
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.flowable.service.IFlowBusinessKeyService;
|
||||
import com.ruoyi.system.domain.FlowTaskEntity;
|
||||
import com.ruoyi.system.mapper.FlowBusinessKeyMapper;
|
||||
|
@ -8,8 +10,10 @@ import org.springframework.stereotype.Service;
|
|||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 业务工作流程自定义
|
||||
|
@ -38,6 +42,7 @@ public class FlowBusinessKeyServiceImpl implements IFlowBusinessKeyService {
|
|||
* @param flowTaskEntity
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Map<String,Object> quueryCount(FlowTaskEntity flowTaskEntity) {
|
||||
flowTaskEntity.setActiveName("await");
|
||||
int awaitSize = flowBusinessKeyMapper.selectAllFlowTaskByParams(flowTaskEntity).size();
|
||||
|
@ -48,4 +53,52 @@ public class FlowBusinessKeyServiceImpl implements IFlowBusinessKeyService {
|
|||
dataMap.put("finished",finishedSize);
|
||||
return dataMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据条件流程Id查询操作日志
|
||||
* @param procInsId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<Map<String, Object>> selectCommentByProcInsId(String procInsId) {
|
||||
return flowBusinessKeyMapper.selectCommentByProcInsId(procInsId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据流程Id查询表单数据
|
||||
* @param procInsId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> selectFormDatasByProcInsId(String procInsId) {
|
||||
Map<String, Object> dataMap = new HashMap<>();
|
||||
List<Map<String, Object>> list = flowBusinessKeyMapper.selectFormDatasByProcInsId(procInsId);
|
||||
Iterator<Map<String, Object>> it = list.iterator();
|
||||
while (it.hasNext()) {
|
||||
Map<String, Object> map = it.next();
|
||||
dataMap.put(Convert.toStr(map.get("name")), map.get("text"));
|
||||
}
|
||||
return dataMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询我的代办任务
|
||||
* @param flowTaskEntity
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<Map<String, Object>> selectMyAwaitFlowTask(FlowTaskEntity flowTaskEntity){
|
||||
flowTaskEntity.setRoleIds(SecurityUtils.getLoginUser().getUser().getRoles().stream().map(role -> role.getRoleId()).collect(Collectors.toList()));
|
||||
return flowBusinessKeyMapper.selectMyAwaitFlowTask(flowTaskEntity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询我的已办任务
|
||||
* @param flowTaskEntity
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<Map<String, Object>> selectMyFinishedFlowTask(FlowTaskEntity flowTaskEntity) {
|
||||
return flowBusinessKeyMapper.selectMyFinishedFlowTask(flowTaskEntity);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -108,8 +108,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|||
taskService.resolveTask(taskVo.getTaskId(), taskVo.getVariables());
|
||||
} else {
|
||||
taskService.addComment(taskVo.getTaskId(), taskVo.getInstanceId(), FlowComment.NORMAL.getType(), taskVo.getComment());
|
||||
Long userId = SecurityUtils.getLoginUser().getUser().getUserId();
|
||||
taskService.setAssignee(taskVo.getTaskId(), userId.toString());
|
||||
taskService.setAssignee(taskVo.getTaskId(), taskVo.getUserId());
|
||||
taskService.complete(taskVo.getTaskId(), taskVo.getVariables());
|
||||
}
|
||||
return AjaxResult.success();
|
||||
|
@ -214,8 +213,9 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|||
}
|
||||
}));
|
||||
// 设置驳回意见
|
||||
currentTaskIds.forEach(item -> taskService.addComment(item, task.getProcessInstanceId(), FlowComment.REJECT.getType(), flowTaskVo.getComment()));
|
||||
|
||||
currentTaskIds.forEach(item ->
|
||||
taskService.addComment(item, task.getProcessInstanceId(), FlowComment.REJECT.getType(), flowTaskVo.getComment()));
|
||||
taskService.setAssignee(flowTaskVo.getTaskId(), flowTaskVo.getUserId());
|
||||
try {
|
||||
// 如果父级任务多于 1 个,说明当前节点不是并行节点,原因为不考虑多对多情况
|
||||
if (targetIds.size() > 1) {
|
||||
|
@ -884,13 +884,13 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|||
map.put("flowList", hisFlowList);
|
||||
}
|
||||
// 第一次申请获取初始化表单
|
||||
if (StringUtils.isNotBlank(deployId)) {
|
||||
SysForm sysForm = sysInstanceFormService.selectSysDeployFormByDeployId(deployId);
|
||||
if (Objects.isNull(sysForm)) {
|
||||
return AjaxResult.error("请先配置流程表单");
|
||||
}
|
||||
map.put("formData", JSONObject.parseObject(sysForm.getFormContent()));
|
||||
}
|
||||
// if (StringUtils.isNotBlank(deployId)) {
|
||||
// SysForm sysForm = sysInstanceFormService.selectSysDeployFormByDeployId(deployId);
|
||||
// if (Objects.isNull(sysForm)) {
|
||||
// return AjaxResult.error("请先配置流程表单");
|
||||
// }
|
||||
// map.put("formData", JSONObject.parseObject(sysForm.getFormContent()));
|
||||
// }
|
||||
return AjaxResult.success(map);
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
|
|||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>工作流任务<p>
|
||||
|
@ -16,6 +17,8 @@ public class FlowTaskEntity extends BaseEntity{
|
|||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String businessKey;
|
||||
|
||||
@ApiModelProperty("业务名称")
|
||||
private String businessKeyName;
|
||||
|
||||
|
@ -96,6 +99,8 @@ public class FlowTaskEntity extends BaseEntity{
|
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date finishTime;
|
||||
|
||||
private List<Long> roleIds;
|
||||
|
||||
public String getBusinessKeyName() {
|
||||
return businessKeyName;
|
||||
}
|
||||
|
@ -305,4 +310,20 @@ public class FlowTaskEntity extends BaseEntity{
|
|||
public void setFinishTime(Date finishTime) {
|
||||
this.finishTime = finishTime;
|
||||
}
|
||||
|
||||
public List<Long> getRoleIds() {
|
||||
return roleIds;
|
||||
}
|
||||
|
||||
public void setRoleIds(List<Long> roleIds) {
|
||||
this.roleIds = roleIds;
|
||||
}
|
||||
|
||||
public String getBusinessKey() {
|
||||
return businessKey;
|
||||
}
|
||||
|
||||
public void setBusinessKey(String businessKey) {
|
||||
this.businessKey = businessKey;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.ruoyi.system.mapper;
|
|||
import com.ruoyi.system.domain.FlowTaskEntity;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/***
|
||||
* 工作流业务相关
|
||||
|
@ -15,4 +16,33 @@ public interface FlowBusinessKeyMapper {
|
|||
* @return
|
||||
*/
|
||||
public List<FlowTaskEntity> selectAllFlowTaskByParams(FlowTaskEntity flowTaskEntity);
|
||||
|
||||
/**
|
||||
* 根据流程Id查询操作日志
|
||||
* @param procInsId
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> selectCommentByProcInsId(String procInsId);
|
||||
|
||||
/**
|
||||
* 根据流程Id查询表单数据
|
||||
* @param procInsId
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> selectFormDatasByProcInsId(String procInsId);
|
||||
|
||||
/**
|
||||
* 查询我的代办任务
|
||||
* @param flowTaskEntity
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> selectMyAwaitFlowTask(FlowTaskEntity flowTaskEntity);
|
||||
|
||||
/**
|
||||
* 查询我的已办任务
|
||||
* @param flowTaskEntity
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> selectMyFinishedFlowTask(FlowTaskEntity flowTaskEntity);
|
||||
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
<!--子部门数据-->
|
||||
<if test='nowRole == "4"'> and fa.businesDeptId = #{nowDept}</if>
|
||||
<!--监理单位/总包公司/分包单位查询当前关联数据-->
|
||||
<if test='nowRole == "5" or nowRole == "6" or nowRole == "7"'> and fa.businesDeptId = #{nowDept}</if>
|
||||
<if test='nowRole == "5" or nowRole == "6" or nowRole == "7"'> and fa.businessKey in (select DISTINCT projectId from sur_project_unit_info where unitId=#{nowDept} and del_flag=0)</if>
|
||||
<!--普通用户查询项目人员-->
|
||||
<if test='nowRole == "15" or nowRole == "16" or nowRole == "17" or nowRole == "99"'> and fa.startUserId = #{nowUser}</if>
|
||||
<if test='activeName == "await"'> and fa.finishTime is null</if>
|
||||
|
@ -47,4 +47,61 @@
|
|||
order by fa.createTime desc
|
||||
</select>
|
||||
|
||||
<!--查询工作流操作日志-->
|
||||
<select id="selectCommentByProcInsId" parameterType="string" resultType="map">
|
||||
select * from vw_flow_comment where procInstId = #{procInstId} order by startTime DESC
|
||||
</select>
|
||||
|
||||
<!--查询工作流携带的参数-->
|
||||
<select id="selectFormDatasByProcInsId" parameterType="string" resultType="map">
|
||||
select hv.NAME_ as `name`,hv.TEXT_ as text from act_hi_varinst hv where hv.PROC_INST_ID_ = #{procInstId}
|
||||
</select>
|
||||
|
||||
<!--查询我的代办任务-->
|
||||
<select id="selectMyAwaitFlowTask" parameterType="com.ruoyi.system.domain.FlowTaskEntity" resultType="map">
|
||||
select fa.* from vw_flow_await fa
|
||||
where
|
||||
1=1
|
||||
<if test="procDefName != null and procDefName != ''"> and fa.procDefName like concat('%', #{procDefName}, '%')</if>
|
||||
<if test="businessKeyName != null and businessKeyName != ''"> and fa.businessKeyName like concat('%', #{businessKeyName}, '%')</if>
|
||||
<if test="category != null and category != ''"> and fa.category = #{category}</if>
|
||||
<if test="params.beginDate != null and params.beginDate != '' and params.endDate != null and params.endDate != ''"> and fa.createTime between #{params.beginDate} and #{params.endDate}</if>
|
||||
<!-- 查询条件-项目部门 -->
|
||||
<if test="projectDeptId != null "> and fa.businesDeptId = #{projectDeptId}</if>
|
||||
<!--子部门数据-->
|
||||
<if test='nowRole == "4"'> and fa.businesDeptId = #{nowDept}</if>
|
||||
<!--监理单位/总包公司/分包单位查询当前关联数据-->
|
||||
<if test='nowRole == "5" or nowRole == "6" or nowRole == "7"'> and fa.businessKey in (select DISTINCT projectId from sur_project_unit_info where unitId=#{nowDept} and del_flag=0)</if>
|
||||
<!--普通用户查询项目人员-->
|
||||
<if test='nowRole == "15" or nowRole == "16" or nowRole == "17" or nowRole == "99"'> and fa.businessKey in (select DISTINCT projectId from sur_project_userinfo where user_id=#{nowUser} and is_del=0)</if>
|
||||
AND (fa.ASSIGNEE_ = #{nowUser}
|
||||
OR (
|
||||
fa.ASSIGNEE_ IS NULL
|
||||
AND (
|
||||
fa.USER_ID_ = #{nowUser}
|
||||
OR (
|
||||
fa.GROUP_ID_ IN
|
||||
<foreach collection="roleIds" item="roleId" open="(" separator="," close=")">
|
||||
#{roleId}
|
||||
</foreach>
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
order by fa.createTime desc
|
||||
</select>
|
||||
|
||||
<!--查询我的已办任务-->
|
||||
<select id="selectMyFinishedFlowTask" parameterType="com.ruoyi.system.domain.FlowTaskEntity" resultType="map">
|
||||
select fa.* from vw_flow_finished fa
|
||||
where
|
||||
fa.ASSIGNEE_=#{nowUser}
|
||||
<if test="procDefName != null and procDefName != ''"> and fa.procDefName like concat('%', #{procDefName}, '%')</if>
|
||||
<if test="businessKey != null and businessKey != ''"> and fa.businessKey = #{businessKey}</if>
|
||||
<if test="businessKeyName != null and businessKeyName != ''"> and fa.businessKeyName like concat('%', #{businessKeyName}, '%')</if>
|
||||
<if test="category != null and category != ''"> and fa.category = #{category}</if>
|
||||
<if test="params.beginDate != null and params.beginDate != '' and params.endDate != null and params.endDate != ''"> and fa.endTime between #{params.beginDate} and #{params.endDate}</if>
|
||||
order by fa.endTime desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
|
@ -17,3 +17,40 @@ export function queryCount(query) {
|
|||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 根据业务流程查询操作日志
|
||||
export function findCommentByProcInsId(query) {
|
||||
return request({
|
||||
url: '/flowable/businessKey/findCommentByProcInsId',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 根据业务流程查询表单数据
|
||||
export function findFormDatasByProcInsId(query) {
|
||||
return request({
|
||||
url: '/flowable/businessKey/findFormDatasByProcInsId',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 根据条件查询我的代办任务
|
||||
export function myAwaitFlowTaskList(query) {
|
||||
return request({
|
||||
url: '/flowable/businessKey/myAwaitFlowTaskList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 根据条件查询我的已办任务
|
||||
export function myFinishedFlowTaskList(query) {
|
||||
return request({
|
||||
url: '/flowable/businessKey/myFinishedFlowTaskList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ const getters = {
|
|||
cachedViews: state => state.tagsView.cachedViews,
|
||||
token: state => state.user.token,
|
||||
avatar: state => state.user.avatar,
|
||||
userId: state => state.user.userId,
|
||||
name: state => state.user.name,
|
||||
dept:state=>state.user.dept,
|
||||
introduction: state => state.user.introduction,
|
||||
|
|
|
@ -4,6 +4,7 @@ import { getToken, setToken, removeToken } from '@/utils/auth'
|
|||
const user = {
|
||||
state: {
|
||||
token: getToken(),
|
||||
userId:'',
|
||||
name: '',
|
||||
avatar: '',
|
||||
dept:null,
|
||||
|
@ -15,6 +16,9 @@ const user = {
|
|||
SET_TOKEN: (state, token) => {
|
||||
state.token = token
|
||||
},
|
||||
SET_USER_ID: (state, id) => {
|
||||
state.userId = id
|
||||
},
|
||||
SET_NAME: (state, name) => {
|
||||
state.name = name
|
||||
},
|
||||
|
@ -62,6 +66,7 @@ const user = {
|
|||
} else {
|
||||
commit('SET_ROLES', ['ROLE_DEFAULT'])
|
||||
}
|
||||
commit('SET_USER_ID', user.userId)
|
||||
commit('SET_NAME', user.userName)
|
||||
commit("SET_DEPT",user.dept);
|
||||
commit('SET_AVATAR', avatar)
|
||||
|
|
|
@ -124,10 +124,10 @@ export default {
|
|||
this.taskForm.procInsId = this.$route.query && this.$route.query.procInsId;
|
||||
// 回显流程记录
|
||||
// 流程任务重获取变量表单
|
||||
if (this.taskForm.taskId){
|
||||
this.processVariables( this.taskForm.taskId)
|
||||
}
|
||||
this.getFlowRecordList( this.taskForm.procInsId, this.taskForm.deployId);
|
||||
//if (this.taskForm.taskId){
|
||||
// this.processVariables( this.taskForm.taskId)
|
||||
//}
|
||||
//this.getFlowRecordList( this.taskForm.procInsId, this.taskForm.deployId);
|
||||
},
|
||||
methods: {
|
||||
handleClick(tab, event) {
|
||||
|
|
|
@ -1,22 +1,40 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-form-item label="流程名称" prop="procDefName">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
v-model="queryParams.procDefName"
|
||||
placeholder="请输入名称"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="开始时间" prop="deployTime">
|
||||
<el-date-picker clearable size="small"
|
||||
v-model="queryParams.deployTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择时间">
|
||||
</el-date-picker>
|
||||
<el-form-item label="流程类型" prop="category">
|
||||
<el-select
|
||||
v-model="queryParams.category"
|
||||
@keyup.enter.native="handleQuery"
|
||||
placeholder="请选择流程类型"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in dict.type.sys_process_category"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="办理时间">
|
||||
<el-date-picker
|
||||
v-model="daterangeCheckTime"
|
||||
style="width: 240px"
|
||||
value-format="yyyy-MM-dd"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
|
@ -24,7 +42,7 @@
|
|||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<!-- <el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
|
@ -37,22 +55,41 @@
|
|||
>删除</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</el-row> -->
|
||||
|
||||
<el-table v-loading="loading" :data="finishedList" border @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 v-loading="loading" :data="finishedList" @selection-change="handleSelectionChange">
|
||||
<el-table-column label="项目名称" align="center" prop="businessKeyName" width="220" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="任务编号" align="center" prop="taskId" width="80" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="流程名称" align="center" prop="procDefName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="任务节点" align="center" prop="taskName" />
|
||||
<el-table-column label="流程发起人" align="center">
|
||||
<el-table-column label="流程类别" align="center" prop="category" width="130">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag
|
||||
:options="dict.type.sys_process_category"
|
||||
:value="scope.row.category"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="任务节点" align="center" prop="taskName" width="110"/>
|
||||
<el-table-column label="流程发起人" align="center" width="180">
|
||||
<template slot-scope="scope">
|
||||
<label>{{scope.row.startUserName}} <el-tag type="info" size="mini">{{scope.row.startDeptName}}</el-tag></label>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="接收时间" align="center" prop="createTime" width="180"/>
|
||||
<el-table-column label="审批时间" align="center" prop="finishTime" width="180"/>
|
||||
<el-table-column label="耗时" align="center" prop="duration" width="180"/>
|
||||
<el-table-column label="操作" width="150" fixed="right" class-name="small-padding fixed-width">
|
||||
<el-table-column label="接收时间" align="center" prop="createTime" width="160"/>
|
||||
<el-table-column label="审批时间" align="center" prop="endTime" width="160"/>
|
||||
<el-table-column label="审批耗时" align="center" prop="duration" width="140">
|
||||
<template slot-scope="scope">
|
||||
{{getDurationDate(scope.row)}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="流程状态" align="center" width="80">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.finishTime == null" size="mini">进行中</el-tag>
|
||||
<el-tag type="success" v-if="scope.row.finishTime != null && scope.row.ASSIGNEE_ != null" size="mini">已完成</el-tag>
|
||||
<el-tag type="danger" v-if="scope.row.finishTime != null && scope.row.ASSIGNEE_ == null" size="mini">已撤销</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="150" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
|
@ -60,7 +97,7 @@
|
|||
icon="el-icon-tickets"
|
||||
@click="handleFlowRecord(scope.row)"
|
||||
>流转记录</el-button>
|
||||
<el-button
|
||||
<el-button v-if="scope.row.finishTime == null"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-refresh-left"
|
||||
|
@ -83,11 +120,13 @@
|
|||
|
||||
<script>
|
||||
import { finishedList, getDeployment, delDeployment, addDeployment, updateDeployment, exportDeployment, revokeProcess } from "@/api/flowable/finished";
|
||||
import {myFinishedFlowTaskList} from "@/api/flowable/businessKey";
|
||||
|
||||
export default {
|
||||
name: "Deploy",
|
||||
components: {
|
||||
},
|
||||
dicts: ["sys_process_category"],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
|
@ -113,21 +152,16 @@ export default {
|
|||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: null,
|
||||
procDefName: null,
|
||||
category: null,
|
||||
key: null,
|
||||
tenantId: null,
|
||||
deployTime: null,
|
||||
derivedFrom: null,
|
||||
derivedFromRoot: null,
|
||||
parentDeploymentId: null,
|
||||
engineVersion: null
|
||||
params: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
},
|
||||
daterangeCheckTime:[]
|
||||
};
|
||||
},
|
||||
created() {
|
||||
|
@ -137,9 +171,19 @@ export default {
|
|||
/** 查询流程定义列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
finishedList(this.queryParams).then(response => {
|
||||
this.finishedList = response.data.records;
|
||||
this.total = response.data.total;
|
||||
// finishedList(this.queryParams).then(response => {
|
||||
// this.finishedList = response.data.records;
|
||||
// this.total = response.data.total;
|
||||
// this.loading = false;
|
||||
// });
|
||||
this.queryParams.params = {};
|
||||
if (null != this.daterangeCheckTime && "" != this.daterangeCheckTime) {
|
||||
this.queryParams.params["beginDate"] = this.daterangeCheckTime[0];
|
||||
this.queryParams.params["endDate"] = this.daterangeCheckTime[1];
|
||||
}
|
||||
myFinishedFlowTaskList(this.queryParams).then(response => {
|
||||
this.finishedList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
|
@ -160,26 +204,12 @@ export default {
|
|||
derivedFrom: null,
|
||||
derivedFromRoot: null,
|
||||
parentDeploymentId: null,
|
||||
engineVersion: null
|
||||
engineVersion: null,
|
||||
params: null,
|
||||
};
|
||||
this.daterangeCheckTime=[];
|
||||
this.resetForm("form");
|
||||
},
|
||||
setIcon(val){
|
||||
if (val){
|
||||
return "el-icon-check";
|
||||
}else {
|
||||
return "el-icon-time";
|
||||
}
|
||||
|
||||
},
|
||||
setColor(val){
|
||||
if (val){
|
||||
return "#2bc418";
|
||||
}else {
|
||||
return "#b3bdbb";
|
||||
}
|
||||
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
|
@ -188,6 +218,7 @@ export default {
|
|||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.daterangeCheckTime=[];
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
|
@ -277,7 +308,41 @@ export default {
|
|||
}).then(response => {
|
||||
this.download(response.msg);
|
||||
})
|
||||
}
|
||||
},
|
||||
getDurationDate(row){
|
||||
let day=0;
|
||||
let hours=0;
|
||||
let min = row.duration;
|
||||
if(min>1440){
|
||||
day = parseInt(min/1440);
|
||||
min = min % 1440;
|
||||
if(min>60){
|
||||
hours = parseInt(min/60);
|
||||
min = min % 60;
|
||||
}
|
||||
}else if(min>60){
|
||||
hours = parseInt(min/60);
|
||||
min = min % 60;
|
||||
}
|
||||
if(day>0){
|
||||
if(day<10) day="0"+day;
|
||||
if(hours<10) hours="0"+hours;
|
||||
if(min<10) min="0"+min;
|
||||
return day+"天"+hours+"小时"+min+"分钟";
|
||||
}
|
||||
if(hours>0){
|
||||
if(hours<10) hours="0"+hours;
|
||||
if(min<10) min="0"+min;
|
||||
return hours+"小时"+min+"分钟";
|
||||
}
|
||||
if(min>0){
|
||||
if(min<10) min="0"+min;
|
||||
return min+"分钟";
|
||||
}
|
||||
if(min==0){
|
||||
return "1分钟";
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -113,8 +113,8 @@ export default {
|
|||
this.taskForm.procInsId = this.$route.query && this.$route.query.procInsId;
|
||||
// 回显流程记录
|
||||
// 流程任务重获取变量表单
|
||||
this.processVariables( this.taskForm.taskId)
|
||||
this.getFlowRecordList(this.taskForm.procInsId, this.taskForm.deployId);
|
||||
//this.processVariables( this.taskForm.taskId)
|
||||
//this.getFlowRecordList(this.taskForm.procInsId, this.taskForm.deployId);
|
||||
},
|
||||
methods: {
|
||||
handleClick(tab, event) {
|
||||
|
|
|
@ -0,0 +1,223 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-drawer
|
||||
v-if="onOpen"
|
||||
:visible.sync="onOpen"
|
||||
ref="drawer"
|
||||
direction="rtl"
|
||||
size="60%"
|
||||
@close="closeCallBack"
|
||||
style="padding-left: 20px; padding-right: 20px"
|
||||
>
|
||||
<template slot="title">
|
||||
<div>申请流程详情 【{{ title }}】</div>
|
||||
</template>
|
||||
<el-form
|
||||
ref="form"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
v-loading="loading"
|
||||
label-width="120px"
|
||||
style="padding-right: 35px"
|
||||
>
|
||||
<div class="canvas" ref="flowCanvas"></div>
|
||||
<div class="maskLayer" />
|
||||
<el-form-item label="所属项目">
|
||||
{{ initData.projectName }}
|
||||
</el-form-item>
|
||||
<el-form-item label="发起单位">
|
||||
{{ deptName }}
|
||||
</el-form-item>
|
||||
<el-form-item label="发起人">
|
||||
{{ nickName }}
|
||||
</el-form-item>
|
||||
<el-form-item label="审批事项">
|
||||
{{ title }}
|
||||
</el-form-item>
|
||||
<el-form-item label="审批内容" prop="files">
|
||||
<FileUpload
|
||||
@input="fileInput"
|
||||
:limit="9"
|
||||
:fileType="['pdf', 'png', 'jpg', 'jpeg', 'doc', 'docx', 'xls', 'xlsx']"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="申请说明" prop="remark">
|
||||
<el-input
|
||||
type="textarea"
|
||||
v-model="form.remark"
|
||||
placeholder="请输入申请说明"
|
||||
rows="5"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div style="text-align: center">
|
||||
<el-button type="primary" @click="submitForm">提交流程</el-button>
|
||||
<el-button @click="doCanel">取 消</el-button>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import store from "@/store";
|
||||
import { definitionStart, flowXmlAndNode } from "@/api/flowable/definition";
|
||||
import { CustomViewer as BpmnViewer } from "@/components/customBpmn";
|
||||
import { getNextFlowNodeByStart } from "@/api/flowable/todo";
|
||||
|
||||
export default {
|
||||
components: {},
|
||||
props: {
|
||||
closeCallBack: {
|
||||
type: Function,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 抽屉层
|
||||
onOpen: false,
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
// 标题
|
||||
title: "",
|
||||
// 表单参数
|
||||
form: {
|
||||
businessKey: "",
|
||||
projectName: "",
|
||||
files: "",
|
||||
remark: "",
|
||||
},
|
||||
// 表单校验
|
||||
rules: {
|
||||
businessKey: [{ required: true, message: "请选择所属项目", trigger: "blur" }],
|
||||
files: [{ required: true, message: "请上传申请内容", trigger: "blur" }],
|
||||
remark: [
|
||||
{ required: false, message: "请输入申请说明", trigger: "blur" },
|
||||
{
|
||||
max: 500,
|
||||
message: "申请说明最多输入500字",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
},
|
||||
projectOptions: null,
|
||||
deptName: null,
|
||||
nickName: null,
|
||||
disPro: false,
|
||||
bpmnViewer: null,
|
||||
options: {},
|
||||
taskTitle: null,
|
||||
taskOpen: false,
|
||||
daterangeMarksTime: [],
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {},
|
||||
mounted() {},
|
||||
beforeDestroy() {},
|
||||
methods: {
|
||||
// 查询和我相关的项目信息
|
||||
initMyProject() {
|
||||
// 获取项目列表的接口
|
||||
this.$api.publics.getMyProjectList({}).then((response) => {
|
||||
this.projectOptions = response.rows;
|
||||
if (response.rows.length == 0) {
|
||||
this.$message.error("未查询到和您关联项目,请联系子公司或管理员...");
|
||||
} else if (response.rows.length == 1) {
|
||||
// 这里只有一个项目,默认选中并只读
|
||||
this.form.businessKey = response.rows[0].id;
|
||||
this.form.projectName = response.rows[0].projectName;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 项目选择
|
||||
projectChage(val) {
|
||||
let projectName = "";
|
||||
this.projectOptions.forEach((item) => {
|
||||
if ((item.id = val)) {
|
||||
projectName = item.projectName;
|
||||
return;
|
||||
}
|
||||
});
|
||||
this.form.projectName = projectName;
|
||||
},
|
||||
doCanel() {
|
||||
this.onOpen = false;
|
||||
},
|
||||
show(options) {
|
||||
this.options = options;
|
||||
this.initMyProject();
|
||||
this.title = options.name;
|
||||
this.deptName = store.getters.dept.deptName;
|
||||
this.nickName = store.getters.name;
|
||||
const self = this;
|
||||
this.onOpen = true;
|
||||
flowXmlAndNode({ deployId: options.deploymentId }).then((res) => {
|
||||
this.initFlowImage(res.data.xmlData);
|
||||
});
|
||||
},
|
||||
async initFlowImage(data) {
|
||||
try {
|
||||
self.bpmnViewer = new BpmnViewer({
|
||||
container: this.$refs.flowCanvas,
|
||||
height: "150px",
|
||||
});
|
||||
await self.bpmnViewer.importXML(data);
|
||||
// 自适应
|
||||
self.bpmnViewer.get("canvas").zoom("fit-viewport", "auto");
|
||||
} catch (err) {
|
||||
console.error(err.message, err.warnings);
|
||||
}
|
||||
},
|
||||
fileInput(files) {
|
||||
let fileUrls = "";
|
||||
if (files.length > 0) {
|
||||
fileUrls = "";
|
||||
files.forEach((item) => {
|
||||
fileUrls += "," + item.url;
|
||||
});
|
||||
fileUrls = fileUrls.substring(1);
|
||||
}
|
||||
this.form.files = fileUrls;
|
||||
},
|
||||
submitForm() {
|
||||
this.$refs["form"].validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true;
|
||||
// 根据当前任务或者流程设计配置的下一步节点 todo 暂时未涉及到考虑网关、表达式和多节点情况
|
||||
// getNextFlowNodeByStart({
|
||||
// deploymentId: this.options.deploymentId,
|
||||
// variables: this.form,
|
||||
// }).then((res) => {
|
||||
// const data = res.data;
|
||||
// if (data) {
|
||||
// console.log(data);
|
||||
// this.loading = false;
|
||||
// }
|
||||
// });
|
||||
// 启动流程并将表单数据加入流程变量
|
||||
|
||||
definitionStart(this.options.id, JSON.stringify(this.form)).then((res) => {
|
||||
this.$modal.msgSuccess(res.msg);
|
||||
this.loading = false;
|
||||
//关闭并刷新列表
|
||||
this.$refs.drawer.closeDrawer();
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.bjs-powered-by {
|
||||
display: none !important;
|
||||
}
|
||||
.maskLayer {
|
||||
width: 100%;
|
||||
height: 150px;
|
||||
position: absolute;
|
||||
z-index: 9999;
|
||||
top: 66px;
|
||||
}
|
||||
</style>
|
|
@ -103,7 +103,7 @@
|
|||
<div v-if="scope.row.finishTime != null">结束</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="耗时" align="center" prop="duration" width="150">
|
||||
<el-table-column label="处理耗时" align="center" prop="duration" width="150">
|
||||
<template slot-scope="scope">
|
||||
{{getDurationDate(scope.row)}}
|
||||
</template>
|
||||
|
@ -197,6 +197,7 @@
|
|||
/>
|
||||
</el-dialog>
|
||||
<initTaskDrawer ref="initTaskDrawer" :closeCallBack="getList"></initTaskDrawer>
|
||||
<detailDrawer ref="detailDrawer"></detailDrawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -213,10 +214,12 @@ import { myProcessList,stopProcess } from "@/api/flowable/process";
|
|||
import {allList,queryCount} from "@/api/flowable/businessKey";
|
||||
import {myDefinitionList} from "@/api/flowable/definition";
|
||||
import initTaskDrawer from "./initTaskDrawer.vue";
|
||||
import detailDrawer from "./detail/detailDrawer.vue";
|
||||
export default {
|
||||
name: "Deploy",
|
||||
components: {
|
||||
initTaskDrawer
|
||||
initTaskDrawer,
|
||||
detailDrawer
|
||||
},
|
||||
dicts: ["sys_process_category"],
|
||||
data() {
|
||||
|
@ -385,21 +388,24 @@ export default {
|
|||
const params = {
|
||||
instanceId: row.procInsId
|
||||
}
|
||||
this.loading = true;
|
||||
stopProcess(params).then( res => {
|
||||
this.$modal.msgSuccess(res.msg);
|
||||
this.loading=false;
|
||||
this.$modal.confirm('撤销流程会终止,是否继续?').then(function() {
|
||||
this.loading = true;
|
||||
return stopProcess(params);
|
||||
}).then(res => {
|
||||
this.$modal.msgSuccess(res.msg);
|
||||
this.loading=false;
|
||||
this.getList();
|
||||
});
|
||||
},
|
||||
/** 流程流转记录 */
|
||||
handleFlowRecord(row){
|
||||
this.$router.push({ path: '/flowable/task/myProcess/detail/index',
|
||||
query: {
|
||||
procInsId: row.procInsId,
|
||||
deployId: row.deployId,
|
||||
taskId: row.taskId
|
||||
}})
|
||||
this.$refs.detailDrawer.show(row);
|
||||
// this.$router.push({ path: '/flowable/task/myProcess/detail/index',
|
||||
// query: {
|
||||
// procInsId: row.procInsId,
|
||||
// deployId: row.deployId,
|
||||
// taskId: row.taskId
|
||||
// }})
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
|
@ -434,7 +440,7 @@ export default {
|
|||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.procInsId || this.ids;// 暂不支持删除多个流程
|
||||
this.$confirm('是否确认删除流程定义编号为"' + ids + '"的数据项?', "警告", {
|
||||
this.$confirm('是否确认删除流程定义编号为"' + ids + '"的数据项?删除后数据将不可找回!!', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
|
@ -480,10 +486,24 @@ export default {
|
|||
hours = parseInt(min/60);
|
||||
min = min % 60;
|
||||
}
|
||||
if(day<10) day="0"+day;
|
||||
if(hours<10) hours="0"+hours;
|
||||
if(min<10) min="0"+min;
|
||||
return day+"天"+hours+"小时"+min+"分钟";
|
||||
if(day>0){
|
||||
if(day<10) day="0"+day;
|
||||
if(hours<10) hours="0"+hours;
|
||||
if(min<10) min="0"+min;
|
||||
return day+"天"+hours+"小时"+min+"分钟";
|
||||
}
|
||||
if(hours>0){
|
||||
if(hours<10) hours="0"+hours;
|
||||
if(min<10) min="0"+min;
|
||||
return hours+"小时"+min+"分钟";
|
||||
}
|
||||
if(min>0){
|
||||
if(min<10) min="0"+min;
|
||||
return min+"分钟";
|
||||
}
|
||||
if(min==0){
|
||||
return "1分钟";
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
|
|
|
@ -64,11 +64,11 @@
|
|||
rows="5"
|
||||
/>
|
||||
</el-form-item>
|
||||
<div style="text-align: center">
|
||||
<el-button type="primary" @click="submitForm">提交流程</el-button>
|
||||
<el-button @click="doCanel">取 消</el-button>
|
||||
</div>
|
||||
</el-form>
|
||||
<div style="text-align: center">
|
||||
<el-button type="primary" @click="submitForm">提交流程</el-button>
|
||||
<el-button @click="doCanel">取 消</el-button>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -1,22 +1,40 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-form-item label="流程名称" prop="procDefName">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
v-model="queryParams.procDefName"
|
||||
placeholder="请输入名称"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="开始时间" prop="deployTime">
|
||||
<el-date-picker clearable size="small"
|
||||
v-model="queryParams.deployTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择时间">
|
||||
</el-date-picker>
|
||||
<el-form-item label="流程类型" prop="category">
|
||||
<el-select
|
||||
v-model="queryParams.category"
|
||||
@keyup.enter.native="handleQuery"
|
||||
placeholder="请选择流程类型"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in dict.type.sys_process_category"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="接受时间">
|
||||
<el-date-picker
|
||||
v-model="daterangeCheckTime"
|
||||
style="width: 240px"
|
||||
value-format="yyyy-MM-dd"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
|
@ -24,33 +42,25 @@
|
|||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['system:deployment:remove']"
|
||||
>删除
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="todoList" border @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="center" prop="procDefName"/>
|
||||
<el-table v-loading="loading" :data="todoList" @selection-change="handleSelectionChange">
|
||||
<el-table-column label="项目名称" align="center" prop="businessKeyName" width="250" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="任务编号" align="center" prop="taskId" width="120" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="流程名称" align="center" prop="procDefName" width="180" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="流程类别" align="center" prop="category" width="180">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag
|
||||
:options="dict.type.sys_process_category"
|
||||
:value="scope.row.category"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="当前节点" align="center" prop="taskName"/>
|
||||
<el-table-column label="流程版本" align="center">
|
||||
<el-table-column label="流程版本" align="center" width="80">
|
||||
<template slot-scope="scope">
|
||||
<el-tag size="medium" >v{{scope.row.procDefVersion}}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="流程发起人" align="center">
|
||||
<el-table-column label="流程发起人" align="center" width="180">
|
||||
<template slot-scope="scope">
|
||||
<label>{{scope.row.startUserName}} <el-tag type="info" size="mini">{{scope.row.startDeptName}}</el-tag></label>
|
||||
</template>
|
||||
|
@ -76,24 +86,21 @@
|
|||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<approveDrawer ref="approveDrawer" :closeCallBack="getList"></approveDrawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
todoList,
|
||||
complete,
|
||||
returnList,
|
||||
returnTask,
|
||||
rejectTask,
|
||||
getDeployment,
|
||||
delDeployment,
|
||||
exportDeployment
|
||||
} from "@/api/flowable/todo";
|
||||
import {myAwaitFlowTaskList} from "@/api/flowable/businessKey";
|
||||
import approveDrawer from "./detail/approveDrawer.vue";
|
||||
|
||||
export default {
|
||||
name: "Deploy",
|
||||
components: {},
|
||||
components: {approveDrawer},
|
||||
dicts: ["sys_process_category"],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
|
@ -118,13 +125,15 @@ export default {
|
|||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: null,
|
||||
category: null
|
||||
procDefName: null,
|
||||
category: null,
|
||||
params: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {}
|
||||
rules: {},
|
||||
daterangeCheckTime:[],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
|
@ -134,23 +143,34 @@ export default {
|
|||
/** 查询流程定义列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
todoList(this.queryParams).then(response => {
|
||||
this.todoList = response.data.records;
|
||||
this.total = response.data.total;
|
||||
this.queryParams.params = {};
|
||||
if (null != this.daterangeCheckTime && "" != this.daterangeCheckTime) {
|
||||
this.queryParams.params["beginDate"] = this.daterangeCheckTime[0];
|
||||
this.queryParams.params["endDate"] = this.daterangeCheckTime[1];
|
||||
}
|
||||
// todoList(this.queryParams).then(response => {
|
||||
// this.todoList = response.data.records;
|
||||
// this.total = response.data.total;
|
||||
// this.loading = false;
|
||||
// });
|
||||
myAwaitFlowTaskList(this.queryParams).then(response => {
|
||||
this.todoList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 跳转到处理页面
|
||||
handleProcess(row){
|
||||
this.$router.push({ path: '/flowable/task/todo/detail/index',
|
||||
query: {
|
||||
procInsId: row.procInsId,
|
||||
executionId: row.executionId,
|
||||
deployId: row.deployId,
|
||||
taskId: row.taskId,
|
||||
taskName: row.taskName,
|
||||
startUser: row.startUserName + '-' + row.startDeptName,
|
||||
}})
|
||||
this.$refs.approveDrawer.show(row);
|
||||
// this.$router.push({ path: '/flowable/task/todo/detail/index',
|
||||
// query: {
|
||||
// procInsId: row.procInsId,
|
||||
// executionId: row.executionId,
|
||||
// deployId: row.deployId,
|
||||
// taskId: row.taskId,
|
||||
// taskName: row.taskName,
|
||||
// startUser: row.startUserName + '-' + row.startDeptName,
|
||||
// }})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
|
@ -171,6 +191,7 @@ export default {
|
|||
parentDeploymentId: null,
|
||||
engineVersion: null
|
||||
};
|
||||
this.daterangeCheckTime=[];
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
|
@ -181,6 +202,7 @@ export default {
|
|||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.daterangeCheckTime=[];
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
|
|
Loading…
Reference in New Issue