var j=Object.defineProperty;var D=Object.getOwnPropertySymbols;var z=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable;var I=(u,a,i)=>a in u?j(u,a,{enumerable:!0,configurable:!0,writable:!0,value:i}):u[a]=i,M=(u,a)=>{for(var i in a||(a={}))z.call(a,i)&&I(u,i,a[i]);if(D)for(var i of D(a))E.call(a,i)&&I(u,i,a[i]);return u};import{d as J,u as O,i as d,q as W,H as G,J as S,n as K,W as Q,o as n,j as p,c as m,w as x,b as s,U as X,x as Z,v as ee,a as b,e as _,F as h,f,t as g,k as te,r as ae,m as ie,aq as oe,B as le}from"./index.29cf2edd.js";/* empty css              *//* empty css              *//* empty css              *//* empty css              *//* empty css              *//* empty css              *//* empty css              *//* empty css              */import{C as se}from"./CovidService.5364de46.js";import{_ as ne}from"./Status.120e28ab.js";import{f as N,h as $}from"./filters.69c883c5.js";import{_ as ue}from"./HospitalSelection.c3cfe7ce.js";import{_ as me}from"./BuyModeSelection.7846d63e.js";import{_ as re}from"./StatusSelection.682823fe.js";import{_ as ce}from"./PurposeSelection.b97f97a6.js";const de=f("Clear"),pe={key:6},_e=["onClick"],we=J({__name:"ClaimList",setup(u){let a=[{title:"Claim ID",dataIndex:"id",key:"id"},{title:"Claim Date",dataIndex:"reqtime",key:"reqtime"},{title:"Certificate No",dataIndex:"no",key:"certificateno"},{title:"Hospital",dataIndex:"hospital_id",key:"hospital_id"},{title:"Claim Via",dataIndex:"claim_mode",key:"claim_mode"},{title:"Purpose",dataIndex:"type",key:"type"},{title:"Amount",dataIndex:"amount",key:"amount"},{title:"Claim To",key:"claimto"},{title:"Status",dataIndex:"status",key:"status"},{title:"Actions",dataIndex:"action",key:"action"}];const i=O();i.role!=="ADMIN"&&(a=a.filter(e=>!["hospital_id"].includes(e.dataIndex)));const r=d([]),Y=d();let c=d(),v=d(),y=d(),k=d(),C=d();W(async()=>{G(),se.getClaims().then(e=>{Y.value=e.data.map(t=>M({},t)),S()}).catch(e=>{S(),K.error(e.message)})});const q=Q(()=>{let e=Y.value;return v.value&&(e=e.filter(t=>t.hospital_id===v.value)),y.value&&(e=e.filter(t=>t.claim_mode===y.value)),k.value&&(e=e.filter(t=>t.type===k.value)),C.value&&(e=e.filter(t=>t.status===C.value)),c.value&&(e=e.filter(t=>t.id.toString().indexOf(c.value)!==-1)),r.value[0]&&r.value[1]&&(e=e.filter(t=>$(t.reqtime).format("YYYYMMDD")>=r.value[0].format("YYYYMMDD")&&$(t.reqtime).format("YYYYMMDD")<=r.value[1].format("YYYYMMDD"))),e}),B=e=>{ae.push(`/covid/claim/detail/${e}`)},V=e=>{C.value=e},A=e=>{v.value=e},w=e=>{y.value=e},H=e=>{k.value=e},L=()=>{c.value=void 0,r.value=[],v.value=void 0,y.value=void 0,C.value=void 0,k.value=void 0};return(e,t)=>{const P=ie,R=oe,U=le,F=X,T=Z;return n(),p("div",null,[m(F,{size:8,style:{"margin-bottom":"8px"}},{default:x(()=>[m(P,{value:s(c),"onUpdate:value":t[0]||(t[0]=o=>ee(c)?c.value=o:c=o),placeholder:"Certificate No, Customer"},null,8,["value"]),m(R,{value:r.value,"onUpdate:value":t[1]||(t[1]=o=>r.value=o)},null,8,["value"]),s(i).role==="ADMIN"?(n(),b(ue,{key:0,value:s(v),onChange:A},null,8,["value"])):_("",!0),m(me,{value:s(y),onChange:w},null,8,["value"]),m(ce,{value:s(k),onChange:H},null,8,["value"]),m(re,{value:s(C),onChange:V},null,8,["value"]),m(U,{style:{"margin-right":"12px"},onClick:L},{default:x(()=>[de]),_:1})]),_:1}),m(T,{dataSource:s(q),columns:s(a)},{bodyCell:x(({column:o,text:fe,record:l,index:ve})=>[o.key==="certificateno"?(n(),p(h,{key:0},[f(g(l.certificate.no),1)],64)):_("",!0),o.key==="hospital_id"?(n(),p(h,{key:1},[f(g(l.hospital_id?`${l.hospital.name}`:"N/A"),1)],64)):_("",!0),o.key==="reqtime"?(n(),p(h,{key:2},[f(g(s(N).formatDate(l.reqtime)),1)],64)):_("",!0),o.key==="amount"?(n(),p(h,{key:3},[f(g(s(N).formatMoney(l.amount)),1)],64)):_("",!0),o.key==="claimto"?(n(),p(h,{key:4},[f(g(l.certificatemember?`${l.certificatemember.firstname} ${l.certificatemember.lastname}`:l.certificatemember_id),1)],64)):_("",!0),o.key==="status"?(n(),b(ne,{key:5,status:l.status},null,8,["status"])):o.key==="action"?(n(),p("span",pe,[te("a",{onClick:ye=>B(l.id)},"View",8,_e)])):_("",!0)]),_:1},8,["dataSource","columns"])])}}});export{we as default};
