|
@@ -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 ">
|
|
<div class="table-buttons py-2 bg-primary rounded-start d-flex flex-column ">
|
|
@@ -18,17 +18,17 @@
|
|
|
</button>
|
|
</button>
|
|
|
</div>
|
|
</div>
|
|
|
<table class="table table-interactive table-initial-hidden" id="tbl" data-table-name="{{ $id }}">
|
|
<table class="table table-interactive table-initial-hidden" id="tbl" data-table-name="{{ $id }}">
|
|
|
- <thead>
|
|
|
|
|
|
|
+ <thead class="table-head-shadow">
|
|
|
<tr>
|
|
<tr>
|
|
|
@foreach($header as $headerName => $headerTitle)
|
|
@foreach($header as $headerName => $headerTitle)
|
|
|
<th scope="col" class="bg-primary-subtle column_{{ $headerName }}">
|
|
<th scope="col" class="bg-primary-subtle column_{{ $headerName }}">
|
|
|
<div class="d-flex align-items-center justify-content-between">
|
|
<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 }}
|
|
{{ $headerTitle }}
|
|
|
</div>
|
|
</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')
|
|
@if($orderBy === 'asc')
|
|
|
<i class="bi bi-arrow-down-square-fill text-primary"></i>
|
|
<i class="bi bi-arrow-down-square-fill text-primary"></i>
|
|
|
@else
|
|
@else
|
|
@@ -36,7 +36,7 @@
|
|
|
@endif
|
|
@endif
|
|
|
@endif
|
|
@endif
|
|
|
</div>
|
|
</div>
|
|
|
- @if($headerName !== 'image')
|
|
|
|
|
|
|
+ @if(($enableColumnFilters ?? true) && $headerName !== 'image' && $headerName !== 'actions')
|
|
|
@php
|
|
@php
|
|
|
$type = null;
|
|
$type = null;
|
|
|
$data = (array_merge($filters, $ranges, $dates))[$headerName] ?? null;
|
|
$data = (array_merge($filters, $ranges, $dates))[$headerName] ?? null;
|
|
@@ -178,6 +178,41 @@
|
|
|
{{ $pricingCode->code }}
|
|
{{ $pricingCode->code }}
|
|
|
</span>@if(!$loop->last)<br>@endif
|
|
</span>@if(!$loop->last)<br>@endif
|
|
|
@endforeach
|
|
@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
|
|
@else
|
|
|
<p title="{!! $string->$headerName !!}">
|
|
<p title="{!! $string->$headerName !!}">
|
|
|
{!! \Illuminate\Support\Str::words($string->$headerName, config('app.words_in_table_cell_limit'), ' ...') !!}
|
|
{!! \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
|
|
// Инициализация tooltips для полей tsn_number и pricing_code
|
|
|
const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]');
|
|
const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]');
|