createOrder

This commit is contained in:
joshikannan
2024-04-01 20:17:03 +05:30
parent 30b05f9524
commit 3a255749bb
12 changed files with 2208 additions and 1430 deletions

View File

@@ -1,3 +1,3 @@
REACT_APP_URL='https://jupiter.nearle.app/live/api/v1'
REACT_APP_URL2=''
REACT_APP_URL2='https://jupiter.nearle.app/live/api/v2'
REACT_APP_STAFF_TOKEN=''

View File

@@ -1,3 +1,3 @@
REACT_APP_URL='https://jupiter.nearle.app/live/api/v1'
REACT_APP_URL2=''
REACT_APP_URL2='https://jupiter.nearle.app/live/api/v2'
REACT_APP_STAFF_TOKEN=''

65
package-lock.json generated
View File

@@ -51,6 +51,7 @@
"react-icons": "^4.12.0",
"react-intl": "^6.4.1",
"react-loading-icons": "^1.1.0",
"react-phone-number-input": "^3.3.10",
"react-redux": "^8.0.5",
"react-router": "^6.10.0",
"react-router-dom": "^6.10.0",
@@ -7161,6 +7162,11 @@
"node": ">=8"
}
},
"node_modules/country-flag-icons": {
"version": "1.5.10",
"resolved": "https://registry.npmjs.org/country-flag-icons/-/country-flag-icons-1.5.10.tgz",
"integrity": "sha512-x3elaK+ZY23W1YtFsNQknRdURzkV7g3Z93AoA7SHZJUEXbVjRsNh4h9Uf09+OjWF/4u8tXeAt37gezGRdwR/2g=="
},
"node_modules/create-ecdh": {
"version": "4.0.4",
"resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz",
@@ -10649,6 +10655,14 @@
"resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz",
"integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew=="
},
"node_modules/input-format": {
"version": "0.3.10",
"resolved": "https://registry.npmjs.org/input-format/-/input-format-0.3.10.tgz",
"integrity": "sha512-5cFv/kOZD7Ch0viprVkuYPDkAU7HBZYBx8QrIpQ6yXUWbAQ0+RQ8IIojDJOf/RO6FDJLL099HDSK2KoVZ2zevg==",
"dependencies": {
"prop-types": "^15.8.1"
}
},
"node_modules/internal-slot": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz",
@@ -13464,6 +13478,11 @@
"node": ">= 0.8.0"
}
},
"node_modules/libphonenumber-js": {
"version": "1.10.59",
"resolved": "https://registry.npmjs.org/libphonenumber-js/-/libphonenumber-js-1.10.59.tgz",
"integrity": "sha512-HeTsOrDF/hWhEiKqZVwg9Cqlep5x2T+IYDENvT2VRj3iX8JQ7Y+omENv+AIn0vC8m6GYhivfCed5Cgfw27r5SA=="
},
"node_modules/lilconfig": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.0.6.tgz",
@@ -16933,6 +16952,22 @@
"node": ">= 12.0.0"
}
},
"node_modules/react-phone-number-input": {
"version": "3.3.10",
"resolved": "https://registry.npmjs.org/react-phone-number-input/-/react-phone-number-input-3.3.10.tgz",
"integrity": "sha512-onv6ETMejyA4Wi0/6Ay00FcSokHIJcowLUcwdizpALSpeXPFqbyrjHQSL8+pgkxIIruRxr5nyIAB8LT+Sa/Vlg==",
"dependencies": {
"classnames": "^2.3.1",
"country-flag-icons": "^1.5.4",
"input-format": "^0.3.10",
"libphonenumber-js": "^1.10.59",
"prop-types": "^15.8.1"
},
"peerDependencies": {
"react": ">=16.8",
"react-dom": ">=16.8"
}
},
"node_modules/react-redux": {
"version": "8.0.5",
"resolved": "https://registry.npmjs.org/react-redux/-/react-redux-8.0.5.tgz",
@@ -25456,6 +25491,11 @@
"yaml": "^1.7.2"
}
},
"country-flag-icons": {
"version": "1.5.10",
"resolved": "https://registry.npmjs.org/country-flag-icons/-/country-flag-icons-1.5.10.tgz",
"integrity": "sha512-x3elaK+ZY23W1YtFsNQknRdURzkV7g3Z93AoA7SHZJUEXbVjRsNh4h9Uf09+OjWF/4u8tXeAt37gezGRdwR/2g=="
},
"create-ecdh": {
"version": "4.0.4",
"resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz",
@@ -27969,6 +28009,14 @@
"resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz",
"integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew=="
},
"input-format": {
"version": "0.3.10",
"resolved": "https://registry.npmjs.org/input-format/-/input-format-0.3.10.tgz",
"integrity": "sha512-5cFv/kOZD7Ch0viprVkuYPDkAU7HBZYBx8QrIpQ6yXUWbAQ0+RQ8IIojDJOf/RO6FDJLL099HDSK2KoVZ2zevg==",
"requires": {
"prop-types": "^15.8.1"
}
},
"internal-slot": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz",
@@ -29998,6 +30046,11 @@
"type-check": "~0.4.0"
}
},
"libphonenumber-js": {
"version": "1.10.59",
"resolved": "https://registry.npmjs.org/libphonenumber-js/-/libphonenumber-js-1.10.59.tgz",
"integrity": "sha512-HeTsOrDF/hWhEiKqZVwg9Cqlep5x2T+IYDENvT2VRj3iX8JQ7Y+omENv+AIn0vC8m6GYhivfCed5Cgfw27r5SA=="
},
"lilconfig": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.0.6.tgz",
@@ -32302,6 +32355,18 @@
"resolved": "https://registry.npmjs.org/react-loading-icons/-/react-loading-icons-1.1.0.tgz",
"integrity": "sha512-Y9eZ6HAufmUd8DIQd6rFrx5Bt/oDlTM9Nsjvf8YpajTa3dI8cLNU8jUN5z7KTANU+Yd6/KJuBjxVlrU2dMw33g=="
},
"react-phone-number-input": {
"version": "3.3.10",
"resolved": "https://registry.npmjs.org/react-phone-number-input/-/react-phone-number-input-3.3.10.tgz",
"integrity": "sha512-onv6ETMejyA4Wi0/6Ay00FcSokHIJcowLUcwdizpALSpeXPFqbyrjHQSL8+pgkxIIruRxr5nyIAB8LT+Sa/Vlg==",
"requires": {
"classnames": "^2.3.1",
"country-flag-icons": "^1.5.4",
"input-format": "^0.3.10",
"libphonenumber-js": "^1.10.59",
"prop-types": "^15.8.1"
}
},
"react-redux": {
"version": "8.0.5",
"resolved": "https://registry.npmjs.org/react-redux/-/react-redux-8.0.5.tgz",

View File

@@ -46,6 +46,7 @@
"react-icons": "^4.12.0",
"react-intl": "^6.4.1",
"react-loading-icons": "^1.1.0",
"react-phone-number-input": "^3.3.10",
"react-redux": "^8.0.5",
"react-router": "^6.10.0",
"react-router-dom": "^6.10.0",

View File

@@ -13,33 +13,34 @@ import { useEffect } from 'react';
// ==============================|| APP - THEME, ROUTER, LOCAL ||============================== //
const App = () =>{
let navigate=useNavigate()
const App = () => {
let navigate = useNavigate();
useEffect(()=>{
if (!localStorage.getItem("authname")) {
navigate('/login')
}
},[])
useEffect(() => {
if (!localStorage.getItem('authname')) {
navigate('/login');
}
}, []);
return <>
<ThemeCustomization>
{/* <RTLLayout> */}
<Locales>
<ScrollTop>
{/* <AuthProvider> */}
<>
<Notistack>
<Routes />
<Snackbar />
</Notistack>
</>
{/* </AuthProvider> */}
</ScrollTop>
</Locales>
{/* </RTLLayout> */}
</ThemeCustomization>
</>
}
return (
<>
<ThemeCustomization>
{/* <RTLLayout> */}
<Locales>
<ScrollTop>
{/* <AuthProvider> */}
<>
<Notistack>
<Routes />
<Snackbar />
</Notistack>
</>
{/* </AuthProvider> */}
</ScrollTop>
</Locales>
{/* </RTLLayout> */}
</ThemeCustomization>
</>
);
};
export default App;

View File

@@ -73,7 +73,7 @@ const HeaderContent = () => {
{matchesXs && <Box sx={{ width: '100%', ml: 1 }} />}
<Stack direction={'row'} spacing={2}>
<Box sx={{ flexShrink: 0, ml: 0.75 }}>
<Tooltip title="Quick Menu">
<Tooltip title="Create Menu" placement="left">
<IconButton
// color="secondary"
// variant="light"

View File

@@ -22,7 +22,9 @@ import { openDrawer } from 'store/reducers/menu';
const MainLayout = () => {
const theme = useTheme();
const matchDownXL = useMediaQuery(theme.breakpoints.down('xl'));
// const matchDownXL = useMediaQuery(theme.breakpoints.down('xl'));
const matchDownXL = useMediaQuery(`(max-width: 1440px)`);
const downLG = useMediaQuery(theme.breakpoints.down('lg'));
const { container, miniDrawer, menuOrientation } = useConfig();

View File

@@ -52,10 +52,10 @@ export const fetchAllTenants = async ({ queryKey }) => {
let url = '';
if (search) {
// url = `https://jupiter.nearle.app/live/api/v1/tenants/search/?keyword=${search}`;
// url = `${process.env.REACT_APP_URL}/tenants/search/?keyword=${search}`;
url = `${process.env.REACT_APP_URL}/tenants/search/?keyword=${search}`;
} else {
// url = `https://jupiter.nearle.app/live/api/v1/tenants/getalltenants?pageno=${pageno}&pagesize=${size}`;
// url = `${process.env.REACT_APP_URL}/tenants/getalltenants?pageno=${pageno}&pagesize=${size}`;
url = `${process.env.REACT_APP_URL}/tenants/getalltenants?pageno=${pageno}&pagesize=${size}`;
}
const response = await axios.get(url);
@@ -139,9 +139,9 @@ export const fetchorderdetails = async ({ queryKey }) => {
let status = tabValue === 0 ? 'delivered' : tabValue === 1 ? 'pending' : 'cancelled';
const response = await axios.get(
// appId == -1
// ? `https://jupiter.nearle.app/live/api/v1/orders/getorders/?fromdate=${startdate}&todate=${enddate}`
// : `https://jupiter.nearle.app/live/api/v1/orders/getorders/?fromdate=${startdate}&todate=${enddate}&applocationid=${appId}`
`https://jupiter.nearle.app/live/api/v1/deliveries/getdeliveries/?tenantid=${tenid}&fromdate=${startdate}&todate=${enddate}`
// ? `${process.env.REACT_APP_URL}/orders/getorders/?fromdate=${startdate}&todate=${enddate}`
// : `${process.env.REACT_APP_URL}/orders/getorders/?fromdate=${startdate}&todate=${enddate}&applocationid=${appId}`
`${process.env.REACT_APP_URL}/deliveries/getdeliveries/?tenantid=${tenid}&fromdate=${startdate}&todate=${enddate}`
);
console.log('fetchorderdetails', response.data.details);
@@ -151,7 +151,7 @@ export const fetchorderdetails = async ({ queryKey }) => {
export const fetchCount = async ({ queryKey }) => {
console.log('queryKey of fetchCount', queryKey);
const [startdate, enddate] = queryKey;
const response = await axios.get(`https://jupiter.nearle.app/live/api/v1/orders/getorders/?fromdate=${startdate}&todate=${enddate}`);
const response = await axios.get(`${process.env.REACT_APP_URL}/orders/getorders/?fromdate=${startdate}&todate=${enddate}`);
const calculateOrderCounts = () => {
let deliveredCount = 0;
let pendingCount = 0;

View File

@@ -1,318 +1,309 @@
import { useState, useEffect } from 'react'
import { useState, useEffect } from 'react';
// import { useSelector } from 'react-redux';
// import AuthWrapper from 'sections/auth/AuthWrapper';
import {
Box, Grid, Card,
CardContent,
// CardHeader,
Stack,
// Divider,
// InputLabel,
// OutlinedInput,
TextField,
Button,
Typography,
CardHeader,
Container,
Link
} from '@mui/material'
Box,
Grid,
Card,
CardContent,
// CardHeader,
Stack,
// Divider,
// InputLabel,
// OutlinedInput,
TextField,
Button,
Typography,
CardHeader,
Container,
Link
} from '@mui/material';
import { useTheme } from '@mui/material/styles';
import AnimateButton from 'components/@extended/AnimateButton';
import logo from 'assets/images/logo-nearle1.png';
import logo from 'assets/images/logo-nearle1.png'
import axios from 'axios'
import { useNavigate } from 'react-router-dom'
import axios from 'axios';
import { useNavigate } from 'react-router-dom';
// import { openSnackbar } from 'store/reducers/snackbar';
// import { useDispatch } from 'react-redux';
import Loader from 'components/Loader';
import { enqueueSnackbar } from 'notistack';
const Login = () => {
const theme = useTheme();
const [username, setUsername] = useState('');
const [password, setPassword] = useState('');
const [alertmessage, setAlertmessage] = useState('');
const [checkusername, setCheckusername] = useState(false);
// const [toast, setToast] = useState(false);
const [loading, setLoading] = useState(false);
let navigate = useNavigate();
// let dispatch = useDispatch();
const [submitting, setSubmitting] = useState(false)
// let loginuserid = useSelector((state)=>state.logininfo);
const theme = useTheme();
const [username, setUsername] = useState('');
const [password, setPassword] = useState('');
const [alertmessage, setAlertmessage] = useState('');
const [checkusername, setCheckusername] = useState(false);
// const [toast, setToast] = useState(false);
const [loading, setLoading] = useState(false);
let navigate = useNavigate();
// let dispatch = useDispatch();
const [submitting, setSubmitting] = useState(false);
// let loginuserid = useSelector((state)=>state.logininfo);
// useEffect(() => {
// useEffect(() => {
// if (alertmessage) {
// dispatch(
// openSnackbar({
// open: true,
// message: alertmessage,
// variant: 'alert',
// anchorOrigin: { vertical: 'top', horizontal: 'right' },
// alert: {
// // variant:'info',
// color: 'error',
// if (alertmessage) {
// dispatch(
// openSnackbar({
// open: true,
// message: alertmessage,
// variant: 'alert',
// anchorOrigin: { vertical: 'top', horizontal: 'right' },
// alert: {
// // variant:'info',
// color: 'error',
// }
// })
// )
// }
// }, [toast])
// }
// })
// )
// }
// }, [toast])
useEffect(() => {
if (localStorage.getItem("authname")
// || localStorage.getItem("appuserid")
) {
navigate('/orders')
}
// console.log(alertmessage)
}, [])
const usernamecheck = async (e) => {
e.preventDefault();
setUsername(e.target.value)
if (e.target.value) {
try {
// await axios.post(`${process.env.REACT_APP_URL}/auth/login`, {
// "authname": e.target.value
// })
await axios.post(`${process.env.REACT_APP_URL}/users/login`, {
"authname": e.target.value,
"configid": 1,
"password": 'admin'
})
.then((res) => {
console.log(res.data)
if (res.data.details.authname === e.target.value) {
setUsername(e.target.value);
setCheckusername(false);
} else {
setCheckusername(true);
}
// if (res.data.authname === e.target.value) {
// setUsername(e.target.value);
// setCheckusername(false);
// }
}).catch((err) => {
// if (err.response.data.message === 'No user found') {
setCheckusername(true);
// }
})
} catch (err) {
console.log(err)
}
}
useEffect(() => {
if (
localStorage.getItem('authname')
// || localStorage.getItem("appuserid")
) {
navigate('/orders');
}
const loginsend = async () => {
// e.preventDefault();
setLoading(true)
// console.log(alertmessage)
}, []);
if (password && username) {
if (password == 'admin') {
setSubmitting(true)
try {
await axios.post(`${process.env.REACT_APP_URL}/users/login`, {
"authname": username,
"configid": 1,
"password": password
}).then((res) => {
console.log(res.data)
if (res.data.details.authname === username) {
// setAlertmessage('login Successfull');
setLoading(false)
// dispatch(
// openSnackbar({
// open: true,
// message: 'login Successfull',
// variant: 'alert',
// anchorOrigin: { vertical: 'top', horizontal: 'right' },
// alert: {
// color: 'success'
// }
// })
// )
enqueueSnackbar('login Successfull', {
variant: 'success', anchorOrigin: { vertical: 'top', horizontal: 'right' },
autoHideDuration: 3000
})
setUsername('');
setPassword('');
localStorage.setItem("firstname", res.data.details.tenantname);
localStorage.setItem("authname", res.data.details.authname);
localStorage.setItem("appuserid", res.data.details.userid);
localStorage.setItem("roleid", res.data.details.roleid);
localStorage.setItem("tenantid", res.data.details.tenantid);
localStorage.setItem("applocationid", res.data.details.applocationid);
localStorage.setItem("fullname", res.data.details.fullname);
navigate('/orders');
setSubmitting(false)
}else{
opentoast('Login Error')
setLoading(false)
setSubmitting(false)
}
}).catch((err) => {
console.log(err);
// setAlertmessage('Invalid Data');
// if(err.message == 'Network Error'){
opentoast(err.message)
// }else{
// opentoast('Invalid Data');
// }
setLoading(false)
setSubmitting(false)
console.log(err.message)
})
} catch (err) {
console.log(err)
setLoading(false)
setSubmitting(false)
}
}else{
opentoast('Password is Incorrect');
setLoading(false)
const usernamecheck = async (e) => {
e.preventDefault();
setUsername(e.target.value);
if (e.target.value) {
try {
// await axios.post(`${process.env.REACT_APP_URL}/auth/login`, {
// "authname": e.target.value
// })
await axios
// .post(`${process.env.REACT_APP_URL}/users/login`, {
.post(`${process.env.REACT_APP_URL}/users/tenant/login`, {
authname: e.target.value,
configid: 1,
password: 'admin'
})
.then((res) => {
console.log(res.data);
if (res.data.details.authname === e.target.value) {
setUsername(e.target.value);
setCheckusername(false);
} else {
setCheckusername(true);
}
} else {
// let el2 = document.getElementById('toastid');
// el2.classList.add('d-block');
// el2.classList.remove('d-none');
setAlertmessage('Fill All required fields');
opentoast('Fill All required fields');
setLoading(false)
}
// if (res.data.authname === e.target.value) {
// setUsername(e.target.value);
// setCheckusername(false);
// }
})
.catch((err) => {
// if (err.response.data.message === 'No user found') {
setCheckusername(true);
// }
});
} catch (err) {
console.log(err);
}
}
};
// const handleClose = () => {
const loginsend = async () => {
// e.preventDefault();
setLoading(true);
if (password && username) {
if (password == 'admin') {
setSubmitting(true);
try {
await axios
// .post(`${process.env.REACT_APP_URL}/users/login`, {
.post(`${process.env.REACT_APP_URL}/users/tenant/login`, {
authname: username,
configid: 1,
password: password
})
.then((res) => {
console.log(res.data);
if (res.data.details.authname === username) {
// setAlertmessage('login Successfull');
setLoading(false);
// dispatch(
// openSnackbar({
// open: true,
// message: 'login Successfull',
// variant: 'alert',
// anchorOrigin: { vertical: 'top', horizontal: 'right' },
// alert: {
// color: 'success'
// }
// })
// )
enqueueSnackbar('login Successfull', {
variant: 'success',
anchorOrigin: { vertical: 'top', horizontal: 'right' },
autoHideDuration: 1000
});
setUsername('');
setPassword('');
localStorage.setItem('firstname', res.data.details.tenantname);
localStorage.setItem('authname', res.data.details.authname);
localStorage.setItem('appuserid', res.data.details.userid);
localStorage.setItem('roleid', res.data.details.roleid);
localStorage.setItem('tenantid', res.data.details.tenantid);
localStorage.setItem('applocationid', res.data.details.applocationid);
localStorage.setItem('fullname', res.data.details.fullname);
localStorage.setItem('configid', res.data.details.configid);
localStorage.setItem('locationid', res.data.details.locationid);
localStorage.setItem('moduleid', res.data.details.moduleid);
localStorage.setItem('userid', res.data.details.userid);
navigate('/orders');
setSubmitting(false);
} else {
opentoast('Login Error');
setLoading(false);
setSubmitting(false);
}
})
.catch((err) => {
console.log(err);
// setAlertmessage('Invalid Data');
// if(err.message == 'Network Error'){
opentoast(err.message);
// }else{
// opentoast('Invalid Data');
// }
setLoading(false);
setSubmitting(false);
console.log(err.message);
});
} catch (err) {
console.log(err);
setLoading(false);
setSubmitting(false);
}
} else {
opentoast('Password is Incorrect');
setLoading(false);
}
} else {
// let el2 = document.getElementById('toastid');
// el2.classList.add('d-block');
// el2.classList.remove('d-none');
setAlertmessage('Fill All required fields');
opentoast('Fill All required fields');
setLoading(false);
}
};
// const handleClose = () => {
// setToast(false)
// }
const opentoast = (message) => {
// setToast(true)
// setTimeout(() => {
// // handleClose();
// setToast(false)
// }
const opentoast = (message) => {
// setToast(true)
// }, 2000);
enqueueSnackbar(message, {
variant: 'error',
anchorOrigin: { vertical: 'top', horizontal: 'right' },
autoHideDuration: 2000
});
};
// setTimeout(() => {
// // handleClose();
// setToast(false)
// }, 2000);
enqueueSnackbar(message, {
variant: 'error', anchorOrigin: { vertical: 'top', horizontal: 'right' },
autoHideDuration: 2000
})
}
return <>
{/* <AuthWrapper> */}
<Box sx={{ minHeight: '100vh' }}>
{(loading) &&
<Loader />
}
{/* <AuthBackground /> */}
return (
<>
{/* <AuthWrapper> */}
<Box sx={{ minHeight: '100vh' }}>
{loading && <Loader />}
{/* <AuthBackground /> */}
<Grid
container
direction="column"
justifyContent="flex-start"
sx={{
minHeight: '100vh'
}}
>
<Grid
item
xs={12}
// sx={{ ml: 3, mt: 3 }}
sx={{ ml: 3, mt: 1 }}
>
<img src={logo} alt="legendary" width="200px" />
</Grid>
<Grid item xs={12}>
<Grid
container
direction="column"
justifyContent="flex-start"
sx={{
minHeight: '100vh'
}}
item
xs={12}
container
justifyContent="center"
alignItems="center"
// sx={{ minHeight: { xs: 'calc(100vh - 210px)', sm: 'calc(100vh - 134px)', md: 'calc(100vh - 112px)' } }}
sx={{ minHeight: { xs: 'calc(100vh - 210px)', sm: 'calc(100vh - 134px)', md: 'calc(100vh - 140px)' } }}
>
<Grid item xs={12}
// sx={{ ml: 3, mt: 3 }}
sx={{ ml: 3, mt: 1 }}
<Grid item>
{/* <AuthCard>{children}</AuthCard> */}
<Box
sx={{
maxWidth: { xs: 400, lg: 475 },
margin: { xs: 2.5, md: 3 },
'& > *': {
flexGrow: 1,
flexBasis: '50%'
}
}}
>
<Card
sx={{
position: 'relative',
border: '1px solid',
borderRadius: 1,
borderColor: theme.palette.divider,
boxShadow: 'inherit',
p: 2,
width: '100%'
}}
>
{/* <CardHeader title={<Typography variant="h4">Login</Typography>} /> */}
{/* <Divider sx={{ borderStyle: 'dashed' }} /> */}
{/* <h1>eee</h1> */}
{/* <CardHeader> */}
<img src={logo} alt='legendary'
width='200px'
/>
</Grid>
<Grid item xs={12}>
<Grid
item
xs={12}
container
justifyContent="center"
alignItems="center"
// sx={{ minHeight: { xs: 'calc(100vh - 210px)', sm: 'calc(100vh - 134px)', md: 'calc(100vh - 112px)' } }}
sx={{ minHeight: { xs: 'calc(100vh - 210px)', sm: 'calc(100vh - 134px)', md: 'calc(100vh - 140px)' } }}
<Grid container spacing={3}>
<Grid item xs={12}>
<Stack direction="row" justifyContent="flex-start" alignItems="baseline" sx={{ mb: { xs: -0.5, sm: 0.5 } }}>
<CardHeader title={<Typography variant="h3">Login</Typography>} />
</Stack>
</Grid>
>
<Grid item>
{/* <AuthCard>{children}</AuthCard> */}
<Box sx={{
maxWidth: { xs: 400, lg: 475 },
margin: { xs: 2.5, md: 3 },
'& > *': {
flexGrow: 1,
flexBasis: '50%'
}
}} >
<Card sx={{
position: 'relative',
border: '1px solid',
borderRadius: 1,
borderColor: theme.palette.divider,
boxShadow: 'inherit',
p: 2,
width: '100%'
}}>
{/* <CardHeader title={<Typography variant="h4">Login</Typography>} /> */}
{/* <Divider sx={{ borderStyle: 'dashed' }} /> */}
{/* <h1>eee</h1> */}
{/* <CardHeader> */}
<Grid container
spacing={3}
>
<Grid item xs={12}>
<Stack direction="row" justifyContent="flex-start" alignItems="baseline"
sx={{ mb: { xs: -0.5, sm: 0.5 } }}
>
<CardHeader
title={<Typography variant="h3">Login</Typography>}
/>
</Stack>
</Grid>
{/* <Grid item xs={12}>
{/* <Grid item xs={12}>
<AuthLogin isDemo={isLoggedIn} />
</Grid> */}
</Grid>
<CardContent>
<form noValidate
onSubmit={(e) => { e.preventDefault() }}
>
<Grid container
spacing={2}
>
<Grid item xs={12}>
{/* <Stack spacing={1}> */}
{/* <InputLabel htmlFor="email-login">Email Address</InputLabel>
</Grid>
<CardContent>
<form
noValidate
onSubmit={(e) => {
e.preventDefault();
}}
>
<Grid container spacing={2}>
<Grid item xs={12}>
{/* <Stack spacing={1}> */}
{/* <InputLabel htmlFor="email-login">Email Address</InputLabel>
<OutlinedInput
id="email-login"
type="email"
@@ -324,7 +315,7 @@ const Login = () => {
fullWidth
id="username1"
label="E-mail Address"
variant="outlined"
variant="outlined"
autoComplete='email'
required
onChange={usernamecheck}
@@ -336,26 +327,34 @@ const Login = () => {
{errors.email}
</FormHelperText>
)} */}
<TextField
margin="normal"
fullWidth
id="username1" label="E-mail Address" variant="outlined" autoComplete='email' required
onChange={usernamecheck}
error={checkusername}
/>
<TextField
margin="normal"
fullWidth
required
autoComplete="current-password"
onChange={(e) => setPassword(e.target.value)}
type='password' id="password1" label="Password" variant="outlined" />
{/* </Stack> */}
</Grid>
<Grid item xs={12}>
{/* <Stack spacing={0}> */}
{/* <InputLabel htmlFor="password-login">Password</InputLabel> */}
{/* <OutlinedInput
<TextField
margin="normal"
fullWidth
id="username1"
label="E-mail Address"
variant="outlined"
autoComplete="email"
required
onChange={usernamecheck}
error={checkusername}
/>
<TextField
margin="normal"
fullWidth
required
autoComplete="current-password"
onChange={(e) => setPassword(e.target.value)}
type="password"
id="password1"
label="Password"
variant="outlined"
/>
{/* </Stack> */}
</Grid>
<Grid item xs={12}>
{/* <Stack spacing={0}> */}
{/* <InputLabel htmlFor="password-login">Password</InputLabel> */}
{/* <OutlinedInput
fullWidth
// error={Boolean(touched.password && errors.password)}
// id="-password-login"
@@ -385,20 +384,19 @@ const Login = () => {
onChange={(e) => setPassword(e.target.value)}
type='password' id="password1"
/> */}
{/* {touched.password && errors.password && (
{/* {touched.password && errors.password && (
<FormHelperText error id="standard-weight-helper-text-password-login">
{errors.password}
</FormHelperText>
)} */}
{/* </Stack> */}
<Link href="#" variant="h6" >
Forgot password?
</Link>
</Grid>
{/* </Stack> */}
<Link href="#" variant="h6">
Forgot password?
</Link>
</Grid>
{/* <Grid item xs={12} sx={{ mt: -1 }}>
{/* <Grid item xs={12} sx={{ mt: -1 }}>
<Stack direction="row" justifyContent="space-between" alignItems="center" spacing={2}>
<FormControlLabel
control={
@@ -417,92 +415,96 @@ const Login = () => {
</Link>
</Stack>
</Grid> */}
{/* {errors.submit && (
{/* {errors.submit && (
<Grid item xs={12}>
<FormHelperText error>{errors.submit}</FormHelperText>
</Grid>
)} */}
<Grid item xs={12}>
{/* <AnimateButton> */}
<AnimateButton>
<Button
disabled={submitting}
onClick={() => {
loginsend()
// navigate('/dashboard')
}}
fullWidth size="large" type="submit" variant="contained" color="primary">
Login
</Button>
</AnimateButton>
{/* </AnimateButton> */}
</Grid>
</Grid>
{/* </Grid> */}
</form>
</CardContent>
{/* </CardHeader> */}
</Card>
</Box>
<Grid item xs={12}>
{/* <AnimateButton> */}
<AnimateButton>
<Button
disabled={submitting}
onClick={() => {
loginsend();
// navigate('/dashboard')
}}
fullWidth
size="large"
type="submit"
variant="contained"
color="primary"
>
Login
</Button>
</AnimateButton>
{/* </AnimateButton> */}
</Grid>
</Grid>
</Grid>
</Grid>
<Grid item xs={12}
// sx={{ m: 3, mt: 1 }}
sx={{ mb: 1 }}
{/* </Grid> */}
</form>
</CardContent>
{/* </CardHeader> */}
</Card>
</Box>
</Grid>
</Grid>
</Grid>
<Grid
item
xs={12}
// sx={{ m: 3, mt: 1 }}
sx={{ mb: 1 }}
>
{/* <AuthFooter /> */}
<Container maxWidth="xl">
<Stack
direction={{ sx: 'column', md: 'row' }}
justifyContent={{ sx: 'center', md: 'space-between' }}
spacing={2}
// textAlign={{ sx: 'center', md: 'inherit' }}
alignItems={{ sx: 'center', md: 'inherit' }}
width="100%"
>
<Stack direction="row" justifyContent="center" spacing={1}>
<Typography variant="subtitle2" color="secondary" component="span" sx={{ display: 'flex' }}>
&copy; All rights reserved
{/* <Typography variant="subtitle2" href="#mantis-privacy" target="_blank" underline="hover" sx={{ml:1}}>Privacy Policy</Typography> */}
</Typography>
</Stack>
<Stack
direction={{ sx: 'column', md: 'row' }}
spacing={{ sx: 1, md: 3 }}
textAlign={{ sx: 'center', md: 'inherit' }}
alignItems={{ sx: 'center', md: 'inherit' }}
// width='100%'
>
{/* <AuthFooter /> */}
<Container maxWidth="xl">
<Stack
direction={{ sx: 'column', md: 'row' }}
justifyContent={{ sx: 'center', md: 'space-between' }}
spacing={2}
// textAlign={{ sx: 'center', md: 'inherit' }}
alignItems={{ sx: 'center', md: 'inherit' }}
width='100%'
>
<Stack direction='row' justifyContent='center' spacing={1}>
<Typography variant="subtitle2" color="secondary" component="span" sx={{ display: 'flex' }}>&copy; All rights reserved
{/* <Typography variant="subtitle2" href="#mantis-privacy" target="_blank" underline="hover" sx={{ml:1}}>Privacy Policy</Typography> */}
</Typography>
</Stack>
<Stack direction={{ sx: 'column', md: 'row' }} spacing={{ sx: 1, md: 3 }}
textAlign={{ sx: 'center', md: 'inherit' }}
alignItems={{ sx: 'center', md: 'inherit' }}
// width='100%'
>
<Typography
variant="subtitle2"
color="secondary"
component={Link}
href="#"
// target="_blank"
underline="hover"
textAlign='center'
>
Terms and Conditions
</Typography>
<Typography
variant="subtitle2"
color="secondary"
component={Link}
href="#"
// target="_blank"
underline="hover"
textAlign='center'
>
Privacy Policy
</Typography>
{/* <Typography
<Typography
variant="subtitle2"
color="secondary"
component={Link}
href="#"
// target="_blank"
underline="hover"
textAlign="center"
>
Terms and Conditions
</Typography>
<Typography
variant="subtitle2"
color="secondary"
component={Link}
href="#"
// target="_blank"
underline="hover"
textAlign="center"
>
Privacy Policy
</Typography>
{/* <Typography
variant="subtitle2"
color="secondary"
component={Link}
@@ -513,14 +515,15 @@ const Login = () => {
>
CA Privacy Notice
</Typography> */}
</Stack>
</Stack>
</Container>
</Grid>
</Grid>
</Box >
{/* </AuthWrapper> */}
</Stack>
</Stack>
</Container>
</Grid>
</Grid>
</Box>
{/* </AuthWrapper> */}
</>
}
);
};
export default Login;
export default Login;

File diff suppressed because it is too large Load Diff

View File

@@ -406,8 +406,8 @@ const Orders = () => {
{loading && (
<>
<TableBody>
{[0, 1, 2, 3, 4, 5, 6, 7, 8, 9].map((item) => (
<TableRow key={item}>
{[0, 1, 2, 3, 4, 5, 6, 7, 8, 9].map((item, index) => (
<TableRow key={index}>
<TableCell>
<Skeleton animation="wave" />
</TableCell>
@@ -628,12 +628,12 @@ const Orders = () => {
<Grid item sx={{ width: '100%', m: 1 }}>
<MainCard sx={{
opacity: ((val5.shiftstatus == 1) || (val5.status == 1)) ? '0.6' : ''
}}>
<Stack direction={{ xs: 'column', md: 'row' }} spacing={2} sx={{ p: 2 }} alignItems={{ md: 'center' }}>
<Typography>Shift {k + 1}</Typography>
<Typography color="secondary" >
<EnvironmentOutlined /> {''}{val5.locationaddress}
</Typography>
@@ -643,13 +643,13 @@ const Orders = () => {
}
</Grid>
</Stack>
<TableContainer >
<Table sx={{ width: '100%' }} >
<TableHead >
<TableRow
>
<TableCell></TableCell>
<TableCell>#</TableCell>
@@ -662,18 +662,18 @@ const Orders = () => {
<TableCell align="right">Price</TableCell>
<TableCell align="right">Amount</TableCell>
<TableCell align="left">Assigned Roles</TableCell>
</TableRow>
</TableHead>
<TableBody>
{((val5.orderdetails) ? val5.orderdetails : []).map((val, i) => {
return <>
<TableRow key={i}
sx={{
opacity: (val.status == 0) ? '' : '0.6'
}}
@@ -683,7 +683,7 @@ const Orders = () => {
<TableCell>
{val.productname}
</TableCell>
<TableCell>
<Stack direction="column">
<Typography variant="body1">
@@ -710,7 +710,7 @@ const Orders = () => {
</TableCell>
<TableCell align="center">
<Chip label={val.orderqty} color="primary" variant="light" size="small" />
</TableCell>
<TableCell align="center">
<Chip label={val.supplyqty} color={(val.supplyqty > 0) ? "warning" : "error"} variant="light" size="small" />
@@ -718,7 +718,7 @@ const Orders = () => {
<TableCell align="right">${val.price}</TableCell>
<TableCell align="right">${val.landingamount}</TableCell>
<TableCell >
<Tooltip title='Assigned staffs'>
<Button sx={{ minWidth: '10px !important' }}
onClick={(e) => {
@@ -732,28 +732,28 @@ const Orders = () => {
</Button>
</Tooltip>
</TableCell>
</TableRow>
</>
})}
</TableBody>
</Table>
</TableContainer >
</MainCard>
</Grid>
<Dialog maxWidth={false} fullWidth={true}
open={dialogopen} onClose={dialogclose}
scroll={'paper'}
TransitionComponent={PopupTransition}>
<DialogTitle>
<Stack direction={'row'} justifyContent={'space-between'}>
<Stack direction={{
@@ -761,48 +761,48 @@ const Orders = () => {
}} spacing={2} alignItems={'flex-start'}>
<Typography variant='h3'>Assigned Roles</Typography>
{(stafflist[0]) &&
<Chip icon={<EnvironmentOutlined />} label={stafflist[0].locationaddress} variant="light" color="primary" />
}
</Stack>
{(stafflist[0]) &&
<Chip label={stafflist[0].orderid} variant="combined" color='warning' size={'large'} />
}
</Stack>
<Grid container sx={{ p: 1 }} spacing={2}>
<Grid item sm={6} xs={12}>
</Grid>
<Grid item sm={6} xs={12}>
</Grid>
</Grid>
</DialogTitle>
<DialogContent dividers={true}>
{(stafflist.length === 0) ?
<>
{(loading1) ?
<>
<Stack alignItems={'center'}>
<CircularProgress />
</Stack>
</>
:
<Typography>No Staffs has been Assigned</Typography>
}
</>
:
<TableContainer>
<Table>
<TableHead>
@@ -812,31 +812,31 @@ const Orders = () => {
<TableCell>Start Time</TableCell>
<TableCell>End Time</TableCell>
<TableCell>Pay Rate</TableCell>
<TableCell align='center'>Clockin</TableCell>
<TableCell align='center'>Clockout</TableCell>
<TableCell>Hours Worked</TableCell>
<TableCell>Status</TableCell>
</TableRow>
</TableHead>
<TableBody>
{stafflist.map((val, i) => {
return <Fragment key={i}>
<TableRow sx={{
}}>
<TableCell component="th"
scope="row" padding="none">
{i + 1}
</TableCell>
<TableCell align="left">
<Stack direction="column">
<Typography variant="caption">
@@ -860,48 +860,48 @@ const Orders = () => {
</Stack>
</TableCell>
<TableCell>{val.rolecost}</TableCell>
<TableCell>
<Stack spacing={0.5}
alignItems="center"
>
<Chip label={(val.clockin) ? dayjs(val.clockin).format('MM/DD/YYYY') : ''} color="primary" variant="light" size="small" />
<Chip label={(val.clockin) ? dayjs(val.clockin).format('hh:mm A') : ''} color="info" variant="light" size="small" />
</Stack>
</TableCell>
<TableCell>
<Stack spacing={0.5}
alignItems="center"
>
<Chip label={(val.clockout) ? dayjs(val.clockout).format('MM/DD/YYYY') : ''} color="primary" variant="light" size="small" />
<Chip label={(val.clockout) ? dayjs(val.clockout).format('hh:mm A') : ''} color="info" variant="light" size="small" />
</Stack>
</TableCell>
<TableCell>
{val.hoursworked}
</TableCell>
<TableCell align="left">
<Stack direction="row">
{(val.orderstatus === 'pending') &&
<Chip label="Pending" color="error" size="small" />
}
{(val.orderstatus === 'cancelled') &&
<Chip label="Cancelled" color="secondary" size="small" />
}
{(val.orderstatus === 'completed') &&
<Chip label="Completed" color="primary" size="small" />
}
{(val.orderstatus === 'processing') &&
@@ -913,7 +913,7 @@ const Orders = () => {
{(val.orderstatus === 'confirmed') &&
<Chip label="Confirmed" color="success" size="small" />
}
{(val.orderstatus === 'active') &&
<Chip label="Active" color="info" size="small" />
}
@@ -921,11 +921,11 @@ const Orders = () => {
<Chip label="Closed" color="info" size="small" />
}
</Stack>
</TableCell>
</TableRow>
</Fragment>
})
}
</TableBody>
@@ -935,18 +935,18 @@ const Orders = () => {
</DialogContent>
<DialogActions>
<Stack sx={{ mt: 2 }} direction='row' justifyContent='flex-end' spacing={5}>
<Button sx={{ width: '130px' }} color='error' variant='contained' onClick={() => { dialogclose() }}>Close</Button>
</Stack>
</DialogActions>
</Dialog >
</>
})
}
</Grid> */}
</Collapse>
</TableCell>

View File

@@ -4173,6 +4173,11 @@ cosmiconfig@^8.1.3:
parse-json "^5.0.0"
path-type "^4.0.0"
country-flag-icons@^1.5.4:
version "1.5.10"
resolved "https://registry.npmjs.org/country-flag-icons/-/country-flag-icons-1.5.10.tgz"
integrity sha512-x3elaK+ZY23W1YtFsNQknRdURzkV7g3Z93AoA7SHZJUEXbVjRsNh4h9Uf09+OjWF/4u8tXeAt37gezGRdwR/2g==
create-ecdh@^4.0.0:
version "4.0.4"
resolved "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz"
@@ -6202,6 +6207,13 @@ ini@^1.3.5:
resolved "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz"
integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==
input-format@^0.3.10:
version "0.3.10"
resolved "https://registry.npmjs.org/input-format/-/input-format-0.3.10.tgz"
integrity sha512-5cFv/kOZD7Ch0viprVkuYPDkAU7HBZYBx8QrIpQ6yXUWbAQ0+RQ8IIojDJOf/RO6FDJLL099HDSK2KoVZ2zevg==
dependencies:
prop-types "^15.8.1"
internal-slot@^1.0.3, internal-slot@^1.0.4:
version "1.0.5"
resolved "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz"
@@ -7230,6 +7242,11 @@ levn@~0.3.0:
prelude-ls "~1.1.2"
type-check "~0.3.2"
libphonenumber-js@^1.10.59:
version "1.10.59"
resolved "https://registry.npmjs.org/libphonenumber-js/-/libphonenumber-js-1.10.59.tgz"
integrity sha512-HeTsOrDF/hWhEiKqZVwg9Cqlep5x2T+IYDENvT2VRj3iX8JQ7Y+omENv+AIn0vC8m6GYhivfCed5Cgfw27r5SA==
lilconfig@^2.0.3, lilconfig@^2.0.5, lilconfig@^2.0.6:
version "2.0.6"
resolved "https://registry.npmjs.org/lilconfig/-/lilconfig-2.0.6.tgz"
@@ -9243,6 +9260,17 @@ react-loading-icons@^1.1.0:
resolved "https://registry.npmjs.org/react-loading-icons/-/react-loading-icons-1.1.0.tgz"
integrity sha512-Y9eZ6HAufmUd8DIQd6rFrx5Bt/oDlTM9Nsjvf8YpajTa3dI8cLNU8jUN5z7KTANU+Yd6/KJuBjxVlrU2dMw33g==
react-phone-number-input@^3.3.10:
version "3.3.10"
resolved "https://registry.npmjs.org/react-phone-number-input/-/react-phone-number-input-3.3.10.tgz"
integrity sha512-onv6ETMejyA4Wi0/6Ay00FcSokHIJcowLUcwdizpALSpeXPFqbyrjHQSL8+pgkxIIruRxr5nyIAB8LT+Sa/Vlg==
dependencies:
classnames "^2.3.1"
country-flag-icons "^1.5.4"
input-format "^0.3.10"
libphonenumber-js "^1.10.59"
prop-types "^15.8.1"
"react-redux@^7.2.1 || ^8.0.2", react-redux@^8.0.5:
version "8.0.5"
resolved "https://registry.npmjs.org/react-redux/-/react-redux-8.0.5.tgz"