diff --git a/src/AppShell.jsx b/src/AppShell.jsx index 53a162d..2a1a744 100644 --- a/src/AppShell.jsx +++ b/src/AppShell.jsx @@ -85,6 +85,9 @@ export const AppShell = ({ + @@ -124,6 +127,9 @@ export const AppShell = ({ + + diff --git a/src/components/orders/OrderDetailPanel.jsx b/src/components/orders/OrderDetailPanel.jsx index 834a526..3eec303 100644 --- a/src/components/orders/OrderDetailPanel.jsx +++ b/src/components/orders/OrderDetailPanel.jsx @@ -722,7 +722,8 @@ export const OrderDetailPanel = ({ return; } - if (!isFutureDeliveryDate(effectiveDate)) { + const canUsePastDate = ["logistician", "admin", "mega_admin", "manager"].includes(userRole); + if (!canUsePastDate && !isFutureDeliveryDate(effectiveDate)) { setFormMessage(deliveryType === "pickup" ? "Выберите дату самовывоза позже сегодняшнего дня." : "Выберите дату доставки позже сегодняшнего дня."); return; } @@ -1337,7 +1338,7 @@ export const OrderDetailPanel = ({ - {userRole !== "driver" && order?.deliveryLink ? ( + {order?.deliveryLink ? ( Ссылка на согласование

diff --git a/src/components/orders/SmsStatusCard.jsx b/src/components/orders/SmsStatusCard.jsx index 408277d..1b84acc 100644 --- a/src/components/orders/SmsStatusCard.jsx +++ b/src/components/orders/SmsStatusCard.jsx @@ -261,6 +261,23 @@ export const SmsStatusCard = ({ order, userRole }) => { )} + {/* Client page access info */} + {(order.invitationAccessCount > 0 || order.invitationOpenedAt) ? ( +

+ 👁 Клиент открывал страницу согласования + {order.invitationAccessCount || 1} раз + {(order.invitationLastAccessedAt || order.invitationOpenedAt) && ( + + · последний: {fmtTime(order.invitationLastAccessedAt || order.invitationOpenedAt)} + + )} +
+ ) : ( +
+ 📭 Клиент ещё не открывал страницу согласования +
+ )} + {/* Restart buttons */} {canManage && (
diff --git a/src/components/orders/StatusActionPanel.jsx b/src/components/orders/StatusActionPanel.jsx index 862b671..0664df5 100644 --- a/src/components/orders/StatusActionPanel.jsx +++ b/src/components/orders/StatusActionPanel.jsx @@ -42,7 +42,7 @@ const StatusActionPanel = ({ { value: "pending_confirmation", label: "Ожидает согласования" }, { value: "agreed", label: "Согласовано" }, { value: "driver_assigned", label: "Назначен водитель" }, - { value: "picked_up", label: "Вывезено", primary: true, requiresSchedule: true }, + { value: "picked_up", label: "Вывезено", primary: true, requiresSchedule: true, requiresDriver: false }, { value: "delivered", label: "Доставлено", mismatch: true, requiresSchedule: true }, { value: "requires_address", label: "Требуется адрес" }, { value: "problem", label: "Проблема" }, @@ -52,7 +52,7 @@ const StatusActionPanel = ({ { value: "pending_confirmation", label: "Ожидает согласования" }, { value: "agreed", label: "Согласовано" }, { value: "driver_assigned", label: "Назначен водитель" }, - { value: "delivered", label: "Доставлено", primary: true, requiresSchedule: true }, + { value: "delivered", label: "Доставлено", primary: true, requiresSchedule: true, requiresDriver: true }, { value: "picked_up", label: "Вывезено", mismatch: true, requiresSchedule: true }, { value: "requires_address", label: "Требуется адрес" }, { value: "problem", label: "Проблема" }, @@ -79,7 +79,7 @@ const StatusActionPanel = ({ {!hasDeliverySchedule && ( ⚠ Дата не указана )} - {!hasDriver && ( + {!hasDriver && !isPickup && ( ⚠ Водитель не назначен )}
@@ -88,6 +88,7 @@ const StatusActionPanel = ({ {allStatuses.map((statusOption) => { const isCurrent = currentStatus === statusOption.value; const blockedBySchedule = statusOption.requiresSchedule && !hasDeliverySchedule; + const blockedByDriver = statusOption.requiresDriver !== false && !hasDriver; const hint = getHint(statusOption.value); return (