提交 | 用户 | 时间
|
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 align="center" label="流程编号" prop="id" :show-overflow-tooltip="true" /> |
|
71 |
<el-table-column align="center" label="任务编号" prop="id" :show-overflow-tooltip="true" /> |
|
72 |
<el-table-column align="center" label="操作" fixed="right" width="80"> |
|
73 |
<template #default="scope"> |
|
74 |
<el-button link type="primary" @click="handleAudit(scope.row)">办理</el-button> |
|
75 |
</template> |
|
76 |
</el-table-column> |
|
77 |
</el-table> |
|
78 |
<!-- 分页 --> |
|
79 |
<Pagination |
|
80 |
v-model:limit="queryParams.pageSize" |
|
81 |
v-model:page="queryParams.pageNo" |
|
82 |
:total="total" |
|
83 |
@pagination="getList" |
|
84 |
/> |
|
85 |
</ContentWrap> |
|
86 |
</template> |
|
87 |
|
|
88 |
<script lang="ts" setup> |
|
89 |
import { dateFormatter } from '@/utils/formatTime' |
|
90 |
import * as TaskApi from '@/api/bpm/task' |
|
91 |
|
|
92 |
defineOptions({ name: 'BpmTodoTask' }) |
|
93 |
|
|
94 |
const { push } = useRouter() // 路由 |
|
95 |
|
|
96 |
const loading = ref(true) // 列表的加载中 |
|
97 |
const total = ref(0) // 列表的总页数 |
|
98 |
const list = ref([]) // 列表的数据 |
|
99 |
const queryParams = reactive({ |
|
100 |
pageNo: 1, |
|
101 |
pageSize: 10, |
|
102 |
name: '', |
|
103 |
createTime: [] |
|
104 |
}) |
|
105 |
const queryFormRef = ref() // 搜索的表单 |
|
106 |
|
|
107 |
/** 查询任务列表 */ |
|
108 |
const getList = async () => { |
|
109 |
loading.value = true |
|
110 |
try { |
|
111 |
const data = await TaskApi.getTaskTodoPage(queryParams) |
|
112 |
list.value = data.list |
|
113 |
total.value = data.total |
|
114 |
} finally { |
|
115 |
loading.value = false |
|
116 |
} |
|
117 |
} |
|
118 |
|
|
119 |
/** 搜索按钮操作 */ |
|
120 |
const handleQuery = () => { |
|
121 |
queryParams.pageNo = 1 |
|
122 |
getList() |
|
123 |
} |
|
124 |
|
|
125 |
/** 重置按钮操作 */ |
|
126 |
const resetQuery = () => { |
|
127 |
queryFormRef.value.resetFields() |
|
128 |
handleQuery() |
|
129 |
} |
|
130 |
|
|
131 |
/** 处理审批按钮 */ |
|
132 |
const handleAudit = (row: any) => { |
|
133 |
push({ |
|
134 |
name: 'BpmProcessInstanceDetail', |
|
135 |
query: { |
3e359e
|
136 |
id: row.processInstance.id, |
H |
137 |
taskId: row.id |
820397
|
138 |
} |
H |
139 |
}) |
|
140 |
} |
|
141 |
|
|
142 |
/** 初始化 **/ |
|
143 |
onMounted(() => { |
|
144 |
getList() |
|
145 |
}) |
|
146 |
</script> |