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

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>