@extends('layouts.app') @section('title', '交接審核管理') @section('content')

交接審核管理

返回清單 @if(auth()->user()->role === 'admin') @endif 歷史審核紀錄
@foreach(['success','error'] as $t) @if(session($t))
{{ session($t) }}
@endif @endforeach @php $user = auth()->user(); @endphp @if($user->role === 'supervisor') {{-- Supervisor: pending approvals waiting for them --}} @if($pending->isEmpty())
目前無待審核的交接申請
@else
待我審核({{ $pending->count() }})
@foreach($pending as $a) @php $h = $a->handover; $sl = $h->statusLabel(); @endphp @endforeach
申請人 類型 預計日期 目前關卡 送出時間
{{ $h->applicant->name }} {{ $h->type === 'resignation' ? '離職' : '調職' }} {{ $h->expected_date?->format('Y-m-d') ?? '—' }} {{ $sl['label'] }} {{ $h->updated_at->format('Y-m-d') }} 審核
@endif {{-- Pipeline: handovers heading toward this supervisor's stage --}} @if($inProgress->isNotEmpty())
審核中(尚未到我的關卡,{{ $inProgress->count() }})
@foreach($inProgress as $h) @php $sl = $h->statusLabel(); @endphp @endforeach
申請人 類型 預計日期 目前關卡
{{ $h->applicant->name }} {{ $h->type === 'resignation' ? '離職' : '調職' }} {{ $h->expected_date?->format('Y-m-d') ?? '—' }} {{ $sl['label'] }} 檢視
@endif @else {{-- Admin: boss-stage pending first, then other in-progress --}} {{-- 待營運長核准 --}} @if($pending->isNotEmpty())
待我核准(營運長關卡,{{ $pending->count() }})
@foreach($pending as $a) @php $h = $a->handover; @endphp @endforeach
申請人類型預計日期送出時間
{{ $h->applicant->name }} {{ $h->type === 'resignation' ? '離職' : '調職' }} {{ $h->expected_date?->format('Y-m-d') ?? '—' }} {{ $h->updated_at->format('Y-m-d') }} 審核
@endif {{-- 其他在途(尚未到營運長關卡) --}} @if($byStage->isNotEmpty()) @foreach(\App\Models\Handover::STAGES as $status => $info) @if($status === 'stage_5') @continue @endif @php $group = $byStage[$status] ?? collect(); @endphp @if($group->isNotEmpty()) @php $sl = \App\Models\Handover::STATUS_LABELS[$status]; @endphp
{{ $sl['label'] }} {{ $info['label'] }}關卡({{ $group->count() }} 件)
@foreach($group as $h) @endforeach
申請人類型預計日期送出時間
{{ $h->applicant->name }} {{ $h->type === 'resignation' ? '離職' : '調職' }} {{ $h->expected_date?->format('Y-m-d') ?? '—' }} {{ $h->updated_at->format('Y-m-d') }} 查看
@endif @endforeach @endif @if($pending->isEmpty() && $byStage->isEmpty())
目前無進行中的交接申請
@endif @endif
@endsection