implementation on the dispatch and some change in the deliveries page
This commit is contained in:
42
.env
Normal file
42
.env
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
REACT_APP_VERSION=v2.1.0
|
||||||
|
GENERATE_SOURCEMAP = false
|
||||||
|
|
||||||
|
## Backend API URL
|
||||||
|
REACT_APP_API_URL=https://mock-data-api-nextjs.vercel.app/
|
||||||
|
|
||||||
|
## Google Map Key
|
||||||
|
|
||||||
|
REACT_APP_URL=https://jupiter.nearle.app/live/api/v1
|
||||||
|
REACT_APP_URL2=https://jupiter.nearle.app/live/api/v2
|
||||||
|
REACT_APP_URL3=https://jupiter.nearle.app/live/api/v3
|
||||||
|
REACT_APP_STAFF_TOKEN=
|
||||||
|
REACT_APP_GOOGLE_MAPS_API_KEY=AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8
|
||||||
|
REACT_APP_RIDER_ACCESS_ID=AAAAILMpCEU:APA91bEavuOllBI6sFgYtxXAgNmAVwNA-MnCMHLGlR4_t7UqpLajAkdn3T0CZr_zaLBknLyim9ytFLMZgbeXmKqTad_PKCbqlYjHpaizVrLXtecxqyEy4UktIacK2UvHVUATHL-7VQQk
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
REACT_APP_RIDER_ACCESS_ID=AAAAILMpCEU:APA91bEavuOllBI6sFgYtxXAgNmAVwNA-MnCMHLGlR4_t7UqpLajAkdn3T0CZr_zaLBknLyim9ytFLMZgbeXmKqTad_PKCbqlYjHpaizVrLXtecxqyEy4UktIacK2UvHVUATHL-7VQQk
|
||||||
|
|
||||||
|
## Firebase - Google Auth
|
||||||
|
|
||||||
|
REACT_APP_FIREBASE_API_KEY=
|
||||||
|
REACT_APP_FIREBASE_AUTH_DOMAIN=
|
||||||
|
REACT_APP_FIREBASE_PROJECT_ID=
|
||||||
|
REACT_APP_FIREBASE_STORAGE_BUCKET=
|
||||||
|
REACT_APP_FIREBASE_MESSAGING_SENDER_ID=
|
||||||
|
REACT_APP_FIREBASE_APP_ID=
|
||||||
|
REACT_APP_FIREBASE_MEASUREMENT_ID=
|
||||||
|
|
||||||
|
## AWS
|
||||||
|
|
||||||
|
REACT_APP_AWS_POOL_ID=
|
||||||
|
REACT_APP_AWS_APP_CLIENT_ID=
|
||||||
|
|
||||||
|
## Auth0
|
||||||
|
|
||||||
|
REACT_APP_AUTH0_CLIENT_ID=
|
||||||
|
REACT_APP_AUTH0_DOMAIN=
|
||||||
|
|
||||||
|
DISABLE_ESLINT_PLUGIN=true
|
||||||
8
.env.development
Normal file
8
.env.development
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
REACT_APP_URL=https://jupiter.nearle.app/live/api/v1
|
||||||
|
REACT_APP_URL2=https://jupiter.nearle.app/live/api/v2
|
||||||
|
REACT_APP_URL3=https://jupiter.nearle.app/live/api/v3
|
||||||
|
REACT_APP_STAFF_TOKEN=
|
||||||
|
REACT_APP_GOOGLE_MAPS_API_KEY=AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8
|
||||||
|
REACT_APP_RIDER_ACCESS_ID=AAAAILMpCEU:APA91bEavuOllBI6sFgYtxXAgNmAVwNA-MnCMHLGlR4_t7UqpLajAkdn3T0CZr_zaLBknLyim9ytFLMZgbeXmKqTad_PKCbqlYjHpaizVrLXtecxqyEy4UktIacK2UvHVUATHL-7VQQk
|
||||||
|
|
||||||
|
|
||||||
3
.env.staging
Normal file
3
.env.staging
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
REACT_APP_URL=https://jupiter.nearle.app/live/api/v1
|
||||||
|
REACT_APP_URL2=
|
||||||
|
REACT_APP_STAFF_TOKEN=
|
||||||
6
.gitignore
vendored
6
.gitignore
vendored
@@ -69,11 +69,7 @@ typings/
|
|||||||
# Yarn Integrity file
|
# Yarn Integrity file
|
||||||
.yarn-integrity
|
.yarn-integrity
|
||||||
|
|
||||||
# dotenv environment variables file
|
|
||||||
.env
|
|
||||||
.env.development
|
|
||||||
.env.staging
|
|
||||||
.env.test
|
|
||||||
|
|
||||||
# parcel-bundler cache (https://parceljs.org/)
|
# parcel-bundler cache (https://parceljs.org/)
|
||||||
.cache
|
.cache
|
||||||
|
|||||||
BIN
src/assets/images/bikeicon.png
Normal file
BIN
src/assets/images/bikeicon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 353 KiB |
@@ -3,6 +3,7 @@ import { FormattedMessage } from 'react-intl';
|
|||||||
import DirectionsBikeOutlinedIcon from '@mui/icons-material/DirectionsBikeOutlined';
|
import DirectionsBikeOutlinedIcon from '@mui/icons-material/DirectionsBikeOutlined';
|
||||||
import ReceiptOutlinedIcon from '@mui/icons-material/ReceiptOutlined';
|
import ReceiptOutlinedIcon from '@mui/icons-material/ReceiptOutlined';
|
||||||
import MopedOutlinedIcon from '@mui/icons-material/MopedOutlined';
|
import MopedOutlinedIcon from '@mui/icons-material/MopedOutlined';
|
||||||
|
import NearMeOutlinedIcon from '@mui/icons-material/NearMeOutlined';
|
||||||
import { TbListDetails } from 'react-icons/tb';
|
import { TbListDetails } from 'react-icons/tb';
|
||||||
|
|
||||||
// assets
|
// assets
|
||||||
@@ -48,6 +49,9 @@ const icons = {
|
|||||||
ImportOutlined,
|
ImportOutlined,
|
||||||
BarChartOutlined,
|
BarChartOutlined,
|
||||||
ReceiptOutlinedIcon,
|
ReceiptOutlinedIcon,
|
||||||
|
NearMeOutlinedIcon,
|
||||||
|
DirectionsBikeOutlinedIcon,
|
||||||
|
MopedOutlinedIcon,
|
||||||
FileDoneOutlined
|
FileDoneOutlined
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -147,6 +151,13 @@ const nearle = {
|
|||||||
type: 'item',
|
type: 'item',
|
||||||
url: '/nearle/invoice',
|
url: '/nearle/invoice',
|
||||||
icon: icons.ReceiptOutlinedIcon
|
icon: icons.ReceiptOutlinedIcon
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'dispatch',
|
||||||
|
title: <FormattedMessage id="dispatch" />,
|
||||||
|
type: 'item',
|
||||||
|
url: '/nearle/dispatch',
|
||||||
|
icon: icons.DirectionsBikeOutlinedIcon
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -484,16 +484,16 @@ const Deliveries = () => {
|
|||||||
const errorMessage = fetchDeliveriesIsError
|
const errorMessage = fetchDeliveriesIsError
|
||||||
? `Error fetching percentages: ${fetchDeliveriesError?.message}`
|
? `Error fetching percentages: ${fetchDeliveriesError?.message}`
|
||||||
: fetchPercentageIsError
|
: fetchPercentageIsError
|
||||||
? `Error fetching percentages: ${fetchPercentageError?.message}`
|
? `Error fetching percentages: ${fetchPercentageError?.message}`
|
||||||
: fetchCountIsError
|
: fetchCountIsError
|
||||||
? `Error fetching percentages: ${fetchCountError?.message}`
|
? `Error fetching percentages: ${fetchCountError?.message}`
|
||||||
: ridersListIsError
|
: ridersListIsError
|
||||||
? `Error fetching percentages: ${ridersListError?.message}`
|
? `Error fetching percentages: ${ridersListError?.message}`
|
||||||
: fetchtenantsIsError
|
: fetchtenantsIsError
|
||||||
? `Error tenant list: ${fetchtenantsError?.message}`
|
? `Error tenant list: ${fetchtenantsError?.message}`
|
||||||
: fetchlocationsIsError
|
: fetchlocationsIsError
|
||||||
? `Error location list: ${fetchlocationsError?.message}`
|
? `Error location list: ${fetchlocationsError?.message}`
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
if (errorMessage) {
|
if (errorMessage) {
|
||||||
console.log('errorMessage', errorMessage);
|
console.log('errorMessage', errorMessage);
|
||||||
@@ -509,11 +509,11 @@ const Deliveries = () => {
|
|||||||
fetchtenantsIsLoading ||
|
fetchtenantsIsLoading ||
|
||||||
fetchlocationsIsLoading ||
|
fetchlocationsIsLoading ||
|
||||||
riderListIsLoading) && (
|
riderListIsLoading) && (
|
||||||
<>
|
<>
|
||||||
<Loader />
|
<Loader />
|
||||||
{/* <CircularLoader /> */}
|
{/* <CircularLoader /> */}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{
|
{
|
||||||
<Backdrop
|
<Backdrop
|
||||||
sx={{
|
sx={{
|
||||||
@@ -872,6 +872,7 @@ const Deliveries = () => {
|
|||||||
sx={{
|
sx={{
|
||||||
maxHeight: 'calc(100vh - 190px)',
|
maxHeight: 'calc(100vh - 190px)',
|
||||||
overflow: 'auto',
|
overflow: 'auto',
|
||||||
|
overflowX: 'auto',
|
||||||
'&::-webkit-scrollbar': {
|
'&::-webkit-scrollbar': {
|
||||||
width: '12px', // scroll bar width
|
width: '12px', // scroll bar width
|
||||||
cursor: 'pointer'
|
cursor: 'pointer'
|
||||||
@@ -891,11 +892,11 @@ const Deliveries = () => {
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Table stickyHeader>
|
<Table stickyHeader sx={{ minWidth: 1400 }}>
|
||||||
<TableHead>
|
<TableHead>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
{tabstatus == 'Created' && (
|
{tabstatus == 'Created' && (
|
||||||
<TableCell>
|
<TableCell sx={{ whiteSpace: 'nowrap' }}>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
indeterminate={deliverylist.length > 0 && deliverylist.length != rows.length}
|
indeterminate={deliverylist.length > 0 && deliverylist.length != rows.length}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
@@ -909,26 +910,29 @@ const Deliveries = () => {
|
|||||||
/>
|
/>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
)}
|
)}
|
||||||
<TableCell sx={{ position: 'sticky !important', backgroundColor: theme.palette.secondary.light }}>S.No </TableCell>
|
<TableCell sx={{ position: 'sticky !important', backgroundColor: theme.palette.secondary.light, whiteSpace: 'nowrap', border: 'none' }}>S.No </TableCell>
|
||||||
<TableCell sx={{ position: 'sticky !important', backgroundColor: theme.palette.secondary.light }}>Tenant </TableCell>
|
<TableCell sx={{ position: 'sticky !important', backgroundColor: theme.palette.secondary.light, whiteSpace: 'nowrap', border: 'none' }}>Tenant </TableCell>
|
||||||
<TableCell sx={{ position: 'sticky !important', backgroundColor: theme.palette.secondary.light }}>
|
<TableCell sx={{ position: 'sticky !important', backgroundColor: theme.palette.secondary.light, whiteSpace: 'nowrap', border: 'none' }}>
|
||||||
Order Location{' '}
|
Order Location{' '}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell sx={{ position: 'sticky !important', backgroundColor: theme.palette.secondary.light }}>Pickup </TableCell>
|
<TableCell sx={{ position: 'sticky !important', backgroundColor: theme.palette.secondary.light, whiteSpace: 'nowrap', border: 'none' }}>Pickup </TableCell>
|
||||||
<TableCell sx={{ position: 'sticky !important', backgroundColor: theme.palette.secondary.light }}>Drop </TableCell>
|
<TableCell sx={{ position: 'sticky !important', backgroundColor: theme.palette.secondary.light, whiteSpace: 'nowrap', border: 'none' }}>Drop </TableCell>
|
||||||
<TableCell sx={{ position: 'sticky !important', backgroundColor: theme.palette.secondary.light }}>Rider </TableCell>
|
<TableCell sx={{ position: 'sticky !important', backgroundColor: theme.palette.secondary.light, whiteSpace: 'nowrap', border: 'none' }}>Rider </TableCell>
|
||||||
<TableCell sx={{ position: 'sticky !important', backgroundColor: theme.palette.secondary.light }}>Notes </TableCell>
|
<TableCell sx={{ position: 'sticky !important', backgroundColor: theme.palette.secondary.light, whiteSpace: 'nowrap', border: 'none' }}>Est. Delivery Time</TableCell>
|
||||||
<TableCell sx={{ position: 'sticky !important', backgroundColor: theme.palette.secondary.light }}>Qty</TableCell>
|
<TableCell sx={{ position: 'sticky !important', backgroundColor: theme.palette.secondary.light, whiteSpace: 'nowrap', border: 'none' }}>Transit</TableCell>
|
||||||
<TableCell sx={{ position: 'sticky !important', backgroundColor: theme.palette.secondary.light }}>COD </TableCell>
|
<TableCell sx={{ position: 'sticky !important', backgroundColor: theme.palette.secondary.light, whiteSpace: 'nowrap', border: 'none' }}> Kms</TableCell>
|
||||||
<TableCell sx={{ position: 'sticky !important', backgroundColor: theme.palette.secondary.light }}> Kms</TableCell>
|
<TableCell sx={{ position: 'sticky !important', backgroundColor: theme.palette.secondary.light, whiteSpace: 'nowrap', border: 'none' }}>Amount </TableCell>
|
||||||
<TableCell sx={{ position: 'sticky !important', backgroundColor: theme.palette.secondary.light }}>Amount </TableCell>
|
<TableCell sx={{ position: 'sticky !important', backgroundColor: theme.palette.secondary.light, whiteSpace: 'nowrap', border: 'none' }}>Notes </TableCell>
|
||||||
{/* <TableCell sx={{ position: 'sticky !important', backgroundColor: theme.palette.secondary.light }}>Status </TableCell> */}
|
<TableCell sx={{ position: 'sticky !important', backgroundColor: theme.palette.secondary.light, whiteSpace: 'nowrap', border: 'none' }}>Qty</TableCell>
|
||||||
|
<TableCell sx={{ position: 'sticky !important', backgroundColor: theme.palette.secondary.light, whiteSpace: 'nowrap', border: 'none' }}>COD </TableCell>
|
||||||
{tabstatus !== 'Cancelled' && tabstatus !== 'Delivered' && (
|
{tabstatus !== 'Cancelled' && tabstatus !== 'Delivered' && (
|
||||||
<TableCell
|
<TableCell
|
||||||
align="right"
|
align="right"
|
||||||
sx={{
|
sx={{
|
||||||
position: 'sticky',
|
position: 'sticky !important',
|
||||||
backgroundColor: theme.palette.secondary.light
|
backgroundColor: theme.palette.secondary.light,
|
||||||
|
whiteSpace: 'nowrap',
|
||||||
|
border: 'none'
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Action
|
Action
|
||||||
@@ -936,11 +940,11 @@ const Deliveries = () => {
|
|||||||
)}
|
)}
|
||||||
</TableRow>
|
</TableRow>
|
||||||
</TableHead>
|
</TableHead>
|
||||||
{(loading1 || fetchDeliveriesIsLoading) && <OrdersTableSkeleton col={6} />}
|
{(loading1 || fetchDeliveriesIsLoading) && <OrdersTableSkeleton col={8} />}
|
||||||
<TableBody>
|
<TableBody>
|
||||||
{rows.length == 0 && !loading1 && (
|
{rows.length == 0 && !loading1 && (
|
||||||
<>
|
<>
|
||||||
<TableCell colSpan={11}>
|
<TableCell colSpan={13}>
|
||||||
{/* <Stack width={'100%'} direction={'row'} justifyContent={'center'}> */}
|
{/* <Stack width={'100%'} direction={'row'} justifyContent={'center'}> */}
|
||||||
<Empty description={`No ${tabstatus} Orders`} styles={{ description: { color: theme.palette.error.main } }} />
|
<Empty description={`No ${tabstatus} Orders`} styles={{ description: { color: theme.palette.error.main } }} />
|
||||||
</TableCell>
|
</TableCell>
|
||||||
@@ -1087,6 +1091,40 @@ const Deliveries = () => {
|
|||||||
<Typography variant="subtitle2"> {`ID: ${row.userid}`}</Typography>
|
<Typography variant="subtitle2"> {`ID: ${row.userid}`}</Typography>
|
||||||
<Typography variant="subtitle2"> {row.ridercontact}</Typography>
|
<Typography variant="subtitle2"> {row.ridercontact}</Typography>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
{/* Estimated Delivery Time */}
|
||||||
|
<TableCell align="left">
|
||||||
|
<Typography variant="subtitle1" noWrap>
|
||||||
|
{row.expecteddeliverytime ? dayjs(row.expecteddeliverytime).format('hh:mm A') : 'N/A'}
|
||||||
|
</Typography>
|
||||||
|
</TableCell>
|
||||||
|
{/* Transit Minutes */}
|
||||||
|
<TableCell align="left">
|
||||||
|
<Typography variant="subtitle1" noWrap>
|
||||||
|
{row.transitminutes || 0} min
|
||||||
|
</Typography>
|
||||||
|
</TableCell>
|
||||||
|
{/* kms */}
|
||||||
|
<TableCell>
|
||||||
|
<Stack direction={'column'} spacing={1}>
|
||||||
|
<Tooltip title=" KMS" placement="top">
|
||||||
|
<Chip label={row.kms || 0} size="small" variant="light" color="error" />
|
||||||
|
</Tooltip>
|
||||||
|
<Tooltip title="Actual KMS">
|
||||||
|
<Chip label={row.cumulativekms || 0} size="small" color="success" variant="light" />
|
||||||
|
</Tooltip>
|
||||||
|
</Stack>
|
||||||
|
</TableCell>
|
||||||
|
{/* amount */}
|
||||||
|
<TableCell align="left">
|
||||||
|
<Stack direction={'column'} spacing={1}>
|
||||||
|
<Tooltip title=" Delivery Charge" placement="top">
|
||||||
|
<Chip label={`₹ ${row.deliverycharges?.toFixed(2)}` || 0} size="small" variant="light" color="error" />
|
||||||
|
</Tooltip>
|
||||||
|
<Tooltip title="Delivery Amount">
|
||||||
|
<Chip label={`₹ ${row.deliveryamt?.toFixed(2)}` || 0} size="small" color="success" variant="light" />
|
||||||
|
</Tooltip>
|
||||||
|
</Stack>
|
||||||
|
</TableCell>
|
||||||
{/* {qty} */}
|
{/* {qty} */}
|
||||||
<TableCell>
|
<TableCell>
|
||||||
<Typography>{row.notes}</Typography>
|
<Typography>{row.notes}</Typography>
|
||||||
@@ -1117,52 +1155,6 @@ const Deliveries = () => {
|
|||||||
</Typography>
|
</Typography>
|
||||||
)}
|
)}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
{/* kms */}
|
|
||||||
<TableCell>
|
|
||||||
<Stack direction={'column'} spacing={1}>
|
|
||||||
<Tooltip title=" KMS" placement="top">
|
|
||||||
<Chip label={row.kms || 0} size="small" variant="light" color="error" />
|
|
||||||
</Tooltip>
|
|
||||||
<Tooltip title="Actual KMS">
|
|
||||||
<Chip label={row.cumulativekms || 0} size="small" color="success" variant="light" />
|
|
||||||
</Tooltip>
|
|
||||||
</Stack>
|
|
||||||
</TableCell>
|
|
||||||
{/* amount */}
|
|
||||||
<TableCell align="left">
|
|
||||||
{' '}
|
|
||||||
<Stack direction={'column'} spacing={1}>
|
|
||||||
<Tooltip title=" Delivery Charge" placement="top">
|
|
||||||
<Chip label={`₹ ${row.deliverycharges?.toFixed(2)}` || 0} size="small" variant="light" color="error" />
|
|
||||||
</Tooltip>
|
|
||||||
<Tooltip title="Delivery Amount">
|
|
||||||
<Chip label={`₹ ${row.deliveryamt?.toFixed(2)}` || 0} size="small" color="success" variant="light" />
|
|
||||||
</Tooltip>
|
|
||||||
</Stack>
|
|
||||||
</TableCell>
|
|
||||||
{/* status */}
|
|
||||||
{/* <TableCell align="left">
|
|
||||||
<Stack direction="row">
|
|
||||||
{row.orderstatus === 'pending' && <Chip label="Pending" color="warning" size="small" />}
|
|
||||||
{row.orderstatus === 'modified' && <Chip label="Confirmed" color="success" size="small" />}
|
|
||||||
{row.orderstatus === 'cancelled' && <Chip label="Cancelled" color="error" size="small" />}
|
|
||||||
{row.orderstatus === 'delivered' && <Chip label="Completed" color="success" size="small" />}
|
|
||||||
{row.orderstatus === 'processing' && <Chip label="Processing" color="primary" size="small" />}
|
|
||||||
{row.orderstatus === 'ready' && <Chip label="Accepted" color="info" size="small" />}
|
|
||||||
{row.orderstatus === 'confirmed' && <Chip label="Confirmed" color="success" size="small" />}
|
|
||||||
{row.orderstatus === 'active' && <Chip label="Active" color="info" size="small" />}
|
|
||||||
{row.orderstatus === 'closed' && <Chip label="Closed" color="info" size="small" />}
|
|
||||||
{row.orderstatus === 'created' && <Chip label="Created" color="primary" size="small" />}
|
|
||||||
{row.orderstatus === 'picked' && <Chip label="Picked" color="info" size="small" />}
|
|
||||||
{row.orderstatus === 'skipped' && <Chip label="Skipped" color="secondary" size="small" />}
|
|
||||||
{row.orderstatus === 'accepted' && (
|
|
||||||
<Chip label="Accepted" size="small" sx={{ bgcolor: theme.palette.chip.accept, color: 'white' }} />
|
|
||||||
)}
|
|
||||||
{row.orderstatus === 'arrived' && (
|
|
||||||
<Chip label="Arrived" size="small" sx={{ bgcolor: theme.palette.chip.arrive, color: 'white' }} />
|
|
||||||
)}
|
|
||||||
</Stack>
|
|
||||||
</TableCell> */}
|
|
||||||
{/* Action */}
|
{/* Action */}
|
||||||
{tabstatus !== 'Cancelled' && tabstatus !== 'Delivered' && (
|
{tabstatus !== 'Cancelled' && tabstatus !== 'Delivered' && (
|
||||||
<TableCell>
|
<TableCell>
|
||||||
|
|||||||
1537
src/pages/nearle/dispatch/Dispatch.css
Normal file
1537
src/pages/nearle/dispatch/Dispatch.css
Normal file
File diff suppressed because it is too large
Load Diff
1370
src/pages/nearle/dispatch/Dispatch.js
Normal file
1370
src/pages/nearle/dispatch/Dispatch.js
Normal file
File diff suppressed because it is too large
Load Diff
16105
src/pages/nearle/dispatch/DispatchData.js
Normal file
16105
src/pages/nearle/dispatch/DispatchData.js
Normal file
File diff suppressed because it is too large
Load Diff
@@ -97,6 +97,7 @@ import {
|
|||||||
import LoaderWithImage from 'components/nearle_components/LoaderWithImage';
|
import LoaderWithImage from 'components/nearle_components/LoaderWithImage';
|
||||||
import { useNavigate } from 'react-router';
|
import { useNavigate } from 'react-router';
|
||||||
import CSVExport from 'components/third-party/ReactTable';
|
import CSVExport from 'components/third-party/ReactTable';
|
||||||
|
import Dispatch from '../dispatch/Dispatch';
|
||||||
// import usePreventReload from 'hooks/usePreventReload';
|
// import usePreventReload from 'hooks/usePreventReload';
|
||||||
|
|
||||||
const Orders = () => {
|
const Orders = () => {
|
||||||
@@ -134,6 +135,7 @@ const Orders = () => {
|
|||||||
const [speedDialOpen, setSpeedDialOpen] = useState(false);
|
const [speedDialOpen, setSpeedDialOpen] = useState(false);
|
||||||
const [aiDialog, setAiDialog] = useState(false);
|
const [aiDialog, setAiDialog] = useState(false);
|
||||||
const [normalAssignDialog, setNormalAssignDialog] = useState(false);
|
const [normalAssignDialog, setNormalAssignDialog] = useState(false);
|
||||||
|
const [dispatchPreviewData, setDispatchPreviewData] = useState(null);
|
||||||
const [deliverylist, setDeliverylist] = useState([]);
|
const [deliverylist, setDeliverylist] = useState([]);
|
||||||
const [deliveryDetails, setDeliveryDetails] = useState([]);
|
const [deliveryDetails, setDeliveryDetails] = useState([]);
|
||||||
const [zoneData, setZoneData] = useState(null);
|
const [zoneData, setZoneData] = useState(null);
|
||||||
@@ -413,6 +415,7 @@ const Orders = () => {
|
|||||||
setDeliveryDetails(data?.details);
|
setDeliveryDetails(data?.details);
|
||||||
setZoneData(data?.zones);
|
setZoneData(data?.zones);
|
||||||
setMetaData(data?.meta);
|
setMetaData(data?.meta);
|
||||||
|
setDispatchPreviewData(data);
|
||||||
setAiDialog(true);
|
setAiDialog(true);
|
||||||
// navigate('/nearle/orders/optimisedpreview', {
|
// navigate('/nearle/orders/optimisedpreview', {
|
||||||
// state: {
|
// state: {
|
||||||
@@ -636,14 +639,14 @@ const Orders = () => {
|
|||||||
const errorMessage = fetchpercentageIsError
|
const errorMessage = fetchpercentageIsError
|
||||||
? `Error fetching percentages: ${fetchpercentageError?.message}`
|
? `Error fetching percentages: ${fetchpercentageError?.message}`
|
||||||
: fetchorderscountIsError
|
: fetchorderscountIsError
|
||||||
? `Error fetching orders Count: ${fetchorderscountError?.message}`
|
? `Error fetching orders Count: ${fetchorderscountError?.message}`
|
||||||
: fetchOrdersIsError
|
: fetchOrdersIsError
|
||||||
? `Error fetching orders : ${fetchOrdersError?.message}`
|
? `Error fetching orders : ${fetchOrdersError?.message}`
|
||||||
: fetchtenantsIsError
|
: fetchtenantsIsError
|
||||||
? `Error Fetching on Tenants:${fetchtenantsError?.message} `
|
? `Error Fetching on Tenants:${fetchtenantsError?.message} `
|
||||||
: fetchlocationsIsError
|
: fetchlocationsIsError
|
||||||
? `Error Fetching on Tenants Locations:${fetchlocationsError?.message} `
|
? `Error Fetching on Tenants Locations:${fetchlocationsError?.message} `
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (errorMessage) {
|
if (errorMessage) {
|
||||||
@@ -660,11 +663,11 @@ const Orders = () => {
|
|||||||
fetchtenantsIsLoading ||
|
fetchtenantsIsLoading ||
|
||||||
fetchlocationsIsLoading ||
|
fetchlocationsIsLoading ||
|
||||||
createloader) && (
|
createloader) && (
|
||||||
<>
|
<>
|
||||||
<Loader />
|
<Loader />
|
||||||
<CircularLoader />
|
<CircularLoader />
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{
|
{
|
||||||
<Backdrop
|
<Backdrop
|
||||||
sx={{
|
sx={{
|
||||||
@@ -1426,12 +1429,12 @@ const Orders = () => {
|
|||||||
row.orderstatus === 'confirmed' ||
|
row.orderstatus === 'confirmed' ||
|
||||||
row.orderstatus === 'delivered' ||
|
row.orderstatus === 'delivered' ||
|
||||||
row.orderstatus === 'accepted'
|
row.orderstatus === 'accepted'
|
||||||
? 'success'
|
? 'success'
|
||||||
: row.orderstatus === 'cancelled'
|
: row.orderstatus === 'cancelled'
|
||||||
? 'error'
|
? 'error'
|
||||||
: row.orderstatus === 'processing'
|
: row.orderstatus === 'processing'
|
||||||
? 'primary'
|
? 'primary'
|
||||||
: 'primary'
|
: 'primary'
|
||||||
}
|
}
|
||||||
size="small"
|
size="small"
|
||||||
variant="light"
|
variant="light"
|
||||||
@@ -2087,7 +2090,12 @@ const Orders = () => {
|
|||||||
</DialogActions>
|
</DialogActions>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
{/* ============================================= || AI optimisation Assign Orders | ============================================= */}
|
{/* ============================================= || AI optimisation Assign Orders | ============================================= */}
|
||||||
<Dialog open={aiDialog} fullScreen TransitionComponent={PopupTransition}>
|
<Dialog
|
||||||
|
open={aiDialog}
|
||||||
|
fullScreen
|
||||||
|
TransitionComponent={PopupTransition}
|
||||||
|
PaperProps={{ sx: { display: 'flex', flexDirection: 'column', overflow: 'hidden' } }}
|
||||||
|
>
|
||||||
{
|
{
|
||||||
<Backdrop
|
<Backdrop
|
||||||
sx={{
|
sx={{
|
||||||
@@ -2220,226 +2228,8 @@ const Orders = () => {
|
|||||||
</Grid>
|
</Grid>
|
||||||
</Stack>
|
</Stack>
|
||||||
</DialogTitle>
|
</DialogTitle>
|
||||||
<DialogContent>
|
<DialogContent sx={{ p: 0, display: 'flex', flexDirection: 'column', overflow: 'hidden', flex: 1 }}>
|
||||||
<MainCard content={false}>
|
{dispatchPreviewData && <Dispatch data={dispatchPreviewData} embedded />}
|
||||||
{zoneData?.map((zone, index) => {
|
|
||||||
const orders = zone?.riders?.flatMap((rider) => rider.orders);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Accordion
|
|
||||||
key={index}
|
|
||||||
// expanded={true}
|
|
||||||
>
|
|
||||||
<AccordionSummary>
|
|
||||||
<Stack direction="row" alignItems="center" spacing={2} sx={{ m: 2 }}>
|
|
||||||
<Typography variant="h5" fontWeight={1000}>
|
|
||||||
Zone {index + 1} :
|
|
||||||
</Typography>
|
|
||||||
<Chip label={zone.zone_name} color="primary" variant="light" size="small" sx={{ minWidth: 100 }} />
|
|
||||||
<Tooltip title={`Orders`} placement="top">
|
|
||||||
<Badge badgeContent={zone.total_orders} color="secondary">
|
|
||||||
<DashboardOutlined style={{ fontSize: 20 }} />
|
|
||||||
</Badge>
|
|
||||||
</Tooltip>
|
|
||||||
<Tooltip title={`Riders`} placement="top">
|
|
||||||
<Badge color="secondary" badgeContent={zone.active_riders_count}>
|
|
||||||
<DirectionsBikeOutlinedIcon style={{ fontSize: 20 }} />
|
|
||||||
</Badge>
|
|
||||||
</Tooltip>
|
|
||||||
</Stack>
|
|
||||||
</AccordionSummary>
|
|
||||||
<AccordionDetails>
|
|
||||||
<TableContainer sx={{ p: 0, m: 0 }}>
|
|
||||||
<Table stickyHeader>
|
|
||||||
<TableHead>
|
|
||||||
<TableRow>
|
|
||||||
<TableCell>#</TableCell>
|
|
||||||
{/* <TableCell>Tenant</TableCell> */}
|
|
||||||
<TableCell>Order Location</TableCell>
|
|
||||||
<TableCell>Pickup</TableCell>
|
|
||||||
<TableCell>Delivery</TableCell>
|
|
||||||
<TableCell>Notes</TableCell>
|
|
||||||
<TableCell>Rider</TableCell>
|
|
||||||
<TableCell align="center">Type</TableCell>
|
|
||||||
<TableCell align="center">Profit</TableCell>
|
|
||||||
<TableCell align="center">Charges</TableCell>
|
|
||||||
<TableCell align="center">KMS</TableCell>
|
|
||||||
</TableRow>
|
|
||||||
</TableHead>
|
|
||||||
|
|
||||||
<TableBody>
|
|
||||||
{orders.map((val, i) => (
|
|
||||||
<Fragment key={i}>
|
|
||||||
<TableRow sx={{}}>
|
|
||||||
<TableCell>
|
|
||||||
<Typography> {i + 1}</Typography>
|
|
||||||
</TableCell>
|
|
||||||
{/* <TableCell>
|
|
||||||
<Tooltip title={val.tenantaddress}>
|
|
||||||
<Typography variant="body1" noWrap>
|
|
||||||
{val.tenantname}
|
|
||||||
</Typography>
|
|
||||||
<Typography noWrap sx={{ fontSize: '11px' }}>
|
|
||||||
{val.tenantsuburb}
|
|
||||||
<br />
|
|
||||||
</Typography>
|
|
||||||
|
|
||||||
<Typography noWrap variant="body2">
|
|
||||||
{val.applocation}
|
|
||||||
</Typography>
|
|
||||||
</Tooltip>
|
|
||||||
</TableCell> */}
|
|
||||||
<TableCell align="left">
|
|
||||||
<Tooltip title={val.locationaddress} placement="top">
|
|
||||||
<Typography variant="body1" noWrap>
|
|
||||||
{`${val.locationname}-(${val.locationsuburb})`}
|
|
||||||
</Typography>
|
|
||||||
</Tooltip>
|
|
||||||
<Tooltip title="Order Id">
|
|
||||||
<Typography variant="body2" noWrap>
|
|
||||||
{val.orderid}
|
|
||||||
</Typography>
|
|
||||||
</Tooltip>
|
|
||||||
<Stack display={'flex'} flexDirection={'row'} gap={3} sx={{ cursor: 'pointer' }}>
|
|
||||||
<Tooltip title="Pickup Time">
|
|
||||||
<Typography noWrap sx={{ fontSize: '12px' }}>
|
|
||||||
{dayjs(val.pickupslot).format('DD/MM/YYYY')}
|
|
||||||
</Typography>
|
|
||||||
<Chip
|
|
||||||
size="small"
|
|
||||||
label={dayjs(val.pickupslot).format('hh:mm A')}
|
|
||||||
variant="light"
|
|
||||||
sx={{
|
|
||||||
color: '#0a803b',
|
|
||||||
bgcolor: '#c3f3c7'
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</Tooltip>
|
|
||||||
<ArrowRightAltOutlined />
|
|
||||||
<Tooltip title="Estimated Delivery time">
|
|
||||||
<Typography noWrap sx={{ fontSize: '12px' }}>
|
|
||||||
{dayjs(val.expecteddeliverytime).format('DD/MM/YYYY')}
|
|
||||||
</Typography>
|
|
||||||
<Chip
|
|
||||||
size="small"
|
|
||||||
label={dayjs(val.expecteddeliverytime).format('hh:mm A')}
|
|
||||||
variant="light"
|
|
||||||
sx={{
|
|
||||||
color: '#DD2C00',
|
|
||||||
background: '#FBE9E7'
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</Tooltip>
|
|
||||||
</Stack>
|
|
||||||
</TableCell>
|
|
||||||
<TableCell align="left">
|
|
||||||
<Stack direction={'row'} spacing={1}>
|
|
||||||
<Stack direction="column">
|
|
||||||
<Typography variant="caption">{val.pickupcustomer}</Typography>
|
|
||||||
<Typography variant="caption">{val.pickupcontactno}</Typography>
|
|
||||||
<Tooltip title={val.pickupaddress}>
|
|
||||||
<Typography sx={{ cursor: 'pointer' }} variant="caption">
|
|
||||||
{val.pickupsuburb || val.pickupaddress.slice(0, 20)}
|
|
||||||
</Typography>
|
|
||||||
</Tooltip>
|
|
||||||
</Stack>
|
|
||||||
</Stack>
|
|
||||||
</TableCell>
|
|
||||||
<TableCell align="left">
|
|
||||||
<Stack direction={'row'} spacing={1}>
|
|
||||||
<Stack direction="column">
|
|
||||||
<Typography variant="caption">{val.deliverycustomer}</Typography>
|
|
||||||
<Typography variant="caption">{val.deliverycontactno}</Typography>
|
|
||||||
<Tooltip title={val.deliveryaddress}>
|
|
||||||
<Typography sx={{ cursor: 'pointer' }} variant="caption">
|
|
||||||
{val.deliverysuburb || val.deliveryaddress.slice(0, 20)}
|
|
||||||
</Typography>
|
|
||||||
</Tooltip>
|
|
||||||
</Stack>
|
|
||||||
</Stack>
|
|
||||||
</TableCell>
|
|
||||||
<TableCell align="left">
|
|
||||||
<Typography variant="caption" sx={{ whiteSpace: 'nowrap' }}>
|
|
||||||
{val.ordernotes}
|
|
||||||
</Typography>
|
|
||||||
</TableCell>
|
|
||||||
|
|
||||||
<TableCell align="left">
|
|
||||||
<Typography variant="caption" sx={{ whiteSpace: 'nowrap' }}>
|
|
||||||
{val.rider}
|
|
||||||
</Typography>
|
|
||||||
<br />
|
|
||||||
<Typography variant="caption">ID : {val.userid}</Typography>
|
|
||||||
</TableCell>
|
|
||||||
|
|
||||||
<TableCell align="center">
|
|
||||||
<Chip
|
|
||||||
size="small"
|
|
||||||
label={val.ordertype}
|
|
||||||
icon={
|
|
||||||
val.ordertype === 'Economy' ? (
|
|
||||||
<EnergySavingsLeafIcon />
|
|
||||||
) : val.ordertype === 'Risky' ? (
|
|
||||||
<WarningIcon />
|
|
||||||
) : (
|
|
||||||
<BoltIcon />
|
|
||||||
)
|
|
||||||
}
|
|
||||||
color={val.ordertype === 'Economy' ? 'success' : val.ordertype === 'Risky' ? 'error' : 'primary'}
|
|
||||||
variant="light"
|
|
||||||
/>
|
|
||||||
</TableCell>
|
|
||||||
<TableCell align="center">
|
|
||||||
<Chip
|
|
||||||
size="small"
|
|
||||||
label={`₹ ${parseFloat(val?.profit).toFixed(2)}`}
|
|
||||||
variant="light"
|
|
||||||
sx={{
|
|
||||||
color: '#009688',
|
|
||||||
bgcolor: '#b2dfdb'
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</TableCell>
|
|
||||||
|
|
||||||
<TableCell align="center">
|
|
||||||
<Stack display={'flex'} flexDirection={'column'} gap={1} sx={{ cursor: 'pointer' }}>
|
|
||||||
<Tooltip title="Charges" placement="top">
|
|
||||||
<Chip
|
|
||||||
size="small"
|
|
||||||
label={`₹ ${val.deliverycharge.toFixed(2)} `}
|
|
||||||
variant="light"
|
|
||||||
sx={{
|
|
||||||
color: '#0074e7',
|
|
||||||
bgcolor: '#cce3fa'
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</Tooltip>
|
|
||||||
{/* <Tooltip title="Amount" placement="left">
|
|
||||||
<Chip size="small" label={`₹ ${val.deliveryamt.toFixed(2)} `} color="success" variant="light" />
|
|
||||||
</Tooltip> */}
|
|
||||||
</Stack>
|
|
||||||
</TableCell>
|
|
||||||
<TableCell align="center">
|
|
||||||
<Stack display={'flex'} flexDirection={'column'} gap={1} sx={{ cursor: 'pointer' }}>
|
|
||||||
<Tooltip title="KMS" placement="top">
|
|
||||||
<Chip size="small" label={`${val.kms} km`} color="error" variant="light" />
|
|
||||||
</Tooltip>
|
|
||||||
<Tooltip title="Cumulative Kms" placement="right">
|
|
||||||
<Chip size="small" label={`${val.cumulativekms} km`} color="success" variant="light" />
|
|
||||||
</Tooltip>
|
|
||||||
</Stack>
|
|
||||||
</TableCell>
|
|
||||||
</TableRow>
|
|
||||||
</Fragment>
|
|
||||||
))}
|
|
||||||
</TableBody>
|
|
||||||
</Table>
|
|
||||||
</TableContainer>
|
|
||||||
</AccordionDetails>
|
|
||||||
</Accordion>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</MainCard>
|
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
<Stack display={'flex'} flexDirection={'row'} gap={2} alignItems={'center'} justifyContent={'end'} sx={{ p: 2 }}>
|
<Stack display={'flex'} flexDirection={'row'} gap={2} alignItems={'center'} justifyContent={'end'} sx={{ p: 2 }}>
|
||||||
|
|||||||
@@ -48,6 +48,8 @@ const RidersLogs = Loadable(lazy(() => import('pages/nearle/reports/ridersLogs')
|
|||||||
const Riders = Loadable(lazy(() => import('pages/nearle/riders/riders')));
|
const Riders = Loadable(lazy(() => import('pages/nearle/riders/riders')));
|
||||||
const Createrider = Loadable(lazy(() => import('pages/nearle/riders/createrider')));
|
const Createrider = Loadable(lazy(() => import('pages/nearle/riders/createrider')));
|
||||||
const EditRider = Loadable(lazy(() => import('pages/nearle/riders/editRider')));
|
const EditRider = Loadable(lazy(() => import('pages/nearle/riders/editRider')));
|
||||||
|
const Dispatch = Loadable(lazy(() => import('pages/nearle/dispatch/Dispatch')));
|
||||||
|
|
||||||
|
|
||||||
// ==============================|| MAIN ROUTING ||============================== //
|
// ==============================|| MAIN ROUTING ||============================== //
|
||||||
|
|
||||||
@@ -164,6 +166,10 @@ const MainRoutes = {
|
|||||||
element: <RidersLogs />
|
element: <RidersLogs />
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'dispatch',
|
||||||
|
element: <Dispatch />
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -205,8 +211,9 @@ const MainRoutes = {
|
|||||||
element: <MaintenanceComingSoon />
|
element: <MaintenanceComingSoon />
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
export default MainRoutes;
|
export default MainRoutes;
|
||||||
|
|||||||
@@ -16,5 +16,6 @@
|
|||||||
"ordersdetails": "Orders Details",
|
"ordersdetails": "Orders Details",
|
||||||
"riderssummary": "Riders Summary",
|
"riderssummary": "Riders Summary",
|
||||||
"riderslogs": "Riders Logs",
|
"riderslogs": "Riders Logs",
|
||||||
"invoice": "Invoice"
|
"invoice": "Invoice",
|
||||||
|
"dispatch": "Dispatch"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user