Merge branch 'ui/master-diagnosis' into staging
This commit is contained in:
@@ -90,6 +90,13 @@ const navConfig = [
|
|||||||
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: 'MASTER',
|
||||||
|
children: [
|
||||||
|
{ title: 'Diagnosis', path: '/master/diagnosis' },
|
||||||
|
|
||||||
|
],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: 'USER MANAGEMENT',
|
title: 'USER MANAGEMENT',
|
||||||
path: '/users',
|
path: '/users',
|
||||||
|
|||||||
@@ -283,8 +283,8 @@ export default function List(props: any) {
|
|||||||
id: number;
|
id: number;
|
||||||
status: number;
|
status: number;
|
||||||
code: string,
|
code: string,
|
||||||
name: string,
|
name: string,
|
||||||
rules: string,
|
rules: string,
|
||||||
};
|
};
|
||||||
const plans = props?.data.map((plan: any) => {
|
const plans = props?.data.map((plan: any) => {
|
||||||
return {
|
return {
|
||||||
@@ -576,32 +576,32 @@ export default function List(props: any) {
|
|||||||
)}
|
)}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
|
||||||
<TableCell align="left">
|
<TableCell align="left">
|
||||||
<TableMoreMenu actions={
|
<TableMoreMenu actions={
|
||||||
<>
|
<>
|
||||||
<MenuItem onClick={() => setOpen(!open)}>
|
<MenuItem onClick={() => setOpen(!open)}>
|
||||||
<FindInPageOutlined />
|
<FindInPageOutlined />
|
||||||
Detail
|
Detail
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem onClick={() => navigate(`/corporates/${corporate_id}/diagnosis-exclusions/${row.id}/edit`)} >
|
<MenuItem onClick={() => navigate(`/corporates/${corporate_id}/diagnosis-exclusions/${row.id}/edit`)} >
|
||||||
<EditOutlined />
|
<EditOutlined />
|
||||||
Edit
|
Edit
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem onClick={() => handleActivate(true, {
|
<MenuItem onClick={() => handleActivate(true, {
|
||||||
code: row.code,
|
code: row.code,
|
||||||
name: row.name,
|
name: row.name,
|
||||||
rules: Object.keys(row.rules).length ? 'With Rules' : 'All',
|
rules: Object.keys(row.rules).length ? 'With Rules' : 'All',
|
||||||
id:row.id,
|
id:row.id,
|
||||||
status: row.active,
|
status: row.active,
|
||||||
service: row.service_code
|
service: row.service_code
|
||||||
})
|
})
|
||||||
} >
|
} >
|
||||||
<CachedIcon />
|
<CachedIcon />
|
||||||
Update Status
|
Update Status
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
</>
|
</>
|
||||||
} />
|
} />
|
||||||
</TableCell>
|
</TableCell>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
{/* COLLAPSIBLE ROW */}
|
{/* COLLAPSIBLE ROW */}
|
||||||
<TableRow>
|
<TableRow>
|
||||||
@@ -801,7 +801,7 @@ export default function List(props: any) {
|
|||||||
|
|
||||||
const onSubmit = async (row : any) => {
|
const onSubmit = async (row : any) => {
|
||||||
try {
|
try {
|
||||||
handleUpdate(dataValue.status, dataValue.id, row.reason)
|
handleUpdate(dataValue.status, dataValue.id, row.reason)
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
console.log('data gagal');
|
console.log('data gagal');
|
||||||
}
|
}
|
||||||
@@ -836,7 +836,7 @@ export default function List(props: any) {
|
|||||||
resolver: yupResolver(NewCorporateSchema),
|
resolver: yupResolver(NewCorporateSchema),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
const {
|
const {
|
||||||
reset,
|
reset,
|
||||||
handleSubmit,
|
handleSubmit,
|
||||||
@@ -924,7 +924,7 @@ export default function List(props: any) {
|
|||||||
Cancel
|
Cancel
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
{dataValue?.status == 1?
|
{dataValue?.status == 1?
|
||||||
<LoadingButton
|
<LoadingButton
|
||||||
sx={{ boxShadow: '0px 2px 4px rgba(0, 0, 0, 0.1)'}}
|
sx={{ boxShadow: '0px 2px 4px rgba(0, 0, 0, 0.1)'}}
|
||||||
type="submit"
|
type="submit"
|
||||||
@@ -936,7 +936,7 @@ export default function List(props: any) {
|
|||||||
>
|
>
|
||||||
Inactive
|
Inactive
|
||||||
</LoadingButton>
|
</LoadingButton>
|
||||||
:
|
:
|
||||||
<LoadingButton
|
<LoadingButton
|
||||||
sx={{ boxShadow: '0px 2px 4px rgba(0, 0, 0, 0.1)'}}
|
sx={{ boxShadow: '0px 2px 4px rgba(0, 0, 0, 0.1)'}}
|
||||||
type="submit"
|
type="submit"
|
||||||
@@ -948,12 +948,12 @@ export default function List(props: any) {
|
|||||||
>
|
>
|
||||||
Active
|
Active
|
||||||
</LoadingButton>
|
</LoadingButton>
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|
||||||
</FormProvider>
|
</FormProvider>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
@@ -1031,9 +1031,9 @@ export default function List(props: any) {
|
|||||||
<BasePagination paginationData={dataTableData} onPageChange={handlePageChange} />
|
<BasePagination paginationData={dataTableData} onPageChange={handlePageChange} />
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
<DialogUpdateStatus
|
<DialogUpdateStatus
|
||||||
openDialog={isDialogOpen}
|
openDialog={isDialogOpen}
|
||||||
setOpenDialog={setDialogOpen}
|
setOpenDialog={setDialogOpen}
|
||||||
title={titles}
|
title={titles}
|
||||||
data={dataValue}
|
data={dataValue}
|
||||||
description={dataDescription}
|
description={dataDescription}
|
||||||
|
|||||||
@@ -16,27 +16,26 @@ export default function Divisions() {
|
|||||||
return (
|
return (
|
||||||
<Page title={ pageTitle }>
|
<Page title={ pageTitle }>
|
||||||
|
|
||||||
<HeaderBreadcrumbs
|
<HeaderBreadcrumbs
|
||||||
heading={ pageTitle }
|
heading={ pageTitle }
|
||||||
links={[
|
sx={{ px: 2 }}
|
||||||
{
|
links={[
|
||||||
name: 'Master',
|
{
|
||||||
href: '/master/diagnosis-template',
|
name: 'Master',
|
||||||
},
|
href: '/master/diagnosis',
|
||||||
{
|
},
|
||||||
name: 'Diagnosis Template',
|
{
|
||||||
href: '/master/diagnosis-template',
|
name: 'Diagnosis',
|
||||||
},
|
href: '/master/diagnosis',
|
||||||
{
|
},
|
||||||
name: 'Diagnosis',
|
{
|
||||||
href: '/master/diagnosis-template',
|
name: 'Diagnosis',
|
||||||
},
|
href: '/master/diagnosis',
|
||||||
]}
|
},
|
||||||
/>
|
]}
|
||||||
|
/>
|
||||||
<Card>
|
|
||||||
<List />
|
<List />
|
||||||
</Card>
|
|
||||||
</Page>
|
</Page>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import UploadIcon from '@mui/icons-material/Upload';
|
|||||||
import CancelIcon from '@mui/icons-material/Cancel';
|
import CancelIcon from '@mui/icons-material/Cancel';
|
||||||
import HistoryIcon from '@mui/icons-material/History';
|
import HistoryIcon from '@mui/icons-material/History';
|
||||||
// hooks
|
// hooks
|
||||||
import { Link, NavLink as RouterLink } from 'react-router-dom';
|
import { Link, NavLink as RouterLink, useNavigate } from 'react-router-dom';
|
||||||
import React, { ChangeEvent, Component, useEffect, useRef, useState } from 'react';
|
import React, { ChangeEvent, Component, useEffect, useRef, useState } from 'react';
|
||||||
import useSettings from '../../../hooks/useSettings';
|
import useSettings from '../../../hooks/useSettings';
|
||||||
import { useParams, useSearchParams } from 'react-router-dom';
|
import { useParams, useSearchParams } from 'react-router-dom';
|
||||||
@@ -17,13 +17,15 @@ import { LaravelPaginatedData } from '../../../@types/paginated-data';
|
|||||||
import { Icd } from '../../../@types/diagnosis';
|
import { Icd } from '../../../@types/diagnosis';
|
||||||
import BasePagination from '../../../components/BasePagination';
|
import BasePagination from '../../../components/BasePagination';
|
||||||
import { enqueueSnackbar } from 'notistack';
|
import { enqueueSnackbar } from 'notistack';
|
||||||
|
import TableMoreMenu from '@/components/table/TableMoreMenu';
|
||||||
|
|
||||||
export default function List() {
|
export default function List() {
|
||||||
const { themeStretch } = useSettings();
|
const navigate = useNavigate();
|
||||||
const { diagnosis_template_id } = useParams();
|
const { themeStretch } = useSettings();
|
||||||
const [searchParams, setSearchParams] = useSearchParams();
|
const { diagnosis_template_id } = useParams();
|
||||||
const [importResult, setImportResult] = useState(null);
|
const [searchParams, setSearchParams] = useSearchParams();
|
||||||
|
const [importResult, setImportResult] = useState(null);
|
||||||
|
|
||||||
function SearchInput(props: any) {
|
function SearchInput(props: any) {
|
||||||
// SEARCH
|
// SEARCH
|
||||||
const searchInput = useRef<HTMLInputElement>(null);
|
const searchInput = useRef<HTMLInputElement>(null);
|
||||||
@@ -44,7 +46,7 @@ export default function List() {
|
|||||||
}, [searchParams])
|
}, [searchParams])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<form onSubmit={handleSearchSubmit} style={{ width: '100%' }}>
|
<form onSubmit={handleSearchSubmit} style={{ width: '90%' }}>
|
||||||
<TextField id="search-input" ref={searchInput} label="Search" variant="outlined" fullWidth onChange={handleSearchChange} value={searchText}/>
|
<TextField id="search-input" ref={searchInput} label="Search" variant="outlined" fullWidth onChange={handleSearchChange} value={searchText}/>
|
||||||
</form>
|
</form>
|
||||||
);
|
);
|
||||||
@@ -55,7 +57,7 @@ export default function List() {
|
|||||||
// Create Button Menu
|
// Create Button Menu
|
||||||
const [anchorEl, setAnchorEl] = React.useState<null | HTMLElement>(null);
|
const [anchorEl, setAnchorEl] = React.useState<null | HTMLElement>(null);
|
||||||
const createMenu = Boolean(anchorEl);
|
const createMenu = Boolean(anchorEl);
|
||||||
const importForm = useRef<HTMLInputElement>(null)
|
const importForm = useRef<HTMLInputElement>(null)
|
||||||
const [currentImportFileName, setCurrentImportFileName] = useState(null)
|
const [currentImportFileName, setCurrentImportFileName] = useState(null)
|
||||||
|
|
||||||
const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {
|
const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {
|
||||||
@@ -135,8 +137,8 @@ export default function List() {
|
|||||||
handleClose();
|
handleClose();
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<input type='file' id='file' ref={importForm} style={{ display: 'none' }} onChange={handleImportChange} accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel, text/plain" />
|
<input type='file' id='file' ref={importForm} style={{ display: 'none' }} onChange={handleImportChange} accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel, text/plain" />
|
||||||
@@ -145,8 +147,8 @@ export default function List() {
|
|||||||
{/* <h1>kjasndkjandskjasndkjansdkjansd</h1> */}
|
{/* <h1>kjasndkjandskjasndkjansdkjansd</h1> */}
|
||||||
<Button
|
<Button
|
||||||
id="import-button"
|
id="import-button"
|
||||||
variant='outlined'
|
variant='contained'
|
||||||
startIcon={<AddIcon />} sx={{ p: 1.8 }}
|
startIcon={<AddIcon />} sx={{ p: 1.8, width: '200px' }}
|
||||||
aria-controls={createMenu ? 'basic-menu' : undefined}
|
aria-controls={createMenu ? 'basic-menu' : undefined}
|
||||||
aria-haspopup="true"
|
aria-haspopup="true"
|
||||||
aria-expanded={createMenu ? 'true' : undefined}
|
aria-expanded={createMenu ? 'true' : undefined}
|
||||||
@@ -186,7 +188,7 @@ export default function List() {
|
|||||||
</Button>
|
</Button>
|
||||||
</Stack>
|
</Stack>
|
||||||
)}
|
)}
|
||||||
{( importResult &&
|
{( importResult &&
|
||||||
<Stack direction={'row'} sx={{ px: 2, pb: 2 }}>
|
<Stack direction={'row'} sx={{ px: 2, pb: 2 }}>
|
||||||
<Box sx={{ color: "text.secondary" }}>Last Import Result Report : <a href={importResult.result_file?.url ?? "#"}>{importResult.result_file?.name ?? "-"}</a></Box>
|
<Box sx={{ color: "text.secondary" }}>Last Import Result Report : <a href={importResult.result_file?.url ?? "#"}>{importResult.result_file?.name ?? "-"}</a></Box>
|
||||||
</Stack>
|
</Stack>
|
||||||
@@ -220,7 +222,7 @@ export default function List() {
|
|||||||
let updatedModel = model;
|
let updatedModel = model;
|
||||||
if (row.id == model.id) {
|
if (row.id == model.id) {
|
||||||
updatedModel.active = res.data.icd.active;
|
updatedModel.active = res.data.icd.active;
|
||||||
}
|
}
|
||||||
return updatedModel;
|
return updatedModel;
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
@@ -240,15 +242,22 @@ export default function List() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<TableRow sx={{ '& > *': { borderBottom: 'unset' } }}>
|
<TableRow sx={{ '& > *': { borderBottom: '1' } }}>
|
||||||
<TableCell align="left">{row.code}</TableCell>
|
<TableCell align="left"/>
|
||||||
<TableCell align="left">{row.name}</TableCell>
|
<TableCell align="left">{row.code}</TableCell>
|
||||||
<TableCell align="right">
|
<TableCell align="left">{row.name}</TableCell>
|
||||||
{/* <Button variant="outlined" color="error" size="small">Disable</Button> */}
|
<TableCell align="right">
|
||||||
<Link to={`/master/diagnosis/${row.id}/diagnosis-history`}>
|
<Stack direction="row" justifyContent="flex-end" spacing={1}>
|
||||||
<HistoryIcon />
|
<TableMoreMenu actions={
|
||||||
</Link>
|
<>
|
||||||
</TableCell>
|
<MenuItem onClick={() => navigate(`/master/diagnosis/${row.id}/diagnosis-history`)}>
|
||||||
|
<HistoryIcon />
|
||||||
|
History
|
||||||
|
</MenuItem>
|
||||||
|
</>
|
||||||
|
} />
|
||||||
|
</Stack>
|
||||||
|
</TableCell>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
);
|
);
|
||||||
@@ -301,22 +310,29 @@ export default function List() {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
loadDataTableData();
|
loadDataTableData();
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack>
|
<Stack>
|
||||||
<ImportForm />
|
<ImportForm />
|
||||||
|
|
||||||
<Card>
|
|
||||||
{/* The Main Table */}
|
{/* The Main Table */}
|
||||||
<TableContainer component={Paper}>
|
<TableContainer component={Paper} sx={{ px: 1, mt: 3 }}>
|
||||||
<Table aria-label="collapsible table">
|
<Table aria-label="collapsible table">
|
||||||
<TableBody>
|
<colgroup>
|
||||||
|
<col width="20" />
|
||||||
|
<col width="250" />
|
||||||
|
<col width="*" />
|
||||||
|
<col width="50" />
|
||||||
|
</colgroup>
|
||||||
|
|
||||||
|
<TableHead>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
|
<TableCell align="left" />
|
||||||
<TableCell style={headStyle} align="left">Code</TableCell>
|
<TableCell style={headStyle} align="left">Code</TableCell>
|
||||||
<TableCell style={headStyle} align="left">Description</TableCell>
|
<TableCell style={headStyle} align="left">Description</TableCell>
|
||||||
<TableCell style={headStyle} align="right">Action</TableCell>
|
<TableCell style={headStyle} align="right"></TableCell>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
</TableBody>
|
</TableHead>
|
||||||
{dataTableIsLoading ?
|
{dataTableIsLoading ?
|
||||||
(
|
(
|
||||||
<TableBody>
|
<TableBody>
|
||||||
@@ -325,7 +341,7 @@ export default function List() {
|
|||||||
</TableRow>
|
</TableRow>
|
||||||
</TableBody>
|
</TableBody>
|
||||||
) : (
|
) : (
|
||||||
dataTableData.data.length == 0 ?
|
dataTableData.data.length == 0 ?
|
||||||
(
|
(
|
||||||
<TableBody>
|
<TableBody>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
@@ -342,9 +358,8 @@ export default function List() {
|
|||||||
)}
|
)}
|
||||||
</Table>
|
</Table>
|
||||||
</TableContainer>
|
</TableContainer>
|
||||||
|
|
||||||
<BasePagination paginationData={dataTableData} onPageChange={handlePageChange}/>
|
<BasePagination paginationData={dataTableData} onPageChange={handlePageChange}/>
|
||||||
</Card>
|
|
||||||
</Stack>
|
</Stack>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,8 +24,8 @@ export default function PlanCreate() {
|
|||||||
}, [configuredCorporateContext])
|
}, [configuredCorporateContext])
|
||||||
|
|
||||||
const [ currentCorporatePlan, setCurrentCorporatePlan ] = useState<CorporatePlan>();
|
const [ currentCorporatePlan, setCurrentCorporatePlan ] = useState<CorporatePlan>();
|
||||||
|
|
||||||
|
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
const isEdit = !!id;
|
const isEdit = !!id;
|
||||||
@@ -48,6 +48,7 @@ export default function PlanCreate() {
|
|||||||
return (
|
return (
|
||||||
<Page title= "Master ICD - 10">
|
<Page title= "Master ICD - 10">
|
||||||
<HeaderBreadcrumbs
|
<HeaderBreadcrumbs
|
||||||
|
sx={{ px: 2 }}
|
||||||
heading={'Master ICD - 10'}
|
heading={'Master ICD - 10'}
|
||||||
links={[
|
links={[
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as Yup from 'yup';
|
import * as Yup from 'yup';
|
||||||
import { LoadingButton } from "@mui/lab";
|
import { LoadingButton } from "@mui/lab";
|
||||||
import { Card, Grid, Stack, Typography } from "@mui/material";
|
import { Box, Card, Grid, Stack, Typography } from "@mui/material";
|
||||||
import { CorporatePlan } from "../../../../@types/corporates";
|
import { CorporatePlan } from "../../../../@types/corporates";
|
||||||
import { FormProvider, RHFSwitch, RHFTextField } from "../../../../components/hook-form";
|
import { FormProvider, RHFSwitch, RHFTextField } from "../../../../components/hook-form";
|
||||||
import { useEffect, useMemo } from 'react';
|
import { useEffect, useMemo } from 'react';
|
||||||
@@ -9,6 +9,7 @@ import { yupResolver } from '@hookform/resolvers/yup';
|
|||||||
import { useSnackbar } from 'notistack';
|
import { useSnackbar } from 'notistack';
|
||||||
import { useNavigate, useParams } from 'react-router-dom';
|
import { useNavigate, useParams } from 'react-router-dom';
|
||||||
import axios from '../../../../utils/axios';
|
import axios from '../../../../utils/axios';
|
||||||
|
import palette from '@/theme/palette';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
isEdit: boolean;
|
isEdit: boolean;
|
||||||
@@ -68,11 +69,11 @@ export default function CorporatePlanForm({ isEdit, currentCorporatePlan }: Prop
|
|||||||
enqueueSnackbar('Division created successfully', { variant: 'success' });
|
enqueueSnackbar('Division created successfully', { variant: 'success' });
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
navigate('/master/diagnosis-template', { replace: true });
|
navigate('/master/diagnosis', { replace: true });
|
||||||
})
|
})
|
||||||
.catch(({ response }) => {
|
.catch(({ response }) => {
|
||||||
if (response.status === 422) {
|
if (response.status === 422) {
|
||||||
for (const [key, value] of Object.entries(response.data.errors)) {
|
for (const [key, value] of Object.entries(response.data.errors)) {
|
||||||
setError(key, { message: value[0] });
|
setError(key, { message: value[0] });
|
||||||
enqueueSnackbar(value[0] ?? 'Failed Processing Request', { variant: 'error' });
|
enqueueSnackbar(value[0] ?? 'Failed Processing Request', { variant: 'error' });
|
||||||
}
|
}
|
||||||
@@ -88,7 +89,7 @@ export default function CorporatePlanForm({ isEdit, currentCorporatePlan }: Prop
|
|||||||
enqueueSnackbar('Division updated successfully', { variant: 'success' });
|
enqueueSnackbar('Division updated successfully', { variant: 'success' });
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
navigate('/master/diagnosis-template' , { replace: true });
|
navigate('/master/diagnosis' , { replace: true });
|
||||||
})
|
})
|
||||||
.catch(({ response }) => {
|
.catch(({ response }) => {
|
||||||
enqueueSnackbar('Update Failed : '+ response.data.message, { variant: 'error' });
|
enqueueSnackbar('Update Failed : '+ response.data.message, { variant: 'error' });
|
||||||
@@ -98,31 +99,27 @@ export default function CorporatePlanForm({ isEdit, currentCorporatePlan }: Prop
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<FormProvider methods={methods} onSubmit={handleSubmit(onSubmit)}>
|
<FormProvider methods={methods} onSubmit={handleSubmit(onSubmit)}>
|
||||||
<Grid container spacing={2}>
|
<Box sx={{ px: 2 }}>
|
||||||
<Grid item xs={8}>
|
<Grid container spacing={2}>
|
||||||
<Card sx={{ p: 2 }}>
|
<Grid item xs={8}>
|
||||||
<Stack spacing={3}>
|
<Card sx={{ px: 3, py: 4 }}>
|
||||||
|
<Stack spacing={6}>
|
||||||
|
|
||||||
<Typography variant="h6">Detail</Typography>
|
<Typography variant="h6" color={palette.light.primary.main}>Detail</Typography>
|
||||||
|
|
||||||
|
|
||||||
<RHFTextField name="name" label="Name" />
|
<RHFTextField name="name" label="Name" />
|
||||||
<RHFTextField name="description" label="Description" />
|
<RHFTextField name="description" label="Description" />
|
||||||
|
|
||||||
<LoadingButton type="submit" variant="contained" size="large" fullWidth={true} loading={isSubmitting}>
|
<LoadingButton type="submit" variant="contained" size="large" fullWidth={true} loading={isSubmitting}>
|
||||||
{ isEdit? 'Update' : 'Create' }
|
{ isEdit? 'Update' : 'Create' }
|
||||||
</LoadingButton>
|
</LoadingButton>
|
||||||
|
|
||||||
</Stack>
|
</Stack>
|
||||||
</Card>
|
</Card>
|
||||||
</Grid>
|
</Grid>
|
||||||
{/* <Grid item xs={4}>
|
</Grid>
|
||||||
<Card sx={{ p:2 }}>
|
</Box>
|
||||||
|
|
||||||
<RHFSwitch name="active" label="Active" />
|
|
||||||
</Card>
|
|
||||||
</Grid> */}
|
|
||||||
</Grid>
|
|
||||||
</FormProvider>
|
</FormProvider>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,27 +12,26 @@ export default function Divisions() {
|
|||||||
|
|
||||||
const { corporate_id } = useParams();
|
const { corporate_id } = useParams();
|
||||||
|
|
||||||
const pageTitle = 'Diagnosis Template';
|
const pageTitle = 'Diagnosis';
|
||||||
return (
|
return (
|
||||||
<Page title={ pageTitle }>
|
<Page title={ pageTitle }>
|
||||||
|
|
||||||
<HeaderBreadcrumbs
|
<HeaderBreadcrumbs
|
||||||
|
sx={{ px: 2 }}
|
||||||
heading={ pageTitle }
|
heading={ pageTitle }
|
||||||
links={[
|
links={[
|
||||||
{
|
{
|
||||||
name: 'Master',
|
name: 'Master',
|
||||||
href: '/master/diagnosis-template',
|
href: '/master/diagnosis',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Diagnosis Template',
|
name: 'Diagnosis',
|
||||||
href: '/master/diagnosis-template',
|
href: '/master/diagnosis',
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Card>
|
|
||||||
<List />
|
<List />
|
||||||
</Card>
|
|
||||||
</Page>
|
</Page>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import UploadIcon from '@mui/icons-material/Upload';
|
|||||||
import CancelIcon from '@mui/icons-material/Cancel';
|
import CancelIcon from '@mui/icons-material/Cancel';
|
||||||
import HistoryIcon from '@mui/icons-material/History';
|
import HistoryIcon from '@mui/icons-material/History';
|
||||||
// hooks
|
// hooks
|
||||||
import { Link, NavLink as RouterLink } from 'react-router-dom';
|
import { Link, NavLink as RouterLink, useNavigate } from 'react-router-dom';
|
||||||
import React, { ChangeEvent, Component, useEffect, useRef, useState } from 'react';
|
import React, { ChangeEvent, Component, useEffect, useRef, useState } from 'react';
|
||||||
import useSettings from '../../../../hooks/useSettings';
|
import useSettings from '../../../../hooks/useSettings';
|
||||||
import { useParams, useSearchParams } from 'react-router-dom';
|
import { useParams, useSearchParams } from 'react-router-dom';
|
||||||
@@ -17,13 +17,16 @@ import { LaravelPaginatedData } from '../../../../@types/paginated-data';
|
|||||||
import { Icd } from '../../../../@types/diagnosis';
|
import { Icd } from '../../../../@types/diagnosis';
|
||||||
import BasePagination from '../../../../components/BasePagination';
|
import BasePagination from '../../../../components/BasePagination';
|
||||||
import { enqueueSnackbar } from 'notistack';
|
import { enqueueSnackbar } from 'notistack';
|
||||||
|
import TableMoreMenu from '@/components/table/TableMoreMenu';
|
||||||
|
import { EditOutlined, FindInPageOutlined } from '@mui/icons-material';
|
||||||
|
|
||||||
export default function List() {
|
export default function List() {
|
||||||
const { themeStretch } = useSettings();
|
const navigate = useNavigate();
|
||||||
const { corporate_id } = useParams();
|
const { themeStretch } = useSettings();
|
||||||
const [searchParams, setSearchParams] = useSearchParams();
|
const { corporate_id } = useParams();
|
||||||
const [importResult, setImportResult] = useState(null);
|
const [searchParams, setSearchParams] = useSearchParams();
|
||||||
|
const [importResult, setImportResult] = useState(null);
|
||||||
|
|
||||||
function SearchInput(props: any) {
|
function SearchInput(props: any) {
|
||||||
// SEARCH
|
// SEARCH
|
||||||
const searchInput = useRef<HTMLInputElement>(null);
|
const searchInput = useRef<HTMLInputElement>(null);
|
||||||
@@ -44,7 +47,7 @@ export default function List() {
|
|||||||
}, [searchParams])
|
}, [searchParams])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<form onSubmit={handleSearchSubmit} style={{ width: '100%' }}>
|
<form onSubmit={handleSearchSubmit} style={{ width: '90%' }}>
|
||||||
<TextField id="search-input" ref={searchInput} label="Search" variant="outlined" fullWidth onChange={handleSearchChange} value={searchText}/>
|
<TextField id="search-input" ref={searchInput} label="Search" variant="outlined" fullWidth onChange={handleSearchChange} value={searchText}/>
|
||||||
</form>
|
</form>
|
||||||
);
|
);
|
||||||
@@ -55,7 +58,7 @@ export default function List() {
|
|||||||
// Create Button Menu
|
// Create Button Menu
|
||||||
const [anchorEl, setAnchorEl] = React.useState<null | HTMLElement>(null);
|
const [anchorEl, setAnchorEl] = React.useState<null | HTMLElement>(null);
|
||||||
const createMenu = Boolean(anchorEl);
|
const createMenu = Boolean(anchorEl);
|
||||||
const importForm = useRef<HTMLInputElement>(null)
|
const importForm = useRef<HTMLInputElement>(null)
|
||||||
const [currentImportFileName, setCurrentImportFileName] = useState(null)
|
const [currentImportFileName, setCurrentImportFileName] = useState(null)
|
||||||
|
|
||||||
const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {
|
const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {
|
||||||
@@ -130,8 +133,8 @@ export default function List() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<input type='file' id='file' ref={importForm} style={{ display: 'none' }} onChange={handleImportChange} accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel, text/plain" />
|
<input type='file' id='file' ref={importForm} style={{ display: 'none' }} onChange={handleImportChange} accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel, text/plain" />
|
||||||
@@ -139,17 +142,15 @@ export default function List() {
|
|||||||
<SearchInput onSearch={applyFilter}/>
|
<SearchInput onSearch={applyFilter}/>
|
||||||
{/* <h1>kjasndkjandskjasndkjansdkjansd</h1> */}
|
{/* <h1>kjasndkjandskjasndkjansdkjansd</h1> */}
|
||||||
<Button
|
<Button
|
||||||
id="import-button"
|
id="import-button"
|
||||||
variant='outlined'
|
variant='contained'
|
||||||
startIcon={<AddIcon />} sx={{ p: 1.8 }}
|
startIcon={<AddIcon />} sx={{ p: 1.8, width: '200px' }}
|
||||||
aria-controls={createMenu ? 'basic-menu' : undefined}
|
aria-controls={createMenu ? 'basic-menu' : undefined}
|
||||||
aria-haspopup="true"
|
aria-haspopup="true"
|
||||||
aria-expanded={createMenu ? 'true' : undefined}
|
aria-expanded={createMenu ? 'true' : undefined}
|
||||||
|
onClick={() => navigate(`/master/diagnosis/create`)}
|
||||||
>
|
>
|
||||||
<Link to={`/master/diagnosis-template/create`} style={{ textDecoration: 'none', color: 'blue'}}>
|
Create
|
||||||
Create
|
|
||||||
</Link>
|
|
||||||
</Button>
|
</Button>
|
||||||
<Menu
|
<Menu
|
||||||
id="import-button"
|
id="import-button"
|
||||||
@@ -161,7 +162,7 @@ export default function List() {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<MenuItem>
|
<MenuItem>
|
||||||
|
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
</Menu>
|
</Menu>
|
||||||
</Stack>
|
</Stack>
|
||||||
@@ -195,7 +196,7 @@ export default function List() {
|
|||||||
let updatedModel = model;
|
let updatedModel = model;
|
||||||
if (row.id == model.id) {
|
if (row.id == model.id) {
|
||||||
updatedModel.active = res.data.icd.active;
|
updatedModel.active = res.data.icd.active;
|
||||||
}
|
}
|
||||||
return updatedModel;
|
return updatedModel;
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
@@ -211,27 +212,30 @@ export default function List() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<TableRow sx={{ '& > *': { borderBottom: 'unset' } }}>
|
<TableRow sx={{ '& > *': { borderBottom: '1' } }}>
|
||||||
<TableCell align="left">{row.name}</TableCell>
|
<TableCell align="left"/>
|
||||||
<TableCell align="left">{row.description ?? '-'}</TableCell>
|
<TableCell align="left">{row.name}</TableCell>
|
||||||
<TableCell align="center">
|
<TableCell align="left">{row.description ?? '-'}</TableCell>
|
||||||
{/* <Button variant="outlined" color="error" size="small">Disable</Button> */}
|
<TableCell align="center">
|
||||||
<Stack direction="row" justifyContent="flex-end" spacing={1}>
|
<Stack direction="row" justifyContent="flex-end" spacing={1}>
|
||||||
<Link to={`/master/diagnosis/${row.id}`}>
|
<TableMoreMenu actions={
|
||||||
<Button variant="outlined" color="primary" size="small">
|
<>
|
||||||
Detail
|
<MenuItem onClick={() => navigate(`/master/diagnosis/${row.id}`)}>
|
||||||
</Button>
|
<FindInPageOutlined />
|
||||||
</Link>
|
Detail
|
||||||
<Link to={`/master/diagnosis-template/${row.id}/edit`}>
|
</MenuItem>
|
||||||
<Button variant="outlined" color="primary" size="small">
|
<MenuItem onClick={() => navigate(`/master/diagnosis-template/${row.id}/edit`)} >
|
||||||
Edit
|
<EditOutlined />
|
||||||
</Button>
|
Edit
|
||||||
</Link>
|
</MenuItem>
|
||||||
<Link to={`/master/diagnosis-template/${row.id}/diagnosis-template-history`}>
|
<MenuItem onClick={() => navigate(`/master/diagnosis-template/${row.id}/diagnosis-template-history`)}>
|
||||||
<HistoryIcon />
|
<HistoryIcon />
|
||||||
</Link>
|
History
|
||||||
</Stack>
|
</MenuItem>
|
||||||
</TableCell>
|
</>
|
||||||
|
} />
|
||||||
|
</Stack>
|
||||||
|
</TableCell>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
);
|
);
|
||||||
@@ -285,22 +289,29 @@ export default function List() {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
loadDataTableData();
|
loadDataTableData();
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack>
|
<Stack>
|
||||||
<ImportForm />
|
<ImportForm />
|
||||||
|
|
||||||
<Card>
|
|
||||||
{/* The Main Table */}
|
{/* The Main Table */}
|
||||||
<TableContainer component={Paper}>
|
<TableContainer component={Paper} sx={{ px: 1, mt: 3 }}>
|
||||||
<Table aria-label="collapsible table">
|
<Table aria-label="collapsible table">
|
||||||
<TableBody>
|
<colgroup>
|
||||||
|
<col width="20" />
|
||||||
|
<col width="250" />
|
||||||
|
<col width="*" />
|
||||||
|
<col width="50" />
|
||||||
|
</colgroup>
|
||||||
|
|
||||||
|
<TableHead>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
|
<TableCell align="left" />
|
||||||
<TableCell style={headStyle} align="left">Name</TableCell>
|
<TableCell style={headStyle} align="left">Name</TableCell>
|
||||||
<TableCell style={headStyle} align="left">Description</TableCell>
|
<TableCell style={headStyle} align="left">Description</TableCell>
|
||||||
<TableCell style={headStyle} align="right">Action</TableCell>
|
<TableCell style={headStyle} align="right"></TableCell>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
</TableBody>
|
</TableHead>
|
||||||
{dataTableIsLoading ?
|
{dataTableIsLoading ?
|
||||||
(
|
(
|
||||||
<TableBody>
|
<TableBody>
|
||||||
@@ -309,7 +320,7 @@ export default function List() {
|
|||||||
</TableRow>
|
</TableRow>
|
||||||
</TableBody>
|
</TableBody>
|
||||||
) : (
|
) : (
|
||||||
dataTableData.data.length == 0 ?
|
dataTableData.data.length == 0 ?
|
||||||
(
|
(
|
||||||
<TableBody>
|
<TableBody>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
@@ -326,9 +337,8 @@ export default function List() {
|
|||||||
)}
|
)}
|
||||||
</Table>
|
</Table>
|
||||||
</TableContainer>
|
</TableContainer>
|
||||||
|
|
||||||
<BasePagination paginationData={dataTableData} onPageChange={handlePageChange}/>
|
<BasePagination paginationData={dataTableData} onPageChange={handlePageChange}/>
|
||||||
</Card>
|
|
||||||
</Stack>
|
</Stack>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -268,12 +268,12 @@ export default function Router() {
|
|||||||
element: <MasterHospitalsCreate />,
|
element: <MasterHospitalsCreate />,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'master/diagnosis-template/create',
|
path: 'master/diagnosis',
|
||||||
element: <MasterDiagnosisTemplateCreate />,
|
element: <MasterDiagnosisTemplate />,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'master/diagnosis-template',
|
path: 'master/diagnosis/create',
|
||||||
element: <MasterDiagnosisTemplate />,
|
element: <MasterDiagnosisTemplateCreate />,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'master/diagnosis-template/:id/diagnosis-template-history',
|
path: 'master/diagnosis-template/:id/diagnosis-template-history',
|
||||||
|
|||||||
Reference in New Issue
Block a user