diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java index a873066b..c2210970 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java @@ -57,6 +57,16 @@ public class SysDeptController extends BaseController return success(depts); } + /** + * 获取部门下拉树列表 + */ + @GetMapping("/treeselect") + public AjaxResult treeselect(SysDept dept) + { + List depts = deptService.selectDeptList(dept); + return AjaxResult.success(deptService.buildDeptTreeSelect(depts)); + } + /** * 根据部门编号获取详细信息 */ diff --git a/ruoyi-flowable/src/main/java/com/ruoyi/flowable/controller/FlowTaskController.java b/ruoyi-flowable/src/main/java/com/ruoyi/flowable/controller/FlowTaskController.java index 3c15ca22..0d1cccbd 100644 --- a/ruoyi-flowable/src/main/java/com/ruoyi/flowable/controller/FlowTaskController.java +++ b/ruoyi-flowable/src/main/java/com/ruoyi/flowable/controller/FlowTaskController.java @@ -73,6 +73,13 @@ public class FlowTaskController { return flowTaskService.flowRecord(procInsId, deployId); } + + @ApiOperation(value = "流程初始化表单", response = FlowTaskDto.class) + @GetMapping(value = "/flowFormData") + public AjaxResult flowFormData(String deployId) { + return flowTaskService.flowFormData(deployId); + } + @ApiOperation(value = "获取流程变量", response = FlowTaskDto.class) @GetMapping(value = "/processVariables/{taskId}") public AjaxResult processVariables(@ApiParam(value = "流程任务Id") @PathVariable(value = "taskId") String taskId) { diff --git a/ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/IFlowTaskService.java b/ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/IFlowTaskService.java index 74035f48..a2ee19a1 100644 --- a/ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/IFlowTaskService.java +++ b/ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/IFlowTaskService.java @@ -164,4 +164,11 @@ public interface IFlowTaskService { * @return */ AjaxResult getNextFlowNode(FlowTaskVo flowTaskVo); + + /** + * 流程初始化表单 + * @param deployId + * @return + */ + AjaxResult flowFormData(String deployId); } diff --git a/ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/impl/FlowTaskServiceImpl.java b/ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/impl/FlowTaskServiceImpl.java index cc97ea68..904bab46 100644 --- a/ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/impl/FlowTaskServiceImpl.java +++ b/ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/impl/FlowTaskServiceImpl.java @@ -1000,6 +1000,26 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask return AjaxResult.success(flowNextDto); } + /** + * 流程初始化表单 + * + * @param deployId + * @return + */ + @Override + public AjaxResult flowFormData(String deployId) { + // 第一次申请获取初始化表单 + if (StringUtils.isNotBlank(deployId)) { + SysForm sysForm = sysInstanceFormService.selectSysDeployFormByDeployId(deployId); + if (Objects.isNull(sysForm)) { + return AjaxResult.error("请先配置流程表单!"); + } + return AjaxResult.success(JSONObject.parseObject(sysForm.getFormContent())); + } else { + return AjaxResult.error("参数错误!"); + } + } + /** * 流程完成时间处理 * diff --git a/ruoyi-ui/src/api/flowable/process.js b/ruoyi-ui/src/api/flowable/process.js index effce341..6a4008f8 100644 --- a/ruoyi-ui/src/api/flowable/process.js +++ b/ruoyi-ui/src/api/flowable/process.js @@ -10,6 +10,14 @@ export function myProcessList(query) { }) } +export function flowFormData(query) { + return request({ + url: '/flowable/task/flowFormData', + method: 'get', + params: query + }) +} + // 完成任务 export function complete(data) { return request({ diff --git a/ruoyi-ui/src/api/system/dept.js b/ruoyi-ui/src/api/system/dept.js index 9ca69663..970ecdee 100644 --- a/ruoyi-ui/src/api/system/dept.js +++ b/ruoyi-ui/src/api/system/dept.js @@ -1,52 +1,60 @@ -import request from '@/utils/request' - -// 查询部门列表 -export function listDept(query) { - return request({ - url: '/system/dept/list', - method: 'get', - params: query - }) -} - -// 查询部门列表(排除节点) -export function listDeptExcludeChild(deptId) { - return request({ - url: '/system/dept/list/exclude/' + deptId, - method: 'get' - }) -} - -// 查询部门详细 -export function getDept(deptId) { - return request({ - url: '/system/dept/' + deptId, - method: 'get' - }) -} - -// 新增部门 -export function addDept(data) { - return request({ - url: '/system/dept', - method: 'post', - data: data - }) -} - -// 修改部门 -export function updateDept(data) { - return request({ - url: '/system/dept', - method: 'put', - data: data - }) -} - -// 删除部门 -export function delDept(deptId) { - return request({ - url: '/system/dept/' + deptId, - method: 'delete' - }) -} \ No newline at end of file +import request from '@/utils/request' + +// 查询部门列表 +export function listDept(query) { + return request({ + url: '/system/dept/list', + method: 'get', + params: query + }) +} + +// 查询部门下拉树结构 +export function treeselect() { + return request({ + url: '/system/dept/treeselect', + method: 'get' + }) +} + +// 查询部门列表(排除节点) +export function listDeptExcludeChild(deptId) { + return request({ + url: '/system/dept/list/exclude/' + deptId, + method: 'get' + }) +} + +// 查询部门详细 +export function getDept(deptId) { + return request({ + url: '/system/dept/' + deptId, + method: 'get' + }) +} + +// 新增部门 +export function addDept(data) { + return request({ + url: '/system/dept', + method: 'post', + data: data + }) +} + +// 修改部门 +export function updateDept(data) { + return request({ + url: '/system/dept', + method: 'put', + data: data + }) +} + +// 删除部门 +export function delDept(deptId) { + return request({ + url: '/system/dept/' + deptId, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/components/parser/Parser.vue b/ruoyi-ui/src/components/parser/Parser.vue index 95b96e9f..a5c82292 100644 --- a/ruoyi-ui/src/components/parser/Parser.vue +++ b/ruoyi-ui/src/components/parser/Parser.vue @@ -132,8 +132,10 @@ export default { [this.formConf.formModel]: {}, [this.formConf.formRules]: {} } - this.initFormData(data.formConfCopy.fields, data[this.formConf.formModel]) - this.buildRules(data.formConfCopy.fields, data[this.formConf.formRules]) + if (data.formConfCopy.fields) { + this.initFormData(data.formConfCopy.fields, data[this.formConf.formModel]) + this.buildRules(data.formConfCopy.fields, data[this.formConf.formRules]) + } return data }, methods: { diff --git a/ruoyi-ui/src/router/index.js b/ruoyi-ui/src/router/index.js index 6047c83c..9ca9e269 100644 --- a/ruoyi-ui/src/router/index.js +++ b/ruoyi-ui/src/router/index.js @@ -107,9 +107,48 @@ export const constantRoutes = [ hidden: true, children: [ { - path: 'task/record/index', - component: () => import('@/views/flowable/task/record/index'), - name: 'Record', + path: 'task/finished/detail/index', + component: () => import('@/views/flowable/task/finished/detail/index'), + name: 'FinishedRecord', + meta: { title: '流程详情', icon: '' } + } + ] + }, + { + path: '/flowable', + component: Layout, + hidden: true, + children: [ + { + path: 'task/myProcess/detail/index', + component: () => import('@/views/flowable/task/myProcess/detail/index'), + name: 'MyProcessRecord', + meta: { title: '流程详情', icon: '' } + } + ] + }, + { + path: '/flowable', + component: Layout, + hidden: true, + children: [ + { + path: 'task/myProcess/send/index', + component: () => import('@/views/flowable/task/myProcess/send/index'), + name: 'SendRecord', + meta: { title: '流程发起', icon: '' } + } + ] + }, + { + path: '/flowable', + component: Layout, + hidden: true, + children: [ + { + path: 'task/todo/detail/index', + component: () => import('@/views/flowable/task/todo/detail/index'), + name: 'TodoRecord', meta: { title: '流程处理', icon: '' } } ] diff --git a/ruoyi-ui/src/views/flowable/task/finished/detail/flow.vue b/ruoyi-ui/src/views/flowable/task/finished/detail/flow.vue new file mode 100644 index 00000000..7cd8334b --- /dev/null +++ b/ruoyi-ui/src/views/flowable/task/finished/detail/flow.vue @@ -0,0 +1,36 @@ + + diff --git a/ruoyi-ui/src/views/flowable/task/finished/detail/flowview.vue b/ruoyi-ui/src/views/flowable/task/finished/detail/flowview.vue new file mode 100644 index 00000000..e3064879 --- /dev/null +++ b/ruoyi-ui/src/views/flowable/task/finished/detail/flowview.vue @@ -0,0 +1,243 @@ + + + diff --git a/ruoyi-ui/src/views/flowable/task/finished/detail/index.vue b/ruoyi-ui/src/views/flowable/task/finished/detail/index.vue new file mode 100644 index 00000000..b2eb5755 --- /dev/null +++ b/ruoyi-ui/src/views/flowable/task/finished/detail/index.vue @@ -0,0 +1,227 @@ + + + + diff --git a/ruoyi-ui/src/views/flowable/task/finished/index.vue b/ruoyi-ui/src/views/flowable/task/finished/index.vue index 95e92a3f..6b57e615 100644 --- a/ruoyi-ui/src/views/flowable/task/finished/index.vue +++ b/ruoyi-ui/src/views/flowable/task/finished/index.vue @@ -204,12 +204,11 @@ export default { }, /** 流程流转记录 */ handleFlowRecord(row){ - this.$router.push({ path: '/flowable/task/record/index', + this.$router.push({ path: '/flowable/task/finished/detail/index', query: { procInsId: row.procInsId, deployId: row.deployId, taskId: row.taskId, - finished: false }}) }, /** 撤回任务 */ diff --git a/ruoyi-ui/src/views/flowable/task/myProcess/detail/flow.vue b/ruoyi-ui/src/views/flowable/task/myProcess/detail/flow.vue new file mode 100644 index 00000000..7cd8334b --- /dev/null +++ b/ruoyi-ui/src/views/flowable/task/myProcess/detail/flow.vue @@ -0,0 +1,36 @@ + + diff --git a/ruoyi-ui/src/views/flowable/task/myProcess/detail/flowview.vue b/ruoyi-ui/src/views/flowable/task/myProcess/detail/flowview.vue new file mode 100644 index 00000000..e3064879 --- /dev/null +++ b/ruoyi-ui/src/views/flowable/task/myProcess/detail/flowview.vue @@ -0,0 +1,243 @@ + + + diff --git a/ruoyi-ui/src/views/flowable/task/myProcess/detail/index.vue b/ruoyi-ui/src/views/flowable/task/myProcess/detail/index.vue new file mode 100644 index 00000000..e3400d48 --- /dev/null +++ b/ruoyi-ui/src/views/flowable/task/myProcess/detail/index.vue @@ -0,0 +1,214 @@ + + + + diff --git a/ruoyi-ui/src/views/flowable/task/process/index.vue b/ruoyi-ui/src/views/flowable/task/myProcess/index.vue similarity index 98% rename from ruoyi-ui/src/views/flowable/task/process/index.vue rename to ruoyi-ui/src/views/flowable/task/myProcess/index.vue index 68b63bc6..49a4341d 100644 --- a/ruoyi-ui/src/views/flowable/task/process/index.vue +++ b/ruoyi-ui/src/views/flowable/task/myProcess/index.vue @@ -311,11 +311,10 @@ export default { }, /** 发起流程申请 */ handleStartProcess(row){ - this.$router.push({ path: '/flowable/task/record/index', + this.$router.push({ path: '/flowable/task/myProcess/send/index', query: { deployId: row.deploymentId, - procDefId: row.id, - finished: true + procDefId: row.id } }) }, @@ -331,12 +330,11 @@ export default { }, /** 流程流转记录 */ handleFlowRecord(row){ - this.$router.push({ path: '/flowable/task/record/index', + this.$router.push({ path: '/flowable/task/myProcess/detail/index', query: { procInsId: row.procInsId, deployId: row.deployId, - taskId: row.taskId, - finished: false + taskId: row.taskId }}) }, /** 修改按钮操作 */ diff --git a/ruoyi-ui/src/views/flowable/task/myProcess/send/flow.vue b/ruoyi-ui/src/views/flowable/task/myProcess/send/flow.vue new file mode 100644 index 00000000..7cd8334b --- /dev/null +++ b/ruoyi-ui/src/views/flowable/task/myProcess/send/flow.vue @@ -0,0 +1,36 @@ + + diff --git a/ruoyi-ui/src/views/flowable/task/myProcess/send/flowview.vue b/ruoyi-ui/src/views/flowable/task/myProcess/send/flowview.vue new file mode 100644 index 00000000..e3064879 --- /dev/null +++ b/ruoyi-ui/src/views/flowable/task/myProcess/send/flowview.vue @@ -0,0 +1,243 @@ + + + diff --git a/ruoyi-ui/src/views/flowable/task/myProcess/send/index.vue b/ruoyi-ui/src/views/flowable/task/myProcess/send/index.vue new file mode 100644 index 00000000..a7d20dc5 --- /dev/null +++ b/ruoyi-ui/src/views/flowable/task/myProcess/send/index.vue @@ -0,0 +1,194 @@ + + + + diff --git a/ruoyi-ui/src/views/flowable/task/todo/detail/flow.vue b/ruoyi-ui/src/views/flowable/task/todo/detail/flow.vue new file mode 100644 index 00000000..7cd8334b --- /dev/null +++ b/ruoyi-ui/src/views/flowable/task/todo/detail/flow.vue @@ -0,0 +1,36 @@ + + diff --git a/ruoyi-ui/src/views/flowable/task/todo/detail/flowview.vue b/ruoyi-ui/src/views/flowable/task/todo/detail/flowview.vue new file mode 100644 index 00000000..e3064879 --- /dev/null +++ b/ruoyi-ui/src/views/flowable/task/todo/detail/flowview.vue @@ -0,0 +1,243 @@ + + + diff --git a/ruoyi-ui/src/views/flowable/task/todo/detail/index.vue b/ruoyi-ui/src/views/flowable/task/todo/detail/index.vue new file mode 100644 index 00000000..cb320d2e --- /dev/null +++ b/ruoyi-ui/src/views/flowable/task/todo/detail/index.vue @@ -0,0 +1,589 @@ + + + + diff --git a/ruoyi-ui/src/views/flowable/task/todo/index.vue b/ruoyi-ui/src/views/flowable/task/todo/index.vue index 52a7eb36..00e356cd 100644 --- a/ruoyi-ui/src/views/flowable/task/todo/index.vue +++ b/ruoyi-ui/src/views/flowable/task/todo/index.vue @@ -142,13 +142,12 @@ export default { }, // 跳转到处理页面 handleProcess(row){ - this.$router.push({ path: '/flowable/task/record/index', + this.$router.push({ path: '/flowable/task/todo/detail/index', query: { procInsId: row.procInsId, executionId: row.executionId, deployId: row.deployId, taskId: row.taskId, - finished: true }}) }, // 取消按钮