import{r as a,a9 as e,ar as t,cY as l,cV as s,aa as u,f as r,g as v,h as n,w as d,z as o,o as _,i,a as c,j as f,t as m,k as p,l as b,F as g,_ as h,y as k,a8 as y,O as w}from"./index-WeUkftbp.js";import{_ as Y}from"./uni-icons.B3nCnuXe.js";import{_ as j}from"./uni-nav-bar.cBITQXNK.js";import{_ as x}from"./empty.9XRZTjWt.js";import{h as M}from"./moment.BD7_iMEL.js";import{_ as D}from"./_plugin-vue_export-helper.BCo6x5W8.js";/* empty css                                                                  *//* empty css                                                                    */const $=D({__name:"userVacationList",setup(D){let $=a(`${(new Date).getFullYear()}-${(new Date).getMonth()+1} `),C=a(`${(new Date).getFullYear()}-${(new Date).getMonth()+1} `);a((new Date).getMonth()+1);let F=a(0),z=a(1),L=a(20);const V=a(!0),I=a([{label:"全部",value:0}]),N=a([]);let O=a(0),Q=a(0),S=a(""),W=a();e((a=>{switch(a.user_id&&(O.value=a.user_id,W.value=a.user_name,t({title:W.value})),Q.value=a.status,a.status){case"-1":S.value="补卡",F.value=1;break;case"-2":S.value="出差",F.value=2;break;case"-3":S.value="外出",F.value=3;break;case"1":S.value="事假",F.value=4;break;case"2":S.value="年假",F.value=5;break;case"3":S.value="调休假",F.value=6;break;case"4":S.value="产假",F.value=7;break;case"5":S.value="陪产假",F.value=8;break;case"6":S.value="病假",F.value=9;break;case"7":S.value="丧假",F.value=10;break;case"8":S.value="婚假",F.value=11}A(),q()}));const Z=a=>{C.value=a.detail.value,q()},q=()=>{C.value=M(C.value).format("YYYY-MM");let a={date:C.value,status:F.value,user_id:O.value,page:z.value,limit:L.value};l(a).then((a=>{N.value=a.data,a.data.length<L.value&&(V.value=!1)}))},A=()=>{C.value=M(C.value).format("YYYY-MM");let a={date:C.value,type:1,user_id:O.value};s(a).then((a=>{let e;e=a.data.leave_statistics.map((a=>({label:a.name,value:a.status}))),I.value=[...I.value,...e]}))},B=a=>{let e;return I.value.map((t=>{t.value==a&&(e=t.label)})),e},E=()=>{h()};return u((()=>{V.value&&(z.value++,q())})),(a,e)=>{const t=o,l=k,s=r(v("uni-icons"),Y),u=y,h=r(v("uni-nav-bar"),j),M=w;return _(),n(t,{class:"nav"},{default:d((()=>[i(h,{fixed:!0,"left-icon":"left","status-bar":"",backgroundColor:"rgba(255,255,255,1)",color:"#303133",border:!1,onClickLeft:E},{right:d((()=>[i(t,{class:"bar-right"},{default:d((()=>[i(u,{ref:"picker",mode:"date",fields:"month",value:c(C),start:"2021-01",end:c($),onChange:Z},{default:d((()=>[i(l,{class:"uni-nav-bar-text"},{default:d((()=>[i(l,{class:"month"},{default:d((()=>[f(m(c(C)),1)])),_:1}),i(s,{type:"arrowdown",color:"#606266",size:"12"})])),_:1})])),_:1},8,["value","end"])])),_:1})])),default:d((()=>[i(t,{class:"nav-content"},{default:d((()=>[i(t,{class:"title"},{default:d((()=>[i(t,{class:"head-title"},{default:d((()=>[f(m(c(W)),1)])),_:1}),i(l,null,{default:d((()=>[f("的假勤明细")])),_:1})])),_:1})])),_:1})])),_:1}),c(N).length>0?(_(),n(t,{key:0,class:"card"},{default:d((()=>[i(t,{class:"table-list"},{default:d((()=>[(_(!0),p(g,null,b(c(N),((a,e)=>(_(),n(t,{class:"item",key:e},{default:d((()=>[i(t,{class:"num"},{default:d((()=>[f(m(a.date),1)])),_:2},1024),i(t,{class:"msg"},{default:d((()=>[(_(!0),p(g,null,b(a.details,((e,l)=>(_(),n(t,{class:"msg-item",key:l},{default:d((()=>[f(m(0==e.work_type?"上班":1==e.work_type?"下班":"")+m(-1==e.status?"补卡":B(e.status))+m(e.work_hours)+m(-1==e.status?"次":"day"==e.time_type?"天":"hour"==e.time_type?"小时":"")+" "+m(l!=a.details.length-1&&l<a.details.length?",":""),1)])),_:2},1024)))),128))])),_:2},1024)])),_:2},1024)))),128))])),_:1})])),_:1})):(_(),n(t,{key:1,class:"default"},{default:d((()=>[i(M,{src:x,mode:""}),i(t,{class:"text"},{default:d((()=>[f("暂无假勤明细～")])),_:1})])),_:1}))])),_:1})}}},[["__scopeId","data-v-e172d884"]]);export{$ as default};
