import{_ as D,R as U,az as I,aA as O,Y as V,f as c,b as j,E as z,r as p,o as m,c as k,a as t,w as a,G as Y,h as H,l as i,t as s,i as N,k as S,M as G,j as q,ay as F,aB as J,aC as R,q as T,aM as K,aD as Q,be as W,J as X,aG as Z}from"./app-DyK1k-lL.js";import{h as $}from"./hrmManagement-2iw22uhk.js";import{A as ee}from"./AdminPageHeader-DvckKcMF.js";import{L as ae}from"./LeaveSidebar-EMlOD5ZD.js";import"./index-IxYN3YHr.js";import"./TabletOutlined-BSmxn9lp.js";import"./UnderlineOutlined-CWU6djax.js";import"./ScheduleOutlined-BgXa0dBI.js";import"./FundViewOutlined-fZiHFEV8.js";const te={components:{PlusOutlined:U,EditOutlined:I,DeleteOutlined:O,AdminPageHeader:ee,LeaveSidebar:ae},setup(){const{t:o}=V(),{getMonthNameByNumber:d}=$(),w=[{title:o("leave.leave_type"),dataIndex:"name"},{title:o("menu.unpaid_leaves"),dataIndex:"unpaid_leaves"}],e=c([]),f=c(!0),{dayjs:A,user:b,permsArray:x}=j(),r=c({year:A(),user_id:void 0}),g=c([]),h=c([]),M="users?limit=10000";z(()=>{const u=axiosAdmin.get(M);Promise.all([u]).then(([_])=>{h.value=_.data,r.value={...r.value,user_id:b.value.xid},l()})});const l=()=>{f.value=!0;var u=r.value.year.format("YYYY");axiosAdmin.get(`leaves/unpaid-leaves?year=${u}&user_id=${r.value.user_id}`).then(_=>{e.value=_.data.data,g.value=_.data.month_year,f.value=!1})};return{columns:w,unpaidLeaves:e,filters:r,getMonthNameByNumber:d,selectedYearStartEndMonths:g,tableLoading:f,setUrlData:l,allUsers:h,permsArray:x}}},ne={class:"table-responsive"};function oe(o,d,w,e,f,A){const b=F,x=p("router-link"),r=J,g=R,h=p("AdminPageHeader"),M=p("LeaveSidebar"),l=T,u=K,_=Z,B=Q,C=W,y=H,E=p("admin-page-filters"),L=X,P=p("admin-page-table-content");return m(),k(Y,null,[t(h,null,{header:a(()=>[t(b,{title:o.$t("menu.leave_types"),class:"p-0"},null,8,["title"])]),breadcrumb:a(()=>[t(g,{separator:"-",style:{"font-size":"12px"}},{default:a(()=>[t(r,null,{default:a(()=>[t(x,{to:{name:"admin.dashboard.index"}},{default:a(()=>[i(s(o.$t("menu.dashboard")),1)]),_:1},8,["to"])]),_:1}),t(r,null,{default:a(()=>[i(s(o.$t("menu.hrm")),1)]),_:1}),t(r,null,{default:a(()=>[i(s(o.$t("menu.unpaid_leaves")),1)]),_:1})]),_:1})]),_:1}),t(y,null,{default:a(()=>[t(l,{xs:24,sm:24,md:24,lg:4,xl:4,class:"bg-setting-sidebar"},{default:a(()=>[t(M)]),_:1}),t(l,{xs:24,sm:24,md:24,lg:20,xl:20},{default:a(()=>[t(E,null,{default:a(()=>[t(y,{gutter:[16,16],align:"middle"},{default:a(()=>[t(l,{xs:24,sm:24,md:12,lg:10,xl:10},{default:a(()=>[e.selectedYearStartEndMonths&&e.selectedYearStartEndMonths.start_month?(m(),N(u,{key:0,strong:""},{default:a(()=>[i(s(e.getMonthNameByNumber(e.selectedYearStartEndMonths.start_month))+" "+s(e.selectedYearStartEndMonths.start_year)+" - "+s(e.getMonthNameByNumber(e.selectedYearStartEndMonths.end_month))+" "+s(e.selectedYearStartEndMonths.end_year),1)]),_:1})):S("",!0)]),_:1}),t(l,{xs:24,sm:24,md:12,lg:14,xl:14},{default:a(()=>[t(y,{gutter:[16,16],justify:"end"},{default:a(()=>[e.permsArray.includes("admin")||e.permsArray.includes("leaves_assign_to_all")?(m(),N(l,{key:0,xs:24,sm:24,md:12,lg:6,xl:6},{default:a(()=>[t(B,{value:e.filters.user_id,"onUpdate:value":d[0]||(d[0]=n=>e.filters.user_id=n),onChange:e.setUrlData,"show-search":"",style:{width:"100%"},placeholder:o.$t("common.select_default_text",[o.$t("leave.user")])},{default:a(()=>[(m(!0),k(Y,null,G(e.allUsers,n=>(m(),N(_,{key:n.xid,value:n.xid,title:n.name},{default:a(()=>[i(s(n.name),1)]),_:2},1032,["value","title"]))),128))]),_:1},8,["value","onChange","placeholder"])]),_:1})):S("",!0),t(l,{xs:24,sm:24,md:12,lg:12,xl:8},{default:a(()=>[t(C,{value:e.filters.year,"onUpdate:value":d[1]||(d[1]=n=>e.filters.year=n),placeholder:o.$t("common.select_default_text",[o.$t("holiday.year")]),picker:"year",onChange:e.setUrlData,style:{width:"100%"}},null,8,["value","placeholder","onChange"])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}),t(P,null,{default:a(()=>[t(y,null,{default:a(()=>[t(l,{span:24},{default:a(()=>[q("div",ne,[t(L,{"row-selection":{getCheckboxProps:n=>({disabled:!1,name:n.xid})},columns:e.columns,"row-key":n=>n.month,"data-source":e.unpaidLeaves,pagination:!1,loading:e.tableLoading,bordered:"",size:"middle"},{bodyCell:a(({column:n,record:v})=>[n.dataIndex=="name"?(m(),k(Y,{key:0},[i(s(v.month?e.getMonthNameByNumber(v.month):"")+" "+s(v.year?v.year:""),1)],64)):S("",!0)]),_:1},8,["row-selection","columns","row-key","data-source","loading"])])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})],64)}const pe=D(te,[["render",oe]]);export{pe as default};
