hide fields | set default values

This commit is contained in:
vchikalkin 2020-11-17 13:57:28 +03:00
parent f9a00396bf
commit 32c12b7df6
5 changed files with 42 additions and 40 deletions

View File

@ -1201,15 +1201,15 @@ const sections: ISection[] = [
// valueName: 'insPeriod',
// },
// },
{
Component: Button,
props: {
type: 'ghost',
name: 'btnFranschise',
text: 'Заявление на франшизу',
onClick: undefined,
},
},
// {
// Component: Button,
// props: {
// type: 'ghost',
// name: 'btnFranschise',
// text: 'Заявление на франшизу',
// onClick: undefined,
// },
// },
],
},
{
@ -1250,15 +1250,15 @@ const sections: ISection[] = [
// valueName: 'INNForCalc',
// },
// },
{
Component: Button,
props: {
type: 'ghost',
name: 'btnDriversApplication',
text: 'Заявление на ограничения по водителям',
onClick: undefined,
},
},
// {
// Component: Button,
// props: {
// type: 'ghost',
// name: 'btnDriversApplication',
// text: 'Заявление на ограничения по водителям',
// onClick: undefined,
// },
// },
],
},
{

View File

@ -1259,25 +1259,25 @@ const reactionEffects: IReactionEffect[] = [
},
}),
calculationStore => ({
expression: () => {
const { leasingPeriod } = calculationStore.values;
return leasingPeriod;
},
effect: leasingPeriod => {
if (leasingPeriod) {
if (parseInt(leasingPeriod) < 12) {
calculationStore.setStatus('radioBalanceHolder', Status.Disabled);
calculationStore.setValue('balanceHolder', 100000000);
} else {
calculationStore.setStatus('radioBalanceHolder', Status.Default);
}
}
},
options: {
fireImmediately: true,
},
}),
// calculationStore => ({
// expression: () => {
// const { leasingPeriod } = calculationStore.values;
// return leasingPeriod;
// },
// effect: leasingPeriod => {
// if (leasingPeriod) {
// if (parseInt(leasingPeriod) < 12) {
// calculationStore.setStatus('radioBalanceHolder', Status.Disabled);
// calculationStore.setValue('balanceHolder', 100000000);
// } else {
// calculationStore.setStatus('radioBalanceHolder', Status.Default);
// }
// }
// },
// options: {
// fireImmediately: true,
// },
// }),
calculationStore => ({
expression: () => {

View File

@ -36,6 +36,8 @@ const initialStatuses: TElements<Status> = {
selectAgent: Status.Disabled,
tbxCommentLead: Status.Disabled,
btnCreateLead: Status.Disabled,
radioBalanceHolder: Status.Disabled,
};
export default initialStatuses;

View File

@ -18,7 +18,7 @@ const tableInsurance: ITable = {
),
},
insured: {
value: null,
value: 100000000,
},
insCost: {
value: 0,
@ -42,7 +42,7 @@ const tableInsurance: ITable = {
),
},
insured: {
value: null,
value: 100000000,
},
insCost: {
value: 0,

View File

@ -26,7 +26,7 @@ const initialValues: TValues<TValue> = {
highSeasonStart: 100000000,
comissionPerc: 0,
comissionRub: 0,
saleBonus: 1.25,
saleBonus: 1.3,
IRR_Perc: 20,
brand: null,
model: null,