mirror of
https://github.com/beak-insights/felicity-lims.git
synced 2025-02-24 17:02:55 +08:00
2 lines
6.6 KiB
JavaScript
2 lines
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 durat
|