diff --git a/actions/edoActions.js b/actions/edoActions.js index 22b2c31..6719cb6 100644 --- a/actions/edoActions.js +++ b/actions/edoActions.js @@ -43,7 +43,8 @@ export const getEDOOperatorList = ({ dispatch, update = false }) => dispatch({ type: actionTypes.EDO_OPERATORS_LIST, data: { - operators: response.data.box_edo + operators: response.data.box_edo, + message: response.data.message, } }); @@ -57,7 +58,8 @@ export const getEDOOperatorList = ({ dispatch, update = false }) => dispatch({ type: actionTypes.EDO_OPERATORS_LIST, data: { - operators: [] + operators: [], + message: "Невозможно получить список операторов ЭДО", } }); diff --git a/components/DealsStatus/DealsList.js b/components/DealsStatus/DealsList.js index 329e51e..60dc9bd 100644 --- a/components/DealsStatus/DealsList.js +++ b/components/DealsStatus/DealsList.js @@ -50,6 +50,7 @@ export default class DealsList extends React.Component if(dealSelected === deal.opp_number) { return ( this.items_ref[index] = ref } diff --git a/components/DealsStatus/SingleDeal.js b/components/DealsStatus/SingleDeal.js index a6f7afc..d540a17 100644 --- a/components/DealsStatus/SingleDeal.js +++ b/components/DealsStatus/SingleDeal.js @@ -1126,6 +1126,13 @@ class LeasingRegistration extends Step }); } + _handle_onGoToEDOInvites = () => + { + console.log("_handle_onGoToEDOInvites", { props: this.props }); + + this.props.router.push("/settings/digital"); + } + _getDocuments = () => { const contracts = this.props.contracts['prepared_contracts']; @@ -1164,6 +1171,7 @@ class LeasingRegistration extends Step documents={ this._getDocuments() } onCancel={ this._handle_onCancelEDO } onFinish={ this._handle_onFinishEDO } + onGoToEDOInvites={ this._handle_onGoToEDOInvites } /> ) } diff --git a/components/DealsStatus/index.js b/components/DealsStatus/index.js index 2b9857e..9f8d06f 100644 --- a/components/DealsStatus/index.js +++ b/components/DealsStatus/index.js @@ -186,6 +186,7 @@ class DealsStatus extends React.Component + case 0: + { + this.setState({ step: 1 }, () => + { + this._sign(); + }); + } + break; + + case 1: { this._sign(); - }); + } + break; } - break; - - case 1: - { - this._sign(); - } - break; } } } @@ -431,7 +445,7 @@ class EDOSign extends React.Component render() { - const { step, operators, documents, loading, disabled, finished, operator_selected } = this.state; + const { step, operators, edo_message, documents, loading, disabled, finished, operator_selected } = this.state; const { onCancel, } = this.props; console.log({ operators, documents }); @@ -443,20 +457,33 @@ class EDOSign extends React.Component { step === 0 && (
-
- { operators !== undefined && operators !== null && operators.map((operator, index) => ( -
- this._handle_onSelectOperator(operator) } - disabled={ false } - /> - -
- )) } +
+ { operators !== undefined && operators !== null && ( + <> + { operators.length === 0 ? ( +
+
+
+ { edo_message } +
+
+ ) : ( + operators.map((operator, index) => ( +
+ this._handle_onSelectOperator(operator) } + disabled={ false } + /> + +
+ ) ) + )} + + ) }
) } @@ -578,6 +605,7 @@ function mapStateToProps(state, ownProps) console.log("EDOSign", "mapStateToProps", { state: state }); return { operators: state.edo.operators, + edo_message: state.edo.message, } } diff --git a/components/FileDropzoneDeals/index.js b/components/FileDropzoneDeals/index.js index 29037ba..9663ac9 100644 --- a/components/FileDropzoneDeals/index.js +++ b/components/FileDropzoneDeals/index.js @@ -18,24 +18,34 @@ export default class FileDropzoneDeals extends FileDropzone const { uploaded, onAddFile, onDeleteFile, uploading, document, } = this.props; console.log("FileDropzoneDeals", { uploaded, document }); + let show_comment = false; + if(document.comment !== null && document.comment !== "") + { + show_comment = true; + if(!uploaded.sent) + { + show_comment = false; + } + } + return ( <> + { show_comment && ( +
+

+ { document.check } + { document.comment } +

+
+ ) } { uploaded.files.length > 0 && (
- { document.comment !== null && document.comment !== "" && ( -
-

- { document.check } - { document.comment } -

-
- ) }
{ uploaded.files.map((file, index) => { return (
- { file.sent ? ( + { uploaded.sent ? (
onDeleteFile(file.group, index) }>
diff --git a/css/main/style.css b/css/main/style.css index 16ebc53..942ec00 100644 --- a/css/main/style.css +++ b/css/main/style.css @@ -6169,13 +6169,13 @@ main .dropdown_blocks_list.zero-margin.gibdd .dropdown_block .block_body .fines_ display: flex; flex-direction: column; gap: 0px 20px; - padding-top: 15px; + padding: 15px 0px; } .horizontal_dropzone_files_wrapper .horizontal_dropzone_files_item { width: 100%; } -.horizontal_dropzone_files_wrapper .horizontal_dropzone_files_error { - padding-bottom: 24px; +.horizontal_dropzone_files_error { + padding-bottom: 15px; } .horizontal_dropzone_files_comment { background: rgba(131, 3, 84, 0.1); diff --git a/css/main/style.less b/css/main/style.less index 72d1042..ca38416 100644 --- a/css/main/style.less +++ b/css/main/style.less @@ -7099,15 +7099,15 @@ main .dropdown_blocks_list.zero-margin.gibdd .dropdown_block { display: flex; flex-direction: column; gap: 0px 20px; - padding-top: 15px; + padding: 15px 0px; .horizontal_dropzone_files_item { width: 100%; } - - .horizontal_dropzone_files_error { - padding-bottom: 24px; - } +} + +.horizontal_dropzone_files_error { + padding-bottom: 15px; } .horizontal_dropzone_files_comment { diff --git a/pages/api/deals/file/attach.js b/pages/api/deals/file/attach.js index 068a8e4..d6a98f6 100644 --- a/pages/api/deals/file/attach.js +++ b/pages/api/deals/file/attach.js @@ -45,7 +45,6 @@ export default async function handler(req, res) index, type, lastModified, - sent: true }; try diff --git a/pages/api/deals/upload.js b/pages/api/deals/upload.js index 15da2fd..bdb220b 100644 --- a/pages/api/deals/upload.js +++ b/pages/api/deals/upload.js @@ -160,6 +160,7 @@ export default async function handler(req, res) eachSeries(Object.keys(deals[ deal_id ].uploaded), (group, callback) => { const document = deals[ deal_id ].uploaded[ group ]; + deals[ deal_id ].uploaded[ group ].sent = true; console.log({ group, document }); if(document.files.length === 1) @@ -201,40 +202,11 @@ export default async function handler(req, res) }); }) } - - /* - try - { - - - if(fs.existsSync(`${ uploads }${ file.filename }`)) - { - */ - /* - - */ - /* - } - else - { - callback(); - } - */ - /* - console.log({ file_upload_url }); - - */ - /* - } - catch(e) - { - console.error(e) - callback(); - } - */ - }, () => + }, async () => { console.log("ALL FILES SENT"); + await RedisClient.set(key, JSON.stringify(deals)); + res.status(200).json({}); resolve(); }); @@ -256,65 +228,6 @@ export default async function handler(req, res) res.status(403).json({}); resolve(); } - - /* - - const payload = new URLSearchParams({ - name: number, - entity: entity, - documentTypeNumber: id, - documentName: filename, - }); - const path = `${ process.env.CRM_API_HOST }/lk/document/upload?${ payload.toString() }`; - console.log({ path }); - - upload.single("file")(req, {}, err => - { - const { file } = req; - file.originalname = Buffer.from(file.originalname, 'latin1').toString('utf8'); - - const data = new FormData(); - data.append("file", file.buffer, file.originalname); - - try - { - axios.post(path, data, - { - headers: { - "Content-Type": `multipart/form-data; boundary=${ data._boundary }`, - "Authorization": `Bearer ${ crm_jwt }`, - }, - withCredentials: true, - }) - .then((crm_response) => - { - console.log("/lk/document/upload SUCCESS"); - res.status(200).json(crm_response.data); - resolve(); - }) - .catch((error) => - { - console.error("-".repeat(30), "error.response.data:"); - console.error(error.response); - - res.status(500).json(error.response.data); - resolve(); - }); - } - catch(e) - { - console.error(e); - res.status(500).send(e); - resolve(); - } - }); - } - else - { - res.status(403).send(); - resolve(); - } - */ } else { diff --git a/pages/index.js b/pages/index.js index 8cd9b04..61e5fe7 100644 --- a/pages/index.js +++ b/pages/index.js @@ -316,7 +316,11 @@ class IndexPage extends React.Component ) } {/*}{*/} - + {/*}{*/} { contracts !== null && contracts.length > 0 && ( diff --git a/reducers/edoReducer.js b/reducers/edoReducer.js index bafaa84..f425b7f 100644 --- a/reducers/edoReducer.js +++ b/reducers/edoReducer.js @@ -21,11 +21,13 @@ const edoReducer = (state = initialState.edo, action) => console.log({ ...state, operators: action.data.operators, + message: action.data.message, }); return { ...state, operators: action.data.operators, + message: action.data.message, }; } diff --git a/reducers/initialState.js b/reducers/initialState.js index f6eab6e..94b7d01 100644 --- a/reducers/initialState.js +++ b/reducers/initialState.js @@ -257,6 +257,7 @@ export const defaultState = { loaded: false, operators: null, invites: null, + message: null, } };