Add Spesialis & DPPJ
This commit is contained in:
@@ -250,6 +250,14 @@ export default function Detail() {
|
||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Penempatan Kamar</Typography>
|
||||
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.penempatan_kamar ? requestLog?.penempatan_kamar : '-'}</Typography>
|
||||
</Stack>
|
||||
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Spesialis</Typography>
|
||||
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.specialities_id ? requestLog?.specialities_id : '-'}</Typography>
|
||||
</Stack>
|
||||
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
||||
<Typography variant='subtitle2' sx={style1} gutterBottom>DPPJ</Typography>
|
||||
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.dppj ? requestLog?.dppj : '-'}</Typography>
|
||||
</Stack>
|
||||
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Catatan</Typography>
|
||||
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.catatan ? requestLog?.catatan : '-'}</Typography>
|
||||
|
||||
@@ -24,6 +24,8 @@ export type FinalLogType = {
|
||||
provider : string,
|
||||
status : string,
|
||||
files_by_type : files_by_type,
|
||||
specialities_id : number,
|
||||
dppj: string
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ export default function Detail() {
|
||||
const navigate = useNavigate();
|
||||
const { themeStretch } = useSettings();
|
||||
const [requestLog, setRequestLog] = useState<DetailRequestLogType>();
|
||||
|
||||
|
||||
|
||||
const { id } = useParams();
|
||||
|
||||
@@ -70,9 +70,9 @@ export default function Detail() {
|
||||
const handleCloseDialogSubmit = () => {
|
||||
setOpenDialogSubmit(false);
|
||||
}
|
||||
|
||||
|
||||
const [approve, setApprove] = useState('')
|
||||
|
||||
|
||||
const [openDialogEdit, setOpenDialogEdit] = useState(false);
|
||||
return (
|
||||
<Page title='Detail'>
|
||||
@@ -84,7 +84,7 @@ export default function Detail() {
|
||||
<Grid container spacing={2}>
|
||||
<Grid item xs={12} md={12}>
|
||||
<Card sx={{padding:2}} >
|
||||
<Grid container spacing={2}>
|
||||
<Grid container spacing={2}>
|
||||
<Grid item xs={6}>
|
||||
<Typography variant='subtitle1' sx={{ color: '#19BBBB', marginBottom: 4 }} gutterBottom>
|
||||
Detail
|
||||
@@ -106,7 +106,7 @@ export default function Detail() {
|
||||
/>
|
||||
</Grid>
|
||||
) : null}
|
||||
|
||||
|
||||
</Grid>
|
||||
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Provider Name</Typography>
|
||||
@@ -157,6 +157,14 @@ export default function Detail() {
|
||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Penempatan Kamar</Typography>
|
||||
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.penempatan_kamar ? requestLog?.penempatan_kamar : '-'}</Typography>
|
||||
</Stack>
|
||||
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Spesialis</Typography>
|
||||
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.specialities_id ? requestLog?.specialities_id : '-'}</Typography>
|
||||
</Stack>
|
||||
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
||||
<Typography variant='subtitle2' sx={style1} gutterBottom>DPPJ</Typography>
|
||||
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.dppj ? requestLog?.dppj : '-'}</Typography>
|
||||
</Stack>
|
||||
</Card>
|
||||
</Grid>
|
||||
<Grid item xs={12} md={12} marginTop={2}>
|
||||
@@ -217,13 +225,13 @@ export default function Detail() {
|
||||
openDialog={openDialogSubmit}
|
||||
approve={approve}
|
||||
></DialogConfirmation>
|
||||
|
||||
|
||||
</Stack>
|
||||
</Grid>
|
||||
) : null}
|
||||
<Grid item xs={12} md={12}>
|
||||
<Stack direction="row" padding={4} sx={{ justifyContent: 'space-between' }}>
|
||||
<DialogEditInformation
|
||||
<DialogEditInformation
|
||||
setOpenDialog={setOpenDialogEdit}
|
||||
requestLog={requestLog}
|
||||
openDialog={openDialogEdit}
|
||||
@@ -231,7 +239,7 @@ export default function Detail() {
|
||||
</DialogEditInformation>
|
||||
</Stack>
|
||||
</Grid>
|
||||
|
||||
|
||||
</Grid>
|
||||
</Container>
|
||||
</Page>
|
||||
|
||||
@@ -57,7 +57,9 @@ export type DetailRequestLogType = {
|
||||
benefit : Benefit[],
|
||||
reason : string,
|
||||
type_of_member : string,
|
||||
corporate_id : number
|
||||
corporate_id : number,
|
||||
specialities_id : number,
|
||||
dppj: string
|
||||
}
|
||||
|
||||
export type Benefit = {
|
||||
|
||||
@@ -138,7 +138,9 @@
|
||||
"txtButtonClose": "Close",
|
||||
"txtLabelFailed": "Failed",
|
||||
"txtAttention": "Attention",
|
||||
"txtAttentionInfo": "There are pending orders that require approval."
|
||||
"txtAttentionInfo": "There are pending orders that require approval.",
|
||||
"txtDPPJ": "DPPJ",
|
||||
"txtSpecialist": "Specialist"
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -138,5 +138,7 @@
|
||||
"txtButtonClose": "Tutup",
|
||||
"txtLabelFailed": "Gagal Pengiriman",
|
||||
"txtAttention": "Perhatian",
|
||||
"txtAttentionInfo": "Terdapat pesanan pending mohon untuk segera di approve."
|
||||
"txtAttentionInfo": "Terdapat pesanan pending mohon untuk segera di approve.",
|
||||
"txtDPPJ": "DPPJ",
|
||||
"txtSpecialist": "Spesialis"
|
||||
}
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
import { LoadingButton } from '@mui/lab';
|
||||
import
|
||||
{
|
||||
import
|
||||
{
|
||||
Avatar,
|
||||
FormControl,
|
||||
InputLabel,
|
||||
Select,
|
||||
FormHelperText,
|
||||
MenuItem
|
||||
MenuItem
|
||||
} from '@mui/material';
|
||||
import { Card } from '@mui/material';
|
||||
import { Stack, Typography } from '@mui/material';
|
||||
import axios from '@/utils/axios';
|
||||
import { enqueueSnackbar } from 'notistack';
|
||||
import { useRef, useState, useContext, useEffect } from 'react';
|
||||
import React, { useRef, useState, useContext, useEffect } from 'react';
|
||||
import { makeFormData } from '@/utils/jsonToFormData';
|
||||
import { format } from 'date-fns';
|
||||
import { LanguageContext } from '@/contexts/LanguageContext';
|
||||
@@ -28,6 +28,7 @@ interface MemberType {
|
||||
services: any;
|
||||
providers:any;
|
||||
companies:any;
|
||||
specialities:any;
|
||||
}
|
||||
interface FormRequestClaimProps {
|
||||
member: MemberType;
|
||||
@@ -37,6 +38,8 @@ export default function FormRequestClaim({ member, handleSubmitSuccess }: FormRe
|
||||
const { localeData }: any = useContext(LanguageContext);
|
||||
const [serviceCode, setServiceCode] = useState<string>('');
|
||||
const [idProvider, setIdProvider] = useState<number>(0);
|
||||
const [idSpecialities, setIdSpecialities] = useState<number>(0);
|
||||
const [inputDppj, setInputDppj] = useState<string>('');
|
||||
//Submission date
|
||||
const [submissionDate, setSubmissionDate] = useState<string>(format(new Date(), "yyyy MMM d HH:mm:ss"));
|
||||
|
||||
@@ -47,7 +50,7 @@ export default function FormRequestClaim({ member, handleSubmitSuccess }: FormRe
|
||||
setCorporateIdPartner(member?.companies?.map((item: { id: any; name: any; }) => ({ value: item.id, label: item.name })));
|
||||
}, []);
|
||||
const [selectedCorporatID, setSelectedCorporateID] = useState<any>([]);
|
||||
|
||||
|
||||
const handleSelectChangePatner = (event:any, selectedOptions:any) => {
|
||||
const selectedValues = selectedOptions.map((option: { value: any; }) => option.value);
|
||||
setSelectedCorporateID(selectedValues);
|
||||
@@ -77,24 +80,26 @@ export default function FormRequestClaim({ member, handleSubmitSuccess }: FormRe
|
||||
organization_name : name,
|
||||
address_provider: alamat,
|
||||
submission_date: fPostFormat(submissionDate, 'yyyy-MM-dd HH:mm:ss'),
|
||||
corporate_id_partner: selectedCorporatID
|
||||
corporate_id_partner: selectedCorporatID,
|
||||
specialities_id: idSpecialities,
|
||||
dppj: inputDppj
|
||||
};
|
||||
axios
|
||||
.post('/request-log', formData)
|
||||
.then((response) => {
|
||||
if (response && response.data && response.data.meta) {
|
||||
setTimeout(() => {
|
||||
window.location.reload();
|
||||
}, 1500);
|
||||
// setTimeout(() => {
|
||||
// window.location.reload();
|
||||
// }, 1500);
|
||||
enqueueSnackbar(response.data.meta.message, { variant: 'success' });
|
||||
handleSubmitSuccess();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
.catch(({ response }) => {
|
||||
if (response && response.data && response.data.meta) {
|
||||
enqueueSnackbar(response.data.meta.message, { variant: 'error' });
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(() => {
|
||||
setSubmitLoading(false);
|
||||
@@ -111,6 +116,11 @@ export default function FormRequestClaim({ member, handleSubmitSuccess }: FormRe
|
||||
name: string;
|
||||
}
|
||||
|
||||
interface Specialities {
|
||||
id: number;
|
||||
name: string;
|
||||
}
|
||||
|
||||
const [showAddNewForm, setShowAddNewForm] = useState(false);
|
||||
const [name, setName] = useState('');
|
||||
const [alamat, setAlamat] = useState('');
|
||||
@@ -191,7 +201,7 @@ export default function FormRequestClaim({ member, handleSubmitSuccess }: FormRe
|
||||
<FormHelperText style={{ color: 'red' }}></FormHelperText>
|
||||
</Stack>
|
||||
</Stack>
|
||||
|
||||
|
||||
<Stack direction="row" spacing={2}>
|
||||
<Stack spacing={2} sx={{ width: '100%' }}>
|
||||
<Typography variant='subtitle1'>{localeData.txtDialogMember1} *</Typography>
|
||||
@@ -215,6 +225,45 @@ export default function FormRequestClaim({ member, handleSubmitSuccess }: FormRe
|
||||
</Stack>
|
||||
</Stack>
|
||||
|
||||
{/* Specialist */}
|
||||
<Stack direction="row" spacing={2}>
|
||||
<Stack spacing={2} sx={{ width: '100%' }}>
|
||||
<Typography variant='subtitle1'>{localeData.txtSpecialist}</Typography>
|
||||
<Autocomplete
|
||||
id='specialities'
|
||||
options={member?.specialities || []}
|
||||
getOptionLabel={(option: Specialities) => option.name || ''}
|
||||
value={member?.specialities.find((item: Specialities) => item.id === idSpecialities) || null}
|
||||
onChange={(event: React.ChangeEvent<{}>, newValue : Specialities | null) => {
|
||||
setIdSpecialities(newValue?.id || 0);
|
||||
}}
|
||||
renderInput={(params) => (
|
||||
<TextField
|
||||
{...params}
|
||||
label={localeData.txtSpecialist}
|
||||
fullWidth
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
<FormHelperText style={{ color: 'red' }}></FormHelperText>
|
||||
</Stack>
|
||||
</Stack>
|
||||
|
||||
<Stack direction="row" spacing={2}>
|
||||
<Stack spacing={2} sx={{ width: '100%' }}>
|
||||
<Typography variant='subtitle1'>{ localeData.txtDPPJ }</Typography>
|
||||
<TextField
|
||||
id='dppj'
|
||||
variant='outlined'
|
||||
placeholder={ localeData.txtDPPJ }
|
||||
onChange={(event) => {
|
||||
setInputDppj(event.target.value);
|
||||
}}
|
||||
fullWidth
|
||||
/>
|
||||
</Stack>
|
||||
</Stack>
|
||||
|
||||
<Stack direction="row" spacing={2}>
|
||||
<Stack spacing={2} sx={{ width: '100%' }}>
|
||||
<Typography variant='subtitle1'>{localeData.txtDialogMember5} *</Typography>
|
||||
@@ -226,7 +275,7 @@ export default function FormRequestClaim({ member, handleSubmitSuccess }: FormRe
|
||||
setSubmissionDate( (newValue));
|
||||
}}
|
||||
inputFormat="dd-MM-yyyy HH:mm"
|
||||
renderInput={(params) => <TextField sx={{width:'40%'}} {...params} required/>}
|
||||
renderInput={(params) => <TextField sx={{width:'45%'}} {...params} required/>}
|
||||
/>
|
||||
</LocalizationProvider>
|
||||
</Stack>
|
||||
|
||||
Reference in New Issue
Block a user