| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151 |
- @extends('layouts.app')
- @section('content')
- <div class="row mb-2 page-header-row">
- <div class="col-12 col-md-4 page-header-title">
- <h3>МАФ</h3>
- </div>
- <div class="col-auto col-md-4 text-md-center page-header-year">
- @include('partials.year-switcher')
- </div>
- <div class="col-auto col-md-4 text-md-end page-header-actions">
- @if(hasRole('admin'))
- <button type="button" class="btn btn-sm mb-1 btn-primary page-action-btn" data-bs-toggle="modal" data-bs-target="#importModal" aria-label="Импорт">
- <i class="bi bi-upload page-action-btn__icon"></i>
- <span class="page-action-btn__label">Импорт</span>
- </button>
- <button type="button" class="btn btn-sm mb-1 btn-primary page-action-btn" data-bs-toggle="modal" data-bs-target="#exportModal" aria-label="Экспорт">
- <i class="bi bi-download page-action-btn__icon"></i>
- <span class="page-action-btn__label">Экспорт</span>
- </button>
- @endif
- @if(hasRole('admin,assistant_head'))
- <button type="button" class="btn btn-sm mb-1 btn-primary page-action-btn" data-bs-toggle="modal" data-bs-target="#registryModal" aria-label="Реестр на оплату">
- <i class="bi bi-file-earmark-spreadsheet page-action-btn__icon"></i>
- <span class="page-action-btn__label">Реестр на оплату</span>
- </button>
- @endif
- </div>
- </div>
- @include('partials.table', [
- 'id' => $id,
- 'header' => $header,
- 'strings' => $products_sku,
- 'routeName' => 'product_sku.show',
- 'routeParam' => 'product_sku',
- ])
- @include('partials.pagination', ['items' => $products_sku])
- <!-- Модальное окно импорта-->
- <div class="modal fade" id="importModal" tabindex="-1" aria-labelledby="importModalLabel" aria-hidden="true">
- <div class="modal-dialog modal-fullscreen-sm-down">
- <div class="modal-content">
- <div class="modal-header">
- <h1 class="modal-title fs-5" id="importModalLabel">Импорт МАФ</h1>
- <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Закрыть"></button>
- </div>
- <div class="modal-body">
- <form action="{{ route('import.create') }}" method="post" enctype="multipart/form-data">
- @csrf
- <input type="hidden" name="type" value="mafs">
- @include('partials.input', ['title' => 'XLSX файл', 'name' => 'import_file', 'type' => 'file', 'required' => true])
- @include('partials.submit', ['name' => 'Импорт'])
- </form>
- </div>
- </div>
- </div>
- </div>
- <!-- Модальное окно экспорта-->
- <div class="modal fade" id="exportModal" tabindex="-1" aria-labelledby="exportModalLabel" 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="exportModalLabel">Экспорт МАФ</h1>
- <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Закрыть"></button>
- </div>
- <div class="modal-body">
- <form action="{{ route('mafs.export') }}" method="post" enctype="multipart/form-data">
- @csrf
- @include('partials.checkbox', ['title' => 'С учётом текущего фильтра и поиска', 'name' => 'withFilter', 'type' => 'checkbox', 'value' => 'yes', 'checked' => false])
- <div class="d-none">
- @if(request()->s)
- @include('partials.input', ['name' => 's', 'title' => 'поиск', 'value' => request()->s])
- @endif
- @if(request()->filters)
- @foreach(request()->filters as $filterName => $filterValue)
- @include('partials.input', ['name' => 'filters[' . $filterName .']', 'title' => $filterName, 'value' => $filterValue])
- @endforeach
- @endif
- </div>
- @include('partials.submit', ['name' => 'Экспорт'])
- </form>
- </div>
- </div>
- </div>
- </div>
- <!-- Модальное окно реестра на оплату-->
- <div class="modal fade" id="registryModal" tabindex="-1" aria-labelledby="registryModalLabel" aria-hidden="true">
- <div class="modal-dialog modal-fullscreen-sm-down">
- <div class="modal-content">
- <div class="modal-header">
- <h1 class="modal-title fs-5" id="registryModalLabel">Реестр на оплату</h1>
- <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Закрыть"></button>
- </div>
- <div class="modal-body">
- <form action="{{ route('mafs.registry') }}" method="post">
- @csrf
- @include('partials.input', ['name' => 'upd_number', 'title' => 'Номер УПД', 'required' => true])
- @include('partials.submit', ['name' => 'Сформировать'])
- </form>
- <hr>
- <h6 class="mb-2">Сформированные реестры</h6>
- @if($maf_registry_files->isNotEmpty())
- <div class="table-responsive">
- <table class="table table-sm align-middle mb-0">
- <thead>
- <tr>
- <th>Файл</th>
- <th>Дата</th>
- <th>Пользователь</th>
- <th class="text-end">Скачать</th>
- </tr>
- </thead>
- <tbody>
- @foreach($maf_registry_files as $registryFile)
- <tr>
- <td>{{ $registryFile->original_name }}</td>
- <td>{{ $registryFile->created_at?->format('d.m.Y H:i') }}</td>
- <td>{{ $registryFile->user?->name ?? '' }}</td>
- <td class="text-end">
- <a href="{{ $registryFile->link }}" class="btn btn-sm btn-outline-primary" target="_blank">
- <i class="bi bi-download"></i>
- </a>
- </td>
- </tr>
- @endforeach
- </tbody>
- </table>
- </div>
- @else
- <div class="text-muted">Сформированных реестров пока нет.</div>
- @endif
- </div>
- </div>
- </div>
- </div>
- @endsection
- @push('scripts')
- <script type="module">
- $('#select_maf').on('change', function () {
- $('#product_id').val($(this).val());
- $('#product_name').val($('#select_maf option:selected').text()).slideDown();
- $('#select_maf_form').slideUp();
- $('#sku_form').slideDown();
- });
- </script>
- @endpush
|