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