fix: логисты могут ставить Доставлено без части дня + дублирующий индекс удалён

This commit is contained in:
root 2026-07-14 18:48:03 +00:00
parent 48e238e634
commit 3b93e755fb
2 changed files with 8 additions and 2 deletions

View File

@ -1197,7 +1197,11 @@ export const OrderDetailPanel = ({
return statusOptions.map((statusOption) => {
const isSelected = pendingStatus?.value === statusOption.value;
const isMismatch = statusOption.mismatch;
const blockedBySchedule = statusOption.requiresSchedule && !hasDeliverySchedule;
const hasDeliveryDate = !!(order?.deliveryDate || order?.customerDate);
const hasDeliverySchedule = hasDeliveryDate && !!(order?.deliveryTime || order?.deliveryHalfDay || order?.delivery_time);
const canSkipHalfDay = ["logistician", "admin", "mega_admin", "manager"].includes(userRole);
const scheduleReady = canSkipHalfDay ? hasDeliveryDate : hasDeliverySchedule;
const blockedBySchedule = statusOption.requiresSchedule && !scheduleReady;
return (
<Button
key={statusOption.value}

View File

@ -87,7 +87,9 @@ const StatusActionPanel = ({
<div className="flex flex-wrap gap-2">
{allStatuses.map((statusOption) => {
const isCurrent = currentStatus === statusOption.value;
const blockedBySchedule = statusOption.requiresSchedule && !hasDeliverySchedule;
const canSkipHalfDay = ["logistician", "admin", "mega_admin", "manager"].includes(userRole);
const scheduleReady = canSkipHalfDay ? hasDeliveryDate : hasDeliverySchedule;
const blockedBySchedule = statusOption.requiresSchedule && !scheduleReady;
const blockedByDriver = statusOption.requiresDriver !== false && !hasDriver;
const hint = getHint(statusOption.value);
return (