mirror of
https://github.com/beak-insights/felicity-lims.git
synced 2025-02-24 17:02:55 +08:00
1 line
7.1 KiB
JavaScript
1 line
7.1 KiB
JavaScript
import{d as O,a_ as J,P as K,r as _,D as U,C as Q,z as W,n as D,o as l,c as d,e as a,E as i,b as e,F as R,p as V,t as p,f as n,at as X,v as Y,g as Z,G as I,H as A,w as b,i as ee,au as E,y as te,x as se,q as oe,j as ae,_ as re,k as ne}from"./index-e48f6898.js";import{u as le}from"./shipment-1c724af2.js";const ie={class:""},de=e("hr",{class:"mt-4"},null,-1),ce={class:"flex justify-between items-center"},pe={action:"post",class:"p-1"},ue={class:"flex justify-start items-center mb-4"},me={class:"flex justify-between items-center"},he=e("span",{class:"text-gray-700 mr-2 whitespace-nowrap"},"Reference Laboratory",-1),ye=["value"],_e={class:"flex justify-between items-center ml-4"},be=e("span",{class:"text-gray-700 mr-2"},"Courier",-1),fe={class:"ml-6 mt-2"},ve=e("hr",{class:"mb-4"},null,-1),ge={class:"overflow-x-auto"},xe={class:"align-middle inline-block min-w-full shadow overflow-hidden bg-white shadow-dashboard px-2 pt-1 rounded-bl-lg rounded-br-lg"},ke={class:"min-w-full"},we={class:"px-1 py-1 border-b-2 border-gray-300 text-left leading-4 text-gray-800 tracking-wider"},Se=e("th",{class:"px-1 py-1 border-b-2 border-gray-300 text-left leading-4 text-gray-800 tracking-wider"},null,-1),Ce=e("th",{class:"px-1 py-1 border-b-2 border-gray-300 text-left leading-4 text-gray-800 tracking-wider"}," Sample ID ",-1),Ue={class:"px-1 py-1 border-b-2 border-gray-300 text-left leading-4 text-gray-800 tracking-wider"},De=e("th",{class:"px-1 py-1 border-b-2 border-gray-300 text-left leading-4 text-gray-800 tracking-wider"}," Client Request Id ",-1),Re=e("th",{class:"px-1 py-1 border-b-2 border-gray-300 text-left text-sm leading-4 text-gray-800 tracking-wider"}," Date Collected ",-1),Ve=e("th",{class:"px-1 py-1 border-b-2 border-gray-300 text-left text-sm leading-4 text-gray-800 tracking-wider"}," Analysis ",-1),Ie=e("th",{class:"px-1 py-1 border-b-2 border-gray-300 text-left text-sm leading-4 text-gray-800 tracking-wider"}," Status ",-1),Ae={class:"bg-white"},Ee={class:"px-1 py-1 whitespace-no-wrap border-b border-gray-500"},Me=["onUpdate:modelValue"],qe={class:"px-1 py-1 whitespace-no-wrap border-b border-gray-500"},Be=e("i",{class:"fa fa-star"},null,-1),je=[Be],Pe={class:"px-1 py-1 whitespace-no-wrap border-b border-gray-500"},$e={class:"text-sm leading-5 text-gray-800 font-semibold"},Ne={key:1},Fe={class:"px-1 py-1 whitespace-no-wrap border-b border-gray-500"},Le={class:"px-1 py-1 whitespace-no-wrap border-b border-gray-500"},Te={class:"px-1 py-1 whitespace-no-wrap border-b border-gray-500"},ze=e("td",{class:"px-1 py-1 whitespace-no-wrap border-b border-gray-500"},[e("div",null,"tests")],-1),Ge={class:"px-1 py-1 whitespace-no-wrap border-b border-gray-500"},He={type:"button",class:"bg-sky-800 text-white py-1 px-2 rounded-sm leading-none"},Oe={class:"my-4"},Je=O({__name:"ShipmentSamples",setup(Ke){const M=ae(()=>re(()=>import("./FelButton-abe4eedd.js"),["assets/FelButton-abe4eedd.js","assets/index-e48f6898.js","assets/index-7d22ceed.css"])),u=J(),g=K();let c=_(!1),r=U(()=>u.getShipment);const x=()=>{u.fetchShipmentByUid(g.params.shipmentUid)},m=Q({laboratoryUid:void 0,comment:void 0,courier:void 0}),h=_(!1),q=()=>{h.value=!0,u.updateShipment({uid:g.params.shipmentUid,payload:m}).then(()=>{h.value=!1,x()})};function B(){return r.value?.samples?.every(o=>o.checked===!0)}function k(){let o=[];return r.value?.shippedSamples?.forEach(s=>{s?.checked&&o.push(s.sample)}),o}function j(){B()?c.value=!0:c.value=!1,y()}function P(o){if($(o)||r.value?.state!=="preperation"){w(o);return}o.checked=!0,y()}function $(o){return["retracted","approved"].includes(o.status)}function w(o){o.checked=!1,y()}function N(){r?.value?.samples?.forEach(o=>c.value?P(o):w(o)),y()}function F(){return k().map(o=>({sampleUid:o.uid,shipedSampleUid:void 0,analyses:[]}))}let f=_(!1),v=_(!1);function y(){f.value=!1,v.value=!1;const o=k();o.length!==0&&(o.every(s=>["referred","paired"].includes(s.status??""))&&(f.value=!0),o.every(s=>s.status==="referred")&&(v.value=!0))}const L=U(()=>!["cancelled","dispatched"].includes(r.value?.state??"")),{manageSamples:T}=le(),S=o=>{const s=F();T(r?.value?.uid,s,o)};return(o,s)=>{const z=W("router-link"),G=D("motion-slide-left"),H=D("motion-slide-right");return l(),d("div",ie,[de,a((l(),d("div",ce,[a(e("form",pe,[e("div",ue,[e("label",me,[he,a(e("select",{name:"laboratory_uid","onUpdate:modelValue":s[0]||(s[0]=t=>m.laboratoryUid=t),class:"form-input mt-1 block w-full py-1"},[(l(!0),d(R,null,V(n(u).laboratories,t=>(l(),d("option",{key:t.uid,value:t.uid},p(t.name),9,ye))),128))],512),[[X,m.laboratoryUid]])]),e("label",_e,[be,a(e("input",{type:"text",class:"form-input mt-1 block w-full py-1","onUpdate:modelValue":s[1]||(s[1]=t=>m.courier=t)},null,512),[[Y,m.courier]])]),e("div",fe,[Z(n(M),{onClick:s[2]||(s[2]=b(t=>q(),["prevent"])),color:"sky-800",class:"p-1"},{default:I(()=>[A("Apply")]),_:1})])])],512),[[i,!h.value&&!n(u).shipment?.incoming]]),a(e("p",null,"updating ...",512),[[i,h.value]]),e("div",null,[e("button",{onClick:s[3]||(s[3]=b(t=>x(),["prevent"])),class:"px-1 py-1 mr-2 border-sky-800 border text-sky-800 rounded-sm transition duration-300 hover:bg-sky-800 hover:text-white focus:outline-none"}," Refresh ")])])),[[i,L.value],[G]]),ve,e("div",ge,[e("div",xe,[e("table",ke,[e("thead",null,[e("tr",null,[a(e("th",we,[a(e("input",{type:"checkbox",class:"",onChange:s[4]||(s[4]=t=>N()),"onUpdate:modelValue":s[5]||(s[5]=t=>ee(c)?c.value=t:c=t)},null,544),[[E,n(c)]])],512),[[i,n(r)?.state==="preperation"]]),Se,Ce,a(e("th",Ue," Exernal SID ",512),[[i,n(r)?.incoming]]),De,Re,Ve,Ie])]),e("tbody",Ae,[(l(!0),d(R,null,V(n(r)?.shippedSamples,t=>a((l(),d("tr",{key:t.sampleUid},[a(e("td",Ee,[a(e("input",{type:"checkbox",class:"","onUpdate:modelValue":C=>t.checked=C,onChange:s[6]||(s[6]=C=>j())},null,40,Me),[[E,t.checked]])],512),[[i,n(r)?.state==="preperation"]]),e("td",qe,[t.sample?.priority??0>0?(l(),d("span",{key:0,class:te(["font-small",{"text-orange-600":t.sample?.priority??0>1}])},[...je],2)):se("",!0)]),e("td",Pe,[e("div",$e,[t.sample?.analysisRequest?.patient?.uid?(l(),oe(z,{key:0,to:{name:"sample-detail",params:{patientUid:t.sample?.analysisRequest?.patient?.uid,sampleUid:t.sample?.uid}}},{default:I(()=>[A(p(t.sample?.sampleId),1)]),_:2},1032,["to"])):(l(),d("div",Ne,p(t.sample?.sampleId),1))])]),a(e("td",Fe,[e("div",null,p(t.extSampleId),1)],512),[[i,n(r)?.incoming]]),e("td",Le,[e("div",null,p(t.sample?.analysisRequest?.clientRequestId),1)]),e("td",Te,[e("div",null,p(t.sample?.dateCollected),1)]),ze,e("td",Ge,[e("button",He,p(t.sample?.status||"unknown"),1)])])),[[H]])),128))])])])]),e("section",Oe,[a(e("button",{onClick:s[7]||(s[7]=b(t=>S("recover"),["prevent"])),class:"px-2 py-1 mr-2 border-sky-800 border text-sky-800 rounded-sm transition duration-300 hover:bg-sky-800 hover:text-white focus:outline-none"}," Remove ",512),[[i,n(f)]]),a(e("button",{onClick:s[8]||(s[8]=b(t=>S("recall"),["prevent"])),class:"px-2 py-1 mr-2 border-sky-800 border text-sky-800 rounded-sm transition duration-300 hover:bg-sky-800 hover:text-white focus:outline-none"}," Pair ",512),[[i,n(v)]])])])}}}),Xe=ne(Je,[["__file","/home/aurthurm/Documents/Development/felicity/felicity-lims/webapp/views/shipment/_id/ShipmentSamples.vue"]]);export{Xe as default};
|