|
@@ -76,19 +76,24 @@
|
|
|
@foreach($schs as $schedule)
|
|
@foreach($schs as $schedule)
|
|
|
{!! (!$loop->first) ? '<tr>':'' !!}
|
|
{!! (!$loop->first) ? '<tr>':'' !!}
|
|
|
<td style="background: {{ $schedule->brigadier->color }}"
|
|
<td style="background: {{ $schedule->brigadier->color }}"
|
|
|
- class="align-middle">{{ $schedule->order_id }}</td>
|
|
|
|
|
|
|
+ class="align-middle code-{{ $schedule->id }}">{{ $schedule->address_code }}</td>
|
|
|
<td style="background: {{ $schedule->brigadier->color }}"
|
|
<td style="background: {{ $schedule->brigadier->color }}"
|
|
|
class="align-middle">{{ $schedule->district->shortname }}</td>
|
|
class="align-middle">{{ $schedule->district->shortname }}</td>
|
|
|
<td style="background: {{ $schedule->brigadier->color }}"
|
|
<td style="background: {{ $schedule->brigadier->color }}"
|
|
|
class="align-middle">{{ $schedule->area->name }}</td>
|
|
class="align-middle">{{ $schedule->area->name }}</td>
|
|
|
|
|
+ <td style="background: {{ $schedule->brigadier->color }}" class="align-middle">
|
|
|
|
|
+ @if($schedule->order_id)
|
|
|
|
|
+ <a href="{{ route('order.show', $schedule->order_id) }}">{{ $schedule->object_address }}</a>
|
|
|
|
|
+ @else
|
|
|
|
|
+ {{ $schedule->object_address }}
|
|
|
|
|
+ @endif
|
|
|
|
|
+ </td>
|
|
|
<td style="background: {{ $schedule->brigadier->color }}"
|
|
<td style="background: {{ $schedule->brigadier->color }}"
|
|
|
- class="align-middle">{{ $schedule->object_address }}</td>
|
|
|
|
|
- <td style="background: {{ $schedule->brigadier->color }}"
|
|
|
|
|
- class="align-middle">{{ $schedule->objectType->name }}</td>
|
|
|
|
|
|
|
+ class="align-middle object-type-{{ $schedule->id }}">{{ $schedule->object_type }}</td>
|
|
|
<td style="background: {{ $schedule->brigadier->color }}"
|
|
<td style="background: {{ $schedule->brigadier->color }}"
|
|
|
- class="align-middle">{!! $schedule->mafs !!}</td>
|
|
|
|
|
|
|
+ class="align-middle mafs-{{ $schedule->id }}">{!! nl2br($schedule->mafs) !!}</td>
|
|
|
<td style="background: {{ $schedule->brigadier->color }}"
|
|
<td style="background: {{ $schedule->brigadier->color }}"
|
|
|
- class="align-middle">{{ $schedule->mafs_count }}</td>
|
|
|
|
|
|
|
+ class="align-middle mafs-count-{{ $schedule->id }}">{{ $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 }}"
|
|
<td style="background: {{ $schedule->brigadier->color }}"
|
|
@@ -96,6 +101,10 @@
|
|
|
<td style="background: {{ $schedule->brigadier->color }}" class="align-middle">
|
|
<td style="background: {{ $schedule->brigadier->color }}" class="align-middle">
|
|
|
<i class="bi bi-pencil p-1 m-1 cursor-pointer text-primary editSchedule"
|
|
<i class="bi bi-pencil p-1 m-1 cursor-pointer text-primary editSchedule"
|
|
|
data-schedule-date="{{ $schedule->installation_date }}"
|
|
data-schedule-date="{{ $schedule->installation_date }}"
|
|
|
|
|
+ data-schedule-address="{{ $schedule->object_address }}"
|
|
|
|
|
+ data-schedule-district="{{ $schedule->district_id }}"
|
|
|
|
|
+ data-schedule-brigadier="{{ $schedule->brigadier_id }}"
|
|
|
|
|
+ data-schedule-area="{{ $schedule->area_id }}"
|
|
|
data-schedule-id="{{ $schedule->id }}"></i>
|
|
data-schedule-id="{{ $schedule->id }}"></i>
|
|
|
<i class="bi bi-trash text-danger p-1 m-1 deleteSchedule"
|
|
<i class="bi bi-trash text-danger p-1 m-1 deleteSchedule"
|
|
|
data-schedule-id="{{ $schedule->id }}"></i>
|
|
data-schedule-id="{{ $schedule->id }}"></i>
|
|
@@ -123,7 +132,7 @@
|
|
|
<div class="modal-dialog modal-fullscreen-sm-down modal-lg">
|
|
<div class="modal-dialog modal-fullscreen-sm-down modal-lg">
|
|
|
<div class="modal-content">
|
|
<div class="modal-content">
|
|
|
<div class="modal-header">
|
|
<div class="modal-header">
|
|
|
- <h1 class="modal-title fs-5" id="addModalLabel">Изменить запись в графике</h1>
|
|
|
|
|
|
|
+ <h1 class="modal-title fs-5" id="addModalLabel">Изменить/создать запись в графике</h1>
|
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Закрыть"></button>
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Закрыть"></button>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="modal-body">
|
|
<div class="modal-body">
|
|
@@ -131,11 +140,19 @@
|
|
|
@csrf
|
|
@csrf
|
|
|
<input type="hidden" name="id" value="0">
|
|
<input type="hidden" name="id" value="0">
|
|
|
<div>
|
|
<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>
|
|
|
|
|
|
|
+ @include('partials.input', ['name' => 'installation_date', 'title' => 'Дата монтажа'])
|
|
|
|
|
+ @include('partials.input', ['name' => 'address_code', 'title' => 'Код адреса'])
|
|
|
|
|
+ @include('partials.select', ['name' => 'district_id', 'title' => 'Округ', 'options' => $districts, 'first_empty' => true, 'required' => true])
|
|
|
|
|
+ @include('partials.select', ['name' => 'area_id', 'title' => 'Район', 'options' => $areas, 'required' => true, 'first_empty' => true])
|
|
|
|
|
+ @include('partials.input', ['name' => 'object_address', 'title' => 'Адрес'])
|
|
|
|
|
+ @include('partials.input', ['name' => 'object_type', 'title' => 'Тип объекта'])
|
|
|
|
|
+ @include('partials.textarea', ['name' => 'mafs', 'title' => 'МАФы'])
|
|
|
|
|
+ @include('partials.input', ['name' => 'mafs_count', 'title' => 'Кол-во МАФ'])
|
|
|
|
|
+ @include('partials.select', ['name' => 'brigadier_id', 'title' => 'Бригадир', 'options' => $brigadiers, 'required' => true, 'first_empty' => true])
|
|
|
|
|
+ @include('partials.textarea', ['name' => 'comment', 'title' => 'Комментарий'])
|
|
|
|
|
+ <div class="text-center">
|
|
|
|
|
+ <button type="submit" class="btn btn-primary btn-sm">Сохранить</button>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</form>
|
|
</form>
|
|
|
</div>
|
|
</div>
|
|
@@ -144,32 +161,35 @@
|
|
|
</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>
|
|
|
|
|
- </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--}}
|
|
|
|
|
+{{-- @include('partials.input', ['name' => 'installation_date', 'title' => 'Дата монтажа'])--}}
|
|
|
|
|
+{{-- @include('partials.input', ['name' => 'address_code', 'title' => 'Код адреса'])--}}
|
|
|
|
|
+{{-- @include('partials.select', ['name' => 'district_id', 'title' => 'Округ', 'options' => $districts, 'first_empty' => true, 'required' => true])--}}
|
|
|
|
|
+{{-- @include('partials.select', ['name' => 'area_id', 'title' => 'Район', 'options' => $areas, 'required' => true, 'first_empty' => true])--}}
|
|
|
|
|
+{{-- @include('partials.input', ['name' => 'object_address', 'title' => 'Адрес'])--}}
|
|
|
|
|
+{{-- @include('partials.input', ['name' => 'object_type', 'title' => 'Тип объекта'])--}}
|
|
|
|
|
+{{-- @include('partials.textarea', ['name' => 'mafs', 'title' => 'МАФы'])--}}
|
|
|
|
|
+{{-- @include('partials.input', ['name' => 'mafs_count', 'title' => 'Кол-во МАФ'])--}}
|
|
|
|
|
+{{-- @include('partials.select', ['name' => 'brigadier_id', 'title' => 'Бригадир', 'options' => $brigadiers, 'required' => true, 'first_empty' => true])--}}
|
|
|
|
|
+{{-- @include('partials.textarea', ['name' => 'comment', 'title' => 'Комментарий'])--}}
|
|
|
|
|
+{{-- <div class="text-center">--}}
|
|
|
|
|
+{{-- <button type="submit" class="btn btn-primary btn-sm">Сохранить</button>--}}
|
|
|
|
|
+{{-- </div>--}}
|
|
|
|
|
+{{-- </form>--}}
|
|
|
|
|
+{{-- </div>--}}
|
|
|
|
|
+{{-- </div>--}}
|
|
|
|
|
+{{-- </div>--}}
|
|
|
|
|
+{{-- </div>--}}
|
|
|
|
|
|
|
|
|
|
|
|
|
@if($errors->any())
|
|
@if($errors->any())
|
|
@@ -183,10 +203,28 @@
|
|
|
$('.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 scheduleDistrict = $(this).attr('data-schedule-district');
|
|
|
|
|
+ let scheduleArea = $(this).attr('data-schedule-area');
|
|
|
|
|
+ let scheduleBrigadier = $(this).attr('data-schedule-brigadier');
|
|
|
|
|
+ let scheduleAddress = $(this).attr('data-schedule-address');
|
|
|
let scheduleComment = $('.comment-' + scheduleId).text();
|
|
let scheduleComment = $('.comment-' + scheduleId).text();
|
|
|
|
|
+ let scheduleMafs = $('.mafs-' + scheduleId).text();
|
|
|
|
|
+ let scheduleObjectType = $('.object-type-' + scheduleId).text();
|
|
|
|
|
+ let scheduleMafsCount = $('.mafs-count-' + scheduleId).text();
|
|
|
|
|
+ let scheduleCode = $('.code-' + scheduleId).text();
|
|
|
|
|
+ console.log(scheduleId, scheduleDate, scheduleDistrict, $(this).attr('data-schedule-brigadier'));
|
|
|
$('form#scheduleEditForm input[name=id]').val(scheduleId);
|
|
$('form#scheduleEditForm input[name=id]').val(scheduleId);
|
|
|
|
|
+ $('form#scheduleEditForm input[name=object_address]').val(scheduleAddress);
|
|
|
|
|
+ $('form#scheduleEditForm input[name=object_type]').val(scheduleObjectType);
|
|
|
$('form#scheduleEditForm input[name=installation_date]').val(scheduleDate);
|
|
$('form#scheduleEditForm input[name=installation_date]').val(scheduleDate);
|
|
|
- $('form#scheduleEditForm textarea').text(scheduleComment);
|
|
|
|
|
|
|
+ $('form#scheduleEditForm select[name=district_id]').val(scheduleDistrict);
|
|
|
|
|
+ $('form#scheduleEditForm select[name=area_id]').val(scheduleArea);
|
|
|
|
|
+ $('form#scheduleEditForm select[name=brigadier_id]').val(scheduleBrigadier);
|
|
|
|
|
+ $('form#scheduleEditForm textarea[name=comment]').text(scheduleComment);
|
|
|
|
|
+ $('form#scheduleEditForm textarea[name=mafs]').text(scheduleMafs);
|
|
|
|
|
+ $('form#scheduleEditForm input[name=mafs_count]').val(scheduleMafsCount);
|
|
|
|
|
+ $('form#scheduleEditForm input[name=address_code]').val(scheduleCode);
|
|
|
|
|
+
|
|
|
let myModalEditSchedule = new bootstrap.Modal(document.getElementById("copySchedule"), {});
|
|
let myModalEditSchedule = new bootstrap.Modal(document.getElementById("copySchedule"), {});
|
|
|
myModalEditSchedule.show();
|
|
myModalEditSchedule.show();
|
|
|
});
|
|
});
|
|
@@ -202,10 +240,19 @@
|
|
|
$('.createSchedule').on('click', function () {
|
|
$('.createSchedule').on('click', function () {
|
|
|
let scheduleDate = $(this).attr('data-schedule-date');
|
|
let scheduleDate = $(this).attr('data-schedule-date');
|
|
|
|
|
|
|
|
- $('form#scheduleCreateForm input[name=installation_date]').val(scheduleDate);
|
|
|
|
|
- $('form#scheduleCreateForm textarea').text('');
|
|
|
|
|
|
|
+ $('form#scheduleEditForm input[name=id]').val('');
|
|
|
|
|
+ $('form#scheduleEditForm input[name=object_address]').val('');
|
|
|
|
|
+ $('form#scheduleEditForm input[name=object_type]').val('');
|
|
|
|
|
+ $('form#scheduleEditForm input[name=installation_date]').val(scheduleDate);
|
|
|
|
|
+ $('form#scheduleEditForm select[name=district_id]').val('');
|
|
|
|
|
+ $('form#scheduleEditForm select[name=area_id]').val('');
|
|
|
|
|
+ $('form#scheduleEditForm select[name=brigadier_id]').val('');
|
|
|
|
|
+ $('form#scheduleEditForm textarea[name=comment]').text('');
|
|
|
|
|
+ $('form#scheduleEditForm textarea[name=mafs]').text('');
|
|
|
|
|
+ $('form#scheduleEditForm input[name=mafs_count]').val('');
|
|
|
|
|
+ $('form#scheduleEditForm input[name=address_code]').val('');
|
|
|
|
|
|
|
|
- let myModalCreateSchedule = new bootstrap.Modal(document.getElementById("createSchedule"), {});
|
|
|
|
|
|
|
+ let myModalCreateSchedule = new bootstrap.Modal(document.getElementById("copySchedule"), {});
|
|
|
myModalCreateSchedule.show();
|
|
myModalCreateSchedule.show();
|
|
|
});
|
|
});
|
|
|
|
|
|
|
@@ -221,6 +268,21 @@
|
|
|
}
|
|
}
|
|
|
);
|
|
);
|
|
|
}).trigger('keyup');
|
|
}).trigger('keyup');
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ $('#district_id').on('change', function () {
|
|
|
|
|
+ // load areas of selected district
|
|
|
|
|
+ $.get('{{ route('area.ajax-get-areas-by-district') }}/' + $(this).val(),
|
|
|
|
|
+ function (data) {
|
|
|
|
|
+ $('#area_id').children().remove();
|
|
|
|
|
+ $.each(data, function (id, name) {
|
|
|
|
|
+ $('#area_id').append('<option value=\'' + id + '\'>' + name + '</option>');
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ );
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
</script>
|
|
</script>
|
|
|
<script type="text/javascript">
|
|
<script type="text/javascript">
|
|
|
function getWeekNumber(d) {
|
|
function getWeekNumber(d) {
|