bdc360f: поправили
This commit is contained in:
parent
aab9045460
commit
81a10296a9
@ -46,6 +46,30 @@ export const selectHighSeasonStart = Array.from(
|
||||
})
|
||||
);
|
||||
|
||||
export const radioGraphType = [
|
||||
{
|
||||
label: 'аннуитет',
|
||||
value: 100_000_000,
|
||||
},
|
||||
{
|
||||
label: 'дегрессия (ступенчатая)',
|
||||
value: 100_000_001,
|
||||
},
|
||||
{
|
||||
label: 'равноубывающий',
|
||||
value: 100_000_002,
|
||||
},
|
||||
{
|
||||
label: 'сезонный',
|
||||
value: 100_000_003,
|
||||
},
|
||||
{
|
||||
label: 'легкий старт',
|
||||
value: 100_000_004,
|
||||
disabled: true,
|
||||
},
|
||||
];
|
||||
|
||||
const defaultOptions: CalculationOptions = {
|
||||
radioLastPaymentRule: [
|
||||
{
|
||||
@ -73,28 +97,7 @@ const defaultOptions: CalculationOptions = {
|
||||
},
|
||||
],
|
||||
|
||||
radioGraphType: [
|
||||
{
|
||||
label: 'аннуитет',
|
||||
value: 100_000_000,
|
||||
},
|
||||
{
|
||||
label: 'дегрессия (ступенчатая)',
|
||||
value: 100_000_001,
|
||||
},
|
||||
{
|
||||
label: 'равноубывающий',
|
||||
value: 100_000_002,
|
||||
},
|
||||
{
|
||||
label: 'сезонный',
|
||||
value: 100_000_003,
|
||||
},
|
||||
{
|
||||
label: 'легкий старт',
|
||||
value: 100_000_004,
|
||||
},
|
||||
],
|
||||
radioGraphType,
|
||||
|
||||
selectSeasonType,
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { gql } from '@apollo/client';
|
||||
import { selectSeasonType } from 'config/default-options';
|
||||
import { radioGraphType, selectSeasonType } from 'config/default-options';
|
||||
import dayjs from 'dayjs';
|
||||
import utc from 'dayjs/plugin/utc';
|
||||
import type * as CRMTypes from 'graphql/crm.types';
|
||||
@ -323,15 +323,15 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex
|
||||
({ evo_tarif } = data);
|
||||
}
|
||||
|
||||
const filteredGraphTypes = $calculation
|
||||
.element('radioGraphType')
|
||||
.getOptions()
|
||||
.map((type) => ({
|
||||
...type,
|
||||
disabled: evo_tarif?.evo_graphtype_exception?.includes(type.value),
|
||||
}));
|
||||
if (evo_tarif?.evo_graphtype_exception?.length) {
|
||||
const filteredGraphTypes = radioGraphType.filter(
|
||||
(type) => !evo_tarif?.evo_graphtype_exception?.includes(type.value)
|
||||
);
|
||||
|
||||
$calculation.element('radioGraphType').setOptions(filteredGraphTypes);
|
||||
$calculation.element('radioGraphType').setOptions(filteredGraphTypes);
|
||||
} else {
|
||||
$calculation.element('radioGraphType').resetOptions();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user