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