提交代码

dev_xds
姜玉琦 2023-09-09 22:33:35 +08:00
parent 1490c32d5e
commit cd4eae7450
18 changed files with 853 additions and 242 deletions

View File

@ -1,95 +1,96 @@
//package com.ruoyi.flowable.config; package com.ruoyi.flowable.config;
//
//import com.sun.prism.paint.Color; import com.sun.prism.paint.Color;
//import org.flowable.bpmn.model.AssociationDirection; import org.flowable.bpmn.model.AssociationDirection;
//import org.flowable.image.impl.DefaultProcessDiagramCanvas; import org.flowable.image.impl.DefaultProcessDiagramCanvas;
//
//import java.awt.*; import java.awt.*;
//import java.awt.geom.Line2D; import java.awt.geom.Line2D;
//import java.awt.geom.RoundRectangle2D; import java.awt.geom.RoundRectangle2D;
//
///** /**
// * @author Tony * @author Tony
// * @date 2021-04-03 * @date 2021-04-03
// */ */
//public class MyDefaultProcessDiagramCanvas extends DefaultProcessDiagramCanvas { public class MyDefaultProcessDiagramCanvas extends DefaultProcessDiagramCanvas {
// //设置高亮线的颜色 这里我设置成绿色
// protected static Color HIGHLIGHT_SEQUENCEFLOW_COLOR = Color.GREEN; //设置高亮线的颜色 这里我设置成绿色
// 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, 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); 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, @Override
// AssociationDirection associationDirection, boolean highLighted, double scaleFactor) { 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(); Paint originalPaint = g.getPaint();
// Stroke originalStroke = g.getStroke();
// g.setPaint(CONNECTION_COLOR);
// if (connectionType.equals("association")) { g.setPaint(CONNECTION_COLOR);
// g.setStroke(ASSOCIATION_STROKE); if (connectionType.equals("association")) {
// } else if (highLighted) { g.setStroke(ASSOCIATION_STROKE);
// //设置线的颜色 } else if (highLighted) {
// g.setPaint(originalPaint); //设置线的颜色
// g.setStroke(HIGHLIGHT_FLOW_STROKE); g.setPaint(originalPaint);
// } g.setStroke(HIGHLIGHT_FLOW_STROKE);
// }
// for (int i = 1; i < xPoints.length; i++) {
// Integer sourceX = xPoints[i - 1]; for (int i = 1; i < xPoints.length; i++) {
// Integer sourceY = yPoints[i - 1]; Integer sourceX = xPoints[i - 1];
// Integer targetX = xPoints[i]; Integer sourceY = yPoints[i - 1];
// Integer targetY = yPoints[i]; Integer targetX = xPoints[i];
// Line2D.Double line = new Line2D.Double(sourceX, sourceY, targetX, targetY); Integer targetY = yPoints[i];
// g.draw(line); 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]); if (isDefault) {
// drawDefaultSequenceFlowIndicator(line, scaleFactor); 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]); if (conditional) {
// drawConditionalSequenceFlowIndicator(line, scaleFactor); 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]); if (associationDirection == AssociationDirection.ONE || associationDirection == AssociationDirection.BOTH) {
// drawArrowHead(line, scaleFactor); 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]); if (associationDirection == AssociationDirection.BOTH) {
// drawArrowHead(line, scaleFactor); Line2D.Double line = new Line2D.Double(xPoints[1], yPoints[1], xPoints[0], yPoints[0]);
// } drawArrowHead(line, scaleFactor);
// g.setPaint(originalPaint); }
// g.setStroke(originalStroke); g.setPaint(originalPaint);
// } g.setStroke(originalStroke);
// }
// /**
// * 高亮节点设置 /**
// */ *
// @Override */
// public void drawHighLight(int x, int y, int width, int height) { @Override
// Paint originalPaint = g.getPaint(); public void drawHighLight(int x, int y, int width, int height) {
// Stroke originalStroke = g.getStroke(); Paint originalPaint = g.getPaint();
// //设置高亮节点的颜色 Stroke originalStroke = g.getStroke();
// g.setPaint(HIGHLIGHT_COLOR); //设置高亮节点的颜色
// g.setStroke(THICK_TASK_BORDER_STROKE); g.setPaint(HIGHLIGHT_COLOR);
// g.setStroke(THICK_TASK_BORDER_STROKE);
// RoundRectangle2D rect = new RoundRectangle2D.Double(x, y, width, height, 20, 20);
// g.draw(rect); RoundRectangle2D rect = new RoundRectangle2D.Double(x, y, width, height, 20, 20);
// g.draw(rect);
// g.setPaint(originalPaint);
// g.setStroke(originalStroke); g.setPaint(originalPaint);
// } g.setStroke(originalStroke);
//} }
}

View File

@ -5,15 +5,13 @@ import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.text.Convert; import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.enums.SysRoleEnum; import com.ruoyi.common.enums.SysRoleEnum;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.flowable.service.IFlowBusinessKeyService; import com.ruoyi.flowable.service.IFlowBusinessKeyService;
import com.ruoyi.system.domain.FlowProcDefDto;
import com.ruoyi.system.domain.FlowTaskEntity; import com.ruoyi.system.domain.FlowTaskEntity;
import com.ruoyi.system.service.ISysDeptService; import com.ruoyi.system.service.ISysDeptService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; 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.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@ -72,4 +70,54 @@ public class FlowBusinessKeyController extends BaseController {
flowTaskEntity.setNowUser(Convert.toStr(getUserId())); flowTaskEntity.setNowUser(Convert.toStr(getUserId()));
return success(flowBusinessKeyService.quueryCount(flowTaskEntity)); 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));
}
} }

View File

@ -24,4 +24,32 @@ public interface IFlowBusinessKeyService {
* @return * @return
*/ */
public Map<String,Object> quueryCount(FlowTaskEntity flowTaskEntity); 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);
} }

View File

@ -1,5 +1,7 @@
package com.ruoyi.flowable.service.impl; 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.flowable.service.IFlowBusinessKeyService;
import com.ruoyi.system.domain.FlowTaskEntity; import com.ruoyi.system.domain.FlowTaskEntity;
import com.ruoyi.system.mapper.FlowBusinessKeyMapper; import com.ruoyi.system.mapper.FlowBusinessKeyMapper;
@ -8,8 +10,10 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
/** /**
* *
@ -38,6 +42,7 @@ public class FlowBusinessKeyServiceImpl implements IFlowBusinessKeyService {
* @param flowTaskEntity * @param flowTaskEntity
* @return * @return
*/ */
@Override
public Map<String,Object> quueryCount(FlowTaskEntity flowTaskEntity) { public Map<String,Object> quueryCount(FlowTaskEntity flowTaskEntity) {
flowTaskEntity.setActiveName("await"); flowTaskEntity.setActiveName("await");
int awaitSize = flowBusinessKeyMapper.selectAllFlowTaskByParams(flowTaskEntity).size(); int awaitSize = flowBusinessKeyMapper.selectAllFlowTaskByParams(flowTaskEntity).size();
@ -48,4 +53,52 @@ public class FlowBusinessKeyServiceImpl implements IFlowBusinessKeyService {
dataMap.put("finished",finishedSize); dataMap.put("finished",finishedSize);
return dataMap; 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);
}
} }

View File

@ -108,8 +108,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
taskService.resolveTask(taskVo.getTaskId(), taskVo.getVariables()); taskService.resolveTask(taskVo.getTaskId(), taskVo.getVariables());
} else { } else {
taskService.addComment(taskVo.getTaskId(), taskVo.getInstanceId(), FlowComment.NORMAL.getType(), taskVo.getComment()); taskService.addComment(taskVo.getTaskId(), taskVo.getInstanceId(), FlowComment.NORMAL.getType(), taskVo.getComment());
Long userId = SecurityUtils.getLoginUser().getUser().getUserId(); taskService.setAssignee(taskVo.getTaskId(), taskVo.getUserId());
taskService.setAssignee(taskVo.getTaskId(), userId.toString());
taskService.complete(taskVo.getTaskId(), taskVo.getVariables()); taskService.complete(taskVo.getTaskId(), taskVo.getVariables());
} }
return AjaxResult.success(); 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 { try {
// 如果父级任务多于 1 个,说明当前节点不是并行节点,原因为不考虑多对多情况 // 如果父级任务多于 1 个,说明当前节点不是并行节点,原因为不考虑多对多情况
if (targetIds.size() > 1) { if (targetIds.size() > 1) {
@ -884,13 +884,13 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
map.put("flowList", hisFlowList); map.put("flowList", hisFlowList);
} }
// 第一次申请获取初始化表单 // 第一次申请获取初始化表单
if (StringUtils.isNotBlank(deployId)) { // if (StringUtils.isNotBlank(deployId)) {
SysForm sysForm = sysInstanceFormService.selectSysDeployFormByDeployId(deployId); // SysForm sysForm = sysInstanceFormService.selectSysDeployFormByDeployId(deployId);
if (Objects.isNull(sysForm)) { // if (Objects.isNull(sysForm)) {
return AjaxResult.error("请先配置流程表单"); // return AjaxResult.error("请先配置流程表单");
} // }
map.put("formData", JSONObject.parseObject(sysForm.getFormContent())); // map.put("formData", JSONObject.parseObject(sysForm.getFormContent()));
} // }
return AjaxResult.success(map); return AjaxResult.success(map);
} }

View File

@ -5,6 +5,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* <p><p> * <p><p>
@ -16,6 +17,8 @@ public class FlowTaskEntity extends BaseEntity{
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private String businessKey;
@ApiModelProperty("业务名称") @ApiModelProperty("业务名称")
private String businessKeyName; private String businessKeyName;
@ -96,6 +99,8 @@ public class FlowTaskEntity extends BaseEntity{
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date finishTime; private Date finishTime;
private List<Long> roleIds;
public String getBusinessKeyName() { public String getBusinessKeyName() {
return businessKeyName; return businessKeyName;
} }
@ -305,4 +310,20 @@ public class FlowTaskEntity extends BaseEntity{
public void setFinishTime(Date finishTime) { public void setFinishTime(Date finishTime) {
this.finishTime = 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;
}
} }

View File

@ -3,6 +3,7 @@ package com.ruoyi.system.mapper;
import com.ruoyi.system.domain.FlowTaskEntity; import com.ruoyi.system.domain.FlowTaskEntity;
import java.util.List; import java.util.List;
import java.util.Map;
/*** /***
* *
@ -15,4 +16,33 @@ public interface FlowBusinessKeyMapper {
* @return * @return
*/ */
public List<FlowTaskEntity> selectAllFlowTaskByParams(FlowTaskEntity flowTaskEntity); 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);
} }

View File

@ -38,7 +38,7 @@
<!--子部门数据--> <!--子部门数据-->
<if test='nowRole == "4"'> and fa.businesDeptId = #{nowDept}</if> <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='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> <if test='activeName == "await"'> and fa.finishTime is null</if>
@ -47,4 +47,61 @@
order by fa.createTime desc order by fa.createTime desc
</select> </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> </mapper>

View File

@ -17,3 +17,40 @@ export function queryCount(query) {
params: 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
})
}

View File

@ -7,6 +7,7 @@ const getters = {
cachedViews: state => state.tagsView.cachedViews, cachedViews: state => state.tagsView.cachedViews,
token: state => state.user.token, token: state => state.user.token,
avatar: state => state.user.avatar, avatar: state => state.user.avatar,
userId: state => state.user.userId,
name: state => state.user.name, name: state => state.user.name,
dept:state=>state.user.dept, dept:state=>state.user.dept,
introduction: state => state.user.introduction, introduction: state => state.user.introduction,

View File

@ -4,6 +4,7 @@ import { getToken, setToken, removeToken } from '@/utils/auth'
const user = { const user = {
state: { state: {
token: getToken(), token: getToken(),
userId:'',
name: '', name: '',
avatar: '', avatar: '',
dept:null, dept:null,
@ -15,6 +16,9 @@ const user = {
SET_TOKEN: (state, token) => { SET_TOKEN: (state, token) => {
state.token = token state.token = token
}, },
SET_USER_ID: (state, id) => {
state.userId = id
},
SET_NAME: (state, name) => { SET_NAME: (state, name) => {
state.name = name state.name = name
}, },
@ -62,6 +66,7 @@ const user = {
} else { } else {
commit('SET_ROLES', ['ROLE_DEFAULT']) commit('SET_ROLES', ['ROLE_DEFAULT'])
} }
commit('SET_USER_ID', user.userId)
commit('SET_NAME', user.userName) commit('SET_NAME', user.userName)
commit("SET_DEPT",user.dept); commit("SET_DEPT",user.dept);
commit('SET_AVATAR', avatar) commit('SET_AVATAR', avatar)

View File

@ -124,10 +124,10 @@ export default {
this.taskForm.procInsId = this.$route.query && this.$route.query.procInsId; this.taskForm.procInsId = this.$route.query && this.$route.query.procInsId;
// //
// //
if (this.taskForm.taskId){ //if (this.taskForm.taskId){
this.processVariables( this.taskForm.taskId) // this.processVariables( this.taskForm.taskId)
} //}
this.getFlowRecordList( this.taskForm.procInsId, this.taskForm.deployId); //this.getFlowRecordList( this.taskForm.procInsId, this.taskForm.deployId);
}, },
methods: { methods: {
handleClick(tab, event) { handleClick(tab, event) {

View File

@ -1,22 +1,40 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"> <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 <el-input
v-model="queryParams.name" v-model="queryParams.procDefName"
placeholder="请输入名称" placeholder="请输入名称"
clearable clearable
size="small" size="small"
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="开始时间" prop="deployTime"> <el-form-item label="流程类型" prop="category">
<el-date-picker clearable size="small" <el-select
v-model="queryParams.deployTime" v-model="queryParams.category"
type="date" @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" value-format="yyyy-MM-dd"
placeholder="选择时间"> type="daterange"
</el-date-picker> range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
@ -24,7 +42,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-row :gutter="10" class="mb8"> <!-- <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="danger" type="danger"
@ -37,22 +55,41 @@
>删除</el-button> >删除</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row> -->
<el-table v-loading="loading" :data="finishedList" border @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="finishedList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column label="项目名称" align="center" prop="businessKeyName" width="220" :show-overflow-tooltip="true"/>
<el-table-column label="任务编号" align="center" prop="taskId" :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="procDefName" :show-overflow-tooltip="true"/>
<el-table-column label="任务节点" align="center" prop="taskName" /> <el-table-column label="流程类别" align="center" prop="category" width="130">
<el-table-column label="流程发起人" align="center"> <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"> <template slot-scope="scope">
<label>{{scope.row.startUserName}} <el-tag type="info" size="mini">{{scope.row.startDeptName}}</el-tag></label> <label>{{scope.row.startUserName}} <el-tag type="info" size="mini">{{scope.row.startDeptName}}</el-tag></label>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="接收时间" align="center" prop="createTime" width="180"/> <el-table-column label="接收时间" align="center" prop="createTime" width="160"/>
<el-table-column label="审批时间" align="center" prop="finishTime" width="180"/> <el-table-column label="审批时间" align="center" prop="endTime" width="160"/>
<el-table-column label="耗时" align="center" prop="duration" width="180"/> <el-table-column label="审批耗时" align="center" prop="duration" width="140">
<el-table-column label="操作" width="150" fixed="right" class-name="small-padding fixed-width"> <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"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="mini"
@ -60,7 +97,7 @@
icon="el-icon-tickets" icon="el-icon-tickets"
@click="handleFlowRecord(scope.row)" @click="handleFlowRecord(scope.row)"
>流转记录</el-button> >流转记录</el-button>
<el-button <el-button v-if="scope.row.finishTime == null"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-refresh-left" icon="el-icon-refresh-left"
@ -83,11 +120,13 @@
<script> <script>
import { finishedList, getDeployment, delDeployment, addDeployment, updateDeployment, exportDeployment, revokeProcess } from "@/api/flowable/finished"; import { finishedList, getDeployment, delDeployment, addDeployment, updateDeployment, exportDeployment, revokeProcess } from "@/api/flowable/finished";
import {myFinishedFlowTaskList} from "@/api/flowable/businessKey";
export default { export default {
name: "Deploy", name: "Deploy",
components: { components: {
}, },
dicts: ["sys_process_category"],
data() { data() {
return { return {
// //
@ -113,21 +152,16 @@ export default {
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
name: null, procDefName: null,
category: null, category: null,
key: null, params: null,
tenantId: null,
deployTime: null,
derivedFrom: null,
derivedFromRoot: null,
parentDeploymentId: null,
engineVersion: null
}, },
// //
form: {}, form: {},
// //
rules: { rules: {
} },
daterangeCheckTime:[]
}; };
}, },
created() { created() {
@ -137,9 +171,19 @@ export default {
/** 查询流程定义列表 */ /** 查询流程定义列表 */
getList() { getList() {
this.loading = true; this.loading = true;
finishedList(this.queryParams).then(response => { // finishedList(this.queryParams).then(response => {
this.finishedList = response.data.records; // this.finishedList = response.data.records;
this.total = response.data.total; // 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; this.loading = false;
}); });
}, },
@ -160,26 +204,12 @@ export default {
derivedFrom: null, derivedFrom: null,
derivedFromRoot: null, derivedFromRoot: null,
parentDeploymentId: null, parentDeploymentId: null,
engineVersion: null engineVersion: null,
params: null,
}; };
this.daterangeCheckTime=[];
this.resetForm("form"); 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() { handleQuery() {
this.queryParams.pageNum = 1; this.queryParams.pageNum = 1;
@ -188,6 +218,7 @@ export default {
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.resetForm("queryForm"); this.resetForm("queryForm");
this.daterangeCheckTime=[];
this.handleQuery(); this.handleQuery();
}, },
// //
@ -277,7 +308,41 @@ export default {
}).then(response => { }).then(response => {
this.download(response.msg); 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> </script>

View File

@ -113,8 +113,8 @@ export default {
this.taskForm.procInsId = this.$route.query && this.$route.query.procInsId; this.taskForm.procInsId = this.$route.query && this.$route.query.procInsId;
// //
// //
this.processVariables( this.taskForm.taskId) //this.processVariables( this.taskForm.taskId)
this.getFlowRecordList(this.taskForm.procInsId, this.taskForm.deployId); //this.getFlowRecordList(this.taskForm.procInsId, this.taskForm.deployId);
}, },
methods: { methods: {
handleClick(tab, event) { handleClick(tab, event) {

View File

@ -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>

View File

@ -103,7 +103,7 @@
<div v-if="scope.row.finishTime != null"></div> <div v-if="scope.row.finishTime != null"></div>
</template> </template>
</el-table-column> </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"> <template slot-scope="scope">
{{getDurationDate(scope.row)}} {{getDurationDate(scope.row)}}
</template> </template>
@ -197,6 +197,7 @@
/> />
</el-dialog> </el-dialog>
<initTaskDrawer ref="initTaskDrawer" :closeCallBack="getList"></initTaskDrawer> <initTaskDrawer ref="initTaskDrawer" :closeCallBack="getList"></initTaskDrawer>
<detailDrawer ref="detailDrawer"></detailDrawer>
</div> </div>
</template> </template>
@ -213,10 +214,12 @@ import { myProcessList,stopProcess } from "@/api/flowable/process";
import {allList,queryCount} from "@/api/flowable/businessKey"; import {allList,queryCount} from "@/api/flowable/businessKey";
import {myDefinitionList} from "@/api/flowable/definition"; import {myDefinitionList} from "@/api/flowable/definition";
import initTaskDrawer from "./initTaskDrawer.vue"; import initTaskDrawer from "./initTaskDrawer.vue";
import detailDrawer from "./detail/detailDrawer.vue";
export default { export default {
name: "Deploy", name: "Deploy",
components: { components: {
initTaskDrawer initTaskDrawer,
detailDrawer
}, },
dicts: ["sys_process_category"], dicts: ["sys_process_category"],
data() { data() {
@ -385,8 +388,10 @@ export default {
const params = { const params = {
instanceId: row.procInsId instanceId: row.procInsId
} }
this.$modal.confirm('撤销流程会终止,是否继续?').then(function() {
this.loading = true; this.loading = true;
stopProcess(params).then( res => { return stopProcess(params);
}).then(res => {
this.$modal.msgSuccess(res.msg); this.$modal.msgSuccess(res.msg);
this.loading=false; this.loading=false;
this.getList(); this.getList();
@ -394,12 +399,13 @@ export default {
}, },
/** 流程流转记录 */ /** 流程流转记录 */
handleFlowRecord(row){ handleFlowRecord(row){
this.$router.push({ path: '/flowable/task/myProcess/detail/index', this.$refs.detailDrawer.show(row);
query: { // this.$router.push({ path: '/flowable/task/myProcess/detail/index',
procInsId: row.procInsId, // query: {
deployId: row.deployId, // procInsId: row.procInsId,
taskId: row.taskId // deployId: row.deployId,
}}) // taskId: row.taskId
// }})
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
@ -434,7 +440,7 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const ids = row.procInsId || this.ids;// const ids = row.procInsId || this.ids;//
this.$confirm('是否确认删除流程定义编号为"' + ids + '"的数据项?', "警告", { this.$confirm('是否确认删除流程定义编号为"' + ids + '"的数据项?删除后数据将不可找回!!', "警告", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning"
@ -480,10 +486,24 @@ export default {
hours = parseInt(min/60); hours = parseInt(min/60);
min = min % 60; min = min % 60;
} }
if(day>0){
if(day<10) day="0"+day; if(day<10) day="0"+day;
if(hours<10) hours="0"+hours; if(hours<10) hours="0"+hours;
if(min<10) min="0"+min; if(min<10) min="0"+min;
return day+"天"+hours+"小时"+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分钟";
}
}, },
} }
}; };

View File

@ -64,11 +64,11 @@
rows="5" rows="5"
/> />
</el-form-item> </el-form-item>
</el-form>
<div style="text-align: center"> <div style="text-align: center">
<el-button type="primary" @click="submitForm"></el-button> <el-button type="primary" @click="submitForm"></el-button>
<el-button @click="doCanel"> </el-button> <el-button @click="doCanel"> </el-button>
</div> </div>
</el-form>
</el-drawer> </el-drawer>
</div> </div>
</template> </template>

View File

@ -1,22 +1,40 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"> <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 <el-input
v-model="queryParams.name" v-model="queryParams.procDefName"
placeholder="请输入名称" placeholder="请输入名称"
clearable clearable
size="small" size="small"
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="开始时间" prop="deployTime"> <el-form-item label="流程类型" prop="category">
<el-date-picker clearable size="small" <el-select
v-model="queryParams.deployTime" v-model="queryParams.category"
type="date" @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" value-format="yyyy-MM-dd"
placeholder="选择时间"> type="daterange"
</el-date-picker> range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
@ -24,33 +42,25 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-row :gutter="10" class="mb8"> <el-table v-loading="loading" :data="todoList" @selection-change="handleSelectionChange">
<el-col :span="1.5"> <el-table-column label="项目名称" align="center" prop="businessKeyName" width="250" :show-overflow-tooltip="true"/>
<el-button <el-table-column label="任务编号" align="center" prop="taskId" width="120" :show-overflow-tooltip="true"/>
type="danger" <el-table-column label="流程名称" align="center" prop="procDefName" width="180" :show-overflow-tooltip="true"/>
plain <el-table-column label="流程类别" align="center" prop="category" width="180">
icon="el-icon-delete" <template slot-scope="scope">
size="mini" <dict-tag
:disabled="multiple" :options="dict.type.sys_process_category"
@click="handleDelete" :value="scope.row.category"
v-hasPermi="['system:deployment:remove']" />
>删除 </template>
</el-button> </el-table-column>
</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-column label="当前节点" align="center" prop="taskName"/> <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"> <template slot-scope="scope">
<el-tag size="medium" >v{{scope.row.procDefVersion}}</el-tag> <el-tag size="medium" >v{{scope.row.procDefVersion}}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="流程发起人" align="center"> <el-table-column label="流程发起人" align="center" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<label>{{scope.row.startUserName}} <el-tag type="info" size="mini">{{scope.row.startDeptName}}</el-tag></label> <label>{{scope.row.startUserName}} <el-tag type="info" size="mini">{{scope.row.startDeptName}}</el-tag></label>
</template> </template>
@ -76,24 +86,21 @@
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
@pagination="getList" @pagination="getList"
/> />
<approveDrawer ref="approveDrawer" :closeCallBack="getList"></approveDrawer>
</div> </div>
</template> </template>
<script> <script>
import { import {
todoList, todoList,
complete,
returnList,
returnTask,
rejectTask,
getDeployment,
delDeployment, delDeployment,
exportDeployment
} from "@/api/flowable/todo"; } from "@/api/flowable/todo";
import {myAwaitFlowTaskList} from "@/api/flowable/businessKey";
import approveDrawer from "./detail/approveDrawer.vue";
export default { export default {
name: "Deploy", name: "Deploy",
components: {}, components: {approveDrawer},
dicts: ["sys_process_category"],
data() { data() {
return { return {
// //
@ -118,13 +125,15 @@ export default {
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
name: null, procDefName: null,
category: null category: null,
params: null,
}, },
// //
form: {}, form: {},
// //
rules: {} rules: {},
daterangeCheckTime:[],
}; };
}, },
created() { created() {
@ -134,23 +143,34 @@ export default {
/** 查询流程定义列表 */ /** 查询流程定义列表 */
getList() { getList() {
this.loading = true; this.loading = true;
todoList(this.queryParams).then(response => { this.queryParams.params = {};
this.todoList = response.data.records; if (null != this.daterangeCheckTime && "" != this.daterangeCheckTime) {
this.total = response.data.total; 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; this.loading = false;
}); });
}, },
// //
handleProcess(row){ handleProcess(row){
this.$router.push({ path: '/flowable/task/todo/detail/index', this.$refs.approveDrawer.show(row);
query: { // this.$router.push({ path: '/flowable/task/todo/detail/index',
procInsId: row.procInsId, // query: {
executionId: row.executionId, // procInsId: row.procInsId,
deployId: row.deployId, // executionId: row.executionId,
taskId: row.taskId, // deployId: row.deployId,
taskName: row.taskName, // taskId: row.taskId,
startUser: row.startUserName + '-' + row.startDeptName, // taskName: row.taskName,
}}) // startUser: row.startUserName + '-' + row.startDeptName,
// }})
}, },
// //
cancel() { cancel() {
@ -171,6 +191,7 @@ export default {
parentDeploymentId: null, parentDeploymentId: null,
engineVersion: null engineVersion: null
}; };
this.daterangeCheckTime=[];
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
@ -181,6 +202,7 @@ export default {
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.resetForm("queryForm"); this.resetForm("queryForm");
this.daterangeCheckTime=[];
this.handleQuery(); this.handleQuery();
}, },
// //