From d16936cac34ad68afab9dc518f000c4505007d83 Mon Sep 17 00:00:00 2001 From: Chika Date: Mon, 25 Apr 2022 15:01:38 +0300 Subject: [PATCH 1/2] tbxLastPaymentPerc: increase max value --- src/client/Containers/Calculation/Elements/props/common.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/Containers/Calculation/Elements/props/common.ts b/src/client/Containers/Calculation/Elements/props/common.ts index 2443935..5f9a221 100644 --- a/src/client/Containers/Calculation/Elements/props/common.ts +++ b/src/client/Containers/Calculation/Elements/props/common.ts @@ -76,7 +76,7 @@ const elementsProps: Partial> = { }, tbxLastPaymentPerc: { min: '0', - max: '15', + max: '70', step: '1.000000', precision: 6, formatter: formatNumber, From d858e0eaad8a91a21db1f8d649a8ad567216c887 Mon Sep 17 00:00:00 2001 From: Chika Date: Mon, 25 Apr 2022 15:13:34 +0300 Subject: [PATCH 2/2] =?UTF-8?q?validaton:=20=D0=BF=D0=BE=D1=87=D0=B8=D0=BD?= =?UTF-8?q?=D0=B8=D0=BB=D0=B8=20=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA?= =?UTF-8?q?=D1=83=20=D0=9E=D0=A1=D0=90=D0=93=D0=9E=20=D0=B8=20=D0=9A=D0=90?= =?UTF-8?q?=D0=A1=D0=9A=D0=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../actions/calculate/validate/tables.ts | 53 +++++++++++-------- 1 file changed, 30 insertions(+), 23 deletions(-) diff --git a/src/client/stores/CalculationStore/Effects/actions/calculate/validate/tables.ts b/src/client/stores/CalculationStore/Effects/actions/calculate/validate/tables.ts index 182458b..e355725 100644 --- a/src/client/stores/CalculationStore/Effects/actions/calculate/validate/tables.ts +++ b/src/client/stores/CalculationStore/Effects/actions/calculate/validate/tables.ts @@ -11,32 +11,12 @@ function validateInsuranceTable(this: ICalculationStore) { rows => rows.findIndex(x => x?.key === 'osago'), 'value', ); - this.setTableRow('tableInsurance', rows => - rows.findIndex(x => x?.key === 'osago'), - )({ - insuranceCompany: { - validation: !isNil(osagoRow.insuranceCompany), - }, - insured: { - validation: !isNil(osagoRow.insured), - }, - }); const kaskoRow = this.getTableRowValues( 'tableInsurance', rows => rows.findIndex(x => x?.key === 'kasko'), 'value', ); - this.setTableRow('tableInsurance', rows => - rows.findIndex(x => x?.key === 'kasko'), - )({ - insuranceCompany: { - validation: !isNil(kaskoRow.insuranceCompany), - }, - insured: { - validation: !isNil(kaskoRow.insured), - }, - }); /** * если в СК ОСАГО поле evo_osago_with_kasko=True И СК ОСАГО != СК КАСКО, @@ -50,25 +30,52 @@ function validateInsuranceTable(this: ICalculationStore) { const invalid = osagoInsuranceCompanyOption?.evo_osago_with_kasko && osagoRow.insuranceCompany !== kaskoRow.insuranceCompany; - if (invalid) + if (invalid) { openNotification({ type: 'error', message: 'Ошибка', description: 'Невозможно страхование ОСАГО отдельно от КАСКО - страховая компания должна быть одна!', }); + this.setTableRow('tableInsurance', rows => + rows.findIndex(x => x?.key === 'osago'), + )({ + insuranceCompany: { + validation: !invalid, + }, + }); + this.setTableRow('tableInsurance', rows => + rows.findIndex(x => x?.key === 'kasko'), + )({ + insuranceCompany: { + validation: !invalid, + }, + }); + return; + } + + /** + * Проверка на заполнение ОСАГО и КАСКО + */ this.setTableRow('tableInsurance', rows => rows.findIndex(x => x?.key === 'osago'), )({ insuranceCompany: { - validation: !invalid, + validation: !isNil(osagoRow.insuranceCompany), + }, + insured: { + validation: !isNil(osagoRow.insured), }, }); + this.setTableRow('tableInsurance', rows => rows.findIndex(x => x?.key === 'kasko'), )({ insuranceCompany: { - validation: !invalid, + validation: !isNil(kaskoRow.insuranceCompany), + }, + insured: { + validation: !isNil(kaskoRow.insured), }, }); }