mirror of
https://github.com/beak-insights/felicity-lims.git
synced 2025-02-24 17:02:55 +08:00
1 line
6.6 KiB
JavaScript
1 line
6.6 KiB
JavaScript
import{_ as C,W as D,n as V,q as F}from"./billing-356772f3.js";import{f as R,G as B,r as m,c as $,d as _,h as r,k as a,x as e,F as p,ak as b,D as d,u as n,y as v,j,A as k,ag as c,i as L,_ as O}from"./_plugin-vue_export-helper-3f67fb71.js";import{a as P,b as q}from"./instrument.mutations-c5d0ba02.js";import{v as f,d as h,a as G}from"./runtime-dom.esm-bundler-6e07ef74.js";const K={class:""},W={class:"container w-full my-4"},Y=e("hr",null,null,-1),z=e("hr",null,null,-1),H=e("hr",null,null,-1),J={class:"overflow-x-auto mt-4"},Q={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"},X={class:"min-w-full"},Z=e("thead",null,[e("tr",null,[e("th",{class:"px-1 py-1 border-b-2 border-gray-300 text-left text-sm leading-4 text-gray-800 tracking-wider"},"Name"),e("th",{class:"px-1 py-1 border-b-2 border-gray-300 text-left text-sm leading-4 text-gray-800 tracking-wider"},"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"},"Manufacturer"),e("th",{class:"px-1 py-1 border-b-2 border-gray-300 text-left text-sm leading-4 text-gray-800 tracking-wider"},"Supplier"),e("th",{class:"px-1 py-1 border-b-2 border-gray-300"})])],-1),ee={class:"bg-white"},te={class:"px-1 py-1 whitespace-no-wrap border-b border-gray-500"},se={class:"text-sm leading-5 text-gray-800"},oe={class:"px-1 py-1 whitespace-no-wrap border-b border-gray-500"},ne={class:"text-sm leading-5 text-gray-800"},le={class:"px-1 py-1 whitespace-no-wrap border-b border-gray-500"},re={class:"text-sm leading-5 text-sky-800"},ae={class:"px-1 py-1 whitespace-no-wrap border-b border-gray-500"},ie={class:"text-sm leading-5 text-sky-800"},de={class:"px-1 py-1 whitespace-no-wrap text-right border-b border-gray-500 text-sm leading-5"},ue=["onClick"],ce={action:"post",class:"p-1"},pe={class:"grid grid-cols-3 gap-x-4 mb-4"},me={class:"block col-span-2 mb-2"},_e=e("span",{class:"text-gray-700"},"Instrument Name",-1),be={class:"block col-span-1 mb-2"},ye=e("span",{class:"text-gray-700"},"keyword",-1),fe={class:"block col-span-1 mb-2"},he=e("span",{class:"text-gray-700 w-4/12"},"Instrument Type",-1),ge={class:"w-full"},we=e("option",null,null,-1),xe=["value"],ve={class:"block col-span-1 mb-2"},ke=e("span",{class:"text-gray-700 w-4/12"},"Manufacturer",-1),Ue={class:"w-full"},Ie=e("option",null,null,-1),Te=["value"],Se={class:"block col-span-1 mb-2"},Me=e("span",{class:"text-gray-700 w-4/12"},"Supplier",-1),Ee={class:"w-full"},Ne=e("option",null,null,-1),Ae=["value"],Ce={class:"block col-span-3 mb-2"},De=e("span",{class:"text-gray-700"},"Description",-1),Ve=e("hr",null,null,-1),Fe=R({__name:"Instruments",setup(Re){const U=B(()=>C(()=>import("./SimpleModal-1f91868a.js"),["assets/SimpleModal-1f91868a.js","assets/_plugin-vue_export-helper-3f67fb71.js","assets/runtime-dom.esm-bundler-6e07ef74.js","assets/SimpleModal-f645a074.css"]));D();const l=V(),{withClientMutation:g}=F();m("view");let u=m(!1),w=m("");const y=m(!0);let s=$({});l.fetchInstrumentTypes();const I=_(()=>l.getInstrumentTypes);l.fetchInstruments();const T=_(()=>l.getInstruments);l.fetchManufacturers();const S=_(()=>l.getManufacturers);l.fetchSuppliers();const M=_(()=>l.getSuppliers);function E(){const i={name:s.name,keyword:s.keyword,description:s.description,instrumentTypeUid:s.instrumentTypeUid,manufacturerUid:s.manufacturerUid,supplierUid:s.supplierUid};g(P,{payload:i},"createInstrument").then(o=>l.addInstrument(o))}function N(){const i={name:s.name,keyword:s.keyword,description:s.description,instrumentTypeUid:s.instrumentTypeUid,manufacturerUid:s.manufacturerUid,supplierUid:s.supplierUid};g(q,{uid:s.uid,payload:i},"updateInstrument").then(o=>l.updateInstrument(o))}function x(i,o={}){y.value=i,u.value=!0,w.value=(i?"CREATE":"EDIT")+" ANALYSES INSTRUMENT",i?Object.assign(s,{}):Object.assign(s,{...o})}function A(){y.value===!0&&E(),y.value===!1&&N(),u.value=!1}return(i,o)=>(r(),a(p,null,[e("div",K,[e("div",W,[Y,e("button",{class:"px-2 py-1 border-sky-800 border text-sky-800 rounded-sm transition duration-300 hover:bg-sky-800 hover:text-white focus:outline-none",onClick:o[0]||(o[0]=t=>x(!0))}," Add Instrument"),z]),H,e("div",J,[e("div",Q,[e("table",X,[Z,e("tbody",ee,[(r(!0),a(p,null,b(n(T),t=>(r(),a("tr",{key:t?.uid},[e("td",te,[e("div",se,d(t?.name),1)]),e("td",oe,[e("div",ne,d(t?.instrumentType?.name),1)]),e("td",le,[e("div",re,d(t?.manufacturer?.name),1)]),e("td",ae,[e("div",ie,d(t?.supplier?.name),1)]),e("td",de,[e("button",{onClick:Be=>x(!1,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"},"Edit",8,ue)])]))),128))])])])])]),v(" AnaltsisProfile Form Modal "),n(u)?(r(),j(n(U),{key:0,onClose:o[8]||(o[8]=t=>L(u)?u.value=!1:u=!1)},{header:k(()=>[e("h3",null,d(n(w)),1)]),body:k(()=>[e("form",ce,[e("div",pe,[e("label",me,[_e,c(e("input",{class:"form-input mt-1 block w-full","onUpdate:modelValue":o[1]||(o[1]=t=>n(s).name=t),placeholder:"Name ..."},null,512),[[f,n(s).name]])]),e("label",be,[ye,c(e("input",{class:"form-input mt-1 block w-full","onUpdate:modelValue":o[2]||(o[2]=t=>n(s).keyword=t),placeholder:"Keyword ..."},null,512),[[f,n(s).keyword]])]),e("label",fe,[he,e("div",ge,[c(e("select",{class:"form-select mt-1 w-full","onUpdate:modelValue":o[3]||(o[3]=t=>n(s).instrumentTypeUid=t)},[we,(r(!0),a(p,null,b(n(I),t=>(r(),a("option",{key:t?.uid,value:t.uid},d(t?.name),9,xe))),128))],512),[[h,n(s).instrumentTypeUid]])])]),e("label",ve,[ke,e("div",Ue,[c(e("select",{class:"form-select mt-1 w-full","onUpdate:modelValue":o[4]||(o[4]=t=>n(s).manufacturerUid=t)},[Ie,(r(!0),a(p,null,b(n(S),t=>(r(),a("option",{key:t?.uid,value:t.uid},d(t?.name),9,Te))),128))],512),[[h,n(s).manufacturerUid]])])]),e("label",Se,[Me,e("div",Ee,[c(e("select",{class:"form-select mt-1 w-full","onUpdate:modelValue":o[5]||(o[5]=t=>n(s).supplierUid=t)},[Ne,(r(!0),a(p,null,b(n(M),t=>(r(),a("option",{key:t?.uid,value:t.uid},d(t?.name),9,Ae))),128))],512),[[h,n(s).supplierUid]])])]),e("label",Ce,[De,c(e("textarea",{cols:"2",class:"form-input mt-1 block w-full","onUpdate:modelValue":o[6]||(o[6]=t=>n(s).description=t),placeholder:"Description ..."},null,512),[[f,n(s).description]])])]),Ve,e("button",{type:"button",onClick:o[7]||(o[7]=G(t=>A(),["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})):v("v-if",!0)],64))}}),Pe=O(Fe,[["__file","/home/aurthurm/Development/felicity-lims/webapp/views/admin/instruments/Instruments.vue"]]);export{Pe as default};
|