deal hotfix on edo send
This commit is contained in:
parent
986114702e
commit
ef1cac0ec4
@ -3,7 +3,7 @@ import moment from "moment";
|
|||||||
import { SpinnerCircular } from "spinners-react";
|
import { SpinnerCircular } from "spinners-react";
|
||||||
import Dropzone from 'react-dropzone';
|
import Dropzone from 'react-dropzone';
|
||||||
|
|
||||||
import { docEDOStatus, getFile, signCancelDocument, signCheckCancelDocument, signCheckDownloadContractProject, signGetFileContractProject, signUploadPaperDocument } from "../../../actions";
|
import { docEDOSign, docEDOStatus, getFile, signCancelDocument, signCheckCancelDocument, signCheckDownloadContractProject, signGetFileContractProject, signUploadPaperDocument } from "../../../actions";
|
||||||
|
|
||||||
export default class SignPlannedContract extends React.Component
|
export default class SignPlannedContract extends React.Component
|
||||||
{
|
{
|
||||||
@ -131,12 +131,15 @@ export default class SignPlannedContract extends React.Component
|
|||||||
const check_result = await signCheckDownloadContractProject({ contract_number: contract.name });
|
const check_result = await signCheckDownloadContractProject({ contract_number: contract.name });
|
||||||
if(check_result.status === "success")
|
if(check_result.status === "success")
|
||||||
{
|
{
|
||||||
const status_result = await docEDOStatus({ contract_number: document.id });
|
const status_result = await docEDOStatus({ contract_number: contract.name });
|
||||||
console.log({ status_result });
|
console.log({ status_result });
|
||||||
|
|
||||||
if(status_result.status > 0)
|
if(status_result.status > 0)
|
||||||
{
|
{
|
||||||
const sign_result = await docEDOSign({ edoid: status_result.edoid });
|
const sign_result = await docEDOSign({ edoid: status_result.edoid });
|
||||||
|
|
||||||
|
const new_status_result = await docEDOStatus({ contract_number: contract.name });
|
||||||
|
this.setState({ status: new_status_result.status, loading: false, disabled: false, loading_signing: false });
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -174,7 +177,7 @@ export default class SignPlannedContract extends React.Component
|
|||||||
render()
|
render()
|
||||||
{
|
{
|
||||||
const { index, contract, } = this.props;
|
const { index, contract, } = this.props;
|
||||||
const { loading, status, uploading, disabled, finished, error, message, loading_download_file, loading_uploading_file, loading_cancel_sign } = this.state;
|
const { loading, status, uploading, disabled, finished, error, message, loading_download_file, loading_uploading_file, loading_cancel_sign, loading_signing } = this.state;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="document deal_contract_sign_item">
|
<div className="document deal_contract_sign_item">
|
||||||
@ -255,17 +258,31 @@ export default class SignPlannedContract extends React.Component
|
|||||||
{ contract.sign_type === "EDO" && (
|
{ contract.sign_type === "EDO" && (
|
||||||
<div className="actions">
|
<div className="actions">
|
||||||
{ status === 1 && (
|
{ status === 1 && (
|
||||||
<button className="button blue" style={{ minWidth: "130px", }} disabled={ disabled } onClick={ () => this._handle_downloadFile() }>{ loading_download_file ? (
|
<button className="button blue" style={{ minWidth: "130px", }} disabled={ disabled } onClick={ () => this._handle_downloadFile() }>
|
||||||
<SpinnerCircular size={ 22 } thickness={ 100 } speed={ 100 } color="rgba(236, 239, 244, 1)" secondaryColor="rgba(28, 1, 169, 1)" />
|
{ loading_download_file ? (
|
||||||
) : ("Скачать проект") }</button>
|
<SpinnerCircular size={ 22 } thickness={ 100 } speed={ 100 } color="rgba(236, 239, 244, 1)" secondaryColor="rgba(28, 1, 169, 1)" />
|
||||||
|
) : (
|
||||||
|
"Скачать проект"
|
||||||
|
) }
|
||||||
|
</button>
|
||||||
) }
|
) }
|
||||||
{ status === 1 && (
|
{ status === 1 && (
|
||||||
<button className="button blue" style={{ minWidth: "175px", }} disabled={ disabled } onClick={ () => this._handle_cancelSign() }>{ loading_cancel_sign ? (
|
<button className="button blue" style={{ minWidth: "175px", }} disabled={ disabled } onClick={ () => this._handle_cancelSign() }>
|
||||||
<SpinnerCircular size={ 22 } thickness={ 100 } speed={ 100 } color="rgba(236, 239, 244, 1)" secondaryColor="rgba(28, 1, 169, 1)" />
|
{ loading_cancel_sign ? (
|
||||||
) : ("Отменить подписание") }</button>
|
<SpinnerCircular size={ 22 } thickness={ 100 } speed={ 100 } color="rgba(236, 239, 244, 1)" secondaryColor="rgba(28, 1, 169, 1)" />
|
||||||
|
) : (
|
||||||
|
"Отменить подписание"
|
||||||
|
) }
|
||||||
|
</button>
|
||||||
)}
|
)}
|
||||||
{ status === 1 && (
|
{ status === 1 && (
|
||||||
<button className="button blue" style={{ minWidth: "144px", }} disabled={ disabled } onClick={ () => this._handle_sendToEDO() }>Отправить в ЭДО</button>
|
<button className="button blue" style={{ minWidth: "144px", }} disabled={ disabled } onClick={ () => this._handle_sendToEDO() }>
|
||||||
|
{ loading_signing ? (
|
||||||
|
<SpinnerCircular size={ 22 } thickness={ 100 } speed={ 100 } color="rgba(236, 239, 244, 1)" secondaryColor="rgba(28, 1, 169, 1)" />
|
||||||
|
) : (
|
||||||
|
"Отправить в ЭДО"
|
||||||
|
) }
|
||||||
|
</button>
|
||||||
) }
|
) }
|
||||||
{ status >= 2 && (
|
{ status >= 2 && (
|
||||||
<button className="button blue" onClick={ () => this._handle_onGoToEDO() }>Перейти в ЭДО</button>
|
<button className="button blue" onClick={ () => this._handle_onGoToEDO() }>Перейти в ЭДО</button>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user