commit melhorias compras3
tests / ci (push) Canceled after 0s

This commit is contained in:
2026-11-22 10:56:58 +02:00
parent 4fac443dda
commit efd97e265b
130 changed files with 8917 additions and 363 deletions
+32 -1
View File
@@ -1,4 +1,9 @@
import { Head, Link, useForm } from '@inertiajs/react';
import AgreementOrderBindings, {
type OrderAgreementBinding,
type OrderAgreementOption,
type OrderAgreementLine,
} from '@/components/agreement-order-bindings';
import { ComparisonPolicySummary } from '@/components/comparison-policy-summary';
import type { ComparisonPolicy } from '@/components/comparison-policy-summary';
import {
@@ -14,6 +19,10 @@ import { money, roleLabels, date } from '@/types/procurement';
import type { MatrixRow, PurchaseAward } from '@/types/purchase';
type Props = {
agreementOrderLimitsReady?: boolean;
agreementOptions?: OrderAgreementOption[];
agreementLines?: OrderAgreementLine[];
agreementSearch?: string;
requisition: { id: number; number: string };
comparison: {
rows: MatrixRow[];
@@ -37,6 +46,10 @@ export default function Award({
canIssue,
order,
recommendation,
agreementOrderLimitsReady = false,
agreementOptions = [],
agreementLines = [],
agreementSearch = '',
}: Props) {
const selection = useForm({
quotation_id: '',
@@ -45,7 +58,9 @@ export default function Award({
delivery_location: '',
});
const decision = useForm({ decision: 'approved', comment: '' });
const issue = useForm({});
const issue = useForm({
agreement_bindings: [] as OrderAgreementBinding[],
});
return (
<>
<Head title={`Adjudicação · ${requisition.number}`} />
@@ -415,6 +430,22 @@ export default function Award({
description="O servidor revalida a matriz, os conflitos e as aprovações. A ordem emitida mantém um retrato dos dados e não pode ser reescrita."
>
<FormErrors errors={issue.errors} />
{agreementOrderLimitsReady && (
<AgreementOrderBindings
key={requisition.id}
requestId={requisition.id}
lines={agreementLines}
options={agreementOptions}
value={issue.data.agreement_bindings}
onChange={(value) =>
issue.setData(
'agreement_bindings',
value,
)
}
initialSearch={agreementSearch}
/>
)}
<Button
className="mt-4"
disabled={issue.processing}