Merge branch 'staging' of http://itcorp.primaya.id:3000/rajif/aso into staging

This commit is contained in:
Lasteinsa
2023-09-04 13:34:35 +07:00
4 changed files with 158 additions and 86 deletions

View File

@@ -188,7 +188,13 @@ export default function List() {
</LocalizationProvider>
</Grid>
<Grid item xs={12} md={2}>
<Button variant="outlined" fullWidth startIcon={<Add />} sx={{ p: 1.8 }}>
<Button
variant="outlined"
fullWidth
startIcon={<Add />}
sx={{ p: 1.8 }}
onClick={exportExcel}
>
Export
</Button>
</Grid>
@@ -397,6 +403,27 @@ export default function List() {
setDataTableData(response.data);
};
const exportExcel = async () => {
var filter = Object.fromEntries([...searchParams.entries()]);
await axios
.get('live-chat/export', { params: filter })
.then((res) => {
enqueueSnackbar('Data berhasil di Export', {
variant: 'success',
anchorOrigin: { horizontal: 'right', vertical: 'top' },
});
document.location.href = res.data.data.file_url;
})
.catch((err) =>
enqueueSnackbar('Data Gagal di Export', {
variant: 'error',
anchorOrigin: { horizontal: 'right', vertical: 'top' },
})
);
};
// const applyFilter = async (searchFilter: string) => {
// await loadDataTableData({ search: searchFilter });
// setSearchParams({ search: searchFilter });
@@ -485,20 +512,20 @@ export default function List() {
<TableRow>
<TableCell style={headStyle} align="left" />
{/* <TableCell style={headStyle} align="left">
Tanggal Booking
</TableCell>
<TableCell style={headStyle} align="left">
Tanggal Appointment
</TableCell>
<TableCell style={headStyle} align="left">
Faskes
</TableCell>
<TableCell style={headStyle} align="left">
Nama Dokter
</TableCell>
<TableCell style={headStyle} align="left">
Spesialisasi
</TableCell> */}
Tanggal Booking
</TableCell>
<TableCell style={headStyle} align="left">
Tanggal Appointment
</TableCell>
<TableCell style={headStyle} align="left">
Faskes
</TableCell>
<TableCell style={headStyle} align="left">
Nama Dokter
</TableCell>
<TableCell style={headStyle} align="left">
Spesialisasi
</TableCell> */}
<TableCell style={headStyle} align="left">
Pasien
</TableCell>