@extends('layouts.app') @section('content')

Рекламация

@if(hasRole('admin') && !is_null($reclamation->brigadier_id) && !is_null($reclamation->start_work_date)) @endif @if(hasRole('admin,manager')) Пакет документов рекламации @endif @if(hasRole('admin')) Удалить
@csrf @method('DELETE')
@endif
@csrf @include('partials.input', ['name' => 'order_name', 'title' => 'Площадка', 'disabled' => true, 'value' => $reclamation->order->common_name ?? '']) @include('partials.select', ['name' => 'status_id', 'title' => 'Статус', 'options' => $statuses, 'value' => $reclamation->status_id ?? old('status_id'), 'disabled' => !hasRole('admin,manager')]) @include('partials.select', ['name' => 'user_id', 'title' => 'Менеджер', 'options' => $users, 'value' => $reclamation->user_id ?? old('user_id') ?? auth()->user()->id, 'disabled' => !hasRole('admin,manager')]) @include('partials.input', ['name' => 'create_date', 'title' => 'Дата создания', 'type' => 'date', 'required' => true, 'value' => $reclamation->create_date ?? date('Y-m-d'), 'disabled' => !hasRole('admin,manager')]) @include('partials.input', ['name' => 'finish_date', 'title' => 'Дата завершения', 'type' => 'date', 'required' => true, 'value' => $reclamation->finish_date ?? date('Y-m-d', strtotime('+30 days')), 'disabled' => !hasRole('admin,manager')]) @include('partials.select', ['name' => 'brigadier_id', 'title' => 'Бригадир', 'options' => $brigadiers, 'value' => $reclamation->brigadier_id ?? old('brigadier_id'), 'disabled' => !hasRole('admin,manager'), 'first_empty' => true]) @include('partials.input', ['name' => 'start_work_date', 'title' => 'Дата начала работ', 'type' => 'date', 'value' => $reclamation->start_work_date, 'disabled' => !hasRole('admin,manager')]) @include('partials.input', ['name' => 'work_days', 'title' => 'Срок работ, дней', 'type' => 'number', 'min' => 1, 'value' => $reclamation->work_days, 'disabled' => !hasRole('admin,manager')]) @include('partials.select', ['name' => 'reason', 'title' => 'Причина', 'size' => 6, 'value' => $reclamation->reason ?? '', 'options' => ['Вандализм', 'Гарантия', 'Сервисное обслуживание'], 'key_as_val' => true, 'disabled' => !hasRole('admin,manager')]) @include('partials.textarea', ['name' => 'guarantee', 'title' => 'Гарантии', 'size' => 6, 'value' => $reclamation->guarantee ?? '', 'disabled' => !hasRole('admin,manager')]) @include('partials.textarea', ['name' => 'whats_done', 'title' => 'Что сделано', 'size' => 6, 'value' => $reclamation->whats_done ?? '', 'disabled' => !hasRole('admin,manager')]) @include('partials.textarea', ['name' => 'comment', 'title' => 'Комментарий', 'size' => 6, 'value' => $reclamation->comment ?? '', 'disabled' => !hasRole('admin,manager')]) @include('partials.submit', ['name' => 'Сохранить', 'offset' => 5, 'disabled' => !hasRole('admin,manager'), 'backurl' => route('reclamations.index', session('gp_reclamations'))])
@foreach($reclamation->skus as $p) @endforeach
Картинка МАФ Тип Номер заказа МАФ RFID Заводской номер Дата производства
@if($p->product->image) @endif @if(hasRole('admin,manager')) {!! $p->product->article !!}
каталог @endif
{!! $p->product->nomenclature_number !!} @if($p->maf_order_id && hasRole('admin,manager')) {{ $p->maf_order->order_number }} @endif {{ $p->rfid }} {{ $p->factory_number }} {{ $p->manufacture_date }}
@php $activeReservationsCount = $reclamation->activeReservations()->count(); $openShortagesCount = $reclamation->openShortages()->count(); @endphp Запчасти ({{ $reclamation->spareParts->count() }}) @if($activeReservationsCount > 0) {{ $activeReservationsCount }} резерв @endif @if($openShortagesCount > 0) {{ $openShortagesCount }} дефицит @endif
@csrf
@forelse($reclamation->spareParts as $idx => $sp)
pivot->with_documents) @disabled(!hasRole('admin,manager'))>
@empty
@endforelse
Добавить строку
@if($errors->any()) @dump($errors->all()) @endif
{{-- Резервы и дефициты --}} @php $reservations = $reclamation->sparePartReservations() ->with('sparePart', 'sparePartOrder') ->orderByDesc('created_at') ->get(); $shortages = $reclamation->sparePartShortages() ->with('sparePart') ->orderByDesc('created_at') ->get(); @endphp @if($reservations->count() > 0 || $shortages->count() > 0)
{{-- Активные резервы --}} @if($reservations->where('status', 'active')->count() > 0)
Активные резервы @if(hasRole('admin,manager')) @endif @foreach($reservations->where('status', 'active') as $reservation) @if(hasRole('admin,manager')) @endif @endforeach
Запчасть Кол-во С док. Партия
@if($reservation->sparePart) {{ $reservation->sparePart->article }} @else - @endif {{ $reservation->reserved_qty }} @if($reservation->with_documents) @else @endif @if($reservation->sparePartOrder) #{{ $reservation->sparePartOrder->id }} @else - @endif
@csrf
@csrf
@if(hasRole('admin,manager') && $reservations->where('status', 'active')->count() > 1)
@csrf
@csrf
@endif
@endif {{-- Списанные --}} @if($reservations->where('status', 'issued')->count() > 0)
Списано @foreach($reservations->where('status', 'issued') as $reservation) @endforeach
Запчасть Кол-во С док. Партия Дата
@if($reservation->sparePart) {{ $reservation->sparePart->article }} @else - @endif {{ $reservation->reserved_qty }} @if($reservation->with_documents) @else @endif @if($reservation->sparePartOrder) #{{ $reservation->sparePartOrder->id }} @else - @endif {{ $reservation->updated_at->format('d.m.Y H:i') }}
@endif {{-- Открытые дефициты --}} @if($shortages->where('status', 'open')->count() > 0)
Дефициты (нехватка) @foreach($shortages->where('status', 'open') as $shortage) @endforeach
Запчасть Требуется Зарезервировано Не хватает С док.
@if($shortage->sparePart) {{ $shortage->sparePart->article }} @else - @endif {{ $shortage->required_qty }} {{ $shortage->reserved_qty }} {{ $shortage->missing_qty }} @if($shortage->with_documents) @else @endif
@endif
@endif

Документы @if(hasRole('admin,manager'))
@csrf
@endif
@foreach($reclamation->documents as $document)
{{ $document->original_name }} @if(hasRole('admin')) @endif
@csrf @method('DELETE')
@endforeach

Акты @if(hasRole('admin,manager'))
@csrf
@endif
@foreach($reclamation->acts as $act)
{{ $act->original_name }} @if(hasRole('admin'))
@csrf @method('DELETE')
@endif
@endforeach

Фотографии проблемы ({{ $reclamation->photos_before->count() }}) @if($reclamation->photos_before->count()) Скачать все @endif
@csrf
@foreach($reclamation->photos_before as $photo)
@if(hasRole('admin')) @endif
@csrf @method('DELETE')
@endforeach

Фотографии после устранения ({{ $reclamation->photos_after->count() }}) @if($reclamation->photos_after->count()) Скачать все @endif
@csrf
@foreach($reclamation->photos_after as $photo)
@if(hasRole('admin')) @endif
@csrf @method('DELETE')
@endforeach
@endsection @push('styles') @endpush @push('scripts') @endpush