show.blade.php 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565
  1. @php
  2. use App\Models\Order;
  3. @endphp
  4. @extends('layouts.app')
  5. @section('content')
  6. <div class="px-3">
  7. <div class="row mb-2">
  8. <div class="col-md-6">
  9. <h3>
  10. Площадка {{ $order->object_address }}
  11. <div class="badge text-bg-{{ Order::STATUS_COLOR[$order->order_status_id] }}">{{ $order->orderStatus->name }}</div>
  12. </h3>
  13. </div>
  14. <div class="col-md-6 text-end">
  15. @if(hasRole('admin,manager'))
  16. <a href="{{ route('order.edit', ['order' => $order, 'previous_url' => $previous_url]) }}"
  17. class="btn btn-sm mb-1 btn-primary">Редактировать</a>
  18. @endif
  19. @if(hasRole('admin') && ($order->order_status_id == Order::STATUS_NEW))
  20. <a href="#" onclick="if(confirm('Удалить площадку?')) $('form#destroy').submit();"
  21. class="btn btn-sm mb-1 btn-danger">Удалить</a>
  22. <form action="{{ route('order.destroy', $order) }}" method="post" class="d-none" id="destroy">
  23. @csrf
  24. @method('DELETE')
  25. </form>
  26. @endif
  27. @if(in_array($order->order_status_id, [Order::STATUS_READY_TO_MOUNT, Order::STATUS_IN_MOUNT]) && $order->isAllMafConnected() && hasRole('admin,manager'))
  28. <a href="{{ route('order.generate-installation-pack', $order) }}"
  29. class="btn btn-sm mb-1 btn-primary">Документы для монтажа</a>
  30. @if(hasRole('admin'))
  31. <button @disabled(is_null($order->brigadier_id)) class="btn btn-primary btn-sm mb-1"
  32. id="createScheduleButton">Перенести в график
  33. </button>
  34. @endif
  35. @endif
  36. @if($order->canCreateHandover() && hasRole('admin,manager'))
  37. <a href="{{ route('order.generate-handover-pack', $order) }}" class="btn btn-sm mb-1 btn-primary">Документы
  38. для сдачи</a>
  39. @endif
  40. <a href="{{ $previous_url ?? route('order.index', session('gp_orders')) }}"
  41. class="btn btn-sm mb-1 btn-outline-secondary">Назад</a>
  42. </div>
  43. </div>
  44. <div class="row">
  45. <div class="col-xl-3 border-end">
  46. <h4>Общая информация об объекте</h4>
  47. <div>ID площадки: {{ $order->id }}</div>
  48. @include('partials.input', ['name' => 'name', 'title' => 'Название', 'value' => $order->name ?? old('name'), 'required' => true, 'disabled' => !hasRole('admin'), 'classes' => ['update-once']])
  49. @include('partials.input', ['name' => 'object_address', 'title' => 'Адрес объекта', 'value' => $order->object_address ?? old('object_address'), 'required' => true, 'disabled' => !hasRole('admin'), 'classes' => ['update-once']])
  50. @include('partials.select', ['name' => 'object_type_id', 'title' => 'Тип объекта', 'options' => $objectTypes, 'value' => $order->object_type_id ?? old('object_type_id'), 'required' => true, 'first_empty' => true, 'disabled' => !hasRole('admin'), 'classes' => ['update-once']])
  51. @include('partials.select', ['name' => 'order_status_id', 'title' => 'Статус', 'options' => $orderStatuses, 'value' => $order->order_status_id ?? old('order_status_id'), 'required' => true, 'classes' => ['update-once']])
  52. @include('partials.textarea', ['name' => 'comment', 'title' => 'Комментарий', 'value' => $order->comment ?? old('comment'), 'classes' => ['update-once']])
  53. @include('partials.input', ['name' => 'installation_date', 'title' => 'Дата выхода на монтаж', 'type' => 'date', 'value' => $order->installation_date ?? old('installation_date'), 'disabled' => !hasRole('admin'), 'classes' => ['update-once']])
  54. @include('partials.input', ['name' => 'install_days', 'title' => 'Дней на монтаж', 'type' => 'number', 'min' => 1, 'value' => $order->install_days ?? old('install_days'), 'disabled' => !hasRole('admin'), 'classes' => ['update-once']])
  55. @include('partials.input', ['name' => 'ready_date', 'title' => 'Дата готовности площадки', 'type' => 'date', 'value' => $order->ready_date ?? old('ready_date'), 'disabled' => !hasRole('admin'), 'classes' => ['update-once']])
  56. @include('partials.select', ['name' => 'brigadier_id', 'title' => 'Бригадир', 'options' => $brigadiers, 'value' => $order->brigadier_id ?? old('brigadier_id'), 'first_empty' => true, 'disabled' => !hasRole('admin'), 'classes' => ['update-once']])
  57. @include('partials.select', ['name' => 'user_id', 'title' => 'Менеджер', 'options' => $users, 'value' => $order->user_id ?? old('user_id') ?? auth()->user()->id, 'disabled' => !hasRole('admin'), 'classes' => ['update-once']])
  58. @include('partials.input', ['name' => 'tg_group_name', 'title' => 'Название группы в ТГ', 'value' => $order->tg_group_name ?? old('tg_group_name'), 'classes' => ['update-once']])
  59. @include('partials.input', ['name' => 'tg_group_link', 'title' => 'Ссылка на группу в ТГ', 'value' => $order->tg_group_link ?? old('tg_group_link'), 'classes' => ['update-once']])
  60. <hr>
  61. <div class="reclamations">
  62. Рекламации
  63. @foreach($order->reclamations as $reclamation)
  64. <div>
  65. <a href="{{ route('reclamations.show', ['reclamation' => $reclamation, 'previous_url' => url()->current()]) }}">
  66. Рекламация № {{ $reclamation->id }} от {{ $reclamation->create_date }}
  67. </a>
  68. </div>
  69. @endforeach
  70. </div>
  71. @if(hasRole('admin,manager'))
  72. <hr>
  73. <div class="documents">
  74. Документы
  75. <button class="btn btn-sm text-success" onclick="$('#upl-documents').trigger('click');"><i
  76. class="bi bi-plus-circle-fill"></i> Загрузить
  77. </button>
  78. <form action="{{ route('order.upload-document', $order) }}" enctype="multipart/form-data"
  79. method="post" class="visually-hidden">
  80. @csrf
  81. <input required type="file" id="upl-documents" onchange="$(this).parent().submit()" multiple
  82. name="document[]" class="form-control form-control-sm">
  83. </form>
  84. <div class="row my-2 g-1">
  85. @foreach($order->documents as $document)
  86. <div class="col-12">
  87. <a href="{{ $document->link }}" target="_blank">
  88. {{ $document->original_name }}
  89. </a>
  90. @if(hasRole('admin'))
  91. <i class="bi bi-x-circle-fill fs-6 text-danger cursor-pointer ms-2"
  92. onclick="if(confirm('Удалить?')) $('#document-{{ $document->id }}').submit()"
  93. title="Удалить"></i>
  94. @endif
  95. <form action="{{ route('order.delete-document', [$order, $document]) }}" method="POST"
  96. id="document-{{ $document->id }}" class="visually-hidden">
  97. @csrf
  98. @method('DELETE')
  99. </form>
  100. </div>
  101. @endforeach
  102. </div>
  103. </div>
  104. <hr>
  105. <div class="statements">
  106. Ведомости
  107. <button class="btn btn-sm text-success" onclick="$('#upl-statements').trigger('click');"><i
  108. class="bi bi-plus-circle-fill"></i> Загрузить
  109. </button>
  110. <form action="{{ route('order.upload-statement', $order) }}" enctype="multipart/form-data"
  111. method="post" class="visually-hidden">
  112. @csrf
  113. <input required type="file" id="upl-statements" onchange="$(this).parent().submit()" multiple
  114. name="statement[]" class="form-control form-control-sm">
  115. </form>
  116. <div class="row my-2 g-1">
  117. @foreach($order->statements as $statement)
  118. <div class="col-12">
  119. <a href="{{ $statement->link }}" target="_blank">
  120. {{ $statement->original_name }}
  121. </a>
  122. @if(hasRole('admin'))
  123. <i class="bi bi-x-circle-fill fs-6 text-danger cursor-pointer ms-2"
  124. onclick="if(confirm('Удалить?')) $('#statement-{{ $statement->id }}').submit()"
  125. title="Удалить"></i>
  126. @endif
  127. <form action="{{ route('order.delete-statement', [$order, $statement]) }}" method="POST"
  128. id="statement-{{ $statement->id }}" class="visually-hidden">
  129. @csrf
  130. @method('DELETE')
  131. </form>
  132. </div>
  133. @endforeach
  134. </div>
  135. </div>
  136. @endif
  137. <hr>
  138. <div class="photo">
  139. <a href="#photos" data-bs-toggle="collapse">Фотографии ({{ $order->photos->count() }})</a>
  140. <button class="btn btn-sm text-success" onclick="$('#upl-photo').trigger('click');"><i
  141. class="bi bi-plus-circle-fill"></i> Загрузить
  142. </button>
  143. @if($order->photos->count())
  144. <a href="{{ route('order.generate-photos-pack', $order) }}" class="btn btn-sm text-primary"><i
  145. class="bi bi-download"></i> Скачать все
  146. </a>
  147. @endif
  148. <form action="{{ route('order.upload-photo', $order) }}" enctype="multipart/form-data" method="post"
  149. class="visually-hidden">
  150. @csrf
  151. <input required type="file" id="upl-photo" onchange="$(this).parent().submit()" multiple
  152. name="photo[]" class="form-control form-control-sm" accept=".jpg,.jpeg,.png">
  153. </form>
  154. <div class="row my-2 g-1 collapse" id="photos">
  155. @foreach($order->photos as $photo)
  156. <div class="col-4">
  157. <a href="{{ $photo->link }}"
  158. data-toggle="lightbox" data-gallery="photos" data-size="fullscreen">
  159. <img class="img-thumbnail" src="{{ $photo->link }}" alt="">
  160. </a>
  161. @if(hasRole('admin'))
  162. <i class="bi bi-x-circle-fill fs-6 text-danger cursor-pointer rm-but"
  163. onclick="if(confirm('Удалить фото?')) $('#photo-{{ $photo->id }}').submit()"
  164. title="Удалить"></i>
  165. @endif
  166. <form action="{{ route('order.delete-photo', [$order, $photo]) }}" method="POST"
  167. id="photo-{{ $photo->id }}" class="visually-hidden">
  168. @csrf
  169. @method('DELETE')
  170. </form>
  171. </div>
  172. @endforeach
  173. </div>
  174. </div>
  175. </div>
  176. <div class="col-xl-9">
  177. <h4>МАФы заказа</h4>
  178. <div id="selected_maf">
  179. @if(isset($order) && $order->products_sku)
  180. <div class="col-12 overflow-x-scroll mb-3">
  181. <table class="table">
  182. <thead>
  183. <tr>
  184. <th><input type="checkbox" class="form-check" id="check-all-maf"></th>
  185. <th>Картинка</th>
  186. <th>МАФ</th>
  187. <th>Тип</th>
  188. <th>Статус</th>
  189. <th>Номер заказа МАФ</th>
  190. <th>RFID</th>
  191. <th>Заводской номер</th>
  192. <th>Дата производства</th>
  193. <th>Склад</th>
  194. <th>Паспорт</th>
  195. </tr>
  196. </thead>
  197. <tbody>
  198. @php
  199. $needs = $order->getNeeds();
  200. @endphp
  201. @foreach($order->products_sku as $p)
  202. <tr>
  203. <td>
  204. <input type="checkbox" class="form-check check-maf"
  205. data-maf-id="{{ $p->id }}">
  206. </td>
  207. <td>
  208. @if($p->product->image)
  209. <a href="{{ $p->product->image }}" data-toggle="lightbox"
  210. data-gallery="maf" data-size="fullscreen">
  211. <img src="{{ $p->product->image }}" alt=""
  212. class="img-thumbnail maf-img">
  213. </a>
  214. @endif
  215. </td>
  216. <td>
  217. @if(hasRole('admin'))
  218. <a href="{{ route('product_sku.show', ['product_sku' =>$p, 'previous_url' => url()->current()]) }}">
  219. {!! $p->product->article !!}
  220. </a>
  221. <br>
  222. <a class="small"
  223. href="{{ route('catalog.show', ['product' => $p->product, 'previous_url' => request()->fullUrl()]) }}">каталог</a>
  224. @endif
  225. </td>
  226. <td>{!! $p->product->nomenclature_number !!}</td>
  227. <td>{{ $p->status }}</td>
  228. <td>
  229. @if($p->maf_order_id && hasRole('admin'))
  230. <a href="{{ route('maf_order.show', $p->maf_order) }}">{{ $p->maf_order->order_number }}</a>
  231. @endif
  232. </td>
  233. <td>{{ $p->rfid }}</td>
  234. <td>{{ $p->factory_number }}</td>
  235. <td>{{ $p->manufacture_date }}</td>
  236. <td class="text-center">
  237. @if($p->maf_order?->order_number)
  238. <i class="bi bi-check-all text-success fw-bold"></i>
  239. @else
  240. @if($needs[$p->product_id]['sku']-- > 0)
  241. <i class="bi bi-check text-success fw-bold"></i>
  242. @else
  243. <i class="bi bi-x text-danger fw-bold"></i>
  244. @endif
  245. @endif
  246. </td>
  247. <td class="text-center">
  248. @if($p->passport)
  249. <i class="bi bi-check text-success fw-bold"></i>
  250. @else
  251. <i class="bi bi-x text-danger fw-bold"></i>
  252. @endif
  253. </td>
  254. </tr>
  255. @endforeach
  256. </tbody>
  257. </table>
  258. </div>
  259. <div>
  260. @if(hasRole('admin'))
  261. <a href="{{ route('order.get-maf', $order) }}"
  262. class="btn btn-primary btn-sm mb-1 @disabled($order->ready_to_mount == 'Нет' )">Привязать
  263. все МАФы</a>
  264. <br class="d-md-none">
  265. <a href="{{ route('order.revert-maf', $order) }}" class="btn btn-primary btn-sm mb-1">Отвязать
  266. все МАФы</a>
  267. <br class="d-md-none">
  268. <button class="btn btn-primary btn-sm mb-1" data-bs-toggle="modal"
  269. data-bs-target="#moveModal">Перенести МАФы
  270. </button>
  271. <br class="d-md-none">
  272. <button class="btn btn-sm mb-1 btn-warning" id="create-reclamation-button">Создать
  273. рекламацию
  274. </button>
  275. <form action="{{ route('reclamations.create', $order) }}" method="post"
  276. class="visually-hidden" id="create-reclamation-form">
  277. @csrf
  278. </form>
  279. <a href="#" class="btn btn-primary btn-sm mb-1" id="ttnBtn">ТН</a>
  280. @endif
  281. </div>
  282. @endif
  283. </div>
  284. </div>
  285. </div>
  286. </div>
  287. <!-- Модальное окно графика -->
  288. <div class="modal fade" id="copySchedule" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
  289. <div class="modal-dialog modal-fullscreen-sm-down modal-lg">
  290. <div class="modal-content">
  291. <div class="modal-header">
  292. <h1 class="modal-title fs-5" id="addModalLabel">Перенести в график монтажей</h1>
  293. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Закрыть"></button>
  294. </div>
  295. <div class="modal-body">
  296. <form action="{{ route('schedule.create-from-order') }}" method="post" id="scheduleCreateForm">
  297. @csrf
  298. <div>
  299. <input type="hidden" name="order_id" value="{{ $order->id }}">
  300. <textarea name="comment" placeholder="Комментарий для графика" class="form-control mb-3"></textarea>
  301. <input type="checkbox" id="deleteOldRecords" name="delete_old_records" class="form-check-inline">
  302. <label for="deleteOldRecords" class="form-check-label mb-2">Удалить старые записи в графике для этой площадки?</label><br>
  303. <button type="submit" class="btn btn-primary btn-sm">Обновить график</button>
  304. </div>
  305. </form>
  306. </div>
  307. </div>
  308. </div>
  309. </div>
  310. <!-- Модальное окно ТН -->
  311. <div class="modal fade" id="createTtnModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
  312. <div class="modal-dialog modal-fullscreen-sm-down modal-lg">
  313. <div class="modal-content">
  314. <div class="modal-header">
  315. <h1 class="modal-title fs-5" id="addModalLabel">Введите данные для ТН</h1>
  316. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Закрыть"></button>
  317. </div>
  318. <div class="modal-body">
  319. <form action="{{ route('order.create-ttn') }}" method="post" id="ttnForm">
  320. @csrf
  321. <div>
  322. <input type="text" class="form-control mb-2" name="order_number" placeholder="Номер заказа">
  323. <input type="date" class="form-control mb-2" name="order_date" placeholder="Дата заказа" value="{{ date('Y-m-d') }}">
  324. <input type="number" class="form-control mb-2" name="order_sum" placeholder="Сумма заказа" value="0">
  325. <button href="#" class="btn btn-primary" id="createTtn">Создать ТН</button>
  326. </div>
  327. </form>
  328. </div>
  329. </div>
  330. </div>
  331. </div>
  332. <!-- Модальное окно переноса -->
  333. <div class="modal fade" id="moveModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
  334. <div class="modal-dialog modal-fullscreen-sm-down modal-lg">
  335. <div class="modal-content">
  336. <div class="modal-header">
  337. <h1 class="modal-title fs-5" id="addModalLabel">Выбрать площадку, куда переносим</h1>
  338. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Закрыть"></button>
  339. </div>
  340. <div class="modal-body">
  341. <form action="{{ route('order.move-maf') }}" method="post">
  342. @csrf
  343. <div id="select_maf_form">
  344. <input type="text" class="form-control mb-2" placeholder="Поиск площадки" id="search_order">
  345. <select id="select_order" name="new_order_id" class="form-select mb-3" size="20" multiple
  346. required></select>
  347. <a href="#" class="btn btn-primary" id="moveMaf">Перенести</a>
  348. </div>
  349. </form>
  350. </div>
  351. </div>
  352. </div>
  353. </div>
  354. @if($errors->any())
  355. @dump($errors)
  356. @endif
  357. @endsection
  358. @push('scripts')
  359. <script type="module">
  360. // select order
  361. $('#search_order').on('keyup', function () {
  362. // search products on backend
  363. $.get('{{ route('order.search') }}?s=' + $(this).val(),
  364. function (data) {
  365. $('#select_order').children().remove()
  366. $.each(data, function (id, name) {
  367. $('#select_order').append('<option value=\'' + id + '\'>' + name + '</option>');
  368. });
  369. }
  370. );
  371. }).trigger('keyup');
  372. $('#check-all-maf').on('change', function () {
  373. $('input:checkbox.check-maf').not(this).prop('checked', this.checked);
  374. });
  375. // move maf
  376. $('#moveMaf').on('click', function () {
  377. let ids = Array();
  378. $('.check-maf').each(function () {
  379. if ($(this).prop('checked')) {
  380. ids.push($(this).attr('data-maf-id'));
  381. }
  382. });
  383. $.post('{{ route('order.move-maf') }}',
  384. {
  385. '_token': $('meta[name=csrf-token]').attr('content'),
  386. ids: JSON.stringify(ids),
  387. 'new_order_id': $('#select_order').find(":selected").val()
  388. },
  389. function () {
  390. location.reload();
  391. }
  392. );
  393. });
  394. $('#create-reclamation-button').on('click', function () {
  395. let ids = Array();
  396. $('.check-maf').each(function () {
  397. if ($(this).prop('checked')) {
  398. ids.push($(this).attr('data-maf-id'));
  399. $('#create-reclamation-form').append('<input type="hidden" name="skus[]" value="' + $(this).attr('data-maf-id') + '">');
  400. }
  401. });
  402. if (ids.length) {
  403. $('#create-reclamation-form').submit();
  404. } else {
  405. alert('Нужно выбрать МАФ для рекламации!');
  406. }
  407. });
  408. $('#createScheduleButton').on('click', function () {
  409. let ids = Array();
  410. $('.check-maf').each(function () {
  411. if ($(this).prop('checked')) {
  412. ids.push($(this).attr('data-maf-id'));
  413. $('#scheduleCreateForm').append('<input type="hidden" name="skus[]" value="' + $(this).attr('data-maf-id') + '">');
  414. }
  415. });
  416. let myModalSchedule = new bootstrap.Modal(document.getElementById("copySchedule"), {});
  417. myModalSchedule.show();
  418. });
  419. $('#ttnBtn').on('click', function () {
  420. if ($('input.check-maf:checkbox:checked').length > 0) {
  421. let myModalTtn = new bootstrap.Modal(document.getElementById("createTtnModal"), {});
  422. myModalTtn.show();
  423. } else {
  424. alert('Нужно выбрать МАФ для ТН!');
  425. }
  426. });
  427. $('#createTtn').on('click', function () {
  428. let ids = Array();
  429. $('.check-maf').each(function () {
  430. if ($(this).prop('checked')) {
  431. ids.push($(this).attr('data-maf-id'));
  432. $('#ttnForm').append('<input type="hidden" name="skus[]" value="' + $(this).attr('data-maf-id') + '">');
  433. }
  434. });
  435. if (ids.length) {
  436. $('#ttnForm').submit();
  437. } else {
  438. alert('Нужно выбрать МАФ для ТН!');
  439. }
  440. });
  441. $('.update-once').on('change', function () {
  442. let v = $(this).val();
  443. let n = $(this).attr('name');
  444. $.post(
  445. '{{ route('order.update', $order->id) }}',
  446. {
  447. '_token': '{{ csrf_token() }}',
  448. id: '{{ $order->id }}',
  449. [n]: v
  450. },
  451. function () {
  452. $('.alerts').append(
  453. '<div class="main-alert alert alert-success" role="alert">Площадка обновлена!</div>'
  454. );
  455. setTimeout(function () {
  456. $('.main-alert').fadeTo(2000, 500).slideUp(500, function () {
  457. $(".main-alert").slideUp(500);
  458. })
  459. }, 3000);
  460. }
  461. );
  462. });
  463. {{--$('#installation_date').on('change', function () {--}}
  464. {{-- let installationDate = $(this).val();--}}
  465. {{-- $.post(--}}
  466. {{-- '{{ route('order.update', $order->id) }}',--}}
  467. {{-- {--}}
  468. {{-- '_token': '{{ csrf_token() }}',--}}
  469. {{-- id: '{{ $order->id }}',--}}
  470. {{-- installation_date: installationDate--}}
  471. {{-- },--}}
  472. {{-- function () {--}}
  473. {{-- $('.alerts').append(--}}
  474. {{-- '<div class="main-alert alert alert-success" role="alert">Обновлена дата выхода на монтаж!</div>'--}}
  475. {{-- );--}}
  476. {{-- setTimeout(function () {--}}
  477. {{-- $('.main-alert').fadeTo(2000, 500).slideUp(500, function () {--}}
  478. {{-- $(".main-alert").slideUp(500);--}}
  479. {{-- })--}}
  480. {{-- }, 3000);--}}
  481. {{-- }--}}
  482. {{-- );--}}
  483. {{--});--}}
  484. {{--$('#install_days').on('change', function () {--}}
  485. {{-- let installDays = $(this).val();--}}
  486. {{-- $.post(--}}
  487. {{-- '{{ route('order.update', $order->id) }}',--}}
  488. {{-- {--}}
  489. {{-- '_token' : '{{ csrf_token() }}',--}}
  490. {{-- id: '{{ $order->id }}',--}}
  491. {{-- install_days: installDays--}}
  492. {{-- },--}}
  493. {{-- function () {--}}
  494. {{-- $('.alerts').append(--}}
  495. {{-- '<div class="main-alert alert alert-success" role="alert">Обновлено количество дней на монтаж!</div>'--}}
  496. {{-- );--}}
  497. {{-- setTimeout(function () {--}}
  498. {{-- $('.main-alert').fadeTo(2000, 500).slideUp(500, function () {--}}
  499. {{-- $(".main-alert").slideUp(500);--}}
  500. {{-- })--}}
  501. {{-- }, 3000);--}}
  502. {{-- }--}}
  503. {{-- );--}}
  504. {{--});--}}
  505. {{--$('#name').on('change', function () {--}}
  506. {{-- let name = $(this).val();--}}
  507. {{-- $.post(--}}
  508. {{-- '{{ route('order.update', $order->id) }}',--}}
  509. {{-- {--}}
  510. {{-- '_token' : '{{ csrf_token() }}',--}}
  511. {{-- id: '{{ $order->id }}',--}}
  512. {{-- name: name--}}
  513. {{-- },--}}
  514. {{-- function () {--}}
  515. {{-- $('.alerts').append(--}}
  516. {{-- '<div class="main-alert alert alert-success" role="alert">Обновлено название!</div>'--}}
  517. {{-- );--}}
  518. {{-- setTimeout(function () {--}}
  519. {{-- $('.main-alert').fadeTo(2000, 500).slideUp(500, function () {--}}
  520. {{-- $(".main-alert").slideUp(500);--}}
  521. {{-- })--}}
  522. {{-- }, 3000);--}}
  523. {{-- }--}}
  524. {{-- );--}}
  525. {{--});--}}
  526. </script>
  527. @endpush