From 0c4b9afd835c5de1e311ed52bdf9e35a5b0b9351 Mon Sep 17 00:00:00 2001 From: fomichev Date: Wed, 3 Jun 2026 12:34:10 +0300 Subject: [PATCH] =?utf8?q?ERP-397:=20=D1=81=D0=B8=D0=BD=D1=85=D1=80=D0=BE?= =?utf8?q?=D0=BD=D0=B8=D0=B7=D0=B0=D1=86=D0=B8=D1=8F=20is=5Factive=20?= =?utf8?q?=E2=86=92=20visible=20=D0=B8=20=D0=BE=D0=B1=D0=BD=D0=BE=D0=B2?= =?utf8?q?=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20UI=20=D0=B1=D0=B5=D0=B7=20?= =?utf8?q?=D0=BF=D0=B5=D1=80=D0=B5=D0=B7=D0=B0=D0=B3=D1=80=D1=83=D0=B7?= =?utf8?q?=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit - CityStoreManagementController: при сохранении is_active обновляет city_store.visible через CityStore::updateAll в той же транзакции - JS: после сохранения патчит STORES[si].isActive и сразу перерисовывает комбо-список, чтобы фильтр «Неактивен» отражал изменение без перезагрузки страницы Co-Authored-By: Claude Sonnet 4.6 --- erp24/controllers/CityStoreManagementController.php | 4 ++++ erp24/web/js/city-store-management/city-store-management.js | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/erp24/controllers/CityStoreManagementController.php b/erp24/controllers/CityStoreManagementController.php index c8db7fa1..e4b0e817 100644 --- a/erp24/controllers/CityStoreManagementController.php +++ b/erp24/controllers/CityStoreManagementController.php @@ -285,6 +285,10 @@ class CityStoreManagementController extends Controller $isActiveNow = (bool)$params->is_active; if ($isNew || $isActiveBefore !== $isActiveNow) { $this->recordStoreDynamic($storeId, StoreDynamic::CATEGORY_IS_ACTIVE, (int)$isActiveNow); + CityStore::updateAll( + ['visible' => $isActiveNow ? CityStore::IS_VISIBLE : 0], + ['id' => $storeId] + ); } if (!empty($post['bush_chef_florist'])) { diff --git a/erp24/web/js/city-store-management/city-store-management.js b/erp24/web/js/city-store-management/city-store-management.js index bb8bc87e..6d4db81b 100644 --- a/erp24/web/js/city-store-management/city-store-management.js +++ b/erp24/web/js/city-store-management/city-store-management.js @@ -543,6 +543,12 @@ function saveChanges() { if (allOk) { toast('Сохранено', 'ok'); clearDirty(); + var si = STORES.findIndex(function (s) { return s.id === D.id; }); + if (si !== -1) { + STORES[si].isActive = !!csParams.is_active; + STORES[si].name = csStore.name || STORES[si].name; + } + renderComboList(document.getElementById('storeSearchInput').value || ''); loadStore(D.id); } else { var errs = results.filter(function (r) { return r && !r.success; }).map(function (r) { return r.message; }).join('; '); -- 2.39.5