mirror of
https://github.com/beak-insights/felicity-lims.git
synced 2025-02-24 00:42:59 +08:00
1 line
5.9 KiB
JavaScript
1 line
5.9 KiB
JavaScript
import{d as P,a$ as $,W as z,x as v,q as O,r as W,z as w,o as a,c as i,b as e,e as d,F as h,E as g,t as n,f as u,as as G,g as y,B as S,C,w as A,P as U,at as b,j as H,_ as J,k as K}from"./index-e62f5c21.js";import D from"./FelButton-7b166825.js";import{u as Q}from"./shipment-165f14c9.js";const X={class:"overflow-x-auto mt-4"},Y={action:"post",class:"p-1"},Z={class:"flex justify-start mb-4"},ee={class:"flex justify-between items-center"},te=e("span",{class:"text-gray-700 mr-2 whitespace-nowrap"},"Sample Type",-1),se=["value"],oe={class:"ml-6 mt-2"},ae={class:"overflow-x-auto mt-4"},ie={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"},ne={key:0,class:"py-4 text-center"},re={key:1,class:"min-w-full"},de={class:"px-1 py-1 border-b-2 border-gray-300 text-left leading-4 text-gray-800 tracking-wider"},le=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),pe=e("th",{class:"px-1 py-1 border-b-2 border-gray-300 text-left leading-4 text-gray-800 tracking-wider"}," Sample Type ",-1),he=e("th",{class:"px-1 py-1 border-b-2 border-gray-300 text-left leading-4 text-gray-800 tracking-wider"}," Client Sample ID ",-1),ue=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),_e=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 Created ",-1),me=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 Received ",-1),ge=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),ye={class:"bg-white"},be=["onUpdate:modelValue","onChange"],xe=e("td",{class:"px-1 py-1 whitespace-no-wrap border-b border-gray-500"},null,-1),fe={class:"px-1 py-1 whitespace-no-wrap border-b border-gray-500"},ke={class:"text-sm leading-5 text-sky-800 font-semibold"},ve={class:"px-1 py-1 whitespace-no-wrap border-b border-gray-500"},we={class:"text-sm leading-5 text-sky-800 font-semibold"},Se={class:"px-1 py-1 whitespace-no-wrap border-b border-gray-500"},Ce={class:"text-sm leading-5 text-sky-800 font-semibold"},Ae={class:"px-1 py-1 whitespace-no-wrap border-b border-gray-500"},Ue={class:"text-sm leading-5 text-sky-800"},De=["onUpdate:modelValue","disabled"],Ve={class:"px-1 py-1 whitespace-no-wrap border-b border-gray-500"},Te={class:"text-sm leading-5 text-sky-800"},Re={class:"px-1 py-1 whitespace-no-wrap border-b border-gray-500"},Fe={class:"text-sm leading-5 text-sky-800"},Be={class:"px-1 py-1 whitespace-no-wrap border-b border-gray-500"},Ee={class:"text-sm leading-5 text-sky-800"},Ie={class:"my-4"},Me=P({__name:"ShipmentAssign",setup(je){const V=H(()=>J(()=>import("./FelLoadingMessage-b4229f94.js"),["assets/FelLoadingMessage-b4229f94.js","assets/index-e62f5c21.js","assets/index-332ec99e.css"])),l=$(),x=z(),{manageSamples:T}=Q();l.fetchReferralLaboratories();const R=v(()=>l.getShipment);x.fetchSampleTypes();const _=O({sampleTypeUid:void 0,analysisUid:void 0}),c=W(!1),f=v(()=>{const t=[];return l.getSamples?.forEach(p=>{t?.some(m=>m.uid===p.uid)||t.push(p)}),t}),F=()=>{k(),l.fetchFoShipmentAssign({first:50,after:"",text:"",sortBy:void 0,..._})},B=()=>{const t=E();T(R?.value?.uid,t,"assign")};function k(){return l.samples?.filter(t=>t.checked)}function E(){return k().map(t=>({sampleUid:t.uid,shipedSampleUid:void 0,analyses:t.analysisResults?.filter(o=>o.checked)?.map(o=>o.uid)}))?.filter(t=>t?.analyses?.length>0)}function I(t){q()?c.value=!0:c.value=!1}function M(t){t.checked=!0}function j(t){t.checked=!1}async function L(){await f?.value?.forEach(t=>c.value?M(t):j(t))}function q(){return f?.value?.every(t=>t.checked===!0)}return(t,o)=>{const p=w("motion-slide-left"),m=w("motion-slide-right");return a(),i(h,null,[e("div",X,[d((a(),i("form",Y,[e("div",Z,[e("label",ee,[te,d(e("select",{name:"analyses_uids","onUpdate:modelValue":o[0]||(o[0]=s=>_.sampleTypeUid=s),class:"form-input mt-1 block w-full py-1"},[(a(!0),i(h,null,g(u(x).sampleTypes,s=>(a(),i("option",{key:s.uid,value:s.uid},n(s.name),9,se))),128))],512),[[G,_.sampleTypeUid]])]),e("div",oe,[d(y(D,{onClick:o[1]||(o[1]=A(s=>F(),["prevent"])),color:"sky-800",class:"p-1"},{default:S(()=>[C("Apply Filters")]),_:1},512),[[U,!0]])])])])),[[p]])]),e("div",ae,[e("div",ie,[u(l).fetchingSamples?(a(),i("div",ne,[y(u(V),{message:"Fetching samples ..."})])):(a(),i("table",re,[e("thead",null,[e("tr",null,[e("th",de,[d(e("input",{type:"checkbox",onChange:L,"onUpdate:modelValue":o[2]||(o[2]=s=>c.value=s)},null,544),[[b,c.value]])]),le,ce,pe,he,ue,_e,me,ge])]),d((a(),i("tbody",ye,[(a(!0),i(h,null,g(u(l).samples,s=>(a(),i("tr",{key:s?.uid},[e("td",null,[d(e("input",{type:"checkbox","onUpdate:modelValue":r=>s.checked=r,onChange:r=>I()},null,40,be),[[b,s.checked]])]),xe,e("td",fe,[e("div",ke,n(s?.sampleId),1)]),e("td",ve,[e("div",we,n(s?.sampleType?.name),1)]),e("td",Se,[e("div",Ce,n(s?.analysisRequest?.clientRequestId),1)]),e("td",Ae,[e("div",Ue,[e("ul",null,[(a(!0),i(h,null,g(s?.analysisResults,r=>(a(),i("li",{class:"flex justify-start items-center",key:r.uid},[d(e("input",{type:"checkbox","onUpdate:modelValue":N=>r.checked=N,class:"mr-2",disabled:!s.checked},null,8,De),[[b,r.checked]]),e("span",null,n(r?.analysis?.name),1),e("span",null,n(r?.status),1)]))),128))])])]),e("td",Ve,[e("div",Te,n(s?.createdAt),1)]),e("td",Re,[e("div",Fe,n(s?.dateReceived),1)]),e("td",Be,[e("div",Ee,n(s?.status),1)])]))),128))])),[[m]])]))])]),e("section",Ie,[d(y(D,{onClick:A(B,["prevent"]),color:"orange-600"},{default:S(()=>[C("Assign Samples")]),_:1},512),[[U,!0]])])],64)}}}),Pe=K(Me,[["__file","/home/aurthurm/Documents/Development/felicity/felicity-lims/webapp/views/shipment/_id/ShipmentAssign.vue"]]);export{Pe as default};
|