@flowselections/floriday-afhandeling-module 1.0.100 → 1.0.102
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-lib/components/afhandeling/AutoProcessStatus.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/AutoProcessStatus.js +3 -2
- package/dist-lib/components/afhandeling/AutoSendStatus.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/AutoSendStatus.js +4 -5
- package/dist-lib/components/afhandeling/CapacityWarning.js +1 -1
- package/dist-lib/components/afhandeling/ControlePage.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/ControlePage.js +59 -46
- package/dist-lib/components/afhandeling/DagDetailDialog.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/DagDetailDialog.js +27 -11
- package/dist-lib/components/afhandeling/LeveringenPage.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/LeveringenPage.js +105 -6
- package/dist-lib/components/afhandeling/NuVersturenButton.d.ts +1 -0
- package/dist-lib/components/afhandeling/NuVersturenButton.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/NuVersturenButton.js +3 -7
- package/dist-lib/components/afhandeling/PickAgendaView.d.ts +7 -1
- package/dist-lib/components/afhandeling/PickAgendaView.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/PickAgendaView.js +39 -22
- package/dist-lib/components/afhandeling/PickingPage.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/PickingPage.js +3 -2
- package/dist-lib/components/afhandeling/PlanningAgendaPage.d.ts +2 -0
- package/dist-lib/components/afhandeling/PlanningAgendaPage.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/PlanningAgendaPage.js +15 -3
- package/dist-lib/components/afhandeling/ScanControleView.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/ScanControleView.js +2 -1
- package/dist-lib/components/afhandeling/ServiceAreaSelect.js +2 -2
- package/dist-lib/components/afhandeling/VervoerdersPage.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/VervoerdersPage.js +69 -19
- package/dist-lib/components/afhandeling/VerzetOrderDialog.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/VerzetOrderDialog.js +2 -1
- package/dist-lib/components/afhandeling/WeekAgendaView.d.ts +21 -1
- package/dist-lib/components/afhandeling/WeekAgendaView.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/WeekAgendaView.js +39 -30
- package/dist-lib/components/fs-ui/DataTable.d.ts +29 -7
- package/dist-lib/components/fs-ui/DataTable.d.ts.map +1 -1
- package/dist-lib/components/fs-ui/DataTable.js +36 -11
- package/dist-lib/components/fs-ui/FilterChips.d.ts +9 -2
- package/dist-lib/components/fs-ui/FilterChips.d.ts.map +1 -1
- package/dist-lib/components/fs-ui/FilterChips.js +8 -4
- package/dist-lib/components/fs-ui/FilterPanel.d.ts +19 -0
- package/dist-lib/components/fs-ui/FilterPanel.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/FilterPanel.js +14 -0
- package/dist-lib/components/fs-ui/InlineAlert.d.ts +8 -2
- package/dist-lib/components/fs-ui/InlineAlert.d.ts.map +1 -1
- package/dist-lib/components/fs-ui/InlineAlert.js +19 -7
- package/dist-lib/components/fs-ui/KpiRow.js +1 -1
- package/dist-lib/components/fs-ui/PageHeader.d.ts +8 -2
- package/dist-lib/components/fs-ui/PageHeader.d.ts.map +1 -1
- package/dist-lib/components/fs-ui/PageHeader.js +7 -3
- package/dist-lib/components/fs-ui/PeriodPicker.d.ts +10 -0
- package/dist-lib/components/fs-ui/PeriodPicker.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/PeriodPicker.js +7 -0
- package/dist-lib/components/fs-ui/PillTabs.d.ts +4 -2
- package/dist-lib/components/fs-ui/PillTabs.d.ts.map +1 -1
- package/dist-lib/components/fs-ui/PillTabs.js +25 -10
- package/dist-lib/components/fs-ui/SearchInput.d.ts +1 -1
- package/dist-lib/components/fs-ui/SearchInput.d.ts.map +1 -1
- package/dist-lib/components/fs-ui/SearchInput.js +16 -9
- package/dist-lib/components/fs-ui/Toolbar.d.ts +6 -1
- package/dist-lib/components/fs-ui/Toolbar.d.ts.map +1 -1
- package/dist-lib/components/fs-ui/Toolbar.js +8 -2
- package/dist-lib/components/fs-ui/UpdatedAt.d.ts +7 -2
- package/dist-lib/components/fs-ui/UpdatedAt.d.ts.map +1 -1
- package/dist-lib/components/fs-ui/UpdatedAt.js +9 -4
- package/dist-lib/components/settings/AutomatischVersturenCard.d.ts +6 -0
- package/dist-lib/components/settings/AutomatischVersturenCard.d.ts.map +1 -0
- package/dist-lib/components/settings/AutomatischVersturenCard.js +54 -0
- package/dist-lib/hooks/useOrderPlanning.d.ts +1 -0
- package/dist-lib/hooks/useOrderPlanning.d.ts.map +1 -1
- package/dist-lib/hooks/useOrderPlanning.js +2 -0
- package/dist-lib/integrations/supabase/types.d.ts +85 -0
- package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
- package/dist-lib/lib/dateLabels.d.ts +9 -0
- package/dist-lib/lib/dateLabels.d.ts.map +1 -0
- package/dist-lib/lib/dateLabels.js +45 -0
- package/dist-lib/lib/labels.d.ts +80 -0
- package/dist-lib/lib/labels.d.ts.map +1 -0
- package/dist-lib/lib/labels.js +87 -0
- package/dist-lib/lib/labels.test.d.ts +2 -0
- package/dist-lib/lib/labels.test.d.ts.map +1 -0
- package/dist-lib/lib/labels.test.js +21 -0
- package/dist-lib/moduleDefinition.d.ts.map +1 -1
- package/dist-lib/moduleDefinition.js +2 -0
- package/package.json +1 -1
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
1
2
|
import type { FloridayOrder } from "../../lib/floriday.functions.js";
|
|
2
3
|
export interface PickAgendaViewProps {
|
|
3
4
|
onOrderClick?: (order: FloridayOrder) => void;
|
|
5
|
+
/** Laat de pagina de kop tekenen met de periodekiezer en "Bijgewerkt". */
|
|
6
|
+
header?: (p: {
|
|
7
|
+
updatedAt: number | null;
|
|
8
|
+
period: ReactNode;
|
|
9
|
+
}) => ReactNode;
|
|
4
10
|
}
|
|
5
|
-
export declare function PickAgendaView({ onOrderClick }: PickAgendaViewProps): import("react").JSX.Element;
|
|
11
|
+
export declare function PickAgendaView({ onOrderClick, header }: PickAgendaViewProps): import("react").JSX.Element;
|
|
6
12
|
//# sourceMappingURL=PickAgendaView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PickAgendaView.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/PickAgendaView.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PickAgendaView.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/PickAgendaView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAgBvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAElE,MAAM,WAAW,mBAAmB;IAClC,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC9C,0EAA0E;IAC1E,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE;QAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,MAAM,EAAE,SAAS,CAAA;KAAE,KAAK,SAAS,CAAC;CAC5E;AAUD,wBAAgB,cAAc,CAAC,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,mBAAmB,+BA+G3E"}
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
import { jsxs as _jsxs,
|
|
2
|
-
import { useMemo, useState } from "react";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useMemo, useState } from "react";
|
|
3
|
+
import { fmtDayTime } from "../../lib/dateLabels.js";
|
|
4
|
+
import { AlertTriangle, CheckCircle2, Clock, List, Package, ShoppingCart, Truck } from "lucide-react";
|
|
5
|
+
import { KpiRow } from "../fs-ui/KpiRow.js";
|
|
6
|
+
import { KpiTile } from "../fs-ui/KpiTile.js";
|
|
7
|
+
import { InlineAlert, NoticeStack } from "../fs-ui/InlineAlert.js";
|
|
8
|
+
import { PillTabs } from "../fs-ui/PillTabs.js";
|
|
9
|
+
import { PeriodPicker } from "../fs-ui/PeriodPicker.js";
|
|
10
|
+
import { weekLabel } from "../../lib/dateLabels.js";
|
|
11
|
+
import { addDays, startOfWeek } from "../../lib/pickDate.js";
|
|
3
12
|
import { Button } from "@flowselections/core";
|
|
4
13
|
import { WeekAgendaView } from "./WeekAgendaView.js";
|
|
5
14
|
import { DagDetailDialog } from "./DagDetailDialog.js";
|
|
@@ -12,32 +21,40 @@ function refsOf(items) {
|
|
|
12
21
|
const all = items.map((p) => p.order.orderNumber || p.order.id).filter(Boolean);
|
|
13
22
|
return { shown: all.slice(0, MAX_REFS), total: all.length };
|
|
14
23
|
}
|
|
15
|
-
function
|
|
16
|
-
const { shown, total } = refsOf(items);
|
|
17
|
-
if (!total)
|
|
18
|
-
return null;
|
|
19
|
-
return (_jsxs("div", { children: [label(total), ": ", shown.join(", "), total > shown.length ? ` en ${total - shown.length} meer` : "", "."] }));
|
|
20
|
-
}
|
|
21
|
-
export function PickAgendaView({ onOrderClick }) {
|
|
24
|
+
export function PickAgendaView({ onOrderClick, header }) {
|
|
22
25
|
const [weekStart, setWeekStart] = useState(() => currentWeekStart());
|
|
23
26
|
const range = useMemo(() => agendaRange(weekStart), [weekStart]);
|
|
24
|
-
const { planned, awaiting, tasksWithoutStart, nearestDeliveryDate, signalError, lastEngineRun, isLoading, error, warning, refetch, } = useOrderPlanning(range);
|
|
27
|
+
const { planned, awaiting, tasksWithoutStart, nearestDeliveryDate, signalError, lastEngineRun, isLoading, error, warning, refetch, dataUpdatedAt, } = useOrderPlanning(range);
|
|
25
28
|
const awaitingCount = awaiting.length;
|
|
26
29
|
const anyIssue = awaitingCount + tasksWithoutStart.length > 0;
|
|
27
30
|
const vestigingTz = useVestigingTijdzone().data ?? null;
|
|
28
31
|
const lastRunLabel = lastEngineRun && vestigingTz
|
|
29
|
-
? new Date(
|
|
30
|
-
timeZone: vestigingTz,
|
|
31
|
-
dateStyle: "short",
|
|
32
|
-
timeStyle: "short",
|
|
33
|
-
})
|
|
32
|
+
? fmtDayTime(lastEngineRun, new Date(), vestigingTz)
|
|
34
33
|
: null;
|
|
35
34
|
const [dayDetailDate, setDayDetailDate] = useState(null);
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
35
|
+
const [tab, setTab] = useState("alle");
|
|
36
|
+
const [totals, setTotals] = useState({ leveringen: 0, verzendklaar: 0, voorbereiding: 0, totaalStuks: 0, afgehandeld: 0, nietAfgemeld: 0, karren: 0 });
|
|
37
|
+
const onTotals = useCallback((t) => setTotals(t), []);
|
|
38
|
+
const isCurrent = startOfWeek(weekStart).getTime() === startOfWeek(currentWeekStart()).getTime();
|
|
39
|
+
const refsText = (items) => {
|
|
40
|
+
const { shown, total } = refsOf(items);
|
|
41
|
+
return shown.join(", ") + (total > shown.length ? ` en ${total - shown.length} meer` : "");
|
|
42
|
+
};
|
|
43
|
+
const lastRunText = lastRunLabel ? `Laatste indeling door de planning: ${lastRunLabel}.` : "Er is nog geen indeling bekend voor deze periode.";
|
|
44
|
+
const notices = [
|
|
45
|
+
error ? (_jsx(InlineAlert, { tone: "error", title: "De pickagenda kon niet worden geladen", action: _jsx(Button, { size: "sm", variant: "outline", onClick: () => refetch(), children: "Opnieuw proberen" }), children: error }, "err")) : null,
|
|
46
|
+
warning && !error ? _jsxs(InlineAlert, { tone: "warning", children: [warning, " De beschikbare orders blijven zichtbaar."] }, "warn") : null,
|
|
47
|
+
awaitingCount > 0 ? (_jsx(InlineAlert, { tone: "info", title: `${awaitingCount} ${awaitingCount === 1 ? "order wacht" : "orders wachten"} op karindeling`, details: _jsxs(_Fragment, { children: [refsText(awaiting), ". ", lastRunText, " ", signalError ?? "De orders worden automatisch ingepland."] }), children: "Nog niet in de agenda." }, "aw")) : null,
|
|
48
|
+
tasksWithoutStart.length > 0 ? (_jsx(InlineAlert, { tone: "warning", title: `${tasksWithoutStart.length} zonder starttijd`, details: _jsxs(_Fragment, { children: [refsText(tasksWithoutStart), ". ", lastRunText] }), children: "Controleer de werktijden." }, "ts")) : null,
|
|
49
|
+
];
|
|
50
|
+
void anyIssue;
|
|
51
|
+
return (_jsxs("div", { className: "flex flex-col gap-4", children: [header?.({
|
|
52
|
+
updatedAt: dataUpdatedAt ?? null,
|
|
53
|
+
period: (_jsx(PeriodPicker, { label: weekLabel(weekStart), onPrev: () => setWeekStart((w) => addDays(w, -7)), onNext: () => setWeekStart((w) => addDays(w, 7)), onToday: () => setWeekStart(currentWeekStart()), todayLabel: "Deze week", isCurrent: isCurrent })),
|
|
54
|
+
}), _jsx(NoticeStack, { children: notices }), _jsxs(KpiRow, { children: [_jsx(KpiTile, { title: "Te picken", icon: _jsx(ShoppingCart, {}), loading: isLoading, value: totals.leveringen, sub: `${totals.totaalStuks.toLocaleString("nl-NL")} stuks` }), _jsx(KpiTile, { title: "Karren", icon: _jsx(Package, {}), loading: isLoading, value: totals.karren, sub: "in de getoonde week" }), _jsx(KpiTile, { title: "Afgehandeld", icon: _jsx(CheckCircle2, {}), loading: isLoading, value: totals.afgehandeld, sub: `van ${totals.leveringen} orders` }), _jsx(KpiTile, { title: "Nog niet ingedeeld", icon: _jsx(AlertTriangle, {}), loading: isLoading, value: awaitingCount, tone: awaitingCount ? "warning" : "default", sub: awaitingCount ? "wacht op karindeling" : "alles ingedeeld" })] }), _jsx(PillTabs, { ariaLabel: "Status", value: tab, onChange: setTab, tabs: [
|
|
55
|
+
{ value: "alle", label: "Alle", icon: _jsx(List, {}), count: totals.leveringen },
|
|
56
|
+
{ value: "voorbereiding", label: "In voorbereiding", icon: _jsx(Clock, {}), count: totals.voorbereiding },
|
|
57
|
+
{ value: "verzendklaar", label: "Verzendklaar", icon: _jsx(Truck, {}), count: totals.verzendklaar },
|
|
58
|
+
{ value: "afgehandeld", label: "Afgehandeld", icon: _jsx(CheckCircle2, {}), count: totals.afgehandeld },
|
|
59
|
+
] }), !error && (_jsx(WeekAgendaView, { planned: planned, mode: "pick", isLoading: isLoading, onOrderClick: onOrderClick, onDayClick: setDayDetailDate, weekStart: weekStart, onJump: setWeekStart, statusFilter: tab, onTotals: onTotals, jumpToDate: nearestDeliveryDate })), _jsx(DagDetailDialog, { open: !!dayDetailDate, date: dayDetailDate, planned: planned, onOpenChange: (o) => !o && setDayDetailDate(null) })] }));
|
|
43
60
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PickingPage.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/PickingPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PickingPage.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/PickingPage.tsx"],"names":[],"mappings":"AAKA,wBAAgB,WAAW,gCAe1B"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { PageHeader } from "../fs-ui/PageHeader.js";
|
|
3
|
+
import { UpdatedAt } from "../fs-ui/UpdatedAt.js";
|
|
3
4
|
import { useAfhandelingDefaults } from "../../hooks/useAfhandelingDefaults.js";
|
|
4
5
|
import { PickAgendaView } from "./PickAgendaView.js";
|
|
5
6
|
export function PickingPage() {
|
|
6
7
|
useAfhandelingDefaults();
|
|
7
|
-
return (
|
|
8
|
+
return (_jsx("main", { className: "flex w-full min-w-0 flex-col gap-4 overflow-x-clip p-4 pb-[calc(7rem+env(safe-area-inset-bottom))] sm:p-6 sm:pb-24", children: _jsx(PickAgendaView, { header: ({ updatedAt, period }) => (_jsx(PageHeader, { title: "Picken", updatedAt: _jsx(UpdatedAt, { at: updatedAt, info: "Overzicht van alle orders die gepickt moeten worden." }), period: period })) }) }));
|
|
8
9
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { type WeekAgendaMode } from "./WeekAgendaView.js";
|
|
2
2
|
interface Props {
|
|
3
3
|
title: string;
|
|
4
|
+
/** Wordt in de infoballon bij "Bijgewerkt" getoond. */
|
|
4
5
|
description: string;
|
|
5
6
|
mode: WeekAgendaMode;
|
|
6
7
|
}
|
|
8
|
+
/** Planning: geen 4 zinvolle cijfers, dus geen KPI-rij (vaste regel: geen verzonnen tegels). */
|
|
7
9
|
export declare function PlanningAgendaPage({ title, description, mode }: Props): import("react").JSX.Element;
|
|
8
10
|
export {};
|
|
9
11
|
//# sourceMappingURL=PlanningAgendaPage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlanningAgendaPage.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/PlanningAgendaPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PlanningAgendaPage.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/PlanningAgendaPage.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAMvE,UAAU,KAAK;IACb,KAAK,EAAE,MAAM,CAAC;IACd,uDAAuD;IACvD,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,cAAc,CAAC;CACtB;AAED,gGAAgG;AAChG,wBAAgB,kBAAkB,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE,KAAK,+BA8BrE"}
|
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
2
3
|
import { PageHeader } from "../fs-ui/PageHeader.js";
|
|
3
|
-
import { InlineAlert } from "../fs-ui/InlineAlert.js";
|
|
4
|
+
import { InlineAlert, NoticeStack } from "../fs-ui/InlineAlert.js";
|
|
5
|
+
import { UpdatedAt } from "../fs-ui/UpdatedAt.js";
|
|
6
|
+
import { PeriodPicker } from "../fs-ui/PeriodPicker.js";
|
|
4
7
|
import { useAfhandelingDefaults } from "../../hooks/useAfhandelingDefaults.js";
|
|
5
8
|
import { WeekAgendaView } from "./WeekAgendaView.js";
|
|
6
9
|
import { useOrderPlanning } from "../../hooks/useOrderPlanning.js";
|
|
10
|
+
import { currentWeekStart } from "../../lib/agendaRange.js";
|
|
11
|
+
import { addDays, startOfWeek } from "../../lib/pickDate.js";
|
|
12
|
+
import { weekLabel } from "../../lib/dateLabels.js";
|
|
13
|
+
/** Planning: geen 4 zinvolle cijfers, dus geen KPI-rij (vaste regel: geen verzonnen tegels). */
|
|
7
14
|
export function PlanningAgendaPage({ title, description, mode }) {
|
|
8
15
|
useAfhandelingDefaults();
|
|
9
|
-
const
|
|
10
|
-
|
|
16
|
+
const [weekStart, setWeekStart] = useState(() => currentWeekStart());
|
|
17
|
+
const { planned, isLoading, error, warning, dataUpdatedAt } = useOrderPlanning();
|
|
18
|
+
const isCurrent = startOfWeek(weekStart).getTime() === startOfWeek(currentWeekStart()).getTime();
|
|
19
|
+
return (_jsxs("main", { className: "flex w-full min-w-0 flex-col gap-4 overflow-x-clip p-4 pb-[calc(7rem+env(safe-area-inset-bottom))] sm:p-6 sm:pb-24", children: [_jsx(PageHeader, { title: title, updatedAt: _jsx(UpdatedAt, { at: dataUpdatedAt, info: description }), period: _jsx(PeriodPicker, { label: weekLabel(weekStart), onPrev: () => setWeekStart((w) => addDays(w, -7)), onNext: () => setWeekStart((w) => addDays(w, 7)), onToday: () => setWeekStart(currentWeekStart()), todayLabel: "Deze week", isCurrent: isCurrent }) }), _jsx(NoticeStack, { children: [
|
|
20
|
+
error ? _jsx(InlineAlert, { tone: "error", children: error }, "e") : null,
|
|
21
|
+
warning && !error ? _jsxs(InlineAlert, { tone: "warning", children: [warning, " De beschikbare orders blijven zichtbaar."] }, "w") : null,
|
|
22
|
+
] }), _jsx(WeekAgendaView, { planned: planned, mode: mode, isLoading: isLoading, weekStart: weekStart, onJump: setWeekStart })] }));
|
|
11
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScanControleView.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/ScanControleView.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScanControleView.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/ScanControleView.tsx"],"names":[],"mappings":"AA+FA,wBAAgB,gBAAgB,gCAkX/B"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
3
|
+
import { label } from "../../lib/labels.js";
|
|
3
4
|
import { supabase } from "../../integrations/supabase/moduleClient.js";
|
|
4
5
|
import { Button, Badge, Card, Input, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, toast, } from "@flowselections/core";
|
|
5
6
|
import { AlertTriangle, CheckCircle2, RefreshCw, ScanLine } from "lucide-react";
|
|
@@ -181,5 +182,5 @@ export function ScanControleView() {
|
|
|
181
182
|
setLookup(null);
|
|
182
183
|
setBarcode("");
|
|
183
184
|
inputRef.current?.focus();
|
|
184
|
-
}, children: "Annuleren" })] })] }))] }), _jsxs("div", { className: "flex flex-wrap gap-3", children: [_jsxs(Card, { className: "p-3", children: [_jsx("div", { className: "text-xs text-muted-foreground", children: "Gescand vandaag" }), _jsx("div", { className: "text-2xl font-semibold", children: stats.totaal })] }), _jsxs(Card, { className: "p-3", children: [_jsx("div", { className: "text-xs text-muted-foreground", children: "Geprint" }), _jsx("div", { className: "text-2xl font-semibold", children: stats.geprint })] }), _jsxs(Card, { className: "p-3", children: [_jsx("div", { className: "text-xs text-muted-foreground", children: "In behandeling" }), _jsx("div", { className: "text-2xl font-semibold", children: stats.wacht })] }), _jsxs(Card, { className: "p-3", children: [_jsx("div", { className: "text-xs text-muted-foreground", children: "Mislukt" }), _jsx("div", { className: "text-2xl font-semibold", children: stats.mislukt })] })] }), _jsx(Card, { className: "p-0 overflow-hidden", children: _jsxs(Table, { children: [_jsx(TableHeader, { children: _jsxs(TableRow, { children: [_jsx(TableHead, { children: "Ordernummer" }), _jsx(TableHead, { children: "Soort" }), _jsx(TableHead, { children: "Status" }), _jsx(TableHead, { children: "Melding" }), _jsx(TableHead, { children: "Bijgewerkt" }), _jsx(TableHead, {})] }) }), _jsx(TableBody, { children: overviewQ.isLoading ? (_jsx(TableRow, { children: _jsx(TableCell, { colSpan: 6, className: "text-sm text-muted-foreground", children: "Laden\u2026" }) })) : rows.length === 0 ? (_jsx(TableRow, { children: _jsx(TableCell, { colSpan: 6, className: "text-sm text-muted-foreground", children: "Vandaag nog niets gescand." }) })) : (rows.map((r) => (_jsxs(TableRow, { children: [_jsx(TableCell, { children: r.orderNumber ?? "—" }), _jsx(TableCell, { children: r.isFloriday ? "FO" : "Eigen" }), _jsx(TableCell, { children: _jsx(Badge, { variant: statusVariant(r.status), children: r.status }) }), _jsx(TableCell, { className: "text-sm text-muted-foreground", children: r.error ?? "—" }), _jsx(TableCell, { children: tijd(r.updatedAt) }), _jsx(TableCell, { className: "text-right", children: r.status === "mislukt" && (_jsxs(Button, { size: "sm", variant: "outline", disabled: retryM.isPending, onClick: () => retryM.mutate(r.id), children: [_jsx(RefreshCw, { className: "h-4 w-4 mr-2" }), "Opnieuw proberen"] })) })] }, r.id)))) })] }) })] }));
|
|
185
|
+
}, children: "Annuleren" })] })] }))] }), _jsxs("div", { className: "flex flex-wrap gap-3", children: [_jsxs(Card, { className: "p-3", children: [_jsx("div", { className: "text-xs text-muted-foreground", children: "Gescand vandaag" }), _jsx("div", { className: "text-2xl font-semibold", children: stats.totaal })] }), _jsxs(Card, { className: "p-3", children: [_jsx("div", { className: "text-xs text-muted-foreground", children: "Geprint" }), _jsx("div", { className: "text-2xl font-semibold", children: stats.geprint })] }), _jsxs(Card, { className: "p-3", children: [_jsx("div", { className: "text-xs text-muted-foreground", children: "In behandeling" }), _jsx("div", { className: "text-2xl font-semibold", children: stats.wacht })] }), _jsxs(Card, { className: "p-3", children: [_jsx("div", { className: "text-xs text-muted-foreground", children: "Mislukt" }), _jsx("div", { className: "text-2xl font-semibold", children: stats.mislukt })] })] }), _jsx(Card, { className: "p-0 overflow-hidden", children: _jsxs(Table, { children: [_jsx(TableHeader, { children: _jsxs(TableRow, { children: [_jsx(TableHead, { children: "Ordernummer" }), _jsx(TableHead, { children: "Soort" }), _jsx(TableHead, { children: "Status" }), _jsx(TableHead, { children: "Melding" }), _jsx(TableHead, { children: "Bijgewerkt" }), _jsx(TableHead, {})] }) }), _jsx(TableBody, { children: overviewQ.isLoading ? (_jsx(TableRow, { children: _jsx(TableCell, { colSpan: 6, className: "text-sm text-muted-foreground", children: "Laden\u2026" }) })) : rows.length === 0 ? (_jsx(TableRow, { children: _jsx(TableCell, { colSpan: 6, className: "text-sm text-muted-foreground", children: "Vandaag nog niets gescand." }) })) : (rows.map((r) => (_jsxs(TableRow, { children: [_jsx(TableCell, { children: r.orderNumber ?? "—" }), _jsx(TableCell, { children: r.isFloriday ? "FO" : "Eigen" }), _jsx(TableCell, { children: _jsx(Badge, { variant: statusVariant(r.status), children: label("scanStatus", r.status) }) }), _jsx(TableCell, { className: "text-sm text-muted-foreground", children: r.error ?? "—" }), _jsx(TableCell, { children: tijd(r.updatedAt) }), _jsx(TableCell, { className: "text-right", children: r.status === "mislukt" && (_jsxs(Button, { size: "sm", variant: "outline", disabled: retryM.isPending, onClick: () => retryM.mutate(r.id), children: [_jsx(RefreshCw, { className: "h-4 w-4 mr-2" }), "Opnieuw proberen"] })) })] }, r.id)))) })] }) })] }));
|
|
185
186
|
}
|
|
@@ -4,9 +4,9 @@ import { Popover, PopoverContent, PopoverTrigger, Badge, cn } from "@flowselecti
|
|
|
4
4
|
import { ChevronDown, Search, X, Check, Globe, MapPin, Building2 } from "lucide-react";
|
|
5
5
|
import { GEO_ITEMS, getGeoItem } from "../../lib/geo/euServiceAreas.js";
|
|
6
6
|
const LEVEL_META = {
|
|
7
|
-
country: { label: "Land", icon: Globe, tone: "bg-
|
|
7
|
+
country: { label: "Land", icon: Globe, tone: "bg-primary/10 text-primary" },
|
|
8
8
|
province: { label: "Provincie", icon: MapPin, tone: "bg-emerald-100 text-emerald-700" },
|
|
9
|
-
city: { label: "Plaats", icon: Building2, tone: "bg-
|
|
9
|
+
city: { label: "Plaats", icon: Building2, tone: "bg-warning-soft text-warning-soft-foreground" },
|
|
10
10
|
};
|
|
11
11
|
function isSelected(value, item) {
|
|
12
12
|
if (item.level === "country")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VervoerdersPage.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/VervoerdersPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"VervoerdersPage.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/VervoerdersPage.tsx"],"names":[],"mappings":"AAkDA;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,KAAK,GAAE;IAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAA;CAAO,+BAM3G"}
|
|
@@ -6,23 +6,27 @@ import { PageHeader } from "../fs-ui/PageHeader.js";
|
|
|
6
6
|
import { UpdatedAt } from "../fs-ui/UpdatedAt.js";
|
|
7
7
|
import { KpiRow } from "../fs-ui/KpiRow.js";
|
|
8
8
|
import { KpiTile } from "../fs-ui/KpiTile.js";
|
|
9
|
-
import { Toolbar } from "../fs-ui/Toolbar.js";
|
|
9
|
+
import { Toolbar, FiltersButton } from "../fs-ui/Toolbar.js";
|
|
10
|
+
import { FilterChips } from "../fs-ui/FilterChips.js";
|
|
11
|
+
import { FilterPanel, FilterOptions } from "../fs-ui/FilterPanel.js";
|
|
12
|
+
import { label } from "../../lib/labels.js";
|
|
10
13
|
import { SearchInput } from "../fs-ui/SearchInput.js";
|
|
11
|
-
import { DataTable } from "../fs-ui/DataTable.js";
|
|
14
|
+
import { DataTable, Cell2 } from "../fs-ui/DataTable.js";
|
|
15
|
+
import { StatusIcon } from "../fs-ui/StatusIcon.js";
|
|
12
16
|
import { EmptyState } from "../fs-ui/EmptyState.js";
|
|
13
|
-
import { InlineAlert } from "../fs-ui/InlineAlert.js";
|
|
17
|
+
import { InlineAlert, NoticeStack } from "../fs-ui/InlineAlert.js";
|
|
14
18
|
import { TableSkeleton } from "../fs-ui/TableSkeleton.js";
|
|
15
19
|
import { MobilePrimaryAction } from "../fs-ui/MobilePrimaryAction.js";
|
|
16
20
|
import { useShortcuts } from "../fs-ui/useShortcuts.js";
|
|
17
|
-
import { ShortcutHelp
|
|
18
|
-
import { Plus, Pencil, Archive, Truck, ArrowUp, ArrowDown, Star, AlertTriangle,
|
|
21
|
+
import { ShortcutHelp } from "../fs-ui/ShortcutHelp.js";
|
|
22
|
+
import { Plus, Pencil, Archive, Truck, ArrowUp, ArrowDown, Star, AlertTriangle, Mail, MoreVertical } from "lucide-react";
|
|
19
23
|
import { ResponsiveAlertDialogBody, ResponsiveAlertDialogContent, ResponsiveAlertDialogFooter, ResponsiveAlertDialogHeader, } from "../ui/responsive-dialog.js";
|
|
20
24
|
import { Link, useNavigate } from "@tanstack/react-router";
|
|
21
25
|
import { useServerFn } from "@tanstack/react-start";
|
|
22
26
|
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
23
27
|
import { toServerFnError } from "../../lib/serverFnError.js";
|
|
24
28
|
import { listCarriers, deleteCarrier, reorderCarriers, setFavoriteCarrier, getCarrierAccess, ensureCarrierDefaults } from "../../lib/carriers.functions.js";
|
|
25
|
-
import { carrierReadiness
|
|
29
|
+
import { carrierReadiness } from "../../lib/carrierReadiness.js";
|
|
26
30
|
import { carrierLeadDaysFromMoments } from "../../lib/carrierPlanning.js";
|
|
27
31
|
import { VervoerderForm } from "./VervoerderForm.js";
|
|
28
32
|
import { resolveCarrierId } from "./VervoerderBewerkenPage.js";
|
|
@@ -51,6 +55,10 @@ function VervoerdersLijst() {
|
|
|
51
55
|
const [search, setSearch] = useState("");
|
|
52
56
|
const [sel, setSel] = useState(null);
|
|
53
57
|
const [help, setHelp] = useState(false);
|
|
58
|
+
const [filtersOpen, setFiltersOpen] = useState(false);
|
|
59
|
+
const [fKind, setFKind] = useState(null);
|
|
60
|
+
const [fReady, setFReady] = useState(null);
|
|
61
|
+
const [fMail, setFMail] = useState(null);
|
|
54
62
|
const searchRef = useRef(null);
|
|
55
63
|
const navigate = useNavigate();
|
|
56
64
|
const ensureDefaults = useServerFn(ensureCarrierDefaults);
|
|
@@ -106,7 +114,37 @@ function VervoerdersLijst() {
|
|
|
106
114
|
reorderMutation.mutate(ids);
|
|
107
115
|
};
|
|
108
116
|
const q = search.trim().toLowerCase();
|
|
109
|
-
const
|
|
117
|
+
const filtering = !!q || !!fKind || !!fReady || !!fMail;
|
|
118
|
+
const shown = carriers.filter((c) => {
|
|
119
|
+
if (q && !`${c.name} ${c.email ?? ""}`.toLowerCase().includes(q))
|
|
120
|
+
return false;
|
|
121
|
+
if (fKind && (fKind === "geen" ? !!c.carrier_kind : c.carrier_kind !== fKind))
|
|
122
|
+
return false;
|
|
123
|
+
if (fReady) {
|
|
124
|
+
const ok = carrierReadiness(c).warnings.length === 0;
|
|
125
|
+
if ((fReady === "compleet") !== ok)
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
if (fMail && (fMail === "met") !== !!c.email)
|
|
129
|
+
return false;
|
|
130
|
+
return true;
|
|
131
|
+
});
|
|
132
|
+
const KIND_OPTS = [
|
|
133
|
+
{ value: "extern", label: label("carrierKind", "extern") },
|
|
134
|
+
{ value: "eigen_vervoer", label: label("carrierKind", "eigen_vervoer") },
|
|
135
|
+
{ value: "klant_haalt_op", label: label("carrierKind", "klant_haalt_op") },
|
|
136
|
+
{ value: "geen", label: "Nog niet gekozen" },
|
|
137
|
+
];
|
|
138
|
+
const chips = [
|
|
139
|
+
fKind && { key: "kind", label: KIND_OPTS.find((o) => o.value === fKind).label },
|
|
140
|
+
fReady && { key: "ready", label: fReady === "compleet" ? "Compleet" : "Nog niet gereed" },
|
|
141
|
+
fMail && { key: "mail", label: fMail === "met" ? "Met e-mailadres" : "Zonder e-mailadres" },
|
|
142
|
+
].filter(Boolean);
|
|
143
|
+
const removeChip = (k) => { if (k === "kind")
|
|
144
|
+
setFKind(null); if (k === "ready")
|
|
145
|
+
setFReady(null); if (k === "mail")
|
|
146
|
+
setFMail(null); };
|
|
147
|
+
const clearFilters = () => { setFKind(null); setFReady(null); setFMail(null); };
|
|
110
148
|
const favorite = carriers.find((c) => c.is_favorite);
|
|
111
149
|
const notReady = carriers.filter((c) => carrierReadiness(c).warnings.length > 0).length;
|
|
112
150
|
const withMail = carriers.filter((c) => !!c.email).length;
|
|
@@ -126,28 +164,40 @@ function VervoerdersLijst() {
|
|
|
126
164
|
});
|
|
127
165
|
const columns = [
|
|
128
166
|
{
|
|
129
|
-
key: "prio", header: "Prioriteit", width:
|
|
167
|
+
key: "prio", header: "Prioriteit", width: 112,
|
|
130
168
|
cell: (c) => {
|
|
131
169
|
const index = carriers.indexOf(c);
|
|
132
|
-
return (_jsxs("div", { className: "flex items-center gap-1", onClick: (e) => e.stopPropagation(), children: [_jsx("span", { className: "w-6 text-sm
|
|
170
|
+
return (_jsxs("div", { className: "flex items-center gap-1", onClick: (e) => e.stopPropagation(), children: [_jsx("span", { className: "w-6 text-sm tabular-nums text-foreground", children: index + 1 }), _jsx(Button, { variant: "ghost", size: "sm", className: "h-8 w-8 p-0", onClick: () => move(index, -1), disabled: filtering || index === 0 || reorderMutation.isPending, "aria-label": "Hoger", children: _jsx(ArrowUp, { className: "h-4 w-4" }) }), _jsx(Button, { variant: "ghost", size: "sm", className: "h-8 w-8 p-0", onClick: () => move(index, 1), disabled: filtering || index === carriers.length - 1 || reorderMutation.isPending, "aria-label": "Lager", children: _jsx(ArrowDown, { className: "h-4 w-4" }) })] }));
|
|
133
171
|
},
|
|
134
172
|
},
|
|
135
173
|
{
|
|
136
|
-
key: "name", header: "Bedrijfsnaam", width:
|
|
137
|
-
cell: (c) => (_jsxs("div", { className: "flex min-w-0 items-center gap-3", children: [_jsx("span", { className: "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-primary/10 text-xs font-semibold text-primary", "aria-hidden": true, children: c.name.split(/\s+/).map((w) => w[0]).join("").slice(0, 2).toUpperCase() }), _jsxs("div", { className: "min-w-0", children: [_jsxs("div", { className: "flex items-center gap-1 truncate font-medium", children: [c.name, c.is_favorite && _jsx(Star, { className: "h-4 w-4 shrink-0 fill-primary text-primary", "aria-label": "Favoriet" })] }), _jsx("div", { className: "truncate text-xs text-muted-foreground", children: c.email ?? "geen e-mail" })] })] })),
|
|
174
|
+
key: "name", header: "Bedrijfsnaam", width: undefined,
|
|
175
|
+
cell: (c) => (_jsxs("div", { className: "flex min-w-0 items-center gap-3", children: [_jsx("span", { className: "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-primary/10 text-xs font-semibold text-primary", "aria-hidden": true, children: c.name.split(/\s+/).map((w) => w[0]).join("").slice(0, 2).toUpperCase() }), _jsxs("div", { className: "min-w-0", children: [_jsxs("div", { className: "flex items-center gap-1 truncate text-sm font-medium", title: c.name, children: [c.name, c.is_favorite && _jsx(Star, { className: "h-4 w-4 shrink-0 fill-primary text-primary", "aria-label": "Favoriet" })] }), _jsx("div", { className: "truncate text-xs text-muted-foreground", children: c.email ?? "geen e-mail" })] })] })),
|
|
138
176
|
},
|
|
139
|
-
{ key: "kind", header: "Soort", width:
|
|
140
|
-
{ key: "ready", header: "Gereed", width:
|
|
141
|
-
{ key: "lead", header: "Levertijd", width:
|
|
177
|
+
{ key: "kind", header: "Soort", width: 140, cell: (c) => c.carrier_kind ? label("carrierKind", c.carrier_kind) : _jsx("span", { className: "text-destructive", children: "Nog niet gekozen" }) },
|
|
178
|
+
{ key: "ready", header: "Gereed", width: 280, cell: (c) => _jsx(ReadinessCell, { carrier: c }) },
|
|
179
|
+
{ key: "lead", header: "Levertijd", width: 120, cell: (c) => _jsxs("span", { className: "tabular-nums", children: [carrierLeadDaysFromMoments(c.pickup_moments), " werkdagen"] }) },
|
|
142
180
|
{
|
|
143
|
-
key: "acties", header: _jsx("span", { className: "sr-only", children: "Acties" }), width:
|
|
144
|
-
cell: (c) => (_jsx("div", { onClick: (e) => e.stopPropagation(), children: _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, {
|
|
181
|
+
key: "acties", header: _jsx("span", { className: "sr-only", children: "Acties" }), width: 56,
|
|
182
|
+
cell: (c) => (_jsx("div", { onClick: (e) => e.stopPropagation(), children: _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { "aria-label": `Acties voor ${c.name}`, onClick: (e) => e.stopPropagation(), className: "inline-flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", children: _jsx(MoreVertical, { className: "h-4 w-4" }) }), _jsxs(DropdownMenuContent, { align: "end", children: [_jsx(DropdownMenuItem, { asChild: true, children: _jsxs(Link, { to: "/afhandeling/vervoerders/$carrierId", params: { carrierId: c.id }, children: [_jsx(Pencil, { className: "mr-2 h-4 w-4" }), " Bewerken"] }) }), !c.is_favorite && canManage && carrierReadiness(c).canBeFavorite && (_jsxs(DropdownMenuItem, { disabled: favoriteMutation.isPending, onSelect: () => favoriteMutation.mutate(c.id), children: [_jsx(Star, { className: "mr-2 h-4 w-4" }), " Maak favoriet"] })), _jsxs(DropdownMenuItem, { disabled: !canManage || c.is_favorite, onSelect: () => setDeletingId(c.id), className: "text-destructive focus:text-destructive", children: [_jsx(Archive, { className: "mr-2 h-4 w-4" }), " ", c.is_favorite ? "Archiveren (kies eerst een andere favoriet)" : "Archiveren"] })] })] }) })),
|
|
145
183
|
},
|
|
146
184
|
];
|
|
147
|
-
return (_jsxs("
|
|
185
|
+
return (_jsxs("main", { className: "flex w-full min-w-0 flex-col gap-4 overflow-x-clip p-4 pb-[calc(7rem+env(safe-area-inset-bottom))] sm:p-6 sm:pb-24", children: [_jsx(PageHeader, { title: "Vervoerders", updatedAt: _jsx(UpdatedAt, { at: dataUpdatedAt || null, info: "Beheer vervoerders, hun werkgebied en ophaalmomenten." }), actions: _jsx(Button, { asChild: true, size: "sm", className: "hidden sm:inline-flex", children: _jsxs(Link, { to: "/afhandeling/vervoerders/nieuw", children: [_jsx(Plus, { className: "mr-2 h-4 w-4" }), "Vervoerder toevoegen", _jsx("kbd", { "aria-hidden": true, className: "ml-2 hidden rounded border border-primary-foreground/30 bg-primary-foreground/15 px-1.5 font-mono text-[10px] leading-4 text-primary-foreground sm:inline-block", children: "N" })] }) }) }), _jsx(NoticeStack, { children: [
|
|
186
|
+
access.data && access.data.managersCount === 0 ? _jsx(InlineAlert, { tone: "error", children: "Niemand mag vervoerders beheren; vraag een beheerder om een rol." }, "a") : null,
|
|
187
|
+
access.data && access.data.managersCount > 0 && !canManage ? _jsx(InlineAlert, { tone: "info", children: "Je kunt de vervoerders bekijken. Wijzigen kan alleen met de rol beheerder, manager of planner." }, "b") : null,
|
|
188
|
+
!isLoading && !error && !hasFavorite && carriers.length > 0 ? _jsx(InlineAlert, { tone: "warning", title: "Kies een favoriete vervoerder", children: "Open het menu bij een vervoerder en kies \"Maak favoriet\"." }, "c") : null,
|
|
189
|
+
] }), _jsxs(KpiRow, { children: [_jsx(KpiTile, { title: "Vervoerders", icon: _jsx(Truck, {}), loading: isLoading, value: carriers.length, sub: "actief in de lijst" }), _jsx(KpiTile, { title: "Favoriet", icon: _jsx(Star, {}), loading: isLoading, value: _jsx("span", { className: "block truncate text-lg", children: favorite?.name ?? "Niet gekozen" }), sub: "eerste keuze bij plannen", tone: favorite ? "default" : "warning" }), _jsx(KpiTile, { title: "Met e-mailadres", icon: _jsx(Mail, {}), loading: isLoading, value: withMail, sub: "kunnen een aanmeldmail krijgen" }), _jsx(KpiTile, { title: "Nog niet gereed", icon: _jsx(AlertTriangle, {}), loading: isLoading, value: notReady, sub: notReady ? "vul de ontbrekende gegevens aan" : "alles compleet", tone: notReady ? "warning" : "default" })] }), _jsxs(Toolbar, { children: [_jsx(SearchInput, { ref: searchRef, value: search, onChange: setSearch, placeholder: "Zoek vervoerder" }), _jsx(FiltersButton, { count: chips.length, onClick: () => setFiltersOpen(true) }), _jsx(FilterChips, { chips: chips, onRemove: removeChip, onClearAll: clearFilters }), filtering && _jsx("span", { className: "hidden text-xs text-muted-foreground lg:inline", children: "Volgorde wijzigen kan zonder zoeken of filters." })] }), _jsxs(FilterPanel, { open: filtersOpen, onOpenChange: setFiltersOpen, onClear: chips.length ? clearFilters : undefined, children: [_jsx(FilterOptions, { title: "Soort", value: fKind, options: KIND_OPTS.map((o) => ({ ...o })), onChange: setFKind }), _jsx(FilterOptions, { title: "Gegevens", value: fReady, options: [{ value: "compleet", label: "Compleet" }, { value: "niet", label: "Nog niet gereed" }], onChange: setFReady }), _jsx(FilterOptions, { title: "E-mailadres", value: fMail, options: [{ value: "met", label: "Met e-mailadres" }, { value: "zonder", label: "Zonder e-mailadres" }], onChange: setFMail })] }), isLoading ? (_jsx(TableSkeleton, { columns: 6, rows: 5 })) : error ? (_jsx(InlineAlert, { tone: "error", title: "De vervoerders konden niet worden geladen", action: _jsx(Button, { variant: "outline", size: "sm", onClick: () => refetch(), children: "Opnieuw proberen" }), children: "Lukt het niet, probeer het later opnieuw." })) : carriers.length === 0 ? (_jsx("div", { children: _jsx(EmptyState, { icon: _jsx(Truck, { className: "h-7 w-7" }), title: "Nog geen vervoerders", text: "Voeg een vervoerder toe om orders te kunnen plannen.", action: _jsx(Button, { asChild: true, children: _jsxs(Link, { to: "/afhandeling/vervoerders/nieuw", children: [_jsx(Plus, { className: "mr-1 h-4 w-4" }), "Vervoerder toevoegen"] }) }) }) })) : shown.length === 0 ? (_jsx("div", { children: _jsx(EmptyState, { icon: _jsx(Truck, { className: "h-7 w-7" }), title: "Geen vervoerder gevonden", text: "Pas je zoekopdracht of filters aan.", action: _jsx(Button, { variant: "outline", onClick: () => { setSearch(""); clearFilters(); }, children: "Alles wissen" }) }) })) : (_jsx(DataTable, { ariaLabel: "Vervoerders", columns: columns, rows: shown, rowKey: (c) => c.id, selectedIndex: sel, onRowClick: (c, i) => { setSel(i); navigate({ to: "/afhandeling/vervoerders/$carrierId", params: { carrierId: c.id } }); } })), _jsx(MobilePrimaryAction, { children: _jsx(Button, { asChild: true, children: _jsxs(Link, { to: "/afhandeling/vervoerders/nieuw", children: [_jsx(Plus, { className: "mr-1 h-4 w-4" }), "Vervoerder toevoegen"] }) }) }), _jsx(ShortcutHelp, { open: help, onOpenChange: setHelp }), _jsx(AlertDialog, { open: !!deletingId, onOpenChange: (o) => !o && setDeletingId(null), children: _jsxs(ResponsiveAlertDialogContent, { size: "sm", children: [_jsx(ResponsiveAlertDialogHeader, { children: _jsx(AlertDialogTitle, { children: "Vervoerder archiveren?" }) }), _jsx(ResponsiveAlertDialogBody, { children: _jsx(AlertDialogDescription, { children: "De vervoerder verdwijnt uit de lijst en wordt niet meer gekozen. Er wordt niets verwijderd." }) }), _jsxs(ResponsiveAlertDialogFooter, { children: [_jsx(AlertDialogCancel, { children: "Annuleren" }), _jsx(AlertDialogAction, { onClick: () => deletingId && deleteMutation.mutate(deletingId), className: "bg-destructive text-destructive-foreground hover:bg-destructive/90", children: "Archiveren" })] })] }) })] }));
|
|
148
190
|
}
|
|
149
191
|
function ReadinessCell({ carrier }) {
|
|
150
192
|
const r = carrierReadiness(carrier);
|
|
151
|
-
const
|
|
152
|
-
|
|
193
|
+
const missing = [
|
|
194
|
+
!r.hasEmail && "e-mail",
|
|
195
|
+
!r.hasArea && "werkgebied",
|
|
196
|
+
!r.hasLocations && "afleverlocaties",
|
|
197
|
+
!r.hasMoment && "ophaalmoment",
|
|
198
|
+
].filter(Boolean);
|
|
199
|
+
const ok = missing.length === 0 && r.warnings.length === 0;
|
|
200
|
+
const main = ok ? "Compleet" : missing.length ? `Mist ${missing.join(", ")}` : "Let op";
|
|
201
|
+
const sub = r.warnings.join(" ");
|
|
202
|
+
return (_jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [_jsx(StatusIcon, { tone: ok ? "done" : "error", label: ok ? "Alle gegevens zijn ingevuld" : [main, sub].filter(Boolean).join(". ") }), _jsx(Cell2, { main: main, sub: sub || undefined })] }));
|
|
153
203
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VerzetOrderDialog.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/VerzetOrderDialog.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"VerzetOrderDialog.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/VerzetOrderDialog.tsx"],"names":[],"mappings":"AA8CA,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,qFAAqF;IACrF,aAAa,CAAC,EAAE;QACd,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAC1B,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACxB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACzB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KACtB,CAAC;IACF,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACvC;AAmBD,wBAAgB,iBAAiB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,EAAE,sBAAsB,+BAkWxG"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useMemo, useState } from "react";
|
|
3
|
+
import { fmtDayTime } from "../../lib/dateLabels.js";
|
|
3
4
|
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
|
4
5
|
import { useServerFn } from "@tanstack/react-start";
|
|
5
6
|
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, Badge, Button, Dialog, DialogTitle, DialogDescription, Input, Label, Textarea, toast, } from "@flowselections/core";
|
|
@@ -199,5 +200,5 @@ export function VerzetOrderDialog({ open, orderRef, carrierTarget, onOpenChange
|
|
|
199
200
|
setPickupFrom(m.signup_time);
|
|
200
201
|
setPickupTo(m.signup_time);
|
|
201
202
|
}, children: [m.signup_time, _jsxs("span", { className: "ml-1 text-xs opacity-70", children: ["(", m.signup_days, " wd vooraf \u00B7 ophalen ", m.pickup_time, ")"] })] }, `${m.signup_time}-${i}`));
|
|
202
|
-
}) }), _jsx("p", { className: "text-xs text-muted-foreground", children: "Kies een aanmeldtijd van deze vervoerder." })] }))] }), preview?.current && (_jsxs("p", { className: "text-xs text-muted-foreground", children: ["Huidig aanmeldmoment: ", fmtDate(preview.current.pickupDate), " ", preview.current.pickupFrom ?? "—", "\u2013", preview.current.pickupTo ?? "—", " \u00B7 leverdatum ", fmtDate(preview.current.deliveryDate)] })), loadingPreview && _jsx("p", { className: "text-sm text-muted-foreground", children: "Voorvertoning ophalen\u2026" }), preview && preview.ok === false && (_jsx("div", { className: "rounded-md border border-destructive/30 bg-destructive/5 p-3 text-sm text-destructive", children: preview.error ?? "Deze wijziging kan nu niet worden verwerkt." })), preview && preview.ok !== false && (_jsxs("div", { className: "rounded-md border bg-muted/40 p-3 text-sm space-y-2", children: [_jsx("p", { children: summary }), _jsxs("p", { className: "text-xs text-muted-foreground", children: [preview.affectedTasks ?? 0, " taken worden opnieuw ingepland."] }), preview.planLocked && (_jsx(Badge, { variant: "outline", children: "Deze order ligt vast en kan nu niet worden verzet." }))] })), needsCustomerChoice && (_jsxs("div", { className: "space-y-1 rounded-md border p-3", children: [_jsx(Label, { children: "Reden voor de klantmelding (optioneel)" }), _jsx(Textarea, { value: reason, onChange: (e) => setReason(e.target.value), maxLength: 500, placeholder: "Bijv. Aanvoer bloemen vertraagd" })] })), history.length > 0 && (_jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-xs font-medium text-muted-foreground", children: "Verzetgeschiedenis" }), _jsx("ul", { className: "space-y-1 text-xs text-muted-foreground", children: history.map((h) => (_jsxs("li", { children: [
|
|
203
|
+
}) }), _jsx("p", { className: "text-xs text-muted-foreground", children: "Kies een aanmeldtijd van deze vervoerder." })] }))] }), preview?.current && (_jsxs("p", { className: "text-xs text-muted-foreground", children: ["Huidig aanmeldmoment: ", fmtDate(preview.current.pickupDate), " ", preview.current.pickupFrom ?? "—", "\u2013", preview.current.pickupTo ?? "—", " \u00B7 leverdatum ", fmtDate(preview.current.deliveryDate)] })), loadingPreview && _jsx("p", { className: "text-sm text-muted-foreground", children: "Voorvertoning ophalen\u2026" }), preview && preview.ok === false && (_jsx("div", { className: "rounded-md border border-destructive/30 bg-destructive/5 p-3 text-sm text-destructive", children: preview.error ?? "Deze wijziging kan nu niet worden verwerkt." })), preview && preview.ok !== false && (_jsxs("div", { className: "rounded-md border bg-muted/40 p-3 text-sm space-y-2", children: [_jsx("p", { children: summary }), _jsxs("p", { className: "text-xs text-muted-foreground", children: [preview.affectedTasks ?? 0, " taken worden opnieuw ingepland."] }), preview.planLocked && (_jsx(Badge, { variant: "outline", children: "Deze order ligt vast en kan nu niet worden verzet." }))] })), needsCustomerChoice && (_jsxs("div", { className: "space-y-1 rounded-md border p-3", children: [_jsx(Label, { children: "Reden voor de klantmelding (optioneel)" }), _jsx(Textarea, { value: reason, onChange: (e) => setReason(e.target.value), maxLength: 500, placeholder: "Bijv. Aanvoer bloemen vertraagd" })] })), history.length > 0 && (_jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-xs font-medium text-muted-foreground", children: "Verzetgeschiedenis" }), _jsx("ul", { className: "space-y-1 text-xs text-muted-foreground", children: history.map((h) => (_jsxs("li", { children: [fmtDayTime(h.created_at), " \u2014", " ", String(h.direction ?? ""), " ", String(h.reason ?? "")] }, h.id))) })] }))] }), _jsxs(ResponsiveDialogFooter, { children: [_jsx(Button, { variant: "outline", onClick: () => onOpenChange(false), children: "Annuleren" }), _jsx(Button, { onClick: handleVerzetten, disabled: saving || loadingPreview || (!pickDayChanged && (!transportChanged || blocked)), children: saving ? "Opslaan…" : "Verzetten" })] })] }), _jsx(AlertDialog, { open: confirmOpen, onOpenChange: setConfirmOpen, children: _jsxs(AlertDialogContent, { children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: "Klant informeren?" }), _jsx(AlertDialogDescription, { children: "De leverdatum is gewijzigd naar een latere datum. Wilt u de klant hierover informeren?" })] }), _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { onClick: () => void submit(false), children: "Nee" }), _jsx(AlertDialogAction, { onClick: () => void submit(true), children: "Ja" })] })] }) })] }));
|
|
203
204
|
}
|
|
@@ -13,5 +13,25 @@ export interface WeekAgendaViewProps {
|
|
|
13
13
|
/** Dichtstbijzijnde datum met data buiten de zichtbare week (auto-jump). */
|
|
14
14
|
jumpToDate?: string | null;
|
|
15
15
|
}
|
|
16
|
-
export
|
|
16
|
+
export type OrderBucket = "afgehandeld" | "niet_afgemeld" | "verzendklaar" | "voorbereiding" | "uit";
|
|
17
|
+
/** Eén indeling per order. Floriday herkend op Floriday-id; afmeldstand uit de order. */
|
|
18
|
+
export declare function classify(o: FloridayOrder, scanned: boolean): OrderBucket;
|
|
19
|
+
export type AgendaStatusFilter = "alle" | "voorbereiding" | "verzendklaar" | "afgehandeld";
|
|
20
|
+
export interface AgendaTotals {
|
|
21
|
+
leveringen: number;
|
|
22
|
+
verzendklaar: number;
|
|
23
|
+
voorbereiding: number;
|
|
24
|
+
totaalStuks: number;
|
|
25
|
+
afgehandeld: number;
|
|
26
|
+
nietAfgemeld: number;
|
|
27
|
+
karren: number;
|
|
28
|
+
}
|
|
29
|
+
export declare function WeekAgendaView({ planned, mode, isLoading, onOrderClick, onDayClick, title, onWeekChange, jumpToDate, weekStart: controlledWeekStart, onJump, statusFilter, onTotals, }: WeekAgendaViewProps & {
|
|
30
|
+
/** Gestuurd vanuit de pagina (periodekiezer in de kop). */
|
|
31
|
+
weekStart?: Date;
|
|
32
|
+
/** Bij gestuurde week: vraag de pagina naar een andere week te springen. */
|
|
33
|
+
onJump?: (weekStart: Date) => void;
|
|
34
|
+
statusFilter?: AgendaStatusFilter;
|
|
35
|
+
onTotals?: (t: AgendaTotals) => void;
|
|
36
|
+
}): import("react").JSX.Element;
|
|
17
37
|
//# sourceMappingURL=WeekAgendaView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WeekAgendaView.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/WeekAgendaView.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WeekAgendaView.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/WeekAgendaView.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAElE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAOjE,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,QAAQ,GAAG,oBAAoB,GAAG,MAAM,CAAC;AAEnF,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,IAAI,EAAE,cAAc,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC9C,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yEAAyE;IACzE,YAAY,CAAC,EAAE,CAAC,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,KAAK,IAAI,CAAC;IACxD,4EAA4E;IAC5E,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AA6BD,MAAM,MAAM,WAAW,GAAG,aAAa,GAAG,eAAe,GAAG,cAAc,GAAG,eAAe,GAAG,KAAK,CAAC;AAIrG,yFAAyF;AACzF,wBAAgB,QAAQ,CAAC,CAAC,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,GAAG,WAAW,CAQxE;AAgDD,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,eAAe,GAAG,cAAc,GAAG,aAAa,CAAC;AAE3F,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,IAAI,EACJ,SAAS,EACT,YAAY,EACZ,UAAU,EACV,KAAK,EACL,YAAY,EACZ,UAAU,EACV,SAAS,EAAE,mBAAmB,EAC9B,MAAM,EACN,YAAqB,EACrB,QAAQ,GACT,EAAE,mBAAmB,GAAG;IACvB,2DAA2D;IAC3D,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,4EAA4E;IAC5E,MAAM,CAAC,EAAE,CAAC,SAAS,EAAE,IAAI,KAAK,IAAI,CAAC;IACnC,YAAY,CAAC,EAAE,kBAAkB,CAAC;IAClC,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,YAAY,KAAK,IAAI,CAAC;CACtC,+BA+LA"}
|