updates and removed on the dead codes
This commit is contained in:
@@ -106,24 +106,6 @@ const soft = (c) => a(c, '18');
|
||||
const ring = (c) => a(c, '26');
|
||||
const edge = (c) => a(c, '55');
|
||||
|
||||
const pillFieldSx = (color) => ({
|
||||
cursor: 'pointer',
|
||||
'& .MuiOutlinedInput-root': {
|
||||
borderRadius: '10px',
|
||||
bgcolor: '#ffffff',
|
||||
fontWeight: 600,
|
||||
color: DT.textPrimary,
|
||||
paddingRight: '8px',
|
||||
cursor: 'pointer',
|
||||
transition: 'border-color 0.15s, box-shadow 0.15s, background-color 0.2s',
|
||||
'& fieldset': { borderColor: '#e2e8f0', borderWidth: 1 },
|
||||
'&:hover fieldset': { borderColor: '#cbd5e1' },
|
||||
'&.Mui-focused': { boxShadow: `0 0 0 3px ${ring(color)}` },
|
||||
'&.Mui-focused fieldset': { borderColor: '#C01227', borderWidth: 1.5 }
|
||||
},
|
||||
'& .MuiAutocomplete-endAdornment .MuiSvgIcon-root': { color: color }
|
||||
});
|
||||
|
||||
// Status palette — drives the pill tabs and per-row badges.
|
||||
const STATUS_META = {
|
||||
active: { label: 'Active', color: '#10b981', icon: MdCheckCircle, statusKey: 'active' },
|
||||
@@ -202,7 +184,7 @@ const Clients1 = () => {
|
||||
const [latlong, setLatlong] = useState({});
|
||||
const [editClient, setEditClient] = useState({});
|
||||
const [page, setPage] = useState(0);
|
||||
const [tabStatus, setTabStatus] = useState('Active');
|
||||
const [, setTabStatus] = useState('Active');
|
||||
|
||||
const handleChangePage = (event, newPage) => {
|
||||
setPage(newPage);
|
||||
@@ -1785,14 +1767,6 @@ const Clients1 = () => {
|
||||
variant="outlined"
|
||||
fullWidth
|
||||
value={latlong.lng}
|
||||
// onChange={(e) => {
|
||||
// setLongi(e.target.value.toString())
|
||||
// setEditClient({
|
||||
// ...editClient,
|
||||
// longitude:
|
||||
// e.target.value.toString(),
|
||||
// });
|
||||
// }}
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
@@ -2,7 +2,7 @@ import { useEffect, useState } from 'react';
|
||||
|
||||
// material-ui
|
||||
import { useTheme } from '@mui/material/styles';
|
||||
import { Box, Button, FormLabel, Grid, InputLabel, MenuItem, Select, Stack, TextField, Typography, useMediaQuery } from '@mui/material';
|
||||
import { Button, Grid, InputLabel, MenuItem, Select, Stack, TextField, Typography, useMediaQuery } from '@mui/material';
|
||||
|
||||
// third-party
|
||||
// import { PatternFormat } from 'react-number-format';
|
||||
@@ -55,8 +55,6 @@ const Createclient = () => {
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
// fetchprofiledetails(localStorage.getItem('appuserid'));
|
||||
// fetchprofiledetails(181);
|
||||
if (localStorage.getItem('tenantid')) {
|
||||
fetchtenantinfo(localStorage.getItem('tenantid'));
|
||||
}
|
||||
@@ -93,41 +91,6 @@ const Createclient = () => {
|
||||
// console.log(alertmessage)
|
||||
};
|
||||
|
||||
const fetchprofiledetails = async (userid) => {
|
||||
if (userid) {
|
||||
setLoading(true);
|
||||
try {
|
||||
await axios
|
||||
.get(`${process.env.REACT_APP_URL2}/tenants/getclient?id=${userid}`)
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
if (res.data.message === 'Successful') {
|
||||
let res1 = res.data.details;
|
||||
setMobilenumber(res1.contactno);
|
||||
setEmailaddress(res1.primaryemail);
|
||||
setAddress(res1.address);
|
||||
setCity(res1.city);
|
||||
setZipcode(res1.postcode);
|
||||
setState(res1.state);
|
||||
setSuburb(res1.suburb);
|
||||
setLatlong({
|
||||
lat: res1.latitude,
|
||||
lng: res1.longitude
|
||||
});
|
||||
}
|
||||
setLoading(false);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
setLoading(false);
|
||||
});
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
setLoading(false);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const fetchtenantinfo = async (tid) => {
|
||||
setLoading(true);
|
||||
await axios
|
||||
@@ -256,10 +219,6 @@ const Createclient = () => {
|
||||
autoHideDuration: 2000
|
||||
});
|
||||
navigate('/clients');
|
||||
// setTimeout(()=>{
|
||||
// fetchprofiledetails(localStorage.getItem('appuserid'));
|
||||
|
||||
// },2000)
|
||||
} else if (res.data.message == 'Customer Already available') {
|
||||
enqueueSnackbar('Customer Already available', {
|
||||
variant: 'error',
|
||||
|
||||
@@ -36,8 +36,6 @@ import {
|
||||
MdLocationOn,
|
||||
MdEdit,
|
||||
MdGroups,
|
||||
MdHowToReg,
|
||||
MdPlace,
|
||||
MdOutlineGroups,
|
||||
MdOutlineHowToReg,
|
||||
MdOutlinePlace
|
||||
@@ -273,14 +271,6 @@ export default function Customers() {
|
||||
}
|
||||
}, [address]);
|
||||
|
||||
// useEffect(() => {
|
||||
// selectedCustomer &&
|
||||
// setLatlong({
|
||||
// lat: selectedCustomer.latitude,
|
||||
// lng: selectedCustomer.longitude
|
||||
// });
|
||||
// }, [selectedCustomer]);
|
||||
|
||||
// ==============================|| getallcustomers (customers) ||============================== //
|
||||
|
||||
const {
|
||||
|
||||
@@ -18,7 +18,6 @@ import {
|
||||
MdStorefront,
|
||||
MdLocationOn,
|
||||
MdDirectionsBike,
|
||||
MdLocalShipping,
|
||||
MdNotificationsActive,
|
||||
MdPersonPin,
|
||||
MdHistoryToggleOff,
|
||||
@@ -325,7 +324,6 @@ const Deliveries = () => {
|
||||
const [tabstatus, setTabstatus] = useState('Pending');
|
||||
const [tabvalue, setTabvalue] = useState(0);
|
||||
const [open, setOpen] = useState(false);
|
||||
const [datestatus, setDatestatus] = useState('Today');
|
||||
const [kms, setKms] = useState('');
|
||||
const [cumulativekms, setCumulativeKms] = useState();
|
||||
const [deliveryamount, setDeliveryamount] = useState();
|
||||
@@ -339,7 +337,6 @@ const Deliveries = () => {
|
||||
const tenantRef = useRef(null);
|
||||
const [page, setPage] = React.useState(0);
|
||||
const [rowsPerPage, setRowsPerPage] = React.useState(50);
|
||||
const [totalCount, setTotalCount] = React.useState();
|
||||
const [productCollapse, setProductCollapse] = useState(null);
|
||||
const [orderHeaderid, setOrderHeaderId] = useState(null);
|
||||
const [searchword, setSearchword] = useState('');
|
||||
@@ -347,8 +344,6 @@ const Deliveries = () => {
|
||||
const [menuAnchorEl, setMenuAnchorEl] = React.useState(null);
|
||||
const [selectedRow, setSelectedRow] = useState(null);
|
||||
const [loading1, setLoading1] = useState(false);
|
||||
const [anchorEl, setAnchorEl] = React.useState(null);
|
||||
const [open2, setOpen2] = useState('');
|
||||
const [cancelDeliveryOpen, setCancelDeliveryOpen] = useState(false);
|
||||
const [changeDialogOpen, setChangeDialogOpen] = useState(false);
|
||||
const [cancelFeed, setCancelFeed] = useState('');
|
||||
@@ -488,7 +483,7 @@ const Deliveries = () => {
|
||||
countSourceRefetch(); // Refresh the all-statuses dataset feeding table + chips
|
||||
notifyRiderMutation.mutate(selectedRider.userfcmtoken);
|
||||
},
|
||||
onError: (err, { selectedRider, selectedRow }) => {
|
||||
onError: (err, { selectedRow }) => {
|
||||
logger.error(`Failed to change rider for order ID ${selectedRow?.orderid}:`, err);
|
||||
opentoast(err.message, 'error');
|
||||
setLoading1(false);
|
||||
@@ -524,43 +519,35 @@ const Deliveries = () => {
|
||||
if (i === 0) {
|
||||
setTabstatus('Pending');
|
||||
setCurrentStatus('pending');
|
||||
setTotalCount(countData?.uncoveredLength);
|
||||
}
|
||||
if (i === 1) {
|
||||
setTabstatus('Assigned');
|
||||
setCurrentStatus('accepted');
|
||||
setTotalCount(countData?.assignedLength);
|
||||
}
|
||||
if (i === 2) {
|
||||
setTabstatus('Arrived');
|
||||
setCurrentStatus('arrived');
|
||||
setTotalCount(countData?.arrivedLength);
|
||||
}
|
||||
if (i === 3) {
|
||||
setTabstatus('Picked');
|
||||
setCurrentStatus('picked');
|
||||
setTotalCount(countData?.pickedLength);
|
||||
}
|
||||
if (i === 4) {
|
||||
setTabstatus('Active');
|
||||
setCurrentStatus('active');
|
||||
setTotalCount(countData?.activeLength);
|
||||
}
|
||||
if (i === 5) {
|
||||
setTabstatus('Skipped');
|
||||
setCurrentStatus('skipped');
|
||||
setTotalCount(countData?.skippedLength);
|
||||
}
|
||||
if (i === 6) {
|
||||
setTabstatus('Delivered');
|
||||
setCurrentStatus('delivered');
|
||||
setTotalCount(countData?.coveredLength);
|
||||
}
|
||||
|
||||
if (i === 7) {
|
||||
setTabstatus('Cancelled');
|
||||
setCurrentStatus('cancelled');
|
||||
setTotalCount(countData?.cancelLength);
|
||||
}
|
||||
console.log(i);
|
||||
setSearchword('');
|
||||
@@ -807,13 +794,6 @@ const Deliveries = () => {
|
||||
queryKey: ['fetchCountData', appId, userid, startdate, enddate, rowsPerPage, debouncedSearch, tenantid, locationid, riderid, tabstatus],
|
||||
queryFn: () => fetchCountAPI(appId, userid, startdate, enddate, rowsPerPage, debouncedSearch, tenantid, locationid, riderid)
|
||||
});
|
||||
useEffect(() => {
|
||||
console.log('countData', countData);
|
||||
if (tabvalue === 0 && countData) {
|
||||
setTotalCount(countData.uncoveredLength);
|
||||
}
|
||||
}, [countData]);
|
||||
|
||||
// ==============================|| fetchRidersList ||============================== //
|
||||
|
||||
const {
|
||||
@@ -2597,11 +2577,6 @@ const Deliveries = () => {
|
||||
} else {
|
||||
setStartdate(dayjs(range.startDate).format('YYYY-MM-DD'));
|
||||
setEnddate(dayjs(range.endDate).format('YYYY-MM-DD'));
|
||||
if (range.label) {
|
||||
setDatestatus(range.label);
|
||||
} else {
|
||||
setDatestatus('');
|
||||
}
|
||||
}
|
||||
console.log(range);
|
||||
}}
|
||||
@@ -2646,11 +2621,6 @@ const Deliveries = () => {
|
||||
startDate: startOfMonth(addMonths(new Date(), -1)),
|
||||
endDate: endOfMonth(addMonths(new Date(), -1))
|
||||
}
|
||||
// {
|
||||
// label: 'All',
|
||||
// startDate: new Date(),
|
||||
// endDate: addDays(new Date(), -1),
|
||||
// },
|
||||
]}
|
||||
/>
|
||||
</DialogContent>
|
||||
|
||||
@@ -96,7 +96,7 @@ const ActiveSection = ({
|
||||
);
|
||||
}
|
||||
|
||||
const renderActiveDeliveryCard = (o, i) => {
|
||||
const renderActiveDeliveryCard = (o) => {
|
||||
const rid = o.rider_id || o.userid;
|
||||
const rider = riders.find((r) => String(r.id) === String(rid));
|
||||
const color = getRiderColor(rid);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React, { useState, useEffect, useMemo, useCallback, useRef } from 'react';
|
||||
import { MapContainer, TileLayer, Marker, Popup, Polyline, Tooltip, useMap, useMapEvents, ZoomControl } from 'react-leaflet';
|
||||
import { MapContainer, TileLayer, Marker, Popup, Polyline, Tooltip, useMap, ZoomControl } from 'react-leaflet';
|
||||
import L from 'leaflet';
|
||||
import 'leaflet/dist/leaflet.css';
|
||||
// Side-effect import: patches L.Polyline so pathOptions.offset (in screen px)
|
||||
@@ -22,7 +22,6 @@ import {
|
||||
MdStraighten,
|
||||
MdLocationOn,
|
||||
MdMarkunreadMailbox,
|
||||
MdMoveToInbox,
|
||||
MdPlace,
|
||||
MdTwoWheeler,
|
||||
MdNotes,
|
||||
@@ -59,7 +58,6 @@ import ProfitabilitySection from './ProfitabilitySection';
|
||||
import ActiveSection from './ActiveSection';
|
||||
import { fetchDeliveries, fetchAppLocations, getRiderPeriodicLogs, fetchRidersLogs, fetchBatchEfficiency } from '../../api/api';
|
||||
import {
|
||||
STATUS_STYLES,
|
||||
getStatusStyle,
|
||||
FINAL_STATUSES,
|
||||
SKIPPED_STATUSES,
|
||||
@@ -232,15 +230,6 @@ const getRowBatch = (r, fieldId = 'all', batches = BATCHES_DEFAULT) => {
|
||||
return getBatchForHour(d.hour() + d.minute() / 60, batches);
|
||||
};
|
||||
|
||||
// Sits inside the Compare MapContainer and unpins any pinned popup whenever
|
||||
// the operator clicks empty map space. Markers' click events do NOT bubble
|
||||
// to the map, so this only fires on background clicks (which is what we
|
||||
// want — clicking elsewhere should release the pin).
|
||||
function CompareMapClickUnpin({ onUnpin }) {
|
||||
useMapEvents({ click: () => onUnpin() });
|
||||
return null;
|
||||
}
|
||||
|
||||
// Captures the Leaflet map instance for the parent component via a ref. Kept
|
||||
// available even after the two-map Compare layout was unified into one map,
|
||||
// since future per-step imperative zoom logic still needs a handle on the
|
||||
@@ -983,12 +972,6 @@ const ANALYSIS_BATCH_WINDOWS = [
|
||||
|
||||
// Tolerant field-name lookup so the Analysis card still renders cleanly even
|
||||
// if the API response uses slightly different keys than expected.
|
||||
const analysisPick = (obj, keys) => {
|
||||
for (const k of keys) {
|
||||
if (obj && obj[k] != null && obj[k] !== '') return obj[k];
|
||||
}
|
||||
return null;
|
||||
};
|
||||
const analysisFormatNum = (v) => {
|
||||
if (v == null) return '—';
|
||||
if (typeof v === 'number') return v.toLocaleString('en-IN');
|
||||
@@ -996,14 +979,6 @@ const analysisFormatNum = (v) => {
|
||||
if (Number.isFinite(n)) return n.toLocaleString('en-IN');
|
||||
return String(v);
|
||||
};
|
||||
const analysisFormatKm = (v) => (v == null ? '—' : `${parseFloat(v).toFixed(1)} km`);
|
||||
const analysisFormatRupees = (v) => (v == null ? '—' : `₹${parseFloat(v).toFixed(0)}`);
|
||||
const analysisFormatPct = (v) => {
|
||||
if (v == null) return '—';
|
||||
const n = parseFloat(v);
|
||||
if (!Number.isFinite(n)) return '—';
|
||||
return `${n > 1 ? n.toFixed(1) : (n * 100).toFixed(1)}%`;
|
||||
};
|
||||
// Parse "HH:mm:ss" or "HH:mm" → seconds since midnight. Returns null when the
|
||||
// string is missing or malformed. Used to compute gantt percentages for the
|
||||
// rider timelines on the Analysis page — the API ships those fields as bare
|
||||
@@ -1163,7 +1138,6 @@ const Dispatch = ({
|
||||
// Short-lived close timer for the general map order/marker popups.
|
||||
// Gives the cursor a ~200ms window to travel from the marker onto the popup
|
||||
// or vice versa without immediately triggering a close.
|
||||
const activePopupMarkerRef = useRef(null);
|
||||
const popupHoverTimerRef = useRef(null);
|
||||
// Order shown in the centered popup overlay. Rendered outside the leaflet
|
||||
// map (see `dispatch-popup-center` overlay near the bottom of the JSX) so
|
||||
@@ -3150,7 +3124,7 @@ const Dispatch = ({
|
||||
? new Map(riderActualTracks.map((t) => [String(t.deliveryid), t.sequenceStep]))
|
||||
: null;
|
||||
|
||||
return ordersToRender.map((o, idx) => {
|
||||
return ordersToRender.map((o) => {
|
||||
const rid = o.rider_id;
|
||||
const active = rid ? activeRiders.has(rid) : true;
|
||||
let color = getRiderColor(rid);
|
||||
@@ -3477,13 +3451,6 @@ const Dispatch = ({
|
||||
return routes;
|
||||
};
|
||||
|
||||
const toggleRider = (rid) => {
|
||||
const newActive = new Set(activeRiders);
|
||||
if (newActive.has(rid)) newActive.delete(rid);
|
||||
else newActive.add(rid);
|
||||
setActiveRiders(newActive);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className={`dispatch-container${embedded ? ' embedded' : ''}${compareOpen ? ' compare-open' : ''}`}>
|
||||
{!embedded && (
|
||||
@@ -5373,15 +5340,6 @@ const Dispatch = ({
|
||||
(o) => o.deliveryid != null && String(o.deliveryid) === String(t.deliveryid)
|
||||
);
|
||||
|
||||
const statusStyle = getStatusStyle(t.orderstatus);
|
||||
const flagSvg = t.orderstatus
|
||||
? `<svg class="cmark-flag" viewBox="0 0 18 22" xmlns="http://www.w3.org/2000/svg">
|
||||
<line x1="1.5" y1="0" x2="1.5" y2="22" stroke="#0f172a" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<polygon points="2,1 17,1 13.5,5.5 17,10 2,10" fill="${statusStyle.bg}" stroke="#0f172a" stroke-width="0.6" stroke-linejoin="round"/>
|
||||
${isDelivered ? '<polyline points="5,5.5 7,7.5 11,3.5" fill="none" stroke="#fff" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"/>' : ''}
|
||||
</svg>`
|
||||
: '';
|
||||
|
||||
const dropClasses = ['compare-step-pin'];
|
||||
if (isFocusedStep) dropClasses.push('is-focused');
|
||||
if (isDelivered) dropClasses.push('is-delivered');
|
||||
|
||||
@@ -9,12 +9,9 @@ import logo_nearle1 from '../../../assets/images/doormile-logo.png';
|
||||
const DOORMILE_RED_FILTER = 'brightness(0) saturate(100%) invert(15%) sepia(93%) saturate(5437%) hue-rotate(346deg) brightness(81%) contrast(92%)';
|
||||
import axios from 'axios';
|
||||
import dayjs from 'dayjs';
|
||||
import Loader from 'components/Loader';
|
||||
import { enqueueSnackbar } from 'notistack';
|
||||
import { DownloadOutlined, PrinterFilled } from '@ant-design/icons';
|
||||
import ReactToPrint, { useReactToPrint } from 'react-to-print';
|
||||
import { SearchOutlined, LeftOutlined, RightOutlined } from '@ant-design/icons';
|
||||
import ArrowBackIcon from '@mui/icons-material/ArrowBack';
|
||||
import { PrinterFilled } from '@ant-design/icons';
|
||||
import ReactToPrint from 'react-to-print';
|
||||
// import jsPDF from 'jspdf';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { FaArrowLeft } from 'react-icons/fa6';
|
||||
@@ -30,14 +27,9 @@ import {
|
||||
TableCell,
|
||||
TableContainer,
|
||||
TableHead,
|
||||
TablePagination,
|
||||
TableRow,
|
||||
Tabs,
|
||||
Tab,
|
||||
Typography,
|
||||
Box,
|
||||
OutlinedInput,
|
||||
InputAdornment,
|
||||
IconButton,
|
||||
TextField,
|
||||
Tooltip,
|
||||
@@ -55,7 +47,6 @@ const InvoicePreview = () => {
|
||||
const navigate = useNavigate();
|
||||
console.log('previewSelect', location.state);
|
||||
const componentRef = useRef(null);
|
||||
const [tabletype, settabletype] = useState(true);
|
||||
const [paydialog, setpaydialog] = useState(false);
|
||||
const [refnumber, setRefnumber] = useState('');
|
||||
const [remarks, setRemarks] = useState('');
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
import { enqueueSnackbar, closeSnackbar } from 'notistack';
|
||||
import { enqueueSnackbar } from 'notistack';
|
||||
import AnimateButton from 'components/@extended/AnimateButton';
|
||||
import OtpInput from 'react18-input-otp';
|
||||
|
||||
import { Box, Card, CardContent, Stack, TextField, Button, Typography, Link, FormLabel, IconButton, InputAdornment } from '@mui/material';
|
||||
import { useTheme } from '@mui/material/styles';
|
||||
@@ -11,7 +10,6 @@ import Loader from 'components/Loader';
|
||||
import doormileLogo from 'assets/images/doormile-logo.png';
|
||||
import { useSelector, useDispatch } from 'react-redux';
|
||||
import { OpenToast } from 'components/third-party/OpenToast';
|
||||
import { closeGlobalToast, GlobalToast } from 'components/nearle_components/GlobalToast';
|
||||
import Visibility from '@mui/icons-material/Visibility';
|
||||
import VisibilityOff from '@mui/icons-material/VisibilityOff';
|
||||
import { setLoginUser } from 'store/reducers/loginUserSlice';
|
||||
@@ -23,18 +21,15 @@ const DOORMILE_RED_FILTER = 'brightness(0) saturate(100%) invert(15%) sepia(93%)
|
||||
const Login = () => {
|
||||
const dispatch = useDispatch();
|
||||
const fcmtoken = useSelector((state) => state.fcm);
|
||||
const permission = useSelector((state) => state.fcm.permission);
|
||||
const theme = useTheme();
|
||||
const [loading, setLoading] = useState(false);
|
||||
let navigate = useNavigate();
|
||||
const [otp, setOtp] = useState('');
|
||||
const [currentotp, setCurrentotp] = useState('');
|
||||
const [userinfo, setUserinfo] = useState({});
|
||||
const [, setOtp] = useState('');
|
||||
const [username, setUsername] = useState('');
|
||||
const [passwordStatus, setPasswordStatus] = useState(0);
|
||||
const [password, setPassword] = useState('');
|
||||
const [confirmPassword, setConfirmPassword] = useState('');
|
||||
const [isPassword, setIspassword] = useState(false);
|
||||
const [isPassword] = useState(false);
|
||||
const [showPassword, setShowPassword] = useState(false);
|
||||
const [showConfirmPassword, setShowConfirmPassword] = useState(false);
|
||||
const [userid, setUserid] = useState(0);
|
||||
@@ -89,7 +84,6 @@ const Login = () => {
|
||||
// user found, correct password
|
||||
else if (res.data.code == 200 && res.data.status) {
|
||||
OpenToast(res.data.message, 'success', 1000);
|
||||
setUserinfo(res.data.details);
|
||||
const userinfo = res.data.details;
|
||||
dispatch(setLoginUser(userinfo));
|
||||
localStorage.setItem('firstname', userinfo.firstname);
|
||||
@@ -113,21 +107,6 @@ const Login = () => {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
const loginsuccessful = () => {
|
||||
localStorage.setItem('firstname', userinfo.firstname);
|
||||
localStorage.setItem('authname', userinfo.authname);
|
||||
localStorage.setItem('roleid', userinfo.roleid);
|
||||
localStorage.setItem('tenantid', userinfo.tenantid);
|
||||
localStorage.setItem('partnerid', userinfo.partnerid);
|
||||
localStorage.setItem('applocationid', userinfo.applocationid);
|
||||
localStorage.setItem('userid', userinfo.userid);
|
||||
localStorage.setItem('userfcmtoken', userinfo.userfcmtoken);
|
||||
markSessionStart();
|
||||
closeGlobalToast(); // to close the pin snackbar
|
||||
|
||||
navigate('/nearle/dispatch');
|
||||
};
|
||||
|
||||
const opentoast = (message) => {
|
||||
enqueueSnackbar(message, {
|
||||
variant: 'error',
|
||||
@@ -287,14 +266,6 @@ const Login = () => {
|
||||
}
|
||||
loginsend();
|
||||
}
|
||||
// if (currentotp) {
|
||||
// if (currentotp == otp) {
|
||||
// loginsuccessful();
|
||||
// fetchAppLocations();
|
||||
// } else {
|
||||
// opentoast('Invalid pin');
|
||||
// }
|
||||
// }
|
||||
}}
|
||||
>
|
||||
<Stack spacing={3}>
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
import { useSelector } from 'react-redux';
|
||||
// import AuthWrapper from 'sections/auth/AuthWrapper';
|
||||
import {
|
||||
Box,
|
||||
Grid,
|
||||
@@ -39,7 +37,7 @@ const Login = () => {
|
||||
const isMobile = useMediaQuery(theme.breakpoints.down('md'));
|
||||
const [username, setUsername] = useState('');
|
||||
const [password, setPassword] = useState('');
|
||||
const [alertmessage, setAlertmessage] = useState('');
|
||||
const [, setAlertmessage] = useState('');
|
||||
const [checkusername, setCheckusername] = useState(false);
|
||||
// const [toast, setToast] = useState(false);
|
||||
const [loading, setLoading] = useState(false);
|
||||
@@ -107,11 +105,8 @@ const Login = () => {
|
||||
// setCheckusername(false);
|
||||
// }
|
||||
})
|
||||
.catch((err) => {
|
||||
// if (err.response.data.message === 'No user found') {
|
||||
|
||||
.catch(() => {
|
||||
setCheckusername(true);
|
||||
// }
|
||||
});
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
@@ -278,10 +273,6 @@ const Login = () => {
|
||||
<CardHeader title={<Typography variant="h3">Login</Typography>} />
|
||||
</Stack>
|
||||
</Grid>
|
||||
|
||||
{/* <Grid item xs={12}>
|
||||
<AuthLogin isDemo={isLoggedIn} />
|
||||
</Grid> */}
|
||||
</Grid>
|
||||
<CardContent>
|
||||
<form
|
||||
@@ -516,4 +507,4 @@ const Login = () => {
|
||||
);
|
||||
};
|
||||
|
||||
export default Login1;
|
||||
export default Login;
|
||||
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
Backdrop,
|
||||
IconButton
|
||||
} from '@mui/material';
|
||||
import React, { Fragment, useEffect, useMemo, useState } from 'react';
|
||||
import React, { Fragment, useEffect, useState } from 'react';
|
||||
import { useTheme } from '@mui/material/styles';
|
||||
import useMediaQuery from '@mui/material/useMediaQuery';
|
||||
import { MobileCard, MobileCardList, MobileField, MobileFieldGrid } from 'components/nearle_components/MobileCard';
|
||||
@@ -32,7 +32,7 @@ import Loader from 'components/Loader';
|
||||
import CircularLoader from 'components/CircularLoader';
|
||||
import { Empty } from 'antd';
|
||||
import HoverSocialCard from 'components/cards/statistics/HoverSocialCard';
|
||||
import { DashboardFilled, OpenAIFilled } from '@ant-design/icons';
|
||||
import { DashboardFilled } from '@ant-design/icons';
|
||||
import { MdDirectionsBike } from 'react-icons/md';
|
||||
import { FaMapLocationDot } from 'react-icons/fa6';
|
||||
import { HiOutlineArrowLeft } from 'react-icons/hi';
|
||||
@@ -234,9 +234,7 @@ const OrdersPreview = () => {
|
||||
|
||||
const {
|
||||
data: paymentModes = [],
|
||||
isLoading: paymentModesLoading,
|
||||
isError: paymentModesError,
|
||||
error: paymentModesErrorMessage
|
||||
isLoading: paymentModesLoading
|
||||
} = useQuery({
|
||||
queryKey: ['paymentmodes'],
|
||||
queryFn: fetchPaymentType
|
||||
@@ -246,24 +244,13 @@ const OrdersPreview = () => {
|
||||
|
||||
const {
|
||||
data: ridersList = [],
|
||||
isLoading: ridersListLoading,
|
||||
isError: ridersListError,
|
||||
error: ridersListErrorMessage,
|
||||
refetch: ridersListRefetch
|
||||
isLoading: ridersListLoading
|
||||
} = useQuery({
|
||||
queryKey: ['ridersList', appId], // Unique key for caching & re-fetching
|
||||
queryFn: fetchRidersList,
|
||||
enabled: appId !== 0 // Ensures query runs only when appId is valid
|
||||
});
|
||||
|
||||
const getRiderName = async (userid) => {
|
||||
await ridersList.map((rider) => {
|
||||
if (rider.userid == userid) {
|
||||
return rider.firstname;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// ======================================================= || notifyRiderMutation || =======================================================
|
||||
|
||||
const notifyRiderMutation = useMutation({
|
||||
|
||||
@@ -9,7 +9,6 @@ import {
|
||||
Button,
|
||||
TextField,
|
||||
Autocomplete,
|
||||
Chip,
|
||||
Divider,
|
||||
DialogTitle,
|
||||
DialogContent,
|
||||
@@ -19,7 +18,6 @@ import {
|
||||
IconButton,
|
||||
Switch,
|
||||
OutlinedInput,
|
||||
FormGroup,
|
||||
FormControlLabel,
|
||||
Box,
|
||||
Card,
|
||||
@@ -28,7 +26,7 @@ import {
|
||||
import CloseIcon from '@mui/icons-material/Close';
|
||||
import { calculateDrivingDistance, calculateTotalCharge } from '../../../utils/distance';
|
||||
import { Empty } from 'antd';
|
||||
import { FaPhoneAlt, FaBox, FaBoxes, FaTruck, FaArrowRight, FaArrowLeft, FaCheck, FaRoute, FaMoneyBillWave, FaChartLine, FaReceipt, FaPaperPlane } from 'react-icons/fa';
|
||||
import { FaPhoneAlt, FaBox, FaBoxes, FaArrowRight, FaArrowLeft, FaCheck, FaRoute, FaMoneyBillWave, FaChartLine, FaReceipt, FaPaperPlane } from 'react-icons/fa';
|
||||
import { GiDoorHandle } from 'react-icons/gi';
|
||||
import { FaLandmarkDome } from 'react-icons/fa6';
|
||||
import ClearIcon from '@mui/icons-material/Clear';
|
||||
@@ -39,8 +37,6 @@ import axios from 'axios';
|
||||
import { useTheme } from '@mui/material/styles';
|
||||
import Geocode from 'react-geocode';
|
||||
import Loader from 'components/Loader';
|
||||
import * as geolib from 'geolib';
|
||||
import MainCard from 'components/MainCard';
|
||||
import { FaUser } from 'react-icons/fa6';
|
||||
import { DatePicker } from '@mui/x-date-pickers/DatePicker';
|
||||
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
|
||||
@@ -50,7 +46,7 @@ import dayjs from 'dayjs';
|
||||
import { enqueueSnackbar } from 'notistack';
|
||||
var utc = require('dayjs/plugin/utc');
|
||||
dayjs.extend(utc);
|
||||
import { SearchOutlined, CloseOutlined, CalendarOutlined, ClockCircleOutlined, FileTextOutlined, MessageOutlined } from '@ant-design/icons';
|
||||
import { SearchOutlined, CalendarOutlined, ClockCircleOutlined, FileTextOutlined, MessageOutlined } from '@ant-design/icons';
|
||||
import MyLocationIcon from '@mui/icons-material/MyLocation';
|
||||
import HighlightOffIcon from '@mui/icons-material/HighlightOff';
|
||||
import { OpenToast } from 'components/third-party/OpenToast';
|
||||
@@ -58,7 +54,6 @@ import { MapContainer, TileLayer, Marker, Polyline, useMap } from 'react-leaflet
|
||||
import L from 'leaflet';
|
||||
import 'leaflet/dist/leaflet.css';
|
||||
import './OrdersRedesign.css';
|
||||
import ArrowDownwardIcon from '@mui/icons-material/ArrowDownward';
|
||||
import AnimateButton from 'components/@extended/AnimateButton';
|
||||
|
||||
const pickupIcon = typeof window !== 'undefined' ? new L.Icon({
|
||||
@@ -192,14 +187,12 @@ const Createorder1 = () => {
|
||||
const tenantRef = useRef(null);
|
||||
const [inputValue1, setInputValue1] = React.useState('');
|
||||
const [inputValue2, setInputValue2] = React.useState('');
|
||||
const [tenanatLocoId, setTenanatLocoId] = useState(localStorage.getItem('locationid'));
|
||||
const [isLocation, setIsLocation] = useState(false);
|
||||
const textFieldRef1 = useRef(null);
|
||||
const textFieldRef1a = useRef(null);
|
||||
const textFieldRef2 = useRef(null);
|
||||
const [appId, setAppId] = useState(0);
|
||||
const [open, setOpen] = useState(false);
|
||||
const [clientdetail, setClientdetail] = useState([]);
|
||||
const [, setClientdetail] = useState([]);
|
||||
const [startdate, setStartdate] = useState(dayjs().format('MM-DD-YYYY'));
|
||||
// const [starttime, setStatrttime] = useState(`${dayjs().format('MM-DD-YYYY')} 08:00:00`);
|
||||
const [starttime, setStatrttime] = useState();
|
||||
@@ -224,16 +217,15 @@ const Createorder1 = () => {
|
||||
const [minKm, setMinKm] = useState(0);
|
||||
const [totalCharge, setTotalCharge] = useState(0);
|
||||
const [subCat, setSubCat] = useState([]);
|
||||
const [subCatName, setSubCatName] = useState('Select ');
|
||||
const [, setSubCatName] = useState('Select ');
|
||||
const [subCatId, setSubCatId] = useState(0);
|
||||
const [weight, setWeight] = useState('');
|
||||
const [weight] = useState('');
|
||||
const [tenantid, setTenantid] = useState(0);
|
||||
const [locationid, setLocationid] = useState(0);
|
||||
const [selectedCatChip, setSelectedCatChip] = useState(null);
|
||||
const [isCustomerOpen, setIsCustomerOpen] = useState(false);
|
||||
const [searchCustList, setSearchCustList] = useState('');
|
||||
const [customerlist, setCustomerlist] = useState([]);
|
||||
const [defaultPickup, setDefaultPickup] = useState(null);
|
||||
const [, setDefaultPickup] = useState(null);
|
||||
const [pickCust, setPickCust] = useState(null);
|
||||
const [dropCust, setDropCust] = useState(null);
|
||||
const [pickordrop, setpickordrop] = useState(0); // 1 ->pick 2 -> drop
|
||||
@@ -330,20 +322,6 @@ const Createorder1 = () => {
|
||||
appId && fetchtenantinfolist();
|
||||
}, [appId]);
|
||||
|
||||
const handleChipClick = (chipLabel) => {
|
||||
setSelectedCatChip(chipLabel);
|
||||
};
|
||||
|
||||
const chipStyle = (chipLabel) => ({
|
||||
cursor: 'pointer',
|
||||
backgroundColor: selectedCatChip === chipLabel ? theme.palette.primary.main : 'default',
|
||||
color: selectedCatChip === chipLabel ? '#fff' : '',
|
||||
'&:hover': {
|
||||
backgroundColor: selectedCatChip === chipLabel ? theme.palette.primary.main : theme.palette.primary.light,
|
||||
color: '#fff'
|
||||
}
|
||||
});
|
||||
|
||||
const fetchTenantPricing = async (id) => {
|
||||
try {
|
||||
const pricingResponse = await axios.get(`${process.env.REACT_APP_URL}/tenants/gettenantpricing/?tenantid=${id}`);
|
||||
@@ -473,9 +451,9 @@ const Createorder1 = () => {
|
||||
console.log('endtime', `${dayjs().format('MM-DD-YYYY')} ${closetime} `);
|
||||
let arr = [];
|
||||
for (
|
||||
let i = `${dayjs().format('MM-DD-YYYY')} ${opentime}`, j = 0;
|
||||
let i = `${dayjs().format('MM-DD-YYYY')} ${opentime}`;
|
||||
dayjs(`${dayjs().format('MM-DD-YYYY')} ${closetime} `).diff(i, 'm') >= 0;
|
||||
j++, i = dayjs(i).add(30, 'm')
|
||||
i = dayjs(i).add(30, 'm')
|
||||
) {
|
||||
arr.push(i);
|
||||
}
|
||||
@@ -859,7 +837,6 @@ const Createorder1 = () => {
|
||||
// radius: 100000 //km to m
|
||||
}).getBounds()
|
||||
});
|
||||
let arr = [];
|
||||
// Event listener for autocomplete place changed
|
||||
autocomplete.addListener('place_changed', () => {
|
||||
const place = autocomplete.getPlace();
|
||||
|
||||
@@ -1,39 +1,15 @@
|
||||
import {
|
||||
useEffect,
|
||||
useState,
|
||||
Fragment
|
||||
// useReducer
|
||||
} from 'react';
|
||||
import { useEffect, useState, Fragment } from 'react';
|
||||
import BorderColorIcon from '@mui/icons-material/BorderColor';
|
||||
import {
|
||||
// Navigate,
|
||||
// useSearchParams,
|
||||
useLocation,
|
||||
useNavigate
|
||||
} from 'react-router-dom';
|
||||
import { useLocation, useNavigate } from 'react-router-dom';
|
||||
import axios from 'axios';
|
||||
import ArrowBackIcon from '@mui/icons-material/ArrowBack';
|
||||
import {
|
||||
// UserOutlined,
|
||||
EnvironmentOutlined,
|
||||
EditTwoTone
|
||||
// DeleteTwoTone
|
||||
} from '@ant-design/icons';
|
||||
// import WomanIcon from '@mui/icons-material/Woman';
|
||||
// import { Link } from 'react-router-dom';
|
||||
// import SoupKitchenIcon from '@mui/icons-material/SoupKitchen';
|
||||
import { EnvironmentOutlined, EditTwoTone } from '@ant-design/icons';
|
||||
import DirectionsCarIcon from '@mui/icons-material/DirectionsCar';
|
||||
import { KeyboardArrowUp, KeyboardArrowDown } from '@mui/icons-material';
|
||||
|
||||
// import { PopupTransition } from 'components/@extended/Transitions';
|
||||
// import { useDispatch } from 'react-redux';
|
||||
// import { openSnackbar } from 'store/reducers/snackbar';
|
||||
// assets
|
||||
import { DeleteFilled, NotificationOutlined } from '@ant-design/icons';
|
||||
var utc = require('dayjs/plugin/utc');
|
||||
// import { groupBy } from "core-js/actual/array/group-by";
|
||||
// import "lodash.chunk";
|
||||
// var chunk = require('lodash.chunk');
|
||||
import {
|
||||
Grid,
|
||||
Typography,
|
||||
@@ -79,13 +55,8 @@ import { PopupTransition } from 'components/@extended/Transitions';
|
||||
import CancelOutlinedIcon from '@mui/icons-material/CancelOutlined';
|
||||
import MainCard from 'components/MainCard';
|
||||
import Loader from 'components/Loader';
|
||||
// import AlertCustomerDelete from 'sections/apps/customer/AlertCustomerDelete';
|
||||
import dayjs from 'dayjs';
|
||||
dayjs.extend(utc);
|
||||
// import { Link as RouterLink } from 'react-router-dom';
|
||||
// import PlayCircleFilled from '@mui/icons-material/PlayCircleFilled';
|
||||
// import SmileFilled from '@mui/icons-material/Mood';
|
||||
// import HeartFilled from '@mui/icons-material/Favorite';
|
||||
|
||||
import { useTheme } from '@mui/material/styles';
|
||||
import useMediaQuery from '@mui/material/useMediaQuery';
|
||||
@@ -181,23 +152,6 @@ const Details = () => {
|
||||
const theme = useTheme();
|
||||
const isMobile = useMediaQuery(theme.breakpoints.down('md'));
|
||||
|
||||
// const fetchorderdetails = async () => {
|
||||
// setLoading(true);
|
||||
// await axios
|
||||
// .get(`${process.env.REACT_APP_URL}/orders/orderbyid/?orderheaderid=${orderheaderid}`)
|
||||
|
||||
// .then((res) => {
|
||||
// console.log(res);
|
||||
|
||||
// setLoading(false);
|
||||
// })
|
||||
// .catch((err) => {
|
||||
// console.log(err);
|
||||
// setLoading(false);
|
||||
// });
|
||||
|
||||
// };
|
||||
|
||||
const fetchorderaddons = async () => {
|
||||
setLoading(true);
|
||||
await axios
|
||||
@@ -249,21 +203,6 @@ const Details = () => {
|
||||
console.log('res');
|
||||
console.log(res);
|
||||
setOrderarr(res.data.Details || []);
|
||||
// let result = res.data.Details.find((res1) => res1.orderheaderid == searchParams.get('id'))
|
||||
// orderheaderid
|
||||
// console.log(result)
|
||||
// setOrderaddons(result.orderaddons);
|
||||
// setVenuetype(result.venuetype)
|
||||
// setOtherinstructions(result.remarks)
|
||||
// console.log("res");
|
||||
// let result = _.chain(res.data.Details)
|
||||
|
||||
// .groupBy("shiftid")
|
||||
|
||||
// .map((value, key) => ({shiftid:key, locationaddress: value[0].locationaddress, roles: value }))
|
||||
// .value()
|
||||
|
||||
// setcategoryarr(result);
|
||||
console.log('categoryarr');
|
||||
setcategoryarr(res.data.Details);
|
||||
console.log(res.data.Details);
|
||||
@@ -305,15 +244,7 @@ const Details = () => {
|
||||
const cancelorder = async () => {
|
||||
await axios
|
||||
.put(`${process.env.REACT_APP_URL2}/orders/cancel`, {
|
||||
// "Orderheaderid": parseInt(orderheaderid),
|
||||
// "Tenantid": parseInt(tenantid),
|
||||
// "Orderstatus": "cancelled",
|
||||
// "Currentdatetime": dayjs().format('YYYY-MM-DD HH:mm:ss'),
|
||||
// "Cod": false,
|
||||
// "Remarks": "",
|
||||
orderheaderid: parseInt(orderheaderid),
|
||||
// "orderdetailid":78,
|
||||
// "shiftid":788,
|
||||
orderstatus: 'cancelled',
|
||||
cancelled: dayjs().format('YYYY-MM-DD HH:mm:ss'),
|
||||
unserviceable: invoiceeligible ? 0 : 1
|
||||
@@ -443,20 +374,10 @@ const Details = () => {
|
||||
fetchorderaddons();
|
||||
fetchorderattires();
|
||||
fetchassignedcount();
|
||||
// fetchuserdetails();
|
||||
console.log(location.state || '');
|
||||
// setOrderid(location.state.orderid || '');
|
||||
// setEventlocation(location.state.eventlocation || '');
|
||||
// setEventlocation(address || []);
|
||||
|
||||
// setOrderdate(dayjs(location.state.orderdate.substring(0, 10)).format('MM/DD/YYYY') || '');
|
||||
// setDuedate(dayjs(location.state.orderdate.substring(0, 10)).format('MM/DD/YYYY') || '')
|
||||
// setEventname(location.state.eventname || '');
|
||||
// setClientname(location.state.tenantname || '')
|
||||
} else {
|
||||
setLoading(false);
|
||||
}
|
||||
// fetchorderdetails();
|
||||
console.log(orderheaderid, tenantid);
|
||||
}, [orderheaderid, tenantid, assignedpendingcount]);
|
||||
|
||||
@@ -522,12 +443,6 @@ const Details = () => {
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
if (res.data.message === 'Successfully created') {
|
||||
// if (orderheaderid && tenantid) {
|
||||
// fetchorderdetails();
|
||||
// fetchorderaddons();
|
||||
// fetchorderattires();
|
||||
// }
|
||||
|
||||
enqueueSnackbar('Roles assigned successfully', {
|
||||
variant: 'success',
|
||||
anchorOrigin: { vertical: 'top', horizontal: 'right' },
|
||||
@@ -631,32 +546,6 @@ const Details = () => {
|
||||
});
|
||||
};
|
||||
|
||||
// const updateorderstatus = async () => {
|
||||
|
||||
// await axios.put(`${process.env.REACT_APP_URL2}/orders/updateorderstatus`,{
|
||||
// "orderheaderid":orderheaderid,
|
||||
// "tenantid":tenantid,
|
||||
// "orderstatus":"processing",
|
||||
// "pending":"",
|
||||
// "processing":dayjs().format('YYYY-MM-DD HH:mm:ss'),
|
||||
// "completed":""
|
||||
// })
|
||||
// .then((res) => {
|
||||
// console.log(res)
|
||||
// fetchorderdetails();
|
||||
// fetchorderaddons();
|
||||
// fetchorderattires();
|
||||
|
||||
// })
|
||||
// .catch((err) => {
|
||||
// console.log(err)
|
||||
// fetchorderdetails();
|
||||
// fetchorderaddons();
|
||||
// fetchorderattires();
|
||||
// })
|
||||
|
||||
// }
|
||||
|
||||
const fetchassignedcount = async () => {
|
||||
// console.log(obj1)
|
||||
await axios
|
||||
|
||||
@@ -55,9 +55,7 @@ import {
|
||||
CalendarOutlined,
|
||||
ClockCircleOutlined,
|
||||
FileTextOutlined,
|
||||
InboxOutlined,
|
||||
LockOutlined,
|
||||
CheckCircleFilled
|
||||
InboxOutlined
|
||||
} from '@ant-design/icons';
|
||||
import { Empty } from 'antd';
|
||||
import { FaUser, FaTruck, FaUsers, FaPaperPlane, FaRoute, FaMoneyBillWave, FaBoxes, FaReceipt } from 'react-icons/fa';
|
||||
@@ -66,7 +64,6 @@ import { MdOutlineCloudUpload } from 'react-icons/md';
|
||||
|
||||
import Loader from 'components/Loader';
|
||||
import CircularLoader from 'components/CircularLoader';
|
||||
import AnimateButton from 'components/@extended/AnimateButton';
|
||||
import { MobileCard, MobileCardList, MobileField, MobileFieldGrid } from 'components/nearle_components/MobileCard';
|
||||
import './OrdersRedesign.css';
|
||||
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import * as React from 'react';
|
||||
import { useState, useEffect, Fragment, useRef } from 'react';
|
||||
import { DashboardOutlined, DeleteFilled, DeleteOutlined, ShoppingCartOutlined } from '@ant-design/icons';
|
||||
import { DeleteFilled, DeleteOutlined, ShoppingCartOutlined } from '@ant-design/icons';
|
||||
import { Empty } from 'antd';
|
||||
import dayjs from 'dayjs';
|
||||
import { useQuery, useMutation, useInfiniteQuery } from '@tanstack/react-query';
|
||||
import HoverSocialCard from 'components/cards/statistics/HoverSocialCard';
|
||||
import { useTheme } from '@mui/material/styles';
|
||||
import { CloseOutlined } from '@ant-design/icons';
|
||||
import { PopupTransition } from 'components/@extended/Transitions';
|
||||
@@ -12,9 +11,7 @@ import CircularLoader from 'components/CircularLoader';
|
||||
import Loader from 'components/Loader';
|
||||
import { KeyboardArrowDownOutlined, KeyboardArrowUpOutlined } from '@mui/icons-material';
|
||||
|
||||
import { PiMapPinLineDuotone } from 'react-icons/pi';
|
||||
import {
|
||||
MdOutlineDateRange,
|
||||
MdPersonOff,
|
||||
MdEventBusy,
|
||||
MdLocalShipping,
|
||||
@@ -28,16 +25,11 @@ import {
|
||||
MdMyLocation,
|
||||
MdGroups,
|
||||
MdPlace,
|
||||
MdStraighten,
|
||||
MdCurrencyRupee,
|
||||
MdInventory2,
|
||||
MdHistoryToggleOff,
|
||||
MdCalendarMonth
|
||||
} from 'react-icons/md';
|
||||
import { VscArchive } from 'react-icons/vsc';
|
||||
import DateFilterDialog from 'components/DateFilterDialog';
|
||||
import DebounceSearchBar from 'components/nearle_components/DebounceSearchBar';
|
||||
import TitleCard from 'components/nearle_components/TitleCard';
|
||||
import MainCard from 'components/MainCard';
|
||||
import { OpenToast } from 'components/third-party/OpenToast';
|
||||
import { OrdersTableSkeleton } from './OrdersTableSkeleton';
|
||||
@@ -46,11 +38,6 @@ import PageHeader from 'components/nearle_components/PageHeader';
|
||||
import StatCard from 'components/nearle_components/StatCard';
|
||||
import AiImage from '../../../assets/images/aiImage.png';
|
||||
import ArrowBackIcon from '@mui/icons-material/ArrowBack';
|
||||
import EnergySavingsLeafIcon from '@mui/icons-material/EnergySavingsLeaf';
|
||||
import DirectionsBikeOutlinedIcon from '@mui/icons-material/DirectionsBikeOutlined';
|
||||
import WarningIcon from '@mui/icons-material/Warning';
|
||||
import BoltIcon from '@mui/icons-material/Bolt';
|
||||
import { ArrowRightAltOutlined } from '@mui/icons-material';
|
||||
import { HiOutlineArrowLeft } from 'react-icons/hi';
|
||||
|
||||
import { IoReload } from 'react-icons/io5';
|
||||
@@ -62,8 +49,6 @@ import {
|
||||
Avatar,
|
||||
Button,
|
||||
Grid,
|
||||
Tabs,
|
||||
Tab,
|
||||
IconButton,
|
||||
Stack,
|
||||
TextField,
|
||||
@@ -89,9 +74,6 @@ import {
|
||||
SpeedDialAction,
|
||||
Badge,
|
||||
Divider,
|
||||
AccordionDetails,
|
||||
AccordionSummary,
|
||||
Accordion,
|
||||
Paper,
|
||||
Box
|
||||
} from '@mui/material';
|
||||
@@ -118,7 +100,6 @@ import { MobileCard, MobileCardList, MobileField, MobileFieldGrid } from 'compon
|
||||
import { useNavigate } from 'react-router';
|
||||
import CSVExport from 'components/third-party/ReactTable';
|
||||
import Dispatch from '../dispatch/Dispatch';
|
||||
// import usePreventReload from 'hooks/usePreventReload';
|
||||
|
||||
// ============================================================================
|
||||
// Design tokens — shared with deliveries / tenants / customers / pricing /
|
||||
@@ -255,8 +236,8 @@ const Orders = () => {
|
||||
const [dispatchPreviewData, setDispatchPreviewData] = useState(null);
|
||||
const [deliverylist, setDeliverylist] = useState([]);
|
||||
const [deliveryDetails, setDeliveryDetails] = useState([]);
|
||||
const [zoneData, setZoneData] = useState(null);
|
||||
const [metaData, setMetaData] = useState(null);
|
||||
const [, setZoneData] = useState(null);
|
||||
const [, setMetaData] = useState(null);
|
||||
const [aiMode] = useState(0);
|
||||
const [csvExportData, setCsvExportData] = useState([]);
|
||||
const [finaldeliveryList, setFinalDeliveryList] = useState([]);
|
||||
|
||||
@@ -1,91 +0,0 @@
|
||||
import React, { useEffect, useRef } from 'react';
|
||||
import { LoadScriptNext, GoogleMap } from '@react-google-maps/api';
|
||||
|
||||
const containerStyle = {
|
||||
width: '100%',
|
||||
height: '90vh'
|
||||
};
|
||||
|
||||
const MapWithRouteGoogle = ({ coordinates, additionalProps, setMapOpen }) => {
|
||||
const mapRef = useRef(null);
|
||||
|
||||
/** Convert coordinates to numbers */
|
||||
const numericCoordinates = coordinates
|
||||
.map((c) => {
|
||||
const lat = Number(c.lat);
|
||||
const lng = Number(c.lng);
|
||||
return isNaN(lat) || isNaN(lng) ? null : { lat, lng };
|
||||
})
|
||||
.filter(Boolean);
|
||||
|
||||
if (numericCoordinates.length < 2) {
|
||||
return <div>No route data available</div>;
|
||||
}
|
||||
|
||||
const start = numericCoordinates[0];
|
||||
const end = numericCoordinates[numericCoordinates.length - 1];
|
||||
|
||||
/** Map loaded callback */
|
||||
const onMapLoad = (map) => {
|
||||
// draw markers
|
||||
new window.google.maps.Marker({
|
||||
position: start,
|
||||
map,
|
||||
label: 'S',
|
||||
title: `Start: ${additionalProps?.riderStart}`
|
||||
});
|
||||
|
||||
new window.google.maps.Marker({
|
||||
position: end,
|
||||
map,
|
||||
label: 'E',
|
||||
title: `End: ${additionalProps?.riderEnd}`
|
||||
});
|
||||
|
||||
// draw rider route (point-to-point)
|
||||
const route = new window.google.maps.Polyline({
|
||||
path: numericCoordinates,
|
||||
geodesic: false,
|
||||
strokeColor: '#1A73E8',
|
||||
strokeOpacity: 1.0,
|
||||
strokeWeight: 4
|
||||
});
|
||||
|
||||
route.setMap(map);
|
||||
|
||||
// auto fit
|
||||
const bounds = new window.google.maps.LatLngBounds();
|
||||
numericCoordinates.forEach((p) => bounds.extend(p));
|
||||
map.fitBounds(bounds);
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<button
|
||||
onClick={() => setMapOpen(false)}
|
||||
style={{
|
||||
position: 'absolute',
|
||||
top: 10,
|
||||
right: 10,
|
||||
zIndex: 999,
|
||||
padding: '6px 12px',
|
||||
background: '#1A73E8',
|
||||
color: 'white',
|
||||
borderRadius: 6,
|
||||
cursor: 'pointer',
|
||||
border: 'none'
|
||||
}}
|
||||
>
|
||||
Close
|
||||
</button>
|
||||
|
||||
<LoadScriptNext googleMapsApiKey={process.env.REACT_APP_GOOGLE_MAPS_API_KEY}>
|
||||
<GoogleMap mapContainerStyle={containerStyle} center={start} zoom={14} onLoad={onMapLoad}>
|
||||
{/* Polyline and markers added via onLoad */}
|
||||
</GoogleMap>
|
||||
</LoadScriptNext>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default MapWithRouteGoogle;
|
||||
@@ -16,8 +16,6 @@ import {
|
||||
Divider,
|
||||
Grid,
|
||||
IconButton,
|
||||
List,
|
||||
ListItem,
|
||||
Paper,
|
||||
Skeleton,
|
||||
Stack,
|
||||
@@ -51,7 +49,6 @@ import {
|
||||
MdCheckCircle,
|
||||
MdCancel,
|
||||
MdList,
|
||||
MdLocalShipping,
|
||||
MdStraighten,
|
||||
MdCurrencyRupee,
|
||||
MdMap,
|
||||
|
||||
@@ -242,23 +242,6 @@ const Requests = () => {
|
||||
// fetchroleslist();
|
||||
}, []);
|
||||
|
||||
// useEffect(() => {
|
||||
|
||||
// if (alertmessage && toast) {
|
||||
// dispatch(
|
||||
// openSnackbar({
|
||||
// open: true,
|
||||
// message: alertmessage,
|
||||
// variant: 'alert',
|
||||
// anchorOrigin: { vertical: 'top', horizontal: 'right' },
|
||||
// alert: {
|
||||
// color: 'error',
|
||||
|
||||
// }
|
||||
// })
|
||||
// )
|
||||
// }
|
||||
// }, [toast])
|
||||
const opentoast = (message) => {
|
||||
enqueueSnackbar(message, {
|
||||
variant: 'error',
|
||||
@@ -486,17 +469,6 @@ const Requests = () => {
|
||||
.then((res) => {
|
||||
console.log('res:', res);
|
||||
if (res.data.message === 'Update successful') {
|
||||
// dispatch(
|
||||
// openSnackbar({
|
||||
// open: true,
|
||||
// message: 'Client Detail Updated Successfully',
|
||||
// variant: 'alert',
|
||||
// anchorOrigin: { vertical: 'top', horizontal: 'right' },
|
||||
// alert: {
|
||||
// color: 'success'
|
||||
// }
|
||||
// })
|
||||
// )
|
||||
enqueueSnackbar('Client Details Updated Successfully', {
|
||||
variant: 'success',
|
||||
anchorOrigin: { vertical: 'top', horizontal: 'right' },
|
||||
@@ -626,63 +598,6 @@ const Requests = () => {
|
||||
}
|
||||
};
|
||||
|
||||
// const rolepriceupdate = async () => {
|
||||
// console.log('submit')
|
||||
// let arr = [];
|
||||
// let objcheck = false;
|
||||
// rolesarr.map((val) => {
|
||||
// if (!val.role || !val.cost) {
|
||||
// objcheck = true;
|
||||
// }
|
||||
// arr.push({
|
||||
// serviceid: 0,
|
||||
// tenantid: currenttenantid,
|
||||
// categoryid: val.categoryid,
|
||||
// subcategoryid: val.subcategoryid,
|
||||
// servicecode: val.servicecode,
|
||||
// servicename: val.servicename,
|
||||
// unitid: val.unitid,
|
||||
// unitname: val.unitname,
|
||||
// serviceamount: parseFloat(val.serviceamount),
|
||||
// discountid: val.discountid,
|
||||
// taxpercent: val.taxpercent,
|
||||
// taxamount: val.taxamount,
|
||||
// servicevalue: parseFloat(val.servicevalue),
|
||||
|
||||
// })
|
||||
// })
|
||||
// console.log(arr)
|
||||
// if (!objcheck) {
|
||||
// try {
|
||||
// setLoading(true)
|
||||
// // await axios.post(`${process.env.REACT_APP_URL2}/clients/createservice`, arr)
|
||||
// await axios.post(`${process.env.REACT_APP_URL2}/tenants/createservice`, arr)
|
||||
|
||||
// // await axios.post(`${process.env.REACT_APP_URL2}/clients/createservice`, arr)
|
||||
// .then((res) => {
|
||||
// console.log('res:', res);
|
||||
// if (res.data.message === "Successful") {
|
||||
|
||||
// enqueueSnackbar('Service created Successfully', { variant: 'success',anchorOrigin: { vertical: 'top', horizontal: 'right' },
|
||||
// autoHideDuration: 3000 })
|
||||
// }
|
||||
// setLoading(false)
|
||||
// }).catch((err) => {
|
||||
// console.log(err)
|
||||
// setLoading(false)
|
||||
// })
|
||||
|
||||
// } catch (err) {
|
||||
// console.log(err);
|
||||
// setLoading(false)
|
||||
// }
|
||||
// } else {
|
||||
|
||||
// enqueueSnackbar('Fill all Details', { variant: 'error',anchorOrigin: { vertical: 'top', horizontal: 'right' },
|
||||
// autoHideDuration: 2000 })
|
||||
// }
|
||||
// }
|
||||
|
||||
const handleRequestSort = (event, property) => {
|
||||
const isAsc = orderBy === property && order === 'asc';
|
||||
setOrder(isAsc ? 'desc' : 'asc');
|
||||
@@ -811,15 +726,9 @@ const Requests = () => {
|
||||
<TextField
|
||||
type="number"
|
||||
value={amount}
|
||||
// placeholder='Mobile Number'
|
||||
// InputProps={{
|
||||
// startAdornment: <InputAdornment position="start">+1</InputAdornment>,
|
||||
// }}
|
||||
sx={{ width: '100%' }}
|
||||
onChange={(e) => setAmount(e.target.value)}
|
||||
/>
|
||||
{/* </Stack>
|
||||
</List> */}
|
||||
</Grid>
|
||||
{/* </Grid>
|
||||
</MainCard>
|
||||
@@ -918,7 +827,7 @@ const Requests = () => {
|
||||
))}
|
||||
|
||||
{!loading &&
|
||||
visibleRows.map((row, index) => {
|
||||
visibleRows.map((row) => {
|
||||
const isItemSelected = isSelected(row.sno);
|
||||
return (
|
||||
<MobileCard
|
||||
@@ -1468,10 +1377,6 @@ const Requests = () => {
|
||||
border: '1px solid #e0e0e0',
|
||||
textIndent: '10px',
|
||||
outline: 'none'
|
||||
// ':hover': {
|
||||
// border: '1px solid #00b0ff !important',
|
||||
// backgroundColor:'blue'
|
||||
// }
|
||||
}}
|
||||
onPlaceSelected={(place) => {
|
||||
setAddress(place.formatted_address);
|
||||
@@ -1813,20 +1718,6 @@ const Requests = () => {
|
||||
const [searchword, setSearchword] = useState('');
|
||||
const [dialogopen, setDialogopen] = useState(false);
|
||||
|
||||
// const [expandopen, setExpandopen] = React.useState('');
|
||||
|
||||
// const setinitial = (val)=>{
|
||||
// if(val){
|
||||
|
||||
// console.log(val);
|
||||
// setClientname(val.tenantname)
|
||||
// }else{
|
||||
// setClientname('')
|
||||
// }
|
||||
// console.log(clientname)
|
||||
|
||||
// }
|
||||
|
||||
useEffect(() => {
|
||||
if (localStorage.getItem('partnerid')) {
|
||||
clientdetailspending(localStorage.getItem('partnerid'));
|
||||
@@ -1834,33 +1725,6 @@ const Requests = () => {
|
||||
}
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
// if (searchword) {
|
||||
// if (tabvalue === 0) {
|
||||
// let arr = clientapproved.filter((val) => {
|
||||
// return (val.tenantname.toLowerCase().includes(searchword.toLowerCase())
|
||||
// || val.primarycontact.toLowerCase().includes(searchword.toLowerCase())
|
||||
// || val.primaryemail.toLowerCase().includes(searchword.toLowerCase())
|
||||
// || val.city.toString().toLowerCase().includes(searchword.toLowerCase())
|
||||
// )
|
||||
// })
|
||||
// console.log(arr)
|
||||
// setRows([...arr])
|
||||
// }
|
||||
// if (tabvalue === 1) {
|
||||
// let arr = clientpending.filter((val) => {
|
||||
// return (val.tenantname.toLowerCase().includes(searchword.toLowerCase())
|
||||
// || val.primarycontact.toLowerCase().includes(searchword.toLowerCase())
|
||||
// || val.primaryemail.toLowerCase().includes(searchword.toLowerCase())
|
||||
// || val.city.toString().toLowerCase().includes(searchword.toLowerCase())
|
||||
// )
|
||||
// })
|
||||
// console.log(arr)
|
||||
// setRows([...arr])
|
||||
// }
|
||||
// }
|
||||
}, [searchword, tabvalue]);
|
||||
|
||||
const handleChangetab = (e, i) => {
|
||||
setTabvalue(i);
|
||||
if (i === 1) setRows(clientapproved);
|
||||
|
||||
@@ -16,23 +16,8 @@ import Loader from 'components/Loader';
|
||||
import Geocode from 'react-geocode';
|
||||
import { enqueueSnackbar } from 'notistack';
|
||||
import { useNavigate } from 'react-router';
|
||||
// import { setLocationType } from 'react-geocode';
|
||||
|
||||
// const avatarImage = require.context('assets/images/users', true);
|
||||
|
||||
// styles & constant
|
||||
// const ITEM_HEIGHT = 48;
|
||||
// const ITEM_PADDING_TOP = 8;
|
||||
// const MenuProps = {
|
||||
// PaperProps: {
|
||||
// style: {
|
||||
// maxHeight: ITEM_HEIGHT * 4.5 + ITEM_PADDING_TOP
|
||||
// }
|
||||
// }
|
||||
// };
|
||||
|
||||
const Createrider = () => {
|
||||
// const [role, setRole] = useState('');
|
||||
const [mobilenumber, setMobilenumber] = useState('');
|
||||
const [emailaddress, setEmailaddress] = useState('');
|
||||
const [city, setCity] = useState('');
|
||||
@@ -162,12 +147,6 @@ const Createrider = () => {
|
||||
const createprofile = async () => {
|
||||
console.log('res', businessname, businessno, mobilenumber, emailaddress, address, city, zipcode);
|
||||
|
||||
// if (!businessname) {
|
||||
// opentoast('Fill Business name')
|
||||
// } else if (!businessno) {
|
||||
// opentoast('Fill Registration No')
|
||||
// }
|
||||
// else
|
||||
if (!firstname) {
|
||||
opentoast('Fill Full name');
|
||||
} else if (!mobilenumber) {
|
||||
|
||||
@@ -164,38 +164,10 @@ const EditRider = () => {
|
||||
});
|
||||
};
|
||||
|
||||
// const fetchpartnerlist = async () => {
|
||||
// setLoading(true);
|
||||
// await axios
|
||||
// .get(`${process.env.REACT_APP_URL}/partners/getpartners`)
|
||||
// .then((res) => {
|
||||
// console.log('fetchpartnerlist', res);
|
||||
// // if (res.data.status) {
|
||||
// let arr = [];
|
||||
// res.data.details.map((val) => {
|
||||
// arr.push({
|
||||
// ...val,
|
||||
// label: val.partnername
|
||||
// });
|
||||
// });
|
||||
// setPartnerlist([...arr]);
|
||||
// console.log(arr);
|
||||
// // }
|
||||
// setLoading(false);
|
||||
// })
|
||||
// .catch((err) => {
|
||||
// console.log(err);
|
||||
// setLoading(false);
|
||||
// });
|
||||
// };
|
||||
// ==============================|| fetchAppLocations ||============================== //
|
||||
const fetchAppLocations = async () => {
|
||||
try {
|
||||
const locationRes = await axios.get(`${process.env.REACT_APP_URL}/partners/getlocations/?userid=${userid}`);
|
||||
// const updatedLocations = [
|
||||
// ...locationRes.data.details,
|
||||
// { locationname: 'All', applocationid: 0 } // Add your new object here
|
||||
// ];
|
||||
console.log('fetchAppLocations', locationRes.data.details);
|
||||
setPartnerlist(locationRes.data.details);
|
||||
} catch (err) {
|
||||
|
||||
@@ -398,7 +398,7 @@ const Riders = () => {
|
||||
}
|
||||
});
|
||||
|
||||
const { data: activeSubsToday, isLoading: activeSubsTodayLoading } = useQuery({
|
||||
useQuery({
|
||||
queryKey: ['activeSubstitutionsToday', appId, selectedDate.format('YYYY-MM-DD')],
|
||||
queryFn: async () => {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user