index.blade.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. @extends('layouts.app')
  2. @section('content')
  3. <div class="row mb-3">
  4. <div class="col-6">
  5. <h3>Каталог</h3>
  6. </div>
  7. <div class="col-6 text-end">
  8. <button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#importModal">
  9. Импорт
  10. </button>
  11. </div>
  12. </div>
  13. @include('partials.table', [
  14. 'id' => 'products',
  15. 'header' => [
  16. 'id' => 'ID',
  17. 'year' => 'Год',
  18. 'nomenclature_number' => 'Номер номенклатуры',
  19. 'article' => 'Артикул',
  20. 'manufacturer' => 'Производитель',
  21. 'name_tz' => 'Наименование ТЗ',
  22. 'type_tz' => 'Тип по ТЗ',
  23. 'type' => 'Тип',
  24. 'manufacturer_name' => 'Наименование производителя',
  25. 'sizes' => 'Размеры',
  26. 'price_status' => 'Статус цены',
  27. 'product_price_txt' => 'Цена товара',
  28. 'installation_price_txt' => 'Цена установки',
  29. 'service_price_txt' => 'Цена обслуживания',
  30. 'total_price_txt' => 'Итоговая цена',
  31. 'note' => 'Примечания',
  32. 'created_at' => 'Дата создания',
  33. ],
  34. 'data' => $products
  35. ])
  36. <div class="row pt-3 px-3">
  37. <div class="col-12 pagination">
  38. {{ $products->links() }}
  39. </div>
  40. </div>
  41. <!-- Модальное окно импорта-->
  42. <div class="modal fade" id="importModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
  43. <div class="modal-dialog modal-fullscreen-sm-down">
  44. <div class="modal-content">
  45. <div class="modal-header">
  46. <h1 class="modal-title fs-5" id="exampleModalLabel">Выберите год и файл для импорта</h1>
  47. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Закрыть"></button>
  48. </div>
  49. <div class="modal-body">
  50. <form action="{{ route('catalog.import') }}" method="post" enctype="multipart/form-data">
  51. @csrf
  52. @include('partials.input', ['title' => 'Год', 'name' => 'year', 'type' => 'number', 'min' => 2000, 'max' => (int) date('Y') + 1, 'value' => date('Y')])
  53. @include('partials.input', ['title' => 'XLSX файл', 'name' => 'import_file', 'type' => 'file'])
  54. @include('partials.submit', ['name' => 'Импорт'])
  55. </form>
  56. </div>
  57. </div>
  58. </div>
  59. </div>
  60. @if($errors->count())
  61. @dump($errors)
  62. @endif
  63. @endsection