Update service hospital dan prime center
This commit is contained in:
@@ -26,7 +26,7 @@ export default function FormRequestClaim({ member, handleSubmitSuccess }) {
|
||||
},
|
||||
}));
|
||||
|
||||
const [serviceCode, setServiceCode] = useState('IP');
|
||||
const [serviceCode, setServiceCode] = useState('');
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
// Files Diagnosa
|
||||
@@ -96,9 +96,14 @@ export default function FormRequestClaim({ member, handleSubmitSuccess }) {
|
||||
|
||||
const [submitLoading, setSubmitLoading] = useState(false);
|
||||
function submitRequest() {
|
||||
if(serviceCode == '')
|
||||
{
|
||||
enqueueSnackbar('Please select services', { variant: 'error' });
|
||||
return false;
|
||||
}
|
||||
setSubmitLoading(true);
|
||||
const formData = makeFormData({
|
||||
member_id: member.id,
|
||||
member_id: member.members.id,
|
||||
result_files: fileHasilPenunjangs,
|
||||
diagnosa_files: fileDiagnosas,
|
||||
kondisi_files: fileKondisis,
|
||||
@@ -107,11 +112,11 @@ export default function FormRequestClaim({ member, handleSubmitSuccess }) {
|
||||
axios
|
||||
.post('/claim-requests', formData)
|
||||
.then((response) => {
|
||||
enqueueSnackbar(response.data.message ?? 'Berhasil membuat data', { variant: 'success' });
|
||||
enqueueSnackbar(response.data.data.message ?? 'Berhasil membuat data', { variant: 'success' });
|
||||
handleSubmitSuccess();
|
||||
})
|
||||
.catch(({ response }) => {
|
||||
enqueueSnackbar(response.data.message ?? 'Something Went Wrong', { variant: 'error' });
|
||||
enqueueSnackbar(response.data.data.message ?? 'Something Went Wrong', { variant: 'error' });
|
||||
})
|
||||
.then(() => {
|
||||
setSubmitLoading(false);
|
||||
@@ -127,26 +132,39 @@ export default function FormRequestClaim({ member, handleSubmitSuccess }) {
|
||||
<Typography variant='body2' sx={{fontWeight:'bold'}}>{format(new Date(), "d MMM yyyy")}</Typography>
|
||||
</Stack>
|
||||
|
||||
|
||||
<Card sx={{ p: 1, background: '#f4f6f8', marginBottom: 2 }}>
|
||||
<Stack direction="column" spacing={2} sx={{marginBottom: 2}}>
|
||||
<Typography variant="body1" sx={{fontWeight:'bold'}}>
|
||||
Services
|
||||
</Typography>
|
||||
<Card sx={{ p: 1, background: '#f4f6f8', marginBottom: 2 }}>
|
||||
<Stack direction="row" spacing={2}>
|
||||
{member && member?.services?.map((dataServices, index) => (
|
||||
<Button
|
||||
key={index}
|
||||
sx={{padding: 2, width: '100%'}}
|
||||
color="primary"
|
||||
variant={serviceCode === dataServices.service_code ? 'outlined' : ''}
|
||||
onClick={() => { setServiceCode(dataServices.service_code) }}
|
||||
>
|
||||
{dataServices.name}
|
||||
</Button>
|
||||
))}
|
||||
</Stack>
|
||||
</Card>
|
||||
|
||||
<Stack direction="row" spacing={2}>
|
||||
<Button sx={{padding: 2, width: '100%'}} color="primary" variant={serviceCode == 'IP' ? 'outlined' : ''} onClick={() => {setServiceCode('IP')}}>Inpatient</Button>
|
||||
<Button sx={{padding: 2, width: '100%'}} color="primary" variant={serviceCode == 'OP' ? 'outlined' : ''} onClick={() => {setServiceCode('OP')}}>Outpatient</Button>
|
||||
</Stack>
|
||||
</Card>
|
||||
|
||||
|
||||
<Card sx={{ p: 1, background: '#f4f6f8', marginBottom: 2 }}>
|
||||
<Card sx={{ p: 1, background: '#f4f6f8'}}>
|
||||
<Stack direction="row">
|
||||
<Avatar
|
||||
src="https://minimal-assets-api.vercel.app/assets/images/avatars/avatar_5.jpg"
|
||||
alt={member?.full_name ?? ''}
|
||||
alt={member?.members.name ?? ''}
|
||||
sx={{ marginTop: 1, width: 48, height: 48 }}
|
||||
/>
|
||||
<Stack sx={{ p: 1 }}>
|
||||
<Typography variant="body2">{member?.full_name ?? ''}</Typography>
|
||||
<Typography variant="body2" sx={{color:'#637381'}}>{member?.member_id ?? ''}</Typography>
|
||||
<Typography variant="body2">{member?.members.name ?? ''}</Typography>
|
||||
<Typography variant="body2" sx={{color:'#637381'}}>{member?.members.member_id ?? ''}</Typography>
|
||||
</Stack>
|
||||
</Stack>
|
||||
</Card>
|
||||
@@ -173,7 +191,7 @@ export default function FormRequestClaim({ member, handleSubmitSuccess }) {
|
||||
<Stack
|
||||
divider={<Divider orientation="horizontal" flexItem />}
|
||||
spacing={4}
|
||||
sx={{ marginY: 2 }}
|
||||
sx={{ marginY: 2, marginBottom: 6 }}
|
||||
>
|
||||
{/* -------------------------------Upload Dokumen Kondisi------------------------------- */}
|
||||
<Stack sx={{ marginTop: 2 }}>
|
||||
@@ -226,7 +244,7 @@ export default function FormRequestClaim({ member, handleSubmitSuccess }) {
|
||||
style={{ display: 'none' }}
|
||||
multiple
|
||||
onChange={handleKondisiInputChange}
|
||||
accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel, text/plain, application/pdf"
|
||||
accept="application/pdf"
|
||||
/>
|
||||
</ButtonBase>
|
||||
</Stack>
|
||||
@@ -287,7 +305,7 @@ export default function FormRequestClaim({ member, handleSubmitSuccess }) {
|
||||
style={{ display: 'none' }}
|
||||
multiple
|
||||
onChange={handleDiagnosaInputChange}
|
||||
accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel, text/plain, application/pdf"
|
||||
accept="application/pdf"
|
||||
/>
|
||||
</ButtonBase>
|
||||
</Stack>
|
||||
@@ -348,7 +366,7 @@ export default function FormRequestClaim({ member, handleSubmitSuccess }) {
|
||||
style={{ display: 'none' }}
|
||||
multiple
|
||||
onChange={handleResultInputChange}
|
||||
accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel, text/plain, application/pdf"
|
||||
accept="application/pdf"
|
||||
/>
|
||||
</ButtonBase>
|
||||
</Stack>
|
||||
@@ -362,7 +380,7 @@ export default function FormRequestClaim({ member, handleSubmitSuccess }) {
|
||||
}}
|
||||
loading={submitLoading}
|
||||
>
|
||||
LOG Request
|
||||
Request LOG
|
||||
</LoadingButton>
|
||||
</Stack>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user