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