Calculation/Form: add AddProduct tab
This commit is contained in:
parent
e18a6b92d7
commit
37b9add533
32
Components/Calculation/Form/AddProduct/config.ts
Normal file
32
Components/Calculation/Form/AddProduct/config.ts
Normal file
@ -0,0 +1,32 @@
|
||||
/* eslint-disable object-curly-newline */
|
||||
import type { FormTabRows } from '../../lib/render-rows';
|
||||
|
||||
export const id = 'add-product';
|
||||
export const title = 'Доп. продукты';
|
||||
|
||||
export const rows: FormTabRows = [
|
||||
{
|
||||
title: 'Регистрация',
|
||||
},
|
||||
[['radioObjectRegistration', 'radioTypePTS']],
|
||||
[['selectRegionRegistration', 'selectTownRegistration', 'selectObjectRegionRegistration']],
|
||||
[['tbxLeaseObjectYear', 'tbxLeaseObjectMotorPower', 'tbxVehicleTaxInYear']],
|
||||
[['selectObjectCategoryTax', 'selectObjectTypeTax', 'tbxVehicleTaxInLeasingPeriod']],
|
||||
[
|
||||
['selectRegistration'],
|
||||
{
|
||||
gridTemplateColumns: '1fr',
|
||||
},
|
||||
],
|
||||
[
|
||||
['labelRegistrationDescription'],
|
||||
{
|
||||
gridTemplateColumns: '1fr',
|
||||
},
|
||||
],
|
||||
{
|
||||
title: 'Доп. продукты',
|
||||
},
|
||||
[['selectTechnicalCard', 'selectInsNSIB'], { gridTemplateColumns: '1fr 2fr' }],
|
||||
[['selectRequirementTelematic', 'selectTracker', 'selectTelematic']],
|
||||
];
|
||||
12
Components/Calculation/Form/AddProduct/index.jsx
Normal file
12
Components/Calculation/Form/AddProduct/index.jsx
Normal file
@ -0,0 +1,12 @@
|
||||
import renderFormRows from 'Components/Calculation/lib/render-rows';
|
||||
import { id, rows, title } from './config';
|
||||
|
||||
function Insurance() {
|
||||
return renderFormRows(rows);
|
||||
}
|
||||
|
||||
export default {
|
||||
id,
|
||||
title,
|
||||
Component: Insurance,
|
||||
};
|
||||
@ -1,12 +1,13 @@
|
||||
import Background from 'Elements/layout/Background';
|
||||
import { Tabs, Wrapper } from 'Elements/layout/Tabs';
|
||||
import AddProduct from './AddProduct';
|
||||
import Insurance from './Insurance';
|
||||
import Leasing from './Leasing';
|
||||
import LeasingObject from './LeasingObject';
|
||||
import Payments from './Payments';
|
||||
import SupplierAgent from './SupplierAgent';
|
||||
|
||||
const formTabs = [Leasing, Payments, LeasingObject, SupplierAgent, Insurance];
|
||||
const formTabs = [Leasing, Payments, LeasingObject, SupplierAgent, Insurance, AddProduct];
|
||||
|
||||
function Form() {
|
||||
return (
|
||||
|
||||
@ -123,7 +123,7 @@ const builders: Record<keyof typeof components, any> = {
|
||||
radioDeliveryTime: buildOptions,
|
||||
radioInsKaskoType: buildOptions,
|
||||
radioInfuranceOPF: buildOptions,
|
||||
radioRequirementTelematic: buildOptions,
|
||||
selectRequirementTelematic: buildOptions,
|
||||
radioQuoteContactGender: buildOptions,
|
||||
radioCalcType: buildOptions,
|
||||
radioObjectRegistration: buildOptions,
|
||||
|
||||
@ -91,7 +91,7 @@ const components: Record<
|
||||
radioInfuranceOPF: Radio,
|
||||
selectRegistration: Select,
|
||||
selectInsNSIB: Select,
|
||||
radioRequirementTelematic: Radio,
|
||||
selectRequirementTelematic: Select,
|
||||
selectTracker: Select,
|
||||
selectTelematic: Select,
|
||||
selectTechnicalCard: Select,
|
||||
|
||||
@ -355,6 +355,11 @@ const props: Partial<ElementsProps> = {
|
||||
direction: 'vertical',
|
||||
},
|
||||
},
|
||||
selectRequirementTelematic: {
|
||||
spaceProps: {
|
||||
direction: 'vertical',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const moneyResultElementsProps = Object.fromEntries(
|
||||
|
||||
@ -100,7 +100,7 @@ const titles: Record<ValuesElements | ComputedElements | ActionElements, string>
|
||||
selectRegistration: 'Регистрация',
|
||||
selectInsNSIB: 'НСИБ',
|
||||
selectTechnicalCard: 'Карта техпомощи',
|
||||
radioRequirementTelematic: 'Программа средства контроля',
|
||||
selectRequirementTelematic: 'Программа средства контроля',
|
||||
selectTelematic: 'Телематика ',
|
||||
selectTracker: 'Маяк',
|
||||
tbxMileage: 'Пробег, км',
|
||||
|
||||
@ -106,7 +106,7 @@ const elementsToValues = wrapElementsMap({
|
||||
selectRegistration: 'registration',
|
||||
selectInsNSIB: 'insNSIB',
|
||||
selectTechnicalCard: 'technicalCard',
|
||||
radioRequirementTelematic: 'requirementTelematic',
|
||||
selectRequirementTelematic: 'requirementTelematic',
|
||||
selectTelematic: 'telematic',
|
||||
selectTracker: 'tracker',
|
||||
tbxMileage: 'mileage',
|
||||
|
||||
@ -85,7 +85,7 @@ export interface ElementsProps {
|
||||
radioInfuranceOPF: RadioProps;
|
||||
selectRegistration: SelectProps;
|
||||
selectInsNSIB: SelectProps;
|
||||
radioRequirementTelematic: RadioProps;
|
||||
selectRequirementTelematic: SelectProps;
|
||||
selectTracker: SelectProps;
|
||||
selectTelematic: SelectProps;
|
||||
selectTechnicalCard: SelectProps;
|
||||
|
||||
@ -273,7 +273,7 @@ const defaultOptions: Partial<CalculationOptions> = {
|
||||
},
|
||||
],
|
||||
|
||||
radioRequirementTelematic: [
|
||||
selectRequirementTelematic: [
|
||||
{
|
||||
label: 'Не требуется',
|
||||
value: 100_000_004,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user