aurora-(1636, 1693): обновление справочника гк и юл и исправлена фильтрация юл без гк #201
@ -13,7 +13,7 @@ export async function fetchCompanyGroups(params: GetCompanyGroupsPropsI): Promis
|
||||
const page = await api.get<Page<ICompanyGroupOut>>('/directories/company-groups', {
|
||||
limit: CG_PAGE,
|
||||
offset: offset,
|
||||
...params,
|
||||
...params,
|
||||
});
|
||||
all.push(...page.items);
|
||||
if (all.length >= page.total || page.items.length === 0) {
|
||||
|
||||
@ -21,7 +21,7 @@ export interface ICatalogueJur {
|
||||
name: string;
|
||||
is_head_office: boolean;
|
||||
};
|
||||
regional_name?:string;
|
||||
regional_name?: string;
|
||||
}
|
||||
|
||||
export type KindType = 'gsk' | 'gsz';
|
||||
|
||||
@ -6,7 +6,7 @@ export interface ICompanyGroupOut {
|
||||
base_regional_office_id: string | null;
|
||||
base_regional_office: { id: string; name: string; is_head_office: boolean } | null;
|
||||
legal_entities_count: number;
|
||||
is_archived:boolean;
|
||||
is_archived: boolean;
|
||||
}
|
||||
|
||||
/** Строка таблицы ГК: имя филиала плоским полем — по нему работают поиск и фильтры GenericTable. */
|
||||
|
||||
@ -17,7 +17,7 @@ export const ArchiveCompanyGroupModal: React.FC<Props> = ({ open, onCancel, onOk
|
||||
onOk={onOk}
|
||||
okText='Подтвердить'
|
||||
cancelText='Отмена'
|
||||
okButtonProps={isArchived ? undefined : { danger: true }}
|
||||
okButtonProps={isArchived ? undefined : { danger: true }}
|
||||
confirmLoading={loading}
|
||||
centered>
|
||||
<p style={{ margin: 0, color: '#595959' }}>Группа компании будет {isArchived ? 'разархивированна' : 'архивированна'}</p>
|
||||
|
||||
@ -55,7 +55,7 @@ export function CatalogueJurTable({ outside_group, tabsComponent }: CatalogueJur
|
||||
const isGettingArchiveCompany = useAppSelector((state) => state.company_groups.isGettingArchive);
|
||||
|
||||
const filterdData = useMemo(() => {
|
||||
let newData = rawRows
|
||||
let newData = rawRows;
|
||||
if (relatedGroupFilter?.id && !outside_group) {
|
||||
newData = rawRows?.filter((row) => {
|
||||
return row?.memberships?.some((member) => member.related_group_id === relatedGroupFilter.id);
|
||||
@ -69,7 +69,7 @@ export function CatalogueJurTable({ outside_group, tabsComponent }: CatalogueJur
|
||||
useTableFilters<ICatalogueJur>();
|
||||
// single filtered array — title count and table share it
|
||||
const { rows } = useFilteredRows(filterdData, catalogueJurConfig, rawQuery, columnFilters, sort);
|
||||
|
||||
|
||||
function getCatalogueJur() {
|
||||
dispatch(
|
||||
getCatalogueJurThunk({
|
||||
|
||||
@ -31,7 +31,7 @@ export const CompanyGroupsList = () => {
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
dispatch(getCompanyGroupsThunk({is_archived:isGettingArchiveCompany}));
|
||||
dispatch(getCompanyGroupsThunk({ is_archived: isGettingArchiveCompany }));
|
||||
}, [dispatch, isGettingArchiveCompany]);
|
||||
|
||||
useEffect(() => {
|
||||
@ -66,7 +66,7 @@ export const CompanyGroupsList = () => {
|
||||
value={query}
|
||||
onChange={(e) => setQuery(e.target.value)}
|
||||
/>
|
||||
<Checkbox checked={isGettingArchiveCompany} onChange={(e) =>dispatch(setIsGettingArchive(e.target.checked))}>
|
||||
<Checkbox checked={isGettingArchiveCompany} onChange={(e) => dispatch(setIsGettingArchive(e.target.checked))}>
|
||||
Архив
|
||||
</Checkbox>
|
||||
</Space>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user