84 lines
3.3 KiB
TypeScript
84 lines
3.3 KiB
TypeScript
import { Head, Link } from '@inertiajs/react';
|
|
import { PageTitle, Panel } from '@/components/procurement';
|
|
import { Button } from '@/components/ui/button';
|
|
import { money } from '@/types/procurement';
|
|
|
|
type Process = {
|
|
id: number;
|
|
number: string;
|
|
justification: string;
|
|
total_minor: number;
|
|
department: { name: string };
|
|
};
|
|
export default function Quotations({
|
|
requisitions,
|
|
}: {
|
|
requisitions: {
|
|
data: Process[];
|
|
prev_page_url: string | null;
|
|
next_page_url: string | null;
|
|
};
|
|
}) {
|
|
return (
|
|
<>
|
|
<Head title="Cotações" />
|
|
<div className="mx-auto flex w-full max-w-7xl flex-col gap-7 p-5 lg:p-8">
|
|
<PageTitle
|
|
eyebrow="Consulta ao mercado"
|
|
title="Cotações e avaliação"
|
|
description="Requisições aprovadas disponíveis para recolha e comparação de propostas."
|
|
/>
|
|
<Panel title="Processos de compra">
|
|
<div className="divide-y">
|
|
{requisitions.data.map((r) => (
|
|
<div
|
|
className="flex flex-wrap items-center justify-between gap-4 py-5"
|
|
key={r.id}
|
|
>
|
|
<div>
|
|
<strong>
|
|
{r.number} · {r.department.name}
|
|
</strong>
|
|
<p className="mt-1 text-sm text-muted-foreground">
|
|
{r.justification}
|
|
</p>
|
|
<p className="mt-2 text-sm">
|
|
Estimativa com IVA:{' '}
|
|
{money(r.total_minor)}
|
|
</p>
|
|
</div>
|
|
<Button asChild variant="outline">
|
|
<Link
|
|
href={`/requisicoes/${r.id}/cotacoes`}
|
|
>
|
|
Comparar propostas
|
|
</Link>
|
|
</Button>
|
|
</div>
|
|
))}
|
|
</div>
|
|
{!requisitions.data.length && (
|
|
<p className="py-8 text-center text-muted-foreground">
|
|
As requisições surgem aqui depois de todas as
|
|
aprovações.
|
|
</p>
|
|
)}
|
|
<div className="mt-4 flex gap-4">
|
|
{requisitions.prev_page_url && (
|
|
<Link href={requisitions.prev_page_url}>
|
|
Anterior
|
|
</Link>
|
|
)}
|
|
{requisitions.next_page_url && (
|
|
<Link href={requisitions.next_page_url}>
|
|
Seguinte
|
|
</Link>
|
|
)}
|
|
</div>
|
|
</Panel>
|
|
</div>
|
|
</>
|
|
);
|
|
}
|
|
Quotations.layout = { breadcrumbs: [{ title: 'Cotações', href: '/cotacoes' }] };
|