mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-07 13:05:44 +00:00
fix
This commit is contained in:
@@ -3,6 +3,7 @@ import {
|
|||||||
ArrowRight,
|
ArrowRight,
|
||||||
Eye,
|
Eye,
|
||||||
MoreHorizontal,
|
MoreHorizontal,
|
||||||
|
Printer,
|
||||||
RefreshCw,
|
RefreshCw,
|
||||||
Truck,
|
Truck,
|
||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
@@ -313,6 +314,11 @@ const LastMilePage = () => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handlePrintTripSlip = (job: LastMileJob) => {
|
||||||
|
// Placeholder — wire to the trip-slip document service when available.
|
||||||
|
toast({ title: "Printing trip slip", description: job.bookingRef });
|
||||||
|
};
|
||||||
|
|
||||||
const columns = useMemo((): ColumnDef<LastMileJob>[] => {
|
const columns = useMemo((): ColumnDef<LastMileJob>[] => {
|
||||||
const headerClassName = ruleEngineTable.headerCell;
|
const headerClassName = ruleEngineTable.headerCell;
|
||||||
const cellClassName = ruleEngineTable.bodyCell;
|
const cellClassName = ruleEngineTable.bodyCell;
|
||||||
@@ -386,6 +392,9 @@ const LastMilePage = () => {
|
|||||||
cell: ({ row }) => {
|
cell: ({ row }) => {
|
||||||
const isAssigned = row.original.status === "ASSIGNED";
|
const isAssigned = row.original.status === "ASSIGNED";
|
||||||
const nextStatus = NEXT_DELIVERY_STATUS[row.original.deliveryStatus];
|
const nextStatus = NEXT_DELIVERY_STATUS[row.original.deliveryStatus];
|
||||||
|
const canPrintTripSlip =
|
||||||
|
row.original.deliveryStatus === "READY_TO_TRANSIT" ||
|
||||||
|
row.original.deliveryStatus === "DELIVERED";
|
||||||
return (
|
return (
|
||||||
<Group gap={4} justify="flex-end" wrap="nowrap">
|
<Group gap={4} justify="flex-end" wrap="nowrap">
|
||||||
<Menu position="bottom-end" width={200} withinPortal>
|
<Menu position="bottom-end" width={200} withinPortal>
|
||||||
@@ -426,6 +435,14 @@ const LastMilePage = () => {
|
|||||||
>
|
>
|
||||||
View detail
|
View detail
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
|
{canPrintTripSlip && (
|
||||||
|
<Menu.Item
|
||||||
|
leftSection={<Printer size={15} />}
|
||||||
|
onClick={() => handlePrintTripSlip(row.original)}
|
||||||
|
>
|
||||||
|
Print trip slip
|
||||||
|
</Menu.Item>
|
||||||
|
)}
|
||||||
</Menu.Dropdown>
|
</Menu.Dropdown>
|
||||||
</Menu>
|
</Menu>
|
||||||
</Group>
|
</Group>
|
||||||
|
|||||||
Reference in New Issue
Block a user