11122023
This commit is contained in:
Submodule nearlexpressbuild updated: 97d9155b79...c178408d13
Binary file not shown.
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.1 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 4.1 KiB |
@@ -47,7 +47,7 @@ const Header = () => {
|
|||||||
// variant="light"
|
// variant="light"
|
||||||
// sx={{ color: 'text.primary', bgcolor: drawerOpen ? iconBackColorOpen : iconBackColor, ml: { xs: 0, lg: -2 } }}
|
// sx={{ color: 'text.primary', bgcolor: drawerOpen ? iconBackColorOpen : iconBackColor, ml: { xs: 0, lg: -2 } }}
|
||||||
sx={{ color: '#fff', bgcolor: 'transparent', ml: { xs: 0, lg: -2 },
|
sx={{ color: '#fff', bgcolor: 'transparent', ml: { xs: 0, lg: -2 },
|
||||||
fontSize:'20px',
|
fontSize:'25px',
|
||||||
':hover':{
|
':hover':{
|
||||||
color: '#fff', bgcolor: 'transparent'
|
color: '#fff', bgcolor: 'transparent'
|
||||||
} }}
|
} }}
|
||||||
|
|||||||
@@ -88,20 +88,17 @@ const Accountsettings = () => {
|
|||||||
<Grid container spacing={3}
|
<Grid container spacing={3}
|
||||||
sx={{ mt: 1,height:'100%'}}
|
sx={{ mt: 1,height:'100%'}}
|
||||||
>
|
>
|
||||||
<Grid item xs={12} sm={5} md={4} xl={3}>
|
{/* <Grid item xs={12} sm={5} md={4} xl={3}>
|
||||||
<Grid container spacing={3} sx={{height:'100%'}}>
|
<Grid container spacing={3} sx={{height:'100%'}}>
|
||||||
<Grid item xs={12} sx={{height:'100%'}}>
|
<Grid item xs={12} sx={{height:'100%'}}>
|
||||||
<MainCard sx={{height:'100%'}}>
|
<MainCard sx={{height:'100%'}}>
|
||||||
<Grid container spacing={3} sx={{height:'100%'}}>
|
<Grid container spacing={3} sx={{height:'100%'}}>
|
||||||
<Grid item xs={12} sx={{height:'100%'}}>
|
<Grid item xs={12} sx={{height:'100%'}}>
|
||||||
<Stack direction="row" justifyContent="flex-end">
|
<Stack direction="row" justifyContent="flex-end">
|
||||||
{/* <Chip label="Pro" size="small" color="primary" /> */}
|
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack spacing={2.5} alignItems="center">
|
<Stack spacing={2.5} alignItems="center">
|
||||||
<Avatar alt="Avatar 1"
|
<Avatar alt="Avatar 1"
|
||||||
// size="xl"
|
|
||||||
sx={{width:80,height:80}}
|
sx={{width:80,height:80}}
|
||||||
// src={avatarImage(`./default.png`)}
|
|
||||||
/>
|
/>
|
||||||
<Stack spacing={0.5} alignItems="center">
|
<Stack spacing={0.5} alignItems="center">
|
||||||
<Typography variant="h5">{info.companyname || ''}</Typography>
|
<Typography variant="h5">{info.companyname || ''}</Typography>
|
||||||
@@ -109,27 +106,7 @@ const Accountsettings = () => {
|
|||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Grid>
|
</Grid>
|
||||||
{/* <Grid item xs={12}>
|
|
||||||
<Divider />
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={12}>
|
|
||||||
<Stack direction="row" justifyContent="space-around" alignItems="center">
|
|
||||||
<Stack spacing={0.5} alignItems="center">
|
|
||||||
<Typography variant="h5">86</Typography>
|
|
||||||
<Typography color="secondary">Post</Typography>
|
|
||||||
</Stack>
|
|
||||||
<Divider orientation="vertical" flexItem />
|
|
||||||
<Stack spacing={0.5} alignItems="center">
|
|
||||||
<Typography variant="h5">40</Typography>
|
|
||||||
<Typography color="secondary">Project</Typography>
|
|
||||||
</Stack>
|
|
||||||
<Divider orientation="vertical" flexItem />
|
|
||||||
<Stack spacing={0.5} alignItems="center">
|
|
||||||
<Typography variant="h5">4.5K</Typography>
|
|
||||||
<Typography color="secondary">Members</Typography>
|
|
||||||
</Stack>
|
|
||||||
</Stack>
|
|
||||||
</Grid>*/}
|
|
||||||
<Grid item xs={12}>
|
<Grid item xs={12}>
|
||||||
<Divider />
|
<Divider />
|
||||||
</Grid>
|
</Grid>
|
||||||
@@ -149,7 +126,6 @@ const Accountsettings = () => {
|
|||||||
</ListItemIcon>
|
</ListItemIcon>
|
||||||
<ListItemSecondaryAction>
|
<ListItemSecondaryAction>
|
||||||
<Typography align="right">
|
<Typography align="right">
|
||||||
{/* (+1-876) 8654 239 581 */}
|
|
||||||
{info.primarycontact || ''}
|
{info.primarycontact || ''}
|
||||||
</Typography>
|
</Typography>
|
||||||
</ListItemSecondaryAction>
|
</ListItemSecondaryAction>
|
||||||
@@ -160,7 +136,6 @@ const Accountsettings = () => {
|
|||||||
</ListItemIcon>
|
</ListItemIcon>
|
||||||
<ListItemSecondaryAction>
|
<ListItemSecondaryAction>
|
||||||
<Typography align="right">
|
<Typography align="right">
|
||||||
{/* New York */}
|
|
||||||
{info.city}
|
{info.city}
|
||||||
</Typography>
|
</Typography>
|
||||||
</ListItemSecondaryAction>
|
</ListItemSecondaryAction>
|
||||||
@@ -170,9 +145,7 @@ const Accountsettings = () => {
|
|||||||
<EnvironmentOutlined />
|
<EnvironmentOutlined />
|
||||||
</ListItemIcon>
|
</ListItemIcon>
|
||||||
<ListItemSecondaryAction>
|
<ListItemSecondaryAction>
|
||||||
{/* <Link align="right" href="https://google.com" target="_blank">
|
|
||||||
https://anshan.dh.url
|
|
||||||
</Link> */}
|
|
||||||
{info.state}
|
{info.state}
|
||||||
</ListItemSecondaryAction>
|
</ListItemSecondaryAction>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
@@ -181,55 +154,41 @@ const Accountsettings = () => {
|
|||||||
</Grid>
|
</Grid>
|
||||||
</MainCard>
|
</MainCard>
|
||||||
</Grid>
|
</Grid>
|
||||||
{/* <Grid item xs={12}>
|
|
||||||
<MainCard title="Skills">
|
|
||||||
<Grid container spacing={1.25}>
|
|
||||||
<Grid item xs={6}>
|
|
||||||
<Typography color="secondary">Junior</Typography>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={6}>
|
|
||||||
<LinearWithLabel value={30} />
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={6}>
|
|
||||||
<Typography color="secondary">UX Reseacher</Typography>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={6}>
|
|
||||||
<LinearWithLabel value={80} />
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={6}>
|
|
||||||
<Typography color="secondary">Wordpress</Typography>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={6}>
|
|
||||||
<LinearWithLabel value={90} />
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={6}>
|
|
||||||
<Typography color="secondary">HTML</Typography>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={6}>
|
|
||||||
<LinearWithLabel value={30} />
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={6}>
|
|
||||||
<Typography color="secondary">Graphic Design</Typography>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={6}>
|
|
||||||
<LinearWithLabel value={95} />
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={6}>
|
|
||||||
<Typography color="secondary">Code Style</Typography>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={6}>
|
|
||||||
<LinearWithLabel value={75} />
|
|
||||||
</Grid>
|
|
||||||
</Grid>
|
|
||||||
</MainCard>
|
|
||||||
</Grid> */}
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid> */}
|
||||||
<Grid item xs={12} sm={7} md={8} xl={9} >
|
<Grid item
|
||||||
|
// xs={12} sm={7} md={8} xl={9}
|
||||||
|
xs={12}
|
||||||
|
// sm={7} md={8} xl={9}
|
||||||
|
|
||||||
|
>
|
||||||
<Grid container spacing={3} >
|
<Grid container spacing={3} >
|
||||||
|
|
||||||
<Grid item xs={12} >
|
<Grid item xs={12} >
|
||||||
<MainCard title="Other Details" >
|
<MainCard
|
||||||
|
// title="Other Details"
|
||||||
|
title={ <Stack direction="row" alignItems="center" spacing={1} justifyContent="flex-start">
|
||||||
|
<Avatar
|
||||||
|
alt=""
|
||||||
|
size="sm"
|
||||||
|
// src={row.profileimage}
|
||||||
|
sx={{
|
||||||
|
width: '25px',
|
||||||
|
height: '25px'
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
|
||||||
|
</Avatar>
|
||||||
|
<Stack direction="column">
|
||||||
|
<Typography variant="caption">{info.companyname}</Typography>
|
||||||
|
{/* <Typography variant="caption" color="textSecondary">
|
||||||
|
|
||||||
|
{info.registrationno}
|
||||||
|
</Typography> */}
|
||||||
|
</Stack>
|
||||||
|
</Stack>}
|
||||||
|
>
|
||||||
<List sx={{ py: 0 }}>
|
<List sx={{ py: 0 }}>
|
||||||
<ListItem divider={!matchDownMD}>
|
<ListItem divider={!matchDownMD}>
|
||||||
<Grid container spacing={3}>
|
<Grid container spacing={3}>
|
||||||
@@ -253,7 +212,6 @@ const Accountsettings = () => {
|
|||||||
<Stack spacing={0.5}>
|
<Stack spacing={0.5}>
|
||||||
<Typography color="secondary">Phone</Typography>
|
<Typography color="secondary">Phone</Typography>
|
||||||
<Typography>
|
<Typography>
|
||||||
{/* (+1-876) <PatternFormat value={8654239581} displayType="text" type="text" format="#### ### ###" /> */}
|
|
||||||
{info.primarycontact || ''}
|
{info.primarycontact || ''}
|
||||||
</Typography>
|
</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
@@ -315,101 +273,7 @@ const Accountsettings = () => {
|
|||||||
</Typography>
|
</Typography>
|
||||||
</MainCard>
|
</MainCard>
|
||||||
</Grid>
|
</Grid>
|
||||||
{/* <Grid item xs={12}>
|
|
||||||
<MainCard title="Education">
|
|
||||||
<List sx={{ py: 0 }}>
|
|
||||||
<ListItem divider>
|
|
||||||
<Grid container spacing={matchDownMD ? 0.5 : 3}>
|
|
||||||
<Grid item xs={12} md={6}>
|
|
||||||
<Stack spacing={0.5}>
|
|
||||||
<Typography color="secondary">Master Degree (Year)</Typography>
|
|
||||||
<Typography>2014-2017</Typography>
|
|
||||||
</Stack>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={12} md={6}>
|
|
||||||
<Stack spacing={0.5}>
|
|
||||||
<Typography color="secondary">Institute</Typography>
|
|
||||||
<Typography>-</Typography>
|
|
||||||
</Stack>
|
|
||||||
</Grid>
|
|
||||||
</Grid>
|
|
||||||
</ListItem>
|
|
||||||
<ListItem divider>
|
|
||||||
<Grid container spacing={matchDownMD ? 0.5 : 3}>
|
|
||||||
<Grid item xs={12} md={6}>
|
|
||||||
<Stack spacing={0.5}>
|
|
||||||
<Typography color="secondary">Bachelor (Year)</Typography>
|
|
||||||
<Typography>2011-2013</Typography>
|
|
||||||
</Stack>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={12} md={6}>
|
|
||||||
<Stack spacing={0.5}>
|
|
||||||
<Typography color="secondary">Institute</Typography>
|
|
||||||
<Typography>Imperial College London</Typography>
|
|
||||||
</Stack>
|
|
||||||
</Grid>
|
|
||||||
</Grid>
|
|
||||||
</ListItem>
|
|
||||||
<ListItem>
|
|
||||||
<Grid container spacing={matchDownMD ? 0.5 : 3}>
|
|
||||||
<Grid item xs={12} md={6}>
|
|
||||||
<Stack spacing={0.5}>
|
|
||||||
<Typography color="secondary">School (Year)</Typography>
|
|
||||||
<Typography>2009-2011</Typography>
|
|
||||||
</Stack>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={12} md={6}>
|
|
||||||
<Stack spacing={0.5}>
|
|
||||||
<Typography color="secondary">Institute</Typography>
|
|
||||||
<Typography>School of London, England</Typography>
|
|
||||||
</Stack>
|
|
||||||
</Grid>
|
|
||||||
</Grid>
|
|
||||||
</ListItem>
|
|
||||||
</List>
|
|
||||||
</MainCard>
|
|
||||||
</Grid> */}
|
|
||||||
{/* <Grid item xs={12}>
|
|
||||||
<MainCard title="Emplyment">
|
|
||||||
<List sx={{ py: 0 }}>
|
|
||||||
<ListItem divider>
|
|
||||||
<Grid container spacing={matchDownMD ? 0.5 : 3}>
|
|
||||||
<Grid item xs={12} md={6}>
|
|
||||||
<Stack spacing={0.5}>
|
|
||||||
<Typography color="secondary">Senior</Typography>
|
|
||||||
<Typography color="secondary">Senior UI/UX designer (Year)</Typography>
|
|
||||||
</Stack>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={12} md={6}>
|
|
||||||
<Stack spacing={0.5}>
|
|
||||||
<Typography color="secondary">Job Responsibility</Typography>
|
|
||||||
<Typography>
|
|
||||||
Perform task related to project manager with the 100+ team under my observation. Team management is key role in
|
|
||||||
this company.
|
|
||||||
</Typography>
|
|
||||||
</Stack>
|
|
||||||
</Grid>
|
|
||||||
</Grid>f
|
|
||||||
</ListItem>
|
|
||||||
<ListItem>
|
|
||||||
<Grid container spacing={matchDownMD ? 0.5 : 3}>
|
|
||||||
<Grid item xs={12} md={6}>
|
|
||||||
<Stack spacing={0.5}>
|
|
||||||
<Typography color="secondary">Trainee cum Project Manager (Year)</Typography>
|
|
||||||
<Typography>2017-2019</Typography>
|
|
||||||
</Stack>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={12} md={6}>
|
|
||||||
<Stack spacing={0.5}>
|
|
||||||
<Typography color="secondary">Job Responsibility</Typography>
|
|
||||||
<Typography>Team management is key role in this company.</Typography>
|
|
||||||
</Stack>
|
|
||||||
</Grid>
|
|
||||||
</Grid>
|
|
||||||
</ListItem>
|
|
||||||
</List>
|
|
||||||
</MainCard>
|
|
||||||
</Grid> */}
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@@ -65,7 +65,10 @@ const Createclient = () => {
|
|||||||
const [primarycontact,setPrimarycontact]=useState('')
|
const [primarycontact,setPrimarycontact]=useState('')
|
||||||
const [firstname,setFirstname]=useState('');
|
const [firstname,setFirstname]=useState('');
|
||||||
const [doorno,setDoorno]=useState('');
|
const [doorno,setDoorno]=useState('');
|
||||||
const [landmark,setLandmark]=useState('')
|
const [landmark,setLandmark]=useState('');
|
||||||
|
const [tenantinfo, setTenantinfo] = useState({});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
@@ -78,7 +81,9 @@ const Createclient = () => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// fetchprofiledetails(localStorage.getItem('appuserid'));
|
// fetchprofiledetails(localStorage.getItem('appuserid'));
|
||||||
// fetchprofiledetails(181);
|
// fetchprofiledetails(181);
|
||||||
|
if(localStorage.getItem('tenantid')){
|
||||||
|
fetchtenantinfo(localStorage.getItem('tenantid'))
|
||||||
|
}
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -158,6 +163,21 @@ const Createclient = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const fetchtenantinfo = async (tid) => {
|
||||||
|
setLoading(true)
|
||||||
|
await axios.get(`${process.env.REACT_APP_URL}/tenants/gettenantinfo/?tenantid=${tid}`)
|
||||||
|
.then((res) => {
|
||||||
|
console.log(res)
|
||||||
|
if (res.data.status) {
|
||||||
|
setTenantinfo(res.data.details);
|
||||||
|
}
|
||||||
|
setLoading(false)
|
||||||
|
}).catch((err) => {
|
||||||
|
console.log(err)
|
||||||
|
setLoading(false)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (selectedImage) {
|
if (selectedImage) {
|
||||||
setAvatar(URL.createObjectURL(selectedImage));
|
setAvatar(URL.createObjectURL(selectedImage));
|
||||||
@@ -241,7 +261,7 @@ const Createclient = () => {
|
|||||||
"customerid":0,
|
"customerid":0,
|
||||||
"configid":1,
|
"configid":1,
|
||||||
"firstname":firstname,
|
"firstname":firstname,
|
||||||
"applocationid":3,
|
"applocationid":tenantinfo.applolcationid,
|
||||||
"profileimage":"",
|
"profileimage":"",
|
||||||
"dialcode":"+91",
|
"dialcode":"+91",
|
||||||
"contactno":mobilenumber,
|
"contactno":mobilenumber,
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ import Geocode from "react-geocode";
|
|||||||
// import {setApi} from "react-geocode";
|
// import {setApi} from "react-geocode";
|
||||||
import Autocomplete1 from "react-google-autocomplete";
|
import Autocomplete1 from "react-google-autocomplete";
|
||||||
// import logo from 'assets/images/location.png'
|
// import logo from 'assets/images/location.png'
|
||||||
|
import Loader from 'components/Loader'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
// EditOutlined,
|
// EditOutlined,
|
||||||
@@ -141,7 +142,7 @@ const Createorder = () => {
|
|||||||
|
|
||||||
const [stafflist, setStafflist] = useState([]);
|
const [stafflist, setStafflist] = useState([]);
|
||||||
const [loading2, setLoading2] = useState(false);
|
const [loading2, setLoading2] = useState(false);
|
||||||
|
const [loading,setLoading]=useState(false)
|
||||||
|
|
||||||
|
|
||||||
const [shiftarr, setShiftarr] = useState([]);
|
const [shiftarr, setShiftarr] = useState([]);
|
||||||
@@ -163,12 +164,12 @@ const Createorder = () => {
|
|||||||
sno: 1,
|
sno: 1,
|
||||||
address: '',
|
address: '',
|
||||||
"customerid": '',
|
"customerid": '',
|
||||||
"deliverytime": "",
|
"deliverytime": dayjs(),
|
||||||
"deliverylocationid": '',
|
"deliverylocationid": '',
|
||||||
"clientname": '',
|
"clientname": '',
|
||||||
"contactno": ''
|
"contactno": ''
|
||||||
}])
|
}])
|
||||||
console.log(orderarr)
|
// console.log(dayjs())
|
||||||
}
|
}
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
@@ -195,14 +196,17 @@ const Createorder = () => {
|
|||||||
}, [searchword])
|
}, [searchword])
|
||||||
|
|
||||||
const fetchtenantinfo = async (tid) => {
|
const fetchtenantinfo = async (tid) => {
|
||||||
|
setLoading(true)
|
||||||
await axios.get(`${process.env.REACT_APP_URL}/tenants/gettenantinfo/?tenantid=${tid}`)
|
await axios.get(`${process.env.REACT_APP_URL}/tenants/gettenantinfo/?tenantid=${tid}`)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
if (res.data.status) {
|
if (res.data.status) {
|
||||||
setTenantinfo(res.data.details);
|
setTenantinfo(res.data.details);
|
||||||
}
|
}
|
||||||
|
setLoading(false)
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
console.log(err)
|
console.log(err)
|
||||||
|
setLoading(false)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -223,7 +227,7 @@ const Createorder = () => {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
const createsubmitobj1 = () => {
|
const createsubmitobj1 = async() => {
|
||||||
let arr = []
|
let arr = []
|
||||||
let timecheck = false;
|
let timecheck = false;
|
||||||
let addresscheck = false;
|
let addresscheck = false;
|
||||||
@@ -243,7 +247,7 @@ const Createorder = () => {
|
|||||||
"moduleid": tenantinfo.moduleid,
|
"moduleid": tenantinfo.moduleid,
|
||||||
"configid": 7,
|
"configid": 7,
|
||||||
"orderid": "",
|
"orderid": "",
|
||||||
"customerid": val.customerid, //
|
"customerid": val.customerid,
|
||||||
"orderdate": dayjs().format('YYYY-MM-DD HH:mm:ss'),
|
"orderdate": dayjs().format('YYYY-MM-DD HH:mm:ss'),
|
||||||
"orderstatus": "created",
|
"orderstatus": "created",
|
||||||
"pending": "",
|
"pending": "",
|
||||||
@@ -266,13 +270,16 @@ const Createorder = () => {
|
|||||||
"deliverycharge": 0,
|
"deliverycharge": 0,
|
||||||
"deliverytime": `${dayjs(startdate).format('YYYY-MM-DD')} ${dayjs(val.deliverytime.$d).format('HH:mm:ss')}`,
|
"deliverytime": `${dayjs(startdate).format('YYYY-MM-DD')} ${dayjs(val.deliverytime.$d).format('HH:mm:ss')}`,
|
||||||
"deliverylocationid": val.deliverylocationid, //
|
"deliverylocationid": val.deliverylocationid, //
|
||||||
"delivceryaddress": val.address,
|
"deliveryaddress": val.address,
|
||||||
"pickupaddress": tenantinfo.address,
|
"pickupaddress": tenantinfo.address,
|
||||||
"pickuplat": tenantinfo.latitude,
|
"pickuplat": tenantinfo.latitude,
|
||||||
"pickuplong": tenantinfo.longitude,
|
"pickuplong": tenantinfo.longitude,
|
||||||
"ordernotes": otherinstructions,
|
"ordernotes": otherinstructions,
|
||||||
"remarks": "",
|
"remarks": "",
|
||||||
"tenantuserid": parseInt(localStorage.getItem('tenantid'))
|
"tenantuserid": parseInt(localStorage.getItem('tenantid')),
|
||||||
|
"categoryid":tenantinfo.categoryid,
|
||||||
|
"subcategoryid":tenantinfo.subcategoryid,
|
||||||
|
"partnerid":tenantinfo.partnerid
|
||||||
})
|
})
|
||||||
|
|
||||||
})
|
})
|
||||||
@@ -283,7 +290,28 @@ const Createorder = () => {
|
|||||||
opentoast('Choose Client')
|
opentoast('Choose Client')
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
opentoast('success')
|
setLoading(true)
|
||||||
|
await axios.post(`${process.env.REACT_APP_URL}/orders/createorders`,arr)
|
||||||
|
.then((res) => {
|
||||||
|
if (res.data.status) {
|
||||||
|
enqueueSnackbar('Order Created Successfully', {
|
||||||
|
variant: 'success', anchorOrigin: { vertical: 'top', horizontal: 'right' },
|
||||||
|
autoHideDuration: 2000
|
||||||
|
})
|
||||||
|
navigate('/orders')
|
||||||
|
}else{
|
||||||
|
opentoast(res.data.message)
|
||||||
|
}
|
||||||
|
setLoading(false)
|
||||||
|
console.log(res)
|
||||||
|
|
||||||
|
}).catch((err) => {
|
||||||
|
console.log(err)
|
||||||
|
opentoast(err.data.message)
|
||||||
|
setLoading(false)
|
||||||
|
|
||||||
|
})
|
||||||
|
// opentoast('success')
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(arr)
|
console.log(arr)
|
||||||
@@ -433,6 +461,11 @@ const Createorder = () => {
|
|||||||
|
|
||||||
|
|
||||||
return <>
|
return <>
|
||||||
|
{(loading) &&
|
||||||
|
|
||||||
|
<Loader />
|
||||||
|
|
||||||
|
}
|
||||||
<Grid container rowSpacing={4.5} columnSpacing={2.75}>
|
<Grid container rowSpacing={4.5} columnSpacing={2.75}>
|
||||||
|
|
||||||
<CardActions
|
<CardActions
|
||||||
@@ -463,7 +496,7 @@ const Createorder = () => {
|
|||||||
sno: 1,
|
sno: 1,
|
||||||
address: '',
|
address: '',
|
||||||
"customerid": '',
|
"customerid": '',
|
||||||
"deliverytime": "",
|
"deliverytime":dayjs(),
|
||||||
"deliverylocationid": '',
|
"deliverylocationid": '',
|
||||||
"clientname": '',
|
"clientname": '',
|
||||||
"contactno": ''
|
"contactno": ''
|
||||||
@@ -475,7 +508,7 @@ const Createorder = () => {
|
|||||||
sno: 1,
|
sno: 1,
|
||||||
address: '',
|
address: '',
|
||||||
"customerid": '',
|
"customerid": '',
|
||||||
"deliverytime": "",
|
"deliverytime": dayjs(),
|
||||||
"deliverylocationid": '',
|
"deliverylocationid": '',
|
||||||
"clientname": '',
|
"clientname": '',
|
||||||
"contactno": ''
|
"contactno": ''
|
||||||
@@ -785,17 +818,18 @@ const Createorder = () => {
|
|||||||
setOrderarr([{
|
setOrderarr([{
|
||||||
sno: 1,
|
sno: 1,
|
||||||
address: address.address,
|
address: address.address,
|
||||||
"customerid": '',
|
"customerid": address.customerid,
|
||||||
"deliverytime": "",
|
"deliverytime": dayjs(),
|
||||||
"deliverylocationid": '',
|
"deliverylocationid": address.deliverylocationid,
|
||||||
"clientname": address.firstname,
|
"clientname": address.firstname,
|
||||||
"contactno": address.contactno
|
"contactno": address.contactno
|
||||||
}])
|
}])
|
||||||
} else {
|
} else {
|
||||||
if (orderarr.find((val2) => val2.address == address.address)) {
|
if (orderarr.find((val2) => val2.customerid == address.customerid)) {
|
||||||
if (orderarr.length > 1) {
|
if (orderarr.length > 1) {
|
||||||
let arr = orderarr;
|
let arr = orderarr;
|
||||||
arr.splice(address.sno - 1, 1);
|
let res = orderarr.find((val2) => val2.customerid == address.customerid)
|
||||||
|
arr.splice(res.sno - 1, 1);
|
||||||
let arr1 = []
|
let arr1 = []
|
||||||
arr.map((val2, k) => {
|
arr.map((val2, k) => {
|
||||||
arr1.push({
|
arr1.push({
|
||||||
@@ -814,7 +848,7 @@ const Createorder = () => {
|
|||||||
sno: 1,
|
sno: 1,
|
||||||
address: '',
|
address: '',
|
||||||
"customerid": '',
|
"customerid": '',
|
||||||
"deliverytime": "",
|
"deliverytime": dayjs(),
|
||||||
"deliverylocationid": '',
|
"deliverylocationid": '',
|
||||||
"clientname": '',
|
"clientname": '',
|
||||||
"contactno": ''
|
"contactno": ''
|
||||||
@@ -827,7 +861,7 @@ const Createorder = () => {
|
|||||||
sno: arr.length + 1,
|
sno: arr.length + 1,
|
||||||
'address': address.address,
|
'address': address.address,
|
||||||
"customerid": address.customerid,
|
"customerid": address.customerid,
|
||||||
"deliverytime": "",
|
"deliverytime": dayjs(),
|
||||||
"deliverylocationid": address.deliverylocationid,
|
"deliverylocationid": address.deliverylocationid,
|
||||||
"clientname":address.firstname,
|
"clientname":address.firstname,
|
||||||
"contactno": address.contactno
|
"contactno": address.contactno
|
||||||
@@ -844,7 +878,7 @@ const Createorder = () => {
|
|||||||
sno: 1,
|
sno: 1,
|
||||||
address: address.address,
|
address: address.address,
|
||||||
"customerid": address.customerid,
|
"customerid": address.customerid,
|
||||||
"deliverytime": "",
|
"deliverytime": dayjs(),
|
||||||
"deliverylocationid": address.deliverylocationid,
|
"deliverylocationid": address.deliverylocationid,
|
||||||
"clientname":address.firstname,
|
"clientname":address.firstname,
|
||||||
"contactno": address.contactno
|
"contactno": address.contactno
|
||||||
@@ -869,10 +903,11 @@ const Createorder = () => {
|
|||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
p: 1.25,
|
p: 1.25,
|
||||||
'&:hover': {
|
'&:hover': {
|
||||||
bgcolor: theme.palette.primary.lighter,
|
// bgcolor: theme.palette.primary.lighter,
|
||||||
borderColor: theme.palette.primary.lighter
|
// borderColor: theme.palette.primary.lighter
|
||||||
|
bgcolor:(orderarr.find((val2) => val2.customerid == address.customerid)) ? '#e1bee7' : ''
|
||||||
},
|
},
|
||||||
bgcolor: (orderarr.find((val2) => val2.address == address.address)) ? '#e1bee7' : ''
|
bgcolor: (orderarr.find((val2) => val2.customerid == address.customerid)) ? '#e1bee7' : ''
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Stack direction={'row'} justifyContent={'space-between'}>
|
<Stack direction={'row'} justifyContent={'space-between'}>
|
||||||
@@ -880,7 +915,7 @@ const Createorder = () => {
|
|||||||
{address.firstname}
|
{address.firstname}
|
||||||
</Typography>
|
</Typography>
|
||||||
{(orderarr.find((val2) => val2.address == address.address)) &&
|
{(orderarr.find((val2) => val2.address == address.address)) &&
|
||||||
<CheckCircleIcon color='#662582' />
|
<CheckCircleIcon color='primary' />
|
||||||
}
|
}
|
||||||
|
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|||||||
@@ -517,9 +517,9 @@ import {
|
|||||||
<Typography variant='body2' noWrap>{row.orderid}</Typography>
|
<Typography variant='body2' noWrap>{row.orderid}</Typography>
|
||||||
<Typography noWrap
|
<Typography noWrap
|
||||||
sx={{ fontSize: '11px' }}>
|
sx={{ fontSize: '11px' }}>
|
||||||
{dayjs(row.orderdate).utc().format('MM/DD/YYYY')}
|
{dayjs(row.deliverydate).utc().format('MM/DD/YYYY hh:mm A')}
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell align="left">
|
<TableCell align="left">
|
||||||
<Stack direction='column'>
|
<Stack direction='column'>
|
||||||
@@ -536,7 +536,7 @@ import {
|
|||||||
<TableCell align="left">
|
<TableCell align="left">
|
||||||
<Stack direction='column'>
|
<Stack direction='column'>
|
||||||
{/* <Typography variant="caption" > {row.eventname}</Typography> */}
|
{/* <Typography variant="caption" > {row.eventname}</Typography> */}
|
||||||
<Tooltip title={row.delivceryaddress}>
|
<Tooltip title={row.deliveryaddress}>
|
||||||
<Typography variant="caption" color="textSecondary"
|
<Typography variant="caption" color="textSecondary"
|
||||||
>
|
>
|
||||||
{row.deliveryaddress.slice(0,20)}
|
{row.deliveryaddress.slice(0,20)}
|
||||||
@@ -1065,6 +1065,8 @@ import {
|
|||||||
let [orderarrmodified, setArrmodified] = useState([]);
|
let [orderarrmodified, setArrmodified] = useState([]);
|
||||||
let [orderarrclosed, setArrclosed] = useState([]);
|
let [orderarrclosed, setArrclosed] = useState([]);
|
||||||
let [orderarrpicked, setArrpicked] = useState([]);
|
let [orderarrpicked, setArrpicked] = useState([]);
|
||||||
|
let [orderarrcreated, setArrcreated] = useState([]);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1108,8 +1110,9 @@ import {
|
|||||||
setTabvalue(i);
|
setTabvalue(i);
|
||||||
|
|
||||||
if (i === 0) setTabstatus('All orders')
|
if (i === 0) setTabstatus('All orders')
|
||||||
if (i === 1) setTabstatus('Pending')
|
// if (i === 1) setTabstatus('Created')
|
||||||
// if (i === 2) setTabstatus('Modified')
|
// if (i === 2) setTabstatus('Modified')
|
||||||
|
if (i === 1) setTabstatus('Pending')
|
||||||
|
|
||||||
if (i === 2) setTabstatus('Assigned')
|
if (i === 2) setTabstatus('Assigned')
|
||||||
if (i === 3) setTabstatus('Picked')
|
if (i === 3) setTabstatus('Picked')
|
||||||
@@ -1147,6 +1150,7 @@ import {
|
|||||||
fetchtablecancelled(val);
|
fetchtablecancelled(val);
|
||||||
fetchtableassigned(val);
|
fetchtableassigned(val);
|
||||||
fetchtablepicked(val);
|
fetchtablepicked(val);
|
||||||
|
fetchtablecreated(val);
|
||||||
// fetchtableconfirmed(val);
|
// fetchtableconfirmed(val);
|
||||||
// fetchtablemodified(val);
|
// fetchtablemodified(val);
|
||||||
// fetchtableclosed(val)
|
// fetchtableclosed(val)
|
||||||
@@ -1175,6 +1179,7 @@ import {
|
|||||||
// fetchtablemodified(val);
|
// fetchtablemodified(val);
|
||||||
// fetchtableclosed(val)
|
// fetchtableclosed(val)
|
||||||
fetchtable(val)
|
fetchtable(val)
|
||||||
|
fetchtablecreated(val)
|
||||||
|
|
||||||
console.log(activeorders);
|
console.log(activeorders);
|
||||||
}
|
}
|
||||||
@@ -1186,7 +1191,7 @@ import {
|
|||||||
// if (tabstatus === 'All orders') setRows(orderarr)
|
// if (tabstatus === 'All orders') setRows(orderarr)
|
||||||
// if (tabstatus === 'Completed') setRows(orderarrcovered)
|
// if (tabstatus === 'Completed') setRows(orderarrcovered)
|
||||||
// if (tabstatus === 'Active') setRows(orderarractive)
|
// if (tabstatus === 'Active') setRows(orderarractive)
|
||||||
if (tabstatus === 'Pending') setRows(orderarruncovered)
|
// if (tabstatus === 'Pending') setRows(orderarruncovered)
|
||||||
// if (tabstatus === 'Cancelled') setRows(orderarrcancelled)
|
// if (tabstatus === 'Cancelled') setRows(orderarrcancelled)
|
||||||
// if (tabstatus === 'Assigned') setRows(orderarrassigned)
|
// if (tabstatus === 'Assigned') setRows(orderarrassigned)
|
||||||
// if (tabstatus === 'Confirmed') setRows(orderarrconfirmed)
|
// if (tabstatus === 'Confirmed') setRows(orderarrconfirmed)
|
||||||
@@ -1194,6 +1199,8 @@ import {
|
|||||||
|
|
||||||
if (tabstatus === 'All orders') setRows(orderarr)
|
if (tabstatus === 'All orders') setRows(orderarr)
|
||||||
if (tabstatus === 'Delivered') setRows(orderarrcovered)
|
if (tabstatus === 'Delivered') setRows(orderarrcovered)
|
||||||
|
if (tabstatus === 'Pending') setRows(orderarrcreated)
|
||||||
|
|
||||||
// if (tabstatus === 'Active') setRows(orderarractive)
|
// if (tabstatus === 'Active') setRows(orderarractive)
|
||||||
// if (tabstatus === 'Pending') setRows(orderarruncovered)
|
// if (tabstatus === 'Pending') setRows(orderarruncovered)
|
||||||
if (tabstatus === 'Cancelled') setRows(orderarrcancelled)
|
if (tabstatus === 'Cancelled') setRows(orderarrcancelled)
|
||||||
@@ -1434,8 +1441,8 @@ import {
|
|||||||
const fetchtable = async (tid) => {
|
const fetchtable = async (tid) => {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// await axios.get(`${process.env.REACT_APP_URL}/orders/getorders/?tenantid=${tid}`)
|
// await axios.get(`${process.env.REACT_APP_URL}/orders/tenantorders/?tenantid=${tid}`)
|
||||||
await axios.get(`${process.env.REACT_APP_URL}/orders/tenantorders/?tenantid=${tid}`)
|
await axios.get(`${process.env.REACT_APP_URL}/orders/tenant/getorders/?tenantid=${tid}`)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.data.status) {
|
if (res.data.status) {
|
||||||
let arr = []
|
let arr = []
|
||||||
@@ -1463,7 +1470,7 @@ import {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
// await axios.get(`${process.env.REACT_APP_URL}/orders/getorders/?tenantid=${tid}&status=completed`)
|
// await axios.get(`${process.env.REACT_APP_URL}/orders/getorders/?tenantid=${tid}&status=completed`)
|
||||||
await axios.get(`${process.env.REACT_APP_URL}/orders/tenantorders/?tenantid=${tid}&status=delivered`)
|
await axios.get(`${process.env.REACT_APP_URL}/orders/tenant/getorders/?tenantid=${tid}&status=delivered`)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
// if (res.data.message === "Success") {
|
// if (res.data.message === "Success") {
|
||||||
let arr = []
|
let arr = []
|
||||||
@@ -1481,6 +1488,29 @@ import {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const fetchtablecreated = async (tid) => {
|
||||||
|
|
||||||
|
try {
|
||||||
|
// await axios.get(`${process.env.REACT_APP_URL}/orders/getorders/?tenantid=${tid}&status=completed`)
|
||||||
|
await axios.get(`${process.env.REACT_APP_URL}/orders/tenant/getorders/?tenantid=${tid}&status=created`)
|
||||||
|
.then((res) => {
|
||||||
|
// if (res.data.message === "Success") {
|
||||||
|
let arr = []
|
||||||
|
res.data.details.map((val, i) => {
|
||||||
|
arr = [...arr, { ...val, sno: i + 1 }];
|
||||||
|
})
|
||||||
|
setArrcreated(arr)
|
||||||
|
// }
|
||||||
|
}).catch((err) => {
|
||||||
|
console.log(err)
|
||||||
|
})
|
||||||
|
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const fetchtableactive = async () => {
|
const fetchtableactive = async () => {
|
||||||
@@ -1509,7 +1539,7 @@ import {
|
|||||||
const fetchtableuncovered = async (tid) => {
|
const fetchtableuncovered = async (tid) => {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await axios.get(`${process.env.REACT_APP_URL}/orders/tenantorders/?tenantid=${tid}&status=pending`)
|
await axios.get(`${process.env.REACT_APP_URL}/orders/tenant/getorders/?tenantid=${tid}&status=pending`)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.data.message === "Success") {
|
if (res.data.message === "Success") {
|
||||||
let arr = []
|
let arr = []
|
||||||
@@ -1532,7 +1562,7 @@ import {
|
|||||||
const fetchtablecancelled = async (tid) => {
|
const fetchtablecancelled = async (tid) => {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await axios.get(`${process.env.REACT_APP_URL}/orders/tenantorders/?tenantid=${tid}&status=cancelled`)
|
await axios.get(`${process.env.REACT_APP_URL}/orders/tenant/getorders/?tenantid=${tid}&status=cancelled`)
|
||||||
// await axios.get(`${process.env.REACT_APP_URL2}/client/orders/getordersbystatus?tenantid=${tid}&status=cancelled`)
|
// await axios.get(`${process.env.REACT_APP_URL2}/client/orders/getordersbystatus?tenantid=${tid}&status=cancelled`)
|
||||||
|
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
@@ -1558,7 +1588,7 @@ import {
|
|||||||
const fetchtableassigned = async (tid) => {
|
const fetchtableassigned = async (tid) => {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await axios.get(`${process.env.REACT_APP_URL}/orders/tenantorders/?tenantid=${tid}&status=accepted`)
|
await axios.get(`${process.env.REACT_APP_URL}/orders/tenant/getorders/?tenantid=${tid}&status=accepted`)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
// if (res.data.message === "Success") {
|
// if (res.data.message === "Success") {
|
||||||
let arr = [];
|
let arr = [];
|
||||||
@@ -1582,7 +1612,7 @@ import {
|
|||||||
const fetchtablepicked = async (tid) => {
|
const fetchtablepicked = async (tid) => {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await axios.get(`${process.env.REACT_APP_URL}/orders/tenantorders/?tenantid=${tid}&status=picked`)
|
await axios.get(`${process.env.REACT_APP_URL}/orders/tenant/getorders/?tenantid=${tid}&status=picked`)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
// if (res.data.message === "Success") {
|
// if (res.data.message === "Success") {
|
||||||
let arr = [];
|
let arr = [];
|
||||||
@@ -1909,7 +1939,10 @@ import {
|
|||||||
iconPosition="end"
|
iconPosition="end"
|
||||||
icon={<Chip label={allorders} color="primary" variant="light" size="small" />}
|
icon={<Chip label={allorders} color="primary" variant="light" size="small" />}
|
||||||
/>
|
/>
|
||||||
|
{/* <Tab label="Created"
|
||||||
|
icon={<Chip label={modified} color="primary" variant="light" size="small" />}
|
||||||
|
iconPosition="end"
|
||||||
|
/> */}
|
||||||
<Tab label="Pending"
|
<Tab label="Pending"
|
||||||
icon={<Chip label={uncoveredorders} color="primary" variant="light" size="small" />}
|
icon={<Chip label={uncoveredorders} color="primary" variant="light" size="small" />}
|
||||||
iconPosition="end"
|
iconPosition="end"
|
||||||
|
|||||||
Reference in New Issue
Block a user