Conflicts:
	css/main/style.css
This commit is contained in:
merelendor 2022-08-30 01:47:51 +03:00
commit f0a9783e76
29 changed files with 420 additions and 379 deletions

View File

@ -155,6 +155,7 @@ export const logout = ({ dispatch }) =>
dispatch({ type: actionTypes.AUTH, data: { logged: false, observer: false } });
dispatch({ type: actionTypes.USER, data: {} });
dispatch({ type: actionTypes.COMPANY, data: {} });
dispatch({ type: actionTypes.CONTRACTS_INFO_RESET, data: {} });
resolve();
Router.push('/');

View File

@ -74,6 +74,11 @@ export const getContractInfo = ({ dispatch, number, }) =>
const info = { date: response.data.dl_date, car: response.data.car };
dispatch({ type: actionTypes.CONTRACT_INFO, data: info });
const contract = {};
contract[`${ number }`] = info;
dispatch({ type: actionTypes.CONTRACTS_INFO, data: contract });
resolve(info);
})
.catch((error) =>
@ -298,16 +303,6 @@ export const getContractDocuments = ({ dispatch, number, }) =>
documents.billfines = rows;
pr();
});
}), new Promise((pr) =>
{
let query = nSQL(response.data.fines).query("select");
query = query.orderBy({ date: "desc" });
query.exec().then((rows) =>
{
documents.fines = rows;
pr();
});
})])
.then(() =>
{
@ -325,6 +320,45 @@ export const getContractDocuments = ({ dispatch, number, }) =>
});
}
export const getContractFines = ({ dispatch, number, }) =>
{
console.log("ACTION", "getContractFines");
return new Promise((resolve, reject) =>
{
axios.post(`${ process.env.NEXT_PUBLIC_SELF_API_HOST }/api/contract/fines`, {
number: number
},
{
withCredentials: true,
})
.then(async (response) =>
{
console.log("ACTION", "getContractFines", "response.data", response.data);
let fines = [];
let query = nSQL(response.data.fines).query("select");
query = query.orderBy({ date: "desc" });
query.exec().then((rows) =>
{
fines = rows;
console.log("fines");
console.log(fines);
dispatch({ type: actionTypes.CONTRACT_FINES, data: { fines: fines } });
resolve();
});
})
.catch((error) =>
{
console.error(error);
reject();
});
});
}
export const getContractRules = ({ dispatch, date, }) =>
{
return new Promise((resolve, reject) =>

View File

@ -4,6 +4,8 @@ export const COMPANY = 'COMPANY';
export const COMPANIES = 'COMPANIES';
export const ADMIN = 'ADMIN';
export const CONTRACTS = 'CONTRACTS';
export const CONTRACTS_INFO = 'CONTRACTS_INFO';
export const CONTRACTS_INFO_RESET = 'CONTRACTS_INFO_RESET';
export const CONTRACT = 'CONTRACT';
export const CONTRACT_PAYMENTS = 'CONTRACT_PAYMENTS';
export const CONTRACT_INFO = 'CONTRACT_INFO';
@ -13,6 +15,7 @@ export const CONTRACT_REGISTRATION = 'CONTRACT_REGISTRATION';
export const CONTRACT_TELEMATIC = 'CONTRACT_TELEMATIC';
export const CONTRACT_AGREEMENT = 'CONTRACT_AGREEMENT';
export const CONTRACT_DOCUMENTS = 'CONTRACT_DOCUMENTS';
export const CONTRACT_FINES = 'CONTRACT_FINES';
export const CONTRACT_RULES = 'CONTRACT_RULES';
export const CONTRACT_MATERIALS = 'CONTRACT_MATERIALS';

View File

@ -1,6 +1,7 @@
main {
padding-top: 112px;
min-height: calc(100vh - 587px);
position: relative;
}
@media all and (max-width: 1600px) and (min-width: 1280px) {
main {
@ -21,6 +22,7 @@ main section.gray {
main .title_wrapper {
display: flex;
justify-content: space-between;
align-items: flex-start;
margin-bottom: 50px;
}
@media all and (max-width: 1600px) and (min-width: 1280px) {
@ -123,7 +125,7 @@ main .title_wrapper .company-dropdown .companies_list {
display: none;
position: absolute;
right: 0;
top: calc(100% + 10px);
top: calc(100% + 28px);
width: 412px;
background: #fff;
box-shadow: 0px 4px 32px rgba(0, 0, 0, 0.16);
@ -2660,12 +2662,7 @@ main #order .container {
}
}
.contract_table {
margin-bottom: 80px;
}
@media all and (max-width: 960px) {
.contract_table {
margin-bottom: 30px;
}
margin-bottom: 0px;
}
.contract_table .table_row {
min-height: 80px;
@ -3536,15 +3533,28 @@ main .dropdown_blocks_list .dropdown_block .block_body .fines_detail ul li {
position: absolute;
top: 0;
left: 0;
bottom: -70px;
bottom: -30px;
right: 0;
pointer-events: none;
z-index: 99999;
z-index: 98;
margin: 0 auto;
max-width: 1310px;
}
@media all and (max-width: 1420px) {
.helpBox_wrapper {
width: calc(100% - 160px);
}
}
@media all and (max-width: 960px) {
.helpBox_wrapper {
position: relative;
bottom: 0;
z-index: 2;
}
}
@media all and (max-width: 768px) {
.helpBox_wrapper {
width: calc(100% - 32px);
}
}
.helpBox_wrapper .helpBox {
@ -3847,6 +3857,9 @@ main .dropdown_blocks_list .dropdown_block .block_body .fines_detail ul li {
.grecaptcha-badge {
visibility: hidden;
}
.changes {
overflow: hidden;
}
.changes .block {
margin-bottom: 55px;
}
@ -3881,6 +3894,7 @@ main .dropdown_blocks_list .dropdown_block .block_body .fines_detail ul li {
}
.changes .feed .feed_list {
margin-right: -30px;
box-sizing: border-box;
}
@media all and (max-width: 1279px) {
.changes .feed .feed_list {

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,7 @@
main {
padding-top: 112px;
min-height: calc(100vh - 587px);
position: relative;
@media all and (max-width: 1600px) and (min-width: 1280px) {
padding-top: 82px;
@ -27,6 +28,7 @@ main {
.title_wrapper {
display: flex;
justify-content: space-between;
align-items: flex-start;
margin-bottom: 50px;
@media all and (max-width: 1600px) and (min-width: 1280px) {
@ -131,7 +133,7 @@ main {
display: none;
position: absolute;
right: 0;
top: calc(100% + 10px);
top: calc(100% + 28px);
width: 412px;
background: #fff;
box-shadow: 0px 4px 32px rgba(0, 0, 0, 0.16);
@ -2898,11 +2900,7 @@ main {
// Таблица договоров в лк
.contract_table {
margin-bottom: 80px;
@media all and (max-width: 960px) {
margin-bottom: 30px;
}
margin-bottom: 0px;
.table_row {
min-height: 80px;
@ -3965,14 +3963,25 @@ main .dropdown_blocks_list .dropdown_block .block_body {
position: absolute;
top: 0;
left: 0;
bottom: -70px;
bottom: -30px;
right: 0;
pointer-events: none;
z-index: 99999;
z-index: 98;
margin: 0 auto;
max-width: 1310px;
@media all and (max-width: 1420px) {
width: calc(100% - 160px);
}
@media all and (max-width: 960px) {
position: relative;
bottom: 0;
z-index: 2;
}
@media all and (max-width: 768px) {
width: calc(100% - 32px);
}
.helpBox {
@ -4324,6 +4333,7 @@ main .dropdown_blocks_list .dropdown_block .block_body {
.grecaptcha-badge { visibility: hidden; }
.changes {
overflow: hidden;
.block {
margin-bottom: 55px;
@ -4364,6 +4374,8 @@ main .dropdown_blocks_list .dropdown_block .block_body {
.feed .feed_list {
margin-right: -30px;
//padding-right: 100px;
box-sizing: border-box;
@media all and (max-width: 1279px) {
overflow: visible;

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
{"version":3,"sources":["var.less"],"names":[],"mappings":"AAAA,MACE,cAAA,CACA,wBAAA,CACA,cAAA,CACA,+BAAA,CACA,iBAAA,CACA,kCAAA,CACA,aAAA,CACA,kBAAA,CACA,eAAA,CACA,0BAgBF,KACE,cAAA,CACA,gBAAA,CACA,aAAA,CACA,YAAa,uBAAb,CACA,eAAA,CACA,kBAEA,gBAAmC,uBAAwB,kBAA3D,KACE,cAAA,CACA,kBAGF,gBAAkC,iBAAlC,KACE,cAAA,CACA,kBAQJ,WACE,gBAAA,CACA,UAAA,CACA,gBAAA,CACA,WAAA,CACA,iBAAA,CACA,oBAAA,CACE,mBAEF,UAAC,OACC,QAAS,EAAT,CACA,aAAA,CACA,iBAAA,CACA,KAAA,CACA,MAAA,CACA,UAAA,CACA,QAAA,CACA,WAYF,gBAAmC,uBAAwB,kBAA3D,WACE,kBAGF,gBAAmC,kBAAnC,WACE,kBAGF,gBAAkC,iBAAlC,WACE,gBAAA,CACA,qBAGF,gBAAmC,kBAAnC,WACE,MAAO,kBAAP,CACA,yBAGF,gBAAkC,iBAAlC,WACE,uBAAA,CACA,MAAO,mBAIX,iBACE,YAAA,CACA,6BAAA,CACA,kBAEA,gBAAmC,kBACjC,gBAAC,QACC,QAAS,EAAT,CACA,aAAA,CACA,iBAAA,CACA,SAAA,CACA,UAAA,CACA,MAAA,CACA,QAAA,CACA,UAAA,CACA,WAAY,iBAflB,gBAmBE,OACE,YAEA,gBAAkC,iBAAlC,gBAHF,OAII,YAvBN,gBA2BE,SACE,MAAO,mBAEP,gBAHF,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AA,CACA,SAAA,CACA,SAAA,CACA,UAAA,CACA,KAAA,CACA,cAAA,CACA,UAAA,CACA,YAAA,CACA,oBAAA,CACA,sBAAA,CACA,kBAAA,CACA,wBAAA,CACG,qBAGJ,gBAAmC,uBAAwB,kBAA3D,UAxBA,cAyBC,iBAAA,CACA,qBAEA,UA5BD,aA4BE,QACA,UAAA,CACA,aAAA,CACA,UAIF,gBAAkC,iBAAlC,UAnCA,cAoCC,iBAAA,CACA,oBAAA,CACA,0BAEA,UAxCD,aAwCE,QACI,aAAA,CACA,UAAA,CACA,WAAA,CACA,gBAAA,CACA,iBAAA,CACA,QAAA,CACA,WAQJ,YADF,cACG,QACC,eAAA,CACA,iBAAA,CACA,qBAAA,CACA,qBAAA,CACA,eAAA,CACA,aAAA,CACA,MAAA,CACA,WAEA,gBAAmC,kBAAnC,YAXJ,cACG,QAWG,YAMR,OACE,iBAAA,CACA,eAAgB,0DAAhB,CACA,qBAEA,gBAAmC,uBAAwB,kBAA3D,OACE,iBAAA,CACA,sBAGF,gBAAkC,iBAAlC,OACE,iBAAA,CACA,oBAAA,CACA,2BAIJ,SACE,MAAO,aAGT,QACE,MAAO,WAGT,gBAAkC,iBAChC,oBACE,cAIJ,OACC,YAAA,CACA,0BAAA,CACC,mBAHF,MAKC,GACC,eAAA,CACE,cAAA,CACA,gBAAA,CACA,UAAA,CACF,mBAEA,gBAAmC,kBAAnC,MAPD,GAQE,cAAA,CACA,qBAID,gBAAmC,kBAAnC,OACE,mBADF,MAGE,GACE,cAAA,CACA,kBAKN,sBACC,gBAAA,CACA,0BAEA,gBAAkC,iBAAlC,sBACC,yBAAA,CACA,kBAGD,QAA2B,uBAAwB,kBAAnD,sBACC,yBAAA,CACA,kBAIF,aACC,eAGD,cACC,gBAAA,CACA,qBAAA,CACA,wBAAA,CACA"}
{"version":3,"sources":["var.less"],"names":[],"mappings":"AAAA,MACE,cAAA,CACA,wBAAA,CACA,cAAA,CACA,+BAAA,CACA,iBAAA,CACA,kCAAA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,CACA,gBAAA,CACA,iBAAA,CACA,QAAA,CACA,WAQJ,YADF,cACG,QACC,eAAA,CACA,iBAAA,CACA,qBAAA,CACA,qBAAA,CACA,eAAA,CACA,aAAA,CACA,MAAA,CACA,WAEA,gBAAmC,kBAAnC,YAXJ,cACG,QAWG,YAMR,OACE,iBAAA,CACA,eAAgB,0DAAhB,CACA,qBAEA,gBAAmC,uBAAwB,kBAA3D,OACE,iBAAA,CACA,sBAGF,gBAAkC,iBAAlC,OACE,iBAAA,CACA,oBAAA,CACA,2BAIJ,SACE,MAAO,aAGT,QACE,MAAO,WAGT,gBAAkC,iBAChC,oBACE,cAIJ,OACC,YAAA,CACA,0BAAA,CACC,mBAHF,MAKC,GACC,eAAA,CACE,cAAA,CACA,gBAAA,CACA,UAAA,CACF,mBAEA,gBAAmC,kBAAnC,MAPD,GAQE,cAAA,CACA,qBAID,gBAAmC,kBAAnC,OACE,mBADF,MAGE,GACE,cAAA,CACA,kBAKN,sBACC,gBAAA,CACA,0BAEA,gBAAkC,iBAAlC,sBACC,yBAAA,CACA,kBAGD,QAA2B,uBAAwB,kBAAnD,sBACC,yBAAA,CACA,kBAIF,aACC,eAGD,cACC,gBAAA,CACA,qBAAA,CACA,wBAAA,CACA"}

View File

@ -31,6 +31,7 @@ body {
font-family: 'Montserrat', sans-serif;
font-weight: 400;
overflow-x: hidden;
width: 100%;
@media all and (max-width: 1600px) and (min-width: 1280px) {
font-size: 13px;
@ -44,7 +45,7 @@ body {
}
.overflow {
//overflow: hidden;
overflow: hidden;
}
.container {
@ -194,7 +195,7 @@ body {
}
@media all and (max-width: 960px) {
padding-bottom: 30px;
padding-bottom: 0px;
}
}

View File

@ -23,50 +23,34 @@ export default async function handler(req, res)
upd: [],
upd_avans: [],
billfines: [],
fines: [],
};
await Promise.all([
new Promise((resolve) => {
axios.get(`${ process.env.CRM_API_HOST }/lk/Contract/GetUPDListByContract`, {
params: { ...client_jwt_decoded, contract_number: req.body.number },
headers: { "Authorization": `Bearer ${ crm_jwt }`, },
})
.then((crm_response) =>
{
console.log(inspect(crm_response.data, true, null, true));
for(let i in crm_response.data)
{
if(crm_response.data[i].type === "UPD")
{
result.upd = crm_response.data[i].upd;
}
if(crm_response.data[i].type === "UPD_Avans")
{
result.upd_avans = crm_response.data[i].upd;
}
if(crm_response.data[i].type === "BillFine")
{
result.billfines = crm_response.data[i].upd;
}
}
resolve();
})
.catch((error) => { console.error(error); resolve(); });
}),
new Promise((resolve) => {
axios.get(`${ process.env.CRM_API_HOST }/lk/Contract/GetFineGIBDDList`, {
params: { ...client_jwt_decoded, contract_number: req.body.number },
headers: { "Authorization": `Bearer ${ crm_jwt }`, },
})
.then((crm_response) => { result.fines = crm_response.data; resolve(); })
.catch((error) => { console.error(error); resolve(); });
}),
])
.then(() =>
{
axios.get(`${ process.env.CRM_API_HOST }/lk/Contract/GetUPDListByContract`, {
params: { ...client_jwt_decoded, contract_number: req.body.number },
headers: { "Authorization": `Bearer ${ crm_jwt }`, },
})
.then((crm_response) =>
{
console.log(inspect(crm_response.data, true, null, true));
for(let i in crm_response.data)
{
if(crm_response.data[i].type === "UPD")
{
result.upd = crm_response.data[i].upd;
}
if(crm_response.data[i].type === "UPD_Avans")
{
result.upd_avans = crm_response.data[i].upd;
}
if(crm_response.data[i].type === "BillFine")
{
result.billfines = crm_response.data[i].upd;
}
}
res.status(200).json(result);
});
})
.catch((error) => { console.error(error); resolve(); });
}
else
{

View File

@ -0,0 +1,44 @@
// 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';
import { inspect } from 'util';
export default async function handler(req, res)
{
await cors(req, res);
if(req.headers.cookie !== undefined)
{
const cookies = cookie.parse(req.headers?.cookie ? req.headers?.cookie : "");
if(cookies.jwt !== undefined && cookies.jwt !== null)
{
var client_jwt_decoded = jwt.verify(cookies.jwt, process.env.JWT_SECRET_CLIENT);
var crm_jwt = jwt.sign(client_jwt_decoded, process.env.JWT_SECRET_CRM, { noTimestamp: true });
const result = {
fines: [],
};
axios.get(`${ process.env.CRM_API_HOST }/lk/Contract/GetFineGIBDDList`, {
params: { ...client_jwt_decoded, contract_number: req.body.number },
headers: { "Authorization": `Bearer ${ crm_jwt }`, },
})
.then((crm_response) =>
{
result.fines = crm_response.data;
res.status(200).json(result);
})
.catch((error) => { console.error(error); });
}
else
{
res.status(403);
}
}
}

View File

@ -17,10 +17,10 @@ export default class AccountLayout extends React.Component
<div className="overflow">
<div className="container">
{ this.props.children }
<Manager/>
</div>
</div>
</section>
<Manager/>
</main>
)
}

View File

@ -21,6 +21,7 @@ import {
getFile,
} from "../../actions";
import AccountLayout from "../components/Layout/Account";
import ContractHeader from "./components/ContractHeader";
class ContractPage extends React.Component
{
@ -141,11 +142,7 @@ class ContractPage extends React.Component
<AccountLayout>
<div className="title_wrapper">
<div className="left" style={{ flexDirection: "column" }}>
<h1 className="section_title">Договор { number }</h1>
<h5 style={{ fontSize: "14px" }}>
{ date !== undefined && date !== null && date !== null && (<> от {moment(date).format("DD.MM.YYYY")}</>) }
{ car !== undefined && car !== null ? ` - ${car.brand.name} ${car.model.name} | ${ car.reg_number !== null ? car.reg_number : "без рег. номера" } | ${ car.vin_number !== null ? car.vin_number : "без VIN номера" }` : "" }
</h5>
<ContractHeader number={ number } date={ date } car={ car }/>
</div>
<Company { ...this.props }/>
</div>

View File

@ -49,7 +49,7 @@ export default class CalculationsList extends React.Component
dots: false,
infinite: false,
speed: 500,
slidesToShow: 2,
slidesToShow: 2.5,
slidesToScroll: 1,
centerMode: false,
variableWidth: false,

View File

@ -43,7 +43,7 @@ export default class SignatoriesList extends React.Component
dots: false,
infinite: false,
speed: 500,
slidesToShow: 2,
slidesToShow: 2.5,
slidesToScroll: 1,
centerMode: false,
variableWidth: false,

View File

@ -34,6 +34,7 @@ import {
import Options from "./components/Options";
import Comparison from "./components/Comparison";
import AccountLayout from "../../components/Layout/Account";
import ContractHeader from "../components/ContractHeader";
class ChangeGraphicPage extends React.Component
{
@ -284,11 +285,7 @@ class ChangeGraphicPage extends React.Component
<AccountLayout>
<div className="title_wrapper">
<div className="left" style={{ flexDirection: "column" }}>
<h1 className="section_title">Договор { number }</h1>
<h5 style={{ fontSize: "14px" }}>
{ date !== undefined && date !== null && date !== null && ( <> от {moment(date).format("DD.MM.YYYY")}</> ) }
{ car !== undefined && car !== null ? ` - ${car.brand.name} ${car.model.name} | ${ car.reg_number !== null ? car.reg_number : "без рег. номера" } | ${ car.vin_number !== null ? car.vin_number : "без VIN номера" }` : "" }
</h5>
<ContractHeader number={ number } date={ date } car={ car }/>
</div>
<Company { ...this.props }/>
</div>

View File

@ -0,0 +1,32 @@
import React from "react";
import moment from "moment";
export default class ContractHeader extends React.Component
{
constructor(props)
{
super(props);
this.state = {
};
}
componentDidMount()
{
}
render()
{
const { number, date, car } = this.props;
return (
<>
<h1 className="section_title">Договор { number }</h1>
<h5 style={{ fontSize: "14px" }}>
{ date !== undefined && date !== null && date !== null && ( <> от { moment(date).format("DD.MM.YYYY") }</> ) }
{ car !== undefined && car !== null ? ` - ${ car.brand.name } ${ car.model.name } | ${ car.reg_number !== null ? car.reg_number : "без рег. номера" } | ${ car.vin_number !== null ? car.vin_number : "без VIN номера" }`
: "" }
</h5>
</>
)
}
}

View File

@ -30,6 +30,7 @@ import {
getContractPenalties,
} from "../../actions";
import AccountLayout from "../components/Layout/Account";
import ContractHeader from "./components/ContractHeader";
const TYPES = {
upd: "УПД по очередным платежам",
@ -414,20 +415,8 @@ class ContractDocumentsPage extends React.Component
<h1 className="section_title">Расчет планируемых пени</h1>
<h5 style={{ fontSize: "14px" }}>
Договор { number }
{ date !== undefined && date !== null && date !== null && (
<> от {moment(date).format("DD.MM.YYYY")}</>
) }
{ car !== undefined && car !== null
? ` - ${car.brand.name} ${car.model.name} | ${
car.reg_number !== null
? car.reg_number
: "без рег. номера"
} | ${
car.vin_number !== null
? car.vin_number
: "без VIN номера"
}`
: "" }
{ date !== undefined && date !== null && date !== null && ( <> от {moment(date).format("DD.MM.YYYY")}</> ) }
{ car !== undefined && car !== null ? ` - ${car.brand.name} ${car.model.name} | ${ car.reg_number !== null ? car.reg_number : "без рег. номера" } | ${ car.vin_number !== null ? car.vin_number : "без VIN номера" }` : "" }
</h5>
</div>
</div>
@ -471,23 +460,7 @@ class ContractDocumentsPage extends React.Component
<>
<div className="title_wrapper">
<div className="left" style={{ flexDirection: "column" }}>
<h1 className="section_title">Договор { number }</h1>
<h5 style={{ fontSize: "14px" }}>
{ date !== undefined && date !== null && date !== null && (
<> от {moment(date).format("DD.MM.YYYY")}</>
) }
{ car !== undefined && car !== null
? ` - ${car.brand.name} ${car.model.name} | ${
car.reg_number !== null
? car.reg_number
: "без рег. номера"
} | ${
car.vin_number !== null
? car.vin_number
: "без VIN номера"
}`
: "" }
</h5>
<ContractHeader number={ number } date={ date } car={ car }/>
</div>
<Company { ...this.props }/>
</div>

View File

@ -17,6 +17,7 @@ import NotificationMessage from "../components/Events/NotificationMessage";
import { getContractInfo, getFilteredEvents } from "../../actions";
import AccountLayout from "../components/Layout/Account";
import ContractHeader from "./components/ContractHeader";
class ContractPage extends React.Component
{
@ -79,8 +80,7 @@ class ContractPage extends React.Component
<AccountLayout>
<div className="title_wrapper">
<div className="left" style={{ flexDirection: "column" }}>
<h1 className="section_title">Договор { number }</h1>
<h5 style={{ fontSize: "14px" }}>{ date !== undefined && date !== null && date !== null && (<> от { moment(date).format("DD.MM.YYYY") }</>)}{ car !== undefined && car !== null ? ` - ${ car.brand.name } ${ car.model.name } | ${ car.reg_number !== null ? car.reg_number : "без рег. номера" } | ${ car.vin_number !== null ? car.vin_number : "без VIN номера" }` : "" }</h5>
<ContractHeader number={ number } date={ date } car={ car }/>
</div>
<Company { ...this.props }/>
</div>

View File

@ -19,11 +19,11 @@ import DownloadPrintFormPdfButton from "../components/DownloadPrintFormPdfButton
import DownloadFinesPdfButton from "../components/DownloadFinesPdfButton";
import {
getContractInfo,
getContractDocuments,
getReconciliationFile,
getContractInfo,
getContractFines,
} from "../../actions";
import AccountLayout from "../components/Layout/Account";
import ContractHeader from "./components/ContractHeader";
const TYPES = {
upd: "УПД по очередным платежам",
@ -33,34 +33,35 @@ const TYPES = {
fines: "Штрафы ГИБДД",
};
class ContractDocumentsPage extends React.Component
class ContractFinesPage extends React.Component
{
constructor(props)
{
super(props);
this.state = {
opened: [],
date: null,
car: null,
contract_date: null,
documents: null,
loading: false,
valid_date_start: null,
valid_date_end: null,
period_date_start: null,
period_date_end: null,
reconciliation_requested: false,
reconciliation_disabled: false,
all: false,
date: null,
car: null,
contract_date: null,
documents: null,
fines: null,
loading: false,
valid_date_start: null,
valid_date_end: null,
period_date_start: null,
period_date_end: null,
contracts_info: [],
};
}
static getDerivedStateFromProps(nextProps, prevState)
{
return {
contracts_info: nextProps.contracts_info,
date: nextProps.date,
car: nextProps.car,
contract_date: nextProps.contract_date,
documents: nextProps.documents,
fines: nextProps.fines,
};
}
@ -68,16 +69,15 @@ class ContractDocumentsPage extends React.Component
{
if (!this.state.loading && this.props.number !== undefined)
{
const de = moment().toDate();
this.setState(
{ loading: true, period_date_end: de, valid_date_end: de },
{ loading: true },
() => {
getContractInfo({
dispatch: this.props.dispatch,
number: this.props.number,
});
getContractDocuments({
getContractFines({
dispatch: this.props.dispatch,
number: this.props.number,
})
@ -104,31 +104,17 @@ class ContractDocumentsPage extends React.Component
}
}
_handle_onGroup = (group) =>
_handle_onShowMore = () =>
{
console.log("group", group);
const opened = [...this.state.opened];
if (opened.indexOf(group) < 0)
{
opened.push(group);
}
else
{
opened.splice(opened.indexOf(group), 1);
}
this.setState({ opened: opened });
this.setState({ all: true });
}
_renderFines = (fines, type) =>
_renderFines = (fines) =>
{
console.log("_renderFines");
console.log("fines");
console.log(fines);
console.log("_renderFines", "fines", fines);
const { number } = this.props;
const { opened } = this.state;
const { all } = this.state;
const status = {
NotPaid: "danger",
@ -140,18 +126,8 @@ class ContractDocumentsPage extends React.Component
{
return (
<>
<div className="block-column">
<div
className={`dropdown_block ${
opened.indexOf("fines") > -1 ? "open" : ""
}`}
>
<div className="block_header">
<p>{ TYPES["fines"] }</p>
</div>
</div>
<div className="dropdown_blocks_list">
{ fines.slice(0, opened.indexOf("fines") > -1 ? fines.length : 3).map((fine, fine_index) => (
{ fines.slice(0, all ? fines.length : 3).map((fine, fine_index) => (
<div className="dropdown_block open" key={fine_index}>
<div className="block_body">
<div className="fines_detail">
@ -219,7 +195,7 @@ class ContractDocumentsPage extends React.Component
{*/}
</div>
)) }
{ opened.indexOf(type) < 0 && fines.length > 3 && (
{ !all && fines.length > 3 && (
<div
className="row"
style={{
@ -227,7 +203,7 @@ class ContractDocumentsPage extends React.Component
justifyContent: "center",
corsor: "pointer",
}}
onClick={() => this._handle_onGroup(type)}
onClick={ this._handle_onShowMore }
>
<p style={{ paddingTop: "15px", color: "#747474" }}>
Еще {fines.length - 3}{" "}
@ -242,7 +218,6 @@ class ContractDocumentsPage extends React.Component
</div>
) }
</div>
</div>
</>
);
}
@ -250,18 +225,6 @@ class ContractDocumentsPage extends React.Component
return (
<>
<div className="block-column">
<div
className={`dropdown_block ${
opened.indexOf(type) > -1 ? "open" : ""
}`}
>
<div
className="block_header"
onClick={ () => this._handle_onGroup(type) }
>
<p>{ TYPES[type] }</p>
</div>
</div>
<div style={{ display: "flex", alignItems: "center" }}>
<p>Штрафов не найдено.</p>
<p>&nbsp;</p>
@ -279,21 +242,11 @@ class ContractDocumentsPage extends React.Component
date,
car,
contract_date,
documents,
period_date_start,
period_date_end,
valid_date_start,
valid_date_end,
reconciliation_requested,
reconciliation_disabled,
opened,
fines,
} = this.state;
console.log("documentsdocumentsdocumentsdocumentsdocuments");
console.log(documents);
console.log("opened");
console.log(opened);
console.log("fines");
console.log(fines);
return (
<React.Fragment>
@ -305,23 +258,7 @@ class ContractDocumentsPage extends React.Component
<AccountLayout>
<div className="title_wrapper">
<div className="left" style={{ flexDirection: "column" }}>
<h1 className="section_title">Договор {number}</h1>
<h5 style={{ fontSize: "14px" }}>
{ date !== undefined && date !== null && date !== null && (
<> от {moment(date).format("DD.MM.YYYY")}</>
) }
{ car !== undefined && car !== null
? ` - ${car.brand.name} ${car.model.name} | ${
car.reg_number !== null
? car.reg_number
: "без рег. номера"
} | ${
car.vin_number !== null
? car.vin_number
: "без VIN номера"
}`
: "" }
</h5>
<ContractHeader number={ number } date={ date } car={ car }/>
</div>
<Company { ...this.props }/>
</div>
@ -329,34 +266,31 @@ class ContractDocumentsPage extends React.Component
<InnerMenu number={ number } { ...this.props }/>
<article>
{ loading ? (
<div
className="table_row table_header"
style={{
minHeight: 300,
display: "flex",
justifyContent: "center",
alignItems: "center",
}}
>
<SpinnerCircular
size={90}
thickness={51}
speed={100}
color="rgba(28, 1, 169, 1)"
secondaryColor="rgba(236, 239, 244, 1)"
/>
<div className="table_row table_header" style={{ minHeight: 300, display: "flex", justifyContent: "center", alignItems: "center", }}>
<SpinnerCircular size={ 90 } thickness={ 51 } speed={ 100 } color="rgba(28, 1, 169, 1)" secondaryColor="rgba(236, 239, 244, 1)" />
</div>
) : (
<div className="dropdown_blocks_list zero-margin gibdd">
<div className={`dropdown_block open`}>
<div className="block_body full">
<div className="company">
<p className="title lower">Штрафы ГИБДД</p>
{fines !== undefined && fines !== null ? (
<>
{this._renderFines(fines)}
</>
) : null}
</div>
</div>
</div>
</div>
) }
{/*}
<>
<div className="dropdown_blocks_list">
{documents !== undefined && documents !== null ? (
<>
{this._renderFines(documents.fines, "fines")}
</>
) : null}
</div>
</>
) }
{*/}
</article>
</div>
</AccountLayout>
@ -369,10 +303,11 @@ class ContractDocumentsPage extends React.Component
function mapStateToProps(state, ownProps)
{
return {
contract_date: state.contract.date,
date: state.contract.date,
car: state.contract.car,
documents: state.contract.documents,
contracts_info: state.contracts_info,
contract_date: state.contract.date,
date: state.contract.date,
car: state.contract.car,
fines: state.contract.fines,
};
}
@ -387,7 +322,7 @@ export const getServerSideProps = reduxWrapper.getServerSideProps(
}
);
export default withRouter(connect(mapStateToProps)(ContractDocumentsPage));
export default withRouter(connect(mapStateToProps)(ContractFinesPage));
{
/*}

View File

@ -21,6 +21,7 @@ import {
getContractRegistration,
getContractTelematic,
} from "./../../actions";
import ContractHeader from "./components/ContractHeader";
class ContractServicesPage extends React.Component {
constructor(props) {
@ -126,100 +127,55 @@ class ContractServicesPage extends React.Component {
<section>
<div className="clear"></div>
<div className="container">
<div className="title_wrapper">
<div className="left" style={{ flexDirection: "column" }}>
<h1 className="section_title">Договор {number}</h1>
<h5 style={{ fontSize: "14px" }}>
{date !== undefined && date !== null && date !== null && (
<> от {moment(date).format("DD.MM.YYYY")}</>
)}
{car !== undefined && car !== null
? ` - ${car.brand.name} ${car.model.name} | ${
car.reg_number !== null
? car.reg_number
: "без рег. номера"
} | ${
car.vin_number !== null
? car.vin_number
: "без VIN номера"
}`
: ""}
</h5>
<div className="title_wrapper">
<div className="left" style={{ flexDirection: "column" }}>
<ContractHeader number={ number } date={ date } car={ car }/>
</div>
<Company { ...this.props }/>
</div>
<Company { ...this.props }/>
</div>
<div className="aside_container about">
<InnerMenu number={number} {...this.props} />
<article>
{loading ? (
<div
className="table_row table_header"
style={{
minHeight: 300,
display: "flex",
justifyContent: "center",
alignItems: "center",
}}
>
<SpinnerCircular
size={90}
thickness={51}
speed={100}
color="rgba(28, 1, 169, 1)"
secondaryColor="rgba(236, 239, 244, 1)"
/>
</div>
) : (
<div className="dropdown_blocks_list zero-margin gibdd">
<div className={`dropdown_block open`}>
<div className="block_body full">
<div className="company">
<p className="title lower">Штрафы ГИБДД</p>
<ul>
<li>
Номер постановления: <b>3432434242334</b>
</li>
<li>
Страховая: <b>3 400 000,00 </b>
</li>
<li>
Статус: <b>Оплачен</b>
</li>
<li>
Дата: <b>01/01/2020 </b>
</li>
<li>
Штраф:{" "}
<b>п. 1.15 - Несоблюдение правил парковки </b>
</li>
<li>
<div className="dosc_list medium-icon">
<div className="row">
<p className="doc_name i-pdf extension">
01/20/2020 (.PDF)
<span style={{"width":"100%"}}>
Постановление
</span>
</p>
<div className="aside_container about">
<InnerMenu number={number} {...this.props} />
<article>
{ loading ? (
<div className="table_row table_header" style={{ minHeight: 300, display: "flex", justifyContent: "center", alignItems: "center", }} >
<SpinnerCircular size={ 90 } thickness={ 51 } speed={ 100 } color="rgba(28, 1, 169, 1)" secondaryColor="rgba(236, 239, 244, 1)" />
</div>
) : (
<div className="dropdown_blocks_list zero-margin gibdd">
<div className={`dropdown_block open`}>
<div className="block_body full">
<div className="company">
<p className="title lower">Штрафы ГИБДД</p>
<ul>
<li>Номер постановления: <b>3432434242334</b></li>
<li>Страховая: <b>3 400 000,00 </b></li>
<li>Статус: <b>Оплачен</b></li>
<li>Дата: <b>01/01/2020 </b></li>
<li>Штраф:{" "}<b>п. 1.15 - Несоблюдение правил парковки </b></li>
<li>
<div className="dosc_list medium-icon">
<div className="row">
<p className="doc_name i-pdf extension">
01/20/2020 (.PDF)
<span style={{"width":"100%"}}>Постановление</span>
</p>
</div>
<div className="row">
<p className="doc_name i-pdf extension">
Договор
<span style={{"width":"100%"}}>2021_3866 от 25.06.2021</span>
</p>
</div>
</div>
</li>
</ul>
</div>
</div>
</div>
<div className="row">
<p className="doc_name i-pdf extension">
Договор
<span style={{"width":"100%"}}>
2021_3866 от 25.06.2021
</span>
</p>
</div>
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
)}
</article>
</div>
</div>
) }
</article>
</div>
</div>
</section>
</main>

View File

@ -16,6 +16,7 @@ import InnerMenu from "./components/InnerMenu";
import { getContract, getContractDebtInvoiceFile, getContractInfo, getContractPenaltyInvoiceFile } from './../../actions';
import AccountLayout from "../components/Layout/Account";
import ContractHeader from "./components/ContractHeader";
class ContractSchedulePage extends React.Component
{
@ -24,6 +25,7 @@ class ContractSchedulePage extends React.Component
super(props);
this.state = {
loading: false,
contracts_info: {},
payments: null,
avans: null,
debt: null,
@ -40,6 +42,7 @@ class ContractSchedulePage extends React.Component
static getDerivedStateFromProps(nextProps, prevState)
{
return {
contracts_info: nextProps.contracts_info,
date: nextProps.date,
car: nextProps.car,
payments: nextProps.payments,
@ -51,13 +54,19 @@ class ContractSchedulePage extends React.Component
componentDidMount()
{
if(!this.state.loading && this.props.number !== undefined)
console.log("ContractSchedulePage", "this.state", this.state);
const { number } = this.props;
if(!this.state.loading && number !== undefined)
{
this.setState({ loading: true }, () =>
{
getContractInfo({ dispatch: this.props.dispatch, number: this.props.number });
if(this.state.contracts_info[ number ] === undefined)
{
getContractInfo({ dispatch: this.props.dispatch, number: number });
}
getContract({ dispatch: this.props.dispatch, number: this.props.number }).then(() => {
getContract({ dispatch: this.props.dispatch, number: number }).then(() => {
this.setState({ loading: false });
}).catch(() => {});
});
@ -147,8 +156,10 @@ class ContractSchedulePage extends React.Component
render()
{
const { payments, avans, debt, penalty, date, car, full, opened, loading, debt_invoice_file_loading, penalty_invoice_file_loading } = this.state;
const { number } = this.props;
const { loading, contracts_info, payments, avans, debt, penalty, full, opened, debt_invoice_file_loading, penalty_invoice_file_loading } = this.state;
let { date, car } = contracts_info[ number ] !== undefined ? contracts_info[ number ] : {};
console.log(".".repeat(50));
console.log("this.state", this.state);
@ -182,8 +193,7 @@ class ContractSchedulePage extends React.Component
<AccountLayout>
<div className="title_wrapper">
<div className="left" style={{ flexDirection: 'column', }}>
<h1 className="section_title">Договор { number }</h1>
<p className="section_subtitle">{ date !== undefined && date !== null && date !== null && (<> от { moment(date).format("DD.MM.YYYY") }</>)}{ car !== undefined && car !== null ? ` - ${ car.brand.name } ${ car.model.name } | ${ car.reg_number !== null ? car.reg_number : 'без рег. номера' } | ${ car.vin_number !== null ? car.vin_number : 'без VIN номера' }` : '' }</p>
<ContractHeader number={ number } date={ date } car={ car }/>
</div>
<Company { ...this.props }/>
</div>
@ -335,6 +345,7 @@ function mapStateToProps(state, ownProps)
{
return {
company: state.company,
contracts_info: state.contracts_info,
payments: state.contract.payments,
avans: state.contract.avans,
debt: state.contract.debt,

View File

@ -16,6 +16,7 @@ import DownloadPdfButton from "../components/DownloadPdfButton";
import { getContractInfo, getContractMaterials } from "../../actions";
import AccountLayout from "../components/Layout/Account";
import ContractHeader from "./components/ContractHeader";
class ContractPage extends React.Component
{
@ -85,8 +86,7 @@ class ContractPage extends React.Component
<AccountLayout>
<div className="title_wrapper">
<div className="left" style={{ flexDirection: 'column', }}>
<h1 className="section_title">Договор { number }</h1>
<h5 style={{ fontSize: '14px' }}>{ date !== undefined && date !== null && date !== null && (<> от { moment(date).format("DD.MM.YYYY") }</>)}{ car !== undefined && car !== null ? ` - ${ car.brand.name } ${ car.model.name } | ${ car.reg_number !== null ? car.reg_number : 'без рег. номера' } | ${ car.vin_number !== null ? car.vin_number : 'без VIN номера' }` : '' }</h5>
<ContractHeader number={ number } date={ date } car={ car }/>
</div>
<Company { ...this.props }/>
</div>

View File

@ -134,20 +134,8 @@ class ContractPage extends React.Component
<h1 className="section_title">Расчет планируемых пени</h1>
<h5 style={{ fontSize: "14px" }}>
Договор { number }
{ date !== undefined && date !== null && date !== null && (
<> от {moment(date).format("DD.MM.YYYY")}</>
) }
{ car !== undefined && car !== null
? ` - ${car.brand.name} ${car.model.name} | ${
car.reg_number !== null
? car.reg_number
: "без рег. номера"
} | ${
car.vin_number !== null
? car.vin_number
: "без VIN номера"
}`
: "" }
{ date !== undefined && date !== null && date !== null && ( <> от {moment(date).format("DD.MM.YYYY")}</> ) }
{ car !== undefined && car !== null ? ` - ${car.brand.name} ${car.model.name} | ${ car.reg_number !== null ? car.reg_number : "без рег. номера" } | ${ car.vin_number !== null ? car.vin_number : "без VIN номера" }` : "" }
</h5>
</div>
</div>

View File

@ -17,6 +17,7 @@ import InnerMenu from "./components/InnerMenu";
import { getContractInfo, getContractHelpCard, getContractInsurance, getContractRegistration, getContractTelematic, } from './../../actions';
import DownloadPdfButton from "../components/DownloadPdfButton";
import AccountLayout from "../components/Layout/Account";
import ContractHeader from "./components/ContractHeader";
class ContractServicesPage extends React.Component
{
@ -167,8 +168,7 @@ class ContractServicesPage extends React.Component
<AccountLayout>
<div className="title_wrapper">
<div className="left" style={{ flexDirection: 'column', }}>
<h1 className="section_title">Договор { number }</h1>
<h5 style={{ fontSize: '14px' }}>{ date !== undefined && date !== null && date !== null && (<> от { moment(date).format("DD.MM.YYYY") }</>)}{ car !== undefined && car !== null ? ` - ${ car.brand.name } ${ car.model.name } | ${ car.reg_number !== null ? car.reg_number : 'без рег. номера' } | ${ car.vin_number !== null ? car.vin_number : 'без VIN номера' }` : '' }</h5>
<ContractHeader number={ number } date={ date } car={ car }/>
</div>
<Company { ...this.props }/>
</div>

View File

@ -1,5 +1,3 @@
import { HYDRATE } from 'next-redux-wrapper';
import * as actionTypes from '../constants/actionTypes';
import initialState from "./initialState";
@ -7,14 +5,6 @@ const contractReducer = (state = initialState.contract, action) =>
{
switch (action.type)
{
case HYDRATE:
{
return {
...state,
...action.payload.contract,
};
}
case actionTypes.CONTRACT:
{
return {
@ -91,6 +81,14 @@ const contractReducer = (state = initialState.contract, action) =>
};
}
case actionTypes.CONTRACT_FINES:
{
return {
...state,
fines: action.data.fines,
};
}
case actionTypes.CONTRACT_RULES:
{
return {

View File

@ -0,0 +1,49 @@
import { HYDRATE } from 'next-redux-wrapper';
import * as actionTypes from '../constants/actionTypes';
import initialState from "./initialState";
const contractsInfoReducer = (state = initialState.contracts_info, action) =>
{
switch (action.type)
{
case HYDRATE:
{
return {
...state,
...action.payload.contracts_info,
};
}
case actionTypes.CONTRACTS_INFO:
{
console.log("actionTypes.CONTRACTS_INFO");
console.log("state", state);
console.log("action.data", action.data);
console.log("-".repeat(100));
console.log({
...state, ...action.data,
});
console.log("=".repeat(100));
return {
...state, ...action.data,
};
}
case actionTypes.CONTRACTS_INFO_RESET:
{
console.log("actionTypes.CONTRACTS_INFO_RESET");
console.log("state", state);
console.log("action.data", action.data);
return {};
}
default: {
return state;
}
}
};
export default contractsInfoReducer;

View File

@ -1,33 +1,40 @@
export const defaultState = {
auth: {
auth:
{
logged: false,
observer: false,
},
user: {
user:
{
name: "",
lastname: "",
secondname: "",
secondname: "",
phone: "",
},
companies: {
companies:
{
list: null,
},
admin: {
admin:
{
list: null,
},
company: {
company:
{
title: "",
inn: "",
kpp: "",
ogrn: "",
},
contracts_info: {},
contracts:
{
{
list: null,
page: 1,
pages: 1,
},
contract: {
contract:
{
payments: null,
avans: null,
debt: null,
@ -38,14 +45,17 @@ export const defaultState = {
helpcard: null,
registration: null,
telematic: null,
agreement: {
agreement:
{
unsigned: null,
signed: null,
},
documents: null,
fines: null,
rules: null,
materials: null,
change: {
change:
{
signatories: null,
calculations: null,
variants: null,
@ -54,7 +64,7 @@ export const defaultState = {
calculated: null,
},
},
calendar: {
calendar: {
payments: null,
periods: null,
},

View File

@ -11,6 +11,7 @@ import calendarReducer from '../reducers/calendarReducer';
import eventsReducer from '../reducers/eventsReducer';
import supportReducer from '../reducers/supportReducer';
import adminReducer from '../reducers/adminReducer';
import contractsInfoReducer from '../reducers/contractsInfoReducer';
const combinedReducer = combineReducers({
auth: authReducer,
@ -23,6 +24,7 @@ const combinedReducer = combineReducers({
events: eventsReducer,
support: supportReducer,
admin: adminReducer,
contracts_info: contractsInfoReducer,
});
const makeStore = (context) =>
@ -40,7 +42,7 @@ const makeStore = (context) =>
const persistConfig = {
key: 'nextjs',
whitelist: [ 'auth', 'user', 'company', 'companies' ],
whitelist: [ 'auth', 'user', 'company', 'companies', 'contracts_info', ],
storage
};