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-CgV11GBz.js";import{h as V}from"./hrmManagement-DSu-pZ5D.js";import{A as j,B as H,a as z,_ as F}from"./AdminPageHeader-BbLazqh2.js";import{D as q}from"./DeleteOutlined-CzplmvFG.js";import{E as G}from"./EditOutlined-CDoHc2FT.js";import{P as J}from"./index-B7-RTJOc.js";import{T as K}from"./Text-BEWt5-6S.js";import{S as Q,a as R}from"./index-GcUTOa9d.js";import{D as W}from"./dayjs-1hJdMHbK.js";import{_ as X,a as Z}from"./index-CyQQxPex.js";import{_ as $}from"./index-vRSySr5e.js";import"./dropdown-C8TPWlvJ.js";import"./useFlexGapSupport-CWWB0EO1.js";import"./move-DC4W0EQt.js";import"./index-BnFAf-Nu.js";import"./transButton-BBsxYOSm.js";import"./useDestroyed-DU9zWypE.js";import"./index-4wtx7HnJ.js";import"./index-MBDGOAKp.js";import"./Base-CoAoxKFd.js";import"./TextArea-CiAld6jk.js";import"./pickAttrs-6g5FyZe9.js";import"./index-CJx7RGCD.js";import"./index-BiYulQUu.js";import"./index-Oi0DGWnW.js";import"./CalendarOutlined-DlxTbIcy.js";import"./index-E6lmxuug.js";import"./index-DtCc1bFm.js";import"./index-DEQO-jTQ.js";import"./Checkbox-tUwuA94o.js";import"./index-DFoCNTvZ.js";import"./RadioButton-BPv4-qI8.js";import"./MinusSquareOutlined-Cd4pIAZ_.js";import"./FolderOpenOutlined-5lmK0J8L.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};
