@if(($viewerDeptKey || $isApplicant || $user->role === 'admin') && $hp->receiver_id)
交接給:{{ $hp->receiver?->name }}
@if($hp->receiver_confirmed_at)
— 已於 {{ $hp->receiver_confirmed_at->format('Y-m-d H:i') }} 確認交接完成
@else
— 尚未確認交接完成
@endif
@if(!$hp->receiver_confirmed_at && ($isApplicant || $viewerDeptKey || $user->role === 'admin') && !in_array($handover->status, ['draft','approved','rejected']))
@endif
@endif
@if($isApplicant || $user->role === 'admin')
@if($handover->isEditable() && $isApplicant)
@else
{{ $hp->receiver?->name ?? '—' }}
@endif
@if($handover->isEditable() && $isApplicant)
@else
{{ $hp->notes ?? '—' }}
@endif
@endif
@if(isset($receiverProjectIds) && $receiverProjectIds->has($hp->id))
@if($hp->receiver_confirmed_at)
{{ $hp->receiverConfirmer?->name }} 已於 {{ $hp->receiver_confirmed_at->format('Y-m-d H:i') }} 確認交接完成
@else
尚未確認交接完成
@endif
@endif
@php $projRespsByDept = $projResps->groupBy(fn($r) => $r->template->department); @endphp
@foreach(['business'=>'專案業務組','rd'=>'軟體開發組','systems'=>'系統資安組','admin'=>'人事'] as $dept => $deptLabel)
@php
$dRs = $projRespsByDept[$dept] ?? collect();
$isDeptStage = $currentStage === $dept;
$canConfirmItem = !$isApplicant && !in_array($handover->status, ['draft','rejected'])
&& ($user->role === 'admin' || $viewerDeptKey === $dept);
@endphp
@if($viewerDeptKey && $viewerDeptKey !== $dept) @continue @endif
@if($dRs->isNotEmpty())
{{ $deptLabel }}
@foreach($dRs as $resp)
@include('handovers._response_item', ['resp'=>$resp,'handover'=>$handover,'isApplicant'=>$isApplicant,'isThisStage'=>$isDeptStage,'canApprove'=>$canApprove,'canConfirmItem'=>$canConfirmItem])
@endforeach
@endif
@endforeach