From c1d94572720c3b0dbad9dfa824862c9494271880 Mon Sep 17 00:00:00 2001 From: merelendor Date: Fri, 2 Sep 2022 17:43:29 +0300 Subject: [PATCH] hotfix for graphic changes menu link --- css/main/style.css | 8 ++++ css/main/style.less | 9 +++- pages/components/DownloadPdfButton/index.js | 4 +- pages/contract/change/index.js | 52 ++++++++++----------- pages/contract/materials.js | 2 +- pages/contract/services.js | 8 ++-- 6 files changed, 49 insertions(+), 34 deletions(-) diff --git a/css/main/style.css b/css/main/style.css index c7dd28e..49f9e61 100644 --- a/css/main/style.css +++ b/css/main/style.css @@ -4924,3 +4924,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; + } +} diff --git a/css/main/style.less b/css/main/style.less index ccb6845..fa1c5d6 100644 --- a/css/main/style.less +++ b/css/main/style.less @@ -5585,4 +5585,11 @@ main .dropdown_blocks_list .dropdown_block .block_body { } } - \ No newline at end of file +.services_invoice_button +{ + min-width: 220px; + + @media all and (max-width: 1600px) { + min-width: 195px; + } +} \ No newline at end of file diff --git a/pages/components/DownloadPdfButton/index.js b/pages/components/DownloadPdfButton/index.js index cf6dddc..5c9771a 100644 --- a/pages/components/DownloadPdfButton/index.js +++ b/pages/components/DownloadPdfButton/index.js @@ -45,9 +45,9 @@ export default class DownloadPdfButton extends React.Component const s = this.props.style !== undefined ? this.props.style : {}; return ( - { (bitrix && url === null) || (!bitrix && id === null) ? {} : this._handle_onDownloadFile() }}> + { (bitrix && url === null) || (!bitrix && id === null) ? {} : this._handle_onDownloadFile() }}> { downloading ? ( - + ) : title !== undefined ? title : "Скачать" } ) diff --git a/pages/contract/change/index.js b/pages/contract/change/index.js index 71270b7..a9c84f4 100644 --- a/pages/contract/change/index.js +++ b/pages/contract/change/index.js @@ -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 ( @@ -291,7 +292,7 @@ class ChangeGraphicPage extends React.Component { loading ? (
- +
@@ -326,7 +327,7 @@ class ChangeGraphicPage extends React.Component ) : (
- +
{ mode_options ? ( { document.description } ) }

- +
)) }
diff --git a/pages/contract/services.js b/pages/contract/services.js index 2499fc7..afb09b1 100644 --- a/pages/contract/services.js +++ b/pages/contract/services.js @@ -245,7 +245,7 @@ class ContractServicesPage extends React.Component { entry.period_type === "prolong" && entry.invoice_url !== null && (
- +
) }
@@ -274,7 +274,7 @@ class ContractServicesPage extends React.Component { entry.period_type === "prolong" && entry.invoice_url !== null && (
- +
) } @@ -300,7 +300,7 @@ class ContractServicesPage extends React.Component { entry.period_type === "prolong" && entry.invoice_url !== null && (
- +
) } @@ -326,7 +326,7 @@ class ContractServicesPage extends React.Component { entry.period_type === "prolong" && entry.invoice_url !== null && (
- +
) }