fix -- 修复我的流程跳转后表单内容为空,优化流程详情页面显示布局。
This commit is contained in:
@@ -11,8 +11,6 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工作流流程实例管理
|
* 工作流流程实例管理
|
||||||
*
|
*
|
||||||
@@ -26,29 +24,20 @@ import java.util.Map;
|
|||||||
@RequestMapping("/workflow/instance")
|
@RequestMapping("/workflow/instance")
|
||||||
public class WfInstanceController {
|
public class WfInstanceController {
|
||||||
|
|
||||||
private final IWfInstanceService flowInstanceService;
|
private final IWfInstanceService instanceService;
|
||||||
|
|
||||||
@ApiOperation(value = "根据流程定义id启动流程实例")
|
|
||||||
@PostMapping("/startBy/{procDefId}")
|
|
||||||
public R startById(@ApiParam(value = "流程定义id") @PathVariable(value = "procDefId") String procDefId,
|
|
||||||
@ApiParam(value = "变量集合,json对象") @RequestBody Map<String, Object> variables) {
|
|
||||||
flowInstanceService.startProcessInstanceById(procDefId, variables);
|
|
||||||
return R.ok("流程启动成功");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "激活或挂起流程实例")
|
@ApiOperation(value = "激活或挂起流程实例")
|
||||||
@PostMapping(value = "/updateState")
|
@PostMapping(value = "/updateState")
|
||||||
public R updateState(@ApiParam(value = "1:激活,2:挂起", required = true) @RequestParam Integer state,
|
public R updateState(@ApiParam(value = "1:激活,2:挂起", required = true) @RequestParam Integer state,
|
||||||
@ApiParam(value = "流程实例ID", required = true) @RequestParam String instanceId) {
|
@ApiParam(value = "流程实例ID", required = true) @RequestParam String instanceId) {
|
||||||
flowInstanceService.updateState(state, instanceId);
|
instanceService.updateState(state, instanceId);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("结束流程实例")
|
@ApiOperation("结束流程实例")
|
||||||
@PostMapping(value = "/stopProcessInstance")
|
@PostMapping(value = "/stopProcessInstance")
|
||||||
public R stopProcessInstance(@RequestBody WfTaskBo bo) {
|
public R stopProcessInstance(@RequestBody WfTaskBo bo) {
|
||||||
flowInstanceService.stopProcessInstance(bo);
|
instanceService.stopProcessInstance(bo);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,7 +45,13 @@ public class WfInstanceController {
|
|||||||
@DeleteMapping(value = "/delete")
|
@DeleteMapping(value = "/delete")
|
||||||
public R delete(@ApiParam(value = "流程实例ID", required = true) @RequestParam String instanceId,
|
public R delete(@ApiParam(value = "流程实例ID", required = true) @RequestParam String instanceId,
|
||||||
@ApiParam(value = "删除原因") @RequestParam(required = false) String deleteReason) {
|
@ApiParam(value = "删除原因") @RequestParam(required = false) String deleteReason) {
|
||||||
flowInstanceService.delete(instanceId, deleteReason);
|
instanceService.delete(instanceId, deleteReason);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "查询流程实例详情信息")
|
||||||
|
@GetMapping("/detail")
|
||||||
|
public R detail(String procInsId, String deployId) {
|
||||||
|
return R.ok(instanceService.queryDetailProcess(procInsId, deployId));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import com.ruoyi.common.core.domain.PageQuery;
|
|||||||
import com.ruoyi.common.core.domain.R;
|
import com.ruoyi.common.core.domain.R;
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
import com.ruoyi.workflow.domain.vo.WfDefinitionVo;
|
import com.ruoyi.workflow.domain.vo.WfDefinitionVo;
|
||||||
|
import com.ruoyi.workflow.domain.vo.WfTaskVo;
|
||||||
import com.ruoyi.workflow.service.IWfProcessService;
|
import com.ruoyi.workflow.service.IWfProcessService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
@@ -47,4 +48,10 @@ public class WfProcessController extends BaseController {
|
|||||||
return R.ok("流程启动成功");
|
return R.ok("流程启动成功");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "我拥有的流程", response = WfTaskVo.class)
|
||||||
|
@GetMapping(value = "/own")
|
||||||
|
public TableDataInfo<WfTaskVo> ownProcess(PageQuery pageQuery) {
|
||||||
|
return processService.queryPageOwnProcessList(pageQuery);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ public class WfTaskController {
|
|||||||
|
|
||||||
private final IWfTaskService flowTaskService;
|
private final IWfTaskService flowTaskService;
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
@ApiOperation(value = "我发起的流程", response = WfTaskVo.class)
|
@ApiOperation(value = "我发起的流程", response = WfTaskVo.class)
|
||||||
@GetMapping(value = "/myProcess")
|
@GetMapping(value = "/myProcess")
|
||||||
public TableDataInfo<WfTaskVo> myProcess(PageQuery pageQuery) {
|
public TableDataInfo<WfTaskVo> myProcess(PageQuery pageQuery) {
|
||||||
@@ -62,6 +63,7 @@ public class WfTaskController {
|
|||||||
return flowTaskService.todoList(pageQuery);
|
return flowTaskService.todoList(pageQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
@ApiOperation(value = "获取已办任务", response = WfTaskVo.class)
|
@ApiOperation(value = "获取已办任务", response = WfTaskVo.class)
|
||||||
@GetMapping(value = "/finishedList")
|
@GetMapping(value = "/finishedList")
|
||||||
public TableDataInfo<WfTaskVo> finishedList(PageQuery pageQuery) {
|
public TableDataInfo<WfTaskVo> finishedList(PageQuery pageQuery) {
|
||||||
|
|||||||
@@ -46,12 +46,11 @@ public interface IWfInstanceService {
|
|||||||
*/
|
*/
|
||||||
HistoricProcessInstance getHistoricProcessInstanceById(String processInstanceId);
|
HistoricProcessInstance getHistoricProcessInstanceById(String processInstanceId);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据流程定义ID启动流程实例
|
* 查询流程详情信息
|
||||||
*
|
* @param procInsId 流程实例ID
|
||||||
* @param procDefId 流程定义Id
|
* @param deployId 流程部署ID
|
||||||
* @param variables 流程变量
|
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
void startProcessInstanceById(String procDefId, Map<String, Object> variables);
|
Map<String, Object> queryDetailProcess(String procInsId, String deployId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.ruoyi.workflow.service;
|
|||||||
import com.ruoyi.common.core.domain.PageQuery;
|
import com.ruoyi.common.core.domain.PageQuery;
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
import com.ruoyi.workflow.domain.vo.WfDefinitionVo;
|
import com.ruoyi.workflow.domain.vo.WfDefinitionVo;
|
||||||
|
import com.ruoyi.workflow.domain.vo.WfTaskVo;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@@ -32,4 +33,11 @@ public interface IWfProcessService {
|
|||||||
* @param variables 扩展参数
|
* @param variables 扩展参数
|
||||||
*/
|
*/
|
||||||
void startProcessByDefKey(String procDefKey, Map<String, Object> variables);
|
void startProcessByDefKey(String procDefKey, Map<String, Object> variables);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询我的流程列表
|
||||||
|
* @param pageQuery 分页参数
|
||||||
|
*/
|
||||||
|
TableDataInfo<WfTaskVo> queryPageOwnProcessList(PageQuery pageQuery);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ public interface IWfTaskService {
|
|||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
TableDataInfo<WfTaskVo> myProcess(PageQuery pageQuery);
|
TableDataInfo<WfTaskVo> myProcess(PageQuery pageQuery);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -129,6 +130,7 @@ public interface IWfTaskService {
|
|||||||
* @param procInsId 流程实例Id
|
* @param procInsId 流程实例Id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
Map<String, Object> flowRecord(String procInsId, String deployId);
|
Map<String, Object> flowRecord(String procInsId, String deployId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,22 +1,35 @@
|
|||||||
package com.ruoyi.workflow.service.impl;
|
package com.ruoyi.workflow.service.impl;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.date.BetweenFormatter;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||||
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||||
import com.ruoyi.common.exception.ServiceException;
|
import com.ruoyi.common.exception.ServiceException;
|
||||||
import com.ruoyi.common.helper.LoginHelper;
|
import com.ruoyi.common.utils.JsonUtils;
|
||||||
import com.ruoyi.flowable.common.constant.ProcessConstants;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import com.ruoyi.flowable.factory.FlowServiceFactory;
|
import com.ruoyi.flowable.factory.FlowServiceFactory;
|
||||||
|
import com.ruoyi.system.service.ISysRoleService;
|
||||||
|
import com.ruoyi.system.service.ISysUserService;
|
||||||
import com.ruoyi.workflow.domain.bo.WfTaskBo;
|
import com.ruoyi.workflow.domain.bo.WfTaskBo;
|
||||||
|
import com.ruoyi.workflow.domain.dto.WfCommentDto;
|
||||||
|
import com.ruoyi.workflow.domain.vo.WfFormVo;
|
||||||
|
import com.ruoyi.workflow.domain.vo.WfTaskVo;
|
||||||
|
import com.ruoyi.workflow.service.IWfDeployFormService;
|
||||||
import com.ruoyi.workflow.service.IWfInstanceService;
|
import com.ruoyi.workflow.service.IWfInstanceService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.flowable.common.engine.api.FlowableObjectNotFoundException;
|
import org.flowable.common.engine.api.FlowableObjectNotFoundException;
|
||||||
|
import org.flowable.engine.history.HistoricActivityInstance;
|
||||||
import org.flowable.engine.history.HistoricProcessInstance;
|
import org.flowable.engine.history.HistoricProcessInstance;
|
||||||
|
import org.flowable.engine.task.Comment;
|
||||||
|
import org.flowable.identitylink.api.history.HistoricIdentityLink;
|
||||||
import org.flowable.task.api.Task;
|
import org.flowable.task.api.Task;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.*;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工作流流程实例管理
|
* 工作流流程实例管理
|
||||||
@@ -24,10 +37,14 @@ import java.util.Objects;
|
|||||||
* @author KonBAI
|
* @author KonBAI
|
||||||
* @createTime 2022/3/10 00:12
|
* @createTime 2022/3/10 00:12
|
||||||
*/
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
@Service
|
@Service
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class WfInstanceServiceImpl extends FlowServiceFactory implements IWfInstanceService {
|
public class WfInstanceServiceImpl extends FlowServiceFactory implements IWfInstanceService {
|
||||||
|
|
||||||
|
private final IWfDeployFormService deployFormService;
|
||||||
|
private final ISysUserService userService;
|
||||||
|
private final ISysRoleService roleService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Task> queryListByInstanceId(String instanceId) {
|
public List<Task> queryListByInstanceId(String instanceId) {
|
||||||
@@ -102,25 +119,85 @@ public class WfInstanceServiceImpl extends FlowServiceFactory implements IWfInst
|
|||||||
return historicProcessInstance;
|
return historicProcessInstance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据流程定义ID启动流程实例
|
* 流程历史流转记录
|
||||||
*
|
*
|
||||||
* @param procDefId 流程定义Id
|
* @param procInsId 流程实例Id
|
||||||
* @param variables 流程变量
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void startProcessInstanceById(String procDefId, Map<String, Object> variables) {
|
public Map<String, Object> queryDetailProcess(String procInsId, String deployId) {
|
||||||
try {
|
Map<String, Object> map = new HashMap<>();
|
||||||
// 设置流程发起人Id到流程中
|
if (StringUtils.isNotBlank(procInsId)) {
|
||||||
String userIdStr = LoginHelper.getUserId().toString();
|
List<HistoricActivityInstance> list = historyService
|
||||||
// identityService.setAuthenticatedUserId(userId.toString());
|
.createHistoricActivityInstanceQuery()
|
||||||
variables.put(ProcessConstants.PROCESS_INITIATOR, userIdStr);
|
.processInstanceId(procInsId)
|
||||||
variables.put("_FLOWABLE_SKIP_EXPRESSION_ENABLED", true);
|
.orderByHistoricActivityInstanceStartTime()
|
||||||
runtimeService.startProcessInstanceById(procDefId, variables);
|
.desc().list();
|
||||||
} catch (Exception e) {
|
List<WfTaskVo> hisFlowList = new ArrayList<>();
|
||||||
e.printStackTrace();
|
for (HistoricActivityInstance histIns : list) {
|
||||||
throw new ServiceException("流程启动错误");
|
if (StringUtils.isNotBlank(histIns.getTaskId())) {
|
||||||
|
WfTaskVo flowTask = new WfTaskVo();
|
||||||
|
flowTask.setProcDefId(histIns.getProcessDefinitionId());
|
||||||
|
flowTask.setTaskId(histIns.getTaskId());
|
||||||
|
flowTask.setTaskName(histIns.getActivityName());
|
||||||
|
flowTask.setCreateTime(histIns.getStartTime());
|
||||||
|
flowTask.setFinishTime(histIns.getEndTime());
|
||||||
|
if (StringUtils.isNotBlank(histIns.getAssignee())) {
|
||||||
|
SysUser user = userService.selectUserById(Long.parseLong(histIns.getAssignee()));
|
||||||
|
flowTask.setAssigneeId(user.getUserId());
|
||||||
|
flowTask.setAssigneeName(user.getNickName());
|
||||||
|
flowTask.setDeptName(user.getDept().getDeptName());
|
||||||
|
}
|
||||||
|
// 展示审批人员
|
||||||
|
List<HistoricIdentityLink> linksForTask = historyService.getHistoricIdentityLinksForTask(histIns.getTaskId());
|
||||||
|
StringBuilder stringBuilder = new StringBuilder();
|
||||||
|
for (HistoricIdentityLink identityLink : linksForTask) {
|
||||||
|
if ("candidate".equals(identityLink.getType())) {
|
||||||
|
if (StringUtils.isNotBlank(identityLink.getUserId())) {
|
||||||
|
SysUser user = userService.selectUserById(Long.parseLong(identityLink.getUserId()));
|
||||||
|
stringBuilder.append(user.getNickName()).append(",");
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(identityLink.getGroupId())) {
|
||||||
|
SysRole role = roleService.selectRoleById(Long.parseLong(identityLink.getGroupId()));
|
||||||
|
stringBuilder.append(role.getRoleName()).append(",");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(stringBuilder)) {
|
||||||
|
flowTask.setCandidate(stringBuilder.substring(0, stringBuilder.length() - 1));
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotNull(histIns.getDurationInMillis())) {
|
||||||
|
flowTask.setDuration(DateUtil.formatBetween(histIns.getDurationInMillis(), BetweenFormatter.Level.SECOND));
|
||||||
|
}
|
||||||
|
// 获取意见评论内容
|
||||||
|
List<Comment> commentList = taskService.getProcessInstanceComments(histIns.getProcessInstanceId());
|
||||||
|
commentList.forEach(comment -> {
|
||||||
|
if (histIns.getTaskId().equals(comment.getTaskId())) {
|
||||||
|
flowTask.setComment(WfCommentDto.builder().type(comment.getType()).comment(comment.getFullMessage()).build());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
hisFlowList.add(flowTask);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
map.put("flowList", hisFlowList);
|
||||||
|
// // 查询当前任务是否完成
|
||||||
|
// List<Task> taskList = taskService.createTaskQuery().processInstanceId(procInsId).list();
|
||||||
|
// if (CollectionUtils.isNotEmpty(taskList)) {
|
||||||
|
// map.put("finished", true);
|
||||||
|
// } else {
|
||||||
|
// map.put("finished", false);
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
// 第一次申请获取初始化表单
|
||||||
|
if (StringUtils.isNotBlank(deployId)) {
|
||||||
|
WfFormVo formVo = deployFormService.selectDeployFormByDeployId(deployId);
|
||||||
|
if (Objects.isNull(formVo)) {
|
||||||
|
throw new ServiceException("请先配置流程表单");
|
||||||
|
}
|
||||||
|
map.put("formData", JsonUtils.parseObject(formVo.getContent(), Map.class));
|
||||||
|
}
|
||||||
|
return map;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,24 +1,28 @@
|
|||||||
package com.ruoyi.workflow.service.impl;
|
package com.ruoyi.workflow.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.ruoyi.common.core.domain.PageQuery;
|
import com.ruoyi.common.core.domain.PageQuery;
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
import com.ruoyi.common.exception.ServiceException;
|
import com.ruoyi.common.exception.ServiceException;
|
||||||
import com.ruoyi.common.helper.LoginHelper;
|
import com.ruoyi.common.helper.LoginHelper;
|
||||||
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import com.ruoyi.flowable.common.constant.ProcessConstants;
|
import com.ruoyi.flowable.common.constant.ProcessConstants;
|
||||||
import com.ruoyi.flowable.common.enums.FlowComment;
|
|
||||||
import com.ruoyi.flowable.factory.FlowServiceFactory;
|
import com.ruoyi.flowable.factory.FlowServiceFactory;
|
||||||
import com.ruoyi.workflow.domain.vo.WfDefinitionVo;
|
import com.ruoyi.workflow.domain.vo.WfDefinitionVo;
|
||||||
|
import com.ruoyi.workflow.domain.vo.WfTaskVo;
|
||||||
import com.ruoyi.workflow.service.IWfProcessService;
|
import com.ruoyi.workflow.service.IWfProcessService;
|
||||||
import com.ruoyi.workflow.service.IWfTaskService;
|
import com.ruoyi.workflow.service.IWfTaskService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.flowable.engine.history.HistoricProcessInstance;
|
||||||
|
import org.flowable.engine.history.HistoricProcessInstanceQuery;
|
||||||
import org.flowable.engine.repository.Deployment;
|
import org.flowable.engine.repository.Deployment;
|
||||||
import org.flowable.engine.repository.ProcessDefinition;
|
import org.flowable.engine.repository.ProcessDefinition;
|
||||||
import org.flowable.engine.repository.ProcessDefinitionQuery;
|
import org.flowable.engine.repository.ProcessDefinitionQuery;
|
||||||
import org.flowable.engine.runtime.ProcessInstance;
|
import org.flowable.engine.runtime.ProcessInstance;
|
||||||
import org.flowable.task.api.Task;
|
import org.flowable.task.api.Task;
|
||||||
|
import org.flowable.task.api.history.HistoricTaskInstance;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
@@ -133,6 +137,54 @@ public class WfProcessServiceImpl extends FlowServiceFactory implements IWfProce
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TableDataInfo<WfTaskVo> queryPageOwnProcessList(PageQuery pageQuery) {
|
||||||
|
Page<WfTaskVo> page = new Page<>();
|
||||||
|
Long userId = LoginHelper.getUserId();
|
||||||
|
HistoricProcessInstanceQuery historicProcessInstanceQuery = historyService.createHistoricProcessInstanceQuery()
|
||||||
|
.startedBy(userId.toString())
|
||||||
|
.orderByProcessInstanceStartTime()
|
||||||
|
.desc();
|
||||||
|
int offset = pageQuery.getPageSize() * (pageQuery.getPageNum() - 1);
|
||||||
|
List<HistoricProcessInstance> historicProcessInstances = historicProcessInstanceQuery
|
||||||
|
.listPage(offset, pageQuery.getPageSize());
|
||||||
|
page.setTotal(historicProcessInstanceQuery.count());
|
||||||
|
List<WfTaskVo> taskVoList = new ArrayList<>();
|
||||||
|
for (HistoricProcessInstance hisIns : historicProcessInstances) {
|
||||||
|
WfTaskVo taskVo = new WfTaskVo();
|
||||||
|
taskVo.setCreateTime(hisIns.getStartTime());
|
||||||
|
taskVo.setFinishTime(hisIns.getEndTime());
|
||||||
|
taskVo.setProcInsId(hisIns.getId());
|
||||||
|
|
||||||
|
// 计算耗时
|
||||||
|
if (Objects.nonNull(hisIns.getEndTime())) {
|
||||||
|
taskVo.setDuration(DateUtils.getDatePoor(hisIns.getEndTime(), hisIns.getStartTime()));
|
||||||
|
} else {
|
||||||
|
taskVo.setDuration(DateUtils.getDatePoor(DateUtils.getNowDate(), hisIns.getStartTime()));
|
||||||
|
}
|
||||||
|
// 流程部署实例信息
|
||||||
|
Deployment deployment = repositoryService.createDeploymentQuery()
|
||||||
|
.deploymentId(hisIns.getDeploymentId()).singleResult();
|
||||||
|
taskVo.setDeployId(hisIns.getDeploymentId());
|
||||||
|
taskVo.setProcDefId(hisIns.getProcessDefinitionId());
|
||||||
|
taskVo.setProcDefName(hisIns.getProcessDefinitionName());
|
||||||
|
taskVo.setProcDefVersion(hisIns.getProcessDefinitionVersion());
|
||||||
|
taskVo.setCategory(deployment.getCategory());
|
||||||
|
// 当前所处流程
|
||||||
|
List<Task> taskList = taskService.createTaskQuery().processInstanceId(hisIns.getId()).list();
|
||||||
|
if (CollUtil.isNotEmpty(taskList)) {
|
||||||
|
taskVo.setTaskId(taskList.get(0).getId());
|
||||||
|
} else {
|
||||||
|
List<HistoricTaskInstance> historicTaskInstance = historyService.createHistoricTaskInstanceQuery()
|
||||||
|
.processInstanceId(hisIns.getId()).orderByHistoricTaskInstanceEndTime().desc().list();
|
||||||
|
taskVo.setTaskId(historicTaskInstance.get(0).getId());
|
||||||
|
}
|
||||||
|
taskVoList.add(taskVo);
|
||||||
|
}
|
||||||
|
page.setRecords(taskVoList);
|
||||||
|
return TableDataInfo.build(page);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 扩展参数构建
|
* 扩展参数构建
|
||||||
* @param variables 扩展参数
|
* @param variables 扩展参数
|
||||||
|
|||||||
10
ruoyi-ui/src/api/workflow/instance.js
Normal file
10
ruoyi-ui/src/api/workflow/instance.js
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询流程实例详情信息
|
||||||
|
export function getDetailInstance(query) {
|
||||||
|
return request({
|
||||||
|
url: '/workflow/instance/detail',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -20,9 +20,9 @@ export function startProcess(processDefId, data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 我的发起的流程
|
// 我的发起的流程
|
||||||
export function myProcessList(query) {
|
export function listOwnProcess(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/workflow/task/myProcess',
|
url: '/workflow/process/own',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,21 +1,37 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-tabs tab-position="top" v-model="activeTagName">
|
<el-tabs tab-position="top">
|
||||||
<el-tab-pane label="基础信息" name="basicInfo">
|
<el-tab-pane label="任务办理" v-if="finished === 'true'">
|
||||||
<el-card class="box-card">
|
<el-card class="box-card" shadow="never">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="20" :offset="2">
|
||||||
|
<el-form ref="taskForm" :model="taskForm" :rules="rules" label-width="80px">
|
||||||
|
<el-form-item label="审批意见" prop="comment">
|
||||||
|
<el-input type="textarea" :rows="5" v-model="taskForm.comment" placeholder="请输入 审批意见" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="6" :offset="8">
|
||||||
|
<el-button icon="el-icon-edit-outline" type="success" @click="handleComplete">通过</el-button>
|
||||||
|
<!-- <el-button icon="el-icon-edit-outline" type="primary" @click="handleDelegate">委派</el-button>-->
|
||||||
|
<!-- <el-button icon="el-icon-edit-outline" type="primary" size="mini" @click="handleAssign">转办</el-button>-->
|
||||||
|
<!-- <el-button icon="el-icon-edit-outline" type="primary" size="mini" @click="handleDelegate">签收</el-button>-->
|
||||||
|
<el-button icon="el-icon-refresh-left" type="warning" @click="handleReturn">退回</el-button>
|
||||||
|
<el-button icon="el-icon-circle-close" type="danger" @click="handleReject">驳回</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-card>
|
||||||
|
<!-- </div>-->
|
||||||
|
</el-tab-pane>
|
||||||
|
<el-tab-pane label="表单信息">
|
||||||
|
<el-card class="box-card" shadow="never">
|
||||||
<!--流程处理表单模块-->
|
<!--流程处理表单模块-->
|
||||||
<el-col :span="16" :offset="6" v-if="variableOpen">
|
<el-col :span="20" :offset="2" v-if="variableOpen">
|
||||||
<div>
|
<div>
|
||||||
<parser :key="new Date().getTime()" :form-conf="variablesData"/>
|
<parser :key="new Date().getTime()" :form-conf="variablesData"/>
|
||||||
</div>
|
</div>
|
||||||
<div style="margin-left:10%;margin-bottom: 20px;font-size: 14px;" v-if="finished === 'true'">
|
|
||||||
<el-button icon="el-icon-edit-outline" type="success" size="mini" @click="handleComplete">审批</el-button>
|
|
||||||
<!-- <el-button icon="el-icon-edit-outline" type="primary" size="mini" @click="handleDelegate">委派</el-button>-->
|
|
||||||
<!-- <el-button icon="el-icon-edit-outline" type="primary" size="mini" @click="handleAssign">转办</el-button>-->
|
|
||||||
<!-- <el-button icon="el-icon-edit-outline" type="primary" size="mini" @click="handleDelegate">签收</el-button>-->
|
|
||||||
<el-button icon="el-icon-refresh-left" type="warning" size="mini" @click="handleReturn">退回</el-button>
|
|
||||||
<el-button icon="el-icon-circle-close" type="danger" size="mini" @click="handleReject">驳回</el-button>
|
|
||||||
</div>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<!--初始化流程加载表单信息-->
|
<!--初始化流程加载表单信息-->
|
||||||
@@ -26,8 +42,8 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-tab-pane >
|
</el-tab-pane >
|
||||||
<el-tab-pane label="流转记录" name="flowRecord">
|
<el-tab-pane label="流转记录">
|
||||||
<el-card class="box-card">
|
<el-card class="box-card" shadow="never">
|
||||||
<el-col :span="16" :offset="4">
|
<el-col :span="16" :offset="4">
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<el-timeline>
|
<el-timeline>
|
||||||
@@ -71,8 +87,8 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="流程跟踪" name="processTrack">
|
<el-tab-pane label="流程跟踪">
|
||||||
<el-card class="box-card">
|
<el-card class="box-card" shadow="never">
|
||||||
<process-viewer :key="`designer-${loadIndex}`" :style="'height:' + height" :xml="xmlData"
|
<process-viewer :key="`designer-${loadIndex}`" :style="'height:' + height" :xml="xmlData"
|
||||||
:finishedInfo="finishedInfo" :allCommentList="null"
|
:finishedInfo="finishedInfo" :allCommentList="null"
|
||||||
/>
|
/>
|
||||||
@@ -80,65 +96,6 @@
|
|||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
|
|
||||||
<!--审批正常流程-->
|
|
||||||
<el-dialog :title="completeTitle" :visible.sync="completeOpen" width="60%" append-to-body>
|
|
||||||
<!-- <el-row :gutter="20">-->
|
|
||||||
<!-- <!–部门数据–>-->
|
|
||||||
<!-- <el-col :span="4" :xs="24">-->
|
|
||||||
<!-- <h6>部门列表</h6>-->
|
|
||||||
<!-- <div class="head-container">-->
|
|
||||||
<!-- <el-input-->
|
|
||||||
<!-- v-model="deptName"-->
|
|
||||||
<!-- placeholder="请输入部门名称"-->
|
|
||||||
<!-- clearable-->
|
|
||||||
<!-- size="small"-->
|
|
||||||
<!-- prefix-icon="el-icon-search"-->
|
|
||||||
<!-- style="margin-bottom: 20px"-->
|
|
||||||
<!-- />-->
|
|
||||||
<!-- </div>-->
|
|
||||||
<!-- <div class="head-container">-->
|
|
||||||
<!-- <el-tree-->
|
|
||||||
<!-- :data="deptOptions"-->
|
|
||||||
<!-- :props="defaultProps"-->
|
|
||||||
<!-- :expand-on-click-node="false"-->
|
|
||||||
<!-- :filter-node-method="filterNode"-->
|
|
||||||
<!-- ref="tree"-->
|
|
||||||
<!-- default-expand-all-->
|
|
||||||
<!-- @node-click="handleNodeClick"-->
|
|
||||||
<!-- />-->
|
|
||||||
<!-- </div>-->
|
|
||||||
<!-- </el-col>-->
|
|
||||||
<!-- <el-col :span="12" :xs="24">-->
|
|
||||||
<!-- <h6>待选人员</h6>-->
|
|
||||||
<!-- <el-table-->
|
|
||||||
<!-- ref="singleTable"-->
|
|
||||||
<!-- :data="userList"-->
|
|
||||||
<!-- border-->
|
|
||||||
<!-- style="width: 100%"-->
|
|
||||||
<!-- @selection-change="handleSelectionChange">-->
|
|
||||||
<!-- <el-table-column type="selection" width="50" align="center" />-->
|
|
||||||
<!-- <el-table-column label="用户名" align="center" prop="nickName" />-->
|
|
||||||
<!-- <el-table-column label="部门" align="center" prop="dept.deptName" />-->
|
|
||||||
<!-- </el-table>-->
|
|
||||||
<!-- </el-col>-->
|
|
||||||
<!-- <el-col :span="8" :xs="24">-->
|
|
||||||
<!-- <h6>已选人员</h6>-->
|
|
||||||
<!-- <el-tag-->
|
|
||||||
<!-- v-for="tag in userData"-->
|
|
||||||
<!-- :key="tag.nickName"-->
|
|
||||||
<!-- closable-->
|
|
||||||
<!-- @close="handleClose(tag)">-->
|
|
||||||
<!-- {{tag.nickName}} {{tag.dept.deptName}}-->
|
|
||||||
<!-- </el-tag>-->
|
|
||||||
<!-- </el-col>-->
|
|
||||||
<!-- </el-row>-->
|
|
||||||
<span slot="footer" class="dialog-footer">
|
|
||||||
<el-input style="width: 50%;margin-right: 34%" type="textarea" v-model="taskForm.comment" placeholder="请输入处理意见"/>
|
|
||||||
<el-button @click="completeOpen = false">取 消</el-button>
|
|
||||||
<el-button type="primary" @click="taskComplete">确 定</el-button>
|
|
||||||
</span>
|
|
||||||
</el-dialog>
|
|
||||||
|
|
||||||
<!--退回流程-->
|
<!--退回流程-->
|
||||||
<el-dialog :title="returnTitle" :visible.sync="returnOpen" width="40%" append-to-body>
|
<el-dialog :title="returnTitle" :visible.sync="returnOpen" width="40%" append-to-body>
|
||||||
<el-form ref="taskForm" :model="taskForm" label-width="80px" >
|
<el-form ref="taskForm" :model="taskForm" label-width="80px" >
|
||||||
@@ -151,33 +108,19 @@
|
|||||||
>{{item.name}}</el-radio-button>
|
>{{item.name}}</el-radio-button>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="退回意见" prop="comment" :rules="[{ required: true, message: '请输入意见', trigger: 'blur' }]">
|
|
||||||
<el-input style="width: 50%" type="textarea" v-model="taskForm.comment" placeholder="请输入意见"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
</el-form>
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
<el-button @click="returnOpen = false">取 消</el-button>
|
<el-button @click="returnOpen = false">取 消</el-button>
|
||||||
<el-button type="primary" @click="taskReturn">确 定</el-button>
|
<el-button type="primary" @click="submitReturn">确 定</el-button>
|
||||||
</span>
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<!--驳回流程-->
|
|
||||||
<el-dialog :title="rejectTitle" :visible.sync="rejectOpen" width="40%" append-to-body>
|
|
||||||
<el-form ref="taskForm" :model="taskForm" label-width="80px" >
|
|
||||||
<el-form-item label="驳回意见" prop="comment" :rules="[{ required: true, message: '请输入意见', trigger: 'blur' }]">
|
|
||||||
<el-input style="width: 50%" type="textarea" v-model="taskForm.comment" placeholder="请输入意见"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<span slot="footer" class="dialog-footer">
|
|
||||||
<el-button @click="rejectOpen = false">取 消</el-button>
|
|
||||||
<el-button type="primary" @click="taskReject">确 定</el-button>
|
|
||||||
</span>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { flowRecord } from '@/api/workflow/finished'
|
import { getDetailInstance } from '@/api/workflow/instance'
|
||||||
import Parser from '@/utils/generator/parser'
|
import Parser from '@/utils/generator/parser'
|
||||||
import { definitionStart, getFlowViewer, getProcessVariables, readXml } from '@/api/workflow/definition'
|
import { definitionStart, getFlowViewer, getProcessVariables, readXml } from '@/api/workflow/definition'
|
||||||
import { complete, delegate, getNextFlowNode, rejectTask, returnList, returnTask } from '@/api/workflow/todo'
|
import { complete, delegate, getNextFlowNode, rejectTask, returnList, returnTask } from '@/api/workflow/todo'
|
||||||
@@ -198,7 +141,6 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
height: document.documentElement.clientHeight - 205 + 'px;',
|
height: document.documentElement.clientHeight - 205 + 'px;',
|
||||||
activeTagName: 'basicInfo',
|
|
||||||
// 模型xml数据
|
// 模型xml数据
|
||||||
loadIndex: 0,
|
loadIndex: 0,
|
||||||
xmlData: undefined,
|
xmlData: undefined,
|
||||||
@@ -215,7 +157,7 @@ export default {
|
|||||||
deptOptions: undefined,
|
deptOptions: undefined,
|
||||||
// 用户表格数据
|
// 用户表格数据
|
||||||
userList: null,
|
userList: null,
|
||||||
defaultProps: {
|
deptProps: {
|
||||||
children: "children",
|
children: "children",
|
||||||
label: "label"
|
label: "label"
|
||||||
},
|
},
|
||||||
@@ -225,16 +167,14 @@ export default {
|
|||||||
},
|
},
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
loading: true,
|
loading: true,
|
||||||
flowRecordList: [], // 流程流转数据
|
flowRecordList: [],
|
||||||
formConfCopy: {},
|
formConfCopy: {},
|
||||||
src: null,
|
variablesForm: {},
|
||||||
rules: {}, // 表单校验
|
|
||||||
variablesForm: {}, // 流程变量数据
|
|
||||||
taskForm:{
|
taskForm:{
|
||||||
returnTaskShow: false, // 是否展示回退表单
|
returnTaskShow: false,
|
||||||
delegateTaskShow: false, // 是否展示回退表单
|
delegateTaskOpen: false,
|
||||||
defaultTaskShow: true, // 默认处理
|
defaultTaskShow: true,
|
||||||
sendUserShow: false, // 审批用户
|
sendUserShow: false,
|
||||||
multiple: false,
|
multiple: false,
|
||||||
comment:"", // 意见内容
|
comment:"", // 意见内容
|
||||||
procInsId: "", // 流程实例编号
|
procInsId: "", // 流程实例编号
|
||||||
@@ -245,6 +185,9 @@ export default {
|
|||||||
vars: "",
|
vars: "",
|
||||||
targetKey:""
|
targetKey:""
|
||||||
},
|
},
|
||||||
|
rules: {
|
||||||
|
comment: [{ required: true, message: '请输入审批意见', trigger: 'blur' }],
|
||||||
|
},
|
||||||
userDataList:[], // 流程候选人
|
userDataList:[], // 流程候选人
|
||||||
assignee: null,
|
assignee: null,
|
||||||
formConf: {}, // 默认表单数据
|
formConf: {}, // 默认表单数据
|
||||||
@@ -254,12 +197,11 @@ export default {
|
|||||||
variableOpen: false, // 是否加载流程变量数据
|
variableOpen: false, // 是否加载流程变量数据
|
||||||
returnTaskList: [], // 回退列表数据
|
returnTaskList: [], // 回退列表数据
|
||||||
finished: 'false',
|
finished: 'false',
|
||||||
completeTitle: null,
|
|
||||||
completeOpen: false,
|
|
||||||
returnTitle: null,
|
returnTitle: null,
|
||||||
returnOpen: false,
|
returnOpen: false,
|
||||||
rejectOpen: false,
|
rejectOpen: false,
|
||||||
rejectTitle: null,
|
rejectTitle: null,
|
||||||
|
delegateOpen: false,
|
||||||
userData:[],
|
userData:[],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -271,7 +213,7 @@ export default {
|
|||||||
this.taskForm.instanceId = this.$route.query && this.$route.query.procInsId;
|
this.taskForm.instanceId = this.$route.query && this.$route.query.procInsId;
|
||||||
this.finished = this.$route.query && this.$route.query.finished
|
this.finished = this.$route.query && this.$route.query.finished
|
||||||
// 流程任务重获取变量表单
|
// 流程任务重获取变量表单
|
||||||
if (this.taskForm.taskId){
|
if (this.taskForm.taskId) {
|
||||||
this.processVariables( this.taskForm.taskId)
|
this.processVariables( this.taskForm.taskId)
|
||||||
// this.getNextFlowNode(this.taskForm.taskId)
|
// this.getNextFlowNode(this.taskForm.taskId)
|
||||||
this.taskForm.deployId = null
|
this.taskForm.deployId = null
|
||||||
@@ -283,7 +225,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 查询部门下拉树结构 */
|
/** 查询部门下拉树结构 */
|
||||||
getTreeselect() {
|
getTreeSelect() {
|
||||||
treeselect().then(response => {
|
treeselect().then(response => {
|
||||||
this.deptOptions = response.data;
|
this.deptOptions = response.data;
|
||||||
});
|
});
|
||||||
@@ -377,7 +319,7 @@ export default {
|
|||||||
/** 流程流转记录 */
|
/** 流程流转记录 */
|
||||||
getFlowRecordList(procInsId, deployId) {
|
getFlowRecordList(procInsId, deployId) {
|
||||||
const params = {procInsId: procInsId, deployId: deployId}
|
const params = {procInsId: procInsId, deployId: deployId}
|
||||||
flowRecord(params).then(res => {
|
getDetailInstance(params).then(res => {
|
||||||
this.flowRecordList = res.data.flowList;
|
this.flowRecordList = res.data.flowList;
|
||||||
// 流程过程中不存在初始化表单 直接读取的流程变量中存储的表单值
|
// 流程过程中不存在初始化表单 直接读取的流程变量中存储的表单值
|
||||||
if (res.data.formData) {
|
if (res.data.formData) {
|
||||||
@@ -433,31 +375,28 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/** 审批任务选择 */
|
/** 通过任务 */
|
||||||
handleComplete() {
|
handleComplete() {
|
||||||
this.completeOpen = true;
|
this.$refs['taskForm'].validate(valid => {
|
||||||
this.completeTitle = "审批流程";
|
if (valid) {
|
||||||
this.getTreeselect();
|
complete(this.taskForm).then(response => {
|
||||||
},
|
this.$modal.msgSuccess(response.msg);
|
||||||
/** 审批任务 */
|
this.goBack();
|
||||||
taskComplete() {
|
});
|
||||||
// if (!this.taskForm.values){
|
}
|
||||||
// this.$modal.msgError("请选择流程接收人员");
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
if (!this.taskForm.comment){
|
|
||||||
this.$modal.msgError("请输入审批意见");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
complete(this.taskForm).then(response => {
|
|
||||||
this.$modal.msgSuccess(response.msg);
|
|
||||||
this.goBack();
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 委派任务 */
|
|
||||||
handleDelegate() {
|
/** 驳回任务 */
|
||||||
this.taskForm.delegateTaskShow = true;
|
handleReject() {
|
||||||
this.taskForm.defaultTaskShow = false;
|
this.$refs["taskForm"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
rejectTask(this.taskForm).then(res => {
|
||||||
|
this.$modal.msgSuccess(res.msg);
|
||||||
|
this.goBack();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
handleAssign(){
|
handleAssign(){
|
||||||
|
|
||||||
@@ -507,35 +446,27 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/** 驳回任务 */
|
|
||||||
handleReject() {
|
|
||||||
this.rejectOpen = true;
|
|
||||||
this.rejectTitle = "驳回流程";
|
|
||||||
},
|
|
||||||
/** 驳回任务 */
|
|
||||||
taskReject() {
|
|
||||||
this.$refs["taskForm"].validate(valid => {
|
|
||||||
if (valid) {
|
|
||||||
rejectTask(this.taskForm).then(res => {
|
|
||||||
this.$modal.msgSuccess(res.msg);
|
|
||||||
this.goBack();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 可退回任务列表 */
|
/** 可退回任务列表 */
|
||||||
handleReturn() {
|
handleReturn() {
|
||||||
this.returnOpen = true;
|
this.$refs['taskForm'].validate(valid => {
|
||||||
this.returnTitle = "退回流程";
|
if (valid) {
|
||||||
returnList(this.taskForm).then(res => {
|
this.returnTitle = "退回流程";
|
||||||
this.returnTaskList = res.data;
|
returnList(this.taskForm).then(res => {
|
||||||
this.taskForm.values = null;
|
this.returnTaskList = res.data;
|
||||||
})
|
this.taskForm.values = null;
|
||||||
|
this.returnOpen = true;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
/** 提交退回任务 */
|
/** 提交退回任务 */
|
||||||
taskReturn() {
|
submitReturn() {
|
||||||
this.$refs["taskForm"].validate(valid => {
|
this.$refs["taskForm"].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
if (!this.taskForm.targetKey) {
|
||||||
|
this.$modal.msgError("请选择退回节点!");
|
||||||
|
}
|
||||||
returnTask(this.taskForm).then(res => {
|
returnTask(this.taskForm).then(res => {
|
||||||
this.$modal.msgSuccess(res.msg);
|
this.$modal.msgSuccess(res.msg);
|
||||||
this.goBack()
|
this.goBack()
|
||||||
@@ -563,7 +494,7 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 取消回退任务按钮 */
|
/** 取消回退任务按钮 */
|
||||||
cancelDelegateTask() {
|
cancelDelegateTask() {
|
||||||
this.taskForm.delegateTaskShow = false;
|
this.taskForm.delegateTaskOpen = false;
|
||||||
this.taskForm.defaultTaskShow = true;
|
this.taskForm.defaultTaskShow = true;
|
||||||
this.taskForm.sendUserShow = true;
|
this.taskForm.sendUserShow = true;
|
||||||
this.returnTaskList = [];
|
this.returnTaskList = [];
|
||||||
@@ -595,4 +526,14 @@ export default {
|
|||||||
.el-tag + .el-tag {
|
.el-tag + .el-tag {
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.el-row {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
&:last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.el-col {
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -47,7 +47,7 @@
|
|||||||
<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="myProcessList" border @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="ownProcessList" border @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="流程编号" align="center" prop="procInsId" :show-overflow-tooltip="true"/>
|
<el-table-column label="流程编号" align="center" prop="procInsId" :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"/>
|
||||||
@@ -110,7 +110,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { myProcessList, stopProcess, delProcess } from "@/api/workflow/process";
|
import { listOwnProcess, stopProcess, delProcess } from '@/api/workflow/process';
|
||||||
import { listCategory } from '@/api/workflow/category';
|
import { listCategory } from '@/api/workflow/category';
|
||||||
export default {
|
export default {
|
||||||
name: "Own",
|
name: "Own",
|
||||||
@@ -134,7 +134,7 @@ export default {
|
|||||||
categoryOptions: [],
|
categoryOptions: [],
|
||||||
processTotal:0,
|
processTotal:0,
|
||||||
// 我发起的流程列表数据
|
// 我发起的流程列表数据
|
||||||
myProcessList: [],
|
ownProcessList: [],
|
||||||
// 弹出层标题
|
// 弹出层标题
|
||||||
title: "",
|
title: "",
|
||||||
// 是否显示弹出层
|
// 是否显示弹出层
|
||||||
@@ -172,8 +172,8 @@ export default {
|
|||||||
/** 查询流程定义列表 */
|
/** 查询流程定义列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
myProcessList(this.queryParams).then(response => {
|
listOwnProcess(this.queryParams).then(response => {
|
||||||
this.myProcessList = response.rows;
|
this.ownProcessList = response.rows;
|
||||||
this.total = response.total;
|
this.total = response.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
@@ -226,7 +226,8 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 流程流转记录 */
|
/** 流程流转记录 */
|
||||||
handleFlowRecord(row){
|
handleFlowRecord(row) {
|
||||||
|
console.log("row =========> ", row)
|
||||||
this.$router.push({ path: '/work/detail',
|
this.$router.push({ path: '/work/detail',
|
||||||
query: {
|
query: {
|
||||||
definitionId: row.procDefId,
|
definitionId: row.procDefId,
|
||||||
|
|||||||
Reference in New Issue
Block a user