import{r as s,x as U,e as d,E as j,o as h,c as L,f as l,h as r,i as g,m as q,y as _,k as V,M as E,n as $,G as y,J as z,H as A,K as G,v as H}from"./index-C1_1_QXk.js";import{a as I,s as J}from"./attendance-Di9IcRbk.js";const K=["onClick"],R={style:{padding:"20px"}},W={__name:"attendance",props:["data","addVisible"],emits:["changeVisible","tableData"],setup(C,{emit:w}){const{proxy:x}=H(),c=s([]),p=s(!1),u=s(0),v=s([]),f=x.$route.query,n=C,D=w,i=s({page:1,limit:10,projectid:n.data.pro_id,idno:n.data.id_no,month:n.data.belong_date}),k=a=>{n.data.type!="view"};function b(){p.value=!0,I(i.value).then(a=>{v.value=a.data,u.value=a.count,p.value=!1})}function O(){J({idno:n.data.id_no,proid:n.data.pro_id,month:n.data.belong_date}).then(a=>{a.data.datas=a.data.datas||[],c.value=a.data.datas.map(t=>t.days)})}b(),O();const m=U({get:()=>n.addVisible,set:a=>D("changeVisible",a)});return(a,t)=>{const B=d("el-calendar"),o=d("el-table-column"),M=d("el-table"),N=d("pagination"),P=d("el-dialog"),S=j("loading");return h(),L("div",null,[l(P,{title:"打卡天数",modelValue:g(m),"onUpdate:modelValue":t[3]||(t[3]=e=>G(m)?m.value=e:null),width:"1200px",onOpen:a.dialogOpen,onClose:a.dialogClose,"custom-class":"dialogClass"},{default:r(()=>[l(B,{class:"text_calendar",modelValue:g(f).month,"onUpdate:modelValue":t[0]||(t[0]=e=>g(f).month=e)},{header:r(({date:e})=>[q(_(e),1)]),"date-cell":r(({data:e})=>[V("p",{class:E(c.value.includes(e.day)?"is-selected calendar_item":"calendar_item"),onClick:$(T=>k(e),["stop"])},_(e.day.split("-").slice(1).join("-"))+" "+_(c.value.includes(e.day)?"✔️":""),11,K)]),_:1},8,["modelValue"]),V("div",R,[y((h(),z(M,{data:v.value},{default:r(()=>[l(o,{label:"姓名",align:"center",prop:"name"}),l(o,{label:"证件号码",align:"left",prop:"idNo",width:"180"}),l(o,{label:"所属项目",align:"left",prop:"project"}),l(o,{label:"厂商",align:"left",prop:"manufacturer"}),l(o,{label:"上班天数",align:"left",prop:"amountDay"}),l(o,{label:"打卡次数",align:"center",prop:"amount"}),l(o,{label:"增长额度",align:"center",prop:"increaseAmount",width:"280"})]),_:1},8,["data"])),[[S,p.value]]),y(l(N,{total:u.value,page:i.value.page,"onUpdate:page":t[1]||(t[1]=e=>i.value.page=e),limit:i.value.limit,"onUpdate:limit":t[2]||(t[2]=e=>i.value.limit=e),onPagination:b},null,8,["total","page","limit"]),[[A,u.value>0]])])]),_:1},8,["modelValue","onOpen","onClose"])])}}};export{W as default};
