This commit is contained in:
natib21
2026-07-04 02:45:10 +00:00
parent 2e31fd12e1
commit 8b20924ba8
2 changed files with 20 additions and 10 deletions

View File

@@ -20,6 +20,7 @@ import type { ColumnDef } from "@edr/ui-common";
import { DataTable, DataTableFooter, usePagination } from "@edr/ui-common";
import {
ActionIcon,
Autocomplete,
Badge,
Box,
Button,
@@ -1307,17 +1308,21 @@ const FirstMilePage = () => {
clearable
disabled={assignVehicleOptions.length === 0}
/>
<TextInput
<Autocomplete
style={{ flex: 1 }}
label={i === 0 ? "Container no." : undefined}
placeholder="Container number"
data={(activeRecord ? bookingContainerNumbers(activeRecord) : []).filter(
(n) =>
n === row.containerNumber ||
!vehicleRows.some((r, idx) => idx !== i && r.containerNumber === n),
)}
value={row.containerNumber}
onChange={(e) => {
const value = e.currentTarget.value;
onChange={(value) =>
setVehicleRows((prev) =>
prev.map((x, idx) => (idx === i ? { ...x, containerNumber: value } : x)),
);
}}
)
}
/>
{vehicleRows.length > 1 && (
<ActionIcon

View File

@@ -19,6 +19,7 @@ import { DataTable, DataTableFooter, usePagination } from "@edr/ui-common";
import {
ActionIcon,
Alert,
Autocomplete,
Badge,
Box,
Button,
@@ -1666,17 +1667,21 @@ const LastMilePage = () => {
clearable
disabled={assignVehicleOptions.length === 0}
/>
<TextInput
<Autocomplete
style={{ flex: 1 }}
label={i === 0 ? "Container no." : undefined}
placeholder="Container number"
data={(activeRecord ? bookingContainerNumbers(activeRecord) : []).filter(
(n) =>
n === row.containerNumber ||
!vehicleRows.some((r, idx) => idx !== i && r.containerNumber === n),
)}
value={row.containerNumber}
onChange={(e) => {
const value = e.currentTarget.value;
onChange={(value) =>
setVehicleRows((prev) =>
prev.map((x, idx) => (idx === i ? { ...x, containerNumber: value } : x)),
);
}}
)
}
/>
{vehicleRows.length > 1 && (
<ActionIcon