diff --git a/components/DealsStatus/components/SignPlannedContract.js b/components/DealsStatus/components/SignPlannedContract.js index 2869b19..37fe6bb 100644 --- a/components/DealsStatus/components/SignPlannedContract.js +++ b/components/DealsStatus/components/SignPlannedContract.js @@ -3,7 +3,7 @@ import moment from "moment"; import { SpinnerCircular } from "spinners-react"; 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 { @@ -131,12 +131,15 @@ export default class SignPlannedContract extends React.Component const check_result = await signCheckDownloadContractProject({ contract_number: contract.name }); 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 }); if(status_result.status > 0) { 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 { @@ -174,7 +177,7 @@ export default class SignPlannedContract extends React.Component render() { 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 (
@@ -255,17 +258,31 @@ export default class SignPlannedContract extends React.Component { contract.sign_type === "EDO" && (
{ status === 1 && ( - + ) } { status === 1 && ( - + )} { status === 1 && ( - + ) } { status >= 2 && (