import{ref as b,resolveComponent as a,openBlock as m,createElementBlock as p,createVNode as t,withCtx as l,createTextVNode as C,unref as d,createElementVNode as n,Fragment as D,renderList as w,toDisplayString as f}from"vue";import{d as N,u as R,a as k}from"../server.mjs";import{a as B}from"./axios.65783c45.js";import"#internal/nitro";import"vue-router";const E=N({id:"slips",state:()=>({slip:{},details:{}}),getters:{showSlip(e){return e.slip},getClientName(e){return e.details.clientname},getSlipDate(e){return e.details.slipdate},getDetails(e){return e.details.slipmeta},getSlipCount(e){return e.details.availability},getInstructions(e){return e.details.description}},actions:{async getSlipDetails(e,c){try{const o=await B.get(`${c}/api/slip/id/${e}`);o&&(this.slip=o.data.data,this.details=o.data.data.attributes)}catch(o){console.log(o)}}}}),M={class:"d-flex align-center flex-column"},V=n("thead",null,[n("tr",null,[n("th",{class:"text-left"},"Medicine"),n("th",{class:"text-left"},"Quantity"),n("th",{class:"text-left"},"Details")])],-1),A=n("br",null,null,-1),I=n("br",null,null,-1),T={__name:"[searchid]",setup(e){b("");const c=R(),{searchid:o}=k().params,i=E();return i.getSlipDetails(o,c.CMS_BASE_URL),(L,U)=>{const g=a("v-card-title"),_=a("v-text-field"),s=a("v-col"),u=a("v-row"),v=a("v-divider"),h=a("v-table"),x=a("v-textarea"),S=a("v-card-text"),y=a("v-card");return m(),p("div",M,[t(y,{width:"800"},{default:l(()=>[t(g,null,{default:l(()=>[C("Medical Slip")]),_:1}),t(S,null,{default:l(()=>[t(u,{justify:"end"},{default:l(()=>[t(s,{cols:"12",sm:"6"},{default:l(()=>[t(_,{label:"Date",readonly:"","model-value":d(i).getSlipDate},null,8,["model-value"])]),_:1}),t(s,{cols:"12",sm:"6"},{default:l(()=>[t(_,{label:"Usage Count",readonly:"","model-value":d(i).getSlipCount,outlined:""},null,8,["model-value"])]),_:1})]),_:1}),t(u,null,{default:l(()=>[t(s,{cols:"12"},{default:l(()=>[t(_,{label:"Client","model-value":d(i).getClientName,readonly:""},null,8,["model-value"])]),_:1}),t(v)]),_:1}),t(u,null,{default:l(()=>[t(s,null,{default:l(()=>[t(h,null,{default:l(()=>[V,n("tbody",null,[(m(!0),p(D,null,w(d(i).getDetails,r=>(m(),p("tr",{key:r.medicinename},[n("td",null,f(r.medicinename),1),n("td",null,f(r.quantity),1),n("td",null,f(r.details),1)]))),128))])]),_:1}),A,I]),_:1}),t(v)]),_:1}),t(u,null,{default:l(()=>[t(s,null,{default:l(()=>[t(x,{label:"Additional Details","model-value":d(i).getInstructions},null,8,["model-value"])]),_:1})]),_:1})]),_:1})]),_:1})])}}};export{T as default};
//# sourceMappingURL=_searchid_.c9524b8f.js.map
