deliverytype createOrder
This commit is contained in:
@@ -336,20 +336,20 @@ const Createorder1 = () => {
|
||||
enqueueSnackbar(' Created Successfully ', {
|
||||
variant: 'success',
|
||||
anchorOrigin: { vertical: 'top', horizontal: 'right' },
|
||||
autoHideDuration: 2000
|
||||
autoHideDuration: 1000
|
||||
});
|
||||
// navigate('/customers')
|
||||
// setTimeout(()=>{
|
||||
// fetchprofiledetails(localStorage.getItem('appuserid'));
|
||||
|
||||
// },2000)
|
||||
// },1000)
|
||||
clientdetails(tenantid);
|
||||
setOpen4(false);
|
||||
} else if (res.data.message == 'Customer Already available') {
|
||||
enqueueSnackbar('Customer Already available', {
|
||||
variant: 'error',
|
||||
anchorOrigin: { vertical: 'top', horizontal: 'right' },
|
||||
autoHideDuration: 2000
|
||||
autoHideDuration: 1000
|
||||
});
|
||||
}
|
||||
setLoading(false);
|
||||
@@ -361,7 +361,7 @@ const Createorder1 = () => {
|
||||
enqueueSnackbar(err.message, {
|
||||
variant: 'error',
|
||||
anchorOrigin: { vertical: 'top', horizontal: 'right' },
|
||||
autoHideDuration: 2000
|
||||
autoHideDuration: 1000
|
||||
});
|
||||
});
|
||||
} catch (err) {
|
||||
@@ -722,6 +722,7 @@ const Createorder1 = () => {
|
||||
const [tenantlocation, setTenantlocation] = useState('');
|
||||
|
||||
const [pickupswitch, setPickupswitch] = useState(true);
|
||||
const [deliverytype, setDeliverytype] = useState('B');
|
||||
const [dropswitch, setDropswitch] = useState(false);
|
||||
const [startPoint, setStartPoint] = useState({ latitude: 0, longitude: 0 });
|
||||
const [endPoint, setEndPoint] = useState({ latitude: 0, longitude: 0 });
|
||||
@@ -958,8 +959,6 @@ const Createorder1 = () => {
|
||||
|
||||
let arr = [];
|
||||
for (let i = starttime, j = 0; dayjs(endtime).diff(i, 'm') >= 0; j++, i = dayjs(i).add(30, 'm')) {
|
||||
// console.log(dayjs(endtime).diff(i, 'm'));
|
||||
// console.log(dayjs(i).format('hh:mm A'));
|
||||
arr.push(i);
|
||||
}
|
||||
console.log(arr);
|
||||
@@ -977,7 +976,7 @@ const Createorder1 = () => {
|
||||
enqueueSnackbar(message, {
|
||||
variant: 'error',
|
||||
anchorOrigin: { vertical: 'top', horizontal: 'right' },
|
||||
autoHideDuration: 2000
|
||||
autoHideDuration: 1000
|
||||
});
|
||||
console.log(alertmessage);
|
||||
};
|
||||
@@ -1021,6 +1020,7 @@ const Createorder1 = () => {
|
||||
deliverytime: `${dayjs(startdate).format('YYYY-MM-DD')} ${dayjs(selectedtime.$d).format('HH:mm:ss')}`,
|
||||
deliverylocationid: clientinfo.deliverylocationid,
|
||||
deliveryaddress: clientinfo.address,
|
||||
deliverytype: deliverytype,
|
||||
pickupaddress: tenantinfo.address,
|
||||
pickuplat: startPoint.latitude,
|
||||
pickuplong: startPoint.longitude,
|
||||
@@ -1055,7 +1055,7 @@ const Createorder1 = () => {
|
||||
enqueueSnackbar('Order Created Successfully', {
|
||||
variant: 'success',
|
||||
anchorOrigin: { vertical: 'top', horizontal: 'right' },
|
||||
autoHideDuration: 2000
|
||||
autoHideDuration: 1000
|
||||
});
|
||||
if (admintoken) {
|
||||
notifyadmin(admintoken);
|
||||
@@ -1192,7 +1192,7 @@ const Createorder1 = () => {
|
||||
enqueueSnackbar('Notification sent Successfully', {
|
||||
variant: 'success',
|
||||
anchorOrigin: { vertical: 'top', horizontal: 'right' },
|
||||
autoHideDuration: 2000
|
||||
autoHideDuration: 1000
|
||||
});
|
||||
}
|
||||
setLoading(false);
|
||||
@@ -1202,7 +1202,7 @@ const Createorder1 = () => {
|
||||
enqueueSnackbar(err.message, {
|
||||
variant: 'error',
|
||||
anchorOrigin: { vertical: 'top', horizontal: 'right' },
|
||||
autoHideDuration: 2000
|
||||
autoHideDuration: 1000
|
||||
});
|
||||
setLoading(false);
|
||||
});
|
||||
@@ -1278,10 +1278,12 @@ const Createorder1 = () => {
|
||||
onChange={(e, val) => {
|
||||
if (val) {
|
||||
setPickupswitch(true);
|
||||
setDeliverytype('B');
|
||||
setTenantinfo({});
|
||||
} else {
|
||||
setPickupswitch(false);
|
||||
setTenantinfo({});
|
||||
setDeliverytype('C');
|
||||
}
|
||||
}}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user