|
|
@@ -1,147 +1,73 @@
|
|
|
<template>
|
|
|
<div class="ele-body">
|
|
|
<el-card shadow="never">
|
|
|
- <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.taskName"
|
|
|
- placeholder="任务名称"
|
|
|
- style="width: 200px"
|
|
|
- class="filter-item"
|
|
|
- @keyup.enter.native="btnQuery"
|
|
|
- />
|
|
|
- <el-input
|
|
|
- v-model="listQuery.processInstanceBusinessKey"
|
|
|
- placeholder="业务主键Key"
|
|
|
- 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-dropdown
|
|
|
- split-button
|
|
|
- type="primary"
|
|
|
- @click="btnQuery"
|
|
|
- class="filter-item"
|
|
|
- >
|
|
|
- <i class="el-icon-search el-icon--left"></i>查询
|
|
|
- <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"
|
|
|
- border
|
|
|
- fit
|
|
|
- highlight-current-row
|
|
|
- style="width: 100%"
|
|
|
- :cell-style="{ padding: '3px' }"
|
|
|
+ <todo-search @search="reload" />
|
|
|
+
|
|
|
+ <ele-pro-table
|
|
|
+ ref="table"
|
|
|
+ :columns="columns"
|
|
|
+ :datasource="datasource"
|
|
|
+ cache-key="systemRoleTable"
|
|
|
>
|
|
|
- <el-table-column
|
|
|
- label="流程实例名称"
|
|
|
- prop="processInstanceName"
|
|
|
- align="center"
|
|
|
- >
|
|
|
- <template slot-scope="scope"
|
|
|
- ><span>{{ scope.row.processInstanceName }}</span></template
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="任务名称" prop="name" align="center">
|
|
|
- <template slot-scope="scope"
|
|
|
- ><span>{{ scope.row.name }}</span></template
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="开始时间"
|
|
|
- prop="createTime"
|
|
|
- align="center"
|
|
|
- width="165px"
|
|
|
- >
|
|
|
- <template slot-scope="scope"
|
|
|
- ><span>{{ scope.row.createTime }}</span></template
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="到期日期" prop="dueDate" align="center">
|
|
|
- <template slot-scope="scope"
|
|
|
- ><span>{{ scope.row.dueDate }}</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 }">
|
|
|
- <el-dropdown>
|
|
|
- <span class="el-dropdown-link"
|
|
|
- >操作<i class="el-icon-arrow-down el-icon--right"></i
|
|
|
- ></span>
|
|
|
- <el-dropdown-menu slot="dropdown">
|
|
|
- <el-dropdown-item
|
|
|
- icon="el-icon-view"
|
|
|
- @click.native="btnView(row.processInstanceId)"
|
|
|
- >查看详情
|
|
|
- </el-dropdown-item>
|
|
|
- <el-dropdown-item
|
|
|
- v-if="row.assignee == null || row.assignee == ''"
|
|
|
- icon="el-icon-edit"
|
|
|
- divided
|
|
|
- @click.native="btnClaim(row)"
|
|
|
- >认领并执行
|
|
|
- </el-dropdown-item>
|
|
|
- <!-- v-if="
|
|
|
+ <!-- 表头工具栏 -->
|
|
|
+ <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
|
|
|
+ ></span>
|
|
|
+ <el-dropdown-menu slot="dropdown">
|
|
|
+ <el-dropdown-item
|
|
|
+ icon="el-icon-view"
|
|
|
+ @click.native="btnView(row.processInstanceId)"
|
|
|
+ >查看详情
|
|
|
+ </el-dropdown-item>
|
|
|
+ <el-dropdown-item
|
|
|
+ v-if="row.assignee == null || row.assignee == ''"
|
|
|
+ icon="el-icon-edit"
|
|
|
+ divided
|
|
|
+ @click.native="btnClaim(row)"
|
|
|
+ >认领并执行
|
|
|
+ </el-dropdown-item>
|
|
|
+ <!-- v-if="
|
|
|
row.assignee === $store.getters.sysUser.userId &&
|
|
|
row.endTime == null
|
|
|
" -->
|
|
|
- <el-dropdown-item
|
|
|
- icon="el-icon-edit"
|
|
|
- divided
|
|
|
- @click.native="btnUnclaim(row)"
|
|
|
- >取消签收
|
|
|
- </el-dropdown-item>
|
|
|
- <el-dropdown-item
|
|
|
- icon="el-icon-edit"
|
|
|
- divided
|
|
|
- @click.native="btnExcuteTask(row)"
|
|
|
- >执行
|
|
|
- </el-dropdown-item>
|
|
|
- </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"
|
|
|
- />
|
|
|
+ <el-dropdown-item
|
|
|
+ icon="el-icon-edit"
|
|
|
+ v-if="
|
|
|
+ (row.endTime == null || row.endTime == '') &&
|
|
|
+ row.assignee == userId
|
|
|
+ "
|
|
|
+ divided
|
|
|
+ @click.native="btnUnclaim(row)"
|
|
|
+ >取消签收
|
|
|
+ </el-dropdown-item>
|
|
|
+ <el-dropdown-item
|
|
|
+ icon="el-icon-edit"
|
|
|
+ v-if="
|
|
|
+ (row.endTime == null || row.endTime == '') &&
|
|
|
+ (row.assignee != null || row.assignee != '') &&
|
|
|
+ row.assignee == userId
|
|
|
+ "
|
|
|
+ divided
|
|
|
+ @click.native="btnExcuteTask(row)"
|
|
|
+ >执行
|
|
|
+ </el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </el-dropdown>
|
|
|
+ </template>
|
|
|
+ </ele-pro-table>
|
|
|
</el-card>
|
|
|
|
|
|
<!-- 执行任务 -->
|
|
|
@@ -160,7 +86,6 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import Pagination from '@/components/Pagination';
|
|
|
import {
|
|
|
deleteAction,
|
|
|
getAction,
|
|
|
@@ -170,20 +95,75 @@
|
|
|
import { Message } from 'element-ui';
|
|
|
import ExecuteTask from '../components/ExecuteTask';
|
|
|
import ProcessDetail from '../components/ProcessDetail';
|
|
|
+ import TodoSearch from '@/views/flowable/taskTodo/todo-search';
|
|
|
|
|
|
export default {
|
|
|
name: 'FlowableTaskTodo',
|
|
|
- components: { Pagination, ExecuteTask, ProcessDetail },
|
|
|
+ components: { ExecuteTask, ProcessDetail, TodoSearch },
|
|
|
data() {
|
|
|
return {
|
|
|
- dicts: [],
|
|
|
- records: null,
|
|
|
- selectedRecords: [],
|
|
|
- total: 0,
|
|
|
+ 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: 'dueDate',
|
|
|
+ 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
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ userId: localStorage.getItem('userId'),
|
|
|
+
|
|
|
listQuery: {
|
|
|
- current: 1,
|
|
|
- size: 10,
|
|
|
- processInstanceId: undefined,
|
|
|
taskName: undefined,
|
|
|
processInstanceBusinessKey: undefined,
|
|
|
taskDueAfter: undefined,
|
|
|
@@ -196,51 +176,62 @@
|
|
|
dialogViewVisible: false
|
|
|
};
|
|
|
},
|
|
|
- created() {
|
|
|
- this.list();
|
|
|
- console.log(this.$store.getters);
|
|
|
- },
|
|
|
+
|
|
|
methods: {
|
|
|
- list() {
|
|
|
- getAction('/flowable/task/listTodo', this.listQuery).then((res) => {
|
|
|
- const { data } = res;
|
|
|
- console.log(data);
|
|
|
- this.records = data.data.records;
|
|
|
- this.total = data.data.total;
|
|
|
+ async datasource({ page, limit, where }) {
|
|
|
+ const res = await getAction('/flowable/task/listTodo', {
|
|
|
+ ...where,
|
|
|
+ current: page,
|
|
|
+ size: limit
|
|
|
});
|
|
|
+ const { data } = res.data;
|
|
|
+ return {
|
|
|
+ list: data.records,
|
|
|
+ count: data.total
|
|
|
+ };
|
|
|
+ },
|
|
|
+ reload(where) {
|
|
|
+ this.$refs.table.reload({ page: 1, where });
|
|
|
},
|
|
|
+ // list() {
|
|
|
+ // this.$refs.table.reload({ page: 1 });
|
|
|
+
|
|
|
+ // getAction('/flowable/task/listTodo', this.listQuery).then((res) => {
|
|
|
+ // const { data } = res;
|
|
|
+ // console.log(data);
|
|
|
+ // this.records = data.data.records;
|
|
|
+ // this.total = data.data.total;
|
|
|
+ // });
|
|
|
+ // },
|
|
|
btnQuery() {
|
|
|
this.listQuery.current = 1;
|
|
|
- this.list();
|
|
|
+ this.reload();
|
|
|
},
|
|
|
btnReset() {
|
|
|
this.listQuery = {
|
|
|
- current: 1,
|
|
|
- size: 10,
|
|
|
- processInstanceId: undefined,
|
|
|
taskName: undefined,
|
|
|
processInstanceBusinessKey: undefined,
|
|
|
taskDueAfter: undefined,
|
|
|
taskDueBefore: undefined
|
|
|
};
|
|
|
- this.list();
|
|
|
+ this.reload();
|
|
|
},
|
|
|
btnClaim(row) {
|
|
|
putAction('/flowable/task/claim', { taskId: row.id })
|
|
|
.then(({ data }) => {
|
|
|
Message.success('认领' + data.message + ',请编辑执行');
|
|
|
- this.list();
|
|
|
+ this.reload();
|
|
|
this.btnExcuteTask(row);
|
|
|
})
|
|
|
.catch((response) => {
|
|
|
- this.list();
|
|
|
+ this.reload();
|
|
|
});
|
|
|
},
|
|
|
btnUnclaim(row) {
|
|
|
putAction('/flowable/task/unclaim', { taskId: row.id }).then(
|
|
|
({ data }) => {
|
|
|
Message.success(data.message);
|
|
|
- this.list();
|
|
|
+ this.reload();
|
|
|
}
|
|
|
);
|
|
|
},
|