merge refactor/february-2022
This commit is contained in:
parent
c0dcaaf8fd
commit
0b89b59e03
@ -1,16 +1,14 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
|
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
|
||||||
addons: [
|
addons: ['@storybook/addon-links', '@storybook/addon-essentials', {
|
||||||
'@storybook/addon-links',
|
name: '@storybook/preset-create-react-app',
|
||||||
'@storybook/addon-essentials',
|
options: {
|
||||||
{
|
craOverrides: {
|
||||||
name: '@storybook/preset-create-react-app',
|
fileLoaderExcludes: ['less']
|
||||||
options: {
|
}
|
||||||
craOverrides: {
|
}
|
||||||
fileLoaderExcludes: ['less'],
|
}, '@storybook/preset-ant-design'],
|
||||||
},
|
core: {
|
||||||
},
|
builder: "webpack5"
|
||||||
},
|
}
|
||||||
'@storybook/preset-ant-design',
|
|
||||||
],
|
|
||||||
};
|
};
|
||||||
17
package.json
17
package.json
@ -29,13 +29,15 @@
|
|||||||
"use-debounce": "^6.0.1"
|
"use-debounce": "^6.0.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@storybook/addon-actions": "^6.2.9",
|
"@storybook/addon-actions": "^6.4.18",
|
||||||
"@storybook/addon-essentials": "^6.2.9",
|
"@storybook/addon-essentials": "^6.4.18",
|
||||||
"@storybook/addon-links": "^6.2.9",
|
"@storybook/addon-links": "^6.4.18",
|
||||||
"@storybook/node-logger": "^6.2.9",
|
"@storybook/builder-webpack5": "^6.4.18",
|
||||||
|
"@storybook/manager-webpack5": "^6.4.18",
|
||||||
|
"@storybook/node-logger": "^6.4.18",
|
||||||
"@storybook/preset-ant-design": "^0.0.2",
|
"@storybook/preset-ant-design": "^0.0.2",
|
||||||
"@storybook/preset-create-react-app": "^3.1.7",
|
"@storybook/preset-create-react-app": "^4.0.0",
|
||||||
"@storybook/react": "^6.2.9",
|
"@storybook/react": "^6.4.18",
|
||||||
"@testing-library/jest-dom": "^5.11.4",
|
"@testing-library/jest-dom": "^5.11.4",
|
||||||
"@testing-library/react": "^11.1.0",
|
"@testing-library/react": "^11.1.0",
|
||||||
"@testing-library/user-event": "^12.1.10",
|
"@testing-library/user-event": "^12.1.10",
|
||||||
@ -53,7 +55,8 @@
|
|||||||
"cz-conventional-changelog": "^3.3.0",
|
"cz-conventional-changelog": "^3.3.0",
|
||||||
"dotenv-cli": "^4.1.1",
|
"dotenv-cli": "^4.1.1",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"source-map-explorer": "^2.5.2"
|
"source-map-explorer": "^2.5.2",
|
||||||
|
"webpack": "5"
|
||||||
},
|
},
|
||||||
"resolutions": {
|
"resolutions": {
|
||||||
"mini-css-extract-plugin": "2.4.5"
|
"mini-css-extract-plugin": "2.4.5"
|
||||||
|
|||||||
@ -13,12 +13,12 @@ const BottomControls = ({ insType, onSelectRow, selectedKey }) => {
|
|||||||
calculationProcess.addProcess(Process.ELT);
|
calculationProcess.addProcess(Process.ELT);
|
||||||
const selectRes = onSelectRow.call(calculationStore, insType, selectedKey);
|
const selectRes = onSelectRow.call(calculationStore, insType, selectedKey);
|
||||||
|
|
||||||
if (selectRes && selectRes.message) {
|
if (selectRes?.message) {
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
title: 'Внимание',
|
message: 'Внимание',
|
||||||
description: selectRes.message,
|
description: selectRes.message,
|
||||||
})();
|
});
|
||||||
} else {
|
} else {
|
||||||
ELTStore[insType].setKey(selectedKey);
|
ELTStore[insType].setKey(selectedKey);
|
||||||
message.success({ content: 'Выбранный расчет ЭЛТ применен' });
|
message.success({ content: 'Выбранный расчет ЭЛТ применен' });
|
||||||
|
|||||||
@ -46,12 +46,12 @@ export default function (this: ICalculationStore, validation: ELTValidation) {
|
|||||||
if (missingElementsNames.length > 0) {
|
if (missingElementsNames.length > 0) {
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Ошибка во время расчета ЭЛТ',
|
message: 'Ошибка во время расчета ЭЛТ',
|
||||||
description: String.prototype.concat(
|
description: String.prototype.concat(
|
||||||
'Не заполнены поля: ',
|
'Не заполнены поля: ',
|
||||||
missingElementsNames.join(', '),
|
missingElementsNames.join(', '),
|
||||||
),
|
),
|
||||||
})();
|
});
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -157,9 +157,9 @@ const callbacks: Table['callbacks'] = {
|
|||||||
});
|
});
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Ошибка',
|
message: 'Ошибка',
|
||||||
description: 'Не указана страховая компания по полису',
|
description: 'Не указана страховая компания по полису',
|
||||||
})();
|
});
|
||||||
} else {
|
} else {
|
||||||
calculationStore.setTableRow(
|
calculationStore.setTableRow(
|
||||||
'tableInsurance',
|
'tableInsurance',
|
||||||
@ -187,9 +187,9 @@ const callbacks: Table['callbacks'] = {
|
|||||||
});
|
});
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Ошибка',
|
message: 'Ошибка',
|
||||||
description: 'Не указан срок страхования',
|
description: 'Не указан срок страхования',
|
||||||
})();
|
});
|
||||||
} else {
|
} else {
|
||||||
calculationStore.setTableRow(
|
calculationStore.setTableRow(
|
||||||
'tableInsurance',
|
'tableInsurance',
|
||||||
@ -217,9 +217,9 @@ const callbacks: Table['callbacks'] = {
|
|||||||
});
|
});
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Ошибка',
|
message: 'Ошибка',
|
||||||
description: 'Не указан плательщик',
|
description: 'Не указан плательщик',
|
||||||
})();
|
});
|
||||||
} else {
|
} else {
|
||||||
calculationStore.setTableRow(
|
calculationStore.setTableRow(
|
||||||
'tableInsurance',
|
'tableInsurance',
|
||||||
@ -249,9 +249,9 @@ const callbacks: Table['callbacks'] = {
|
|||||||
});
|
});
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Ошибка',
|
message: 'Ошибка',
|
||||||
description: 'Не указан плательщик',
|
description: 'Не указан плательщик',
|
||||||
})();
|
});
|
||||||
} else {
|
} else {
|
||||||
calculationStore.setTableRow(
|
calculationStore.setTableRow(
|
||||||
'tableInsurance',
|
'tableInsurance',
|
||||||
@ -281,9 +281,9 @@ const callbacks: Table['callbacks'] = {
|
|||||||
});
|
});
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Ошибка',
|
message: 'Ошибка',
|
||||||
description: 'Не указан срок страхования',
|
description: 'Не указан срок страхования',
|
||||||
})();
|
});
|
||||||
} else {
|
} else {
|
||||||
calculationStore.setTableRow(
|
calculationStore.setTableRow(
|
||||||
'tableInsurance',
|
'tableInsurance',
|
||||||
@ -314,9 +314,9 @@ const callbacks: Table['callbacks'] = {
|
|||||||
});
|
});
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Ошибка',
|
message: 'Ошибка',
|
||||||
description: 'Не указана страховая компания по полису',
|
description: 'Не указана страховая компания по полису',
|
||||||
})();
|
});
|
||||||
} else {
|
} else {
|
||||||
calculationStore.setTableRow(
|
calculationStore.setTableRow(
|
||||||
'tableInsurance',
|
'tableInsurance',
|
||||||
|
|||||||
30
src/client/Elements/Notification.stories.jsx
Normal file
30
src/client/Elements/Notification.stories.jsx
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
import { openNotification } from './Notification';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
title: 'Notification',
|
||||||
|
};
|
||||||
|
|
||||||
|
export const Notification = () => (
|
||||||
|
<>
|
||||||
|
<button
|
||||||
|
onClick={() => {
|
||||||
|
openNotification('error', {
|
||||||
|
message: 'message',
|
||||||
|
description: 'description',
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Open Error
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
onClick={() => {
|
||||||
|
openNotification('success', {
|
||||||
|
message: 'message',
|
||||||
|
description: 'description',
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Open Success
|
||||||
|
</button>
|
||||||
|
</>
|
||||||
|
);
|
||||||
@ -1,27 +1,17 @@
|
|||||||
import { notification } from 'antd';
|
import { notification } from 'antd';
|
||||||
|
import { ArgsProps, NotificationInstance } from 'antd/lib/notification';
|
||||||
import { NOTIFICATION_DEBOUNCE } from 'core/constants/debounce';
|
import { NOTIFICATION_DEBOUNCE } from 'core/constants/debounce';
|
||||||
import { debounce } from 'lodash';
|
import { debounce } from 'lodash';
|
||||||
|
|
||||||
type TNotification = 'success' | 'info' | 'warning' | 'error';
|
const defaultOptions: Partial<ArgsProps> = {
|
||||||
|
placement: 'bottomRight',
|
||||||
|
};
|
||||||
|
|
||||||
export const openNotification = ({
|
type NotificationOptions = ArgsProps & {
|
||||||
type,
|
type: keyof NotificationInstance;
|
||||||
title,
|
};
|
||||||
description,
|
|
||||||
}: {
|
export const openNotification = debounce((options: NotificationOptions) => {
|
||||||
type: TNotification;
|
if (!options.key) options.key = JSON.stringify(options);
|
||||||
title: string;
|
notification[options.type]({ ...defaultOptions, ...options });
|
||||||
description?: string;
|
}, NOTIFICATION_DEBOUNCE);
|
||||||
}) =>
|
|
||||||
debounce(
|
|
||||||
() =>
|
|
||||||
notification[type]({
|
|
||||||
message: title,
|
|
||||||
description,
|
|
||||||
placement: 'bottomRight',
|
|
||||||
style: {
|
|
||||||
zIndex: 9999999999,
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
NOTIFICATION_DEBOUNCE,
|
|
||||||
);
|
|
||||||
|
|||||||
@ -60,18 +60,18 @@ export default function (this: ICalculationStore) {
|
|||||||
if (invalidElements.length > 0)
|
if (invalidElements.length > 0)
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Ошибка во время расчета графика',
|
message: 'Ошибка во время расчета графика',
|
||||||
description:
|
description:
|
||||||
'Некорректно заполнены поля: ' + invalidElements.join(', '),
|
'Некорректно заполнены поля: ' + invalidElements.join(', '),
|
||||||
})();
|
});
|
||||||
|
|
||||||
if (invalidTables.length > 0)
|
if (invalidTables.length > 0)
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Ошибка во время расчета графика',
|
message: 'Ошибка во время расчета графика',
|
||||||
description:
|
description:
|
||||||
'Некорректно заполнены таблицы: ' + invalidTables.join(', '),
|
'Некорректно заполнены таблицы: ' + invalidTables.join(', '),
|
||||||
})();
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -115,14 +115,14 @@ export default function (this: ICalculationStore) {
|
|||||||
.catch(err => {
|
.catch(err => {
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Ошибка во время расчета!',
|
message: 'Ошибка во время расчета!',
|
||||||
description:
|
description:
|
||||||
err.response &&
|
err.response &&
|
||||||
err.response.data &&
|
err.response.data &&
|
||||||
(err.response.data.errors
|
(err.response.data.errors
|
||||||
? err.response.data.errors.join(', ')
|
? err.response.data.errors.join(', ')
|
||||||
: err.response.data),
|
: err.response.data),
|
||||||
})();
|
});
|
||||||
|
|
||||||
throw err;
|
throw err;
|
||||||
})
|
})
|
||||||
|
|||||||
@ -82,8 +82,8 @@ export default async function (this: ICalculationStore) {
|
|||||||
} catch (err) {
|
} catch (err) {
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Ошибка во время создания КП!',
|
message: 'Ошибка во время создания КП!',
|
||||||
})();
|
});
|
||||||
|
|
||||||
const { response } = err as AxiosError;
|
const { response } = err as AxiosError;
|
||||||
const error = response?.data || err;
|
const error = response?.data || err;
|
||||||
|
|||||||
@ -63,9 +63,9 @@ const autorunEffects: IAutorunEffect[] = [
|
|||||||
calculationStore.setValidation('tbxEngineVolume', false);
|
calculationStore.setValidation('tbxEngineVolume', false);
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Ошибка',
|
message: 'Ошибка',
|
||||||
description: 'Объем двигателя должен быть больше 0',
|
description: 'Объем двигателя должен быть больше 0',
|
||||||
})();
|
});
|
||||||
} else {
|
} else {
|
||||||
calculationStore.setValidation('tbxEngineVolume', undefined);
|
calculationStore.setValidation('tbxEngineVolume', undefined);
|
||||||
}
|
}
|
||||||
@ -74,9 +74,9 @@ const autorunEffects: IAutorunEffect[] = [
|
|||||||
calculationStore.setValidation('selectEngineType', false);
|
calculationStore.setValidation('selectEngineType', false);
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Ошибка',
|
message: 'Ошибка',
|
||||||
description: 'Тип двигателя должен содержать данные',
|
description: 'Тип двигателя должен содержать данные',
|
||||||
})();
|
});
|
||||||
} else {
|
} else {
|
||||||
calculationStore.setValidation('selectEngineType', undefined);
|
calculationStore.setValidation('selectEngineType', undefined);
|
||||||
}
|
}
|
||||||
@ -85,9 +85,9 @@ const autorunEffects: IAutorunEffect[] = [
|
|||||||
calculationStore.setValidation('tbxLeaseObjectMotorPower', false);
|
calculationStore.setValidation('tbxLeaseObjectMotorPower', false);
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Ошибка',
|
message: 'Ошибка',
|
||||||
description: 'Мощность двигателя должна быть больше 0',
|
description: 'Мощность двигателя должна быть больше 0',
|
||||||
})();
|
});
|
||||||
} else {
|
} else {
|
||||||
calculationStore.setValidation('tbxLeaseObjectMotorPower', undefined);
|
calculationStore.setValidation('tbxLeaseObjectMotorPower', undefined);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -139,10 +139,10 @@ const gibddReactions: IReactionEffect[] = [
|
|||||||
calculationStore.setValidation('tbxMaxMass', false);
|
calculationStore.setValidation('tbxMaxMass', false);
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Ошибка',
|
message: 'Ошибка',
|
||||||
description:
|
description:
|
||||||
'При категории ТС = В Разерешенная макс.масс не может быть больше 3500кг',
|
'При категории ТС = В Разерешенная макс.масс не может быть больше 3500кг',
|
||||||
})();
|
});
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -151,9 +151,9 @@ const gibddReactions: IReactionEffect[] = [
|
|||||||
calculationStore.setValidation('tbxMaxMass', false);
|
calculationStore.setValidation('tbxMaxMass', false);
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Ошибка',
|
message: 'Ошибка',
|
||||||
description: 'Разерешенная макс.масс не может быть меньше 3500кг',
|
description: 'Разерешенная макс.масс не может быть меньше 3500кг',
|
||||||
})();
|
});
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -243,10 +243,10 @@ const gibddReactions: IReactionEffect[] = [
|
|||||||
calculationStore.setValidation('selectObjectCategoryTax', false);
|
calculationStore.setValidation('selectObjectCategoryTax', false);
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Ошибка',
|
message: 'Ошибка',
|
||||||
description:
|
description:
|
||||||
'Необходимо из ЭПТС указать Категорию в соответствии с ТР ТС 018/2011',
|
'Необходимо из ЭПТС указать Категорию в соответствии с ТР ТС 018/2011',
|
||||||
})();
|
});
|
||||||
} else {
|
} else {
|
||||||
calculationStore.setValidation('selectObjectCategoryTax', undefined);
|
calculationStore.setValidation('selectObjectCategoryTax', undefined);
|
||||||
}
|
}
|
||||||
@ -268,9 +268,9 @@ const gibddReactions: IReactionEffect[] = [
|
|||||||
calculationStore.setValidation('selectInsNSIB', false);
|
calculationStore.setValidation('selectInsNSIB', false);
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Ошибка',
|
message: 'Ошибка',
|
||||||
description: 'Страхование НСИБ обязательно для мотоциклистов',
|
description: 'Страхование НСИБ обязательно для мотоциклистов',
|
||||||
})();
|
});
|
||||||
} else {
|
} else {
|
||||||
calculationStore.setValidation('selectInsNSIB', undefined);
|
calculationStore.setValidation('selectInsNSIB', undefined);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,10 @@
|
|||||||
import { message } from 'antd';
|
import { message } from 'antd';
|
||||||
import { resetIns } from 'client/Containers/Calculation/Components/ELT/lib/resetIns';
|
import { resetIns } from 'client/Containers/Calculation/Components/ELT/lib/resetIns';
|
||||||
import { numberElementsProps } from 'client/Containers/Calculation/Elements/props/common';
|
import { numberElementsProps } from 'client/Containers/Calculation/Elements/props/common';
|
||||||
import { getTitle, getValueName } from 'client/Containers/Calculation/Elements/tools';
|
import {
|
||||||
|
getTitle,
|
||||||
|
getValueName,
|
||||||
|
} from 'client/Containers/Calculation/Elements/tools';
|
||||||
import { ElementsNames } from 'client/Containers/Calculation/types/elements';
|
import { ElementsNames } from 'client/Containers/Calculation/types/elements';
|
||||||
import { openNotification } from 'client/Elements/Notification';
|
import { openNotification } from 'client/Elements/Notification';
|
||||||
import initialValues from 'client/stores/CalculationStore/config/initialValues';
|
import initialValues from 'client/stores/CalculationStore/config/initialValues';
|
||||||
@ -10,7 +13,7 @@ import {
|
|||||||
mainOptionsForQuoteQuery,
|
mainOptionsForQuoteQuery,
|
||||||
quoteQuery,
|
quoteQuery,
|
||||||
secondaryOptionsForQuoteQuery,
|
secondaryOptionsForQuoteQuery,
|
||||||
singleOptionsForQuoteQuery
|
singleOptionsForQuoteQuery,
|
||||||
} from 'core/services/CrmService/graphql/query/quote';
|
} from 'core/services/CrmService/graphql/query/quote';
|
||||||
import { TOptionizedEntity } from 'core/services/CrmService/types/common';
|
import { TOptionizedEntity } from 'core/services/CrmService/types/common';
|
||||||
import {
|
import {
|
||||||
@ -18,7 +21,7 @@ import {
|
|||||||
IAccount,
|
IAccount,
|
||||||
IEvoGraph,
|
IEvoGraph,
|
||||||
IEvoTown,
|
IEvoTown,
|
||||||
IQuote
|
IQuote,
|
||||||
} from 'core/services/CrmService/types/entities';
|
} from 'core/services/CrmService/types/entities';
|
||||||
import { currentISODate } from 'core/tools/date';
|
import { currentISODate } from 'core/tools/date';
|
||||||
import { NIL } from 'core/tools/uuid';
|
import { NIL } from 'core/tools/uuid';
|
||||||
@ -28,7 +31,6 @@ import { get, invert, isEqual, isNil } from 'lodash';
|
|||||||
import { ElementStatus } from 'types/elements';
|
import { ElementStatus } from 'types/elements';
|
||||||
import { getValuesFromKP } from './mapKpToValues';
|
import { getValuesFromKP } from './mapKpToValues';
|
||||||
|
|
||||||
|
|
||||||
const map_add_product_types_to_values = {
|
const map_add_product_types_to_values = {
|
||||||
technicalCard: 100000000,
|
technicalCard: 100000000,
|
||||||
registration: 100000001,
|
registration: 100000001,
|
||||||
@ -578,9 +580,9 @@ const loadKpReaction: IReactionEffect = calculationStore => ({
|
|||||||
.join(', ');
|
.join(', ');
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
title: 'Внимание',
|
message: 'Внимание',
|
||||||
description: 'При подгрузке КП были сброшены поля: ' + fieldsTitles,
|
description: 'При подгрузке КП были сброшены поля: ' + fieldsTitles,
|
||||||
})();
|
});
|
||||||
}
|
}
|
||||||
// check min max number values
|
// check min max number values
|
||||||
|
|
||||||
@ -658,9 +660,9 @@ const loadKpReaction: IReactionEffect = calculationStore => ({
|
|||||||
.catch(err => {
|
.catch(err => {
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: `Ошибка во время загрузки КП `,
|
message: `Ошибка во время загрузки КП `,
|
||||||
description: `${err}`,
|
description: `${err}`,
|
||||||
})();
|
});
|
||||||
throw err;
|
throw err;
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
|
|||||||
@ -238,10 +238,10 @@ const reactionEffects: IReactionEffect[] = [
|
|||||||
calculationStore.setValidation('tbxIndAgentRewardSumm', false);
|
calculationStore.setValidation('tbxIndAgentRewardSumm', false);
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Ошибка',
|
message: 'Ошибка',
|
||||||
description:
|
description:
|
||||||
'Вознаграждение агента ФЛ указано больше условия по агентскому договору! \nЗначение установлено по условию договора.',
|
'Вознаграждение агента ФЛ указано больше условия по агентскому договору! \nЗначение установлено по условию договора.',
|
||||||
})();
|
});
|
||||||
return;
|
return;
|
||||||
} else if (
|
} else if (
|
||||||
!indAgentRewardCondition.evo_reduce_reward &&
|
!indAgentRewardCondition.evo_reduce_reward &&
|
||||||
@ -254,10 +254,10 @@ const reactionEffects: IReactionEffect[] = [
|
|||||||
calculationStore.setValidation('tbxIndAgentRewardSumm', false);
|
calculationStore.setValidation('tbxIndAgentRewardSumm', false);
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Ошибка',
|
message: 'Ошибка',
|
||||||
description:
|
description:
|
||||||
'Вознаграждение агента ФЛ указано меньше условия по агентскому договору! \nЗначение установлено по условию договора.',
|
'Вознаграждение агента ФЛ указано меньше условия по агентскому договору! \nЗначение установлено по условию договора.',
|
||||||
})();
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -288,10 +288,10 @@ const reactionEffects: IReactionEffect[] = [
|
|||||||
);
|
);
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Ошибка',
|
message: 'Ошибка',
|
||||||
description:
|
description:
|
||||||
'Вознаграждение двойного агента указано больше условия по агентскому договору! \nЗначение установлено по условию договора.',
|
'Вознаграждение двойного агента указано больше условия по агентскому договору! \nЗначение установлено по условию договора.',
|
||||||
})();
|
});
|
||||||
return;
|
return;
|
||||||
} else if (
|
} else if (
|
||||||
!selectCalcDoubleAgentRewardCondition.evo_reduce_reward &&
|
!selectCalcDoubleAgentRewardCondition.evo_reduce_reward &&
|
||||||
@ -307,10 +307,10 @@ const reactionEffects: IReactionEffect[] = [
|
|||||||
);
|
);
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Ошибка',
|
message: 'Ошибка',
|
||||||
description:
|
description:
|
||||||
'Вознаграждение двойного агента указано меньше условия по агентскому договору! \nЗначение установлено по условию договора.',
|
'Вознаграждение двойного агента указано меньше условия по агентскому договору! \nЗначение установлено по условию договора.',
|
||||||
})();
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -338,10 +338,10 @@ const reactionEffects: IReactionEffect[] = [
|
|||||||
calculationStore.setValidation('tbxCalcBrokerRewardSum', false);
|
calculationStore.setValidation('tbxCalcBrokerRewardSum', false);
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Ошибка',
|
message: 'Ошибка',
|
||||||
description:
|
description:
|
||||||
'Вознаграждение брокера указано больше условия по агентскому договору! \nЗначение установлено по условию договора.',
|
'Вознаграждение брокера указано больше условия по агентскому договору! \nЗначение установлено по условию договора.',
|
||||||
})();
|
});
|
||||||
return;
|
return;
|
||||||
} else if (
|
} else if (
|
||||||
!selectCalcBrokerRewardCondition.evo_reduce_reward &&
|
!selectCalcBrokerRewardCondition.evo_reduce_reward &&
|
||||||
@ -354,10 +354,10 @@ const reactionEffects: IReactionEffect[] = [
|
|||||||
calculationStore.setValidation('tbxCalcBrokerRewardSum', false);
|
calculationStore.setValidation('tbxCalcBrokerRewardSum', false);
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Ошибка',
|
message: 'Ошибка',
|
||||||
description:
|
description:
|
||||||
'Вознаграждение брокера указано меньше условия по агентскому договору! \nЗначение установлено по условию договора.',
|
'Вознаграждение брокера указано меньше условия по агентскому договору! \nЗначение установлено по условию договора.',
|
||||||
})();
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -387,10 +387,10 @@ const reactionEffects: IReactionEffect[] = [
|
|||||||
calculationStore.setValidation('tbxFinDepartmentRewardSumm', false);
|
calculationStore.setValidation('tbxFinDepartmentRewardSumm', false);
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Ошибка',
|
message: 'Ошибка',
|
||||||
description:
|
description:
|
||||||
'Вознаграждение финотдела указано больше условия по агентскому договору! \nЗначение установлено по условию договора.',
|
'Вознаграждение финотдела указано больше условия по агентскому договору! \nЗначение установлено по условию договора.',
|
||||||
})();
|
});
|
||||||
return;
|
return;
|
||||||
} else if (
|
} else if (
|
||||||
!selectFinDepartmentRewardCondtion.evo_reduce_reward &&
|
!selectFinDepartmentRewardCondtion.evo_reduce_reward &&
|
||||||
@ -403,10 +403,10 @@ const reactionEffects: IReactionEffect[] = [
|
|||||||
calculationStore.setValidation('tbxFinDepartmentRewardSumm', false);
|
calculationStore.setValidation('tbxFinDepartmentRewardSumm', false);
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Ошибка',
|
message: 'Ошибка',
|
||||||
description:
|
description:
|
||||||
'Вознаграждение финотдела указано меньше условия по агентскому договору! \nЗначение установлено по условию договора.',
|
'Вознаграждение финотдела указано меньше условия по агентскому договору! \nЗначение установлено по условию договора.',
|
||||||
})();
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -494,10 +494,10 @@ const reactionEffects: IReactionEffect[] = [
|
|||||||
calculationStore.setValidation('tbxLastPaymentRub', false);
|
calculationStore.setValidation('tbxLastPaymentRub', false);
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Ошибка',
|
message: 'Ошибка',
|
||||||
description:
|
description:
|
||||||
'Последний платеж меньше 3500 руб. не может быть при наличии НСИБ, укажите большее значение',
|
'Последний платеж меньше 3500 руб. не может быть при наличии НСИБ, укажите большее значение',
|
||||||
})();
|
});
|
||||||
} else {
|
} else {
|
||||||
calculationStore.setValidation('tbxLastPaymentRub', true);
|
calculationStore.setValidation('tbxLastPaymentRub', true);
|
||||||
}
|
}
|
||||||
@ -808,10 +808,10 @@ const reactionEffects: IReactionEffect[] = [
|
|||||||
calculationStore.setValidation('tbxDealerRewardSumm', false);
|
calculationStore.setValidation('tbxDealerRewardSumm', false);
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Ошибка',
|
message: 'Ошибка',
|
||||||
description:
|
description:
|
||||||
'Вознаграждение ЮЛ поставщика указано больше условия по агентскому договору! \nЗначение установлено по условию договора.',
|
'Вознаграждение ЮЛ поставщика указано больше условия по агентскому договору! \nЗначение установлено по условию договора.',
|
||||||
})();
|
});
|
||||||
return;
|
return;
|
||||||
} else if (
|
} else if (
|
||||||
!dealerRewardCondition.evo_reduce_reward &&
|
!dealerRewardCondition.evo_reduce_reward &&
|
||||||
@ -823,10 +823,10 @@ const reactionEffects: IReactionEffect[] = [
|
|||||||
calculationStore.setValidation('tbxDealerRewardSumm', false);
|
calculationStore.setValidation('tbxDealerRewardSumm', false);
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Ошибка',
|
message: 'Ошибка',
|
||||||
description:
|
description:
|
||||||
'Вознаграждение ЮЛ поставщика указано меньше условия по агентскому договору! \nЗначение установлено по условию договора.',
|
'Вознаграждение ЮЛ поставщика указано меньше условия по агентскому договору! \nЗначение установлено по условию договора.',
|
||||||
})();
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -853,10 +853,10 @@ const reactionEffects: IReactionEffect[] = [
|
|||||||
calculationStore.setValidation('tbxDealerBrokerRewardSumm', false);
|
calculationStore.setValidation('tbxDealerBrokerRewardSumm', false);
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Ошибка',
|
message: 'Ошибка',
|
||||||
description:
|
description:
|
||||||
'Вознаграждение брокера поставщика указано больше условия по агентскому договору! \nЗначение установлено по условию договора.',
|
'Вознаграждение брокера поставщика указано больше условия по агентскому договору! \nЗначение установлено по условию договора.',
|
||||||
})();
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -871,10 +871,10 @@ const reactionEffects: IReactionEffect[] = [
|
|||||||
calculationStore.setValidation('tbxDealerBrokerRewardSumm', false);
|
calculationStore.setValidation('tbxDealerBrokerRewardSumm', false);
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Ошибка',
|
message: 'Ошибка',
|
||||||
description:
|
description:
|
||||||
'Вознаграждение брокера поставщика указано меньше условия по агентскому договору! \nЗначение установлено по условию договора.',
|
'Вознаграждение брокера поставщика указано меньше условия по агентскому договору! \nЗначение установлено по условию договора.',
|
||||||
})();
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -914,10 +914,10 @@ const reactionEffects: IReactionEffect[] = [
|
|||||||
calculationStore.setValidation('tbxSaleBonus', false);
|
calculationStore.setValidation('tbxSaleBonus', false);
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Ошибка',
|
message: 'Ошибка',
|
||||||
description:
|
description:
|
||||||
'Размер бонуса МПЛ не может быть выше установленного по СОТ',
|
'Размер бонуса МПЛ не может быть выше установленного по СОТ',
|
||||||
})();
|
});
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
calculationStore.setValidation('tbxSaleBonus', undefined);
|
calculationStore.setValidation('tbxSaleBonus', undefined);
|
||||||
@ -1107,10 +1107,10 @@ const reactionEffects: IReactionEffect[] = [
|
|||||||
}, 0);
|
}, 0);
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
title: 'Внимание',
|
message: 'Внимание!',
|
||||||
description:
|
description:
|
||||||
'При сезонном графике срок лизинга должен быть больше 14 месяцев',
|
'При сезонном графике срок лизинга должен быть больше 14 месяцев',
|
||||||
})();
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
@ -1322,9 +1322,9 @@ const reactionEffects: IReactionEffect[] = [
|
|||||||
calculationStore.setValidation('tbxCountSeats', false);
|
calculationStore.setValidation('tbxCountSeats', false);
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Ошибка',
|
message: 'Ошибка',
|
||||||
description: 'Количество мест должно быть меньше 9',
|
description: 'Количество мест должно быть меньше 9',
|
||||||
})();
|
});
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1335,10 +1335,10 @@ const reactionEffects: IReactionEffect[] = [
|
|||||||
calculationStore.setValidation('tbxMaxMass', false);
|
calculationStore.setValidation('tbxMaxMass', false);
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Ошибка',
|
message: 'Ошибка',
|
||||||
description:
|
description:
|
||||||
'Разрешенная максимальная масса должна быть больше 0',
|
'Разрешенная максимальная масса должна быть больше 0',
|
||||||
})();
|
});
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1350,9 +1350,9 @@ const reactionEffects: IReactionEffect[] = [
|
|||||||
calculationStore.setValidation('tbxCountSeats', false);
|
calculationStore.setValidation('tbxCountSeats', false);
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Ошибка',
|
message: 'Ошибка',
|
||||||
description: 'Кол-во мест должно быть больше 8',
|
description: 'Кол-во мест должно быть больше 8',
|
||||||
})();
|
});
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1411,9 +1411,9 @@ const reactionEffects: IReactionEffect[] = [
|
|||||||
calculationStore.setValidation('tbxMileage', false);
|
calculationStore.setValidation('tbxMileage', false);
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Ошибка',
|
message: 'Ошибка',
|
||||||
description: 'Не указан пробег',
|
description: 'Не указан пробег',
|
||||||
})();
|
});
|
||||||
} else {
|
} else {
|
||||||
calculationStore.setValidation('tbxMileage', undefined);
|
calculationStore.setValidation('tbxMileage', undefined);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,10 +26,8 @@ export default [
|
|||||||
|
|
||||||
(calculationStore, calculationProcess) => ({
|
(calculationStore, calculationProcess) => ({
|
||||||
expression: () => {
|
expression: () => {
|
||||||
const {
|
const { leaseObjectPrice, supplierDiscountPerc } =
|
||||||
leaseObjectPrice,
|
calculationStore.values;
|
||||||
supplierDiscountPerc,
|
|
||||||
} = calculationStore.values;
|
|
||||||
return [leaseObjectPrice, supplierDiscountPerc];
|
return [leaseObjectPrice, supplierDiscountPerc];
|
||||||
},
|
},
|
||||||
effect: ([leaseObjectPrice = 0, supplierDiscountPerc = 0]) => {
|
effect: ([leaseObjectPrice = 0, supplierDiscountPerc = 0]) => {
|
||||||
@ -74,11 +72,8 @@ export default [
|
|||||||
|
|
||||||
calculationStore => ({
|
calculationStore => ({
|
||||||
expression: () => {
|
expression: () => {
|
||||||
const {
|
const { supplierCurrency, leaseObjectPrice, firstPaymentPerc } =
|
||||||
supplierCurrency,
|
calculationStore.values;
|
||||||
leaseObjectPrice,
|
|
||||||
firstPaymentPerc,
|
|
||||||
} = calculationStore.values;
|
|
||||||
return [supplierCurrency, leaseObjectPrice, firstPaymentPerc];
|
return [supplierCurrency, leaseObjectPrice, firstPaymentPerc];
|
||||||
},
|
},
|
||||||
effect: ([
|
effect: ([
|
||||||
@ -102,11 +97,8 @@ export default [
|
|||||||
|
|
||||||
(calculationStore, calculationProcess) => ({
|
(calculationStore, calculationProcess) => ({
|
||||||
expression: () => {
|
expression: () => {
|
||||||
const {
|
const { supplierCurrency, leaseObjectPrice, comissionPerc } =
|
||||||
supplierCurrency,
|
calculationStore.values;
|
||||||
leaseObjectPrice,
|
|
||||||
comissionPerc,
|
|
||||||
} = calculationStore.values;
|
|
||||||
return [supplierCurrency, leaseObjectPrice, comissionPerc];
|
return [supplierCurrency, leaseObjectPrice, comissionPerc];
|
||||||
},
|
},
|
||||||
effect: ([supplierCurrencyId, leaseObjectPrice = 0, comissionPerc = 0]) => {
|
effect: ([supplierCurrencyId, leaseObjectPrice = 0, comissionPerc = 0]) => {
|
||||||
@ -252,10 +244,10 @@ export default [
|
|||||||
calculationStore.setValidation('tbxSupplierDiscountRub', false);
|
calculationStore.setValidation('tbxSupplierDiscountRub', false);
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Ошибка',
|
message: 'Ошибка',
|
||||||
description:
|
description:
|
||||||
'Скидка от поставщика не может быть больше или равна стоимости ПЛ.',
|
'Скидка от поставщика не может быть больше или равна стоимости ПЛ.',
|
||||||
})();
|
});
|
||||||
} else {
|
} else {
|
||||||
calculationStore.setValidation('tbxSupplierDiscountRub', undefined);
|
calculationStore.setValidation('tbxSupplierDiscountRub', undefined);
|
||||||
}
|
}
|
||||||
@ -288,10 +280,10 @@ export default [
|
|||||||
calculationStore.setValidation('tbxFirstPaymentRub', false);
|
calculationStore.setValidation('tbxFirstPaymentRub', false);
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Ошибка',
|
message: 'Ошибка',
|
||||||
description:
|
description:
|
||||||
'Первый платеж не может быть больше или равен стоимости ПЛ.',
|
'Первый платеж не может быть больше или равен стоимости ПЛ.',
|
||||||
})();
|
});
|
||||||
} else {
|
} else {
|
||||||
calculationStore.setValidation('tbxFirstPaymentRub', undefined);
|
calculationStore.setValidation('tbxFirstPaymentRub', undefined);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -132,11 +132,11 @@ const reactionEffects: IReactionEffect[] = [
|
|||||||
calculationStore.setValidation('tbxLeaseObjectPrice', false);
|
calculationStore.setValidation('tbxLeaseObjectPrice', false);
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Ошибка',
|
message: 'Ошибка',
|
||||||
description:
|
description:
|
||||||
'Указанная стоимость предмета лизинга больше возмножного изменения стоимости предмета лизинга при пересчете без пересмотра. ' +
|
'Указанная стоимость предмета лизинга больше возмножного изменения стоимости предмета лизинга при пересчете без пересмотра. ' +
|
||||||
'Уменьшите стоимость предмета лизинга',
|
'Уменьшите стоимость предмета лизинга',
|
||||||
})();
|
});
|
||||||
} else {
|
} else {
|
||||||
calculationStore.setValidation('tbxLeaseObjectPrice', undefined);
|
calculationStore.setValidation('tbxLeaseObjectPrice', undefined);
|
||||||
}
|
}
|
||||||
@ -147,11 +147,11 @@ const reactionEffects: IReactionEffect[] = [
|
|||||||
calculationStore.setValidation('tbxLeaseObjectPrice', false);
|
calculationStore.setValidation('tbxLeaseObjectPrice', false);
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Ошибка',
|
message: 'Ошибка',
|
||||||
description:
|
description:
|
||||||
'Указанная стоимость предмета лизинга меньше возмножного изменения стоимости предмета лизинга при пересчете без пересмотра. ' +
|
'Указанная стоимость предмета лизинга меньше возмножного изменения стоимости предмета лизинга при пересчете без пересмотра. ' +
|
||||||
'Увеличьте стоимость предмета лизинга',
|
'Увеличьте стоимость предмета лизинга',
|
||||||
})();
|
});
|
||||||
} else {
|
} else {
|
||||||
calculationStore.setValidation('tbxLeaseObjectPrice', undefined);
|
calculationStore.setValidation('tbxLeaseObjectPrice', undefined);
|
||||||
}
|
}
|
||||||
@ -176,10 +176,10 @@ const reactionEffects: IReactionEffect[] = [
|
|||||||
calculationStore.setValidation('tbxFirstPaymentPerc', false);
|
calculationStore.setValidation('tbxFirstPaymentPerc', false);
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Ошибка',
|
message: 'Ошибка',
|
||||||
description:
|
description:
|
||||||
'Указанный первый платеж меньше одобренного. При пересчете без пересмотра изменение первого платежа возможно только в большую сторону от одобренного значения',
|
'Указанный первый платеж меньше одобренного. При пересчете без пересмотра изменение первого платежа возможно только в большую сторону от одобренного значения',
|
||||||
})();
|
});
|
||||||
} else {
|
} else {
|
||||||
calculationStore.setValidation('tbxFirstPaymentPerc', undefined);
|
calculationStore.setValidation('tbxFirstPaymentPerc', undefined);
|
||||||
}
|
}
|
||||||
@ -204,10 +204,10 @@ const reactionEffects: IReactionEffect[] = [
|
|||||||
calculationStore.setValidation('tbxLeaseObjectCount', false);
|
calculationStore.setValidation('tbxLeaseObjectCount', false);
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Ошибка',
|
message: 'Ошибка',
|
||||||
description:
|
description:
|
||||||
'Количество ПЛ превышает лимит пересчета без пересмотра',
|
'Количество ПЛ превышает лимит пересчета без пересмотра',
|
||||||
})();
|
});
|
||||||
} else {
|
} else {
|
||||||
calculationStore.setValidation('tbxLeaseObjectCount', undefined);
|
calculationStore.setValidation('tbxLeaseObjectCount', undefined);
|
||||||
}
|
}
|
||||||
@ -253,10 +253,10 @@ const reactionEffects: IReactionEffect[] = [
|
|||||||
} else {
|
} else {
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Ошибка',
|
message: 'Ошибка',
|
||||||
description:
|
description:
|
||||||
'Указанная разрешенная макс. масса выходит из утвержденного диапазона. Для изменения параметра требуется пересмотр сделки',
|
'Указанная разрешенная макс. масса выходит из утвержденного диапазона. Для изменения параметра требуется пересмотр сделки',
|
||||||
})();
|
});
|
||||||
calculationStore.setValidation('tbxMaxMass', false);
|
calculationStore.setValidation('tbxMaxMass', false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -288,10 +288,10 @@ const reactionEffects: IReactionEffect[] = [
|
|||||||
} else {
|
} else {
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Ошибка',
|
message: 'Ошибка',
|
||||||
description:
|
description:
|
||||||
'Указанное кол-во мест выходит из утвержденного диапазона. Для изменения параметра требуется пересмотр сделки',
|
'Указанное кол-во мест выходит из утвержденного диапазона. Для изменения параметра требуется пересмотр сделки',
|
||||||
})();
|
});
|
||||||
calculationStore.setValidation('tbxCountSeats', false);
|
calculationStore.setValidation('tbxCountSeats', false);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -527,10 +527,10 @@ const reactionEffects: IReactionEffect[] = [
|
|||||||
) {
|
) {
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Ошибка',
|
message: 'Ошибка',
|
||||||
description:
|
description:
|
||||||
'При пересчете без пересмотра последний платеж можно уменьшать или увеличивать до 1%',
|
'При пересчете без пересмотра последний платеж можно уменьшать или увеличивать до 1%',
|
||||||
})();
|
});
|
||||||
calculationStore.setValidation('tbxLastPaymentPerc', false);
|
calculationStore.setValidation('tbxLastPaymentPerc', false);
|
||||||
} else {
|
} else {
|
||||||
calculationStore.setValidation('tbxLastPaymentPerc', undefined);
|
calculationStore.setValidation('tbxLastPaymentPerc', undefined);
|
||||||
@ -551,10 +551,10 @@ const reactionEffects: IReactionEffect[] = [
|
|||||||
calculationStore.setValidation('tbxLastPaymentPerc', false);
|
calculationStore.setValidation('tbxLastPaymentPerc', false);
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Ошибка',
|
message: 'Ошибка',
|
||||||
description:
|
description:
|
||||||
'При балансе лизингодатель последний платеж не может быть меньше 1%! Увеличьте значение.',
|
'При балансе лизингодатель последний платеж не может быть меньше 1%! Увеличьте значение.',
|
||||||
})();
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -562,10 +562,10 @@ const reactionEffects: IReactionEffect[] = [
|
|||||||
calculationStore.setValidation('tbxLastPaymentPerc', false);
|
calculationStore.setValidation('tbxLastPaymentPerc', false);
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Ошибка',
|
message: 'Ошибка',
|
||||||
description:
|
description:
|
||||||
'Последний платеж не может быть равен 0. Увеличьте значение',
|
'Последний платеж не может быть равен 0. Увеличьте значение',
|
||||||
})();
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -141,10 +141,10 @@ export default [
|
|||||||
});
|
});
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'info',
|
type: 'info',
|
||||||
title: 'Внимание!',
|
message: 'Внимание!',
|
||||||
description:
|
description:
|
||||||
'Срок страхования КАСКО изменен на 12 месяцев, т.к. оформляется Однолетний полис',
|
'Срок страхования КАСКО изменен на 12 месяцев, т.к. оформляется Однолетний полис',
|
||||||
})();
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
@ -277,9 +277,9 @@ export default [
|
|||||||
|
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Ошибка во время расчета графика',
|
message: 'Ошибка во время расчета графика',
|
||||||
description: 'Укажите стоимость КАСКО',
|
description: 'Укажите стоимость КАСКО',
|
||||||
})();
|
});
|
||||||
} else {
|
} else {
|
||||||
calculationStore.setTableRow('tableInsurance', rows =>
|
calculationStore.setTableRow('tableInsurance', rows =>
|
||||||
rows.findIndex(x => x.policyType?.value === 'КАСКО'),
|
rows.findIndex(x => x.policyType?.value === 'КАСКО'),
|
||||||
@ -322,9 +322,9 @@ export default [
|
|||||||
});
|
});
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Ошибка во время расчета графика',
|
message: 'Ошибка во время расчета графика',
|
||||||
description: 'Укажите стоимость КАСКО, включаемую в график',
|
description: 'Укажите стоимость КАСКО, включаемую в график',
|
||||||
})();
|
});
|
||||||
} else {
|
} else {
|
||||||
calculationStore.setTableRow('tableInsurance', rows =>
|
calculationStore.setTableRow('tableInsurance', rows =>
|
||||||
rows.findIndex(x => x.policyType?.value === 'КАСКО'),
|
rows.findIndex(x => x.policyType?.value === 'КАСКО'),
|
||||||
@ -371,9 +371,9 @@ export default [
|
|||||||
});
|
});
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Ошибка во время расчета графика',
|
message: 'Ошибка во время расчета графика',
|
||||||
description: 'Укажите стоимость ОСАГО, включаемую в график',
|
description: 'Укажите стоимость ОСАГО, включаемую в график',
|
||||||
})();
|
});
|
||||||
} else {
|
} else {
|
||||||
calculationStore.setTableRow('tableInsurance', rows =>
|
calculationStore.setTableRow('tableInsurance', rows =>
|
||||||
rows.findIndex(x => x.policyType?.value === 'ОСАГО'),
|
rows.findIndex(x => x.policyType?.value === 'ОСАГО'),
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
import { getValueName } from 'client/Containers/Calculation/Elements/tools';
|
import { getValueName } from 'client/Containers/Calculation/Elements/tools';
|
||||||
import { ElementsNames } from 'client/Containers/Calculation/types/elements';
|
import { ElementsNames } from 'client/Containers/Calculation/types/elements';
|
||||||
import { openNotification } from 'client/Elements/Notification';
|
import { openNotification } from 'client/Elements/Notification';
|
||||||
@ -60,9 +59,9 @@ export function showValidationMessages(
|
|||||||
if (message)
|
if (message)
|
||||||
openNotification({
|
openNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title,
|
message: title,
|
||||||
description: message,
|
description: message,
|
||||||
})();
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return { hasMessages };
|
return { hasMessages };
|
||||||
|
|||||||
Reference in New Issue
Block a user