@extends('layouts.app') @section('title', '문서 상세') @section('content')
{{-- 헤더 --}}

문서 상세

{{ $document->document_no }} - {{ $document->title }}

@if($document->status === 'DRAFT' || $document->status === 'REJECTED') 수정 @endif 목록으로
{{-- 문서 정보 --}}
{{-- 메인 컨텐츠 --}}
{{-- 기본 정보 --}}

기본 정보

문서번호
{{ $document->document_no }}
템플릿
{{ $document->template->name ?? '-' }}
제목
{{ $document->title }}
상태
{{ $document->status_label }}
작성자
{{ $document->creator->name ?? '-' }}
작성일
{{ $document->created_at?->format('Y-m-d H:i') ?? '-' }}
@if($document->updated_at && $document->updated_at->ne($document->created_at))
수정자
{{ $document->updater->name ?? '-' }}
수정일
{{ $document->updated_at?->format('Y-m-d H:i') ?? '-' }}
@endif
{{-- 기본 필드 데이터 --}} @if($document->template?->basicFields && $document->template->basicFields->count() > 0)

{{ $document->template->title ?? '문서 정보' }}

@foreach($document->template->basicFields as $field) @php $fieldData = $document->data->where('field_key', $field->field_key)->first(); $value = $fieldData?->field_value ?? '-'; @endphp
{{ $field->label }}
{{ $value }}
@endforeach
@endif {{-- 섹션 데이터 (테이블) --}} @if($document->template?->sections && $document->template->sections->count() > 0) @foreach($document->template->sections as $section)

{{ $section->name }}

테이블 형태의 데이터 표시는 추후 구현 예정입니다.

@endforeach @endif {{-- 첨부파일 --}} @if($document->attachments && $document->attachments->count() > 0)

첨부파일

    @foreach($document->attachments as $attachment)
  • {{ $attachment->file->original_name ?? '파일명 없음' }}

    {{ $attachment->type_label }} · {{ $attachment->file ? number_format($attachment->file->size / 1024, 1) . ' KB' : '-' }}

    @if($attachment->file) 다운로드 @endif
  • @endforeach
@endif
{{-- 사이드바 --}}
{{-- 결재 현황 --}}

결재 현황

@if($document->approvals && $document->approvals->count() > 0)
    @foreach($document->approvals->sortBy('step_order') as $approval)
  1. @if($approval->status === 'APPROVED') @elseif($approval->status === 'REJECTED') @else {{ $approval->step_order }} @endif

    {{ $approval->user->name ?? '미지정' }}

    {{ $approval->step_name }}

    @if($approval->approved_at)

    {{ $approval->approved_at->format('Y-m-d H:i') }}

    @endif @if($approval->comment)

    {{ $approval->comment }}

    @endif
  2. @endforeach
@else

결재선이 설정되지 않았습니다.

@endif
{{-- 문서 이력 --}}

문서 이력

문서 이력 기능은 추후 구현 예정입니다.

@endsection