Merge remote-tracking branch 'origin/origin/production' into staging
This commit is contained in:
@@ -75,8 +75,8 @@ MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
|
||||
|
||||
LMS_API_URL="http://lmsapi.primaya.id"
|
||||
|
||||
DUITKU_MERCHANT_KEY=c61af0a92d8e9b7fff00deecc975d84d
|
||||
DUITKU_MERCHANT_CODE=D11810
|
||||
DUITKU_MERCHANT_KEY=
|
||||
DUITKU_MERCHANT_CODE=
|
||||
DUITKU_IS_SANDBOX=TRUE
|
||||
|
||||
WKHTML_PDF_BINARY=/var/www/aso/vendor/h4cc/wkhtmltopdf-amd64/bin/wkhtmltopdf-amd64
|
||||
|
||||
@@ -6,7 +6,7 @@ use App\Helpers\Helper;
|
||||
use App\Models\Member;
|
||||
use App\Models\Claim;
|
||||
use App\Models\ClaimRequest;
|
||||
use App\Models\CorporateEmployee;
|
||||
use App\Models\RequestLog;
|
||||
use App\Services\CorporateMemberService;
|
||||
use Illuminate\Contracts\Support\Renderable;
|
||||
use Illuminate\Http\Request;
|
||||
@@ -18,15 +18,14 @@ use Modules\Client\Transformers\Dashboard\MemberResources as ClaimSubmitMemberRe
|
||||
use Modules\Client\Transformers\Dashboard\MemberResources as DashboardMemberResources;
|
||||
use Modules\Client\Transformers\Dashboard\MemberAlarmCenterResources as DashboardMemberAlarmResources;
|
||||
use Modules\Client\Transformers\Dashboard\MemberEmployeeDataResources as DashboardMemberEmployeeDataResources;
|
||||
use Modules\Client\Transformers\DataMemberResource;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
use Box\Spout\Reader\Common\Creator\ReaderEntityFactory;
|
||||
use Box\Spout\Writer\Common\Creator\WriterEntityFactory;
|
||||
use Modules\Client\Transformers\EmployeeData\UserProfile\DataMemberResource as EmployeeDataProfileMemberResource;
|
||||
use Modules\Internal\Services\MemberEnrollmentService;
|
||||
|
||||
class CorporateMemberController extends Controller
|
||||
{
|
||||
public $memberEnrollmentService;
|
||||
|
||||
public function __construct(public CorporateMemberService $corporateMemberService, MemberEnrollmentService $memberEnrollmentService)
|
||||
{
|
||||
$this->memberEnrollmentService = $memberEnrollmentService;
|
||||
@@ -62,173 +61,185 @@ class CorporateMemberController extends Controller
|
||||
|
||||
public function show($corporate_id, $person_id)
|
||||
{
|
||||
$data = Member::with(['claims', 'person', 'employeds', 'currentPlan.benefits', 'person.currentAddress'])
|
||||
->where('person_id', $person_id)
|
||||
->whereHas('employeds', function ($query) use ($corporate_id) {
|
||||
$query->where('corporate_id', $corporate_id);
|
||||
})
|
||||
->first();
|
||||
$data = Member::query()
|
||||
->with(['person'])
|
||||
->where('person_id', $person_id)
|
||||
->whereHas('currentCorporate', function ($query) use ($corporate_id) {
|
||||
$query->where('corporate_id', $corporate_id);
|
||||
})
|
||||
->firstOrFail();
|
||||
|
||||
|
||||
$totalClaims = $data->claims->sum('total_claim');
|
||||
$data->total_claims = $totalClaims;
|
||||
|
||||
//Get Family
|
||||
|
||||
$data_family = DB::table('members')
|
||||
->join('persons', 'members.person_id', '=', 'persons.id')
|
||||
->select('members.*', 'persons.phone')
|
||||
// Get Families
|
||||
$data->families = Member::query()
|
||||
->with(['person'])
|
||||
->where('principal_id', $data->member_id)
|
||||
->get();
|
||||
if ($data_family->isEmpty()) {
|
||||
$principal_id = DB::table('members')
|
||||
->where('member_id', $data->member_id)
|
||||
->select('principal_id')
|
||||
->first();
|
||||
$data_family = DB::table('members')
|
||||
->join('persons', 'members.person_id', '=', 'persons.id')
|
||||
->select('members.*', 'persons.phone')
|
||||
->where('principal_id', $principal_id->principal_id)
|
||||
->where('members.member_id', '<>', $data->member_id)
|
||||
->orWhere('members.member_id', $principal_id->principal_id)
|
||||
->get();
|
||||
|
||||
return response()->json(EmployeeDataProfileMemberResource::make($data));
|
||||
}
|
||||
|
||||
public function generateMemberList($corporate_id)
|
||||
{
|
||||
// Mendapatkan data yang akan diekspor (misalnya, dari database)
|
||||
$data = Member::with(['currentPlan', 'currentCorporate', 'division', 'employeds', 'currentPolicy'])
|
||||
// ->filter($request->all())
|
||||
// ->where('corporate_id', $corporate_id)
|
||||
->whereHas('employeds', function ($employeds) use ($corporate_id) {
|
||||
$employeds->where('corporate_id', $corporate_id);
|
||||
})->get()->toArray();
|
||||
// Membuat penulis entitas Spout
|
||||
$writer = WriterEntityFactory::createXLSXWriter();
|
||||
|
||||
// Membuka penulis untuk menulis ke file
|
||||
$writer->openToFile(public_path('files/CorporateMembershipList.xlsx'));
|
||||
// Menulis header kolom
|
||||
$headers_map_to_table_fields = $this->memberEnrollmentService->listing_doc_headers;
|
||||
$headerRow = WriterEntityFactory::createRowFromArray($headers_map_to_table_fields);
|
||||
|
||||
$writer->addRow($headerRow);
|
||||
|
||||
// Menulis data
|
||||
if (!empty($data)) {
|
||||
foreach ($data as $item) {
|
||||
$rowData = [
|
||||
$item['record_mode'], // Recode Mode
|
||||
$item['record_type'], // Recode Type
|
||||
$item['payor_id'], // Payor ID
|
||||
$item['member_id'], // Member ID
|
||||
$item['principal_id'], // Mapping ID
|
||||
NULL, // Link Medis Member ID
|
||||
$item['current_corporate']['code'] ?? null, // Corporate ID
|
||||
$item['employeds'][0]['nik'] ?? null, // NIK
|
||||
$item['division']['code'] ?? null, // Devision
|
||||
$item['employeds'][0]['branch_code'] ?? null, // Branch Code
|
||||
$item['bank_info'], // Bank Info
|
||||
$item['language'], // Language
|
||||
null, // Type of Work
|
||||
$item['race'], // Race
|
||||
$item['current_policy']['code'] ?? null, // Policy Number
|
||||
$item['marital_status'], // Marital Status
|
||||
$item['relation_with_principal'], // Relationship
|
||||
str_replace('-', '', $item['members_effective_date']), // Member effective date
|
||||
str_replace('-', '', $item['members_expire_date']), // Member expiry date
|
||||
NULL, // Faskes FKTP (First Level Provider) or Individual preferred provider
|
||||
NULL, // Faskes FKRTL (Next Level Provider) or Individual group preferred provider
|
||||
$item['bpjs_class'], // The Right Classes Room of BPJS Participants
|
||||
NULL, // Name of Faskes
|
||||
NULL, // Rule BPJSK
|
||||
NULL, // Internal Use
|
||||
$item['full_name'], // Member Name
|
||||
$item['address1'], // Address1
|
||||
$item['address2'], // Address2
|
||||
$item['address3'], // Address3
|
||||
$item['address4'], // Address4
|
||||
$item['city'], // City
|
||||
NULL, // State
|
||||
$item['postal_code'], // Post Code
|
||||
NULL, // Telephone - Mobile
|
||||
NULL, // Telephone - Res
|
||||
NULL, // Telephone - Office
|
||||
$item['nric'], // NRIC
|
||||
$item['passport_no'], // Passport No
|
||||
$item['passport_country'], // Passport Country
|
||||
$item['email'], // Email
|
||||
$item['identification_code'], // Identification Code
|
||||
$item['birth_date'], // Date of Birth
|
||||
$item['gender_code'], // Sex
|
||||
NULL, // Internal Use
|
||||
$item['current_plan']['code'] ?? null, // Plan-ID
|
||||
NULL, // Employment-Status
|
||||
NULL, // Internal Use
|
||||
NULL, // Internal Use
|
||||
NULL, // Internal Use
|
||||
str_replace('-', '', $item['terminated_date']), // Date Terminated
|
||||
$item['pre_existing'], // Pre Existing
|
||||
$item['bpjs_id'], // BPJS ID
|
||||
$item['endorsement_date'], // Endorsement Date
|
||||
$item['remarks'], // Remarks
|
||||
NULL, // Internal Use
|
||||
NULL, // Member Since
|
||||
NULL, // Internal Use
|
||||
$item['policy_in_force'], // Policy Inforce
|
||||
NULL, // Member Suspended
|
||||
str_replace('-', '', $item['activation_date']), // Activation Date
|
||||
NULL, // Internal Use
|
||||
$item['start_no_claim'], // StartNoClaim
|
||||
$item['end_no_claim'], // EndNoClaim
|
||||
NULL, // Option Mode
|
||||
];
|
||||
$row = WriterEntityFactory::createRowFromArray($rowData);
|
||||
$writer->addRow($row);
|
||||
}
|
||||
}
|
||||
|
||||
$data->family = $data_family;
|
||||
|
||||
//Claim History
|
||||
$data_claim_history = DB::table('claim_requests')
|
||||
->join('claims', 'claims.claim_request_id', '=', 'claim_requests.id')
|
||||
->join('claim_items', 'claim_items.claim_id', '=', 'claims.id')
|
||||
->join('benefits', 'benefits.id', '=', 'claim_items.claim_itemable_id')
|
||||
->select('claim_requests.status', 'claim_requests.submission_date', 'benefits.description')
|
||||
->where('claim_requests.member_id', $data->id)
|
||||
->get();
|
||||
$data->claim_history = $data_claim_history;
|
||||
|
||||
return response()->json(DataMemberResource::make($data));
|
||||
|
||||
|
||||
// Menutup penulis
|
||||
$writer->close();
|
||||
// dd('test');
|
||||
// Mengembalikan response untuk mengunduh file
|
||||
$filePath = public_path('files/CorporateMembershipList.xlsx');
|
||||
// dd($filePath);
|
||||
// Mengembalikan response untuk mengunduh file
|
||||
return Helper::responseJson([
|
||||
'file_name' => "Corporate Plan & Benefit List " . date('Y-m-d h:i:s'),
|
||||
"file_url" => url('files/CorporateMembershipList.xlsx')
|
||||
]);
|
||||
}
|
||||
|
||||
public function generateMemberList($corporate_id){
|
||||
// Mendapatkan data yang akan diekspor (misalnya, dari database)
|
||||
$data = Member::with(['currentPlan', 'currentCorporate', 'division', 'employeds', 'currentPolicy'])
|
||||
// ->filter($request->all())
|
||||
// ->where('corporate_id', $corporate_id)
|
||||
->whereHas('employeds', function ($employeds) use ($corporate_id) {
|
||||
$employeds->where('corporate_id', $corporate_id);
|
||||
})->get()->toArray();
|
||||
// Membuat penulis entitas Spout
|
||||
$writer = WriterEntityFactory::createXLSXWriter();
|
||||
|
||||
// Membuka penulis untuk menulis ke file
|
||||
$writer->openToFile(public_path('files/CorporateMembershipList.xlsx'));
|
||||
// Menulis header kolom
|
||||
$headers_map_to_table_fields = $this->memberEnrollmentService->listing_doc_headers;
|
||||
$headerRow = WriterEntityFactory::createRowFromArray($headers_map_to_table_fields);
|
||||
|
||||
$writer->addRow($headerRow);
|
||||
// dd('test');
|
||||
// Menulis data
|
||||
if (!empty($data)) {
|
||||
foreach ($data as $item) {
|
||||
$rowData = [ $item['record_mode'], // Recode Mode
|
||||
$item['record_type'], // Recode Type
|
||||
$item['payor_id'], // Payor ID
|
||||
$item['member_id'], // Member ID
|
||||
$item['principal_id'], // Mapping ID
|
||||
NULL, // Link Medis Member ID
|
||||
$item['current_corporate']['code'] ?? null, // Corporate ID
|
||||
$item['employeds'][0]['nik'] ?? null, // NIK
|
||||
$item['division']['code'] ?? null, // Devision
|
||||
$item['employeds'][0]['branch_code'] ?? null, // Branch Code
|
||||
$item['bank_info'], // Bank Info
|
||||
$item['language'], // Language
|
||||
null, // Type of Work
|
||||
$item['race'], // Race
|
||||
$item['current_policy']['code'] ?? null, // Policy Number
|
||||
$item['marital_status'], // Marital Status
|
||||
$item['relation_with_principal'], // Relationship
|
||||
str_replace('-', '',$item['members_effective_date']), // Member effective date
|
||||
str_replace('-', '',$item['members_expire_date']), // Member expiry date
|
||||
NULL, // Faskes FKTP (First Level Provider) or Individual preferred provider
|
||||
NULL, // Faskes FKRTL (Next Level Provider) or Individual group preferred provider
|
||||
$item['bpjs_class'], // The Right Classes Room of BPJS Participants
|
||||
NULL, // Name of Faskes
|
||||
NULL, // Rule BPJSK
|
||||
NULL, // Internal Use
|
||||
$item['full_name'], // Member Name
|
||||
$item['address1'], // Address1
|
||||
$item['address2'], // Address2
|
||||
$item['address3'], // Address3
|
||||
$item['address4'], // Address4
|
||||
$item['city'], // City
|
||||
NULL, // State
|
||||
$item['postal_code'], // Post Code
|
||||
NULL, // Telephone - Mobile
|
||||
NULL, // Telephone - Res
|
||||
NULL, // Telephone - Office
|
||||
$item['nric'], // NRIC
|
||||
$item['passport_no'], // Passport No
|
||||
$item['passport_country'], // Passport Country
|
||||
$item['email'], // Email
|
||||
$item['identification_code'], // Identification Code
|
||||
$item['birth_date'], // Date of Birth
|
||||
$item['gender_code'], // Sex
|
||||
NULL, // Internal Use
|
||||
$item['current_plan']['code'] ?? null, // Plan-ID
|
||||
NULL, // Employment-Status
|
||||
NULL, // Internal Use
|
||||
NULL, // Internal Use
|
||||
NULL,// Internal Use
|
||||
str_replace('-', '',$item['terminated_date']), // Date Terminated
|
||||
$item['pre_existing'], // Pre Existing
|
||||
$item['bpjs_id'], // BPJS ID
|
||||
$item['endorsement_date'], // Endorsement Date
|
||||
$item['remarks'], // Remarks
|
||||
NULL, // Internal Use
|
||||
NULL,// Member Since
|
||||
NULL,// Internal Use
|
||||
$item['policy_in_force'], // Policy Inforce
|
||||
NULL, // Member Suspended
|
||||
str_replace('-', '',$item['activation_date']), // Activation Date
|
||||
NULL, // Internal Use
|
||||
$item['start_no_claim'], // StartNoClaim
|
||||
$item['end_no_claim'], // EndNoClaim
|
||||
NULL, // Option Mode
|
||||
];
|
||||
$row = WriterEntityFactory::createRowFromArray($rowData);
|
||||
$writer->addRow($row);
|
||||
}
|
||||
}
|
||||
|
||||
// Menutup penulis
|
||||
$writer->close();
|
||||
// dd('test');
|
||||
// Mengembalikan response untuk mengunduh file
|
||||
$filePath = public_path('files/CorporateMembershipList.xlsx');
|
||||
// dd($filePath);
|
||||
// Mengembalikan response untuk mengunduh file
|
||||
return Helper::responseJson([
|
||||
'file_name' => "Corporate Plan & Benefit List " . date('Y-m-d h:i:s'),
|
||||
"file_url" => url('files/CorporateMembershipList.xlsx')
|
||||
]);
|
||||
}
|
||||
|
||||
public function showPerMember($corporate_id, $member_id){
|
||||
$data = ClaimRequest::where(['member_id' => $member_id])
|
||||
->whereNotNull('claim_id')
|
||||
->paginate(10);
|
||||
return response()->json(Helper::paginateResources(DataListClaimMemberResource::collection($data)));
|
||||
}
|
||||
|
||||
public function serviceMonitoring($corporate_id, $claim_id)
|
||||
public function showPerMember(Request $request, $corporate_id, $member_id)
|
||||
{
|
||||
$data = Claim::where('id', $claim_id)->first();
|
||||
$per_page = $request->has('per_page') ? $request->input('per_page') : 10;
|
||||
|
||||
$data = Member::query()
|
||||
->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 ?? null, 'paginations' => Helper::paginateResources(DataListClaimMemberResource::collection($data->requestLogs()->paginate($per_page)))]);
|
||||
}
|
||||
|
||||
public function serviceMonitoring(int $corporate_id, int $request_log_id)
|
||||
{
|
||||
$data = RequestLog::query()
|
||||
->with([
|
||||
'member:id,member_id,person_id,birth_date,email,name_prefix,name,name_suffix' => [
|
||||
'currentCorporate',
|
||||
'person:id,email,name_prefix,name,name_suffix,phone'
|
||||
],
|
||||
'organization:id,name',
|
||||
'requestLogBenefits:id,request_log_id,benefit_id,amount_incurred,amount_approved,amount_not_approved,excess_paid,keterangan' => [
|
||||
'benefit'
|
||||
],
|
||||
'requestLogDailyMonitorings:id,request_log_id,created_at,subject,body_temperature,sistole,diastole,respiration_rate,analysis,lab_date,provider,examination' => [
|
||||
'requestLogMedicalPlans:request_log_daily_monitoring_id,plan,type'
|
||||
],
|
||||
'service:code,name',
|
||||
])
|
||||
->find($request_log_id, ['id', 'submission_date', 'discharge_date', 'member_id', 'service_code', 'organization_id']);
|
||||
|
||||
$dataBenefit = [];
|
||||
if (count($data->requestLogBenefits) > 0) {
|
||||
$totalIncurred = 0;
|
||||
$totalApprove = 0;
|
||||
$totalNotApporve = 0;
|
||||
$totalExcess = 0;
|
||||
|
||||
foreach ($data->requestLogBenefits as $itemBenefit) {
|
||||
$totalIncurred += $itemBenefit->amount_incurred;
|
||||
$totalApprove += $itemBenefit->amount_approved;
|
||||
$totalNotApporve += $itemBenefit->amount_not_approved;
|
||||
$totalExcess += $itemBenefit->excess_paid;
|
||||
}
|
||||
|
||||
$dataBenefit['totalIncurred'] = $totalIncurred;
|
||||
$dataBenefit['totalApprove'] = $totalApprove;
|
||||
$dataBenefit['totalNotApprove'] = $totalNotApporve;
|
||||
$dataBenefit['totalExcess'] = $totalExcess;
|
||||
}
|
||||
|
||||
$data->benefitTotal = $dataBenefit;
|
||||
|
||||
return Helper::responseJson(DataServiceMonitoring::make($data));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ class CorporatePolicyController extends Controller
|
||||
public function index($corporate_id)
|
||||
{
|
||||
$currentCorporate = Auth::user()->managedCorporates()
|
||||
->with(['currentPolicy', 'employees'])
|
||||
->with(['currentPolicy'])
|
||||
->find($corporate_id);
|
||||
|
||||
$data = LimitResources::make($currentCorporate);
|
||||
|
||||
@@ -20,7 +20,7 @@ class TopUpController extends Controller
|
||||
{
|
||||
$data = Auth::user()
|
||||
->managedCorporates()
|
||||
->with(['currentPolicy', 'employees'])
|
||||
->with(['currentPolicy'])
|
||||
->withCount(['employees', 'claims' => function ($query) {
|
||||
$query->where('claims.status', 'paid');
|
||||
}])
|
||||
@@ -36,20 +36,20 @@ class TopUpController extends Controller
|
||||
*/
|
||||
public function store(Request $request, $corporate_id)
|
||||
{
|
||||
|
||||
|
||||
$data = $request->validate([
|
||||
'topup' => 'required|numeric',
|
||||
]);
|
||||
|
||||
$corporatePolicy = CorporatePolicy::query()->where('corporate_id',$corporate_id)->firstOrFail();
|
||||
$corporatePolicy = CorporatePolicy::query()->where('corporate_id', $corporate_id)->firstOrFail();
|
||||
if (!$corporatePolicy) {
|
||||
return response() -> json (['message' => 'Corporate policy not found'],404);
|
||||
return response()->json(['message' => 'Corporate policy not found'], 404);
|
||||
}
|
||||
|
||||
$corporatePolicy -> total_premi += $data ['topup'];
|
||||
$corporatePolicy -> save();
|
||||
$corporatePolicy->total_premi += $data['topup'];
|
||||
$corporatePolicy->save();
|
||||
|
||||
return response () -> json (['message' => 'Amount added to total_premi successfully'], 200);
|
||||
return response()->json(['message' => 'Amount added to total_premi successfully'], 200);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -50,7 +50,7 @@ Route::prefix('client')->group(function () {
|
||||
Route::get('members/{id}', [CorporateMemberController::class, 'show']);
|
||||
Route::get('export-members/list', [CorporateMemberController::class, 'generateMemberList']);
|
||||
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', [ClaimController::class, 'index']);
|
||||
Route::get('claims/export', [ClaimController::class, 'export']);
|
||||
@@ -65,8 +65,6 @@ Route::prefix('client')->group(function () {
|
||||
|
||||
Route::get('corporate', [CorporateCurrentController::class, 'index']);
|
||||
Route::put('corporate-update', [CorporateCurrentController::class, 'update']);
|
||||
|
||||
|
||||
});
|
||||
Route::get('claims/{id}', [ClaimController::class, 'show']);
|
||||
|
||||
|
||||
@@ -2,9 +2,8 @@
|
||||
|
||||
namespace Modules\Client\Transformers\AlarmCenter;
|
||||
|
||||
use App\Models\Member;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use App\Models\Service;
|
||||
|
||||
class DataListClaimMemberResource extends JsonResource
|
||||
{
|
||||
@@ -16,22 +15,27 @@ class DataListClaimMemberResource extends JsonResource
|
||||
*/
|
||||
public function toArray($request)
|
||||
{
|
||||
$member = Member::findOrFail($this->member_id);
|
||||
$serviceData = Service::where('code', $this->service_code)->first();
|
||||
if ($serviceData) {
|
||||
$serviceName = $serviceData->name;
|
||||
} else {
|
||||
$serviceName = $this->service_cod;
|
||||
}
|
||||
|
||||
if ($this->status == 'approved' && $this->status_final_log ){
|
||||
$status = 'Done';
|
||||
} else if ($this->status == 'declined' || $this->status_final_log == 'declined') {
|
||||
$status = 'Declined';
|
||||
} else {
|
||||
$status = 'Ongoing';
|
||||
}
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'admission_date' => $this->submission_date,
|
||||
'discharge_date' => $this->submission_date,
|
||||
'code' => $this->code,
|
||||
'service_type' => $this->service_code == 'IP' ? 'Inpatient' : 'Outpatient',
|
||||
'status' => $this->service_code == 'approved' ? 'Done' : 'OnGoing',
|
||||
'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,
|
||||
];
|
||||
'admission_date' => $this->submission_date ?? null,
|
||||
'discharge_date' => $this->discharge_date ?? null,
|
||||
'code' => $this->code ?? null,
|
||||
'service_type' => $serviceName,
|
||||
'status' => $status,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,25 +2,8 @@
|
||||
|
||||
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 Illuminate\Http\Resources\Json\JsonResource;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
class DataServiceMonitoring extends JsonResource
|
||||
{
|
||||
@@ -32,157 +15,89 @@ class DataServiceMonitoring extends JsonResource
|
||||
*/
|
||||
public function toArray($request)
|
||||
{
|
||||
$claim_request = ClaimRequest::findOrFail($this->claim_request_id);
|
||||
$member = Member::findOrFail($this->member_id);
|
||||
|
||||
|
||||
// History Care Hospital
|
||||
$historyCareHospital = ClaimHistoryCare::where('claim_id', $this->id)->first();
|
||||
if ($historyCareHospital) {
|
||||
$hospital = Organization::findOrFail($historyCareHospital->organization_id)->name;
|
||||
$mainDianosis = Icd::findOrFail($historyCareHospital->main_diagnosis_id)->name;
|
||||
$mainDianosisCode = Icd::findOrFail($historyCareHospital->main_diagnosis_id)->code;
|
||||
|
||||
$comporatationDiagnosis = DiagnosisSecondaryClaimHistoryCare::where('claim_history_care_id', $historyCareHospital->id)->first();
|
||||
|
||||
$comporatationDiagnosisName = Icd::findOrFail($comporatationDiagnosis->icd_id)->name;
|
||||
$comporatationDiagnosisCode = Icd::findOrFail($comporatationDiagnosis->icd_id)->code;
|
||||
|
||||
$admissionDate = $historyCareHospital->admission_date;
|
||||
$dischargeDate = $historyCareHospital->discharge_date;
|
||||
$serviceCode = $historyCareHospital->service_code;
|
||||
$symptoms = $historyCareHospital->symptoms;
|
||||
$sign = $historyCareHospital->sign;
|
||||
} else {
|
||||
$hospital = '-';
|
||||
$mainDianosis = '-';
|
||||
$mainDianosisCode = '-';
|
||||
$comporatationDiagnosisName = '-';
|
||||
$comporatationDiagnosisCode = '-';
|
||||
$admissionDate = '-';
|
||||
$dischargeDate = '-';
|
||||
$serviceCode = '-';
|
||||
$symptoms = '-';
|
||||
$sign = '-';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$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 [
|
||||
'companyName' => $this->member->currentCorporate->name ?? null,
|
||||
'serviceCode' => $this->service_code ?? null,
|
||||
'memberId' => $this->member->member_id ?? null,
|
||||
'fullName' => $this->member->full_name ?? null,
|
||||
'dateOfBirth' => $this->member->birth_date ?? null,
|
||||
'phoneNumber' => $this->person->phone ?? null,
|
||||
'email' => $this->member->email ?? ($this->member->person->email ?? null),
|
||||
'serviceName' => $this->service->name ?? ($this->service_code ?? null),
|
||||
'benefits' => collect($this->requestLogBenefits)->map(function ($requestLogBenefit) {
|
||||
return [
|
||||
'amountIncurred' => $requestLogBenefit->amount_incurred,
|
||||
'amountApproved' => $requestLogBenefit->amount_approved,
|
||||
'amountNotAprroved' => $requestLogBenefit->amount_not_approved,
|
||||
'excessPaid' => $requestLogBenefit->excess_paid,
|
||||
'description' => $requestLogBenefit->keterangan,
|
||||
'name' => $requestLogBenefit->benefit->description,
|
||||
];
|
||||
})->all() ?? null,
|
||||
'benefitTotal' => $this->benefitTotal ?? null,
|
||||
'hospital' => $this->organization->name ?? null,
|
||||
'admissionDate' => $this->submission_date ?? null,
|
||||
'dischargeDate' => $this->discharge_date ?? null,
|
||||
'dailyMonitorings' => $this->when($this->service_code === 'IP', collect($this->requestLogDailyMonitorings)
|
||||
->groupBy(function ($requestLogDailyMonitoring) {
|
||||
return $requestLogDailyMonitoring->created_at->format('d M Y');
|
||||
})
|
||||
->map(function ($groupedItems) {
|
||||
return collect($groupedItems)
|
||||
->map(function ($requestLogDailyMonitoring) {
|
||||
return [
|
||||
'time' => $requestLogDailyMonitoring->created_at->format('H:i') ?? null,
|
||||
'status' => 'Done' ?? null,
|
||||
'subject' => $requestLogDailyMonitoring->subject ?? null,
|
||||
'bodyTemperature' => $requestLogDailyMonitoring->body_temperature ?? null,
|
||||
'sistole' => $requestLogDailyMonitoring->sistole . 'mm[Hg]' ?? null,
|
||||
'diastole' => $requestLogDailyMonitoring->diastole . 'mm[Hg]' ?? null,
|
||||
'respirationRate' => $requestLogDailyMonitoring->respiration_rate . '/min' ?? null,
|
||||
'analysis' => $requestLogDailyMonitoring->analysis ?? null,
|
||||
'complaints' => $requestLogDailyMonitoring->complaints ?? null,
|
||||
'plans' => $this->when($requestLogDailyMonitoring->requestLogMedicalPlans, collect($requestLogDailyMonitoring->requestLogMedicalPlans)
|
||||
->map(function ($requestLogMedicalPlan) {
|
||||
return [
|
||||
'type' => $requestLogMedicalPlan->type,
|
||||
'plan' => $requestLogMedicalPlan->plan
|
||||
];
|
||||
})
|
||||
->sortBy('type')
|
||||
->all()) ?? null,
|
||||
];
|
||||
})
|
||||
->sortByDesc(function ($item) {
|
||||
return $item['time'];
|
||||
})
|
||||
->values();
|
||||
})
|
||||
->sortByDesc(function ($groupedItems, $date) {
|
||||
return Carbon::createFromFormat('d M Y', $date)->format('Y-m-d');
|
||||
})
|
||||
->all()) ?? null,
|
||||
'laboratoriumResults' => $this->whenLoaded('requestLogDailyMonitorings', collect($this->requestLogDailyMonitorings)
|
||||
->groupBy(function ($requestLogDailyMonitoring) {
|
||||
return Carbon::parse($requestLogDailyMonitoring->lab_date)->format('d M Y');
|
||||
})
|
||||
->map(function ($groupedItems) {
|
||||
return collect($groupedItems)
|
||||
->map(function ($requestLogDailyMonitoring) {
|
||||
return [
|
||||
'code' => $requestLogDailyMonitoring->code,
|
||||
'date' => Carbon::parse($requestLogDailyMonitoring->lab_date)->format('d M Y') ?? null,
|
||||
'examination' => $requestLogDailyMonitoring->examination ?? null,
|
||||
'location' => $requestLogDailyMonitoring->provider ?? null,
|
||||
];
|
||||
})
|
||||
->sortByDesc(function ($item) {
|
||||
return $item['code'];
|
||||
})
|
||||
->values();
|
||||
})
|
||||
->sortByDesc(function ($groupedItems, $date) {
|
||||
return Carbon::createFromFormat('d M Y', $date)->format('Y-m-d');
|
||||
})
|
||||
->all()) ?? null
|
||||
];
|
||||
|
||||
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Client\Transformers\Dashboard;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
@@ -18,7 +19,7 @@ class MemberEmployeeDataResources extends JsonResource
|
||||
'personId' => $this->person_id,
|
||||
'memberId' => $this->member_id,
|
||||
'fullName' => $this->full_name,
|
||||
'service' => $this->service_code,
|
||||
// 'service' => $this->service_code,
|
||||
'start_date' => $this->start_date,
|
||||
'end_date' => $this->end_date,
|
||||
'status' => $this->active,
|
||||
|
||||
@@ -26,7 +26,7 @@ class MemberResources extends JsonResource
|
||||
'percentage' => (!empty($this->currentPlan->limit_rules ?? 0)) ? (($this->claims_sum_total_claim / $this->currentPlan->limit_rules) * 100) : 0
|
||||
],
|
||||
'status' => $this->active,
|
||||
'service_type' => $this->currentPlans,
|
||||
// 'service_type' => $this->currentPlans,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Client\Transformers\EmployeeData\UserProfile;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class DataMemberResource extends JsonResource
|
||||
{
|
||||
/**
|
||||
* Transform the resource into an array.
|
||||
*
|
||||
* @param \Illuminate\Http\Request
|
||||
* @return array
|
||||
*/
|
||||
public function toArray($request)
|
||||
{
|
||||
return [
|
||||
'person' => [
|
||||
'name' => $this->full_name ?? null,
|
||||
'weight' => $this->person->last_weight_kg ?? null,
|
||||
'height' => $this->person->last_height_kg ?? null,
|
||||
'placeOfBirth' => ucwords($this->person->birth_place) ?? null,
|
||||
'dateOfBirth' => $this->birth_date ?? $this->person->birth_date,
|
||||
'gender' => ucwords(strtolower($this->gender ?? $this->person->gender)),
|
||||
'phoneNumber' => $this->person->phone ?? null,
|
||||
'email' => $this->email ?? ($this->person->email ?? null),
|
||||
'address' => $this->person->last_height_kg ?? null,
|
||||
'idNumber' => $this->person->nik ?? null,
|
||||
'religion' => ucwords(strtolower($this->person->religion)) ?? null,
|
||||
'maritalStatus' => $this->marital_status,
|
||||
'education' => ucwords(strtolower($this->person->last_education)) ?? null,
|
||||
'occupation' => null,
|
||||
],
|
||||
'families' => collect($this->families)->map(function ($family) {
|
||||
return [
|
||||
'name' => $family->full_name ?? null,
|
||||
'relationship' => $family->relationship ?? null,
|
||||
'dateOfBirth' => $family->birth_date ?? $family->person->birth_date,
|
||||
'email' => $this->email ?? ($this->person->email ?? null),
|
||||
'phoneNumber' => $this->person->phone ?? null,
|
||||
'status' => $this->status ?? null
|
||||
];
|
||||
})->all()
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -71,33 +71,33 @@ class RequestLogController extends Controller
|
||||
|
||||
// Membuat kode organisasi
|
||||
$kodeOrganisasi = "ORG000" . $singkatan;
|
||||
|
||||
|
||||
// Insert data ke tabel organizations
|
||||
$organization_id = DB::table('organizations')
|
||||
->insertGetId([
|
||||
'name' => $request->organization_name,
|
||||
'code' => $kodeOrganisasi,
|
||||
'type' => 'hospital',
|
||||
'code' => $kodeOrganisasi,
|
||||
'type' => 'hospital',
|
||||
'created_at' => now(),
|
||||
'created_by' => auth()->user()->id
|
||||
]);
|
||||
|
||||
|
||||
// Insert data ke tabel addresses
|
||||
$address_id = DB::table('addresses')
|
||||
->insertGetId([
|
||||
'text'=> $request->address_provider,
|
||||
'addressable_type' => 'App\Models\Organization',
|
||||
'text'=> $request->address_provider,
|
||||
'addressable_type' => 'App\Models\Organization',
|
||||
'addressable_id' => $organization_id,
|
||||
'type' => 'hospital',
|
||||
'type' => 'hospital',
|
||||
'created_at' => now(),
|
||||
'created_by' => auth()->user()->id
|
||||
]);
|
||||
|
||||
|
||||
// Update main_address_id di tabel organizations
|
||||
DB::table('organizations')
|
||||
->where('organizations.id', '=', $organization_id)
|
||||
->update(['main_address_id' => $address_id]);
|
||||
|
||||
|
||||
// Commit transaksi
|
||||
DB::commit();
|
||||
$request->merge(['organization_id' => $organization_id]);
|
||||
@@ -144,7 +144,7 @@ class RequestLogController extends Controller
|
||||
} catch (\Exception $e) {
|
||||
// Rollback transaksi jika terjadi kesalahan
|
||||
DB::rollBack();
|
||||
|
||||
|
||||
// Handle error, bisa di-log atau dikembalikan sebagai response
|
||||
return ApiResponse::apiResponse('Server Error', $data, $e->getMessage(), 500);
|
||||
}
|
||||
@@ -178,11 +178,11 @@ class RequestLogController extends Controller
|
||||
})
|
||||
->when($request->input('status'), function ($query, $status) {
|
||||
$query->where(function ($query) use ($status) {
|
||||
|
||||
|
||||
if ($status === 'requested') {
|
||||
$query->where('request_logs.status', '=', 'requested');
|
||||
}
|
||||
|
||||
|
||||
if ($status === 'reviewed') {
|
||||
$query->where('request_logs.status', '=', 'approved');
|
||||
}
|
||||
@@ -194,29 +194,29 @@ class RequestLogController extends Controller
|
||||
if ($status === 'declined') {
|
||||
$query->where('request_logs.status', '=', 'declined');
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
})
|
||||
->select(
|
||||
'request_logs.id',
|
||||
'request_logs.member_id',
|
||||
'request_logs.final_log',
|
||||
'request_logs.code',
|
||||
'members.name as full_name',
|
||||
'request_logs.code',
|
||||
'members.name as full_name',
|
||||
'members.member_id as no_polis',
|
||||
'members.birth_date',
|
||||
DB::raw('
|
||||
CASE
|
||||
CASE
|
||||
WHEN request_logs.status = "requested" THEN "requested"
|
||||
WHEN request_logs.status = "approved" THEN "approved"
|
||||
WHEN request_logs.status = "declined" THEN "declined"
|
||||
WHEN request_logs.status = "reviewed" THEN "reviewed"
|
||||
ELSE ""
|
||||
ELSE ""
|
||||
END AS status
|
||||
'),
|
||||
DB::raw('
|
||||
(SELECT organizations.name FROM organizations WHERE organizations.id = request_logs.organization_id LIMIT 1) AS provider
|
||||
'),
|
||||
'),
|
||||
'request_logs.submission_date')
|
||||
->paginate($limit);
|
||||
return response()->json(Helper::paginateResources($results));
|
||||
@@ -250,11 +250,11 @@ class RequestLogController extends Controller
|
||||
})
|
||||
->when($request->input('status'), function ($query, $status) {
|
||||
$query->where(function ($query) use ($status) {
|
||||
|
||||
|
||||
if ($status === 'requested') {
|
||||
$query->where('request_logs.status_final_log', '=', 'requested');
|
||||
}
|
||||
|
||||
|
||||
if ($status === 'reviewed') {
|
||||
$query->where('request_logs.status_final_log', '=', 'approved');
|
||||
}
|
||||
@@ -266,39 +266,39 @@ class RequestLogController extends Controller
|
||||
if ($status === 'declined') {
|
||||
$query->where('request_logs.status_final_log', '=', 'declined');
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
})
|
||||
->where('request_logs.final_log', '=', 1)
|
||||
->select(
|
||||
'request_logs.id',
|
||||
'request_logs.final_log',
|
||||
'request_logs.code',
|
||||
'members.name as full_name',
|
||||
'request_logs.code',
|
||||
'members.name as full_name',
|
||||
'members.member_id as no_polis',
|
||||
'members.id AS member_id',
|
||||
'request_logs.service_code',
|
||||
'members.birth_date',
|
||||
DB::raw('
|
||||
CASE
|
||||
CASE
|
||||
WHEN request_logs.status_final_log = "requested" THEN "requested"
|
||||
WHEN request_logs.status_final_log = "approved" THEN "approved"
|
||||
WHEN request_logs.status_final_log = "declined" THEN "declined"
|
||||
WHEN request_logs.status_final_log = "reviewed" THEN "reviewed"
|
||||
ELSE ""
|
||||
ELSE ""
|
||||
END AS status
|
||||
'),
|
||||
'),
|
||||
'request_logs.submission_date',
|
||||
DB::raw('
|
||||
CASE
|
||||
CASE
|
||||
WHEN service_code = "OP" THEN "Outpatient"
|
||||
WHEN service_code = "IP" THEN "Inpatient"
|
||||
ELSE ""
|
||||
ELSE ""
|
||||
END AS service_type
|
||||
'),
|
||||
DB::raw('
|
||||
(SELECT organizations.name FROM organizations WHERE organizations.id = request_logs.organization_id LIMIT 1) AS provider
|
||||
'),
|
||||
'),
|
||||
DB::raw('
|
||||
(Select request_log_id FROM claim_requests WHERE claim_requests.request_log_id = request_logs.id LIMIT 1) AS check_claim
|
||||
')
|
||||
@@ -428,7 +428,7 @@ class RequestLogController extends Controller
|
||||
'members.nric',
|
||||
'members.id',
|
||||
'members.principal_id',
|
||||
'members.name',
|
||||
'members.name',
|
||||
'members.birth_date',
|
||||
'members.member_id',
|
||||
'members.gender',
|
||||
@@ -439,20 +439,20 @@ class RequestLogController extends Controller
|
||||
"LinkSehat" AS penjamin
|
||||
'),
|
||||
DB::raw('
|
||||
(Select corporates.name FROM corporates
|
||||
(Select corporates.name FROM corporates
|
||||
LEFT JOIN corporate_employees ON corporate_employees.corporate_id = corporates.id
|
||||
WHERE corporate_employees.member_id = members.id LIMIT 1) AS nama_perusahaan
|
||||
'),
|
||||
DB::raw('
|
||||
(Select corporates.id FROM corporates
|
||||
(Select corporates.id FROM corporates
|
||||
LEFT JOIN corporate_employees ON corporate_employees.corporate_id = corporates.id
|
||||
WHERE corporate_employees.member_id = members.id LIMIT 1) AS id_perusahaan
|
||||
'),
|
||||
DB::raw('
|
||||
(Select corporates.code FROM corporates
|
||||
(Select corporates.code FROM corporates
|
||||
LEFT JOIN corporate_employees ON corporate_employees.corporate_id = corporates.id
|
||||
WHERE corporate_employees.member_id = members.id LIMIT 1) AS code_perusahaan
|
||||
'),
|
||||
'),
|
||||
DB::raw('
|
||||
(Select services.name FROM services
|
||||
WHERE services.code = "'.$dataRequestLog->service_code.'" LIMIT 1) AS jenis_perwatan
|
||||
@@ -464,12 +464,12 @@ class RequestLogController extends Controller
|
||||
(Select member_policies.status FROM member_policies WHERE member_policies.member_id = members.member_id LIMIT 1) AS status_polis
|
||||
'),
|
||||
DB::raw('
|
||||
(Select plans.code FROM member_plans
|
||||
(Select plans.code FROM member_plans
|
||||
LEFT JOIN plans ON plans.id = member_plans.plan_id
|
||||
WHERE member_plans.member_id = members.id AND plans.service_code = "'.$dataRequestLog->service_code.'" LIMIT 1) AS code_plan
|
||||
'),
|
||||
DB::raw('
|
||||
(Select plans.limit_rules FROM member_plans
|
||||
(Select plans.limit_rules FROM member_plans
|
||||
LEFT JOIN plans ON plans.id = member_plans.plan_id
|
||||
WHERE member_plans.member_id = members.id LIMIT 1) AS limit_rules
|
||||
'),
|
||||
@@ -478,20 +478,20 @@ class RequestLogController extends Controller
|
||||
'),
|
||||
'members.members_effective_date AS mulai',
|
||||
'members.members_expire_date AS akhir'
|
||||
)
|
||||
)
|
||||
->first();
|
||||
$data['namaKaryawan'] = '';
|
||||
$data['namaKaryawan'] = '';
|
||||
if($dataMember->principal_id)
|
||||
{
|
||||
$dataNamaKaryawan = DB::table('members')
|
||||
->where('members.member_id', '=', $dataMember->principal_id)
|
||||
->select('members.name')
|
||||
->first();
|
||||
$data['namaKaryawan'] = $dataNamaKaryawan->name;
|
||||
$data['namaKaryawan'] = $dataNamaKaryawan->name;
|
||||
}
|
||||
else{
|
||||
$data['namaKaryawan'] = $dataMember->name;
|
||||
}
|
||||
}
|
||||
|
||||
$data['dataMember'] = $dataMember;
|
||||
|
||||
@@ -536,7 +536,7 @@ class RequestLogController extends Controller
|
||||
->select(
|
||||
'files.path',
|
||||
DB::raw('
|
||||
(Select persons.name FROM users
|
||||
(Select persons.name FROM users
|
||||
LEFT JOIN persons ON users.person_id = persons.id
|
||||
WHERE users.id = "'.$dataRequestLog->approved_by.'" LIMIT 1) AS name_approve
|
||||
')
|
||||
@@ -557,7 +557,7 @@ class RequestLogController extends Controller
|
||||
|
||||
// Halaman 1
|
||||
$html1 = view('pdf.req_log_page_1', $data);
|
||||
|
||||
|
||||
// Halaman 2
|
||||
// $html2 = view('pdf.req_log_page_2', $data);
|
||||
|
||||
@@ -567,10 +567,10 @@ class RequestLogController extends Controller
|
||||
|
||||
$pdf->loadHtml($htmlCombined);
|
||||
$pdf->render();
|
||||
|
||||
|
||||
$headers = [
|
||||
'Content-Type' => 'application/pdf',
|
||||
'Content-Disposition' => 'inline; filename="file.pdf"',
|
||||
'Content-Disposition' => 'inline; filename="file.pdf"',
|
||||
];
|
||||
|
||||
return response($pdf->output(), 200, $headers);
|
||||
@@ -588,7 +588,7 @@ class RequestLogController extends Controller
|
||||
'members.nric',
|
||||
'members.id',
|
||||
'members.principal_id',
|
||||
'members.name',
|
||||
'members.name',
|
||||
'members.birth_date',
|
||||
'members.member_id',
|
||||
'members.gender',
|
||||
@@ -599,17 +599,17 @@ class RequestLogController extends Controller
|
||||
"LinkSehat" AS penjamin
|
||||
'),
|
||||
DB::raw('
|
||||
(Select corporates.name FROM corporates
|
||||
(Select corporates.name FROM corporates
|
||||
LEFT JOIN corporate_employees ON corporate_employees.corporate_id = corporates.id
|
||||
WHERE corporate_employees.member_id = members.id LIMIT 1) AS nama_perusahaan
|
||||
'),
|
||||
DB::raw('
|
||||
(Select corporates.id FROM corporates
|
||||
(Select corporates.id FROM corporates
|
||||
LEFT JOIN corporate_employees ON corporate_employees.corporate_id = corporates.id
|
||||
WHERE corporate_employees.member_id = members.id LIMIT 1) AS id_perusahaan
|
||||
'),
|
||||
DB::raw('
|
||||
(Select corporates.code FROM corporates
|
||||
(Select corporates.code FROM corporates
|
||||
LEFT JOIN corporate_employees ON corporate_employees.corporate_id = corporates.id
|
||||
WHERE corporate_employees.member_id = members.id LIMIT 1) AS code_perusahaan
|
||||
'),
|
||||
@@ -624,12 +624,12 @@ class RequestLogController extends Controller
|
||||
(Select member_policies.status FROM member_policies WHERE member_policies.member_id = members.member_id LIMIT 1) AS status_polis
|
||||
'),
|
||||
DB::raw('
|
||||
(Select plans.code FROM member_plans
|
||||
(Select plans.code FROM member_plans
|
||||
LEFT JOIN plans ON plans.id = member_plans.plan_id
|
||||
WHERE member_plans.member_id = members.id AND plans.service_code = "'.$dataRequestLog->service_code.'" LIMIT 1) AS code_plan
|
||||
'),
|
||||
DB::raw('
|
||||
(Select plans.limit_rules FROM member_plans
|
||||
(Select plans.limit_rules FROM member_plans
|
||||
LEFT JOIN plans ON plans.id = member_plans.plan_id
|
||||
WHERE member_plans.member_id = members.id LIMIT 1) AS limit_rules
|
||||
'),
|
||||
@@ -638,9 +638,9 @@ class RequestLogController extends Controller
|
||||
'),
|
||||
'members.members_effective_date AS mulai',
|
||||
'members.members_expire_date AS akhir'
|
||||
)
|
||||
)
|
||||
->first();
|
||||
$data['namaKaryawan'] = '';
|
||||
$data['namaKaryawan'] = '';
|
||||
if($dataMember->principal_id)
|
||||
{
|
||||
$dataNamaKaryawan = DB::table('members')
|
||||
@@ -648,11 +648,11 @@ class RequestLogController extends Controller
|
||||
->select('members.name')
|
||||
->limit(1)
|
||||
->first();
|
||||
$data['namaKaryawan'] = $dataNamaKaryawan->name;
|
||||
$data['namaKaryawan'] = $dataNamaKaryawan->name;
|
||||
}
|
||||
else{
|
||||
$data['namaKaryawan'] = $dataMember->name;
|
||||
}
|
||||
}
|
||||
|
||||
$data['dataMember'] = $dataMember;
|
||||
|
||||
@@ -675,7 +675,7 @@ class RequestLogController extends Controller
|
||||
|
||||
$data['dataClaimLog'] = $dataClaimLog;
|
||||
|
||||
|
||||
|
||||
$dataRumahSakit = DB::table('organizations')
|
||||
->leftJoin('addresses', 'addresses.addressable_id', '=', 'organizations.id')
|
||||
->where('organizations.id', '=', $dataRequestLog->organization_id)
|
||||
@@ -715,7 +715,7 @@ class RequestLogController extends Controller
|
||||
->select(
|
||||
'files.path',
|
||||
DB::raw('
|
||||
(Select persons.name FROM users
|
||||
(Select persons.name FROM users
|
||||
LEFT JOIN persons ON users.person_id = persons.id
|
||||
WHERE users.id = "'.$dataRequestLog->approved_by.'" LIMIT 1) AS name_approve
|
||||
')
|
||||
@@ -734,7 +734,7 @@ class RequestLogController extends Controller
|
||||
|
||||
// Halaman 1
|
||||
$html1 = view('pdf.final_log_page_1', $data);
|
||||
|
||||
|
||||
// Halaman 2
|
||||
$html2 = view('pdf.final_log_page_2', $data);
|
||||
|
||||
@@ -743,10 +743,10 @@ class RequestLogController extends Controller
|
||||
|
||||
$pdf->loadHtml($htmlCombined);
|
||||
$pdf->render();
|
||||
|
||||
|
||||
$headers = [
|
||||
'Content-Type' => 'application/pdf',
|
||||
'Content-Disposition' => 'inline; filename="file.pdf"',
|
||||
'Content-Disposition' => 'inline; filename="file.pdf"',
|
||||
];
|
||||
|
||||
return response($pdf->output(), 200, $headers);
|
||||
|
||||
@@ -6,7 +6,6 @@ use App\Http\Controllers\Controller;
|
||||
use App\Models\User;
|
||||
use App\Models\Person;
|
||||
use Crypt;
|
||||
use Error;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
|
||||
@@ -456,12 +456,12 @@ class CorporateMemberController extends Controller
|
||||
|
||||
public function viewECard(Request $request, $member_id){
|
||||
$member = Member::with([
|
||||
'currentPlan',
|
||||
'currentPolicy',
|
||||
'currentCorporate',
|
||||
'currentCorporate.files',
|
||||
'currentPlan',
|
||||
'currentPolicy',
|
||||
'currentCorporate',
|
||||
'currentCorporate.files',
|
||||
// 'currentPlan.corporateBenefits.benefit'
|
||||
])->find($member_id);
|
||||
])->find($member_id);
|
||||
|
||||
if ($member->currentCorporate->id == 5){ // Vale
|
||||
$pdf = PDF::loadView('pdf.ecard', compact('member'))->setPaper('A5', 'portrait');
|
||||
|
||||
@@ -42,7 +42,7 @@ class DailyMonitoringController extends Controller
|
||||
->leftJoin('members', 'request_logs.member_id', '=', 'members.id')
|
||||
->leftJoin('member_plans', 'request_logs.member_id', '=', 'member_plans.member_id')
|
||||
->leftJoin('organizations', 'organizations.id', '=', 'request_logs.organization_id')
|
||||
->select('members.member_id','members.name','member_plans.start AS startdate','member_plans.end AS enddate', 'request_logs.submission_date as addmision_date', 'organizations.name as provider' )
|
||||
->select('members.member_id','members.name','members.members_effective_date AS startdate','members.members_expire_date AS enddate', 'request_logs.submission_date as addmision_date', 'organizations.name as provider' )
|
||||
->where('request_logs.service_code', 'IP')
|
||||
->where('request_logs.status_final_log', 'approved')
|
||||
->groupBy('request_logs.member_id')
|
||||
@@ -118,7 +118,7 @@ class DailyMonitoringController extends Controller
|
||||
public function AddDetailMonitoringList(Request $request, $claim_code)
|
||||
{
|
||||
$request->merge(['claim_code' => $claim_code]);
|
||||
|
||||
|
||||
// validation rule
|
||||
$validator = Validator::make($request->all(),[
|
||||
'claim_code' => 'required|exists:claim_requests,code',
|
||||
@@ -145,7 +145,7 @@ class DailyMonitoringController extends Controller
|
||||
->select('id')
|
||||
->where('code', $claim_code)
|
||||
->first();
|
||||
|
||||
|
||||
// get claim
|
||||
$claim = DB::table('claims')
|
||||
->select('id')
|
||||
@@ -219,7 +219,7 @@ class DailyMonitoringController extends Controller
|
||||
public function AddDetailMonitoringListRequestLog(Request $request, $request_code)
|
||||
{
|
||||
$request->merge(['request_code' => $request_code]);
|
||||
|
||||
|
||||
// validation rule
|
||||
$validator = Validator::make($request->all(),[
|
||||
'request_code' => 'required|exists:request_logs,code',
|
||||
@@ -319,7 +319,7 @@ class DailyMonitoringController extends Controller
|
||||
'extension' => $extension,
|
||||
'path' => $path,
|
||||
]);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
if ($request->medical_action_letter){
|
||||
@@ -337,7 +337,7 @@ class DailyMonitoringController extends Controller
|
||||
'extension' => $extension,
|
||||
'path' => $path,
|
||||
]);
|
||||
|
||||
|
||||
// $file->storeAs($this->path_for_store, $fileName);
|
||||
}
|
||||
}
|
||||
@@ -356,7 +356,7 @@ class DailyMonitoringController extends Controller
|
||||
'extension' => $extension,
|
||||
'path' => $path,
|
||||
]);
|
||||
|
||||
|
||||
// $file->storeAs($this->path_for_store, $fileName);
|
||||
}
|
||||
}
|
||||
@@ -389,10 +389,10 @@ class DailyMonitoringController extends Controller
|
||||
$request_log = DB::table('request_logs')
|
||||
->where('code', $request_code)
|
||||
->update([
|
||||
'discharge_date' => now(),
|
||||
'discharge_date' => now(),
|
||||
'updated_by' => auth()->user()->id,
|
||||
'updated_at' => now()
|
||||
]);
|
||||
]);
|
||||
if ($request_log) {
|
||||
return response()->json([
|
||||
'error' => false,
|
||||
|
||||
@@ -37,21 +37,26 @@ class PaymentController extends Controller
|
||||
&& !empty($request->appointment_start)
|
||||
&& !empty($request->appointment_end)
|
||||
) {
|
||||
$appointments = $appointments->whereHas('detail', function (Builder $detail) use ($request) {
|
||||
// $appointments = $appointments->whereHas('detail', function (Builder $detail) use ($request) {
|
||||
|
||||
// Appointment Start
|
||||
// if ($request->has('appointment_start')) {
|
||||
$detail->where('dCreateOn', '>=', $request->appointment_start);
|
||||
// } else {
|
||||
// $detail->where('dTanggalAppointment', '>', now()->format('Y-m-d'));
|
||||
// }
|
||||
// // Appointment Start
|
||||
// // if ($request->has('appointment_start')) {
|
||||
// $detail->where('dTanggalAppointment', '>=', $request->appointment_start);
|
||||
// // } else {
|
||||
// // $detail->where('dTanggalAppointment', '>', now()->format('Y-m-d'));
|
||||
// // }
|
||||
|
||||
// if ($request->has('appointment_end')) {
|
||||
$detail->where('dCreateOn', '<=', $request->appointment_end);
|
||||
// } else {
|
||||
// $detail->where('dTanggalAppointment', '<', now()->addDay(1)->format('Y-m-d'));
|
||||
// }
|
||||
// // if ($request->has('appointment_end')) {
|
||||
// $detail->where('dTanggalAppointment', '<=', $request->appointment_end);
|
||||
// // } else {
|
||||
// // $detail->where('dTanggalAppointment', '<', now()->addDay(1)->format('Y-m-d'));
|
||||
// // }
|
||||
|
||||
// });
|
||||
|
||||
$appointments = $appointments->where(function($q) use ($request) {
|
||||
$q->where('dCreateOn', '>=', $request->appointment_start)
|
||||
->where('dCreateOn', '<=', $request->appointment_end);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -109,8 +109,8 @@ class RequestLogController extends Controller
|
||||
|
||||
$memberValid = false;
|
||||
if ($member){
|
||||
if (($member->members_effective_date <= date('Y-m-d')) &&
|
||||
($member->members_expire_date >= date('Y-m-d')) &&
|
||||
if (($member->members_effective_date <= date('Y-m-d')) &&
|
||||
($member->members_expire_date >= date('Y-m-d')) &&
|
||||
($member->active == 1) &&
|
||||
($member->suspended == 'N')
|
||||
){
|
||||
@@ -128,12 +128,12 @@ class RequestLogController extends Controller
|
||||
organization_id: $request->organization_id,
|
||||
source: $request->source
|
||||
);
|
||||
|
||||
|
||||
DB::commit();
|
||||
}
|
||||
catch (\Throwable $th) {
|
||||
DB::rollBack();
|
||||
|
||||
|
||||
return Helper::responseJson(status: 'failed', statusCode: 500, message: $th->getMessage());
|
||||
}
|
||||
} else {
|
||||
@@ -150,18 +150,18 @@ class RequestLogController extends Controller
|
||||
organization_id: $request->organization_id,
|
||||
source: $request->source
|
||||
);
|
||||
|
||||
|
||||
DB::commit();
|
||||
}
|
||||
catch (\Throwable $th) {
|
||||
DB::rollBack();
|
||||
|
||||
|
||||
return Helper::responseJson(status: 'failed', statusCode: 500, message: $th->getMessage());
|
||||
}
|
||||
// return Helper::responseJson(status: 'failed', statusCode: 500, message: 'Member Not Valid');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return Helper::responseJson(status: 'success', statusCode: 200, message: 'Request LOG berhasil ajukan!', data: $request->toArray());
|
||||
@@ -187,7 +187,7 @@ class RequestLogController extends Controller
|
||||
// 'member.current_policy',
|
||||
'claim',
|
||||
'organization',
|
||||
|
||||
|
||||
]);
|
||||
|
||||
return Helper::responseJson(data: RequestLogShowResource::make($claimRequest));
|
||||
@@ -221,7 +221,12 @@ class RequestLogController extends Controller
|
||||
$requestLog->approved_by = auth()->user()->id;
|
||||
$requestLog->approved_at = Carbon::now();
|
||||
$requestLog->save();
|
||||
|
||||
|
||||
// update nirc member
|
||||
$member = Member::findOrFail($requestLog->member_id);
|
||||
$member->nric = $request->no_identitas;
|
||||
$member->save();
|
||||
|
||||
return response()->json([
|
||||
'error' => false,
|
||||
'message' => 'Update succses',
|
||||
@@ -252,7 +257,7 @@ class RequestLogController extends Controller
|
||||
'error' => true,
|
||||
'message' => 'LOG Belum Terverifikasi',
|
||||
'data' => $requestLog],
|
||||
200);
|
||||
200);
|
||||
}
|
||||
|
||||
$member = Member::findOrFail($requestLog->member_id)
|
||||
@@ -260,15 +265,15 @@ class RequestLogController extends Controller
|
||||
// 'currentPlan',
|
||||
'currentPlan' => function ($plan) use ($id, $service_code) {
|
||||
$plan->where('plans.service_code', $service_code);
|
||||
},
|
||||
'currentPolicy',
|
||||
'currentPlan.corporateBenefits',
|
||||
},
|
||||
'currentPolicy',
|
||||
'currentPlan.corporateBenefits',
|
||||
'currentPlan.corporateBenefits.benefit'
|
||||
]);
|
||||
|
||||
$pdf = PDF::loadView('pdf.guaranted_leter', compact('member', 'requestLog'));
|
||||
return $pdf->download('Guaranted Letter - '.$member->full_name.'.pdf');
|
||||
|
||||
|
||||
return $requestLog;
|
||||
}
|
||||
|
||||
@@ -282,7 +287,7 @@ class RequestLogController extends Controller
|
||||
$writer = WriterEntityFactory::createXLSXWriter();
|
||||
// Membuka penulis untuk menulis ke file
|
||||
$writer->openToFile(public_path('files/Data Request LOG.xlsx'));
|
||||
|
||||
|
||||
// Sheet 1
|
||||
$writer->getCurrentSheet()->setName('Data');
|
||||
$headers_map_to_table_fields = RequestLog::$listing_data_doc_headers;
|
||||
@@ -300,7 +305,7 @@ class RequestLogController extends Controller
|
||||
// dd($dataRequestLog);
|
||||
foreach ($dataRequestLog as $index => $row){
|
||||
$serviceType = $this->getServiceName($row['service_code']);
|
||||
|
||||
|
||||
$rowData = [
|
||||
$row['id'], // id
|
||||
$row['code'], // code
|
||||
@@ -455,7 +460,7 @@ class RequestLogController extends Controller
|
||||
|
||||
$file_name = now()->getPreciseTimestamp(3) . '-' . $request->file('file')->getClientOriginalName();
|
||||
$file = $request->file('file')->storeAs('temp', $file_name);
|
||||
|
||||
|
||||
$reader = ReaderEntityFactory::createXLSXReader(Storage::path('temp/' . $file_name));
|
||||
$reader->open(Storage::path('temp/' . $file_name));
|
||||
|
||||
@@ -683,7 +688,7 @@ class RequestLogController extends Controller
|
||||
->offset($offset)
|
||||
->limit($limit)
|
||||
->get();
|
||||
|
||||
|
||||
$data = [];
|
||||
if(count($memberList)>0){
|
||||
$temp = [];
|
||||
|
||||
@@ -2,18 +2,17 @@
|
||||
|
||||
namespace Modules\Internal\Transformers;
|
||||
|
||||
use App\Models\Benefit;
|
||||
use App\Models\Plan;
|
||||
use App\Models\CorporateBenefit;
|
||||
use App\Models\ClaimRequest;
|
||||
use App\Models\MemberPlan;
|
||||
use App\Models\CorporateService;
|
||||
use App\Models\RequestLogBenefit;
|
||||
use App\Models\RequestLogMedicine;
|
||||
use App\Models\Organization;
|
||||
use App\Models\MemberPlan;
|
||||
use App\Models\Plan;
|
||||
use App\Models\Exclusion;
|
||||
use App\Models\Icd;
|
||||
use App\Helpers\Helper;
|
||||
use App\Models\CorporatePolicy;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class RequestLogShowResource extends JsonResource
|
||||
@@ -26,11 +25,12 @@ class RequestLogShowResource extends JsonResource
|
||||
*/
|
||||
public function toArray($request)
|
||||
{
|
||||
|
||||
|
||||
$requestLog = parent::toArray($request);
|
||||
$corporateId = $requestLog['member']['current_plan']['corporate_id'] ?? 0;
|
||||
$member_id = $requestLog['member_id'];
|
||||
$planMember = MemberPlan::where('member_id', $member_id)->get('plan_id');
|
||||
|
||||
$planId = Plan::whereIn('id', $planMember)->where('service_code', $requestLog['service_code'])->first();
|
||||
$benefit = CorporateBenefit::with('benefit')->where('plan_id', $planId->id)->get()->toArray();
|
||||
$benefitDetailLog = RequestLogBenefit::with('benefit')->where('request_log_id', $requestLog['id'])->get()->toArray();
|
||||
@@ -58,6 +58,7 @@ class RequestLogShowResource extends JsonResource
|
||||
array_push($medicineData, $data);
|
||||
}
|
||||
}
|
||||
|
||||
// Service Rule
|
||||
$corporateService = CorporateService::query()
|
||||
->where('corporate_id', $corporateId)
|
||||
@@ -67,7 +68,7 @@ class RequestLogShowResource extends JsonResource
|
||||
$config = [];
|
||||
if ($corporateService) {
|
||||
$config = $corporateService->configs->pluck('value', 'name')->toArray();
|
||||
}
|
||||
}
|
||||
|
||||
// Exclusion Service or diagnosis
|
||||
$exclusions = Exclusion::query()
|
||||
@@ -76,15 +77,21 @@ class RequestLogShowResource extends JsonResource
|
||||
->with(['exclusionable', 'rules'])
|
||||
->get()->toArray();
|
||||
|
||||
// Policy Number
|
||||
$policyNumber = CorporatePolicy::query()
|
||||
->where('corporate_id', $corporateId)
|
||||
->first();
|
||||
|
||||
|
||||
$data = [
|
||||
'id' => $requestLog['id'],
|
||||
'code' => $requestLog['code'],
|
||||
'member_id' => $requestLog['member']['member_id'],
|
||||
'policy_number' => $requestLog['member']['current_policy']['code'],
|
||||
'policy_number' =>$policyNumber->code ? $policyNumber->code : '-',
|
||||
'name' => $requestLog['member']['name'],
|
||||
'date_of_birth' => $requestLog['member']['birth_date'],
|
||||
'gender' => $requestLog['member']['gender'],
|
||||
'marital_status' => Helper::maritalNormalization($requestLog['member']['marital_status']),
|
||||
'marital_status' => $requestLog['member']['status_marital'],
|
||||
'member_type' => Helper::memberType($requestLog['member']['record_type']),
|
||||
'principal_id' => $requestLog['member']['principal_id'] ? $requestLog['member']['principal_id'] : '-',
|
||||
'principal_name' => $requestLog['member']['principal_id'] ? Helper::principalName($requestLog['member']['principal_id']) : '-',
|
||||
@@ -101,13 +108,12 @@ class RequestLogShowResource extends JsonResource
|
||||
'medicine' => $medicineData,
|
||||
'files' => $requestLog['files'],
|
||||
'provider' => $providerName,
|
||||
|
||||
'no_identitas' => $requestLog['member']['nric'],
|
||||
'keterangan' => $requestLog['keterangan'],
|
||||
'hak_kamar_pasien' => $requestLog['hak_kamar_pasien'],
|
||||
'penempatan_kamar' => $requestLog['penempatan_kamar'],
|
||||
'catatan' => $requestLog['catatan'],
|
||||
|
||||
|
||||
|
||||
];
|
||||
|
||||
|
||||
@@ -13,18 +13,19 @@ use App\Models\Service;
|
||||
|
||||
class Helper
|
||||
{
|
||||
public static function genderNormalization($anyGenderCode)
|
||||
public static function genderNormalization($anyGenderCode = '-')
|
||||
{
|
||||
|
||||
if ($anyGenderCode == 'M') {
|
||||
return 'Male';
|
||||
return 'male';
|
||||
} else if ($anyGenderCode == 'F') {
|
||||
return 'Female';
|
||||
return 'female';
|
||||
} else if ($anyGenderCode == 'O') {
|
||||
return 'Others';
|
||||
return 'others';
|
||||
} else if ($anyGenderCode == 'U') {
|
||||
return 'Unknown';
|
||||
return 'unknown';
|
||||
} else {
|
||||
return null;
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,11 +53,12 @@ class Helper
|
||||
} else if ($anyGenderCode == 'U') {
|
||||
return 'unknown';
|
||||
} else {
|
||||
return null;
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
|
||||
public static function memberType($code){
|
||||
public static function memberType($code)
|
||||
{
|
||||
if ($code == 'P') {
|
||||
return 'Principal';
|
||||
} else if ($code == 'D') {
|
||||
@@ -66,30 +68,29 @@ class Helper
|
||||
}
|
||||
}
|
||||
|
||||
public static function relationWithPrincipal($code){
|
||||
public static function relationWithPrincipal($code)
|
||||
{
|
||||
if ($code == 'H') {
|
||||
return 'Husbund';
|
||||
}
|
||||
else if ($code == 'W') {
|
||||
} else if ($code == 'W') {
|
||||
return 'Wife';
|
||||
}
|
||||
else if ($code == 'S') {
|
||||
} else if ($code == 'S') {
|
||||
return 'Son';
|
||||
}
|
||||
else if ($code == 'D') {
|
||||
} else if ($code == 'D') {
|
||||
return 'Daughter';
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
'-';
|
||||
}
|
||||
}
|
||||
|
||||
public static function principalName($code){
|
||||
public static function principalName($code)
|
||||
{
|
||||
$principalName = Member::where('member_id', $code)->get()->first();
|
||||
return $principalName->name;
|
||||
}
|
||||
|
||||
public static function serviceName($code){
|
||||
public static function serviceName($code)
|
||||
{
|
||||
$serviceName = Service::where('code', $code)->get()->first();
|
||||
return $serviceName->name;
|
||||
}
|
||||
@@ -240,10 +241,11 @@ class Helper
|
||||
], $statusCode);
|
||||
}
|
||||
|
||||
public static function validatePhoneNumber($phoneNumber) {
|
||||
public static function validatePhoneNumber($phoneNumber)
|
||||
{
|
||||
// Menghapus semua karakter selain angka dan +
|
||||
$cleanedNumber = preg_replace('/[^0-9+]/', '', $phoneNumber);
|
||||
|
||||
|
||||
// Memeriksa apakah nomor telepon hanya terdiri dari angka dan +
|
||||
if ($cleanedNumber == $phoneNumber) {
|
||||
// Nomor telepon valid
|
||||
@@ -254,11 +256,13 @@ class Helper
|
||||
}
|
||||
}
|
||||
|
||||
public static function formatRupiah($angka) {
|
||||
public static function formatRupiah($angka)
|
||||
{
|
||||
return "Rp " . number_format($angka, 0, ',', '.');
|
||||
}
|
||||
|
||||
public static function sPaymentMethod($id) {
|
||||
public static function sPaymentMethod($id)
|
||||
{
|
||||
$sPaymentMethod = [
|
||||
1 => 'Pribadi',
|
||||
2 => 'On-Site Payment',
|
||||
@@ -267,17 +271,19 @@ class Helper
|
||||
5 => 'Voucher',
|
||||
6 => 'ASO'
|
||||
];
|
||||
|
||||
|
||||
return $sPaymentMethod[$id];
|
||||
}
|
||||
|
||||
public static function formatDateDB($date){
|
||||
public static function formatDateDB($date)
|
||||
{
|
||||
$convertedDate = Carbon::createFromFormat('d-m-Y', $date)->format('Y-m-d H:i:s');
|
||||
return $convertedDate;
|
||||
}
|
||||
|
||||
|
||||
public static function formatDateOnly($date){
|
||||
public static function formatDateOnly($date)
|
||||
{
|
||||
// Membuat objek Carbon dengan tanggal asli dan zona waktu UTC
|
||||
$carbonDate = Carbon::createFromFormat('Y-m-d\TH:i:s.u\Z', $date, 'UTC');
|
||||
|
||||
@@ -288,7 +294,8 @@ class Helper
|
||||
return $convertedDate;
|
||||
}
|
||||
|
||||
public static function formatTimeOnly($date){
|
||||
public static function formatTimeOnly($date)
|
||||
{
|
||||
// Membuat objek Carbon dengan tanggal asli dan zona waktu UTC
|
||||
$carbonDate = Carbon::createFromFormat('Y-m-d\TH:i:s.u\Z', $date, 'UTC');
|
||||
|
||||
@@ -306,8 +313,7 @@ class Helper
|
||||
DB::table('notifications')->insert($data);
|
||||
DB::commit();
|
||||
return true;
|
||||
}
|
||||
catch (\Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
DB::rollback();
|
||||
return $e->getMessage();
|
||||
}
|
||||
@@ -319,28 +325,27 @@ class Helper
|
||||
$mail = new PHPMailer(true);
|
||||
try {
|
||||
// Server settings
|
||||
$mail->isSMTP();
|
||||
$mail->Host = 'smtp.gmail.com';
|
||||
$mail->SMTPAuth = true;
|
||||
$mail->Username = env('EMAIL');
|
||||
$mail->Password = env('PW_EMAIL');
|
||||
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
|
||||
$mail->Port = 465;
|
||||
$mail->SMTPSecure = "ssl";
|
||||
$mail->isSMTP();
|
||||
$mail->Host = 'smtp.gmail.com';
|
||||
$mail->SMTPAuth = true;
|
||||
$mail->Username = env('EMAIL');
|
||||
$mail->Password = env('PW_EMAIL');
|
||||
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
|
||||
$mail->Port = 465;
|
||||
$mail->SMTPSecure = "ssl";
|
||||
|
||||
// Penerima email
|
||||
$mail->setFrom(env('EMAIL'), env('NAME_EMAIL'));
|
||||
$mail->addAddress($data['email'], $data['name']);
|
||||
|
||||
// Konten email
|
||||
$mail->isHTML(true);
|
||||
$mail->isHTML(true);
|
||||
$mail->Subject = $data['subject'];
|
||||
$mail->Body = $data['body'];
|
||||
|
||||
// Kirim email
|
||||
$mail->send();
|
||||
return true;
|
||||
|
||||
} catch (\Exception $e) {
|
||||
dd($e);
|
||||
return ($mail->ErrorInfo);
|
||||
@@ -354,21 +359,21 @@ class Helper
|
||||
$mail = new PHPMailer(true);
|
||||
try {
|
||||
// Server settings
|
||||
$mail->isSMTP();
|
||||
$mail->Host = 'smtp.gmail.com';
|
||||
$mail->SMTPAuth = true;
|
||||
$mail->Username = env('EMAIL');
|
||||
$mail->Password = env('PW_EMAIL');
|
||||
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
|
||||
$mail->Port = 465;
|
||||
$mail->SMTPSecure = "ssl";
|
||||
$mail->isSMTP();
|
||||
$mail->Host = 'smtp.gmail.com';
|
||||
$mail->SMTPAuth = true;
|
||||
$mail->Username = env('EMAIL');
|
||||
$mail->Password = env('PW_EMAIL');
|
||||
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
|
||||
$mail->Port = 465;
|
||||
$mail->SMTPSecure = "ssl";
|
||||
|
||||
// Penerima email
|
||||
$mail->setFrom(env('EMAIL'), env('NAME_EMAIL'));
|
||||
$mail->addAddress($data['email'], $data['name']);
|
||||
|
||||
// Konten email
|
||||
$mail->isHTML(true);
|
||||
$mail->isHTML(true);
|
||||
$mail->Subject = $data['subject'];
|
||||
$mail->Body = $data['body'];
|
||||
$mail->addAttachment($data['attach'], 'e-card.pdf');
|
||||
@@ -376,7 +381,6 @@ class Helper
|
||||
// Kirim email
|
||||
$mail->send();
|
||||
return true;
|
||||
|
||||
} catch (\Exception $e) {
|
||||
dd($mail->ErrorInfo);
|
||||
return ($mail->ErrorInfo);
|
||||
@@ -389,7 +393,8 @@ class Helper
|
||||
ini_set('max_execution_time', '-1'); // Waktu untuk execution suatu function atau script
|
||||
ini_set('post_max_size', '32M'); // Batas post Yang di Upload
|
||||
ini_set('upload_max_filesize', '10M'); // Batas File yang di Upload
|
||||
ini_set('max_input_time ', '-1'); // Batas max time menunggu input max 5 menit
|
||||
ini_set('max_input_time ', '-1'); // Batas max time menunggu input max 5 menit
|
||||
ini_set('memory_limit', '256M');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -59,14 +59,14 @@ class Member extends Model
|
||||
"endorsement_date",
|
||||
"members_effective_date",
|
||||
"members_expire_date",
|
||||
"employee_status",
|
||||
"activation_date",
|
||||
"terminated_date",
|
||||
"remarks",
|
||||
"policy_in_force",
|
||||
"start_no_claim",
|
||||
"end_no_claim",
|
||||
"suspended"
|
||||
"suspended",
|
||||
"active",
|
||||
];
|
||||
|
||||
protected $appends = [
|
||||
@@ -98,7 +98,7 @@ class Member extends Model
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* relationship */
|
||||
/* Relationship */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
public function claims()
|
||||
{
|
||||
@@ -158,36 +158,18 @@ class Member extends Model
|
||||
public function currentPlans()
|
||||
{
|
||||
return $this->hasManyThrough(Plan::class, MemberPlan::class, 'member_id', 'id', 'id', 'plan_id');
|
||||
// ->latest(); // TODO Fix This
|
||||
}
|
||||
|
||||
public function currentPlan()
|
||||
{
|
||||
return $this->hasOneThrough(Plan::class, MemberPlan::class, 'member_id', 'id', 'id', 'plan_id', )
|
||||
->latest();
|
||||
// ->where('plans.service_code', $this->claimRequest->service_code); // TODO Fix This
|
||||
return $this->hasOneThrough(Plan::class, MemberPlan::class, 'member_id', 'id', 'id', 'plan_id',)
|
||||
->latest();
|
||||
}
|
||||
|
||||
// public function currentPlan()
|
||||
// {
|
||||
// return $this->hasOneThrough(
|
||||
// Plan::class,
|
||||
// MemberPlan::class,
|
||||
// 'member_id',
|
||||
// 'id',
|
||||
// 'id',
|
||||
// 'plan_id'
|
||||
// )
|
||||
// ->join('claim_requests', 'claim_requests.service_code', '=', 'plans.service_code')
|
||||
// ->latest('claim_requests.created_at') // Atau sesuaikan dengan kolom timestamp yang sesuai
|
||||
// ->select('plans.*');
|
||||
// }
|
||||
|
||||
|
||||
public function currentEmployeds()
|
||||
{
|
||||
return $this->hasOneThrough(CorporateEmployee::class, Person::class, 'nik', 'id', 'id', 'nik')
|
||||
->latest(); // TODO Fix This
|
||||
->latest();
|
||||
}
|
||||
|
||||
public function policies()
|
||||
@@ -200,7 +182,6 @@ class Member extends Model
|
||||
return $this->hasOneThrough(CorporatePolicy::class, MemberPolicy::class, 'member_id', 'code', 'member_id', 'policy_id')
|
||||
->where('status', 'active')
|
||||
->orderBy('end', 'DESC');
|
||||
// return $this->hasOne(MemberPolicy::class, 'member_id', 'member_id')->where('status', 'active')->latestOfMany();
|
||||
}
|
||||
|
||||
public function currentActivePolicy()
|
||||
@@ -216,6 +197,11 @@ class Member extends Model
|
||||
{
|
||||
return $this->hasOneThrough(CorporateDivision::class, CorporateEmployee::class, 'member_id', 'id', 'id', 'division_id');
|
||||
}
|
||||
|
||||
public function requestLogs()
|
||||
{
|
||||
return $this->hasMany(RequestLog::class);
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
@@ -232,18 +218,30 @@ class Member extends Model
|
||||
{
|
||||
$arr = [];
|
||||
|
||||
if (!empty($this->person->name_prefix)) {
|
||||
$arr[] = $this->person->name_prefix;
|
||||
}
|
||||
if ($this->relationLoaded('person')) {
|
||||
if (!empty($this->person->name_prefix)) {
|
||||
$arr[] = $this->person->name_prefix;
|
||||
}
|
||||
|
||||
$arr[] = $this->person->name;
|
||||
$arr[] = $this->person->name;
|
||||
|
||||
if (!empty($this->person->name_suffix)) {
|
||||
$arr[] = $this->person->name_suffix;
|
||||
if (!empty($this->person->name_suffix)) {
|
||||
$arr[] = $this->person->name_suffix;
|
||||
}
|
||||
} else {
|
||||
if (!empty($this->name_prefix)) {
|
||||
$arr[] = $this->name_prefix;
|
||||
}
|
||||
|
||||
$arr[] = $this->name;
|
||||
|
||||
if (!empty($this->name_suffix)) {
|
||||
$arr[] = $this->name_suffix;
|
||||
}
|
||||
}
|
||||
|
||||
return Attribute::make(
|
||||
get: fn () => !$this->person ? null : implode(' ', $arr)
|
||||
get: fn () => $arr ? ucwords(strtolower(implode(' ', $arr))) : null
|
||||
);
|
||||
}
|
||||
|
||||
@@ -254,10 +252,22 @@ class Member extends Model
|
||||
);
|
||||
}
|
||||
|
||||
protected function name(): Attribute
|
||||
protected function relationship(): Attribute
|
||||
{
|
||||
$relation = null;
|
||||
|
||||
if ($this->relation_with_principal === 'S') {
|
||||
$relation = 'Son';
|
||||
} elseif ($this->relation_with_principal === 'H') {
|
||||
$relation = 'Husband';
|
||||
} elseif ($this->relation_with_principal === 'D') {
|
||||
$relation = 'Daughter';
|
||||
} elseif ($this->relation_with_principal === 'Wife') {
|
||||
$relation = 'Wife';
|
||||
}
|
||||
|
||||
return Attribute::make(
|
||||
get: fn () => $this->person->name ?? ($this->name ?? null)
|
||||
get: fn () => $relation
|
||||
);
|
||||
}
|
||||
|
||||
@@ -265,32 +275,32 @@ class Member extends Model
|
||||
protected function relations(): Attribute
|
||||
{
|
||||
$relation = '-';
|
||||
if ($this->relation_with_principal == 'H'){
|
||||
if ($this->relation_with_principal == 'H') {
|
||||
$relation = 'Husbund';
|
||||
} else if ($this->relation_with_principal == 'W'){
|
||||
} else if ($this->relation_with_principal == 'W') {
|
||||
$relation = 'Wife';
|
||||
} else if ($this->relation_with_principal == 'S'){
|
||||
} else if ($this->relation_with_principal == 'S') {
|
||||
$relation = 'Son';
|
||||
} else if ($this->relation_with_principal == 'D'){
|
||||
} else if ($this->relation_with_principal == 'D') {
|
||||
$relation = 'Daughter';
|
||||
}
|
||||
}
|
||||
return Attribute::make(
|
||||
get: fn () => $relation
|
||||
get: fn () => $relation
|
||||
);
|
||||
}
|
||||
|
||||
protected function statusMarital(): Attribute
|
||||
{
|
||||
$maritalStatus = '-';
|
||||
if ($this->marital_status == 'M'){
|
||||
if ($this->marital_status == 'M') {
|
||||
$maritalStatus = 'Married';
|
||||
} else if ($this->relation_with_principal == 'D'){
|
||||
} else if ($this->relation_with_principal == 'D') {
|
||||
$maritalStatus = 'Divorced';
|
||||
} else if ($this->relation_with_principal == 'S'){
|
||||
$maritalStatus = 'Sungle';
|
||||
}
|
||||
} else if ($this->relation_with_principal == 'S') {
|
||||
$maritalStatus = 'Single';
|
||||
}
|
||||
return Attribute::make(
|
||||
get: fn () => $maritalStatus
|
||||
get: fn () => $maritalStatus
|
||||
);
|
||||
}
|
||||
|
||||
@@ -306,12 +316,12 @@ class Member extends Model
|
||||
protected function birthDateeCard(): Attribute
|
||||
{
|
||||
// $date = $this->person->birth_date ?? ($this->birth_date ?? null);
|
||||
if ($this->birth_date){
|
||||
if ($this->birth_date) {
|
||||
$date = $this->birth_date;
|
||||
return Attribute::make(
|
||||
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(
|
||||
get: fn () => !empty($date) ? Carbon::parse($date)->format('d / M / Y') : null
|
||||
);
|
||||
@@ -322,9 +332,28 @@ class Member extends Model
|
||||
}
|
||||
}
|
||||
|
||||
protected function birthDateCard(): Attribute
|
||||
{
|
||||
$date = $this->birth_date;
|
||||
|
||||
if ($date) {
|
||||
return Attribute::make(
|
||||
get: fn () => !empty($date) ? Carbon::parse($date)->format('d / M / Y') : '-'
|
||||
);
|
||||
} else if ($this->relationLoaded('person')) {
|
||||
$date = $this->person->birth_date;
|
||||
return Attribute::make(
|
||||
get: fn () => !empty($date) ? Carbon::parse($date)->format('d / M / Y') : '-'
|
||||
);
|
||||
} else {
|
||||
return Attribute::make(
|
||||
get: fn () => '-'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
protected function startDate(): Attribute
|
||||
{
|
||||
// $date = $this->person->birth_date ?? ($this->birth_date ?? null);
|
||||
$date = $this->members_effective_date;
|
||||
return Attribute::make(
|
||||
get: fn () => !empty($date) ? Carbon::parse($date)->format('d / M / Y') : null
|
||||
@@ -333,7 +362,6 @@ class Member extends Model
|
||||
|
||||
protected function endDate(): Attribute
|
||||
{
|
||||
// $date = $this->person->birth_date ?? ($this->birth_date ?? null);
|
||||
$date = $this->members_expire_date;
|
||||
return Attribute::make(
|
||||
get: fn () => !empty($date) ? Carbon::parse($date)->format('d / M / Y') : null
|
||||
@@ -366,19 +394,22 @@ class Member extends Model
|
||||
// );
|
||||
// }
|
||||
|
||||
protected function corporateLogo(): Attribute
|
||||
{
|
||||
$avatar = File::where(['type' => 'avatar', 'fileable_id' => $this->currentPolicy->corporate->id])->orderBy('id', 'desc')->get()->first();
|
||||
if ($avatar){
|
||||
$path = $_ENV['LMS_APP_STORAGE'] . $avatar->path ? $avatar->path :'';
|
||||
return Attribute::make(
|
||||
get: fn () => $avatar ? $path : null
|
||||
);
|
||||
} else {
|
||||
return Attribute::make(
|
||||
get: fn () => null
|
||||
);
|
||||
}
|
||||
}
|
||||
// protected function corporateLogo(): Attribute
|
||||
// {
|
||||
// $avatar = null;
|
||||
|
||||
// if ($this->relationLoaded('currentPolicy')) {
|
||||
// $corporateId = $this->currentPolicy->corporate->id;
|
||||
// $avatar = File::where(['type' => 'avatar', 'fileable_id' => $corporateId])
|
||||
// ->orderBy('id', 'desc')
|
||||
// ->first();
|
||||
// }
|
||||
|
||||
// $path = $avatar ? $_ENV['LMS_APP_STORAGE'] . $avatar->path : '';
|
||||
|
||||
// return Attribute::make(
|
||||
// get: fn () => $path
|
||||
// );
|
||||
// }
|
||||
/* -------------------------------------------------------------------------- */
|
||||
}
|
||||
|
||||
@@ -172,4 +172,8 @@ class Appointment extends Model
|
||||
{
|
||||
return $this->belongsTo(Healthcare::class, 'nIDHealthCare', 'nID');
|
||||
}
|
||||
|
||||
public function consulPrice(){
|
||||
return $this->hasOne(JadwalDokter::class, 'nIDDokter', 'nIDDokter');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ class Person extends Model
|
||||
'updated_by',
|
||||
'deleted_by'
|
||||
];
|
||||
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
@@ -126,6 +126,11 @@ class Person extends Model
|
||||
return $this->morphMany(AppointmentParticipant::class, 'participantable');
|
||||
}
|
||||
|
||||
public function member()
|
||||
{
|
||||
return $this->hasOne(Member::class);
|
||||
}
|
||||
|
||||
public function setGenderAttribute($value)
|
||||
{
|
||||
if ($value == "M" || $value == "L") {
|
||||
@@ -139,7 +144,6 @@ class Person extends Model
|
||||
|
||||
public function getGenderAttribute()
|
||||
{
|
||||
|
||||
if ($this->attributes['gender'] == "male" || $this->attributes['gender'] == "L") {
|
||||
return "male";
|
||||
} else if ($this->attributes['gender'] == "female" || $this->attributes['gender'] == "P") {
|
||||
@@ -148,9 +152,4 @@ class Person extends Model
|
||||
return "other";
|
||||
}
|
||||
}
|
||||
|
||||
public function updatePerson()
|
||||
{
|
||||
$this -> update ( $data );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ class RequestLog extends Model
|
||||
'penempatan_kamar',
|
||||
'catatan',
|
||||
'import_system',
|
||||
'diagnosis',
|
||||
'code',
|
||||
'approved_by',
|
||||
'approved_at',
|
||||
@@ -51,7 +52,7 @@ class RequestLog extends Model
|
||||
'deleted_by',
|
||||
];
|
||||
|
||||
public static $doc_headers_to_field_map = [
|
||||
public static $doc_headers_to_field_map = [
|
||||
"Date Of Request" => "submission_date",
|
||||
"Date Addmission" => "submission_date",
|
||||
"Member ID Peserta" => "member_id",
|
||||
@@ -65,7 +66,7 @@ class RequestLog extends Model
|
||||
"Total Billing" => "total_billing",
|
||||
"Amount Approval" => "amount_approval",
|
||||
"Amount Not Approval" => "amount_not_approval",
|
||||
"QC 1" => "status_final_log",
|
||||
"QC 1" => "status_final_log",
|
||||
];
|
||||
|
||||
public static $listing_doc_headers = [
|
||||
@@ -82,7 +83,7 @@ class RequestLog extends Model
|
||||
"Total Billing",
|
||||
"Amount Approval",
|
||||
"Amount Not Approval",
|
||||
"QC 1",
|
||||
"QC 1",
|
||||
];
|
||||
|
||||
public static $listing_data_doc_headers = [
|
||||
@@ -94,7 +95,7 @@ class RequestLog extends Model
|
||||
"CLAIM METHOD",
|
||||
"STATUS",
|
||||
];
|
||||
|
||||
|
||||
|
||||
public static $status = [
|
||||
'draft' => 'Draft',
|
||||
@@ -241,6 +242,16 @@ class RequestLog extends Model
|
||||
return $this->belongsTo(Service::class, 'service_code', 'code');
|
||||
}
|
||||
|
||||
public function requestLogBenefits()
|
||||
{
|
||||
return $this->hasMany(RequestLogBenefit::class, 'request_log_id');
|
||||
}
|
||||
|
||||
public function requestLogDailyMonitorings()
|
||||
{
|
||||
return $this->hasMany(RequestLogDailyMonitoring::class, 'request_log_id');
|
||||
}
|
||||
|
||||
public function getPaymentTypeNameAttribute()
|
||||
{
|
||||
return self::$payment_types[$this->payment_type] ?? $this->payment_type;
|
||||
|
||||
@@ -24,7 +24,13 @@ class RequestLogBenefit extends Model
|
||||
'deleted_by',
|
||||
];
|
||||
|
||||
public function benefit(){
|
||||
public function benefit()
|
||||
{
|
||||
return $this->belongsTo(Benefit::class, 'benefit_id', 'id');
|
||||
}
|
||||
|
||||
public function requestLog()
|
||||
{
|
||||
return $this->belongsTo(RequestLog::class);
|
||||
}
|
||||
}
|
||||
|
||||
31
app/Models/RequestLogDailyMonitoring.php
Normal file
31
app/Models/RequestLogDailyMonitoring.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
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);
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
protected function code(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn ($value, $attributes) => 'RE-' . str_pad($attributes['id'], 3, '0', STR_PAD_LEFT),
|
||||
);
|
||||
}
|
||||
}
|
||||
18
app/Models/RequestLogMedicalPlan.php
Normal file
18
app/Models/RequestLogMedicalPlan.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class RequestLogMedicalPlan extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'request_log_medical_plan';
|
||||
|
||||
public function requestLogDailyMonitoring()
|
||||
{
|
||||
return $this->belongsTo(RequestLogDailyMonitoring::class);
|
||||
}
|
||||
}
|
||||
@@ -48,7 +48,7 @@ class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
Schema::defaultStringLength(191);
|
||||
|
||||
Str::macro('initials', fn($value, $sep = ' ', $glue = '') => trim(collect(explode($sep, $value))->map(function ($segment) {
|
||||
Str::macro('initials', fn ($value, $sep = ' ', $glue = '') => trim(collect(explode($sep, $value))->map(function ($segment) {
|
||||
return $segment[0] ?? '';
|
||||
})->join($glue)));
|
||||
|
||||
@@ -87,7 +87,7 @@ class AppServiceProvider extends ServiceProvider
|
||||
|
||||
//Hospital
|
||||
CorporateHospital::updated(function ($model) {
|
||||
|
||||
|
||||
$this->logAuditTrail($model, 'updated');
|
||||
});
|
||||
|
||||
@@ -179,8 +179,6 @@ class AppServiceProvider extends ServiceProvider
|
||||
});
|
||||
|
||||
Sanctum::usePersonalAccessTokenModel(PersonalAccessToken::class);
|
||||
|
||||
|
||||
}
|
||||
|
||||
private function logAuditTrail($model, $action)
|
||||
|
||||
@@ -2,8 +2,10 @@
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Models\CorporateEmployee;
|
||||
use App\Models\Member;
|
||||
use App\Models\Encounter;
|
||||
use App\Models\RequestLog;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
@@ -13,34 +15,42 @@ class CorporateMemberService
|
||||
public function getAllMemberDashboards(int $corporateId, Request $request)
|
||||
{
|
||||
$limit = $request->has('perPage') ? $request->input('perPage') : 10;
|
||||
return Member::query()
|
||||
->joinCorporateEmployees('left')
|
||||
->joinCorporateDivisions('left')
|
||||
->with(['currentPlan', 'person'])
|
||||
->where('corporate_employees.corporate_id', $corporateId)
|
||||
->when($request->input('search'), function (Builder $query, $search) {
|
||||
$query->where(function (Builder $query) use ($search) {
|
||||
$query->orWhere('members.member_id', 'like', "%" . $search . "%")
|
||||
->orWhere('members.name', 'like', "%" . $search . "%");
|
||||
$memberIds = CorporateEmployee::where('corporate_id', $corporateId)
|
||||
->when($request->input('division'), function ($query, $value) {
|
||||
$query->where('division_id', $value);
|
||||
})
|
||||
->pluck('member_id');
|
||||
return Member::with(['person'])
|
||||
->whereIn('id', $memberIds)
|
||||
->when($request->input('search'), function ($query, $search) {
|
||||
$query->where(function ($query) use ($search) {
|
||||
$query->orWhere('member_id', 'like', "%" . $search . "%")
|
||||
->orWhere('name', 'like', "%" . $search . "%");
|
||||
});
|
||||
})
|
||||
->when($request->input('division'), function (Builder $query, $value) {
|
||||
$query->where('corporate_employees.division_id', $value);
|
||||
})
|
||||
->when($request->has('orderBy'), function (Builder $query) use ($request) {
|
||||
->when($request->has('orderBy'), function ($query) use ($request) {
|
||||
$orderBy = match ($request->input('orderBy')) {
|
||||
'memberId' => 'member_id',
|
||||
'fullName' => 'name',
|
||||
'status' => 'active',
|
||||
'division' => 'corporate_divisions.name',
|
||||
default => ''
|
||||
default => null,
|
||||
};
|
||||
if ($request->order) {
|
||||
$query->getQuery()->orderBy($orderBy, $request->order);
|
||||
if ($orderBy !== null && $request->order) {
|
||||
$query->orderBy($orderBy, $request->order);
|
||||
}
|
||||
})
|
||||
->select(['members.id', 'members.person_id', 'members.member_id', 'members.name', 'corporate_divisions.name AS division_name', 'members.active'])
|
||||
->selectRaw("(select sum(`claims`.`total_claim`) from `claims` where `members`.`id` = `claims`.`member_id` AND `claims`.`deleted_at` IS NULL) AS `claims_sum_total_claim`")
|
||||
->select([
|
||||
'id',
|
||||
'person_id',
|
||||
'member_id',
|
||||
'name',
|
||||
'active',
|
||||
])
|
||||
->withCount([
|
||||
'claims as claims_sum_total_claim' => function ($query) {
|
||||
$query->select(DB::raw('COALESCE(SUM(total_claim), 0)'))->whereNull('deleted_at');
|
||||
},
|
||||
])
|
||||
->paginate($limit);
|
||||
}
|
||||
|
||||
@@ -49,41 +59,48 @@ class CorporateMemberService
|
||||
$limit = $request->has('per_page') ? $request->input('per_page') : 10;
|
||||
|
||||
$results = DB::table('claim_requests')
|
||||
->leftJoin('claims', 'claim_requests.id', '=', 'claims.claim_request_id')
|
||||
->leftJoin('members', 'claim_requests.member_id', '=', 'members.id')
|
||||
->leftJoin('corporate_employees', 'members.id', '=', 'corporate_employees.member_id')
|
||||
->leftJoin('corporate_divisions', 'corporate_employees.division_id', '=', 'corporate_divisions.id')
|
||||
->where('corporate_employees.corporate_id', '=', $corporateId)
|
||||
->when($request->input('search'), function ($query, $search) {
|
||||
$query->where(function ($query) use ($search) {
|
||||
$query->orWhere('claim_requests.code', 'like', "%" . $search . "%")
|
||||
->orWhere('members.member_id', 'like', "%" . $search . "%")
|
||||
->orWhere('members.name', 'like', "%" . $search . "%")
|
||||
->orWhere('corporate_divisions.name', 'like', "%" . $search . "%")
|
||||
->orWhere('claim_requests.status', 'like', "%" . $search . "%")
|
||||
->orWhere('claim_requests.submission_date', 'like', "%" . $search . "%");
|
||||
});
|
||||
})
|
||||
->when($request->has('orderBy'), function ($query) use ($request) {
|
||||
$orderBy = $request->orderBy;
|
||||
$direction = $request->order ?? 'asc';
|
||||
->leftJoin('claims', 'claim_requests.id', '=', 'claims.claim_request_id')
|
||||
->leftJoin('members', 'claim_requests.member_id', '=', 'members.id')
|
||||
->leftJoin('corporate_employees', 'members.id', '=', 'corporate_employees.member_id')
|
||||
->leftJoin('corporate_divisions', 'corporate_employees.division_id', '=', 'corporate_divisions.id')
|
||||
->where('corporate_employees.corporate_id', '=', $corporateId)
|
||||
->when($request->input('search'), function ($query, $search) {
|
||||
$query->where(function ($query) use ($search) {
|
||||
$query->orWhere('claim_requests.code', 'like', "%" . $search . "%")
|
||||
->orWhere('members.member_id', 'like', "%" . $search . "%")
|
||||
->orWhere('members.name', 'like', "%" . $search . "%")
|
||||
->orWhere('corporate_divisions.name', 'like', "%" . $search . "%")
|
||||
->orWhere('claim_requests.status', 'like', "%" . $search . "%")
|
||||
->orWhere('claim_requests.submission_date', 'like', "%" . $search . "%");
|
||||
});
|
||||
})
|
||||
->when($request->has('orderBy'), function ($query) use ($request) {
|
||||
$orderBy = $request->orderBy;
|
||||
$direction = $request->order ?? 'asc';
|
||||
|
||||
$query->orderBy($orderBy, $direction);
|
||||
})
|
||||
->select('members.id', 'claim_requests.code','members.member_id', 'members.name as full_name', 'corporate_divisions.name AS division_name',
|
||||
DB::raw('
|
||||
CASE
|
||||
$query->orderBy($orderBy, $direction);
|
||||
})
|
||||
->select(
|
||||
'members.id',
|
||||
'claim_requests.code',
|
||||
'members.member_id',
|
||||
'members.name as full_name',
|
||||
'corporate_divisions.name AS division_name',
|
||||
DB::raw('
|
||||
CASE
|
||||
WHEN claim_requests.status = "requested" THEN "requested"
|
||||
WHEN claim_requests.status = "approved" AND claims.status = "approved" THEN "approved"
|
||||
WHEN claim_requests.status = "approved" AND claims.status = "declined" THEN "declined"
|
||||
WHEN claim_requests.status = "approved" AND claims.status = "disbrusmented" THEN "disbrusmented"
|
||||
/*WHEN claim_requests.status = "approved" AND claims.status = "received" THEN "pending"*/
|
||||
WHEN claim_requests.status = "approved" AND claims.status = "received" THEN "reviewed"
|
||||
ELSE ""
|
||||
ELSE ""
|
||||
END AS status
|
||||
'),
|
||||
'claim_requests.id AS claim_request_id', 'claim_requests.submission_date')
|
||||
->paginate($limit);
|
||||
'),
|
||||
'claim_requests.id AS claim_request_id',
|
||||
'claim_requests.submission_date'
|
||||
)
|
||||
->paginate($limit);
|
||||
return $results;
|
||||
}
|
||||
|
||||
@@ -125,34 +142,90 @@ class CorporateMemberService
|
||||
}
|
||||
})
|
||||
// ->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);
|
||||
}
|
||||
|
||||
public function getAllMemberAlarmCenter(int $corporateId, Request $request)
|
||||
{
|
||||
$limit = $request->has('perPage') ? $request->input('perPage') : 10;
|
||||
$start_date = date('Y-m-d', strtotime($request->input('start_date') . ' +1 day'));
|
||||
$end_date = date('Y-m-d', strtotime($request->input('end_date') . ' +1 day'));
|
||||
// $start_date = date('Y-m-d', strtotime($request->input('start_date') . ' +1 day'));
|
||||
// $end_date = date('Y-m-d', strtotime($request->input('end_date') . ' +1 day'));
|
||||
|
||||
// dd($request);
|
||||
return Member::query()
|
||||
->joinCorporateEmployees('left')
|
||||
->joinMemberPlans('left')
|
||||
->joinPlans('left')
|
||||
->with(['currentPlan', 'person'])
|
||||
->where('corporate_employees.corporate_id', $corporateId)
|
||||
|
||||
// return Member::query()
|
||||
// // ->joinCorporateEmployees('left')
|
||||
// // ->joinMemberPlans('left')
|
||||
// // ->joinPlans('left')
|
||||
// // ->with(['currentPlan', 'person'])
|
||||
// // ->where('corporate_employees.corporate_id', $corporateId)
|
||||
// ->when($request->input('search'), function (Builder $query, $search) {
|
||||
// $query->where(function (Builder $query) use ($search) {
|
||||
// $query->orWhere('members.member_id', 'like', "%" . $search . "%")
|
||||
// ->orWhere('members.name', 'like', "%" . $search . "%");
|
||||
// });
|
||||
// })
|
||||
// ->when($request->input('start_date'), function (Builder $query, $start_date) {
|
||||
// $query->where('members.members_effective_date', '>=', $start_date);
|
||||
// })
|
||||
// ->when($request->input('end_date'), function (Builder $query, $end_date) {
|
||||
// $query->where('members.members_expire_date', '<', $end_date);
|
||||
// })
|
||||
// ->when($request->input('division'), function (Builder $query, $value) {
|
||||
// $query->where('corporate_employees.division_id', $value);
|
||||
// })
|
||||
// ->when($request->input('status'), function (Builder $query, $value) {
|
||||
// $query->where('plans.active', $value);
|
||||
// })
|
||||
// ->when($request->has('orderBy'), function (Builder $query) use ($request) {
|
||||
// $orderBy = match ($request->input('orderBy')) {
|
||||
// 'memberId' => 'member_id',
|
||||
// 'fullName' => 'name',
|
||||
// // 'status' => 'active',
|
||||
// 'start_date' => 'member_plans.members_effective_date',
|
||||
// 'end_date' => 'member_plans.members_expire_date',
|
||||
// // 'service' => 'plans.service_code',
|
||||
|
||||
// default => ''
|
||||
// };
|
||||
|
||||
// $query->getQuery()->orderBy($orderBy, $request->order);
|
||||
// })
|
||||
// ->select([
|
||||
// 'members.id',
|
||||
// 'members.person_id',
|
||||
// 'members.member_id',
|
||||
// 'members.name',
|
||||
// 'members.members_effective_date', // Use the actual property name
|
||||
// 'members.members_expire_date', // Use the actual property name
|
||||
// // 'plans.active',
|
||||
// // 'plans.service_code'
|
||||
// ])
|
||||
// // ->selectRaw("(select sum(`claims`.`total_claim`) from `claims` where `members`.`id` = `claims`.`member_id` AND `claims`.`deleted_at` IS NULL) AS `claims_sum_total_claim`")
|
||||
// // ->groupBy('member_id')
|
||||
// ->paginate($limit);
|
||||
|
||||
return RequestLog::query()
|
||||
->leftJoin('members', 'request_logs.member_id', '=', 'members.id')
|
||||
// ->joinMemberPlans('left')
|
||||
// ->joinPlans('left')
|
||||
// ->with(['currentPlan', 'person'])
|
||||
// ->where('corporate_employees.corporate_id', $corporateId)
|
||||
// ->whereHas('currentCorporate', function (Builder $query) use ($corporateId) {
|
||||
// // $query->where('corporate_id', $corporateId);
|
||||
// })
|
||||
->when($request->input('search'), function (Builder $query, $search) {
|
||||
$query->where(function (Builder $query) use ($search) {
|
||||
$query->orWhere('members.member_id', 'like', "%" . $search . "%")
|
||||
->orWhere('members.name', 'like', "%" . $search . "%");
|
||||
});
|
||||
})
|
||||
->when($request->input('start_date'), function (Builder $query, $start) {
|
||||
$query->where('members.members_effective_date', '>=', $start);
|
||||
->when($request->input('start_date'), function (Builder $query, $start_date) {
|
||||
$query->where('members.members_effective_date', '>=', $start_date);
|
||||
})
|
||||
->when($request->input('end_date'), function (Builder $query, $end) {
|
||||
$query->where('members.members_expire_date', '<', $end);
|
||||
->when($request->input('end_date'), function (Builder $query, $end_date) {
|
||||
$query->where('members.members_expire_date', '<', $end_date);
|
||||
})
|
||||
->when($request->input('division'), function (Builder $query, $value) {
|
||||
$query->where('corporate_employees.division_id', $value);
|
||||
@@ -165,9 +238,9 @@ class CorporateMemberService
|
||||
'memberId' => 'member_id',
|
||||
'fullName' => 'name',
|
||||
'status' => 'active',
|
||||
'start_date' => 'member_plans.start',
|
||||
'end_date' => 'member_plans.end',
|
||||
'service' => 'plans.service_code',
|
||||
'start_date' => 'member_plans.members_effective_date',
|
||||
'end_date' => 'member_plans.members_expire_date',
|
||||
'request_date' => 'request_logs.submission_date',
|
||||
|
||||
default => ''
|
||||
};
|
||||
@@ -178,14 +251,17 @@ class CorporateMemberService
|
||||
'members.id',
|
||||
'members.person_id',
|
||||
'members.member_id',
|
||||
'members.name',
|
||||
'members.name as full_name',
|
||||
'members.members_effective_date', // Use the actual property name
|
||||
'members.members_expire_date', // Use the actual property name
|
||||
'plans.active',
|
||||
'plans.service_code'
|
||||
'members.active',
|
||||
'request_logs.service_code',
|
||||
])
|
||||
->selectRaw("(select sum(`claims`.`total_claim`) from `claims` where `members`.`id` = `claims`.`member_id` AND `claims`.`deleted_at` IS NULL) AS `claims_sum_total_claim`")
|
||||
// ->selectRaw("(select sum(`claims`.`total_claim`) from `claims` where `members`.`id` = `claims`.`member_id` AND `claims`.`deleted_at` IS NULL) AS `claims_sum_total_claim`")
|
||||
->groupBy('member_id')
|
||||
->paginate($limit);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function getAllMemberEmployeeData(int $corporateId, Request $request)
|
||||
@@ -193,36 +269,40 @@ class CorporateMemberService
|
||||
$limit = $request->has('perPage') ? $request->input('perPage') : 10;
|
||||
|
||||
return Member::query()
|
||||
->joinCorporateEmployees('left')
|
||||
->joinMemberPlans('left')
|
||||
->joinPlans('left')
|
||||
->with(['currentPlan', 'person'])
|
||||
->where('corporate_employees.corporate_id', $corporateId)
|
||||
->when($request->input('search'), function (Builder $query, $search) {
|
||||
$query->where(function (Builder $query) use ($search) {
|
||||
$query->orWhere('members.member_id', 'like', "%" . $search . "%")
|
||||
->orWhere('members.name', 'like', "%" . $search . "%");
|
||||
->whereHas('employeds', function ($query) use ($corporateId) {
|
||||
$query->where('corporate_id', $corporateId);
|
||||
})
|
||||
->when($request->input('search'), function ($query, $search) {
|
||||
$query->where(function ($query) use ($search) {
|
||||
$query->orWhere('member_id', 'like', "%" . $search . "%")
|
||||
->orWhere('name', 'like', "%" . $search . "%");
|
||||
});
|
||||
})
|
||||
->when($request->input('division'), function (Builder $query, $value) {
|
||||
$query->where('corporate_employees.division_id', $value);
|
||||
})
|
||||
->when($request->has('orderBy'), function (Builder $query) use ($request) {
|
||||
->when($request->has('orderBy'), function ($query) use ($request) {
|
||||
$orderBy = match ($request->input('orderBy')) {
|
||||
'memberId' => 'member_id',
|
||||
'fullName' => 'name',
|
||||
'status' => 'active',
|
||||
'start_date' => 'member_plans.start',
|
||||
'end_date' => 'member_plans.end',
|
||||
'service' => 'plans.service_code',
|
||||
|
||||
default => ''
|
||||
'start_date' => 'members_effective_date',
|
||||
'end_date' => 'members_expire_date',
|
||||
default => null,
|
||||
};
|
||||
|
||||
$query->getQuery()->orderBy($orderBy, $request->order);
|
||||
if ($orderBy !== null && $request->order) {
|
||||
$query->orderBy($orderBy, $request->order);
|
||||
}
|
||||
})
|
||||
->select(['members.id', 'members.person_id', 'members.member_id', 'members.name', 'member_plans.start AS start_date', 'member_plans.end AS end_date', 'plans.active', 'plans.service_code'])
|
||||
->selectRaw("(select sum(`claims`.`total_claim`) from `claims` where `members`.`id` = `claims`.`member_id` AND `claims`.`deleted_at` IS NULL) AS `claims_sum_total_claim`")
|
||||
->select([
|
||||
'id',
|
||||
'person_id',
|
||||
'member_id',
|
||||
'name_prefix',
|
||||
'name_suffix',
|
||||
'name',
|
||||
'members_effective_date',
|
||||
'members_expire_date',
|
||||
'active',
|
||||
])
|
||||
->paginate($limit);
|
||||
}
|
||||
|
||||
|
||||
2254
composer.lock
generated
2254
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -13,7 +13,7 @@ return new class extends Migration
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table(' plans', function (Blueprint $table) {
|
||||
Schema::table('plans', function (Blueprint $table) {
|
||||
$table->string('limit_telecon')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('request_logs', function (Blueprint $table) {
|
||||
$table->string('diagnosis')->after('import_system')->default(null);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('request_logs', function (Blueprint $table) {
|
||||
$table->dropColumn('diagnosis');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -1,3 +1,3 @@
|
||||
GENERATE_SOURCEMAP=false
|
||||
|
||||
VITE_API_URL="https://aso-api.linksehat.dev/api/client"
|
||||
VITE_API_URL="https://primecenter-api.linksehat.com/api/client"
|
||||
|
||||
@@ -1,21 +1,45 @@
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
export type Member = {
|
||||
id: string,
|
||||
member_id: string,
|
||||
record_type: string,
|
||||
payor_id: string,
|
||||
user_id: string,
|
||||
name_prefix: string,
|
||||
name: string,
|
||||
name_suffix: string,
|
||||
birth_date: string,
|
||||
gender: string,
|
||||
language: string,
|
||||
race: string,
|
||||
marital_status: string,
|
||||
principal_id: string,
|
||||
relation_with_principal: string,
|
||||
bpjs_class: string,
|
||||
active: string,
|
||||
id: string;
|
||||
member_id: string;
|
||||
record_type: string;
|
||||
payor_id: string;
|
||||
user_id: string;
|
||||
name_prefix: string;
|
||||
name: string;
|
||||
name_suffix: string;
|
||||
birth_date: string;
|
||||
gender: string;
|
||||
language: string;
|
||||
race: string;
|
||||
marital_status: string;
|
||||
principal_id: string;
|
||||
relation_with_principal: string;
|
||||
bpjs_class: string;
|
||||
active: string;
|
||||
};
|
||||
|
||||
export type PersonalInformationType = {
|
||||
name: string;
|
||||
weight: number;
|
||||
height: number;
|
||||
placeOfBirth: string;
|
||||
dateOfBirth: string;
|
||||
gender: string;
|
||||
phoneNumber: string;
|
||||
email: string;
|
||||
address: string;
|
||||
idNumber: string;
|
||||
religion: string;
|
||||
maritalStatus: string;
|
||||
education: string;
|
||||
occupation: string;
|
||||
};
|
||||
|
||||
export type FamilyInformationtype = {
|
||||
name: string;
|
||||
relationship: string;
|
||||
dateOfBirth: string;
|
||||
email: string;
|
||||
phoneNumber: string;
|
||||
status: string;
|
||||
};
|
||||
|
||||
@@ -58,7 +58,7 @@ export type Status = {
|
||||
export type TableListProps<DataType> = {
|
||||
headCells?: HeadCell<DataType>[];
|
||||
rows?: Array<DataType>;
|
||||
paginations: {
|
||||
paginations?: {
|
||||
page: number;
|
||||
setPage: Dispatch<SetStateAction<number>>;
|
||||
rowsPerPage: number;
|
||||
@@ -66,7 +66,7 @@ export type TableListProps<DataType> = {
|
||||
paginationTable: PaginationTableProps;
|
||||
setPaginationTable: Dispatch<SetStateAction<PaginationTableProps>>;
|
||||
};
|
||||
orders: {
|
||||
orders?: {
|
||||
order: Order;
|
||||
setOrder: Dispatch<SetStateAction<Order>>;
|
||||
orderBy: string;
|
||||
@@ -76,14 +76,15 @@ export type TableListProps<DataType> = {
|
||||
isLoading: boolean;
|
||||
setIsLoading: Dispatch<SetStateAction<boolean>>;
|
||||
};
|
||||
params: {
|
||||
params?: {
|
||||
searchParams: URLSearchParams;
|
||||
setSearchParams: any;
|
||||
appliedParams: {};
|
||||
setAppliedParams: Dispatch<SetStateAction<{}>>;
|
||||
};
|
||||
searchs: {
|
||||
searchs?: {
|
||||
useSearchs: boolean;
|
||||
fullWidth?: boolean;
|
||||
searchText: string;
|
||||
setSearchText: Dispatch<SetStateAction<string>>;
|
||||
handleSearchSubmit: (event: FormEvent<HTMLFormElement>) => void;
|
||||
@@ -106,19 +107,19 @@ export type TableListProps<DataType> = {
|
||||
handleStatusChange: (event: SelectChangeEvent) => void;
|
||||
};
|
||||
};
|
||||
filterStartDate: {
|
||||
filterStartDate?: {
|
||||
useFilter: boolean;
|
||||
startDate: string;
|
||||
setStartDate: Dispatch<SetStateAction<string>>;
|
||||
handleStartDateChange: (event: FormEvent<HTMLFormElement>) => void;
|
||||
};
|
||||
filterEndDate: {
|
||||
filterEndDate?: {
|
||||
useFilter: boolean;
|
||||
endDate: string;
|
||||
setEndDate: Dispatch<SetStateAction<string>>;
|
||||
handleEndDateChange: (event: FormEvent<HTMLFormElement>) => void;
|
||||
};
|
||||
exportReport: {
|
||||
exportReport?: {
|
||||
useExport: boolean;
|
||||
startDate: string;
|
||||
endDate: string;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
/* ---------------------------------- @mui ---------------------------------- */
|
||||
import { styled } from '@mui/material/styles';
|
||||
import {
|
||||
Paper,
|
||||
Table as TableContent,
|
||||
@@ -12,49 +11,23 @@ import {
|
||||
Button,
|
||||
TableSortLabel,
|
||||
Box,
|
||||
Card,
|
||||
Grid,
|
||||
FormControl,
|
||||
InputLabel,
|
||||
Select,
|
||||
MenuItem,
|
||||
SelectChangeEvent,
|
||||
Stack,
|
||||
InputAdornment,
|
||||
Typography,
|
||||
LinearProgress,
|
||||
linearProgressClasses,
|
||||
} from '@mui/material';
|
||||
import { visuallyHidden } from '@mui/utils';
|
||||
/* ---------------------------------- axios --------------------------------- */
|
||||
import axios from '../utils/axios';
|
||||
/* ---------------------------------- react --------------------------------- */
|
||||
import { Fragment, useContext, useEffect, useState } from 'react';
|
||||
import { useSearchParams } from 'react-router-dom';
|
||||
import { Fragment } from 'react';
|
||||
/* -------------------------------- component ------------------------------- */
|
||||
import BaseTablePagination from './BaseTablePagination';
|
||||
/* ---------------------------------- theme --------------------------------- */
|
||||
import palette from '../theme/palette';
|
||||
/* ---------------------------------- utils --------------------------------- */
|
||||
import { UserCurrentCorporateContext } from '../contexts/UserCurrentCorporate';
|
||||
import { fSplit } from '../utils/formatNumber';
|
||||
import { Download, Search as SearchIcon, Upload } from '@mui/icons-material';
|
||||
import { Download, Search as SearchIcon } from '@mui/icons-material';
|
||||
/* ---------------------------------- types --------------------------------- */
|
||||
import { DivisionDataProps, Order, PaginationTableProps, TableListProps } from '../@types/table';
|
||||
import { InputAdornment } from '@mui/material';
|
||||
import GetAppIcon from '@mui/icons-material/GetApp';
|
||||
/* --------------------------------- styled --------------------------------- */
|
||||
const BorderLinearProgress = styled(LinearProgress)(({ theme }) => ({
|
||||
height: 10,
|
||||
borderRadius: 6,
|
||||
[`&.${linearProgressClasses.colorPrimary}`]: {
|
||||
backgroundColor: '#D1F1F1',
|
||||
},
|
||||
[`& .${linearProgressClasses.bar}`]: {
|
||||
borderRadius: 6,
|
||||
backgroundColor: theme.palette.primary.main,
|
||||
},
|
||||
}));
|
||||
/* -------------------------------------------------------------------------- */
|
||||
import { DivisionDataProps, StatusDataProps, TableListProps } from '../@types/table';
|
||||
|
||||
export default function Table<T>({
|
||||
headCells,
|
||||
@@ -77,11 +50,11 @@ export default function Table<T>({
|
||||
orders?.setOrder(isAsc ? 'desc' : 'asc');
|
||||
orders?.setOrderBy(property);
|
||||
const parameters = Object.fromEntries([
|
||||
...params.searchParams.entries(),
|
||||
...(params?.searchParams.entries() as IterableIterator<[string, string]>),
|
||||
['order', isAsc ? 'desc' : 'asc'],
|
||||
['orderBy', property],
|
||||
]);
|
||||
params.setAppliedParams(parameters);
|
||||
params?.setAppliedParams(parameters);
|
||||
};
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
@@ -134,123 +107,142 @@ export default function Table<T>({
|
||||
newPage: number
|
||||
) => {
|
||||
const parameters = Object.fromEntries([
|
||||
...params.searchParams.entries(),
|
||||
...(params?.searchParams.entries() as IterableIterator<[string, string]>),
|
||||
['page', newPage + 1],
|
||||
['per_page', paginations.rowsPerPage]
|
||||
['per_page', paginations?.rowsPerPage],
|
||||
]);
|
||||
paginations.setPage(newPage);
|
||||
paginations?.setPage(newPage);
|
||||
await new Promise((resolve) => setTimeout(resolve, 500));
|
||||
params.setAppliedParams(parameters);
|
||||
params?.setAppliedParams(parameters);
|
||||
};
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
/* --------------------------- row page per limit --------------------------- */
|
||||
const onRowsPerPageChangeHandle = async (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||
params.searchParams.delete('page');
|
||||
params?.searchParams.delete('page');
|
||||
const parameters = Object.fromEntries([
|
||||
...params.searchParams.entries(),
|
||||
...(params?.searchParams.entries() as IterableIterator<[string, string]>),
|
||||
['per_page', parseInt(event.target.value, 10)],
|
||||
]);
|
||||
|
||||
paginations.setPage(0);
|
||||
paginations.setRowsPerPage(parseInt(event.target.value, 10));
|
||||
paginations?.setPage(0);
|
||||
paginations?.setRowsPerPage(parseInt(event.target.value, 10));
|
||||
await new Promise((resolve) => setTimeout(resolve, 500));
|
||||
params.setAppliedParams(parameters);
|
||||
params?.setAppliedParams(parameters);
|
||||
};
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
return (
|
||||
// <Card>
|
||||
<Grid container>
|
||||
{/* Field 1 */}
|
||||
<Grid item xs={12} paddingX="24px" paddingY="20px">
|
||||
<Grid container spacing={2}>
|
||||
{filters && filters.useFilter ? (
|
||||
<Fragment>
|
||||
<Grid item xs={12} lg={3} xl={2}>
|
||||
<FormControl fullWidth>
|
||||
<InputLabel id="simple-division-select-lable">Division</InputLabel>
|
||||
<Select
|
||||
labelId="simple-division-select-lable"
|
||||
id="division-select-lable"
|
||||
value={filters.config.divisionValue}
|
||||
label="Division"
|
||||
onChange={filters.config.handleDivisionChange}
|
||||
>
|
||||
<MenuItem value="all">All</MenuItem>
|
||||
{filters.config.divisionData.map((row: DivisionDataProps, index) => (
|
||||
<MenuItem key={index} value={row.id}>
|
||||
{row.name}
|
||||
</MenuItem>
|
||||
))}
|
||||
</Select>
|
||||
</FormControl>
|
||||
</Grid>
|
||||
<Grid item xs={12} lg={9} xl={10}>
|
||||
<Grid container>
|
||||
{/* Field 1 */}
|
||||
<Grid item xs={12} paddingX="24px" paddingY="20px">
|
||||
<Grid container spacing={2}>
|
||||
{filters && filters.useFilter ? (
|
||||
<Fragment>
|
||||
<Grid item xs={12} lg={3} xl={2}>
|
||||
<FormControl fullWidth>
|
||||
<InputLabel id="simple-division-select-lable">Division</InputLabel>
|
||||
<Select
|
||||
labelId="simple-division-select-lable"
|
||||
id="division-select-lable"
|
||||
value={filters.config.divisionValue}
|
||||
label="Division"
|
||||
onChange={filters.config.handleDivisionChange}
|
||||
>
|
||||
<MenuItem value="all">All</MenuItem>
|
||||
{filters.config.divisionData.map((row: DivisionDataProps, index) => (
|
||||
<MenuItem key={index} value={row.id}>
|
||||
{row.name}
|
||||
</MenuItem>
|
||||
))}
|
||||
</Select>
|
||||
</FormControl>
|
||||
</Grid>
|
||||
<Grid item xs={12} lg={9} xl={10}>
|
||||
<form onSubmit={searchs?.handleSearchSubmit}>
|
||||
<TextField
|
||||
id="search-input"
|
||||
label="Search"
|
||||
variant="outlined"
|
||||
onChange={(event) => searchs?.setSearchText(event.target.value)}
|
||||
value={searchs?.searchText}
|
||||
fullWidth
|
||||
/>
|
||||
</form>
|
||||
</Grid>
|
||||
</Fragment>
|
||||
) : null}
|
||||
|
||||
{searchs && searchs.useSearchs ? (
|
||||
<Fragment>
|
||||
{filterStatus && filterStatus.useFilter ? (
|
||||
<Grid item xs={12} lg={4} xl={4}>
|
||||
<form onSubmit={searchs.handleSearchSubmit}>
|
||||
<TextField
|
||||
id="search-input"
|
||||
label="Search"
|
||||
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>
|
||||
</Fragment>
|
||||
) : null }
|
||||
|
||||
{searchs && searchs.useSearchs ? (
|
||||
<Fragment>
|
||||
{filterStatus && filterStatus.useFilter ? (
|
||||
<Grid item xs={12} lg={4} xl={4}>
|
||||
<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>
|
||||
) : 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={6} xl={6}>
|
||||
<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>
|
||||
}
|
||||
|
||||
</Fragment>
|
||||
) : null }
|
||||
) : (
|
||||
<Grid item xs={12} lg={searchs.fullWidth ? 12 : 6} xl={searchs.fullWidth ? 12 : 6}>
|
||||
<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>
|
||||
)}
|
||||
</Fragment>
|
||||
) : null}
|
||||
|
||||
{/* Start date */}
|
||||
{filterStartDate && filterStartDate.useFilter ? (
|
||||
<Grid item xs={12} lg={2} xl={2}>
|
||||
{/* Start date */}
|
||||
{filterStartDate && filterStartDate.useFilter ? (
|
||||
<Grid item xs={12} lg={2} xl={2}>
|
||||
<form onChange={filterStartDate.handleStartDateChange}>
|
||||
<TextField
|
||||
id="date-input"
|
||||
@@ -266,12 +258,12 @@ export default function Table<T>({
|
||||
/>
|
||||
</form>
|
||||
</Grid>
|
||||
) : null }
|
||||
) : null}
|
||||
|
||||
{/* End Date */}
|
||||
{/* End Date */}
|
||||
|
||||
{filterEndDate && filterEndDate.useFilter ? (
|
||||
<Grid item xs={12} lg={2} xl={2}>
|
||||
{filterEndDate && filterEndDate.useFilter ? (
|
||||
<Grid item xs={12} lg={2} xl={2}>
|
||||
<form onChange={filterEndDate.handleEndDateChange}>
|
||||
<TextField
|
||||
id="date-input"
|
||||
@@ -287,90 +279,101 @@ export default function Table<T>({
|
||||
/>
|
||||
</form>
|
||||
</Grid>
|
||||
) : null }
|
||||
) : null}
|
||||
|
||||
{/* Filter status */}
|
||||
{filterStatus && filterStatus.useFilter ? (
|
||||
<Grid item xs={12} lg={2} xl={2}>
|
||||
<FormControl fullWidth>
|
||||
<InputLabel id="simple-status-select-lable">Status</InputLabel>
|
||||
<Select
|
||||
labelId="simple-status-select-lable"
|
||||
id="status-select-lable"
|
||||
value={filterStatus.config.statusValue}
|
||||
label="Status"
|
||||
onChange={filterStatus.config.handleStatusChange}
|
||||
>
|
||||
<MenuItem value="all">All</MenuItem>
|
||||
{filterStatus.config.filterData.map((row: StatusDataProps, index) => (
|
||||
<MenuItem key={index} value={row.id}>
|
||||
{row.name}
|
||||
</MenuItem>
|
||||
))}
|
||||
</Select>
|
||||
</FormControl>
|
||||
</Grid>
|
||||
) : null }
|
||||
{/* Filter status */}
|
||||
{filterStatus && filterStatus.useFilter ? (
|
||||
<Grid item xs={12} lg={2} xl={2}>
|
||||
<FormControl fullWidth>
|
||||
<InputLabel id="simple-status-select-lable">Status</InputLabel>
|
||||
<Select
|
||||
labelId="simple-status-select-lable"
|
||||
id="status-select-lable"
|
||||
value={filterStatus.config.statusValue}
|
||||
label="Status"
|
||||
onChange={filterStatus.config.handleStatusChange}
|
||||
>
|
||||
<MenuItem value="all">All</MenuItem>
|
||||
{filterStatus.config.statusData.map((row: StatusDataProps, index) => (
|
||||
<MenuItem key={index} value={row.id}>
|
||||
{row.name}
|
||||
</MenuItem>
|
||||
))}
|
||||
</Select>
|
||||
</FormControl>
|
||||
</Grid>
|
||||
) : null}
|
||||
|
||||
{/* Export Report */}
|
||||
|
||||
{exportReport && exportReport.useExport ? (
|
||||
<Grid item xs={12} lg={2} xl={2}>
|
||||
<FormControl fullWidth>
|
||||
<Button variant='contained' sx={{p:2}} onClick={exportReport.handleExportReport}>
|
||||
<Download />
|
||||
<Typography variant='inherit' sx={{marginLeft: 1}}>Export</Typography>
|
||||
</Button>
|
||||
</FormControl>
|
||||
</Grid>
|
||||
) : null }
|
||||
|
||||
</Grid>
|
||||
{/* Export Report */}
|
||||
{exportReport && exportReport.useExport ? (
|
||||
<Grid item xs={12} lg={2} xl={2}>
|
||||
<FormControl fullWidth>
|
||||
<Button
|
||||
variant="contained"
|
||||
sx={{ p: 2 }}
|
||||
onClick={() => exportReport.handleExportReport}
|
||||
>
|
||||
<Download />
|
||||
<Typography variant="inherit" sx={{ marginLeft: 1 }}>
|
||||
Export
|
||||
</Typography>
|
||||
</Button>
|
||||
</FormControl>
|
||||
</Grid>
|
||||
) : null}
|
||||
</Grid>
|
||||
{/* End Field 1 */}
|
||||
{/* Field 2 */}
|
||||
<Grid item xs={12}>
|
||||
{/* Table */}
|
||||
<TableContainer component={Paper}>
|
||||
<TableContent aria-label="collapsible table" size="small">
|
||||
{/* Table Header */}
|
||||
<EnhancedTableHead />
|
||||
{/* End Table Header */}
|
||||
{/* Table Body */}
|
||||
<TableBody>
|
||||
{loadings.isLoading && rows.length >= 1 ? (
|
||||
<TableRow>
|
||||
<TableCell colSpan={headCells?.length} align="center">
|
||||
Loading . . .
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
) : rows && rows.length >= 1 ? (
|
||||
rows.map((row, rowIndex) => (
|
||||
<TableRow key={rowIndex}>
|
||||
{headCells &&
|
||||
</Grid>
|
||||
{/* End Field 1 */}
|
||||
{/* Field 2 */}
|
||||
<Grid item xs={12}>
|
||||
{/* Table */}
|
||||
<TableContainer component={Paper}>
|
||||
<TableContent aria-label="collapsible table" size="small">
|
||||
{/* Table Header */}
|
||||
<EnhancedTableHead />
|
||||
{/* End Table Header */}
|
||||
{/* Table Body */}
|
||||
<TableBody>
|
||||
{loadings.isLoading && rows && rows.length >= 1 ? (
|
||||
<TableRow>
|
||||
<TableCell colSpan={headCells?.length} align="center">
|
||||
Loading . . .
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
) : rows && rows.length >= 1 ? (
|
||||
rows.map((row, rowIndex) => (
|
||||
<TableRow key={rowIndex}>
|
||||
{headCells &&
|
||||
//@ts-ignore
|
||||
headCells.map((head, headIndex) => (
|
||||
//@ts-ignore
|
||||
headCells.map((head, headIndex) => (
|
||||
//@ts-ignore
|
||||
<TableCell align={head.align} key={headIndex}>
|
||||
{row[head.id]}
|
||||
</TableCell>
|
||||
))}
|
||||
</TableRow>
|
||||
))
|
||||
) : (
|
||||
<TableRow>
|
||||
<TableCell colSpan={6} align="center">
|
||||
No Data Found
|
||||
</TableCell>
|
||||
<TableCell align={head.align} key={headIndex}>
|
||||
{row[head.id]}
|
||||
</TableCell>
|
||||
))}
|
||||
</TableRow>
|
||||
)}
|
||||
</TableBody>
|
||||
{/* End Table Body */}
|
||||
</TableContent>
|
||||
</TableContainer>
|
||||
{/* End Table */}
|
||||
))
|
||||
) : loadings.isLoading === false && rows && rows.length === 0 ? (
|
||||
<TableRow>
|
||||
<TableCell colSpan={6} align="center">
|
||||
No Data Found
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
) : (
|
||||
<TableRow>
|
||||
<TableCell colSpan={6} align="center">
|
||||
Loading . . .
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
)}
|
||||
</TableBody>
|
||||
{/* End Table Body */}
|
||||
</TableContent>
|
||||
</TableContainer>
|
||||
{/* End Table */}
|
||||
|
||||
{/* Pagination */}
|
||||
{/* Pagination */}
|
||||
{paginations && (
|
||||
<BaseTablePagination
|
||||
count={paginations.paginationTable.total}
|
||||
onPageChange={onPageChangeHandle}
|
||||
@@ -378,10 +381,11 @@ export default function Table<T>({
|
||||
rowsPerPage={paginations.rowsPerPage}
|
||||
onRowsPerPageChange={onRowsPerPageChangeHandle}
|
||||
/>
|
||||
{/* End Pagination */}
|
||||
</Grid>
|
||||
{/* End Field 2 */}
|
||||
)}
|
||||
{/* End Pagination */}
|
||||
</Grid>
|
||||
{/* End Field 2 */}
|
||||
</Grid>
|
||||
// </Card>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -32,16 +32,18 @@ export default function NavSectionVertical({
|
||||
<Box {...other}>
|
||||
{navConfig.map((group, index) => (
|
||||
<List key={index} disablePadding sx={{ px: 2 }}>
|
||||
<ListSubheaderStyle
|
||||
key={index}
|
||||
sx={{
|
||||
...(isCollapse && {
|
||||
opacity: 0,
|
||||
}),
|
||||
}}
|
||||
>
|
||||
{group.subheader}
|
||||
</ListSubheaderStyle>
|
||||
{group.subheader && (
|
||||
<ListSubheaderStyle
|
||||
key={index}
|
||||
sx={{
|
||||
...(isCollapse && {
|
||||
opacity: 0,
|
||||
}),
|
||||
}}
|
||||
>
|
||||
{group.subheader}
|
||||
</ListSubheaderStyle>
|
||||
)}
|
||||
|
||||
{group.items.map((list) => (
|
||||
<NavListRoot key={list.title} list={list} isCollapse={isCollapse} />
|
||||
|
||||
@@ -1,31 +1,30 @@
|
||||
import { useState } from 'react';
|
||||
// @mui
|
||||
import { alpha } from '@mui/material/styles';
|
||||
import { Box, Divider, Typography, Stack, MenuItem, Avatar } from '@mui/material';
|
||||
import { Box, Divider, Typography, MenuItem, Avatar } from '@mui/material';
|
||||
// components
|
||||
import MenuPopover from '../../../components/MenuPopover';
|
||||
import { IconButtonAnimate } from '../../../components/animate';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import useAuth from '../../../hooks/useAuth';
|
||||
import useLocalStorage from '../../../hooks/useLocalStorage';
|
||||
import { enqueueSnackbar } from 'notistack';
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
const MENU_OPTIONS = [
|
||||
{
|
||||
label: 'Home',
|
||||
linkTo: '/',
|
||||
},
|
||||
{
|
||||
label: 'Profile',
|
||||
linkTo: '/',
|
||||
},
|
||||
{
|
||||
label: 'Settings',
|
||||
linkTo: '/',
|
||||
},
|
||||
];
|
||||
// const MENU_OPTIONS = [
|
||||
// {
|
||||
// label: 'Home',
|
||||
// linkTo: '/',
|
||||
// },
|
||||
// {
|
||||
// label: 'Profile',
|
||||
// linkTo: '/',
|
||||
// },
|
||||
// {
|
||||
// label: 'Settings',
|
||||
// linkTo: '/',
|
||||
// },
|
||||
// ];
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
@@ -67,10 +66,7 @@ export default function AccountPopover() {
|
||||
}),
|
||||
}}
|
||||
>
|
||||
{user && user.user.avatar_url && (<Avatar
|
||||
src={user ? user.user.avatar_url : ''}
|
||||
alt={user ? user.user.full_name : ''}
|
||||
/>)}
|
||||
<Avatar src={user?.user.avatar_url || ''} alt={user?.user.full_name || ''} />
|
||||
</IconButtonAnimate>
|
||||
|
||||
<MenuPopover
|
||||
@@ -89,10 +85,10 @@ export default function AccountPopover() {
|
||||
>
|
||||
<Box sx={{ my: 1.5, px: 2.5 }}>
|
||||
<Typography variant="subtitle2" noWrap>
|
||||
{ user ? user.user.full_name ?? 'Hi, ' : 'Hi, '}
|
||||
{`Hi, ${user?.user?.full_name || 'User'}`}
|
||||
</Typography>
|
||||
<Typography variant="body2" sx={{ color: 'text.secondary' }} noWrap>
|
||||
{ user ? user.user.email : 'Please Wait'}
|
||||
{user ? user.user.email : 'Please Wait'}
|
||||
</Typography>
|
||||
</Box>
|
||||
|
||||
|
||||
@@ -14,24 +14,41 @@ type CorporateDataProps = {
|
||||
export default function CorporatePopover() {
|
||||
const { corporateValue, setCorporateValue } = useContext(UserCurrentCorporateContext);
|
||||
const [corporateData, setCorporateData] = useState([]);
|
||||
//Check route in profile
|
||||
const controller = new AbortController();
|
||||
|
||||
const navigate = useNavigate();
|
||||
const currentPathname = window.location.pathname;
|
||||
const desiredPart = currentPathname.split('/')[1];
|
||||
|
||||
const handleCorporateChange = (event: SelectChangeEvent) => {
|
||||
setCorporateValue(event.target.value as string);
|
||||
if(desiredPart === 'user-profile')
|
||||
{
|
||||
if (desiredPart === 'user-profile') {
|
||||
navigate('/alarm-center');
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
(async () => {
|
||||
// @ts-ignore
|
||||
const corporateManages = await axios.get(`/corporate-manage`);
|
||||
setCorporateData(corporateManages.data);
|
||||
try {
|
||||
const corporateManages = await axios.get(`/corporate-manage`, {
|
||||
signal: controller.signal,
|
||||
});
|
||||
setCorporateData(corporateManages.data);
|
||||
|
||||
const storageCorporateValue = corporateManages.data.find(
|
||||
(item: { id: number }) => item.id === parseInt(corporateValue)
|
||||
);
|
||||
|
||||
setCorporateValue(
|
||||
storageCorporateValue ? storageCorporateValue.id : corporateManages.data[0].id
|
||||
);
|
||||
} catch (error: any) {
|
||||
console.error('Error fetching data:', error.message);
|
||||
}
|
||||
|
||||
return () => {
|
||||
controller.abort();
|
||||
};
|
||||
})();
|
||||
}, []);
|
||||
|
||||
|
||||
@@ -13,11 +13,7 @@ import Logo from '../../../components/Logo';
|
||||
import Iconify from '../../../components/Iconify';
|
||||
import { IconButtonAnimate } from '../../../components/animate';
|
||||
//
|
||||
import Searchbar from './Searchbar';
|
||||
import AccountPopover from './AccountPopover';
|
||||
import LanguagePopover from './LanguagePopover';
|
||||
import ContactsPopover from './ContactsPopover';
|
||||
import NotificationsPopover from './NotificationsPopover';
|
||||
import CorporatePopover from './CorporatePopover';
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -46,11 +42,11 @@ const RootStyle = styled(AppBar, {
|
||||
width: `calc(100% - ${NAVBAR.DASHBOARD_COLLAPSE_WIDTH}px)`,
|
||||
}),
|
||||
...(isOffset && {
|
||||
height: HEADER.DASHBOARD_DESKTOP_OFFSET_HEIGHT,
|
||||
height: HEADER.DASHBOARD_DESKTOP_HEIGHT,
|
||||
}),
|
||||
...(verticalLayout && {
|
||||
width: '100%',
|
||||
height: HEADER.DASHBOARD_DESKTOP_OFFSET_HEIGHT,
|
||||
height: HEADER.DASHBOARD_DESKTOP_HEIGHT,
|
||||
backgroundColor: theme.palette.background.default,
|
||||
}),
|
||||
},
|
||||
@@ -89,15 +85,15 @@ export default function DashboardHeader({
|
||||
</IconButtonAnimate>
|
||||
)}
|
||||
|
||||
<Searchbar />
|
||||
{/* <Searchbar /> */}
|
||||
<Box sx={{ flexGrow: 1 }} />
|
||||
|
||||
<Stack direction="row" alignItems="center" spacing={{ xs: 0.5, sm: 1.5 }}>
|
||||
<CorporatePopover />
|
||||
<Divider orientation="vertical" flexItem />
|
||||
<LanguagePopover />
|
||||
<NotificationsPopover />
|
||||
<ContactsPopover />
|
||||
{/* <LanguagePopover /> */}
|
||||
{/* <NotificationsPopover /> */}
|
||||
{/* <ContactsPopover /> */}
|
||||
<AccountPopover />
|
||||
</Stack>
|
||||
</Toolbar>
|
||||
|
||||
@@ -60,9 +60,8 @@ export default function DashboardLayout() {
|
||||
|
||||
const [corporateValue, setCorporateValue] = useLocalStorage(
|
||||
'corporateValue',
|
||||
user.corporate ? `${user.corporate.id}` : ''
|
||||
user && user.corporate ? `${user.corporate.id}` : ''
|
||||
);
|
||||
const value = { corporateValue, setCorporateValue };
|
||||
|
||||
if (verticalLayout) {
|
||||
return (
|
||||
@@ -96,7 +95,7 @@ export default function DashboardLayout() {
|
||||
}
|
||||
|
||||
return (
|
||||
<UserCurrentCorporateContext.Provider value={value}>
|
||||
<UserCurrentCorporateContext.Provider value={{ corporateValue, setCorporateValue }}>
|
||||
<Box
|
||||
sx={{
|
||||
display: { lg: 'flex' },
|
||||
|
||||
@@ -7,7 +7,7 @@ const navConfig = [
|
||||
items: [{ title: 'Dashboard', path: '/dashboard' }],
|
||||
},
|
||||
|
||||
// Corporate
|
||||
// Corporate
|
||||
// ----------------------------------------------------------------------
|
||||
{
|
||||
subheader: 'Corporate',
|
||||
@@ -15,37 +15,34 @@ const navConfig = [
|
||||
{
|
||||
title: 'Corporate',
|
||||
path: '/corporate',
|
||||
// icon: ICONS.default,
|
||||
},
|
||||
{
|
||||
title: 'Employee Data',
|
||||
path: '/employee-data',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
|
||||
// Alarm Center
|
||||
// ----------------------------------------------------------------------
|
||||
{
|
||||
subheader: 'Case Management',
|
||||
items: [
|
||||
{
|
||||
title: 'Employee Data',
|
||||
path: '/employee-data',
|
||||
},
|
||||
{
|
||||
title: 'Alarm Center',
|
||||
path: '/alarm-center',
|
||||
},
|
||||
{
|
||||
title: 'Claim Submit',
|
||||
path: '/claim-submit',
|
||||
},
|
||||
{
|
||||
title: 'Claim Report',
|
||||
path: '/claim-report',
|
||||
},
|
||||
// {
|
||||
// title: 'Claim Submit',
|
||||
// path: '/claim-submit',
|
||||
// },
|
||||
// {
|
||||
// title: 'Claim Report',
|
||||
// path: '/claim-report',
|
||||
// },
|
||||
],
|
||||
},
|
||||
|
||||
|
||||
// User Management
|
||||
// ----------------------------------------------------------------------
|
||||
// {
|
||||
|
||||
@@ -23,10 +23,8 @@ type Props = {
|
||||
};
|
||||
|
||||
export default function NavbarAccount({ isCollapse }: Props) {
|
||||
|
||||
const { user } = useAuth();
|
||||
|
||||
// console.log('current user is ', user)
|
||||
return (
|
||||
<Link underline="none" color="inherit">
|
||||
<RootStyle
|
||||
@@ -36,10 +34,9 @@ export default function NavbarAccount({ isCollapse }: Props) {
|
||||
}),
|
||||
}}
|
||||
>
|
||||
{user && user.user.avatar_url && (<Avatar
|
||||
src={user ? user.user.avatar_url : ''}
|
||||
alt={user ? user.user.full_name : ''}
|
||||
/>)}
|
||||
{user && user.user.avatar_url && (
|
||||
<Avatar src={user?.user.avatar_url || ''} alt={user?.user.full_name || ''} />
|
||||
)}
|
||||
|
||||
<Box
|
||||
sx={{
|
||||
@@ -55,10 +52,10 @@ export default function NavbarAccount({ isCollapse }: Props) {
|
||||
}}
|
||||
>
|
||||
<Typography variant="subtitle2" noWrap>
|
||||
{ user ? user.user.full_name ?? 'Hi, ' : 'Hi, '}
|
||||
{`Hi, ${user?.user?.full_name || 'User'}`}
|
||||
</Typography>
|
||||
<Typography variant="body2" noWrap sx={{ color: 'text.secondary', fontSize: '11px' }}>
|
||||
{ user ? user.user.email : 'Please Wait'}
|
||||
{user ? user.user.email : 'Please Wait'}
|
||||
</Typography>
|
||||
</Box>
|
||||
</RootStyle>
|
||||
|
||||
@@ -1,105 +1,15 @@
|
||||
/* ---------------------------------- react --------------------------------- */
|
||||
import { useState, SyntheticEvent } from 'react';
|
||||
/* ---------------------------------- @mui ---------------------------------- */
|
||||
import { Box, Tabs, Tab, Container, Grid, Card } from '@mui/material';
|
||||
import { styled } from '@mui/material/styles';
|
||||
import { Container, Grid } from '@mui/material';
|
||||
/* ------------------------------- components ------------------------------- */
|
||||
import Page from '../../components/Page';
|
||||
/* ---------------------------------- hooks --------------------------------- */
|
||||
import useSettings from '../../hooks/useSettings';
|
||||
import List from './List';
|
||||
import ServiceMonitoring from './ServiceMonitoring';
|
||||
import UserProfile from './UserProfile';
|
||||
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() {
|
||||
const { themeStretch } = useSettings();
|
||||
|
||||
const [value, setValue] = useState(0);
|
||||
const handleChange = (event: SyntheticEvent, newValue: number) => {
|
||||
setValue(newValue);
|
||||
};
|
||||
|
||||
return (
|
||||
<Page title="Alarm Center">
|
||||
<Container maxWidth={themeStretch ? false : 'xl'}>
|
||||
@@ -107,29 +17,12 @@ export default function Drugs() {
|
||||
heading={'Alarm Center'}
|
||||
links={[
|
||||
{ name: 'Case Management', href: '/alarm-center' },
|
||||
{ name: 'Alarm Center', href: '/alarm-center'}
|
||||
{ name: 'Alarm Center', href: '/alarm-center' },
|
||||
]}
|
||||
/>
|
||||
<Grid container>
|
||||
<Grid item xs={12} lg={12} md={12}>
|
||||
{/* <Card> */}
|
||||
{/* <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> */}
|
||||
<List />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Container>
|
||||
|
||||
@@ -1,149 +1,23 @@
|
||||
/* ---------------------------------- @mui ---------------------------------- */
|
||||
import {
|
||||
Paper,
|
||||
Table,
|
||||
TableBody,
|
||||
TableCell,
|
||||
TableContainer,
|
||||
TableHead,
|
||||
TableRow,
|
||||
TextField,
|
||||
Stack,
|
||||
Button,
|
||||
TableSortLabel,
|
||||
Box,
|
||||
SelectChangeEvent,
|
||||
Typography,
|
||||
MenuItem
|
||||
} from '@mui/material';
|
||||
import { visuallyHidden } from '@mui/utils';
|
||||
import { SelectChangeEvent, MenuItem } from '@mui/material';
|
||||
/* ---------------------------------- axios --------------------------------- */
|
||||
// import axios from 'axios';
|
||||
import axios from '../../utils/axios';
|
||||
/* ---------------------------------- react --------------------------------- */
|
||||
import { useContext, useEffect, useState } from 'react';
|
||||
|
||||
/* -------------------------------- component ------------------------------- */
|
||||
import Iconify from '../../components/Iconify';
|
||||
import BaseTablePagination from '../../components/BaseTablePagination';
|
||||
import TableComponent from '../../components/Table';
|
||||
|
||||
/* ---------------------------------- hooks --------------------------------- */
|
||||
import useMap from '../../hooks/useMap';
|
||||
/* ---------------------------------- theme --------------------------------- */
|
||||
import palette from '../../theme/palette';
|
||||
import { UserCurrentCorporateContext } from '../../contexts/UserCurrentCorporate';
|
||||
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 TableMoreMenu from '../../components/table/TableMoreMenu';
|
||||
import VisibilityOutlinedIcon from '@mui/icons-material/VisibilityOutlined';
|
||||
import { enqueueSnackbar } from 'notistack';
|
||||
|
||||
import DetailDataMember from './ListMember';
|
||||
import Label from '../../components/Label';
|
||||
|
||||
|
||||
/* ---------------------------------- 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>
|
||||
// );
|
||||
// }
|
||||
import { Stack } from '@mui/material';
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
@@ -177,8 +51,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('request_date');
|
||||
|
||||
const orders = {
|
||||
order: order,
|
||||
@@ -237,7 +111,7 @@ export default function List() {
|
||||
handleSearchSubmit: handleSearchSubmit,
|
||||
};
|
||||
|
||||
/* ------------------------------ handle filter ----------------------------- */
|
||||
/* ------------------------------ handle filter ----------------------------- */
|
||||
const [statusValue, setStatusValue] = useState('all');
|
||||
const [filterData, setStatusData] = useState([]);
|
||||
|
||||
@@ -263,7 +137,7 @@ export default function List() {
|
||||
config: {
|
||||
label: 'Status',
|
||||
statusValue: statusValue,
|
||||
filterData: filterData,
|
||||
statusData: filterData,
|
||||
handleStatusChange: handleStatusChanges,
|
||||
},
|
||||
};
|
||||
@@ -273,13 +147,16 @@ export default function List() {
|
||||
|
||||
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]]);
|
||||
const params = Object.fromEntries([
|
||||
...searchParams.entries(),
|
||||
['start_date', startDateValue],
|
||||
]);
|
||||
setAppliedParams(params);
|
||||
}
|
||||
};
|
||||
@@ -314,7 +191,7 @@ export default function List() {
|
||||
};
|
||||
|
||||
/* -------------------------------- handle export --------------------------- */
|
||||
const handleExportReport = async () => {
|
||||
const handleExportReport = async () => {
|
||||
var filter = Object.fromEntries([...searchParams.entries()]);
|
||||
|
||||
await axios
|
||||
@@ -339,8 +216,8 @@ export default function List() {
|
||||
startDate: startDateValue,
|
||||
endDate: endDateValue,
|
||||
status: statusValue,
|
||||
handleExportReport: handleExportReport
|
||||
}
|
||||
handleExportReport: handleExportReport,
|
||||
};
|
||||
|
||||
/* -------------------------------- headCell -------------------------------- */
|
||||
const headCells: HeadCell<never>[] = [
|
||||
@@ -356,7 +233,7 @@ export default function List() {
|
||||
label: 'Name',
|
||||
isSort: true,
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
id: 'start_date',
|
||||
align: 'center',
|
||||
@@ -400,72 +277,34 @@ export default function List() {
|
||||
});
|
||||
|
||||
const status = [
|
||||
{"id": 1, "name": "Done" },
|
||||
{"id": 0, "name": "On Going" },
|
||||
|
||||
]
|
||||
setStatusData(status)
|
||||
{ id: 1, name: 'Done' },
|
||||
{ id: 0, name: 'On Going' },
|
||||
];
|
||||
setStatusData(status);
|
||||
|
||||
setData(
|
||||
response.data.data.map((obj: any) => {
|
||||
return {
|
||||
...obj,
|
||||
// memberId:
|
||||
// // <Link to={'/user-profile/'+obj.personId} >
|
||||
// <Button
|
||||
// onClick={() => navigate ('/user-profile/'+obj.personId)}
|
||||
// >{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={
|
||||
response.data.data.map((obj: any) => ({
|
||||
...obj,
|
||||
start_date: <Label>{fDateSuffix(obj.start_date)}</Label>,
|
||||
end_date: <Label> {fDateSuffix(obj.end_date)}</Label>,
|
||||
action: (
|
||||
<TableMoreMenu
|
||||
actions={
|
||||
<>
|
||||
<MenuItem onClick={() => navigate('member/'+obj.id )}>
|
||||
<MenuItem onClick={() => navigate('member/' + obj.id)}>
|
||||
<VisibilityOutlinedIcon />
|
||||
View
|
||||
</MenuItem>
|
||||
</>
|
||||
} />
|
||||
};
|
||||
})
|
||||
}
|
||||
/>
|
||||
),
|
||||
}))
|
||||
);
|
||||
|
||||
setPaginationTable(response.data);
|
||||
setRowsPerPage(response.data.per_page);
|
||||
|
||||
|
||||
|
||||
if (searchParams.get('page')) {
|
||||
//@ts-ignore
|
||||
const currentPage = parseInt(searchParams.get('page')) - 1;
|
||||
@@ -488,7 +327,6 @@ export default function List() {
|
||||
loadings={loadings}
|
||||
params={params}
|
||||
searchs={searchs}
|
||||
// filters={filters}
|
||||
filterStatus={filterStatus}
|
||||
filterStartDate={filterStartDate}
|
||||
filterEndDate={filterEndDate}
|
||||
|
||||
@@ -1,23 +1,5 @@
|
||||
/* ---------------------------------- @mui ---------------------------------- */
|
||||
import {
|
||||
Paper,
|
||||
Table,
|
||||
TableBody,
|
||||
TableCell,
|
||||
TableContainer,
|
||||
TableHead,
|
||||
TableRow,
|
||||
TextField,
|
||||
Stack,
|
||||
Button,
|
||||
TableSortLabel,
|
||||
Box,
|
||||
SelectChangeEvent,
|
||||
Typography,
|
||||
MenuItem,
|
||||
Grid
|
||||
} from '@mui/material';
|
||||
import { visuallyHidden } from '@mui/utils';
|
||||
import { Stack, Typography, MenuItem, Grid } from '@mui/material';
|
||||
/* ---------------------------------- axios --------------------------------- */
|
||||
// import axios from 'axios';
|
||||
import axios from '../../utils/axios';
|
||||
@@ -25,137 +7,27 @@ import axios from '../../utils/axios';
|
||||
import { useContext, useEffect, useState } from 'react';
|
||||
|
||||
/* -------------------------------- component ------------------------------- */
|
||||
import Iconify from '../../components/Iconify';
|
||||
import BaseTablePagination from '../../components/BaseTablePagination';
|
||||
import TableComponent from '../../components/Table';
|
||||
import ArrowBackIosIcon from '@mui/icons-material/ArrowBackIos';
|
||||
|
||||
/* ---------------------------------- hooks --------------------------------- */
|
||||
import useMap from '../../hooks/useMap';
|
||||
/* ---------------------------------- theme --------------------------------- */
|
||||
import palette from '../../theme/palette';
|
||||
import { UserCurrentCorporateContext } from '../../contexts/UserCurrentCorporate';
|
||||
import { HeadCell, Order, PaginationTableProps } from '../../@types/table';
|
||||
import { useSearchParams, useNavigate, Link, useParams } from 'react-router-dom';
|
||||
import { fDateSuffix, fPostFormat } from '../../utils/formatTime';
|
||||
import { useSearchParams, useNavigate, useParams } from 'react-router-dom';
|
||||
import { fDateSuffix } from '../../utils/formatTime';
|
||||
import TableMoreMenu from '../../components/table/TableMoreMenu';
|
||||
import VisibilityOutlinedIcon from '@mui/icons-material/VisibilityOutlined';
|
||||
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() {
|
||||
const navigate = useNavigate();
|
||||
|
||||
const { corporateValue } = useContext(UserCurrentCorporateContext);
|
||||
|
||||
const [data, setData] = useState([]);
|
||||
const [data, setData] = useState({
|
||||
full_name: '',
|
||||
paginations: [],
|
||||
});
|
||||
const { id } = useParams();
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
@@ -182,7 +54,7 @@ export default function List() {
|
||||
|
||||
/* ------------------------------ handle order ------------------------------ */
|
||||
const [order, setOrder] = useState<Order>('asc');
|
||||
const [orderBy, setOrderBy] = useState('fullName');
|
||||
const [orderBy, setOrderBy] = useState('admission_date');
|
||||
|
||||
const orders = {
|
||||
order: order,
|
||||
@@ -215,141 +87,10 @@ export default function List() {
|
||||
paginationTable: paginationTable,
|
||||
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 -------------------------------- */
|
||||
const headCells: HeadCell<never>[] = [
|
||||
const headCells: HeadCell<never>[] = [
|
||||
{
|
||||
id: 'admission_date',
|
||||
align: 'center',
|
||||
@@ -368,6 +109,12 @@ export default function List() {
|
||||
label: 'Code',
|
||||
isSort: true,
|
||||
},
|
||||
{
|
||||
id: 'service_type',
|
||||
align: 'center',
|
||||
label: 'Service Type',
|
||||
isSort: false,
|
||||
},
|
||||
{
|
||||
id: 'status',
|
||||
align: 'center',
|
||||
@@ -398,59 +145,45 @@ export default function List() {
|
||||
params: { ...parameters },
|
||||
});
|
||||
|
||||
const status = [
|
||||
{"id": 1, "name": "Done" },
|
||||
{"id": 0, "name": "On Going" },
|
||||
setSearchParams(parameters);
|
||||
|
||||
]
|
||||
setStatusData(status)
|
||||
const datatable = response.data.data;
|
||||
|
||||
// if (response.data.data.length > 0){
|
||||
// setIsLoading(true);
|
||||
// } else {
|
||||
// setIsLoading(false);
|
||||
// }
|
||||
|
||||
const dataName = response.data.data[0].fullName
|
||||
setName(dataName)
|
||||
setData(
|
||||
datatable.map((obj: any) => {
|
||||
return {
|
||||
...obj,
|
||||
admission_date:
|
||||
<Label>{ fDateSuffix(obj.admission_date) }</Label>
|
||||
,
|
||||
discharge_date:
|
||||
<Label>{ fDateSuffix(obj.discharge_date) }</Label>
|
||||
,
|
||||
status:
|
||||
obj.status === 'Done' ? (
|
||||
<Label color='success'>
|
||||
Done
|
||||
</Label>
|
||||
) : (
|
||||
<Label color='warning'>
|
||||
Ongoing
|
||||
</Label>
|
||||
),
|
||||
action:
|
||||
<TableMoreMenu actions={
|
||||
setData({
|
||||
full_name: response.data.full_name,
|
||||
paginations: response.data.paginations.data.map((obj: any) => ({
|
||||
...obj,
|
||||
admission_date: obj.admission_date ? (
|
||||
<Label> {fDateSuffix(obj.admission_date)} </Label>
|
||||
) : (
|
||||
''
|
||||
),
|
||||
discharge_date: obj.discharge_date ? (
|
||||
<Label> {fDateSuffix(obj.discharge_date)} </Label>
|
||||
) : (
|
||||
''
|
||||
),
|
||||
status:
|
||||
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 />
|
||||
View
|
||||
</MenuItem>
|
||||
</>
|
||||
} />
|
||||
};
|
||||
})
|
||||
);
|
||||
}
|
||||
/>
|
||||
),
|
||||
})),
|
||||
});
|
||||
|
||||
setPaginationTable(response.data);
|
||||
setRowsPerPage(response.data.per_page);
|
||||
|
||||
|
||||
setPaginationTable(response.data.paginations);
|
||||
setRowsPerPage(response.data.paginations.per_page);
|
||||
|
||||
if (searchParams.get('page')) {
|
||||
//@ts-ignore
|
||||
@@ -463,17 +196,14 @@ export default function List() {
|
||||
setIsLoading(false);
|
||||
})();
|
||||
}, [appliedParams, searchParams, order, orderBy, setSearchParams, corporateValue]);
|
||||
console.log(loadings);
|
||||
|
||||
return (
|
||||
<Grid container spacing={8}>
|
||||
<Grid item xs={12} paddingX="24px" >
|
||||
<Stack direction="row" alignItems="center">
|
||||
<ArrowBackIosIcon
|
||||
onClick={() => navigate(`/alarm-center`)}
|
||||
sx={{ cursor: 'pointer' }}
|
||||
/>
|
||||
<Grid container spacing={8} padding={3}>
|
||||
<Grid item xs={12}>
|
||||
<Stack direction="row" alignItems="center" gap={3}>
|
||||
<ArrowBackIosIcon onClick={() => navigate(`/alarm-center`)} sx={{ cursor: 'pointer' }} />
|
||||
<Typography variant="h5" sx={{ flexGrow: 1 }}>
|
||||
{name}
|
||||
{data.full_name}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
@@ -481,24 +211,14 @@ export default function List() {
|
||||
<Stack>
|
||||
<TableComponent
|
||||
headCells={headCells}
|
||||
rows={data}
|
||||
rows={data.paginations}
|
||||
orders={orders}
|
||||
paginations={paginations}
|
||||
loadings={loadings}
|
||||
params={params}
|
||||
searchs={searchs}
|
||||
// filters={filters}
|
||||
filterStatus={filterStatus}
|
||||
filterStartDate={filterStartDate}
|
||||
filterEndDate={filterEndDate}
|
||||
exportReport={exportReport}
|
||||
/>
|
||||
</Stack>
|
||||
|
||||
</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 (
|
||||
<Page title="Profile">
|
||||
<Container maxWidth={themeStretch ? false : 'xl'}>
|
||||
<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 />
|
||||
<Typography variant="h5">Profil Peserta</Typography>
|
||||
</Stack>
|
||||
@@ -74,7 +71,7 @@ export default function UserProfile() {
|
||||
</Grid>
|
||||
{/* Item 2 */}
|
||||
<Grid item xs={12}>
|
||||
<CardClaimHistory data={data}/>
|
||||
<CardClaimHistory data={data} />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
@@ -95,8 +95,6 @@ export default function Drugs() {
|
||||
setIsLoading: setIsLoading,
|
||||
};
|
||||
|
||||
|
||||
|
||||
/* ------------------------------ handle params ----------------------------- */
|
||||
const [searchParams, setSearchParams] = useSearchParams();
|
||||
const [appliedParams, setAppliedParams] = useState({});
|
||||
@@ -121,7 +119,6 @@ export default function Drugs() {
|
||||
setOrderBy: setOrderBy,
|
||||
};
|
||||
|
||||
|
||||
/* ---------------------------- Get Current Date ---------------------------- */
|
||||
const current = new Date();
|
||||
const date = fDateSuffix(current);
|
||||
@@ -220,11 +217,7 @@ export default function Drugs() {
|
||||
const parameters =
|
||||
Object.keys(appliedParams).length !== 0
|
||||
? appliedParams
|
||||
: Object.fromEntries([
|
||||
...searchParams.entries(),
|
||||
['order', orders.order],
|
||||
['orderBy', orders.orderBy],
|
||||
]);
|
||||
: Object.fromEntries([...searchParams.entries()]);
|
||||
|
||||
// const claim = await axios.get(`${corporateValue}/members`, {
|
||||
// params: { ...parameters, type: 'claim-report' },
|
||||
@@ -242,32 +235,39 @@ export default function Drugs() {
|
||||
return (
|
||||
<Page title="Claim Reports">
|
||||
<HeaderBreadcrumbs
|
||||
heading={'Claim Submit'}
|
||||
links={[
|
||||
{ name: 'Case Management', href: '/dashboard' },
|
||||
{
|
||||
name: 'Claim Submit',
|
||||
href: '/claim-submit',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
heading={'Claim Submit'}
|
||||
links={[
|
||||
{ name: 'Case Management', href: '/dashboard' },
|
||||
{
|
||||
name: 'Claim Submit',
|
||||
href: '/claim-submit',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
<Container maxWidth={themeStretch ? false : 'xl'}>
|
||||
<Grid container spacing={2}>
|
||||
<Grid item xs={12} lg={6} md={6}>
|
||||
<Typography variant="h6" sx={{marginLeft:'10px'}}> Select Employee</Typography>
|
||||
<Typography variant="h6" sx={{ marginLeft: '10px' }}>
|
||||
{' '}
|
||||
Select Employee
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item xs={12} lg={6} md={6} sx={{ display: 'flex', justifyContent: 'flex-end' }}>
|
||||
<Stack direction='row' alignItems='center'>
|
||||
<Typography variant="inherit" align='right' sx={{ marginRight: '10px' }}>Submission Date</Typography>
|
||||
<Typography variant="subtitle1" align='right' sx={{ marginRight: '10px' }}>{date}</Typography>
|
||||
<Stack direction="row" alignItems="center">
|
||||
<Typography variant="inherit" align="right" sx={{ marginRight: '10px' }}>
|
||||
Submission Date
|
||||
</Typography>
|
||||
<Typography variant="subtitle1" align="right" sx={{ marginRight: '10px' }}>
|
||||
{date}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} lg={12} md={12}>
|
||||
<DialogClaimSubmitMember
|
||||
openDialog={true}
|
||||
setOpenDialog={false}
|
||||
title={{ name: 'te' }}
|
||||
/>
|
||||
openDialog={true}
|
||||
setOpenDialog={false}
|
||||
title={{ name: 'te' }}
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Container>
|
||||
|
||||
@@ -1,139 +1,31 @@
|
||||
/* ---------------------------------- react --------------------------------- */
|
||||
import { useState, SyntheticEvent } from 'react';
|
||||
/* ---------------------------------- @mui ---------------------------------- */
|
||||
import { Box, Tabs, Tab, Container, Grid, Card } from '@mui/material';
|
||||
import { styled } from '@mui/material/styles';
|
||||
import { Container, Grid } from '@mui/material';
|
||||
/* ------------------------------- components ------------------------------- */
|
||||
import Page from '../../components/Page';
|
||||
/* ---------------------------------- hooks --------------------------------- */
|
||||
import useSettings from '../../hooks/useSettings';
|
||||
import List from './List';
|
||||
import ServiceMonitoring from './ServiceMonitoring';
|
||||
import UserProfile from './UserProfile';
|
||||
import HeaderBreadcrumbs from '../../components/HeaderBreadcrumbs';
|
||||
import TableMoreMenu from '../../components/table/TableMoreMenu';
|
||||
|
||||
/* ------------------------------ 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() {
|
||||
const { themeStretch } = useSettings();
|
||||
|
||||
const [value, setValue] = useState(0);
|
||||
const handleChange = (event: SyntheticEvent, newValue: number) => {
|
||||
setValue(newValue);
|
||||
};
|
||||
|
||||
return (
|
||||
<Page title="Corporate">
|
||||
<Container maxWidth={themeStretch ? false : 'xl'}>
|
||||
<HeaderBreadcrumbs
|
||||
heading={'Corporate'}
|
||||
links={[
|
||||
{ name: 'Dashboard', href: '/dashboard' },
|
||||
{
|
||||
name: 'Corporates',
|
||||
href: '/corporates',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
heading={'Corporate'}
|
||||
links={[
|
||||
{ name: 'Dashboard', href: '/dashboard' },
|
||||
{
|
||||
name: 'Corporates',
|
||||
href: '/corporates',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
<Grid container>
|
||||
<Grid item xs={12} lg={12} md={12}>
|
||||
{/* <Card> */}
|
||||
{/* <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> */}
|
||||
<List />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Container>
|
||||
|
||||
@@ -1,21 +1,5 @@
|
||||
/* ---------------------------------- @mui ---------------------------------- */
|
||||
import {
|
||||
Paper,
|
||||
Table,
|
||||
TableBody,
|
||||
TableCell,
|
||||
TableContainer,
|
||||
TableHead,
|
||||
TableRow,
|
||||
TextField,
|
||||
Stack,
|
||||
Button,
|
||||
TableSortLabel,
|
||||
Typography,
|
||||
Box,
|
||||
MenuItem,
|
||||
} from '@mui/material';
|
||||
import { visuallyHidden } from '@mui/utils';
|
||||
import { Stack, Button, Typography, MenuItem } from '@mui/material';
|
||||
/* ---------------------------------- axios --------------------------------- */
|
||||
// import axios from 'axios';
|
||||
import axios from '../../utils/axios';
|
||||
@@ -23,129 +7,19 @@ import axios from '../../utils/axios';
|
||||
import { useContext, useEffect, useState } from 'react';
|
||||
|
||||
/* -------------------------------- component ------------------------------- */
|
||||
import Iconify from '../../components/Iconify';
|
||||
import BaseTablePagination from '../../components/BaseTablePagination';
|
||||
import TableComponent from '../../components/Table';
|
||||
|
||||
/* ---------------------------------- hooks --------------------------------- */
|
||||
import useMap from '../../hooks/useMap';
|
||||
/* ---------------------------------- theme --------------------------------- */
|
||||
import palette from '../../theme/palette';
|
||||
import { UserCurrentCorporateContext } from '../../contexts/UserCurrentCorporate';
|
||||
import { HeadCell, Order, PaginationTableProps } from '../../@types/table';
|
||||
import { useSearchParams, useNavigate, Link } from 'react-router-dom';
|
||||
import { HeadCell } from '../../@types/table';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import TableMoreMenu from '../../components/table/TableMoreMenu';
|
||||
import EditOutlinedIcon from '@mui/icons-material/EditOutlined';
|
||||
import VisibilityOutlinedIcon from '@mui/icons-material/VisibilityOutlined';
|
||||
|
||||
|
||||
/* ---------------------------------- 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>
|
||||
// );
|
||||
// }
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
export default function List() {
|
||||
const navigate = useNavigate();
|
||||
|
||||
const { corporateValue } = useContext(UserCurrentCorporateContext);
|
||||
const controller = new AbortController();
|
||||
|
||||
const [data, setData] = useState([]);
|
||||
|
||||
@@ -159,196 +33,101 @@ export default function List() {
|
||||
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,
|
||||
};
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
/* ------------------------------ handle search ----------------------------- */
|
||||
const [searchText, setSearchText] = 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,
|
||||
};
|
||||
|
||||
/* -------------------------------- headCell -------------------------------- */
|
||||
const headCells: HeadCell<never>[] = [
|
||||
{
|
||||
id: 'code',
|
||||
align: 'left',
|
||||
label: 'Code',
|
||||
isSort: true,
|
||||
isSort: false,
|
||||
},
|
||||
{
|
||||
id: 'name',
|
||||
align: 'left',
|
||||
label: 'Name',
|
||||
isSort: true,
|
||||
isSort: false,
|
||||
},
|
||||
{
|
||||
id: 'active',
|
||||
align: 'center',
|
||||
label: 'Status',
|
||||
isSort: true,
|
||||
isSort: false,
|
||||
},
|
||||
{
|
||||
id: 'action',
|
||||
align: 'center',
|
||||
label: '',
|
||||
isSort: true,
|
||||
isSort: false,
|
||||
},
|
||||
|
||||
];
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
useEffect(() => {
|
||||
(async () => {
|
||||
setIsLoading(true);
|
||||
try {
|
||||
setIsLoading(true);
|
||||
|
||||
await new Promise((resolve) => setTimeout(resolve, 250));
|
||||
const [response] = await Promise.all([
|
||||
axios.get(`${corporateValue}/corporate`, { signal: controller.signal }),
|
||||
]);
|
||||
|
||||
const parameters =
|
||||
Object.keys(appliedParams).length !== 0
|
||||
? appliedParams
|
||||
: Object.fromEntries([...searchParams.entries(), ['order', order], ['orderBy', orderBy]]);
|
||||
|
||||
const response = await axios.get(`${corporateValue}/corporate`, {
|
||||
params: { ...parameters },
|
||||
});
|
||||
|
||||
setData(
|
||||
response.data.data.map((obj: any) => {
|
||||
return {
|
||||
setData(
|
||||
response.data.data.map((obj: any) => ({
|
||||
...obj,
|
||||
active:
|
||||
obj.active === 1 ? (
|
||||
<Typography variant="overline"
|
||||
sx={{
|
||||
backgroundColor: 'rgba(84, 214, 44, 0.16)',
|
||||
color: '#229A16',
|
||||
paddingX: 1.5,
|
||||
paddingY: 1,
|
||||
display: 'inline-flex', // Mengatur elemen menjadi inline-flex
|
||||
alignItems: 'center', // Untuk align vertical
|
||||
borderRadius: '10px'
|
||||
,
|
||||
}}
|
||||
>
|
||||
Active
|
||||
</Typography>
|
||||
) : (
|
||||
<Button variant="outlined" color="error">
|
||||
Inactive
|
||||
</Button>
|
||||
obj.active === 1 ? (
|
||||
<Typography
|
||||
variant="overline"
|
||||
sx={{
|
||||
backgroundColor: 'rgba(84, 214, 44, 0.16)',
|
||||
color: '#229A16',
|
||||
paddingX: 1.5,
|
||||
paddingY: 1,
|
||||
display: 'inline-flex',
|
||||
alignItems: 'center',
|
||||
borderRadius: '10px',
|
||||
}}
|
||||
>
|
||||
Active
|
||||
</Typography>
|
||||
) : (
|
||||
<Button variant="outlined" color="error">
|
||||
Inactive
|
||||
</Button>
|
||||
),
|
||||
action: (
|
||||
<TableMoreMenu
|
||||
actions={
|
||||
<>
|
||||
<MenuItem onClick={() => navigate(`/corporate/edit`)}>
|
||||
<EditOutlinedIcon />
|
||||
Edit
|
||||
</MenuItem>
|
||||
<MenuItem onClick={() => navigate(`/corporate/view`)}>
|
||||
<VisibilityOutlinedIcon />
|
||||
View
|
||||
</MenuItem>
|
||||
</>
|
||||
}
|
||||
/>
|
||||
),
|
||||
action:
|
||||
<TableMoreMenu actions={
|
||||
<>
|
||||
<MenuItem onClick={() => navigate(`/corporate/edit`)}>
|
||||
<EditOutlinedIcon />
|
||||
Edit
|
||||
</MenuItem>
|
||||
<MenuItem onClick={() => navigate(`/corporate/view`)}>
|
||||
<VisibilityOutlinedIcon />
|
||||
View
|
||||
</MenuItem>
|
||||
</>
|
||||
} />
|
||||
,
|
||||
};
|
||||
})
|
||||
);
|
||||
}))
|
||||
);
|
||||
|
||||
setPaginationTable(response.data);
|
||||
setRowsPerPage(response.data.per_page);
|
||||
|
||||
|
||||
|
||||
if (searchParams.get('page')) {
|
||||
//@ts-ignore
|
||||
const currentPage = parseInt(searchParams.get('page')) - 1;
|
||||
|
||||
paginationTable.current_page = currentPage;
|
||||
setPage(currentPage);
|
||||
setIsLoading(false);
|
||||
} catch (error: any) {
|
||||
console.error('Error fetching data:', error.message);
|
||||
}
|
||||
|
||||
setIsLoading(false);
|
||||
return () => {
|
||||
controller.abort();
|
||||
};
|
||||
})();
|
||||
}, [appliedParams, searchParams, order, orderBy, setSearchParams, corporateValue]);
|
||||
}, [corporateValue]);
|
||||
|
||||
return (
|
||||
<Stack>
|
||||
<TableComponent
|
||||
headCells={headCells}
|
||||
rows={data}
|
||||
orders={orders}
|
||||
paginations={paginations}
|
||||
loadings={loadings}
|
||||
params={params}
|
||||
searchs={searchs}
|
||||
// filters={filters}
|
||||
/>
|
||||
<TableComponent headCells={headCells} rows={data} loadings={loadings} />
|
||||
</Stack>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -121,14 +121,14 @@ export default function ServiceMonitoring() {
|
||||
const { corporateValue } = useContext(UserCurrentCorporateContext);
|
||||
const { id } = useParams();
|
||||
const claimId = '2';
|
||||
// console.log('id', id);
|
||||
// console.log('id', id);
|
||||
|
||||
useEffect(() => {
|
||||
console.log('fetching data...');
|
||||
axios
|
||||
.get('/data/' + id)
|
||||
.then((response) => {
|
||||
// console.log('data fetched...', response.data);
|
||||
// console.log('data fetched...', response.data);
|
||||
setData(response.data);
|
||||
})
|
||||
.catch((error) => {
|
||||
@@ -138,7 +138,7 @@ export default function ServiceMonitoring() {
|
||||
axios
|
||||
.get('/corporate-manage/' + corporateValue)
|
||||
.then((response) => {
|
||||
// console.log('corporate fetched...', response.data);
|
||||
// console.log('corporate fetched...', response.data);
|
||||
setCorporate(response.data);
|
||||
})
|
||||
.catch((error) => {
|
||||
@@ -146,15 +146,15 @@ export default function ServiceMonitoring() {
|
||||
});
|
||||
}, []);
|
||||
|
||||
// console.log('Data:', data);
|
||||
// console.log('Data:', data);
|
||||
const [encounterData, setEncounterData] = useState({});
|
||||
|
||||
useEffect(() => {
|
||||
// console.log('fetching encounter data...');
|
||||
// console.log('fetching encounter data...');
|
||||
axios
|
||||
.get('/claims/${claim_id}/encounters')
|
||||
.then((response) => {
|
||||
// console.log('encounter data fetched...', response.data);
|
||||
// console.log('encounter data fetched...', response.data);
|
||||
setEncounterData(response.data);
|
||||
})
|
||||
.catch((error) => {
|
||||
|
||||
@@ -1,22 +1,10 @@
|
||||
// @mui
|
||||
import { styled } from '@mui/material/styles';
|
||||
import {
|
||||
Typography,
|
||||
Container,
|
||||
Grid,
|
||||
Button,
|
||||
IconButton,
|
||||
LinearProgress,
|
||||
linearProgressClasses,
|
||||
SelectChangeEvent,
|
||||
} from '@mui/material';
|
||||
import { Typography, Container, Grid, Button, SelectChangeEvent } from '@mui/material';
|
||||
// hooks
|
||||
import useSettings from '../../hooks/useSettings';
|
||||
// components
|
||||
import Page from '../../components/Page';
|
||||
// theme
|
||||
import CardNotification from '../../sections/dashboard/CardNotification';
|
||||
import CardPolicy from '../../sections/dashboard/CardPolicy';
|
||||
import { useContext, useEffect, useState } from 'react';
|
||||
import axios from '../../utils/axios';
|
||||
import { Stack } from '@mui/system';
|
||||
@@ -25,67 +13,13 @@ import Table from '../../components/Table';
|
||||
import { HeadCell, Order, PaginationTableProps } from '../../@types/table';
|
||||
import { useSearchParams } from 'react-router-dom';
|
||||
import palette from '../../theme/palette';
|
||||
import { MoreVert as MoreVertIcon } from '@mui/icons-material';
|
||||
import { fSplit } from '../../utils/formatNumber';
|
||||
|
||||
const itemList = [
|
||||
{ info: 'Mohon lengkapi dokumen Alison Born', date: 'Selasa, 13 Februari 23', time: '09:43 WIB' },
|
||||
{ info: 'Mohon lengkapi dokumen Alison Born', date: 'Selasa, 13 Februari 23', time: '09:43 WIB' },
|
||||
{ info: 'Mohon lengkapi dokumen Alison Born', date: 'Selasa, 13 Februari 23', time: '09:43 WIB' },
|
||||
{ info: 'Mohon lengkapi dokumen Alison Born', date: 'Selasa, 13 Februari 23', time: '09:43 WIB' },
|
||||
];
|
||||
|
||||
/* ------------------------------ default data ------------------------------ */
|
||||
type DataMember = {
|
||||
id: number;
|
||||
fullName: string;
|
||||
memberId: string;
|
||||
limit: {
|
||||
current: number;
|
||||
total: number;
|
||||
percentage: number;
|
||||
};
|
||||
avatar?: {
|
||||
url?: string;
|
||||
title?: string;
|
||||
};
|
||||
};
|
||||
|
||||
type CardPolicyProps = {
|
||||
limit: {
|
||||
myLimit: {
|
||||
balance: number;
|
||||
total: number;
|
||||
percentage: number;
|
||||
};
|
||||
lockLimit: {
|
||||
balance: number;
|
||||
percentage: number;
|
||||
};
|
||||
};
|
||||
topUpLimit: {
|
||||
companyName: string;
|
||||
policyNumber: number;
|
||||
totalMembers: number;
|
||||
totalCases: number;
|
||||
totalPersen: number;
|
||||
myLimit: {
|
||||
balance: number;
|
||||
total: number;
|
||||
percentage: number;
|
||||
};
|
||||
maxTopUp: number;
|
||||
};
|
||||
members?: DataMember[];
|
||||
};
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
export default function Index() {
|
||||
const { themeStretch } = useSettings();
|
||||
const { corporateValue } = useContext(UserCurrentCorporateContext);
|
||||
const controller = new AbortController();
|
||||
|
||||
const [memberData, setMemberData] = useState([]);
|
||||
const [policyData, setPolicyData] = useState<CardPolicyProps>();
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* setting up for the table */
|
||||
@@ -97,20 +31,6 @@ export default function Index() {
|
||||
setIsLoading: setIsLoading,
|
||||
};
|
||||
|
||||
/* ----------------------------- limit progress ----------------------------- */
|
||||
const BorderLinearProgress = styled(LinearProgress)(({ theme }) => ({
|
||||
height: 10,
|
||||
borderRadius: 6,
|
||||
[`&.${linearProgressClasses.colorPrimary}`]: {
|
||||
backgroundColor: '#D1F1F1',
|
||||
},
|
||||
[`& .${linearProgressClasses.bar}`]: {
|
||||
borderRadius: 6,
|
||||
backgroundColor: theme.palette.primary.main,
|
||||
},
|
||||
}));
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
/* ------------------------------ handle params ----------------------------- */
|
||||
const [searchParams, setSearchParams] = useSearchParams();
|
||||
const [appliedParams, setAppliedParams] = useState({});
|
||||
@@ -177,7 +97,7 @@ export default function Index() {
|
||||
};
|
||||
|
||||
const searchs = {
|
||||
// useSearchs: true,
|
||||
useSearchs: false,
|
||||
searchText: searchText,
|
||||
setSearchText: setSearchText,
|
||||
handleSearchSubmit: handleSearchSubmit,
|
||||
@@ -235,12 +155,6 @@ export default function Index() {
|
||||
label: 'Divisi',
|
||||
isSort: true,
|
||||
},
|
||||
// {
|
||||
// id: 'limit',
|
||||
// align: 'center',
|
||||
// label: 'Limit',
|
||||
// isSort: false,
|
||||
// },
|
||||
{
|
||||
id: 'status',
|
||||
align: 'center',
|
||||
@@ -256,54 +170,33 @@ export default function Index() {
|
||||
];
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
/* ----------------------------- handler action ----------------------------- */
|
||||
const handleAction = () => {
|
||||
alert('action');
|
||||
};
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
useEffect(() => {
|
||||
(async () => {
|
||||
setIsLoading(true);
|
||||
try {
|
||||
setIsLoading(true);
|
||||
|
||||
await new Promise((resolve) => setTimeout(resolve, 250));
|
||||
const parameters =
|
||||
Object.keys(appliedParams).length !== 0
|
||||
? appliedParams
|
||||
: Object.fromEntries([
|
||||
...searchParams.entries(),
|
||||
['order', order],
|
||||
['orderBy', orderBy],
|
||||
]);
|
||||
|
||||
const parameters =
|
||||
Object.keys(appliedParams).length !== 0
|
||||
? appliedParams
|
||||
: Object.fromEntries([...searchParams.entries(), ['order', order], ['orderBy', orderBy]]);
|
||||
const [divisionResponse, membersResponse] = await Promise.all([
|
||||
axios.get(`${corporateValue}/division`, { signal: controller.signal }),
|
||||
axios.get(`${corporateValue}/members`, {
|
||||
params: { ...parameters },
|
||||
signal: controller.signal,
|
||||
}),
|
||||
]);
|
||||
|
||||
const corporatePolicyLimit = await axios.get(`${corporateValue}/policy`);
|
||||
const corporateDivision = await axios.get(`${corporateValue}/division`);
|
||||
const corporateMembers = await axios.get(`${corporateValue}/members`, {
|
||||
params: { ...parameters },
|
||||
});
|
||||
|
||||
// console.log('member', corporateMembers);
|
||||
const corporateTopUpLimit = await axios.get(`${corporateValue}/topup`);
|
||||
|
||||
setSearchParams(parameters);
|
||||
setPolicyData({
|
||||
limit: corporatePolicyLimit.data.data,
|
||||
topUpLimit: corporateTopUpLimit.data.data,
|
||||
});
|
||||
setDivisionData(corporateDivision.data);
|
||||
setMemberData(
|
||||
corporateMembers.data.data.map((obj: any) => {
|
||||
return {
|
||||
setSearchParams(parameters);
|
||||
setDivisionData(divisionResponse.data);
|
||||
setMemberData(
|
||||
membersResponse.data.data.map((obj: any) => ({
|
||||
...obj,
|
||||
// limit: (
|
||||
// <Stack>
|
||||
// <BorderLinearProgress
|
||||
// variant="determinate"
|
||||
// value={obj.limit.percentage}
|
||||
// sx={{ mb: 1 }}
|
||||
// />
|
||||
// <Typography sx={{ typography: 'caption', color: '#637381' }}>
|
||||
// {fSplit(obj.limit.current)} / {fSplit(obj.limit.total)}
|
||||
// </Typography>
|
||||
// </Stack>
|
||||
// ),
|
||||
status:
|
||||
obj.status === 1 ? (
|
||||
<Button
|
||||
@@ -334,30 +227,28 @@ export default function Index() {
|
||||
Inactive
|
||||
</Button>
|
||||
),
|
||||
/* action: (
|
||||
<IconButton onClick={handleAction}>
|
||||
<MoreVertIcon />
|
||||
</IconButton>
|
||||
), */
|
||||
};
|
||||
})
|
||||
);
|
||||
setPaginationTable(corporateMembers.data);
|
||||
setRowsPerPage(corporateMembers.data.per_page);
|
||||
}))
|
||||
);
|
||||
setPaginationTable(membersResponse.data);
|
||||
setRowsPerPage(membersResponse.data.per_page);
|
||||
|
||||
if (searchParams.get('page')) {
|
||||
//@ts-ignore
|
||||
const currentPage = parseInt(searchParams.get('page')) - 1;
|
||||
if (searchParams.get('page')) {
|
||||
// @ts-ignore
|
||||
const currentPage = parseInt(searchParams.get('page')) - 1;
|
||||
paginationTable.current_page = currentPage;
|
||||
setPage(currentPage);
|
||||
}
|
||||
|
||||
paginationTable.current_page = currentPage;
|
||||
setPage(currentPage);
|
||||
setIsLoading(false);
|
||||
} catch (error: any) {
|
||||
console.error('Error fetching data:', error.message);
|
||||
}
|
||||
|
||||
setIsLoading(false);
|
||||
})();
|
||||
}, [appliedParams, searchParams, order, orderBy, setSearchParams, corporateValue]);
|
||||
|
||||
// console.log(policyData);
|
||||
return () => {
|
||||
controller.abort();
|
||||
};
|
||||
}, [appliedParams, searchParams, order, orderBy, setSearchParams, corporateValue]);
|
||||
|
||||
return (
|
||||
<Page title="Dashboard">
|
||||
@@ -369,12 +260,6 @@ export default function Index() {
|
||||
</Stack>
|
||||
|
||||
<Grid container spacing={2}>
|
||||
{/* <Grid item xs={12} lg={6} md={12}>
|
||||
<CardNotification data={itemList} />
|
||||
</Grid>
|
||||
<Grid item xs={12} lg={6} md={12}>
|
||||
<CardPolicy data={policyData} />
|
||||
</Grid> */}
|
||||
<Grid item xs={12} lg={12} md={12}>
|
||||
<Table
|
||||
headCells={headCells}
|
||||
|
||||
@@ -1,121 +1,26 @@
|
||||
/* ---------------------------------- react --------------------------------- */
|
||||
import { useState, SyntheticEvent } from 'react';
|
||||
/* ---------------------------------- @mui ---------------------------------- */
|
||||
import { Box, Tabs, Tab, Container, Grid, Card, Stack } from '@mui/material';
|
||||
import { styled } from '@mui/material/styles';
|
||||
import { Container, Grid } from '@mui/material';
|
||||
/* ------------------------------- components ------------------------------- */
|
||||
import Page from '../../components/Page';
|
||||
/* ---------------------------------- hooks --------------------------------- */
|
||||
import useSettings from '../../hooks/useSettings';
|
||||
import List from './List';
|
||||
import ServiceMonitoring from './ServiceMonitoring';
|
||||
import UserProfile from './UserProfile';
|
||||
|
||||
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() {
|
||||
const { themeStretch } = useSettings();
|
||||
|
||||
const [value, setValue] = useState(0);
|
||||
const handleChange = (event: SyntheticEvent, newValue: number) => {
|
||||
setValue(newValue);
|
||||
};
|
||||
|
||||
return (
|
||||
<Page title="Employee Data">
|
||||
<Container maxWidth={themeStretch ? false : 'xl'}>
|
||||
<HeaderBreadcrumbs
|
||||
heading={'Employee Data'}
|
||||
links={[
|
||||
{ name: 'Case Management', href: '/employee-data' },
|
||||
{ name: 'Employee Data', href: '/employee-data'}
|
||||
]}
|
||||
links={[{ name: 'Case Management' }, { name: 'Employee Data', href: '/employee-data' }]}
|
||||
/>
|
||||
<Grid container>
|
||||
<Grid item xs={12} lg={12} md={12}>
|
||||
<TabPanel value={value} index={0}>
|
||||
<List />
|
||||
</TabPanel>
|
||||
<List />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Container>
|
||||
|
||||
@@ -1,151 +1,24 @@
|
||||
/* ---------------------------------- @mui ---------------------------------- */
|
||||
import {
|
||||
Paper,
|
||||
Table,
|
||||
TableBody,
|
||||
TableCell,
|
||||
TableContainer,
|
||||
TableHead,
|
||||
TableRow,
|
||||
TextField,
|
||||
Stack,
|
||||
Button,
|
||||
TableSortLabel,
|
||||
Box,
|
||||
MenuItem
|
||||
} from '@mui/material';
|
||||
import { visuallyHidden } from '@mui/utils';
|
||||
import { Stack, MenuItem } from '@mui/material';
|
||||
/* ---------------------------------- axios --------------------------------- */
|
||||
// import axios from 'axios';
|
||||
import axios from '../../utils/axios';
|
||||
/* ---------------------------------- react --------------------------------- */
|
||||
import { useContext, useEffect, useState } from 'react';
|
||||
|
||||
/* -------------------------------- component ------------------------------- */
|
||||
import Iconify from '../../components/Iconify';
|
||||
import BaseTablePagination from '../../components/BaseTablePagination';
|
||||
import TableComponent from '../../components/Table';
|
||||
|
||||
/* ---------------------------------- hooks --------------------------------- */
|
||||
import useMap from '../../hooks/useMap';
|
||||
/* ---------------------------------- theme --------------------------------- */
|
||||
import palette from '../../theme/palette';
|
||||
import { UserCurrentCorporateContext } from '../../contexts/UserCurrentCorporate';
|
||||
import { HeadCell, Order, PaginationTableProps } from '../../@types/table';
|
||||
import { useSearchParams, useNavigate, Link } from 'react-router-dom';
|
||||
import { fDate, fDateSuffix } from '../../utils/formatTime';
|
||||
import { format } from 'date-fns';
|
||||
import { useSearchParams, useNavigate } from 'react-router-dom';
|
||||
import { fDateSuffix } from '../../utils/formatTime';
|
||||
import Typography from '@mui/material/Typography';
|
||||
import TableMoreMenu from '../../components/table/TableMoreMenu';
|
||||
import EditOutlinedIcon from '@mui/icons-material/EditOutlined';
|
||||
import VisibilityOutlinedIcon from '@mui/icons-material/VisibilityOutlined';
|
||||
import Label from '../../components/Label';
|
||||
import { enqueueSnackbar } from 'notistack';
|
||||
|
||||
|
||||
/* ---------------------------------- 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>
|
||||
// );
|
||||
// }
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
export default function List() {
|
||||
const navigate = useNavigate();
|
||||
|
||||
@@ -235,27 +108,23 @@ export default function List() {
|
||||
setSearchText: setSearchText,
|
||||
handleSearchSubmit: handleSearchSubmit,
|
||||
};
|
||||
const [startDateValue, setStartDateValue] = useState('');
|
||||
const [endDateValue, setEndDateValue] = useState('');
|
||||
const [statusValue, setStatusValue] = useState('all');
|
||||
|
||||
const handleExportReport = async (appliedFilter = null) => {
|
||||
axios.get(corporateValue + '/export-members/list').then((response) => {
|
||||
const handleExportReport = async () => {
|
||||
axios.get(corporateValue + '/export-members/list').then((response) => {
|
||||
const link = document.createElement('a');
|
||||
link.href = response.data.data.file_url;
|
||||
link.setAttribute('download', response.data.data.file_name);
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
// handleClose();
|
||||
});
|
||||
}
|
||||
};
|
||||
const exportReport = {
|
||||
useExport: true,
|
||||
startDate: startDateValue,
|
||||
endDate: endDateValue,
|
||||
status: statusValue,
|
||||
handleExportReport: handleExportReport
|
||||
}
|
||||
startDate: '',
|
||||
endDate: '',
|
||||
status: 'all',
|
||||
handleExportReport: handleExportReport,
|
||||
};
|
||||
|
||||
/* -------------------------------- headCell -------------------------------- */
|
||||
const headCells: HeadCell<never>[] = [
|
||||
@@ -271,7 +140,7 @@ export default function List() {
|
||||
label: 'Name',
|
||||
isSort: true,
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
id: 'start_date',
|
||||
align: 'center',
|
||||
@@ -313,68 +182,39 @@ export default function List() {
|
||||
const response = await axios.get(`${corporateValue}/members?type=employee-data`, {
|
||||
params: { ...parameters },
|
||||
});
|
||||
|
||||
|
||||
setSearchParams(parameters);
|
||||
setData(
|
||||
response.data.data.map((obj: any) => {
|
||||
return {
|
||||
...obj,
|
||||
// memberId:
|
||||
// <Button
|
||||
// onClick={() => navigate ('/employee-data/user-profile/'+obj.personId)}
|
||||
// >{obj.memberId}</Button>
|
||||
// ,
|
||||
status:
|
||||
obj.status === 1 ? (
|
||||
<Label color='success'>
|
||||
Active
|
||||
</Label>
|
||||
) : (
|
||||
<Label color='error'>
|
||||
Inactive
|
||||
</Label>
|
||||
),
|
||||
start_date:
|
||||
<Label>
|
||||
{obj.start_date ? fDateSuffix(obj.start_date) : ''}
|
||||
</Label>
|
||||
,
|
||||
end_date:
|
||||
<Label>
|
||||
{obj.end_date ? fDateSuffix(obj.end_date) : ''}
|
||||
</Label>
|
||||
,
|
||||
fullName:
|
||||
<Typography
|
||||
variant="body2"
|
||||
>
|
||||
{obj.fullName}
|
||||
</Typography>
|
||||
,
|
||||
memberId:
|
||||
<Typography
|
||||
variant="body2"
|
||||
>
|
||||
{obj.memberId}
|
||||
</Typography>
|
||||
,
|
||||
action:
|
||||
<TableMoreMenu actions={
|
||||
<>
|
||||
<MenuItem onClick={() => navigate ('/employee-data/user-profile/'+obj.personId)}>
|
||||
<VisibilityOutlinedIcon />
|
||||
View
|
||||
</MenuItem>
|
||||
</>
|
||||
} />
|
||||
};
|
||||
})
|
||||
response.data.data.map((obj: any) => ({
|
||||
...obj,
|
||||
status:
|
||||
obj.status === 1 ? (
|
||||
<Label color="success">Active</Label>
|
||||
) : (
|
||||
<Label color="error">Inactive</Label>
|
||||
),
|
||||
start_date: <Label>{obj.start_date ? fDateSuffix(obj.start_date) : ''}</Label>,
|
||||
end_date: <Label>{obj.end_date ? fDateSuffix(obj.end_date) : ''}</Label>,
|
||||
fullName: <Typography variant="body2">{obj.fullName}</Typography>,
|
||||
memberId: <Typography variant="body2">{obj.memberId}</Typography>,
|
||||
action: (
|
||||
<TableMoreMenu
|
||||
actions={
|
||||
<>
|
||||
<MenuItem onClick={() => navigate('/employee-data/user-profile/' + obj.personId)}>
|
||||
<VisibilityOutlinedIcon />
|
||||
View
|
||||
</MenuItem>
|
||||
</>
|
||||
}
|
||||
/>
|
||||
),
|
||||
}))
|
||||
);
|
||||
|
||||
setPaginationTable(response.data);
|
||||
setRowsPerPage(response.data.per_page);
|
||||
|
||||
|
||||
|
||||
if (searchParams.get('page')) {
|
||||
//@ts-ignore
|
||||
const currentPage = parseInt(searchParams.get('page')) - 1;
|
||||
|
||||
@@ -1,68 +1,73 @@
|
||||
// mui
|
||||
import { IconButton, Container, Grid, Stack, Typography } from '@mui/material';
|
||||
import { Container, Grid, Stack, Typography } from '@mui/material';
|
||||
// components
|
||||
import Page from '../../components/Page';
|
||||
import Iconify from '../../components/Iconify';
|
||||
// utils
|
||||
import useSettings from '../../hooks/useSettings';
|
||||
// section
|
||||
import CardPersonalInformation from '../../sections/alarm-center/user-profile/CardPersonalInformation';
|
||||
import CardFamilyInformation from '../../sections/alarm-center/user-profile/CardFamilyInformation';
|
||||
import CardPolicyNumber from '../../sections/alarm-center/user-profile/CardPolicyNumber';
|
||||
import CardBenefitSummary from '../../sections/alarm-center/user-profile/CardBenefitSummary';
|
||||
import CardClaimHistory from '../../sections/alarm-center/user-profile/CardClaimHistory';
|
||||
// react
|
||||
import { useNavigate, useParams } from 'react-router-dom';
|
||||
import ButtonBack from '../../components/ButtonBack';
|
||||
import { useEffect, useState, useContext } from 'react';
|
||||
import axios from '../../utils/axios';
|
||||
import { UserCurrentCorporateContext } from '../../contexts/UserCurrentCorporate';
|
||||
import ArrowBackIosIcon from '@mui/icons-material/ArrowBackIos';
|
||||
import CardPersonalInformation from '../../sections/employee-data/user-profile/CardPersonalInformation';
|
||||
import CardFamilyInformation from '../../sections/employee-data/user-profile/CardFamilyInformation';
|
||||
import { FamilyInformationtype, PersonalInformationType } from '../../@types/member';
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
type UserProfileDataType = {
|
||||
person: PersonalInformationType;
|
||||
families: FamilyInformationtype[];
|
||||
};
|
||||
|
||||
export default function UserProfile() {
|
||||
const { themeStretch } = useSettings();
|
||||
const navigate = useNavigate();
|
||||
const [data, setData] = useState();
|
||||
const [data, setData] = useState<UserProfileDataType>();
|
||||
const [loading, setLoading] = useState(true);
|
||||
|
||||
const { corporateValue } = useContext(UserCurrentCorporateContext);
|
||||
const { id } = useParams();
|
||||
|
||||
useEffect(() => {
|
||||
axios
|
||||
.get(corporateValue + '/members/' + id)
|
||||
.then((response) => {
|
||||
setData(response.data);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
(async () => {
|
||||
await axios
|
||||
.get(corporateValue + '/members/' + id)
|
||||
.then((response) => {
|
||||
setTimeout(() => {
|
||||
setData(response.data);
|
||||
setLoading(false);
|
||||
}, 1000);
|
||||
})
|
||||
.catch((error) => {
|
||||
if (error.response.data.statusCode === 404) {
|
||||
navigate(-1);
|
||||
} else {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
})();
|
||||
}, []);
|
||||
|
||||
// console.log('data', data);
|
||||
|
||||
return (
|
||||
<Page title="Profile">
|
||||
<Container maxWidth={themeStretch ? false : 'xl'}>
|
||||
<Stack direction="row" alignItems="center" sx={{ marginBottom: 3 }}>
|
||||
{/* <IconButton sx={{ marginRight: '10px', color: '#424242' }} onClick={() => navigate()}>
|
||||
<Iconify icon="heroicons-outline:arrow-narrow-left" />
|
||||
</IconButton> */}
|
||||
<ArrowBackIosIcon sx={{cursor:'pointer'}} onClick={() => navigate(-1)}/>
|
||||
<Typography variant="h5" sx={{marginLeft:2}}>Profile</Typography>
|
||||
<ArrowBackIosIcon sx={{ cursor: 'pointer' }} onClick={() => navigate(-1)} />
|
||||
<Typography variant="h5" sx={{ marginLeft: 2 }}>
|
||||
Profile
|
||||
</Typography>
|
||||
</Stack>
|
||||
{data ? (
|
||||
<Grid container spacing={2}>
|
||||
{/* Row 1 */}
|
||||
<Grid item xs={12} md={12}>
|
||||
<CardPersonalInformation data={data} />
|
||||
<CardPersonalInformation data={data?.person} />
|
||||
</Grid>
|
||||
<Grid item xs={12} md={12}>
|
||||
<CardFamilyInformation data={data} />
|
||||
<CardFamilyInformation data={data?.families} loading={loading} />
|
||||
</Grid>
|
||||
</Grid>
|
||||
) : ''}
|
||||
</Container>
|
||||
</Page>
|
||||
);
|
||||
|
||||
@@ -89,8 +89,8 @@ export default function Router() {
|
||||
},
|
||||
{
|
||||
path: '/employee-data/user-profile/:id',
|
||||
element: <EmployeeDataUserProfile/>,
|
||||
}
|
||||
element: <EmployeeDataUserProfile />,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -112,13 +112,12 @@ export default function Router() {
|
||||
element: <AlarmCenterMemberPerList />,
|
||||
},
|
||||
{
|
||||
path: 'member/:id/service-monitoring/:id',
|
||||
path: 'member/:memberId/service-monitoring/:requestLogId',
|
||||
element: <AlarmCenterServiceMonitoring />,
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
|
||||
|
||||
{
|
||||
path: '/claim-submit',
|
||||
element: (
|
||||
@@ -135,7 +134,7 @@ export default function Router() {
|
||||
},
|
||||
{
|
||||
path: 'dialog-detail',
|
||||
element: <DialogDetailClaim/>
|
||||
element: <DialogDetailClaim />,
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -155,7 +154,7 @@ export default function Router() {
|
||||
},
|
||||
{
|
||||
path: 'dialog-detail',
|
||||
element: <DialogDetailClaim/>
|
||||
element: <DialogDetailClaim />,
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -180,7 +179,7 @@ export default function Router() {
|
||||
{
|
||||
path: '/claim-report/detail-history/:id',
|
||||
element: <DetailHitoryClaimReport />,
|
||||
}
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -262,9 +261,9 @@ const AlarmCenterUserProfile = Loadable(lazy(() => import('../pages/AlarmCenter/
|
||||
const ClaimReport = Loadable(lazy(() => import('../pages/ClaimReport/Index')));
|
||||
const Claims = Loadable(lazy(() => import('../pages/Claims/Index')));
|
||||
const ClaimShow = Loadable(lazy(() => import('../pages/Claims/Show')));
|
||||
const DialogDetailClaim = Loadable(lazy(()=> import('../pages/ClaimReport/DialogDetailClaim')));
|
||||
const DetailClaimReport = Loadable(lazy(()=> import('../pages/ClaimReport/Detail')));
|
||||
const DetailHitoryClaimReport = Loadable(lazy(()=> import('../pages/ClaimReport/DetailHistory')));
|
||||
const DialogDetailClaim = Loadable(lazy(() => import('../pages/ClaimReport/DialogDetailClaim')));
|
||||
const DetailClaimReport = Loadable(lazy(() => import('../pages/ClaimReport/Detail')));
|
||||
const DetailHitoryClaimReport = Loadable(lazy(() => import('../pages/ClaimReport/DetailHistory')));
|
||||
|
||||
// Claim submit
|
||||
const ClaimSubmit = Loadable(lazy(() => import('../pages/ClaimSubmit/Index')));
|
||||
|
||||
@@ -20,20 +20,20 @@ import DialogClaimSubmitMember from './DialogClaimSubmitMember';
|
||||
|
||||
/* ---------------------------------- types --------------------------------- */
|
||||
|
||||
type DataMember = {
|
||||
id: number;
|
||||
fullName: string;
|
||||
memberId: string;
|
||||
limit: {
|
||||
current: number;
|
||||
total: number;
|
||||
percentage: number;
|
||||
};
|
||||
avatar?: {
|
||||
url?: string;
|
||||
title?: string;
|
||||
};
|
||||
};
|
||||
// type DataMember = {
|
||||
// id: number;
|
||||
// fullName: string;
|
||||
// memberId: string;
|
||||
// limit: {
|
||||
// current: number;
|
||||
// total: number;
|
||||
// percentage: number;
|
||||
// };
|
||||
// avatar?: {
|
||||
// url?: string;
|
||||
// title?: string;
|
||||
// };
|
||||
// };
|
||||
|
||||
type CardPolicyProps = {
|
||||
data: {
|
||||
@@ -99,7 +99,7 @@ export default function CardPolicy(props: CardPolicyProps) {
|
||||
const [dialogTitle, setDialogTitle] = useState('');
|
||||
const [isDialog, setIsDialog] = useState('');
|
||||
|
||||
const { limit, topUpLimit, members } = props.data || {};
|
||||
const { limit, topUpLimit } = props.data || {};
|
||||
if (!limit || !topUpLimit) {
|
||||
return null;
|
||||
}
|
||||
@@ -178,14 +178,14 @@ export default function CardPolicy(props: CardPolicyProps) {
|
||||
>
|
||||
Submit Claim
|
||||
</Button>
|
||||
<Button
|
||||
{/* <Button
|
||||
variant="contained"
|
||||
startIcon={<Iconify icon="heroicons-solid:cash" />}
|
||||
fullWidth={true}
|
||||
onClick={() => clickHandler('topUpLimit')}
|
||||
>
|
||||
Top Up
|
||||
</Button>
|
||||
</Button> */}
|
||||
</Stack>
|
||||
</>
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@ const ItemNotificationStyle = styled(Card)(({ theme }) => ({
|
||||
marginTop: 2,
|
||||
overflowY: 'auto',
|
||||
maxHeight: '154px',
|
||||
minHeight: '154px',
|
||||
gap: '0.5rem',
|
||||
}));
|
||||
|
||||
@@ -100,31 +101,37 @@ export default function CardNotification({ data }: NotificationProps) {
|
||||
</Button>
|
||||
</Stack>
|
||||
|
||||
<ItemNotificationStyle>
|
||||
{data
|
||||
? data.map(({ info, date, time }, index) => (
|
||||
<div key={index}>
|
||||
{index >= 1 ? <Divider sx={{ marginY: 0.5 }} /> : ''}
|
||||
<Stack direction="row" justifyContent="space-between" alignItems="center">
|
||||
<Stack direction="column" justifyContent="flex-start" alignItems="flex-start">
|
||||
<Typography sx={{ typography: 'caption' }}>{info}</Typography>
|
||||
<Link
|
||||
component="button"
|
||||
variant="caption"
|
||||
underline="always"
|
||||
onClick={() => clickHandler('infoDetail')}
|
||||
>
|
||||
Info Detail
|
||||
</Link>
|
||||
</Stack>
|
||||
<Stack direction="column" justifyContent="flex-start" alignItems="flex-start">
|
||||
<Typography sx={{ typography: 'caption', color: '#656565' }}>{date}</Typography>
|
||||
<Typography sx={{ typography: 'caption', color: '#656565' }}>{time}</Typography>
|
||||
</Stack>
|
||||
<ItemNotificationStyle
|
||||
sx={{ display: data?.length === 0 || data === undefined ? 'flex' : 'block' }}
|
||||
>
|
||||
{data ? (
|
||||
data.map(({ info, date, time }, index) => (
|
||||
<div key={index}>
|
||||
{index >= 1 ? <Divider sx={{ marginY: 0.5 }} /> : ''}
|
||||
<Stack direction="row" justifyContent="space-between" alignItems="center">
|
||||
<Stack direction="column" justifyContent="flex-start" alignItems="flex-start">
|
||||
<Typography sx={{ typography: 'caption' }}>{info}</Typography>
|
||||
<Link
|
||||
component="button"
|
||||
variant="caption"
|
||||
underline="always"
|
||||
onClick={() => clickHandler('infoDetail')}
|
||||
>
|
||||
Info Detail
|
||||
</Link>
|
||||
</Stack>
|
||||
</div>
|
||||
))
|
||||
: ''}
|
||||
<Stack direction="column" justifyContent="flex-start" alignItems="flex-start">
|
||||
<Typography sx={{ typography: 'caption', color: '#656565' }}>{date}</Typography>
|
||||
<Typography sx={{ typography: 'caption', color: '#656565' }}>{time}</Typography>
|
||||
</Stack>
|
||||
</Stack>
|
||||
</div>
|
||||
))
|
||||
) : (
|
||||
<Stack justifyContent="center" alignItems="center" flexGrow={1}>
|
||||
No Notification
|
||||
</Stack>
|
||||
)}
|
||||
</ItemNotificationStyle>
|
||||
|
||||
{isDialog === 'allNotification' && (
|
||||
|
||||
@@ -7,11 +7,12 @@ import {
|
||||
LinearProgress,
|
||||
linearProgressClasses,
|
||||
Stack,
|
||||
Skeleton,
|
||||
} from '@mui/material';
|
||||
// components
|
||||
import Iconify from '../../components/Iconify';
|
||||
// React
|
||||
import { useState } from 'react';
|
||||
import { Fragment, useState } from 'react';
|
||||
// utils
|
||||
import { fCurrency, fSplit } from '../../utils/formatNumber';
|
||||
/* -------------------------------- sections -------------------------------- */
|
||||
@@ -20,23 +21,23 @@ import DialogClaimSubmitMember from './DialogClaimSubmitMember';
|
||||
|
||||
/* ---------------------------------- types --------------------------------- */
|
||||
|
||||
type DataMember = {
|
||||
id: number;
|
||||
fullName: string;
|
||||
memberId: string;
|
||||
limit: {
|
||||
current: number;
|
||||
total: number;
|
||||
percentage: number;
|
||||
};
|
||||
avatar?: {
|
||||
url?: string;
|
||||
title?: string;
|
||||
};
|
||||
};
|
||||
// type DataMember = {
|
||||
// id: number;
|
||||
// fullName: string;
|
||||
// memberId: string;
|
||||
// limit: {
|
||||
// current: number;
|
||||
// total: number;
|
||||
// percentage: number;
|
||||
// };
|
||||
// avatar?: {
|
||||
// url?: string;
|
||||
// title?: string;
|
||||
// };
|
||||
// };
|
||||
|
||||
type CardPolicyProps = {
|
||||
data: {
|
||||
data?: {
|
||||
limit: {
|
||||
myLimit: {
|
||||
balance: number;
|
||||
@@ -61,10 +62,6 @@ type CardPolicyProps = {
|
||||
};
|
||||
maxTopUp: number;
|
||||
};
|
||||
members: {
|
||||
memberId: string;
|
||||
memberFullName: string;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -99,10 +96,7 @@ export default function CardPolicy(props: CardPolicyProps) {
|
||||
const [dialogTitle, setDialogTitle] = useState('');
|
||||
const [isDialog, setIsDialog] = useState('');
|
||||
|
||||
const { limit, topUpLimit, members } = props.data || {};
|
||||
if (!limit || !topUpLimit) {
|
||||
return null;
|
||||
}
|
||||
const { limit, topUpLimit } = props.data || {};
|
||||
|
||||
const clickHandler = (isDialog: string) => {
|
||||
switch (isDialog) {
|
||||
@@ -124,70 +118,108 @@ export default function CardPolicy(props: CardPolicyProps) {
|
||||
|
||||
return (
|
||||
<RootBalanceStyle>
|
||||
<>
|
||||
<Stack direction="row" justifyContent="space-between" sx={{ mb: 1 }}>
|
||||
<div>
|
||||
<Fragment>
|
||||
<Stack direction="row" justifyContent="space-between" sx={{ mb: 1 }} spacing={2}>
|
||||
<Stack>
|
||||
<Typography variant="body2" component="span" sx={{ opacity: 0.72 }}>
|
||||
Total Limit
|
||||
{limit ? (
|
||||
'Total Limit'
|
||||
) : (
|
||||
<Skeleton sx={{ bgcolor: 'grey.300' }} animation="wave" width={75} />
|
||||
)}
|
||||
</Typography>
|
||||
<Typography sx={{ typography: 'body2' }}>
|
||||
{fCurrency(limit.myLimit ? limit.myLimit.balance : 0)}
|
||||
{limit ? (
|
||||
fCurrency(limit.myLimit.balance ?? 0)
|
||||
) : (
|
||||
<Skeleton sx={{ bgcolor: 'grey.300' }} animation="wave" width={150} />
|
||||
)}
|
||||
</Typography>
|
||||
<Typography sx={{ typography: 'caption', color: '#919EAB' }}>
|
||||
/ {fSplit(limit.myLimit ? limit.myLimit.total : 0)}
|
||||
{limit ? (
|
||||
`/ ${fSplit(limit.myLimit.total ?? 0)}`
|
||||
) : (
|
||||
<Skeleton sx={{ bgcolor: 'grey.300' }} animation="wave" />
|
||||
)}
|
||||
</Typography>
|
||||
</div>
|
||||
</Stack>
|
||||
|
||||
<Stack direction="row" alignItems="center" justifyContent="center">
|
||||
<Typography variant="h5" sx={{ ml: 0.5 }}>
|
||||
{limit.myLimit ? limit.myLimit.percentage : 0}%
|
||||
{limit ? (
|
||||
`${limit.myLimit.percentage ?? 0}%`
|
||||
) : (
|
||||
<Skeleton sx={{ bgcolor: 'grey.300' }} animation="wave" width={70} />
|
||||
)}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Stack>
|
||||
|
||||
<BorderLinearProgress
|
||||
variant="determinate"
|
||||
value={limit.myLimit ? limit.myLimit.percentage : 0}
|
||||
sx={{ mb: 1 }}
|
||||
/>
|
||||
{limit ? (
|
||||
<BorderLinearProgress
|
||||
variant="determinate"
|
||||
value={limit.myLimit.percentage ?? 0}
|
||||
sx={{ mb: 1 }}
|
||||
/>
|
||||
) : (
|
||||
<Skeleton sx={{ bgcolor: 'grey.300' }} animation="wave" />
|
||||
)}
|
||||
|
||||
<Stack sx={{ backgroundColor: '#B2E8E8', paddingY: 1, paddingX: 1.5, mb: 2 }}>
|
||||
<Typography sx={{ typography: 'caption', display: 'flex', alignItems: 'center' }}>
|
||||
<Iconify
|
||||
icon="bxs:lock-alt"
|
||||
width={12}
|
||||
height={13}
|
||||
sx={{ color: '#424242', marginRight: '6px' }}
|
||||
/>
|
||||
<Typography variant="caption" component="span">
|
||||
Lock Fund ( {limit.lockLimit ? limit.lockLimit.percentage : 0}% )
|
||||
</Typography>
|
||||
{limit ? (
|
||||
<Fragment>
|
||||
<Iconify
|
||||
icon="bxs:lock-alt"
|
||||
width={12}
|
||||
height={13}
|
||||
sx={{ color: '#424242', marginRight: '6px' }}
|
||||
/>
|
||||
<Typography variant="caption" component="span">
|
||||
Lock Fund ( {limit.lockLimit.percentage ?? 0}% )
|
||||
</Typography>
|
||||
</Fragment>
|
||||
) : (
|
||||
<Skeleton sx={{ bgcolor: 'grey.300' }} animation="wave" width={130} />
|
||||
)}
|
||||
</Typography>
|
||||
<Typography sx={{ typography: 'caption', color: '#637381' }}>
|
||||
{fSplit(limit.lockLimit ? limit.lockLimit.balance : 0)} /{' '}
|
||||
{fSplit(limit.myLimit ? limit.myLimit.total : 0)}
|
||||
{limit ? (
|
||||
`${fSplit(limit.lockLimit.balance ?? 0)} / ${fSplit(limit.myLimit.total ?? 0)}`
|
||||
) : (
|
||||
<Skeleton sx={{ bgcolor: 'grey.300' }} animation="wave" width={120} />
|
||||
)}
|
||||
</Typography>
|
||||
</Stack>
|
||||
|
||||
<Stack direction="row" spacing={2}>
|
||||
<Button
|
||||
variant="outlined"
|
||||
startIcon={<Iconify icon="bi:clipboard-check-fill" />}
|
||||
fullWidth={true}
|
||||
onClick={() => clickHandler('submitClaim')}
|
||||
>
|
||||
Submit Claim
|
||||
</Button>
|
||||
<Button
|
||||
{limit ? (
|
||||
<Button
|
||||
variant="outlined"
|
||||
startIcon={<Iconify icon="bi:clipboard-check-fill" />}
|
||||
fullWidth={true}
|
||||
onClick={() => clickHandler('submitClaim')}
|
||||
>
|
||||
Submit Claim
|
||||
</Button>
|
||||
) : (
|
||||
<Skeleton
|
||||
sx={{ bgcolor: 'grey.300' }}
|
||||
animation="wave"
|
||||
height={'36px'}
|
||||
width={'100%'}
|
||||
/>
|
||||
)}
|
||||
{/* <Button
|
||||
variant="contained"
|
||||
startIcon={<Iconify icon="heroicons-solid:cash" />}
|
||||
fullWidth={true}
|
||||
onClick={() => clickHandler('topUpLimit')}
|
||||
>
|
||||
Top Up
|
||||
</Button>
|
||||
</Button> */}
|
||||
</Stack>
|
||||
</>
|
||||
</Fragment>
|
||||
|
||||
{isDialog === 'submitClaim' && (
|
||||
<DialogClaimSubmitMember
|
||||
|
||||
@@ -0,0 +1,180 @@
|
||||
/* ------------------------------- material ui ------------------------------ */
|
||||
import { Card, Typography, Grid, Skeleton, Stack } from '@mui/material';
|
||||
import { fDateBirth } from '../../../utils/formatTime';
|
||||
import { Fragment } from 'react';
|
||||
|
||||
type CardFamilyInformationProps = {
|
||||
data?: {
|
||||
name: string;
|
||||
relationship: string;
|
||||
dateOfBirth: string;
|
||||
email: string;
|
||||
phoneNumber: string;
|
||||
status: string;
|
||||
}[];
|
||||
loading: boolean;
|
||||
};
|
||||
|
||||
export default function CardFamilyInformation({ data, loading }: CardFamilyInformationProps) {
|
||||
if (loading) {
|
||||
return (
|
||||
<Card sx={{ borderRadius: 2, padding: 3 }}>
|
||||
<Grid container gap={5}>
|
||||
<Grid item xs={12}>
|
||||
<Typography component={'h6'} fontWeight={700}>
|
||||
<Skeleton animation={'wave'} width={200} />
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item container xs={12} spacing={3}>
|
||||
<Grid item xs={12} md={6}>
|
||||
<Card sx={{ borderRadius: 1.5, paddingX: 3, paddingY: 3.5 }}>
|
||||
<Grid container>
|
||||
<Grid item xs={12}>
|
||||
<Stack gap={0.5}>
|
||||
<Typography variant="subtitle1" color={'grey.800'}>
|
||||
<Skeleton animation={'wave'} width={250} />
|
||||
</Typography>
|
||||
<Typography variant="subtitle2" color={'grey.600'}>
|
||||
<Skeleton animation={'wave'} width={150} />
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid container xs={12} spacing={1} marginTop={3}>
|
||||
<Grid item xs={12} md={4}>
|
||||
<Typography variant="body2" color={'grey.600'}>
|
||||
<Skeleton animation={'wave'} />
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item xs={12} md={8}>
|
||||
<Typography variant="body2" color={'grey.800'}>
|
||||
<Skeleton animation={'wave'} />
|
||||
</Typography>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container xs={12} spacing={1}>
|
||||
<Grid item xs={12} md={4}>
|
||||
<Typography variant="body2" color={'grey.600'}>
|
||||
<Skeleton animation={'wave'} />
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item xs={12} md={8}>
|
||||
<Typography variant="body2" color={'grey.800'}>
|
||||
<Skeleton animation={'wave'} />
|
||||
</Typography>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container xs={12} spacing={1}>
|
||||
<Grid item xs={12} md={4}>
|
||||
<Typography variant="body2" color={'grey.600'}>
|
||||
<Skeleton animation={'wave'} />
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item xs={12} md={8}>
|
||||
<Typography variant="body2" color={'grey.800'}>
|
||||
<Skeleton animation={'wave'} />
|
||||
</Typography>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container xs={12} spacing={1}>
|
||||
<Grid item xs={12} md={4}>
|
||||
<Typography variant="body2" color={'grey.600'}>
|
||||
<Skeleton animation={'wave'} />
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item xs={12} md={8}>
|
||||
<Typography variant="body2" color={'grey.800'}>
|
||||
<Skeleton animation={'wave'} />
|
||||
</Typography>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Card>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Card>
|
||||
);
|
||||
} else {
|
||||
return data && data.length > 0 ? (
|
||||
<Card sx={{ borderRadius: 2, padding: 3 }}>
|
||||
<Grid container gap={5}>
|
||||
<Grid item xs={12}>
|
||||
<Typography component={'h6'} fontWeight={700}>
|
||||
Beneficiary / Family
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item container xs={12} spacing={3}>
|
||||
{data.map((familyMember, index) => (
|
||||
<Grid item xs={12} md={6} key={index}>
|
||||
<Card sx={{ borderRadius: 1.5, paddingX: 3, paddingY: 3.5 }}>
|
||||
<Grid container>
|
||||
<Grid item xs={12}>
|
||||
<Stack gap={0.5}>
|
||||
<Typography variant="subtitle1" color={'grey.800'}>
|
||||
{familyMember.name ? familyMember.name : '-'}
|
||||
</Typography>
|
||||
<Typography variant="subtitle2" color={'grey.600'}>
|
||||
{familyMember.relationship ? familyMember.relationship : '-'}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid container xs={12} marginTop={3}>
|
||||
<Grid item xs={12} md={4}>
|
||||
<Typography variant="body2" color={'grey.600'}>
|
||||
Date Of Birth
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item xs={12} md={8}>
|
||||
<Typography variant="body2" color={'grey.800'}>
|
||||
{familyMember.dateOfBirth ? fDateBirth(familyMember.dateOfBirth) : '-'}
|
||||
</Typography>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container xs={12}>
|
||||
<Grid item xs={12} md={4}>
|
||||
<Typography variant="body2" color={'grey.600'}>
|
||||
Email
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item xs={12} md={8}>
|
||||
<Typography variant="body2" color={'grey.800'}>
|
||||
{familyMember.email ? familyMember.email : '-'}
|
||||
</Typography>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container xs={12}>
|
||||
<Grid item xs={12} md={4}>
|
||||
<Typography variant="body2" color={'grey.600'}>
|
||||
Phone Number
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item xs={12} md={8}>
|
||||
<Typography variant="body2" color={'grey.800'}>
|
||||
{familyMember.phoneNumber ? familyMember.phoneNumber : '-'}
|
||||
</Typography>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container xs={12}>
|
||||
<Grid item xs={12} md={4}>
|
||||
<Typography variant="body2" color={'grey.600'}>
|
||||
Status
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item xs={12} md={8}>
|
||||
<Typography variant="body2" color={'grey.800'}>
|
||||
{familyMember.status ? familyMember.status : '-'}
|
||||
</Typography>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Card>
|
||||
</Grid>
|
||||
))}
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Card>
|
||||
) : (
|
||||
<Fragment />
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,280 @@
|
||||
/* ------------------------------- Material UI ------------------------------ */
|
||||
import { Card, Stack, Typography, Grid, Skeleton } from '@mui/material';
|
||||
import { fDateBirth } from '../../../utils/formatTime';
|
||||
|
||||
type CardPersonalInformationProps = {
|
||||
data?: {
|
||||
name: string;
|
||||
weight: number;
|
||||
height: number;
|
||||
placeOfBirth: string;
|
||||
dateOfBirth: string;
|
||||
gender: string;
|
||||
phoneNumber: string;
|
||||
email: string;
|
||||
address: string;
|
||||
idNumber: string;
|
||||
religion: string;
|
||||
maritalStatus: string;
|
||||
education: string;
|
||||
occupation: string;
|
||||
};
|
||||
};
|
||||
|
||||
export default function CardPersonalInformation({ data }: CardPersonalInformationProps) {
|
||||
return (
|
||||
<Card sx={{ borderRadius: 2, padding: 3 }}>
|
||||
<Grid container gap={5}>
|
||||
<Grid item xs={12}>
|
||||
<Typography component={'h6'} fontWeight={700}>
|
||||
{data ? 'Personal Information' : <Skeleton animation={'wave'} width={200} />}
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item container xs={12} spacing={3}>
|
||||
{/* First */}
|
||||
<Grid item xs={12} md={4}>
|
||||
<Stack gap={1.5}>
|
||||
<Typography variant="subtitle2" color={'grey.600'}>
|
||||
{data ? 'Full Name' : <Skeleton animation={'wave'} width={200} />}
|
||||
</Typography>
|
||||
<Typography variant="subtitle1" color={'grey.800'}>
|
||||
{data ? data.name ? data.name : '-' : <Skeleton animation={'wave'} width={125} />}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} md={4}>
|
||||
<Stack gap={1.5}>
|
||||
<Typography variant="subtitle2" color={'grey.600'}>
|
||||
{data ? 'Weight' : <Skeleton animation={'wave'} width={200} />}
|
||||
</Typography>
|
||||
<Typography variant="subtitle1" color={'grey.800'}>
|
||||
{data ? (
|
||||
data.weight ? (
|
||||
`${data.weight} kg`
|
||||
) : (
|
||||
'-'
|
||||
)
|
||||
) : (
|
||||
<Skeleton animation={'wave'} width={125} />
|
||||
)}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} md={4}>
|
||||
<Stack gap={1.5}>
|
||||
<Typography variant="subtitle2" color={'grey.600'}>
|
||||
{data ? 'Height' : <Skeleton animation={'wave'} width={200} />}
|
||||
</Typography>
|
||||
<Typography variant="subtitle1" color={'grey.800'}>
|
||||
{data ? (
|
||||
data.height ? (
|
||||
`${data.height} cm`
|
||||
) : (
|
||||
'-'
|
||||
)
|
||||
) : (
|
||||
<Skeleton animation={'wave'} width={125} />
|
||||
)}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
{/* Second */}
|
||||
<Grid item xs={12} md={4}>
|
||||
<Stack gap={1.5}>
|
||||
<Typography variant="subtitle2" color={'grey.600'}>
|
||||
{data ? 'Place of Birth' : <Skeleton animation={'wave'} width={200} />}
|
||||
</Typography>
|
||||
<Typography variant="subtitle1" color={'grey.800'}>
|
||||
{data ? (
|
||||
data.placeOfBirth ? (
|
||||
data.placeOfBirth
|
||||
) : (
|
||||
'-'
|
||||
)
|
||||
) : (
|
||||
<Skeleton animation={'wave'} width={125} />
|
||||
)}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} md={4}>
|
||||
<Stack gap={1.5}>
|
||||
<Typography variant="subtitle2" color={'grey.600'}>
|
||||
{data ? 'Date of Birth' : <Skeleton animation={'wave'} width={200} />}
|
||||
</Typography>
|
||||
<Typography variant="subtitle1" color={'grey.800'}>
|
||||
{data ? (
|
||||
data.dateOfBirth ? (
|
||||
fDateBirth(data.dateOfBirth)
|
||||
) : (
|
||||
'-'
|
||||
)
|
||||
) : (
|
||||
<Skeleton animation={'wave'} width={125} />
|
||||
)}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} md={4}>
|
||||
<Stack gap={1.5}>
|
||||
<Typography variant="subtitle2" color={'grey.600'}>
|
||||
{data ? 'Gender' : <Skeleton animation={'wave'} width={200} />}
|
||||
</Typography>
|
||||
<Typography variant="subtitle1" color={'grey.800'}>
|
||||
{data ? (
|
||||
data.gender ? (
|
||||
data.gender
|
||||
) : (
|
||||
'-'
|
||||
)
|
||||
) : (
|
||||
<Skeleton animation={'wave'} width={125} />
|
||||
)}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
{/* Third */}
|
||||
<Grid item xs={12} md={4}>
|
||||
<Stack gap={1.5}>
|
||||
<Typography variant="subtitle2" color={'grey.600'}>
|
||||
{data ? 'Phone Number' : <Skeleton animation={'wave'} width={200} />}
|
||||
</Typography>
|
||||
<Typography variant="subtitle1" color={'grey.800'}>
|
||||
{data ? (
|
||||
data.phoneNumber ? (
|
||||
data.phoneNumber
|
||||
) : (
|
||||
'-'
|
||||
)
|
||||
) : (
|
||||
<Skeleton animation={'wave'} width={125} />
|
||||
)}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={8}>
|
||||
<Stack gap={1.5}>
|
||||
<Typography variant="subtitle2" color={'grey.600'}>
|
||||
{data ? 'Email' : <Skeleton animation={'wave'} width={200} />}
|
||||
</Typography>
|
||||
<Typography variant="subtitle1" color={'grey.800'}>
|
||||
{data ? data.email ? data.email : '-' : <Skeleton animation={'wave'} width={125} />}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
{/* Four */}
|
||||
<Grid item xs={12}>
|
||||
<Stack gap={1.5}>
|
||||
<Typography variant="subtitle2" color={'grey.600'}>
|
||||
{data ? 'Address' : <Skeleton animation={'wave'} width={200} />}
|
||||
</Typography>
|
||||
<Typography variant="subtitle1" color={'grey.800'}>
|
||||
{data ? (
|
||||
data.address ? (
|
||||
data.address
|
||||
) : (
|
||||
'-'
|
||||
)
|
||||
) : (
|
||||
<Skeleton animation={'wave'} width={125} />
|
||||
)}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
{/* Five */}
|
||||
<Grid item xs={12} md={4}>
|
||||
<Stack gap={1.5}>
|
||||
<Typography variant="subtitle2" color={'grey.600'}>
|
||||
{data ? 'ID Number' : <Skeleton animation={'wave'} width={200} />}
|
||||
</Typography>
|
||||
<Typography variant="subtitle1" color={'grey.800'}>
|
||||
{data ? (
|
||||
data.idNumber ? (
|
||||
data.idNumber
|
||||
) : (
|
||||
'-'
|
||||
)
|
||||
) : (
|
||||
<Skeleton animation={'wave'} width={125} />
|
||||
)}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={8}>
|
||||
<Stack gap={1.5}>
|
||||
<Typography variant="subtitle2" color={'grey.600'}>
|
||||
{data ? 'Religion' : <Skeleton animation={'wave'} width={200} />}
|
||||
</Typography>
|
||||
<Typography variant="subtitle1" color={'grey.800'}>
|
||||
{data ? (
|
||||
data.religion ? (
|
||||
data.religion
|
||||
) : (
|
||||
'-'
|
||||
)
|
||||
) : (
|
||||
<Skeleton animation={'wave'} width={125} />
|
||||
)}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
{/* Six */}
|
||||
<Grid item xs={12} md={4}>
|
||||
<Stack gap={1.5}>
|
||||
<Typography variant="subtitle2" color={'grey.600'}>
|
||||
{data ? 'Marital Status' : <Skeleton animation={'wave'} width={200} />}
|
||||
</Typography>
|
||||
<Typography variant="subtitle1" color={'grey.800'}>
|
||||
{data ? (
|
||||
data.maritalStatus ? (
|
||||
data.maritalStatus
|
||||
) : (
|
||||
'-'
|
||||
)
|
||||
) : (
|
||||
<Skeleton animation={'wave'} width={125} />
|
||||
)}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} md={4}>
|
||||
<Stack gap={1.5}>
|
||||
<Typography variant="subtitle2" color={'grey.600'}>
|
||||
{data ? 'Education' : <Skeleton animation={'wave'} width={200} />}
|
||||
</Typography>
|
||||
<Typography variant="subtitle1" color={'grey.800'}>
|
||||
{data ? (
|
||||
data.education ? (
|
||||
data.education
|
||||
) : (
|
||||
'-'
|
||||
)
|
||||
) : (
|
||||
<Skeleton animation={'wave'} width={125} />
|
||||
)}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} md={4}>
|
||||
<Stack gap={1.5}>
|
||||
<Typography variant="subtitle2" color={'grey.600'}>
|
||||
{data ? 'Occupation' : <Skeleton animation={'wave'} width={200} />}
|
||||
</Typography>
|
||||
<Typography variant="subtitle1" color={'grey.800'}>
|
||||
{data ? (
|
||||
data.occupation ? (
|
||||
data.occupation
|
||||
) : (
|
||||
'-'
|
||||
)
|
||||
) : (
|
||||
<Skeleton animation={'wave'} width={125} />
|
||||
)}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
@@ -1,27 +1,13 @@
|
||||
import axios from 'axios';
|
||||
// config
|
||||
import { HOST_API } from '../config';
|
||||
|
||||
import { getSession } from './token';
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
const token = getSession();
|
||||
|
||||
const axiosInstance = axios.create({
|
||||
baseURL: HOST_API,
|
||||
// headers: {
|
||||
// 'X-Requested-With': 'XMLHttpRequest',
|
||||
// },
|
||||
// withCredentials: true,
|
||||
// headers: {
|
||||
// Authorization: `Bearer ${token}`
|
||||
// }
|
||||
});
|
||||
|
||||
axiosInstance.interceptors.response.use(
|
||||
(response) => response,
|
||||
(error) => Promise.reject((error) || 'Something went wrong')
|
||||
(error) => Promise.reject(error || 'Something went wrong')
|
||||
);
|
||||
|
||||
export default axiosInstance;
|
||||
|
||||
@@ -7,6 +7,10 @@ export function fDate(date: Date | string | number) {
|
||||
return format(new Date(date), 'dd MMMM yyyy');
|
||||
}
|
||||
|
||||
export function fDateBirth(date: Date | string | number) {
|
||||
return format(new Date(date), 'dd MMM yyyy');
|
||||
}
|
||||
|
||||
export function fDateTime(date: Date | string | number) {
|
||||
return format(new Date(date), 'dd MMM yyyy hh:mm');
|
||||
}
|
||||
@@ -19,7 +23,6 @@ export function fDateTimeSuffix(date: Date | string | number) {
|
||||
return format(new Date(date), 'dd/MM/yyyy hh:mm p');
|
||||
}
|
||||
|
||||
|
||||
export function fDateSuffix(date: Date | string | number) {
|
||||
return format(new Date(date), 'dd MMM yyyy');
|
||||
}
|
||||
|
||||
@@ -1,36 +1,39 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<!-- Favicon -->
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/favicon/apple-touch-icon.png" />
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="/favicon/favicon-32x32.png" />
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="/favicon/favicon-16x16.png" />
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<!-- Favicon -->
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/favicon/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="/favicon/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="/favicon/favicon-16x16.png">
|
||||
<meta name="theme-color" content="#000000" />
|
||||
<link rel="manifest" href="/manifest.json" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
||||
|
||||
<meta name="theme-color" content="#000000" />
|
||||
<link rel="manifest" href="/manifest.json" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
||||
<!-- Using Google Font -->
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" />
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css2?family=Public+Sans:wght@400;500;600;700&display=swap"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
|
||||
<!-- Using Google Font -->
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com">
|
||||
<link href="https://fonts.googleapis.com/css2?family=Public+Sans:wght@400;500;600;700&display=swap" rel="stylesheet">
|
||||
<!-- Using Local Font -->
|
||||
<link rel="stylesheet" type="text/css" href="/fonts/index.css" />
|
||||
|
||||
<!-- Using Local Font -->
|
||||
<link rel="stylesheet" type="text/css" href="/fonts/index.css" />
|
||||
<title>Dashboard</title>
|
||||
<meta
|
||||
name="description"
|
||||
content="The starting point for your next project with Minimal UI Kit, built on the newest version of Material-UI ©, ready to be customized to your style"
|
||||
/>
|
||||
<meta name="keywords" content="react,material,kit,application,dashboard,admin,template" />
|
||||
<meta name="author" content="Minimal UI Kit" />
|
||||
</head>
|
||||
|
||||
<title>Dashboard</title>
|
||||
<meta name="description"
|
||||
content="The starting point for your next project with Minimal UI Kit, built on the newest version of Material-UI ©, ready to be customized to your style" />
|
||||
<meta name="keywords" content="react,material,kit,application,dashboard,admin,template" />
|
||||
<meta name="author" content="Minimal UI Kit" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
<div id="root"></div>
|
||||
|
||||
<script type="module" src="/src/index.tsx"></script>
|
||||
</body>
|
||||
<body>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
<div id="root"></div>
|
||||
|
||||
<script type="module" src="/src/index.tsx"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
9996
frontend/dashboard/package-lock.json
generated
9996
frontend/dashboard/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -362,7 +362,7 @@ export default function List() {
|
||||
<TableCell align="left">
|
||||
{ row.status_final_log == "requested" ?
|
||||
(<Label variant='ghost' color='primary'>{capitalizeFirstLetter(row.status_final_log)}</Label>) :
|
||||
row.status_final_log == "declined" ?
|
||||
row.status_final_log == "declined" ?
|
||||
(<Label color='error'> {capitalizeFirstLetter(row.status_final_log)}</Label>)
|
||||
:
|
||||
(<Label color='success'> {capitalizeFirstLetter(row.status_final_log)}</Label>)
|
||||
|
||||
@@ -342,8 +342,8 @@ export default function List() {
|
||||
</IconButton>
|
||||
</TableCell>
|
||||
<TableCell align="left">{row.health_care?.sHealthCare ?? '-'}</TableCell>
|
||||
<TableCell align="left">{row.detail?.sPaymentDetails?.settlement_time ?? '-'}</TableCell>
|
||||
<TableCell align="left">{row.detail?.dTanggalAppointment ?? ''}</TableCell>
|
||||
<TableCell align="left">{row.detail?.sPaymentDetails?.settlement_time ?? row.detail?.sPaymentDetails?.transaction_time}</TableCell>
|
||||
<TableCell align="left">{row.detail?.dTanggalAppointment == '0000-00-00' ? fDateOnly(row.detail?.dCreateOn) : row.detail?.dTanggalAppointment }</TableCell>
|
||||
<TableCell align="left">{row.nID}</TableCell>
|
||||
<TableCell align="left">{row.sBookingCode ?? ''}</TableCell>
|
||||
<TableCell align="left">{row.doctor?.user?.full_name ?? '-'}</TableCell>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
1
frontend/hospital-portal/.env.production
Normal file
1
frontend/hospital-portal/.env.production
Normal file
@@ -0,0 +1 @@
|
||||
VITE_API_URL="https://primecenter-api.linksehat.com/api/v1/hospitalportal"
|
||||
@@ -1,36 +1,39 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<!-- Favicon -->
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/favicon/apple-touch-icon.png" />
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="/favicon/favicon-32x32.png" />
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="/favicon/favicon-16x16.png" />
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<!-- Favicon -->
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/favicon/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="/favicon/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="/favicon/favicon-16x16.png">
|
||||
<meta name="theme-color" content="#000000" />
|
||||
<link rel="manifest" href="/manifest.json" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
||||
|
||||
<meta name="theme-color" content="#000000" />
|
||||
<link rel="manifest" href="/manifest.json" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
||||
<!-- Using Google Font -->
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" />
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css2?family=Public+Sans:wght@400;500;600;700&display=swap"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
|
||||
<!-- Using Google Font -->
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com">
|
||||
<link href="https://fonts.googleapis.com/css2?family=Public+Sans:wght@400;500;600;700&display=swap" rel="stylesheet">
|
||||
<!-- Using Local Font -->
|
||||
<link rel="stylesheet" type="text/css" href="/fonts/index.css" />
|
||||
|
||||
<!-- Using Local Font -->
|
||||
<link rel="stylesheet" type="text/css" href="/fonts/index.css" />
|
||||
<title>Dashboard</title>
|
||||
<meta
|
||||
name="description"
|
||||
content="The starting point for your next project with Minimal UI Kit, built on the newest version of Material-UI ©, ready to be customized to your style"
|
||||
/>
|
||||
<meta name="keywords" content="react,material,kit,application,dashboard,admin,template" />
|
||||
<meta name="author" content="Minimal UI Kit" />
|
||||
</head>
|
||||
|
||||
<title>Dashboard</title>
|
||||
<meta name="description"
|
||||
content="The starting point for your next project with Minimal UI Kit, built on the newest version of Material-UI ©, ready to be customized to your style" />
|
||||
<meta name="keywords" content="react,material,kit,application,dashboard,admin,template" />
|
||||
<meta name="author" content="Minimal UI Kit" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
<div id="root"></div>
|
||||
|
||||
<script type="module" src="/src/index.tsx?v=<?php echo time(); ?>"></script>
|
||||
</body>
|
||||
<body>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
<div id="root"></div>
|
||||
|
||||
<script type="module" src="/src/index.tsx"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
1
public/client-portal/assets/ArrowBackIos.720b1306.js
Normal file
1
public/client-portal/assets/ArrowBackIos.720b1306.js
Normal file
@@ -0,0 +1 @@
|
||||
import{r,i as a,a as t}from"./jsx-runtime_commonjs-proxy.08daee49.js";var e={},o=a.exports;Object.defineProperty(e,"__esModule",{value:!0});var u=e.default=void 0,i=o(r()),d=t,l=(0,i.default)((0,d.jsx)("path",{d:"M11.67 3.87 9.9 2.1 0 12l9.9 9.9 1.77-1.77L3.54 12z"}),"ArrowBackIos");u=e.default=l;export{u as d};
|
||||
1
public/client-portal/assets/Box.522fc68e.js
Normal file
1
public/client-portal/assets/Box.522fc68e.js
Normal file
@@ -0,0 +1 @@
|
||||
import{a7 as o}from"./index.4524613b.js";const t=o(),r=t;export{r as B};
|
||||
@@ -1 +0,0 @@
|
||||
import{ac as o}from"./index.52c19e01.js";const t=o(),c=t;export{c as B};
|
||||
@@ -1 +1 @@
|
||||
import{a as d,g as u,s as C,P as p,r as f,u as m,e as x,_ as n,j as h,h as y,i as g}from"./index.52c19e01.js";function v(s){return d("MuiCard",s)}u("MuiCard",["root"]);const w=["className","raised"],M=s=>{const{classes:e}=s;return g({root:["root"]},v,e)},P=C(p,{name:"MuiCard",slot:"Root",overridesResolver:(s,e)=>e.root})(()=>({overflow:"hidden"})),R=f.exports.forwardRef(function(e,t){const o=m({props:e,name:"MuiCard"}),{className:i,raised:r=!1}=o,l=x(o,w),a=n({},o,{raised:r}),c=M(a);return h(P,n({className:y(c.root,i),elevation:r?8:void 0,ref:t,ownerState:a},l))}),_=R;export{_ as C};
|
||||
import{a as d,g as u,s as C,P as p,r as f,u as m,e as x,_ as n,j as h,h as y,i as g}from"./index.4524613b.js";function v(s){return d("MuiCard",s)}u("MuiCard",["root"]);const w=["className","raised"],M=s=>{const{classes:e}=s;return g({root:["root"]},v,e)},P=C(p,{name:"MuiCard",slot:"Root",overridesResolver:(s,e)=>e.root})(()=>({overflow:"hidden"})),R=f.exports.forwardRef(function(e,t){const o=m({props:e,name:"MuiCard"}),{className:i,raised:r=!1}=o,l=x(o,w),a=n({},o,{raised:r}),c=M(a);return h(P,n({className:y(c.root,i),elevation:r?8:void 0,ref:t,ownerState:a},l))}),_=R;export{_ as C};
|
||||
1
public/client-portal/assets/Checkbox.e8ad52b3.js
Normal file
1
public/client-portal/assets/Checkbox.e8ad52b3.js
Normal file
@@ -0,0 +1 @@
|
||||
import{c as h,j as t,g as P,a as B,s as g,aQ as S,b as v,_ as n,a6 as M,r as d,u as _,e as H,h as R,i as O}from"./index.4524613b.js";import{S as U}from"./SwitchBase.e250c68d.js";const V=h(t("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),j=h(t("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),L=h(t("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");function N(o){return B("MuiCheckbox",o)}const w=P("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary"]),p=w,E=["checkedIcon","color","icon","indeterminate","indeterminateIcon","inputProps","size","className"],F=o=>{const{classes:e,indeterminate:c,color:s}=o,r={root:["root",c&&"indeterminate",`color${v(s)}`]},a=O(r,N,e);return n({},e,a)},Q=g(U,{shouldForwardProp:o=>S(o)||o==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(o,e)=>{const{ownerState:c}=o;return[e.root,c.indeterminate&&e.indeterminate,c.color!=="default"&&e[`color${v(c.color)}`]]}})(({theme:o,ownerState:e})=>n({color:(o.vars||o).palette.text.secondary},!e.disableRipple&&{"&:hover":{backgroundColor:o.vars?`rgba(${e.color==="default"?o.vars.palette.action.activeChannel:o.vars.palette.primary.mainChannel} / ${o.vars.palette.action.hoverOpacity})`:M(e.color==="default"?o.palette.action.active:o.palette[e.color].main,o.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},e.color!=="default"&&{[`&.${p.checked}, &.${p.indeterminate}`]:{color:(o.vars||o).palette[e.color].main},[`&.${p.disabled}`]:{color:(o.vars||o).palette.action.disabled}})),T=t(j,{}),W=t(V,{}),q=t(L,{}),A=d.exports.forwardRef(function(e,c){var s,r;const a=_({props:e,name:"MuiCheckbox"}),{checkedIcon:b=T,color:f="primary",icon:I=W,indeterminate:i=!1,indeterminateIcon:u=q,inputProps:z,size:l="medium",className:$}=a,y=H(a,E),m=i?u:I,C=i?u:b,k=n({},a,{color:f,indeterminate:i,size:l}),x=F(k);return t(Q,n({type:"checkbox",inputProps:n({"data-indeterminate":i},z),icon:d.exports.cloneElement(m,{fontSize:(s=m.props.fontSize)!=null?s:l}),checkedIcon:d.exports.cloneElement(C,{fontSize:(r=C.props.fontSize)!=null?r:l}),ownerState:k,ref:c,className:R(x.root,$)},y,{classes:x}))}),J=A;export{J as C};
|
||||
1
public/client-portal/assets/Close.10859109.js
Normal file
1
public/client-portal/assets/Close.10859109.js
Normal file
File diff suppressed because one or more lines are too long
1
public/client-portal/assets/Detail.47a133d1.js
Normal file
1
public/client-portal/assets/Detail.47a133d1.js
Normal file
File diff suppressed because one or more lines are too long
1
public/client-portal/assets/DetailHistory.165c4876.js
Normal file
1
public/client-portal/assets/DetailHistory.165c4876.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
import{au as x,n as g,r as l,Z as b,a0 as v,f as i,F as y,S as n,T as a,j as e,B as w,D as s,q as D}from"./index.4524613b.js";import{c as d,b as C}from"./formatTime.0646b9d0.js";import{S,a as j,b as I}from"./Stepper.3a0cdbba.js";import{C as p}from"./Card.4734268d.js";import"./index.49ea62c1.js";const Y=["Review","Approval","Disbursement"],U=()=>{const{id:h}=x(),m=g(),{corporateValue:c}=l.exports.useContext(b),[f,k]=l.exports.useState(c),[t,u]=l.exports.useState(null);return l.exports.useEffect(()=>{v.get(`${c}/claim-report/${h}`).then(r=>{u(r.data.data)}).catch(r=>{console.error("Terjadi kesalahan:",r)})},[]),l.exports.useEffect(()=>{f!==c&&m("/claim-report")},[c]),i(y,{children:[i(n,{alignItems:"center",justifyContent:"space-between",direction:"row",sx:{marginTop:1},children:[i(a,{variant:"subtitle1",sx:{height:"max-content"},children:["Claim Request for ",t==null?void 0:t.fullName]}),i(n,{children:[e(a,{variant:"caption",children:"Submission date"}),e(a,{variant:"caption",children:d(t?t.submissionDate:new Date,"dd / MM / yyyy")})]})]}),e(w,{sx:{width:"100%",marginTop:2},children:e(S,{activeStep:(t==null?void 0:t.status)==="approved"?1:(t==null?void 0:t.status)==="requested"?0:2,alternativeLabel:!0,children:Y.map(r=>e(j,{children:e(I,{children:r})},r))})}),e(n,{marginTop:2,children:e(a,{variant:"subtitle1",paddingY:2,children:C(t?t==null?void 0:t.histories[0].created_at:new Date)})}),i(n,{direction:"row",spacing:2,children:[e(s,{orientation:"vertical",flexItem:!0,sx:{borderStyle:"dashed"}}),i(n,{spacing:2,sx:{flex:1,maxWidth:"100%"},children:[t==null?void 0:t.histories.map((r,o)=>i(p,{sx:{paddingY:2,paddingX:3},children:[e(n,{direction:"row",justifyContent:"space-between",alignItems:"center",children:i(a,{variant:"body1",children:[d(r.created_at,"HH:mm")," WIB"]})}),e(s,{sx:{marginY:2}}),i(n,{children:[i(a,{variant:"subtitle2",color:"#404040",children:["Details : ",r.description]}),e(a,{variant:"caption",color:"#757575",sx:{marginTop:2,marginBottom:1},children:r.title})]})]},`${r.title}-${o}`)),i(p,{sx:{paddingY:2,paddingX:3},children:[e(n,{direction:"row",justifyContent:"space-between",alignItems:"center",children:i(a,{variant:"body1",fontWeight:600,children:[e(D,{icon:"eva:file-text-fill"})," Dokumen Kelengkapan"]})}),e(s,{sx:{marginY:2}}),e(a,{fontWeight:"600",children:"Kondisi"}),i(n,{children:[e(n,{divider:e(s,{orientation:"horizontal",flexItem:!0}),spacing:1,sx:{marginY:2},children:t&&t.files.claimConditions.map((r,o)=>e(n,{direction:"row",justifyContent:"space-between",children:e("a",{href:r.fileUrl,target:"_blank",style:{textDecoration:"none"},rel:"noreferrer",children:i(a,{sx:{color:"text.secondary"},variant:"subtitle2",children:["- ",r.fileName]})})},o))}),e(a,{fontWeight:"600",children:"Diagnosa"}),e(n,{divider:e(s,{orientation:"horizontal",flexItem:!0}),spacing:1,sx:{marginY:2},children:t&&t.files.claimDiagnosis.map((r,o)=>e(n,{direction:"row",justifyContent:"space-between",children:e("a",{href:r.fileUrl,target:"_blank",style:{textDecoration:"none"},rel:"noreferrer",children:i(a,{sx:{color:"text.secondary"},variant:"subtitle2",children:["- ",r.fileName]})})},o))}),e(a,{fontWeight:"600",children:"Hasil"}),e(n,{divider:e(s,{orientation:"horizontal",flexItem:!0}),spacing:1,sx:{marginY:2},children:t&&t.files.claimResults.map((r,o)=>e(n,{direction:"row",justifyContent:"space-between",children:e("a",{href:r.fileUrl,target:"_blank",style:{textDecoration:"none"},rel:"noreferrer",children:i(a,{sx:{color:"text.secondary"},variant:"subtitle2",children:["- ",r.fileName]})})},o))})]})]})]})]})]})};export{U as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{f as a,F as l,S as e,j as i,T as r,B as s,D as t,Z as n,H as c}from"./index.52c19e01.js";import{S as p,a as h,b as g,A as m}from"./Add.d1ec42b9.js";import{C as o}from"./Card.6cad65b0.js";const x=["Review","Approval","Disbursement"],y=({title:b,openDialog:u,setOpenDialog:v,data:w})=>a(l,{children:[a(e,{alignItems:"center",justifyContent:"space-between",direction:"row",sx:{marginTop:1},children:[i(r,{variant:"subtitle1",sx:{height:"max-content"},children:"Claim Request"}),a(e,{children:[i(r,{variant:"caption",children:"Submission date"}),i(r,{variant:"caption",children:"15 / 05 / 2022"})]})]}),i(s,{sx:{width:"100%",marginTop:2},children:i(p,{alternativeLabel:!0,children:x.map(d=>i(h,{children:i(g,{children:d})},d))})}),i(e,{marginTop:2,children:i(r,{variant:"subtitle1",paddingY:2,children:"17 Mei 2022"})}),a(e,{direction:"row",spacing:2,children:[i(t,{orientation:"vertical",flexItem:!0,sx:{borderStyle:"dashed"}}),a(e,{spacing:2,sx:{flex:1,maxWidth:"100%"},children:[a(o,{sx:{paddingY:2,paddingX:3},children:[a(e,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[i(r,{variant:"body1",children:"09:10 WIB"}),i(r,{sx:{backgroundColor:n.light.warning.lighter,color:n.light.warning.dark,borderColor:n.light.warning.dark,border:"1px solid",borderRadius:"6px",padding:1},variant:"caption",children:"Approval"})]}),i(t,{sx:{marginY:2}}),a(e,{children:[i(r,{variant:"subtitle2",color:"#404040",children:"Details : mohon melengkapi kekurangan dokumen"}),i(r,{variant:"caption",color:"#757575",sx:{marginTop:2,marginBottom:1},children:"Lab pemeriksaan darah"}),i(c,{variant:"outlined",startIcon:i(m,{}),fullWidth:!0,sx:{typography:"subtitle2",borderColor:"#F5F5F5"},children:"Hasil Pemeriksaan Laboratorium"})]})]}),a(o,{sx:{flex:1,maxWidth:"100%",paddingY:2,paddingX:3},children:[a(e,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[i(r,{variant:"body1",children:"09:00 WIB"}),i(r,{sx:{backgroundColor:n.light.warning.lighter,color:n.light.warning.dark,borderColor:n.light.warning.dark,border:"1px solid",borderRadius:"6px",padding:1},variant:"caption",children:"Approval"})]}),i(t,{sx:{marginY:2}}),i(e,{children:i(r,{variant:"subtitle2",color:"#404040",children:"Details : Penilaian Dokter"})})]}),a(o,{sx:{flex:1,maxWidth:"100%",paddingY:2,paddingX:3},children:[a(e,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[i(r,{variant:"body1",children:"08:00 WIB"}),i(r,{sx:{backgroundColor:"#F5F5F5",color:"#757575",borderColor:"#757575",border:"1px solid",borderRadius:"6px",padding:1},variant:"caption",children:"Review"})]}),i(t,{sx:{marginY:2}}),i(e,{children:i(r,{variant:"subtitle2",color:"#404040",children:"Details : Klaim Diajukan"})})]})]})]})]});export{y as default};
|
||||
File diff suppressed because one or more lines are too long
5
public/client-portal/assets/Form.a56fd31b.js
Normal file
5
public/client-portal/assets/Form.a56fd31b.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,4 +1,4 @@
|
||||
import{c as p_,j as q,s as _e,a4 as __,_ as Rt,aA as _o,e as xo,g as d_,a as v_,T as Mi,r as ge,u as x_,aw as w_,h as A_,i as m_,A as pe,B as It,f as cr,L as Wi,av as S_}from"./index.52c19e01.js";const y_=p_(q("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreHoriz"),I_=["slots","slotProps"],R_=_e(__)(({theme:R})=>Rt({display:"flex",marginLeft:`calc(${R.spacing(1)} * 0.5)`,marginRight:`calc(${R.spacing(1)} * 0.5)`},R.palette.mode==="light"?{backgroundColor:R.palette.grey[100],color:R.palette.grey[700]}:{backgroundColor:R.palette.grey[700],color:R.palette.grey[100]},{borderRadius:2,"&:hover, &:focus":Rt({},R.palette.mode==="light"?{backgroundColor:R.palette.grey[200]}:{backgroundColor:R.palette.grey[600]}),"&:active":Rt({boxShadow:R.shadows[0]},R.palette.mode==="light"?{backgroundColor:_o(R.palette.grey[200],.12)}:{backgroundColor:_o(R.palette.grey[600],.12)})})),C_=_e(y_)({width:24,height:16});function T_(R){const{slots:D={},slotProps:o={}}=R,Z=xo(R,I_),V=R;return q("li",{children:q(R_,Rt({focusRipple:!0},Z,{ownerState:V,children:q(C_,Rt({as:D.CollapsedIcon,ownerState:V},o.collapsedIcon))}))})}function L_(R){return v_("MuiBreadcrumbs",R)}const E_=d_("MuiBreadcrumbs",["root","ol","li","separator"]),b_=E_,O_=["children","className","component","slots","slotProps","expandText","itemsAfterCollapse","itemsBeforeCollapse","maxItems","separator"],B_=R=>{const{classes:D}=R;return m_({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},L_,D)},W_=_e(Mi,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(R,D)=>[{[`& .${b_.li}`]:D.li},D.root]})({}),P_=_e("ol",{name:"MuiBreadcrumbs",slot:"Ol",overridesResolver:(R,D)=>D.ol})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),M_=_e("li",{name:"MuiBreadcrumbs",slot:"Separator",overridesResolver:(R,D)=>D.separator})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function U_(R,D,o,Z){return R.reduce((V,Mn,P)=>(P<R.length-1?V=V.concat(Mn,q(M_,{"aria-hidden":!0,className:D,ownerState:Z,children:o},`separator-${P}`)):V.push(Mn),V),[])}const F_=ge.exports.forwardRef(function(D,o){const Z=x_({props:D,name:"MuiBreadcrumbs"}),{children:V,className:Mn,component:P="nav",slots:de={},slotProps:Kt={},expandText:ve="Show path",itemsAfterCollapse:nt=1,itemsBeforeCollapse:xn=1,maxItems:Ct=8,separator:Hn="/"}=Z,tt=xo(Z,O_),[ht,fn]=ge.exports.useState(!1),cn=Rt({},Z,{component:P,expanded:ht,expandText:ve,itemsAfterCollapse:nt,itemsBeforeCollapse:xn,maxItems:Ct,separator:Hn}),gt=B_(cn),wn=w_({elementType:de.CollapsedIcon,externalSlotProps:Kt.collapsedIcon,ownerState:cn}),$n=ge.exports.useRef(null),An=Y=>{const qn=()=>{fn(!0);const Tt=$n.current.querySelector("a[href],button,[tabindex]");Tt&&Tt.focus()};return xn+nt>=Y.length?Y:[...Y.slice(0,xn),q(T_,{"aria-label":ve,slots:{CollapsedIcon:de.CollapsedIcon},slotProps:{collapsedIcon:wn},onClick:qn},"ellipsis"),...Y.slice(Y.length-nt,Y.length)]},Un=ge.exports.Children.toArray(V).filter(Y=>ge.exports.isValidElement(Y)).map((Y,qn)=>q("li",{className:gt.li,children:Y},`child-${qn}`));return q(W_,Rt({ref:o,component:P,color:"text.secondary",className:A_(gt.root,Mn),ownerState:cn},tt,{children:q(P_,{className:gt.ol,ref:$n,ownerState:cn,children:U_(ht||Ct&&Un.length<=Ct?Un:An(Un),gt.separator,Hn,cn)})}))}),D_=F_;var Pi={exports:{}};/**
|
||||
import{c as p_,j as q,s as _e,a3 as __,_ as Rt,ad as _o,e as xo,g as d_,a as v_,T as Mi,r as ge,u as x_,ae as w_,h as A_,i as m_,z as pe,B as It,f as cr,L as Wi,ac as S_}from"./index.4524613b.js";const y_=p_(q("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreHoriz"),I_=["slots","slotProps"],R_=_e(__)(({theme:R})=>Rt({display:"flex",marginLeft:`calc(${R.spacing(1)} * 0.5)`,marginRight:`calc(${R.spacing(1)} * 0.5)`},R.palette.mode==="light"?{backgroundColor:R.palette.grey[100],color:R.palette.grey[700]}:{backgroundColor:R.palette.grey[700],color:R.palette.grey[100]},{borderRadius:2,"&:hover, &:focus":Rt({},R.palette.mode==="light"?{backgroundColor:R.palette.grey[200]}:{backgroundColor:R.palette.grey[600]}),"&:active":Rt({boxShadow:R.shadows[0]},R.palette.mode==="light"?{backgroundColor:_o(R.palette.grey[200],.12)}:{backgroundColor:_o(R.palette.grey[600],.12)})})),C_=_e(y_)({width:24,height:16});function T_(R){const{slots:D={},slotProps:o={}}=R,Z=xo(R,I_),V=R;return q("li",{children:q(R_,Rt({focusRipple:!0},Z,{ownerState:V,children:q(C_,Rt({as:D.CollapsedIcon,ownerState:V},o.collapsedIcon))}))})}function L_(R){return v_("MuiBreadcrumbs",R)}const E_=d_("MuiBreadcrumbs",["root","ol","li","separator"]),b_=E_,O_=["children","className","component","slots","slotProps","expandText","itemsAfterCollapse","itemsBeforeCollapse","maxItems","separator"],B_=R=>{const{classes:D}=R;return m_({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},L_,D)},W_=_e(Mi,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(R,D)=>[{[`& .${b_.li}`]:D.li},D.root]})({}),P_=_e("ol",{name:"MuiBreadcrumbs",slot:"Ol",overridesResolver:(R,D)=>D.ol})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),M_=_e("li",{name:"MuiBreadcrumbs",slot:"Separator",overridesResolver:(R,D)=>D.separator})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function U_(R,D,o,Z){return R.reduce((V,Mn,P)=>(P<R.length-1?V=V.concat(Mn,q(M_,{"aria-hidden":!0,className:D,ownerState:Z,children:o},`separator-${P}`)):V.push(Mn),V),[])}const F_=ge.exports.forwardRef(function(D,o){const Z=x_({props:D,name:"MuiBreadcrumbs"}),{children:V,className:Mn,component:P="nav",slots:de={},slotProps:Kt={},expandText:ve="Show path",itemsAfterCollapse:nt=1,itemsBeforeCollapse:xn=1,maxItems:Ct=8,separator:Hn="/"}=Z,tt=xo(Z,O_),[ht,fn]=ge.exports.useState(!1),cn=Rt({},Z,{component:P,expanded:ht,expandText:ve,itemsAfterCollapse:nt,itemsBeforeCollapse:xn,maxItems:Ct,separator:Hn}),gt=B_(cn),wn=w_({elementType:de.CollapsedIcon,externalSlotProps:Kt.collapsedIcon,ownerState:cn}),$n=ge.exports.useRef(null),An=Y=>{const qn=()=>{fn(!0);const Tt=$n.current.querySelector("a[href],button,[tabindex]");Tt&&Tt.focus()};return xn+nt>=Y.length?Y:[...Y.slice(0,xn),q(T_,{"aria-label":ve,slots:{CollapsedIcon:de.CollapsedIcon},slotProps:{collapsedIcon:wn},onClick:qn},"ellipsis"),...Y.slice(Y.length-nt,Y.length)]},Un=ge.exports.Children.toArray(V).filter(Y=>ge.exports.isValidElement(Y)).map((Y,qn)=>q("li",{className:gt.li,children:Y},`child-${qn}`));return q(W_,Rt({ref:o,component:P,color:"text.secondary",className:A_(gt.root,Mn),ownerState:cn},tt,{children:q(P_,{className:gt.ol,ref:$n,ownerState:cn,children:U_(ht||Ct&&Un.length<=Ct?Un:An(Un),gt.separator,Hn,cn)})}))}),D_=F_;var Pi={exports:{}};/**
|
||||
* @license
|
||||
* Lodash <https://lodash.com/>
|
||||
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
||||
1
public/client-portal/assets/Index.0c12c5d1.js
Normal file
1
public/client-portal/assets/Index.0c12c5d1.js
Normal file
File diff suppressed because one or more lines are too long
1
public/client-portal/assets/Index.1aa270d9.js
Normal file
1
public/client-portal/assets/Index.1aa270d9.js
Normal file
@@ -0,0 +1 @@
|
||||
import{P as K}from"./Page.b1f38576.js";import{n as Q,r as a,Z as X,$ as ee,a0 as _,j as s,f as g,F as te,a4 as ae,S as re,m as O,Y as se,a2 as ne}from"./index.4524613b.js";import{T as oe}from"./Table.b404960e.js";import{f as P}from"./formatTime.0646b9d0.js";import{T as ie}from"./TableMoreMenu.fbaa38aa.js";import{d as ce}from"./VisibilityOutlined.7d63b3a6.js";import{L as j}from"./Label.c0ab61c4.js";import{H as le}from"./HeaderBreadcrumbs.f593a2a7.js";import{G as v}from"./Grid.63392dc1.js";import"./Box.522fc68e.js";import"./TablePagination.a2995130.js";import"./KeyboardArrowRight.dfbe216b.js";import"./LastPage.928f2cf3.js";import"./TableRow.184bd340.js";import"./useId.5c752e65.js";import"./TextField.489cf1ea.js";import"./InputAdornment.c3b5c49a.js";import"./Search.a632f4d1.js";import"./TableContainer.e4a601db.js";import"./TableHead.2295a13e.js";import"./index.49ea62c1.js";import"./jsx-runtime_commonjs-proxy.08daee49.js";function de(){const d=Q(),{corporateValue:m}=a.exports.useContext(X),[y,T]=a.exports.useState([]),[w,p]=a.exports.useState(!0),V={isLoading:w,setIsLoading:p},[t,S]=ee(),[i,n]=a.exports.useState({}),k={searchParams:t,setSearchParams:S,appliedParams:i,setAppliedParams:n},[u,I]=a.exports.useState("desc"),[h,F]=a.exports.useState("request_date"),L={order:u,setOrder:I,orderBy:h,setOrderBy:F},[M,x]=a.exports.useState(0),[A,D]=a.exports.useState(10),[b,E]=a.exports.useState({current_page:0,from:0,last_page:0,links:[],path:"",per_page:0,to:0,total:0}),B={page:M,setPage:x,rowsPerPage:A,setRowsPerPage:D,paginationTable:b,setPaginationTable:E},[f,G]=a.exports.useState(""),R={useSearchs:!0,searchText:f,setSearchText:G,handleSearchSubmit:async r=>{if(r.preventDefault(),f===""){t.delete("search");const e=Object.fromEntries([...t.entries()]);n(e)}else{const e=Object.fromEntries([...t.entries(),["search",f]]);n(e)}}},[C,N]=a.exports.useState("all"),[q,z]=a.exports.useState([]),H={useFilter:!1,config:{label:"Status",statusValue:C,statusData:q,handleStatusChange:r=>{if(N(r.target.value),r.target.value==="all"){t.delete("status");const e=Object.fromEntries([...t.entries()]);n(e)}else{const e=Object.fromEntries([...t.entries(),["status",r.target.value]]);n(e)}}}},[c,$]=a.exports.useState(""),U={useFilter:!0,startDate:c,setStartDate:$,handleStartDateChange:async r=>{if(r.preventDefault(),c===""){t.delete("start_date");const e=Object.fromEntries([...t.entries()]);n(e)}else{const e=Object.fromEntries([...t.entries(),["start_date",c]]);n(e)}}},[l,W]=a.exports.useState(""),Y={useFilter:!0,endDate:l,setEndDate:W,handleEndDateChange:async r=>{if(r.preventDefault(),l===""){t.delete("end_date");const e=Object.fromEntries([...t.entries()]);n(e)}else{const e=Object.fromEntries([...t.entries(),["end_date",l]]);n(e)}}},Z={useExport:!0,startDate:c,endDate:l,status:C,handleExportReport:async()=>{var r=Object.fromEntries([...t.entries()]);await _.get(m+"/claims/export",{params:r}).then(e=>{O("Data berhasil di Export",{variant:"success",anchorOrigin:{horizontal:"right",vertical:"top"}}),document.location.href=e.data.data.file_url}).catch(e=>O("Data Gagal di Export",{variant:"error",anchorOrigin:{horizontal:"right",vertical:"top"}}))}},J=[{id:"memberId",align:"left",label:"Member ID",isSort:!0},{id:"fullName",align:"left",label:"Name",isSort:!0},{id:"start_date",align:"center",label:"Start Date",isSort:!0},{id:"end_date",align:"center",label:"End Date",isSort:!0},{id:"action",align:"center",label:"",isSort:!1}];return a.exports.useEffect(()=>{(async()=>{p(!0),await new Promise(o=>setTimeout(o,250));const r=Object.keys(i).length!==0?i:Object.fromEntries([...t.entries(),["order",u],["orderBy",h]]),e=await _.get(`${m}/members?type=alarm-center`,{params:{...r}});if(z([{id:1,name:"Done"},{id:0,name:"On Going"}]),T(e.data.data.map(o=>({...o,start_date:s(j,{children:P(o.start_date)}),end_date:g(j,{children:[" ",P(o.end_date)]}),action:s(ie,{actions:s(te,{children:g(ae,{onClick:()=>d("member/"+o.id),children:[s(ce,{}),"View"]})})})}))),E(e.data),D(e.data.per_page),t.get("page")){const o=parseInt(t.get("page"))-1;b.current_page=o,x(o)}p(!1)})()},[i,t,u,h,S,m]),s(re,{children:s(oe,{headCells:J,rows:y,orders:L,paginations:B,loadings:V,params:k,searchs:R,filterStatus:H,filterStartDate:U,filterEndDate:Y,exportReport:Z})})}function Ge(){const{themeStretch:d}=se();return s(K,{title:"Alarm Center",children:g(ne,{maxWidth:d?!1:"xl",children:[s(le,{heading:"Alarm Center",links:[{name:"Case Management",href:"/alarm-center"},{name:"Alarm Center",href:"/alarm-center"}]}),s(v,{container:!0,children:s(v,{item:!0,xs:12,lg:12,md:12,children:s(de,{})})})]})})}export{Ge as default};
|
||||
1
public/client-portal/assets/Index.2d5138ff.js
Normal file
1
public/client-portal/assets/Index.2d5138ff.js
Normal file
@@ -0,0 +1 @@
|
||||
import{P as x}from"./Page.b1f38576.js";import{n as C,r as t,Z as b,a0 as S,j as e,T as _,G as I,f as a,F as y,a4 as d,S as L,Y as T,a2 as j}from"./index.4524613b.js";import{T as k}from"./Table.b404960e.js";import{T as w}from"./TableMoreMenu.fbaa38aa.js";import{r as D,i as E,a as M}from"./jsx-runtime_commonjs-proxy.08daee49.js";import{d as q}from"./VisibilityOutlined.7d63b3a6.js";import{H as P}from"./HeaderBreadcrumbs.f593a2a7.js";import{G as p}from"./Grid.63392dc1.js";import"./Box.522fc68e.js";import"./TablePagination.a2995130.js";import"./KeyboardArrowRight.dfbe216b.js";import"./LastPage.928f2cf3.js";import"./TableRow.184bd340.js";import"./useId.5c752e65.js";import"./TextField.489cf1ea.js";import"./InputAdornment.c3b5c49a.js";import"./Search.a632f4d1.js";import"./TableContainer.e4a601db.js";import"./TableHead.2295a13e.js";var s={},R=E.exports;Object.defineProperty(s,"__esModule",{value:!0});var m=s.default=void 0,$=R(D()),A=M,G=(0,$.default)((0,A.jsx)("path",{d:"m14.06 9.02.92.92L5.92 19H5v-.92l9.06-9.06M17.66 3c-.25 0-.51.1-.7.29l-1.83 1.83 3.75 3.75 1.83-1.83c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.2-.2-.45-.29-.71-.29zm-3.6 3.19L3 17.25V21h3.75L17.81 9.94l-3.75-3.75z"}),"EditOutlined");m=s.default=G;function H(){const r=C(),{corporateValue:n}=t.exports.useContext(b),l=new AbortController,[u,f]=t.exports.useState([]),[g,o]=t.exports.useState(!0),h={isLoading:g,setIsLoading:o},v=[{id:"code",align:"left",label:"Code",isSort:!1},{id:"name",align:"left",label:"Name",isSort:!1},{id:"active",align:"center",label:"Status",isSort:!1},{id:"action",align:"center",label:"",isSort:!1}];return t.exports.useEffect(()=>{(async()=>{try{o(!0);const[i]=await Promise.all([S.get(`${n}/corporate`,{signal:l.signal})]);f(i.data.data.map(c=>({...c,active:c.active===1?e(_,{variant:"overline",sx:{backgroundColor:"rgba(84, 214, 44, 0.16)",color:"#229A16",paddingX:1.5,paddingY:1,display:"inline-flex",alignItems:"center",borderRadius:"10px"},children:"Active"}):e(I,{variant:"outlined",color:"error",children:"Inactive"}),action:e(w,{actions:a(y,{children:[a(d,{onClick:()=>r("/corporate/edit"),children:[e(m,{}),"Edit"]}),a(d,{onClick:()=>r("/corporate/view"),children:[e(q,{}),"View"]})]})})}))),o(!1)}catch(i){console.error("Error fetching data:",i.message)}return()=>{l.abort()}})()},[n]),e(L,{children:e(k,{headCells:v,rows:u,loadings:h})})}function ie(){const{themeStretch:r}=T();return e(x,{title:"Corporate",children:a(j,{maxWidth:r?!1:"xl",children:[e(P,{heading:"Corporate",links:[{name:"Dashboard",href:"/dashboard"},{name:"Corporates",href:"/corporates"}]}),e(p,{container:!0,children:e(p,{item:!0,xs:12,lg:12,md:12,children:e(H,{})})})]})})}export{ie as default};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
public/client-portal/assets/Index.7c3e31bb.js
Normal file
1
public/client-portal/assets/Index.7c3e31bb.js
Normal file
@@ -0,0 +1 @@
|
||||
import{P as H}from"./Page.b1f38576.js";import{n as V,r,Z as $,$ as U,a0 as y,j as e,T as _,F as W,f as E,a4 as Y,S as Z,Y as q,a2 as z}from"./index.4524613b.js";import{T as J}from"./Table.b404960e.js";import{f as P}from"./formatTime.0646b9d0.js";import{T as K}from"./TableMoreMenu.fbaa38aa.js";import{d as Q}from"./VisibilityOutlined.7d63b3a6.js";import{L as i}from"./Label.c0ab61c4.js";import{H as X}from"./HeaderBreadcrumbs.f593a2a7.js";import{G as D}from"./Grid.63392dc1.js";import"./Box.522fc68e.js";import"./TablePagination.a2995130.js";import"./KeyboardArrowRight.dfbe216b.js";import"./LastPage.928f2cf3.js";import"./TableRow.184bd340.js";import"./useId.5c752e65.js";import"./TextField.489cf1ea.js";import"./InputAdornment.c3b5c49a.js";import"./Search.a632f4d1.js";import"./TableContainer.e4a601db.js";import"./TableHead.2295a13e.js";import"./index.49ea62c1.js";import"./jsx-runtime_commonjs-proxy.08daee49.js";function j(){const c=V(),{corporateValue:l}=r.exports.useContext($),[T,I]=r.exports.useState([]),[C,m]=r.exports.useState(!0),w={isLoading:C,setIsLoading:m},[s,d]=U(),[n,p]=r.exports.useState({}),k={searchParams:s,setSearchParams:d,appliedParams:n,setAppliedParams:p},[u,v]=r.exports.useState("asc"),[f,N]=r.exports.useState("fullName"),O={order:u,setOrder:v,orderBy:f,setOrderBy:N},[L,g]=r.exports.useState(0),[M,S]=r.exports.useState(10),[x,b]=r.exports.useState({current_page:0,from:0,last_page:0,links:[],path:"",per_page:0,to:0,total:0}),B={page:L,setPage:g,rowsPerPage:M,setRowsPerPage:S,paginationTable:x,setPaginationTable:b},[h,R]=r.exports.useState(""),A={useSearchs:!0,searchText:h,setSearchText:R,handleSearchSubmit:async o=>{if(o.preventDefault(),h===""){s.delete("search");const a=Object.fromEntries([...s.entries()]);p(a)}else{const a=Object.fromEntries([...s.entries(),["search",h]]);p(a)}}},F={useExport:!0,startDate:"",endDate:"",status:"all",handleExportReport:async()=>{y.get(l+"/export-members/list").then(o=>{const a=document.createElement("a");a.href=o.data.data.file_url,a.setAttribute("download",o.data.data.file_name),document.body.appendChild(a),a.click()})}},G=[{id:"memberId",align:"left",label:"Member ID",isSort:!0},{id:"fullName",align:"left",label:"Name",isSort:!0},{id:"start_date",align:"center",label:"Start Date",isSort:!0},{id:"end_date",align:"center",label:"End Date",isSort:!0},{id:"status",align:"center",label:"Status",isSort:!0},{id:"action",align:"center",label:"",isSort:!0}];return r.exports.useEffect(()=>{(async()=>{m(!0),await new Promise(t=>setTimeout(t,250));const o=Object.keys(n).length!==0?n:Object.fromEntries([...s.entries(),["order",u],["orderBy",f]]),a=await y.get(`${l}/members?type=employee-data`,{params:{...o}});if(d(o),I(a.data.data.map(t=>({...t,status:t.status===1?e(i,{color:"success",children:"Active"}):e(i,{color:"error",children:"Inactive"}),start_date:e(i,{children:t.start_date?P(t.start_date):""}),end_date:e(i,{children:t.end_date?P(t.end_date):""}),fullName:e(_,{variant:"body2",children:t.fullName}),memberId:e(_,{variant:"body2",children:t.memberId}),action:e(K,{actions:e(W,{children:E(Y,{onClick:()=>c("/employee-data/user-profile/"+t.personId),children:[e(Q,{}),"View"]})})})}))),b(a.data),S(a.data.per_page),s.get("page")){const t=parseInt(s.get("page"))-1;x.current_page=t,g(t)}m(!1)})()},[n,s,u,f,d,l]),e(Z,{children:e(J,{headCells:G,rows:T,orders:O,paginations:B,loadings:w,params:k,searchs:A,exportReport:F})})}function Ee(){const{themeStretch:c}=q();return e(H,{title:"Employee Data",children:E(z,{maxWidth:c?!1:"xl",children:[e(X,{heading:"Employee Data",links:[{name:"Case Management"},{name:"Employee Data",href:"/employee-data"}]}),e(D,{container:!0,children:e(D,{item:!0,xs:12,lg:12,md:12,children:e(j,{})})})]})})}export{Ee as default};
|
||||
1
public/client-portal/assets/Index.b9875b0b.js
Normal file
1
public/client-portal/assets/Index.b9875b0b.js
Normal file
@@ -0,0 +1 @@
|
||||
import{Y as U,r as e,Z as W,$ as Z,a0 as k,j as s,G as P,a1 as c,f as q,a2 as z,T as H}from"./index.4524613b.js";import{P as J}from"./Page.b1f38576.js";import{T as K}from"./Table.b404960e.js";import{S as Q}from"./Stack.2fe98e42.js";import{G as C}from"./Grid.63392dc1.js";import"./Box.522fc68e.js";import"./TablePagination.a2995130.js";import"./KeyboardArrowRight.dfbe216b.js";import"./LastPage.928f2cf3.js";import"./TableRow.184bd340.js";import"./useId.5c752e65.js";import"./TextField.489cf1ea.js";import"./InputAdornment.c3b5c49a.js";import"./Search.a632f4d1.js";import"./TableContainer.e4a601db.js";import"./TableHead.2295a13e.js";function fe(){const{themeStretch:D}=U(),{corporateValue:l}=e.exports.useContext(W),p=new AbortController,[y,j]=e.exports.useState([]),[O,d]=e.exports.useState(!0),T={isLoading:O,setIsLoading:d},[t,m]=Z(),[n,o]=e.exports.useState({}),w={searchParams:t,setSearchParams:m,appliedParams:n,setAppliedParams:o},[u,E]=e.exports.useState("asc"),[g,I]=e.exports.useState("fullName"),_={order:u,setOrder:E,orderBy:g,setOrderBy:I},[B,f]=e.exports.useState(0),[A,S]=e.exports.useState(10),[x,v]=e.exports.useState({current_page:0,from:0,last_page:0,links:[],path:"",per_page:0,to:0,total:0}),G={page:B,setPage:f,rowsPerPage:A,setRowsPerPage:S,paginationTable:x,setPaginationTable:v},[h,N]=e.exports.useState(""),R={useSearchs:!1,searchText:h,setSearchText:N,handleSearchSubmit:async r=>{if(r.preventDefault(),h===""){t.delete("search");const a=Object.fromEntries([...t.entries()]);o(a)}else{const a=Object.fromEntries([...t.entries(),["search",h]]);o(a)}}},[V,Y]=e.exports.useState("all"),[$,L]=e.exports.useState([]),M={useFilter:!0,config:{label:"Division",divisionValue:V,divisionData:$,handleDivisionChange:r=>{if(Y(r.target.value),r.target.value==="all"){t.delete("division");const a=Object.fromEntries([...t.entries()]);o(a)}else{const a=Object.fromEntries([...t.entries(),["division",r.target.value]]);o(a)}}}},F=[{id:"memberId",align:"left",label:"Member ID",isSort:!0},{id:"fullName",align:"center",label:"Name",isSort:!0},{id:"division",align:"center",label:"Divisi",isSort:!0},{id:"status",align:"center",label:"Status",isSort:!0},{id:"action",align:"right",label:"",isSort:!1}];return e.exports.useEffect(()=>((async()=>{try{d(!0);const r=Object.keys(n).length!==0?n:Object.fromEntries([...t.entries(),["order",u],["orderBy",g]]),[a,b]=await Promise.all([k.get(`${l}/division`,{signal:p.signal}),k.get(`${l}/members`,{params:{...r},signal:p.signal})]);if(m(r),L(a.data),j(b.data.data.map(i=>({...i,status:i.status===1?s(P,{sx:{backgroundColor:"rgba(84, 214, 44, 0.16)",color:c.dark.success.dark,paddingY:0,"&:hover":{backgroundColor:"rgba(84, 214, 44, 0.32)",color:c.dark.success.darker}},children:"Active"}):s(P,{sx:{backgroundColor:"rgba(255, 72, 66, 0.16)",color:c.dark.error.dark,paddingY:0,"&:hover":{backgroundColor:"rgba(255, 72, 66, 0.32)",color:c.dark.error.darker}},children:"Inactive"})}))),v(b.data),S(b.data.per_page),t.get("page")){const i=parseInt(t.get("page"))-1;x.current_page=i,f(i)}d(!1)}catch(r){console.error("Error fetching data:",r.message)}})(),()=>{p.abort()}),[n,t,u,g,m,l]),s(J,{title:"Dashboard",children:q(z,{maxWidth:D?!1:"xl",children:[s(Q,{direction:"row",justifyContent:"space-between",children:s(H,{variant:"h3",component:"h1",paragraph:!0,children:"Dashboard"})}),s(C,{container:!0,spacing:2,children:s(C,{item:!0,xs:12,lg:12,md:12,children:s(K,{headCells:F,rows:y,orders:_,paginations:G,loadings:T,params:w,searchs:R,filters:M})})})]})})}export{fe as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{f as P,j as t,S as A,T as p,s as q,Z as h,o as G,r as e,$ as E,a2 as L,a0 as M,H as _,t as V,a1 as Y,a3 as H}from"./index.52c19e01.js";import{P as U}from"./Page.2d2aae4a.js";import{G as S}from"./Grid.35ade0df.js";import{C as I}from"./Card.6cad65b0.js";import{T as Z}from"./Table.4e5e7a7b.js";import"./Box.bdfd146f.js";import"./TablePagination.9f676df5.js";import"./TableRow.2979bcea.js";import"./KeyboardArrowRight.45cdeaba.js";import"./TextField.ca0ae25e.js";const z=q(I)(({theme:r})=>({boxShadow:"none",padding:r.spacing(2),color:"black",backgroundColor:r.palette.grey[200]})),J=[{name:"Requested",value:5,color:h.dark.primary.dark},{name:"Approval",value:1,color:h.dark.warning.dark},{name:"Disbrusment",value:0,color:h.dark.success.dark},{name:"Rejected",value:3,color:h.dark.error.dark}];function K({data:r}){return P(z,{children:[t(A,{sx:{mb:1},children:t(p,{variant:"body2",children:"Claim Status"})}),t(S,{container:!0,spacing:2,children:r?r.map(({name:s,value:o,color:n},m)=>t(S,{item:!0,xs:6,sm:3,children:P(I,{sx:{paddingX:1,borderRadius:.75,borderColor:n,borderStyle:"solid",borderWidth:"1px",padding:2,flex:1,textAlign:"center"},children:[t(p,{component:"p",variant:"body2",children:s}),t(p,{component:"p",variant:"h5",sx:{marginTop:2},children:o}),t(p,{component:"p",variant:"body2",sx:{marginTop:2},children:"Cases"})]})},m)):J.map(({name:s,value:o,color:n},m)=>t(S,{item:!0,xs:6,sm:3,children:P(I,{sx:{paddingX:1,borderRadius:.75,borderColor:n,borderStyle:"solid",borderWidth:"1px",padding:2,flex:1,textAlign:"center"},children:[t(p,{component:"p",variant:"body2",children:s}),t(p,{component:"p",variant:"h5",sx:{marginTop:2},children:o}),t(p,{component:"p",variant:"body2",sx:{marginTop:2},children:"Cases"})]})},m))})]})}function Q(){const r=G(),{corporateValue:s}=e.exports.useContext(E),[o,n]=e.exports.useState([]),[m,b]=e.exports.useState(!0),j={isLoading:m,setIsLoading:b},[a,f]=L(),[i,l]=e.exports.useState({}),w={searchParams:a,setSearchParams:f,appliedParams:i,setAppliedParams:l},[u,v]=e.exports.useState("asc"),[g,T]=e.exports.useState("fullName"),y={order:u,setOrder:v,orderBy:g,setOrderBy:T},[F,C]=e.exports.useState(0),[k,x]=e.exports.useState(10),[D,R]=e.exports.useState({current_page:0,from:0,last_page:0,links:[],path:"",per_page:0,to:0,total:0}),N={page:F,setPage:C,rowsPerPage:k,setRowsPerPage:x,paginationTable:D,setPaginationTable:R},[B,X]=e.exports.useState(""),W={searchText:B,setSearchText:X,handleSearchSubmit:async O=>{if(O.preventDefault(),B===""){a.delete("search");const c=Object.fromEntries([...a.entries()]);l(c)}else{const c=Object.fromEntries([...a.entries(),["search",B]]);l(c)}}},$=[{id:"memberId",align:"left",label:"Member ID",isSort:!0},{id:"fullName",align:"left",label:"Name",isSort:!0},{id:"division",align:"left",label:"Divisi",isSort:!0},{id:"status",align:"center",label:"Status",isSort:!0},{id:"action",align:"right",label:"",isSort:!1}];return e.exports.useState(null),e.exports.useEffect(()=>{(async()=>{b(!0),await new Promise(d=>setTimeout(d,250));const O=Object.keys(i).length!==0?i:Object.fromEntries([...a.entries(),["order",u],["orderBy",g]]),c=await M.get(`${s}/members`,{params:{...O}});if(n(c.data.data.map(d=>({...d,status:d.status===1?t(_,{onClick:()=>r("dialog-detail"),sx:{backgroundColor:"rgba(84, 214, 44, 0.16)",color:h.dark.success.dark,paddingX:1.5,paddingY:1,"&:hover":{backgroundColor:"rgba(84, 214, 44, 0.16)",color:h.dark.success.dark}},children:"Request"}):t(_,{startIcon:t(V,{icon:"fa6-solid:clock"}),sx:{backgroundColor:"#CD7B2E",color:"#FFFF",paddingX:1.5,paddingY:1,"&:hover":{backgroundColor:"#BF6919",color:"#FFFF"}},children:"Ongoing"})}))),R(c.data),x(c.data.per_page),a.get("page")){const d=parseInt(a.get("page"))-1;D.current_page=d,C(d)}b(!1)})()},[i,a,u,g,f,s]),t(A,{children:t(Z,{headCells:$,rows:o,orders:y,paginations:N,loadings:j,params:w,searchs:W})})}function pe(){const{themeStretch:r}=Y(),{corporateValue:s}=e.exports.useContext(E),[o,n]=e.exports.useState([]),[m,b]=e.exports.useState([]),[j,a]=e.exports.useState(!0),[f,i]=L(),[l,w]=e.exports.useState({}),[u,v]=e.exports.useState("asc"),[g,T]=e.exports.useState("fullName"),y={order:u,setOrder:v,orderBy:g,setOrderBy:T};e.exports.useState(0),e.exports.useState(10);const[F,C]=e.exports.useState({current_page:0,from:0,last_page:0,links:[],path:"",per_page:0,to:0,total:0});return e.exports.useEffect(()=>{(async()=>{a(!0);const k=Object.keys(l).length!==0?l:Object.fromEntries([...f.entries(),["order",y.order],["orderBy",y.orderBy]]),x=await M.get(`${s}/members`,{params:{...k,type:"claim-report"}});i(k),n(x.data.data.allClaimStatus),b(x.data.data.allMembersByClaimStatus.data),C(x.data.data.allMembersByClaimStatus),a(!1)})()},[l,f,u,g,i,s]),t(U,{title:"Claim Reports",children:t(H,{maxWidth:r?!1:"xl",children:P(S,{container:!0,spacing:2,children:[t(S,{item:!0,xs:12,lg:12,md:12,children:t(K,{data:o})}),t(S,{item:!0,xs:12,lg:12,md:12,children:t(Q,{})})]})})})}export{pe as default};
|
||||
1
public/client-portal/assets/Index.da883486.js
Normal file
1
public/client-portal/assets/Index.da883486.js
Normal file
File diff suppressed because one or more lines are too long
1
public/client-portal/assets/Index.e38eb6a9.js
Normal file
1
public/client-portal/assets/Index.e38eb6a9.js
Normal file
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
import{o as G,r as a,$ as V,a2 as X,a0 as Y,j as e,H as x,t as v,Z as m,S as H,a1 as U,a3 as Z,f as F,B as D,s as O}from"./index.52c19e01.js";import{P as q}from"./Page.2d2aae4a.js";import{T as z}from"./Table.4e5e7a7b.js";import{G as I}from"./Grid.35ade0df.js";import{C as J}from"./Card.6cad65b0.js";import{T as K,a as Q}from"./Tabs.8cb1735e.js";import"./Box.bdfd146f.js";import"./TablePagination.9f676df5.js";import"./TableRow.2979bcea.js";import"./KeyboardArrowRight.45cdeaba.js";import"./TextField.ca0ae25e.js";function ee(){const t=G(),{corporateValue:o}=a.exports.useContext(V),[l,n]=a.exports.useState([]),[d,c]=a.exports.useState(!0),w={isLoading:d,setIsLoading:c},[s,y]=X(),[p,u]=a.exports.useState({}),_={searchParams:s,setSearchParams:y,appliedParams:p,setAppliedParams:u},[g,E]=a.exports.useState("asc"),[b,$]=a.exports.useState("fullName"),j={order:g,setOrder:E,orderBy:b,setOrderBy:$},[M,P]=a.exports.useState(0),[N,T]=a.exports.useState(10),[k,B]=a.exports.useState({current_page:0,from:0,last_page:0,links:[],path:"",per_page:0,to:0,total:0}),A={page:M,setPage:P,rowsPerPage:N,setRowsPerPage:T,paginationTable:k,setPaginationTable:B},[h,L]=a.exports.useState(""),R={searchText:h,setSearchText:L,handleSearchSubmit:async f=>{if(f.preventDefault(),h===""){s.delete("search");const i=Object.fromEntries([...s.entries()]);u(i)}else{const i=Object.fromEntries([...s.entries(),["search",h]]);u(i)}}},W=[{id:"memberId",align:"left",label:"Member ID",isSort:!0},{id:"fullName",align:"left",label:"Name",isSort:!0},{id:"start_date",align:"center",label:"Start Date",isSort:!0},{id:"end_date",align:"center",label:"End Date",isSort:!1},{id:"status",align:"center",label:"Status",isSort:!0}];return a.exports.useEffect(()=>{(async()=>{c(!0),await new Promise(r=>setTimeout(r,250));const f=Object.keys(p).length!==0?p:Object.fromEntries([...s.entries(),["order",g],["orderBy",b]]),i=await Y.get(`${o}/members?type=alarm-center`,{params:{...f}});if(n(i.data.data.map(r=>({...r,memberId:e(x,{onClick:()=>t("/user-profile/"+r.personId),children:r.memberId}),status:r.status===1?e(x,{onClick:()=>t("service-monitoring/"+r.personId),startIcon:e(v,{icon:"ic:round-check"}),sx:{backgroundColor:m.light.grey[300],color:m.light.grey[800],paddingX:1.5,paddingY:1,"&:hover":{backgroundColor:m.light.grey[400],color:m.light.grey[800]}},children:"done"}):e(x,{startIcon:e(v,{icon:"fa6-solid:clock"}),sx:{backgroundColor:"#CD7B2E",color:"#FFFF",paddingX:1.5,paddingY:1,"&:hover":{backgroundColor:"#BF6919",color:"#FFFF"}},children:"Ongoing"})}))),B(i.data),T(i.data.per_page),s.get("page")){const r=parseInt(s.get("page"))-1;k.current_page=r,P(r)}c(!1)})()},[p,s,g,b,y,o]),e(H,{children:e(z,{headCells:W,rows:l,orders:j,paginations:A,loadings:w,params:_,searchs:R})})}function te(t){const{children:o,value:l,index:n,...d}=t;return e("div",{role:"tabpanel",hidden:l!==n,id:`simple-tabpanel-${n}`,"aria-labelledby":`simple-tab-${n}`,...d,children:l===n&&e(D,{children:o})})}function S(t){return{id:`simple-tab-${t}`,"aria-controls":`simple-tabpanel-${t}`}}const ae=O(t=>e(K,{...t}))({backgroundColor:"#F4F6F8",padding:"0 24px","& .MuiTabs-indicator":{display:"flex",justifyContent:"space-between",backgroundColor:"transparent"},"& .MuiTabs-indicatorSpan":{maxWidth:40,backgroundColor:"#635ee7"}}),C=O(t=>e(Q,{disableRipple:!0,...t}))(({theme:t})=>({textTransform:"none",fontWeight:600,color:t.palette.grey[600],marginRight:"5rem","&.Mui-selected":{color:"#212B36",borderBottom:"2px solid "+t.palette.primary.main},"&:hover":{color:"#212B36",opacity:1,borderBottom:"2px solid "+t.palette.primary.main}}));function be(){const{themeStretch:t}=U(),[o,l]=a.exports.useState(0);return e(q,{title:"Alarm Center",children:e(Z,{maxWidth:t?!1:"xl",children:e(I,{container:!0,children:e(I,{item:!0,xs:12,lg:12,md:12,children:F(J,{children:[e(D,{sx:{borderBottom:1,borderColor:"divider"},children:F(ae,{value:o,onChange:(d,c)=>{l(c)},"aria-label":"basic tabs example",children:[e(C,{label:"All Data",...S(0)}),e(C,{label:"Ongoing",...S(1)}),e(C,{label:"Done",...S(2)})]})}),e(te,{value:o,index:0,children:e(ee,{})})]})})})})})}export{be as default};
|
||||
1
public/client-portal/assets/InputAdornment.c3b5c49a.js
Normal file
1
public/client-portal/assets/InputAdornment.c3b5c49a.js
Normal file
@@ -0,0 +1 @@
|
||||
import{g as A,a as C,s as I,_ as c,r as b,u as E,e as L,H as $,j as r,J as z,h as T,T as R,f as _,b as m,i as j}from"./index.4524613b.js";function F(e){return C("MuiInputAdornment",e)}const M=A("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]),f=M;var g;const N=["children","className","component","disablePointerEvents","disableTypography","position","variant"],S=(e,t)=>{const{ownerState:n}=e;return[t.root,t[`position${m(n.position)}`],n.disablePointerEvents===!0&&t.disablePointerEvents,t[n.variant]]},U=e=>{const{classes:t,disablePointerEvents:n,hiddenLabel:o,position:s,size:a,variant:l}=e,d={root:["root",n&&"disablePointerEvents",s&&`position${m(s)}`,l,o&&"hiddenLabel",a&&`size${m(a)}`]};return j(d,F,t)},w=I("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:S})(({theme:e,ownerState:t})=>c({display:"flex",height:"0.01em",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(e.vars||e).palette.action.active},t.variant==="filled"&&{[`&.${f.positionStart}&:not(.${f.hiddenLabel})`]:{marginTop:16}},t.position==="start"&&{marginRight:8},t.position==="end"&&{marginLeft:8},t.disablePointerEvents===!0&&{pointerEvents:"none"})),H=b.exports.forwardRef(function(t,n){const o=E({props:t,name:"MuiInputAdornment"}),{children:s,className:a,component:l="div",disablePointerEvents:d=!1,disableTypography:x=!1,position:u,variant:v}=o,P=L(o,N),i=$()||{};let p=v;v&&i.variant,i&&!p&&(p=i.variant);const h=c({},o,{hiddenLabel:i.hiddenLabel,size:i.size,disablePointerEvents:d,position:u,variant:p}),y=U(h);return r(z.Provider,{value:null,children:r(w,c({as:l,ownerState:h,className:T(y.root,a),ref:n},P,{children:typeof s=="string"&&!x?r(R,{color:"text.secondary",children:s}):_(b.exports.Fragment,{children:[u==="start"?g||(g=r("span",{className:"notranslate",children:"\u200B"})):null,s]})}))})}),J=H;export{J as I};
|
||||
@@ -1 +1 @@
|
||||
import{c as r,j as o}from"./index.52c19e01.js";const t=r(o("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),e=r(o("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight");export{e as K,t as a};
|
||||
import{c as r,j as o}from"./index.4524613b.js";const t=r(o("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),e=r(o("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight");export{e as K,t as a};
|
||||
1
public/client-portal/assets/Label.c0ab61c4.js
Normal file
1
public/client-portal/assets/Label.c0ab61c4.js
Normal file
@@ -0,0 +1 @@
|
||||
import{v as p,j as d,s as g,a6 as c}from"./index.4524613b.js";const y=g("span")(({theme:t,ownerState:r})=>{const n=t.palette.mode==="light",{color:l,variant:a}=r,e=o=>({color:t.palette[o].contrastText,backgroundColor:t.palette[o].main}),i=o=>({color:t.palette[o].main,backgroundColor:"transparent",border:`1px solid ${t.palette[o].main}`}),s=o=>({color:t.palette[o][n?"dark":"light"],backgroundColor:c(t.palette[o].main,.16)});return{height:22,minWidth:22,lineHeight:0,borderRadius:6,alignItems:"center",whiteSpace:"nowrap",display:"inline-flex",justifyContent:"center",padding:t.spacing(0,1),color:t.palette.grey[800],fontSize:t.typography.pxToRem(12),fontFamily:t.typography.fontFamily,backgroundColor:t.palette.grey[300],fontWeight:t.typography.fontWeightBold,...l!=="default"?{...a==="filled"&&{...e(l)},...a==="outlined"&&{...i(l)},...a==="ghost"&&{...s(l)}}:{...a==="outlined"&&{backgroundColor:"transparent",color:t.palette.text.primary,border:`1px solid ${t.palette.grey[50032]}`},...a==="ghost"&&{color:n?t.palette.text.secondary:t.palette.common.white,backgroundColor:t.palette.grey[50016]}}}});function f({color:t="default",variant:r="ghost",children:n,sx:l}){const a=p();return d(y,{ownerState:{color:t,variant:r},sx:l,theme:a,children:n})}export{f as L};
|
||||
1
public/client-portal/assets/LastPage.928f2cf3.js
Normal file
1
public/client-portal/assets/LastPage.928f2cf3.js
Normal file
@@ -0,0 +1 @@
|
||||
import{c as a,j as s}from"./index.4524613b.js";const o=a(s("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"}),"FirstPage"),c=a(s("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"}),"LastPage");export{o as F,c as L};
|
||||
54
public/client-portal/assets/LinearProgress.9a82ef9e.js
Normal file
54
public/client-portal/assets/LinearProgress.9a82ef9e.js
Normal file
@@ -0,0 +1,54 @@
|
||||
import{g as q,a as M,C as h,s as b,b as t,_ as s,E as C,r as z,u as D,e as T,v as j,f as U,j as p,h as O,i as A,l as K,d as w}from"./index.4524613b.js";function X(r){return M("MuiLinearProgress",r)}const E=q("MuiLinearProgress",["root","colorPrimary","colorSecondary","determinate","indeterminate","buffer","query","dashed","dashedColorPrimary","dashedColorSecondary","bar","barColorPrimary","barColorSecondary","bar1Indeterminate","bar1Determinate","bar1Buffer","bar2Indeterminate","bar2Buffer"]),er=E,S=["className","color","value","valueBuffer","variant"];let l=r=>r,x,L,k,B,I,_;const v=4,W=h(x||(x=l`
|
||||
0% {
|
||||
left: -35%;
|
||||
right: 100%;
|
||||
}
|
||||
|
||||
60% {
|
||||
left: 100%;
|
||||
right: -90%;
|
||||
}
|
||||
|
||||
100% {
|
||||
left: 100%;
|
||||
right: -90%;
|
||||
}
|
||||
`)),F=h(L||(L=l`
|
||||
0% {
|
||||
left: -200%;
|
||||
right: 100%;
|
||||
}
|
||||
|
||||
60% {
|
||||
left: 107%;
|
||||
right: -8%;
|
||||
}
|
||||
|
||||
100% {
|
||||
left: 107%;
|
||||
right: -8%;
|
||||
}
|
||||
`)),G=h(k||(k=l`
|
||||
0% {
|
||||
opacity: 1;
|
||||
background-position: 0 -23px;
|
||||
}
|
||||
|
||||
60% {
|
||||
opacity: 0;
|
||||
background-position: 0 -23px;
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 1;
|
||||
background-position: -200px -23px;
|
||||
}
|
||||
`)),H=r=>{const{classes:e,variant:a,color:o}=r,m={root:["root",`color${t(o)}`,a],dashed:["dashed",`dashedColor${t(o)}`],bar1:["bar",`barColor${t(o)}`,(a==="indeterminate"||a==="query")&&"bar1Indeterminate",a==="determinate"&&"bar1Determinate",a==="buffer"&&"bar1Buffer"],bar2:["bar",a!=="buffer"&&`barColor${t(o)}`,a==="buffer"&&`color${t(o)}`,(a==="indeterminate"||a==="query")&&"bar2Indeterminate",a==="buffer"&&"bar2Buffer"]};return A(m,X,e)},P=(r,e)=>e==="inherit"?"currentColor":r.vars?r.vars.palette.LinearProgress[`${e}Bg`]:r.palette.mode==="light"?K(r.palette[e].main,.62):w(r.palette[e].main,.5),J=b("span",{name:"MuiLinearProgress",slot:"Root",overridesResolver:(r,e)=>{const{ownerState:a}=r;return[e.root,e[`color${t(a.color)}`],e[a.variant]]}})(({ownerState:r,theme:e})=>s({position:"relative",overflow:"hidden",display:"block",height:4,zIndex:0,"@media print":{colorAdjust:"exact"},backgroundColor:P(e,r.color)},r.color==="inherit"&&r.variant!=="buffer"&&{backgroundColor:"none","&::before":{content:'""',position:"absolute",left:0,top:0,right:0,bottom:0,backgroundColor:"currentColor",opacity:.3}},r.variant==="buffer"&&{backgroundColor:"transparent"},r.variant==="query"&&{transform:"rotate(180deg)"})),Q=b("span",{name:"MuiLinearProgress",slot:"Dashed",overridesResolver:(r,e)=>{const{ownerState:a}=r;return[e.dashed,e[`dashedColor${t(a.color)}`]]}})(({ownerState:r,theme:e})=>{const a=P(e,r.color);return s({position:"absolute",marginTop:0,height:"100%",width:"100%"},r.color==="inherit"&&{opacity:.3},{backgroundImage:`radial-gradient(${a} 0%, ${a} 16%, transparent 42%)`,backgroundSize:"10px 10px",backgroundPosition:"0 -23px"})},C(B||(B=l`
|
||||
animation: ${0} 3s infinite linear;
|
||||
`),G)),V=b("span",{name:"MuiLinearProgress",slot:"Bar1",overridesResolver:(r,e)=>{const{ownerState:a}=r;return[e.bar,e[`barColor${t(a.color)}`],(a.variant==="indeterminate"||a.variant==="query")&&e.bar1Indeterminate,a.variant==="determinate"&&e.bar1Determinate,a.variant==="buffer"&&e.bar1Buffer]}})(({ownerState:r,theme:e})=>s({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left",backgroundColor:r.color==="inherit"?"currentColor":(e.vars||e).palette[r.color].main},r.variant==="determinate"&&{transition:`transform .${v}s linear`},r.variant==="buffer"&&{zIndex:1,transition:`transform .${v}s linear`}),({ownerState:r})=>(r.variant==="indeterminate"||r.variant==="query")&&C(I||(I=l`
|
||||
width: auto;
|
||||
animation: ${0} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
|
||||
`),W)),Y=b("span",{name:"MuiLinearProgress",slot:"Bar2",overridesResolver:(r,e)=>{const{ownerState:a}=r;return[e.bar,e[`barColor${t(a.color)}`],(a.variant==="indeterminate"||a.variant==="query")&&e.bar2Indeterminate,a.variant==="buffer"&&e.bar2Buffer]}})(({ownerState:r,theme:e})=>s({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left"},r.variant!=="buffer"&&{backgroundColor:r.color==="inherit"?"currentColor":(e.vars||e).palette[r.color].main},r.color==="inherit"&&{opacity:.3},r.variant==="buffer"&&{backgroundColor:P(e,r.color),transition:`transform .${v}s linear`}),({ownerState:r})=>(r.variant==="indeterminate"||r.variant==="query")&&C(_||(_=l`
|
||||
width: auto;
|
||||
animation: ${0} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite;
|
||||
`),F)),Z=z.exports.forwardRef(function(e,a){const o=D({props:e,name:"MuiLinearProgress"}),{className:m,color:N="primary",value:g,valueBuffer:y,variant:i="indeterminate"}=o,R=T(o,S),c=s({},o,{color:N,variant:i}),f=H(c),$=j(),u={},d={bar1:{},bar2:{}};if((i==="determinate"||i==="buffer")&&g!==void 0){u["aria-valuenow"]=Math.round(g),u["aria-valuemin"]=0,u["aria-valuemax"]=100;let n=g-100;$.direction==="rtl"&&(n=-n),d.bar1.transform=`translateX(${n}%)`}if(i==="buffer"&&y!==void 0){let n=(y||0)-100;$.direction==="rtl"&&(n=-n),d.bar2.transform=`translateX(${n}%)`}return U(J,s({className:O(f.root,m),ownerState:c,role:"progressbar"},u,{ref:a},R,{children:[i==="buffer"?p(Q,{className:f.dashed,ownerState:c}):null,p(V,{className:f.bar1,ownerState:c,style:d.bar1}),i==="determinate"?null:p(Y,{className:f.bar2,ownerState:c,style:d.bar2})]}))}),ar=Z;export{ar as L,er as l};
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user