feat(proxy-input): 대리입력 리뉴얼 — 2단계 UI + UPSERT + 부적합

프론트엔드:
- Step 1: 날짜 선택 → 전체 작업자 목록 (완료/미입력/휴가 구분)
- Step 2: 선택 작업자 일괄 편집 (프로젝트/공종/시간/부적합/비고)
- 연차=선택불가, 반차=4h, 반반차=6h 기본값

백엔드:
- POST /api/proxy-input UPSERT 방식 (409 제거)
- 신규: TBM 세션 자동 생성 + 작업보고서 INSERT
- 기존: 작업보고서 UPDATE
- 부적합: work_report_defects INSERT (기존 defect 있으면 SKIP)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Hyungi Ahn
2026-03-31 14:50:04 +09:00
parent b8d3a516e1
commit 3cc38791c8
4 changed files with 386 additions and 773 deletions

View File

@@ -1,256 +1,67 @@
/* proxy-input.css — 대리입력 페이지 */
/* proxy-input.css — 대리입력 리뉴얼 */
/* Header */
.pi-header {
background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
color: white;
padding: 14px 16px;
border-radius: 0 0 16px 16px;
margin: -16px -16px 0;
position: sticky;
top: 56px;
z-index: 20;
}
.pi-header-row { display: flex; align-items: center; gap: 12px; }
.pi-back-btn {
width: 32px; height: 32px;
display: flex; align-items: center; justify-content: center;
background: rgba(255,255,255,0.15);
border-radius: 8px;
border: none; color: white; cursor: pointer;
}
.pi-header h1 { font-size: 1.05rem; font-weight: 700; flex: 1; }
.pi-header-date { font-size: 0.75rem; opacity: 0.8; }
/* Title Row */
.pi-title-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.pi-title { font-size: 18px; font-weight: 700; color: #1f2937; flex: 1; }
.pi-back-btn { background: none; border: none; font-size: 18px; color: #6b7280; cursor: pointer; padding: 4px 8px; }
.pi-date-group { display: flex; align-items: center; gap: 6px; }
.pi-date-input { border: 1px solid #d1d5db; border-radius: 8px; padding: 6px 10px; font-size: 14px; }
.pi-refresh-btn { background: none; border: none; color: #6b7280; font-size: 14px; cursor: pointer; padding: 6px; }
/* Date Bar */
.pi-date-bar {
display: flex; align-items: center; justify-content: space-between;
padding: 10px 12px;
background: white;
border-radius: 10px;
margin: 12px 0 8px;
box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.pi-date-info { display: flex; align-items: center; gap: 8px; }
.pi-date-input {
border: 1px solid #e5e7eb;
border-radius: 6px;
padding: 4px 8px;
font-size: 0.8rem;
color: #374151;
}
.pi-refresh-btn {
width: 28px; height: 28px;
display: flex; align-items: center; justify-content: center;
background: #f3f4f6; border: none; border-radius: 6px;
color: #6b7280; cursor: pointer; font-size: 0.75rem;
}
.pi-status-badge {
display: flex; align-items: center; gap: 4px;
font-size: 0.8rem; color: #374151;
}
/* Status Bar */
.pi-status-bar { display: flex; gap: 16px; background: white; border-radius: 10px; padding: 10px 14px; margin-bottom: 10px; font-size: 13px; color: #6b7280; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
/* Bulk Actions Bar */
.pi-bulk {
background: #eff6ff;
border: 1px solid #bfdbfe;
border-radius: 10px;
padding: 8px 12px;
margin-bottom: 8px;
display: flex; align-items: center; justify-content: space-between;
flex-wrap: wrap; gap: 6px;
}
.pi-bulk-label { font-size: 0.75rem; font-weight: 600; color: #1d4ed8; }
.pi-bulk-actions { display: flex; gap: 4px; }
.pi-bulk-btn {
padding: 4px 10px;
font-size: 0.7rem; font-weight: 600;
background: white; color: #2563eb;
border: 1px solid #bfdbfe;
border-radius: 6px;
cursor: pointer;
}
.pi-bulk-btn:active { background: #dbeafe; }
/* Select All */
.pi-select-all { padding: 6px 2px; font-size: 13px; color: #6b7280; }
.pi-select-all input { margin-right: 6px; }
/* Worker Cards */
.pi-cards { padding-bottom: 100px; }
/* Worker List */
.pi-worker-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 80px; }
.pi-worker { display: flex; align-items: center; gap: 10px; background: white; border-radius: 10px; padding: 10px 12px; cursor: pointer; border: 2px solid transparent; transition: border-color 0.15s; }
.pi-worker:hover { border-color: #93c5fd; }
.pi-worker.disabled { opacity: 0.45; cursor: not-allowed; }
.pi-check { width: 18px; height: 18px; flex-shrink: 0; accent-color: #2563eb; }
.pi-worker-info { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.pi-worker-name { font-size: 14px; font-weight: 600; color: #1f2937; }
.pi-worker-job { font-size: 11px; color: #9ca3af; }
.pi-worker-badges { display: flex; gap: 4px; flex-shrink: 0; }
.pi-card {
background: white;
border-radius: 10px;
margin-bottom: 8px;
box-shadow: 0 1px 2px rgba(0,0,0,0.04);
overflow: hidden;
border: 2px solid transparent;
transition: border-color 0.15s;
}
.pi-card.selected { border-color: #2563eb; }
/* Badges */
.pi-badge { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 6px; }
.pi-badge.done { background: #dcfce7; color: #166534; }
.pi-badge.missing { background: #fee2e2; color: #991b1b; }
.pi-badge.vac { background: #dbeafe; color: #1e40af; }
.pi-badge.vac-half { background: #fef3c7; color: #92400e; }
.pi-card-header {
display: flex; align-items: center; gap: 10px;
padding: 12px;
cursor: pointer;
}
.pi-card-check {
width: 22px; height: 22px;
border: 2px solid #d1d5db;
border-radius: 6px;
display: flex; align-items: center; justify-content: center;
flex-shrink: 0;
transition: all 0.15s;
}
.pi-card.selected .pi-card-check {
background: #2563eb; border-color: #2563eb; color: white;
}
.pi-card-name { font-size: 0.875rem; font-weight: 600; color: #1f2937; }
.pi-card-meta { font-size: 0.7rem; color: #9ca3af; }
.pi-card-status {
margin-left: auto;
font-size: 0.65rem;
padding: 2px 6px;
border-radius: 4px;
}
.pi-card-status.both_missing { background: #fef2f2; color: #dc2626; }
.pi-card-status.tbm_only { background: #fefce8; color: #ca8a04; }
.pi-card-status.report_only { background: #fefce8; color: #ca8a04; }
/* Bottom Bar */
.pi-bottom-bar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 50; background: white; padding: 12px 16px; border-top: 1px solid #e5e7eb; box-shadow: 0 -2px 8px rgba(0,0,0,0.06); }
.pi-edit-btn, .pi-save-btn { width: 100%; padding: 12px; border: none; border-radius: 10px; font-size: 15px; font-weight: 600; color: white; cursor: pointer; }
.pi-edit-btn { background: #2563eb; }
.pi-edit-btn:hover { background: #1d4ed8; }
.pi-edit-btn:disabled { background: #9ca3af; cursor: not-allowed; }
.pi-save-btn { background: #10b981; }
.pi-save-btn:hover { background: #059669; }
.pi-save-btn:disabled { background: #9ca3af; }
/* Expanded Form */
.pi-card-form {
display: none;
padding: 0 12px 12px;
border-top: 1px solid #f3f4f6;
}
.pi-card.selected .pi-card-form { display: block; }
/* Edit Cards */
.pi-edit-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 80px; }
.pi-edit-card { background: white; border-radius: 12px; padding: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.pi-edit-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 14px; }
.pi-edit-job { font-size: 11px; color: #9ca3af; }
.pi-edit-fields { display: flex; flex-direction: column; gap: 6px; }
.pi-edit-row { display: flex; gap: 6px; }
.pi-select { flex: 1; padding: 6px 8px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 13px; background: white; }
.pi-field { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.pi-field span { font-size: 11px; color: #6b7280; font-weight: 600; }
.pi-input { padding: 6px 8px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 14px; text-align: center; }
.pi-note-input { width: 100%; padding: 6px 8px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 13px; }
.pi-field { margin-top: 8px; }
.pi-field label {
display: block;
font-size: 0.7rem; font-weight: 600;
color: #6b7280;
margin-bottom: 3px;
}
.pi-field select, .pi-field input, .pi-field textarea {
width: 100%;
border: 1px solid #e5e7eb;
border-radius: 6px;
padding: 6px 8px;
font-size: 0.8rem;
color: #374151;
background: white;
}
.pi-field textarea { resize: none; height: 48px; }
.pi-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pi-field-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
/* Bottom Save */
.pi-bottom {
position: fixed;
bottom: 0; left: 0; right: 0;
padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
background: white;
border-top: 1px solid #e5e7eb;
z-index: 30;
max-width: 480px;
margin: 0 auto;
}
.pi-save-btn {
width: 100%;
padding: 12px;
background: #2563eb;
color: white;
font-size: 0.875rem;
font-weight: 700;
border: none;
border-radius: 10px;
cursor: pointer;
transition: background 0.15s;
}
.pi-save-btn:hover { background: #1d4ed8; }
.pi-save-btn:disabled { background: #d1d5db; cursor: not-allowed; }
.pi-save-btn .fa-spinner { display: none; }
.pi-save-btn.loading .fa-spinner { display: inline; }
.pi-save-btn.loading .fa-save { display: none; }
/* Skeleton */
.pi-skeleton { height: 52px; border-radius: 10px; background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%); background-size: 200% 100%; animation: pi-shimmer 1.5s infinite; }
@keyframes pi-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
/* Empty */
.pi-empty {
display: flex; flex-direction: column; align-items: center;
gap: 8px; padding: 48px 16px; color: #9ca3af; font-size: 0.875rem;
}
.pi-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 48px 16px; color: #9ca3af; font-size: 14px; }
/* Modal */
.pi-modal-overlay {
position: fixed; inset: 0;
background: rgba(0,0,0,0.4);
z-index: 50;
display: flex; align-items: center; justify-content: center;
padding: 16px;
}
.pi-modal {
background: white;
border-radius: 12px;
width: 100%; max-width: 360px;
overflow: hidden;
}
.pi-modal-header {
display: flex; align-items: center; justify-content: space-between;
padding: 12px 16px;
border-bottom: 1px solid #f3f4f6;
font-weight: 700; font-size: 0.9rem;
}
.pi-modal-header button { background: none; border: none; color: #9ca3af; cursor: pointer; }
.pi-modal-body { padding: 16px; }
.pi-modal-body select, .pi-modal-body input {
width: 100%; border: 1px solid #e5e7eb; border-radius: 8px;
padding: 8px 10px; font-size: 0.85rem;
}
.pi-modal-footer {
display: flex; gap: 8px; padding: 12px 16px;
border-top: 1px solid #f3f4f6;
}
.pi-modal-cancel {
flex: 1; padding: 8px; border: 1px solid #e5e7eb;
border-radius: 8px; background: white; font-size: 0.8rem; cursor: pointer;
}
.pi-modal-confirm {
flex: 1; padding: 8px; background: #2563eb; color: white;
border: none; border-radius: 8px; font-size: 0.8rem; font-weight: 600; cursor: pointer;
}
/* Skeleton (reuse) */
.ds-skeleton {
height: 56px;
background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
background-size: 200% 100%;
animation: ds-shimmer 1.5s infinite;
border-radius: 10px;
margin-bottom: 6px;
}
@keyframes ds-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
/* 휴무일 배너 */
.pi-holiday-banner {
padding: 8px 12px;
background: #f0fdf4;
border: 1px solid #bbf7d0;
border-radius: 8px;
font-size: 0.8rem;
font-weight: 600;
color: #166534;
text-align: center;
margin-bottom: 8px;
}
/* 연차 비활성화 */
.pi-card.vacation-disabled { opacity: 0.5; }
.pi-card.vacation-disabled .pi-card-form { pointer-events: none; }
.pi-card.vacation-disabled .pi-card-header { cursor: default; }
.pi-vac-badge {
font-size: 0.65rem; font-weight: 600;
padding: 2px 6px; border-radius: 4px;
background: #dcfce7; color: #166534;
margin-left: 4px;
}
.ds-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 48px 16px; color: #9ca3af; font-size: 0.875rem; }
.ds-link { color: #2563eb; font-size: 0.8rem; text-decoration: underline; }
@media (max-width: 480px) { body { max-width: 480px; margin: 0 auto; } }
/* Responsive */
@media (min-width: 640px) { .pi-bottom-bar { max-width: 640px; margin: 0 auto; } }