|
|
@@ -13,7 +13,7 @@
|
|
|
</h4>
|
|
|
</div>
|
|
|
<div class="col-xl-6 action-toolbar mb-2">
|
|
|
- @if(hasRole('admin'))
|
|
|
+ @if(hasPermission('reclamations.delete'))
|
|
|
<a href="#" onclick="customConfirm('Удалить рекламацию?', function () { $('form#destroy').submit(); }, 'Подтверждение удаления'); return false;"
|
|
|
class="btn btn-sm btn-danger">Удалить</a>
|
|
|
<form action="{{ route('reclamations.delete', $reclamation) }}" method="post" class="d-none" id="destroy">
|
|
|
@@ -21,10 +21,10 @@
|
|
|
@method('DELETE')
|
|
|
</form>
|
|
|
@endif
|
|
|
- @if(hasRole('admin') && !is_null($reclamation->brigadier_id) && !is_null($reclamation->start_work_date))
|
|
|
+ @if(hasPermission('schedule.create') && !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'))
|
|
|
+ @if(hasPermission('reclamations.update'))
|
|
|
<a href="{{ route('order.generate-reclamation-pack', ['reclamation' => $reclamation, 'nav' => $nav ?? null]) }}"
|
|
|
class="btn btn-primary btn-sm">Пакет документов рекламации</a>
|
|
|
<a href="{{ route('reclamation.generate-reclamation-payment-pack', ['reclamation' => $reclamation, 'nav' => $nav ?? null]) }}"
|
|
|
@@ -43,20 +43,20 @@
|
|
|
<input type="hidden" name="nav" value="{{ $nav ?? '' }}">
|
|
|
|
|
|
@include('partials.link', ['title' => 'Площадка', 'href' => route('order.show', ['order' => $reclamation->order_id, 'sync_year' => 1, 'nav' => $nav ?? null]), 'text' => $reclamation->order->common_name ?? ''])
|
|
|
- @include('partials.select', ['name' => 'status_id', 'title' => 'Статус', 'options' => $statuses, 'value' => $reclamation->status_id ?? old('status_id'), 'disabled' => !hasRole('admin,manager'), 'classes' => ['update-once']])
|
|
|
- @include('partials.select', ['name' => 'user_id', 'title' => 'Менеджер', 'options' => $users, 'value' => $reclamation->user_id ?? old('user_id') ?? auth()->user()->id, 'disabled' => !hasRole('admin,manager'), 'classes' => ['update-once']])
|
|
|
+ @include('partials.select', ['name' => 'status_id', 'title' => 'Статус', 'options' => $statuses, 'value' => $reclamation->status_id ?? old('status_id'), 'disabled' => !hasPermission('reclamations.update'), 'classes' => ['update-once']])
|
|
|
+ @include('partials.select', ['name' => 'user_id', 'title' => 'Менеджер', 'options' => $users, 'value' => $reclamation->user_id ?? old('user_id') ?? auth()->user()->id, 'disabled' => !hasPermission('reclamations.update'), 'classes' => ['update-once']])
|
|
|
@include('partials.input', ['name' => 'maf_installation_year', 'title' => 'Год установки МАФ', 'type' => 'text', 'value' => $reclamation->order->year, 'disabled' => true])
|
|
|
- @include('partials.input', ['name' => 'create_date', 'title' => 'Дата создания', 'type' => 'date', 'required' => true, 'value' => $reclamation->create_date ?? date('Y-m-d'), 'disabled' => !hasRole('admin,manager'), 'classes' => ['update-once']])
|
|
|
- @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'), 'classes' => ['update-once']])
|
|
|
- @include('partials.select', ['name' => 'brigadier_id', 'title' => 'Бригадир', 'options' => $brigadiers, 'value' => $reclamation->brigadier_id ?? old('brigadier_id'), 'disabled' => !hasRole('admin,manager'), 'first_empty' => true, 'classes' => ['update-once']])
|
|
|
- @include('partials.input', ['name' => 'start_work_date', 'title' => 'Дата начала работ', 'type' => 'date', 'value' => $reclamation->start_work_date, 'disabled' => !hasRole('admin,manager'), 'classes' => ['update-once']])
|
|
|
- @include('partials.input', ['name' => 'work_days', 'title' => 'Срок работ, дней', 'type' => 'number', 'min' => 1, 'value' => $reclamation->work_days, 'disabled' => !hasRole('admin,manager'), 'classes' => ['update-once']])
|
|
|
- @include('partials.select', ['name' => 'reason', 'title' => 'Причина', 'size' => 6, 'value' => $reclamation->reason ?? '', 'options' => ['Вандализм', 'Гарантия', 'Сервисное обслуживание'], 'key_as_val' => true, 'disabled' => !hasRole('admin,manager'), 'classes' => ['update-once']])
|
|
|
- @include('partials.input', ['name' => 'factory_reclamation_number', 'title' => '№ рекламации на фабрике', 'type' => 'text', 'value' => $reclamation->factory_reclamation_number ?? '', 'disabled' => !hasRole('admin,manager'), 'classes' => ['update-once']])
|
|
|
- @include('partials.textarea', ['name' => 'guarantee', 'title' => 'Гарантии', 'size' => 6, 'value' => $reclamation->guarantee ?? '', 'disabled' => !hasRole('admin,manager'), 'classes' => ['update-once']])
|
|
|
- @include('partials.textarea', ['name' => 'whats_done', 'title' => 'Что сделано', 'size' => 6, 'value' => $reclamation->whats_done ?? '', 'disabled' => !hasRole('admin,manager'), 'classes' => ['update-once']])
|
|
|
- @include('partials.textarea', ['name' => 'comment', 'title' => 'Комментарий', 'size' => 6, 'value' => $reclamation->comment ?? '', 'disabled' => !hasRole('admin,manager'), 'classes' => ['update-once']])
|
|
|
- @include('partials.submit', ['name' => 'Сохранить', 'offset' => 5, 'disabled' => !hasRole('admin,manager'), 'back_url' => $back_url ?? route('reclamations.index', session('gp_reclamations'))])
|
|
|
+ @include('partials.input', ['name' => 'create_date', 'title' => 'Дата создания', 'type' => 'date', 'required' => true, 'value' => $reclamation->create_date ?? date('Y-m-d'), 'disabled' => !hasPermission('reclamations.update'), 'classes' => ['update-once']])
|
|
|
+ @include('partials.input', ['name' => 'finish_date', 'title' => 'Дата завершения', 'type' => 'date', 'required' => true, 'value' => $reclamation->finish_date ?? date('Y-m-d', strtotime('+30 days')), 'disabled' => !hasPermission('reclamations.update'), 'classes' => ['update-once']])
|
|
|
+ @include('partials.select', ['name' => 'brigadier_id', 'title' => 'Бригадир', 'options' => $brigadiers, 'value' => $reclamation->brigadier_id ?? old('brigadier_id'), 'disabled' => !hasPermission('reclamations.update'), 'first_empty' => true, 'classes' => ['update-once']])
|
|
|
+ @include('partials.input', ['name' => 'start_work_date', 'title' => 'Дата начала работ', 'type' => 'date', 'value' => $reclamation->start_work_date, 'disabled' => !hasPermission('reclamations.update'), 'classes' => ['update-once']])
|
|
|
+ @include('partials.input', ['name' => 'work_days', 'title' => 'Срок работ, дней', 'type' => 'number', 'min' => 1, 'value' => $reclamation->work_days, 'disabled' => !hasPermission('reclamations.update'), 'classes' => ['update-once']])
|
|
|
+ @include('partials.select', ['name' => 'reason', 'title' => 'Причина', 'size' => 6, 'value' => $reclamation->reason ?? '', 'options' => ['Вандализм', 'Гарантия', 'Сервисное обслуживание'], 'key_as_val' => true, 'disabled' => !hasPermission('reclamations.update'), 'classes' => ['update-once']])
|
|
|
+ @include('partials.input', ['name' => 'factory_reclamation_number', 'title' => '№ рекламации на фабрике', 'type' => 'text', 'value' => $reclamation->factory_reclamation_number ?? '', 'disabled' => !hasPermission('reclamations.update'), 'classes' => ['update-once']])
|
|
|
+ @include('partials.textarea', ['name' => 'guarantee', 'title' => 'Гарантии', 'size' => 6, 'value' => $reclamation->guarantee ?? '', 'disabled' => !hasPermission('reclamations.update'), 'classes' => ['update-once']])
|
|
|
+ @include('partials.textarea', ['name' => 'whats_done', 'title' => 'Что сделано', 'size' => 6, 'value' => $reclamation->whats_done ?? '', 'disabled' => !hasPermission('reclamations.update'), 'classes' => ['update-once']])
|
|
|
+ @include('partials.textarea', ['name' => 'comment', 'title' => 'Комментарий', 'size' => 6, 'value' => $reclamation->comment ?? '', 'disabled' => !hasPermission('reclamations.update'), 'classes' => ['update-once']])
|
|
|
+ @include('partials.submit', ['name' => 'Сохранить', 'offset' => 5, 'disabled' => !hasPermission('reclamations.update'), 'back_url' => $back_url ?? route('reclamations.index', session('gp_reclamations'))])
|
|
|
</form>
|
|
|
</div>
|
|
|
<div class="col-xl-7 ">
|
|
|
@@ -85,7 +85,7 @@
|
|
|
@endif
|
|
|
</td>
|
|
|
<td>
|
|
|
- @if(hasRole('admin,manager'))
|
|
|
+ @if(hasPermission('reclamations.update'))
|
|
|
<a href="{{ route('product_sku.show', ['product_sku' => $p, 'nav' => $nav ?? null]) }}">
|
|
|
{{ $p->product->article }}
|
|
|
</a>
|
|
|
@@ -97,7 +97,7 @@
|
|
|
</td>
|
|
|
<td>{!! $p->product->nomenclature_number !!}</td>
|
|
|
<td>
|
|
|
- @if($p->maf_order_id && hasRole('admin'))
|
|
|
+ @if($p->maf_order_id && hasPermission('maf_orders.view'))
|
|
|
<a href="{{ route('maf_order.show', $p->maf_order) }}">{{ $p->maf_order->order_number }}</a>
|
|
|
@else
|
|
|
{{ $p->maf_order?->order_number }}
|
|
|
@@ -138,13 +138,13 @@
|
|
|
value="{{ $sp->article }}@if($sp->note) ({{ $sp->note }})@endif"
|
|
|
placeholder="Введите артикул или название"
|
|
|
autocomplete="off"
|
|
|
- @disabled(!hasRole('admin,manager'))>
|
|
|
+ @disabled(!hasPermission('reclamations.update'))>
|
|
|
<div class="spare-part-dropdown"></div>
|
|
|
</div>
|
|
|
<div class="col-4 col-md-2">
|
|
|
<input type="number" name="rows[{{ $idx }}][quantity]" value="{{ $sp->pivot->quantity }}"
|
|
|
min="0" class="form-control form-control-sm text-end"
|
|
|
- @disabled(!hasRole('admin,manager'))
|
|
|
+ @disabled(!hasPermission('reclamations.update'))
|
|
|
placeholder="кол-во">
|
|
|
</div>
|
|
|
<div class="col-5 col-md-3">
|
|
|
@@ -153,7 +153,7 @@
|
|
|
<input type="checkbox" name="rows[{{ $idx }}][with_documents]" value="1"
|
|
|
class="form-check-input" id="with_docs_{{ $idx }}"
|
|
|
@checked($sp->pivot->with_documents)
|
|
|
- @disabled(!hasRole('admin,manager'))>
|
|
|
+ @disabled(!hasPermission('reclamations.update'))>
|
|
|
<label class="form-check-label small" for="with_docs_{{ $idx }}">с док.</label>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -171,13 +171,13 @@
|
|
|
value=""
|
|
|
placeholder="Введите артикул или название"
|
|
|
autocomplete="off"
|
|
|
- @disabled(!hasRole('admin,manager'))>
|
|
|
+ @disabled(!hasPermission('reclamations.update'))>
|
|
|
<div class="spare-part-dropdown"></div>
|
|
|
</div>
|
|
|
<div class="col-4 col-md-2">
|
|
|
<input type="number" name="rows[0][quantity]" value=""
|
|
|
min="0" class="form-control form-control-sm text-end"
|
|
|
- @disabled(!hasRole('admin,manager'))
|
|
|
+ @disabled(!hasPermission('reclamations.update'))
|
|
|
placeholder="кол-во">
|
|
|
</div>
|
|
|
<div class="col-5 col-md-3">
|
|
|
@@ -185,7 +185,7 @@
|
|
|
<input type="hidden" name="rows[0][with_documents]" value="0">
|
|
|
<input type="checkbox" name="rows[0][with_documents]" value="1"
|
|
|
class="form-check-input" id="with_docs_0"
|
|
|
- @disabled(!hasRole('admin,manager'))>
|
|
|
+ @disabled(!hasPermission('reclamations.update'))>
|
|
|
<label class="form-check-label small" for="with_docs_0">с док.</label>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -229,8 +229,8 @@
|
|
|
<div class="row">
|
|
|
<div class="col-12 text-end">
|
|
|
<span class="btn btn-light btn-sm cursor-pointer" id="add-spare-part-row"
|
|
|
- @disabled(!hasRole('admin,manager'))>Добавить строку</span>
|
|
|
- <button class="btn btn-primary btn-sm" type="submit" @disabled(!hasRole('admin,manager'))>Сохранить запчасти</button>
|
|
|
+ @disabled(!hasPermission('reclamations.update'))>Добавить строку</span>
|
|
|
+ <button class="btn btn-primary btn-sm" type="submit" @disabled(!hasPermission('reclamations.update'))>Сохранить запчасти</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</form>
|
|
|
@@ -260,7 +260,7 @@
|
|
|
<th class="text-center">Кол-во</th>
|
|
|
<th class="text-center">С док.</th>
|
|
|
<th>Номер заказа</th>
|
|
|
- @if(hasRole('admin,manager'))
|
|
|
+ @if(hasPermission('reclamations.update'))
|
|
|
<th></th>
|
|
|
@endif
|
|
|
</tr>
|
|
|
@@ -283,7 +283,7 @@
|
|
|
<tr>
|
|
|
<td>
|
|
|
@if($reservation->sparePart)
|
|
|
- @if(hasRole('admin,manager'))
|
|
|
+ @if(hasPermission('reclamations.update'))
|
|
|
<a href="{{ route('spare_parts.show', $reservation->sparePart->id) }}">
|
|
|
{{ $reservation->sparePart->article }}
|
|
|
</a>
|
|
|
@@ -304,7 +304,7 @@
|
|
|
</td>
|
|
|
<td>
|
|
|
@if($reservation->sparePartOrder)
|
|
|
- @if(hasRole('admin,manager'))
|
|
|
+ @if(hasPermission('reclamations.update'))
|
|
|
<a href="{{ route('spare_part_orders.show', $reservation->sparePartOrder->id) }}">
|
|
|
{{ $reservation->sparePartOrder->display_order_number }}
|
|
|
</a>
|
|
|
@@ -315,7 +315,7 @@
|
|
|
-
|
|
|
@endif
|
|
|
</td>
|
|
|
- @if(hasRole('admin,manager'))
|
|
|
+ @if(hasPermission('reclamations.update'))
|
|
|
<td class="text-end">
|
|
|
<button type="button"
|
|
|
class="btn btn-sm btn-outline-primary"
|
|
|
@@ -391,7 +391,7 @@
|
|
|
@endforeach
|
|
|
</tbody>
|
|
|
</table>
|
|
|
- @if(hasRole('admin,manager') && $reservations->where('status', 'active')->count() > 1)
|
|
|
+ @if(hasPermission('reclamations.update') && $reservations->where('status', 'active')->count() > 1)
|
|
|
<div class="text-end mt-1">
|
|
|
<form action="{{ route('spare_part_reservations.issue_all', $reclamation->id) }}" method="POST" class="d-inline">
|
|
|
@csrf
|
|
|
@@ -425,7 +425,7 @@
|
|
|
<tr>
|
|
|
<td>
|
|
|
@if($reservation->sparePart)
|
|
|
- @if(hasRole('admin,manager'))
|
|
|
+ @if(hasPermission('reclamations.update'))
|
|
|
<a href="{{ route('spare_parts.show', $reservation->sparePart->id) }}">
|
|
|
{{ $reservation->sparePart->article }}
|
|
|
</a>
|
|
|
@@ -446,7 +446,7 @@
|
|
|
</td>
|
|
|
<td>
|
|
|
@if($reservation->sparePartOrder)
|
|
|
- @if(hasRole('admin,manager'))
|
|
|
+ @if(hasPermission('reclamations.update'))
|
|
|
<a href="{{ route('spare_part_orders.show', $reservation->sparePartOrder->id) }}">
|
|
|
{{ $reservation->sparePartOrder->display_order_number }}
|
|
|
</a>
|
|
|
@@ -484,7 +484,7 @@
|
|
|
<tr>
|
|
|
<td>
|
|
|
@if($shortage->sparePart)
|
|
|
- @if(hasRole('admin,manager'))
|
|
|
+ @if(hasPermission('reclamations.update'))
|
|
|
<a href="{{ route('spare_parts.show', $shortage->sparePart->id) }}">
|
|
|
{{ $shortage->sparePart->article }}
|
|
|
</a>
|
|
|
@@ -517,7 +517,7 @@
|
|
|
<hr>
|
|
|
<div class="documents">
|
|
|
Документы
|
|
|
- @if(hasRole('admin,manager'))
|
|
|
+ @if(hasPermission('reclamations.update'))
|
|
|
<button class="btn btn-sm text-success" onclick="$('#upl-documents').trigger('click');"><i
|
|
|
class="bi bi-plus-circle-fill"></i> Загрузить
|
|
|
</button>
|
|
|
@@ -535,7 +535,7 @@
|
|
|
<a href="{{ $document->link }}" target="_blank">
|
|
|
{{ $document->original_name }}
|
|
|
</a>
|
|
|
- @if(hasRole('admin,manager'))
|
|
|
+ @if(hasPermission('reclamations.update'))
|
|
|
<i class="bi bi-x-circle-fill fs-6 text-danger cursor-pointer ms-2"
|
|
|
onclick="customConfirm('Удалить?', function () { $('#document-{{ $document->id }}').submit(); }, 'Подтверждение удаления')"
|
|
|
title="Удалить"></i>
|
|
|
@@ -553,7 +553,7 @@
|
|
|
<hr>
|
|
|
<div class="acts">
|
|
|
Акты
|
|
|
- @if(hasRole('admin,manager,brigadier,warehouse_head'))
|
|
|
+ @if(hasPermission('reclamations.act.upload'))
|
|
|
<button class="btn btn-sm text-success" onclick="$('#upl-acts').trigger('click');"><i
|
|
|
class="bi bi-plus-circle-fill"></i> Загрузить
|
|
|
</button>
|
|
|
@@ -571,7 +571,7 @@
|
|
|
<a href="{{ $act->link }}" target="_blank">
|
|
|
{{ $act->original_name }}
|
|
|
</a>
|
|
|
- @if(hasRole('admin,manager'))
|
|
|
+ @if(hasPermission('reclamations.update'))
|
|
|
<i class="bi bi-x-circle-fill fs-6 text-danger cursor-pointer ms-2"
|
|
|
onclick="customConfirm('Удалить?', function () { $('#act-{{ $act->id }}').submit(); }, 'Подтверждение удаления')"
|
|
|
title="Удалить"></i>
|
|
|
@@ -591,7 +591,7 @@
|
|
|
<div class="photo_before">
|
|
|
<a href="#photos_before" data-bs-toggle="collapse">Фотографии проблемы
|
|
|
({{ $reclamation->photos_before->count() }})</a>
|
|
|
- @if(hasRole('admin,manager'))
|
|
|
+ @if(hasPermission('reclamations.update'))
|
|
|
<button class="btn btn-sm text-success" onclick="$('#upl-photo-before').trigger('click');"><i
|
|
|
class="bi bi-plus-circle-fill"></i> Загрузить
|
|
|
</button>
|
|
|
@@ -602,7 +602,7 @@
|
|
|
class="bi bi-download"></i> Скачать все
|
|
|
</a>
|
|
|
@endif
|
|
|
- @if(hasRole('admin,manager'))
|
|
|
+ @if(hasPermission('reclamations.update'))
|
|
|
<form action="{{ route('reclamations.upload-photo-before', $reclamation) }}"
|
|
|
enctype="multipart/form-data" method="post" class="visually-hidden">
|
|
|
@csrf
|
|
|
@@ -618,7 +618,7 @@
|
|
|
data-toggle="lightbox" data-gallery="photos-before" data-size="fullscreen">
|
|
|
<img class="img-thumbnail" data-src="{{ $photo->thumbnail_link }}" alt="">
|
|
|
</a>
|
|
|
- @if(hasRole('admin,manager'))
|
|
|
+ @if(hasPermission('reclamations.update'))
|
|
|
<i class="bi bi-x-circle-fill fs-6 text-danger cursor-pointer rm-but"
|
|
|
onclick="customConfirm('Удалить фото?', function () { $('#photo-{{ $photo->id }}').submit(); }, 'Подтверждение удаления')"
|
|
|
title="Удалить"></i>
|
|
|
@@ -637,7 +637,7 @@
|
|
|
<div class="photo_after">
|
|
|
<a href="#photos_after" data-bs-toggle="collapse">Фотографии после устранения
|
|
|
({{ $reclamation->photos_after->count() }})</a>
|
|
|
- @if(hasRole('admin,manager,brigadier,warehouse_head'))
|
|
|
+ @if(hasPermission('reclamations.act.upload'))
|
|
|
<button class="btn btn-sm text-success" onclick="$('#upl-photo-after').trigger('click');"><i
|
|
|
class="bi bi-plus-circle-fill"></i> Загрузить
|
|
|
</button>
|
|
|
@@ -649,7 +649,7 @@
|
|
|
</a>
|
|
|
@endif
|
|
|
|
|
|
- @if(hasRole('admin,manager,brigadier,warehouse_head'))
|
|
|
+ @if(hasPermission('reclamations.act.upload'))
|
|
|
<form action="{{ route('reclamations.upload-photo-after', $reclamation) }}"
|
|
|
enctype="multipart/form-data" method="post" class="visually-hidden">
|
|
|
@csrf
|
|
|
@@ -665,7 +665,7 @@
|
|
|
data-toggle="lightbox" data-gallery="photos-after" data-size="fullscreen">
|
|
|
<img class="img-thumbnail" data-src="{{ $photo->thumbnail_link }}" alt="">
|
|
|
</a>
|
|
|
- @if(hasRole('admin,manager'))
|
|
|
+ @if(hasPermission('reclamations.update'))
|
|
|
<i class="bi bi-x-circle-fill fs-6 text-danger cursor-pointer rm-but"
|
|
|
onclick="customConfirm('Удалить фото?', function () { $('#photo-{{ $photo->id }}').submit(); }, 'Подтверждение удаления')"
|
|
|
title="Удалить"></i>
|
|
|
@@ -696,7 +696,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- @if(hasRole('admin'))
|
|
|
+ @if(hasPermission('schedule.create'))
|
|
|
<!-- Модальное окно графика -->
|
|
|
<div class="modal fade" id="copySchedule" tabindex="-1" aria-labelledby="copyScheduleLabel" aria-hidden="true">
|
|
|
<div class="modal-dialog modal-fullscreen-sm-down modal-lg">
|
|
|
@@ -729,7 +729,7 @@
|
|
|
|
|
|
@push('scripts')
|
|
|
<script type="module">
|
|
|
- @if(hasRole('admin'))
|
|
|
+ @if(hasPermission('schedule.create'))
|
|
|
$('#createScheduleButton').on('click', function () {
|
|
|
let myModalSchedule = new bootstrap.Modal(document.getElementById("copySchedule"), {});
|
|
|
myModalSchedule.show();
|