Merge branch 'master' into zjw
# Conflicts: # imt-ui/src/utils/dict.js
This commit is contained in:
commit
86c532fd07
@ -0,0 +1,49 @@
|
||||
package com.inspur.framework.common.util.date;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author xusd
|
||||
* @Date 2024/9/10 13:55
|
||||
**/
|
||||
public class DateMappingUtils {
|
||||
|
||||
/**
|
||||
* 将 LocalDateTime 转换成 Date
|
||||
*
|
||||
* @param date LocalDateTime
|
||||
* @return LocalDateTime
|
||||
*/
|
||||
public static Date of(LocalDateTime date) {
|
||||
if (date == null) {
|
||||
return null;
|
||||
}
|
||||
// 将此日期时间与时区相结合以创建 ZonedDateTime
|
||||
ZonedDateTime zonedDateTime = date.atZone(ZoneId.systemDefault());
|
||||
// 本地时间线 LocalDateTime 到即时时间线 Instant 时间戳
|
||||
Instant instant = zonedDateTime.toInstant();
|
||||
// UTC时间(世界协调时间,UTC + 00:00)转北京(北京,UTC + 8:00)时间
|
||||
return Date.from(instant);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将 Date 转换成 LocalDateTime
|
||||
*
|
||||
* @param date Date
|
||||
* @return LocalDateTime
|
||||
*/
|
||||
public static LocalDateTime of(Date date) {
|
||||
if (date == null) {
|
||||
return null;
|
||||
}
|
||||
// 转为时间戳
|
||||
Instant instant = date.toInstant();
|
||||
// UTC时间(世界协调时间,UTC + 00:00)转北京(北京,UTC + 8:00)时间
|
||||
return LocalDateTime.ofInstant(instant, ZoneId.systemDefault());
|
||||
}
|
||||
|
||||
}
|
@ -19,6 +19,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.flowable.bpmn.model.BpmnModel;
|
||||
import org.flowable.bpmn.model.UserTask;
|
||||
import org.flowable.engine.repository.Deployment;
|
||||
import org.flowable.engine.repository.Model;
|
||||
import org.flowable.engine.repository.ProcessDefinition;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@ -84,11 +85,15 @@ public class BpmProcessDefinitionController {
|
||||
return success(Collections.emptyList());
|
||||
}
|
||||
|
||||
// 获得 Category Map
|
||||
Map<String, BpmCategoryDO> categoryMap = categoryService.getCategoryMap(
|
||||
convertSet(list, ProcessDefinition::getCategory));
|
||||
|
||||
// 获得 BpmProcessDefinitionInfoDO Map
|
||||
Map<String, BpmProcessDefinitionInfoDO> processDefinitionMap = processDefinitionService.getProcessDefinitionInfoMap(
|
||||
convertSet(list, ProcessDefinition::getId));
|
||||
return success(BpmProcessDefinitionConvert.INSTANCE.buildProcessDefinitionList(
|
||||
list, null, processDefinitionMap, null, null));
|
||||
list, null, processDefinitionMap, null, categoryMap));
|
||||
}
|
||||
|
||||
@GetMapping ("/get")
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.inspur.module.bpm.convert.task;
|
||||
|
||||
import com.inspur.framework.common.util.date.DateUtils;
|
||||
import com.inspur.framework.common.util.date.DateMappingUtils;
|
||||
import com.inspur.module.bpm.controller.admin.task.vo.activity.BpmActivityRespVO;
|
||||
import org.flowable.engine.history.HistoricActivityInstance;
|
||||
import org.mapstruct.Mapper;
|
||||
@ -15,7 +15,7 @@ import java.util.List;
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper(uses = DateUtils.class)
|
||||
@Mapper(uses = DateMappingUtils.class)
|
||||
public interface BpmActivityConvert {
|
||||
|
||||
BpmActivityConvert INSTANCE = Mappers.getMapper(BpmActivityConvert.class);
|
||||
|
@ -42,6 +42,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/parser": "7.18.4",
|
||||
"@form-create/element-ui": "^2.5.19",
|
||||
"@riophae/vue-treeselect": "0.4.0",
|
||||
"axios": "0.27.2",
|
||||
"benz-amr-recorder": "^1.1.5",
|
||||
@ -49,6 +50,7 @@
|
||||
"clipboard": "2.0.8",
|
||||
"core-js": "^3.26.0",
|
||||
"crypto-js": "^4.0.0",
|
||||
"dayjs": "^1.11.13",
|
||||
"echarts": "5.4.0",
|
||||
"element-ui": "2.15.12",
|
||||
"file-saver": "2.0.5",
|
||||
|
@ -16,9 +16,10 @@ export function getProcessDefinitionList(query) {
|
||||
})
|
||||
}
|
||||
|
||||
export function getProcessDefinitionBpmnXML(id) {
|
||||
export function getProcessDefinitionBpmnXML(id,key) {
|
||||
return request({
|
||||
url: '/bpm/process-definition/get?id=' + id,
|
||||
method: 'get'
|
||||
url: '/bpm/process-definition/get',
|
||||
method: 'get',
|
||||
params: { id, key }
|
||||
})
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ export function createProcessInstance(data) {
|
||||
|
||||
export function cancelProcessInstance(id, reason) {
|
||||
return request({
|
||||
url: '/bpm/process-instance/cancel',
|
||||
url: '/bpm/process-instance/cancel-by-start-user',
|
||||
method: 'DELETE',
|
||||
data: {
|
||||
id,
|
||||
|
@ -64,7 +64,7 @@ export function getTaskListByProcessInstanceId(processInstanceId) {
|
||||
|
||||
export function getReturnList(taskId) {
|
||||
return request({
|
||||
url: '/bpm/task/return-list?taskId='+ taskId,
|
||||
url: '/bpm/task/list-by-return?id='+ taskId,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
@ -9,6 +9,7 @@
|
||||
<script>
|
||||
import BpmnViewer from "bpmn-js/lib/Viewer";
|
||||
import DefaultEmptyXML from "./plugins/defaultEmpty";
|
||||
import {DICT_TYPE, getDictDatas} from "@/utils/dict";
|
||||
|
||||
export default {
|
||||
name: "MyProcessViewer",
|
||||
@ -43,7 +44,6 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
this.xml = this.value;
|
||||
console.log(this.xml)
|
||||
this.activityList = this.activityData;
|
||||
// 初始化
|
||||
this.initBpmnModeler();
|
||||
@ -90,7 +90,6 @@ export default {
|
||||
let newName = `业务流程_${new Date().getTime()}`;
|
||||
let xmlString = xml || DefaultEmptyXML(newId, newName, this.prefix);
|
||||
try {
|
||||
// console.log(this.bpmnModeler.importXML);
|
||||
let { warnings } = await this.bpmnModeler.importXML(xmlString);
|
||||
if (warnings && warnings.length) {
|
||||
warnings.forEach(warn => console.warn(warn));
|
||||
@ -130,10 +129,10 @@ export default {
|
||||
return;
|
||||
}
|
||||
// 高亮任务
|
||||
canvas.addMarker(n.id, this.getResultCss(task.result));
|
||||
canvas.addMarker(n.id, this.getResultCss(task.status));
|
||||
|
||||
// 如果非通过,就不走后面的线条了
|
||||
if (task.result !== 2) {
|
||||
if (task.status !== 2) {
|
||||
return;
|
||||
}
|
||||
// 处理 outgoing 出线
|
||||
@ -297,9 +296,16 @@ export default {
|
||||
if (!task) {
|
||||
return;
|
||||
}
|
||||
let optionData = getDictDatas(DICT_TYPE.BPM_TASK_STATUS)
|
||||
let dataResult = ''
|
||||
optionData.forEach((element) => {
|
||||
if (element.value == task.status) {
|
||||
dataResult = element.label
|
||||
}
|
||||
})
|
||||
html = `<p>审批人:${task.assigneeUser.nickname}</p>
|
||||
<p>部门:${task.assigneeUser.deptName}</p>
|
||||
<p>结果:${this.getDictDataLabel(this.DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT, task.result)}</p>
|
||||
<p>结果:${dataResult}</p>
|
||||
<p>创建时间:${this.parseTime(task.createTime)}</p>`;
|
||||
if (task.endTime) {
|
||||
html += `<p>结束时间:${this.parseTime(task.endTime)}</p>`
|
||||
@ -316,7 +322,14 @@ export default {
|
||||
}
|
||||
console.log(html)
|
||||
} else if (element.type === 'bpmn:EndEvent' && this.processInstance) {
|
||||
html = `<p>结果:${this.getDictDataLabel(this.DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT, this.processInstance.result)}</p>`;
|
||||
let optionData = getDictDatas(DICT_TYPE.BPM_TASK_STATUS)
|
||||
let dataResult = ''
|
||||
optionData.forEach((element) => {
|
||||
if (element.value == processInstance.value.status) {
|
||||
dataResult = element.label
|
||||
}
|
||||
})
|
||||
html = `<p>结果:${dataResult}</p>`;
|
||||
if (this.processInstance.endTime) {
|
||||
html += `<p>结束时间:${this.parseTime(this.processInstance.endTime)}</p>`
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
import dayjs from 'dayjs'
|
||||
/**
|
||||
* 将毫秒,转换成时间字符串。例如说,xx 分钟
|
||||
*
|
||||
@ -40,6 +41,26 @@ export function betweenDay(date1, date2) {
|
||||
return Math.floor((date2.getTime() - date1.getTime()) / (24 * 3600 * 1000));
|
||||
}
|
||||
|
||||
/**
|
||||
* 时间日期转换
|
||||
* @param date 当前时间,new Date() 格式
|
||||
* @param format 需要转换的时间格式字符串
|
||||
* @description format 字符串随意,如 `YYYY-MM、YYYY-MM-DD`
|
||||
* @description format 季度:"YYYY-MM-DD HH:mm:ss QQQQ"
|
||||
* @description format 星期:"YYYY-MM-DD HH:mm:ss WWW"
|
||||
* @description format 几周:"YYYY-MM-DD HH:mm:ss ZZZ"
|
||||
* @description format 季度 + 星期 + 几周:"YYYY-MM-DD HH:mm:ss WWW QQQQ ZZZ"
|
||||
* @returns string
|
||||
*/
|
||||
export function formatDateToString(date){
|
||||
// 日期不存在,则返回空
|
||||
if (!date) {
|
||||
return ''
|
||||
}
|
||||
// 日期存在,则进行格式化
|
||||
return date ? dayjs(date).format('YYYY-MM-DD HH:mm:ss') : ''
|
||||
}
|
||||
|
||||
export function formatDate(date, fmt) {
|
||||
date = convertDate(date);
|
||||
const o = {
|
||||
@ -73,3 +94,30 @@ export function convertDate(date) {
|
||||
}
|
||||
return date;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将毫秒,转换成时间字符串。例如说,xx 分钟
|
||||
*
|
||||
* @param ms 毫秒
|
||||
* @returns {string} 字符串
|
||||
*/
|
||||
export function formatPast2(ms){
|
||||
const day = Math.floor(ms / (24 * 60 * 60 * 1000))
|
||||
const hour = Math.floor(ms / (60 * 60 * 1000) - day * 24)
|
||||
const minute = Math.floor(ms / (60 * 1000) - day * 24 * 60 - hour * 60)
|
||||
const second = Math.floor(ms / 1000 - day * 24 * 60 * 60 - hour * 60 * 60 - minute * 60)
|
||||
if (day > 0) {
|
||||
return day + ' 天' + hour + ' 小时 ' + minute + ' 分钟'
|
||||
}
|
||||
if (hour > 0) {
|
||||
return hour + ' 小时 ' + minute + ' 分钟'
|
||||
}
|
||||
if (minute > 0) {
|
||||
return minute + ' 分钟'
|
||||
}
|
||||
if (second > 0) {
|
||||
return second + ' 秒'
|
||||
} else {
|
||||
return 0 + ' 秒'
|
||||
}
|
||||
}
|
||||
|
@ -69,7 +69,8 @@ export const DICT_TYPE = {
|
||||
BPM_PROCESS_INSTANCE_RESULT: "bpm_process_instance_result",
|
||||
BPM_TASK_ASSIGN_SCRIPT: "bpm_task_assign_script",
|
||||
BPM_OA_LEAVE_TYPE: "bpm_oa_leave_type",
|
||||
BPM_TASK_CANDIDATE_STRATEGY: "bpm_task_candidate_strategy",
|
||||
BPM_TASK_CANDIDATE_STRATEGY: 'bpm_task_candidate_strategy',
|
||||
BPM_TASK_STATUS: 'bpm_task_status',
|
||||
|
||||
// ========== PAY 模块 ==========
|
||||
PAY_CHANNEL_WECHAT_VERSION: "pay_channel_wechat_version", // 微信渠道版本
|
||||
|
@ -44,11 +44,7 @@
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="流程分类" align="center" prop="category" width="100">
|
||||
<template v-slot="scope">
|
||||
<dict-tag :type="DICT_TYPE.BPM_MODEL_CATEGORY" :value="scope.row.category" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="流程分类" align="center" prop="categoryName" />
|
||||
<el-table-column label="表单信息" align="center" prop="formType" width="200">
|
||||
<template v-slot="scope">
|
||||
<el-button v-if="scope.row.formId" type="text" @click="handleFormDetail(scope.row)">
|
||||
@ -132,7 +128,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.id" label="流程分类" prop="category">
|
||||
<el-select v-model="form.category" placeholder="请选择流程分类" clearable style="width: 100%">
|
||||
<el-option v-for="item in categorySelect" :key="item.id" :label="item.name" :value="item.id"/>
|
||||
<el-option v-for="item in categorySelect" :key="item.code" :label="item.name" :value="item.code"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="流程描述" prop="description">
|
||||
|
@ -12,11 +12,7 @@
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="流程分类" align="center" prop="category" width="100">
|
||||
<template v-slot="scope">
|
||||
<dict-tag :type="DICT_TYPE.BPM_MODEL_CATEGORY" :value="scope.row.category" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="流程分类" align="center" prop="categoryName" />
|
||||
<el-table-column label="流程版本" align="center" prop="processDefinition.version" width="80">
|
||||
<template v-slot="scope">
|
||||
<el-tag size="medium" v-if="scope.row">v{{ scope.row.version }}</el-tag>
|
||||
@ -85,6 +81,8 @@ export default {
|
||||
fields: []
|
||||
},
|
||||
|
||||
startUserSelectAssignees:{},
|
||||
|
||||
// BPMN 数据
|
||||
showBpmnOpen: false,
|
||||
bpmnXML: null,
|
||||
@ -159,7 +157,8 @@ export default {
|
||||
const variables = params.values;
|
||||
createProcessInstance({
|
||||
processDefinitionId: this.selectProcessInstance.id,
|
||||
variables: variables
|
||||
variables: variables,
|
||||
startUserSelectAssignees:this.startUserSelectAssignees
|
||||
}).then(response => {
|
||||
this.$modal.msgSuccess("发起流程成功");
|
||||
// 关闭当前窗口
|
||||
|
@ -56,8 +56,19 @@
|
||||
<el-col :span="16" :offset="4">
|
||||
<div class="block">
|
||||
<el-timeline>
|
||||
<el-timeline-item v-for="(item, index) in tasks" :key="index"
|
||||
:icon="getTimelineItemIcon(item)" :type="getTimelineItemType(item)">
|
||||
<el-timeline-item
|
||||
v-if="processInstance.endTime"
|
||||
:type="getProcessInstanceTimelineItemType(processInstance)"
|
||||
>
|
||||
<p style="font-weight: 700">
|
||||
结束流程:在 {{ getFormatDate(processInstance.endTime) }} 结束
|
||||
<dict-tag
|
||||
:type="DICT_TYPE.BPM_PROCESS_INSTANCE_STATUS"
|
||||
:value="processInstance.status"
|
||||
/>
|
||||
</p>
|
||||
</el-timeline-item>
|
||||
<el-timeline-item v-for="(item, index) in tasks" :key="index" :type="getTaskTimelineItemType(item)">
|
||||
<p style="font-weight: 700">任务:{{ item.name }}</p>
|
||||
<el-card :body-style="{ padding: '10px' }">
|
||||
<label v-if="item.assigneeUser" style="font-weight: normal; margin-right: 30px;">
|
||||
@ -78,6 +89,12 @@
|
||||
</p>
|
||||
</el-card>
|
||||
</el-timeline-item>
|
||||
<el-timeline-item type="success">
|
||||
<p style="font-weight: 700">
|
||||
发起流程:【{{nickName}}】在
|
||||
{{ getFormatDate(processInstance.startTime) }} 发起【 {{ processInstance.name }} 】流程
|
||||
</p>
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
</div>
|
||||
</el-col>
|
||||
@ -128,13 +145,13 @@
|
||||
<!--退回流程-->
|
||||
<el-dialog title="退回流程" :visible.sync="returnOpen" width="40%" append-to-body>
|
||||
<el-form ref="formRef" v-loading="formLoading" :model="formData" :rules="formRules" label-width="110px">
|
||||
<el-form-item label="退回节点" prop="targetDefinitionKey">
|
||||
<el-select v-model="formData.targetDefinitionKey" clearable style="width: 100%">
|
||||
<el-form-item label="退回节点" prop="targetTaskDefinitionKey">
|
||||
<el-select v-model="formData.targetTaskDefinitionKey" clearable style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in returnList"
|
||||
:key="item.definitionKey"
|
||||
:key="item.taskDefinitionKey"
|
||||
:label="item.name"
|
||||
:value="item.definitionKey"
|
||||
:value="item.taskDefinitionKey"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@ -165,7 +182,7 @@ import {
|
||||
returnTask,
|
||||
updateTaskAssignee,
|
||||
} from "@/api/bpm/task";
|
||||
import {getDate} from "@/utils/dateUtils";
|
||||
import {formatDateToString,getDate,formatPast2} from "@/utils/dateUtils";
|
||||
import {listSimpleUsers} from "@/api/system/user";
|
||||
import {getActivityList} from "@/api/bpm/activity";
|
||||
import Vue from "vue";
|
||||
@ -178,6 +195,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
nickName:"",
|
||||
// 遮罩层
|
||||
processInstanceLoading: true,
|
||||
// 流程实例
|
||||
@ -192,11 +210,11 @@ export default {
|
||||
returnList: [],
|
||||
formData: {
|
||||
id: '',
|
||||
targetDefinitionKey: undefined,
|
||||
targetTaskDefinitionKey: undefined,
|
||||
reason: ''
|
||||
},
|
||||
formRules: {
|
||||
targetDefinitionKey: [{required: true, message: '必须选择回退节点', trigger: 'change'}],
|
||||
targetTaskDefinitionKey: [{required: true, message: '必须选择回退节点', trigger: 'change'}],
|
||||
reason: [{required: true, message: '回退理由不能为空', trigger: 'blur'}]
|
||||
},
|
||||
returnOpen: false,
|
||||
@ -256,6 +274,36 @@ export default {
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
getTaskTimelineItemType(item){
|
||||
if ([0, 1, 6, 7].includes(item.status)) {
|
||||
return 'primary'
|
||||
}
|
||||
if (item.status === 2) {
|
||||
return 'success'
|
||||
}
|
||||
if (item.status === 3) {
|
||||
return 'danger'
|
||||
}
|
||||
if (item.status === 4) {
|
||||
return 'info'
|
||||
}
|
||||
if (item.status === 5) {
|
||||
return 'warning'
|
||||
}
|
||||
return ''
|
||||
},
|
||||
getProcessInstanceTimelineItemType(item){
|
||||
if (item.status === 2) {
|
||||
return 'success'
|
||||
}
|
||||
if (item.status === 3) {
|
||||
return 'danger'
|
||||
}
|
||||
if (item.status === 4) {
|
||||
return 'warning'
|
||||
}
|
||||
return ''
|
||||
},
|
||||
/** 获得流程实例 */
|
||||
getDetail() {
|
||||
// 获得流程实例相关
|
||||
@ -268,6 +316,8 @@ export default {
|
||||
// 设置流程信息
|
||||
this.processInstance = response.data;
|
||||
|
||||
this.nickName = response.data.startUser.nickname;
|
||||
|
||||
//将业务表单,注册为动态组件
|
||||
const path = this.processInstance.processDefinition.formCustomViewPath;
|
||||
Vue.component("async-biz-form-component", function (resolve) {
|
||||
@ -290,10 +340,9 @@ export default {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 加载流程图
|
||||
getProcessDefinitionBpmnXML(this.processInstance.processDefinition.id).then(response => {
|
||||
this.bpmnXML = response.data
|
||||
getProcessDefinitionBpmnXML(this.processInstance.processDefinitionId).then(response => {
|
||||
this.bpmnXML = response.data.bpmnXml
|
||||
});
|
||||
// 加载活动列表
|
||||
getActivityList({
|
||||
@ -315,7 +364,7 @@ export default {
|
||||
this.tasks = [];
|
||||
// 移除已取消的审批
|
||||
response.data.forEach(task => {
|
||||
if (task.result !== 4) {
|
||||
if (task.status !== 4) {
|
||||
this.tasks.push(task);
|
||||
}
|
||||
});
|
||||
@ -337,7 +386,7 @@ export default {
|
||||
// 需要审核的记录
|
||||
const userId = store.getters.userId;
|
||||
this.tasks.forEach(task => {
|
||||
if (task.result !== 1 && task.result !== 6) { // 只有待处理才需要
|
||||
if (task.status !== 1 && task.status !== 6) { // 只有待处理才需要
|
||||
return;
|
||||
}
|
||||
if (!task.assigneeUser || task.assigneeUser.id !== userId) { // 自己不是处理人
|
||||
@ -353,6 +402,12 @@ export default {
|
||||
this.tasksLoad = false;
|
||||
});
|
||||
},
|
||||
getFormatPast2(ms){
|
||||
return formatPast2(ms);
|
||||
},
|
||||
getFormatDate(date){
|
||||
return formatDateToString(date);
|
||||
},
|
||||
getDateStar(ms) {
|
||||
return getDate(ms);
|
||||
},
|
||||
@ -504,7 +559,7 @@ export default {
|
||||
},
|
||||
/** 提交退回任务 */
|
||||
submitReturn() {
|
||||
if (!this.formData.targetDefinitionKey) {
|
||||
if (!this.formData.targetTaskDefinitionKey) {
|
||||
this.$modal.msgError("请选择退回节点!");
|
||||
}
|
||||
this.$refs['formRef'].validate(valid => {
|
||||
|
@ -12,25 +12,19 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="流程分类" prop="category">
|
||||
<el-select v-model="queryParams.category" placeholder="请选择流程分类" clearable>
|
||||
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.BPM_MODEL_CATEGORY)"
|
||||
:key="dict.value" :label="dict.label" :value="dict.value"/>
|
||||
<el-option v-for="item in categoryList"
|
||||
:key="item.code" :label="item.name" :value="item.code"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="提交时间" prop="createTime">
|
||||
<el-date-picker v-model="queryParams.createTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
|
||||
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
|
||||
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.BPM_PROCESS_INSTANCE_STATUS)"
|
||||
:key="dict.value" :label="dict.label" :value="dict.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="结果" prop="result">
|
||||
<el-select v-model="queryParams.result" placeholder="请选择流结果" clearable>
|
||||
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT)"
|
||||
:key="dict.value" :label="dict.label" :value="dict.value"/>
|
||||
</el-select>
|
||||
<el-form-item label="发起时间" prop="createTime">
|
||||
<el-date-picker v-model="queryParams.createTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
|
||||
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
@ -51,14 +45,10 @@
|
||||
<el-table v-loading="loading" :data="list">
|
||||
<el-table-column label="编号" align="center" prop="id" width="320" />
|
||||
<el-table-column label="流程名" align="center" prop="name" />
|
||||
<el-table-column label="流程分类" align="center" prop="category">
|
||||
<template v-slot="scope">
|
||||
<dict-tag :type="DICT_TYPE.BPM_MODEL_CATEGORY" :value="scope.row.category" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="流程分类" align="center" prop="categoryName"/>
|
||||
<el-table-column label="当前审批任务" align="center" prop="tasks">
|
||||
<template v-slot="scope">
|
||||
<el-button v-for="task in scope.row.tasks" :key="task.id" type="text"">
|
||||
<el-button v-for="task in scope.row.tasks" :key="task.id" type="text">
|
||||
<span>{{ task.name }}</span>
|
||||
</el-button>
|
||||
</template>
|
||||
@ -68,14 +58,9 @@
|
||||
<dict-tag :type="DICT_TYPE.BPM_PROCESS_INSTANCE_STATUS" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="结果" align="center" prop="result">
|
||||
<el-table-column label="发起时间" align="center" prop="createTime" width="180">
|
||||
<template v-slot="scope">
|
||||
<dict-tag :type="DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT" :value="scope.row.result"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="提交时间" align="center" prop="createTime" width="180">
|
||||
<template v-slot="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
<span>{{ parseTime(scope.row.startTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="结束时间" align="center" prop="createTime" width="180">
|
||||
@ -83,9 +68,14 @@
|
||||
<span>{{ parseTime(scope.row.endTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="耗时" align="center" prop="durationInMillis" width="160">
|
||||
<template #default="scope">
|
||||
{{ scope.row.durationInMillis > 0 ? pastFormat(scope.row.durationInMillis) : '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template v-slot="scope">
|
||||
<el-button type="text" size="small" icon="el-icon-delete" v-if="scope.row.result === 1"
|
||||
<el-button type="text" size="small" icon="el-icon-delete" v-if="scope.row.status === 1"
|
||||
v-hasPermi="['bpm:process-instance:cancel']" @click="handleCancel(scope.row)">取消</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleDetail(scope.row)"
|
||||
v-hasPermi="['bpm:process-instance:query']">详情</el-button>
|
||||
@ -101,6 +91,8 @@
|
||||
|
||||
<script>
|
||||
import { getMyProcessInstancePage, cancelProcessInstance } from "@/api/bpm/processInstance";
|
||||
import {getCategorySelect} from '@/api/bpm/category'
|
||||
import { formatPast2 } from '@/utils/dateUtils'
|
||||
|
||||
export default {
|
||||
name: "BpmProcessInstance",
|
||||
@ -108,6 +100,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
categoryList:[],
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 显示搜索条件
|
||||
@ -131,11 +124,17 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
getCategorySelect().then(res=>{
|
||||
this.categoryList = res.data;
|
||||
})
|
||||
},
|
||||
activated() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
pastFormat(ms){
|
||||
return formatPast2(ms);
|
||||
},
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="流程名" prop="name">
|
||||
<el-form-item label="任务名称" prop="name">
|
||||
<el-input v-model="queryParams.name" placeholder="请输入流程名" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
@ -19,13 +19,13 @@
|
||||
|
||||
<!-- 列表 -->
|
||||
<el-table v-loading="loading" :data="list">
|
||||
<el-table-column label="任务编号" align="center" prop="id" width="320" fixed />
|
||||
<el-table-column label="任务名称" align="center" prop="name" width="200" />
|
||||
<el-table-column label="任务编号" align="center" prop="id" width="320" fixed/>
|
||||
<el-table-column label="任务名称" align="center" prop="name" width="200" fixed/>
|
||||
<el-table-column label="所属流程" align="center" prop="processInstance.name" width="200" />
|
||||
<el-table-column label="流程发起人" align="center" prop="processInstance.startUserNickname" width="120" />
|
||||
<el-table-column label="结果" align="center" prop="result">
|
||||
<el-table-column label="流程发起人" align="center" prop="processInstance.startUser.nickname" width="120" />
|
||||
<el-table-column label="审批状态" align="center" prop="status">
|
||||
<template v-slot="scope">
|
||||
<dict-tag :type="DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT" :value="scope.row.result"/>
|
||||
<dict-tag :type="DICT_TYPE.BPM_TASK_STATUS" :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="审批意见" align="center" prop="reason" width="200" />
|
||||
@ -61,9 +61,15 @@
|
||||
<script>
|
||||
import {getDoneTaskPage} from '@/api/bpm/task'
|
||||
import {getDate} from "@/utils/dateUtils";
|
||||
import {DICT_TYPE} from "@/utils/dict";
|
||||
|
||||
export default {
|
||||
name: "BpmDoneTask",
|
||||
computed: {
|
||||
DICT_TYPE() {
|
||||
return DICT_TYPE
|
||||
}
|
||||
},
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
|
@ -4,10 +4,10 @@
|
||||
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="流程名" prop="name">
|
||||
<el-input v-model="queryParams.name" placeholder="请输入流程名" clearable @keyup.enter.native="handleQuery"/>
|
||||
<el-form-item label="任务名称" prop="name">
|
||||
<el-input v-model="queryParams.name" placeholder="请输入任务名称" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-form-item label="发起时间" prop="createTime">
|
||||
<el-date-picker v-model="queryParams.createTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
|
||||
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
|
||||
</el-form-item>
|
||||
@ -19,21 +19,15 @@
|
||||
|
||||
<!-- 列表 -->
|
||||
<el-table v-loading="loading" :data="list">
|
||||
<el-table-column label="任务编号" align="center" prop="id" width="320" />
|
||||
<el-table-column label="任务名称" align="center" prop="name" />
|
||||
<el-table-column label="所属流程" align="center" prop="processInstance.name" />
|
||||
<el-table-column label="流程发起人" align="center" prop="processInstance.startUserNickname" />
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||
<el-table-column align="center" label="流程" prop="processInstance.name"/>
|
||||
<el-table-column label="任务编号" align="center" prop="id"/>
|
||||
<el-table-column label="当前任务" align="center" prop="name" />
|
||||
<el-table-column label="流程发起人" align="center" prop="processInstance.startUser.nickname" />
|
||||
<el-table-column label="发起时间" align="center" prop="createTime">
|
||||
<template v-slot="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" prop="version" width="80">
|
||||
<template v-slot="scope">
|
||||
<el-tag type="success" v-if="scope.row.suspensionState === 1">激活</el-tag>
|
||||
<el-tag type="warning" v-if="scope.row.suspensionState === 2">挂起</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template v-slot="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleAudit(scope.row)"
|
||||
|
Loading…
Reference in New Issue
Block a user