aurora-1868, исправление расхождения с макетом #210
@ -6,25 +6,7 @@
|
||||
border-radius: 999px !important;
|
||||
}
|
||||
|
||||
/* кастомные стили для модального окна */
|
||||
.ant-modal-container {
|
||||
padding: 0 !important;
|
||||
}
|
||||
.ant-modal-header,
|
||||
.ant-modal-body{
|
||||
padding: 16px !important;
|
||||
}
|
||||
.ant-modal-footer {
|
||||
padding: 0 16 16 16 !important;
|
||||
}
|
||||
.ant-modal-header {
|
||||
border-bottom: 1px solid #f0f0f0 !important;
|
||||
}
|
||||
|
||||
.ant-modal-close {
|
||||
padding: 4px !important;
|
||||
}
|
||||
/* */
|
||||
|
||||
/* стили кастомного сегмента */
|
||||
.customSegment .ant-segmented-item {
|
||||
|
||||
19
web/src/components/AppModal/AppModal.css
Normal file
19
web/src/components/AppModal/AppModal.css
Normal file
@ -0,0 +1,19 @@
|
||||
/* кастомные стили для модального окна */
|
||||
.appModal .ant-modal-container {
|
||||
padding: 0 !important;
|
||||
}
|
||||
.appModal .ant-modal-header,
|
||||
.appModal .ant-modal-body{
|
||||
padding: 16px !important;
|
||||
}
|
||||
.appModal .ant-modal-footer {
|
||||
padding: 0px 16px 16px 16px !important;
|
||||
}
|
||||
.appModal .ant-modal-header {
|
||||
border-bottom: 1px solid #f0f0f0 !important;
|
||||
}
|
||||
|
||||
.appModal .ant-modal-close {
|
||||
padding: 4px !important;
|
||||
}
|
||||
/* */
|
||||
18
web/src/components/AppModal/AppModal.tsx
Normal file
18
web/src/components/AppModal/AppModal.tsx
Normal file
@ -0,0 +1,18 @@
|
||||
import { Modal } from 'antd';
|
||||
import type { ModalProps } from 'antd';
|
||||
import CustomModalCloseIcon from '../CustomModalCloseIcon';
|
||||
import './AppModal.css'
|
||||
export type AppModalProps = ModalProps ;
|
||||
|
||||
export function AppModal({ children, ...props }: AppModalProps) {
|
||||
return (
|
||||
<Modal
|
||||
className='appModal'
|
||||
centered={true}
|
||||
closeIcon={<CustomModalCloseIcon />}
|
||||
{...props}
|
||||
>
|
||||
{children}
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
@ -55,7 +55,7 @@ export function DataTable<T extends Record<string, any>>({
|
||||
const opts: FilterOption[] = [];
|
||||
for (const r of allRows) {
|
||||
const v = r[key];
|
||||
if (!seen.has(v) && v) {
|
||||
if (!seen.has(v) && (v !== null && v !== undefined)) {
|
||||
seen.add(v);
|
||||
opts.push({ label: String(v), value: v });
|
||||
}
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import { Form, Input, Modal, Select } from 'antd';
|
||||
import { Form, Input, Select } from 'antd';
|
||||
import { useRef, useState } from 'react';
|
||||
import { ApiError, api } from '../../api/client';
|
||||
import type { AdminUser, BusinessSegment, RegionalOffice, Role, UserCreate } from '../../api/types';
|
||||
import CustomModalCloseIcon from '../../components/CustomModalCloseIcon';
|
||||
import { useMountedRef, useNotifyError } from './hooks';
|
||||
import { AppModal } from '../../components/AppModal/AppModal';
|
||||
|
||||
type Props = {
|
||||
open: boolean;
|
||||
@ -88,7 +88,7 @@ export function CreateUserModal({ open, roles, offices, onClose, onCreated }: Pr
|
||||
};
|
||||
|
||||
return (
|
||||
<Modal
|
||||
<AppModal
|
||||
title='Новый пользователь'
|
||||
open={open}
|
||||
okText='Создать'
|
||||
@ -98,9 +98,6 @@ export function CreateUserModal({ open, roles, offices, onClose, onCreated }: Pr
|
||||
confirmLoading={submitting}
|
||||
cancelButtonProps={{ disabled: submitting }}
|
||||
mask={{ closable: !submitting }}
|
||||
centered
|
||||
// форма смонтирована всегда (forceRender), поэтому её можно очистить после закрытия окна
|
||||
closeIcon={<CustomModalCloseIcon />}
|
||||
forceRender
|
||||
afterClose={() => form.resetFields()}>
|
||||
<Form<FormValues> form={form} layout='vertical' onFinish={submit} disabled={submitting}>
|
||||
@ -139,6 +136,6 @@ export function CreateUserModal({ open, roles, offices, onClose, onCreated }: Pr
|
||||
/>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</Modal>
|
||||
</AppModal>
|
||||
);
|
||||
}
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
import { Modal } from 'antd';
|
||||
import CustomModalCloseIcon from '../../../components/CustomModalCloseIcon';
|
||||
import { AppModal } from '../../../components/AppModal/AppModal';
|
||||
|
||||
type Props = {
|
||||
open: boolean;
|
||||
@ -11,7 +10,7 @@ type Props = {
|
||||
|
||||
export const ArchiveCompanyGroupModal: React.FC<Props> = ({ open, onCancel, onOk, loading, isArchived }) => {
|
||||
return (
|
||||
<Modal
|
||||
<AppModal
|
||||
title={isArchived ? 'Разархивировать ГК' : 'Архивировать ГК'}
|
||||
open={open}
|
||||
onCancel={onCancel}
|
||||
@ -20,11 +19,10 @@ export const ArchiveCompanyGroupModal: React.FC<Props> = ({ open, onCancel, onOk
|
||||
cancelText='Отмена'
|
||||
okButtonProps={isArchived ? undefined : { danger: true }}
|
||||
confirmLoading={loading}
|
||||
centered
|
||||
closeIcon={<CustomModalCloseIcon />}>
|
||||
>
|
||||
<p style={{ margin: 0, color: '#595959' }}>
|
||||
{isArchived ? 'Группа компаний вернётся из архива в список действующих.' : 'Группа компаний будет перенесена в архив.'}
|
||||
</p>
|
||||
</Modal>
|
||||
</AppModal>
|
||||
);
|
||||
};
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
import { Col, Form, Input, Modal, Row, Select } from 'antd';
|
||||
import { Col, Form, Input, Row, Select } from 'antd';
|
||||
import type React from 'react';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { ApiError } from '../../../api/client';
|
||||
import { useMe } from '../../../auth/useMe';
|
||||
import CustomModalCloseIcon from '../../../components/CustomModalCloseIcon';
|
||||
import { fetchOneCompanyGroup } from '../../../services/api/directories/company_groups';
|
||||
import type { CompanyGroupFormProps } from '../../../types/companyGroups/companyGroups';
|
||||
import { useNotificationApi } from '../../../utils/useNotification';
|
||||
import { loadOffices } from '../../Admin/UsersTable';
|
||||
import { AppModal } from '../../../components/AppModal/AppModal';
|
||||
|
||||
type Props = {
|
||||
open: boolean;
|
||||
@ -100,7 +100,7 @@ export const CompanyGroupForm: React.FC<Props> = ({ open, onCancel, onOk, compan
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<Modal
|
||||
<AppModal
|
||||
title={companyGroupId ? 'Изменить группу компаний' : 'Создать группу компаний'}
|
||||
open={open}
|
||||
onCancel={handleCancel}
|
||||
@ -110,9 +110,7 @@ export const CompanyGroupForm: React.FC<Props> = ({ open, onCancel, onOk, compan
|
||||
destroyOnHidden
|
||||
loading={initialDataLoading}
|
||||
confirmLoading={confirmLoading}
|
||||
width={720}
|
||||
centered
|
||||
closeIcon={<CustomModalCloseIcon />}>
|
||||
width={720}>
|
||||
<Form form={form} layout='vertical'>
|
||||
<Form.Item name='name' label='Название ГК' rules={[{ required: true, message: 'Укажите название ГК' }]}>
|
||||
<Input placeholder='Например: Агроком' />
|
||||
@ -139,6 +137,6 @@ export const CompanyGroupForm: React.FC<Props> = ({ open, onCancel, onOk, compan
|
||||
</Col>
|
||||
</Row>
|
||||
</Form>
|
||||
</Modal>
|
||||
</AppModal>
|
||||
);
|
||||
};
|
||||
|
||||
@ -1,8 +1,7 @@
|
||||
import { Col, Form, Input, Modal, Row, Select } from 'antd';
|
||||
import { Col, Form, Input, Row, Select } from 'antd';
|
||||
import type React from 'react';
|
||||
import { useEffect, useMemo, useState } from 'react';
|
||||
import { ApiError } from '../../../api/client';
|
||||
import CustomModalCloseIcon from '../../../components/CustomModalCloseIcon';
|
||||
import { fetchOneCatalogueJur } from '../../../services/api/directories/catalogue_jur';
|
||||
import { fetchRelatedGroups } from '../../../services/api/directories/company_groups';
|
||||
import { useAppSelector } from '../../../store/store';
|
||||
@ -10,6 +9,7 @@ import type { RelatedGroupOut } from '../../../types/api';
|
||||
import type { CatalogueJurFormProps } from '../../../types/catalogueJur/catalogueJur';
|
||||
import { useNotificationApi } from '../../../utils/useNotification';
|
||||
import { loadOffices } from '../../Admin/UsersTable';
|
||||
import { AppModal } from '../../../components/AppModal/AppModal';
|
||||
|
||||
type Props = {
|
||||
open: boolean;
|
||||
@ -154,7 +154,7 @@ export const CatalogueJurForm: React.FC<Props> = ({ open, onCancel, onOk, jurId
|
||||
}, [jurId, open]);
|
||||
|
||||
return (
|
||||
<Modal
|
||||
<AppModal
|
||||
title={jurId ? 'Изменить юридическое лицо' : 'Добавить юридическое лицо'}
|
||||
open={open}
|
||||
onCancel={handleCancel}
|
||||
@ -164,9 +164,7 @@ export const CatalogueJurForm: React.FC<Props> = ({ open, onCancel, onOk, jurId
|
||||
destroyOnHidden
|
||||
width={720}
|
||||
confirmLoading={confirmLoading}
|
||||
loading={initialDataLoading}
|
||||
centered
|
||||
closeIcon={<CustomModalCloseIcon />}>
|
||||
loading={initialDataLoading}>
|
||||
<Form form={form} layout='vertical'>
|
||||
<Row gutter={16}>
|
||||
<Col span={6}>
|
||||
@ -304,6 +302,6 @@ export const CatalogueJurForm: React.FC<Props> = ({ open, onCancel, onOk, jurId
|
||||
</Col>
|
||||
</Row>
|
||||
</Form>
|
||||
</Modal>
|
||||
</AppModal>
|
||||
);
|
||||
};
|
||||
|
||||
@ -1,15 +1,15 @@
|
||||
import { DatePicker, Form, Input, Modal, Select } from 'antd';
|
||||
import { DatePicker, Form, Input, Select } from 'antd';
|
||||
import FormItem from 'antd/es/form/FormItem';
|
||||
import dayjs from 'dayjs';
|
||||
import type React from 'react';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { ApiError } from '../../../api/client';
|
||||
import CustomModalCloseIcon from '../../../components/CustomModalCloseIcon';
|
||||
import { fetchOneCatalogueJur } from '../../../services/api/directories/catalogue_jur';
|
||||
import { getCompanyGroupsThunk } from '../../../store/slices/companyGroupsSlice/thunks';
|
||||
import { useAppDispatch, useAppSelector } from '../../../store/store';
|
||||
import type { MoveCatalogueJurProps } from '../../../types/catalogueJur/catalogueJur';
|
||||
import { useNotificationApi } from '../../../utils/useNotification';
|
||||
import { AppModal } from '../../../components/AppModal/AppModal';
|
||||
|
||||
type FormValues = {
|
||||
name: string;
|
||||
@ -86,7 +86,7 @@ export const MoveCatalogueJurForm: React.FC<Props> = ({ open, onCancel, onOk, ju
|
||||
}, [open]);
|
||||
|
||||
return (
|
||||
<Modal
|
||||
<AppModal
|
||||
title='Перевести ЮЛ в другую ГК'
|
||||
open={open}
|
||||
onCancel={handleCancel}
|
||||
@ -95,9 +95,7 @@ export const MoveCatalogueJurForm: React.FC<Props> = ({ open, onCancel, onOk, ju
|
||||
cancelText='Отмена'
|
||||
destroyOnHidden
|
||||
loading={initialDataLoading}
|
||||
confirmLoading={confirmLoading}
|
||||
centered
|
||||
closeIcon={<CustomModalCloseIcon />}>
|
||||
confirmLoading={confirmLoading}>
|
||||
<Form form={form} layout='vertical'>
|
||||
<FormItem name='name' label='ЮЛ'>
|
||||
<Input disabled />
|
||||
@ -130,6 +128,6 @@ export const MoveCatalogueJurForm: React.FC<Props> = ({ open, onCancel, onOk, ju
|
||||
<DatePicker minDate={dayjs()} style={{ width: '100%' }} format='DD.MM.YYYY' placeholder='ДД.ММ.ГГГГ' />
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</Modal>
|
||||
</AppModal>
|
||||
);
|
||||
};
|
||||
|
||||
@ -1,14 +1,14 @@
|
||||
import { DatePicker, Form, Input, Modal, Select } from 'antd';
|
||||
import { DatePicker, Form, Input, Select } from 'antd';
|
||||
import FormItem from 'antd/es/form/FormItem';
|
||||
import TextArea from 'antd/es/input/TextArea';
|
||||
import dayjs from 'dayjs';
|
||||
import type React from 'react';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { ApiError } from '../../../api/client';
|
||||
import CustomModalCloseIcon from '../../../components/CustomModalCloseIcon';
|
||||
import { fetchOneCatalogueJur } from '../../../services/api/directories/catalogue_jur';
|
||||
import type { WithdrawCatalogueJurProps } from '../../../types/catalogueJur/catalogueJur';
|
||||
import { useNotificationApi } from '../../../utils/useNotification';
|
||||
import { AppModal } from '../../../components/AppModal/AppModal';
|
||||
|
||||
interface FormValues extends WithdrawCatalogueJurProps {
|
||||
name: string;
|
||||
@ -78,7 +78,7 @@ export const WithdrawCatalogueJurForm: React.FC<Props> = ({ open, onCancel, onOk
|
||||
}, [open]);
|
||||
|
||||
return (
|
||||
<Modal
|
||||
<AppModal
|
||||
title='Вывести ЮЛ из состава ГК'
|
||||
open={open}
|
||||
onCancel={handleCancel}
|
||||
@ -88,9 +88,7 @@ export const WithdrawCatalogueJurForm: React.FC<Props> = ({ open, onCancel, onOk
|
||||
destroyOnHidden
|
||||
loading={initialDataLoading}
|
||||
confirmLoading={confirmLoading}
|
||||
okButtonProps={{ danger: true }}
|
||||
centered
|
||||
closeIcon={<CustomModalCloseIcon />}>
|
||||
okButtonProps={{ danger: true }}>
|
||||
<Form form={form} layout='vertical'>
|
||||
<FormItem name='name' label='ЮЛ'>
|
||||
<Input disabled />
|
||||
@ -113,6 +111,6 @@ export const WithdrawCatalogueJurForm: React.FC<Props> = ({ open, onCancel, onOk
|
||||
<TextArea rows={4} placeholder='Необязательно' />
|
||||
</FormItem>
|
||||
</Form>
|
||||
</Modal>
|
||||
</AppModal>
|
||||
);
|
||||
};
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
import { DownloadOutlined } from '@ant-design/icons';
|
||||
import { Modal, Table, message } from 'antd';
|
||||
import { Table, message } from 'antd';
|
||||
import { useEffect, useMemo, useState } from 'react';
|
||||
import { ApiError } from '../../api/client';
|
||||
import CustomModalCloseIcon from '../../components/CustomModalCloseIcon';
|
||||
import { getChecklist } from '../../services/api/consolidations';
|
||||
import type { ChecklistBackendShape, IVersionCard } from '../../types/consolidations/version_members';
|
||||
import { buildChecklistColumns, buildChecklistRows, getMarksItems } from './checklist_utils';
|
||||
import { AppModal } from '../../components/AppModal/AppModal';
|
||||
|
||||
type ChecklistProps = {
|
||||
open: boolean;
|
||||
@ -28,25 +28,23 @@ export default function ChecklistModal({ open, onDownload, consolidationData, on
|
||||
}, [open, consolidationData.id]);
|
||||
|
||||
return (
|
||||
<Modal
|
||||
<AppModal
|
||||
width='100%'
|
||||
open={open}
|
||||
cancelText='Отмена'
|
||||
onCancel={onClose}
|
||||
title='Чеклист'
|
||||
destroyOnHidden
|
||||
centered
|
||||
onOk={() => {
|
||||
onDownload();
|
||||
onClose();
|
||||
}}
|
||||
okText='Скачать чек-лист'
|
||||
closeIcon={<CustomModalCloseIcon />}
|
||||
okButtonProps={{ icon: <DownloadOutlined /> }}>
|
||||
<div style={{ display: 'flex', flexDirection: 'column', gap: '16px' }}>
|
||||
{getMarksItems()}
|
||||
<Table rowKey='key' columns={columns} dataSource={rows} pagination={false} />
|
||||
</div>
|
||||
</Modal>
|
||||
</AppModal>
|
||||
);
|
||||
}
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
import { Alert, Button, Input, Modal, Skeleton, message } from 'antd';
|
||||
import { Alert, Button, Input, Skeleton, message } from 'antd';
|
||||
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||
import { ApiError } from '../../api/client';
|
||||
import CustomModalCloseIcon from '../../components/CustomModalCloseIcon';
|
||||
import { useBeforeUnload } from '../../hooks/useBeforeUnload';
|
||||
import { getVersionCard, lockVersion } from '../../services/api/consolidations';
|
||||
import type { LockOut } from '../../types/consolidations/common_types';
|
||||
import { MAX_REASON_LENGTH, endSentence, isValidReason } from '../../utils/consolidations';
|
||||
import { quarterShortLabel } from '../../utils/labels';
|
||||
import { AppModal } from '../../components/AppModal/AppModal';
|
||||
|
||||
type LockModalProps = {
|
||||
versionId: string | null;
|
||||
@ -104,19 +104,17 @@ export default function LockModal({ versionId, open, onOpenChange, currentUserId
|
||||
};
|
||||
|
||||
return (
|
||||
<Modal
|
||||
<AppModal
|
||||
open={open}
|
||||
title='Взять консолидацию в работу?'
|
||||
onCancel={() => !submitting && close()}
|
||||
centered
|
||||
closable={!submitting}
|
||||
okText='Взять в работу'
|
||||
okButtonProps={{ disabled: loading || loadError || (hasToReason && !isValidReason(reason)) }}
|
||||
confirmLoading={submitting}
|
||||
cancelText='Отмена'
|
||||
onOk={handleOk}
|
||||
cancelButtonProps={{ disabled: submitting }}
|
||||
closeIcon={<CustomModalCloseIcon />}>
|
||||
cancelButtonProps={{ disabled: submitting }}>
|
||||
{loading && <Skeleton active paragraph={{ rows: 2 }} />}
|
||||
|
||||
{!loading && loadError && (
|
||||
@ -161,6 +159,6 @@ export default function LockModal({ versionId, open, onOpenChange, currentUserId
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</Modal>
|
||||
</AppModal>
|
||||
);
|
||||
}
|
||||
|
||||
@ -3,7 +3,6 @@ import { Button, Checkbox, Input, Modal, Table, message } from 'antd';
|
||||
import type { TableColumnsType } from 'antd';
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
import { ApiError } from '../../api/client';
|
||||
import CustomModalCloseIcon from '../../components/CustomModalCloseIcon';
|
||||
import { getVersionCard, lockVersion } from '../../services/api/consolidations';
|
||||
import { getCounterpartyCandidates, mapCounterparty } from '../../services/api/osv';
|
||||
import type { CandidateOut, CandidateScope, ConsolidatedRowOut, RefOut } from '../../types/api';
|
||||
@ -20,6 +19,7 @@ import {
|
||||
mapResultText,
|
||||
pairCandidateRows,
|
||||
} from './counterpartyMapping';
|
||||
import { AppModal } from '../../components/AppModal/AppModal';
|
||||
|
||||
const SEARCH_DELAY_MS = 300;
|
||||
|
||||
@ -225,13 +225,11 @@ export function CounterpartyMapModal({ versionId, row, onClose, onMapped, pairTa
|
||||
else if (tooShort) emptyText = `Для поиска по всему справочнику введите не меньше ${ALL_SCOPE_MIN_QUERY} символов`;
|
||||
const rows = pairOnly && pairTarget ? pairCandidateRows(candidates, pairTarget) : candidateRows(candidates);
|
||||
return (
|
||||
<Modal
|
||||
<AppModal
|
||||
open
|
||||
width={1040}
|
||||
footer={null}
|
||||
onCancel={onClose}
|
||||
centered
|
||||
closeIcon={<CustomModalCloseIcon />}
|
||||
title={
|
||||
<>
|
||||
Выбор организации для связи с <span style={{ color: TITLE_COLOR }}>{sourceName}</span>
|
||||
@ -276,6 +274,6 @@ export function CounterpartyMapModal({ versionId, row, onClose, onMapped, pairTa
|
||||
locale={{ emptyText }}
|
||||
/>
|
||||
</div>
|
||||
</Modal>
|
||||
</AppModal>
|
||||
);
|
||||
}
|
||||
|
||||
@ -1,8 +1,7 @@
|
||||
import { WarningOutlined } from '@ant-design/icons';
|
||||
import { Button, Modal, Segmented, Tooltip } from 'antd';
|
||||
import { Button, Segmented, Tooltip } from 'antd';
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
import { useLocation, useNavigate, useParams } from 'react-router-dom';
|
||||
import CustomModalCloseIcon from '../../components/CustomModalCloseIcon';
|
||||
import { getOsvSummary } from '../../services/api/osv';
|
||||
import type { CounterPairOut, OsvSummaryOut } from '../../types/api';
|
||||
import type { ConsStatus } from '../../types/consolidations/common_types';
|
||||
@ -14,6 +13,7 @@ import {
|
||||
resolveLeaveAfterFetch,
|
||||
} from '../../utils/consolidations';
|
||||
import { pairsViewSearch } from './counterPairs';
|
||||
import { AppModal } from '../../components/AppModal/AppModal';
|
||||
|
||||
const TAB_CONFIG = [
|
||||
{ key: 'osv', label: 'ОСВ' },
|
||||
@ -197,12 +197,10 @@ export function CounterPairsModal({
|
||||
}) {
|
||||
const { headline, details } = counterPairsWarning(pairs, unmappedTotal);
|
||||
return (
|
||||
<Modal
|
||||
<AppModal
|
||||
open={open}
|
||||
title='Проверьте встречные записи участников'
|
||||
centered
|
||||
onCancel={onStay}
|
||||
closeIcon={<CustomModalCloseIcon />}
|
||||
footer={[
|
||||
<Button key='show' onClick={onShow}>
|
||||
Показать пары
|
||||
@ -223,6 +221,6 @@ export function CounterPairsModal({
|
||||
<div style={{ color: '#667085' }}>{details}</div>
|
||||
</div>
|
||||
</div>
|
||||
</Modal>
|
||||
</AppModal>
|
||||
);
|
||||
}
|
||||
|
||||
@ -1,9 +1,8 @@
|
||||
import { ApartmentOutlined, BankOutlined, DeploymentUnitOutlined, TeamOutlined } from '@ant-design/icons';
|
||||
import { Modal } from 'antd';
|
||||
import type React from 'react';
|
||||
import type { CreateEntityKind } from '../../types/relatedGroup/relatedGroup';
|
||||
import './CreateEntityPickerModal.css';
|
||||
import CustomModalCloseIcon from '../../components/CustomModalCloseIcon';
|
||||
import { AppModal } from '../../components/AppModal/AppModal';
|
||||
type Option = {
|
||||
key: CreateEntityKind;
|
||||
title: string;
|
||||
@ -46,14 +45,12 @@ type Props = {
|
||||
|
||||
export const CreateEntityPickerModal: React.FC<Props> = ({ open, onCancel, onSelect }) => {
|
||||
return (
|
||||
<Modal
|
||||
<AppModal
|
||||
title='Выберите объект для добавления'
|
||||
open={open}
|
||||
onCancel={onCancel}
|
||||
footer={null}
|
||||
centered
|
||||
destroyOnHidden
|
||||
closeIcon={<CustomModalCloseIcon />}>
|
||||
destroyOnHidden>
|
||||
<div className='options'>
|
||||
{OPTIONS.map((opt) => (
|
||||
<button key={opt.key} type='button' className='optionCard' onClick={() => onSelect(opt.key)}>
|
||||
@ -65,6 +62,6 @@ export const CreateEntityPickerModal: React.FC<Props> = ({ open, onCancel, onSel
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</Modal>
|
||||
</AppModal>
|
||||
);
|
||||
};
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { Alert, Button, Input, Modal, Space, Tooltip, Typography } from 'antd';
|
||||
import { Alert, Button, Input, Space, Tooltip, Typography } from 'antd';
|
||||
import { useState } from 'react';
|
||||
import CustomModalCloseIcon from '../../components/CustomModalCloseIcon';
|
||||
import type { ChecksOut, FailedCheckOut } from '../../types/api';
|
||||
import { expectedActualText, failureKey, failureText } from './checkText';
|
||||
import { AppModal } from '../../components/AppModal/AppModal';
|
||||
|
||||
type Props = {
|
||||
checks: ChecksOut;
|
||||
@ -88,20 +88,18 @@ export function ChecksPanel({ checks, editable, dirty, onAccept, onShow }: Props
|
||||
</Button>
|
||||
</Tooltip>
|
||||
)}
|
||||
<Modal
|
||||
<AppModal
|
||||
open={open}
|
||||
title='Принять нарушения'
|
||||
okText='Принять'
|
||||
cancelText='Отмена'
|
||||
confirmLoading={saving}
|
||||
centered
|
||||
closeIcon={<CustomModalCloseIcon />}
|
||||
okButtonProps={{ disabled: comment.trim().length === 0 }}
|
||||
onOk={submit}
|
||||
onCancel={() => setOpen(false)}>
|
||||
<Typography.Paragraph>Комментарий обязателен (до 2000 символов).</Typography.Paragraph>
|
||||
<Input.TextArea rows={4} maxLength={2000} value={comment} onChange={(e) => setComment(e.target.value)} />
|
||||
</Modal>
|
||||
</AppModal>
|
||||
</Space>
|
||||
);
|
||||
}
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import { Button, Modal, Tooltip, Typography, message, theme } from 'antd';
|
||||
import { Button, Tooltip, Typography, message, theme } from 'antd';
|
||||
import { type ReactNode, useState } from 'react';
|
||||
import { ApiError } from '../../api/client';
|
||||
import CustomModalCloseIcon from '../../components/CustomModalCloseIcon';
|
||||
import { removeFile } from '../../services/api/files';
|
||||
import type { DocumentRow } from './documentRows';
|
||||
import { AppModal } from '../../components/AppModal/AppModal';
|
||||
|
||||
const { Text } = Typography;
|
||||
|
||||
@ -57,9 +57,7 @@ export default function DeleteReasonModal({ targetRow, open, onCancel, onDelete,
|
||||
}
|
||||
};
|
||||
return (
|
||||
<Modal
|
||||
closeIcon={<CustomModalCloseIcon />}
|
||||
centered
|
||||
<AppModal
|
||||
title='Удаление документа'
|
||||
open={open}
|
||||
onCancel={onCancel}
|
||||
@ -91,6 +89,6 @@ export default function DeleteReasonModal({ targetRow, open, onCancel, onDelete,
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</Modal>
|
||||
</AppModal>
|
||||
);
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { FileAddOutlined, UploadOutlined } from '@ant-design/icons';
|
||||
import { Button, Input, Modal, Upload } from 'antd';
|
||||
import { Button, Input, Upload } from 'antd';
|
||||
import { useEffect, useState } from 'react';
|
||||
import CustomModalCloseIcon from '../../components/CustomModalCloseIcon';
|
||||
import { AppModal } from '../../components/AppModal/AppModal';
|
||||
|
||||
const { Dragger } = Upload;
|
||||
|
||||
@ -27,7 +27,7 @@ export default function ReplaceDocModal({ open, docName, organizationName, submi
|
||||
}, [open]);
|
||||
|
||||
return (
|
||||
<Modal
|
||||
<AppModal
|
||||
title='Замена документа'
|
||||
open={open}
|
||||
onCancel={onCancel}
|
||||
@ -37,8 +37,6 @@ export default function ReplaceDocModal({ open, docName, organizationName, submi
|
||||
icon: <UploadOutlined />,
|
||||
disabled: file === null || reason.trim().length === 0,
|
||||
}}
|
||||
closeIcon={<CustomModalCloseIcon />}
|
||||
centered
|
||||
confirmLoading={submitting}>
|
||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 12 }}>
|
||||
{organizationName && <span>{organizationName}</span>}
|
||||
@ -75,6 +73,6 @@ export default function ReplaceDocModal({ open, docName, organizationName, submi
|
||||
<Button>Выбрать документ</Button>
|
||||
</Dragger>
|
||||
</div>
|
||||
</Modal>
|
||||
</AppModal>
|
||||
);
|
||||
}
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import { FileAddOutlined, UploadOutlined } from '@ant-design/icons';
|
||||
import { Alert, Button, Modal, Typography, Upload, message } from 'antd';
|
||||
import { Alert, Button, Typography, Upload, message } from 'antd';
|
||||
import type { UploadFile } from 'antd/es/upload/interface';
|
||||
import { useState } from 'react';
|
||||
import { ApiError } from '../../api/client';
|
||||
import CustomModalCloseIcon from '../../components/CustomModalCloseIcon';
|
||||
import { summarizeUpload, uploadFiles } from '../../services/api/files';
|
||||
import { AppModal } from '../../components/AppModal/AppModal';
|
||||
|
||||
type Props = {
|
||||
legalEntityId: string;
|
||||
@ -49,7 +49,7 @@ export function UploadDocumentsModal({ legalEntityId, consolidationId, organizat
|
||||
};
|
||||
|
||||
return (
|
||||
<Modal
|
||||
<AppModal
|
||||
open={open}
|
||||
title='Загрузка документов'
|
||||
onOk={handleOk}
|
||||
@ -60,8 +60,6 @@ export function UploadDocumentsModal({ legalEntityId, consolidationId, organizat
|
||||
disabled: !summary && fileList.length === 0,
|
||||
style: { background: summary || fileList.length > 0 ? '#237804' : undefined },
|
||||
}}
|
||||
closeIcon={<CustomModalCloseIcon />}
|
||||
centered
|
||||
cancelText='Отмена'
|
||||
confirmLoading={uploading}
|
||||
closable={!uploading}
|
||||
@ -118,6 +116,6 @@ export function UploadDocumentsModal({ legalEntityId, consolidationId, organizat
|
||||
</p>
|
||||
</Upload.Dragger>
|
||||
)}
|
||||
</Modal>
|
||||
</AppModal>
|
||||
);
|
||||
}
|
||||
|
||||
@ -1,9 +1,8 @@
|
||||
import { PlusOutlined } from '@ant-design/icons';
|
||||
import { Col, Form, Modal, Row, Select, message } from 'antd';
|
||||
import { Col, Form, Row, Select, message } from 'antd';
|
||||
import type React from 'react';
|
||||
import { useEffect, useMemo, useRef, useState } from 'react';
|
||||
import { ApiError } from '../../api/client';
|
||||
import CustomModalCloseIcon from '../../components/CustomModalCloseIcon';
|
||||
import { useBeforeUnload } from '../../hooks/useBeforeUnload';
|
||||
import { fetchAllLegalEntities, fetchRelatedGroup, fetchRelatedGroups } from '../../services/api/directories/company_groups';
|
||||
import { getCompanyGroupsThunk } from '../../store/slices/companyGroupsSlice/thunks';
|
||||
@ -12,6 +11,7 @@ import type { ConsolidationCreate, LegalEntityBrief, Quarter, RelatedGroupOut }
|
||||
import { MIN_PERIMETER } from '../../utils/consolidations';
|
||||
import { CompanyMultiSelect } from './CompanyOptionRow';
|
||||
import { membersFirst, preselectMembers } from './preselect';
|
||||
import { AppModal } from '../../components/AppModal/AppModal';
|
||||
|
||||
type Props = {
|
||||
open: boolean;
|
||||
@ -147,7 +147,7 @@ export const NewConsolidationModal: React.FC<Props> = ({ open, onCancel, onOk })
|
||||
};
|
||||
|
||||
return (
|
||||
<Modal
|
||||
<AppModal
|
||||
title='Новая консолидация'
|
||||
open={open}
|
||||
onCancel={handleCancel}
|
||||
@ -157,9 +157,7 @@ export const NewConsolidationModal: React.FC<Props> = ({ open, onCancel, onOk })
|
||||
cancelText='Отмена'
|
||||
confirmLoading={submitting}
|
||||
destroyOnHidden
|
||||
width={640}
|
||||
centered
|
||||
closeIcon={<CustomModalCloseIcon />}>
|
||||
width={640}>
|
||||
<Form form={form} requiredMark={false} layout='vertical' preserve={false} initialValues={{ legal_entity_ids: [] }}>
|
||||
<Row gutter={16}>
|
||||
<Col span={12}>
|
||||
@ -219,6 +217,6 @@ export const NewConsolidationModal: React.FC<Props> = ({ open, onCancel, onOk })
|
||||
)}
|
||||
</Row>
|
||||
</Form>
|
||||
</Modal>
|
||||
</AppModal>
|
||||
);
|
||||
};
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
import { Modal } from 'antd';
|
||||
import CustomModalCloseIcon from '../../../components/CustomModalCloseIcon';
|
||||
import { AppModal } from '../../../components/AppModal/AppModal';
|
||||
|
||||
type Props = {
|
||||
open: boolean;
|
||||
@ -11,7 +10,7 @@ type Props = {
|
||||
|
||||
export const DeleteRelatedGroupModal: React.FC<Props> = ({ open, onCancel, onOk, loading, kind }) => {
|
||||
return (
|
||||
<Modal
|
||||
<AppModal
|
||||
title='Удалить?'
|
||||
open={open}
|
||||
onCancel={onCancel}
|
||||
@ -19,10 +18,8 @@ export const DeleteRelatedGroupModal: React.FC<Props> = ({ open, onCancel, onOk,
|
||||
okText='Подтвердить'
|
||||
cancelText='Отмена'
|
||||
okButtonProps={{ danger: true }}
|
||||
confirmLoading={loading}
|
||||
closeIcon={<CustomModalCloseIcon />}
|
||||
centered>
|
||||
confirmLoading={loading}>
|
||||
<p style={{ margin: 0, color: '#595959' }}>Группа связанных {kind === 'gsk' ? 'компаний' : 'заёмщиков'} будет удалена.</p>
|
||||
</Modal>
|
||||
</AppModal>
|
||||
);
|
||||
};
|
||||
|
||||
@ -1,15 +1,15 @@
|
||||
import { DatePicker, Form, Input, Modal, Select } from 'antd';
|
||||
import { DatePicker, Form, Input, Select } from 'antd';
|
||||
import FormItem from 'antd/es/form/FormItem';
|
||||
import dayjs from 'dayjs';
|
||||
import type React from 'react';
|
||||
import { useEffect, useMemo, useState } from 'react';
|
||||
import { ApiError } from '../../../api/client';
|
||||
import CustomModalCloseIcon from '../../../components/CustomModalCloseIcon';
|
||||
import { fetchRelatedGroup } from '../../../services/api/directories/company_groups';
|
||||
import { getCompanyGroupsThunk } from '../../../store/slices/companyGroupsSlice/thunks';
|
||||
import { useAppDispatch, useAppSelector } from '../../../store/store';
|
||||
import type { RelatedGroupFormType } from '../../../types/relatedGroup/relatedGroup';
|
||||
import { useNotificationApi } from '../../../utils/useNotification';
|
||||
import { AppModal } from '../../../components/AppModal/AppModal';
|
||||
|
||||
type Props = {
|
||||
open: boolean;
|
||||
@ -100,7 +100,7 @@ export const RelatedGroupForm: React.FC<Props> = ({ open, onCancel, onOk, relate
|
||||
}, [open]);
|
||||
|
||||
return (
|
||||
<Modal
|
||||
<AppModal
|
||||
title={`${relatedGroupId ? 'Изменить' : 'Создать'} группу связанных ${kind === 'gsk' ? 'компаний' : 'заемщиков'}`}
|
||||
open={open}
|
||||
onCancel={handleCancel}
|
||||
@ -110,8 +110,7 @@ export const RelatedGroupForm: React.FC<Props> = ({ open, onCancel, onOk, relate
|
||||
destroyOnHidden
|
||||
loading={initialDataLoading}
|
||||
confirmLoading={confirmLoading}
|
||||
closeIcon={<CustomModalCloseIcon />}
|
||||
centered>
|
||||
>
|
||||
<Form form={form} layout='vertical'>
|
||||
<FormItem name='crm_id' label='ID в CRM'>
|
||||
<Input />
|
||||
@ -140,6 +139,6 @@ export const RelatedGroupForm: React.FC<Props> = ({ open, onCancel, onOk, relate
|
||||
<DatePicker style={{ width: '100%' }} format='DD.MM.YYYY' placeholder='ДД.ММ.ГГГГ' />
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</Modal>
|
||||
</AppModal>
|
||||
);
|
||||
};
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import { Form, Input, Modal, Select, message } from 'antd';
|
||||
import { Form, Input, Select, message } from 'antd';
|
||||
import { useState } from 'react';
|
||||
import { ApiError } from '../../api/client';
|
||||
import CustomModalCloseIcon from '../../components/CustomModalCloseIcon';
|
||||
import { TableTag } from '../../components/TableTag/TableTag';
|
||||
import { useBeforeUnload } from '../../hooks/useBeforeUnload';
|
||||
import { updateStatus } from '../../services/api/consolidations';
|
||||
@ -10,6 +9,7 @@ import type { ConsStatus } from '../../types/consolidations/common_types';
|
||||
import type { VersionCard } from '../../types/consolidations/version_members';
|
||||
import { CONS_STATUS_LABEL, MAX_REASON_LENGTH, canSubmitStatusChange, manualTransitions } from '../../utils/consolidations';
|
||||
import { statusColorMapping } from '../ConsoleTable/consts';
|
||||
import { AppModal } from '../../components/AppModal/AppModal';
|
||||
|
||||
type StatusModalProps = {
|
||||
open: boolean;
|
||||
@ -55,7 +55,7 @@ export default function ChangeStatusModal({ open, card, onClose, onSuccess }: St
|
||||
};
|
||||
|
||||
return (
|
||||
<Modal
|
||||
<AppModal
|
||||
open={open}
|
||||
title='Изменить статус'
|
||||
okText='Изменить статус'
|
||||
@ -64,9 +64,7 @@ export default function ChangeStatusModal({ open, card, onClose, onSuccess }: St
|
||||
confirmLoading={submitting}
|
||||
onOk={handleOk}
|
||||
onCancel={() => !submitting && onClose()}
|
||||
destroyOnHidden
|
||||
centered
|
||||
closeIcon={<CustomModalCloseIcon />}>
|
||||
destroyOnHidden>
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 8, marginBottom: 16 }}>
|
||||
<span style={{ color: '#667085' }}>Текущий этап</span>
|
||||
<TableTag text={currentLabel} {...statusColorMapping[currentLabel]} />
|
||||
@ -79,6 +77,6 @@ export default function ChangeStatusModal({ open, card, onClose, onSuccess }: St
|
||||
<Input.TextArea rows={3} maxLength={MAX_REASON_LENGTH} placeholder='Укажите комментарий к изменению статуса' />
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</Modal>
|
||||
</AppModal>
|
||||
);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user