index.vue
9.85 KB
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
<template>
<div>
<PlacedTop :nodeId="'circulateMatterIndex'"></PlacedTop>
<NavBar :is-custom="true" @go-back="handleGoBack">
<template slot="title">传阅事项</template>
</NavBar>
<van-search
v-model="searchValue"
show-action
placeholder="请输入标题或流程编号来搜索..."
@search="onSearchChange"
@clear="onSearch"
>
<template #action>
<div @click="onSearch" style="color: #409eff">搜索</div>
</template>
</van-search>
<van-tabs
v-model="active"
title-active-color="#409EFF"
color="#409EFF"
@change="onChangeTabs"
>
<div class="task-content-container">
<van-tab
v-for="(tab, index) in categories"
:key="tab.id"
:title="tab.name"
>
<div
class="roadWrapper"
id="circulateMatterIndex"
v-if="status == tab.id"
>
<div class="road">
<van-pull-refresh v-model="isDownLoading" @refresh="onRefresh()">
<van-list
v-if="itemList && itemList.length > 0"
v-model="loading"
:finished="finished"
finished-text=""
@load="onLoad(1)"
:immediate-check="false"
:offset="20"
>
<van-cell
v-for="item in itemList"
:key="item.id"
class="task_list_item task_mobile"
@click="showItem(item)"
>
<MyNoticeListItem
:item="item"
:status="status"
:searchValue="searchValue"
@revoke="handleRevoke"
></MyNoticeListItem>
</van-cell>
</van-list>
</van-pull-refresh>
<van-collapse
v-model="activeNames"
v-if="finished && PCitemList && PCitemList.length > 0 "
class="pc_process"
>
<van-collapse-item
title="不可使用任务"
name="PCProcess"
:border="false"
:is-link="false"
>
<template #title>
不可使用任务
<i class="van-icon van-icon-arrow van-cell__right-icon"></i>
</template>
<van-list
v-if="PCitemList && PCitemList.length > 0"
v-model="PCloading"
:finished="PCfinished"
finished-text="没有更多了"
@load="onLoad(0)"
:immediate-check="false"
:offset="50"
>
<van-cell
v-for="item in PCitemList"
:key="item.id"
class="task_list_item task_pc"
@click="showItem(item)"
>
<MyNoticeListItem
:item="item"
:status="status"
:searchValue="searchValue"
@revoke="handleRevoke"
></MyNoticeListItem>
</van-cell>
</van-list>
</van-collapse-item>
</van-collapse>
<van-empty
v-if="itemList.length == 0 && finished && PCitemList.length == 0 && PCfinished "
class="custom-image"
:image="noDataImage"
description="暂无内容"
/>
</div>
</div>
</van-tab>
</div>
</van-tabs>
</div>
</template>
<script>
const PlacedTop = () => import('@/components/PlacedTop.vue')
const MyNoticeListItem = () => import('./MyNoticeListItem.vue')
import flow from '@/api/flow.js'
import { Dialog, Notify } from 'vant'
import { revokeProcessById } from '@/api/process.js'
import vanListCommon from '@/mixins/vanListCommon.js'
import callBackScroll from '@/mixins/callBackScroll.js'
import tabActiveMemory from '@/mixins/tabActiveMemory'
export default {
name: 'CirculateMatter',
mixins: [vanListCommon, tabActiveMemory, callBackScroll],
components: {
MyNoticeListItem,
PlacedTop,
},
data() {
return {
active: 0,
status: 'wait',
noticeTyle: 'getNoticeTodoReadList',
categories: [
{
id: 'wait',
name: '我收到的',
},
{
id: 'mine',
name: '我传阅的',
},
],
noDataImage: require('@/assets/images/no_data_list.png'),
}
},
methods: {
init() {
this.onChangeTabs()
},
//根据ID主键ID删除传阅任务
handleRevoke(id) {
Dialog.confirm({
title: '提示',
message: '确认撤回此任务?',
beforeClose: (action, done) => {
if (action === 'confirm') {
revokeProcessById(id)
.then((res) => {
if (!res.state)
return Notify({ type: 'danger', message: res.message })
Notify({ type: 'success', message: res.message })
this.onRefresh()
})
.finally(() => {
done()
})
} else {
done()
}
},
}).then(() => {})
},
onChangeTabs(event) {
switch (this.active) {
case 0:
this.status = 'wait'
this.noticeTyle = 'getNoticeTodoReadList'
break
case 1:
this.noticeTyle = 'getMyNoticeReadList'
this.status = 'mine'
break
default:
this.noticeTyle = 'getNoticeTodoReadList'
this.status = 'wait'
break
}
this.searchValue = ''
this.onRefresh()
},
//上拉加载
//异步请求数据 ,我们的项目时封装好的方法,此处只是调用
onLoad(supportMobile) {
let params = {
pageBean: {
page:supportMobile==1?this.page:this.PCpage,
pageSize: this.pageSize,
showTotal: true,
},
querys: [{
property:'bpm_task_notice.support_mobile_',
value: supportMobile,
group: 'main',
relation: 'AND',
operation: 'EQUAL',
}],
}
if (this.searchValue) {
params.querys.push({
property: 'bpm_pro_inst.subject_',
value: this.searchValue,
operation: 'LIKE',
relation: 'OR',
group: 'main1',
})
params.querys.push({
property: 'bpm_pro_inst.proc_def_name_',
value: this.searchValue,
operation: 'LIKE',
relation: 'OR',
group: 'main1',
})
params.querys.push({
property: 'bpm_task_notice.owner_name_',
value: this.searchValue,
operation: 'LIKE',
relation: 'OR',
group: 'main1',
})
params.querys.push({
group: 'main1',
operation: 'LIKE',
property: 'bpm_task_notice.proc_inst_id_',
relation: 'OR',
value: this.searchValue,
})
}
let _self = this
flow
.getNoticesList(params, this.noticeTyle)
.then((response) => {
if(supportMobile===1){
_self.loadData(response, _self)
}else{
_self.loadPCData(response, _self)
}
})
.catch((error) => {})
.finally(() => {
_self.isDownLoading = false
_self.isUpLoading = false
})
},
showItem(row) {
if (row.supportMobile == 1) {
if (this.status == 'wait') {
this.$router.push({
path: '/matter/approvalForm',
query: {
readId: row.id, //为知会任务表的id
instId: row.procInstId,
from: 'received',
receivedStatus: row.status,
isRead: row.isRead,
nodeId: row.nodeId,
status: row.status,
},
})
} else if (this.status == 'mine') {
this.$router.push({
path: '/matter/approvalForm',
query: {
readId: row.id,
instId: row.procInstId,
from: 'circulate',
nodeId: row.nodeId,
status: row.status,
},
})
}}else{
this.$toast.fail('此任务未绑定手机表单')
}
},
handleGoBack() {
const from = this.$route.query.from
if (from === 'worker') {
this.$router.push('/worker')
} else {
this.$router.push({
path: '/home',
})
}
},
},
}
</script>
<style lang="scss" scoped>
.roadWrapper {
height: calc(#{$vh} - 164px);
overflow: scroll;
}
::v-deep .van-tab {
font-size: 16px;
}
.van-search {
padding: 16px 8px 8px 16px;
.van-search__content {
border-radius: 8px;
}
}
.task_list_item {
margin-bottom: 16px;
border-radius: 12px;
padding: 16px;
.van-cell__title {
width: 100%;
}
}
.task-content-container {
padding: 16px 0;
.road {
padding: 0 16px;
}
}
.pc_process ::v-deep .van-collapse-item__content {
padding: 0;
background: #f5f5f5;
}
.pc_process ::v-deep .van-collapse-item__title{
text-align: center;
background: #f5f5f5;
color: #409eff;
border: none;
.van-icon{
color: #409eff;
}
}
.van-hairline--top-bottom::after,
.van-hairline-unset--top-bottom::after {
border-width:0;
}
</style>