@studio-west/employees 0.6.36 → 0.6.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- "use strict";const e=require("vue"),de=require("file-saver"),se=require("exceljs"),c=require("./index-Dn3djtwj.cjs"),ve=require("vue-i18n"),i=require("element-plus"),G=require("@imengyu/vue3-context-menu");function ce(k){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(k){for(const V in k)if(V!=="default"){const v=Object.getOwnPropertyDescriptor(k,V);Object.defineProperty(r,V,v.get?v:{enumerable:!0,get:()=>k[V]})}}return r.default=k,Object.freeze(r)}const ge=ce(se),me={class:"work"},he={class:"nav"},fe={style:{height:"100px",width:"100%",display:"inline-block"}},pe={style:{height:"100px",width:"100%",display:"inline-block"}},ye={key:0,class:"controls-container",style:{"margin-top":".5rem"}},we={key:0,style:{padding:"0.5em 1.5em"}},ke={key:1,style:{padding:"0.5em 1.5em"}},Ce={__name:"WorkTable",props:{checkEdit:{type:Boolean,default:()=>!0},odata:Object,workSchedule:Object,fullName:{type:String,default:"Вы"},group:String,date:String},setup(k){const{t:r,d:V}=ve.useI18n(),v=k,F=e.ref(!1),n=e.ref([]),R=e.ref(v.date?new Date(v.date+"T00:00:01").getMonth():new Date().getMonth()),j=e.ref(!1),B=e.ref([]),f=e.ref(new Date(new Date().getFullYear(),new Date().getMonth(),1)),u=e.ref([]),T=e.ref(0),p=e.ref(9),m=e.ref(8),I=e.ref(!1),J=e.ref(!0),$=e.ref(!1),q=e.ref("5"),M=e.ref(1),C=e.ref(""),O=e.ref([]),b=e.ref([]),Y=e.ref([]),g=e.ref({name:"Имя",length:0,code:""}),U=e.ref(!1),P=e.ref({zIndex:3,minWidth:230,x:500,y:200}),Z=e.ref({}),A=e.ref("100%");e.watch(C,async(a,l)=>{a!==l&&(b.value=[],I.value=!1,v.odata.personal.forEach(o=>{o.divisionName===a&&(b.value.some(d=>(d==null?void 0:d.activeText)===o.roleName)||b.value.push({val:!0,activeText:o.roleName}))}),X())}),e.watch(R,async a=>{let l=new Date().getMonth(),o=a===null?l:a-1;o=l-1<=o?o:o+12,console.log("currentMonth",o),f.value=new Date(new Date().getFullYear(),o,1),K()});const ee=(a,l,o,d)=>{g.value.ids=a.ids,g.value.key=a.key,g.value.add=a.days.length>0&&a.days[a.days.length-1].cont,g.value.level=l.level,g.value.day=o.cellIndex,P.value.y=d.clientY,P.value.x=d.clientX,l.level===2&&l.no===0&&v.checkEdit&&(g.value.name=r("workSchedule.autocomplete"),U.value=!0),l.level===3&&o.cellIndex-l.no===1&&v.checkEdit&&(D(o.cellIndex,a.ids),g.value.name=r("workSchedule.modeSelection"),U.value=!0)},le=({row:a,columnIndex:l})=>{if(!B.value||B.value.length===0||!j.value)return"";const o=new Date(new Date(f.value).getFullYear(),new Date(f.value).getMonth(),l).getTime()+1e3;for(let d of B.value){const{dateStart:t,dateEnd:h,code:S}=d;if(t&&h&&S===a.code&&l!==0&&l<=u.value.length){const N=new Date(c.parseDate(t)).getTime(),E=new Date(c.parseDate(h)).getTime();if(o>=N&&o<=E)return"vacation"}}return""},K=()=>{var h,S,N,E;const a=Z.value,l=new Date(f.value),o=new Date(l.getFullYear(),l.getMonth()+1,0).getDate();let d=[],t=0;for(let x=1;x<=o;x++){const s=c.parseTime(l.setDate(x),"{Y}-{m}-{dd}");t+=(h=a.nowork)!=null&&h.includes(s)||a.holidays.includes(s)?0:(S=a.preholidays)!=null&&S.includes(s)?7:8;const y=(N=a.nowork)!=null&&N.includes(s)?"nowork":a.holidays.includes(s)?"holiday":(E=a.preholidays)!=null&&E.includes(s)?"preholiday":"";d.push({day:x,holidays:y,weekday:V(new Date(l.getFullYear(),l.getMonth(),x),"day")})}T.value=t,u.value=d,v.odata.getPersonal({}).then(x=>{var s;C.value.length===0&&(C.value=(s=x.find(y=>y.employeeName===v.fullName))==null?void 0:s.divisionName),x.forEach((y,W)=>{O.value.some(w=>(w==null?void 0:w.value)===y.divisionName)||O.value.push({value:y.divisionName,label:y.divisionName,key:W}),y.divisionName===C.value&&!b.value.some(w=>(w==null?void 0:w.activeText)===y.roleName)&&b.value.push({val:!0,activeText:y.roleName})}),X(),J.value=!1})},te=e.computed(()=>!n.value.some(a=>a.contHour!==T.value)),Q=(a,l)=>{var h,S,N;const o=new Date(f.value),d=`${o.getFullYear()}-${(o.getMonth()+1).toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}`,t=(h=n.value[l])==null?void 0:h.days.findIndex(E=>E.day===d);return l===-1||t===-1?"":((S=n.value[l].days[t])==null?void 0:S.tips)+`
2
- `+((N=n.value[l].days[t])==null?void 0:N.time)},X=()=>{n.value=[],Y.value=[],B.value=[],v.odata.personal.forEach(a=>{if(a.divisionName===C.value&&b.value.some(l=>l.val&&l.activeText===a.roleName)){let l=c.byInitials(a.employeeName);Y.value.push(a.employeeKey),n.value.push({name:l+" ("+a.roleName+")",days:[],contHour:0,code:a.employeeKey,id:!1,ids:n.value.length})}}),v.workSchedule.getUsersYear({code:Y.value,year:new Date(f.value).getFullYear()}).then(a=>{a.forEach(l=>{l.dateStart&&B.value.push({code:l.code,dateStart:l.dateStart,dateEnd:l.dateEnd})}),console.log(a),ae(),$.value=!1})},ae=()=>{v.workSchedule.getWorkSchedule({code:Y.value,date:c.parseTime(new Date(f.value),"{Y}-{m}-{dd}")}).then(a=>{a.forEach((l,o)=>{l!==null&&(n.value[o].days=l.data.days,n.value[o].id=l.id)}),z()})},z=()=>{n.value.forEach(a=>{a.contHour=a.days.reduce((l,o)=>l+o.time,0)})},ne=a=>{n.value[a].days=[],z()},oe=a=>{switch(q.value){case"5":for(let l=M.value;l<=u.value.length;l++)u.value[l-1].holidays===""&&D(l,a,!0),u.value[l-1].holidays==="preholiday"&&(m.value-=1,D(l,a,!0),m.value+=1);break;case"2x2":for(let l=M.value;l<=u.value.length;l+=4)D(l,a,!0),l+1<=u.value.length&&D(l+1,a,!0);break;case"2x5":for(let l=M.value;l<=u.value.length;l+=7)for(let o=l;o<l+5&&o<=u.value.length;o++)u.value[o-1].holidays==="preholiday"?(m.value-=1,D(o,a,!0),m.value+=1):D(o,a,!0);break}},D=(a,l,o=!1)=>{const{date:d,ind:t}=H(a,l);t===-1?(n.value[l].days.push({day:d,time:m.value,tips:`(${p.value}:00 - ${m.value>=22?p.value+m.value+2:p.value+m.value+1}:00)`}),z()):o||(m.value=n.value[l].days[t].time,p.value=parseInt(n.value[l].days[t].tips.slice(1,-12)))},ue=(a,l)=>{const{ind:o}=H(a,l);n.value[l].days.splice(o,1),z(),document.querySelector(".app-main").click()},_=(a,l)=>{const{date:o,ind:d}=H(a,l);n.value[l].days[d]={day:o,time:m.value,tips:`(${p.value}:00 - ${m.value>=22?p.value+m.value+2:p.value+m.value+1}:00)`},z()},H=(a,l)=>{var t;const o=c.parseTime(new Date(f.value).setDate(a),"{Y}-{m}-{dd}"),d=(t=n.value[l])==null?void 0:t.days.findIndex(h=>h.day===o);return{date:o,ind:d}},re=async()=>{var x;F.value=!0;const a=new ge.Workbook,l=a.addWorksheet(V(f.value,"month"),{pageSetup:{paperSize:9,orientation:"landscape",fitToPage:!0}}),o={vertical:"middle",horizontal:"center"},d={top:{style:"thin"},left:{style:"thin"},bottom:{style:"thin"},right:{style:"thin"}},t={vertical:"middle",horizontal:"center",wrapText:!0};l.mergeCells(`A1:${c.cellsDynamically("A1",u.value.length+5)}1`),l.mergeCells(`A2:${c.cellsDynamically("A2",u.value.length+5)}2`),l.mergeCells("A3:A4"),l.mergeCells(`B3:${c.cellsDynamically("B3",u.value.length)}3`),l.mergeCells(`${c.cellsDynamically("B3",u.value.length+1)}3:${c.cellsDynamically("B3",u.value.length+2)}3`),l.mergeCells(`${c.cellsDynamically("B3",u.value.length+3)}3:${c.cellsDynamically("B4",u.value.length+3)}4`),l.mergeCells(`${c.cellsDynamically("B3",u.value.length+4)}3:${c.cellsDynamically("B4",u.value.length+4)}4`),l.getCell("A1").value=r("workSchedule.firm"),l.getCell("A2").value=r("workSchedule.title",{name:C.value})+V(f.value,"month")+` ${new Date(f.value).getFullYear()}`,l.getCell("A3").value=r("workSchedule.month"),l.getCell("B3").value=r("workSchedule.numbersMonth"),l.getCell(3,u.value.length+2).value=r("workSchedule.onSchedule"),l.getCell(3,u.value.length+4).value=r("workSchedule.acquainted"),l.getCell(3,u.value.length+5).value=r("workSchedule.date"),l.getCell(4,u.value.length+2).value=r("workSchedule.days"),l.getCell(4,u.value.length+3).value=`${r("workSchedule.hours")} (${T.value})`;for(let s=2;s<=u.value.length+1;s++)l.getCell(4,s).value=u.value[s-2].weekday+`
3
- `+(s-1),l.getColumn(s).width=6,l.getColumn(s).alignment=t,l.getCell(4,s).border=d;l.getRow(1).height=40,l.getRow(2).height=30,l.getRow(3).height=20,l.getColumn(1).width=15,l.getColumn(u.value.length+2).width=5,l.getColumn(u.value.length+3).width=6,l.getColumn(u.value.length+4).width=13,l.getColumn(u.value.length+5).width=13,l.getColumn(1).alignment=t,l.getCell("A2").alignment=o,l.getCell("A3").alignment=o,l.getCell("B3").alignment=o,l.getCell(3,u.value.length+2).alignment=o,l.getColumn(u.value.length+2).alignment=t,l.getColumn(u.value.length+3).alignment=t,l.getColumn(u.value.length+4).alignment=o,l.getColumn(u.value.length+5).alignment=o,l.getCell("A3").border=d,l.getCell("B3").border=d,l.getCell(3,u.value.length+2).border=d,l.getCell(4,u.value.length+2).border=d,l.getCell(3,u.value.length+4).border=d,l.getCell(3,u.value.length+5).border=d,l.getCell(4,u.value.length+3).border=d;let h=0;for(const s of n.value){let y=[s.name];for(let w=1;w<=u.value.length;w++){const{ind:L}=H(w,h);L!==-1?y[w]=`${s.days[L].time} ${s.days[L].tips}`:y[w]=" "}y.push(((x=s.days)==null?void 0:x.length)||" ",s.contHour||0);const W=l.addRow(y);W.border=d,h++}let S="Щербина Е. В.";v.odata.personal.forEach(s=>{s.roleName==="Начальник отдела правовой и кадровой работы"&&(S=s.employeeName)}),l.mergeCells(`A${n.value.length+6}:P${n.value.length+6}`),l.mergeCells(`Q${n.value.length+6}:AG${n.value.length+6}`),l.mergeCells(`B${n.value.length+8}:E${n.value.length+8}`),l.mergeCells(`F${n.value.length+8}:L${n.value.length+8}`),l.mergeCells(`M${n.value.length+8}:P${n.value.length+8}`),l.mergeCells(`S${n.value.length+8}:V${n.value.length+8}`),l.mergeCells(`W${n.value.length+8}:AC${n.value.length+8}`),l.mergeCells(`AD${n.value.length+8}:AG${n.value.length+8}`),l.mergeCells(`Z${n.value.length+9}:AA${n.value.length+9}`),l.getCell(`A${n.value.length+6}`).value=r("workSchedule.byInitials"),l.getCell(`Q${n.value.length+6}`).value=r("workSchedule.supervisorHR"),l.getCell(`B${n.value.length+8}`).value=r("workSchedule.compiled")+":",l.getCell(`S${n.value.length+8}`).value=r("workSchedule.approved")+":",l.getCell(`M${n.value.length+8}`).value=c.byInitials(v.fullName),l.getCell(`AD${n.value.length+8}`).value=c.byInitials(S),l.getCell(`Z${n.value.length+9}`).value=r("workSchedule.printPlace"),l.getCell(`A${n.value.length+6}`).alignment={vertical:"middle",horizontal:"right"},l.getCell(`Q${n.value.length+6}`).alignment={vertical:"middle",horizontal:"right"},l.getCell(`B${n.value.length+8}`).alignment={vertical:"middle",horizontal:"right"},l.getCell(`F${n.value.length+8}`).alignment={vertical:"middle",horizontal:"right"},l.getCell(`M${n.value.length+8}`).alignment={vertical:"middle",horizontal:"left"},l.getCell(`AD${n.value.length+8}`).alignment={vertical:"middle",horizontal:"left"},l.getCell(`Z${n.value.length+9}`).alignment=o,l.getCell(`F${n.value.length+8}`).border={bottom:{style:"thin"}},l.getCell(`W${n.value.length+8}`).border={bottom:{style:"thin"}};const N="export_"+c.parseTime(Date.now(),"{dd}.{m}.{Y}")+".xlsx",E=await a.xlsx.writeBuffer();de.saveAs(new Blob([E]),N),F.value=!1},ie=async()=>{I.value||v.workSchedule.addWorkSchedule({data:n.value,date:c.parseTime(new Date(f.value),"{Y}-{m}-{dd}"),group:C.value}).then(a=>I.value=a)};return console.log("props.group",v.group),console.log("props.date",v.date),v.group&&(C.value=v.group),v.date&&(f.value=new Date(v.date+"T00:00:01")),c.holidays().then(a=>{Z.value=a,K()}),(a,l)=>{const o=e.resolveComponent("el-date-picker"),d=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",me,[e.createElementVNode("div",he,[k.checkEdit?(e.openBlock(),e.createBlock(e.unref(i.ElSelect),{key:0,modelValue:C.value,"onUpdate:modelValue":l[0]||(l[0]=t=>C.value=t),placeholder:"Select",style:{width:"240px"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O.value,t=>(e.openBlock(),e.createBlock(e.unref(i.ElOption),{key:t.key,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])):e.createCommentVNode("",!0),k.checkEdit?(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:1,plain:"",onClick:l[1]||(l[1]=t=>$.value=!0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.jobTitle")),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(o,{modelValue:R.value,"onUpdate:modelValue":l[2]||(l[2]=t=>R.value=t),type:"month",placeholder:"Выберите месяц",format:"MMM","value-format":"M"},null,8,["modelValue"]),l[20]||(l[20]=e.createElementVNode("div",{class:"expander"},null,-1)),e.createVNode(e.unref(i.ElSwitch),{modelValue:A.value,"onUpdate:modelValue":l[3]||(l[3]=t=>A.value=t),"active-text":a.$t("bids.currentHeight"),"active-value":"100%","inactive-value":"calc(100vh - var(--el-component-size)*5 - var(--el-main-padding)*2 - var(--header-height))"},null,8,["modelValue","active-text"]),e.createVNode(e.unref(i.ElSwitch),{modelValue:j.value,"onUpdate:modelValue":l[4]||(l[4]=t=>j.value=t),"active-text":"Отпуска","active-value":!0,"inactive-value":!1},null,8,["modelValue"])]),e.createVNode(e.unref(i.ElSkeleton),{style:{width:"100%"},loading:J.value,animated:""},{template:e.withCtx(()=>[e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"100%",height:"2rem"}}),e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"180px",height:"4rem","margin-right":"4px"}}),e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"calc( 100% - 184px)",height:"4rem"}}),e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"180px",height:"8rem","margin-right":"4px"}}),e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"calc( 100% - 184px)",height:"8rem"}})]),default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTable),{id:"printTable",data:n.value,style:{width:"100%"},"max-height":A.value,size:"small",align:"center",onCellClick:ee,"empty-text":e.unref(r)("workSchedule.emptyText"),"cell-class-name":le},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.title",{name:C.value})+e.unref(V)(f.value,"month")+` ${new Date(f.value).getFullYear()}`,align:"center",height:"34"},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.month"),width:"180",align:"center",fixed:A.value!=="100%"},{default:e.withCtx(t=>[e.createElementVNode("div",fe,e.toDisplayString(n.value[t.$index].name),1)]),_:1},8,["label","fixed"]),e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.numbersMonth"),align:"center"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,t=>(e.openBlock(),e.createBlock(e.unref(i.ElTableColumn),{key:t.day,width:"46","class-name":t.holidays,align:"center",label:t.weekday+`
4
- `+t.day.toString(),prop:"vacation"},{default:e.withCtx(h=>[e.createElementVNode("div",pe,e.toDisplayString(Q(t.day,h.$index)||" "),1)]),_:2},1032,["class-name","label"]))),128))]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.onSchedule"),align:"center",fixed:A.value!=="100%"?"right":!1},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.days"),align:"center"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(n.value[t.$index].days.length||0),1)]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:`${e.unref(r)("workSchedule.hours")} ( ${T.value} )`,align:"center"},{default:e.withCtx(t=>[e.createElementVNode("div",{style:e.normalizeStyle(`color: ${T.value===t.row.contHour?"green":"red"};`)},e.toDisplayString(t.row.contHour),5)]),_:1},8,["label"])]),_:1},8,["label","fixed"])]),_:1},8,["label"])]),_:1},8,["data","max-height","empty-text"])]),_:1},8,["loading"]),te.value&&k.checkEdit?(e.openBlock(),e.createElementBlock("div",ye,[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.chartsFilled"))+": ",1),I.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:0,type:"primary",onClick:ie},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.confirm")),1)]),_:1})),l[21]||(l[21]=e.createTextVNode()),e.createElementVNode("span",null,e.toDisplayString(k.fullName),1)])):e.createCommentVNode("",!0),e.withDirectives((e.openBlock(),e.createBlock(e.unref(i.ElButton),{disabled:F.value,plain:"",onClick:re,style:{"margin-top":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.exportExcel")),1)]),_:1},8,["disabled"])),[[d,F.value]]),e.createVNode(e.unref(i.ElDialog),{title:e.unref(r)("workSchedule.jobTitle"),modelValue:$.value,"onUpdate:modelValue":l[7]||(l[7]=t=>$.value=t),width:"400px"},{footer:e.withCtx(()=>[e.createVNode(e.unref(i.ElButton),{onClick:l[5]||(l[5]=t=>$.value=!1),size:"default"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.$t("workSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(i.ElButton),{size:"default",type:"primary",onClick:l[6]||(l[6]=t=>{$.value=!1})},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.$t("workSchedule.select")),1)]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(i.ElForm),{ref:"dialogForm",model:b.value,autocomplete:"on"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,t=>(e.openBlock(),e.createBlock(e.unref(i.ElFormItem),null,{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElSwitch),{modelValue:t.val,"onUpdate:modelValue":h=>t.val=h,"active-text":t.activeText},null,8,["modelValue","onUpdate:modelValue","active-text"])]),_:2},1024))),256))]),_:1},8,["model"])]),_:1},8,["title","modelValue"]),e.createVNode(e.unref(G.ContextMenu),{show:U.value,"onUpdate:show":l[19]||(l[19]=t=>U.value=t),options:P.value},{default:e.withCtx(()=>[e.createVNode(e.unref(G.ContextMenuItem),{label:g.value.name,disabled:""},null,8,["label"]),e.createVNode(e.unref(G.ContextMenuSeparator)),g.value.level===2?(e.openBlock(),e.createElementBlock("div",we,[e.createVNode(e.unref(i.ElRadioGroup),{modelValue:q.value,"onUpdate:modelValue":l[8]||(l[8]=t=>q.value=t),size:"small"},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElRadioButton),{label:e.unref(r)("workSchedule.Days5"),value:"5"},null,8,["label"]),e.createVNode(e.unref(i.ElRadioButton),{label:"2 Х 2",value:"2x2"}),e.createVNode(e.unref(i.ElRadioButton),{label:"2 Х 5",value:"2x5"})]),_:1},8,["modelValue"]),l[22]||(l[22]=e.createElementVNode("br",null,null,-1)),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.fromDate"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:M.value,"onUpdate:modelValue":l[9]||(l[9]=t=>M.value=t),step:1,min:1,max:u.value.length},null,8,["modelValue","max"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.with"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:p.value,"onUpdate:modelValue":l[10]||(l[10]=t=>p.value=t),step:1,min:0,max:19},null,8,["modelValue"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.duration"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:m.value,"onUpdate:modelValue":l[11]||(l[11]=t=>m.value=t),step:1,min:4,max:e.unref(c.clamp)(p.value!==1?23-p.value:21,4,22)},null,8,["modelValue","max"]),e.createVNode(e.unref(i.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:l[12]||(l[12]=t=>oe(g.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.fillOut")),1)]),_:1}),e.createVNode(e.unref(i.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:l[13]||(l[13]=t=>ne(g.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.clearRow")),1)]),_:1})])):(e.openBlock(),e.createElementBlock("div",ke,[e.createElementVNode("div",null,e.toDisplayString(Q(g.value.day,g.value.ids)),1),l[23]||(l[23]=e.createElementVNode("br",null,null,-1)),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.with"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:p.value,"onUpdate:modelValue":l[14]||(l[14]=t=>p.value=t),step:1,min:0,max:19,onChange:l[15]||(l[15]=t=>_(g.value.day,g.value.ids))},null,8,["modelValue"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.duration"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:m.value,"onUpdate:modelValue":l[16]||(l[16]=t=>m.value=t),step:1,min:4,max:e.unref(c.clamp)(p.value!==1?23-p.value:21,4,22),onChange:l[17]||(l[17]=t=>_(g.value.day,g.value.ids))},null,8,["modelValue","max"]),e.createVNode(e.unref(i.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:l[18]||(l[18]=t=>ue(g.value.day,g.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.delete")),1)]),_:1})]))]),_:1},8,["show","options"])])}}};module.exports=Ce;
1
+ "use strict";const e=require("vue"),de=require("file-saver"),se=require("exceljs"),c=require("./index-Dn3djtwj.cjs"),ve=require("vue-i18n"),i=require("element-plus"),G=require("@imengyu/vue3-context-menu");function ce(k){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(k){for(const V in k)if(V!=="default"){const v=Object.getOwnPropertyDescriptor(k,V);Object.defineProperty(r,V,v.get?v:{enumerable:!0,get:()=>k[V]})}}return r.default=k,Object.freeze(r)}const ge=ce(se),me={class:"work"},he={class:"nav"},fe={style:{height:"100px",width:"100%",display:"inline-block"}},pe={style:{height:"100px",width:"100%",display:"inline-block"}},ye={key:0,class:"controls-container",style:{"margin-top":".5rem"}},we={key:0,style:{padding:"0.5em 1.5em"}},ke={key:1,style:{padding:"0.5em 1.5em"}},Ce={__name:"WorkTable",props:{checkEdit:{type:Boolean,default:()=>!0},odata:Object,workSchedule:Object,fullName:{type:String,default:"Вы"},group:String,date:String},setup(k){const{t:r,d:V}=ve.useI18n(),v=k,F=e.ref(!1),n=e.ref([]),R=e.ref(v.date?new Date(v.date+"T00:00:01").getMonth():new Date().getMonth()),j=e.ref(!1),B=e.ref([]),f=e.ref(new Date(new Date().getFullYear(),new Date().getMonth(),1)),u=e.ref([]),T=e.ref(0),p=e.ref(9),m=e.ref(8),I=e.ref(!1),J=e.ref(!0),$=e.ref(!1),q=e.ref("5"),M=e.ref(1),C=e.ref([]),O=e.ref([]),b=e.ref([]),Y=e.ref([]),g=e.ref({name:"Имя",length:0,code:""}),U=e.ref(!1),P=e.ref({zIndex:3,minWidth:230,x:500,y:200}),Z=e.ref({}),A=e.ref("100%");e.watch(C,async(a,l)=>{a!==l&&(b.value=[],I.value=!1,v.odata.personal.forEach(o=>{a.includes(o.divisionName)&&(b.value.some(d=>(d==null?void 0:d.activeText)===o.roleName)||b.value.push({val:!0,activeText:o.roleName}))}),te())}),e.watch(R,async a=>{let l=new Date().getMonth(),o=a===null?l:a-1;o=l-1<=o?o:o+12,console.log("currentMonth",o),f.value=new Date(new Date().getFullYear(),o,1),K()});const _=(a,l,o,d)=>{g.value.ids=a.ids,g.value.key=a.key,g.value.add=a.days.length>0&&a.days[a.days.length-1].cont,g.value.level=l.level,g.value.day=o.cellIndex,P.value.y=d.clientY,P.value.x=d.clientX,l.level===2&&l.no===0&&v.checkEdit&&(g.value.name=r("workSchedule.autocomplete"),U.value=!0),l.level===3&&o.cellIndex-l.no===1&&v.checkEdit&&(D(o.cellIndex,a.ids),g.value.name=r("workSchedule.modeSelection"),U.value=!0)},ee=({row:a,columnIndex:l})=>{if(!B.value||B.value.length===0||!j.value)return"";const o=new Date(new Date(f.value).getFullYear(),new Date(f.value).getMonth(),l).getTime()+1e3;for(let d of B.value){const{dateStart:t,dateEnd:h,code:S}=d;if(t&&h&&S===a.code&&l!==0&&l<=u.value.length){const N=new Date(c.parseDate(t)).getTime(),E=new Date(c.parseDate(h)).getTime();if(o>=N&&o<=E)return"vacation"}}return""},K=()=>{var h,S,N,E;const a=Z.value,l=new Date(f.value),o=new Date(l.getFullYear(),l.getMonth()+1,0).getDate();let d=[],t=0;for(let x=1;x<=o;x++){const s=c.parseTime(l.setDate(x),"{Y}-{m}-{dd}");t+=(h=a.nowork)!=null&&h.includes(s)||a.holidays.includes(s)?0:(S=a.preholidays)!=null&&S.includes(s)?7:8;const y=(N=a.nowork)!=null&&N.includes(s)?"nowork":a.holidays.includes(s)?"holiday":(E=a.preholidays)!=null&&E.includes(s)?"preholiday":"";d.push({day:x,holidays:y,weekday:V(new Date(l.getFullYear(),l.getMonth(),x),"day")})}T.value=t,u.value=d,v.odata.getPersonal({}).then(x=>{var s;C.value.length===0&&(C.value=[(s=x.find(y=>y.employeeName===v.fullName))==null?void 0:s.divisionName]),x.forEach((y,W)=>{O.value.some(w=>(w==null?void 0:w.value)===y.divisionName)||O.value.push({value:y.divisionName,label:y.divisionName,key:W}),C.value.includes(y.divisionName)&&!b.value.some(w=>(w==null?void 0:w.activeText)===y.roleName)&&b.value.push({val:!0,activeText:y.roleName})}),J.value=!1})},le=e.computed(()=>!n.value.some(a=>a.contHour!==T.value)),Q=(a,l)=>{var h,S,N;const o=new Date(f.value),d=`${o.getFullYear()}-${(o.getMonth()+1).toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}`,t=(h=n.value[l])==null?void 0:h.days.findIndex(E=>E.day===d);return l===-1||t===-1?"":((S=n.value[l].days[t])==null?void 0:S.tips)+`
2
+ `+((N=n.value[l].days[t])==null?void 0:N.time)},te=()=>{n.value=[],Y.value=[],B.value=[],v.odata.personal.forEach(a=>{if(C.value.includes(a.divisionName)&&b.value.some(l=>l.val&&l.activeText===a.roleName)){let l=c.byInitials(a.employeeName);Y.value.push(a.employeeKey),n.value.push({name:l+" ("+a.roleName+")",days:[],contHour:0,code:a.employeeKey,id:!1,ids:n.value.length})}}),v.workSchedule.getUsersYear({code:Y.value,year:new Date(f.value).getFullYear()}).then(a=>{a.forEach(l=>{l.dateStart&&B.value.push({code:l.code,dateStart:l.dateStart,dateEnd:l.dateEnd})}),console.log(a),ae(),$.value=!1})},ae=()=>{v.workSchedule.getWorkSchedule({code:Y.value,date:c.parseTime(new Date(f.value),"{Y}-{m}-{dd}")}).then(a=>{a.forEach((l,o)=>{l!==null&&(n.value[o].days=l.data.days,n.value[o].id=l.id)}),z()})},z=()=>{n.value.forEach(a=>{a.contHour=a.days.reduce((l,o)=>l+o.time,0)})},ne=a=>{n.value[a].days=[],z()},oe=a=>{switch(q.value){case"5":for(let l=M.value;l<=u.value.length;l++)u.value[l-1].holidays===""&&D(l,a,!0),u.value[l-1].holidays==="preholiday"&&(m.value-=1,D(l,a,!0),m.value+=1);break;case"2x2":for(let l=M.value;l<=u.value.length;l+=4)D(l,a,!0),l+1<=u.value.length&&D(l+1,a,!0);break;case"2x5":for(let l=M.value;l<=u.value.length;l+=7)for(let o=l;o<l+5&&o<=u.value.length;o++)u.value[o-1].holidays==="preholiday"?(m.value-=1,D(o,a,!0),m.value+=1):D(o,a,!0);break}},D=(a,l,o=!1)=>{const{date:d,ind:t}=H(a,l);t===-1?(n.value[l].days.push({day:d,time:m.value,tips:`(${p.value}:00 - ${m.value>=22?p.value+m.value+2:p.value+m.value+1}:00)`}),z()):o||(m.value=n.value[l].days[t].time,p.value=parseInt(n.value[l].days[t].tips.slice(1,-12)))},ue=(a,l)=>{const{ind:o}=H(a,l);n.value[l].days.splice(o,1),z(),document.querySelector(".app-main").click()},X=(a,l)=>{const{date:o,ind:d}=H(a,l);n.value[l].days[d]={day:o,time:m.value,tips:`(${p.value}:00 - ${m.value>=22?p.value+m.value+2:p.value+m.value+1}:00)`},z()},H=(a,l)=>{var t;const o=c.parseTime(new Date(f.value).setDate(a),"{Y}-{m}-{dd}"),d=(t=n.value[l])==null?void 0:t.days.findIndex(h=>h.day===o);return{date:o,ind:d}},re=async()=>{var x;F.value=!0;const a=new ge.Workbook,l=a.addWorksheet(V(f.value,"month"),{pageSetup:{paperSize:9,orientation:"landscape",fitToPage:!0}}),o={vertical:"middle",horizontal:"center"},d={top:{style:"thin"},left:{style:"thin"},bottom:{style:"thin"},right:{style:"thin"}},t={vertical:"middle",horizontal:"center",wrapText:!0};l.mergeCells(`A1:${c.cellsDynamically("A1",u.value.length+5)}1`),l.mergeCells(`A2:${c.cellsDynamically("A2",u.value.length+5)}2`),l.mergeCells("A3:A4"),l.mergeCells(`B3:${c.cellsDynamically("B3",u.value.length)}3`),l.mergeCells(`${c.cellsDynamically("B3",u.value.length+1)}3:${c.cellsDynamically("B3",u.value.length+2)}3`),l.mergeCells(`${c.cellsDynamically("B3",u.value.length+3)}3:${c.cellsDynamically("B4",u.value.length+3)}4`),l.mergeCells(`${c.cellsDynamically("B3",u.value.length+4)}3:${c.cellsDynamically("B4",u.value.length+4)}4`),l.getCell("A1").value=r("workSchedule.firm"),l.getCell("A2").value=r("workSchedule.title",{name:C.value[0]})+V(f.value,"month")+` ${new Date(f.value).getFullYear()}`,l.getCell("A3").value=r("workSchedule.month"),l.getCell("B3").value=r("workSchedule.numbersMonth"),l.getCell(3,u.value.length+2).value=r("workSchedule.onSchedule"),l.getCell(3,u.value.length+4).value=r("workSchedule.acquainted"),l.getCell(3,u.value.length+5).value=r("workSchedule.date"),l.getCell(4,u.value.length+2).value=r("workSchedule.days"),l.getCell(4,u.value.length+3).value=`${r("workSchedule.hours")} (${T.value})`;for(let s=2;s<=u.value.length+1;s++)l.getCell(4,s).value=u.value[s-2].weekday+`
3
+ `+(s-1),l.getColumn(s).width=6,l.getColumn(s).alignment=t,l.getCell(4,s).border=d;l.getRow(1).height=40,l.getRow(2).height=30,l.getRow(3).height=20,l.getColumn(1).width=15,l.getColumn(u.value.length+2).width=5,l.getColumn(u.value.length+3).width=6,l.getColumn(u.value.length+4).width=13,l.getColumn(u.value.length+5).width=13,l.getColumn(1).alignment=t,l.getCell("A2").alignment=o,l.getCell("A3").alignment=o,l.getCell("B3").alignment=o,l.getCell(3,u.value.length+2).alignment=o,l.getColumn(u.value.length+2).alignment=t,l.getColumn(u.value.length+3).alignment=t,l.getColumn(u.value.length+4).alignment=o,l.getColumn(u.value.length+5).alignment=o,l.getCell("A3").border=d,l.getCell("B3").border=d,l.getCell(3,u.value.length+2).border=d,l.getCell(4,u.value.length+2).border=d,l.getCell(3,u.value.length+4).border=d,l.getCell(3,u.value.length+5).border=d,l.getCell(4,u.value.length+3).border=d;let h=0;for(const s of n.value){let y=[s.name];for(let w=1;w<=u.value.length;w++){const{ind:L}=H(w,h);L!==-1?y[w]=`${s.days[L].time} ${s.days[L].tips}`:y[w]=" "}y.push(((x=s.days)==null?void 0:x.length)||" ",s.contHour||0);const W=l.addRow(y);W.border=d,h++}let S="Щербина Е. В.";v.odata.personal.forEach(s=>{s.roleName==="Начальник отдела правовой и кадровой работы"&&(S=s.employeeName)}),l.mergeCells(`A${n.value.length+6}:P${n.value.length+6}`),l.mergeCells(`Q${n.value.length+6}:AG${n.value.length+6}`),l.mergeCells(`B${n.value.length+8}:E${n.value.length+8}`),l.mergeCells(`F${n.value.length+8}:L${n.value.length+8}`),l.mergeCells(`M${n.value.length+8}:P${n.value.length+8}`),l.mergeCells(`S${n.value.length+8}:V${n.value.length+8}`),l.mergeCells(`W${n.value.length+8}:AC${n.value.length+8}`),l.mergeCells(`AD${n.value.length+8}:AG${n.value.length+8}`),l.mergeCells(`Z${n.value.length+9}:AA${n.value.length+9}`),l.getCell(`A${n.value.length+6}`).value=r("workSchedule.byInitials"),l.getCell(`Q${n.value.length+6}`).value=r("workSchedule.supervisorHR"),l.getCell(`B${n.value.length+8}`).value=r("workSchedule.compiled")+":",l.getCell(`S${n.value.length+8}`).value=r("workSchedule.approved")+":",l.getCell(`M${n.value.length+8}`).value=c.byInitials(v.fullName),l.getCell(`AD${n.value.length+8}`).value=c.byInitials(S),l.getCell(`Z${n.value.length+9}`).value=r("workSchedule.printPlace"),l.getCell(`A${n.value.length+6}`).alignment={vertical:"middle",horizontal:"right"},l.getCell(`Q${n.value.length+6}`).alignment={vertical:"middle",horizontal:"right"},l.getCell(`B${n.value.length+8}`).alignment={vertical:"middle",horizontal:"right"},l.getCell(`F${n.value.length+8}`).alignment={vertical:"middle",horizontal:"right"},l.getCell(`M${n.value.length+8}`).alignment={vertical:"middle",horizontal:"left"},l.getCell(`AD${n.value.length+8}`).alignment={vertical:"middle",horizontal:"left"},l.getCell(`Z${n.value.length+9}`).alignment=o,l.getCell(`F${n.value.length+8}`).border={bottom:{style:"thin"}},l.getCell(`W${n.value.length+8}`).border={bottom:{style:"thin"}};const N="export_"+c.parseTime(Date.now(),"{dd}.{m}.{Y}")+".xlsx",E=await a.xlsx.writeBuffer();de.saveAs(new Blob([E]),N),F.value=!1},ie=async()=>{I.value||v.workSchedule.addWorkSchedule({data:n.value,date:c.parseTime(new Date(f.value),"{Y}-{m}-{dd}"),group:C.value[0]}).then(a=>I.value=a)};return console.log("props.group",v.group),console.log("props.date",v.date),v.group&&(C.value[0]=v.group),v.date&&(f.value=new Date(v.date+"T00:00:01")),c.holidays().then(a=>{Z.value=a,K()}),(a,l)=>{const o=e.resolveComponent("el-date-picker"),d=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",me,[e.createElementVNode("div",he,[k.checkEdit?(e.openBlock(),e.createBlock(e.unref(i.ElSelect),{key:0,modelValue:C.value,"onUpdate:modelValue":l[0]||(l[0]=t=>C.value=t),multiple:"","collapse-tags":"","collapse-tags-tooltip":"",placeholder:"Select",style:{width:"240px"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O.value,t=>(e.openBlock(),e.createBlock(e.unref(i.ElOption),{key:t.key,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])):e.createCommentVNode("",!0),k.checkEdit?(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:1,plain:"",onClick:l[1]||(l[1]=t=>$.value=!0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.jobTitle")),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(o,{modelValue:R.value,"onUpdate:modelValue":l[2]||(l[2]=t=>R.value=t),type:"month",placeholder:"Выберите месяц",format:"MMM","value-format":"M"},null,8,["modelValue"]),l[20]||(l[20]=e.createElementVNode("div",{class:"expander"},null,-1)),e.createVNode(e.unref(i.ElSwitch),{modelValue:A.value,"onUpdate:modelValue":l[3]||(l[3]=t=>A.value=t),"active-text":a.$t("bids.currentHeight"),"active-value":"100%","inactive-value":"calc(100vh - var(--el-component-size)*5 - var(--el-main-padding)*2 - var(--header-height))"},null,8,["modelValue","active-text"]),e.createVNode(e.unref(i.ElSwitch),{modelValue:j.value,"onUpdate:modelValue":l[4]||(l[4]=t=>j.value=t),"active-text":"Отпуска","active-value":!0,"inactive-value":!1},null,8,["modelValue"])]),e.createVNode(e.unref(i.ElSkeleton),{style:{width:"100%"},loading:J.value,animated:""},{template:e.withCtx(()=>[e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"100%",height:"2rem"}}),e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"180px",height:"4rem","margin-right":"4px"}}),e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"calc( 100% - 184px)",height:"4rem"}}),e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"180px",height:"8rem","margin-right":"4px"}}),e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"calc( 100% - 184px)",height:"8rem"}})]),default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTable),{id:"printTable",data:n.value,style:{width:"100%"},"max-height":A.value,size:"small",align:"center",onCellClick:_,"empty-text":e.unref(r)("workSchedule.emptyText"),"cell-class-name":ee},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.title",{name:C.value[0]})+e.unref(V)(f.value,"month")+` ${new Date(f.value).getFullYear()}`,align:"center",height:"34"},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.month"),width:"180",align:"center",fixed:A.value!=="100%"},{default:e.withCtx(t=>[e.createElementVNode("div",fe,e.toDisplayString(n.value[t.$index].name),1)]),_:1},8,["label","fixed"]),e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.numbersMonth"),align:"center"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,t=>(e.openBlock(),e.createBlock(e.unref(i.ElTableColumn),{key:t.day,width:"46","class-name":t.holidays,align:"center",label:t.weekday+`
4
+ `+t.day.toString(),prop:"vacation"},{default:e.withCtx(h=>[e.createElementVNode("div",pe,e.toDisplayString(Q(t.day,h.$index)||" "),1)]),_:2},1032,["class-name","label"]))),128))]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.onSchedule"),align:"center",fixed:A.value!=="100%"?"right":!1},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.days"),align:"center"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(n.value[t.$index].days.length||0),1)]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:`${e.unref(r)("workSchedule.hours")} ( ${T.value} )`,align:"center"},{default:e.withCtx(t=>[e.createElementVNode("div",{style:e.normalizeStyle(`color: ${T.value===t.row.contHour?"green":"red"};`)},e.toDisplayString(t.row.contHour),5)]),_:1},8,["label"])]),_:1},8,["label","fixed"])]),_:1},8,["label"])]),_:1},8,["data","max-height","empty-text"])]),_:1},8,["loading"]),le.value&&k.checkEdit?(e.openBlock(),e.createElementBlock("div",ye,[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.chartsFilled"))+": ",1),I.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:0,type:"primary",onClick:ie},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.confirm")),1)]),_:1})),l[21]||(l[21]=e.createTextVNode()),e.createElementVNode("span",null,e.toDisplayString(k.fullName),1)])):e.createCommentVNode("",!0),e.withDirectives((e.openBlock(),e.createBlock(e.unref(i.ElButton),{disabled:F.value,plain:"",onClick:re,style:{"margin-top":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.exportExcel")),1)]),_:1},8,["disabled"])),[[d,F.value]]),e.createVNode(e.unref(i.ElDialog),{title:e.unref(r)("workSchedule.jobTitle"),modelValue:$.value,"onUpdate:modelValue":l[7]||(l[7]=t=>$.value=t),width:"400px"},{footer:e.withCtx(()=>[e.createVNode(e.unref(i.ElButton),{onClick:l[5]||(l[5]=t=>$.value=!1),size:"default"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.$t("workSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(i.ElButton),{size:"default",type:"primary",onClick:l[6]||(l[6]=t=>{$.value=!1})},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.$t("workSchedule.select")),1)]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(i.ElForm),{ref:"dialogForm",model:b.value,autocomplete:"on"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,t=>(e.openBlock(),e.createBlock(e.unref(i.ElFormItem),null,{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElSwitch),{modelValue:t.val,"onUpdate:modelValue":h=>t.val=h,"active-text":t.activeText},null,8,["modelValue","onUpdate:modelValue","active-text"])]),_:2},1024))),256))]),_:1},8,["model"])]),_:1},8,["title","modelValue"]),e.createVNode(e.unref(G.ContextMenu),{show:U.value,"onUpdate:show":l[19]||(l[19]=t=>U.value=t),options:P.value},{default:e.withCtx(()=>[e.createVNode(e.unref(G.ContextMenuItem),{label:g.value.name,disabled:""},null,8,["label"]),e.createVNode(e.unref(G.ContextMenuSeparator)),g.value.level===2?(e.openBlock(),e.createElementBlock("div",we,[e.createVNode(e.unref(i.ElRadioGroup),{modelValue:q.value,"onUpdate:modelValue":l[8]||(l[8]=t=>q.value=t),size:"small"},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElRadioButton),{label:e.unref(r)("workSchedule.Days5"),value:"5"},null,8,["label"]),e.createVNode(e.unref(i.ElRadioButton),{label:"2 Х 2",value:"2x2"}),e.createVNode(e.unref(i.ElRadioButton),{label:"2 Х 5",value:"2x5"})]),_:1},8,["modelValue"]),l[22]||(l[22]=e.createElementVNode("br",null,null,-1)),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.fromDate"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:M.value,"onUpdate:modelValue":l[9]||(l[9]=t=>M.value=t),step:1,min:1,max:u.value.length},null,8,["modelValue","max"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.with"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:p.value,"onUpdate:modelValue":l[10]||(l[10]=t=>p.value=t),step:1,min:0,max:19},null,8,["modelValue"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.duration"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:m.value,"onUpdate:modelValue":l[11]||(l[11]=t=>m.value=t),step:1,min:4,max:e.unref(c.clamp)(p.value!==1?23-p.value:21,4,22)},null,8,["modelValue","max"]),e.createVNode(e.unref(i.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:l[12]||(l[12]=t=>oe(g.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.fillOut")),1)]),_:1}),e.createVNode(e.unref(i.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:l[13]||(l[13]=t=>ne(g.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.clearRow")),1)]),_:1})])):(e.openBlock(),e.createElementBlock("div",ke,[e.createElementVNode("div",null,e.toDisplayString(Q(g.value.day,g.value.ids)),1),l[23]||(l[23]=e.createElementVNode("br",null,null,-1)),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.with"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:p.value,"onUpdate:modelValue":l[14]||(l[14]=t=>p.value=t),step:1,min:0,max:19,onChange:l[15]||(l[15]=t=>X(g.value.day,g.value.ids))},null,8,["modelValue"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.duration"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:m.value,"onUpdate:modelValue":l[16]||(l[16]=t=>m.value=t),step:1,min:4,max:e.unref(c.clamp)(p.value!==1?23-p.value:21,4,22),onChange:l[17]||(l[17]=t=>X(g.value.day,g.value.ids))},null,8,["modelValue","max"]),e.createVNode(e.unref(i.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:l[18]||(l[18]=t=>ue(g.value.day,g.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.delete")),1)]),_:1})]))]),_:1},8,["show","options"])])}}};module.exports=Ce;
package/dist/WorkTable.js CHANGED
@@ -1,7 +1,7 @@
1
- import { ref as g, watch as fe, computed as Ne, resolveComponent as Ae, resolveDirective as Te, createElementBlock as z, openBlock as C, createElementVNode as x, createVNode as r, createCommentVNode as _, withDirectives as Be, createBlock as F, unref as a, withCtx as s, Fragment as de, renderList as re, createTextVNode as D, toDisplayString as m, normalizeStyle as ze } from "vue";
1
+ import { ref as g, watch as ye, computed as Ne, resolveComponent as Ae, resolveDirective as Te, createElementBlock as z, openBlock as C, createElementVNode as x, createVNode as i, createCommentVNode as _, withDirectives as Be, createBlock as F, unref as a, withCtx as s, Fragment as de, renderList as ie, createTextVNode as D, toDisplayString as m, normalizeStyle as ze } from "vue";
2
2
  import { saveAs as Fe } from "file-saver";
3
3
  import * as Ye from "exceljs";
4
- import { p as O, b as ie, h as Ue, c as we, a as ke, d as M } from "./index-2Mx6IUGl.js";
4
+ import { p as O, b as re, h as Ue, c as fe, a as we, d as M } from "./index-2Mx6IUGl.js";
5
5
  import { useI18n as Ie } from "vue-i18n";
6
6
  import { ElSelect as He, ElOption as Re, ElButton as T, ElSwitch as ve, ElSkeleton as We, ElTable as Pe, ElTableColumn as Y, ElSkeletonItem as G, ElDialog as je, ElForm as Oe, ElFormItem as Ge, ElRadioGroup as Le, ElRadioButton as se, ElSlider as L } from "element-plus";
7
7
  import { ContextMenu as Ze, ContextMenuItem as qe, ContextMenuSeparator as Je } from "@imengyu/vue3-context-menu";
@@ -15,7 +15,7 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
15
15
  }, tl = {
16
16
  key: 1,
17
17
  style: { padding: "0.5em 1.5em" }
18
- }, il = {
18
+ }, rl = {
19
19
  __name: "WorkTable",
20
20
  props: {
21
21
  checkEdit: { type: Boolean, default: () => !0 },
@@ -39,29 +39,29 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
39
39
  // code: '0000-00052'
40
40
  // ids: 1
41
41
  // }
42
- ]), ee = g(h.date ? (/* @__PURE__ */ new Date(h.date + "T00:00:01")).getMonth() : (/* @__PURE__ */ new Date()).getMonth()), le = g(!1), H = g([]), f = g(new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1)), u = g([]), R = g(0), w = g(9), p = g(8), J = g(!1), ge = g(!0), U = g(!1), te = g("5"), W = g(1), $ = g(""), ae = g([]), N = g([]), K = g([]), c = g({ name: "Имя", length: 0, code: "" }), Q = g(!1), ne = g({
42
+ ]), ee = g(h.date ? (/* @__PURE__ */ new Date(h.date + "T00:00:01")).getMonth() : (/* @__PURE__ */ new Date()).getMonth()), le = g(!1), H = g([]), f = g(new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1)), u = g([]), R = g(0), w = g(9), p = g(8), J = g(!1), ge = g(!0), U = g(!1), te = g("5"), W = g(1), $ = g([]), ae = g([]), N = g([]), K = g([]), c = g({ name: "Имя", length: 0, code: "" }), Q = g(!1), ne = g({
43
43
  zIndex: 3,
44
44
  minWidth: 230,
45
45
  x: 500,
46
46
  y: 200
47
47
  }), me = g({}), P = g("100%");
48
- fe($, async (t, e) => {
48
+ ye($, async (t, e) => {
49
49
  t !== e && (N.value = [], J.value = !1, h.odata.personal.forEach((o) => {
50
- o.divisionName === t && (N.value.some((i) => (i == null ? void 0 : i.activeText) === o.roleName) || N.value.push({ val: !0, activeText: o.roleName }));
51
- }), pe());
52
- }), fe(ee, async (t) => {
50
+ t.includes(o.divisionName) && (N.value.some((r) => (r == null ? void 0 : r.activeText) === o.roleName) || N.value.push({ val: !0, activeText: o.roleName }));
51
+ }), Se());
52
+ }), ye(ee, async (t) => {
53
53
  let e = (/* @__PURE__ */ new Date()).getMonth(), o = t === null ? e : t - 1;
54
54
  o = e - 1 <= o ? o : o + 12, console.log("currentMonth", o), f.value = new Date((/* @__PURE__ */ new Date()).getFullYear(), o, 1), he();
55
55
  });
56
- const Ce = (t, e, o, i) => {
57
- c.value.ids = t.ids, c.value.key = t.key, c.value.add = t.days.length > 0 && t.days[t.days.length - 1].cont, c.value.level = e.level, c.value.day = o.cellIndex, ne.value.y = i.clientY, ne.value.x = i.clientX, e.level === 2 && e.no === 0 && h.checkEdit && (c.value.name = d("workSchedule.autocomplete"), Q.value = !0), e.level === 3 && o.cellIndex - e.no === 1 && h.checkEdit && (B(o.cellIndex, t.ids), c.value.name = d("workSchedule.modeSelection"), Q.value = !0);
58
- }, xe = ({ row: t, columnIndex: e }) => {
56
+ const ke = (t, e, o, r) => {
57
+ c.value.ids = t.ids, c.value.key = t.key, c.value.add = t.days.length > 0 && t.days[t.days.length - 1].cont, c.value.level = e.level, c.value.day = o.cellIndex, ne.value.y = r.clientY, ne.value.x = r.clientX, e.level === 2 && e.no === 0 && h.checkEdit && (c.value.name = d("workSchedule.autocomplete"), Q.value = !0), e.level === 3 && o.cellIndex - e.no === 1 && h.checkEdit && (B(o.cellIndex, t.ids), c.value.name = d("workSchedule.modeSelection"), Q.value = !0);
58
+ }, Ce = ({ row: t, columnIndex: e }) => {
59
59
  if (!H.value || H.value.length === 0 || !le.value) return "";
60
60
  const o = new Date(new Date(f.value).getFullYear(), new Date(f.value).getMonth(), e).getTime() + 1e3;
61
- for (let i of H.value) {
62
- const { dateStart: l, dateEnd: y, code: V } = i;
61
+ for (let r of H.value) {
62
+ const { dateStart: l, dateEnd: y, code: V } = r;
63
63
  if (l && y && V === t.code && e !== 0 && e <= u.value.length) {
64
- const E = new Date(ke(l)).getTime(), A = new Date(ke(y)).getTime();
64
+ const E = new Date(we(l)).getTime(), A = new Date(we(y)).getTime();
65
65
  if (o >= E && o <= A) return "vacation";
66
66
  }
67
67
  }
@@ -69,28 +69,28 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
69
69
  }, he = () => {
70
70
  var y, V, E, A;
71
71
  const t = me.value, e = new Date(f.value), o = new Date(e.getFullYear(), e.getMonth() + 1, 0).getDate();
72
- let i = [], l = 0;
72
+ let r = [], l = 0;
73
73
  for (let b = 1; b <= o; b++) {
74
74
  const v = O(e.setDate(b), "{Y}-{m}-{dd}");
75
75
  l += (y = t.nowork) != null && y.includes(v) || t.holidays.includes(v) ? 0 : (V = t.preholidays) != null && V.includes(v) ? 7 : 8;
76
76
  const k = (E = t.nowork) != null && E.includes(v) ? "nowork" : t.holidays.includes(v) ? "holiday" : (A = t.preholidays) != null && A.includes(v) ? "preholiday" : "";
77
- i.push({ day: b, holidays: k, weekday: Z(new Date(e.getFullYear(), e.getMonth(), b), "day") });
77
+ r.push({ day: b, holidays: k, weekday: Z(new Date(e.getFullYear(), e.getMonth(), b), "day") });
78
78
  }
79
- R.value = l, u.value = i, h.odata.getPersonal({}).then((b) => {
79
+ R.value = l, u.value = r, h.odata.getPersonal({}).then((b) => {
80
80
  var v;
81
- $.value.length === 0 && ($.value = (v = b.find((k) => k.employeeName === h.fullName)) == null ? void 0 : v.divisionName), b.forEach((k, oe) => {
82
- ae.value.some((S) => (S == null ? void 0 : S.value) === k.divisionName) || ae.value.push({ value: k.divisionName, label: k.divisionName, key: oe }), k.divisionName === $.value && !N.value.some((S) => (S == null ? void 0 : S.activeText) === k.roleName) && N.value.push({ val: !0, activeText: k.roleName });
83
- }), pe(), ge.value = !1;
81
+ $.value.length === 0 && ($.value = [(v = b.find((k) => k.employeeName === h.fullName)) == null ? void 0 : v.divisionName]), b.forEach((k, oe) => {
82
+ ae.value.some((S) => (S == null ? void 0 : S.value) === k.divisionName) || ae.value.push({ value: k.divisionName, label: k.divisionName, key: oe }), $.value.includes(k.divisionName) && !N.value.some((S) => (S == null ? void 0 : S.activeText) === k.roleName) && N.value.push({ val: !0, activeText: k.roleName });
83
+ }), ge.value = !1;
84
84
  });
85
- }, Se = Ne(() => !n.value.some((t) => t.contHour !== R.value)), ce = (t, e) => {
85
+ }, xe = Ne(() => !n.value.some((t) => t.contHour !== R.value)), ce = (t, e) => {
86
86
  var y, V, E;
87
- const o = new Date(f.value), i = `${o.getFullYear()}-${(o.getMonth() + 1).toString().padStart(2, "0")}-${t.toString().padStart(2, "0")}`, l = (y = n.value[e]) == null ? void 0 : y.days.findIndex((A) => A.day === i);
87
+ const o = new Date(f.value), r = `${o.getFullYear()}-${(o.getMonth() + 1).toString().padStart(2, "0")}-${t.toString().padStart(2, "0")}`, l = (y = n.value[e]) == null ? void 0 : y.days.findIndex((A) => A.day === r);
88
88
  return e === -1 || l === -1 ? "" : ((V = n.value[e].days[l]) == null ? void 0 : V.tips) + `
89
89
  ` + ((E = n.value[e].days[l]) == null ? void 0 : E.time);
90
- }, pe = () => {
90
+ }, Se = () => {
91
91
  n.value = [], K.value = [], H.value = [], h.odata.personal.forEach((t) => {
92
- if (t.divisionName === $.value && N.value.some((e) => e.val && e.activeText === t.roleName)) {
93
- let e = ie(t.employeeName);
92
+ if ($.value.includes(t.divisionName) && N.value.some((e) => e.val && e.activeText === t.roleName)) {
93
+ let e = re(t.employeeName);
94
94
  K.value.push(t.employeeKey), n.value.push({ name: e + " (" + t.roleName + ")", days: [], contHour: 0, code: t.employeeKey, id: !1, ids: n.value.length });
95
95
  }
96
96
  }), h.workSchedule.getUsersYear({ code: K.value, year: new Date(f.value).getFullYear() }).then((t) => {
@@ -129,35 +129,35 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
129
129
  break;
130
130
  }
131
131
  }, B = (t, e, o = !1) => {
132
- const { date: i, ind: l } = X(t, e);
132
+ const { date: r, ind: l } = X(t, e);
133
133
  l === -1 ? (n.value[e].days.push({
134
- day: i,
134
+ day: r,
135
135
  time: p.value,
136
136
  tips: `(${w.value}:00 - ${p.value >= 22 ? w.value + p.value + 2 : w.value + p.value + 1}:00)`
137
137
  }), j()) : o || (p.value = n.value[e].days[l].time, w.value = parseInt(n.value[e].days[l].tips.slice(1, -12)));
138
138
  }, Ve = (t, e) => {
139
139
  const { ind: o } = X(t, e);
140
140
  n.value[e].days.splice(o, 1), j(), document.querySelector(".app-main").click();
141
- }, ye = (t, e) => {
142
- const { date: o, ind: i } = X(t, e);
143
- n.value[e].days[i] = {
141
+ }, pe = (t, e) => {
142
+ const { date: o, ind: r } = X(t, e);
143
+ n.value[e].days[r] = {
144
144
  day: o,
145
145
  time: p.value,
146
146
  tips: `(${w.value}:00 - ${p.value >= 22 ? w.value + p.value + 2 : w.value + p.value + 1}:00)`
147
147
  }, j();
148
148
  }, X = (t, e) => {
149
149
  var l;
150
- const o = O(new Date(f.value).setDate(t), "{Y}-{m}-{dd}"), i = (l = n.value[e]) == null ? void 0 : l.days.findIndex((y) => y.day === o);
151
- return { date: o, ind: i };
150
+ const o = O(new Date(f.value).setDate(t), "{Y}-{m}-{dd}"), r = (l = n.value[e]) == null ? void 0 : l.days.findIndex((y) => y.day === o);
151
+ return { date: o, ind: r };
152
152
  }, Ee = async () => {
153
153
  var b;
154
154
  q.value = !0;
155
- const t = new Ye.Workbook(), e = t.addWorksheet(Z(f.value, "month"), { pageSetup: { paperSize: 9, orientation: "landscape", fitToPage: !0 } }), o = { vertical: "middle", horizontal: "center" }, i = { top: { style: "thin" }, left: { style: "thin" }, bottom: { style: "thin" }, right: { style: "thin" } }, l = { vertical: "middle", horizontal: "center", wrapText: !0 };
156
- e.mergeCells(`A1:${M("A1", u.value.length + 5)}1`), e.mergeCells(`A2:${M("A2", u.value.length + 5)}2`), e.mergeCells("A3:A4"), e.mergeCells(`B3:${M("B3", u.value.length)}3`), e.mergeCells(`${M("B3", u.value.length + 1)}3:${M("B3", u.value.length + 2)}3`), e.mergeCells(`${M("B3", u.value.length + 3)}3:${M("B4", u.value.length + 3)}4`), e.mergeCells(`${M("B3", u.value.length + 4)}3:${M("B4", u.value.length + 4)}4`), e.getCell("A1").value = d("workSchedule.firm"), e.getCell("A2").value = d("workSchedule.title", { name: $.value }) + Z(f.value, "month") + ` ${new Date(f.value).getFullYear()}`, e.getCell("A3").value = d("workSchedule.month"), e.getCell("B3").value = d("workSchedule.numbersMonth"), e.getCell(3, u.value.length + 2).value = d("workSchedule.onSchedule"), e.getCell(3, u.value.length + 4).value = d("workSchedule.acquainted"), e.getCell(3, u.value.length + 5).value = d("workSchedule.date"), e.getCell(4, u.value.length + 2).value = d("workSchedule.days"), e.getCell(4, u.value.length + 3).value = `${d("workSchedule.hours")} (${R.value})`;
155
+ const t = new Ye.Workbook(), e = t.addWorksheet(Z(f.value, "month"), { pageSetup: { paperSize: 9, orientation: "landscape", fitToPage: !0 } }), o = { vertical: "middle", horizontal: "center" }, r = { top: { style: "thin" }, left: { style: "thin" }, bottom: { style: "thin" }, right: { style: "thin" } }, l = { vertical: "middle", horizontal: "center", wrapText: !0 };
156
+ e.mergeCells(`A1:${M("A1", u.value.length + 5)}1`), e.mergeCells(`A2:${M("A2", u.value.length + 5)}2`), e.mergeCells("A3:A4"), e.mergeCells(`B3:${M("B3", u.value.length)}3`), e.mergeCells(`${M("B3", u.value.length + 1)}3:${M("B3", u.value.length + 2)}3`), e.mergeCells(`${M("B3", u.value.length + 3)}3:${M("B4", u.value.length + 3)}4`), e.mergeCells(`${M("B3", u.value.length + 4)}3:${M("B4", u.value.length + 4)}4`), e.getCell("A1").value = d("workSchedule.firm"), e.getCell("A2").value = d("workSchedule.title", { name: $.value[0] }) + Z(f.value, "month") + ` ${new Date(f.value).getFullYear()}`, e.getCell("A3").value = d("workSchedule.month"), e.getCell("B3").value = d("workSchedule.numbersMonth"), e.getCell(3, u.value.length + 2).value = d("workSchedule.onSchedule"), e.getCell(3, u.value.length + 4).value = d("workSchedule.acquainted"), e.getCell(3, u.value.length + 5).value = d("workSchedule.date"), e.getCell(4, u.value.length + 2).value = d("workSchedule.days"), e.getCell(4, u.value.length + 3).value = `${d("workSchedule.hours")} (${R.value})`;
157
157
  for (let v = 2; v <= u.value.length + 1; v++)
158
158
  e.getCell(4, v).value = u.value[v - 2].weekday + `
159
- ` + (v - 1), e.getColumn(v).width = 6, e.getColumn(v).alignment = l, e.getCell(4, v).border = i;
160
- e.getRow(1).height = 40, e.getRow(2).height = 30, e.getRow(3).height = 20, e.getColumn(1).width = 15, e.getColumn(u.value.length + 2).width = 5, e.getColumn(u.value.length + 3).width = 6, e.getColumn(u.value.length + 4).width = 13, e.getColumn(u.value.length + 5).width = 13, e.getColumn(1).alignment = l, e.getCell("A2").alignment = o, e.getCell("A3").alignment = o, e.getCell("B3").alignment = o, e.getCell(3, u.value.length + 2).alignment = o, e.getColumn(u.value.length + 2).alignment = l, e.getColumn(u.value.length + 3).alignment = l, e.getColumn(u.value.length + 4).alignment = o, e.getColumn(u.value.length + 5).alignment = o, e.getCell("A3").border = i, e.getCell("B3").border = i, e.getCell(3, u.value.length + 2).border = i, e.getCell(4, u.value.length + 2).border = i, e.getCell(3, u.value.length + 4).border = i, e.getCell(3, u.value.length + 5).border = i, e.getCell(4, u.value.length + 3).border = i;
159
+ ` + (v - 1), e.getColumn(v).width = 6, e.getColumn(v).alignment = l, e.getCell(4, v).border = r;
160
+ e.getRow(1).height = 40, e.getRow(2).height = 30, e.getRow(3).height = 20, e.getColumn(1).width = 15, e.getColumn(u.value.length + 2).width = 5, e.getColumn(u.value.length + 3).width = 6, e.getColumn(u.value.length + 4).width = 13, e.getColumn(u.value.length + 5).width = 13, e.getColumn(1).alignment = l, e.getCell("A2").alignment = o, e.getCell("A3").alignment = o, e.getCell("B3").alignment = o, e.getCell(3, u.value.length + 2).alignment = o, e.getColumn(u.value.length + 2).alignment = l, e.getColumn(u.value.length + 3).alignment = l, e.getColumn(u.value.length + 4).alignment = o, e.getColumn(u.value.length + 5).alignment = o, e.getCell("A3").border = r, e.getCell("B3").border = r, e.getCell(3, u.value.length + 2).border = r, e.getCell(4, u.value.length + 2).border = r, e.getCell(3, u.value.length + 4).border = r, e.getCell(3, u.value.length + 5).border = r, e.getCell(4, u.value.length + 3).border = r;
161
161
  let y = 0;
162
162
  for (const v of n.value) {
163
163
  let k = [v.name];
@@ -167,32 +167,35 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
167
167
  }
168
168
  k.push(((b = v.days) == null ? void 0 : b.length) || " ", v.contHour || 0);
169
169
  const oe = e.addRow(k);
170
- oe.border = i, y++;
170
+ oe.border = r, y++;
171
171
  }
172
172
  let V = "Щербина Е. В.";
173
173
  h.odata.personal.forEach((v) => {
174
174
  v.roleName === "Начальник отдела правовой и кадровой работы" && (V = v.employeeName);
175
- }), e.mergeCells(`A${n.value.length + 6}:P${n.value.length + 6}`), e.mergeCells(`Q${n.value.length + 6}:AG${n.value.length + 6}`), e.mergeCells(`B${n.value.length + 8}:E${n.value.length + 8}`), e.mergeCells(`F${n.value.length + 8}:L${n.value.length + 8}`), e.mergeCells(`M${n.value.length + 8}:P${n.value.length + 8}`), e.mergeCells(`S${n.value.length + 8}:V${n.value.length + 8}`), e.mergeCells(`W${n.value.length + 8}:AC${n.value.length + 8}`), e.mergeCells(`AD${n.value.length + 8}:AG${n.value.length + 8}`), e.mergeCells(`Z${n.value.length + 9}:AA${n.value.length + 9}`), e.getCell(`A${n.value.length + 6}`).value = d("workSchedule.byInitials"), e.getCell(`Q${n.value.length + 6}`).value = d("workSchedule.supervisorHR"), e.getCell(`B${n.value.length + 8}`).value = d("workSchedule.compiled") + ":", e.getCell(`S${n.value.length + 8}`).value = d("workSchedule.approved") + ":", e.getCell(`M${n.value.length + 8}`).value = ie(h.fullName), e.getCell(`AD${n.value.length + 8}`).value = ie(V), e.getCell(`Z${n.value.length + 9}`).value = d("workSchedule.printPlace"), e.getCell(`A${n.value.length + 6}`).alignment = { vertical: "middle", horizontal: "right" }, e.getCell(`Q${n.value.length + 6}`).alignment = { vertical: "middle", horizontal: "right" }, e.getCell(`B${n.value.length + 8}`).alignment = { vertical: "middle", horizontal: "right" }, e.getCell(`F${n.value.length + 8}`).alignment = { vertical: "middle", horizontal: "right" }, e.getCell(`M${n.value.length + 8}`).alignment = { vertical: "middle", horizontal: "left" }, e.getCell(`AD${n.value.length + 8}`).alignment = { vertical: "middle", horizontal: "left" }, e.getCell(`Z${n.value.length + 9}`).alignment = o, e.getCell(`F${n.value.length + 8}`).border = { bottom: { style: "thin" } }, e.getCell(`W${n.value.length + 8}`).border = { bottom: { style: "thin" } };
175
+ }), e.mergeCells(`A${n.value.length + 6}:P${n.value.length + 6}`), e.mergeCells(`Q${n.value.length + 6}:AG${n.value.length + 6}`), e.mergeCells(`B${n.value.length + 8}:E${n.value.length + 8}`), e.mergeCells(`F${n.value.length + 8}:L${n.value.length + 8}`), e.mergeCells(`M${n.value.length + 8}:P${n.value.length + 8}`), e.mergeCells(`S${n.value.length + 8}:V${n.value.length + 8}`), e.mergeCells(`W${n.value.length + 8}:AC${n.value.length + 8}`), e.mergeCells(`AD${n.value.length + 8}:AG${n.value.length + 8}`), e.mergeCells(`Z${n.value.length + 9}:AA${n.value.length + 9}`), e.getCell(`A${n.value.length + 6}`).value = d("workSchedule.byInitials"), e.getCell(`Q${n.value.length + 6}`).value = d("workSchedule.supervisorHR"), e.getCell(`B${n.value.length + 8}`).value = d("workSchedule.compiled") + ":", e.getCell(`S${n.value.length + 8}`).value = d("workSchedule.approved") + ":", e.getCell(`M${n.value.length + 8}`).value = re(h.fullName), e.getCell(`AD${n.value.length + 8}`).value = re(V), e.getCell(`Z${n.value.length + 9}`).value = d("workSchedule.printPlace"), e.getCell(`A${n.value.length + 6}`).alignment = { vertical: "middle", horizontal: "right" }, e.getCell(`Q${n.value.length + 6}`).alignment = { vertical: "middle", horizontal: "right" }, e.getCell(`B${n.value.length + 8}`).alignment = { vertical: "middle", horizontal: "right" }, e.getCell(`F${n.value.length + 8}`).alignment = { vertical: "middle", horizontal: "right" }, e.getCell(`M${n.value.length + 8}`).alignment = { vertical: "middle", horizontal: "left" }, e.getCell(`AD${n.value.length + 8}`).alignment = { vertical: "middle", horizontal: "left" }, e.getCell(`Z${n.value.length + 9}`).alignment = o, e.getCell(`F${n.value.length + 8}`).border = { bottom: { style: "thin" } }, e.getCell(`W${n.value.length + 8}`).border = { bottom: { style: "thin" } };
176
176
  const E = "export_" + O(Date.now(), "{dd}.{m}.{Y}") + ".xlsx", A = await t.xlsx.writeBuffer();
177
177
  Fe(new Blob([A]), E), q.value = !1;
178
178
  }, Me = async () => {
179
- J.value || h.workSchedule.addWorkSchedule({ data: n.value, date: O(new Date(f.value), "{Y}-{m}-{dd}"), group: $.value }).then((t) => J.value = t);
179
+ J.value || h.workSchedule.addWorkSchedule({ data: n.value, date: O(new Date(f.value), "{Y}-{m}-{dd}"), group: $.value[0] }).then((t) => J.value = t);
180
180
  };
181
- return console.log("props.group", h.group), console.log("props.date", h.date), h.group && ($.value = h.group), h.date && (f.value = /* @__PURE__ */ new Date(h.date + "T00:00:01")), Ue().then((t) => {
181
+ return console.log("props.group", h.group), console.log("props.date", h.date), h.group && ($.value[0] = h.group), h.date && (f.value = /* @__PURE__ */ new Date(h.date + "T00:00:01")), Ue().then((t) => {
182
182
  me.value = t, he();
183
183
  }), (t, e) => {
184
- const o = Ae("el-date-picker"), i = Te("loading");
184
+ const o = Ae("el-date-picker"), r = Te("loading");
185
185
  return C(), z("div", Ke, [
186
186
  x("div", Qe, [
187
187
  I.checkEdit ? (C(), F(a(He), {
188
188
  key: 0,
189
189
  modelValue: $.value,
190
190
  "onUpdate:modelValue": e[0] || (e[0] = (l) => $.value = l),
191
+ multiple: "",
192
+ "collapse-tags": "",
193
+ "collapse-tags-tooltip": "",
191
194
  placeholder: "Select",
192
195
  style: { width: "240px" }
193
196
  }, {
194
197
  default: s(() => [
195
- (C(!0), z(de, null, re(ae.value, (l) => (C(), F(a(Re), {
198
+ (C(!0), z(de, null, ie(ae.value, (l) => (C(), F(a(Re), {
196
199
  key: l.key,
197
200
  label: l.label,
198
201
  value: l.value
@@ -210,7 +213,7 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
210
213
  ]),
211
214
  _: 1
212
215
  })) : _("", !0),
213
- r(o, {
216
+ i(o, {
214
217
  modelValue: ee.value,
215
218
  "onUpdate:modelValue": e[2] || (e[2] = (l) => ee.value = l),
216
219
  type: "month",
@@ -219,14 +222,14 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
219
222
  "value-format": "M"
220
223
  }, null, 8, ["modelValue"]),
221
224
  e[20] || (e[20] = x("div", { class: "expander" }, null, -1)),
222
- r(a(ve), {
225
+ i(a(ve), {
223
226
  modelValue: P.value,
224
227
  "onUpdate:modelValue": e[3] || (e[3] = (l) => P.value = l),
225
228
  "active-text": t.$t("bids.currentHeight"),
226
229
  "active-value": "100%",
227
230
  "inactive-value": "calc(100vh - var(--el-component-size)*5 - var(--el-main-padding)*2 - var(--header-height))"
228
231
  }, null, 8, ["modelValue", "active-text"]),
229
- r(a(ve), {
232
+ i(a(ve), {
230
233
  modelValue: le.value,
231
234
  "onUpdate:modelValue": e[4] || (e[4] = (l) => le.value = l),
232
235
  "active-text": "Отпуска",
@@ -234,53 +237,53 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
234
237
  "inactive-value": !1
235
238
  }, null, 8, ["modelValue"])
236
239
  ]),
237
- r(a(We), {
240
+ i(a(We), {
238
241
  style: { width: "100%" },
239
242
  loading: ge.value,
240
243
  animated: ""
241
244
  }, {
242
245
  template: s(() => [
243
- r(a(G), {
246
+ i(a(G), {
244
247
  variant: "text",
245
248
  style: { width: "100%", height: "2rem" }
246
249
  }),
247
- r(a(G), {
250
+ i(a(G), {
248
251
  variant: "text",
249
252
  style: { width: "180px", height: "4rem", "margin-right": "4px" }
250
253
  }),
251
- r(a(G), {
254
+ i(a(G), {
252
255
  variant: "text",
253
256
  style: { width: "calc( 100% - 184px)", height: "4rem" }
254
257
  }),
255
- r(a(G), {
258
+ i(a(G), {
256
259
  variant: "text",
257
260
  style: { width: "180px", height: "8rem", "margin-right": "4px" }
258
261
  }),
259
- r(a(G), {
262
+ i(a(G), {
260
263
  variant: "text",
261
264
  style: { width: "calc( 100% - 184px)", height: "8rem" }
262
265
  })
263
266
  ]),
264
267
  default: s(() => [
265
- r(a(Pe), {
268
+ i(a(Pe), {
266
269
  id: "printTable",
267
270
  data: n.value,
268
271
  style: { width: "100%" },
269
272
  "max-height": P.value,
270
273
  size: "small",
271
274
  align: "center",
272
- onCellClick: Ce,
275
+ onCellClick: ke,
273
276
  "empty-text": a(d)("workSchedule.emptyText"),
274
- "cell-class-name": xe
277
+ "cell-class-name": Ce
275
278
  }, {
276
279
  default: s(() => [
277
- r(a(Y), {
278
- label: a(d)("workSchedule.title", { name: $.value }) + a(Z)(f.value, "month") + ` ${new Date(f.value).getFullYear()}`,
280
+ i(a(Y), {
281
+ label: a(d)("workSchedule.title", { name: $.value[0] }) + a(Z)(f.value, "month") + ` ${new Date(f.value).getFullYear()}`,
279
282
  align: "center",
280
283
  height: "34"
281
284
  }, {
282
285
  default: s(() => [
283
- r(a(Y), {
286
+ i(a(Y), {
284
287
  label: a(d)("workSchedule.month"),
285
288
  width: "180",
286
289
  align: "center",
@@ -291,12 +294,12 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
291
294
  ]),
292
295
  _: 1
293
296
  }, 8, ["label", "fixed"]),
294
- r(a(Y), {
297
+ i(a(Y), {
295
298
  label: a(d)("workSchedule.numbersMonth"),
296
299
  align: "center"
297
300
  }, {
298
301
  default: s(() => [
299
- (C(!0), z(de, null, re(u.value, (l) => (C(), F(a(Y), {
302
+ (C(!0), z(de, null, ie(u.value, (l) => (C(), F(a(Y), {
300
303
  key: l.day,
301
304
  width: "46",
302
305
  "class-name": l.holidays,
@@ -313,13 +316,13 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
313
316
  ]),
314
317
  _: 1
315
318
  }, 8, ["label"]),
316
- r(a(Y), {
319
+ i(a(Y), {
317
320
  label: a(d)("workSchedule.onSchedule"),
318
321
  align: "center",
319
322
  fixed: P.value !== "100%" ? "right" : !1
320
323
  }, {
321
324
  default: s(() => [
322
- r(a(Y), {
325
+ i(a(Y), {
323
326
  label: a(d)("workSchedule.days"),
324
327
  align: "center"
325
328
  }, {
@@ -328,7 +331,7 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
328
331
  ]),
329
332
  _: 1
330
333
  }, 8, ["label"]),
331
- r(a(Y), {
334
+ i(a(Y), {
332
335
  label: `${a(d)("workSchedule.hours")} ( ${R.value} )`,
333
336
  align: "center"
334
337
  }, {
@@ -351,7 +354,7 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
351
354
  ]),
352
355
  _: 1
353
356
  }, 8, ["loading"]),
354
- Se.value && I.checkEdit ? (C(), z("div", el, [
357
+ xe.value && I.checkEdit ? (C(), z("div", el, [
355
358
  D(m(a(d)("workSchedule.chartsFilled")) + ": ", 1),
356
359
  J.value ? _("", !0) : (C(), F(a(T), {
357
360
  key: 0,
@@ -377,16 +380,16 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
377
380
  ]),
378
381
  _: 1
379
382
  }, 8, ["disabled"])), [
380
- [i, q.value]
383
+ [r, q.value]
381
384
  ]),
382
- r(a(je), {
385
+ i(a(je), {
383
386
  title: a(d)("workSchedule.jobTitle"),
384
387
  modelValue: U.value,
385
388
  "onUpdate:modelValue": e[7] || (e[7] = (l) => U.value = l),
386
389
  width: "400px"
387
390
  }, {
388
391
  footer: s(() => [
389
- r(a(T), {
392
+ i(a(T), {
390
393
  onClick: e[5] || (e[5] = (l) => U.value = !1),
391
394
  size: "default"
392
395
  }, {
@@ -395,7 +398,7 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
395
398
  ]),
396
399
  _: 1
397
400
  }),
398
- r(a(T), {
401
+ i(a(T), {
399
402
  size: "default",
400
403
  type: "primary",
401
404
  onClick: e[6] || (e[6] = (l) => {
@@ -409,15 +412,15 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
409
412
  })
410
413
  ]),
411
414
  default: s(() => [
412
- r(a(Oe), {
415
+ i(a(Oe), {
413
416
  ref: "dialogForm",
414
417
  model: N.value,
415
418
  autocomplete: "on"
416
419
  }, {
417
420
  default: s(() => [
418
- (C(!0), z(de, null, re(N.value, (l) => (C(), F(a(Ge), null, {
421
+ (C(!0), z(de, null, ie(N.value, (l) => (C(), F(a(Ge), null, {
419
422
  default: s(() => [
420
- r(a(ve), {
423
+ i(a(ve), {
421
424
  modelValue: l.val,
422
425
  "onUpdate:modelValue": (y) => l.val = y,
423
426
  "active-text": l.activeText
@@ -431,33 +434,33 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
431
434
  ]),
432
435
  _: 1
433
436
  }, 8, ["title", "modelValue"]),
434
- r(a(Ze), {
437
+ i(a(Ze), {
435
438
  show: Q.value,
436
439
  "onUpdate:show": e[19] || (e[19] = (l) => Q.value = l),
437
440
  options: ne.value
438
441
  }, {
439
442
  default: s(() => [
440
- r(a(qe), {
443
+ i(a(qe), {
441
444
  label: c.value.name,
442
445
  disabled: ""
443
446
  }, null, 8, ["label"]),
444
- r(a(Je)),
447
+ i(a(Je)),
445
448
  c.value.level === 2 ? (C(), z("div", ll, [
446
- r(a(Le), {
449
+ i(a(Le), {
447
450
  modelValue: te.value,
448
451
  "onUpdate:modelValue": e[8] || (e[8] = (l) => te.value = l),
449
452
  size: "small"
450
453
  }, {
451
454
  default: s(() => [
452
- r(a(se), {
455
+ i(a(se), {
453
456
  label: a(d)("workSchedule.Days5"),
454
457
  value: "5"
455
458
  }, null, 8, ["label"]),
456
- r(a(se), {
459
+ i(a(se), {
457
460
  label: "2 Х 2",
458
461
  value: "2x2"
459
462
  }),
460
- r(a(se), {
463
+ i(a(se), {
461
464
  label: "2 Х 5",
462
465
  value: "2x5"
463
466
  })
@@ -466,7 +469,7 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
466
469
  }, 8, ["modelValue"]),
467
470
  e[22] || (e[22] = x("br", null, null, -1)),
468
471
  x("span", null, m(a(d)("workSchedule.fromDate")) + ":", 1),
469
- r(a(L), {
472
+ i(a(L), {
470
473
  modelValue: W.value,
471
474
  "onUpdate:modelValue": e[9] || (e[9] = (l) => W.value = l),
472
475
  step: 1,
@@ -474,7 +477,7 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
474
477
  max: u.value.length
475
478
  }, null, 8, ["modelValue", "max"]),
476
479
  x("span", null, m(a(d)("workSchedule.with")) + ":", 1),
477
- r(a(L), {
480
+ i(a(L), {
478
481
  modelValue: w.value,
479
482
  "onUpdate:modelValue": e[10] || (e[10] = (l) => w.value = l),
480
483
  step: 1,
@@ -482,14 +485,14 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
482
485
  max: 19
483
486
  }, null, 8, ["modelValue"]),
484
487
  x("span", null, m(a(d)("workSchedule.duration")) + ":", 1),
485
- r(a(L), {
488
+ i(a(L), {
486
489
  modelValue: p.value,
487
490
  "onUpdate:modelValue": e[11] || (e[11] = (l) => p.value = l),
488
491
  step: 1,
489
492
  min: 4,
490
- max: a(we)(w.value !== 1 ? 23 - w.value : 21, 4, 22)
493
+ max: a(fe)(w.value !== 1 ? 23 - w.value : 21, 4, 22)
491
494
  }, null, 8, ["modelValue", "max"]),
492
- r(a(T), {
495
+ i(a(T), {
493
496
  style: { "margin-top": ".5rem" },
494
497
  size: "small",
495
498
  onClick: e[12] || (e[12] = (l) => De(c.value.ids))
@@ -499,7 +502,7 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
499
502
  ]),
500
503
  _: 1
501
504
  }),
502
- r(a(T), {
505
+ i(a(T), {
503
506
  style: { "margin-top": ".5rem" },
504
507
  size: "small",
505
508
  onClick: e[13] || (e[13] = (l) => be(c.value.ids))
@@ -513,24 +516,24 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
513
516
  x("div", null, m(ce(c.value.day, c.value.ids)), 1),
514
517
  e[23] || (e[23] = x("br", null, null, -1)),
515
518
  x("span", null, m(a(d)("workSchedule.with")) + ":", 1),
516
- r(a(L), {
519
+ i(a(L), {
517
520
  modelValue: w.value,
518
521
  "onUpdate:modelValue": e[14] || (e[14] = (l) => w.value = l),
519
522
  step: 1,
520
523
  min: 0,
521
524
  max: 19,
522
- onChange: e[15] || (e[15] = (l) => ye(c.value.day, c.value.ids))
525
+ onChange: e[15] || (e[15] = (l) => pe(c.value.day, c.value.ids))
523
526
  }, null, 8, ["modelValue"]),
524
527
  x("span", null, m(a(d)("workSchedule.duration")) + ":", 1),
525
- r(a(L), {
528
+ i(a(L), {
526
529
  modelValue: p.value,
527
530
  "onUpdate:modelValue": e[16] || (e[16] = (l) => p.value = l),
528
531
  step: 1,
529
532
  min: 4,
530
- max: a(we)(w.value !== 1 ? 23 - w.value : 21, 4, 22),
531
- onChange: e[17] || (e[17] = (l) => ye(c.value.day, c.value.ids))
533
+ max: a(fe)(w.value !== 1 ? 23 - w.value : 21, 4, 22),
534
+ onChange: e[17] || (e[17] = (l) => pe(c.value.day, c.value.ids))
532
535
  }, null, 8, ["modelValue", "max"]),
533
- r(a(T), {
536
+ i(a(T), {
534
537
  style: { "margin-top": ".5rem" },
535
538
  size: "small",
536
539
  onClick: e[18] || (e[18] = (l) => Ve(c.value.day, c.value.ids))
@@ -549,5 +552,5 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
549
552
  }
550
553
  };
551
554
  export {
552
- il as default
555
+ rl as default
553
556
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@studio-west/employees",
3
- "version": "0.6.36",
3
+ "version": "0.6.37",
4
4
  "files": [
5
5
  "dist"
6
6
  ],