mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-08 05:25:41 +00:00
Merge pull request #459 from Tria-plc/CutomerTruckAssign
Cutomer truck assign Fields: Truck Plate Number, Driver Name, Truck Type, Container Number to Load (now the Select I just wired) → Verify & Submit Assignment.
This commit is contained in:
@@ -38,6 +38,11 @@ export function CustomerTruckAssignmentCard({
|
||||
);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
|
||||
// Physical container numbers on this booking — the customer picks which one to
|
||||
// load onto the truck instead of typing it. Falls back to free entry when the
|
||||
// booking has no container numbers recorded.
|
||||
const containerOptions = booking.containerNumbers ?? [];
|
||||
|
||||
const assignMutation = useMutation(api.bookings.assignCustomerTruck.mutationOptions());
|
||||
const downloadMutation = useMutation(api.bookings.downloadCustomerTruckFreightOrder.mutationOptions());
|
||||
|
||||
@@ -120,13 +125,27 @@ export function CustomerTruckAssignmentCard({
|
||||
onChange={(value) => setTruckType(value ?? "")}
|
||||
disabled={assigned}
|
||||
/>
|
||||
<TextInput
|
||||
label="Container Number to Load"
|
||||
required
|
||||
value={containerNumberToLoad}
|
||||
onChange={(e) => setContainerNumberToLoad(e.currentTarget.value.toUpperCase())}
|
||||
readOnly={assigned}
|
||||
/>
|
||||
{containerOptions.length > 0 ? (
|
||||
<Select
|
||||
label="Container Number to Load"
|
||||
required
|
||||
placeholder="Select a container from this booking"
|
||||
data={containerOptions}
|
||||
value={containerNumberToLoad || null}
|
||||
onChange={(value) => setContainerNumberToLoad(value ?? "")}
|
||||
searchable
|
||||
disabled={assigned}
|
||||
nothingFoundMessage="No matching container"
|
||||
/>
|
||||
) : (
|
||||
<TextInput
|
||||
label="Container Number to Load"
|
||||
required
|
||||
value={containerNumberToLoad}
|
||||
onChange={(e) => setContainerNumberToLoad(e.currentTarget.value.toUpperCase())}
|
||||
readOnly={assigned}
|
||||
/>
|
||||
)}
|
||||
</SimpleGrid>
|
||||
|
||||
<Group justify="flex-end">
|
||||
|
||||
Reference in New Issue
Block a user