update penambahan specialist dan dppj di request final log
This commit is contained in:
@@ -86,7 +86,8 @@ export default function DialogFinalLog({ member, getData, onClose, handleSubmitS
|
||||
|
||||
// --------------------------------------------------------------
|
||||
// Submit Form
|
||||
|
||||
const [idSpecialities, setIdSpecialities] = useState(member.specialities_id);
|
||||
const [inputDppj, setInputDppj] = useState(member.dppj);
|
||||
const [submitLoading, setSubmitLoading] = useState(false);
|
||||
function submitRequestFinalLog() {
|
||||
if(dischargeDate == '')
|
||||
@@ -102,6 +103,8 @@ export default function DialogFinalLog({ member, getData, onClose, handleSubmitS
|
||||
kondisi_files: fileKondisis,
|
||||
discharge_date: fPostFormat(dischargeDate, 'yyyy-MM-dd HH:mm:ss'),
|
||||
service_code: serviceCode,
|
||||
spescialis_id: idSpecialities,
|
||||
dppj: inputDppj,
|
||||
});
|
||||
axios
|
||||
.post('/request-final-log', formData)
|
||||
@@ -121,6 +124,9 @@ export default function DialogFinalLog({ member, getData, onClose, handleSubmitS
|
||||
const [serviceOptions, setServiceOptions] = useState([
|
||||
{ value: '-', label: '-' }
|
||||
]);
|
||||
const [specialisOptions, setSpecialisOptions] = useState([
|
||||
{ value: '-', label: '-' }
|
||||
]);
|
||||
|
||||
useEffect(() => {
|
||||
axios.get('service-member/'+member.member_id)
|
||||
@@ -129,6 +135,13 @@ export default function DialogFinalLog({ member, getData, onClose, handleSubmitS
|
||||
}).catch((error) => {
|
||||
console.error('Error fetching ICD options:', error);
|
||||
});
|
||||
|
||||
axios.get('specialis')
|
||||
.then((response) => {
|
||||
setSpecialisOptions(response.data);
|
||||
}).catch((error) => {
|
||||
console.error('Error fetching ICD options:', error);
|
||||
});
|
||||
|
||||
}, []);
|
||||
|
||||
@@ -365,7 +378,7 @@ export default function DialogFinalLog({ member, getData, onClose, handleSubmitS
|
||||
id="service_type"
|
||||
options={serviceOptions}
|
||||
getOptionLabel={(option) => option.label || ""}
|
||||
value={serviceOptions.find((opt) => opt.value == member.service_code) || null}
|
||||
value={serviceOptions.find((opt) => opt.value == serviceCode) || null}
|
||||
onChange={(event, newValue) => {
|
||||
setServiceCode(newValue?.value || "");
|
||||
}}
|
||||
@@ -377,6 +390,42 @@ export default function DialogFinalLog({ member, getData, onClose, handleSubmitS
|
||||
</Stack>
|
||||
</Stack>
|
||||
|
||||
{/* Specialist */}
|
||||
<Stack direction="row" spacing={2}>
|
||||
<Stack spacing={2} sx={{ width: '100%' }}>
|
||||
<Typography variant='subtitle1'>{localeData.txtSpecialist}</Typography>
|
||||
<Autocomplete
|
||||
id='specialities'
|
||||
options={specialisOptions}
|
||||
getOptionLabel={(option) => option.label || ''}
|
||||
value={specialisOptions.find((opt) => opt.value === idSpecialities) || null}
|
||||
onChange={(event, newValue) => {
|
||||
setIdSpecialities(newValue?.value || 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'
|
||||
value={inputDppj}
|
||||
placeholder={ localeData.txtDPPJ }
|
||||
onChange={(event) => {
|
||||
setInputDppj(event.target.value);
|
||||
}}
|
||||
fullWidth
|
||||
/>
|
||||
</Stack>
|
||||
</Stack>
|
||||
|
||||
|
||||
|
||||
<LoadingButton
|
||||
|
||||
@@ -355,6 +355,8 @@ export default function TableList() {
|
||||
submission_date:any,
|
||||
service_code:any,
|
||||
member_id:any,
|
||||
specialities_id:any,
|
||||
dppj:any,
|
||||
)
|
||||
{
|
||||
setOpenDialogFinalLog(true);
|
||||
@@ -365,6 +367,8 @@ export default function TableList() {
|
||||
'submission_date' : submission_date,
|
||||
'service_code' : service_code,
|
||||
'member_id' : member_id,
|
||||
'specialities_id' : specialities_id,
|
||||
'dppj' : dppj,
|
||||
};
|
||||
setDataViewFinalDialog(datas_view);
|
||||
}
|
||||
@@ -436,7 +440,16 @@ export default function TableList() {
|
||||
</MenuItem>
|
||||
):''}
|
||||
{obj.final_log === 0 && obj.status === 'approved' ? (
|
||||
<MenuItem onClick={() => handleRequestFinalLog(obj.id, obj.full_name, obj.no_polis, obj.submission_date, obj.service_code, obj.member_id) }>
|
||||
<MenuItem onClick={() => handleRequestFinalLog(
|
||||
obj.id,
|
||||
obj.full_name,
|
||||
obj.no_polis,
|
||||
obj.submission_date,
|
||||
obj.service_code,
|
||||
obj.member_id,
|
||||
obj.specialities_id,
|
||||
obj.dppj,
|
||||
) }>
|
||||
<Iconify icon="fa:file-text" />
|
||||
Request Final LOG
|
||||
</MenuItem>
|
||||
|
||||
Reference in New Issue
Block a user