[WIP] Update
This commit is contained in:
@@ -62,10 +62,11 @@ class ClaimRequestController extends Controller
|
|||||||
{
|
{
|
||||||
$request->validate([
|
$request->validate([
|
||||||
'member_id' => 'required',
|
'member_id' => 'required',
|
||||||
|
'service_code' => 'required|in:OP,IP'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$member = Member::find($request->member_id);
|
$member = Member::find($request->member_id);
|
||||||
$newClaimRequest = ClaimRequestService::storeClaimRequest(member: $member);
|
$newClaimRequest = ClaimRequestService::storeClaimRequest(member: $member, paymentType: 'reimbursement', serviceCode: $request->service_code);
|
||||||
|
|
||||||
ClaimRequested::dispatch($newClaimRequest);
|
ClaimRequested::dispatch($newClaimRequest);
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ class ClaimRequestController extends Controller
|
|||||||
->when($request->status, function($q, $status) {
|
->when($request->status, function($q, $status) {
|
||||||
$q->where('status', $status);
|
$q->where('status', $status);
|
||||||
})
|
})
|
||||||
->with(['member', 'files'])
|
->with(['member', 'files', 'service'])
|
||||||
->paginate();
|
->paginate();
|
||||||
|
|
||||||
return Helper::paginateResources(ClaimRequestResource::collection($claimRequests));
|
return Helper::paginateResources(ClaimRequestResource::collection($claimRequests));
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Modules\Internal\Services;
|
|
||||||
|
|
||||||
use App\Models\Claim;
|
|
||||||
use Illuminate\Support\Facades\DB;
|
|
||||||
|
|
||||||
class ClaimService
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -24,7 +24,9 @@ class ClaimRequestResource extends JsonResource
|
|||||||
'submission_date' => $this->submission_date,
|
'submission_date' => $this->submission_date,
|
||||||
'member' => $this->member,
|
'member' => $this->member,
|
||||||
'status' => $this->status ?? 'unknown',
|
'status' => $this->status ?? 'unknown',
|
||||||
'service_type' => $this->service_type,
|
'service_name' => $this->service->name,
|
||||||
|
'payment_type' => $this->payment_type,
|
||||||
|
'payment_type_name' => $this->payment_type_name,
|
||||||
'files_by_type' => $filesGroupByType
|
'files_by_type' => $filesGroupByType
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -57,6 +57,8 @@ class GeneratedDocumentController extends Controller
|
|||||||
// $pdf = PDF::loadFile(route('generated-document.show', $id));
|
// $pdf = PDF::loadFile(route('generated-document.show', $id));
|
||||||
// return $pdf->inline();
|
// return $pdf->inline();
|
||||||
|
|
||||||
|
// $pdf = PDF::loadHtml('<h1>Motherfucker</h1>');
|
||||||
|
|
||||||
// $snappy = App::make('snappy.pdf');
|
// $snappy = App::make('snappy.pdf');
|
||||||
// $html = '<h1>Bill</h1><p>You owe me money, dude.</p>';
|
// $html = '<h1>Bill</h1><p>You owe me money, dude.</p>';
|
||||||
// // $snappy->generateFromHtml($html, '/tmp/bill-123.pdf');
|
// // $snappy->generateFromHtml($html, '/tmp/bill-123.pdf');
|
||||||
|
|||||||
@@ -122,6 +122,17 @@ class Claim extends Model
|
|||||||
return (string) self::$code_prefix .'-'. str_pad($next_number, 5, 0, STR_PAD_LEFT);
|
return (string) self::$code_prefix .'-'. str_pad($next_number, 5, 0, STR_PAD_LEFT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Current ClaimRequest that refer to the claim
|
||||||
|
public function claimRequest()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(ClaimRequest::class, 'claim_request_id');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Possibilities of ClaimRequest that refer to the claim
|
||||||
|
public function claimRequests()
|
||||||
|
{
|
||||||
|
return $this->hasMany(ClaimRequest::class, 'claim_id');
|
||||||
|
}
|
||||||
|
|
||||||
public function files()
|
public function files()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -17,8 +17,12 @@ class ClaimRequest extends Model
|
|||||||
protected static $code_prefix = 'CRQ';
|
protected static $code_prefix = 'CRQ';
|
||||||
|
|
||||||
public $fillable = [
|
public $fillable = [
|
||||||
|
'uuid',
|
||||||
'submission_date',
|
'submission_date',
|
||||||
'member_id',
|
'member_id',
|
||||||
|
'payment_type',
|
||||||
|
'service_code',
|
||||||
|
'policy_id',
|
||||||
'status',
|
'status',
|
||||||
'claim_id'
|
'claim_id'
|
||||||
];
|
];
|
||||||
@@ -35,13 +39,19 @@ class ClaimRequest extends Model
|
|||||||
public static $status = [
|
public static $status = [
|
||||||
'draft' => 'Draft',
|
'draft' => 'Draft',
|
||||||
'requested' => 'Requested',
|
'requested' => 'Requested',
|
||||||
'received' => 'Received',
|
|
||||||
'approved' => 'Approved',
|
'approved' => 'Approved',
|
||||||
'postpone' => 'Postpone',
|
|
||||||
'paid' => 'Paid',
|
|
||||||
'declined' => 'Declined'
|
'declined' => 'Declined'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
public static $payment_types = [
|
||||||
|
'cashless' => 'Cashless',
|
||||||
|
'reimbursement' => 'Reimbursement'
|
||||||
|
];
|
||||||
|
|
||||||
|
public $appends = [
|
||||||
|
'payment_type_name'
|
||||||
|
];
|
||||||
|
|
||||||
protected static function boot()
|
protected static function boot()
|
||||||
{
|
{
|
||||||
parent::boot();
|
parent::boot();
|
||||||
@@ -116,6 +126,11 @@ class ClaimRequest extends Model
|
|||||||
return (string) self::$code_prefix .'-'. str_pad($next_number, 5, 0, STR_PAD_LEFT);
|
return (string) self::$code_prefix .'-'. str_pad($next_number, 5, 0, STR_PAD_LEFT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function claim()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(Claim::class, 'claim_id');
|
||||||
|
}
|
||||||
|
|
||||||
public function claims()
|
public function claims()
|
||||||
{
|
{
|
||||||
return $this->hasMany(Claim::class, 'claim_request_id');
|
return $this->hasMany(Claim::class, 'claim_request_id');
|
||||||
@@ -140,4 +155,19 @@ class ClaimRequest extends Model
|
|||||||
{
|
{
|
||||||
return $this->belongsTo(Member::class, 'member_id', 'id');
|
return $this->belongsTo(Member::class, 'member_id', 'id');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function service()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(Service::class, 'service_code', 'code');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getPaymentTypeNameAttribute()
|
||||||
|
{
|
||||||
|
return self::$payment_types[$this->payment_type] ?? $this->payment_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getStatusAttribute($value)
|
||||||
|
{
|
||||||
|
return self::$payment_types[$value] ?? $value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -151,13 +151,20 @@ class Member extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function currentPolicy()
|
public function currentPolicy()
|
||||||
|
{
|
||||||
|
return $this->hasOneThrough(CorporatePolicy::class, MemberPolicy::class, 'member_id', 'code', 'member_id', 'policy_id')
|
||||||
|
->where('status', 'active')
|
||||||
|
->orderBy('end', 'DESC');
|
||||||
|
// return $this->hasOne(MemberPolicy::class, 'member_id', 'member_id')->where('status', 'active')->latestOfMany();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function currentActivePolicy()
|
||||||
{
|
{
|
||||||
return $this->hasOneThrough(CorporatePolicy::class, MemberPolicy::class, 'member_id', 'code', 'member_id', 'policy_id')
|
return $this->hasOneThrough(CorporatePolicy::class, MemberPolicy::class, 'member_id', 'code', 'member_id', 'policy_id')
|
||||||
->where('corporate_policies.start', '<', now())
|
->where('corporate_policies.start', '<', now())
|
||||||
->where('corporate_policies.end', '>', now())
|
->where('corporate_policies.end', '>', now())
|
||||||
->where('member_policies.start', '<', now())
|
->where('member_policies.start', '<', now())
|
||||||
->where('member_policies.end', '>', now());
|
->where('member_policies.end', '>', now());
|
||||||
// return $this->hasOne(MemberPolicy::class, 'member_id', 'member_id')->where('status', 'active')->latestOfMany();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAgeAttribute()
|
public function getAgeAttribute()
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ use Str;
|
|||||||
|
|
||||||
class ClaimRequestService{
|
class ClaimRequestService{
|
||||||
|
|
||||||
public static function storeClaimRequest($member, $submissionDate = null, $status = 'requested')
|
public static function storeClaimRequest($member, $paymentType, $serviceCode, $submissionDate = null, $status = 'requested')
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
DB::beginTransaction();
|
DB::beginTransaction();
|
||||||
@@ -22,7 +22,10 @@ class ClaimRequestService{
|
|||||||
$claimRequestData = [
|
$claimRequestData = [
|
||||||
'member_id' => $member->id,
|
'member_id' => $member->id,
|
||||||
'submission_date' => $submissionDate ?? now(),
|
'submission_date' => $submissionDate ?? now(),
|
||||||
'status' => $status
|
'status' => $status,
|
||||||
|
'payment_type' => $paymentType,
|
||||||
|
'service_code' => $serviceCode,
|
||||||
|
'policy_id' => $member->currentPolicy->id ?? null,
|
||||||
];
|
];
|
||||||
|
|
||||||
$claimRequest = ClaimRequest::create($claimRequestData);
|
$claimRequest = ClaimRequest::create($claimRequestData);
|
||||||
|
|||||||
@@ -19,6 +19,9 @@ return new class extends Migration
|
|||||||
$table->string('code')->index();
|
$table->string('code')->index();
|
||||||
$table->dateTime('submission_date')->nullable();
|
$table->dateTime('submission_date')->nullable();
|
||||||
$table->foreignId('member_id');
|
$table->foreignId('member_id');
|
||||||
|
$table->string('payment_type');
|
||||||
|
$table->string('service_code');
|
||||||
|
$table->foreignId('policy_id');
|
||||||
$table->string('status')->nullable();
|
$table->string('status')->nullable();
|
||||||
$table->foreignId('claim_id')->nullable()->comment('After Claim is Created');
|
$table->foreignId('claim_id')->nullable()->comment('After Claim is Created');
|
||||||
|
|
||||||
|
|||||||
@@ -135,6 +135,34 @@ const DialogDetailClaim = ({ title, openDialog, setOpenDialog, data }: MuiDialog
|
|||||||
</Stack>
|
</Stack>
|
||||||
)} */}
|
)} */}
|
||||||
|
|
||||||
|
|
||||||
|
<Stack direction="row" spacing={2} sx={{ marginTop: 2 }}>
|
||||||
|
<Divider orientation="vertical" flexItem sx={{ borderStyle: 'dashed' }} />
|
||||||
|
<Stack spacing={2} sx={{ flex: 1, maxWidth: '100%' }}>
|
||||||
|
{/* ---------------------------------TYPE INFO------------------------------------ */}
|
||||||
|
<Card sx={{ paddingY: 2, paddingX: 3 }}>
|
||||||
|
<Stack direction="row" justifyContent="space-between" alignItems="center">
|
||||||
|
<Typography variant="body1" fontWeight={600}>
|
||||||
|
<Iconify icon="eva:file-text-fill"></Iconify> Pengajuan Penjaminan
|
||||||
|
</Typography>
|
||||||
|
</Stack>
|
||||||
|
<Divider sx={{ marginY: 2 }} />
|
||||||
|
|
||||||
|
<Stack>
|
||||||
|
<LoadingButton loading={false}
|
||||||
|
variant="contained"
|
||||||
|
startIcon={<Add />}
|
||||||
|
fullWidth
|
||||||
|
// sx={{ typography: 'subtitle2', borderColor: '#F5F5F5' }}
|
||||||
|
onClick={() => {}}
|
||||||
|
>
|
||||||
|
Upload Invoice
|
||||||
|
</LoadingButton>
|
||||||
|
</Stack>
|
||||||
|
</Card>
|
||||||
|
</Stack>
|
||||||
|
</Stack>
|
||||||
|
|
||||||
{claim.histories_by_date &&
|
{claim.histories_by_date &&
|
||||||
claim.histories_by_date.map((historiesByDate) => (
|
claim.histories_by_date.map((historiesByDate) => (
|
||||||
<Stack key={historiesByDate.date}>
|
<Stack key={historiesByDate.date}>
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ const navConfig = [
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'LOG REQUEST',
|
title: 'CLAIM REQUEST',
|
||||||
path: '/claim-requests',
|
path: '/claim-requests',
|
||||||
// children: [
|
// children: [
|
||||||
// { title: 'Request', path: '/case-request' },
|
// { title: 'Request', path: '/case-request' },
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import CancelIcon from '@mui/icons-material/Cancel';
|
|||||||
// hooks
|
// hooks
|
||||||
import React, { ChangeEvent, useEffect, useRef, useState } from 'react';
|
import React, { ChangeEvent, useEffect, useRef, useState } from 'react';
|
||||||
import { Navigate, useNavigate, useSearchParams } from 'react-router-dom';
|
import { Navigate, useNavigate, useSearchParams } from 'react-router-dom';
|
||||||
|
import useSettings from '@/hooks/useSettings';
|
||||||
// components
|
// components
|
||||||
import axios from '../../utils/axios';
|
import axios from '../../utils/axios';
|
||||||
import { LaravelPaginatedData, LaravelPaginatedDataDefault } from '../../@types/paginated-data';
|
import { LaravelPaginatedData, LaravelPaginatedDataDefault } from '../../@types/paginated-data';
|
||||||
@@ -40,6 +41,7 @@ import DialogDetailClaim from '@/components/dialogs/DialogDetailClaim';
|
|||||||
// import LoadingButton from '@/theme/overrides/LoadingButton';
|
// import LoadingButton from '@/theme/overrides/LoadingButton';
|
||||||
|
|
||||||
export default function List() {
|
export default function List() {
|
||||||
|
const { themeColorPresets } = useSettings();
|
||||||
const [searchParams, setSearchParams] = useSearchParams();
|
const [searchParams, setSearchParams] = useSearchParams();
|
||||||
const [importResult, setImportResult] = useState(null);
|
const [importResult, setImportResult] = useState(null);
|
||||||
|
|
||||||
@@ -137,15 +139,16 @@ export default function List() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleApprove = (claimRequest) => {
|
const handleApprove = (claimRequest) => {
|
||||||
axios.post(`claim-requests/${claimRequest.id}/approve`)
|
axios
|
||||||
|
.post(`claim-requests/${claimRequest.id}/approve`)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
enqueueSnackbar('Success Approve', {variant: 'success'})
|
enqueueSnackbar('Success Approve', { variant: 'success' });
|
||||||
loadDataTableData()
|
loadDataTableData();
|
||||||
})
|
})
|
||||||
.catch(({response}) => {
|
.catch(({ response }) => {
|
||||||
enqueueSnackbar(response.data.message ?? 'Something went wrong!', {variant : "error"})
|
enqueueSnackbar(response.data.message ?? 'Something went wrong!', { variant: 'error' });
|
||||||
})
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
loadDataTableData();
|
loadDataTableData();
|
||||||
@@ -178,13 +181,39 @@ export default function List() {
|
|||||||
{open ? <KeyboardArrowDownIcon /> : <KeyboardArrowRightIcon />}
|
{open ? <KeyboardArrowDownIcon /> : <KeyboardArrowRightIcon />}
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell align="left">{row.code}</TableCell>
|
<TableCell align="left">
|
||||||
|
<Typography
|
||||||
|
onClick={() => {
|
||||||
|
handleShowClaim(row);
|
||||||
|
}}
|
||||||
|
color={themeColorPresets}
|
||||||
|
>
|
||||||
|
{row.code}
|
||||||
|
</Typography>
|
||||||
|
</TableCell>
|
||||||
|
<TableCell align="left">{row.member?.full_name}</TableCell>
|
||||||
<TableCell align="left">{row.member?.full_name}</TableCell>
|
<TableCell align="left">{row.member?.full_name}</TableCell>
|
||||||
<TableCell align="left">{row.submission_date}</TableCell>
|
<TableCell align="left">{row.submission_date}</TableCell>
|
||||||
<TableCell align="left">{row.service_type}</TableCell>
|
<TableCell align="left">{row.service_name}</TableCell>
|
||||||
<TableCell align="right"><Chip label={row.status}/></TableCell>
|
<TableCell align="left">{row.payment_type_name}</TableCell>
|
||||||
<TableCell align="right">{ row.status == 'requested' && (<LoadingButton loading={loadingApprove} variant="outlined" onClick={() => {handleApprove(row)}}>Approve</LoadingButton> )}</TableCell>
|
<TableCell align="right">
|
||||||
<TableCell>
|
<Chip label={row.status} />
|
||||||
|
</TableCell>
|
||||||
|
<TableCell align="right">
|
||||||
|
{row.status == 'requested' && (
|
||||||
|
<LoadingButton
|
||||||
|
loading={loadingApprove}
|
||||||
|
variant="outlined"
|
||||||
|
size="small"
|
||||||
|
onClick={() => {
|
||||||
|
handleApprove(row);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Ajukan Claim <Iconify icon="eva:arrow-forward-outline"></Iconify>
|
||||||
|
</LoadingButton>
|
||||||
|
)}
|
||||||
|
</TableCell>
|
||||||
|
{/* <TableCell>
|
||||||
|
|
||||||
<IconButton
|
<IconButton
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
@@ -193,32 +222,33 @@ export default function List() {
|
|||||||
>
|
>
|
||||||
<Iconify icon="eva:eye-fill" />
|
<Iconify icon="eva:eye-fill" />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</TableCell>
|
</TableCell> */}
|
||||||
</TableRow>
|
</TableRow>
|
||||||
{/* COLLAPSIBLE ROW */}
|
{/* COLLAPSIBLE ROW */}
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TableCell style={{ paddingBottom: 0, paddingTop: 0 }} colSpan={99}>
|
<TableCell style={{ paddingBottom: 0, paddingTop: 0 }} colSpan={99}>
|
||||||
<Collapse in={open} timeout="auto" unmountOnExit>
|
<Collapse in={open} timeout="auto" unmountOnExit>
|
||||||
<Box sx={{ borderBottom: 1 }}>
|
<Box sx={{ borderBottom: 1 }}>
|
||||||
<Stack
|
<Stack
|
||||||
divider={<Divider orientation="horizontal" flexItem />}
|
divider={<Divider orientation="horizontal" flexItem />}
|
||||||
spacing={1}
|
spacing={1}
|
||||||
sx={{ marginY: 2 }}
|
sx={{ marginY: 2 }}
|
||||||
>
|
>
|
||||||
<Box>
|
<Box>
|
||||||
<Typography fontWeight={600}>Berkas Hasil Penunjang</Typography>
|
<Typography fontWeight={600}>Berkas Hasil Penunjang</Typography>
|
||||||
{row.files_by_type?.result &&
|
{row.files_by_type?.result &&
|
||||||
row.files_by_type?.result.map((file, index) => (
|
row.files_by_type?.result.map((file, index) => (
|
||||||
<Stack direction="row" key={index}>
|
<Stack direction="row" key={index}>
|
||||||
<Typography sx={{marginRight: 2}}>-</Typography> <a href={file.url} target="_blank">{file.name}</a>
|
<Typography sx={{ marginRight: 2 }}>-</Typography>{' '}
|
||||||
</Stack>
|
<a href={file.url} target="_blank">
|
||||||
))}
|
{file.name}
|
||||||
|
</a>
|
||||||
{ !row.files_by_type?.result && (
|
</Stack>
|
||||||
<Typography>Tidak ada berkas</Typography>
|
))}
|
||||||
)}
|
|
||||||
|
{!row.files_by_type?.result && <Typography>Tidak ada berkas</Typography>}
|
||||||
</Box>
|
</Box>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Box>
|
</Box>
|
||||||
</Collapse>
|
</Collapse>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
@@ -241,20 +271,24 @@ export default function List() {
|
|||||||
Code
|
Code
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell style={headStyle} align="left">
|
<TableCell style={headStyle} align="left">
|
||||||
Member Name
|
Name
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell style={headStyle} align="left">
|
<TableCell style={headStyle} align="left">
|
||||||
Submission Date
|
Nomor Polis
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell style={headStyle} align="left">
|
<TableCell style={headStyle} align="left">
|
||||||
Jenis Layanan
|
Tanggal Pengajuan
|
||||||
|
</TableCell>
|
||||||
|
<TableCell style={headStyle} align="left">
|
||||||
|
Service Type
|
||||||
|
</TableCell>
|
||||||
|
<TableCell style={headStyle} align="left">
|
||||||
|
Claim Type
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell style={headStyle} align="left">
|
<TableCell style={headStyle} align="left">
|
||||||
Status
|
Status
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell style={headStyle} align="right">
|
<TableCell style={headStyle} align="right"></TableCell>
|
||||||
Action
|
|
||||||
</TableCell>
|
|
||||||
</TableRow>
|
</TableRow>
|
||||||
</TableBody>
|
</TableBody>
|
||||||
{/* ------------------ END TABLE HEADER ------------------ */}
|
{/* ------------------ END TABLE HEADER ------------------ */}
|
||||||
@@ -288,8 +322,6 @@ export default function List() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// ---------------------------------------------------------
|
// ---------------------------------------------------------
|
||||||
// Dialog Detail Claim Request
|
// Dialog Detail Claim Request
|
||||||
const [openDialogDetailClaim, setOpenDialogDetailClaim] = useState(false);
|
const [openDialogDetailClaim, setOpenDialogDetailClaim] = useState(false);
|
||||||
@@ -300,20 +332,18 @@ export default function List() {
|
|||||||
setLoadingClaimDetail(true);
|
setLoadingClaimDetail(true);
|
||||||
setOpenDialogDetailClaim(true);
|
setOpenDialogDetailClaim(true);
|
||||||
|
|
||||||
axios.get(`/claim-requests/${claimRequest.id}`)
|
axios
|
||||||
.then(({data}) => {
|
.get(`/claim-requests/${claimRequest.id}`)
|
||||||
|
.then(({ data }) => {
|
||||||
setCurrentClaim(data.data);
|
setCurrentClaim(data.data);
|
||||||
setLoadingClaimDetail(false);
|
setLoadingClaimDetail(false);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
enqueueSnackbar(err.message, {variant: 'error'})
|
enqueueSnackbar(err.message, { variant: 'error' });
|
||||||
})
|
});
|
||||||
}
|
|
||||||
|
|
||||||
function handleDownloadLog() {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleDownloadLog() {}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card>
|
<Card>
|
||||||
@@ -327,7 +357,6 @@ export default function List() {
|
|||||||
TableContent={<TableContent />}
|
TableContent={<TableContent />}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
||||||
<DialogDetailClaim
|
<DialogDetailClaim
|
||||||
openDialog={openDialogDetailClaim}
|
openDialog={openDialogDetailClaim}
|
||||||
setOpenDialog={setOpenDialogDetailClaim}
|
setOpenDialog={setOpenDialogDetailClaim}
|
||||||
|
|||||||
@@ -36,8 +36,8 @@ export const colorPresets = [
|
|||||||
name: 'blue',
|
name: 'blue',
|
||||||
lighter: '#D1E9FC',
|
lighter: '#D1E9FC',
|
||||||
light: '#76B0F1',
|
light: '#76B0F1',
|
||||||
main: '#006a35',
|
main: '#2065D1',
|
||||||
dark: '#004422',
|
dark: '#103996',
|
||||||
darker: '#061B64',
|
darker: '#061B64',
|
||||||
contrastText: '#fff',
|
contrastText: '#fff',
|
||||||
},
|
},
|
||||||
@@ -63,7 +63,7 @@ export const colorPresets = [
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
export const defaultPreset = colorPresets[3];
|
export const defaultPreset = colorPresets[0];
|
||||||
export const purplePreset = colorPresets[1];
|
export const purplePreset = colorPresets[1];
|
||||||
export const cyanPreset = colorPresets[2];
|
export const cyanPreset = colorPresets[2];
|
||||||
export const bluePreset = colorPresets[3];
|
export const bluePreset = colorPresets[3];
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// mui
|
// mui
|
||||||
import { styled } from '@mui/material/styles';
|
import { styled } from '@mui/material/styles';
|
||||||
import { LoadingButton, TabPanel } from "@mui/lab";
|
import { LoadingButton, TabPanel } from "@mui/lab";
|
||||||
import { Card, Divider, Grid, LinearProgress, linearProgressClasses, Typography } from "@mui/material";
|
import { Button, Card, Divider, Grid, LinearProgress, linearProgressClasses, Typography } from "@mui/material";
|
||||||
import { Tab, Tabs } from "@mui/material";
|
import { Tab, Tabs } from "@mui/material";
|
||||||
import { Box, Stack } from "@mui/material";
|
import { Box, Stack } from "@mui/material";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
@@ -80,7 +80,7 @@ export default function DialogMember(member, handleSubmitSuccess) {
|
|||||||
<Grid item sm={6} key={index}>
|
<Grid item sm={6} key={index}>
|
||||||
<Card sx={{p: 2}}>
|
<Card sx={{p: 2}}>
|
||||||
<Typography variant="body1" sx={{fontWeight: 500}}>{corporateBenefit.benefit.description}</Typography>
|
<Typography variant="body1" sx={{fontWeight: 500}}>{corporateBenefit.benefit.description}</Typography>
|
||||||
<Typography variant="body2">{corporateBenefit.benefit.code}</Typography>
|
<Typography variant="body2">Member ID : {corporateBenefit.benefit.code}</Typography>
|
||||||
<Typography variant="body2" sx={{ marginTop: 2 }}>Yearly Limits</Typography>
|
<Typography variant="body2" sx={{ marginTop: 2 }}>Yearly Limits</Typography>
|
||||||
<BorderLinearProgress variant="determinate" value={100 - (corporateBenefit.limit_amount ? ((corporateBenefit.usage ?? 0) / corporateBenefit.limit_amount) : 0)} sx={{ mb: 1 }} />
|
<BorderLinearProgress variant="determinate" value={100 - (corporateBenefit.limit_amount ? ((corporateBenefit.usage ?? 0) / corporateBenefit.limit_amount) : 0)} sx={{ mb: 1 }} />
|
||||||
<Typography sx={{ textAlign: 'right'}}>{corporateBenefit.usage ?? 0} /
|
<Typography sx={{ textAlign: 'right'}}>{corporateBenefit.usage ?? 0} /
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { styled } from '@mui/material/styles';
|
|||||||
import Iconify from '@/components/Iconify';
|
import Iconify from '@/components/Iconify';
|
||||||
import { fCurrency } from '@/utils/formatNumber';
|
import { fCurrency } from '@/utils/formatNumber';
|
||||||
import { LoadingButton } from '@mui/lab';
|
import { LoadingButton } from '@mui/lab';
|
||||||
import { Avatar, Divider, LinearProgress, linearProgressClasses } from '@mui/material';
|
import { Avatar, Button, Divider, LinearProgress, linearProgressClasses } from '@mui/material';
|
||||||
import { Card } from '@mui/material';
|
import { Card } from '@mui/material';
|
||||||
import { Stack, Typography } from '@mui/material';
|
import { Stack, Typography } from '@mui/material';
|
||||||
import { fPostFormat } from '@/utils/formatTime';
|
import { fPostFormat } from '@/utils/formatTime';
|
||||||
@@ -25,6 +25,8 @@ export default function FormRequestClaim({ member, handleSubmitSuccess }) {
|
|||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
const [serviceCode, setServiceCode] = useState('IP');
|
||||||
|
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
// Files Diagnosa
|
// Files Diagnosa
|
||||||
|
|
||||||
@@ -98,7 +100,8 @@ export default function FormRequestClaim({ member, handleSubmitSuccess }) {
|
|||||||
member_id: member.id,
|
member_id: member.id,
|
||||||
result_files: fileHasilPenunjangs,
|
result_files: fileHasilPenunjangs,
|
||||||
diagnosa_files: fileDiagnosas,
|
diagnosa_files: fileDiagnosas,
|
||||||
kondisi_files: fileKondisis
|
kondisi_files: fileKondisis,
|
||||||
|
service_code: serviceCode
|
||||||
});
|
});
|
||||||
axios
|
axios
|
||||||
.post('/claim-requests', formData)
|
.post('/claim-requests', formData)
|
||||||
@@ -117,10 +120,21 @@ export default function FormRequestClaim({ member, handleSubmitSuccess }) {
|
|||||||
return (
|
return (
|
||||||
<Stack>
|
<Stack>
|
||||||
<Stack direction="row" justifyContent={'end'} sx={{ marginBottom: 2 }}>
|
<Stack direction="row" justifyContent={'end'} sx={{ marginBottom: 2 }}>
|
||||||
<Typography textAlign={'right'}>
|
<Typography textAlign={'right'} variant='body2'>
|
||||||
Submission Date : <br /> {fPostFormat(new Date(), 'dd/MM/yyyy')}
|
Submission Date : <br /> {fPostFormat(new Date(), 'dd/MM/yyyy')}
|
||||||
</Typography>
|
</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|
||||||
|
|
||||||
|
<Card sx={{ p: 1, background: '#f4f6f8', marginBottom: 2 }}>
|
||||||
|
|
||||||
|
<Stack direction="row" spacing={2}>
|
||||||
|
<Button sx={{padding: 2, width: '100%'}} variant={serviceCode == 'IP' ? 'contained' : ''} onClick={() => {setServiceCode('IP')}}>Rawat Inap</Button>
|
||||||
|
<Button sx={{padding: 2, width: '100%'}} variant={serviceCode == 'OP' ? 'contained' : ''} onClick={() => {setServiceCode('OP')}}>Rawat Jalan</Button>
|
||||||
|
</Stack>
|
||||||
|
</Card>
|
||||||
|
|
||||||
|
|
||||||
<Card sx={{ p: 1, background: '#f4f6f8', marginBottom: 2 }}>
|
<Card sx={{ p: 1, background: '#f4f6f8', marginBottom: 2 }}>
|
||||||
<Stack direction="row">
|
<Stack direction="row">
|
||||||
<Avatar
|
<Avatar
|
||||||
|
|||||||
@@ -79,7 +79,7 @@
|
|||||||
<table style="width: 100%;">
|
<table style="width: 100%;">
|
||||||
<tr>
|
<tr>
|
||||||
<td rowspan="4" style="width: 110px;">
|
<td rowspan="4" style="width: 110px;">
|
||||||
<img src="{{ public_path('images/logo-linksehat-vertical-default.png') }}" width="100px">
|
{{-- <img src="{{ assets('images/logo-linksehat-vertical-default.png') }}" width="100px"> --}}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user