Compare commits
29 Commits
feature/ho
...
feature/ge
| Author | SHA1 | Date | |
|---|---|---|---|
| bcf6662db6 | |||
| 912edcdae7 | |||
| 5a7695b404 | |||
| 5f05f191c6 | |||
| 46af57b17c | |||
| 016bd3f605 | |||
| 093f8160d2 | |||
| d8f493103c | |||
| 7f77deb09e | |||
| d38bc8dbfc | |||
| b225084991 | |||
| d8a98f4648 | |||
|
|
f309f4039c | ||
|
|
387658a992 | ||
| 6491f4d3e3 | |||
| 5028b2d82b | |||
| 5d56434aa2 | |||
| 8e05280b7d | |||
| e3de0a3c04 | |||
| c3a425c93d | |||
| 431070efc3 | |||
| e8c3decf85 | |||
| 99c488baf3 | |||
| 0b50e4c980 | |||
| ba310a21c1 | |||
| 5a0136acf8 | |||
| 75c9781a22 | |||
| 2a1f0c854a | |||
| f0c787fede |
@@ -35,13 +35,13 @@ class AuthController extends Controller
|
||||
if (filter_var($request->phoneOrEmail, FILTER_VALIDATE_EMAIL)) {
|
||||
User::query()->find($user->id)->update([
|
||||
'email' => $request->phoneOrEmail,
|
||||
'otp' => rand(1000, 9999),
|
||||
'otp' => 4444, //rand(1000, 9999),
|
||||
'otp_created_at' => now()
|
||||
]);
|
||||
} else {
|
||||
User::query()->find($user->id)->update([
|
||||
'phone' => $request->phoneOrEmail,
|
||||
'otp' => rand(1000, 9999),
|
||||
'otp' => 4444,//rand(1000, 9999),
|
||||
'otp_created_at' => now()
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ class DashboardResources extends JsonResource
|
||||
'myLimit' => [
|
||||
'balance' => $myLimitBalance,
|
||||
'total' => $myLimitTotal,
|
||||
'percentage' => ($myLimitBalance / $myLimitTotal) * 100,
|
||||
'percentage' => $myLimitTotal ? (($myLimitBalance / $myLimitTotal) * 100) : 0,
|
||||
],
|
||||
'lockLimit' => [
|
||||
'balance' => $lockBalance,
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Internal\Http\Controllers\Api;
|
||||
|
||||
use App\Helpers\Helper;
|
||||
use App\Models\OLDLMS\Appointment;
|
||||
use Illuminate\Contracts\Support\Renderable;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Routing\Controller;
|
||||
use Modules\Internal\Transformers\AppointmentResource;
|
||||
|
||||
class AppointmentController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
* @return Renderable
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$appointments = Appointment::query()
|
||||
->with('doctor.user', 'doctor.speciality', 'appointmentDetail', 'healthCare', 'user', 'user.detail')
|
||||
->latest()
|
||||
->paginate(15);
|
||||
return response()->json(Helper::paginateResources(AppointmentResource::collection($appointments)));
|
||||
}
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
* @return Renderable
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
return view('internal::create');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
* @param Request $request
|
||||
* @return Renderable
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
* @param int $id
|
||||
* @return Renderable
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
$appointments = Appointment::query()
|
||||
->with('doctor.user', 'doctor.speciality', 'appointmentDetail', 'healthCare')
|
||||
->where('nID', $id)
|
||||
->first();
|
||||
return response()->json(new AppointmentResource($appointments));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
* @param int $id
|
||||
* @return Renderable
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
return view('internal::edit');
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
* @param Request $request
|
||||
* @param int $id
|
||||
* @return Renderable
|
||||
*/
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
* @param int $id
|
||||
* @return Renderable
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
86
Modules/Internal/Http/Controllers/Api/CityController.php
Normal file
86
Modules/Internal/Http/Controllers/Api/CityController.php
Normal file
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Internal\Http\Controllers\Api;
|
||||
|
||||
use App\Models\City;
|
||||
use Illuminate\Contracts\Support\Renderable;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Routing\Controller;
|
||||
|
||||
class CityController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
* @return Renderable
|
||||
*/
|
||||
public function index(Request $request)
|
||||
{
|
||||
$city = City::where('province_id', $request->province_id)->orderBy('name', 'asc')->get();
|
||||
|
||||
if (!$city) {
|
||||
return response(['message' => 'Tidak ada data'], 404);
|
||||
} else {
|
||||
return response(['message' => 'Data ditemukan', 'data' => $city]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
* @return Renderable
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
return view('internal::create');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
* @param Request $request
|
||||
* @return Renderable
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
* @param int $id
|
||||
* @return Renderable
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
return view('internal::show');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
* @param int $id
|
||||
* @return Renderable
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
return view('internal::edit');
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
* @param Request $request
|
||||
* @param int $id
|
||||
* @return Renderable
|
||||
*/
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
* @param int $id
|
||||
* @return Renderable
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -10,11 +10,13 @@ use App\Models\Member;
|
||||
use Box\Spout\Reader\Common\Creator\ReaderEntityFactory;
|
||||
use Box\Spout\Writer\Common\Creator\WriterEntityFactory;
|
||||
use Box\Spout\Common\Entity\Row;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Contracts\Support\Renderable;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Routing\Controller;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Modules\Internal\Services\MemberEnrollmentService;
|
||||
use PDF;
|
||||
|
||||
class CorporateMemberController extends Controller
|
||||
{
|
||||
@@ -41,10 +43,10 @@ class CorporateMemberController extends Controller
|
||||
'claims' => function ($claim) {
|
||||
// return $claim->whereBetween('requested_at', [now()->startOfYear(), now()->endOfYear()]);
|
||||
// return $claim->used(now()->startOfYear(), now()->endOfYear());
|
||||
}
|
||||
},
|
||||
'currentPlan',
|
||||
'currentPlan.benefits'
|
||||
])
|
||||
->with('currentPlan')
|
||||
// ->with
|
||||
->paginate()
|
||||
->appends($request->all());
|
||||
|
||||
@@ -228,4 +230,25 @@ class CorporateMemberController extends Controller
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
public function generateLog(Request $request, $member_id)
|
||||
{
|
||||
$member = Member::findOrFail($member_id)
|
||||
->load([
|
||||
'currentPlan',
|
||||
'currentPolicy',
|
||||
'currentPlan.corporateBenefits' => function ($benefit) use ($request) {
|
||||
return $benefit->when($request->benefit_ids, function ($q, $ids) {
|
||||
return $q->whereIn('id', $ids);
|
||||
});
|
||||
},
|
||||
'currentPlan.corporateBenefits.benefit']);
|
||||
|
||||
$dateOfAdmission = $request->date_of_admission ? Carbon::parse($request->date_of_admission) : now();
|
||||
|
||||
// return view('pdf.guaranted_leter', compact('member'));
|
||||
$pdf = PDF::loadView('pdf.guaranted_leter', compact(['member', 'dateOfAdmission']));
|
||||
return $pdf->download('Guaranted Letter - '.$member->full_name.'.pdf');
|
||||
}
|
||||
}
|
||||
|
||||
85
Modules/Internal/Http/Controllers/Api/DistrictController.php
Normal file
85
Modules/Internal/Http/Controllers/Api/DistrictController.php
Normal file
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Internal\Http\Controllers\Api;
|
||||
|
||||
use App\Models\District;
|
||||
use Illuminate\Contracts\Support\Renderable;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Routing\Controller;
|
||||
|
||||
class DistrictController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
* @return Renderable
|
||||
*/
|
||||
public function index(Request $request)
|
||||
{
|
||||
$district = District::where('city_id', $request->city_id)->orderBy('name', 'asc')->get();
|
||||
|
||||
if (!$district) {
|
||||
return response(['message' => 'Tidak ada data'], 404);
|
||||
} else {
|
||||
return response(['message' => 'Data ditemukan', 'data' => $district]);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
* @return Renderable
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
return view('internal::create');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
* @param Request $request
|
||||
* @return Renderable
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
* @param int $id
|
||||
* @return Renderable
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
return view('internal::show');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
* @param int $id
|
||||
* @return Renderable
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
return view('internal::edit');
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
* @param Request $request
|
||||
* @param int $id
|
||||
* @return Renderable
|
||||
*/
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
* @param int $id
|
||||
* @return Renderable
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace Modules\Internal\Http\Controllers\Api;
|
||||
|
||||
use App\Helpers\Helper;
|
||||
use App\Models\Person;
|
||||
use App\Models\Practitioner;
|
||||
use App\Models\PractitionerRole;
|
||||
use Illuminate\Contracts\Support\Renderable;
|
||||
@@ -18,12 +19,6 @@ class DoctorController extends Controller
|
||||
*/
|
||||
public function index(Request $request)
|
||||
{
|
||||
// $doctors = PractitionerRole::active()->with('practitioner.person', 'organization')
|
||||
// ->when($request->search ?? null, function ($query, $search) {
|
||||
// $query->whereHas('practitioner.person', function ($person) use ($search) {
|
||||
// $person->where('name', 'LIKE', '%' . $search . '%');
|
||||
// });
|
||||
// })->paginate();
|
||||
|
||||
$doctors = Practitioner::with('person', 'practitionerRoles.organization', 'practitionerRoles.speciality')
|
||||
->when($request->search ?? null, function ($query, $search) {
|
||||
@@ -31,6 +26,9 @@ class DoctorController extends Controller
|
||||
$person->where('name', 'LIKE', '%' . $search . '%');
|
||||
});
|
||||
})
|
||||
->when($request->id ?? null, function ($query, $id) {
|
||||
$query->where('id', $id);
|
||||
})
|
||||
->when($request->organization_id ?? null, function ($query, $organization_id) {
|
||||
$query->whereHas('practitionerRoles', function ($practitionerRole) use ($organization_id) {
|
||||
$practitionerRole->where('organization_id', $organization_id);
|
||||
@@ -65,7 +63,58 @@ class DoctorController extends Controller
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
//
|
||||
$data_person = [
|
||||
'name' => $request->name,
|
||||
'gender' => $request->gender,
|
||||
'address' => $request->address,
|
||||
'phone' => $request->phone,
|
||||
'email' => $request->email,
|
||||
'birth_date' => date('Y-m-d', strtotime($request->birth_date)),
|
||||
'birth_place' => $request->birth_place,
|
||||
];
|
||||
|
||||
$person = Person::create($data_person);
|
||||
$address = $person->addresses()->create([
|
||||
'use' => 'both',
|
||||
'type' => 'physical',
|
||||
'text' => $request->address,
|
||||
]);
|
||||
|
||||
$person->main_address_id = $address->id;
|
||||
$person->save();
|
||||
|
||||
$practitioner = $person->practitioner()->create();
|
||||
|
||||
$practices = $request->practices;
|
||||
if ($practices[0]['organization_id'] !== null) {
|
||||
foreach ($practices as $key => $practice) {
|
||||
if (isset($practice['specialities'])) {
|
||||
//jika input spesialis
|
||||
foreach ($practice['specialities'] as $key => $speciality) {
|
||||
$speciality_id = $speciality['speciality_id'];
|
||||
$organization_id = $practice['organization_id'];
|
||||
$practitionerRole = $practitioner->practitionerRoles()->create([
|
||||
'organization_id' => $organization_id,
|
||||
'speciality_id' => $speciality_id,
|
||||
]);
|
||||
}
|
||||
} else {
|
||||
//jika tidak input spesialis
|
||||
$speciality_id = null;
|
||||
$organization_id = $practice['organization_id'];
|
||||
|
||||
$practitionerRole = $practitioner->practitionerRoles()->create([
|
||||
'organization_id' => $organization_id,
|
||||
'speciality_id' => $speciality_id,
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return response()->json([
|
||||
'status' => 'success',
|
||||
'message' => 'Data berhasil disimpan',
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -75,7 +124,8 @@ class DoctorController extends Controller
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
return view('internal::show');
|
||||
$practitioner = Practitioner::with('person', 'practitionerRoles.organization', 'practitionerRoles.speciality')->find($id);
|
||||
return response()->json(DoctorResource::make($practitioner));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -85,7 +135,8 @@ class DoctorController extends Controller
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
return view('internal::edit');
|
||||
$practitioner = Practitioner::with('person', 'practitionerRoles.organization', 'practitionerRoles.speciality')->find($id);
|
||||
return response()->json(DoctorResource::make($practitioner));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -96,7 +147,81 @@ class DoctorController extends Controller
|
||||
*/
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
//
|
||||
$practitioner = Practitioner::find($id);
|
||||
$data_person = [
|
||||
'name' => $request->name,
|
||||
'gender' => $request->gender,
|
||||
'address' => $request->address,
|
||||
'phone' => $request->phone,
|
||||
'email' => $request->email,
|
||||
'birth_date' => date('Y-m-d', strtotime($request->birth_date)),
|
||||
'birth_place' => $request->birth_place,
|
||||
];
|
||||
|
||||
$person = $practitioner->person;
|
||||
$person->update($data_person);
|
||||
$address = $practitioner->person->addresses()->updateOrCreate([
|
||||
'use' => 'both',
|
||||
'type' => 'physical',
|
||||
'text' => $request->address,
|
||||
]);
|
||||
$practitioner->person->main_address_id = $address->id;
|
||||
$practitioner->person->save();
|
||||
|
||||
$practices = $request->practices;
|
||||
$practitionerRole = $practitioner->practitionerRoles()->get() ?? null;
|
||||
|
||||
foreach ($practices as $practice) {
|
||||
$organization_id = $practice['organization_id'];
|
||||
foreach ($practice['specialities'] as $speciality) {
|
||||
$speciality_id = $speciality['speciality_id'];
|
||||
$cek = $practitionerRole->where('organization_id', $organization_id)
|
||||
->where('speciality_id', $speciality_id)->first() ?? null;
|
||||
if (!$cek || $practitionerRole->isEmpty()) {
|
||||
// Create new practitioner role if not found
|
||||
$practitioner->practitionerRoles()->create([
|
||||
'organization_id' => $organization_id,
|
||||
'speciality_id' => $speciality_id,
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($practitionerRole) {
|
||||
// Remove practitioner roles that are no longer exists
|
||||
$currentRoleIds = $practitionerRole->pluck('id')->toArray();
|
||||
$newRoleIds = [];
|
||||
|
||||
foreach ($practices as $practice) {
|
||||
$organization_id = $practice['organization_id'];
|
||||
foreach ($practice['specialities'] as $speciality) {
|
||||
$speciality_id = $speciality['speciality_id'];
|
||||
$newPractitionerRole = $practitionerRole->where('organization_id', $organization_id)
|
||||
->where('speciality_id', $speciality_id)
|
||||
->first();
|
||||
|
||||
if ($newPractitionerRole) {
|
||||
$newRoleIds[] = $newPractitionerRole->id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$deletedRoleIds = array_diff($currentRoleIds, $newRoleIds);
|
||||
|
||||
if (count($deletedRoleIds) > 0) {
|
||||
// Delete practitioner roles that are no longer exists
|
||||
$data = $practitionerRole->whereIn('id', $deletedRoleIds);
|
||||
$data->each(function ($item) {
|
||||
$item->delete();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return response()->json([
|
||||
'status' => 'success',
|
||||
'message' => 'Data berhasil disimpan',
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -106,6 +231,14 @@ class DoctorController extends Controller
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
//
|
||||
$practitioner = Practitioner::find($id);
|
||||
$person = $practitioner->person->delete();
|
||||
$address = $practitioner->person->addresses()->delete();
|
||||
$practitionerRole = $practitioner->practitionerRoles()->delete();
|
||||
$practitioner->delete();
|
||||
return response()->json([
|
||||
'status' => 'success',
|
||||
'message' => 'Data berhasil dihapus',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
90
Modules/Internal/Http/Controllers/Api/LivechatController.php
Normal file
90
Modules/Internal/Http/Controllers/Api/LivechatController.php
Normal file
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Internal\Http\Controllers\Api;
|
||||
|
||||
use App\Helpers\Helper;
|
||||
use App\Models\OLDLMS\Livechat;
|
||||
use Illuminate\Contracts\Support\Renderable;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Routing\Controller;
|
||||
use Modules\Internal\Transformers\LivechatResource;
|
||||
|
||||
class LivechatController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
* @return Renderable
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$livechat = Livechat::with('doctor.user', 'doctor.speciality', 'appointment.appointmentDetail', 'healthCare')
|
||||
->where('nIDAppointment', '!=', null)->where('nIDAppointment', '!=', '')
|
||||
->latest()
|
||||
->paginate(15);
|
||||
|
||||
return response()->json(Helper::paginateResources(LivechatResource::collection($livechat)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
* @return Renderable
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
return view('internal::create');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
* @param Request $request
|
||||
* @return Renderable
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
* @param int $id
|
||||
* @return Renderable
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
$livechat = Livechat::with('doctor.user', 'doctor.speciality', 'appointment.appointmentDetail', 'healthCare')
|
||||
->where('nIDAppointment', '!=', null)->where('nIDAppointment', '!=', '')
|
||||
->where('nID', $id)
|
||||
->first();
|
||||
return response()->json(new LivechatResource($livechat));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
* @param int $id
|
||||
* @return Renderable
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
return view('internal::edit');
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
* @param Request $request
|
||||
* @param int $id
|
||||
* @return Renderable
|
||||
*/
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
* @param int $id
|
||||
* @return Renderable
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -47,7 +47,44 @@ class OrganizationController extends Controller
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
//
|
||||
$organization = [
|
||||
'code' => $request->code,
|
||||
'name' => $request->name,
|
||||
'type' => 'hospital',
|
||||
'status' => $request->active == 1 ? 'active' : 'inactive',
|
||||
'description' => $request->description,
|
||||
];
|
||||
|
||||
$create_organization = Organization::create($organization);
|
||||
|
||||
if ($request->phone != null) {
|
||||
$create_organization->metas()->create([
|
||||
'system' => 'default',
|
||||
'type' => 'phone',
|
||||
'value' => $request->phone,
|
||||
]);
|
||||
}
|
||||
|
||||
$address = $create_organization->addresses()->create([
|
||||
'use' => 'both',
|
||||
'type' => 'physical',
|
||||
'text' => $request->address,
|
||||
'province_id' => $request->province_id,
|
||||
'city_id' => $request->city_id,
|
||||
'district_id' => $request->district_id,
|
||||
'village_id' => $request->village_id,
|
||||
'postal_code' => $request->postal_code,
|
||||
'lat' => $request->lat,
|
||||
'lng' => $request->lng,
|
||||
]);
|
||||
|
||||
$create_organization->main_address_id = $address->id;
|
||||
$create_organization->save();
|
||||
|
||||
return response()->json([
|
||||
'message' => 'Data berhasil disimpan',
|
||||
'data' => new OrganizationResource($create_organization)
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -57,7 +94,7 @@ class OrganizationController extends Controller
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
return view('internal::show');
|
||||
return response()->json(OrganizationResource::make(Organization::find($id)));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -67,7 +104,7 @@ class OrganizationController extends Controller
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
return view('internal::edit');
|
||||
return response()->json(OrganizationResource::make(Organization::find($id)));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -78,7 +115,46 @@ class OrganizationController extends Controller
|
||||
*/
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
//
|
||||
$update_organization = Organization::find($id);
|
||||
|
||||
$update_organization->update([
|
||||
'code' => $request->code,
|
||||
'name' => $request->name,
|
||||
'type' => 'hospital',
|
||||
'status' => $request->active == 1 ? 'active' : 'inactive',
|
||||
'description' => $request->description,
|
||||
]);
|
||||
|
||||
if ($request->phone != null) {
|
||||
$update_organization->metas()->updateOrCreate([
|
||||
'system' => 'default',
|
||||
'type' => 'phone',
|
||||
], [
|
||||
'system' => 'default',
|
||||
'type' => 'phone',
|
||||
'value' => $request->phone,
|
||||
]);
|
||||
}
|
||||
|
||||
$update_organization->addresses()->updateOrCreate([
|
||||
'id' => $update_organization->main_address_id
|
||||
], [
|
||||
'use' => 'both',
|
||||
'type' => 'physical',
|
||||
'text' => $request->address,
|
||||
'province_id' => $request->province_id,
|
||||
'city_id' => $request->city_id,
|
||||
'district_id' => $request->district_id,
|
||||
'village_id' => $request->village_id,
|
||||
'postal_code' => $request->postal_code,
|
||||
'lat' => $request->lat,
|
||||
'lng' => $request->lng,
|
||||
]);
|
||||
|
||||
return response()->json([
|
||||
'message' => 'Data berhasil diubah',
|
||||
'data' => new OrganizationResource($update_organization)
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -88,6 +164,12 @@ class OrganizationController extends Controller
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
//
|
||||
$delete_organization = Organization::find($id);
|
||||
$delete_organization->addresses()->delete();
|
||||
$delete_organization->delete();
|
||||
return response()->json([
|
||||
'message' => 'Data berhasil dihapus',
|
||||
'data' => new OrganizationResource($delete_organization)
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
86
Modules/Internal/Http/Controllers/Api/ProvinceController.php
Normal file
86
Modules/Internal/Http/Controllers/Api/ProvinceController.php
Normal file
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Internal\Http\Controllers\Api;
|
||||
|
||||
use App\Models\Province;
|
||||
use Illuminate\Contracts\Support\Renderable;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Routing\Controller;
|
||||
|
||||
class ProvinceController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
* @return Renderable
|
||||
*/
|
||||
public function index(Request $request)
|
||||
{
|
||||
$province = Province::orderBy('name', 'ASC')->get();
|
||||
|
||||
if (empty($province)) {
|
||||
return response(['message' => 'Tidak ada data'], 404);
|
||||
} else {
|
||||
return response(['message' => 'Data ditemukan', 'data' => $province]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
* @return Renderable
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
return view('internal::create');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
* @param Request $request
|
||||
* @return Renderable
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
* @param int $id
|
||||
* @return Renderable
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
return view('internal::show');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
* @param int $id
|
||||
* @return Renderable
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
return view('internal::edit');
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
* @param Request $request
|
||||
* @param int $id
|
||||
* @return Renderable
|
||||
*/
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
* @param int $id
|
||||
* @return Renderable
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
86
Modules/Internal/Http/Controllers/Api/VillageController.php
Normal file
86
Modules/Internal/Http/Controllers/Api/VillageController.php
Normal file
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Internal\Http\Controllers\Api;
|
||||
|
||||
use App\Models\Village;
|
||||
use Illuminate\Contracts\Support\Renderable;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Routing\Controller;
|
||||
|
||||
class VillageController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
* @return Renderable
|
||||
*/
|
||||
public function index(Request $request)
|
||||
{
|
||||
$villages = Village::where('district_id', $request->district_id)->orderBy('name', 'asc')->get();
|
||||
|
||||
if (!$villages) {
|
||||
return response(['message' => 'Tidak ada data'], 404);
|
||||
} else {
|
||||
return response(['message' => 'Data ditemukan', 'data' => $villages]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
* @return Renderable
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
return view('internal::create');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
* @param Request $request
|
||||
* @return Renderable
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
* @param int $id
|
||||
* @return Renderable
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
return view('internal::show');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
* @param int $id
|
||||
* @return Renderable
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
return view('internal::edit');
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
* @param Request $request
|
||||
* @param int $id
|
||||
* @return Renderable
|
||||
*/
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
* @param int $id
|
||||
* @return Renderable
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,9 @@
|
||||
use App\Http\Controllers\Api\MemberController as ApiMemberController;
|
||||
use Modules\Internal\Http\Controllers\Api\AuthController;
|
||||
use Illuminate\Http\Request;
|
||||
use Modules\Internal\Http\Controllers\Api\AppointmentController;
|
||||
use Modules\Internal\Http\Controllers\Api\BenefitController;
|
||||
use Modules\Internal\Http\Controllers\Api\CityController;
|
||||
use Modules\Internal\Http\Controllers\Api\ClaimController;
|
||||
use Modules\Internal\Http\Controllers\Api\CorporateBenefitController;
|
||||
use Modules\Internal\Http\Controllers\Api\CorporateController;
|
||||
@@ -13,14 +15,18 @@ use Modules\Internal\Http\Controllers\Api\CorporatePlanController;
|
||||
use Modules\Internal\Http\Controllers\Api\CorporateServiceController;
|
||||
use Modules\Internal\Http\Controllers\Api\DiagnosisController;
|
||||
use Modules\Internal\Http\Controllers\Api\DiagnosisExclusionController;
|
||||
use Modules\Internal\Http\Controllers\Api\DistrictController;
|
||||
use Modules\Internal\Http\Controllers\Api\DivisionController;
|
||||
use Modules\Internal\Http\Controllers\Api\DoctorController;
|
||||
use Modules\Internal\Http\Controllers\Api\DrugController;
|
||||
use Modules\Internal\Http\Controllers\Api\FormulariumController;
|
||||
use Modules\Internal\Http\Controllers\Api\LivechatController;
|
||||
use Modules\Internal\Http\Controllers\Api\MemberController;
|
||||
use Modules\Internal\Http\Controllers\Api\OrganizationController;
|
||||
use Modules\Internal\Http\Controllers\Api\PlanController;
|
||||
use Modules\Internal\Http\Controllers\Api\ProvinceController;
|
||||
use Modules\Internal\Http\Controllers\Api\SpecialityController;
|
||||
use Modules\Internal\Http\Controllers\Api\VillageController;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
@@ -119,11 +125,19 @@ Route::prefix('internal')->group(function () {
|
||||
Route::get('search-organizations', [OrganizationController::class, 'searchOrganization']);
|
||||
Route::get('search-specialities', [SpecialityController::class, 'searchSpeciality']);
|
||||
Route::resource('organizations', OrganizationController::class);
|
||||
Route::resource('appointments', AppointmentController::class);
|
||||
Route::resource('live-chat', LivechatController::class);
|
||||
|
||||
Route::resource('doctors', DoctorController::class);
|
||||
|
||||
Route::post('generate-log/{member_id}', [CorporateMemberController::class, 'generateLog']);
|
||||
|
||||
Route::get('claim-requests', [ClaimRequestController::class, 'index'])->name('claim-requests.index');
|
||||
Route::post('claim-requests/{id}/approve', [ClaimRequestController::class, 'approve'])->name('claim-requests.approve');
|
||||
});
|
||||
|
||||
// Route::resource('organizations', OrganizationController::class);
|
||||
// Route::resource('doctors', DoctorController::class);
|
||||
|
||||
// Route::get('something', [DiagnosisExclusionController::class, 'index']);
|
||||
Route::get('province', [ProvinceController::class, 'index']);
|
||||
Route::get('city', [CityController::class, 'index']);
|
||||
Route::get('district', [DistrictController::class, 'index']);
|
||||
Route::get('village', [VillageController::class, 'index']);
|
||||
});
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
|
|
||||
*/
|
||||
|
||||
use Modules\Internal\Http\Controllers\Api\CorporateMemberController;
|
||||
|
||||
Route::prefix('internal')->group(function() {
|
||||
Route::get('/', 'InternalController@index');
|
||||
});
|
||||
});
|
||||
@@ -42,10 +42,8 @@ class CorporateService
|
||||
|
||||
$this->validatePlanRow($plan_data);
|
||||
|
||||
$plan = Plan::updateOrCreate([
|
||||
$plan = $corporate->plans()->updateOrCreate([
|
||||
'service_code' => $plan_data['service_code'],
|
||||
'corporate_id' => $corporate->id,
|
||||
'code' => $plan_data['code'],
|
||||
], $plan_data);
|
||||
|
||||
return $plan;
|
||||
|
||||
53
Modules/Internal/Transformers/AppointmentResource.php
Normal file
53
Modules/Internal/Transformers/AppointmentResource.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Internal\Transformers;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class AppointmentResource extends JsonResource
|
||||
{
|
||||
/**
|
||||
* Transform the resource into an array.
|
||||
*
|
||||
* @param \Illuminate\Http\Request
|
||||
* @return array
|
||||
*/
|
||||
public function toArray($request)
|
||||
{
|
||||
$appointment = [
|
||||
'id' => $this->nID,
|
||||
'patient_name' => $this->user ? $this->user->full_name : '',
|
||||
'doctor_name' => $this->doctor ? $this->doctor->user?->full_name : '',
|
||||
'speciality' => $this->doctor->speciality->sKeterangan,
|
||||
'date_appointment' => Carbon::parse($this->appointmentDetail->dTanggalAppointment)->format('d-m-Y') . ' ' . $this->appointmentDetail->tTimeAppointment,
|
||||
'date_created' => Carbon::parse($this->dCreateOn)->format('d-m-Y H:i:s') ?? null,
|
||||
'appointment_media' => $this->sMedia,
|
||||
'status' => $this->status_name,
|
||||
'health_care' => $this->healthCare->sHealthCare ?? null,
|
||||
'payment_method' => $this->payment_method ?? null,
|
||||
'patient' => $this->user,
|
||||
'booking_code' => $this->sBookingCode,
|
||||
'his_detail' => [
|
||||
'RegID' => $this->sRegID,
|
||||
'Medrec' => $this->sNomorRekamMedis
|
||||
],
|
||||
'type' => $this->type
|
||||
];
|
||||
|
||||
$payment_detail = null;
|
||||
if ($this->appointmentDetail->sPaymentDetails != null) {
|
||||
$payment_detail = [
|
||||
'payment_type' => $this->appointmentDetail->sPaymentDetails['payment_type'] ?? '',
|
||||
'transaction_time' => $this->appointmentDetail->sPaymentDetails['transaction_time'] ?? '',
|
||||
'gross_amount' => $this->appointmentDetail->sPaymentDetails['gross_amount'] ?? '',
|
||||
'currency' => $this->appointmentDetail->sPaymentDetails['currency'] ?? '',
|
||||
'status_message' => $this->appointmentDetail->sPaymentDetails['status_message'] ?? '',
|
||||
];
|
||||
}
|
||||
|
||||
$appointment['payment_detail'] = $payment_detail;
|
||||
|
||||
return $appointment;
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,8 @@ namespace Modules\Internal\Transformers;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
use function PHPSTORM_META\map;
|
||||
|
||||
class DoctorResource extends JsonResource
|
||||
{
|
||||
/**
|
||||
@@ -19,35 +21,51 @@ class DoctorResource extends JsonResource
|
||||
// 'his_dokter_id' => $this->practitionerRoles->meta,
|
||||
'name' => $this->person->name,
|
||||
'person_id' => $this->person->id,
|
||||
'phone' => $this->person->phone,
|
||||
'email' => $this->person->email,
|
||||
'gender' => $this->person->gender == "L" ? 'Laki-laki' : 'Perempuan',
|
||||
'address' => $this->person->currentAddress->text,
|
||||
'phone' => $this->person->phone ?? null,
|
||||
'email' => $this->person->email ?? null,
|
||||
'birth_date' => $this->person->birth_date ?? null,
|
||||
'birth_place' => $this->person->birth_place ?? null,
|
||||
'gender' => $this->person->gender == "L" || $this->person->gender == "male" ? 'male' : 'female',
|
||||
'address' => $this->person->currentAddress->text ?? null,
|
||||
'organizations' => $this->practitionerRoles->unique('organization_id')->map(function ($practitionerRole) {
|
||||
return [
|
||||
'organization_id' => $practitionerRole->organization->id,
|
||||
'organization_name' => $practitionerRole->organization->name,
|
||||
];
|
||||
}),
|
||||
})->values(),
|
||||
"specialties" => $this->practitionerRoles->unique('speciality_id')->map(function ($practitionerRole) {
|
||||
return [
|
||||
'specialty_id' => $practitionerRole->speciality->id,
|
||||
'specialty_name' => $practitionerRole->speciality->name,
|
||||
];
|
||||
}),
|
||||
"departemen" => $this->practitionerRoles->map(function ($practitionerRole) {
|
||||
return [
|
||||
'departemen_id' => $practitionerRole->meta->DepartemenID,
|
||||
];
|
||||
}),
|
||||
'education' => $this->meta->education,
|
||||
'experience' => $this->meta->work_experience,
|
||||
'award' => $this->meta->award,
|
||||
'keilmuan' => $this->meta->Keilmuan,
|
||||
'tipe_dokter' => $this->meta->tipeDokter,
|
||||
// "departemen" => $this->practitionerRoles->map(function ($practitionerRole) {
|
||||
// return [
|
||||
// 'departemen_id' => $practitionerRole->meta->DepartemenID ?? null,
|
||||
// ];
|
||||
// }) ?? null,
|
||||
'education' => $this->meta->education ?? null,
|
||||
'experience' => $this->meta->work_experience ?? null,
|
||||
'award' => $this->meta->award ?? null,
|
||||
'keilmuan' => $this->meta->Keilmuan ?? null,
|
||||
'tipe_dokter' => $this->meta->tipeDokter ?? null,
|
||||
|
||||
];
|
||||
|
||||
$grouped = $this->collection($this->practitionerRoles)->groupBy('organization_id');
|
||||
$grouped->transform(function ($items, $key) {
|
||||
return [
|
||||
'organization_id' => $key,
|
||||
'specialities' => $items->map(function ($item) {
|
||||
return [
|
||||
'speciality_id' => $item->speciality->id,
|
||||
];
|
||||
}),
|
||||
];
|
||||
});
|
||||
|
||||
$doctor['practices'] = $grouped->toArray();
|
||||
|
||||
return $doctor;
|
||||
}
|
||||
}
|
||||
|
||||
62
Modules/Internal/Transformers/LivechatResource.php
Normal file
62
Modules/Internal/Transformers/LivechatResource.php
Normal file
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Internal\Transformers;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class LivechatResource extends JsonResource
|
||||
{
|
||||
/**
|
||||
* Transform the resource into an array.
|
||||
*
|
||||
* @param \Illuminate\Http\Request
|
||||
* @return array
|
||||
*/
|
||||
public function toArray($request)
|
||||
{
|
||||
$livechat = [
|
||||
'id' => $this->nID,
|
||||
'doctor_name' => isset($this->doctor->user->sFirstName) ? $this->doctor->user->sFirstName . ' ' . $this->doctor->user->sLastName : null,
|
||||
'speciality' => $this->doctor->speciality->sKeterangan ?? null,
|
||||
'health_care' => $this->healthCare->sHealthCare ?? null,
|
||||
'date_appointment' => Carbon::parse($this->appointment->appointmentDetail->dTanggalAppointment)->format('d-m-Y')
|
||||
. ' ' . $this->appointment->appointmentDetail->tTimeAppointment ?? null,
|
||||
'status_appointment' => $this->appointment->status_name ?? null,
|
||||
'date_created' => Carbon::parse($this->appointment->dCreateOn)->format('d-m-Y H:i:s') ?? null,
|
||||
'patient_media' => $this->sMedia ?? null,
|
||||
'doctor_media' => $this->sMediaDokter ?? null,
|
||||
'appointment_media' => $this->appointment->sMedia ?? null,
|
||||
'status_chat' => $this->status_name ?? null,
|
||||
'payment_method' => $this->appointment->payment_method ?? null,
|
||||
];
|
||||
|
||||
$start_time = $this->dStartTime;
|
||||
$end_time = $this->dEndTime;
|
||||
$data_duration = 0 . ' jam ' . 0 . ' menit ' . 0 . ' detik';
|
||||
if ($start_time != null && $end_time != null) {
|
||||
$duration = Carbon::parse($start_time)->diffInMinutes(Carbon::parse($end_time));
|
||||
$hours = floor($duration / 60);
|
||||
$minutes = $duration % 60;
|
||||
$seconds = ($duration - ($hours * 60) - $minutes) * 60;
|
||||
|
||||
$data_duration = $hours . ' jam ' . $minutes . ' menit ' . $seconds . ' detik';
|
||||
}
|
||||
|
||||
$livechat['duration'] = $data_duration;
|
||||
|
||||
$payment_detail = null;
|
||||
if ($this->appointment->appointmentDetail->sPaymentDetails != null) {
|
||||
$payment_detail = [
|
||||
'payment_type' => $this->appointment->appointmentDetail->sPaymentDetails['payment_type'],
|
||||
'transaction_time' => $this->appointment->appointmentDetail->sPaymentDetails['transaction_time'],
|
||||
'gross_amount' => $this->appointment->appointmentDetail->sPaymentDetails['gross_amount'],
|
||||
'currency' => $this->appointment->appointmentDetail->sPaymentDetails['currency'],
|
||||
'status_message' => $this->appointment->appointmentDetail->sPaymentDetails['status_message'],
|
||||
];
|
||||
}
|
||||
|
||||
$livechat['payment_detail'] = $payment_detail;
|
||||
return $livechat;
|
||||
}
|
||||
}
|
||||
@@ -14,17 +14,24 @@ class OrganizationResource extends JsonResource
|
||||
*/
|
||||
public function toArray($request)
|
||||
{
|
||||
|
||||
$organization = [
|
||||
'id' => $this->id,
|
||||
'name' => $this->name,
|
||||
'type' => $this->type,
|
||||
'code' => $this->code,
|
||||
'description' => $this->description,
|
||||
'kodeRs' => $this->meta->kodeRs ?? null,
|
||||
'kodeRs' => $this->meta->KodeRS ?? null,
|
||||
'phone' => $this->meta->phone ?? null,
|
||||
'lat' => $this->currentAddress->lat ?? null,
|
||||
'lng' => $this->currentAddress->lng ?? null,
|
||||
'address' => $this->currentAddress ?? null,
|
||||
'address' => $this->currentAddress->text ?? null,
|
||||
'province_id' => $this->currentAddress->province_id ?? null,
|
||||
'city_id' => $this->currentAddress->city_id ?? null,
|
||||
'district_id' => $this->currentAddress->district_id ?? null,
|
||||
'village_id' => $this->currentAddress->village_id ?? null,
|
||||
'postal_code' => $this->currentAddress->postal_code ?? null,
|
||||
'active' => $this->status == 'active' ? 1 : 0,
|
||||
];
|
||||
|
||||
return $organization;
|
||||
|
||||
@@ -4,10 +4,11 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class CorporateManager extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
use HasFactory, SoftDeletes;
|
||||
|
||||
protected $table = 'corporate_manager';
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Models\OLDLMS;
|
||||
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
@@ -14,12 +15,99 @@ class Appointment extends Model
|
||||
const UPDATED_AT = 'dUpdateOn';
|
||||
const DELETED_AT = 'dDeleteOn';
|
||||
|
||||
public $sStatusNames = [
|
||||
0 => 'Menunggu Pembayaran',
|
||||
1 => 'Pembayaran Terkonfirmasi', // Pembayaran Diterima
|
||||
2 => 'Ditolak',
|
||||
3 => 'Dibatalkan', // Canceled
|
||||
4 => 'Expired',
|
||||
];
|
||||
|
||||
public $sPaymentMethodName = [
|
||||
1 => 'Pribadi',
|
||||
2 => 'On-Site Payment',
|
||||
3 => 'OVO',
|
||||
4 => 'Asuransi',
|
||||
5 => 'Voucher',
|
||||
];
|
||||
|
||||
public $nIDJenisBookingNames = [
|
||||
1 => 'Rawat Jalan',
|
||||
2 => 'Telekonsultasi',
|
||||
3 => 'Chat Sekarang'
|
||||
];
|
||||
|
||||
protected $connection = 'oldlms';
|
||||
|
||||
protected $table = 'tx_appointment';
|
||||
|
||||
public function detail()
|
||||
protected $primaryKey = 'nID';
|
||||
|
||||
public $incrementing = false;
|
||||
|
||||
protected $keyType = 'string';
|
||||
|
||||
protected $fillable = [
|
||||
'nID',
|
||||
'nIDDokter',
|
||||
'nIDUser',
|
||||
'sStatus',
|
||||
'dCreateOn',
|
||||
'dUpdateOn',
|
||||
'dDeleteOn',
|
||||
];
|
||||
|
||||
protected $appends = [
|
||||
'status_name',
|
||||
'payment_method',
|
||||
'type'
|
||||
];
|
||||
|
||||
protected function statusName(): Attribute
|
||||
{
|
||||
return $this->hasOne(AppointmentDetail::class, '');
|
||||
return Attribute::make(
|
||||
get: function ($value) {
|
||||
return $this->sStatusNames[$this->sStatus] ?? '-';
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
protected function paymentMethod(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: function ($value) {
|
||||
return $this->sPaymentMethodName[$this->sPaymentMethod] ?? '-';
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
protected function type(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: function($value) {
|
||||
return $this->nIDJenisBookingNames[$this->nIDJenisBooking] ?? '-';
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public function appointmentDetail()
|
||||
{
|
||||
return $this->hasOne(AppointmentDetail::class, 'nIDAppointment', 'nID');
|
||||
}
|
||||
|
||||
public function doctor()
|
||||
{
|
||||
return $this->belongsTo(Dokter::class, 'nIDDokter', 'nID');
|
||||
}
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'nIDUser', 'nID');
|
||||
}
|
||||
|
||||
public function healthCare()
|
||||
{
|
||||
return $this->belongsTo(Healthcare::class, 'nIDHealthCare', 'nID');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,4 +8,19 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class AppointmentDetail extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
const CREATED_AT = 'dCreateOn';
|
||||
const UPDATED_AT = 'dUpdateOn';
|
||||
const DELETED_AT = 'dDeleteOn';
|
||||
|
||||
protected $connection = 'oldlms';
|
||||
|
||||
protected $table = 'tx_appointment_detail';
|
||||
protected $casts = [
|
||||
'sPaymentDetails' => 'array',
|
||||
];
|
||||
public function appointment()
|
||||
{
|
||||
return $this->belongsTo(Appointment::class, 'nIDAppointment', 'nID');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,4 +24,14 @@ class Dokter extends Model
|
||||
{
|
||||
return $this->hasMany(JadwalDokter::class, 'nIDDokter', 'nID');
|
||||
}
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'nIDUser', 'nID');
|
||||
}
|
||||
|
||||
public function speciality()
|
||||
{
|
||||
return $this->belongsTo(Speciality::class, 'nIDSpesialis', 'nID');
|
||||
}
|
||||
}
|
||||
|
||||
64
app/Models/OLDLMS/Livechat.php
Normal file
64
app/Models/OLDLMS/Livechat.php
Normal file
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\OLDLMS;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Livechat extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
|
||||
public $sStatusNames = [
|
||||
0 => 'Menunggu Konfirmasi',
|
||||
1 => 'Diterima',
|
||||
2 => 'Ditolak',
|
||||
3 => 'Selesai',
|
||||
4 => 'Expired',
|
||||
];
|
||||
|
||||
const CREATED_AT = 'dCreateOn';
|
||||
const UPDATED_AT = 'dUpdateOn';
|
||||
const DELETED_AT = 'dDeleteOn';
|
||||
|
||||
protected $connection = 'oldlms';
|
||||
|
||||
protected $table = 'tx_livechat';
|
||||
|
||||
protected $appends = [
|
||||
'status_name',
|
||||
];
|
||||
|
||||
protected function statusName(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: function ($value) {
|
||||
return $this->sStatusNames[$this->sStatus] ?? '-';
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'nIDUser', 'nID');
|
||||
}
|
||||
|
||||
public function doctor()
|
||||
{
|
||||
return $this->belongsTo(Dokter::class, 'nIDDokter', 'nID');
|
||||
}
|
||||
|
||||
|
||||
public function appointment()
|
||||
{
|
||||
return $this->belongsTo(Appointment::class, 'nIDAppointment', 'nID');
|
||||
}
|
||||
|
||||
public function healthCare()
|
||||
{
|
||||
return $this->belongsTo(Healthcare::class, 'nIDHealthCare', 'nID');
|
||||
}
|
||||
}
|
||||
26
app/Models/OLDLMS/Speciality.php
Normal file
26
app/Models/OLDLMS/Speciality.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\OLDLMS;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Speciality extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
const CREATED_AT = 'dCreateOn';
|
||||
const UPDATED_AT = 'dUpdateOn';
|
||||
const DELETED_AT = 'dDeleteOn';
|
||||
|
||||
protected $connection = 'oldlms';
|
||||
|
||||
protected $table = 'tm_spesialis';
|
||||
|
||||
protected $primaryKey = 'nID';
|
||||
|
||||
public function dokter()
|
||||
{
|
||||
return $this->hasMany(Dokter::class, 'nIDSpesialis', 'nID');
|
||||
}
|
||||
}
|
||||
@@ -2,10 +2,46 @@
|
||||
|
||||
namespace App\Models\OLDLMS;
|
||||
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class User extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
use HasFactory, SoftDeletes;
|
||||
|
||||
const CREATED_AT = 'dCreateOn';
|
||||
const UPDATED_AT = 'dUpdateOn';
|
||||
const DELETED_AT = 'dDeleteOn';
|
||||
|
||||
protected $connection = 'oldlms';
|
||||
|
||||
protected $table = 'tm_users';
|
||||
|
||||
protected $appends = [
|
||||
'full_name',
|
||||
];
|
||||
|
||||
protected function fullName(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: function ($value) {
|
||||
$names = [];
|
||||
if (!empty($this->sFirstName)) {
|
||||
array_push($names, $this->sFirstName);
|
||||
}
|
||||
if (!empty($this->sLastName)) {
|
||||
array_push($names, $this->sLastName);
|
||||
}
|
||||
|
||||
return implode(' ', $names);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
public function detail()
|
||||
{
|
||||
return $this->hasOne(UserDetail::class, 'nIDUser', 'nID');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,4 +8,13 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class UserDetail extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
const CREATED_AT = 'dCreateOn';
|
||||
const UPDATED_AT = 'dUpdateOn';
|
||||
const DELETED_AT = 'dDeleteOn';
|
||||
|
||||
protected $connection = 'oldlms';
|
||||
|
||||
protected $table = 'tm_users_detail';
|
||||
|
||||
}
|
||||
|
||||
@@ -114,6 +114,11 @@ class Person extends Model
|
||||
return $this->hasOne(User::class, 'person_id');
|
||||
}
|
||||
|
||||
public function practitioner()
|
||||
{
|
||||
return $this->hasOne(Practitioner::class, 'person_id');
|
||||
}
|
||||
|
||||
public function appointmentParticipantables()
|
||||
{
|
||||
return $this->morphMany(AppointmentParticipant::class, 'participantable');
|
||||
|
||||
@@ -48,13 +48,26 @@ class User extends Authenticatable
|
||||
];
|
||||
|
||||
public $with = [
|
||||
'metas'
|
||||
'metas',
|
||||
'person'
|
||||
];
|
||||
|
||||
public $appends = [
|
||||
'meta'
|
||||
'meta',
|
||||
'avatar_url',
|
||||
'full_name'
|
||||
];
|
||||
|
||||
public function getAvatarUrlAttribute()
|
||||
{
|
||||
return asset('images/specialities/anak.png');
|
||||
}
|
||||
|
||||
public function getFullNameAttribute()
|
||||
{
|
||||
return $this->person?->full_name;
|
||||
}
|
||||
|
||||
public function getMetaAttribute()
|
||||
{
|
||||
$orgMeta = [];
|
||||
|
||||
@@ -6,9 +6,11 @@
|
||||
"license": "MIT",
|
||||
"require": {
|
||||
"php": "^8.0.2",
|
||||
"barryvdh/laravel-snappy": "^1.0",
|
||||
"box/spout": "^3.3",
|
||||
"duitkupg/duitku-php": "dev-master",
|
||||
"guzzlehttp/guzzle": "^7.2",
|
||||
"h4cc/wkhtmltopdf-amd64": "0.12.x",
|
||||
"laravel/framework": "^9.11",
|
||||
"laravel/sanctum": "^2.15",
|
||||
"laravel/socialite": "^5.5",
|
||||
|
||||
203
composer.lock
generated
203
composer.lock
generated
@@ -4,8 +4,86 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "bce7c2a0879fd09f793f1bfa9aeb0a68",
|
||||
"content-hash": "001e5beb4f35e725aaab5763c69eaeed",
|
||||
"packages": [
|
||||
{
|
||||
"name": "barryvdh/laravel-snappy",
|
||||
"version": "v1.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/barryvdh/laravel-snappy.git",
|
||||
"reference": "2c18a3602981bc6f25b32908cf8aaa05952ab2f7"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/barryvdh/laravel-snappy/zipball/2c18a3602981bc6f25b32908cf8aaa05952ab2f7",
|
||||
"reference": "2c18a3602981bc6f25b32908cf8aaa05952ab2f7",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"illuminate/filesystem": "^6|^7|^8|^9",
|
||||
"illuminate/support": "^6|^7|^8|^9",
|
||||
"knplabs/knp-snappy": "^1",
|
||||
"php": ">=7.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"orchestra/testbench": "^4|^5|^6|^7"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0-dev"
|
||||
},
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Barryvdh\\Snappy\\ServiceProvider"
|
||||
],
|
||||
"aliases": {
|
||||
"PDF": "Barryvdh\\Snappy\\Facades\\SnappyPdf",
|
||||
"SnappyImage": "Barryvdh\\Snappy\\Facades\\SnappyImage"
|
||||
}
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Barryvdh\\Snappy\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Barry vd. Heuvel",
|
||||
"email": "barryvdh@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "Snappy PDF/Image for Laravel",
|
||||
"keywords": [
|
||||
"image",
|
||||
"laravel",
|
||||
"pdf",
|
||||
"snappy",
|
||||
"wkhtmltoimage",
|
||||
"wkhtmltopdf"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/barryvdh/laravel-snappy/issues",
|
||||
"source": "https://github.com/barryvdh/laravel-snappy/tree/v1.0.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://fruitcake.nl",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/barryvdh",
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2022-01-29T19:36:49+00:00"
|
||||
},
|
||||
{
|
||||
"name": "box/spout",
|
||||
"version": "v3.3.0",
|
||||
@@ -1199,6 +1277,129 @@
|
||||
],
|
||||
"time": "2022-10-26T14:07:24+00:00"
|
||||
},
|
||||
{
|
||||
"name": "h4cc/wkhtmltopdf-amd64",
|
||||
"version": "0.12.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/h4cc/wkhtmltopdf-amd64.git",
|
||||
"reference": "4e2ab2d032a5d7fbe2a741de8b10b8989523c95b"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/h4cc/wkhtmltopdf-amd64/zipball/4e2ab2d032a5d7fbe2a741de8b10b8989523c95b",
|
||||
"reference": "4e2ab2d032a5d7fbe2a741de8b10b8989523c95b",
|
||||
"shasum": ""
|
||||
},
|
||||
"bin": [
|
||||
"bin/wkhtmltopdf-amd64"
|
||||
],
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"h4cc\\WKHTMLToPDF\\": ""
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"LGPL Version 3"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Julius Beckmann",
|
||||
"email": "github@h4cc.de"
|
||||
}
|
||||
],
|
||||
"description": "Convert html to pdf using webkit (qtwebkit). Static linked linux binary for amd64 systems.",
|
||||
"homepage": "http://wkhtmltopdf.org/",
|
||||
"keywords": [
|
||||
"binary",
|
||||
"convert",
|
||||
"pdf",
|
||||
"snapshot",
|
||||
"thumbnail",
|
||||
"wkhtmltopdf"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/h4cc/wkhtmltopdf-amd64/issues",
|
||||
"source": "https://github.com/h4cc/wkhtmltopdf-amd64/tree/master"
|
||||
},
|
||||
"time": "2018-01-15T06:57:33+00:00"
|
||||
},
|
||||
{
|
||||
"name": "knplabs/knp-snappy",
|
||||
"version": "v1.4.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/KnpLabs/snappy.git",
|
||||
"reference": "5126fb5b335ec929a226314d40cd8dad497c3d67"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/KnpLabs/snappy/zipball/5126fb5b335ec929a226314d40cd8dad497c3d67",
|
||||
"reference": "5126fb5b335ec929a226314d40cd8dad497c3d67",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.1",
|
||||
"psr/log": "^1.0||^2.0||^3.0",
|
||||
"symfony/process": "~3.4||~4.3||~5.0||~6.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"friendsofphp/php-cs-fixer": "^2.16||^3.0",
|
||||
"pedrotroller/php-cs-custom-fixer": "^2.19",
|
||||
"phpstan/phpstan": "^0.12.7",
|
||||
"phpstan/phpstan-phpunit": "^0.12.6",
|
||||
"phpunit/phpunit": "~7.4||~8.5"
|
||||
},
|
||||
"suggest": {
|
||||
"h4cc/wkhtmltoimage-amd64": "Provides wkhtmltoimage-amd64 binary for Linux-compatible machines, use version `~0.12` as dependency",
|
||||
"h4cc/wkhtmltoimage-i386": "Provides wkhtmltoimage-i386 binary for Linux-compatible machines, use version `~0.12` as dependency",
|
||||
"h4cc/wkhtmltopdf-amd64": "Provides wkhtmltopdf-amd64 binary for Linux-compatible machines, use version `~0.12` as dependency",
|
||||
"h4cc/wkhtmltopdf-i386": "Provides wkhtmltopdf-i386 binary for Linux-compatible machines, use version `~0.12` as dependency",
|
||||
"wemersonjanuario/wkhtmltopdf-windows": "Provides wkhtmltopdf executable for Windows, use version `~0.12` as dependency"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Knp\\Snappy\\": "src/Knp/Snappy"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "KNP Labs Team",
|
||||
"homepage": "http://knplabs.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "http://github.com/KnpLabs/snappy/contributors"
|
||||
}
|
||||
],
|
||||
"description": "PHP library allowing thumbnail, snapshot or PDF generation from a url or a html page. Wrapper for wkhtmltopdf/wkhtmltoimage.",
|
||||
"homepage": "http://github.com/KnpLabs/snappy",
|
||||
"keywords": [
|
||||
"knp",
|
||||
"knplabs",
|
||||
"pdf",
|
||||
"snapshot",
|
||||
"thumbnail",
|
||||
"wkhtmltopdf"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/KnpLabs/snappy/issues",
|
||||
"source": "https://github.com/KnpLabs/snappy/tree/v1.4.1"
|
||||
},
|
||||
"time": "2022-01-07T13:03:38+00:00"
|
||||
},
|
||||
{
|
||||
"name": "laravel/framework",
|
||||
"version": "v9.47.0",
|
||||
|
||||
@@ -187,6 +187,7 @@ return [
|
||||
*/
|
||||
Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class,
|
||||
Maatwebsite\Excel\ExcelServiceProvider::class,
|
||||
Barryvdh\Snappy\ServiceProvider::class,
|
||||
|
||||
/*
|
||||
* Application Service Providers...
|
||||
@@ -218,6 +219,8 @@ return [
|
||||
'Duitku' => App\Services\Duitku::class,
|
||||
'Excel' => Maatwebsite\Excel\Facades\Excel::class,
|
||||
'LmsApi' => App\Services\LmsApi::class,
|
||||
'PDF' => Barryvdh\Snappy\Facades\SnappyPdf::class,
|
||||
'SnappyImage' => Barryvdh\Snappy\Facades\SnappyImage::class,
|
||||
])->toArray(),
|
||||
|
||||
];
|
||||
|
||||
52
config/snappy.php
Normal file
52
config/snappy.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Snappy PDF / Image Configuration
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option contains settings for PDF generation.
|
||||
|
|
||||
| Enabled:
|
||||
|
|
||||
| Whether to load PDF / Image generation.
|
||||
|
|
||||
| Binary:
|
||||
|
|
||||
| The file path of the wkhtmltopdf / wkhtmltoimage executable.
|
||||
|
|
||||
| Timout:
|
||||
|
|
||||
| The amount of time to wait (in seconds) before PDF / Image generation is stopped.
|
||||
| Setting this to false disables the timeout (unlimited processing time).
|
||||
|
|
||||
| Options:
|
||||
|
|
||||
| The wkhtmltopdf command options. These are passed directly to wkhtmltopdf.
|
||||
| See https://wkhtmltopdf.org/usage/wkhtmltopdf.txt for all options.
|
||||
|
|
||||
| Env:
|
||||
|
|
||||
| The environment variables to set while running the wkhtmltopdf process.
|
||||
|
|
||||
*/
|
||||
|
||||
'pdf' => [
|
||||
'enabled' => true,
|
||||
'binary' => env('WKHTML_PDF_BINARY', '/usr/local/bin/wkhtmltopdf'),
|
||||
'timeout' => false,
|
||||
'options' => [],
|
||||
'env' => [],
|
||||
],
|
||||
|
||||
'image' => [
|
||||
'enabled' => true,
|
||||
'binary' => env('WKHTML_IMG_BINARY', '/usr/local/bin/wkhtmltoimage'),
|
||||
'timeout' => false,
|
||||
'options' => [],
|
||||
'env' => [],
|
||||
],
|
||||
|
||||
];
|
||||
@@ -32,7 +32,7 @@ const MENU_OPTIONS = [
|
||||
export default function AccountPopover() {
|
||||
const [open, setOpen] = useState<HTMLElement | null>(null);
|
||||
const navigate = useNavigate();
|
||||
const { logout } = useAuth();
|
||||
const { logout, user } = useAuth();
|
||||
|
||||
const handleOpen = (event: React.MouseEvent<HTMLElement>) => {
|
||||
setOpen(event.currentTarget);
|
||||
@@ -67,10 +67,10 @@ export default function AccountPopover() {
|
||||
}),
|
||||
}}
|
||||
>
|
||||
<Avatar
|
||||
src="https://minimal-assets-api.vercel.app/assets/images/avatars/avatar_5.jpg"
|
||||
alt="Rayan Moran"
|
||||
/>
|
||||
{user && user.user.avatar_url && (<Avatar
|
||||
src={user ? user.user.avatar_url : ''}
|
||||
alt={user ? user.user.full_name : ''}
|
||||
/>)}
|
||||
</IconButtonAnimate>
|
||||
|
||||
<MenuPopover
|
||||
@@ -89,16 +89,16 @@ export default function AccountPopover() {
|
||||
>
|
||||
<Box sx={{ my: 1.5, px: 2.5 }}>
|
||||
<Typography variant="subtitle2" noWrap>
|
||||
Rayan Moran
|
||||
{ user ? user.user.full_name ?? 'Hi, ' : 'Hi, '}
|
||||
</Typography>
|
||||
<Typography variant="body2" sx={{ color: 'text.secondary' }} noWrap>
|
||||
rayan.moran@gmail.com
|
||||
{ user ? user.user.email : 'Please Wait'}
|
||||
</Typography>
|
||||
</Box>
|
||||
|
||||
<Divider sx={{ borderStyle: 'dashed' }} />
|
||||
|
||||
<Stack sx={{ p: 1 }}>
|
||||
{/* <Stack sx={{ p: 1 }}>
|
||||
{MENU_OPTIONS.map((option) => (
|
||||
<MenuItem key={option.label} onClick={handleClose}>
|
||||
{option.label}
|
||||
@@ -106,7 +106,7 @@ export default function AccountPopover() {
|
||||
))}
|
||||
</Stack>
|
||||
|
||||
<Divider sx={{ borderStyle: 'dashed' }} />
|
||||
<Divider sx={{ borderStyle: 'dashed' }} /> */}
|
||||
|
||||
<MenuItem sx={{ m: 1 }} onClick={handleLogout}>
|
||||
Logout
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// @mui
|
||||
import { styled } from '@mui/material/styles';
|
||||
import { Box, Link, Typography, Avatar } from '@mui/material';
|
||||
import useAuth from '../../../hooks/useAuth';
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
@@ -22,6 +23,10 @@ type Props = {
|
||||
};
|
||||
|
||||
export default function NavbarAccount({ isCollapse }: Props) {
|
||||
|
||||
const { user } = useAuth();
|
||||
|
||||
console.log('current user is ', user)
|
||||
return (
|
||||
<Link underline="none" color="inherit">
|
||||
<RootStyle
|
||||
@@ -31,10 +36,10 @@ export default function NavbarAccount({ isCollapse }: Props) {
|
||||
}),
|
||||
}}
|
||||
>
|
||||
<Avatar
|
||||
src="https://minimal-assets-api.vercel.app/assets/images/avatars/avatar_5.jpg"
|
||||
alt="Rayan Moran"
|
||||
/>
|
||||
{user && user.user.avatar_url && (<Avatar
|
||||
src={user ? user.user.avatar_url : ''}
|
||||
alt={user ? user.user.full_name : ''}
|
||||
/>)}
|
||||
|
||||
<Box
|
||||
sx={{
|
||||
@@ -50,10 +55,10 @@ export default function NavbarAccount({ isCollapse }: Props) {
|
||||
}}
|
||||
>
|
||||
<Typography variant="subtitle2" noWrap>
|
||||
Rayan Moran
|
||||
{ user ? user.user.full_name ?? 'Hi, ' : 'Hi, '}
|
||||
</Typography>
|
||||
<Typography variant="body2" noWrap sx={{ color: 'text.secondary' }}>
|
||||
user
|
||||
<Typography variant="body2" noWrap sx={{ color: 'text.secondary', fontSize: '11px' }}>
|
||||
{ user ? user.user.email : 'Please Wait'}
|
||||
</Typography>
|
||||
</Box>
|
||||
</RootStyle>
|
||||
|
||||
@@ -134,7 +134,7 @@ export default function DialogClaimSubmitMember({
|
||||
params: { ...appliedParams, claimMember: true },
|
||||
});
|
||||
|
||||
setData(response.data);
|
||||
setData(response.data.data);
|
||||
}
|
||||
})();
|
||||
}, [corporateValue, openDialog, appliedParams]);
|
||||
|
||||
@@ -409,11 +409,11 @@ export default function TableList(props: any) {
|
||||
</Button>
|
||||
)}
|
||||
</TableCell>
|
||||
<TableCell align="right">
|
||||
{/* <TableCell align="right">
|
||||
<IconButton>
|
||||
<Iconify icon="ic:baseline-more-vert" />
|
||||
</IconButton>
|
||||
</TableCell>
|
||||
</TableCell> */}
|
||||
</TableRow>
|
||||
))
|
||||
) : (
|
||||
|
||||
7
frontend/dashboard/.env.development
Executable file
7
frontend/dashboard/.env.development
Executable file
@@ -0,0 +1,7 @@
|
||||
GENERATE_SOURCEMAP=false
|
||||
|
||||
PORT=8083
|
||||
|
||||
REACT_APP_HOST_API_URL="http://localhost:8000"
|
||||
|
||||
VITE_API_URL="http://localhost:8000/api/internal"
|
||||
@@ -69,6 +69,13 @@ const navConfig = [
|
||||
title: 'CUSTOMER SERVICES',
|
||||
children: [{ title: 'Request', path: '/cs-request' }],
|
||||
},
|
||||
{
|
||||
title: 'REPORT',
|
||||
children: [
|
||||
{ title: 'Appointment', path: '/report/appointments' },
|
||||
{ title: 'Live Chat', path: '/report/live-chat' },
|
||||
],
|
||||
},
|
||||
{
|
||||
title: 'USER MANAGEMENT',
|
||||
path: '/users',
|
||||
|
||||
@@ -33,6 +33,7 @@ import KeyboardArrowRightIcon from '@mui/icons-material/KeyboardArrowRight';
|
||||
import AddIcon from '@mui/icons-material/Add';
|
||||
import UploadIcon from '@mui/icons-material/Upload';
|
||||
import CancelIcon from '@mui/icons-material/Cancel';
|
||||
import InsertDriveFileIcon from '@mui/icons-material/InsertDriveFile';
|
||||
// hooks
|
||||
import React, { ChangeEvent, Component, useEffect, useRef, useState } from 'react';
|
||||
import useSettings from '../../../hooks/useSettings';
|
||||
@@ -45,6 +46,7 @@ import { Member } from '../../../@types/member';
|
||||
import BasePagination from '../../../components/BasePagination';
|
||||
import { enqueueSnackbar } from 'notistack';
|
||||
import { LoadingButton } from '@mui/lab';
|
||||
import DialogLog from './sections/DialogLog';
|
||||
|
||||
export default function CorporatePlanList() {
|
||||
const { themeStretch } = useSettings();
|
||||
@@ -197,19 +199,17 @@ export default function CorporatePlanList() {
|
||||
enqueueSnackbar('No File Selected', { variant: 'warning' });
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
const handleGetTemplate = (type :string) => {
|
||||
axios.get('corporates/import-document-example/' + type)
|
||||
.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 handleGetTemplate = (type: string) => {
|
||||
axios.get('corporates/import-document-example/' + type).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();
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<div>
|
||||
@@ -247,7 +247,13 @@ export default function CorporatePlanList() {
|
||||
}}
|
||||
>
|
||||
<MenuItem onClick={handleImportButton}>Import</MenuItem>
|
||||
<MenuItem onClick={() => {handleGetTemplate('member')}}>Download Template</MenuItem>
|
||||
<MenuItem
|
||||
onClick={() => {
|
||||
handleGetTemplate('member');
|
||||
}}
|
||||
>
|
||||
Download Template
|
||||
</MenuItem>
|
||||
</Menu>
|
||||
</Stack>
|
||||
)}
|
||||
@@ -327,6 +333,16 @@ export default function CorporatePlanList() {
|
||||
function Row(props: { row: ReturnType<typeof createData> }) {
|
||||
const { row } = props;
|
||||
const [open, setOpen] = React.useState(false);
|
||||
const [loadingLog, setLoadingLog] = React.useState(false);
|
||||
const [dialogLogOpen, setDialogLogOpen] = React.useState(false);
|
||||
|
||||
// useEffect(function () {
|
||||
// if (row.full_name == 'Pajri') {
|
||||
// setDialogLogOpen(true);
|
||||
// console.log('fuck');
|
||||
// }
|
||||
// }, []);
|
||||
|
||||
const handleActivate = (model: any, status: string) => {
|
||||
axios
|
||||
.put(`/members/${row.id}/activation`, {
|
||||
@@ -353,6 +369,7 @@ export default function CorporatePlanList() {
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
<TableRow sx={{ '& > *': { borderBottom: 'unset' } }}>
|
||||
@@ -516,19 +533,30 @@ export default function CorporatePlanList() {
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
{/* <Typography sx={{ fontWeight: '600', mb: 1, mt: 2 }}>Sub Corporate</Typography>
|
||||
<Grid container>
|
||||
<Grid item xs={12}>
|
||||
<Grid container>
|
||||
<Grid item xs={6}>
|
||||
Sub Corporates (asdasdasdasd)
|
||||
</Grid>
|
||||
<Grid item xs={6}>
|
||||
: qweqweqweqwe
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid> */}
|
||||
<Grid>
|
||||
<LoadingButton
|
||||
id="upload-button"
|
||||
variant="outlined"
|
||||
startIcon={<InsertDriveFileIcon />}
|
||||
// sx={{ p: 1.8 }}
|
||||
// onClick={() => {handleDownloadLog(row)}}
|
||||
onClick={() => {
|
||||
setDialogLogOpen(true);
|
||||
}}
|
||||
loading={loadingLog}
|
||||
>
|
||||
Download LOG
|
||||
</LoadingButton>
|
||||
</Grid>
|
||||
|
||||
<DialogLog
|
||||
title={{
|
||||
name: `Generate LOG - ${row.full_name}`,
|
||||
}}
|
||||
openDialog={dialogLogOpen}
|
||||
setOpenDialog={setDialogLogOpen}
|
||||
data={{ member: row }}
|
||||
></DialogLog>
|
||||
</Box>
|
||||
</Collapse>
|
||||
</TableCell>
|
||||
|
||||
@@ -0,0 +1,203 @@
|
||||
// react
|
||||
import { ReactElement, useEffect, useState } from 'react';
|
||||
// mui
|
||||
import {
|
||||
Card,
|
||||
Checkbox,
|
||||
Divider,
|
||||
Grid,
|
||||
Input,
|
||||
Link,
|
||||
Stack,
|
||||
Table,
|
||||
TableCell,
|
||||
TableContainer,
|
||||
TableRow,
|
||||
Typography,
|
||||
} from '@mui/material';
|
||||
import { styled } from '@mui/material/styles';
|
||||
// Component
|
||||
import MuiDialog from '@/components/MuiDialog';
|
||||
import { Box } from '@mui/material';
|
||||
import { TextField } from '@mui/material';
|
||||
import { DesktopDatePicker, LocalizationProvider } from '@mui/x-date-pickers';
|
||||
import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns';
|
||||
import { fPostFormat } from '@/utils/formatTime';
|
||||
import { LoadingButton } from '@mui/lab';
|
||||
import InsertDriveFileIcon from '@mui/icons-material/InsertDriveFile';
|
||||
import axios from '@/utils/axios';
|
||||
import { enqueueSnackbar } from 'notistack';
|
||||
|
||||
type DataContent = {
|
||||
info: string;
|
||||
date: string;
|
||||
time: string;
|
||||
};
|
||||
|
||||
type MuiDialogProps = {
|
||||
title?: {
|
||||
name?: string;
|
||||
icon?: string;
|
||||
};
|
||||
openDialog: boolean;
|
||||
setOpenDialog: Function;
|
||||
content?: ReactElement;
|
||||
data?: DataContent[];
|
||||
};
|
||||
|
||||
const ItemNotificationStyle = styled(Card)(({ theme }) => ({
|
||||
boxShadow: 'none',
|
||||
padding: theme.spacing(1),
|
||||
borderRadius: 0.5,
|
||||
color: 'black',
|
||||
}));
|
||||
|
||||
const DialogLog = ({ title, openDialog, setOpenDialog, data }: MuiDialogProps) => {
|
||||
const [openDialogClaim, setOpenDialogClaim] = useState(false);
|
||||
const [dialogTitleClaim, setDialogTitleClaim] = useState('');
|
||||
const [dateOfAdmission, setDateOfAdmission] = useState(new Date());
|
||||
const [checkedBenefitIds, setCheckedBenefitIds] = useState([]);
|
||||
const [benefitIds, setBenefitIds] = useState([]);
|
||||
const [loadingLog, setLoadingLog] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
setBenefitIds(data.member.current_plan?.benefits.map((benefit) => benefit.id))
|
||||
setCheckedBenefitIds(benefitIds)
|
||||
console.log('Check All', benefitIds, 'X', data.member.current_plan?.benefits.map((benefit) => benefit.id))
|
||||
}, [])
|
||||
|
||||
const clickHandler = () => {
|
||||
setDialogTitleClaim('Claim Details');
|
||||
setOpenDialogClaim(true);
|
||||
};
|
||||
|
||||
const handleCheckAll = (event) => {
|
||||
if (event.target.checked) {
|
||||
setCheckedBenefitIds(benefitIds)
|
||||
} else {
|
||||
setCheckedBenefitIds([])
|
||||
}
|
||||
}
|
||||
|
||||
const handleCheckChange = (event, benefit) => {
|
||||
if ( event.target.checked ) {
|
||||
setCheckedBenefitIds([...checkedBenefitIds, benefit.id])
|
||||
} else {
|
||||
// setCheckedBenefitIds([])
|
||||
setCheckedBenefitIds(checkedBenefitIds.filter((benefitId) => benefitId !== benefit.id))
|
||||
}
|
||||
}
|
||||
|
||||
const handleDownloadLog = (row) => {
|
||||
setLoadingLog(true);
|
||||
axios
|
||||
.post(`generate-log/${row.id}`, {
|
||||
date_of_admission : dateOfAdmission,
|
||||
benefit_ids : checkedBenefitIds
|
||||
}, {
|
||||
responseType: 'blob',
|
||||
})
|
||||
.then((response) => {
|
||||
window.open(URL.createObjectURL(response.data));
|
||||
setLoadingLog(false);
|
||||
setOpenDialog(false);
|
||||
})
|
||||
.catch((response) => {
|
||||
enqueueSnackbar(response.message, { variant: 'error' });
|
||||
setLoadingLog(false);
|
||||
});
|
||||
}
|
||||
|
||||
const getContent = () => (
|
||||
<Stack sx={{ marginTop: 2 }}>
|
||||
<ItemNotificationStyle>
|
||||
<Stack>
|
||||
<Grid container spacing={2}>
|
||||
<Grid item xs={12}>
|
||||
<LocalizationProvider dateAdapter={AdapterDateFns}>
|
||||
<DesktopDatePicker
|
||||
inputFormat="dd/MM/Y"
|
||||
value={dateOfAdmission}
|
||||
onChange={(value) => {
|
||||
setDateOfAdmission(new Date(fPostFormat(value)));
|
||||
// console.log('value')
|
||||
}}
|
||||
renderInput={(params) => (
|
||||
<TextField
|
||||
{...params}
|
||||
fullWidth
|
||||
label="Date of Admission"
|
||||
placeholder="dd/mm/yyyy"
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
</LocalizationProvider>
|
||||
</Grid>
|
||||
<Grid item xs={12} sx={{marginTop: 2}}>
|
||||
<Stack direction="row" alignItems="center" justifyContent={'space-between'}>
|
||||
<Typography variant="body1" fontWeight={800}>List Of Benefit</Typography>
|
||||
|
||||
<Stack direction="row" alignItems="center">
|
||||
<Typography>All</Typography>
|
||||
<Checkbox onChange={handleCheckAll} checked={benefitIds.length == checkedBenefitIds.length}/>
|
||||
</Stack>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<Stack divider={<Divider flexItem />}>
|
||||
{ data.member.current_plan?.benefits && (
|
||||
data.member.current_plan?.benefits.map((benefit, index) => (
|
||||
<Stack direction="row" alignItems="center" key={index}>
|
||||
<Box sx={{ width: '100%' }}>
|
||||
<Typography>{benefit.code} {benefit.description ? ` - ${benefit.description} ` : ''}</Typography>
|
||||
</Box>
|
||||
<Checkbox checked={checkedBenefitIds.includes(benefit.id)} onClick={(event) => {handleCheckChange(event, benefit)} } />
|
||||
</Stack>
|
||||
))
|
||||
)}
|
||||
</Stack>
|
||||
{/* <TableContainer>
|
||||
<Table>
|
||||
<TableRow>
|
||||
<TableCell>
|
||||
ASD
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
ASD
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
</Table>
|
||||
</TableContainer> */}
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
|
||||
<LoadingButton
|
||||
id="upload-button"
|
||||
variant="outlined"
|
||||
fullWidth
|
||||
startIcon={<InsertDriveFileIcon />}
|
||||
onClick={() => {handleDownloadLog(data.member)}}
|
||||
loading={loadingLog}
|
||||
>
|
||||
Download LOG
|
||||
</LoadingButton>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Stack>
|
||||
</ItemNotificationStyle>
|
||||
</Stack>
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<MuiDialog
|
||||
title={title}
|
||||
openDialog={openDialog}
|
||||
setOpenDialog={setOpenDialog}
|
||||
content={getContent()}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default DialogLog;
|
||||
@@ -9,7 +9,6 @@ import Form from './Form';
|
||||
import HeaderBreadcrumbs from '../../../components/HeaderBreadcrumbs';
|
||||
import axios from '../../../utils/axios';
|
||||
import { Practitioner } from '../../../@types/doctor';
|
||||
import ButtonBack from '../../../components/ButtonBack';
|
||||
|
||||
export default function Create() {
|
||||
const { themeStretch } = useSettings();
|
||||
@@ -31,7 +30,6 @@ export default function Create() {
|
||||
<Page title="Membership: Create a new Dokter">
|
||||
<Container maxWidth={themeStretch ? false : 'xl'}>
|
||||
<Stack direction="row" alignItems="center">
|
||||
<ButtonBack />
|
||||
<HeaderBreadcrumbs
|
||||
heading={!isEdit ? 'Manage a new Dokter' : 'Manage Dokter'}
|
||||
links={[
|
||||
@@ -54,40 +52,3 @@ export default function Create() {
|
||||
</Page>
|
||||
);
|
||||
}
|
||||
// const pageTitle = 'Create Data Dokter';
|
||||
// return (
|
||||
// <Page title={pageTitle}>
|
||||
// <Container maxWidth={themeStretch ? false : 'xl'}>
|
||||
// <HeaderBreadcrumbs
|
||||
// heading={pageTitle}
|
||||
// links={[
|
||||
// {
|
||||
// name: 'Master',
|
||||
// href: '/master',
|
||||
// },
|
||||
// {
|
||||
// name: 'Dokter',
|
||||
// href: '/master/organizations/',
|
||||
// },
|
||||
// {
|
||||
// name: 'Create',
|
||||
// href: '/master/organizations/create/',
|
||||
// },
|
||||
// ]}
|
||||
// />
|
||||
|
||||
// <Grid container spacing={2}>
|
||||
// <Grid item xs={12}>
|
||||
// <Card sx={{ p: 2 }}>
|
||||
// <Form
|
||||
// isSubmitting={isSubmitting}
|
||||
// isEdit={isEdit}
|
||||
// currentOrganizations={currentOrganizations}
|
||||
// />
|
||||
// </Card>
|
||||
// </Grid>
|
||||
// </Grid>
|
||||
// </Container>
|
||||
// </Page>
|
||||
// );
|
||||
// }
|
||||
|
||||
@@ -8,7 +8,7 @@ import Select, { SelectChangeEvent } from '@mui/material/Select';
|
||||
import * as React from 'react';
|
||||
|
||||
// form
|
||||
import { useForm } from 'react-hook-form';
|
||||
import { useForm, Controller } from 'react-hook-form';
|
||||
import { yupResolver } from '@hookform/resolvers/yup';
|
||||
// @mui
|
||||
import { styled } from '@mui/material/styles';
|
||||
@@ -25,6 +25,7 @@ import {
|
||||
Typography,
|
||||
TextField,
|
||||
Chip,
|
||||
Autocomplete,
|
||||
} from '@mui/material';
|
||||
|
||||
import CancelIcon from '@mui/icons-material/Cancel';
|
||||
@@ -41,17 +42,20 @@ import {
|
||||
RHFMultiCheckbox,
|
||||
RHFCheckbox,
|
||||
RHFCustomMultiCheckbox,
|
||||
RHFSelect,
|
||||
} from '../../../components/hook-form';
|
||||
import axios from '../../../utils/axios';
|
||||
import { fCurrency } from '../../../utils/formatNumber';
|
||||
import { Practitioner } from '../../../@types/doctor';
|
||||
import AddIcon from '@mui/icons-material/Add';
|
||||
|
||||
import { Label, Rowing } from '@mui/icons-material';
|
||||
import { email } from '../../../_mock/email';
|
||||
|
||||
const LabelStyle = styled(Typography)(({ theme }) => ({
|
||||
...theme.typography.subtitle2,
|
||||
color: theme.palette.text.secondary,
|
||||
marginBottom: theme.spacing(1),
|
||||
...theme.typography.h6,
|
||||
marginBottom: theme.spacing(2),
|
||||
marginTop: theme.spacing(2),
|
||||
}));
|
||||
|
||||
const HeaderStyle = styled('header')(({ theme }) => ({
|
||||
@@ -66,7 +70,6 @@ const Title = styled(Typography)(({ theme }) => ({
|
||||
boxShadow: 'none',
|
||||
// paddingBottom: theme.spacing(3),
|
||||
fontWeight: 700,
|
||||
color: '#005B7F',
|
||||
}));
|
||||
|
||||
interface FormValuesProps extends Partial<Practitioner> {
|
||||
@@ -106,6 +109,8 @@ export default function PractitionerForm({ isEdit, currentPractitioner }: Props)
|
||||
() => ({
|
||||
id: currentPractitioner?.id,
|
||||
name: currentPractitioner?.name || '',
|
||||
email: currentPractitioner?.email || '',
|
||||
phone: currentPractitioner?.phone || '',
|
||||
address: currentPractitioner?.address || '',
|
||||
birth_date: currentPractitioner?.birth_date || '',
|
||||
gender: currentPractitioner?.gender || '',
|
||||
@@ -121,6 +126,8 @@ export default function PractitionerForm({ isEdit, currentPractitioner }: Props)
|
||||
[currentPractitioner]
|
||||
);
|
||||
|
||||
console.log('currentPractitioner', currentPractitioner);
|
||||
|
||||
console.log('defaultValues', defaultValues);
|
||||
|
||||
function StatusLabel({ value }: { value: boolean }) {
|
||||
@@ -168,91 +175,391 @@ export default function PractitionerForm({ isEdit, currentPractitioner }: Props)
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [isEdit, currentPractitioner]);
|
||||
|
||||
const handleActivate = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||
setValue('active', event.target.checked);
|
||||
const onSubmit = async (data: FormValuesProps) => {
|
||||
try {
|
||||
const formData = new FormData();
|
||||
formData.append('name', data.name);
|
||||
formData.append('gender', data.gender);
|
||||
formData.append('address', data.address);
|
||||
formData.append('birth_place', data.birth_place);
|
||||
formData.append('birth_date', data.birth_date);
|
||||
formData.append('email', data.email);
|
||||
formData.append('phone', data.phone);
|
||||
// formData.append('active', data.active ? '1' : '0');
|
||||
forms.forEach((form, index) => {
|
||||
formData.append(`practices[${index}][organization_id]`, form.organizationId);
|
||||
form.specialities.forEach((speciality, i) => {
|
||||
formData.append(`practices[${index}][specialities][${i}][speciality_id]`, speciality);
|
||||
});
|
||||
});
|
||||
|
||||
console.log('event.target.checked', event.target.checked);
|
||||
if (!isEdit) {
|
||||
console.log('formData', formData);
|
||||
const response = await axios.post('/doctors', formData);
|
||||
} else {
|
||||
formData.append('_method', 'PUT');
|
||||
const response = await axios.post('/doctors/' + currentPractitioner?.id ?? '', formData);
|
||||
}
|
||||
reset();
|
||||
enqueueSnackbar(!isEdit ? 'Doctors Created Successfully!' : 'Doctors Udpated Successfully!', {
|
||||
variant: 'success',
|
||||
});
|
||||
navigate('/master/doctors');
|
||||
} catch (error: any) {
|
||||
if (error && error.response.status === 422) {
|
||||
console.log('error', error.response.data.errors);
|
||||
for (const [key, value] of Object.entries(error.response.data.errors)) {
|
||||
setError(key, { message: value[0] });
|
||||
enqueueSnackbar(value[0] ?? 'Failed Processing Request', { variant: 'error' });
|
||||
}
|
||||
} else {
|
||||
enqueueSnackbar(error.message ?? 'Failed Processing Request', { variant: 'error' });
|
||||
}
|
||||
}
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append('active', event.target.checked ? '1' : '0');
|
||||
formData.append('_method', 'PUT');
|
||||
axios.post('/doctors/' + currentPractitioner?.id ?? '', formData);
|
||||
const ascent = document?.querySelector('ascent');
|
||||
if (ascent != null) {
|
||||
ascent.innerHTML = '';
|
||||
}
|
||||
};
|
||||
|
||||
enqueueSnackbar('active Updated Successfully!', { variant: 'success' });
|
||||
const [organizations, setOrganizations] = useState<any>([]);
|
||||
const [specialities, setSpecialities] = useState<any>([]);
|
||||
|
||||
useEffect(() => {
|
||||
axios.get(`/search-organizations`).then((response) => {
|
||||
setOrganizations(
|
||||
response.data.map((item: any) => ({ ...item, name: item.name, value: item.id }))
|
||||
);
|
||||
});
|
||||
|
||||
axios.get(`/search-specialities`).then((response) => {
|
||||
setSpecialities(
|
||||
response.data.map((item: any) => ({ ...item, name: item.name, value: item.id }))
|
||||
);
|
||||
});
|
||||
}, []);
|
||||
|
||||
// const specialities = [
|
||||
// { name: 'Dentistry', id: 1 },
|
||||
// { name: 'Dermatology', id: 2 },
|
||||
// { name: 'General Medicine', id: 3 },
|
||||
// { name: 'Pediatrics', id: 4 },
|
||||
// { name: 'Surgery', id: 5 },
|
||||
// ];
|
||||
|
||||
const practices = currentPractitioner?.practices || [];
|
||||
// const practices = [
|
||||
// {
|
||||
// organization_id: 187,
|
||||
// specialities: [
|
||||
// {
|
||||
// speciality_id: 7,
|
||||
// },
|
||||
// {
|
||||
// speciality_id: 6,
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// {
|
||||
// organization_id: 181,
|
||||
// specialities: [
|
||||
// {
|
||||
// speciality_id: 2,
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// ];
|
||||
|
||||
const [forms, setForms] = useState<any>([]);
|
||||
|
||||
useEffect(() => {
|
||||
if (practices.length > 0) {
|
||||
const newForms = practices.map((practice: any) => {
|
||||
return {
|
||||
organizationId: practice.organization_id,
|
||||
specialities: practice.specialities.map((s) => s.speciality_id),
|
||||
};
|
||||
});
|
||||
setForms(newForms);
|
||||
} else {
|
||||
setForms([
|
||||
{
|
||||
organizationId: '',
|
||||
specialities: [],
|
||||
},
|
||||
]);
|
||||
}
|
||||
}, [practices && practices.length]);
|
||||
// }, []);
|
||||
|
||||
console.log('forms', forms);
|
||||
|
||||
const findValueOrganization = (organizationId) => {
|
||||
if (organizationId === '' || organizationId === null) {
|
||||
return { name: '', value: '' };
|
||||
} else {
|
||||
const organization = organizations.find((o) => o.id === organizationId);
|
||||
return { name: organization?.name, value: organizationId };
|
||||
}
|
||||
};
|
||||
|
||||
// console.log('findValueOrganization', findValueOrganization(187));
|
||||
|
||||
// const findValueSpeciality = (specialityIds: number[]) => {
|
||||
// if (specialityIds.length === 0) {
|
||||
// return [];
|
||||
// } else {
|
||||
// const data = specialities.filter((s) => specialityIds.includes(s.id));
|
||||
// return data.map((d) => ({ name: d.name, value: d.id }));
|
||||
// }
|
||||
// };
|
||||
|
||||
const findValueSpeciality = (values: any) => {
|
||||
return specialities.filter((s) => values.includes(s.value));
|
||||
};
|
||||
|
||||
// const [forms, setForms] = useState([
|
||||
// {
|
||||
// organizationId: '',
|
||||
// specialities: [],
|
||||
// },
|
||||
// ]);
|
||||
|
||||
const addForm = () => {
|
||||
setForms([
|
||||
...forms,
|
||||
{
|
||||
organizationId: '',
|
||||
specialities: [],
|
||||
},
|
||||
]);
|
||||
};
|
||||
console.log('forms', forms);
|
||||
|
||||
const gender = [
|
||||
{
|
||||
value: 'male',
|
||||
label: 'Laki-Laki',
|
||||
},
|
||||
{
|
||||
value: 'female',
|
||||
label: 'Perempuan',
|
||||
},
|
||||
];
|
||||
|
||||
console.log('forms', forms);
|
||||
// const handleSpecialitiesChange = (index: number, value: any) => {
|
||||
// const newForms = [...forms];
|
||||
// newForms[index].specialities = value.map((v: any) => ({ speciality_id: v.id }));
|
||||
// setForms(newForms);
|
||||
// };
|
||||
// const handleSpecialitiesChange = (index: number, value: any) => {
|
||||
// const updatedForms = [...forms];
|
||||
// updatedForms[index].specialities = value.map((v: any) => v.speciality_id);
|
||||
// setForms(updatedForms);
|
||||
// };
|
||||
|
||||
const handleOrganizationIdChange = (index, value) => {
|
||||
const updatedForms = [...forms];
|
||||
updatedForms[index].organizationId = value.id;
|
||||
setForms(updatedForms);
|
||||
};
|
||||
|
||||
const handleSpecialitiesChange = (index: number, value: any) => {
|
||||
setForms((forms) => {
|
||||
forms[index].specialities = value.map((v: any) => v.value);
|
||||
return [...forms];
|
||||
});
|
||||
};
|
||||
|
||||
// const availableOrganizations = organizations.filter(
|
||||
// (org) =>
|
||||
// !forms.some((f) => f.organization && f.organization.id === org.id) ||
|
||||
// forms.findIndex((f) => f.organization && f.organization.id === org.id) === editIndex
|
||||
// );
|
||||
const availableOrganizations =
|
||||
practices.length > 0
|
||||
? organizations.filter(
|
||||
(org) => !practices.some((practice) => practice.organization_id === org.id)
|
||||
)
|
||||
: organizations.filter((org) => !forms.some((f) => f.organizationId === org.id));
|
||||
|
||||
// const availableOrganizations = organizations.filter(
|
||||
// (org) => !practices.some((p) => p.organization_id === org.id)
|
||||
// );
|
||||
|
||||
const handleDeleteForm = (index) => {
|
||||
const updatedForms = [...forms];
|
||||
updatedForms.splice(index, 1);
|
||||
setForms(updatedForms);
|
||||
};
|
||||
|
||||
return (
|
||||
<FormProvider methods={methods}>
|
||||
<FormProvider methods={methods} onSubmit={handleSubmit(onSubmit)}>
|
||||
<Stack spacing={3}>
|
||||
<Box sx={{ width: '100%' }}>
|
||||
{/* <Stack spacing={3}> */}
|
||||
<Card sx={{ p: 5 }}>
|
||||
<HeaderStyle>
|
||||
{/* <HeaderStyle>
|
||||
<Grid item xs={6} md={6}>
|
||||
<Title>Data Dokter</Title>
|
||||
</Grid>
|
||||
<Grid item xs={6} md={6}>
|
||||
{/* <Typography>Status Rumah Sakit</Typography> */}
|
||||
<RHFSwitch name="active" label="" onClick={handleActivate} />
|
||||
<RHFSwitch name="active" label="" />
|
||||
<StatusLabel value={values.active} />
|
||||
</Grid>
|
||||
</HeaderStyle>
|
||||
</HeaderStyle> */}
|
||||
<Title variant="h5">Informasi Umum</Title>
|
||||
<Avatar
|
||||
alt="Remy Sharp"
|
||||
src={currentPractitioner?.avatar_url}
|
||||
sx={{ width: 120, height: 120, marginBottom: 2 }}
|
||||
/>
|
||||
|
||||
<Grid container rowSpacing={1} columnSpacing={{ xs: 1, sm: 2, md: 3 }}>
|
||||
<Grid item xs={7}>
|
||||
<Span style={{ fontWeight: 'bold' }}>Nama Dokter</Span>
|
||||
<Text>{currentPractitioner?.name ? currentPractitioner?.name : '-'}</Text>
|
||||
<Span style={{ fontWeight: 'bold' }}>No Telp</Span>
|
||||
<Text>{currentPractitioner?.phone ? currentPractitioner?.phone : '-'}</Text>
|
||||
<Span style={{ fontWeight: 'bold' }}>Tempat Lahir</Span>
|
||||
<Text>
|
||||
{currentPractitioner?.birth_place ? currentPractitioner?.birth_place : '-'}
|
||||
</Text>
|
||||
<Span style={{ fontWeight: 'bold' }}>Alamat</Span>
|
||||
<Text>{currentPractitioner?.address ? currentPractitioner?.address : '-'}</Text>
|
||||
<Grid container rowSpacing={1} columnSpacing={{ xs: 1, sm: 2, md: 3 }} sx={{ mt: 2 }}>
|
||||
<Grid item xs={12}>
|
||||
<LabelStyle>Nama Dokter</LabelStyle>
|
||||
<RHFTextField name="name" placeholder="Tuliskan Nama Dokter" />
|
||||
</Grid>
|
||||
<Grid item xs={5} columnSpacing={{ xs: 1, sm: 2, md: 3 }}>
|
||||
<Span style={{ fontWeight: 'bold' }}>Jenis Kelamin</Span>
|
||||
<Text>{currentPractitioner?.gender ? currentPractitioner?.gender : '-'}</Text>
|
||||
<Span style={{ fontWeight: 'bold' }}>Email</Span>
|
||||
<Text>{currentPractitioner?.email ? currentPractitioner?.email : '-'}</Text>
|
||||
<Span style={{ fontWeight: 'bold' }}>Tanggal Lahir</Span>
|
||||
<Text>
|
||||
{currentPractitioner?.birth_date ? currentPractitioner?.birth_date : '-'}
|
||||
</Text>
|
||||
|
||||
<Grid item xs={6}>
|
||||
<LabelStyle>Jenis Kelamin</LabelStyle>
|
||||
<RHFSelect name="gender" label="Pilih Jenis Kelamin">
|
||||
<option value="" />
|
||||
{gender.map((option, index) => (
|
||||
<option key={index} value={option.value}>
|
||||
{option.label}
|
||||
</option>
|
||||
))}
|
||||
</RHFSelect>
|
||||
</Grid>
|
||||
<Grid item xs={6}>
|
||||
<LabelStyle>Alamat</LabelStyle>
|
||||
<RHFTextField name="address" placeholder="Tuliskan Alamat" />
|
||||
</Grid>
|
||||
|
||||
<Grid item xs={6}>
|
||||
<LabelStyle>Tempat Lahir</LabelStyle>
|
||||
<RHFTextField name="birth_place" placeholder="Tuliskan Tempat Lahir" />
|
||||
</Grid>
|
||||
<Grid item xs={6}>
|
||||
<LabelStyle>Tanggal Lahir</LabelStyle>
|
||||
<RHFDatepicker name="birth_date" placeholder="Silahkan Pilih Tanggal Lahir" />
|
||||
</Grid>
|
||||
<Grid item xs={6}>
|
||||
<LabelStyle>Email</LabelStyle>
|
||||
<RHFTextField name="email" placeholder="Tuliskan Email" type="email" />
|
||||
</Grid>
|
||||
<Grid item xs={6}>
|
||||
<LabelStyle>No. Telp</LabelStyle>
|
||||
<RHFTextField name="phone" placeholder="Tuliskan Nomor Telepon" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Card>
|
||||
<Card sx={{ p: 5, marginTop: 2 }}>
|
||||
<Title variant="h5">Tempat Praktik</Title>
|
||||
{currentPractitioner?.organizations?.map((item, index) => (
|
||||
<Box key={index} sx={{ mt: 3 }}>
|
||||
<Grid container rowSpacing={1} columnSpacing={{ xs: 1, sm: 2, md: 3 }}>
|
||||
<Grid item xs={7}>
|
||||
<Text>{item.name}</Text>
|
||||
<Stack spacing={3} direction="row" justifyContent="space-between">
|
||||
<Title variant="h5">Tempat Praktik</Title>
|
||||
<Button
|
||||
variant="contained"
|
||||
color="primary"
|
||||
size="small"
|
||||
sx={{ boxShadow: 'none' }}
|
||||
onClick={addForm}
|
||||
startIcon={<AddIcon />}
|
||||
>
|
||||
Tambah Tempat Praktik
|
||||
</Button>
|
||||
</Stack>
|
||||
|
||||
{forms.map((form, index) => (
|
||||
<div key={index}>
|
||||
<Box sx={{ mt: 3 }}>
|
||||
<Stack spacing={3} direction="row" justifyContent="space-between">
|
||||
<LabelStyle></LabelStyle>
|
||||
{index !== 0 && (
|
||||
<Button
|
||||
sx={{ color: 'red', m: 1 }}
|
||||
aria-label="close"
|
||||
onClick={() => handleDeleteForm(index)}
|
||||
>
|
||||
Delete
|
||||
</Button>
|
||||
// <Button onClick={() => handleDeleteForm(index)}>Delete</Button>
|
||||
)}
|
||||
</Stack>
|
||||
{/* <h1>{form.organizationId}</h1> */}
|
||||
<Grid container rowSpacing={1} columnSpacing={{ xs: 1, sm: 2, md: 3 }}>
|
||||
<Grid item xs={6}>
|
||||
<Autocomplete
|
||||
options={availableOrganizations}
|
||||
value={findValueOrganization(form.organizationId) ?? ''}
|
||||
getOptionLabel={(option) => option.name}
|
||||
isOptionEqualToValue={(option, value) => option.value === value.value}
|
||||
onChange={(event, value) => handleOrganizationIdChange(index, value)}
|
||||
renderInput={(params) => (
|
||||
<TextField {...params} label="Rumah Sakit" variant="outlined" />
|
||||
)}
|
||||
/>
|
||||
{/* <Autocomplete
|
||||
options={organizations}
|
||||
value={findValueOrganization(form.organizationId)}
|
||||
getOptionLabel={(option) =>
|
||||
option.name ?? findValueOrganization(form.organizationId).name ?? ''
|
||||
}
|
||||
onChange={(event, value) => handleOrganizationIdChange(index, value)}
|
||||
renderInput={(params) => (
|
||||
<TextField {...params} label="Rumah Sakit" variant="outlined" />
|
||||
)}
|
||||
/> */}
|
||||
</Grid>
|
||||
<Grid item xs={6}>
|
||||
{form.specialities && (
|
||||
// <Autocomplete
|
||||
// multiple
|
||||
// // options={specialities}
|
||||
// options={specialities}
|
||||
// value={findValueSpeciality(form.specialities) ?? ''}
|
||||
// getOptionLabel={(option) => option.name}
|
||||
// isOptionEqualToValue={(option, value) => option.value === value.value}
|
||||
// onChange={(event, value) => handleSpecialitiesChange(index, value)}
|
||||
// renderInput={(params) => (
|
||||
// <TextField {...params} label="Spesialis" variant="outlined" />
|
||||
// )}
|
||||
// />
|
||||
|
||||
<Autocomplete
|
||||
multiple
|
||||
options={specialities}
|
||||
value={findValueSpeciality(form.specialities)}
|
||||
getOptionLabel={(option) => option.name}
|
||||
onChange={(event, value) => handleSpecialitiesChange(index, value)}
|
||||
renderInput={(params) => (
|
||||
<TextField {...params} label="Spesialis" variant="outlined" />
|
||||
)}
|
||||
/>
|
||||
)}
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Box>
|
||||
))}
|
||||
</Card>
|
||||
<Card sx={{ p: 5, marginTop: 2 }}>
|
||||
<Title variant="h5">Spesialisasi</Title>
|
||||
{currentPractitioner?.specialities?.map((item, index) => (
|
||||
<Box key={index} sx={{ mt: 3 }}>
|
||||
<Grid container rowSpacing={1} columnSpacing={{ xs: 1, sm: 2, md: 3 }}>
|
||||
<Grid item xs={7}>
|
||||
<Text>{item.name}</Text>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Box>
|
||||
</Box>
|
||||
</div>
|
||||
))}
|
||||
</Card>
|
||||
<Box sx={{ width: '100%', mt: 5 }}>
|
||||
<Stack
|
||||
alignItems="center"
|
||||
justifyContent="end"
|
||||
direction={{ xs: 'column', md: 'row' }}
|
||||
sx={{ width: 1, textAlign: { xs: 'center', md: 'left' } }}
|
||||
>
|
||||
<Grid item xs={12} md={4}>
|
||||
<LoadingButton
|
||||
sx={{ boxShadow: '0px 2px 4px rgba(0, 0, 0, 0.1)' }}
|
||||
type="submit"
|
||||
variant="contained"
|
||||
size="large"
|
||||
// fullWidth={true}
|
||||
loading={isSubmitting}
|
||||
>
|
||||
{!isEdit ? 'Simpan' : 'Simpan Perubahan'}
|
||||
</LoadingButton>
|
||||
</Grid>
|
||||
</Stack>
|
||||
</Box>
|
||||
</Box>
|
||||
</Stack>
|
||||
</FormProvider>
|
||||
|
||||
@@ -57,6 +57,7 @@ import { Search } from '@mui/icons-material';
|
||||
import { Icon } from '@iconify/react';
|
||||
import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
|
||||
import KeyboardArrowRightIcon from '@mui/icons-material/KeyboardArrowRight';
|
||||
import AddIcon from '@mui/icons-material/Add';
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
@@ -205,9 +206,16 @@ export default function List() {
|
||||
spacing={2}
|
||||
sx={{ p: 2, justifyContent: 'space-between', alignItems: 'center' }}
|
||||
>
|
||||
<Grid item xs={12} md={12} lg={12}>
|
||||
<Grid item xs={12} md={10} lg={10}>
|
||||
<Filter onSearch={applyItems} />
|
||||
</Grid>
|
||||
<Grid item xs={12} md={2} lg={2} sx={{ textAlign: 'right' }}>
|
||||
<Link to="/master/doctors/create" style={{ textDecoration: 'none' }}>
|
||||
<Button variant="outlined" startIcon={<AddIcon />} sx={{ p: 1.8 }}>
|
||||
Create
|
||||
</Button>
|
||||
</Link>
|
||||
</Grid>
|
||||
</Grid>
|
||||
);
|
||||
}
|
||||
@@ -297,15 +305,22 @@ export default function List() {
|
||||
<CheckStatus row={row} />
|
||||
</TableCell> */}
|
||||
|
||||
{/* <TableCell align="center">
|
||||
<TableCell align="center">
|
||||
<ButtonGroup variant="text" aria-label="text button group">
|
||||
<Link to={'/master/doctors/' + row.id}>
|
||||
<Link to={'/master/doctors/' + row.id + '/edit'}>
|
||||
<Button>
|
||||
<Icon icon="ph:eye-bold" style={{ width: '24px', height: '24px' }} />
|
||||
<Icon icon="ph:pencil-simple-fill" style={{ width: '24px', height: '24px' }} />
|
||||
</Button>
|
||||
</Link>
|
||||
<Button
|
||||
onClick={() => {
|
||||
setOpenDialog(true);
|
||||
}}
|
||||
>
|
||||
<Icon icon="eva:trash-2-outline" style={{ width: '24px', height: '24px' }} />
|
||||
</Button>
|
||||
</ButtonGroup>
|
||||
</TableCell> */}
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
{/* COLLAPSIBLE ROW */}
|
||||
<TableRow>
|
||||
@@ -336,7 +351,12 @@ export default function List() {
|
||||
Jenis Kelamin
|
||||
</Grid>
|
||||
<Grid item xs={6}>
|
||||
: {row.gender ? row.gender : '-'}
|
||||
:{' '}
|
||||
{row.gender == 'male'
|
||||
? 'Laki-Laki'
|
||||
: row.gender == 'female'
|
||||
? 'Perempuan'
|
||||
: '-'}
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
@@ -9,7 +9,6 @@ import Form from './Form';
|
||||
import HeaderBreadcrumbs from '../../../components/HeaderBreadcrumbs';
|
||||
import axios from '../../../utils/axios';
|
||||
import { Organizations } from '../../../@types/organization';
|
||||
import ButtonBack from '../../../components/ButtonBack';
|
||||
|
||||
export default function Create() {
|
||||
const { themeStretch } = useSettings();
|
||||
@@ -31,25 +30,20 @@ export default function Create() {
|
||||
<Page title="Membership: Create a new Rumah Sakit">
|
||||
<Container maxWidth={themeStretch ? false : 'xl'}>
|
||||
<Stack direction="row" alignItems="center">
|
||||
<ButtonBack />
|
||||
<HeaderBreadcrumbs
|
||||
heading={!isEdit ? 'Create a new Rumah Sakit' : 'Edit Rumah Sakit'}
|
||||
links={[
|
||||
{ name: 'Master', href: '/master' },
|
||||
{
|
||||
name: 'Organizations',
|
||||
href: '/master/organizations',
|
||||
href: '/master/hospitals',
|
||||
},
|
||||
{ name: !isEdit ? 'Create' : currentOrganizations?.name ?? '' },
|
||||
]}
|
||||
/>
|
||||
</Stack>
|
||||
|
||||
<Form
|
||||
// isSubmitting={isSubmitting}
|
||||
isEdit={isEdit}
|
||||
currentOrganizations={currentOrganizations}
|
||||
/>
|
||||
<Form isEdit={isEdit} currentOrganizations={currentOrganizations} />
|
||||
</Container>
|
||||
</Page>
|
||||
);
|
||||
|
||||
@@ -65,7 +65,6 @@ const LabelStyle = styled(Typography)(({ theme }) => ({
|
||||
}));
|
||||
|
||||
const HeaderStyle = styled('header')(({ theme }) => ({
|
||||
padding: theme.spacing(5),
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'space-between',
|
||||
@@ -76,7 +75,6 @@ const Title = styled(Typography)(({ theme }) => ({
|
||||
boxShadow: 'none',
|
||||
// paddingBottom: theme.spacing(3),
|
||||
fontWeight: 700,
|
||||
color: '#005B7F',
|
||||
}));
|
||||
|
||||
// const [timezone, setTimezone] = React.useState('');
|
||||
@@ -110,10 +108,6 @@ export default function OrganizationsForm({ isEdit, currentOrganizations }: Prop
|
||||
const NewCorporateSchema = Yup.object().shape({
|
||||
name: Yup.string().required('Name is required'),
|
||||
code: Yup.string().required('Corporate Code is required'),
|
||||
active: Yup.boolean().required('Corporate Status is required'),
|
||||
lat: Yup.string().required('Latitude is required'),
|
||||
lng: Yup.string().required('Longitude is required'),
|
||||
timezone: Yup.string().required('Timezone is required'),
|
||||
// file: Yup.boolean().required('Corporate Status is required'),
|
||||
});
|
||||
|
||||
@@ -133,12 +127,6 @@ export default function OrganizationsForm({ isEdit, currentOrganizations }: Prop
|
||||
village_id: currentOrganizations?.village_id || '',
|
||||
postal_code: currentOrganizations?.postal_code || '',
|
||||
description: currentOrganizations?.description || '',
|
||||
technology: currentOrganizations?.technology || '',
|
||||
support_services: currentOrganizations?.support_services || '',
|
||||
merchant_code: currentOrganizations?.merchant_code || '',
|
||||
merchant_key: currentOrganizations?.merchant_key || '',
|
||||
image_url: currentOrganizations?.image_url || '',
|
||||
region_groups: currentOrganizations?.region_groups || '',
|
||||
}),
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
[currentOrganizations]
|
||||
@@ -192,25 +180,15 @@ export default function OrganizationsForm({ isEdit, currentOrganizations }: Prop
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [isEdit, currentOrganizations]);
|
||||
|
||||
const currentImage = currentOrganizations?.image_url;
|
||||
console.log('currentImage', currentImage);
|
||||
|
||||
console.log('current_image', currentImage);
|
||||
|
||||
const [file, setFile] = useState(null);
|
||||
console.log('file', file);
|
||||
|
||||
const onSubmit = async (data: FormValuesProps) => {
|
||||
try {
|
||||
const formData = new FormData();
|
||||
console.log('data', data);
|
||||
formData.append('name', data.name);
|
||||
formData.append('code', data.code);
|
||||
formData.append('phone', data.phone);
|
||||
formData.append('lat', data.lat);
|
||||
formData.append('lng', data.lng);
|
||||
formData.append('address', data.address);
|
||||
formData.append('timezone', data.timezone);
|
||||
formData.append('active', data.active ? '1' : '0');
|
||||
if (data.province_id === currentOrganizations?.province_id) {
|
||||
formData.append('province_id', data.province_id);
|
||||
@@ -235,21 +213,12 @@ export default function OrganizationsForm({ isEdit, currentOrganizations }: Prop
|
||||
} else {
|
||||
formData.append('village_id', data.village_id?.value ?? '');
|
||||
}
|
||||
if (data.region_groups === currentOrganizations?.region_groups) {
|
||||
formData.append('region_groups', data.region_groups);
|
||||
} else {
|
||||
formData.append('region_groups', data.region_groups?.value ?? '');
|
||||
}
|
||||
|
||||
formData.append('postal_code', data.postal_code);
|
||||
formData.append('description', data.description);
|
||||
formData.append('technology', data.technology);
|
||||
formData.append('support_services', data.support_services);
|
||||
formData.append('merchant_code', data.merchant_code);
|
||||
formData.append('merchant_key', data.merchant_key);
|
||||
formData.append('image', file);
|
||||
|
||||
if (!isEdit) {
|
||||
console.log('formData', formData);
|
||||
const response = await axios.post('/organizations', formData);
|
||||
} else {
|
||||
formData.append('_method', 'PUT');
|
||||
@@ -263,9 +232,10 @@ export default function OrganizationsForm({ isEdit, currentOrganizations }: Prop
|
||||
!isEdit ? 'Organizations Created Successfully!' : 'Organizations Udpated Successfully!',
|
||||
{ variant: 'success' }
|
||||
);
|
||||
navigate('/master/organizations');
|
||||
navigate('/master/hospitals');
|
||||
} catch (error: any) {
|
||||
if (error && error.response.status === 422) {
|
||||
console.log('error', error.response.data.errors);
|
||||
for (const [key, value] of Object.entries(error.response.data.errors)) {
|
||||
setError(key, { message: value[0] });
|
||||
enqueueSnackbar(value[0] ?? 'Failed Processing Request', { variant: 'error' });
|
||||
@@ -281,34 +251,10 @@ export default function OrganizationsForm({ isEdit, currentOrganizations }: Prop
|
||||
}
|
||||
};
|
||||
|
||||
const [valueTab, setValueTab] = React.useState('1');
|
||||
|
||||
const handleChangeTab = (event: React.SyntheticEvent, newValueTab: string) => {
|
||||
setValueTab(newValueTab);
|
||||
};
|
||||
|
||||
const handleDrop = useCallback(
|
||||
(acceptedFiles) => {
|
||||
setValue(
|
||||
'logo',
|
||||
acceptedFiles.map((file: Blob | MediaSource) =>
|
||||
Object.assign(file, {
|
||||
preview: URL.createObjectURL(file),
|
||||
})
|
||||
)
|
||||
);
|
||||
},
|
||||
[setValue]
|
||||
);
|
||||
|
||||
const handleRemove = (file: File | string) => {
|
||||
setValue('logo', null);
|
||||
};
|
||||
|
||||
const [province, setProvince] = useState<any>([]);
|
||||
const [city, setCity] = useState<any>([]);
|
||||
const [district, setDistrict] = useState<any>([]);
|
||||
// const [village, setVillage] = useState<any>([]);
|
||||
const [village, setVillage] = useState<any>([]);
|
||||
|
||||
useEffect(() => {
|
||||
axios.get('/province').then((res) => {
|
||||
@@ -335,17 +281,15 @@ export default function OrganizationsForm({ isEdit, currentOrganizations }: Prop
|
||||
}
|
||||
};
|
||||
|
||||
// if (values.province_id) {
|
||||
// if (values.city_id) {
|
||||
// loadDistrict();
|
||||
// } else {
|
||||
// loadCity();
|
||||
// }
|
||||
// } else {
|
||||
// axios.get('/province').then((res) => {
|
||||
// setProvince(res.data.data.map((item: any) => ({ value: item.id, label: item.name })));
|
||||
// });
|
||||
// }
|
||||
const loadVillage = async () => {
|
||||
if (values.district_id == currentOrganizations?.district_id) {
|
||||
const res = await axios.get('/village?district_id=' + values.district_id);
|
||||
setVillage(res.data.data.map((item: any) => ({ value: item.id, label: item.name })));
|
||||
} else {
|
||||
const res = await axios.get('/village?district_id=' + values.district_id?.value);
|
||||
setVillage(res.data.data.map((item: any) => ({ value: item.id, label: item.name })));
|
||||
}
|
||||
};
|
||||
|
||||
if (values.province_id) {
|
||||
loadCity();
|
||||
@@ -354,12 +298,11 @@ export default function OrganizationsForm({ isEdit, currentOrganizations }: Prop
|
||||
if (values.city_id) {
|
||||
loadDistrict();
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [values.province_id, values.city_id, values.district_id]);
|
||||
|
||||
console.log('province', values.province_id);
|
||||
console.log('city', values.city_id);
|
||||
console.log('district', values.district_id);
|
||||
if (values.district_id) {
|
||||
loadVillage();
|
||||
}
|
||||
}, [values.province_id, values.city_id, values.district_id, values.village_id]);
|
||||
|
||||
const findValueProvince = province.find(
|
||||
(item: any) => item.value === currentOrganizations?.province_id
|
||||
@@ -368,53 +311,8 @@ export default function OrganizationsForm({ isEdit, currentOrganizations }: Prop
|
||||
const findValueDistrict = district.find(
|
||||
(item: any) => item.value === currentOrganizations?.district_id
|
||||
);
|
||||
|
||||
console.log('findValueProvince', findValueProvince);
|
||||
console.log('findValueCity', findValueCity);
|
||||
console.log('findValueDistrict', findValueDistrict);
|
||||
const timezone = [
|
||||
{
|
||||
value: 'WIB',
|
||||
label: 'WIB',
|
||||
},
|
||||
{
|
||||
value: 'WITA',
|
||||
label: 'WITA',
|
||||
},
|
||||
{
|
||||
value: 'WIT',
|
||||
label: 'WIT',
|
||||
},
|
||||
];
|
||||
const region_groups = [
|
||||
{
|
||||
value: 'Jabodetabek',
|
||||
label: 'Jabodetabek',
|
||||
},
|
||||
{
|
||||
value: 'Jawa',
|
||||
label: 'Jawa',
|
||||
},
|
||||
{
|
||||
value: 'Kalimantan',
|
||||
label: 'Kalimantan',
|
||||
},
|
||||
{
|
||||
value: 'Papua',
|
||||
label: 'Papua',
|
||||
},
|
||||
{
|
||||
value: 'Sulawesi',
|
||||
label: 'Sulawesi',
|
||||
},
|
||||
{
|
||||
value: 'Sumatera',
|
||||
label: 'Sumatera',
|
||||
},
|
||||
];
|
||||
|
||||
const findVaalueGroupWilayah = region_groups.find(
|
||||
(item: any) => item.value === currentOrganizations?.region_groups
|
||||
const findValueVillage = village.find(
|
||||
(item: any) => item.value === currentOrganizations?.village_id
|
||||
);
|
||||
|
||||
return (
|
||||
@@ -431,326 +329,147 @@ export default function OrganizationsForm({ isEdit, currentOrganizations }: Prop
|
||||
<StatusLabel value={values.active} />
|
||||
</Grid>
|
||||
</HeaderStyle>
|
||||
<Box sx={{ width: '100%', typography: 'body1' }}>
|
||||
<TabContext value={valueTab}>
|
||||
<Box
|
||||
sx={{
|
||||
borderBottom: 1,
|
||||
borderColor: 'divider',
|
||||
backgroundColor: '#F4F6F8',
|
||||
pl: 5,
|
||||
pr: 5,
|
||||
}}
|
||||
>
|
||||
<TabList onChange={handleChangeTab} aria-label="lab API tabs example">
|
||||
<Tab label="Rumah Sakit" value="1" sx={{ pr: 5, pl: 5 }} />
|
||||
<Tab label="Informasi" value="2" sx={{ pr: 5, pl: 5 }} />
|
||||
<Tab label="Duitku Setting" value="3" sx={{ pr: 5, pl: 5 }} />
|
||||
</TabList>
|
||||
</Box>
|
||||
<TabPanel value="1">
|
||||
<Box sx={{ width: '100%', p: 5 }}>
|
||||
<Grid container rowSpacing={4} columnSpacing={{ xs: 1, sm: 2, md: 3 }}>
|
||||
<Grid item xs={12}>
|
||||
<LabelStyle>Nama Rumah Sakit</LabelStyle>
|
||||
<RHFTextField name="name" placeholder="Tuliskan Nama Rumah Sakit" />
|
||||
</Grid>
|
||||
<Grid item xs={12} md={12}>
|
||||
<LabelStyle>Pilih Foto Rumah Sakit</LabelStyle>
|
||||
<Box sx={{ width: '100%' }}>
|
||||
<MyDropzone setFile={setFile} currentImage={currentImage} />
|
||||
</Box>
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<LabelStyle>Nomor IGD</LabelStyle>
|
||||
<RHFTextField name="phone" placeholder="Tuliskan No IGD" />
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<LabelStyle>Code Rumah Sakit</LabelStyle>
|
||||
<RHFTextField name="code" placeholder="Tuliskan Code Rumah Sakit" />
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<LabelStyle>Group Wilayah</LabelStyle>
|
||||
<Controller
|
||||
name="region_groups"
|
||||
control={control}
|
||||
render={({ field: { onChange, value } }) => (
|
||||
<Autocomplete
|
||||
id="combo-box-demo"
|
||||
options={region_groups}
|
||||
getOptionLabel={(option) =>
|
||||
option.label ?? findVaalueGroupWilayah?.label ?? ''
|
||||
}
|
||||
value={value}
|
||||
onChange={(event: any, newValue: any) => {
|
||||
console.log('newValue', newValue);
|
||||
setValue('region_groups', newValue?.value);
|
||||
onChange(newValue);
|
||||
}}
|
||||
renderInput={(params) => (
|
||||
<TextField
|
||||
{...params}
|
||||
label="Group Wilayah"
|
||||
variant="outlined"
|
||||
fullWidth
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<LabelStyle>Alamat</LabelStyle>
|
||||
<RHFTextField name="address" placeholder="Tuliskan Alamat" />
|
||||
</Grid>
|
||||
<Grid item xs={12} md={6}>
|
||||
<LabelStyle>Provinsi</LabelStyle>
|
||||
{/*
|
||||
<Controller
|
||||
name="province_id"
|
||||
control={control}
|
||||
render={({ field: { onChange, value } }) => (
|
||||
<Select
|
||||
className="input-container"
|
||||
size="medium"
|
||||
disabled={!province?.length}
|
||||
value={value}
|
||||
onChange={(e: any) => {
|
||||
onChange(e);
|
||||
}}
|
||||
fullWidth
|
||||
MenuProps={{
|
||||
PaperProps: {
|
||||
sx: {
|
||||
maxHeight: 224,
|
||||
width: 250,
|
||||
p: 1,
|
||||
},
|
||||
},
|
||||
}}
|
||||
>
|
||||
{province?.map((item: any) => (
|
||||
<MenuItem key={item.value} value={item.value}>
|
||||
{item.label}
|
||||
</MenuItem>
|
||||
))}
|
||||
</Select>
|
||||
)}
|
||||
/> */}
|
||||
<Box sx={{ width: '100%', typography: 'body1', mt: 2 }}>
|
||||
<Grid container rowSpacing={4} columnSpacing={{ xs: 1, sm: 2, md: 3 }}>
|
||||
<Grid item xs={12}>
|
||||
<LabelStyle>Nama Rumah Sakit</LabelStyle>
|
||||
<RHFTextField name="name" placeholder="Tuliskan Nama Rumah Sakit" />
|
||||
</Grid>
|
||||
|
||||
<Controller
|
||||
name="province_id"
|
||||
control={control}
|
||||
render={({ field: { onChange, value } }) => (
|
||||
<Autocomplete
|
||||
id="combo-box-demo"
|
||||
options={province}
|
||||
getOptionLabel={(option) =>
|
||||
option.label ?? findValueProvince?.label ?? ''
|
||||
}
|
||||
value={value}
|
||||
onChange={(event: any, newValue: any) => {
|
||||
console.log('newValue', newValue);
|
||||
setValue('province_id', newValue?.value);
|
||||
onChange(newValue);
|
||||
}}
|
||||
renderInput={(params) => (
|
||||
<TextField
|
||||
{...params}
|
||||
label="Provinsi"
|
||||
variant="outlined"
|
||||
fullWidth
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item xs={12} md={6}>
|
||||
<LabelStyle>Kabupaten / Kota</LabelStyle>
|
||||
{/* <Controller
|
||||
name="city_id"
|
||||
control={control}
|
||||
render={({ field: { onChange, value } }) => (
|
||||
<Select
|
||||
className="input-container"
|
||||
size="medium"
|
||||
disabled={!city?.length}
|
||||
value={value}
|
||||
onChange={(e: any) => {
|
||||
onChange(e);
|
||||
}}
|
||||
fullWidth
|
||||
MenuProps={{
|
||||
PaperProps: {
|
||||
sx: {
|
||||
maxHeight: 224,
|
||||
width: 250,
|
||||
p: 1,
|
||||
},
|
||||
},
|
||||
}}
|
||||
>
|
||||
{city?.map((item: any) => (
|
||||
<MenuItem key={item.value} value={item.value}>
|
||||
{item.label}
|
||||
</MenuItem>
|
||||
))}
|
||||
</Select>
|
||||
)}
|
||||
/> */}
|
||||
<Controller
|
||||
name="city_id"
|
||||
control={control}
|
||||
render={({ field: { onChange, value } }) => (
|
||||
<Autocomplete
|
||||
id="combo-box-demo"
|
||||
options={city}
|
||||
getOptionLabel={(option) => option.label ?? findValueCity?.label ?? ''}
|
||||
value={value}
|
||||
onChange={(event: any, newValue: any) => {
|
||||
console.log('newValue', newValue);
|
||||
setValue('city_id', newValue?.value);
|
||||
onChange(newValue);
|
||||
}}
|
||||
renderInput={(params) => (
|
||||
<TextField
|
||||
{...params}
|
||||
label="Kabupaten / Kota"
|
||||
variant="outlined"
|
||||
fullWidth
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item xs={12} md={6}>
|
||||
<LabelStyle>Code Rumah Sakit</LabelStyle>
|
||||
<RHFTextField name="code" placeholder="Tuliskan Code Rumah Sakit" />
|
||||
</Grid>
|
||||
<Grid item xs={12} md={6}>
|
||||
<LabelStyle>Nomor IGD</LabelStyle>
|
||||
<RHFTextField name="phone" placeholder="Tuliskan No IGD" />
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<LabelStyle>Alamat</LabelStyle>
|
||||
<RHFTextField name="address" placeholder="Tuliskan Alamat" />
|
||||
</Grid>
|
||||
<Grid item xs={12} md={6}>
|
||||
<LabelStyle>Provinsi</LabelStyle>
|
||||
|
||||
<Grid item xs={12} md={6}>
|
||||
<LabelStyle>Kecamatan</LabelStyle>
|
||||
<Controller
|
||||
name="province_id"
|
||||
control={control}
|
||||
render={({ field: { onChange, value } }) => (
|
||||
<Autocomplete
|
||||
id="combo-box-demo"
|
||||
options={province}
|
||||
getOptionLabel={(option) => option.label ?? findValueProvince?.label ?? ''}
|
||||
value={value}
|
||||
onChange={(event: any, newValue: any) => {
|
||||
console.log('newValue', newValue);
|
||||
setValue('province_id', newValue?.value);
|
||||
onChange(newValue);
|
||||
}}
|
||||
renderInput={(params) => (
|
||||
<TextField {...params} label="Provinsi" variant="outlined" fullWidth />
|
||||
)}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item xs={12} md={6}>
|
||||
<LabelStyle>Kabupaten / Kota</LabelStyle>
|
||||
|
||||
{/* <Controller
|
||||
name="district_id"
|
||||
control={control}
|
||||
render={({ field: { onChange, value } }) => (
|
||||
<Select
|
||||
className="input-container"
|
||||
size="medium"
|
||||
disabled={!district?.length}
|
||||
value={value}
|
||||
onChange={(e: any) => {
|
||||
onChange(e);
|
||||
}}
|
||||
fullWidth
|
||||
MenuProps={{
|
||||
PaperProps: {
|
||||
sx: {
|
||||
maxHeight: 224,
|
||||
width: 250,
|
||||
p: 1,
|
||||
},
|
||||
},
|
||||
}}
|
||||
>
|
||||
{district?.map((item: any) => (
|
||||
<MenuItem key={item.value} value={item.value}>
|
||||
{item.label}
|
||||
</MenuItem>
|
||||
))}
|
||||
</Select>
|
||||
)}
|
||||
/> */}
|
||||
<Controller
|
||||
name="city_id"
|
||||
control={control}
|
||||
render={({ field: { onChange, value } }) => (
|
||||
<Autocomplete
|
||||
id="combo-box-demo"
|
||||
options={city}
|
||||
getOptionLabel={(option) => option.label ?? findValueCity?.label ?? ''}
|
||||
value={value}
|
||||
onChange={(event: any, newValue: any) => {
|
||||
console.log('newValue', newValue);
|
||||
setValue('city_id', newValue?.value);
|
||||
onChange(newValue);
|
||||
}}
|
||||
renderInput={(params) => (
|
||||
<TextField
|
||||
{...params}
|
||||
label="Kabupaten / Kota"
|
||||
variant="outlined"
|
||||
fullWidth
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
</Grid>
|
||||
|
||||
<Controller
|
||||
name="district_id"
|
||||
control={control}
|
||||
render={({ field: { onChange, value } }) => (
|
||||
<Autocomplete
|
||||
id="combo-box-demo"
|
||||
options={district}
|
||||
getOptionLabel={(option) =>
|
||||
option.label ?? findValueDistrict?.label ?? ''
|
||||
}
|
||||
value={value}
|
||||
onChange={(event: any, newValue: any) => {
|
||||
console.log('newValue', newValue);
|
||||
setValue('district_id', newValue?.value);
|
||||
onChange(newValue);
|
||||
}}
|
||||
renderInput={(params) => (
|
||||
<TextField
|
||||
{...params}
|
||||
label="Kecamatan"
|
||||
variant="outlined"
|
||||
fullWidth
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item xs={12} md={6}>
|
||||
<LabelStyle>Kode Pos</LabelStyle>
|
||||
<RHFTextField name="postal_code" placeholder="Tuliskan Kode Pos" />
|
||||
</Grid>
|
||||
<Grid item xs={12} md={4}>
|
||||
<LabelStyle>Latitude</LabelStyle>
|
||||
<RHFTextField name="lat" placeholder="Tuliskan Lattitude" />
|
||||
</Grid>
|
||||
<Grid item xs={12} md={4}>
|
||||
<LabelStyle>Longitude</LabelStyle>
|
||||
<RHFTextField name="lng" placeholder="Tuliskan Longitude" />
|
||||
</Grid>
|
||||
<Grid item xs={12} md={4}>
|
||||
<LabelStyle>Timezone</LabelStyle>
|
||||
{/* <RHFTextField name="timezone" /> */}
|
||||
<RHFSelect name="timezone" label="Pilih Timezone">
|
||||
<option value="" />
|
||||
{timezone.map((option, index) => (
|
||||
<option key={index} value={option.value}>
|
||||
{option.label}
|
||||
</option>
|
||||
))}
|
||||
</RHFSelect>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Box>
|
||||
</TabPanel>
|
||||
<TabPanel value="2">
|
||||
<Box sx={{ width: '100%', p: 5 }}>
|
||||
<Grid container rowSpacing={4} columnSpacing={{ xs: 1, sm: 2, md: 3 }}>
|
||||
<Grid item xs={12}>
|
||||
<LabelStyle>Deskripsi</LabelStyle>
|
||||
<RHFEditor name="description" placeholder="Tuliskan Deskripsi" />
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<LabelStyle>Teknologi</LabelStyle>
|
||||
<RHFEditor name="technology" placeholder="Tuliskan Teknologi" />
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<LabelStyle>Layanan Penunjang</LabelStyle>
|
||||
<RHFEditor name="support_services" placeholder="Tuliskan Layanan Penunjang" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Box>
|
||||
</TabPanel>
|
||||
<TabPanel value="3">
|
||||
<Box sx={{ width: '100%', p: 5 }}>
|
||||
<Grid container rowSpacing={4} columnSpacing={{ xs: 1, sm: 2, md: 3 }}>
|
||||
<Grid item xs={12}>
|
||||
<LabelStyle>Merchant Code</LabelStyle>
|
||||
<RHFTextField name="merchant_code" placeholder="Tuliskan Merchant Code" />
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<LabelStyle>Merchant Key</LabelStyle>
|
||||
<RHFTextField name="merchant_key" placeholder="Tuliskan Merchant Key" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Box>
|
||||
</TabPanel>
|
||||
</TabContext>
|
||||
<Grid item xs={12} md={6}>
|
||||
<LabelStyle>Kecamatan</LabelStyle>
|
||||
|
||||
<Controller
|
||||
name="district_id"
|
||||
control={control}
|
||||
render={({ field: { onChange, value } }) => (
|
||||
<Autocomplete
|
||||
id="combo-box-demo"
|
||||
options={district}
|
||||
getOptionLabel={(option) => option.label ?? findValueDistrict?.label ?? ''}
|
||||
value={value}
|
||||
onChange={(event: any, newValue: any) => {
|
||||
console.log('newValue', newValue);
|
||||
setValue('district_id', newValue?.value);
|
||||
onChange(newValue);
|
||||
}}
|
||||
renderInput={(params) => (
|
||||
<TextField {...params} label="Kecamatan" variant="outlined" fullWidth />
|
||||
)}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item xs={12} md={6}>
|
||||
<LabelStyle>Desa</LabelStyle>
|
||||
|
||||
<Controller
|
||||
name="village_id"
|
||||
control={control}
|
||||
render={({ field: { onChange, value } }) => (
|
||||
<Autocomplete
|
||||
id="combo-box-demo"
|
||||
options={village}
|
||||
getOptionLabel={(option) => option.label ?? findValueVillage?.label ?? ''}
|
||||
value={value}
|
||||
onChange={(event: any, newValue: any) => {
|
||||
console.log('newValue', newValue);
|
||||
setValue('village_id', newValue?.value);
|
||||
onChange(newValue);
|
||||
}}
|
||||
renderInput={(params) => (
|
||||
<TextField {...params} label="Desa" variant="outlined" fullWidth />
|
||||
)}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item xs={12} md={4}>
|
||||
<LabelStyle>Kode Pos</LabelStyle>
|
||||
<RHFTextField name="postal_code" placeholder="Tuliskan Kode Pos" />
|
||||
</Grid>
|
||||
<Grid item xs={12} md={4}>
|
||||
<LabelStyle>Latitude</LabelStyle>
|
||||
<RHFTextField name="lat" placeholder="Tuliskan Lattitude" />
|
||||
</Grid>
|
||||
<Grid item xs={12} md={4}>
|
||||
<LabelStyle>Longitude</LabelStyle>
|
||||
<RHFTextField name="lng" placeholder="Tuliskan Longitude" />
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<LabelStyle>Deskripsi</LabelStyle>
|
||||
<RHFEditor name="description" placeholder="Tuliskan Deskripsi" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Box>
|
||||
<Box sx={{ width: '100%', p: 5 }}>
|
||||
|
||||
<Box sx={{ width: '100%', mt: 5 }}>
|
||||
<Stack
|
||||
alignItems="center"
|
||||
justifyContent="end"
|
||||
|
||||
@@ -23,7 +23,7 @@ export default function Organizations() {
|
||||
},
|
||||
{
|
||||
name: 'Rumah Sakit',
|
||||
href: '/master/organizations',
|
||||
href: '/master/hospitals',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
|
||||
@@ -147,9 +147,11 @@ export default function List() {
|
||||
>
|
||||
<SearchInput onSearch={applyFilter} />
|
||||
|
||||
{/* <Link to="/master/organizations/create/" style={{ textDecoration: 'none' }}>
|
||||
<ButtonCreate />
|
||||
</Link> */}
|
||||
<Link to="/master/hospitals/create" style={{ textDecoration: 'none' }}>
|
||||
<Button variant="outlined" startIcon={<AddIcon />} sx={{ p: 1.8 }}>
|
||||
Create
|
||||
</Button>
|
||||
</Link>
|
||||
</Stack>
|
||||
);
|
||||
}
|
||||
@@ -259,26 +261,26 @@ export default function List() {
|
||||
</TableCell>
|
||||
<TableCell align="left">{row.name}</TableCell>
|
||||
<TableCell align="left">{row.phone}</TableCell>
|
||||
<TableCell align="left">{row.address?.text}</TableCell>
|
||||
<TableCell align="left">{row.address}</TableCell>
|
||||
|
||||
{/* <TableCell align="left">
|
||||
<Stack direction="row">
|
||||
<ButtonGroup variant="text" aria-label="text button group">
|
||||
<Link to={'/master/organizations/' + row.id + '/edit'}>
|
||||
<Button>
|
||||
<Icon icon="ph:pencil-simple-fill" style={{ width: '24px', height: '24px' }} />
|
||||
</Button>
|
||||
</Link>
|
||||
<Button
|
||||
onClick={() => {
|
||||
setOpenDialog(true);
|
||||
}}
|
||||
>
|
||||
<Icon icon="eva:trash-2-outline" style={{ width: '24px', height: '24px' }} />
|
||||
<TableCell align="right">
|
||||
{/* <Stack direction="row"> */}
|
||||
<ButtonGroup variant="text" aria-label="text button group">
|
||||
<Link to={'/master/hospitals/' + row.id + '/edit'}>
|
||||
<Button>
|
||||
<Icon icon="ph:pencil-simple-fill" style={{ width: '24px', height: '24px' }} />
|
||||
</Button>
|
||||
</ButtonGroup>
|
||||
</Stack>
|
||||
</TableCell> */}
|
||||
</Link>
|
||||
<Button
|
||||
onClick={() => {
|
||||
setOpenDialog(true);
|
||||
}}
|
||||
>
|
||||
<Icon icon="eva:trash-2-outline" style={{ width: '24px', height: '24px' }} />
|
||||
</Button>
|
||||
</ButtonGroup>
|
||||
{/* </Stack> */}
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
|
||||
{/* COLLAPSIBLE ROW */}
|
||||
|
||||
93
frontend/dashboard/src/pages/Report/Appointments/Create.tsx
Normal file
93
frontend/dashboard/src/pages/Report/Appointments/Create.tsx
Normal file
@@ -0,0 +1,93 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
import { paramCase } from 'change-case';
|
||||
import { useParams, useLocation } from 'react-router-dom';
|
||||
// @mui
|
||||
import { Container, Stack } from '@mui/material';
|
||||
import useSettings from '../../../hooks/useSettings';
|
||||
import Page from '../../../components/Page';
|
||||
import Form from './Form';
|
||||
import HeaderBreadcrumbs from '../../../components/HeaderBreadcrumbs';
|
||||
import axios from '../../../utils/axios';
|
||||
import { Practitioner } from '../../../@types/doctor';
|
||||
import ButtonBack from '../../../components/ButtonBack';
|
||||
|
||||
export default function Create() {
|
||||
const { themeStretch } = useSettings();
|
||||
const { id } = useParams();
|
||||
|
||||
const isEdit = id ? true : false;
|
||||
|
||||
const [currentPractitioner, setCurrentPractitioner] = useState<Practitioner>();
|
||||
|
||||
useEffect(() => {
|
||||
if (isEdit) {
|
||||
axios.get('/doctors/' + id).then((res) => {
|
||||
setCurrentPractitioner(res.data);
|
||||
});
|
||||
}
|
||||
}, [id]);
|
||||
|
||||
return (
|
||||
<Page title="Membership: Create a new Dokter">
|
||||
<Container maxWidth={themeStretch ? false : 'xl'}>
|
||||
<Stack direction="row" alignItems="center">
|
||||
{/* <ButtonBack /> */}
|
||||
<HeaderBreadcrumbs
|
||||
heading={!isEdit ? 'Manage a new Dokter' : 'Manage Dokter'}
|
||||
links={[
|
||||
{ name: 'Master', href: '/master' },
|
||||
{
|
||||
name: 'Doctors',
|
||||
href: '/master/doctors',
|
||||
},
|
||||
{ name: !isEdit ? 'Create' : currentPractitioner?.name ?? '' },
|
||||
]}
|
||||
/>
|
||||
</Stack>
|
||||
|
||||
<Form
|
||||
// isSubmitting={isSubmitting}
|
||||
isEdit={isEdit}
|
||||
currentPractitioner={currentPractitioner}
|
||||
/>
|
||||
</Container>
|
||||
</Page>
|
||||
);
|
||||
}
|
||||
// const pageTitle = 'Create Data Dokter';
|
||||
// return (
|
||||
// <Page title={pageTitle}>
|
||||
// <Container maxWidth={themeStretch ? false : 'xl'}>
|
||||
// <HeaderBreadcrumbs
|
||||
// heading={pageTitle}
|
||||
// links={[
|
||||
// {
|
||||
// name: 'Master',
|
||||
// href: '/master',
|
||||
// },
|
||||
// {
|
||||
// name: 'Dokter',
|
||||
// href: '/master/organizations/',
|
||||
// },
|
||||
// {
|
||||
// name: 'Create',
|
||||
// href: '/master/organizations/create/',
|
||||
// },
|
||||
// ]}
|
||||
// />
|
||||
|
||||
// <Grid container spacing={2}>
|
||||
// <Grid item xs={12}>
|
||||
// <Card sx={{ p: 2 }}>
|
||||
// <Form
|
||||
// isSubmitting={isSubmitting}
|
||||
// isEdit={isEdit}
|
||||
// currentOrganizations={currentOrganizations}
|
||||
// />
|
||||
// </Card>
|
||||
// </Grid>
|
||||
// </Grid>
|
||||
// </Container>
|
||||
// </Page>
|
||||
// );
|
||||
// }
|
||||
260
frontend/dashboard/src/pages/Report/Appointments/Form.tsx
Normal file
260
frontend/dashboard/src/pages/Report/Appointments/Form.tsx
Normal file
@@ -0,0 +1,260 @@
|
||||
import * as Yup from 'yup';
|
||||
import { useSnackbar } from 'notistack';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||
import MenuItem from '@mui/material/MenuItem';
|
||||
|
||||
import Select, { SelectChangeEvent } from '@mui/material/Select';
|
||||
import * as React from 'react';
|
||||
|
||||
// form
|
||||
import { useForm } from 'react-hook-form';
|
||||
import { yupResolver } from '@hookform/resolvers/yup';
|
||||
// @mui
|
||||
import { styled } from '@mui/material/styles';
|
||||
import { LoadingButton } from '@mui/lab';
|
||||
import {
|
||||
Box,
|
||||
Avatar,
|
||||
Button,
|
||||
ButtonGroup,
|
||||
Card,
|
||||
FormHelperText,
|
||||
Grid,
|
||||
Stack,
|
||||
Typography,
|
||||
TextField,
|
||||
Chip,
|
||||
} from '@mui/material';
|
||||
|
||||
import CancelIcon from '@mui/icons-material/Cancel';
|
||||
|
||||
// components
|
||||
import {
|
||||
FormProvider,
|
||||
RHFTextField,
|
||||
RHFRadioGroup,
|
||||
RHFUploadAvatar,
|
||||
RHFSwitch,
|
||||
RHFEditor,
|
||||
RHFDatepicker,
|
||||
RHFMultiCheckbox,
|
||||
RHFCheckbox,
|
||||
RHFCustomMultiCheckbox,
|
||||
} from '../../../components/hook-form';
|
||||
import axios from '../../../utils/axios';
|
||||
import { fCurrency } from '../../../utils/formatNumber';
|
||||
import { Practitioner } from '../../../@types/doctor';
|
||||
|
||||
import { Label, Rowing } from '@mui/icons-material';
|
||||
|
||||
const LabelStyle = styled(Typography)(({ theme }) => ({
|
||||
...theme.typography.subtitle2,
|
||||
color: theme.palette.text.secondary,
|
||||
marginBottom: theme.spacing(1),
|
||||
}));
|
||||
|
||||
const HeaderStyle = styled('header')(({ theme }) => ({
|
||||
paddingBottom: theme.spacing(5),
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'space-between',
|
||||
}));
|
||||
|
||||
const Title = styled(Typography)(({ theme }) => ({
|
||||
...theme.typography.h4,
|
||||
boxShadow: 'none',
|
||||
// paddingBottom: theme.spacing(3),
|
||||
fontWeight: 700,
|
||||
color: '#005B7F',
|
||||
}));
|
||||
|
||||
interface FormValuesProps extends Partial<Practitioner> {
|
||||
taxes: boolean;
|
||||
inStock: boolean;
|
||||
}
|
||||
|
||||
type Props = {
|
||||
isEdit: boolean;
|
||||
currentPractitioner?: Practitioner;
|
||||
};
|
||||
|
||||
const Span = styled(Typography)(({ theme }) => ({
|
||||
boxShadow: 'none',
|
||||
paddingBottom: theme.spacing(1),
|
||||
}));
|
||||
|
||||
const Text = styled(Typography)(({ theme }) => ({
|
||||
boxShadow: 'none',
|
||||
paddingBottom: theme.spacing(3),
|
||||
}));
|
||||
|
||||
export default function PractitionerForm({ isEdit, currentPractitioner }: Props) {
|
||||
const navigate = useNavigate();
|
||||
const [practitioner_group, setPractitionerGroups] = useState([]);
|
||||
|
||||
// const [ errors, setErrors ] = useState<{ [key: string]: string }>({});
|
||||
|
||||
const { enqueueSnackbar } = useSnackbar();
|
||||
|
||||
const NewCorporateSchema = Yup.object().shape({
|
||||
name: Yup.string().required('Name is required'),
|
||||
// file: Yup.boolean().required('Corporate Status is required'),
|
||||
});
|
||||
|
||||
const defaultValues = useMemo(
|
||||
() => ({
|
||||
id: currentPractitioner?.id,
|
||||
name: currentPractitioner?.name || '',
|
||||
address: currentPractitioner?.address || '',
|
||||
birth_date: currentPractitioner?.birth_date || '',
|
||||
gender: currentPractitioner?.gender || '',
|
||||
description: currentPractitioner?.description || '',
|
||||
birth_place: currentPractitioner?.birth_place || '',
|
||||
active: currentPractitioner?.active === 1 ? true : false,
|
||||
avatar_url: currentPractitioner?.avatar_url || '',
|
||||
doctor_id: currentPractitioner?.doctor_id || '',
|
||||
organizations: currentPractitioner?.organizations || [],
|
||||
specialities: currentPractitioner?.specialities || [],
|
||||
}),
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
[currentPractitioner]
|
||||
);
|
||||
|
||||
console.log('defaultValues', defaultValues);
|
||||
|
||||
function StatusLabel({ value }: { value: boolean }) {
|
||||
return (
|
||||
<Chip
|
||||
label={value ? 'Aktif' : 'Tidak Aktif'}
|
||||
size="medium"
|
||||
sx={{
|
||||
backgroundColor: value ? 'rgba(84, 214, 44, 0.16)' : 'rgba(255, 72, 66, 0.16)',
|
||||
color: value ? '#229A16' : '#B72136',
|
||||
padding: '1 8 1 8 px',
|
||||
borderRadius: '4px',
|
||||
fontSize: '12px',
|
||||
fontWeight: 'bold',
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
const methods = useForm<FormValuesProps>({
|
||||
resolver: yupResolver(NewCorporateSchema),
|
||||
defaultValues,
|
||||
});
|
||||
|
||||
const {
|
||||
reset,
|
||||
watch,
|
||||
control,
|
||||
setValue,
|
||||
getValues,
|
||||
setError,
|
||||
handleSubmit,
|
||||
formState: { isSubmitting },
|
||||
} = methods;
|
||||
|
||||
const values = watch();
|
||||
|
||||
useEffect(() => {
|
||||
if (isEdit && currentPractitioner) {
|
||||
reset(defaultValues);
|
||||
}
|
||||
if (!isEdit) {
|
||||
reset(defaultValues);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [isEdit, currentPractitioner]);
|
||||
|
||||
const handleActivate = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||
setValue('active', event.target.checked);
|
||||
|
||||
console.log('event.target.checked', event.target.checked);
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append('active', event.target.checked ? '1' : '0');
|
||||
formData.append('_method', 'PUT');
|
||||
axios.post('/doctors/' + currentPractitioner?.id ?? '', formData);
|
||||
|
||||
enqueueSnackbar('active Updated Successfully!', { variant: 'success' });
|
||||
};
|
||||
|
||||
return (
|
||||
<FormProvider methods={methods}>
|
||||
<Stack spacing={3}>
|
||||
<Box sx={{ width: '100%' }}>
|
||||
{/* <Stack spacing={3}> */}
|
||||
<Card sx={{ p: 5 }}>
|
||||
<HeaderStyle>
|
||||
<Grid item xs={6} md={6}>
|
||||
<Title>Data Dokter</Title>
|
||||
</Grid>
|
||||
<Grid item xs={6} md={6}>
|
||||
{/* <Typography>Status Rumah Sakit</Typography> */}
|
||||
<RHFSwitch name="active" label="" onClick={handleActivate} />
|
||||
<StatusLabel value={values.active} />
|
||||
</Grid>
|
||||
</HeaderStyle>
|
||||
<Title variant="h5">Informasi Umum</Title>
|
||||
<Avatar
|
||||
alt="Remy Sharp"
|
||||
src={currentPractitioner?.avatar_url}
|
||||
sx={{ width: 120, height: 120, marginBottom: 2 }}
|
||||
/>
|
||||
|
||||
<Grid container rowSpacing={1} columnSpacing={{ xs: 1, sm: 2, md: 3 }}>
|
||||
<Grid item xs={7}>
|
||||
<Span style={{ fontWeight: 'bold' }}>Nama Dokter</Span>
|
||||
<Text>{currentPractitioner?.name ? currentPractitioner?.name : '-'}</Text>
|
||||
<Span style={{ fontWeight: 'bold' }}>No Telp</Span>
|
||||
<Text>{currentPractitioner?.phone ? currentPractitioner?.phone : '-'}</Text>
|
||||
<Span style={{ fontWeight: 'bold' }}>Tempat Lahir</Span>
|
||||
<Text>
|
||||
{currentPractitioner?.birth_place ? currentPractitioner?.birth_place : '-'}
|
||||
</Text>
|
||||
<Span style={{ fontWeight: 'bold' }}>Alamat</Span>
|
||||
<Text>{currentPractitioner?.address ? currentPractitioner?.address : '-'}</Text>
|
||||
</Grid>
|
||||
<Grid item xs={5} columnSpacing={{ xs: 1, sm: 2, md: 3 }}>
|
||||
<Span style={{ fontWeight: 'bold' }}>Jenis Kelamin</Span>
|
||||
<Text>{currentPractitioner?.gender ? currentPractitioner?.gender : '-'}</Text>
|
||||
<Span style={{ fontWeight: 'bold' }}>Email</Span>
|
||||
<Text>{currentPractitioner?.email ? currentPractitioner?.email : '-'}</Text>
|
||||
<Span style={{ fontWeight: 'bold' }}>Tanggal Lahir</Span>
|
||||
<Text>
|
||||
{currentPractitioner?.birth_date ? currentPractitioner?.birth_date : '-'}
|
||||
</Text>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Card>
|
||||
<Card sx={{ p: 5, marginTop: 2 }}>
|
||||
<Title variant="h5">Tempat Praktik</Title>
|
||||
{currentPractitioner?.organizations?.map((item, index) => (
|
||||
<Box key={index} sx={{ mt: 3 }}>
|
||||
<Grid container rowSpacing={1} columnSpacing={{ xs: 1, sm: 2, md: 3 }}>
|
||||
<Grid item xs={7}>
|
||||
<Text>{item.name}</Text>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Box>
|
||||
))}
|
||||
</Card>
|
||||
<Card sx={{ p: 5, marginTop: 2 }}>
|
||||
<Title variant="h5">Spesialisasi</Title>
|
||||
{currentPractitioner?.specialities?.map((item, index) => (
|
||||
<Box key={index} sx={{ mt: 3 }}>
|
||||
<Grid container rowSpacing={1} columnSpacing={{ xs: 1, sm: 2, md: 3 }}>
|
||||
<Grid item xs={7}>
|
||||
<Text>{item.name}</Text>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Box>
|
||||
))}
|
||||
</Card>
|
||||
</Box>
|
||||
</Stack>
|
||||
</FormProvider>
|
||||
);
|
||||
}
|
||||
35
frontend/dashboard/src/pages/Report/Appointments/Index.tsx
Normal file
35
frontend/dashboard/src/pages/Report/Appointments/Index.tsx
Normal file
@@ -0,0 +1,35 @@
|
||||
import { Card, Grid, Container } from '@mui/material';
|
||||
import { useParams } from 'react-router-dom';
|
||||
import HeaderBreadcrumbs from '../../../components/HeaderBreadcrumbs';
|
||||
import Page from '../../../components/Page';
|
||||
import useSettings from '../../../hooks/useSettings';
|
||||
import List from './List';
|
||||
|
||||
export default function Doctors() {
|
||||
const { themeStretch } = useSettings();
|
||||
|
||||
const { id } = useParams();
|
||||
|
||||
const pageTitle = 'Appointments';
|
||||
return (
|
||||
<Page title={pageTitle}>
|
||||
<Container maxWidth={themeStretch ? false : 'xl'}>
|
||||
<HeaderBreadcrumbs
|
||||
heading={pageTitle}
|
||||
links={[
|
||||
{
|
||||
name: 'Report',
|
||||
href: '/report',
|
||||
},
|
||||
{
|
||||
name: 'Appointments',
|
||||
href: '/report/appointments',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
|
||||
<List />
|
||||
</Container>
|
||||
</Page>
|
||||
);
|
||||
}
|
||||
416
frontend/dashboard/src/pages/Report/Appointments/List.tsx
Normal file
416
frontend/dashboard/src/pages/Report/Appointments/List.tsx
Normal file
@@ -0,0 +1,416 @@
|
||||
import {
|
||||
Box,
|
||||
Button,
|
||||
Card,
|
||||
Collapse,
|
||||
Paper,
|
||||
Select,
|
||||
SelectChangeEvent,
|
||||
Table,
|
||||
TableBody,
|
||||
TableCell,
|
||||
TableContainer,
|
||||
TableHead,
|
||||
TableRow,
|
||||
TextField,
|
||||
Typography,
|
||||
Stack,
|
||||
ButtonGroup,
|
||||
Grid,
|
||||
Chip,
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogContentText,
|
||||
DialogActions,
|
||||
FormControl,
|
||||
Autocomplete,
|
||||
InputAdornment,
|
||||
IconButton,
|
||||
} from '@mui/material';
|
||||
|
||||
import {
|
||||
Link,
|
||||
NavLink as RouterLink,
|
||||
useSearchParams,
|
||||
useNavigate,
|
||||
useParams,
|
||||
} from 'react-router-dom';
|
||||
// hooks
|
||||
import React, { ChangeEvent, Component, useEffect, useRef, useState } from 'react';
|
||||
import useSettings from '../../../hooks/useSettings';
|
||||
// components
|
||||
import axios from '../../../utils/axios';
|
||||
import { LaravelPaginatedData } from '../../../@types/paginated-data';
|
||||
import { Icd } from '../../../@types/diagnosis';
|
||||
import BasePagination from '../../../components/BasePagination';
|
||||
import { Practitioner } from '../../../@types/doctor';
|
||||
import CreateIcon from '@mui/icons-material/Create';
|
||||
import { Props } from '../../../components/editor/index';
|
||||
import { red } from '@mui/material/colors';
|
||||
import { margin, padding } from '@mui/system';
|
||||
import { enqueueSnackbar } from 'notistack';
|
||||
import { Controller } from 'react-hook-form';
|
||||
|
||||
import SvgIconStyle from '../../../components/SvgIconStyle';
|
||||
import { GridSearchIcon } from '@mui/x-data-grid';
|
||||
import { Search } from '@mui/icons-material';
|
||||
import { Icon } from '@iconify/react';
|
||||
import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
|
||||
import KeyboardArrowRightIcon from '@mui/icons-material/KeyboardArrowRight';
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
export default function List() {
|
||||
// Generate the every row of the table
|
||||
|
||||
const navigate = useNavigate();
|
||||
const { organization_id } = useParams();
|
||||
const [searchParams, setSearchParams] = useSearchParams();
|
||||
const [searchParamsOrganizations, setSearchParamsOrganizations] = useSearchParams();
|
||||
const [searchParamsSpecialities, setSearchParamsSpecialities] = useSearchParams();
|
||||
const [searchParamsFilter, setSearchParamsFilter] = useSearchParams();
|
||||
|
||||
function Filter(props: any) {
|
||||
// SEARCH
|
||||
const searchInput = useRef<HTMLInputElement>(null);
|
||||
const [searchText, setSearchText] = useState('');
|
||||
|
||||
//handle search
|
||||
const handleSearchChange = (event: any) => {
|
||||
const newSearchText = event.target.value ?? '';
|
||||
setSearchText(newSearchText);
|
||||
};
|
||||
|
||||
const handleSearchSubmit = (event: any) => {
|
||||
event.preventDefault();
|
||||
|
||||
props.onSearch(searchText);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
// Trigger First Search
|
||||
setSearchText(searchParams.get('search') ?? '');
|
||||
}, []);
|
||||
|
||||
const item = [
|
||||
{
|
||||
id: '',
|
||||
value: '',
|
||||
name: 'Semua',
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<form style={{ width: '100%' }}>
|
||||
<Grid container spacing={2} sx={{ justifyContent: 'space-between', alignItems: 'center' }}>
|
||||
<Grid item xs={12} sm={12} md={12} lg={12}>
|
||||
<TextField
|
||||
id="search-input"
|
||||
ref={searchInput}
|
||||
variant="outlined"
|
||||
fullWidth
|
||||
onChange={handleSearchChange}
|
||||
onKeyDown={(event) => {
|
||||
if (event.key === 'Enter') {
|
||||
handleSearchSubmit(event);
|
||||
}
|
||||
}}
|
||||
value={searchText}
|
||||
InputProps={{
|
||||
startAdornment: (
|
||||
<InputAdornment position="start">
|
||||
<Search />
|
||||
</InputAdornment>
|
||||
),
|
||||
placeholder: 'Search',
|
||||
}}
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</form>
|
||||
);
|
||||
}
|
||||
|
||||
function FilterForm(props: any) {
|
||||
// IMPORT
|
||||
return (
|
||||
<Grid
|
||||
container
|
||||
spacing={2}
|
||||
sx={{ p: 2, justifyContent: 'space-between', alignItems: 'center' }}
|
||||
>
|
||||
<Grid item xs={12} md={12} lg={12}>
|
||||
<Filter onSearch={applyItems} />
|
||||
</Grid>
|
||||
</Grid>
|
||||
);
|
||||
}
|
||||
|
||||
function createData(doctor: Practitioner): Practitioner {
|
||||
return {
|
||||
...doctor,
|
||||
};
|
||||
}
|
||||
|
||||
function Row(props: { row: ReturnType<typeof createData> }) {
|
||||
const { row } = props;
|
||||
const [open, setOpen] = React.useState(false);
|
||||
const [openDialog, setOpenDialog] = React.useState(false);
|
||||
|
||||
const handleDelete = (model: any) => {
|
||||
axios
|
||||
.delete(`/doctors/${row.id}`)
|
||||
.then((res) => {
|
||||
setDataTableData({
|
||||
...dataTableData,
|
||||
data: dataTableData.data.filter((model) => model.id != row.id),
|
||||
});
|
||||
enqueueSnackbar('Data berhasil dihapus', { variant: 'success' });
|
||||
})
|
||||
.catch((error) => {
|
||||
enqueueSnackbar(
|
||||
error.response.data.message ?? error.message ?? 'Failed Processing Request',
|
||||
{ variant: 'error' }
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
<TableRow>
|
||||
<TableCell>
|
||||
<IconButton aria-label="expand row" size="small" onClick={() => setOpen(!open)}>
|
||||
{open ? <KeyboardArrowDownIcon /> : <KeyboardArrowRightIcon />}
|
||||
</IconButton>
|
||||
</TableCell>
|
||||
<TableCell align="left">{row.date_created ? row.date_created : '-'}</TableCell>
|
||||
<TableCell align="left">{row.date_appointment ? row.date_appointment : '-'}</TableCell>
|
||||
<TableCell align="left">{row.booking_code ?? '-'}</TableCell>
|
||||
<TableCell align="left">{row.patient_name ? row.patient_name : '-'}</TableCell>
|
||||
<TableCell align="left">{row.health_care ? row.health_care : '-'}</TableCell>
|
||||
<TableCell align="left">{row.doctor_name ? row.doctor_name : '-'}</TableCell>
|
||||
<TableCell align="left">{row.type ? row.type : '-'}</TableCell>
|
||||
|
||||
<TableCell align="left">{row.status ? row.status : '-'}</TableCell>
|
||||
<TableCell align="center">
|
||||
<ButtonGroup variant="text" aria-label="text button group">
|
||||
<Link to={'/report/appointments/' + row.id + '/show'}>
|
||||
<Button>
|
||||
<Icon icon="ph:eye-bold" style={{ width: '24px', height: '24px' }} />
|
||||
</Button>
|
||||
</Link>
|
||||
</ButtonGroup>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
<TableRow>
|
||||
<TableCell style={{ paddingBottom: 0, paddingTop: 0 }} colSpan={15}>
|
||||
<Collapse in={open} timeout="auto" unmountOnExit>
|
||||
<Stack>
|
||||
<Grid container>
|
||||
<Grid item xs={2}>Spesialisasi</Grid><Grid item xs="10">: {row.speciality}</Grid>
|
||||
<Grid item xs={2}>Via</Grid><Grid item xs="10">: {row.appointment_media}</Grid>
|
||||
<Grid item xs={2}>Metode Pembayaran</Grid><Grid item xs="10">: {row.payment_method}</Grid>
|
||||
<Grid item xs={2}>HIS RegID</Grid><Grid item xs="10">: {row.his_detail?.sRegID}</Grid>
|
||||
<Grid item xs={2}>HIS Medrec</Grid><Grid item xs="10">: {row.his_detail?.Medrec}</Grid>
|
||||
<Grid item xs={2}>No HP</Grid><Grid item xs="10">: {row.patient.sPhone ?? ''}</Grid>
|
||||
<Grid item xs={2}>E-mail</Grid><Grid item xs="10">: {row.patient.sEmail ?? ''}</Grid>
|
||||
<Grid item xs={2}>Alamat</Grid><Grid item xs="10">: {row.patient.detail.sAlamat ?? ''}</Grid>
|
||||
<Grid item xs={2}>KTP</Grid><Grid item xs="10">: {row.patient.detail.sKTP ?? ''}</Grid>
|
||||
</Grid>
|
||||
</Stack>
|
||||
</Collapse>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
|
||||
<Dialog
|
||||
open={openDialog}
|
||||
onClose={() => {
|
||||
setOpenDialog(false);
|
||||
}}
|
||||
aria-labelledby="alert-dialog-title"
|
||||
aria-describedby="alert-dialog-description"
|
||||
>
|
||||
<DialogContent sx={{ p: 5 }}>
|
||||
<Icon
|
||||
icon="eva:trash-2-outline"
|
||||
style={{
|
||||
width: '100px',
|
||||
height: '100px',
|
||||
color: '#FF0000',
|
||||
margin: 'auto',
|
||||
display: 'block',
|
||||
marginBottom: '20px',
|
||||
alignContent: 'center',
|
||||
}}
|
||||
/>
|
||||
<DialogContentText sx={{ fontWeight: 'bold', pb: 1 }} id="alert-dialog-title">
|
||||
Apakah anda yakin ingin menghapus
|
||||
</DialogContentText>
|
||||
<Typography sx={{ fontWeight: 'bold' }} id="alert-dialog-title">
|
||||
{row.name}?
|
||||
</Typography>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button
|
||||
onClick={() => {
|
||||
setOpenDialog(false);
|
||||
}}
|
||||
color="primary"
|
||||
>
|
||||
Batal
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() => {
|
||||
handleDelete(row.id);
|
||||
}}
|
||||
color="primary"
|
||||
autoFocus
|
||||
>
|
||||
Hapus
|
||||
</Button>
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
|
||||
const headStyle = {
|
||||
fontWeight: 'bold',
|
||||
};
|
||||
// Dummy Default Data
|
||||
const [dataTableIsLoading, setDataTableLoading] = useState(true);
|
||||
const [dataTableLastRequest, setDataTableLastRequest] = useState(0);
|
||||
const [dataTableResponseState, setDataTableResponseState] = useState('idle');
|
||||
const [dataTableData, setDataTableData] = useState<LaravelPaginatedData>({
|
||||
current_page: 1,
|
||||
data: [],
|
||||
path: '',
|
||||
first_page_url: '',
|
||||
last_page: 1,
|
||||
last_page_url: '',
|
||||
next_page_url: '',
|
||||
prev_page_url: '',
|
||||
per_page: 10,
|
||||
from: 0,
|
||||
to: 0,
|
||||
total: 0,
|
||||
});
|
||||
const [dataTablePage, setDataTablePage] = useState(5);
|
||||
|
||||
const loadDataTableData = async (appliedFilter: any | null = null) => {
|
||||
setDataTableLoading(true);
|
||||
const filter = appliedFilter ? appliedFilter : Object.fromEntries([...searchParams.entries()]);
|
||||
const response = await axios.get('/appointments', {
|
||||
params: filter,
|
||||
});
|
||||
setDataTableLoading(false);
|
||||
setDataTableData(response.data);
|
||||
};
|
||||
|
||||
// const applyFilter = async (searchFilter: string) => {
|
||||
// await loadDataTableData({ search: searchFilter });
|
||||
// setSearchParams({ search: searchFilter });
|
||||
// };
|
||||
|
||||
const applyItems = async (
|
||||
searchFilter: string,
|
||||
searchFilterOrganization: string,
|
||||
searchFilterSpecialities: string
|
||||
) => {
|
||||
await loadDataTableData({
|
||||
search: searchFilter,
|
||||
organization_id: searchFilterOrganization,
|
||||
speciality_id: searchFilterSpecialities,
|
||||
});
|
||||
setSearchParamsFilter({
|
||||
search: searchFilter,
|
||||
organization_id: searchFilterOrganization,
|
||||
speciality_id: searchFilterSpecialities,
|
||||
});
|
||||
};
|
||||
|
||||
const handlePageChange = (event: ChangeEvent, value: number) => {
|
||||
const filter = Object.fromEntries([...searchParams.entries(), ['page', value]]);
|
||||
loadDataTableData(filter);
|
||||
setSearchParams(filter);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
loadDataTableData();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<Stack>
|
||||
{/* <Ambulace /> */}
|
||||
|
||||
<Card sx={{ marginTop: '30px' }}>
|
||||
<FilterForm sx={{ marginTop: '100px' }} />
|
||||
|
||||
{/* The Main Table */}
|
||||
<TableContainer component={Paper}>
|
||||
<Table>
|
||||
<TableBody>
|
||||
<TableRow>
|
||||
<TableCell style={headStyle} align="left" />
|
||||
<TableCell style={headStyle} align="left">
|
||||
Tanggal Pemesanan
|
||||
</TableCell>
|
||||
<TableCell style={headStyle} align="left">
|
||||
Tanggal Appointment
|
||||
</TableCell>
|
||||
<TableCell style={headStyle} align="left">
|
||||
Kode Booking
|
||||
</TableCell>
|
||||
<TableCell style={headStyle} align="left">
|
||||
Pasien
|
||||
</TableCell>
|
||||
<TableCell style={headStyle} align="left">
|
||||
Faskes
|
||||
</TableCell>
|
||||
<TableCell style={headStyle} align="left">
|
||||
Dokter
|
||||
</TableCell>
|
||||
<TableCell style={headStyle} align="left">
|
||||
Jenis
|
||||
</TableCell>
|
||||
<TableCell style={headStyle} align="left">
|
||||
Status Appointment
|
||||
</TableCell>
|
||||
<TableCell style={headStyle} align="left" />
|
||||
|
||||
{/* <TableCell style={headStyle} align="center">
|
||||
Aksi
|
||||
</TableCell> */}
|
||||
</TableRow>
|
||||
</TableBody>
|
||||
{dataTableIsLoading ? (
|
||||
<TableBody>
|
||||
<TableRow>
|
||||
<TableCell colSpan={8} align="center">
|
||||
Loading
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
</TableBody>
|
||||
) : dataTableData.data.length == 0 ? (
|
||||
<TableBody>
|
||||
<TableRow>
|
||||
<TableCell colSpan={8} align="center">
|
||||
No Data
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
</TableBody>
|
||||
) : (
|
||||
<TableBody>
|
||||
{dataTableData.data.map((row) => (
|
||||
<Row key={row.id} row={row} />
|
||||
))}
|
||||
</TableBody>
|
||||
)}
|
||||
</Table>
|
||||
</TableContainer>
|
||||
|
||||
<BasePagination paginationData={dataTableData} onPageChange={handlePageChange} />
|
||||
</Card>
|
||||
</Stack>
|
||||
);
|
||||
}
|
||||
53
frontend/dashboard/src/pages/Report/Appointments/Show.tsx
Normal file
53
frontend/dashboard/src/pages/Report/Appointments/Show.tsx
Normal file
@@ -0,0 +1,53 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
import { paramCase } from 'change-case';
|
||||
import { useParams, useLocation } from 'react-router-dom';
|
||||
// @mui
|
||||
import { Container, Stack } from '@mui/material';
|
||||
import useSettings from '../../../hooks/useSettings';
|
||||
import Page from '../../../components/Page';
|
||||
import View from './View';
|
||||
import HeaderBreadcrumbs from '../../../components/HeaderBreadcrumbs';
|
||||
import axios from '../../../utils/axios';
|
||||
import { Appointment } from '../../../@types/doctor';
|
||||
|
||||
export default function Create() {
|
||||
const { themeStretch } = useSettings();
|
||||
const { id } = useParams();
|
||||
|
||||
const isEdit = id ? true : false;
|
||||
|
||||
const [currentAppointment, setCurrentAppointment] = useState<Appointment>();
|
||||
|
||||
useEffect(() => {
|
||||
if (isEdit) {
|
||||
axios.get('/appointments/' + id).then((res) => {
|
||||
setCurrentAppointment(res.data);
|
||||
});
|
||||
}
|
||||
}, [id]);
|
||||
|
||||
return (
|
||||
<Page title="Appointment">
|
||||
<Container maxWidth={themeStretch ? false : 'xl'}>
|
||||
<Stack direction="row" alignItems="center">
|
||||
<HeaderBreadcrumbs
|
||||
heading={!isEdit ? 'Appointment' : 'Appointment'}
|
||||
links={[
|
||||
{ name: 'Report', href: '/report' },
|
||||
{
|
||||
name: 'Appointments',
|
||||
href: '/report/appointments',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</Stack>
|
||||
|
||||
<View
|
||||
// isSubmitting={isSubmitting}
|
||||
isEdit={isEdit}
|
||||
currentAppointment={currentAppointment}
|
||||
/>
|
||||
</Container>
|
||||
</Page>
|
||||
);
|
||||
}
|
||||
275
frontend/dashboard/src/pages/Report/Appointments/View.tsx
Normal file
275
frontend/dashboard/src/pages/Report/Appointments/View.tsx
Normal file
@@ -0,0 +1,275 @@
|
||||
import * as Yup from 'yup';
|
||||
import { useSnackbar } from 'notistack';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||
import MenuItem from '@mui/material/MenuItem';
|
||||
|
||||
import Select, { SelectChangeEvent } from '@mui/material/Select';
|
||||
import * as React from 'react';
|
||||
|
||||
// form
|
||||
import { useForm } from 'react-hook-form';
|
||||
import { yupResolver } from '@hookform/resolvers/yup';
|
||||
// @mui
|
||||
import { styled } from '@mui/material/styles';
|
||||
import { LoadingButton } from '@mui/lab';
|
||||
import {
|
||||
Box,
|
||||
Avatar,
|
||||
Button,
|
||||
ButtonGroup,
|
||||
Card,
|
||||
FormHelperText,
|
||||
Grid,
|
||||
Stack,
|
||||
Typography,
|
||||
TextField,
|
||||
Chip,
|
||||
Badge,
|
||||
Divider,
|
||||
} from '@mui/material';
|
||||
|
||||
import CancelIcon from '@mui/icons-material/Cancel';
|
||||
|
||||
// components
|
||||
import {
|
||||
FormProvider,
|
||||
RHFTextField,
|
||||
RHFRadioGroup,
|
||||
RHFUploadAvatar,
|
||||
RHFSwitch,
|
||||
RHFEditor,
|
||||
RHFDatepicker,
|
||||
RHFMultiCheckbox,
|
||||
RHFCheckbox,
|
||||
RHFCustomMultiCheckbox,
|
||||
} from '../../../components/hook-form';
|
||||
import axios from '../../../utils/axios';
|
||||
import { fCurrency } from '../../../utils/formatNumber';
|
||||
import { Appointment } from '../../../@types/doctor';
|
||||
|
||||
import { Label, Rowing, Spa } from '@mui/icons-material';
|
||||
import { border } from '@mui/system';
|
||||
|
||||
const LabelStyle = styled(Typography)(({ theme }) => ({
|
||||
...theme.typography.subtitle2,
|
||||
color: theme.palette.text.secondary,
|
||||
marginBottom: theme.spacing(1),
|
||||
}));
|
||||
|
||||
const HeaderStyle = styled('header')(({ theme }) => ({
|
||||
paddingBottom: theme.spacing(5),
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'space-between',
|
||||
}));
|
||||
|
||||
const Title = styled(Typography)(({ theme }) => ({
|
||||
...theme.typography.h4,
|
||||
boxShadow: 'none',
|
||||
// paddingBottom: theme.spacing(3),
|
||||
fontWeight: 700,
|
||||
color: '#005B7F',
|
||||
}));
|
||||
|
||||
interface FormValuesProps extends Partial<Appointment> {
|
||||
taxes: boolean;
|
||||
inStock: boolean;
|
||||
}
|
||||
|
||||
type Props = {
|
||||
isEdit: boolean;
|
||||
currentAppointment?: Appointment;
|
||||
};
|
||||
|
||||
const Span = styled(Typography)(({ theme }) => ({
|
||||
boxShadow: 'none',
|
||||
paddingBottom: theme.spacing(1),
|
||||
}));
|
||||
|
||||
const Text = styled(Typography)(({ theme }) => ({
|
||||
boxShadow: 'none',
|
||||
paddingBottom: theme.spacing(3),
|
||||
}));
|
||||
|
||||
export default function AppointmentForm({ isEdit, currentAppointment }: Props) {
|
||||
const navigate = useNavigate();
|
||||
|
||||
// const [ errors, setErrors ] = useState<{ [key: string]: string }>({});
|
||||
|
||||
const { enqueueSnackbar } = useSnackbar();
|
||||
|
||||
const NewCorporateSchema = Yup.object().shape({
|
||||
name: Yup.string().required('Name is required'),
|
||||
// file: Yup.boolean().required('Corporate Status is required'),
|
||||
});
|
||||
|
||||
const defaultValues = useMemo(
|
||||
() => ({
|
||||
id: currentAppointment?.id,
|
||||
name: currentAppointment?.name || '',
|
||||
address: currentAppointment?.address || '',
|
||||
birth_date: currentAppointment?.birth_date || '',
|
||||
gender: currentAppointment?.gender || '',
|
||||
description: currentAppointment?.description || '',
|
||||
birth_place: currentAppointment?.birth_place || '',
|
||||
active: currentAppointment?.active === 1 ? true : false,
|
||||
avatar_url: currentAppointment?.avatar_url || '',
|
||||
doctor_id: currentAppointment?.doctor_id || '',
|
||||
organizations: currentAppointment?.organizations || [],
|
||||
specialities: currentAppointment?.specialities || [],
|
||||
}),
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
[currentAppointment]
|
||||
);
|
||||
|
||||
const methods = useForm<FormValuesProps>({
|
||||
resolver: yupResolver(NewCorporateSchema),
|
||||
defaultValues,
|
||||
});
|
||||
|
||||
const {
|
||||
reset,
|
||||
watch,
|
||||
control,
|
||||
setValue,
|
||||
getValues,
|
||||
setError,
|
||||
handleSubmit,
|
||||
formState: { isSubmitting },
|
||||
} = methods;
|
||||
|
||||
const values = watch();
|
||||
|
||||
useEffect(() => {
|
||||
if (isEdit && currentAppointment) {
|
||||
reset(defaultValues);
|
||||
}
|
||||
if (!isEdit) {
|
||||
reset(defaultValues);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [isEdit, currentAppointment]);
|
||||
|
||||
return (
|
||||
<FormProvider methods={methods}>
|
||||
<Stack spacing={3}>
|
||||
<Box sx={{ width: '100%' }}>
|
||||
{/* <Stack spacing={3}> */}
|
||||
<Card sx={{ p: 5 }}>
|
||||
<HeaderStyle>
|
||||
<Grid item xs={6} md={6}>
|
||||
<Stack
|
||||
direction="row"
|
||||
divider={<Divider orientation="vertical" flexItem />}
|
||||
spacing={2}
|
||||
>
|
||||
<Title>Data Appointment</Title>
|
||||
<Chip label={currentAppointment?.status} variant="outlined" />
|
||||
</Stack>
|
||||
</Grid>
|
||||
</HeaderStyle>
|
||||
|
||||
<Grid container rowSpacing={1} columnSpacing={{ xs: 1, sm: 2, md: 3 }}>
|
||||
<Grid item xs={12}>
|
||||
<Stack direction="row" spacing={2}>
|
||||
<Grid item xs={6}>
|
||||
<Stack direction="row" spacing={2}>
|
||||
<Span style={{ fontWeight: 'bold' }}>Tanggal Booking :</Span>
|
||||
<Text>
|
||||
{currentAppointment?.date_created ? currentAppointment?.date_created : '-'}
|
||||
</Text>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={6}>
|
||||
<Stack direction="row" spacing={2}>
|
||||
<Span style={{ fontWeight: 'bold' }}>Tanggal Appointment :</Span>
|
||||
<Text>
|
||||
{currentAppointment?.date_appointment
|
||||
? currentAppointment?.date_appointment
|
||||
: '-'}
|
||||
</Text>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={6}>
|
||||
<Span style={{ fontWeight: 'bold' }}>Nama Dokter</Span>
|
||||
<Text>
|
||||
{currentAppointment?.doctor_name ? currentAppointment?.doctor_name : '-'}
|
||||
</Text>
|
||||
<Span style={{ fontWeight: 'bold' }}>Faskes</Span>
|
||||
<Text>
|
||||
{currentAppointment?.health_care ? currentAppointment?.health_care : '-'}
|
||||
</Text>
|
||||
</Grid>
|
||||
<Grid item xs={6} columnSpacing={{ xs: 1, sm: 2, md: 3 }}>
|
||||
<Span style={{ fontWeight: 'bold' }}>Spesialis</Span>
|
||||
<Text>{currentAppointment?.speciality ? currentAppointment?.speciality : '-'}</Text>
|
||||
<Span style={{ fontWeight: 'bold' }}>Appointment Via Web/App</Span>
|
||||
<Text>
|
||||
{currentAppointment?.appointment_media
|
||||
? currentAppointment?.appointment_media
|
||||
: '-'}
|
||||
</Text>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Card>
|
||||
<Card sx={{ mt: 5, p: 5 }}>
|
||||
<HeaderStyle>
|
||||
<Grid item xs={6} md={6}>
|
||||
<Title>Data Pembayaran</Title>
|
||||
</Grid>
|
||||
</HeaderStyle>
|
||||
|
||||
{currentAppointment?.payment_detail !== null ? (
|
||||
<Grid container rowSpacing={1} columnSpacing={{ xs: 1, sm: 2, md: 3 }}>
|
||||
<Grid item xs={6}>
|
||||
<Span style={{ fontWeight: 'bold' }}>Metode Pembayaran</Span>
|
||||
<Text>
|
||||
{currentAppointment?.payment_method ? currentAppointment?.payment_method : '-'}
|
||||
</Text>
|
||||
<Span style={{ fontWeight: 'bold' }}>Harga</Span>
|
||||
<Text>
|
||||
{currentAppointment?.payment_detail?.gross_amount
|
||||
? currentAppointment?.payment_detail?.gross_amount
|
||||
: '-'}
|
||||
</Text>
|
||||
<Span style={{ fontWeight: 'bold' }}>Mata Uang</Span>
|
||||
<Text>
|
||||
{currentAppointment?.payment_detail?.currency
|
||||
? currentAppointment?.payment_detail?.currency
|
||||
: '-'}
|
||||
</Text>
|
||||
</Grid>
|
||||
<Grid item xs={6} columnSpacing={{ xs: 1, sm: 2, md: 3 }}>
|
||||
<Span style={{ fontWeight: 'bold' }}>Tipe Pembayaran</Span>
|
||||
<Text>
|
||||
{currentAppointment?.payment_detail?.payment_type
|
||||
? currentAppointment?.payment_detail?.payment_type
|
||||
: '-'}
|
||||
</Text>
|
||||
<Span style={{ fontWeight: 'bold' }}>Waktu Transaksi</Span>
|
||||
<Text>
|
||||
{currentAppointment?.payment_detail?.transaction_time
|
||||
? currentAppointment?.payment_detail?.transaction_time
|
||||
: '-'}
|
||||
</Text>
|
||||
<Span style={{ fontWeight: 'bold' }}>Status</Span>
|
||||
<Text>
|
||||
{currentAppointment?.payment_detail?.status_message
|
||||
? currentAppointment?.payment_detail?.status_message
|
||||
: '-'}
|
||||
</Text>
|
||||
</Grid>
|
||||
</Grid>
|
||||
) : (
|
||||
<Span>Belum ada pembayaran</Span>
|
||||
)}
|
||||
</Card>
|
||||
</Box>
|
||||
</Stack>
|
||||
</FormProvider>
|
||||
);
|
||||
}
|
||||
93
frontend/dashboard/src/pages/Report/Livechat/Create.tsx
Normal file
93
frontend/dashboard/src/pages/Report/Livechat/Create.tsx
Normal file
@@ -0,0 +1,93 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
import { paramCase } from 'change-case';
|
||||
import { useParams, useLocation } from 'react-router-dom';
|
||||
// @mui
|
||||
import { Container, Stack } from '@mui/material';
|
||||
import useSettings from '../../../hooks/useSettings';
|
||||
import Page from '../../../components/Page';
|
||||
import Form from './Form';
|
||||
import HeaderBreadcrumbs from '../../../components/HeaderBreadcrumbs';
|
||||
import axios from '../../../utils/axios';
|
||||
import { Practitioner } from '../../../@types/doctor';
|
||||
import ButtonBack from '../../../components/ButtonBack';
|
||||
|
||||
export default function Create() {
|
||||
const { themeStretch } = useSettings();
|
||||
const { id } = useParams();
|
||||
|
||||
const isEdit = id ? true : false;
|
||||
|
||||
const [currentPractitioner, setCurrentPractitioner] = useState<Practitioner>();
|
||||
|
||||
useEffect(() => {
|
||||
if (isEdit) {
|
||||
axios.get('/doctors/' + id).then((res) => {
|
||||
setCurrentPractitioner(res.data);
|
||||
});
|
||||
}
|
||||
}, [id]);
|
||||
|
||||
return (
|
||||
<Page title="Membership: Create a new Dokter">
|
||||
<Container maxWidth={themeStretch ? false : 'xl'}>
|
||||
<Stack direction="row" alignItems="center">
|
||||
{/* <ButtonBack /> */}
|
||||
<HeaderBreadcrumbs
|
||||
heading={!isEdit ? 'Manage a new Dokter' : 'Manage Dokter'}
|
||||
links={[
|
||||
{ name: 'Master', href: '/master' },
|
||||
{
|
||||
name: 'Doctors',
|
||||
href: '/master/doctors',
|
||||
},
|
||||
{ name: !isEdit ? 'Create' : currentPractitioner?.name ?? '' },
|
||||
]}
|
||||
/>
|
||||
</Stack>
|
||||
|
||||
<Form
|
||||
// isSubmitting={isSubmitting}
|
||||
isEdit={isEdit}
|
||||
currentPractitioner={currentPractitioner}
|
||||
/>
|
||||
</Container>
|
||||
</Page>
|
||||
);
|
||||
}
|
||||
// const pageTitle = 'Create Data Dokter';
|
||||
// return (
|
||||
// <Page title={pageTitle}>
|
||||
// <Container maxWidth={themeStretch ? false : 'xl'}>
|
||||
// <HeaderBreadcrumbs
|
||||
// heading={pageTitle}
|
||||
// links={[
|
||||
// {
|
||||
// name: 'Master',
|
||||
// href: '/master',
|
||||
// },
|
||||
// {
|
||||
// name: 'Dokter',
|
||||
// href: '/master/organizations/',
|
||||
// },
|
||||
// {
|
||||
// name: 'Create',
|
||||
// href: '/master/organizations/create/',
|
||||
// },
|
||||
// ]}
|
||||
// />
|
||||
|
||||
// <Grid container spacing={2}>
|
||||
// <Grid item xs={12}>
|
||||
// <Card sx={{ p: 2 }}>
|
||||
// <Form
|
||||
// isSubmitting={isSubmitting}
|
||||
// isEdit={isEdit}
|
||||
// currentOrganizations={currentOrganizations}
|
||||
// />
|
||||
// </Card>
|
||||
// </Grid>
|
||||
// </Grid>
|
||||
// </Container>
|
||||
// </Page>
|
||||
// );
|
||||
// }
|
||||
260
frontend/dashboard/src/pages/Report/Livechat/Form.tsx
Normal file
260
frontend/dashboard/src/pages/Report/Livechat/Form.tsx
Normal file
@@ -0,0 +1,260 @@
|
||||
import * as Yup from 'yup';
|
||||
import { useSnackbar } from 'notistack';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||
import MenuItem from '@mui/material/MenuItem';
|
||||
|
||||
import Select, { SelectChangeEvent } from '@mui/material/Select';
|
||||
import * as React from 'react';
|
||||
|
||||
// form
|
||||
import { useForm } from 'react-hook-form';
|
||||
import { yupResolver } from '@hookform/resolvers/yup';
|
||||
// @mui
|
||||
import { styled } from '@mui/material/styles';
|
||||
import { LoadingButton } from '@mui/lab';
|
||||
import {
|
||||
Box,
|
||||
Avatar,
|
||||
Button,
|
||||
ButtonGroup,
|
||||
Card,
|
||||
FormHelperText,
|
||||
Grid,
|
||||
Stack,
|
||||
Typography,
|
||||
TextField,
|
||||
Chip,
|
||||
} from '@mui/material';
|
||||
|
||||
import CancelIcon from '@mui/icons-material/Cancel';
|
||||
|
||||
// components
|
||||
import {
|
||||
FormProvider,
|
||||
RHFTextField,
|
||||
RHFRadioGroup,
|
||||
RHFUploadAvatar,
|
||||
RHFSwitch,
|
||||
RHFEditor,
|
||||
RHFDatepicker,
|
||||
RHFMultiCheckbox,
|
||||
RHFCheckbox,
|
||||
RHFCustomMultiCheckbox,
|
||||
} from '../../../components/hook-form';
|
||||
import axios from '../../../utils/axios';
|
||||
import { fCurrency } from '../../../utils/formatNumber';
|
||||
import { Practitioner } from '../../../@types/doctor';
|
||||
|
||||
import { Label, Rowing } from '@mui/icons-material';
|
||||
|
||||
const LabelStyle = styled(Typography)(({ theme }) => ({
|
||||
...theme.typography.subtitle2,
|
||||
color: theme.palette.text.secondary,
|
||||
marginBottom: theme.spacing(1),
|
||||
}));
|
||||
|
||||
const HeaderStyle = styled('header')(({ theme }) => ({
|
||||
paddingBottom: theme.spacing(5),
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'space-between',
|
||||
}));
|
||||
|
||||
const Title = styled(Typography)(({ theme }) => ({
|
||||
...theme.typography.h4,
|
||||
boxShadow: 'none',
|
||||
// paddingBottom: theme.spacing(3),
|
||||
fontWeight: 700,
|
||||
color: '#005B7F',
|
||||
}));
|
||||
|
||||
interface FormValuesProps extends Partial<Practitioner> {
|
||||
taxes: boolean;
|
||||
inStock: boolean;
|
||||
}
|
||||
|
||||
type Props = {
|
||||
isEdit: boolean;
|
||||
currentPractitioner?: Practitioner;
|
||||
};
|
||||
|
||||
const Span = styled(Typography)(({ theme }) => ({
|
||||
boxShadow: 'none',
|
||||
paddingBottom: theme.spacing(1),
|
||||
}));
|
||||
|
||||
const Text = styled(Typography)(({ theme }) => ({
|
||||
boxShadow: 'none',
|
||||
paddingBottom: theme.spacing(3),
|
||||
}));
|
||||
|
||||
export default function PractitionerForm({ isEdit, currentPractitioner }: Props) {
|
||||
const navigate = useNavigate();
|
||||
const [practitioner_group, setPractitionerGroups] = useState([]);
|
||||
|
||||
// const [ errors, setErrors ] = useState<{ [key: string]: string }>({});
|
||||
|
||||
const { enqueueSnackbar } = useSnackbar();
|
||||
|
||||
const NewCorporateSchema = Yup.object().shape({
|
||||
name: Yup.string().required('Name is required'),
|
||||
// file: Yup.boolean().required('Corporate Status is required'),
|
||||
});
|
||||
|
||||
const defaultValues = useMemo(
|
||||
() => ({
|
||||
id: currentPractitioner?.id,
|
||||
name: currentPractitioner?.name || '',
|
||||
address: currentPractitioner?.address || '',
|
||||
birth_date: currentPractitioner?.birth_date || '',
|
||||
gender: currentPractitioner?.gender || '',
|
||||
description: currentPractitioner?.description || '',
|
||||
birth_place: currentPractitioner?.birth_place || '',
|
||||
active: currentPractitioner?.active === 1 ? true : false,
|
||||
avatar_url: currentPractitioner?.avatar_url || '',
|
||||
doctor_id: currentPractitioner?.doctor_id || '',
|
||||
organizations: currentPractitioner?.organizations || [],
|
||||
specialities: currentPractitioner?.specialities || [],
|
||||
}),
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
[currentPractitioner]
|
||||
);
|
||||
|
||||
console.log('defaultValues', defaultValues);
|
||||
|
||||
function StatusLabel({ value }: { value: boolean }) {
|
||||
return (
|
||||
<Chip
|
||||
label={value ? 'Aktif' : 'Tidak Aktif'}
|
||||
size="medium"
|
||||
sx={{
|
||||
backgroundColor: value ? 'rgba(84, 214, 44, 0.16)' : 'rgba(255, 72, 66, 0.16)',
|
||||
color: value ? '#229A16' : '#B72136',
|
||||
padding: '1 8 1 8 px',
|
||||
borderRadius: '4px',
|
||||
fontSize: '12px',
|
||||
fontWeight: 'bold',
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
const methods = useForm<FormValuesProps>({
|
||||
resolver: yupResolver(NewCorporateSchema),
|
||||
defaultValues,
|
||||
});
|
||||
|
||||
const {
|
||||
reset,
|
||||
watch,
|
||||
control,
|
||||
setValue,
|
||||
getValues,
|
||||
setError,
|
||||
handleSubmit,
|
||||
formState: { isSubmitting },
|
||||
} = methods;
|
||||
|
||||
const values = watch();
|
||||
|
||||
useEffect(() => {
|
||||
if (isEdit && currentPractitioner) {
|
||||
reset(defaultValues);
|
||||
}
|
||||
if (!isEdit) {
|
||||
reset(defaultValues);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [isEdit, currentPractitioner]);
|
||||
|
||||
const handleActivate = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||
setValue('active', event.target.checked);
|
||||
|
||||
console.log('event.target.checked', event.target.checked);
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append('active', event.target.checked ? '1' : '0');
|
||||
formData.append('_method', 'PUT');
|
||||
axios.post('/doctors/' + currentPractitioner?.id ?? '', formData);
|
||||
|
||||
enqueueSnackbar('active Updated Successfully!', { variant: 'success' });
|
||||
};
|
||||
|
||||
return (
|
||||
<FormProvider methods={methods}>
|
||||
<Stack spacing={3}>
|
||||
<Box sx={{ width: '100%' }}>
|
||||
{/* <Stack spacing={3}> */}
|
||||
<Card sx={{ p: 5 }}>
|
||||
<HeaderStyle>
|
||||
<Grid item xs={6} md={6}>
|
||||
<Title>Data Dokter</Title>
|
||||
</Grid>
|
||||
<Grid item xs={6} md={6}>
|
||||
{/* <Typography>Status Rumah Sakit</Typography> */}
|
||||
<RHFSwitch name="active" label="" onClick={handleActivate} />
|
||||
<StatusLabel value={values.active} />
|
||||
</Grid>
|
||||
</HeaderStyle>
|
||||
<Title variant="h5">Informasi Umum</Title>
|
||||
<Avatar
|
||||
alt="Remy Sharp"
|
||||
src={currentPractitioner?.avatar_url}
|
||||
sx={{ width: 120, height: 120, marginBottom: 2 }}
|
||||
/>
|
||||
|
||||
<Grid container rowSpacing={1} columnSpacing={{ xs: 1, sm: 2, md: 3 }}>
|
||||
<Grid item xs={7}>
|
||||
<Span style={{ fontWeight: 'bold' }}>Nama Dokter</Span>
|
||||
<Text>{currentPractitioner?.name ? currentPractitioner?.name : '-'}</Text>
|
||||
<Span style={{ fontWeight: 'bold' }}>No Telp</Span>
|
||||
<Text>{currentPractitioner?.phone ? currentPractitioner?.phone : '-'}</Text>
|
||||
<Span style={{ fontWeight: 'bold' }}>Tempat Lahir</Span>
|
||||
<Text>
|
||||
{currentPractitioner?.birth_place ? currentPractitioner?.birth_place : '-'}
|
||||
</Text>
|
||||
<Span style={{ fontWeight: 'bold' }}>Alamat</Span>
|
||||
<Text>{currentPractitioner?.address ? currentPractitioner?.address : '-'}</Text>
|
||||
</Grid>
|
||||
<Grid item xs={5} columnSpacing={{ xs: 1, sm: 2, md: 3 }}>
|
||||
<Span style={{ fontWeight: 'bold' }}>Jenis Kelamin</Span>
|
||||
<Text>{currentPractitioner?.gender ? currentPractitioner?.gender : '-'}</Text>
|
||||
<Span style={{ fontWeight: 'bold' }}>Email</Span>
|
||||
<Text>{currentPractitioner?.email ? currentPractitioner?.email : '-'}</Text>
|
||||
<Span style={{ fontWeight: 'bold' }}>Tanggal Lahir</Span>
|
||||
<Text>
|
||||
{currentPractitioner?.birth_date ? currentPractitioner?.birth_date : '-'}
|
||||
</Text>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Card>
|
||||
<Card sx={{ p: 5, marginTop: 2 }}>
|
||||
<Title variant="h5">Tempat Praktik</Title>
|
||||
{currentPractitioner?.organizations?.map((item, index) => (
|
||||
<Box key={index} sx={{ mt: 3 }}>
|
||||
<Grid container rowSpacing={1} columnSpacing={{ xs: 1, sm: 2, md: 3 }}>
|
||||
<Grid item xs={7}>
|
||||
<Text>{item.name}</Text>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Box>
|
||||
))}
|
||||
</Card>
|
||||
<Card sx={{ p: 5, marginTop: 2 }}>
|
||||
<Title variant="h5">Spesialisasi</Title>
|
||||
{currentPractitioner?.specialities?.map((item, index) => (
|
||||
<Box key={index} sx={{ mt: 3 }}>
|
||||
<Grid container rowSpacing={1} columnSpacing={{ xs: 1, sm: 2, md: 3 }}>
|
||||
<Grid item xs={7}>
|
||||
<Text>{item.name}</Text>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Box>
|
||||
))}
|
||||
</Card>
|
||||
</Box>
|
||||
</Stack>
|
||||
</FormProvider>
|
||||
);
|
||||
}
|
||||
35
frontend/dashboard/src/pages/Report/Livechat/Index.tsx
Normal file
35
frontend/dashboard/src/pages/Report/Livechat/Index.tsx
Normal file
@@ -0,0 +1,35 @@
|
||||
import { Card, Grid, Container } from '@mui/material';
|
||||
import { useParams } from 'react-router-dom';
|
||||
import HeaderBreadcrumbs from '../../../components/HeaderBreadcrumbs';
|
||||
import Page from '../../../components/Page';
|
||||
import useSettings from '../../../hooks/useSettings';
|
||||
import List from './List';
|
||||
|
||||
export default function Doctors() {
|
||||
const { themeStretch } = useSettings();
|
||||
|
||||
const { id } = useParams();
|
||||
|
||||
const pageTitle = 'Live Chat';
|
||||
return (
|
||||
<Page title={pageTitle}>
|
||||
<Container maxWidth={themeStretch ? false : 'xl'}>
|
||||
<HeaderBreadcrumbs
|
||||
heading={pageTitle}
|
||||
links={[
|
||||
{
|
||||
name: 'Report',
|
||||
href: '/report',
|
||||
},
|
||||
{
|
||||
name: 'Live Chat',
|
||||
href: '/report/live-chat',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
|
||||
<List />
|
||||
</Container>
|
||||
</Page>
|
||||
);
|
||||
}
|
||||
466
frontend/dashboard/src/pages/Report/Livechat/List.tsx
Normal file
466
frontend/dashboard/src/pages/Report/Livechat/List.tsx
Normal file
@@ -0,0 +1,466 @@
|
||||
import {
|
||||
Box,
|
||||
Button,
|
||||
Card,
|
||||
Collapse,
|
||||
Paper,
|
||||
Select,
|
||||
SelectChangeEvent,
|
||||
Table,
|
||||
TableBody,
|
||||
TableCell,
|
||||
TableContainer,
|
||||
TableHead,
|
||||
TableRow,
|
||||
TextField,
|
||||
Typography,
|
||||
Stack,
|
||||
ButtonGroup,
|
||||
Grid,
|
||||
Chip,
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogContentText,
|
||||
DialogActions,
|
||||
FormControl,
|
||||
Autocomplete,
|
||||
InputAdornment,
|
||||
IconButton,
|
||||
} from '@mui/material';
|
||||
|
||||
import {
|
||||
Link,
|
||||
NavLink as RouterLink,
|
||||
useSearchParams,
|
||||
useNavigate,
|
||||
useParams,
|
||||
} from 'react-router-dom';
|
||||
// hooks
|
||||
import React, { ChangeEvent, Component, useEffect, useRef, useState } from 'react';
|
||||
import useSettings from '../../../hooks/useSettings';
|
||||
// components
|
||||
import axios from '../../../utils/axios';
|
||||
import { LaravelPaginatedData } from '../../../@types/paginated-data';
|
||||
import { Icd } from '../../../@types/diagnosis';
|
||||
import BasePagination from '../../../components/BasePagination';
|
||||
import { Practitioner } from '../../../@types/doctor';
|
||||
import CreateIcon from '@mui/icons-material/Create';
|
||||
import { Props } from '../../../components/editor/index';
|
||||
import { red } from '@mui/material/colors';
|
||||
import { margin, padding } from '@mui/system';
|
||||
import { enqueueSnackbar } from 'notistack';
|
||||
import { Controller } from 'react-hook-form';
|
||||
|
||||
import SvgIconStyle from '../../../components/SvgIconStyle';
|
||||
import { GridSearchIcon } from '@mui/x-data-grid';
|
||||
import { Search } from '@mui/icons-material';
|
||||
import { Icon } from '@iconify/react';
|
||||
import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
|
||||
import KeyboardArrowRightIcon from '@mui/icons-material/KeyboardArrowRight';
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
export default function List() {
|
||||
// Generate the every row of the table
|
||||
|
||||
const navigate = useNavigate();
|
||||
const { organization_id } = useParams();
|
||||
const [searchParams, setSearchParams] = useSearchParams();
|
||||
const [searchParamsOrganizations, setSearchParamsOrganizations] = useSearchParams();
|
||||
const [searchParamsSpecialities, setSearchParamsSpecialities] = useSearchParams();
|
||||
const [searchParamsFilter, setSearchParamsFilter] = useSearchParams();
|
||||
|
||||
function Filter(props: any) {
|
||||
// SEARCH
|
||||
const searchInput = useRef<HTMLInputElement>(null);
|
||||
const [searchText, setSearchText] = useState('');
|
||||
|
||||
//handle search
|
||||
const handleSearchChange = (event: any) => {
|
||||
const newSearchText = event.target.value ?? '';
|
||||
setSearchText(newSearchText);
|
||||
};
|
||||
|
||||
const handleSearchSubmit = (event: any) => {
|
||||
event.preventDefault();
|
||||
|
||||
props.onSearch(searchText);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
// Trigger First Search
|
||||
setSearchText(searchParams.get('search') ?? '');
|
||||
}, []);
|
||||
|
||||
const item = [
|
||||
{
|
||||
id: '',
|
||||
value: '',
|
||||
name: 'Semua',
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<form style={{ width: '100%' }}>
|
||||
<Grid container spacing={2} sx={{ justifyContent: 'space-between', alignItems: 'center' }}>
|
||||
<Grid item xs={12} sm={12} md={12} lg={12}>
|
||||
<TextField
|
||||
id="search-input"
|
||||
ref={searchInput}
|
||||
variant="outlined"
|
||||
fullWidth
|
||||
onChange={handleSearchChange}
|
||||
onKeyDown={(event) => {
|
||||
if (event.key === 'Enter') {
|
||||
handleSearchSubmit(event);
|
||||
}
|
||||
}}
|
||||
value={searchText}
|
||||
InputProps={{
|
||||
startAdornment: (
|
||||
<InputAdornment position="start">
|
||||
<Search />
|
||||
</InputAdornment>
|
||||
),
|
||||
placeholder: 'Search',
|
||||
}}
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</form>
|
||||
);
|
||||
}
|
||||
|
||||
function FilterForm(props: any) {
|
||||
// IMPORT
|
||||
return (
|
||||
<Grid
|
||||
container
|
||||
spacing={2}
|
||||
sx={{ p: 2, justifyContent: 'space-between', alignItems: 'center' }}
|
||||
>
|
||||
<Grid item xs={12} md={12} lg={12}>
|
||||
<Filter onSearch={applyItems} />
|
||||
</Grid>
|
||||
</Grid>
|
||||
);
|
||||
}
|
||||
|
||||
function createData(doctor: Practitioner): Practitioner {
|
||||
return {
|
||||
...doctor,
|
||||
};
|
||||
}
|
||||
|
||||
function Row(props: { row: ReturnType<typeof createData> }) {
|
||||
const { row } = props;
|
||||
const [open, setOpen] = React.useState(false);
|
||||
const [openDialog, setOpenDialog] = React.useState(false);
|
||||
|
||||
const handleDelete = (model: any) => {
|
||||
axios
|
||||
.delete(`/doctors/${row.id}`)
|
||||
.then((res) => {
|
||||
setDataTableData({
|
||||
...dataTableData,
|
||||
data: dataTableData.data.filter((model) => model.id != row.id),
|
||||
});
|
||||
enqueueSnackbar('Data berhasil dihapus', { variant: 'success' });
|
||||
})
|
||||
.catch((error) => {
|
||||
enqueueSnackbar(
|
||||
error.response.data.message ?? error.message ?? 'Failed Processing Request',
|
||||
{ variant: 'error' }
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
<TableRow>
|
||||
<TableCell>
|
||||
<IconButton aria-label="expand row" size="small" onClick={() => setOpen(!open)}>
|
||||
{open ? <KeyboardArrowDownIcon /> : <KeyboardArrowRightIcon />}
|
||||
</IconButton>
|
||||
</TableCell>
|
||||
<TableCell align="left">{row.date_created ? row.date_created : '-'}</TableCell>
|
||||
<TableCell align="left">{row.date_appointment ? row.date_appointment : '-'}</TableCell>
|
||||
<TableCell align="left">{row.health_care ? row.health_care : '-'}</TableCell>
|
||||
<TableCell align="left">{row.doctor_name ? row.doctor_name : '-'}</TableCell>
|
||||
<TableCell align="left">{row.speciality ? row.speciality : '-'}</TableCell>
|
||||
<TableCell align="left">{row.appointment_media ? row.appointment_media : '-'}</TableCell>
|
||||
<TableCell align="left">{row.patient_media ? row.patient_media : '-'}</TableCell>
|
||||
<TableCell align="left">{row.doctor_media ? row.doctor_media : '-'}</TableCell>
|
||||
<TableCell align="left">
|
||||
{row.status_appointment ? row.status_appointment : '-'}
|
||||
</TableCell>
|
||||
<TableCell align="left">{row.status_chat ? row.status_chat : '-'}</TableCell>
|
||||
<TableCell align="center">
|
||||
<ButtonGroup variant="text" aria-label="text button group">
|
||||
<Link to={'/report/live-chat/' + row.id + '/show'}>
|
||||
<Button>
|
||||
<Icon icon="ph:eye-bold" style={{ width: '24px', height: '24px' }} />
|
||||
</Button>
|
||||
</Link>
|
||||
</ButtonGroup>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
{/* COLLAPSIBLE ROW */}
|
||||
<TableRow>
|
||||
<TableCell
|
||||
style={{ paddingBottom: 0, paddingTop: 0, backgroundColor: 'rgba(244, 246, 248, 0.5)' }}
|
||||
colSpan={6}
|
||||
>
|
||||
<Collapse in={open} timeout="auto" unmountOnExit>
|
||||
<Box sx={{ margin: 1, pb: 2, pl: 4 }}>
|
||||
<Grid container>
|
||||
<Grid item xs={12} sx={{ padding: 2 }}>
|
||||
<Grid container>
|
||||
<Grid item xs={6}>
|
||||
Metode Pembayaran
|
||||
</Grid>
|
||||
<Grid item xs={6}>
|
||||
: {row.payment_method ? row.payment_method : '-'}
|
||||
</Grid>
|
||||
|
||||
<Grid item xs={6}>
|
||||
Jenis Benefit
|
||||
</Grid>
|
||||
<Grid item xs={6}>
|
||||
: -
|
||||
</Grid>
|
||||
<Grid item xs={6}>
|
||||
Durasi
|
||||
</Grid>
|
||||
<Grid item xs={6}>
|
||||
: {row.duration ? row.duration : '-'}
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Box>
|
||||
</Collapse>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
|
||||
{/* END COLLAPSIBLE ROW */}
|
||||
<Dialog
|
||||
open={openDialog}
|
||||
onClose={() => {
|
||||
setOpenDialog(false);
|
||||
}}
|
||||
aria-labelledby="alert-dialog-title"
|
||||
aria-describedby="alert-dialog-description"
|
||||
>
|
||||
<DialogContent sx={{ p: 5 }}>
|
||||
<Icon
|
||||
icon="eva:trash-2-outline"
|
||||
style={{
|
||||
width: '100px',
|
||||
height: '100px',
|
||||
color: '#FF0000',
|
||||
margin: 'auto',
|
||||
display: 'block',
|
||||
marginBottom: '20px',
|
||||
alignContent: 'center',
|
||||
}}
|
||||
/>
|
||||
<DialogContentText sx={{ fontWeight: 'bold', pb: 1 }} id="alert-dialog-title">
|
||||
Apakah anda yakin ingin menghapus
|
||||
</DialogContentText>
|
||||
<Typography sx={{ fontWeight: 'bold' }} id="alert-dialog-title">
|
||||
{row.name}?
|
||||
</Typography>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button
|
||||
onClick={() => {
|
||||
setOpenDialog(false);
|
||||
}}
|
||||
color="primary"
|
||||
>
|
||||
Batal
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() => {
|
||||
handleDelete(row.id);
|
||||
}}
|
||||
color="primary"
|
||||
autoFocus
|
||||
>
|
||||
Hapus
|
||||
</Button>
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
|
||||
const headStyle = {
|
||||
fontWeight: 'bold',
|
||||
};
|
||||
// Dummy Default Data
|
||||
const [dataTableIsLoading, setDataTableLoading] = useState(true);
|
||||
const [dataTableLastRequest, setDataTableLastRequest] = useState(0);
|
||||
const [dataTableResponseState, setDataTableResponseState] = useState('idle');
|
||||
const [dataTableData, setDataTableData] = useState<LaravelPaginatedData>({
|
||||
current_page: 1,
|
||||
data: [],
|
||||
path: '',
|
||||
first_page_url: '',
|
||||
last_page: 1,
|
||||
last_page_url: '',
|
||||
next_page_url: '',
|
||||
prev_page_url: '',
|
||||
per_page: 10,
|
||||
from: 0,
|
||||
to: 0,
|
||||
total: 0,
|
||||
});
|
||||
const [dataTablePage, setDataTablePage] = useState(5);
|
||||
|
||||
const loadDataTableData = async (appliedFilter: any | null = null) => {
|
||||
setDataTableLoading(true);
|
||||
const filter = appliedFilter ? appliedFilter : Object.fromEntries([...searchParams.entries()]);
|
||||
const response = await axios.get('/live-chat', {
|
||||
params: filter,
|
||||
});
|
||||
setDataTableLoading(false);
|
||||
setDataTableData(response.data);
|
||||
};
|
||||
|
||||
// const applyFilter = async (searchFilter: string) => {
|
||||
// await loadDataTableData({ search: searchFilter });
|
||||
// setSearchParams({ search: searchFilter });
|
||||
// };
|
||||
|
||||
const applyItems = async (
|
||||
searchFilter: string,
|
||||
searchFilterOrganization: string,
|
||||
searchFilterSpecialities: string
|
||||
) => {
|
||||
await loadDataTableData({
|
||||
search: searchFilter,
|
||||
organization_id: searchFilterOrganization,
|
||||
speciality_id: searchFilterSpecialities,
|
||||
});
|
||||
setSearchParamsFilter({
|
||||
search: searchFilter,
|
||||
organization_id: searchFilterOrganization,
|
||||
speciality_id: searchFilterSpecialities,
|
||||
});
|
||||
};
|
||||
|
||||
const handlePageChange = (event: ChangeEvent, value: number) => {
|
||||
const filter = Object.fromEntries([...searchParams.entries(), ['page', value]]);
|
||||
loadDataTableData(filter);
|
||||
setSearchParams(filter);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
loadDataTableData();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<Stack>
|
||||
{/* <Ambulace /> */}
|
||||
|
||||
<Card sx={{ marginTop: '30px' }}>
|
||||
<FilterForm sx={{ marginTop: '100px' }} />
|
||||
|
||||
{/* The Main Table */}
|
||||
<TableContainer component={Paper}>
|
||||
<Table>
|
||||
<TableBody>
|
||||
<TableRow>
|
||||
{/* <TableCell colSpan={8} rowSpan={1} align="center" /> */}
|
||||
<TableCell style={headStyle} align="left" />
|
||||
<TableCell style={headStyle} rowSpan={2} align="left">
|
||||
Tanggal Booking
|
||||
</TableCell>
|
||||
<TableCell style={headStyle} rowSpan={2} align="left">
|
||||
Tanggal Appointment
|
||||
</TableCell>
|
||||
<TableCell style={headStyle} rowSpan={2} align="left">
|
||||
Faskes
|
||||
</TableCell>
|
||||
<TableCell style={headStyle} rowSpan={2} align="left">
|
||||
Nama Dokter
|
||||
</TableCell>
|
||||
<TableCell style={headStyle} rowSpan={2} align="left">
|
||||
Spesialisasi
|
||||
</TableCell>
|
||||
<TableCell style={headStyle} rowSpan={2} align="left">
|
||||
Appointment Via App/Website
|
||||
</TableCell>
|
||||
<TableCell
|
||||
colSpan={2}
|
||||
style={headStyle}
|
||||
align="center"
|
||||
sx={{ borderBottom: '3px solid #d7d7d7' }}
|
||||
>
|
||||
Chat Via App/Website
|
||||
</TableCell>
|
||||
<TableCell style={headStyle} rowSpan={2} align="left">
|
||||
Status Appointment
|
||||
</TableCell>
|
||||
<TableCell style={headStyle} rowSpan={2} align="left">
|
||||
Status Chat
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
<TableRow>
|
||||
<TableCell style={headStyle} align="left" />
|
||||
{/* <TableCell style={headStyle} align="left">
|
||||
Tanggal Booking
|
||||
</TableCell>
|
||||
<TableCell style={headStyle} align="left">
|
||||
Tanggal Appointment
|
||||
</TableCell>
|
||||
<TableCell style={headStyle} align="left">
|
||||
Faskes
|
||||
</TableCell>
|
||||
<TableCell style={headStyle} align="left">
|
||||
Nama Dokter
|
||||
</TableCell>
|
||||
<TableCell style={headStyle} align="left">
|
||||
Spesialisasi
|
||||
</TableCell> */}
|
||||
<TableCell style={headStyle} align="left">
|
||||
Pasien
|
||||
</TableCell>
|
||||
<TableCell style={headStyle} align="left">
|
||||
Dokter
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
</TableBody>
|
||||
{dataTableIsLoading ? (
|
||||
<TableBody>
|
||||
<TableRow>
|
||||
<TableCell colSpan={8} align="center">
|
||||
Loading
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
</TableBody>
|
||||
) : dataTableData.data.length == 0 ? (
|
||||
<TableBody>
|
||||
<TableRow>
|
||||
<TableCell colSpan={8} align="center">
|
||||
No Data
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
</TableBody>
|
||||
) : (
|
||||
<TableBody>
|
||||
{dataTableData.data.map((row) => (
|
||||
<Row key={row.id} row={row} />
|
||||
))}
|
||||
</TableBody>
|
||||
)}
|
||||
</Table>
|
||||
</TableContainer>
|
||||
|
||||
<BasePagination paginationData={dataTableData} onPageChange={handlePageChange} />
|
||||
</Card>
|
||||
</Stack>
|
||||
);
|
||||
}
|
||||
53
frontend/dashboard/src/pages/Report/Livechat/Show.tsx
Normal file
53
frontend/dashboard/src/pages/Report/Livechat/Show.tsx
Normal file
@@ -0,0 +1,53 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
import { paramCase } from 'change-case';
|
||||
import { useParams, useLocation } from 'react-router-dom';
|
||||
// @mui
|
||||
import { Container, Stack } from '@mui/material';
|
||||
import useSettings from '../../../hooks/useSettings';
|
||||
import Page from '../../../components/Page';
|
||||
import View from './View';
|
||||
import HeaderBreadcrumbs from '../../../components/HeaderBreadcrumbs';
|
||||
import axios from '../../../utils/axios';
|
||||
import { Appointment } from '../../../@types/doctor';
|
||||
|
||||
export default function Create() {
|
||||
const { themeStretch } = useSettings();
|
||||
const { id } = useParams();
|
||||
|
||||
const isEdit = id ? true : false;
|
||||
|
||||
const [currentAppointment, setCurrentAppointment] = useState<Appointment>();
|
||||
|
||||
useEffect(() => {
|
||||
if (isEdit) {
|
||||
axios.get('/live-chat/' + id).then((res) => {
|
||||
setCurrentAppointment(res.data);
|
||||
});
|
||||
}
|
||||
}, [id]);
|
||||
|
||||
return (
|
||||
<Page title="Live Chat">
|
||||
<Container maxWidth={themeStretch ? false : 'xl'}>
|
||||
<Stack direction="row" alignItems="center">
|
||||
<HeaderBreadcrumbs
|
||||
heading={!isEdit ? 'Live Chat' : 'Live Chat'}
|
||||
links={[
|
||||
{ name: 'Report', href: '/report' },
|
||||
{
|
||||
name: 'Live Chat',
|
||||
href: '/report/live-chat',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</Stack>
|
||||
|
||||
<View
|
||||
// isSubmitting={isSubmitting}
|
||||
isEdit={isEdit}
|
||||
currentAppointment={currentAppointment}
|
||||
/>
|
||||
</Container>
|
||||
</Page>
|
||||
);
|
||||
}
|
||||
309
frontend/dashboard/src/pages/Report/Livechat/View.tsx
Normal file
309
frontend/dashboard/src/pages/Report/Livechat/View.tsx
Normal file
@@ -0,0 +1,309 @@
|
||||
import * as Yup from 'yup';
|
||||
import { useSnackbar } from 'notistack';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||
import MenuItem from '@mui/material/MenuItem';
|
||||
|
||||
import Select, { SelectChangeEvent } from '@mui/material/Select';
|
||||
import * as React from 'react';
|
||||
|
||||
// form
|
||||
import { useForm } from 'react-hook-form';
|
||||
import { yupResolver } from '@hookform/resolvers/yup';
|
||||
// @mui
|
||||
import { styled } from '@mui/material/styles';
|
||||
import { LoadingButton } from '@mui/lab';
|
||||
import {
|
||||
Box,
|
||||
Avatar,
|
||||
Button,
|
||||
ButtonGroup,
|
||||
Card,
|
||||
FormHelperText,
|
||||
Grid,
|
||||
Stack,
|
||||
Typography,
|
||||
TextField,
|
||||
Chip,
|
||||
Badge,
|
||||
Divider,
|
||||
} from '@mui/material';
|
||||
|
||||
import CancelIcon from '@mui/icons-material/Cancel';
|
||||
|
||||
// components
|
||||
import {
|
||||
FormProvider,
|
||||
RHFTextField,
|
||||
RHFRadioGroup,
|
||||
RHFUploadAvatar,
|
||||
RHFSwitch,
|
||||
RHFEditor,
|
||||
RHFDatepicker,
|
||||
RHFMultiCheckbox,
|
||||
RHFCheckbox,
|
||||
RHFCustomMultiCheckbox,
|
||||
} from '../../../components/hook-form';
|
||||
import axios from '../../../utils/axios';
|
||||
import { fCurrency } from '../../../utils/formatNumber';
|
||||
import { Appointment } from '../../../@types/doctor';
|
||||
|
||||
import { Label, Rowing, Spa } from '@mui/icons-material';
|
||||
import { border, padding } from '@mui/system';
|
||||
|
||||
const LabelStyle = styled(Typography)(({ theme }) => ({
|
||||
...theme.typography.subtitle2,
|
||||
color: theme.palette.text.secondary,
|
||||
marginBottom: theme.spacing(1),
|
||||
}));
|
||||
|
||||
const HeaderStyle = styled('header')(({ theme }) => ({
|
||||
paddingBottom: theme.spacing(5),
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'space-between',
|
||||
}));
|
||||
|
||||
const Title = styled(Typography)(({ theme }) => ({
|
||||
...theme.typography.h4,
|
||||
boxShadow: 'none',
|
||||
// paddingBottom: theme.spacing(3),
|
||||
fontWeight: 700,
|
||||
color: '#005B7F',
|
||||
}));
|
||||
|
||||
interface FormValuesProps extends Partial<Appointment> {
|
||||
taxes: boolean;
|
||||
inStock: boolean;
|
||||
}
|
||||
|
||||
type Props = {
|
||||
isEdit: boolean;
|
||||
currentAppointment?: Appointment;
|
||||
};
|
||||
|
||||
const Span = styled(Typography)(({ theme }) => ({
|
||||
boxShadow: 'none',
|
||||
paddingBottom: theme.spacing(1),
|
||||
}));
|
||||
|
||||
const Text = styled(Typography)(({ theme }) => ({
|
||||
boxShadow: 'none',
|
||||
paddingBottom: theme.spacing(3),
|
||||
}));
|
||||
|
||||
export default function AppointmentForm({ isEdit, currentAppointment }: Props) {
|
||||
const navigate = useNavigate();
|
||||
|
||||
// const [ errors, setErrors ] = useState<{ [key: string]: string }>({});
|
||||
|
||||
const { enqueueSnackbar } = useSnackbar();
|
||||
|
||||
const NewCorporateSchema = Yup.object().shape({
|
||||
name: Yup.string().required('Name is required'),
|
||||
// file: Yup.boolean().required('Corporate Status is required'),
|
||||
});
|
||||
|
||||
const defaultValues = useMemo(
|
||||
() => ({
|
||||
id: currentAppointment?.id,
|
||||
name: currentAppointment?.name || '',
|
||||
address: currentAppointment?.address || '',
|
||||
birth_date: currentAppointment?.birth_date || '',
|
||||
gender: currentAppointment?.gender || '',
|
||||
description: currentAppointment?.description || '',
|
||||
birth_place: currentAppointment?.birth_place || '',
|
||||
active: currentAppointment?.active === 1 ? true : false,
|
||||
avatar_url: currentAppointment?.avatar_url || '',
|
||||
doctor_id: currentAppointment?.doctor_id || '',
|
||||
organizations: currentAppointment?.organizations || [],
|
||||
specialities: currentAppointment?.specialities || [],
|
||||
}),
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
[currentAppointment]
|
||||
);
|
||||
|
||||
const methods = useForm<FormValuesProps>({
|
||||
resolver: yupResolver(NewCorporateSchema),
|
||||
defaultValues,
|
||||
});
|
||||
|
||||
const {
|
||||
reset,
|
||||
watch,
|
||||
control,
|
||||
setValue,
|
||||
getValues,
|
||||
setError,
|
||||
handleSubmit,
|
||||
formState: { isSubmitting },
|
||||
} = methods;
|
||||
|
||||
const values = watch();
|
||||
|
||||
useEffect(() => {
|
||||
if (isEdit && currentAppointment) {
|
||||
reset(defaultValues);
|
||||
}
|
||||
if (!isEdit) {
|
||||
reset(defaultValues);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [isEdit, currentAppointment]);
|
||||
|
||||
return (
|
||||
<FormProvider methods={methods}>
|
||||
<Stack spacing={3}>
|
||||
<Box sx={{ width: '100%' }}>
|
||||
{/* <Stack spacing={3}> */}
|
||||
<Card sx={{ p: 5 }}>
|
||||
<HeaderStyle>
|
||||
<Grid item xs={6} md={6}>
|
||||
<Stack
|
||||
direction="row"
|
||||
divider={<Divider orientation="vertical" flexItem />}
|
||||
spacing={2}
|
||||
>
|
||||
<Title>Data Live Chat</Title>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</HeaderStyle>
|
||||
|
||||
<Grid container rowSpacing={1} columnSpacing={{ xs: 1, sm: 2, md: 3 }}>
|
||||
<Grid item xs={12}>
|
||||
<Stack direction="row" spacing={2}>
|
||||
<Grid item xs={6}>
|
||||
<Stack direction="row" spacing={2} alignItems="center">
|
||||
<Span style={{ fontWeight: 'bold', paddingBottom: '0px' }}>
|
||||
Status Appointment :
|
||||
</Span>
|
||||
<Chip
|
||||
label={
|
||||
currentAppointment?.status_appointment
|
||||
? currentAppointment?.status_appointment
|
||||
: '-'
|
||||
}
|
||||
variant="outlined"
|
||||
/>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={6}>
|
||||
<Stack direction="row" spacing={2} alignItems="center">
|
||||
<Span style={{ fontWeight: 'bold', paddingBottom: '0px' }}>
|
||||
Status Chat :
|
||||
</Span>
|
||||
<Chip
|
||||
label={
|
||||
currentAppointment?.status_chat ? currentAppointment?.status_chat : '-'
|
||||
}
|
||||
variant="outlined"
|
||||
/>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={12} sx={{ marginTop: '20px' }}>
|
||||
<Stack direction="row" spacing={2}>
|
||||
<Grid item xs={6}>
|
||||
<Stack direction="row" spacing={2}>
|
||||
<Span style={{ fontWeight: 'bold' }}>Tanggal Booking :</Span>
|
||||
<Text>
|
||||
{currentAppointment?.date_created ? currentAppointment?.date_created : '-'}
|
||||
</Text>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={6}>
|
||||
<Stack direction="row" spacing={2}>
|
||||
<Span style={{ fontWeight: 'bold' }}>Tanggal Appointment :</Span>
|
||||
<Text>
|
||||
{currentAppointment?.date_appointment
|
||||
? currentAppointment?.date_appointment
|
||||
: '-'}
|
||||
</Text>
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Stack>
|
||||
</Grid>
|
||||
|
||||
<Grid item xs={6}>
|
||||
<Span style={{ fontWeight: 'bold' }}>Nama Dokter</Span>
|
||||
<Text>
|
||||
{currentAppointment?.doctor_name ? currentAppointment?.doctor_name : '-'}
|
||||
</Text>
|
||||
<Span style={{ fontWeight: 'bold' }}>Faskes</Span>
|
||||
<Text>
|
||||
{currentAppointment?.health_care ? currentAppointment?.health_care : '-'}
|
||||
</Text>
|
||||
<Span style={{ fontWeight: 'bold' }}>Durasi</Span>
|
||||
<Text>{currentAppointment?.duration ? currentAppointment?.duration : '-'}</Text>
|
||||
</Grid>
|
||||
<Grid item xs={6} columnSpacing={{ xs: 1, sm: 2, md: 3 }}>
|
||||
<Span style={{ fontWeight: 'bold' }}>Spesialis</Span>
|
||||
<Text>{currentAppointment?.speciality ? currentAppointment?.speciality : '-'}</Text>
|
||||
<Span style={{ fontWeight: 'bold' }}>Appointment Via Web/App</Span>
|
||||
<Text>
|
||||
{currentAppointment?.appointment_media
|
||||
? currentAppointment?.appointment_media
|
||||
: '-'}
|
||||
</Text>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Card>
|
||||
<Card sx={{ mt: 5, p: 5 }}>
|
||||
<HeaderStyle>
|
||||
<Grid item xs={6} md={6}>
|
||||
<Title>Data Pembayaran</Title>
|
||||
</Grid>
|
||||
</HeaderStyle>
|
||||
|
||||
{currentAppointment?.payment_detail !== null ? (
|
||||
<Grid container rowSpacing={1} columnSpacing={{ xs: 1, sm: 2, md: 3 }}>
|
||||
<Grid item xs={6}>
|
||||
<Span style={{ fontWeight: 'bold' }}>Metode Pembayaran</Span>
|
||||
<Text>
|
||||
{currentAppointment?.payment_method ? currentAppointment?.payment_method : '-'}
|
||||
</Text>
|
||||
<Span style={{ fontWeight: 'bold' }}>Harga</Span>
|
||||
<Text>
|
||||
{currentAppointment?.payment_detail?.gross_amount
|
||||
? currentAppointment?.payment_detail?.gross_amount
|
||||
: '-'}
|
||||
</Text>
|
||||
<Span style={{ fontWeight: 'bold' }}>Mata Uang</Span>
|
||||
<Text>
|
||||
{currentAppointment?.payment_detail?.currency
|
||||
? currentAppointment?.payment_detail?.currency
|
||||
: '-'}
|
||||
</Text>
|
||||
</Grid>
|
||||
<Grid item xs={6} columnSpacing={{ xs: 1, sm: 2, md: 3 }}>
|
||||
<Span style={{ fontWeight: 'bold' }}>Tipe Pembayaran</Span>
|
||||
<Text>
|
||||
{currentAppointment?.payment_detail?.payment_type
|
||||
? currentAppointment?.payment_detail?.payment_type
|
||||
: '-'}
|
||||
</Text>
|
||||
<Span style={{ fontWeight: 'bold' }}>Waktu Transaksi</Span>
|
||||
<Text>
|
||||
{currentAppointment?.payment_detail?.transaction_time
|
||||
? currentAppointment?.payment_detail?.transaction_time
|
||||
: '-'}
|
||||
</Text>
|
||||
<Span style={{ fontWeight: 'bold' }}>Status</Span>
|
||||
<Text>
|
||||
{currentAppointment?.payment_detail?.status_message
|
||||
? currentAppointment?.payment_detail?.status_message
|
||||
: '-'}
|
||||
</Text>
|
||||
</Grid>
|
||||
</Grid>
|
||||
) : (
|
||||
<Span>Belum ada pembayaran</Span>
|
||||
)}
|
||||
</Card>
|
||||
</Box>
|
||||
</Stack>
|
||||
</FormProvider>
|
||||
);
|
||||
}
|
||||
@@ -194,10 +194,26 @@ export default function Router() {
|
||||
path: 'master/doctors',
|
||||
element: <MasterDoctors />,
|
||||
},
|
||||
{
|
||||
path: 'master/doctors/create',
|
||||
element: <MasterDoctorsCreate />,
|
||||
},
|
||||
{
|
||||
path: 'master/doctors/:id/edit',
|
||||
element: <MasterDoctorsCreate />,
|
||||
},
|
||||
{
|
||||
path: 'master/hospitals',
|
||||
element: <MasterHospitals />,
|
||||
},
|
||||
{
|
||||
path: 'master/hospitals/create',
|
||||
element: <MasterHospitalsCreate />,
|
||||
},
|
||||
{
|
||||
path: 'master/hospitals/:id/edit',
|
||||
element: <MasterHospitalsCreate />,
|
||||
},
|
||||
{
|
||||
path: 'master/diagnosis',
|
||||
element: <MasterDiagnosis />,
|
||||
@@ -217,6 +233,39 @@ export default function Router() {
|
||||
element: <MasterFormulariumCreate />,
|
||||
},
|
||||
|
||||
{
|
||||
path: 'report/appointments',
|
||||
element: <Appointment />,
|
||||
},
|
||||
{
|
||||
path: 'report/appointments/:id',
|
||||
element: <AppointmentCreate />,
|
||||
},
|
||||
{
|
||||
path: 'report/appointments/:id/show',
|
||||
element: <AppointmentShow />,
|
||||
},
|
||||
{
|
||||
path: 'report/appointments/:id/edit',
|
||||
element: <AppointmentCreate />,
|
||||
},
|
||||
{
|
||||
path: 'report/live-chat',
|
||||
element: <Livechat />,
|
||||
},
|
||||
{
|
||||
path: 'report/live-chat/:id',
|
||||
element: <LivechatCreate />,
|
||||
},
|
||||
{
|
||||
path: 'report/live-chat/:id/show',
|
||||
element: <LivechatShow />,
|
||||
},
|
||||
{
|
||||
path: 'report/live-chat/:id/edit',
|
||||
element: <LivechatCreate />,
|
||||
},
|
||||
|
||||
{
|
||||
path: 'claims',
|
||||
element: <Claims />,
|
||||
@@ -320,7 +369,17 @@ const CorporateFormularium = Loadable(lazy(() => import('../pages/Corporates/For
|
||||
|
||||
const MasterDiagnosis = Loadable(lazy(() => import('../pages/Master/Diagnosis/Index')));
|
||||
const MasterDoctors = Loadable(lazy(() => import('../pages/Master/Doctors/Index')));
|
||||
const MasterDoctorsCreate = Loadable(lazy(() => import('../pages/Master/Doctors/Create')));
|
||||
const MasterHospitals = Loadable(lazy(() => import('../pages/Master/Hospitals/Index')));
|
||||
const MasterHospitalsCreate = Loadable(lazy(() => import('../pages/Master/Hospitals/Create')));
|
||||
|
||||
const Appointment = Loadable(lazy(() => import('../pages/Report/Appointments/Index')));
|
||||
const AppointmentCreate = Loadable(lazy(() => import('../pages/Report/Appointments/Create')));
|
||||
const AppointmentShow = Loadable(lazy(() => import('../pages/Report/Appointments/Show')));
|
||||
|
||||
const Livechat = Loadable(lazy(() => import('../pages/Report/Livechat/Index')));
|
||||
const LivechatCreate = Loadable(lazy(() => import('../pages/Report/Livechat/Create')));
|
||||
const LivechatShow = Loadable(lazy(() => import('../pages/Report/Livechat/Show')));
|
||||
|
||||
const MasterDrug = Loadable(lazy(() => import('../pages/Master/Drug/Index')));
|
||||
|
||||
|
||||
@@ -36,8 +36,8 @@ export const colorPresets = [
|
||||
name: 'blue',
|
||||
lighter: '#D1E9FC',
|
||||
light: '#76B0F1',
|
||||
main: '#2065D1',
|
||||
dark: '#103996',
|
||||
main: '#006a35',
|
||||
dark: '#004422',
|
||||
darker: '#061B64',
|
||||
contrastText: '#fff',
|
||||
},
|
||||
@@ -63,7 +63,7 @@ export const colorPresets = [
|
||||
},
|
||||
];
|
||||
|
||||
export const defaultPreset = colorPresets[0];
|
||||
export const defaultPreset = colorPresets[3];
|
||||
export const purplePreset = colorPresets[1];
|
||||
export const cyanPreset = colorPresets[2];
|
||||
export const bluePreset = colorPresets[3];
|
||||
|
||||
@@ -1,4 +1,12 @@
|
||||
<IfModule mod_rewrite.c>
|
||||
|
||||
RewriteEngine On
|
||||
RewriteBase /
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteRule (.*) /index.html [QSA,L]
|
||||
</IfModule>
|
||||
|
||||
<IfModule pagespeed_module>
|
||||
ModPagespeed off
|
||||
</IfModule>
|
||||
@@ -1 +1 @@
|
||||
import{aw as m,c as w,j as r,g as L,a as y,s as u,av as T,b as v,_ as c,r as h,u as C,e as I,f as $,h as b,i as D}from"./index.b24f7692.js";import{f as B}from"./TableRow.eae87b2d.js";const R={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:-1,overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"},k=R,M=m(),P=M,j=w(r("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"}),"ArrowDownward");function N(o){return y("MuiTableSortLabel",o)}const U=L("MuiTableSortLabel",["root","active","icon","iconDirectionDesc","iconDirectionAsc"]),i=U,_=["active","children","className","direction","hideSortIcon","IconComponent"],z=o=>{const{classes:e,direction:t,active:a}=o,s={root:["root",a&&"active"],icon:["icon",`iconDirection${v(t)}`]};return D(s,N,e)},A=u(T,{name:"MuiTableSortLabel",slot:"Root",overridesResolver:(o,e)=>{const{ownerState:t}=o;return[e.root,t.active&&e.active]}})(({theme:o})=>({cursor:"pointer",display:"inline-flex",justifyContent:"flex-start",flexDirection:"inherit",alignItems:"center","&:focus":{color:(o.vars||o).palette.text.secondary},"&:hover":{color:(o.vars||o).palette.text.secondary,[`& .${i.icon}`]:{opacity:.5}},[`&.${i.active}`]:{color:(o.vars||o).palette.text.primary,[`& .${i.icon}`]:{opacity:1,color:(o.vars||o).palette.text.secondary}}})),H=u("span",{name:"MuiTableSortLabel",slot:"Icon",overridesResolver:(o,e)=>{const{ownerState:t}=o;return[e.icon,e[`iconDirection${v(t.direction)}`]]}})(({theme:o,ownerState:e})=>c({fontSize:18,marginRight:4,marginLeft:4,opacity:0,transition:o.transitions.create(["opacity","transform"],{duration:o.transitions.duration.shorter}),userSelect:"none"},e.direction==="desc"&&{transform:"rotate(0deg)"},e.direction==="asc"&&{transform:"rotate(180deg)"})),O=h.exports.forwardRef(function(e,t){const a=C({props:e,name:"MuiTableSortLabel"}),{active:s=!1,children:f,className:S,direction:x="asc",hideSortIcon:l=!1,IconComponent:d=j}=a,g=I(a,_),n=c({},a,{active:s,direction:x,hideSortIcon:l,IconComponent:d}),p=z(n);return $(A,c({className:b(p.root,S),component:"span",disableRipple:!0,ownerState:n,ref:t},g,{children:[f,l&&!s?null:r(H,{as:d,className:b(p.icon),ownerState:n})]}))}),q=O;function E({count:o,onPageChange:e,page:t,rowsPerPage:a,onRowsPerPageChange:s}){return r(P,{children:r(B,{component:"div",rowsPerPageOptions:[10,25],count:o,page:t,onPageChange:e,rowsPerPage:a,onRowsPerPageChange:s})})}export{E as B,q as T,k as v};
|
||||
import{aw as m,c as w,j as r,g as L,a as y,s as u,av as T,b as v,_ as c,r as h,u as C,e as I,f as $,h as b,i as D}from"./index.6e3d3f58.js";import{f as B}from"./TableRow.ebea94d3.js";const R={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:-1,overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"},k=R,M=m(),P=M,j=w(r("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"}),"ArrowDownward");function N(o){return y("MuiTableSortLabel",o)}const U=L("MuiTableSortLabel",["root","active","icon","iconDirectionDesc","iconDirectionAsc"]),i=U,_=["active","children","className","direction","hideSortIcon","IconComponent"],z=o=>{const{classes:e,direction:t,active:a}=o,s={root:["root",a&&"active"],icon:["icon",`iconDirection${v(t)}`]};return D(s,N,e)},A=u(T,{name:"MuiTableSortLabel",slot:"Root",overridesResolver:(o,e)=>{const{ownerState:t}=o;return[e.root,t.active&&e.active]}})(({theme:o})=>({cursor:"pointer",display:"inline-flex",justifyContent:"flex-start",flexDirection:"inherit",alignItems:"center","&:focus":{color:(o.vars||o).palette.text.secondary},"&:hover":{color:(o.vars||o).palette.text.secondary,[`& .${i.icon}`]:{opacity:.5}},[`&.${i.active}`]:{color:(o.vars||o).palette.text.primary,[`& .${i.icon}`]:{opacity:1,color:(o.vars||o).palette.text.secondary}}})),H=u("span",{name:"MuiTableSortLabel",slot:"Icon",overridesResolver:(o,e)=>{const{ownerState:t}=o;return[e.icon,e[`iconDirection${v(t.direction)}`]]}})(({theme:o,ownerState:e})=>c({fontSize:18,marginRight:4,marginLeft:4,opacity:0,transition:o.transitions.create(["opacity","transform"],{duration:o.transitions.duration.shorter}),userSelect:"none"},e.direction==="desc"&&{transform:"rotate(0deg)"},e.direction==="asc"&&{transform:"rotate(180deg)"})),O=h.exports.forwardRef(function(e,t){const a=C({props:e,name:"MuiTableSortLabel"}),{active:s=!1,children:f,className:S,direction:x="asc",hideSortIcon:l=!1,IconComponent:d=j}=a,g=I(a,_),n=c({},a,{active:s,direction:x,hideSortIcon:l,IconComponent:d}),p=z(n);return $(A,c({className:b(p.root,S),component:"span",disableRipple:!0,ownerState:n,ref:t},g,{children:[f,l&&!s?null:r(H,{as:d,className:b(p.icon),ownerState:n})]}))}),q=O;function E({count:o,onPageChange:e,page:t,rowsPerPage:a,onRowsPerPageChange:s}){return r(P,{children:r(B,{component:"div",rowsPerPageOptions:[10,25],count:o,page:t,onPageChange:e,rowsPerPage:a,onRowsPerPageChange:s})})}export{E as B,q as T,k as v};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
import{P as m}from"./Page.1bc06f71.js";import{f as t,j as r,S as p,T as n,s as u,ao as e,at as h,au as g}from"./index.b24f7692.js";import{G as o,C as d}from"./Grid.b97a55f1.js";const x=u(d)(({theme:a})=>({boxShadow:"none",padding:a.spacing(2),color:"black",backgroundColor:a.palette.grey[200]})),b=[{name:"Requested",value:0,color:e.dark.primary.dark},{name:"Approval",value:0,color:e.dark.warning.dark},{name:"Disbrusment",value:0,color:e.dark.success.dark},{name:"Rejected",value:0,color:e.dark.error.dark}];function k({data:a}){return t(x,{children:[r(p,{sx:{mb:1},children:r(n,{variant:"body2",children:"Claim Status"})}),r(o,{container:!0,spacing:2,children:a?a.map(({name:i,value:l,color:s},c)=>r(o,{item:!0,xs:6,sm:3,children:t(d,{sx:{paddingX:1,borderRadius:.75,borderColor:s,borderStyle:"solid",borderWidth:"1px",padding:2,flex:1,textAlign:"center"},children:[r(n,{component:"p",variant:"body2",children:i}),r(n,{component:"p",variant:"h5",sx:{marginTop:2},children:l}),r(n,{component:"p",variant:"body2",sx:{marginTop:2},children:"Cases"})]})},c)):b.map(({name:i,value:l,color:s},c)=>r(o,{item:!0,xs:6,sm:3,children:t(d,{sx:{paddingX:1,borderRadius:.75,borderColor:s,borderStyle:"solid",borderWidth:"1px",padding:2,flex:1,textAlign:"center"},children:[r(n,{component:"p",variant:"body2",children:i}),r(n,{component:"p",variant:"h5",sx:{marginTop:2},children:l}),r(n,{component:"p",variant:"body2",sx:{marginTop:2},children:"Cases"})]})},c))})]})}const v=[{name:"Requested",value:15,color:e.dark.primary.dark},{name:"Approval",value:20,color:e.dark.warning.dark},{name:"Disbrusment",value:20,color:e.dark.success.dark},{name:"Rejected",value:20,color:e.dark.error.dark}];function S(){const{themeStretch:a}=h();return r(m,{title:"Claim Reports",children:r(g,{maxWidth:a?!1:"xl",children:t(o,{container:!0,spacing:2,children:[r(o,{item:!0,xs:12,lg:12,md:12,children:r(k,{data:v})}),r(o,{item:!0,xs:12,lg:12,md:12,children:r(d,{})})]})})})}export{S as default};
|
||||
import{P as m}from"./Page.e7b124c2.js";import{f as t,j as r,S as p,T as n,s as u,ao as e,at as h,au as g}from"./index.6e3d3f58.js";import{G as o,C as d}from"./Grid.b6e46be2.js";const x=u(d)(({theme:a})=>({boxShadow:"none",padding:a.spacing(2),color:"black",backgroundColor:a.palette.grey[200]})),b=[{name:"Requested",value:0,color:e.dark.primary.dark},{name:"Approval",value:0,color:e.dark.warning.dark},{name:"Disbrusment",value:0,color:e.dark.success.dark},{name:"Rejected",value:0,color:e.dark.error.dark}];function k({data:a}){return t(x,{children:[r(p,{sx:{mb:1},children:r(n,{variant:"body2",children:"Claim Status"})}),r(o,{container:!0,spacing:2,children:a?a.map(({name:i,value:l,color:s},c)=>r(o,{item:!0,xs:6,sm:3,children:t(d,{sx:{paddingX:1,borderRadius:.75,borderColor:s,borderStyle:"solid",borderWidth:"1px",padding:2,flex:1,textAlign:"center"},children:[r(n,{component:"p",variant:"body2",children:i}),r(n,{component:"p",variant:"h5",sx:{marginTop:2},children:l}),r(n,{component:"p",variant:"body2",sx:{marginTop:2},children:"Cases"})]})},c)):b.map(({name:i,value:l,color:s},c)=>r(o,{item:!0,xs:6,sm:3,children:t(d,{sx:{paddingX:1,borderRadius:.75,borderColor:s,borderStyle:"solid",borderWidth:"1px",padding:2,flex:1,textAlign:"center"},children:[r(n,{component:"p",variant:"body2",children:i}),r(n,{component:"p",variant:"h5",sx:{marginTop:2},children:l}),r(n,{component:"p",variant:"body2",sx:{marginTop:2},children:"Cases"})]})},c))})]})}const v=[{name:"Requested",value:15,color:e.dark.primary.dark},{name:"Approval",value:20,color:e.dark.warning.dark},{name:"Disbrusment",value:20,color:e.dark.success.dark},{name:"Rejected",value:20,color:e.dark.error.dark}];function S(){const{themeStretch:a}=h();return r(m,{title:"Claim Reports",children:r(g,{maxWidth:a?!1:"xl",children:t(o,{container:!0,spacing:2,children:[r(o,{item:!0,xs:12,lg:12,md:12,children:r(k,{data:v})}),r(o,{item:!0,xs:12,lg:12,md:12,children:r(d,{})})]})})})}export{S as default};
|
||||
@@ -1 +1 @@
|
||||
import{c as r,j as o}from"./index.b24f7692.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.6e3d3f58.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};
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
import{r as c,f as a,F as i,W as x,j as e,B as d}from"./index.b24f7692.js";const f=c.exports.forwardRef(({children:r,title:s="",meta:t,...o},n)=>a(i,{children:[a(x,{children:[e("title",{children:`${s} | LinkSehat`}),t]}),e(d,{ref:n,...o,children:r})]})),l=f;export{l as P};
|
||||
import{r as c,f as a,F as i,W as x,j as e,B as d}from"./index.6e3d3f58.js";const f=c.exports.forwardRef(({children:r,title:s="",meta:t,...o},n)=>a(i,{children:[a(x,{children:[e("title",{children:`${s} | LinkSehat`}),t]}),e(d,{ref:n,...o,children:r})]})),l=f;export{l as P};
|
||||
File diff suppressed because one or more lines are too long
@@ -1,4 +1,4 @@
|
||||
import{a as po,g as vo,A as In,s as Ae,b as Me,_ as Pe,C as Mn,r as at,u as jn,e as Bn,j as Se,h as yo,i as go,E as _e,R as ce,G as mo,H as bo,f as Fr,J as _o,B as Oo}from"./index.b24f7692.js";import{T as Eo}from"./TextField.7ba4109b.js";function wo(e){return po("MuiCircularProgress",e)}vo("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const xo=["className","color","disableShrink","size","style","thickness","value","variant"];let qt=e=>e,Lr,Rr,$r,Dr;const Ce=44,Ao=In(Lr||(Lr=qt`
|
||||
import{a as po,g as vo,A as In,s as Ae,b as Me,_ as Pe,C as Mn,r as at,u as jn,e as Bn,j as Se,h as yo,i as go,E as _e,R as ce,G as mo,H as bo,f as Fr,J as _o,B as Oo}from"./index.6e3d3f58.js";import{T as Eo}from"./TextField.d5f4a1bd.js";function wo(e){return po("MuiCircularProgress",e)}vo("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const xo=["className","color","disableShrink","size","style","thickness","value","variant"];let qt=e=>e,Lr,Rr,$r,Dr;const Ce=44,Ao=In(Lr||(Lr=qt`
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -1,4 +1,4 @@
|
||||
import{a as R,g as I,s as u,av as de,_ as i,r as z,e as L,ac as ue,K as pe,f as N,j as k,h as M,b as t,i as F,A as _,C as T,u as Y,w as fe,l as Z,d as ee,ah as E}from"./index.b24f7692.js";function be(e){return R("PrivateSwitchBase",e)}I("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const he=["autoFocus","checked","checkedIcon","className","defaultChecked","disabled","disableFocusRipple","edge","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"],ge=e=>{const{classes:r,checked:a,disabled:o,edge:s}=e,p={root:["root",a&&"checked",o&&"disabled",s&&`edge${t(s)}`],input:["input"]};return F(p,be,r)},me=u(de)(({ownerState:e})=>i({padding:9,borderRadius:"50%"},e.edge==="start"&&{marginLeft:e.size==="small"?-3:-12},e.edge==="end"&&{marginRight:e.size==="small"?-3:-12})),ve=u("input")({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),ke=z.exports.forwardRef(function(r,a){const{autoFocus:o,checked:s,checkedIcon:p,className:f,defaultChecked:b,disabled:l,disableFocusRipple:C=!1,edge:c=!1,icon:d,id:v,inputProps:$,inputRef:w,name:h,onBlur:O,onChange:D,onFocus:U,readOnly:re,required:ae,tabIndex:oe,type:B,value:j}=r,te=L(r,he),[A,ie]=ue({controlled:s,default:Boolean(b),name:"SwitchBase",state:"checked"}),m=pe(),ne=g=>{U&&U(g),m&&m.onFocus&&m.onFocus(g)},se=g=>{O&&O(g),m&&m.onBlur&&m.onBlur(g)},ce=g=>{if(g.nativeEvent.defaultPrevented)return;const X=g.target.checked;ie(X),D&&D(g,X)};let x=l;m&&typeof x>"u"&&(x=m.disabled);const le=B==="checkbox"||B==="radio",S=i({},r,{checked:A,disabled:x,disableFocusRipple:C,edge:c}),K=ge(S);return N(me,i({component:"span",className:M(K.root,f),centerRipple:!0,focusRipple:!C,disabled:x,tabIndex:null,role:void 0,onFocus:ne,onBlur:se,ownerState:S,ref:a},te,{children:[k(ve,i({autoFocus:o,checked:s,defaultChecked:b,className:K.input,disabled:x,id:le&&v,name:h,onChange:ce,readOnly:re,ref:w,required:ae,ownerState:S,tabIndex:oe,type:B},B==="checkbox"&&j===void 0?{}:{value:j},$)),A?p:d]}))}),Ce=ke;function $e(e){return R("MuiLinearProgress",e)}const we=I("MuiLinearProgress",["root","colorPrimary","colorSecondary","determinate","indeterminate","buffer","query","dashed","dashedColorPrimary","dashedColorSecondary","bar","barColorPrimary","barColorSecondary","bar1Indeterminate","bar1Determinate","bar1Buffer","bar2Indeterminate","bar2Buffer"]),Ke=we,ye=["className","color","value","valueBuffer","variant"];let y=e=>e,W,G,H,J,Q,V;const P=4,xe=_(W||(W=y`
|
||||
import{a as R,g as I,s as u,av as de,_ as i,r as z,e as L,ac as ue,K as pe,f as N,j as k,h as M,b as t,i as F,A as _,C as T,u as Y,w as fe,l as Z,d as ee,ah as E}from"./index.6e3d3f58.js";function be(e){return R("PrivateSwitchBase",e)}I("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const he=["autoFocus","checked","checkedIcon","className","defaultChecked","disabled","disableFocusRipple","edge","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"],ge=e=>{const{classes:r,checked:a,disabled:o,edge:s}=e,p={root:["root",a&&"checked",o&&"disabled",s&&`edge${t(s)}`],input:["input"]};return F(p,be,r)},me=u(de)(({ownerState:e})=>i({padding:9,borderRadius:"50%"},e.edge==="start"&&{marginLeft:e.size==="small"?-3:-12},e.edge==="end"&&{marginRight:e.size==="small"?-3:-12})),ve=u("input")({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),ke=z.exports.forwardRef(function(r,a){const{autoFocus:o,checked:s,checkedIcon:p,className:f,defaultChecked:b,disabled:l,disableFocusRipple:C=!1,edge:c=!1,icon:d,id:v,inputProps:$,inputRef:w,name:h,onBlur:O,onChange:D,onFocus:U,readOnly:re,required:ae,tabIndex:oe,type:B,value:j}=r,te=L(r,he),[A,ie]=ue({controlled:s,default:Boolean(b),name:"SwitchBase",state:"checked"}),m=pe(),ne=g=>{U&&U(g),m&&m.onFocus&&m.onFocus(g)},se=g=>{O&&O(g),m&&m.onBlur&&m.onBlur(g)},ce=g=>{if(g.nativeEvent.defaultPrevented)return;const X=g.target.checked;ie(X),D&&D(g,X)};let x=l;m&&typeof x>"u"&&(x=m.disabled);const le=B==="checkbox"||B==="radio",S=i({},r,{checked:A,disabled:x,disableFocusRipple:C,edge:c}),K=ge(S);return N(me,i({component:"span",className:M(K.root,f),centerRipple:!0,focusRipple:!C,disabled:x,tabIndex:null,role:void 0,onFocus:ne,onBlur:se,ownerState:S,ref:a},te,{children:[k(ve,i({autoFocus:o,checked:s,defaultChecked:b,className:K.input,disabled:x,id:le&&v,name:h,onChange:ce,readOnly:re,ref:w,required:ae,ownerState:S,tabIndex:oe,type:B},B==="checkbox"&&j===void 0?{}:{value:j},$)),A?p:d]}))}),Ce=ke;function $e(e){return R("MuiLinearProgress",e)}const we=I("MuiLinearProgress",["root","colorPrimary","colorSecondary","determinate","indeterminate","buffer","query","dashed","dashedColorPrimary","dashedColorSecondary","bar","barColorPrimary","barColorSecondary","bar1Indeterminate","bar1Determinate","bar1Buffer","bar2Indeterminate","bar2Buffer"]),Ke=we,ye=["className","color","value","valueBuffer","variant"];let y=e=>e,W,G,H,J,Q,V;const P=4,xe=_(W||(W=y`
|
||||
0% {
|
||||
left: -35%;
|
||||
right: 100%;
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
import{g as q,a as S,s as N,b as L,_ as l,r as U,u as _,e as B,K as se,M as le,j as c,h as W,i as j,N as ae,H as ne,f as ie,Q as de,U as ue,V as ce,X as pe,O as fe}from"./index.b24f7692.js";function me(e){return S("MuiFormHelperText",e)}const xe=q("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]),M=xe;var $;const Fe=["children","className","component","disabled","error","filled","focused","margin","required","variant"],he=e=>{const{classes:o,contained:t,size:s,disabled:n,error:i,filled:d,focused:p,required:u}=e,r={root:["root",n&&"disabled",i&&"error",s&&`size${L(s)}`,t&&"contained",p&&"focused",d&&"filled",u&&"required"]};return j(r,me,o)},be=N("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.root,t.size&&o[`size${L(t.size)}`],t.contained&&o.contained,t.filled&&o.filled]}})(({theme:e,ownerState:o})=>l({color:(e.vars||e).palette.text.secondary},e.typography.caption,{textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${M.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${M.error}`]:{color:(e.vars||e).palette.error.main}},o.size==="small"&&{marginTop:4},o.contained&&{marginLeft:14,marginRight:14})),Te=U.exports.forwardRef(function(o,t){const s=_({props:o,name:"MuiFormHelperText"}),{children:n,className:i,component:d="p"}=s,p=B(s,Fe),u=se(),r=le({props:s,muiFormControl:u,states:["variant","size","disabled","error","filled","focused","required"]}),f=l({},s,{component:d,contained:r.variant==="filled"||r.variant==="outlined",variant:r.variant,size:r.size,disabled:r.disabled,error:r.error,filled:r.filled,focused:r.focused,required:r.required}),F=he(f);return c(be,l({as:d,ownerState:f,className:W(F.root,i),ref:t},p,{children:n===" "?$||($=c("span",{className:"notranslate",children:"\u200B"})):n}))}),ve=Te;function Ce(e){return S("MuiTextField",e)}q("MuiTextField",["root"]);const ge=["autoComplete","autoFocus","children","className","color","defaultValue","disabled","error","FormHelperTextProps","fullWidth","helperText","id","InputLabelProps","inputProps","InputProps","inputRef","label","maxRows","minRows","multiline","name","onBlur","onChange","onFocus","placeholder","required","rows","select","SelectProps","type","value","variant"],Re={standard:ce,filled:pe,outlined:fe},we=e=>{const{classes:o}=e;return j({root:["root"]},Ce,o)},ye=N(ae,{name:"MuiTextField",slot:"Root",overridesResolver:(e,o)=>o.root})({}),Ie=U.exports.forwardRef(function(o,t){const s=_({props:o,name:"MuiTextField"}),{autoComplete:n,autoFocus:i=!1,children:d,className:p,color:u="primary",defaultValue:r,disabled:f=!1,error:F=!1,FormHelperTextProps:V,fullWidth:T=!1,helperText:v,id:O,InputLabelProps:h,inputProps:k,InputProps:A,inputRef:E,label:m,maxRows:K,minRows:Q,multiline:w=!1,name:X,onBlur:D,onChange:G,onFocus:J,placeholder:Y,required:y=!1,rows:Z,select:C=!1,SelectProps:g,type:ee,value:I,variant:b="outlined"}=s,oe=B(s,ge),H=l({},s,{autoFocus:i,color:u,disabled:f,error:F,fullWidth:T,multiline:w,required:y,select:C,variant:b}),re=we(H),x={};b==="outlined"&&(h&&typeof h.shrink<"u"&&(x.notched=h.shrink),x.label=m),C&&((!g||!g.native)&&(x.id=void 0),x["aria-describedby"]=void 0);const a=ne(O),R=v&&a?`${a}-helper-text`:void 0,P=m&&a?`${a}-label`:void 0,te=Re[b],z=c(te,l({"aria-describedby":R,autoComplete:n,autoFocus:i,defaultValue:r,fullWidth:T,multiline:w,name:X,rows:Z,maxRows:K,minRows:Q,type:ee,value:I,id:a,inputRef:E,onBlur:D,onChange:G,onFocus:J,placeholder:Y,inputProps:k},x,A));return ie(ye,l({className:W(re.root,p),disabled:f,error:F,fullWidth:T,ref:t,required:y,color:u,variant:b,ownerState:H},oe,{children:[m!=null&&m!==""&&c(de,l({htmlFor:a,id:P},h,{children:m})),C?c(ue,l({"aria-describedby":R,id:a,labelId:P,value:I,input:z},g,{children:d})):z,v&&c(ve,l({id:R},V,{children:v}))]}))}),Pe=Ie;export{Pe as T};
|
||||
import{g as q,a as S,s as N,b as L,_ as l,r as U,u as _,e as B,K as se,M as le,j as c,h as W,i as j,N as ae,H as ne,f as ie,Q as de,U as ue,V as ce,X as pe,O as fe}from"./index.6e3d3f58.js";function me(e){return S("MuiFormHelperText",e)}const xe=q("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]),M=xe;var $;const Fe=["children","className","component","disabled","error","filled","focused","margin","required","variant"],he=e=>{const{classes:o,contained:t,size:s,disabled:n,error:i,filled:d,focused:p,required:u}=e,r={root:["root",n&&"disabled",i&&"error",s&&`size${L(s)}`,t&&"contained",p&&"focused",d&&"filled",u&&"required"]};return j(r,me,o)},be=N("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.root,t.size&&o[`size${L(t.size)}`],t.contained&&o.contained,t.filled&&o.filled]}})(({theme:e,ownerState:o})=>l({color:(e.vars||e).palette.text.secondary},e.typography.caption,{textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${M.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${M.error}`]:{color:(e.vars||e).palette.error.main}},o.size==="small"&&{marginTop:4},o.contained&&{marginLeft:14,marginRight:14})),Te=U.exports.forwardRef(function(o,t){const s=_({props:o,name:"MuiFormHelperText"}),{children:n,className:i,component:d="p"}=s,p=B(s,Fe),u=se(),r=le({props:s,muiFormControl:u,states:["variant","size","disabled","error","filled","focused","required"]}),f=l({},s,{component:d,contained:r.variant==="filled"||r.variant==="outlined",variant:r.variant,size:r.size,disabled:r.disabled,error:r.error,filled:r.filled,focused:r.focused,required:r.required}),F=he(f);return c(be,l({as:d,ownerState:f,className:W(F.root,i),ref:t},p,{children:n===" "?$||($=c("span",{className:"notranslate",children:"\u200B"})):n}))}),ve=Te;function Ce(e){return S("MuiTextField",e)}q("MuiTextField",["root"]);const ge=["autoComplete","autoFocus","children","className","color","defaultValue","disabled","error","FormHelperTextProps","fullWidth","helperText","id","InputLabelProps","inputProps","InputProps","inputRef","label","maxRows","minRows","multiline","name","onBlur","onChange","onFocus","placeholder","required","rows","select","SelectProps","type","value","variant"],Re={standard:ce,filled:pe,outlined:fe},we=e=>{const{classes:o}=e;return j({root:["root"]},Ce,o)},ye=N(ae,{name:"MuiTextField",slot:"Root",overridesResolver:(e,o)=>o.root})({}),Ie=U.exports.forwardRef(function(o,t){const s=_({props:o,name:"MuiTextField"}),{autoComplete:n,autoFocus:i=!1,children:d,className:p,color:u="primary",defaultValue:r,disabled:f=!1,error:F=!1,FormHelperTextProps:V,fullWidth:T=!1,helperText:v,id:O,InputLabelProps:h,inputProps:k,InputProps:A,inputRef:E,label:m,maxRows:K,minRows:Q,multiline:w=!1,name:X,onBlur:D,onChange:G,onFocus:J,placeholder:Y,required:y=!1,rows:Z,select:C=!1,SelectProps:g,type:ee,value:I,variant:b="outlined"}=s,oe=B(s,ge),H=l({},s,{autoFocus:i,color:u,disabled:f,error:F,fullWidth:T,multiline:w,required:y,select:C,variant:b}),re=we(H),x={};b==="outlined"&&(h&&typeof h.shrink<"u"&&(x.notched=h.shrink),x.label=m),C&&((!g||!g.native)&&(x.id=void 0),x["aria-describedby"]=void 0);const a=ne(O),R=v&&a?`${a}-helper-text`:void 0,P=m&&a?`${a}-label`:void 0,te=Re[b],z=c(te,l({"aria-describedby":R,autoComplete:n,autoFocus:i,defaultValue:r,fullWidth:T,multiline:w,name:X,rows:Z,maxRows:K,minRows:Q,type:ee,value:I,id:a,inputRef:E,onBlur:D,onChange:G,onFocus:J,placeholder:Y,inputProps:k},x,A));return ie(ye,l({className:W(re.root,p),disabled:f,error:F,fullWidth:T,ref:t,required:y,color:u,variant:b,ownerState:H},oe,{children:[m!=null&&m!==""&&c(de,l({htmlFor:a,id:P},h,{children:m})),C?c(ue,l({"aria-describedby":R,id:a,labelId:P,value:I,input:z},g,{children:d})):z,v&&c(ve,l({id:R},V,{children:v}))]}))}),Pe=Ie;export{Pe as T};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -27,7 +27,7 @@
|
||||
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" />
|
||||
<script type="module" crossorigin src="/assets/index.b24f7692.js"></script>
|
||||
<script type="module" crossorigin src="/assets/index.6e3d3f58.js"></script>
|
||||
<link rel="stylesheet" href="/assets/index.4f71ab86.css">
|
||||
<link rel="manifest" href="/manifest.webmanifest"><script src="/registerSW.js"></script></head>
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
if(!self.define){let s,e={};const i=(i,l)=>(i=new URL(i+".js",l).href,e[i]||new Promise((e=>{if("document"in self){const s=document.createElement("script");s.src=i,s.onload=e,document.head.appendChild(s)}else s=i,importScripts(i),e()})).then((()=>{let s=e[i];if(!s)throw new Error(`Module ${i} didn’t register its module`);return s})));self.define=(l,n)=>{const r=s||("document"in self?document.currentScript.src:"")||location.href;if(e[r])return;let t={};const o=s=>i(s,r),u={module:{uri:r},exports:t,require:o};e[r]=Promise.all(l.map((s=>u[s]||o(s)))).then((s=>(n(...s),t)))}}define(["./workbox-74eda642"],(function(s){"use strict";self.addEventListener("message",(s=>{s.data&&"SKIP_WAITING"===s.data.type&&self.skipWaiting()})),s.precacheAndRoute([{url:"assets/BaseTablePagination.70ad36bd.js",revision:null},{url:"assets/Dashboard.7db5c1cc.js",revision:null},{url:"assets/Grid.b97a55f1.js",revision:null},{url:"assets/Index.27056ef6.js",revision:null},{url:"assets/index.4f71ab86.css",revision:null},{url:"assets/Index.a17a77a4.js",revision:null},{url:"assets/index.b24f7692.js",revision:null},{url:"assets/KeyboardArrowRight.fab88f79.js",revision:null},{url:"assets/Login.bcab0d13.js",revision:null},{url:"assets/Page.1bc06f71.js",revision:null},{url:"assets/Page404.db6f063c.js",revision:null},{url:"assets/RHFTextField.19431e9a.js",revision:null},{url:"assets/RHFTextField.595782a5.css",revision:null},{url:"assets/ServiceMonitoring.f6a2920a.js",revision:null},{url:"assets/Switch.c6f688ce.js",revision:null},{url:"assets/TableRow.eae87b2d.js",revision:null},{url:"assets/Tabs.23d6345e.js",revision:null},{url:"assets/TextField.7ba4109b.js",revision:null},{url:"assets/UserProfile.88975bbb.js",revision:null},{url:"fonts/index.css",revision:"8711e169f3dc54f34d839f18d7acef21"},{url:"index.html",revision:"84131c347638e7afc8c05f97a7937154"},{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"manifest.webmanifest",revision:"ced57fe94e88ec3187bcd0a36e2e178f"}],{}),s.cleanupOutdatedCaches(),s.registerRoute(new s.NavigationRoute(s.createHandlerBoundToURL("index.html")))}));
|
||||
if(!self.define){let e,s={};const i=(i,l)=>(i=new URL(i+".js",l).href,s[i]||new Promise((s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()})).then((()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e})));self.define=(l,n)=>{const r=e||("document"in self?document.currentScript.src:"")||location.href;if(s[r])return;let t={};const o=e=>i(e,r),u={module:{uri:r},exports:t,require:o};s[r]=Promise.all(l.map((e=>u[e]||o(e)))).then((e=>(n(...e),t)))}}define(["./workbox-74eda642"],(function(e){"use strict";self.addEventListener("message",(e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()})),e.precacheAndRoute([{url:"assets/BaseTablePagination.b8f78785.js",revision:null},{url:"assets/Dashboard.9b155889.js",revision:null},{url:"assets/Grid.b6e46be2.js",revision:null},{url:"assets/index.4f71ab86.css",revision:null},{url:"assets/index.6e3d3f58.js",revision:null},{url:"assets/Index.a47edb98.js",revision:null},{url:"assets/Index.c5c4cabd.js",revision:null},{url:"assets/KeyboardArrowRight.9ad3d050.js",revision:null},{url:"assets/Login.e3555333.js",revision:null},{url:"assets/Page.e7b124c2.js",revision:null},{url:"assets/Page404.308050b8.js",revision:null},{url:"assets/RHFTextField.522e64b8.js",revision:null},{url:"assets/RHFTextField.595782a5.css",revision:null},{url:"assets/ServiceMonitoring.b8e510e4.js",revision:null},{url:"assets/Switch.cad85877.js",revision:null},{url:"assets/TableRow.ebea94d3.js",revision:null},{url:"assets/Tabs.ad1e478e.js",revision:null},{url:"assets/TextField.d5f4a1bd.js",revision:null},{url:"assets/UserProfile.45602e0c.js",revision:null},{url:"fonts/index.css",revision:"8711e169f3dc54f34d839f18d7acef21"},{url:"index.html",revision:"d39abb0612b569934a1fed8ec5949f9b"},{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"manifest.webmanifest",revision:"ced57fe94e88ec3187bcd0a36e2e178f"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))}));
|
||||
|
||||
@@ -1 +1 @@
|
||||
import{r,i as a,a as t}from"./jsx-runtime_commonjs-proxy.aef95d3b.js";var e={},u=a.exports;Object.defineProperty(e,"__esModule",{value:!0});var v=e.default=void 0,d=u(r()),i=t,o=(0,d.default)((0,i.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}),"Add");v=e.default=o;export{v as d};
|
||||
import{r,i as a,a as t}from"./jsx-runtime_commonjs-proxy.3d631f7d.js";var e={},u=a.exports;Object.defineProperty(e,"__esModule",{value:!0});var v=e.default=void 0,d=u(r()),i=t,o=(0,d.default)((0,i.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}),"Add");v=e.default=o;export{v as d};
|
||||
@@ -1,4 +1,4 @@
|
||||
import{aO as wo,r as h,O as io,aP as Xe,aM as Do,x as c,X as No,y as w,t as Io,q as $o,s as U,V as b,Z as H,v as Oo,w as Po,aQ as Mo,N as go,z as Z,Q as Fe,D as t,G as ko,bR as po,bS as Ye,bT as bo,bU as Qe,f as To,bV as So,P as Ao,bW as zo,bX as Eo,bY as Vo,E as xo,aZ as Fo}from"./index.228177b0.js";import{u as Ho}from"./unsupportedProp.69e7c162.js";function mo(e){return typeof e.normalize<"u"?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e}function Uo(e={}){const{ignoreAccents:r=!0,ignoreCase:u=!0,limit:i,matchFrom:v="any",stringify:A,trim:O=!1}=e;return(f,{inputValue:R,getOptionLabel:y})=>{let D=O?R.trim():R;u&&(D=D.toLowerCase()),r&&(D=mo(D));const W=D?f.filter(me=>{let z=(A||y)(me);return u&&(z=z.toLowerCase()),r&&(z=mo(z)),v==="start"?z.indexOf(D)===0:z.indexOf(D)>-1}):f;return typeof i=="number"?W.slice(0,i):W}}function co(e,r){for(let u=0;u<e.length;u+=1)if(r(e[u]))return u;return-1}const Wo=Uo(),ho=5,jo=e=>{var r;return e.current!==null&&((r=e.current.parentElement)==null?void 0:r.contains(document.activeElement))};function Bo(e){const{unstable_isActiveElementInListbox:r=jo,unstable_classNamePrefix:u="Mui",autoComplete:i=!1,autoHighlight:v=!1,autoSelect:A=!1,blurOnSelect:O=!1,clearOnBlur:f=!e.freeSolo,clearOnEscape:R=!1,componentName:y="useAutocomplete",defaultValue:D=e.multiple?[]:null,disableClearable:W=!1,disableCloseOnSelect:me=!1,disabled:z,disabledItemsFocusable:j=!1,disableListWrap:ye=!1,filterOptions:Se=Wo,filterSelectedOptions:he=!1,freeSolo:J=!1,getOptionDisabled:X,getOptionLabel:Ae=n=>{var o;return(o=n.label)!=null?o:n},groupBy:ce,handleHomeEndKeys:ve=!e.freeSolo,id:te,includeInputInList:Ie=!1,inputValue:He,isOptionEqualToValue:B=(n,o)=>n===o,multiple:x=!1,onChange:re,onClose:ne,onHighlightChange:K,onInputChange:Y,onOpen:ue,open:Ce,openOnFocus:$e=!1,options:P,readOnly:ae=!1,selectOnFocus:Ze=!e.freeSolo,value:eo}=e,M=wo(te);let le=Ae;le=n=>{const o=Ae(n);if(typeof o!="string"){{const a=o===void 0?"undefined":`${typeof o} (${o})`;console.error(`MUI: The \`getOptionLabel\` method of ${y} returned ${a} instead of a string for ${JSON.stringify(n)}.`)}return String(o)}return o};const Re=h.exports.useRef(!1),Le=h.exports.useRef(!0),$=h.exports.useRef(null),q=h.exports.useRef(null),[we,oo]=h.exports.useState(null),[E,Oe]=h.exports.useState(-1),Ue=v?0:-1,_=h.exports.useRef(Ue),[l,We]=io({controlled:eo,default:D,name:y}),[C,de]=io({controlled:He,default:"",name:y,state:"inputValue"}),[se,je]=h.exports.useState(!1),Pe=h.exports.useCallback((n,o)=>{if(!(x?l.length<o.length:o!==null)&&!f)return;let s;if(x)s="";else if(o==null)s="";else{const m=le(o);s=typeof m=="string"?m:""}C!==s&&(de(s),Y&&Y(n,s,"reset"))},[le,C,x,Y,de,f,l]),De=h.exports.useRef();h.exports.useEffect(()=>{const n=l!==De.current;De.current=l,!(se&&!n)&&(J&&!n||Pe(null,l))},[l,Pe,se,De,J]);const[fe,Be]=io({controlled:Ce,default:!1,name:y,state:"open"}),[to,Ke]=h.exports.useState(!0),qe=!x&&l!=null&&C===le(l),V=fe&&!ae,k=V?Se(P.filter(n=>!(he&&(x?l:[l]).some(o=>o!==null&&B(n,o)))),{inputValue:qe&&to?"":C,getOptionLabel:le}):[],Ne=fe&&k.length>0&&!ae;if(l!==null&&!J&&P.length>0){const n=(x?l:[l]).filter(o=>!P.some(a=>B(a,o)));n.length>0&&console.warn([`MUI: The value provided to ${y} is invalid.`,`None of the options match with \`${n.length>1?JSON.stringify(n):JSON.stringify(n[0])}\`.`,"You can use the `isOptionEqualToValue` prop to customize the equality test."].join(`
|
||||
import{aO as wo,r as h,O as io,aP as Xe,aM as Do,x as c,X as No,y as w,t as Io,q as $o,s as U,V as b,Z as H,v as Oo,w as Po,aQ as Mo,N as go,z as Z,Q as Fe,D as t,G as ko,bR as po,bS as Ye,bT as bo,bU as Qe,f as To,bV as So,P as Ao,bW as zo,bX as Eo,bY as Vo,E as xo,aZ as Fo}from"./index.3292d49b.js";import{u as Ho}from"./unsupportedProp.69e7c162.js";function mo(e){return typeof e.normalize<"u"?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e}function Uo(e={}){const{ignoreAccents:r=!0,ignoreCase:u=!0,limit:i,matchFrom:v="any",stringify:A,trim:O=!1}=e;return(f,{inputValue:R,getOptionLabel:y})=>{let D=O?R.trim():R;u&&(D=D.toLowerCase()),r&&(D=mo(D));const W=D?f.filter(me=>{let z=(A||y)(me);return u&&(z=z.toLowerCase()),r&&(z=mo(z)),v==="start"?z.indexOf(D)===0:z.indexOf(D)>-1}):f;return typeof i=="number"?W.slice(0,i):W}}function co(e,r){for(let u=0;u<e.length;u+=1)if(r(e[u]))return u;return-1}const Wo=Uo(),ho=5,jo=e=>{var r;return e.current!==null&&((r=e.current.parentElement)==null?void 0:r.contains(document.activeElement))};function Bo(e){const{unstable_isActiveElementInListbox:r=jo,unstable_classNamePrefix:u="Mui",autoComplete:i=!1,autoHighlight:v=!1,autoSelect:A=!1,blurOnSelect:O=!1,clearOnBlur:f=!e.freeSolo,clearOnEscape:R=!1,componentName:y="useAutocomplete",defaultValue:D=e.multiple?[]:null,disableClearable:W=!1,disableCloseOnSelect:me=!1,disabled:z,disabledItemsFocusable:j=!1,disableListWrap:ye=!1,filterOptions:Se=Wo,filterSelectedOptions:he=!1,freeSolo:J=!1,getOptionDisabled:X,getOptionLabel:Ae=n=>{var o;return(o=n.label)!=null?o:n},groupBy:ce,handleHomeEndKeys:ve=!e.freeSolo,id:te,includeInputInList:Ie=!1,inputValue:He,isOptionEqualToValue:B=(n,o)=>n===o,multiple:x=!1,onChange:re,onClose:ne,onHighlightChange:K,onInputChange:Y,onOpen:ue,open:Ce,openOnFocus:$e=!1,options:P,readOnly:ae=!1,selectOnFocus:Ze=!e.freeSolo,value:eo}=e,M=wo(te);let le=Ae;le=n=>{const o=Ae(n);if(typeof o!="string"){{const a=o===void 0?"undefined":`${typeof o} (${o})`;console.error(`MUI: The \`getOptionLabel\` method of ${y} returned ${a} instead of a string for ${JSON.stringify(n)}.`)}return String(o)}return o};const Re=h.exports.useRef(!1),Le=h.exports.useRef(!0),$=h.exports.useRef(null),q=h.exports.useRef(null),[we,oo]=h.exports.useState(null),[E,Oe]=h.exports.useState(-1),Ue=v?0:-1,_=h.exports.useRef(Ue),[l,We]=io({controlled:eo,default:D,name:y}),[C,de]=io({controlled:He,default:"",name:y,state:"inputValue"}),[se,je]=h.exports.useState(!1),Pe=h.exports.useCallback((n,o)=>{if(!(x?l.length<o.length:o!==null)&&!f)return;let s;if(x)s="";else if(o==null)s="";else{const m=le(o);s=typeof m=="string"?m:""}C!==s&&(de(s),Y&&Y(n,s,"reset"))},[le,C,x,Y,de,f,l]),De=h.exports.useRef();h.exports.useEffect(()=>{const n=l!==De.current;De.current=l,!(se&&!n)&&(J&&!n||Pe(null,l))},[l,Pe,se,De,J]);const[fe,Be]=io({controlled:Ce,default:!1,name:y,state:"open"}),[to,Ke]=h.exports.useState(!0),qe=!x&&l!=null&&C===le(l),V=fe&&!ae,k=V?Se(P.filter(n=>!(he&&(x?l:[l]).some(o=>o!==null&&B(n,o)))),{inputValue:qe&&to?"":C,getOptionLabel:le}):[],Ne=fe&&k.length>0&&!ae;if(l!==null&&!J&&P.length>0){const n=(x?l:[l]).filter(o=>!P.some(a=>B(a,o)));n.length>0&&console.warn([`MUI: The value provided to ${y} is invalid.`,`None of the options match with \`${n.length>1?JSON.stringify(n):JSON.stringify(n[0])}\`.`,"You can use the `isOptionEqualToValue` prop to customize the equality test."].join(`
|
||||
`))}const ke=Xe(n=>{n===-1?$.current.focus():we.querySelector(`[data-tag-index="${n}"]`).focus()});h.exports.useEffect(()=>{x&&E>l.length-1&&(Oe(-1),ke(-1))},[l,x,E,ke]);function Te(n,o){if(!q.current||n===-1)return-1;let a=n;for(;;){if(o==="next"&&a===k.length||o==="previous"&&a===-1)return-1;const s=q.current.querySelector(`[data-option-index="${a}"]`),m=j?!1:!s||s.disabled||s.getAttribute("aria-disabled")==="true";if(s&&!s.hasAttribute("tabindex")||m)a+=o==="next"?1:-1;else return a}}const ie=Xe(({event:n,index:o,reason:a="auto"})=>{if(_.current=o,o===-1?$.current.removeAttribute("aria-activedescendant"):$.current.setAttribute("aria-activedescendant",`${M}-option-${o}`),K&&K(n,o===-1?null:k[o],a),!q.current)return;const s=q.current.querySelector(`[role="option"].${u}-focused`);s&&(s.classList.remove(`${u}-focused`),s.classList.remove(`${u}-focusVisible`));const m=q.current.parentElement.querySelector('[role="listbox"]');if(!m)return;if(o===-1){m.scrollTop=0;return}const I=q.current.querySelector(`[data-option-index="${o}"]`);if(!!I&&(I.classList.add(`${u}-focused`),a==="keyboard"&&I.classList.add(`${u}-focusVisible`),m.scrollHeight>m.clientHeight&&a!=="mouse")){const S=I,F=m.clientHeight+m.scrollTop,Je=S.offsetTop+S.offsetHeight;Je>F?m.scrollTop=Je-m.clientHeight:S.offsetTop-S.offsetHeight*(ce?1.3:0)<m.scrollTop&&(m.scrollTop=S.offsetTop-S.offsetHeight*(ce?1.3:0))}}),Q=Xe(({event:n,diff:o,direction:a="next",reason:s="auto"})=>{if(!V)return;const I=Te((()=>{const S=k.length-1;if(o==="reset")return Ue;if(o==="start")return 0;if(o==="end")return S;const F=_.current+o;return F<0?F===-1&&Ie?-1:ye&&_.current!==-1||Math.abs(o)>1?0:S:F>S?F===S+1&&Ie?-1:ye||Math.abs(o)>1?S:0:F})(),a);if(ie({index:I,reason:s,event:n}),i&&o!=="reset")if(I===-1)$.current.value=C;else{const S=le(k[I]);$.current.value=S,S.toLowerCase().indexOf(C.toLowerCase())===0&&C.length>0&&$.current.setSelectionRange(C.length,S.length)}}),ge=h.exports.useCallback(()=>{if(!V)return;const n=x?l[0]:l;if(k.length===0||n==null){Q({diff:"reset"});return}if(!!q.current){if(n!=null){const o=k[_.current];if(x&&o&&co(l,s=>B(o,s))!==-1)return;const a=co(k,s=>B(s,n));a===-1?Q({diff:"reset"}):ie({index:a});return}if(_.current>=k.length-1){ie({index:k.length-1});return}ie({index:_.current})}},[k.length,x?!1:l,he,Q,ie,V,C,x]),ro=Xe(n=>{Do(q,n),n&&ge()});h.exports.useEffect(()=>{(!$.current||$.current.nodeName!=="INPUT")&&($.current&&$.current.nodeName==="TEXTAREA"?console.warn([`A textarea element was provided to ${y} where input was expected.`,"This is not a supported scenario but it may work under certain conditions.","A textarea keyboard navigation may conflict with Autocomplete controls (e.g. enter and arrow keys).","Make sure to test keyboard navigation and add custom event handlers if necessary."].join(`
|
||||
`)):console.error([`MUI: Unable to find the input element. It was resolved to ${$.current} while an HTMLInputElement was expected.`,`Instead, ${y} expects an input element.`,"",y==="useAutocomplete"?"Make sure you have bound getInputProps correctly and that the normal ref/effect resolutions order is guaranteed.":"Make sure you have customized the input component correctly."].join(`
|
||||
`)))},[y]),h.exports.useEffect(()=>{ge()},[ge]);const pe=n=>{fe||(Be(!0),Ke(!0),ue&&ue(n))},ee=(n,o)=>{!fe||(Be(!1),ne&&ne(n,o))},oe=(n,o,a,s)=>{if(x){if(l.length===o.length&&l.every((m,I)=>m===o[I]))return}else if(l===o)return;re&&re(n,o,a,s),We(o)},be=h.exports.useRef(!1),T=(n,o,a="selectOption",s="options")=>{let m=a,I=o;if(x){I=Array.isArray(l)?l.slice():[];{const F=I.filter(Je=>B(o,Je));F.length>1&&console.error([`MUI: The \`isOptionEqualToValue\` method of ${y} does not handle the arguments correctly.`,`The component expects a single value to match a given option but found ${F.length} matches.`].join(`
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
import{r as a,i as r,a as t}from"./jsx-runtime_commonjs-proxy.aef95d3b.js";var e={},u=r.exports;Object.defineProperty(e,"__esModule",{value:!0});var i=e.default=void 0,l=u(a()),o=t,d=(0,l.default)((0,o.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel");i=e.default=d;export{i as d};
|
||||
import{r as a,i as r,a as t}from"./jsx-runtime_commonjs-proxy.3d631f7d.js";var e={},u=r.exports;Object.defineProperty(e,"__esModule",{value:!0});var i=e.default=void 0,l=u(a()),o=t,d=(0,l.default)((0,o.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel");i=e.default=d;export{i as d};
|
||||
@@ -1 +1 @@
|
||||
import{q as u,t as x,s as f,P as C,r as y,v as m,w as h,x as i,y as b,z as v,D as s,E as w,G as T}from"./index.228177b0.js";function g(e){return u("MuiCard",e)}x("MuiCard",["root"]);const j=["className","raised"],M=e=>{const{classes:o}=e;return T({root:["root"]},g,o)},P=f(C,{name:"MuiCard",slot:"Root",overridesResolver:(e,o)=>o.root})(()=>({overflow:"hidden"})),c=y.exports.forwardRef(function(o,t){const r=m({props:o,name:"MuiCard"}),{className:l,raised:a=!1}=r,p=h(r,j),n=i({},r,{raised:a}),d=M(n);return b(P,i({className:v(d.root,l),elevation:a?8:void 0,ref:t,ownerState:n},p))});c.propTypes={children:s.exports.node,classes:s.exports.object,className:s.exports.string,raised:w(s.exports.bool,e=>e.raised&&e.variant==="outlined"?new Error('MUI: Combining `raised={true}` with `variant="outlined"` has no effect.'):null),sx:s.exports.oneOfType([s.exports.arrayOf(s.exports.oneOfType([s.exports.func,s.exports.object,s.exports.bool])),s.exports.func,s.exports.object])};const N=c;export{N as C};
|
||||
import{q as u,t as x,s as f,P as C,r as y,v as m,w as h,x as i,y as b,z as v,D as s,E as w,G as T}from"./index.3292d49b.js";function g(e){return u("MuiCard",e)}x("MuiCard",["root"]);const j=["className","raised"],M=e=>{const{classes:o}=e;return T({root:["root"]},g,o)},P=f(C,{name:"MuiCard",slot:"Root",overridesResolver:(e,o)=>o.root})(()=>({overflow:"hidden"})),c=y.exports.forwardRef(function(o,t){const r=m({props:o,name:"MuiCard"}),{className:l,raised:a=!1}=r,p=h(r,j),n=i({},r,{raised:a}),d=M(n);return b(P,i({className:v(d.root,l),elevation:a?8:void 0,ref:t,ownerState:n},p))});c.propTypes={children:s.exports.node,classes:s.exports.object,className:s.exports.string,raised:w(s.exports.bool,e=>e.raised&&e.variant==="outlined"?new Error('MUI: Combining `raised={true}` with `variant="outlined"` has no effect.'):null),sx:s.exports.oneOfType([s.exports.arrayOf(s.exports.oneOfType([s.exports.func,s.exports.object,s.exports.bool])),s.exports.func,s.exports.object])};const N=c;export{N as C};
|
||||
@@ -1 +1 @@
|
||||
import{X as u,y as r,t as P,q as B,s as S,Y as T,V as C,x as n,Z as M,r as d,v as R,w as j,z as H,D as e,U,G as V}from"./index.228177b0.js";import{S as _}from"./FormControlLabel.b626fc05.js";const w=u(r("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"),N=u(r("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=u(r("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 q(o){return B("MuiCheckbox",o)}const E=P("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary"]),x=E,F=["checkedIcon","color","icon","indeterminate","indeterminateIcon","inputProps","size","className"],D=o=>{const{classes:t,indeterminate:s,color:a}=o,i={root:["root",s&&"indeterminate",`color${C(a)}`]},c=V(i,q,t);return n({},t,c)},G=S(_,{shouldForwardProp:o=>T(o)||o==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(o,t)=>{const{ownerState:s}=o;return[t.root,s.indeterminate&&t.indeterminate,s.color!=="default"&&t[`color${C(s.color)}`]]}})(({theme:o,ownerState:t})=>n({color:(o.vars||o).palette.text.secondary},!t.disableRipple&&{"&:hover":{backgroundColor:o.vars?`rgba(${t.color==="default"?o.vars.palette.action.activeChannel:o.vars.palette.primary.mainChannel} / ${o.vars.palette.action.hoverOpacity})`:M(t.color==="default"?o.palette.action.active:o.palette[t.color].main,o.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},t.color!=="default"&&{[`&.${x.checked}, &.${x.indeterminate}`]:{color:(o.vars||o).palette[t.color].main},[`&.${x.disabled}`]:{color:(o.vars||o).palette.action.disabled}})),W=r(N,{}),X=r(w,{}),Y=r(L,{}),v=d.exports.forwardRef(function(t,s){var a,i;const c=R({props:t,name:"MuiCheckbox"}),{checkedIcon:y=W,color:I="primary",icon:z=X,indeterminate:l=!1,indeterminateIcon:m=Y,inputProps:g,size:p="medium",className:$}=c,O=j(c,F),h=l?m:z,f=l?m:y,b=n({},c,{color:I,indeterminate:l,size:p}),k=D(b);return r(G,n({type:"checkbox",inputProps:n({"data-indeterminate":l},g),icon:d.exports.cloneElement(h,{fontSize:(a=h.props.fontSize)!=null?a:p}),checkedIcon:d.exports.cloneElement(f,{fontSize:(i=f.props.fontSize)!=null?i:p}),ownerState:b,ref:s,className:H(k.root,$)},O,{classes:k}))});v.propTypes={checked:e.exports.bool,checkedIcon:e.exports.node,classes:e.exports.object,className:e.exports.string,color:e.exports.oneOfType([e.exports.oneOf(["default","primary","secondary","error","info","success","warning"]),e.exports.string]),defaultChecked:e.exports.bool,disabled:e.exports.bool,disableRipple:e.exports.bool,icon:e.exports.node,id:e.exports.string,indeterminate:e.exports.bool,indeterminateIcon:e.exports.node,inputProps:e.exports.object,inputRef:U,onChange:e.exports.func,required:e.exports.bool,size:e.exports.oneOfType([e.exports.oneOf(["medium","small"]),e.exports.string]),sx:e.exports.oneOfType([e.exports.arrayOf(e.exports.oneOfType([e.exports.func,e.exports.object,e.exports.bool])),e.exports.func,e.exports.object]),value:e.exports.any};const J=v;export{J as C};
|
||||
import{X as u,y as r,t as P,q as B,s as S,Y as T,V as C,x as n,Z as M,r as d,v as R,w as j,z as H,D as e,U,G as V}from"./index.3292d49b.js";import{S as _}from"./FormControlLabel.d236a1c6.js";const w=u(r("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"),N=u(r("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=u(r("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 q(o){return B("MuiCheckbox",o)}const E=P("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary"]),x=E,F=["checkedIcon","color","icon","indeterminate","indeterminateIcon","inputProps","size","className"],D=o=>{const{classes:t,indeterminate:s,color:a}=o,i={root:["root",s&&"indeterminate",`color${C(a)}`]},c=V(i,q,t);return n({},t,c)},G=S(_,{shouldForwardProp:o=>T(o)||o==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(o,t)=>{const{ownerState:s}=o;return[t.root,s.indeterminate&&t.indeterminate,s.color!=="default"&&t[`color${C(s.color)}`]]}})(({theme:o,ownerState:t})=>n({color:(o.vars||o).palette.text.secondary},!t.disableRipple&&{"&:hover":{backgroundColor:o.vars?`rgba(${t.color==="default"?o.vars.palette.action.activeChannel:o.vars.palette.primary.mainChannel} / ${o.vars.palette.action.hoverOpacity})`:M(t.color==="default"?o.palette.action.active:o.palette[t.color].main,o.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},t.color!=="default"&&{[`&.${x.checked}, &.${x.indeterminate}`]:{color:(o.vars||o).palette[t.color].main},[`&.${x.disabled}`]:{color:(o.vars||o).palette.action.disabled}})),W=r(N,{}),X=r(w,{}),Y=r(L,{}),v=d.exports.forwardRef(function(t,s){var a,i;const c=R({props:t,name:"MuiCheckbox"}),{checkedIcon:y=W,color:I="primary",icon:z=X,indeterminate:l=!1,indeterminateIcon:m=Y,inputProps:g,size:p="medium",className:$}=c,O=j(c,F),h=l?m:z,f=l?m:y,b=n({},c,{color:I,indeterminate:l,size:p}),k=D(b);return r(G,n({type:"checkbox",inputProps:n({"data-indeterminate":l},g),icon:d.exports.cloneElement(h,{fontSize:(a=h.props.fontSize)!=null?a:p}),checkedIcon:d.exports.cloneElement(f,{fontSize:(i=f.props.fontSize)!=null?i:p}),ownerState:b,ref:s,className:H(k.root,$)},O,{classes:k}))});v.propTypes={checked:e.exports.bool,checkedIcon:e.exports.node,classes:e.exports.object,className:e.exports.string,color:e.exports.oneOfType([e.exports.oneOf(["default","primary","secondary","error","info","success","warning"]),e.exports.string]),defaultChecked:e.exports.bool,disabled:e.exports.bool,disableRipple:e.exports.bool,icon:e.exports.node,id:e.exports.string,indeterminate:e.exports.bool,indeterminateIcon:e.exports.node,inputProps:e.exports.object,inputRef:U,onChange:e.exports.func,required:e.exports.bool,size:e.exports.oneOfType([e.exports.oneOf(["medium","small"]),e.exports.string]),sx:e.exports.oneOfType([e.exports.arrayOf(e.exports.oneOfType([e.exports.func,e.exports.object,e.exports.bool])),e.exports.func,e.exports.object]),value:e.exports.any};const J=v;export{J as C};
|
||||
@@ -1 +1 @@
|
||||
import{C as o}from"./ConfiguredCorporateContext.15968be6.js";import{j as e,S as s,aU as a}from"./index.228177b0.js";var r="/var/www/aso/frontend/dashboard/src/pages/Corporates/ConfigLayout.tsx";function l(){return e.exports.jsxDEV(s,{sx:{display:{lg:"flex"},minHeight:{lg:1}},children:e.exports.jsxDEV(o,{children:e.exports.jsxDEV(a,{},void 0,!1,{fileName:r,lineNumber:15,columnNumber:9},this)},void 0,!1,{fileName:r,lineNumber:14,columnNumber:7},this)},void 0,!1,{fileName:r,lineNumber:8,columnNumber:5},this)}export{l as default};
|
||||
import{C as o}from"./ConfiguredCorporateContext.687ccf2a.js";import{j as e,S as s,aU as a}from"./index.3292d49b.js";var r="/var/www/aso/frontend/dashboard/src/pages/Corporates/ConfigLayout.tsx";function l(){return e.exports.jsxDEV(s,{sx:{display:{lg:"flex"},minHeight:{lg:1}},children:e.exports.jsxDEV(o,{children:e.exports.jsxDEV(a,{},void 0,!1,{fileName:r,lineNumber:15,columnNumber:9},this)},void 0,!1,{fileName:r,lineNumber:14,columnNumber:7},this)},void 0,!1,{fileName:r,lineNumber:8,columnNumber:5},this)}export{l as default};
|
||||
@@ -1 +1 @@
|
||||
import{r as e,aV as n,a0 as c,j as i}from"./index.228177b0.js";var u="/var/www/aso/frontend/dashboard/src/contexts/ConfiguredCorporateContext.tsx";const p={currentCorporate:null},l=e.exports.createContext(p);function C({children:o}){const{corporate_id:r}=n(),[t,a]=e.exports.useState(null);return e.exports.useEffect(()=>{console.log("calling corporate"+r),c.get(`corporates/${r}`).then(s=>{a(s.data)})},[]),i.exports.jsxDEV(l.Provider,{value:{currentCorporate:t},children:o},void 0,!1,{fileName:u,lineNumber:39,columnNumber:5},this)}export{C,l as a};
|
||||
import{r as e,aV as n,a0 as c,j as i}from"./index.3292d49b.js";var u="/var/www/aso/frontend/dashboard/src/contexts/ConfiguredCorporateContext.tsx";const p={currentCorporate:null},l=e.exports.createContext(p);function C({children:o}){const{corporate_id:r}=n(),[t,a]=e.exports.useState(null);return e.exports.useEffect(()=>{console.log("calling corporate"+r),c.get(`corporates/${r}`).then(s=>{a(s.data)})},[]),i.exports.jsxDEV(l.Provider,{value:{currentCorporate:t},children:o},void 0,!1,{fileName:u,lineNumber:39,columnNumber:5},this)}export{C,l as a};
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
import{ar as t,u as s,j as e,C as i,T as a}from"./index.228177b0.js";import{P as n}from"./Page.2d491b97.js";var r="/var/www/aso/frontend/dashboard/src/pages/Medicines/Create.tsx";function l(){const{themeStretch:q}=t();return s(),e.exports.jsxDEV(n,{title:"Create Obat",children:e.exports.jsxDEV(i,{maxWidth:q?!1:"xl",children:[e.exports.jsxDEV(a,{variant:"h3",component:"h1",paragraph:!0,children:"Create Obat"},void 0,!1,{fileName:r,lineNumber:25,columnNumber:9},this),e.exports.jsxDEV(a,{children:"qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq"},void 0,!1,{fileName:r,lineNumber:28,columnNumber:9},this)]},void 0,!0,{fileName:r,lineNumber:24,columnNumber:7},this)},void 0,!1,{fileName:r,lineNumber:23,columnNumber:5},this)}export{l as default};
|
||||
import{ar as t,u as s,j as e,C as i,T as a}from"./index.3292d49b.js";import{P as n}from"./Page.bd0996f6.js";var r="/var/www/aso/frontend/dashboard/src/pages/Medicines/Create.tsx";function l(){const{themeStretch:q}=t();return s(),e.exports.jsxDEV(n,{title:"Create Obat",children:e.exports.jsxDEV(i,{maxWidth:q?!1:"xl",children:[e.exports.jsxDEV(a,{variant:"h3",component:"h1",paragraph:!0,children:"Create Obat"},void 0,!1,{fileName:r,lineNumber:25,columnNumber:9},this),e.exports.jsxDEV(a,{children:"qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq"},void 0,!1,{fileName:r,lineNumber:28,columnNumber:9},this)]},void 0,!0,{fileName:r,lineNumber:24,columnNumber:7},this)},void 0,!1,{fileName:r,lineNumber:23,columnNumber:5},this)}export{l as default};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
import{H as y}from"./HeaderBreadcrumbs.fb23a62b.js";import{P as C}from"./Page.2d491b97.js";import{bG as q,a as V,aV as D,c as R,d as v,r as c,e as k,j as a,F as H,S as _,T as G,R as g,i as T,a0 as p,o as U,ar as $}from"./index.228177b0.js";import{R as z}from"./RHFSwitch.4e33a26b.js";import{G as u}from"./Grid.86fbe9c8.js";import{C as j}from"./Card.16f0d31f.js";import"./FormControlLabel.b626fc05.js";import"./requirePropFactory.ef3816bc.js";var s="/var/www/aso/frontend/dashboard/src/pages/Corporates/CorporateBenefit/Form.tsx";function A({isEdit:r,currentCorporateBenefit:e}){const{enqueueSnackbar:o}=q(),n=V(),{corporate_id:m}=D(),l=R().shape({name:v().required("Name is required"),code:v().required("Corporate Code is required")}),i=c.exports.useMemo(()=>({name:(e==null?void 0:e.name)||"",code:(e==null?void 0:e.code)||"",active:(e==null?void 0:e.active)===1}),[e]);c.exports.useEffect(()=>{r&&e&&b(i),r||b(i)},[r,e]);const f=k({resolver:U(l),defaultValues:i}),{reset:b,watch:L,control:M,setValue:O,getValues:W,setError:E,handleSubmit:F,formState:{isSubmitting:S}}=f,w=async N=>{r?await p.put("/corporate/"+m+"/corporate-benefits/"+(e==null?void 0:e.id),N).then(t=>{o("Corporate Benefit updated successfully",{variant:"success"})}).then(t=>{n("/corporate/"+m+"/corporate-benefits/",{replace:!0})}).catch(({response:t})=>{o("Update Failed : "+t.data.message,{variant:"error"})}):await p.post("/corporate/"+m+"/corporate-benefits",N).then(t=>{o("Corporate Plan created successfully",{variant:"success"})}).then(t=>{n("/corporate/"+m+"/corporate-benefits",{replace:!0})}).catch(({response:t})=>{var h;if(t.status===422)for(const[P,x]of Object.entries(t.data.errors))E(P,{message:x[0]}),o((h=x[0])!=null?h:"Failed Processing Request",{variant:"error"});else o("Create Failed : "+t.data.message,{variant:"error"})})};return a.exports.jsxDEV(H,{methods:f,onSubmit:F(w),children:a.exports.jsxDEV(u,{container:!0,spacing:2,children:[a.exports.jsxDEV(u,{item:!0,xs:8,children:a.exports.jsxDEV(j,{sx:{p:2},children:a.exports.jsxDEV(_,{spacing:3,children:[a.exports.jsxDEV(G,{variant:"h6",children:"Corporate Benefit Detail"},void 0,!1,{fileName:s,lineNumber:107,columnNumber:19},this),a.exports.jsxDEV(g,{name:"name",label:"Name"},void 0,!1,{fileName:s,lineNumber:109,columnNumber:19},this),a.exports.jsxDEV(g,{name:"code",label:"Code"},void 0,!1,{fileName:s,lineNumber:111,columnNumber:19},this),a.exports.jsxDEV(T,{type:"submit",variant:"contained",size:"large",fullWidth:!0,loading:S,children:r?"Update":"Create"},void 0,!1,{fileName:s,lineNumber:113,columnNumber:19},this)]},void 0,!0,{fileName:s,lineNumber:105,columnNumber:17},this)},void 0,!1,{fileName:s,lineNumber:104,columnNumber:13},this)},void 0,!1,{fileName:s,lineNumber:103,columnNumber:11},this),a.exports.jsxDEV(u,{item:!0,xs:4,children:a.exports.jsxDEV(j,{sx:{p:2},children:a.exports.jsxDEV(z,{name:"active",label:"Active"},void 0,!1,{fileName:s,lineNumber:123,columnNumber:13},this)},void 0,!1,{fileName:s,lineNumber:121,columnNumber:13},this)},void 0,!1,{fileName:s,lineNumber:120,columnNumber:11},this)]},void 0,!0,{fileName:s,lineNumber:102,columnNumber:9},this)},void 0,!1,{fileName:s,lineNumber:101,columnNumber:5},this)}var d="/var/www/aso/frontend/dashboard/src/pages/Corporates/CorporateBenefit/CreateUpdate.tsx";function ee(){$();const{corporate_id:r,id:e}=D(),[o,n]=c.exports.useState(),m=V(),l=!!e;return c.exports.useEffect(()=>{l&&p.get("/corporates/"+r+"/corporate-benefits/"+e+"/edit").then(i=>{n(i.data)}).catch(i=>{i.response.status===404&&m("/404")})},[r,e]),a.exports.jsxDEV(C,{title:"Create Corporate Benefit",children:[a.exports.jsxDEV(y,{heading:"Create Corporate Benefit",links:[{name:"Corporates",href:"/corporates"},{name:"Corporate Name",href:"/corporates/"+r},{name:"Corporate Benefits",href:"/corporates/"+r+"/corporate-benefits"},{name:l?"Edit":"Create",href:"/corporates/"+r+"/corporate-benefits/"+e}]},void 0,!1,{fileName:d,lineNumber:39,columnNumber:7},this),a.exports.jsxDEV(A,{isEdit:l,currentCorporateBenefit:o},void 0,!1,{fileName:d,lineNumber:61,columnNumber:7},this)]},void 0,!0,{fileName:d,lineNumber:38,columnNumber:5},this)}export{ee as default};
|
||||
import{H as y}from"./HeaderBreadcrumbs.e8bafe8a.js";import{P as C}from"./Page.bd0996f6.js";import{bG as q,a as V,aV as D,c as R,d as v,r as c,e as k,j as a,F as H,S as _,T as G,R as g,i as T,a0 as p,o as U,ar as $}from"./index.3292d49b.js";import{R as z}from"./RHFSwitch.de11fb0d.js";import{G as u}from"./Grid.099c6905.js";import{C as j}from"./Card.af331726.js";import"./FormControlLabel.d236a1c6.js";import"./requirePropFactory.49d10b2d.js";var s="/var/www/aso/frontend/dashboard/src/pages/Corporates/CorporateBenefit/Form.tsx";function A({isEdit:r,currentCorporateBenefit:e}){const{enqueueSnackbar:o}=q(),n=V(),{corporate_id:m}=D(),l=R().shape({name:v().required("Name is required"),code:v().required("Corporate Code is required")}),i=c.exports.useMemo(()=>({name:(e==null?void 0:e.name)||"",code:(e==null?void 0:e.code)||"",active:(e==null?void 0:e.active)===1}),[e]);c.exports.useEffect(()=>{r&&e&&b(i),r||b(i)},[r,e]);const f=k({resolver:U(l),defaultValues:i}),{reset:b,watch:L,control:M,setValue:O,getValues:W,setError:E,handleSubmit:F,formState:{isSubmitting:S}}=f,w=async N=>{r?await p.put("/corporate/"+m+"/corporate-benefits/"+(e==null?void 0:e.id),N).then(t=>{o("Corporate Benefit updated successfully",{variant:"success"})}).then(t=>{n("/corporate/"+m+"/corporate-benefits/",{replace:!0})}).catch(({response:t})=>{o("Update Failed : "+t.data.message,{variant:"error"})}):await p.post("/corporate/"+m+"/corporate-benefits",N).then(t=>{o("Corporate Plan created successfully",{variant:"success"})}).then(t=>{n("/corporate/"+m+"/corporate-benefits",{replace:!0})}).catch(({response:t})=>{var h;if(t.status===422)for(const[P,x]of Object.entries(t.data.errors))E(P,{message:x[0]}),o((h=x[0])!=null?h:"Failed Processing Request",{variant:"error"});else o("Create Failed : "+t.data.message,{variant:"error"})})};return a.exports.jsxDEV(H,{methods:f,onSubmit:F(w),children:a.exports.jsxDEV(u,{container:!0,spacing:2,children:[a.exports.jsxDEV(u,{item:!0,xs:8,children:a.exports.jsxDEV(j,{sx:{p:2},children:a.exports.jsxDEV(_,{spacing:3,children:[a.exports.jsxDEV(G,{variant:"h6",children:"Corporate Benefit Detail"},void 0,!1,{fileName:s,lineNumber:107,columnNumber:19},this),a.exports.jsxDEV(g,{name:"name",label:"Name"},void 0,!1,{fileName:s,lineNumber:109,columnNumber:19},this),a.exports.jsxDEV(g,{name:"code",label:"Code"},void 0,!1,{fileName:s,lineNumber:111,columnNumber:19},this),a.exports.jsxDEV(T,{type:"submit",variant:"contained",size:"large",fullWidth:!0,loading:S,children:r?"Update":"Create"},void 0,!1,{fileName:s,lineNumber:113,columnNumber:19},this)]},void 0,!0,{fileName:s,lineNumber:105,columnNumber:17},this)},void 0,!1,{fileName:s,lineNumber:104,columnNumber:13},this)},void 0,!1,{fileName:s,lineNumber:103,columnNumber:11},this),a.exports.jsxDEV(u,{item:!0,xs:4,children:a.exports.jsxDEV(j,{sx:{p:2},children:a.exports.jsxDEV(z,{name:"active",label:"Active"},void 0,!1,{fileName:s,lineNumber:123,columnNumber:13},this)},void 0,!1,{fileName:s,lineNumber:121,columnNumber:13},this)},void 0,!1,{fileName:s,lineNumber:120,columnNumber:11},this)]},void 0,!0,{fileName:s,lineNumber:102,columnNumber:9},this)},void 0,!1,{fileName:s,lineNumber:101,columnNumber:5},this)}var d="/var/www/aso/frontend/dashboard/src/pages/Corporates/CorporateBenefit/CreateUpdate.tsx";function ee(){$();const{corporate_id:r,id:e}=D(),[o,n]=c.exports.useState(),m=V(),l=!!e;return c.exports.useEffect(()=>{l&&p.get("/corporates/"+r+"/corporate-benefits/"+e+"/edit").then(i=>{n(i.data)}).catch(i=>{i.response.status===404&&m("/404")})},[r,e]),a.exports.jsxDEV(C,{title:"Create Corporate Benefit",children:[a.exports.jsxDEV(y,{heading:"Create Corporate Benefit",links:[{name:"Corporates",href:"/corporates"},{name:"Corporate Name",href:"/corporates/"+r},{name:"Corporate Benefits",href:"/corporates/"+r+"/corporate-benefits"},{name:l?"Edit":"Create",href:"/corporates/"+r+"/corporate-benefits/"+e}]},void 0,!1,{fileName:d,lineNumber:39,columnNumber:7},this),a.exports.jsxDEV(A,{isEdit:l,currentCorporateBenefit:o},void 0,!1,{fileName:d,lineNumber:61,columnNumber:7},this)]},void 0,!0,{fileName:d,lineNumber:38,columnNumber:5},this)}export{ee as default};
|
||||
@@ -1 +1 @@
|
||||
import{H as q}from"./HeaderBreadcrumbs.fb23a62b.js";import{P as R}from"./Page.2d491b97.js";import{bG as k,a as j,aV as V,c as H,d as p,r as u,e as _,j as s,F as G,S as T,T as U,R as D,i as B,a0 as f,o as $,ar as z}from"./index.228177b0.js";import{R as A}from"./RHFSwitch.4e33a26b.js";import{G as d}from"./Grid.86fbe9c8.js";import{C as g}from"./Card.16f0d31f.js";import"./FormControlLabel.b626fc05.js";import"./requirePropFactory.ef3816bc.js";var i="/var/www/aso/frontend/dashboard/src/pages/Corporates/Division/Form.tsx";function C({isEdit:a,currentCorporatePlan:e}){const{enqueueSnackbar:o}=k(),l=j(),{corporate_id:m}=V(),n=H().shape({name:p().required("Name is required"),code:p().required("Corporate Code is required")}),r=u.exports.useMemo(()=>({name:(e==null?void 0:e.name)||"",code:(e==null?void 0:e.code)||"",active:(e==null?void 0:e.active)===1}),[e]);u.exports.useEffect(()=>{a&&e&&N(r),a||N(r)},[a,e]);const v=_({resolver:$(n),defaultValues:r}),{reset:N,watch:L,control:M,setValue:O,getValues:W,setError:E,handleSubmit:F,formState:{isSubmitting:S}}=v,w=async h=>{a?await f.put("/corporate/"+m+"/divisions/"+(e==null?void 0:e.id),h).then(t=>{o("Division updated successfully",{variant:"success"})}).then(t=>{l("/corporate/"+m+"/divisions/",{replace:!0})}).catch(({response:t})=>{o("Update Failed : "+t.data.message,{variant:"error"})}):await f.post("/corporate/"+m+"/divisions",h).then(t=>{o("Division created successfully",{variant:"success"})}).then(t=>{l("/corporate/"+m+"/divisions",{replace:!0})}).catch(({response:t})=>{var x;if(t.status===422)for(const[y,b]of Object.entries(t.data.errors))E(y,{message:b[0]}),o((x=b[0])!=null?x:"Failed Processing Request",{variant:"error"});else o("Create Failed : "+t.data.message,{variant:"error"})})};return s.exports.jsxDEV(G,{methods:v,onSubmit:F(w),children:s.exports.jsxDEV(d,{container:!0,spacing:2,children:[s.exports.jsxDEV(d,{item:!0,xs:8,children:s.exports.jsxDEV(g,{sx:{p:2},children:s.exports.jsxDEV(T,{spacing:3,children:[s.exports.jsxDEV(U,{variant:"h6",children:"Division Detail"},void 0,!1,{fileName:i,lineNumber:107,columnNumber:19},this),s.exports.jsxDEV(D,{name:"name",label:"Name"},void 0,!1,{fileName:i,lineNumber:109,columnNumber:19},this),s.exports.jsxDEV(D,{name:"code",label:"Code"},void 0,!1,{fileName:i,lineNumber:111,columnNumber:19},this),s.exports.jsxDEV(B,{type:"submit",variant:"contained",size:"large",fullWidth:!0,loading:S,children:a?"Update":"Create"},void 0,!1,{fileName:i,lineNumber:113,columnNumber:19},this)]},void 0,!0,{fileName:i,lineNumber:105,columnNumber:17},this)},void 0,!1,{fileName:i,lineNumber:104,columnNumber:13},this)},void 0,!1,{fileName:i,lineNumber:103,columnNumber:11},this),s.exports.jsxDEV(d,{item:!0,xs:4,children:s.exports.jsxDEV(g,{sx:{p:2},children:s.exports.jsxDEV(A,{name:"active",label:"Active"},void 0,!1,{fileName:i,lineNumber:123,columnNumber:13},this)},void 0,!1,{fileName:i,lineNumber:121,columnNumber:13},this)},void 0,!1,{fileName:i,lineNumber:120,columnNumber:11},this)]},void 0,!0,{fileName:i,lineNumber:102,columnNumber:9},this)},void 0,!1,{fileName:i,lineNumber:101,columnNumber:5},this)}var c="/var/www/aso/frontend/dashboard/src/pages/Corporates/Division/CreateUpdate.tsx";function ee(){z();const{corporate_id:a,id:e}=V(),[o,l]=u.exports.useState(),m=j(),n=!!e;return u.exports.useEffect(()=>{n&&f.get("/corporates/"+a+"/divisions/"+e+"/edit").then(r=>{l(r.data)}).catch(r=>{r.response.status===404&&m("/404")})},[a,e]),s.exports.jsxDEV(R,{title:"Create Corporate Division",children:[s.exports.jsxDEV(q,{heading:"Create Corporate Division",links:[{name:"Corporates",href:"/corporates"},{name:"Corporate Name",href:"/corporates/"+a},{name:"Division",href:"/corporates/"+a+"/divisions"},{name:n?"Edit":"Create",href:"/corporates/"+a+"/divisions/"+e}]},void 0,!1,{fileName:c,lineNumber:39,columnNumber:7},this),s.exports.jsxDEV(C,{isEdit:n,currentCorporatePlan:o},void 0,!1,{fileName:c,lineNumber:61,columnNumber:7},this)]},void 0,!0,{fileName:c,lineNumber:38,columnNumber:5},this)}export{ee as default};
|
||||
import{H as q}from"./HeaderBreadcrumbs.e8bafe8a.js";import{P as R}from"./Page.bd0996f6.js";import{bG as k,a as j,aV as V,c as H,d as p,r as u,e as _,j as s,F as G,S as T,T as U,R as D,i as B,a0 as f,o as $,ar as z}from"./index.3292d49b.js";import{R as A}from"./RHFSwitch.de11fb0d.js";import{G as d}from"./Grid.099c6905.js";import{C as g}from"./Card.af331726.js";import"./FormControlLabel.d236a1c6.js";import"./requirePropFactory.49d10b2d.js";var i="/var/www/aso/frontend/dashboard/src/pages/Corporates/Division/Form.tsx";function C({isEdit:a,currentCorporatePlan:e}){const{enqueueSnackbar:o}=k(),l=j(),{corporate_id:m}=V(),n=H().shape({name:p().required("Name is required"),code:p().required("Corporate Code is required")}),r=u.exports.useMemo(()=>({name:(e==null?void 0:e.name)||"",code:(e==null?void 0:e.code)||"",active:(e==null?void 0:e.active)===1}),[e]);u.exports.useEffect(()=>{a&&e&&N(r),a||N(r)},[a,e]);const v=_({resolver:$(n),defaultValues:r}),{reset:N,watch:L,control:M,setValue:O,getValues:W,setError:E,handleSubmit:F,formState:{isSubmitting:S}}=v,w=async h=>{a?await f.put("/corporate/"+m+"/divisions/"+(e==null?void 0:e.id),h).then(t=>{o("Division updated successfully",{variant:"success"})}).then(t=>{l("/corporate/"+m+"/divisions/",{replace:!0})}).catch(({response:t})=>{o("Update Failed : "+t.data.message,{variant:"error"})}):await f.post("/corporate/"+m+"/divisions",h).then(t=>{o("Division created successfully",{variant:"success"})}).then(t=>{l("/corporate/"+m+"/divisions",{replace:!0})}).catch(({response:t})=>{var x;if(t.status===422)for(const[y,b]of Object.entries(t.data.errors))E(y,{message:b[0]}),o((x=b[0])!=null?x:"Failed Processing Request",{variant:"error"});else o("Create Failed : "+t.data.message,{variant:"error"})})};return s.exports.jsxDEV(G,{methods:v,onSubmit:F(w),children:s.exports.jsxDEV(d,{container:!0,spacing:2,children:[s.exports.jsxDEV(d,{item:!0,xs:8,children:s.exports.jsxDEV(g,{sx:{p:2},children:s.exports.jsxDEV(T,{spacing:3,children:[s.exports.jsxDEV(U,{variant:"h6",children:"Division Detail"},void 0,!1,{fileName:i,lineNumber:107,columnNumber:19},this),s.exports.jsxDEV(D,{name:"name",label:"Name"},void 0,!1,{fileName:i,lineNumber:109,columnNumber:19},this),s.exports.jsxDEV(D,{name:"code",label:"Code"},void 0,!1,{fileName:i,lineNumber:111,columnNumber:19},this),s.exports.jsxDEV(B,{type:"submit",variant:"contained",size:"large",fullWidth:!0,loading:S,children:a?"Update":"Create"},void 0,!1,{fileName:i,lineNumber:113,columnNumber:19},this)]},void 0,!0,{fileName:i,lineNumber:105,columnNumber:17},this)},void 0,!1,{fileName:i,lineNumber:104,columnNumber:13},this)},void 0,!1,{fileName:i,lineNumber:103,columnNumber:11},this),s.exports.jsxDEV(d,{item:!0,xs:4,children:s.exports.jsxDEV(g,{sx:{p:2},children:s.exports.jsxDEV(A,{name:"active",label:"Active"},void 0,!1,{fileName:i,lineNumber:123,columnNumber:13},this)},void 0,!1,{fileName:i,lineNumber:121,columnNumber:13},this)},void 0,!1,{fileName:i,lineNumber:120,columnNumber:11},this)]},void 0,!0,{fileName:i,lineNumber:102,columnNumber:9},this)},void 0,!1,{fileName:i,lineNumber:101,columnNumber:5},this)}var c="/var/www/aso/frontend/dashboard/src/pages/Corporates/Division/CreateUpdate.tsx";function ee(){z();const{corporate_id:a,id:e}=V(),[o,l]=u.exports.useState(),m=j(),n=!!e;return u.exports.useEffect(()=>{n&&f.get("/corporates/"+a+"/divisions/"+e+"/edit").then(r=>{l(r.data)}).catch(r=>{r.response.status===404&&m("/404")})},[a,e]),s.exports.jsxDEV(R,{title:"Create Corporate Division",children:[s.exports.jsxDEV(q,{heading:"Create Corporate Division",links:[{name:"Corporates",href:"/corporates"},{name:"Corporate Name",href:"/corporates/"+a},{name:"Division",href:"/corporates/"+a+"/divisions"},{name:n?"Edit":"Create",href:"/corporates/"+a+"/divisions/"+e}]},void 0,!1,{fileName:c,lineNumber:39,columnNumber:7},this),s.exports.jsxDEV(C,{isEdit:n,currentCorporatePlan:o},void 0,!1,{fileName:c,lineNumber:61,columnNumber:7},this)]},void 0,!0,{fileName:c,lineNumber:38,columnNumber:5},this)}export{ee as default};
|
||||
@@ -1 +1 @@
|
||||
import{H as k}from"./HeaderBreadcrumbs.fb23a62b.js";import{P as H}from"./Page.2d491b97.js";import{bG as _,a as E,aV as F,c as C,d as v,r as c,e as G,j as s,F as T,S as j,T as g,R as V,i as B,a0 as p,o as U,ar as $}from"./index.228177b0.js";import{R as z}from"./RHFSwitch.4e33a26b.js";import{R as A}from"./RHFEditor.abea8364.js";import{G as u}from"./Grid.86fbe9c8.js";import{C as D}from"./Card.16f0d31f.js";import"./FormControlLabel.b626fc05.js";import"./requirePropFactory.ef3816bc.js";var a="/var/www/aso/frontend/dashboard/src/pages/Corporates/CorporatePlan/Form.tsx";function L({isEdit:i,currentCorporatePlan:e}){const{enqueueSnackbar:r}=_(),n=E(),{corporate_id:m}=F(),l=C().shape({name:v().required("Name is required"),code:v().required("Corporate Code is required")}),o=c.exports.useMemo(()=>({name:(e==null?void 0:e.name)||"",code:(e==null?void 0:e.code)||"",active:(e==null?void 0:e.active)||!0,description:(e==null?void 0:e.description)||""}),[e]);c.exports.useEffect(()=>{i&&e&&N(o),i||N(o)},[i,e]);const f=G({resolver:U(l),defaultValues:o}),{reset:N,watch:M,control:O,setValue:W,getValues:I,setError:S,handleSubmit:w,formState:{isSubmitting:y}}=f,R=async h=>{i?await p.put("/corporate/"+m+"/corporate-plans/"+(e==null?void 0:e.id),h).then(t=>{r("Corporate Plan updated successfully",{variant:"success"})}).then(t=>{n("/corporate/"+m+"/corporate-plans/",{replace:!0})}).catch(({response:t})=>{r("Update Failed : "+t.data.message,{variant:"error"})}):await p.post("/corporate/"+m+"/corporate-plans",h).then(t=>{r("Corporate Plan created successfully",{variant:"success"})}).then(t=>{n("/corporate/"+m+"/corporate-plans",{replace:!0})}).catch(({response:t})=>{var x;if(t.status===422)for(const[q,b]of Object.entries(t.data.errors))S(q,{message:b[0]}),r((x=b[0])!=null?x:"Failed Processing Request",{variant:"error"});else r("Create Failed : "+t.data.message,{variant:"error"})})};return s.exports.jsxDEV(T,{methods:f,onSubmit:w(R),children:s.exports.jsxDEV(u,{container:!0,spacing:2,children:[s.exports.jsxDEV(u,{item:!0,xs:8,children:s.exports.jsxDEV(D,{sx:{p:2},children:s.exports.jsxDEV(j,{spacing:3,children:[s.exports.jsxDEV(g,{variant:"h6",children:"Corporate Plan Detail"},void 0,!1,{fileName:a,lineNumber:105,columnNumber:15},this),s.exports.jsxDEV(V,{name:"name",label:"Name"},void 0,!1,{fileName:a,lineNumber:107,columnNumber:15},this),s.exports.jsxDEV(V,{name:"code",label:"Code"},void 0,!1,{fileName:a,lineNumber:109,columnNumber:15},this),s.exports.jsxDEV(j,{spacing:1,children:[s.exports.jsxDEV(g,{variant:"subtitle2",sx:{color:"text.secondary"},children:"Description"},void 0,!1,{fileName:a,lineNumber:112,columnNumber:17},this),s.exports.jsxDEV(A,{name:"description"},void 0,!1,{fileName:a,lineNumber:115,columnNumber:17},this)]},void 0,!0,{fileName:a,lineNumber:111,columnNumber:15},this),s.exports.jsxDEV(B,{type:"submit",variant:"contained",size:"large",fullWidth:!0,loading:y,children:"Create Corporate Plan"},void 0,!1,{fileName:a,lineNumber:118,columnNumber:15},this)]},void 0,!0,{fileName:a,lineNumber:104,columnNumber:13},this)},void 0,!1,{fileName:a,lineNumber:103,columnNumber:11},this)},void 0,!1,{fileName:a,lineNumber:102,columnNumber:9},this),s.exports.jsxDEV(u,{item:!0,xs:4,children:s.exports.jsxDEV(D,{sx:{p:2},children:s.exports.jsxDEV(z,{name:"active",label:"Active"},void 0,!1,{fileName:a,lineNumber:132,columnNumber:13},this)},void 0,!1,{fileName:a,lineNumber:131,columnNumber:11},this)},void 0,!1,{fileName:a,lineNumber:130,columnNumber:9},this)]},void 0,!0,{fileName:a,lineNumber:101,columnNumber:7},this)},void 0,!1,{fileName:a,lineNumber:100,columnNumber:5},this)}var d="/var/www/aso/frontend/dashboard/src/pages/Corporates/CorporatePlan/CreateUpdate.tsx";function ae(){$();const{corporate_id:i,id:e}=F(),[r,n]=c.exports.useState(),m=E(),l=!!e;return c.exports.useEffect(()=>{l&&p.get("/corporates/"+i+"/corporate-plans/"+e+"/edit").then(o=>{n(o.data)}).catch(o=>{o.response.status===404&&m("/404")})},[i,e]),s.exports.jsxDEV(H,{title:"Create Corporate Plan",children:[s.exports.jsxDEV(k,{heading:"Create Corporate Plan",links:[{name:"Corporates",href:"/corporates"},{name:"Corporate Name",href:"/corporates/"+i},{name:"Corporate Plans",href:"/corporates/"+i+"/corporate-plans"},{name:l?"Edit":"Create",href:"/corporates/"+i+"/corporate-plans/"+e}]},void 0,!1,{fileName:d,lineNumber:39,columnNumber:7},this),s.exports.jsxDEV(L,{isEdit:l,currentCorporatePlan:r},void 0,!1,{fileName:d,lineNumber:61,columnNumber:7},this)]},void 0,!0,{fileName:d,lineNumber:38,columnNumber:5},this)}export{ae as default};
|
||||
import{H as k}from"./HeaderBreadcrumbs.e8bafe8a.js";import{P as H}from"./Page.bd0996f6.js";import{bG as _,a as E,aV as F,c as C,d as v,r as c,e as G,j as s,F as T,S as j,T as g,R as V,i as B,a0 as p,o as U,ar as $}from"./index.3292d49b.js";import{R as z}from"./RHFSwitch.de11fb0d.js";import{R as A}from"./RHFEditor.d9f82361.js";import{G as u}from"./Grid.099c6905.js";import{C as D}from"./Card.af331726.js";import"./FormControlLabel.d236a1c6.js";import"./requirePropFactory.49d10b2d.js";var a="/var/www/aso/frontend/dashboard/src/pages/Corporates/CorporatePlan/Form.tsx";function L({isEdit:i,currentCorporatePlan:e}){const{enqueueSnackbar:r}=_(),n=E(),{corporate_id:m}=F(),l=C().shape({name:v().required("Name is required"),code:v().required("Corporate Code is required")}),o=c.exports.useMemo(()=>({name:(e==null?void 0:e.name)||"",code:(e==null?void 0:e.code)||"",active:(e==null?void 0:e.active)||!0,description:(e==null?void 0:e.description)||""}),[e]);c.exports.useEffect(()=>{i&&e&&N(o),i||N(o)},[i,e]);const f=G({resolver:U(l),defaultValues:o}),{reset:N,watch:M,control:O,setValue:W,getValues:I,setError:S,handleSubmit:w,formState:{isSubmitting:y}}=f,R=async h=>{i?await p.put("/corporate/"+m+"/corporate-plans/"+(e==null?void 0:e.id),h).then(t=>{r("Corporate Plan updated successfully",{variant:"success"})}).then(t=>{n("/corporate/"+m+"/corporate-plans/",{replace:!0})}).catch(({response:t})=>{r("Update Failed : "+t.data.message,{variant:"error"})}):await p.post("/corporate/"+m+"/corporate-plans",h).then(t=>{r("Corporate Plan created successfully",{variant:"success"})}).then(t=>{n("/corporate/"+m+"/corporate-plans",{replace:!0})}).catch(({response:t})=>{var x;if(t.status===422)for(const[q,b]of Object.entries(t.data.errors))S(q,{message:b[0]}),r((x=b[0])!=null?x:"Failed Processing Request",{variant:"error"});else r("Create Failed : "+t.data.message,{variant:"error"})})};return s.exports.jsxDEV(T,{methods:f,onSubmit:w(R),children:s.exports.jsxDEV(u,{container:!0,spacing:2,children:[s.exports.jsxDEV(u,{item:!0,xs:8,children:s.exports.jsxDEV(D,{sx:{p:2},children:s.exports.jsxDEV(j,{spacing:3,children:[s.exports.jsxDEV(g,{variant:"h6",children:"Corporate Plan Detail"},void 0,!1,{fileName:a,lineNumber:105,columnNumber:15},this),s.exports.jsxDEV(V,{name:"name",label:"Name"},void 0,!1,{fileName:a,lineNumber:107,columnNumber:15},this),s.exports.jsxDEV(V,{name:"code",label:"Code"},void 0,!1,{fileName:a,lineNumber:109,columnNumber:15},this),s.exports.jsxDEV(j,{spacing:1,children:[s.exports.jsxDEV(g,{variant:"subtitle2",sx:{color:"text.secondary"},children:"Description"},void 0,!1,{fileName:a,lineNumber:112,columnNumber:17},this),s.exports.jsxDEV(A,{name:"description"},void 0,!1,{fileName:a,lineNumber:115,columnNumber:17},this)]},void 0,!0,{fileName:a,lineNumber:111,columnNumber:15},this),s.exports.jsxDEV(B,{type:"submit",variant:"contained",size:"large",fullWidth:!0,loading:y,children:"Create Corporate Plan"},void 0,!1,{fileName:a,lineNumber:118,columnNumber:15},this)]},void 0,!0,{fileName:a,lineNumber:104,columnNumber:13},this)},void 0,!1,{fileName:a,lineNumber:103,columnNumber:11},this)},void 0,!1,{fileName:a,lineNumber:102,columnNumber:9},this),s.exports.jsxDEV(u,{item:!0,xs:4,children:s.exports.jsxDEV(D,{sx:{p:2},children:s.exports.jsxDEV(z,{name:"active",label:"Active"},void 0,!1,{fileName:a,lineNumber:132,columnNumber:13},this)},void 0,!1,{fileName:a,lineNumber:131,columnNumber:11},this)},void 0,!1,{fileName:a,lineNumber:130,columnNumber:9},this)]},void 0,!0,{fileName:a,lineNumber:101,columnNumber:7},this)},void 0,!1,{fileName:a,lineNumber:100,columnNumber:5},this)}var d="/var/www/aso/frontend/dashboard/src/pages/Corporates/CorporatePlan/CreateUpdate.tsx";function ae(){$();const{corporate_id:i,id:e}=F(),[r,n]=c.exports.useState(),m=E(),l=!!e;return c.exports.useEffect(()=>{l&&p.get("/corporates/"+i+"/corporate-plans/"+e+"/edit").then(o=>{n(o.data)}).catch(o=>{o.response.status===404&&m("/404")})},[i,e]),s.exports.jsxDEV(H,{title:"Create Corporate Plan",children:[s.exports.jsxDEV(k,{heading:"Create Corporate Plan",links:[{name:"Corporates",href:"/corporates"},{name:"Corporate Name",href:"/corporates/"+i},{name:"Corporate Plans",href:"/corporates/"+i+"/corporate-plans"},{name:l?"Edit":"Create",href:"/corporates/"+i+"/corporate-plans/"+e}]},void 0,!1,{fileName:d,lineNumber:39,columnNumber:7},this),s.exports.jsxDEV(L,{isEdit:l,currentCorporatePlan:r},void 0,!1,{fileName:d,lineNumber:61,columnNumber:7},this)]},void 0,!0,{fileName:d,lineNumber:38,columnNumber:5},this)}export{ae as default};
|
||||
@@ -1,4 +1,4 @@
|
||||
import{H as et}from"./HeaderBreadcrumbs.fb23a62b.js";import{P as tt}from"./Page.2d491b97.js";import{t as Ve,q as Ce,b_ as Ie,s as F,V as T,x as h,b$ as Se,r as f,v as Le,w as me,$ as rt,Q as De,y as $,z as se,D as s,G as Pe,aE as it,aF as ot,c0 as ce,Z as ae,c1 as st,aN as at,aJ as Ye,aQ as nt,c2 as Re,E as lt,c3 as ct,N as ut,X as Xe,j as e,S as B,ax as ye,aw as Ke,a2 as ue,a0 as de,a as mt,bG as dt,c as pt,d as Te,bH as ft,e as bt,F as Nt,T as z,R as Ae,ap as ne,M as Me,g as Oe,c4 as pe,f as fe,c5 as be,bZ as Ne,c6 as xe,i as we,o as xt,ar as ht,aV as vt,C as gt}from"./index.228177b0.js";import{M as Dt}from"./MuiDialog.7878f793.js";import{L as yt,a as jt}from"./LaravelTable.77482fb1.js";import{T as je,a as Q,b as V,c}from"./TableRow.5b574350.js";import{G as le}from"./Grid.86fbe9c8.js";import{A as Be}from"./Autocomplete.244d6537.js";import"./jsx-runtime_commonjs-proxy.aef95d3b.js";import"./requirePropFactory.ef3816bc.js";import"./unsupportedProp.69e7c162.js";import"./DialogContent.8840e521.js";import"./DialogTitle.1214888f.js";import"./BasePagination.0420dce5.js";import"./Card.16f0d31f.js";import"./TableContainer.fcccbd24.js";function Et(t){return Ce("MuiLinearProgress",t)}const Vt=Ve("MuiLinearProgress",["root","colorPrimary","colorSecondary","determinate","indeterminate","buffer","query","dashed","dashedColorPrimary","dashedColorSecondary","bar","barColorPrimary","barColorSecondary","bar1Indeterminate","bar1Determinate","bar1Buffer","bar2Indeterminate","bar2Buffer"]),Fe=Vt,Ct=["className","color","value","valueBuffer","variant"];let Z=t=>t,qe,Ge,Ue,ze,He,We;const Ee=4,It=Ie(qe||(qe=Z`
|
||||
import{H as et}from"./HeaderBreadcrumbs.e8bafe8a.js";import{P as tt}from"./Page.bd0996f6.js";import{t as Ve,q as Ce,b_ as Ie,s as F,V as T,x as h,b$ as Se,r as f,v as Le,w as me,$ as rt,Q as De,y as $,z as se,D as s,G as Pe,aE as it,aF as ot,c0 as ce,Z as ae,c1 as st,aN as at,aJ as Ye,aQ as nt,c2 as Re,E as lt,c3 as ct,N as ut,X as Xe,j as e,S as B,ax as ye,aw as Ke,a2 as ue,a0 as de,a as mt,bG as dt,c as pt,d as Te,bH as ft,e as bt,F as Nt,T as z,R as Ae,ap as ne,M as Me,g as Oe,c4 as pe,f as fe,c5 as be,bZ as Ne,c6 as xe,i as we,o as xt,ar as ht,aV as vt,C as gt}from"./index.3292d49b.js";import{M as Dt}from"./MuiDialog.9be85392.js";import{L as yt,a as jt}from"./LaravelTable.b8ea99da.js";import{T as je,a as Q,b as V,c}from"./TableRow.299dcced.js";import{G as le}from"./Grid.099c6905.js";import{A as Be}from"./Autocomplete.c236485f.js";import"./jsx-runtime_commonjs-proxy.3d631f7d.js";import"./requirePropFactory.49d10b2d.js";import"./unsupportedProp.69e7c162.js";import"./DialogContent.0e22b756.js";import"./DialogTitle.63dd1dd4.js";import"./BasePagination.374f773e.js";import"./Card.af331726.js";import"./TableContainer.738d1e09.js";function Et(t){return Ce("MuiLinearProgress",t)}const Vt=Ve("MuiLinearProgress",["root","colorPrimary","colorSecondary","determinate","indeterminate","buffer","query","dashed","dashedColorPrimary","dashedColorSecondary","bar","barColorPrimary","barColorSecondary","bar1Indeterminate","bar1Determinate","bar1Buffer","bar2Indeterminate","bar2Buffer"]),Fe=Vt,Ct=["className","color","value","valueBuffer","variant"];let Z=t=>t,qe,Ge,Ue,ze,He,We;const Ee=4,It=Ie(qe||(qe=Z`
|
||||
0% {
|
||||
left: -35%;
|
||||
right: 100%;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user