From 203829c27c2e9debbca97722818aa2f41e5e2a5c Mon Sep 17 00:00:00 2001 From: marina Date: Mon, 23 Jun 2025 16:52:57 +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/web/js/autoplannogramma/autoplannogramma.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/erp24/web/js/autoplannogramma/autoplannogramma.js b/erp24/web/js/autoplannogramma/autoplannogramma.js index a0f3a1b2..e4caabaf 100644 --- a/erp24/web/js/autoplannogramma/autoplannogramma.js +++ b/erp24/web/js/autoplannogramma/autoplannogramma.js @@ -66,6 +66,12 @@ $('.subcategory .list-group-item').on('click', function (e) { const $row = $link.closest('tr'); const $nextRow = $row.next(); + const subcategoryLabel = $link.closest('td.subcategory-cell').find('span.subcategory-label').text(); + if (subcategoryLabel.includes('нет данных')) { + alert('Нет планограммы для выбранного периода'); + return; + } + if ($nextRow.hasClass('inserted-row')) { if ($nextRow.hasClass('d-none')) { $('tr.inserted-row').each(function () { @@ -107,11 +113,6 @@ $('.subcategory .list-group-item').on('click', function (e) { success: function (response) { $row.nextAll('tr.inserted-row').remove(); - if (!response || !Array.isArray(response) || response.length === 0) { - alert('Нет планограммы для выбранного периода'); - return; - } - const fragment = document.createDocumentFragment(); response.forEach(item => { -- 2.39.5