This commit is contained in:
merelendor 2023-10-04 10:43:03 +03:00
commit 806941a482
11 changed files with 617 additions and 100 deletions

View File

@ -132,4 +132,36 @@ export const inviteToEDO = () =>
reject(error.data);
});
});
}
export const createEDOProject = (payload) =>
{
const url = `${ process.env.NEXT_PUBLIC_SELF_API_HOST }/api/edo/project`;
console.log("ACTION", "edo", "createEDOProject()", { url });
return new Promise((resolve, reject) =>
{
axios.post(url, payload, {
withCredentials: true,
})
.then((response) =>
{
console.log("ACTION", "edo", "createEDOProject()", "response", response.data);
resolve(response.data);
})
.catch((error) =>
{
console.error("ACTION", "edo", "createEDOProject()", "ERROR");
console.error(error);
reject(error.data);
});
});
}
export const docEDOConnect = ({ contract_number }) =>
{
}

View File

@ -8,36 +8,30 @@ import { concatSeries, eachSeries } from 'async';
import * as actionTypes from '../constants/actionTypes';
import * as currentState from '../reducers/initialState';
export const signCheckEDOCreatePrintForm = ({ contracts, sign_type }) =>
export const signCheckEDOCreatePrintForm = ({ contract_number, sign_type }) =>
{
const url = `${ process.env.NEXT_PUBLIC_SELF_API_HOST }/api/contract/sign/check`;
console.log("ACTION", "edo", "signCheckEDOCreatePrintForm()", { url });
console.log("ACTION", "sign", "signCheckEDOCreatePrintForm()", { url });
return new Promise((resolve, reject) =>
{
concatSeries(contracts, (contract_id, callback) =>
{
axios.post(url, { contract_number: contract_id, sign_type }, {
withCredentials: true,
})
.then((response) =>
{
console.log("ACTION", "edo", "signCheckEDOCreatePrintForm()", "response", response.data);
callback(response.data);
})
.catch((error) =>
{
console.error("ACTION", "edo", "signCheckEDOCreatePrintForm()", "ERROR");
console.error(error);
callback(error.data);
});
}, (error, result) =>
{
resolve(result);
axios.post(url, { contract_number, sign_type }, {
withCredentials: true,
})
.then((response) =>
{
console.log("ACTION", "sign", "signCheckEDOCreatePrintForm()", "response", response.data);
resolve(response.data);
})
.catch((error) =>
{
console.error("ACTION", "sign", "signCheckEDOCreatePrintForm()", "ERROR");
console.error(error);
reject(error.data);
});
});
}
@ -45,31 +39,97 @@ export const signGetGUIDEntity = ({ contract_number }) =>
{
const url = `${ process.env.NEXT_PUBLIC_SELF_API_HOST }/api/contract/sign/entity`;
console.log("ACTION", "edo", "signGetGUIDEntity()", { url });
console.log("ACTION", "sign", "signGetGUIDEntity()", { url });
return new Promise((resolve, reject) =>
{
concatSeries(contracts, (contract_id, callback) =>
{
axios.post(url, { contract_number: contract_id, sign_type }, {
withCredentials: true,
})
.then((response) =>
{
console.log("ACTION", "edo", "signGetGUIDEntity()", "response", response.data);
callback(response.data);
})
.catch((error) =>
{
console.error("ACTION", "edo", "signGetGUIDEntity()", "ERROR");
console.error(error);
callback(error.data);
});
}, (error, result) =>
{
resolve(result);
axios.post(url, { contract_number }, {
withCredentials: true,
})
.then((response) =>
{
console.log("ACTION", "sign", "signGetGUIDEntity()", "response", response.data);
resolve(response.data);
})
.catch((error) =>
{
console.error("ACTION", "sign", "signGetGUIDEntity()", "ERROR");
console.error(error);
resolve(response.data);
});
});
}
export const signCheckPowerAttorneyClient = ({ contract_number }) =>
{
const url = `${ process.env.NEXT_PUBLIC_SELF_API_HOST }/api/contract/sign/attorney/check`;
return new Promise((resolve, reject) =>
{
axios.post(url, { contract_number }, {
withCredentials: true,
})
.then((response) =>
{
console.log("ACTION", "sign", "signCheckPowerAttorneyClient()", "response", response.data);
resolve(response.data);
})
.catch((error) =>
{
console.error("ACTION", "sign", "signCheckPowerAttorneyClient()", "ERROR");
console.error(error);
reject(error.data);
});
});
}
export const signGetPowerAttorneyClient = ({ contract_number }) =>
{
const url = `${ process.env.NEXT_PUBLIC_SELF_API_HOST }/api/contract/sign/attorney/get`;
return new Promise((resolve, reject) =>
{
axios.post(url, { contract_number }, {
withCredentials: true,
})
.then((response) =>
{
console.log("ACTION", "sign", "signGetPowerAttorneyClient()", "response", response.data);
resolve(response.data);
})
.catch((error) =>
{
console.error("ACTION", "sign", "signGetPowerAttorneyClient()", "ERROR");
console.error(error);
reject(error.data);
});
});
}
export const signGetWMDoc = (payload) =>
{
const url = `${ process.env.NEXT_PUBLIC_SELF_API_HOST }/api/contract/sign/document`;
return new Promise((resolve, reject) =>
{
axios.post(url, payload, {
withCredentials: true,
})
.then((response) =>
{
console.log("ACTION", "sign", "signGetWMDoc()", "response", response.data);
resolve(response.data);
})
.catch((error) =>
{
console.error("ACTION", "sign", "signGetWMDoc()", "ERROR");
console.error(error);
reject(error.data);
});
});
}

View File

@ -731,6 +731,38 @@ class LeasingRegistration extends Step
key: "annulled_contracts",
},
];
this.container_ref = React.createRef();
}
_handle_onScrollToContainer = () =>
{
const element = this.container_ref.current;
const y = (element.getBoundingClientRect().top + window.scrollY - 160);
window.scrollTo({top: y, behavior: 'smooth'});
}
_handle_onPreparedContract = (contract) =>
{
const checked = [ ...this.state.checked ];
if(checked.indexOf(contract) > -1)
{
checked.splice(checked.indexOf(contract), 1);
}
else
{
checked.push(contract);
}
this.setState({ checked });
}
_handle_onSignEDO = () =>
{
this.setState({ edo: true }, () =>
{
this._handle_onScrollToContainer();
});
}
_getEDODocuments = () =>
@ -756,22 +788,6 @@ class LeasingRegistration extends Step
return documents;
}
_handle_onPreparedContract = (contract) =>
{
const checked = [ ...this.state.checked ];
if(checked.indexOf(contract) > -1)
{
checked.splice(checked.indexOf(contract), 1);
}
else
{
checked.push(contract);
}
this.setState({ checked });
}
_render_preparedContracts = () =>
{
const { edo, checked } = this.state;
@ -813,7 +829,7 @@ class LeasingRegistration extends Step
{ contracts.length > 0 &&
(
<div className="block_footer_btn">
<button className="button button-blue" onClick={ () => this.setState({ edo: true }) } disabled={ checked.length > 0 ? false : true }>Подписать в ЭДО</button>
<button className="button button-blue" onClick={ this._handle_onSignEDO } disabled={ checked.length > 0 ? false : true }>Подписать в ЭДО</button>
<button className="button button-blue" disabled={ checked.length > 0 ? false : true }>Подписать в бумажном виде</button>
</div>
) }
@ -1001,7 +1017,7 @@ class LeasingRegistration extends Step
const { open, edo } = this.state;
return (
<div className={`${ this.status.indexOf( statuscode_id ) > -1 ? "current" : statuscode_id > this.status[ 0 ] ? "done" : "" }`}>
<div className={`${ this.status.indexOf( statuscode_id ) > -1 ? "current" : statuscode_id > this.status[ 0 ] ? "done" : "" }`} ref={ this.container_ref }>
<p> { dealSelected }</p>
<span></span>
<div className="status_body">
@ -1043,6 +1059,7 @@ export default class SingleDeal extends React.Component
constructor(props)
{
super(props);
this.leasing_registration_ref = React.createRef();
}
render()

View File

@ -2,8 +2,12 @@ import React from "react";
import { connect } from "react-redux";
import moment from "moment";
import { SpinnerCircular } from "spinners-react";
import { concatSeries } from "async";
import { eachSeries } from 'async';
import Select from 'react-select';
import { signCheckEDOCreatePrintForm } from "../../actions";
import { createEDOProject, signCheckEDOCreatePrintForm, signCheckPowerAttorneyClient, signGetGUIDEntity, signGetPowerAttorneyClient, signGetWMDoc } from "../../actions";
//import { getDeals, getDealOffers, getDealDocuments, getDealContracts } from "../../actions";
class EDOSign extends React.Component
@ -14,7 +18,9 @@ class EDOSign extends React.Component
this.state = {
operators: null,
loading: false,
selected: {},
documents: [],
operator_selected: {},
statuses: {},
}
}
@ -28,49 +34,215 @@ class EDOSign extends React.Component
componentDidMount()
{
if(this.state.selected.box_id === undefined)
const docs = [];
for(let i in this.props.documents)
{
this.setState({ selected: this.state.operators !== null && this.state.operators[0] !== undefined ? this.state.operators[0] : {} });
docs.push({ ...this.props.documents[i], ...{ index: i, loading: true, completed: false, attorney: false } });
}
this.setState({ documents: docs });
if(this.state.operator_selected.box_id === undefined)
{
this.setState({ operator_selected: this.state.operators !== null && this.state.operators[0] !== undefined ? this.state.operators[0] : {} });
}
}
_updateDocs = (id, update) =>
{
return new Promise((resolve) =>
{
const docs = [ ...this.state.documents ];
docs[ id ] = { ...docs[id], ...update };
this.setState({ documents: docs }, () =>
{
resolve();
});
});
}
_handle_onFormSubmit = (event) =>
{
event.preventDefault();
const { documents } = this.props;
const { selected } = this.state;
//const { documents } = this.props;
const { operator_selected } = this.state;
const documents = [ ...this.state.documents ];
console.log("_handle_onFormSubmit");
console.log({ documents, selected });
console.log({ documents, operator_selected });
this.setState({ loading: true }, () =>
{
const contracts = [];
for(let i in documents)
eachSeries(documents, async (document, callback) =>
{
contracts.push(documents[i].id);
signCheckEDOCreatePrintForm({ contracts, sign_type: "EDO" })
.then((checks) =>
if(document.completed)
{
console.log({ checks });
})
.catch((error) =>
callback();
}
else
{
console.log({ error });
});
}
console.log({ document })
await this._updateDocs(document.index, { loading: true });
if(document.attorney && document.attorney_selected !== undefined)
{
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,
});
console.log("\n\nIMPORTANT !!!!!!!!!!\n\n");
console.log({ create_edo_project_result });
const get_guid_entity_result = await signGetGUIDEntity({
contract_number: document.id,
});
console.log("\n\nENTITY !!!!!!!!!!\n\n");
console.log({ get_guid_entity_result });
await this._updateDocs(document.index, {
entity_id: get_guid_entity_result.entityid,
completed: true,
loading: false,
attorney: false,
});
callback();
}
else
{
const create_print_form_result = await signCheckEDOCreatePrintForm({ contract_number: document.id === "2023_5885" ? "2023_5894" : 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.completed = 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, completed: true, message: "Возникла ошибка при создании документа для подписания." });
callback();
}
else
{
if(get_attorney_client_result.length === null)
{
await this._updateDocs(document.index, { loading: false, error: true, completed: 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,
});
await this._updateDocs(document.index, {
entity_id: get_guid_entity_result.entityid,
completed: true,
loading: false,
attorney: false,
});
callback();
}
}
else
{
callback();
}
}
}
}, () =>
{
this.setState({ loading: false });
});
})
}
_handle_onSelectOperator = (operator) =>
{
this.setState({ selected: operator });
this.setState({ operator_selected: operator });
}
_handle_onAttorneyChange = (index, attorney) =>
{
console.log("_handle_onAttorneyChange", { index, attorney });
this._updateDocs(index, { attorney_selected: attorney });
}
_handle_onDownloadFile = (index, entity_id) =>
{
console.log("_handle_onDownloadFile", { index, entity_id })
this.setState({ loading: true }, async () =>
{
await this._updateDocs(index, { loading: true });
const wmdoc_result = await signGetWMDoc({ entity_name: "evo_contract", entity_id, sign_type: "EDO" });
console.log({ wmdoc_result });
await this._updateDocs(index, { loading: false });
});
}
_handle_onCancelFile = async (index, entity_id) =>
{
await this._updateDocs(index, { loading: true });
this.setState({ loading: true }, async () =>
{
await this._updateDocs(index, { loading: true });
});
}
render()
{
const { operators, loading, selected } = this.state;
const { onCancel, documents } = this.props;
const { operators, documents, loading, operator_selected } = this.state;
const { onCancel, } = this.props;
console.log({ operators, documents });
return (
@ -78,13 +250,69 @@ class EDOSign extends React.Component
<div className="docs_list medium-icon">
<p className="list_title">Подписание через ЭДО</p>
</div>
<div className="docs_list medium-icon">
<div className="docs_list medium-icon edo_sign_documents_list">
{ documents.map((document, index) =>
(
<p className="doc_name i-pdf extension edo_sign_document" data-format={ document.extension } key={ index }>
{ document.name } от { moment(document.date).format("DD.MM.YYYY") }
{ document.type !== undefined && (<span>{ document.type }</span>) }
</p>
<div className="edo_sign_documents_document" key={ index }>
<div className="edo_sign_documents_document_left">
<p className="doc_name i-pdf extension edo_sign_document" data-format={ document.extension }>
{ document.name } от { moment(document.date).format("DD.MM.YYYY") }
{ document.type !== undefined && (<span>{ document.type }</span>) }
</p>
</div>
<div className="edo_sign_documents_document_right">
{ document.loading ? (
<>
{ loading && (
<SpinnerCircular size={ 22 } thickness={ 100 } speed={ 100 } color="rgba(236, 239, 244, 1)" secondaryColor="rgba(28, 1, 169, 1)" />
) }
</>
) : (
<>
{ document.error ? (
<>
<div className="status_icon error"></div>
<i>{ document.message }</i>
</>
) : (
<>
{ document.attorney && (
<>
<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 }
/>
</div>
</>
) }
{ document.completed && (
<>
<div className="status_icon success"></div>
{ document.entity_id !== undefined && (
<>
<button className="button" onClick={ () => this._handle_onDownloadFile(index, document.entity_id) }>Посмотреть проект договора</button>
<button className="button" onClick={ () => this._handle_onCancelFile(index, document.entity_id) }>Отменить подписание</button>
</>
) }
</>
) }
</>
) }
</>
) }
</div>
</div>
)) }
</div>
<form ref={ this.ref_form } onSubmit={ this._handle_onFormSubmit } onKeyDown={(e) => {if (e.key === 'Enter') e.preventDefault() }}>
@ -94,7 +322,7 @@ class EDOSign extends React.Component
{ operators !== undefined && operators !== null && operators.map((operator, index) => (
<div className="form_field checkbox item" key={ index }>
<input type="radio"
checked={ operator.box_id === selected.box_id }
checked={ operator.box_id === operator_selected.box_id }
hidden=""
id={ `operator_${ index }` }
name={ `operator_${ index }` }

View File

@ -6266,7 +6266,6 @@ main .dropdown_blocks_list.zero-margin.gibdd .dropdown_block .block_body .fines_
.edo_sign_document {
display: flex;
flex-direction: column;
margin: 30px 0px !important;
align-items: flex-start;
}
.edo_operators_settings_list {
@ -6302,3 +6301,64 @@ main .dropdown_blocks_list.zero-margin.gibdd .dropdown_block .block_body .fines_
.edo_operators_settings_list_item.invite:before {
background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z' stroke='%238E94A7' stroke-width='2' stroke-miterlimit='10'/%3E%3Cpath d='M12 6.75V12H17.25' stroke='%238E94A7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A");
}
.edo_sign_documents_list {
display: flex;
flex-direction: column;
margin-bottom: 50px;
}
.edo_sign_documents_document {
display: flex;
flex-direction: row;
gap: 0px 30px;
padding-top: 15px;
padding-bottom: 15px;
border-top: solid 1px #edeff5;
}
.edo_sign_documents_document .status_icon {
width: 24px;
min-width: 24px;
height: 24px;
min-height: 24px;
background-repeat: no-repeat;
background-position: center;
background-position-y: -1px;
background-position-x: -1px;
}
.edo_sign_documents_document .status_icon.success {
background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z' stroke='%235FB158' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M16.125 9.75L10.625 15L7.875 12.375' stroke='%235FB158' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A");
border: none !important;
}
.edo_sign_documents_document .status_icon.error {
background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z' stroke='%23ED0A34' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M13 16C13 16.5523 12.5523 17 12 17C11.4477 17 11 16.5523 11 16C11 15.4477 11.4477 15 12 15C12.5523 15 13 15.4477 13 16Z' fill='%23ED0A34'/%3E%3Cpath d='M12 8L12 12' stroke='%23ED0A34' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
border: none !important;
}
.edo_sign_documents_document .status_icon.await {
background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z' stroke='%238E94A7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M12 8L12 12' stroke='%238E94A7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M16 12L12 12' stroke='%238E94A7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
border: none !important;
}
.edo_sign_documents_document .edo_sign_documents_document_left {
width: 35%;
}
.edo_sign_documents_document .edo_sign_documents_document_right {
width: 65%;
display: flex;
align-items: center;
justify-content: flex-start;
}
.edo_sign_documents_document .edo_sign_documents_document_right i {
width: 100% !important;
height: auto !important;
font-size: 12px;
padding-left: 10px;
color: #8e94a7;
align-self: center;
justify-content: center;
line-height: 16px;
}
.edo_sign_documents_document:first-child {
border: none;
}
.edo_sign_status_attorney_select {
padding-left: 10px;
width: 100%;
}

View File

@ -7224,7 +7224,7 @@ main .dropdown_blocks_list.zero-margin.gibdd .dropdown_block {
.edo_sign_document {
display: flex;
flex-direction: column;
margin: 30px 0px !important;
// margin: 30px 0px !important;
align-items: flex-start;
}
@ -7266,4 +7266,79 @@ main .dropdown_blocks_list.zero-margin.gibdd .dropdown_block {
background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z' stroke='%238E94A7' stroke-width='2' stroke-miterlimit='10'/%3E%3Cpath d='M12 6.75V12H17.25' stroke='%238E94A7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A");
}
}
}
.edo_sign_documents_list {
display: flex;
flex-direction: column;
// gap: 30px 0px;
margin-bottom: 50px;
}
.edo_sign_documents_document {
display: flex;
flex-direction: row;
gap: 0px 30px;
padding-top: 15px;
padding-bottom: 15px;
border-top: solid 1px #edeff5;
.status_icon {
width: 24px;
min-width: 24px;
height: 24px;
min-height: 24px;
background-repeat: no-repeat;
background-position: center;
background-position-y: -1px;
background-position-x: -1px;
&.success {
background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z' stroke='%235FB158' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M16.125 9.75L10.625 15L7.875 12.375' stroke='%235FB158' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A");
border: none !important;
}
&.error {
background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z' stroke='%23ED0A34' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M13 16C13 16.5523 12.5523 17 12 17C11.4477 17 11 16.5523 11 16C11 15.4477 11.4477 15 12 15C12.5523 15 13 15.4477 13 16Z' fill='%23ED0A34'/%3E%3Cpath d='M12 8L12 12' stroke='%23ED0A34' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
border: none !important;
}
&.await {
background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z' stroke='%238E94A7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M12 8L12 12' stroke='%238E94A7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M16 12L12 12' stroke='%238E94A7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
border: none !important;
}
}
.edo_sign_documents_document_left {
width: 35%;
}
.edo_sign_documents_document_right {
width: 65%;
display: flex;
align-items: center;
justify-content: flex-start;
i {
width: 100% !important;
height: auto !important;
font-size: 12px;
padding-left: 10px;
color: #8e94a7;
align-self: center;
justify-content: center;
line-height: 16px;
}
}
&:first-child {
border: none;
}
}
.edo_sign_status_attorney_select {
padding-left: 10px;
width: 100%;
}

View File

@ -32,10 +32,11 @@ export default async function CRMRequestGet(req, res, path, params, log = false)
var client_jwt_decoded = jwt.verify(cookies.jwt, process.env.JWT_SECRET_CLIENT);
var crm_jwt = jwt.sign({ acc_number: client_jwt_decoded.acc_number }, process.env.JWT_SECRET_CRM, { noTimestamp: true });
//console.log("client_jwt_decoded", client_jwt_decoded);
//console.log("crm_jwt", crm_jwt);
if(log)
{
console.log("client_jwt_decoded", client_jwt_decoded);
console.log("crm_jwt", crm_jwt);
}
//console.log("path", path);

View File

@ -0,0 +1,13 @@
import CRMRequestGet from '../../../../../lib/CRMRequestGet';
export default async function handler(req, res)
{
console.log("API", "SIGN", "/attorney/check");
const { contract_number } = req.body;
const payload = {
contract_number,
};
await CRMRequestGet(req, res, `${ process.env.CRM_API_HOST }/lk/Contract/CheckPowerAttorneyClient`, payload);
}

View File

@ -0,0 +1,13 @@
import CRMRequestGet from '../../../../../lib/CRMRequestGet';
export default async function handler(req, res)
{
console.log("API", "SIGN", "/attorney/get");
const { contract_number } = req.body;
const payload = {
contract_number,
};
await CRMRequestGet(req, res, `${ process.env.CRM_API_HOST }/lk/Contract/GetPowerAttorneyClient`, payload);
}

View File

@ -1,18 +1,20 @@
import CRMRequestGet from '../../../lib/CRMRequestGet';
import CRMRequestGet from '../../../../lib/CRMRequestGet';
export default async function handler(req, res)
{
console.log("API", "SIGN", "/document");
const { entityName, entityId, sign_type } = req.body;
const { entity_name, entity_id, sign_type } = req.body;
const payload = {
entityName,
entityId,
entityName: entity_name,
entityId: entity_id,
reportCodes: [ "Leas_Contract" ],
inputParameters: [ sign_type ],
createDocument: true,
};
console.log({ payload });
if(sign_type === "EDO")
{
payload.documentTypeEvoId = 144;

16
pages/api/edo/project.js Normal file
View File

@ -0,0 +1,16 @@
import CRMRequestGet from '../../../lib/CRMRequestGet';
export default async function handler(req, res)
{
console.log("API", "EDO", "/project");
const { contract_number, power_attorney, power_attorney_number, edo_box, } = req.body;
const payload = {
contract_number,
power_attorney,
power_attorney_number,
edo_box,
};
await CRMRequestGet(req, res, `${ process.env.CRM_API_HOST }/lk/Contract/CreateEDOProject`, payload);
}