update requeset

This commit is contained in:
2023-09-28 16:00:36 +07:00
parent 9b4579e8f1
commit 0fd79b8284
8 changed files with 73 additions and 16 deletions

View File

@@ -53,7 +53,7 @@ class ClaimRequestController extends Controller
'title' => 'New Claim Requested',
'description' => "Claim Requested for Member : {$member->member_id} - ({$member->full_name})",
'type' => 'info',
'system_origin' => 'hospital-portal'
'system_origin' => 'client-portal'
]);
if ($request->hasFile('result_files')) {

View File

@@ -16,6 +16,7 @@ class MemberResources extends JsonResource
{
return [
'id' => $this->id,
'codeRequest' => $this->code,
'memberId' => $this->member_id,
'fullName' => $this->full_name,
'division' => $this->division_name ?? '',

View File

@@ -3,6 +3,7 @@
namespace Modules\Internal\Transformers;
use Illuminate\Http\Resources\Json\JsonResource;
use Illuminate\Support\Str;
class ClaimRequestResource extends JsonResource
{
@@ -15,7 +16,7 @@ class ClaimRequestResource extends JsonResource
public function toArray($request)
{
$filesGroupByType = $this->files->mapToGroups(function($file) {
return [$file->type => $file];
return [Str::slug($file->type, '_') => $file];
});
$data = [

View File

@@ -70,16 +70,17 @@ class CorporateMemberService
$orderBy = match ($request->orderBy) {
'memberId' => 'member_id',
'fullName' => 'name',
'codeRequest' => 'code',
default => ''
};
if (in_array($orderBy, ['member_id', 'name', 'active'])) {
if (in_array($orderBy, ['member_id', 'name', 'active', 'code'])) {
$query->getQuery()->orderBy($orderBy, $request->order);
} elseif ($request->orderBy === 'division') {
$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'])
->select(['members.id', 'members.person_id', 'members.member_id', 'members.name', 'corporate_divisions.name AS division_name', 'claim_requests.status', 'claim_requests.code'])
->paginate($limit);
}

View File

@@ -104,6 +104,12 @@ export default function Drugs() {
label: 'Member ID',
isSort: true,
},
{
id: 'codeRequest',
align: 'left',
label: 'Code Request',
isSort: true,
},
{
id: 'fullName',
align: 'center',

View File

@@ -45,8 +45,8 @@ export default function List() {
/* -------------------------------------------------------------------------- */
/* ------------------------------ handle order ------------------------------ */
const [order, setOrder] = useState<Order>('asc');
const [orderBy, setOrderBy] = useState('fullName');
const [order, setOrder] = useState<Order>('desc');
const [orderBy, setOrderBy] = useState('codeRequest');
const orders = {
order: order,
@@ -112,6 +112,12 @@ export default function List() {
label: 'Member ID',
isSort: true,
},
{
id: 'codeRequest',
align: 'left',
label: 'Code Request',
isSort: true,
},
{
id: 'fullName',
align: 'left',
@@ -123,13 +129,13 @@ export default function List() {
id: 'division',
align: 'left',
label: 'Divisi',
isSort: true,
isSort: false,
},
{
id: 'status',
align: 'center',
label: 'Status',
isSort: true,
isSort: false,
},
{
id: 'action',

View File

@@ -195,7 +195,8 @@ export default function List() {
<TableCell align="left">{row.member?.current_policy?.code}</TableCell>
<TableCell align="left">{row.submission_date}</TableCell>
<TableCell align="left">{row.service_name}</TableCell>
<TableCell align="left">{row.payment_type_name}</TableCell>
{/* <TableCell align="left">{row.payment_type_name}</TableCell> */}
<TableCell align="left">{'-'}</TableCell>
<TableCell align="right">
<Chip label={row.status} />
</TableCell>
@@ -236,17 +237,58 @@ export default function List() {
>
<Box>
<Typography fontWeight={600}>Berkas Hasil Penunjang</Typography>
{row.files_by_type?.result &&
row.files_by_type?.result.map((file, index) => (
{/* {row.files_by_type?.claim_kondisi &&
row.files_by_type?.claim_kondisi.map((file, index) => (
<Stack direction="row" key={index}>
<Typography sx={{ marginRight: 2 }}>-</Typography>{' '}
<a href={file.url} target="_blank">
{file.name}
</a>
</Stack>
))}
))} */}
{!row.files_by_type?.result && <Typography>Tidak ada berkas</Typography>}
{row.files_by_type?.claim_kondisi && (
<>
<Typography fontWeight={600} sx={{ marginRight: 4 }}> - Kondisi</Typography>
{row.files_by_type?.claim_kondisi.map((file, index) => (
<Stack direction="row" key={index}>
<a href={file.url} target="_blank">
{file.name}
</a>
</Stack>
))}
</>
)}
{row.files_by_type?.claim_diagnosis && (
<>
<Typography fontWeight={600} sx={{ marginRight: 4 }}> - Diagnosa</Typography>
{row.files_by_type?.claim_diagnosis.map((file, index) => (
<Stack direction="row" key={index}>
<a href={file.url} target="_blank">
{file.name}
</a>
</Stack>
))}
</>
)}
{row.files_by_type?.claim_result && (
<>
<Typography fontWeight={600} sx={{ marginRight: 4 }}> - Hasil</Typography>
{row.files_by_type?.claim_result.map((file, index) => (
<Stack direction="row" key={index}>
<a href={file.url} target="_blank">
{file.name}
</a>
</Stack>
))}
</>
)}
{(!row.files_by_type?.claim_result && !row.files_by_type?.claim_diagnosis && !row.files_by_type?.claim_kondisi)&& <Typography>Tidak ada berkas</Typography>}
</Box>
</Stack>
</Box>

View File

@@ -174,7 +174,7 @@ export default function List() {
</IconButton>
</TableCell>
<TableCell align="left">{row.claim_request?.code}</TableCell>
<TableCell align="left">{row.code}</TableCell>
{/* <TableCell align="left">{row.code}</TableCell> */}
<TableCell align="left">{row.member?.full_name}</TableCell>
<TableCell align="left">{row.plan?.code}</TableCell>
<TableCell align="left">{row.claim_request?.service?.name}</TableCell>
@@ -234,9 +234,9 @@ export default function List() {
<TableCell style={headStyle} align="left">
Code Request
</TableCell>
<TableCell style={headStyle} align="left">
{/* <TableCell style={headStyle} align="left">
Code Claim
</TableCell>
</TableCell> */}
<TableCell style={headStyle} align="left">
Member Name
</TableCell>