@extends('layouts.app') @section('title', '離職/調職交接') @section('content')

離職/調職交接

@if(auth()->user()->role !== 'admin') 申請交接 @endif
{{-- 待我審核 --}} @if($pendingApprovals->isNotEmpty())
待我審核({{ $pendingApprovals->count() }})
@endif {{-- 我需要確認的交接(被交接人) --}} @if($receiverHandovers->isNotEmpty())
我需要確認的交接({{ $receiverHandovers->count() }})
@foreach($receiverHandovers as $h) @php $myProjects = $h->projects; // already filtered in controller $allConfirmed = $myProjects->every(fn($p) => $p->receiver_confirmed_at !== null); $confirmedCount = $myProjects->where('receiver_confirmed_at', '!=', null)->count(); $sl = $h->statusLabel(); @endphp {{ $h->applicant->name }} {{ $h->type === 'resignation' ? '離職' : '調職' }} 專案:{{ $myProjects->map(fn($p) => $p->project->name)->join('、') }} @if($allConfirmed) 已全部確認 @elseif($confirmedCount > 0) 確認中({{ $confirmedCount }}/{{ $myProjects->count() }}) @else 待確認 @endif @endforeach
@endif {{-- 申請清單 --}}
交接申請紀錄
@if($handovers->isEmpty())
尚無交接申請
@else
@foreach($handovers as $h) @php $sl = $h->statusLabel(); @endphp @endforeach
申請人 類型 預計日期 狀態 申請時間
{{ $h->applicant->name }} {{ $h->type === 'resignation' ? '🚪 離職' : '🔄 調職' }} {{ $h->expected_date?->format('Y-m-d') ?? '—' }} {{ $sl['label'] }} {{ $h->created_at->format('Y-m-d') }} 查看 @if($h->isDeletable() && $h->applicant_id === auth()->id())
@csrf @method('DELETE')
@endif
@if($handovers->hasPages()) @endif @endif
@if(auth()->user()->role === 'admin' || auth()->user()->role === 'supervisor')
管理交接項目範本
@endif
@endsection