Merge remote-tracking branch 'origin/staging' into origin/production
This commit is contained in:
@@ -7,7 +7,7 @@ import List from "./List";
|
||||
|
||||
export default function Claims() {
|
||||
|
||||
const pageTitle = 'Claim Request';
|
||||
const pageTitle = 'Final LOG';
|
||||
return (
|
||||
<Page title={ pageTitle } sx={{ mx: 2}}>
|
||||
|
||||
@@ -16,8 +16,8 @@ export default function Claims() {
|
||||
links={[
|
||||
{ name: 'Dashboard', href: '/dashboard' },
|
||||
{
|
||||
name: 'Claim Request',
|
||||
href: '/claim-requests',
|
||||
name: 'Final LOG',
|
||||
href: '/final-log',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
|
||||
@@ -354,7 +354,7 @@ export default function List() {
|
||||
</Typography>
|
||||
</TableCell> */}
|
||||
<TableCell align="left">{row.code}</TableCell>
|
||||
<TableCell align="left">{row.member?.full_name}</TableCell>
|
||||
<TableCell align="left">{row.member_name}</TableCell>
|
||||
<TableCell align="left"><Label>{fDateTimesecond(row.submission_date)}</Label></TableCell>
|
||||
<TableCell align="left">{row.service_name}</TableCell>
|
||||
<TableCell align="left">{row.payment_type_name}</TableCell>
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
import MuiDialog from "@/components/MuiDialog";
|
||||
import { Button, Card, Checkbox, DialogActions, Grid, Typography } from "@mui/material";
|
||||
import { Button, Card, Checkbox, DialogActions, Grid, TextField, Typography } from "@mui/material";
|
||||
import { Paper } from "@mui/material";
|
||||
import { Stack } from '@mui/material';
|
||||
import React, { useState } from 'react';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { DetailRequestLogType } from "../Model/Types";
|
||||
import { fDateTimesecond, toTitleCase } from "@/utils/formatTime";
|
||||
import axios from "@/utils/axios";
|
||||
import { enqueueSnackbar } from "notistack";
|
||||
import { useNavigate } from "react-router";
|
||||
import { RHFTextField } from "@/components/hook-form";
|
||||
|
||||
|
||||
type DialogConfirmationType = {
|
||||
@@ -19,12 +20,42 @@ type DialogConfirmationType = {
|
||||
}
|
||||
|
||||
export default function DialogConfirmation({requestLog, setOpenDialog, openDialog, approve, onSubmit} : DialogConfirmationType ) {
|
||||
|
||||
const navigate = useNavigate();
|
||||
|
||||
const [formData, setFormData] = useState({
|
||||
status: approve || '',
|
||||
no_identitas: '',
|
||||
keterangan: '',
|
||||
hak_kamar_pasien: '',
|
||||
penempatan_kamar: '',
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
// Update formData setiap kali approve berubah
|
||||
setFormData(prevData => ({
|
||||
...prevData,
|
||||
status: approve || '',
|
||||
}));
|
||||
}, [approve]);
|
||||
|
||||
const handleChange = (field, value) => {
|
||||
setFormData((prevData) => ({
|
||||
...prevData,
|
||||
[field]: value,
|
||||
}));
|
||||
|
||||
};
|
||||
|
||||
const handleApprove = () => {
|
||||
setFormData((prevData) => ({
|
||||
...prevData,
|
||||
status: approve,
|
||||
}));
|
||||
handleSubmit();
|
||||
};
|
||||
|
||||
|
||||
const handleSubmit = () => {
|
||||
const formData = {
|
||||
status : approve
|
||||
}
|
||||
axios
|
||||
.put(`customer-service/request/${requestLog?.id}`, formData)
|
||||
.then((response) => {
|
||||
@@ -48,10 +79,31 @@ export default function DialogConfirmation({requestLog, setOpenDialog, openDialo
|
||||
marginBottom: 1,
|
||||
}
|
||||
|
||||
const marginBottom2 = {
|
||||
marginBottom: 2,
|
||||
}
|
||||
|
||||
const resetForm = () => {
|
||||
setFormData({
|
||||
status: approve,
|
||||
no_identitas: '',
|
||||
keterangan: '',
|
||||
hak_kamar_pasien: '',
|
||||
penempatan_kamar: '',
|
||||
});
|
||||
};
|
||||
|
||||
const handleCloseDialog = () => {
|
||||
setOpenDialog(false);
|
||||
resetForm();
|
||||
}
|
||||
|
||||
const handleNumericInput = (input: any) => {
|
||||
const numericInput = input.replace(/\D/g, '');
|
||||
return numericInput;
|
||||
};
|
||||
|
||||
|
||||
const getContent = () => (
|
||||
<Stack spacing={1} marginTop={2}>
|
||||
<Typography variant="subtitle2">Are you sure to {approve == 'approved' ? 'approve' : 'deciline'} this request ?</Typography>
|
||||
@@ -82,14 +134,56 @@ export default function DialogConfirmation({requestLog, setOpenDialog, openDialo
|
||||
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.service_type}</Typography>
|
||||
</Stack>
|
||||
</Card>
|
||||
<Card sx={{padding:2, marginTop:2}} >
|
||||
<Stack direction='row' spacing={2} sx={marginBottom2}>
|
||||
<Typography variant='subtitle2' sx={style1} gutterBottom>No Identitas</Typography>
|
||||
<TextField
|
||||
label="No Identitas"
|
||||
variant="outlined"
|
||||
fullWidth
|
||||
value={formData.no_identitas}
|
||||
onChange={(e) => handleChange('no_identitas', handleNumericInput(e.target.value))}
|
||||
/>
|
||||
</Stack>
|
||||
<Stack direction='row' spacing={2} sx={marginBottom2}>
|
||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Keterangan</Typography>
|
||||
<TextField
|
||||
label="Keterangan"
|
||||
variant="outlined"
|
||||
fullWidth
|
||||
value={formData.keterangan}
|
||||
onChange={(e) => handleChange('keterangan', e.target.value)}
|
||||
/>
|
||||
</Stack>
|
||||
<Stack direction='row' spacing={2} sx={marginBottom2}>
|
||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Hak Kamar Pasien</Typography>
|
||||
<TextField
|
||||
label="Hak Kamar Pasien"
|
||||
variant="outlined"
|
||||
fullWidth
|
||||
value={formData.hak_kamar_pasien}
|
||||
onChange={(e) => handleChange('hak_kamar_pasien', e.target.value)}
|
||||
/>
|
||||
</Stack>
|
||||
<Stack direction='row' spacing={2} sx={marginBottom2}>
|
||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Penempatan Kamar</Typography>
|
||||
<TextField
|
||||
label="Penempatan Kamar"
|
||||
variant="outlined"
|
||||
fullWidth
|
||||
value={formData.penempatan_kamar}
|
||||
onChange={(e) => handleChange('penempatan_kamar', e.target.value)}
|
||||
/>
|
||||
</Stack>
|
||||
</Card>
|
||||
</Grid>
|
||||
<DialogActions>
|
||||
<Button variant="outlined" sx={{color: '#212B36', borderColor: '#919EAB52'}} onClick={handleCloseDialog}>Cancel</Button>
|
||||
|
||||
{approve == 'approved' ? (
|
||||
<Button color="primary" variant="contained" onClick={handleSubmit}>Approve</Button>
|
||||
<Button color="primary" variant="contained" onClick={() => handleApprove()}>Approve</Button>
|
||||
) : (
|
||||
<Button color="error" variant="contained" onClick={handleSubmit}>Decline</Button>
|
||||
<Button color="error" variant="contained" onClick={() => handleApprove()}>Decline</Button>
|
||||
|
||||
) }
|
||||
|
||||
</DialogActions>
|
||||
|
||||
@@ -104,6 +104,23 @@ export default function Detail() {
|
||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Submission Date</Typography>
|
||||
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.submission_date ? fDateTimesecond(requestLog?.submission_date) : '-'}</Typography>
|
||||
</Stack>
|
||||
|
||||
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
||||
<Typography variant='subtitle2' sx={style1} gutterBottom>No KTP</Typography>
|
||||
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.no_identitas ? requestLog?.no_identitas : '-'}</Typography>
|
||||
</Stack>
|
||||
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Keterangan</Typography>
|
||||
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.keterangan ? requestLog?.keterangan : '-'}</Typography>
|
||||
</Stack>
|
||||
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Hak Kamar Pasien</Typography>
|
||||
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.hak_kamar_pasien ? requestLog?.hak_kamar_pasien : '-'}</Typography>
|
||||
</Stack>
|
||||
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Penempatan Kamar</Typography>
|
||||
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.penempatan_kamar ? requestLog?.penempatan_kamar : '-'}</Typography>
|
||||
</Stack>
|
||||
</Card>
|
||||
</Grid>
|
||||
<Grid item xs={12} md={12} marginTop={2}>
|
||||
|
||||
@@ -42,9 +42,13 @@ export type DetailRequestLogType = {
|
||||
date_of_birth : string,
|
||||
gender : string,
|
||||
marital_status : string,
|
||||
submission_date : string,
|
||||
submission_date : string,
|
||||
service_type : string,
|
||||
claim_method : string,
|
||||
no_identitas : string,
|
||||
keterangan : string,
|
||||
hak_kamar_pasien : string,
|
||||
penempatan_kamar : string,
|
||||
status : string,
|
||||
benefit : Benefit[],
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user