diff --git a/src/pages/nearle/deliveries/deliveries.js b/src/pages/nearle/deliveries/deliveries.js index b108ee2..949663c 100644 --- a/src/pages/nearle/deliveries/deliveries.js +++ b/src/pages/nearle/deliveries/deliveries.js @@ -334,6 +334,21 @@ const Deliveries = () => { )} + {/* ============================================= || Sticky top shell || ============================================= */} + + {/* ============================================= || Header (compact) || ============================================= */} { justifyContent="space-between" spacing={{ xs: 1, sm: 1.5 }} > + {/* LEFT: icon + title + live subtitle */} { > Deliveries - + - + Live · {locoName} · {datestatus} + + {/* RIGHT: date pill */} + + setDateOpen(true)} + sx={{ + display: 'inline-flex', + alignItems: 'center', + gap: 0.75, + px: 1.25, + py: 0.625, + borderRadius: 999, + cursor: 'pointer', + bgcolor: tint('#f59e0b'), + border: `1.5px solid ${edge('#f59e0b')}`, + color: '#b45309', + fontWeight: 800, + fontSize: 12, + transition: 'all 0.18s', + '&:hover': { borderColor: '#f59e0b', boxShadow: `0 0 0 3px ${ring('#f59e0b')}` } + }} + > + + {dayjs(startdate).format('DD/MM/YY')} – {dayjs(enddate).format('DD/MM/YY')} + + @@ -490,71 +533,6 @@ const Deliveries = () => { })} - {/* ============================================= || Filter Bar (compact) || ============================================= */} - - - - - setDateOpen(true)} - sx={{ - display: 'inline-flex', - alignItems: 'center', - gap: 0.75, - px: 1.25, - py: 0.75, - borderRadius: 999, - cursor: 'pointer', - bgcolor: tint('#f59e0b'), - border: `1.5px solid ${edge('#f59e0b')}`, - color: '#f59e0b', - fontWeight: 800, - fontSize: 12, - transition: 'all 0.18s', - '&:hover': { borderColor: '#f59e0b', boxShadow: `0 0 0 3px ${ring('#f59e0b')}` } - }} - > - - {dayjs(startdate).format('DD/MM/YY')} – {dayjs(enddate).format('DD/MM/YY')} - - - - {datestatus} - - - - - {/* ============================================= || Status Tabs + Search (compact) || ============================================= */} { + {/* end sticky shell */} + {/* ============================================= || Table (dense, sticky header) || ============================================= */} { logger.info('View mode changed: All Active Routes'); setViewMode('all'); handleRiderFocus(null); setFocusedKitchen(null); setFocusedZone(null); }}>Active )} - + {!embedded && ( + + )} {shouldFetchLive && viewMode !== 'rider-info' && ( diff --git a/src/pages/nearle/dispatch/Preview.js b/src/pages/nearle/dispatch/Preview.js index 81e9687..0f3999a 100644 --- a/src/pages/nearle/dispatch/Preview.js +++ b/src/pages/nearle/dispatch/Preview.js @@ -301,6 +301,12 @@ const Preview = () => { } // eslint-disable-next-line react-hooks/exhaustive-deps }, []); + + useEffect(() => { + const prev = document.body.style.overflow; + document.body.style.overflow = 'hidden'; + return () => { document.body.style.overflow = prev; }; + }, []); const [csvExportData, setCsvExportData] = useState([]); const [isLoading, setIsLoading] = useState(false); const [tabValue, setTabValue] = useState(0); @@ -544,7 +550,17 @@ const Preview = () => { }; return ( - + theme.zIndex.modal + 1 }} open={isLoading} @@ -557,7 +573,8 @@ const Preview = () => { py: 1.5, px: 2.5, borderBottom: '1px solid #e2e8f0', - background: 'linear-gradient(135deg, rgba(102,37,130,0.06) 0%, rgba(146,85,171,0.06) 100%)' + background: 'linear-gradient(135deg, rgba(102,37,130,0.06) 0%, rgba(146,85,171,0.06) 100%)', + flexShrink: 0 }} > @@ -580,6 +597,30 @@ const Preview = () => { Assign Orders + + @@ -599,60 +640,6 @@ const Preview = () => { )} - - - - - - - setChangeDialogOpen(false)} maxWidth="xs" fullWidth> Change Rider diff --git a/src/pages/nearle/orders/multipleOrders.js b/src/pages/nearle/orders/multipleOrders.js index f95156d..bac520f 100644 --- a/src/pages/nearle/orders/multipleOrders.js +++ b/src/pages/nearle/orders/multipleOrders.js @@ -116,6 +116,7 @@ const MultipleOrders = () => { const [uploadType, setUploadType] = useState(null); const [users, setUsers] = useState([]); const [fileName, setFileName] = useState(''); + const [slotDropdownOpen, setSlotDropdownOpen] = useState(false); const toastCacheRef = useRef({}); @@ -538,7 +539,7 @@ const MultipleOrders = () => { // ============================== derived ============================== const canSubmit = !!locationid && !!pickupSlot && dropCust.length > 0; - const prereqOk = true; + const prereqOk = !!locationid; const previewMode = dropCust.length > 0 ? 'drops' : users.length > 0 ? 'preview' : 'empty'; // ============================== render ============================== @@ -621,7 +622,10 @@ const MultipleOrders = () => { ) }} - sx={{ '& .MuiOutlinedInput-root': { borderRadius: '10px', height: '36px' } }} + sx={{ + '& .MuiOutlinedInput-root': { borderRadius: '10px', height: '36px', alignItems: 'center' }, + '& .MuiOutlinedInput-input': { padding: '0 14px !important' } + }} /> ) : ( { setPickupSlotsList(value?.slots || null); } }} - renderInput={(params) => } - sx={{ '& .MuiOutlinedInput-root': { borderRadius: '10px', height: '36px' } }} + renderInput={(params) => ( + + )} + sx={{ + '& .MuiOutlinedInput-root': { borderRadius: '10px', height: '36px', alignItems: 'center', padding: '0 9px !important' }, + '& .MuiAutocomplete-input': { padding: '0 !important' } + }} /> )} @@ -676,7 +690,7 @@ const MultipleOrders = () => { ) }, - sx: { '& .MuiOutlinedInput-root': { borderRadius: '10px', height: '36px', paddingLeft: '10px' } } + sx: { '& .MuiOutlinedInput-root': { borderRadius: '10px', height: '36px' } } } }} /> @@ -685,7 +699,19 @@ const MultipleOrders = () => { { + if (!locationid) { + OpenToast('Please select a Business Location first.', 'warning', 3000); + return; + } + setSlotDropdownOpen(true); + }} + onClose={() => setSlotDropdownOpen(false)} + sx={{ + '& .MuiOutlinedInput-root': { borderRadius: '10px', height: '36px', alignItems: 'center', padding: '0 9px !important' }, + '& .MuiAutocomplete-input': { padding: '0 !important' } + }} onChange={(e, newValue, reason) => { if (reason === 'clear' || !newValue) { setSelectedtime(null); setPickupSlot(null); return; } if (!newValue.time) { OpenToast('This slot has no time configured.', 'warning', 3000); return; } @@ -699,14 +725,12 @@ const MultipleOrders = () => { - - {params.InputProps.startAdornment} - + + + ) }} /> @@ -758,8 +782,8 @@ const MultipleOrders = () => { value={otherinstructions} onChange={(e) => setOtherinstructions(e.target.value)} sx={{ - '& .MuiOutlinedInput-root': { borderRadius: '10px', padding: '0 10px', alignItems: 'center', fontSize: '12px', background: '#ffffff', height: '32px' }, - '& .MuiOutlinedInput-input': { padding: '0 !important', fontSize: '12px !important', lineHeight: '32px' } + '& .MuiOutlinedInput-root': { borderRadius: '10px', height: '36px', alignItems: 'center', fontSize: '12px', background: '#ffffff' }, + '& .MuiOutlinedInput-input': { padding: '0 14px !important', fontSize: '12px' } }} /> diff --git a/src/pages/nearle/orders/orders.js b/src/pages/nearle/orders/orders.js index 0a947a1..2980bcd 100644 --- a/src/pages/nearle/orders/orders.js +++ b/src/pages/nearle/orders/orders.js @@ -355,7 +355,7 @@ const Orders = () => { const createDeliveryMutation = useMutation({ mutationFn: createAutomationDeliveries, onSuccess: (data, variables) => { - enqueueSnackbar('Orders Optimised Successfully', { variant: 'success', autoHideDuration: 2000 }); + enqueueSnackbar('Orders Optimised Successfully', { variant: 'success', autoHideDuration: 2000, anchorOrigin: { vertical: 'top', horizontal: 'right' } }); orderscountRefetch(); refetchOrders(); setCreateloader(false); @@ -469,7 +469,7 @@ const Orders = () => { }} startIcon={} > - Assign All Orders ({rows.length}) + Assign Orders ({rows.length}) )}