This commit is contained in:
IO420
2025-10-03 17:29:53 -06:00
parent f07954eef2
commit 02e06f10bf
6 changed files with 26 additions and 17 deletions
+4 -3
View File
@@ -5,20 +5,21 @@ import Toggle from "@/app/Components/Global/Toggle/Toggle";
export default async function Page(props: { export default async function Page(props: {
searchParams?: Promise<{ searchParams?: Promise<{
key?: string;
numAcount?: string; numAcount?: string;
machine?: string; machine?: string;
}>; }>;
}) { }) {
const params = await props.searchParams; const params = await props.searchParams;
const key = params?.key && params.key;
const numAcount = params?.numAcount ? params.numAcount : null; const numAcount = params?.numAcount ? params.numAcount : null;
return ( return (
<section className="containerSection"> <section className="containerSection">
<h2 className="title">EQUIPOS ACTIVOS Y EN MANTENIMIENTO</h2> <h2 className="title">EQUIPOS ACTIVOS Y EN MANTENIMIENTO</h2>
<Toggle <Toggle
defaultView="Equipos" defaultView={key}
options={[ options={[
{ {
key: "Equipos", key: "Equipos",
@@ -43,7 +44,7 @@ export default async function Page(props: {
label: "Mesas", label: "Mesas",
content: ( content: (
<> <>
<MesasDisponibles/> <MesasDisponibles />
</> </>
), ),
}, },
+4 -2
View File
@@ -4,17 +4,19 @@ import { GetStudent } from "@/app/lib/getStudent";
import CheckBoxEquipo from "@/app/Components/CheckBoxEquipo"; import CheckBoxEquipo from "@/app/Components/CheckBoxEquipo";
import Information from "@/app/Components/Global/Information/information"; import Information from "@/app/Components/Global/Information/information";
import ShowError from "@/app/Components/Global/ShowError";
import "@/app/globals.css"; import "@/app/globals.css";
import ShowError from "@/app/Components/Global/ShowError";
export default async function Page(props: { export default async function Page(props: {
searchParams?: Promise<{ searchParams?: Promise<{
key?:string
numAcount?: string; numAcount?: string;
machine?: string; machine?: string;
}>; }>;
}) { }) {
const params = await props.searchParams; const params = await props.searchParams;
const key = params?.key && params.key;
const numAcount = params?.numAcount ? params.numAcount : null; const numAcount = params?.numAcount ? params.numAcount : null;
const machine = params?.machine ? params.machine : null; const machine = params?.machine ? params.machine : null;
@@ -38,7 +40,7 @@ export default async function Page(props: {
<h2 className="title"> ASIGNACION DE EQUIPOS </h2> <h2 className="title"> ASIGNACION DE EQUIPOS </h2>
<Toggle <Toggle
defaultView="Asignar" defaultView={key}
options={[ options={[
{ {
key: "Asignar", key: "Asignar",
+1 -1
View File
@@ -35,7 +35,7 @@ export default async function Page(props: {
<h2 className="title"> ASIGNACION DE MESAS </h2> <h2 className="title"> ASIGNACION DE MESAS </h2>
<Toggle <Toggle
defaultView="Asignar" defaultView={key}
options={[ options={[
{ {
key: "Asignar", key: "Asignar",
+12 -9
View File
@@ -1,34 +1,37 @@
"use client";
import styles from "./Page.module.css";
import Toggle from "@/app/Components/Global/Toggle/Toggle"; import Toggle from "@/app/Components/Global/Toggle/Toggle";
import SearchDateBetween from "@/app/Components/SearchDateBetween/SearchDateBetween"; import SearchDateBetween from "@/app/Components/SearchDateBetween/SearchDateBetween";
import Porservicio from "@/app/Components/Reportes/porServicio";
import PorServicios from "@/app/Components/Reportes/porServicio"; import PorServicios from "@/app/Components/Reportes/porServicio";
import PorRecibos from "@/app/Components/Reportes/porRecibo"; import PorRecibos from "@/app/Components/Reportes/porRecibo";
export default function Page() { export default async function Page(props: {
searchParams?: Promise<{
key: string;
numAcount: string;
}>;
}) {
const params = await props.searchParams;
const key = params?.key && params.key;
return ( return (
<section className="containerSection"> <section className="containerSection">
<h2 className="title"> REPORTES </h2> <h2 className="title"> REPORTES </h2>
<Toggle <Toggle
defaultView="1" defaultView={key}
options={[ options={[
{ {
key: "1", key: "Por recibo",
label: "Por recibo", label: "Por recibo",
content: ( content: (
<> <>
<SearchDateBetween /> <SearchDateBetween />
<PorServicios /> <PorServicios />
</> </>
), ),
}, },
{ {
key: "2", key: "Por Servicio",
label: "Por Servicio", label: "Por Servicio",
content: ( content: (
<> <>
@@ -61,6 +61,7 @@ function Impressions({ costs, numAcount }: ImpressionsProps) {
setPages(""); setPages("");
setCost(""); setCost("");
toast.success("Impresion cobrada correctamente"); toast.success("Impresion cobrada correctamente");
router.refresh();
}; };
return ( return (
+4 -2
View File
@@ -3,7 +3,7 @@
import toast from "react-hot-toast"; import toast from "react-hot-toast";
import { useState } from "react"; import { useState } from "react";
import { PostReceipt } from "@/app/lib/postReceipt"; import { PostReceipt } from "@/app/lib/postReceipt";
import { useRouter } from "next/navigation"; import { useParams, usePathname, useRouter } from "next/navigation";
import "./Receipt.css"; import "./Receipt.css";
@@ -13,6 +13,8 @@ interface ReceiptsProps {
function Receipt({ numAcount }: ReceiptsProps) { function Receipt({ numAcount }: ReceiptsProps) {
const router = useRouter(); const router = useRouter();
const path = usePathname();
console.log(path);
const [folio, setFolio] = useState(""); const [folio, setFolio] = useState("");
const [amount, setAmount] = useState(""); const [amount, setAmount] = useState("");
@@ -29,7 +31,6 @@ function Receipt({ numAcount }: ReceiptsProps) {
//restrict this month// //restrict this month//
const handleSaveReceipt = async () => { const handleSaveReceipt = async () => {
if (!numAcount) { if (!numAcount) {
toast.error("busca de nuevo al estudiante"); toast.error("busca de nuevo al estudiante");
return; return;
@@ -63,6 +64,7 @@ function Receipt({ numAcount }: ReceiptsProps) {
setDate(""); setDate("");
toast.success("Recibo guardado"); toast.success("Recibo guardado");
router.refresh();
} catch (err: any) { } catch (err: any) {
toast.error(String(err)); toast.error(String(err));
} }