diff --git a/src/client/Containers/Calculation/Sections/sectionsList.ts b/src/client/Containers/Calculation/Sections/sectionsList.ts index fecbae5..2dfb741 100644 --- a/src/client/Containers/Calculation/Sections/sectionsList.ts +++ b/src/client/Containers/Calculation/Sections/sectionsList.ts @@ -318,7 +318,7 @@ const sections: ISection[] = [ 'selectInsNSIB', 'radioRequirementTelematic', 'selectTracker', - // 'selectTelematic', + 'selectTelematic', ], }, ], diff --git a/src/client/Containers/Calculation/lib/elements/elementsProps.ts b/src/client/Containers/Calculation/lib/elements/elementsProps.ts index b994f39..81f0b0a 100644 --- a/src/client/Containers/Calculation/lib/elements/elementsProps.ts +++ b/src/client/Containers/Calculation/lib/elements/elementsProps.ts @@ -75,7 +75,7 @@ const elementsProps: TElements = { text: 'Создать интерес', }, tbxLeaseObjectPrice: { - min: '10000', + min: '1000', max: '1000000000', step: '10000.00', precision: 2, diff --git a/src/client/Containers/Calculation/lib/fetchData/queries/optionsQuery.ts b/src/client/Containers/Calculation/lib/fetchData/queries/optionsQuery.ts index d93352b..92cb6ec 100644 --- a/src/client/Containers/Calculation/lib/fetchData/queries/optionsQuery.ts +++ b/src/client/Containers/Calculation/lib/fetchData/queries/optionsQuery.ts @@ -291,6 +291,7 @@ const toOptions = [ 'selectRegistration', 'selectInsNSIB', 'selectTracker', + 'selectTelematic', 'selectTechnicalCard', 'selectTarif', 'selectRate', diff --git a/src/client/stores/CalculationStore/Effects/autorun.ts b/src/client/stores/CalculationStore/Effects/autorun.ts index 982d4fc..0ab67c3 100644 --- a/src/client/stores/CalculationStore/Effects/autorun.ts +++ b/src/client/stores/CalculationStore/Effects/autorun.ts @@ -115,6 +115,23 @@ const autorunEffects: IAutorunEffect[] = [ ); if (tracker) calculationStore.setValue('tracker', tracker.evo_addproduct_typeid); + else { + calculationStore.setValue('tracker', null); + } + } + }, + + calculationStore => () => { + const { requirementTelematic } = calculationStore.values; + if (requirementTelematic) { + const telematic = calculationStore.options.selectTelematic?.find(x => + x.evo_controls_program?.includes(requirementTelematic), + ); + if (telematic) + calculationStore.setValue('telematic', telematic.evo_addproduct_typeid); + else { + calculationStore.setValue('telematic', null); + } } }, diff --git a/src/client/stores/CalculationStore/Effects/reactions/recalcWoRevisionReactions.ts b/src/client/stores/CalculationStore/Effects/reactions/recalcWoRevisionReactions.ts index db0e557..f858c49 100644 --- a/src/client/stores/CalculationStore/Effects/reactions/recalcWoRevisionReactions.ts +++ b/src/client/stores/CalculationStore/Effects/reactions/recalcWoRevisionReactions.ts @@ -358,6 +358,25 @@ const reactionEffects: IReactionEffect[] = [ } }, }), + + calculationStore => ({ + expression: () => { + const { recalcWithRevision } = calculationStore.values; + return recalcWithRevision; + }, + effect: recalcWithRevision => { + if (!recalcWithRevision) { + calculationStore.setFilter('radioRequirementTelematic', options => + options.filter(x => x.value !== 100000003), + ); + } else { + calculationStore.setFilter('radioRequirementTelematic', undefined); + } + }, + options: { + fireImmediately: true, + }, + }), ]; const elementsToDisable: (ElementsNames | TableNames)[] = [ diff --git a/src/client/stores/CalculationStore/config/initialOptions.ts b/src/client/stores/CalculationStore/config/initialOptions.ts index 308320c..322a6a6 100644 --- a/src/client/stores/CalculationStore/config/initialOptions.ts +++ b/src/client/stores/CalculationStore/config/initialOptions.ts @@ -291,10 +291,10 @@ const initialOptions: TElements = { // name: 'COMFORT', // value: 100000002, // }, - // { - // name: 'COMFORT+', - // value: 100000003, - // }, + { + name: 'COMFORT+', + value: 100000003, + }, ], radioCalcType: [ { diff --git a/src/client/stores/CalculationStore/config/initialValues.ts b/src/client/stores/CalculationStore/config/initialValues.ts index 40e351a..ff30f1a 100644 --- a/src/client/stores/CalculationStore/config/initialValues.ts +++ b/src/client/stores/CalculationStore/config/initialValues.ts @@ -37,7 +37,7 @@ const initialValues: TValues = { maxMass: 0, countSeats: 0, maxSpeed: 0, - leaseObjectYear: 2020, + leaseObjectYear: new Date().getUTCFullYear(), engineType: 100000000, leaseObjectCategory: 100000001, leaseObjectMotorPower: 0,