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