|
|
@@ -78,7 +78,7 @@
|
|
|
<tr>
|
|
|
@foreach($header as $headerName => $headerTitle)
|
|
|
<td class="column_{{$headerName}}"
|
|
|
- @if(isset($routeName) && !str_contains($headerName, 'image')) onclick="location.href='{{ route($routeName, $string->id) }}'" @endif>
|
|
|
+ @if(isset($routeName) && !str_contains($headerName, 'image') && !str_contains($headerName, 'order_status_name')) onclick="location.href='{{ route($routeName, $string->id) }}'" @endif>
|
|
|
@if(str_contains($headerName, '-'))
|
|
|
@php
|
|
|
list($rel, $field) = explode('-', $headerName);
|
|
|
@@ -125,6 +125,12 @@
|
|
|
data-size="fullscreen">
|
|
|
<img src="{{ $string->$headerName }}" alt="" class="img-thumbnail maf-img">
|
|
|
</a>
|
|
|
+ @elseif(str_contains($headerName, 'order_status_name'))
|
|
|
+ <select name="order_status_name" data-order-id="{{ $string->id }}" @disabled(!hasRole('admin,manager')) class="change-order-status form-control form-control-sm" >
|
|
|
+ @foreach($statuses as $statusId => $statusName)
|
|
|
+ <option value="{{ $statusId }}" @selected($statusName == $string->$headerName)>{{ $statusName }}</option>
|
|
|
+ @endforeach
|
|
|
+ </select>
|
|
|
@else
|
|
|
<p title="{!! $string->$headerName !!}">
|
|
|
{!! \Illuminate\Support\Str::words($string->$headerName, config('app.words_in_table_cell_limit'), ' ...') !!}
|
|
|
@@ -384,5 +390,30 @@
|
|
|
currentUrl.searchParams.delete('page');
|
|
|
document.location.href = currentUrl.href;
|
|
|
});
|
|
|
+
|
|
|
+ $('.change-order-status').on('change', function () {
|
|
|
+ let orderStatusId = $(this).val();
|
|
|
+ let orderId = $(this).attr('data-order-id');
|
|
|
+
|
|
|
+ $.post(
|
|
|
+ '{{ route('order.update') }}',
|
|
|
+ {
|
|
|
+ '_token' : '{{ csrf_token() }}',
|
|
|
+ id: orderId,
|
|
|
+ order_status_id: orderStatusId
|
|
|
+ },
|
|
|
+ function () {
|
|
|
+ $('.alerts').append(
|
|
|
+ '<div class="main-alert alert alert-success" role="alert">Обновлён статус площадки!</div>'
|
|
|
+ );
|
|
|
+ setTimeout(function () {
|
|
|
+ $('.main-alert').fadeTo(2000, 500).slideUp(500, function () {
|
|
|
+ $(".main-alert").slideUp(500);
|
|
|
+ })
|
|
|
+ }, 3000);
|
|
|
+ }
|
|
|
+ );
|
|
|
+ });
|
|
|
+
|
|
|
</script>
|
|
|
@endpush
|