add config msc (belum kelar)

This commit is contained in:
pajri
2022-12-22 19:13:24 +07:00
parent b1c908a6f6
commit 2321e708c5
9 changed files with 814 additions and 366 deletions

View File

@@ -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`, {

View File

@@ -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>
)
);
}

View File

@@ -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>

View File

@@ -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>
);