|
|
@@ -8,11 +8,13 @@
|
|
|
<h4>Рекламация</h4>
|
|
|
</div>
|
|
|
<div class="col-xl-6 text-end mb-2">
|
|
|
+ @if(hasRole('admin') && !is_null($reclamation->brigadier_id) && !is_null($reclamation->start_work_date))
|
|
|
+ <button class="btn btn-sm btn-primary" id="createScheduleButton">Перенести в график</button>
|
|
|
+ @endif
|
|
|
@if(hasRole('admin,manager'))
|
|
|
- <a href="{{ route('order.generate-reclamation-pack', $reclamation) }}" class="btn btn-primary btn-sm">Пакет
|
|
|
- документов рекламации</a>
|
|
|
+ <a href="{{ route('order.generate-reclamation-pack', $reclamation) }}"
|
|
|
+ class="btn btn-primary btn-sm">Пакет документов рекламации</a>
|
|
|
@endif
|
|
|
-
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="row">
|
|
|
@@ -28,6 +30,9 @@
|
|
|
@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')])
|
|
|
@@ -285,5 +290,37 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
+ <!-- Модальное окно графика -->
|
|
|
+ <div class="modal fade" id="copySchedule" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
|
|
+ <div class="modal-dialog modal-fullscreen-sm-down modal-lg">
|
|
|
+ <div class="modal-content">
|
|
|
+ <div class="modal-header">
|
|
|
+ <h1 class="modal-title fs-5" id="addModalLabel">Перенести в график монтажей</h1>
|
|
|
+ <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Закрыть"></button>
|
|
|
+ </div>
|
|
|
+ <div class="modal-body">
|
|
|
+ <form action="{{ route('schedule.create-from-reclamation') }}" method="post" id="scheduleCreateForm">
|
|
|
+ @csrf
|
|
|
+ <div>
|
|
|
+ <input type="hidden" name="reclamation_id" value="{{ $reclamation->id }}">
|
|
|
+{{-- <textarea name="comment" placeholder="Комментарий для графика" class="form-control mb-3"></textarea>--}}
|
|
|
+ <input type="checkbox" id="deleteOldRecords" name="delete_old_records" class="form-check-inline">
|
|
|
+ <label for="deleteOldRecords" class="form-check-label mb-2">Удалить старые записи в графике для этой рекламации?</label><br>
|
|
|
+ <button type="submit" class="btn btn-primary btn-sm">Обновить график</button>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
@endsection
|
|
|
|
|
|
+@push('scripts')
|
|
|
+ <script type="module">
|
|
|
+ $('#createScheduleButton').on('click', function () {
|
|
|
+ let myModalSchedule = new bootstrap.Modal(document.getElementById("copySchedule"), {});
|
|
|
+ myModalSchedule.show();
|
|
|
+ });
|
|
|
+ </script>
|
|
|
+@endpush
|