penyesuaian ambil data submission ke created at
This commit is contained in:
@@ -20,10 +20,11 @@ class RequestLogResource extends JsonResource
|
|||||||
return [Str::slug($file->type, '_') => $file];
|
return [Str::slug($file->type, '_') => $file];
|
||||||
});
|
});
|
||||||
$provider = Organization::where('id', $this->organization_id)->first();
|
$provider = Organization::where('id', $this->organization_id)->first();
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'id' => $this->id,
|
'id' => $this->id,
|
||||||
'code' => $this->code,
|
'code' => $this->code,
|
||||||
|
'created_at' => $this->created_at,
|
||||||
'submission_date' => $this->submission_date,
|
'submission_date' => $this->submission_date,
|
||||||
'submission_date_fgl' => $this->approved_final_log_at,
|
'submission_date_fgl' => $this->approved_final_log_at,
|
||||||
'member_name' => $this->member->name,
|
'member_name' => $this->member->name,
|
||||||
|
|||||||
@@ -106,7 +106,8 @@ class RequestLogShowResource extends JsonResource
|
|||||||
'principal_id' => $requestLog['member']['principal_id'] ? $requestLog['member']['principal_id'] : '-',
|
'principal_id' => $requestLog['member']['principal_id'] ? $requestLog['member']['principal_id'] : '-',
|
||||||
'principal_name' => $requestLog['member']['principal_id'] ? Helper::principalName($requestLog['member']['principal_id']) : '-',
|
'principal_name' => $requestLog['member']['principal_id'] ? Helper::principalName($requestLog['member']['principal_id']) : '-',
|
||||||
'relation_with_principal' => Helper::relationWithPrincipal($requestLog['member']['relation_with_principal']),
|
'relation_with_principal' => Helper::relationWithPrincipal($requestLog['member']['relation_with_principal']),
|
||||||
'submission_date' => $requestLog['submission_date'],
|
'admission_date' => $requestLog['submission_date'], // admission mengacu pada tanggal submit
|
||||||
|
'submission_date' => $requestLog['created_at'], // submission mengacu pada tanggal buat
|
||||||
'approved_final_log_at' => $requestLog['approved_final_log_at'], // submission final log
|
'approved_final_log_at' => $requestLog['approved_final_log_at'], // submission final log
|
||||||
'discharge_date' => $requestLog['discharge_date'],
|
'discharge_date' => $requestLog['discharge_date'],
|
||||||
'service_type' => Helper::serviceName($requestLog['service_code']),
|
'service_type' => Helper::serviceName($requestLog['service_code']),
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ import DialogHospitalCare from './Components/DialogHospitalCare';
|
|||||||
import DialogBenefit from './Components/DialogBenefit';
|
import DialogBenefit from './Components/DialogBenefit';
|
||||||
import DialogMedicine from './Components/DialogMedicine';
|
import DialogMedicine from './Components/DialogMedicine';
|
||||||
import DialogDeleteBenfit from './Components/DialogDeleteBenefit';
|
import DialogDeleteBenfit from './Components/DialogDeleteBenefit';
|
||||||
import DialogEditBenefit from './Components/DialogEditBenefit';
|
import DialogEditBenefit from './Components/DialogEditBenefit';
|
||||||
import DialogDeleteMedicine from './Components/DialogDeleteMedicine'
|
import DialogDeleteMedicine from './Components/DialogDeleteMedicine'
|
||||||
|
|
||||||
import MoreMenu from '@/components/MoreMenu';
|
import MoreMenu from '@/components/MoreMenu';
|
||||||
@@ -66,7 +66,7 @@ export default function Detail() {
|
|||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const { themeStretch } = useSettings();
|
const { themeStretch } = useSettings();
|
||||||
const [requestLog, setRequestLog] = useState<DetailFinalLogType>();
|
const [requestLog, setRequestLog] = useState<DetailFinalLogType>();
|
||||||
|
|
||||||
|
|
||||||
const { id } = useParams();
|
const { id } = useParams();
|
||||||
|
|
||||||
@@ -107,7 +107,7 @@ export default function Detail() {
|
|||||||
// Handel Delete Detail Benefit
|
// Handel Delete Detail Benefit
|
||||||
const [idBenefitData, setIdBenefitData] = useState<number>();
|
const [idBenefitData, setIdBenefitData] = useState<number>();
|
||||||
const [openDialogDeleteBenefit, setDialogDeleteBenefit] = useState(false)
|
const [openDialogDeleteBenefit, setDialogDeleteBenefit] = useState(false)
|
||||||
|
|
||||||
const [idMedicineData, setIdMedicineData] = useState<number>();
|
const [idMedicineData, setIdMedicineData] = useState<number>();
|
||||||
const [openDialogDeleteMedicine, setDialogDeleteMedicine] = useState(false)
|
const [openDialogDeleteMedicine, setDialogDeleteMedicine] = useState(false)
|
||||||
|
|
||||||
@@ -117,7 +117,7 @@ export default function Detail() {
|
|||||||
const [openDialogEditBenefit, setDialogEditBenefit] = useState(false)
|
const [openDialogEditBenefit, setDialogEditBenefit] = useState(false)
|
||||||
const [BenefitConfigurationData, setBenefitConfigurationData] = useState<BenefitData>();
|
const [BenefitConfigurationData, setBenefitConfigurationData] = useState<BenefitData>();
|
||||||
|
|
||||||
// Buat total data
|
// Buat total data
|
||||||
const totalAmountIncurred = (requestLog?.benefit_data || []).reduce((accumulator, item) => {
|
const totalAmountIncurred = (requestLog?.benefit_data || []).reduce((accumulator, item) => {
|
||||||
return accumulator + (item.amount_incurred || 0);
|
return accumulator + (item.amount_incurred || 0);
|
||||||
}, 0);
|
}, 0);
|
||||||
@@ -130,7 +130,7 @@ export default function Detail() {
|
|||||||
const totalExcessPaid = (requestLog?.benefit_data || []).reduce((accumulator, item) => {
|
const totalExcessPaid = (requestLog?.benefit_data || []).reduce((accumulator, item) => {
|
||||||
return accumulator + (item.excess_paid || 0);
|
return accumulator + (item.excess_paid || 0);
|
||||||
}, 0);
|
}, 0);
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Page title='Detail'>
|
<Page title='Detail'>
|
||||||
@@ -143,7 +143,7 @@ export default function Detail() {
|
|||||||
{/* Detail */}
|
{/* Detail */}
|
||||||
<Grid item xs={12} md={12}>
|
<Grid item xs={12} md={12}>
|
||||||
<Card sx={{padding:2}} >
|
<Card sx={{padding:2}} >
|
||||||
<Grid container spacing={2}>
|
<Grid container spacing={2}>
|
||||||
<Grid item xs={6}>
|
<Grid item xs={6}>
|
||||||
<Typography variant='subtitle1' sx={{ color: '#19BBBB', marginBottom: 4 }} gutterBottom>
|
<Typography variant='subtitle1' sx={{ color: '#19BBBB', marginBottom: 4 }} gutterBottom>
|
||||||
Detail
|
Detail
|
||||||
@@ -164,7 +164,7 @@ export default function Detail() {
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</Grid>) : null }
|
</Grid>) : null }
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
||||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Provider</Typography>
|
<Typography variant='subtitle2' sx={style1} gutterBottom>Provider</Typography>
|
||||||
@@ -192,7 +192,11 @@ export default function Detail() {
|
|||||||
</Stack>
|
</Stack>
|
||||||
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
||||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Submission Date</Typography>
|
<Typography variant='subtitle2' sx={style1} gutterBottom>Submission Date</Typography>
|
||||||
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.approved_final_log_at ? fDateTimesecond(requestLog?.approved_final_log_at) : '-'}</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>Admission Date</Typography>
|
||||||
|
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.admission_date ? fDateTimesecond(requestLog?.admission_date) : '-'}</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|
||||||
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
||||||
@@ -245,16 +249,16 @@ export default function Detail() {
|
|||||||
|
|
||||||
{/* Service */}
|
{/* Service */}
|
||||||
<Grid item xs={12} md={12} marginTop={2}>
|
<Grid item xs={12} md={12} marginTop={2}>
|
||||||
<CardService
|
<CardService
|
||||||
requestLog={requestLog}
|
requestLog={requestLog}
|
||||||
isFinalLog={true}
|
isFinalLog={true}
|
||||||
>
|
>
|
||||||
</CardService>
|
</CardService>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
{/* Exclusion */}
|
{/* Exclusion */}
|
||||||
<Grid item xs={12} md={12} marginTop={2}>
|
<Grid item xs={12} md={12} marginTop={2}>
|
||||||
{/* <CardExclusion
|
{/* <CardExclusion
|
||||||
requestLog={requestLog}
|
requestLog={requestLog}
|
||||||
>
|
>
|
||||||
</CardExclusion> */}
|
</CardExclusion> */}
|
||||||
@@ -276,7 +280,7 @@ export default function Detail() {
|
|||||||
requestLog={requestLog}
|
requestLog={requestLog}
|
||||||
openDialog={openDialogHospital}
|
openDialog={openDialogHospital}
|
||||||
setOpenDialog={setDialogHospital}
|
setOpenDialog={setDialogHospital}
|
||||||
|
|
||||||
>
|
>
|
||||||
</DialogHospitalCare>
|
</DialogHospitalCare>
|
||||||
</Grid> */}
|
</Grid> */}
|
||||||
@@ -294,7 +298,7 @@ export default function Detail() {
|
|||||||
</Stack>
|
</Stack>
|
||||||
|
|
||||||
{requestLog?.benefit_data?.map((item, index) => (
|
{requestLog?.benefit_data?.map((item, index) => (
|
||||||
<Box key={index} sx={{ border: '1px solid rgba(0,0,0,0.125)', px: '24px', py: '20px', marginBottom: '24px', borderRadius: '12px'}}>
|
<Box key={index} sx={{ border: '1px solid rgba(0,0,0,0.125)', px: '24px', py: '20px', marginBottom: '24px', borderRadius: '12px'}}>
|
||||||
<Grid container spacing={2}>
|
<Grid container spacing={2}>
|
||||||
<Grid item xs={12}>
|
<Grid item xs={12}>
|
||||||
<Grid container spacing={2}>
|
<Grid container spacing={2}>
|
||||||
@@ -415,14 +419,14 @@ export default function Detail() {
|
|||||||
</Grid>
|
</Grid>
|
||||||
</Box>
|
</Box>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Box>
|
</Box>
|
||||||
))}
|
))}
|
||||||
<hr/>
|
<hr/>
|
||||||
<br/>
|
<br/>
|
||||||
{requestLog?.benefit_data && requestLog.benefit_data.length > 0 ? (
|
{requestLog?.benefit_data && requestLog.benefit_data.length > 0 ? (
|
||||||
<Box key={requestLog.benefit_data.length+1} sx={{ border: '1px solid rgba(0,0,0,0.125)', px: '24px', py: '20px', marginBottom: '24px', borderRadius: '12px'}}>
|
<Box key={requestLog.benefit_data.length+1} sx={{ border: '1px solid rgba(0,0,0,0.125)', px: '24px', py: '20px', marginBottom: '24px', borderRadius: '12px'}}>
|
||||||
<Grid container spacing={2}>
|
<Grid container spacing={2}>
|
||||||
<Grid item xs={12}>
|
<Grid item xs={12}>
|
||||||
<Grid container spacing={2}>
|
<Grid container spacing={2}>
|
||||||
@@ -431,7 +435,7 @@ export default function Detail() {
|
|||||||
Total Benefit
|
Total Benefit
|
||||||
</Typography>
|
</Typography>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={12}>
|
<Grid item xs={12}>
|
||||||
@@ -504,13 +508,13 @@ export default function Detail() {
|
|||||||
</Grid>
|
</Grid>
|
||||||
</Box>
|
</Box>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Box>
|
</Box>
|
||||||
)
|
)
|
||||||
: (
|
: (
|
||||||
null
|
null
|
||||||
)}
|
)}
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
{/* PR Buat pindahin ke componen */}
|
{/* PR Buat pindahin ke componen */}
|
||||||
@@ -523,7 +527,7 @@ export default function Detail() {
|
|||||||
requestLog={requestLog}
|
requestLog={requestLog}
|
||||||
openDialog={openDialogBenefit}
|
openDialog={openDialogBenefit}
|
||||||
setOpenDialog={setDialogBenefit}
|
setOpenDialog={setDialogBenefit}
|
||||||
|
|
||||||
/>
|
/>
|
||||||
{/* Dialog Edit */}
|
{/* Dialog Edit */}
|
||||||
<DialogEditBenefit
|
<DialogEditBenefit
|
||||||
@@ -534,14 +538,14 @@ export default function Detail() {
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
{/* Dialog Delete */}
|
{/* Dialog Delete */}
|
||||||
<DialogDeleteBenfit
|
<DialogDeleteBenfit
|
||||||
id={idBenefitData}
|
id={idBenefitData}
|
||||||
openDialog={openDialogDeleteBenefit}
|
openDialog={openDialogDeleteBenefit}
|
||||||
setOpenDialog={setDialogDeleteBenefit}
|
setOpenDialog={setDialogDeleteBenefit}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* Dialog Edit Detai; */}
|
{/* Dialog Edit Detai; */}
|
||||||
<DialogEditFinalLOG
|
<DialogEditFinalLOG
|
||||||
setOpenDialog={setDialogDEditDetail}
|
setOpenDialog={setDialogDEditDetail}
|
||||||
requestLog={requestLog}
|
requestLog={requestLog}
|
||||||
openDialog={openDialogEditDetail}
|
openDialog={openDialogEditDetail}
|
||||||
@@ -637,7 +641,7 @@ export default function Detail() {
|
|||||||
</Stack>
|
</Stack>
|
||||||
</Grid>
|
</Grid>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Container>
|
</Container>
|
||||||
</Page>
|
</Page>
|
||||||
|
|||||||
@@ -350,7 +350,7 @@ export default function List() {
|
|||||||
<TableCell align="left">{row.code}</TableCell>
|
<TableCell align="left">{row.code}</TableCell>
|
||||||
<TableCell align="left">{row.provider}</TableCell>
|
<TableCell align="left">{row.provider}</TableCell>
|
||||||
<TableCell align="left">{row.member_name}</TableCell>
|
<TableCell align="left">{row.member_name}</TableCell>
|
||||||
<TableCell align="left"><Label>{fDateTimesecond(row.submission_date_fgl)}</Label></TableCell>
|
<TableCell align="left"><Label>{fDateTimesecond(row.created_at)}</Label></TableCell>
|
||||||
<TableCell align="left">{row.service_name}</TableCell>
|
<TableCell align="left">{row.service_name}</TableCell>
|
||||||
<TableCell align="left">{row.payment_type_name}</TableCell>
|
<TableCell align="left">{row.payment_type_name}</TableCell>
|
||||||
<TableCell align="left">
|
<TableCell align="left">
|
||||||
@@ -577,7 +577,7 @@ export default function List() {
|
|||||||
</Grid>
|
</Grid>
|
||||||
<Grid item sm={12}>
|
<Grid item sm={12}>
|
||||||
{/* Dialog Delete */}
|
{/* Dialog Delete */}
|
||||||
<DialogDeleteFinalLOG
|
<DialogDeleteFinalLOG
|
||||||
id={idFinalLog}
|
id={idFinalLog}
|
||||||
openDialog={openDialogDeleteFinalLog}
|
openDialog={openDialogDeleteFinalLog}
|
||||||
setOpenDialog={setDialogDeleteFinalLog}
|
setOpenDialog={setDialogDeleteFinalLog}
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ export type FinalLogType = {
|
|||||||
member : Member,
|
member : Member,
|
||||||
member_name : string,
|
member_name : string,
|
||||||
submission_date_fgl : string,
|
submission_date_fgl : string,
|
||||||
|
submission_date : string,
|
||||||
|
created_at : string,
|
||||||
service_name : string,
|
service_name : string,
|
||||||
payment_type_name : string,
|
payment_type_name : string,
|
||||||
status_final_log : string,
|
status_final_log : string,
|
||||||
@@ -28,7 +30,7 @@ export type FinalLogType = {
|
|||||||
export type DetailFinalLogType = {
|
export type DetailFinalLogType = {
|
||||||
id : number,
|
id : number,
|
||||||
code : string,
|
code : string,
|
||||||
member_id : string,
|
member_id : string,
|
||||||
provider : string,
|
provider : string,
|
||||||
policy_number : string,
|
policy_number : string,
|
||||||
name : string|any,
|
name : string|any,
|
||||||
|
|||||||
Reference in New Issue
Block a user