提交代码
parent
ab67fcc363
commit
fb31744f9b
|
@ -139,3 +139,55 @@ LEFT JOIN sys_user ru ON ru.user_id = RES.ASSIGNEE_
|
|||
LEFT JOIN sys_dept rd ON rd.dept_id = ru.dept_id
|
||||
WHERE
|
||||
RES.ASSIGNEE_ is not null and RES.END_TIME_ is not null)
|
||||
|
||||
##审批意见
|
||||
DROP view vw_flow_comment;
|
||||
CREATE VIEW vw_flow_comment AS (
|
||||
SELECT
|
||||
hi.ID_ as cc,
|
||||
hc.ID_ AS commentId,
|
||||
hc.TYPE_ AS commentType,
|
||||
ht.ID_ AS taskId,
|
||||
ht.NAME_ AS taskName,
|
||||
ht.REV_ AS rev,
|
||||
CASE
|
||||
WHEN hc.TYPE_ = 1 and ht.NAME_ !='提交申请' THEN
|
||||
'通过'
|
||||
WHEN hc.TYPE_ = 2 THEN
|
||||
'退回'
|
||||
WHEN hc.TYPE_ = 3 THEN
|
||||
'驳回'
|
||||
WHEN hc.TYPE_ = 4 THEN
|
||||
'委派'
|
||||
WHEN hc.TYPE_ = 5 THEN
|
||||
'转办'
|
||||
WHEN hc.TYPE_ = 6 THEN
|
||||
'终止'
|
||||
WHEN hc.TYPE_ = 7 THEN
|
||||
'撤回'
|
||||
END AS commentResult,
|
||||
ht.PROC_INST_ID_ AS procInstId,
|
||||
ht.TASK_DEF_KEY_ AS taskDefKey,
|
||||
ht.EXECUTION_ID_ AS executionId,
|
||||
ht.DELETE_REASON_ AS deleteReason,
|
||||
DATE_FORMAT(
|
||||
ht.START_TIME_,
|
||||
'%Y-%m-%d %H:%i:%S'
|
||||
) AS startTime,
|
||||
DATE_FORMAT(
|
||||
ht.END_TIME_,
|
||||
'%Y-%m-%d %H:%i:%S'
|
||||
) AS endTime,
|
||||
ht.DURATION_ AS duration,
|
||||
hc.MESSAGE_ AS message,
|
||||
ru.nick_name AS assigneeName,
|
||||
rd.dept_name AS deptName,
|
||||
r.role_name as candidate
|
||||
FROM
|
||||
act_hi_taskinst ht
|
||||
LEFT JOIN act_hi_comment hc ON hc.TASK_ID_ = ht.ID_ or (hc.TASK_ID_ is null and hc.PROC_INST_ID_ = ht.PROC_INST_ID_)
|
||||
LEFT JOIN act_hi_identitylink hi on hi.TYPE_ = 'candidate' and hi.TASK_ID_ = ht.ID_ and hi.USER_ID_ IS NULL
|
||||
left JOIN sys_role r on r.role_id = hi.group_Id_
|
||||
LEFT JOIN sys_user ru ON ru.user_id = ht.ASSIGNEE_
|
||||
LEFT JOIN sys_dept rd ON rd.dept_id = ru.dept_id
|
||||
where hc.TYPE_ is null or hc.TYPE_!='event')
|
|
@ -2,7 +2,7 @@ package com.yanzhu.flowable.controller;
|
|||
|
||||
|
||||
import com.yanzhu.common.core.domain.AjaxResult;
|
||||
import com.yanzhu.system.domain.flowable.FlowTaskVo;
|
||||
import com.yanzhu.flowable.domain.FlowTaskVo;
|
||||
import com.yanzhu.flowable.service.IFlowInstanceService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
|
|
@ -5,7 +5,7 @@ import com.yanzhu.common.core.domain.AjaxResult;
|
|||
import com.yanzhu.common.enums.BusinessType;
|
||||
import com.yanzhu.flowable.domain.FlowTaskDto;
|
||||
import com.yanzhu.system.domain.flowable.FlowQueryVo;
|
||||
import com.yanzhu.system.domain.flowable.FlowTaskVo;
|
||||
import com.yanzhu.flowable.domain.FlowTaskVo;
|
||||
import com.yanzhu.flowable.service.IFlowTaskService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
@ -95,6 +95,13 @@ public class FlowTaskController {
|
|||
return flowTaskService.complete(flowTaskVo);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "重新提交流程")
|
||||
@Log(title = "重新提交流程", businessType = BusinessType.UPDATE)
|
||||
@PostMapping(value = "/completeAndModify")
|
||||
public AjaxResult completeAndModify(@RequestBody FlowTaskVo flowTaskVo) {
|
||||
return flowTaskService.complete(flowTaskVo);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "驳回任务")
|
||||
@Log(title = "驳回流程", businessType = BusinessType.UPDATE)
|
||||
@PostMapping(value = "/reject")
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.yanzhu.system.domain.flowable;
|
||||
package com.yanzhu.flowable.domain;
|
||||
|
||||
import com.yanzhu.project.domain.ProProjectApply;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
@ -45,6 +46,9 @@ public class FlowTaskVo {
|
|||
@ApiModelProperty("流程变量信息")
|
||||
private Map<String, Object> variables;
|
||||
|
||||
@ApiModelProperty("流程变量信息")
|
||||
private ProProjectApply proProjectApply;
|
||||
|
||||
@ApiModelProperty("审批人")
|
||||
private String assignee;
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
package com.yanzhu.flowable.listener;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.flowable.engine.delegate.DelegateExecution;
|
||||
import org.flowable.engine.delegate.ExecutionListener;
|
||||
import org.flowable.engine.delegate.TaskListener;
|
||||
import org.flowable.task.service.delegate.DelegateTask;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 任务监听器
|
||||
*
|
||||
* create(创建):在任务被创建且所有的任务属性设置完成后才触发
|
||||
* assignment(指派):在任务被分配给某个办理人之后触发
|
||||
* complete(完成):在配置了监听器的上一个任务完成时触发
|
||||
* delete(删除):在任务即将被删除前触发。请注意任务由completeTask正常完成时也会触发
|
||||
*
|
||||
* @author Tony
|
||||
* @date 2021/4/20
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class FlowTaskEndListener implements ExecutionListener {
|
||||
|
||||
@Override
|
||||
public void notify(DelegateExecution delegateExecution) {
|
||||
log.info("任务结束监听器:{}", delegateExecution);
|
||||
}
|
||||
}
|
|
@ -22,11 +22,8 @@ public class FlowTaskListener implements TaskListener{
|
|||
|
||||
@Override
|
||||
public void notify(DelegateTask delegateTask) {
|
||||
|
||||
log.info("任务监听器:{}", delegateTask);
|
||||
// TODO 获取事件类型 delegateTask.getEventName(),可以通过监听器给任务执行人发送相应的通知消息
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.yanzhu.flowable.service;
|
||||
|
||||
import com.yanzhu.common.core.domain.AjaxResult;
|
||||
import com.yanzhu.system.domain.flowable.FlowTaskVo;
|
||||
import com.yanzhu.flowable.domain.FlowTaskVo;
|
||||
import org.flowable.engine.history.HistoricProcessInstance;
|
||||
|
||||
import java.util.Map;
|
||||
|
|
|
@ -2,7 +2,7 @@ package com.yanzhu.flowable.service;
|
|||
|
||||
import com.yanzhu.common.core.domain.AjaxResult;
|
||||
import com.yanzhu.system.domain.flowable.FlowQueryVo;
|
||||
import com.yanzhu.system.domain.flowable.FlowTaskVo;
|
||||
import com.yanzhu.flowable.domain.FlowTaskVo;
|
||||
import org.flowable.task.api.Task;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
|
|
@ -199,12 +199,8 @@ public class FlowDefinitionServiceImpl extends FlowServiceFactory implements IFl
|
|||
@Override
|
||||
public AjaxResult startProcessInstanceById(String procDefId, ProProjectApply proProjectApply) {
|
||||
try {
|
||||
int res;
|
||||
if(proProjectApply.getId()!=null){
|
||||
res = proProjectApplyService.updateProProjectApply(proProjectApply);
|
||||
}else{
|
||||
res = proProjectApplyService.insertProProjectApply(proProjectApply);
|
||||
}
|
||||
/**保存流程表单**/
|
||||
int res = proProjectApplyService.insertProProjectApply(proProjectApply);
|
||||
if(res>0){
|
||||
Map<String, Object> variables = new HashMap<>();
|
||||
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(procDefId)
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
package com.yanzhu.flowable.service.impl;
|
||||
|
||||
|
||||
import com.yanzhu.common.core.domain.AjaxResult;
|
||||
import com.yanzhu.common.utils.SecurityUtils;
|
||||
import com.yanzhu.system.domain.flowable.FlowTaskVo;
|
||||
import com.yanzhu.flowable.domain.FlowTaskVo;
|
||||
import com.yanzhu.flowable.factory.FlowServiceFactory;
|
||||
import com.yanzhu.flowable.service.IFlowInstanceService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.yanzhu.flowable.service.impl;
|
||||
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.alibaba.fastjson2.TypeReference;
|
||||
|
@ -19,8 +18,9 @@ import com.yanzhu.flowable.domain.FlowNextDto;
|
|||
import com.yanzhu.flowable.domain.FlowTaskDto;
|
||||
import com.yanzhu.flowable.domain.FlowViewerDto;
|
||||
import com.yanzhu.flowable.flow.ModelUtils;
|
||||
import com.yanzhu.project.service.IProProjectApplyService;
|
||||
import com.yanzhu.system.domain.flowable.FlowQueryVo;
|
||||
import com.yanzhu.system.domain.flowable.FlowTaskVo;
|
||||
import com.yanzhu.flowable.domain.FlowTaskVo;
|
||||
import com.yanzhu.flowable.factory.FlowServiceFactory;
|
||||
import com.yanzhu.flowable.flow.CustomProcessDiagramGenerator;
|
||||
import com.yanzhu.flowable.flow.FindNextNodeUtil;
|
||||
|
@ -56,6 +56,7 @@ import org.flowable.task.api.history.HistoricTaskInstance;
|
|||
import org.flowable.task.api.history.HistoricTaskInstanceQuery;
|
||||
import org.flowable.engine.impl.cmd.AddMultiInstanceExecutionCmd;
|
||||
import org.flowable.engine.impl.cmd.DeleteMultiInstanceExecutionCmd;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
@ -86,6 +87,9 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|||
@Resource
|
||||
private ISysFormService sysFormService;
|
||||
|
||||
@Autowired
|
||||
private IProProjectApplyService proProjectApplyService;
|
||||
|
||||
/**
|
||||
* 完成任务
|
||||
*
|
||||
|
@ -94,18 +98,22 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public AjaxResult complete(FlowTaskVo taskVo) {
|
||||
/**表单不为空时,重新修改表单**/
|
||||
if(!Objects.isNull(taskVo.getProProjectApply())){
|
||||
proProjectApplyService.updateProProjectApply(taskVo.getProProjectApply());
|
||||
}
|
||||
Task task = taskService.createTaskQuery().taskId(taskVo.getTaskId()).singleResult();
|
||||
if (Objects.isNull(task)) {
|
||||
return AjaxResult.error("任务不存在");
|
||||
}
|
||||
if (DelegationState.PENDING.equals(task.getDelegationState())) {
|
||||
taskService.addComment(taskVo.getTaskId(), taskVo.getInstanceId(), FlowComment.DELEGATE.getType(), taskVo.getComment());
|
||||
taskService.resolveTask(taskVo.getTaskId(), taskVo.getVariables());
|
||||
taskService.resolveTask(taskVo.getTaskId());
|
||||
} else {
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
taskService.addComment(taskVo.getTaskId(), taskVo.getInstanceId(), FlowComment.NORMAL.getType(), taskVo.getComment());
|
||||
Long userId = SecurityUtils.getLoginUser().getUser().getUserId();
|
||||
taskService.setAssignee(taskVo.getTaskId(), userId.toString());
|
||||
taskService.complete(taskVo.getTaskId(), taskVo.getVariables());
|
||||
taskService.setAssignee(taskVo.getTaskId(), Convert.toStr(userId));
|
||||
taskService.complete(taskVo.getTaskId());
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
|
|
@ -123,6 +123,7 @@ export function exportDeployment(query) {
|
|||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 流程节点表单
|
||||
export function flowTaskForm(query) {
|
||||
return request({
|
||||
|
@ -131,3 +132,13 @@ export function flowTaskForm(query) {
|
|||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 完成任务并修改表单
|
||||
export function completeAndModify(data) {
|
||||
return request({
|
||||
url: '/flowable/task/completeAndModify',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
<div class="canvas" ref="flowCanvas"></div>
|
||||
<div class="maskLayer" />
|
||||
</div>
|
||||
<el-timeline>
|
||||
<el-timeline style="padding-left: 0px !important;">
|
||||
<el-timeline-item
|
||||
v-for="(item, index) in flowRecordList"
|
||||
:key="index"
|
||||
|
@ -129,7 +129,7 @@
|
|||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="申请时间">
|
||||
{{ parseTime(initData.createTime, "{y}-{m}-{d} {h}:{i}") }}
|
||||
{{ options.createTime }}
|
||||
</el-form-item>
|
||||
<el-form-item label="使用时间" v-if="initData.useTime">
|
||||
{{ parseTime(initData.useTime, "{y}-{m}-{d} {h}:{i}") }}
|
||||
|
@ -523,7 +523,7 @@ export default {
|
|||
}
|
||||
.containers {
|
||||
width: 100%;
|
||||
height: 150px;
|
||||
height: 100px;
|
||||
.canvas {
|
||||
width: 100%;
|
||||
height: 100px;
|
||||
|
@ -548,7 +548,7 @@ export default {
|
|||
}
|
||||
|
||||
.djs-container svg {
|
||||
min-height: 150px;
|
||||
min-height: 100px;
|
||||
}
|
||||
|
||||
.highlight.djs-shape .djs-visual > :nth-child(1) {
|
||||
|
|
|
@ -1,76 +1,278 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<div class="app-editTaskDrawer">
|
||||
<el-drawer
|
||||
v-if="onOpen"
|
||||
:visible.sync="onOpen"
|
||||
ref="drawer"
|
||||
direction="rtl"
|
||||
size="60%"
|
||||
size="70%"
|
||||
@close="closeCallBack"
|
||||
>
|
||||
<template slot="title">
|
||||
<div>临时工程申请 【{{ title }}】</div>
|
||||
<div>
|
||||
临时工程申请 【{{ title }}】<span v-if="showjd">
|
||||
- 当前节点【{{ options.taskName }}】</span
|
||||
>
|
||||
</div>
|
||||
</template>
|
||||
<div class="drawer">
|
||||
<div class="drawerLeft">
|
||||
<el-timeline style="padding-left: 0px !important">
|
||||
<el-timeline-item
|
||||
v-for="(item, index) in flowRecordList"
|
||||
:key="index"
|
||||
:icon="setIcon(item)"
|
||||
:color="setColor(item)"
|
||||
>
|
||||
<p style="font-weight: 700">
|
||||
{{ getSort(index) }}{{ item.taskName }}{{ item.commentResult }}
|
||||
</p>
|
||||
<el-card :body-style="{ padding: '6px' }">
|
||||
<el-descriptions class="margin-top" :column="1" size="small" border>
|
||||
<el-descriptions-item
|
||||
v-if="item.assigneeName"
|
||||
label-class-name="my-label"
|
||||
:labelStyle="labelStyle"
|
||||
>
|
||||
<template slot="label"><i class="el-icon-user"></i>办理人</template>
|
||||
{{ item.assigneeName }}
|
||||
<el-tag type="info" size="mini">{{ item.deptName }}</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item
|
||||
v-if="item.candidate"
|
||||
label-class-name="my-label"
|
||||
:labelStyle="labelStyle"
|
||||
>
|
||||
<template slot="label"><i class="el-icon-user"></i>候选办理</template>
|
||||
{{ item.candidate }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item
|
||||
v-if="item.deleteReason"
|
||||
label-class-name="my-label"
|
||||
:labelStyle="labelStyle"
|
||||
>
|
||||
<template slot="label"><i class="el-icon-user"></i>驳回节点</template>
|
||||
{{ getDeleteReason(item.deleteReason) }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item
|
||||
label-class-name="my-label"
|
||||
:labelStyle="labelStyle"
|
||||
>
|
||||
<template slot="label"><i class="el-icon-date"></i>接收时间</template>
|
||||
{{ item.startTime }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item
|
||||
v-if="item.endTime"
|
||||
label-class-name="my-label"
|
||||
:labelStyle="labelStyle"
|
||||
>
|
||||
<template slot="label"><i class="el-icon-date"></i>处理时间</template>
|
||||
{{ item.endTime }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item
|
||||
v-if="item.duration"
|
||||
label-class-name="my-label"
|
||||
:labelStyle="labelStyle"
|
||||
>
|
||||
<template slot="label"><i class="el-icon-time"></i>处理耗时</template>
|
||||
{{ getDurationDateStr(item.duration) }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item
|
||||
v-if="item.message"
|
||||
label-class-name="my-label"
|
||||
:labelStyle="labelStyle"
|
||||
>
|
||||
<template slot="label"
|
||||
><i class="el-icon-tickets"></i>处理意见</template
|
||||
>
|
||||
{{ item.message }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
</div>
|
||||
<div class="drawerRight">
|
||||
<el-form
|
||||
ref="form"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
v-loading="loading"
|
||||
label-width="120px"
|
||||
style="padding-right: 35px"
|
||||
label-width="100px"
|
||||
style="padding-left: 25px; padding-right: 25px"
|
||||
>
|
||||
<div class="block containers">
|
||||
<div class="canvas" ref="flowCanvas"></div>
|
||||
<div class="maskLayer" />
|
||||
<div class="maskLayer"></div>
|
||||
</div>
|
||||
<el-form-item label="所属项目" prop="businessKey">
|
||||
<el-form-item label="项目单位">
|
||||
{{ form.parProjName }}
|
||||
</el-form-item>
|
||||
<el-form-item label="项目名称" prop="projId">
|
||||
<el-select
|
||||
v-model="form.businessKey"
|
||||
placeholder="请选择所属项目"
|
||||
v-model="form.projId"
|
||||
placeholder="请选择项目名称"
|
||||
style="width: 100%"
|
||||
filterable
|
||||
:disabled="disPro"
|
||||
@change="projectChage"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in projectOptions"
|
||||
:key="index"
|
||||
:label="item.projectName"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="发起单位">
|
||||
{{ deptName }}
|
||||
</el-form-item>
|
||||
<el-form-item label="发起人">
|
||||
{{ nickName }}
|
||||
</el-form-item>
|
||||
<el-form-item label="审批事项">
|
||||
<el-form-item label="申请类型">
|
||||
{{ title }}
|
||||
</el-form-item>
|
||||
<el-form-item label="审批内容" prop="files">
|
||||
<el-form-item label="申请人">
|
||||
<label
|
||||
>{{ nickName }}
|
||||
<el-tag type="info" size="mini">{{ deptName }}</el-tag></label
|
||||
>
|
||||
</el-form-item>
|
||||
<el-form-item label="申请原因" prop="applyReason">
|
||||
<el-input
|
||||
type="textarea"
|
||||
v-model="form.applyReason"
|
||||
placeholder="请输入申请原因"
|
||||
rows="3"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="附件说明" prop="applyFiles">
|
||||
<FileUpload
|
||||
@input="fileInput"
|
||||
:limit="9"
|
||||
v-model="form.files"
|
||||
v-model="form.applyFiles"
|
||||
:fileType="['pdf', 'png', 'jpg', 'jpeg', 'doc', 'docx', 'xls', 'xlsx']"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="申请说明" prop="remark">
|
||||
<el-divider content-position="left" style="margin-left"
|
||||
>申请明细信息</el-divider
|
||||
>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAddProProjectApplyDetail"
|
||||
>添加</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
@click="handleDeleteProProjectApplyDetail"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-table
|
||||
:data="proProjectApplyDetailList"
|
||||
:row-class-name="rowProProjectApplyDetailIndex"
|
||||
@selection-change="handleProProjectApplyDetailSelectionChange"
|
||||
ref="proProjectApplyDetail"
|
||||
>
|
||||
<el-table-column type="selection" width="50" align="center" />
|
||||
<el-table-column label="序号" align="center" prop="index" width="50" />
|
||||
<el-table-column align="center" prop="assetsId">
|
||||
<template slot="header" slot-scope="scope">
|
||||
<span class="required">申请明细</span>
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<el-select
|
||||
v-model="scope.row.assetsId"
|
||||
placeholder="请选择申请明细"
|
||||
filterable
|
||||
style="width: 100%"
|
||||
@change="selectAssetsId"
|
||||
>
|
||||
<el-option-group
|
||||
v-for="group in AssetsTypeOptions"
|
||||
:key="group.id"
|
||||
:label="group.name"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in group.childrenAssetsTypeList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-option-group>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="number" align="center" width="180">
|
||||
<template slot="header" slot-scope="scope">
|
||||
<span class="required">申请数量</span>
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<el-row>
|
||||
<el-col :span="12"
|
||||
><el-input v-model="scope.row.number" placeholder="数量"
|
||||
/></el-col>
|
||||
<el-col :span="12"
|
||||
><el-select
|
||||
v-model="scope.row.assetsUnit"
|
||||
placeholder="单位"
|
||||
filterable
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in getUnitOptions(scope.row.assetsId)"
|
||||
:key="index"
|
||||
:label="item"
|
||||
:value="item"
|
||||
>
|
||||
</el-option> </el-select
|
||||
></el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="showAssetsVersion"
|
||||
label="申请规格"
|
||||
align="center"
|
||||
prop="assetsVersion"
|
||||
width="180"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-input
|
||||
type="textarea"
|
||||
v-model="form.remark"
|
||||
placeholder="请输入申请说明"
|
||||
rows="5"
|
||||
v-model="scope.row.assetsVersion"
|
||||
placeholder="请输入申请规格"
|
||||
rows="2"
|
||||
maxlength="200"
|
||||
/>
|
||||
</el-form-item>
|
||||
<div style="text-align: center">
|
||||
<el-button type="primary" @click="submitForm">提交流程</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="useReason" align="center">
|
||||
<template slot="header" slot-scope="scope">
|
||||
<span class="required">使用说明</span>
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<el-input
|
||||
type="textarea"
|
||||
v-model="scope.row.useReason"
|
||||
placeholder="请输入申请规格"
|
||||
rows="2"
|
||||
maxlength="500"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div style="text-align: center; padding: 20px 0px">
|
||||
<el-button type="primary" @click="submitForm">提交申请</el-button>
|
||||
<el-button @click="doCanel">取 消</el-button>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -79,8 +281,11 @@
|
|||
import store from "@/store";
|
||||
import { definitionStart, flowXmlAndNode } from "@/api/flowable/definition";
|
||||
import { CustomViewer as BpmnViewer } from "@/components/customBpmn";
|
||||
import { findFormDatasByProcInsId } from "@/api/flowable/businessKey";
|
||||
import { complete, getNextFlowNodeByStart } from "@/api/flowable/todo";
|
||||
import { getProjectApply } from "@/api/project/projectApply";
|
||||
import { completeAndModify, getNextFlowNodeByStart } from "@/api/flowable/todo";
|
||||
import { findCommentByProcInsId } from "@/api/flowable/businessKey";
|
||||
import { findMyDeptProject } from "@/api/project/projectInfo";
|
||||
import { findAllByCategory } from "@/api/base/assetsType";
|
||||
|
||||
export default {
|
||||
components: {},
|
||||
|
@ -99,25 +304,30 @@
|
|||
title: "",
|
||||
// 表单参数
|
||||
form: {
|
||||
businessKey: "",
|
||||
projectName: "",
|
||||
files: "",
|
||||
remark: "",
|
||||
id: null,
|
||||
deptId: null,
|
||||
projId: 0,
|
||||
projName: null,
|
||||
parProjName: null,
|
||||
applyType: null,
|
||||
applyStatus: null,
|
||||
applyReason: null,
|
||||
applyFiles: null,
|
||||
applyUser: null,
|
||||
useTime: null,
|
||||
isDel: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
remark: null,
|
||||
},
|
||||
// 表单校验
|
||||
rules: {
|
||||
businessKey: [{ required: true, message: "请选择所属项目", trigger: "blur" }],
|
||||
files: [{ required: true, message: "请上传申请内容", trigger: "blur" }],
|
||||
remark: [
|
||||
{ required: false, message: "请输入申请说明", trigger: "blur" },
|
||||
{
|
||||
max: 500,
|
||||
message: "申请说明最多输入500字",
|
||||
trigger: "blur",
|
||||
projId: [{ required: true, message: "请选择项目名称", trigger: "blur" }],
|
||||
applyReason: [{ required: true, message: "请输入申请原因", trigger: "blur" }],
|
||||
},
|
||||
],
|
||||
},
|
||||
projectOptions: null,
|
||||
projectOptions: [],
|
||||
deptName: null,
|
||||
nickName: null,
|
||||
disPro: false,
|
||||
|
@ -126,6 +336,16 @@
|
|||
taskTitle: null,
|
||||
taskOpen: false,
|
||||
daterangeMarksTime: [],
|
||||
flowRecordList: [],
|
||||
showjd: true,
|
||||
labelStyle: { width: "160px" },
|
||||
initData: {},
|
||||
showAssetsVersion: false,
|
||||
proProjectApplyDetailList: [],
|
||||
// 子表选中数据
|
||||
checkedProProjectApplyDetail: [],
|
||||
AssetsTypeOptions: [],
|
||||
unitOptions: [],
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
|
@ -134,28 +354,59 @@
|
|||
mounted() {},
|
||||
beforeDestroy() {},
|
||||
methods: {
|
||||
// 项目选择
|
||||
projectChage(val) {
|
||||
let projectName = "";
|
||||
this.projectOptions.forEach((item) => {
|
||||
if ((item.id = val)) {
|
||||
projectName = item.projectName;
|
||||
return;
|
||||
// 查询和我相关的项目信息
|
||||
initMyProject() {
|
||||
// 获取项目列表的接口
|
||||
findMyDeptProject().then((response) => {
|
||||
if (response.code == 200) {
|
||||
this.projectOptions = response.data;
|
||||
}
|
||||
});
|
||||
this.form.projectName = projectName;
|
||||
},
|
||||
initCategoryAssetsType(val) {
|
||||
// 获取项目列表的接口
|
||||
findAllByCategory(val).then((response) => {
|
||||
if (response.code == 200 && response.data) {
|
||||
this.AssetsTypeOptions = response.data;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 项目选择
|
||||
projectChage(val) {
|
||||
this.$forceUpdate();
|
||||
for (let i = 0; i < this.projectOptions.length; i++) {
|
||||
if (this.projectOptions[i].id == val) {
|
||||
this.form.projName = this.projectOptions[i].name;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
},
|
||||
doCanel() {
|
||||
this.onOpen = false;
|
||||
},
|
||||
show(options) {
|
||||
this.options = options;
|
||||
this.onOpen = true;
|
||||
this.initMyProject();
|
||||
//物资设备类需要输入规格
|
||||
if (options.category == 1) {
|
||||
this.showAssetsVersion = true;
|
||||
} else {
|
||||
this.showAssetsVersion = false;
|
||||
}
|
||||
this.initCategoryAssetsType(options.category);
|
||||
this.title = options.procDefName;
|
||||
this.initFormDate(options.procInsId);
|
||||
flowXmlAndNode({ procInsId:options.procInsId, deployId: options.deployId }).then((res) => {
|
||||
this.form.applyType = options.category;
|
||||
this.form.parProjName = options.businessKeyParName;
|
||||
this.nickName = options.startUserName;
|
||||
this.deptName = options.startDeptName;
|
||||
this.onOpen = true;
|
||||
this.getFlowRecordList(options.procInsId, options.deployId);
|
||||
this.initFormDate(options.businessKey);
|
||||
flowXmlAndNode({ procInsId: options.procInsId, deployId: options.deployId }).then(
|
||||
(res) => {
|
||||
this.initFlowImage(res.data);
|
||||
});
|
||||
}
|
||||
);
|
||||
},
|
||||
async initFlowImage(data) {
|
||||
const self = this;
|
||||
|
@ -168,54 +419,84 @@
|
|||
// 自适应
|
||||
self.bpmnViewer.get("canvas").zoom("fit-viewport", "auto");
|
||||
if (data.nodeData !== undefined && data.nodeData.length > 0) {
|
||||
self.fillColor(data.nodeData)
|
||||
self.fillColor(data.nodeData);
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err.message, err.warnings);
|
||||
}
|
||||
},
|
||||
/** 流程表单数据 */
|
||||
initFormDate(procInsId, deployId) {
|
||||
this.projectOptions=[{id:this.options.businessKey,projectName:this.options.businessKeyName}];
|
||||
const params = {procInsId: procInsId}
|
||||
findFormDatasByProcInsId(params).then(res => {
|
||||
this.form = res.data;
|
||||
this.deptName = this.options.startDeptName;
|
||||
this.nickName = this.options.startUserName;
|
||||
this.form.taskId = this.options.taskId;
|
||||
this.form.taskName = this.options.taskName;
|
||||
this.form.userId = store.getters.userId;
|
||||
this.form.assignee = store.getters.name;
|
||||
this.form.procInsId = this.options.procInsId;
|
||||
this.form.instanceId = this.options.procInsId;
|
||||
}).catch(res => {
|
||||
this.$message.error("数据异常,请联系管理员...");
|
||||
})
|
||||
},
|
||||
fileInput(files) {
|
||||
let fileUrls = "";
|
||||
if (files.length > 0) {
|
||||
fileUrls = "";
|
||||
files.forEach((item) => {
|
||||
fileUrls += "," + item.url;
|
||||
initFormDate(businessKey) {
|
||||
getProjectApply(businessKey)
|
||||
.then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.initData = res.data;
|
||||
this.form.id = res.data.id;
|
||||
this.form.projId = res.data.projId;
|
||||
this.form.applyReason = res.data.applyReason;
|
||||
this.form.applyFiles = res.data.applyFiles;
|
||||
let applyDetailList = [];
|
||||
if (
|
||||
res.data.proProjectApplyDetailList &&
|
||||
res.data.proProjectApplyDetailList.length > 0
|
||||
) {
|
||||
for (let i = 0; i < res.data.proProjectApplyDetailList.length; i++) {
|
||||
this.selectAssetsId(res.data.proProjectApplyDetailList[i].assetsId);
|
||||
applyDetailList.push({
|
||||
index: i + 1,
|
||||
assetsId: res.data.proProjectApplyDetailList[i].assetsId,
|
||||
number: res.data.proProjectApplyDetailList[i].number,
|
||||
assetsUnit: res.data.proProjectApplyDetailList[i].assetsUnit,
|
||||
assetsVersion: res.data.proProjectApplyDetailList[i].assetsVersion,
|
||||
useReason: res.data.proProjectApplyDetailList[i].useReason,
|
||||
});
|
||||
fileUrls = fileUrls.substring(1);
|
||||
}
|
||||
this.form.files = fileUrls;
|
||||
this.proProjectApplyDetailList = applyDetailList;
|
||||
}
|
||||
} else {
|
||||
this.$message.error("数据异常,请联系管理员...");
|
||||
}
|
||||
})
|
||||
.catch((res) => {
|
||||
this.$message.error("数据异常,请联系管理员...");
|
||||
});
|
||||
},
|
||||
submitForm() {
|
||||
this.$refs["form"].validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true;
|
||||
this.form.variables={
|
||||
businessKey:this.form.businessKey,
|
||||
projectName:this.form.projectName,
|
||||
files:this.form.files,
|
||||
remark:this.form.remark,
|
||||
INITIATOR:this.form.INITIATOR
|
||||
if (this.proProjectApplyDetailList.length == 0) {
|
||||
this.$modal.msgWarning("请添加申请明细信息...");
|
||||
return false;
|
||||
}
|
||||
complete(this.form).then(res => {
|
||||
this.$store.dispatch('initMyTaskNum');
|
||||
for (let i = 0; i < this.proProjectApplyDetailList.length; i++) {
|
||||
if (!this.proProjectApplyDetailList[i].assetsId) {
|
||||
this.$modal.msgWarning("申请明细第 ”" + (i + 1) + "“行未选择...");
|
||||
return false;
|
||||
}
|
||||
if (!this.proProjectApplyDetailList[i].number) {
|
||||
this.$modal.msgWarning("申请明细第 ”" + (i + 1) + "“行数量未输入...");
|
||||
return false;
|
||||
}
|
||||
if (!this.proProjectApplyDetailList[i].assetsUnit) {
|
||||
this.$modal.msgWarning("申请明细第 ”" + (i + 1) + "“行单位未选择...");
|
||||
return false;
|
||||
}
|
||||
if (!this.proProjectApplyDetailList[i].useReason) {
|
||||
this.$modal.msgWarning("申请明细第 ”" + (i + 1) + "“行申请说明未输入...");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
this.form.proProjectApplyDetailList = this.proProjectApplyDetailList;
|
||||
let flowTaskVo = {
|
||||
taskId:this.options.taskId,
|
||||
instanceId:this.options.procInsId,
|
||||
instanceId:this.options.procInsId,
|
||||
comment:store.getters.name+" 重新修改并重新提交申请。",
|
||||
proProjectApply:this.form
|
||||
}
|
||||
this.loading = true;
|
||||
completeAndModify(flowTaskVo).then((res) => {
|
||||
this.$store.dispatch("initMyTaskNum");
|
||||
this.$modal.msgSuccess("任务提交成功");
|
||||
this.loading = false;
|
||||
//关闭并刷新列表
|
||||
|
@ -226,79 +507,285 @@
|
|||
},
|
||||
// 设置高亮颜色的
|
||||
fillColor(nodeData) {
|
||||
const canvas = this.bpmnViewer.get('canvas')
|
||||
this.bpmnViewer.getDefinitions().rootElements[0].flowElements.forEach(n => {
|
||||
const completeTask = nodeData.find(m => m.key === n.id)
|
||||
const todoTask = nodeData.find(m => !m.completed)
|
||||
const endTask = nodeData[nodeData.length - 1]
|
||||
if (n.$type === 'bpmn:UserTask') {
|
||||
const canvas = this.bpmnViewer.get("canvas");
|
||||
this.bpmnViewer.getDefinitions().rootElements[0].flowElements.forEach((n) => {
|
||||
const completeTask = nodeData.find((m) => m.key === n.id);
|
||||
const todoTask = nodeData.find((m) => !m.completed);
|
||||
const endTask = nodeData[nodeData.length - 1];
|
||||
if (n.$type === "bpmn:UserTask") {
|
||||
if (completeTask) {
|
||||
canvas.addMarker(n.id, completeTask.completed ? 'highlight' : 'highlight-todo')
|
||||
n.outgoing?.forEach(nn => {
|
||||
const targetTask = nodeData.find(m => m.key === nn.targetRef.id)
|
||||
canvas.addMarker(
|
||||
n.id,
|
||||
completeTask.completed ? "highlight" : "highlight-todo"
|
||||
);
|
||||
n.outgoing?.forEach((nn) => {
|
||||
const targetTask = nodeData.find((m) => m.key === nn.targetRef.id);
|
||||
if (targetTask) {
|
||||
if (todoTask && completeTask.key === todoTask.key && !todoTask.completed){
|
||||
canvas.addMarker(nn.id, todoTask.completed ? 'highlight' : 'highlight-todo')
|
||||
canvas.addMarker(nn.targetRef.id, todoTask.completed ? 'highlight' : 'highlight-todo')
|
||||
if (
|
||||
todoTask &&
|
||||
completeTask.key === todoTask.key &&
|
||||
!todoTask.completed
|
||||
) {
|
||||
canvas.addMarker(
|
||||
nn.id,
|
||||
todoTask.completed ? "highlight" : "highlight-todo"
|
||||
);
|
||||
canvas.addMarker(
|
||||
nn.targetRef.id,
|
||||
todoTask.completed ? "highlight" : "highlight-todo"
|
||||
);
|
||||
} else {
|
||||
canvas.addMarker(nn.id, targetTask.completed ? 'highlight' : 'highlight-todo')
|
||||
canvas.addMarker(nn.targetRef.id, targetTask.completed ? 'highlight' : 'highlight-todo')
|
||||
canvas.addMarker(
|
||||
nn.id,
|
||||
targetTask.completed ? "highlight" : "highlight-todo"
|
||||
);
|
||||
canvas.addMarker(
|
||||
nn.targetRef.id,
|
||||
targetTask.completed ? "highlight" : "highlight-todo"
|
||||
);
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
// 排他网关
|
||||
else if (n.$type === 'bpmn:ExclusiveGateway') {
|
||||
else if (n.$type === "bpmn:ExclusiveGateway") {
|
||||
if (completeTask) {
|
||||
canvas.addMarker(n.id, completeTask.completed ? 'highlight' : 'highlight-todo')
|
||||
n.outgoing?.forEach(nn => {
|
||||
const targetTask = nodeData.find(m => m.key === nn.targetRef.id)
|
||||
canvas.addMarker(
|
||||
n.id,
|
||||
completeTask.completed ? "highlight" : "highlight-todo"
|
||||
);
|
||||
n.outgoing?.forEach((nn) => {
|
||||
const targetTask = nodeData.find((m) => m.key === nn.targetRef.id);
|
||||
if (targetTask) {
|
||||
|
||||
canvas.addMarker(nn.id, targetTask.completed ? 'highlight' : 'highlight-todo')
|
||||
canvas.addMarker(nn.targetRef.id, targetTask.completed ? 'highlight' : 'highlight-todo')
|
||||
canvas.addMarker(
|
||||
nn.id,
|
||||
targetTask.completed ? "highlight" : "highlight-todo"
|
||||
);
|
||||
canvas.addMarker(
|
||||
nn.targetRef.id,
|
||||
targetTask.completed ? "highlight" : "highlight-todo"
|
||||
);
|
||||
}
|
||||
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
// 并行网关
|
||||
else if (n.$type === 'bpmn:ParallelGateway') {
|
||||
else if (n.$type === "bpmn:ParallelGateway") {
|
||||
if (completeTask) {
|
||||
canvas.addMarker(n.id, completeTask.completed ? 'highlight' : 'highlight-todo')
|
||||
n.outgoing?.forEach(nn => {
|
||||
const targetTask = nodeData.find(m => m.key === nn.targetRef.id)
|
||||
canvas.addMarker(
|
||||
n.id,
|
||||
completeTask.completed ? "highlight" : "highlight-todo"
|
||||
);
|
||||
n.outgoing?.forEach((nn) => {
|
||||
const targetTask = nodeData.find((m) => m.key === nn.targetRef.id);
|
||||
if (targetTask) {
|
||||
canvas.addMarker(nn.id, targetTask.completed ? 'highlight' : 'highlight-todo')
|
||||
canvas.addMarker(nn.targetRef.id, targetTask.completed ? 'highlight' : 'highlight-todo')
|
||||
canvas.addMarker(
|
||||
nn.id,
|
||||
targetTask.completed ? "highlight" : "highlight-todo"
|
||||
);
|
||||
canvas.addMarker(
|
||||
nn.targetRef.id,
|
||||
targetTask.completed ? "highlight" : "highlight-todo"
|
||||
);
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
else if (n.$type === 'bpmn:StartEvent') {
|
||||
n.outgoing.forEach(nn => {
|
||||
const completeTask = nodeData.find(m => m.key === nn.targetRef.id)
|
||||
} else if (n.$type === "bpmn:StartEvent") {
|
||||
n.outgoing.forEach((nn) => {
|
||||
const completeTask = nodeData.find((m) => m.key === nn.targetRef.id);
|
||||
if (completeTask) {
|
||||
canvas.addMarker(nn.id, 'highlight')
|
||||
canvas.addMarker(n.id, 'highlight')
|
||||
return
|
||||
canvas.addMarker(nn.id, "highlight");
|
||||
canvas.addMarker(n.id, "highlight");
|
||||
return;
|
||||
}
|
||||
})
|
||||
}
|
||||
else if (n.$type === 'bpmn:EndEvent') {
|
||||
});
|
||||
} else if (n.$type === "bpmn:EndEvent") {
|
||||
if (endTask.key === n.id && endTask.completed) {
|
||||
canvas.addMarker(n.id, 'highlight')
|
||||
return
|
||||
canvas.addMarker(n.id, "highlight");
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 项目申请明细序号 */
|
||||
rowProProjectApplyDetailIndex({ row, rowIndex }) {
|
||||
row.index = rowIndex + 1;
|
||||
},
|
||||
/** 项目申请明细添加按钮操作 */
|
||||
handleAddProProjectApplyDetail() {
|
||||
let obj = {};
|
||||
obj.superTypeId = "";
|
||||
obj.superTypeName = "";
|
||||
obj.typeId = "";
|
||||
obj.typeName = "";
|
||||
obj.assetsId = "";
|
||||
obj.assetsName = "";
|
||||
obj.assetsUnit = "";
|
||||
obj.number = "";
|
||||
obj.useTime = "";
|
||||
obj.useReason = "";
|
||||
obj.price = "";
|
||||
obj.totalPrice = "";
|
||||
obj.isDel = "";
|
||||
obj.remark = "";
|
||||
this.proProjectApplyDetailList.push(obj);
|
||||
},
|
||||
/** 项目申请明细删除按钮操作 */
|
||||
handleDeleteProProjectApplyDetail() {
|
||||
if (this.checkedProProjectApplyDetail.length == 0) {
|
||||
this.$modal.msgError("请先选择要删除的项目申请明细数据");
|
||||
} else {
|
||||
const proProjectApplyDetailList = this.proProjectApplyDetailList;
|
||||
const checkedProProjectApplyDetail = this.checkedProProjectApplyDetail;
|
||||
this.proProjectApplyDetailList = proProjectApplyDetailList.filter(function (
|
||||
item
|
||||
) {
|
||||
return checkedProProjectApplyDetail.indexOf(item.index) == -1;
|
||||
});
|
||||
}
|
||||
},
|
||||
/** 复选框选中数据 */
|
||||
handleProProjectApplyDetailSelectionChange(selection) {
|
||||
this.checkedProProjectApplyDetail = selection.map((item) => item.index);
|
||||
},
|
||||
selectAssetsId(val) {
|
||||
for (let i = 0; i < this.AssetsTypeOptions.length; i++) {
|
||||
for (
|
||||
let x = 0;
|
||||
x < this.AssetsTypeOptions[i].childrenAssetsTypeList.length;
|
||||
x++
|
||||
) {
|
||||
if (this.AssetsTypeOptions[i].childrenAssetsTypeList[x].id == val) {
|
||||
if (this.getUnitOptions(val) == null) {
|
||||
this.unitOptions.push({
|
||||
id: val,
|
||||
data: this.AssetsTypeOptions[i].childrenAssetsTypeList[x].unit.split(","),
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
getUnitOptions(val) {
|
||||
for (let i = 0; i < this.unitOptions.length; i++) {
|
||||
if (this.unitOptions[i].id == val) {
|
||||
return this.unitOptions[i].data;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
},
|
||||
setIcon(row) {
|
||||
if (row.endTime) {
|
||||
if (row.commentResult == "驳回") {
|
||||
return "el-icon-close";
|
||||
} else {
|
||||
return "el-icon-check";
|
||||
}
|
||||
} else {
|
||||
return "el-icon-time";
|
||||
}
|
||||
},
|
||||
setColor(row) {
|
||||
if (row.endTime) {
|
||||
if (row.commentResult == "驳回") {
|
||||
return "#f56c6c";
|
||||
} else {
|
||||
return "#2bc418";
|
||||
}
|
||||
} else {
|
||||
return "#b3bdbb";
|
||||
}
|
||||
},
|
||||
getSort(i) {
|
||||
let num = this.flowRecordList.length - i;
|
||||
if (num < 10) {
|
||||
num = "0" + num;
|
||||
}
|
||||
return num + ". ";
|
||||
},
|
||||
/** 流程流转记录 */
|
||||
getFlowRecordList(procInsId, deployId) {
|
||||
const that = this;
|
||||
const params = { procInsId: procInsId };
|
||||
findCommentByProcInsId(params)
|
||||
.then((res) => {
|
||||
that.flowRecordList = res.data;
|
||||
})
|
||||
.catch((res) => {
|
||||
this.$message.error("数据异常,请联系管理员...");
|
||||
});
|
||||
},
|
||||
getDeleteReason(val) {
|
||||
val = val.replace("Change activity to ", "");
|
||||
let flowRecordList = this.flowRecordList;
|
||||
for (let i = 0; i < flowRecordList.length; i++) {
|
||||
if (flowRecordList[i].taskDefKey == val) {
|
||||
return "驳回至" + flowRecordList[i].taskName;
|
||||
}
|
||||
}
|
||||
},
|
||||
getDurationDateStr(val) {
|
||||
// 计算出相差天数
|
||||
let days = Math.floor(val / (24 * 3600 * 1000));
|
||||
// 计算出小时数
|
||||
let leave1 = val % (24 * 3600 * 1000); // 计算天数后剩余的毫秒数
|
||||
let hours = Math.floor(leave1 / (3600 * 1000));
|
||||
// 计算相差分钟数
|
||||
let leave2 = leave1 % (3600 * 1000); // 计算小时数后剩余的毫秒数
|
||||
let minutes = Math.floor(leave2 / (60 * 1000));
|
||||
// 计算相差秒数
|
||||
let leave3 = leave2 % (60 * 1000); // 计算分钟数后剩余的毫秒数
|
||||
let seconds = Math.round(leave3 / 1000);
|
||||
if (days > 0) {
|
||||
if (days < 10) days = "0" + days;
|
||||
if (hours < 10) hours = "0" + hours;
|
||||
if (minutes < 10) minutes = "0" + minutes;
|
||||
if (seconds < 10) seconds = "0" + seconds;
|
||||
return days + "天" + hours + "小时" + minutes + "分钟" + seconds + "秒";
|
||||
}
|
||||
if (hours > 0) {
|
||||
if (hours < 10) hours = "0" + hours;
|
||||
if (minutes < 10) minutes = "0" + minutes;
|
||||
if (seconds < 10) seconds = "0" + seconds;
|
||||
return hours + "小时" + minutes + "分钟" + seconds + "秒";
|
||||
}
|
||||
if (minutes > 0) {
|
||||
if (minutes < 10) minutes = "0" + minutes;
|
||||
if (seconds < 10) seconds = "0" + seconds;
|
||||
return minutes + "分钟" + seconds + "秒";
|
||||
}
|
||||
if (seconds > 0) {
|
||||
if (seconds < 10) seconds = "0" + seconds;
|
||||
return seconds + "秒";
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.app-editTaskDrawer {
|
||||
.drawer {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding-left: 20px;
|
||||
padding-right: 20px;
|
||||
padding-bottom: 20px;
|
||||
.drawerLeft {
|
||||
width: 40%;
|
||||
min-width: 280px;
|
||||
height: 100%;
|
||||
float: left;
|
||||
border-right: 1px solid #dcdfe6;
|
||||
overflow-y: scroll;
|
||||
padding-right: 20px;
|
||||
}
|
||||
.drawerRight {
|
||||
width: 60%;
|
||||
min-width: 400px;
|
||||
height: 100%;
|
||||
float: left;
|
||||
padding-left: 20px;
|
||||
.bjs-powered-by {
|
||||
display: none !important;
|
||||
}
|
||||
|
@ -307,15 +794,16 @@
|
|||
height: 100px;
|
||||
position: absolute;
|
||||
z-index: 9999;
|
||||
top: 66px;
|
||||
top: 77px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.app-container{
|
||||
.containers {
|
||||
width: 100%;
|
||||
height: 150px;
|
||||
height: 100px;
|
||||
.canvas {
|
||||
width: 100%;
|
||||
height: 150px;
|
||||
height: 100px;
|
||||
}
|
||||
.panel {
|
||||
position: absolute;
|
||||
|
@ -329,17 +817,14 @@
|
|||
.el-form-item__label {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.djs-palette {
|
||||
left: 0px !important;
|
||||
top: 0px;
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
.djs-container svg {
|
||||
min-height: 150px;
|
||||
min-height: 100px;
|
||||
}
|
||||
|
||||
.highlight.djs-shape .djs-visual > :nth-child(1) {
|
||||
fill: green !important;
|
||||
stroke: green !important;
|
||||
|
@ -376,4 +861,3 @@
|
|||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -148,7 +148,7 @@
|
|||
<el-tag size="medium">v{{ scope.row.procDefVersion }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="提交时间" align="center" prop="createTime" width="160" />
|
||||
<el-table-column label="申请时间" align="center" prop="createTime" width="160" />
|
||||
<el-table-column label="流程状态" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.finishTime == null" size="mini">进行中</el-tag>
|
||||
|
@ -362,11 +362,11 @@
|
|||
rows="5"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<div style="text-align: right;">
|
||||
<el-button type="primary" @click="handleStopClick">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
<el-button @click="cancelStop">取 消</el-button>
|
||||
</div>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
<detailDrawer ref="detailDrawer"></detailDrawer>
|
||||
<editTaskDrawer ref="editTaskDrawer" :closeCallBack="getList"></editTaskDrawer>
|
||||
|
@ -417,6 +417,7 @@ export default {
|
|||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
stopOpen: false,
|
||||
src: "",
|
||||
definitionList: [],
|
||||
// 查询参数
|
||||
|
@ -511,6 +512,9 @@ export default {
|
|||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
cancelStop() {
|
||||
this.stopOpen = false;
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
|
@ -586,16 +590,6 @@ export default {
|
|||
this.$refs.initTaskDrawer.show(row);
|
||||
},
|
||||
/** 取消流程申请 */
|
||||
handleStop(row) {
|
||||
const params = {
|
||||
instanceId: row.procInsId,
|
||||
};
|
||||
stopProcess(params).then((res) => {
|
||||
this.$modal.msgSuccess(res.msg);
|
||||
this.getList();
|
||||
});
|
||||
},
|
||||
/** 取消流程申请 */
|
||||
handleStop(row) {
|
||||
this.form.taskId = row.taskId;
|
||||
this.form.userId = this.$store.getters.userId;
|
||||
|
|
|
@ -62,6 +62,7 @@
|
|||
<el-form-item label="附件说明" prop="applyFiles">
|
||||
<FileUpload
|
||||
:limit="9"
|
||||
v-model="form.applyFiles"
|
||||
:fileType="['pdf', 'png', 'jpg', 'jpeg', 'doc', 'docx', 'xls', 'xlsx']"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
@ -180,7 +181,7 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div style="text-align: center; margin: 20px 0px;">
|
||||
<div style="text-align: center; margin: 20px 0px">
|
||||
<el-button type="primary" @click="submitForm">提交申请</el-button>
|
||||
<el-button @click="doCanel">取 消</el-button>
|
||||
</div>
|
||||
|
@ -216,7 +217,7 @@ export default {
|
|||
form: {
|
||||
id: null,
|
||||
deptId: null,
|
||||
projId: null,
|
||||
projId: 0,
|
||||
projName: null,
|
||||
parProjName: null,
|
||||
applyType: null,
|
||||
|
@ -281,6 +282,7 @@ export default {
|
|||
},
|
||||
// 项目选择
|
||||
projectChage(val) {
|
||||
this.$forceUpdate();
|
||||
for (let i = 0; i < this.projectOptions.length; i++) {
|
||||
if (this.projectOptions[i].id == val) {
|
||||
this.form.projName = this.projectOptions[i].name;
|
||||
|
|
|
@ -68,7 +68,7 @@
|
|||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<!-- <el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
|
@ -82,7 +82,7 @@
|
|||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</el-row> -->
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
|
@ -90,21 +90,45 @@
|
|||
border
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column
|
||||
label="任务编号"
|
||||
label="项目单位"
|
||||
align="center"
|
||||
prop="taskId"
|
||||
prop="businessKeyParName"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column label="流程名称" align="center" prop="procDefName" />
|
||||
<el-table-column
|
||||
label="项目名称"
|
||||
align="center"
|
||||
prop="businessKeyName"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="流程名称"
|
||||
align="center"
|
||||
prop="procDefName"
|
||||
width="120"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column label="流程编号" align="center" width="80">
|
||||
<template slot-scope="scope">
|
||||
<label>{{ scope.row.taskId }}</label>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="流程类别" align="center" prop="category" width="180">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag
|
||||
:options="dict.type.sys_process_category"
|
||||
:value="scope.row.category"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="当前节点" align="center" prop="taskName" />
|
||||
<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">
|
||||
<el-table-column label="流程发起人" align="center" width="180">
|
||||
<template slot-scope="scope">
|
||||
<label
|
||||
>{{ scope.row.startUserName }}
|
||||
|
@ -112,7 +136,12 @@
|
|||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="接收时间" align="center" prop="createTime" width="180" />
|
||||
<el-table-column label="接收时间" align="center" prop="createTime" width="160" />
|
||||
<el-table-column label="处理耗时" align="center" prop="duration" width="150">
|
||||
<template slot-scope="scope">
|
||||
{{getDurationDate(scope.row.duration)}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
|
@ -133,6 +162,8 @@
|
|||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<approveDrawer ref="approveDrawer" :closeCallBack="getList"></approveDrawer>
|
||||
<editTaskDrawer ref="editTaskDrawer" :closeCallBack="getList"></editTaskDrawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -210,26 +241,20 @@ export default {
|
|||
this.queryParams.params["endDate"] = this.daterangeCheckTime[1];
|
||||
}
|
||||
//重新刷新代办任务
|
||||
this.$store.dispatch('initMyTaskNum');
|
||||
this.$store.dispatch("initMyTaskNum");
|
||||
myAwaitFlowTaskList(this.queryParams).then((response) => {
|
||||
this.todoList = response.data.records;
|
||||
this.total = response.data.total;
|
||||
this.todoList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 跳转到处理页面
|
||||
handleProcess(row) {
|
||||
this.$router.push({
|
||||
path: "/flowable/task/todo/detail/index",
|
||||
query: {
|
||||
procInsId: row.procInsId,
|
||||
executionId: row.executionId,
|
||||
deployId: row.deployId,
|
||||
taskId: row.taskId,
|
||||
taskName: row.taskName,
|
||||
startUser: row.startUserName + "-" + row.startDeptName,
|
||||
},
|
||||
});
|
||||
//if (row.taskName == "提交申请") {
|
||||
this.$refs.editTaskDrawer.show(row);
|
||||
//} else {
|
||||
// this.$refs.approveDrawer.show(row);
|
||||
//}
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
|
|
Loading…
Reference in New Issue