From 85bd044cd638590ecdaa3e3fbe2231c311b7fd4b Mon Sep 17 00:00:00 2001 From: coopops Date: Wed, 8 Jul 2026 20:46:34 +0000 Subject: [PATCH] =?UTF-8?q?fix(desktop):=20=D0=BF=D0=B5=D1=80=D0=B5=D0=B7?= =?UTF-8?q?=D0=B0=D0=B3=D1=80=D1=83=D0=B7=D0=BA=D0=B0=20=D1=81=D0=BF=D0=B8?= =?UTF-8?q?=D1=81=D0=BA=D0=B0=20=D0=9A=D0=A3=20=D0=BF=D1=80=D0=B8=20=D0=BF?= =?UTF-8?q?=D0=BE=D0=BA=D0=B0=D0=B7=D0=B5=20=D0=BE=D0=B2=D0=B5=D1=80=D0=BB?= =?UTF-8?q?=D0=B5=D1=8F=20=D0=B2=D1=8B=D0=B1=D0=BE=D1=80=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Оверлей выбора кооперативного участка теперь подгружает список при переходе в мажоритарный режим, показывает лоадер и блокирует «Продолжить» без выбора. Co-authored-by: Cursor --- .../SelectBranch/ui/SelectBranchOverlay.vue | 4 +++ .../src/processes/select-branch/index.ts | 31 +++++++++++++++++-- 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/components/desktop/src/features/Branch/SelectBranch/ui/SelectBranchOverlay.vue b/components/desktop/src/features/Branch/SelectBranch/ui/SelectBranchOverlay.vue index 7277cc7b48e..d5000699f0b 100644 --- a/components/desktop/src/features/Branch/SelectBranch/ui/SelectBranchOverlay.vue +++ b/components/desktop/src/features/Branch/SelectBranch/ui/SelectBranchOverlay.vue @@ -13,11 +13,14 @@ BaseDialog( div(v-if="step === 1") p.q-mt-lg | Кооператив перешёл на двухэтапную систему управления на основании общего собрания уполномоченных председателей кооперативных участков... + Loader(v-if="branchesLoading" text="Загружаем список кооперативных участков...") Form( + v-else :handler-submit="next" :is-submitting="isSubmitting" :showSubmit="!isLoading" :showCancel="false" + :disabled="!selectedBranch" :button-submit-txt="'Продолжить'" ) BranchSelector( @@ -53,6 +56,7 @@ BaseDialog( document, isSubmitting, isLoading, + branchesLoading, next, back, sign diff --git a/components/desktop/src/processes/select-branch/index.ts b/components/desktop/src/processes/select-branch/index.ts index 56dd4a02430..e90a79133c9 100644 --- a/components/desktop/src/processes/select-branch/index.ts +++ b/components/desktop/src/processes/select-branch/index.ts @@ -20,21 +20,45 @@ export function useSelectBranchProcess() { const system = useSystemStore() const session = useSessionStore() const branchStore = useBranchStore() - const { selectBranch } = useSelectBranch() + const { isVisible, selectBranch } = useSelectBranch() const branches = computed(() => branchStore.publicBranches) + const branchesLoading = ref(false) - // Вотчер на авторизацию + const loadBranches = async () => { + if (!session.isAuth || !system.info.coopname) return + + try { + branchesLoading.value = true + await branchStore.loadPublicBranches({ coopname: system.info.coopname }) + } catch (e: unknown) { + FailAlert(e) + } finally { + branchesLoading.value = false + } + } + + // Загрузка при входе watch( () => session.isAuth, (isAuth, wasAuth) => { if (isAuth && !wasAuth) { - branchStore.loadPublicBranches({ coopname: system.info.coopname }) + void loadBranches() } }, { immediate: true } ) + // Перезагрузка при переходе в мажоритарный режим или показе оверлея + watch( + [() => isVisible.value, () => system.info?.cooperator_account?.is_branched], + ([visible, branched]) => { + if (visible && branched && session.isAuth) { + void loadBranches() + } + } + ) + const next = async () => { isLoading.value = true document.value = await digitalDocument.generate({ @@ -80,6 +104,7 @@ export function useSelectBranchProcess() { document, isSubmitting, isLoading, + branchesLoading, next, back, sign,