diff --git a/frontend/src/pages/relay/TaskDetailPage.vue b/frontend/src/pages/relay/TaskDetailPage.vue index 9287f21..1a00db6 100644 --- a/frontend/src/pages/relay/TaskDetailPage.vue +++ b/frontend/src/pages/relay/TaskDetailPage.vue @@ -334,25 +334,37 @@ function checkpointState(cp: TaskCheckpointView): CheckpointState { return 'future' } -// --- 보고서 작성 폼(인라인, 점검일 당일·담당자만) --- +// --- 보고서 작성(모달, 점검일 당일·담당자만) — 카테고리 탭 방식 --- const reportingCpId = ref(null) -const reportItems = ref<{ id: string; text: string; workStatus: ChecklistWorkStatus }[]>([]) +const reportItems = ref< + { id: string; text: string; category: ChecklistCategory; workStatus: ChecklistWorkStatus }[] +>([]) const reportNote = ref('') const reportSubmitting = ref(false) +const writeTab = ref('필수') function openReportForm(cp: TaskCheckpointView) { if (!task.value) return reportingCpId.value = cp.id + writeTab.value = '필수' // 현재(마지막 보고) 상태로 프리필 reportItems.value = task.value.checklist .filter((c) => c.id) .map((c) => ({ id: c.id as string, text: c.text, + category: c.category, workStatus: c.workStatus ?? 'todo', })) reportNote.value = '' } +// 작성 모달 탭별 항목 / 개수 +function writeItemsByCat(cat: ChecklistCategory) { + return reportItems.value.filter((it) => it.category === cat) +} +function writeCatCount(cat: ChecklistCategory): number { + return writeItemsByCat(cat).length +} function cancelReportForm() { reportingCpId.value = null reportItems.value = [] @@ -1271,14 +1283,14 @@ function badgeFor(name: string | undefined): { label: string; cls: string } { class="cp-d-item" > {{ cp.dateLabel }} - + - - - -

- 등록된 할 일이 없어 메모만 보고됩니다. -

-