diff --git a/components/DealsStatus/SingleDeal.js b/components/DealsStatus/SingleDeal.js index c69fcad..9ff6894 100644 --- a/components/DealsStatus/SingleDeal.js +++ b/components/DealsStatus/SingleDeal.js @@ -866,7 +866,7 @@ class SignPlannedContract extends React.Component { const status_result = await docEDOStatus({ contract_number: contract.name }); console.log("SignPlannedContract", "CDM", { status_result }); - this.setState({ contract_entity_id: status_result.edoid, status: status_result.status, loading: false, url: status_result.edo_url }); + this.setState({ contract_entity_id: status_result.edoid, status: status_result.status, loading: false, url: status_result.url_edo }); } else { @@ -924,6 +924,7 @@ class SignPlannedContract extends React.Component _handle_onGoToEDO = () => { const { url } = this.state; + console.log("_handle_onGoToEDO", { url }); if(url !== undefined && url !== null) { diff --git a/components/EDOSign/index.js b/components/EDOSign/index.js index 773ee77..3b61fc9 100644 --- a/components/EDOSign/index.js +++ b/components/EDOSign/index.js @@ -6,7 +6,7 @@ import { concatSeries } from "async"; import { eachSeries } from 'async'; import Select from 'react-select'; -import { createEDOProject, docEDOCancel, signCheckEDOCreatePrintForm, signCheckPowerAttorneyClient, signDownloadFile, signGetGUIDEntity, signGetPowerAttorneyClient, signGetWMDoc, docEDOSign, docEDOStatus, docEDOConnect } from "../../actions"; +import { createEDOProject, docEDOCancel, signCheckEDOCreatePrintForm, signCheckPowerAttorneyClient, signDownloadFile, signGetGUIDEntity, signGetPowerAttorneyClient, signGetWMDoc, docEDOSign, docEDOStatus, docEDOConnect, getFile, signGetFileContractProject } from "../../actions"; //import { getDeals, getDealOffers, getDealDocuments, getDealContracts } from "../../actions"; class EDOSign extends React.Component @@ -329,18 +329,21 @@ class EDOSign extends React.Component this._updateDocs(index, { attorney_selected: attorney }); } - _handle_onDownloadFile = (index, entity_id, name) => + _handle_onDownloadFile = (index) => { - console.log("_handle_onDownloadFile", { index, entity_id }); + const { documents } = this.state; + this.setState({ loading: true, disabled: true, }, async () => { await this._updateDocs(index, { loading: true }); - const wmdoc_result = await signDownloadFile({ - payload: { entity_name: "evo_contract", entity_id, sign_type: "EDO", evo_id: "144", }, - filename: `ЛК ЭВОЛЮЦИЯ ${ name }.pdf`, + const link_result = await signGetFileContractProject({ + contract_number: documents[index].id, }); + console.log("_handle_onDownloadFile", { link_result }); + await getFile({ id: link_result.url, filename: `ЛК ЭВОЛЮЦИЯ ${ documents[index].id }.${ link_result.extension }` }); + await this._updateDocs(index, { loading: false, disabled: false, }); this.setState({ loading: false, disabled: false, }); }); @@ -511,7 +514,7 @@ class EDOSign extends React.Component
{ document.entity_id !== undefined && ( <> - + ) }