fix radioCalcType
This commit is contained in:
parent
3b559561d7
commit
f86744de70
@ -184,6 +184,17 @@ export const selectLeaseObjectUseFor = alphabetical(
|
||||
'asc'
|
||||
);
|
||||
|
||||
export const radioCalcType = [
|
||||
{
|
||||
label: 'IRR',
|
||||
value: 100_000_000,
|
||||
},
|
||||
{
|
||||
label: 'Суммы',
|
||||
value: 100_000_001,
|
||||
},
|
||||
];
|
||||
|
||||
const defaultOptions: CalculationOptions = {
|
||||
radioLastPaymentRule: [
|
||||
{
|
||||
@ -321,16 +332,7 @@ const defaultOptions: CalculationOptions = {
|
||||
value: 100_000_007,
|
||||
},
|
||||
],
|
||||
radioCalcType: [
|
||||
{
|
||||
label: 'IRR',
|
||||
value: 100_000_000,
|
||||
},
|
||||
{
|
||||
label: 'Суммы',
|
||||
value: 100_000_001,
|
||||
},
|
||||
],
|
||||
radioCalcType,
|
||||
radioObjectRegistration: [
|
||||
{
|
||||
label: 'Лизингополучатель',
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { radioGraphType, selectSeasonType } from '@/config/default-options';
|
||||
import { radioCalcType, radioGraphType, selectSeasonType } from '@/config/default-options';
|
||||
import * as CRMTypes from '@/graphql/crm.types';
|
||||
import { SEASON_TYPES } from '@/process/payments/lib/seasons-constants';
|
||||
import type { ProcessContext } from '@/process/types';
|
||||
@ -278,7 +278,7 @@ export default function reactions({ store, apolloClient }: ProcessContext) {
|
||||
|
||||
const {
|
||||
data: { evo_baseproduct },
|
||||
} = await apolloClient.query<CRMTypes.GetProductQuery, CRMTypes.GetProductQueryVariables>({
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetProductDocument,
|
||||
variables: {
|
||||
productId,
|
||||
@ -286,10 +286,9 @@ export default function reactions({ store, apolloClient }: ProcessContext) {
|
||||
});
|
||||
|
||||
if (evo_baseproduct?.evo_calculation_method) {
|
||||
const filteredCalcTypeOptions = $calculation
|
||||
.element('radioCalcType')
|
||||
.getOptions()
|
||||
.filter((calcType) => evo_baseproduct.evo_calculation_method?.includes(calcType.value));
|
||||
const filteredCalcTypeOptions = radioCalcType.filter((calcType) =>
|
||||
evo_baseproduct.evo_calculation_method?.includes(calcType.value)
|
||||
);
|
||||
$calculation.element('radioCalcType').setOptions(filteredCalcTypeOptions);
|
||||
} else {
|
||||
$calculation.element('radioCalcType').resetOptions();
|
||||
|
||||
@ -199,6 +199,7 @@ export default function valuesReactions({ store, apolloClient }: ProcessContext)
|
||||
'selectFuelCard',
|
||||
'selectRegistration',
|
||||
'selectTownRegistration',
|
||||
'radioCalcType',
|
||||
] as Elements[]
|
||||
).forEach((elementName) => {
|
||||
reaction(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user