@extends('layouts.app') @section('title', '周次管理(Sprint)') @section('content')

周次管理

新增週次
@if(session('success'))
{{ session('success') }}
@endif {{-- 篩選 --}}
重置
共 {{ $sprints->total() }} 筆
{{-- 表格 --}} @if($sprints->isEmpty())
{{ $year }} 年度尚無周次記錄。
@else
@foreach($sprints as $sprint) @php $requiredUsers = is_array($sprint->required_users) ? $sprint->required_users : (is_string($sprint->required_users) ? json_decode($sprint->required_users, true) : []); $requiredUsers = $requiredUsers ?? []; $userCount = count($requiredUsers); $totalManDays = collect($requiredUsers)->sum(fn($u) => (float)($u['man_days'] ?? 0)); @endphp @endforeach
週次 名稱 狀態 期間 天數 人員需求 操作
W{{ $sprint->week }} {{ $sprint->name }} {{ $sprint->status_label }} @if($sprint->status === 'active')
剩 {{ $sprint->days_remaining }} 天
@endif
{{ $sprint->start_date->format('Y/m/d') }} {{ $sprint->end_date->format('Y/m/d') }} {{ $sprint->duration_days }} @if($userCount > 0) {{ $userCount }} 人 {{ $totalManDays }} 人日 @else @endif
{{ $sprints->links() }}
@endif

週次由系統每週日 23:00 自動建立(預建兩週),並自動更新本週狀態為「進行中」、過期週次為「已完成」。

{{-- 刪除確認表單 --}} @endsection @push('scripts') @endpush