felicity-lims/felicity/templates/static/assets/LineListing-f83a7f9f.js
2024-11-01 08:48:45 +02:00

1 line
7.7 KiB
JavaScript

import{d as S,as as R,bd as L,C as E,N as V,o as n,c as l,g as m,G as c,H as h,b as e,f as d,F as y,p as g,t as a,e as i,E as x,at as _,v,w as A,j as P,_ as T,be as U,k as B}from"./index-e48f6898.js";const M={class:"bg-white p-2"},N={class:"overflow-x-auto my-4"},j={key:0,class:"align-middle inline-block min-w-full shadow overflow-hidden bg-white shadow-dashboard px-2 pt-1 rounded-bl-sm rounded-br-sm"},G={class:"min-w-full"},Y=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("input",{type:"checkbox"})]),e("th",{class:"px-1 py-1 border-b-2 border-gray-300 text-left leading-4 text-gray-800 tracking-wider"}," Report Type "),e("th",{class:"px-1 py-1 border-b-2 border-gray-300 text-left text-sm leading-4 text-gray-800 tracking-wider"}," Generated By "),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 Generated "),e("th",{class:"px-1 py-1 border-b-2 border-gray-300 text-left text-sm leading-4 text-gray-800 tracking-wider"}," Period Start "),e("th",{class:"px-1 py-1 border-b-2 border-gray-300 text-left text-sm leading-4 text-gray-800 tracking-wider"}," Period End "),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 "),e("th",{class:"px-1 py-1 border-b-2 border-gray-300"})])],-1),$={class:"bg-white"},q=e("td",null,[e("input",{type:"checkbox"})],-1),I={class:"px-1 py-1 whitespace-no-wrap border-b border-gray-500"},O={class:"text-sm leading-5 text-sky-800"},H={class:"px-1 py-1 whitespace-no-wrap border-b border-gray-500"},z={class:"text-sm leading-5 text-sky-800"},J={class:"px-1 py-1 whitespace-no-wrap border-b border-gray-500"},K={class:"text-sm leading-5 text-sky-800"},Q={class:"px-1 py-1 whitespace-no-wrap border-b border-gray-500"},W={class:"text-sm leading-5 text-sky-800"},X={class:"px-1 py-1 whitespace-no-wrap border-b border-gray-500"},Z={class:"text-sm leading-5 text-sky-800"},ee={class:"px-1 py-1 whitespace-no-wrap border-b border-gray-500"},te={class:"text-sm leading-5 text-sky-800"},se={class:"px-1 py-1 whitespace-no-wrap text-right border-b border-gray-500 text-sm leading-5"},oe=["onClick"],ae=["onClick"],ie={key:1,class:"py-4 pl-4 bg-white"},ne=e("p",{class:"text-orange-600"},"There are no downloaded reports yet",-1),le=e("hr",null,null,-1),de=e("p",{class:"italic"}," Once a download request has been done. Your reports will be appear here ",-1),re=[ne,le,de],ce={class:"my-4"},_e={action:"post",class:"p-1"},pe={class:"grid grid-cols-3 gap-x-4 mb-4"},ue={class:"block col-span-1 mb-2"},be=e("span",{class:"text-gray-700"},"Report Type",-1),me=e("option",{value:"line_listing",selected:""},"line listing",-1),he=[me],ye={class:"block col-span-1 mb-2"},ge=e("span",{class:"text-gray-700"},"Analyses",-1),xe=["value"],ve={class:"block col-span-1 mb-2"},we=e("span",{class:"text-gray-700"},"States",-1),fe=e("option",{value:""},null,-1),ke=e("option",{value:"published"},"published",-1),Fe=e("option",{value:"verified"},"verified",-1),De=e("option",{value:"to_be_verified"},"to_be_verified",-1),Ce=e("option",{value:"received"},"received",-1),Se=e("option",{value:"cancelled"},"cancelled",-1),Re=e("option",{value:"rejected"},"rejected",-1),Le=e("option",{value:"invalidated"},"invalidated",-1),Ee=e("option",{value:"due"},"due",-1),Ve=[fe,ke,Fe,De,Ce,Se,Re,Le,Ee],Ae={class:"grid grid-cols-3 gap-x-4 mb-4"},Pe={class:"block col-span-1 mb-2"},Te=e("span",{class:"text-gray-700"},"Period Date Criteria",-1),Ue=e("option",{value:"created_at"},"Created Date",-1),Be=e("option",{value:"date_published"},"Published Date",-1),Me=e("option",{value:"date_submitted"},"Submission Date",-1),Ne=e("option",{value:"date_verified"},"Verified Date",-1),je=e("option",{value:"date_cancelled"},"Cacellation Date",-1),Ge=e("option",{value:"date_invalidated"},"Invalidation Date",-1),Ye=[Ue,Be,Me,Ne,je,Ge],$e={class:"block col-span-1 mb-2"},qe=e("span",{class:"text-gray-700"},"Period Start",-1),Ie={class:"block col-span-1 mb-2"},Oe=e("span",{class:"text-gray-700"},"Period End",-1),He=e("hr",null,null,-1),ze=S({__name:"LineListing",setup(Je){const p=P(()=>T(()=>import("./FelAccordion-a82a10ed.js"),["assets/FelAccordion-a82a10ed.js","assets/index-e48f6898.js","assets/index-7d22ceed.css"])),u=R(),{reports:b,fetchReports:w,generateReport:f,deleteReport:k}=L(),o=E({listingForm:{report_type:"",analyses_uids:[],sample_states:[],date_column:"",period_start:"",period_end:""}});V(async()=>{u.fetchAnalysesServices({first:void 0,after:"",text:"",sortBy:["name"]}),await w()});const F=()=>f({...o.listingForm}),D=r=>{const s=document.createElement("a");s.download=r.report_type+"-"+r.crated_at,s.href=U+"/"+r.location,document.body.appendChild(s),s.click(),document.body.removeChild(s)};return(r,s)=>(n(),l("div",M,[m(d(p),null,{title:c(()=>[h("Downloaded Line Listing Reports")]),body:c(()=>[e("div",N,[d(b)?.length>0?(n(),l("div",j,[e("table",G,[Y,e("tbody",$,[(n(!0),l(y,null,g(d(b),t=>(n(),l("tr",{key:t.uid},[q,e("td",I,[e("div",O,a(t.report_type),1)]),e("td",H,[e("div",z,a(t?.created_by?.first_name)+" "+a(t?.created_by?.last_name),1)]),e("td",J,[e("div",K,a(t?.created_at),1)]),e("td",Q,[e("div",W,a(t?.period_start),1)]),e("td",X,[e("div",Z,a(t?.period_end),1)]),e("td",ee,[e("div",te,a(t?.status),1)]),e("td",se,[i(e("button",{onClick:C=>D(t),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"}," Download ",8,oe),[[x,t.status=="READY"]]),i(e("button",{onClick:C=>d(k)(t),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"}," Delete ",8,ae),[[x,t.status=="READY"]])])]))),128))])])])):(n(),l("div",ie,[...re]))])]),_:1}),m(d(p),null,{title:c(()=>[h("Listing Report Request")]),body:c(()=>[e("div",ce,[e("form",_e,[e("div",pe,[e("label",ue,[be,i(e("select",{name:"report_type","onUpdate:modelValue":s[0]||(s[0]=t=>o.listingForm.report_type=t),class:"form-input mt-1 block w-full"},[...he],512),[[_,o.listingForm.report_type]])]),e("label",ye,[ge,i(e("select",{name:"analyses_uids","onUpdate:modelValue":s[1]||(s[1]=t=>o.listingForm.analyses_uids=t),class:"form-input mt-1 block w-full",multiple:""},[(n(!0),l(y,null,g(d(u).analysesServices,t=>(n(),l("option",{key:t.uid,value:t.uid},a(t.name),9,xe))),128))],512),[[_,o.listingForm.analyses_uids]])]),e("label",ve,[we,i(e("select",{name:"sample_states","onUpdate:modelValue":s[2]||(s[2]=t=>o.listingForm.sample_states=t),class:"form-input mt-1 block w-full",multiple:""},[...Ve],512),[[_,o.listingForm.sample_states]])])]),e("div",Ae,[e("label",Pe,[Te,i(e("select",{name:"date_column","onUpdate:modelValue":s[3]||(s[3]=t=>o.listingForm.date_column=t),class:"form-input mt-1 block w-full"},[...Ye],512),[[_,o.listingForm.date_column]])]),e("label",$e,[qe,i(e("input",{name:"period_start",type:"datetime-local",class:"form-input mt-1 block w-full",autocomplete:"off","onUpdate:modelValue":s[4]||(s[4]=t=>o.listingForm.period_start=t),placeholder:"From ..."},null,512),[[v,o.listingForm.period_start]])]),e("label",Ie,[Oe,i(e("input",{name:"period_end",type:"datetime-local",class:"form-input mt-1 block w-full","onUpdate:modelValue":s[5]||(s[5]=t=>o.listingForm.period_end=t),placeholder:"To ..."},null,512),[[v,o.listingForm.period_end]])])]),He,e("button",{type:"button",onClick:s[6]||(s[6]=A(t=>F(),["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})]))}}),Qe=B(ze,[["__file","/home/aurthurm/Documents/Development/felicity/felicity-lims/webapp/views/dashboard/LineListing.vue"]]);export{Qe as default};