@include('business.pages.partials.date-range-picker')
财务系统化待办

日常过会使用。在类型、内容或序号旁直接添加,筛选修改后仍保持当前筛选结果。

@if (is_string(session('success')) && session('success') !== '')
{{ session('success') }}
@endif @if (is_string(session('error')) && session('error') !== '')
{{ session('error') }}
@endif
全部
{{ number_format($todoSummary['total']) }}
未完成
{{ number_format($todoSummary['incomplete']) }}
已完成
{{ number_format($todoSummary['completed']) }}
@php $selectedOwners = $todoOwners->filter( static fn (string $owner): bool => in_array($owner, $todoFilters['owners'], true) ); $selectedAssignees = $todoAssignees->filter( static fn (string $assignee): bool => in_array($assignee, $todoFilters['assignees'], true) ); $ownerSummary = $selectedOwners->isEmpty() ? '全部总负责人' : '已选 ' . $selectedOwners->count() . ' 人'; $assigneeSummary = $selectedAssignees->isEmpty() ? '全部责任人' : '已选 ' . $selectedAssignees->count() . ' 人'; @endphp
总负责人
{{ $ownerSummary }}
@forelse ($todoOwners as $owner) @empty 暂无可选总负责人 @endforelse
责任人
{{ $assigneeSummary }}
@forelse ($todoAssignees as $assignee) @empty 暂无可选责任人 @endforelse
重置
@php $cleanDisplayLabel = static function (?string $value): string { return trim((string) preg_replace( '/^\s*(?:\d+|[一二三四五六七八九十百]+)\s*[、,,..::;;)]\s*/u', '', (string) $value, )); }; $personNames = static function (?string $value): array { $parts = preg_split('/[、,,;;\/]+/u', trim((string) $value)) ?: []; return collect($parts) ->map(static fn (string $name): string => trim($name)) ->filter(static fn (string $name): bool => $name !== '' && $name !== '—') ->unique() ->values() ->all(); }; $sectionLabels = $items ->map(static fn ($groupItem): string => trim((string) $groupItem->section_display)) ->all(); $titleLabels = $items ->map(static fn ($groupItem): string => $cleanDisplayLabel($groupItem->title)) ->all(); $groupValues = [ 'category' => $items->map(static fn ($groupItem): string => (string) ((int) $groupItem->type_sequence))->all(), 'section' => $items->map(static fn ($groupItem): string => (int) $groupItem->type_sequence . "\0" . (int) $groupItem->content_sequence)->all(), ]; $groupRowspans = ['category' => [], 'section' => []]; foreach (['category', 'section'] as $groupField) { $start = 0; $previous = null; $count = 0; foreach ($items as $index => $groupItem) { $current = (string) ($groupValues[$groupField][$index] ?? ''); if ($index === 0) { $start = 0; $previous = $current; $count = 1; continue; } if ($current === $previous) { $count++; continue; } if ($previous !== '' && $count > 0) { for ($rowIndex = $start; $rowIndex < $start + $count; $rowIndex++) { $groupRowspans[$groupField][$rowIndex] = $rowIndex === $start ? $count : 0; } } $start = $index; $previous = $current; $count = 1; } if ($previous !== null && $previous !== '' && $count > 0) { for ($rowIndex = $start; $rowIndex < $start + $count; $rowIndex++) { $groupRowspans[$groupField][$rowIndex] = $rowIndex === $start ? $count : 0; } } } $highlightId = max(0, (int) request('highlight', 0)); @endphp
@forelse ($items as $item) @php $statusClass = $item->isCompleted() ? 'sys-todo-badge--completed' : 'sys-todo-badge--incomplete'; $displayProgress = $item->displayProgress(); $todoPayload = [ 'id' => $item->id, 'position' => (int) $item->item_sequence, 'category' => $item->category ?? '', 'section' => $sectionLabels[$loop->index] ?? '', 'title' => $titleLabels[$loop->index] ?? '', 'owner' => $item->owner_display ?? '', 'assignee' => $item->assignee ?? '', 'start_date' => $item->start_date?->format('Y-m-d') ?? '', 'start_note' => $item->start_note ?? '', 'due_date' => $item->due_date?->format('Y-m-d') ?? '', 'due_note' => $item->due_note ?? '', 'status' => $item->status_label, 'completed_at' => $item->completed_at?->format('Y-m-d') ?? '', 'progress' => $item->progress ?? '', 'attachments' => $item->attachments->map(static fn ($attachment): array => [ 'id' => $attachment->id, 'name' => $attachment->original_name, 'url' => route('business.systemization-todos.attachments.show', [ 'todo' => $item->id, 'attachment' => $attachment->id, ]), 'delete_url' => route('business.systemization-todos.grid-attachment-destroy', [ 'todo' => $item->id, 'attachment' => $attachment->id, ]), ])->values()->all(), ]; $todoPayloadEncoded = base64_encode(json_encode($todoPayload, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)); $categorySpan = $groupRowspans['category'][$loop->index] ?? 1; $sectionSpan = $groupRowspans['section'][$loop->index] ?? 1; @endphp @if ($categorySpan !== 0) @endif @if ($sectionSpan !== 0) @endif @php($ownerNames = $personNames($item->owner_display ?? null)) @php($assigneeNames = $personNames($item->assignee)) @php($startGridValue = $item->start_date?->format('Y-m-d') ?: (string) ($item->start_note ?? '')) @php($dueGridValue = $item->due_date?->format('Y-m-d') ?: (string) ($item->due_note ?? '')) @empty @endforelse
类型 内容 待办事项序号 待办事项 创建人 创建时间 总负责人 责任人 开始时间 完成时间 提醒 状态 完成情况
1) rowspan="{{ $categorySpan }}" @endif title="点击类型文字直接编辑"> {{ (int) $item->type_sequence }} {{ $item->category_display ?: '未分类' }} 1) rowspan="{{ $sectionSpan }}" @endif title="点击内容文字直接编辑"> {{ (int) $item->content_sequence }} {{ $sectionLabels[$loop->index] ?: '未填写内容' }} {{ (int) $item->item_sequence }} @if ($canDeleteTodos) @endif
{{ $titleLabels[$loop->index] }} @if ($item->attachments->isNotEmpty()) @endif
{{ $item->creator?->name ?: '—' }} {{ $item->creationTimeLabel() ?: '—' }} @if ($ownerNames === []) — @else @foreach ($ownerNames as $ownerName) {{ $ownerName }} @endforeach @endif @if ($assigneeNames === []) — @else @foreach ($assigneeNames as $assigneeName) {{ $assigneeName }} @endforeach @endif {{ $startGridValue ?: '—' }} {{ $dueGridValue ?: '—' }} {{ $item->reminder_label }} {{ $item->status_label }}
完成情况 {{ $displayProgress ?: '—' }}
当前筛选条件下没有待办事项。

系统化待办 · 操作记录

按北京时间记录并长期保留,可选择日期查看;单次最多显示 500 条
时间 操作 类型 / 内容 / 待办事项 变更内容 操作人

已逾期待办

正在加载…
@csrf @method('DELETE')
确认删除待办
删除后这条待办及其完成截图将不再显示,操作无法撤销。 当前待办

完成截图预览

在新页面打开原图