Merge branch 'master' of https://github.com/merelendor/evoleasing-account
Conflicts: css/main/style.less
This commit is contained in:
commit
afd8bdbc75
@ -4927,3 +4927,11 @@ main .dropdown_blocks_list.zero-margin.gibdd .dropdown_block .block_body .fines_
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
}
|
||||
.services_invoice_button {
|
||||
min-width: 220px;
|
||||
}
|
||||
@media all and (max-width: 1600px) {
|
||||
.services_invoice_button {
|
||||
min-width: 195px;
|
||||
}
|
||||
}
|
||||
|
||||
@ -5585,3 +5585,12 @@ main .dropdown_blocks_list .dropdown_block .block_body {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.services_invoice_button
|
||||
{
|
||||
min-width: 220px;
|
||||
|
||||
@media all and (max-width: 1600px) {
|
||||
min-width: 195px;
|
||||
}
|
||||
}
|
||||
@ -45,9 +45,9 @@ export default class DownloadPdfButton extends React.Component
|
||||
|
||||
const s = this.props.style !== undefined ? this.props.style : {};
|
||||
return (
|
||||
<a style={{ ...{ cursor: "pointer", opacity: (bitrix && url === null) || (!bitrix && id === null) ? 0.5 : 1.0 }, ...s }} className="button button-blue" onClick={ () => { (bitrix && url === null) || (!bitrix && id === null) ? {} : this._handle_onDownloadFile() }}>
|
||||
<a style={{ ...{ cursor: "pointer", opacity: (bitrix && url === null) || (!bitrix && id === null) ? 0.5 : 1.0 }, ...s }} className={`button button-blue ${ this.props.class !== undefined ? this.props.class : "" }`} onClick={ () => { (bitrix && url === null) || (!bitrix && id === null) ? {} : this._handle_onDownloadFile() }}>
|
||||
{ downloading ? (
|
||||
<SpinnerCircular size={24} thickness={100} speed={100} color="rgba(255, 255, 255, 1)" secondaryColor="rgba(255, 255, 255, 0.5)" />
|
||||
<SpinnerCircular size={24} thickness={ 100 } speed={ 100 } color="rgba(255, 255, 255, 1)" secondaryColor="rgba(255, 255, 255, 0.5)" />
|
||||
) : title !== undefined ? title : "Скачать" }
|
||||
</a>
|
||||
)
|
||||
|
||||
@ -42,9 +42,8 @@ class ChangeGraphicPage extends React.Component
|
||||
{
|
||||
super(props);
|
||||
this.state = {
|
||||
date: null,
|
||||
car: null,
|
||||
loading: false,
|
||||
contracts_info: {},
|
||||
mode_options: false,
|
||||
mode_comparison: false,
|
||||
mode_calculation: false,
|
||||
@ -79,8 +78,7 @@ class ChangeGraphicPage extends React.Component
|
||||
{
|
||||
console.log("getDerivedStateFromProps", nextProps);
|
||||
return {
|
||||
date: nextProps.date,
|
||||
car: nextProps.car,
|
||||
contracts_info: nextProps.contracts_info,
|
||||
signatories: nextProps.signatories,
|
||||
calculations: nextProps.calculations,
|
||||
variants: nextProps.variants,
|
||||
@ -92,13 +90,18 @@ class ChangeGraphicPage extends React.Component
|
||||
|
||||
componentDidMount()
|
||||
{
|
||||
const { dispatch, number } = this.props;
|
||||
|
||||
if(document.location.hash !== undefined && document.location.hash !== null && document.location.hash !== "")
|
||||
{
|
||||
if (!this.state.loading && this.props.number !== undefined)
|
||||
if (!this.state.loading && number !== undefined)
|
||||
{
|
||||
this.setState({ loading: true }, () =>
|
||||
{
|
||||
const { dispatch, number } = this.props;
|
||||
if(this.state.contracts_info[ number ] === undefined)
|
||||
{
|
||||
getContractInfo({ dispatch, number });
|
||||
}
|
||||
|
||||
Promise.all([
|
||||
getContractGraphicChangeCalculationsList({ dispatch, number }),
|
||||
@ -115,25 +118,19 @@ class ChangeGraphicPage extends React.Component
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!this.state.loading && this.props.number !== undefined)
|
||||
if (!this.state.loading && number !== undefined)
|
||||
{
|
||||
this.setState({ loading: true }, () =>
|
||||
{
|
||||
getContractInfo({
|
||||
dispatch: this.props.dispatch,
|
||||
number: this.props.number,
|
||||
})
|
||||
.then((info) =>
|
||||
if(this.state.contracts_info[ number ] === undefined)
|
||||
{
|
||||
getContractGraphicChange({
|
||||
dispatch: this.props.dispatch,
|
||||
number: this.props.number,
|
||||
})
|
||||
.then(() =>
|
||||
{
|
||||
this.setState({ loading: false });
|
||||
})
|
||||
.catch(() => {});
|
||||
getContractInfo({ dispatch, number });
|
||||
}
|
||||
|
||||
getContractGraphicChange({ dispatch, number, })
|
||||
.then(() =>
|
||||
{
|
||||
this.setState({ loading: false });
|
||||
})
|
||||
.catch(() => {});
|
||||
});
|
||||
@ -272,8 +269,12 @@ class ChangeGraphicPage extends React.Component
|
||||
|
||||
render()
|
||||
{
|
||||
const { loading, mode_options, mode_comparison, mode_calculation, mode_final, date, car, signer, signatories, calculations, calculation_id, editable, variants, variants_loading, variants_selected, variants_types, variants_unavailable, options, current, calculated, comment } = this.state;
|
||||
const { number } = this.props;
|
||||
const { loading, contracts_info, mode_options, mode_comparison, mode_calculation, mode_final, signer, signatories, calculations, calculation_id, editable, variants, variants_loading, variants_selected, variants_types, variants_unavailable, options, current, calculated, comment } = this.state;
|
||||
|
||||
let { date, car, status } = contracts_info[ number ] !== undefined ? contracts_info[ number ] : {};
|
||||
|
||||
console.log("contracts_info", contracts_info);
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
@ -291,7 +292,7 @@ class ChangeGraphicPage extends React.Component
|
||||
</div>
|
||||
{ loading ? (
|
||||
<div className="aside_container about">
|
||||
<InnerMenu number={ number } { ...this.props } />
|
||||
<InnerMenu number={ number } status={ status } { ...this.props } />
|
||||
<article className="changes">
|
||||
<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)" />
|
||||
@ -326,7 +327,7 @@ class ChangeGraphicPage extends React.Component
|
||||
</>
|
||||
) : (
|
||||
<div className="aside_container about">
|
||||
<InnerMenu number={ number } { ...this.props } />
|
||||
<InnerMenu number={ number } status={ status } { ...this.props } />
|
||||
<article className="changes">
|
||||
{ mode_options ? (
|
||||
<Options
|
||||
@ -395,8 +396,7 @@ class ChangeGraphicPage extends React.Component
|
||||
function mapStateToProps(state, ownProps)
|
||||
{
|
||||
return {
|
||||
date: state.contract.date,
|
||||
car: state.contract.car,
|
||||
contracts_info: state.contracts_info,
|
||||
signatories: state.contract.change.signatories,
|
||||
calculations: state.contract.change.calculations,
|
||||
variants: state.contract.change.variants,
|
||||
|
||||
@ -103,7 +103,7 @@ class ContractPage extends React.Component
|
||||
<span style={{ width: "100%"}}>{ document.description }</span>
|
||||
) }
|
||||
</p>
|
||||
<DownloadPdfButton url={ `${ process.env.NEXT_PUBLIC_MAIN_SITE }${ document.url }` } filename={ `${ document.filename }.pdf` } bitrix={ true }/>
|
||||
<DownloadPdfButton url={ `${ process.env.NEXT_PUBLIC_MAIN_SITE }${ document.url }` } filename={ `${ document.filename }.pdf` } bitrix={ true } />
|
||||
</div>
|
||||
)) }
|
||||
</div>
|
||||
|
||||
@ -245,7 +245,7 @@ class ContractServicesPage extends React.Component
|
||||
</ul>
|
||||
{ entry.period_type === "prolong" && entry.invoice_url !== null && (
|
||||
<div className="action">
|
||||
<DownloadPdfButton id={ entry.invoice_url } filename={ `${ entry.number }.pdf` } title="Скачать счет на оплату" style={{ width: "195px" }}/>
|
||||
<DownloadPdfButton id={ entry.invoice_url } filename={ `${ entry.number }.pdf` } title="Скачать счет на оплату" class={ "services_invoice_button" }/>
|
||||
</div>
|
||||
) }
|
||||
</div>
|
||||
@ -274,7 +274,7 @@ class ContractServicesPage extends React.Component
|
||||
</ul>
|
||||
{ entry.period_type === "prolong" && entry.invoice_url !== null && (
|
||||
<div className="action">
|
||||
<DownloadPdfButton id={ entry.invoice_url } filename={ `${ entry.number }.pdf` } title="Скачать счет на оплату" style={{ width: "195px" }}/>
|
||||
<DownloadPdfButton id={ entry.invoice_url } filename={ `${ entry.number }.pdf` } title="Скачать счет на оплату" class={ "services_invoice_button" }/>
|
||||
</div>
|
||||
) }
|
||||
</div>
|
||||
@ -300,7 +300,7 @@ class ContractServicesPage extends React.Component
|
||||
</ul>
|
||||
{ entry.period_type === "prolong" && entry.invoice_url !== null && (
|
||||
<div className="action">
|
||||
<DownloadPdfButton id={ entry.invoice_url } filename={ `${ entry.number }.pdf` } title="Скачать счет на оплату" style={{ width: "195px" }}/>
|
||||
<DownloadPdfButton id={ entry.invoice_url } filename={ `${ entry.number }.pdf` } title="Скачать счет на оплату" class={ "services_invoice_button" }/>
|
||||
</div>
|
||||
) }
|
||||
</div>
|
||||
@ -326,7 +326,7 @@ class ContractServicesPage extends React.Component
|
||||
</ul>
|
||||
{ entry.period_type === "prolong" && entry.invoice_url !== null && (
|
||||
<div className="action">
|
||||
<DownloadPdfButton id={ entry.invoice_url } filename={ `${ entry.number }.pdf` } title="Скачать счет на оплату" style={{ width: "195px" }}/>
|
||||
<DownloadPdfButton id={ entry.invoice_url } filename={ `${ entry.number }.pdf` } title="Скачать счет на оплату" class={ "services_invoice_button" }/>
|
||||
</div>
|
||||
) }
|
||||
</div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user