From fbc6645239a46fa94ea5d09271819d33511000d2 Mon Sep 17 00:00:00 2001 From: Veronika Tsygankova Date: Fri, 6 Nov 2026 16:47:08 +0300 Subject: [PATCH] =?UTF-8?q?[AURORA-1678]:=20=D0=A7=D0=B5=D0=BA-=D0=BB?= =?UTF-8?q?=D0=B8=D1=81=D1=82=20=D0=B4=D0=BE=D0=BA=D1=83=D0=BC=D0=B5=D0=BD?= =?UTF-8?q?=D1=82=D0=BE=D0=B2:?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - добавлен фильтр по документам - в запрос на загрузку добавлен параметр documents - Labeled вынесен в components/, убраны дубли в шахматке, таблице корректировок --- web/src/components/Labeled.tsx | 10 ++ web/src/services/api/consolidations.ts | 7 +- .../ChecklistDocumentsFilter.tsx | 49 +++++++++ .../ConsoleLegalEntities/ChecklistModal.tsx | 37 +++++-- .../ConsoleLegalEntities.tsx | 4 +- .../checklist_utils.test.ts | 103 +++++++++++++++++- .../ConsoleLegalEntities/checklist_utils.tsx | 81 ++++++++++++-- .../ConsolidationChessFormatTableFilter.tsx | 11 +- .../ConsolidationChessTableFilter.tsx | 26 ++--- .../CorrectionTable/CorrectionToolbar.tsx | 10 +- 10 files changed, 290 insertions(+), 48 deletions(-) create mode 100644 web/src/components/Labeled.tsx create mode 100644 web/src/widgets/ConsoleLegalEntities/ChecklistDocumentsFilter.tsx diff --git a/web/src/components/Labeled.tsx b/web/src/components/Labeled.tsx new file mode 100644 index 0000000..b1e198c --- /dev/null +++ b/web/src/components/Labeled.tsx @@ -0,0 +1,10 @@ +import { Space } from 'antd'; +import type { ReactNode } from 'react'; + +/** Поле с серой подписью сверху — для фильтров и настроек над таблицами (селекты отчётности, чек-листа). */ +export const Labeled = ({ label, children }: { label: string; children: ReactNode }) => ( + + {label} + {children} + +); diff --git a/web/src/services/api/consolidations.ts b/web/src/services/api/consolidations.ts index 003e2ba..97a968b 100644 --- a/web/src/services/api/consolidations.ts +++ b/web/src/services/api/consolidations.ts @@ -9,7 +9,12 @@ export const getConsolidations = (groupId: string, in_work_only: boolean) => api.get(`/company-groups/${groupId}/consolidations`, { in_work_only }); export const getVersionCard = (versionId: string) => api.get(`/consolidations/versions/${versionId}`); export const createConsolidation = (body: ConsolidationCreate) => api.post('/consolidations', body); -export const downloadChecklistCsv = (versionId: string) => apiFetchBlob(`/consolidations/versions/${versionId}/checklist?format=csv`); +/** CSV чек-листа; `documents` — отбор колонок (`BALANCE,INCOME,OSV:01`), не задан — вся матрица. */ +export const downloadChecklistCsv = (versionId: string, documents?: string) => { + const params = new URLSearchParams({ format: 'csv' }); + if (documents) params.set('documents', documents); + return apiFetchBlob(`/consolidations/versions/${versionId}/checklist?${params}`); +}; export const getChecklist = (versionId: string) => api.get(`/consolidations/versions/${versionId}/checklist`); /** «Взять в работу»: 201 — взята, 200 — уже ваша; чужая — 409 `LOCKED_BY_OTHER` (перехват — с `takeover_reason`). */ export const lockVersion = (versionId: string, reason?: string | null) => diff --git a/web/src/widgets/ConsoleLegalEntities/ChecklistDocumentsFilter.tsx b/web/src/widgets/ConsoleLegalEntities/ChecklistDocumentsFilter.tsx new file mode 100644 index 0000000..1893eec --- /dev/null +++ b/web/src/widgets/ConsoleLegalEntities/ChecklistDocumentsFilter.tsx @@ -0,0 +1,49 @@ +// Фильтр «Документы» окна чек-листа: селект как в отчётности (подпись сверху, underlined), в списке — чекбоксы. +import { Checkbox, Select } from 'antd'; +import { Labeled } from '../../components/Labeled'; +import { documentFilterLabel, toggleAllDocuments, toggleDocument } from './checklist_utils'; + +type Props = { + options: { key: string; title: string }[]; + value: string[]; + onChange: (next: string[]) => void; +}; + +const itemStyle: React.CSSProperties = { display: 'flex', padding: '5px 12px', borderRadius: 4, cursor: 'pointer' }; + +export function ChecklistDocumentsFilter({ options, value, onChange }: Props) { + const allKeys = options.map((o) => o.key); + const isAll = value.length === allKeys.length; + + return ( + + - + - - Знаков после запятой + - - - Период + + )} /> - + - - Дт + - + {companies?.length || debit?.length || credit?.length ? : null} ); diff --git a/web/src/widgets/CorrectionTable/CorrectionToolbar.tsx b/web/src/widgets/CorrectionTable/CorrectionToolbar.tsx index 80d6c72..15829e7 100644 --- a/web/src/widgets/CorrectionTable/CorrectionToolbar.tsx +++ b/web/src/widgets/CorrectionTable/CorrectionToolbar.tsx @@ -1,7 +1,8 @@ // Панель над таблицей: «Отображение», «Правило», «Тип записи», единицы и знаки, сброс фильтров, настройка, экспорт, весь экран. import { DownloadOutlined, FullscreenExitOutlined, FullscreenOutlined } from '@ant-design/icons'; -import { Button, Select, Space } from 'antd'; +import { Button, Select } from 'antd'; import { ColumnSettings } from '../../components/GenericTable/ColumnSettings'; +import { Labeled } from '../../components/Labeled'; import type { CorrectionRuleOut } from '../../types/corrections'; import { PRECISIONS, UNITS, type Unit } from '../ConsolidatedOsv/useNumberDisplay'; import { COLUMN_DEFS, type ColKey, type ColShape } from './columns'; @@ -31,13 +32,6 @@ const RECORD_TYPES: { value: RecordType; label: string }[] = [ { value: 'unallocated', label: 'Нераспределенные записи' }, ]; -const Labeled = ({ label, children }: { label: string; children: React.ReactNode }) => ( - - {label} - {children} - -); - export function CorrectionToolbar(p: Props) { const { filters, rules } = p;