Merge remote-tracking branch 'origin/staging' into origin/production
This commit is contained in:
@@ -172,8 +172,10 @@ class RequestLogController extends Controller
|
||||
'member.currentPlan' => function($memberPlan) {
|
||||
$memberPlan->join('request_logs', 'request_logs.service_code', '=', 'plans.service_code');
|
||||
},
|
||||
// 'member.current_policy',
|
||||
'claim',
|
||||
'organization',
|
||||
|
||||
]);
|
||||
|
||||
return Helper::responseJson(data: RequestLogShowResource::make($claimRequest));
|
||||
@@ -198,6 +200,12 @@ class RequestLogController extends Controller
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
$requestLog = RequestLog::findOrFail($id);
|
||||
$requestLog->keterangan = $request->keterangan;
|
||||
$requestLog->hak_kamar_pasien = $request->hak_kamar_pasien;
|
||||
$requestLog->penempatan_kamar = $request->penempatan_kamar;
|
||||
$requestLog->catatan = $request->catatan;
|
||||
$requestLog->no_identitas = $request->no_identitas;
|
||||
|
||||
$requestLog->status = $request->status;
|
||||
$requestLog->approved_by = auth()->user()->id;
|
||||
$requestLog->approved_at = Carbon::now();
|
||||
@@ -313,6 +321,7 @@ class RequestLogController extends Controller
|
||||
|
||||
|
||||
// Update Request LOG untuk lanjut ke Final LOG
|
||||
$requestLog->catatan = $request->catatan;
|
||||
$requestLog->final_log = 1;
|
||||
$requestLog->status_final_log = $status;
|
||||
$requestLog->approved_final_log_by = auth()->user()->id;
|
||||
|
||||
@@ -93,6 +93,11 @@ class RequestLogShowResource extends JsonResource
|
||||
'medicine' => $medicineData,
|
||||
'files' => $requestLog['files'],
|
||||
|
||||
'no_identitas' => $requestLog['no_identitas'],
|
||||
'keterangan' => $requestLog['keterangan'],
|
||||
'hak_kamar_pasien' => $requestLog['hak_kamar_pasien'],
|
||||
'penempatan_kamar' => $requestLog['penempatan_kamar'],
|
||||
|
||||
|
||||
];
|
||||
|
||||
|
||||
@@ -30,6 +30,11 @@ class RequestLog extends Model
|
||||
'source',
|
||||
'claim_id',
|
||||
'organization_id',
|
||||
'keterangan',
|
||||
'hak_kamar_pasien',
|
||||
'penempatan_kamar',
|
||||
'catatan',
|
||||
'no_identitas',
|
||||
'code',
|
||||
'approved_by',
|
||||
'approved_at',
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('request_logs', function (Blueprint $table) {
|
||||
$table->string('keterangan')->after('organization_id')->default(null);
|
||||
$table->string('hak_kamar_pasien')->after('keterangan')->default(null);
|
||||
$table->string('penempatan_kamar')->after('hak_kamar_pasien')->default(null);
|
||||
$table->string('catatan')->after('penempatan_kamar')->default(null);
|
||||
$table->string('no_identitas')->after('catatan')->default(null);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('request_logs', function (Blueprint $table) {
|
||||
$table->dropColumn('keterangan');
|
||||
$table->dropColumn('hak_kamar_pasien');
|
||||
$table->dropColumn('penempatan_kamar');
|
||||
$table->dropColumn('catatan');
|
||||
$table->dropColumn('no_identitas');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -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