fix on deal & quests zip creation
This commit is contained in:
parent
a8b597a27f
commit
1b98fe1a62
@ -9,11 +9,11 @@ import fileDownload from 'js-file-download';
|
||||
import * as actionTypes from '../constants/actionTypes';
|
||||
import * as currentState from '../reducers/initialState';
|
||||
|
||||
export const signCheckEDOCreatePrintForm = ({ contract_number, sign_type }) =>
|
||||
export const signCheckCreatePrintForm = ({ contract_number, sign_type }) =>
|
||||
{
|
||||
const url = `${ process.env.NEXT_PUBLIC_SELF_API_HOST }/api/contract/sign/check`;
|
||||
|
||||
console.log("ACTION", "sign", "signCheckEDOCreatePrintForm()", { url });
|
||||
console.log("ACTION", "sign", "signCheckCreatePrintForm()", { url });
|
||||
|
||||
return new Promise((resolve, reject) =>
|
||||
{
|
||||
@ -22,13 +22,13 @@ export const signCheckEDOCreatePrintForm = ({ contract_number, sign_type }) =>
|
||||
})
|
||||
.then((response) =>
|
||||
{
|
||||
console.log("ACTION", "sign", "signCheckEDOCreatePrintForm()", "response", response.data);
|
||||
console.log("ACTION", "sign", "signCheckCreatePrintForm()", "response", response.data);
|
||||
|
||||
resolve(response.data);
|
||||
})
|
||||
.catch((error) =>
|
||||
{
|
||||
console.error("ACTION", "sign", "signCheckEDOCreatePrintForm()", "ERROR");
|
||||
console.error("ACTION", "sign", "signCheckCreatePrintForm()", "ERROR");
|
||||
console.error(error);
|
||||
|
||||
reject(error.data);
|
||||
|
||||
@ -6,7 +6,7 @@ import { concatSeries } from "async";
|
||||
import { eachSeries } from 'async';
|
||||
import Select from 'react-select';
|
||||
|
||||
import { createEDOProject, docEDOCancel, signCheckEDOCreatePrintForm, signDownloadFile, signGetGUIDEntity, signGetWMDoc, docEDOSign, docEDOStatus, docEDOConnect } from "../../actions";
|
||||
import { createEDOProject, docEDOCancel, signCheckCreatePrintForm, signDownloadFile, signGetGUIDEntity, signGetWMDoc, docEDOSign, docEDOStatus, docEDOConnect } from "../../actions";
|
||||
|
||||
export default class DealContractsSignPaper extends React.Component
|
||||
{
|
||||
@ -32,7 +32,10 @@ export default class DealContractsSignPaper extends React.Component
|
||||
docs.push({ ...this.props.documents[i], ...{ index: i, loading: true, ready: false, upload: false, } });
|
||||
}
|
||||
|
||||
this.setState({ documents: docs, loading: true });
|
||||
this.setState({ documents: docs, loading: true }, () =>
|
||||
{
|
||||
this._sign();
|
||||
});
|
||||
}
|
||||
|
||||
_updateDocs = (id, update) =>
|
||||
@ -68,11 +71,10 @@ export default class DealContractsSignPaper extends React.Component
|
||||
_sign = () =>
|
||||
{
|
||||
//const { documents } = this.props;
|
||||
const { operator_selected, step } = this.state;
|
||||
const documents = [ ...this.state.documents ];
|
||||
|
||||
console.log("_handle_onFormSubmit");
|
||||
console.log({ documents, operator_selected });
|
||||
console.log("DealContractsSignPaper", "_sign");
|
||||
console.log({ documents, });
|
||||
|
||||
this.setState({ loading: true }, () =>
|
||||
{
|
||||
@ -119,7 +121,7 @@ export default class DealContractsSignPaper extends React.Component
|
||||
console.log({ document })
|
||||
// await this._updateDocs(document.index, { loading: true });
|
||||
|
||||
const create_print_form_result = await signCheckEDOCreatePrintForm({ contract_number: document.id, sign_type: "Paper" });
|
||||
const create_print_form_result = await signCheckCreatePrintForm({ contract_number: document.id, sign_type: "Paper" });
|
||||
console.log({ create_print_form_result });
|
||||
|
||||
const docs = { status: create_print_form_result.status };
|
||||
|
||||
@ -460,6 +460,7 @@ class DocumentsForm extends Step
|
||||
type: file.type,
|
||||
file,
|
||||
update,
|
||||
index,
|
||||
};
|
||||
|
||||
attachDealDocument(payload)
|
||||
|
||||
@ -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, getFile, signGetFileContractProject } from "../../actions";
|
||||
import { createEDOProject, docEDOCancel, signCheckCreatePrintForm, signCheckPowerAttorneyClient, signDownloadFile, signGetGUIDEntity, signGetPowerAttorneyClient, signGetWMDoc, docEDOSign, docEDOStatus, docEDOConnect, getFile, signGetFileContractProject } from "../../actions";
|
||||
//import { getDeals, getDealOffers, getDealDocuments, getDealContracts } from "../../actions";
|
||||
|
||||
class EDOSign extends React.Component
|
||||
@ -173,7 +173,7 @@ class EDOSign extends React.Component
|
||||
}
|
||||
else
|
||||
{
|
||||
const create_print_form_result = await signCheckEDOCreatePrintForm({ contract_number: document.id, sign_type: "EDO" });
|
||||
const create_print_form_result = await signCheckCreatePrintForm({ contract_number: document.id, sign_type: "EDO" });
|
||||
console.log({ create_print_form_result });
|
||||
|
||||
const docs = { status: create_print_form_result.status };
|
||||
|
||||
@ -35,9 +35,15 @@ function createZipFile(zip_filename, files)
|
||||
zlib: { level: 9 } // Sets the compression level.
|
||||
});
|
||||
|
||||
output.on('close', function()
|
||||
{
|
||||
console.log('archive on close');
|
||||
resolve();
|
||||
});
|
||||
|
||||
output.on('end', function()
|
||||
{
|
||||
console.log('Data has been drained');
|
||||
console.log('archive on end');
|
||||
});
|
||||
|
||||
archive.on('warning', function(err)
|
||||
@ -60,9 +66,7 @@ function createZipFile(zip_filename, files)
|
||||
{
|
||||
archive.append(fs.createReadStream(files[i].path), { name: files[i].name });
|
||||
}
|
||||
await archive.finalize();
|
||||
|
||||
resolve();
|
||||
archive.finalize();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -42,9 +42,15 @@ function createZipFile(zip_filename, files)
|
||||
zlib: { level: 9 } // Sets the compression level.
|
||||
});
|
||||
|
||||
output.on('close', function()
|
||||
{
|
||||
console.log('archive on close');
|
||||
resolve();
|
||||
});
|
||||
|
||||
output.on('end', function()
|
||||
{
|
||||
console.log('Data has been drained');
|
||||
console.log('archive on end');
|
||||
});
|
||||
|
||||
archive.on('warning', function(err)
|
||||
@ -70,8 +76,6 @@ function createZipFile(zip_filename, files)
|
||||
archive.append(fs.createReadStream(files[i].path), { name: files[i].name });
|
||||
}
|
||||
archive.finalize();
|
||||
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user