import{d as V,h as $,p as D,i as r,q as E,r as k,s as x,o as s,j as l,k as p,c as f,b as o,I as z,t as y,v as K,l as P,a as C,e as c,w as F,n as L,m as R,x as j,F as g,f as w}from"./index.29cf2edd.js";/* empty css              *//* empty css              *//* empty css              *//* empty css              *//* empty css              */import{C as q}from"./CovidService.5364de46.js";import{S as A}from"./Spin.ce9c3cec.js";import{_ as M}from"./Status.120e28ab.js";import{f as O}from"./filters.69c883c5.js";/* empty css              */const T={style:{width:"100%"}},U={style:{margin:"0 auto","text-align":"center","margin-top":"0"}},G={style:{"font-size":"18pt","margin-top":"12px"}},H={key:0,style:{"margin-top":"20px"}},J={key:3},Q=["onClick"],pe=V({__name:"SearchDetail",setup(W){const{t:S,d:X,n:Y}=$({inheritLocale:!0}),I=[{title:"Certificate No.",dataIndex:"no",key:"no"},{title:"Phone",dataIndex:"phone",key:"phone"},{title:"E-mail",dataIndex:"email",key:"email"},{title:"Customer",dataIndex:"customer",key:"customer"},{title:"Placed Date",dataIndex:"createdtime",key:"createdtime"},{title:"Status",dataIndex:"status",key:"status"},{title:"Action",key:"action"}],_=D();r();const u=r(!1);let e=r(),n=r(),d=r();E(async()=>{e.value=_.params.search,e&&(n.value=e.value,await h())});const b=async()=>{if(!e.value)return L.warning("Please enter the value");e.value=n.value,await h()},h=async()=>{u.value=!0,q.findCertificates(e.value).then(t=>{u.value=!1,d.value=t.data,t.data.length===1&&k.push(`/covid/order/view/${d.value[0].no}`)}).catch(t=>{u.value=!1})},v=async t=>k.push(`/covid/order/view/${t}`);return x(()=>e.value,async()=>{e.value}),x(()=>_.params.search,async(t,m)=>{}),(t,m)=>{const B=R,N=j;return s(),l("div",T,[p("div",U,[f(o(z),{style:{"font-size":"60px",color:"#0C6B3B"}}),p("h1",G,y(o(S)("info_check")),1),f(B,{placeholder:"Enter Certificate Number, ...",size:"large",style:{width:"260px","border-radius":"50px","text-align":"center"},value:o(n),"onUpdate:value":m[0]||(m[0]=a=>K(n)?n.value=a:n=a),onKeydown:P(b,["enter"])},null,8,["value","onKeydown"]),u.value?(s(),C(A,{key:0})):c("",!0)]),o(d)?(s(),l("div",H,[f(N,{dataSource:o(d),columns:I,pagination:!1,onClick:v},{bodyCell:F(({column:a,text:Z,record:i,index:ee})=>[a.key==="customer"?(s(),l(g,{key:0},[w(y(`${i.firstname} ${i.lastname}`),1)],64)):c("",!0),a.key==="createdtime"?(s(),l(g,{key:1},[w(y(o(O).formatDate(i.createdtime)),1)],64)):c("",!0),a.key==="status"?(s(),C(M,{key:2,status:i.status},null,8,["status"])):a.key==="action"?(s(),l("span",J,[p("a",{onClick:te=>v(i.no)},"View",8,Q)])):c("",!0)]),_:1},8,["dataSource"])])):c("",!0)])}}});export{pe as default};
