feat(M08-B): 补批量免清洁操作
This commit is contained in:
@@ -138,6 +138,7 @@
|
|||||||
@reject="handleReject"
|
@reject="handleReject"
|
||||||
@reject-many="handleRejectMany"
|
@reject-many="handleRejectMany"
|
||||||
@exempt="handleExempt"
|
@exempt="handleExempt"
|
||||||
|
@exempt-many="handleExemptMany"
|
||||||
@reclaim="handleReclaim"
|
@reclaim="handleReclaim"
|
||||||
/>
|
/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
@@ -542,6 +543,15 @@ async function handleExempt(input: { taskId: string; note?: string }) {
|
|||||||
}, '宸叉爣璁板厤娓呮磥');
|
}, '宸叉爣璁板厤娓呮磥');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function handleExemptMany(input: { taskIds: string[]; note?: string }) {
|
||||||
|
await runAction(async () => {
|
||||||
|
for (const taskId of input.taskIds) {
|
||||||
|
await exemptCleaningTask(session.value, taskId, input.note);
|
||||||
|
}
|
||||||
|
await Promise.all([loadTasks(), loadStatistics()]);
|
||||||
|
}, `\u5df2\u6279\u91cf\u6807\u8bb0\u514d\u6e05\u6d01 ${input.taskIds.length} \u4e2a\u4efb\u52a1`);
|
||||||
|
}
|
||||||
|
|
||||||
async function handleReclaim(input: { olderThanMinutes: number; limit: number }) {
|
async function handleReclaim(input: { olderThanMinutes: number; limit: number }) {
|
||||||
await runAction(async () => {
|
await runAction(async () => {
|
||||||
await reclaimCleaningTimeouts(session.value, input);
|
await reclaimCleaningTimeouts(session.value, input);
|
||||||
|
|||||||
@@ -53,6 +53,14 @@
|
|||||||
>
|
>
|
||||||
批量驳回
|
批量驳回
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
type="warning"
|
||||||
|
:icon="Ban"
|
||||||
|
:disabled="selectedExemptableCount === 0"
|
||||||
|
@click="submitBatchExempt"
|
||||||
|
>
|
||||||
|
{{ '\u6279\u91cf\u514d\u6e05\u6d01' }}
|
||||||
|
</el-button>
|
||||||
<el-popover trigger="click" width="280">
|
<el-popover trigger="click" width="280">
|
||||||
<template #reference>
|
<template #reference>
|
||||||
<el-button :icon="RotateCcw">回收</el-button>
|
<el-button :icon="RotateCcw">回收</el-button>
|
||||||
@@ -478,6 +486,7 @@ const emit = defineEmits<{
|
|||||||
reject: [{ taskId: string; reason: string }];
|
reject: [{ taskId: string; reason: string }];
|
||||||
'reject-many': [{ taskIds: string[]; reason: string }];
|
'reject-many': [{ taskIds: string[]; reason: string }];
|
||||||
exempt: [{ taskId: string; note?: string }];
|
exempt: [{ taskId: string; note?: string }];
|
||||||
|
'exempt-many': [{ taskIds: string[]; note?: string }];
|
||||||
reclaim: [{ olderThanMinutes: number; limit: number }];
|
reclaim: [{ olderThanMinutes: number; limit: number }];
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
@@ -526,6 +535,9 @@ const memberDialog = reactive({
|
|||||||
const selectedSubmittedTasks = computed(() => selectedTasks.value
|
const selectedSubmittedTasks = computed(() => selectedTasks.value
|
||||||
.filter((task) => task.status === 'SUBMITTED'));
|
.filter((task) => task.status === 'SUBMITTED'));
|
||||||
const selectedSubmittedCount = computed(() => selectedSubmittedTasks.value.length);
|
const selectedSubmittedCount = computed(() => selectedSubmittedTasks.value.length);
|
||||||
|
const selectedExemptableTasks = computed(() => selectedTasks.value
|
||||||
|
.filter((task) => canExempt(task.status)));
|
||||||
|
const selectedExemptableCount = computed(() => selectedExemptableTasks.value.length);
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => props.filters,
|
() => props.filters,
|
||||||
@@ -541,7 +553,7 @@ function taskTag(status: TaskStatus) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function canSelectTask(row: CleaningTask) {
|
function canSelectTask(row: CleaningTask) {
|
||||||
return row.status === 'SUBMITTED';
|
return row.status === 'SUBMITTED' || canExempt(row.status);
|
||||||
}
|
}
|
||||||
|
|
||||||
function canExempt(status: TaskStatus) {
|
function canExempt(status: TaskStatus) {
|
||||||
@@ -648,6 +660,18 @@ function submitBatchReject() {
|
|||||||
batchRejectDialog.open = false;
|
batchRejectDialog.open = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function submitBatchExempt() {
|
||||||
|
const taskIds = selectedExemptableTasks.value.map((task) => task.id);
|
||||||
|
if (!taskIds.length) {
|
||||||
|
ElMessage.warning('\u8bf7\u9009\u62e9\u53ef\u514d\u6e05\u6d01\u4efb\u52a1');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
emit('exempt-many', {
|
||||||
|
taskIds,
|
||||||
|
note: '\u540e\u53f0\u6279\u91cf\u6807\u8bb0\u514d\u6e05\u6d01'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
async function loadMembers() {
|
async function loadMembers() {
|
||||||
memberDialog.loading = true;
|
memberDialog.loading = true;
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ for (const pattern of [
|
|||||||
'handleCompleteMany',
|
'handleCompleteMany',
|
||||||
'handleRejectMany',
|
'handleRejectMany',
|
||||||
'handleExempt',
|
'handleExempt',
|
||||||
|
'handleExemptMany',
|
||||||
'运营待处理',
|
'运营待处理',
|
||||||
'jumpToTaskStatus',
|
'jumpToTaskStatus',
|
||||||
'jumpToSettlementStatus',
|
'jumpToSettlementStatus',
|
||||||
@@ -94,10 +95,14 @@ for (const pattern of [
|
|||||||
'批量验收',
|
'批量验收',
|
||||||
'批量驳回',
|
'批量驳回',
|
||||||
'selectedSubmittedTasks',
|
'selectedSubmittedTasks',
|
||||||
|
'selectedExemptableTasks',
|
||||||
|
'selectedExemptableCount',
|
||||||
'complete-many',
|
'complete-many',
|
||||||
'reject-many',
|
'reject-many',
|
||||||
|
'exempt-many',
|
||||||
'exempt',
|
'exempt',
|
||||||
'canExempt',
|
'canExempt',
|
||||||
|
'\\u6279\\u91cf\\u514d\\u6e05\\u6d01',
|
||||||
'EXEMPT',
|
'EXEMPT',
|
||||||
'photo-grid',
|
'photo-grid',
|
||||||
'timeline-grid',
|
'timeline-grid',
|
||||||
|
|||||||
Reference in New Issue
Block a user