new style and fixed request
This commit is contained in:
@@ -1 +0,0 @@
|
||||
NEXT_PUBLIC_API_URL=
|
||||
@@ -12,11 +12,11 @@ export default async function Page(props:{
|
||||
}) {
|
||||
|
||||
const params =await props.searchParams;
|
||||
const numAccount = params?.numAcount ? parseInt(params.numAcount) : null;
|
||||
const numAcount = params?.numAcount ? parseInt(params.numAcount) : null;
|
||||
|
||||
let student: any = null;
|
||||
if (numAccount) {
|
||||
student = await GetStudent(numAccount);
|
||||
if (numAcount) {
|
||||
student = await GetStudent(numAcount);
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -30,7 +30,7 @@ export default async function Page(props:{
|
||||
<Information NoCuenta={student.id_cuenta} Nombre={student.nombre} />
|
||||
|
||||
<div className="addTime">
|
||||
<Receipt numAccount={student.id_cuenta} />
|
||||
<Receipt numAcount={student.id_cuenta} />
|
||||
</div>
|
||||
</>
|
||||
) : (
|
||||
|
||||
@@ -14,7 +14,7 @@ export default async function Page(props:{
|
||||
}>
|
||||
}) {
|
||||
const params =await props.searchParams;
|
||||
const numAccount = params?.numAcount ? parseInt(params.numAcount) : null;
|
||||
const numAcount = params?.numAcount ? parseInt(params.numAcount) : null;
|
||||
|
||||
let student: any = null;
|
||||
let error: string | null = null;
|
||||
|
||||
@@ -14,12 +14,12 @@ export default async function Page(props: {
|
||||
}>;
|
||||
}) {
|
||||
const params = await props.searchParams;
|
||||
const numAccount = params?.numAcount ? parseInt(params.numAcount) : null;
|
||||
const numAcount = params?.numAcount ? parseInt(params.numAcount) : null;
|
||||
|
||||
let student: any = null;
|
||||
let error: string | null = null;
|
||||
if (numAccount) {
|
||||
const result = await GetStudent(numAccount);
|
||||
if (numAcount) {
|
||||
const result = await GetStudent(numAcount);
|
||||
|
||||
if (result.error) {
|
||||
error = result.error;
|
||||
@@ -50,7 +50,7 @@ export default async function Page(props: {
|
||||
{
|
||||
key: "1",
|
||||
label: "Recibo",
|
||||
content: <Receipt numAccount={student.id_cuenta} />,
|
||||
content: <Receipt numAcount={student.id_cuenta} />,
|
||||
},
|
||||
{
|
||||
key: "2",
|
||||
@@ -58,7 +58,7 @@ export default async function Page(props: {
|
||||
content: (
|
||||
<Impressions
|
||||
costs={[{ value: 1 }, { value: 2 }]}
|
||||
numAccount={student.id_cuenta}
|
||||
numAcount={student.id_cuenta}
|
||||
/>
|
||||
),
|
||||
},
|
||||
@@ -77,7 +77,7 @@ export default async function Page(props: {
|
||||
{ value: 12 },
|
||||
{ value: 14 },
|
||||
]}
|
||||
numAccount={student.id_cuenta}
|
||||
numAcount={student.id_cuenta}
|
||||
/>
|
||||
),
|
||||
},
|
||||
@@ -105,7 +105,7 @@ export default async function Page(props: {
|
||||
{ value: 150 },
|
||||
{ value: 200 },
|
||||
]}
|
||||
numAccount={student.id_cuenta}
|
||||
numAcount={student.id_cuenta}
|
||||
/>
|
||||
),
|
||||
},
|
||||
@@ -115,7 +115,7 @@ export default async function Page(props: {
|
||||
content: (
|
||||
<Impressions
|
||||
costs={[{ value: 1 }, { value: 2 }, { value: 5 }]}
|
||||
numAccount={student.id_cuenta}
|
||||
numAcount={student.id_cuenta}
|
||||
/>
|
||||
),
|
||||
},
|
||||
|
||||
@@ -14,12 +14,12 @@ export default async function Page(props:{
|
||||
}) {
|
||||
|
||||
const params =await props.searchParams;
|
||||
const numAccount = params?.numAcount ? parseInt(params.numAcount) : null;
|
||||
const numAcount = params?.numAcount ? parseInt(params.numAcount) : null;
|
||||
|
||||
let student: any = null;
|
||||
let error: string | null = null;
|
||||
if (numAccount) {
|
||||
const result = await GetStudent(numAccount);
|
||||
if (numAcount) {
|
||||
const result = await GetStudent(numAcount);
|
||||
|
||||
if (result.error) {
|
||||
error = result.error;
|
||||
@@ -45,7 +45,7 @@ export default async function Page(props:{
|
||||
|
||||
<StepNavigator totalSteps={2}>
|
||||
<Selection />
|
||||
<Receipt numAccount={student.id_cuenta}/>
|
||||
<Receipt numAcount={student.id_cuenta}/>
|
||||
</StepNavigator>
|
||||
</>
|
||||
) : (
|
||||
|
||||
@@ -14,10 +14,10 @@ interface CostOption {
|
||||
|
||||
interface ImpressionsProps {
|
||||
costs: CostOption[];
|
||||
numAccount: number | null;
|
||||
numAcount: number | null;
|
||||
}
|
||||
|
||||
function Impressions({ costs, numAccount }: ImpressionsProps) {
|
||||
function Impressions({ costs, numAcount }: ImpressionsProps) {
|
||||
const [pages, setPages] = useState("");
|
||||
const [cost, setCost] = useState("");
|
||||
|
||||
@@ -33,7 +33,7 @@ function Impressions({ costs, numAccount }: ImpressionsProps) {
|
||||
const handlePayment = async () => {
|
||||
setError("");
|
||||
|
||||
if (!numAccount) {
|
||||
if (!numAcount) {
|
||||
setError("Error busca denuevo al estudiante");
|
||||
return;
|
||||
}
|
||||
@@ -49,7 +49,7 @@ function Impressions({ costs, numAccount }: ImpressionsProps) {
|
||||
}
|
||||
|
||||
const result = await PostImpressions({
|
||||
id_cuenta:numAccount,
|
||||
id_cuenta:numAcount,
|
||||
numero_hojas : parseInt(pages),
|
||||
monto: parseInt(cost) * parseInt(pages),
|
||||
});
|
||||
|
||||
@@ -7,10 +7,10 @@ import Cookies from "js-cookie";
|
||||
import "./Receipt.css";
|
||||
|
||||
interface ReceiptsProps {
|
||||
numAccount: number | null;
|
||||
numAcount: number | null;
|
||||
}
|
||||
|
||||
function Receipt({ numAccount }: ReceiptsProps) {
|
||||
function Receipt({ numAcount }: ReceiptsProps) {
|
||||
const [folio, setFolio] = useState("");
|
||||
const [amount, setAmount] = useState("");
|
||||
const [date, setDate] = useState("");
|
||||
@@ -29,7 +29,7 @@ function Receipt({ numAccount }: ReceiptsProps) {
|
||||
//restrict this month//
|
||||
|
||||
const handleSaveReceipt = () => {
|
||||
if (!numAccount) {
|
||||
if (!numAcount) {
|
||||
setError("Error busca denuevo al estudiante");
|
||||
return;
|
||||
}
|
||||
@@ -50,7 +50,7 @@ function Receipt({ numAccount }: ReceiptsProps) {
|
||||
}
|
||||
|
||||
PostReceipt({
|
||||
id_cuenta: numAccount,
|
||||
id_cuenta: numAcount,
|
||||
folio_recibo: folio,
|
||||
monto: Number(amount),
|
||||
fecha_recibo: date,
|
||||
|
||||
@@ -8,14 +8,14 @@ interface urlProp{
|
||||
}
|
||||
|
||||
function SearchUser(url:urlProp) {
|
||||
const [numAccount, setNumAccount] = useState("");
|
||||
const [numAcount, setnumAcount] = useState("");
|
||||
const router = useRouter();
|
||||
|
||||
const handleSubmit = (e: React.FormEvent) => {
|
||||
e.preventDefault();
|
||||
|
||||
if (numAccount) {
|
||||
router.push(`/${url.urlBase}?numAccount=${numAccount}`);
|
||||
if (numAcount) {
|
||||
router.push(`/${url.urlBase}?numAcount=${numAcount}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -27,11 +27,11 @@ function SearchUser(url:urlProp) {
|
||||
<div className="groupInput">
|
||||
<input
|
||||
type="text"
|
||||
value={numAccount}
|
||||
value={numAcount}
|
||||
onChange={(e) => {
|
||||
const value = e.target.value;
|
||||
if (/^\d*$/.test(value) && value.length <= 9) {
|
||||
setNumAccount(value);
|
||||
setnumAcount(value);
|
||||
}
|
||||
}}
|
||||
placeholder="Coloca un número de cuenta..."
|
||||
|
||||
+35
-2
@@ -13,6 +13,7 @@
|
||||
html {
|
||||
box-sizing: border-box;
|
||||
font-size: 62.5%;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
body {
|
||||
@@ -101,7 +102,7 @@ footer p {
|
||||
border-radius: 4px;
|
||||
width: 90%;
|
||||
max-width: 1150px;
|
||||
height: 550px;
|
||||
height: 600px;
|
||||
min-height: 520px;
|
||||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
||||
overflow: hidden;
|
||||
@@ -297,13 +298,14 @@ form {
|
||||
|
||||
.toggleButton {
|
||||
flex: 1;
|
||||
padding: 0.5rem 1rem;
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
border-radius: 4px;
|
||||
transition: background-color 0.3s, color 0.3s;
|
||||
font-weight: 500;
|
||||
overflow-y: hidden;
|
||||
max-height: 60px;
|
||||
}
|
||||
|
||||
.toggleButton.active {
|
||||
@@ -379,6 +381,12 @@ table tr {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
@media(max-width: 1330px) {
|
||||
.mainContainer {
|
||||
grid-template-rows: 60px 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 1300px) {
|
||||
.container {
|
||||
width: 100%;
|
||||
@@ -402,6 +410,10 @@ table tr {
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.mainContainer {
|
||||
grid-template-rows: 40px 1fr;
|
||||
}
|
||||
|
||||
.img {
|
||||
right: 50%;
|
||||
transform: translateX(50%);
|
||||
@@ -447,6 +459,20 @@ table tr {
|
||||
footer p {
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
|
||||
label {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
input,
|
||||
select {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
button {
|
||||
font-size: 1.5rem;
|
||||
padding: 1rem 1.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-height: 960px) {
|
||||
@@ -454,3 +480,10 @@ table tr {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 450px) {
|
||||
.title {
|
||||
max-width: 300px;
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
import axios from "axios";
|
||||
import { envConfig } from "./config";
|
||||
|
||||
export async function GetStudent(numAccount: number) {
|
||||
export async function GetStudent(numAcount: number) {
|
||||
try {
|
||||
const response = await axios.get(`${envConfig.apiUrl}/student/${numAccount}`);
|
||||
const response = await axios.get(`${envConfig.apiUrl}/student/${numAcount}`);
|
||||
console.log(response.data)
|
||||
return response.data;
|
||||
} catch (error: any) {
|
||||
|
||||
Reference in New Issue
Block a user