14
14
placeholder =" 请输入任务名称"
15
15
clearable
16
16
@keyup.enter =" handleQuery"
17
+ class =" !w-240px"
17
18
/>
18
19
</el-form-item >
19
- <el-form-item label =" 状态" prop =" status" >
20
- <el-select v-model =" queryParams.status" placeholder =" 请选择状态" clearable >
21
- <el-option
22
- v-for =" dict in getIntDictOptions(DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT)"
23
- :key =" dict.value"
24
- :label =" dict.label"
25
- :value =" dict.value"
26
- />
27
- </el-select >
20
+ <el-form-item label =" 创建时间" prop =" createTime" >
21
+ <el-date-picker
22
+ v-model =" queryParams.createTime"
23
+ value-format =" YYYY-MM-DD HH:mm:ss"
24
+ type =" daterange"
25
+ start-placeholder =" 开始日期"
26
+ end-placeholder =" 结束日期"
27
+ :default-time =" [new Date('1 00:00:00'), new Date('1 23:59:59')]"
28
+ class =" !w-240px"
29
+ />
28
30
</el-form-item >
29
31
<el-form-item >
30
32
<el-button @click =" handleQuery" ><Icon icon =" ep:search" class =" mr-5px" /> 搜索</el-button >
31
33
<el-button @click =" resetQuery" ><Icon icon =" ep:refresh" class =" mr-5px" /> 重置</el-button >
32
- <el-button
33
- type =" success"
34
- plain
35
- @click =" handleExport"
36
- :loading =" exportLoading"
37
- v-hasPermi =" ['bpm:task:done:export']"
38
- >
39
- <Icon icon =" ep:download" class =" mr-5px" /> 导出
40
- </el-button >
41
34
</el-form-item >
42
35
</el-form >
43
36
</ContentWrap >
37
+
44
38
<!-- 列表 -->
45
39
<ContentWrap >
46
- <el-table v-loading =" loading" :data =" list" align = " center " >
40
+ <el-table v-loading =" loading" :data =" list" >
47
41
<el-table-column label =" 任务编号" align =" center" prop =" id" width =" 300px" />
48
42
<el-table-column label =" 任务名称" align =" center" prop =" name" />
49
43
<el-table-column label =" 所属流程" align =" center" prop =" processInstance.name" />
63
57
/>
64
58
<el-table-column label =" 操作" align =" center" >
65
59
<template #default =" scope " >
66
- <el-button link type =" primary" @click =" openModal (scope.row)" > 流程信息 </el-button >
67
- <el-button link type =" primary" @click =" handleAudit(scope.row)" > 流程详情 </el-button >
60
+ <el-button link type =" primary" @click =" openDetail (scope.row)" >详情 </el-button >
61
+ <el-button link type =" primary" @click =" handleAudit(scope.row)" >流程 </el-button >
68
62
</template >
69
63
</el-table-column >
70
64
</el-table >
76
70
@pagination =" getList"
77
71
/>
78
72
</ContentWrap >
73
+
79
74
<!-- 表单弹窗:详情 -->
80
- <TaskDoneDetail ref =" modalRef " @success =" getList" />
75
+ <TaskDetail ref =" detailRef " @success =" getList" />
81
76
</template >
82
77
<script setup lang="tsx">
78
+ import { DICT_TYPE } from ' @/utils/dict'
83
79
import { dateFormatter } from ' @/utils/formatTime'
84
- import { DICT_TYPE , getIntDictOptions } from ' @/utils/dict'
85
80
import * as TaskApi from ' @/api/bpm/task'
86
- import download from ' @/utils/download '
87
- import TaskDoneDetail from ' ./Taskdetail.vue '
81
+ import TaskDetail from ' ./TaskDetail.vue '
82
+ const { push } = useRouter () // 路由
88
83
89
84
const loading = ref (true ) // 列表的加载中
90
85
const total = ref (0 ) // 列表的总页数
91
86
const list = ref ([]) // 列表的数据
92
- const message = useMessage () // 消息弹窗
93
- const exportLoading = ref (false ) // 导出的加载中
94
- const queryFormRef = ref () // 搜索的表单
95
87
const queryParams = reactive ({
96
88
pageNo: 1 ,
97
89
pageSize: 10 ,
98
90
name: ' ' ,
99
- status: undefined ,
100
91
createTime: []
101
92
})
93
+ const queryFormRef = ref () // 搜索的表单
102
94
103
- /** 搜索按钮操作 */
104
- const handleQuery = () => {
105
- queryParams .pageNo = 1
106
- getList ()
107
- }
108
- /** 详情操作 */
109
- const modalRef = ref ()
110
- const openModal = (data : TaskApi .TaskVO ) => {
111
- modalRef .value .openModal (data )
112
- }
113
-
114
- /** 重置按钮操作 */
115
- const resetQuery = () => {
116
- queryFormRef .value .resetFields ()
117
- handleQuery ()
118
- }
119
95
/** 查询任务列表 */
120
96
const getList = async () => {
121
97
loading .value = true
@@ -127,22 +103,26 @@ const getList = async () => {
127
103
loading .value = false
128
104
}
129
105
}
130
- /** 导出按钮操作 */
131
- const handleExport = async () => {
132
- try {
133
- // 导出的二次确认
134
- await message .exportConfirm ()
135
- // 发起导出
136
- exportLoading .value = true
137
- const data = await TaskApi .exportTask (queryParams )
138
- download .excel (data , ' 任务列表.xls' )
139
- } catch {
140
- } finally {
141
- exportLoading .value = false
142
- }
106
+
107
+ /** 搜索按钮操作 */
108
+ const handleQuery = () => {
109
+ queryParams .pageNo = 1
110
+ getList ()
143
111
}
144
- const { push } = useRouter () // 路由
145
- // 处理审批按钮
112
+
113
+ /** 重置按钮操作 */
114
+ const resetQuery = () => {
115
+ queryFormRef .value .resetFields ()
116
+ handleQuery ()
117
+ }
118
+
119
+ /** 详情操作 */
120
+ const detailRef = ref ()
121
+ const openDetail = (row : TaskApi .TaskVO ) => {
122
+ detailRef .value .open (row )
123
+ }
124
+
125
+ /** 处理审批按钮 */
146
126
const handleAudit = (row ) => {
147
127
push ({
148
128
name: ' BpmProcessInstanceDetail' ,
@@ -151,6 +131,7 @@ const handleAudit = (row) => {
151
131
}
152
132
})
153
133
}
134
+
154
135
/** 初始化 **/
155
136
onMounted (() => {
156
137
getList ()
0 commit comments