fixes for deals status, fixes for files logging
This commit is contained in:
parent
829f7b4c4b
commit
2fe3547666
@ -167,6 +167,7 @@ export const getReconciliationFile = ({ contract, date_from, date_to, filename }
|
|||||||
fileDownload(response.data, filename);
|
fileDownload(response.data, filename);
|
||||||
logDocumentAccess({
|
logDocumentAccess({
|
||||||
contract_number: contract,
|
contract_number: contract,
|
||||||
|
document_name: "Акт сверки по ДЛ",
|
||||||
document_type: "act_bu",
|
document_type: "act_bu",
|
||||||
document_period_from: date_from,
|
document_period_from: date_from,
|
||||||
document_period_to: date_to,
|
document_period_to: date_to,
|
||||||
|
|||||||
@ -39,7 +39,7 @@ export default class DealsList extends React.Component
|
|||||||
|
|
||||||
render()
|
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 });
|
console.log({ deals });
|
||||||
|
|
||||||
@ -60,6 +60,7 @@ export default class DealsList extends React.Component
|
|||||||
onCloseDeal={ this._handle_onCloseDeal }
|
onCloseDeal={ this._handle_onCloseDeal }
|
||||||
onDealsUpdate={ onDealsUpdate }
|
onDealsUpdate={ onDealsUpdate }
|
||||||
onDealContractsUpdate={ onDealContractsUpdate }
|
onDealContractsUpdate={ onDealContractsUpdate }
|
||||||
|
onQuestionnaire={ onQuestionnaire }
|
||||||
{ ...deal }
|
{ ...deal }
|
||||||
/>)
|
/>)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -456,6 +456,14 @@ class DocumentsForm extends Step
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_handle_onQuestionnaire = (event) =>
|
||||||
|
{
|
||||||
|
const { onQuestionnaire } = this.props;
|
||||||
|
|
||||||
|
event.preventDefault();
|
||||||
|
onQuestionnaire();
|
||||||
|
}
|
||||||
|
|
||||||
_checkFilesCompleted = () =>
|
_checkFilesCompleted = () =>
|
||||||
{
|
{
|
||||||
const documents_length = this.props.documents.length;
|
const documents_length = this.props.documents.length;
|
||||||
@ -515,7 +523,7 @@ class DocumentsForm extends Step
|
|||||||
|
|
||||||
render()
|
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;
|
const { open, files, uploading, loading } = this.state;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -539,7 +547,7 @@ class DocumentsForm extends Step
|
|||||||
{ questionnaire_status === "need_to_fill" ? (
|
{ questionnaire_status === "need_to_fill" ? (
|
||||||
<div className="message alert">
|
<div className="message alert">
|
||||||
<p>Требуется обновить данные в анкете</p>
|
<p>Требуется обновить данные в анкете</p>
|
||||||
<button className="button button-blue">Актуализировать данные</button>
|
<button className="button button-blue" onClick={ this._handle_onQuestionnaire }>Актуализировать данные</button>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@ -176,8 +176,8 @@ class DealsStatus extends React.Component
|
|||||||
|
|
||||||
render()
|
render()
|
||||||
{
|
{
|
||||||
const { currentContractModalOpened, allContractModalOpened, currentSelected, dealSelected, deals, status } = this.state
|
const { currentContractModalOpened, allContractModalOpened, currentSelected, dealSelected, deals, status, } = this.state
|
||||||
const { questionnaire_status } = this.props;
|
const { questionnaire_status, onQuestionnaire, } = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@ -194,6 +194,7 @@ class DealsStatus extends React.Component
|
|||||||
onCloseDeal={ this._handle_onCloseDeal }
|
onCloseDeal={ this._handle_onCloseDeal }
|
||||||
onDealsUpdate={ this._onDealsUpdate }
|
onDealsUpdate={ this._onDealsUpdate }
|
||||||
onDealContractsUpdate={ this._onDealContractsUpdate }
|
onDealContractsUpdate={ this._onDealContractsUpdate }
|
||||||
|
onQuestionnaire={ onQuestionnaire }
|
||||||
/>
|
/>
|
||||||
{/*}
|
{/*}
|
||||||
<AllContractsModal
|
<AllContractsModal
|
||||||
|
|||||||
@ -72,7 +72,16 @@ export default async function handler(req, res)
|
|||||||
deals = {};
|
deals = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
files[ document_id ] = [ file_payload ];
|
if(files[ document_id ] !== undefined)
|
||||||
|
{
|
||||||
|
files[ document_id ].push(file_payload);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
files[ document_id ] = [ file_payload ];
|
||||||
|
}
|
||||||
|
|
||||||
|
//files[ document_id ] = [ file_payload ];
|
||||||
deals[ deal_id ] = { files };
|
deals[ deal_id ] = { files };
|
||||||
|
|
||||||
await RedisClient.set(key, JSON.stringify(deals));
|
await RedisClient.set(key, JSON.stringify(deals));
|
||||||
|
|||||||
@ -31,7 +31,7 @@ export default async function handler(req, res)
|
|||||||
{
|
{
|
||||||
var client_jwt_decoded = jwt.verify(cookies.jwt, process.env.JWT_SECRET_CLIENT);
|
var client_jwt_decoded = jwt.verify(cookies.jwt, process.env.JWT_SECRET_CLIENT);
|
||||||
|
|
||||||
const { deal_id, document_id } = req.query;
|
const { deal_id, document_id, index } = req.query;
|
||||||
const local_filename = `${ client_jwt_decoded.acc_number }_${ deal_id }_${ document_id }`;
|
const local_filename = `${ client_jwt_decoded.acc_number }_${ deal_id }_${ document_id }`;
|
||||||
|
|
||||||
try
|
try
|
||||||
@ -61,7 +61,7 @@ export default async function handler(req, res)
|
|||||||
deals = {};
|
deals = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
delete files[ document_id ];
|
files[ document_id ].splice(index, 1);
|
||||||
deals[ deal_id ] = { files };
|
deals[ deal_id ] = { files };
|
||||||
|
|
||||||
await RedisClient.set(key, JSON.stringify(deals));
|
await RedisClient.set(key, JSON.stringify(deals));
|
||||||
|
|||||||
@ -4,48 +4,64 @@ import cookie from 'cookie';
|
|||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import jwt from 'jsonwebtoken';
|
import jwt from 'jsonwebtoken';
|
||||||
import { cors } from '../../../lib/cors';
|
import { cors } from '../../../lib/cors';
|
||||||
|
import { inspect } from 'util';
|
||||||
|
|
||||||
export default async function handler(req, res)
|
export default async function handler(req, res)
|
||||||
{
|
{
|
||||||
await cors(req, res);
|
await cors(req, res);
|
||||||
|
|
||||||
if(req.headers.cookie !== undefined)
|
return new Promise((resolve) =>
|
||||||
{
|
{
|
||||||
const cookies = cookie.parse(req.headers?.cookie ? req.headers?.cookie : "");
|
if(req.headers.cookie !== undefined)
|
||||||
|
|
||||||
if(cookies.jwt !== undefined && cookies.jwt !== null)
|
|
||||||
{
|
{
|
||||||
var client_jwt_decoded = jwt.verify(cookies.jwt, process.env.JWT_SECRET_CLIENT);
|
const cookies = cookie.parse(req.headers?.cookie ? req.headers?.cookie : "");
|
||||||
var crm_jwt = jwt.sign(client_jwt_decoded, process.env.JWT_SECRET_CRM, { noTimestamp: true });
|
|
||||||
|
|
||||||
try
|
if(cookies.jwt !== undefined && cookies.jwt !== null)
|
||||||
{
|
{
|
||||||
axios.get(`${ process.env.CRM_API_HOST }/lk/Contract/GetAktBU/`, {
|
var client_jwt_decoded = jwt.verify(cookies.jwt, process.env.JWT_SECRET_CLIENT);
|
||||||
params: { ...client_jwt_decoded, contract_number: req.query.contract, dateBegin: req.query.date_from, dateEnd: req.query.date_to, },
|
var crm_jwt = jwt.sign(client_jwt_decoded, process.env.JWT_SECRET_CRM, { noTimestamp: true });
|
||||||
responseType: 'arraybuffer',
|
|
||||||
headers: {
|
try
|
||||||
"Authorization": `Bearer ${ crm_jwt }`,
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.then((crm_response) =>
|
|
||||||
{
|
{
|
||||||
res.status(200).send(crm_response.data);
|
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));
|
||||||
.catch((error) =>
|
|
||||||
|
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);
|
console.error(e);
|
||||||
res.status(500);
|
res.status(500).send();
|
||||||
});
|
resolve();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch(e)
|
else
|
||||||
{
|
{
|
||||||
console.error(e);
|
res.status(403).send();
|
||||||
res.status(500);
|
resolve();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
res.status(403);
|
res.status(403).send();
|
||||||
|
resolve();
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
@ -46,7 +46,7 @@ class Insurance extends React.Component
|
|||||||
filename={ `${ entry.number }.${ entry.extension}` }
|
filename={ `${ entry.number }.${ entry.extension}` }
|
||||||
log={{
|
log={{
|
||||||
contract_number: number,
|
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,
|
document_name: entry.number,
|
||||||
description: entry.period,
|
description: entry.period,
|
||||||
}}
|
}}
|
||||||
@ -71,7 +71,7 @@ class Insurance extends React.Component
|
|||||||
class={ "services_invoice_button" }
|
class={ "services_invoice_button" }
|
||||||
log={{
|
log={{
|
||||||
contract_number: number,
|
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,
|
document_name: entry.number,
|
||||||
description: entry.period,
|
description: entry.period,
|
||||||
}}
|
}}
|
||||||
|
|||||||
@ -195,7 +195,8 @@ class IndexPage extends React.Component
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
_handle_onSearch = () => {
|
_handle_onSearch = () =>
|
||||||
|
{
|
||||||
const { search, date_from, date_to } = this.state
|
const { search, date_from, date_to } = this.state
|
||||||
|
|
||||||
this.setState({ loading: true },
|
this.setState({ loading: true },
|
||||||
@ -208,12 +209,15 @@ class IndexPage extends React.Component
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
_handle_onService = (url) => {
|
_handle_onService = (url) =>
|
||||||
|
{
|
||||||
this.props.router.push(url)
|
this.props.router.push(url)
|
||||||
}
|
}
|
||||||
|
|
||||||
_handle_onQuestionnaire = () => {
|
_handle_onQuestionnaire = () =>
|
||||||
this.props.router.push("/questionnaire")
|
{
|
||||||
|
console.log(" _handle_onQuestionnaire ");
|
||||||
|
this.props.router.push("/questionnaire");
|
||||||
}
|
}
|
||||||
|
|
||||||
_renderQuestionnaireStatus = () =>
|
_renderQuestionnaireStatus = () =>
|
||||||
@ -312,7 +316,7 @@ class IndexPage extends React.Component
|
|||||||
) }
|
) }
|
||||||
|
|
||||||
{/*}{*/}
|
{/*}{*/}
|
||||||
<DealsStatus questionnaire_status={ company.questionnaire_status }/>
|
<DealsStatus questionnaire_status={ company.questionnaire_status } onQuestionnaire={ this._handle_onQuestionnaire }/>
|
||||||
{/*}{*/}
|
{/*}{*/}
|
||||||
|
|
||||||
{ contracts !== null && contracts.length > 0 && (
|
{ contracts !== null && contracts.length > 0 && (
|
||||||
|
|||||||
@ -172,7 +172,7 @@ class SupportAppealsPage extends React.Component
|
|||||||
file={ file }
|
file={ file }
|
||||||
log={{
|
log={{
|
||||||
incident_number: appeal.number,
|
incident_number: appeal.number,
|
||||||
document_name: file.doc_url,
|
document_name: file.doc_name,
|
||||||
}}
|
}}
|
||||||
/>)
|
/>)
|
||||||
}) }
|
}) }
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user