@burdenoff/microfe-movethewheels 2026.924.2 → 2026.925.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/OrderItemRow.js +195 -109
- package/dist/components/StatusBadge.js +31 -31
- package/dist/constants/index.js +11 -3
- package/dist/generated/wspace-operations.d.ts +7 -0
- package/dist/hooks/useFleet.js +85 -76
- package/dist/hooks/useOrders.js +8 -4
- package/dist/hooks/useTracking.js +127 -66
- package/dist/movethewheels/components/OrderItemRow.d.ts +1 -2
- package/dist/movethewheels/components/StatusBadge.d.ts +3 -1
- package/dist/movethewheels/constants/index.d.ts +1 -0
- package/dist/movethewheels/hooks/useFleet.d.ts +41 -1
- package/dist/movethewheels/hooks/useOrders.d.ts +1 -0
- package/dist/movethewheels/hooks/useTracking.d.ts +2 -2
- package/dist/movethewheels/types/index.d.ts +17 -39
- package/dist/node_modules/lucide-react/dist/esm/icons/sticky-note.js +11 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/user-x.js +30 -0
- package/dist/pages/CreateOrderPage.js +597 -420
- package/dist/pages/DriverDetailsPage.js +702 -421
- package/dist/pages/DriversPage.js +106 -117
- package/dist/pages/FleetPage.js +4 -10
- package/dist/pages/OrderDetailsPage.js +290 -262
- package/dist/pages/OrdersListPage.js +4 -0
- package/dist/pages/RouteDetailsPage.js +264 -252
- package/dist/pages/TrackingPage.js +205 -195
- package/dist/pages/VehicleDetailsPage.js +403 -243
- package/dist/utils/mapMarkers.js +2 -1
- package/package.json +1 -1
- package/src/generated/wspace-operations.ts +10 -3
- package/src/movethewheels/components/OrderItemRow.tsx +162 -99
- package/src/movethewheels/components/StatusBadge.tsx +11 -2
- package/src/movethewheels/constants/index.ts +13 -0
- package/src/movethewheels/hooks/useFleet.ts +163 -44
- package/src/movethewheels/hooks/useOrders.ts +17 -3
- package/src/movethewheels/hooks/useTracking.ts +208 -27
- package/src/movethewheels/pages/CreateOrderPage.tsx +372 -263
- package/src/movethewheels/pages/DriverDetailsPage.tsx +516 -156
- package/src/movethewheels/pages/DriversPage.tsx +28 -11
- package/src/movethewheels/pages/FleetPage.tsx +7 -10
- package/src/movethewheels/pages/OrderDetailsPage.tsx +67 -30
- package/src/movethewheels/pages/OrdersListPage.tsx +1 -0
- package/src/movethewheels/pages/RouteDetailsPage.tsx +15 -7
- package/src/movethewheels/pages/TrackingPage.tsx +44 -14
- package/src/movethewheels/pages/VehicleDetailsPage.tsx +137 -15
- package/src/movethewheels/types/index.ts +17 -38
- package/src/movethewheels/utils/mapMarkers.ts +1 -0
- package/src/operations/wspace/movethewheels/queries/dashboard.graphql +5 -0
- package/src/operations/wspace/movethewheels/queries/logistics.graphql +2 -2
|
@@ -10,30 +10,31 @@ import { MapPin as r } from "../node_modules/lucide-react/dist/esm/icons/map-pin
|
|
|
10
10
|
import { Package as i } from "../node_modules/lucide-react/dist/esm/icons/package.js";
|
|
11
11
|
import { Phone as ae } from "../node_modules/lucide-react/dist/esm/icons/phone.js";
|
|
12
12
|
import { Printer as a } from "../node_modules/lucide-react/dist/esm/icons/printer.js";
|
|
13
|
+
import { Search as oe } from "../node_modules/lucide-react/dist/esm/icons/search.js";
|
|
13
14
|
import { SquarePen as o } from "../node_modules/lucide-react/dist/esm/icons/square-pen.js";
|
|
14
|
-
import { Truck as
|
|
15
|
-
import { UserCheck as
|
|
16
|
-
import { User as
|
|
17
|
-
import { joinPath as
|
|
18
|
-
import { useMoveTheWheels as
|
|
19
|
-
import { useOrder as
|
|
20
|
-
import { useDriver as
|
|
21
|
-
import { Badge as
|
|
22
|
-
import { ErrorState as
|
|
23
|
-
import { PaymentStatusBadge as
|
|
24
|
-
import { FormError as
|
|
25
|
-
import { Notice as
|
|
26
|
-
import { formatAddress as
|
|
27
|
-
import { DocumentsCard as
|
|
28
|
-
import { useDebouncedValue as
|
|
29
|
-
import { EntityCombobox as
|
|
30
|
-
import { ProofOfDeliveryCard as
|
|
31
|
-
import { useEffect as
|
|
32
|
-
import { useParams as
|
|
33
|
-
import { Fragment as
|
|
34
|
-
import { EmphasisPanel as
|
|
15
|
+
import { Truck as se } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
|
|
16
|
+
import { UserCheck as ce } from "../node_modules/lucide-react/dist/esm/icons/user-check.js";
|
|
17
|
+
import { User as le } from "../node_modules/lucide-react/dist/esm/icons/user.js";
|
|
18
|
+
import { joinPath as s } from "../utils/navigation.js";
|
|
19
|
+
import { useMoveTheWheels as ue } from "../providers/MoveTheWheelsProvider.js";
|
|
20
|
+
import { useOrder as de, useOrders as fe } from "../hooks/useOrders.js";
|
|
21
|
+
import { useDriver as pe, useDrivers as me, useVehicle as he, useVehicles as ge } from "../hooks/useFleet.js";
|
|
22
|
+
import { Badge as c, Button as l, Card as u, CardContent as d, CardHeader as f, CardTitle as p, Input as _e, Label as m, Separator as h, Table as ve, TableBody as ye, TableCell as g, TableHead as _, TableHeader as be, TableRow as v } from "../components/ui.js";
|
|
23
|
+
import { ErrorState as xe, LoadingState as Se, PageLayout as Ce } from "../components/PageLayout.js";
|
|
24
|
+
import { PaymentStatusBadge as we, PriorityBadge as Te, StatusBadge as y } from "../components/StatusBadge.js";
|
|
25
|
+
import { FormError as Ee } from "../components/FormError.js";
|
|
26
|
+
import { Notice as De, useNotice as Oe } from "../components/Notice.js";
|
|
27
|
+
import { formatAddress as b, formatCurrency as x, formatDate as S } from "../utils/formatters.js";
|
|
28
|
+
import { DocumentsCard as ke } from "../components/DocumentsCard.js";
|
|
29
|
+
import { useDebouncedValue as Ae } from "../hooks/useDebouncedValue.js";
|
|
30
|
+
import { EntityCombobox as C } from "../components/EntityCombobox.js";
|
|
31
|
+
import { ProofOfDeliveryCard as je } from "../components/ProofOfDeliveryCard.js";
|
|
32
|
+
import { useEffect as w, useState as T } from "react";
|
|
33
|
+
import { useParams as Me } from "react-router";
|
|
34
|
+
import { Fragment as E, jsx as D, jsxs as O } from "react/jsx-runtime";
|
|
35
|
+
import { EmphasisPanel as Ne, NextSteps as Pe, PagePurpose as Fe } from "@burdenoff/fe-libs/ui";
|
|
35
36
|
//#region src/movethewheels/pages/OrderDetailsPage.tsx
|
|
36
|
-
var
|
|
37
|
+
var k = [
|
|
37
38
|
"pending",
|
|
38
39
|
"confirmed",
|
|
39
40
|
"assigned",
|
|
@@ -41,7 +42,7 @@ var A = [
|
|
|
41
42
|
"in_transit",
|
|
42
43
|
"out_for_delivery",
|
|
43
44
|
"delivered"
|
|
44
|
-
],
|
|
45
|
+
], A = {
|
|
45
46
|
pending: "Pending",
|
|
46
47
|
confirmed: "Confirmed",
|
|
47
48
|
assigned: "Assigned",
|
|
@@ -49,261 +50,279 @@ var A = [
|
|
|
49
50
|
in_transit: "In Transit",
|
|
50
51
|
out_for_delivery: "Out for Delivery",
|
|
51
52
|
delivered: "Delivered",
|
|
53
|
+
returned: "Returned",
|
|
52
54
|
cancelled: "Cancelled",
|
|
53
55
|
failed: "Failed"
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
}, j = new Set([
|
|
57
|
+
"delivered",
|
|
58
|
+
"returned",
|
|
59
|
+
"cancelled",
|
|
60
|
+
"failed"
|
|
61
|
+
]);
|
|
62
|
+
function Ie(e) {
|
|
63
|
+
let t = k.indexOf(e);
|
|
64
|
+
return t === -1 || t >= k.length - 1 ? null : k[t + 1];
|
|
58
65
|
}
|
|
59
66
|
function M() {
|
|
60
|
-
let { orderId:
|
|
67
|
+
let { orderId: k } = Me(), { basePath: M, navigate: N } = ue(), { order: P, isLoading: Le, error: Re, refetch: F } = de(k), { updateOrder: ze, updateOrderStatus: I } = fe(), [L, Be] = T(""), [R, z] = T(""), [B, V] = T(""), [H, U] = T(!1), [W, G] = T(!1), [K, q] = T(null), J = Ae(L), { vehicles: Y, isLoading: X } = ge({
|
|
61
68
|
limit: 20,
|
|
62
|
-
search:
|
|
63
|
-
driverId:
|
|
64
|
-
}), { drivers:
|
|
69
|
+
search: J || void 0,
|
|
70
|
+
driverId: B || void 0
|
|
71
|
+
}), { drivers: Z, isLoading: Q } = me({
|
|
65
72
|
limit: 20,
|
|
66
|
-
search:
|
|
67
|
-
vehicleId:
|
|
68
|
-
}), { vehicle:
|
|
69
|
-
|
|
70
|
-
!
|
|
73
|
+
search: J || void 0,
|
|
74
|
+
vehicleId: R || void 0
|
|
75
|
+
}), { vehicle: Ve, isLoading: He } = he(R || void 0), { driver: Ue, isLoading: We } = pe(B || void 0), { message: Ge, notify: Ke } = Oe(), qe = Y.filter((e) => e.status === "available" || e.id === P?.vehicleId), Je = Z.filter((e) => e.status === "available" || e.id === P?.driverId);
|
|
76
|
+
w(() => {
|
|
77
|
+
!Q && B && !Z.some((e) => e.id === B) && V("");
|
|
71
78
|
}, [
|
|
72
|
-
X,
|
|
73
79
|
Z,
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
80
|
+
Q,
|
|
81
|
+
B
|
|
82
|
+
]), w(() => {
|
|
83
|
+
!X && R && !Y.some((e) => e.id === R) && z("");
|
|
77
84
|
}, [
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
85
|
+
R,
|
|
86
|
+
Y,
|
|
87
|
+
X
|
|
81
88
|
]);
|
|
82
|
-
let
|
|
83
|
-
if (!
|
|
84
|
-
|
|
89
|
+
let Ye = async () => {
|
|
90
|
+
if (!k || !P) {
|
|
91
|
+
q("This order is no longer available. Refresh and try again.");
|
|
85
92
|
return;
|
|
86
93
|
}
|
|
87
|
-
|
|
94
|
+
let e = R || P.vehicleId, t = B || P.driverId;
|
|
95
|
+
if (!e || !t) {
|
|
96
|
+
q("Select both a compatible vehicle and driver before dispatching.");
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
let n = !!(P.vehicleId && P.driverId);
|
|
100
|
+
U(!0), q(null);
|
|
88
101
|
try {
|
|
89
|
-
await
|
|
90
|
-
vehicleId:
|
|
91
|
-
driverId:
|
|
92
|
-
}),
|
|
102
|
+
await ze(k, {
|
|
103
|
+
vehicleId: e,
|
|
104
|
+
driverId: t
|
|
105
|
+
}), !n && P.status === "confirmed" && await I(k, "assigned"), Ke(!n && P.status === "confirmed" ? "Fleet assigned and order advanced to Assigned." : "Assignment updated."), z(""), V(""), F();
|
|
93
106
|
} catch (e) {
|
|
94
|
-
|
|
107
|
+
q(e instanceof Error ? e.message : "Failed to update assignment.");
|
|
95
108
|
} finally {
|
|
96
|
-
|
|
109
|
+
U(!1);
|
|
97
110
|
}
|
|
98
|
-
},
|
|
99
|
-
if (
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
111
|
+
}, Xe = async (e, t) => {
|
|
112
|
+
if (!(!k || !P)) {
|
|
113
|
+
if (e === "assigned" && (!P.vehicleId || !P.driverId)) {
|
|
114
|
+
q("Assign both a compatible vehicle and driver before advancing to Assigned.");
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
if (!j.has(P.status)) {
|
|
118
|
+
G(!0), q(null);
|
|
119
|
+
try {
|
|
120
|
+
await I(k, e), Ke(t), F();
|
|
121
|
+
} catch (e) {
|
|
122
|
+
q(e instanceof Error ? e.message : "Failed to update status.");
|
|
123
|
+
} finally {
|
|
124
|
+
G(!1);
|
|
125
|
+
}
|
|
107
126
|
}
|
|
108
127
|
}
|
|
109
128
|
}, $ = (e) => {
|
|
110
|
-
N && N(
|
|
129
|
+
N && N(s(M, e));
|
|
111
130
|
};
|
|
112
|
-
return
|
|
131
|
+
return Le ? /* @__PURE__ */ D(Se, { message: "Loading order details..." }) : Re || !P ? /* @__PURE__ */ D(xe, {
|
|
113
132
|
title: "Order not found",
|
|
114
133
|
message: "The order you're looking for doesn't exist or has been removed.",
|
|
115
134
|
onRetry: F
|
|
116
|
-
}) : /* @__PURE__ */
|
|
135
|
+
}) : /* @__PURE__ */ O(Ce, {
|
|
117
136
|
title: P.orderNumber,
|
|
118
|
-
subtitle: `Created ${
|
|
119
|
-
icon: /* @__PURE__ */
|
|
120
|
-
headerActions: /* @__PURE__ */
|
|
137
|
+
subtitle: `Created ${S(P.createdAt, "full")}`,
|
|
138
|
+
icon: /* @__PURE__ */ D(i, { size: 24 }),
|
|
139
|
+
headerActions: /* @__PURE__ */ O("div", {
|
|
121
140
|
className: "flex gap-2",
|
|
122
141
|
children: [
|
|
123
|
-
/* @__PURE__ */
|
|
142
|
+
/* @__PURE__ */ O(l, {
|
|
124
143
|
variant: "outline",
|
|
125
144
|
onClick: () => {
|
|
126
|
-
N && N(
|
|
145
|
+
N && N(s(M, "orders"));
|
|
127
146
|
},
|
|
128
|
-
children: [/* @__PURE__ */
|
|
147
|
+
children: [/* @__PURE__ */ D(e, { size: 16 }), "Back"]
|
|
129
148
|
}),
|
|
130
|
-
/* @__PURE__ */
|
|
149
|
+
/* @__PURE__ */ O(l, {
|
|
131
150
|
variant: "outline",
|
|
132
151
|
onClick: () => window.print(),
|
|
133
|
-
children: [/* @__PURE__ */
|
|
152
|
+
children: [/* @__PURE__ */ D(a, { size: 16 }), "Print"]
|
|
134
153
|
}),
|
|
135
|
-
/* @__PURE__ */
|
|
136
|
-
onClick: () => $(`orders/${
|
|
137
|
-
children: [/* @__PURE__ */
|
|
154
|
+
/* @__PURE__ */ O(l, {
|
|
155
|
+
onClick: () => $(`orders/${k}/edit`),
|
|
156
|
+
children: [/* @__PURE__ */ D(o, { size: 16 }), "Edit"]
|
|
138
157
|
})
|
|
139
158
|
]
|
|
140
159
|
}),
|
|
141
|
-
headerContent: /* @__PURE__ */
|
|
160
|
+
headerContent: /* @__PURE__ */ O("div", {
|
|
142
161
|
className: "flex flex-wrap gap-2",
|
|
143
162
|
children: [
|
|
144
|
-
/* @__PURE__ */
|
|
163
|
+
/* @__PURE__ */ D(y, {
|
|
145
164
|
status: P.status,
|
|
146
165
|
type: "order"
|
|
147
166
|
}),
|
|
148
|
-
/* @__PURE__ */
|
|
149
|
-
/* @__PURE__ */
|
|
167
|
+
/* @__PURE__ */ D(Te, { priority: P.priority }),
|
|
168
|
+
/* @__PURE__ */ D(we, { status: P.pricing.paymentStatus })
|
|
150
169
|
]
|
|
151
170
|
}),
|
|
152
171
|
children: [
|
|
153
|
-
/* @__PURE__ */
|
|
154
|
-
icon: /* @__PURE__ */
|
|
172
|
+
/* @__PURE__ */ D(Fe, {
|
|
173
|
+
icon: /* @__PURE__ */ D(i, { size: 18 }),
|
|
155
174
|
children: "Everything about this one delivery in a single place — who it's for, where it's going, what's inside, the running cost and the full status history. Use this page to review the order, hand it to a driver, print the docket, or jump into live tracking."
|
|
156
175
|
}),
|
|
157
|
-
/* @__PURE__ */
|
|
176
|
+
/* @__PURE__ */ D(Pe, {
|
|
158
177
|
storageKey: "movethewheels-order-details",
|
|
159
178
|
steps: [
|
|
160
179
|
{
|
|
161
180
|
id: "track",
|
|
162
181
|
label: "Track this order live",
|
|
163
182
|
description: "See where the shipment is right now on the map.",
|
|
164
|
-
icon: /* @__PURE__ */
|
|
183
|
+
icon: /* @__PURE__ */ D(r, { size: 16 }),
|
|
165
184
|
onClick: () => $(`tracking?order=${P.id}`)
|
|
166
185
|
},
|
|
167
186
|
{
|
|
168
187
|
id: "edit",
|
|
169
188
|
label: "Edit order details",
|
|
170
189
|
description: "Update items, addresses or instructions before dispatch.",
|
|
171
|
-
icon: /* @__PURE__ */
|
|
172
|
-
onClick: () => $(`orders/${
|
|
190
|
+
icon: /* @__PURE__ */ D(o, { size: 16 }),
|
|
191
|
+
onClick: () => $(`orders/${k}/edit`)
|
|
173
192
|
},
|
|
174
193
|
{
|
|
175
194
|
id: "print",
|
|
176
195
|
label: "Print the delivery docket",
|
|
177
196
|
description: "Generate a printable copy for the driver or warehouse.",
|
|
178
|
-
icon: /* @__PURE__ */
|
|
197
|
+
icon: /* @__PURE__ */ D(a, { size: 16 }),
|
|
179
198
|
onClick: () => window.print()
|
|
180
199
|
}
|
|
181
200
|
]
|
|
182
201
|
}),
|
|
183
|
-
/* @__PURE__ */
|
|
202
|
+
/* @__PURE__ */ O("div", {
|
|
184
203
|
className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
|
|
185
|
-
children: [/* @__PURE__ */
|
|
204
|
+
children: [/* @__PURE__ */ O("div", {
|
|
186
205
|
className: "lg:col-span-2 space-y-6",
|
|
187
206
|
children: [
|
|
188
|
-
/* @__PURE__ */
|
|
207
|
+
/* @__PURE__ */ O(u, { children: [/* @__PURE__ */ D(f, { children: /* @__PURE__ */ O(p, {
|
|
189
208
|
className: "flex items-center gap-2",
|
|
190
|
-
children: [/* @__PURE__ */
|
|
191
|
-
}) }), /* @__PURE__ */
|
|
209
|
+
children: [/* @__PURE__ */ D(le, { size: 18 }), "Customer Information"]
|
|
210
|
+
}) }), /* @__PURE__ */ D(d, { children: /* @__PURE__ */ O("div", {
|
|
192
211
|
className: "grid grid-cols-1 md:grid-cols-2 gap-6",
|
|
193
|
-
children: [/* @__PURE__ */
|
|
194
|
-
/* @__PURE__ */
|
|
212
|
+
children: [/* @__PURE__ */ O("div", { children: [
|
|
213
|
+
/* @__PURE__ */ D("h4", {
|
|
195
214
|
className: "font-medium mb-2",
|
|
196
215
|
children: P.customerInfo.name
|
|
197
216
|
}),
|
|
198
|
-
P.customerInfo.company && /* @__PURE__ */
|
|
217
|
+
P.customerInfo.company && /* @__PURE__ */ D("p", {
|
|
199
218
|
className: "text-sm text-text-secondary mb-2",
|
|
200
219
|
children: P.customerInfo.company
|
|
201
220
|
}),
|
|
202
|
-
/* @__PURE__ */
|
|
221
|
+
/* @__PURE__ */ O("div", {
|
|
203
222
|
className: "space-y-1 text-sm",
|
|
204
|
-
children: [/* @__PURE__ */
|
|
223
|
+
children: [/* @__PURE__ */ O("p", {
|
|
205
224
|
className: "flex items-center gap-2",
|
|
206
|
-
children: [/* @__PURE__ */
|
|
225
|
+
children: [/* @__PURE__ */ D(ie, {
|
|
207
226
|
size: 14,
|
|
208
227
|
className: "text-text-secondary"
|
|
209
228
|
}), P.customerInfo.email]
|
|
210
|
-
}), /* @__PURE__ */
|
|
229
|
+
}), /* @__PURE__ */ O("p", {
|
|
211
230
|
className: "flex items-center gap-2",
|
|
212
|
-
children: [/* @__PURE__ */
|
|
231
|
+
children: [/* @__PURE__ */ D(ae, {
|
|
213
232
|
size: 14,
|
|
214
233
|
className: "text-text-secondary"
|
|
215
234
|
}), P.customerInfo.phone]
|
|
216
235
|
})]
|
|
217
236
|
})
|
|
218
|
-
] }), /* @__PURE__ */
|
|
237
|
+
] }), /* @__PURE__ */ O("div", { children: [P.customerInfo.preferredDeliveryTime && /* @__PURE__ */ O("div", {
|
|
219
238
|
className: "mb-2",
|
|
220
|
-
children: [/* @__PURE__ */
|
|
239
|
+
children: [/* @__PURE__ */ D("p", {
|
|
221
240
|
className: "text-sm text-text-secondary",
|
|
222
241
|
children: "Preferred Delivery Time"
|
|
223
|
-
}), /* @__PURE__ */
|
|
242
|
+
}), /* @__PURE__ */ D("p", {
|
|
224
243
|
className: "text-sm",
|
|
225
244
|
children: P.customerInfo.preferredDeliveryTime
|
|
226
245
|
})]
|
|
227
|
-
}), P.customerInfo.deliveryInstructions && /* @__PURE__ */
|
|
246
|
+
}), P.customerInfo.deliveryInstructions && /* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("p", {
|
|
228
247
|
className: "text-sm text-text-secondary",
|
|
229
248
|
children: "Delivery Instructions"
|
|
230
|
-
}), /* @__PURE__ */
|
|
249
|
+
}), /* @__PURE__ */ D("p", {
|
|
231
250
|
className: "text-sm",
|
|
232
251
|
children: P.customerInfo.deliveryInstructions
|
|
233
252
|
})] })] })]
|
|
234
253
|
}) })] }),
|
|
235
|
-
/* @__PURE__ */
|
|
254
|
+
/* @__PURE__ */ O(u, { children: [/* @__PURE__ */ D(f, { children: /* @__PURE__ */ O(p, {
|
|
236
255
|
className: "flex items-center gap-2",
|
|
237
|
-
children: [/* @__PURE__ */
|
|
238
|
-
}) }), /* @__PURE__ */
|
|
256
|
+
children: [/* @__PURE__ */ D(r, { size: 18 }), "Addresses"]
|
|
257
|
+
}) }), /* @__PURE__ */ D(d, { children: /* @__PURE__ */ O("div", {
|
|
239
258
|
className: "grid grid-cols-1 md:grid-cols-2 gap-6",
|
|
240
|
-
children: [/* @__PURE__ */
|
|
241
|
-
/* @__PURE__ */
|
|
259
|
+
children: [/* @__PURE__ */ O("div", { children: [
|
|
260
|
+
/* @__PURE__ */ D("h4", {
|
|
242
261
|
className: "font-medium mb-2 flex items-center gap-2",
|
|
243
|
-
children: /* @__PURE__ */
|
|
262
|
+
children: /* @__PURE__ */ D(c, {
|
|
244
263
|
variant: "outline",
|
|
245
264
|
children: "Pickup"
|
|
246
265
|
})
|
|
247
266
|
}),
|
|
248
|
-
/* @__PURE__ */
|
|
267
|
+
/* @__PURE__ */ D("p", {
|
|
249
268
|
className: "text-sm",
|
|
250
|
-
children:
|
|
269
|
+
children: b(P.pickupAddress)
|
|
251
270
|
}),
|
|
252
|
-
P.scheduledPickup && /* @__PURE__ */
|
|
271
|
+
P.scheduledPickup && /* @__PURE__ */ O("p", {
|
|
253
272
|
className: "text-sm text-text-secondary mt-2",
|
|
254
|
-
children: ["Scheduled: ",
|
|
273
|
+
children: ["Scheduled: ", S(P.scheduledPickup, "full")]
|
|
255
274
|
}),
|
|
256
|
-
P.actualPickup && /* @__PURE__ */
|
|
275
|
+
P.actualPickup && /* @__PURE__ */ O("p", {
|
|
257
276
|
className: "text-sm text-status-success-text mt-1",
|
|
258
277
|
children: [
|
|
259
|
-
/* @__PURE__ */
|
|
278
|
+
/* @__PURE__ */ D(n, {
|
|
260
279
|
size: 14,
|
|
261
280
|
className: "inline mr-1"
|
|
262
281
|
}),
|
|
263
282
|
"Picked up: ",
|
|
264
|
-
|
|
283
|
+
S(P.actualPickup, "full")
|
|
265
284
|
]
|
|
266
285
|
})
|
|
267
|
-
] }), /* @__PURE__ */
|
|
268
|
-
/* @__PURE__ */
|
|
286
|
+
] }), /* @__PURE__ */ O("div", { children: [
|
|
287
|
+
/* @__PURE__ */ D("h4", {
|
|
269
288
|
className: "font-medium mb-2 flex items-center gap-2",
|
|
270
|
-
children: /* @__PURE__ */
|
|
289
|
+
children: /* @__PURE__ */ D(c, {
|
|
271
290
|
variant: "outline",
|
|
272
291
|
children: "Delivery"
|
|
273
292
|
})
|
|
274
293
|
}),
|
|
275
|
-
/* @__PURE__ */
|
|
294
|
+
/* @__PURE__ */ D("p", {
|
|
276
295
|
className: "text-sm",
|
|
277
|
-
children:
|
|
296
|
+
children: b(P.deliveryAddress)
|
|
278
297
|
}),
|
|
279
|
-
P.scheduledDelivery && /* @__PURE__ */
|
|
298
|
+
P.scheduledDelivery && /* @__PURE__ */ O("p", {
|
|
280
299
|
className: "text-sm text-text-secondary mt-2",
|
|
281
|
-
children: ["Scheduled: ",
|
|
300
|
+
children: ["Scheduled: ", S(P.scheduledDelivery, "full")]
|
|
282
301
|
}),
|
|
283
|
-
P.actualDelivery && /* @__PURE__ */
|
|
302
|
+
P.actualDelivery && /* @__PURE__ */ O("p", {
|
|
284
303
|
className: "text-sm text-status-success-text mt-1",
|
|
285
304
|
children: [
|
|
286
|
-
/* @__PURE__ */
|
|
305
|
+
/* @__PURE__ */ D(n, {
|
|
287
306
|
size: 14,
|
|
288
307
|
className: "inline mr-1"
|
|
289
308
|
}),
|
|
290
309
|
"Delivered: ",
|
|
291
|
-
|
|
310
|
+
S(P.actualDelivery, "full")
|
|
292
311
|
]
|
|
293
312
|
})
|
|
294
313
|
] })]
|
|
295
314
|
}) })] }),
|
|
296
|
-
/* @__PURE__ */
|
|
315
|
+
/* @__PURE__ */ O(u, { children: [/* @__PURE__ */ D(f, { children: /* @__PURE__ */ O(p, {
|
|
297
316
|
className: "flex items-center gap-2",
|
|
298
|
-
children: [/* @__PURE__ */
|
|
299
|
-
}) }), /* @__PURE__ */
|
|
317
|
+
children: [/* @__PURE__ */ D(se, { size: 18 }), "Saved Route"]
|
|
318
|
+
}) }), /* @__PURE__ */ D(d, { children: P.route ? /* @__PURE__ */ O("div", {
|
|
300
319
|
className: "space-y-3",
|
|
301
|
-
children: [/* @__PURE__ */
|
|
320
|
+
children: [/* @__PURE__ */ O("div", {
|
|
302
321
|
className: "flex items-center justify-between gap-3",
|
|
303
|
-
children: [/* @__PURE__ */
|
|
322
|
+
children: [/* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("p", {
|
|
304
323
|
className: "font-medium",
|
|
305
324
|
children: P.route.name
|
|
306
|
-
}), /* @__PURE__ */
|
|
325
|
+
}), /* @__PURE__ */ O("p", {
|
|
307
326
|
className: "text-sm text-text-secondary",
|
|
308
327
|
children: [
|
|
309
328
|
P.route.stops.length,
|
|
@@ -311,112 +330,112 @@ function M() {
|
|
|
311
330
|
" ",
|
|
312
331
|
P.route.status.replace("_", " ").toLowerCase()
|
|
313
332
|
]
|
|
314
|
-
})] }), /* @__PURE__ */
|
|
333
|
+
})] }), /* @__PURE__ */ D(c, {
|
|
315
334
|
variant: "outline",
|
|
316
335
|
children: "Reusable route"
|
|
317
336
|
})]
|
|
318
|
-
}), /* @__PURE__ */
|
|
337
|
+
}), /* @__PURE__ */ D("div", {
|
|
319
338
|
className: "space-y-2",
|
|
320
|
-
children: P.route.stops.map((e, t) => /* @__PURE__ */
|
|
339
|
+
children: P.route.stops.map((e, t) => /* @__PURE__ */ O("div", {
|
|
321
340
|
className: "flex items-start gap-2 text-sm",
|
|
322
|
-
children: [/* @__PURE__ */
|
|
341
|
+
children: [/* @__PURE__ */ O("span", {
|
|
323
342
|
className: "text-text-secondary",
|
|
324
343
|
children: [t + 1, "."]
|
|
325
|
-
}), /* @__PURE__ */
|
|
326
|
-
/* @__PURE__ */
|
|
344
|
+
}), /* @__PURE__ */ O("span", { children: [
|
|
345
|
+
/* @__PURE__ */ D("span", {
|
|
327
346
|
className: "font-medium capitalize",
|
|
328
347
|
children: e.type
|
|
329
348
|
}),
|
|
330
349
|
" ·",
|
|
331
350
|
" ",
|
|
332
|
-
|
|
351
|
+
b(e.address)
|
|
333
352
|
] })]
|
|
334
353
|
}, e.id))
|
|
335
354
|
})]
|
|
336
|
-
}) : /* @__PURE__ */
|
|
355
|
+
}) : /* @__PURE__ */ D("p", {
|
|
337
356
|
className: "text-sm text-text-secondary",
|
|
338
357
|
children: "No saved route was selected for this order."
|
|
339
358
|
}) })] }),
|
|
340
|
-
/* @__PURE__ */
|
|
359
|
+
/* @__PURE__ */ O(u, { children: [/* @__PURE__ */ D(f, { children: /* @__PURE__ */ O(p, {
|
|
341
360
|
className: "flex items-center gap-2",
|
|
342
361
|
children: [
|
|
343
|
-
/* @__PURE__ */
|
|
362
|
+
/* @__PURE__ */ D(i, { size: 18 }),
|
|
344
363
|
"Order Items (",
|
|
345
364
|
P.items.length,
|
|
346
365
|
")"
|
|
347
366
|
]
|
|
348
|
-
}) }), /* @__PURE__ */
|
|
367
|
+
}) }), /* @__PURE__ */ D(d, {
|
|
349
368
|
className: "p-0",
|
|
350
|
-
children: /* @__PURE__ */
|
|
351
|
-
/* @__PURE__ */
|
|
352
|
-
/* @__PURE__ */
|
|
353
|
-
/* @__PURE__ */
|
|
369
|
+
children: /* @__PURE__ */ O(ve, { children: [/* @__PURE__ */ D(be, { children: /* @__PURE__ */ O(v, { children: [
|
|
370
|
+
/* @__PURE__ */ D(_, { children: "Item" }),
|
|
371
|
+
/* @__PURE__ */ D(_, { children: "SKU" }),
|
|
372
|
+
/* @__PURE__ */ D(_, {
|
|
354
373
|
className: "text-center",
|
|
355
374
|
children: "Qty"
|
|
356
375
|
}),
|
|
357
|
-
/* @__PURE__ */
|
|
376
|
+
/* @__PURE__ */ D(_, {
|
|
358
377
|
className: "text-right",
|
|
359
378
|
children: "Unit Price"
|
|
360
379
|
}),
|
|
361
|
-
/* @__PURE__ */
|
|
380
|
+
/* @__PURE__ */ D(_, {
|
|
362
381
|
className: "text-right",
|
|
363
382
|
children: "Total"
|
|
364
383
|
})
|
|
365
|
-
] }) }), /* @__PURE__ */
|
|
366
|
-
/* @__PURE__ */
|
|
384
|
+
] }) }), /* @__PURE__ */ D(ye, { children: P.items.map((e) => /* @__PURE__ */ O(v, { children: [
|
|
385
|
+
/* @__PURE__ */ D(g, { children: /* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("p", {
|
|
367
386
|
className: "font-medium",
|
|
368
387
|
children: e.name
|
|
369
|
-
}), e.description && /* @__PURE__ */
|
|
388
|
+
}), e.description && /* @__PURE__ */ D("p", {
|
|
370
389
|
className: "text-sm text-text-secondary",
|
|
371
390
|
children: e.description
|
|
372
391
|
})] }) }),
|
|
373
|
-
/* @__PURE__ */
|
|
392
|
+
/* @__PURE__ */ D(g, {
|
|
374
393
|
className: "font-mono text-sm",
|
|
375
394
|
children: e.sku
|
|
376
395
|
}),
|
|
377
|
-
/* @__PURE__ */
|
|
396
|
+
/* @__PURE__ */ D(g, {
|
|
378
397
|
className: "text-center",
|
|
379
398
|
children: e.quantity
|
|
380
399
|
}),
|
|
381
|
-
/* @__PURE__ */
|
|
400
|
+
/* @__PURE__ */ D(g, {
|
|
382
401
|
className: "text-right",
|
|
383
|
-
children:
|
|
402
|
+
children: x(e.value)
|
|
384
403
|
}),
|
|
385
|
-
/* @__PURE__ */
|
|
404
|
+
/* @__PURE__ */ D(g, {
|
|
386
405
|
className: "text-right font-medium",
|
|
387
|
-
children:
|
|
406
|
+
children: x(e.value * e.quantity)
|
|
388
407
|
})
|
|
389
408
|
] }, e.id)) })] })
|
|
390
409
|
})] }),
|
|
391
|
-
/* @__PURE__ */
|
|
410
|
+
/* @__PURE__ */ O(u, { children: [/* @__PURE__ */ D(f, { children: /* @__PURE__ */ O(p, {
|
|
392
411
|
className: "flex items-center gap-2",
|
|
393
|
-
children: [/* @__PURE__ */
|
|
394
|
-
}) }), /* @__PURE__ */
|
|
412
|
+
children: [/* @__PURE__ */ D(te, { size: 18 }), "Order Timeline"]
|
|
413
|
+
}) }), /* @__PURE__ */ D(d, { children: /* @__PURE__ */ D("div", {
|
|
395
414
|
className: "relative",
|
|
396
|
-
children: P.timeline.map((e, t) => /* @__PURE__ */
|
|
415
|
+
children: P.timeline.map((e, t) => /* @__PURE__ */ O("div", {
|
|
397
416
|
className: "flex gap-4 pb-6 last:pb-0",
|
|
398
|
-
children: [/* @__PURE__ */
|
|
417
|
+
children: [/* @__PURE__ */ O("div", {
|
|
399
418
|
className: "relative",
|
|
400
|
-
children: [/* @__PURE__ */
|
|
401
|
-
}), /* @__PURE__ */
|
|
419
|
+
children: [/* @__PURE__ */ D("div", { className: "w-3 h-3 rounded-full bg-action-primary-bg mt-1.5" }), t < P.timeline.length - 1 && /* @__PURE__ */ D("div", { className: "absolute top-4 left-1.5 w-px h-full -ml-px bg-border" })]
|
|
420
|
+
}), /* @__PURE__ */ O("div", {
|
|
402
421
|
className: "flex-1",
|
|
403
422
|
children: [
|
|
404
|
-
/* @__PURE__ */
|
|
423
|
+
/* @__PURE__ */ O("div", {
|
|
405
424
|
className: "flex items-center gap-2 mb-1",
|
|
406
|
-
children: [/* @__PURE__ */
|
|
425
|
+
children: [/* @__PURE__ */ D(y, {
|
|
407
426
|
status: e.status,
|
|
408
427
|
type: "order",
|
|
409
428
|
size: "sm"
|
|
410
|
-
}), /* @__PURE__ */
|
|
429
|
+
}), /* @__PURE__ */ D("span", {
|
|
411
430
|
className: "text-sm text-text-secondary",
|
|
412
|
-
children:
|
|
431
|
+
children: S(e.timestamp, "full")
|
|
413
432
|
})]
|
|
414
433
|
}),
|
|
415
|
-
e.notes && /* @__PURE__ */
|
|
434
|
+
e.notes && /* @__PURE__ */ D("p", {
|
|
416
435
|
className: "text-sm",
|
|
417
436
|
children: e.notes
|
|
418
437
|
}),
|
|
419
|
-
/* @__PURE__ */
|
|
438
|
+
/* @__PURE__ */ O("p", {
|
|
420
439
|
className: "text-xs text-text-secondary",
|
|
421
440
|
children: ["by ", e.performedBy]
|
|
422
441
|
})
|
|
@@ -425,212 +444,221 @@ function M() {
|
|
|
425
444
|
}, t))
|
|
426
445
|
}) })] })
|
|
427
446
|
]
|
|
428
|
-
}), /* @__PURE__ */
|
|
447
|
+
}), /* @__PURE__ */ O("div", {
|
|
429
448
|
className: "space-y-6",
|
|
430
449
|
children: [
|
|
431
|
-
/* @__PURE__ */
|
|
450
|
+
/* @__PURE__ */ O(Ne, { children: [/* @__PURE__ */ O("h2", {
|
|
432
451
|
className: "flex items-center gap-2 text-base font-semibold text-text-primary mb-4",
|
|
433
|
-
children: [/* @__PURE__ */
|
|
434
|
-
}), /* @__PURE__ */
|
|
452
|
+
children: [/* @__PURE__ */ D(ne, { size: 18 }), "Order Summary"]
|
|
453
|
+
}), /* @__PURE__ */ O("div", {
|
|
435
454
|
className: "space-y-3",
|
|
436
455
|
children: [
|
|
437
|
-
/* @__PURE__ */
|
|
456
|
+
/* @__PURE__ */ O("div", {
|
|
438
457
|
className: "flex justify-between text-sm",
|
|
439
|
-
children: [/* @__PURE__ */
|
|
458
|
+
children: [/* @__PURE__ */ D("span", {
|
|
440
459
|
className: "text-text-secondary",
|
|
441
460
|
children: "Subtotal"
|
|
442
|
-
}), /* @__PURE__ */
|
|
461
|
+
}), /* @__PURE__ */ D("span", { children: x(P.pricing.subtotal) })]
|
|
443
462
|
}),
|
|
444
|
-
/* @__PURE__ */
|
|
463
|
+
/* @__PURE__ */ O("div", {
|
|
445
464
|
className: "flex justify-between text-sm",
|
|
446
|
-
children: [/* @__PURE__ */
|
|
465
|
+
children: [/* @__PURE__ */ D("span", {
|
|
447
466
|
className: "text-text-secondary",
|
|
448
467
|
children: "Delivery"
|
|
449
|
-
}), /* @__PURE__ */
|
|
468
|
+
}), /* @__PURE__ */ D("span", { children: x(P.pricing.fees.delivery) })]
|
|
450
469
|
}),
|
|
451
|
-
/* @__PURE__ */
|
|
470
|
+
/* @__PURE__ */ O("div", {
|
|
452
471
|
className: "flex justify-between text-sm",
|
|
453
|
-
children: [/* @__PURE__ */
|
|
472
|
+
children: [/* @__PURE__ */ D("span", {
|
|
454
473
|
className: "text-text-secondary",
|
|
455
474
|
children: "Handling"
|
|
456
|
-
}), /* @__PURE__ */
|
|
475
|
+
}), /* @__PURE__ */ D("span", { children: x(P.pricing.fees.handling) })]
|
|
457
476
|
}),
|
|
458
|
-
P.pricing.fees.insurance && /* @__PURE__ */
|
|
477
|
+
P.pricing.fees.insurance && /* @__PURE__ */ O("div", {
|
|
459
478
|
className: "flex justify-between text-sm",
|
|
460
|
-
children: [/* @__PURE__ */
|
|
479
|
+
children: [/* @__PURE__ */ D("span", {
|
|
461
480
|
className: "text-text-secondary",
|
|
462
481
|
children: "Insurance"
|
|
463
|
-
}), /* @__PURE__ */
|
|
482
|
+
}), /* @__PURE__ */ D("span", { children: x(P.pricing.fees.insurance) })]
|
|
464
483
|
}),
|
|
465
|
-
/* @__PURE__ */
|
|
484
|
+
/* @__PURE__ */ O("div", {
|
|
466
485
|
className: "flex justify-between text-sm",
|
|
467
|
-
children: [/* @__PURE__ */
|
|
486
|
+
children: [/* @__PURE__ */ D("span", {
|
|
468
487
|
className: "text-text-secondary",
|
|
469
488
|
children: "Taxes"
|
|
470
|
-
}), /* @__PURE__ */
|
|
489
|
+
}), /* @__PURE__ */ D("span", { children: x(P.pricing.taxes) })]
|
|
471
490
|
}),
|
|
472
|
-
/* @__PURE__ */
|
|
473
|
-
/* @__PURE__ */
|
|
491
|
+
/* @__PURE__ */ D(h, {}),
|
|
492
|
+
/* @__PURE__ */ O("div", {
|
|
474
493
|
className: "flex justify-between font-medium",
|
|
475
|
-
children: [/* @__PURE__ */
|
|
494
|
+
children: [/* @__PURE__ */ D("span", { children: "Total" }), /* @__PURE__ */ D("span", {
|
|
476
495
|
className: "text-lg",
|
|
477
|
-
children:
|
|
496
|
+
children: x(P.pricing.total)
|
|
478
497
|
})]
|
|
479
498
|
}),
|
|
480
|
-
/* @__PURE__ */
|
|
499
|
+
/* @__PURE__ */ O("div", {
|
|
481
500
|
className: "pt-2",
|
|
482
|
-
children: [/* @__PURE__ */
|
|
501
|
+
children: [/* @__PURE__ */ D("p", {
|
|
483
502
|
className: "text-sm text-text-secondary",
|
|
484
503
|
children: "Payment Method"
|
|
485
|
-
}), /* @__PURE__ */
|
|
504
|
+
}), /* @__PURE__ */ D("p", {
|
|
486
505
|
className: "text-sm capitalize",
|
|
487
506
|
children: P.pricing.paymentMethod.replace("_", " ")
|
|
488
507
|
})]
|
|
489
508
|
})
|
|
490
509
|
]
|
|
491
510
|
})] }),
|
|
492
|
-
/* @__PURE__ */
|
|
511
|
+
/* @__PURE__ */ O(u, { children: [/* @__PURE__ */ D(f, { children: /* @__PURE__ */ O(p, {
|
|
493
512
|
className: "flex items-center gap-2",
|
|
494
|
-
children: [/* @__PURE__ */
|
|
495
|
-
}) }), /* @__PURE__ */
|
|
513
|
+
children: [/* @__PURE__ */ D(se, { size: 18 }), "Assignment"]
|
|
514
|
+
}) }), /* @__PURE__ */ D(d, { children: /* @__PURE__ */ O("div", {
|
|
496
515
|
className: "space-y-4",
|
|
497
516
|
children: [
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
/* @__PURE__ */
|
|
517
|
+
K && /* @__PURE__ */ D(Ee, { message: K }),
|
|
518
|
+
Ge && /* @__PURE__ */ D(De, { message: Ge }),
|
|
519
|
+
/* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("p", {
|
|
501
520
|
className: "text-sm text-text-secondary",
|
|
502
521
|
children: "Tracking Number"
|
|
503
|
-
}), /* @__PURE__ */
|
|
522
|
+
}), /* @__PURE__ */ D("p", {
|
|
504
523
|
className: "text-sm font-mono",
|
|
505
524
|
children: P.trackingNumber || "—"
|
|
506
525
|
})] }),
|
|
507
|
-
/* @__PURE__ */
|
|
508
|
-
/* @__PURE__ */
|
|
526
|
+
/* @__PURE__ */ D(h, {}),
|
|
527
|
+
/* @__PURE__ */ O("div", {
|
|
509
528
|
className: "space-y-3",
|
|
510
529
|
children: [
|
|
511
|
-
/* @__PURE__ */
|
|
530
|
+
/* @__PURE__ */ O("div", {
|
|
512
531
|
className: "space-y-1.5",
|
|
513
|
-
children: [/* @__PURE__ */
|
|
532
|
+
children: [/* @__PURE__ */ D(m, {
|
|
514
533
|
htmlFor: "assign-fleet-search",
|
|
515
|
-
children: "Search
|
|
516
|
-
}), /* @__PURE__ */ O(
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
534
|
+
children: "Search vehicles & drivers"
|
|
535
|
+
}), /* @__PURE__ */ O("div", {
|
|
536
|
+
className: "relative",
|
|
537
|
+
children: [/* @__PURE__ */ D(oe, { className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary" }), /* @__PURE__ */ D(_e, {
|
|
538
|
+
id: "assign-fleet-search",
|
|
539
|
+
value: L,
|
|
540
|
+
onChange: (e) => Be(e.target.value),
|
|
541
|
+
placeholder: "Vehicle number, driver name or employee ID",
|
|
542
|
+
className: "pl-9"
|
|
543
|
+
})]
|
|
521
544
|
})]
|
|
522
545
|
}),
|
|
523
|
-
/* @__PURE__ */
|
|
546
|
+
/* @__PURE__ */ O("div", {
|
|
524
547
|
className: "space-y-1.5",
|
|
525
|
-
children: [/* @__PURE__ */
|
|
548
|
+
children: [/* @__PURE__ */ D(m, {
|
|
526
549
|
htmlFor: "assign-vehicle",
|
|
527
550
|
children: "Vehicle"
|
|
528
|
-
}), /* @__PURE__ */
|
|
551
|
+
}), /* @__PURE__ */ D(C, {
|
|
529
552
|
id: "assign-vehicle",
|
|
530
|
-
value:
|
|
531
|
-
onChange:
|
|
532
|
-
options:
|
|
533
|
-
loading:
|
|
553
|
+
value: R,
|
|
554
|
+
onChange: z,
|
|
555
|
+
options: qe,
|
|
556
|
+
loading: X,
|
|
534
557
|
getId: (e) => e.id,
|
|
535
558
|
getLabel: (e) => `${e.vehicleNumber} (${e.type})`,
|
|
536
|
-
renderOption: (e) => /* @__PURE__ */
|
|
559
|
+
renderOption: (e) => /* @__PURE__ */ O(E, { children: [
|
|
537
560
|
e.vehicleNumber,
|
|
538
561
|
" (",
|
|
539
562
|
e.type,
|
|
540
563
|
")"
|
|
541
564
|
] }),
|
|
542
|
-
selectedOption:
|
|
543
|
-
selectedLoading:
|
|
565
|
+
selectedOption: Ve,
|
|
566
|
+
selectedLoading: He,
|
|
544
567
|
required: !0,
|
|
545
568
|
placeholder: P.vehicleId ? `Current: ${P.vehicleId}` : "Select a vehicle",
|
|
546
569
|
emptyText: "No available vehicles."
|
|
547
570
|
})]
|
|
548
571
|
}),
|
|
549
|
-
/* @__PURE__ */
|
|
572
|
+
/* @__PURE__ */ O("div", {
|
|
550
573
|
className: "space-y-1.5",
|
|
551
|
-
children: [/* @__PURE__ */
|
|
574
|
+
children: [/* @__PURE__ */ D(m, {
|
|
552
575
|
htmlFor: "assign-driver",
|
|
553
576
|
children: "Driver"
|
|
554
|
-
}), /* @__PURE__ */
|
|
577
|
+
}), /* @__PURE__ */ D(C, {
|
|
555
578
|
id: "assign-driver",
|
|
556
|
-
value:
|
|
557
|
-
onChange:
|
|
558
|
-
options:
|
|
559
|
-
loading:
|
|
579
|
+
value: B,
|
|
580
|
+
onChange: V,
|
|
581
|
+
options: Je,
|
|
582
|
+
loading: Q,
|
|
560
583
|
getId: (e) => e.id,
|
|
561
584
|
getLabel: (e) => `${e.fullName} (${e.employeeId})`,
|
|
562
|
-
renderOption: (e) => /* @__PURE__ */
|
|
585
|
+
renderOption: (e) => /* @__PURE__ */ O(E, { children: [
|
|
563
586
|
e.fullName,
|
|
564
587
|
" (",
|
|
565
588
|
e.employeeId,
|
|
566
589
|
")"
|
|
567
590
|
] }),
|
|
568
|
-
selectedOption:
|
|
569
|
-
selectedLoading:
|
|
591
|
+
selectedOption: Ue,
|
|
592
|
+
selectedLoading: We,
|
|
570
593
|
required: !0,
|
|
571
594
|
placeholder: P.driverId ? `Current: ${P.driverId}` : "Select a driver",
|
|
572
595
|
emptyText: "No available drivers."
|
|
573
596
|
})]
|
|
574
597
|
}),
|
|
575
|
-
/* @__PURE__ */
|
|
598
|
+
/* @__PURE__ */ O(l, {
|
|
576
599
|
className: "w-full",
|
|
577
|
-
onClick:
|
|
578
|
-
disabled:
|
|
579
|
-
children: [/* @__PURE__ */
|
|
600
|
+
onClick: Ye,
|
|
601
|
+
disabled: H || !R && !B,
|
|
602
|
+
children: [/* @__PURE__ */ D(ce, { size: 16 }), H ? "Assigning…" : "Assign driver & vehicle"]
|
|
580
603
|
})
|
|
581
604
|
]
|
|
582
605
|
}),
|
|
583
|
-
/* @__PURE__ */
|
|
584
|
-
/* @__PURE__ */
|
|
606
|
+
/* @__PURE__ */ D(h, {}),
|
|
607
|
+
/* @__PURE__ */ O("div", {
|
|
585
608
|
className: "space-y-2",
|
|
586
609
|
children: [
|
|
587
|
-
/* @__PURE__ */
|
|
610
|
+
/* @__PURE__ */ O("p", {
|
|
588
611
|
className: "text-sm text-text-secondary",
|
|
589
612
|
children: [
|
|
590
613
|
"Current status:",
|
|
591
614
|
" ",
|
|
592
|
-
/* @__PURE__ */
|
|
615
|
+
/* @__PURE__ */ D("span", {
|
|
593
616
|
className: "font-medium",
|
|
594
|
-
children:
|
|
617
|
+
children: A[P.status]
|
|
595
618
|
})
|
|
596
619
|
]
|
|
597
620
|
}),
|
|
598
621
|
(() => {
|
|
599
|
-
let e =
|
|
600
|
-
|
|
622
|
+
let e = Ie(P.status);
|
|
623
|
+
if (!e) return null;
|
|
624
|
+
let n = e === "assigned" && (!P.vehicleId || !P.driverId);
|
|
625
|
+
return /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ O(l, {
|
|
601
626
|
variant: "outline",
|
|
602
627
|
className: "w-full",
|
|
603
|
-
onClick: () =>
|
|
604
|
-
disabled:
|
|
605
|
-
children: [/* @__PURE__ */
|
|
606
|
-
})
|
|
628
|
+
onClick: () => Xe(e, `Order advanced to ${A[e]}.`),
|
|
629
|
+
disabled: W || n,
|
|
630
|
+
children: [/* @__PURE__ */ D(t, { size: 16 }), W ? "Updating…" : `Advance to ${A[e]}`]
|
|
631
|
+
}), n && /* @__PURE__ */ D("p", {
|
|
632
|
+
className: "text-xs text-text-secondary",
|
|
633
|
+
children: "Assign both a compatible vehicle and driver before dispatching this order."
|
|
634
|
+
})] });
|
|
607
635
|
})(),
|
|
608
|
-
P.status !== "cancelled" && P.status
|
|
636
|
+
P.status !== "cancelled" && !j.has(P.status) && /* @__PURE__ */ O(l, {
|
|
609
637
|
variant: "outline",
|
|
610
638
|
className: "w-full text-status-error-text",
|
|
611
|
-
onClick: () =>
|
|
612
|
-
disabled:
|
|
613
|
-
children: [/* @__PURE__ */
|
|
639
|
+
onClick: () => Xe("cancelled", "Order cancelled."),
|
|
640
|
+
disabled: W,
|
|
641
|
+
children: [/* @__PURE__ */ D(ee, { size: 16 }), "Cancel order"]
|
|
614
642
|
})
|
|
615
643
|
]
|
|
616
644
|
}),
|
|
617
|
-
/* @__PURE__ */
|
|
645
|
+
/* @__PURE__ */ O(l, {
|
|
618
646
|
variant: "outline",
|
|
619
647
|
className: "w-full",
|
|
620
648
|
onClick: () => $(`tracking?order=${P.id}`),
|
|
621
|
-
children: [/* @__PURE__ */
|
|
649
|
+
children: [/* @__PURE__ */ D(r, { size: 16 }), "Track Order"]
|
|
622
650
|
})
|
|
623
651
|
]
|
|
624
652
|
}) })] }),
|
|
625
|
-
/* @__PURE__ */
|
|
653
|
+
/* @__PURE__ */ D(ke, {
|
|
626
654
|
entityType: "order",
|
|
627
655
|
entityId: P.id
|
|
628
656
|
}),
|
|
629
|
-
/* @__PURE__ */
|
|
630
|
-
P.specialInstructions && /* @__PURE__ */
|
|
657
|
+
/* @__PURE__ */ D(je, { deliveryJobId: P.id }),
|
|
658
|
+
P.specialInstructions && /* @__PURE__ */ O(u, { children: [/* @__PURE__ */ D(f, { children: /* @__PURE__ */ O(p, {
|
|
631
659
|
className: "flex items-center gap-2",
|
|
632
|
-
children: [/* @__PURE__ */
|
|
633
|
-
}) }), /* @__PURE__ */
|
|
660
|
+
children: [/* @__PURE__ */ D(re, { size: 18 }), "Special Instructions"]
|
|
661
|
+
}) }), /* @__PURE__ */ D(d, { children: /* @__PURE__ */ D("p", {
|
|
634
662
|
className: "text-sm",
|
|
635
663
|
children: P.specialInstructions
|
|
636
664
|
}) })] })
|