Calculation/Form: disable elements when LoadKP
This commit is contained in:
parent
4f509aefdf
commit
05ed1b6aef
@ -29,17 +29,20 @@ const Validation = observer(() => {
|
||||
});
|
||||
|
||||
const FinGAP = observer(() => {
|
||||
const { $tables } = useStore();
|
||||
const { $tables, $process } = useStore();
|
||||
const { fingap } = $tables;
|
||||
|
||||
const dataSource = toJS(fingap.risks);
|
||||
const selectedRowKeys = [...toJS(fingap.selectedKeys)];
|
||||
|
||||
const disabled = $process.has('LoadKP');
|
||||
|
||||
return (
|
||||
<Table
|
||||
columns={columns}
|
||||
dataSource={dataSource}
|
||||
rowSelection={{
|
||||
getCheckboxProps: () => ({ disabled }),
|
||||
onChange: (_, selectedRows) => {
|
||||
const selectedKeys = selectedRows.reduce((acc, row) => {
|
||||
acc.push(row.key);
|
||||
|
||||
@ -22,10 +22,14 @@ export default class StatusStore {
|
||||
public getStatus(elementName: ElementsActions | ElementsValues) {
|
||||
const status = this.overrided[elementName] || this.statuses[elementName];
|
||||
|
||||
if (this.root.$process.has('Unlimited') && status === 'Disabled') {
|
||||
if (this.root.$process.has('Unlimited')) {
|
||||
return 'Default';
|
||||
}
|
||||
|
||||
if (this.root.$process.has('LoadKP')) {
|
||||
return 'Disabled';
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
@ -105,6 +105,8 @@ export default class InsuranceTable {
|
||||
getStatus: (valueName: Insurance.Values) => {
|
||||
if (this.root.$process.has('Unlimited')) return 'Default';
|
||||
|
||||
if (this.root.$process.has('LoadKP')) return 'Disabled';
|
||||
|
||||
return this.statuses[key][valueName];
|
||||
},
|
||||
|
||||
|
||||
@ -74,6 +74,8 @@ export default class PaymentsTable {
|
||||
public getStatus(index: number) {
|
||||
if (this.root.$process.has('Unlimited')) return 'Default';
|
||||
|
||||
if (this.root.$process.has('LoadKP')) return 'Disabled';
|
||||
|
||||
return this.overridedStatus.get() ?? this.statuses[index];
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user