fix radioCalcType

This commit is contained in:
vchikalkin 2023-04-17 13:39:06 +03:00
parent 501c818119
commit e20e8457e7
2 changed files with 11 additions and 2 deletions

View File

@ -193,6 +193,10 @@ export const radioCalcType = [
label: 'Суммы',
value: 100_000_001,
},
{
label: 'PI',
value: 100_000_099,
},
];
export const selectRequirementTelematic = [

View File

@ -302,8 +302,10 @@ export default function reactions({ store, apolloClient, user }: ProcessContext)
reaction(
() => $calculation.element('selectProduct').getValue(),
async (productId) => {
const IRRCalcTypeOptions = radioCalcType.filter((x) => x.value === 100_000_000);
if (!productId) {
$calculation.element('radioCalcType').resetOptions();
$calculation.element('radioCalcType').setOptions(IRRCalcTypeOptions);
return;
}
@ -323,8 +325,11 @@ export default function reactions({ store, apolloClient, user }: ProcessContext)
);
$calculation.element('radioCalcType').setOptions(filteredCalcTypeOptions);
} else {
$calculation.element('radioCalcType').resetOptions();
$calculation.element('radioCalcType').setOptions(IRRCalcTypeOptions);
}
},
{
fireImmediately: true,
}
);