fix table filter

This commit is contained in:
Chika 2021-04-02 16:15:02 +03:00
parent 4638ead7e7
commit b9dde9e5c3
2 changed files with 9 additions and 5 deletions

View File

@ -8,7 +8,7 @@ import { toJS } from 'mobx';
import valuesConstants from 'core/constants/values';
import {
insuranceOsagoDefaultFilter,
insuranceOsagoOtherFilter,
singleValueFilter,
} from 'core/constants/stores/Calculation/filters';
const { PERIODS_NUMBER } = valuesConstants;
@ -793,14 +793,17 @@ export default [
const otherInsuranceCompany = calculationStore.tables.tableInsurance.options?.insuranceCompany?.find(
x => x.name?.includes('ПРОЧИЕ'),
);
if (otherInsuranceCompany)
if (otherInsuranceCompany) {
const insuranceOtherFilter = singleValueFilter(
otherInsuranceCompany.value,
);
calculationStore.setTableRow(
'tableInsurance',
0,
true,
)({
insuranceCompany: {
filter: insuranceOsagoOtherFilter,
filter: insuranceOtherFilter,
value: otherInsuranceCompany.value,
status: ElementStatus.Disabled,
},
@ -813,6 +816,7 @@ export default [
status: ElementStatus.Disabled,
},
});
}
} else {
calculationStore.setTableRow(
'tableInsurance',

View File

@ -2,8 +2,8 @@ export const insuranceOsagoDefaultFilter = options =>
options.filter(
x => x.evo_type_ins_policy && x.evo_type_ins_policy.includes(100000001),
);
export const insuranceOsagoOtherFilter = options =>
options.filter(x => x.value === otherInsuranceCompany.value);
export const singleValueFilter = value => options =>
options.filter(x => x.value === value);
export const insuranceKaskoDefaultFilter = options =>
options.filter(
x => x.evo_type_ins_policy && x.evo_type_ins_policy.includes(100000000),