update export excel request log

This commit is contained in:
Linksehat Staging Server
2024-01-31 14:52:04 +07:00
parent 932b20eba6
commit 7e56fb4b77
3 changed files with 41 additions and 28 deletions

View File

@@ -170,14 +170,17 @@ export default function List() {
}
const handleGetData = (type :string) => {
axios.get(`report/logs/export`)
.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();
handleClose();
setImportLoading(true);
handleCancelImportButton();
axios.get(`report/logs/export`)
.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();
setImportLoading(false);
})
}
@@ -194,14 +197,15 @@ export default function List() {
{!currentImportFileName && (
<Stack direction={'row'} spacing={2} sx={{ p: 2 }}>
<SearchInput onSearch={applyFilter} />
<Button
<LoadingButton
variant="outlined"
startIcon={<UploadIcon />}
sx={{ p: 1.8 }}
onClick={handleClick}
loading={importLoading}
>
Export
</Button>
</LoadingButton>
<Menu
id="import-button"
anchorEl={anchorEl}
@@ -283,7 +287,7 @@ export default function List() {
const response = await axios.get('/report/logs', {
params: { ...parameters },
});
setDataTableLoading(false);
setDataTableData(response.data);
};
@@ -313,14 +317,14 @@ export default function List() {
const { row } = props;
const [open, setOpen] = React.useState(false);
const [loadingApprove, setLoadingApprove] = React.useState(false);
return (
<React.Fragment>
<TableRow sx={{ '& > *': { borderBottom: 'unset' } }}>
<TableCell align="left">{row.code}</TableCell>
<TableCell align="left">{row.member_name}</TableCell>
<TableCell align="left"><Label>{row.created_at ? fDateTimesecond(row.created_at) : '-'}</Label></TableCell>
<TableCell align="left"><Label>{fDateTimesecond(row.submission_date)}</Label></TableCell>
<TableCell align="left"><Label>{row.submission_date != null ? fDateTimesecond(row.submission_date) : '-'}</Label></TableCell>
<TableCell align="left">{row.approved_by}</TableCell>
<TableCell align="left"><Label>{row.created_final_at != null ? fDateTimesecond(row.created_final_at) : '-' }</Label></TableCell>
<TableCell align="left"><Label>{row.approved_final_log_at ? fDateTimesecond(row.approved_final_log_at) : '-' }</Label></TableCell>