updates on the ui
This commit is contained in:
@@ -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 = () => {
|
||||
</InputAdornment>
|
||||
)
|
||||
}}
|
||||
sx={{ '& .MuiOutlinedInput-root': { borderRadius: '10px', height: '36px' } }}
|
||||
sx={{
|
||||
'& .MuiOutlinedInput-root': { borderRadius: '10px', height: '36px', alignItems: 'center' },
|
||||
'& .MuiOutlinedInput-input': { padding: '0 14px !important' }
|
||||
}}
|
||||
/>
|
||||
) : (
|
||||
<Autocomplete
|
||||
@@ -643,8 +647,18 @@ const MultipleOrders = () => {
|
||||
setPickupSlotsList(value?.slots || null);
|
||||
}
|
||||
}}
|
||||
renderInput={(params) => <TextField {...params} label="Select Business Location" placeholder="Select Business Location" />}
|
||||
sx={{ '& .MuiOutlinedInput-root': { borderRadius: '10px', height: '36px' } }}
|
||||
renderInput={(params) => (
|
||||
<TextField
|
||||
{...params}
|
||||
label="Select Business Location"
|
||||
placeholder="Select Business Location"
|
||||
InputLabelProps={{ shrink: true }}
|
||||
/>
|
||||
)}
|
||||
sx={{
|
||||
'& .MuiOutlinedInput-root': { borderRadius: '10px', height: '36px', alignItems: 'center', padding: '0 9px !important' },
|
||||
'& .MuiAutocomplete-input': { padding: '0 !important' }
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</Grid>
|
||||
@@ -676,7 +690,7 @@ const MultipleOrders = () => {
|
||||
</InputAdornment>
|
||||
)
|
||||
},
|
||||
sx: { '& .MuiOutlinedInput-root': { borderRadius: '10px', height: '36px', paddingLeft: '10px' } }
|
||||
sx: { '& .MuiOutlinedInput-root': { borderRadius: '10px', height: '36px' } }
|
||||
}
|
||||
}}
|
||||
/>
|
||||
@@ -685,7 +699,19 @@ const MultipleOrders = () => {
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Autocomplete
|
||||
size="small" fullWidth options={pickupSlotsList || []}
|
||||
sx={{ '& .MuiOutlinedInput-root': { borderRadius: '10px', height: '36px' } }}
|
||||
open={slotDropdownOpen}
|
||||
onOpen={() => {
|
||||
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 = () => {
|
||||
<TextField
|
||||
{...params} label="Pickup Slot" placeholder="Select Pickup Slot" fullWidth
|
||||
InputLabelProps={{ shrink: true }}
|
||||
sx={{ '& .MuiOutlinedInput-root': { borderRadius: '10px', height: '36px' } }}
|
||||
InputProps={{
|
||||
...params.InputProps,
|
||||
startAdornment: (
|
||||
<>
|
||||
<ClockCircleOutlined style={{ color: '#94a3b8', fontSize: '13px', marginRight: '6px', marginLeft: '2px', flexShrink: 0 }} />
|
||||
{params.InputProps.startAdornment}
|
||||
</>
|
||||
<InputAdornment position="start">
|
||||
<ClockCircleOutlined style={{ color: '#94a3b8', fontSize: '13px' }} />
|
||||
</InputAdornment>
|
||||
)
|
||||
}}
|
||||
/>
|
||||
@@ -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' }
|
||||
}}
|
||||
/>
|
||||
</Box>
|
||||
|
||||
@@ -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={<MdLocalShipping size={18} />}
|
||||
>
|
||||
Assign All Orders ({rows.length})
|
||||
Assign Orders ({rows.length})
|
||||
</Button>
|
||||
)}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user