Compare commits

...

36 Commits

Author SHA1 Message Date
bob 8598f1de17 feat(env) add test prod
continuous-integration/drone/push Build is passing Details
1 year ago
bob 6a2c22c7a3 feat(doc) mysql backup
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is failing Details
1 year ago
bob b8f305e0b7 feat(cd) drone pipeline add event test
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is passing Details
2 years ago
bob 8e63d6fc69 feat(cd) drone pipeline add event
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2 years ago
bob ae3a54062e feat(cd) drone pipeline add event
continuous-integration/drone/pr Build was killed Details
continuous-integration/drone/push Build was killed Details
2 years ago
bob 29fe333fa6 feat(cd) drone pipeline add event
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2 years ago
bob e16475d629 feat(cd) drone pipeline add event
continuous-integration/drone/pr Build is passing Details
2 years ago
bob 32bedd1bfd feat(cd) change Dockerfile
continuous-integration/drone/pr Build is passing Details
2 years ago
bob 83d885e8d9 feat(cd) modify drone
continuous-integration/drone/pr Build is failing Details
2 years ago
bob a7b29514fd feat(cd) modify drone
continuous-integration/drone/push Build is passing Details
2 years ago
bob 0900a70c17 feat(cd) modify drone
continuous-integration/drone/push Build was killed Details
2 years ago
bob 146ce44c73 feat(cd) modify drone
continuous-integration/drone/push Build is failing Details
2 years ago
bob c2732f28b2 feat(cd) modify drone
continuous-integration/drone/pr Build was killed Details
continuous-integration/drone/push Build was killed Details
2 years ago
bob 0858f1e809 feat(cd) modify drone yml
2 years ago
bob 73964d4741 feat(cd) modify drone yml
continuous-integration/drone/push Build was killed Details
2 years ago
bob a9d9064da3 feat(cd) modify drone yml
continuous-integration/drone/pr Build was killed Details
continuous-integration/drone/promote/production Build was killed Details
2 years ago
bob 285aff099d feat(cd) modify drone yml
continuous-integration/drone/pr Build was killed Details
2 years ago
bob 10197387c9 feat(cd) add drone
continuous-integration/drone/pr Build encountered an error Details
2 years ago
bob 653a4832e0 fix(log) add logserver compose
2 years ago
bob 8eaf9b4f20 fix(flow) flow reject status
2 years ago
bob 96267e98a2 fix(flow) flow reject status
2 years ago
bob dae69da8ca fix(flow) resubmit page add instance
2 years ago
bob 957f7cfc18 fix(flow) complete updateBusinessStatus
2 years ago
bob 53e458f201 fix(flow) add resubmit page
2 years ago
bob 44c0687812 feat(finish) add img
2 years ago
bob 6f60edf7e3 feat(h5) process delete taskName
2 years ago
bob 1bdc5010e3 feat(flow) finishedList add issue projectName
2 years ago
bob b2fa07be98 feat(flow) add delete button, delete export button
2 years ago
bob 94deb7399f feat(flow) last complete updateBusinessStatus
2 years ago
bob 793c8435fc Merge branch 'approve-sys'
2 years ago
bob e830cc9c79 fix(flow) update VariablesSubmitDate,delete invalid button
2 years ago
bob f87d8f01de fix(flow) update VariablesSubmitDate
2 years ago
bob 017bb8f0c4 feat(process) start oaProject
2 years ago
bob d095d76460 fix(oaProject) change attachment path
2 years ago
bob 13a0ce1cf5 feat(flow) flowRecord parse attachmentIds
2 years ago
bob 9681974c03 feat(h5) adapt process page
2 years ago

@ -0,0 +1,45 @@
kind: pipeline # 定义对象类型还有secret和signature两种类型
type: docker # 定义流水线类型还有kubernetes、exec、ssh等类型
name: jar-deploy # 定义流水线名称
steps: # 定义流水线执行步骤,这些步骤将顺序执行
- name: build-package # 流水线名称
image: maven:3.8-openjdk-11 # 定义创建容器的Docker镜像
pull: if-not-exists
volumes: # 将容器内目录挂载到宿主机仓库需要开启Trusted设置
- name: maven-cache
path: /root/.m2 # 将maven下载依赖的目录挂载出来防止重复下载
- name: maven-build
path: /app/build # 将应用打包好的Jar和执行脚本挂载出来
commands: # 定义在Docker容器中执行的shell命令
- mvn clean package -Dmaven.test.skip=true -pl ruoyi-admin -am # 应用打包命令
- cp ruoyi-admin/target/*.jar /app/build/
- cp ruoyi-admin/Dockerfile /app/build/Dockerfile
- cp run.sh /app/build/run.sh
- name: deploy-start
image: appleboy/drone-ssh # SSH工具镜像
pull: if-not-exists
settings:
host: 49.232.170.154 # 远程连接地址
username: root # 远程连接账号
password:
from_secret: ssh_password # 从Secret中读取SSH密码
port: 22 # 远程连接端口
command_timeout: 5m # 远程执行命令超时时间
script:
- cd /app/build # 进入宿主机构建目录
- chmod +x run.sh # 更改为可执行脚本
- ./run.sh # 运行脚本打包应用镜像并运行
volumes: # 定义流水线挂载目录,用于共享数据
- name: maven-build
host:
path: /app/build # 从宿主机中挂载的目录
- name: maven-cache
host:
path: /app/maven/cache
when:
branch:
- test
event:
- pull_request

@ -1,3 +1,4 @@
[![Build Status](http://49.232.170.154:7079/api/badges/bob/oa-flowable/status.svg)](http://49.232.170.154:7079/bob/oa-flowable)
## 项目说明
工作流管理

@ -0,0 +1,20 @@
version: '3.8'
services:
logserver:
image: codeskyblue/gohttpserver
container_name: logserver
restart: always
networks:
- caddynetwork
environment:
TZ: Asia/Shanghai
volumes:
- /etc/localtime:/etc/localtime:ro
- ruoyi-admin_logs:/app/public
command: ["--auth-type", "http", "--auth-http", "libob:KiQBW3GcHAuAQMB2tcc0o"]
networks:
caddynetwork:
name: caddynetwork
volumes:
ruoyi-admin_logs:
external: true

@ -0,0 +1,45 @@
### 备份
以下命令用于将容器内的 mysql 的特定数据库备份到 sql 文件:
```sh
# 进入 mysql 容器(宿主机执行)
docker exec -it mysql bash
# 执行备份, 此命令演示中仅备份 iot 数据库(容器内执行)
mysqldump -u root -p -h 127.0.0.1 oa_system > /tmp/oa_system.sql
mysqldump -u root -p -h 127.0.0.1 crm_single > /tmp/crm_single.sql
mysqldump -u root -p -h 127.0.0.1 hrm_single > /tmp/hrm_single.sql
mysqldump -u root -p -h 127.0.0.1 nacos > /tmp/nacos.sql
mysqldump -u root -p -h 127.0.0.1 teamwork > /tmp/teamwork.sql
# 将备份文件复制到宿主机(宿主机执行)
docker cp mysql:/tmp/oa_system.sql ./oa_system.sql
# 打包备份文件,压缩存储对于文本文件可以节省大量空间(宿主机执行)
tar -zcvf oa_system.sql.tzr.gz oa_system.sql
```
### 恢复
以下命名将备份的 sql 文件恢复到容器内的 mysql 数据库中:
```sh
# 解压备份文件, 解压后生成 iot.sql(宿主机执行)
tar -zxvf oa_system.sql.tar.gz
# 将备份文件复制到容器内(宿主机执行)
docker cp oa_system.sql mysql:/tmp/iot.sql
# 进入 mysql 容器(宿主机执行)
docker exec -it mysql bash
# 执行恢复(容器内执行)
mysql -u root -p oa_system < oa_system.sql
```
**全新的数据库在恢复之前需要先创建该数据库,然后再进行恢复:**
```sql
create database iot default character set utf8mb4 collate utf8mb4_unicode_ci;
```

@ -0,0 +1,12 @@
#!/bin/bash
# 打包编译docker镜像
echo '----build image----start'
docker build -t ruoyi-admin .
echo '----build image----end'
echo '----cd /opt/composes/ruoyi-admin----'
cd /opt/composes/ruoyi-admin
echo '----restart container----'
docker compose up -d
echo '----start container----'

@ -6,6 +6,6 @@ ARG SPRING_PROFILE
ENV JAVA_OPTS "${JAVA_OPTS} ${CUSTOM_OPTS}"
COPY target/*.jar /javarun
COPY *.jar /javarun
CMD ["bash","-c","java ${JAVA_OPTS} -Dspring.profiles.active=${SPRING_PROFILE} -jar /javarun/*.jar"]

@ -1,5 +1,6 @@
package com.ruoyi;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
@ -9,12 +10,14 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
*
* @author ruoyi
*/
@Slf4j
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
public class RuoYiApplication
{
public static void main(String[] args)
{
// System.setProperty("spring.devtools.restart.enabled", "false");
log.info("=========================cd auto deploy success=========");
SpringApplication.run(RuoYiApplication.class, args);
}
}

@ -0,0 +1,81 @@
# 数据源配置
spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driverClassName: com.mysql.cj.jdbc.Driver
# driverClassName: com.p6spy.engine.spy.P6SpyDriver
druid:
# 主库数据源
master:
url: jdbc:mysql://mysql:3306/oa_system?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2b8&allowPublicKeyRetrieval=true
username: root
password: Ldu@9ZZieMVjBj8G
# 从库数据源
slave:
# 从数据源开关/默认关闭
enabled: false
url:
username:
password:
# 初始连接数
initialSize: 5
# 最小连接池数量
minIdle: 10
# 最大连接池数量
maxActive: 20
# 配置获取连接等待超时的时间
maxWait: 60000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
timeBetweenEvictionRunsMillis: 60000
# 配置一个连接在池中最小生存的时间,单位是毫秒
minEvictableIdleTimeMillis: 300000
# 配置一个连接在池中最大生存的时间,单位是毫秒
maxEvictableIdleTimeMillis: 900000
# 配置检测连接是否有效
validationQuery: SELECT 1 FROM DUAL
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
webStatFilter:
enabled: true
statViewServlet:
enabled: true
# 设置白名单,不填则允许所有访问
allow:
url-pattern: /druid/*
# 控制台管理用户名和密码
login-username: admin
login-password: 123456
filter:
stat:
enabled: true
# 慢SQL记录
log-slow-sql: true
slow-sql-millis: 1000
merge-sql: true
wall:
config:
multi-statement-allow: true
# redis 配置
redis:
# 地址
host: redis
# 端口默认为6379
port: 6379
# 数据库索引
database: 0
# 密码
password: v5rNC30HQTjeGpA4jCZc
# 连接超时时间
timeout: 10s
lettuce:
pool:
# 连接池中的最小空闲连接
min-idle: 0
# 连接池中的最大空闲连接
max-idle: 8
# 连接池的最大数据库连接数
max-active: 8
# #连接池最大阻塞等待时间(使用负值表示没有限制)
max-wait: -1ms

@ -14,9 +14,9 @@ spring:
slave:
# 从数据源开关/默认关闭
enabled: false
url:
username:
password:
url:
username:
password:
# 初始连接数
initialSize: 5
# 最小连接池数量
@ -36,7 +36,7 @@ spring:
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
webStatFilter:
webStatFilter:
enabled: true
statViewServlet:
enabled: true
@ -55,4 +55,27 @@ spring:
merge-sql: true
wall:
config:
multi-statement-allow: true
multi-statement-allow: true
# redis 配置
redis:
# 地址
host: 49.232.170.154
# 端口默认为6379
port: 6379
# 数据库索引
database: 0
# 密码
password: v5rNC30HQTjeGpA4jCZc
# 连接超时时间
timeout: 10s
lettuce:
pool:
# 连接池中的最小空闲连接
min-idle: 0
# 连接池中的最大空闲连接
max-idle: 8
# 连接池的最大数据库连接数
max-active: 8
# #连接池最大阻塞等待时间(使用负值表示没有限制)
max-wait: -1ms

@ -43,7 +43,7 @@ spring:
# 国际化资源文件路径
basename: i18n/messages
profiles:
active: druid
active: test
# 文件上传
servlet:
multipart:
@ -56,29 +56,6 @@ spring:
restart:
# 热部署开关
enabled: true
# redis 配置
redis:
# 地址
host: 49.232.170.154
# 端口默认为6379
port: 6379
# 数据库索引
database: 0
# 密码
password: v5rNC30HQTjeGpA4jCZc
# 连接超时时间
timeout: 10s
lettuce:
pool:
# 连接池中的最小空闲连接
min-idle: 0
# 连接池中的最大空闲连接
max-idle: 8
# 连接池的最大数据库连接数
max-active: 8
# #连接池最大阻塞等待时间(使用负值表示没有限制)
max-wait: -1ms
# token配置
token:
# 令牌自定义标识
@ -127,4 +104,4 @@ flowable:
# 关闭定时任务JOB
async-executor-activate: false
attachment:
path: /tmp
path: /data/attachment

@ -95,7 +95,7 @@ public class FlowTaskController {
@ApiOperation(value = "修改任务完成时间", response = FlowTaskDto.class)
@PostMapping(value = "/updateTaskFinishDate")
public AjaxResult updateTaskFinishDate(@RequestBody UpdateVariablesSubmitDateVo vo) {
return flowTaskService.updateVariablesSubmitDate(vo);
return flowTaskService.updateTaskFinishDate(vo);
}
@ApiOperation(value = "审批任务")

@ -1,6 +1,7 @@
package com.ruoyi.flowable.domain.vo;
import cn.hutool.core.img.ImgUtil;
import cn.hutool.core.io.FileUtil;
import lombok.Data;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.StringUtils;
@ -23,8 +24,8 @@ public class AttachmentInfoVO {
this.isImg = false;
}
public void setBase64ByFile(String path, String type) {
if (this.isImg) {
public void parseImageBase64(String path, String type) {
if (this.isImg && FileUtil.exist(path)) {
this.base64 = ImgUtil.toBase64(ImgUtil.read(path), type);
}
}

@ -12,6 +12,8 @@ public class UpdateVariablesSubmitDateVo {
@ApiModelProperty("任务id")
private String taskId;
@ApiModelProperty("任务顺序编号")
private String taskIndex;
@ApiModelProperty("提交时间")
private String finishDate;

@ -167,7 +167,7 @@ public interface IFlowTaskService {
AjaxResult processVariables(String taskId);
AjaxResult updateVariablesSubmitDate(String processInstanceId,String submitDate);
AjaxResult updateVariablesSubmitDate(UpdateVariablesSubmitDateVo vo);
AjaxResult updateTaskFinishDate(UpdateVariablesSubmitDateVo vo);
/**
*

@ -2,8 +2,10 @@ package com.ruoyi.flowable.service.impl;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists;
@ -103,6 +105,12 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
if (Objects.isNull(task)) {
return AjaxResult.error("任务不存在");
}
ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(task.getProcessInstanceId()).singleResult();
String businessStatus = processInstance.getBusinessStatus();
// 排除驳回状态
if (ObjectUtil.notEqual(businessStatus,FlowStatus.REJECT.getValue() )) {
runtimeService.updateBusinessStatus(taskVo.getInstanceId(), FlowStatus.APPROVING.getValue());
}
if (DelegationState.PENDING.equals(task.getDelegationState())) {
taskService.addComment(taskVo.getTaskId(), taskVo.getInstanceId(), FlowComment.DELEGATE.getType(), taskVo.getComment());
taskService.resolveTask(taskVo.getTaskId(), taskVo.getVars());
@ -112,7 +120,11 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
taskService.setAssignee(taskVo.getTaskId(), userId.toString());
taskService.complete(taskVo.getTaskId(), taskVo.getVars());
}
runtimeService.updateBusinessStatus(taskVo.getInstanceId(), FlowStatus.APPROVING.getValue());
// 兼容驳回状态提交报错The process instance id is mandatory, but '' has been provided.
if (ObjectUtil.equals(businessStatus,FlowStatus.REJECT.getValue() )) {
runtimeService.updateBusinessStatus(taskVo.getInstanceId(), FlowStatus.APPROVING.getValue());
}
return AjaxResult.success();
}
@ -237,11 +249,9 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
} catch (FlowableException e) {
throw new CustomException("无法取消或开始活动");
}
runtimeService.updateBusinessStatus(flowTaskVo.getInstanceId(), FlowStatus.REJECT.getValue());
}
/**
* 退
*
@ -708,7 +718,8 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
flowTask.setProcDefVersion(pd.getVersion());
flowTask.setProcInsId(histTask.getProcessInstanceId());
flowTask.setHisProcInsId(histTask.getProcessInstanceId());
flowTask.extractIssue(histTask.getProcessVariables());
flowTask.extractProjectName(histTask.getProcessVariables(),sysProjectService);
// 流程发起人信息
HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery()
.processInstanceId(histTask.getProcessInstanceId())
@ -826,8 +837,10 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
return result;
}
Map<String, Object> variables = ( Map<String, Object>)MapUtils.getMap(result, "form",new HashMap<>());
String attachmentIdsStr = MapUtils.getString(variables, ATTACHMENT_IDS_VARIABLE_KEY);
// get AttachmentIds
if (!variables.containsKey(ATTACHMENT_IDS_VARIABLE_KEY) || StringUtils.isBlank(MapUtils.getString(variables,ATTACHMENT_IDS_VARIABLE_KEY))) {
if (!variables.containsKey(ATTACHMENT_IDS_VARIABLE_KEY) || StringUtils.isBlank(attachmentIdsStr) || StrUtil.equals("[]",attachmentIdsStr)) {
return result;
}
// get Attachment info
@ -838,7 +851,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
List<AttachmentInfoVO> list = attachmentIds.stream().map(e -> sysAttachmentService.selectSysAttachmentById(e)).map(e->{
AttachmentInfoVO vo = new AttachmentInfoVO();
vo.setIsImgByContentType(e.getContentType());
vo.setBase64ByFile(e.getPath(),e.getType());
vo.parseImageBase64(e.getPath(),e.getType());
vo.setId(e.getId());
vo.setName(e.getName());
vo.setType(e.getType());
@ -996,23 +1009,37 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
return AjaxResult.success();
}
@Override
public AjaxResult updateVariablesSubmitDate(UpdateVariablesSubmitDateVo vo) {
public AjaxResult updateTaskFinishDate(UpdateVariablesSubmitDateVo vo) {
if (StringUtils.isBlank(vo.getProcessInstanceId()) || StringUtils.isBlank(vo.getFinishDate())) {
return AjaxResult.error("更新提交时间失败,参数无效");
}
Execution execution = runtimeService.createExecutionQuery().processInstanceId(vo.getProcessInstanceId()).variableExists("submitDate").singleResult();
ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(vo.getProcessInstanceId()).includeProcessVariables().singleResult();
if (Objects.isNull(execution)) {
HistoricTaskInstance historicTaskInstance = historyService.createHistoricTaskInstanceQuery().processInstanceId(vo.getProcessInstanceId()).taskId(vo.getTaskId()).singleResult();
if (Objects.isNull(historicTaskInstance)) {
return AjaxResult.error("更新提交时间失败,此任务不存在");
}
String executionId = historicTaskInstance.getExecutionId();
if (Objects.isNull(executionId)) {
return AjaxResult.error("更新提交时间失败,查询错误");
}
ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(vo.getProcessInstanceId()).includeProcessVariables().singleResult();
Map<String, Object> variables = processInstance.getProcessVariables();
Map<String, Object> map = (Map<String , Object>)MapUtils.getMap(variables, USER_MODIFY_TASK_FINISH_TIME_VARIABLE_KEY,new HashMap<>());
map.put(vo.getTaskId(), DateUtil.parse(vo.getFinishDate(), DatePattern.NORM_DATETIME_FORMATTER));
runtimeService.setVariable(execution.getId(),USER_MODIFY_TASK_FINISH_TIME_VARIABLE_KEY,map);
DateTime submitDate = DateUtil.parse(vo.getFinishDate(), DatePattern.NORM_DATETIME_FORMATTER);
map.put(vo.getTaskId(),submitDate);
runtimeService.setVariable(vo.getProcessInstanceId(), USER_MODIFY_TASK_FINISH_TIME_VARIABLE_KEY,map);
updateSubmitDate(vo.getProcessInstanceId(), historicTaskInstance.getName(), submitDate);
return AjaxResult.success();
}
public void updateSubmitDate( String processInstanceId,String taskName, DateTime submitDate) {
if (ObjectUtil.notEqual("提交汇报",taskName)) {
return;
}
runtimeService.setVariable(processInstanceId,"submitDate",submitDate);
}
/**
*
*

@ -0,0 +1,146 @@
import request from '@/utils/request'
// 查询流程定义列表
export function listDefinition(query) {
return request({
url: '/flowable/definition/list',
method: 'get',
params: query
})
}
// 部署流程实例
export function definitionStart(procDefId, data) {
return request({
url: '/flowable/definition/start/' + procDefId,
method: 'post',
data: data
})
}
// 获取流程变量
export function getProcessVariables(taskId) {
return request({
url: '/flowable/task/processVariables/' + taskId,
method: 'get'
})
}
// 更新流程变量提交时间
export function updateVariablesSubmitDate(data) {
return request({
url: '/flowable/task/updateVariablesSubmitDate',
method: 'post',
data: data
})
}// 更新流程变量提交时间
export function updateTaskFinishDate(data) {
return request({
url: '/flowable/task/updateTaskFinishDate',
method: 'post',
data: data
})
}
// 激活/挂起流程
export function updateState(params) {
return request({
url: '/flowable/definition/updateState',
method: 'put',
params: params
})
}
// 指定流程办理人员列表
export function userList(query) {
return request({
url: '/flowable/definition/userList',
method: 'get',
params: query
})
}
// 指定流程办理组列表
export function roleList(query) {
return request({
url: '/flowable/definition/roleList',
method: 'get',
params: query
})
}
// 读取xml文件
export function readXml(deployId) {
return request({
url: '/flowable/definition/readXml/' + deployId,
method: 'get'
})
}
// 读取image文件
export function readImage(deployId) {
return request({
url: '/flowable/definition/readImage/' + deployId,
method: 'get'
})
}
// 读取image文件
export function getFlowViewer(procInsId, executionId) {
return request({
url: '/flowable/task/flowViewer/' + procInsId + '/' + executionId,
method: 'get'
})
}
// 读取xml文件
export function saveXml(data) {
return request({
url: '/flowable/definition/save',
method: 'post',
data: data
})
}
// 获取最新流程id
export function getLatestIdByKey(procKey) {
return request({
url: '/flowable/definition/getLatestIdByKey/' + procKey,
method: 'get'
});
}
// 新增流程定义
export function addDeployment(data) {
return request({
url: '/system/deployment',
method: 'post',
data: data
})
}
// 修改流程定义
export function updateDeployment(data) {
return request({
url: '/system/deployment',
method: 'put',
data: data
})
}
// 删除流程定义
export function delProcessInstance(param) {
return request({
url: '/flowable/instance/delete/',
method: 'delete',
params: param
})
}
// 导出流程定义
export function exportDeployment(query) {
return request({
url: '/system/deployment/export',
method: 'get',
params: query
})
}

@ -1,40 +1,40 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="开始时间" prop="deployTime">
<el-date-picker clearable size="small"
v-model="queryParams.deployTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择时间">
</el-date-picker>
</el-form-item>
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="80px">
<!-- <el-form-item label="名称" prop="name">-->
<!-- <el-input-->
<!-- v-model="queryParams.name"-->
<!-- placeholder="请输入名称"-->
<!-- clearable-->
<!-- size="small"-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="开始时间" prop="deployTime">-->
<!-- <el-date-picker clearable size="small"-->
<!-- v-model="queryParams.deployTime"-->
<!-- type="date"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- placeholder="选择时间">-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<!-- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>-->
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:deployment:add']"
>新增流程</el-button>
</el-col>
<!-- <el-row :gutter="10" class="mb8">-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="primary"-->
<!-- plain-->
<!-- icon="el-icon-plus"-->
<!-- size="mini"-->
<!-- @click="handleAdd"-->
<!-- v-hasPermi="['system:deployment:add']"-->
<!-- >新增流程</el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="danger"-->
@ -43,32 +43,25 @@
<!-- size="mini"-->
<!-- :disabled="multiple"-->
<!-- @click="handleDelete"-->
<!-- v-hasPermi="['system:deployment:remove']"-->
<!-- >删除</el-button>-->
<!-- </el-col>-->
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:deployment:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="warning"-->
<!-- plain-->
<!-- icon="el-icon-download"-->
<!-- size="mini"-->
<!-- @click="handleExport"-->
<!-- v-hasPermi="['system:deployment:export']"-->
<!-- >导出</el-button>-->
<!-- </el-col>-->
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
<!-- </el-row>-->
<el-table v-loading="loading" :data="myProcessList" border @selection-change="handleSelectionChange">
<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="procDefName" :show-overflow-tooltip="true"/>
<el-table-column label="流程类别" align="center" prop="category" width="100px" />
<el-table-column label="流程版本" align="center" width="80px">
<template slot-scope="scope">
<el-tag size="medium" >v{{ scope.row.procDefVersion }}</el-tag>
</template>
</el-table-column>
<!-- <el-table-column type="selection" width="55" align="center" />-->
<el-table-column label="项目名称" align="center" prop="projectName" :show-overflow-tooltip="true"/>
<el-table-column label="工作事项" align="center" prop="workIssue" :show-overflow-tooltip="true"/>
<el-table-column label="提交时间" align="center" prop="createTime" width="180"/>
<el-table-column label="流程状态" align="center" width="100">
<template slot-scope="scope">
@ -76,30 +69,21 @@
<el-tag type="success" v-if="scope.row.finishTime != null" size="mini"></el-tag>
</template>
</el-table-column>
<el-table-column label="耗时" align="center" prop="duration" width="180"/>
<el-table-column label="当前节点" align="center" prop="taskName"/>
<el-table-column label="办理" align="center">
<template slot-scope="scope">
<label v-if="scope.row.assigneeName">{{scope.row.assigneeName}} <el-tag type="info" size="mini">{{scope.row.deptName}}</el-tag></label>
<label v-if="scope.row.candidate">{{scope.row.candidate}}</label>
</template>
</el-table-column>
<!-- <el-table-column label="当前节点" align="center" prop="taskName"/>-->
<!-- <el-table-column label="办理" align="center">-->
<!-- <template slot-scope="scope">-->
<!-- <label v-if="scope.row.assigneeName">{{scope.row.assigneeName}} <el-tag type="info" size="mini">{{scope.row.deptName}}</el-tag></label>-->
<!-- <label v-if="scope.row.candidate">{{scope.row.candidate}}</label>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-dropdown>
<span class="el-dropdown-link">
更多操作<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<span class="el-dropdown-link">更多操作<i class="el-icon-arrow-down el-icon--right"></i></span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item icon="el-icon-tickets" @click.native="handleFlowRecord(scope.row)">
详情
</el-dropdown-item>
<!-- <el-dropdown-item icon="el-icon-circle-close" @click.native="handleUpdateSubmitDate(scope.row)">-->
<!-- 更新提交时间-->
<!-- </el-dropdown-item>-->
<el-dropdown-item icon="el-icon-delete" @click.native="handleDownloadAttachment(scope.row)">
下载附件
</el-dropdown-item>
<el-dropdown-item icon="el-icon-tickets" @click.native="handleFlowRecord(scope.row)">详情</el-dropdown-item>
<el-dropdown-item icon="el-icon-delete" @click.native="handleDownloadAttachment(scope.row)">下载附件</el-dropdown-item>
<el-dropdown-item icon="el-icon-delete" @click.native="handleDelete(scope.row)">删除</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
@ -122,13 +106,13 @@
<script>
import {
getDeployment,
delDeployment,
addDeployment,
updateDeployment,
exportDeployment,
flowRecord
} from "@/api/flowable/finished";
import {allProcessList, myProcessList, stopProcess} from "@/api/flowable/process";
import { delProcessInstance } from "@/api/flowable/processInstance";
import {listDefinition, updateVariablesSubmitDate} from "@/api/flowable/definition";
import {downLoadZip} from "@/utils/zipdownload";
import {downloadAttachment} from "@/api/system/attachment";
@ -216,6 +200,27 @@ export default {
this.open = false;
this.reset();
},
/** 删除按钮操作 */
handleDelete(row) {
// const ids = row.procInsId || this.ids;//
const ids = row.procInsId;
this.$confirm('是否确认删除该申请记录?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return delProcessInstance(
{
instanceId:row.procInsId,
deleteReason:"管理员删除"
}
);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
})
},
//
reset() {
this.form = {

@ -1,57 +1,55 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="开始时间" prop="deployTime">
<el-date-picker clearable size="small"
v-model="queryParams.deployTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择时间">
</el-date-picker>
</el-form-item>
<!-- <el-form-item label="名称" prop="name">-->
<!-- <el-input-->
<!-- v-model="queryParams.name"-->
<!-- placeholder="请输入名称"-->
<!-- clearable-->
<!-- size="small"-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="开始时间" prop="deployTime">-->
<!-- <el-date-picker clearable size="small"-->
<!-- v-model="queryParams.deployTime"-->
<!-- type="date"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- placeholder="选择时间">-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<!-- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>-->
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:deployment:remove']"
>删除</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- <el-row :gutter="10" class="mb8">-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="danger"-->
<!-- plain-->
<!-- icon="el-icon-delete"-->
<!-- size="mini"-->
<!-- :disabled="multiple"-->
<!-- @click="handleDelete"-->
<!-- v-hasPermi="['system:deployment:remove']"-->
<!-- >删除</el-button>-->
<!-- </el-col>-->
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
<!-- </el-row>-->
<el-table v-loading="loading" :data="finishedList" border @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="任务编号" align="center" prop="taskId" :show-overflow-tooltip="true"/>
<el-table-column label="流程名称" align="center" prop="procDefName" :show-overflow-tooltip="true"/>
<el-table-column label="任务节点" align="center" prop="taskName" />
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="项目名称" align="center" prop="projectName" :show-overflow-tooltip="true"/>
<el-table-column label="工作事项" align="center" prop="workIssue" :show-overflow-tooltip="true"/>
<el-table-column label="任务节点" align="center" prop="taskName"/>
<el-table-column label="流程发起人" align="center">
<template slot-scope="scope">
<label>{{scope.row.startUserName}} <el-tag type="info" size="mini">{{scope.row.startDeptName}}</el-tag></label>
</template>
</el-table-column>
<el-table-column label="接收时间" align="center" prop="createTime" width="180"/>
<el-table-column label="审批时间" align="center" prop="finishTime" width="180"/>
<el-table-column label="耗时" align="center" prop="duration" width="180"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button

@ -1,15 +1,10 @@
<template>
<div class="app-container">
<el-dialog :title="'流转信息'" :visible.sync="open" width="80%" append-to-body>
<el-dialog :title="'详情'" :visible.sync="open" width="80%" append-to-body>
<el-card class="box-card" >
<div slot="header" class="clearfix">
<span class="el-icon-document">基础信息</span>
<el-button style="float: right;" type="primary" @click="goBack"></el-button>
</div>
<!--流程处理表单模块-->
<el-col :span="16" :offset="6" v-if="variableOpen">
<span class="el-icon-notebook-1">基础信息</span>
<div>
<el-form ref="form" :model="form" :rules="rules" label-width="100px" :disabled="true">
<el-form-item label="所属项目">
@ -19,7 +14,7 @@
placeholder="请选择">
<el-option
v-for="(item,index) in projectList"
:key="record"
:key="index"
:label="item.label"
:value="item.value">
</el-option>
@ -34,33 +29,77 @@
<el-form-item label="工作记录">
<el-input type="textarea" v-model="form.workRecord"/>
</el-form-item>
<el-form-item label="图片上传" prop="remark">
<el-upload
class="upload-demo"
action="https://jsonplaceholder.typicode.com/posts/"
:on-preview="handlePreview"
:on-remove="handleRemove"
:file-list="fileList">
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件且不超过500kb</div>
</el-upload>
</el-form-item>
<el-form-item label="文件上传" prop="remark">
<el-upload
class="upload-demo"
action="https://jsonplaceholder.typicode.com/posts/"
:on-preview="handlePreview"
:on-remove="handleRemove"
multiple
:limit="3"
:file-list="fileList">
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件且不超过500kb</div>
</el-upload>
<el-form-item label="附件">
<div v-for="(item,index) in uploadedImgs" class="demo-image__preview">
<el-row :span="24">
<el-col :span="6">
<el-image
style="width: 100px; height: 100px"
:src="'data:image/png;base64,'+item.base64"
:preview-src-list="['data:image/png;base64,'+item.base64]">
</el-image>
</el-col>
<el-col :span="2">
<span>{{item.name}}</span>
</el-col>
</el-row>
</div>
<div v-for="(item,index) in uploadedFiles" class="demo-image__preview">
<span>{{item.name}}</span>
</div>
</el-form-item>
</el-form>
</div>
</el-col>
</div>
<!--流程处理表单模块-->
<!-- <el-col :span="16" :offset="6" v-if="variableOpen">-->
<!-- <div>-->
<!-- <el-form ref="form" :model="form" :rules="rules" label-width="100px" :disabled="true">-->
<!-- <el-form-item label="所属项目">-->
<!-- <el-select v-model="form.projectId"-->
<!-- clearable-->
<!-- filterable-->
<!-- placeholder="请选择">-->
<!-- <el-option-->
<!-- v-for="(item,index) in projectList"-->
<!-- :key="record"-->
<!-- :label="item.label"-->
<!-- :value="item.value">-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="项目问题">-->
<!-- <el-input type="textarea" v-model="form.issue"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="解决方案">-->
<!-- <el-input type="textarea" v-model="form.solution"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="工作记录">-->
<!-- <el-input type="textarea" v-model="form.workRecord"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="附件">-->
<!-- <div v-for="(item,index) in uploadedImgs" class="demo-image__preview">-->
<!-- <el-row :span="24">-->
<!-- <el-col :span="6">-->
<!-- <el-image-->
<!-- style="width: 100px; height: 100px"-->
<!-- :src="'data:image/png;base64,'+item.base64"-->
<!-- :preview-src-list="['data:image/png;base64,'+item.base64]">-->
<!-- </el-image>-->
<!-- </el-col>-->
<!-- <el-col :span="2">-->
<!-- <span>{{item.name}}</span>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- </div>-->
<!-- </el-form-item>-->
<!-- </el-form>-->
<!-- </div>-->
<!-- </el-col>-->
</el-card>
@ -75,7 +114,7 @@
<el-timeline-item
v-for="(item,index ) in flowRecordList"
:key="record"
:icon="setIcon(item.finishTime)"
:icon="setIcon(item.finishTime, item.comment)"
:color="setColor(item.finishTime)"
>
<p style="font-weight: 700">{{item.taskName}}</p>
@ -108,6 +147,8 @@
{{item.comment.comment}}
</el-descriptions-item>
</el-descriptions>
<img v-if="isRefuse(item.comment)" src="@/assets/images/refuse.png" width="50" height="50">
<!-- <p v-if="item.comment">-->
<!-- <el-tag type="success" v-if="item.comment.type === '1'"> {{item.comment.comment}}</el-tag>-->
@ -128,104 +169,104 @@
<!-- </el-card>-->
<!--审批正常流程-->
<el-dialog :title="completeTitle" :visible.sync="completeOpen" :width="checkSendUser? '60%':'40%'" append-to-body>
<el-form ref="taskForm" :model="taskForm" label-width="80px" >
<el-form-item v-if="checkSendUser" prop="targetKey">
<el-row :gutter="20">
<!--部门数据-->
<el-col :span="6" :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="10" :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="(user,index) in userData"
:key="record"
closable
@close="handleClose(user)">
{{user.nickName}} {{user.dept.deptName}}
</el-tag>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="处理意见" prop="comment" :rules="[{ required: true, message: '请输入处理意见', trigger: 'blur' }]">
<el-input type="textarea" v-model="taskForm.comment" placeholder="请输入处理意见"/>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="completeOpen = false"> </el-button>
<el-button type="primary" @click="taskComplete"> </el-button>
</span>
</el-dialog>
<!-- <el-dialog :title="completeTitle" :visible.sync="completeOpen" :width="checkSendUser? '60%':'40%'" append-to-body>-->
<!-- <el-form ref="taskForm" :model="taskForm" label-width="80px" >-->
<!-- <el-form-item v-if="checkSendUser" prop="targetKey">-->
<!-- <el-row :gutter="20">-->
<!-- &lt;!&ndash;部门数据&ndash;&gt;-->
<!-- <el-col :span="6" :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="10" :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="(user,index) in userData"-->
<!-- :key="record"-->
<!-- closable-->
<!-- @close="handleClose(user)">-->
<!-- {{user.nickName}} {{user.dept.deptName}}-->
<!-- </el-tag>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="处理意见" prop="comment" :rules="[{ required: true, message: '请输入处理意见', trigger: 'blur' }]">-->
<!-- <el-input type="textarea" v-model="taskForm.comment" placeholder="请输入处理意见"/>-->
<!-- </el-form-item>-->
<!-- </el-form>-->
<!-- <span slot="footer" class="dialog-footer">-->
<!-- <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-form ref="taskForm" :model="taskForm" label-width="80px" >
<el-form-item label="退回节点" prop="targetKey">
<el-radio-group v-model="taskForm.targetKey">
<el-radio-button
v-for="item in returnTaskList"
:key="item.id"
:label="item.id"
>{{item.name}}</el-radio-button>
</el-radio-group>
</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>
<span slot="footer" class="dialog-footer">
<el-button @click="returnOpen = false"> </el-button>
<el-button type="primary" @click="taskReturn"> </el-button>
</span>
</el-dialog>
<!-- <el-dialog :title="returnTitle" :visible.sync="returnOpen" width="40%" append-to-body>-->
<!-- <el-form ref="taskForm" :model="taskForm" label-width="80px" >-->
<!-- <el-form-item label="退回节点" prop="targetKey">-->
<!-- <el-radio-group v-model="taskForm.targetKey">-->
<!-- <el-radio-button-->
<!-- v-for="item in returnTaskList"-->
<!-- :key="item.id"-->
<!-- :label="item.id"-->
<!-- >{{item.name}}</el-radio-button>-->
<!-- </el-radio-group>-->
<!-- </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>-->
<!-- <span slot="footer" class="dialog-footer">-->
<!-- <el-button @click="returnOpen = false"> </el-button>-->
<!-- <el-button type="primary" @click="taskReturn"> </el-button>-->
<!-- </span>-->
<!-- </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>
<!-- <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>-->
</el-dialog>
</div>
</template>
@ -306,6 +347,7 @@ export default {
issue: '',
solution: '',
},
uploadedImgs: [],
fileList: [],
projectList: [],
returnTaskList: [], // 退
@ -323,6 +365,7 @@ export default {
methods: {
init(procInsId, deployId, taskId, finished) {
this.uploadedImgs = []
this.open = true
this.taskForm.deployId = deployId;
this.taskForm.taskId = taskId;
@ -344,6 +387,9 @@ export default {
this.getFlowRecordList(this.taskForm.procInsId, this.taskForm.deployId);
this.finished = finished;
},
isRefuse(comment) {
return comment !== null &&comment !== undefined && comment.type !== null && comment.type !== undefined && comment.type === "3"
},
/** 查询部门下拉树结构 */
getTreeselect() {
treeselect().then(response => {
@ -380,8 +426,13 @@ export default {
this.taskList = res.data
})
},
setIcon(val) {
if (val) {
setIcon(finishTime,comment) {
console.log('setIcon::',comment)
//
if (this.isRefuse(comment)) {
return "el-icon-close";
} else if (finishTime) {
return "el-icon-check";
} else {
return "el-icon-time";
@ -431,6 +482,7 @@ export default {
getFlowRecordList(procInsId, deployId) {
const params = {procInsId: procInsId, deployId: deployId}
flowRecord(params).then(res => {
this.uploadedImgs = res.data.imgs;
this.flowRecordList = res.data.flowList;
//
// if (res.data.formData) {

@ -1,41 +1,34 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="开始时间" prop="deployTime">
<el-date-picker clearable size="small"
v-model="queryParams.deployTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择时间">
</el-date-picker>
</el-form-item>
<!-- <el-form-item label="名称" prop="name">-->
<!-- <el-input-->
<!-- v-model="queryParams.name"-->
<!-- placeholder="请输入名称"-->
<!-- clearable-->
<!-- size="small"-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="开始时间" prop="deployTime">-->
<!-- <el-date-picker clearable size="small"-->
<!-- v-model="queryParams.deployTime"-->
<!-- type="date"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- placeholder="选择时间">-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<!-- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>-->
<!-- <el-button type="primary" @click="handleAddOaProject"></el-button>-->
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:deployment:add']"
>新增流程</el-button>
</el-col>
<!-- <el-col :span="1.5">-->
<!-- <el-row :gutter="10" class="mb8">-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="danger"-->
<!-- plain-->
@ -46,23 +39,23 @@
<!-- v-hasPermi="['system:deployment:remove']"-->
<!-- >删除</el-button>-->
<!-- </el-col>-->
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:deployment:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="warning"-->
<!-- plain-->
<!-- icon="el-icon-download"-->
<!-- size="mini"-->
<!-- @click="handleExport"-->
<!-- v-hasPermi="['system:deployment:export']"-->
<!-- >导出</el-button>-->
<!-- </el-col>-->
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
<!-- </el-row>-->
<el-table v-loading="loading" :data="myProcessList" border @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="项目名称" align="center" prop="projectName" :show-overflow-tooltip="true"/>
<el-table-column label="工作问题" align="center" prop="workIssue" :show-overflow-tooltip="true"/>
<el-table-column label="工作事项" align="center" prop="workIssue" :show-overflow-tooltip="true"/>
<el-table-column label="流程类别" align="center" prop="category" width="100px" />
<el-table-column label="流程版本" align="center" width="80px">
<template slot-scope="scope">
@ -78,13 +71,13 @@
</template>
</el-table-column>
<el-table-column label="耗时" align="center" prop="duration" width="180"/>
<el-table-column label="当前节点" align="center" prop="taskName"/>
<el-table-column label="办理" align="center">
<template slot-scope="scope">
<label v-if="scope.row.assigneeName">{{scope.row.assigneeName}} <el-tag type="info" size="mini">{{scope.row.deptName}}</el-tag></label>
<label v-if="scope.row.candidate">{{scope.row.candidate}}</label>
</template>
</el-table-column>
<!-- <el-table-column label="当前节点" align="center" prop="taskName"/>-->
<!-- <el-table-column label="办理" align="center">-->
<!-- <template slot-scope="scope">-->
<!-- <label v-if="scope.row.assigneeName">{{scope.row.assigneeName}} <el-tag type="info" size="mini">{{scope.row.deptName}}</el-tag></label>-->
<!-- <label v-if="scope.row.candidate">{{scope.row.candidate}}</label>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-dropdown>
@ -95,7 +88,7 @@
<el-dropdown-item icon="el-icon-tickets" @click.native="handleFlowRecord(scope.row)">
详情
</el-dropdown-item>
<el-dropdown-item v-if="scope.row.status =='reject' " icon="el-icon-circle-close" @click.native="handleFlowRecord(scope.row)">
<el-dropdown-item v-if="scope.row.status =='reject' " icon="el-icon-circle-close" @click.native="handleResubmit(scope.row)">
重新发起
</el-dropdown-item>
<!-- <el-dropdown-item icon="el-icon-delete" @click.native="handleDelete(scope.row)" v-hasPermi="['system:deployment:remove']">-->
@ -159,11 +152,15 @@
@pagination="listDefinition"
/>
</el-dialog>
<oa-project-flow refre ref="oaProjectFlow" @refreshDataList="getList"></oa-project-flow>
<finished-record ref="finishedRecord"></finished-record>
<record-resubmit ref="recordResubmit"></record-resubmit>
</div>
</template>
<script>
import oaProjectFlow from "@/views/flowable/oa-project-flow.vue";
import {
getDeployment,
delDeployment,
@ -174,10 +171,15 @@ import {
} from "@/api/flowable/finished";
import { myProcessList,stopProcess } from "@/api/flowable/process";
import {listDefinition} from "@/api/flowable/definition";
import finishedRecord from "@/views/flowable/task/finished/record.vue";
import recordResubmit from "@/views/flowable/task/record/resubmit.vue";
export default {
name: "Deploy",
components: {
},
oaProjectFlow,
finishedRecord,
recordResubmit
},
data() {
return {
//
@ -250,6 +252,9 @@ export default {
this.loading = false;
});
},
handleAddOaProject() {
this.$refs.oaProjectFlow.init()
},
//
cancel() {
this.open = false;
@ -330,15 +335,23 @@ export default {
this.getList();
});
},
// /** */
// handleFlowRecord(row){
// this.$router.push({ path: '/flowable/task/record/index',
// query: {
// procInsId: row.procInsId,
// deployId: row.deployId,
// taskId: row.taskId,
// finished: false
// }})
// },
/** 流程流转记录 */
handleFlowRecord(row){
this.$router.push({ path: '/flowable/task/record/index',
query: {
procInsId: row.procInsId,
deployId: row.deployId,
taskId: row.taskId,
finished: false
}})
this.$refs.finishedRecord.init(row.procInsId,row.deployId,row.taskId, false)
}, /** 流程流转记录 */
handleResubmit(row){
console.log('handleResubmit=row=',row)
this.$refs.recordResubmit.init(row.procInsId,row.deployId,row.taskId, false)
},
/** 修改按钮操作 */
handleUpdate(row) {

@ -159,7 +159,7 @@
<el-descriptions-item v-if="item.finishTime" label-class-name="my-label">
<template slot="label"><i class="el-icon-date"></i>处理时间</template>
<span>{{item.finishTime}}</span>
<span > <el-button align="right" @click="handleUpdateTaskFinishDate(item.taskId)" size="mini" round plain type="primary">修改时间</el-button></span>
<span > <el-button align="right" @click="handleUpdateTaskFinishDate(item.taskId,index)" size="mini" round plain type="primary">修改时间</el-button></span>
</el-descriptions-item >
<!-- <el-descriptions-item v-if="item.duration" label-class-name="my-label">-->
<!-- <template slot="label"><i class="el-icon-time"></i>耗时</template>-->
@ -408,6 +408,7 @@ export default {
rejectOpen: false,
updateFinishDateOpen: false,
taskId: '',
taskIndex: '',
rejectTitle: null,
userData:[],
checkSendUser: false //
@ -450,9 +451,10 @@ export default {
);
},
/** 修改任务提交时间 */
handleUpdateTaskFinishDate(taskId) {
handleUpdateTaskFinishDate(taskId,taskIndex) {
this.updateFinishDateOpen = true;
this.taskId = taskId;
this.taskIndex = taskIndex;
},
/** 修改任务提交时间 */
@ -460,6 +462,7 @@ export default {
const params = {
processInstanceId: this.taskForm.procInsId,
taskId: this.taskId,
taskIndex: this.taskIndex,
finishDate: this.finishDate
}
updateTaskFinishDate(params).then( res => {

@ -158,31 +158,16 @@
<template slot="label"><i class="el-icon-user"></i>候选办理</template>
{{item.candidate}}
</el-descriptions-item>
<!-- <el-descriptions-item label-class-name="my-label">-->
<!-- <template slot="label"><i class="el-icon-date"></i>接收时间</template>-->
<!-- {{item.createTime}}-->
<!-- </el-descriptions-item>-->
<el-descriptions-item v-if="item.finishTime" label-class-name="my-label">
<template slot="label"><i class="el-icon-date"></i>处理时间</template>
<span v-if="form.submitDate !==undefined && form.submitDate !==''&& form.submitDate !==null">{{form.submitDate}}</span>
<span v-else>{{item.finishTime}}</span>
<span>{{item.finishTime}}</span>
</el-descriptions-item >
<!-- <el-descriptions-item v-if="item.duration" label-class-name="my-label">-->
<!-- <template slot="label"><i class="el-icon-time"></i>耗时</template>-->
<!-- {{item.duration}}-->
<!-- </el-descriptions-item>-->
<el-descriptions-item v-if="item.comment" label-class-name="my-label">
<template slot="label"><i class="el-icon-tickets"></i>处理意见</template>
{{item.comment.comment}}
</el-descriptions-item>
</el-descriptions>
<!-- <p v-if="item.comment">-->
<!-- <el-tag type="success" v-if="item.comment.type === '1'"> {{item.comment.comment}}</el-tag>-->
<!-- <el-tag type="warning" v-if="item.comment.type === '2'"> {{item.comment.comment}}</el-tag>-->
<!-- <el-tag type="danger" v-if="item.comment.type === '3'"> {{item.comment.comment}}</el-tag>-->
<!-- </p>-->
<img v-if="isRefuse(item.comment)" src="@/assets/images/refuse.png" width="50" height="50">
</el-card>
</el-timeline-item>

@ -0,0 +1,614 @@
<template>
<div class="app-container">
<el-dialog :title="'详情'" :visible.sync="open" width="80%" append-to-body>
<el-card class="box-card" >
<div slot="header" class="clearfix">
<span class="el-icon-document">基础信息</span>
</div>
<!--初始化流程加载表单信息-->
<el-col :span="16" :offset="4" v-if="formConfOpen" >
<div class="test-form">
<el-form ref="form" :model="form" :rules="rules" label-width="100px" :disabled=!applyIsRevoked>
<el-form-item label="所属项目">
<el-select v-model="form.projectId"
clearable
filterable
placeholder="请选择">
<el-option
v-for="(item,index) in projectList"
:key="index"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="项目问题">
<el-input type="textarea" v-model="form.issue"/>
</el-form-item>
<el-form-item label="解决方案">
<el-input type="textarea" v-model="form.solution"/>
</el-form-item>
<el-form-item label="工作记录">
<el-input type="textarea" v-model="form.workRecord"/>
</el-form-item>
<el-form-item v-if="applyIsRevoked" label="附件上传" prop="remark">
<el-upload
class="upload-demo"
:action="uploadFileUrl"
:on-error="handleUploadError"
:on-preview="handlePreview"
:on-success="handleSuccess"
:on-remove="handleRemove"
:headers="headers"
:file-list="fileList">
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
</el-form-item>
<el-form-item v-if="!applyIsRevoked" label="附件">
<div v-for="(item,index) in uploadedImgs" class="demo-image__preview">
<el-row :span="24">
<el-col :span="6">
<el-image
style="width: 100px; height: 100px"
:src="'data:image/png;base64,'+item.base64"
:preview-src-list="['data:image/png;base64,'+item.base64]">
</el-image>
</el-col>
<el-col :span="2">
<span>{{item.name}}</span>
</el-col>
</el-row>
</div>
<div v-for="(item,index) in uploadedFiles" class="demo-image__preview">
<span>{{item.name}}</span>
</div>
</el-form-item>
</el-form>
</div>
<div style="margin-left:10%;margin-bottom: 20px;font-size: 14px;" v-if=applyIsRevoked>
<el-button icon="el-icon-edit-outline" type="success" size="mini" @click="handleClaimAndComplete"></el-button>
</div>
</el-col>
</el-card>
</el-dialog>
</div>
</template>
<script>
import {flowRecord} from "@/api/flowable/finished";
import Parser from '@/components/parser/Parser'
import {definitionStart, getProcessVariables, readXml, getFlowViewer} from "@/api/flowable/definition";
import {complete, rejectTask, returnList, returnTask, getNextFlowNode, delegate} from "@/api/flowable/todo";
import flow from '@/views/flowable/task/record/flow'
import {treeselect} from "@/api/system/dept";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import Treeselect from "@riophae/vue-treeselect";
import {listUser} from "@/api/system/user";
import {optionProject} from "@/api/system/project";
import {getToken} from "@/utils/auth";
export default {
name: "Record",
components: {
Parser,
flow,
Treeselect
},
props: {},
data() {
return {
// xml
xmlData: "",
taskList: [],
//
deptName: undefined,
//
deptOptions: undefined,
//
userList: null,
defaultProps: {
children: "children",
label: "label"
},
//
queryParams: {
deptId: undefined
},
open: false,
//
loading: true,
applyIsRevoked: false,
flowRecordList: [], //
formConfCopy: {},
src: null,
rules: {}, //
variablesForm: {}, //
taskForm:{
returnTaskShow: false, // 退
delegateTaskShow: false, // 退
defaultTaskShow: true, //
sendUserShow: false, //
multiple: false,
comment:"", //
procInsId: "", //
instanceId: "", //
deployId: "", //
taskId: "" ,//
procDefId: "", //
vars: "",
targetKey:""
},
userDataList:[], //
assignee: null,
formConf: {}, //
formConfOpen: false, //
variables: [], //
variablesData: {}, //
variableOpen: false, //
//
form: {
projectId: 0,
workRecord: '',
issue: '',
submitDate: '',
solution: '',
attachmentIds:''
},
fileIdList: [],
fileList: [],
uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/attachment/upload", //
headers: {
Authorization: "Bearer " + getToken(),
},
uploadedImgs: [],
uploadedFiles: [],
projectList: [],
returnTaskList: [], // 退
finished: 'false',
completeTitle: null,
completeOpen: false,
returnTitle: null,
returnOpen: false,
rejectOpen: false,
rejectTitle: null,
userData:[],
checkSendUser: false //
};
},
// activated() {
// this.taskForm.deployId = this.$route.query && this.$route.query.deployId;
// this.taskForm.taskId = this.$route.query && this.$route.query.taskId;
// this.taskForm.procInsId = this.$route.query && this.$route.query.procInsId;
// this.taskForm.executionId = this.$route.query && this.$route.query.executionId;
// this.taskForm.instanceId = this.$route.query && this.$route.query.procInsId;
// //
// this.taskForm.procDefId = this.$route.query && this.$route.query.procDefId;
// //
// this.getFlowViewer(this.taskForm.procInsId,this.taskForm.executionId);
// this.getModelDetail(this.taskForm.deployId);
// //
// if (this.taskForm.taskId){
// this.processVariables( this.taskForm.taskId)
// this.getNextFlowNode(this.taskForm.taskId)
// this.taskForm.deployId = null
// }
// this.optionList();
// this.getFlowRecordList( this.taskForm.procInsId, this.taskForm.deployId);
// this.finished = this.$route.query && this.$route.query.finished
// this.fileIdList = []
// this.uploadedFiles = []
// this.uploadedImgs = []
// },
methods: {
init(procInsId, deployId, taskId, finished) {
console.log('init:procInsId=',procInsId)
this.uploadedImgs = []
this.open = true
this.taskForm.deployId = deployId;
this.taskForm.taskId = taskId;
this.taskForm.procInsId = procInsId;
this.taskForm.instanceId = procInsId;
// this.taskForm.executionId = this.$route.query && this.$route.query.executionId;
// this.taskForm.instanceId = this.$route.query && this.$route.query.procInsId;
//
// this.taskForm.procDefId = this.$route.query && this.$route.query.procDefId;
//
this.getFlowViewer(this.taskForm.procInsId, this.taskForm.executionId);
this.getModelDetail(this.taskForm.deployId);
//
if (this.taskForm.taskId) {
this.processVariables(this.taskForm.taskId)
this.getNextFlowNode(this.taskForm.taskId)
this.taskForm.deployId = null
}
this.optionList();
this.getFlowRecordList(this.taskForm.procInsId, this.taskForm.deployId);
this.finished = finished;
},
/** 查询部门下拉树结构 */
getTreeselect() {
treeselect().then(response => {
this.deptOptions = response.data;
});
},
/** 查询用户列表 */
getList() {
listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.userList = response.rows;
this.total = response.total;
}
);
},
//
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
//
handleNodeClick(data) {
this.queryParams.deptId = data.id;
this.getList();
},
/** xml 文件 */
getModelDetail(deployId) {
// xml
readXml(deployId).then(res => {
this.xmlData = res.data
})
},
getFlowViewer(procInsId,executionId) {
getFlowViewer(procInsId,executionId).then(res => {
this.taskList = res.data
})
},
isRefuse(comment) {
return comment !== null &&comment !== undefined && comment.type !== null && comment.type !== undefined && comment.type === "3"
},
setIcon(finishTime,comment) {
console.log('setIcon::',comment)
//
if (this.isRefuse(comment)) {
return "el-icon-close";
} else if (finishTime) {
return "el-icon-check";
} else {
return "el-icon-time";
}
},
setColor(val) {
if (val) {
return "#2bc418";
} else {
return "#b3bdbb";
}
},
//
handleSelectionChange(selection) {
if (selection) {
this.userData = selection
const selectVal = selection.map(item => item.userId);
if (selectVal instanceof Array) {
this.taskForm.values = {
"approval": selectVal.join(',')
}
} else {
this.taskForm.values = {
"approval": selectVal
}
}
}
},
//
handleClose(tag) {
this.userData.splice(this.userData.indexOf(tag), 1);
this.$refs.singleTable.toggleRowSelection(tag, false)
},
/** 流程变量赋值 */
handleCheckChange(val) {
if (val instanceof Array) {
this.taskForm.values = {
"approval": val.join(',')
}
} else {
this.taskForm.values = {
"approval": val
}
}
},
/** 流程流转记录 */
getFlowRecordList(procInsId, deployId) {
const params = {procInsId: procInsId, deployId: deployId}
flowRecord(params).then(res => {
this.flowRecordList = res.data.flowList;
this.uploadedImgs = res.data.imgs;
this.uploadedFiles = res.data.files;
//
// if (res.data.formData) {
this.form = res.data.form;
console.log("res.data.form;", res.data.form)
console.log("this.form ", this.form)
if (this.taskForm.executionId === undefined) {
this.formConfOpen = true
if (this.flowRecordList && this.flowRecordList.length !== 0) {
console.log("this.flowRecordList[0]", this.flowRecordList[0])
this.applyIsRevoked = this.flowRecordList[0].taskName === '提交汇报';
console.log("applyIsRevoked", this.applyIsRevoked)
}
}
// }
}).catch(res => {
this.goBack();
})
},
fillFormData(form, data) {
form.fields.forEach(item => {
const val = data[item.__vModel__]
if (val) {
item.__config__.defaultValue = val
}
})
},
/** 获取流程变量内容 */
processVariables(taskId) {
if (taskId) {
//
getProcessVariables(taskId).then(res => {
// this.variables = res.data.variables;
this.form = res.data;
this.variableOpen = true
});
}
},
/** 查询项目列表 */
optionList() {
this.loading = true;
optionProject().then(response => {
this.projectList = response.data;
this.loading = false;
});
},
/** 根据当前任务或者流程设计配置的下一步节点 */
getNextFlowNode(taskId) {
// todo
const params = {taskId: taskId}
getNextFlowNode(params).then(res => {
const data = res.data;
if (data) {
this.checkSendUser = true
if (data.type === 'assignee') { //
this.userDataList = res.data.userList;
} else if (data.type === 'candidateUsers') { // ()
this.userDataList = res.data.userList;
this.taskForm.multiple = true;
} else if (data.type === 'candidateGroups') { // ()
res.data.roleList.forEach(role => {
role.userId = role.roleId;
role.nickName = role.roleName;
})
this.userDataList = res.data.roleList;
this.taskForm.multiple = false;
} else if (data.type === 'multiInstance') { // ?
this.userDataList = res.data.userList;
this.taskForm.multiple = true;
}else if (data.type === 'fixed') { //
this.checkSendUser = false;
}
}
})
},
/** 审批任务选择 */
handleComplete() {
this.completeOpen = true;
this.completeTitle = "审批流程";
this.getTreeselect();
}, /** 确认并提交任务选择 */
handleClaimAndComplete() {
if (this.fileIdList.length > 0) {
this.form.attachmentIds=this.fileIdList.map(e => e.id).join(',')
console.log("this.form.attachmentIds", this.form.attachmentIds);
}
this.taskForm.comment = '提交任务';
this.taskForm.vars= JSON.stringify(this.form)
this.taskForm.taskId= this.flowRecordList[0].taskId
complete(this.taskForm).then(response => {
this.msgSuccess(response.msg);
});
this.open = false;
},
/** 审批任务 */
taskComplete() {
if (!this.taskForm.values && this.checkSendUser){
this.msgError("请选择流程接收人员");
return;
}
if (!this.taskForm.comment){
this.msgError("请输入审批意见");
return;
}
complete(this.taskForm).then(response => {
this.msgSuccess(response.msg);
this.goBack();
});
},
/** 委派任务 */
handleDelegate() {
this.taskForm.delegateTaskShow = true;
this.taskForm.defaultTaskShow = false;
},
handleAssign(){
},
/** 返回页面 */
goBack() {
//
this.$store.dispatch("tagsView/delView", this.$route);
this.$router.go(-1)
},
/** 接收子组件传的值 */
getData(data) {
if (data) {
const variables = [];
data.fields.forEach(item => {
let variableData = {};
variableData.label = item.__config__.label
//
if (item.__config__.defaultValue instanceof Array) {
const array = [];
item.__config__.defaultValue.forEach(val => {
array.push(val)
})
variableData.val = array;
} else {
variableData.val = item.__config__.defaultValue
}
variables.push(variableData)
})
this.variables = variables;
}
},
/** 申请流程表单数据提交 */
submitForm(data) {
if (data) {
const variables = data.valData;
const formData = data.formData;
formData.disabled = true;
formData.formBtns = false;
if (this.taskForm.procDefId) {
variables.variables = formData;
//
definitionStart(this.taskForm.procDefId, JSON.stringify(variables)).then(res => {
this.msgSuccess(res.msg);
this.goBack();
})
}
}
},
/** 驳回任务 */
handleReject() {
this.rejectOpen = true;
this.rejectTitle = "驳回流程";
},
/** 驳回任务 */
taskReject() {
this.$refs["taskForm"].validate(valid => {
if (valid) {
rejectTask(this.taskForm).then(res => {
this.msgSuccess(res.msg);
this.goBack();
});
}
});
},
/** 可退回任务列表 */
handleReturn() {
this.returnOpen = true;
this.returnTitle = "退回流程";
returnList(this.taskForm).then(res => {
this.returnTaskList = res.data;
this.taskForm.values = null;
})
},
/** 提交退回任务 */
taskReturn() {
this.$refs["taskForm"].validate(valid => {
if (valid) {
returnTask(this.taskForm).then(res => {
this.msgSuccess(res.msg);
this.goBack()
});
}
});
},
/** 取消回退任务按钮 */
cancelTask() {
this.taskForm.returnTaskShow = false;
this.taskForm.defaultTaskShow = true;
this.taskForm.sendUserShow = true;
this.returnTaskList = [];
},
/** 委派任务 */
submitDeleteTask() {
this.$refs["taskForm"].validate(valid => {
if (valid) {
delegate(this.taskForm).then(response => {
this.msgSuccess(response.msg);
this.goBack();
});
}
});
},
/** 取消回退任务按钮 */
cancelDelegateTask() {
this.taskForm.delegateTaskShow = false;
this.taskForm.defaultTaskShow = true;
this.taskForm.sendUserShow = true;
this.returnTaskList = [];
},
handleRemove(file, fileList) {
// id
console.log(file, fileList);
for(var i = this.fileIdList.length -1; i >= 0 ; i--){
if(this.fileIdList[i].uid == file.uid){
// fileIdListid
this.fileIdList.splice(i, 1);
}
}
},
handleUploadError(err, file, fileList) {
this.$message.error("上传失败, 请重试");
},
handleSuccess(res, file, fileList) {
if (res.code !== 200) {
this.$message.error("上传失败, 请重试");
return
}
this.fileIdList.push({
id:res.data.id,
uid:file.uid // id
})
// id
},
handlePreview(file) {
console.log(file);
}
}
};
</script>
<style lang="scss" scoped>
.test-form {
margin: 15px auto;
width: 800px;
padding: 15px;
}
.clearfix:before,
.clearfix:after {
display: table;
content: "";
}
.clearfix:after {
clear: both
}
.box-card {
width: 100%;
margin-bottom: 20px;
}
.el-tag + .el-tag {
margin-left: 10px;
}
.my-label {
background: #E1F3D8;
}
</style>

@ -1,55 +1,50 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="开始时间" prop="deployTime">
<el-date-picker clearable size="small"
v-model="queryParams.deployTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择时间">
</el-date-picker>
</el-form-item>
<!-- <el-form-item label="名称" prop="name">-->
<!-- <el-input-->
<!-- v-model="queryParams.name"-->
<!-- placeholder="请输入名称"-->
<!-- clearable-->
<!-- size="small"-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="开始时间" prop="deployTime">-->
<!-- <el-date-picker clearable size="small"-->
<!-- v-model="queryParams.deployTime"-->
<!-- type="date"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- placeholder="选择时间">-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<!-- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>-->
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:deployment:remove']"
>删除
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- <el-row :gutter="10" class="mb8">-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="danger"-->
<!-- plain-->
<!-- icon="el-icon-delete"-->
<!-- size="mini"-->
<!-- :disabled="multiple"-->
<!-- @click="handleDelete"-->
<!-- v-hasPermi="['system:deployment:remove']"-->
<!-- >删除-->
<!-- </el-button>-->
<!-- </el-col>-->
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
<!-- </el-row>-->
<el-table v-loading="loading" :data="todoList" border @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="项目名称" align="center" prop="projectName" :show-overflow-tooltip="true"/>
<el-table-column label="工作问题" align="center" prop="workIssue" :show-overflow-tooltip="true"/>
<el-table-column label="工作事项" align="center" prop="workIssue" :show-overflow-tooltip="true"/>
<el-table-column label="任务节点" align="center" prop="taskName"/>
<el-table-column label="流程版本" align="center">
<template slot-scope="scope">
<el-tag size="medium" >v{{scope.row.procDefVersion}}</el-tag>
</template>
</el-table-column>
<el-table-column label="流程发起人" align="center">
<template slot-scope="scope">
<label>{{scope.row.startUserName}} <el-tag type="info" size="mini">{{scope.row.startDeptName}}</el-tag></label>

@ -82,7 +82,7 @@
</template>
</el-table-column>
<el-table-column label="项目名称" align="center" prop="projectName" :show-overflow-tooltip="true"/>
<el-table-column label="工作问题" align="center" prop="workIssue" :show-overflow-tooltip="true"/>
<el-table-column label="工作事项" align="center" prop="workIssue" :show-overflow-tooltip="true"/>
<!-- <el-table-column label="流程类别" align="center" prop="category" width="100px" />-->
<!-- <el-table-column label="流程版本" align="center" width="80px">-->
<!-- <template slot-scope="scope">-->

86
ry.sh

@ -1,86 +0,0 @@
#!/bin/bash
AppName=ruoyi-admin.jar
#JVM参数
JVM_OPTS="-Dname=$AppName -Duser.timezone=Asia/Shanghai -Xms512M -Xmx512M -XX:PermSize=256M -XX:MaxPermSize=512M -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:NewRatio=1 -XX:SurvivorRatio=30 -XX:+UseParallelGC -XX:+UseParallelOldGC"
APP_HOME=`pwd`
LOG_PATH=$APP_HOME/logs/$AppName.log
if [ "$1" = "" ];
then
echo -e "\033[0;31m 未输入操作名 \033[0m \033[0;34m {start|stop|restart|status} \033[0m"
exit 1
fi
if [ "$AppName" = "" ];
then
echo -e "\033[0;31m 未输入应用名 \033[0m"
exit 1
fi
function start()
{
PID=`ps -ef |grep java|grep $AppName|grep -v grep|awk '{print $2}'`
if [ x"$PID" != x"" ]; then
echo "$AppName is running..."
else
nohup java -jar $JVM_OPTS target/$AppName > /dev/null 2>&1 &
echo "Start $AppName success..."
fi
}
function stop()
{
echo "Stop $AppName"
PID=""
query(){
PID=`ps -ef |grep java|grep $AppName|grep -v grep|awk '{print $2}'`
}
query
if [ x"$PID" != x"" ]; then
kill -TERM $PID
echo "$AppName (pid:$PID) exiting..."
while [ x"$PID" != x"" ]
do
sleep 1
query
done
echo "$AppName exited."
else
echo "$AppName already stopped."
fi
}
function restart()
{
stop
sleep 2
start
}
function status()
{
PID=`ps -ef |grep java|grep $AppName|grep -v grep|wc -l`
if [ $PID != 0 ];then
echo "$AppName is running..."
else
echo "$AppName is not running..."
fi
}
case $1 in
start)
start;;
stop)
stop;;
restart)
restart;;
status)
status;;
*)
esac
Loading…
Cancel
Save