edit.blade.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. @extends('layouts.app')
  2. @section('content')
  3. <div class="px-3">
  4. <div class="row">
  5. <div class="col-xl-6">
  6. <h4>Рекламация</h4>
  7. </div>
  8. <div class="col-xl-6 text-end">
  9. </div>
  10. </div>
  11. <div class="row">
  12. <div class="col-xl-5 border-end">
  13. <form action="{{ route('reclamations.update', $reclamation) }}" method="post">
  14. @csrf
  15. <input type="hidden" id="order_id" name="order_id" value="{{ $reclamation->order_id}}">
  16. @include('partials.input', ['name' => 'order_name', 'title' => 'Площадка', 'disabled' => true, 'value' => $reclamation->order->common_name ?? ''])
  17. @include('partials.select', ['name' => 'status_id', 'title' => 'Статус', 'options' => $statuses, 'value' => $reclamation->status_id ?? old('status_id')])
  18. @include('partials.select', ['name' => 'user_id', 'title' => 'Менеджер', 'options' => $users, 'value' => $reclamation->user_id ?? old('user_id') ?? auth()->user()->id])
  19. @include('partials.input', ['name' => 'create_date', 'title' => 'Дата создания', 'type' => 'date', 'required' => true, 'value' => $reclamation->create_date ?? date('Y-m-d')])
  20. @include('partials.input', ['name' => 'finish_date', 'title' => 'Дата завершения', 'type' => 'date', 'required' => true, 'value' => $reclamation->finish_date ?? date('Y-m-d', strtotime('+30 days'))])
  21. @include('partials.textarea', ['name' => 'reason', 'title' => 'Причина', 'size' => 6, 'value' => $reclamation->reason ?? ''])
  22. @include('partials.textarea', ['name' => 'guarantee', 'title' => 'Гарантии', 'size' => 6, 'value' => $reclamation->guarantee ?? ''])
  23. @include('partials.textarea', ['name' => 'whats_done', 'title' => 'Что сделано', 'size' => 6, 'value' => $reclamation->whats_done ?? ''])
  24. <input type="hidden" name="redirect_url" value="{{ url()->previous() }}">
  25. @include('partials.submit', ['name' => 'Сохранить', 'offset' => 5])
  26. </form>
  27. </div>
  28. <div class="col-xl-7">
  29. <table class="table">
  30. <thead>
  31. <tr>
  32. <th>Картинка</th>
  33. <th>МАФ</th>
  34. <th>Тип</th>
  35. <th>Номер заказа МАФ</th>
  36. <th>RFID</th>
  37. <th>Заводской номер</th>
  38. <th>Дата производства</th>
  39. </tr>
  40. </thead>
  41. <tbody>
  42. @foreach($reclamation->skus as $p)
  43. <tr>
  44. <td>
  45. @if($p->product->image)
  46. <a href="{{ $p->product->image }}" data-toggle="lightbox" data-gallery="maf" data-size="fullscreen">
  47. <img src="{{ $p->product->image }}" alt="" class="img-thumbnail maf-img">
  48. </a>
  49. @endif
  50. </td>
  51. <td>
  52. <a href="{{ route('product_sku.show', $p) }}">
  53. {!! $p->product->article !!}
  54. </a>
  55. <br>
  56. <a class="small" href="{{ route('catalog.show', $p->product) }}">каталог</a>
  57. </td>
  58. <td>{!! $p->product->nomenclature_number !!}</td>
  59. <td>
  60. @if($p->maf_order_id)
  61. <a href="{{ route('maf_order.show', $p->maf_order) }}">{{ $p->maf_order->order_number }}</a>
  62. @endif
  63. </td>
  64. <td>{{ $p->rfid }}</td>
  65. <td>{{ $p->factory_number }}</td>
  66. <td>{{ $p->manufacture_date }}</td>
  67. </tr>
  68. @endforeach
  69. </tbody>
  70. </table>
  71. <div class="documents">
  72. Документы
  73. <button class="btn btn-sm text-success" onclick="$('#upl-documents').trigger('click');"><i
  74. class="bi bi-plus-circle-fill"></i> Загрузить
  75. </button>
  76. <form action="{{ route('reclamations.upload-document', $reclamation) }}"
  77. enctype="multipart/form-data" method="post" class="visually-hidden">
  78. @csrf
  79. <input required type="file" id="upl-documents" onchange="$(this).parent().submit()" multiple
  80. name="document[]" class="form-control form-control-sm">
  81. </form>
  82. <div class="row my-2 g-1">
  83. @foreach($reclamation->documents as $document)
  84. <div class="col-12">
  85. <a href="{{ $document->link }}" target="_blank">
  86. {{ $document->original_name }}
  87. </a>
  88. @if(hasRole('admin'))
  89. <i class="bi bi-x-circle-fill fs-6 text-danger cursor-pointer ms-2"
  90. onclick="if(confirm('Удалить?')) $('#document-{{ $document->id }}').submit()"
  91. title="Удалить"></i>
  92. @endif
  93. <form action="{{ route('reclamations.delete-document', [$reclamation, $document]) }}"
  94. method="POST" id="document-{{ $document->id }}" class="visually-hidden">
  95. @csrf
  96. @method('DELETE')
  97. </form>
  98. </div>
  99. @endforeach
  100. </div>
  101. </div>
  102. <hr>
  103. <div class="acts">
  104. Акты
  105. <button class="btn btn-sm text-success" onclick="$('#upl-acts').trigger('click');"><i
  106. class="bi bi-plus-circle-fill"></i> Загрузить
  107. </button>
  108. <form action="{{ route('reclamations.upload-act', $reclamation) }}" enctype="multipart/form-data"
  109. method="post" class="visually-hidden">
  110. @csrf
  111. <input required type="file" id="upl-acts" onchange="$(this).parent().submit()" multiple
  112. name="acts[]" class="form-control form-control-sm">
  113. </form>
  114. <div class="row my-2 g-1">
  115. @foreach($reclamation->acts as $act)
  116. <div class="col-12">
  117. <a href="{{ $act->link }}" target="_blank">
  118. {{ $act->original_name }}
  119. </a>
  120. @if(hasRole('admin'))
  121. <i class="bi bi-x-circle-fill fs-6 text-danger cursor-pointer ms-2"
  122. onclick="if(confirm('Удалить?')) $('#act-{{ $act->id }}').submit()"
  123. title="Удалить"></i>
  124. @endif
  125. <form action="{{ route('reclamations.delete-act', [$reclamation, $act]) }}" method="POST"
  126. id="act-{{ $act->id }}" class="visually-hidden">
  127. @csrf
  128. @method('DELETE')
  129. </form>
  130. </div>
  131. @endforeach
  132. </div>
  133. </div>
  134. <hr>
  135. <div class="photo_before">
  136. <a href="#photos_before" data-bs-toggle="collapse">Фотографии проблемы ({{ $reclamation->photos_before->count() }})</a>
  137. <button class="btn btn-sm text-success" onclick="$('#upl-photo-before').trigger('click');"><i
  138. class="bi bi-plus-circle-fill"></i> Загрузить
  139. </button>
  140. <form action="{{ route('reclamations.upload-photo-before', $reclamation) }}"
  141. enctype="multipart/form-data" method="post" class="visually-hidden">
  142. @csrf
  143. <input required type="file" id="upl-photo-before" onchange="$(this).parent().submit()" multiple
  144. name="photo[]" class="form-control form-control-sm" accept=".jpg,.jpeg,.png">
  145. </form>
  146. <div class="row my-2 g-1 collapse" id="photos_before">
  147. @foreach($reclamation->photos_before as $photo)
  148. <div class="col-4">
  149. <a href="{{ $photo->link }}"
  150. data-toggle="lightbox" data-gallery="photos-before" data-size="fullscreen">
  151. <img class="img-thumbnail" src="{{ $photo->link }}" alt="">
  152. </a>
  153. @if(hasRole('admin'))
  154. <i class="bi bi-x-circle-fill fs-6 text-danger cursor-pointer rm-but"
  155. onclick="if(confirm('Удалить фото?')) $('#photo-{{ $photo->id }}').submit()"
  156. title="Удалить"></i>
  157. @endif
  158. <form action="{{ route('reclamations.delete-photo-before', [$reclamation, $photo]) }}"
  159. method="POST" id="photo-{{ $photo->id }}" class="visually-hidden">
  160. @csrf
  161. @method('DELETE')
  162. </form>
  163. </div>
  164. @endforeach
  165. </div>
  166. </div>
  167. <hr>
  168. <div class="photo_after">
  169. <a href="#photos_after" data-bs-toggle="collapse">Фотографии после устранения ({{ $reclamation->photos_after->count() }})</a>
  170. <button class="btn btn-sm text-success" onclick="$('#upl-photo-after').trigger('click');"><i
  171. class="bi bi-plus-circle-fill"></i> Загрузить
  172. </button>
  173. <form action="{{ route('reclamations.upload-photo-after', $reclamation) }}"
  174. enctype="multipart/form-data" method="post" class="visually-hidden">
  175. @csrf
  176. <input required type="file" id="upl-photo-after" onchange="$(this).parent().submit()" multiple
  177. name="photo[]" class="form-control form-control-sm" accept=".jpg,.jpeg,.png">
  178. </form>
  179. <div class="row my-2 g-1 collapse" id="photos_after">
  180. @foreach($reclamation->photos_after as $photo)
  181. <div class="col-4">
  182. <a href="{{ $photo->link }}"
  183. data-toggle="lightbox" data-gallery="photos-after" data-size="fullscreen">
  184. <img class="img-thumbnail" src="{{ $photo->link }}" alt="">
  185. </a>
  186. @if(hasRole('admin'))
  187. <i class="bi bi-x-circle-fill fs-6 text-danger cursor-pointer rm-but"
  188. onclick="if(confirm('Удалить фото?')) $('#photo-{{ $photo->id }}').submit()"
  189. title="Удалить"></i>
  190. @endif
  191. <form action="{{ route('reclamations.delete-photo-after', [$reclamation, $photo]) }}"
  192. method="POST" id="photo-{{ $photo->id }}" class="visually-hidden">
  193. @csrf
  194. @method('DELETE')
  195. </form>
  196. </div>
  197. @endforeach
  198. </div>
  199. </div>
  200. </div>
  201. </div>
  202. </div>
  203. @endsection