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;