14122023
This commit is contained in:
@@ -167,27 +167,21 @@ const Accountsettings = () => {
|
||||
|
||||
<Grid item xs={12} >
|
||||
<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'
|
||||
}}
|
||||
>
|
||||
// title={ <Stack direction="row" alignItems="center" spacing={1} justifyContent="flex-start">
|
||||
// <Avatar
|
||||
// alt=""
|
||||
// size="sm"
|
||||
// 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>}
|
||||
// </Avatar>
|
||||
// <Stack direction="column">
|
||||
// <Typography variant="caption">{info.companyname}</Typography>
|
||||
// </Stack>
|
||||
// </Stack>}
|
||||
>
|
||||
<List sx={{ py: 0 }}>
|
||||
<ListItem divider={!matchDownMD}>
|
||||
@@ -199,11 +193,28 @@ const Accountsettings = () => {
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} md={6}>
|
||||
|
||||
<Stack spacing={0.5}>
|
||||
<Typography color="secondary">Company Name</Typography>
|
||||
<Typography>{info.companyname || ''}</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</ListItem>
|
||||
<ListItem divider={!matchDownMD}>
|
||||
<Grid container spacing={3}>
|
||||
<Grid item xs={12} md={6}>
|
||||
<Stack spacing={0.5}>
|
||||
<Typography color="secondary">Registration No</Typography>
|
||||
<Typography>{info.registrationno || ''}</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} md={6}>
|
||||
<Stack spacing={0.5}>
|
||||
<Typography color="secondary">Info</Typography>
|
||||
<Typography>{info.info || ''}</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</ListItem>
|
||||
<ListItem divider={!matchDownMD}>
|
||||
@@ -266,13 +277,13 @@ const Accountsettings = () => {
|
||||
</List>
|
||||
</MainCard>
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
{/* <Grid item xs={12}>
|
||||
<MainCard title="Info">
|
||||
<Typography color="secondary">
|
||||
{info.info || ''}
|
||||
</Typography>
|
||||
</MainCard>
|
||||
</Grid>
|
||||
</Grid> */}
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
@@ -10,7 +10,17 @@ import { useState, Fragment } from 'react';
|
||||
// import AccessTimeOutlinedIcon from '@mui/icons-material/AccessTimeOutlined';
|
||||
// import CustomerCard from 'sections/apps/customer/CustomerCard';
|
||||
// import CustomerCardPage from 'pages/apps/customer/card';
|
||||
import { DeleteFilled, NotificationOutlined } from '@ant-design/icons';
|
||||
import { usePlacesWidget } from "react-google-autocomplete";
|
||||
import Autocomplete from "react-google-autocomplete";
|
||||
import { Autocomplete as Autocomplete1 } from '@mui/material';
|
||||
import Geocode from "react-geocode";
|
||||
|
||||
|
||||
import {
|
||||
DeleteFilled,
|
||||
NotificationOutlined,
|
||||
// EditTwoTone,
|
||||
} from '@ant-design/icons';
|
||||
import { Empty } from 'antd';
|
||||
|
||||
import {
|
||||
@@ -43,14 +53,18 @@ import {
|
||||
// TableSortLabel,
|
||||
TableRow,
|
||||
Tooltip,
|
||||
// List,
|
||||
// ListItem,
|
||||
// ListItemIcon,
|
||||
List,
|
||||
ListItem,
|
||||
ListItemIcon,
|
||||
FormControl,
|
||||
OutlinedInput,
|
||||
InputAdornment,
|
||||
Popper,
|
||||
ClickAwayListener,
|
||||
InputLabel,
|
||||
TextField,
|
||||
Select,
|
||||
MenuItem,
|
||||
// Tooltip,
|
||||
// Badge,
|
||||
// Avatar
|
||||
@@ -78,6 +92,7 @@ import {
|
||||
// PhoneOutlined,
|
||||
// // EditTwoTone,
|
||||
DeleteTwoTone,
|
||||
EditTwoTone,
|
||||
CheckCircleOutlined,
|
||||
MoreOutlined
|
||||
|
||||
@@ -353,11 +368,118 @@ const Client = () => {
|
||||
const [loading1, setLoading1] = useState(false);
|
||||
const [staffdetaillist, setStaffdetaillist] = useState([]);
|
||||
const [anchorEl, setAnchorEl] = React.useState(null);
|
||||
const [currentcustomerid, setCurrentcustomerid] = useState('')
|
||||
const [currentcustomerid, setCurrentcustomerid] = useState('');
|
||||
|
||||
const [businessname, setBusinessname] = useState('');
|
||||
const [businessno, setBusinessno] = useState('');
|
||||
// const [role, setRole] = useState('');
|
||||
const [mobilenumber, setMobilenumber] = useState('')
|
||||
const [emailaddress, setEmailaddress] = useState('')
|
||||
const [city, setCity] = useState('')
|
||||
const [zipcode, setZipcode] = useState('');
|
||||
const [address, setAddress] = useState('');
|
||||
const [state, setState] = useState('');
|
||||
const [suburb, setSuburb] = useState('');
|
||||
const [latlong, setLatlong] = useState({});
|
||||
const [profiledetails, setProfiledetails] = useState({});
|
||||
const [primarycontact, setPrimarycontact] = useState('')
|
||||
const [firstname, setFirstname] = useState('');
|
||||
const [doorno, setDoorno] = useState('');
|
||||
const [landmark, setLandmark] = useState('');
|
||||
const [tenantinfo, setTenantinfo] = useState({});
|
||||
Geocode.setApiKey(process.env.REACT_APP_GOOGLE_MAPS_API_KEY);
|
||||
|
||||
const handleClickAway = () => {
|
||||
setOpen('');
|
||||
};
|
||||
useEffect(()=>{
|
||||
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)
|
||||
})
|
||||
}
|
||||
if(localStorage.getItem('tenantid')){
|
||||
fetchtenantinfo(localStorage.getItem('tenantid'))
|
||||
}
|
||||
},[])
|
||||
|
||||
useEffect(() => {
|
||||
try {
|
||||
Geocode.fromAddress(address).then(
|
||||
(response) => {
|
||||
if (response.status == 'OK') {
|
||||
|
||||
|
||||
const { lat, lng } = response.results[0].geometry.location;
|
||||
setLatlong({
|
||||
lat, lng
|
||||
})
|
||||
console.log(response);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}, (error) => {
|
||||
console.log(error)
|
||||
}
|
||||
);
|
||||
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
|
||||
}
|
||||
|
||||
}, [address])
|
||||
|
||||
const { ref: materialRef } = usePlacesWidget({
|
||||
apiKey: process.env.REACT_APP_GOOGLE_MAPS_API_KEY,
|
||||
onPlaceSelected: (place) => {
|
||||
|
||||
console.log(place)
|
||||
|
||||
setAddress(place.formatted_address)
|
||||
let city1, zipcode1, state1, suburb1;
|
||||
for (let i = 0; i < place.address_components.length; i++) {
|
||||
for (let j = 0; j < place.address_components[i].types.length; j++) {
|
||||
switch (place.address_components[i].types[j]) {
|
||||
case "locality":
|
||||
city1 = place.address_components[i].long_name;
|
||||
break;
|
||||
case "administrative_area_level_1":
|
||||
state1 = place.address_components[i].long_name;
|
||||
break;
|
||||
case "postal_code":
|
||||
zipcode1 = place.address_components[i].long_name;
|
||||
break;
|
||||
case "sublocality":
|
||||
suburb1 = place.address_components[i].long_name;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
setCity(city1 || '')
|
||||
setState(state1 || '');
|
||||
setZipcode(zipcode1 || '');
|
||||
setSuburb(suburb1 || '')
|
||||
|
||||
// setAddress(place.formatted_address)
|
||||
},
|
||||
// inputAutocompleteValue: "country",
|
||||
options: {
|
||||
// componentRestrictions: 'us',
|
||||
// types: ["establishment"]
|
||||
types: ['address' || 'geocode']
|
||||
},
|
||||
});
|
||||
// const fetchstafflog = async (uid, sid) => {
|
||||
// setLoading1(true)
|
||||
// try {
|
||||
@@ -494,6 +616,98 @@ const Client = () => {
|
||||
}
|
||||
}
|
||||
|
||||
const updateclient = async (sid) => {
|
||||
console.log({
|
||||
"customerid": 1364,
|
||||
"configid": 1,
|
||||
"firstname": firstname,
|
||||
"applocationid":tenantinfo.applolcationid,
|
||||
"profileimage": "",
|
||||
"dialcode": "+91",
|
||||
"contactno": mobilenumber,
|
||||
"devicetype": "",
|
||||
"deviceid": "",
|
||||
// "customertoken": "123",
|
||||
"address":address,
|
||||
"suburb": suburb,
|
||||
"city": city,
|
||||
"state": state,
|
||||
"postcode": zipcode,
|
||||
"landmark": landmark,
|
||||
"doorno": doorno,
|
||||
"latitude": latlong.lat.toString(),
|
||||
"longitude": latlong.lng.toString(),
|
||||
"tenantid": parseInt(localStorage.getItem('tenantid')),
|
||||
//email,regno,tenantname
|
||||
})
|
||||
setLoading(true)
|
||||
try {
|
||||
// await axios.get(`${process.env.REACT_APP_URL2}/orders/getorderprocessbystatus`)
|
||||
await axios.put(`${process.env.REACT_APP_URL}/staffs/earnings/update12`,
|
||||
{
|
||||
"customerid": 1364,
|
||||
"configid": 1,
|
||||
"firstname": firstname,
|
||||
"applocationid":tenantinfo.applolcationid,
|
||||
"profileimage": "",
|
||||
"dialcode": "+91",
|
||||
"contactno": mobilenumber,
|
||||
"devicetype": "",
|
||||
"deviceid": "",
|
||||
// "customertoken": "123",
|
||||
"address":address,
|
||||
"suburb": suburb,
|
||||
"city": city,
|
||||
"state": state,
|
||||
"postcode": zipcode,
|
||||
"landmark": landmark,
|
||||
"doorno": doorno,
|
||||
"latitude": latlong.lat.toString(),
|
||||
"longitude": latlong.lng.toString(),
|
||||
"tenantid": parseInt(localStorage.getItem('tenantid')),
|
||||
//email,regno,tenantname
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
.then((res) => {
|
||||
console.log(res)
|
||||
if (res.data.status) {
|
||||
// let arr = []
|
||||
// res.data.Details.map((val, i) => {
|
||||
// arr = [...arr, { ...val, sno: i + 1 }];
|
||||
// })
|
||||
// // setArr(arr)
|
||||
// setRows(arr)
|
||||
// console.log(res.data.Details)
|
||||
// console.log(arr)
|
||||
// setLoading(false)
|
||||
enqueueSnackbar("Updated Successfully", {
|
||||
variant: 'success', anchorOrigin: { vertical: 'top', horizontal: 'right' },
|
||||
autoHideDuration: 2000
|
||||
})
|
||||
// setTimeout(() => {
|
||||
|
||||
// if (localStorage.getItem('appuserid')) {
|
||||
// fetchtable(localStorage.getItem('appuserid'))
|
||||
|
||||
// }
|
||||
|
||||
// }, 2000)
|
||||
}
|
||||
|
||||
}).catch((err) => {
|
||||
console.log(err)
|
||||
setLoading(false)
|
||||
})
|
||||
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
setLoading(false)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const handleRequestSort = (event, property) => {
|
||||
const isAsc = orderBy === property && order === 'asc';
|
||||
@@ -1070,6 +1284,25 @@ const Client = () => {
|
||||
<DeleteTwoTone twoToneColor={theme.palette.error.main} />
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
{(false) &&
|
||||
|
||||
|
||||
<IconButton onClick={() => {
|
||||
setFirstname(row.firstname);
|
||||
setAddress(row.address)
|
||||
setMobilenumber(row.contactno)
|
||||
// setEmailaddress(row.)
|
||||
setSuburb(row.suburb)
|
||||
setCity(row.city)
|
||||
setState(row.state)
|
||||
setZipcode(row.postcode)
|
||||
setDoorno(row.doorno)
|
||||
setLandmark(row.landmark)
|
||||
setExpandopen((expandopen === row.sno) ? '' : row.sno)
|
||||
}}>
|
||||
<EditTwoTone />
|
||||
</IconButton>
|
||||
}
|
||||
</TableCell>
|
||||
|
||||
</TableRow>
|
||||
@@ -1078,275 +1311,240 @@ const Client = () => {
|
||||
<Collapse in={(expandopen === row.sno)} timeout="auto" unmountOnExit >
|
||||
<Grid container sx={{ width: '100%' }}>
|
||||
<Grid item sx={{ width: '100%', m: 1 }}>
|
||||
<MainCard title='Staffs'>
|
||||
|
||||
{/* <TableContainer>
|
||||
<Table sx={{ p: 2 }}>
|
||||
<TableHead>
|
||||
<TableRow>
|
||||
<TableCell>Contact Name</TableCell>
|
||||
<TableCell>Contact No</TableCell>
|
||||
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
|
||||
<TableBody>
|
||||
{(row.ordercontacts.map((val) => {
|
||||
return <>
|
||||
<TableRow>
|
||||
<TableCell>{val.contactname}</TableCell>
|
||||
<TableCell>{val.contactno}</TableCell>
|
||||
</TableRow>
|
||||
</>
|
||||
}))
|
||||
|
||||
}
|
||||
|
||||
</TableBody>
|
||||
</Table>
|
||||
|
||||
</TableContainer> */}
|
||||
|
||||
{(loading1) ?
|
||||
<>
|
||||
|
||||
|
||||
<Stack alignItems={'center'}>
|
||||
<CircularProgress />
|
||||
<MainCard
|
||||
title="Details"
|
||||
sx={{ height: '100%' }}>
|
||||
<Grid container spacing={1}>
|
||||
{/* <Grid item xs={12} sm={6}>
|
||||
<Stack spacing={1.25}>
|
||||
<InputLabel htmlFor="personal-first-name">Business Name</InputLabel>
|
||||
<TextField fullWidth
|
||||
id="personal-first-name" placeholder="Business Name" autoFocus
|
||||
onChange={(e) => setBusinessname(e.target.value)}
|
||||
value={businessname}
|
||||
autoComplete='off'
|
||||
/>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack spacing={1.25}>
|
||||
<InputLabel htmlFor="personal-last-name">Registration No</InputLabel>
|
||||
<TextField fullWidth
|
||||
id="personal-last-name" placeholder="Registration No"
|
||||
onChange={(e) => setBusinessno(e.target.value)}
|
||||
value={businessno}
|
||||
autoComplete='off'
|
||||
|
||||
</>
|
||||
/>
|
||||
</Stack>
|
||||
</Grid> */}
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack spacing={1.25}>
|
||||
<InputLabel htmlFor="personal-last-name">Admin Name</InputLabel>
|
||||
<TextField fullWidth
|
||||
id="personal-last-name" placeholder="Name"
|
||||
onChange={(e) => setFirstname(e.target.value)}
|
||||
value={firstname}
|
||||
autoComplete='off'
|
||||
|
||||
:
|
||||
/>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}
|
||||
>
|
||||
<Stack spacing={1.25} >
|
||||
<InputLabel htmlFor="personal-phone">Phone Number</InputLabel>
|
||||
<Stack direction="row" justifyContent="space-between" alignItems="center"
|
||||
spacing={2}>
|
||||
<Select defaultValue="+1" disabled sx={{ cursor: 'not-allowed' }}>
|
||||
<MenuItem value="+1">+91</MenuItem>
|
||||
|
||||
<TableContainer>
|
||||
<Table>
|
||||
<TableHead>
|
||||
<TableRow>
|
||||
<TableCell>#</TableCell>
|
||||
<TableCell>Staff</TableCell>
|
||||
<TableCell>Start Time</TableCell>
|
||||
<TableCell>End Time</TableCell>
|
||||
{/* <TableCell>Pay Rate</TableCell> */}
|
||||
</Select>
|
||||
<TextField
|
||||
type='number'
|
||||
id='personal-phone'
|
||||
// format="##########"
|
||||
// mask="_"
|
||||
fullWidth
|
||||
// customInput={TextField}
|
||||
placeholder="Phone Number"
|
||||
// defaultValue="8654239581"
|
||||
// onBlur={() => { }}
|
||||
onChange={(e) => {
|
||||
if (e.target.value.toString().length <= 10) {
|
||||
setMobilenumber(e.target.value)
|
||||
}
|
||||
}}
|
||||
value={mobilenumber}
|
||||
autoComplete='off'
|
||||
// disabled
|
||||
sx={{ cursor: 'not-allowed' }}
|
||||
/>
|
||||
</Stack>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12}
|
||||
sm={6}
|
||||
>
|
||||
<Stack spacing={1.25}>
|
||||
<InputLabel htmlFor="personal-email">Email Address</InputLabel>
|
||||
<TextField type="email" fullWidth
|
||||
// defaultValue="stebin.ben@gmail.com"
|
||||
id="personal-email" placeholder="Email Address"
|
||||
onChange={(e) => setEmailaddress(e.target.value)}
|
||||
value={emailaddress}
|
||||
autoComplete='off'
|
||||
|
||||
{/* <TableCell>Category</TableCell> */}
|
||||
<TableCell align='center'>Clockin</TableCell>
|
||||
<TableCell align='center'>Clockout</TableCell>
|
||||
<TableCell>Actual Hrs</TableCell>
|
||||
|
||||
<TableCell>Hrs Worked</TableCell>
|
||||
|
||||
<TableCell>OT</TableCell>
|
||||
|
||||
<TableCell>Deficit</TableCell>
|
||||
|
||||
{/* <TableCell>Experience</TableCell> */}
|
||||
|
||||
{/* <TableCell>Level</TableCell> */}
|
||||
{/* <TableCell>City</TableCell> */}
|
||||
<TableCell>Status</TableCell>
|
||||
<TableCell>Action</TableCell>
|
||||
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
<TableBody>
|
||||
{/* {row.ordeprocessInfo.map((val, i) => { */}
|
||||
{staffdetaillist.map((val, i) => {
|
||||
|
||||
return <Fragment key={i}>
|
||||
/>
|
||||
</Stack>
|
||||
</Grid>
|
||||
|
||||
|
||||
<TableRow sx={{
|
||||
// backgroundColor: (staffarr.find((res) => res.userid == val.userid)) ? '#f5f5f5' : '', ':hover': {
|
||||
// backgroundColor: (staffarr.find((res) => res.userid == val.userid)) ? '#f5f5f5 !important' : ''
|
||||
// }
|
||||
}}>
|
||||
<TableCell component="th"
|
||||
scope="row" padding="none">
|
||||
{i + 1}
|
||||
</TableCell>
|
||||
<Grid item xs={12}>
|
||||
<Stack spacing={1.25}>
|
||||
<InputLabel htmlFor="personal-address">Address</InputLabel>
|
||||
<Autocomplete
|
||||
className='automap'
|
||||
apiKey={process.env.REACT_APP_GOOGLE_MAPS_API_KEY}
|
||||
style={{
|
||||
width: "100%", height: '40px', borderRadius: '5px',
|
||||
border: '1px solid #e0e0e0', textIndent: '10px', outline: 'none',
|
||||
// ':hover': {
|
||||
// border: '1px solid #00b0ff !important',
|
||||
// backgroundColor:'blue'
|
||||
// }
|
||||
}}
|
||||
onPlaceSelected={(place) => {
|
||||
setAddress(place.formatted_address)
|
||||
let city1, state, zipcode1, suburb1;
|
||||
for (let i = 0; i < place.address_components.length; i++) {
|
||||
for (let j = 0; j < place.address_components[i].types.length; j++) {
|
||||
switch (place.address_components[i].types[j]) {
|
||||
case "locality":
|
||||
city1 = place.address_components[i].long_name;
|
||||
break;
|
||||
case "administrative_area_level_1":
|
||||
state = place.address_components[i].long_name;
|
||||
break;
|
||||
case "postal_code":
|
||||
zipcode1 = place.address_components[i].long_name;
|
||||
break;
|
||||
case "sublocality":
|
||||
suburb1 = place.address_components[i].long_name;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
setCity(city1 || '')
|
||||
setState(state || '');
|
||||
setZipcode(zipcode1 || '');
|
||||
setSuburb(suburb1 || '')
|
||||
}}
|
||||
options={{
|
||||
|
||||
<TableCell align="left">
|
||||
<Stack direction="column">
|
||||
<Typography variant="caption">
|
||||
{val.staffname}
|
||||
</Typography>
|
||||
<Grid>
|
||||
<Chip label={val.productname} color="info" variant="light" size="small" />
|
||||
</Grid>
|
||||
</Stack>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<Stack direction="column">
|
||||
<Typography variant="body2">{dayjs(val.starttime)
|
||||
// .utc()
|
||||
.format('MM/DD/YYYY')}</Typography>
|
||||
<Typography variant="caption">{dayjs(val.starttime)
|
||||
// .utc()
|
||||
.format('hh:mm A')}</Typography>
|
||||
</Stack>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<Stack direction="column">
|
||||
<Typography variant="body2">{dayjs(val.endtime)
|
||||
// .utc()
|
||||
.format('MM/DD/YYYY')}</Typography>
|
||||
<Typography variant="caption">{dayjs(val.endtime)
|
||||
// .utc()
|
||||
.format('hh:mm A')}</Typography>
|
||||
</Stack>
|
||||
</TableCell>
|
||||
{/* <TableCell>{val.rolecost}</TableCell> */}
|
||||
types: ['address' || 'geocode']
|
||||
|
||||
}}
|
||||
placeholder='Address'
|
||||
value={address}
|
||||
onChange={(e) => setAddress(e.target.value)}
|
||||
|
||||
/>
|
||||
</Stack>
|
||||
</Grid>
|
||||
|
||||
<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" />
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack spacing={1.25}>
|
||||
<InputLabel htmlFor="personal-location">Suburb</InputLabel>
|
||||
<TextField fullWidth
|
||||
// defaultValue="New York"
|
||||
id="personal-location" placeholder="Location"
|
||||
onChange={(e) => setSuburb(e.target.value)}
|
||||
value={suburb}
|
||||
autoComplete='off'
|
||||
|
||||
</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>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack spacing={1.25}>
|
||||
<InputLabel htmlFor="personal-zipcode">City</InputLabel>
|
||||
<TextField fullWidth
|
||||
// defaultValue="956754"
|
||||
// type='number'
|
||||
id="personal-zipcode" placeholder="City"
|
||||
onChange={(e) => setCity(e.target.value)}
|
||||
value={city}
|
||||
autoComplete='off'
|
||||
|
||||
</Stack>
|
||||
</TableCell>
|
||||
<TableCell>{val.workhours}</TableCell>
|
||||
<TableCell>
|
||||
{val.hoursworked}
|
||||
</TableCell>
|
||||
<TableCell>{val.overtime}</TableCell>
|
||||
<TableCell>{val.shorttime}</TableCell>
|
||||
/>
|
||||
</Stack>
|
||||
</Grid>
|
||||
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack spacing={1.25}>
|
||||
<InputLabel htmlFor="personal-location">State</InputLabel>
|
||||
<TextField fullWidth
|
||||
// defaultValue="New York"
|
||||
id="personal-location" placeholder="State"
|
||||
onChange={(e) => setState(e.target.value)}
|
||||
value={state}
|
||||
autoComplete='off'
|
||||
|
||||
/>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack spacing={1.25}>
|
||||
<InputLabel htmlFor="personal-zipcode">Post Code</InputLabel>
|
||||
<TextField fullWidth
|
||||
// defaultValue="956754"
|
||||
type='number'
|
||||
id="personal-zipcode" placeholder="Zipcode"
|
||||
onChange={(e) => setZipcode(e.target.value)}
|
||||
value={zipcode}
|
||||
autoComplete='off'
|
||||
|
||||
<TableCell align="left">
|
||||
<Stack direction="row">
|
||||
/>
|
||||
</Stack>
|
||||
</Grid>
|
||||
|
||||
{(val.orderstatus === 'pending') &&
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack spacing={1.25}>
|
||||
<InputLabel htmlFor="personal-location">Door No</InputLabel>
|
||||
<TextField fullWidth
|
||||
// defaultValue="New York"
|
||||
id="personal-location" placeholder="Door No"
|
||||
onChange={(e) => setDoorno(e.target.value)}
|
||||
value={doorno}
|
||||
autoComplete='off'
|
||||
|
||||
<Chip label="Pending" color="error" size="small" />
|
||||
}
|
||||
{(val.orderstatus === 'cancelled') &&
|
||||
/>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack spacing={1.25}>
|
||||
<InputLabel htmlFor="personal-email">Landmark</InputLabel>
|
||||
<TextField type="email" fullWidth
|
||||
// defaultValue="stebin.ben@gmail.com"
|
||||
id="personal-email" placeholder="Landmark"
|
||||
onChange={(e) => setLandmark(e.target.value)}
|
||||
value={landmark}
|
||||
autoComplete='off'
|
||||
|
||||
|
||||
<Chip label="Cancelled" color="secondary" size="small" />
|
||||
}
|
||||
{(val.orderstatus === 'completed') &&
|
||||
|
||||
<Chip label="Completed" color="primary" size="small" />
|
||||
}
|
||||
{(val.orderstatus === 'processing') &&
|
||||
<Chip label="Processing" color="primary" size="small" />
|
||||
}
|
||||
{(val.orderstatus === 'assigned') &&
|
||||
<Chip label="Assigned" color="warning" size="small" />
|
||||
}
|
||||
{(val.orderstatus === 'confirmed') &&
|
||||
<Chip label="Confirmed" color="success" size="small" />
|
||||
}
|
||||
|
||||
{(val.orderstatus === 'active') &&
|
||||
<Chip label="Active" color="info" size="small" />
|
||||
}
|
||||
{(val.orderstatus === 'closed') &&
|
||||
<Chip label="Closed" color="info" size="small" />
|
||||
}
|
||||
</Stack>
|
||||
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
|
||||
|
||||
<Stack direction='row'>
|
||||
{((val.verified == 0) && (val.orderstatus === 'completed')) &&
|
||||
<>
|
||||
|
||||
|
||||
<IconButton
|
||||
// onClick={(e) => handleClick1(e, row.sno)}
|
||||
onClick={(e) => {
|
||||
setOpen(i + 1)
|
||||
setAnchorEl(e.currentTarget);
|
||||
}}
|
||||
aria-describedby={`aria-${row.sno}`}
|
||||
>
|
||||
<MoreOutlined />
|
||||
</IconButton>
|
||||
|
||||
<Popper id={`aria-${row.sno}`} open={(open == (i + 1))}
|
||||
anchorEl={anchorEl}
|
||||
placement='bottom-end'
|
||||
sx={{
|
||||
zIndex: 5000,
|
||||
p: 0
|
||||
}}
|
||||
>
|
||||
|
||||
<Box sx={{ backgroundColor: '#fff', px: 2, py: 1, cursor: 'pointer', boxShadow: theme.customShadows.z1 }}
|
||||
onClick={() => {
|
||||
|
||||
// setApproveid(true)
|
||||
// setDisableid(false)
|
||||
|
||||
// setExpandopen('')
|
||||
// setRolestab(0)
|
||||
staffearningsverify(val.staffearningsid)
|
||||
// fetchclientbyid(row.tenantid, row.sno);
|
||||
// fetchclientpricing(row.tenantid)
|
||||
// setEditexpandopen(row.sno)
|
||||
|
||||
handleClickAway()
|
||||
}}
|
||||
>
|
||||
<ClickAwayListener onClickAway={handleClickAway}>
|
||||
|
||||
<Typography>Verify</Typography>
|
||||
|
||||
</ClickAwayListener>
|
||||
</Box>
|
||||
|
||||
|
||||
</Popper>
|
||||
</>
|
||||
}
|
||||
|
||||
{(val.verified == 1) &&
|
||||
|
||||
<>
|
||||
<Tooltip title='Verified' >
|
||||
<IconButton
|
||||
>
|
||||
|
||||
<CheckCircleOutlined
|
||||
style={{ color: '#4caf50' }}
|
||||
|
||||
/>
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
|
||||
</>
|
||||
|
||||
}
|
||||
</Stack>
|
||||
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
</Fragment>
|
||||
|
||||
})
|
||||
}
|
||||
</TableBody>
|
||||
</Table>
|
||||
</TableContainer>
|
||||
}
|
||||
/>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<Stack direction={'row'} justifyContent={'flex-end'} sx={{width:'100%'}}>
|
||||
<Button variant='contained' onClick={()=>{
|
||||
updateclient()
|
||||
}}>Update</Button>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</MainCard>
|
||||
</Grid></Grid>
|
||||
</Collapse>
|
||||
|
||||
@@ -62,13 +62,13 @@ const Createclient = () => {
|
||||
const [suburb, setSuburb] = useState('');
|
||||
const [latlong, setLatlong] = useState({});
|
||||
const [profiledetails, setProfiledetails] = useState({});
|
||||
const [primarycontact,setPrimarycontact]=useState('')
|
||||
const [firstname,setFirstname]=useState('');
|
||||
const [doorno,setDoorno]=useState('');
|
||||
const [landmark,setLandmark]=useState('');
|
||||
const [primarycontact, setPrimarycontact] = useState('')
|
||||
const [firstname, setFirstname] = useState('');
|
||||
const [doorno, setDoorno] = useState('');
|
||||
const [landmark, setLandmark] = useState('');
|
||||
const [tenantinfo, setTenantinfo] = useState({});
|
||||
|
||||
|
||||
|
||||
|
||||
const navigate = useNavigate();
|
||||
|
||||
@@ -81,7 +81,7 @@ const Createclient = () => {
|
||||
useEffect(() => {
|
||||
// fetchprofiledetails(localStorage.getItem('appuserid'));
|
||||
// fetchprofiledetails(181);
|
||||
if(localStorage.getItem('tenantid')){
|
||||
if (localStorage.getItem('tenantid')) {
|
||||
fetchtenantinfo(localStorage.getItem('tenantid'))
|
||||
}
|
||||
}, [])
|
||||
@@ -106,7 +106,7 @@ const Createclient = () => {
|
||||
console.log(error)
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
|
||||
@@ -193,7 +193,7 @@ const Createclient = () => {
|
||||
console.log(place)
|
||||
|
||||
setAddress(place.formatted_address)
|
||||
let city1, zipcode1, state1,suburb1;
|
||||
let city1, zipcode1, state1, suburb1;
|
||||
for (let i = 0; i < place.address_components.length; i++) {
|
||||
for (let j = 0; j < place.address_components[i].types.length; j++) {
|
||||
switch (place.address_components[i].types[j]) {
|
||||
@@ -232,17 +232,17 @@ const Createclient = () => {
|
||||
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 (!businessno) {
|
||||
opentoast('Fill Registration No')
|
||||
} else if (!firstname) {
|
||||
// if (!businessname) {
|
||||
// opentoast('Fill Business name')
|
||||
// } else if (!businessno) {
|
||||
// opentoast('Fill Registration No')
|
||||
// }
|
||||
// else
|
||||
if (!firstname) {
|
||||
opentoast('Fill Full name')
|
||||
} else if (!mobilenumber) {
|
||||
} else if (!mobilenumber) {
|
||||
opentoast('Fill Mobile Number')
|
||||
}else if (!emailaddress) {
|
||||
} else if (!emailaddress) {
|
||||
opentoast('Fill emailaddress')
|
||||
} else if (!address) {
|
||||
opentoast('Fill Address')
|
||||
@@ -250,45 +250,46 @@ const Createclient = () => {
|
||||
opentoast('Fill City')
|
||||
} else if (!zipcode) {
|
||||
opentoast('Fill post code')
|
||||
} else if (!suburb) {
|
||||
} else if (!suburb) {
|
||||
opentoast('Fill suburb')
|
||||
} else if (!emailaddress) {
|
||||
opentoast('Fill emailaddress')
|
||||
} else if (!latlong.lat || !latlong.lng) {
|
||||
opentoast('Choose valid address')
|
||||
} else {
|
||||
let obj={
|
||||
"customerid":0,
|
||||
"configid":1,
|
||||
"firstname":firstname,
|
||||
"applocationid":tenantinfo.applolcationid,
|
||||
"profileimage":"",
|
||||
"dialcode":"+91",
|
||||
"contactno":mobilenumber,
|
||||
"devicetype":"",
|
||||
"deviceid":"",
|
||||
"customertoken":"",
|
||||
"address":address,
|
||||
"suburb":suburb,
|
||||
"city":city,
|
||||
"state":state,
|
||||
"postcode":zipcode,
|
||||
"landmark":landmark,
|
||||
"doorno":doorno,
|
||||
"latitude":latlong.lat.toString(),
|
||||
"longitude":latlong.lng.toString(),
|
||||
"tenantid":parseInt(localStorage.getItem('tenantid'))
|
||||
} else {
|
||||
let obj = {
|
||||
"customerid": 0,
|
||||
"configid": 1,
|
||||
"firstname": firstname,
|
||||
"applocationid": tenantinfo.applolcationid,
|
||||
"profileimage": "",
|
||||
"dialcode": "+91",
|
||||
"contactno": mobilenumber,
|
||||
"devicetype": "",
|
||||
"deviceid": "",
|
||||
"customertoken": "",
|
||||
"address": address,
|
||||
"suburb": suburb,
|
||||
"city": city,
|
||||
"state": state,
|
||||
"postcode": zipcode,
|
||||
"landmark": landmark,
|
||||
"doorno": doorno,
|
||||
"latitude": latlong.lat.toString(),
|
||||
"longitude": latlong.lng.toString(),
|
||||
"tenantid": parseInt(localStorage.getItem('tenantid')),
|
||||
"email" : emailaddress
|
||||
}
|
||||
|
||||
|
||||
console.log(obj)
|
||||
|
||||
setLoading(true)
|
||||
try {
|
||||
await axios.post(`${process.env.REACT_APP_URL}/customers/create`,obj)
|
||||
await axios.post(`${process.env.REACT_APP_URL}/customers/create`, obj)
|
||||
.then((res) => {
|
||||
console.log(res)
|
||||
if (res.data.status) {
|
||||
|
||||
|
||||
enqueueSnackbar(' Created Successfully ', {
|
||||
variant: 'success', anchorOrigin: { vertical: 'top', horizontal: 'right' },
|
||||
autoHideDuration: 2000
|
||||
@@ -298,7 +299,7 @@ const Createclient = () => {
|
||||
// fetchprofiledetails(localStorage.getItem('appuserid'));
|
||||
|
||||
// },2000)
|
||||
}else if(res.data.message == "Customer Already available"){
|
||||
} else if (res.data.message == "Customer Already available") {
|
||||
enqueueSnackbar("Customer Already available", {
|
||||
variant: 'error', anchorOrigin: { vertical: 'top', horizontal: 'right' },
|
||||
autoHideDuration: 2000
|
||||
@@ -307,7 +308,7 @@ const Createclient = () => {
|
||||
setLoading(false)
|
||||
}).catch((err) => {
|
||||
console.log(err)
|
||||
|
||||
|
||||
setLoading(false)
|
||||
enqueueSnackbar(err.message, {
|
||||
variant: 'error', anchorOrigin: { vertical: 'top', horizontal: 'right' },
|
||||
@@ -341,7 +342,7 @@ const Createclient = () => {
|
||||
</Grid>
|
||||
<MainCard>
|
||||
<Grid container spacing={3}>
|
||||
<Grid item xs={12} sm={4} >
|
||||
{/* <Grid item xs={12} sm={4} >
|
||||
<MainCard title="Personal Information" sx={{ height: '100%' }}>
|
||||
<Grid container spacing={3}>
|
||||
<Grid item xs={12}>
|
||||
@@ -398,44 +399,18 @@ const Createclient = () => {
|
||||
|
||||
<Grid item xs={12}
|
||||
>
|
||||
<Stack spacing={1.25}>
|
||||
<InputLabel htmlFor="personal-first-name">Business Name</InputLabel>
|
||||
<TextField fullWidth
|
||||
id="personal-first-name" placeholder="Business Name" autoFocus
|
||||
onChange={(e) => setBusinessname(e.target.value)}
|
||||
value={businessname}
|
||||
autoComplete='off'
|
||||
/>
|
||||
</Stack>
|
||||
|
||||
</Grid>
|
||||
<Grid item xs={12}
|
||||
>
|
||||
<Stack spacing={1.25}>
|
||||
<InputLabel htmlFor="personal-last-name">Registration No</InputLabel>
|
||||
<TextField fullWidth
|
||||
id="personal-last-name" placeholder="Registration No"
|
||||
onChange={(e) => setBusinessno(e.target.value)}
|
||||
value={businessno}
|
||||
autoComplete='off'
|
||||
|
||||
/>
|
||||
</Stack>
|
||||
|
||||
</Grid>
|
||||
<Grid item xs={12}
|
||||
>
|
||||
<Stack spacing={1.25}>
|
||||
<InputLabel htmlFor="personal-last-name">Name</InputLabel>
|
||||
<TextField fullWidth
|
||||
id="personal-last-name" placeholder="Name"
|
||||
onChange={(e) => setFirstname(e.target.value)}
|
||||
value={firstname}
|
||||
autoComplete='off'
|
||||
|
||||
/>
|
||||
</Stack>
|
||||
|
||||
</Grid>
|
||||
|
||||
{/* <Grid item xs={12}
|
||||
<Grid item xs={12}
|
||||
|
||||
>
|
||||
<Stack spacing={1.25}>
|
||||
@@ -449,24 +424,65 @@ const Createclient = () => {
|
||||
|
||||
/>
|
||||
</Stack>
|
||||
</Grid> */}
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
</MainCard>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={8} >
|
||||
</Grid> */}
|
||||
<Grid item xs={12}
|
||||
// sm={8}
|
||||
>
|
||||
|
||||
<MainCard title="Contact Information" sx={{ height: '100%' }}>
|
||||
<MainCard
|
||||
// title="Contact Information"
|
||||
sx={{ height: '100%' }}>
|
||||
<Grid container spacing={3}>
|
||||
<Grid item xs={12}
|
||||
{/* <Grid item xs={12} sm={6}>
|
||||
<Stack spacing={1.25}>
|
||||
<InputLabel htmlFor="personal-first-name">Business Name</InputLabel>
|
||||
<TextField fullWidth
|
||||
id="personal-first-name" placeholder="Business Name" autoFocus
|
||||
onChange={(e) => setBusinessname(e.target.value)}
|
||||
value={businessname}
|
||||
autoComplete='off'
|
||||
/>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack spacing={1.25}>
|
||||
<InputLabel htmlFor="personal-last-name">Registration No</InputLabel>
|
||||
<TextField fullWidth
|
||||
id="personal-last-name" placeholder="Registration No"
|
||||
onChange={(e) => setBusinessno(e.target.value)}
|
||||
value={businessno}
|
||||
autoComplete='off'
|
||||
|
||||
/>
|
||||
</Stack>
|
||||
</Grid> */}
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack spacing={1.25}>
|
||||
<InputLabel htmlFor="personal-last-name">Admin Name</InputLabel>
|
||||
<TextField fullWidth
|
||||
id="personal-last-name" placeholder="Name"
|
||||
onChange={(e) => setFirstname(e.target.value)}
|
||||
value={firstname}
|
||||
autoComplete='off'
|
||||
|
||||
/>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}
|
||||
>
|
||||
<Stack spacing={1.25} >
|
||||
<InputLabel htmlFor="personal-phone">Phone Number</InputLabel>
|
||||
<Stack direction="row" justifyContent="space-between" alignItems="center"
|
||||
spacing={2}>
|
||||
<Select defaultValue="+1" disabled sx={{cursor: 'not-allowed'}}>
|
||||
<Stack direction="row" justifyContent="space-between" alignItems="center"
|
||||
spacing={2}>
|
||||
<Select defaultValue="+1" disabled sx={{ cursor: 'not-allowed' }}>
|
||||
<MenuItem value="+1">+91</MenuItem>
|
||||
|
||||
|
||||
</Select>
|
||||
<TextField
|
||||
type='number'
|
||||
@@ -478,21 +494,21 @@ const Createclient = () => {
|
||||
placeholder="Phone Number"
|
||||
// defaultValue="8654239581"
|
||||
// onBlur={() => { }}
|
||||
onChange={(e) => {
|
||||
if(e.target.value.toString().length <= 10){
|
||||
onChange={(e) => {
|
||||
if (e.target.value.toString().length <= 10) {
|
||||
setMobilenumber(e.target.value)
|
||||
}
|
||||
}}
|
||||
}}
|
||||
value={mobilenumber}
|
||||
autoComplete='off'
|
||||
// disabled
|
||||
sx={{cursor: 'not-allowed'}}
|
||||
sx={{ cursor: 'not-allowed' }}
|
||||
/>
|
||||
</Stack>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12}
|
||||
// sm={6}
|
||||
sm={6}
|
||||
>
|
||||
<Stack spacing={1.25}>
|
||||
<InputLabel htmlFor="personal-email">Email Address</InputLabel>
|
||||
@@ -506,7 +522,7 @@ const Createclient = () => {
|
||||
/>
|
||||
</Stack>
|
||||
</Grid>
|
||||
|
||||
|
||||
|
||||
<Grid item xs={12}>
|
||||
<Stack spacing={1.25}>
|
||||
@@ -578,7 +594,7 @@ const Createclient = () => {
|
||||
/>
|
||||
</Stack>
|
||||
</Grid>
|
||||
|
||||
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack spacing={1.25}>
|
||||
<InputLabel htmlFor="personal-location">Door No</InputLabel>
|
||||
@@ -593,7 +609,7 @@ const Createclient = () => {
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Stack spacing={1.25}>
|
||||
<Stack spacing={1.25}>
|
||||
<InputLabel htmlFor="personal-email">Landmark</InputLabel>
|
||||
<TextField type="email" fullWidth
|
||||
// defaultValue="stebin.ben@gmail.com"
|
||||
@@ -604,7 +620,7 @@ const Createclient = () => {
|
||||
|
||||
/>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</MainCard>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user