complete insurance table

This commit is contained in:
Chika 2020-10-06 13:40:22 +03:00
parent 8b1741e20b
commit d868f62a8d
2 changed files with 127 additions and 1 deletions

View File

@ -157,6 +157,14 @@ const actions: TAction = {
((DGORow && DGORow.insCost?.value > 0) ||
(NSRow && NSRow.insCost?.value > 0))
) {
CalculationStore.setTableRow(
'tableInsurance',
1,
)({
insCost: {
validation: false,
},
});
openNotification({
type: 'error',
title: 'Ошибка во время расчета графика',
@ -170,6 +178,14 @@ const actions: TAction = {
kaskoRow.insured?.value === 100000001 &&
kaskoRow.insCost?.value === 0
) {
CalculationStore.setTableRow(
'tableInsurance',
1,
)({
insCost: {
validation: false,
},
});
openNotification({
type: 'error',
title: 'Ошибка во время расчета графика',
@ -177,6 +193,14 @@ const actions: TAction = {
})();
return;
}
CalculationStore.setTableRow(
'tableInsurance',
1,
)({
insCost: {
validation: true,
},
});
},
};

View File

@ -18,7 +18,7 @@ const tableInsurance: ITable = {
value: 0,
},
insTerm: {
value: null,
value: 100000000,
status: Status.Disabled,
},
},
@ -112,11 +112,28 @@ const tableInsurance: ITable = {
!calculationStore.tables[tableName]?.rows[rowIndex]['insuranceCompany']
?.value
) {
calculationStore.setTableRow(
'tableInsurance',
rowIndex,
)({
insuranceCompany: {
validation: false,
},
});
openNotification({
type: 'error',
title: 'Ошибка',
description: 'Не указана страховая компания по полису',
})();
} else {
calculationStore.setTableRow(
'tableInsurance',
rowIndex,
)({
insuranceCompany: {
validation: true,
},
});
}
if (
calculationStore.tables[tableName]?.rows[rowIndex]['insCost']?.value &&
@ -124,11 +141,28 @@ const tableInsurance: ITable = {
0 &&
!calculationStore.tables[tableName]?.rows[rowIndex]['insTerm']?.value
) {
calculationStore.setTableRow(
'tableInsurance',
rowIndex,
)({
insTerm: {
validation: false,
},
});
openNotification({
type: 'error',
title: 'Ошибка',
description: 'Не указан срок страхования',
})();
} else {
calculationStore.setTableRow(
'tableInsurance',
rowIndex,
)({
insTerm: {
validation: true,
},
});
}
if (
calculationStore.tables[tableName]?.rows[rowIndex]['insCost']?.value &&
@ -136,11 +170,28 @@ const tableInsurance: ITable = {
0 &&
!calculationStore.tables[tableName]?.rows[rowIndex]['insured']?.value
) {
calculationStore.setTableRow(
'tableInsurance',
rowIndex,
)({
insured: {
validation: false,
},
});
openNotification({
type: 'error',
title: 'Ошибка',
description: 'Не указан плательщик',
})();
} else {
calculationStore.setTableRow(
'tableInsurance',
rowIndex,
)({
insured: {
validation: true,
},
});
}
},
@ -151,11 +202,28 @@ const tableInsurance: ITable = {
0 &&
!calculationStore.tables[tableName]?.rows[rowIndex]['insured']?.value
) {
calculationStore.setTableRow(
'tableInsurance',
rowIndex,
)({
insured: {
validation: false,
},
});
openNotification({
type: 'error',
title: 'Ошибка',
description: 'Не указан плательщик',
})();
} else {
calculationStore.setTableRow(
'tableInsurance',
rowIndex,
)({
insured: {
validation: true,
},
});
}
},
@ -166,11 +234,28 @@ const tableInsurance: ITable = {
0 &&
!calculationStore.tables[tableName]?.rows[rowIndex]['insTerm']?.value
) {
calculationStore.setTableRow(
'tableInsurance',
rowIndex,
)({
insTerm: {
validation: false,
},
});
openNotification({
type: 'error',
title: 'Ошибка',
description: 'Не указан срок страхования',
})();
} else {
calculationStore.setTableRow(
'tableInsurance',
rowIndex,
)({
insTerm: {
validation: true,
},
});
}
},
insuranceCompany: (calculationStore, tableName, rowIndex) => {
@ -181,11 +266,28 @@ const tableInsurance: ITable = {
!calculationStore.tables[tableName]?.rows[rowIndex]['insuranceCompany']
?.value
) {
calculationStore.setTableRow(
'tableInsurance',
rowIndex,
)({
insuranceCompany: {
validation: false,
},
});
openNotification({
type: 'error',
title: 'Ошибка',
description: 'Не указана страховая компания по полису',
})();
} else {
calculationStore.setTableRow(
'tableInsurance',
rowIndex,
)({
insuranceCompany: {
validation: true,
},
});
}
},
},