Merge branch 'origin/production' of https://dev.sismedika.online/febio/aso into origin/production
This commit is contained in:
@@ -6,6 +6,7 @@ use App\Helpers\Helper;
|
|||||||
use App\Models\Member;
|
use App\Models\Member;
|
||||||
use App\Models\Claim;
|
use App\Models\Claim;
|
||||||
use App\Models\ClaimRequest;
|
use App\Models\ClaimRequest;
|
||||||
|
use App\Models\RequestLog;
|
||||||
use App\Services\CorporateMemberService;
|
use App\Services\CorporateMemberService;
|
||||||
use Illuminate\Contracts\Support\Renderable;
|
use Illuminate\Contracts\Support\Renderable;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
@@ -184,17 +185,31 @@ class CorporateMemberController extends Controller
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function showPerMember($corporate_id, $member_id)
|
public function showPerMember(Request $request, $corporate_id, $member_id)
|
||||||
{
|
{
|
||||||
$data = ClaimRequest::where(['member_id' => $member_id])
|
$per_page = $request->has('per_page') ? $request->input('per_page') : 10;
|
||||||
->whereNotNull('claim_id')
|
|
||||||
->paginate(10);
|
$data = Member::query()
|
||||||
return response()->json(Helper::paginateResources(DataListClaimMemberResource::collection($data)));
|
->with(['requestLogs'])
|
||||||
|
->whereHas('currentCorporate', function ($query) use ($corporate_id) {
|
||||||
|
$query->where('corporate_id', $corporate_id);
|
||||||
|
})
|
||||||
|
->find($member_id);
|
||||||
|
|
||||||
|
return response()->json(['full_name' => $data->full_name, 'paginations' => Helper::paginateResources(DataListClaimMemberResource::collection($data->requestLogs()->paginate($per_page)))]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function serviceMonitoring($corporate_id, $claim_id)
|
public function serviceMonitoring(int $corporate_id, int $request_log_id)
|
||||||
{
|
{
|
||||||
$data = Claim::where('id', $claim_id)->first();
|
// $data = Claim::where('id', $claim_id)->first();
|
||||||
|
|
||||||
|
// return $request_log_id;
|
||||||
|
|
||||||
|
$data = RequestLog::query()
|
||||||
|
->with(['member' => ['currentCorporate', 'person'], 'organization', 'requestLogBenefit' => ['benefit'], 'requestLogDailyMonitorings' => ['requestLogMedicalPlans'],])
|
||||||
|
->find($request_log_id);
|
||||||
|
|
||||||
|
// return $data;
|
||||||
return Helper::responseJson(DataServiceMonitoring::make($data));
|
return Helper::responseJson(DataServiceMonitoring::make($data));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ Route::prefix('client')->group(function () {
|
|||||||
Route::get('members/{id}', [CorporateMemberController::class, 'show']);
|
Route::get('members/{id}', [CorporateMemberController::class, 'show']);
|
||||||
Route::get('export-members/list', [CorporateMemberController::class, 'generateMemberList']);
|
Route::get('export-members/list', [CorporateMemberController::class, 'generateMemberList']);
|
||||||
Route::get('alarm-center-members/{id}', [CorporateMemberController::class, 'showPerMember']);
|
Route::get('alarm-center-members/{id}', [CorporateMemberController::class, 'showPerMember']);
|
||||||
Route::get('service-monitoring/{id}', [CorporateMemberController::class, 'serviceMonitoring']);
|
Route::get('service-monitoring/{request_log_id}', [CorporateMemberController::class, 'serviceMonitoring']);
|
||||||
Route::get('claims/status', [ClaimController::class, 'status']);
|
Route::get('claims/status', [ClaimController::class, 'status']);
|
||||||
Route::get('claims', [ClaimController::class, 'index']);
|
Route::get('claims', [ClaimController::class, 'index']);
|
||||||
Route::get('claims/export', [ClaimController::class, 'export']);
|
Route::get('claims/export', [ClaimController::class, 'export']);
|
||||||
@@ -65,8 +65,6 @@ Route::prefix('client')->group(function () {
|
|||||||
|
|
||||||
Route::get('corporate', [CorporateCurrentController::class, 'index']);
|
Route::get('corporate', [CorporateCurrentController::class, 'index']);
|
||||||
Route::put('corporate-update', [CorporateCurrentController::class, 'update']);
|
Route::put('corporate-update', [CorporateCurrentController::class, 'update']);
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
Route::get('claims/{id}', [ClaimController::class, 'show']);
|
Route::get('claims/{id}', [ClaimController::class, 'show']);
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,7 @@
|
|||||||
|
|
||||||
namespace Modules\Client\Transformers\AlarmCenter;
|
namespace Modules\Client\Transformers\AlarmCenter;
|
||||||
|
|
||||||
use App\Models\Member;
|
|
||||||
use Illuminate\Http\Resources\Json\JsonResource;
|
use Illuminate\Http\Resources\Json\JsonResource;
|
||||||
use Illuminate\Support\Facades\Storage;
|
|
||||||
|
|
||||||
class DataListClaimMemberResource extends JsonResource
|
class DataListClaimMemberResource extends JsonResource
|
||||||
{
|
{
|
||||||
@@ -16,22 +14,13 @@ class DataListClaimMemberResource extends JsonResource
|
|||||||
*/
|
*/
|
||||||
public function toArray($request)
|
public function toArray($request)
|
||||||
{
|
{
|
||||||
$member = Member::findOrFail($this->member_id);
|
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'id' => $this->id,
|
'id' => $this->id,
|
||||||
'admission_date' => $this->submission_date,
|
'admission_date' => $this->submission_date ?? null,
|
||||||
'discharge_date' => $this->submission_date,
|
'discharge_date' => $this->discharge_date ?? null,
|
||||||
'code' => $this->code,
|
'code' => $this->code ?? null,
|
||||||
'service_type' => $this->service_code == 'IP' ? 'Inpatient' : 'Outpatient',
|
'service_type' => $this->service_code == 'IP' ? 'Inpatient' : 'Outpatient',
|
||||||
'status' => $this->service_code == 'approved' ? 'Done' : 'OnGoing',
|
'status' => $this->status === 'requested' || ($this->status === 'approved' && $this->status_final_log) || ($this->status_final_log === 'requested' && $this->status === 'requested') ? 'Ongoing' : ($this->status === 'approved' && $this->status_final_log === 'approved' ? 'Approved' : 'Declined')
|
||||||
'claim_id' => $this->claim_id,
|
];
|
||||||
// 'memberId' => $this->member_id,
|
|
||||||
'fullName' => $member->name,
|
|
||||||
// 'division' => $this->division_name ?? '',
|
|
||||||
// 'status' => $this->status,
|
|
||||||
// 'claimRequestId' => $this->claim_request_id,
|
|
||||||
// 'submissionDate' => $this->submission_date,
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,25 +2,8 @@
|
|||||||
|
|
||||||
namespace Modules\Client\Transformers\AlarmCenter;
|
namespace Modules\Client\Transformers\AlarmCenter;
|
||||||
|
|
||||||
use App\Models\ClaimRequest;
|
|
||||||
use App\Models\DiagnosisSecondaryClaimHistoryCare;
|
|
||||||
use App\Models\ClaimEncounter;
|
|
||||||
use App\Models\ClaimHistoryCare;
|
|
||||||
use App\Models\Encounter;
|
|
||||||
use App\Models\Member;
|
|
||||||
use App\Models\Icd;
|
|
||||||
use App\Models\Organization;
|
|
||||||
use App\Models\MedicalPlan;
|
|
||||||
use App\Models\CorporateEmployee;
|
|
||||||
use App\Models\DailyMonitoring;
|
|
||||||
use App\Models\LaboratoriumResult;
|
|
||||||
|
|
||||||
|
|
||||||
use App\Helpers\Helper;
|
use App\Helpers\Helper;
|
||||||
|
|
||||||
|
|
||||||
use Illuminate\Http\Resources\Json\JsonResource;
|
use Illuminate\Http\Resources\Json\JsonResource;
|
||||||
use Illuminate\Support\Facades\Storage;
|
|
||||||
|
|
||||||
class DataServiceMonitoring extends JsonResource
|
class DataServiceMonitoring extends JsonResource
|
||||||
{
|
{
|
||||||
@@ -32,157 +15,38 @@ class DataServiceMonitoring extends JsonResource
|
|||||||
*/
|
*/
|
||||||
public function toArray($request)
|
public function toArray($request)
|
||||||
{
|
{
|
||||||
$claim_request = ClaimRequest::findOrFail($this->claim_request_id);
|
return [
|
||||||
$member = Member::findOrFail($this->member_id);
|
'companyName' => $this->member->currentCorporate->name ?? null,
|
||||||
|
'memberId' => $this->member->member_id ?? null,
|
||||||
|
'fullName' => $this->member->full_name ?? null,
|
||||||
// History Care Hospital
|
'dateOfBirth' => $this->member->birth_date ?? null,
|
||||||
$historyCareHospital = ClaimHistoryCare::where('claim_id', $this->id)->first();
|
'dateOfBirth' => $this->member->birth_date ?? null,
|
||||||
if ($historyCareHospital) {
|
'phoneNumber' => $this->person->phone ?? null,
|
||||||
$hospital = Organization::findOrFail($historyCareHospital->organization_id)->name;
|
'email' => $this->member->email ?? ($this->member->person->email ?? null),
|
||||||
$mainDianosis = Icd::findOrFail($historyCareHospital->main_diagnosis_id)->name;
|
'serviceName' => $this->service_code === 'IP' ? 'Inpatient' : ($this->service_code === 'OP' ? 'Outpatient' : null),
|
||||||
$mainDianosisCode = Icd::findOrFail($historyCareHospital->main_diagnosis_id)->code;
|
'benefitName' => $this->requestLogBenefit->benefit->description ?? null,
|
||||||
|
'hospital' => $this->organization->name ?? null,
|
||||||
$comporatationDiagnosis = DiagnosisSecondaryClaimHistoryCare::where('claim_history_care_id', $historyCareHospital->id)->first();
|
'admissionDate' => $this->submission_date ?? null,
|
||||||
|
'dischargeDate' => $this->discharge_date ?? null,
|
||||||
$comporatationDiagnosisName = Icd::findOrFail($comporatationDiagnosis->icd_id)->name;
|
'dailyMonitorings' => $this->when($this->service_code === 'IP', collect($this->requesLogDailyMonitorings)->map(function ($requesLogDailyMonitoring) {
|
||||||
$comporatationDiagnosisCode = Icd::findOrFail($comporatationDiagnosis->icd_id)->code;
|
return [
|
||||||
|
'date' => Helper::formatDateOnly($requesLogDailyMonitoring->created_at) ?? null,
|
||||||
$admissionDate = $historyCareHospital->admission_date;
|
'time' => Helper::formatTimeOnly($requesLogDailyMonitoring->created_at) ?? null,
|
||||||
$dischargeDate = $historyCareHospital->discharge_date;
|
'status' => 'Done' ?? null,
|
||||||
$serviceCode = $historyCareHospital->service_code;
|
'subject' => $requesLogDailyMonitoring->subject ?? null,
|
||||||
$symptoms = $historyCareHospital->symptoms;
|
'bodyTemperature' => $requesLogDailyMonitoring->body_temperature ?? null,
|
||||||
$sign = $historyCareHospital->sign;
|
'sistole' => $requesLogDailyMonitoring->sistole . 'mm[Hg]' ?? null,
|
||||||
} else {
|
'diastole' => $requesLogDailyMonitoring->diastole . 'mm[Hg]' ?? null,
|
||||||
$hospital = '-';
|
'respirationRate' => $requesLogDailyMonitoring->respiration_rate . '/min' ?? null,
|
||||||
$mainDianosis = '-';
|
'analysis' => $requesLogDailyMonitoring->analysis ?? null,
|
||||||
$mainDianosisCode = '-';
|
'plan' => collect($requesLogDailyMonitoring->requestLogMedicalPlans)->map(function ($requestLogMedicalPlan) {
|
||||||
$comporatationDiagnosisName = '-';
|
return $requestLogMedicalPlan->type == 1 ? $requestLogMedicalPlan->plan : null;
|
||||||
$comporatationDiagnosisCode = '-';
|
})->all(),
|
||||||
$admissionDate = '-';
|
];
|
||||||
$dischargeDate = '-';
|
})->all()),
|
||||||
$serviceCode = '-';
|
// 'laboratoriumResults' => collect($this->dailyMonitorings)->map(function ($dailyMonitoring) {
|
||||||
$symptoms = '-';
|
// $data['date'][Helper::formatDateOnly($dailyMonitoring->created_at)]
|
||||||
$sign = '-';
|
// })->all() ?? null
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$dailyMonitoring = DailyMonitoring::where('claim_id', $claim_request->claim_id)->get()->toArray();
|
|
||||||
$laboratoriumResult = LaboratoriumResult::where('claim_id', $claim_request->claim_id)->get()->toArray();
|
|
||||||
|
|
||||||
// Handle Daily Monitoring
|
|
||||||
$dataDailyMonitoring = [];
|
|
||||||
if (count($dailyMonitoring) > 0){
|
|
||||||
$temp = [];
|
|
||||||
foreach($dailyMonitoring as $data){
|
|
||||||
$temp['date'] = Helper::formatDateOnly($data['created_at']);
|
|
||||||
$temp['time'] = Helper::formatTimeOnly($data['created_at']);
|
|
||||||
$temp['status'] = 'Done';
|
|
||||||
$temp['subject_title'] = $data['subject'];
|
|
||||||
$temp['body_temperature'] = $data['body_temperature']. 'mm[Hg]';
|
|
||||||
$temp['sistole'] = $data['sistole']. 'mm[Hg]';
|
|
||||||
$temp['diastole'] = $data['diastole']. 'mm[Hg]';
|
|
||||||
$temp['respiration_rate'] = $data['respiration_rate']. 'mm[Hg]';
|
|
||||||
$temp['analisis_title'] = $data['analysis'];
|
|
||||||
|
|
||||||
$medicalPlan = MedicalPlan::where('claim_daily_monitoring_id', $data['id'])->get('plan')->toArray();
|
|
||||||
if (count( $medicalPlan) > 0){
|
|
||||||
$temp['Perencanaan'] = [];
|
|
||||||
foreach($medicalPlan as $item){
|
|
||||||
array_push($temp['Perencanaan'], $item['plan']);
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
$temp['Perencanaan'] = [];
|
|
||||||
}
|
|
||||||
array_push($dataDailyMonitoring, $temp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Handle Laboratorium Result
|
|
||||||
$dataLaboratoruiumResult = [];
|
|
||||||
if (count($laboratoriumResult) > 0){
|
|
||||||
$tempLab = [];
|
|
||||||
foreach($laboratoriumResult as $data){
|
|
||||||
$tempLab['datetime'] = $data['date'];
|
|
||||||
$tempLab['reimbursement_code'] = "RE-0" . $data['id'];
|
|
||||||
$tempLab['examination'] = $data['examination'];
|
|
||||||
$tempLab['location'] = $data['location'];
|
|
||||||
|
|
||||||
if (count($data['lab_result_file']) > 0){
|
|
||||||
$tempLab['file'] = $data['lab_result_file'][0]['lab_result_file_obj']->path; // masih dumy untuk download nya belum bisa multiple
|
|
||||||
}
|
|
||||||
array_push($dataLaboratoruiumResult, $tempLab);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$data = [
|
|
||||||
"id" => $this->id,
|
|
||||||
"company_name" => $member->currentCorporate->name,
|
|
||||||
"member_name" => $member->name,
|
|
||||||
"member_code" => $member->member_id,
|
|
||||||
"member_id" => $member->id,
|
|
||||||
"phone" => $member->person->phone,
|
|
||||||
"email" => $member->email,
|
|
||||||
"birth_date" => $member->birth_date,
|
|
||||||
"symptoms" => $symptoms,
|
|
||||||
"sign" => $sign,
|
|
||||||
"main_diagnose" => $mainDianosis,
|
|
||||||
"main_diagnose_code" => $mainDianosisCode,
|
|
||||||
"comparative_diagnosis" => $comporatationDiagnosisName,
|
|
||||||
"comparative_diagnosis_code" => $comporatationDiagnosisCode,
|
|
||||||
"service_name" => $serviceCode,
|
|
||||||
"benefit_name" => "Konsultasi Dokter",
|
|
||||||
"hospital" => $hospital,
|
|
||||||
"admission_date" => $admissionDate,
|
|
||||||
"discharge_date" => $dischargeDate,
|
|
||||||
"dialy_monitoring" => $dataDailyMonitoring,
|
|
||||||
// "laboratorium_result" => [
|
|
||||||
// "0" => [
|
|
||||||
// [
|
|
||||||
// "datetime" => "2023-10-05 10:00",
|
|
||||||
// "reimbursement_code" => "RE-011",
|
|
||||||
// "examination" => "SGOT",
|
|
||||||
// "location" => "Pramita Jakarta Ragunan",
|
|
||||||
// "files" => "https:://test.com"
|
|
||||||
// ],
|
|
||||||
// [
|
|
||||||
// "datetime" => "2023-10-05 09:00",
|
|
||||||
// "reimbursement_code" => "RE-010",
|
|
||||||
// "examination" => "SGOT",
|
|
||||||
// "location" => "Pramita Jakarta Ragunan",
|
|
||||||
// "files" => "https:://test.com"
|
|
||||||
// ],
|
|
||||||
// ],
|
|
||||||
// "1" => [
|
|
||||||
// [
|
|
||||||
// "datetime" => "2023-10-04 10:00",
|
|
||||||
// "reimbursement_code" => "RE-09",
|
|
||||||
// "examination" => "Hematologi Lengkap",
|
|
||||||
// "location" => "Pramita Jakarta Ragunan",
|
|
||||||
// "files" => "https:://test.com"
|
|
||||||
// ],
|
|
||||||
// [
|
|
||||||
// "datetime" => "2023-10-04 09:00",
|
|
||||||
// "reimbursement_code" => "RE-08",
|
|
||||||
// "examination" => "Hematologi Lengkap",
|
|
||||||
// "location" => "Pramita Jakarta Ragunan",
|
|
||||||
// "files" => "https:://test.com"
|
|
||||||
// ]
|
|
||||||
// ]
|
|
||||||
|
|
||||||
// ],
|
|
||||||
|
|
||||||
"laboratorium_result" => [$dataLaboratoruiumResult], //
|
|
||||||
|
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
return $data;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -197,6 +197,11 @@ class Member extends Model
|
|||||||
{
|
{
|
||||||
return $this->hasOneThrough(CorporateDivision::class, CorporateEmployee::class, 'member_id', 'id', 'id', 'division_id');
|
return $this->hasOneThrough(CorporateDivision::class, CorporateEmployee::class, 'member_id', 'id', 'id', 'division_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function requestLogs()
|
||||||
|
{
|
||||||
|
return $this->hasMany(RequestLog::class);
|
||||||
|
}
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
|
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
@@ -270,13 +275,13 @@ class Member extends Model
|
|||||||
protected function relations(): Attribute
|
protected function relations(): Attribute
|
||||||
{
|
{
|
||||||
$relation = '-';
|
$relation = '-';
|
||||||
if ($this->relation_with_principal == 'H'){
|
if ($this->relation_with_principal == 'H') {
|
||||||
$relation = 'Husbund';
|
$relation = 'Husbund';
|
||||||
} else if ($this->relation_with_principal == 'W'){
|
} else if ($this->relation_with_principal == 'W') {
|
||||||
$relation = 'Wife';
|
$relation = 'Wife';
|
||||||
} else if ($this->relation_with_principal == 'S'){
|
} else if ($this->relation_with_principal == 'S') {
|
||||||
$relation = 'Son';
|
$relation = 'Son';
|
||||||
} else if ($this->relation_with_principal == 'D'){
|
} else if ($this->relation_with_principal == 'D') {
|
||||||
$relation = 'Daughter';
|
$relation = 'Daughter';
|
||||||
}
|
}
|
||||||
return Attribute::make(
|
return Attribute::make(
|
||||||
@@ -287,11 +292,11 @@ class Member extends Model
|
|||||||
protected function statusMarital(): Attribute
|
protected function statusMarital(): Attribute
|
||||||
{
|
{
|
||||||
$maritalStatus = '-';
|
$maritalStatus = '-';
|
||||||
if ($this->marital_status == 'M'){
|
if ($this->marital_status == 'M') {
|
||||||
$maritalStatus = 'Married';
|
$maritalStatus = 'Married';
|
||||||
} else if ($this->relation_with_principal == 'D'){
|
} else if ($this->relation_with_principal == 'D') {
|
||||||
$maritalStatus = 'Divorced';
|
$maritalStatus = 'Divorced';
|
||||||
} else if ($this->relation_with_principal == 'S'){
|
} else if ($this->relation_with_principal == 'S') {
|
||||||
$maritalStatus = 'Single';
|
$maritalStatus = 'Single';
|
||||||
}
|
}
|
||||||
return Attribute::make(
|
return Attribute::make(
|
||||||
@@ -311,12 +316,12 @@ class Member extends Model
|
|||||||
protected function birthDateeCard(): Attribute
|
protected function birthDateeCard(): Attribute
|
||||||
{
|
{
|
||||||
// $date = $this->person->birth_date ?? ($this->birth_date ?? null);
|
// $date = $this->person->birth_date ?? ($this->birth_date ?? null);
|
||||||
if ($this->birth_date){
|
if ($this->birth_date) {
|
||||||
$date = $this->birth_date;
|
$date = $this->birth_date;
|
||||||
return Attribute::make(
|
return Attribute::make(
|
||||||
get: fn () => !empty($date) ? Carbon::parse($date)->format('d / M / Y') : null
|
get: fn () => !empty($date) ? Carbon::parse($date)->format('d / M / Y') : null
|
||||||
);
|
);
|
||||||
} else if ($this->person->birth_date){
|
} else if ($this->person->birth_date) {
|
||||||
return Attribute::make(
|
return Attribute::make(
|
||||||
get: fn () => !empty($date) ? Carbon::parse($date)->format('d / M / Y') : null
|
get: fn () => !empty($date) ? Carbon::parse($date)->format('d / M / Y') : null
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ class RequestLog extends Model
|
|||||||
"CLAIM METHOD",
|
"CLAIM METHOD",
|
||||||
"STATUS",
|
"STATUS",
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
public static $status = [
|
public static $status = [
|
||||||
'draft' => 'Draft',
|
'draft' => 'Draft',
|
||||||
@@ -241,6 +241,16 @@ class RequestLog extends Model
|
|||||||
return $this->belongsTo(Service::class, 'service_code', 'code');
|
return $this->belongsTo(Service::class, 'service_code', 'code');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function requestLogBenefit()
|
||||||
|
{
|
||||||
|
return $this->hasOne(RequestLogBenefit::class, 'request_log_id');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function requestLogDailyMonitorings()
|
||||||
|
{
|
||||||
|
return $this->hasMany(RequestLogDailyMonitoring::class, 'request_log_id');
|
||||||
|
}
|
||||||
|
|
||||||
public function getPaymentTypeNameAttribute()
|
public function getPaymentTypeNameAttribute()
|
||||||
{
|
{
|
||||||
return self::$payment_types[$this->payment_type] ?? $this->payment_type;
|
return self::$payment_types[$this->payment_type] ?? $this->payment_type;
|
||||||
|
|||||||
@@ -24,7 +24,13 @@ class RequestLogBenefit extends Model
|
|||||||
'deleted_by',
|
'deleted_by',
|
||||||
];
|
];
|
||||||
|
|
||||||
public function benefit(){
|
public function benefit()
|
||||||
|
{
|
||||||
return $this->belongsTo(Benefit::class, 'benefit_id', 'id');
|
return $this->belongsTo(Benefit::class, 'benefit_id', 'id');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function requestLog()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(RequestLog::class, 'aa');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
21
app/Models/RequestLogDailyMonitoring.php
Normal file
21
app/Models/RequestLogDailyMonitoring.php
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class RequestLogDailyMonitoring extends Model
|
||||||
|
{
|
||||||
|
use HasFactory;
|
||||||
|
|
||||||
|
public function requestLog()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(RequestLog::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function requestLogMedicalPlans()
|
||||||
|
{
|
||||||
|
return $this->hasMany(RequestLogMedicalPlan::class);
|
||||||
|
}
|
||||||
|
}
|
||||||
16
app/Models/RequestLogMedicalPlan.php
Normal file
16
app/Models/RequestLogMedicalPlan.php
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class RequestLogMedicalPlan extends Model
|
||||||
|
{
|
||||||
|
use HasFactory;
|
||||||
|
|
||||||
|
public function requestLogDailyMonitoring()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(RequestLogDailyMonitoring::class);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -196,6 +196,26 @@ export default function Table<T>({
|
|||||||
/>
|
/>
|
||||||
</form>
|
</form>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
) : exportReport && exportReport.useExport && filterStatus === undefined ? (
|
||||||
|
<Grid item xs={12} lg={10} xl={10}>
|
||||||
|
<form onSubmit={searchs.handleSearchSubmit}>
|
||||||
|
<TextField
|
||||||
|
id="search-input"
|
||||||
|
variant="outlined"
|
||||||
|
onChange={(event) => searchs.setSearchText(event.target.value)}
|
||||||
|
value={searchs.searchText}
|
||||||
|
fullWidth
|
||||||
|
InputProps={{
|
||||||
|
startAdornment: (
|
||||||
|
<InputAdornment position="start">
|
||||||
|
<SearchIcon />
|
||||||
|
</InputAdornment>
|
||||||
|
),
|
||||||
|
}}
|
||||||
|
placeholder="Search Name or Member ID... "
|
||||||
|
/>
|
||||||
|
</form>
|
||||||
|
</Grid>
|
||||||
) : (
|
) : (
|
||||||
<Grid item xs={12} lg={searchs.fullWidth ? 12 : 6} xl={searchs.fullWidth ? 12 : 6}>
|
<Grid item xs={12} lg={searchs.fullWidth ? 12 : 6} xl={searchs.fullWidth ? 12 : 6}>
|
||||||
<form onSubmit={searchs.handleSearchSubmit}>
|
<form onSubmit={searchs.handleSearchSubmit}>
|
||||||
|
|||||||
@@ -32,16 +32,18 @@ export default function NavSectionVertical({
|
|||||||
<Box {...other}>
|
<Box {...other}>
|
||||||
{navConfig.map((group, index) => (
|
{navConfig.map((group, index) => (
|
||||||
<List key={index} disablePadding sx={{ px: 2 }}>
|
<List key={index} disablePadding sx={{ px: 2 }}>
|
||||||
<ListSubheaderStyle
|
{group.subheader && (
|
||||||
key={index}
|
<ListSubheaderStyle
|
||||||
sx={{
|
key={index}
|
||||||
...(isCollapse && {
|
sx={{
|
||||||
opacity: 0,
|
...(isCollapse && {
|
||||||
}),
|
opacity: 0,
|
||||||
}}
|
}),
|
||||||
>
|
}}
|
||||||
{group.subheader}
|
>
|
||||||
</ListSubheaderStyle>
|
{group.subheader}
|
||||||
|
</ListSubheaderStyle>
|
||||||
|
)}
|
||||||
|
|
||||||
{group.items.map((list) => (
|
{group.items.map((list) => (
|
||||||
<NavListRoot key={list.title} list={list} isCollapse={isCollapse} />
|
<NavListRoot key={list.title} list={list} isCollapse={isCollapse} />
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ const navConfig = [
|
|||||||
items: [{ title: 'Dashboard', path: '/dashboard' }],
|
items: [{ title: 'Dashboard', path: '/dashboard' }],
|
||||||
},
|
},
|
||||||
|
|
||||||
// Corporate
|
// Corporate
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
{
|
{
|
||||||
subheader: 'Corporate',
|
subheader: 'Corporate',
|
||||||
@@ -15,21 +15,19 @@ const navConfig = [
|
|||||||
{
|
{
|
||||||
title: 'Corporate',
|
title: 'Corporate',
|
||||||
path: '/corporate',
|
path: '/corporate',
|
||||||
// icon: ICONS.default,
|
},
|
||||||
|
{
|
||||||
|
title: 'Employee Data',
|
||||||
|
path: '/employee-data',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
// Alarm Center
|
// Alarm Center
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
{
|
{
|
||||||
subheader: 'Case Management',
|
subheader: 'Case Management',
|
||||||
items: [
|
items: [
|
||||||
{
|
|
||||||
title: 'Employee Data',
|
|
||||||
path: '/employee-data',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: 'Alarm Center',
|
title: 'Alarm Center',
|
||||||
path: '/alarm-center',
|
path: '/alarm-center',
|
||||||
@@ -45,7 +43,6 @@ const navConfig = [
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
// User Management
|
// User Management
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
// {
|
// {
|
||||||
|
|||||||
@@ -1,105 +1,15 @@
|
|||||||
/* ---------------------------------- react --------------------------------- */
|
|
||||||
import { useState, SyntheticEvent } from 'react';
|
|
||||||
/* ---------------------------------- @mui ---------------------------------- */
|
/* ---------------------------------- @mui ---------------------------------- */
|
||||||
import { Box, Tabs, Tab, Container, Grid, Card } from '@mui/material';
|
import { Container, Grid } from '@mui/material';
|
||||||
import { styled } from '@mui/material/styles';
|
|
||||||
/* ------------------------------- components ------------------------------- */
|
/* ------------------------------- components ------------------------------- */
|
||||||
import Page from '../../components/Page';
|
import Page from '../../components/Page';
|
||||||
/* ---------------------------------- hooks --------------------------------- */
|
/* ---------------------------------- hooks --------------------------------- */
|
||||||
import useSettings from '../../hooks/useSettings';
|
import useSettings from '../../hooks/useSettings';
|
||||||
import List from './List';
|
import List from './List';
|
||||||
import ServiceMonitoring from './ServiceMonitoring';
|
|
||||||
import UserProfile from './UserProfile';
|
|
||||||
import HeaderBreadcrumbs from '../../components/HeaderBreadcrumbs';
|
import HeaderBreadcrumbs from '../../components/HeaderBreadcrumbs';
|
||||||
|
|
||||||
/* ------------------------------ tabs setting ------------------------------ */
|
|
||||||
|
|
||||||
/* ---------------------------------- types --------------------------------- */
|
|
||||||
|
|
||||||
interface TabPanelProps {
|
|
||||||
children?: React.ReactNode;
|
|
||||||
index: number;
|
|
||||||
value: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface StyledTabsProps {
|
|
||||||
children?: React.ReactNode;
|
|
||||||
value: number;
|
|
||||||
onChange: (event: React.SyntheticEvent, newValue: number) => void;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface StyledTabProps {
|
|
||||||
label: string;
|
|
||||||
icon?: string | React.ReactElement;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -------------------------------- tab style ------------------------------- */
|
|
||||||
|
|
||||||
function TabPanel(props: TabPanelProps) {
|
|
||||||
const { children, value, index, ...other } = props;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div
|
|
||||||
role="tabpanel"
|
|
||||||
hidden={value !== index}
|
|
||||||
id={`simple-tabpanel-${index}`}
|
|
||||||
aria-labelledby={`simple-tab-${index}`}
|
|
||||||
{...other}
|
|
||||||
>
|
|
||||||
{value === index && <Box>{children}</Box>}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function a11yProps(index: number) {
|
|
||||||
return {
|
|
||||||
id: `simple-tab-${index}`,
|
|
||||||
'aria-controls': `simple-tabpanel-${index}`,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
const StyledTabs = styled((props: StyledTabsProps) => <Tabs {...props} />)({
|
|
||||||
backgroundColor: '#F4F6F8',
|
|
||||||
padding: '0 24px',
|
|
||||||
'& .MuiTabs-indicator': {
|
|
||||||
display: 'flex',
|
|
||||||
justifyContent: 'space-between',
|
|
||||||
backgroundColor: 'transparent',
|
|
||||||
},
|
|
||||||
'& .MuiTabs-indicatorSpan': {
|
|
||||||
maxWidth: 40,
|
|
||||||
backgroundColor: '#635ee7',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const StyledTab = styled((props: StyledTabProps) => <Tab disableRipple {...props} />)(
|
|
||||||
({ theme }) => ({
|
|
||||||
textTransform: 'none',
|
|
||||||
fontWeight: 600,
|
|
||||||
color: theme.palette.grey[600],
|
|
||||||
marginRight: '5rem',
|
|
||||||
'&.Mui-selected': {
|
|
||||||
color: '#212B36',
|
|
||||||
borderBottom: '2px solid ' + theme.palette.primary.main,
|
|
||||||
},
|
|
||||||
'&:hover': {
|
|
||||||
color: '#212B36',
|
|
||||||
opacity: 1,
|
|
||||||
borderBottom: '2px solid ' + theme.palette.primary.main,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
/* -------------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
export default function Drugs() {
|
export default function Drugs() {
|
||||||
const { themeStretch } = useSettings();
|
const { themeStretch } = useSettings();
|
||||||
|
|
||||||
const [value, setValue] = useState(0);
|
|
||||||
const handleChange = (event: SyntheticEvent, newValue: number) => {
|
|
||||||
setValue(newValue);
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Page title="Alarm Center">
|
<Page title="Alarm Center">
|
||||||
<Container maxWidth={themeStretch ? false : 'xl'}>
|
<Container maxWidth={themeStretch ? false : 'xl'}>
|
||||||
@@ -107,29 +17,12 @@ export default function Drugs() {
|
|||||||
heading={'Alarm Center'}
|
heading={'Alarm Center'}
|
||||||
links={[
|
links={[
|
||||||
{ name: 'Case Management', href: '/alarm-center' },
|
{ name: 'Case Management', href: '/alarm-center' },
|
||||||
{ name: 'Alarm Center', href: '/alarm-center'}
|
{ name: 'Alarm Center', href: '/alarm-center' },
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
<Grid container>
|
<Grid container>
|
||||||
<Grid item xs={12} lg={12} md={12}>
|
<Grid item xs={12} lg={12} md={12}>
|
||||||
{/* <Card> */}
|
<List />
|
||||||
{/* <Box sx={{ borderBottom: 1, borderColor: 'divider' }}>
|
|
||||||
<StyledTabs value={value} onChange={handleChange} aria-label="basic tabs example">
|
|
||||||
<StyledTab label="All Data" {...a11yProps(0)} />
|
|
||||||
<StyledTab label="Ongoing" {...a11yProps(1)} />
|
|
||||||
<StyledTab label="Done" {...a11yProps(2)} />
|
|
||||||
</StyledTabs>
|
|
||||||
</Box> */}
|
|
||||||
<TabPanel value={value} index={0}>
|
|
||||||
<List />
|
|
||||||
</TabPanel>
|
|
||||||
{/* <TabPanel value={value} index={1}>
|
|
||||||
<ServiceMonitoring/>
|
|
||||||
</TabPanel>
|
|
||||||
<TabPanel value={value} index={2}>
|
|
||||||
<UserProfile />
|
|
||||||
</TabPanel> */}
|
|
||||||
{/* </Card> */}
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Container>
|
</Container>
|
||||||
|
|||||||
@@ -1,149 +1,23 @@
|
|||||||
/* ---------------------------------- @mui ---------------------------------- */
|
/* ---------------------------------- @mui ---------------------------------- */
|
||||||
import {
|
import { SelectChangeEvent, MenuItem } from '@mui/material';
|
||||||
Paper,
|
|
||||||
Table,
|
|
||||||
TableBody,
|
|
||||||
TableCell,
|
|
||||||
TableContainer,
|
|
||||||
TableHead,
|
|
||||||
TableRow,
|
|
||||||
TextField,
|
|
||||||
Stack,
|
|
||||||
Button,
|
|
||||||
TableSortLabel,
|
|
||||||
Box,
|
|
||||||
SelectChangeEvent,
|
|
||||||
Typography,
|
|
||||||
MenuItem
|
|
||||||
} from '@mui/material';
|
|
||||||
import { visuallyHidden } from '@mui/utils';
|
|
||||||
/* ---------------------------------- axios --------------------------------- */
|
/* ---------------------------------- axios --------------------------------- */
|
||||||
// import axios from 'axios';
|
|
||||||
import axios from '../../utils/axios';
|
import axios from '../../utils/axios';
|
||||||
/* ---------------------------------- react --------------------------------- */
|
/* ---------------------------------- react --------------------------------- */
|
||||||
import { useContext, useEffect, useState } from 'react';
|
import { useContext, useEffect, useState } from 'react';
|
||||||
|
|
||||||
/* -------------------------------- component ------------------------------- */
|
/* -------------------------------- component ------------------------------- */
|
||||||
import Iconify from '../../components/Iconify';
|
|
||||||
import BaseTablePagination from '../../components/BaseTablePagination';
|
|
||||||
import TableComponent from '../../components/Table';
|
import TableComponent from '../../components/Table';
|
||||||
|
|
||||||
/* ---------------------------------- hooks --------------------------------- */
|
|
||||||
import useMap from '../../hooks/useMap';
|
|
||||||
/* ---------------------------------- theme --------------------------------- */
|
/* ---------------------------------- theme --------------------------------- */
|
||||||
import palette from '../../theme/palette';
|
|
||||||
import { UserCurrentCorporateContext } from '../../contexts/UserCurrentCorporate';
|
import { UserCurrentCorporateContext } from '../../contexts/UserCurrentCorporate';
|
||||||
import { HeadCell, Order, PaginationTableProps } from '../../@types/table';
|
import { HeadCell, Order, PaginationTableProps } from '../../@types/table';
|
||||||
import { useSearchParams, useNavigate, Link } from 'react-router-dom';
|
import { useSearchParams, useNavigate } from 'react-router-dom';
|
||||||
import { fDateSuffix } from '../../utils/formatTime';
|
import { fDateSuffix } from '../../utils/formatTime';
|
||||||
import TableMoreMenu from '../../components/table/TableMoreMenu';
|
import TableMoreMenu from '../../components/table/TableMoreMenu';
|
||||||
import VisibilityOutlinedIcon from '@mui/icons-material/VisibilityOutlined';
|
import VisibilityOutlinedIcon from '@mui/icons-material/VisibilityOutlined';
|
||||||
import { enqueueSnackbar } from 'notistack';
|
import { enqueueSnackbar } from 'notistack';
|
||||||
|
|
||||||
import DetailDataMember from './ListMember';
|
|
||||||
import Label from '../../components/Label';
|
import Label from '../../components/Label';
|
||||||
|
import { Stack } from '@mui/material';
|
||||||
|
|
||||||
/* ---------------------------------- types --------------------------------- */
|
|
||||||
|
|
||||||
// type PaginationTableProps = {
|
|
||||||
// current_page: number;
|
|
||||||
// from: number;
|
|
||||||
// last_page: number;
|
|
||||||
// links: [];
|
|
||||||
// path: string;
|
|
||||||
// per_page: number;
|
|
||||||
// to: number;
|
|
||||||
// total: number;
|
|
||||||
// };
|
|
||||||
|
|
||||||
// type DataTableProps = {
|
|
||||||
// fullName: string;
|
|
||||||
// memberId: string;
|
|
||||||
// service: string;
|
|
||||||
// start_date: string;
|
|
||||||
// end_date: string;
|
|
||||||
// status: boolean | number;
|
|
||||||
// };
|
|
||||||
|
|
||||||
// /* -------------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
// /* -------------------------- enchanced table head -------------------------- */
|
|
||||||
|
|
||||||
// type Order = 'asc' | 'desc';
|
|
||||||
|
|
||||||
// interface HeadCell {
|
|
||||||
// id: string;
|
|
||||||
// label: string;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// const headCells: readonly HeadCell[] = [
|
|
||||||
// {
|
|
||||||
// id: 'name',
|
|
||||||
// label: 'Name',
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// id: 'member_id',
|
|
||||||
// label: 'Member ID',
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// id: 'service',
|
|
||||||
// label: 'Service',
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// id: 'start_date',
|
|
||||||
// label: 'Start Date',
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// id: 'end_date',
|
|
||||||
// label: 'End Date',
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// id: 'status',
|
|
||||||
// label: 'Status',
|
|
||||||
// },
|
|
||||||
// ];
|
|
||||||
|
|
||||||
// interface EnhancedTableProps {
|
|
||||||
// onRequestSort: (event: React.MouseEvent<unknown>, property: string) => void;
|
|
||||||
// order: Order;
|
|
||||||
// orderBy: string;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// function EnhancedTableHead(props: EnhancedTableProps) {
|
|
||||||
// const { order, orderBy, onRequestSort } = props;
|
|
||||||
// const createSortHandler = (property: string) => (event: React.MouseEvent<unknown>) => {
|
|
||||||
// onRequestSort(event, property);
|
|
||||||
// };
|
|
||||||
|
|
||||||
// return (
|
|
||||||
// <TableHead>
|
|
||||||
// <TableRow>
|
|
||||||
// <TableCell align="center">No</TableCell>
|
|
||||||
// {headCells.map((headCell) => (
|
|
||||||
// <TableCell
|
|
||||||
// key={headCell.id}
|
|
||||||
// sortDirection={orderBy === headCell.id ? order : false}
|
|
||||||
// align="center"
|
|
||||||
// >
|
|
||||||
// <TableSortLabel
|
|
||||||
// active={orderBy === headCell.id}
|
|
||||||
// direction={orderBy === headCell.id ? order : 'asc'}
|
|
||||||
// onClick={createSortHandler(headCell.id)}
|
|
||||||
// >
|
|
||||||
// {headCell.label}
|
|
||||||
// {orderBy === headCell.id ? (
|
|
||||||
// <Box component="span" sx={visuallyHidden}>
|
|
||||||
// {order === 'desc' ? 'sorted descending' : 'sorted ascending'}
|
|
||||||
// </Box>
|
|
||||||
// ) : null}
|
|
||||||
// </TableSortLabel>
|
|
||||||
// </TableCell>
|
|
||||||
// ))}
|
|
||||||
// </TableRow>
|
|
||||||
// </TableHead>
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
|
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
|
|
||||||
@@ -237,7 +111,7 @@ export default function List() {
|
|||||||
handleSearchSubmit: handleSearchSubmit,
|
handleSearchSubmit: handleSearchSubmit,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ------------------------------ handle filter ----------------------------- */
|
/* ------------------------------ handle filter ----------------------------- */
|
||||||
const [statusValue, setStatusValue] = useState('all');
|
const [statusValue, setStatusValue] = useState('all');
|
||||||
const [filterData, setStatusData] = useState([]);
|
const [filterData, setStatusData] = useState([]);
|
||||||
|
|
||||||
@@ -263,7 +137,7 @@ export default function List() {
|
|||||||
config: {
|
config: {
|
||||||
label: 'Status',
|
label: 'Status',
|
||||||
statusValue: statusValue,
|
statusValue: statusValue,
|
||||||
filterData: filterData,
|
statusData: filterData,
|
||||||
handleStatusChange: handleStatusChanges,
|
handleStatusChange: handleStatusChanges,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -273,13 +147,16 @@ export default function List() {
|
|||||||
|
|
||||||
const handleStartDateChanges = async (event: React.FormEvent<HTMLFormElement>) => {
|
const handleStartDateChanges = async (event: React.FormEvent<HTMLFormElement>) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
console.log(startDateValue)
|
console.log(startDateValue);
|
||||||
if (startDateValue === '') {
|
if (startDateValue === '') {
|
||||||
searchParams.delete('start_date');
|
searchParams.delete('start_date');
|
||||||
const params = Object.fromEntries([...searchParams.entries()]);
|
const params = Object.fromEntries([...searchParams.entries()]);
|
||||||
setAppliedParams(params);
|
setAppliedParams(params);
|
||||||
} else {
|
} else {
|
||||||
const params = Object.fromEntries([...searchParams.entries(), ['start_date', startDateValue]]);
|
const params = Object.fromEntries([
|
||||||
|
...searchParams.entries(),
|
||||||
|
['start_date', startDateValue],
|
||||||
|
]);
|
||||||
setAppliedParams(params);
|
setAppliedParams(params);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -314,7 +191,7 @@ export default function List() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* -------------------------------- handle export --------------------------- */
|
/* -------------------------------- handle export --------------------------- */
|
||||||
const handleExportReport = async () => {
|
const handleExportReport = async () => {
|
||||||
var filter = Object.fromEntries([...searchParams.entries()]);
|
var filter = Object.fromEntries([...searchParams.entries()]);
|
||||||
|
|
||||||
await axios
|
await axios
|
||||||
@@ -339,8 +216,8 @@ export default function List() {
|
|||||||
startDate: startDateValue,
|
startDate: startDateValue,
|
||||||
endDate: endDateValue,
|
endDate: endDateValue,
|
||||||
status: statusValue,
|
status: statusValue,
|
||||||
handleExportReport: handleExportReport
|
handleExportReport: handleExportReport,
|
||||||
}
|
};
|
||||||
|
|
||||||
/* -------------------------------- headCell -------------------------------- */
|
/* -------------------------------- headCell -------------------------------- */
|
||||||
const headCells: HeadCell<never>[] = [
|
const headCells: HeadCell<never>[] = [
|
||||||
@@ -356,7 +233,7 @@ export default function List() {
|
|||||||
label: 'Name',
|
label: 'Name',
|
||||||
isSort: true,
|
isSort: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
id: 'start_date',
|
id: 'start_date',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
@@ -400,72 +277,34 @@ export default function List() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const status = [
|
const status = [
|
||||||
{"id": 1, "name": "Done" },
|
{ id: 1, name: 'Done' },
|
||||||
{"id": 0, "name": "On Going" },
|
{ id: 0, name: 'On Going' },
|
||||||
|
];
|
||||||
]
|
setStatusData(status);
|
||||||
setStatusData(status)
|
|
||||||
|
|
||||||
setData(
|
setData(
|
||||||
response.data.data.map((obj: any) => {
|
response.data.data.map((obj: any) => ({
|
||||||
return {
|
...obj,
|
||||||
...obj,
|
start_date: <Label>{fDateSuffix(obj.start_date)}</Label>,
|
||||||
// memberId:
|
end_date: <Label> {fDateSuffix(obj.end_date)}</Label>,
|
||||||
// // <Link to={'/user-profile/'+obj.personId} >
|
action: (
|
||||||
// <Button
|
<TableMoreMenu
|
||||||
// onClick={() => navigate ('/user-profile/'+obj.personId)}
|
actions={
|
||||||
// >{obj.memberId}</Button>
|
|
||||||
// ,
|
|
||||||
start_date:
|
|
||||||
<Label>{ fDateSuffix(obj.start_date) }</Label>
|
|
||||||
,
|
|
||||||
end_date:
|
|
||||||
<Label> { fDateSuffix(obj.end_date) }</Label>
|
|
||||||
,
|
|
||||||
// status:
|
|
||||||
// obj.status === 1 ? (
|
|
||||||
// <Typography
|
|
||||||
// sx={{
|
|
||||||
// background: 'rgba(84, 214, 44, 0.16)',
|
|
||||||
// color: '#229A16',
|
|
||||||
// paddingX: 1.5,
|
|
||||||
// paddingY: 1,
|
|
||||||
// borderRadius: 3,
|
|
||||||
// }} variant='overline'
|
|
||||||
// >
|
|
||||||
// Done
|
|
||||||
// </Typography>
|
|
||||||
// ) : (
|
|
||||||
// <Typography
|
|
||||||
// sx={{
|
|
||||||
// background: 'rgba(255, 193, 7, 0.16)',
|
|
||||||
// color: '#BF6919',
|
|
||||||
// paddingX: 1.5,
|
|
||||||
// paddingY: 1,
|
|
||||||
// borderRadius: 3,
|
|
||||||
// }} variant='overline'
|
|
||||||
// >
|
|
||||||
// Ongoing
|
|
||||||
// </Typography>
|
|
||||||
// ),
|
|
||||||
action:
|
|
||||||
<TableMoreMenu actions={
|
|
||||||
<>
|
<>
|
||||||
<MenuItem onClick={() => navigate('member/'+obj.id )}>
|
<MenuItem onClick={() => navigate('member/' + obj.id)}>
|
||||||
<VisibilityOutlinedIcon />
|
<VisibilityOutlinedIcon />
|
||||||
View
|
View
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
</>
|
</>
|
||||||
} />
|
}
|
||||||
};
|
/>
|
||||||
})
|
),
|
||||||
|
}))
|
||||||
);
|
);
|
||||||
|
|
||||||
setPaginationTable(response.data);
|
setPaginationTable(response.data);
|
||||||
setRowsPerPage(response.data.per_page);
|
setRowsPerPage(response.data.per_page);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (searchParams.get('page')) {
|
if (searchParams.get('page')) {
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
const currentPage = parseInt(searchParams.get('page')) - 1;
|
const currentPage = parseInt(searchParams.get('page')) - 1;
|
||||||
@@ -488,7 +327,6 @@ export default function List() {
|
|||||||
loadings={loadings}
|
loadings={loadings}
|
||||||
params={params}
|
params={params}
|
||||||
searchs={searchs}
|
searchs={searchs}
|
||||||
// filters={filters}
|
|
||||||
filterStatus={filterStatus}
|
filterStatus={filterStatus}
|
||||||
filterStartDate={filterStartDate}
|
filterStartDate={filterStartDate}
|
||||||
filterEndDate={filterEndDate}
|
filterEndDate={filterEndDate}
|
||||||
|
|||||||
@@ -1,23 +1,5 @@
|
|||||||
/* ---------------------------------- @mui ---------------------------------- */
|
/* ---------------------------------- @mui ---------------------------------- */
|
||||||
import {
|
import { Stack, Typography, MenuItem, Grid } from '@mui/material';
|
||||||
Paper,
|
|
||||||
Table,
|
|
||||||
TableBody,
|
|
||||||
TableCell,
|
|
||||||
TableContainer,
|
|
||||||
TableHead,
|
|
||||||
TableRow,
|
|
||||||
TextField,
|
|
||||||
Stack,
|
|
||||||
Button,
|
|
||||||
TableSortLabel,
|
|
||||||
Box,
|
|
||||||
SelectChangeEvent,
|
|
||||||
Typography,
|
|
||||||
MenuItem,
|
|
||||||
Grid
|
|
||||||
} from '@mui/material';
|
|
||||||
import { visuallyHidden } from '@mui/utils';
|
|
||||||
/* ---------------------------------- axios --------------------------------- */
|
/* ---------------------------------- axios --------------------------------- */
|
||||||
// import axios from 'axios';
|
// import axios from 'axios';
|
||||||
import axios from '../../utils/axios';
|
import axios from '../../utils/axios';
|
||||||
@@ -25,137 +7,27 @@ import axios from '../../utils/axios';
|
|||||||
import { useContext, useEffect, useState } from 'react';
|
import { useContext, useEffect, useState } from 'react';
|
||||||
|
|
||||||
/* -------------------------------- component ------------------------------- */
|
/* -------------------------------- component ------------------------------- */
|
||||||
import Iconify from '../../components/Iconify';
|
|
||||||
import BaseTablePagination from '../../components/BaseTablePagination';
|
|
||||||
import TableComponent from '../../components/Table';
|
import TableComponent from '../../components/Table';
|
||||||
import ArrowBackIosIcon from '@mui/icons-material/ArrowBackIos';
|
import ArrowBackIosIcon from '@mui/icons-material/ArrowBackIos';
|
||||||
|
|
||||||
/* ---------------------------------- hooks --------------------------------- */
|
|
||||||
import useMap from '../../hooks/useMap';
|
|
||||||
/* ---------------------------------- theme --------------------------------- */
|
/* ---------------------------------- theme --------------------------------- */
|
||||||
import palette from '../../theme/palette';
|
|
||||||
import { UserCurrentCorporateContext } from '../../contexts/UserCurrentCorporate';
|
import { UserCurrentCorporateContext } from '../../contexts/UserCurrentCorporate';
|
||||||
import { HeadCell, Order, PaginationTableProps } from '../../@types/table';
|
import { HeadCell, Order, PaginationTableProps } from '../../@types/table';
|
||||||
import { useSearchParams, useNavigate, Link, useParams } from 'react-router-dom';
|
import { useSearchParams, useNavigate, useParams } from 'react-router-dom';
|
||||||
import { fDateSuffix, fPostFormat } from '../../utils/formatTime';
|
import { fDateSuffix } from '../../utils/formatTime';
|
||||||
import TableMoreMenu from '../../components/table/TableMoreMenu';
|
import TableMoreMenu from '../../components/table/TableMoreMenu';
|
||||||
import VisibilityOutlinedIcon from '@mui/icons-material/VisibilityOutlined';
|
import VisibilityOutlinedIcon from '@mui/icons-material/VisibilityOutlined';
|
||||||
import Label from '../../components/Label';
|
import Label from '../../components/Label';
|
||||||
|
|
||||||
|
|
||||||
/* ---------------------------------- types --------------------------------- */
|
|
||||||
|
|
||||||
type DataList = {
|
|
||||||
name: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
// type PaginationTableProps = {
|
|
||||||
// current_page: number;
|
|
||||||
// from: number;
|
|
||||||
// last_page: number;
|
|
||||||
// links: [];
|
|
||||||
// path: string;
|
|
||||||
// per_page: number;
|
|
||||||
// to: number;
|
|
||||||
// total: number;
|
|
||||||
// };
|
|
||||||
|
|
||||||
// type DataTableProps = {
|
|
||||||
// fullName: string;
|
|
||||||
// memberId: string;
|
|
||||||
// service: string;
|
|
||||||
// start_date: string;
|
|
||||||
// end_date: string;
|
|
||||||
// status: boolean | number;
|
|
||||||
// };
|
|
||||||
|
|
||||||
// /* -------------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
// /* -------------------------- enchanced table head -------------------------- */
|
|
||||||
|
|
||||||
// type Order = 'asc' | 'desc';
|
|
||||||
|
|
||||||
// interface HeadCell {
|
|
||||||
// id: string;
|
|
||||||
// label: string;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// const headCells: readonly HeadCell[] = [
|
|
||||||
// {
|
|
||||||
// id: 'name',
|
|
||||||
// label: 'Name',
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// id: 'member_id',
|
|
||||||
// label: 'Member ID',
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// id: 'service',
|
|
||||||
// label: 'Service',
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// id: 'start_date',
|
|
||||||
// label: 'Start Date',
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// id: 'end_date',
|
|
||||||
// label: 'End Date',
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// id: 'status',
|
|
||||||
// label: 'Status',
|
|
||||||
// },
|
|
||||||
// ];
|
|
||||||
|
|
||||||
// interface EnhancedTableProps {
|
|
||||||
// onRequestSort: (event: React.MouseEvent<unknown>, property: string) => void;
|
|
||||||
// order: Order;
|
|
||||||
// orderBy: string;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// function EnhancedTableHead(props: EnhancedTableProps) {
|
|
||||||
// const { order, orderBy, onRequestSort } = props;
|
|
||||||
// const createSortHandler = (property: string) => (event: React.MouseEvent<unknown>) => {
|
|
||||||
// onRequestSort(event, property);
|
|
||||||
// };
|
|
||||||
|
|
||||||
// return (
|
|
||||||
// <TableHead>
|
|
||||||
// <TableRow>
|
|
||||||
// <TableCell align="center">No</TableCell>
|
|
||||||
// {headCells.map((headCell) => (
|
|
||||||
// <TableCell
|
|
||||||
// key={headCell.id}
|
|
||||||
// sortDirection={orderBy === headCell.id ? order : false}
|
|
||||||
// align="center"
|
|
||||||
// >
|
|
||||||
// <TableSortLabel
|
|
||||||
// active={orderBy === headCell.id}
|
|
||||||
// direction={orderBy === headCell.id ? order : 'asc'}
|
|
||||||
// onClick={createSortHandler(headCell.id)}
|
|
||||||
// >
|
|
||||||
// {headCell.label}
|
|
||||||
// {orderBy === headCell.id ? (
|
|
||||||
// <Box component="span" sx={visuallyHidden}>
|
|
||||||
// {order === 'desc' ? 'sorted descending' : 'sorted ascending'}
|
|
||||||
// </Box>
|
|
||||||
// ) : null}
|
|
||||||
// </TableSortLabel>
|
|
||||||
// </TableCell>
|
|
||||||
// ))}
|
|
||||||
// </TableRow>
|
|
||||||
// </TableHead>
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
|
|
||||||
/* -------------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
export default function List() {
|
export default function List() {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
const { corporateValue } = useContext(UserCurrentCorporateContext);
|
const { corporateValue } = useContext(UserCurrentCorporateContext);
|
||||||
|
|
||||||
const [data, setData] = useState([]);
|
const [data, setData] = useState({
|
||||||
|
full_name: '',
|
||||||
|
paginations: [],
|
||||||
|
});
|
||||||
const { id } = useParams();
|
const { id } = useParams();
|
||||||
|
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
@@ -182,7 +54,7 @@ export default function List() {
|
|||||||
|
|
||||||
/* ------------------------------ handle order ------------------------------ */
|
/* ------------------------------ handle order ------------------------------ */
|
||||||
const [order, setOrder] = useState<Order>('asc');
|
const [order, setOrder] = useState<Order>('asc');
|
||||||
const [orderBy, setOrderBy] = useState('fullName');
|
const [orderBy, setOrderBy] = useState('admission_date');
|
||||||
|
|
||||||
const orders = {
|
const orders = {
|
||||||
order: order,
|
order: order,
|
||||||
@@ -215,141 +87,10 @@ export default function List() {
|
|||||||
paginationTable: paginationTable,
|
paginationTable: paginationTable,
|
||||||
setPaginationTable: setPaginationTable,
|
setPaginationTable: setPaginationTable,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
|
|
||||||
/* ------------------------------ handle search ----------------------------- */
|
|
||||||
const [searchText, setSearchText] = useState('');
|
|
||||||
const [name, setName] = useState('');
|
|
||||||
|
|
||||||
const handleSearchSubmit = async (event: React.FormEvent<HTMLFormElement>) => {
|
|
||||||
event.preventDefault();
|
|
||||||
|
|
||||||
if (searchText === '') {
|
|
||||||
searchParams.delete('search');
|
|
||||||
const params = Object.fromEntries([...searchParams.entries()]);
|
|
||||||
setAppliedParams(params);
|
|
||||||
} else {
|
|
||||||
const params = Object.fromEntries([...searchParams.entries(), ['search', searchText]]);
|
|
||||||
setAppliedParams(params);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const searchs = {
|
|
||||||
useSearchs: false,
|
|
||||||
searchText: searchText,
|
|
||||||
setSearchText: setSearchText,
|
|
||||||
handleSearchSubmit: handleSearchSubmit,
|
|
||||||
};
|
|
||||||
|
|
||||||
/* ------------------------------ handle filter ----------------------------- */
|
|
||||||
const [statusValue, setStatusValue] = useState('all');
|
|
||||||
const [filterData, setStatusData] = useState([]);
|
|
||||||
|
|
||||||
// handle status
|
|
||||||
const handleStatusChanges = (event: SelectChangeEvent) => {
|
|
||||||
setStatusValue(event.target.value as string);
|
|
||||||
|
|
||||||
if (event.target.value === 'all') {
|
|
||||||
searchParams.delete('status');
|
|
||||||
const params = Object.fromEntries([...searchParams.entries()]);
|
|
||||||
setAppliedParams(params);
|
|
||||||
} else {
|
|
||||||
const params = Object.fromEntries([
|
|
||||||
...searchParams.entries(),
|
|
||||||
['status', event.target.value as string],
|
|
||||||
]);
|
|
||||||
setAppliedParams(params);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const filterStatus = {
|
|
||||||
useFilter: false,
|
|
||||||
config: {
|
|
||||||
label: 'Status',
|
|
||||||
statusValue: statusValue,
|
|
||||||
filterData: filterData,
|
|
||||||
handleStatusChange: handleStatusChanges,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
// handle start date
|
|
||||||
const [startDateValue, setStartDateValue] = useState('');
|
|
||||||
|
|
||||||
const handleStartDateChanges = async (event: React.FormEvent<HTMLFormElement>) => {
|
|
||||||
event.preventDefault();
|
|
||||||
console.log(startDateValue)
|
|
||||||
if (startDateValue === '') {
|
|
||||||
searchParams.delete('start_date');
|
|
||||||
const params = Object.fromEntries([...searchParams.entries()]);
|
|
||||||
setAppliedParams(params);
|
|
||||||
} else {
|
|
||||||
const params = Object.fromEntries([...searchParams.entries(), ['start_date', startDateValue]]);
|
|
||||||
setAppliedParams(params);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const filterStartDate = {
|
|
||||||
useFilter: false,
|
|
||||||
startDate: startDateValue,
|
|
||||||
setStartDate: setStartDateValue,
|
|
||||||
handleStartDateChange: handleStartDateChanges,
|
|
||||||
};
|
|
||||||
|
|
||||||
// handle end date
|
|
||||||
const [endDateValue, setEndDateValue] = useState('');
|
|
||||||
|
|
||||||
const handleEndDateChanges = async (event: React.FormEvent<HTMLFormElement>) => {
|
|
||||||
event.preventDefault();
|
|
||||||
if (endDateValue === '') {
|
|
||||||
searchParams.delete('end_date');
|
|
||||||
const params = Object.fromEntries([...searchParams.entries()]);
|
|
||||||
setAppliedParams(params);
|
|
||||||
} else {
|
|
||||||
const params = Object.fromEntries([...searchParams.entries(), ['end_date', endDateValue]]);
|
|
||||||
setAppliedParams(params);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const filterEndDate = {
|
|
||||||
useFilter: false,
|
|
||||||
endDate: endDateValue,
|
|
||||||
setEndDate: setEndDateValue,
|
|
||||||
handleEndDateChange: handleEndDateChanges,
|
|
||||||
};
|
|
||||||
|
|
||||||
/* -------------------------------- handle export --------------------------- */
|
|
||||||
const handleExportReport = async () => {
|
|
||||||
var filter = Object.fromEntries([...searchParams.entries()]);
|
|
||||||
|
|
||||||
await axios
|
|
||||||
.get('claims/export', { params: filter })
|
|
||||||
.then((res) => {
|
|
||||||
enqueueSnackbar('Data berhasil di Export', {
|
|
||||||
variant: 'success',
|
|
||||||
anchorOrigin: { horizontal: 'right', vertical: 'top' },
|
|
||||||
});
|
|
||||||
|
|
||||||
document.location.href = res.data.data.file_url;
|
|
||||||
})
|
|
||||||
.catch((err) =>
|
|
||||||
enqueueSnackbar('Data Gagal di Export', {
|
|
||||||
variant: 'error',
|
|
||||||
anchorOrigin: { horizontal: 'right', vertical: 'top' },
|
|
||||||
})
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
const exportReport = {
|
|
||||||
useExport: false,
|
|
||||||
startDate: startDateValue,
|
|
||||||
endDate: endDateValue,
|
|
||||||
status: statusValue,
|
|
||||||
handleExportReport: handleExportReport
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -------------------------------- headCell -------------------------------- */
|
/* -------------------------------- headCell -------------------------------- */
|
||||||
const headCells: HeadCell<never>[] = [
|
const headCells: HeadCell<never>[] = [
|
||||||
{
|
{
|
||||||
id: 'admission_date',
|
id: 'admission_date',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
@@ -368,6 +109,12 @@ export default function List() {
|
|||||||
label: 'Code',
|
label: 'Code',
|
||||||
isSort: true,
|
isSort: true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: 'service_type',
|
||||||
|
align: 'center',
|
||||||
|
label: 'Service Type',
|
||||||
|
isSort: false,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
id: 'status',
|
id: 'status',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
@@ -398,59 +145,45 @@ export default function List() {
|
|||||||
params: { ...parameters },
|
params: { ...parameters },
|
||||||
});
|
});
|
||||||
|
|
||||||
const status = [
|
setSearchParams(parameters);
|
||||||
{"id": 1, "name": "Done" },
|
|
||||||
{"id": 0, "name": "On Going" },
|
|
||||||
|
|
||||||
]
|
setData({
|
||||||
setStatusData(status)
|
full_name: response.data.full_name,
|
||||||
const datatable = response.data.data;
|
paginations: response.data.paginations.data.map((obj: any) => ({
|
||||||
|
...obj,
|
||||||
// if (response.data.data.length > 0){
|
admission_date: obj.admission_date ? (
|
||||||
// setIsLoading(true);
|
<Label> {fDateSuffix(obj.admission_date)} </Label>
|
||||||
// } else {
|
) : (
|
||||||
// setIsLoading(false);
|
''
|
||||||
// }
|
),
|
||||||
|
discharge_date: obj.discharge_date ? (
|
||||||
const dataName = response.data.data[0].fullName
|
<Label> {fDateSuffix(obj.discharge_date)} </Label>
|
||||||
setName(dataName)
|
) : (
|
||||||
setData(
|
''
|
||||||
datatable.map((obj: any) => {
|
),
|
||||||
return {
|
status:
|
||||||
...obj,
|
obj.status === 'Done' ? (
|
||||||
admission_date:
|
<Label color="success">Done</Label>
|
||||||
<Label>{ fDateSuffix(obj.admission_date) }</Label>
|
) : (
|
||||||
,
|
<Label color="warning">Ongoing</Label>
|
||||||
discharge_date:
|
),
|
||||||
<Label>{ fDateSuffix(obj.discharge_date) }</Label>
|
action: (
|
||||||
,
|
<TableMoreMenu
|
||||||
status:
|
actions={
|
||||||
obj.status === 'Done' ? (
|
|
||||||
<Label color='success'>
|
|
||||||
Done
|
|
||||||
</Label>
|
|
||||||
) : (
|
|
||||||
<Label color='warning'>
|
|
||||||
Ongoing
|
|
||||||
</Label>
|
|
||||||
),
|
|
||||||
action:
|
|
||||||
<TableMoreMenu actions={
|
|
||||||
<>
|
<>
|
||||||
<MenuItem onClick={() => navigate('service-monitoring/'+obj.claim_id )}>
|
<MenuItem onClick={() => navigate('service-monitoring/' + obj.id)}>
|
||||||
<VisibilityOutlinedIcon />
|
<VisibilityOutlinedIcon />
|
||||||
View
|
View
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
</>
|
</>
|
||||||
} />
|
}
|
||||||
};
|
/>
|
||||||
})
|
),
|
||||||
);
|
})),
|
||||||
|
});
|
||||||
|
|
||||||
setPaginationTable(response.data);
|
setPaginationTable(response.data.paginations);
|
||||||
setRowsPerPage(response.data.per_page);
|
setRowsPerPage(response.data.paginations.per_page);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (searchParams.get('page')) {
|
if (searchParams.get('page')) {
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
@@ -463,17 +196,14 @@ export default function List() {
|
|||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
})();
|
})();
|
||||||
}, [appliedParams, searchParams, order, orderBy, setSearchParams, corporateValue]);
|
}, [appliedParams, searchParams, order, orderBy, setSearchParams, corporateValue]);
|
||||||
console.log(loadings);
|
|
||||||
return (
|
return (
|
||||||
<Grid container spacing={8}>
|
<Grid container spacing={8} padding={3}>
|
||||||
<Grid item xs={12} paddingX="24px" >
|
<Grid item xs={12}>
|
||||||
<Stack direction="row" alignItems="center">
|
<Stack direction="row" alignItems="center" gap={3}>
|
||||||
<ArrowBackIosIcon
|
<ArrowBackIosIcon onClick={() => navigate(`/alarm-center`)} sx={{ cursor: 'pointer' }} />
|
||||||
onClick={() => navigate(`/alarm-center`)}
|
|
||||||
sx={{ cursor: 'pointer' }}
|
|
||||||
/>
|
|
||||||
<Typography variant="h5" sx={{ flexGrow: 1 }}>
|
<Typography variant="h5" sx={{ flexGrow: 1 }}>
|
||||||
{name}
|
{data.full_name}
|
||||||
</Typography>
|
</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Grid>
|
</Grid>
|
||||||
@@ -481,24 +211,14 @@ export default function List() {
|
|||||||
<Stack>
|
<Stack>
|
||||||
<TableComponent
|
<TableComponent
|
||||||
headCells={headCells}
|
headCells={headCells}
|
||||||
rows={data}
|
rows={data.paginations}
|
||||||
orders={orders}
|
orders={orders}
|
||||||
paginations={paginations}
|
paginations={paginations}
|
||||||
loadings={loadings}
|
loadings={loadings}
|
||||||
params={params}
|
params={params}
|
||||||
searchs={searchs}
|
|
||||||
// filters={filters}
|
|
||||||
filterStatus={filterStatus}
|
|
||||||
filterStartDate={filterStartDate}
|
|
||||||
filterEndDate={filterEndDate}
|
|
||||||
exportReport={exportReport}
|
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -39,15 +39,12 @@ export default function UserProfile() {
|
|||||||
});
|
});
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
// console.log('data', data);
|
// console.log('data', data);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Page title="Profile">
|
<Page title="Profile">
|
||||||
<Container maxWidth={themeStretch ? false : 'xl'}>
|
<Container maxWidth={themeStretch ? false : 'xl'}>
|
||||||
<Stack direction="row" alignItems="center" sx={{ marginBottom: 2 }}>
|
<Stack direction="row" alignItems="center" sx={{ marginBottom: 2 }}>
|
||||||
{/* <IconButton sx={{ marginRight: '10px', color: '#424242' }} onClick={() => navigate()}>
|
|
||||||
<Iconify icon="heroicons-outline:arrow-narrow-left" />
|
|
||||||
</IconButton> */}
|
|
||||||
<ButtonBack />
|
<ButtonBack />
|
||||||
<Typography variant="h5">Profil Peserta</Typography>
|
<Typography variant="h5">Profil Peserta</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
@@ -74,7 +71,7 @@ export default function UserProfile() {
|
|||||||
</Grid>
|
</Grid>
|
||||||
{/* Item 2 */}
|
{/* Item 2 */}
|
||||||
<Grid item xs={12}>
|
<Grid item xs={12}>
|
||||||
<CardClaimHistory data={data}/>
|
<CardClaimHistory data={data} />
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@@ -121,14 +121,14 @@ export default function ServiceMonitoring() {
|
|||||||
const { corporateValue } = useContext(UserCurrentCorporateContext);
|
const { corporateValue } = useContext(UserCurrentCorporateContext);
|
||||||
const { id } = useParams();
|
const { id } = useParams();
|
||||||
const claimId = '2';
|
const claimId = '2';
|
||||||
// console.log('id', id);
|
// console.log('id', id);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
console.log('fetching data...');
|
console.log('fetching data...');
|
||||||
axios
|
axios
|
||||||
.get('/data/' + id)
|
.get('/data/' + id)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
// console.log('data fetched...', response.data);
|
// console.log('data fetched...', response.data);
|
||||||
setData(response.data);
|
setData(response.data);
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
@@ -138,7 +138,7 @@ export default function ServiceMonitoring() {
|
|||||||
axios
|
axios
|
||||||
.get('/corporate-manage/' + corporateValue)
|
.get('/corporate-manage/' + corporateValue)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
// console.log('corporate fetched...', response.data);
|
// console.log('corporate fetched...', response.data);
|
||||||
setCorporate(response.data);
|
setCorporate(response.data);
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
@@ -146,15 +146,15 @@ export default function ServiceMonitoring() {
|
|||||||
});
|
});
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
// console.log('Data:', data);
|
// console.log('Data:', data);
|
||||||
const [encounterData, setEncounterData] = useState({});
|
const [encounterData, setEncounterData] = useState({});
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// console.log('fetching encounter data...');
|
// console.log('fetching encounter data...');
|
||||||
axios
|
axios
|
||||||
.get('/claims/${claim_id}/encounters')
|
.get('/claims/${claim_id}/encounters')
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
// console.log('encounter data fetched...', response.data);
|
// console.log('encounter data fetched...', response.data);
|
||||||
setEncounterData(response.data);
|
setEncounterData(response.data);
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
|
|||||||
@@ -89,8 +89,8 @@ export default function Router() {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/employee-data/user-profile/:id',
|
path: '/employee-data/user-profile/:id',
|
||||||
element: <EmployeeDataUserProfile/>,
|
element: <EmployeeDataUserProfile />,
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -112,13 +112,12 @@ export default function Router() {
|
|||||||
element: <AlarmCenterMemberPerList />,
|
element: <AlarmCenterMemberPerList />,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'member/:id/service-monitoring/:id',
|
path: 'member/:memberId/service-monitoring/:requestLogId',
|
||||||
element: <AlarmCenterServiceMonitoring />,
|
element: <AlarmCenterServiceMonitoring />,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
path: '/claim-submit',
|
path: '/claim-submit',
|
||||||
element: (
|
element: (
|
||||||
@@ -135,7 +134,7 @@ export default function Router() {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'dialog-detail',
|
path: 'dialog-detail',
|
||||||
element: <DialogDetailClaim/>
|
element: <DialogDetailClaim />,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -155,7 +154,7 @@ export default function Router() {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'dialog-detail',
|
path: 'dialog-detail',
|
||||||
element: <DialogDetailClaim/>
|
element: <DialogDetailClaim />,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -180,7 +179,7 @@ export default function Router() {
|
|||||||
{
|
{
|
||||||
path: '/claim-report/detail-history/:id',
|
path: '/claim-report/detail-history/:id',
|
||||||
element: <DetailHitoryClaimReport />,
|
element: <DetailHitoryClaimReport />,
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -262,9 +261,9 @@ const AlarmCenterUserProfile = Loadable(lazy(() => import('../pages/AlarmCenter/
|
|||||||
const ClaimReport = Loadable(lazy(() => import('../pages/ClaimReport/Index')));
|
const ClaimReport = Loadable(lazy(() => import('../pages/ClaimReport/Index')));
|
||||||
const Claims = Loadable(lazy(() => import('../pages/Claims/Index')));
|
const Claims = Loadable(lazy(() => import('../pages/Claims/Index')));
|
||||||
const ClaimShow = Loadable(lazy(() => import('../pages/Claims/Show')));
|
const ClaimShow = Loadable(lazy(() => import('../pages/Claims/Show')));
|
||||||
const DialogDetailClaim = Loadable(lazy(()=> import('../pages/ClaimReport/DialogDetailClaim')));
|
const DialogDetailClaim = Loadable(lazy(() => import('../pages/ClaimReport/DialogDetailClaim')));
|
||||||
const DetailClaimReport = Loadable(lazy(()=> import('../pages/ClaimReport/Detail')));
|
const DetailClaimReport = Loadable(lazy(() => import('../pages/ClaimReport/Detail')));
|
||||||
const DetailHitoryClaimReport = Loadable(lazy(()=> import('../pages/ClaimReport/DetailHistory')));
|
const DetailHitoryClaimReport = Loadable(lazy(() => import('../pages/ClaimReport/DetailHistory')));
|
||||||
|
|
||||||
// Claim submit
|
// Claim submit
|
||||||
const ClaimSubmit = Loadable(lazy(() => import('../pages/ClaimSubmit/Index')));
|
const ClaimSubmit = Loadable(lazy(() => import('../pages/ClaimSubmit/Index')));
|
||||||
|
|||||||
Reference in New Issue
Block a user