|
|
@@ -1,48 +1,96 @@
|
|
|
@extends('layouts.app')
|
|
|
|
|
|
@section('content')
|
|
|
- <form action="{{ route('catalog.import') }}" method="post" enctype="multipart/form-data">
|
|
|
- @csrf
|
|
|
- <input class="form-control mb-3" required type="number" name="year" min="2000" max="{{ (int)date('Y') + 1 }}" placeholder="2020" value="{{ date('Y') }}">
|
|
|
- <input class="form-control mb-3" required type="file" name="import_file">
|
|
|
- <button type="submit" class="btn btn-primary">Импорт</button>
|
|
|
- </form>
|
|
|
-
|
|
|
- <div class="px-md-3 px-2">
|
|
|
- <div class="table">
|
|
|
- <div class="row d-none d-md-flex header px-5 py-4 fw-bold">
|
|
|
- <div class="col-xl-3">Фото</div>
|
|
|
- <div class="col-xl-3">Наименование</div>
|
|
|
- <div class="col-xl-3">фывфывфыв</div>
|
|
|
- <div class="col-xl-3 text-end">Действия</div>
|
|
|
+
|
|
|
+ <div class="row mb-3">
|
|
|
+ <div class="col-6">
|
|
|
+ <h3>Каталог</h3>
|
|
|
+ </div>
|
|
|
+ <div class="col-6 text-end">
|
|
|
+ <button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#importModal">
|
|
|
+ Импорт
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="tbl">
|
|
|
+ <div class="row d-none d-md-flex header px-2 py-3 fw-bold bg-primary-subtle">
|
|
|
+ <div class="col-xl-1">Год, ном. номер, артикул</div>
|
|
|
+ <div class="col-xl-2">Производитель, наименование ТЗ</div>
|
|
|
+ <div class="col-xl-3">Типы</div>
|
|
|
+ <div class="col-xl-1">Размеры, ед.изм.</div>
|
|
|
+ <div class="col-xl-1">Прайс</div>
|
|
|
+ <div class="col-xl-4">Примечания</div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ @foreach($products as $product)
|
|
|
+ <div class="row px-2 py-2 align-items-center tbl-item" onclick="location.href='{{ route('catalog.show', $product->id) }}'">
|
|
|
+ <div class="col-xl-1">
|
|
|
+ {{ $product->year }}<br>
|
|
|
+ {{ $product->nomenclature_number }}<br>
|
|
|
+ {{ $product->article }}<br>
|
|
|
+ </div>
|
|
|
+ <div class="col-xl-2">
|
|
|
+ {{ $product->manufacturer }}<br>
|
|
|
+ {{ $product->name_tz }}<br>
|
|
|
+ </div>
|
|
|
+ <div class="col-xl-3">
|
|
|
+ {{ $product->type_tz }}<br>
|
|
|
+ {{ $product->type }}<br>
|
|
|
+ {{ $product->manufacturer_name }}
|
|
|
+ </div>
|
|
|
+ <div class="col-xl-1">
|
|
|
+ {{ $product->sizes }}<br>
|
|
|
+ {{ $product->unit }}<br>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="col-xl-1">
|
|
|
+ {{ $product->price_status }}<br>
|
|
|
+ {{ $product->product_price_txt }}<br>
|
|
|
+ {{ $product->installation_price_txt }}<br>
|
|
|
+ {{ $product->service_price_txt }}<br>
|
|
|
+ {{ $product->total_price_txt }}
|
|
|
+ </div>
|
|
|
+ <div class="col-xl-4" title="{!! nl2br($product->note) !!}">
|
|
|
+ {!! Str::words(nl2br($product->note), 15) !!}
|
|
|
+ </div>
|
|
|
+
|
|
|
</div>
|
|
|
+ @endforeach
|
|
|
|
|
|
-{{-- @foreach($users as $user)--}}
|
|
|
-{{-- <div class="row px-md-5 px-2 py-4 align-items-center">--}}
|
|
|
-{{-- <div class="col-xl-3 mb-3">--}}
|
|
|
-{{-- <span class="ps-2">{{ $user->name }}</span>--}}
|
|
|
-{{-- </div>--}}
|
|
|
-{{-- <div class="col-xl-3">--}}
|
|
|
-{{-- <span class="d-md-none fw-bold">E-mail: </span>{{ $user->email }}--}}
|
|
|
-{{-- </div>--}}
|
|
|
-{{-- <div class="col-xl-3">--}}
|
|
|
-{{-- <span class="d-md-none fw-bold">Роль: </span>{{ roleName($user->role) }}--}}
|
|
|
-{{-- </div>--}}
|
|
|
-{{-- <div class="col-xl-3 text-end">--}}
|
|
|
-{{-- <a href="{{ route('user.show', $user->id) }}"><i class="bi bi-pencil fs-5 text-primary"></i></a>--}}
|
|
|
-{{-- <a href="#" onclick="if(confirm('Удалить пользователя {{ $user->name }}?')) { document.getElementById('delete-user-{{ $user->id }}').submit(); } ">--}}
|
|
|
-{{-- <i class="bi bi-trash fs-5 text-danger"></i>--}}
|
|
|
-{{-- </a>--}}
|
|
|
-{{-- <form action="{{ route('user.destroy', $user->id) }}" method="post" class="visually-hidden d-none" id="delete-user-{{ $user->id }}">--}}
|
|
|
-{{-- @csrf--}}
|
|
|
-{{-- @method('DELETE')--}}
|
|
|
-{{-- </form>--}}
|
|
|
-{{-- </div>--}}
|
|
|
-{{-- </div>--}}
|
|
|
-{{-- @endforeach--}}
|
|
|
+ </div>
|
|
|
+ <div class="row pt-3 px-3">
|
|
|
+ <div class="col-12 pagination">
|
|
|
+ {{ $products->links() }}
|
|
|
</div>
|
|
|
</div>
|
|
|
- @dump($products)
|
|
|
- @dump($errors)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <!-- Модальное окно -->
|
|
|
+ <div class="modal fade" id="importModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
|
|
+ <div class="modal-dialog">
|
|
|
+ <div class="modal-content">
|
|
|
+ <div class="modal-header">
|
|
|
+ <h1 class="modal-title fs-5" id="exampleModalLabel">Выберите год и файл для импорта</h1>
|
|
|
+ <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Закрыть"></button>
|
|
|
+ </div>
|
|
|
+ <div class="modal-body">
|
|
|
+ <form action="{{ route('catalog.import') }}" method="post" enctype="multipart/form-data">
|
|
|
+ @csrf
|
|
|
+ @include('partials.input', ['title' => 'Год', 'name' => 'year', 'type' => 'number', 'min' => 2000, 'max' => (int) date('Y') + 1, 'value' => date('Y')])
|
|
|
+ @include('partials.input', ['title' => 'XLSX файл', 'name' => 'import_file', 'type' => 'file'])
|
|
|
+ @include('partials.submit', ['name' => 'Импорт'])
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ @if($errors->count())
|
|
|
+ @dump($errors)
|
|
|
+ @endif
|
|
|
@endsection
|
|
|
|