This commit is contained in:
merelendor 2022-09-06 07:44:53 +03:00
commit 46a805b7ba
9 changed files with 332 additions and 202 deletions

View File

@ -110,7 +110,7 @@ export default class NotificationMessage extends React.Component
{
return (
<li className="new">
<p className="name"><b>Сформировано новое ДС { event.add_info} от { moment(event.event_date).format("DD.MM.YYYY") } по договору { event.contract_number }. Срок подписания (НЕТ ДАТЫ).</b></p>
<p className="name"><b>Сформировано новое ДС { event.add_info} от { moment(event.event_date).format("DD.MM.YYYY") } по договору { event.contract_number }.</b></p>
{ event.important && (<p className="type">Важное</p>) }
<p className="date">{ moment(event.event_date).format("DD.MM.YYYY") }</p>
<p className="action">

View File

@ -53,6 +53,7 @@ class Header extends React.Component
if (route.indexOf("/documents/") > -1) return "Взаиморасчеты и закрывающие документы";
if (route.indexOf("/settings/") > -1) return "Настройки";
if (route.indexOf("/contract") === 0) return "Договоры";
if (route.indexOf("/support") === 0) return "Обращения";
return null;
};

View File

@ -20,20 +20,22 @@ export default class Comparison extends React.Component
show_previous: false,
mixed_index: 0,
signatories_show_all: false,
opened: [],
};
}
componentDidMount()
{
if(this.props.signer === undefined)
const { signer, signatories, calculations, calculation_id, current } = this.props;
const { today } = this.state;
if(signer === undefined)
{
if(this.props.signatories !== undefined && this.props.signatories !== null)
if(signatories !== undefined && signatories !== null)
{
this._handle_onSigner(this.props.signatories[0].signatoryid);
this._handle_onSigner(signatories[0].signatoryid);
}
}
const { calculations, calculation_id, } = this.props;
let calculation = null;
for(let i in calculations)
@ -45,7 +47,17 @@ export default class Comparison extends React.Component
}
}
this.setState({ calculation : calculation });
const opened = [];
for(let i in current)
{
if(moment(current[i].plandate) >= today)
{
opened.push(current[i].name);
break;
}
}
this.setState({ calculation, opened });
}
componentDidUpdate(prevProps, prevState)
@ -88,7 +100,18 @@ export default class Comparison extends React.Component
_handle_onMixedPayment = (index) =>
{
this.setState({ mixed_index: index });
const opened = [ ...this.state.opened ];
if(opened.indexOf(index) > -1)
{
opened.splice(opened.indexOf(index));
}
else
{
opened.push(index);
}
this.setState({ opened });
}
_handle_onShowPrevious = () =>
@ -96,6 +119,90 @@ export default class Comparison extends React.Component
this.setState({ show_previous: true });
}
_handle_onDownloadPDF = () =>
{
console.log("this.props");
console.log(this.props);
console.log("this.state");
console.log(this.state);
}
_renderMixedPayments = () =>
{
const { calculation, mixed_index, opened, today, show_previous, } = this.state;
const { current, calculated } = this.props;
if(current !== undefined && current !== null && calculated !== undefined && calculated !== null)
{
console.log("_renderMixedPayments", "current.length", current.length, "calculated.length", calculated.length);
if(current.length > calculated.length)
{
return (
<>
{ current.map((payment, index) =>
{
if(!show_previous && moment(payment.plandate) < today) { return null; }
else
{
return (
<div key={ `mixed_${ index }` } className={ `table_row ${ opened.indexOf(payment.name) > -1 && "opened" }` } onClick={ () => this._handle_onMixedPayment(payment.name) }>
<p className="row_title">Платеж { payment.name }</p>
<div className="table_group">
<div className="table_cell">
<div><span>Текущий график</span> { moment(payment.plandate, "YYYY.MM.DD").format("DD.MM.YYYY") }</div>
<div><span>На сумму</span> { numeral(payment.sum).format(' ., ') }&nbsp;</div>
<div><span>Сумма досрочного выкупа</span> { numeral(payment.early_repayment_sum).format(' ., ') }&nbsp;</div>
</div>
<div className="table_cell">
<div><span>Новый график</span> { calculated[index] !== undefined ? moment(calculated[index].plandate, "YYYY.MM.DD").format("DD.MM.YYYY") : (`-`) }</div>
<div><span>На сумму</span> { calculated[index] !== undefined ? (<>{ numeral(calculated[index].sum).format(' ., ') }&nbsp;₽</>) : (`-`) }</div>
<div><span>Сумма досрочного выкупа</span> { calculated[index] !== undefined ? (<>{ numeral(calculated[index].early_repayment_sum).format(' ., ') }&nbsp;₽</>) : (`-`) }</div>
</div>
</div>
</div>
)
}
}) }
</>
)
}
else
{
return (
<>
{ calculated.map((payment, index) =>
{
if(!show_previous && moment(payment.plandate) < today) { return null; }
else
{
return (
<div key={ `mixed_${ index }` } className={ `table_row ${ opened.indexOf(payment.name) > -1 && "opened" }` } onClick={ () => this._handle_onMixedPayment(payment.name) }>
<p className="row_title">Платеж { payment.name }</p>
<div className="table_group">
<div className="table_cell">
<div><span>Текущий график</span> { current[index] !== undefined ? moment(current[index].plandate, "YYYY.MM.DD").format("DD.MM.YYYY") : (`-`) }</div>
<div><span>На сумму</span> { current[index] !== undefined ? (<>{ numeral(current[index].sum).format(' ., ') }&nbsp;₽</>) : (`-`) }</div>
<div><span>Сумма досрочного выкупа</span> { current[index] !== undefined ? (<>{ numeral(current[index].early_repayment_sum).format(' ., ') }&nbsp;₽</>) : (`-`) }</div>
</div>
<div className="table_cell">
<div><span>Новый график</span> { moment(payment.plandate, "YYYY.MM.DD").format("DD.MM.YYYY") }</div>
<div><span>На сумму</span> { numeral(payment.sum).format(' ., ') }&nbsp;</div>
<div><span>Сумма досрочного выкупа</span> { numeral(payment.early_repayment_sum).format(' ., ') }&nbsp;</div>
</div>
</div>
</div>
)
}
}) }
</>
)
}
}
return null;
}
render()
{
const { calculation, mixed_index, today, show_previous, signatories_show_all } = this.state;
@ -108,7 +215,7 @@ export default class Comparison extends React.Component
Выбранный(ые) варианты изменения графика
<a className="interactive" onClick={ this._handle_onOptions }>Вернуться к параметрам изменения графика</a>
</p>
<button className="button button-blue">Скачать PDF</button>
<button className="button button-blue" onClick={ this._handle_onDownloadPDF }>Скачать PDF</button>
</div>
<div className="compare_data">
{ calculation !== undefined && calculation !== null && calculation.fix_last_payment_available_comment !== null && (
@ -181,21 +288,19 @@ export default class Comparison extends React.Component
</button>
</div>
) }
{ current !== undefined &&
current !== null &&
current.map((payment, index) =>
{
if(!show_previous && moment(payment.plandate) < today) { return null; }
return (
<div key={ `current_${ index }` } className="table_row" >
<div>{ payment.name }</div>
<div>{ moment(payment.plandate, "YYYY.MM.DD").format("DD.MM.YYYY") }</div>
<div>{ numeral(payment.sum).format(' ., ') }&nbsp;</div>
<div>{ numeral(payment.early_repayment_sum).format(' ., ') }&nbsp;</div>
</div>
)
})
}
{ current !== undefined && current !== null && current.map((payment, index) =>
{
if(!show_previous && moment(payment.plandate) < today) { return null; }
return (
<div key={ `current_${ index }` } className="table_row" >
<div>{ payment.name }</div>
<div>{ moment(payment.plandate, "YYYY.MM.DD").format("DD.MM.YYYY") }</div>
<div>{ numeral(payment.sum).format(' ., ') }&nbsp;</div>
<div>{ numeral(payment.early_repayment_sum).format(' ., ') }&nbsp;</div>
</div>
)
}) }
</div>
</div>
<div className="compare_table">
@ -218,21 +323,19 @@ export default class Comparison extends React.Component
</button>
</div>
) }
{ calculated !== undefined &&
calculated !== null &&
calculated.map((payment, index) =>
{
if(!show_previous && moment(payment.plandate) < today) { return null; }
return (
<div key={ `current_${ index }` } className="table_row">
<div>{ payment.name }</div>
<div>{ moment(payment.plandate, "YYYY.MM.DD").format("DD.MM.YYYY") }</div>
<div>{ numeral(payment.sum).format(' ., ') }&nbsp;</div>
<div>{ numeral(payment.early_repayment_sum).format(' ., ') } &nbsp;</div>
</div>
)
})
}
{ calculated !== undefined && calculated !== null && calculated.map((payment, index) =>
{
if(!show_previous && moment(payment.plandate) < today) { return null; }
return (
<div key={ `current_${ index }` } className="table_row">
<div>{ payment.name }</div>
<div>{ moment(payment.plandate, "YYYY.MM.DD").format("DD.MM.YYYY") }</div>
<div>{ numeral(payment.sum).format(' ., ') }&nbsp;</div>
<div>{ numeral(payment.early_repayment_sum).format(' ., ') } &nbsp;</div>
</div>
)
}) }
</div>
</div>
<div className="compare_table touchable">
@ -242,32 +345,7 @@ export default class Comparison extends React.Component
Показать прошедшие платежи
</button>
) }
{ current !== undefined &&
current !== null &&
calculated !== undefined &&
calculated !== null &&
current.map((payment, index) =>
{
if(!show_previous && moment(payment.plandate) < today) { return null; }
return (
<div key={ `mixed_${ index }` } className={ `table_row ${ index === mixed_index && "opened" }` } onClick={ () => this._handle_onMixedPayment(index) }>
<p className="row_title">Платеж { payment.name }</p>
<div className="table_group">
<div className="table_cell">
<div><span>Текущий график</span> { moment(payment.plandate, "YYYY.MM.DD").format("DD.MM.YYYY") }</div>
<div><span>На сумму</span> { numeral(payment.sum).format(' ., ') }&nbsp;</div>
<div><span>Сумма досрочного выкупа</span> { numeral(payment.early_repayment_sum).format(' ., ') }&nbsp;</div>
</div>
<div className="table_cell">
<div><span>Новый график</span> { calculated[index] !== undefined ? moment(calculated[index].plandate, "YYYY.MM.DD").format("DD.MM.YYYY") : (`-`) }</div>
<div><span>На сумму</span> { calculated[index] !== undefined ? (<>{ numeral(calculated[index].sum).format(' ., ') }&nbsp;₽</>) : (`-`) }</div>
<div><span>Сумма досрочного выкупа</span> { calculated[index] !== undefined ? (<>{ numeral(calculated[index].early_repayment_sum).format(' ., ') }&nbsp;₽</>) : (`-`) }</div>
</div>
</div>
</div>
)
})
}
{ this._renderMixedPayments() }
</div>
</div>
</div>

View File

@ -15,18 +15,11 @@ export default class InnerMenu extends React.Component
};
}
_handle_onToggleMenu = () =>
{
this.setState({
menuOpened: !this.state.menuOpened,
});
};
componentDidMount()
{
let l = 0;
let m = 0;
const menu = ["payments", "services", "agreement", "documents", "materials","events","change"];
const menu = [ "payments", "services", "agreement", "documents", "materials", "events", "change" ];
for(let i in menu)
{
@ -44,6 +37,13 @@ export default class InnerMenu extends React.Component
this.menuRef.current.scrollLeft = l - 50;
}
_handle_onToggleMenu = () =>
{
this.setState({
menuOpened: !this.state.menuOpened,
});
};
_getActiveLink = (route) =>
{
if (route.indexOf("/payments") > -1) return "График платежей";
@ -60,15 +60,15 @@ export default class InnerMenu extends React.Component
render()
{
const { menuOpened, count_events, count_fines } = this.state;
const { number, status } = this.props;
const { menuOpened, count_events, count_fines } = this.state;
return (
<aside>
<button className="nav_toggle" onClick={this._handle_onToggleMenu}>
{ this.props.router && this._getActiveLink(this.props.router.route) }
<button className="nav_toggle" onClick={ this._handle_onToggleMenu }>
{ this.props.router && this._getActiveLink(this.props.router.asPath) }
</button>
<ul className={menuOpened ? "aside_nav open" : "aside_nav"} ref={ this.menuRef }>
<ul className={ menuOpened ? "aside_nav open" : "aside_nav" } ref={ this.menuRef }>
<li>
<Link href={`/contract/${ number }/payments`} shallow>
<a className={ this.props.router && this.props.router.asPath.indexOf("payments") > -1 ? "active" : "" }>График платежей</a>

View File

@ -54,7 +54,6 @@ class ContractServicesPage extends React.Component
componentDidMount()
{
console.log("document.location.hash", document.location.hash);
const { dispatch, number } = this.props;
if(!this.state.loading && number !== undefined)
@ -144,6 +143,23 @@ class ContractServicesPage extends React.Component
}
_checkInsuranceAvailable = () =>
{
const { insurance, } = this.state;
if(insurance !== undefined && insurance !== null)
{
for(let i in insurance)
{
if(insurance[i].length > 0)
{
return true;
}
}
}
return false;
}
render()
{
const { loading, contracts_info, opened, helpcard, insurance, registration, telematic, } = this.state;
@ -223,121 +239,119 @@ class ContractServicesPage extends React.Component
</p>
<button className="block_toggle"></button>
</div>
<div className="block_body full">
{ insurance !== undefined && insurance !== null ? (
<>
{ insurance.kasko !== undefined && insurance.kasko !== null && insurance.kasko !== "" && insurance.kasko.map !== undefined && insurance.kasko.map((entry, index) => (
<React.Fragment key={ index }>
<div className={ `company ${ entry.period_type === "prolong" && "filled" }` }>
<p className="title">КАСКО</p>
<ul>
{ entry.company && (<li>Страховая компания: <b>{ entry.company }</b></li>) }
{ entry.site && (<li>Сайт: <b>{ entry.site }</b></li>) }
{ entry.phone && (<li>Телефон: <b>{ entry.phone }</b></li>) }
{ entry.number && (
<li>Номер полиса: <DownloadFileById id={ entry.url } filename={ `${ entry.number }.pdf` }>
<b style={ entry.url !== null ? { color: "#1C01A9", cursor: "pointer", } : {} } onClick={ () => { entry.url !== null ? this._handle_onContract(entry.url) : {} } }>{ entry.number }</b>
</DownloadFileById>
</li>
) }
{ entry.period && (<li>Период действия: <b>{ entry.period }</b></li>) }
{ entry.amount && (<li>Страховая сумма: <b style={{ whiteSpace: "nowrap" }}>{ numeral(entry.amount).format(' ., ') }&nbsp;</b></li>) }
</ul>
{ entry.period_type === "prolong" && entry.invoice_url !== null && (
<div className="action">
<DownloadPdfButton id={ entry.invoice_url } filename={ `${ entry.number }.pdf` } title="Скачать счет на оплату" class={ "services_invoice_button" }/>
</div>
{ this._checkInsuranceAvailable() ? (
<div className="block_body full">
{ insurance.kasko !== undefined && insurance.kasko !== null && insurance.kasko !== "" && insurance.kasko.map !== undefined && insurance.kasko.map((entry, index) => (
<React.Fragment key={ index }>
<div className={ `company ${ entry.period_type === "prolong" && "filled" }` }>
<p className="title">КАСКО</p>
<ul>
{ entry.company && (<li>Страховая компания: <b>{ entry.company }</b></li>) }
{ entry.site && (<li>Сайт: <b>{ entry.site }</b></li>) }
{ entry.phone && (<li>Телефон: <b>{ entry.phone }</b></li>) }
{ entry.number && (
<li>Номер полиса: <DownloadFileById id={ entry.url } filename={ `${ entry.number }.pdf` }>
<b style={ entry.url !== null ? { color: "#1C01A9", cursor: "pointer", } : {} } onClick={ () => { entry.url !== null ? this._handle_onContract(entry.url) : {} } }>{ entry.number }</b>
</DownloadFileById>
</li>
) }
</div>
{ entry.description && (<p>{ entry.description }</p>) }
</React.Fragment>
)) }
{ insurance.osago !== undefined && insurance.osago !== null && insurance.osago !== "" && insurance.osago.map !== undefined && insurance.osago.map((entry, index) => (
<React.Fragment key={ index }>
<div className={ `company ${ entry.period_type === "prolong" && "filled" }` }>
<p className="title">ОСАГО</p>
<ul>
{ entry.company && (<li>Страховая компания: <b>{ entry.company }</b></li>) }
{ entry.site && (<li>Сайт: <b>{ entry.site }</b></li>) }
{ entry.phone && (<li>Телефон: <b>{ entry.phone }</b></li>) }
{ entry.number && (
<li>Номер полиса: <DownloadFileById id={ entry.url } filename={ `${ entry.number }.pdf` }>
<b style={ entry.url !== null ? { color: "#1C01A9", cursor: "pointer", } : {} } onClick={ () => { entry.url !== null ? this._handle_onContract(entry.url) : {} } }>{ entry.number }</b>
</DownloadFileById>
</li>
) }
{ entry.period && (<li>Период действия: <b>{ entry.period }</b></li>) }
{ entry.amount && (<li>Страховая сумма: <b style={{ whiteSpace: "nowrap" }}>{ numeral(entry.amount).format(' ., ') }&nbsp;</b></li>) }
{ entry.period_type === "prolong" && (
<li className="alert">Обращаем Ваше внимание, что пролонгация полиса ОСАГО на второй и последующие периоды осуществляется Лизингополучателем самостоятельно</li>
) }
</ul>
{ entry.period_type === "prolong" && entry.invoice_url !== null && (
<div className="action">
<DownloadPdfButton id={ entry.invoice_url } filename={ `${ entry.number }.pdf` } title="Скачать счет на оплату" class={ "services_invoice_button" }/>
</div>
{ entry.period && (<li>Период действия: <b>{ entry.period }</b></li>) }
{ entry.amount && (<li>Страховая сумма: <b style={{ whiteSpace: "nowrap" }}>{ numeral(entry.amount).format(' ., ') }&nbsp;</b></li>) }
</ul>
{ entry.period_type === "prolong" && entry.invoice_url !== null && (
<div className="action">
<DownloadPdfButton id={ entry.invoice_url } filename={ `${ entry.number }.pdf` } title="Скачать счет на оплату" class={ "services_invoice_button" }/>
</div>
) }
</div>
{ entry.description && (<p>{ entry.description }</p>) }
</React.Fragment>
)) }
{ insurance.osago !== undefined && insurance.osago !== null && insurance.osago !== "" && insurance.osago.map !== undefined && insurance.osago.map((entry, index) => (
<React.Fragment key={ index }>
<div className={ `company ${ entry.period_type === "prolong" && "filled" }` }>
<p className="title">ОСАГО</p>
<ul>
{ entry.company && (<li>Страховая компания: <b>{ entry.company }</b></li>) }
{ entry.site && (<li>Сайт: <b>{ entry.site }</b></li>) }
{ entry.phone && (<li>Телефон: <b>{ entry.phone }</b></li>) }
{ entry.number && (
<li>Номер полиса: <DownloadFileById id={ entry.url } filename={ `${ entry.number }.pdf` }>
<b style={ entry.url !== null ? { color: "#1C01A9", cursor: "pointer", } : {} } onClick={ () => { entry.url !== null ? this._handle_onContract(entry.url) : {} } }>{ entry.number }</b>
</DownloadFileById>
</li>
) }
</div>
{ entry.description && (<p>{ entry.description }</p>) }
</React.Fragment>
)) }
{ insurance.nsib !== undefined && insurance.nsib !== null && insurance.nsib !== "" && insurance.nsib.map !== undefined && insurance.nsib.map((entry, index) => (
<React.Fragment key={ index }>
<div className={ `company ${ entry.period_type === "prolong" && "filled" }` }>
<p className="title">НСИБ</p>
<ul>
{ entry.company && (<li>Страховая компания: <b>{ entry.company }</b></li>) }
{ entry.site && (<li>Сайт: <b>{ entry.site }</b></li>) }
{ entry.phone && (<li>Телефон: <b>{ entry.phone }</b></li>) }
{ entry.number && (
<li>Номер полиса: <DownloadFileById id={ entry.url } filename={ `${ entry.number }.pdf` }>
<b style={ entry.url !== null ? { color: "#1C01A9", cursor: "pointer", } : {} } onClick={ () => { entry.url !== null ? this._handle_onContract(entry.url) : {} } }>{ entry.number }</b>
</DownloadFileById>
</li>
) }
{ entry.period && (<li>Период действия: <b>{ entry.period }</b></li>) }
{ entry.amount && (<li>Страховая сумма: <b style={{ whiteSpace: "nowrap" }}>{ numeral(entry.amount).format(' ., ') }&nbsp;</b></li>) }
</ul>
{ entry.period_type === "prolong" && entry.invoice_url !== null && (
<div className="action">
<DownloadPdfButton id={ entry.invoice_url } filename={ `${ entry.number }.pdf` } title="Скачать счет на оплату" class={ "services_invoice_button" }/>
</div>
{ entry.period && (<li>Период действия: <b>{ entry.period }</b></li>) }
{ entry.amount && (<li>Страховая сумма: <b style={{ whiteSpace: "nowrap" }}>{ numeral(entry.amount).format(' ., ') }&nbsp;</b></li>) }
{ entry.period_type === "prolong" && (
<li className="alert">Обращаем Ваше внимание, что пролонгация полиса ОСАГО на второй и последующие периоды осуществляется Лизингополучателем самостоятельно</li>
) }
</div>
{ entry.description && (<p>{ entry.description }</p>) }
</React.Fragment>
)) }
{ insurance.fingap !== undefined && insurance.fingap !== null && insurance.fingap !== "" && insurance.fingap.map !== undefined && insurance.fingap.map((entry, index) => (
<React.Fragment key={ index }>
<div className= { `company ${ entry.period_type === "prolong" && "filled" }` }>
<p className="title">Safe Finance</p>
<ul>
{ entry.company && (<li>Страховая компания: <b>{ entry.company }</b></li>) }
{ entry.site && (<li>Сайт: <b>{ entry.site }</b></li>) }
{ entry.phone && (<li>Телефон: <b>{ entry.phone }</b></li>) }
{ entry.number && (
<li>Номер полиса: <DownloadFileById id={ entry.url } filename={ `${ entry.number }.docx` }>
<b style={ entry.url !== null ? { color: "#1C01A9", cursor: "pointer", } : {} }>{ entry.number }</b>
</DownloadFileById>
</li>
) }
{ entry.period && (<li>Период действия: <b>{ entry.period }</b></li>) }
{ entry.amount && (<li>Страховая сумма: <b style={{ whiteSpace: "nowrap" }}>{ numeral(entry.amount).format(' ., ') }&nbsp;</b></li>) }
</ul>
{ entry.period_type === "prolong" && entry.invoice_url !== null && (
<div className="action">
<DownloadPdfButton id={ entry.invoice_url } filename={ `${ entry.number }.pdf` } title="Скачать счет на оплату" class={ "services_invoice_button" }/>
</div>
</ul>
{ entry.period_type === "prolong" && entry.invoice_url !== null && (
<div className="action">
<DownloadPdfButton id={ entry.invoice_url } filename={ `${ entry.number }.pdf` } title="Скачать счет на оплату" class={ "services_invoice_button" }/>
</div>
) }
</div>
{ entry.description && (<p>{ entry.description }</p>) }
</React.Fragment>
)) }
{ insurance.nsib !== undefined && insurance.nsib !== null && insurance.nsib !== "" && insurance.nsib.map !== undefined && insurance.nsib.map((entry, index) => (
<React.Fragment key={ index }>
<div className={ `company ${ entry.period_type === "prolong" && "filled" }` }>
<p className="title">НСИБ</p>
<ul>
{ entry.company && (<li>Страховая компания: <b>{ entry.company }</b></li>) }
{ entry.site && (<li>Сайт: <b>{ entry.site }</b></li>) }
{ entry.phone && (<li>Телефон: <b>{ entry.phone }</b></li>) }
{ entry.number && (
<li>Номер полиса: <DownloadFileById id={ entry.url } filename={ `${ entry.number }.pdf` }>
<b style={ entry.url !== null ? { color: "#1C01A9", cursor: "pointer", } : {} } onClick={ () => { entry.url !== null ? this._handle_onContract(entry.url) : {} } }>{ entry.number }</b>
</DownloadFileById>
</li>
) }
</div>
{ entry.description && (<p>{ entry.description }</p>) }
</React.Fragment>
)) }
</>
) : (
<div className="block_body"><p>Нет данных</p></div>
) }
</div>
{ entry.period && (<li>Период действия: <b>{ entry.period }</b></li>) }
{ entry.amount && (<li>Страховая сумма: <b style={{ whiteSpace: "nowrap" }}>{ numeral(entry.amount).format(' ., ') }&nbsp;</b></li>) }
</ul>
{ entry.period_type === "prolong" && entry.invoice_url !== null && (
<div className="action">
<DownloadPdfButton id={ entry.invoice_url } filename={ `${ entry.number }.pdf` } title="Скачать счет на оплату" class={ "services_invoice_button" }/>
</div>
) }
</div>
{ entry.description && (<p>{ entry.description }</p>) }
</React.Fragment>
)) }
{ insurance.fingap !== undefined && insurance.fingap !== null && insurance.fingap !== "" && insurance.fingap.map !== undefined && insurance.fingap.map((entry, index) => (
<React.Fragment key={ index }>
<div className= { `company ${ entry.period_type === "prolong" && "filled" }` }>
<p className="title">Safe Finance</p>
<ul>
{ entry.company && (<li>Страховая компания: <b>{ entry.company }</b></li>) }
{ entry.site && (<li>Сайт: <b>{ entry.site }</b></li>) }
{ entry.phone && (<li>Телефон: <b>{ entry.phone }</b></li>) }
{ entry.number && (
<li>Номер полиса: <DownloadFileById id={ entry.url } filename={ `${ entry.number }.docx` }>
<b style={ entry.url !== null ? { color: "#1C01A9", cursor: "pointer", } : {} }>{ entry.number }</b>
</DownloadFileById>
</li>
) }
{ entry.period && (<li>Период действия: <b>{ entry.period }</b></li>) }
{ entry.amount && (<li>Страховая сумма: <b style={{ whiteSpace: "nowrap" }}>{ numeral(entry.amount).format(' ., ') }&nbsp;</b></li>) }
</ul>
{ entry.period_type === "prolong" && entry.invoice_url !== null && (
<div className="action">
<DownloadPdfButton id={ entry.invoice_url } filename={ `${ entry.number }.pdf` } title="Скачать счет на оплату" class={ "services_invoice_button" }/>
</div>
) }
</div>
{ entry.description && (<p>{ entry.description }</p>) }
</React.Fragment>
)) }
</div>
) : (
<div className="block_body"><p>Нет данных</p></div>
) }
</div>
<div className={`dropdown_block ${ opened.indexOf("registration") > -1 ? 'open' : '' }`}>
<div className="block_header" onClick={ () => this._handle_onCard('registration') }>

View File

@ -423,7 +423,7 @@ class AdminPage extends React.Component
return (
<div className="table_row" key={ index }>
<div className="table_cell" data-title="ФИО пользователя">{ entry.name } (Вы)</div>
<div className="table_cell" data-title="Почта">{ entry.email } [{user.email}]</div>
<div className="table_cell" data-title="Почта">{ entry.email }</div>
<div className="table_cell" data-title="Роль">{ entry.is_admin ? "Администратор" : "Пользователь" }</div>
<div className="table_cell" data-title="Доступные организации">Все организации</div>
<div className="table_cell" data-title="Статус">{ entry.is_admin ? "Активен" : entry.last !== null ? "Активен" : "Приглашен" }</div>

View File

@ -12,18 +12,18 @@ export default class InnerMenu extends React.Component
constructor(props)
{
super(props);
this.state = {
menuOpened: false,
};
this.menuRef = React.createRef();
menu.forEach(item =>
{
this[item.id] = React.createRef();
});
}
componentDidMount()
{
let l = 0;
let m = 0;
const menu = [ "phone", "password", "admin" ];
for(let i in menu)
{
@ -41,6 +41,22 @@ export default class InnerMenu extends React.Component
this.menuRef.current.scrollLeft = l - 50;
}
_handle_onToggleMenu = () =>
{
this.setState({
menuOpened: !this.state.menuOpened,
});
};
_getActiveLink = (route) =>
{
if (route.indexOf("/phone") > -1) return "Номер телефона";
if (route.indexOf("/password") > -1) return "Пароль";
if (route.indexOf("/admin") > -1) return "Настройки доступа";
return null;
};
scrollToCategory = id => {
};
@ -48,16 +64,20 @@ export default class InnerMenu extends React.Component
render()
{
const { user, observer } = this.props;
const { menuOpened, } = this.state;
return (
<aside>
<ul className="aside_nav" ref={ this.menuRef }>
<button className="nav_toggle" onClick={ this._handle_onToggleMenu }>
{ this.props.router && this._getActiveLink(this.props.router.asPath) }
</button>
<ul className={ menuOpened ? "aside_nav open" : "aside_nav" } ref={ this.menuRef }>
{ menu.map(item =>
{
if(item.type === "admin" && !observer && !user.is_admin) { return null; }
return (
<li key = {item.id} ref={this[item.id]} onClick={() => this.scrollToCategory(item.id)}>
<li key = {item.id} ref={this[item.id]}>
<Link
href={item.link}
shallow

View File

@ -25,11 +25,11 @@ class InnerMenu extends React.Component
{
let l = 0;
let m = 0;
const menu = ["events","faq"];
const menu = [ "faq", "appeals" ];
for(let i in menu)
{
if(this.props.router.asPath.indexOf(menu[i]) > -1)
if(this.props.router.asPath.indexOf(menu[i].link) > -1)
{
m = i;
}
@ -43,6 +43,21 @@ class InnerMenu extends React.Component
this.menuRef.current.scrollLeft = l - 50;
}
_handle_onToggleMenu = () =>
{
this.setState({
menuOpened: !this.state.menuOpened,
});
};
_getActiveLink = (route) =>
{
if (route.indexOf("/faq") > -1) return "FAQ";
if (route.indexOf("/appeals") > -1) return "Мои обращения";
return null;
};
_handle_onNewAppeal = () =>
{
this.props.router.push('/support/request/');
@ -50,13 +65,15 @@ class InnerMenu extends React.Component
render()
{
const { appeals } = this.state;
const { menuOpened, appeals } = this.state;
const { number } = this.props;
return (
<aside className="flex">
<button className="nav_toggle">Меню</button>
<ul className="aside_nav" ref={ this.menuRef }>
<button className="nav_toggle" onClick={ this._handle_onToggleMenu }>
{ this.props.router && this._getActiveLink(this.props.router.asPath) }
</button>
<ul className={ menuOpened ? "aside_nav open" : "aside_nav" } ref={ this.menuRef }>
<li>
<Link href={`/support/faq`} shallow>
<a className={ this.props.router && this.props.router.asPath.indexOf("faq") > -1 ? "active" : "" }>FAQ</a></Link>

View File

@ -19,7 +19,7 @@ export default class SuccessMessage extends React.Component
<div className="compare_message">
<p>{ comment }</p>
<br/>
<p>Сообщение успешно отправлено, ожидайте, пожалуйста, ответа от ответсвенного сотрудника Отдела <br/>по работе с клиентами.<br/><br/><Link href={`/support/appeals`}>Перейти к списку обращений</Link></p>
<p>Сообщение успешно отправлено, ожидайте, пожалуйста, ответа от ответственного сотрудника Службы клиентского сервиса.<br/><br/>После обработки обращение появится<br/> в <Link href={`/support/appeals`}>списке обращений</Link>.</p>
</div>
</article>
);