404 lines
7.3 KiB
TypeScript
404 lines
7.3 KiB
TypeScript
import { MAX_FRANCHISE } from 'constants/values';
|
|
import DownloadOutlined from 'Elements/icons/DownloadOutlined';
|
|
import date from 'tools/date';
|
|
import { formatMoney, formatNumber } from 'tools/format';
|
|
import { pipe } from 'tools/function';
|
|
import { round } from 'tools/number';
|
|
import type { ElementsProps } from '../types/elements-props';
|
|
|
|
const props: Partial<ElementsProps> = {
|
|
tbxLeaseObjectPrice: {
|
|
min: 0,
|
|
max: 1_000_000_000,
|
|
step: 10_000,
|
|
precision: 2,
|
|
formatter: formatNumber,
|
|
},
|
|
tbxLeaseObjectPriceWthtVAT: {
|
|
min: 0,
|
|
max: 1_000_000_000,
|
|
step: 10_000,
|
|
precision: 2,
|
|
formatter: formatNumber,
|
|
},
|
|
tbxVATInLeaseObjectPrice: {
|
|
min: 0,
|
|
max: 1_000_000_000,
|
|
step: 10_000,
|
|
precision: 2,
|
|
formatter: formatNumber,
|
|
},
|
|
tbxEngineHours: {
|
|
min: 0,
|
|
step: 10,
|
|
precision: 2,
|
|
formatter: formatNumber,
|
|
},
|
|
tbxSupplierDiscountRub: {
|
|
min: 0,
|
|
max: 1_000_000_000,
|
|
step: 10_000,
|
|
precision: 2,
|
|
formatter: formatNumber,
|
|
},
|
|
tbxSupplierDiscountPerc: {
|
|
min: 0,
|
|
max: 100,
|
|
precision: 2,
|
|
formatter: formatNumber,
|
|
},
|
|
radioBalanceHolder: {
|
|
optionType: 'button',
|
|
buttonStyle: 'solid',
|
|
},
|
|
tbxSaleBonus: {
|
|
min: 0,
|
|
// max: 1.30,
|
|
step: 0.1,
|
|
precision: 2,
|
|
formatter: formatNumber,
|
|
},
|
|
tbxFirstPaymentPerc: {
|
|
min: 0,
|
|
max: 50,
|
|
precision: 4,
|
|
formatter: formatNumber,
|
|
},
|
|
tbxFirstPaymentRub: {
|
|
min: 0,
|
|
max: 1_000_000_000,
|
|
step: 10_000,
|
|
precision: 2,
|
|
formatter: formatNumber,
|
|
},
|
|
tbxLastPaymentPerc: {
|
|
min: 0,
|
|
max: 70,
|
|
step: 1,
|
|
precision: 6,
|
|
formatter: formatNumber,
|
|
},
|
|
tbxLastPaymentRub: {
|
|
min: 0,
|
|
max: 1_000_000_000,
|
|
step: 10_000,
|
|
precision: 2,
|
|
formatter: formatNumber,
|
|
},
|
|
tbxRedemptionPaymentSum: {
|
|
min: 1000,
|
|
max: 2000,
|
|
step: 1000,
|
|
precision: 2,
|
|
formatter: formatNumber,
|
|
},
|
|
tbxLeasingPeriod: {
|
|
min: 13,
|
|
max: 60,
|
|
},
|
|
tbxParmentsDecreasePercent: {
|
|
min: 50,
|
|
max: 99,
|
|
},
|
|
tbxComissionPerc: {
|
|
min: 0,
|
|
max: 100,
|
|
},
|
|
tbxComissionRub: {
|
|
min: 0,
|
|
max: 1_000_000_000,
|
|
step: 10_000,
|
|
},
|
|
selectLeaseObjectType: {
|
|
showSearch: true,
|
|
},
|
|
selectBrand: {
|
|
showSearch: true,
|
|
},
|
|
selectModel: {
|
|
showSearch: true,
|
|
},
|
|
selectConfiguration: {
|
|
showSearch: true,
|
|
},
|
|
tbxLeaseObjectCount: {
|
|
min: 1,
|
|
max: 1000,
|
|
},
|
|
selectLeaseObjectUseFor: {
|
|
showSearch: true,
|
|
},
|
|
tbxLeaseObjectYear: {
|
|
min: 1994,
|
|
max: date().year(),
|
|
},
|
|
selectLeaseObjectCategory: {
|
|
showSearch: false,
|
|
},
|
|
selectEngineType: {
|
|
showSearch: true,
|
|
},
|
|
tbxLeaseObjectMotorPower: {
|
|
min: 0,
|
|
max: 20_000,
|
|
step: 10,
|
|
precision: 2,
|
|
formatter: formatNumber,
|
|
},
|
|
tbxEngineVolume: {
|
|
min: 0,
|
|
max: 99.9999,
|
|
step: 0.5,
|
|
precision: 4,
|
|
formatter: formatNumber,
|
|
},
|
|
tbxMaxMass: {
|
|
min: 0,
|
|
max: 999_999,
|
|
step: 100,
|
|
formatter: formatNumber,
|
|
},
|
|
tbxCountSeats: {
|
|
min: 0,
|
|
max: 2000,
|
|
},
|
|
tbxMaxSpeed: {
|
|
min: 0,
|
|
max: 2000,
|
|
},
|
|
selectDealer: {
|
|
showSearch: true,
|
|
},
|
|
tbxDealerRewardSumm: {
|
|
min: 0,
|
|
max: 20,
|
|
step: 0.1,
|
|
precision: 2,
|
|
formatter: formatNumber,
|
|
},
|
|
tbxDealerBrokerRewardSumm: {
|
|
min: 0,
|
|
max: 20,
|
|
step: 0.1,
|
|
precision: 2,
|
|
formatter: formatNumber,
|
|
},
|
|
tbxIndAgentRewardSumm: {
|
|
min: 0,
|
|
max: 20,
|
|
step: 0.1,
|
|
precision: 2,
|
|
formatter: formatNumber,
|
|
},
|
|
tbxCalcDoubleAgentRewardSumm: {
|
|
min: 0,
|
|
max: 20,
|
|
step: 0.1,
|
|
precision: 2,
|
|
formatter: formatNumber,
|
|
},
|
|
tbxCalcBrokerRewardSum: {
|
|
min: 0,
|
|
max: 20,
|
|
step: 0.1,
|
|
precision: 2,
|
|
formatter: formatNumber,
|
|
},
|
|
tbxFinDepartmentRewardSumm: {
|
|
min: 0,
|
|
max: 20,
|
|
step: 0.1,
|
|
precision: 2,
|
|
formatter: formatNumber,
|
|
},
|
|
radioInsKaskoType: {
|
|
optionType: 'button',
|
|
buttonStyle: 'solid',
|
|
},
|
|
tbxInsFranchise: {
|
|
min: 0,
|
|
max: MAX_FRANCHISE,
|
|
step: 10_000,
|
|
precision: 2,
|
|
formatter: formatNumber,
|
|
},
|
|
tbxInsAgeDrivers: {
|
|
// min: 18,
|
|
// max: 99,
|
|
},
|
|
tbxInsExpDrivers: {
|
|
// min: 0,
|
|
// max: 99,
|
|
},
|
|
selectRegionRegistration: {
|
|
showSearch: true,
|
|
},
|
|
selectTownRegistration: {
|
|
showSearch: true,
|
|
},
|
|
radioQuoteContactGender: {
|
|
optionType: 'button',
|
|
buttonStyle: 'solid',
|
|
},
|
|
btnCreateKP: {
|
|
type: 'primary',
|
|
text: 'Создать КП',
|
|
},
|
|
tbxCreditRate: {
|
|
min: 0,
|
|
max: 99.99,
|
|
step: 0.1,
|
|
},
|
|
tbxMaxPriceChange: {
|
|
min: 0,
|
|
max: 34_999_990,
|
|
step: 10_000,
|
|
},
|
|
tbxMinPriceChange: {
|
|
min: 0,
|
|
max: 34_999_990,
|
|
step: 10_000,
|
|
},
|
|
tbxImporterRewardPerc: {
|
|
min: 0,
|
|
max: 99.99,
|
|
step: 0.1,
|
|
precision: 2,
|
|
},
|
|
tbxImporterRewardRub: {
|
|
min: 0,
|
|
max: 1_000_000_000,
|
|
step: 10_000,
|
|
precision: 2,
|
|
},
|
|
selectLead: {
|
|
showSearch: true,
|
|
},
|
|
selectOpportunity: {
|
|
showSearch: true,
|
|
},
|
|
selectQuote: {
|
|
showSearch: true,
|
|
},
|
|
btnCalculate: {
|
|
text: 'Рассчитать график',
|
|
type: 'primary',
|
|
},
|
|
tbxIRR_Perc: {
|
|
min: 0,
|
|
max: 500,
|
|
step: 0.0001,
|
|
precision: 6,
|
|
formatter: formatNumber,
|
|
},
|
|
linkDownloadKp: {
|
|
type: 'primary',
|
|
text: 'Скачать КП',
|
|
icon: DownloadOutlined,
|
|
},
|
|
tbxMileage: {
|
|
min: 0,
|
|
step: 100,
|
|
precision: 2,
|
|
formatter: formatNumber,
|
|
},
|
|
cbxRecalcWithRevision: {
|
|
text: 'Пересчет без пересмотра',
|
|
style: {
|
|
marginBottom: '8px',
|
|
},
|
|
},
|
|
radioCalcType: {
|
|
optionType: 'button',
|
|
buttonStyle: 'solid',
|
|
},
|
|
tbxTotalPayments: {
|
|
min: 0,
|
|
step: 1000,
|
|
precision: 2,
|
|
formatter: formatNumber,
|
|
},
|
|
tbxVehicleTaxInYear: {
|
|
min: 0,
|
|
step: 100,
|
|
max: 9_999_999,
|
|
precision: 2,
|
|
},
|
|
tbxVehicleTaxInLeasingPeriod: {
|
|
min: 0,
|
|
step: 100,
|
|
max: 9_999_999,
|
|
precision: 2,
|
|
},
|
|
selectObjectRegionRegistration: {
|
|
showSearch: true,
|
|
},
|
|
tbxInsKaskoPriceLeasePeriod: {
|
|
min: 0,
|
|
precision: 2,
|
|
formatter: formatNumber,
|
|
readOnly: true,
|
|
controls: false,
|
|
},
|
|
selectLegalClientRegion: {
|
|
showSearch: true,
|
|
},
|
|
selectLegalClientTown: {
|
|
showSearch: true,
|
|
},
|
|
radioInfuranceOPF: {
|
|
optionType: 'button',
|
|
buttonStyle: 'solid',
|
|
},
|
|
radioGraphType: {
|
|
spaceProps: {
|
|
direction: 'vertical',
|
|
},
|
|
},
|
|
};
|
|
|
|
const moneyResultElementsProps = Object.fromEntries(
|
|
(
|
|
[
|
|
'labelResultTotalGraphwithNDS',
|
|
'labelResultPlPrice',
|
|
'labelResultInsKasko',
|
|
'labelResultInsOsago',
|
|
'labelResultDopProdSum',
|
|
'labelResultFirstPayment',
|
|
'labelResultLastPayment',
|
|
'labelResultAB_FL',
|
|
'labelResultAB_UL',
|
|
'labelResultBonusMPL',
|
|
'labelResultDopMPLLeasing',
|
|
'labelResultBonusDopProd',
|
|
'labelSubsidySum',
|
|
'labelResultBonusSafeFinance',
|
|
] as (keyof ElementsProps)[]
|
|
).map((a) => [
|
|
a,
|
|
{
|
|
middleware: (value: number) => pipe(round, formatMoney)(value),
|
|
},
|
|
])
|
|
);
|
|
|
|
const numberResultElementsProps = Object.fromEntries(
|
|
(
|
|
[
|
|
'labelResultPriceUpPr',
|
|
'labelResultIRRGraphPerc',
|
|
'labelResultIRRNominalPerc',
|
|
'labelResultTerm',
|
|
'labelResultFirstPaymentRiskPolicy',
|
|
] as (keyof ElementsProps)[]
|
|
).map((a) => [
|
|
a,
|
|
{
|
|
middleware: (value: number) => pipe(round)(value),
|
|
},
|
|
])
|
|
);
|
|
|
|
export default Object.assign(props, moneyResultElementsProps, numberResultElementsProps);
|