felicity-lims/felicity/templates/static/assets/ShipmentAssign-25c1674c.js

2 lines
5.9 KiB
JavaScript
Raw Normal View History

2024-11-18 01:39:30 +08:00
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",