Files
aso/public/client-portal/assets/Index.e38eb6a9.js
Linksehat Staging Server d125d1bb38 [Production] Build
2024-01-14 12:06:54 +07:00

2 lines
7.1 KiB
JavaScript

import{g as B,a as O,s as E,b as H,_ as $,r,u as U,e as q,H as V,K as G,T as x,j as e,h as _,f as h,i as Y,aS as T,aT as z,aU as K,Z as M,aV as X,n as Z,a0 as W,aW as R,S as j,I as J,q as Q,Y as ee,$ as te,a1 as N,a2 as ae}from"./index.4524613b.js";import{P as re}from"./Page.b1f38576.js";import{H as se}from"./HeaderBreadcrumbs.f593a2a7.js";import{f as oe}from"./formatTime.0646b9d0.js";import{G as m}from"./Grid.63392dc1.js";import{T as le}from"./TextField.489cf1ea.js";import{I as ne}from"./InputAdornment.c3b5c49a.js";import{S as ie}from"./Search.a632f4d1.js";import{L as ce}from"./LoadingButton.1d571e70.js";import{L as me,l as A}from"./LinearProgress.9a82ef9e.js";import{C as de}from"./Card.4734268d.js";import{C as pe}from"./Checkbox.e8ad52b3.js";import{S as ue}from"./Stack.2fe98e42.js";import"./index.49ea62c1.js";import"./useId.5c752e65.js";import"./generateUtilityClasses.06032f54.js";import"./SwitchBase.e250c68d.js";function he(s){return O("MuiFormControlLabel",s)}const fe=B("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error"]),D=fe,be=["checked","className","componentsProps","control","disabled","disableTypography","inputRef","label","labelPlacement","name","onChange","slotProps","value"],ge=s=>{const{classes:a,disabled:i,labelPlacement:l,error:n}=s,f={root:["root",i&&"disabled",`labelPlacement${H(l)}`,n&&"error"],label:["label",i&&"disabled"]};return Y(f,he,a)},xe=E("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(s,a)=>{const{ownerState:i}=s;return[{[`& .${D.label}`]:a.label},a.root,a[`labelPlacement${H(i.labelPlacement)}`]]}})(({theme:s,ownerState:a})=>$({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${D.disabled}`]:{cursor:"default"}},a.labelPlacement==="start"&&{flexDirection:"row-reverse",marginLeft:16,marginRight:-11},a.labelPlacement==="top"&&{flexDirection:"column-reverse",marginLeft:16},a.labelPlacement==="bottom"&&{flexDirection:"column",marginLeft:16},{[`& .${D.label}`]:{[`&.${D.disabled}`]:{color:(s.vars||s).palette.text.disabled}}})),Ce=r.exports.forwardRef(function(a,i){var l;const n=U({props:a,name:"MuiFormControlLabel"}),{className:f,componentsProps:c={},control:o,disabled:b,disableTypography:C,label:P,labelPlacement:v="end",slotProps:S={}}=n,k=q(n,be),g=V();let d=b;typeof d>"u"&&typeof o.props.disabled<"u"&&(d=o.props.disabled),typeof d>"u"&&g&&(d=g.disabled);const t={disabled:d};["checked","name","onChange","value","inputRef"].forEach(I=>{typeof o.props[I]>"u"&&typeof n[I]<"u"&&(t[I]=n[I])});const p=G({props:n,muiFormControl:g,states:["error"]}),u=$({},n,{disabled:d,labelPlacement:v,error:p.error}),y=ge(u),F=(l=S.typography)!=null?l:c.typography;let L=P;return L!=null&&L.type!==x&&!C&&(L=e(x,$({component:"span"},F,{className:_(y.label,F==null?void 0:F.className),children:L}))),h(xe,$({className:_(y.root,f),ownerState:u,ref:i},k,{children:[r.exports.cloneElement(o,t),L]}))}),Se=Ce;function w(s=T){const a=s===T?z:K(s);return function(){const{store:l}=a();return l}}const ye=w();function Pe(s=T){const a=s===T?ye:w(s);return function(){return a().dispatch}}const ve=Pe();E(me)(({theme:s})=>({height:10,borderRadius:6,[`&.${A.colorPrimary}`]:{backgroundColor:"#D1F1F1"},[`& .${A.bar}`]:{borderRadius:6,backgroundColor:"#54D62C"}}));function Le({title:s,openDialog:a,setOpenDialog:i}){const{corporateValue:l}=r.exports.useContext(M),[n,f]=r.exports.useState([]),c=ve(),o=X(t=>t.claims.data);r.exports.useState({id:0,fullName:"",memberId:"",limit:{current:0,total:0,percentage:0}});const b=Z(),[C,P]=r.exports.useState(""),[v,S]=r.exports.useState({}),k=async t=>{t.preventDefault(),S(C===""?{}:{search:C}),await new Promise(p=>setTimeout(p,500))},g=(t,p)=>{if(p)c(R.patch([...o,t]));else{let u=o.filter(y=>y.memberId!==t.memberId);c(R.patch(u))}};return r.exports.useEffect(()=>{(async()=>{if(a===!0){const t=await W.get(`${l}/members`,{params:{...v,type:"claim-submit"}});f(t.data.data)}})()},[l,a,v]),r.exports.useEffect(()=>{c(R.dispatch())},[c]),h(m,{container:!0,children:[h(m,{item:!0,xs:12,paddingX:"10px",paddingY:"20px",children:[e("form",{onSubmit:k,children:e(le,{id:"search-input",variant:"outlined",fullWidth:!0,onChange:t=>P(t==null?void 0:t.target.value),value:C,InputProps:{startAdornment:e(ne,{position:"start",children:e(ie,{})})},placeholder:"Search Name or Member ID... ",sx:{marginTop:2}})}),(()=>e(j,{children:e(j,{marginTop:2,spacing:1,children:n.map((t,p)=>e(de,{sx:{bgcolor:u=>o.some(y=>y.memberId===t.memberId)?u.palette.primary.lighter:u.palette.background.default},children:h(j,{direction:"row",alignItems:"center",children:[e(m,{item:!0,xs:1,lg:1,xl:1,children:e("form",{children:e(Se,{value:"end",control:e(pe,{onChange:u=>g(t,u.target.checked)}),label:"",labelPlacement:"end",sx:{marginLeft:"20px"}})})}),e("div",{}),h(m,{item:!0,xs:11,lg:11,xl:11,py:2,children:[e(x,{variant:"subtitle1",children:t.fullName}),e(x,{color:"#637381",variant:"body2",sx:{fontWeight:500},children:t.memberId})]}),e(m,{item:!0,xs:1,lg:1,xl:1,style:{display:"flex",justifyContent:"right",alignItems:"right"},children:e(J,{disabled:o.length>0,sx:{marginLeft:"10px"},onClick:()=>{c(R.patch([t])),b(`/claim-request/${t.id}`)},children:e(Q,{icon:"ic:round-chevron-right"})})})]})},p))})}))()]}),e(m,{item:!0,xs:12,children:e(ce,{variant:"contained",sx:{marginTop:2,p:2,margin:"10px"},fullWidth:!0,disabled:o.length===0,onClick:()=>b("/claim-request/bulk"),children:"Claim Submit Selected"})})]})}function Oe(){const{themeStretch:s}=ee(),{corporateValue:a}=r.exports.useContext(M),[i,l]=r.exports.useState([]);r.exports.useState([]);const[n,f]=r.exports.useState(!0),[c,o]=te(),[b,C]=r.exports.useState({});r.exports.useState();const[P,v]=r.exports.useState("asc"),[S,k]=r.exports.useState("fullName"),g=new Date,d=oe(g);return r.exports.useState(0),r.exports.useState(10),r.exports.useState({current_page:0,from:0,last_page:0,links:[],path:"",per_page:0,to:0,total:0}),r.exports.useEffect(()=>{(async()=>{f(!0);const t=await W.get(`${a}/claim-report/claim-status`);l([{name:"Requested",value:t.data.data.requesteds,color:N.dark.primary.dark},{name:"Approval",value:t.data.data.approveds,color:N.dark.warning.dark},{name:"Rejected",value:t.data.data.rejecteds,color:N.dark.error.dark}]);const p=Object.keys(b).length!==0?b:Object.fromEntries([...c.entries()]);o(p),f(!1)})()},[b,c,P,S,o,a]),h(re,{title:"Claim Reports",children:[e(se,{heading:"Claim Submit",links:[{name:"Case Management",href:"/dashboard"},{name:"Claim Submit",href:"/claim-submit"}]}),e(ae,{maxWidth:s?!1:"xl",children:h(m,{container:!0,spacing:2,children:[e(m,{item:!0,xs:12,lg:6,md:6,children:h(x,{variant:"h6",sx:{marginLeft:"10px"},children:[" ","Select Employee"]})}),e(m,{item:!0,xs:12,lg:6,md:6,sx:{display:"flex",justifyContent:"flex-end"},children:h(ue,{direction:"row",alignItems:"center",children:[e(x,{variant:"inherit",align:"right",sx:{marginRight:"10px"},children:"Submission Date"}),e(x,{variant:"subtitle1",align:"right",sx:{marginRight:"10px"},children:d})]})}),e(m,{item:!0,xs:12,lg:12,md:12,children:e(Le,{openDialog:!0,setOpenDialog:!1,title:{name:"te"}})})]})})]})}export{Oe as default};