update api user dan export alamr center client
This commit is contained in:
@@ -317,7 +317,7 @@ export default function Table<T>({
|
||||
{exportReport && exportReport.useExport ? (
|
||||
<Grid item xs={12} lg={2} xl={2}>
|
||||
<FormControl fullWidth>
|
||||
<Button variant='contained' sx={{p:2}}>
|
||||
<Button variant='contained' sx={{p:2}} onClick={exportReport.handleExportReport}>
|
||||
<Download />
|
||||
<Typography variant='inherit' sx={{marginLeft: 1}}>Export</Typography>
|
||||
</Button>
|
||||
|
||||
@@ -38,6 +38,7 @@ import { useSearchParams, useNavigate, Link } from 'react-router-dom';
|
||||
import { fDateSuffix } from '../../utils/formatTime';
|
||||
import TableMoreMenu from '../../components/table/TableMoreMenu';
|
||||
import VisibilityOutlinedIcon from '@mui/icons-material/VisibilityOutlined';
|
||||
import { enqueueSnackbar } from 'notistack';
|
||||
|
||||
import DetailDataMember from './ListMember';
|
||||
import Label from '../../components/Label';
|
||||
@@ -313,9 +314,26 @@ export default function List() {
|
||||
};
|
||||
|
||||
/* -------------------------------- handle export --------------------------- */
|
||||
const handleExportReport = {
|
||||
const handleExportReport = async () => {
|
||||
var filter = Object.fromEntries([...searchParams.entries()]);
|
||||
|
||||
}
|
||||
await axios
|
||||
.get(corporateValue + '/claims/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 exportReport = {
|
||||
useExport: true,
|
||||
startDate: startDateValue,
|
||||
|
||||
@@ -319,9 +319,27 @@ export default function List() {
|
||||
};
|
||||
|
||||
/* -------------------------------- handle export --------------------------- */
|
||||
const handleExportReport = {
|
||||
const handleExportReport = async () => {
|
||||
var filter = Object.fromEntries([...searchParams.entries()]);
|
||||
|
||||
}
|
||||
await axios
|
||||
.get('claims/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 exportReport = {
|
||||
useExport: false,
|
||||
startDate: startDateValue,
|
||||
|
||||
@@ -14,6 +14,7 @@ import {
|
||||
TableBody,
|
||||
Table,
|
||||
TableRow,
|
||||
Link,
|
||||
} from '@mui/material';
|
||||
import { styled } from '@mui/material/styles';
|
||||
import DownloadIcon from '@mui/icons-material/Download';
|
||||
@@ -135,7 +136,7 @@ type Data = {
|
||||
main_diagnose_code: string,
|
||||
comparative_diagnosis: string,
|
||||
comparative_diagnosis_code: string,
|
||||
medical_evacuation: string,
|
||||
service_name: string,
|
||||
benefit_name: string,
|
||||
hospital: string,
|
||||
admission_date: string,
|
||||
@@ -193,7 +194,16 @@ export default function ServiceMonitoring() {
|
||||
})();
|
||||
}, [corporateValue]);
|
||||
|
||||
console.log(data?.laboratorium_result)
|
||||
function handleDownloadClick(fileUrl: string) {
|
||||
const tempLink = document.createElement('a');
|
||||
tempLink.href = fileUrl;
|
||||
tempLink.setAttribute('download', 'nama-file-yang-diunduh.pdf'); // Ganti 'nama-file-yang-diunduh.pdf' sesuai kebutuhan
|
||||
tempLink.style.display = 'none';
|
||||
document.body.appendChild(tempLink);
|
||||
tempLink.click();
|
||||
document.body.removeChild(tempLink);
|
||||
}
|
||||
|
||||
return (
|
||||
<Page title="Service Monitoring">
|
||||
<Grid container spacing={3} paddingX={2} sx={{ marginBottom: 5, marginTop: 1 }} >
|
||||
@@ -244,7 +254,7 @@ export default function ServiceMonitoring() {
|
||||
<Grid item xs={6} lg={6} md={6}>
|
||||
<Stack>
|
||||
<Typography variant="inherit">Date of Birth</Typography>
|
||||
<Typography variant="h6">{data?.birth_date || 'Loading...'}</Typography>
|
||||
<Typography variant="h6">{data?.birth_date ? fDateSuffix(data?.birth_date) : '-' || 'Loading...'}</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Stack>
|
||||
@@ -331,8 +341,8 @@ export default function ServiceMonitoring() {
|
||||
<Stack spacing={3} sx={{ paddingY: 2, paddingX: 2 }}>
|
||||
<Grid item xs={12} lg={12} md={12}>
|
||||
<Stack spacing={1}>
|
||||
<Typography variant="inherit">Medical Evacuation</Typography>
|
||||
<Typography variant="h6">{data?.medical_evacuation}</Typography>
|
||||
<Typography variant="inherit">Code</Typography>
|
||||
<Typography variant="h6">{data?.service_name}</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} lg={12} md={12}>
|
||||
@@ -390,7 +400,7 @@ export default function ServiceMonitoring() {
|
||||
<TimelineConnector sx={{border: '0.5px dashed rgba(145, 158, 171, 0.32)', backgrounSize: '4px 4px' }} />
|
||||
</TimelineSeparator>
|
||||
<TimelineContent>
|
||||
<Typography variant='h5' sx={{marginBottom: 2}}> { fDateSuffix(row.date)}</Typography>
|
||||
<Typography variant='h5' sx={{marginBottom: 2}}> {fDateSuffix(row.date)}</Typography>
|
||||
<Card sx={{paddinX:2, paddingY:2}} >
|
||||
<Stack direction={'row'} sx={{ alignItems: 'center', padding: 2, justifyContent: 'space-between' }}>
|
||||
<Label> {row.time} </Label>
|
||||
@@ -473,9 +483,9 @@ export default function ServiceMonitoring() {
|
||||
<Grid item xs={12} lg={12} md={12}>
|
||||
<Stack marginLeft={5}>
|
||||
<ul>
|
||||
{/* {data.} */}
|
||||
<li>test</li>
|
||||
<li>test</li>
|
||||
{row.Perencanaan.length > 0 ? row.Perencanaan.map((r, index) => (
|
||||
<li key={index}>{r}</li>
|
||||
)) : <li>-</li>}
|
||||
</ul>
|
||||
</Stack>
|
||||
</Grid>
|
||||
@@ -496,13 +506,14 @@ export default function ServiceMonitoring() {
|
||||
</Grid>
|
||||
|
||||
</TabPanel>
|
||||
|
||||
<TabPanel value={value} index={1}>
|
||||
<Grid container>
|
||||
<Grid item xs={12} md={12}>
|
||||
{data?.laboratorium_result.length > 0 ? data?.laboratorium_result.map((row, index) => (
|
||||
<Card sx={{paddinX:2, paddingY:2, paddingX:1, marginTop:2 }} key={index} >
|
||||
<Stack paddingX={5}>
|
||||
<Typography variant='subtitle1'>{fDateSuffix(row[index].datetime)}</Typography>
|
||||
<Typography variant='subtitle1'>{row[index]?.datetime ? fDateSuffix(row[index].datetime) : ''}</Typography>
|
||||
{row.length > 0 ? row.map((list, i) => (
|
||||
<Card key={i} sx={{marginTop:2, paddingX:2, paddingY:2}}>
|
||||
<Label> {list.reimbursement_code}
|
||||
@@ -525,7 +536,7 @@ export default function ServiceMonitoring() {
|
||||
<TableCell>{list.location}</TableCell>
|
||||
<TableMoreMenu actions={
|
||||
<>
|
||||
<MenuItem onClick={() => navigate(`${list.files}` )}>
|
||||
<MenuItem onClick={() => handleDownloadClick(list.file)} >
|
||||
<DownloadIcon />
|
||||
Download
|
||||
</MenuItem>
|
||||
|
||||
@@ -54,7 +54,7 @@ const navConfig = [
|
||||
{ title: 'Corporate', path: '/corporates' },
|
||||
// { title: 'Corporate Create', path: '/corporates/create' },
|
||||
{ title: 'Formularium', path: '/master/formularium-template-v2' },
|
||||
{ title: 'Master ICD-10 Diagnosis', path: '/master/diagnosis-template' },
|
||||
{ title: 'Master ICD-10 Diagnosis', path: '/master/diagnosis' },
|
||||
{ title: 'Hospitals', path: '/hospitals' },
|
||||
],
|
||||
},
|
||||
|
||||
@@ -75,7 +75,7 @@ export default function ClaimListRow ({ ...props }: Props) {
|
||||
</MenuItem>
|
||||
<MenuItem onClick={() => navigate(`/case_management/laboratorium_result/${props.row.member_id}/claims/${props.row.claim_code}/add_lab_result`)}>
|
||||
<AddIcon />
|
||||
Daily Monitoring
|
||||
Laboratorium Result
|
||||
</MenuItem>
|
||||
</>
|
||||
} />
|
||||
|
||||
@@ -219,7 +219,7 @@ export default function DetailMonitoringList() {
|
||||
<Grid item xs={12} md={12}>
|
||||
<Box display="flex" justifyContent={'flex-end'}>
|
||||
<Box display="flex" gap={1}>
|
||||
<Button variant="outlined" color="inherit" onClick={() => navigate(`/case_management/daily_monitoring/${member_id}/claims`)}>
|
||||
<Button variant="outlined" color="inherit" onClick={() => navigate(`/case_management/laboratorium_result/${member_id}/claims`)}>
|
||||
Cancel
|
||||
</Button>
|
||||
<LoadingButton disabled={!isDirty} type="submit" variant="contained" loading={isSubmitting}>
|
||||
|
||||
Reference in New Issue
Block a user