update
This commit is contained in:
@@ -8,6 +8,8 @@ import Page from '../../components/Page';
|
||||
/* ---------------------------------- hooks --------------------------------- */
|
||||
import useSettings from '../../hooks/useSettings';
|
||||
import List from './List';
|
||||
import ServiceMonitoring from './ServiceMonitoring';
|
||||
import UserProfile from './UserProfile';
|
||||
|
||||
/* ------------------------------ tabs setting ------------------------------ */
|
||||
|
||||
@@ -105,21 +107,21 @@ export default function Drugs() {
|
||||
<Card>
|
||||
<Box sx={{ borderBottom: 1, borderColor: 'divider' }}>
|
||||
<StyledTabs value={value} onChange={handleChange} aria-label="basic tabs example">
|
||||
<StyledTab label="All Data (20)" {...a11yProps(0)} />
|
||||
<StyledTab label="Ongoing (5)" {...a11yProps(1)} />
|
||||
<StyledTab label="Done (15)" {...a11yProps(2)} />
|
||||
<StyledTab label="All Data (999)" {...a11yProps(0)} />
|
||||
<StyledTab label="Ongoing (888)" {...a11yProps(1)} />
|
||||
<StyledTab label="Done (777)" {...a11yProps(2)} />
|
||||
</StyledTabs>
|
||||
</Box>
|
||||
<TabPanel value={value} index={0}>
|
||||
<List />
|
||||
</TabPanel>
|
||||
<TabPanel value={value} index={1}>
|
||||
Item Two
|
||||
{/* <TabPanel value={value} index={1}>
|
||||
<ServiceMonitoring/>
|
||||
</TabPanel>
|
||||
<TabPanel value={value} index={2}>
|
||||
Item Two
|
||||
</TabPanel>
|
||||
</Card>
|
||||
<UserProfile />
|
||||
</TabPanel> */}
|
||||
</Card>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Container>
|
||||
|
||||
@@ -31,7 +31,8 @@ import useMap from '../../hooks/useMap';
|
||||
import palette from '../../theme/palette';
|
||||
import { UserCurrentCorporateContext } from '../../contexts/UserCurrentCorporate';
|
||||
import { HeadCell, Order, PaginationTableProps } from '../../@types/table';
|
||||
import { useSearchParams } from 'react-router-dom';
|
||||
import { useSearchParams, useNavigate, Link } from 'react-router-dom';
|
||||
|
||||
|
||||
/* ---------------------------------- types --------------------------------- */
|
||||
|
||||
@@ -137,6 +138,8 @@ import { useSearchParams } from 'react-router-dom';
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
export default function List() {
|
||||
const navigate = useNavigate();
|
||||
|
||||
const { corporateValue } = useContext(UserCurrentCorporateContext);
|
||||
|
||||
const [data, setData] = useState([]);
|
||||
@@ -198,6 +201,7 @@ export default function List() {
|
||||
paginationTable: paginationTable,
|
||||
setPaginationTable: setPaginationTable,
|
||||
};
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
/* ------------------------------ handle search ----------------------------- */
|
||||
@@ -224,18 +228,19 @@ export default function List() {
|
||||
|
||||
/* -------------------------------- headCell -------------------------------- */
|
||||
const headCells: HeadCell<never>[] = [
|
||||
{
|
||||
id: 'fullName',
|
||||
align: 'left',
|
||||
label: 'Name',
|
||||
isSort: true,
|
||||
},
|
||||
{
|
||||
id: 'memberId',
|
||||
align: 'left',
|
||||
label: 'Member ID',
|
||||
isSort: true,
|
||||
},
|
||||
{
|
||||
id: 'fullName',
|
||||
align: 'left',
|
||||
label: 'Name',
|
||||
isSort: true,
|
||||
},
|
||||
|
||||
{
|
||||
id: 'start_date',
|
||||
align: 'center',
|
||||
@@ -268,17 +273,23 @@ export default function List() {
|
||||
? appliedParams
|
||||
: Object.fromEntries([...searchParams.entries(), ['order', order], ['orderBy', orderBy]]);
|
||||
|
||||
const response = await axios.get(`/${corporateValue}/members?type=alarm-center`, {
|
||||
params: parameters,
|
||||
const response = await axios.get(`${corporateValue}/members?type=alarm-center`, {
|
||||
params: { ...parameters },
|
||||
});
|
||||
|
||||
setData(
|
||||
response.data.data.map((obj: any) => {
|
||||
return {
|
||||
...obj,
|
||||
memberId:
|
||||
// <Link to={'/user-profile/'+obj.personId} >
|
||||
<Button
|
||||
onClick={() => navigate ('/user-profile/'+obj.personId)}
|
||||
>{obj.memberId}</Button>
|
||||
,
|
||||
status:
|
||||
obj.status === 1 ? (
|
||||
<Button
|
||||
<Button onClick={() => navigate('service-monitoring/:id')}
|
||||
startIcon={<Iconify icon="ic:round-check" />}
|
||||
sx={{
|
||||
backgroundColor: palette.light.grey[300],
|
||||
|
||||
@@ -18,6 +18,7 @@ import Iconify from '../../components/Iconify';
|
||||
// utils
|
||||
import useSettings from '../../hooks/useSettings';
|
||||
import { useState, SyntheticEvent } from 'react';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
// sections
|
||||
// import ListTable from '../../sections/claimreports/ListTable';
|
||||
// import ClaimStatusCard from '../../sections/claimreports/ClaimStatusCard';
|
||||
@@ -101,19 +102,28 @@ const StyledTab = styled((props: StyledTabProps) => <Tab disableRipple {...props
|
||||
})
|
||||
);
|
||||
|
||||
|
||||
|
||||
export default function ServiceMonitoring() {
|
||||
const { themeStretch } = useSettings();
|
||||
const navigate = useNavigate();
|
||||
|
||||
|
||||
const [value, setValue] = useState(0);
|
||||
const handleChange = (event: SyntheticEvent, newValue: number) => {
|
||||
setValue(newValue);
|
||||
|
||||
};
|
||||
|
||||
|
||||
return (
|
||||
<Page title="Service Monitoring 123456">
|
||||
<Container maxWidth={themeStretch ? false : 'xl'}>
|
||||
<Stack direction="row" alignItems="center" sx={{ marginBottom: 2 }}>
|
||||
<IconButton sx={{ marginRight: '10px', color: '#424242' }}>
|
||||
<IconButton onClick={() =>
|
||||
navigate('/alarm-center')
|
||||
}
|
||||
sx={{ marginRight: '10px', color: '#424242' }}>
|
||||
<Iconify icon="heroicons-outline:arrow-narrow-left" />
|
||||
</IconButton>
|
||||
<Typography variant="h5">Service Monitoring</Typography>
|
||||
@@ -271,7 +281,7 @@ export default function ServiceMonitoring() {
|
||||
<StyledTab icon={<Favorite />} label="Daily Monitoring" {...a11yProps(0)} />
|
||||
<StyledTab
|
||||
icon={<Iconify icon="heroicons-solid:beaker" />}
|
||||
label="Item Two"
|
||||
label="Laboratorium Result"
|
||||
{...a11yProps(1)}
|
||||
/>
|
||||
</StyledTabs>
|
||||
|
||||
@@ -12,21 +12,47 @@ import CardPolicyNumber from '../../sections/alarm-center/user-profile/CardPolic
|
||||
import CardBenefitSummary from '../../sections/alarm-center/user-profile/CardBenefitSummary';
|
||||
import CardClaimHistory from '../../sections/alarm-center/user-profile/CardClaimHistory';
|
||||
// react
|
||||
import { useNavigate } from 'react-router';
|
||||
import { useNavigate, useParams } from 'react-router-dom';
|
||||
import ButtonBack from '../../components/ButtonBack';
|
||||
import { useEffect, useState, useContext } from 'react';
|
||||
import axios from '../../utils/axios';
|
||||
import { UserCurrentCorporateContext } from '../../contexts/UserCurrentCorporate';
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
export default function UserProfile() {
|
||||
const { themeStretch } = useSettings();
|
||||
const navigate = useNavigate();
|
||||
// const navigate = useNavigate();
|
||||
const [data, setData] = useState();
|
||||
const [data1, setData1] = useState();
|
||||
|
||||
|
||||
|
||||
const {corporateValue} = useContext(UserCurrentCorporateContext);
|
||||
const {id} = useParams();
|
||||
|
||||
useEffect (() => {
|
||||
axios.get('/data/'+id )
|
||||
.then(response => {
|
||||
setData(response.data);
|
||||
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
}, []);
|
||||
|
||||
console.log(id)
|
||||
|
||||
return (
|
||||
<Page title="Profile Peserta Jessica Lie">
|
||||
<Container maxWidth={themeStretch ? false : 'xl'}>
|
||||
<Stack direction="row" alignItems="center" sx={{ marginBottom: 2 }}>
|
||||
<IconButton sx={{ marginRight: '10px', color: '#424242' }} onClick={() => navigate(-1)}>
|
||||
{/* <IconButton sx={{ marginRight: '10px', color: '#424242' }} onClick={() => navigate()}>
|
||||
<Iconify icon="heroicons-outline:arrow-narrow-left" />
|
||||
</IconButton>
|
||||
</IconButton> */}
|
||||
<ButtonBack/>
|
||||
<Typography variant="h5">Profil Peserta</Typography>
|
||||
</Stack>
|
||||
<Grid container spacing={2}>
|
||||
@@ -35,11 +61,11 @@ export default function UserProfile() {
|
||||
<Grid container spacing={2}>
|
||||
{/* Item 1 */}
|
||||
<Grid item xs={12} md={12}>
|
||||
<CardPersonalInformation />
|
||||
<CardPersonalInformation data={data} />
|
||||
</Grid>
|
||||
{/* Item 2 */}
|
||||
<Grid item xs={12} md={12}>
|
||||
<CardFamilyInformation />
|
||||
<CardFamilyInformation data={data1} />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
Reference in New Issue
Block a user