提交 | 用户 | 时间
|
820397
|
1 |
<template> |
3e359e
|
2 |
|
820397
|
3 |
<ContentWrap> |
H |
4 |
<!-- 搜索工作栏 --> |
|
5 |
<el-form |
|
6 |
ref="queryFormRef" |
|
7 |
:inline="true" |
|
8 |
:model="queryParams" |
|
9 |
class="-mb-15px" |
|
10 |
label-width="68px" |
|
11 |
> |
|
12 |
<el-form-item label="任务名称" prop="name"> |
|
13 |
<el-input |
|
14 |
v-model="queryParams.name" |
|
15 |
class="!w-240px" |
|
16 |
clearable |
|
17 |
placeholder="请输入任务名称" |
|
18 |
@keyup.enter="handleQuery" |
|
19 |
/> |
|
20 |
</el-form-item> |
|
21 |
<el-form-item label="创建时间" prop="createTime"> |
|
22 |
<el-date-picker |
|
23 |
v-model="queryParams.createTime" |
|
24 |
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]" |
|
25 |
class="!w-240px" |
|
26 |
end-placeholder="结束日期" |
|
27 |
start-placeholder="开始日期" |
|
28 |
type="daterange" |
|
29 |
value-format="YYYY-MM-DD HH:mm:ss" |
|
30 |
/> |
|
31 |
</el-form-item> |
|
32 |
<el-form-item> |
|
33 |
<el-button @click="handleQuery"> |
|
34 |
<Icon class="mr-5px" icon="ep:search" /> |
|
35 |
搜索 |
|
36 |
</el-button> |
|
37 |
<el-button @click="resetQuery"> |
|
38 |
<Icon class="mr-5px" icon="ep:refresh" /> |
|
39 |
重置 |
|
40 |
</el-button> |
|
41 |
</el-form-item> |
|
42 |
</el-form> |
|
43 |
</ContentWrap> |
|
44 |
|
|
45 |
<!-- 列表 --> |
|
46 |
<ContentWrap> |
|
47 |
<el-table v-loading="loading" :data="list"> |
|
48 |
<el-table-column align="center" label="流程" prop="processInstance.name" width="180" /> |
|
49 |
<el-table-column |
|
50 |
align="center" |
|
51 |
label="发起人" |
|
52 |
prop="processInstance.startUser.nickname" |
|
53 |
width="100" |
|
54 |
/> |
|
55 |
<el-table-column |
|
56 |
:formatter="dateFormatter" |
|
57 |
align="center" |
|
58 |
label="发起时间" |
|
59 |
prop="createTime" |
|
60 |
width="180" |
|
61 |
/> |
|
62 |
<el-table-column align="center" label="当前任务" prop="name" width="180" /> |
|
63 |
<el-table-column |
|
64 |
:formatter="dateFormatter" |
|
65 |
align="center" |
|
66 |
label="任务开始时间" |
|
67 |
prop="createTime" |
|
68 |
width="180" |
|
69 |
/> |
|
70 |
<el-table-column |
|
71 |
:formatter="dateFormatter" |
|
72 |
align="center" |
|
73 |
label="任务结束时间" |
|
74 |
prop="endTime" |
|
75 |
width="180" |
|
76 |
/> |
|
77 |
<el-table-column align="center" label="审批人" prop="assigneeUser.nickname" width="100" /> |
|
78 |
<el-table-column align="center" label="审批状态" prop="status" width="120"> |
|
79 |
<template #default="scope"> |
|
80 |
<dict-tag :type="DICT_TYPE.BPM_TASK_STATUS" :value="scope.row.status" /> |
|
81 |
</template> |
|
82 |
</el-table-column> |
|
83 |
<el-table-column align="center" label="审批建议" prop="reason" min-width="180" /> |
|
84 |
<el-table-column align="center" label="耗时" prop="durationInMillis" width="160"> |
|
85 |
<template #default="scope"> |
|
86 |
{{ formatPast2(scope.row.durationInMillis) }} |
|
87 |
</template> |
|
88 |
</el-table-column> |
|
89 |
<el-table-column align="center" label="流程编号" prop="id" :show-overflow-tooltip="true" /> |
|
90 |
<el-table-column align="center" label="任务编号" prop="id" :show-overflow-tooltip="true" /> |
|
91 |
<el-table-column align="center" label="操作" fixed="right" width="80"> |
|
92 |
<template #default="scope"> |
|
93 |
<el-button link type="primary" @click="handleAudit(scope.row)">历史</el-button> |
|
94 |
</template> |
|
95 |
</el-table-column> |
|
96 |
</el-table> |
|
97 |
<!-- 分页 --> |
|
98 |
<Pagination |
|
99 |
v-model:limit="queryParams.pageSize" |
|
100 |
v-model:page="queryParams.pageNo" |
|
101 |
:total="total" |
|
102 |
@pagination="getList" |
|
103 |
/> |
|
104 |
</ContentWrap> |
|
105 |
</template> |
|
106 |
<script lang="ts" setup> |
|
107 |
import { DICT_TYPE } from '@/utils/dict' |
|
108 |
import { dateFormatter, formatPast2 } from '@/utils/formatTime' |
|
109 |
import * as TaskApi from '@/api/bpm/task' |
|
110 |
|
|
111 |
// 它和【待办任务】【已办任务】的差异是,该菜单可以看全部的流程任务 |
|
112 |
defineOptions({ name: 'BpmManagerTask' }) |
|
113 |
|
|
114 |
const { push } = useRouter() // 路由 |
|
115 |
|
|
116 |
const loading = ref(true) // 列表的加载中 |
|
117 |
const total = ref(0) // 列表的总页数 |
|
118 |
const list = ref([]) // 列表的数据 |
|
119 |
const queryParams = reactive({ |
|
120 |
pageNo: 1, |
|
121 |
pageSize: 10, |
|
122 |
name: '', |
|
123 |
createTime: [] |
|
124 |
}) |
|
125 |
const queryFormRef = ref() // 搜索的表单 |
|
126 |
|
|
127 |
/** 查询任务列表 */ |
|
128 |
const getList = async () => { |
|
129 |
loading.value = true |
|
130 |
try { |
|
131 |
const data = await TaskApi.getTaskManagerPage(queryParams) |
|
132 |
list.value = data.list |
|
133 |
total.value = data.total |
|
134 |
} finally { |
|
135 |
loading.value = false |
|
136 |
} |
|
137 |
} |
|
138 |
|
|
139 |
/** 搜索按钮操作 */ |
|
140 |
const handleQuery = () => { |
|
141 |
queryParams.pageNo = 1 |
|
142 |
getList() |
|
143 |
} |
|
144 |
|
|
145 |
/** 重置按钮操作 */ |
|
146 |
const resetQuery = () => { |
|
147 |
queryFormRef.value.resetFields() |
|
148 |
handleQuery() |
|
149 |
} |
|
150 |
|
|
151 |
/** 处理审批按钮 */ |
|
152 |
const handleAudit = (row: any) => { |
|
153 |
push({ |
|
154 |
name: 'BpmProcessInstanceDetail', |
|
155 |
query: { |
|
156 |
id: row.processInstance.id |
|
157 |
} |
|
158 |
}) |
|
159 |
} |
|
160 |
|
|
161 |
/** 初始化 **/ |
|
162 |
onMounted(() => { |
|
163 |
getList() |
|
164 |
}) |
|
165 |
</script> |