Merge branch 'master' of https://github.com/merelendor/evoleasing-account
This commit is contained in:
commit
ceff05615a
@ -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, signDownloadFile, signGetGUIDEntity, signGetWMDoc, docEDOSign, docEDOStatus, docEDOConnect } from "../../actions";
|
||||
|
||||
export default class DealContractsSignPaper extends React.Component
|
||||
{
|
||||
@ -29,8 +29,9 @@ export default class DealContractsSignPaper extends React.Component
|
||||
const docs = [];
|
||||
for(let i in this.props.documents)
|
||||
{
|
||||
docs.push({ ...this.props.documents[i], ...{ index: i, loading: true, ready: false, attorney: false } });
|
||||
docs.push({ ...this.props.documents[i], ...{ index: i, loading: true, ready: false, upload: false, } });
|
||||
}
|
||||
|
||||
this.setState({ documents: docs, loading: true });
|
||||
}
|
||||
|
||||
@ -116,129 +117,51 @@ export default class DealContractsSignPaper extends React.Component
|
||||
else
|
||||
{
|
||||
console.log({ document })
|
||||
await this._updateDocs(document.index, { loading: true });
|
||||
// await this._updateDocs(document.index, { loading: true });
|
||||
|
||||
if(document.attorney && document.attorney_selected !== undefined)
|
||||
const create_print_form_result = await signCheckEDOCreatePrintForm({ contract_number: document.id, sign_type: "Paper" });
|
||||
console.log({ create_print_form_result });
|
||||
|
||||
const docs = { status: create_print_form_result.status };
|
||||
|
||||
if(create_print_form_result.status !== "success")
|
||||
{
|
||||
const create_edo_project_result = await createEDOProject({
|
||||
contract_number: document.id,
|
||||
power_attorney: document.attorney_selected.value,
|
||||
power_attorney_number: document.attorney_selected.label,
|
||||
edo_box: operator_selected.edo_box,
|
||||
});
|
||||
docs.loading = false;
|
||||
docs.error = true;
|
||||
docs.ready = true;
|
||||
docs.message = create_print_form_result.message;
|
||||
}
|
||||
|
||||
console.log("\n\nIMPORTANT !!!!!!!!!!\n\n");
|
||||
console.log({ create_edo_project_result });
|
||||
await this._updateDocs(document.index, docs);
|
||||
|
||||
if(create_print_form_result.status === "success")
|
||||
{
|
||||
const get_guid_entity_result = await signGetGUIDEntity({
|
||||
contract_number: document.id,
|
||||
});
|
||||
|
||||
console.log("\n\nENTITY !!!!!!!!!!\n\n");
|
||||
console.log({ get_guid_entity_result });
|
||||
const wmdoc_result = await signGetWMDoc({
|
||||
entity_name: "evo_contract",
|
||||
entity_id: get_guid_entity_result.entityid,
|
||||
sign_type: "Paper",
|
||||
evo_id: "60",
|
||||
});
|
||||
console.log({ wmdoc_result });
|
||||
|
||||
const connect_result = await docEDOConnect({ contract_number: document.id });
|
||||
|
||||
await this._updateDocs(document.index, {
|
||||
entity_id: get_guid_entity_result.entityid,
|
||||
ready: true,
|
||||
loading: false,
|
||||
attorney: false,
|
||||
});
|
||||
|
||||
callback();
|
||||
}
|
||||
else
|
||||
{
|
||||
const create_print_form_result = await signCheckEDOCreatePrintForm({ contract_number: document.id, sign_type: "EDO" });
|
||||
console.log({ create_print_form_result });
|
||||
|
||||
const docs = { status: create_print_form_result.status };
|
||||
|
||||
if(create_print_form_result.status !== "success")
|
||||
{
|
||||
docs.loading = false;
|
||||
docs.error = true;
|
||||
docs.ready = true;
|
||||
docs.message = create_print_form_result.message;
|
||||
}
|
||||
|
||||
await this._updateDocs(document.index, docs);
|
||||
|
||||
if(create_print_form_result.status === "success")
|
||||
{
|
||||
const check_attorney_client_result = await signCheckPowerAttorneyClient({ contract_number: document.id })
|
||||
console.log({ check_attorney_client_result });
|
||||
|
||||
await this._updateDocs(document.index, { attorney: check_attorney_client_result.power_attorney_required, });
|
||||
|
||||
if(check_attorney_client_result.power_attorney_required)
|
||||
{
|
||||
const get_attorney_client_result = await signGetPowerAttorneyClient({ contract_number: document.id });
|
||||
console.log({ get_attorney_client_result });
|
||||
|
||||
if(get_attorney_client_result === null)
|
||||
{
|
||||
await this._updateDocs(document.index, { loading: false, error: true, ready: true, message: "Возникла ошибка при создании документа для подписания." });
|
||||
callback();
|
||||
}
|
||||
else
|
||||
{
|
||||
if(get_attorney_client_result.length === null)
|
||||
{
|
||||
await this._updateDocs(document.index, { loading: false, error: true, ready: true, message: "Не обнаружена доверенность на подписанта. Для продолжения подписания обратитесь к своему персональному менеджеру" });
|
||||
callback();
|
||||
}
|
||||
else
|
||||
{
|
||||
const attorneys = [];
|
||||
for(let i in get_attorney_client_result)
|
||||
{
|
||||
attorneys.push({
|
||||
value: get_attorney_client_result[i].power_attorney,
|
||||
label: get_attorney_client_result[i].power_attorney_number,
|
||||
});
|
||||
}
|
||||
|
||||
await this._updateDocs(document.index, { loading: false, error: false, attorneys, attorney_selected: undefined });
|
||||
|
||||
callback();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
const create_edo_project_result = await createEDOProject({
|
||||
contract_number: document.id,
|
||||
edo_box: operator_selected.edo_box,
|
||||
});
|
||||
|
||||
const get_guid_entity_result = await signGetGUIDEntity({
|
||||
contract_number: document.id,
|
||||
});
|
||||
|
||||
const wmdoc_result = await signGetWMDoc({
|
||||
entity_name: "evo_contract",
|
||||
entity_id: get_guid_entity_result.entityid,
|
||||
sign_type: "EDO",
|
||||
evo_id: "144",
|
||||
});
|
||||
console.log({ wmdoc_result });
|
||||
|
||||
const connect_result = await docEDOConnect({ contract_number: document.id });
|
||||
|
||||
await this._updateDocs(document.index, {
|
||||
entity_id: get_guid_entity_result.entityid,
|
||||
ready: true,
|
||||
loading: false,
|
||||
attorney: false,
|
||||
});
|
||||
|
||||
callback();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
callback();
|
||||
}
|
||||
await this._updateDocs(document.index, { loading: false, error: true, ready: true, message: "Возникла ошибка при создании документа для подписания." });
|
||||
callback();
|
||||
}
|
||||
}
|
||||
}, () =>
|
||||
@ -276,12 +199,6 @@ export default class DealContractsSignPaper extends React.Component
|
||||
}
|
||||
}
|
||||
|
||||
_handle_onAttorneyChange = (index, attorney) =>
|
||||
{
|
||||
console.log("_handle_onAttorneyChange", { index, attorney });
|
||||
this._updateDocs(index, { attorney_selected: attorney });
|
||||
}
|
||||
|
||||
_handle_onDownloadFile = (index, entity_id, name) =>
|
||||
{
|
||||
console.log("_handle_onDownloadFile", { index, entity_id });
|
||||
@ -401,23 +318,11 @@ export default class DealContractsSignPaper extends React.Component
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
{ document.attorney && (
|
||||
{ document.upload && (
|
||||
<>
|
||||
<div className="status_icon await"></div>
|
||||
<div className="edo_sign_status_attorney_select">
|
||||
<Select
|
||||
id="edo_attorneys_list"
|
||||
name="edo_attorneys_list"
|
||||
options={ document.attorneys }
|
||||
placeholder="Выберите доверенность"
|
||||
noOptionsMessage={ ({ inputValue }) => !inputValue ? "" :"Ничего не найдено" }
|
||||
isSearchable={ true }
|
||||
className="autocomlete autocomlete_with_indicators"
|
||||
classNamePrefix="react-select"
|
||||
value={ document.attorney_selected }
|
||||
onChange={ (element) => { this._handle_onAttorneyChange(document.index, element) } }
|
||||
required={ true }
|
||||
/>
|
||||
UPLOAD
|
||||
</div>
|
||||
</>
|
||||
) }
|
||||
|
||||
@ -853,6 +853,7 @@ class SignPlannedContract extends React.Component
|
||||
disabled: false,
|
||||
status: undefined,
|
||||
contract_entity_id: undefined,
|
||||
url: undefined,
|
||||
};
|
||||
}
|
||||
|
||||
@ -865,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 });
|
||||
this.setState({ contract_entity_id: status_result.edoid, status: status_result.status, loading: false, url: status_result.edo_url });
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -920,9 +921,14 @@ class SignPlannedContract extends React.Component
|
||||
console.log("_handle_sendToEDO");
|
||||
}
|
||||
|
||||
_handle_goToEDO = () =>
|
||||
_handle_onGoToEDO = () =>
|
||||
{
|
||||
console.log("_handle_goToEDO");
|
||||
const { url } = this.state;
|
||||
|
||||
if(url !== undefined && url !== null)
|
||||
{
|
||||
window.open(url, "_blank");
|
||||
}
|
||||
}
|
||||
|
||||
render()
|
||||
@ -970,7 +976,7 @@ class SignPlannedContract extends React.Component
|
||||
<button className="button blue" disabled={ disabled } style={{ minWidth: "145px" }} onClick={ () => this._handle_sendToEDO() }>Отправить в ЭДО</button>
|
||||
) }
|
||||
{ status >= 2 && (
|
||||
<button className="button blue" style={{ minWidth: "145px" }} onClick={ () => this._handle_goToEDO() }>Перейти в ЭДО</button>
|
||||
<button className="button blue" style={{ minWidth: "145px" }} onClick={ () => this._handle_onGoToEDO() }>Перейти в ЭДО</button>
|
||||
) }
|
||||
</div>
|
||||
) }
|
||||
|
||||
@ -152,6 +152,16 @@ class EDOSign extends React.Component
|
||||
console.log("\n\nENTITY !!!!!!!!!!\n\n");
|
||||
console.log({ get_guid_entity_result });
|
||||
|
||||
const wmdoc_result = await signGetWMDoc({
|
||||
entity_name: "evo_contract",
|
||||
entity_id: get_guid_entity_result.entityid,
|
||||
sign_type: "EDO",
|
||||
evo_id: "144",
|
||||
});
|
||||
console.log({ wmdoc_result });
|
||||
|
||||
const connect_result = await docEDOConnect({ contract_number: document.id });
|
||||
|
||||
await this._updateDocs(document.index, {
|
||||
entity_id: get_guid_entity_result.entityid,
|
||||
ready: true,
|
||||
@ -252,6 +262,7 @@ class EDOSign extends React.Component
|
||||
}
|
||||
else
|
||||
{
|
||||
await this._updateDocs(document.index, { loading: false, error: true, ready: true, message: "Возникла ошибка при создании документа для подписания." });
|
||||
callback();
|
||||
}
|
||||
}
|
||||
@ -260,11 +271,11 @@ class EDOSign extends React.Component
|
||||
{
|
||||
if(this._checkDocumentsCompleted())
|
||||
{
|
||||
this.setState({ loading: false, finished: true, });
|
||||
this.setState({ loading: false, disabled: false, finished: true, });
|
||||
}
|
||||
else
|
||||
{
|
||||
this.setState({ loading: false });
|
||||
this.setState({ loading: false, disabled: false, finished: false, });
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -331,6 +342,7 @@ class EDOSign extends React.Component
|
||||
});
|
||||
|
||||
await this._updateDocs(index, { loading: false, disabled: false, });
|
||||
this.setState({ loading: false, disabled: false, });
|
||||
});
|
||||
}
|
||||
|
||||
@ -375,27 +387,43 @@ class EDOSign extends React.Component
|
||||
|
||||
_handle_onCheckEDOStatus = async (index) =>
|
||||
{
|
||||
const { documents } = this.state;
|
||||
|
||||
await this._updateDocs(index, { loading: true });
|
||||
|
||||
this.setState({ loading: true, disabled: true }, async () =>
|
||||
{
|
||||
const status_result = await docEDOStatus({ contract_number: document.id });
|
||||
const status_result = await docEDOStatus({ contract_number: documents[index].id });
|
||||
console.log({ status_result });
|
||||
|
||||
if(status_result.status === 3)
|
||||
if(status_result.status >= 2)
|
||||
{
|
||||
await this._updateDocs(index, { loading: false, disabled: false, signing: false, completed: true, });
|
||||
await this._updateDocs(index, { loading: false, disabled: false, signing: false, completed: true, url: status_result.url_edo, });
|
||||
}
|
||||
else
|
||||
{
|
||||
await this._updateDocs(index, { loading: false, disabled: false, signing: true, completed: false, });
|
||||
await this._updateDocs(index, { loading: false, disabled: false, signing: true, completed: false, url: status_result.url_edo, });
|
||||
}
|
||||
|
||||
if(this._checkDocumentsCompleted())
|
||||
{
|
||||
this.setState({ loading: false, disabled: false, finished: true, });
|
||||
}
|
||||
else
|
||||
{
|
||||
this.setState({ loading: false, disabled: false, finished: false, });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
_handle_onGoToEDO = () =>
|
||||
{
|
||||
|
||||
const { documents } = this.state;
|
||||
|
||||
if(documents[index].url !== undefined && documents[index].url !== null)
|
||||
{
|
||||
window.open(documents[index].url, "_blank");
|
||||
}
|
||||
}
|
||||
|
||||
render()
|
||||
|
||||
@ -2,12 +2,16 @@ import CRMRequestGet from '../../../../../lib/CRMRequestGet';
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
console.log("API", "SIGN", "/attorney/check");
|
||||
console.log("\n\n", "API", "SIGN", "/attorney/check");
|
||||
|
||||
const { contract_number } = req.body;
|
||||
const payload = {
|
||||
contract_number,
|
||||
};
|
||||
|
||||
await CRMRequestGet({ req, res, path: `${ process.env.CRM_API_HOST }/lk/Contract/CheckPowerAttorneyClient`, params: payload });
|
||||
await CRMRequestGet({ req, res,
|
||||
path: `${ process.env.CRM_API_HOST }/lk/Contract/CheckPowerAttorneyClient`,
|
||||
params: payload,
|
||||
log: true,
|
||||
});
|
||||
}
|
||||
@ -2,12 +2,16 @@ import CRMRequestGet from '../../../../../lib/CRMRequestGet';
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
console.log("API", "SIGN", "/attorney/get");
|
||||
console.log("\n\n", "API", "SIGN", "/attorney/get");
|
||||
|
||||
const { contract_number } = req.body;
|
||||
const payload = {
|
||||
contract_number,
|
||||
};
|
||||
|
||||
await CRMRequestGet({ req, res, path: `${ process.env.CRM_API_HOST }/lk/Contract/GetPowerAttorneyClient`, params: payload });
|
||||
await CRMRequestGet({ req, res,
|
||||
path: `${ process.env.CRM_API_HOST }/lk/Contract/GetPowerAttorneyClient`,
|
||||
params: payload,
|
||||
log: true,
|
||||
});
|
||||
}
|
||||
@ -2,7 +2,7 @@ import CRMRequestGet from '../../../../../lib/CRMRequestGet';
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
console.log("API", "SIGN", "/cancel/check");
|
||||
console.log("\n\n", "API", "SIGN", "/cancel/check");
|
||||
|
||||
const { contract_number, sign_type } = req.body;
|
||||
const payload = {
|
||||
@ -18,5 +18,9 @@ export default async function handler(req, res)
|
||||
payload.doc_type_id = 60;
|
||||
}
|
||||
|
||||
await CRMRequestGet({ req, res, path: `${ process.env.CRM_API_HOST }/lk/Contract/CheckCancelDocument`, params: payload });
|
||||
await CRMRequestGet({ req, res,
|
||||
path: `${ process.env.CRM_API_HOST }/lk/Contract/CheckCancelDocument`,
|
||||
params: payload,
|
||||
log: true,
|
||||
});
|
||||
}
|
||||
@ -2,7 +2,7 @@ import CRMRequestGet from '../../../../../lib/CRMRequestGet';
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
console.log("API", "SIGN", "/cancel");
|
||||
console.log("\n\n", "API", "SIGN", "/cancel");
|
||||
|
||||
const { contract_number, sign_type } = req.body;
|
||||
const payload = {
|
||||
@ -18,5 +18,9 @@ export default async function handler(req, res)
|
||||
payload.doc_type_id = 60;
|
||||
}
|
||||
|
||||
await CRMRequestGet({ req, res, path: `${ process.env.CRM_API_HOST }/lk/Contract/CancelDocument`, params: payload });
|
||||
await CRMRequestGet({ req, res,
|
||||
path: `${ process.env.CRM_API_HOST }/lk/Contract/CancelDocument`,
|
||||
params: payload,
|
||||
log: true,
|
||||
});
|
||||
}
|
||||
@ -2,7 +2,7 @@ import CRMRequestGet from '../../../../lib/CRMRequestGet';
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
console.log("API", "SIGN", "/check");
|
||||
console.log("\n\n", "API", "SIGN", "/check");
|
||||
|
||||
const { contract_number, sign_type } = req.body;
|
||||
const payload = {
|
||||
@ -10,5 +10,9 @@ export default async function handler(req, res)
|
||||
sign_type
|
||||
};
|
||||
|
||||
await CRMRequestGet({ req, res, path: `${ process.env.CRM_API_HOST }/lk/Contract/CheckCreatePrintForm`, params: payload });
|
||||
await CRMRequestGet({ req, res,
|
||||
path: `${ process.env.CRM_API_HOST }/lk/Contract/CheckCreatePrintForm`,
|
||||
params: payload,
|
||||
log: true,
|
||||
});
|
||||
}
|
||||
@ -2,7 +2,7 @@ import CRMRequestGet from '../../../../../lib/CRMRequestGet';
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
console.log("API", "SIGN", "/document/connect");
|
||||
console.log("\n\n", "API", "SIGN", "/document/connect");
|
||||
|
||||
const { contract_number } = req.body;
|
||||
const payload = {
|
||||
@ -14,5 +14,6 @@ export default async function handler(req, res)
|
||||
await CRMRequestGet({ req, res,
|
||||
path: `${ process.env.CRM_API_HOST }/lk/Contract/DocEdoConnect`,
|
||||
params: payload,
|
||||
log: true,
|
||||
});
|
||||
}
|
||||
@ -2,7 +2,7 @@ import CRMRequestGet from '../../../../../lib/CRMRequestGet';
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
console.log("API", "SIGN", "/document/create");
|
||||
console.log("\n\n", "API", "SIGN", "/document/create");
|
||||
|
||||
const { entity_name, entity_id, sign_type, evo_id } = req.body;
|
||||
const payload = {
|
||||
@ -21,5 +21,6 @@ export default async function handler(req, res)
|
||||
path: `${ process.env.CRM_API_HOST }/File/GetWMDoc`,
|
||||
data: JSON.stringify(payload),
|
||||
headers: { "Content-Type": "application/json" },
|
||||
log: true,
|
||||
});
|
||||
}
|
||||
@ -10,7 +10,7 @@ import { cors } from '../../../../../lib/cors';
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
console.log("API", "SIGN", "/document/download");
|
||||
console.log("\n\n", "API", "SIGN", "/document/download");
|
||||
|
||||
await cors(req, res);
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@ import CRMRequestGet from '../../../../../lib/CRMRequestGet';
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
console.log("API", "SIGN", "/document/link");
|
||||
console.log("\n\n", "API", "SIGN", "/document/link");
|
||||
|
||||
const { contract_number } = req.body;
|
||||
const payload = {
|
||||
@ -14,5 +14,6 @@ export default async function handler(req, res)
|
||||
await CRMRequestGet({ req, res,
|
||||
path: `${ process.env.CRM_API_HOST }/lk/Contract/GetFileContractProject`,
|
||||
params: payload,
|
||||
log: true,
|
||||
});
|
||||
}
|
||||
@ -2,7 +2,7 @@ import CRMRequestGet from '../../../../../lib/CRMRequestGet';
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
console.log("API", "SIGN", "/document/status");
|
||||
console.log("\n\n", "API", "SIGN", "/document/status");
|
||||
|
||||
const { contract_number } = req.body;
|
||||
const payload = {
|
||||
@ -14,5 +14,6 @@ export default async function handler(req, res)
|
||||
await CRMRequestGet({ req, res,
|
||||
path: `${ process.env.CRM_API_HOST }/lk/Contract/GetEdoProjectID`,
|
||||
params: payload,
|
||||
log: true,
|
||||
});
|
||||
}
|
||||
@ -2,12 +2,16 @@ import CRMRequestGet from '../../../../lib/CRMRequestGet';
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
console.log("API", "SIGN", "/entity");
|
||||
console.log("\n\n", "API", "SIGN", "/entity");
|
||||
|
||||
const { contract_number } = req.body;
|
||||
const payload = {
|
||||
contract_number
|
||||
};
|
||||
|
||||
await CRMRequestGet({ req, res, path: `${ process.env.CRM_API_HOST }/lk/Contract/GetGUIDEntity`, params: payload });
|
||||
await CRMRequestGet({ req, res,
|
||||
path: `${ process.env.CRM_API_HOST }/lk/Contract/GetGUIDEntity`,
|
||||
params: payload,
|
||||
log: true,
|
||||
});
|
||||
}
|
||||
@ -7,7 +7,7 @@ import CRMRequestPost from '../../../lib/CRMRequestPost';
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
console.log("API", "DEALS", "quote");
|
||||
console.log("\n\n", "API", "DEALS", "quote");
|
||||
console.log(req.body);
|
||||
console.log("-".repeat(50));
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@ import CRMRequestGet from '../../../lib/CRMRequestGet';
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
console.log("API", "DEALS", "contracts");
|
||||
console.log("\n\n", "API", "DEALS", "contracts");
|
||||
console.log(req.body);
|
||||
console.log("-".repeat(50));
|
||||
|
||||
|
||||
@ -13,6 +13,8 @@ import RedisClient from '../../../lib/RedisClient';
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
console.log("\n\n", "API", "DEALS", "documents");
|
||||
|
||||
await cors(req, res);
|
||||
const { deal_id } = req.body;
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@ const upload = multer({ storage: storage, limits: { fileSize: 1024 * 1024 * 300
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
console.log("API", "DEALS", "FILE", "upload");
|
||||
console.log("\n\n", "API", "DEALS", "FILE", "upload");
|
||||
await cors(req, res);
|
||||
|
||||
return new Promise(async (resolve) =>
|
||||
|
||||
@ -18,7 +18,7 @@ const upload = multer({ storage: storage });
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
console.log("API", "DEALS", "FILE", "remove");
|
||||
console.log("\n\n", "API", "DEALS", "FILE", "remove");
|
||||
await cors(req, res);
|
||||
|
||||
return new Promise(async (resolve) =>
|
||||
|
||||
@ -7,5 +7,7 @@ import CRMRequestGet from '../../../lib/CRMRequestGet';
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
console.log("\n\n", "API", "DEALS", "index");
|
||||
|
||||
await CRMRequestGet({ req, res, path: `${ process.env.CRM_API_HOST }/lk/ConsiderationOpportunity/`, params: {} });
|
||||
}
|
||||
@ -10,7 +10,7 @@ import { cors } from '../../../../lib/cors';
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
console.log("API", "DEALS", "/offer/download");
|
||||
console.log("\n\n", "API", "DEALS", "/offer/download");
|
||||
|
||||
await cors(req, res);
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@ import CRMRequestGet from '../../../../lib/CRMRequestGet';
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
console.log("API", "DEALS", "offers");
|
||||
console.log("\n\n", "API", "DEALS", "offers");
|
||||
console.log(req.body);
|
||||
console.log("-".repeat(50));
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@ import CRMRequestGet from '../../../lib/CRMRequestGet';
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
console.log("API", "DEALS", "offers");
|
||||
console.log("\n\n", "API", "DEALS", "offers");
|
||||
console.log(req.body);
|
||||
console.log("-".repeat(50));
|
||||
|
||||
|
||||
@ -120,6 +120,8 @@ function uploadFile({ deal_id, filename, name, group, crm_jwt })
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
console.log("\n\n", "API", "DEALS", "upload");
|
||||
|
||||
await cors(req, res);
|
||||
|
||||
// const { number, entity, id, filename } = req.query;
|
||||
|
||||
@ -5,7 +5,7 @@ import CRMRequestGet from '../../../lib/CRMRequestGet';
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
console.log("API", "EDO", "/cancel");
|
||||
console.log("\n\n", "API", "EDO", "/cancel");
|
||||
|
||||
const { contract_number, doc_type_id, } = req.body;
|
||||
const payload = {
|
||||
@ -13,5 +13,9 @@ export default async function handler(req, res)
|
||||
doc_type_id,
|
||||
};
|
||||
|
||||
await CRMRequestGet({ req, res, path: `${ process.env.CRM_API_HOST }/lk/Contract/CancelDocument`, params: payload });
|
||||
await CRMRequestGet({ req, res,
|
||||
path: `${ process.env.CRM_API_HOST }/lk/Contract/CancelDocument`,
|
||||
params: payload,
|
||||
log: true,
|
||||
});
|
||||
}
|
||||
@ -6,7 +6,11 @@ import CRMRequestGet from '../../../../lib/CRMRequestGet';
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
console.log("API", "EDO", "/invite/send");
|
||||
console.log("\n\n", "API", "EDO", "/invite/send");
|
||||
|
||||
await CRMRequestGet({ req, res, path: `${ process.env.CRM_API_HOST }/lk/Account/InviteEdoBox`, params: {} });
|
||||
await CRMRequestGet({ req, res,
|
||||
path: `${ process.env.CRM_API_HOST }/lk/Account/InviteEdoBox`,
|
||||
params: {},
|
||||
log: true,
|
||||
});
|
||||
}
|
||||
@ -5,7 +5,11 @@ import CRMRequestGet from '../../../lib/CRMRequestGet';
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
console.log("API", "EDO", "/invites");
|
||||
console.log("\n\n", "API", "EDO", "/invites");
|
||||
|
||||
await CRMRequestGet({ req, res, path: `${ process.env.CRM_API_HOST }/lk/Account/GetInviteEdoBox`, params: {} });
|
||||
await CRMRequestGet({ req, res,
|
||||
path: `${ process.env.CRM_API_HOST }/lk/Account/GetInviteEdoBox`,
|
||||
params: {},
|
||||
log: true,
|
||||
});
|
||||
}
|
||||
@ -5,7 +5,11 @@ import CRMRequestGet from '../../../lib/CRMRequestGet';
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
console.log("API", "EDO", "/operators");
|
||||
console.log("\n\n", "API", "EDO", "/operators");
|
||||
|
||||
await CRMRequestGet({ req, res, path: `${ process.env.CRM_API_HOST }/lk/Account/GetEdoBox`, params: {} });
|
||||
await CRMRequestGet({ req, res,
|
||||
path: `${ process.env.CRM_API_HOST }/lk/Account/GetEdoBox`,
|
||||
params: {},
|
||||
log: true,
|
||||
});
|
||||
}
|
||||
@ -2,7 +2,7 @@ import CRMRequestGet from '../../../lib/CRMRequestGet';
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
console.log("API", "EDO", "/project");
|
||||
console.log("\n\n", "API", "EDO", "/project");
|
||||
|
||||
const { contract_number, power_attorney, power_attorney_number, edo_box, } = req.body;
|
||||
const payload = {
|
||||
@ -12,5 +12,9 @@ export default async function handler(req, res)
|
||||
edo_box,
|
||||
};
|
||||
|
||||
await CRMRequestGet({ req, res, path: `${ process.env.CRM_API_HOST }/lk/Contract/CreateEDOProject`, params: payload });
|
||||
await CRMRequestGet({ req, res,
|
||||
path: `${ process.env.CRM_API_HOST }/lk/Contract/CreateEDOProject`,
|
||||
params: payload,
|
||||
log: true,
|
||||
});
|
||||
}
|
||||
@ -2,12 +2,16 @@ import CRMRequestGet from '../../../lib/CRMRequestGet';
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
console.log("API", "EDO", "/sign");
|
||||
console.log("\n\n", "API", "EDO", "/sign");
|
||||
|
||||
const { edoid } = req.body;
|
||||
const payload = {
|
||||
edoid,
|
||||
};
|
||||
|
||||
await CRMRequestGet({ req, res, path: `${ process.env.CRM_API_HOST }/lk/Contract/SignEDODocument`, params: payload });
|
||||
await CRMRequestGet({ req, res,
|
||||
path: `${ process.env.CRM_API_HOST }/lk/Contract/SignEDODocument`,
|
||||
params: payload,
|
||||
log: true,
|
||||
});
|
||||
}
|
||||
@ -653,14 +653,13 @@ export default class Options extends React.Component
|
||||
{
|
||||
//console.log("_handle_onCalculate ?");
|
||||
|
||||
|
||||
const selected = {
|
||||
number_planpayment: options.number_planpayment.value,
|
||||
};
|
||||
|
||||
if(number_paydate !== null) { selected.number_paydate = moment(number_paydate).format(); }
|
||||
if(period_new !== null) { selected.period_new = period_new; }
|
||||
if(fix_last_payment_available !== null) { selected.fix_last_payment_available = fix_last_payment_available; }
|
||||
if(fix_last_payment_available !== null) { selected.fix_last_payment_available = fix_last_payment_available; }
|
||||
if(date_offset_type !== null) { selected.date_offset_type = date_offset_type; }
|
||||
if(sum !== null) { selected.sum = sum; }
|
||||
if(insurance_price_result !== null) { selected.insurance_price_result = insurance_price_result; }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user