import{o as k,c as C,b as l,a,z as J,av as M,q as T,ax as V,F as $,r as o}from"./vendor-BDR7yMJi.js";import{u as F,S as N,s,a as P}from"./index-BSaHX2oa.js";import{_ as S}from"./DataGrid-DbeHIyBR.js";import"./useAgGridConfig-DxO2r97K.js";const j={class:"flex min-w-full flex-col lg:flex-row lg:items-center gap-2 p-4"},R={class:"btns flex items-center gap-2 lg:w-1/4 lg:justify-start lg:ml-0"},B={class:"p-4"},G={class:"grid grid-cols-1 md:grid-cols-3 gap-4"},D={style:{height:"calc(100vh - 180px)",width:"100%"}},U={__name:"PaieJoursTravailleesMois",setup(I){const{showError:p,showWarn:d,showInfo:m}=F(),u=o(),v=o(null),n=o([]),f=o(),g=o(),r=o(1),b=[{label:"Calcul de la paie",value:1},{label:"Pointage",value:2}],_=({event:t,data:e})=>{v.value=e},h=t=>{g.value=t.api},y=async()=>{s.state.afficher_in_progress=!0;try{const t=await P.post(`${s.lienApi}/JoursTravailleAnnuelle/${s.db}`,{Annee:s.state.annee_fiscale,TypeCalcul:r.value,NbHeuresJour:s.state.enreg_option_paie.nbhj},{headers:{"Content-Type":"application/json"}});n.value=t.data}catch(t){p(`Une erreur est survenue lors du chargement des données: ${t}`)}finally{s.state.afficher_in_progress=!1}},x=()=>{if(!n.value||n.value.length===0){d("Aucune donnée à imprimer. Veuillez d'abord afficher les données.");return}m("Fonction d'impression à implémenter")};return(t,e)=>{const c=J,w=M,A=V;return k(),C($,null,[l("div",j,[l("div",R,[a(c,{icon:"pi pi-refresh",label:"Afficher",text:"",onClick:y}),a(c,{icon:"pi pi-cog",label:"Actions",text:"",onClick:e[0]||(e[0]=i=>u.value.toggle(i))}),a(w,{ref_key:"actionsMenu",ref:u,model:[{label:"Imprimer",icon:"pi pi-print",command:()=>x()}],popup:!0},null,8,["model"]),a(c,{icon:"pi pi-times",label:"Fermer",text:"",onClick:e[1]||(e[1]=i=>T(N)("PaieJoursTravailleesMois"))})])]),l("div",B,[l("div",G,[l("div",null,[e[3]||(e[3]=l("label",{class:"block text-sm font-medium text-gray-700 mb-1"},"Type de calcul",-1)),a(A,{modelValue:r.value,"onUpdate:modelValue":e[2]||(e[2]=i=>r.value=i),options:b,optionLabel:"label",optionValue:"value",placeholder:"Sélectionner le type",class:"w-full"},null,8,["modelValue"])])])]),e[4]||(e[4]=l("div",{class:"h-2"},null,-1)),l("div",D,[a(S,{ref_key:"dataGrid",ref:f,"excel-file-name":"Paie jours travaillees mois","excel-sheet-name":"Paie jours travaillees mois","row-data":n.value,"numeric-columns":["Janvier","Fevrier","Mars","Avril","Mai","Juin","Juillet","Aout","Septembre","Octobre","Novembre","Decembre"],"date-columns":["datee"],"date-only":["datee"],"column-widths":{Matricule:140,Nom:140,Prenom:140,cin:140,cnss:140,datee:150,Janvier:100,Fevrier:100,Mars:100,Avril:100,Mai:100,Juin:100,Juillet:100,Aout:100,Septembre:100,Octobre:100,Novembre:100,Decembre:100},"grid-style":"height: calc(100vh - 240px); width: 100%",onRowClicked:_,onGridReady:h},null,8,["row-data"])])],64)}}};export{U as default};
