From 4bb4fbd225c4bd18938a35851d384a01c4deb17f Mon Sep 17 00:00:00 2001 From: Hyungi Ahn Date: Wed, 1 Apr 2026 08:27:41 +0900 Subject: [PATCH] =?UTF-8?q?feat(monthly-comparison):=20=EC=83=81=EC=84=B8?= =?UTF-8?q?=20=EB=B7=B0=20=EC=9E=91=EC=97=85=EC=9E=90=20=EC=9D=B4=EB=A6=84?= =?UTF-8?q?=20+=20=EA=B2=80=ED=86=A0=EC=99=84=EB=A3=8C=20=EB=B2=84?= =?UTF-8?q?=ED=8A=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - detail 모드: 제목에 "김두수 근무 비교" 작업자 이름 표시 - 하단에 "검토완료" 버튼 → POST /admin-check → 목록 복귀 - 목록에서 ✓검토 뱃지로 구별 Co-Authored-By: Claude Opus 4.6 (1M context) --- system1-factory/web/js/monthly-comparison.js | 31 +++++++++++++++++++ .../pages/attendance/monthly-comparison.html | 9 +++++- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/system1-factory/web/js/monthly-comparison.js b/system1-factory/web/js/monthly-comparison.js index b023b87..5995de8 100644 --- a/system1-factory/web/js/monthly-comparison.js +++ b/system1-factory/web/js/monthly-comparison.js @@ -164,10 +164,23 @@ async function loadMyRecords() { } comparisonData = res.data; + + // detail 모드: 작업자 이름 표시 + if (currentMode === 'detail' && comparisonData.user) { + document.getElementById('pageTitle').textContent = + (comparisonData.user.worker_name || '') + ' 근무 비교'; + } + renderSummaryCards(comparisonData.summary); renderMismatchAlert(comparisonData.summary); renderDailyList(comparisonData.daily_records || []); renderConfirmationStatus(comparisonData.confirmation); + + // detail 모드: 검토완료 버튼 표시 + var adminCheckBtn = document.getElementById('adminCheckBtn'); + if (adminCheckBtn && currentMode === 'detail') { + adminCheckBtn.classList.remove('hidden'); + } } catch (e) { listEl.innerHTML = '

네트워크 오류

'; } @@ -511,6 +524,24 @@ async function downloadExcel() { } } +// ===== Admin Check (검토완료 태깅) ===== +async function markAdminChecked() { + if (!currentUserId || isProcessing) return; + isProcessing = true; + try { + var res = await window.apiCall('/monthly-comparison/admin-check', 'POST', { + user_id: currentUserId, year: currentYear, month: currentMonth, checked: true + }); + if (res && res.success) { + showToast((comparisonData?.user?.worker_name || '') + ' 검토완료', 'success'); + history.back(); + } else { + showToast(res?.message || '처리 실패', 'error'); + } + } catch (e) { showToast('네트워크 오류', 'error'); } + finally { isProcessing = false; } +} + // ===== Review Send (확인요청 일괄 발송) ===== async function sendReviewAll() { if (isProcessing) return; diff --git a/system1-factory/web/pages/attendance/monthly-comparison.html b/system1-factory/web/pages/attendance/monthly-comparison.html index 6370618..705226b 100644 --- a/system1-factory/web/pages/attendance/monthly-comparison.html +++ b/system1-factory/web/pages/attendance/monthly-comparison.html @@ -86,6 +86,13 @@ + + + @@ -162,7 +169,7 @@ - +