update approval di list approval
This commit is contained in:
@@ -346,6 +346,11 @@ class RequestLogController extends Controller
|
|||||||
$requestLog->approved_at = Carbon::now();
|
$requestLog->approved_at = Carbon::now();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($request->status_approval){
|
||||||
|
$requestLog->status_approval = $request->status_approval;
|
||||||
|
$requestLog->approval_nominal_by = auth()->user()->id;
|
||||||
|
}
|
||||||
|
|
||||||
$requestLog->save();
|
$requestLog->save();
|
||||||
|
|
||||||
// update nirc member
|
// update nirc member
|
||||||
|
|||||||
@@ -31,6 +31,8 @@ class RequestLogResource extends JsonResource
|
|||||||
'status' => $this->status ?? 'unknown',
|
'status' => $this->status ?? 'unknown',
|
||||||
'provider' => $provider ? $provider->name : '-',
|
'provider' => $provider ? $provider->name : '-',
|
||||||
'status_final_log' => $this->status_final_log ?? 'unknown',
|
'status_final_log' => $this->status_final_log ?? 'unknown',
|
||||||
|
'nominal' => $this->nominal ?? 'unknown',
|
||||||
|
'status_approval' => $this->status_approval ?? 'requested',
|
||||||
'service_name' => $this->service ? $this->service->name : '',
|
'service_name' => $this->service ? $this->service->name : '',
|
||||||
'payment_type' => $this->payment_type,
|
'payment_type' => $this->payment_type,
|
||||||
'payment_type_name' => $this->payment_type_name,
|
'payment_type_name' => $this->payment_type_name,
|
||||||
|
|||||||
@@ -175,10 +175,11 @@ class RequestLogShowResource extends JsonResource
|
|||||||
'hak_kamar_pasien' => $requestLog['hak_kamar_pasien'],
|
'hak_kamar_pasien' => $requestLog['hak_kamar_pasien'],
|
||||||
'penempatan_kamar' => $requestLog['penempatan_kamar'],
|
'penempatan_kamar' => $requestLog['penempatan_kamar'],
|
||||||
'nominal' => $requestLog['nominal'],
|
'nominal' => $requestLog['nominal'],
|
||||||
|
'status_approval' => $requestLog['status_approval'],
|
||||||
'catatan' => $requestLog['catatan'],
|
'catatan' => $requestLog['catatan'],
|
||||||
'reason' => $requestLog['reason'],
|
'reason' => $requestLog['reason'],
|
||||||
'diagnosis' => $icd,
|
'diagnosis' => $icd,
|
||||||
'url_approval' => env('LMS_WEB_URL') . '/custormer-service/final-log/detail/'.$requestLog['id'],
|
'url_approval' => env('LMS_WEB_URL') . '/custormer-service/final-log/detail/'.$requestLog['id'] . '/' . auth()->user()->id,
|
||||||
'is_reversal' => $isReversal, // untuk penjagaan, jika true tidak bisa di edit/hapus lagi
|
'is_reversal' => $isReversal, // untuk penjagaan, jika true tidak bisa di edit/hapus lagi
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ class RequestLog extends Model
|
|||||||
'final_log',
|
'final_log',
|
||||||
'status',
|
'status',
|
||||||
'status_final_log',
|
'status_final_log',
|
||||||
|
'status_approval',
|
||||||
'source',
|
'source',
|
||||||
'claim_id',
|
'claim_id',
|
||||||
'organization_id',
|
'organization_id',
|
||||||
@@ -55,6 +56,7 @@ class RequestLog extends Model
|
|||||||
'dppj',
|
'dppj',
|
||||||
'type_of_member',
|
'type_of_member',
|
||||||
'nominal',
|
'nominal',
|
||||||
|
'approval_nominal_by',
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $hidden = [
|
protected $hidden = [
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ return new class extends Migration
|
|||||||
{
|
{
|
||||||
Schema::table('request_logs', function (Blueprint $table) {
|
Schema::table('request_logs', function (Blueprint $table) {
|
||||||
$table->integer('nominal')->default(0)->after('total_cob');
|
$table->integer('nominal')->default(0)->after('total_cob');
|
||||||
|
$table->string('status_approval')->nullable()->after('status_final_log');
|
||||||
|
$table->integer('approval_nominal_by')->nullable()->after('status_approval');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -27,6 +29,8 @@ return new class extends Migration
|
|||||||
{
|
{
|
||||||
Schema::table('table_request_log', function (Blueprint $table) {
|
Schema::table('table_request_log', function (Blueprint $table) {
|
||||||
$table->dropColumn('nominal');
|
$table->dropColumn('nominal');
|
||||||
|
$table->dropColumn('status_approval');
|
||||||
|
$table->dropColumn('approval_nominal_by');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -367,6 +367,39 @@ export default function List() {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const updateApproval = async (id:any) => {
|
||||||
|
axios
|
||||||
|
.put(`/customer-service/request/${id}`, {
|
||||||
|
status_approval: 'approved',
|
||||||
|
})
|
||||||
|
.then((response) => {
|
||||||
|
enqueueSnackbar('Berhasil Approve', { variant: 'success' });
|
||||||
|
window.location.reload();
|
||||||
|
})
|
||||||
|
.catch(({ response }) => {
|
||||||
|
enqueueSnackbar(response?.data?.message || 'Something Went Wrong', { variant: 'error' });
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
const updateDecline = async (id:any) => {
|
||||||
|
axios
|
||||||
|
.put(`/customer-service/request/${id}`, {
|
||||||
|
status_approval: 'declined',
|
||||||
|
})
|
||||||
|
.then((response) => {
|
||||||
|
enqueueSnackbar('Berhasil Approve', { variant: 'success' });
|
||||||
|
window.location.reload();
|
||||||
|
})
|
||||||
|
.catch(({ response }) => {
|
||||||
|
enqueueSnackbar(response?.data?.message || 'Something Went Wrong', { variant: 'error' });
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
/* ------------------ TABLE ROW ------------------ */
|
/* ------------------ TABLE ROW ------------------ */
|
||||||
}
|
}
|
||||||
@@ -423,14 +456,38 @@ export default function List() {
|
|||||||
)}
|
)}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell align="left">
|
<TableCell align="left">
|
||||||
{ row.status_final_log == "requested" ?
|
{ row.status_approval == "requested" ?
|
||||||
(<Label variant='ghost' color='primary'>{capitalizeFirstLetter(row.status_final_log)}</Label>) :
|
(<Label variant='ghost' color='primary'>{capitalizeFirstLetter(row.status_approval)}</Label>) :
|
||||||
row.status_final_log == "declined" ?
|
row.status_approval == "declined" ?
|
||||||
(<Label color='error'> {capitalizeFirstLetter(row.status_final_log)}</Label>)
|
(<Label color='error'> {capitalizeFirstLetter(row.status_approval)}</Label>)
|
||||||
:
|
:
|
||||||
(<Label color='success'> {capitalizeFirstLetter(row.status_final_log)}</Label>)
|
(<Label color='success'> {capitalizeFirstLetter(row.status_approval)}</Label>)
|
||||||
}
|
}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
<TableCell align="left">{fCurrency(row.nominal)}</TableCell>
|
||||||
|
<TableCell align="left">
|
||||||
|
{row.status_approval !== "approved" && (
|
||||||
|
<Stack direction="row" spacing={1.5} mt={2}>
|
||||||
|
<Button
|
||||||
|
color="error"
|
||||||
|
variant="outlined"
|
||||||
|
size="small"
|
||||||
|
onClick={() => updateDecline(row.id)}
|
||||||
|
>
|
||||||
|
Decline
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
variant="contained"
|
||||||
|
size="small"
|
||||||
|
color="primary"
|
||||||
|
onClick={() => updateApproval(row.id)}
|
||||||
|
>
|
||||||
|
Approve
|
||||||
|
</Button>
|
||||||
|
</Stack>
|
||||||
|
)}
|
||||||
|
</TableCell>
|
||||||
<TableCell align="right">
|
<TableCell align="right">
|
||||||
<TableMoreMenu actions={
|
<TableMoreMenu actions={
|
||||||
<>
|
<>
|
||||||
@@ -575,6 +632,12 @@ export default function List() {
|
|||||||
<TableCell style={headStyle} align="left">
|
<TableCell style={headStyle} align="left">
|
||||||
Status
|
Status
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
<TableCell style={headStyle} align="left">
|
||||||
|
Nominal
|
||||||
|
</TableCell>
|
||||||
|
<TableCell style={headStyle} align="left">
|
||||||
|
Action
|
||||||
|
</TableCell>
|
||||||
<TableCell style={headStyle} align="right"></TableCell>
|
<TableCell style={headStyle} align="right"></TableCell>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
</TableHead>
|
</TableHead>
|
||||||
|
|||||||
@@ -117,6 +117,43 @@ export default function Detail() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const updateApproval = async () => {
|
||||||
|
setSubmitLoading(true);
|
||||||
|
axios
|
||||||
|
.put(`/customer-service/request/${id}`, {
|
||||||
|
status_approval: 'approved',
|
||||||
|
})
|
||||||
|
.then((response) => {
|
||||||
|
enqueueSnackbar('Berhasil Approve', { variant: 'success' });
|
||||||
|
window.location.reload();
|
||||||
|
})
|
||||||
|
.catch(({ response }) => {
|
||||||
|
enqueueSnackbar(response?.data?.message || 'Something Went Wrong', { variant: 'error' });
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
setSubmitLoading(false);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
const updateDecline = async () => {
|
||||||
|
setSubmitLoading(true);
|
||||||
|
axios
|
||||||
|
.put(`/customer-service/request/${id}`, {
|
||||||
|
status_approval: 'declined',
|
||||||
|
})
|
||||||
|
.then((response) => {
|
||||||
|
enqueueSnackbar('Berhasil Approve', { variant: 'success' });
|
||||||
|
window.location.reload();
|
||||||
|
})
|
||||||
|
.catch(({ response }) => {
|
||||||
|
enqueueSnackbar(response?.data?.message || 'Something Went Wrong', { variant: 'error' });
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
setSubmitLoading(false);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const { id, approval } = useParams();
|
const { id, approval } = useParams();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -457,13 +494,14 @@ export default function Detail() {
|
|||||||
/>
|
/>
|
||||||
</ButtonBase>
|
</ButtonBase>
|
||||||
</Stack>
|
</Stack>
|
||||||
<RHFTextFieldMoney
|
<RHFTextFieldMoney
|
||||||
id='nominal'
|
id="nominal"
|
||||||
name={`nominal`}
|
name="nominal"
|
||||||
label="Nominal"
|
label="Nominal"
|
||||||
required
|
required
|
||||||
placeholder="Nominal"
|
placeholder="Nominal"
|
||||||
value={requestLog?.nominal || 0}
|
value={requestLog?.nominal || 0}
|
||||||
|
disabled={!!approval}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* <LoadingButton
|
{/* <LoadingButton
|
||||||
@@ -474,81 +512,77 @@ export default function Detail() {
|
|||||||
>
|
>
|
||||||
Simpan
|
Simpan
|
||||||
</LoadingButton> */}
|
</LoadingButton> */}
|
||||||
<Stack direction="row" spacing={2} sx={{ mt: 6 }}>
|
<Stack direction="row" spacing={2} sx={{ mt: 6 }}>
|
||||||
{approval ? (
|
{approval ? (
|
||||||
<>
|
<>
|
||||||
<Box sx={{ flexGrow: 1 }} />
|
<Box sx={{ flexGrow: 1 }} />
|
||||||
{/* GRUP TOMBOL DI KANAN */}
|
{/* GRUP TOMBOL DI KANAN */}
|
||||||
<Stack direction="row" spacing={1.5} mt={2}>
|
{requestLog?.status_approval !== 'approved' && (
|
||||||
<Button
|
<Stack direction="row" spacing={1.5} mt={2}>
|
||||||
color='error'
|
<Button
|
||||||
variant="outlined"
|
color="error"
|
||||||
size="small"
|
variant="outlined"
|
||||||
onClick={() => {
|
size="small"
|
||||||
setDialogSendWa(true);
|
onClick={updateDecline}
|
||||||
setShareLink(false);
|
>
|
||||||
}}
|
Decline
|
||||||
>
|
</Button>
|
||||||
Decline
|
|
||||||
</Button>
|
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
variant="contained"
|
variant="contained"
|
||||||
size="small"
|
size="small"
|
||||||
color='primary'
|
color="primary"
|
||||||
onClick={() => {
|
onClick={updateApproval}
|
||||||
setDialogSendWa(true);
|
>
|
||||||
setShareLink(true);
|
Approve
|
||||||
}}
|
</Button>
|
||||||
>
|
</Stack>
|
||||||
Approve
|
)}
|
||||||
</Button>
|
|
||||||
</Stack>
|
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
{/* TOMBOL SIMPAN DI KIRI */}
|
{/* TOMBOL SIMPAN DI KIRI */}
|
||||||
<LoadingButton
|
<LoadingButton
|
||||||
type="submit"
|
type="submit"
|
||||||
variant="contained"
|
variant="contained"
|
||||||
sx={{ p: 2, backgroundColor: "#19BBBB" }}
|
sx={{ p: 2, backgroundColor: "#19BBBB" }}
|
||||||
loading={false}
|
loading={false}
|
||||||
size="small"
|
size="small"
|
||||||
>
|
>
|
||||||
Simpan
|
Simpan
|
||||||
</LoadingButton>
|
</LoadingButton>
|
||||||
|
|
||||||
{/* Ini adalah spacer untuk mendorong tombol berikutnya ke kanan */}
|
{/* Ini adalah spacer untuk mendorong tombol berikutnya ke kanan */}
|
||||||
<Box sx={{ flexGrow: 1 }} />
|
<Box sx={{ flexGrow: 1 }} />
|
||||||
|
|
||||||
{/* GRUP TOMBOL DI KANAN */}
|
{/* GRUP TOMBOL DI KANAN */}
|
||||||
<Stack direction="row" spacing={1.5} mt={2}>
|
<Stack direction="row" spacing={1.5} mt={2}>
|
||||||
<Button
|
<Button
|
||||||
variant="contained"
|
variant="contained"
|
||||||
size="small"
|
size="small"
|
||||||
sx={{ p: 2, backgroundColor: "#19BBBB" }}
|
sx={{ p: 2, backgroundColor: "#19BBBB" }}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setDialogSendWa(true);
|
setDialogSendWa(true);
|
||||||
setShareLink(false);
|
setShareLink(false);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Kirim (WA Chatbot)
|
Kirim (WA Chatbot)
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
variant="contained"
|
variant="contained"
|
||||||
size="small"
|
size="small"
|
||||||
sx={{ p: 2, backgroundColor: "#19BBBB" }}
|
sx={{ p: 2, backgroundColor: "#19BBBB" }}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setDialogSendWa(true);
|
setDialogSendWa(true);
|
||||||
setShareLink(true);
|
setShareLink(true);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Share Link
|
Share Link
|
||||||
</Button>
|
</Button>
|
||||||
</Stack>
|
</Stack>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|
||||||
</Stack>
|
</Stack>
|
||||||
@@ -1009,8 +1043,7 @@ export default function Detail() {
|
|||||||
variant="outlined"
|
variant="outlined"
|
||||||
sx={{ color: '#FF4842', borderColor: '#FF4842' }}
|
sx={{ color: '#FF4842', borderColor: '#FF4842' }}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setOpenDialogSubmit(true);
|
|
||||||
setApprove('declined');
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Decline
|
Decline
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ export type FinalLogType = {
|
|||||||
service_name : string,
|
service_name : string,
|
||||||
payment_type_name : string,
|
payment_type_name : string,
|
||||||
status_final_log : string,
|
status_final_log : string,
|
||||||
|
status_approval : string,
|
||||||
|
nominal : number,
|
||||||
provider : string,
|
provider : string,
|
||||||
status : string,
|
status : string,
|
||||||
files_by_type : files_by_type,
|
files_by_type : files_by_type,
|
||||||
@@ -43,12 +45,12 @@ export type DetailFinalLogType = {
|
|||||||
marital_status : string,
|
marital_status : string,
|
||||||
admission_date : string,
|
admission_date : string,
|
||||||
submission_date : string,
|
submission_date : string,
|
||||||
admission_date : string,
|
|
||||||
approved_final_log_at : string,
|
approved_final_log_at : string,
|
||||||
service_type : string,
|
service_type : string,
|
||||||
claim_method : string,
|
claim_method : string,
|
||||||
status : string,
|
status : string,
|
||||||
status_final_log : string,
|
status_final_log : string,
|
||||||
|
status_approval : string,
|
||||||
no_identitas : string,
|
no_identitas : string,
|
||||||
keterangan : string,
|
keterangan : string,
|
||||||
hak_kamar_pasien : string,
|
hak_kamar_pasien : string,
|
||||||
|
|||||||
Reference in New Issue
Block a user