2 lines
7.3 KiB
JavaScript
2 lines
7.3 KiB
JavaScript
import{g as O,a as W,s as A,b as E,_ as $,r,u as q,e as U,H as G,K as V,T as x,j as e,h as _,f as h,i as Y,aP as T,aQ as z,aR as K,Z as H,aS as Q,n as X,a1 as M,aT as R,S as j,I as Z,q as J,Y as ee,a0 as te,a2 as N,a4 as ae}from"./index.225b3434.js";import{P as re}from"./Page.ca87850d.js";import{H as se}from"./HeaderBreadcrumbs.8438820f.js";import{f as oe}from"./formatTime.102fc2f1.js";import{G as m}from"./Grid.5bf85f86.js";import{T as le}from"./TextField.609a8f9c.js";import{I as ne}from"./InputAdornment.77fd4574.js";import{S as ie}from"./Search.1e728f3a.js";import{L as ce}from"./LoadingButton.597d96e3.js";import{L as me,l as w}from"./LinearProgress.c06d1136.js";import{C as de}from"./Card.95cb6642.js";import{C as pe}from"./Checkbox.3da17a6c.js";import{S as ue}from"./Stack.6951b0ec.js";import"./index.49ea62c1.js";import"./useId.ea638843.js";import"./generateUtilityClasses.06032f54.js";import"./SwitchBase.cb47962b.js";function he(s){return W("MuiFormControlLabel",s)}const fe=O("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error"]),D=fe,ge=["checked","className","componentsProps","control","disabled","disableTypography","inputRef","label","labelPlacement","name","onChange","slotProps","value"],be=s=>{const{classes:a,disabled:i,labelPlacement:l,error:n}=s,f={root:["root",i&&"disabled",`labelPlacement${E(l)}`,n&&"error"],label:["label",i&&"disabled"]};return Y(f,he,a)},xe=A("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(s,a)=>{const{ownerState:i}=s;return[{[`& .${D.label}`]:a.label},a.root,a[`labelPlacement${E(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=q({props:a,name:"MuiFormControlLabel"}),{className:f,componentsProps:c={},control:o,disabled:g,disableTypography:C,label:P,labelPlacement:v="end",slotProps:S={}}=n,k=U(n,ge),b=G();let d=g;typeof d>"u"&&typeof o.props.disabled<"u"&&(d=o.props.disabled),typeof d>"u"&&b&&(d=b.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=V({props:n,muiFormControl:b,states:["error"]}),u=$({},n,{disabled:d,labelPlacement:v,error:p.error}),y=be(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 B(s=T){const a=s===T?z:K(s);return function(){const{store:l}=a();return l}}const ye=B();function Pe(s=T){const a=s===T?ye:B(s);return function(){return a().dispatch}}const ve=Pe();A(me)(({theme:s})=>({height:10,borderRadius:6,[`&.${w.colorPrimary}`]:{backgroundColor:"#D1F1F1"},[`& .${w.bar}`]:{borderRadius:6,backgroundColor:"#54D62C"}}));function Le({title:s,openDialog:a,setOpenDialog:i}){const{corporateValue:l}=r.exports.useContext(H),[n,f]=r.exports.useState([]),c=ve(),o=Q(t=>t.claims.data);r.exports.useState({id:0,fullName:"",memberId:"",limit:{current:0,total:0,percentage:0}});const g=X(),[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))},b=(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 M.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=>b(t,u.target.checked)}),label:"",labelPlacement:"end",sx:{marginLeft:"20px"}})})}),e("div",{style:{position:"relative",flex:"none",height:"fit-content",margin:"15px"},children:e("img",{width:52,height:52,src:"/images/user-profile.png",alt:"user-profile",style:{borderRadius:"50%"}})}),h(m,{item:!0,xs:11,lg:11,xl:11,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(Z,{disabled:o.length>0,sx:{marginLeft:"10px"},onClick:()=>{c(R.patch([t])),g(`/claim-request/${t.id}`)},children:e(J,{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:()=>g("/claim-request/bulk"),children:"Claim Submit Selected"})})]})}function We(){const{themeStretch:s}=ee(),{corporateValue:a}=r.exports.useContext(H),[i,l]=r.exports.useState([]);r.exports.useState([]);const[n,f]=r.exports.useState(!0),[c,o]=te(),[g,C]=r.exports.useState({});r.exports.useState();const[P,v]=r.exports.useState("asc"),[S,k]=r.exports.useState("fullName"),b=new Date,d=oe(b);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 M.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(g).length!==0?g:Object.fromEntries([...c.entries()]);o(p),f(!1)})()},[g,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{We as default};
|