From ea839231d221203f3a4570bb195e4fcc01fb5b86 Mon Sep 17 00:00:00 2001 From: marina Date: Mon, 23 Jun 2025 18:20:49 +0300 Subject: [PATCH] =?utf8?q?=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B0=20=D0=BE?= =?utf8?q?=D1=82=D0=BE=D0=B1=D1=80=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8=D1=8F=20?= =?utf8?q?=D0=B8=20=D1=81=D0=BA=D1=80=D1=8B=D1=82=D0=B8=D1=8F=20=D0=BF?= =?utf8?q?=D0=BE=D0=B4=D0=BA=D0=B0=D1=82=D0=B5=D0=B3=D0=BE=D1=80=D0=B8?= =?utf8?q?=D0=B9=20=D0=B8=20=D0=BA=D0=B0=D1=82=D0=B5=D0=B3=D0=BE=D1=80?= =?utf8?q?=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/views/auto-plannogramma/index.php | 2 +- .../js/autoplannogramma/autoplannogramma.js | 130 ++++++++++-------- 2 files changed, 72 insertions(+), 60 deletions(-) diff --git a/erp24/views/auto-plannogramma/index.php b/erp24/views/auto-plannogramma/index.php index a2460b40..9ee91af0 100644 --- a/erp24/views/auto-plannogramma/index.php +++ b/erp24/views/auto-plannogramma/index.php @@ -219,7 +219,7 @@ $this->registerJsFile('/js/autoplannogramma/autoplannogramma.js', ['position' => - + { const tr = $('').addClass('inserted-row'); - const subcategoryTd = $(` - - - ${item.name || ''} - - - `); + + + ${item.name || ''} + + + `); tr.append(subcategoryTd); const valuesMap = new Map(item.values?.map(val => [ @@ -141,7 +147,6 @@ $('.subcategory .list-group-item').on('click', function (e) { $('table thead th').each(function (index) { const $th = $(this); const storeId = $th.data('store-id'); - if (storeId === undefined) return; const isVisible = $(`table tbody tr:first td:eq(${index})`).is(':visible'); @@ -152,28 +157,27 @@ $('.subcategory .list-group-item').on('click', function (e) { const encodedTooltip = $('
').text(tooltipTitle).html(); const td = $(` - -
- - -
- - `); - + +
+ + +
+ + `); tr.append(td); }); @@ -181,10 +185,7 @@ $('.subcategory .list-group-item').on('click', function (e) { }); $row.after(fragment); - - $('[data-bs-toggle="tooltip"]').tooltip({ - customClass: 'custom-tooltip' - }); + $('[data-bs-toggle="tooltip"]').tooltip({customClass: 'custom-tooltip'}); }, error: function (xhr) { alert('Ошибка: ' + (xhr.responseText || 'Неизвестная ошибка сервера')); @@ -203,13 +204,24 @@ $('.category .list-group-item').on('click', function () { $('.loader-overlay').removeClass('d-none'); + $('tr.subcategory-row').each(function () { + const $span = $(this).find('.list-group-item[data-category][data-subcategory]').first(); + const rowCategory = $span.data('category'); + + if (rowCategory === category) { + $(this).removeClass('d-none'); + } else { + $(this).addClass('d-none'); + } + }); + $.get('/auto-plannogramma/get-subcategories', {category, year, week}, function (subcategories) { const subMap = {}; subcategories.forEach(sub => { subMap[sub.name] = sub.hasdata; }); - $(`span.list-group-item[data-category="${category}"]`).each(function () { + $(`.subcategory-cell span.list-group-item[data-category="${category}"]`).each(function () { const $span = $(this); const subName = $span.data('subcategory'); -- 2.39.5