Update cetak final LOG

This commit is contained in:
ivan-sim
2023-12-29 13:35:06 +07:00
parent 2134de863a
commit 7c2df15a9f
8 changed files with 697 additions and 9 deletions

View File

@@ -38,8 +38,17 @@ export default function TableListFinalLog() {
const [data, setData] = useState([]);
// Download LOG
async function handleDownloadLog(claimRequest:any) {
enqueueSnackbar('Sorry, this feature is currently being processed', { variant: 'error' });
async function handleDownloadLog(request_log_id:any) {
return axios
.get(`download-final-log/${request_log_id}`, {
responseType: 'blob',
})
.then((response) => {
window.open(URL.createObjectURL(response.data), '_blank');
})
.catch((response) => {
enqueueSnackbar(response.message, { variant: 'error' });
});
}
/* -------------------------------------------------------------------------- */
@@ -334,9 +343,9 @@ export default function TableListFinalLog() {
View
</MenuItem>
{obj.status === 'approved' ? (
<MenuItem onClick={() => handleDownloadLog(obj.claim_request_id)}>
<MenuItem onClick={() => handleDownloadLog(obj.id)}>
<Iconify icon="eva:download-fill" />
Download LOG
Download Final LOG
</MenuItem>
):''}
{!obj.check_claim && obj.status === 'approved' ? (