Merge remote-tracking branch 'origin/staging' into origin/production

This commit is contained in:
Server D3 Linksehat
2024-10-16 10:56:59 +07:00
2 changed files with 83 additions and 13 deletions

View File

@@ -15,9 +15,12 @@ import {
Stack,
Menu,
ButtonGroup,
FormControl,
Select,
Link,
Chip,
TableHead,
InputLabel,
Grid,
} from '@mui/material';
import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
@@ -61,6 +64,13 @@ export default function List() {
const navigate = useNavigate()
const fileOptions = {
kondisi: 'Dokumen Billing',
diagnosa: 'Dokumen Diagnosa',
result: 'Dokumen Penduk Medis',
none: 'Belum ada Dokumen'
};
function SearchInput(props: any) {
// SEARCH
const searchInput = useRef<HTMLInputElement>(null);
@@ -199,15 +209,48 @@ export default function List() {
/>
{!currentImportFileName && (
<Stack direction={'row'} spacing={2} sx={{ p: 2 }}>
<SearchInput onSearch={applyFilter} />
<Button
variant="outlined"
startIcon={<UploadIcon />}
sx={{ p: 1.8 }}
onClick={handleClick}
>
Import
</Button>
<Grid item md={9}>
<SearchInput onSearch={applyFilter} />
</Grid>
<Grid item md={2}>
<FormControl fullWidth>
<InputLabel>File</InputLabel>
<Select
value={searchParams.get('file') ?? 'semua'} // Pastikan menggunakan kunci 'file'
label="File"
onChange={(el) => {
const selectedValue = el.target.value;
const filter = Object.fromEntries(searchParams.entries());
if (selectedValue === 'semua') {
delete filter.file; // Menghapus filter 'file' jika memilih 'semua'
} else {
filter.file = selectedValue; // Menambahkan atau memperbarui filter 'file'
}
setSearchParams(filter); // Update state searchParams
loadDataTableData(filter); // Memuat data sesuai filter
}}
>
<MenuItem value={'semua'}>Semua</MenuItem>
{Object.entries(fileOptions).map((option, index) => (
<MenuItem value={option[0]} key={index}>
{option[1]}
</MenuItem>
))}
</Select>
</FormControl>
</Grid>
<Grid item md={1}>
<Button
variant="outlined"
startIcon={<UploadIcon />}
sx={{ p: 1.8 }}
onClick={handleClick}
>
Import
</Button>
</Grid>
<Menu
id="import-button"
anchorEl={anchorEl}
@@ -353,6 +396,31 @@ export default function List() {
<TableCell align="left"><Label>{fDateTimesecond(row.admission_date)}</Label></TableCell>
<TableCell align="left">{row.service_name}</TableCell>
<TableCell align="left">{row.payment_type_name}</TableCell>
<TableCell align="left">
{row.files_by_type?.final_log_diagnosis?.length > 0 && (
<>
<Label variant='ghost' color='primary'>
{row.files_by_type.final_log_diagnosis.length} File Diagnosa
</Label>
<br />
</>
)}
{row.files_by_type?.final_log_kondisi?.length > 0 && (
<>
<Label variant='ghost' color='success'>
{row.files_by_type.final_log_kondisi.length} File Billing
</Label>
<br />
</>
)}
{row.files_by_type?.final_log_result?.length > 0 && (
<Label variant='ghost' color='warning'>
{row.files_by_type.final_log_result.length} File Pendukung Medis
</Label>
)}
</TableCell>
<TableCell align="left">
{ row.status_final_log == "requested" ?
(<Label variant='ghost' color='primary'>{capitalizeFirstLetter(row.status_final_log)}</Label>) :
@@ -500,6 +568,9 @@ export default function List() {
<TableCell style={headStyle} align="left">
Claim Method
</TableCell>
<TableCell style={headStyle} align="left">
File Upload
</TableCell>
<TableCell style={headStyle} align="left">
Status
</TableCell>

View File

@@ -241,7 +241,6 @@ export default function List() {
<Stack direction={'row'} spacing={2} sx={{ p: 2 }}>
<Grid item md={9}>
<SearchInput onSearch={applyFilter} />
</Grid>
<Grid item md={2}>
<FormControl fullWidth>
@@ -464,7 +463,7 @@ export default function List() {
{row.files_by_type?.final_log_diagnosis?.length > 0 && (
<>
<Label variant='ghost' color='primary'>
File Diagnosa {row.files_by_type.final_log_diagnosis.length}
{row.files_by_type.final_log_diagnosis.length} File Diagnosa
</Label>
<br />
</>
@@ -473,7 +472,7 @@ export default function List() {
{row.files_by_type?.final_log_kondisi?.length > 0 && (
<>
<Label variant='ghost' color='success'>
File Billing {row.files_by_type.final_log_kondisi.length}
{row.files_by_type.final_log_kondisi.length} File Billing
</Label>
<br />
</>
@@ -481,7 +480,7 @@ export default function List() {
{row.files_by_type?.final_log_result?.length > 0 && (
<Label variant='ghost' color='warning'>
File Pendukung Medis {row.files_by_type.final_log_result.length}
{row.files_by_type.final_log_result.length} File Pendukung Medis
</Label>
)}
</TableCell>