var G=Object.defineProperty,H=Object.defineProperties;var J=Object.getOwnPropertyDescriptors;var B=Object.getOwnPropertySymbols;var U=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable;var E=(o,a,e)=>a in o?G(o,a,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[a]=e,R=(o,a)=>{for(var e in a||(a={}))U.call(a,e)&&E(o,e,a[e]);if(B)for(var e of B(a))W.call(a,e)&&E(o,e,a[e]);return o},D=(o,a)=>H(o,J(a));import{g as z,d as K,u as O,i as r,W as x,o as _,j as g,k as Q,c as i,b as n,w as y,a as Z,e as k,H as ee,J as T,aN as te,aq as ae,B as oe,x as ne,F as Y,f as u,t as M}from"./index.29cf2edd.js";/* empty css              *//* empty css              *//* empty css              *//* empty css              *//* empty css              *//* empty css              *//* empty css              */import{f as L}from"./filters.69c883c5.js";import{_ as re}from"./BuyModeSelection.7846d63e.js";import{_ as ie}from"./BuyTypeSelection.f3739a5a.js";import{_ as le}from"./InsuranceSelection.053f358d.js";import{_ as se}from"./PackageSelection.ec5d16e2.js";import{R as ue}from"./ReportService.10f7d665.js";const ce={class:"filter-options"},de=u("Search"),pe=u("Clear"),me=u("Excel "),ve=K({__name:"CertificateExpiryReport",setup(o){const a=[{title:"Passport No",dataIndex:"passport",key:"passport"},{title:"First name",dataIndex:"firstname",key:"firstname"},{title:"Last name",dataIndex:"lastname",key:"lastname"},{title:"Gender",dataIndex:"gender",key:"gender"},{title:"Nationality",dataIndex:"nationality",key:"nationality"},{title:"Certificate No",dataIndex:"certificate_no",key:"certificate_no"},{title:"Buy Date",dataIndex:"createdtime",key:"createdtime"},{title:"Expiry At",dataIndex:"expirytime",key:"expirytime"}];O();let e=r();const l=r([]);let h=r(),c=r(),d=r(),p=r(),m=r(),C=r();const $=async()=>{const t={fromdate:b.value,todate:S.value,serviceLocation:h.value,buyType:c.value,buyMode:d.value,insuranceType:p.value,packageType:m.value,status:C.value};ee(),ue.getCertificateExpiryReport(t).then(s=>{e.value=s.data,T()}).catch(s=>{T()})},w=t=>{c.value=t},F=t=>{d.value=t},V=t=>{p.value=t},P=t=>{m.value=t},X=()=>{e.value=[],l.value=[],h.value=void 0,c.value=void 0,d.value=void 0,p.value=void 0,m.value=void 0,C.value=void 0},j=()=>{const t=`SaleReport.${b.value}.${S.value}.xlsx`;te(t,I.value)},b=x(()=>l.value[0]?l.value[0].format("YYYY-MM-DD"):null),S=x(()=>l.value[1]?l.value[1].format("YYYY-MM-DD"):null),I=x(()=>e&&e.value.length>0?e.value.map(t=>D(R({},t),{amount:Number(t.amount),expirytime:L.formatDob(t.expirytime),createdtime:L.formatDate(t.createdtime)})):e.value);return(t,s)=>{const q=ae,f=oe,A=ne;return _(),g("div",null,[Q("div",ce,[i(q,{value:l.value,"onUpdate:value":s[0]||(s[0]=v=>l.value=v),style:{"min-width":"200px"}},null,8,["value"]),i(ie,{value:n(c),onChange:w},null,8,["value"]),i(re,{value:n(d),onChange:F},null,8,["value"]),i(le,{value:n(p),onChange:V},null,8,["value"]),i(se,{value:n(m),onChange:P},null,8,["value"]),i(f,{onClick:$},{default:y(()=>[de]),_:1}),i(f,{onClick:X},{default:y(()=>[pe]),_:1}),i(f,{disabled:!n(e)||n(e)&&n(e).length===0,type:"primary",onClick:j},{default:y(()=>[me]),_:1},8,["disabled"])]),n(e)?(_(),Z(A,{key:0,dataSource:n(I),columns:a,pagination:!1},{bodyCell:y(({column:v,text:_e,record:N,index:ye})=>[v.key==="expirytime"?(_(),g(Y,{key:0},[u(M(N.expirytime),1)],64)):k("",!0),v.key==="createdtime"?(_(),g(Y,{key:1},[u(M(N.createdtime),1)],64)):k("",!0)]),_:1},8,["dataSource"])):k("",!0)])}}});var Ye=z(ve,[["__scopeId","data-v-602604d2"]]);export{Ye as default};
