19122023
This commit is contained in:
Submodule nearlexpressbuild updated: 088ac08a24...5d8638cb57
@@ -5,7 +5,7 @@
|
|||||||
<link rel="icon" href="%PUBLIC_URL%/favicon.png" />
|
<link rel="icon" href="%PUBLIC_URL%/favicon.png" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<meta name="theme-color" content="#000000" />
|
<meta name="theme-color" content="#000000" />
|
||||||
<meta name="description" content="Nearle" />
|
<meta name="description" content="Nearle Neighbourhood commerce" />
|
||||||
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
|
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
@@ -27,6 +27,11 @@
|
|||||||
|
|
||||||
<!-- this is to resolve issue in old safari browser in tablet -->
|
<!-- this is to resolve issue in old safari browser in tablet -->
|
||||||
<script src="https://cdn.jsdelivr.net/npm/resize-observer-polyfill@1.5.1/dist/ResizeObserver.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/resize-observer-polyfill@1.5.1/dist/ResizeObserver.min.js"></script>
|
||||||
|
<style>
|
||||||
|
.datedialog > div > div > .MuiPaper-root{
|
||||||
|
box-shadow: none !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||||
|
|||||||
@@ -8,22 +8,22 @@ import {
|
|||||||
useState,
|
useState,
|
||||||
useEffect,
|
useEffect,
|
||||||
Fragment
|
Fragment
|
||||||
} from 'react';
|
} from 'react';
|
||||||
import { Empty } from 'antd';
|
import { Empty } from 'antd';
|
||||||
import { DatePicker } from '@mui/x-date-pickers/DatePicker';
|
import { DatePicker } from '@mui/x-date-pickers/DatePicker';
|
||||||
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
|
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
var utc = require('dayjs/plugin/utc')
|
var utc = require('dayjs/plugin/utc')
|
||||||
dayjs.extend(utc)
|
dayjs.extend(utc)
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
|
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
|
||||||
// import { DataGrid } from '@mui/x-data-grid'
|
// import { DataGrid } from '@mui/x-data-grid'
|
||||||
// material-ui
|
// material-ui
|
||||||
import HoverSocialCard from 'components/cards/statistics/HoverSocialCard';
|
import HoverSocialCard from 'components/cards/statistics/HoverSocialCard';
|
||||||
// import {FacebookOutlined} from '@ant-design/icons';
|
// import {FacebookOutlined} from '@ant-design/icons';
|
||||||
import { useTheme } from '@mui/material/styles';
|
import { useTheme } from '@mui/material/styles';
|
||||||
// import { edittabstatus1 } from 'store/reducers/dashboard1';
|
// import { edittabstatus1 } from 'store/reducers/dashboard1';
|
||||||
import {
|
import {
|
||||||
Avatar,
|
Avatar,
|
||||||
// AvatarGroup,
|
// AvatarGroup,
|
||||||
// Button as Button1,
|
// Button as Button1,
|
||||||
@@ -58,25 +58,25 @@ import {
|
|||||||
// ClickAwayListener
|
// ClickAwayListener
|
||||||
|
|
||||||
// Checkbox
|
// Checkbox
|
||||||
} from '@mui/material';
|
} from '@mui/material';
|
||||||
import MainCard from 'components/MainCard';
|
import MainCard from 'components/MainCard';
|
||||||
|
|
||||||
// import { useSelector } from 'store';
|
// import { useSelector } from 'store';
|
||||||
// import { useDispatch } from 'react-redux';
|
// import { useDispatch } from 'react-redux';
|
||||||
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
SearchOutlined, EnvironmentOutlined, UserOutlined,
|
SearchOutlined, EnvironmentOutlined, UserOutlined,
|
||||||
// MoreOutlined ,
|
// MoreOutlined ,
|
||||||
CloseOutlined
|
CloseOutlined
|
||||||
} from '@ant-design/icons';
|
} from '@ant-design/icons';
|
||||||
import { PopupTransition } from 'components/@extended/Transitions';
|
import { PopupTransition } from 'components/@extended/Transitions';
|
||||||
|
|
||||||
// import FilterList from '@mui/icons-material/FilterList';
|
// import FilterList from '@mui/icons-material/FilterList';
|
||||||
import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
|
import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
|
||||||
import KeyboardArrowUpIcon from '@mui/icons-material/KeyboardArrowUp';
|
import KeyboardArrowUpIcon from '@mui/icons-material/KeyboardArrowUp';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
addDays,
|
addDays,
|
||||||
addMonths,
|
addMonths,
|
||||||
addWeeks,
|
addWeeks,
|
||||||
@@ -87,57 +87,57 @@ import {
|
|||||||
startOfMonth,
|
startOfMonth,
|
||||||
startOfWeek,
|
startOfWeek,
|
||||||
// startOfYear,
|
// startOfYear,
|
||||||
} from 'date-fns';
|
} from 'date-fns';
|
||||||
|
|
||||||
// import { DateRangePicker } from '@mui/x-date-pickers-pro/DateRangePicker';
|
// import { DateRangePicker } from '@mui/x-date-pickers-pro/DateRangePicker';
|
||||||
// import { DesktopDateRangePicker } from '@mui/x-date-pickers-pro/DesktopDateRangePicker';
|
// import { DesktopDateRangePicker } from '@mui/x-date-pickers-pro/DesktopDateRangePicker';
|
||||||
// import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns';
|
// import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns';
|
||||||
// import { DateRangePicker } from "mui-daterange-picker-orient";
|
// import { DateRangePicker } from "mui-daterange-picker-orient";
|
||||||
import { DateRangePicker } from "mui-daterange-picker";
|
import { DateRangePicker } from "mui-daterange-picker";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// import EnhancedTable from 'components/tablemuiedit'
|
// import EnhancedTable from 'components/tablemuiedit'
|
||||||
import {
|
import {
|
||||||
// CloseOutlined,
|
// CloseOutlined,
|
||||||
// PlusOutlined,
|
// PlusOutlined,
|
||||||
EyeTwoTone,
|
EyeTwoTone,
|
||||||
// EditTwoTone,
|
// EditTwoTone,
|
||||||
// DeleteTwoTone
|
// DeleteTwoTone
|
||||||
} from '@ant-design/icons';
|
} from '@ant-design/icons';
|
||||||
|
|
||||||
import { useNavigate } from 'react-router';
|
import { useNavigate } from 'react-router';
|
||||||
|
|
||||||
|
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
// import { alpha } from '@mui/material/styles';
|
// import { alpha } from '@mui/material/styles';
|
||||||
// import Box from '@mui/material/Box';
|
// import Box from '@mui/material/Box';
|
||||||
// import Table from '@mui/material/Table';
|
// import Table from '@mui/material/Table';
|
||||||
// import TableBody from '@mui/material/TableBody';
|
// import TableBody from '@mui/material/TableBody';
|
||||||
// import TableCell from '@mui/material/TableCell';
|
// import TableCell from '@mui/material/TableCell';
|
||||||
import TableContainer from '@mui/material/TableContainer';
|
import TableContainer from '@mui/material/TableContainer';
|
||||||
// import TableHead from '@mui/material/TableHead';
|
// import TableHead from '@mui/material/TableHead';
|
||||||
import TablePagination from '@mui/material/TablePagination';
|
import TablePagination from '@mui/material/TablePagination';
|
||||||
// import TableRow from '@mui/material/TableRow';
|
// import TableRow from '@mui/material/TableRow';
|
||||||
// import TablePagination from '@mui/material/TablePagination';
|
// import TablePagination from '@mui/material/TablePagination';
|
||||||
import TableSortLabel from '@mui/material/TableSortLabel';
|
import TableSortLabel from '@mui/material/TableSortLabel';
|
||||||
// import Toolbar from '@mui/material/Toolbar';
|
// import Toolbar from '@mui/material/Toolbar';
|
||||||
// import Typography from '@mui/material/Typography';
|
// import Typography from '@mui/material/Typography';
|
||||||
// import Paper from '@mui/material/Paper';
|
// import Paper from '@mui/material/Paper';
|
||||||
// import Checkbox from '@mui/material/Checkbox';
|
// import Checkbox from '@mui/material/Checkbox';
|
||||||
// import IconButton from '@mui/material/IconButton';
|
// import IconButton from '@mui/material/IconButton';
|
||||||
// import Tooltip from '@mui/material/Tooltip';
|
// import Tooltip from '@mui/material/Tooltip';
|
||||||
// import FormControlLabel from '@mui/material/FormControlLabel';
|
// import FormControlLabel from '@mui/material/FormControlLabel';
|
||||||
// // import Switch from '@mui/material/Switch';
|
// // import Switch from '@mui/material/Switch';
|
||||||
// import DeleteIcon from '@mui/icons-material/Delete';
|
// import DeleteIcon from '@mui/icons-material/Delete';
|
||||||
// import FilterListIcon from '@mui/icons-material/FilterList';
|
// import FilterListIcon from '@mui/icons-material/FilterList';
|
||||||
import { visuallyHidden } from '@mui/utils';
|
import { visuallyHidden } from '@mui/utils';
|
||||||
import Loader from 'components/Loader'
|
import Loader from 'components/Loader'
|
||||||
import { FilterList } from '@mui/icons-material';
|
import { FilterList } from '@mui/icons-material';
|
||||||
// import MainCard from 'components/MainCard';
|
// import MainCard from 'components/MainCard';
|
||||||
// import DialogTitle from 'themes/overrides/DialogTitle';
|
// import DialogTitle from 'themes/overrides/DialogTitle';
|
||||||
// import MainCard from 'components/MainCard';
|
// import MainCard from 'components/MainCard';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -145,7 +145,7 @@ import {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
const Orders = () => {
|
const Orders = () => {
|
||||||
|
|
||||||
|
|
||||||
function descendingComparator(a, b, orderBy) {
|
function descendingComparator(a, b, orderBy) {
|
||||||
@@ -298,8 +298,8 @@ 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 [open, setOpen] = useState(false);
|
||||||
const [orderheaderid,setOrderheaderid]=useState('')
|
const [orderheaderid, setOrderheaderid] = useState('')
|
||||||
|
|
||||||
const cancelorder = async () => {
|
const cancelorder = async () => {
|
||||||
|
|
||||||
@@ -334,8 +334,8 @@ import {
|
|||||||
fetchtableuncovered(val);
|
fetchtableuncovered(val);
|
||||||
fetchtablecovered(val);
|
fetchtablecovered(val);
|
||||||
fetchtablecancelled(val);
|
fetchtablecancelled(val);
|
||||||
fetchtableassigned(val);
|
// fetchtableassigned(val);
|
||||||
fetchtablepicked(val);
|
// fetchtablepicked(val);
|
||||||
fetchtablecreated(val);
|
fetchtablecreated(val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -436,7 +436,7 @@ import {
|
|||||||
return (
|
return (
|
||||||
<Dialog
|
<Dialog
|
||||||
open={open}
|
open={open}
|
||||||
onClose={()=>handleClose(false)}
|
onClose={() => handleClose(false)}
|
||||||
// keepMounted
|
// keepMounted
|
||||||
// TransitionComponent={PopupTransition}
|
// TransitionComponent={PopupTransition}
|
||||||
maxWidth="xs"
|
maxWidth="xs"
|
||||||
@@ -472,9 +472,9 @@ import {
|
|||||||
}} autoFocus>
|
}} autoFocus>
|
||||||
Yes, Cancel
|
Yes, Cancel
|
||||||
</Button>
|
</Button>
|
||||||
<Button fullWidth onClick={() =>{
|
<Button fullWidth onClick={() => {
|
||||||
handleClose(false)
|
handleClose(false)
|
||||||
} } color="secondary" variant="outlined">
|
}} color="secondary" variant="outlined">
|
||||||
No
|
No
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
@@ -646,7 +646,7 @@ import {
|
|||||||
<Tooltip title={row.pickupaddress}>
|
<Tooltip title={row.pickupaddress}>
|
||||||
<Typography variant="caption" color="textSecondary"
|
<Typography variant="caption" color="textSecondary"
|
||||||
>
|
>
|
||||||
{row.pickupaddress.slice(0,20)}
|
{row.pickupaddress.slice(0, 20)}
|
||||||
</Typography>
|
</Typography>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</Stack>
|
</Stack>
|
||||||
@@ -658,7 +658,7 @@ import {
|
|||||||
<Tooltip title={row.deliveryaddress}>
|
<Tooltip title={row.deliveryaddress}>
|
||||||
<Typography variant="caption" color="textSecondary"
|
<Typography variant="caption" color="textSecondary"
|
||||||
>
|
>
|
||||||
{row.deliveryaddress.slice(0,20)}
|
{row.deliveryaddress.slice(0, 20)}
|
||||||
</Typography>
|
</Typography>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</Stack>
|
</Stack>
|
||||||
@@ -769,7 +769,7 @@ import {
|
|||||||
|
|
||||||
<TableCell>
|
<TableCell>
|
||||||
|
|
||||||
{(row.orderstatus == 'created')&&
|
{(row.orderstatus == 'created') &&
|
||||||
|
|
||||||
<>
|
<>
|
||||||
|
|
||||||
@@ -791,7 +791,7 @@ import {
|
|||||||
{/* <EyeTwoTone twoToneColor={theme.palette.secondary.main} /> */}
|
{/* <EyeTwoTone twoToneColor={theme.palette.secondary.main} /> */}
|
||||||
<CloseOutlined
|
<CloseOutlined
|
||||||
style={{
|
style={{
|
||||||
color:theme.palette.error.main,
|
color: theme.palette.error.main,
|
||||||
|
|
||||||
}}
|
}}
|
||||||
// twoToneColor={theme.palette.primary.main}
|
// twoToneColor={theme.palette.primary.main}
|
||||||
@@ -800,7 +800,7 @@ import {
|
|||||||
</Tooltip>
|
</Tooltip>
|
||||||
</>
|
</>
|
||||||
|
|
||||||
}
|
}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
<TableRow >
|
<TableRow >
|
||||||
@@ -1176,11 +1176,11 @@ import {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
const [startdate, setStartdate] = useState(''
|
const [startdate, setStartdate] = useState(
|
||||||
// dayjs().format('YYYY-MM-DD')
|
dayjs().format('YYYY-MM-DD')
|
||||||
);
|
);
|
||||||
const [enddate, setEnddate] = useState(''
|
const [enddate, setEnddate] = useState(
|
||||||
// dayjs().format('YYYY-MM-DD')
|
dayjs().format('YYYY-MM-DD')
|
||||||
);
|
);
|
||||||
|
|
||||||
const [tenantid, setTenantid] = useState('')
|
const [tenantid, setTenantid] = useState('')
|
||||||
@@ -1219,8 +1219,8 @@ import {
|
|||||||
const [modified, setModified] = useState('');
|
const [modified, setModified] = useState('');
|
||||||
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 [created, setCreated] = useState('')
|
||||||
|
|
||||||
|
|
||||||
const [tabstatus, setTabstatus] = useState('Created');
|
const [tabstatus, setTabstatus] = useState('Created');
|
||||||
@@ -1232,9 +1232,13 @@ import {
|
|||||||
const [open, setOpen] = useState(false);
|
const [open, setOpen] = useState(false);
|
||||||
const [dateselect, setDateselect] = useState('select');
|
const [dateselect, setDateselect] = useState('select');
|
||||||
|
|
||||||
const [tabstatus1, setTabstatus1] = useState('All');
|
// const [tabstatus1, setTabstatus1] = useState('All');
|
||||||
|
const [tabstatus1, setTabstatus1] = useState('Today');
|
||||||
|
|
||||||
|
|
||||||
|
// const [datestatus, setDatestatus] = useState('All');
|
||||||
|
const [datestatus, setDatestatus] = useState('Today');
|
||||||
|
|
||||||
const [datestatus, setDatestatus] = useState('All');
|
|
||||||
const [searchword, setSearchword] = useState('')
|
const [searchword, setSearchword] = useState('')
|
||||||
|
|
||||||
|
|
||||||
@@ -1249,10 +1253,10 @@ import {
|
|||||||
// if (i === 2) setTabstatus('Modified')
|
// if (i === 2) setTabstatus('Modified')
|
||||||
if (i === 1) setTabstatus('Pending')
|
if (i === 1) setTabstatus('Pending')
|
||||||
|
|
||||||
if (i === 2) setTabstatus('Assigned')
|
// if (i === 2) setTabstatus('Assigned')
|
||||||
if (i === 3) setTabstatus('Picked')
|
// if (i === 3) setTabstatus('Picked')
|
||||||
if (i === 4) setTabstatus('Delivered')
|
if (i === 2) setTabstatus('Delivered')
|
||||||
if (i === 5) setTabstatus('Cancelled')
|
if (i === 3) setTabstatus('Cancelled')
|
||||||
|
|
||||||
// if (i === 0) setTabstatus('All orders')
|
// if (i === 0) setTabstatus('All orders')
|
||||||
// if (i === 1) setTabstatus('Pending')
|
// if (i === 1) setTabstatus('Pending')
|
||||||
@@ -1283,8 +1287,8 @@ import {
|
|||||||
fetchtableuncovered(val);
|
fetchtableuncovered(val);
|
||||||
fetchtablecovered(val);
|
fetchtablecovered(val);
|
||||||
fetchtablecancelled(val);
|
fetchtablecancelled(val);
|
||||||
fetchtableassigned(val);
|
// fetchtableassigned(val);
|
||||||
fetchtablepicked(val);
|
// fetchtablepicked(val);
|
||||||
fetchtablecreated(val);
|
fetchtablecreated(val);
|
||||||
// fetchtableconfirmed(val);
|
// fetchtableconfirmed(val);
|
||||||
// fetchtablemodified(val);
|
// fetchtablemodified(val);
|
||||||
@@ -1308,8 +1312,8 @@ import {
|
|||||||
fetchtableuncovered(val);
|
fetchtableuncovered(val);
|
||||||
fetchtablecovered(val);
|
fetchtablecovered(val);
|
||||||
fetchtablecancelled(val);
|
fetchtablecancelled(val);
|
||||||
fetchtableassigned(val);
|
// fetchtableassigned(val);
|
||||||
fetchtablepicked(val);
|
// fetchtablepicked(val);
|
||||||
// fetchtableconfirmed(val);
|
// fetchtableconfirmed(val);
|
||||||
// fetchtablemodified(val);
|
// fetchtablemodified(val);
|
||||||
// fetchtableclosed(val)
|
// fetchtableclosed(val)
|
||||||
@@ -1369,12 +1373,12 @@ import {
|
|||||||
setEnddate(new Date().toISOString().substring(0, 10));
|
setEnddate(new Date().toISOString().substring(0, 10));
|
||||||
setDateselect('select');
|
setDateselect('select');
|
||||||
}
|
}
|
||||||
else if (tabstatus1 === 'All') {
|
// else if (tabstatus1 === 'All') {
|
||||||
setEnddate('');
|
// setEnddate('');
|
||||||
setStartdate('');
|
// setStartdate('');
|
||||||
|
|
||||||
setDateselect('all');
|
// setDateselect('all');
|
||||||
}
|
// }
|
||||||
}, [tabstatus1]);
|
}, [tabstatus1]);
|
||||||
|
|
||||||
const choosedate = (date) => {
|
const choosedate = (date) => {
|
||||||
@@ -1556,7 +1560,7 @@ import {
|
|||||||
console.log(arr)
|
console.log(arr)
|
||||||
setRows([...arr])
|
setRows([...arr])
|
||||||
}
|
}
|
||||||
}else if (tabstatus === 'Picked') {
|
} else if (tabstatus === 'Picked') {
|
||||||
if (searchword) {
|
if (searchword) {
|
||||||
let arr = orderarrpicked.filter((val) => {
|
let arr = orderarrpicked.filter((val) => {
|
||||||
|
|
||||||
@@ -1576,7 +1580,7 @@ import {
|
|||||||
setRows([...orderarrpicked])
|
setRows([...orderarrpicked])
|
||||||
}
|
}
|
||||||
|
|
||||||
}else if (tabstatus === 'Created') {
|
} else if (tabstatus === 'Created') {
|
||||||
if (searchword) {
|
if (searchword) {
|
||||||
let arr = orderarrcreated.filter((val) => {
|
let arr = orderarrcreated.filter((val) => {
|
||||||
|
|
||||||
@@ -1640,7 +1644,7 @@ import {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
// await axios.get(`${process.env.REACT_APP_URL}/orders/getorders/?tenantid=${tid}&status=completed`)
|
// await axios.get(`${process.env.REACT_APP_URL}/orders/getorders/?tenantid=${tid}&status=completed`)
|
||||||
await axios.get(`${process.env.REACT_APP_URL}/orders/tenant/getorders/?tenantid=${tid}&status=delivered`)
|
await axios.get(`${process.env.REACT_APP_URL}/orders/tenant/getorders/?tenantid=${tid}&status=delivered&fromdate=${startdate}&todate=${enddate}`)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
// if (res.data.message === "Success") {
|
// if (res.data.message === "Success") {
|
||||||
let arr = []
|
let arr = []
|
||||||
@@ -1663,7 +1667,7 @@ import {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
// await axios.get(`${process.env.REACT_APP_URL}/orders/getorders/?tenantid=${tid}&status=completed`)
|
// await axios.get(`${process.env.REACT_APP_URL}/orders/getorders/?tenantid=${tid}&status=completed`)
|
||||||
await axios.get(`${process.env.REACT_APP_URL}/orders/tenant/getorders/?tenantid=${tid}&status=created`)
|
await axios.get(`${process.env.REACT_APP_URL}/orders/tenant/getorders/?tenantid=${tid}&status=created&fromdate=${startdate}&todate=${enddate}`)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
// if (res.data.message === "Success") {
|
// if (res.data.message === "Success") {
|
||||||
let arr = []
|
let arr = []
|
||||||
@@ -1671,7 +1675,7 @@ import {
|
|||||||
arr = [...arr, { ...val, sno: i + 1 }];
|
arr = [...arr, { ...val, sno: i + 1 }];
|
||||||
})
|
})
|
||||||
setArrcreated(arr)
|
setArrcreated(arr)
|
||||||
if(tabstatus == 'Created'){
|
if (tabstatus == 'Created') {
|
||||||
setRows(arr)
|
setRows(arr)
|
||||||
}
|
}
|
||||||
// }
|
// }
|
||||||
@@ -1712,7 +1716,7 @@ import {
|
|||||||
const fetchtableuncovered = async (tid) => {
|
const fetchtableuncovered = async (tid) => {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await axios.get(`${process.env.REACT_APP_URL}/orders/tenant/getorders/?tenantid=${tid}&status=pending`)
|
await axios.get(`${process.env.REACT_APP_URL}/orders/tenant/getorders/?tenantid=${tid}&status=pending&fromdate=${startdate}&todate=${enddate}`)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.data.message === "Success") {
|
if (res.data.message === "Success") {
|
||||||
let arr = []
|
let arr = []
|
||||||
@@ -1735,7 +1739,7 @@ import {
|
|||||||
const fetchtablecancelled = async (tid) => {
|
const fetchtablecancelled = async (tid) => {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await axios.get(`${process.env.REACT_APP_URL}/orders/tenant/getorders/?tenantid=${tid}&status=cancelled`)
|
await axios.get(`${process.env.REACT_APP_URL}/orders/tenant/getorders/?tenantid=${tid}&status=cancelled&fromdate=${startdate}&todate=${enddate}`)
|
||||||
// await axios.get(`${process.env.REACT_APP_URL2}/client/orders/getordersbystatus?tenantid=${tid}&status=cancelled`)
|
// await axios.get(`${process.env.REACT_APP_URL2}/client/orders/getordersbystatus?tenantid=${tid}&status=cancelled`)
|
||||||
|
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
@@ -1761,7 +1765,7 @@ import {
|
|||||||
const fetchtableassigned = async (tid) => {
|
const fetchtableassigned = async (tid) => {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await axios.get(`${process.env.REACT_APP_URL}/orders/tenant/getorders/?tenantid=${tid}&status=accepted`)
|
await axios.get(`${process.env.REACT_APP_URL}/orders/tenant/getorders/?tenantid=${tid}&status=accepted&fromdate=${startdate}&todate=${enddate}`)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
// if (res.data.message === "Success") {
|
// if (res.data.message === "Success") {
|
||||||
let arr = [];
|
let arr = [];
|
||||||
@@ -1785,7 +1789,7 @@ import {
|
|||||||
const fetchtablepicked = async (tid) => {
|
const fetchtablepicked = async (tid) => {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await axios.get(`${process.env.REACT_APP_URL}/orders/tenant/getorders/?tenantid=${tid}&status=picked`)
|
await axios.get(`${process.env.REACT_APP_URL}/orders/tenant/getorders/?tenantid=${tid}&status=picked&fromdate=${startdate}&todate=${enddate}`)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
// if (res.data.message === "Success") {
|
// if (res.data.message === "Success") {
|
||||||
let arr = [];
|
let arr = [];
|
||||||
@@ -1901,26 +1905,26 @@ import {
|
|||||||
setCancelled(res.data.details.cancelled.toString())
|
setCancelled(res.data.details.cancelled.toString())
|
||||||
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())
|
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.total / res.data.details.total) * 100) || 0).toString())
|
||||||
setPercentage3((Math.round((res.data.details.picked / res.data.details.total) * 100) || 0).toString())
|
setPercentage3((Math.round((res.data.details.delivered / res.data.details.total) * 100) || 0).toString())
|
||||||
|
|
||||||
setPercentage4((Math.round((res.data.details.delivered / res.data.details.total) * 100) || 0).toString())
|
setPercentage4((Math.round((res.data.details.cancelled / res.data.details.total) * 100) || 0).toString())
|
||||||
|
|
||||||
setPercentage2((Math.round((res.data.details.accepted / res.data.details.total) * 100) || 0).toString())
|
setPercentage2((Math.round((res.data.details.pending / res.data.details.total) * 100) || 0).toString())
|
||||||
|
|
||||||
|
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
console.log(err)
|
console.log(err)
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
enqueueSnackbar(err.message, {
|
// enqueueSnackbar(err.message, {
|
||||||
variant: 'error', anchorOrigin: { vertical: 'top', horizontal: 'right' },
|
// variant: 'error', anchorOrigin: { vertical: 'top', horizontal: 'right' },
|
||||||
autoHideDuration: 2000
|
// autoHideDuration: 2000
|
||||||
})
|
// })
|
||||||
})
|
})
|
||||||
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
@@ -1947,7 +1951,7 @@ import {
|
|||||||
{(startdate && enddate) &&
|
{(startdate && enddate) &&
|
||||||
<Stack direction='row' spacing={2}>
|
<Stack direction='row' spacing={2}>
|
||||||
<Chip label={`Orders-${datestatus}`} color="primary" variant="light" size="small" />
|
<Chip label={`Orders-${datestatus}`} color="primary" variant="light" size="small" />
|
||||||
<Chip label={<Typography noWrap color="secondary">{dayjs(startdate).format('MM/DD/YYYY')} - {dayjs(enddate).format('MM/DD/YYYY')}</Typography>} variant="combined" color='warning' size='small' />
|
<Chip label={<Typography noWrap color="secondary">{dayjs(startdate).format('DD/MM/YYYY')} - {dayjs(enddate).format('DD/MM/YYYY')}</Typography>} variant="combined" color='warning' size='small' />
|
||||||
|
|
||||||
|
|
||||||
</Stack>
|
</Stack>
|
||||||
@@ -2012,7 +2016,7 @@ import {
|
|||||||
|
|
||||||
</Box>*/}
|
</Box>*/}
|
||||||
|
|
||||||
{/* <Tooltip title='Order Filter'>
|
<Tooltip title='Order Filter'>
|
||||||
<IconButton
|
<IconButton
|
||||||
|
|
||||||
|
|
||||||
@@ -2031,7 +2035,7 @@ import {
|
|||||||
onClick={() => setOpen(true)} >
|
onClick={() => setOpen(true)} >
|
||||||
<FilterList />
|
<FilterList />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</Tooltip> */}
|
</Tooltip>
|
||||||
|
|
||||||
</Stack>
|
</Stack>
|
||||||
</Grid>
|
</Grid>
|
||||||
@@ -2050,13 +2054,19 @@ import {
|
|||||||
|
|
||||||
: modified} percentage={percentage2.toString()} color={theme.palette.secondary[600]} />
|
: modified} percentage={percentage2.toString()} color={theme.palette.secondary[600]} />
|
||||||
</Grid> */}
|
</Grid> */}
|
||||||
|
<Grid item xs={12} lg={3} sm={6}>
|
||||||
|
<HoverSocialCard primary="All orders" secondary={(allorders === '') ?
|
||||||
|
<Skeleton sx={{ width: '30px' }} animation="wave" />
|
||||||
|
|
||||||
|
: allorders} percentage={percentage1.toString()} color={theme.palette.primary.main} />
|
||||||
|
</Grid>
|
||||||
<Grid item xs={12} lg={3} sm={6}>
|
<Grid item xs={12} lg={3} sm={6}>
|
||||||
<HoverSocialCard primary="Pending orders" secondary={(uncoveredorders == '') ?
|
<HoverSocialCard primary="Pending orders" secondary={(uncoveredorders == '') ?
|
||||||
<Skeleton sx={{ width: '30px' }} animation="wave" />
|
<Skeleton sx={{ width: '30px' }} animation="wave" />
|
||||||
|
|
||||||
: uncoveredorders} percentage={percentage1.toString()} color={theme.palette.warning.main} />
|
: uncoveredorders} percentage={percentage2.toString()} color={theme.palette.warning.main} />
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={12} lg={3} sm={6}>
|
{/* <Grid item xs={12} lg={3} sm={6}>
|
||||||
<HoverSocialCard primary="Accepted orders" secondary={(assigned === '') ?
|
<HoverSocialCard primary="Accepted orders" secondary={(assigned === '') ?
|
||||||
<Skeleton sx={{ width: '30px' }} animation="wave" />
|
<Skeleton sx={{ width: '30px' }} animation="wave" />
|
||||||
|
|
||||||
@@ -2067,26 +2077,27 @@ import {
|
|||||||
<Skeleton sx={{ width: '30px' }} animation="wave" />
|
<Skeleton sx={{ width: '30px' }} animation="wave" />
|
||||||
|
|
||||||
: picked} percentage={percentage3.toString()} color={theme.palette.primary.main} />
|
: picked} percentage={percentage3.toString()} color={theme.palette.primary.main} />
|
||||||
</Grid>
|
</Grid> */}
|
||||||
<Grid item xs={12} lg={3} sm={6}>
|
<Grid item xs={12} lg={3} sm={6}>
|
||||||
<HoverSocialCard primary="Delivered orders" secondary={(coveredorders === '') ?
|
<HoverSocialCard primary="Delivered orders" secondary={(coveredorders === '') ?
|
||||||
<Skeleton sx={{ width: '30px' }} animation="wave" />
|
<Skeleton sx={{ width: '30px' }} animation="wave" />
|
||||||
|
|
||||||
: coveredorders} percentage={percentage4.toString()} color={theme.palette.success.main} />
|
: coveredorders} percentage={percentage3.toString()} color={theme.palette.success.main} />
|
||||||
</Grid>
|
</Grid>
|
||||||
{/*
|
{/*
|
||||||
<Grid item xs={12} lg={3} sm={6}>
|
<Grid item xs={12} lg={3} sm={6}>
|
||||||
<HoverSocialCard primary="Closed orders" secondary={(closed === '') ?
|
<HoverSocialCard primary="Closed orders" secondary={(closed === '') ?
|
||||||
<Skeleton sx={{ width: '30px' }} animation="wave" />
|
<Skeleton sx={{ width: '30px' }} animation="wave" />
|
||||||
|
|
||||||
: closed} percentage={percentage4.toString()} color={theme.palette.warning.main} />
|
: closed} percentage={percentage4.toString()} color={theme.palette.warning.main} />
|
||||||
</Grid>
|
</Grid>
|
||||||
|
*/}
|
||||||
<Grid item xs={12} lg={3} sm={6}>
|
<Grid item xs={12} lg={3} sm={6}>
|
||||||
<HoverSocialCard primary="Cancelled Orders" secondary={(cancelled === '') ?
|
<HoverSocialCard primary="Cancelled Orders" secondary={(cancelled === '') ?
|
||||||
<Skeleton sx={{ width: '30px' }} animation="wave" />
|
<Skeleton sx={{ width: '30px' }} animation="wave" />
|
||||||
|
|
||||||
: cancelled} percentage={percentage2.toString()} color={theme.palette.secondary[600]} />
|
: cancelled} percentage={percentage4.toString()} color={theme.palette.secondary[600]} />
|
||||||
</Grid> */}
|
</Grid>
|
||||||
|
|
||||||
|
|
||||||
<Grid item md={8} sx={{ display: { sm: 'none', md: 'block', lg: 'none' } }} />
|
<Grid item md={8} sx={{ display: { sm: 'none', md: 'block', lg: 'none' } }} />
|
||||||
@@ -2113,17 +2124,17 @@ import {
|
|||||||
icon={<Chip label={allorders} color="primary" variant="light" size="small" />}
|
icon={<Chip label={allorders} color="primary" variant="light" size="small" />}
|
||||||
/> */}
|
/> */}
|
||||||
<Tab label="Created"
|
<Tab label="Created"
|
||||||
icon={<Chip label={created} color="primary" variant="light" size="small" />}
|
icon={<Chip label={orderarrcreated.length} color="primary" variant="light" size="small" />}
|
||||||
iconPosition="end"
|
iconPosition="end"
|
||||||
/>
|
/>
|
||||||
<Tab label="Pending"
|
<Tab label="Pending"
|
||||||
icon={<Chip label={uncoveredorders} color="primary" variant="light" size="small" />}
|
icon={<Chip label={orderarruncovered.length} color="primary" variant="light" size="small" />}
|
||||||
iconPosition="end"
|
iconPosition="end"
|
||||||
/>
|
/>
|
||||||
<Tab label="Accepted"
|
{/* <Tab label="Accepted"
|
||||||
icon={<Chip label={assigned} color="primary" variant="light" size="small" />}
|
icon={<Chip label={assigned} color="primary" variant="light" size="small" />}
|
||||||
iconPosition="end"
|
iconPosition="end"
|
||||||
/>
|
/> */}
|
||||||
{/* <Tab label="Confirmed"
|
{/* <Tab label="Confirmed"
|
||||||
icon={<Chip label={confirmed} color="primary" variant="light" size="small" />}
|
icon={<Chip label={confirmed} color="primary" variant="light" size="small" />}
|
||||||
iconPosition="end"
|
iconPosition="end"
|
||||||
@@ -2132,13 +2143,13 @@ import {
|
|||||||
icon={<Chip label={modified} color="primary" variant="light" size="small" />}
|
icon={<Chip label={modified} color="primary" variant="light" size="small" />}
|
||||||
iconPosition="end"
|
iconPosition="end"
|
||||||
/> */}
|
/> */}
|
||||||
<Tab label="Picked"
|
{/* <Tab label="Picked"
|
||||||
icon={<Chip label={picked} color="primary" variant="light" size="small" />}
|
icon={<Chip label={picked} color="primary" variant="light" size="small" />}
|
||||||
iconPosition="end"
|
iconPosition="end"
|
||||||
/>
|
/> */}
|
||||||
|
|
||||||
<Tab label="Delivered"
|
<Tab label="Delivered"
|
||||||
icon={<Chip label={coveredorders} color="primary" variant="light" size="small" />}
|
icon={<Chip label={orderarrcovered.length} color="primary" variant="light" size="small" />}
|
||||||
iconPosition="end"
|
iconPosition="end"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -2148,7 +2159,7 @@ import {
|
|||||||
iconPosition="end"
|
iconPosition="end"
|
||||||
/> */}
|
/> */}
|
||||||
<Tab label="Cancelled"
|
<Tab label="Cancelled"
|
||||||
icon={<Chip label={cancelled} color="primary" variant="light" size="small" />}
|
icon={<Chip label={orderarrcancelled.length} color="primary" variant="light" size="small" />}
|
||||||
iconPosition="end"
|
iconPosition="end"
|
||||||
/>
|
/>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
@@ -2199,7 +2210,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>
|
||||||
@@ -2273,11 +2284,11 @@ import {
|
|||||||
startDate: startOfMonth(addMonths(new Date(), -1)),
|
startDate: startOfMonth(addMonths(new Date(), -1)),
|
||||||
endDate: endOfMonth(addMonths(new Date(), -1)),
|
endDate: endOfMonth(addMonths(new Date(), -1)),
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
label: 'All',
|
// label: 'All',
|
||||||
startDate: new Date(),
|
// startDate: new Date(),
|
||||||
endDate: addDays(new Date(), -1),
|
// endDate: addDays(new Date(), -1),
|
||||||
},
|
// },
|
||||||
|
|
||||||
]}
|
]}
|
||||||
|
|
||||||
@@ -2289,7 +2300,7 @@ import {
|
|||||||
</Stack>
|
</Stack>
|
||||||
|
|
||||||
</Dialog>
|
</Dialog>
|
||||||
*/}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -2299,6 +2310,6 @@ import {
|
|||||||
|
|
||||||
|
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Orders;
|
export default Orders;
|
||||||
Reference in New Issue
Block a user