diff --git a/frontend/app/(main)/approval/page.tsx b/frontend/app/(main)/approval/page.tsx index 4b57371b..6b66c7a1 100644 --- a/frontend/app/(main)/approval/page.tsx +++ b/frontend/app/(main)/approval/page.tsx @@ -16,6 +16,7 @@ import { type ApprovalRequest, type ApprovalLine, } from "@/lib/api/approval"; +import { useAuth } from "@/hooks/useAuth"; // 상태 배지 색상 const statusConfig: Record = { @@ -204,12 +205,17 @@ function ApprovalDetailModal({ request, open, onClose, onRefresh, pendingLineId // 결재 대기 행 (ApprovalLine 기반) function ApprovalLineRow({ line, onClick }: { line: ApprovalLine; onClick: () => void }) { + const { user } = useAuth(); const statusInfo = lineStatusConfig[line.status] || { label: line.status, icon: null }; const createdAt = line.request_created_at || line.created_at; const formattedDate = createdAt ? new Date(createdAt).toLocaleDateString("ko-KR", { year: "2-digit", month: "2-digit", day: "2-digit" }) : "-"; + // 대무 받은 결재: 현재 사용자가 본인이 아닌 다른 사람(원본 결재자)에게 배정된 라인을 보고 있음 + const isProxy = user?.user_id != null && line.approver_id != null + && user.user_id !== line.approver_id; + return ( + + + {error && !dialogOpen && ( +
{error}
+ )} + + {loading ? ( +
불러오는 중...
+ ) : rows.length === 0 ? ( +
지정된 대무자가 없습니다.
+ ) : ( + + + + + + + + + + + + {rows.map((r) => ( + + + + + + + + ))} + +
대무자기간사유상태
+ {r.proxy_user_name || r.proxy_user_id} + {r.proxy_dept_name && ( + ({r.proxy_dept_name}) + )} + + {r.start_date ?? "즉시"} ~ {r.end_date} + {r.reason ?? "-"}{statusBadge(r)} + +
+ )} + + + + + 대무자 지정 + + +
+
+ + setForm({ ...form, proxy_user_id: e.target.value })} + placeholder="예: hjkim" + autoFocus + /> +

+ 같은 회사 사용자만 지정 가능. SUPER_ADMIN 은 지정 불가. +

+
+ +
+
+ + setForm({ ...form, start_date: e.target.value })} + /> +

비우면 즉시 시작

+
+
+ + setForm({ ...form, end_date: e.target.value })} + /> +

그 날까지 유효

+
+
+ +
+ +