|
|
@@ -1,189 +1,154 @@
|
|
|
<template>
|
|
|
- <div class="app-container">
|
|
|
- <div class="filter-container">
|
|
|
- <el-checkbox v-model="listQuery.unfinished">任务未办结</el-checkbox>
|
|
|
- <el-checkbox v-model="listQuery.finished">任务已办结</el-checkbox>
|
|
|
- <el-checkbox v-model="listQuery.processUnfinished"
|
|
|
- >流程未办结</el-checkbox
|
|
|
- >
|
|
|
- <el-checkbox v-model="listQuery.processFinished">流程已办结</el-checkbox>
|
|
|
- </div>
|
|
|
- <div class="filter-container">
|
|
|
- <el-input
|
|
|
- v-model="listQuery.processInstanceId"
|
|
|
- placeholder="流程实例ID"
|
|
|
- style="width: 200px"
|
|
|
- class="filter-item"
|
|
|
- @keyup.enter.native="btnQuery"
|
|
|
- />
|
|
|
- <el-input
|
|
|
- v-model="listQuery.taskId"
|
|
|
- placeholder="任务ID"
|
|
|
- style="width: 200px"
|
|
|
- class="filter-item"
|
|
|
- @keyup.enter.native="btnQuery"
|
|
|
- />
|
|
|
- <el-input
|
|
|
- v-model="listQuery.taskName"
|
|
|
- placeholder="任务名称"
|
|
|
- style="width: 200px"
|
|
|
- class="filter-item"
|
|
|
- @keyup.enter.native="btnQuery"
|
|
|
- />
|
|
|
- <el-input
|
|
|
- v-model="listQuery.processInstanceBusinessKey"
|
|
|
- placeholder="业务主键"
|
|
|
- style="width: 200px"
|
|
|
- class="filter-item"
|
|
|
- @keyup.enter.native="btnQuery"
|
|
|
- />
|
|
|
- <el-input
|
|
|
- v-model="listQuery.taskAssignee"
|
|
|
- placeholder="执行人"
|
|
|
- style="width: 200px"
|
|
|
- class="filter-item"
|
|
|
- @keyup.enter.native="btnQuery"
|
|
|
- />
|
|
|
- <el-input
|
|
|
- v-model="listQuery.taskOwner"
|
|
|
- placeholder="所有人"
|
|
|
- style="width: 200px"
|
|
|
- class="filter-item"
|
|
|
- @keyup.enter.native="btnQuery"
|
|
|
- />
|
|
|
- <el-input
|
|
|
- v-model="listQuery.taskInvolvedUser"
|
|
|
- placeholder="干系人"
|
|
|
- style="width: 200px"
|
|
|
- class="filter-item"
|
|
|
- @keyup.enter.native="btnQuery"
|
|
|
- />
|
|
|
- <el-input
|
|
|
- v-model="listQuery.parentTaskId"
|
|
|
- placeholder="父任务ID"
|
|
|
- style="width: 200px"
|
|
|
- class="filter-item"
|
|
|
- @keyup.enter.native="btnQuery"
|
|
|
- />
|
|
|
- <el-date-picker
|
|
|
- v-model="listQuery.taskDueAfter"
|
|
|
- value-format="yyyy-MM-dd"
|
|
|
- placeholder="到期日开始"
|
|
|
- type="date"
|
|
|
- style="width: 200px"
|
|
|
- class="filter-item"
|
|
|
- ></el-date-picker>
|
|
|
- <el-date-picker
|
|
|
- v-model="listQuery.taskDueBefore"
|
|
|
- value-format="yyyy-MM-dd"
|
|
|
- placeholder="到期日结束"
|
|
|
- type="date"
|
|
|
- style="width: 200px"
|
|
|
- class="filter-item"
|
|
|
- ></el-date-picker>
|
|
|
- <el-date-picker
|
|
|
- v-model="listQuery.taskCreatedAfter"
|
|
|
- value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
- placeholder="创建时间开始"
|
|
|
- type="datetime"
|
|
|
- style="width: 200px"
|
|
|
- class="filter-item"
|
|
|
- ></el-date-picker>
|
|
|
- <el-date-picker
|
|
|
- v-model="listQuery.taskCreatedBefore"
|
|
|
- value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
- placeholder="创建时间结束"
|
|
|
- type="datetime"
|
|
|
- style="width: 200px"
|
|
|
- class="filter-item"
|
|
|
- ></el-date-picker>
|
|
|
- <el-date-picker
|
|
|
- v-model="listQuery.taskCompletedAfter"
|
|
|
- value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
- placeholder="完成时间开始"
|
|
|
- type="datetime"
|
|
|
- style="width: 200px"
|
|
|
- class="filter-item"
|
|
|
- ></el-date-picker>
|
|
|
- <el-date-picker
|
|
|
- v-model="listQuery.taskCompletedBefore"
|
|
|
- value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
- placeholder="完成时间结束"
|
|
|
- type="datetime"
|
|
|
- style="width: 200px"
|
|
|
- class="filter-item"
|
|
|
- />
|
|
|
- <el-dropdown
|
|
|
- split-button
|
|
|
- type="primary"
|
|
|
- class="filter-item"
|
|
|
- @click="btnQuery"
|
|
|
- >
|
|
|
- <i class="el-icon-search el-icon--left" />查询
|
|
|
- <el-dropdown-menu slot="dropdown">
|
|
|
- <el-dropdown-item icon="el-icon-zoom-out" @click.native="btnReset"
|
|
|
- >重置</el-dropdown-item
|
|
|
- >
|
|
|
- </el-dropdown-menu>
|
|
|
- </el-dropdown>
|
|
|
- </div>
|
|
|
- <el-table
|
|
|
- :data="records"
|
|
|
- ref="multipleTable"
|
|
|
- @selection-change="selectionChange"
|
|
|
- border
|
|
|
- fit
|
|
|
- highlight-current-row
|
|
|
- style="width: 100%"
|
|
|
- :cell-style="{ padding: '3px' }"
|
|
|
- >
|
|
|
- <el-table-column type="selection" align="center"> </el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="流程实例名称"
|
|
|
- prop="processInstanceName"
|
|
|
- align="center"
|
|
|
- >
|
|
|
- <template slot-scope="scope"
|
|
|
- ><span>{{ scope.row.processInstanceName }}</span></template
|
|
|
+ <div class="ele-body">
|
|
|
+ <el-card shadow="never">
|
|
|
+ <div class="filter-container">
|
|
|
+ <el-checkbox v-model="listQuery.unfinished">任务未办结</el-checkbox>
|
|
|
+ <el-checkbox v-model="listQuery.finished">任务已办结</el-checkbox>
|
|
|
+ <el-checkbox v-model="listQuery.processUnfinished"
|
|
|
+ >流程未办结</el-checkbox
|
|
|
>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="任务名称" prop="name" align="center">
|
|
|
- <template slot-scope="scope"
|
|
|
- ><span>{{ scope.row.name }}</span></template
|
|
|
+ <el-checkbox v-model="listQuery.processFinished"
|
|
|
+ >流程已办结</el-checkbox
|
|
|
>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="开始时间"
|
|
|
- prop="claimTime"
|
|
|
- align="center"
|
|
|
- width="165px"
|
|
|
- >
|
|
|
- <template slot-scope="scope"
|
|
|
- ><span>{{ scope.row.createTime }}</span></template
|
|
|
+ </div>
|
|
|
+ <div class="filter-container">
|
|
|
+ <el-input
|
|
|
+ v-model="listQuery.processInstanceId"
|
|
|
+ placeholder="流程实例ID"
|
|
|
+ style="width: 200px"
|
|
|
+ class="filter-item"
|
|
|
+ @keyup.enter.native="btnQuery"
|
|
|
+ />
|
|
|
+ <el-input
|
|
|
+ v-model="listQuery.taskId"
|
|
|
+ placeholder="任务ID"
|
|
|
+ style="width: 200px"
|
|
|
+ class="filter-item"
|
|
|
+ @keyup.enter.native="btnQuery"
|
|
|
+ />
|
|
|
+ <el-input
|
|
|
+ v-model="listQuery.taskName"
|
|
|
+ placeholder="任务名称"
|
|
|
+ style="width: 200px"
|
|
|
+ class="filter-item"
|
|
|
+ @keyup.enter.native="btnQuery"
|
|
|
+ />
|
|
|
+ <el-input
|
|
|
+ v-model="listQuery.processInstanceBusinessKey"
|
|
|
+ placeholder="业务主键"
|
|
|
+ style="width: 200px"
|
|
|
+ class="filter-item"
|
|
|
+ @keyup.enter.native="btnQuery"
|
|
|
+ />
|
|
|
+ <el-input
|
|
|
+ v-model="listQuery.taskAssignee"
|
|
|
+ placeholder="执行人"
|
|
|
+ style="width: 200px"
|
|
|
+ class="filter-item"
|
|
|
+ @keyup.enter.native="btnQuery"
|
|
|
+ />
|
|
|
+ <el-input
|
|
|
+ v-model="listQuery.taskOwner"
|
|
|
+ placeholder="所有人"
|
|
|
+ style="width: 200px"
|
|
|
+ class="filter-item"
|
|
|
+ @keyup.enter.native="btnQuery"
|
|
|
+ />
|
|
|
+ <el-input
|
|
|
+ v-model="listQuery.taskInvolvedUser"
|
|
|
+ placeholder="干系人"
|
|
|
+ style="width: 200px"
|
|
|
+ class="filter-item"
|
|
|
+ @keyup.enter.native="btnQuery"
|
|
|
+ />
|
|
|
+ <el-input
|
|
|
+ v-model="listQuery.parentTaskId"
|
|
|
+ placeholder="父任务ID"
|
|
|
+ style="width: 200px"
|
|
|
+ class="filter-item"
|
|
|
+ @keyup.enter.native="btnQuery"
|
|
|
+ />
|
|
|
+ <el-date-picker
|
|
|
+ v-model="listQuery.taskDueAfter"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ placeholder="到期日开始"
|
|
|
+ type="date"
|
|
|
+ style="width: 200px"
|
|
|
+ class="filter-item"
|
|
|
+ ></el-date-picker>
|
|
|
+ <el-date-picker
|
|
|
+ v-model="listQuery.taskDueBefore"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ placeholder="到期日结束"
|
|
|
+ type="date"
|
|
|
+ style="width: 200px"
|
|
|
+ class="filter-item"
|
|
|
+ ></el-date-picker>
|
|
|
+ <el-date-picker
|
|
|
+ v-model="listQuery.taskCreatedAfter"
|
|
|
+ value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
+ placeholder="创建时间开始"
|
|
|
+ type="datetime"
|
|
|
+ style="width: 200px"
|
|
|
+ class="filter-item"
|
|
|
+ ></el-date-picker>
|
|
|
+ <el-date-picker
|
|
|
+ v-model="listQuery.taskCreatedBefore"
|
|
|
+ value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
+ placeholder="创建时间结束"
|
|
|
+ type="datetime"
|
|
|
+ style="width: 200px"
|
|
|
+ class="filter-item"
|
|
|
+ ></el-date-picker>
|
|
|
+ <el-date-picker
|
|
|
+ v-model="listQuery.taskCompletedAfter"
|
|
|
+ value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
+ placeholder="完成时间开始"
|
|
|
+ type="datetime"
|
|
|
+ style="width: 200px"
|
|
|
+ class="filter-item"
|
|
|
+ ></el-date-picker>
|
|
|
+ <el-date-picker
|
|
|
+ v-model="listQuery.taskCompletedBefore"
|
|
|
+ value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
+ placeholder="完成时间结束"
|
|
|
+ type="datetime"
|
|
|
+ style="width: 200px"
|
|
|
+ class="filter-item"
|
|
|
+ />
|
|
|
+ <el-dropdown
|
|
|
+ split-button
|
|
|
+ type="primary"
|
|
|
+ class="filter-item"
|
|
|
+ @click="btnQuery"
|
|
|
>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="结束时间"
|
|
|
- prop="endTime"
|
|
|
- align="center"
|
|
|
- width="165px"
|
|
|
+ <i class="el-icon-search el-icon--left" />查询
|
|
|
+ <el-dropdown-menu slot="dropdown">
|
|
|
+ <el-dropdown-item icon="el-icon-zoom-out" @click.native="btnReset"
|
|
|
+ >重置</el-dropdown-item
|
|
|
+ >
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </el-dropdown>
|
|
|
+ </div>
|
|
|
+ <ele-pro-table
|
|
|
+ ref="table"
|
|
|
+ :columns="columns"
|
|
|
+ :datasource="datasource"
|
|
|
+ cache-key="systemRoleTable"
|
|
|
>
|
|
|
- <template slot-scope="scope"
|
|
|
- ><span>{{ scope.row.endTime }}</span></template
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="所有人" prop="owner" align="center">
|
|
|
- <template slot-scope="scope"
|
|
|
- ><span>{{ scope.row.owner }}</span></template
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="执行人" prop="assignee" align="center">
|
|
|
- <template slot-scope="scope"
|
|
|
- ><span>{{ scope.row.assignee }}</span></template
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="操作" align="center">
|
|
|
- <template slot-scope="{ row }">
|
|
|
+ <!-- 表头工具栏 -->
|
|
|
+ <template v-slot:toolbar>
|
|
|
+ <!-- <el-button
|
|
|
+ icon="el-icon-plus"
|
|
|
+ type="primary"
|
|
|
+ @click="btnImport"
|
|
|
+ class="ele-btn-icon"
|
|
|
+ >导入
|
|
|
+ </el-button> -->
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <!-- 操作列 -->
|
|
|
+ <template v-slot:action="{ row }">
|
|
|
<el-dropdown>
|
|
|
<span class="el-dropdown-link"
|
|
|
>操作<i class="el-icon-arrow-down el-icon--right"></i
|
|
|
@@ -201,32 +166,30 @@
|
|
|
>查看详情
|
|
|
</el-dropdown-item>
|
|
|
<el-dropdown-item
|
|
|
- v-permission="'flowable:task:execute'"
|
|
|
+ icon="el-icon-edit"
|
|
|
v-if="
|
|
|
- row.endTime == null &&
|
|
|
+ (row.endTime == null || row.endTime == '') &&
|
|
|
(row.assignee == null || row.assignee == '')
|
|
|
"
|
|
|
- icon="el-icon-edit"
|
|
|
divided
|
|
|
@click.native="btnClaim(row)"
|
|
|
>认领并执行
|
|
|
</el-dropdown-item>
|
|
|
<el-dropdown-item
|
|
|
- v-permission="'flowable:task:execute'"
|
|
|
+ icon="el-icon-edit"
|
|
|
v-if="
|
|
|
- row.endTime == null &&
|
|
|
- row.assignee === $store.getters.sysUser.userId
|
|
|
+ (row.endTime == null || row.endTime == '') &&
|
|
|
+ row.assignee == userId
|
|
|
"
|
|
|
- icon="el-icon-edit"
|
|
|
divided
|
|
|
@click.native="btnUnclaim(row)"
|
|
|
>取消认领
|
|
|
</el-dropdown-item>
|
|
|
<el-dropdown-item
|
|
|
v-if="
|
|
|
- row.endTime == null &&
|
|
|
- row.assignee != null &&
|
|
|
- row.assignee === $store.getters.sysUser.userId
|
|
|
+ (row.endTime == null || row.endTime == '') &&
|
|
|
+ (row.assignee != null || row.assignee != '') &&
|
|
|
+ row.assignee == userId
|
|
|
"
|
|
|
icon="el-icon-edit"
|
|
|
divided
|
|
|
@@ -237,15 +200,8 @@
|
|
|
</el-dropdown-menu>
|
|
|
</el-dropdown>
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- <pagination
|
|
|
- v-show="total > 0"
|
|
|
- :total="total"
|
|
|
- :current.sync="listQuery.current"
|
|
|
- :size.sync="listQuery.size"
|
|
|
- @pagination="list"
|
|
|
- />
|
|
|
+ </ele-pro-table>
|
|
|
+ </el-card>
|
|
|
<!-- 弹窗任务信息 -->
|
|
|
<task-detail
|
|
|
v-if="dialogTaskDetailVisible"
|
|
|
@@ -286,13 +242,78 @@
|
|
|
components: { Pagination, TaskDetail, ExecuteTask, ProcessDetail },
|
|
|
data() {
|
|
|
return {
|
|
|
+ columns: [
|
|
|
+ {
|
|
|
+ type: 'index',
|
|
|
+ label: '序号',
|
|
|
+ width: 50,
|
|
|
+ align: 'center',
|
|
|
+ fixed: 'left'
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ prop: 'processInstanceName',
|
|
|
+ label: '流程实例名称',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'name',
|
|
|
+ label: '任务名称',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'createTime',
|
|
|
+ label: '创建时间',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'claimTime',
|
|
|
+ label: '开始时间',
|
|
|
+ align: 'center',
|
|
|
+
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'endTime',
|
|
|
+ label: '结束时间',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'owner',
|
|
|
+ label: '所有人',
|
|
|
+ align: 'center',
|
|
|
+
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ prop: 'assignee',
|
|
|
+ label: '执行人',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ columnKey: 'action',
|
|
|
+ label: '操作',
|
|
|
+ width: 230,
|
|
|
+ align: 'center',
|
|
|
+ resizable: false,
|
|
|
+ slot: 'action',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+
|
|
|
dicts: [],
|
|
|
records: null,
|
|
|
selectedRecords: [],
|
|
|
total: 0,
|
|
|
+ userId: localStorage.getItem('userId'),
|
|
|
listQuery: {
|
|
|
- current: 1,
|
|
|
- size: 10,
|
|
|
processInstanceId: undefined,
|
|
|
taskId: undefined,
|
|
|
taskName: undefined,
|
|
|
@@ -362,19 +383,41 @@
|
|
|
dialogViewVisible: false
|
|
|
};
|
|
|
},
|
|
|
- created() {
|
|
|
- if (this.$route.query && this.$route.query.processInstanceId) {
|
|
|
- this.listQuery.processInstanceId = this.$route.query.processInstanceId;
|
|
|
+
|
|
|
+ watch: {
|
|
|
+ $route: {
|
|
|
+ handler(route) {
|
|
|
+ if (route.query && route.query.processInstanceId) {
|
|
|
+ this.listQuery.processInstanceId = route.query.processInstanceId;
|
|
|
+ } else {
|
|
|
+ this.listQuery.processInstanceId = undefined;
|
|
|
+ }
|
|
|
+ this.$refs.table?.reload({ page: 1 });
|
|
|
+ },
|
|
|
+ immediate: true
|
|
|
}
|
|
|
- this.list();
|
|
|
},
|
|
|
methods: {
|
|
|
- list() {
|
|
|
- getAction('/flowable/task/list', this.listQuery).then((res) => {
|
|
|
- const { data } = res;
|
|
|
- this.records = data.data.records;
|
|
|
- this.total = data.data.total;
|
|
|
+ async datasource({ page, limit }) {
|
|
|
+ const res = await getAction('/flowable/task/list', {
|
|
|
+ ...this.listQuery,
|
|
|
+ current: page,
|
|
|
+ size: limit
|
|
|
});
|
|
|
+ const { data } = res.data;
|
|
|
+ return {
|
|
|
+ list: data.records,
|
|
|
+ count: data.total
|
|
|
+ };
|
|
|
+ },
|
|
|
+ list() {
|
|
|
+ this.$refs.table.reload({ page: 1 });
|
|
|
+
|
|
|
+ // getAction('/flowable/task/list', this.listQuery).then((res) => {
|
|
|
+ // const { data } = res;
|
|
|
+ // this.records = data.data.records;
|
|
|
+ // this.total = data.data.total;
|
|
|
+ // });
|
|
|
},
|
|
|
btnQuery() {
|
|
|
this.listQuery.current = 1;
|
|
|
@@ -382,8 +425,6 @@
|
|
|
},
|
|
|
btnReset() {
|
|
|
this.listQuery = {
|
|
|
- current: 1,
|
|
|
- size: 10,
|
|
|
processInstanceId: undefined,
|
|
|
taskId: undefined,
|
|
|
taskName: undefined,
|
|
|
@@ -412,7 +453,7 @@
|
|
|
btnViewTask(row) {
|
|
|
getAction('/flowable/task/queryById', { taskId: row.id }).then(
|
|
|
(res) => {
|
|
|
- const { data } = res;
|
|
|
+ const { data } = res.data;
|
|
|
this.taskDetailData = Object.assign({}, data);
|
|
|
this.dialogTaskDetailVisible = true;
|
|
|
}
|
|
|
@@ -430,8 +471,8 @@
|
|
|
},
|
|
|
btnUnclaim(row) {
|
|
|
putAction('/flowable/task/unclaim', { taskId: row.id }).then(
|
|
|
- ({ msg }) => {
|
|
|
- Message.success(msg);
|
|
|
+ ({ data }) => {
|
|
|
+ Message.success(data.message);
|
|
|
this.list();
|
|
|
}
|
|
|
);
|