mirror of
https://github.com/beak-insights/felicity-lims.git
synced 2025-02-24 00:42:59 +08:00
1 line
12 KiB
JavaScript
1 line
12 KiB
JavaScript
import{d as se,W as oe,ar as le,K as ne,s as ae,q as Q,r as C,x as f,y as ie,m as re,o as l,c as n,b as e,e as h,P as V,w as x,i as A,f as i,F as _,E as m,t as v,g as E,B as q,C as de,D as w,as as g,A as ce,h as M,j as D,_ as T,aQ as ue,M as pe,k as he}from"./index-e62f5c21.js";import{h as _e,o as ve,a as fe}from"./constants-02c93bfe.js";const me={class:"flex items-center justify-between"},be=e("h1",{class:"h1 font-bold text-dark-700"},"QC Analyses Requests",-1),ye=M('<hr><section class="my-4 flex sm:flex-row flex-col"><div class="flex flex-row mb-1 sm:mb-0"><div class="relative"><select class="appearance-none h-full rounded-l-sm border block w-full bg-white border-gray-400 text-gray-700 py-2 px-4 pr-8 leading-tight focus:outline-none focus:bg-white focus:border-gray-500"><option value="">All</option><option value="received">Received</option><option value="awaiting">Awaiting</option><option value="approved">Approved</option><option value="cancelled">Cancelled</option></select><div class="pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-700"><svg class="fill-current h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M9.293 12.95l.707.707L15.657 8l-1.414-1.414L10 10.828 5.757 6.586 4.343 8z"></path></svg></div></div></div><div class="block relative"><span class="h-full absolute inset-y-0 left-0 flex items-center pl-2"><svg viewBox="0 0 24 24" class="h-4 w-4 fill-current text-gray-500"><path d="M10 4a6 6 0 100 12 6 6 0 000-12zm-8 6a8 8 0 1114.32 4.906l5.387 5.387a1 1 0 01-1.414 1.414l-5.387-5.387A8 8 0 012 10z"></path></svg></span><input placeholder="Search ..." class="appearance-none rounded-r-sm rounded-l-sm sm:rounded-l-none border border-gray-400 border-b block pl-8 pr-6 py-2 w-full bg-white text-sm placeholder-gray-400 text-gray-700 focus:bg-white focus:placeholder-gray-600 focus:text-gray-700 focus:outline-none"></div><button class="px-2 py-1 ml-2 border-sky-800 border text-sky-800 rounded-sm transition duration-300 hover:bg-sky-800 hover:text-white focus:outline-none"> Filter ...</button></section>',2),ge={class:"overflow-x-auto mt-4"},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"},we={class:"min-w-full"},ke=e("thead",null,[e("tr",null,[e("th",{class:"px-1 py-1 border-b-2 border-gray-300 text-left leading-4 text-gray-800 tracking-wider"}),e("th",{class:"px-1 py-1 border-b-2 border-gray-300 text-left leading-4 text-gray-800 tracking-wider"},"Date Created"),e("th",{class:"px-1 py-1 border-b-2 border-gray-300 text-left text-sm leading-4 text-gray-800 tracking-wider"},"QCSet (samples)"),e("th",{class:"px-1 py-1 border-b-2 border-gray-300 text-left text-sm leading-4 text-gray-800 tracking-wider"},"Test(s)"),e("th",{class:"px-1 py-1 border-b-2 border-gray-300"})])],-1),Ce={class:"bg-white"},Se=e("td",{class:"px-1 py-1 whitespace-no-wrap border-b border-gray-500"},null,-1),Qe={class:"px-1 py-1 whitespace-no-wrap border-b border-gray-500"},Ae={class:"flex items-center"},qe={class:"text-sm leading-5 text-gray-800"},Le={class:"px-1 py-1 whitespace-no-wrap border-b border-gray-500"},Pe={class:"text-sm leading-5 text-sky-800"},Ue={class:"px-1 py-1 whitespace-no-wrap border-b border-gray-500"},Ve={class:"text-sm leading-5 text-sky-800"},Ee={class:"px-1 py-1 whitespace-no-wrap text-right border-b border-gray-500 text-sm leading-5"},De={key:0,class:"py-4 text-center"},Te={class:"flex justify-between"},Me=e("div",null,null,-1),Re={class:"my-4 flex sm:flex-row flex-col"},Be={class:"flex flex-row mb-1 sm:mb-0"},je={class:"relative"},Ie=["disabled"],Ne=M('<option value="25">25</option><option value="50">50</option><option value="100">100</option><option value="250">250</option><option value="500">500</option><option value="1000">1000</option><option value="5000">5000</option><option value="10000">10000</option>',8),Fe=[Ne],$e=e("div",{class:"pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-700"},[e("svg",{class:"fill-current h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},[e("path",{d:"M9.293 12.95l.707.707L15.657 8l-1.414-1.414L10 10.828 5.757 6.586 4.343 8z"})])],-1),ze={class:"block relative"},Oe=["placeholder"],Ke=e("h3",null,"Create QC Analyses Requests",-1),We={action:"post",class:"mb-8 bg-white"},Ze={class:"grid grid-cols-3 gap-x-4 mb-4"},Ge={class:"block col-span-1"},He=e("span",{class:"text-gray-700"},"Department",-1),Je=e("option",{value:""},null,-1),Xe=["value"],Ye={id:"samples"},et=e("hr",null,null,-1),tt={class:"flex justify-between items-center py-2"},st=e("h5",null,"Process Control Samples",-1),ot=e("i",{class:"fa fa-ellipsis-h","aria-hidden":"true"},null,-1),lt=[ot],nt=e("hr",{class:"mb-4"},null,-1),at={class:"flex items-center justify-between"},it={class:""},rt={class:"grid grid-cols-4 gap-x-4"},dt={class:"block col-span-1 mb-2"},ct=e("span",{class:"text-gray-700"},"QC Template",-1),ut=["onUpdate:modelValue"],pt=e("option",{value:""},null,-1),ht=["value"],_t={key:0,class:"block col-span-1 mb-2"},vt=e("span",{class:"text-gray-700"},"QC Levels",-1),ft=["onUpdate:modelValue"],mt=e("option",{value:""},null,-1),bt=["value"],yt={class:"block col-span-1 mb-2"},gt=e("span",{class:"text-gray-700"},"Analysis Profiles",-1),xt=["onUpdate:modelValue"],wt=e("option",{value:""},null,-1),kt=["value"],Ct={key:1,class:"block col-span-1 mb-2"},St=e("span",{class:"text-gray-700"},"Analysis Services",-1),Qt=["onUpdate:modelValue"],At=e("option",{value:""},null,-1),qt=["value"],Lt={class:""},Pt=["onClick"],Ut=e("hr",null,null,-1),Vt=e("hr",null,null,-1),Et=se({__name:"QualityControlListing",setup(Dt){const R=D(()=>T(()=>import("./FelLoadingMessage-b4229f94.js"),["assets/FelLoadingMessage-b4229f94.js","assets/index-e62f5c21.js","assets/index-332ec99e.css"])),B=D(()=>T(()=>import("./FelModal-44636049.js"),["assets/FelModal-44636049.js","assets/index-e62f5c21.js","assets/index-332ec99e.css","assets/FelModal-780aeea9.css"])),c=oe(),u=le(),L=ne(),{withClientMutation:j}=pe(),{qcSets:I,fetchingQCSets:N}=ae(c);let F=Q({first:void 0,after:"",text:"",sortBy:["name"]});u.fetchAnalysesServices(F),u.fetchQCLevels(),u.fetchQCTemplates(),u.fetchAnalysesProfiles(),L.fetchDepartments({}),c.resetQCSets();let b=C(25),y=Q({first:b.value,after:"",text:"",sortBy:["-uid"],filterAction:!1});c.fetchQCSets(y);const $=f(()=>u.getAnalysesProfiles),z=f(()=>{const r=u.getAnalysesServicesSimple;let s=new Set;return r.forEach(a=>{a.profiles?.length===0&&s.add(a)}),[...s]});let d=C(!1),O=C(!0),p=Q({departmentUid:void 0,samples:[]});ie(()=>P());function P(){p.samples?.push({qcTemplateUid:void 0,qcLevels:[],analysisProfiles:[],analysisServices:[]})}function K(){console.log(p),j(ue,{samples:p.samples},"createQcSet").then(r=>c.addQCSets(r?.qcSets))}function W(r){p.samples?.splice(r,1)}function Z(){O.value===!0&&K(),d.value=!1}const S=f(()=>c.getQCSetPageInfo);function G(){y.first=+b.value,y.after=S?.value?.pageInfo?.endCursor??"",y.text="",y.filterAction=!1,c.fetchQCSets(y)}function H(r){let s=[];return r?.forEach(a=>{a?.sampleId+""+a.status;let t=a?.qcLevel?.level?.match(/\b([A-Z])/g).join("")+" ("+a.status+")";s.includes(t)||s.push(t)}),s.join(", ")}function J(r){let s=[];return r?.forEach(a=>{a.profiles.forEach(t=>{s.includes(t.name)||s.push(t.name)})}),r?.forEach(a=>{a.analyses.forEach(t=>{s.includes(t.name)||s.push(t.name)})}),s.join(", ")}const k=C(!1),X=f(()=>L.getDepartments),Y=f(()=>u.getQCTemplates),ee=f(()=>u.getQCLevels),te=f(()=>c.getQCSets?.length+" of "+c.getQCSetCount+" QC Sets");return(r,s)=>{const a=re("router-link");return l(),n(_,null,[e("div",me,[be,h(e("button",{type:"button",class:"border border-sky-800 text-sky-800 rounded-sm px-2 py-1 m-2 transition-colors duration-500 ease select-none hover:bg-sky-800 hover:text-white focus:outline-none focus:shadow-outline",onClick:s[0]||(s[0]=x(t=>A(d)?d.value=!i(d):d=!i(d),["prevent"]))}," Add New QC Request ",512),[[V,_e(fe.CREATE,ve.SAMPLE)]])]),ye,e("section",ge,[e("div",xe,[e("table",we,[ke,e("tbody",Ce,[(l(!0),n(_,null,m(i(I),t=>(l(),n("tr",{key:t.uid},[Se,e("td",Qe,[e("div",Ae,[e("div",qe,v(t.createdAt),1)])]),e("td",Le,[e("div",Pe,v(H(t.samples??[])),1)]),e("td",Ue,[e("div",Ve,v(J(t.samples??[])),1)]),e("td",Ee,[E(a,{to:{name:"qc-set-detail",params:{qcSetUid:t.uid}},class:"px-2 py-1 mr-2 border-sky-800 border text-gray-500rounded-smtransition duration-300 hover:bg-sky-800 hover:text-white focus:outline-none"},{default:q(()=>[de("View Detail")]),_:2},1032,["to"])])]))),128))])]),i(N)?(l(),n("div",De,[E(i(R),{message:"Fetching QCSets ..."})])):w("",!0)])]),e("section",Te,[Me,e("div",Re,[h(e("button",{onClick:s[1]||(s[1]=x(t=>G(),["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"},"Show More",512),[[V,S.value?.pageInfo?.hasNextPage]]),e("div",Be,[e("div",je,[h(e("select",{class:"appearance-none h-full rounded-l-sm border block w-full bg-white border-gray-400 text-gray-700 py-2 px-4 pr-8 leading-tight focus:outline-none focus:bg-white focus:border-gray-500","onUpdate:modelValue":s[2]||(s[2]=t=>A(b)?b.value=t:b=t),disabled:!S.value?.pageInfo?.hasNextPage},[...Fe],8,Ie),[[g,i(b)]]),$e])]),e("div",ze,[e("input",{placeholder:te.value,class:"appearance-none rounded-r-sm rounded-l-sm sm:rounded-l-none border border-gray-400 border-b block pl-8 pr-6 py-2 w-full bg-white text-sm placeholder-gray-400 text-gray-700 focus:bg-white focus:placeholder-gray-600 focus:text-gray-700 focus:outline-none",disabled:""},null,8,Oe)])])]),i(d)?(l(),ce(i(B),{key:0,onClose:s[7]||(s[7]=t=>A(d)?d.value=!1:d=!1)},{header:q(()=>[Ke]),body:q(()=>[e("form",We,[e("div",Ze,[e("label",Ge,[He,h(e("select",{name:"clientContacts",id:"clientContacts","onUpdate:modelValue":s[3]||(s[3]=t=>i(p).departmentUid=t),class:"form-input mt-1 block w-full"},[Je,(l(!0),n(_,null,m(X.value,t=>(l(),n("option",{key:t.uid,value:t.uid},v(t.name),9,Xe))),128))],512),[[g,i(p).departmentUid]])])]),e("section",Ye,[et,e("div",tt,[st,e("span",{class:"cursor-pointer text-xl text-sky-800",onClick:s[4]||(s[4]=t=>k.value=!k.value)},[...lt]),i(p).samples?.length<20?(l(),n("button",{key:0,onClick:s[5]||(s[5]=x(t=>P(),["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"},"Add QCSet")):w("",!0)]),nt,(l(!0),n(_,null,m(i(p).samples,(t,U)=>(l(),n("div",{key:U},[e("div",at,[e("div",it,[e("div",rt,[e("label",dt,[ct,h(e("select",{"onUpdate:modelValue":o=>t.qcTemplateUid=o,class:"form-input mt-1 block w-full"},[pt,(l(!0),n(_,null,m(Y.value,o=>(l(),n("option",{key:o.uid,value:o.uid},v(o.name),9,ht))),128))],8,ut),[[g,t.qcTemplateUid]])]),k.value?(l(),n("label",_t,[vt,h(e("select",{"onUpdate:modelValue":o=>t.qcLevels=o,class:"form-input mt-1 block w-full",multiple:""},[mt,(l(!0),n(_,null,m(ee.value,o=>(l(),n("option",{key:o.uid,value:o.uid},v(o.level),9,bt))),128))],8,ft),[[g,t.qcLevels]])])):w("",!0),e("label",yt,[gt,h(e("select",{"onUpdate:modelValue":o=>t.analysisProfiles=o,class:"form-input mt-1 block w-full",multiple:""},[wt,(l(!0),n(_,null,m($.value,o=>(l(),n("option",{key:o.uid,value:o.uid},v(o.name),9,kt))),128))],8,xt),[[g,t.analysisProfiles]])]),k.value?(l(),n("label",Ct,[St,h(e("select",{"onUpdate:modelValue":o=>t.analysisServices=o,class:"form-input mt-1 block w-full",multiple:""},[At,(l(!0),n(_,null,m(z.value,o=>(l(),n("option",{key:o.uid,value:o.uid},v(o.name),9,qt))),128))],8,Qt),[[g,t.analysisServices]])])):w("",!0)])]),e("div",Lt,[e("button",{onClick:x(o=>W(U),["prevent"]),class:"px-2 py-1 mr-2 border-orange-600 border text-orange-600rounded-smtransition duration-300 hover:bg-orange-600 hover:text-white focus:outline-none"},"Remove",8,Pt)])]),Ut]))),128))]),Vt,e("button",{type:"button",onClick:s[6]||(s[6]=x(t=>Z(),["prevent"])),class:"-mb-4 w-full border border-sky-800 bg-sky-800 text-white rounded-sm px-4 py-2 m-2 transition-colors duration-500 ease select-none hover:bg-sky-800 focus:outline-none focus:shadow-outline"}," Save Form ")])]),_:1})):w("",!0)],64)}}}),Rt=he(Et,[["__file","/home/aurthurm/Documents/Development/felicity/felicity-lims/webapp/views/qcontrol/QualityControlListing.vue"]]);export{Rt as default};
|