From 43991c1069f74b15fd6a012893cc47ec553f68a3 Mon Sep 17 00:00:00 2001 From: Tb Fajri Date: Sun, 7 Jan 2024 08:14:38 +0700 Subject: [PATCH 1/3] update bugs final log --- .../dashboard/src/pages/CustomerService/FinalLog/Index.tsx | 6 +++--- .../dashboard/src/pages/CustomerService/FinalLog/List.tsx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/dashboard/src/pages/CustomerService/FinalLog/Index.tsx b/frontend/dashboard/src/pages/CustomerService/FinalLog/Index.tsx index d26903b0..22040b7d 100644 --- a/frontend/dashboard/src/pages/CustomerService/FinalLog/Index.tsx +++ b/frontend/dashboard/src/pages/CustomerService/FinalLog/Index.tsx @@ -7,7 +7,7 @@ import List from "./List"; export default function Claims() { - const pageTitle = 'Claim Request'; + const pageTitle = 'Final LOG'; return ( @@ -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', }, ]} /> diff --git a/frontend/dashboard/src/pages/CustomerService/FinalLog/List.tsx b/frontend/dashboard/src/pages/CustomerService/FinalLog/List.tsx index fe591df7..a70fb942 100644 --- a/frontend/dashboard/src/pages/CustomerService/FinalLog/List.tsx +++ b/frontend/dashboard/src/pages/CustomerService/FinalLog/List.tsx @@ -354,7 +354,7 @@ export default function List() { */} {row.code} - {row.member?.full_name} + {row.member_name} {row.service_name} {row.payment_type_name} From 0bc965f96eb3cd5b48ac40d9e6b91de48041a027 Mon Sep 17 00:00:00 2001 From: Tb Fajri Date: Sun, 7 Jan 2024 09:20:30 +0700 Subject: [PATCH 2/3] update field pdf request log --- app/Models/RequestLog.php | 5 +++ ...091026_add_column_to_request_log_table.php | 40 +++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 database/migrations/2024_01_07_091026_add_column_to_request_log_table.php diff --git a/app/Models/RequestLog.php b/app/Models/RequestLog.php index 9204e8f4..0ce83e18 100644 --- a/app/Models/RequestLog.php +++ b/app/Models/RequestLog.php @@ -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', diff --git a/database/migrations/2024_01_07_091026_add_column_to_request_log_table.php b/database/migrations/2024_01_07_091026_add_column_to_request_log_table.php new file mode 100644 index 00000000..9cbcb244 --- /dev/null +++ b/database/migrations/2024_01_07_091026_add_column_to_request_log_table.php @@ -0,0 +1,40 @@ +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'); + }); + } +}; From 5c26076806fd69890147935b75fc6857bf5649c7 Mon Sep 17 00:00:00 2001 From: Tb Fajri Date: Sun, 7 Jan 2024 12:03:55 +0700 Subject: [PATCH 3/3] update request log --- .../Controllers/Api/RequestLogController.php | 9 ++ .../Transformers/RequestLogShowResource.php | 5 + .../Request/Components/DialogConfirmation.tsx | 112 ++++++++++++++++-- .../pages/CustomerService/Request/Detail.tsx | 17 +++ .../CustomerService/Request/Model/Types.tsx | 6 +- 5 files changed, 139 insertions(+), 10 deletions(-) diff --git a/Modules/Internal/Http/Controllers/Api/RequestLogController.php b/Modules/Internal/Http/Controllers/Api/RequestLogController.php index 1dcc8e55..bf66f5ac 100644 --- a/Modules/Internal/Http/Controllers/Api/RequestLogController.php +++ b/Modules/Internal/Http/Controllers/Api/RequestLogController.php @@ -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; diff --git a/Modules/Internal/Transformers/RequestLogShowResource.php b/Modules/Internal/Transformers/RequestLogShowResource.php index 480eb3f1..4bb86bce 100644 --- a/Modules/Internal/Transformers/RequestLogShowResource.php +++ b/Modules/Internal/Transformers/RequestLogShowResource.php @@ -85,6 +85,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'], + ]; diff --git a/frontend/dashboard/src/pages/CustomerService/Request/Components/DialogConfirmation.tsx b/frontend/dashboard/src/pages/CustomerService/Request/Components/DialogConfirmation.tsx index fe3a734b..96e467da 100644 --- a/frontend/dashboard/src/pages/CustomerService/Request/Components/DialogConfirmation.tsx +++ b/frontend/dashboard/src/pages/CustomerService/Request/Components/DialogConfirmation.tsx @@ -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 = () => ( Are you sure to {approve == 'approved' ? 'approve' : 'deciline'} this request ? @@ -82,14 +134,56 @@ export default function DialogConfirmation({requestLog, setOpenDialog, openDialo {requestLog?.service_type} + + + No Identitas + handleChange('no_identitas', handleNumericInput(e.target.value))} + /> + + + Keterangan + handleChange('keterangan', e.target.value)} + /> + + + Hak Kamar Pasien + handleChange('hak_kamar_pasien', e.target.value)} + /> + + + Penempatan Kamar + handleChange('penempatan_kamar', e.target.value)} + /> + + - {approve == 'approved' ? ( - + ) : ( - + + ) } diff --git a/frontend/dashboard/src/pages/CustomerService/Request/Detail.tsx b/frontend/dashboard/src/pages/CustomerService/Request/Detail.tsx index db8cc17d..3cec05cd 100644 --- a/frontend/dashboard/src/pages/CustomerService/Request/Detail.tsx +++ b/frontend/dashboard/src/pages/CustomerService/Request/Detail.tsx @@ -104,6 +104,23 @@ export default function Detail() { Submission Date {requestLog?.submission_date ? fDateTimesecond(requestLog?.submission_date) : '-'} + + + No KTP + {requestLog?.no_identitas ? requestLog?.no_identitas : '-'} + + + Keterangan + {requestLog?.keterangan ? requestLog?.keterangan : '-'} + + + Hak Kamar Pasien + {requestLog?.hak_kamar_pasien ? requestLog?.hak_kamar_pasien : '-'} + + + Penempatan Kamar + {requestLog?.penempatan_kamar ? requestLog?.penempatan_kamar : '-'} + diff --git a/frontend/dashboard/src/pages/CustomerService/Request/Model/Types.tsx b/frontend/dashboard/src/pages/CustomerService/Request/Model/Types.tsx index 0091c213..44bdbec7 100644 --- a/frontend/dashboard/src/pages/CustomerService/Request/Model/Types.tsx +++ b/frontend/dashboard/src/pages/CustomerService/Request/Model/Types.tsx @@ -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[], }