disable show.tsx src/pages/claims
This commit is contained in:
@@ -26,7 +26,7 @@ import { FormProvider, RHFCheckbox, RHFSelect, RHFTextField } from '../../compon
|
||||
import Page from '../../components/Page';
|
||||
import useSettings from '../../hooks/useSettings';
|
||||
import { useEffect, useMemo, useRef, useState } from 'react';
|
||||
import MemberSelectDialog from '../../components/dialogs/MemberSelectDialog';
|
||||
// import MemberSelectDialog from '../../components/dialogs/MemberSelectDialog';
|
||||
import { styled } from '@mui/system';
|
||||
import axios from '../../utils/axios';
|
||||
import { enqueueSnackbar } from 'notistack';
|
||||
@@ -38,7 +38,7 @@ import Documents from './components/Documents';
|
||||
import DiagnosisHistory from './components/DiagnosisHistory';
|
||||
import ClaimItems from './components/ClaimItems';
|
||||
import DialogMemberBenefit from './components/DialogMemberBenefit';
|
||||
import AutocompleteDiagnosis from '@/components/autocomplete/AutocompleteDiagnosis';
|
||||
// import AutocompleteDiagnosis from '../../components/autocomplete/AutocompleteDiagnosis';
|
||||
|
||||
export default function ClaimsCreateUpdate() {
|
||||
const { themeStretch } = useSettings();
|
||||
@@ -72,13 +72,11 @@ export default function ClaimsCreateUpdate() {
|
||||
setLoadingClaimItems(true);
|
||||
axios
|
||||
.post(`claims/${id}/update-items`, {
|
||||
benefit_items: claimItems.map((benefit) => {
|
||||
return {
|
||||
id: benefit.id,
|
||||
biaya_diajukan: benefit.biaya_diajukan,
|
||||
biaya_disetujui: benefit.biaya_disetujui,
|
||||
};
|
||||
}),
|
||||
benefit_items: claimItems.map((benefit) => ({
|
||||
id: benefit.id,
|
||||
biaya_diajukan: benefit.biaya_diajukan,
|
||||
biaya_disetujui: benefit.biaya_disetujui,
|
||||
})),
|
||||
})
|
||||
.then((res) => {
|
||||
enqueueSnackbar(res.data.message, { variant: 'success' });
|
||||
@@ -174,48 +172,45 @@ export default function ClaimsCreateUpdate() {
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
// Initial LOG
|
||||
const [loadingLog, setLoadingLog] = useState(false)
|
||||
const [loadingLog, setLoadingLog] = useState(false);
|
||||
|
||||
const handleDownloadLog = (claim_id) => {
|
||||
setLoadingLog(true);
|
||||
axios
|
||||
.post(`generate-log/${claim_id}`, {
|
||||
responseType: 'blob',
|
||||
})
|
||||
.then((response) => {
|
||||
window.open(URL.createObjectURL(response.data));
|
||||
setLoadingLog(false);
|
||||
setOpenDialog(false);
|
||||
})
|
||||
.catch((response) => {
|
||||
enqueueSnackbar(response.message, { variant: 'error' });
|
||||
setLoadingLog(false);
|
||||
});
|
||||
}
|
||||
|
||||
axios
|
||||
.post(`generate-log/${claim_id}`, {
|
||||
responseType: 'blob',
|
||||
})
|
||||
.then((response) => {
|
||||
window.open(URL.createObjectURL(response.data));
|
||||
setLoadingLog(false);
|
||||
setOpenDialog(false);
|
||||
})
|
||||
.catch((response) => {
|
||||
enqueueSnackbar(response.message, { variant: 'error' });
|
||||
setLoadingLog(false);
|
||||
});
|
||||
};
|
||||
|
||||
// -------------------------------------------------
|
||||
// Final LOG
|
||||
const [loadingFinalLog, setLoadingFinalLog] = useState(false)
|
||||
const [loadingFinalLog, setLoadingFinalLog] = useState(false);
|
||||
const handleDownloadFinalLog = (claim_id) => {
|
||||
setLoadingFinalLog(true);
|
||||
axios
|
||||
.get(`final-log/${claim_id}`, {
|
||||
responseType: 'blob',
|
||||
})
|
||||
.then((response) => {
|
||||
window.open(URL.createObjectURL(response.data));
|
||||
setLoadingFinalLog(false);
|
||||
})
|
||||
.catch((response) => {
|
||||
enqueueSnackbar(response.message, { variant: 'error' });
|
||||
setLoadingFinalLog(false);
|
||||
});
|
||||
}
|
||||
|
||||
axios
|
||||
.get(`final-log/${claim_id}`, {
|
||||
responseType: 'blob',
|
||||
})
|
||||
.then((response) => {
|
||||
window.open(URL.createObjectURL(response.data));
|
||||
setLoadingFinalLog(false);
|
||||
})
|
||||
.catch((response) => {
|
||||
enqueueSnackbar(response.message, { variant: 'error' });
|
||||
setLoadingFinalLog(false);
|
||||
});
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
axios.get('/claims/' + id).then(({ data }) => {
|
||||
@@ -280,24 +275,22 @@ export default function ClaimsCreateUpdate() {
|
||||
Re-Open
|
||||
</LoadingButton>
|
||||
)}
|
||||
|
||||
|
||||
</Stack>
|
||||
</Stack>
|
||||
|
||||
<Paper variant="outlined" sx={{ background: '#f4f6f8', p: 2, marginY: 2 }}>
|
||||
<Stack direction="row" justifyContent="space-between" alignItems="center">
|
||||
<Typography>Status : {currentClaim?.status}</Typography>
|
||||
{ currentClaim?.status == 'approved' && (
|
||||
<LoadingButton
|
||||
loading={loadingFinalLog}
|
||||
variant="contained"
|
||||
onClick={() => {
|
||||
handleDownloadFinalLog(currentClaim.id);
|
||||
}}
|
||||
>
|
||||
Download Final LOG
|
||||
</LoadingButton>
|
||||
{currentClaim?.status === 'approved' && (
|
||||
<LoadingButton
|
||||
loading={loadingFinalLog}
|
||||
variant="contained"
|
||||
onClick={() => {
|
||||
handleDownloadFinalLog(currentClaim.id);
|
||||
}}
|
||||
>
|
||||
Download Final LOG
|
||||
</LoadingButton>
|
||||
)}
|
||||
</Stack>
|
||||
</Paper>
|
||||
@@ -306,10 +299,10 @@ export default function ClaimsCreateUpdate() {
|
||||
<Grid container spacing={2}>
|
||||
<Grid item xs={5}>
|
||||
{/* Dokumen Tambahan */}
|
||||
<Documents files={documents}></Documents>
|
||||
<Documents files={documents} />
|
||||
|
||||
{/* Riwayat Diagnosa */}
|
||||
<DiagnosisHistory diagnosis={[]}></DiagnosisHistory>
|
||||
<DiagnosisHistory diagnosis={[]} />
|
||||
|
||||
{/* Ringkasan Data Member */}
|
||||
<Paper variant="outlined" sx={{ background: '#f4f6f8', p: 2, marginTop: 2 }}>
|
||||
@@ -381,35 +374,34 @@ export default function ClaimsCreateUpdate() {
|
||||
<Paper variant="outlined" sx={{ background: '#f4f6f8', p: 2 }}>
|
||||
<Paper variant="outlined" sx={{ background: 'white', p: 2 }}>
|
||||
<Stack spacing={2}>
|
||||
<AutocompleteDiagnosis
|
||||
{/* <AutocompleteDiagnosis
|
||||
onChange={handlePrimaryDiagnosisChange}
|
||||
textLabel="Diagnosa Utama (ICD-X)"
|
||||
currentValue={
|
||||
currentClaim?.primary_diagnosis ? currentClaim?.primary_diagnosis : null
|
||||
}
|
||||
></AutocompleteDiagnosis>
|
||||
/>
|
||||
<AutocompleteDiagnosis
|
||||
onChange={handleSecondaryDiagnosisChange}
|
||||
textLabel="Diagnosa Tambahan (ICD-X)"
|
||||
currentValue={
|
||||
currentClaim?.secondary_diagnosis ? currentClaim?.secondary_diagnosis : null
|
||||
}
|
||||
></AutocompleteDiagnosis>
|
||||
/> */}
|
||||
</Stack>
|
||||
</Paper>
|
||||
|
||||
{(currentClaim?.status == 'requested' || currentClaim?.status == 'received') && (
|
||||
|
||||
<LoadingButton
|
||||
variant="contained"
|
||||
sx={{ marginTop: 2 }}
|
||||
loading={loadingDiagnosis}
|
||||
onClick={() => {
|
||||
handleSaveDiagnosis();
|
||||
}}
|
||||
>
|
||||
Simpan Claim Item
|
||||
</LoadingButton>
|
||||
<LoadingButton
|
||||
variant="contained"
|
||||
sx={{ marginTop: 2 }}
|
||||
loading={loadingDiagnosis}
|
||||
onClick={() => {
|
||||
handleSaveDiagnosis();
|
||||
}}
|
||||
>
|
||||
Simpan Claim Item
|
||||
</LoadingButton>
|
||||
)}
|
||||
</Paper>
|
||||
|
||||
@@ -424,22 +416,20 @@ Simpan Claim Item
|
||||
+ Add Benefit
|
||||
</Typography>
|
||||
</Stack>
|
||||
<ClaimItems items={claimItems} setItems={setClaimItems}></ClaimItems>
|
||||
<ClaimItems items={claimItems} setItems={setClaimItems} />
|
||||
<Stack alignItems={'flex-end'}>
|
||||
|
||||
{(currentClaim?.status == 'requested' || currentClaim?.status == 'received') && (
|
||||
|
||||
<LoadingButton
|
||||
variant="contained"
|
||||
sx={{ marginTop: 2 }}
|
||||
loading={loadingClaimItems}
|
||||
onClick={() => {
|
||||
handleSaveClaimItems();
|
||||
}}
|
||||
>
|
||||
Simpan Claim Item
|
||||
</LoadingButton>
|
||||
)}
|
||||
{(currentClaim?.status == 'requested' || currentClaim?.status == 'received') && (
|
||||
<LoadingButton
|
||||
variant="contained"
|
||||
sx={{ marginTop: 2 }}
|
||||
loading={loadingClaimItems}
|
||||
onClick={() => {
|
||||
handleSaveClaimItems();
|
||||
}}
|
||||
>
|
||||
Simpan Claim Item
|
||||
</LoadingButton>
|
||||
)}
|
||||
</Stack>
|
||||
|
||||
<DialogMemberBenefit
|
||||
|
||||
2149
pnpm-lock.yaml
generated
2149
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user