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 () {
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 => {