From 7e67232515e2ad76c3d73a7f2141e0bd243eb75a Mon Sep 17 00:00:00 2001 From: vchikalkin Date: Tue, 17 Nov 2020 14:17:15 +0300 Subject: [PATCH] fix open url | set last result value --- .../stores/CalculationStore/Effects/action.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/client/stores/CalculationStore/Effects/action.ts b/src/client/stores/CalculationStore/Effects/action.ts index d3b4056..867afa3 100644 --- a/src/client/stores/CalculationStore/Effects/action.ts +++ b/src/client/stores/CalculationStore/Effects/action.ts @@ -215,6 +215,7 @@ const actions: TAction = { quoteid, }, }).then(({ entities: { quote } }) => { + console.log('quote', quote); message.success({ content: `КП ${quote.evo_quotename} создано!`, duration: 5, @@ -223,7 +224,12 @@ const actions: TAction = { }, }); - if (quote.offerprintform) window.open(quote.offerprintform, '_blank'); + if (quote.offerprintform) { + Object.assign(document.createElement('a'), { + target: '_blank', + href: quote.offerprintform, + }).click(); + } }); }) .catch(err => { @@ -406,6 +412,11 @@ const actions: TAction = { (preparedData?.preparedValues?.brokerOfDeliverySum || 0) + (preparedData?.preparedValues?.financialDeptOfDeliverySum || 0), ); + CalculationStore.setValue( + 'resultBonusMPL', + (res.columns.npvBonusExpensesColumn?.values[2] || 0) / + (1 + preparedData.preparedValues.salaryRate), + ); //set values