import{_ as D,c as M,g as a,w as t,b as y,i,t as r,e as w,h as N,F as Y,j as L,f as U,u as I,k as c,a as O,T,o as _}from"./app-D7zH3Nl5.js";import{h as V}from"./hrmManagement-B9P5L2Nz.js";import{A as j,B as H,a as z,_ as F}from"./AdminPageHeader-4nW0e2pw.js";import{D as q}from"./DeleteOutlined-DI2CK1gU.js";import{E as G}from"./EditOutlined-Corvrvzt.js";import{P as J}from"./index-BUzTR6QN.js";import{T as K}from"./Text-BYGZwHPp.js";import{S as Q,a as R}from"./index-DnrvHM6n.js";import{D as W}from"./dayjs-Bh5BavPT.js";import{_ as X,a as Z}from"./index-Cv7zOydE.js";import{_ as $}from"./index-Bso6TOMG.js";import"./dropdown-C-HKHQ-f.js";import"./useFlexGapSupport-CpBR-RD-.js";import"./move-DTmUXir3.js";import"./index-BUQyFFfI.js";import"./transButton--XrRgMTg.js";import"./useDestroyed-B0Qhtgc6.js";import"./index-_ApNSgqk.js";import"./index-B1-dW-7G.js";import"./Base-Dri4L_EE.js";import"./TextArea-C1mL3q5m.js";import"./pickAttrs-1XPwZpL6.js";import"./index-Cu62pBdq.js";import"./index-DzAtlijK.js";import"./index-ClJ_H-9Y.js";import"./CalendarOutlined-m89BWwmS.js";import"./index-Q5rqE8AL.js";import"./index-DTmsoxos.js";import"./index-DkTJbm8y.js";import"./Checkbox-BT3Ug64z.js";import"./index-twmpq7Gp.js";import"./RadioButton-BeQscLER.js";import"./MinusSquareOutlined-CjNBof4X.js";import"./FolderOpenOutlined-tH0_VpKZ.js";const ee={components:{PlusOutlined:J,EditOutlined:G,DeleteOutlined:q,AdminPageHeader:j},setup(){const{t:o}=I(),{getMonthNameByNumber:m}=V(),S=[{title:o("common.month"),dataIndex:"month"},{title:o("menu.unpaid_leaves"),dataIndex:"unpaid_leaves"}],e=c([]),p=c(!0),{dayjs:B,user:v,permsArray:b}=O(),l=c({year:B(),user_id:void 0}),f=c([]),h=c([]),x="users?limit=10000";T(()=>{const u=axiosAdmin.get(x);Promise.all([u]).then(([d])=>{h.value=d.data,l.value={...l.value,user_id:v.value.xid},s()})});const s=()=>{p.value=!0;var u=l.value.year.format("YYYY");axiosAdmin.get(`leaves/unpaid-leaves?year=${u}&user_id=${l.value.user_id}`).then(d=>{e.value=d.data.data,f.value=d.data.month_year,p.value=!1})};return{columns:S,unpaidLeaves:e,filters:l,getMonthNameByNumber:m,selectedYearStartEndMonths:f,tableLoading:p,setUrlData:s,allUsers:h,permsArray:b}}},te={class:"table-responsive"};function ae(o,m,S,e,p,B){const v=F,b=y("router-link"),l=z,f=H,h=y("AdminPageHeader"),x=K,s=Z,u=R,d=Q,C=W,k=X,E=y("admin-page-filters"),A=$,P=y("admin-page-table-content");return _(),M(Y,null,[a(h,null,{header:t(()=>[a(v,{title:o.$t("menu.unpaid_leaves"),class:"p-0"},null,8,["title"])]),breadcrumb:t(()=>[a(f,{separator:"-",style:{"font-size":"12px"}},{default:t(()=>[a(l,null,{default:t(()=>[a(b,{to:{name:"admin.dashboard.index"}},{default:t(()=>[i(r(o.$t("menu.dashboard")),1)]),_:1})]),_:1}),a(l,null,{default:t(()=>[i(r(o.$t("menu.leaves")),1)]),_:1}),a(l,null,{default:t(()=>[i(r(o.$t("menu.unpaid_leaves")),1)]),_:1})]),_:1})]),_:1}),a(E,null,{default:t(()=>[a(k,{gutter:[16,16],align:"middle"},{default:t(()=>[a(s,{xs:24,sm:24,md:12,lg:10,xl:10},{default:t(()=>[e.selectedYearStartEndMonths&&e.selectedYearStartEndMonths.start_month?(_(),w(x,{key:0,strong:""},{default:t(()=>[i(r(e.getMonthNameByNumber(e.selectedYearStartEndMonths.start_month))+" "+r(e.selectedYearStartEndMonths.start_year)+" - "+r(e.getMonthNameByNumber(e.selectedYearStartEndMonths.end_month))+" "+r(e.selectedYearStartEndMonths.end_year),1)]),_:1})):N("",!0)]),_:1}),a(s,{xs:24,sm:24,md:12,lg:14,xl:14},{default:t(()=>[a(k,{gutter:[16,16],justify:"end"},{default:t(()=>[e.permsArray.includes("admin")||e.permsArray.includes("leaves_view")?(_(),w(s,{key:0,xs:24,sm:24,md:12,lg:6,xl:6},{default:t(()=>[a(d,{value:e.filters.user_id,"onUpdate:value":m[0]||(m[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:t(()=>[(_(!0),M(Y,null,L(e.allUsers,n=>(_(),w(u,{key:n.xid,value:n.xid,title:n.name},{default:t(()=>[i(r(n.name),1)]),_:2},1032,["value","title"]))),128))]),_:1},8,["value","onChange","placeholder"])]),_:1})):N("",!0),a(s,{xs:24,sm:24,md:12,lg:12,xl:8},{default:t(()=>[a(C,{value:e.filters.year,"onUpdate:value":m[1]||(m[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%"},allowClear:!1},null,8,["value","placeholder","onChange"])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}),a(P,null,{default:t(()=>[a(k,null,{default:t(()=>[a(s,{span:24},{default:t(()=>[U("div",te,[a(A,{"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:t(({column:n,record:g})=>[n.dataIndex=="month"?(_(),M(Y,{key:0},[i(r(g.month?e.getMonthNameByNumber(g.month):"")+" "+r(g.year?g.year:""),1)],64)):N("",!0)]),_:1},8,["row-selection","columns","row-key","data-source","loading"])])]),_:1})]),_:1})]),_:1})],64)}const Oe=D(ee,[["render",ae]]);export{Oe as default};
