From 17f93a65aefd05be6408e0ed6ced822cdd4deda6 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 13 Jul 2026 13:07:03 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20logistics=20UI=20=E2=80=94=20problem=20b?= =?UTF-8?q?adge=20overlap,=20driver=20name,=20SMS=20labels,=20shipment=20r?= =?UTF-8?q?eport?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. LogisticsReadinessBoard: problem badge on separate line (no overlap) 2. DriverAssignmentPanel: show "Водитель назначен" instead of "Неизвестно" when driver name not resolved from join 3. SmsStatusCard: "confirmed" label = "Клиент согласовал дату" (not "Согласовано") 4. StatusActionPanel: when currentStatus=problem, all status buttons clickable (logistician can resolve problem by setting any status) 5. DriverShipmentReport: show ALL items — green check for delivered, red cross for not delivered, with reason comments --- .../logistics/LogisticsReadinessBoard.jsx | 4 +- .../orders/DriverAssignmentPanel.jsx | 2 +- src/components/orders/OrderDetailPanel.jsx | 48 +++++++++++++------ src/components/orders/SmsStatusCard.jsx | 2 +- src/components/orders/StatusActionPanel.jsx | 2 +- 5 files changed, 38 insertions(+), 20 deletions(-) diff --git a/src/components/logistics/LogisticsReadinessBoard.jsx b/src/components/logistics/LogisticsReadinessBoard.jsx index 14c4d65..de399e3 100644 --- a/src/components/logistics/LogisticsReadinessBoard.jsx +++ b/src/components/logistics/LogisticsReadinessBoard.jsx @@ -158,12 +158,12 @@ const renderRow = (group, onSelectSet) => ( {group.assignedDriverName || }
-
+
{getOrderGroupDisplayStatusLabel(group)} {(group.hasDeliveryProblem || group.has_delivery_problem) && ( ⚠ Проблема diff --git a/src/components/orders/DriverAssignmentPanel.jsx b/src/components/orders/DriverAssignmentPanel.jsx index 0411476..b1761ef 100644 --- a/src/components/orders/DriverAssignmentPanel.jsx +++ b/src/components/orders/DriverAssignmentPanel.jsx @@ -122,7 +122,7 @@ const DriverAssignmentPanel = ({ Водитель назначен

- {order.assignedDriverName || "Неизвестно"} + {order.assignedDriverName || "Водитель назначен"}

Назначен diff --git a/src/components/orders/OrderDetailPanel.jsx b/src/components/orders/OrderDetailPanel.jsx index 3e68165..68d5827 100644 --- a/src/components/orders/OrderDetailPanel.jsx +++ b/src/components/orders/OrderDetailPanel.jsx @@ -2,42 +2,60 @@ const DriverShipmentReport = ({ shipmentData }) => { if (!Array.isArray(shipmentData) || shipmentData.length === 0) return null; + const deliveredItems = shipmentData.filter((i) => i.shipped); + const notDeliveredItems = shipmentData.filter((i) => !i.shipped); + return ( - +
- - - - Проблемы с доставкой позиций + 📋 + Отчёт об отгрузке + 0 ? "warning" : "accent"}> + {deliveredItems.length}/{shipmentData.length} доставлено +
-

- Не доставлено {shipmentData.length} {shipmentData.length === 1 ? "позиция" : shipmentData.length < 5 ? "позиции" : "позиций"}. Остальное — доставлено. -

+ + {notDeliveredItems.length > 0 && ( +
+ ⚠ Не доставлено {notDeliveredItems.length} {notDeliveredItems.length === 1 ? "позиция" : notDeliveredItems.length < 5 ? "позиции" : "позиций"} +
+ )} +
{shipmentData.map((item) => (
- {item.name} +
+ + {item.shipped ? "✓" : "✗"} + + + {item.name} + +
{item.quantity || item.unit ? ( {[item.quantity, item.unit].filter(Boolean).join(" ")} ) : null}
- {item.comment ? ( -

Причина: {item.comment}

- ) : ( -

Причина не указана

+ {!item.shipped && item.comment && ( +

Причина: {item.comment}

)}
))}
-
); }; + import React from "react"; import { formatDateTime } from "../../utils/formatters"; import { Badge } from "../UI/Badge"; diff --git a/src/components/orders/SmsStatusCard.jsx b/src/components/orders/SmsStatusCard.jsx index 7be2971..36ee73e 100644 --- a/src/components/orders/SmsStatusCard.jsx +++ b/src/components/orders/SmsStatusCard.jsx @@ -22,7 +22,7 @@ const NOTIF_LABELS = { paid_storage_sending: "Отправляется…", paid_storage_sent: "Платное хранение: отправлено", draft: "Черновик", - confirmed: "Согласовано", + confirmed: "Клиент согласовал дату", }; const NOTIF_TONES = { diff --git a/src/components/orders/StatusActionPanel.jsx b/src/components/orders/StatusActionPanel.jsx index dd7ec90..0a5d122 100644 --- a/src/components/orders/StatusActionPanel.jsx +++ b/src/components/orders/StatusActionPanel.jsx @@ -59,7 +59,7 @@ const StatusActionPanel = ({
{allStatuses.map((statusOption) => { const isCurrent = currentStatus === statusOption.value; - const isClickable = statusOption.manual !== false && !isCurrent; + const isClickable = (statusOption.manual !== false || currentStatus === 'problem') && !isCurrent; const blockedBySchedule = statusOption.requiresSchedule && !hasDeliverySchedule; return (