Внести изменения по умолчанию при загрузке страницы:
в таблице Страхования в строуе SafeFinance указывать: Страховая компания = ГСК ЮГОРИЯ Плательщик = ЛД в таблице Риск SafeFinance выделять все риски по умолчанию
This commit is contained in:
parent
2b3dd5e7b9
commit
d916a180a2
@ -1 +1,2 @@
|
||||
export { default as common } from './common';
|
||||
export { default as init } from './init';
|
||||
|
||||
33
apps/web/process/fingap/reactions/init.ts
Normal file
33
apps/web/process/fingap/reactions/init.ts
Normal 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);
|
||||
});
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user