Form/Leasing: beautify & new fields
This commit is contained in:
parent
adfe323eae
commit
124a59b06b
@ -10,6 +10,8 @@ export const rows: FormTabRows = [
|
||||
[['selectSupplierCurrency', 'tbxSupplierDiscountRub', 'tbxSupplierDiscountPerc']],
|
||||
[['tbxFirstPaymentPerc', 'tbxFirstPaymentRub']],
|
||||
[['tbxLeasingPeriod', 'tbxSaleBonus', 'tbxRedemptionPaymentSum']],
|
||||
[['selectSubsidy', 'labelSubsidySum']],
|
||||
[['tbxLastPaymentPerc', 'tbxLastPaymentRub', 'radioLastPaymentRule']],
|
||||
[['selectSubsidy', 'tbxSubsidySum']],
|
||||
[['selectImportProgram', 'tbxImportProgramSum', 'tbxAddEquipmentPrice']],
|
||||
[['radioLastPaymentRule'], { gridTemplateColumns: '1fr' }],
|
||||
[['tbxLastPaymentPerc', 'tbxLastPaymentRub']],
|
||||
];
|
||||
|
||||
@ -20,6 +20,9 @@ const builders = wrapElementsBuilders({
|
||||
tbxFirstPaymentRub: buildValue,
|
||||
tbxLastPaymentPerc: buildValue,
|
||||
tbxLastPaymentRub: buildValue,
|
||||
selectImportProgram: buildOptions,
|
||||
tbxImportProgramSum: buildReadonly,
|
||||
tbxAddEquipmentPrice: buildValue,
|
||||
tbxRedemptionPaymentSum: buildValue,
|
||||
tbxParmentsDecreasePercent: buildValue,
|
||||
tbxComissionPerc: buildValue,
|
||||
@ -133,7 +136,7 @@ const builders = wrapElementsBuilders({
|
||||
labelIrrInfo: buildReadonly,
|
||||
labelRegistrationDescription: buildReadonly,
|
||||
labelDepreciationGroup: buildReadonly,
|
||||
labelSubsidySum: buildReadonly,
|
||||
tbxSubsidySum: buildReadonly,
|
||||
|
||||
btnCreateKP: buildAction,
|
||||
btnCalculate: buildAction,
|
||||
|
||||
@ -30,9 +30,12 @@ const components = wrapComponentsMap({
|
||||
tbxSaleBonus: InputNumber,
|
||||
tbxFirstPaymentPerc: InputNumber,
|
||||
tbxFirstPaymentRub: InputNumber,
|
||||
radioLastPaymentRule: Radio,
|
||||
radioLastPaymentRule: Segmented,
|
||||
tbxLastPaymentPerc: InputNumber,
|
||||
tbxLastPaymentRub: InputNumber,
|
||||
selectImportProgram: Select,
|
||||
tbxImportProgramSum: InputNumber,
|
||||
tbxAddEquipmentPrice: InputNumber,
|
||||
tbxRedemptionPaymentSum: InputNumber,
|
||||
tbxLeasingPeriod: InputNumber,
|
||||
radioGraphType: Radio,
|
||||
@ -142,7 +145,7 @@ const components = wrapComponentsMap({
|
||||
labelIrrInfo: Text,
|
||||
labelRegistrationDescription: Text,
|
||||
labelDepreciationGroup: Text,
|
||||
labelSubsidySum: InputNumber,
|
||||
tbxSubsidySum: InputNumber,
|
||||
|
||||
/** Button Elements */
|
||||
btnCreateKP: Button,
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import { MAX_FRANCHISE, MAX_LEASING_PERIOD } from 'constants/values';
|
||||
import DownloadOutlined from 'Elements/icons/DownloadOutlined';
|
||||
import date from 'tools/date';
|
||||
import { formatNumber } from 'tools/format';
|
||||
import type { ElementsProps } from './elements-components';
|
||||
|
||||
const props: Partial<ElementsProps> = {
|
||||
@ -10,40 +9,38 @@ const props: Partial<ElementsProps> = {
|
||||
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,
|
||||
|
||||
addonBefore: '₽',
|
||||
},
|
||||
tbxSupplierDiscountPerc: {
|
||||
min: 0,
|
||||
max: 100,
|
||||
precision: 2,
|
||||
formatter: formatNumber,
|
||||
|
||||
addonBefore: '%',
|
||||
},
|
||||
radioBalanceHolder: {
|
||||
optionType: 'button',
|
||||
@ -54,50 +51,70 @@ const props: Partial<ElementsProps> = {
|
||||
// max: 1.30,
|
||||
step: 0.1,
|
||||
precision: 2,
|
||||
formatter: formatNumber,
|
||||
|
||||
addonBefore: '%',
|
||||
},
|
||||
radioLastPaymentRule: {
|
||||
spaceProps: {
|
||||
direction: 'vertical',
|
||||
},
|
||||
block: true,
|
||||
},
|
||||
tbxFirstPaymentPerc: {
|
||||
min: 0,
|
||||
max: 50,
|
||||
precision: 4,
|
||||
formatter: formatNumber,
|
||||
|
||||
addonBefore: '%',
|
||||
},
|
||||
tbxFirstPaymentRub: {
|
||||
min: 0,
|
||||
max: 1_000_000_000,
|
||||
step: 10_000,
|
||||
precision: 2,
|
||||
formatter: formatNumber,
|
||||
|
||||
addonBefore: '₽',
|
||||
},
|
||||
tbxLastPaymentPerc: {
|
||||
min: 0,
|
||||
max: 70,
|
||||
step: 1,
|
||||
precision: 6,
|
||||
formatter: formatNumber,
|
||||
|
||||
addonBefore: '%',
|
||||
},
|
||||
tbxLastPaymentRub: {
|
||||
min: 0,
|
||||
max: 1_000_000_000,
|
||||
step: 10_000,
|
||||
precision: 2,
|
||||
formatter: formatNumber,
|
||||
|
||||
addonBefore: '₽',
|
||||
},
|
||||
tbxRedemptionPaymentSum: {
|
||||
min: 1000,
|
||||
max: 2000,
|
||||
step: 1000,
|
||||
precision: 2,
|
||||
formatter: formatNumber,
|
||||
|
||||
addonBefore: '₽',
|
||||
},
|
||||
tbxLeasingPeriod: {
|
||||
min: 13,
|
||||
max: MAX_LEASING_PERIOD,
|
||||
addonAfter: 'мес.',
|
||||
},
|
||||
tbxSubsidySum: {
|
||||
min: 0,
|
||||
precision: 2,
|
||||
addonBefore: '₽',
|
||||
},
|
||||
tbxImportProgramSum: {
|
||||
min: 0,
|
||||
precision: 2,
|
||||
addonBefore: '₽',
|
||||
},
|
||||
tbxAddEquipmentPrice: {
|
||||
min: 0,
|
||||
precision: 2,
|
||||
addonBefore: '₽',
|
||||
},
|
||||
tbxParmentsDecreasePercent: {
|
||||
min: 50,
|
||||
@ -146,20 +163,17 @@ const props: Partial<ElementsProps> = {
|
||||
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,
|
||||
@ -177,42 +191,36 @@ const props: Partial<ElementsProps> = {
|
||||
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',
|
||||
@ -223,7 +231,6 @@ const props: Partial<ElementsProps> = {
|
||||
max: MAX_FRANCHISE,
|
||||
step: 10_000,
|
||||
precision: 2,
|
||||
formatter: formatNumber,
|
||||
},
|
||||
tbxInsAgeDrivers: {
|
||||
// min: 18,
|
||||
@ -292,7 +299,6 @@ const props: Partial<ElementsProps> = {
|
||||
max: 500,
|
||||
step: 0.0001,
|
||||
precision: 6,
|
||||
formatter: formatNumber,
|
||||
},
|
||||
linkDownloadKp: {
|
||||
type: 'primary',
|
||||
@ -303,7 +309,6 @@ const props: Partial<ElementsProps> = {
|
||||
min: 0,
|
||||
step: 100,
|
||||
precision: 2,
|
||||
formatter: formatNumber,
|
||||
},
|
||||
cbxRecalcWithRevision: {
|
||||
text: 'Пересчет без пересмотра',
|
||||
@ -315,7 +320,6 @@ const props: Partial<ElementsProps> = {
|
||||
min: 0,
|
||||
step: 1000,
|
||||
precision: 2,
|
||||
formatter: formatNumber,
|
||||
},
|
||||
tbxVehicleTaxInYear: {
|
||||
min: 0,
|
||||
@ -335,7 +339,7 @@ const props: Partial<ElementsProps> = {
|
||||
tbxInsKaskoPriceLeasePeriod: {
|
||||
min: 0,
|
||||
precision: 2,
|
||||
formatter: formatNumber,
|
||||
|
||||
readOnly: true,
|
||||
controls: false,
|
||||
},
|
||||
|
||||
@ -10,16 +10,19 @@ const titles: Record<ValuesElements | ActionElements, string> = {
|
||||
selectClientRisk: 'Риск клиента',
|
||||
selectClientType: 'Тип клиента',
|
||||
tbxLeaseObjectPrice: 'Стоимость ПЛ с НДС',
|
||||
selectSupplierCurrency: 'Валюта поставщика',
|
||||
tbxSupplierDiscountRub: 'Скидка от поставщика',
|
||||
tbxSupplierDiscountPerc: 'Скидка от поставщика, %',
|
||||
tbxLeasingPeriod: 'Срок лизинга, мес',
|
||||
tbxFirstPaymentPerc: 'Первый платеж, %',
|
||||
tbxFirstPaymentRub: 'Первый платеж, руб.',
|
||||
tbxLastPaymentPerc: 'Последний платеж, %',
|
||||
tbxLastPaymentRub: 'Последний платеж, руб.',
|
||||
selectSupplierCurrency: 'Валюта поставщика (ДКП)',
|
||||
tbxSupplierDiscountRub: 'Сумма скидки от поставщика',
|
||||
tbxSupplierDiscountPerc: 'Размер скидки от поставщика',
|
||||
tbxLeasingPeriod: 'Срок лизинга',
|
||||
tbxFirstPaymentPerc: 'Размер первого платежа',
|
||||
tbxFirstPaymentRub: 'Сумма первого платежа',
|
||||
tbxLastPaymentPerc: 'Размер последнего платежа',
|
||||
tbxLastPaymentRub: 'Сумма последнего платежа',
|
||||
radioLastPaymentRule: 'Последний платеж',
|
||||
tbxRedemptionPaymentSum: 'Сумма выкупного платежа, руб',
|
||||
selectImportProgram: 'Программа от производителя',
|
||||
tbxImportProgramSum: 'Сумма скидки от производителя',
|
||||
tbxAddEquipmentPrice: 'Стоимость доп.оборудования',
|
||||
tbxRedemptionPaymentSum: 'Сумма выкупного платежа',
|
||||
radioBalanceHolder: 'Балансодержатель',
|
||||
radioGraphType: 'Вид графика',
|
||||
tbxParmentsDecreasePercent: 'Процент убывания платежей',
|
||||
@ -133,7 +136,7 @@ const titles: Record<ValuesElements | ActionElements, string> = {
|
||||
labelRegistrationDescription: 'Описание регистрации',
|
||||
tbxInsKaskoPriceLeasePeriod: 'Стоимость страховки КАСКО на весь срок',
|
||||
labelDepreciationGroup: 'Группа обесценения',
|
||||
labelSubsidySum: 'Сумма субсидии с НДС',
|
||||
tbxSubsidySum: 'Сумма субсидии',
|
||||
|
||||
/** Action Elements */
|
||||
btnCalculate: '',
|
||||
|
||||
@ -25,6 +25,9 @@ const elementsToValues = wrapElementsMap({
|
||||
tbxLastPaymentPerc: 'lastPaymentPerc',
|
||||
tbxLastPaymentRub: 'lastPaymentRub',
|
||||
radioLastPaymentRule: 'lastPaymentRule',
|
||||
selectImportProgram: 'importProgram',
|
||||
tbxImportProgramSum: 'importProgramSum',
|
||||
tbxAddEquipmentPrice: 'addEquipmentPrice',
|
||||
tbxRedemptionPaymentSum: 'redemptionPaymentSum',
|
||||
radioBalanceHolder: 'balanceHolder',
|
||||
radioGraphType: 'graphType',
|
||||
@ -121,7 +124,7 @@ const elementsToValues = wrapElementsMap({
|
||||
selectLegalClientRegion: 'legalClientRegion',
|
||||
selectLegalClientTown: 'legalClientTown',
|
||||
selectSubsidy: 'subsidy',
|
||||
labelSubsidySum: 'subsidySum',
|
||||
tbxSubsidySum: 'subsidySum',
|
||||
selectFuelCard: 'fuelCard',
|
||||
tbxMinPriceChange: 'minPriceChange',
|
||||
|
||||
|
||||
@ -44,7 +44,7 @@ const moneyFormatters = Object.fromEntries(
|
||||
'resultBonusMPL',
|
||||
'resultDopMPLLeasing',
|
||||
'resultBonusDopProd',
|
||||
'labelSubsidySum',
|
||||
'tbxSubsidySum',
|
||||
'resultBonusSafeFinance',
|
||||
'resultPriceUpPr',
|
||||
] as Values[]
|
||||
|
||||
@ -4,16 +4,16 @@ import type { CalculationOptions } from 'stores/calculation/options/types';
|
||||
const defaultOptions: CalculationOptions = {
|
||||
radioLastPaymentRule: [
|
||||
{
|
||||
label: 'равен платежу',
|
||||
value: 100_000_002,
|
||||
label: 'в процентах',
|
||||
value: 100_000_001,
|
||||
},
|
||||
{
|
||||
label: 'в рублях',
|
||||
value: 100_000_000,
|
||||
},
|
||||
{
|
||||
label: 'в процентах',
|
||||
value: 100_000_001,
|
||||
label: 'равен платежу',
|
||||
value: 100_000_002,
|
||||
},
|
||||
],
|
||||
|
||||
@ -488,10 +488,20 @@ const defaultOptions: CalculationOptions = {
|
||||
selectLegalClientRegion: [],
|
||||
selectLegalClientTown: [],
|
||||
selectSubsidy: [],
|
||||
labelSubsidySum: [],
|
||||
tbxSubsidySum: [],
|
||||
selectFuelCard: [],
|
||||
tbxMinPriceChange: [],
|
||||
linkDownloadKp: [],
|
||||
selectImportProgram: [],
|
||||
tbxImportProgramSum: [],
|
||||
tbxAddEquipmentPrice: [],
|
||||
labelLeaseObjectRisk: [],
|
||||
tbxInsKaskoPriceLeasePeriod: [],
|
||||
labelIrrInfo: [],
|
||||
labelRegistrationDescription: [],
|
||||
linkLeadUrl: [],
|
||||
linkOpportunityUrl: [],
|
||||
linkQuoteUrl: [],
|
||||
};
|
||||
|
||||
export default defaultOptions;
|
||||
|
||||
@ -118,10 +118,20 @@ const defaultStatuses: CalculationStatuses = {
|
||||
selectLegalClientRegion: 'Default',
|
||||
selectLegalClientTown: 'Default',
|
||||
selectSubsidy: 'Default',
|
||||
labelSubsidySum: 'Default',
|
||||
tbxSubsidySum: 'Default',
|
||||
selectFuelCard: 'Default',
|
||||
tbxMinPriceChange: 'Default',
|
||||
linkDownloadKp: 'Default',
|
||||
selectImportProgram: 'Default',
|
||||
tbxImportProgramSum: 'Default',
|
||||
tbxAddEquipmentPrice: 'Default',
|
||||
labelLeaseObjectRisk: 'Default',
|
||||
tbxInsKaskoPriceLeasePeriod: 'Default',
|
||||
labelIrrInfo: 'Default',
|
||||
labelRegistrationDescription: 'Default',
|
||||
linkLeadUrl: 'Default',
|
||||
linkOpportunityUrl: 'Default',
|
||||
linkQuoteUrl: 'Default',
|
||||
};
|
||||
|
||||
export default defaultStatuses;
|
||||
|
||||
@ -131,6 +131,9 @@ const defaultValues: CalculationValues = {
|
||||
irrInfo: '-',
|
||||
registrationDescription: '-',
|
||||
depreciationGroup: '-',
|
||||
importProgram: null,
|
||||
importProgramSum: 0,
|
||||
addEquipmentPrice: 0,
|
||||
};
|
||||
|
||||
export default defaultValues;
|
||||
|
||||
@ -16,6 +16,9 @@ export type CalculationValues = {
|
||||
lastPaymentPerc: number;
|
||||
lastPaymentRub: number;
|
||||
lastPaymentRule: 100_000_000 | 100_000_001 | 100_000_002 | null;
|
||||
importProgram: string | null;
|
||||
importProgramSum: number;
|
||||
addEquipmentPrice: number;
|
||||
redemptionPaymentSum: number;
|
||||
balanceHolder: 100_000_000 | 100_000_001 | null;
|
||||
graphType: 100_000_000 | 100_000_001 | 100_000_002 | 100_000_003 | 100_000_004 | null;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user