Merge branch 'staging' of itcorp.primaya.id:rajif/aso into staging
This commit is contained in:
@@ -5,14 +5,10 @@ namespace Modules\Client\Http\Controllers\Api;
|
|||||||
use App\Helpers\Helper;
|
use App\Helpers\Helper;
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Models\ClaimRequest;
|
use App\Models\ClaimRequest;
|
||||||
|
use Modules\Client\Transformers\ClaimReport\ShowResources;
|
||||||
|
|
||||||
class ClaimReportController extends Controller
|
class ClaimReportController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* Display a listing of the resource.
|
|
||||||
*
|
|
||||||
* @return \Illuminate\Http\Response
|
|
||||||
*/
|
|
||||||
public function claimStatus($corporateId)
|
public function claimStatus($corporateId)
|
||||||
{
|
{
|
||||||
$requesteds = ClaimRequest::query()
|
$requesteds = ClaimRequest::query()
|
||||||
@@ -48,4 +44,22 @@ class ClaimReportController extends Controller
|
|||||||
'rejecteds' => count($rejecteds)
|
'rejecteds' => count($rejecteds)
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function show($corporateId, $claimRequestId)
|
||||||
|
{
|
||||||
|
$data = ClaimRequest::query()
|
||||||
|
->with([
|
||||||
|
'histories:historiable_type,historiable_id,title,description,created_at',
|
||||||
|
'member:id,person_id,name_prefix,name,name_suffix' => [
|
||||||
|
'person:id,name_prefix,name,name_suffix,gender'
|
||||||
|
],
|
||||||
|
'claim:id,status',
|
||||||
|
'claimResults',
|
||||||
|
'claimConditions',
|
||||||
|
'claimDiagnosis'
|
||||||
|
])
|
||||||
|
->find($claimRequestId, ['id', 'submission_date', 'member_id', 'claim_id', 'status']);
|
||||||
|
|
||||||
|
return Helper::responseJson(new ShowResources($data));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Modules\Client\Transformers\ClaimReport;
|
||||||
|
|
||||||
|
use Illuminate\Http\Resources\Json\JsonResource;
|
||||||
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
|
||||||
|
class ClaimReportFileShowResources extends JsonResource
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Transform the resource into an array.
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Http\Request
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function toArray($request)
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'id' => $this->id,
|
||||||
|
'fileName' => $this->name,
|
||||||
|
'fileUrl' => url(Storage::url($this->path))
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -21,6 +21,7 @@ class MemberResources extends JsonResource
|
|||||||
'fullName' => $this->full_name,
|
'fullName' => $this->full_name,
|
||||||
'division' => $this->division_name ?? '',
|
'division' => $this->division_name ?? '',
|
||||||
'status' => $this->status,
|
'status' => $this->status,
|
||||||
|
'claimRequestId' => $this->claim_request_id,
|
||||||
'submissionDate' => $this->submission_date,
|
'submissionDate' => $this->submission_date,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
31
Modules/Client/Transformers/ClaimReport/ShowResources.php
Normal file
31
Modules/Client/Transformers/ClaimReport/ShowResources.php
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Modules\Client\Transformers\ClaimReport;
|
||||||
|
|
||||||
|
use Illuminate\Http\Resources\Json\JsonResource;
|
||||||
|
|
||||||
|
class ShowResources extends JsonResource
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Transform the resource into an array.
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Http\Request
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function toArray($request)
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'claimRequestId' => $this->id,
|
||||||
|
'claimId' => $this->claim_id,
|
||||||
|
'submissionDate' => $this->submission_date,
|
||||||
|
'histories' => $this->whenLoaded('histories'),
|
||||||
|
'fullName' => $this->whenLoaded('member', $this->member->full_name),
|
||||||
|
'status' => $this->status,
|
||||||
|
'files' => [
|
||||||
|
'claimResults' => ClaimReportFileShowResources::collection($this->whenLoaded('claimResults')),
|
||||||
|
'claimConditions' => ClaimReportFileShowResources::collection($this->whenLoaded('claimConditions')),
|
||||||
|
'claimDiagnosis' => ClaimReportFileShowResources::collection($this->whenLoaded('claimDiagnosis'))
|
||||||
|
]
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -114,7 +114,7 @@ class ClaimRequest extends Model
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// public static function getNextCode()
|
// public static function getNextCode()
|
||||||
// {
|
// {
|
||||||
// $last_number = self::withTrashed()->max('code');
|
// $last_number = self::withTrashed()->max('code');
|
||||||
@@ -143,6 +143,21 @@ class ClaimRequest extends Model
|
|||||||
return $this->morphMany(File::class, 'fileable');
|
return $this->morphMany(File::class, 'fileable');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function claimResults()
|
||||||
|
{
|
||||||
|
return $this->files()->where('type', 'claim-result')->whereNull('deleted_at');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function claimConditions()
|
||||||
|
{
|
||||||
|
return $this->files()->where('type', 'claim-kondisi')->whereNull('deleted_at');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function claimDiagnosis()
|
||||||
|
{
|
||||||
|
return $this->files()->where('type', 'claim-diagnosis')->whereNull('deleted_at');
|
||||||
|
}
|
||||||
|
|
||||||
public function generatedDocuments()
|
public function generatedDocuments()
|
||||||
{
|
{
|
||||||
return $this->morphMany(GeneratedDocument::class, 'generated_documentable');
|
return $this->morphMany(GeneratedDocument::class, 'generated_documentable');
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ class CorporateMemberService
|
|||||||
->joinClaimRequests('right')
|
->joinClaimRequests('right')
|
||||||
->joinCorporateEmployees('left')
|
->joinCorporateEmployees('left')
|
||||||
->joinCorporateDivisions('left')
|
->joinCorporateDivisions('left')
|
||||||
|
->with('person:id,name_prefix,name_suffix,gender,name,birth_date')
|
||||||
->withSum('claims', 'total_claim')
|
->withSum('claims', 'total_claim')
|
||||||
->whereHas('employeds', function (Builder $corporateEmployee) use ($corporateId) {
|
->whereHas('employeds', function (Builder $corporateEmployee) use ($corporateId) {
|
||||||
$corporateEmployee->where('corporate_id', $corporateId);
|
$corporateEmployee->where('corporate_id', $corporateId);
|
||||||
@@ -80,7 +81,7 @@ class CorporateMemberService
|
|||||||
$query->getQuery()->orderBy('corporate_divisions.name', $request->order);
|
$query->getQuery()->orderBy('corporate_divisions.name', $request->order);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
->select(['members.id', 'members.person_id', 'members.member_id', 'members.name', 'corporate_divisions.name AS division_name', 'claim_requests.status', 'claim_requests.code','claim_requests.submission_date'])
|
->select(['members.id', 'members.person_id', 'members.member_id', 'members.name', 'corporate_divisions.name AS division_name', 'claim_requests.status', 'claim_requests.code', 'claim_requests.id AS claim_request_id','claim_requests.submission_date'])
|
||||||
->paginate($limit);
|
->paginate($limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -89,7 +90,7 @@ class CorporateMemberService
|
|||||||
$limit = $request->has('perPage') ? $request->input('perPage') : 10;
|
$limit = $request->has('perPage') ? $request->input('perPage') : 10;
|
||||||
|
|
||||||
return Member::query()
|
return Member::query()
|
||||||
// ->joinClaimRequests('right')
|
// ->joinClaimRequests('right')
|
||||||
->joinCorporateEmployees('left')
|
->joinCorporateEmployees('left')
|
||||||
->joinCorporateDivisions('left')
|
->joinCorporateDivisions('left')
|
||||||
->with('currentPlan')
|
->with('currentPlan')
|
||||||
@@ -121,8 +122,8 @@ class CorporateMemberService
|
|||||||
$query->getQuery()->orderBy('corporate_divisions.name', $request->order);
|
$query->getQuery()->orderBy('corporate_divisions.name', $request->order);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
// ->select(['members.id', 'members.person_id', 'members.member_id', 'members.name', 'corporate_divisions.name AS division_name', 'members.active', 'claim_requests.id', 'claim_requests.member_id', 'claim_requests.submission_date'])
|
// ->select(['members.id', 'members.person_id', 'members.member_id', 'members.name', 'corporate_divisions.name AS division_name', 'members.active', 'claim_requests.id', 'claim_requests.member_id', 'claim_requests.submission_date'])
|
||||||
->select(['members.id', 'members.person_id', 'members.member_id', 'members.name', 'corporate_divisions.name AS division_name', 'members.active'])
|
->select(['members.id', 'members.person_id', 'members.member_id', 'members.name', 'corporate_divisions.name AS division_name', 'members.active'])
|
||||||
->paginate($limit);
|
->paginate($limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,50 +1,67 @@
|
|||||||
// @mui
|
// @mui
|
||||||
import {
|
import { Box, Stepper, Step, StepLabel, Card, Typography, Divider, Stack } from '@mui/material';
|
||||||
Button,
|
|
||||||
Box,
|
|
||||||
Stepper,
|
|
||||||
Step,
|
|
||||||
StepLabel,
|
|
||||||
Card,
|
|
||||||
Typography,
|
|
||||||
Divider,
|
|
||||||
Stack,
|
|
||||||
} from '@mui/material';
|
|
||||||
import { Add } from '@mui/icons-material';
|
|
||||||
// components
|
|
||||||
import MuiDialog from '../../components/MuiDialog';
|
|
||||||
// theme
|
|
||||||
import palette from '../../theme/palette';
|
|
||||||
// React
|
// React
|
||||||
import { ReactElement } from 'react';
|
import { useContext, useEffect, useState } from 'react';
|
||||||
|
import { useNavigate, useParams } from 'react-router';
|
||||||
type DataContent = {
|
// axios
|
||||||
info: string;
|
import axios from '../../utils/axios';
|
||||||
date: string;
|
import { UserCurrentCorporateContext } from '../../contexts/UserCurrentCorporate';
|
||||||
time: string;
|
import { fDate, fPostFormat } from '../../utils/formatTime';
|
||||||
};
|
import Iconify from '../../components/Iconify';
|
||||||
|
|
||||||
type MuiDialogProps = {
|
|
||||||
title?: {
|
|
||||||
name?: string;
|
|
||||||
icon?: string;
|
|
||||||
};
|
|
||||||
openDialog: boolean;
|
|
||||||
setOpenDialog: Function;
|
|
||||||
content?: ReactElement;
|
|
||||||
data?: DataContent[];
|
|
||||||
};
|
|
||||||
|
|
||||||
const steps = ['Review', 'Approval', 'Disbursement'];
|
const steps = ['Review', 'Approval', 'Disbursement'];
|
||||||
|
|
||||||
const DialogDetailClaim = ({ title, openDialog, setOpenDialog, data }: MuiDialogProps) => {
|
interface DataHistoriesClaimRequest {
|
||||||
function clickHandler(arg0: string) {
|
title: string;
|
||||||
throw new Error('Function not implemented.');
|
description: string;
|
||||||
}
|
created_at: string;
|
||||||
|
}
|
||||||
|
|
||||||
// const getContent = () => (
|
interface DataFilesClaimRequest {
|
||||||
|
id: number;
|
||||||
|
fileName: string;
|
||||||
|
fileUrl: string;
|
||||||
|
}
|
||||||
|
|
||||||
// );
|
interface DataClaimRequest {
|
||||||
|
claimId: number;
|
||||||
|
claimRequestId: number;
|
||||||
|
fullName: string;
|
||||||
|
histories: DataHistoriesClaimRequest[];
|
||||||
|
status: string;
|
||||||
|
submissionDate: string | Date;
|
||||||
|
files: {
|
||||||
|
claimConditions: DataFilesClaimRequest[];
|
||||||
|
claimResults: DataFilesClaimRequest[];
|
||||||
|
claimDiagnosis: DataFilesClaimRequest[];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
const DialogDetailClaim = () => {
|
||||||
|
const { id } = useParams();
|
||||||
|
const navigate = useNavigate();
|
||||||
|
const { corporateValue } = useContext(UserCurrentCorporateContext);
|
||||||
|
const [corporateValueBefore, setCorporateValueBefore] = useState(corporateValue);
|
||||||
|
const [data, setData] = useState<DataClaimRequest | null>(null);
|
||||||
|
|
||||||
|
// inisialisasi pertama
|
||||||
|
useEffect(() => {
|
||||||
|
axios
|
||||||
|
.get(`${corporateValue}/claim-report/${id}`)
|
||||||
|
.then((response) => {
|
||||||
|
setData(response.data.data);
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('Terjadi kesalahan:', error);
|
||||||
|
});
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
// Navigasi ke claim-report ketika corporateValue berubah
|
||||||
|
useEffect(() => {
|
||||||
|
if (corporateValueBefore !== corporateValue) {
|
||||||
|
navigate(`/claim-report`);
|
||||||
|
}
|
||||||
|
}, [corporateValue]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -55,15 +72,20 @@ const DialogDetailClaim = ({ title, openDialog, setOpenDialog, data }: MuiDialog
|
|||||||
sx={{ marginTop: 1 }}
|
sx={{ marginTop: 1 }}
|
||||||
>
|
>
|
||||||
<Typography variant="subtitle1" sx={{ height: 'max-content' }}>
|
<Typography variant="subtitle1" sx={{ height: 'max-content' }}>
|
||||||
Claim Request
|
Claim Request for {data?.fullName}
|
||||||
</Typography>
|
</Typography>
|
||||||
<Stack>
|
<Stack>
|
||||||
<Typography variant="caption">Submission date</Typography>
|
<Typography variant="caption">Submission date</Typography>
|
||||||
<Typography variant="caption">15 / 05 / 2022</Typography>
|
<Typography variant="caption">
|
||||||
|
{fPostFormat(data ? data.submissionDate : new Date(), 'dd / MM / yyyy')}
|
||||||
|
</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Box sx={{ width: '100%', marginTop: 2 }}>
|
<Box sx={{ width: '100%', marginTop: 2 }}>
|
||||||
<Stepper alternativeLabel>
|
<Stepper
|
||||||
|
activeStep={data?.status === 'approved' ? 1 : data?.status === 'requested' ? 0 : 2}
|
||||||
|
alternativeLabel
|
||||||
|
>
|
||||||
{steps.map((label) => (
|
{steps.map((label) => (
|
||||||
<Step key={label}>
|
<Step key={label}>
|
||||||
<StepLabel>{label}</StepLabel>
|
<StepLabel>{label}</StepLabel>
|
||||||
@@ -73,108 +95,116 @@ const DialogDetailClaim = ({ title, openDialog, setOpenDialog, data }: MuiDialog
|
|||||||
</Box>
|
</Box>
|
||||||
<Stack marginTop={2}>
|
<Stack marginTop={2}>
|
||||||
<Typography variant="subtitle1" paddingY={2}>
|
<Typography variant="subtitle1" paddingY={2}>
|
||||||
17 Mei 2022
|
{fDate(data ? data?.histories[0].created_at : new Date())}
|
||||||
</Typography>
|
</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack direction="row" spacing={2}>
|
<Stack direction="row" spacing={2}>
|
||||||
<Divider orientation="vertical" flexItem sx={{ borderStyle: 'dashed' }} />
|
<Divider orientation="vertical" flexItem sx={{ borderStyle: 'dashed' }} />
|
||||||
<Stack spacing={2} sx={{ flex: 1, maxWidth: '100%' }}>
|
<Stack spacing={2} sx={{ flex: 1, maxWidth: '100%' }}>
|
||||||
{/* Item 1 */}
|
{data?.histories.map((history, index) => (
|
||||||
|
<Card sx={{ paddingY: 2, paddingX: 3 }} key={`${history.title}-${index}`}>
|
||||||
|
<Stack direction="row" justifyContent="space-between" alignItems="center">
|
||||||
|
<Typography variant="body1">
|
||||||
|
{fPostFormat(history.created_at, 'HH:mm')} WIB
|
||||||
|
</Typography>
|
||||||
|
</Stack>
|
||||||
|
<Divider sx={{ marginY: 2 }} />
|
||||||
|
<Stack>
|
||||||
|
<Typography variant="subtitle2" color="#404040">
|
||||||
|
Details : {history.description}
|
||||||
|
</Typography>
|
||||||
|
<Typography
|
||||||
|
variant="caption"
|
||||||
|
color="#757575"
|
||||||
|
sx={{ marginTop: 2, marginBottom: 1 }}
|
||||||
|
>
|
||||||
|
{history.title}
|
||||||
|
</Typography>
|
||||||
|
</Stack>
|
||||||
|
</Card>
|
||||||
|
))}
|
||||||
<Card sx={{ paddingY: 2, paddingX: 3 }}>
|
<Card sx={{ paddingY: 2, paddingX: 3 }}>
|
||||||
<Stack direction="row" justifyContent="space-between" alignItems="center">
|
<Stack direction="row" justifyContent="space-between" alignItems="center">
|
||||||
<Typography variant="body1">09:10 WIB</Typography>
|
<Typography variant="body1" fontWeight={600}>
|
||||||
<Typography
|
<Iconify icon="eva:file-text-fill" /> Dokumen Kelengkapan
|
||||||
sx={{
|
|
||||||
backgroundColor: palette.light.warning.lighter,
|
|
||||||
color: palette.light.warning.dark,
|
|
||||||
borderColor: palette.light.warning.dark,
|
|
||||||
border: '1px solid',
|
|
||||||
borderRadius: '6px',
|
|
||||||
padding: 1,
|
|
||||||
}}
|
|
||||||
variant="caption"
|
|
||||||
>
|
|
||||||
Approval
|
|
||||||
</Typography>
|
</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Divider sx={{ marginY: 2 }} />
|
<Divider sx={{ marginY: 2 }} />
|
||||||
|
|
||||||
|
<Typography fontWeight="600">Kondisi</Typography>
|
||||||
<Stack>
|
<Stack>
|
||||||
<Typography variant="subtitle2" color="#404040">
|
<Stack
|
||||||
Details : mohon melengkapi kekurangan dokumen
|
divider={<Divider orientation="horizontal" flexItem />}
|
||||||
</Typography>
|
spacing={1}
|
||||||
<Typography variant="caption" color="#757575" sx={{ marginTop: 2, marginBottom: 1 }}>
|
sx={{ marginY: 2 }}
|
||||||
Lab pemeriksaan darah
|
|
||||||
</Typography>
|
|
||||||
<Button
|
|
||||||
variant="outlined"
|
|
||||||
startIcon={<Add />}
|
|
||||||
fullWidth
|
|
||||||
sx={{ typography: 'subtitle2', borderColor: '#F5F5F5' }}
|
|
||||||
// onClick={() => clickHandler('topUpLimit')}
|
|
||||||
>
|
>
|
||||||
Hasil Pemeriksaan Laboratorium
|
{data &&
|
||||||
</Button>
|
data.files.claimConditions.map((file, index) => (
|
||||||
</Stack>
|
<Stack direction="row" justifyContent={'space-between'} key={index}>
|
||||||
</Card>
|
<a
|
||||||
{/* Item 2 */}
|
href={file.fileUrl}
|
||||||
<Card sx={{ flex: 1, maxWidth: '100%', paddingY: 2, paddingX: 3 }}>
|
target="_blank"
|
||||||
<Stack direction="row" justifyContent="space-between" alignItems="center">
|
style={{ textDecoration: 'none' }}
|
||||||
<Typography variant="body1">09:00 WIB</Typography>
|
rel="noreferrer"
|
||||||
<Typography
|
>
|
||||||
sx={{
|
<Typography sx={{ color: 'text.secondary' }} variant="subtitle2">
|
||||||
backgroundColor: palette.light.warning.lighter,
|
- {file.fileName}
|
||||||
color: palette.light.warning.dark,
|
</Typography>
|
||||||
borderColor: palette.light.warning.dark,
|
</a>
|
||||||
border: '1px solid',
|
</Stack>
|
||||||
borderRadius: '6px',
|
))}
|
||||||
padding: 1,
|
</Stack>
|
||||||
}}
|
|
||||||
variant="caption"
|
<Typography fontWeight="600">Diagnosa</Typography>
|
||||||
|
<Stack
|
||||||
|
divider={<Divider orientation="horizontal" flexItem />}
|
||||||
|
spacing={1}
|
||||||
|
sx={{ marginY: 2 }}
|
||||||
>
|
>
|
||||||
Approval
|
{data &&
|
||||||
</Typography>
|
data.files.claimDiagnosis.map((file, index) => (
|
||||||
</Stack>
|
<Stack direction="row" justifyContent={'space-between'} key={index}>
|
||||||
<Divider sx={{ marginY: 2 }} />
|
<a
|
||||||
<Stack>
|
href={file.fileUrl}
|
||||||
<Typography variant="subtitle2" color="#404040">
|
target="_blank"
|
||||||
Details : Penilaian Dokter
|
style={{ textDecoration: 'none' }}
|
||||||
</Typography>
|
rel="noreferrer"
|
||||||
</Stack>
|
>
|
||||||
</Card>
|
<Typography sx={{ color: 'text.secondary' }} variant="subtitle2">
|
||||||
{/* Item 3 */}
|
- {file.fileName}
|
||||||
<Card sx={{ flex: 1, maxWidth: '100%', paddingY: 2, paddingX: 3 }}>
|
</Typography>
|
||||||
<Stack direction="row" justifyContent="space-between" alignItems="center">
|
</a>
|
||||||
<Typography variant="body1">08:00 WIB</Typography>
|
</Stack>
|
||||||
<Typography
|
))}
|
||||||
sx={{
|
</Stack>
|
||||||
backgroundColor: '#F5F5F5',
|
|
||||||
color: '#757575',
|
<Typography fontWeight="600">Hasil</Typography>
|
||||||
borderColor: '#757575',
|
<Stack
|
||||||
border: '1px solid',
|
divider={<Divider orientation="horizontal" flexItem />}
|
||||||
borderRadius: '6px',
|
spacing={1}
|
||||||
padding: 1,
|
sx={{ marginY: 2 }}
|
||||||
}}
|
|
||||||
variant="caption"
|
|
||||||
>
|
>
|
||||||
Review
|
{data &&
|
||||||
</Typography>
|
data.files.claimResults.map((file, index) => (
|
||||||
</Stack>
|
<Stack direction="row" justifyContent={'space-between'} key={index}>
|
||||||
<Divider sx={{ marginY: 2 }} />
|
<a
|
||||||
<Stack>
|
href={file.fileUrl}
|
||||||
<Typography variant="subtitle2" color="#404040">
|
target="_blank"
|
||||||
Details : Klaim Diajukan
|
style={{ textDecoration: 'none' }}
|
||||||
</Typography>
|
rel="noreferrer"
|
||||||
|
>
|
||||||
|
<Typography sx={{ color: 'text.secondary' }} variant="subtitle2">
|
||||||
|
- {file.fileName}
|
||||||
|
</Typography>
|
||||||
|
</a>
|
||||||
|
</Stack>
|
||||||
|
))}
|
||||||
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Card>
|
</Card>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
</>
|
</>
|
||||||
// <MuiDialog
|
|
||||||
// title={title}
|
|
||||||
// openDialog={openDialog}
|
|
||||||
// setOpenDialog={setOpenDialog}
|
|
||||||
// content={getContent()}
|
|
||||||
// />
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import { useContext, useEffect, useState } from 'react';
|
|||||||
import { Container, Grid } from '@mui/material';
|
import { Container, Grid } from '@mui/material';
|
||||||
/* ------------------------------- components ------------------------------- */
|
/* ------------------------------- components ------------------------------- */
|
||||||
import Page from '../../components/Page';
|
import Page from '../../components/Page';
|
||||||
import TableList from '../../components/Table';
|
|
||||||
/* ---------------------------------- hooks --------------------------------- */
|
/* ---------------------------------- hooks --------------------------------- */
|
||||||
import useSettings from '../../hooks/useSettings';
|
import useSettings from '../../hooks/useSettings';
|
||||||
/* -------------------------------- sections -------------------------------- */
|
/* -------------------------------- sections -------------------------------- */
|
||||||
@@ -13,13 +12,7 @@ import CardClaimStatus from '../../sections/claim-report/CardClaimStatus';
|
|||||||
import axios from '../../utils/axios';
|
import axios from '../../utils/axios';
|
||||||
/* --------------------------------- context -------------------------------- */
|
/* --------------------------------- context -------------------------------- */
|
||||||
import { UserCurrentCorporateContext } from '../../contexts/UserCurrentCorporate';
|
import { UserCurrentCorporateContext } from '../../contexts/UserCurrentCorporate';
|
||||||
/* --------------------------------- orders --------------------------------- */
|
|
||||||
import { HeadCell, Order, PaginationTableProps } from '../../@types/table';
|
|
||||||
import { useSearchParams } from 'react-router-dom';
|
|
||||||
import List from './List';
|
import List from './List';
|
||||||
import ClaimItems from '../Claims/components/ClaimItems';
|
|
||||||
import DiagnosisHistory from '../Claims/components/DiagnosisHistory';
|
|
||||||
import Documents from '../Claims/components/Documents';
|
|
||||||
// theme
|
// theme
|
||||||
import palette from '../../theme/palette';
|
import palette from '../../theme/palette';
|
||||||
|
|
||||||
@@ -32,115 +25,10 @@ interface ClaimStatusType {
|
|||||||
export default function Drugs() {
|
export default function Drugs() {
|
||||||
const { themeStretch } = useSettings();
|
const { themeStretch } = useSettings();
|
||||||
const { corporateValue } = useContext(UserCurrentCorporateContext);
|
const { corporateValue } = useContext(UserCurrentCorporateContext);
|
||||||
|
|
||||||
const [listClaimStatusItems, setListClaimStatusItems] = useState<ClaimStatusType[]>([]);
|
const [listClaimStatusItems, setListClaimStatusItems] = useState<ClaimStatusType[]>([]);
|
||||||
const [listAllMemberByClaimStatus, setListAllMemberByClaimStatus] = useState([]);
|
|
||||||
|
|
||||||
/* -------------------------------------------------------------------------- */
|
|
||||||
/* setTable */
|
|
||||||
/* -------------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
const [isLoading, setIsLoading] = useState(true);
|
|
||||||
|
|
||||||
const loadings = {
|
|
||||||
isLoading: isLoading,
|
|
||||||
setIsLoading: setIsLoading,
|
|
||||||
};
|
|
||||||
|
|
||||||
/* ------------------------------ handle params ----------------------------- */
|
|
||||||
const [searchParams, setSearchParams] = useSearchParams();
|
|
||||||
const [appliedParams, setAppliedParams] = useState({});
|
|
||||||
|
|
||||||
const params = {
|
|
||||||
searchParams: searchParams,
|
|
||||||
setSearchParams: setSearchParams,
|
|
||||||
appliedParams: appliedParams,
|
|
||||||
setAppliedParams: setAppliedParams,
|
|
||||||
};
|
|
||||||
/* -------------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
/* ------------------------------ handle order ------------------------------ */
|
|
||||||
const [order, setOrder] = useState<Order>('asc');
|
|
||||||
const [orderBy, setOrderBy] = useState('fullName');
|
|
||||||
|
|
||||||
const orders = {
|
|
||||||
order: order,
|
|
||||||
setOrder: setOrder,
|
|
||||||
orderBy: orderBy,
|
|
||||||
setOrderBy: setOrderBy,
|
|
||||||
};
|
|
||||||
/* -------------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
/* ---------------------------- handle pagination --------------------------- */
|
|
||||||
const [page, setPage] = useState(0);
|
|
||||||
const [rowsPerPage, setRowsPerPage] = useState(10);
|
|
||||||
|
|
||||||
const [paginationTable, setPaginationTable] = useState<PaginationTableProps>({
|
|
||||||
current_page: 0,
|
|
||||||
from: 0,
|
|
||||||
last_page: 0,
|
|
||||||
links: [],
|
|
||||||
path: '',
|
|
||||||
per_page: 0,
|
|
||||||
to: 0,
|
|
||||||
total: 0,
|
|
||||||
});
|
|
||||||
|
|
||||||
const paginations = {
|
|
||||||
page: page,
|
|
||||||
setPage: setPage,
|
|
||||||
rowsPerPage: rowsPerPage,
|
|
||||||
setRowsPerPage: setRowsPerPage,
|
|
||||||
paginationTable: paginationTable,
|
|
||||||
setPaginationTable: setPaginationTable,
|
|
||||||
};
|
|
||||||
/* -------------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
/* -------------------------------- headCell -------------------------------- */
|
|
||||||
const headCells: HeadCell<never>[] = [
|
|
||||||
{
|
|
||||||
id: 'memberId',
|
|
||||||
align: 'left',
|
|
||||||
label: 'Member ID',
|
|
||||||
isSort: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 'codeRequest',
|
|
||||||
align: 'left',
|
|
||||||
label: 'Code Request',
|
|
||||||
isSort: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 'fullName',
|
|
||||||
align: 'center',
|
|
||||||
label: 'Name',
|
|
||||||
isSort: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 'division',
|
|
||||||
align: 'center',
|
|
||||||
label: 'Divisi',
|
|
||||||
isSort: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 'submissionDate',
|
|
||||||
align: 'center',
|
|
||||||
label: 'Submission Date',
|
|
||||||
isSort: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 'status',
|
|
||||||
align: 'center',
|
|
||||||
label: 'Status',
|
|
||||||
isSort: true,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
/* -------------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
(async () => {
|
(async () => {
|
||||||
setIsLoading(true);
|
|
||||||
|
|
||||||
const claimStatus = await axios.get(`${corporateValue}/claim-report/claim-status`);
|
const claimStatus = await axios.get(`${corporateValue}/claim-report/claim-status`);
|
||||||
|
|
||||||
setListClaimStatusItems([
|
setListClaimStatusItems([
|
||||||
@@ -160,28 +48,8 @@ export default function Drugs() {
|
|||||||
color: palette.dark.error.dark,
|
color: palette.dark.error.dark,
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const parameters =
|
|
||||||
Object.keys(appliedParams).length !== 0
|
|
||||||
? appliedParams
|
|
||||||
: Object.fromEntries([
|
|
||||||
...searchParams.entries(),
|
|
||||||
['order', orders.order],
|
|
||||||
['orderBy', orders.orderBy],
|
|
||||||
]);
|
|
||||||
|
|
||||||
const claim = await axios.get(`${corporateValue}/members`, {
|
|
||||||
params: { ...parameters, type: 'claim-report' },
|
|
||||||
});
|
|
||||||
|
|
||||||
setSearchParams(parameters);
|
|
||||||
|
|
||||||
setListAllMemberByClaimStatus(claim.data.data.allMembersByClaimStatus.data);
|
|
||||||
setPaginationTable(claim.data.data.allMembersByClaimStatus);
|
|
||||||
|
|
||||||
setIsLoading(false);
|
|
||||||
})();
|
})();
|
||||||
}, [appliedParams, searchParams, order, orderBy, setSearchParams, corporateValue]);
|
}, [corporateValue]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Page title="Claim Reports">
|
<Page title="Claim Reports">
|
||||||
@@ -192,15 +60,6 @@ export default function Drugs() {
|
|||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={12} lg={12} md={12}>
|
<Grid item xs={12} lg={12} md={12}>
|
||||||
<List />
|
<List />
|
||||||
|
|
||||||
{/* <TableList
|
|
||||||
headCells={headCells}
|
|
||||||
rows={listAllMemberByClaimStatus}
|
|
||||||
orders={orders}
|
|
||||||
paginations={paginations}
|
|
||||||
loadings={loadings}
|
|
||||||
params={params}
|
|
||||||
/> */}
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Container>
|
</Container>
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ export default function List() {
|
|||||||
status:
|
status:
|
||||||
obj.status === 'requested' ? (
|
obj.status === 'requested' ? (
|
||||||
<Button
|
<Button
|
||||||
onClick={() => navigate('dialog-detail')}
|
onClick={() => navigate(`dialog-detail/${obj.claimRequestId}`)}
|
||||||
sx={{
|
sx={{
|
||||||
backgroundColor: 'rgba(84, 214, 44, 0.16)',
|
backgroundColor: 'rgba(84, 214, 44, 0.16)',
|
||||||
color: palette.dark.success.dark,
|
color: palette.dark.success.dark,
|
||||||
@@ -190,6 +190,7 @@ export default function List() {
|
|||||||
</Button>
|
</Button>
|
||||||
) : obj.status === 'approved' ? (
|
) : obj.status === 'approved' ? (
|
||||||
<Button
|
<Button
|
||||||
|
onClick={() => navigate(`dialog-detail/${obj.claimRequestId}`)}
|
||||||
sx={{
|
sx={{
|
||||||
backgroundColor: (theme) => theme.palette.secondary.main,
|
backgroundColor: (theme) => theme.palette.secondary.main,
|
||||||
color: '#FFFF',
|
color: '#FFFF',
|
||||||
|
|||||||
@@ -128,8 +128,8 @@ export default function Router() {
|
|||||||
index: true,
|
index: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'dialog-detail',
|
path: 'dialog-detail/:id',
|
||||||
element: <DialogDetailClaim/>
|
element: <DialogDetailClaim />,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -216,4 +216,4 @@ const ClaimSubmit = Loadable(lazy(() => import('../pages/ClaimSubmit/Index')));
|
|||||||
// Corporate
|
// Corporate
|
||||||
const Corporate = Loadable(lazy(() => import('../pages/Corporate/Index')));
|
const Corporate = Loadable(lazy(() => import('../pages/Corporate/Index')));
|
||||||
const CorporateEdit = Loadable(lazy(() => import('../pages/Corporate/Form')));
|
const CorporateEdit = Loadable(lazy(() => import('../pages/Corporate/Form')));
|
||||||
const CorporateShow = Loadable(lazy(() => import('../pages/Corporate/Show')));
|
const CorporateShow = Loadable(lazy(() => import('../pages/Corporate/Show')));
|
||||||
|
|||||||
Reference in New Issue
Block a user