From ffa73e594e2a324833615c45f2a7bb7bd76cc2a2 Mon Sep 17 00:00:00 2001 From: marina Date: Tue, 17 Jun 2025 13:16:42 +0300 Subject: [PATCH] =?utf8?q?ERP-360=20=D0=A1=D0=B1=D0=BE=D1=80=D0=BA=D0=B0?= =?utf8?q?=20=D1=81=D1=82=D1=80=D0=B0=D0=BD=D0=B8=D1=86=D1=8B=20=D0=B0?= =?utf8?q?=D0=B2=D1=82=D0=BE=D0=BF=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/controllers/AutoPlannogrammaController.php | 2 +- erp24/web/js/autoplannogramma/autoplannogramma.js | 15 ++++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/erp24/controllers/AutoPlannogrammaController.php b/erp24/controllers/AutoPlannogrammaController.php index b5b77530..061ea2f9 100644 --- a/erp24/controllers/AutoPlannogrammaController.php +++ b/erp24/controllers/AutoPlannogrammaController.php @@ -151,7 +151,7 @@ class AutoPlannogrammaController extends BaseController } $forecast = (new AutoPlannogrammaService())->getWeeklyBouquetProductsForecast($filters['month'], $filters['year'], null, $filters['week']); - + foreach ($result as &$productData) { foreach ($productData['values'] as &$value) { $storeId = $value['store_id']; diff --git a/erp24/web/js/autoplannogramma/autoplannogramma.js b/erp24/web/js/autoplannogramma/autoplannogramma.js index ecfc2003..5b1b0b61 100644 --- a/erp24/web/js/autoplannogramma/autoplannogramma.js +++ b/erp24/web/js/autoplannogramma/autoplannogramma.js @@ -166,13 +166,14 @@ $('.subcategory .list-group-item').on('click', function (e) { }); }); - $('.category .list-group-item').on('click', function () { const $categorySpan = $(this); const category = $categorySpan.text().trim(); const year = $('#year').val(); const week = $('#week').val(); - $('.loader-overlay').removeClass('d-none'); + + $('.loader-overlay').removeClass('d-none'); + $.get('/auto-plannogramma/get-subcategories', {category, year, week}, function (subcategories) { const subMap = {}; subcategories.forEach(sub => { @@ -193,10 +194,14 @@ $('.category .list-group-item').on('click', function () { $span.text(`${subName} (нет данных)`); } }); - }); - $('.loader-overlay').addClass('d-none'); -}); + $('.loader-overlay').addClass('d-none'); + }) + .fail(() => { + alert('Ошибка при загрузке подкатегорий'); + $('.loader-overlay').addClass('d-none'); + }); +}); $('#autoplannogramma').on('input', '.input', function () { $(this).closest('td').find('path').attr('fill', 'red'); -- 2.39.5