Skip to content

Commit 3ede503

Browse files
Merge pull request #70 from REACT-DEVELOPER-IBROKHIM/feat/add-new-driver-certificate
Feat/add new driver certificate
2 parents ba8fea0 + 1d793a3 commit 3ede503

File tree

30 files changed

+598
-75
lines changed

30 files changed

+598
-75
lines changed

client/src/api/upload/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import axios from "@api";
44
export async function uploadSignature(id, type, file) {
55
const authResponse = await resolve(
66
fetch(
7-
"https://lionfish-app-3v9xf.ondigitalocean.app/api/upload/signature?id=" +
7+
`${import.meta.env.VITE_API_URL}upload/signature?id=` +
88
id +
99
"&type=" +
1010
type,
573 KB
Loading
684 KB
Loading

client/src/assets/images/wave.jpg

128 KB
Loading

client/src/components/documents/adr/index.jsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,9 @@ import MiniCertificate from "../driver/mini";
77
const AdrCertificate = forwardRef(({ document, type }, ref) => {
88
return (
99
<div ref={ref}>
10-
<AdrCertificateFront type={type} document={document} ref={ref} />
10+
<AdrCertificateFront type={type} document={document} />
1111
<AdrCertificateBack type={type} tank={document?.tank} />
12-
<MiniCertificate
13-
document={document}
14-
type={type}
15-
certType="adr"
16-
ref={ref}
17-
/>
12+
<MiniCertificate document={document} type={type} certType="adr" />
1813
</div>
1914
);
2015
});
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
import React from "react";
2+
import QRCode from "react-qr-code";
3+
4+
const DriverCardBack = ({ document }) => {
5+
const { to, id } = document;
6+
7+
return (
8+
<div className={`w-[2480px] h-[3498px] flex justify-center mt-[10px]`}>
9+
<div className="w-[1600px] h-[1000px] border-[6px] border-gray-400 mt-[10px] rounded-[50px] bg-silkBack bg-cover bg-no-repeat text-center px-[30px]">
10+
<p className="text-[45px] mt-[20px]">DRIVER QUALIFICATION CARD</p>
11+
<div className="flex justify-between p-[30px]">
12+
<div>
13+
<div className="text-[45px] text-left mt-[30px] flex flex-col gap-[15px]">
14+
<p>1.Номер сертификата</p>
15+
<p>2.Имя</p>
16+
<p>3.Фамилия</p>
17+
<p>4.Дата рождения</p>
18+
<p>5.Oтчество</p>
19+
<p>7.Категории транспортных средств</p>
20+
<p>8.Страна выдачи</p>
21+
<p>9.Организация-эмитент</p>
22+
</div>
23+
<QRCode
24+
className="mb-[20px] mt-[30px]"
25+
value={`https://www.xalqarologistika.uz/check-certificates/${id}`}
26+
/>
27+
</div>
28+
<div className="text-[45px]">
29+
<table className="border-2 border-black">
30+
<tr>
31+
<th className="px-[30px] border-2 border-black">
32+
Category <br /> Категории
33+
</th>
34+
<th className="px-[30px] border-2 border-black">
35+
Until <br /> До
36+
</th>
37+
</tr>
38+
<tr>
39+
<td className="px-[30px] border-2 border-black">C1</td>
40+
<td className="px-[30px] border-2 border-black"></td>
41+
</tr>
42+
<tr>
43+
<td className="px-[30px] border-2 border-black">C</td>
44+
<td className="px-[30px] border-2 border-black">{to}</td>
45+
</tr>
46+
<tr>
47+
<td className="px-[30px] border-2 border-black">D1</td>
48+
<td className="px-[30px] border-2 border-black"></td>
49+
</tr>
50+
<tr>
51+
<td className="px-[30px] border-2 border-black">D</td>
52+
<td className="px-[30px] border-2 border-black"></td>
53+
</tr>
54+
<tr>
55+
<td className="px-[30px] border-2 border-black">C1E</td>
56+
<td className="px-[30px] border-2 border-black"></td>
57+
</tr>
58+
<tr>
59+
<td className="px-[30px] border-2 border-black">CE</td>
60+
<td className="px-[30px] border-2 border-black">{to}</td>
61+
</tr>
62+
<tr>
63+
<td className="px-[30px] border-2 border-black">D1E</td>
64+
<td className="px-[30px] border-2 border-black"></td>
65+
</tr>
66+
<tr>
67+
<td className="px-[30px] border-2 border-black">DE</td>
68+
<td className="px-[30px] border-2 border-black"></td>
69+
</tr>
70+
</table>
71+
</div>
72+
</div>
73+
</div>
74+
</div>
75+
);
76+
};
77+
78+
export default DriverCardBack;
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import React from "react";
2+
import flag from "@assets/images/flag.png";
3+
4+
const DriverCardFront = ({ document }) => {
5+
const { name, surname, to, birthDate, id, signature, driverLicenceNumber } =
6+
document;
7+
console.log(document);
8+
return (
9+
<div className={`w-[2480px] h-[3508px] flex justify-center mt-[10px]`}>
10+
<div className="w-[1600px] h-[1000px] border-[6px] border-gray-400 mt-[10px] rounded-[50px] bg-silk bg-cover bg-no-repeat text-center px-[30px]">
11+
<p className="text-[48px] font-bold mt-[30px]">
12+
CERTIFICATE OF PROFESSIONAL COMPETENCE OF THE DRIVER
13+
</p>
14+
<p className="text-[45px] mt-[20px]">DRIVER QUALIFICATION CARD</p>
15+
<div className="flex justify-between items-center mt-[50px] px-[60px]">
16+
<div className="text-[60px] py-[15px] px-[40px] border-[6px] border-black rounded-[100%]">
17+
UZ
18+
</div>
19+
<p className="text-[50px] font-bold ml-[-200px]">1.Nr. {id}</p>
20+
<img src={flag} alt="NT2022" className="w-[200px]" />
21+
</div>
22+
<div className="h-[570px] flex items-center mt-[60px] gap-[40px]">
23+
<div className="h-full aspect-[3/4] bg-white border-[2px] border-black"></div>
24+
<div className="h-full bg-blue font-bold text-left text-[43px] flex flex-col flex-1 gap-[10px]">
25+
<p>2.{name}</p>
26+
<p>3.{surname}</p>
27+
<p>4.{birthDate}</p>
28+
<p>5.{driverLicenceNumber}</p>
29+
<p>7.C/CE</p>
30+
<p>8.REPUBLIC OF UZBEKISTAN</p>
31+
<p>9.NAMANGANTRANS 2022</p>
32+
<p>Until (date) {to}</p>
33+
<div className="w-[300px] h-[100px] bg-white border-[2px] border-black">
34+
<img
35+
width={"100%"}
36+
height={"80%"}
37+
src={signature}
38+
alt=""
39+
className="scale-[0.7]"
40+
/>
41+
</div>
42+
</div>
43+
<div className="h-full flex flex-col items-end justify-end">
44+
<div className="bg-blue-500 text-white text-[35px] py-[20px] px-[40px] flex items-center justify-center rounded-ee-[30px] rounded-ss-[30px] mb-[500px] mr-[55px]">
45+
NT2022
46+
</div>
47+
</div>
48+
</div>
49+
</div>
50+
</div>
51+
);
52+
};
53+
54+
export default DriverCardFront;
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { forwardRef } from "react";
2+
import DriverCardFront from "./card/front";
3+
import DriverCardBack from "./card/back";
4+
5+
const DriverCertificateCard = forwardRef(({ document, type }, ref) => {
6+
return (
7+
<div ref={ref}>
8+
<DriverCardFront document={document} type={type} />
9+
<DriverCardBack document={document} type={type} />
10+
</div>
11+
);
12+
});
13+
14+
export default DriverCertificateCard;

client/src/components/documents/driver/index.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import MiniCertificate from "./mini";
55
const DriverCertificate = forwardRef(({ document, type }, ref) => {
66
return (
77
<div ref={ref}>
8-
<DriverCertificateTop document={document} type={type} ref={ref} />
9-
<DriverCertificateBottom document={document} type={type} ref={ref} />
10-
<MiniCertificate document={document} type={type} ref={ref} />
8+
<DriverCertificateTop document={document} type={type} />
9+
<DriverCertificateBottom document={document} type={type} />
10+
<MiniCertificate document={document} type={type} />
1111
</div>
1212
);
1313
});

client/src/components/table/index.jsx

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import Edit from "@routes/sub-routes/edit";
1818
import { deleteDocumentThunk } from "@thunks/documents-thunks";
1919
import { updateUI } from "@helpers/update-ui";
2020
import { useNavigate } from "react-router-dom";
21+
import DriverCertificateCard from "../documents/driver-card";
2122

2223
const DocumentsTable = ({ data, loading, type }) => {
2324
const [editingDocumentId, setEditingDocumentId] = useState(null);
@@ -80,6 +81,12 @@ const DocumentsTable = ({ data, loading, type }) => {
8081
key: "birthDate",
8182
width: "10%",
8283
},
84+
{
85+
title: "Haydovchilik guvohnomasi raqami",
86+
dataIndex: "driverLicenceNumber",
87+
key: "driverLicenceNumber",
88+
width: "10%",
89+
},
8390
{
8491
title: "Berilgan sana",
8592
dataIndex: "from",
@@ -175,11 +182,17 @@ const DocumentsTable = ({ data, loading, type }) => {
175182
<div className="hidden w-0 h-0">
176183
{document && (
177184
<>
178-
{SIMILAR_DOCUMENT_TYPES.DRIVER.includes(type) ? (
185+
{SIMILAR_DOCUMENT_TYPES.DRIVER.includes(type) && (
179186
<DriverCertificate document={document} ref={printFrame} />
180-
) : (
187+
)}
188+
189+
{SIMILAR_DOCUMENT_TYPES.ADR.includes(type) && (
181190
<AdrCertificate document={document} ref={printFrame} />
182191
)}
192+
193+
{SIMILAR_DOCUMENT_TYPES.DRIVER_CARD.includes(type) && (
194+
<DriverCertificateCard document={document} ref={printFrame} />
195+
)}
183196
</>
184197
)}
185198
</div>

0 commit comments

Comments
 (0)