This commit is contained in:
ivan-sim
2023-10-24 16:10:47 +07:00
parent 33d3bdab37
commit 134cdb072d
12 changed files with 193 additions and 24 deletions

View File

@@ -30,6 +30,7 @@ export type Hospital = {
corporate_id: number;
code: string;
name?: string;
active: number;
}
export type Employee = {

View File

@@ -0,0 +1,8 @@
export type Drug = {
id: number;
type: string;
code: string;
name: string;
version:string;
active: number;
}

View File

@@ -42,6 +42,7 @@ const navConfig = [
{
title: 'PHARMACY & DELIVERY MANAGEMENT',
children: [
{ title: 'Drug', path: '/master/drugs'},
{ title: 'Inventory', path: '/inventory' },
{ title: 'Delivery Services', path: '/delivery' },
],
@@ -53,7 +54,6 @@ const navConfig = [
{ title: 'Corporate', path: '/corporates' },
// { title: 'Corporate Create', path: '/corporates/create' },
{ title: 'Formularium', path: '/master/formularium-template' },
{ title: 'Obat', path: '/master/drugs' },
{ title: 'Master ICD-10 Diagnosis', path: '/master/diagnosis-template' },
{ title: 'Hospitals', path: '/hospitals' },
],

View File

@@ -27,7 +27,7 @@ import React, { ChangeEvent, useEffect, useRef, useState } from 'react';
import { useNavigate, useParams, useSearchParams } from 'react-router-dom';
// components
import axios from '../../../utils/axios';
import { CorporatePlan } from '../../../@types/corporates';
import { Hospital } from '../../../@types/corporates';
import { LaravelPaginatedData } from '../../../@types/paginated-data';
import BasePagination from '../../../components/BasePagination';
import TableMoreMenu from '@/components/table/TableMoreMenu';
@@ -40,7 +40,7 @@ import CloseIcon from '@mui/icons-material/Close';
import { enqueueSnackbar } from 'notistack';
import Label from '../../../components/Label';
export default function PlanList() {
export default function HospitalList() {
const { corporate_id } = useParams();
const [searchParams, setSearchParams] = useSearchParams();
const navigate = useNavigate();
@@ -80,9 +80,9 @@ export default function PlanList() {
}
// Called on every row to map the data to the columns
function createData(plan: CorporatePlan): CorporatePlan {
function createData(hospital: Hospital): Hospital {
return {
...plan,
...hospital,
};
}

View File

@@ -61,6 +61,7 @@ import FindInPageOutlinedIcon from '@mui/icons-material/FindInPageOutlined';
import CachedOutlinedIcon from '@mui/icons-material/CachedOutlined';
import { Dialog, DialogTitle, DialogContent, DialogActions } from '@mui/material';
import CloseIcon from '@mui/icons-material/Close';
import Label from '../../../components/Label';
export default function CorporatePlanList({handleSubmitSuccess}) {
const navigate = useNavigate();
@@ -424,12 +425,14 @@ export default function CorporatePlanList({handleSubmitSuccess}) {
}
const [columns, setColumns] = React.useState([
{ id: 'member_id', label: 'Member ID', minWidth: 100, align: 'left', width: '10%' },
{ id: 'effective_date', label: 'Effective Date', minWidth: 100, align: 'left', width: '20%' },
{ id: 'member_id', label: 'Member ID', minWidth: 100, align: 'left', width: '15%' },
{ id: 'effective_date', label: 'Effective Date', minWidth: 100, align: 'left', width: '15%' },
{ id: 'name', label: 'Name', minWidth: 100, align: 'left', width: '20%' },
{ id: 'plan_id', label: 'Plan ID', minWidth: 100, align: 'left', width: '10%' },
{ id: 'activation_date', label: 'Activation Date', minWidth: 100, align: 'left', width: '20%' },
{ id: 'termination_date', label: 'Termination Date', minWidth: 100, align: 'left', width: '20%' },
{ id: 'plan_id', label: 'Plan', minWidth: 100, align: 'left', width: '10%' },
{ id: 'activation_date', label: 'Activation Date', minWidth: 100, align: 'left', width: '15%' },
{ id: 'termination_date', label: 'Termination Date', minWidth: 100, align: 'left', width: '15%' },
{id: 'status', label: 'Status', minWidth: 100, align: 'left', width: '5%' },
{id: 'action', label: '', minWidth: 100, align: 'left', width: '5%' },
]);
// Generate the every row of the table
@@ -489,6 +492,19 @@ export default function CorporatePlanList({handleSubmitSuccess}) {
<TableCell align="left">
<Typography variant='body2'>{row.terminated_date ? row.terminated_date : '-'}</Typography>
</TableCell>
<TableCell align="left">
<Typography variant='body2'>
{row.active === 1 ? (
<Label color='success' >
Active
</Label>
) : (
<Label color='error'>
Inactive
</Label>
)}
</Typography>
</TableCell>
<TableCell align='left'>
<TableMoreMenu actions={
<>

View File

@@ -1,16 +1,11 @@
import { Card, Grid } from "@mui/material";
import { useParams } from "react-router-dom";
import { Card } from "@mui/material";
import HeaderBreadcrumbs from "../../../components/HeaderBreadcrumbs";
import Page from "../../../components/Page";
import useSettings from "../../../hooks/useSettings";
import List from "./List";
import List from "./List2";
export default function Drugs() {
const { themeStretch } = useSettings();
const { corporate_id } = useParams();
const pageTitle = 'Drug';
return (
@@ -20,8 +15,8 @@ export default function Drugs() {
heading={ pageTitle }
links={[
{
name: 'Master',
href: '/master',
name: 'Pharmacy & Delivery Management',
href: '/',
},
{
name: 'Drug',

View File

@@ -14,6 +14,7 @@ import axios from '../../../utils/axios';
import { LaravelPaginatedData } from '../../../@types/paginated-data';
import { Icd } from '../../../@types/diagnosis';
import BasePagination from '../../../components/BasePagination';
import { enqueueSnackbar } from 'notistack';
export default function List() {
const { themeStretch } = useSettings();
@@ -42,7 +43,7 @@ export default function List() {
return (
<form onSubmit={handleSearchSubmit} style={{ width: '100%' }}>
<TextField id="search-input" ref={searchInput} label="Search" variant="outlined" fullWidth onChange={handleSearchChange} value={searchText}/>
<TextField id="search-input" ref={searchInput} label="Search Code or Name" variant="outlined" fullWidth onChange={handleSearchChange} value={searchText}/>
</form>
);
}
@@ -109,7 +110,6 @@ export default function List() {
<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" />
{( !currentImportFileName && <Stack direction={'row'} spacing={2} sx={{ p: 2 }}>
<SearchInput onSearch={applyFilter}/>
{/* <h1>kjasndkjandskjasndkjansdkjansd</h1> */}
<Button
id="import-button"
variant='outlined'