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) => { return statusOptions.map((statusOption) => {
const isSelected = pendingStatus?.value === statusOption.value; const isSelected = pendingStatus?.value === statusOption.value;
const isMismatch = statusOption.mismatch; 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 ( return (
<Button <Button
key={statusOption.value} key={statusOption.value}

View File

@ -87,7 +87,9 @@ const StatusActionPanel = ({
<div className="flex flex-wrap gap-2"> <div className="flex flex-wrap gap-2">
{allStatuses.map((statusOption) => { {allStatuses.map((statusOption) => {
const isCurrent = currentStatus === statusOption.value; 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 blockedByDriver = statusOption.requiresDriver !== false && !hasDriver;
const hint = getHint(statusOption.value); const hint = getHint(statusOption.value);
return ( return (