feat(monthly-comparison): 상세 뷰 작업자 이름 + 검토완료 버튼

- detail 모드: 제목에 "김두수 근무 비교" 작업자 이름 표시
- 하단에 "검토완료" 버튼 → POST /admin-check → 목록 복귀
- 목록에서 ✓검토 뱃지로 구별

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Hyungi Ahn
2026-04-01 08:27:41 +09:00
parent 10fd65ba9e
commit 4bb4fbd225
2 changed files with 39 additions and 1 deletions

View File

@@ -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 = '<div class="mc-empty"><i class="fas fa-exclamation-triangle text-2xl text-red-300"></i><p>네트워크 오류</p></div>';
}
@@ -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;

View File

@@ -86,6 +86,13 @@
<i class="fas fa-check-circle text-green-500"></i>
<span id="confirmedText"></span>
</div>
<!-- 관리자 검토완료 버튼 (detail 모드) -->
<div class="mc-bottom-actions hidden" id="adminCheckBtn">
<button type="button" style="flex:1;padding:14px;background:#10b981;color:white;font-size:0.9rem;font-weight:700;border:none;border-radius:12px;cursor:pointer;" onclick="markAdminChecked()">
<i class="fas fa-check mr-2"></i>검토완료
</button>
</div>
</div>
<!-- ═══ 관리자 뷰 ═══ -->
@@ -162,7 +169,7 @@
<script src="/static/js/tkfb-core.js?v=2026033108"></script>
<script src="/js/api-base.js?v=2026031701"></script>
<script src="/js/monthly-comparison.js?v=2026040102"></script>
<script src="/js/monthly-comparison.js?v=2026040103"></script>
<script>initAuth();</script>
</body>
</html>