deals edo sign file download fix

This commit is contained in:
merelendor 2023-10-18 12:33:51 +03:00
parent 61d608d31f
commit ab2ac6e9dd
2 changed files with 12 additions and 8 deletions

View File

@ -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)
{

View File

@ -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
<div className="status_icon success"></div>
{ document.entity_id !== undefined && (
<>
<button className="button" disabled={ disabled } onClick={ () => this._handle_onDownloadFile(index, document.entity_id, document.name) }>Посмотреть проект договора</button>
<button className="button" disabled={ disabled } onClick={ () => this._handle_onDownloadFile(index) }>Посмотреть проект договора</button>
<button className="button" disabled={ disabled } onClick={ () => this._handle_onCancelFile(index) }>Отменить подписание</button>
</>
) }