fix(export inv): added the button to exprot data

This commit is contained in:
2025-10-27 07:18:46 -05:00
parent 5eac14062f
commit 6392441f1b
3 changed files with 134 additions and 140 deletions

View File

@@ -0,0 +1,3 @@
export default function MaterialHelperPage() {
return <div>materialHelperPage</div>;
}

View File

@@ -1,3 +1,8 @@
import { useForm } from "@tanstack/react-form";
import axios from "axios";
import { format } from "date-fns";
import { useState } from "react";
import { toast } from "sonner";
import { Button } from "@/components/ui/button"; import { Button } from "@/components/ui/button";
import { import {
Dialog, Dialog,
@@ -11,12 +16,6 @@ import {
import { Input } from "@/components/ui/input"; import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label"; import { Label } from "@/components/ui/label";
import { useForm } from "@tanstack/react-form";
import axios from "axios";
import { format } from "date-fns";
import { useState } from "react";
import { toast } from "sonner";
export default function ExportInventoryData() { export default function ExportInventoryData() {
const [open, setOpen] = useState(false); const [open, setOpen] = useState(false);
const [saving, setSaving] = useState(false); const [saving, setSaving] = useState(false);
@@ -29,10 +28,10 @@ export default function ExportInventoryData() {
setSaving(true); setSaving(true);
try { try {
const res = await axios.get( const res = await axios.get(
`/api/logistics/getcyclecount?age=${value.age}`, `/lst/old/api/logistics/getcyclecount?age=${value.age}`,
{ {
responseType: "blob", responseType: "blob",
} },
); );
const blob = new Blob([res.data], { const blob = new Blob([res.data], {
@@ -80,8 +79,7 @@ export default function ExportInventoryData() {
<DialogHeader> <DialogHeader>
<DialogTitle>Export Inventory lane check</DialogTitle> <DialogTitle>Export Inventory lane check</DialogTitle>
<DialogDescription> <DialogDescription>
Exports all lanes based on the age you enter, except Exports all lanes based on the age you enter, except empty lanes.
empty lanes.
</DialogDescription> </DialogDescription>
</DialogHeader> </DialogHeader>
<form <form
@@ -104,19 +102,13 @@ export default function ExportInventoryData() {
children={(field) => { children={(field) => {
return ( return (
<div className="m-2 min-w-48 max-w-96 p-2 flex flex-row"> <div className="m-2 min-w-48 max-w-96 p-2 flex flex-row">
<Label htmlFor="active"> <Label htmlFor="active">Age</Label>
Age
</Label>
<Input <Input
className="ml-2" className="ml-2"
name={field.name} name={field.name}
onBlur={field.handleBlur} onBlur={field.handleBlur}
type="number" type="number"
onChange={(e) => onChange={(e) => field.handleChange(e.target.value)}
field.handleChange(
e.target.value
)
}
/> />
</div> </div>
); );
@@ -127,9 +119,7 @@ export default function ExportInventoryData() {
<DialogFooter> <DialogFooter>
<div className="flex justify-end mt-2"> <div className="flex justify-end mt-2">
<Button onClick={() => setOpen(false)}> <Button onClick={() => setOpen(false)}>Close</Button>
Close
</Button>
<Button <Button
type="submit" type="submit"
disabled={saving} disabled={saving}

View File

@@ -20,6 +20,7 @@ import { useAuth, useLogout } from "../../../lib/authClient";
import { AddCards } from "./-components/dashboard/AddCards"; import { AddCards } from "./-components/dashboard/AddCards";
import { AppSidebar } from "./-components/layout/lst-sidebar"; import { AppSidebar } from "./-components/layout/lst-sidebar";
import DMButtons from "./-components/logistics/dm/DMButtons"; import DMButtons from "./-components/logistics/dm/DMButtons";
import ExportInventoryData from "./-components/logistics/warehouse/ExportInventoryData";
export const Route = createFileRoute("/_old/old")({ export const Route = createFileRoute("/_old/old")({
component: RouteComponent, component: RouteComponent,
@@ -39,7 +40,7 @@ function RouteComponent() {
{location.pathname === "/lst/app/old" || {location.pathname === "/lst/app/old" ||
(location.pathname === "/lst/app/old/" && ( (location.pathname === "/lst/app/old/" && (
<div className="m-auto pr-2 flex flex-row gap-2"> <div className="m-auto pr-2 flex flex-row gap-2">
{/* <ExportInventoryData /> */} <ExportInventoryData />
<AddCards /> <AddCards />
</div> </div>
))} ))}