hrms-manual/dist/assets/Main-7c2ac95d.js

2 lines
22 KiB
JavaScript
Raw Normal View History

2023-09-06 14:51:44 +07:00
import{Q as ge}from"./QTab-3e1855a2.js";import{Q as _e}from"./QTabs-95f81e84.js";import{d as me,a as d,w as pe,ab as ie,e as c,s as B,j as r,g as a,C as U,ac as Q,a2 as J,m as y,A as u,f as p,aj as C,D as k,a4 as R,v as $,ah as ve,ao as we,ag as z,o as he,F as te,i as ce,at as xe,au as Ve,ai as ke}from"./index-3a2b6cd5.js";import{Q as A}from"./QSelect-809bd0f2.js";import{Q as ne}from"./QTooltip-5ceb1b84.js";import{Q as se}from"./QSpace-5fefe78e.js";import{Q as Y}from"./QTd-71639d11.js";import{u as ye}from"./mixin-183f301b.js";import{c as q}from"./app.config-a8647d06.js";import{u as fe}from"./storeAllocate-51f623ce.js";import{Q as Ie}from"./QToolbarTitle-e2e05c30.js";import{Q as $e}from"./QToolbar-ccd30184.js";import{Q as Ce}from"./QForm-4d87c0ee.js";import{u as be}from"./use-quasar-1e7f9a8b.js";import"./QResizeObserver-889eb2e3.js";import"./rtl-36dd996b.js";import"./QChip-f43cc21c.js";import"./QItemSection-843d83e6.js";import"./QItemLabel-37c56e27.js";import"./QMenu-59199f2b.js";import"./position-engine-4e9b318c.js";import"./selection-8094913b.js";import"./format-312d1398.js";import"./QSpinnerCube-b3e27bc1.js";import"./index-932e35b0.js";const ze={class:"q-pa-md"},qe={class:"row col-12 items-center q-col-gutter-x-xs q-col-gutter-y-xs"},De={key:0,class:"row col-12 q-col-gutter-x-xs q-col-gutter-y-xs"},Te={class:"col-6"},Oe=u("div",{class:"col-12 text-weight-bold text-grey"}," ข้อมูลผู้ยืม ",-1),Qe={class:"col-xs-12 col-sm-6"},Re={class:"col-xs-6 col-sm-6"},Ue={class:"col-12 q-my-xs"},Ae=u("div",{class:"col-12 text-weight-bold text-grey"}," รายละเอียดการยืมเครื่องราชฯ ",-1),Pe={class:"col-xs-12 col-sm-6"},Se={class:"col-xs-12 col-sm-6"},Fe={class:"col-xs-12 col-sm-6"},Ne={key:1,class:"row col-12 q-col-gutter-x-xs q-col-gutter-y-xs"},Be={class:"col-12 q-my-xs"},Le=u("div",{class:"col-12 text-weight-bold text-grey"}," รายละเอียดการคืนเครื่องราชฯ ",-1),Me={class:"col-xs-12 col-sm-6"},Ee={class:"col-xs-12 col-sm-6"},je={class:"col-12"},Ke={class:"q-pa-md"},Ye={class:"row justify-end"},Ge=me({__name:"DialogForm",props:{modal:Boolean,save:{type:Function,default:()=>console.log("not function")},close:{type:Function,default:()=>console.log("not function")},closeAndFecth:{type:Function,default:()=>console.log("not function")},roundId:{type:String},action:{type:String},typeId:{type:String},selectRoundOption:{type:Array},profileId:{type:String,default:""}},setup(P){const s=P;fe();const g=be(),L=d(),re=ye(),{date2Thai:W,dialogConfirm:le,success:X,messageError:M,showLoader:D,hideLoader:f,notifyError:S}=re,T=d(""),h=d(""),_=d(""),w=d(""),F=d(""),I=d(),x=d(),E=d(""),Z=d([]),G=d([]),b=d(""),V=()=>{I.value=null,x.value=null,w.value="",h.value="",_.value="",F.value="",T.value="",E.value=""};pe(s,()=>{s.modal==!0&&s.roundId!="all"&&(h.value=s.roundId,ee(),ae(),s.action=="editData"&&N())});const ee=async()=>{D();let m={insigniaTypeId:s.typeId,insigniaNoteId:s.roundId,insigniaId:""};await z.post(q.API.noteSearch(),m).then(n=>{Z.value=n.data.result}).catch(n=>{M(g,n)}).finally(()=>{f()})},ae=async()=>{D(),await z.get(q.API.typeOc()).then(async m=>{G.value=m.data.result.map(n=>({id:n.organizationId,name:n.organizationName}))}).catch(m=>{M(g,m)}).finally(()=>{f()})},N=async()=>{D(),await z.get(q.API.insigniaManageBorrowById(s.profileId)).then(async m=>{console.log(m.data.result)}).catch(m=>{M(g,m)}).finally(()=>{f()})},H=async()=>{await L.value.validate().then(m=>{m&&le(g,async()=>{s.action=="addData"?await z.post(q.API.insigniaManageBorrow(),{borrowDate:I.value,borrowOrganizationId:w.value,insigniaNoteProfileId:b.value}).then(()=>{X(g,"บันทึกข้อมูลสำเร็จ")}).catch(n=>{M(g,n)}).finally(()=>{V(),s.closeAndFecth()}):await z.put(q.API.insigniaManageBorrowReturn(s.profileId),{returnDate:x.value,returnOrganizationId:w.value,returnReason:E.value}).then(()=>{X(g,"บันทึกข้อมูลสำเร็จ")}).catch(n=>{M(g,n)}).finally(()=>{V(),s.closeAndFecth()})})})},j=asyn