graphic changes update
This commit is contained in:
parent
30cf18fff0
commit
23e092e3c8
@ -397,8 +397,9 @@ export const getContractGraphicChangeSignatories = ({ dispatch, number }) =>
|
||||
.catch((error) =>
|
||||
{
|
||||
console.error("ACTION", "getContractGraphicChangeSignatories", "error");
|
||||
console.error(error);
|
||||
reject();
|
||||
console.error(error.response.data);
|
||||
|
||||
reject(error.response.data);
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -425,8 +426,9 @@ export const getContractGraphicChangeVariants = ({ dispatch, number, variants =
|
||||
.catch((error) =>
|
||||
{
|
||||
console.error("ACTION", "getContractGraphicChangeVariants", "error");
|
||||
console.error(error);
|
||||
reject();
|
||||
console.error(error.response.data);
|
||||
|
||||
reject(error.response.data);
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -451,8 +453,9 @@ export const getContractGraphicChangeCalculationsList = ({ dispatch, number }) =
|
||||
.catch((error) =>
|
||||
{
|
||||
console.error("ACTION", "getContractGraphicChangeCalculationsList", "error");
|
||||
console.error(error);
|
||||
reject();
|
||||
console.error(error.response.data);
|
||||
|
||||
reject(error.response.data);
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -479,15 +482,16 @@ export const getContractGraphicChangeOptions = ({ dispatch, number, variants })
|
||||
.catch((error) =>
|
||||
{
|
||||
console.error("ACTION", "getContractGraphicChangeOptions", "error");
|
||||
console.error(error);
|
||||
reject();
|
||||
console.error(error.response.data);
|
||||
|
||||
reject(error.response.data);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
export const getContractGraphicChangeCalculate = (calculation) =>
|
||||
{
|
||||
console.log("ACTION", "getContractGraphicChangeCurrent", calculation);
|
||||
console.log("ACTION", "getContractGraphicChangeCalculate", calculation);
|
||||
|
||||
return new Promise((resolve, reject) =>
|
||||
{
|
||||
@ -498,14 +502,15 @@ export const getContractGraphicChangeCalculate = (calculation) =>
|
||||
})
|
||||
.then(async (response) =>
|
||||
{
|
||||
console.log("ACTION", "getContractGraphicChangeCurrent", "response.data", response.data);
|
||||
console.log("ACTION", "getContractGraphicChangeCalculate", "response.data", response.data);
|
||||
resolve(response.data);
|
||||
})
|
||||
.catch((error) =>
|
||||
{
|
||||
console.error("ACTION", "getContractGraphicChangeCurrent", "error");
|
||||
console.error(error);
|
||||
reject();
|
||||
console.error("ACTION", "getContractGraphicChangeCalculate", "error");
|
||||
console.error(error.response.data);
|
||||
|
||||
reject(error.response.data);
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -530,8 +535,9 @@ export const getContractGraphicChangeGetCurrent = ({ dispatch, number }) =>
|
||||
.catch((error) =>
|
||||
{
|
||||
console.error("ACTION", "getContractGraphicChangeGetCurrent", "error");
|
||||
console.error(error);
|
||||
reject();
|
||||
console.error(error.response.data);
|
||||
|
||||
reject(error.response.data);
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -556,8 +562,9 @@ export const getContractGraphicChangeGetCalculated = ({ dispatch, calculation })
|
||||
.catch((error) =>
|
||||
{
|
||||
console.error("ACTION", "getContractGraphicChangeGetCalculated", "error");
|
||||
console.error(error);
|
||||
reject();
|
||||
console.error(error.response.data);
|
||||
|
||||
reject(error.response.data);
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -580,8 +587,9 @@ export const signContractGraphicChange = (params) =>
|
||||
.catch((error) =>
|
||||
{
|
||||
console.error("ACTION", "signContractGraphicChange", "error");
|
||||
console.error(error);
|
||||
reject();
|
||||
console.error(error.response.data);
|
||||
|
||||
reject(error.response.data);
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -99,35 +99,30 @@ export const getSupportThemes = ({ dispatch, query, }) =>
|
||||
});
|
||||
}
|
||||
|
||||
export const sendNewAppeal = ({ name, phone, email, company }) =>
|
||||
export const sendNewAppeal = (appeal) =>
|
||||
{
|
||||
console.log("ACTION", "support", "sendNewAppeal", appeal);
|
||||
|
||||
return new Promise((resolve, reject) =>
|
||||
{
|
||||
var formData = new FormData();
|
||||
formData.append("form", "FORM_LEASING_REQUESTS");
|
||||
formData.append("FORM_FIELD_FIO", name);
|
||||
formData.append("FORM_FIELD_PHONE", phone);
|
||||
formData.append("FORM_FIELD_EMAIL", email);
|
||||
formData.append("FORM_FIELD_COMPANY", company);
|
||||
formData.append("FORM_FIELD_PAGE_NAME", document.title);
|
||||
formData.append("FORM_FIELD_PAGE_URL", window.location.href);
|
||||
|
||||
axios.post(`${ process.env.NEXT_PUBLIC_API_HOST }/api/forms/`, formData)
|
||||
.then((response) =>
|
||||
return new Promise((resolve, reject) =>
|
||||
{
|
||||
if(response.data.status === "complete")
|
||||
axios.post(`${ process.env.NEXT_PUBLIC_SELF_API_HOST }/api/support/request`, {
|
||||
query
|
||||
},
|
||||
{
|
||||
withCredentials: true,
|
||||
})
|
||||
.then(async (response) =>
|
||||
{
|
||||
console.log("sendNewAppeal", "response.data", response.data);
|
||||
resolve();
|
||||
}
|
||||
else
|
||||
})
|
||||
.catch((error) =>
|
||||
{
|
||||
console.error(error);
|
||||
reject();
|
||||
}
|
||||
})
|
||||
.catch((error) =>
|
||||
{
|
||||
console.error(error);
|
||||
reject();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -52,13 +52,16 @@ export default async function CRMRequestGet(req, res, path, params)
|
||||
.catch((error) =>
|
||||
{
|
||||
console.error(error);
|
||||
res.status(500);
|
||||
console.error("-".repeat(30), "error.response.data:");
|
||||
console.error(error.response.data);
|
||||
|
||||
res.status(500).json(error.response.data);
|
||||
});
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
console.error(e);
|
||||
res.status(500);
|
||||
res.status(500).send(e);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@ -51,13 +51,16 @@ export default async function CRMRequestPost(req, res, path, params)
|
||||
.catch((error) =>
|
||||
{
|
||||
console.error(error);
|
||||
res.status(500);
|
||||
console.error("-".repeat(30), "error.response.data:");
|
||||
console.error(error.response.data);
|
||||
|
||||
res.status(500).json(error.response.data);
|
||||
});
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
console.error(e);
|
||||
res.status(500);
|
||||
res.status(500).send(e);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
"react": "17.0.2",
|
||||
"react-cookie": "^4.1.1",
|
||||
"react-dom": "17.0.2",
|
||||
"react-dropzone": "^14.2.2",
|
||||
"react-redux": "^7.2.6",
|
||||
"react-slick": "^0.29.0",
|
||||
"react-widgets": "^5.5.1",
|
||||
|
||||
@ -3,7 +3,9 @@ import CRMRequestPost from '../../../../../lib/CRMRequestPost';
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
console.log("WTF BODY");
|
||||
console.log("API", "contract", "change", "graphic", "calculate");
|
||||
console.log(req.body);
|
||||
console.log("-".repeat(50));
|
||||
|
||||
await CRMRequestPost(req, res, `${ process.env.CRM_API_HOST }/lk/add-contract/CreateCalculation?contract_number=${ req.body.contract_number }`, req.body);
|
||||
}
|
||||
@ -3,5 +3,9 @@ import CRMRequestGet from '../../../../../lib/CRMRequestGet';
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
console.log("API", "contract", "change", "graphic", "calculation");
|
||||
console.log(req.body);
|
||||
console.log("-".repeat(50));
|
||||
|
||||
await CRMRequestGet(req, res, `${ process.env.CRM_API_HOST }/lk/add-contract/GetPreCalculationGraph`, { addcontract_number: req.body.calculation });
|
||||
}
|
||||
@ -3,5 +3,9 @@ import CRMRequestGet from '../../../../../lib/CRMRequestGet';
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
console.log("API", "contract", "change", "graphic", "current");
|
||||
console.log(req.body);
|
||||
console.log("-".repeat(50));
|
||||
|
||||
await CRMRequestGet(req, res, `${ process.env.CRM_API_HOST }/lk/add-contract/GetCurrentGraph`, { contract_number: req.body.number });
|
||||
}
|
||||
@ -3,5 +3,9 @@ import CRMRequestPost from '../../../../../lib/CRMRequestPost';
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
console.log("API", "contract", "change", "graphic", "sign");
|
||||
console.log(req.body);
|
||||
console.log("-".repeat(50));
|
||||
|
||||
await CRMRequestPost(req, res, `${ process.env.CRM_API_HOST }/lk/add-contract/Signing?addcontract_number=${ req.body.addcontract_number }`, req.body);
|
||||
}
|
||||
@ -3,9 +3,8 @@ import CRMRequestGet from '../../../../lib/CRMRequestGet';
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
console.log("-".repeat(50));
|
||||
console.log("API", "contract", "change", "options", "req.body.variants");
|
||||
console.log(req.body.variants);
|
||||
console.log("API", "contract", "change", "options");
|
||||
console.log(req.body);
|
||||
console.log("-".repeat(50));
|
||||
|
||||
await CRMRequestGet(req, res, `${ process.env.CRM_API_HOST }/lk/add-contract/GetTypeOptions`, { ...{ contract_number: req.body.number }, ...req.body.variants });
|
||||
|
||||
@ -3,8 +3,8 @@ import CRMRequestGet from '../../../../lib/CRMRequestGet';
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
console.log("req.body.variantsreq.body.variantsreq.body.variantsreq.body.variants");
|
||||
console.log(req.body.variants);
|
||||
console.log("API", "contract", "change", "variants");
|
||||
console.log(req.body);
|
||||
console.log("-".repeat(50));
|
||||
|
||||
await CRMRequestGet(req, res, `${ process.env.CRM_API_HOST }/lk/add-contract/GetAvaliableGraphChangeTypes`, { ...{ contract_number: req.body.number }, ...req.body.variants });
|
||||
|
||||
55
pages/api/support/attachment.js
Normal file
55
pages/api/support/attachment.js
Normal file
@ -0,0 +1,55 @@
|
||||
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
|
||||
import axios from 'axios';
|
||||
import { Cookies } from 'react-cookie';
|
||||
import cookie from 'cookie';
|
||||
import moment from 'moment';
|
||||
import jwt from 'jsonwebtoken';
|
||||
import { cors } from '../../../lib/cors';
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
await cors(req, res);
|
||||
|
||||
console.log("API", "support", "request");
|
||||
console.log(req.body);
|
||||
console.log("-".repeat(50));
|
||||
|
||||
if(req.headers.cookie !== undefined)
|
||||
{
|
||||
const cookies = cookie.parse(req.headers?.cookie ? req.headers?.cookie : "");
|
||||
if(cookies.jwt !== undefined && cookies.jwt !== null)
|
||||
{
|
||||
if(jwt.verify(cookies.jwt, process.env.JWT_SECRET_CLIENT))
|
||||
{
|
||||
const response = await new Promise((resolve, reject) =>
|
||||
{
|
||||
axios.post(`${ process.env.CRM_API_HOST }/lk/incident/UploadDocument`, req.body)
|
||||
.then((api_response) =>
|
||||
{
|
||||
console.log("RESPONSE");
|
||||
console.log(api_response.data);
|
||||
|
||||
resolve(api_response.data);
|
||||
})
|
||||
.catch((error) =>
|
||||
{
|
||||
console.log("error");
|
||||
console.error(error);
|
||||
|
||||
reject([]);
|
||||
});
|
||||
});
|
||||
|
||||
res.status(200).json(response);
|
||||
}
|
||||
else
|
||||
{
|
||||
res.status(403);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
res.status(403);
|
||||
}
|
||||
}
|
||||
}
|
||||
11
pages/api/support/request.js
Normal file
11
pages/api/support/request.js
Normal file
@ -0,0 +1,11 @@
|
||||
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
|
||||
import CRMRequestPost from '../../../lib/CRMRequestPost';
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
console.log("API", "support", "request");
|
||||
console.log(req.body);
|
||||
console.log("-".repeat(50));
|
||||
|
||||
await CRMRequestPost(req, res, `${ process.env.CRM_API_HOST }/lk/incident/CreateRequestClient`, req.body);
|
||||
}
|
||||
@ -1,7 +1,7 @@
|
||||
import React from "react";
|
||||
import Link from "next/link";
|
||||
|
||||
export default class Comparison extends React.Component
|
||||
export default class FinalMessage extends React.Component
|
||||
{
|
||||
constructor(props)
|
||||
{
|
||||
@ -548,14 +548,14 @@ export default class Options extends React.Component
|
||||
getContractGraphicChangeCalculate(payload)
|
||||
.then((calculation) =>
|
||||
{
|
||||
console.log("calculationcalculationcalculationcalculationcalculation");
|
||||
console.log(calculation);
|
||||
|
||||
onCalculate(calculation.addcontract_number);
|
||||
})
|
||||
.catch(() =>
|
||||
{
|
||||
this.setState({ sending: false, });
|
||||
this.setState({ sending: false, }, () =>
|
||||
{
|
||||
alert("К сожаление при расчете возникла ошибка.");
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@ -19,7 +19,7 @@ import SignatoriesList from "./components/SignatoriesList";
|
||||
import CalculationsList from "./components/CalculationsList";
|
||||
|
||||
import VariantsList from "./components/VariantsList";
|
||||
import Final from "./components/Final";
|
||||
import FinalMessage from "./components/FinalMessage";
|
||||
|
||||
import {
|
||||
getContractInfo,
|
||||
@ -225,7 +225,10 @@ class ChangeGraphicPage extends React.Component
|
||||
})
|
||||
.catch(() =>
|
||||
{
|
||||
this.setState({ loading: false, });
|
||||
this.setState({ loading: false, }, () =>
|
||||
{
|
||||
alert("К сожаление при формировании документа возникла ошибка.");
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -305,7 +308,7 @@ class ChangeGraphicPage extends React.Component
|
||||
<>
|
||||
{ mode_final ? (
|
||||
<div className="aside_container about">
|
||||
<Final number={ number } comment={ comment }/>
|
||||
<FinalMessage number={ number } comment={ comment }/>
|
||||
</div>
|
||||
) : (
|
||||
<div className="aside_container about">
|
||||
|
||||
@ -125,8 +125,8 @@ class IndexPage extends React.Component
|
||||
<div className="table_cell" data-title="ФИО пользователя">{ entry.name }</div>
|
||||
<div className="table_cell" data-title="Почта">{ user.email }</div>
|
||||
<div className="table_cell" data-title="Роль">Администратор</div>
|
||||
<div className="table_cell" data-title="Доступные организации">{ entry.companies.map((company, cindex) => (
|
||||
<p>{ company.title }</p>
|
||||
<div className="table_cell" data-title="Доступные организации">{ entry.companies.map((company, c_index) => (
|
||||
<p key={ c_index }>{ company.title }</p>
|
||||
)) }</div>
|
||||
<div className="table_cell" data-title="Статус">Активен</div>
|
||||
<div className="table_cell delete" style={{ position: 'relative' }}>
|
||||
|
||||
27
pages/support/components/SuccessMessage/index.js
Normal file
27
pages/support/components/SuccessMessage/index.js
Normal file
@ -0,0 +1,27 @@
|
||||
import React from "react";
|
||||
import Link from "next/link";
|
||||
|
||||
export default class SuccessMessage extends React.Component
|
||||
{
|
||||
constructor(props)
|
||||
{
|
||||
super(props);
|
||||
this.state = {
|
||||
};
|
||||
}
|
||||
|
||||
render()
|
||||
{
|
||||
const { number, comment } = this.props;
|
||||
|
||||
return (
|
||||
<article className="compare">
|
||||
<div className="compare_message">
|
||||
<p>{ comment }</p>
|
||||
<br/>
|
||||
<p>Перейти в раздел <Link href={`/contract/${ number }/agreement`}>«Документы по договору» </Link></p>
|
||||
</div>
|
||||
</article>
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -5,6 +5,7 @@ import { connect } from "react-redux";
|
||||
import { withRouter } from "next/router";
|
||||
import moment from "moment";
|
||||
import { SpinnerCircular } from "spinners-react";
|
||||
import Dropzone from 'react-dropzone';
|
||||
|
||||
import { reduxWrapper } from "../../store";
|
||||
|
||||
@ -12,12 +13,41 @@ import Header from "../components/Header";
|
||||
import Footer from "../components/Footer";
|
||||
import Company from "../components/Company";
|
||||
import InnerMenu from "./components/InnerMenu";
|
||||
import SuccessMessage from "./components/SuccessMessage";
|
||||
|
||||
import {
|
||||
getSupportThemes,
|
||||
getContractsList,
|
||||
} from "../../actions";
|
||||
|
||||
class FileDropzone extends React.Component
|
||||
{
|
||||
constructor(props)
|
||||
{
|
||||
super(props);
|
||||
}
|
||||
|
||||
render()
|
||||
{
|
||||
return (
|
||||
<Dropzone onDrop={ acceptedFiles => console.log(acceptedFiles) }>
|
||||
{ ({getRootProps, getInputProps}) => (
|
||||
<div className="file_upload dropzone" { ...getRootProps() }>
|
||||
<div className="files"></div>
|
||||
<div>
|
||||
<p data-sm-text="Выберите файлы">
|
||||
<span>Перенесите файлы на экран для быстрой загрузки или выберите файл с компьютера </span>
|
||||
</p>
|
||||
<label htmlFor="" className="button button-blue">Загрузить файл</label>
|
||||
</div>
|
||||
<input { ...getInputProps() } />
|
||||
</div>
|
||||
) }
|
||||
</Dropzone>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
class SupportRequestPage extends React.Component
|
||||
{
|
||||
constructor(props) {
|
||||
@ -30,9 +60,12 @@ class SupportRequestPage extends React.Component
|
||||
phone: "",
|
||||
email: "",
|
||||
question: "",
|
||||
selected_contracts: [],
|
||||
temp_selected_contract: null,
|
||||
file: null,
|
||||
opened_theme: 0,
|
||||
opened_question: 0,
|
||||
success: false,
|
||||
};
|
||||
}
|
||||
|
||||
@ -81,6 +114,21 @@ class SupportRequestPage extends React.Component
|
||||
|
||||
_handle_onSelectContracts = (event) =>
|
||||
{
|
||||
this.setState({ temp_selected_contract: event.target.value })
|
||||
}
|
||||
|
||||
_handle_onSendAppeal = () =>
|
||||
{
|
||||
const { name, phone, email, question, temp_selected_contract, } = this.state;
|
||||
|
||||
const appeal = {
|
||||
phone: phone,
|
||||
email: email,
|
||||
description: question,
|
||||
contract_numbers: [
|
||||
temp_selected_contract
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
_renderForm = () =>
|
||||
@ -90,10 +138,10 @@ class SupportRequestPage extends React.Component
|
||||
return (
|
||||
<form>
|
||||
<div className="form_field">
|
||||
<select multiple={ false } onChange={ this._handle_onSelectContracts }>
|
||||
<option default selected disabled>Выберите договоры</option>
|
||||
<select multiple={ false } onChange={ this._handle_onSelectContracts } defaultValue={ "" }>
|
||||
<option value="" disabled>Выберите договоры</option>
|
||||
{ contracts !== undefined && contracts !== null && contracts.map((contract, index) => (
|
||||
<option index={ index } value={ contract.number }>{ contract.number }</option>
|
||||
<option key={ index } value={ contract.number }>{ contract.number }</option>
|
||||
)) }
|
||||
</select>
|
||||
</div>
|
||||
@ -111,18 +159,9 @@ class SupportRequestPage extends React.Component
|
||||
<input type="email" name="name" placeholder="Email" />
|
||||
</div>
|
||||
<div className="form_field">
|
||||
<textarea placeholder="Введите текст запроса"></textarea>
|
||||
</div>
|
||||
<div className="file_upload dropzone">
|
||||
<div className="files"></div>
|
||||
<div>
|
||||
<p data-sm-text="Выберите файлы">
|
||||
<span>Перенесите файлы на экран для быстрой загрузки или выберите файл с компьютера </span>
|
||||
</p>
|
||||
<label htmlFor="" className="button button-blue">Загрузить файл</label>
|
||||
</div>
|
||||
<input type="file" accept="" />
|
||||
<textarea placeholder="Введите текст запроса" style={{ resize: "none" }}></textarea>
|
||||
</div>
|
||||
<FileDropzone/>
|
||||
</form>
|
||||
)
|
||||
}
|
||||
@ -130,7 +169,7 @@ class SupportRequestPage extends React.Component
|
||||
render()
|
||||
{
|
||||
const { number } = this.props;
|
||||
const { loading, themes, opened_theme, opened_question } = this.state;
|
||||
const { loading, success, themes, opened_theme, opened_question } = this.state;
|
||||
|
||||
const procedure = themes !== undefined && themes !== null ? themes[opened_theme].questions[opened_question] : undefined;
|
||||
|
||||
@ -153,61 +192,73 @@ class SupportRequestPage extends React.Component
|
||||
<Company { ...this.props }/>
|
||||
</div>
|
||||
<div className="aside_container about">
|
||||
<article className="full">
|
||||
<div className="new_appeal">
|
||||
<div className="column">
|
||||
<div className="dropdown_blocks_list appeal_list visible">
|
||||
{ themes !== undefined && themes !== null && themes.map((theme, theme_index) =>
|
||||
(
|
||||
<React.Fragment key={ `theme_${ theme_index }` } >
|
||||
<div className={ `appeal_item dropdown_block ${ theme_index === opened_theme && "open" }` } style={ theme_index === opened_theme ? { backgroundColor: "unset"} : {} } onClick={ () => this._handle_onChangeTheme(theme_index) }>
|
||||
<div className="block_header">
|
||||
<p style={{ fontWeight: "bold" }}>{ theme.name }</p>
|
||||
<button className="rotate"></button>
|
||||
</div>
|
||||
</div>
|
||||
{ theme_index === opened_theme && theme.questions.map((question, question_index) => (
|
||||
<div key={ `question_${ question_index }` } className={ `appeal_item dropdown_block ${ question_index === opened_question && "open" }` } style={{ paddingLeft: "20px" }} onClick={ () => this.setState({ opened_question: question_index }) }>
|
||||
<div className="block_header">
|
||||
<p>{ question.title }</p>
|
||||
<button className="rotate"></button>
|
||||
</div>
|
||||
</div>
|
||||
) )}
|
||||
</React.Fragment>
|
||||
)) }
|
||||
</div>
|
||||
</div>
|
||||
{ themes !== undefined && themes !== null && (
|
||||
<div className="column">
|
||||
<div className="column_text_block">
|
||||
<p><b>Процедура</b></p>
|
||||
<p dangerouslySetInnerHTML={{ __html: procedure.answer }}/>
|
||||
</div>
|
||||
{ procedure.documents !== null && (
|
||||
<div className="column_text_block">
|
||||
<p><b>Документы</b></p>
|
||||
<p dangerouslySetInnerHTML={{ __html: procedure.documents }}/>
|
||||
</div>
|
||||
) }
|
||||
{ procedure.templates !== null && (
|
||||
<div className="column_text_block">
|
||||
<p><b>Документы</b></p>
|
||||
<div className="dosc_list medium-icon">
|
||||
{ procedure.templates.map((template, index) =>
|
||||
{ loading ? (
|
||||
<div className="container" style={{ display: "flex", alignItems: "center", justifyContent: "center", }}>
|
||||
<SpinnerCircular size={ 90 } thickness={ 51 } speed={ 100 } color="rgba(28, 1, 169, 1)" secondaryColor="rgba(236, 239, 244, 1)" />
|
||||
</div>
|
||||
) : (
|
||||
<>
|
||||
{ success ? (
|
||||
<SuccessMessage/>
|
||||
) : (
|
||||
<article className="full">
|
||||
<div className="new_appeal">
|
||||
<div className="column">
|
||||
<div className="dropdown_blocks_list appeal_list visible">
|
||||
{ themes !== undefined && themes !== null && themes.map((theme, theme_index) =>
|
||||
(
|
||||
<div className="row" key={ `template_${ index }` }>
|
||||
<p className="doc_name i-pdf extension" data-format={ template.extension }>{ template.filename }<span>Скачать шаблон</span></p>
|
||||
</div>
|
||||
<React.Fragment key={ `theme_${ theme_index }` } >
|
||||
<div className={ `appeal_item dropdown_block ${ theme_index === opened_theme && "open" }` } style={ theme_index === opened_theme ? { backgroundColor: "unset"} : {} } onClick={ () => this._handle_onChangeTheme(theme_index) }>
|
||||
<div className="block_header">
|
||||
<p style={{ fontWeight: "bold" }}>{ theme.name }</p>
|
||||
<button className="rotate"></button>
|
||||
</div>
|
||||
</div>
|
||||
{ theme_index === opened_theme && theme.questions.map((question, question_index) => (
|
||||
<div key={ `question_${ question_index }` } className={ `appeal_item dropdown_block ${ question_index === opened_question && "open" }` } style={{ paddingLeft: "20px" }} onClick={ () => this.setState({ opened_question: question_index }) }>
|
||||
<div className="block_header">
|
||||
<p>{ question.title }</p>
|
||||
<button className="rotate"></button>
|
||||
</div>
|
||||
</div>
|
||||
) )}
|
||||
</React.Fragment>
|
||||
)) }
|
||||
</div>
|
||||
</div>
|
||||
) }
|
||||
{ this._renderForm() }
|
||||
</div>
|
||||
{ themes !== undefined && themes !== null && (
|
||||
<div className="column">
|
||||
<div className="column_text_block">
|
||||
<p><b>Процедура</b></p>
|
||||
<p dangerouslySetInnerHTML={{ __html: procedure.answer }}/>
|
||||
</div>
|
||||
{ procedure.documents !== null && (
|
||||
<div className="column_text_block">
|
||||
<p><b>Документы</b></p>
|
||||
<p dangerouslySetInnerHTML={{ __html: procedure.documents }}/>
|
||||
</div>
|
||||
) }
|
||||
{ procedure.templates !== null && (
|
||||
<div className="column_text_block">
|
||||
<p><b>Документы</b></p>
|
||||
<div className="dosc_list medium-icon">
|
||||
{ procedure.templates.map((template, index) =>
|
||||
(
|
||||
<div className="row" key={ `template_${ index }` }>
|
||||
<p className="doc_name i-pdf extension" data-format={ template.extension }>{ template.filename }<span>Скачать шаблон</span></p>
|
||||
</div>
|
||||
)) }
|
||||
</div>
|
||||
</div>
|
||||
) }
|
||||
{ this._renderForm() }
|
||||
</div>
|
||||
) }
|
||||
</div>
|
||||
</article>
|
||||
) }
|
||||
</div>
|
||||
</article>
|
||||
</>
|
||||
) }
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
37
yarn.lock
37
yarn.lock
@ -525,6 +525,11 @@ async@^3.2.2:
|
||||
resolved "https://registry.yarnpkg.com/async/-/async-3.2.2.tgz#2eb7671034bb2194d45d30e31e24ec7e7f9670cd"
|
||||
integrity sha512-H0E+qZaDEfx/FY4t7iLRv1W2fFI6+pyCeTw1uN20AQPiwqwM6ojPxHxdLv4z8hi2DtnW9BOckSspLucW7pIE5g==
|
||||
|
||||
attr-accept@^2.2.2:
|
||||
version "2.2.2"
|
||||
resolved "https://registry.yarnpkg.com/attr-accept/-/attr-accept-2.2.2.tgz#646613809660110749e92f2c10833b70968d929b"
|
||||
integrity sha512-7prDjvt9HmqiZ0cl5CRjtS84sEyhsHP2coDkaZKRKVfCDo9s7iw7ChVmar78Gu9pC4SoR/28wFu/G5JJhTnqEg==
|
||||
|
||||
available-typed-arrays@^1.0.5:
|
||||
version "1.0.5"
|
||||
resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7"
|
||||
@ -1515,6 +1520,13 @@ file-loader@^6.0.0, file-loader@^6.2.0:
|
||||
loader-utils "^2.0.0"
|
||||
schema-utils "^3.0.0"
|
||||
|
||||
file-selector@^0.6.0:
|
||||
version "0.6.0"
|
||||
resolved "https://registry.yarnpkg.com/file-selector/-/file-selector-0.6.0.tgz#fa0a8d9007b829504db4d07dd4de0310b65287dc"
|
||||
integrity sha512-QlZ5yJC0VxHxQQsQhXvBaC7VRJ2uaxTf+Tfpu4Z/OcVQJVpZO+DGU0rkoVW5ce2SccxugvpBJoMvUs59iILYdw==
|
||||
dependencies:
|
||||
tslib "^2.4.0"
|
||||
|
||||
fill-range@^7.0.1:
|
||||
version "7.0.1"
|
||||
resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40"
|
||||
@ -2862,6 +2874,15 @@ prop-types@^15.6.2, prop-types@^15.7.2:
|
||||
object-assign "^4.1.1"
|
||||
react-is "^16.8.1"
|
||||
|
||||
prop-types@^15.8.1:
|
||||
version "15.8.1"
|
||||
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5"
|
||||
integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==
|
||||
dependencies:
|
||||
loose-envify "^1.4.0"
|
||||
object-assign "^4.1.1"
|
||||
react-is "^16.13.1"
|
||||
|
||||
public-encrypt@^4.0.0:
|
||||
version "4.0.3"
|
||||
resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.3.tgz#4fcc9d77a07e48ba7527e7cbe0de33d0701331e0"
|
||||
@ -2966,12 +2987,21 @@ react-dom@17.0.2:
|
||||
object-assign "^4.1.1"
|
||||
scheduler "^0.20.2"
|
||||
|
||||
react-dropzone@^14.2.2:
|
||||
version "14.2.2"
|
||||
resolved "https://registry.yarnpkg.com/react-dropzone/-/react-dropzone-14.2.2.tgz#a75a0676055fe9e2cb78578df4dedb4c42b54f98"
|
||||
integrity sha512-5oyGN/B5rNhop2ggUnxztXBQ6q6zii+OMEftPzsxAR2hhpVWz0nAV+3Ktxo2h5bZzdcCKrpd8bfWAVsveIBM+w==
|
||||
dependencies:
|
||||
attr-accept "^2.2.2"
|
||||
file-selector "^0.6.0"
|
||||
prop-types "^15.8.1"
|
||||
|
||||
react-is@17.0.2, react-is@^17.0.2:
|
||||
version "17.0.2"
|
||||
resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0"
|
||||
integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==
|
||||
|
||||
react-is@^16.3.2, react-is@^16.7.0, react-is@^16.8.1:
|
||||
react-is@^16.13.1, react-is@^16.3.2, react-is@^16.7.0, react-is@^16.8.1:
|
||||
version "16.13.1"
|
||||
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
|
||||
integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==
|
||||
@ -3566,6 +3596,11 @@ tslib@^1.8.1:
|
||||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
|
||||
integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==
|
||||
|
||||
tslib@^2.4.0:
|
||||
version "2.4.0"
|
||||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3"
|
||||
integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==
|
||||
|
||||
tsutils@^3.21.0:
|
||||
version "3.21.0"
|
||||
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user