Merge remote-tracking branch 'origin/staging' into origin/production
This commit is contained in:
@@ -55,6 +55,8 @@ import palette from '@/theme/palette';
|
||||
import CardMedicine from '../Components/CardMedicine';
|
||||
import CardFile from '../Components/CardFile';
|
||||
import DialogEditFinalLOG from './Components/DialogEditFinalLOG';
|
||||
import DialogDeleteFileLog from './Components/DialogDeleteFileLog';
|
||||
import DialogUploadFileFinalLog from './Components/DialogUploadFileFinalLog';
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -131,6 +133,12 @@ export default function Detail() {
|
||||
return accumulator + (item.excess_paid || 0);
|
||||
}, 0);
|
||||
|
||||
// Handle Delete File LOG
|
||||
const [pathFile, setPathFile] = useState('')
|
||||
const [dialogDeleteFIleLog, setDialogDeleteFileLog] = useState(false)
|
||||
|
||||
// Handle Upload File LOG
|
||||
const [dialogUploadFileLog, setDialogUploadFileLog] = useState(false)
|
||||
|
||||
return (
|
||||
<Page title='Detail'>
|
||||
@@ -599,9 +607,54 @@ export default function Detail() {
|
||||
|
||||
{/* File */}
|
||||
<Grid item xs={12} md={12}>
|
||||
<CardFile
|
||||
requestLog={requestLog}
|
||||
/>
|
||||
<Card sx={{padding:2}} >
|
||||
<Stack direction="row" alignItems="center" justifyContent="space-between" sx={{marginBottom: 4}}>
|
||||
<Stack direction="column" spacing={2} sx={{marginBottom: 2}}>
|
||||
<Typography variant='subtitle1' sx={{color: '#19BBBB'}} gutterBottom>Files </Typography>
|
||||
</Stack>
|
||||
<Stack direction="column" spacing={2} sx={{marginBottom: 2}}>
|
||||
<Button variant="outlined" startIcon={<AddIcon/>} sx={{marginLeft: 'auto'}} onClick={() => {
|
||||
setDialogUploadFileLog(true)
|
||||
}} >
|
||||
<Typography variant="button" display="block">Files</Typography>
|
||||
</Button>
|
||||
</Stack>
|
||||
</Stack>
|
||||
{requestLog?.files?.map((documentType, index) => (
|
||||
<Stack direction="row" alignItems="center" justifyContent="space-between" sx={{marginBottom: 2}} key={index}>
|
||||
<Stack direction="column" spacing={2} >
|
||||
<a
|
||||
href={documentType.url}
|
||||
style={{ cursor: 'pointer', textDecoration: 'none', color: '#19BBBB' }}
|
||||
target="_blank"
|
||||
>
|
||||
<Typography variant="body2" gutterBottom>{documentType.original_name ? documentType.original_name : '-'}</Typography>
|
||||
</a>
|
||||
</Stack>
|
||||
<Stack direction="column" spacing={2}>
|
||||
<IconButton onClick={() => {
|
||||
setDialogDeleteFileLog(true)
|
||||
setPathFile(documentType.path)
|
||||
}} aria-label="delete" size="small" sx={{ marginLeft: 'auto' }}>
|
||||
<Delete color='error' fontSize="small" />
|
||||
</IconButton>
|
||||
</Stack>
|
||||
</Stack>
|
||||
))}
|
||||
|
||||
<DialogDeleteFileLog
|
||||
id={requestLog?.id}
|
||||
path={pathFile}
|
||||
setOpenDialog={setDialogDeleteFileLog}
|
||||
openDialog={dialogDeleteFIleLog}
|
||||
/>
|
||||
|
||||
<DialogUploadFileFinalLog
|
||||
id={requestLog?.id}
|
||||
setOpenDialog={setDialogUploadFileLog}
|
||||
openDialog={dialogUploadFileLog}
|
||||
/>
|
||||
</Card>
|
||||
</Grid>
|
||||
|
||||
{requestLog?.status_final_log == 'requested' ? (
|
||||
|
||||
Reference in New Issue
Block a user