Commit d16185f87d06885df206946b2b949d7a7c78c3a7
1 parent
43678150
修改表单为外置表单
Showing
27 changed files
with
1328 additions
and
183 deletions
sql/ruoyi-vue-pro.sql
| ... | ... | @@ -733,13 +733,14 @@ INSERT INTO `sys_menu` VALUES (1113, '错误码更新', 'system:error-code:updat |
| 733 | 733 | INSERT INTO `sys_menu` VALUES (1114, '错误码删除', 'system:error-code:delete', 3, 4, 1110, '', '', '', 0, '', '2021-04-13 21:46:42', '', '2021-04-13 22:09:51', b'0'); |
| 734 | 734 | INSERT INTO `sys_menu` VALUES (1115, '错误码导出', 'system:error-code:export', 3, 5, 1110, '', '', '', 0, '', '2021-04-13 21:46:42', '', '2021-04-13 22:09:55', b'0'); |
| 735 | 735 | INSERT INTO `sys_menu` VALUES (1116, '日志中心', '', 2, 8, 2, 'log-center', 'log', 'infra/skywalking/log', 0, '1', '2021-04-26 22:35:45', '1', '2021-04-26 22:37:25', b'0'); |
| 736 | -INSERT INTO `sys_menu` VALUES (1118,'请假申请','',2,0,5,'oa/leave','user','oa/leave/index',0,'','2021-09-20 08:51:03','1','2021-10-12 22:19:02',0x00); | |
| 736 | +INSERT INTO `sys_menu` VALUES (1118,'请假查询','',2,0,5,'oa/leave','user','oa/leave/index',0,'','2021-09-20 08:51:03','1','2021-10-12 22:19:02',0x00); | |
| 737 | 737 | INSERT INTO `sys_menu` VALUES (1119,'请假申请查询','oa:leave:query',3,1,1118,'','','',0,'','2021-09-20 08:51:03','','2021-09-20 08:51:03',0x00); |
| 738 | 738 | INSERT INTO `sys_menu` VALUES (1120,'请假申请创建','oa:leave:create',3,2,1118,'','','',0,'','2021-09-20 08:51:03','','2021-09-20 08:51:03',0x00); |
| 739 | 739 | INSERT INTO `sys_menu` VALUES (1121,'请假申请更新','oa:leave:update',3,3,1118,'','','',0,'','2021-09-20 08:51:03','','2021-09-20 08:51:03',0x00); |
| 740 | 740 | INSERT INTO `sys_menu` VALUES (1122,'请假申请删除','oa:leave:delete',3,4,1118,'','','',0,'','2021-09-20 08:51:03','','2021-09-20 08:51:03',0x00); |
| 741 | 741 | INSERT INTO `sys_menu` VALUES (1123,'请假申请导出','oa:leave:export',3,5,1118,'','','',0,'','2021-09-20 08:51:03','','2021-09-20 08:51:03',0x00); |
| 742 | 742 | INSERT INTO `sys_menu` VALUES (1124,'待办任务','',2,2,5,'todo','edit','oa/todo/index',0,'1','2021-09-20 22:10:09','1','2021-09-21 23:17:12',0x00); |
| 743 | +INSERT INTO `sys_menu` VALUES (1125,'流程申请','',2,3,5,'flow','form','oa/flow/index',0,'1','2021-10-23 22:10:09','1','2021-10-23 23:17:12',0x00); | |
| 743 | 744 | |
| 744 | 745 | COMMIT; |
| 745 | 746 | ... | ... |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/oa/OaLeaveController.java
| ... | ... | @@ -41,6 +41,14 @@ public class OaLeaveController { |
| 41 | 41 | @ApiOperation("创建请假申请") |
| 42 | 42 | @PreAuthorize("@ss.hasPermission('oa:leave:create')") |
| 43 | 43 | public CommonResult<Long> createLeave(@Valid @RequestBody OaLeaveCreateReqVO createReqVO) { |
| 44 | + createReqVO.setProcessKey("leave"); | |
| 45 | + return success(leaveService.createLeave(createReqVO)); | |
| 46 | + } | |
| 47 | + | |
| 48 | + @PostMapping("/form-key/create") | |
| 49 | + @ApiOperation("创建外置请假申请") | |
| 50 | + public CommonResult<Long> createFormKeyLeave(@Valid @RequestBody OaLeaveCreateReqVO createReqVO) { | |
| 51 | + createReqVO.setProcessKey("leave-formkey"); | |
| 44 | 52 | return success(leaveService.createLeave(createReqVO)); |
| 45 | 53 | } |
| 46 | 54 | ... | ... |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/oa/vo/OaLeaveCreateReqVO.java
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/oa/vo/OaLeaveUpdateReqVO.java
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/workflow/ProcessDefinitionController.java
0 → 100644
| 1 | +package cn.iocoder.yudao.adminserver.modules.activiti.controller.workflow; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.CommonResult; | |
| 4 | +import org.activiti.api.process.runtime.ProcessRuntime; | |
| 5 | +import org.activiti.engine.RepositoryService; | |
| 6 | +import org.activiti.engine.repository.ProcessDefinition; | |
| 7 | +import org.activiti.engine.repository.ProcessDefinitionQuery; | |
| 8 | +import org.springframework.web.bind.annotation.GetMapping; | |
| 9 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 10 | +import org.springframework.web.bind.annotation.RequestParam; | |
| 11 | +import org.springframework.web.bind.annotation.RestController; | |
| 12 | + | |
| 13 | +import javax.annotation.Resource; | |
| 14 | + | |
| 15 | +@RestController | |
| 16 | +@RequestMapping("/workflow/process/definition") | |
| 17 | +public class ProcessDefinitionController { | |
| 18 | + | |
| 19 | + @Resource | |
| 20 | + private RepositoryService repositoryService; | |
| 21 | + | |
| 22 | + @Resource | |
| 23 | + private ProcessRuntime processRuntime; | |
| 24 | + | |
| 25 | + | |
| 26 | + @GetMapping(value = "/getStartForm") | |
| 27 | + public CommonResult<String> getStartForm(@RequestParam("processKey") String processKey){ | |
| 28 | + //这样查似乎有问题??, 暂时写死 | |
| 29 | +// final ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery(). | |
| 30 | +// processDefinitionKey(processKey).latestVersion().singleResult(); | |
| 31 | +// processRuntime.processDefinition(processDefinition.getId()).getFormKey(); | |
| 32 | + return CommonResult.success("/flow/leave/apply"); | |
| 33 | + } | |
| 34 | +} | ... | ... |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/workflow/TaskController.java
| ... | ... | @@ -43,6 +43,11 @@ public class TaskController { |
| 43 | 43 | return success( taskService.getTaskSteps(taskQuery)); |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | + @PostMapping("/formKey") | |
| 47 | + public CommonResult<TodoTaskRespVO> getTaskFormKey(@RequestBody TaskQueryReqVO taskQuery) { | |
| 48 | + return success( taskService.getTaskFormKey(taskQuery)); | |
| 49 | + } | |
| 50 | + | |
| 46 | 51 | @PostMapping("/complete") |
| 47 | 52 | public CommonResult<Boolean> complete(@RequestBody TaskReqVO taskReq) { |
| 48 | 53 | taskService.completeTask(taskReq); | ... | ... |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/workflow/vo/TaskStepVO.java
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/workflow/vo/TodoTaskRespVO.java
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/oa/ReportBackEndProcessor.java
| ... | ... | @@ -3,7 +3,9 @@ package cn.iocoder.yudao.adminserver.modules.activiti.service.oa; |
| 3 | 3 | import cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.oa.OaLeaveDO; |
| 4 | 4 | import cn.iocoder.yudao.adminserver.modules.activiti.dal.mysql.oa.OaLeaveMapper; |
| 5 | 5 | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| 6 | +import org.activiti.engine.delegate.DelegateExecution; | |
| 6 | 7 | import org.activiti.engine.delegate.DelegateTask; |
| 8 | +import org.activiti.engine.delegate.ExecutionListener; | |
| 7 | 9 | import org.activiti.engine.delegate.TaskListener; |
| 8 | 10 | import org.springframework.stereotype.Component; |
| 9 | 11 | import org.springframework.transaction.annotation.Transactional; |
| ... | ... | @@ -11,16 +13,27 @@ import org.springframework.transaction.annotation.Transactional; |
| 11 | 13 | import javax.annotation.Resource; |
| 12 | 14 | |
| 13 | 15 | @Component |
| 14 | -public class ReportBackEndProcessor implements TaskListener { | |
| 16 | +public class ReportBackEndProcessor implements ExecutionListener { | |
| 15 | 17 | |
| 16 | 18 | @Resource |
| 17 | 19 | private OaLeaveMapper leaveMapper; |
| 18 | 20 | |
| 19 | 21 | |
| 22 | +// @Override | |
| 23 | +// @Transactional(rollbackFor = Exception.class) | |
| 24 | +// public void notify(DelegateTask delegateTask) { | |
| 25 | +// final String businessKey = delegateTask.getExecution().getProcessInstanceBusinessKey(); | |
| 26 | +// UpdateWrapper<OaLeaveDO> updateWrapper = new UpdateWrapper<>(); | |
| 27 | +// updateWrapper.eq("id", Long.valueOf(businessKey)); | |
| 28 | +// OaLeaveDO updateDo = new OaLeaveDO(); | |
| 29 | +// updateDo.setStatus(2); | |
| 30 | +// leaveMapper.update(updateDo, updateWrapper); | |
| 31 | +// } | |
| 32 | + | |
| 20 | 33 | @Override |
| 21 | 34 | @Transactional(rollbackFor = Exception.class) |
| 22 | - public void notify(DelegateTask delegateTask) { | |
| 23 | - final String businessKey = delegateTask.getExecution().getProcessInstanceBusinessKey(); | |
| 35 | + public void notify(DelegateExecution delegateExecution) { | |
| 36 | + final String businessKey = delegateExecution.getProcessInstanceBusinessKey(); | |
| 24 | 37 | UpdateWrapper<OaLeaveDO> updateWrapper = new UpdateWrapper<>(); |
| 25 | 38 | updateWrapper.eq("id", Long.valueOf(businessKey)); |
| 26 | 39 | OaLeaveDO updateDo = new OaLeaveDO(); | ... | ... |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/oa/impl/OaLeaveServiceImpl.java
| ... | ... | @@ -2,6 +2,9 @@ package cn.iocoder.yudao.adminserver.modules.activiti.service.oa.impl; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; |
| 4 | 4 | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| 5 | +import org.activiti.api.task.model.Task; | |
| 6 | +import org.activiti.api.task.model.builders.TaskPayloadBuilder; | |
| 7 | +import org.activiti.api.task.runtime.TaskRuntime; | |
| 5 | 8 | import org.activiti.engine.RuntimeService; |
| 6 | 9 | import org.activiti.engine.runtime.ProcessInstance; |
| 7 | 10 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | ... | @@ -38,6 +41,12 @@ public class OaLeaveServiceImpl implements OaLeaveService { |
| 38 | 41 | @Resource |
| 39 | 42 | private RuntimeService runtimeService; |
| 40 | 43 | |
| 44 | + @Resource | |
| 45 | + private org.activiti.engine.TaskService activitiTaskService; | |
| 46 | + | |
| 47 | + @Resource | |
| 48 | + private TaskRuntime taskRuntime; | |
| 49 | + | |
| 41 | 50 | @Override |
| 42 | 51 | @Transactional(rollbackFor = Exception.class) |
| 43 | 52 | public Long createLeave(OaLeaveCreateReqVO createReqVO) { |
| ... | ... | @@ -52,7 +61,7 @@ public class OaLeaveServiceImpl implements OaLeaveService { |
| 52 | 61 | variables.put("deptLeader", "admin"); |
| 53 | 62 | final Long id = leave.getId(); |
| 54 | 63 | String businessKey = String.valueOf(id); |
| 55 | - ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("leave", businessKey, variables); | |
| 64 | + ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(createReqVO.getProcessKey(), businessKey, variables); | |
| 56 | 65 | |
| 57 | 66 | final String processInstanceId = processInstance.getProcessInstanceId(); |
| 58 | 67 | |
| ... | ... | @@ -67,12 +76,29 @@ public class OaLeaveServiceImpl implements OaLeaveService { |
| 67 | 76 | } |
| 68 | 77 | |
| 69 | 78 | @Override |
| 79 | + @Transactional(rollbackFor = Exception.class) | |
| 70 | 80 | public void updateLeave(OaLeaveUpdateReqVO updateReqVO) { |
| 81 | + | |
| 71 | 82 | // 校验存在 |
| 72 | 83 | this.validateLeaveExists(updateReqVO.getId()); |
| 73 | - // 更新 | |
| 74 | - OaLeaveDO updateObj = OaLeaveConvert.INSTANCE.convert(updateReqVO); | |
| 75 | - leaveMapper.updateById(updateObj); | |
| 84 | + | |
| 85 | + final Task task = taskRuntime.task(updateReqVO.getTaskId()); | |
| 86 | + activitiTaskService.addComment(task.getId(), task.getProcessInstanceId(), updateReqVO.getComment()); | |
| 87 | + Map<String, Object> variables = updateReqVO.getVariables(); | |
| 88 | + | |
| 89 | + //如何得到部门领导人, 暂时写死 | |
| 90 | + variables.put("deptLeader", "admin"); | |
| 91 | + taskRuntime.complete(TaskPayloadBuilder.complete().withTaskId(task.getId()) | |
| 92 | + .withVariables(variables) | |
| 93 | + .build()); | |
| 94 | + final Object reApply = variables.get("reApply"); | |
| 95 | + if((reApply instanceof Boolean) && (Boolean)reApply){ | |
| 96 | + // 更新 表单 | |
| 97 | + OaLeaveDO updateObj = OaLeaveConvert.INSTANCE.convert(updateReqVO); | |
| 98 | + leaveMapper.updateById(updateObj); | |
| 99 | + } | |
| 100 | + | |
| 101 | + | |
| 76 | 102 | } |
| 77 | 103 | |
| 78 | 104 | @Override | ... | ... |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/workflow/TaskService.java
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/workflow/impl/TaskServiceImpl.java
| ... | ... | @@ -117,14 +117,14 @@ public class TaskServiceImpl implements TaskService { |
| 117 | 117 | .withVariables(taskReq.getVariables()) |
| 118 | 118 | .build()); |
| 119 | 119 | |
| 120 | - if(variables.containsValue(Boolean.FALSE)){ | |
| 121 | - final String businessKey = task.getBusinessKey(); | |
| 122 | - UpdateWrapper<OaLeaveDO> updateWrapper = new UpdateWrapper<>(); | |
| 123 | - updateWrapper.eq("id", Long.valueOf(businessKey)); | |
| 124 | - OaLeaveDO updateDo = new OaLeaveDO(); | |
| 125 | - updateDo.setStatus(2); | |
| 126 | - leaveMapper.update(updateDo, updateWrapper); | |
| 127 | - } | |
| 120 | +// if(variables.containsValue(Boolean.FALSE)){ | |
| 121 | +// final String businessKey = task.getBusinessKey(); | |
| 122 | +// UpdateWrapper<OaLeaveDO> updateWrapper = new UpdateWrapper<>(); | |
| 123 | +// updateWrapper.eq("id", Long.valueOf(businessKey)); | |
| 124 | +// OaLeaveDO updateDo = new OaLeaveDO(); | |
| 125 | +// updateDo.setStatus(2); | |
| 126 | +// leaveMapper.update(updateDo, updateWrapper); | |
| 127 | +// } | |
| 128 | 128 | |
| 129 | 129 | } |
| 130 | 130 | |
| ... | ... | @@ -152,19 +152,19 @@ public class TaskServiceImpl implements TaskService { |
| 152 | 152 | public TaskHandleVO getTaskSteps(TaskQueryReqVO taskQuery) { |
| 153 | 153 | TaskHandleVO handleVO = new TaskHandleVO(); |
| 154 | 154 | |
| 155 | - String processKey = taskQuery.getProcessKey(); | |
| 156 | - if ("leave".equals(processKey)) { | |
| 157 | - String businessKey = taskQuery.getBusinessKey(); | |
| 158 | - final OaLeaveDO leave = leaveMapper.selectById(Long.valueOf(businessKey)); | |
| 159 | - handleVO.setFormObject( OaLeaveConvert.INSTANCE.convert(leave)); | |
| 160 | - } | |
| 155 | +// String processKey = taskQuery.getProcessKey(); | |
| 156 | +// if ("leave".equals(processKey)) { | |
| 157 | +// String businessKey = taskQuery.getBusinessKey(); | |
| 158 | +// final OaLeaveDO leave = leaveMapper.selectById(Long.valueOf(businessKey)); | |
| 159 | +// handleVO.setFormObject( OaLeaveConvert.INSTANCE.convert(leave)); | |
| 160 | +// } | |
| 161 | 161 | |
| 162 | +// | |
| 163 | +// final String taskDefKey = task.getTaskDefinitionKey(); | |
| 164 | +// final String variableName = Optional.ofNullable(taskVariable.get(taskDefKey)).orElse(""); | |
| 165 | +// handleVO.setTaskVariable(variableName); | |
| 162 | 166 | final Task task = taskRuntime.task(taskQuery.getTaskId()); |
| 163 | - final String taskDefKey = task.getTaskDefinitionKey(); | |
| 164 | - final String variableName = Optional.ofNullable(taskVariable.get(taskDefKey)).orElse(""); | |
| 165 | - | |
| 166 | 167 | |
| 167 | - handleVO.setTaskVariable(variableName); | |
| 168 | 168 | List<TaskStepVO> steps = getTaskSteps(task.getProcessInstanceId()); |
| 169 | 169 | |
| 170 | 170 | handleVO.setHistoryTask(steps); |
| ... | ... | @@ -189,6 +189,7 @@ public class TaskServiceImpl implements TaskService { |
| 189 | 189 | step.setStartTime(instance.getStartTime()); |
| 190 | 190 | step.setEndTime(instance.getEndTime()); |
| 191 | 191 | step.setAssignee(instance.getAssignee()); |
| 192 | + step.setStatus(1); | |
| 192 | 193 | final List<Comment> comments = activitiTaskService.getTaskComments(instance.getTaskId()); |
| 193 | 194 | if(comments.size()>0){ |
| 194 | 195 | step.setComment(comments.get(0).getFullMessage()); |
| ... | ... | @@ -204,15 +205,14 @@ public class TaskServiceImpl implements TaskService { |
| 204 | 205 | .activityType("userTask") |
| 205 | 206 | .unfinished().list(); |
| 206 | 207 | |
| 207 | - if(unfinished.size()>0) { | |
| 208 | - | |
| 209 | - final HistoricActivityInstance unFinishedActiviti = unfinished.get(0); | |
| 208 | + for (HistoricActivityInstance instance : unfinished) { | |
| 210 | 209 | TaskStepVO step = new TaskStepVO(); |
| 211 | - step.setStepName(unFinishedActiviti.getActivityName()); | |
| 212 | - step.setStartTime(unFinishedActiviti.getStartTime()); | |
| 213 | - step.setEndTime(unFinishedActiviti.getEndTime()); | |
| 214 | - step.setAssignee(Optional.ofNullable(unFinishedActiviti.getAssignee()).orElse("")); | |
| 210 | + step.setStepName(instance.getActivityName()); | |
| 211 | + step.setStartTime(instance.getStartTime()); | |
| 212 | + step.setEndTime(instance.getEndTime()); | |
| 213 | + step.setAssignee(Optional.ofNullable(instance.getAssignee()).orElse("")); | |
| 215 | 214 | step.setComment(""); |
| 215 | + step.setStatus(0); | |
| 216 | 216 | steps.add(step); |
| 217 | 217 | } |
| 218 | 218 | return steps; |
| ... | ... | @@ -225,6 +225,15 @@ public class TaskServiceImpl implements TaskService { |
| 225 | 225 | return getTaskSteps(processInstanceId); |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | + @Override | |
| 229 | + public TodoTaskRespVO getTaskFormKey(TaskQueryReqVO taskQuery) { | |
| 230 | + final Task task = taskRuntime.task(taskQuery.getTaskId()); | |
| 231 | + TodoTaskRespVO respVO = new TodoTaskRespVO(); | |
| 232 | + respVO.setFormKey(task.getFormKey()); | |
| 233 | + respVO.setBusinessKey(task.getBusinessKey()); | |
| 234 | + respVO.setId(task.getId()); | |
| 235 | + return respVO; | |
| 236 | + } | |
| 228 | 237 | |
| 229 | 238 | |
| 230 | 239 | // private List<String> getHighLightedFlows(ProcessDefinitionEntity processDefinition, String processInstanceId) { | ... | ... |
yudao-admin-server/src/main/resources/processes/leave-formkey.bpmn
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://bpmn.io/schema/bpmn"> | |
| 3 | + <process id="leave-formkey" name="请假流程-外置表单" isExecutable="true"> | |
| 4 | + <documentation>外置表单</documentation> | |
| 5 | + <startEvent id="startevent1" name="Start" activiti:initiator="applyUserId" activiti:formKey="/flow/leave/apply"></startEvent> | |
| 6 | + <userTask id="deptLeaderVerify" name="部门经理审批" activiti:assignee="${deptLeader}" activiti:formKey="/flow/leave/approve-leader"></userTask> | |
| 7 | + <exclusiveGateway id="exclusivegateway1" name="Exclusive Gateway"></exclusiveGateway> | |
| 8 | + <userTask id="hrVerify" name="人事经理审批" activiti:candidateGroups="hr" activiti:formKey="/flow/leave/approve-hr"></userTask> | |
| 9 | + <exclusiveGateway id="exclusivegateway2" name="Exclusive Gateway"></exclusiveGateway> | |
| 10 | + <userTask id="reportBack" name="申请人确认" activiti:assignee="${applyUserId}" activiti:formKey="/flow/leave/confirm"> | |
| 11 | + </userTask> | |
| 12 | + <endEvent id="endevent1" name="End"></endEvent> | |
| 13 | + <userTask id="modifyApply" name="调整申请内容" activiti:assignee="${applyUserId}" activiti:formKey="/flow/leave/modify"></userTask> | |
| 14 | + <exclusiveGateway id="exclusivegateway3" name="Exclusive Gateway"></exclusiveGateway> | |
| 15 | + <sequenceFlow id="flow1" sourceRef="startevent1" targetRef="deptLeaderVerify"></sequenceFlow> | |
| 16 | + <sequenceFlow id="flow2" sourceRef="deptLeaderVerify" targetRef="exclusivegateway1"></sequenceFlow> | |
| 17 | + <sequenceFlow id="flow3" name="同意" sourceRef="exclusivegateway1" targetRef="hrVerify"> | |
| 18 | + <conditionExpression xsi:type="tFormalExpression"><![CDATA[${deptLeaderApproved == 'true'}]]></conditionExpression> | |
| 19 | + </sequenceFlow> | |
| 20 | + <sequenceFlow id="flow4" sourceRef="hrVerify" targetRef="exclusivegateway2"></sequenceFlow> | |
| 21 | + <sequenceFlow id="flow5" name="同意" sourceRef="exclusivegateway2" targetRef="reportBack"> | |
| 22 | + <conditionExpression xsi:type="tFormalExpression"><![CDATA[${hrApproved == 'true'}]]></conditionExpression> | |
| 23 | + </sequenceFlow> | |
| 24 | + <sequenceFlow id="flow6" sourceRef="reportBack" targetRef="endevent1"> | |
| 25 | + <extensionElements> | |
| 26 | + <activiti:executionListener event="take" delegateExpression="${reportBackEndProcessor}"></activiti:executionListener> | |
| 27 | + </extensionElements> | |
| 28 | + </sequenceFlow> | |
| 29 | + <sequenceFlow id="flow7" name="不同意" sourceRef="exclusivegateway2" targetRef="modifyApply"> | |
| 30 | + <conditionExpression xsi:type="tFormalExpression"><![CDATA[${hrApproved == 'false'}]]></conditionExpression> | |
| 31 | + </sequenceFlow> | |
| 32 | + <sequenceFlow id="flow8" name="不同意" sourceRef="exclusivegateway1" targetRef="modifyApply"> | |
| 33 | + <conditionExpression xsi:type="tFormalExpression"><![CDATA[${deptLeaderApproved == 'false'}]]></conditionExpression> | |
| 34 | + </sequenceFlow> | |
| 35 | + <sequenceFlow id="flow9" sourceRef="modifyApply" targetRef="exclusivegateway3"></sequenceFlow> | |
| 36 | + <sequenceFlow id="flow10" name="调整后继续申请" sourceRef="exclusivegateway3" targetRef="deptLeaderVerify"> | |
| 37 | + <conditionExpression xsi:type="tFormalExpression"><![CDATA[${reApply == 'true'}]]></conditionExpression> | |
| 38 | + </sequenceFlow> | |
| 39 | + <sequenceFlow id="flow11" name="取消申请,并设置取消标志" sourceRef="exclusivegateway3" targetRef="endevent1"> | |
| 40 | + <extensionElements> | |
| 41 | + <activiti:executionListener event="take" delegateExpression="${reportBackEndProcessor}"></activiti:executionListener> | |
| 42 | + </extensionElements> | |
| 43 | + <conditionExpression xsi:type="tFormalExpression"><![CDATA[${reApply == 'false'}]]></conditionExpression> | |
| 44 | + </sequenceFlow> | |
| 45 | + <textAnnotation id="textannotation1" textFormat="text/plain"> | |
| 46 | + <text>请求被驳回后员工可以选择继续申请,或者取消本次申请</text> | |
| 47 | + </textAnnotation> | |
| 48 | + <association id="association1" sourceRef="modifyApply" targetRef="textannotation1"></association> | |
| 49 | + </process> | |
| 50 | + <bpmndi:BPMNDiagram id="BPMNDiagram_leave-formkey"> | |
| 51 | + <bpmndi:BPMNPlane bpmnElement="leave-formkey" id="BPMNPlane_leave-formkey"> | |
| 52 | + <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1"> | |
| 53 | + <omgdc:Bounds height="35.0" width="35.0" x="10.0" y="50.0"></omgdc:Bounds> | |
| 54 | + </bpmndi:BPMNShape> | |
| 55 | + <bpmndi:BPMNShape bpmnElement="deptLeaderVerify" id="BPMNShape_deptLeaderVerify"> | |
| 56 | + <omgdc:Bounds height="55.0" width="105.0" x="90.0" y="40.0"></omgdc:Bounds> | |
| 57 | + </bpmndi:BPMNShape> | |
| 58 | + <bpmndi:BPMNShape bpmnElement="exclusivegateway1" id="BPMNShape_exclusivegateway1"> | |
| 59 | + <omgdc:Bounds height="40.0" width="40.0" x="230.0" y="47.0"></omgdc:Bounds> | |
| 60 | + </bpmndi:BPMNShape> | |
| 61 | + <bpmndi:BPMNShape bpmnElement="hrVerify" id="BPMNShape_hrVerify"> | |
| 62 | + <omgdc:Bounds height="55.0" width="105.0" x="310.0" y="40.0"></omgdc:Bounds> | |
| 63 | + </bpmndi:BPMNShape> | |
| 64 | + <bpmndi:BPMNShape bpmnElement="exclusivegateway2" id="BPMNShape_exclusivegateway2"> | |
| 65 | + <omgdc:Bounds height="40.0" width="40.0" x="470.0" y="47.0"></omgdc:Bounds> | |
| 66 | + </bpmndi:BPMNShape> | |
| 67 | + <bpmndi:BPMNShape bpmnElement="reportBack" id="BPMNShape_reportBack"> | |
| 68 | + <omgdc:Bounds height="55.0" width="105.0" x="580.0" y="40.0"></omgdc:Bounds> | |
| 69 | + </bpmndi:BPMNShape> | |
| 70 | + <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1"> | |
| 71 | + <omgdc:Bounds height="35.0" width="35.0" x="615.0" y="213.0"></omgdc:Bounds> | |
| 72 | + </bpmndi:BPMNShape> | |
| 73 | + <bpmndi:BPMNShape bpmnElement="modifyApply" id="BPMNShape_modifyApply"> | |
| 74 | + <omgdc:Bounds height="55.0" width="105.0" x="198.0" y="120.0"></omgdc:Bounds> | |
| 75 | + </bpmndi:BPMNShape> | |
| 76 | + <bpmndi:BPMNShape bpmnElement="exclusivegateway3" id="BPMNShape_exclusivegateway3"> | |
| 77 | + <omgdc:Bounds height="40.0" width="40.0" x="230.0" y="210.0"></omgdc:Bounds> | |
| 78 | + </bpmndi:BPMNShape> | |
| 79 | + <bpmndi:BPMNShape bpmnElement="textannotation1" id="BPMNShape_textannotation1"> | |
| 80 | + <omgdc:Bounds height="57.0" width="112.0" x="340.0" y="168.0"></omgdc:Bounds> | |
| 81 | + </bpmndi:BPMNShape> | |
| 82 | + <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1"> | |
| 83 | + <omgdi:waypoint x="45.0" y="67.0"></omgdi:waypoint> | |
| 84 | + <omgdi:waypoint x="90.0" y="67.0"></omgdi:waypoint> | |
| 85 | + </bpmndi:BPMNEdge> | |
| 86 | + <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2"> | |
| 87 | + <omgdi:waypoint x="195.0" y="67.0"></omgdi:waypoint> | |
| 88 | + <omgdi:waypoint x="230.0" y="67.0"></omgdi:waypoint> | |
| 89 | + </bpmndi:BPMNEdge> | |
| 90 | + <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3"> | |
| 91 | + <omgdi:waypoint x="270.0" y="67.0"></omgdi:waypoint> | |
| 92 | + <omgdi:waypoint x="310.0" y="67.0"></omgdi:waypoint> | |
| 93 | + <bpmndi:BPMNLabel> | |
| 94 | + <omgdc:Bounds height="11.0" width="22.0" x="269.0" y="50.0"></omgdc:Bounds> | |
| 95 | + </bpmndi:BPMNLabel> | |
| 96 | + </bpmndi:BPMNEdge> | |
| 97 | + <bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4"> | |
| 98 | + <omgdi:waypoint x="415.0" y="67.0"></omgdi:waypoint> | |
| 99 | + <omgdi:waypoint x="470.0" y="67.0"></omgdi:waypoint> | |
| 100 | + </bpmndi:BPMNEdge> | |
| 101 | + <bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5"> | |
| 102 | + <omgdi:waypoint x="510.0" y="67.0"></omgdi:waypoint> | |
| 103 | + <omgdi:waypoint x="580.0" y="67.0"></omgdi:waypoint> | |
| 104 | + <bpmndi:BPMNLabel> | |
| 105 | + <omgdc:Bounds height="11.0" width="22.0" x="529.0" y="50.0"></omgdc:Bounds> | |
| 106 | + </bpmndi:BPMNLabel> | |
| 107 | + </bpmndi:BPMNEdge> | |
| 108 | + <bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6"> | |
| 109 | + <omgdi:waypoint x="632.0" y="95.0"></omgdi:waypoint> | |
| 110 | + <omgdi:waypoint x="632.0" y="213.0"></omgdi:waypoint> | |
| 111 | + </bpmndi:BPMNEdge> | |
| 112 | + <bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7"> | |
| 113 | + <omgdi:waypoint x="490.0" y="87.0"></omgdi:waypoint> | |
| 114 | + <omgdi:waypoint x="490.0" y="147.0"></omgdi:waypoint> | |
| 115 | + <omgdi:waypoint x="303.0" y="147.0"></omgdi:waypoint> | |
| 116 | + <bpmndi:BPMNLabel> | |
| 117 | + <omgdc:Bounds height="11.0" width="33.0" x="438.0" y="119.0"></omgdc:Bounds> | |
| 118 | + </bpmndi:BPMNLabel> | |
| 119 | + </bpmndi:BPMNEdge> | |
| 120 | + <bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8"> | |
| 121 | + <omgdi:waypoint x="250.0" y="87.0"></omgdi:waypoint> | |
| 122 | + <omgdi:waypoint x="250.0" y="120.0"></omgdi:waypoint> | |
| 123 | + <bpmndi:BPMNLabel> | |
| 124 | + <omgdc:Bounds height="11.0" width="33.0" x="260.0" y="87.0"></omgdc:Bounds> | |
| 125 | + </bpmndi:BPMNLabel> | |
| 126 | + </bpmndi:BPMNEdge> | |
| 127 | + <bpmndi:BPMNEdge bpmnElement="flow9" id="BPMNEdge_flow9"> | |
| 128 | + <omgdi:waypoint x="250.0" y="175.0"></omgdi:waypoint> | |
| 129 | + <omgdi:waypoint x="250.0" y="210.0"></omgdi:waypoint> | |
| 130 | + </bpmndi:BPMNEdge> | |
| 131 | + <bpmndi:BPMNEdge bpmnElement="flow10" id="BPMNEdge_flow10"> | |
| 132 | + <omgdi:waypoint x="230.0" y="230.0"></omgdi:waypoint> | |
| 133 | + <omgdi:waypoint x="142.0" y="230.0"></omgdi:waypoint> | |
| 134 | + <omgdi:waypoint x="142.0" y="95.0"></omgdi:waypoint> | |
| 135 | + <bpmndi:BPMNLabel> | |
| 136 | + <omgdc:Bounds height="11.0" width="77.0" x="159.0" y="210.0"></omgdc:Bounds> | |
| 137 | + </bpmndi:BPMNLabel> | |
| 138 | + </bpmndi:BPMNEdge> | |
| 139 | + <bpmndi:BPMNEdge bpmnElement="flow11" id="BPMNEdge_flow11"> | |
| 140 | + <omgdi:waypoint x="270.0" y="230.0"></omgdi:waypoint> | |
| 141 | + <omgdi:waypoint x="615.0" y="230.0"></omgdi:waypoint> | |
| 142 | + <bpmndi:BPMNLabel> | |
| 143 | + <omgdc:Bounds height="33.0" width="100.0" x="58.0" y="-37.0"></omgdc:Bounds> | |
| 144 | + </bpmndi:BPMNLabel> | |
| 145 | + </bpmndi:BPMNEdge> | |
| 146 | + <bpmndi:BPMNEdge bpmnElement="association1" id="BPMNEdge_association1"> | |
| 147 | + <omgdi:waypoint x="303.0" y="147.0"></omgdi:waypoint> | |
| 148 | + <omgdi:waypoint x="396.0" y="168.0"></omgdi:waypoint> | |
| 149 | + </bpmndi:BPMNEdge> | |
| 150 | + </bpmndi:BPMNPlane> | |
| 151 | + </bpmndi:BPMNDiagram> | |
| 152 | +</definitions> | |
| 0 | 153 | \ No newline at end of file | ... | ... |
yudao-admin-server/src/main/resources/processes/leave.bpmn deleted
| 1 | -<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | -<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://bpmn.io/schema/bpmn"> | |
| 3 | - <process id="leave" name="请假流程-普通表单" isExecutable="true"> | |
| 4 | - <documentation>请假流程演示</documentation> | |
| 5 | - <startEvent id="startevent1" name="Start" activiti:initiator="applyUserId"></startEvent> | |
| 6 | - <userTask id="deptLeaderVerify" name="部门领导审批" activiti:assignee="${deptLeader}"></userTask> | |
| 7 | - <exclusiveGateway id="exclusivegateway5" name="Exclusive Gateway"></exclusiveGateway> | |
| 8 | - <userTask id="hrVerify" name="人事审批" activiti:candidateGroups="hr"></userTask> | |
| 9 | - <exclusiveGateway id="exclusivegateway6" name="Exclusive Gateway"></exclusiveGateway> | |
| 10 | - <userTask id="reportBack" name="申请人确认" activiti:assignee="${applyUserId}"> | |
| 11 | - <extensionElements> | |
| 12 | - <activiti:taskListener event="complete" delegateExpression="${reportBackEndProcessor}"></activiti:taskListener> | |
| 13 | - </extensionElements> | |
| 14 | - </userTask> | |
| 15 | - <endEvent id="endevent1" name="End"></endEvent> | |
| 16 | - <sequenceFlow id="flow2" sourceRef="startevent1" targetRef="deptLeaderVerify"></sequenceFlow> | |
| 17 | - <sequenceFlow id="flow3" sourceRef="deptLeaderVerify" targetRef="exclusivegateway5"></sequenceFlow> | |
| 18 | - <sequenceFlow id="flow5" name="部门领导审批-同意" sourceRef="exclusivegateway5" targetRef="hrVerify"> | |
| 19 | - <conditionExpression xsi:type="tFormalExpression"><![CDATA[${deptLeaderApproved}]]></conditionExpression> | |
| 20 | - </sequenceFlow> | |
| 21 | - <sequenceFlow id="flow6" sourceRef="hrVerify" targetRef="exclusivegateway6"></sequenceFlow> | |
| 22 | - <sequenceFlow id="flow7" name="人事审批-同意" sourceRef="exclusivegateway6" targetRef="reportBack"> | |
| 23 | - <conditionExpression xsi:type="tFormalExpression"><![CDATA[${hrApproved}]]></conditionExpression> | |
| 24 | - </sequenceFlow> | |
| 25 | - <sequenceFlow id="flow8" sourceRef="reportBack" targetRef="endevent1"></sequenceFlow> | |
| 26 | - <sequenceFlow id="flow4" name="部门领导审批-不同意" sourceRef="exclusivegateway5" targetRef="endevent1" > | |
| 27 | - <conditionExpression xsi:type="tFormalExpression"><![CDATA[${!deptLeaderApproved}]]></conditionExpression> | |
| 28 | - </sequenceFlow> | |
| 29 | - <sequenceFlow sourceRef="exclusivegateway6" name="人事审批-不同意" targetRef="endevent1" id="flow9"> | |
| 30 | - <conditionExpression xsi:type="tFormalExpression"><![CDATA[${!hrApproved}]]></conditionExpression> | |
| 31 | - </sequenceFlow> | |
| 32 | - </process> | |
| 33 | - <bpmndi:BPMNDiagram id="BPMNDiagram_leave"> | |
| 34 | - <bpmndi:BPMNPlane bpmnElement="leave" id="BPMNPlane_leave"> | |
| 35 | - <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1"> | |
| 36 | - <omgdc:Bounds height="35.0" width="35.0" x="0.0" y="46.0"></omgdc:Bounds> | |
| 37 | - </bpmndi:BPMNShape> | |
| 38 | - <bpmndi:BPMNShape bpmnElement="deptLeaderVerify" id="BPMNShape_deptLeaderVerify"> | |
| 39 | - <omgdc:Bounds height="55.0" width="105.0" x="80.0" y="36.0"></omgdc:Bounds> | |
| 40 | - </bpmndi:BPMNShape> | |
| 41 | - <bpmndi:BPMNShape bpmnElement="exclusivegateway5" id="BPMNShape_exclusivegateway5"> | |
| 42 | - <omgdc:Bounds height="40.0" width="40.0" x="240.0" y="43.0"></omgdc:Bounds> | |
| 43 | - </bpmndi:BPMNShape> | |
| 44 | - <bpmndi:BPMNShape bpmnElement="hrVerify" id="BPMNShape_hrVerify"> | |
| 45 | - <omgdc:Bounds height="55.0" width="105.0" x="348.0" y="36.0"></omgdc:Bounds> | |
| 46 | - </bpmndi:BPMNShape> | |
| 47 | - <bpmndi:BPMNShape bpmnElement="exclusivegateway6" id="BPMNShape_exclusivegateway6"> | |
| 48 | - <omgdc:Bounds height="40.0" width="40.0" x="485.0" y="43.0"></omgdc:Bounds> | |
| 49 | - </bpmndi:BPMNShape> | |
| 50 | - <bpmndi:BPMNShape bpmnElement="reportBack" id="BPMNShape_reportBack"> | |
| 51 | - <omgdc:Bounds height="55.0" width="105.0" x="580.0" y="36.0"></omgdc:Bounds> | |
| 52 | - </bpmndi:BPMNShape> | |
| 53 | - <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1"> | |
| 54 | - <omgdc:Bounds height="35.0" width="35.0" x="615.0" y="195.0"></omgdc:Bounds> | |
| 55 | - </bpmndi:BPMNShape> | |
| 56 | - <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2"> | |
| 57 | - <omgdi:waypoint x="35.0" y="63.0"></omgdi:waypoint> | |
| 58 | - <omgdi:waypoint x="80.0" y="63.0"></omgdi:waypoint> | |
| 59 | - </bpmndi:BPMNEdge> | |
| 60 | - <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3"> | |
| 61 | - <omgdi:waypoint x="185.0" y="63.0"></omgdi:waypoint> | |
| 62 | - <omgdi:waypoint x="240.0" y="63.0"></omgdi:waypoint> | |
| 63 | - </bpmndi:BPMNEdge> | |
| 64 | - <bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4"> | |
| 65 | - <omgdi:waypoint x="260.0" y="83.0"></omgdi:waypoint> | |
| 66 | - <omgdi:waypoint x="260.0" y="114.0"></omgdi:waypoint> | |
| 67 | - <bpmndi:BPMNLabel> | |
| 68 | - <omgdc:Bounds height="11.0" width="33.0" x="270.0" y="83.0"></omgdc:Bounds> | |
| 69 | - </bpmndi:BPMNLabel> | |
| 70 | - </bpmndi:BPMNEdge> | |
| 71 | - <bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5"> | |
| 72 | - <omgdi:waypoint x="280.0" y="63.0"></omgdi:waypoint> | |
| 73 | - <omgdi:waypoint x="348.0" y="63.0"></omgdi:waypoint> | |
| 74 | - <bpmndi:BPMNLabel> | |
| 75 | - <omgdc:Bounds height="11.0" width="22.0" x="300.0" y="46.0"></omgdc:Bounds> | |
| 76 | - </bpmndi:BPMNLabel> | |
| 77 | - </bpmndi:BPMNEdge> | |
| 78 | - <bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6"> | |
| 79 | - <omgdi:waypoint x="453.0" y="63.0"></omgdi:waypoint> | |
| 80 | - <omgdi:waypoint x="485.0" y="63.0"></omgdi:waypoint> | |
| 81 | - </bpmndi:BPMNEdge> | |
| 82 | - <bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7"> | |
| 83 | - <omgdi:waypoint x="525.0" y="63.0"></omgdi:waypoint> | |
| 84 | - <omgdi:waypoint x="580.0" y="63.0"></omgdi:waypoint> | |
| 85 | - <bpmndi:BPMNLabel> | |
| 86 | - <omgdc:Bounds height="11.0" width="22.0" x="539.0" y="46.0"></omgdc:Bounds> | |
| 87 | - </bpmndi:BPMNLabel> | |
| 88 | - </bpmndi:BPMNEdge> | |
| 89 | - <bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8"> | |
| 90 | - <omgdi:waypoint x="632.0" y="91.0"></omgdi:waypoint> | |
| 91 | - <omgdi:waypoint x="632.0" y="195.0"></omgdi:waypoint> | |
| 92 | - </bpmndi:BPMNEdge> | |
| 93 | - <bpmndi:BPMNEdge bpmnElement="flow9" id="BPMNEdge_flow9"> | |
| 94 | - <omgdi:waypoint x="505.0" y="83.0"></omgdi:waypoint> | |
| 95 | - <omgdi:waypoint x="504.0" y="141.0"></omgdi:waypoint> | |
| 96 | - <omgdi:waypoint x="313.0" y="141.0"></omgdi:waypoint> | |
| 97 | - <bpmndi:BPMNLabel> | |
| 98 | - <omgdc:Bounds height="11.0" width="33.0" x="515.0" y="83.0"></omgdc:Bounds> | |
| 99 | - </bpmndi:BPMNLabel> | |
| 100 | - </bpmndi:BPMNEdge> | |
| 101 | - <bpmndi:BPMNEdge bpmnElement="flow10" id="BPMNEdge_flow10"> | |
| 102 | - <omgdi:waypoint x="240.0" y="212.0"></omgdi:waypoint> | |
| 103 | - <omgdi:waypoint x="132.0" y="212.0"></omgdi:waypoint> | |
| 104 | - <omgdi:waypoint x="132.0" y="91.0"></omgdi:waypoint> | |
| 105 | - <bpmndi:BPMNLabel> | |
| 106 | - <omgdc:Bounds height="11.0" width="44.0" x="142.0" y="192.0"></omgdc:Bounds> | |
| 107 | - </bpmndi:BPMNLabel> | |
| 108 | - </bpmndi:BPMNEdge> | |
| 109 | - <bpmndi:BPMNEdge bpmnElement="flow11" id="BPMNEdge_flow11"> | |
| 110 | - <omgdi:waypoint x="260.0" y="169.0"></omgdi:waypoint> | |
| 111 | - <omgdi:waypoint x="260.0" y="192.0"></omgdi:waypoint> | |
| 112 | - </bpmndi:BPMNEdge> | |
| 113 | - <bpmndi:BPMNEdge bpmnElement="flow12" id="BPMNEdge_flow12"> | |
| 114 | - <omgdi:waypoint x="280.0" y="212.0"></omgdi:waypoint> | |
| 115 | - <omgdi:waypoint x="615.0" y="212.0"></omgdi:waypoint> | |
| 116 | - <bpmndi:BPMNLabel> | |
| 117 | - <omgdc:Bounds height="11.0" width="44.0" x="429.0" y="219.0"></omgdc:Bounds> | |
| 118 | - </bpmndi:BPMNLabel> | |
| 119 | - </bpmndi:BPMNEdge> | |
| 120 | - <bpmndi:BPMNEdge bpmnElement="flow4"> | |
| 121 | - <omgdi:waypoint x="260.0" y="63.0"/> | |
| 122 | - <omgdi:waypoint x="632.5" y="212.5"/> | |
| 123 | - </bpmndi:BPMNEdge> | |
| 124 | - <bpmndi:BPMNEdge bpmnElement="flow9"> | |
| 125 | - <omgdi:waypoint x="505.0" y="63.0"/> | |
| 126 | - <omgdi:waypoint x="632.5" y="212.5"/> | |
| 127 | - </bpmndi:BPMNEdge> | |
| 128 | - </bpmndi:BPMNPlane> | |
| 129 | - </bpmndi:BPMNDiagram> | |
| 130 | -</definitions> | |
| 131 | 0 | \ No newline at end of file |
yudao-admin-ui/src/api/oa/flow.js
0 → 100644
yudao-admin-ui/src/api/oa/leave.js
| ... | ... | @@ -43,6 +43,14 @@ export function getLeavePage(query) { |
| 43 | 43 | }) |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | +export function createFormKeyLeave(data) { | |
| 47 | + return request({ | |
| 48 | + url: '/oa/leave/form-key/create', | |
| 49 | + method: 'post', | |
| 50 | + data: data | |
| 51 | + }) | |
| 52 | +} | |
| 53 | + | |
| 46 | 54 | // 导出请假申请 Excel |
| 47 | 55 | export function exportLeaveExcel(query) { |
| 48 | 56 | return request({ | ... | ... |
yudao-admin-ui/src/api/oa/todo.js
| ... | ... | @@ -67,6 +67,14 @@ export function taskSteps(data) { |
| 67 | 67 | }) |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | +export function getTaskFormKey(data) { | |
| 71 | + return request({ | |
| 72 | + url: '/workflow/task/formKey', | |
| 73 | + method: 'post', | |
| 74 | + data: data | |
| 75 | + }) | |
| 76 | +} | |
| 77 | + | |
| 70 | 78 | export function processHistorySteps(id) { |
| 71 | 79 | return request({ |
| 72 | 80 | url: '/workflow/task/process/history-steps?id='+id, | ... | ... |
yudao-admin-ui/src/router/index.js
| ... | ... | @@ -123,6 +123,76 @@ export const constantRoutes = [ |
| 123 | 123 | meta: { title: '修改生成配置' } |
| 124 | 124 | } |
| 125 | 125 | ] |
| 126 | + }, | |
| 127 | + { | |
| 128 | + path: '/flow', | |
| 129 | + component: Layout, | |
| 130 | + hidden: true, | |
| 131 | + redirect: 'noredirect', | |
| 132 | + children: [ | |
| 133 | + { | |
| 134 | + path: 'leave/apply', | |
| 135 | + component: (resolve) => require(['@/views/oa/leave/apply/index'], resolve), | |
| 136 | + name: '请假表单', | |
| 137 | + meta: { title: '请假表单', icon: 'form' } | |
| 138 | + } | |
| 139 | + ] | |
| 140 | + }, | |
| 141 | + { | |
| 142 | + path: '/flow', | |
| 143 | + component: Layout, | |
| 144 | + hidden: true, | |
| 145 | + redirect: 'noredirect', | |
| 146 | + children: [ | |
| 147 | + { | |
| 148 | + path: 'leave/approve-leader', | |
| 149 | + component: (resolve) => require(['@/views/oa/leave/approve-leader/index'], resolve), | |
| 150 | + name: '请假表单-部门领导审批', | |
| 151 | + meta: { title: '请假表单-部门领导审批', icon: 'form' } | |
| 152 | + } | |
| 153 | + ] | |
| 154 | + }, | |
| 155 | + { | |
| 156 | + path: '/flow', | |
| 157 | + component: Layout, | |
| 158 | + hidden: true, | |
| 159 | + redirect: 'noredirect', | |
| 160 | + children: [ | |
| 161 | + { | |
| 162 | + path: 'leave/approve-hr', | |
| 163 | + component: (resolve) => require(['@/views/oa/leave/approve-hr/index'], resolve), | |
| 164 | + name: '请假表单-人事审批', | |
| 165 | + meta: { title: '请假表单-人事审批', icon: 'form' } | |
| 166 | + } | |
| 167 | + ] | |
| 168 | + }, | |
| 169 | + { | |
| 170 | + path: '/flow', | |
| 171 | + component: Layout, | |
| 172 | + hidden: true, | |
| 173 | + redirect: 'noredirect', | |
| 174 | + children: [ | |
| 175 | + { | |
| 176 | + path: 'leave/confirm', | |
| 177 | + component: (resolve) => require(['@/views/oa/leave/confirm/index'], resolve), | |
| 178 | + name: '请假表单-确认', | |
| 179 | + meta: { title: '请假表单-确认', icon: 'form' } | |
| 180 | + } | |
| 181 | + ] | |
| 182 | + }, | |
| 183 | + { | |
| 184 | + path: '/flow', | |
| 185 | + component: Layout, | |
| 186 | + hidden: true, | |
| 187 | + redirect: 'noredirect', | |
| 188 | + children: [ | |
| 189 | + { | |
| 190 | + path: 'leave/modify', | |
| 191 | + component: (resolve) => require(['@/views/oa/leave/modify/index'], resolve), | |
| 192 | + name: '请假表单-修改', | |
| 193 | + meta: { title: '请假表单-修改', icon: 'form' } | |
| 194 | + } | |
| 195 | + ] | |
| 126 | 196 | } |
| 127 | 197 | ] |
| 128 | 198 | ... | ... |
yudao-admin-ui/src/views/oa/flow/index.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <div class="app-container"> | |
| 3 | + <el-row> | |
| 4 | + <el-button type="primary" v-on:click="leave">请假申请</el-button> | |
| 5 | + </el-row> | |
| 6 | + </div> | |
| 7 | +</template> | |
| 8 | + | |
| 9 | +<script> | |
| 10 | +import { getStartForm } from "@/api/oa/flow"; | |
| 11 | +export default { | |
| 12 | + name: "Flow", | |
| 13 | + components: { | |
| 14 | + }, | |
| 15 | + data() { | |
| 16 | + return { | |
| 17 | + // 表单参数 | |
| 18 | + form: {}, | |
| 19 | + | |
| 20 | + rules: { | |
| 21 | + } | |
| 22 | + }; | |
| 23 | + }, | |
| 24 | + created() { | |
| 25 | + | |
| 26 | + }, | |
| 27 | + methods: { | |
| 28 | + leave() { | |
| 29 | + getStartForm('leave-formkey').then(response => { | |
| 30 | + const route = response.data; | |
| 31 | + this.$router.replace(route); | |
| 32 | + }); | |
| 33 | + } | |
| 34 | + } | |
| 35 | +}; | |
| 36 | +</script> | ... | ... |
yudao-admin-ui/src/views/oa/leave/apply/index.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <div class="app-container"> | |
| 3 | + <!-- 对话框(添加 / 修改) --> | |
| 4 | + <el-form ref="form" :model="form" :rules="rules" label-width="80px"> | |
| 5 | + <el-form-item label="开始时间" prop="startTime"> | |
| 6 | + <el-date-picker clearable size="small" v-model="form.startTime" type="date" value-format="timestamp" placeholder="选择开始时间" /> | |
| 7 | + </el-form-item> | |
| 8 | + <el-form-item label="结束时间" prop="endTime"> | |
| 9 | + <el-date-picker clearable size="small" v-model="form.endTime" type="date" value-format="timestamp" placeholder="选择结束时间" /> | |
| 10 | + </el-form-item> | |
| 11 | + <el-form-item label="请假类型" prop="leaveType"> | |
| 12 | + <el-select v-model="form.leaveType" placeholder="请选择"> | |
| 13 | + <el-option | |
| 14 | + v-for="dict in leaveTypeDictData" | |
| 15 | + :key="parseInt(dict.value)" | |
| 16 | + :label="dict.label" | |
| 17 | + :value="parseInt(dict.value)" | |
| 18 | + /> | |
| 19 | + </el-select> | |
| 20 | + </el-form-item> | |
| 21 | + <el-form-item label="原因" prop="reason"> | |
| 22 | + <el-col :span="10"> | |
| 23 | + <el-input | |
| 24 | + type="textarea" | |
| 25 | + :rows="3" | |
| 26 | + v-model="form.reason" | |
| 27 | + placeholder="请输入原因" /> | |
| 28 | + </el-col> | |
| 29 | + </el-form-item> | |
| 30 | + <el-form-item label="申请时间" prop="applyTime"> | |
| 31 | + <el-date-picker clearable size="small" v-model="form.applyTime" type="date" value-format="timestamp" placeholder="选择申请时间" /> | |
| 32 | + </el-form-item> | |
| 33 | + <el-form-item> | |
| 34 | + <el-button type="primary" @click="submitForm">确 定</el-button> | |
| 35 | + </el-form-item> | |
| 36 | + </el-form> | |
| 37 | + </div> | |
| 38 | +</template> | |
| 39 | + | |
| 40 | +<script> | |
| 41 | +import { createFormKeyLeave } from "@/api/oa/leave" | |
| 42 | +import { getDictDataLabel, getDictDatas, DICT_TYPE } from '@/utils/dict' | |
| 43 | +export default { | |
| 44 | + name: "ApplyLeave", | |
| 45 | + components: { | |
| 46 | + }, | |
| 47 | + data() { | |
| 48 | + return { | |
| 49 | + // 表单参数 | |
| 50 | + form: {}, | |
| 51 | + // 表单校验 | |
| 52 | + rules: { | |
| 53 | + startTime: [{ required: true, message: "开始时间不能为空", trigger: "blur" }], | |
| 54 | + endTime: [{ required: true, message: "结束时间不能为空", trigger: "blur" }], | |
| 55 | + applyTime: [{ required: true, message: "申请时间不能为空", trigger: "blur" }], | |
| 56 | + }, | |
| 57 | + statusFormat(row, column) { | |
| 58 | + return getDictDataLabel(DICT_TYPE.OA_LEAVE_STATUS, row.status) | |
| 59 | + }, | |
| 60 | + leaveTypeDictData: getDictDatas(DICT_TYPE.OA_LEAVE_TYPE), | |
| 61 | + leaveStatusData: getDictDatas(DICT_TYPE.OA_LEAVE_STATUS) | |
| 62 | + }; | |
| 63 | + }, | |
| 64 | + created() { | |
| 65 | + }, | |
| 66 | + methods: { | |
| 67 | + /** 提交按钮 */ | |
| 68 | + submitForm() { | |
| 69 | + this.$refs["form"].validate(valid => { | |
| 70 | + if (!valid) { | |
| 71 | + return; | |
| 72 | + } | |
| 73 | + // 修改的提交 | |
| 74 | + // if (this.form.id != null) { | |
| 75 | + // updateLeave(this.form).then(response => { | |
| 76 | + // this.msgSuccess("修改成功"); | |
| 77 | + // }); | |
| 78 | + // return; | |
| 79 | + // } | |
| 80 | + // 添加的提交 | |
| 81 | + createFormKeyLeave(this.form).then(response => { | |
| 82 | + this.msgSuccess("新增成功"); | |
| 83 | + this.$store.dispatch('tagsView/delView', this.$route).then(({ visitedViews }) => { | |
| 84 | + //if (this.isActive(this.$route)) { | |
| 85 | + this.$router.push({path: '/oa/todo'}) | |
| 86 | + //} | |
| 87 | + }) | |
| 88 | + }); | |
| 89 | + }); | |
| 90 | + } | |
| 91 | + } | |
| 92 | +}; | |
| 93 | +</script> | ... | ... |
yudao-admin-ui/src/views/oa/leave/approve-hr/index.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <div class="app-container"> | |
| 3 | + <el-tabs type="border-card"> | |
| 4 | + <el-tab-pane label="任务处理"> | |
| 5 | + <el-form ref="form" :model="form" label-width="80px"> | |
| 6 | + <el-row :gutter="20"> | |
| 7 | + <el-col :span="6"><el-form-item label="申请人" >{{form.userId}}</el-form-item></el-col> | |
| 8 | + <el-col :span="6"> | |
| 9 | + <el-form-item label="请假类型" prop="leaveType"> | |
| 10 | + {{ getDictDataLabel(DICT_TYPE.OA_LEAVE_TYPE, form.leaveType) }} | |
| 11 | + </el-form-item> | |
| 12 | + </el-col> | |
| 13 | + <el-col :span="6"><el-form-item label="原因" prop="reason">{{form.reason}}</el-form-item></el-col> | |
| 14 | + </el-row> | |
| 15 | + <el-row :gutter="20"> | |
| 16 | + <el-col :span="6"><el-form-item label="开始时间" >{{ parseTime(form.startTime) }}</el-form-item></el-col> | |
| 17 | + <el-col :span="6"><el-form-item label="结束时间" prop="endTime">{{ parseTime(form.endTime) }}</el-form-item></el-col> | |
| 18 | + <el-form-item label="申请时间" prop="applyTime">{{ parseTime(form.applyTime) }}</el-form-item> | |
| 19 | + </el-row> | |
| 20 | + </el-form> | |
| 21 | + <el-divider></el-divider> | |
| 22 | + <el-form ref="taskForm" :model="leaveApprove" :rules="rules" label-width="80px"> | |
| 23 | + <el-form-item label="是否同意" prop="approved"> | |
| 24 | + <el-select v-model="leaveApprove.approved" placeholder="是否同意" v-on:change="approveChange"> | |
| 25 | + <el-option | |
| 26 | + v-for="dict in approvedData" | |
| 27 | + :key="parseInt(dict.value)" | |
| 28 | + :label="dict.label" | |
| 29 | + :value="parseInt(dict.value)" | |
| 30 | + /> | |
| 31 | + </el-select> | |
| 32 | + </el-form-item> | |
| 33 | + <el-form-item label="处理意见" prop="comment"> | |
| 34 | + <el-col :span="11"> | |
| 35 | + <el-input | |
| 36 | + type="textarea" | |
| 37 | + :rows="3" | |
| 38 | + v-model="leaveApprove.comment"> | |
| 39 | + </el-input> | |
| 40 | + </el-col> | |
| 41 | + </el-form-item> | |
| 42 | + <el-form-item> | |
| 43 | + <el-button type="primary" @click="submitForm">确 定</el-button> | |
| 44 | + </el-form-item> | |
| 45 | + </el-form> | |
| 46 | + </el-tab-pane> | |
| 47 | + <el-tab-pane label="历史跟踪"> | |
| 48 | + <el-steps :active="stepActive" simple finish-status="success"> | |
| 49 | + <el-step :title="stepTitle(item)" icon="el-icon-edit" v-for="(item) in handleTask.historyTask" ></el-step> | |
| 50 | + </el-steps> | |
| 51 | + <br/> | |
| 52 | + <el-steps direction="vertical" :active="stepActive" space="65px"> | |
| 53 | + <el-step :title="stepTitle(item)" :description="stepDes(item)" v-for="(item) in handleTask.historyTask" ></el-step> | |
| 54 | + </el-steps> | |
| 55 | + </el-tab-pane> | |
| 56 | + <el-tab-pane label="流程图">流程图-TODO</el-tab-pane> | |
| 57 | + </el-tabs> | |
| 58 | + | |
| 59 | + </div> | |
| 60 | +</template> | |
| 61 | + | |
| 62 | +<script> | |
| 63 | +import { getLeave } from "@/api/oa/leave" | |
| 64 | +import { completeTask,taskSteps } from "@/api/oa/todo"; | |
| 65 | +import { getDictDataLabel, getDictDatas, DICT_TYPE } from '@/utils/dict' | |
| 66 | +export default { | |
| 67 | + name: "HrApproveLeave", | |
| 68 | + components: { | |
| 69 | + }, | |
| 70 | + data() { | |
| 71 | + return { | |
| 72 | + // 表单参数 | |
| 73 | + form: {}, | |
| 74 | + // 表单校验 | |
| 75 | + rules: { | |
| 76 | + comment: [{ required: true, message: "意见不能为空", trigger: "blur" }] | |
| 77 | + }, | |
| 78 | + handleTask: { | |
| 79 | + historyTask:[] | |
| 80 | + }, | |
| 81 | + leaveApprove: { | |
| 82 | + approved : 1, | |
| 83 | + variables: {}, | |
| 84 | + taskId: "", | |
| 85 | + comment: "同意" | |
| 86 | + }, | |
| 87 | + approvedData: [ | |
| 88 | + { | |
| 89 | + value: 1, | |
| 90 | + label: '同意' | |
| 91 | + }, | |
| 92 | + { | |
| 93 | + value: 0, | |
| 94 | + label: '不同意' | |
| 95 | + } | |
| 96 | + ], | |
| 97 | + statusFormat(row, column) { | |
| 98 | + return getDictDataLabel(DICT_TYPE.OA_LEAVE_STATUS, row.status) | |
| 99 | + }, | |
| 100 | + leaveTypeDictData: getDictDatas(DICT_TYPE.OA_LEAVE_TYPE), | |
| 101 | + leaveStatusData: getDictDatas(DICT_TYPE.OA_LEAVE_STATUS) | |
| 102 | + }; | |
| 103 | + }, | |
| 104 | + computed:{ | |
| 105 | + stepActive: function () { | |
| 106 | + let idx = 0; | |
| 107 | + for(let i=0; i<this.handleTask.historyTask.length; i++){ | |
| 108 | + if(this.handleTask.historyTask[i].status === 1){ | |
| 109 | + idx= idx+1; | |
| 110 | + }else{ | |
| 111 | + break; | |
| 112 | + } | |
| 113 | + } | |
| 114 | + return idx; | |
| 115 | + }, | |
| 116 | + stepTitle() { | |
| 117 | + return function (item) { | |
| 118 | + let name = item.stepName; | |
| 119 | + if (item.status === 1) { | |
| 120 | + name += '(已完成)' | |
| 121 | + } | |
| 122 | + if (item.status === 0) { | |
| 123 | + name += '(进行中)' | |
| 124 | + } | |
| 125 | + return name; | |
| 126 | + } | |
| 127 | + }, | |
| 128 | + stepDes(){ | |
| 129 | + return function (item) { | |
| 130 | + let desc = ""; | |
| 131 | + if (item.status === 1) { | |
| 132 | + desc+="审批人:["+ item.assignee +"] 审批意见: [" + item.comment + "] 审批时间: " + this.parseTime(item.endTime); | |
| 133 | + } | |
| 134 | + return desc; | |
| 135 | + } | |
| 136 | + } | |
| 137 | + }, | |
| 138 | + created() { | |
| 139 | + const businessKey = this.$route.query.businessKey; | |
| 140 | + const taskId = this.$route.query.taskId; | |
| 141 | + this.leaveApprove.taskId = taskId; | |
| 142 | + this.getForm(businessKey); | |
| 143 | + }, | |
| 144 | + methods: { | |
| 145 | + /** 提交按钮 */ | |
| 146 | + submitForm() { | |
| 147 | + this.$refs["taskForm"].validate(valid => { | |
| 148 | + if (!valid) { | |
| 149 | + return; | |
| 150 | + } | |
| 151 | + if (this.leaveApprove.approved == 1) { | |
| 152 | + this.leaveApprove.variables["hrApproved"] = true; | |
| 153 | + } | |
| 154 | + if (this.leaveApprove.approved == 0) { | |
| 155 | + this.leaveApprove.variables["hrApproved"] = false; | |
| 156 | + } | |
| 157 | + completeTask(this.leaveApprove).then(response => { | |
| 158 | + this.msgSuccess("执行任务成功"); | |
| 159 | + this.$store.dispatch('tagsView/delView', this.$route).then(({ visitedViews }) => { | |
| 160 | + //if (this.isActive(this.$route)) { | |
| 161 | + this.$router.push({path: '/oa/todo'}) | |
| 162 | + //} | |
| 163 | + }) | |
| 164 | + }) | |
| 165 | + }); | |
| 166 | + }, | |
| 167 | + getForm(id){ | |
| 168 | + getLeave(id).then(response => { | |
| 169 | + this.form = response.data; | |
| 170 | + }); | |
| 171 | + const data = { | |
| 172 | + taskId : this.leaveApprove.taskId, | |
| 173 | + businessKey: id, | |
| 174 | + } | |
| 175 | + taskSteps(data).then(response => { | |
| 176 | + this.handleTask = response.data; | |
| 177 | + | |
| 178 | + }); | |
| 179 | + }, | |
| 180 | + approveChange(){ | |
| 181 | + if (this.leaveApprove.approved === 1) { | |
| 182 | + this.leaveApprove.comment = "同意" | |
| 183 | + } | |
| 184 | + if(this.leaveApprove.approved === 0){ | |
| 185 | + this.leaveApprove.comment = "不同意" | |
| 186 | + } | |
| 187 | + } | |
| 188 | + } | |
| 189 | +}; | |
| 190 | +</script> | ... | ... |
yudao-admin-ui/src/views/oa/leave/approve-leader/index.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <div class="app-container"> | |
| 3 | + <el-tabs type="border-card"> | |
| 4 | + <el-tab-pane label="任务处理"> | |
| 5 | + <el-form ref="form" :model="form" label-width="80px"> | |
| 6 | + <el-row :gutter="20"> | |
| 7 | + <el-col :span="6"><el-form-item label="申请人" >{{form.userId}}</el-form-item></el-col> | |
| 8 | + <el-col :span="6"> | |
| 9 | + <el-form-item label="请假类型" prop="leaveType"> | |
| 10 | + {{ getDictDataLabel(DICT_TYPE.OA_LEAVE_TYPE, form.leaveType) }} | |
| 11 | + </el-form-item> | |
| 12 | + </el-col> | |
| 13 | + <el-col :span="6"><el-form-item label="原因" prop="reason">{{form.reason}}</el-form-item></el-col> | |
| 14 | + </el-row> | |
| 15 | + <el-row :gutter="20"> | |
| 16 | + <el-col :span="6"><el-form-item label="开始时间" >{{ parseTime(form.startTime) }}</el-form-item></el-col> | |
| 17 | + <el-col :span="6"><el-form-item label="结束时间" prop="endTime">{{ parseTime(form.endTime) }}</el-form-item></el-col> | |
| 18 | + <el-form-item label="申请时间" prop="applyTime">{{ parseTime(form.applyTime) }}</el-form-item> | |
| 19 | + </el-row> | |
| 20 | + </el-form> | |
| 21 | + <el-divider></el-divider> | |
| 22 | + <el-form ref="taskForm" :model="leaveApprove" :rules="rules" label-width="80px"> | |
| 23 | + <el-form-item label="是否同意" prop="approved"> | |
| 24 | + <el-select v-model="leaveApprove.approved" placeholder="是否同意" v-on:change="approveChange"> | |
| 25 | + <el-option | |
| 26 | + v-for="dict in approvedData" | |
| 27 | + :key="parseInt(dict.value)" | |
| 28 | + :label="dict.label" | |
| 29 | + :value="parseInt(dict.value)" | |
| 30 | + /> | |
| 31 | + </el-select> | |
| 32 | + </el-form-item> | |
| 33 | + <el-form-item label="处理意见" prop="comment"> | |
| 34 | + <el-col :span="11"> | |
| 35 | + <el-input | |
| 36 | + type="textarea" | |
| 37 | + :rows="3" | |
| 38 | + v-model="leaveApprove.comment"> | |
| 39 | + </el-input> | |
| 40 | + </el-col> | |
| 41 | + </el-form-item> | |
| 42 | + <el-form-item> | |
| 43 | + <el-button type="primary" @click="submitForm">确 定</el-button> | |
| 44 | + </el-form-item> | |
| 45 | + </el-form> | |
| 46 | + </el-tab-pane> | |
| 47 | + <el-tab-pane label="历史跟踪"> | |
| 48 | + <el-steps :active="stepActive" simple finish-status="success"> | |
| 49 | + <el-step :title="stepTitle(item)" icon="el-icon-edit" v-for="(item) in handleTask.historyTask" ></el-step> | |
| 50 | + </el-steps> | |
| 51 | + <br/> | |
| 52 | + <el-steps direction="vertical" :active="stepActive" space="65px"> | |
| 53 | + <el-step :title="stepTitle(item)" :description="stepDes(item)" v-for="(item) in handleTask.historyTask" ></el-step> | |
| 54 | + </el-steps> | |
| 55 | + </el-tab-pane> | |
| 56 | + <el-tab-pane label="流程图">流程图-TODO</el-tab-pane> | |
| 57 | + </el-tabs> | |
| 58 | + </div> | |
| 59 | +</template> | |
| 60 | + | |
| 61 | +<script> | |
| 62 | +import { getLeave } from "@/api/oa/leave" | |
| 63 | +import { completeTask,taskSteps } from "@/api/oa/todo"; | |
| 64 | +import { getDictDataLabel, getDictDatas, DICT_TYPE } from '@/utils/dict' | |
| 65 | +export default { | |
| 66 | + name: "ApproveLeaderLeave", | |
| 67 | + components: { | |
| 68 | + }, | |
| 69 | + data() { | |
| 70 | + return { | |
| 71 | + // 表单参数 | |
| 72 | + form: {}, | |
| 73 | + // 表单校验 | |
| 74 | + rules: { | |
| 75 | + comment: [{ required: true, message: "意见不能为空", trigger: "blur" }] | |
| 76 | + }, | |
| 77 | + handleTask: { | |
| 78 | + historyTask:[] | |
| 79 | + }, | |
| 80 | + leaveApprove: { | |
| 81 | + approved : 1, | |
| 82 | + variables: {}, | |
| 83 | + taskId: "", | |
| 84 | + comment: "同意" | |
| 85 | + }, | |
| 86 | + approvedData: [ | |
| 87 | + { | |
| 88 | + value: 1, | |
| 89 | + label: '同意' | |
| 90 | + }, | |
| 91 | + { | |
| 92 | + value: 0, | |
| 93 | + label: '不同意' | |
| 94 | + } | |
| 95 | + ], | |
| 96 | + statusFormat(row, column) { | |
| 97 | + return getDictDataLabel(DICT_TYPE.OA_LEAVE_STATUS, row.status) | |
| 98 | + }, | |
| 99 | + leaveTypeDictData: getDictDatas(DICT_TYPE.OA_LEAVE_TYPE), | |
| 100 | + leaveStatusData: getDictDatas(DICT_TYPE.OA_LEAVE_STATUS) | |
| 101 | + }; | |
| 102 | + }, | |
| 103 | + created() { | |
| 104 | + const businessKey = this.$route.query.businessKey; | |
| 105 | + const taskId = this.$route.query.taskId; | |
| 106 | + this.leaveApprove.taskId = taskId; | |
| 107 | + this.getForm(businessKey); | |
| 108 | + }, | |
| 109 | + computed:{ | |
| 110 | + stepActive: function () { | |
| 111 | + let idx = 0; | |
| 112 | + for(let i=0; i<this.handleTask.historyTask.length; i++){ | |
| 113 | + if(this.handleTask.historyTask[i].status === 1){ | |
| 114 | + idx= idx+1; | |
| 115 | + }else{ | |
| 116 | + break; | |
| 117 | + } | |
| 118 | + } | |
| 119 | + return idx; | |
| 120 | + }, | |
| 121 | + stepTitle() { | |
| 122 | + return function (item) { | |
| 123 | + let name = item.stepName; | |
| 124 | + if (item.status === 1) { | |
| 125 | + name += '(已完成)' | |
| 126 | + } | |
| 127 | + if (item.status === 0) { | |
| 128 | + name += '(进行中)' | |
| 129 | + } | |
| 130 | + return name; | |
| 131 | + } | |
| 132 | + }, | |
| 133 | + stepDes(){ | |
| 134 | + return function (item) { | |
| 135 | + let desc = ""; | |
| 136 | + if (item.status === 1) { | |
| 137 | + desc+="审批人:["+ item.assignee +"] 审批意见: [" + item.comment + "] 审批时间: " + this.parseTime(item.endTime); | |
| 138 | + } | |
| 139 | + return desc; | |
| 140 | + } | |
| 141 | + } | |
| 142 | + }, | |
| 143 | + methods: { | |
| 144 | + /** 提交按钮 */ | |
| 145 | + submitForm() { | |
| 146 | + this.$refs["taskForm"].validate(valid => { | |
| 147 | + if (!valid) { | |
| 148 | + return; | |
| 149 | + } | |
| 150 | + if (this.leaveApprove.approved == 1) { | |
| 151 | + this.leaveApprove.variables["deptLeaderApproved"] = true; | |
| 152 | + } | |
| 153 | + if (this.leaveApprove.approved == 0) { | |
| 154 | + this.leaveApprove.variables["deptLeaderApproved"] = false; | |
| 155 | + } | |
| 156 | + completeTask(this.leaveApprove).then(response => { | |
| 157 | + this.msgSuccess("执行任务成功"); | |
| 158 | + this.$store.dispatch('tagsView/delView', this.$route).then(({ visitedViews }) => { | |
| 159 | + //if (this.isActive(this.$route)) { | |
| 160 | + this.$router.push({path: '/oa/todo'}) | |
| 161 | + //} | |
| 162 | + }) | |
| 163 | + }); | |
| 164 | + }); | |
| 165 | + | |
| 166 | + }, | |
| 167 | + getForm(id){ | |
| 168 | + getLeave(id).then(response => { | |
| 169 | + this.form = response.data; | |
| 170 | + }); | |
| 171 | + const data = { | |
| 172 | + taskId : this.leaveApprove.taskId, | |
| 173 | + businessKey: id, | |
| 174 | + } | |
| 175 | + taskSteps(data).then(response => { | |
| 176 | + this.handleTask = response.data; | |
| 177 | + | |
| 178 | + }); | |
| 179 | + }, | |
| 180 | + approveChange(){ | |
| 181 | + if (this.leaveApprove.approved === 1) { | |
| 182 | + this.leaveApprove.comment = "同意" | |
| 183 | + } | |
| 184 | + if(this.leaveApprove.approved === 0){ | |
| 185 | + this.leaveApprove.comment = "不同意" | |
| 186 | + } | |
| 187 | + } | |
| 188 | + } | |
| 189 | +}; | |
| 190 | +</script> | ... | ... |
yudao-admin-ui/src/views/oa/leave/confirm/index.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <div class="app-container"> | |
| 3 | + <el-tabs type="border-card"> | |
| 4 | + <el-tab-pane label="任务处理"> | |
| 5 | + <el-form ref="form" :model="form" label-width="80px"> | |
| 6 | + <el-row :gutter="20"> | |
| 7 | + <el-col :span="6"><el-form-item label="申请人" >{{form.userId}}</el-form-item></el-col> | |
| 8 | + <el-col :span="6"> | |
| 9 | + <el-form-item label="请假类型" prop="leaveType"> | |
| 10 | + {{ getDictDataLabel(DICT_TYPE.OA_LEAVE_TYPE, form.leaveType) }} | |
| 11 | + </el-form-item> | |
| 12 | + </el-col> | |
| 13 | + <el-col :span="6"><el-form-item label="原因" prop="reason">{{form.reason}}</el-form-item></el-col> | |
| 14 | + </el-row> | |
| 15 | + <el-row :gutter="20"> | |
| 16 | + <el-col :span="6"><el-form-item label="开始时间" >{{ parseTime(form.startTime) }}</el-form-item></el-col> | |
| 17 | + <el-col :span="6"><el-form-item label="结束时间" prop="endTime">{{ parseTime(form.endTime) }}</el-form-item></el-col> | |
| 18 | + <el-form-item label="申请时间" prop="applyTime">{{ parseTime(form.applyTime) }}</el-form-item> | |
| 19 | + </el-row> | |
| 20 | + <el-row :gutter="20"> | |
| 21 | + <el-col :span="6"><el-button type="primary" @click="submitForm">确 定</el-button></el-col> | |
| 22 | + </el-row> | |
| 23 | + </el-form> | |
| 24 | + </el-tab-pane> | |
| 25 | + <el-tab-pane label="历史跟踪"> | |
| 26 | + <el-steps :active="stepActive" simple finish-status="success"> | |
| 27 | + <el-step :title="stepTitle(item)" icon="el-icon-edit" v-for="(item) in handleTask.historyTask" ></el-step> | |
| 28 | + </el-steps> | |
| 29 | + <br/> | |
| 30 | + <el-steps direction="vertical" :active="stepActive" space="65px"> | |
| 31 | + <el-step :title="stepTitle(item)" :description="stepDes(item)" v-for="(item) in handleTask.historyTask" ></el-step> | |
| 32 | + </el-steps> | |
| 33 | + </el-tab-pane> | |
| 34 | + <el-tab-pane label="流程图">流程图-TODO</el-tab-pane> | |
| 35 | + </el-tabs> | |
| 36 | + </div> | |
| 37 | +</template> | |
| 38 | + | |
| 39 | +<script> | |
| 40 | +import { getLeave } from "@/api/oa/leave" | |
| 41 | +import { completeTask,taskSteps } from "@/api/oa/todo"; | |
| 42 | +import { getDictDataLabel, getDictDatas, DICT_TYPE } from '@/utils/dict' | |
| 43 | +export default { | |
| 44 | + name: "ConfirmLeave", | |
| 45 | + components: { | |
| 46 | + }, | |
| 47 | + data() { | |
| 48 | + return { | |
| 49 | + // 表单参数 | |
| 50 | + form: {}, | |
| 51 | + // 表单校验 | |
| 52 | + rules: { | |
| 53 | + }, | |
| 54 | + handleTask: { | |
| 55 | + historyTask:[] | |
| 56 | + }, | |
| 57 | + leaveApprove: { | |
| 58 | + variables: {}, | |
| 59 | + taskId: "", | |
| 60 | + comment: "" | |
| 61 | + }, | |
| 62 | + statusFormat(row, column) { | |
| 63 | + return getDictDataLabel(DICT_TYPE.OA_LEAVE_STATUS, row.status) | |
| 64 | + }, | |
| 65 | + leaveTypeDictData: getDictDatas(DICT_TYPE.OA_LEAVE_TYPE), | |
| 66 | + leaveStatusData: getDictDatas(DICT_TYPE.OA_LEAVE_STATUS) | |
| 67 | + }; | |
| 68 | + }, | |
| 69 | + created() { | |
| 70 | + const businessKey = this.$route.query.businessKey; | |
| 71 | + const taskId = this.$route.query.taskId; | |
| 72 | + this.leaveApprove.taskId = taskId; | |
| 73 | + this.getForm(businessKey); | |
| 74 | + }, | |
| 75 | + computed:{ | |
| 76 | + stepActive: function () { | |
| 77 | + let idx = 0; | |
| 78 | + for(let i=0; i<this.handleTask.historyTask.length; i++){ | |
| 79 | + if(this.handleTask.historyTask[i].status === 1){ | |
| 80 | + idx= idx+1; | |
| 81 | + }else{ | |
| 82 | + break; | |
| 83 | + } | |
| 84 | + } | |
| 85 | + return idx; | |
| 86 | + }, | |
| 87 | + stepTitle() { | |
| 88 | + return function (item) { | |
| 89 | + let name = item.stepName; | |
| 90 | + if (item.status === 1) { | |
| 91 | + name += '(已完成)' | |
| 92 | + } | |
| 93 | + if (item.status === 0) { | |
| 94 | + name += '(进行中)' | |
| 95 | + } | |
| 96 | + return name; | |
| 97 | + } | |
| 98 | + }, | |
| 99 | + stepDes(){ | |
| 100 | + return function (item) { | |
| 101 | + let desc = ""; | |
| 102 | + if (item.status === 1) { | |
| 103 | + desc+="审批人:["+ item.assignee +"] 审批意见: [" + item.comment + "] 审批时间: " + this.parseTime(item.endTime); | |
| 104 | + } | |
| 105 | + return desc; | |
| 106 | + } | |
| 107 | + } | |
| 108 | + }, | |
| 109 | + methods: { | |
| 110 | + /** 提交按钮 */ | |
| 111 | + submitForm() { | |
| 112 | + completeTask(this.leaveApprove).then(response => { | |
| 113 | + this.msgSuccess("执行任务成功"); | |
| 114 | + this.$store.dispatch('tagsView/delView', this.$route).then(({ visitedViews }) => { | |
| 115 | + //if (this.isActive(this.$route)) { | |
| 116 | + this.$router.push({path: '/oa/todo'}) | |
| 117 | + //} | |
| 118 | + }) | |
| 119 | + }) | |
| 120 | + }, | |
| 121 | + getForm(id){ | |
| 122 | + getLeave(id).then(response => { | |
| 123 | + this.form = response.data; | |
| 124 | + }); | |
| 125 | + const data = { | |
| 126 | + taskId : this.leaveApprove.taskId, | |
| 127 | + businessKey: id, | |
| 128 | + } | |
| 129 | + taskSteps(data).then(response => { | |
| 130 | + this.handleTask = response.data; | |
| 131 | + | |
| 132 | + }); | |
| 133 | + | |
| 134 | + } | |
| 135 | + } | |
| 136 | +}; | |
| 137 | +</script> | ... | ... |
yudao-admin-ui/src/views/oa/leave/index.vue
| ... | ... | @@ -28,9 +28,9 @@ |
| 28 | 28 | <el-select v-model="queryParams.leaveType" placeholder="请选择请假类型"> |
| 29 | 29 | <el-option |
| 30 | 30 | v-for="dict in leaveTypeDictData" |
| 31 | - :key="parseInt(dict.value)" | |
| 31 | + :key="dict.value" | |
| 32 | 32 | :label="dict.label" |
| 33 | - :value="parseInt(dict.value)" | |
| 33 | + :value="dict.value" | |
| 34 | 34 | /> |
| 35 | 35 | </el-select> |
| 36 | 36 | </el-form-item> |
| ... | ... | @@ -49,10 +49,6 @@ |
| 49 | 49 | |
| 50 | 50 | <!-- 操作工具栏 --> |
| 51 | 51 | <el-row :gutter="10" class="mb8"> |
| 52 | - <el-col :span="1.5"> | |
| 53 | - <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" | |
| 54 | - v-hasPermi="['oa:leave:create']">新增</el-button> | |
| 55 | - </el-col> | |
| 56 | 52 | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
| 57 | 53 | </el-row> |
| 58 | 54 | |
| ... | ... | @@ -71,7 +67,7 @@ |
| 71 | 67 | <span>{{ parseTime(scope.row.endTime) }}</span> |
| 72 | 68 | </template> |
| 73 | 69 | </el-table-column> |
| 74 | - <el-table-column label="请假类型" align="center" prop="leaveType" /> | |
| 70 | + <el-table-column label="请假类型" align="center" prop="leaveType" :formatter="leaveTypeFormat" /> | |
| 75 | 71 | <el-table-column label="原因" align="center" prop="reason" /> |
| 76 | 72 | <el-table-column label="申请时间" align="center" prop="applyTime" width="180"> |
| 77 | 73 | <template slot-scope="scope"> |
| ... | ... | @@ -102,9 +98,9 @@ |
| 102 | 98 | <el-select v-model="form.leaveType" placeholder="请选择"> |
| 103 | 99 | <el-option |
| 104 | 100 | v-for="dict in leaveTypeDictData" |
| 105 | - :key="parseInt(dict.value)" | |
| 101 | + :key="dict.value" | |
| 106 | 102 | :label="dict.label" |
| 107 | - :value="parseInt(dict.value)" | |
| 103 | + :value="dict.value" | |
| 108 | 104 | /> |
| 109 | 105 | </el-select> |
| 110 | 106 | </el-form-item> |
| ... | ... | @@ -142,12 +138,12 @@ |
| 142 | 138 | </el-dialog> |
| 143 | 139 | |
| 144 | 140 | <el-dialog :title="title" :visible.sync="dialogStepsVisible" width="600px" append-to-body> |
| 145 | - <el-steps :active="handleTask.historyTask.length-1" finish-status="success" > | |
| 146 | - <el-step :title="item.stepName " :description="' 办理人:' + item.assignee " icon="el-icon-edit" v-for="(item) in handleTask.historyTask"></el-step> | |
| 141 | + <el-steps :active="stepActive" finish-status="success" > | |
| 142 | + <el-step :title="stepTitle(item)" :description="' 办理人:' + item.assignee " icon="el-icon-edit" v-for="(item) in handleTask.historyTask"></el-step> | |
| 147 | 143 | </el-steps> |
| 148 | 144 | <br/> |
| 149 | - <el-steps direction="vertical" :active="handleTask.historyTask.length-1"> | |
| 150 | - <el-step :title="item.stepName" :description=" ' 意见:'+ item.comment" v-for="(item) in handleTask.historyTask"></el-step> | |
| 145 | + <el-steps direction="vertical" :active="stepActive"> | |
| 146 | + <el-step :title="stepTitle(item)" :description="stepDes(item)" v-for="(item) in handleTask.historyTask"></el-step> | |
| 151 | 147 | </el-steps> |
| 152 | 148 | <div slot="footer" class="dialog-footer"> |
| 153 | 149 | <el-button type="primary" @click="dialogStepsVisible = false">确 定</el-button> |
| ... | ... | @@ -199,10 +195,7 @@ export default { |
| 199 | 195 | // 表单参数 |
| 200 | 196 | form: {}, |
| 201 | 197 | handleTask: { |
| 202 | - historyTask:[{ | |
| 203 | - stepName:"步骤一" | |
| 204 | - } | |
| 205 | - ], | |
| 198 | + historyTask:[], | |
| 206 | 199 | taskVariable: "", |
| 207 | 200 | formObject: {} |
| 208 | 201 | }, |
| ... | ... | @@ -218,6 +211,9 @@ export default { |
| 218 | 211 | statusFormat(row, column) { |
| 219 | 212 | return getDictDataLabel(DICT_TYPE.OA_LEAVE_STATUS, row.status) |
| 220 | 213 | }, |
| 214 | + leaveTypeFormat(row, column) { | |
| 215 | + return getDictDataLabel(DICT_TYPE.OA_LEAVE_TYPE, row.leaveType) | |
| 216 | + }, | |
| 221 | 217 | leaveTypeDictData: getDictDatas(DICT_TYPE.OA_LEAVE_TYPE), |
| 222 | 218 | leaveStatusData: getDictDatas(DICT_TYPE.OA_LEAVE_STATUS) |
| 223 | 219 | }; |
| ... | ... | @@ -225,6 +221,40 @@ export default { |
| 225 | 221 | created() { |
| 226 | 222 | this.getList(); |
| 227 | 223 | }, |
| 224 | + computed: { | |
| 225 | + stepActive: function () { | |
| 226 | + let idx = 0; | |
| 227 | + for (let i = 0; i < this.handleTask.historyTask.length; i++) { | |
| 228 | + if (this.handleTask.historyTask[i].status === 1) { | |
| 229 | + idx = idx + 1; | |
| 230 | + } else { | |
| 231 | + break; | |
| 232 | + } | |
| 233 | + } | |
| 234 | + return idx; | |
| 235 | + }, | |
| 236 | + stepTitle() { | |
| 237 | + return function (item) { | |
| 238 | + let name = item.stepName; | |
| 239 | + if (item.status === 1) { | |
| 240 | + name += '(已完成)' | |
| 241 | + } | |
| 242 | + if (item.status === 0) { | |
| 243 | + name += '(进行中)' | |
| 244 | + } | |
| 245 | + return name; | |
| 246 | + } | |
| 247 | + }, | |
| 248 | + stepDes() { | |
| 249 | + return function (item) { | |
| 250 | + let desc = ""; | |
| 251 | + if (item.status === 1) { | |
| 252 | + desc += "审批人:[" + item.assignee + "] 审批意见: [" + item.comment + "] 审批时间: " + this.parseTime(item.endTime); | |
| 253 | + } | |
| 254 | + return desc; | |
| 255 | + } | |
| 256 | + } | |
| 257 | + }, | |
| 228 | 258 | methods: { |
| 229 | 259 | /** 查询列表 */ |
| 230 | 260 | getList() { | ... | ... |
yudao-admin-ui/src/views/oa/leave/modify/index.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <div class="app-container"> | |
| 3 | + <el-tabs type="border-card"> | |
| 4 | + <el-tab-pane label="任务处理"> | |
| 5 | + <el-form ref="form" :model="form" :rules="rules" label-width="100px"> | |
| 6 | + <el-row> | |
| 7 | + <el-col :span="15"> | |
| 8 | + <el-form-item label="是否调整申请" prop="reApply"> | |
| 9 | + <el-select v-model="reApplySelect" placeholder="是否调整申请" v-on:change="reApplyChange"> | |
| 10 | + <el-option | |
| 11 | + v-for="dict in reApplyData" | |
| 12 | + :key="parseInt(dict.value)" | |
| 13 | + :label="dict.label" | |
| 14 | + :value="parseInt(dict.value)" | |
| 15 | + /> | |
| 16 | + </el-select> | |
| 17 | + </el-form-item> | |
| 18 | + </el-col> | |
| 19 | + </el-row> | |
| 20 | + <el-row :gutter="20" v-show="modifyShow"> | |
| 21 | + <el-col :span="8"><el-form-item label="申请人" >{{form.userId}}</el-form-item></el-col> | |
| 22 | + <el-col :span="8"> | |
| 23 | + <el-form-item label="申请时间" prop="applyTime">{{ parseTime(form.applyTime) }}</el-form-item> | |
| 24 | + </el-col> | |
| 25 | + </el-row> | |
| 26 | + <el-row :gutter="20" v-show="modifyShow"> | |
| 27 | + <el-col :span="8"> | |
| 28 | + <el-form-item label="开始时间" prop="startTime"> | |
| 29 | + <el-date-picker clearable size="small" v-model="form.startTime" type="date" value-format="timestamp" placeholder="选择开始时间" /> | |
| 30 | + </el-form-item> | |
| 31 | + </el-col> | |
| 32 | + <el-col :span="8"> | |
| 33 | + <el-form-item label="结束时间" prop="endTime"> | |
| 34 | + <el-date-picker clearable size="small" v-model="form.endTime" type="date" value-format="timestamp" placeholder="选择结束时间" /> | |
| 35 | + </el-form-item> | |
| 36 | + </el-col> | |
| 37 | + </el-row> | |
| 38 | + <el-row v-show="modifyShow" > | |
| 39 | + <el-col :span="8"> | |
| 40 | + <el-form-item label="请假类型" prop="leaveType"> | |
| 41 | + <el-select v-model="form.leaveType" placeholder="请选择"> | |
| 42 | + <el-option | |
| 43 | + v-for="dict in leaveTypeDictData" | |
| 44 | + :key="dict.value" | |
| 45 | + :label="dict.label" | |
| 46 | + :value="dict.value" | |
| 47 | + /> | |
| 48 | + </el-select> | |
| 49 | + </el-form-item> | |
| 50 | + </el-col> | |
| 51 | + </el-row> | |
| 52 | + <el-row v-show="modifyShow"> | |
| 53 | + <el-col :span="15"> | |
| 54 | + <el-form-item label="原因" prop="reason"> | |
| 55 | + <el-input | |
| 56 | + type="textarea" | |
| 57 | + :rows="3" | |
| 58 | + v-model="form.reason" | |
| 59 | + placeholder="请输入原因" /> | |
| 60 | + </el-form-item> | |
| 61 | + </el-col> | |
| 62 | + </el-row> | |
| 63 | + <el-form-item> | |
| 64 | + <el-button type="primary" @click="submitForm">确 定</el-button> | |
| 65 | + </el-form-item> | |
| 66 | + </el-form> | |
| 67 | + </el-tab-pane> | |
| 68 | + <el-tab-pane label="历史跟踪"> | |
| 69 | + <el-steps :active="stepActive" simple finish-status="success"> | |
| 70 | + <el-step :title="stepTitle(item)" icon="el-icon-edit" v-for="(item) in handleTask.historyTask" ></el-step> | |
| 71 | + </el-steps> | |
| 72 | + <br/> | |
| 73 | + <el-steps direction="vertical" :active="stepActive" space="65px"> | |
| 74 | + <el-step :title="stepTitle(item)" :description="stepDes(item)" v-for="(item) in handleTask.historyTask" ></el-step> | |
| 75 | + </el-steps> | |
| 76 | + </el-tab-pane> | |
| 77 | + <el-tab-pane label="流程图">流程图-TODO</el-tab-pane> | |
| 78 | + </el-tabs> | |
| 79 | + | |
| 80 | + </div> | |
| 81 | +</template> | |
| 82 | + | |
| 83 | +<script> | |
| 84 | +import { getLeave,updateLeave } from "@/api/oa/leave" | |
| 85 | +import { taskSteps } from "@/api/oa/todo" | |
| 86 | +import { getDictDataLabel, getDictDatas, DICT_TYPE } from '@/utils/dict' | |
| 87 | +export default { | |
| 88 | + name: "HrApproveLeave", | |
| 89 | + components: { | |
| 90 | + }, | |
| 91 | + data() { | |
| 92 | + return { | |
| 93 | + // 表单参数 | |
| 94 | + form: {}, | |
| 95 | + // 表单校验 | |
| 96 | + rules: { | |
| 97 | + }, | |
| 98 | + handleTask: { | |
| 99 | + historyTask:[] | |
| 100 | + }, | |
| 101 | + modifyShow: true, | |
| 102 | + reApplySelect: 1, | |
| 103 | + reApplyData: [ | |
| 104 | + { | |
| 105 | + value: 0, | |
| 106 | + label: '取消申请' | |
| 107 | + }, | |
| 108 | + { | |
| 109 | + value: 1, | |
| 110 | + label: '继续申请' | |
| 111 | + } | |
| 112 | + ], | |
| 113 | + statusFormat(row, column) { | |
| 114 | + return getDictDataLabel(DICT_TYPE.OA_LEAVE_STATUS, row.status) | |
| 115 | + }, | |
| 116 | + leaveTypeDictData: getDictDatas(DICT_TYPE.OA_LEAVE_TYPE), | |
| 117 | + leaveStatusData: getDictDatas(DICT_TYPE.OA_LEAVE_STATUS) | |
| 118 | + }; | |
| 119 | + }, | |
| 120 | + mounted() { | |
| 121 | + const businessKey = this.$route.query.businessKey; | |
| 122 | + const taskId = this.$route.query.taskId; | |
| 123 | + | |
| 124 | + this.getForm(businessKey,taskId); | |
| 125 | + }, | |
| 126 | + computed:{ | |
| 127 | + stepActive: function () { | |
| 128 | + let idx = 0; | |
| 129 | + for(let i=0; i<this.handleTask.historyTask.length; i++){ | |
| 130 | + if(this.handleTask.historyTask[i].status === 1){ | |
| 131 | + idx= idx+1; | |
| 132 | + }else{ | |
| 133 | + break; | |
| 134 | + } | |
| 135 | + } | |
| 136 | + return idx; | |
| 137 | + }, | |
| 138 | + stepTitle() { | |
| 139 | + return function (item) { | |
| 140 | + let name = item.stepName; | |
| 141 | + if (item.status === 1) { | |
| 142 | + name += '(已完成)' | |
| 143 | + } | |
| 144 | + if (item.status === 0) { | |
| 145 | + name += '(进行中)' | |
| 146 | + } | |
| 147 | + return name; | |
| 148 | + } | |
| 149 | + }, | |
| 150 | + stepDes(){ | |
| 151 | + return function (item) { | |
| 152 | + let desc = ""; | |
| 153 | + if (item.status === 1) { | |
| 154 | + desc+="审批人:["+ item.assignee +"] 审批意见: [" + item.comment + "] 审批时间: " + this.parseTime(item.endTime); | |
| 155 | + } | |
| 156 | + return desc; | |
| 157 | + } | |
| 158 | + } | |
| 159 | + }, | |
| 160 | + methods: { | |
| 161 | + /** 提交按钮 */ | |
| 162 | + submitForm() { | |
| 163 | + this.$refs["form"].validate(valid => { | |
| 164 | + if (!valid) { | |
| 165 | + return; | |
| 166 | + } | |
| 167 | + if (this.reApplySelect === 1) { | |
| 168 | + this.form.variables["reApply"] = true; | |
| 169 | + this.form.comment = '调整请假申请'; | |
| 170 | + } | |
| 171 | + if (this.reApplySelect === 0) { | |
| 172 | + this.form.variables["reApply"] = false; | |
| 173 | + this.form.comment = '取消请假申请'; | |
| 174 | + } | |
| 175 | + updateLeave(this.form).then(response => { | |
| 176 | + this.msgSuccess("修改成功"); | |
| 177 | + this.$store.dispatch('tagsView/delView', this.$route).then(({ visitedViews }) => { | |
| 178 | + //if (this.isActive(this.$route)) { | |
| 179 | + this.$router.push({path: '/oa/todo'}) | |
| 180 | + //} | |
| 181 | + }) | |
| 182 | + }); | |
| 183 | + }); | |
| 184 | + }, | |
| 185 | + getForm(id, taskId){ | |
| 186 | + getLeave(id).then(response => { | |
| 187 | + this.form = response.data; | |
| 188 | + this.form.taskId = taskId; | |
| 189 | + this.form.variables = {}; | |
| 190 | + }); | |
| 191 | + const data = { | |
| 192 | + taskId : taskId, | |
| 193 | + businessKey: id, | |
| 194 | + } | |
| 195 | + taskSteps(data).then(response => { | |
| 196 | + this.handleTask = response.data; | |
| 197 | + | |
| 198 | + }); | |
| 199 | + }, | |
| 200 | + reApplyChange(){ | |
| 201 | + if (this.reApplySelect === 1) { | |
| 202 | + this.modifyShow = true; | |
| 203 | + } | |
| 204 | + if (this.reApplySelect === 0) { | |
| 205 | + this.modifyShow = false; | |
| 206 | + } | |
| 207 | + } | |
| 208 | + | |
| 209 | + } | |
| 210 | +}; | |
| 211 | +</script> | ... | ... |
yudao-admin-ui/src/views/oa/todo/index.vue
| ... | ... | @@ -47,7 +47,7 @@ |
| 47 | 47 | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| 48 | 48 | <template slot-scope="scope"> |
| 49 | 49 | <el-button size="mini" type="text" icon="el-icon-edit" v-if="scope.row.status == 1" @click="handleClaim(scope.row)">签收</el-button> |
| 50 | - <el-button size="mini" type="text" icon="el-icon-edit" v-if="scope.row.status == 2" @click="handleLeaveApprove(scope.row)">办理</el-button> | |
| 50 | + <el-button size="mini" type="text" icon="el-icon-edit" v-if="scope.row.status == 2" @click="getTaskFormKey(scope.row)">办理</el-button> | |
| 51 | 51 | </template> |
| 52 | 52 | </el-table-column> |
| 53 | 53 | </el-table> |
| ... | ... | @@ -107,7 +107,7 @@ |
| 107 | 107 | </template> |
| 108 | 108 | |
| 109 | 109 | <script> |
| 110 | -import { completeTask, taskSteps, deleteLeave, getLeave, getTodoTaskPage, claimTask } from "@/api/oa/todo"; | |
| 110 | +import { completeTask, taskSteps, getTaskFormKey,deleteLeave, getLeave, getTodoTaskPage, claimTask } from "@/api/oa/todo"; | |
| 111 | 111 | import { getDictDataLabel, getDictDatas, DICT_TYPE } from '@/utils/dict' |
| 112 | 112 | export default { |
| 113 | 113 | name: "Todo", |
| ... | ... | @@ -220,7 +220,26 @@ export default { |
| 220 | 220 | this.resetForm("queryForm"); |
| 221 | 221 | this.handleQuery(); |
| 222 | 222 | }, |
| 223 | - | |
| 223 | + getTaskFormKey(row) { | |
| 224 | + const taskId = row.id; | |
| 225 | + const data = { | |
| 226 | + taskId : taskId | |
| 227 | + } | |
| 228 | + getTaskFormKey(data).then(response => { | |
| 229 | + const resp = response.data; | |
| 230 | + const path = resp.formKey; | |
| 231 | + const taskId = resp.id; | |
| 232 | + const businessKey = resp.businessKey; | |
| 233 | + const route = { | |
| 234 | + path: path, | |
| 235 | + query: { | |
| 236 | + businessKey: businessKey, | |
| 237 | + taskId:taskId | |
| 238 | + } | |
| 239 | + } | |
| 240 | + this.$router.replace(route); | |
| 241 | + }); | |
| 242 | + }, | |
| 224 | 243 | handleLeaveApprove(row) { |
| 225 | 244 | this.reset(); |
| 226 | 245 | const businessKey = row.businessKey; | ... | ... |
更新日志.md
| ... | ... | @@ -6,6 +6,17 @@ |
| 6 | 6 | ## [v1.2.0] 待定 |
| 7 | 7 | |
| 8 | 8 | * 工作流 |
| 9 | + * 修改表单为外置表单 | |
| 10 | + * 新增菜单流程申请 | |
| 11 | + * 请假流程如下 | |
| 12 | + 1. 请假人 在流程申请, 点击请假申请,填写表单提交 | |
| 13 | + 2. 部门领导(目前写死admin) 登陆,待办任务中 点击办理, 进行审批 | |
| 14 | + 3. hr 登陆(用户名:hradmin 密码:123456) 待办任务中 点击办理, 进行审批 | |
| 15 | + 4. 请假人登陆, 待办任务中, 确认 | |
| 16 | + 5. 流程结束 | |
| 17 | + * 请假查询中,可以查询本人的请假申请, 和进度 | |
| 18 | + * 流程跟踪图 待实现 | |
| 19 | + | |
| 9 | 20 | |
| 10 | 21 | ## [v1.1.1] 待定 |
| 11 | 22 | ... | ... |