deals contracts sign EDO initial
This commit is contained in:
parent
b54eb51a73
commit
05837cc87c
@ -4,7 +4,7 @@ import Router from 'next/router';
|
||||
import moment from 'moment';
|
||||
|
||||
import * as actionTypes from '../constants/actionTypes';
|
||||
import { getEDOList } from './edoActions';
|
||||
import { getEDOOperatorList } from './index';
|
||||
|
||||
if(process.browser)
|
||||
{
|
||||
@ -33,7 +33,7 @@ export const getCompanyInfo = ({ dispatch }) =>
|
||||
})
|
||||
.then((response) =>
|
||||
{
|
||||
getEDOList({ dispatch }).then(() => {}).catch(() => {});
|
||||
getEDOOperatorList({ dispatch }).then(() => {}).catch(() => {});
|
||||
//console.log("getCompanyInfo", "response", response.data);
|
||||
|
||||
dispatch({ type: actionTypes.COMPANY, data: response.data });
|
||||
|
||||
@ -8,11 +8,11 @@ import { eachSeries } from 'async';
|
||||
import * as actionTypes from '../constants/actionTypes';
|
||||
import * as currentState from '../reducers/initialState';
|
||||
|
||||
export const getEDOList = ({ dispatch, update = false }) =>
|
||||
export const getEDOOperatorList = ({ dispatch, update = false }) =>
|
||||
{
|
||||
const url = `${ process.env.NEXT_PUBLIC_SELF_API_HOST }/api/edo/list`;
|
||||
const url = `${ process.env.NEXT_PUBLIC_SELF_API_HOST }/api/edo/operators`;
|
||||
|
||||
console.log("ACTION", "edo", "getEDOList()", { url });
|
||||
console.log("ACTION", "edo", "getEDOOperatorList()", { url });
|
||||
|
||||
return new Promise((resolve, reject) =>
|
||||
{
|
||||
@ -21,10 +21,11 @@ export const getEDOList = ({ dispatch, update = false }) =>
|
||||
})
|
||||
.then((response) =>
|
||||
{
|
||||
console.log("ACTION", "edo", "getEDOList()", "response", response.data);
|
||||
console.log("ACTION", "edo", "getEDOOperatorList()", "response", response.data);
|
||||
|
||||
/*
|
||||
dispatch({
|
||||
type: actionTypes.EDO_LIST,
|
||||
type: actionTypes.EDO_OPERATORS_LIST,
|
||||
data: {
|
||||
list: [
|
||||
{
|
||||
@ -37,31 +38,98 @@ export const getEDOList = ({ dispatch, update = false }) =>
|
||||
]
|
||||
}
|
||||
});
|
||||
*/
|
||||
|
||||
/*
|
||||
dispatch({
|
||||
type: actionTypes.EDO_LIST,
|
||||
type: actionTypes.EDO_OPERATORS_LIST,
|
||||
data: {
|
||||
list: response.data
|
||||
operators: response.data.box_edo
|
||||
}
|
||||
});
|
||||
*/
|
||||
|
||||
resolve();
|
||||
})
|
||||
.catch((error) =>
|
||||
{
|
||||
console.error("ACTION", "edo", "getEDOList()", "ERROR");
|
||||
console.error("ACTION", "edo", "getEDOOperatorList()", "ERROR");
|
||||
console.error(error);
|
||||
|
||||
dispatch({
|
||||
type: actionTypes.EDO_LIST,
|
||||
type: actionTypes.EDO_OPERATORS_LIST,
|
||||
data: {
|
||||
list: []
|
||||
operators: []
|
||||
}
|
||||
});
|
||||
|
||||
reject();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
export const getEDOInvitesList = ({ dispatch, update = false }) =>
|
||||
{
|
||||
const url = `${ process.env.NEXT_PUBLIC_SELF_API_HOST }/api/edo/invites`;
|
||||
|
||||
console.log("ACTION", "edo", "getEDOInvitesList()", { url });
|
||||
|
||||
return new Promise((resolve, reject) =>
|
||||
{
|
||||
axios.post(url, {}, {
|
||||
withCredentials: true,
|
||||
})
|
||||
.then((response) =>
|
||||
{
|
||||
console.log("ACTION", "edo", "getEDOInvitesList()", "response", response.data);
|
||||
|
||||
dispatch({
|
||||
type: actionTypes.EDO_INVITES_LIST,
|
||||
data: {
|
||||
invites: response.data.box_edo
|
||||
}
|
||||
});
|
||||
|
||||
resolve();
|
||||
})
|
||||
.catch((error) =>
|
||||
{
|
||||
console.error("ACTION", "edo", "getEDOInvitesList()", "ERROR");
|
||||
console.error(error);
|
||||
|
||||
dispatch({
|
||||
type: actionTypes.EDO_INVITES_LIST,
|
||||
data: {
|
||||
invites: []
|
||||
}
|
||||
});
|
||||
|
||||
reject();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
export const inviteToEDO = () =>
|
||||
{
|
||||
const url = `${ process.env.NEXT_PUBLIC_SELF_API_HOST }/api/edo/invite/send`;
|
||||
|
||||
console.log("ACTION", "edo", "inviteToEDO()", { url });
|
||||
|
||||
return new Promise((resolve, reject) =>
|
||||
{
|
||||
axios.post(url, {}, {
|
||||
withCredentials: true,
|
||||
})
|
||||
.then((response) =>
|
||||
{
|
||||
console.log("ACTION", "edo", "inviteToEDO()", "response", response.data);
|
||||
|
||||
resolve(response.data);
|
||||
})
|
||||
.catch((error) =>
|
||||
{
|
||||
console.error("ACTION", "edo", "inviteToEDO()", "ERROR");
|
||||
console.error(error);
|
||||
|
||||
reject(error.data);
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -14,4 +14,6 @@ export * from './adminActions';
|
||||
export * from './suggestsActions';
|
||||
export * from './questionnaireActions';
|
||||
export * from './feedbackActions';
|
||||
export * from './dealsActions';
|
||||
export * from './dealsActions';
|
||||
export * from './edoActions';
|
||||
export * from './signActions';
|
||||
75
actions/signActions.js
Normal file
75
actions/signActions.js
Normal file
@ -0,0 +1,75 @@
|
||||
import axios from 'axios';
|
||||
import { Cookies } from 'react-cookie';
|
||||
import Router from 'next/router';
|
||||
import moment from 'moment';
|
||||
import { nSQL } from "@nano-sql/core";
|
||||
import { concatSeries, eachSeries } from 'async';
|
||||
|
||||
import * as actionTypes from '../constants/actionTypes';
|
||||
import * as currentState from '../reducers/initialState';
|
||||
|
||||
export const signCheckEDOCreatePrintForm = ({ contracts, sign_type }) =>
|
||||
{
|
||||
const url = `${ process.env.NEXT_PUBLIC_SELF_API_HOST }/api/contract/sign/check`;
|
||||
|
||||
console.log("ACTION", "edo", "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);
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
export const signGetGUIDEntity = ({ contract_number }) =>
|
||||
{
|
||||
const url = `${ process.env.NEXT_PUBLIC_SELF_API_HOST }/api/contract/sign/entity`;
|
||||
|
||||
console.log("ACTION", "edo", "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);
|
||||
})
|
||||
});
|
||||
}
|
||||
@ -5,6 +5,8 @@ import { eachLimit } from "async";
|
||||
|
||||
import { SpinnerCircular } from "spinners-react";
|
||||
import FileDropzoneDeals from "../FileDropzoneDeals";
|
||||
import EDOSign from "../../components/EDOSign";
|
||||
|
||||
import { acceptDealOffers, attachDealDocument, removeDealDocument, sendDealDocuments } from "../../actions";
|
||||
|
||||
class Step extends React.Component
|
||||
@ -654,7 +656,7 @@ class StatusDecisionMaking extends Step
|
||||
}
|
||||
}
|
||||
|
||||
class StatusLeasingRegistration extends Step
|
||||
class StatusPositiveDecision extends Step
|
||||
{
|
||||
constructor(props)
|
||||
{
|
||||
@ -687,13 +689,14 @@ class StatusLeasingRegistration extends Step
|
||||
}
|
||||
}
|
||||
|
||||
class SigningTypeSelection extends Step
|
||||
class LeasingRegistration extends Step
|
||||
{
|
||||
constructor(props)
|
||||
{
|
||||
super(props);
|
||||
this.state = {
|
||||
open: false,
|
||||
/*
|
||||
checked: {
|
||||
prepared_contracts: [],
|
||||
signing_plan_contracts: [],
|
||||
@ -701,6 +704,9 @@ class SigningTypeSelection extends Step
|
||||
issued_contracts: [],
|
||||
annulled_contracts: [],
|
||||
},
|
||||
*/
|
||||
checked: [],
|
||||
edo: false,
|
||||
};
|
||||
this.status = [ 107 ];
|
||||
this.types = [
|
||||
@ -727,13 +733,63 @@ class SigningTypeSelection extends Step
|
||||
];
|
||||
}
|
||||
|
||||
_getEDODocuments = () =>
|
||||
{
|
||||
const contracts = this.props.contracts['prepared_contracts'];
|
||||
const { checked } = this.state;
|
||||
const documents = [];
|
||||
|
||||
for(let i in contracts)
|
||||
{
|
||||
if(checked.indexOf(contracts[i].name) > -1)
|
||||
{
|
||||
documents.push({
|
||||
id: contracts[i].name,
|
||||
name: `Договор № ${ contracts[i].name }`,
|
||||
date: contracts[i].date,
|
||||
type: `${ contracts[i].brand_name } ${ contracts[i].model_name }`,
|
||||
extension: 'pdf',
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
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 checked = this.state.checked.prepared_contracts;
|
||||
const { edo, checked } = this.state;
|
||||
//const checked = this.state.checked.prepared_contracts;
|
||||
|
||||
const contracts = this.props.contracts['prepared_contracts'];
|
||||
console.log("_render_preparedContracts", { contracts });
|
||||
|
||||
if(edo)
|
||||
{
|
||||
return (
|
||||
<EDOSign
|
||||
documents={ this._getEDODocuments() }
|
||||
onCancel={ () => this.setState({ edo: false }) }
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="block-column">
|
||||
<div className="docs_list acts_list-checkbox medium-icon">
|
||||
@ -741,8 +797,8 @@ class SigningTypeSelection extends Step
|
||||
contracts.map((contract, index) => (
|
||||
<div className="row" key={ index }>
|
||||
<div className="doc_name i-doc i-medium blue deals_contracts" style={{ alignItems: "flex-start" }}>
|
||||
<input type="checkbox" name="" id="" checked={ checked.indexOf(contract.name) > -1 ? true : false } onChange={ () => {} }/>
|
||||
<label htmlFor="">№{ contract.name }</label>
|
||||
<input type="checkbox" name="" id={ `contract_${ index }` } checked={ checked.indexOf(contract.name) > -1 ? true : false } onChange={ () => { this._handle_onPreparedContract(contract.name) } }/>
|
||||
<label htmlFor={ `contract_${ index }` }>№{ contract.name }</label>
|
||||
<div className="info">
|
||||
<span>{ moment(contract.date).format('MM.DD.YYYY') }</span>
|
||||
<span>{ contract.brand_name }</span>
|
||||
@ -754,17 +810,20 @@ class SigningTypeSelection extends Step
|
||||
<p className="empty">Нет договоров</p>
|
||||
) }
|
||||
</div>
|
||||
<div className="block_footer_btn">
|
||||
<button className="button button-blue">Подписать в ЭДО</button>
|
||||
<button className="button button-blue">Подписать в бумажном виде</button>
|
||||
</div>
|
||||
{ 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" disabled={ checked.length > 0 ? false : true }>Подписать в бумажном виде</button>
|
||||
</div>
|
||||
) }
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
_render_signingPlanContracts = () =>
|
||||
{
|
||||
const contracts = this.props.contracts['prepared_contracts'];
|
||||
const contracts = this.props.contracts['signing_plan_contracts'];
|
||||
console.log("_render_signingPlanContracts", { contracts });
|
||||
|
||||
return (
|
||||
@ -939,7 +998,7 @@ class SigningTypeSelection extends Step
|
||||
render()
|
||||
{
|
||||
const { index, statuscode_id, dealSelected } = this.props;
|
||||
const { open } = this.state;
|
||||
const { open, edo } = this.state;
|
||||
|
||||
return (
|
||||
<div className={`${ this.status.indexOf( statuscode_id ) > -1 ? "current" : statuscode_id > this.status[ 0 ] ? "done" : "" }`}>
|
||||
@ -948,16 +1007,30 @@ class SigningTypeSelection extends Step
|
||||
<div className="status_body">
|
||||
{ this._renderHeader("Оформление лизинга") }
|
||||
<div className="wrap form contracts" style={{ display: open ? "block" : "none" }}>
|
||||
{ this.types.map((type, index) => (
|
||||
<div className="block" key={ index }>
|
||||
<div className="left">
|
||||
<p><b>{ type.title }</b></p>
|
||||
</div>
|
||||
<div className="right">
|
||||
{ this._render_contracts(type.key) }
|
||||
</div>
|
||||
{ this.props.contracts === undefined ? (
|
||||
<div style={{ minHeight: 200, display: "flex", justifyContent: "center", alignItems: "center", }}>
|
||||
<SpinnerCircular size={ 90 } thickness={ 51 } speed={ 100 } color="rgba(28, 1, 169, 1)" secondaryColor="rgba(236, 239, 244, 1)" />
|
||||
</div>
|
||||
)) }
|
||||
) : (
|
||||
<>
|
||||
{ this.types.map((type, index) => (
|
||||
<div className="block" key={ index }>
|
||||
{ edo ? (
|
||||
<>
|
||||
{ type.key !== "prepared_contracts" && (
|
||||
<div className="left"><p><b>{ type.title }</b></p></div>
|
||||
) }
|
||||
</>
|
||||
) : (
|
||||
<div className="left"><p><b>{ type.title }</b></p></div>
|
||||
) }
|
||||
<div className="right" style={ edo && type.key === "prepared_contracts" ? { width: "100%" } : {} }>
|
||||
{ this._render_contracts(type.key) }
|
||||
</div>
|
||||
</div>
|
||||
)) }
|
||||
</>
|
||||
) }
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -995,8 +1068,8 @@ export default class SingleDeal extends React.Component
|
||||
<DocumentsForm { ...this.props } documents={ documents } files={ files }/>
|
||||
<StatusDocumentsCheck { ...this.props }/>
|
||||
<StatusDecisionMaking { ...this.props }/>
|
||||
<StatusLeasingRegistration { ...this.props }/>
|
||||
<SigningTypeSelection { ...this.props } contracts={ contracts }/>
|
||||
<StatusPositiveDecision { ...this.props }/>
|
||||
<LeasingRegistration { ...this.props } contracts={ contracts }/>
|
||||
</div>
|
||||
<div className="bottom_button_close" onClick={ onCloseDeal } >
|
||||
<span>Свернуть</span>
|
||||
|
||||
@ -1,6 +1,9 @@
|
||||
import React from "react";
|
||||
import { connect } from "react-redux";
|
||||
import moment from "moment";
|
||||
import { SpinnerCircular } from "spinners-react";
|
||||
|
||||
import { signCheckEDOCreatePrintForm } from "../../actions";
|
||||
//import { getDeals, getDealOffers, getDealDocuments, getDealContracts } from "../../actions";
|
||||
|
||||
class EDOSign extends React.Component
|
||||
@ -9,7 +12,7 @@ class EDOSign extends React.Component
|
||||
{
|
||||
super(props)
|
||||
this.state = {
|
||||
list: null,
|
||||
operators: null,
|
||||
loading: false,
|
||||
selected: {},
|
||||
}
|
||||
@ -19,7 +22,7 @@ class EDOSign extends React.Component
|
||||
{
|
||||
console.log("EDOSign", "getDerivedStateFromProps", { nextProps });
|
||||
return {
|
||||
list: nextProps.list,
|
||||
operators: nextProps.operators,
|
||||
}
|
||||
}
|
||||
|
||||
@ -27,13 +30,36 @@ class EDOSign extends React.Component
|
||||
{
|
||||
if(this.state.selected.box_id === undefined)
|
||||
{
|
||||
this.setState({ selected: this.state.list !== null && this.state.list[0] !== undefined ? this.state.list[0] : {} });
|
||||
this.setState({ selected: this.state.operators !== null && this.state.operators[0] !== undefined ? this.state.operators[0] : {} });
|
||||
}
|
||||
}
|
||||
|
||||
_handle_onFormSubmit = () =>
|
||||
_handle_onFormSubmit = (event) =>
|
||||
{
|
||||
event.preventDefault();
|
||||
|
||||
const { documents } = this.props;
|
||||
const { selected } = this.state;
|
||||
console.log("_handle_onFormSubmit");
|
||||
console.log({ documents, selected });
|
||||
|
||||
this.setState({ loading: true }, () =>
|
||||
{
|
||||
const contracts = [];
|
||||
for(let i in documents)
|
||||
{
|
||||
contracts.push(documents[i].id);
|
||||
signCheckEDOCreatePrintForm({ contracts, sign_type: "EDO" })
|
||||
.then((checks) =>
|
||||
{
|
||||
console.log({ checks });
|
||||
})
|
||||
.catch((error) =>
|
||||
{
|
||||
console.log({ error });
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
_handle_onSelectOperator = (operator) =>
|
||||
@ -43,29 +69,29 @@ class EDOSign extends React.Component
|
||||
|
||||
render()
|
||||
{
|
||||
const { list, loading, selected } = this.state;
|
||||
const { onCancel, document } = this.props;
|
||||
console.log({ list });
|
||||
const { operators, loading, selected } = this.state;
|
||||
const { onCancel, documents } = this.props;
|
||||
console.log({ operators, documents });
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="edo_detail">
|
||||
<div className="docs_list medium-icon">
|
||||
<p className="list_title">Подписание через ЭДО</p>
|
||||
</div>
|
||||
<div className="docs_list medium-icon">
|
||||
<p className="doc_name i-pdf extension edo_sign_document" data-format={ document.extension }>
|
||||
{ document.name }
|
||||
<span style={{ width: "100%" }}>
|
||||
{ document.number } от{" "} { moment(document.date).format("DD.MM.YYYY") }
|
||||
</span>
|
||||
{ document.type !== undefined && (<span>{ document.type }</span>) }
|
||||
</p>
|
||||
{ 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>
|
||||
<form ref={ this.ref_form } onSubmit={ this._handle_onFormSubmit } onKeyDown={(e) => {if (e.key === 'Enter') e.preventDefault() }}>
|
||||
<div className="form_field edo_list_field">
|
||||
<label>Выберите оператора для отправки пакета документов</label>
|
||||
<div className="edo_list_selection">
|
||||
{ list !== undefined && list !== null && list.map((operator, index) => (
|
||||
{ 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 }
|
||||
@ -75,7 +101,7 @@ class EDOSign extends React.Component
|
||||
onChange={ (event) => this._handle_onSelectOperator(operator) }
|
||||
disabled={ false }
|
||||
/>
|
||||
<label htmlFor={ `operator_${ index }` } className="unselectable">{ operator.box_name }</label>
|
||||
<label htmlFor={ `operator_${ index }` } className="unselectable">{ operator.provider_edo }</label>
|
||||
</div>
|
||||
)) }
|
||||
</div>
|
||||
@ -89,7 +115,7 @@ class EDOSign extends React.Component
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
@ -98,7 +124,7 @@ function mapStateToProps(state, ownProps)
|
||||
{
|
||||
console.log("EDOSign", "mapStateToProps", { state: state });
|
||||
return {
|
||||
list: state.edo.list,
|
||||
operators: state.edo.operators,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -56,5 +56,6 @@ export const DEALS_RESET = 'DEALS_RESET';
|
||||
export const DEAL_RESET = 'DEAL_RESET';
|
||||
|
||||
export const EDO_LOADED = 'EDO_LOADED';
|
||||
export const EDO_LIST = 'EDO_LIST';
|
||||
export const EDO_OPERATORS_LIST = 'EDO_OPERATORS_LIST';
|
||||
export const EDO_INVITES_LIST = 'EDO_INVITES_LIST';
|
||||
export const EDO_RESET = 'EDO_RESET';
|
||||
@ -6216,21 +6216,47 @@ main .dropdown_blocks_list.zero-margin.gibdd .dropdown_block .block_body .fines_
|
||||
.edo_detail p {
|
||||
margin: 0px;
|
||||
}
|
||||
.edo_detail .list_title {
|
||||
font-weight: 700 !important;
|
||||
margin-bottom: 15px;
|
||||
font-size: 15px;
|
||||
line-height: 23px;
|
||||
}
|
||||
.edo_list_field {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: flex-start !important;
|
||||
margin-bottom: 30px;
|
||||
width: 100%;
|
||||
}
|
||||
.edo_list_field label {
|
||||
width: 186px;
|
||||
margin-right: 12px;
|
||||
}
|
||||
.edo_list_selection {
|
||||
flex: 1;
|
||||
margin-top: -12px;
|
||||
}
|
||||
.edo_list_selection .item {
|
||||
width: 100%;
|
||||
padding: 16px 0px;
|
||||
margin: 0px !important;
|
||||
border-bottom: solid 1px #edeff5;
|
||||
}
|
||||
.edo_list_selection .item label {
|
||||
width: auto;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-right: 12px;
|
||||
}
|
||||
.edo_list_selection .item label:first {
|
||||
margin-top: 0px;
|
||||
}
|
||||
.edo_list_selection .item label:before {
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
margin: auto;
|
||||
}
|
||||
.edo_list_selection .item:first {
|
||||
margin-top: 0px;
|
||||
}
|
||||
@ -6243,3 +6269,36 @@ main .dropdown_blocks_list.zero-margin.gibdd .dropdown_block .block_body .fines_
|
||||
margin: 30px 0px !important;
|
||||
align-items: flex-start;
|
||||
}
|
||||
.edo_operators_settings_list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-content: flex-start;
|
||||
gap: 15px 0px;
|
||||
}
|
||||
.edo_operators_settings_list_item {
|
||||
margin-left: 40px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
position: relative;
|
||||
}
|
||||
.edo_operators_settings_list_item a {
|
||||
color: #8e94a7;
|
||||
font-style: italic;
|
||||
}
|
||||
.edo_operators_settings_list_item:before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
left: -40px;
|
||||
top: -7px;
|
||||
width: 24px;
|
||||
min-width: 24px;
|
||||
height: 30px;
|
||||
min-height: 30px;
|
||||
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");
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
background-position-y: 6px;
|
||||
}
|
||||
.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");
|
||||
}
|
||||
|
||||
@ -7161,10 +7161,26 @@ main .dropdown_blocks_list.zero-margin.gibdd .dropdown_block {
|
||||
p {
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
.list_title {
|
||||
font-weight: 700 !important;
|
||||
margin-bottom: 15px;
|
||||
font-size: 15px;
|
||||
line-height: 23px;
|
||||
}
|
||||
}
|
||||
|
||||
.edo_list_field {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: flex-start !important;
|
||||
margin-bottom: 30px;
|
||||
width: 100%;
|
||||
|
||||
label {
|
||||
width: 186px;
|
||||
margin-right: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
.edo_list_selection {
|
||||
@ -7172,16 +7188,27 @@ main .dropdown_blocks_list.zero-margin.gibdd .dropdown_block {
|
||||
margin-top: -12px;
|
||||
|
||||
.item {
|
||||
width: 100%;
|
||||
padding: 16px 0px;
|
||||
margin: 0px !important;
|
||||
border-bottom: solid 1px #edeff5;
|
||||
|
||||
label {
|
||||
width: auto;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-right: 12px;
|
||||
// padding-top: 16px;
|
||||
|
||||
&:first {
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
&:before {
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
margin: auto;
|
||||
}
|
||||
}
|
||||
|
||||
&:first {
|
||||
@ -7199,4 +7226,44 @@ main .dropdown_blocks_list.zero-margin.gibdd .dropdown_block {
|
||||
flex-direction: column;
|
||||
margin: 30px 0px !important;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.edo_operators_settings_list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-content: flex-start;
|
||||
gap: 15px 0px;
|
||||
}
|
||||
|
||||
.edo_operators_settings_list_item {
|
||||
margin-left: 40px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
position: relative;
|
||||
|
||||
a {
|
||||
color: #8e94a7;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
&:before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
left: -40px;
|
||||
top: -7px;
|
||||
width: 24px;
|
||||
min-width: 24px;
|
||||
height: 30px;
|
||||
min-height: 30px;
|
||||
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");
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
background-position-y: 6px;
|
||||
}
|
||||
|
||||
&.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");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -7,7 +7,7 @@ import jwt from 'jsonwebtoken';
|
||||
import { cors } from '../cors';
|
||||
import { inspect } from 'util';
|
||||
|
||||
export default async function CRMRequestGet(req, res, path, params)
|
||||
export default async function CRMRequestGet(req, res, path, params, log = false)
|
||||
{
|
||||
await cors(req, res);
|
||||
|
||||
@ -42,10 +42,11 @@ export default async function CRMRequestGet(req, res, path, params)
|
||||
//console.log("params", { ...client_jwt_decoded, ...params });
|
||||
|
||||
|
||||
const payload = { ...{ acc_number: client_jwt_decoded.acc_number }, ...params };
|
||||
try
|
||||
{
|
||||
await axios.get(path, {
|
||||
params: { ...{ acc_number: client_jwt_decoded.acc_number }, ...params },
|
||||
params: payload,
|
||||
headers: {
|
||||
"Authorization": `Bearer ${ crm_jwt }`,
|
||||
},
|
||||
@ -53,10 +54,12 @@ export default async function CRMRequestGet(req, res, path, params)
|
||||
})
|
||||
.then((crm_response) =>
|
||||
{
|
||||
//console.log("crm_response for", path);
|
||||
|
||||
//console.log(inspect(crm_response.data, true, null, true));
|
||||
|
||||
if(log)
|
||||
{
|
||||
console.log("crm_response for", path);
|
||||
console.log("payload", payload);
|
||||
console.log(inspect(crm_response.data, true, null, true));
|
||||
}
|
||||
|
||||
res.status(200).json(crm_response.data);
|
||||
})
|
||||
|
||||
22
pages/api/contract/sign/cancel/check.js
Normal file
22
pages/api/contract/sign/cancel/check.js
Normal file
@ -0,0 +1,22 @@
|
||||
import CRMRequestGet from '../../../../../lib/CRMRequestGet';
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
console.log("API", "SIGN", "/cancel/check");
|
||||
|
||||
const { contract_number, sign_type } = req.body;
|
||||
const payload = {
|
||||
contract_number
|
||||
};
|
||||
|
||||
if(sign_type === "EDO")
|
||||
{
|
||||
payload.doc_type_id = 144;
|
||||
}
|
||||
else
|
||||
{
|
||||
payload.doc_type_id = 60;
|
||||
}
|
||||
|
||||
await CRMRequestGet(req, res, `${ process.env.CRM_API_HOST }/lk/Contract/CheckCancelDocument`, payload);
|
||||
}
|
||||
22
pages/api/contract/sign/cancel/index.js
Normal file
22
pages/api/contract/sign/cancel/index.js
Normal file
@ -0,0 +1,22 @@
|
||||
import CRMRequestGet from '../../../../../lib/CRMRequestGet';
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
console.log("API", "SIGN", "/cancel");
|
||||
|
||||
const { contract_number, sign_type } = req.body;
|
||||
const payload = {
|
||||
contract_number
|
||||
};
|
||||
|
||||
if(sign_type === "EDO")
|
||||
{
|
||||
payload.doc_type_id = 144;
|
||||
}
|
||||
else
|
||||
{
|
||||
payload.doc_type_id = 60;
|
||||
}
|
||||
|
||||
await CRMRequestGet(req, res, `${ process.env.CRM_API_HOST }/lk/Contract/CancelDocument`, payload);
|
||||
}
|
||||
14
pages/api/contract/sign/check.js
Normal file
14
pages/api/contract/sign/check.js
Normal file
@ -0,0 +1,14 @@
|
||||
import CRMRequestGet from '../../../../lib/CRMRequestGet';
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
console.log("API", "SIGN", "/check");
|
||||
|
||||
const { contract_number, sign_type } = req.body;
|
||||
const payload = {
|
||||
contract_number,
|
||||
sign_type
|
||||
};
|
||||
|
||||
await CRMRequestGet(req, res, `${ process.env.CRM_API_HOST }/lk/Contract/CheckCreatePrintForm`, payload);
|
||||
}
|
||||
26
pages/api/contract/sign/document.js
Normal file
26
pages/api/contract/sign/document.js
Normal file
@ -0,0 +1,26 @@
|
||||
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 payload = {
|
||||
entityName,
|
||||
entityId,
|
||||
reportCodes: [ "Leas_Contract" ],
|
||||
inputParameters: [ sign_type ],
|
||||
createDocument: true,
|
||||
};
|
||||
|
||||
if(sign_type === "EDO")
|
||||
{
|
||||
payload.documentTypeEvoId = 144;
|
||||
}
|
||||
else
|
||||
{
|
||||
payload.documentTypeEvoId = 60;
|
||||
}
|
||||
|
||||
await CRMRequestGet(req, res, `${ process.env.CRM_API_HOST }/File/GetWMDoc`, payload);
|
||||
}
|
||||
13
pages/api/contract/sign/entity.js
Normal file
13
pages/api/contract/sign/entity.js
Normal file
@ -0,0 +1,13 @@
|
||||
import CRMRequestGet from '../../../../lib/CRMRequestGet';
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
console.log("API", "SIGN", "/entity");
|
||||
|
||||
const { contract_number } = req.body;
|
||||
const payload = {
|
||||
contract_number
|
||||
};
|
||||
|
||||
await CRMRequestGet(req, res, `${ process.env.CRM_API_HOST }/lk/Contract/GetGUIDEntity`, payload);
|
||||
}
|
||||
@ -1,3 +1,12 @@
|
||||
/*
|
||||
2.8.3 - Метод отправки Приглашения Клиенту(для ЭДО) (lk/Account/InviteEdoBox)
|
||||
*/
|
||||
|
||||
import CRMRequestGet from '../../../../lib/CRMRequestGet';
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
console.log("API", "EDO", "/invite/send");
|
||||
|
||||
await CRMRequestGet(req, res, `${ process.env.CRM_API_HOST }/lk/Account/InviteEdoBox`, {});
|
||||
}
|
||||
11
pages/api/edo/invites.js
Normal file
11
pages/api/edo/invites.js
Normal file
@ -0,0 +1,11 @@
|
||||
/*
|
||||
2.8.1 - Метод получения доступных для работы в ЭДО ящиков (lk/Account/GetEdoBox)
|
||||
*/
|
||||
import CRMRequestGet from '../../../lib/CRMRequestGet';
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
console.log("API", "EDO", "/invites");
|
||||
|
||||
await CRMRequestGet(req, res, `${ process.env.CRM_API_HOST }/lk/Account/GetInviteEdoBox`, {});
|
||||
}
|
||||
@ -5,7 +5,7 @@ import CRMRequestGet from '../../../lib/CRMRequestGet';
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
console.log("API", "EDO", "/list");
|
||||
console.log("API", "EDO", "/operators");
|
||||
|
||||
await CRMRequestGet(req, res, `${ process.env.CRM_API_HOST }/lk/Account/GetEdoBox`, {});
|
||||
}
|
||||
@ -190,7 +190,7 @@ class ContractPage extends React.Component
|
||||
) : (
|
||||
<>
|
||||
{ edo_mode ? (
|
||||
<EDOSign document={ this.state.edo_document } onCancel={ () => this.setState({ edo_mode: false }) }/>
|
||||
<EDOSign documents={ [ this.state.edo_document ] } onCancel={ () => this.setState({ edo_mode: false }) }/>
|
||||
) : (
|
||||
<div className="docs_list medium-icon">
|
||||
{ unsigned !== undefined && unsigned !== null && unsigned.documents !== undefined && unsigned.documents !== null && unsigned.count > 0 && (
|
||||
|
||||
@ -20,9 +20,9 @@ import Footer from '../components/Footer';
|
||||
import Pagination from '../components/Pagination';
|
||||
import Company from "../components/Company";
|
||||
|
||||
import { sendPhoneChangeNumber, sendPhoneChangeNumberSmsCode, setUserPhone } from '../../actions';
|
||||
import { inviteToEDO, sendPhoneChangeNumber, sendPhoneChangeNumberSmsCode, setUserPhone } from '../../actions';
|
||||
import AccountLayout from "../components/Layout/Account";
|
||||
import { getEDOList } from "../../actions/edoActions";
|
||||
import { getEDOOperatorList, getEDOInvitesList } from "../../actions";
|
||||
|
||||
class IndexPage extends React.Component
|
||||
{
|
||||
@ -32,22 +32,20 @@ class IndexPage extends React.Component
|
||||
this.state = {
|
||||
loading: false,
|
||||
operator: undefined,
|
||||
oparators: [
|
||||
{ "value": "1", "label": "Диадок" },
|
||||
{ "value": "2", "label": "Такском" },
|
||||
{ "value": "3", "label": "Тензор" },
|
||||
{ "value": "4", "label": "Калуга Астрал" },
|
||||
{ "value": "5", "label": "КОРУС Консалтинг" },
|
||||
{ "value": "6", "label": "АйтиКом" },
|
||||
]
|
||||
operators: null,
|
||||
invites: null,
|
||||
message: undefined,
|
||||
};
|
||||
}
|
||||
|
||||
static getDerivedStateFromProps(nextProps, prevState)
|
||||
{
|
||||
console.log("getDerivedStateFromProps", "edo", "operators", nextProps.operators);
|
||||
return {
|
||||
observer: nextProps.observer,
|
||||
user: nextProps.user,
|
||||
operators: nextProps.operators,
|
||||
invites: nextProps.operators,
|
||||
};
|
||||
}
|
||||
|
||||
@ -55,20 +53,27 @@ class IndexPage extends React.Component
|
||||
{
|
||||
const { dispatch } = this.props;
|
||||
|
||||
getEDOList({ dispatch })
|
||||
.then(() =>
|
||||
{
|
||||
|
||||
})
|
||||
.catch(() =>
|
||||
{
|
||||
|
||||
});
|
||||
getEDOOperatorList({ dispatch }).then(() => {}).catch(() => {});
|
||||
getEDOInvitesList({ dispatch }).then(() => {}).catch(() => {});
|
||||
}
|
||||
|
||||
_handle_onFormSubmit = (event) =>
|
||||
{
|
||||
event.preventDefault();
|
||||
|
||||
console.log("_handle_onFormSubmit");
|
||||
this.setState({ loading: true }, () =>
|
||||
{
|
||||
inviteToEDO()
|
||||
.then((message) =>
|
||||
{
|
||||
this.setState({ message })
|
||||
})
|
||||
.catch(() =>
|
||||
{
|
||||
this.setState({ message })
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
_handle_onOperatorChange = (operator) =>
|
||||
@ -78,8 +83,11 @@ class IndexPage extends React.Component
|
||||
|
||||
render()
|
||||
{
|
||||
const { user, oparators, operator, loading, } = this.state;
|
||||
const { user, operators, invites, operator, loading, message } = this.state;
|
||||
|
||||
var list = operators !== null && invites !== null ? [ ...operators, ...invites ] : null;
|
||||
|
||||
console.log({ operators });
|
||||
return (
|
||||
<React.Fragment>
|
||||
<Head>
|
||||
@ -101,33 +109,66 @@ class IndexPage extends React.Component
|
||||
<div className="aside_container about">
|
||||
<InnerMenu { ...this.props } user={ user }/>
|
||||
<article className="questionnaire edo_detail">
|
||||
{/*}
|
||||
<p>Выберите своего оператора. Мы отправим вашей организации приглашение.</p>
|
||||
<p><br/></p>
|
||||
<form ref={ this.ref_form } onSubmit={ this._handle_onFormSubmit } onKeyDown={(e) => {if (e.key === 'Enter') e.preventDefault() }}>
|
||||
<div className="form_field">
|
||||
<label>Оператор ЭДО <sup className="required_label">*</sup></label>
|
||||
<Select
|
||||
id="edo_oparators_list"
|
||||
name="edo_oparators_list"
|
||||
options={ oparators }
|
||||
placeholder="Выберите оператора"
|
||||
noOptionsMessage={ ({ inputValue }) => !inputValue ? "" :"Ничего не найдено" }
|
||||
isSearchable={ true }
|
||||
className="autocomlete autocomlete_with_indicators"
|
||||
classNamePrefix="react-select"
|
||||
value={ operator !== undefined ? operator : undefined }
|
||||
onChange={ (element) => { this._handle_onOperatorChange(element) } }
|
||||
required={ true }
|
||||
/>
|
||||
{*/}
|
||||
{ list !== undefined && list !== null ? (
|
||||
<>
|
||||
<p>Операторы ЭДО с которыми установлена связь</p>
|
||||
<p><br/></p>
|
||||
{ message === undefined ? (
|
||||
<form ref={ this.ref_form } onSubmit={ this._handle_onFormSubmit } onKeyDown={(e) => {if (e.key === 'Enter') e.preventDefault() }}>
|
||||
<div className="form_field edo_operators_settings_list">
|
||||
{ list.length > 0 ?
|
||||
<>
|
||||
{ operators.map((operator, index) => (
|
||||
<div key={ index } className="edo_operators_settings_list_item">{ operator.provider_edo }
|
||||
<a href={ operator.url_edo } >{ operator.url_edo }</a>
|
||||
</div>
|
||||
)) }
|
||||
{ invites.map((invite, index) => (
|
||||
<div key={ index } className="edo_operators_settings_list_item invite">{ invite.provider_edo }
|
||||
<a href={ invite.url_edo } >{ invite.url_edo }</a>
|
||||
</div>
|
||||
)) }
|
||||
</> : (
|
||||
<p>У Вас пока нет подключенных операторов ЭДО. Запросите отправку нового приглашения.</p>
|
||||
)
|
||||
}
|
||||
{/*}
|
||||
<label>Оператор ЭДО <sup className="required_label">*</sup></label>
|
||||
<Select
|
||||
id="edo_operators_list"
|
||||
name="edo_operators_list"
|
||||
options={ operators }
|
||||
placeholder="Выберите оператора"
|
||||
noOptionsMessage={ ({ inputValue }) => !inputValue ? "" :"Ничего не найдено" }
|
||||
isSearchable={ true }
|
||||
className="autocomlete autocomlete_with_indicators"
|
||||
classNamePrefix="react-select"
|
||||
value={ operator !== undefined ? operator : undefined }
|
||||
onChange={ (element) => { this._handle_onOperatorChange(element) } }
|
||||
required={ true }
|
||||
/>
|
||||
{*/}
|
||||
</div>
|
||||
<div className="form_field" style={{ display: "flex", justifyContent: "flex-end" }}>
|
||||
<button type="submit" className="button button-blue" style={{ minWidth: "232px" }}>
|
||||
{ loading ? (
|
||||
<SpinnerCircular size={24} thickness={100} speed={100} color="rgba(255, 255, 255, 1)" secondaryColor="rgba(255, 255, 255, 0.5)" style={{ marginTop: "0px" }}/>
|
||||
) : "Отправить новое приглашение" }
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
) : (
|
||||
<p>{ message }</p>
|
||||
) }
|
||||
</>
|
||||
) : (
|
||||
<div style={{ minHeight: 200, display: "flex", justifyContent: "center", alignItems: "center", }}>
|
||||
<SpinnerCircular size={ 90 } thickness={ 51 } speed={ 100 } color="rgba(28, 1, 169, 1)" secondaryColor="rgba(236, 239, 244, 1)" />
|
||||
</div>
|
||||
<div className="form_field" style={{ display: "flex", justifyContent: "flex-end" }}>
|
||||
<button type="submit" className="button button-blue" disabled={ operator === undefined ? true : false }>
|
||||
{ loading ? (
|
||||
<SpinnerCircular size={24} thickness={100} speed={100} color="rgba(255, 255, 255, 1)" secondaryColor="rgba(255, 255, 255, 0.5)" style={{ marginTop: "4px" }}/>
|
||||
) : "Отправить приглашение" }
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
) }
|
||||
</article>
|
||||
</div>
|
||||
</NoSSR>
|
||||
@ -140,9 +181,11 @@ class IndexPage extends React.Component
|
||||
|
||||
function mapStateToProps(state, ownProps)
|
||||
{
|
||||
console.log("mapStateToProps", "operators", { edo: state.edo });
|
||||
return {
|
||||
observer: state.auth.observer,
|
||||
user: state.user,
|
||||
operators: state.edo.operators,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -15,17 +15,17 @@ const edoReducer = (state = initialState.edo, action) =>
|
||||
};
|
||||
}
|
||||
|
||||
case actionTypes.EDO_LIST:
|
||||
case actionTypes.EDO_OPERATORS_LIST:
|
||||
{
|
||||
console.log("actionTypes.EDO_LIST", actionTypes.EDO_LIST, { action });
|
||||
console.log("actionTypes.EDO_OPERATORS_LIST", actionTypes.EDO_OPERATORS_LIST, { action });
|
||||
console.log({
|
||||
...state,
|
||||
list: action.data.list,
|
||||
operators: action.data.operators,
|
||||
});
|
||||
|
||||
return {
|
||||
...state,
|
||||
list: action.data.list,
|
||||
operators: action.data.operators,
|
||||
};
|
||||
}
|
||||
|
||||
@ -33,7 +33,7 @@ const edoReducer = (state = initialState.edo, action) =>
|
||||
{
|
||||
return {
|
||||
loaded: false,
|
||||
list: null,
|
||||
operators: null,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -255,7 +255,8 @@ export const defaultState = {
|
||||
edo:
|
||||
{
|
||||
loaded: false,
|
||||
list: null,
|
||||
operators: null,
|
||||
invites: null,
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user