Номер обращения: { appeal.number } от { moment(appeal.created_date, "YYYY-MM-DD").format("DD.MM.YYYY") }
-
Отвественный сотрудник ОРК: { appeal.owner }
+
Ваш персональный менеджер: { appeal.owner }
{ appeal.contracts.length > 0 && (
Договор{ appeal.contracts.length > 1 && "ы" }: { appeal.contracts.map((contract, contract_index) => (№ { contract }{ contract_index < appeal.contracts.length - 1 && ", " })) }
) }
@@ -152,21 +154,24 @@ class SupportAppealsPage extends React.Component
Тема запроса
{ appeal.subject }
+ { appeal.documents.length > 0 && (
+
+ { appeal.documents.map((file, index) => {
+ if(file.doc_direction !== "outgoing") { return null; }
+ return ()
+ }) }
+
+ ) }
-
Ответ ОРК
+
Ответ службы клиентского сервиса
{ appeal.answer === "" ? "Без ответа" : appeal.answer }
{ appeal.documents.length > 0 && (
- { appeal.documents.map((document, document_index) =>
- (
-
-
- { document.doc_name }
- Скачать документ
-
-
- )) }
+ { appeal.documents.map((file, index) => {
+ if(file.doc_direction !== "incoming") { return null; }
+ (
)
+ }) }
) }
diff --git a/pages/support/components/RequestFile/index.js b/pages/support/components/RequestFile/index.js
new file mode 100644
index 0000000..c120fd3
--- /dev/null
+++ b/pages/support/components/RequestFile/index.js
@@ -0,0 +1,48 @@
+import React from "react";
+import { SpinnerCircular } from "spinners-react";
+
+import { getFile } from "../../../../actions";
+
+export default class RequestFile extends React.Component
+{
+ constructor(props)
+ {
+ super(props);
+ this.state = {
+ downloading: false
+ }
+ }
+
+ _handle_onDownloadFile = () =>
+ {
+ const { id, filename } = this.props;
+ const { downloading } = this.state;
+
+ if(!downloading)
+ {
+ this.setState({ downloading: true }, () =>
+ {
+ getFile({ id, filename })
+ .then(() => { this.setState({ downloading: false }); })
+ .catch(() => { this.setState({ downloading: false }); });
+ });
+ }
+ }
+
+ render()
+ {
+ const { filename, extension } = this.props;
+ const { downloading } = this.state;
+
+ return (
+
+
+ { filename }
+
+ Скачать шаблон{ downloading ? () : null }
+
+
+
+ )
+ }
+}
\ No newline at end of file
diff --git a/pages/support/components/TemplateFile/index.js b/pages/support/components/TemplateFile/index.js
new file mode 100644
index 0000000..3289023
--- /dev/null
+++ b/pages/support/components/TemplateFile/index.js
@@ -0,0 +1,48 @@
+import React from "react";
+import { SpinnerCircular } from "spinners-react";
+
+import { getBitrixFile } from "../../../../actions";
+
+export default class TemplateFile extends React.Component
+{
+ constructor(props)
+ {
+ super(props);
+ this.state = {
+ downloading: false
+ }
+ }
+
+ _handle_onDownloadFile = () =>
+ {
+ const { filename, url } = this.props.template;
+ const { downloading } = this.state;
+
+ if(!downloading)
+ {
+ this.setState({ downloading: true }, () =>
+ {
+ getBitrixFile({ url, filename })
+ .then(() => { this.setState({ downloading: false }); })
+ .catch(() => { this.setState({ downloading: false }); });
+ });
+ }
+ }
+
+ render()
+ {
+ const { template } = this.props;
+ const { downloading } = this.state;
+
+ return (
+
+
+ { template.filename }
+
+ Скачать шаблон{ downloading ? () : null }
+
+
+
+ )
+ }
+}
\ No newline at end of file
diff --git a/pages/support/index.js b/pages/support/index.js
index 31c7641..ba555ef 100644
--- a/pages/support/index.js
+++ b/pages/support/index.js
@@ -12,11 +12,12 @@ import Header from "../components/Header";
import Footer from "../components/Footer";
import Company from "../components/Company";
import InnerMenu from "./components/InnerMenu";
+import AccountLayout from "../components/Layout/Account";
+import TemplateFile from "./components/TemplateFile";
import {
getSupportThemes,
} from "../../actions";
-import AccountLayout from "../components/Layout/Account";
class ContractPage extends React.Component
{
@@ -182,12 +183,7 @@ class ContractPage extends React.Component
Шаблоны документов
- { question.templates.map((template, index) =>
- (
-
-
{ template.filename }
-
- )) }
+ { question.templates.map((template, index) => (
)) }
) }
diff --git a/pages/support/request.js b/pages/support/request.js
index c864498..218b05b 100644
--- a/pages/support/request.js
+++ b/pages/support/request.js
@@ -15,6 +15,8 @@ import Footer from "../components/Footer";
import Company from "../components/Company";
import InnerMenu from "./components/InnerMenu";
import SuccessMessage from "./components/SuccessMessage";
+import AccountLayout from "../components/Layout/Account";
+import TemplateFile from "./components/TemplateFile";
import {
getSupportThemes,
@@ -23,46 +25,7 @@ import {
sendNewAppeal,
sendAppealAttachments
} from "../../actions";
-import AccountLayout from "../components/Layout/Account";
-class TemplateFile extends React.Component
-{
- constructor(props)
- {
- super(props);
- this.state = {
- downloading: false
- }
- }
-
- _handle_onDownloadFile = () =>
- {
- const { filename, url } = this.props.template;
- const { downloading } = this.state;
-
- if(!downloading)
- {
- this.setState({ downloading: true }, () =>
- {
- getBitrixFile({ url, filename })
- .then(() => { this.setState({ downloading: false }); })
- .catch(() => { this.setState({ downloading: false }); });
- });
- }
- }
-
- render()
- {
- const { template } = this.props;
- const { downloading } = this.state;
-
- return (
-
-
{ template.filename }Скачать шаблон{ downloading ? () : null }
-
- )
- }
-}
class FileDropzone extends React.Component
{
constructor(props)
@@ -242,7 +205,10 @@ class SupportRequestPage extends React.Component
})
.then(() =>
{
- this.setState({ loading: false, success: true, });
+ this.setState({ loading: false, success: true, }, () =>
+ {
+ window.scrollTo(0, 0);
+ });
})
.catch(() =>
{
@@ -251,7 +217,10 @@ class SupportRequestPage extends React.Component
}
else
{
- this.setState({ loading: false, success: true, });
+ this.setState({ loading: false, success: true, }, () =>
+ {
+ window.scrollTo(0, 0);
+ });
}
})
.catch(() =>
diff --git a/reducers/contractEventsReducer.js b/reducers/contractEventsReducer.js
new file mode 100644
index 0000000..8133d09
--- /dev/null
+++ b/reducers/contractEventsReducer.js
@@ -0,0 +1,28 @@
+import { HYDRATE } from 'next-redux-wrapper';
+
+import * as actionTypes from '../constants/actionTypes';
+import initialState from "./initialState";
+
+const contractEventsReducer = (state = initialState.contract_events, action) =>
+{
+ switch (action.type)
+ {
+ case actionTypes.CONTRACT_EVENTS:
+ {
+ return {
+ ...state, ...action.data,
+ };
+ }
+
+ case actionTypes.CONTRACT_EVENTS_RESET:
+ {
+ return {};
+ }
+
+ default: {
+ return state;
+ }
+ }
+};
+
+export default contractEventsReducer;
\ No newline at end of file
diff --git a/reducers/initialState.js b/reducers/initialState.js
index da73e3e..6d5b38e 100644
--- a/reducers/initialState.js
+++ b/reducers/initialState.js
@@ -64,6 +64,7 @@ export const defaultState = {
calculated: null,
},
},
+ contract_events: {},
calendar: {
payments: null,
periods: null,
@@ -87,7 +88,7 @@ export const defaultState = {
events:
{
loaded: false,
- list: [],
+ list: undefined,
filtered: undefined,
},
support:
diff --git a/store/index.js b/store/index.js
index 24524b8..8817d1e 100644
--- a/store/index.js
+++ b/store/index.js
@@ -12,6 +12,7 @@ import eventsReducer from '../reducers/eventsReducer';
import supportReducer from '../reducers/supportReducer';
import adminReducer from '../reducers/adminReducer';
import contractsInfoReducer from '../reducers/contractsInfoReducer';
+import contractEventsReducer from '../reducers/contractEventsReducer';
const combinedReducer = combineReducers({
auth: authReducer,
@@ -25,6 +26,7 @@ const combinedReducer = combineReducers({
support: supportReducer,
admin: adminReducer,
contracts_info: contractsInfoReducer,
+ contract_events: contractEventsReducer,
});
const makeStore = (context) =>
@@ -42,7 +44,7 @@ const makeStore = (context) =>
const persistConfig = {
key: 'nextjs',
- whitelist: [ 'auth', 'user', 'company', 'companies', 'contracts_info', ],
+ whitelist: [ 'auth', 'user', 'company', 'companies', 'contracts_info', 'contract_events' ],
storage
};