[WIP] Update Show Hide Button
This commit is contained in:
@@ -174,10 +174,14 @@ export default function ClaimsCreateUpdate() {
|
||||
});
|
||||
};
|
||||
|
||||
const handleDownloadFinalLog = () => {
|
||||
enqueueSnackbar("Gagal Download Final LOG", { variant: 'error' })
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
axios.get('/claims/' + id).then(({ data }) => {
|
||||
const claim = data.data;
|
||||
const allFiles = [...claim.claim_request.files, ...claim.files];
|
||||
const allFiles = [...(claim.claim_request ? claim.claim_request.files : []), ...claim.files];
|
||||
|
||||
setCurrentClaim(claim);
|
||||
setDocuments(allFiles);
|
||||
@@ -243,7 +247,20 @@ export default function ClaimsCreateUpdate() {
|
||||
</Stack>
|
||||
|
||||
<Paper variant="outlined" sx={{ background: '#f4f6f8', p: 2, marginY: 2 }}>
|
||||
<Typography>Status : {currentClaim?.status}</Typography>
|
||||
<Stack direction="row" justifyContent="space-between">
|
||||
<Typography>Status : {currentClaim?.status}</Typography>
|
||||
{ currentClaim?.status == 'approved' && (
|
||||
<LoadingButton
|
||||
loading={false}
|
||||
variant="contained"
|
||||
onClick={() => {
|
||||
handleDownloadFinalLog();
|
||||
}}
|
||||
>
|
||||
Download Final LOG
|
||||
</LoadingButton>
|
||||
)}
|
||||
</Stack>
|
||||
</Paper>
|
||||
|
||||
<Box sx={{ flexGrow: 1 }}>
|
||||
@@ -301,7 +318,7 @@ export default function ClaimsCreateUpdate() {
|
||||
Tipe Claim
|
||||
</Typography>
|
||||
<Typography variant="body2">
|
||||
{currentClaim?.claim_request.payment_type_name}
|
||||
{currentClaim?.claim_request?.payment_type_name}
|
||||
</Typography>
|
||||
</Grid>
|
||||
|
||||
@@ -342,16 +359,19 @@ export default function ClaimsCreateUpdate() {
|
||||
</Stack>
|
||||
</Paper>
|
||||
|
||||
<LoadingButton
|
||||
variant="contained"
|
||||
sx={{ marginTop: 2 }}
|
||||
loading={loadingDiagnosis}
|
||||
onClick={() => {
|
||||
handleSaveDiagnosis();
|
||||
}}
|
||||
>
|
||||
Simpan Claim Item
|
||||
</LoadingButton>
|
||||
{(currentClaim?.status == 'requested' || currentClaim?.status == 'received') && (
|
||||
|
||||
<LoadingButton
|
||||
variant="contained"
|
||||
sx={{ marginTop: 2 }}
|
||||
loading={loadingDiagnosis}
|
||||
onClick={() => {
|
||||
handleSaveDiagnosis();
|
||||
}}
|
||||
>
|
||||
Simpan Claim Item
|
||||
</LoadingButton>
|
||||
)}
|
||||
</Paper>
|
||||
|
||||
<Paper variant="outlined" sx={{ background: '#f4f6f8', p: 2, marginTop: 2 }}>
|
||||
@@ -367,6 +387,9 @@ export default function ClaimsCreateUpdate() {
|
||||
</Stack>
|
||||
<ClaimItems items={claimItems} setItems={setClaimItems}></ClaimItems>
|
||||
<Stack alignItems={'flex-end'}>
|
||||
|
||||
{(currentClaim?.status == 'requested' || currentClaim?.status == 'received') && (
|
||||
|
||||
<LoadingButton
|
||||
variant="contained"
|
||||
sx={{ marginTop: 2 }}
|
||||
@@ -377,6 +400,7 @@ export default function ClaimsCreateUpdate() {
|
||||
>
|
||||
Simpan Claim Item
|
||||
</LoadingButton>
|
||||
)}
|
||||
</Stack>
|
||||
|
||||
<DialogMemberBenefit
|
||||
|
||||
Reference in New Issue
Block a user