@extends('layouts.digitar') @section('Breadcrumbs') {!! Breadcrumbs::render('documents.show') !!} @endsection @section('content')

TRAMITAÇÃO

Voltar
@forelse($documents as $key => $processing) @php $observationPreview = trim(strip_tags($processing->observation ?? '')); $hasObservation = $observationPreview !== ''; $observationModalId = 'processingObservationModal' . $processing->id; $observationContentId = 'processingObservationContent' . $processing->id; $responsePreview = trim(strip_tags($processing->response_text ?? '')); $hasResponseText = $responsePreview !== ''; $responseModalId = 'processingResponseModal' . $processing->id; $responseContentId = 'processingResponseContent' . $processing->id; $authUser = Auth::user(); $canRespondStep = $authUser && ( (int) $processing->recipient_user_id === (int) $authUser->id || (!empty($authUser->sector_id) && (int) $processing->recipient_sector_id === (int) $authUser->sector_id) ); $responseUserName = optional($processing->responseUser)->short_name ?: optional($processing->responseUser)->name ?: 'Não informado'; $responseSectorName = optional($processing->responseSector)->name ?: 'Não informado'; $responseDocumentItems = $processing->responseDocumentItems; $responseDocumentLabel = $responseDocumentItems->map(function ($responseDocument) { $responseDocumentType = optional($responseDocument->document_type)->name ?? 'Documento'; $responseDocumentNumber = $responseDocument->number ?: 'Sem número'; if (!empty($responseDocument->date)) { return $responseDocumentType . ' ' . $responseDocumentNumber . '/' . $responseDocument->getYear($responseDocument->date); } return $responseDocumentType . ' ' . $responseDocumentNumber; })->implode(' | '); $responseDocumentFileId = optional($processing->responseDocumentFile)->id; $responseDocumentFileLabel = optional($processing->responseDocumentFile)->filename_origin ?: optional($processing->responseDocumentFile)->filename ?: ''; @endphp
{{ $loop->first ? 'Trâmite atual' : 'Etapa ' . $loop->iteration }}

{{ $processing->documentSituation->name }}

{{ $processing->processing_document_date }}

Status: {{ $processing->statusProcessingDocument->name ?? 'Não informado' }}

Encaminhado para: {{ optional($processing->recipientUser)->name ?? 'Não informado' }}

Setor: {{ optional($processing->recipientSector)->name ?? 'Não informado' }}

Prazo: {{ !is_null($processing->sla_days) && $processing->sla_days !== '' ? $processing->sla_days . ' dia(s) útil(eis)' : 'Não definido' }}

Vencimento: {{ !empty($processing->sla_deadline_at) ? $processing->sla_deadline_at : 'Não definido' }}

@if ($responseDocumentItems->isNotEmpty())
Documento(s) de resposta vinculado(s) @if ($responseDocumentItems->first()) Abrir documento @endif

Respondido por: {{ $responseUserName }}

Setor da resposta: {{ $responseSectorName }}

@if ($hasResponseText)
Resposta:
{!! \Illuminate\Support\Str::limit(trim(strip_tags($processing->response_text)), 130, '...') !!}
@endif @if ($processing->responseDocumentFile && !empty($processing->responseDocumentFile->filename))
{{ \Illuminate\Support\Str::limit($responseDocumentFileLabel ?: 'Arquivo sem nome', 62, '...') }} Abrir anexo
@elseif ($responseDocumentItems->flatMap(function ($responseDocument) { return $responseDocument->documentFiles; })->isNotEmpty())
@foreach ($responseDocumentItems->flatMap(function ($responseDocument) { return $responseDocument->documentFiles; }) as $file) @if (!empty($file->filename))
{{ \Illuminate\Support\Str::limit($file->filename_origin ?: 'Arquivo sem nome', 62, '...') }} Abrir anexo
@endif @endforeach
@else
Nenhum anexo vinculado a este documento.
@endif
@endif
Observação: @if ($hasObservation)
{!! \Illuminate\Support\Str::limit(trim(strip_tags($processing->observation)), 130, '...') !!}
@else
Nenhuma observação registrada.
@endif
@if ($canRespondStep) @endif @if ($processing->file) Download Arquivo @endif @if (Auth::user()->id == $processing->owner_id || $first_documents->id === $processing->id || Auth::user()->hasRole('root')) @endif
@if ($hasObservation) @endif @if ($hasResponseText) @endif @empty
Não existe tramitação
@endforelse
@endsection