zhanghua
2024-11-21 ca0c92a05c8be10ada67ed30aa71e9a3037b3db1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
<template>
    <div>
        <div class="search-bar">
            <div>
                <label>流程名称</label>
                <el-input v-model="searchParams.processName" size="small"></el-input>
            </div>
            <div>
                <label>任务名称</label>
                 <el-input v-model="searchParams.taskName" size="small"></el-input>
            </div>
            <div>
                <el-button type="primary" @click="search" size="mini" icon="el-icon-search">搜索</el-button>
                <el-button type="default" @click="reset" size="mini" icon="el-icon-refresh">重置</el-button>
            </div>
        </div>
        <table-template
            :data="tableData"
            :total="total"
            @page-change="handlePageChange"
        >
            <template #columns>
                <el-table-column
                    prop="taskName"
                    label="任务名称">
                </el-table-column>
                <el-table-column
                    prop="processInstanceId"
                    label="流程实例编号">
                </el-table-column>
                <el-table-column
                    prop="executionId"
                    label="执行实例编号">
                </el-table-column>
                <el-table-column
                    prop="businessKey"
                    label="业务号">
                </el-table-column>
                <el-table-column
                    prop="processName"
                    label="流程名称">
                </el-table-column>
                <el-table-column
                    prop="starter"
                    label="发起人">
                </el-table-column>
                <el-table-column
                    prop="assignee"
                    label="办理人">
                </el-table-column>
                <el-table-column
                    prop="createTime"
                    label="任务创建时间">
                </el-table-column>
                <el-table-column
                    prop="startTime"
                    label="流程启动时间">
                </el-table-column>
                <el-table-column
                    prop="operation"
                    label="操作">
                    <template slot-scope="scope">
                        <el-button
                        size="mini"
                        type="text"
                        @click="handleTodo(scope.$index, scope.row)">办理</el-button>
                    </template>
                </el-table-column>
            </template>
        </table-template>
    </div>
</template>
 
<script>
import TableTemplate from "@/components/TableTemplate";
import {getMyTodoList} from "./api/myTodoList";
 
export default {
    name: "AllTodoList",
    components: {
        TableTemplate
    },
    data() {
        return {
            responseData: {},
            searchParams: {
                taskName: "",
                processName: "",
                pageNum: 1,
                pageSize: 10
            }
        };
    },
    computed: {
        tableData() {
            return this.responseData.rows || []
        },
        total() {
            return this.responseData.total || 0
        }
    },
    mounted() {
       this.getAllTodoListByParamsAndRender(this.searchParams);
    },
    methods: {
        getAllTodoListByParamsAndRender(params) {
            const {pageSize = 1, pageNum = 10, processName = "", taskName = ""} = params;
            getMyTodoList({
                pageSize,
                pageNum,
                isAsc: "asc",
                processName,
                taskName
            }).then(res => {
                this.responseData = res;
            });
        },
        search() {
            this.getAllTodoListByParamsAndRender(this.searchParams);
        },
        reset() {
            this.searchParams.processName = "";
            this.searchParams.taskName = "";
            this.getAllTodoListByParamsAndRender(this.searchParams);
        },
        handlePageChange() {},
        handleTodo(index, row) {
            console.log("todo", row);
            const {formKey, taskId, businessKey} = row;
            this.$router.push({
                path: `/process/${formKey}/${taskId}?id=${businessKey}`,
                meta: { title: "测试" },
                params: {row}
            })
        }
    },
};
</script>
 
<style scoped>
label {
    font-size: 14px;
    color: #606266;
    margin-right: 8px;
}
.search-bar {
    display: flex;
    margin-top: 8px;
    margin-left: 8px;
}
.el-input {
    display: inline-block;
    width: 300px;
    margin-right: 10px;
}
</style>