tambah form edit tom
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import MuiDialog from "@/components/MuiDialog";
|
||||
import { Autocomplete, Button, Card, DialogActions, Grid, TextField, Typography } from "@mui/material";
|
||||
import { Autocomplete, Button, Card, DialogActions, Grid, MenuItem, Select, TextField, Typography } from "@mui/material";
|
||||
import { Stack } from '@mui/material';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { DetailFinalLogType } from "../Model/Types";
|
||||
@@ -25,9 +25,12 @@ export default function DialogConfirmation({requestLog, setOpenDialog, openDialo
|
||||
id: requestLog?.id,
|
||||
status: approve || '',
|
||||
catatan: '',
|
||||
type_of_member: '' ,
|
||||
icdCodes: requestLog?.diagnosis.length ? requestLog.diagnosis.map(diagnosis => ({ value: diagnosis.id, label: diagnosis.name })) : []
|
||||
});
|
||||
|
||||
const [error, setError] = useState(false);
|
||||
|
||||
const [icdOptions, setIcdOptions] = useState([
|
||||
{ value: '-', label: '-' }
|
||||
]);
|
||||
@@ -69,20 +72,26 @@ export default function DialogConfirmation({requestLog, setOpenDialog, openDialo
|
||||
}
|
||||
|
||||
const handleSubmit = () => {
|
||||
axios
|
||||
.post(`customer-service/request/final-log`, formData)
|
||||
.then((response) => {
|
||||
enqueueSnackbar('Verification Request LOG Success', { variant: 'success' });
|
||||
setOpenDialog(false);
|
||||
if (requestLog?.service_type === 'Inpatient') {
|
||||
navigate('/case_management/inpatient_monitoring');
|
||||
} else {
|
||||
navigate('/custormer-service/final-log');
|
||||
}
|
||||
})
|
||||
.catch(({ response }) => {
|
||||
enqueueSnackbar(response.data.message ?? 'Something went wrong!', { variant: 'error' });
|
||||
});
|
||||
if (formData.type_of_member === "" && requestLog?.corporate_id === 5) { // corporate vale
|
||||
setError(true);
|
||||
alert('Silakan pilih Type Of Member sebelum mengirimkan data.');
|
||||
}
|
||||
else {
|
||||
axios
|
||||
.post(`customer-service/request/final-log`, formData)
|
||||
.then((response) => {
|
||||
enqueueSnackbar('Verification Request LOG Success', { variant: 'success' });
|
||||
setOpenDialog(false);
|
||||
if (requestLog?.service_type === 'Inpatient') {
|
||||
navigate('/case_management/inpatient_monitoring');
|
||||
} else {
|
||||
navigate('/custormer-service/final-log');
|
||||
}
|
||||
})
|
||||
.catch(({ response }) => {
|
||||
enqueueSnackbar(response.data.message ?? 'Something went wrong!', { variant: 'error' });
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const style1 = {
|
||||
@@ -179,6 +188,24 @@ export default function DialogConfirmation({requestLog, setOpenDialog, openDialo
|
||||
)}
|
||||
/>
|
||||
</Stack>
|
||||
<Stack direction='row' spacing={2} sx={marginBottom2}>
|
||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Type Of Member*</Typography>
|
||||
<Select
|
||||
fullWidth
|
||||
value={formData.type_of_member}
|
||||
onChange={(e) => handleChange('type_of_member', e.target.value)}
|
||||
variant="outlined"
|
||||
displayEmpty
|
||||
required
|
||||
error={error}
|
||||
>
|
||||
<MenuItem value="" disabled>
|
||||
Type Member
|
||||
</MenuItem>
|
||||
<MenuItem value="OMT">OMT</MenuItem>
|
||||
<MenuItem value="Non OMT">Non OMT</MenuItem>
|
||||
</Select>
|
||||
</Stack>
|
||||
</Card>
|
||||
</Grid>
|
||||
<DialogActions>
|
||||
|
||||
Reference in New Issue
Block a user