feat: [approval] 결재서명란 테이블 추가 (전통 결재 양식)
- 문서 상세 우측 상단에 결재서명란 테이블 배치 - 작성자 + 결재자 컬럼, 직급/이름/서명/날짜 표시 - 승인/반려/보류/전결 상태별 도장 아이콘 - 기존 원형 타임라인 결재 진행 제거, 결재 의견만 유지
This commit is contained in:
@@ -0,0 +1,83 @@
|
||||
{{--
|
||||
결재서명란 (전통 테이블 형식)
|
||||
Props:
|
||||
$approval (Approval model) - 결재 문서
|
||||
--}}
|
||||
@php
|
||||
$drafter = $approval->drafter;
|
||||
$approverSteps = $approval->steps->whereIn('step_type', ['approval', 'agreement'])->sortBy('step_order')->values();
|
||||
@endphp
|
||||
|
||||
<table style="border-collapse: collapse; border: 2px solid #4338ca; font-size: 12px; min-width: 120px;">
|
||||
<tbody>
|
||||
{{-- 1행: 직급/역할 --}}
|
||||
<tr>
|
||||
<td rowspan="3" style="border: 1px solid #a5b4fc; padding: 4px 6px; text-align: center; font-weight: 700; color: #4338ca; background: #eef2ff; writing-mode: vertical-rl; letter-spacing: 6px; width: 28px; font-size: 13px;">
|
||||
결재
|
||||
</td>
|
||||
<td style="border: 1px solid #c7d2fe; padding: 4px 10px; text-align: center; font-weight: 600; color: #374151; background: #f9fafb; min-width: 64px; white-space: nowrap;">
|
||||
작성자
|
||||
</td>
|
||||
@foreach($approverSteps as $step)
|
||||
<td style="border: 1px solid #c7d2fe; padding: 4px 10px; text-align: center; font-weight: 600; color: #374151; background: #f9fafb; min-width: 64px; white-space: nowrap;">
|
||||
{{ $step->approver_position ?: ($step->step_type === 'agreement' ? '합의' : '결재') }}
|
||||
</td>
|
||||
@endforeach
|
||||
</tr>
|
||||
{{-- 2행: 서명/도장 영역 --}}
|
||||
<tr>
|
||||
<td style="border: 1px solid #c7d2fe; padding: 6px 10px; text-align: center; height: 40px; vertical-align: middle;">
|
||||
@if(in_array($approval->status, ['pending', 'approved', 'rejected', 'cancelled', 'on_hold']))
|
||||
<span style="color: #2563eb; font-size: 11px; font-weight: 500;">{{ $drafter?->name ?? '-' }}</span>
|
||||
@endif
|
||||
</td>
|
||||
@foreach($approverSteps as $step)
|
||||
<td style="border: 1px solid #c7d2fe; padding: 6px 10px; text-align: center; height: 40px; vertical-align: middle;">
|
||||
@if($step->status === 'approved')
|
||||
@if(($step->approval_type ?? 'normal') === 'pre_decided')
|
||||
<div style="display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 2px solid #6366f1; border-radius: 50%; color: #6366f1; font-size: 9px; font-weight: 700; line-height: 1;">
|
||||
전결
|
||||
</div>
|
||||
@else
|
||||
<div style="display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 2px solid #dc2626; border-radius: 50%; color: #dc2626; font-size: 9px; font-weight: 700; line-height: 1;">
|
||||
승인
|
||||
</div>
|
||||
@endif
|
||||
@elseif($step->status === 'rejected')
|
||||
<div style="display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 2px solid #dc2626; border-radius: 50%; color: #dc2626; font-size: 9px; font-weight: 700; line-height: 1;">
|
||||
반려
|
||||
</div>
|
||||
@elseif($step->status === 'on_hold')
|
||||
<div style="display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 2px solid #d97706; border-radius: 50%; color: #d97706; font-size: 9px; font-weight: 700; line-height: 1;">
|
||||
보류
|
||||
</div>
|
||||
@elseif($step->status === 'skipped')
|
||||
<span style="color: #9ca3af; font-size: 10px;">-</span>
|
||||
@endif
|
||||
</td>
|
||||
@endforeach
|
||||
</tr>
|
||||
{{-- 3행: 이름 + 처리일시 --}}
|
||||
<tr>
|
||||
<td style="border: 1px solid #c7d2fe; padding: 3px 10px; text-align: center; white-space: nowrap;">
|
||||
@if(in_array($approval->status, ['pending', 'approved', 'rejected', 'cancelled', 'on_hold']))
|
||||
<div style="font-size: 10px; color: #6b7280;">
|
||||
{{ $approval->drafted_at?->format('m/d') ?? '' }}
|
||||
</div>
|
||||
@endif
|
||||
</td>
|
||||
@foreach($approverSteps as $step)
|
||||
<td style="border: 1px solid #c7d2fe; padding: 3px 10px; text-align: center; white-space: nowrap;">
|
||||
<div style="font-size: 11px; color: #374151; font-weight: 500;">
|
||||
{{ $step->approver_name ?? ($step->approver?->name ?? '') }}
|
||||
</div>
|
||||
@if($step->acted_at)
|
||||
<div style="font-size: 10px; color: #6b7280;">
|
||||
{{ $step->acted_at->format('m/d') }}
|
||||
</div>
|
||||
@endif
|
||||
</td>
|
||||
@endforeach
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -23,7 +23,8 @@ class="bg-gray-600 hover:bg-gray-700 text-white px-4 py-2 rounded-lg transition
|
||||
|
||||
{{-- 문서 정보 --}}
|
||||
<div class="bg-white rounded-lg shadow-sm p-6 mb-6">
|
||||
<div class="flex flex-wrap gap-y-3 mb-4" style="gap-column: 0;">
|
||||
<div class="flex justify-between items-start gap-4 mb-4">
|
||||
<div class="flex flex-wrap gap-y-3" style="gap-column: 0;">
|
||||
<div class="pr-6 border-r border-gray-200 mr-6">
|
||||
<span class="text-xs text-gray-500">상태</span>
|
||||
<div class="mt-1">
|
||||
@@ -63,6 +64,12 @@ class="bg-gray-600 hover:bg-gray-700 text-white px-4 py-2 rounded-lg transition
|
||||
@endif
|
||||
</div>
|
||||
|
||||
{{-- 결재서명란 --}}
|
||||
<div class="shrink-0">
|
||||
@include('approvals.partials._approval-stamp-table', ['approval' => $approval])
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- 회수 사유 표시 --}}
|
||||
@if($approval->status === 'cancelled' && $approval->recall_reason)
|
||||
<div class="mb-4 p-3 bg-yellow-50 border border-yellow-200 rounded-lg">
|
||||
@@ -85,21 +92,13 @@ class="bg-gray-600 hover:bg-gray-700 text-white px-4 py-2 rounded-lg transition
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- 결재 진행 단계 --}}
|
||||
<div class="bg-white rounded-lg shadow-sm p-6 mb-6">
|
||||
<h3 class="text-lg font-semibold text-gray-800 mb-2">결재 진행</h3>
|
||||
@include('approvals.partials._step-progress', [
|
||||
'steps' => $approval->steps->toArray(),
|
||||
'currentStep' => $approval->current_step,
|
||||
])
|
||||
|
||||
{{-- 결재 의견 목록 --}}
|
||||
{{-- 결재 의견 --}}
|
||||
@php
|
||||
$stepsWithComments = $approval->steps->filter(fn($s) => $s->comment);
|
||||
@endphp
|
||||
@if($stepsWithComments->isNotEmpty())
|
||||
<div class="mt-4 border-t pt-4">
|
||||
<h4 class="text-sm font-medium text-gray-700 mb-2">결재 의견</h4>
|
||||
<div class="bg-white rounded-lg shadow-sm p-6 mb-6">
|
||||
<h3 class="text-lg font-semibold text-gray-800 mb-2">결재 의견</h3>
|
||||
<div class="space-y-2">
|
||||
@foreach($stepsWithComments as $step)
|
||||
<div class="flex gap-3 p-3 bg-gray-50 rounded-lg">
|
||||
@@ -134,7 +133,6 @@ class="bg-gray-600 hover:bg-gray-700 text-white px-4 py-2 rounded-lg transition
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
{{-- 결재 처리 (승인/반려/보류/전결) --}}
|
||||
@if($approval->isActionable() && $approval->isCurrentApprover(auth()->id()))
|
||||
|
||||
Reference in New Issue
Block a user