Merge remote-tracking branch 'origin/master' into feature/client-portal
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
import MuiDialog from '@/components/MuiDialog';
|
||||
import axios from '@/utils/axios';
|
||||
import { Button, Checkbox, Typography } from '@mui/material';
|
||||
import { Paper } from '@mui/material';
|
||||
import { Stack } from '@mui/material';
|
||||
import { enqueueSnackbar } from 'notistack';
|
||||
import React, { useState } from 'react';
|
||||
import FormHistoryPerawatan from './FormHistoryPerawatan';
|
||||
|
||||
type DialogDocumentRequestType = {
|
||||
openDialog: boolean;
|
||||
setOpenDialog: React.Dispatch;
|
||||
onSubmit?: void;
|
||||
claim: any; // TODO create ClaimType
|
||||
encounter?: any;
|
||||
}
|
||||
|
||||
export default function DialogDocumentRequest({ openDialog, setOpenDialog, onSubmit, claim } : DialogDocumentRequestType) {
|
||||
|
||||
const handleSubmit = (data) => {
|
||||
|
||||
axios.post(`claims/${claim.id}/encounters`, data)
|
||||
.then((res) => {
|
||||
enqueueSnackbar(res.data.message, {variant: 'success'})
|
||||
setOpenDialog(false);
|
||||
})
|
||||
.catch((err) => {
|
||||
enqueueSnackbar(err.message, {variant: 'error'})
|
||||
})
|
||||
|
||||
onSubmit()
|
||||
};
|
||||
|
||||
const documentTypes = [
|
||||
{
|
||||
type: "result",
|
||||
name: "Dokumen Hasil Penunjang"
|
||||
},
|
||||
{
|
||||
type: "claim-diagnosis",
|
||||
name: "Dokumen Diagnosa"
|
||||
},
|
||||
{
|
||||
type: "claim-diagnosis",
|
||||
name: "Dokumen Diagnosa"
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
const getContent = () => (
|
||||
<Stack spacing={1} marginTop={2}>
|
||||
{documentTypes.map((document, index) => (
|
||||
<Stack key={index} direction="row" alignContent="center" alignItems="center">
|
||||
<Checkbox></Checkbox>
|
||||
<Typography>{document.name}</Typography>
|
||||
</Stack>
|
||||
))}
|
||||
</Stack>
|
||||
);
|
||||
|
||||
return (
|
||||
<MuiDialog
|
||||
title={{ name: 'Request Document'}}
|
||||
openDialog={openDialog}
|
||||
setOpenDialog={setOpenDialog}
|
||||
content={getContent()}
|
||||
maxWidth="xl"
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -4,12 +4,12 @@ import { Button, Checkbox, Typography } from '@mui/material';
|
||||
import { Paper } from '@mui/material';
|
||||
import { Stack } from '@mui/material';
|
||||
import { enqueueSnackbar } from 'notistack';
|
||||
import { useState } from 'react';
|
||||
import React, { useState } from 'react';
|
||||
import FormHistoryPerawatan from './FormHistoryPerawatan';
|
||||
|
||||
type DialogHistoryPerawatanType = {
|
||||
openDialog: boolean;
|
||||
setOpenDialog: void;
|
||||
setOpenDialog: React.Dispatch;
|
||||
onSubmit?: void;
|
||||
claim: any; // TODO create ClaimType
|
||||
encounter?: any;
|
||||
|
||||
@@ -1,33 +1,57 @@
|
||||
import { IconButtonAnimate } from '@/components/animate';
|
||||
import Iconify from '@/components/Iconify';
|
||||
import MuiDialog from '@/components/MuiDialog';
|
||||
import { Box, Tooltip } from '@mui/material';
|
||||
import { Paper, Stack, Typography } from '@mui/material';
|
||||
import { useState } from 'react';
|
||||
import DialogDocumentRequest from './DialogDocumentRequest';
|
||||
|
||||
export default function Documents({ files }) {
|
||||
// --------------------------------------------------------------
|
||||
// Dialog Request Document
|
||||
const [openDialogRequestDocument, setOpenDialogRequestDocument] = useState(false);
|
||||
const [openDialogConfirmRequestDocument, setOpenDialogConfirmRequestDocument] = useState(false);
|
||||
|
||||
function FileItem({item}) {
|
||||
function FileItem({ item }) {
|
||||
function fileCategory(type: string) {
|
||||
switch(type) {
|
||||
case 'claim-result':
|
||||
return 'Claim Result';
|
||||
case 'claim-diagnosis':
|
||||
return 'Claim Diagnosis';
|
||||
case 'claim-condition':
|
||||
return 'Claim Condition';
|
||||
default:
|
||||
return 'Other File';
|
||||
}
|
||||
switch (type) {
|
||||
case 'claim-result':
|
||||
return 'Claim Result';
|
||||
case 'claim-diagnosis':
|
||||
return 'Claim Diagnosis';
|
||||
case 'claim-condition':
|
||||
return 'Claim Condition';
|
||||
default:
|
||||
return 'Other File';
|
||||
}
|
||||
}
|
||||
|
||||
const documentTypes = [
|
||||
{
|
||||
type: 'result',
|
||||
name: 'Dokumen Hasil Penunjang',
|
||||
},
|
||||
{
|
||||
type: 'claim-diagnosis',
|
||||
name: 'Dokumen Diagnosa',
|
||||
},
|
||||
{
|
||||
type: 'claim-diagnosis',
|
||||
name: 'Dokumen Diagnosa',
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<Stack direction="row" justifyContent="space-between" alignItems="center" sx={{ p: 1 }}>
|
||||
<Stack>
|
||||
<Typography variant="body2" fontWeight="600">
|
||||
{ fileCategory(item.type) }
|
||||
</Typography>
|
||||
<Typography variant="body2"><a href={item.url} target="_blank">{ item.name }</a></Typography>
|
||||
<Typography variant="body2" fontWeight="600">
|
||||
{fileCategory(item.type)}
|
||||
</Typography>
|
||||
<Typography variant="body2">
|
||||
<a href={item.url} target="_blank">
|
||||
{item.name}
|
||||
</a>
|
||||
</Typography>
|
||||
</Stack>
|
||||
<Iconify icon="eva:arrow-ios-forward-fill"></Iconify>
|
||||
</Stack>
|
||||
@@ -51,18 +75,51 @@ export default function Documents({ files }) {
|
||||
</Stack>
|
||||
|
||||
<Paper sx={{ background: 'white', marginTop: 2 }}>
|
||||
{ files.length > 0 ? (
|
||||
<Stack sx={{ maxHeight: '250px', overflowY: 'scroll' }}>
|
||||
{ files.map((file, index) => (
|
||||
<FileItem item={file} key={index}></FileItem>
|
||||
)) }
|
||||
<Stack>
|
||||
<Stack direction="row" justifyContent="space-between" alignItems="center" sx={{p: 2, paddingBottom: 1}}>
|
||||
<Typography fontWeight="bold">Dokumen Diagnosa</Typography>
|
||||
<Tooltip title="Request to upload this">
|
||||
<IconButtonAnimate color="primary" onClick={() => {}}>
|
||||
<Iconify icon="eva:bell-outline" width={20} height={20}></Iconify>
|
||||
{/* <Iconify icon="eva:done-all-fill" width={20} height={20} /> */}
|
||||
</IconButtonAnimate>
|
||||
</Tooltip>
|
||||
|
||||
<MuiDialog
|
||||
title="Are you sure to request this document?"
|
||||
openDialog={openDialogConfirmRequestDocument}
|
||||
setOpenDialog={setOpenDialogConfirmRequestDocument}
|
||||
content={(
|
||||
<Typography variant="body2">kasjdnkajsdnkasdnaksjdnaksdjnkasdnkajsdn</Typography>
|
||||
)}
|
||||
/>
|
||||
</Stack>
|
||||
) : (
|
||||
<Stack sx={{px: 2}}>
|
||||
<Typography variant="body2">Dokumen Diagnosa</Typography>
|
||||
</Stack>
|
||||
<Stack sx={{px: 2}}>
|
||||
<Typography variant="body2">Dokumen Diagnosa</Typography>
|
||||
</Stack>
|
||||
</Stack>
|
||||
|
||||
|
||||
{files.length > 0 ? (
|
||||
<Stack sx={{ maxHeight: '250px', overflowY: 'scroll' }}>
|
||||
{files.map((file, index) => (
|
||||
<FileItem item={file} key={index}></FileItem>
|
||||
))}
|
||||
</Stack>
|
||||
) : (
|
||||
<Stack sx={{ p: 1 }}>
|
||||
<Typography>Belum ada History Perawatan</Typography>
|
||||
<Typography>Belum ada dokumen</Typography>
|
||||
</Stack>
|
||||
)}
|
||||
</Paper>
|
||||
|
||||
<DialogDocumentRequest
|
||||
setOpenDialog={setOpenDialogRequestDocument}
|
||||
openDialog={openDialogRequestDocument}
|
||||
></DialogDocumentRequest>
|
||||
</Paper>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user