var O=Object.defineProperty,W=Object.defineProperties;var z=Object.getOwnPropertyDescriptors;var N=Object.getOwnPropertySymbols;var K=Object.prototype.hasOwnProperty,Q=Object.prototype.propertyIsEnumerable;var B=(n,t,a)=>t in n?O(n,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[t]=a,D=(n,t)=>{for(var a in t||(t={}))K.call(t,a)&&B(n,a,t[a]);if(N)for(var a of N(t))Q.call(t,a)&&B(n,a,t[a]);return n},R=(n,t)=>W(n,z(t));import{g as Z,d as ee,u as te,i,W as S,o as u,j as b,k as ae,c as r,b as o,a as I,e as d,w as k,n as oe,H as ne,J as Y,aN as le,aq as se,B as re,x as ie,F as q,f as p,t as $}from"./index.29cf2edd.js";/* empty css              *//* empty css              *//* empty css              *//* empty css              *//* empty css              */import{_ as ue}from"./StatusSelection.682823fe.js";import{_ as ce}from"./PurposeSelection.b97f97a6.js";import{_ as me}from"./BuyModeSelection.7846d63e.js";import{_ as de}from"./HospitalSelection.c3cfe7ce.js";/* empty css              *//* empty css              */import{_ as pe}from"./Status.120e28ab.js";import{f as P}from"./filters.69c883c5.js";import{R as _e}from"./ReportService.10f7d665.js";const ve={class:"filter-options"},fe=p("Search"),ye=p("Clear"),ke=p("Excel "),xe=ee({__name:"ClaimReport",setup(n){const t=[{title:"Claim ID",dataIndex:"id",key:"id"},{title:"Claim Date",dataIndex:"reqtime",key:"reqtime"},{title:"Claim To",dataIndex:"customer",key:"customer"},{title:"Certificate No",dataIndex:"certificateno",key:"certificateno"},{title:"Purpose",dataIndex:"type",key:"type"},{title:"Amount",dataIndex:"amount",key:"amount"},{title:"Claim Mode",dataIndex:"claim_mode",key:"claim_mode"},{title:"Claim By",dataIndex:"claim_by",key:"claim_by"},{title:"Hospital",dataIndex:"hospital",key:"hospital"},{title:"Status",dataIndex:"status",key:"status"}],a=te();let l=i();const s=i([]);let _=i(),v=i(),f=i(),y=i();const w=async()=>{if(!x.value&&!C.value)return oe.warn("Please choose report date");const e={fromdate:x.value,todate:C.value,hospital:_.value,buyMode:v.value,purpose:f.value,status:y.value};ne(),_e.getClaimReport(e).then(c=>{l.value=c.data,Y()}).catch(c=>{Y()})},E=e=>{y.value=e},H=e=>{_.value=e},V=e=>{v.value=e},A=e=>{f.value=e},F=()=>{l.value=[],s.value=[],_.value=void 0,v.value=void 0,f.value=void 0,y.value=void 0},L=()=>{const e=`ClaimReport.${x.value}.${C.value}.xlsx`;le(e,M.value)},x=S(()=>s.value[0]?s.value[0].format("YYYY-MM-DD"):null),C=S(()=>s.value[1]?s.value[1].format("YYYY-MM-DD"):null),M=S(()=>l&&l.value.length>0?l.value.map(e=>R(D({},e),{amount:Number(e.amount),reqtime:P.formatDate(e.reqtime)})):l.value);return(e,c)=>{const T=se,U=de,X=me,j=ce,G=ue,g=re,J=ie;return u(),b("div",null,[ae("div",ve,[r(T,{value:s.value,"onUpdate:value":c[0]||(c[0]=m=>s.value=m)},null,8,["value"]),["ADMIN","ACCOUNTING"].includes(o(a).role)?(u(),I(U,{key:0,value:o(_),onChange:H},null,8,["value"])):d("",!0),r(X,{value:o(v),onChange:V},null,8,["value"]),r(j,{value:o(f),onChange:A},null,8,["value"]),r(G,{value:o(y),onChange:E},null,8,["value"]),r(g,{onClick:w},{default:k(()=>[fe]),_:1}),r(g,{onClick:F},{default:k(()=>[ye]),_:1}),r(g,{disabled:!o(l)||o(l)&&o(l).length===0,type:"primary",onClick:L},{default:k(()=>[ke]),_:1},8,["disabled"])]),o(l)?(u(),I(J,{key:0,dataSource:o(M),columns:t,pagination:!1},{bodyCell:k(({column:m,text:Ce,record:h,index:ge})=>[m.key==="reqtime"?(u(),b(q,{key:0},[p($(h.reqtime),1)],64)):d("",!0),m.key==="amount"?(u(),b(q,{key:1},[p($(o(P).formatMoney(h.amount)),1)],64)):d("",!0),m.key==="status"?(u(),I(pe,{key:2,status:h.status},null,8,["status"])):d("",!0)]),_:1},8,["dataSource"])):d("",!0)])}}});var Ve=Z(xe,[["__scopeId","data-v-660b53da"]]);export{Ve as default};
