diff --git a/actions/fileActions.js b/actions/fileActions.js
index 09044de..131e7c3 100644
--- a/actions/fileActions.js
+++ b/actions/fileActions.js
@@ -167,6 +167,7 @@ export const getReconciliationFile = ({ contract, date_from, date_to, filename }
fileDownload(response.data, filename);
logDocumentAccess({
contract_number: contract,
+ document_name: "Акт сверки по ДЛ",
document_type: "act_bu",
document_period_from: date_from,
document_period_to: date_to,
diff --git a/components/DealsStatus/DealsList.js b/components/DealsStatus/DealsList.js
index c7086b1..329e51e 100644
--- a/components/DealsStatus/DealsList.js
+++ b/components/DealsStatus/DealsList.js
@@ -39,7 +39,7 @@ export default class DealsList extends React.Component
render()
{
- const { status, deals, questionnaire_status, dealSelected, onCloseDeal, onDealsUpdate, onDealContractsUpdate } = this.props;
+ const { status, deals, questionnaire_status, dealSelected, onCloseDeal, onDealsUpdate, onDealContractsUpdate, onQuestionnaire } = this.props;
console.log({ deals });
@@ -60,6 +60,7 @@ export default class DealsList extends React.Component
onCloseDeal={ this._handle_onCloseDeal }
onDealsUpdate={ onDealsUpdate }
onDealContractsUpdate={ onDealContractsUpdate }
+ onQuestionnaire={ onQuestionnaire }
{ ...deal }
/>)
}
diff --git a/components/DealsStatus/SingleDeal.js b/components/DealsStatus/SingleDeal.js
index 83b7da9..09270b9 100644
--- a/components/DealsStatus/SingleDeal.js
+++ b/components/DealsStatus/SingleDeal.js
@@ -456,6 +456,14 @@ class DocumentsForm extends Step
});
}
+ _handle_onQuestionnaire = (event) =>
+ {
+ const { onQuestionnaire } = this.props;
+
+ event.preventDefault();
+ onQuestionnaire();
+ }
+
_checkFilesCompleted = () =>
{
const documents_length = this.props.documents.length;
@@ -515,7 +523,7 @@ class DocumentsForm extends Step
render()
{
- const { index, statuscode_id, dealSelected, documents, questionnaire_status } = this.props;
+ const { index, statuscode_id, dealSelected, documents, questionnaire_status, } = this.props;
const { open, files, uploading, loading } = this.state;
return (
@@ -539,7 +547,7 @@ class DocumentsForm extends Step
{ questionnaire_status === "need_to_fill" ? (
Требуется обновить данные в анкете
-
+
) : (
<>
diff --git a/components/DealsStatus/index.js b/components/DealsStatus/index.js
index 3f49c73..2b9857e 100644
--- a/components/DealsStatus/index.js
+++ b/components/DealsStatus/index.js
@@ -176,8 +176,8 @@ class DealsStatus extends React.Component
render()
{
- const { currentContractModalOpened, allContractModalOpened, currentSelected, dealSelected, deals, status } = this.state
- const { questionnaire_status } = this.props;
+ const { currentContractModalOpened, allContractModalOpened, currentSelected, dealSelected, deals, status, } = this.state
+ const { questionnaire_status, onQuestionnaire, } = this.props;
return (
<>
@@ -194,6 +194,7 @@ class DealsStatus extends React.Component
onCloseDeal={ this._handle_onCloseDeal }
onDealsUpdate={ this._onDealsUpdate }
onDealContractsUpdate={ this._onDealContractsUpdate }
+ onQuestionnaire={ onQuestionnaire }
/>
{/*}
{
- const cookies = cookie.parse(req.headers?.cookie ? req.headers?.cookie : "");
-
- if(cookies.jwt !== undefined && cookies.jwt !== null)
+ if(req.headers.cookie !== undefined)
{
- var client_jwt_decoded = jwt.verify(cookies.jwt, process.env.JWT_SECRET_CLIENT);
- var crm_jwt = jwt.sign(client_jwt_decoded, process.env.JWT_SECRET_CRM, { noTimestamp: true });
+ const cookies = cookie.parse(req.headers?.cookie ? req.headers?.cookie : "");
- try
+ if(cookies.jwt !== undefined && cookies.jwt !== null)
{
- axios.get(`${ process.env.CRM_API_HOST }/lk/Contract/GetAktBU/`, {
- params: { ...client_jwt_decoded, contract_number: req.query.contract, dateBegin: req.query.date_from, dateEnd: req.query.date_to, },
- responseType: 'arraybuffer',
- headers: {
- "Authorization": `Bearer ${ crm_jwt }`,
- }
- })
- .then((crm_response) =>
+ var client_jwt_decoded = jwt.verify(cookies.jwt, process.env.JWT_SECRET_CLIENT);
+ var crm_jwt = jwt.sign(client_jwt_decoded, process.env.JWT_SECRET_CRM, { noTimestamp: true });
+
+ try
{
- res.status(200).send(crm_response.data);
- })
- .catch((error) =>
+ const payload = { ...client_jwt_decoded, contract_number: req.query.contract, dateBegin: req.query.date_from, dateEnd: req.query.date_to, };
+ console.log(inspect(payload, true, null, true));
+
+ axios.get(`${ process.env.CRM_API_HOST }/lk/Contract/GetAktBU/`, {
+ params: payload,
+ responseType: 'arraybuffer',
+ headers: {
+ "Authorization": `Bearer ${ crm_jwt }`,
+ }
+ })
+ .then((crm_response) =>
+ {
+ res.status(200).send(crm_response.data);
+ resolve();
+ })
+ .catch((error) =>
+ {
+ console.error(error);
+ res.status(500).send();
+ resolve();
+ });
+ }
+ catch(e)
{
- console.error(error);
- res.status(500);
- });
+ console.error(e);
+ res.status(500).send();
+ resolve();
+ }
}
- catch(e)
+ else
{
- console.error(e);
- res.status(500);
+ res.status(403).send();
+ resolve();
}
}
else
{
- res.status(403);
+ res.status(403).send();
+ resolve();
}
- }
+ });
}
\ No newline at end of file
diff --git a/pages/contract/services.js b/pages/contract/services.js
index fb6c369..51a53fc 100644
--- a/pages/contract/services.js
+++ b/pages/contract/services.js
@@ -46,7 +46,7 @@ class Insurance extends React.Component
filename={ `${ entry.number }.${ entry.extension}` }
log={{
contract_number: number,
- document_type: `${ entry.period_type }_polis_${ type }`,
+ document_type: `${ entry.period_type !== undefined ? entry.period_type : "current" }_polis_${ type }`,
document_name: entry.number,
description: entry.period,
}}
@@ -71,7 +71,7 @@ class Insurance extends React.Component
class={ "services_invoice_button" }
log={{
contract_number: number,
- document_type: `${ entry.period_type }_polis_${ type }_invoice`,
+ document_type: `${ entry.period_type !== undefined ? entry.period_type : "current" }_polis_${ type }_invoice`,
document_name: entry.number,
description: entry.period,
}}
diff --git a/pages/index.js b/pages/index.js
index 65abb1f..8cd9b04 100644
--- a/pages/index.js
+++ b/pages/index.js
@@ -195,7 +195,8 @@ class IndexPage extends React.Component
})
}
- _handle_onSearch = () => {
+ _handle_onSearch = () =>
+ {
const { search, date_from, date_to } = this.state
this.setState({ loading: true },
@@ -208,12 +209,15 @@ class IndexPage extends React.Component
})
}
- _handle_onService = (url) => {
+ _handle_onService = (url) =>
+ {
this.props.router.push(url)
}
- _handle_onQuestionnaire = () => {
- this.props.router.push("/questionnaire")
+ _handle_onQuestionnaire = () =>
+ {
+ console.log(" _handle_onQuestionnaire ");
+ this.props.router.push("/questionnaire");
}
_renderQuestionnaireStatus = () =>
@@ -312,7 +316,7 @@ class IndexPage extends React.Component
) }
{/*}{*/}
-
+
{/*}{*/}
{ contracts !== null && contracts.length > 0 && (
diff --git a/pages/support/appeals.js b/pages/support/appeals.js
index cb07a9d..c98bb85 100644
--- a/pages/support/appeals.js
+++ b/pages/support/appeals.js
@@ -172,7 +172,7 @@ class SupportAppealsPage extends React.Component
file={ file }
log={{
incident_number: appeal.number,
- document_name: file.doc_url,
+ document_name: file.doc_name,
}}
/>)
}) }