diff --git a/.env b/.env index d630622..eb78342 100644 --- a/.env +++ b/.env @@ -8,5 +8,7 @@ USERS_SUPER=["akalinina","vchikalkin"] ####### URLS ######## URL_GET_USER_DIRECT= URL_CRM_GRAPHQL_DIRECT= +URL_CRM_CREATEKP_DIRECT= URL_CORE_FINGAP_DIRECT= +URL_CORE_CALCULATE_DIRECT= URL_1C_TRANSTAX_DIRECT= \ No newline at end of file diff --git a/apps/web/Components/Calculation/Settings/config.ts b/apps/web/Components/Calculation/Settings/config.ts index 8af3868..6684545 100644 --- a/apps/web/Components/Calculation/Settings/config.ts +++ b/apps/web/Components/Calculation/Settings/config.ts @@ -8,7 +8,12 @@ export const rows: FormTabRows = [ [['selectOpportunity'], defaultRowStyle], [['cbxRecalcWithRevision'], defaultRowStyle], [['selectQuote'], defaultRowStyle], - [['btnCalculate'], defaultRowStyle], + [ + ['btnCalculate', 'btnCreateKPMini'], + { + gridTemplateColumns: ['1fr 0.15fr'], + }, + ], { title: 'Параметры расчета' }, [['labelIrrInfo'], defaultRowStyle], diff --git a/apps/web/Components/Calculation/builders/build-action.tsx b/apps/web/Components/Calculation/builders/build-action.tsx index 37df9e1..5b165b3 100644 --- a/apps/web/Components/Calculation/builders/build-action.tsx +++ b/apps/web/Components/Calculation/builders/build-action.tsx @@ -1,4 +1,5 @@ import type { Elements } from '../config/map/actions'; +import { useProcessContext } from '@/process/hooks'; import { useStatus } from '@/stores/calculation/statuses/hooks'; import { observer } from 'mobx-react-lite'; import type { ComponentType } from 'react'; @@ -15,9 +16,12 @@ export default function buildAction( return observer((props: T) => { const status = useStatus(elementName); + const context = useProcessContext(); + return ( import(`process/${processName}/action`).then((module) => module.action())} + action={() => + import(`process/${processName}/action`).then((module) => module.action(context))} status={status} {...props} /> diff --git a/apps/web/Components/Calculation/config/elements-components.ts b/apps/web/Components/Calculation/config/elements-components.ts index b74ebc2..56d946a 100644 --- a/apps/web/Components/Calculation/config/elements-components.ts +++ b/apps/web/Components/Calculation/config/elements-components.ts @@ -142,6 +142,7 @@ const components = wrapComponentsMap({ /** Button Elements */ btnCreateKP: e.Button, + btnCreateKPMini: e.Button, btnCalculate: e.Button, /** Link Elements */ diff --git a/apps/web/Components/Calculation/config/elements-props.tsx b/apps/web/Components/Calculation/config/elements-props.tsx index 9c80f93..95c1a7c 100644 --- a/apps/web/Components/Calculation/config/elements-props.tsx +++ b/apps/web/Components/Calculation/config/elements-props.tsx @@ -5,7 +5,7 @@ import type { ElementsProps } from './elements-components'; import { MAX_FRANCHISE, MAX_LEASING_PERIOD } from '@/constants/values'; import dayjs from 'dayjs'; import { formatter, formatterExtra, parser } from 'tools/number'; -import { DownloadOutlined } from 'ui/elements/icons'; +import { DownloadOutlined, PlusOutlined } from 'ui/elements/icons'; const props: Partial = { tbxLeaseObjectPrice: { @@ -296,9 +296,21 @@ const props: Partial = { optionType: 'button', buttonStyle: 'solid', }, + btnCalculate: { + text: 'Рассчитать график', + type: 'primary', + block: true, + }, btnCreateKP: { type: 'primary', text: 'Создать КП', + icon: , + }, + btnCreateKPMini: { + text: '', + type: 'primary', + icon: , + block: true, }, tbxCreditRate: { min: 0, @@ -345,10 +357,6 @@ const props: Partial = { showSearch: true, optionFilterProp: 'label', }, - btnCalculate: { - text: 'Рассчитать график', - type: 'primary', - }, tbxIRR_Perc: { min: 0, max: 500, diff --git a/apps/web/Components/Calculation/config/elements-titles.ts b/apps/web/Components/Calculation/config/elements-titles.ts index c65b33a..ba37e87 100644 --- a/apps/web/Components/Calculation/config/elements-titles.ts +++ b/apps/web/Components/Calculation/config/elements-titles.ts @@ -143,6 +143,7 @@ const titles: Record = { /** Action Elements */ btnCalculate: '', btnCreateKP: '', + btnCreateKPMini: '', }; export default titles; diff --git a/apps/web/Components/Calculation/config/elements-types.ts b/apps/web/Components/Calculation/config/elements-types.ts index fe954b1..8142aa5 100644 --- a/apps/web/Components/Calculation/config/elements-types.ts +++ b/apps/web/Components/Calculation/config/elements-types.ts @@ -171,6 +171,7 @@ const types = wrapElementsTypes({ tbxSubsidySum: t.Readonly, btnCreateKP: t.Action, + btnCreateKPMini: t.Action, btnCalculate: t.Action, linkDownloadKp: t.Readonly, diff --git a/apps/web/Components/Calculation/config/map/actions.ts b/apps/web/Components/Calculation/config/map/actions.ts index 24b9adf..843b2e0 100644 --- a/apps/web/Components/Calculation/config/map/actions.ts +++ b/apps/web/Components/Calculation/config/map/actions.ts @@ -5,6 +5,7 @@ function wrapElementsMap>(arg: T) { const elementsToActions = wrapElementsMap({ btnCalculate: 'calculate', btnCreateKP: 'create-kp', + btnCreateKPMini: 'create-kp', }); export default elementsToActions; diff --git a/apps/web/Components/Common/Error.jsx b/apps/web/Components/Common/Error.jsx index fc7d6cf..04362df 100644 --- a/apps/web/Components/Common/Error.jsx +++ b/apps/web/Components/Common/Error.jsx @@ -1,3 +1,4 @@ +/* eslint-disable sonarjs/no-small-switch */ import Button from 'ui/elements/Button'; import Result from 'ui/elements/Result'; @@ -5,7 +6,12 @@ function handleRetry() { window.location.reload(); } +function openSupport() { + window.open('https://support.evoleasing.ru', '_blank').focus(); +} + const RetryButton =