изменения в фильтрации тарифа

This commit is contained in:
vchikalkin 2023-03-23 14:41:48 +03:00
parent cbd3b47a38
commit 80d687e6cd
4 changed files with 27 additions and 2 deletions

View File

@ -14,6 +14,7 @@ export default function ($calculation: ICalculationStore) {
'firstPaymentPerc',
'lastPaymentPerc',
'leaseObjectUsed',
'leaseObjectType',
]),
};
},
@ -24,6 +25,7 @@ export default function ($calculation: ICalculationStore) {
firstPaymentPerc,
lastPaymentPerc,
leaseObjectUsed,
leaseObjectType,
}) => {
if (product && leasingPeriod && deliveryTime) {
const target_tarif = $calculation.options.selectTarif?.find(
@ -38,14 +40,34 @@ export default function ($calculation: ICalculationStore) {
tarif.evo_min_last_payment <= lastPaymentPerc &&
tarif.evo_max_last_payment >= lastPaymentPerc &&
tarif,
tarif => {
if (
!tarif?.evo_leasingobject_types?.length ||
(leaseObjectType &&
tarif.evo_leasingobject_types
.map(x => x.evo_leasingobject_typeid)
.includes(leaseObjectType))
) {
return tarif;
}
},
tarif => {
if (leaseObjectUsed === true) {
if (tarif.evo_used) {
if (
!tarif?.evo_pl_use_type?.length ||
tarif.evo_pl_use_type.includes(100_000_001)
) {
return tarif;
}
} else {
if (
!tarif?.evo_pl_use_type?.length ||
tarif.evo_pl_use_type.includes(100_000_000)
) {
return tarif;
}
}
},
),
);

View File

@ -199,6 +199,7 @@ query GetMainOptions(
evo_margin_min
evo_cut_irr_with_bonus_coefficient
evo_used
evo_pl_use_type
}
selectRate: evo_rates(
statecode: $statecode

View File

@ -2152,6 +2152,7 @@ type evo_tarif {
modifiedon: DateTime
statecode: Int
toObjectString: String
evo_pl_use_type: [Int!]
}
type evo_rate {

View File

@ -439,6 +439,7 @@ export interface IEvoTarif extends BaseEntity {
evo_dateto?: Date;
evo_irr_plan?: number;
evo_used?: boolean;
evo_pl_use_type?: number[];
evo_ins_type?: number;
evo_client_risks?: IEvoClientRisk[];
evo_leasingobject_types?: IEvoLeasingObjectType[];