Update Hospital portal

This commit is contained in:
ivan-sim
2024-03-04 09:54:07 +07:00
parent 3bae411dc6
commit 39ccf2a0b5
5 changed files with 55 additions and 25 deletions

View File

@@ -57,5 +57,7 @@
"txtCancel": "Cancel", "txtCancel": "Cancel",
"txtDecline": "Decline", "txtDecline": "Decline",
"txtApprove": "Approve", "txtApprove": "Approve",
"txtDialogConfirmation": "Are you sure you want to proceed with this action?" "txtDialogConfirmation": "Are you sure you want to proceed with this action?",
"txtStartDate": "Start Date",
"txtEndDate": "End Date"
} }

View File

@@ -57,5 +57,7 @@
"txtCancel": "Batal", "txtCancel": "Batal",
"txtDecline": "Tolak", "txtDecline": "Tolak",
"txtApprove": "Terima", "txtApprove": "Terima",
"txtDialogConfirmation": "Apakah Anda yakin ingin melanjutkan tindakan ini?" "txtDialogConfirmation": "Apakah Anda yakin ingin melanjutkan tindakan ini?",
"txtStartDate": "Tanggal Mulai",
"txtEndDate": "Tanggal Akhir"
} }

View File

@@ -26,6 +26,10 @@ import {
linearProgressClasses, linearProgressClasses,
} from '@mui/material'; } from '@mui/material';
import { visuallyHidden } from '@mui/utils'; import { visuallyHidden } from '@mui/utils';
import { DatePicker, LocalizationProvider, MobileDatePicker } from '@mui/x-date-pickers';
import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns';
/* ---------------------------------- axios --------------------------------- */ /* ---------------------------------- axios --------------------------------- */
import axios from '../utils/axios'; import axios from '../utils/axios';
/* ---------------------------------- react --------------------------------- */ /* ---------------------------------- react --------------------------------- */
@@ -297,7 +301,7 @@ export default function Table<T>({
{/* Start date */} {/* Start date */}
{filterStartDate && filterStartDate.useFilter ? ( {filterStartDate && filterStartDate.useFilter ? (
<Grid item xs={12} lg={2} xl={2}> <Grid item xs={12} lg={2} xl={2}>
<form onChange={(event) => filterStartDate.handleStartDateChange(event)}> {/* <form onChange={(event) => filterStartDate.handleStartDateChange(event)}>
<TextField <TextField
id="date-input" id="date-input"
type="date" type="date"
@@ -309,7 +313,18 @@ export default function Table<T>({
shrink: true, shrink: true,
}} }}
/> />
</form> </form> */}
<LocalizationProvider dateAdapter={AdapterDateFns}>
<DatePicker
label={localeData.txtStartDate}
value={filterStartDate.startDate}
onChange={(newValue:any) => {
filterStartDate.setStartDate( (newValue));
}}
inputFormat="dd-MM-yyyy"
renderInput={(params) => <TextField sx={{width:'40%'}} {...params} required/>}
/>
</LocalizationProvider>
</Grid> </Grid>
) : null } ) : null }
@@ -317,7 +332,7 @@ export default function Table<T>({
{filterEndDate && filterEndDate.useFilter ? ( {filterEndDate && filterEndDate.useFilter ? (
<Grid item xs={12} lg={2} xl={2}> <Grid item xs={12} lg={2} xl={2}>
<form onChange={(event) => filterEndDate.handleEndDateChange(event)}> {/* <form onChange={(event) => filterEndDate.handleEndDateChange(event)}>
<TextField <TextField
id="date-input" id="date-input"
type="date" type="date"
@@ -329,7 +344,18 @@ export default function Table<T>({
shrink: true, shrink: true,
}} }}
/> />
</form> </form> */}
<LocalizationProvider dateAdapter={AdapterDateFns}>
<DatePicker
label={localeData.txtEndDate}
value={filterEndDate.endDate}
onChange={(newValue:any) => {
filterEndDate.setEndDate( (newValue));
}}
inputFormat="dd-MM-yyyy"
renderInput={(params) => <TextField sx={{width:'40%'}} {...params} required/>}
/>
</LocalizationProvider>
</Grid> </Grid>
) : null } ) : null }

View File

@@ -304,12 +304,12 @@ export default function TableList() {
label: localeData.txtStatus, label: localeData.txtStatus,
isSort: true, isSort: true,
}, },
{ // {
id: 'action', // id: 'action',
align: 'right', // align: 'right',
label: '', // label: '',
isSort: false, // isSort: false,
}, // },
]; ];
@@ -363,15 +363,15 @@ export default function TableList() {
{obj.submission_date ? fDateSuffix(obj.submission_date) : ''} {obj.submission_date ? fDateSuffix(obj.submission_date) : ''}
</Label> </Label>
, ,
action: // action:
<TableMoreMenu actions={ // <TableMoreMenu actions={
<> // <>
<MenuItem onClick={() => navigate ('/claim/detail/'+obj.claim_request_id)}> // <MenuItem onClick={() => navigate ('/claim/detail/'+obj.claim_request_id)}>
<Iconify icon="eva:eye-fill" /> // <Iconify icon="eva:eye-fill" />
View // View
</MenuItem> // </MenuItem>
</> // </>
} /> // } />
})) }))
); );

View File

@@ -239,7 +239,7 @@ export default function TableList() {
}; };
// handle start date // handle start date
const [startDateValue, setStartDateValue] = useState(''); const [startDateValue, setStartDateValue] = useState(null);
const handleStartDateChanges = async (event: React.FormEvent<HTMLFormElement>) => { const handleStartDateChanges = async (event: React.FormEvent<HTMLFormElement>) => {
event.preventDefault(); event.preventDefault();
@@ -263,7 +263,7 @@ export default function TableList() {
}; };
// handle end date // handle end date
const [endDateValue, setEndDateValue] = useState(''); const [endDateValue, setEndDateValue] = useState(null);
const handleEndDateChanges = async (event: React.FormEvent<HTMLFormElement>) => { const handleEndDateChanges = async (event: React.FormEvent<HTMLFormElement>) => {
event.preventDefault(); event.preventDefault();
@@ -494,8 +494,8 @@ export default function TableList() {
searchs={searchs} searchs={searchs}
filterStatus={filterStatus} filterStatus={filterStatus}
selected={selected} selected={selected}
// filterStartDate={filterStartDate} //filterStartDate={filterStartDate}
// filterEndDate={filterEndDate} //filterEndDate={filterEndDate}
/> />
<MuiDialog <MuiDialog
title={{name: nameMember}} title={{name: nameMember}}