This commit is contained in:
Malai Raja
2023-12-13 10:33:57 +05:30
parent be9d119961
commit e076b8942f
9 changed files with 280 additions and 92 deletions

Submodule nearlexpressbuild updated: c178408d13...7af311220e

View File

@@ -7,7 +7,8 @@ import { DRAWER_WIDTH, ThemeMode } from 'config';
const openedMixin = (theme) => ({ const openedMixin = (theme) => ({
width: DRAWER_WIDTH, width: DRAWER_WIDTH,
borderRight: `1px solid ${theme.palette.divider}`, // borderRight: `1px solid ${theme.palette.divider}`,
borderRight: 'none',
transition: theme.transitions.create('width', { transition: theme.transitions.create('width', {
easing: theme.transitions.easing.sharp, easing: theme.transitions.easing.sharp,
duration: theme.transitions.duration.enteringScreen duration: theme.transitions.duration.enteringScreen
@@ -22,7 +23,7 @@ const closedMixin = (theme) => ({
easing: theme.transitions.easing.sharp, easing: theme.transitions.easing.sharp,
duration: theme.transitions.duration.leavingScreen duration: theme.transitions.duration.leavingScreen
}), }),
overflowX: 'hidden', // overflowX: 'hidden',
width: theme.spacing(7.5), width: theme.spacing(7.5),
borderRight: 'none', borderRight: 'none',
boxShadow: theme.customShadows.z1, boxShadow: theme.customShadows.z1,

View File

@@ -33,7 +33,10 @@ const MainDrawer = ({ window }) => {
return ( return (
<Box component="nav" sx={{ flexShrink: { md: 0 }, zIndex: 1200 }} aria-label="mailbox folders"> <Box component="nav" sx={{ flexShrink: { md: 0 }, zIndex: 1200 }} aria-label="mailbox folders">
{!matchDownMD ? ( {!matchDownMD ? (
<MiniDrawerStyled variant="permanent" open={drawerOpen} > <MiniDrawerStyled
variant="permanent"
open={drawerOpen}
>
{drawerHeader} {drawerHeader}
{drawerContent} {drawerContent}
</MiniDrawerStyled> </MiniDrawerStyled>

View File

@@ -50,7 +50,12 @@ const MobileSection = () => {
<> <>
<Box sx={{ flexShrink: 0, ml: 0.75 }}> <Box sx={{ flexShrink: 0, ml: 0.75 }}>
<IconButton <IconButton
sx={{ color: 'text.primary', bgcolor: open ? iconBackColorOpen : iconBackColor }} // sx={{ color: 'text.primary', bgcolor: open ? iconBackColorOpen : iconBackColor }}
sx={{ color: '#fff', bgcolor: 'transparent', ml: { xs: 0, lg: -2 },
fontSize:'25px',
':hover':{
color: '#fff', bgcolor: 'transparent'
} }}
aria-label="open more menu" aria-label="open more menu"
ref={anchorRef} ref={anchorRef}
aria-controls={open ? 'menu-list-grow' : undefined} aria-controls={open ? 'menu-list-grow' : undefined}

View File

@@ -71,6 +71,7 @@ const Notification = () => {
return ( return (
<Box sx={{ flexShrink: 0, ml: 0.75 }}> <Box sx={{ flexShrink: 0, ml: 0.75 }}>
<Tooltip title='Notifications'>
<IconButton <IconButton
// color="secondary" // color="secondary"
// variant="light" // variant="light"
@@ -103,6 +104,7 @@ const Notification = () => {
<BellOutlined /> <BellOutlined />
</Badge> </Badge>
</IconButton> </IconButton>
</Tooltip>
<Popper <Popper
placement={matchesXs ? 'bottom' : 'bottom-end'} placement={matchesXs ? 'bottom' : 'bottom-end'}
open={open} open={open}

View File

@@ -96,6 +96,7 @@ navigate('/login')
return ( return (
<Box sx={{ flexShrink: 0, ml: 0.75 }}> <Box sx={{ flexShrink: 0, ml: 0.75 }}>
<Tooltip title='Profile'>
<ButtonBase <ButtonBase
sx={{ sx={{
p: 0.25, p: 0.25,
@@ -120,6 +121,7 @@ navigate('/login')
</Typography> </Typography>
</Stack> </Stack>
</ButtonBase> </ButtonBase>
</Tooltip>
<Popper <Popper
placement="bottom-end" placement="bottom-end"
open={open} open={open}

View File

@@ -237,9 +237,14 @@ const navigate = useNavigate()
<Notification /> <Notification />
{/* <Message /> */} {/* <Message /> */}
{!matchesXs && <Profile />} {/* {!matchesXs && <Profile />}
{matchesXs && <MobileSection />} {matchesXs && <MobileSection />} */}
<Tooltip title='Notifications'>
<Profile />
</Tooltip>
</Stack> </Stack>
</Stack> </Stack>
</> </>

View File

@@ -142,7 +142,7 @@ const Createorder = () => {
const [stafflist, setStafflist] = useState([]); const [stafflist, setStafflist] = useState([]);
const [loading2, setLoading2] = useState(false); const [loading2, setLoading2] = useState(false);
const [loading,setLoading]=useState(false) const [loading, setLoading] = useState(false)
const [shiftarr, setShiftarr] = useState([]); const [shiftarr, setShiftarr] = useState([]);
@@ -167,7 +167,9 @@ const Createorder = () => {
"deliverytime": dayjs(), "deliverytime": dayjs(),
"deliverylocationid": '', "deliverylocationid": '',
"clientname": '', "clientname": '',
"contactno": '' "contactno": '',
"latitude": '',
"longitude": ''
}]) }])
// console.log(dayjs()) // console.log(dayjs())
} }
@@ -227,7 +229,7 @@ const Createorder = () => {
const createsubmitobj1 = async() => { const createsubmitobj1 = async () => {
let arr = [] let arr = []
let timecheck = false; let timecheck = false;
let addresscheck = false; let addresscheck = false;
@@ -269,7 +271,7 @@ const Createorder = () => {
"paymentstatus": 0, "paymentstatus": 0,
"deliverycharge": 0, "deliverycharge": 0,
"deliverytime": `${dayjs(startdate).format('YYYY-MM-DD')} ${dayjs(val.deliverytime.$d).format('HH:mm:ss')}`, "deliverytime": `${dayjs(startdate).format('YYYY-MM-DD')} ${dayjs(val.deliverytime.$d).format('HH:mm:ss')}`,
"deliverylocationid": val.deliverylocationid, // "deliverylocationid": val.deliverylocationid,
"deliveryaddress": val.address, "deliveryaddress": val.address,
"pickupaddress": tenantinfo.address, "pickupaddress": tenantinfo.address,
"pickuplat": tenantinfo.latitude, "pickuplat": tenantinfo.latitude,
@@ -277,9 +279,12 @@ const Createorder = () => {
"ordernotes": otherinstructions, "ordernotes": otherinstructions,
"remarks": "", "remarks": "",
"tenantuserid": parseInt(localStorage.getItem('tenantid')), "tenantuserid": parseInt(localStorage.getItem('tenantid')),
"categoryid":tenantinfo.categoryid, "categoryid": tenantinfo.categoryid,
"subcategoryid":tenantinfo.subcategoryid, "subcategoryid": tenantinfo.subcategoryid,
"partnerid":tenantinfo.partnerid "partnerid": tenantinfo.partnerid,
"deliverylat":val.latitude,
"deliverylong":val.longitude
}) })
}) })
@@ -291,7 +296,7 @@ const Createorder = () => {
} else { } else {
setLoading(true) setLoading(true)
await axios.post(`${process.env.REACT_APP_URL}/orders/createorders`,arr) await axios.post(`${process.env.REACT_APP_URL}/orders/createorders`, arr)
.then((res) => { .then((res) => {
if (res.data.status) { if (res.data.status) {
enqueueSnackbar('Order Created Successfully', { enqueueSnackbar('Order Created Successfully', {
@@ -299,7 +304,7 @@ const Createorder = () => {
autoHideDuration: 2000 autoHideDuration: 2000
}) })
navigate('/orders') navigate('/orders')
}else{ } else {
opentoast(res.data.message) opentoast(res.data.message)
} }
setLoading(false) setLoading(false)
@@ -496,10 +501,12 @@ const Createorder = () => {
sno: 1, sno: 1,
address: '', address: '',
"customerid": '', "customerid": '',
"deliverytime":dayjs(), "deliverytime": dayjs(),
"deliverylocationid": '', "deliverylocationid": '',
"clientname": '', "clientname": '',
"contactno": '' "contactno": '',
"latitude": '',
"longitude": ''
}]) }])
}}>Single</Button> }}>Single</Button>
<Button variant={(tabstatus == 1) ? 'contained' : 'outlined'} onClick={() => { <Button variant={(tabstatus == 1) ? 'contained' : 'outlined'} onClick={() => {
@@ -511,7 +518,9 @@ const Createorder = () => {
"deliverytime": dayjs(), "deliverytime": dayjs(),
"deliverylocationid": '', "deliverylocationid": '',
"clientname": '', "clientname": '',
"contactno": '' "contactno": '',
"latitude": '',
"longitude": ''
}]) }])
}}>Multiple</Button> }}>Multiple</Button>
</ButtonGroup> </ButtonGroup>
@@ -822,7 +831,9 @@ const Createorder = () => {
"deliverytime": dayjs(), "deliverytime": dayjs(),
"deliverylocationid": address.deliverylocationid, "deliverylocationid": address.deliverylocationid,
"clientname": address.firstname, "clientname": address.firstname,
"contactno": address.contactno "contactno": address.contactno,
"latitude": address.latitude,
"longitude": address.longitude
}]) }])
} else { } else {
if (orderarr.find((val2) => val2.customerid == address.customerid)) { if (orderarr.find((val2) => val2.customerid == address.customerid)) {
@@ -839,7 +850,9 @@ const Createorder = () => {
"deliverytime": val2.deliverytime, "deliverytime": val2.deliverytime,
"deliverylocationid": val2.deliverylocationid, "deliverylocationid": val2.deliverylocationid,
"clientname": val2.clientname, "clientname": val2.clientname,
"contactno": val2.contactno "contactno": val2.contactno,
"latitude": val2.latitude,
"longitude": val2.longitude
}) })
}) })
setOrderarr([...arr1]) setOrderarr([...arr1])
@@ -851,7 +864,9 @@ const Createorder = () => {
"deliverytime": dayjs(), "deliverytime": dayjs(),
"deliverylocationid": '', "deliverylocationid": '',
"clientname": '', "clientname": '',
"contactno": '' "contactno": '',
"latitude": '',
"longitude": ''
}]) }])
} }
} else { } else {
@@ -863,8 +878,10 @@ const Createorder = () => {
"customerid": address.customerid, "customerid": address.customerid,
"deliverytime": dayjs(), "deliverytime": dayjs(),
"deliverylocationid": address.deliverylocationid, "deliverylocationid": address.deliverylocationid,
"clientname":address.firstname, "clientname": address.firstname,
"contactno": address.contactno "contactno": address.contactno,
"latitude": address.latitude,
"longitude": address.longitude
}) })
setOrderarr([...arr]) setOrderarr([...arr])
} }
@@ -880,8 +897,10 @@ const Createorder = () => {
"customerid": address.customerid, "customerid": address.customerid,
"deliverytime": dayjs(), "deliverytime": dayjs(),
"deliverylocationid": address.deliverylocationid, "deliverylocationid": address.deliverylocationid,
"clientname":address.firstname, "clientname": address.firstname,
"contactno": address.contactno "contactno": address.contactno,
"latitude": address.latitude,
"longitude": address.longitude
}]) }])
// console.log({ // console.log({
@@ -905,7 +924,7 @@ const Createorder = () => {
'&:hover': { '&:hover': {
// bgcolor: theme.palette.primary.lighter, // bgcolor: theme.palette.primary.lighter,
// borderColor: theme.palette.primary.lighter // borderColor: theme.palette.primary.lighter
bgcolor:(orderarr.find((val2) => val2.customerid == address.customerid)) ? '#e1bee7' : '' bgcolor: (orderarr.find((val2) => val2.customerid == address.customerid)) ? '#e1bee7' : ''
}, },
bgcolor: (orderarr.find((val2) => val2.customerid == address.customerid)) ? '#e1bee7' : '' bgcolor: (orderarr.find((val2) => val2.customerid == address.customerid)) ? '#e1bee7' : ''
}} }}
@@ -1005,7 +1024,7 @@ const Createorder = () => {
<Typography variant="caption" color="textSecondary"> <Typography variant="caption" color="textSecondary">
{ val.contactno} {val.contactno}
</Typography> </Typography>
</Stack> </Stack>
</Stack> </Stack>

View File

@@ -1,6 +1,9 @@
// import React from 'react'; // import React from 'react';
// import Createstaff from 'pages/createstaff' // import Createstaff from 'pages/createstaff'
import { enqueueSnackbar } from 'notistack'; import { enqueueSnackbar } from 'notistack';
import { DeleteFilled, NotificationOutlined } from '@ant-design/icons';
import { import {
useState, useState,
useEffect, useEffect,
@@ -64,7 +67,8 @@ import {
import { import {
SearchOutlined, EnvironmentOutlined, UserOutlined, SearchOutlined, EnvironmentOutlined, UserOutlined,
// MoreOutlined // MoreOutlined ,
CloseOutlined
} from '@ant-design/icons'; } from '@ant-design/icons';
import { PopupTransition } from 'components/@extended/Transitions'; import { PopupTransition } from 'components/@extended/Transitions';
@@ -224,11 +228,11 @@ import {
disablePadding: false, disablePadding: false,
label: 'STATUS', label: 'STATUS',
}, },
// { {
// id: 'action', id: 'action',
// disablePadding: false, disablePadding: false,
// label: 'ACTION', label: 'ACTION',
// } }
]; ];
@@ -294,6 +298,53 @@ import {
const [dialogopen, setDialogopen] = useState(false); const [dialogopen, setDialogopen] = useState(false);
const [stafflist, setStafflist] = useState([]) const [stafflist, setStafflist] = useState([])
const [loading1, setLoading1] = useState(false) const [loading1, setLoading1] = useState(false)
const [open,setOpen]=useState(false);
const [orderheaderid,setOrderheaderid]=useState('')
const cancelorder = async () => {
await axios.put(`${process.env.REACT_APP_URL}/orders/updateorder`, {
"orderheaderid": orderheaderid,
"orderstatus": "cancelled",
"cancelled": dayjs().format('YYYY-MM-DD HH:mm:ss')
})
.then((res) => {
console.log(res)
if (res.data.status) {
// if (orderheaderid && tenantid) {
// fetchorderdetails();
// fetchorderaddons();
// fetchorderattires();
// }
enqueueSnackbar('Order Cancelled Successfully', {
variant: 'success', anchorOrigin: { vertical: 'top', horizontal: 'right' },
autoHideDuration: 2000
})
handleClose(true);
if (localStorage.getItem('tenantid')) {
setTenantid(localStorage.getItem('tenantid'))
let val = localStorage.getItem('tenantid')
fetchtable(val);
fetchpercentage(val);
fetchtableuncovered(val);
fetchtablecovered(val);
fetchtablecancelled(val);
fetchtableassigned(val);
fetchtablepicked(val);
fetchtablecreated(val);
}
}
}).catch((err) => {
console.log(err)
})
}
const fetchstafflist = async (odid) => { const fetchstafflist = async (odid) => {
@@ -371,10 +422,73 @@ import {
[order, orderBy, page, rowsPerPage], [order, orderBy, page, rowsPerPage],
); );
const handleClose = () => {
setOpen(false);
setOrderheaderid('')
};
function AlertCustomerDelete({
// title,
open, handleClose }) {
// const [deletepassword, setDeletepassword] = useState('');
return (
<Dialog
open={open}
onClose={()=>handleClose(false)}
// keepMounted
// TransitionComponent={PopupTransition}
maxWidth="xs"
// aria-labelledby="column-delete-title"
// aria-describedby="column-delete-description"
>
<DialogContent sx={{ mt: 2, my: 1 }}>
<Stack alignItems="center" spacing={3.5}>
<Avatar color="error" sx={{ width: 72, height: 72, fontSize: '1.75rem' }}>
<DeleteFilled />
</Avatar>
{/* <Grid >
<Chip label={orderid.slice(4)} variant="combined" color='warning' size='small' />
</Grid> */}
<Stack spacing={2}>
<Typography variant="h4" align="center">
Are you sure you want to cancel this order?
</Typography>
{/* <Typography variant="h4" align="center">
Please type in the order number to confirm.
</Typography> */}
</Stack>
<Stack direction="row" spacing={2} sx={{ width: 1 }}>
<Button fullWidth color="error" variant="contained" onClick={() => {
// if (deletepassword === orderid.slice(4)) {
cancelorder();
// }
}} autoFocus>
Yes, Cancel
</Button>
<Button fullWidth onClick={() =>{
handleClose(false)
} } color="secondary" variant="outlined">
No
</Button>
</Stack>
</Stack>
</DialogContent>
</Dialog>
);
}
return ( return (
<Box sx={{ width: '100%' }}> <Box sx={{ width: '100%' }}>
<AlertCustomerDelete open={open} handleClose={handleClose} />
<TableContainer sx={{ width: '100%', borderBottom: 1, borderColor: 'divider' }}> <TableContainer sx={{ width: '100%', borderBottom: 1, borderColor: 'divider' }}>
@@ -517,9 +631,14 @@ import {
<Typography variant='body2' noWrap>{row.orderid}</Typography> <Typography variant='body2' noWrap>{row.orderid}</Typography>
<Typography noWrap <Typography noWrap
sx={{ fontSize: '11px' }}> sx={{ fontSize: '11px' }}>
{dayjs(row.deliverydate).utc().format('MM/DD/YYYY hh:mm A')} {dayjs(row.deliverydate).utc().format('MM/DD/YYYY')}
</Typography>
<Typography noWrap
sx={{ fontSize: '11px' }}
variant='h5'
>
{dayjs(row.deliverydate).utc().format('hh:mm A')}
</Typography> </Typography>
</TableCell> </TableCell>
<TableCell align="left"> <TableCell align="left">
<Stack direction='column'> <Stack direction='column'>
@@ -648,25 +767,39 @@ import {
<TableCell>
{/* <Tooltip title='View'> {(row.orderstatus == 'created')&&
<>
<Tooltip title='Cancel'>
<IconButton <IconButton
disabled // disabled
onClick={(e) => { onClick={(e) => {
e.stopPropagation(); e.stopPropagation();
setOrderheaderid(row.orderheaderid)
navigate(`/details`, { setOpen(true)
state: { // navigate(`/details`, {
orderheaderid: row.orderheaderid, // state: {
tenantid: row.tenantid // orderheaderid: row.orderheaderid,
} // tenantid: row.tenantid
}) // }
// })
}}> }}>
<EyeTwoTone twoToneColor={theme.palette.secondary.main} /> {/* <EyeTwoTone twoToneColor={theme.palette.secondary.main} /> */}
<CloseOutlined
style={{
color:theme.palette.error.main
}}
// twoToneColor={theme.palette.primary.main}
/>
</IconButton> </IconButton>
</Tooltip> </Tooltip>
</>
</TableCell> */} }
</TableCell>
</TableRow> </TableRow>
<TableRow > <TableRow >
<TableCell style={{ paddingBottom: 0, paddingTop: 0, paddingLeft: 0, paddingRight: 0 }} colSpan={8} sx={{ width: '100%' }}> <TableCell style={{ paddingBottom: 0, paddingTop: 0, paddingLeft: 0, paddingRight: 0 }} colSpan={8} sx={{ width: '100%' }}>
@@ -1085,10 +1218,10 @@ import {
const [completed, setCompleted] = useState(''); const [completed, setCompleted] = useState('');
const [closed, setClosed] = useState(''); const [closed, setClosed] = useState('');
const [picked,setPicked] = useState('') const [picked,setPicked] = useState('')
const [created,setCreated]=useState('')
const [tabstatus, setTabstatus] = useState('Created');
const [tabstatus, setTabstatus] = useState('All Orders');
const [loading, setLoading] = useState(true) const [loading, setLoading] = useState(true)
const theme = useTheme(); const theme = useTheme();
let [rows, setRows] = useState([]) let [rows, setRows] = useState([])
@@ -1109,8 +1242,8 @@ import {
setTabvalue(i); setTabvalue(i);
if (i === 0) setTabstatus('All orders') // if (i === 0) setTabstatus('All orders')
// if (i === 1) setTabstatus('Created') if (i === 0) setTabstatus('Created')
// if (i === 2) setTabstatus('Modified') // if (i === 2) setTabstatus('Modified')
if (i === 1) setTabstatus('Pending') if (i === 1) setTabstatus('Pending')
@@ -1195,11 +1328,11 @@ import {
// if (tabstatus === 'Cancelled') setRows(orderarrcancelled) // if (tabstatus === 'Cancelled') setRows(orderarrcancelled)
// if (tabstatus === 'Assigned') setRows(orderarrassigned) // if (tabstatus === 'Assigned') setRows(orderarrassigned)
// if (tabstatus === 'Confirmed') setRows(orderarrconfirmed) // if (tabstatus === 'Confirmed') setRows(orderarrconfirmed)
// if (tabstatus === 'Modified') setRows(orderarrmodified) if (tabstatus === 'Created') setRows(orderarrcreated)
if (tabstatus === 'All orders') setRows(orderarr) if (tabstatus === 'All orders') setRows(orderarr)
if (tabstatus === 'Delivered') setRows(orderarrcovered) if (tabstatus === 'Delivered') setRows(orderarrcovered)
if (tabstatus === 'Pending') setRows(orderarrcreated) if (tabstatus === 'Pending') setRows(orderarruncovered)
// if (tabstatus === 'Active') setRows(orderarractive) // if (tabstatus === 'Active') setRows(orderarractive)
// if (tabstatus === 'Pending') setRows(orderarruncovered) // if (tabstatus === 'Pending') setRows(orderarruncovered)
@@ -1256,9 +1389,10 @@ import {
return (val.orderid.toLowerCase().includes(searchword.toLowerCase()) return (val.orderid.toLowerCase().includes(searchword.toLowerCase())
|| val.deliveryaddress.toLowerCase().includes(searchword.toLowerCase()) || val.deliveryaddress.toLowerCase().includes(searchword.toLowerCase())
// || val.tenantname.toLowerCase().includes(searchword.toLowerCase()) || val.customername.toLowerCase().includes(searchword.toLowerCase())
|| val.pickupaddress.toString().toLowerCase().includes(searchword.toLowerCase()) || val.pickupaddress.toString().toLowerCase().includes(searchword.toLowerCase())
|| val.ordernotes.toString().toLowerCase().includes(searchword.toLowerCase()) || val.ordernotes.toString().toLowerCase().includes(searchword.toLowerCase())
|| val.contactno.toString().toLowerCase().includes(searchword.toLowerCase())
) )
}) })
@@ -1277,6 +1411,8 @@ import {
|| val.pickupaddress.toString().toLowerCase().includes(searchword.toLowerCase()) || val.pickupaddress.toString().toLowerCase().includes(searchword.toLowerCase())
|| val.ordernotes.toString().toLowerCase().includes(searchword.toLowerCase()) || val.ordernotes.toString().toLowerCase().includes(searchword.toLowerCase())
|| val.deliveryaddress.toLowerCase().includes(searchword.toLowerCase()) || val.deliveryaddress.toLowerCase().includes(searchword.toLowerCase())
|| val.customername.toLowerCase().includes(searchword.toLowerCase())
|| val.contactno.toString().toLowerCase().includes(searchword.toLowerCase())
) )
}) })
@@ -1292,9 +1428,10 @@ import {
return (val.orderid.toLowerCase().includes(searchword.toLowerCase()) return (val.orderid.toLowerCase().includes(searchword.toLowerCase())
|| val.eventname.toLowerCase().includes(searchword.toLowerCase()) || val.eventname.toLowerCase().includes(searchword.toLowerCase())
|| val.tenantname.toLowerCase().includes(searchword.toLowerCase()) || val.customername.toLowerCase().includes(searchword.toLowerCase())
|| val.ordervalue.toString().toLowerCase().includes(searchword.toLowerCase()) || val.ordervalue.toString().toLowerCase().includes(searchword.toLowerCase())
|| val.deliveryaddress.toLowerCase().includes(searchword.toLowerCase()) || val.deliveryaddress.toLowerCase().includes(searchword.toLowerCase())
|| val.contactno.toString().toLowerCase().includes(searchword.toLowerCase())
) )
}) })
@@ -1306,19 +1443,21 @@ import {
} else if (tabstatus === 'Pending') { } else if (tabstatus === 'Pending') {
if (searchword) { if (searchword) {
let arr = orderarruncovered.filter((val) => { let arr = orderarrcreated.filter((val) => {
return (val.orderid.toLowerCase().includes(searchword.toLowerCase()) return (val.orderid.toLowerCase().includes(searchword.toLowerCase())
|| val.pickupaddress.toString().toLowerCase().includes(searchword.toLowerCase()) || val.pickupaddress.toString().toLowerCase().includes(searchword.toLowerCase())
|| val.ordernotes.toString().toLowerCase().includes(searchword.toLowerCase()) || val.ordernotes.toString().toLowerCase().includes(searchword.toLowerCase())
|| val.deliveryaddress.toLowerCase().includes(searchword.toLowerCase()) || val.deliveryaddress.toLowerCase().includes(searchword.toLowerCase())
|| val.customername.toLowerCase().includes(searchword.toLowerCase())
|| val.contactno.toString().toLowerCase().includes(searchword.toLowerCase())
) )
}) })
console.log(arr) console.log(arr)
setRows([...arr]) setRows([...arr])
} else { } else {
setRows([...orderarruncovered]) setRows([...orderarrcreated])
} }
} else if (tabstatus === 'Cancelled') { } else if (tabstatus === 'Cancelled') {
@@ -1327,9 +1466,10 @@ import {
return (val.orderid.toLowerCase().includes(searchword.toLowerCase()) return (val.orderid.toLowerCase().includes(searchword.toLowerCase())
|| val.eventname.toLowerCase().includes(searchword.toLowerCase()) || val.eventname.toLowerCase().includes(searchword.toLowerCase())
|| val.tenantname.toLowerCase().includes(searchword.toLowerCase()) || val.customername.toLowerCase().includes(searchword.toLowerCase())
|| val.ordervalue.toString().toLowerCase().includes(searchword.toLowerCase()) || val.ordervalue.toString().toLowerCase().includes(searchword.toLowerCase())
|| val.deliveryaddress.toLowerCase().includes(searchword.toLowerCase()) || val.deliveryaddress.toLowerCase().includes(searchword.toLowerCase())
|| val.contactno.toString().toLowerCase().includes(searchword.toLowerCase())
) )
}) })
@@ -1347,6 +1487,8 @@ import {
|| val.pickupaddress.toString().toLowerCase().includes(searchword.toLowerCase()) || val.pickupaddress.toString().toLowerCase().includes(searchword.toLowerCase())
|| val.ordernotes.toString().toLowerCase().includes(searchword.toLowerCase()) || val.ordernotes.toString().toLowerCase().includes(searchword.toLowerCase())
|| val.deliveryaddress.toLowerCase().includes(searchword.toLowerCase()) || val.deliveryaddress.toLowerCase().includes(searchword.toLowerCase())
|| val.customername.toLowerCase().includes(searchword.toLowerCase())
|| val.contactno.toString().toLowerCase().includes(searchword.toLowerCase())
) )
}) })
@@ -1364,6 +1506,8 @@ import {
|| val.pickupaddress.toString().toLowerCase().includes(searchword.toLowerCase()) || val.pickupaddress.toString().toLowerCase().includes(searchword.toLowerCase())
|| val.ordernotes.toString().toLowerCase().includes(searchword.toLowerCase()) || val.ordernotes.toString().toLowerCase().includes(searchword.toLowerCase())
|| val.deliveryaddress.toLowerCase().includes(searchword.toLowerCase()) || val.deliveryaddress.toLowerCase().includes(searchword.toLowerCase())
|| val.customername.toLowerCase().includes(searchword.toLowerCase())
|| val.contactno.toString().toLowerCase().includes(searchword.toLowerCase())
) )
}) })
@@ -1383,6 +1527,7 @@ import {
|| val.tenantname.toLowerCase().includes(searchword.toLowerCase()) || val.tenantname.toLowerCase().includes(searchword.toLowerCase())
|| val.ordervalue.toString().toLowerCase().includes(searchword.toLowerCase()) || val.ordervalue.toString().toLowerCase().includes(searchword.toLowerCase())
|| val.deliveryaddress.toLowerCase().includes(searchword.toLowerCase()) || val.deliveryaddress.toLowerCase().includes(searchword.toLowerCase())
|| val.contactno.toString().toLowerCase().includes(searchword.toLowerCase())
) )
}) })
@@ -1402,6 +1547,7 @@ import {
|| val.tenantname.toLowerCase().includes(searchword.toLowerCase()) || val.tenantname.toLowerCase().includes(searchword.toLowerCase())
|| val.ordervalue.toString().toLowerCase().includes(searchword.toLowerCase()) || val.ordervalue.toString().toLowerCase().includes(searchword.toLowerCase())
|| val.deliveryaddress.toLowerCase().includes(searchword.toLowerCase()) || val.deliveryaddress.toLowerCase().includes(searchword.toLowerCase())
|| val.contactno.toString().toLowerCase().includes(searchword.toLowerCase())
) )
}) })
@@ -1416,6 +1562,8 @@ import {
|| val.pickupaddress.toString().toLowerCase().includes(searchword.toLowerCase()) || val.pickupaddress.toString().toLowerCase().includes(searchword.toLowerCase())
|| val.ordernotes.toString().toLowerCase().includes(searchword.toLowerCase()) || val.ordernotes.toString().toLowerCase().includes(searchword.toLowerCase())
|| val.deliveryaddress.toLowerCase().includes(searchword.toLowerCase()) || val.deliveryaddress.toLowerCase().includes(searchword.toLowerCase())
|| val.customername.toLowerCase().includes(searchword.toLowerCase())
|| val.contactno.toString().toLowerCase().includes(searchword.toLowerCase())
) )
}) })
@@ -1501,6 +1649,9 @@ import {
arr = [...arr, { ...val, sno: i + 1 }]; arr = [...arr, { ...val, sno: i + 1 }];
}) })
setArrcreated(arr) setArrcreated(arr)
if(tabstatus == 'Created'){
setRows(arr)
}
// } // }
}).catch((err) => { }).catch((err) => {
console.log(err) console.log(err)
@@ -1729,7 +1880,7 @@ import {
setUncoveredorders(res.data.details.pending.toString()) setUncoveredorders(res.data.details.pending.toString())
// setActiveorders(res.data.details.assigned.toString()); // setActiveorders(res.data.details.assigned.toString());
setAssigned(res.data.details.accepted.toString()); setAssigned(res.data.details.accepted.toString());
setCreated(res.data.details.created.toString())
setClosed(res.data.details.delivered.toString()); setClosed(res.data.details.delivered.toString());
setPicked(res.data.details.picked.toString()) setPicked(res.data.details.picked.toString())
setPercentage1((Math.round((res.data.details.pending/ res.data.details.total) * 100) || 0).toString()) setPercentage1((Math.round((res.data.details.pending/ res.data.details.total) * 100) || 0).toString())
@@ -1935,14 +2086,14 @@ import {
}}> }}>
<Tabs value={tabvalue} onChange={handleChangetab} variant="scrollable" scrollButtons="auto" > <Tabs value={tabvalue} onChange={handleChangetab} variant="scrollable" scrollButtons="auto" >
<Tab label="All orders" {/* <Tab label="All orders"
iconPosition="end" iconPosition="end"
icon={<Chip label={allorders} color="primary" variant="light" size="small" />} icon={<Chip label={allorders} color="primary" variant="light" size="small" />}
/>
{/* <Tab label="Created"
icon={<Chip label={modified} color="primary" variant="light" size="small" />}
iconPosition="end"
/> */} /> */}
<Tab label="Created"
icon={<Chip label={created} color="primary" variant="light" size="small" />}
iconPosition="end"
/>
<Tab label="Pending" <Tab label="Pending"
icon={<Chip label={uncoveredorders} color="primary" variant="light" size="small" />} icon={<Chip label={uncoveredorders} color="primary" variant="light" size="small" />}
iconPosition="end" iconPosition="end"
@@ -2026,7 +2177,7 @@ import {
</Grid> </Grid>
<Dialog open={open} > {/* <Dialog open={open} >
<DialogTitle align='left'> <DialogTitle align='left'>
<Typography variant='h4'>Select Filter Options</Typography> <Typography variant='h4'>Select Filter Options</Typography>
</DialogTitle> </DialogTitle>
@@ -2116,7 +2267,7 @@ import {
</Stack> </Stack>
</Dialog> </Dialog>
*/}