[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(() => {
|
useEffect(() => {
|
||||||
axios.get('/claims/' + id).then(({ data }) => {
|
axios.get('/claims/' + id).then(({ data }) => {
|
||||||
const claim = data.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);
|
setCurrentClaim(claim);
|
||||||
setDocuments(allFiles);
|
setDocuments(allFiles);
|
||||||
@@ -243,7 +247,20 @@ export default function ClaimsCreateUpdate() {
|
|||||||
</Stack>
|
</Stack>
|
||||||
|
|
||||||
<Paper variant="outlined" sx={{ background: '#f4f6f8', p: 2, marginY: 2 }}>
|
<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>
|
</Paper>
|
||||||
|
|
||||||
<Box sx={{ flexGrow: 1 }}>
|
<Box sx={{ flexGrow: 1 }}>
|
||||||
@@ -301,7 +318,7 @@ export default function ClaimsCreateUpdate() {
|
|||||||
Tipe Claim
|
Tipe Claim
|
||||||
</Typography>
|
</Typography>
|
||||||
<Typography variant="body2">
|
<Typography variant="body2">
|
||||||
{currentClaim?.claim_request.payment_type_name}
|
{currentClaim?.claim_request?.payment_type_name}
|
||||||
</Typography>
|
</Typography>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
@@ -342,16 +359,19 @@ export default function ClaimsCreateUpdate() {
|
|||||||
</Stack>
|
</Stack>
|
||||||
</Paper>
|
</Paper>
|
||||||
|
|
||||||
<LoadingButton
|
{(currentClaim?.status == 'requested' || currentClaim?.status == 'received') && (
|
||||||
variant="contained"
|
|
||||||
sx={{ marginTop: 2 }}
|
<LoadingButton
|
||||||
loading={loadingDiagnosis}
|
variant="contained"
|
||||||
onClick={() => {
|
sx={{ marginTop: 2 }}
|
||||||
handleSaveDiagnosis();
|
loading={loadingDiagnosis}
|
||||||
}}
|
onClick={() => {
|
||||||
>
|
handleSaveDiagnosis();
|
||||||
Simpan Claim Item
|
}}
|
||||||
</LoadingButton>
|
>
|
||||||
|
Simpan Claim Item
|
||||||
|
</LoadingButton>
|
||||||
|
)}
|
||||||
</Paper>
|
</Paper>
|
||||||
|
|
||||||
<Paper variant="outlined" sx={{ background: '#f4f6f8', p: 2, marginTop: 2 }}>
|
<Paper variant="outlined" sx={{ background: '#f4f6f8', p: 2, marginTop: 2 }}>
|
||||||
@@ -367,6 +387,9 @@ export default function ClaimsCreateUpdate() {
|
|||||||
</Stack>
|
</Stack>
|
||||||
<ClaimItems items={claimItems} setItems={setClaimItems}></ClaimItems>
|
<ClaimItems items={claimItems} setItems={setClaimItems}></ClaimItems>
|
||||||
<Stack alignItems={'flex-end'}>
|
<Stack alignItems={'flex-end'}>
|
||||||
|
|
||||||
|
{(currentClaim?.status == 'requested' || currentClaim?.status == 'received') && (
|
||||||
|
|
||||||
<LoadingButton
|
<LoadingButton
|
||||||
variant="contained"
|
variant="contained"
|
||||||
sx={{ marginTop: 2 }}
|
sx={{ marginTop: 2 }}
|
||||||
@@ -377,6 +400,7 @@ export default function ClaimsCreateUpdate() {
|
|||||||
>
|
>
|
||||||
Simpan Claim Item
|
Simpan Claim Item
|
||||||
</LoadingButton>
|
</LoadingButton>
|
||||||
|
)}
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|
||||||
<DialogMemberBenefit
|
<DialogMemberBenefit
|
||||||
|
|||||||
Reference in New Issue
Block a user