|
|
@@ -12,7 +12,7 @@
|
|
12
|
12
|
<list-card v-for="item in filteredList" :key="item.id" :showChecked="true"
|
|
13
|
13
|
@click="navigateToDetail(item)">
|
|
14
|
14
|
<template #checkbox
|
|
15
|
|
- v-if="item.instance && item.instance.businessType === 'SEIZURE_REPORT' && currentTab === 'todo'">
|
|
|
15
|
+ v-if="canShowCheckbox(item)">
|
|
16
|
16
|
<u-checkbox style="margin-top: 6rpx;" :checked="item.checked" :key="item.id"
|
|
17
|
17
|
@change="itemChange(item)" />
|
|
18
|
18
|
</template>
|
|
|
@@ -111,7 +111,7 @@
|
|
111
|
111
|
import HomeContainer from "@/components/HomeContainer.vue";
|
|
112
|
112
|
import HTabs from "@/components/h-tabs/h-tabs.vue";
|
|
113
|
113
|
import { listCheckApprovalCcDetails, listCheckPendingTasks, listCheckFinishedTasks, updateCheckApprovalCcDetails } from "@/api/myToDoList/myToDoList.js"
|
|
114
|
|
-import { approvePassBatch, approveRejectBatch } from "@/api/approve/approve.js";
|
|
|
114
|
+import { approvePassBatch, approveRejectBatch,rectifyApprovePass,rectifyApproveReject } from "@/api/approve/approve.js";
|
|
115
|
115
|
import { showMessageTabRedDot } from "@/utils/common.js"
|
|
116
|
116
|
export default {
|
|
117
|
117
|
components: { HomeContainer, HTabs },
|
|
|
@@ -136,6 +136,9 @@ export default {
|
|
136
|
136
|
}
|
|
137
|
137
|
},
|
|
138
|
138
|
computed: {
|
|
|
139
|
+ userInfoRoles() {
|
|
|
140
|
+ return this.$store.state.user && this.$store.state.user.roles
|
|
|
141
|
+ },
|
|
139
|
142
|
tabList() {
|
|
140
|
143
|
return [
|
|
141
|
144
|
{
|
|
|
@@ -153,12 +156,41 @@ export default {
|
|
153
|
156
|
title: '已办'
|
|
154
|
157
|
}
|
|
155
|
158
|
];
|
|
|
159
|
+ },
|
|
|
160
|
+ // 判断是否显示复选框的条件
|
|
|
161
|
+ showCheckboxCondition(item) {
|
|
|
162
|
+ return this.canShowCheckbox(item);
|
|
156
|
163
|
}
|
|
157
|
164
|
},
|
|
158
|
165
|
watch: {
|
|
159
|
166
|
|
|
160
|
167
|
},
|
|
161
|
168
|
methods: {
|
|
|
169
|
+ // 判断是否显示复选框的条件
|
|
|
170
|
+ canShowCheckbox(item) {
|
|
|
171
|
+
|
|
|
172
|
+ return ((item.instance && item.instance.businessType === 'SEIZURE_REPORT') ||
|
|
|
173
|
+ (item.instance && item.instance.businessType === 'DEPARTMENT_CHECK' &&
|
|
|
174
|
+ this.userInfoRoles.includes('jingli'))) &&
|
|
|
175
|
+ this.currentTab === 'todo';
|
|
|
176
|
+ },
|
|
|
177
|
+
|
|
|
178
|
+ // 根据任务类型分组
|
|
|
179
|
+ groupTasksByType(selectedItems) {
|
|
|
180
|
+ const seizureTaskIds = [];
|
|
|
181
|
+ const departmentTaskIds = [];
|
|
|
182
|
+
|
|
|
183
|
+ selectedItems.forEach(item => {
|
|
|
184
|
+ if (item.instance && item.instance.businessType === 'SEIZURE_REPORT') {
|
|
|
185
|
+ seizureTaskIds.push(item.id);
|
|
|
186
|
+ } else if (item.instance && item.instance.businessType === 'DEPARTMENT_CHECK' &&
|
|
|
187
|
+ this.userInfoRoles.includes('jingli')) {
|
|
|
188
|
+ departmentTaskIds.push(item.id);
|
|
|
189
|
+ }
|
|
|
190
|
+ });
|
|
|
191
|
+
|
|
|
192
|
+ return { seizureTaskIds, departmentTaskIds };
|
|
|
193
|
+ },
|
|
162
|
194
|
async getUnreadCount() {
|
|
163
|
195
|
try {
|
|
164
|
196
|
const query = {
|
|
|
@@ -233,7 +265,7 @@ export default {
|
|
233
|
265
|
return ''
|
|
234
|
266
|
},
|
|
235
|
267
|
navigateToDetail(row) {
|
|
236
|
|
-
|
|
|
268
|
+
|
|
237
|
269
|
let type = 'view'; // 默认查看模式
|
|
238
|
270
|
if (this.currentTab == 'msg') {
|
|
239
|
271
|
const { businessType, businessId, instanceId } = row;
|
|
|
@@ -254,6 +286,7 @@ export default {
|
|
254
|
286
|
});
|
|
255
|
287
|
return;
|
|
256
|
288
|
}
|
|
|
289
|
+
|
|
257
|
290
|
const { instance, id, nodeDefinition } = row;
|
|
258
|
291
|
const { businessId = "", businessType = "", id: instanceId } = instance || {};
|
|
259
|
292
|
const { nodeCode = "" } = nodeDefinition || {};
|
|
|
@@ -278,7 +311,7 @@ export default {
|
|
278
|
311
|
url = `/pages/seizedReported/index?params=${encodeURIComponent(JSON.stringify(obj))}`;
|
|
279
|
312
|
}
|
|
280
|
313
|
// 巡检对应个人 班组 科室
|
|
281
|
|
- if (['PERSONAL_CHECK', 'GROUP_CHECK', 'SECTION_CHECK', 'BRIGADE_CHECK'].includes(businessType) || this.currentTab == 'msg') {
|
|
|
314
|
+ if (['PERSONAL_CHECK', 'GROUP_CHECK', 'SECTION_CHECK', 'BRIGADE_CHECK', 'DEPARTMENT_CHECK'].includes(businessType) || this.currentTab == 'msg') {
|
|
282
|
315
|
url = `/pages/problemRect/index?params=${encodeURIComponent(JSON.stringify(obj))}`;
|
|
283
|
316
|
}
|
|
284
|
317
|
if (url) {
|
|
|
@@ -315,8 +348,8 @@ export default {
|
|
315
|
348
|
this.$nextTick(() => {
|
|
316
|
349
|
this.filteredList = this.filteredList.map(item => ({
|
|
317
|
350
|
...item,
|
|
318
|
|
- //只有查获可以批量审批
|
|
319
|
|
- ...(item.instance && item.instance.businessType === 'SEIZURE_REPORT' ? { checked: e } : {}),
|
|
|
351
|
+ //查获和部门检查可以批量审批
|
|
|
352
|
+ ...(this.canShowCheckbox(item) ? { checked: e } : {}),
|
|
320
|
353
|
}));
|
|
321
|
354
|
this.selectedItems = this.filteredList.filter(item => item.checked);
|
|
322
|
355
|
})
|
|
|
@@ -332,11 +365,22 @@ export default {
|
|
332
|
365
|
}
|
|
333
|
366
|
|
|
334
|
367
|
try {
|
|
335
|
|
- // 提取选中项的任务ID数组
|
|
336
|
|
- const taskIds = this.selectedItems.map(item => item.id);
|
|
|
368
|
+ // 根据任务类型分组
|
|
|
369
|
+ const { seizureTaskIds, departmentTaskIds } = this.groupTasksByType(this.selectedItems);
|
|
|
370
|
+
|
|
|
371
|
+ // 分别调用不同的驳回接口
|
|
|
372
|
+ const promises = [];
|
|
|
373
|
+
|
|
|
374
|
+ if (seizureTaskIds.length > 0) {
|
|
|
375
|
+ promises.push(approveRejectBatch(seizureTaskIds));
|
|
|
376
|
+ }
|
|
|
377
|
+
|
|
|
378
|
+ if (departmentTaskIds.length > 0) {
|
|
|
379
|
+ promises.push(rectifyApproveReject({taskIdList: departmentTaskIds}));
|
|
|
380
|
+ }
|
|
337
|
381
|
|
|
338
|
|
- // 调用批量驳回接口
|
|
339
|
|
- await approveRejectBatch(taskIds);
|
|
|
382
|
+ // 等待所有接口调用完成
|
|
|
383
|
+ await Promise.all(promises);
|
|
340
|
384
|
|
|
341
|
385
|
uni.showToast({
|
|
342
|
386
|
title: '批量驳回成功',
|
|
|
@@ -371,11 +415,22 @@ export default {
|
|
371
|
415
|
}
|
|
372
|
416
|
|
|
373
|
417
|
try {
|
|
374
|
|
- // 提取选中项的任务ID数组
|
|
375
|
|
- const taskIds = this.selectedItems.map(item => item.id);
|
|
376
|
|
-
|
|
377
|
|
- // 调用批量通过接口
|
|
378
|
|
- await approvePassBatch(taskIds);
|
|
|
418
|
+ // 根据任务类型分组
|
|
|
419
|
+ const { seizureTaskIds, departmentTaskIds } = this.groupTasksByType(this.selectedItems);
|
|
|
420
|
+
|
|
|
421
|
+ // 分别调用不同的通过接口
|
|
|
422
|
+ const promises = [];
|
|
|
423
|
+
|
|
|
424
|
+ if (seizureTaskIds.length > 0) {
|
|
|
425
|
+ promises.push(approvePassBatch(seizureTaskIds));
|
|
|
426
|
+ }
|
|
|
427
|
+
|
|
|
428
|
+ if (departmentTaskIds.length > 0) {
|
|
|
429
|
+ promises.push(rectifyApprovePass({ taskIdList: departmentTaskIds }));
|
|
|
430
|
+ }
|
|
|
431
|
+debugger
|
|
|
432
|
+ // 等待所有接口调用完成
|
|
|
433
|
+ await Promise.all(promises);
|
|
379
|
434
|
|
|
380
|
435
|
uni.showToast({
|
|
381
|
436
|
title: '批量通过成功',
|