[WIP] Store Limit
This commit is contained in:
@@ -47,6 +47,7 @@
|
||||
"@mui/lab": "5.0.0-alpha.80",
|
||||
"@mui/material": "^5.10.2",
|
||||
"@mui/system": "^5.10.2",
|
||||
"@mui/utils": "^5.10.16",
|
||||
"@mui/x-data-grid": "^5.16.0",
|
||||
"@mui/x-date-pickers": "5.0.0-beta.2",
|
||||
"@vitejs/plugin-react": "^1.3.2",
|
||||
|
||||
62
frontend/client-portal/pnpm-lock.yaml
generated
62
frontend/client-portal/pnpm-lock.yaml
generated
@@ -15,6 +15,7 @@ specifiers:
|
||||
'@mui/lab': 5.0.0-alpha.80
|
||||
'@mui/material': ^5.10.2
|
||||
'@mui/system': ^5.10.2
|
||||
'@mui/utils': ^5.10.16
|
||||
'@mui/x-data-grid': ^5.16.0
|
||||
'@mui/x-date-pickers': 5.0.0-beta.2
|
||||
'@types/lodash': ^4.14.184
|
||||
@@ -85,6 +86,7 @@ dependencies:
|
||||
'@mui/lab': 5.0.0-alpha.80_vli2fzedtzvbon5ke6iprktoka
|
||||
'@mui/material': 5.10.2_mm2isjkwxtdnw3xlwl5r7b6ile
|
||||
'@mui/system': 5.10.2_ynexvg6j2j66sbh5giu7mkkh7u
|
||||
'@mui/utils': 5.10.16_react@17.0.2
|
||||
'@mui/x-data-grid': 5.16.0_r4jqxufjb3aftjrjm24vhpn4hm
|
||||
'@mui/x-date-pickers': 5.0.0-beta.2_y3fv7pzpxqpbmxcbzsros3kjnu
|
||||
'@vitejs/plugin-react': 1.3.2
|
||||
@@ -1455,14 +1457,20 @@ packages:
|
||||
engines: {node: '>=6.9.0'}
|
||||
dependencies:
|
||||
core-js-pure: 3.25.0
|
||||
regenerator-runtime: 0.13.9
|
||||
regenerator-runtime: 0.13.11
|
||||
dev: true
|
||||
|
||||
/@babel/runtime/7.18.9:
|
||||
resolution: {integrity: sha512-lkqXDcvlFT5rvEjiu6+QYO+1GXrEHRo2LOtS7E4GtX5ESIZOgepqsZBVIj6Pv+a6zqsya9VCgiK1KAK4BvJDAw==}
|
||||
engines: {node: '>=6.9.0'}
|
||||
dependencies:
|
||||
regenerator-runtime: 0.13.9
|
||||
regenerator-runtime: 0.13.11
|
||||
|
||||
/@babel/runtime/7.20.6:
|
||||
resolution: {integrity: sha512-Q+8MqP7TiHMWzSfwiJwXCjyf4GYA4Dgw3emg/7xmwsdLJOZUp+nMqcOwOzzYheuM1rhDu8FSj2l0aoMygEuXuA==}
|
||||
engines: {node: '>=6.9.0'}
|
||||
dependencies:
|
||||
regenerator-runtime: 0.13.11
|
||||
|
||||
/@babel/template/7.18.10:
|
||||
resolution: {integrity: sha512-TI+rCtooWHr3QJ27kJxfjutghu44DLnasDMwpDqCXVTal9RLp3RSYNh4NdBrRP2cQAoG9A8juOQl6P6oZG4JxA==}
|
||||
@@ -1554,7 +1562,7 @@ packages:
|
||||
'@babel/core': 7.18.13
|
||||
'@babel/helper-module-imports': 7.18.6
|
||||
'@babel/plugin-syntax-jsx': 7.18.6_@babel+core@7.18.13
|
||||
'@babel/runtime': 7.18.9
|
||||
'@babel/runtime': 7.20.6
|
||||
'@emotion/hash': 0.9.0
|
||||
'@emotion/memoize': 0.8.0
|
||||
'@emotion/serialize': 1.1.0
|
||||
@@ -1838,10 +1846,10 @@ packages:
|
||||
'@types/react':
|
||||
optional: true
|
||||
dependencies:
|
||||
'@babel/runtime': 7.18.9
|
||||
'@babel/runtime': 7.20.6
|
||||
'@emotion/is-prop-valid': 1.2.0
|
||||
'@mui/types': 7.1.5_@types+react@17.0.48
|
||||
'@mui/utils': 5.9.3_react@17.0.2
|
||||
'@mui/utils': 5.10.16_react@17.0.2
|
||||
'@popperjs/core': 2.11.6
|
||||
'@types/react': 17.0.48
|
||||
clsx: 1.2.1
|
||||
@@ -1862,10 +1870,10 @@ packages:
|
||||
'@types/react':
|
||||
optional: true
|
||||
dependencies:
|
||||
'@babel/runtime': 7.18.9
|
||||
'@babel/runtime': 7.20.6
|
||||
'@emotion/is-prop-valid': 1.2.0
|
||||
'@mui/types': 7.1.5_@types+react@17.0.48
|
||||
'@mui/utils': 5.9.3_react@17.0.2
|
||||
'@mui/utils': 5.10.16_react@17.0.2
|
||||
'@popperjs/core': 2.11.6
|
||||
'@types/react': 17.0.48
|
||||
clsx: 1.2.1
|
||||
@@ -1924,7 +1932,7 @@ packages:
|
||||
'@mui/base': 5.0.0-alpha.79_sk3eihvpffgp52mstba5zhq3vu
|
||||
'@mui/material': 5.10.2_mm2isjkwxtdnw3xlwl5r7b6ile
|
||||
'@mui/system': 5.10.2_ynexvg6j2j66sbh5giu7mkkh7u
|
||||
'@mui/utils': 5.9.3_react@17.0.2
|
||||
'@mui/utils': 5.10.16_react@17.0.2
|
||||
'@mui/x-date-pickers': 5.0.0-alpha.0_ktjudfp74mtqzmc2e56ri5vvri
|
||||
'@types/react': 17.0.48
|
||||
clsx: 1.2.1
|
||||
@@ -1964,7 +1972,7 @@ packages:
|
||||
'@mui/core-downloads-tracker': 5.10.2
|
||||
'@mui/system': 5.10.2_ynexvg6j2j66sbh5giu7mkkh7u
|
||||
'@mui/types': 7.1.5_@types+react@17.0.48
|
||||
'@mui/utils': 5.9.3_react@17.0.2
|
||||
'@mui/utils': 5.10.16_react@17.0.2
|
||||
'@types/react': 17.0.48
|
||||
'@types/react-transition-group': 4.4.5
|
||||
clsx: 1.2.1
|
||||
@@ -1986,8 +1994,8 @@ packages:
|
||||
'@types/react':
|
||||
optional: true
|
||||
dependencies:
|
||||
'@babel/runtime': 7.18.9
|
||||
'@mui/utils': 5.9.3_react@17.0.2
|
||||
'@babel/runtime': 7.20.6
|
||||
'@mui/utils': 5.10.16_react@17.0.2
|
||||
'@types/react': 17.0.48
|
||||
prop-types: 15.8.1
|
||||
react: 17.0.2
|
||||
@@ -2006,7 +2014,7 @@ packages:
|
||||
'@emotion/styled':
|
||||
optional: true
|
||||
dependencies:
|
||||
'@babel/runtime': 7.18.9
|
||||
'@babel/runtime': 7.20.6
|
||||
'@emotion/cache': 11.10.3
|
||||
'@emotion/react': 11.10.0_u65opluo5sjgh3eblfliq6jsnm
|
||||
'@emotion/styled': 11.10.0_mpqqkyoc5j3vv2sg2f5vubqi7u
|
||||
@@ -2037,7 +2045,7 @@ packages:
|
||||
'@mui/private-theming': 5.9.3_skqlhrap4das3cz5b6iqdn2lqi
|
||||
'@mui/styled-engine': 5.10.2_2av45khroaevmcc27aulpaf2sy
|
||||
'@mui/types': 7.1.5_@types+react@17.0.48
|
||||
'@mui/utils': 5.9.3_react@17.0.2
|
||||
'@mui/utils': 5.10.16_react@17.0.2
|
||||
'@types/react': 17.0.48
|
||||
clsx: 1.2.1
|
||||
csstype: 3.1.0
|
||||
@@ -2056,13 +2064,13 @@ packages:
|
||||
'@types/react': 17.0.48
|
||||
dev: false
|
||||
|
||||
/@mui/utils/5.9.3_react@17.0.2:
|
||||
resolution: {integrity: sha512-l0N5bcrenE9hnwZ/jPecpIRqsDFHkPXoFUcmkgysaJwVZzJ3yQkGXB47eqmXX5yyGrSc6HksbbqXEaUya+siew==}
|
||||
/@mui/utils/5.10.16_react@17.0.2:
|
||||
resolution: {integrity: sha512-3MB/SGsgiiu9Z55CFmAfiONUoR7AAue/H4F6w3mc2LnhFQCsoVvXhioDPcsiRpUMIQr34jDPzGXdCuqWooPCXQ==}
|
||||
engines: {node: '>=12.0.0'}
|
||||
peerDependencies:
|
||||
react: ^17.0.0 || ^18.0.0
|
||||
dependencies:
|
||||
'@babel/runtime': 7.18.9
|
||||
'@babel/runtime': 7.20.6
|
||||
'@types/prop-types': 15.7.5
|
||||
'@types/react-is': 17.0.3
|
||||
prop-types: 15.8.1
|
||||
@@ -2082,7 +2090,7 @@ packages:
|
||||
'@babel/runtime': 7.18.9
|
||||
'@mui/material': 5.10.2_mm2isjkwxtdnw3xlwl5r7b6ile
|
||||
'@mui/system': 5.10.2_ynexvg6j2j66sbh5giu7mkkh7u
|
||||
'@mui/utils': 5.9.3_react@17.0.2
|
||||
'@mui/utils': 5.10.16_react@17.0.2
|
||||
clsx: 1.2.1
|
||||
prop-types: 15.8.1
|
||||
react: 17.0.2
|
||||
@@ -2117,7 +2125,7 @@ packages:
|
||||
'@date-io/moment': 2.15.0
|
||||
'@mui/material': 5.10.2_mm2isjkwxtdnw3xlwl5r7b6ile
|
||||
'@mui/system': 5.10.2_ynexvg6j2j66sbh5giu7mkkh7u
|
||||
'@mui/utils': 5.9.3_react@17.0.2
|
||||
'@mui/utils': 5.10.16_react@17.0.2
|
||||
clsx: 1.2.1
|
||||
date-fns: 2.29.2
|
||||
prop-types: 15.8.1
|
||||
@@ -2165,7 +2173,7 @@ packages:
|
||||
'@emotion/styled': 11.10.0_mpqqkyoc5j3vv2sg2f5vubqi7u
|
||||
'@mui/material': 5.10.2_mm2isjkwxtdnw3xlwl5r7b6ile
|
||||
'@mui/system': 5.10.2_ynexvg6j2j66sbh5giu7mkkh7u
|
||||
'@mui/utils': 5.9.3_react@17.0.2
|
||||
'@mui/utils': 5.10.16_react@17.0.2
|
||||
'@types/react-transition-group': 4.4.5
|
||||
clsx: 1.2.1
|
||||
date-fns: 2.29.2
|
||||
@@ -2708,7 +2716,7 @@ packages:
|
||||
resolution: {integrity: sha512-o/HelwhuKpTj/frsOsbNLNgnNGVIFsVP/SW2BSF14gVl7kAfMOJ6/8wUAUvG1R1NHKrfG+2sHZTu0yauT1qBrA==}
|
||||
engines: {node: '>=6.0'}
|
||||
dependencies:
|
||||
'@babel/runtime': 7.18.9
|
||||
'@babel/runtime': 7.20.6
|
||||
'@babel/runtime-corejs3': 7.18.9
|
||||
dev: true
|
||||
|
||||
@@ -2798,7 +2806,7 @@ packages:
|
||||
resolution: {integrity: sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg==}
|
||||
engines: {node: '>=10', npm: '>=6'}
|
||||
dependencies:
|
||||
'@babel/runtime': 7.18.9
|
||||
'@babel/runtime': 7.20.6
|
||||
cosmiconfig: 7.0.1
|
||||
resolve: 1.22.1
|
||||
|
||||
@@ -3192,7 +3200,7 @@ packages:
|
||||
/dom-helpers/5.2.1:
|
||||
resolution: {integrity: sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==}
|
||||
dependencies:
|
||||
'@babel/runtime': 7.18.9
|
||||
'@babel/runtime': 7.20.6
|
||||
csstype: 3.1.0
|
||||
dev: false
|
||||
|
||||
@@ -5100,7 +5108,7 @@ packages:
|
||||
react: '>=16.6.0'
|
||||
react-dom: '>=16.6.0'
|
||||
dependencies:
|
||||
'@babel/runtime': 7.18.9
|
||||
'@babel/runtime': 7.20.6
|
||||
dom-helpers: 5.2.1
|
||||
loose-envify: 1.4.0
|
||||
prop-types: 15.8.1
|
||||
@@ -5127,13 +5135,13 @@ packages:
|
||||
resolution: {integrity: sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==}
|
||||
dev: true
|
||||
|
||||
/regenerator-runtime/0.13.9:
|
||||
resolution: {integrity: sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==}
|
||||
/regenerator-runtime/0.13.11:
|
||||
resolution: {integrity: sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==}
|
||||
|
||||
/regenerator-transform/0.15.0:
|
||||
resolution: {integrity: sha512-LsrGtPmbYg19bcPHwdtmXwbW+TqNvtY4riE3P83foeHRroMbH6/2ddFBfab3t7kbzc7v7p4wbkIecHImqt0QNg==}
|
||||
dependencies:
|
||||
'@babel/runtime': 7.18.9
|
||||
'@babel/runtime': 7.20.6
|
||||
dev: true
|
||||
|
||||
/regexp.prototype.flags/1.4.3:
|
||||
@@ -5846,7 +5854,7 @@ packages:
|
||||
'@apideck/better-ajv-errors': 0.3.6_ajv@8.11.0
|
||||
'@babel/core': 7.18.13
|
||||
'@babel/preset-env': 7.18.10_@babel+core@7.18.13
|
||||
'@babel/runtime': 7.18.9
|
||||
'@babel/runtime': 7.20.6
|
||||
'@rollup/plugin-babel': 5.3.1_2uin6pbxavst3oir53roxbd5qi
|
||||
'@rollup/plugin-node-resolve': 11.2.1_rollup@2.78.1
|
||||
'@rollup/plugin-replace': 2.4.2_rollup@2.78.1
|
||||
|
||||
@@ -251,7 +251,7 @@ export default function MemberSelectDialog({
|
||||
const getContent = () => (
|
||||
<Stack spacing={1} marginTop={2}>
|
||||
<form onSubmit={handleFilterSubmit}>
|
||||
<TextField label="Search" variant="outlined" fullWidth onChange={handleSearchChange} value={searchFilter.search}/>
|
||||
<TextField label="Search" variant="outlined" fullWidth onChange={handleSearchChange} value={searchFilter.search} autoFocus/>
|
||||
</form>
|
||||
<DataTable
|
||||
isLoading={dataTableLoading}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import * as Yup from 'yup';
|
||||
import { yupResolver } from '@hookform/resolvers/yup';
|
||||
import { Autocomplete, Button, Card, Collapse, Divider, Grid, Stack, TextField, Typography } from '@mui/material';
|
||||
import { Autocomplete, Button, Card, Collapse, Divider, Grid, Stack, Table, TableBody, TableCell, TableRow, TextField, Typography } from '@mui/material';
|
||||
import { Controller, useForm } from 'react-hook-form';
|
||||
import { useParams } from 'react-router-dom';
|
||||
import { useParams, useNavigate } from 'react-router-dom';
|
||||
import HeaderBreadcrumbs from '../../components/HeaderBreadcrumbs';
|
||||
import { FormProvider, RHFCheckbox, RHFSelect, RHFTextField } from '../../components/hook-form';
|
||||
import Page from '../../components/Page';
|
||||
@@ -13,22 +13,29 @@ import { styled } from '@mui/system';
|
||||
import axios from '../../utils/axios';
|
||||
import { enqueueSnackbar } from 'notistack';
|
||||
import { LoadingButton } from '@mui/lab';
|
||||
import { fCurrency } from '../../utils/formatNumber';
|
||||
import Iconify from '../../components/Iconify';
|
||||
|
||||
export default function ClaimsCreate() {
|
||||
const navigate = useNavigate();
|
||||
|
||||
export default function Create() {
|
||||
const [member, setMember] = useState();
|
||||
const selectedMemberDisplay = useRef<HTMLInputElement>(null);
|
||||
|
||||
const NewClaimSchema = Yup.object().shape({
|
||||
name: Yup.string().required('Name is required'),
|
||||
diagnosis_id: Yup.string().required('Diagnosis is required'),
|
||||
total_claim: Yup.string().required('Total Claim is required'),
|
||||
member_id: Yup.string().required('Please select Member'),
|
||||
total_claim: Yup.number().typeError('Claim should be a number').min(1, 'Claim cannot 0').required('Total Claim is required'),
|
||||
diagnosis: Yup.object().required('Choose Diagnosis'),
|
||||
benefit: Yup.object().required('Please Select Benefit')
|
||||
});
|
||||
|
||||
const defaultValues = useMemo(
|
||||
() => ({
|
||||
name: '',
|
||||
member_id: null,
|
||||
benefit_id: null,
|
||||
diagnosis_id: null,
|
||||
total_claim: 0,
|
||||
benefit: null
|
||||
}),
|
||||
[]
|
||||
);
|
||||
@@ -50,13 +57,41 @@ export default function Create() {
|
||||
} = methods;
|
||||
|
||||
const onSubmit = async (data: any) => {
|
||||
console.log(data);
|
||||
axios.post('claims', getValues())
|
||||
.then(function(res) {
|
||||
console.log('SUCCESS', res)
|
||||
enqueueSnackbar('Success Creating Claim', { variant: 'success' })
|
||||
navigate('/claims');
|
||||
})
|
||||
.catch(function (err) {
|
||||
console.log('ERROR CUK', err.data)
|
||||
enqueueSnackbar('Failed Creating Claim', { variant: 'error' })
|
||||
})
|
||||
};
|
||||
|
||||
const [memberBenefits, setMemberBenefits] = useState([]);
|
||||
const getMemberBenefits = (member) => {
|
||||
axios.get(`members/${member.id}/benefits`)
|
||||
.then( (res) => {
|
||||
setMemberBenefits(res.data);
|
||||
})
|
||||
.catch( (err) => {
|
||||
enqueueSnackbar('Failed getting member benefits', { variant: 'error' })
|
||||
})
|
||||
}
|
||||
|
||||
const [isMemberDialogOpen, setIsMemberDialogOpen] = useState(false);
|
||||
|
||||
const memberSelected = (selectedMember: any) => {
|
||||
// Reset Selected Benefit
|
||||
setMemberBenefits([]);
|
||||
setValue('benefit_id', null);
|
||||
setValue('benefit', null);
|
||||
|
||||
setMember(selectedMember);
|
||||
setValue('member_id', selectedMember.id)
|
||||
|
||||
getMemberBenefits(selectedMember)
|
||||
};
|
||||
|
||||
const [diagnosis, setDiagnosis] = useState([]);
|
||||
@@ -76,16 +111,12 @@ export default function Create() {
|
||||
|
||||
}, [])
|
||||
|
||||
const [isEligible, setIsEligible] = useState(false)
|
||||
|
||||
useEffect(() => {
|
||||
setIsEligible(false)
|
||||
console.log('member change')
|
||||
}, [member])
|
||||
const [isEligible, setIsEligible] = useState<boolean|null>(null)
|
||||
|
||||
const [isCheckingLimit, setIsCheckingLimit] = useState(false)
|
||||
const checkLimit = (event) => {
|
||||
event.preventDefault();
|
||||
|
||||
console.log(getValues('diagnosis_id'))
|
||||
if (!member || !getValues('diagnosis_id')) {
|
||||
enqueueSnackbar('Please Check the Data', { variant: 'error' })
|
||||
@@ -109,6 +140,10 @@ export default function Create() {
|
||||
setIsCheckingLimit(false)
|
||||
})
|
||||
}
|
||||
|
||||
const headStyle = {
|
||||
fontWeight: 'bold'
|
||||
};
|
||||
|
||||
return (
|
||||
<Page title="Create Claim" sx={{ mx: 2 }}>
|
||||
@@ -136,41 +171,115 @@ export default function Create() {
|
||||
<Typography variant="h6">Member</Typography>
|
||||
|
||||
<Stack spacing={2} direction="row">
|
||||
<Grid item xs={10}>
|
||||
<TextField
|
||||
<Grid item xs={12}>
|
||||
<RHFTextField
|
||||
name="member_id"
|
||||
label="Member"
|
||||
variant="outlined"
|
||||
fullWidth
|
||||
value={member?.name || ''}
|
||||
ref={selectedMemberDisplay}
|
||||
InputProps={{
|
||||
readOnly: true,
|
||||
}}
|
||||
readOnly: true,
|
||||
}}
|
||||
onClick={() => {setIsMemberDialogOpen(true)}}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item xs={2}>
|
||||
{/* <Grid item xs={2}>
|
||||
<Button variant="outlined" fullWidth sx={{ p: 1.8 }} onClick={() => {
|
||||
setIsMemberDialogOpen(true)
|
||||
}}>
|
||||
Search
|
||||
{member ? 'Change' : 'Search'}
|
||||
</Button>
|
||||
</Grid>
|
||||
</Grid> */}
|
||||
</Stack>
|
||||
|
||||
{ member && (
|
||||
<Stack>
|
||||
<div>
|
||||
Plan : {JSON.stringify(member)}
|
||||
</div>
|
||||
<div>
|
||||
Benefit :
|
||||
</div>
|
||||
<div>
|
||||
Another :
|
||||
</div>
|
||||
<Grid container spacing={2}>
|
||||
<Grid item xs={12} md={6}>
|
||||
<Table border="light-700">
|
||||
<TableBody>
|
||||
<TableRow>
|
||||
<TableCell style={headStyle} align="left">Name</TableCell>
|
||||
<TableCell align="left">{member.full_name}</TableCell>
|
||||
</TableRow>
|
||||
<TableRow>
|
||||
<TableCell style={headStyle} align="left">DOB</TableCell>
|
||||
<TableCell align="left">{member.birth_date} ({member.age + ' years'})</TableCell>
|
||||
</TableRow>
|
||||
<TableRow>
|
||||
<TableCell style={headStyle} align="left">Marital Status</TableCell>
|
||||
<TableCell align="left">{member.marital_status}</TableCell>
|
||||
</TableRow>
|
||||
<TableRow>
|
||||
<TableCell style={headStyle} align="left">Record Type</TableCell>
|
||||
<TableCell align="left">{member.record_type}</TableCell>
|
||||
</TableRow>
|
||||
<TableRow>
|
||||
<TableCell style={headStyle} align="left">Principal ID</TableCell>
|
||||
<TableCell align="left">{member.principal_id} ({member.relation_with_principal})</TableCell>
|
||||
</TableRow>
|
||||
</TableBody>
|
||||
</Table>
|
||||
</Grid>
|
||||
<Grid item xs={12} md={6}>
|
||||
<Table border="light-700">
|
||||
<TableBody>
|
||||
<TableRow>
|
||||
<TableCell style={headStyle} align="left">Plan</TableCell>
|
||||
<TableCell align="left">{member.current_plan.code}</TableCell>
|
||||
</TableRow>
|
||||
<TableRow>
|
||||
<TableCell style={headStyle} align="left">Active</TableCell>
|
||||
<TableCell align="left">{member.current_plan.start} - {member.current_plan.end} (Active)</TableCell>
|
||||
</TableRow>
|
||||
<TableRow>
|
||||
<TableCell style={headStyle} align="left">Corporate Limit</TableCell>
|
||||
<TableCell align="left">{fCurrency(0)} / {fCurrency(member.current_plan.limit_rules)}</TableCell>
|
||||
</TableRow>
|
||||
<TableRow>
|
||||
<TableCell style={headStyle} align="left">Plan Usage</TableCell>
|
||||
<TableCell align="left">{fCurrency(0)} / {fCurrency(member.current_plan.limit_rules)}</TableCell>
|
||||
</TableRow>
|
||||
</TableBody>
|
||||
</Table>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Stack>
|
||||
)}
|
||||
|
||||
|
||||
<Controller
|
||||
name="benefit"
|
||||
control={control}
|
||||
render={({ field: { onChange, value } }) => (
|
||||
<Autocomplete
|
||||
options={memberBenefits}
|
||||
getOptionLabel={(option) =>
|
||||
option ? `#${option.id} (${option.code}) ${option.description}` : ''
|
||||
}
|
||||
value={value || ''}
|
||||
onChange={(event: any, newValue: any) => {
|
||||
setValue('benefit_id', newValue?.id)
|
||||
onChange(newValue);
|
||||
}}
|
||||
renderInput={(params) => (
|
||||
<TextField
|
||||
// name="benefit"
|
||||
{...params}
|
||||
label="Benefit"
|
||||
variant="outlined"
|
||||
fullWidth
|
||||
// onKeyPress={(event) => {
|
||||
// if (event.key === 'Enter')
|
||||
// searchDiagnosis(event.target.value)
|
||||
// }}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
|
||||
<Controller
|
||||
name="diagnosis"
|
||||
control={control}
|
||||
@@ -183,16 +292,19 @@ export default function Create() {
|
||||
value={value || ''}
|
||||
onChange={(event: any, newValue: any) => {
|
||||
setValue('diagnosis_id', newValue?.id)
|
||||
// setValue('diagnosis', newValue)
|
||||
onChange(newValue);
|
||||
}}
|
||||
renderInput={(params) => (
|
||||
<TextField
|
||||
<RHFTextField
|
||||
name="diagnosis"
|
||||
{...params}
|
||||
label="Diagnosis"
|
||||
variant="outlined"
|
||||
fullWidth
|
||||
onChange={(event) => {
|
||||
searchDiagnosis(event.target.value)
|
||||
onKeyPress={(event) => {
|
||||
if (event.key === 'Enter')
|
||||
searchDiagnosis(event.target.value)
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
@@ -200,10 +312,86 @@ export default function Create() {
|
||||
)}
|
||||
/>
|
||||
|
||||
{ isCheckingLimit && (
|
||||
<Stack sx={{ backgroundColor: 'gray', paddingY: 1, paddingX: 1.5, mb: 2, borderRadius: '3-xl' }}>
|
||||
{/* Checking */}
|
||||
<Typography sx={{ typography: 'caption', display: 'flex', alignItems: 'center' }}>
|
||||
<Iconify
|
||||
icon="bxs:info-circle"
|
||||
width={12}
|
||||
height={13}
|
||||
sx={{ color: '#424242', marginRight: '6px' }}
|
||||
/>
|
||||
<Typography variant="caption" component="span">
|
||||
Please Wait, Checking Eligibilty
|
||||
</Typography>
|
||||
</Typography>
|
||||
</Stack>
|
||||
)}
|
||||
{ false && isCheckingLimit == false && isEligible == null && (
|
||||
<Stack sx={{ backgroundColor: 'gray', paddingY: 1, paddingX: 1.5, mb: 2, borderRadius: '3-xl' }}>
|
||||
{/* No Data Selected */}
|
||||
<Typography sx={{ typography: 'caption', display: 'flex', alignItems: 'center' }}>
|
||||
<Iconify
|
||||
icon="bxs:info-circle"
|
||||
width={12}
|
||||
height={13}
|
||||
sx={{ color: '#424242', marginRight: '6px' }}
|
||||
/>
|
||||
<Typography variant="caption" component="span">
|
||||
Please Select Diagnosis !
|
||||
</Typography>
|
||||
</Typography>
|
||||
</Stack>
|
||||
)}
|
||||
{ (!isCheckingLimit && isEligible !== null) && isEligible && (
|
||||
<Stack sx={{ backgroundColor: '#B2E8E8', paddingY: 1, paddingX: 1.5, mb: 2, borderRadius: '3-xl' }}>
|
||||
{/* Eligible */}
|
||||
<Typography sx={{ typography: 'caption', display: 'flex', alignItems: 'center' }}>
|
||||
<Iconify
|
||||
icon="bxs:lock-alt"
|
||||
width={12}
|
||||
height={13}
|
||||
sx={{ color: '#424242', marginRight: '6px' }}
|
||||
/>
|
||||
<Typography variant="caption" component="span">
|
||||
Diagnosis is Eligible
|
||||
</Typography>
|
||||
</Typography>
|
||||
<Typography sx={{ typography: 'caption', color: '#637381' }}>
|
||||
125.000.000 / 125.000.000
|
||||
</Typography>
|
||||
</Stack>
|
||||
)}
|
||||
{ (!isCheckingLimit && isEligible !== null) && !isEligible && (
|
||||
<Stack sx={{ backgroundColor: '#B2E8E8', paddingY: 1, paddingX: 1.5, mb: 2, borderRadius: '3-xl' }}>
|
||||
{/* Not Eligible */}
|
||||
<Typography sx={{ typography: 'caption', display: 'flex', alignItems: 'center' }}>
|
||||
<Iconify
|
||||
icon="bxs:lock-alt"
|
||||
width={12}
|
||||
height={13}
|
||||
sx={{ color: '#424242', marginRight: '6px' }}
|
||||
/>
|
||||
<Typography variant="caption" component="span">
|
||||
Not Eligible
|
||||
</Typography>
|
||||
</Typography>
|
||||
<Typography sx={{ typography: 'caption', color: '#637381' }}>
|
||||
125.000.000 / 125.000.000
|
||||
</Typography>
|
||||
</Stack>
|
||||
)}
|
||||
|
||||
|
||||
|
||||
<RHFTextField type="number" name="total_claim" label="Total Claim" />
|
||||
|
||||
<LoadingButton onClick={handleSubmit(onSubmit)} variant="contained" color="success" style={{color: '#ffffff'}} size="large" fullWidth={true} loading={isCheckingLimit}>
|
||||
Create Claim
|
||||
</LoadingButton>
|
||||
{ isEligible === true ? (
|
||||
<LoadingButton onClick={checkLimit} variant="contained" color="success" style={{color: '#ffffff'}} size="large" fullWidth={true} loading={isCheckingLimit}>
|
||||
<LoadingButton onClick={handleSubmit(onSubmit)} variant="contained" color="success" style={{color: '#ffffff'}} size="large" fullWidth={true} loading={isCheckingLimit}>
|
||||
Create Claim
|
||||
</LoadingButton>
|
||||
) : (
|
||||
|
||||
@@ -14,6 +14,7 @@ export default function Claims() {
|
||||
<HeaderBreadcrumbs
|
||||
heading={ pageTitle }
|
||||
links={[
|
||||
{ name: 'Dashboard', href: '/dashboard' },
|
||||
{
|
||||
name: 'Claim',
|
||||
href: '/claims',
|
||||
|
||||
@@ -176,10 +176,10 @@ export default function List() {
|
||||
</IconButton>
|
||||
</TableCell>
|
||||
<TableCell align="left">{row.code}</TableCell>
|
||||
<TableCell align="left">{row.member.full_name}</TableCell>
|
||||
<TableCell align="left">{row.plan.code}</TableCell>
|
||||
<TableCell align="left">{row.benefit.code}</TableCell>
|
||||
<TableCell align="left">({row.diagnosis.code}) {row.diagnosis.name}</TableCell>
|
||||
<TableCell align="left">{row.member?.full_name}</TableCell>
|
||||
<TableCell align="left">{row.plan?.code}</TableCell>
|
||||
<TableCell align="left">{row.benefit?.code}</TableCell>
|
||||
<TableCell align="left">({row.diagnosis?.code}) {row.diagnosis?.name}</TableCell>
|
||||
<TableCell align="left">{fCurrency(row.total_claim)}</TableCell>
|
||||
|
||||
{/* <TableCell align="right"><Button variant="outlined" color="error" size="small">Disable</Button></TableCell> */}
|
||||
|
||||
Reference in New Issue
Block a user