|
@@ -1,47 +1,50 @@
|
|
|
@extends('layouts.app')
|
|
@extends('layouts.app')
|
|
|
|
|
|
|
|
@section('content')
|
|
@section('content')
|
|
|
- <div class="row mb-3">
|
|
|
|
|
- <div class="col-6">
|
|
|
|
|
- <h3>График монтажей</h3>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="col-6 text-end">
|
|
|
|
|
- <div class="d-flex flex-row justify-content-end">
|
|
|
|
|
- <div class="p-2">
|
|
|
|
|
- <button @disabled($weekNumber == 1) class="btn btn-sm btn-primary"
|
|
|
|
|
- onclick="document.location = '{{ route('schedule.index', ['week' => $weekNumber - 1]) }}'">
|
|
|
|
|
- <i class="bi bi-arrow-left"></i>
|
|
|
|
|
- </button>
|
|
|
|
|
- </div>
|
|
|
|
|
- <label class="p-2 d-block small mt-1">Неделя №</label>
|
|
|
|
|
- <div class="p-2">
|
|
|
|
|
- <input type="number" style="width: 3rem" value="{{ $weekNumber }}"
|
|
|
|
|
- class="form-control form-control-sm"
|
|
|
|
|
- onchange="document.location = '{{ route('schedule.index') }}?week='+this.value"
|
|
|
|
|
- min="1" max="53" title="№ недели">
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <div class="table-responsive">
|
|
|
|
|
+ <div class="row mb-3">
|
|
|
|
|
+ <div class="col-md-6">
|
|
|
|
|
+ <h3>График монтажей</h3>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col-md-6 text-end">
|
|
|
|
|
+ <div class="d-flex flex-row justify-content-end">
|
|
|
|
|
+ <div class="p-2">
|
|
|
|
|
+ <button @disabled($weekNumber == 1) class="btn btn-sm btn-primary"
|
|
|
|
|
+ onclick="document.location = '{{ route('schedule.index', ['week' => $weekNumber - 1]) }}'">
|
|
|
|
|
+ <i class="bi bi-arrow-left"></i>
|
|
|
|
|
+ </button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <label class="p-2 d-none d-mb-block small mt-1" for="fromDate">Неделя №</label>
|
|
|
|
|
+ <div class="p-2">
|
|
|
|
|
+ <input type="number" style="width: 3rem" value="{{ $weekNumber }}"
|
|
|
|
|
+ class="form-control form-control-sm" name="weekNumber"
|
|
|
|
|
+ onchange="document.location = '{{ route('schedule.index') }}?week='+this.value"
|
|
|
|
|
+ min="1" max="53" title="№ недели">
|
|
|
|
|
+ </div>
|
|
|
|
|
|
|
|
- <div class="p-2">
|
|
|
|
|
- <input type="date" min="{{ year() . '-01-01' }}" max="{{ year() . '-12-31' }}"
|
|
|
|
|
- class="form-control form-control-sm" value="{{ $weekDates['mon'] }}" title="начало недели"
|
|
|
|
|
- onchange="document.location = '{{ route('schedule.index') }}?week=' + getWeekNumber(this.value)">
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="p-2">
|
|
|
|
|
- <input type="date" disabled
|
|
|
|
|
- class="form-control form-control-sm" value="{{ $weekDates['sun'] }}" title="конец недели">
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <div class="p-2">
|
|
|
|
|
+ <input type="date" min="{{ year() . '-01-01' }}" max="{{ year() . '-12-31' }}"
|
|
|
|
|
+ class="form-control form-control-sm" value="{{ $weekDates['mon'] }}"
|
|
|
|
|
+ title="начало недели" name="monday" id="fromDate"
|
|
|
|
|
+ onchange="document.location = '{{ route('schedule.index') }}?week=' + getWeekNumber(this.value)">
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="p-2 d-none d-md-block">
|
|
|
|
|
+ <input type="date" disabled name="sunday"
|
|
|
|
|
+ class="form-control form-control-sm" value="{{ $weekDates['sun'] }}"
|
|
|
|
|
+ title="конец недели">
|
|
|
|
|
+ </div>
|
|
|
|
|
|
|
|
- <div class="p-2">
|
|
|
|
|
- <button @disabled($weekNumber > 52) class="btn btn-sm btn-primary"
|
|
|
|
|
- onclick="document.location = '{{ route('schedule.index', ['week' => $weekNumber + 1]) }}'">
|
|
|
|
|
- <i class="bi bi-arrow-right"></i>
|
|
|
|
|
- </button>
|
|
|
|
|
|
|
+ <div class="p-2">
|
|
|
|
|
+ <button @disabled($weekNumber > 52) class="btn btn-sm btn-primary"
|
|
|
|
|
+ onclick="document.location = '{{ route('schedule.index', ['week' => $weekNumber + 1]) }}'">
|
|
|
|
|
+ <i class="bi bi-arrow-right"></i>
|
|
|
|
|
+ </button>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- </div>
|
|
|
|
|
|
|
|
|
|
- <div class="schedule">
|
|
|
|
|
|
|
+
|
|
|
<table class="table schedules">
|
|
<table class="table schedules">
|
|
|
<thead>
|
|
<thead>
|
|
|
<tr>
|
|
<tr>
|
|
@@ -88,14 +91,25 @@
|
|
|
class="align-middle">{{ $schedule->mafs_count }}</td>
|
|
class="align-middle">{{ $schedule->mafs_count }}</td>
|
|
|
<td style="background: {{ $schedule->brigadier->color }}"
|
|
<td style="background: {{ $schedule->brigadier->color }}"
|
|
|
class="align-middle">{{ $schedule->brigadier->name }}</td>
|
|
class="align-middle">{{ $schedule->brigadier->name }}</td>
|
|
|
- <td style="background: {{ $schedule->brigadier->color }}" class="align-middle comment-{{ $schedule->id }}">{{ $schedule->comment }}</td>
|
|
|
|
|
|
|
+ <td style="background: {{ $schedule->brigadier->color }}"
|
|
|
|
|
+ class="align-middle comment-{{ $schedule->id }}">{{ $schedule->comment }}</td>
|
|
|
<td style="background: {{ $schedule->brigadier->color }}" class="align-middle">
|
|
<td style="background: {{ $schedule->brigadier->color }}" class="align-middle">
|
|
|
<i class="bi bi-pencil ms-3 cursor-pointer text-primary editSchedule"
|
|
<i class="bi bi-pencil ms-3 cursor-pointer text-primary editSchedule"
|
|
|
- data-schedule-date="{{ $schedule->installation_date }}" data-schedule-id="{{ $schedule->id }}"></i>
|
|
|
|
|
|
|
+ data-schedule-date="{{ $schedule->installation_date }}"
|
|
|
|
|
+ data-schedule-id="{{ $schedule->id }}"></i>
|
|
|
|
|
+ <i class="bi bi-trash text-danger ms-2 deleteSchedule"
|
|
|
|
|
+ data-schedule-id="{{ $schedule->id }}"></i>
|
|
|
|
|
+ <div class="visually-hidden ">
|
|
|
|
|
+ <form action="{{ route('schedule.delete', $schedule->id) }}" method="post"
|
|
|
|
|
+ class="deleteForm-{{ $schedule->id }}">
|
|
|
|
|
+ @csrf
|
|
|
|
|
+ @method('DELETE')
|
|
|
|
|
+ </form>
|
|
|
|
|
+ </div>
|
|
|
</td>
|
|
</td>
|
|
|
- </tr>
|
|
|
|
|
- @endforeach
|
|
|
|
|
- @endif
|
|
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ @endforeach
|
|
|
|
|
+ @endif
|
|
|
{!! (!$schs) ? '</tr>': '' !!}
|
|
{!! (!$schs) ? '</tr>': '' !!}
|
|
|
|
|
|
|
|
@endforeach
|
|
@endforeach
|
|
@@ -103,61 +117,61 @@
|
|
|
</tbody>
|
|
</tbody>
|
|
|
</table>
|
|
</table>
|
|
|
|
|
|
|
|
- </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.update') }}" method="post" id="scheduleEditForm">
|
|
|
|
|
- @csrf
|
|
|
|
|
- <input type="hidden" name="id" value="0">
|
|
|
|
|
- <div>
|
|
|
|
|
- <input type="date" name="installation_date" value="" class="form-control form-control-sm mb-3">
|
|
|
|
|
- <textarea name="comment" placeholder="Комментарий для графика"
|
|
|
|
|
- class="form-control form-control-sm mb-3"></textarea>
|
|
|
|
|
- <button type="submit" class="btn btn-primary btn-sm">Обновить</button>
|
|
|
|
|
- </div>
|
|
|
|
|
- </form>
|
|
|
|
|
|
|
+ <!-- Модальное окно редактирования графика -->
|
|
|
|
|
+ <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.update') }}" method="post" id="scheduleEditForm">
|
|
|
|
|
+ @csrf
|
|
|
|
|
+ <input type="hidden" name="id" value="0">
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <input type="date" name="installation_date" value=""
|
|
|
|
|
+ class="form-control form-control-sm mb-3">
|
|
|
|
|
+ <textarea name="comment" placeholder="Комментарий для графика"
|
|
|
|
|
+ class="form-control form-control-sm mb-3"></textarea>
|
|
|
|
|
+ <button type="submit" class="btn btn-primary btn-sm">Обновить</button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </form>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- </div>
|
|
|
|
|
|
|
|
|
|
- <!-- Модальное окно создания графика -->
|
|
|
|
|
- <div class="modal fade" id="createSchedule" 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') }}" method="post" id="scheduleCreateForm">
|
|
|
|
|
- @csrf
|
|
|
|
|
- <input type="text" class="form-control mb-2" placeholder="Поиск площадки" id="search_order">
|
|
|
|
|
- <select id="select_order" name="order_id" class="form-select mb-3" size="7" multiple
|
|
|
|
|
- required></select>
|
|
|
|
|
- <div>
|
|
|
|
|
- <input type="date" name="installation_date" value="" class="form-control form-control-sm mb-3">
|
|
|
|
|
- <textarea name="comment" placeholder="Комментарий для графика"
|
|
|
|
|
- class="form-control form-control-sm mb-3"></textarea>
|
|
|
|
|
- <button type="submit" class="btn btn-primary btn-sm">Создать</button>
|
|
|
|
|
- </div>
|
|
|
|
|
- </form>
|
|
|
|
|
|
|
+ <!-- Модальное окно создания графика -->
|
|
|
|
|
+ <div class="modal fade" id="createSchedule" 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') }}" method="post" id="scheduleCreateForm">
|
|
|
|
|
+ @csrf
|
|
|
|
|
+ <input type="text" class="form-control mb-2" placeholder="Поиск площадки" id="search_order">
|
|
|
|
|
+ <select id="select_order" name="order_id" class="form-select mb-3" size="7" multiple
|
|
|
|
|
+ required></select>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <input type="date" name="installation_date" value=""
|
|
|
|
|
+ class="form-control form-control-sm mb-3">
|
|
|
|
|
+ <textarea name="comment" placeholder="Комментарий для графика"
|
|
|
|
|
+ class="form-control form-control-sm mb-3"></textarea>
|
|
|
|
|
+ <button type="submit" class="btn btn-primary btn-sm">Создать</button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </form>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- </div>
|
|
|
|
|
|
|
|
|
|
- @if($errors->any())
|
|
|
|
|
- @dump($errors)
|
|
|
|
|
- @endif
|
|
|
|
|
|
|
+ </div>
|
|
|
@endsection
|
|
@endsection
|
|
|
|
|
|
|
|
@push('scripts')
|
|
@push('scripts')
|
|
@@ -165,7 +179,7 @@
|
|
|
$('.editSchedule').on('click', function () {
|
|
$('.editSchedule').on('click', function () {
|
|
|
let scheduleId = $(this).attr('data-schedule-id');
|
|
let scheduleId = $(this).attr('data-schedule-id');
|
|
|
let scheduleDate = $(this).attr('data-schedule-date');
|
|
let scheduleDate = $(this).attr('data-schedule-date');
|
|
|
- let scheduleComment = $('.comment-'+scheduleId).text();
|
|
|
|
|
|
|
+ let scheduleComment = $('.comment-' + scheduleId).text();
|
|
|
$('form#scheduleEditForm input[name=id]').val(scheduleId);
|
|
$('form#scheduleEditForm input[name=id]').val(scheduleId);
|
|
|
$('form#scheduleEditForm input[name=installation_date]').val(scheduleDate);
|
|
$('form#scheduleEditForm input[name=installation_date]').val(scheduleDate);
|
|
|
$('form#scheduleEditForm textarea').text(scheduleComment);
|
|
$('form#scheduleEditForm textarea').text(scheduleComment);
|
|
@@ -173,6 +187,14 @@
|
|
|
myModalEditSchedule.show();
|
|
myModalEditSchedule.show();
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+ $('.deleteSchedule').on('click', function () {
|
|
|
|
|
+ if (confirm('Удалить запись?')) {
|
|
|
|
|
+ let scheduleId = $(this).attr('data-schedule-id');
|
|
|
|
|
+ $('.deleteForm-' + scheduleId).submit();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
$('.createSchedule').on('click', function () {
|
|
$('.createSchedule').on('click', function () {
|
|
|
let scheduleDate = $(this).attr('data-schedule-date');
|
|
let scheduleDate = $(this).attr('data-schedule-date');
|
|
|
|
|
|