diff --git a/Modules/Internal/Http/Controllers/Api/RequestLogController.php b/Modules/Internal/Http/Controllers/Api/RequestLogController.php
index 8402d5bc..09d5b923 100755
--- a/Modules/Internal/Http/Controllers/Api/RequestLogController.php
+++ b/Modules/Internal/Http/Controllers/Api/RequestLogController.php
@@ -489,7 +489,11 @@ class RequestLogController extends Controller
if (!empty($request->reason)) {
$requestLog->reason_final = $request->reason;
}
-
+
+ if (!empty($request->type_of_member)){
+ $requestLog->type_of_member = $request->type_of_member;
+ }
+
$requestLog->final_log = 1;
$requestLog->approved_final_log_by = auth()->user()->id;
$requestLog->approved_final_log_at = Carbon::now();
diff --git a/frontend/dashboard/src/pages/CustomerService/FinalLog/Components/DialogConfirmation.tsx b/frontend/dashboard/src/pages/CustomerService/FinalLog/Components/DialogConfirmation.tsx
index 232856b4..c4c3f9b7 100755
--- a/frontend/dashboard/src/pages/CustomerService/FinalLog/Components/DialogConfirmation.tsx
+++ b/frontend/dashboard/src/pages/CustomerService/FinalLog/Components/DialogConfirmation.tsx
@@ -1,5 +1,5 @@
import MuiDialog from "@/components/MuiDialog";
-import { Autocomplete, Button, Card, DialogActions, Grid, TextField, Typography } from "@mui/material";
+import { Autocomplete, Button, Card, DialogActions, Grid, MenuItem, Select, TextField, Typography } from "@mui/material";
import { Stack } from '@mui/material';
import React, { useEffect, useState } from 'react';
import { DetailFinalLogType } from "../Model/Types";
@@ -25,9 +25,12 @@ export default function DialogConfirmation({requestLog, setOpenDialog, openDialo
id: requestLog?.id,
status: approve || '',
catatan: '',
+ type_of_member: '' ,
icdCodes: requestLog?.diagnosis.length ? requestLog.diagnosis.map(diagnosis => ({ value: diagnosis.id, label: diagnosis.name })) : []
});
+ const [error, setError] = useState(false);
+
const [icdOptions, setIcdOptions] = useState([
{ value: '-', label: '-' }
]);
@@ -69,20 +72,26 @@ export default function DialogConfirmation({requestLog, setOpenDialog, openDialo
}
const handleSubmit = () => {
- axios
- .post(`customer-service/request/final-log`, formData)
- .then((response) => {
- enqueueSnackbar('Verification Request LOG Success', { variant: 'success' });
- setOpenDialog(false);
- if (requestLog?.service_type === 'Inpatient') {
- navigate('/case_management/inpatient_monitoring');
- } else {
- navigate('/custormer-service/final-log');
- }
- })
- .catch(({ response }) => {
- enqueueSnackbar(response.data.message ?? 'Something went wrong!', { variant: 'error' });
- });
+ if (formData.type_of_member === "" && requestLog?.corporate_id === 5) { // corporate vale
+ setError(true);
+ alert('Silakan pilih Type Of Member sebelum mengirimkan data.');
+ }
+ else {
+ axios
+ .post(`customer-service/request/final-log`, formData)
+ .then((response) => {
+ enqueueSnackbar('Verification Request LOG Success', { variant: 'success' });
+ setOpenDialog(false);
+ if (requestLog?.service_type === 'Inpatient') {
+ navigate('/case_management/inpatient_monitoring');
+ } else {
+ navigate('/custormer-service/final-log');
+ }
+ })
+ .catch(({ response }) => {
+ enqueueSnackbar(response.data.message ?? 'Something went wrong!', { variant: 'error' });
+ });
+ }
}
const style1 = {
@@ -179,6 +188,24 @@ export default function DialogConfirmation({requestLog, setOpenDialog, openDialo
)}
/>
+
+ Type Of Member*
+
+
diff --git a/frontend/dashboard/src/pages/CustomerService/FinalLog/Components/DialogEditFinalLOG.tsx b/frontend/dashboard/src/pages/CustomerService/FinalLog/Components/DialogEditFinalLOG.tsx
index 3da8b4dc..6b87f2c9 100755
--- a/frontend/dashboard/src/pages/CustomerService/FinalLog/Components/DialogEditFinalLOG.tsx
+++ b/frontend/dashboard/src/pages/CustomerService/FinalLog/Components/DialogEditFinalLOG.tsx
@@ -1,7 +1,7 @@
import MuiDialog from "@/components/MuiDialog";
-import { Autocomplete, Button, Card, Checkbox, DialogActions, Grid, TextField, Typography } from "@mui/material";
+import { Autocomplete, Button, Card, Checkbox, DialogActions, Grid, TextField, Typography, Select } from "@mui/material";
import { Paper } from "@mui/material";
-import { Stack } from '@mui/material';
+import { Stack, MenuItem } from '@mui/material';
import React, { useEffect, useState } from 'react';
import { DetailFinalLogType } from "../Model/Types";
import { fDateOnly, fDateTimesecond, toTitleCase } from "@/utils/formatTime";
@@ -27,8 +27,11 @@ export default function DialogEditFinalLOG({requestLog, setOpenDialog, openDialo
id: requestLog?.id,
catatan: requestLog?.catatan,
icdCodes: requestLog?.diagnosis,
- reason: requestLog?.reason
+ reason: requestLog?.reason,
+ type_of_member: requestLog?.type_of_member
});
+
+ const [error, setError] = useState(false);
const [icdOptions, setIcdOptions] = useState([
{ value: '-', label: '-' }
@@ -49,17 +52,16 @@ export default function DialogEditFinalLOG({requestLog, setOpenDialog, openDialo
}, []); // useEffect dijalankan hanya sekali saat komponen dimount
useEffect(() => {
- if (requestLog) {
setFormData({
- discharge_date: requestLog.discharge_date,
- billing_no: requestLog.billing_no,
- invoice_no: requestLog.invoice_no,
- id: requestLog.id,
- catatan: requestLog.catatan,
- icdCodes: requestLog.diagnosis,
- reason: requestLog.reason
+ discharge_date: requestLog?.discharge_date|| '',
+ billing_no: requestLog?.billing_no|| '',
+ invoice_no: requestLog?.invoice_no|| '',
+ id: requestLog?.id|| 0,
+ catatan: requestLog?.catatan|| '',
+ icdCodes: requestLog?.diagnosis|| [],
+ reason: requestLog?.reason|| '',
+ type_of_member: requestLog?.type_of_member|| '',
});
- }
}, [requestLog]);
@@ -94,7 +96,11 @@ export default function DialogEditFinalLOG({requestLog, setOpenDialog, openDialo
const handleSubmit = () => {
- if (isReasonSelected && formData.reason !== '') {
+ if (formData.type_of_member === "" && requestLog?.corporate_id === 4) {
+ setError(true);
+ alert('Silakan pilih Type Of Member sebelum mengirimkan data.');
+ }
+ else if (isReasonSelected && formData.reason !== '') {
axios
.post(`customer-service/request/final-log`, formData)
.then((response) => {
@@ -128,13 +134,14 @@ export default function DialogEditFinalLOG({requestLog, setOpenDialog, openDialo
const resetForm = () => {
setFormData({
- discharge_date: requestLog?.discharge_date,
- id: requestLog?.id,
- billing_no: requestLog?.billing_no,
- invoice_no: requestLog?.invoice_no,
- catatan: requestLog?.catatan,
- icdCodes: requestLog?.diagnosis,
- reason: requestLog?.reason
+ discharge_date: requestLog?.discharge_date ?? '',
+ id: requestLog?.id ?? 0,
+ billing_no: requestLog?.billing_no ?? '',
+ invoice_no: requestLog?.invoice_no ?? '',
+ catatan: requestLog?.catatan ?? '',
+ icdCodes: requestLog?.diagnosis ?? [],
+ reason: requestLog?.reason ?? '',
+ type_of_member: requestLog?.type_of_member ?? '',
});
};
const [isReasonSelected, setIsReasonSelected] = useState(true);
@@ -152,7 +159,7 @@ export default function DialogEditFinalLOG({requestLog, setOpenDialog, openDialo
// Add more options as needed
];
-
+ console.log(formData.type_of_member)
const getContent = () => (
@@ -206,6 +213,24 @@ export default function DialogEditFinalLOG({requestLog, setOpenDialog, openDialo
onChange={(e) => handleChange('billing_no', e.target.value)}
/>
+
+ Type Of Member*
+
+
Discharge Date
{
- if (formData.type_of_member === "" && requestLog?.corporate_id === 4) {
+ if (formData.type_of_member === "" && requestLog?.corporate_id === 5) {
setError(true);
alert('Silakan pilih Type Of Member sebelum mengirimkan data.');
} else {
diff --git a/frontend/dashboard/src/pages/CustomerService/Request/Components/DialogEditInformation.tsx b/frontend/dashboard/src/pages/CustomerService/Request/Components/DialogEditInformation.tsx
index 7202392f..6af20e57 100755
--- a/frontend/dashboard/src/pages/CustomerService/Request/Components/DialogEditInformation.tsx
+++ b/frontend/dashboard/src/pages/CustomerService/Request/Components/DialogEditInformation.tsx
@@ -68,7 +68,7 @@ export default function DialogEditInformation({requestLog, setOpenDialog, openDi
const handleSubmit = () => {
- if (formData.type_of_member === "" && requestLog?.corporate_id === 4) {
+ if (formData.type_of_member === "" && requestLog?.corporate_id === 5) {
setError(true);
alert('Silakan pilih Type Of Member sebelum mengirimkan data.');
} else if (isReasonSelected && formData.reason !== '') {
diff --git a/frontend/dashboard/src/pages/CustomerService/Request/Model/Types.tsx b/frontend/dashboard/src/pages/CustomerService/Request/Model/Types.tsx
index ba3db071..209fab3a 100755
--- a/frontend/dashboard/src/pages/CustomerService/Request/Model/Types.tsx
+++ b/frontend/dashboard/src/pages/CustomerService/Request/Model/Types.tsx
@@ -57,6 +57,7 @@ export type DetailRequestLogType = {
benefit : Benefit[],
reason : string,
type_of_member : string,
+ corporate_id : number
}
export type Benefit = {