Ver Fonte

fix layouts

Alexander Musikhin há 2 semanas atrás
pai
commit
7d95dbde67

+ 28 - 10
app/Http/Controllers/Admin/AdminAreaController.php

@@ -14,30 +14,45 @@ use Illuminate\View\View;
 
 class AdminAreaController extends Controller
 {
-    protected string $id = 'id';
+    protected string $id = 'admin_areas';
     protected array $header = [
         'id' => 'ID',
         'name' => 'Название',
         'district_name' => 'Округ',
+        'actions' => '',
     ];
     protected array $searchFields = ['name'];
 
     public function index(Request $request): View
     {
-        $query = Area::with('district')->orderBy('name');
+        $allowedSortFields = ['id', 'name', 'district_name'];
+        $sortBy = in_array($request->get('sortBy'), $allowedSortFields, true) ? $request->get('sortBy') : 'name';
+        $orderBy = $request->get('order') === 'desc' ? 'desc' : 'asc';
+
+        $query = Area::query()
+            ->leftJoin('districts', 'areas.district_id', '=', 'districts.id')
+            ->select('areas.*', 'districts.shortname as district_name');
 
         // Фильтр по округу
         if ($request->has('district_id') && $request->district_id) {
-            $query->where('district_id', $request->district_id);
+            $query->where('areas.district_id', $request->district_id);
+        }
+
+        if ($request->filled('s')) {
+            $search = $request->get('s');
+            $query->where(function ($q) use ($search) {
+                $q->where('areas.name', 'like', '%' . $search . '%')
+                    ->orWhere('districts.shortname', 'like', '%' . $search . '%');
+            });
+        }
+
+        if ($sortBy === 'district_name') {
+            $query->orderBy('districts.shortname', $orderBy);
+        } else {
+            $query->orderBy('areas.' . $sortBy, $orderBy);
         }
 
-        $areas = $query->get()->map(function ($area) {
-            return [
-                'id' => $area->id,
-                'name' => $area->name,
-                'district_name' => $area->district?->shortname ?? '-',
-            ];
-        });
+        $areas = $query->get();
 
         $districts = District::orderBy('shortname')->pluck('shortname', 'id')->toArray();
 
@@ -45,6 +60,9 @@ class AdminAreaController extends Controller
             'active' => 'admin_areas',
             'id' => $this->id,
             'header' => $this->header,
+            'sortBy' => $sortBy,
+            'orderBy' => $orderBy,
+            'searchFields' => ['name', 'district_name'],
             'areas' => $areas,
             'districts' => $districts,
             'selectedDistrict' => $request->district_id,

+ 21 - 11
app/Http/Controllers/Admin/AdminDistrictController.php

@@ -13,33 +13,43 @@ use Illuminate\View\View;
 
 class AdminDistrictController extends Controller
 {
-    protected string $id = 'id';
+    protected string $id = 'admin_districts';
     protected array $header = [
         'id' => 'ID',
         'shortname' => 'Сокращение',
         'name' => 'Название',
         'areas_count' => 'Районов',
+        'actions' => '',
     ];
     protected array $searchFields = ['shortname', 'name'];
 
     public function index(Request $request): View
     {
-        $districts = District::withCount('areas')
-            ->orderBy('id')
-            ->get()
-            ->map(function ($district) {
-                return [
-                    'id' => $district->id,
-                    'shortname' => $district->shortname,
-                    'name' => $district->name,
-                    'areas_count' => $district->areas_count,
-                ];
+        $allowedSortFields = ['id', 'shortname', 'name', 'areas_count'];
+        $sortBy = in_array($request->get('sortBy'), $allowedSortFields, true) ? $request->get('sortBy') : 'id';
+        $orderBy = $request->get('order') === 'desc' ? 'desc' : 'asc';
+
+        $districts = District::query()->withCount('areas');
+
+        if ($request->filled('s')) {
+            $search = $request->get('s');
+            $districts->where(function ($query) use ($search) {
+                $query->where('shortname', 'like', '%' . $search . '%')
+                    ->orWhere('name', 'like', '%' . $search . '%');
             });
+        }
+
+        $districts = $districts
+            ->orderBy($sortBy, $orderBy)
+            ->get();
 
         return view('admin.districts.index', [
             'active' => 'admin_districts',
             'id' => $this->id,
             'header' => $this->header,
+            'sortBy' => $sortBy,
+            'orderBy' => $orderBy,
+            'searchFields' => $this->searchFields,
             'districts' => $districts,
         ]);
     }

+ 18 - 5
app/Http/Controllers/PricingCodeController.php

@@ -14,28 +14,41 @@ class PricingCodeController extends Controller
         'id' => 'pricing_codes',
         'header' => [
             'id' => 'ID',
+            'type' => 'Тип',
             'code' => 'Код',
             'description' => 'Расшифровка',
+            'actions' => 'Действия',
         ],
     ];
 
     public function index(Request $request)
     {
+        $sortBy = $request->get('sortBy', 'code');
+        $allowedSort = ['id', 'type', 'code', 'description'];
+        if (!in_array($sortBy, $allowedSort, true)) {
+            $sortBy = 'code';
+        }
+        $orderBy = $request->get('order') === 'desc' ? 'desc' : 'asc';
+
         $q = PricingCode::query();
 
         // Поиск
-        if ($request->has('search')) {
-            $search = $request->get('search');
+        $search = $request->get('s', $request->get('search'));
+        if (!empty($search)) {
             $q->where(function ($query) use ($search) {
                 $query->where('code', 'LIKE', '%' . $search . '%')
-                    ->orWhere('description', 'LIKE', '%' . $search . '%');
+                    ->orWhere('description', 'LIKE', '%' . $search . '%')
+                    ->orWhere('type', 'LIKE', '%' . $search . '%');
             });
         }
 
-        $q->orderBy('code');
+        $q->orderBy($sortBy, $orderBy);
 
         $this->data['pricing_codes'] = $q->paginate(session('per_page', config('pagination.per_page')))->withQueryString();
-        $this->data['search'] = $request->get('search');
+        $this->data['sortBy'] = $sortBy;
+        $this->data['orderBy'] = $orderBy;
+        $this->data['searchFields'] = ['type', 'code', 'description'];
+        $this->data['search'] = $search;
 
         return view('pricing_codes.index', $this->data);
     }

+ 55 - 0
resources/sass/app.scss

@@ -43,6 +43,40 @@
   opacity: 1;
 }
 
+.js-main-table-scroll {
+  overflow: auto;
+}
+
+.js-main-table-scroll .table {
+  margin-bottom: 0;
+}
+
+.js-main-table-scroll thead th {
+  position: sticky;
+  top: 0;
+  z-index: 3;
+  background-color: var(--bs-primary-bg-subtle);
+}
+
+.js-main-table-scroll .table-head-shadow th {
+  box-shadow: 0 8px 14px -10px rgba(0, 0, 0, 0.35);
+}
+
+.js-subtable-scroll {
+  overflow: auto;
+}
+
+.js-subtable-scroll .table {
+  margin-bottom: 0;
+}
+
+.js-subtable-scroll thead th {
+  position: sticky;
+  top: 0;
+  z-index: 2;
+  background-color: var(--bs-primary-bg-subtle);
+}
+
 .table {
   tr th {
     background-color: var(--bs-primary-bg-subtle);
@@ -89,6 +123,27 @@
   padding-right: 1rem;
 }
 
+.table-pagination-row {
+  padding-top: 0.25rem !important;
+  padding-bottom: 0.25rem !important;
+  background-color: var(--bs-body-bg);
+  box-shadow: 0 -8px 14px -10px rgba(0, 0, 0, 0.35);
+}
+
+.table-pagination-row .pagination {
+  margin-bottom: 0;
+}
+
+.table-pagination-row .pagination .page-link {
+  padding: 0.2rem 0.45rem;
+}
+
+.table-pagination-row .col-form-label {
+  margin-bottom: 0;
+  padding-top: 0.15rem;
+  padding-bottom: 0.15rem;
+}
+
 .cursor-pointer {
   cursor: pointer;
 }

+ 14 - 25
resources/views/admin/areas/index.blade.php

@@ -1,7 +1,7 @@
 @extends('layouts.app')
 
 @section('content')
-    <div class="row mb-3">
+    <div class="row mb-2">
         <div class="col-6">
             <h3>Районы</h3>
         </div>
@@ -48,30 +48,19 @@
         </div>
     </div>
 
-    <table class="table table-bordered table-striped table-hover table-sm">
-        <thead>
-            <tr>
-                @foreach($header as $key => $title)
-                    <th>{{ $title }}</th>
-                @endforeach
-                <th></th>
-            </tr>
-        </thead>
-        <tbody>
-            @foreach($areas as $area)
-                <tr>
-                    <td>{{ $area['id'] }}</td>
-                    <td>{{ $area['name'] }}</td>
-                    <td>{{ $area['district_name'] }}</td>
-                    <td class="text-end">
-                        <a href="{{ route('admin.area.show', $area['id']) }}" class="btn btn-sm btn-outline-primary">
-                            Редактировать
-                        </a>
-                    </td>
-                </tr>
-            @endforeach
-        </tbody>
-    </table>
+    @include('partials.table', [
+        'id' => $id,
+        'header' => $header,
+        'strings' => $areas,
+        'routeName' => 'admin.area.show',
+        'searchFields' => $searchFields,
+        'sortBy' => $sortBy,
+        'orderBy' => $orderBy,
+        'filters' => [],
+        'ranges' => [],
+        'dates' => [],
+        'enableColumnFilters' => false,
+    ])
 
     <!-- Модальное окно добавления -->
     <div class="modal fade" id="addModal" tabindex="-1" aria-hidden="true">

+ 14 - 26
resources/views/admin/districts/index.blade.php

@@ -1,7 +1,7 @@
 @extends('layouts.app')
 
 @section('content')
-    <div class="row mb-3">
+    <div class="row mb-2">
         <div class="col-6">
             <h3>Округа</h3>
         </div>
@@ -33,31 +33,19 @@
         </div>
     @endif
 
-    <table class="table table-bordered table-striped table-hover table-sm">
-        <thead>
-            <tr>
-                @foreach($header as $key => $title)
-                    <th>{{ $title }}</th>
-                @endforeach
-                <th></th>
-            </tr>
-        </thead>
-        <tbody>
-            @foreach($districts as $district)
-                <tr>
-                    <td>{{ $district['id'] }}</td>
-                    <td>{{ $district['shortname'] }}</td>
-                    <td>{{ $district['name'] }}</td>
-                    <td>{{ $district['areas_count'] }}</td>
-                    <td class="text-end">
-                        <a href="{{ route('admin.district.show', $district['id']) }}" class="btn btn-sm btn-outline-primary">
-                            Редактировать
-                        </a>
-                    </td>
-                </tr>
-            @endforeach
-        </tbody>
-    </table>
+    @include('partials.table', [
+        'id' => $id,
+        'header' => $header,
+        'strings' => $districts,
+        'routeName' => 'admin.district.show',
+        'searchFields' => $searchFields,
+        'sortBy' => $sortBy,
+        'orderBy' => $orderBy,
+        'filters' => [],
+        'ranges' => [],
+        'dates' => [],
+        'enableColumnFilters' => false,
+    ])
 
     <!-- Модальное окно добавления -->
     <div class="modal fade" id="addModal" tabindex="-1" aria-hidden="true">

+ 1 - 1
resources/views/admin/settings/index.blade.php

@@ -1,7 +1,7 @@
 @extends('layouts.app')
 
 @section('content')
-    <div class="row mb-3">
+    <div class="row mb-2">
         <div class="col-12">
             <h3>Настройки</h3>
         </div>

+ 1 - 1
resources/views/catalog/index.blade.php

@@ -2,7 +2,7 @@
 
 @section('content')
 
-    <div class="row mb-3 catalog">
+    <div class="row mb-2 catalog">
         <div class="col-md-4">
             <h3>Каталог</h3>
         </div>

+ 1 - 1
resources/views/contracts/index.blade.php

@@ -1,7 +1,7 @@
 @extends('layouts.app')
 
 @section('content')
-    <div class="row mb-3">
+    <div class="row mb-2">
         <div class="col-6">
             <h3>Договоры</h3>
         </div>

+ 1 - 1
resources/views/import/index.blade.php

@@ -1,7 +1,7 @@
 @extends('layouts.app')
 
 @section('content')
-    <div class="row mb-3">
+    <div class="row mb-2">
         <div class="col-6">
             <h3>Импорт</h3>
         </div>

+ 1 - 1
resources/views/layouts/app.blade.php

@@ -154,7 +154,7 @@
             </div>
         </nav>
 
-        <main class="py-4">
+        <main class="pt-2 pb-0">
             <div class="container-fluid">
                 @yield('content')
             </div>

+ 1 - 1
resources/views/layouts/menu.blade.php

@@ -8,7 +8,7 @@
                                 href="{{ route('catalog.index', session('gp_products')) }}">Каталог</a></li>
         <li class="nav-item"><a class="nav-link @if($active == 'reports') active @endif"
                                 href="{{ route('reports.index', session('gp_reports')) }}">Отчёты</a></li>
-        <li class="nav-item"><a class="nav-link" href="{{ route('responsible.index', session('gp_responsibles')) }}">Ответственные</a></li>
+        <li class="nav-item"><a class="nav-link @if($active == 'responsibles') active @endif" href="{{ route('responsible.index', session('gp_responsibles')) }}">Ответственные</a></li>
     @endif
     <li class="nav-item"><a class="nav-link @if($active == 'reclamations') active @endif"
                             href="{{ route('reclamations.index', session('gp_reclamations')) }}">Рекламации</a></li>

+ 1 - 1
resources/views/maf_orders/index.blade.php

@@ -2,7 +2,7 @@
 
 @section('content')
 
-    <div class="row mb-3">
+    <div class="row mb-2">
         <div class="col-md-4">
             <h3>Заказы МАФ</h3>
         </div>

+ 1 - 1
resources/views/orders/index.blade.php

@@ -1,7 +1,7 @@
 @extends('layouts.app')
 
 @section('content')
-    <div class="row mb-3">
+    <div class="row mb-2">
         <div class="col-md-4">
             <h3>Площадки</h3>
         </div>

+ 4 - 4
resources/views/partials/pagination.blade.php

@@ -4,13 +4,13 @@
 @endphp
 
 
-<div class="row pt-3 px-3">
+<div class="row px-3 py-1 align-items-center table-pagination-row">
     <div class="col-md-7 pagination">
         {{ $items->links() }}
     </div>
-    <div class="col-md-5 mt-1">
+    <div class="col-md-5">
         @if($items->count())
-            @include('partials.select', ['name' => 'per_page', 'title' => 'Результатов на странице:', 'options' => $pp, 'value' => $per_page, 'key_as_val' => true])
+            @include('partials.select', ['name' => 'per_page', 'title' => 'Результатов на странице:', 'options' => $pp, 'value' => $per_page, 'key_as_val' => true, 'mb' => 1])
         @endif
     </div>
 </div>
@@ -24,4 +24,4 @@
             document.location.href = currentUrl.href;
         });
     </script>
-@endpush
+@endpush

+ 63 - 11
resources/views/partials/table.blade.php

@@ -1,4 +1,4 @@
-<div class="table-responsive">
+<div class="table-responsive js-main-table-scroll">
 
 
     <div class="table-buttons py-2 bg-primary rounded-start d-flex flex-column ">
@@ -18,17 +18,17 @@
         </button>
     </div>
     <table class="table table-interactive table-initial-hidden" id="tbl" data-table-name="{{ $id }}">
-        <thead>
+        <thead class="table-head-shadow">
         <tr>
             @foreach($header as $headerName => $headerTitle)
                 <th scope="col" class="bg-primary-subtle column_{{ $headerName }}">
                     <div class="d-flex align-items-center justify-content-between">
 
-                        <div class="cursor-pointer sort-by-column" data-name="{{ $headerName }}">
+                        <div class="@if($headerName !== 'actions') cursor-pointer sort-by-column @endif" data-name="{{ $headerName }}">
                             {{ $headerTitle }}
                         </div>
-                        <div class="text-center mx-1 cursor-pointer" data-name="{{ $headerName }}">
-                            @if(($headerName== $sortBy))
+                        <div class="text-center mx-1 @if($headerName !== 'actions') cursor-pointer @endif" data-name="{{ $headerName }}">
+                            @if($headerName !== 'actions' && ($headerName== $sortBy))
                                 @if($orderBy === 'asc')
                                     <i class="bi bi-arrow-down-square-fill text-primary"></i>
                                 @else
@@ -36,7 +36,7 @@
                                 @endif
                             @endif
                         </div>
-                        @if($headerName !== 'image')
+                        @if(($enableColumnFilters ?? true) && $headerName !== 'image' && $headerName !== 'actions')
                             @php
                                 $type = null;
                                 $data = (array_merge($filters, $ranges, $dates))[$headerName] ?? null;
@@ -178,6 +178,41 @@
                                     {{ $pricingCode->code }}
                                 </span>@if(!$loop->last)<br>@endif
                             @endforeach
+                        @elseif($id === 'pricing_codes' && $headerName === 'type')
+                            @if($string->type === 'tsn_number')
+                                <span class="badge bg-info">№ по ТСН</span>
+                            @else
+                                <span class="badge bg-primary">Шифр расценки</span>
+                            @endif
+                        @elseif($id === 'pricing_codes' && $headerName === 'description')
+                            <div class="d-flex justify-content-between align-items-center">
+                                <span class="description-text-{{ $string->id }}">{{ $string->description }}</span>
+                                <button type="button" class="btn btn-sm btn-link edit-description"
+                                        data-id="{{ $string->id }}"
+                                        data-description="{{ $string->description }}">
+                                    <i class="bi bi-pencil"></i>
+                                </button>
+                            </div>
+                            <form action="{{ route('pricing_codes.update', $string) }}" method="POST" class="edit-form-{{ $string->id }} is-hidden">
+                                @csrf
+                                @method('PUT')
+                                <div class="input-group input-group-sm">
+                                    <input type="text" name="description" class="form-control" value="{{ $string->description }}">
+                                    <button type="submit" class="btn btn-success">Сохранить</button>
+                                    <button type="button" class="btn btn-secondary cancel-edit" data-id="{{ $string->id }}">Отмена</button>
+                                </div>
+                            </form>
+                        @elseif($id === 'pricing_codes' && $headerName === 'actions')
+                            <form action="{{ route('pricing_codes.destroy', $string) }}" method="POST" class="d-inline js-confirm-submit"
+                                  data-confirm-message="Удалить код {{ $string->code }}?">
+                                @csrf
+                                @method('DELETE')
+                                <button type="submit" class="btn btn-sm btn-danger">Удалить</button>
+                            </form>
+                        @elseif($headerName === 'actions' && isset($routeName) && isset($string->id))
+                            <a href="{{ route($routeName, $string->id) }}" class="btn btn-sm btn-outline-primary">
+                                Редактировать
+                            </a>
                         @else
                             <p title="{!! $string->$headerName !!}">
                                 {!! \Illuminate\Support\Str::words($string->$headerName, config('app.words_in_table_cell_limit'), ' ...') !!}
@@ -543,11 +578,28 @@
             );
         });
 
-        $(document).ready(async function () {
-            let height1 = $('.das').innerHeight();
-            let height2 = $('.catalog').innerHeight();
-            let totalHeight = (Number(height1) || 0) + (Number(height2) || 0);
-            $(".table-responsive").css('maxHeight', $(window).height() - totalHeight - 50);
+        function updateMainTableScrollHeight() {
+            const tableScrollElement = document.querySelector('.js-main-table-scroll');
+            if (!tableScrollElement) {
+                return;
+            }
+
+            const tableTop = tableScrollElement.getBoundingClientRect().top;
+            const bottomGap = 16;
+            let paginationHeight = 0;
+
+            const paginationRow = document.querySelector('.pagination')?.closest('.row');
+            if (paginationRow) {
+                paginationHeight = paginationRow.getBoundingClientRect().height + 8;
+            }
+
+            const maxHeight = Math.max(180, window.innerHeight - tableTop - paginationHeight - bottomGap);
+            tableScrollElement.style.maxHeight = maxHeight + 'px';
+        }
+
+        $(document).ready(function () {
+            updateMainTableScrollHeight();
+            window.addEventListener('resize', updateMainTableScrollHeight);
 
             // Инициализация tooltips для полей tsn_number и pricing_code
             const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]');

+ 12 - 71
resources/views/pricing_codes/index.blade.php

@@ -43,78 +43,19 @@
                 </button>
             </div>
 
-            {{-- Поиск --}}
-            <form method="GET" action="{{ route('pricing_codes.index') }}" class="mb-3">
-                <div class="input-group">
-                    <input type="text" name="search" class="form-control" placeholder="Поиск по коду или расшифровке..." value="{{ $search ?? '' }}">
-                    <button type="submit" class="btn btn-outline-secondary">Найти</button>
-                    @if($search ?? false)
-                        <a href="{{ route('pricing_codes.index') }}" class="btn btn-outline-danger">Сбросить</a>
-                    @endif
-                </div>
-            </form>
-
-            {{-- Таблица --}}
             @if(isset($pricing_codes))
-                <div class="table-responsive">
-                    <table class="table table-striped table-hover">
-                        <thead>
-                            <tr>
-                                <th>ID</th>
-                                <th>Тип</th>
-                                <th>Код</th>
-                                <th>Расшифровка</th>
-                                <th>Действия</th>
-                            </tr>
-                        </thead>
-                        <tbody>
-                            @forelse($pricing_codes as $code)
-                                <tr>
-                                    <td>{{ $code->id }}</td>
-                                    <td>
-                                        @if($code->type === 'tsn_number')
-                                            <span class="badge bg-info">№ по ТСН</span>
-                                        @else
-                                            <span class="badge bg-primary">Шифр расценки</span>
-                                        @endif
-                                    </td>
-                                    <td><strong>{{ $code->code }}</strong></td>
-                                    <td>
-                                        <div class="d-flex justify-content-between align-items-center">
-                                            <span class="description-text-{{ $code->id }}">{{ $code->description }}</span>
-                                            <button type="button" class="btn btn-sm btn-link edit-description"
-                                                    data-id="{{ $code->id }}"
-                                                    data-description="{{ $code->description }}">
-                                                <i class="bi bi-pencil"></i>
-                                            </button>
-                                        </div>
-                                        <form action="{{ route('pricing_codes.update', $code) }}" method="POST" class="edit-form-{{ $code->id }} is-hidden">
-                                            @csrf
-                                            @method('PUT')
-                                            <div class="input-group input-group-sm">
-                                                <input type="text" name="description" class="form-control" value="{{ $code->description }}">
-                                                <button type="submit" class="btn btn-success">Сохранить</button>
-                                                <button type="button" class="btn btn-secondary cancel-edit" data-id="{{ $code->id }}">Отмена</button>
-                                            </div>
-                                        </form>
-                                    </td>
-                                    <td>
-                                        <form action="{{ route('pricing_codes.destroy', $code) }}" method="POST" class="d-inline js-confirm-submit"
-                                              data-confirm-message="Удалить код {{ $code->code }}?">
-                                            @csrf
-                                            @method('DELETE')
-                                            <button type="submit" class="btn btn-sm btn-danger">Удалить</button>
-                                        </form>
-                                    </td>
-                                </tr>
-                            @empty
-                                <tr>
-                                    <td colspan="5" class="text-center text-muted">Нет записей</td>
-                                </tr>
-                            @endforelse
-                        </tbody>
-                    </table>
-                </div>
+                @include('partials.table', [
+                    'id' => $id,
+                    'header' => $header,
+                    'strings' => $pricing_codes,
+                    'searchFields' => $searchFields,
+                    'sortBy' => $sortBy,
+                    'orderBy' => $orderBy,
+                    'filters' => [],
+                    'ranges' => [],
+                    'dates' => [],
+                    'enableColumnFilters' => false,
+                ])
 
                 {{ $pricing_codes->links() }}
             @endif

+ 1 - 1
resources/views/products_sku/index.blade.php

@@ -2,7 +2,7 @@
 
 @section('content')
 
-    <div class="row mb-3">
+    <div class="row mb-2">
         <div class="col-md-4">
             <h3>МАФ</h3>
         </div>

+ 1 - 1
resources/views/reclamations/index.blade.php

@@ -2,7 +2,7 @@
 
 @section('content')
 
-    <div class="row mb-3">
+    <div class="row mb-2">
         <div class="col-6">
             <h3>Рекламации</h3>
         </div>

+ 38 - 26
resources/views/reports/index.blade.php

@@ -16,7 +16,7 @@
 @endphp
 
 @section('content')
-    <div class="row mb-3">
+    <div class="row mb-2">
         <div class="col-md-4">
             <h3>Отчеты</h3>
         </div>
@@ -184,7 +184,7 @@
             </div>
             <div class="col-12 border-top my-3"></div>
             <div class="row">
-                <div class="col-12 overflow-x-scroll">
+                <div class="col-12 table-responsive js-subtable-scroll">
                     @include('reports.svod')
                 </div>
             </div>
@@ -247,36 +247,48 @@
                     <h4 class="text-success">
                         Общий свод по МАФ
                     </h4>
-                    <table class="table">
-                        <tr>
-                            <th>Артикул МАФ</th>
-                            <th>Кол-во</th>
-                        </tr>
-                        @foreach($reclamationMafs as $n => $val)
-                            <tr>
-                                <td>{{ $n }}</td>
-                                <td>{{ $val }}</td>
-                            </tr>
-                        @endforeach
-                    </table>
+                    <div class="table-responsive js-subtable-scroll">
+                        <table class="table">
+                            <thead>
+                                <tr>
+                                    <th>Артикул МАФ</th>
+                                    <th>Кол-во</th>
+                                </tr>
+                            </thead>
+                            <tbody>
+                                @foreach($reclamationMafs as $n => $val)
+                                    <tr>
+                                        <td>{{ $n }}</td>
+                                        <td>{{ $val }}</td>
+                                    </tr>
+                                @endforeach
+                            </tbody>
+                        </table>
+                    </div>
                 </div>
 
                 <div class="col-xl-6 p-3">
                     <h4 class="text-success">
                         Общий свод по деталям
                     </h4>
-                    <table class="table">
-                        <tr>
-                            <th>Деталь</th>
-                            <th>Кол-во</th>
-                        </tr>
-                        @foreach($reclamationDetails as $n => $val)
-                            <tr>
-                                <td>{{ $n }}</td>
-                                <td>{{ $val }}</td>
-                            </tr>
-                        @endforeach
-                    </table>
+                    <div class="table-responsive js-subtable-scroll">
+                        <table class="table">
+                            <thead>
+                                <tr>
+                                    <th>Деталь</th>
+                                    <th>Кол-во</th>
+                                </tr>
+                            </thead>
+                            <tbody>
+                                @foreach($reclamationDetails as $n => $val)
+                                    <tr>
+                                        <td>{{ $n }}</td>
+                                        <td>{{ $val }}</td>
+                                    </tr>
+                                @endforeach
+                            </tbody>
+                        </table>
+                    </div>
                 </div>
 
             </div>

+ 66 - 63
resources/views/reports/svod.blade.php

@@ -1,69 +1,72 @@
 <table class="table small svod">
-    <tr class="vertical">
-        <th>Округ</th>
-        <th>Сумма</th>
-        <th>Сдано на сумму</th>
-        <th colspan="2">Всего</th>
-        <th colspan="2">Готов к монтажу</th>
-        <th colspan="2">В монтаже</th>
-        <th colspan="2">Готов к сдаче</th>
-        <th colspan="2">Сдан</th>
-        <th colspan="2">Остаток</th>
-        <th colspan="2">Двор всего</th>
-        <th colspan="2">Двор установлено</th>
-        <th colspan="2">Двор остаток</th>
-        <th colspan="2">Школы всего</th>
-        <th colspan="2">Школы установлено</th>
-        <th colspan="2">Школы остаток</th>
-        <th colspan="2">Знаковые всего</th>
-        <th colspan="2">Знаковые установлено</th>
-        <th colspan="2">Знаковые остаток</th>
-    </tr>
-    <tr class="text-center">
-        <th></th>
-        <th></th>
-        <th></th>
-        <th>Адр</th>
-        <th>МАФ</th>
-        <th>Адр</th>
-        <th>МАФ</th>
-        <th>Адр</th>
-        <th>МАФ</th>
-        <th>Адр</th>
-        <th>МАФ</th>
-        <th>Адр</th>
-        <th>МАФ</th>
-        <th>Адр</th>
-        <th>МАФ</th>
-        <th>Адр</th>
-        <th>МАФ</th>
-        <th>Адр</th>
-        <th>МАФ</th>
-        <th>Адр</th>
-        <th>МАФ</th>
-        <th>Адр</th>
-        <th>МАФ</th>
-        <th>Адр</th>
-        <th>МАФ</th>
-        <th>Адр</th>
-        <th>МАФ</th>
-        <th>Адр</th>
-        <th>МАФ</th>
-        <th>Адр</th>
-        <th>МАФ</th>
-        <th>Адр</th>
-        <th>МАФ</th>
-    </tr>
-    @foreach($byDistrict as $vvv)
-        <tr>
-            @foreach($vvv as $v)
-                <td class="text-center svod-{{ $loop->iteration }}">{!! $v !!}</td>
-            @endforeach
+    <thead>
+        <tr class="vertical">
+            <th>Округ</th>
+            <th>Сумма</th>
+            <th>Сдано на сумму</th>
+            <th colspan="2">Всего</th>
+            <th colspan="2">Готов к монтажу</th>
+            <th colspan="2">В монтаже</th>
+            <th colspan="2">Готов к сдаче</th>
+            <th colspan="2">Сдан</th>
+            <th colspan="2">Остаток</th>
+            <th colspan="2">Двор всего</th>
+            <th colspan="2">Двор установлено</th>
+            <th colspan="2">Двор остаток</th>
+            <th colspan="2">Школы всего</th>
+            <th colspan="2">Школы установлено</th>
+            <th colspan="2">Школы остаток</th>
+            <th colspan="2">Знаковые всего</th>
+            <th colspan="2">Знаковые установлено</th>
+            <th colspan="2">Знаковые остаток</th>
         </tr>
-
-    @endforeach
+        <tr class="text-center">
+            <th></th>
+            <th></th>
+            <th></th>
+            <th>Адр</th>
+            <th>МАФ</th>
+            <th>Адр</th>
+            <th>МАФ</th>
+            <th>Адр</th>
+            <th>МАФ</th>
+            <th>Адр</th>
+            <th>МАФ</th>
+            <th>Адр</th>
+            <th>МАФ</th>
+            <th>Адр</th>
+            <th>МАФ</th>
+            <th>Адр</th>
+            <th>МАФ</th>
+            <th>Адр</th>
+            <th>МАФ</th>
+            <th>Адр</th>
+            <th>МАФ</th>
+            <th>Адр</th>
+            <th>МАФ</th>
+            <th>Адр</th>
+            <th>МАФ</th>
+            <th>Адр</th>
+            <th>МАФ</th>
+            <th>Адр</th>
+            <th>МАФ</th>
+            <th>Адр</th>
+            <th>МАФ</th>
+            <th>Адр</th>
+            <th>МАФ</th>
+        </tr>
+    </thead>
+    <tbody>
+        @foreach($byDistrict as $vvv)
+            <tr>
+                @foreach($vvv as $v)
+                    <td class="text-center svod-{{ $loop->iteration }}">{!! $v !!}</td>
+                @endforeach
+            </tr>
+        @endforeach
+    </tbody>
 </table>
 
 
 
-{{--@dump($byDistrict)--}}
+{{--@dump($byDistrict)--}}

+ 1 - 1
resources/views/responsibles/index.blade.php

@@ -2,7 +2,7 @@
 
 @section('content')
 
-    <div class="row mb-3">
+    <div class="row mb-2">
         <div class="col-6">
             <h3>Ответственные</h3>
         </div>

+ 3 - 3
resources/views/schedule/index.blade.php

@@ -2,7 +2,7 @@
 
 @section('content')
     <div class="p-0 m-0">
-        <div class="row mb-3 align-items-center">
+        <div class="row mb-2 align-items-center">
             <div class="col-md-6">
                 <h3>График монтажей</h3>
             </div>
@@ -74,7 +74,7 @@
         @endif
 
         @if($activeTab === 'week')
-        <div class="table-responsive">
+        <div class="table-responsive js-subtable-scroll">
         <table class="table">
             <thead>
             <tr>
@@ -196,7 +196,7 @@
                 </div>
             </div>
 
-            <div class="table-responsive">
+            <div class="table-responsive js-subtable-scroll">
                 <table class="table table-bordered schedule-month">
                     <thead>
                     <tr>

+ 3 - 3
resources/views/spare_parts/index.blade.php

@@ -109,7 +109,7 @@
                     @endif
                 </h4>
                 @if(isset($open_shortages) && $open_shortages->count() > 0)
-                    <div class="table-responsive">
+                    <div class="table-responsive js-subtable-scroll">
                         <table class="table table-danger table-striped">
                             <thead>
                                 <tr>
@@ -171,7 +171,7 @@
                 {{-- Запчасти с критическим недостатком --}}
                 <h4 class="text-danger mt-4">Запчасти с дефицитами</h4>
                 @if(isset($critical_shortages) && $critical_shortages->count() > 0)
-                    <div class="table-responsive">
+                    <div class="table-responsive js-subtable-scroll">
                         <table class="table table-danger table-striped">
                             <thead>
                                 <tr>
@@ -224,7 +224,7 @@
 
                 <h4 class="text-warning mt-4"><i class="bi bi-exclamation-circle-fill"></i> Ниже минимального остатка</h4>
                 @if(isset($below_min_stock) && $below_min_stock->count() > 0)
-                    <div class="table-responsive">
+                    <div class="table-responsive js-subtable-scroll">
                         <table class="table table-warning table-striped">
                             <thead>
                                 <tr>

+ 1 - 1
resources/views/users/index.blade.php

@@ -1,7 +1,7 @@
 @extends('layouts.app')
 
 @section('content')
-    <div class="row mb-3">
+    <div class="row mb-2">
         <div class="col-6">
             <h3>Пользователи</h3>
         </div>