Update service hospital dan prime center

This commit is contained in:
ivan-sim
2023-11-14 16:53:08 +07:00
parent c3b140d1f8
commit 8f77d8bec0
7 changed files with 107 additions and 65 deletions

View File

@@ -1327,7 +1327,7 @@ export default function Detail() {
</InputLabel>
<Select
id="service_type"
value={valServiceType}
value={valServiceType ? serviceTypeData?.[0].id : ''}
fullWidth
label="Service Type"
error={!!valServiceTypeError}
@@ -1335,6 +1335,7 @@ export default function Detail() {
setValServiceType(e.target.value);
setValServiceTypeError(e.target.value === '' ? 'This field is required' : '');
}}
disabled
>
{serviceTypeData?.map((item, index) => (

View File

@@ -69,7 +69,7 @@ export default function CardSearchMember(handleSubmitSuccess) {
.then((response) => {
setOpenDialogBenefit(true)
setCurrentMember(response.data.data)
setNameMember(response.data.data.name);
setNameMember(response.data.data.members.name);
})
.catch(({response}) => {
enqueueSnackbar(response.data.errors ? response.data.errors[0] : (response.data ? response.data.meta.message : 'Opps, Something went Wrong!'), {variant : "error"})

View File

@@ -43,8 +43,6 @@ export default function DialogMember(member, handleSubmitSuccess) {
function TabPanel(props) {
const { children, value, index, ...other } = props;
console.log('current', value)
return (
<div
role="tabpanel"
@@ -79,58 +77,58 @@ export default function DialogMember(member, handleSubmitSuccess) {
<Stack direction="column" spacing={2}>
<Stack direction="row" justifyContent="space-between">
<Typography sx={{width:'50%'}} variant="body2">Member ID</Typography>
<Typography sx={{width:'50%', fontWeight: 'bold'}} variant="body2">{ member?.member_id ?? '-'}</Typography>
<Typography sx={{width:'50%', fontWeight: 'bold'}} variant="body2">{ member?.members.member_id ?? '-'}</Typography>
</Stack>
<Stack direction="row" justifyContent="space-between">
<Typography sx={{width:'50%'}} variant="body2">Policy Number</Typography>
<Typography sx={{width:'50%', fontWeight: 'bold'}} variant="body2">{ member?.current_policy?.code ?? '-'}</Typography>
<Typography sx={{width:'50%', fontWeight: 'bold'}} variant="body2">{ member?.members.policy_id ?? '-'}</Typography>
</Stack>
<Stack direction="row" justifyContent="space-between">
<Typography sx={{width:'50%'}} variant="body2">NRIC</Typography>
<Typography sx={{width:'50%', fontWeight: 'bold'}} variant="body2">{member?.person?.nik ?? '-'}</Typography>
<Typography sx={{width:'50%', fontWeight: 'bold'}} variant="body2">{member?.members.nik ?? '-'}</Typography>
</Stack>
<Stack direction="row" justifyContent="space-between">
<Typography sx={{width:'50%'}} variant="body2">NIK</Typography>
<Typography sx={{width:'50%', fontWeight: 'bold'}} variant="body2">{member?.person?.nik ?? '-'}</Typography>
<Typography sx={{width:'50%', fontWeight: 'bold'}} variant="body2">{member?.members.nik ?? '-'}</Typography>
</Stack>
<Stack direction="row" justifyContent="space-between">
<Typography sx={{width:'50%'}} variant="body2">Email</Typography>
<Typography sx={{width:'50%', fontWeight: 'bold'}} variant="body2">{member?.email ?? '-'}</Typography>
<Typography sx={{width:'50%', fontWeight: 'bold'}} variant="body2">{member?.members.email ?? '-'}</Typography>
</Stack>
<Stack direction="row" justifyContent="space-between">
<Typography sx={{width:'50%'}} variant="body2">Date of Birth</Typography>
<Typography sx={{width:'50%', fontWeight: 'bold'}} variant="body2">{member?.birth_date ? format(new Date(member.birth_date), "d MMM yyyy") : '-'}</Typography>
<Typography sx={{width:'50%', fontWeight: 'bold'}} variant="body2">{member?.members.birth_date ? format(new Date(member.members.birth_date), "d MMM yyyy") : '-'}</Typography>
</Stack>
<Stack direction="row" justifyContent="space-between">
<Typography sx={{width:'50%'}} variant="body2">Gender</Typography>
<Typography sx={{width:'50%', fontWeight: 'bold'}} variant="body2">{member?.gender ?? '-'}</Typography>
<Typography sx={{width:'50%', fontWeight: 'bold'}} variant="body2">{member?.members.gender ?? '-'}</Typography>
</Stack>
<Stack direction="row" justifyContent="space-between">
<Typography sx={{width:'50%'}} variant="body2">Marital Status</Typography>
<Typography sx={{width:'50%', fontWeight: 'bold'}} variant="body2">{member?.marital_status ?? '-'}</Typography>
<Typography sx={{width:'50%', fontWeight: 'bold'}} variant="body2">{member?.members.marital_status ?? '-'}</Typography>
</Stack>
<Stack direction="row" justifyContent="space-between">
<Typography sx={{width:'50%'}} variant="body2">Language</Typography>
<Typography sx={{width:'50%', fontWeight: 'bold'}} variant="body2">{member?.language ?? '-'}</Typography>
<Typography sx={{width:'50%', fontWeight: 'bold'}} variant="body2">{member?.members.language ?? '-'}</Typography>
</Stack>
<Stack direction="row" justifyContent="space-between">
<Typography sx={{width:'50%'}} variant="body2">Race</Typography>
<Typography sx={{width:'50%', fontWeight: 'bold'}} variant="body2">{member?.race ?? '-'}</Typography>
<Typography sx={{width:'50%', fontWeight: 'bold'}} variant="body2">{member?.members.race ?? '-'}</Typography>
</Stack>
<Stack direction="row" justifyContent="space-between">
<Typography sx={{width:'50%'}} variant="body2">Relationship</Typography>
<Typography sx={{width:'50%', fontWeight: 'bold'}} variant="body2">{member?.relation_with_principal ?? '-'}</Typography>
<Typography sx={{width:'50%', fontWeight: 'bold'}} variant="body2">{member?.members.relation_with_principal != '' ? member?.members.relation_with_principal : '-'}</Typography>
</Stack>
</Stack>
</TabPanel>
<TabPanel value={currentTab} index={'benefit'}>
<Grid container spacing={2}>
{ member && member?.current_plan?.corporate_benefits?.map((corporateBenefit, index) => {return (
{ member && member?.benefits?.map((corporateBenefit, index) => {return (
<Grid item sm={6} key={index}>
<Card sx={{p: 2}}>
<Typography variant="body2" sx={{fontWeight: 'bold'}}>{corporateBenefit.benefit.description}</Typography>
<Typography variant="body2" sx={{color: '#919EAB'}}>{corporateBenefit.benefit.code}</Typography>
<Typography variant="body2" sx={{fontWeight: 'bold'}}>{corporateBenefit.description}</Typography>
<Typography variant="body2" sx={{color: '#919EAB'}}>{corporateBenefit.code}</Typography>
</Card>
</Grid>

View File

@@ -26,7 +26,7 @@ export default function FormRequestClaim({ member, handleSubmitSuccess }) {
},
}));
const [serviceCode, setServiceCode] = useState('IP');
const [serviceCode, setServiceCode] = useState('');
// ----------------------------------------------------------------------
// Files Diagnosa
@@ -96,9 +96,14 @@ export default function FormRequestClaim({ member, handleSubmitSuccess }) {
const [submitLoading, setSubmitLoading] = useState(false);
function submitRequest() {
if(serviceCode == '')
{
enqueueSnackbar('Please select services', { variant: 'error' });
return false;
}
setSubmitLoading(true);
const formData = makeFormData({
member_id: member.id,
member_id: member.members.id,
result_files: fileHasilPenunjangs,
diagnosa_files: fileDiagnosas,
kondisi_files: fileKondisis,
@@ -107,11 +112,11 @@ export default function FormRequestClaim({ member, handleSubmitSuccess }) {
axios
.post('/claim-requests', formData)
.then((response) => {
enqueueSnackbar(response.data.message ?? 'Berhasil membuat data', { variant: 'success' });
enqueueSnackbar(response.data.data.message ?? 'Berhasil membuat data', { variant: 'success' });
handleSubmitSuccess();
})
.catch(({ response }) => {
enqueueSnackbar(response.data.message ?? 'Something Went Wrong', { variant: 'error' });
enqueueSnackbar(response.data.data.message ?? 'Something Went Wrong', { variant: 'error' });
})
.then(() => {
setSubmitLoading(false);
@@ -127,26 +132,39 @@ export default function FormRequestClaim({ member, handleSubmitSuccess }) {
<Typography variant='body2' sx={{fontWeight:'bold'}}>{format(new Date(), "d MMM yyyy")}</Typography>
</Stack>
<Card sx={{ p: 1, background: '#f4f6f8', marginBottom: 2 }}>
<Stack direction="column" spacing={2} sx={{marginBottom: 2}}>
<Typography variant="body1" sx={{fontWeight:'bold'}}>
Services
</Typography>
<Card sx={{ p: 1, background: '#f4f6f8', marginBottom: 2 }}>
<Stack direction="row" spacing={2}>
{member && member?.services?.map((dataServices, index) => (
<Button
key={index}
sx={{padding: 2, width: '100%'}}
color="primary"
variant={serviceCode === dataServices.service_code ? 'outlined' : ''}
onClick={() => { setServiceCode(dataServices.service_code) }}
>
{dataServices.name}
</Button>
))}
</Stack>
</Card>
<Stack direction="row" spacing={2}>
<Button sx={{padding: 2, width: '100%'}} color="primary" variant={serviceCode == 'IP' ? 'outlined' : ''} onClick={() => {setServiceCode('IP')}}>Inpatient</Button>
<Button sx={{padding: 2, width: '100%'}} color="primary" variant={serviceCode == 'OP' ? 'outlined' : ''} onClick={() => {setServiceCode('OP')}}>Outpatient</Button>
</Stack>
</Card>
<Card sx={{ p: 1, background: '#f4f6f8', marginBottom: 2 }}>
<Card sx={{ p: 1, background: '#f4f6f8'}}>
<Stack direction="row">
<Avatar
src="https://minimal-assets-api.vercel.app/assets/images/avatars/avatar_5.jpg"
alt={member?.full_name ?? ''}
alt={member?.members.name ?? ''}
sx={{ marginTop: 1, width: 48, height: 48 }}
/>
<Stack sx={{ p: 1 }}>
<Typography variant="body2">{member?.full_name ?? ''}</Typography>
<Typography variant="body2" sx={{color:'#637381'}}>{member?.member_id ?? ''}</Typography>
<Typography variant="body2">{member?.members.name ?? ''}</Typography>
<Typography variant="body2" sx={{color:'#637381'}}>{member?.members.member_id ?? ''}</Typography>
</Stack>
</Stack>
</Card>
@@ -173,7 +191,7 @@ export default function FormRequestClaim({ member, handleSubmitSuccess }) {
<Stack
divider={<Divider orientation="horizontal" flexItem />}
spacing={4}
sx={{ marginY: 2 }}
sx={{ marginY: 2, marginBottom: 6 }}
>
{/* -------------------------------Upload Dokumen Kondisi------------------------------- */}
<Stack sx={{ marginTop: 2 }}>
@@ -226,7 +244,7 @@ export default function FormRequestClaim({ member, handleSubmitSuccess }) {
style={{ display: 'none' }}
multiple
onChange={handleKondisiInputChange}
accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel, text/plain, application/pdf"
accept="application/pdf"
/>
</ButtonBase>
</Stack>
@@ -287,7 +305,7 @@ export default function FormRequestClaim({ member, handleSubmitSuccess }) {
style={{ display: 'none' }}
multiple
onChange={handleDiagnosaInputChange}
accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel, text/plain, application/pdf"
accept="application/pdf"
/>
</ButtonBase>
</Stack>
@@ -348,7 +366,7 @@ export default function FormRequestClaim({ member, handleSubmitSuccess }) {
style={{ display: 'none' }}
multiple
onChange={handleResultInputChange}
accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel, text/plain, application/pdf"
accept="application/pdf"
/>
</ButtonBase>
</Stack>
@@ -362,7 +380,7 @@ export default function FormRequestClaim({ member, handleSubmitSuccess }) {
}}
loading={submitLoading}
>
LOG Request
Request LOG
</LoadingButton>
</Stack>
);