penyesuiaan data claim
This commit is contained in:
@@ -36,7 +36,7 @@ class ClaimRequestController extends Controller
|
|||||||
->when($request->status, function($q, $status) {
|
->when($request->status, function($q, $status) {
|
||||||
$q->where('status', $status);
|
$q->where('status', $status);
|
||||||
})
|
})
|
||||||
->with(['member', 'files', 'service'])
|
->with(['member', 'files', 'service', 'member.currentPolicy'])
|
||||||
->paginate();
|
->paginate();
|
||||||
|
|
||||||
return Helper::paginateResources(ClaimRequestResource::collection($claimRequests));
|
return Helper::paginateResources(ClaimRequestResource::collection($claimRequests));
|
||||||
|
|||||||
@@ -10,12 +10,15 @@ import { ProgressBarStyle } from './components/ProgressBar';
|
|||||||
import ThemeColorPresets from './components/ThemeColorPresets';
|
import ThemeColorPresets from './components/ThemeColorPresets';
|
||||||
import MotionLazyContainer from './components/animate/MotionLazyContainer';
|
import MotionLazyContainer from './components/animate/MotionLazyContainer';
|
||||||
import { SnackbarProvider } from 'notistack';
|
import { SnackbarProvider } from 'notistack';
|
||||||
|
import { Provider } from 'react-redux';
|
||||||
|
import store from "./store"
|
||||||
|
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
|
||||||
export default function App() {
|
export default function App() {
|
||||||
return (
|
return (
|
||||||
<ThemeProvider>
|
<Provider store={store}>
|
||||||
|
<ThemeProvider>
|
||||||
<SnackbarProvider>
|
<SnackbarProvider>
|
||||||
<ThemeColorPresets>
|
<ThemeColorPresets>
|
||||||
<RtlLayout>
|
<RtlLayout>
|
||||||
@@ -29,5 +32,6 @@ export default function App() {
|
|||||||
</ThemeColorPresets>
|
</ThemeColorPresets>
|
||||||
</SnackbarProvider>
|
</SnackbarProvider>
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
|
</Provider>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -192,7 +192,7 @@ export default function List() {
|
|||||||
</Typography>
|
</Typography>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell align="left">{row.member?.full_name}</TableCell>
|
<TableCell align="left">{row.member?.full_name}</TableCell>
|
||||||
<TableCell align="left">{row.member?.full_name}</TableCell>
|
<TableCell align="left">{row.member?.current_policy?.code}</TableCell>
|
||||||
<TableCell align="left">{row.submission_date}</TableCell>
|
<TableCell align="left">{row.submission_date}</TableCell>
|
||||||
<TableCell align="left">{row.service_name}</TableCell>
|
<TableCell align="left">{row.service_name}</TableCell>
|
||||||
<TableCell align="left">{row.payment_type_name}</TableCell>
|
<TableCell align="left">{row.payment_type_name}</TableCell>
|
||||||
|
|||||||
@@ -174,6 +174,7 @@ export default function List() {
|
|||||||
</IconButton>
|
</IconButton>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell align="left">{row.code}</TableCell>
|
<TableCell align="left">{row.code}</TableCell>
|
||||||
|
<TableCell align="left">{row.claim_request?.code}</TableCell>
|
||||||
<TableCell align="left">{row.member?.full_name}</TableCell>
|
<TableCell align="left">{row.member?.full_name}</TableCell>
|
||||||
<TableCell align="left">{row.plan?.code}</TableCell>
|
<TableCell align="left">{row.plan?.code}</TableCell>
|
||||||
<TableCell align="left">{row.claim_request?.service?.name}</TableCell>
|
<TableCell align="left">{row.claim_request?.service?.name}</TableCell>
|
||||||
@@ -231,7 +232,10 @@ export default function List() {
|
|||||||
<TableRow>
|
<TableRow>
|
||||||
<TableCell style={headStyle} align="left" />
|
<TableCell style={headStyle} align="left" />
|
||||||
<TableCell style={headStyle} align="left">
|
<TableCell style={headStyle} align="left">
|
||||||
Code
|
Code Request
|
||||||
|
</TableCell>
|
||||||
|
<TableCell style={headStyle} align="left">
|
||||||
|
Code Claim
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell style={headStyle} align="left">
|
<TableCell style={headStyle} align="left">
|
||||||
Member Name
|
Member Name
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ import ClaimDetail from './components/ClaimDetail';
|
|||||||
import DialogHistoryPerawatan from './components/DialogHistoryPerawatan';
|
import DialogHistoryPerawatan from './components/DialogHistoryPerawatan';
|
||||||
import { IconButton } from '@mui/material';
|
import { IconButton } from '@mui/material';
|
||||||
import { Tooltip } from '@mui/material';
|
import { Tooltip } from '@mui/material';
|
||||||
|
import { useSelector } from 'react-redux';
|
||||||
|
|
||||||
export default function ClaimsCreateUpdate() {
|
export default function ClaimsCreateUpdate() {
|
||||||
const { themeStretch } = useSettings();
|
const { themeStretch } = useSettings();
|
||||||
@@ -48,6 +49,10 @@ export default function ClaimsCreateUpdate() {
|
|||||||
const [currentClaim, setCurrentClaim] = useState();
|
const [currentClaim, setCurrentClaim] = useState();
|
||||||
const [documents, setDocuments] = useState([]);
|
const [documents, setDocuments] = useState([]);
|
||||||
|
|
||||||
|
const claimsHistoryData = useSelector((state) => state.claimsHistory)
|
||||||
|
|
||||||
|
console.log(claimsHistoryData)
|
||||||
|
|
||||||
const Item = styled(Paper)(({ theme }) => ({
|
const Item = styled(Paper)(({ theme }) => ({
|
||||||
backgroundColor: theme.palette.mode === 'dark' ? '#1A2027' : '#fff',
|
backgroundColor: theme.palette.mode === 'dark' ? '#1A2027' : '#fff',
|
||||||
...theme.typography.body2,
|
...theme.typography.body2,
|
||||||
@@ -66,6 +71,12 @@ export default function ClaimsCreateUpdate() {
|
|||||||
setClaimItems([...claimItems, ...items]);
|
setClaimItems([...claimItems, ...items]);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if(claimsHistoryData) {
|
||||||
|
setClaimItems(claimsHistoryData)
|
||||||
|
}
|
||||||
|
},[claimsHistoryData])
|
||||||
|
|
||||||
const handleSaveClaimItems = () => {
|
const handleSaveClaimItems = () => {
|
||||||
console.log('Storing ', claimItems);
|
console.log('Storing ', claimItems);
|
||||||
setLoadingClaimItems(true);
|
setLoadingClaimItems(true);
|
||||||
@@ -305,6 +316,9 @@ export default function ClaimsCreateUpdate() {
|
|||||||
</LoadingButton>
|
</LoadingButton>
|
||||||
)}
|
)}
|
||||||
</Stack>
|
</Stack>
|
||||||
|
<Stack direction="row" justifyContent="space-between" alignItems="center">
|
||||||
|
<Typography>Admission Date : {currentClaim?.claim_request?.submission_date}</Typography>
|
||||||
|
</Stack>
|
||||||
</Paper>
|
</Paper>
|
||||||
|
|
||||||
<Box sx={{ flexGrow: 1 }}>
|
<Box sx={{ flexGrow: 1 }}>
|
||||||
@@ -347,7 +361,7 @@ export default function ClaimsCreateUpdate() {
|
|||||||
<Typography variant="body2" fontWeight={600}>
|
<Typography variant="body2" fontWeight={600}>
|
||||||
Nomor Polis
|
Nomor Polis
|
||||||
</Typography>
|
</Typography>
|
||||||
<Typography variant="body2">{currentClaim?.member?.full_name}</Typography>
|
<Typography variant="body2">{currentClaim?.member?.current_policy?.code}</Typography>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<Grid item xs={12} md={6}>
|
<Grid item xs={12} md={6}>
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ import { Stack } from '@mui/material';
|
|||||||
import { enqueueSnackbar } from 'notistack';
|
import { enqueueSnackbar } from 'notistack';
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import FormHistoryPerawatan from './FormHistoryPerawatan';
|
import FormHistoryPerawatan from './FormHistoryPerawatan';
|
||||||
|
import { useDispatch } from 'react-redux';
|
||||||
|
import { claimsHistoryAction } from '@/store/claimsHistorySlice';
|
||||||
|
|
||||||
type DialogHistoryPerawatanType = {
|
type DialogHistoryPerawatanType = {
|
||||||
openDialog: boolean;
|
openDialog: boolean;
|
||||||
@@ -18,6 +20,7 @@ type DialogHistoryPerawatanType = {
|
|||||||
export default function DialogHistoryPerawatan({ openDialog, setOpenDialog, onSubmit, claim, encounter } : DialogHistoryPerawatanType) {
|
export default function DialogHistoryPerawatan({ openDialog, setOpenDialog, onSubmit, claim, encounter } : DialogHistoryPerawatanType) {
|
||||||
|
|
||||||
const isEdit = encounter?.id != null
|
const isEdit = encounter?.id != null
|
||||||
|
const dispatch = useDispatch()
|
||||||
// const benefits = member?.current_plan?.benefits ?? [];
|
// const benefits = member?.current_plan?.benefits ?? [];
|
||||||
// const [selectedBenefits, setSelectedBenefits] = useState([]);
|
// const [selectedBenefits, setSelectedBenefits] = useState([]);
|
||||||
|
|
||||||
@@ -38,6 +41,10 @@ export default function DialogHistoryPerawatan({ openDialog, setOpenDialog, onSu
|
|||||||
.then((res) => {
|
.then((res) => {
|
||||||
enqueueSnackbar(res.data.message, {variant: 'success'})
|
enqueueSnackbar(res.data.message, {variant: 'success'})
|
||||||
setOpenDialog(false);
|
setOpenDialog(false);
|
||||||
|
window.location.reload(); // tolong benerin ya
|
||||||
|
// axios.get(`claims/${claim.id}`).then((res) => {
|
||||||
|
// dispatch(claimsHistoryAction.setClaims(res.data.data.encounter))
|
||||||
|
// })
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
enqueueSnackbar(err.message, {variant: 'error'})
|
enqueueSnackbar(err.message, {variant: 'error'})
|
||||||
@@ -47,6 +54,10 @@ export default function DialogHistoryPerawatan({ openDialog, setOpenDialog, onSu
|
|||||||
.then((res) => {
|
.then((res) => {
|
||||||
enqueueSnackbar(res.data.message, {variant: 'success'})
|
enqueueSnackbar(res.data.message, {variant: 'success'})
|
||||||
setOpenDialog(false);
|
setOpenDialog(false);
|
||||||
|
window.location.reload(); // tolong benerin ya
|
||||||
|
// axios.get(`claims/${claim.id}`).then((res) => {
|
||||||
|
// dispatch(claimsHistoryAction.setClaims(res.data.data.encounter))
|
||||||
|
// })
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
enqueueSnackbar(err.message, {variant: 'error'})
|
enqueueSnackbar(err.message, {variant: 'error'})
|
||||||
|
|||||||
18
frontend/dashboard/src/store/claimsHistorySlice.ts
Normal file
18
frontend/dashboard/src/store/claimsHistorySlice.ts
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
import { createSlice } from "@reduxjs/toolkit";
|
||||||
|
|
||||||
|
const claimsHistory = createSlice({
|
||||||
|
name:'claims-history',
|
||||||
|
|
||||||
|
initialState:{
|
||||||
|
claimsHistory: []
|
||||||
|
},
|
||||||
|
reducers:{
|
||||||
|
setClaims(states, actions){
|
||||||
|
states.claimsHistory = actions.payload
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
export const claimsHistoryAction = claimsHistory.actions
|
||||||
|
|
||||||
|
export default claimsHistory.reducer
|
||||||
14
frontend/dashboard/src/store/index.ts
Normal file
14
frontend/dashboard/src/store/index.ts
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import { configureStore } from '@reduxjs/toolkit';
|
||||||
|
import claims from "./claimsHistorySlice"
|
||||||
|
|
||||||
|
const store = configureStore({
|
||||||
|
reducer: {
|
||||||
|
claimsHistory: claims
|
||||||
|
// auth: authReducer,
|
||||||
|
// nav: navReducer
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
export default store
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user