index.blade.php 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. @extends('layouts.app')
  2. @section('content')
  3. <div class="row mb-2 page-header-row">
  4. <div class="col-12 col-md-4 page-header-title">
  5. <h3>МАФ</h3>
  6. </div>
  7. <div class="col-auto col-md-4 text-md-center page-header-year">
  8. @include('partials.year-switcher')
  9. </div>
  10. <div class="col-auto col-md-4 text-md-end page-header-actions">
  11. @if(hasRole('admin'))
  12. <button type="button" class="btn btn-sm mb-1 btn-primary page-action-btn" data-bs-toggle="modal" data-bs-target="#importModal" aria-label="Импорт">
  13. <i class="bi bi-upload page-action-btn__icon"></i>
  14. <span class="page-action-btn__label">Импорт</span>
  15. </button>
  16. <button type="button" class="btn btn-sm mb-1 btn-primary page-action-btn" data-bs-toggle="modal" data-bs-target="#exportModal" aria-label="Экспорт">
  17. <i class="bi bi-download page-action-btn__icon"></i>
  18. <span class="page-action-btn__label">Экспорт</span>
  19. </button>
  20. @endif
  21. @if(hasRole('admin,assistant_head'))
  22. <button type="button" class="btn btn-sm mb-1 btn-primary page-action-btn" data-bs-toggle="modal" data-bs-target="#registryModal" aria-label="Реестр на оплату">
  23. <i class="bi bi-file-earmark-spreadsheet page-action-btn__icon"></i>
  24. <span class="page-action-btn__label">Реестр на оплату</span>
  25. </button>
  26. @endif
  27. </div>
  28. </div>
  29. @include('partials.table', [
  30. 'id' => $id,
  31. 'header' => $header,
  32. 'strings' => $products_sku,
  33. 'routeName' => 'product_sku.show',
  34. 'routeParam' => 'product_sku',
  35. ])
  36. @include('partials.pagination', ['items' => $products_sku])
  37. <!-- Модальное окно импорта-->
  38. <div class="modal fade" id="importModal" tabindex="-1" aria-labelledby="importModalLabel" aria-hidden="true">
  39. <div class="modal-dialog modal-fullscreen-sm-down">
  40. <div class="modal-content">
  41. <div class="modal-header">
  42. <h1 class="modal-title fs-5" id="importModalLabel">Импорт МАФ</h1>
  43. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Закрыть"></button>
  44. </div>
  45. <div class="modal-body">
  46. <form action="{{ route('import.create') }}" method="post" enctype="multipart/form-data">
  47. @csrf
  48. <input type="hidden" name="type" value="mafs">
  49. @include('partials.input', ['title' => 'XLSX файл', 'name' => 'import_file', 'type' => 'file', 'required' => true])
  50. @include('partials.submit', ['name' => 'Импорт'])
  51. </form>
  52. </div>
  53. </div>
  54. </div>
  55. </div>
  56. <!-- Модальное окно экспорта-->
  57. <div class="modal fade" id="exportModal" tabindex="-1" aria-labelledby="exportModalLabel" aria-hidden="true">
  58. <div class="modal-dialog modal-fullscreen-sm-down modal-lg">
  59. <div class="modal-content">
  60. <div class="modal-header">
  61. <h1 class="modal-title fs-5" id="exportModalLabel">Экспорт МАФ</h1>
  62. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Закрыть"></button>
  63. </div>
  64. <div class="modal-body">
  65. <form action="{{ route('mafs.export') }}" method="post" enctype="multipart/form-data">
  66. @csrf
  67. @include('partials.checkbox', ['title' => 'С учётом текущего фильтра и поиска', 'name' => 'withFilter', 'type' => 'checkbox', 'value' => 'yes', 'checked' => false])
  68. <div class="d-none">
  69. @if(request()->s)
  70. @include('partials.input', ['name' => 's', 'title' => 'поиск', 'value' => request()->s])
  71. @endif
  72. @if(request()->filters)
  73. @foreach(request()->filters as $filterName => $filterValue)
  74. @include('partials.input', ['name' => 'filters[' . $filterName .']', 'title' => $filterName, 'value' => $filterValue])
  75. @endforeach
  76. @endif
  77. </div>
  78. @include('partials.submit', ['name' => 'Экспорт'])
  79. </form>
  80. </div>
  81. </div>
  82. </div>
  83. </div>
  84. <!-- Модальное окно реестра на оплату-->
  85. <div class="modal fade" id="registryModal" tabindex="-1" aria-labelledby="registryModalLabel" aria-hidden="true">
  86. <div class="modal-dialog modal-fullscreen-sm-down">
  87. <div class="modal-content">
  88. <div class="modal-header">
  89. <h1 class="modal-title fs-5" id="registryModalLabel">Реестр на оплату</h1>
  90. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Закрыть"></button>
  91. </div>
  92. <div class="modal-body">
  93. <form action="{{ route('mafs.registry') }}" method="post">
  94. @csrf
  95. @include('partials.input', ['name' => 'upd_number', 'title' => 'Номер УПД', 'required' => true])
  96. @include('partials.submit', ['name' => 'Сформировать'])
  97. </form>
  98. </div>
  99. </div>
  100. </div>
  101. </div>
  102. @endsection
  103. @push('scripts')
  104. <script type="module">
  105. $('#select_maf').on('change', function () {
  106. $('#product_id').val($(this).val());
  107. $('#product_name').val($('#select_maf option:selected').text()).slideDown();
  108. $('#select_maf_form').slideUp();
  109. $('#sku_form').slideDown();
  110. });
  111. </script>
  112. @endpush