Merge remote-tracking branch 'origin/staging' into origin/production
This commit is contained in:
@@ -219,14 +219,14 @@ export default function Drugs() {
|
||||
? appliedParams
|
||||
: Object.fromEntries([...searchParams.entries()]);
|
||||
|
||||
// const claim = await axios.get(`${corporateValue}/members`, {
|
||||
// params: { ...parameters, type: 'claim-report' },
|
||||
// });
|
||||
// const claim = await axios.get(`${corporateValue}/members`, {
|
||||
// params: { ...parameters, type: 'claim-report' },
|
||||
// });
|
||||
|
||||
setSearchParams(parameters);
|
||||
|
||||
// setListAllMemberByClaimStatus(claim.data.data.allMembersByClaimStatus.data);
|
||||
// setPaginationTable(claim.data.data.allMembersByClaimStatus);
|
||||
// setPaginationTable(claim.data.data.allMembersByClaimStatus);
|
||||
|
||||
setIsLoading(false);
|
||||
})();
|
||||
|
||||
@@ -227,12 +227,12 @@ export default function Index() {
|
||||
label: 'Divisi',
|
||||
isSort: true,
|
||||
},
|
||||
{
|
||||
id: 'limit',
|
||||
align: 'center',
|
||||
label: 'Limit',
|
||||
isSort: false,
|
||||
},
|
||||
// {
|
||||
// id: 'limit',
|
||||
// align: 'center',
|
||||
// label: 'Limit',
|
||||
// isSort: false,
|
||||
// },
|
||||
{
|
||||
id: 'status',
|
||||
align: 'center',
|
||||
@@ -280,56 +280,58 @@ export default function Index() {
|
||||
});
|
||||
setDivisionData(corporateDivision.data);
|
||||
setMemberData(
|
||||
corporateMembers.data.data.map((obj: any) => ({
|
||||
...obj,
|
||||
limit: (
|
||||
<Stack>
|
||||
<BorderLinearProgress
|
||||
variant="determinate"
|
||||
value={obj.limit.percentage}
|
||||
sx={{ mb: 1 }}
|
||||
/>
|
||||
<Typography sx={{ typography: 'caption', color: '#637381' }}>
|
||||
{fSplit(obj.limit.current)} / {fSplit(obj.limit.total)}
|
||||
</Typography>
|
||||
</Stack>
|
||||
),
|
||||
status:
|
||||
obj.status === 1 ? (
|
||||
<Button
|
||||
sx={{
|
||||
backgroundColor: 'rgba(84, 214, 44, 0.16)',
|
||||
color: palette.dark.success.dark,
|
||||
paddingY: 0,
|
||||
'&:hover': {
|
||||
backgroundColor: 'rgba(84, 214, 44, 0.32)',
|
||||
color: palette.dark.success.darker,
|
||||
},
|
||||
}}
|
||||
>
|
||||
Active
|
||||
</Button>
|
||||
) : (
|
||||
<Button
|
||||
sx={{
|
||||
backgroundColor: 'rgba(255, 72, 66, 0.16)',
|
||||
color: palette.dark.error.dark,
|
||||
paddingY: 0,
|
||||
'&:hover': {
|
||||
backgroundColor: 'rgba(255, 72, 66, 0.32)',
|
||||
color: palette.dark.error.darker,
|
||||
},
|
||||
}}
|
||||
>
|
||||
Inactive
|
||||
</Button>
|
||||
),
|
||||
/* action: (
|
||||
<IconButton onClick={handleAction}>
|
||||
<MoreVertIcon />
|
||||
</IconButton>
|
||||
), */
|
||||
}))
|
||||
corporateMembers.data.data.map((obj: any) => {
|
||||
return {
|
||||
...obj,
|
||||
// limit: (
|
||||
// <Stack>
|
||||
// <BorderLinearProgress
|
||||
// variant="determinate"
|
||||
// value={obj.limit.percentage}
|
||||
// sx={{ mb: 1 }}
|
||||
// />
|
||||
// <Typography sx={{ typography: 'caption', color: '#637381' }}>
|
||||
// {fSplit(obj.limit.current)} / {fSplit(obj.limit.total)}
|
||||
// </Typography>
|
||||
// </Stack>
|
||||
// ),
|
||||
status:
|
||||
obj.status === 1 ? (
|
||||
<Button
|
||||
sx={{
|
||||
backgroundColor: 'rgba(84, 214, 44, 0.16)',
|
||||
color: palette.dark.success.dark,
|
||||
paddingY: 0,
|
||||
'&:hover': {
|
||||
backgroundColor: 'rgba(84, 214, 44, 0.32)',
|
||||
color: palette.dark.success.darker,
|
||||
},
|
||||
}}
|
||||
>
|
||||
Active
|
||||
</Button>
|
||||
) : (
|
||||
<Button
|
||||
sx={{
|
||||
backgroundColor: 'rgba(255, 72, 66, 0.16)',
|
||||
color: palette.dark.error.dark,
|
||||
paddingY: 0,
|
||||
'&:hover': {
|
||||
backgroundColor: 'rgba(255, 72, 66, 0.32)',
|
||||
color: palette.dark.error.darker,
|
||||
},
|
||||
}}
|
||||
>
|
||||
Inactive
|
||||
</Button>
|
||||
),
|
||||
/* action: (
|
||||
<IconButton onClick={handleAction}>
|
||||
<MoreVertIcon />
|
||||
</IconButton>
|
||||
), */
|
||||
};
|
||||
})
|
||||
);
|
||||
setPaginationTable(corporateMembers.data);
|
||||
setRowsPerPage(corporateMembers.data.per_page);
|
||||
@@ -362,11 +364,11 @@ export default function Index() {
|
||||
|
||||
<Grid container spacing={2}>
|
||||
{/* <Grid item xs={12} lg={6} md={12}>
|
||||
<CardNotification />
|
||||
</Grid> */}
|
||||
<Grid item xs={12} lg={12} md={12}>
|
||||
<CardPolicy data={policyData} />
|
||||
<CardNotification data={itemList} />
|
||||
</Grid>
|
||||
<Grid item xs={12} lg={6} md={12}>
|
||||
<CardPolicy data={policyData} />
|
||||
</Grid> */}
|
||||
<Grid item xs={12} lg={12} md={12}>
|
||||
<Table
|
||||
headCells={headCells}
|
||||
|
||||
@@ -17,6 +17,7 @@ import Typography from '@mui/material/Typography';
|
||||
import TableMoreMenu from '../../components/table/TableMoreMenu';
|
||||
import VisibilityOutlinedIcon from '@mui/icons-material/VisibilityOutlined';
|
||||
import Label from '../../components/Label';
|
||||
import { enqueueSnackbar } from 'notistack';
|
||||
|
||||
export default function List() {
|
||||
const navigate = useNavigate();
|
||||
@@ -103,12 +104,31 @@ export default function List() {
|
||||
|
||||
const searchs = {
|
||||
useSearchs: true,
|
||||
fullWidth: true,
|
||||
searchText: searchText,
|
||||
setSearchText: setSearchText,
|
||||
handleSearchSubmit: handleSearchSubmit,
|
||||
};
|
||||
/* -------------------------------------------------------------------------- */
|
||||
const [startDateValue, setStartDateValue] = useState('');
|
||||
const [endDateValue, setEndDateValue] = useState('');
|
||||
const [statusValue, setStatusValue] = useState('all');
|
||||
|
||||
const handleExportReport = async (appliedFilter = null) => {
|
||||
axios.get(corporateValue + '/export-members/list').then((response) => {
|
||||
const link = document.createElement('a');
|
||||
link.href = response.data.data.file_url;
|
||||
link.setAttribute('download', response.data.data.file_name);
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
// handleClose();
|
||||
});
|
||||
}
|
||||
const exportReport = {
|
||||
useExport: true,
|
||||
startDate: startDateValue,
|
||||
endDate: endDateValue,
|
||||
status: statusValue,
|
||||
handleExportReport: handleExportReport
|
||||
}
|
||||
|
||||
/* -------------------------------- headCell -------------------------------- */
|
||||
const headCells: HeadCell<never>[] = [
|
||||
@@ -222,6 +242,7 @@ export default function List() {
|
||||
params={params}
|
||||
searchs={searchs}
|
||||
// filters={filters}
|
||||
exportReport={exportReport}
|
||||
/>
|
||||
</Stack>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user