Номер обращения: { 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 e330d40..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)