add config msc (belum kelar)
This commit is contained in:
@@ -74,6 +74,7 @@ class CorporateServiceController extends Controller
|
||||
public function update(Request $request, $corporate_id)
|
||||
{
|
||||
$corporateService = CorporateService::where('corporate_id', $corporate_id)->where('service_code', $request->service_code)->first();
|
||||
|
||||
$corporateServiceConfig = $corporateService->configs()->updateOrCreate([
|
||||
'corporate_service_id' => $corporateService->id,
|
||||
'name' => $request->config_name
|
||||
@@ -99,17 +100,21 @@ class CorporateServiceController extends Controller
|
||||
{
|
||||
$corporate = Corporate::findOrFail($corporate_id);
|
||||
$corporateService = CorporateService::query()
|
||||
->where('corporate_id', $corporate_id)
|
||||
->where('service_code', $service_code)
|
||||
->with(['configs', 'service',
|
||||
'specialities' => function($speciality) {
|
||||
$speciality->where('status', 'active');
|
||||
},
|
||||
'specialities.speciality'])
|
||||
->first();
|
||||
->where('corporate_id', $corporate_id)
|
||||
->where('service_code', $service_code)
|
||||
->with([
|
||||
'configs', 'service',
|
||||
'specialities' => function ($speciality) {
|
||||
$speciality->where('active', true);
|
||||
},
|
||||
'specialities.speciality',
|
||||
'specialities.exclusions.rules'
|
||||
])
|
||||
->first();
|
||||
|
||||
// $service = CorporateServiceConfigResource::make($corporateService);
|
||||
$specialities = Speciality::get();
|
||||
|
||||
|
||||
return response()->json(
|
||||
[
|
||||
'corporate' => $corporate,
|
||||
@@ -123,10 +128,10 @@ class CorporateServiceController extends Controller
|
||||
{
|
||||
// $corporate = Corporate::findOrFail($corporate_id);
|
||||
$corporateService = CorporateService::query()
|
||||
->where('corporate_id', $corporate_id)
|
||||
->where('service_code', $service_code)
|
||||
// ->with('configs', 'service')
|
||||
->first();
|
||||
->where('corporate_id', $corporate_id)
|
||||
->where('service_code', $service_code)
|
||||
// ->with('configs', 'service')
|
||||
->first();
|
||||
$corporateService->fill([
|
||||
'status' => $request->status == 'active' ? 'active' : 'inactive'
|
||||
]);
|
||||
@@ -137,25 +142,108 @@ class CorporateServiceController extends Controller
|
||||
|
||||
public function corporateServiceSpecialityUpdate(Request $request, $corporate_id, $service_code)
|
||||
{
|
||||
|
||||
|
||||
// return response()->json([$request->msc, $request->name, $request->speciality_id]);
|
||||
|
||||
$corporateService = CorporateService::query()
|
||||
->where('corporate_id', $corporate_id)
|
||||
->where('service_code', $service_code)
|
||||
->first();
|
||||
CorporateServiceSpeciality::updateOrCreate([
|
||||
->where('corporate_id', $corporate_id)
|
||||
->where('service_code', $service_code)
|
||||
->first();
|
||||
|
||||
|
||||
$corporateServiceSpeciality = CorporateServiceSpeciality::updateOrCreate([
|
||||
'corporate_service_id' => $corporateService->id,
|
||||
'speciality_id' => $request->speciality_id,
|
||||
], [
|
||||
'corporate_service_id' => $corporateService->id,
|
||||
'speciality_id' => $request->speciality_id,
|
||||
'status' => $request->status
|
||||
'active' => $request->active
|
||||
]);
|
||||
|
||||
$exclusion = $corporateServiceSpeciality->exclusions()->updateOrCreate([
|
||||
'corporate_id' => $corporate_id,
|
||||
'service_code' => $service_code,
|
||||
], [
|
||||
'corporate_id' => $corporate_id,
|
||||
'service_code' => $service_code,
|
||||
'type' => 'speciality',
|
||||
]);
|
||||
|
||||
|
||||
$selected_specialities = CorporateServiceSpeciality::query()
|
||||
->where('corporate_service_id', $corporateService->id)
|
||||
->where('status', 'active')
|
||||
->with('speciality')
|
||||
->get()
|
||||
->pluck('speciality.name', 'speciality.id');
|
||||
->where('corporate_service_id', $corporateService->id)
|
||||
->where('active', true)
|
||||
->with('speciality')
|
||||
->get()
|
||||
->pluck('speciality.name', 'speciality.id');
|
||||
|
||||
return response()->json($selected_specialities);
|
||||
}
|
||||
|
||||
public function storeExclusion(Request $request, $corporate_id, $service_code)
|
||||
{
|
||||
|
||||
$corporateService = CorporateService::query()
|
||||
->where('corporate_id', $corporate_id)
|
||||
->where('service_code', $service_code)
|
||||
->first();
|
||||
|
||||
$corporateServiceSpeciality = CorporateServiceSpeciality::where('corporate_service_id', $corporateService->id)
|
||||
->where('speciality_id', $request->speciality_id)
|
||||
->first();
|
||||
|
||||
// return ([$corporateServiceSpeciality, $request->msc, $request->name, $request->speciality_id, $request->type]);
|
||||
|
||||
$exclusion = $corporateServiceSpeciality->exclusions()->updateOrCreate([
|
||||
'corporate_id' => $corporate_id,
|
||||
'service_code' => $service_code,
|
||||
], [
|
||||
'corporate_id' => $corporate_id,
|
||||
'service_code' => $service_code,
|
||||
'type' => 'speciality',
|
||||
]);
|
||||
|
||||
|
||||
if ($request->type == 'msc') {
|
||||
if ($request->name == 'member' && $request->msc == "1") {
|
||||
$m = "m";
|
||||
} else {
|
||||
$m = "";
|
||||
}
|
||||
|
||||
if ($request->name == 'spouse' && $request->msc == "1") {
|
||||
$s = "s";
|
||||
} else {
|
||||
$s = "";
|
||||
}
|
||||
|
||||
if ($request->name == 'child' && $request->msc == "1") {
|
||||
$c = "c";
|
||||
} else {
|
||||
$c = "";
|
||||
}
|
||||
|
||||
$values = $m . $s . $c;
|
||||
|
||||
|
||||
|
||||
|
||||
$exclusion_rule = $exclusion->rules()->updateOrCreate([
|
||||
'exclusion_id' => $exclusion->id,
|
||||
'name' => 'msc',
|
||||
], [
|
||||
'name' => 'msc',
|
||||
'values' => $values,
|
||||
]);
|
||||
}
|
||||
|
||||
$selected_specialities = CorporateServiceSpeciality::query()
|
||||
->where('corporate_service_id', $corporateService->id)
|
||||
->where('active', true)
|
||||
->with('speciality')
|
||||
->get()
|
||||
->pluck('speciality.name', 'speciality.id');
|
||||
|
||||
return response()->json($selected_specialities);
|
||||
}
|
||||
|
||||
@@ -88,6 +88,7 @@ Route::prefix('internal')->group(function () {
|
||||
Route::get('corporates/{corporate_id}/services/{service_code}', [CorporateServiceController::class, 'corporateServiceIndex']);
|
||||
Route::put('corporates/{corporate_id}/services/{service_code}', [CorporateServiceController::class, 'corporateServiceUpdate']);
|
||||
Route::post('corporates/{corporate_id}/services/{service_code}/specialities', [CorporateServiceController::class, 'corporateServiceSpecialityUpdate']);
|
||||
Route::post('corporates/{corporate_id}/services/{service_code}/specialities/exclusion', [CorporateServiceController::class, 'storeExclusion']);
|
||||
|
||||
Route::get('corporates/{corporate_id}/formulariums', [CorporateFormulariumController::class, 'index']);
|
||||
Route::put('corporates/{corporate_id}/formulariums/{formularium_id}/{action}', [CorporateFormulariumController::class, 'updateStatus']);
|
||||
|
||||
@@ -15,7 +15,7 @@ class CorporateServiceConfigResource extends JsonResource
|
||||
public function toArray($request)
|
||||
{
|
||||
|
||||
return [
|
||||
$data = [
|
||||
'id' => $this->id,
|
||||
'corporate_id' => $this->corporate_id,
|
||||
'service_code' => $this->service_code,
|
||||
@@ -23,7 +23,49 @@ class CorporateServiceConfigResource extends JsonResource
|
||||
'name' => $this->service->name,
|
||||
'description' => $this->service->description,
|
||||
'configurations' => $this->configs->pluck('value', 'name'),
|
||||
'selected_specialities' => $this->specialities->pluck('speciality.name', 'speciality_id')
|
||||
'selected_specialities' => $this->specialities->pluck('speciality.name', 'speciality_id'),
|
||||
'exclusions' => $this->specialities->map(function ($speciality) {
|
||||
return [
|
||||
'speciality_id' => $speciality->speciality_id,
|
||||
'rules' => $speciality->exclusions->first()->rules->map(
|
||||
function ($rule) {
|
||||
return [
|
||||
'name' => $rule->name,
|
||||
'value' => explode(',', $rule->values)
|
||||
];
|
||||
}
|
||||
),
|
||||
|
||||
];
|
||||
}),
|
||||
];
|
||||
|
||||
$list_msc = $this->specialities->map(function ($speciality) {
|
||||
return explode(',', $speciality->exclusions->first()->rules->where('name', 'msc')->first()->values);
|
||||
})->map(function ($item) {
|
||||
return [
|
||||
'm' => in_array('m', $item),
|
||||
's' => in_array('s', $item),
|
||||
'c' => in_array('c', $item),
|
||||
];
|
||||
});
|
||||
// $msc = $cek->map(function ($item) {
|
||||
// return [
|
||||
// 'name' => $item,
|
||||
// 'value' => true
|
||||
// ];
|
||||
// });
|
||||
|
||||
$data['exclusions'] = $data['exclusions']->map(function ($item, $key) use ($list_msc) {
|
||||
|
||||
$item['msc'] = $list_msc[$key];
|
||||
return $item;
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ class CorporateServiceSpeciality extends Model
|
||||
protected $fillable = [
|
||||
'corporate_service_id',
|
||||
'speciality_id',
|
||||
'status'
|
||||
'active'
|
||||
];
|
||||
|
||||
public function corporateService()
|
||||
@@ -31,4 +31,9 @@ class CorporateServiceSpeciality extends Model
|
||||
{
|
||||
return $this->belongsTo(Speciality::class, 'speciality_id');
|
||||
}
|
||||
|
||||
public function exclusions()
|
||||
{
|
||||
return $this->morphMany(Exclusion::class, 'exclusionable');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,11 +17,11 @@ return new class extends Migration
|
||||
$table->id();
|
||||
$table->foreignId('corporate_service_id');
|
||||
$table->foreignId('speciality_id');
|
||||
$table->string('status')->default('active');
|
||||
$table->boolean('active');
|
||||
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
||||
|
||||
$table->foreignId('created_by')->nullable();
|
||||
$table->foreignId('updated_by')->nullable();
|
||||
$table->foreignId('deleted_by')->nullable();
|
||||
|
||||
@@ -259,9 +259,6 @@ export default function PlanList() {
|
||||
const [open, setOpen] = React.useState(false);
|
||||
const [openEdit, setOpenEdit] = React.useState(false);
|
||||
|
||||
console.log('edit', openEdit);
|
||||
console.log('open', open);
|
||||
|
||||
const handleActivate = (model: any, status: string) => {
|
||||
axios
|
||||
.put(`/benefits/${row.id}/activation`, {
|
||||
|
||||
@@ -1,15 +1,19 @@
|
||||
import { Tab, Tabs } from "@mui/material";
|
||||
import { useTheme } from "@mui/system";
|
||||
import React, { useEffect } from "react";
|
||||
import { Link, useNavigate, useParams } from "react-router-dom";
|
||||
import { Tab, Tabs } from '@mui/material';
|
||||
import { useTheme } from '@mui/system';
|
||||
import React, { useEffect, useRef, useState } from 'react';
|
||||
import axios from '../../utils/axios';
|
||||
import { Corporate } from '../../@types/corporates';
|
||||
|
||||
import { Link, useNavigate, useParams } from 'react-router-dom';
|
||||
|
||||
type Props = {
|
||||
position: string
|
||||
}
|
||||
position: string;
|
||||
};
|
||||
|
||||
export default function CorporateTabNavigations({ position }: Props) {
|
||||
const theme = useTheme();
|
||||
const navigate = useNavigate();
|
||||
const [corporate, setCorporate] = useState<Corporate>();
|
||||
|
||||
const { corporate_id } = useParams();
|
||||
|
||||
@@ -17,70 +21,79 @@ export default function CorporateTabNavigations({ position }: Props) {
|
||||
|
||||
const mainTabItems = [
|
||||
{
|
||||
'path' : '',
|
||||
'label': 'Dashboard',
|
||||
path: '',
|
||||
label: 'Dashboard',
|
||||
},
|
||||
// {
|
||||
// 'path' : 'corporate-plans',
|
||||
// 'label': 'Corporate Plan',
|
||||
// },
|
||||
{
|
||||
'path' : 'services',
|
||||
'label': 'Services',
|
||||
path: 'services',
|
||||
label: 'Services',
|
||||
},
|
||||
{
|
||||
'path' : 'plans',
|
||||
'label': 'Plans',
|
||||
path: 'plans',
|
||||
label: 'Plans',
|
||||
},
|
||||
// {
|
||||
// 'path' : 'corporate-benefits',
|
||||
// 'label': 'Corporate Benefit',
|
||||
// },
|
||||
{
|
||||
'path' : 'benefits',
|
||||
'label': 'Benefit',
|
||||
path: 'benefits',
|
||||
label: 'Benefit',
|
||||
},
|
||||
{
|
||||
'path' : 'divisions',
|
||||
'label': 'Division',
|
||||
path: 'divisions',
|
||||
label: 'Division',
|
||||
},
|
||||
{
|
||||
'path' : 'members',
|
||||
'label': 'Member List',
|
||||
path: 'members',
|
||||
label: 'Member List',
|
||||
},
|
||||
{
|
||||
'path' : 'diagnosis-exclusions',
|
||||
'label': 'Exclusion',
|
||||
path: 'diagnosis-exclusions',
|
||||
label: 'Exclusion',
|
||||
},
|
||||
{
|
||||
'path' : 'hospitals',
|
||||
'label': 'Hospital',
|
||||
path: 'hospitals',
|
||||
label: 'Hospital',
|
||||
},
|
||||
{
|
||||
'path' : 'formularium',
|
||||
'label': 'Formularium',
|
||||
path: 'formularium',
|
||||
label: 'Formularium',
|
||||
},
|
||||
{
|
||||
'path' : 'claim-history',
|
||||
'label': 'Claim History',
|
||||
path: 'claim-history',
|
||||
label: 'Claim History',
|
||||
},
|
||||
];
|
||||
useEffect(() => {
|
||||
let currentIndex = mainTabItems.findIndex(item => item.path === position);
|
||||
let currentIndex = mainTabItems.findIndex((item) => item.path === position);
|
||||
setCurrentTab(currentIndex);
|
||||
}, [])
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<Tabs
|
||||
theme={theme}
|
||||
// theme={theme}
|
||||
value={currentTab}
|
||||
// data={corporate}
|
||||
// onChange={(event, newValue) => false}
|
||||
variant="scrollable"
|
||||
scrollButtons
|
||||
allowScrollButtonsMobile
|
||||
aria-label="scrollable force tabs example"
|
||||
>
|
||||
{mainTabItems.map((tabItem, index) => (<Tab key={index} onClick={() => { navigate("/corporates/"+corporate_id+"/"+mainTabItems[index].path) }}label={tabItem.label}/>))}
|
||||
{mainTabItems.map((tabItem, index) => (
|
||||
<Tab
|
||||
key={index}
|
||||
onClick={() => {
|
||||
navigate('/corporates/' + corporate_id + '/' + mainTabItems[index].path);
|
||||
}}
|
||||
label={tabItem.label}
|
||||
/>
|
||||
))}
|
||||
</Tabs>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,19 +1,38 @@
|
||||
import * as Yup from 'yup';
|
||||
import { yupResolver } from "@hookform/resolvers/yup";
|
||||
import { Box, Card, Checkbox, Collapse, Divider, FormControlLabel, Grid, Modal, Paper, Stack, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, Typography } from "@mui/material";
|
||||
import { useForm } from "react-hook-form";
|
||||
import { useParams } from "react-router-dom";
|
||||
import HeaderBreadcrumbs from "../../../components/HeaderBreadcrumbs";
|
||||
import { FormProvider, RHFCheckbox, RHFSelect, RHFTextField } from "../../../components/hook-form";
|
||||
import Page from "../../../components/Page";
|
||||
import useSettings from "../../../hooks/useSettings";
|
||||
import CorporateTabNavigations from "../CorporateTabNavigations";
|
||||
import DivisionsList from "./List";
|
||||
import { yupResolver } from '@hookform/resolvers/yup';
|
||||
import {
|
||||
Box,
|
||||
Card,
|
||||
Checkbox,
|
||||
Collapse,
|
||||
Divider,
|
||||
FormControlLabel,
|
||||
FormGroup,
|
||||
Grid,
|
||||
Modal,
|
||||
Paper,
|
||||
Stack,
|
||||
Table,
|
||||
TableBody,
|
||||
TableCell,
|
||||
TableContainer,
|
||||
TableHead,
|
||||
TableRow,
|
||||
TextField,
|
||||
Typography,
|
||||
} from '@mui/material';
|
||||
import { useForm } from 'react-hook-form';
|
||||
import { useParams } from 'react-router-dom';
|
||||
import HeaderBreadcrumbs from '../../../components/HeaderBreadcrumbs';
|
||||
import { FormProvider, RHFCheckbox, RHFSelect, RHFTextField } from '../../../components/hook-form';
|
||||
import Page from '../../../components/Page';
|
||||
import useSettings from '../../../hooks/useSettings';
|
||||
import CorporateTabNavigations from '../CorporateTabNavigations';
|
||||
import DivisionsList from './List';
|
||||
import { ChangeEvent, useEffect, useMemo, useState } from 'react';
|
||||
import axios from '../../../utils/axios';
|
||||
import { CorporateService } from '../../../@types/corporates';
|
||||
|
||||
|
||||
import { InfoIcon } from '../../../theme/overrides/CustomIcons';
|
||||
|
||||
export default function Divisions() {
|
||||
const { themeStretch } = useSettings();
|
||||
@@ -21,63 +40,117 @@ export default function Divisions() {
|
||||
const { corporate_id, service_code } = useParams();
|
||||
|
||||
const [service, setService] = useState<CorporateService>({
|
||||
"configurations" : {},
|
||||
"corporate_id": "null",
|
||||
"name" : "",
|
||||
"description" : "",
|
||||
"service_code" : "",
|
||||
"status" : "active"
|
||||
configurations: {},
|
||||
corporate_id: 'null',
|
||||
name: '',
|
||||
description: '',
|
||||
service_code: '',
|
||||
status: 'active',
|
||||
});
|
||||
|
||||
const [specialities, setSpecialities] = useState([])
|
||||
const [specialities, setSpecialities] = useState([]);
|
||||
|
||||
useEffect(() => {
|
||||
axios.get('/corporates/'+corporate_id+'/services/'+service_code)
|
||||
.then((res) => {
|
||||
setService(res.data.service)
|
||||
setSpecialities(res.data.specialities)
|
||||
});
|
||||
}, [])
|
||||
// console.log('specialities', specialities);
|
||||
|
||||
useEffect(() => {
|
||||
axios.get('/corporates/' + corporate_id + '/services/' + service_code).then((res) => {
|
||||
setService(res.data.service);
|
||||
setSpecialities(res.data.specialities);
|
||||
setExclusion(res.data.service?.exclusions);
|
||||
});
|
||||
}, []);
|
||||
|
||||
const handleConfigChange = (event: ChangeEvent<HTMLInputElement>, service: any) => {
|
||||
axios.put(`/corporates/${corporate_id}/services`, {
|
||||
service_code: service.service_code,
|
||||
config_name: event.target.name,
|
||||
config_value: event.target.checked
|
||||
})
|
||||
.then((res) => {
|
||||
let newConfigurations = service.configurations
|
||||
newConfigurations[res.data.name] = res.data.value == true
|
||||
|
||||
setService({
|
||||
...service,
|
||||
configurations: { ...newConfigurations }
|
||||
axios
|
||||
.put(`/corporates/${corporate_id}/services`, {
|
||||
service_code: service.service_code,
|
||||
config_name: event.target.name,
|
||||
config_value: event.target.checked,
|
||||
})
|
||||
})
|
||||
}
|
||||
.then((res) => {
|
||||
let newConfigurations = service.configurations;
|
||||
newConfigurations[res.data.name] = res.data.value == true;
|
||||
|
||||
const handleToggleSpeciality = (event: ChangeEvent<HTMLInputElement>, service: any, speciality: any) => {
|
||||
console.log('Changing Service ', service, 'and', speciality)
|
||||
axios.post(`/corporates/${corporate_id}/services/${service_code}/specialities`, {
|
||||
// service_code: service.service_code,
|
||||
speciality_id: speciality.id,
|
||||
status: event.target.checked ? 'active' : 'inactive'
|
||||
})
|
||||
.then((res) => {
|
||||
setService({
|
||||
...service,
|
||||
selected_specialities : res.data
|
||||
setService({
|
||||
...service,
|
||||
configurations: { ...newConfigurations },
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
// const [configExclusions, setConfigExclusions] = useState([]);
|
||||
|
||||
// console.log('Config Exclusions', configExclusions);
|
||||
|
||||
// const handleConfigExclusion = (event: ChangeEvent<HTMLInputElement>, speciality: any) => {
|
||||
|
||||
// setConfigExclusions({
|
||||
// ...configExclusions,
|
||||
// [event.target.name]: event.target.checked,
|
||||
// });
|
||||
// };
|
||||
|
||||
const [exclusion, setExclusion] = useState([]);
|
||||
|
||||
console.log('Exclusions', exclusion);
|
||||
|
||||
const handleConfigExclusion = (
|
||||
event: ChangeEvent<HTMLInputElement>,
|
||||
service: any,
|
||||
speciality: any,
|
||||
name: string,
|
||||
type: string
|
||||
) => {
|
||||
console.log(event.target.checked, service, speciality, name, type);
|
||||
|
||||
axios
|
||||
.post(`/corporates/${corporate_id}/services/${service_code}/specialities/exclusion`, {
|
||||
// service_code: service.service_code,
|
||||
speciality_id: speciality.id,
|
||||
msc: event.target.checked ? '1' : '0',
|
||||
name: name,
|
||||
type: type,
|
||||
})
|
||||
// let newConfigurations = service.configurations
|
||||
// newConfigurations[res.data.name] = res.data.value == true
|
||||
.then((res) => {
|
||||
setService({
|
||||
...service,
|
||||
selected_specialities: res.data,
|
||||
});
|
||||
setExclusion({
|
||||
...exclusion,
|
||||
[event.target.name]: event.target.checked,
|
||||
});
|
||||
// let newConfigurations = service.configurations
|
||||
// newConfigurations[res.data.name] = res.data.value == true
|
||||
});
|
||||
};
|
||||
|
||||
// setService({
|
||||
// ...service,
|
||||
// configurations: { ...newConfigurations }
|
||||
// })
|
||||
})
|
||||
}
|
||||
const handleToggleSpeciality = (
|
||||
event: ChangeEvent<HTMLInputElement>,
|
||||
service: any,
|
||||
speciality: any
|
||||
) => {
|
||||
console.log('Changing Service ', service, 'and', speciality);
|
||||
axios
|
||||
.post(`/corporates/${corporate_id}/services/${service_code}/specialities`, {
|
||||
// service_code: service.service_code,
|
||||
speciality_id: speciality.id,
|
||||
active: event.target.checked ? '1' : '0',
|
||||
})
|
||||
.then((res) => {
|
||||
setService({
|
||||
...service,
|
||||
selected_specialities: res.data,
|
||||
});
|
||||
// let newConfigurations = service.configurations
|
||||
// newConfigurations[res.data.name] = res.data.value == true
|
||||
|
||||
// setService({
|
||||
// ...service,
|
||||
// configurations: { ...newConfigurations }
|
||||
// })
|
||||
});
|
||||
};
|
||||
|
||||
const specialityModalStyle = {
|
||||
position: 'absolute' as 'absolute',
|
||||
@@ -92,12 +165,32 @@ export default function Divisions() {
|
||||
boxShadow: 24,
|
||||
p: 4,
|
||||
};
|
||||
const [specialityModal, setSpecialityModal] = useState(false)
|
||||
const [specialityModal, setSpecialityModal] = useState(false);
|
||||
|
||||
const listMsc = [
|
||||
{
|
||||
id: 1,
|
||||
name: 'Member',
|
||||
value: 'm',
|
||||
checked: false,
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: 'Spouse',
|
||||
value: 's',
|
||||
checked: false,
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: 'Child',
|
||||
value: 'c',
|
||||
checked: false,
|
||||
},
|
||||
];
|
||||
|
||||
console.log('Service _exclusions', service.exclusions);
|
||||
return (
|
||||
<Page title="Create Benefit">
|
||||
|
||||
<HeaderBreadcrumbs
|
||||
heading={'Create Benefit'}
|
||||
links={[
|
||||
@@ -108,255 +201,468 @@ export default function Divisions() {
|
||||
},
|
||||
{
|
||||
name: 'Corporate Name',
|
||||
href: '/corporates/'+corporate_id,
|
||||
href: '/corporates/' + corporate_id,
|
||||
},
|
||||
{
|
||||
name: 'Services',
|
||||
href: '/corporates/'+corporate_id+'/services',
|
||||
href: '/corporates/' + corporate_id + '/services',
|
||||
},
|
||||
{
|
||||
name: service.name ?? '-',
|
||||
href: '/corporates/'+corporate_id+'/services/'+service_code,
|
||||
href: '/corporates/' + corporate_id + '/services/' + service_code,
|
||||
},
|
||||
]}
|
||||
/>
|
||||
|
||||
|
||||
<Grid container spacing={2}>
|
||||
<Grid item xs={12}>
|
||||
<Card sx={{ p: 2 }}>
|
||||
{/* <FormProvider methods={methods} onSubmit={handleSubmit(onSubmit)}> */}
|
||||
<Box sx={{ borderBottom: 1 }}>
|
||||
<Stack>
|
||||
<Stack>
|
||||
<TableContainer sx={{ mb: 4 }}>
|
||||
<Table sx={{ minWidth: 650 }} size="small">
|
||||
<TableHead>
|
||||
<TableRow>
|
||||
<TableCell colSpan={4} sx={{ py: 1 }} align="center">
|
||||
General Practitioner
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
<TableBody>
|
||||
<TableRow>
|
||||
<TableCell colSpan={2}>External Doctor</TableCell>
|
||||
<TableCell colSpan={2}>Internal Doctor</TableCell>
|
||||
</TableRow>
|
||||
<TableRow>
|
||||
<TableCell>
|
||||
<FormControlLabel
|
||||
control={
|
||||
<Checkbox
|
||||
checked={service?.configurations?.gp_external_doctor_online == '1'}
|
||||
onChange={(event) => {
|
||||
handleConfigChange(event, service);
|
||||
}}
|
||||
name="gp_external_doctor_online"
|
||||
/>
|
||||
}
|
||||
label="Online"
|
||||
/>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<FormControlLabel
|
||||
control={
|
||||
<Checkbox
|
||||
checked={service?.configurations?.gp_external_doctor_offline == '1'}
|
||||
onChange={(event) => {
|
||||
handleConfigChange(event, service);
|
||||
}}
|
||||
name="gp_external_doctor_offline"
|
||||
/>
|
||||
}
|
||||
label="Offline"
|
||||
/>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<FormControlLabel
|
||||
control={
|
||||
<Checkbox
|
||||
checked={service?.configurations?.gp_internal_doctor_online == '1'}
|
||||
onChange={(event) => {
|
||||
handleConfigChange(event, service);
|
||||
}}
|
||||
name="gp_internal_doctor_online"
|
||||
/>
|
||||
}
|
||||
label="Online"
|
||||
/>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<FormControlLabel
|
||||
control={
|
||||
<Checkbox
|
||||
checked={service?.configurations?.gp_internal_doctor_offline == '1'}
|
||||
onChange={(event) => {
|
||||
handleConfigChange(event, service);
|
||||
}}
|
||||
name="gp_internal_doctor_offline"
|
||||
/>
|
||||
}
|
||||
label="Offline"
|
||||
/>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
</TableBody>
|
||||
</Table>
|
||||
</TableContainer>
|
||||
|
||||
<TableContainer sx={{ mb:4 }}>
|
||||
<Table sx={{ minWidth: 650 }} size="small">
|
||||
<TableHead>
|
||||
<TableRow>
|
||||
<TableCell colSpan={4} sx={{ py: 1 }} align="center">General Practitioner</TableCell>
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
<TableBody>
|
||||
<TableRow>
|
||||
<TableCell colSpan={2}>External Doctor</TableCell>
|
||||
<TableCell colSpan={2}>Internal Doctor</TableCell>
|
||||
</TableRow>
|
||||
<TableRow>
|
||||
<TableCell>
|
||||
<FormControlLabel control={(
|
||||
<Checkbox
|
||||
checked={service?.configurations?.gp_external_doctor_online == '1'}
|
||||
onChange={(event) => {handleConfigChange(event, service)}}
|
||||
name="gp_external_doctor_online" />
|
||||
)}
|
||||
label="Online" />
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<FormControlLabel control={(
|
||||
<Checkbox
|
||||
checked={service?.configurations?.gp_external_doctor_offline == '1'}
|
||||
onChange={(event) => {handleConfigChange(event, service)}}
|
||||
name="gp_external_doctor_offline" />
|
||||
)}
|
||||
label="Offline" />
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<FormControlLabel control={(
|
||||
<Checkbox
|
||||
checked={service?.configurations?.gp_internal_doctor_online == '1'}
|
||||
onChange={(event) => {handleConfigChange(event, service)}}
|
||||
name="gp_internal_doctor_online" />
|
||||
)}
|
||||
label="Online" />
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<FormControlLabel control={(
|
||||
<Checkbox
|
||||
checked={service?.configurations?.gp_internal_doctor_offline == '1'}
|
||||
onChange={(event) => {handleConfigChange(event, service)}}
|
||||
name="gp_internal_doctor_offline" />
|
||||
)}
|
||||
label="Offline" />
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
</TableBody>
|
||||
</Table>
|
||||
</TableContainer>
|
||||
<TableContainer sx={{ mb: 4 }}>
|
||||
<Table sx={{ minWidth: 650 }} size="small">
|
||||
<TableHead>
|
||||
<TableRow>
|
||||
<TableCell colSpan={4} sx={{ py: 1 }} align="center">
|
||||
Specialist Practitioner
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
<TableBody>
|
||||
<TableRow>
|
||||
<TableCell colSpan={2}>External Doctor</TableCell>
|
||||
<TableCell colSpan={2}>Internal Doctor</TableCell>
|
||||
</TableRow>
|
||||
<TableRow>
|
||||
<TableCell>
|
||||
<FormControlLabel
|
||||
control={
|
||||
<Checkbox
|
||||
checked={service?.configurations?.sp_external_doctor_online == '1'}
|
||||
onChange={(event) => {
|
||||
handleConfigChange(event, service);
|
||||
}}
|
||||
name="sp_external_doctor_online"
|
||||
/>
|
||||
}
|
||||
label="Online"
|
||||
/>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<FormControlLabel
|
||||
control={
|
||||
<Checkbox
|
||||
checked={service?.configurations?.sp_external_doctor_offline == '1'}
|
||||
onChange={(event) => {
|
||||
handleConfigChange(event, service);
|
||||
}}
|
||||
name="sp_external_doctor_offline"
|
||||
/>
|
||||
}
|
||||
label="Offline"
|
||||
/>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<FormControlLabel
|
||||
control={
|
||||
<Checkbox
|
||||
checked={service?.configurations?.sp_internal_doctor_online == '1'}
|
||||
onChange={(event) => {
|
||||
handleConfigChange(event, service);
|
||||
}}
|
||||
name="sp_internal_doctor_online"
|
||||
/>
|
||||
}
|
||||
label="Online"
|
||||
/>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<FormControlLabel
|
||||
control={
|
||||
<Checkbox
|
||||
checked={service?.configurations?.sp_internal_doctor_offline == '1'}
|
||||
onChange={(event) => {
|
||||
handleConfigChange(event, service);
|
||||
}}
|
||||
name="sp_internal_doctor_offline"
|
||||
/>
|
||||
}
|
||||
label="Offline"
|
||||
/>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
<TableRow>
|
||||
<TableCell colSpan={4}>
|
||||
<Typography
|
||||
onClick={() => {
|
||||
setSpecialityModal(true);
|
||||
}}
|
||||
>
|
||||
Specialities : (
|
||||
{service.selected_specialities
|
||||
? Object.keys(service.selected_specialities).length
|
||||
: '0'}
|
||||
)
|
||||
</Typography>
|
||||
<Typography>
|
||||
{service.selected_specialities
|
||||
? '{' + Object.values(service.selected_specialities).join(', ') + '}'
|
||||
: ''}
|
||||
</Typography>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
</TableBody>
|
||||
</Table>
|
||||
</TableContainer>
|
||||
|
||||
<TableContainer sx={{ mb:4 }}>
|
||||
<Table sx={{ minWidth: 650 }} size="small">
|
||||
<TableHead>
|
||||
<TableRow>
|
||||
<TableCell colSpan={4} sx={{ py: 1 }} align="center">Specialist Practitioner</TableCell>
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
<TableBody>
|
||||
<TableRow>
|
||||
<TableCell colSpan={2}>External Doctor</TableCell>
|
||||
<TableCell colSpan={2}>Internal Doctor</TableCell>
|
||||
</TableRow>
|
||||
<TableRow>
|
||||
<TableCell>
|
||||
<FormControlLabel control={(
|
||||
<Checkbox
|
||||
checked={service?.configurations?.sp_external_doctor_online == '1'}
|
||||
onChange={(event) => {handleConfigChange(event, service)}}
|
||||
name="sp_external_doctor_online" />
|
||||
)}
|
||||
label="Online" />
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<FormControlLabel control={(
|
||||
<Checkbox
|
||||
checked={service?.configurations?.sp_external_doctor_offline == '1'}
|
||||
onChange={(event) => {handleConfigChange(event, service)}}
|
||||
name="sp_external_doctor_offline" />
|
||||
)}
|
||||
label="Offline" />
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<FormControlLabel control={(
|
||||
<Checkbox
|
||||
checked={service?.configurations?.sp_internal_doctor_online == '1'}
|
||||
onChange={(event) => {handleConfigChange(event, service)}}
|
||||
name="sp_internal_doctor_online" />
|
||||
)}
|
||||
label="Online" />
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<FormControlLabel control={(
|
||||
<Checkbox
|
||||
checked={service?.configurations?.sp_internal_doctor_offline == '1'}
|
||||
onChange={(event) => {handleConfigChange(event, service)}}
|
||||
name="sp_internal_doctor_offline" />
|
||||
)}
|
||||
label="Offline" />
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
<TableRow>
|
||||
<TableCell colSpan={4}>
|
||||
<Typography onClick={() => { setSpecialityModal(true) }}>
|
||||
Specialities : ({service.selected_specialities ? Object.keys(service.selected_specialities).length : '0'})
|
||||
</Typography>
|
||||
<Typography>{service.selected_specialities ? '{'+Object.values(service.selected_specialities).join(', ')+'}' : ''}</Typography>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
</TableBody>
|
||||
</Table>
|
||||
</TableContainer>
|
||||
<Modal
|
||||
open={specialityModal}
|
||||
onClose={() => {
|
||||
setSpecialityModal(false);
|
||||
}}
|
||||
aria-labelledby="modal-modal-title"
|
||||
aria-describedby="modal-modal-description"
|
||||
>
|
||||
<Box sx={specialityModalStyle}>
|
||||
<Typography id="modal-modal-title" variant="h6" component="h2" sx={{ pb: 4 }}>
|
||||
Specialities
|
||||
</Typography>
|
||||
<TableContainer component={Paper}>
|
||||
<Table sx={{ minWidth: 650 }} aria-label="simple table">
|
||||
<TableHead>
|
||||
<TableRow>
|
||||
<TableCell>Covered</TableCell>
|
||||
|
||||
<Modal
|
||||
open={specialityModal}
|
||||
onClose={() => { setSpecialityModal(false) }}
|
||||
aria-labelledby="modal-modal-title"
|
||||
aria-describedby="modal-modal-description"
|
||||
>
|
||||
<Box sx={specialityModalStyle}>
|
||||
<Typography id="modal-modal-title" variant="h6" component="h2" sx={{ pb: 4 }}>
|
||||
Specialities
|
||||
</Typography>
|
||||
<TableContainer component={Paper}>
|
||||
<Table sx={{ minWidth: 650 }} aria-label="simple table">
|
||||
<TableHead>
|
||||
<TableRow>
|
||||
<TableCell />
|
||||
<TableCell>Nama Spesialisasi</TableCell>
|
||||
<TableCell sx={{ width: 10 }}>Nama Spesialisasi</TableCell>
|
||||
<TableCell align="center">MSC</TableCell>
|
||||
<TableCell align="center">Gender</TableCell>
|
||||
<TableCell align="center">Min Age</TableCell>
|
||||
<TableCell align="center">Max Age</TableCell>
|
||||
<TableCell align="center">Plan</TableCell>
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
<TableBody>
|
||||
{specialities.map((row) => (
|
||||
<TableRow
|
||||
key={row.name}
|
||||
sx={{ '&:last-child td, &:last-child th': { border: 0 } }}
|
||||
>
|
||||
<TableCell>
|
||||
<Checkbox
|
||||
checked={Object.keys(service.selected_specialities).includes(
|
||||
String(row.id)
|
||||
)}
|
||||
onChange={(event) => {
|
||||
handleToggleSpeciality(event, service, row);
|
||||
}}
|
||||
name="vitamins"
|
||||
/>
|
||||
</TableCell>
|
||||
<TableCell component="th" scope="row">
|
||||
{row.name}
|
||||
</TableCell>
|
||||
<TableCell align="center">
|
||||
<Stack direction="row" spacing={2} justifyContent="center">
|
||||
{/* {listMsc.map((list) => (
|
||||
<FormControlLabel
|
||||
key={list.id}
|
||||
control={
|
||||
<Checkbox
|
||||
checked={service.exclusions
|
||||
.map((item) => item.speciality_id == 2)
|
||||
.includes(row.id)}
|
||||
onChange={(event) => {
|
||||
handleConfigExclusion(event, service, row, 'msc');
|
||||
}}
|
||||
/>
|
||||
}
|
||||
label={list.name}
|
||||
/>
|
||||
))} */}
|
||||
|
||||
<FormControlLabel
|
||||
control={
|
||||
<Checkbox
|
||||
checked={service.exclusions.find(
|
||||
(item) =>
|
||||
item.speciality_id == row.id && item.msc?.m == '1'
|
||||
)}
|
||||
onChange={(event) => {
|
||||
handleConfigExclusion(
|
||||
event,
|
||||
service,
|
||||
row,
|
||||
'member',
|
||||
'msc'
|
||||
);
|
||||
}}
|
||||
name="member"
|
||||
/>
|
||||
}
|
||||
label="Member"
|
||||
/>
|
||||
<FormControlLabel
|
||||
control={
|
||||
<Checkbox
|
||||
checked={service.exclusions.find(
|
||||
(item) =>
|
||||
item.speciality_id == row.id && item.msc?.s == '1'
|
||||
)}
|
||||
onChange={(event) => {
|
||||
handleConfigExclusion(
|
||||
event,
|
||||
service,
|
||||
row,
|
||||
'spouse',
|
||||
'msc'
|
||||
);
|
||||
}}
|
||||
name="spouse"
|
||||
/>
|
||||
}
|
||||
label="Spouse"
|
||||
/>
|
||||
<FormControlLabel
|
||||
control={
|
||||
<Checkbox
|
||||
checked={service.exclusions.find(
|
||||
(item) =>
|
||||
item.speciality_id == row.id && item.msc?.c == '1'
|
||||
)}
|
||||
onChange={(event) => {
|
||||
handleConfigExclusion(
|
||||
event,
|
||||
service,
|
||||
row,
|
||||
'child',
|
||||
'msc'
|
||||
);
|
||||
}}
|
||||
name="child"
|
||||
/>
|
||||
}
|
||||
label="Child"
|
||||
/>
|
||||
</Stack>
|
||||
</TableCell>
|
||||
<TableCell align="center">
|
||||
<Stack direction="row" spacing={2} justifyContent="center">
|
||||
<FormControlLabel
|
||||
control={
|
||||
<Checkbox
|
||||
checked={
|
||||
service?.configurations?.sp_external_doctor_online == '1'
|
||||
}
|
||||
onChange={(event) => {
|
||||
handleConfigChange(event, service);
|
||||
}}
|
||||
name="sp_external_doctor_online"
|
||||
/>
|
||||
}
|
||||
label="Male"
|
||||
/>
|
||||
<FormControlLabel
|
||||
control={
|
||||
<Checkbox
|
||||
checked={
|
||||
service?.configurations?.sp_external_doctor_online == '1'
|
||||
}
|
||||
onChange={(event) => {
|
||||
handleConfigChange(event, service);
|
||||
}}
|
||||
name="sp_external_doctor_online"
|
||||
/>
|
||||
}
|
||||
label="Female"
|
||||
/>
|
||||
</Stack>
|
||||
</TableCell>
|
||||
<TableCell align="center">
|
||||
<TextField id="outlined-number" type="number" />
|
||||
</TableCell>
|
||||
<TableCell align="center">
|
||||
<TextField id="outlined-number" type="number" />
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
<TableBody>
|
||||
{specialities.map((row) => (
|
||||
<TableRow
|
||||
key={row.name}
|
||||
sx={{ '&:last-child td, &:last-child th': { border: 0 } }}
|
||||
>
|
||||
<TableCell>
|
||||
<Checkbox
|
||||
checked={ Object.keys(service.selected_specialities).includes(String(row.id)) }
|
||||
onChange={(event) => {handleToggleSpeciality(event, service, row)}}
|
||||
name="vitamins" />
|
||||
</TableCell>
|
||||
<TableCell component="th" scope="row">
|
||||
{row.name}
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
</TableBody>
|
||||
</Table>
|
||||
</TableContainer>
|
||||
</Box>
|
||||
</Modal>
|
||||
))}
|
||||
</TableBody>
|
||||
</Table>
|
||||
</TableContainer>
|
||||
</Box>
|
||||
</Modal>
|
||||
|
||||
<TableContainer sx={{ mb:4 }}>
|
||||
<Table sx={{ minWidth: 650 }} size="small">
|
||||
<TableHead>
|
||||
<TableRow>
|
||||
<TableCell colSpan={4} sx={{ py: 1 }} align="center">Medicine</TableCell>
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
<TableBody>
|
||||
<TableRow>
|
||||
<TableCell width={'25%'}>
|
||||
<FormControlLabel control={(
|
||||
<Checkbox
|
||||
checked={service?.configurations?.vitamins == '1'}
|
||||
onChange={(event) => {handleConfigChange(event, service)}}
|
||||
name="vitamins" />
|
||||
)}
|
||||
label="Vitamins" />
|
||||
</TableCell>
|
||||
<TableCell width={'25%'}>
|
||||
<FormControlLabel control={(
|
||||
<Checkbox
|
||||
checked={service?.configurations?.delivery_fee == '1'}
|
||||
onChange={(event) => {handleConfigChange(event, service)}}
|
||||
name="delivery_fee" />
|
||||
)}
|
||||
label="Delivery Fee" />
|
||||
</TableCell>
|
||||
<TableCell width={'25%'}/>
|
||||
<TableCell width={'25%'}/>
|
||||
</TableRow>
|
||||
</TableBody>
|
||||
</Table>
|
||||
</TableContainer>
|
||||
<TableContainer sx={{ mb: 4 }}>
|
||||
<Table sx={{ minWidth: 650 }} size="small">
|
||||
<TableHead>
|
||||
<TableRow>
|
||||
<TableCell colSpan={4} sx={{ py: 1 }} align="center">
|
||||
Medicine
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
<TableBody>
|
||||
<TableRow>
|
||||
<TableCell width={'25%'}>
|
||||
<FormControlLabel
|
||||
control={
|
||||
<Checkbox
|
||||
checked={service?.configurations?.vitamins == '1'}
|
||||
onChange={(event) => {
|
||||
handleConfigChange(event, service);
|
||||
}}
|
||||
name="vitamins"
|
||||
/>
|
||||
}
|
||||
label="Vitamins"
|
||||
/>
|
||||
</TableCell>
|
||||
<TableCell width={'25%'}>
|
||||
<FormControlLabel
|
||||
control={
|
||||
<Checkbox
|
||||
checked={service?.configurations?.delivery_fee == '1'}
|
||||
onChange={(event) => {
|
||||
handleConfigChange(event, service);
|
||||
}}
|
||||
name="delivery_fee"
|
||||
/>
|
||||
}
|
||||
label="Delivery Fee"
|
||||
/>
|
||||
</TableCell>
|
||||
<TableCell width={'25%'} />
|
||||
<TableCell width={'25%'} />
|
||||
</TableRow>
|
||||
</TableBody>
|
||||
</Table>
|
||||
</TableContainer>
|
||||
|
||||
<TableContainer sx={{ mb:4 }}>
|
||||
<Table sx={{ minWidth: 650 }} size="small">
|
||||
<TableHead>
|
||||
<TableRow>
|
||||
<TableCell colSpan={4} sx={{ py: 1 }} align="center">Free Admin Fee</TableCell>
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
<TableBody>
|
||||
<TableRow>
|
||||
<TableCell width={'25%'}>
|
||||
<FormControlLabel control={(
|
||||
<Checkbox
|
||||
checked={service?.configurations?.general_practitioner_fee == '1'}
|
||||
onChange={(event) => {handleConfigChange(event, service)}}
|
||||
name="general_practitioner_fee" />
|
||||
)}
|
||||
label="General Practitioner" />
|
||||
</TableCell>
|
||||
<TableCell width={'25%'}>
|
||||
<FormControlLabel control={(
|
||||
<Checkbox
|
||||
checked={service?.configurations?.specialist_practitioner_fee == '1'}
|
||||
onChange={(event) => {handleConfigChange(event, service)}}
|
||||
name="specialist_practitioner_fee" />
|
||||
)}
|
||||
label="Specialist Practitioner" />
|
||||
</TableCell>
|
||||
<TableCell width={'25%'}/>
|
||||
<TableCell width={'25%'}/>
|
||||
</TableRow>
|
||||
</TableBody>
|
||||
</Table>
|
||||
</TableContainer>
|
||||
|
||||
|
||||
</Stack>
|
||||
</Box>
|
||||
<TableContainer sx={{ mb: 4 }}>
|
||||
<Table sx={{ minWidth: 650 }} size="small">
|
||||
<TableHead>
|
||||
<TableRow>
|
||||
<TableCell colSpan={4} sx={{ py: 1 }} align="center">
|
||||
Free Admin Fee
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
<TableBody>
|
||||
<TableRow>
|
||||
<TableCell width={'25%'}>
|
||||
<FormControlLabel
|
||||
control={
|
||||
<Checkbox
|
||||
checked={service?.configurations?.general_practitioner_fee == '1'}
|
||||
onChange={(event) => {
|
||||
handleConfigChange(event, service);
|
||||
}}
|
||||
name="general_practitioner_fee"
|
||||
/>
|
||||
}
|
||||
label="General Practitioner"
|
||||
/>
|
||||
</TableCell>
|
||||
<TableCell width={'25%'}>
|
||||
<FormControlLabel
|
||||
control={
|
||||
<Checkbox
|
||||
checked={
|
||||
service?.configurations?.specialist_practitioner_fee == '1'
|
||||
}
|
||||
onChange={(event) => {
|
||||
handleConfigChange(event, service);
|
||||
}}
|
||||
name="specialist_practitioner_fee"
|
||||
/>
|
||||
}
|
||||
label="Specialist Practitioner"
|
||||
/>
|
||||
</TableCell>
|
||||
<TableCell width={'25%'} />
|
||||
<TableCell width={'25%'} />
|
||||
</TableRow>
|
||||
</TableBody>
|
||||
</Table>
|
||||
</TableContainer>
|
||||
</Stack>
|
||||
</Box>
|
||||
{/* </FormProvider> */}
|
||||
</Card>
|
||||
</Grid>
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
import { Card, Grid } 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 CorporateTabNavigations from "../CorporateTabNavigations";
|
||||
import List from "./List";
|
||||
|
||||
|
||||
import { Card, Grid } 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 CorporateTabNavigations from '../CorporateTabNavigations';
|
||||
import List from './List';
|
||||
|
||||
export default function Divisions() {
|
||||
const { themeStretch } = useSettings();
|
||||
@@ -15,10 +13,9 @@ export default function Divisions() {
|
||||
|
||||
const pageTitle = 'Services';
|
||||
return (
|
||||
<Page title={ pageTitle }>
|
||||
|
||||
<Page title={pageTitle}>
|
||||
<HeaderBreadcrumbs
|
||||
heading={ pageTitle }
|
||||
heading={pageTitle}
|
||||
links={[
|
||||
{
|
||||
name: 'Corporates',
|
||||
@@ -26,11 +23,11 @@ export default function Divisions() {
|
||||
},
|
||||
{
|
||||
name: 'Corporate Name',
|
||||
href: '/corporates/'+corporate_id,
|
||||
href: '/corporates/' + corporate_id,
|
||||
},
|
||||
{
|
||||
name: 'Services',
|
||||
href: '/corporates/'+corporate_id+'/services',
|
||||
href: '/corporates/' + corporate_id + '/services',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
@@ -39,7 +36,6 @@ export default function Divisions() {
|
||||
<CorporateTabNavigations position={'services'} />
|
||||
|
||||
<List />
|
||||
|
||||
</Card>
|
||||
</Page>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user