-
-
Номер договора
-
Дата договора
-
Автомобиль
-
Гос.номер / VIN
-
Статус
-
Следующий платеж
-
Дополнительные услуги
-
- { contracts !== undefined && contracts !== null && (
- <>
- {contracts.length > 0 ? ( contracts.map((contract, index) => (
-
-
-
-
{ moment(contract.date).format("DD.MM.YYYY") }
-
- { contract.car?.brand?.name } { contract.car?.model?.name }
-
-
- { contract.car?.reg_number !== null ? contract.car?.reg_number : "Без рег. номера" }
- { contract.car?.vin_number }
-
-
-
{contract.status}
- { contract.debt_leasing !== undefined && contract.debt_leasing !== null && parseFloat(contract.debt_leasing) > 0 && (
-
- Задолжность:
- {numeral(contract.debt_leasing).format(" ., ")} ₽
-
- ) }
- { contract.debt_penalty_fee !== undefined && contract.debt_penalty_fee !== null && parseFloat(contract.debt_penalty_fee) > 0 && (
-
- Пени:
- {numeral(contract.debt_penalty_fee).format(" ., ")} ₽
-
- ) }
-
-
- { contract.current_payment_date !== null ? (
- <>
- {moment(contract.current_payment_date).format("DD.MM.YYYY")}
-
- {numeral(contract.current_payment_amount).format(" ., ")} ₽
-
- >
- ) : ( "-" ) }
-
-
-
- { contract.telematics_exists && (
- {
- event.stopPropagation()
- event.preventDefault()
- this._handle_onService(`/contract/${contract.number}/services#telematic`)
- }}
- />
- ) }
- { contract.rat_exists && (
- {
- event.stopPropagation()
- event.preventDefault()
- this._handle_onService(`/contract/${contract.number}/services#ratcard`)
- }}
- />
- ) }
- { contract.gibddreg_exists && (
- {
- event.stopPropagation()
- event.preventDefault()
- this._handle_onService(`/contract/${contract.number}/services#registration`)
- }}
- />
- ) }
- { contract.fuelcard_exists && (
- {
- event.stopPropagation()
- event.preventDefault()
- this._handle_onService(`/contract/${contract.number}/services#fuelcards`)
- }}
- />
- ) }
- {contract.kasko_exists && (
- {
- event.stopPropagation()
- event.preventDefault()
- this._handle_onService(`/contract/${contract.number}/services#insurance`)
- }}
- />
- ) }
- { contract.osago_exists && (
- {
- event.stopPropagation()
- event.preventDefault()
- this._handle_onService(`/contract/${contract.number}/services#insurance`)
- }}
- />
- ) }
- { contract.nsib_exists && (
- {
- event.stopPropagation()
- event.preventDefault()
- this._handle_onService(`/contract/${contract.number}/services#insurance`)
- }}
- />
- ) }
- { contract.fingap_exists && (
- {
- event.stopPropagation()
- event.preventDefault()
- this._handle_onService(`/contract/${contract.number}/services#insurance`)
- }}
- />
- ) }
-
-
+
+ {
+ this._handle_onChange_search(event.target.value)
+ }}
+ />
-
- ))
+
+ {/*
+ this.setState({ date_from_type: "date" }) } onBlur={ () => { this.setState({ date_from_type: "text" }) } } onChange={ (date) => {
+ this._handle_onChange_date_from(date);
+ } }/>
+
+ */}
+ this.setState({ date_from: date })}
+ />
+
+
+ {/* this.setState({ date_from_type: "date" }) } onBlur={ () => { this.setState({ date_from_type: "text" }) } } onChange={ (date) => {
+ this._handle_onChange_date_to(date);
+ } }/>
+ */}
+ this.setState({ date_to: date })}
+ />
+
+
+
+
+ >
+ ) }
+ { loading ? (
+
+
+
+ ) : (
+
+ { contracts === null || contracts.length === 0 ? (
+ this._renderQuestionnaireStatus()
) : (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
Номер договора
+
Дата договора
+
Автомобиль
+
Гос.номер / VIN
+
Статус
+
Следующий платеж
+
Дополнительные услуги
+
+ { contracts !== undefined && contracts !== null && (
+ <>
+ {contracts.length > 0 ? ( contracts.map((contract, index) => (
+
+
+
+
{ moment(contract.date).format("DD.MM.YYYY") }
+
+ { contract.car?.brand?.name } { contract.car?.model?.name }
+
+
+ { contract.car?.reg_number !== null ? contract.car?.reg_number : "Без рег. номера" }
+ { contract.car?.vin_number }
+
+
+
{contract.status}
+ { contract.debt_leasing !== undefined && contract.debt_leasing !== null && parseFloat(contract.debt_leasing) > 0 && (
+
+ Задолжность:
+ {numeral(contract.debt_leasing).format(" ., ")} ₽
+
+ ) }
+ { contract.debt_penalty_fee !== undefined && contract.debt_penalty_fee !== null && parseFloat(contract.debt_penalty_fee) > 0 && (
+
+ Пени:
+ {numeral(contract.debt_penalty_fee).format(" ., ")} ₽
+
+ ) }
+
+
+ { contract.current_payment_date !== null ? (
+ <>
+ {moment(contract.current_payment_date).format("DD.MM.YYYY")}
+
+ {numeral(contract.current_payment_amount).format(" ., ")} ₽
+
+ >
+ ) : ( "-" ) }
+
+
+
+ { contract.telematics_exists && (
+ {
+ event.stopPropagation()
+ event.preventDefault()
+ this._handle_onService(`/contract/${contract.number}/services#telematic`)
+ }}
+ />
+ ) }
+ { contract.rat_exists && (
+ {
+ event.stopPropagation()
+ event.preventDefault()
+ this._handle_onService(`/contract/${contract.number}/services#ratcard`)
+ }}
+ />
+ ) }
+ { contract.gibddreg_exists && (
+ {
+ event.stopPropagation()
+ event.preventDefault()
+ this._handle_onService(`/contract/${contract.number}/services#registration`)
+ }}
+ />
+ ) }
+ { contract.fuelcard_exists && (
+ {
+ event.stopPropagation()
+ event.preventDefault()
+ this._handle_onService(`/contract/${contract.number}/services#fuelcards`)
+ }}
+ />
+ ) }
+ {contract.kasko_exists && (
+ {
+ event.stopPropagation()
+ event.preventDefault()
+ this._handle_onService(`/contract/${contract.number}/services#insurance`)
+ }}
+ />
+ ) }
+ { contract.osago_exists && (
+ {
+ event.stopPropagation()
+ event.preventDefault()
+ this._handle_onService(`/contract/${contract.number}/services#insurance`)
+ }}
+ />
+ ) }
+ { contract.nsib_exists && (
+ {
+ event.stopPropagation()
+ event.preventDefault()
+ this._handle_onService(`/contract/${contract.number}/services#insurance`)
+ }}
+ />
+ ) }
+ { contract.fingap_exists && (
+ {
+ event.stopPropagation()
+ event.preventDefault()
+ this._handle_onService(`/contract/${contract.number}/services#insurance`)
+ }}
+ />
+ ) }
+
+
+
+
+ ))
+ ) : (
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+ )}
+ >
+ )}
)}
- >
- )}
-
- )}
-
- )}
- {!all && (
-
- )}
+
+ ) }
+ { !all && (
+
+ ) }
@@ -557,29 +555,37 @@ function mapStateToProps(state, ownProps)
}
}
-export const getServerSideProps = reduxWrapper.getServerSideProps((store) => async ({ req, res, query }) => {
- let props = {}
+export const getServerSideProps = reduxWrapper.getServerSideProps((store) => async ({ req, res, query }) =>
+{
+ let props = {}
- if (req.headers.cookie !== undefined) {
- const cookies = cookie.parse(req.headers?.cookie ? req.headers?.cookie : "")
+ if (req.headers.cookie !== undefined)
+ {
+ const cookies = cookie.parse(req.headers?.cookie ? req.headers?.cookie : "")
- if (cookies.jwt === undefined || cookies.jwt === null) {
- res.statusCode = 302
- res.setHeader("Location", `/login`)
- } else {
- //const tokenValid = await checkToken(cookies.jwt);
- const tokenValid = true
- if (!tokenValid) {
- res.statusCode = 302
- res.setHeader("Location", `/login`)
- }
- }
- } else {
- res.statusCode = 302
- res.setHeader("Location", `/login`)
- }
+ if (cookies.jwt === undefined || cookies.jwt === null)
+ {
+ res.statusCode = 302
+ res.setHeader("Location", `/login`)
+ }
+ else
+ {
+ //const tokenValid = await checkToken(cookies.jwt);
+ const tokenValid = true
+ if (!tokenValid)
+ {
+ res.statusCode = 302
+ res.setHeader("Location", `/login`)
+ }
+ }
+ }
+ else
+ {
+ res.statusCode = 302
+ res.setHeader("Location", `/login`)
+ }
- return { props: props }
+ return { props: props }
})
-export default withRouter(connect(mapStateToProps)(IndexPage))
+export default withRouter(connect(mapStateToProps)(IndexPage))
\ No newline at end of file
diff --git a/pages/support/request.js b/pages/support/request.js
index 64b316a..5f8b683 100644
--- a/pages/support/request.js
+++ b/pages/support/request.js
@@ -17,6 +17,7 @@ import InnerMenu from "./components/InnerMenu";
import SuccessMessage from "./components/SuccessMessage";
import AccountLayout from "../components/Layout/Account";
import TemplateFile from "./components/TemplateFile";
+import FileDropzone from "../../components/FileDropzone";
import {
getSupportThemes,
@@ -26,59 +27,6 @@ import {
sendAppealAttachments
} from "../../actions";
-const LIMIT = 10000000;
-const LIMIT_FILES = 10;
-
-class FileDropzone extends React.Component
-{
- constructor(props)
- {
- super(props);
- this.state = {};
- }
-
- render()
- {
- const { files, onAddFile, onDeleteFile } = this.props;
-
- return (
- <>
- { files.length > 0 && (
-
-
-
Приложенные файлы ({ files.length }/{ LIMIT_FILES })
- { files.map((file, index) => (
-
{ file.size > LIMIT && (Ошибка, превышен допустимый размер файла в 10 мб.) } { file.name } - { parseFloat(file.size / 1000000).toFixed(file.size < 100000 ? 3 : 2) } мб. onDeleteFile(file.name) }>[ удалить ]
- )) }
-
-
- ) }
-
-
-
Вы можете приложить до 10 файлов, максимальный размер одного файла: 10 мегабайт.
-
-
- { files.length < LIMIT_FILES && (
-
onAddFile(acceptedFiles) } maxFiles={ LIMIT_FILES }>
- { ({getRootProps, getInputProps}) => (
-
-
-
-
- Перенесите файлы на экран для быстрой загрузки или выберите файл с компьютера
-
-
-
-
-
- ) }
-
- ) }
- >
- )
- }
-}
-
class SupportRequestPage extends React.Component
{
constructor(props) {
diff --git a/public/assets/images/status/1_off.svg b/public/assets/images/status/1_off.svg
new file mode 100644
index 0000000..d34c1f7
--- /dev/null
+++ b/public/assets/images/status/1_off.svg
@@ -0,0 +1,59 @@
+
diff --git a/public/assets/images/status/1_on.svg b/public/assets/images/status/1_on.svg
new file mode 100644
index 0000000..234fd2a
--- /dev/null
+++ b/public/assets/images/status/1_on.svg
@@ -0,0 +1,59 @@
+
diff --git a/public/assets/images/status/2_off.svg b/public/assets/images/status/2_off.svg
new file mode 100644
index 0000000..2766ee9
--- /dev/null
+++ b/public/assets/images/status/2_off.svg
@@ -0,0 +1,91 @@
+
diff --git a/public/assets/images/status/2_on.svg b/public/assets/images/status/2_on.svg
new file mode 100644
index 0000000..584ef58
--- /dev/null
+++ b/public/assets/images/status/2_on.svg
@@ -0,0 +1,91 @@
+
diff --git a/public/assets/images/status/3_off.svg b/public/assets/images/status/3_off.svg
new file mode 100644
index 0000000..caaceaa
--- /dev/null
+++ b/public/assets/images/status/3_off.svg
@@ -0,0 +1,111 @@
+
diff --git a/public/assets/images/status/3_on.svg b/public/assets/images/status/3_on.svg
new file mode 100644
index 0000000..2ef30d6
--- /dev/null
+++ b/public/assets/images/status/3_on.svg
@@ -0,0 +1,111 @@
+
diff --git a/public/assets/images/status/4_off.svg b/public/assets/images/status/4_off.svg
new file mode 100644
index 0000000..43f8874
--- /dev/null
+++ b/public/assets/images/status/4_off.svg
@@ -0,0 +1,31 @@
+
diff --git a/public/assets/images/status/4_on.svg b/public/assets/images/status/4_on.svg
new file mode 100644
index 0000000..1d50238
--- /dev/null
+++ b/public/assets/images/status/4_on.svg
@@ -0,0 +1,31 @@
+
diff --git a/public/assets/images/status/5_off.svg b/public/assets/images/status/5_off.svg
new file mode 100644
index 0000000..e99366a
--- /dev/null
+++ b/public/assets/images/status/5_off.svg
@@ -0,0 +1,25 @@
+
diff --git a/public/assets/images/status/5_on.svg b/public/assets/images/status/5_on.svg
new file mode 100644
index 0000000..8313336
--- /dev/null
+++ b/public/assets/images/status/5_on.svg
@@ -0,0 +1,25 @@
+
diff --git a/public/assets/images/status/6_off.svg b/public/assets/images/status/6_off.svg
new file mode 100644
index 0000000..af4f1bc
--- /dev/null
+++ b/public/assets/images/status/6_off.svg
@@ -0,0 +1,12 @@
+
diff --git a/public/assets/images/status/6_on.svg b/public/assets/images/status/6_on.svg
new file mode 100644
index 0000000..886799b
--- /dev/null
+++ b/public/assets/images/status/6_on.svg
@@ -0,0 +1,12 @@
+
diff --git a/public/assets/images/status/7_off.svg b/public/assets/images/status/7_off.svg
new file mode 100644
index 0000000..4b34bd5
--- /dev/null
+++ b/public/assets/images/status/7_off.svg
@@ -0,0 +1,26 @@
+
diff --git a/public/assets/images/status/7_on.svg b/public/assets/images/status/7_on.svg
new file mode 100644
index 0000000..ac415b0
--- /dev/null
+++ b/public/assets/images/status/7_on.svg
@@ -0,0 +1,26 @@
+
diff --git a/reducers/dealsReducer.js b/reducers/dealsReducer.js
index 5c8ab7c..e03a337 100644
--- a/reducers/dealsReducer.js
+++ b/reducers/dealsReducer.js
@@ -39,25 +39,38 @@ const dealsReducer = (state = initialState.deals, action) =>
case actionTypes.DEAL_OFFERS_LIST:
{
+ console.log("ACTION", actionTypes.DEAL_OFFERS_LIST, { action });
+
+ const details = state.details;
+ details[action.data.deal_id] = { ...details[action.data.deal_id], ...{ offers: action.data.list } };
+
return {
...state,
- deal: { ...state.deal, ...{ offers: action.data.offers, } },
+ details: details,
};
}
case actionTypes.DEAL_DOCUMENTS_LIST:
{
+ console.log("ACTION", actionTypes.DEAL_DOCUMENTS_LIST, { action });
+
+ const details = state.details;
+ details[action.data.deal_id] = { ...details[action.data.deal_id], ...{ documents: action.data.list } };
+
return {
...state,
- deal: { ...state.deal, ...{ documents: action.data.documents, } },
+ details: details,
};
}
case actionTypes.DEAL_CONTRACTS_LIST:
{
+ const details = state.details;
+ details[action.data.deal_id] = { ...details[action.data.deal_id], ...{ contracts: action.data.list } };
+
return {
...state,
- deal: { ...state.deal, ...{ contracts: action.data.contracts, } },
+ details: details,
};
}
diff --git a/reducers/initialState.js b/reducers/initialState.js
index d9035ad..ae24348 100644
--- a/reducers/initialState.js
+++ b/reducers/initialState.js
@@ -236,7 +236,8 @@ export const defaultState = {
{
loaded: false,
list: null,
- deal: {
+ details: {},
+ /*{
loaded: false,
offers: {
list: null,
@@ -249,6 +250,7 @@ export const defaultState = {
list: null,
},
},
+ */
},
};