Внести изменения по умолчанию при загрузке страницы:

в таблице Страхования в строуе SafeFinance указывать:
Страховая компания = ГСК ЮГОРИЯ
Плательщик = ЛД
в таблице Риск SafeFinance выделять все риски по умолчанию
This commit is contained in:
vchikalkin 2024-04-19 11:57:12 +03:00
parent 2b3dd5e7b9
commit d916a180a2
2 changed files with 34 additions and 0 deletions

View File

@ -1 +1,2 @@
export { default as common } from './common';
export { default as init } from './init';

View File

@ -0,0 +1,33 @@
import type { ProcessContext } from '@/process/types';
import { when } from 'mobx';
export default function reactions({ store }: ProcessContext) {
const { $tables } = store;
/**
* Устанавливаем СК фингап по умолчанию при загрузке страницы
*/
when(() => {
const finGAPInsuranceCompanies = $tables.insurance.row('fingap').getOptions('insuranceCompany');
if (finGAPInsuranceCompanies.length) {
$tables.insurance
.row('fingap')
.setValue('insuranceCompany', finGAPInsuranceCompanies[0]?.value);
}
return Boolean(finGAPInsuranceCompanies.length);
});
/**
* Устанавливаем все риски ФинГАП по умолчанию при загрузке страницы
*/
when(() => {
const { risks } = $tables.fingap;
if (risks.length) {
$tables.fingap.setSelectedKeys(risks.map((x) => x.key));
}
return Boolean(risks.length);
});
}