From: fomichev Date: Wed, 3 Jun 2026 09:34:10 +0000 (+0300) Subject: ERP-397: синхронизация is_active → visible и обновление UI без перезагрузки X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=0c4b9afd835c5de1e311ed52bdf9e35a5b0b9351;p=erp24_rep%2Fyii-erp24%2F.git ERP-397: синхронизация is_active → visible и обновление UI без перезагрузки - CityStoreManagementController: при сохранении is_active обновляет city_store.visible через CityStore::updateAll в той же транзакции - JS: после сохранения патчит STORES[si].isActive и сразу перерисовывает комбо-список, чтобы фильтр «Неактивен» отражал изменение без перезагрузки страницы Co-Authored-By: Claude Sonnet 4.6 --- 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('; ');