@studio-west/employees 0.4.3 → 0.4.5

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 +1 @@
1
- "use strict";const e=require("vue"),V=require("./index-CHGzf-XH.cjs"),W=require("vue-i18n"),Z=require("file-saver"),Q=require("exceljs"),d=require("element-plus"),O=require("@imengyu/vue3-context-menu");function ee(D){const x=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(D){for(const n in D)if(n!=="default"){const g=Object.getOwnPropertyDescriptor(D,n);Object.defineProperty(x,n,g.get?g:{enumerable:!0,get:()=>D[n]})}}return x.default=D,Object.freeze(x)}const te=ee(Q),le=(D,x)=>{const n=D.__vccOpts||D;for(const[g,u]of x)n[g]=u;return n},ae={class:"wrapper"},ne={class:"month_year"},oe={class:"text"},ue={class:"week"},re={class:"month"},ie=["onClick"],de={key:0},ce={class:"month_year"},se={class:"text"},ve={class:"week"},me={class:"month"},fe=["onClick"],ge={__name:"DataPicker",props:{data:Object,limitation:{type:[Boolean,Object],default:()=>!1},range:{type:String,default:()=>"solid"}},emits:["init"],setup(D,{emit:x}){var L,U,P,z;const n=e.ref(new Date),g=e.ref(new Date),u=D,F=x,h=e.ref(new Date().getFullYear()),B=e.ref(new Date().getMonth()),Y=e.ref(new Date().getFullYear()),m=e.ref(new Date().getMonth()),c=e.ref([]),T=e.ref(0),M=e.ref(0),p=e.ref(-1),k=e.ref(-1),{locale:A}=W.useI18n(),b=/en|zh|ja|he/.test(A.value)?0:1,N=u.range==="range"?2:1,$=s=>{const r=s.split(s.match(/\D.*?\D?/));return r[0].length>2?r.join("-")+"T00:00:01":r.reverse().join("-")+"T00:00:01"};typeof((L=u.data)==null?void 0:L.startDate)<"u"&&(n.value=new Date($(u.data.startDate)),h.value=n.value.getFullYear(),m.value=n.value.getMonth()),typeof((U=u.data)==null?void 0:U.endDate)<"u"&&(g.value=new Date($(u.data.endDate)),Y.value=g.value.getFullYear(),B.value=g.value.getMonth());const v=()=>{let s=new Date(h.value,m.value,0);for(let a=s.getDate()-s.getDay()+b;a<=s.getDate()&&s.getDay()!==6+b;a++)T.value++,c.value.push({day:a,month:s.getMonth(),year:s.getFullYear(),class:[]});for(let a=1;a<=new Date(h.value,m.value+1,0).getDate();a++)T.value++,c.value.push({day:a,month:m.value,year:h.value,class:[]});if(u.range==="range"){M.value=new Date(h.value,m.value+2,0);for(let a=1;a<=M.value.getDate();a++)c.value.push({day:a,month:M.value.getMonth(),year:M.value.getFullYear(),class:[]})}let r=new Date(h.value,m.value+N,1);for(let a=1;a<=(7-r.getDay()+b)%7&&r.getDay()!==b;a++)c.value.push({day:a,month:r.getMonth(),year:r.getFullYear(),class:[]});u.data.holiday.length!==0&&(u.data.holiday.preholidays.forEach(a=>{let i=a.split("-");const y=c.value.findIndex(S=>S.year==i[0]&&S.month+1==i[1]&&S.day==i[2]);y!==-1&&(c.value[y].class[0]="preholiday")}),u.data.holiday.holidays.forEach(a=>{let i=a.split("-");const y=c.value.findIndex(S=>S.year==i[0]&&S.month+1==i[1]&&S.day==i[2]);y!==-1&&(c.value[y].class[0]="weekend")}),u.data.holiday.holiday.forEach(a=>{let i=a.split("-");const y=c.value.findIndex(S=>S.year==i[0]&&S.month+1==i[1]&&S.day==i[2]);y!==-1&&(c.value[y].class[0]="holiday")}),u.data.holiday.nowork.forEach(a=>{let i=a.split("-");const y=c.value.findIndex(S=>S.year==i[0]&&S.month+1==i[1]&&S.day==i[2]);y!==-1&&(c.value[y].class[0]="nowork")}))},q=(s,r)=>{let a=s-r+1;for(let i=0;i<=s-r;i++)c.value[i+r].class[0]==="holiday"&&a--;return a},E=(s,r)=>{const a=V.parseTime(new Date(s.year,s.month,s.day),"{dd}.{m}.{Y}");if(u.range==="range")if(console.log(p.value),k.value!==-1){if(k.value<=p.value)for(let i=k.value;i<=p.value;i++)c.value[i].class[1]="";else for(let i=p.value;i<=k.value;i++)c.value[i].class[1]="";p.value=r,k.value=-1,c.value[r].class[1]="active"}else if(p.value!==-1){if(k.value=r,k.value>=p.value)for(let y=p.value+1;y<r;y++)c.value[y].class[1]="select";else for(let y=r+1;y<p.value;y++)c.value[y].class[1]="select";c.value[r].class[1]="active";let i=V.parseTime(new Date(c.value[p.value].year,c.value[p.value].month,c.value[p.value].day),"{dd}.{m}.{Y}");p.value>r?F("input",{dateStart:a,dateEnd:i,count:q(p.value,r)}):F("input",{dateStart:i,dateEnd:a,count:q(r,p.value)})}else p.value=r,c.value[r].class[1]="active";else c.value[p.value].class[1]="",p.value=r,c.value[r].class[1]="active",F("input",{dateStart:a,count:1})};if(v(),typeof((P=u.data)==null?void 0:P.startDate)<"u"&&(p.value=c.value.findIndex(s=>s.day===n.value.getDate()&&s.month===m.value&&s.year===h.value),c.value[p.value].class[1]="active"),typeof((z=u.data)==null?void 0:z.endDate)<"u"&&u.range==="range"){k.value=c.value.findIndex(s=>s.day===g.value.getDate()&&s.month===B.value&&s.year===Y.value),c.value[k.value].class[1]="active";for(let s=p.value+1;s<k.value;s++)c.value[s].class[1]="select"}const I=(s,r)=>{j(s,r)&&(c.value=[],T.value=0,n.value=new Date(s,r,1),h.value=n.value.getFullYear(),m.value=n.value.getMonth(),v())},j=(s,r)=>{if(!u.limitation)return!0;if(u.limitation.dateStart){console.log(u.limitation.dateStart);let a=u.limitation.dateStart.split(u.limitation.dateStart.match(/\D.*?\D?/));if(a[0].length>2&&a.reverse(),parseInt(a[2])>s||parseInt(a[2])===s&&parseInt(a[1])>r+1)return!1}if(u.limitation.dateEnd){console.log(u.limitation.dateEnd);let a=u.limitation.dateEnd.split(u.limitation.dateEnd.match(/\D.*?\D?/));if(a[0].length>2&&a.reverse(),parseInt(a[2])<s||parseInt(a[2])===s&&parseInt(a[1])<r+N)return!1}return!0};return(s,r)=>(e.openBlock(),e.createElementBlock("div",ae,[e.createElementVNode("div",null,[e.createElementVNode("p",ne,[e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:r[0]||(r[0]=a=>I(h.value-1,m.value))},"«"),e.createElementVNode("button",{onClick:r[1]||(r[1]=a=>I(h.value,m.value-1))},"‹")]),e.createElementVNode("span",oe,[e.createElementVNode("button",null,e.toDisplayString(h.value),1),e.createElementVNode("button",null,e.toDisplayString(e.unref(V.parseTime)(n.value.setMonth(m.value),"{F}")),1)]),e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:r[2]||(r[2]=a=>I(h.value,m.value+1))},"›"),e.createElementVNode("button",{onClick:r[3]||(r[3]=a=>I(h.value+1,m.value))},"»")])]),e.createElementVNode("div",ue,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(7,(a,i)=>e.createElementVNode("button",{key:i,class:"disabled"},e.toDisplayString(e.unref(V.parseTime)(new Date(1970,1,a+e.unref(b)),"{D}")),1)),64))]),e.createElementVNode("div",re,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(a,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[i<T.value+(7-new Date(h.value,m.value+1,1).getDay()+e.unref(b))%7?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(a.month===m.value&&(!u.limitation||new Date(a.year,a.month,a.day+1).getTime()>new Date($(u.limitation.dateStart)).getTime()&&new Date(a.year,a.month,a.day).getTime()<new Date($(u.limitation.dateEnd)).getTime())?a.class:"disabled"),onClick:()=>{a.month===m.value&&E(a,i)}},e.toDisplayString(a.day),11,ie)):e.createCommentVNode("",!0)],64))),128))])]),u.range==="range"?(e.openBlock(),e.createElementBlock("div",de,[e.createElementVNode("p",ce,[e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:r[4]||(r[4]=a=>I(h.value-1,m.value))},"«"),e.createElementVNode("button",{onClick:r[5]||(r[5]=a=>I(h.value,m.value-1))},"‹")]),e.createElementVNode("span",se,[e.createElementVNode("button",null,e.toDisplayString(new Date(h.value,m.value+1).getFullYear()),1),e.createElementVNode("button",null,e.toDisplayString(e.unref(V.parseTime)(n.value.setMonth(m.value+1),"{F}")),1)]),e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:r[6]||(r[6]=a=>I(h.value,m.value+1))},"›"),e.createElementVNode("button",{onClick:r[7]||(r[7]=a=>I(h.value+1,m.value))},"»")])]),e.createElementVNode("div",ve,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(7,(a,i)=>e.createElementVNode("button",{key:i,class:"disabled"},e.toDisplayString(e.unref(V.parseTime)(new Date(1970,1,a+e.unref(b)),"{D}")),1)),64))]),e.createElementVNode("div",me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(a,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[i>=T.value-new Date(h.value,m.value+1,1).getDay()+e.unref(b)?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(a.month===M.value.getMonth()&&(!u.limitation||new Date(a.year,a.month,a.day+1).getTime()>new Date($(u.limitation.dateStart)).getTime()&&new Date(a.year,a.month,a.day).getTime()<new Date($(u.limitation.dateEnd)).getTime())?a.class:"disabled"),onClick:()=>{a.month===M.value.getMonth()&&E(a,i)}},e.toDisplayString(a.day),11,fe)):e.createCommentVNode("",!0)],64))),128))])])):e.createCommentVNode("",!0)]))}},pe=le(ge,[["__scopeId","data-v-531eb182"]]),he={key:1,class:"controls-container",style:{"margin-top":".5rem"}},Ce={key:0},ye={key:1,style:{padding:"0 1rem .5rem"}},ke={__name:"VacationTable",props:{checkEdit:{type:Boolean,default:()=>!0},odata:Object,workSchedule:Object,query:String,fullName:{type:String,default:"Вы"}},setup(D){const x=D,{t:n}=W.useI18n(),g=e.ref([]);e.ref([]);const u=e.ref(new Date().getFullYear()),F=e.ref(!1),h=e.ref(!1),B=e.ref(!1),Y=e.ref({zIndex:3,minWidth:230,x:500,y:200}),m=e.ref(!1),c=e.ref(!1),T=e.ref({participants:[]}),M=e.ref([]),p=e.ref([]),k=e.ref("all"),A=e.ref([{value:"all",label:n("vacationSchedule.all"),key:"all"}]),b=e.ref(!1),N=e.ref([]),$=e.ref(!1),v=e.ref({name:"",length:0,code:""}),q=new Date().getMonth()>11?[{value:u.value,label:u.value},{value:u.value+1,label:u.value+1}]:[{value:u.value-1,label:u.value-1},{value:u.value,label:u.value}];e.watch(k,async(o,t)=>{o!==t&&(N.value=[],F.value=!1,x.odata.personalManagerData.forEach(f=>{(f.Status!=="Увольнение"&&f.Group===o||o==="all")&&(N.value.some(l=>(l==null?void 0:l.activeText)===f.Role)||N.value.push({val:!0,activeText:f.Role}))}),j())});const E=e.computed(()=>g.value.flatMap((o,t)=>!o.days||o.days.length===0?[{...o,key:0,ids:t}]:o.days.map((f,l)=>({ids:t,key:l,...o,...f})))),I=async()=>{x.odata.getPersonalManagerData({}).then(o=>{var t;k.value=(t=o.find(f=>f.Status!=="Увольнение"&&f.Description===x.fullName))==null?void 0:t.Group,o.forEach(f=>{f.Status!=="Увольнение"&&(A.value.some(l=>(l==null?void 0:l.value)===f.Group)||A.value.push({value:f.Group,label:f.Group,key:f.Group}),f.Group===k.value&&!N.value.some(l=>(l==null?void 0:l.activeText)===f.Role)&&N.value.push({val:!0,activeText:f.Role}))}),j(),h.value=!1})},j=()=>{g.value=[];let o=[];x.odata.personalManagerData.forEach(t=>{t.Status!=="Увольнение"&&(t.Group===k.value||k.value==="all")&&N.value.some(f=>f.val&&f.activeText===t.Role)&&(o.push(t.Code),g.value.push({name:t.Description,days:[{note:""}],jobTitle:t.Role,code:t.Code}))}),L(o),m.value=!1},L=o=>{x.workSchedule.getAllVacations({year:u.value}).then(t=>{o.forEach((f,l)=>{g.value[l].days=[{note:""}],t.forEach(C=>{f===C.code&&(typeof g.value[l].days[0].dateStart>"u"?g.value[l].days[0]={dateStart:V.parseTime(C.dateStart,"{dd}.{m}.{Y}"),dateEnd:V.parseTime(C.dateEnd,"{dd}.{m}.{Y}"),note:C.note,count:C.count}:g.value[l].days.push({dateStart:V.parseTime(C.dateStart,"{dd}.{m}.{Y}"),dateEnd:V.parseTime(C.dateEnd,"{dd}.{m}.{Y}"),note:C.note,count:C.count}))})})})},U=o=>{if(o.columnIndex<3&&E.value[o.rowIndex].key<E.value[o.rowIndex].days.length)return E.value[o.rowIndex].key===0?{rowspan:E.value[o.rowIndex].days.length,colspan:1}:{rowspan:0,colspan:0}},P=(o,t,f,l)=>{v.value.ids=o.ids,v.value.key=o.key,v.value.startDate=o.dateStart,v.value.endDate=o.dateEnd,v.value.name=o.name,v.value.count=o.count,v.value.length=o.days.length,v.value.add=o.days.length>0&&o.days[o.days.length-1].count,v.value.level=t.level,v.value.holiday=p.value,Y.value.y=l.clientY,Y.value.x=l.clientX,t.level===2&&t.no<4&&(v.value.add||o.days.length>1)&&(B.value=!0),t.level===3&&(B.value=!0)},z=o=>{let t=g.value[v.value.ids];switch(o){case"add":t.days.push({note:""}),console.log(t.days.length);break;case"delete":delete t.days.pop(),a(v.value.ids);break}B.value=!1},s=o=>{$.value=o,v.value.count=o.count},r=()=>{$.value&&(g.value[v.value.ids].days[v.value.key]={...$.value,note:""},a(v.value.ids)),B.value=!1},a=o=>{x.workSchedule.rewriteFull({year:u.value,code:g.value[o].code,data:g.value[o].days.map(t=>({dateStart:t.dateStart.split(".").reverse().join("-"),dateEnd:t.dateEnd.split(".").reverse().join("-"),note:t.note,count:t.count}))})},i=o=>{x.workSchedule.sendConfirmMessage({fullname:x.fullName,confirm:o}),x.query=""},y=()=>{x.workSchedule.sendAgreementMessage({users:T.value.participants}),c.value=!1};x.workSchedule.getBoss().then(o=>{M.value=o[0].users}),V.holidays().then(o=>{p.value=o,I()});const S=async()=>{b.value=!0;const o=new te.Workbook,t=o.addWorksheet(u.value.toString(),{pageSetup:{paperSize:9,orientation:"landscape",fitToPage:!0}}),f={vertical:"middle",horizontal:"center"},l={top:{style:"thin"},left:{style:"thin"},bottom:{style:"thin"},right:{style:"thin"}},C={vertical:"middle",horizontal:"center",wrapText:!0},R={vertical:"middle",horizontal:"right",wrapText:!0};t.mergeCells("D1:G1"),t.mergeCells("D2:G2"),t.mergeCells("D3:G3"),t.mergeCells("D4:G4"),t.mergeCells("A5:G5"),t.mergeCells("A6:G6"),t.mergeCells("A9:G9"),t.mergeCells("A10:A11"),t.mergeCells("B10:B11"),t.mergeCells("C10:C11"),t.mergeCells("D10:F10"),t.mergeCells("G10:G11"),t.getCell("D1").value=n("vacationSchedule.approve"),t.getCell("D2").value=n("vacationSchedule.dateApprove",{year:u.value-1}),t.getCell("D3").value=n("workSchedule.printPlace"),t.getCell("D4").value=n("vacationSchedule.dateApprove",{year:u.value-1}),t.getCell("A5").value=n("workSchedule.firm"),t.getCell("B7").value=n("vacationSchedule.vacationSchedule"),t.getCell("C7").value=n("vacationSchedule.numberDocs"),t.getCell("D7").value=n("vacationSchedule.compilation"),t.getCell("E7").value=n("vacationSchedule.year"),t.getCell("C8").value="",t.getCell("D8").value="",t.getCell("E8").value=u.value,t.getCell("E7").value=n("vacationSchedule.year"),t.getCell("A10").value=n("vacationSchedule.jobTitle"),t.getCell("B10").value=n("vacationSchedule.fullName"),t.getCell("C10").value=n("vacationSchedule.personnelNumber"),t.getCell("D10").value=n("vacationSchedule.vacation"),t.getCell("D11").value=n("vacationSchedule.days"),t.getCell("E11").value=n("vacationSchedule.date"),t.getCell("F11").value=n("vacationSchedule.endDate"),t.getCell("G11").value=n("vacationSchedule.note"),t.getRow(1).height=80,t.getColumn(1).width=28,t.getColumn(2).width=28,t.getColumn(3).width=18,t.getColumn(4).width=18,t.getColumn(5).width=14,t.getColumn(6).width=14,t.getColumn(7).width=14,t.getColumn(1).alignment=C,t.getColumn(2).alignment=C,t.getColumn(3).alignment=C,t.getColumn(4).alignment=C,t.getColumn(5).alignment=C,t.getColumn(6).alignment=C,t.getColumn(7).alignment=C,t.getCell("D1").alignment=R,t.getCell("D2").alignment=R,t.getCell("D4").alignment=R,t.getCell("A5").alignment=f,t.getCell("C7").border=l,t.getCell("D7").border=l,t.getCell("E7").border=l,t.getCell("C8").border=l,t.getCell("D8").border=l,t.getCell("E8").border=l,t.getCell("A10").border=l,t.getCell("B10").border=l,t.getCell("C10").border=l,t.getCell("D10").border=l,t.getCell("G10").border=l,t.getCell("D11").border=l,t.getCell("E11").border=l,t.getCell("F11").border=l;let _=11;for(const w of g.value)if(w.days.length>1)w.days.forEach(G=>{let J=[w.jobTitle,w.name,w.code,G.count,G.dateStart,G.dateEnd,G.note];const K=t.addRow(J);K.border=l,_++}),t.mergeCells(`A${_-w.days.length+1}:A${_}`),t.mergeCells(`B${_-w.days.length+1}:B${_}`),t.mergeCells(`C${_-w.days.length+1}:C${_}`);else{let G=[w.jobTitle,w.name,w.code,w.days[0].count,w.days[0].dateStart,w.days[0].dateEnd,w.days[0].note];const J=t.addRow(G);J.border=l,_++}const X="export_"+V.parseTime(Date.now(),"{dd}.{m}.{Y}")+".xlsx",H=await o.xlsx.writeBuffer();Z.saveAs(new Blob([H]),X),b.value=!1};return(o,t)=>{const f=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",null,[D.checkEdit?(e.openBlock(),e.createBlock(e.unref(d.ElSelect),{key:0,modelValue:k.value,"onUpdate:modelValue":t[0]||(t[0]=l=>k.value=l),placeholder:"Select",style:{width:"240px","margin-bottom":".5rem","margin-right":".5rem"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(A.value,l=>(e.openBlock(),e.createBlock(e.unref(d.ElOption),{key:l.value,label:l.label,value:l.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])):e.createCommentVNode("",!0),e.createVNode(e.unref(d.ElButton),{plain:"",onClick:t[1]||(t[1]=l=>m.value=!0),style:{"margin-bottom":".5rem","margin-right":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("workSchedule.jobTitle")),1)]),_:1}),e.createVNode(e.unref(d.ElSelect),{modelValue:u.value,"onUpdate:modelValue":t[2]||(t[2]=l=>u.value=l),onChange:j,placeholder:"Year",style:{width:"80px","margin-bottom":".5rem","margin-right":".5rem"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(q),l=>(e.openBlock(),e.createBlock(e.unref(d.ElOption),{key:l.value,label:l.label,value:l.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),e.createVNode(e.unref(d.ElSkeleton),{style:{width:"100%"},loading:h.value,animated:""},{template:e.withCtx(()=>[e.createVNode(e.unref(d.ElSkeletonItem),{variant:"text",style:{width:"100%",height:"2rem"}}),e.createVNode(e.unref(d.ElSkeletonItem),{variant:"text",style:{width:"180px",height:"4rem","margin-right":"4px"}}),e.createVNode(e.unref(d.ElSkeletonItem),{variant:"text",style:{width:"calc( 100% - 184px)",height:"4rem"}}),e.createVNode(e.unref(d.ElSkeletonItem),{variant:"text",style:{width:"180px",height:"8rem","margin-right":"4px"}}),e.createVNode(e.unref(d.ElSkeletonItem),{variant:"text",style:{width:"calc( 100% - 184px)",height:"8rem"}})]),default:e.withCtx(()=>[e.createVNode(e.unref(d.ElTable),{id:"printTable",data:E.value,"span-method":U,onCellClick:P,border:"",style:{width:"100%"},size:"small","empty-text":e.unref(n)("vacationSchedule.emptyText")},{default:e.withCtx(()=>[e.createVNode(e.unref(d.ElTableColumn),{label:k.value!=="all"?e.unref(n)("vacationSchedule.title",{name:k.value}):e.unref(n)("vacationSchedule.enterprise")+` ${u.value}`,align:"center",height:"34"},{default:e.withCtx(()=>[e.createVNode(e.unref(d.ElTableColumn),{label:e.unref(n)("vacationSchedule.jobTitle"),width:"180",align:"center"},{default:e.withCtx(l=>[e.createTextVNode(e.toDisplayString(E.value[l.$index].jobTitle),1)]),_:1},8,["label"]),e.createVNode(e.unref(d.ElTableColumn),{label:e.unref(n)("vacationSchedule.fullName"),width:"180",align:"center"},{default:e.withCtx(l=>[e.createTextVNode(e.toDisplayString(E.value[l.$index].name),1)]),_:1},8,["label"]),e.createVNode(e.unref(d.ElTableColumn),{label:e.unref(n)("vacationSchedule.personnelNumber"),align:"center"},{default:e.withCtx(l=>[e.createTextVNode(e.toDisplayString(E.value[l.$index].code),1)]),_:1},8,["label"]),e.createVNode(e.unref(d.ElTableColumn),{label:e.unref(n)("vacationSchedule.vacation"),align:"center"},{default:e.withCtx(()=>[e.createVNode(e.unref(d.ElTableColumn),{label:e.unref(n)("vacationSchedule.days"),align:"center"},{default:e.withCtx(l=>[e.createTextVNode(e.toDisplayString(E.value[l.$index].count),1)]),_:1},8,["label"]),e.createVNode(e.unref(d.ElTableColumn),{label:e.unref(n)("vacationSchedule.date"),align:"center"},{default:e.withCtx(l=>[e.createTextVNode(e.toDisplayString(E.value[l.$index].dateStart),1)]),_:1},8,["label"]),e.createVNode(e.unref(d.ElTableColumn),{label:e.unref(n)("vacationSchedule.endDate"),align:"center"},{default:e.withCtx(l=>[e.createTextVNode(e.toDisplayString(E.value[l.$index].dateEnd),1)]),_:1},8,["label"])]),_:1},8,["label"]),e.createVNode(e.unref(d.ElTableColumn),{label:e.unref(n)("vacationSchedule.note"),align:"center"},{default:e.withCtx(l=>[e.createVNode(e.unref(d.ElInput),{modelValue:g.value[E.value[l.$index].ids].days[E.value[l.$index].key].note,"onUpdate:modelValue":C=>g.value[E.value[l.$index].ids].days[E.value[l.$index].key].note=C,style:{width:"100%"},placeholder:" ",class:"noBorder",onBlur:C=>a(E.value[l.$index].ids)},null,8,["modelValue","onUpdate:modelValue","onBlur"])]),_:1},8,["label"])]),_:1},8,["label"])]),_:1},8,["data","empty-text"])]),_:1},8,["loading"]),D.checkEdit?(e.openBlock(),e.createElementBlock("div",he,[F.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(d.ElButton),{key:0,type:"primary",onClick:t[3]||(t[3]=l=>c.value=!0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("vacationSchedule.sendInformation")),1)]),_:1})),D.query==="confirm"?(e.openBlock(),e.createBlock(e.unref(d.ElButton),{key:1,type:"primary",onClick:t[4]||(t[4]=l=>i(!0))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("vacationSchedule.agreeOn")),1)]),_:1})):e.createCommentVNode("",!0),D.query==="confirm"?(e.openBlock(),e.createBlock(e.unref(d.ElButton),{key:2,type:"primary",onClick:t[5]||(t[5]=l=>i(!1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("vacationSchedule.reject")),1)]),_:1})):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.withDirectives((e.openBlock(),e.createBlock(e.unref(d.ElButton),{disabled:b.value,plain:"",onClick:S,style:{"margin-top":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("workSchedule.exportExcel")),1)]),_:1},8,["disabled"])),[[f,b.value]]),e.createVNode(e.unref(d.ElDialog),{title:e.unref(n)("workSchedule.jobTitle"),modelValue:m.value,"onUpdate:modelValue":t[7]||(t[7]=l=>m.value=l),width:"400px"},{footer:e.withCtx(()=>[e.createVNode(e.unref(d.ElButton),{onClick:t[6]||(t[6]=l=>m.value=!1),size:"default"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.$t("workSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(d.ElButton),{size:"default",type:"primary",onClick:j},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.$t("workSchedule.select")),1)]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(d.ElForm),{model:N.value,autocomplete:"on"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,l=>(e.openBlock(),e.createBlock(e.unref(d.ElFormItem),null,{default:e.withCtx(()=>[e.createVNode(e.unref(d.ElSwitch),{modelValue:l.val,"onUpdate:modelValue":C=>l.val=C,"active-text":l.activeText},null,8,["modelValue","onUpdate:modelValue","active-text"])]),_:2},1024))),256))]),_:1},8,["model"])]),_:1},8,["title","modelValue"]),e.createVNode(e.unref(d.ElDialog),{title:e.unref(n)("vacationSchedule.pleaseCoordinate"),modelValue:c.value,"onUpdate:modelValue":t[10]||(t[10]=l=>c.value=l),width:"500px"},{footer:e.withCtx(()=>[e.createVNode(e.unref(d.ElButton),{onClick:t[9]||(t[9]=l=>c.value=!1),size:"default"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("workSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(d.ElButton),{size:"default",type:"primary",onClick:y},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("vacationSchedule.send")),1)]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(d.ElForm),{model:T.value,autocomplete:"on"},{default:e.withCtx(()=>[e.createVNode(e.unref(d.ElSelect),{modelValue:T.value.participants,"onUpdate:modelValue":t[8]||(t[8]=l=>T.value.participants=l),placeholder:e.unref(n)("vacationSchedule.fullName"),multiple:"",size:"default"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.value,l=>(e.openBlock(),e.createBlock(e.unref(d.ElOption),{key:l,label:l,value:l},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["model"])]),_:1},8,["title","modelValue"]),e.createVNode(e.unref(O.ContextMenu),{show:B.value,"onUpdate:show":t[14]||(t[14]=l=>B.value=l),options:Y.value},{default:e.withCtx(()=>[e.createVNode(e.unref(O.ContextMenuItem),{label:v.value.level===3&&typeof v.value.count<"u"?v.value.name+" "+v.value.count+" "+e.unref(n)("vacationSchedule.day",v.value.count):v.value.name,disabled:""},null,8,["label"]),e.createVNode(e.unref(O.ContextMenuSeparator)),v.value.level===2?(e.openBlock(),e.createElementBlock("div",Ce,[v.value.length>1?(e.openBlock(),e.createBlock(e.unref(O.ContextMenuItem),{key:0,label:e.unref(n)("vacationSchedule.deleteLast"),onClick:t[11]||(t[11]=l=>z("delete"))},null,8,["label"])):e.createCommentVNode("",!0),v.value.add?(e.openBlock(),e.createBlock(e.unref(O.ContextMenuItem),{key:1,label:e.unref(n)("vacationSchedule.addVacation"),onClick:t[12]||(t[12]=l=>z("add"))},null,8,["label"])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",ye,[e.createVNode(pe,{data:v.value,range:"range",limitation:{dateStart:"1.01."+u.value,dateEnd:"31.12."+u.value},onInput:s},null,8,["data","limitation"]),e.createElementVNode("div",null,[e.createVNode(e.unref(d.ElButton),{onClick:t[13]||(t[13]=l=>B.value=!1)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("vacationSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(d.ElButton),{onClick:r},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("vacationSchedule.save")),1)]),_:1})])]))]),_:1},8,["show","options"])])}}};module.exports=ke;
1
+ "use strict";const e=require("vue"),V=require("./index-CHGzf-XH.cjs"),W=require("vue-i18n"),Q=require("file-saver"),ee=require("exceljs"),d=require("element-plus"),q=require("@imengyu/vue3-context-menu");function te(D){const x=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(D){for(const n in D)if(n!=="default"){const p=Object.getOwnPropertyDescriptor(D,n);Object.defineProperty(x,n,p.get?p:{enumerable:!0,get:()=>D[n]})}}return x.default=D,Object.freeze(x)}const le=te(ee),ae=(D,x)=>{const n=D.__vccOpts||D;for(const[p,o]of x)n[p]=o;return n},ne={class:"wrapper"},oe={class:"month_year"},ue={class:"text"},re={class:"week"},ie={class:"month"},de=["onClick"],ce={key:0},se={class:"month_year"},ve={class:"text"},me={class:"week"},fe={class:"month"},ge=["onClick"],pe={__name:"DataPicker",props:{data:Object,limitation:{type:[Boolean,Array],default:()=>!1},range:{type:String,default:()=>"solid"}},emits:["init"],setup(D,{emit:x}){var U,P,R,z;const n=e.ref(new Date),p=e.ref(new Date),o=D,F=x,C=e.ref(new Date().getFullYear()),B=e.ref(new Date().getMonth()),Y=e.ref(new Date().getFullYear()),m=e.ref(new Date().getMonth()),c=e.ref([]),T=e.ref(0),_=e.ref(0),h=e.ref(-1),k=e.ref(-1),{locale:A}=W.useI18n(),b=/en|zh|ja|he/.test(A.value)?0:1,N=o.range==="range"?2:1,$=s=>{const r=s.split(s.match(/\D.*?\D?/));return r[0].length>2?r.join("-")+"T00:00:01":r.reverse().join("-")+"T00:00:01"};typeof((U=o.data)==null?void 0:U.startDate)<"u"&&(n.value=new Date($(o.data.startDate)),C.value=n.value.getFullYear(),m.value=n.value.getMonth()),typeof((P=o.data)==null?void 0:P.endDate)<"u"&&(p.value=new Date($(o.data.endDate)),Y.value=p.value.getFullYear(),B.value=p.value.getMonth());const v=()=>{let s=new Date(C.value,m.value,0);for(let a=s.getDate()-s.getDay()+b;a<=s.getDate()&&s.getDay()!==6+b;a++)T.value++,c.value.push({day:a,month:s.getMonth(),year:s.getFullYear(),class:[]});for(let a=1;a<=new Date(C.value,m.value+1,0).getDate();a++)T.value++,c.value.push({day:a,month:m.value,year:C.value,class:[]});if(o.range==="range"){_.value=new Date(C.value,m.value+2,0);for(let a=1;a<=_.value.getDate();a++)c.value.push({day:a,month:_.value.getMonth(),year:_.value.getFullYear(),class:[]})}let r=new Date(C.value,m.value+N,1);console.log(r.getDay());for(let a=1;a<=(7-r.getDay()+b)%7&&r.getDay()!==b;a++)c.value.push({day:a,month:r.getMonth(),year:r.getFullYear(),class:[]});o.data.holiday.length!==0&&(o.data.holiday.preholidays.forEach(a=>{let i=a.split("-");const y=c.value.findIndex(E=>E.year==i[0]&&E.month+1==i[1]&&E.day==i[2]);y!==-1&&(c.value[y].class[0]="preholiday")}),o.data.holiday.holidays.forEach(a=>{let i=a.split("-");const y=c.value.findIndex(E=>E.year==i[0]&&E.month+1==i[1]&&E.day==i[2]);y!==-1&&(c.value[y].class[0]="weekend")}),o.data.holiday.holiday.forEach(a=>{let i=a.split("-");const y=c.value.findIndex(E=>E.year==i[0]&&E.month+1==i[1]&&E.day==i[2]);y!==-1&&(c.value[y].class[0]="holiday")}),o.data.holiday.nowork.forEach(a=>{let i=a.split("-");const y=c.value.findIndex(E=>E.year==i[0]&&E.month+1==i[1]&&E.day==i[2]);y!==-1&&(c.value[y].class[0]="nowork")}))},L=(s,r)=>{let a=s-r+1;for(let i=0;i<=s-r;i++)c.value[i+r].class[0]==="holiday"&&a--;return a},S=(s,r)=>{const a=V.parseTime(new Date(s.year,s.month,s.day),"{dd}.{m}.{Y}");if(o.range==="range")if(console.log(h.value),k.value!==-1){if(k.value<=h.value)for(let i=k.value;i<=h.value;i++)c.value[i].class[1]="";else for(let i=h.value;i<=k.value;i++)c.value[i].class[1]="";h.value=r,k.value=-1,c.value[r].class[1]="active"}else if(h.value!==-1){if(k.value=r,k.value>=h.value)for(let y=h.value+1;y<r;y++)c.value[y].class[1]="select";else for(let y=r+1;y<h.value;y++)c.value[y].class[1]="select";c.value[r].class[1]="active";let i=V.parseTime(new Date(c.value[h.value].year,c.value[h.value].month,c.value[h.value].day),"{dd}.{m}.{Y}");h.value>r?F("input",{dateStart:a,dateEnd:i,count:L(h.value,r)}):F("input",{dateStart:i,dateEnd:a,count:L(r,h.value)})}else h.value=r,c.value[r].class[1]="active";else c.value[h.value].class[1]="",h.value=r,c.value[r].class[1]="active",F("input",{dateStart:a,count:1})};if(v(),typeof((R=o.data)==null?void 0:R.startDate)<"u"&&(h.value=c.value.findIndex(s=>s.day===n.value.getDate()&&s.month===m.value&&s.year===C.value),c.value[h.value].class[1]="active"),typeof((z=o.data)==null?void 0:z.endDate)<"u"&&o.range==="range"){k.value=c.value.findIndex(s=>s.day===p.value.getDate()&&s.month===B.value&&s.year===Y.value),c.value[k.value].class[1]="active";for(let s=h.value+1;s<k.value;s++)c.value[s].class[1]="select"}const I=(s,r)=>{j(s,r)&&(c.value=[],T.value=0,n.value=new Date(s,r,1),C.value=n.value.getFullYear(),m.value=n.value.getMonth(),v())},j=(s,r)=>{if(!o.limitation)return!0;if(o.limitation[0].dateStart){console.log(o.limitation[0].dateStart);let a=o.limitation[0].dateStart.split(o.limitation[0].dateStart.match(/\D.*?\D?/));if(a[0].length>2&&a.reverse(),parseInt(a[2])>s||parseInt(a[2])===s&&parseInt(a[1])>r+1)return!1}if(o.limitation[o.limitation.length-1].dateEnd){console.log(o.limitation[o.limitation.length-1].dateEnd);let a=o.limitation[o.limitation.length-1].dateEnd.split(o.limitation[o.limitation.length-1].dateEnd.match(/\D.*?\D?/));if(a[0].length>2&&a.reverse(),parseInt(a[2])<s||parseInt(a[2])===s&&parseInt(a[1])<r+N)return!1}return!0};return(s,r)=>(e.openBlock(),e.createElementBlock("div",ne,[e.createElementVNode("div",null,[e.createElementVNode("p",oe,[e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:r[0]||(r[0]=a=>I(C.value-1,m.value))},"«"),e.createElementVNode("button",{onClick:r[1]||(r[1]=a=>I(C.value,m.value-1))},"‹")]),e.createElementVNode("span",ue,[e.createElementVNode("button",null,e.toDisplayString(C.value),1),e.createElementVNode("button",null,e.toDisplayString(e.unref(V.parseTime)(n.value.setMonth(m.value),"{F}")),1)]),e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:r[2]||(r[2]=a=>I(C.value,m.value+1))},"›"),e.createElementVNode("button",{onClick:r[3]||(r[3]=a=>I(C.value+1,m.value))},"»")])]),e.createElementVNode("div",re,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(7,(a,i)=>e.createElementVNode("button",{key:i,class:"disabled"},e.toDisplayString(e.unref(V.parseTime)(new Date(1970,1,a+e.unref(b)),"{D}")),1)),64))]),e.createElementVNode("div",ie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(a,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[i<T.value+(7-new Date(C.value,m.value+1,1).getDay()+e.unref(b))%7?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(a.month===m.value&&(!o.limitation||new Date(a.year,a.month,a.day+1).getTime()>new Date($(o.limitation[0].dateStart)).getTime()&&new Date(a.year,a.month,a.day).getTime()<new Date($(o.limitation[0].dateEnd)).getTime())?a.class:"disabled"),onClick:()=>{a.month===m.value&&S(a,i)}},e.toDisplayString(a.day),11,de)):e.createCommentVNode("",!0)],64))),128))])]),o.range==="range"?(e.openBlock(),e.createElementBlock("div",ce,[e.createElementVNode("p",se,[e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:r[4]||(r[4]=a=>I(C.value-1,m.value))},"«"),e.createElementVNode("button",{onClick:r[5]||(r[5]=a=>I(C.value,m.value-1))},"‹")]),e.createElementVNode("span",ve,[e.createElementVNode("button",null,e.toDisplayString(new Date(C.value,m.value+1).getFullYear()),1),e.createElementVNode("button",null,e.toDisplayString(e.unref(V.parseTime)(n.value.setMonth(m.value+1),"{F}")),1)]),e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:r[6]||(r[6]=a=>I(C.value,m.value+1))},"›"),e.createElementVNode("button",{onClick:r[7]||(r[7]=a=>I(C.value+1,m.value))},"»")])]),e.createElementVNode("div",me,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(7,(a,i)=>e.createElementVNode("button",{key:i,class:"disabled"},e.toDisplayString(e.unref(V.parseTime)(new Date(1970,1,a+e.unref(b)),"{D}")),1)),64))]),e.createElementVNode("div",fe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(a,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[i>=T.value-(7+new Date(C.value,m.value+1,1).getDay()-e.unref(b))%7?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(a.month===_.value.getMonth()&&(!o.limitation||new Date(a.year,a.month,a.day+1).getTime()>new Date($(o.limitation[0].dateStart)).getTime()&&new Date(a.year,a.month,a.day).getTime()<new Date($(o.limitation[0].dateEnd)).getTime())?a.class:"disabled"),onClick:()=>{a.month===_.value.getMonth()&&S(a,i)}},e.toDisplayString(a.day),11,ge)):e.createCommentVNode("",!0)],64))),128))])])):e.createCommentVNode("",!0)]))}},he=ae(pe,[["__scopeId","data-v-5b3d4c74"]]),Ce={key:1,class:"controls-container",style:{"margin-top":".5rem"}},ye={key:0},ke={key:1,style:{padding:"0 1rem .5rem"}},xe={__name:"VacationTable",props:{checkEdit:{type:Boolean,default:()=>!0},odata:Object,workSchedule:Object,query:String,fullName:{type:String,default:"Вы"}},setup(D){const x=D,{t:n}=W.useI18n(),p=e.ref([]);e.ref([]);const o=e.ref(new Date().getFullYear()),F=e.ref(!1),C=e.ref(!1),B=e.ref(!1),Y=e.ref({zIndex:3,minWidth:230,x:500,y:200}),m=e.ref(!1),c=e.ref(!1),T=e.ref({participants:[]}),_=e.ref([]),h=e.ref([]),k=e.ref("all"),A=e.ref([{value:"all",label:n("vacationSchedule.all"),key:"all"}]),b=e.ref(!1),N=e.ref([]),$=e.ref(!1),v=e.ref({name:"",length:0,code:""}),L=new Date().getMonth()>11?[{value:o.value,label:o.value},{value:o.value+1,label:o.value+1}]:[{value:o.value-1,label:o.value-1},{value:o.value,label:o.value}];e.watch(k,async(u,t)=>{u!==t&&(N.value=[],F.value=!1,x.odata.personalManagerData.forEach(f=>{(f.Status!=="Увольнение"&&f.Group===u||u==="all")&&(N.value.some(l=>(l==null?void 0:l.activeText)===f.Role)||N.value.push({val:!0,activeText:f.Role}))}),j())});const S=e.computed(()=>p.value.flatMap((u,t)=>!u.days||u.days.length===0?[{...u,key:0,ids:t}]:u.days.map((f,l)=>({ids:t,key:l,...u,...f})))),I=async()=>{x.odata.getPersonalManagerData({}).then(u=>{var t;k.value=(t=u.find(f=>f.Status!=="Увольнение"&&f.Description===x.fullName))==null?void 0:t.Group,u.forEach(f=>{f.Status!=="Увольнение"&&(A.value.some(l=>(l==null?void 0:l.value)===f.Group)||A.value.push({value:f.Group,label:f.Group,key:f.Group}),f.Group===k.value&&!N.value.some(l=>(l==null?void 0:l.activeText)===f.Role)&&N.value.push({val:!0,activeText:f.Role}))}),j(),C.value=!1})},j=()=>{p.value=[];let u=[];x.odata.personalManagerData.forEach(t=>{t.Status!=="Увольнение"&&(t.Group===k.value||k.value==="all")&&N.value.some(f=>f.val&&f.activeText===t.Role)&&(u.push(t.Code),p.value.push({name:t.Description,days:[{note:""}],jobTitle:t.Role,code:t.Code}))}),U(u),m.value=!1},U=u=>{x.workSchedule.getAllVacations({year:o.value}).then(t=>{u.forEach((f,l)=>{p.value[l].days=[{note:""}],t.forEach(g=>{f===g.code&&(typeof p.value[l].days[0].dateStart>"u"?p.value[l].days[0]={dateStart:V.parseTime(g.dateStart,"{dd}.{m}.{Y}"),dateEnd:V.parseTime(g.dateEnd,"{dd}.{m}.{Y}"),note:g.note,count:g.count}:p.value[l].days.push({dateStart:V.parseTime(g.dateStart,"{dd}.{m}.{Y}"),dateEnd:V.parseTime(g.dateEnd,"{dd}.{m}.{Y}"),note:g.note,count:g.count}))})})})},P=u=>{if(u.columnIndex<3&&S.value[u.rowIndex].key<S.value[u.rowIndex].days.length)return S.value[u.rowIndex].key===0?{rowspan:S.value[u.rowIndex].days.length,colspan:1}:{rowspan:0,colspan:0}},R=(u,t,f,l)=>{v.value.ids=u.ids,v.value.key=u.key,v.value.startDate=u.dateStart,v.value.endDate=u.dateEnd,v.value.name=u.name,v.value.count=u.count,v.value.allCount=()=>u.days.length===0?0:u.days.reduce((g,O,M)=>M!==u.key?g+parseInt(O.count):g,0),v.value.length=u.days.length,v.value.add=u.days.length>0&&u.days[u.days.length-1].count,v.value.level=t.level,v.value.holiday=h.value,Y.value.y=l.clientY,Y.value.x=l.clientX,t.level===2&&t.no<4&&(v.value.add||u.days.length>1)&&(B.value=!0),t.level===3&&(B.value=!0)},z=u=>{let t=p.value[v.value.ids];switch(u){case"add":t.days.push({note:""}),console.log(t.days.length);break;case"delete":delete t.days.pop(),a(v.value.ids);break}B.value=!1},s=u=>{$.value=u,v.value.count=u.count},r=()=>{$.value&&(p.value[v.value.ids].days[v.value.key]={...$.value,note:""},a(v.value.ids)),B.value=!1},a=u=>{x.workSchedule.rewriteFull({year:o.value,code:p.value[u].code,data:p.value[u].days.map(t=>({dateStart:t.dateStart.split(".").reverse().join("-"),dateEnd:t.dateEnd.split(".").reverse().join("-"),note:t.note,count:t.count}))})},i=u=>{x.workSchedule.sendConfirmMessage({fullname:x.fullName,confirm:u}),x.query=""},y=()=>{x.workSchedule.sendAgreementMessage({users:T.value.participants}),c.value=!1};x.workSchedule.getBoss().then(u=>{_.value=u[0].users}),V.holidays().then(u=>{h.value=u,I()});const E=()=>v.value.length<2?[{dateStart:"01.01."+o.value,dateEnd:"31.12."+o.value}]:[{dateStart:"01.01."+o.value,dateEnd:"31.12."+o.value}],X=async()=>{b.value=!0;const u=new le.Workbook,t=u.addWorksheet(o.value.toString(),{pageSetup:{paperSize:9,orientation:"landscape",fitToPage:!0}}),f={vertical:"middle",horizontal:"center"},l={top:{style:"thin"},left:{style:"thin"},bottom:{style:"thin"},right:{style:"thin"}},g={vertical:"middle",horizontal:"center",wrapText:!0},O={vertical:"middle",horizontal:"right",wrapText:!0};t.mergeCells("D1:G1"),t.mergeCells("D2:G2"),t.mergeCells("D3:G3"),t.mergeCells("D4:G4"),t.mergeCells("A5:G5"),t.mergeCells("A6:G6"),t.mergeCells("A9:G9"),t.mergeCells("A10:A11"),t.mergeCells("B10:B11"),t.mergeCells("C10:C11"),t.mergeCells("D10:F10"),t.mergeCells("G10:G11"),t.getCell("D1").value=n("vacationSchedule.approve"),t.getCell("D2").value=n("vacationSchedule.dateApprove",{year:o.value-1}),t.getCell("D3").value=n("workSchedule.printPlace"),t.getCell("D4").value=n("vacationSchedule.dateApprove",{year:o.value-1}),t.getCell("A5").value=n("workSchedule.firm"),t.getCell("B7").value=n("vacationSchedule.vacationSchedule"),t.getCell("C7").value=n("vacationSchedule.numberDocs"),t.getCell("D7").value=n("vacationSchedule.compilation"),t.getCell("E7").value=n("vacationSchedule.year"),t.getCell("C8").value="",t.getCell("D8").value="",t.getCell("E8").value=o.value,t.getCell("E7").value=n("vacationSchedule.year"),t.getCell("A10").value=n("vacationSchedule.jobTitle"),t.getCell("B10").value=n("vacationSchedule.fullName"),t.getCell("C10").value=n("vacationSchedule.personnelNumber"),t.getCell("D10").value=n("vacationSchedule.vacation"),t.getCell("D11").value=n("vacationSchedule.days"),t.getCell("E11").value=n("vacationSchedule.date"),t.getCell("F11").value=n("vacationSchedule.endDate"),t.getCell("G11").value=n("vacationSchedule.note"),t.getRow(1).height=80,t.getColumn(1).width=28,t.getColumn(2).width=28,t.getColumn(3).width=18,t.getColumn(4).width=18,t.getColumn(5).width=14,t.getColumn(6).width=14,t.getColumn(7).width=14,t.getColumn(1).alignment=g,t.getColumn(2).alignment=g,t.getColumn(3).alignment=g,t.getColumn(4).alignment=g,t.getColumn(5).alignment=g,t.getColumn(6).alignment=g,t.getColumn(7).alignment=g,t.getCell("D1").alignment=O,t.getCell("D2").alignment=O,t.getCell("D4").alignment=O,t.getCell("A5").alignment=f,t.getCell("C7").border=l,t.getCell("D7").border=l,t.getCell("E7").border=l,t.getCell("C8").border=l,t.getCell("D8").border=l,t.getCell("E8").border=l,t.getCell("A10").border=l,t.getCell("B10").border=l,t.getCell("C10").border=l,t.getCell("D10").border=l,t.getCell("G10").border=l,t.getCell("D11").border=l,t.getCell("E11").border=l,t.getCell("F11").border=l;let M=11;for(const w of p.value)if(w.days.length>1)w.days.forEach(G=>{let J=[w.jobTitle,w.name,w.code,G.count,G.dateStart,G.dateEnd,G.note];const Z=t.addRow(J);Z.border=l,M++}),t.mergeCells(`A${M-w.days.length+1}:A${M}`),t.mergeCells(`B${M-w.days.length+1}:B${M}`),t.mergeCells(`C${M-w.days.length+1}:C${M}`);else{let G=[w.jobTitle,w.name,w.code,w.days[0].count,w.days[0].dateStart,w.days[0].dateEnd,w.days[0].note];const J=t.addRow(G);J.border=l,M++}const H="export_"+V.parseTime(Date.now(),"{dd}.{m}.{Y}")+".xlsx",K=await u.xlsx.writeBuffer();Q.saveAs(new Blob([K]),H),b.value=!1};return(u,t)=>{const f=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",null,[D.checkEdit?(e.openBlock(),e.createBlock(e.unref(d.ElSelect),{key:0,modelValue:k.value,"onUpdate:modelValue":t[0]||(t[0]=l=>k.value=l),placeholder:"Select",style:{width:"240px","margin-bottom":".5rem","margin-right":".5rem"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(A.value,l=>(e.openBlock(),e.createBlock(e.unref(d.ElOption),{key:l.value,label:l.label,value:l.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])):e.createCommentVNode("",!0),e.createVNode(e.unref(d.ElButton),{plain:"",onClick:t[1]||(t[1]=l=>m.value=!0),style:{"margin-bottom":".5rem","margin-right":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("workSchedule.jobTitle")),1)]),_:1}),e.createVNode(e.unref(d.ElSelect),{modelValue:o.value,"onUpdate:modelValue":t[2]||(t[2]=l=>o.value=l),onChange:j,placeholder:"Year",style:{width:"80px","margin-bottom":".5rem","margin-right":".5rem"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(L),l=>(e.openBlock(),e.createBlock(e.unref(d.ElOption),{key:l.value,label:l.label,value:l.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),e.createVNode(e.unref(d.ElSkeleton),{style:{width:"100%"},loading:C.value,animated:""},{template:e.withCtx(()=>[e.createVNode(e.unref(d.ElSkeletonItem),{variant:"text",style:{width:"100%",height:"2rem"}}),e.createVNode(e.unref(d.ElSkeletonItem),{variant:"text",style:{width:"180px",height:"4rem","margin-right":"4px"}}),e.createVNode(e.unref(d.ElSkeletonItem),{variant:"text",style:{width:"calc( 100% - 184px)",height:"4rem"}}),e.createVNode(e.unref(d.ElSkeletonItem),{variant:"text",style:{width:"180px",height:"8rem","margin-right":"4px"}}),e.createVNode(e.unref(d.ElSkeletonItem),{variant:"text",style:{width:"calc( 100% - 184px)",height:"8rem"}})]),default:e.withCtx(()=>[e.createVNode(e.unref(d.ElTable),{id:"printTable",data:S.value,"span-method":P,onCellClick:R,border:"",style:{width:"100%"},size:"small","empty-text":e.unref(n)("vacationSchedule.emptyText")},{default:e.withCtx(()=>[e.createVNode(e.unref(d.ElTableColumn),{label:k.value!=="all"?e.unref(n)("vacationSchedule.title",{name:k.value}):e.unref(n)("vacationSchedule.enterprise")+` ${o.value}`,align:"center",height:"34"},{default:e.withCtx(()=>[e.createVNode(e.unref(d.ElTableColumn),{label:e.unref(n)("vacationSchedule.jobTitle"),width:"180",align:"center"},{default:e.withCtx(l=>[e.createTextVNode(e.toDisplayString(S.value[l.$index].jobTitle),1)]),_:1},8,["label"]),e.createVNode(e.unref(d.ElTableColumn),{label:e.unref(n)("vacationSchedule.fullName"),width:"180",align:"center"},{default:e.withCtx(l=>[e.createTextVNode(e.toDisplayString(S.value[l.$index].name),1)]),_:1},8,["label"]),e.createVNode(e.unref(d.ElTableColumn),{label:e.unref(n)("vacationSchedule.personnelNumber"),align:"center"},{default:e.withCtx(l=>[e.createTextVNode(e.toDisplayString(S.value[l.$index].code),1)]),_:1},8,["label"]),e.createVNode(e.unref(d.ElTableColumn),{label:e.unref(n)("vacationSchedule.vacation"),align:"center"},{default:e.withCtx(()=>[e.createVNode(e.unref(d.ElTableColumn),{label:e.unref(n)("vacationSchedule.days"),align:"center"},{default:e.withCtx(l=>[e.createTextVNode(e.toDisplayString(S.value[l.$index].count),1)]),_:1},8,["label"]),e.createVNode(e.unref(d.ElTableColumn),{label:e.unref(n)("vacationSchedule.date"),align:"center"},{default:e.withCtx(l=>[e.createTextVNode(e.toDisplayString(S.value[l.$index].dateStart),1)]),_:1},8,["label"]),e.createVNode(e.unref(d.ElTableColumn),{label:e.unref(n)("vacationSchedule.endDate"),align:"center"},{default:e.withCtx(l=>[e.createTextVNode(e.toDisplayString(S.value[l.$index].dateEnd),1)]),_:1},8,["label"])]),_:1},8,["label"]),e.createVNode(e.unref(d.ElTableColumn),{label:e.unref(n)("vacationSchedule.note"),align:"center"},{default:e.withCtx(l=>[e.createVNode(e.unref(d.ElInput),{modelValue:p.value[S.value[l.$index].ids].days[S.value[l.$index].key].note,"onUpdate:modelValue":g=>p.value[S.value[l.$index].ids].days[S.value[l.$index].key].note=g,style:{width:"100%"},placeholder:" ",class:"noBorder",onBlur:g=>a(S.value[l.$index].ids)},null,8,["modelValue","onUpdate:modelValue","onBlur"])]),_:1},8,["label"])]),_:1},8,["label"])]),_:1},8,["data","empty-text"])]),_:1},8,["loading"]),D.checkEdit?(e.openBlock(),e.createElementBlock("div",Ce,[F.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(d.ElButton),{key:0,type:"primary",onClick:t[3]||(t[3]=l=>c.value=!0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("vacationSchedule.sendInformation")),1)]),_:1})),D.query==="confirm"?(e.openBlock(),e.createBlock(e.unref(d.ElButton),{key:1,type:"primary",onClick:t[4]||(t[4]=l=>i(!0))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("vacationSchedule.agreeOn")),1)]),_:1})):e.createCommentVNode("",!0),D.query==="confirm"?(e.openBlock(),e.createBlock(e.unref(d.ElButton),{key:2,type:"primary",onClick:t[5]||(t[5]=l=>i(!1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("vacationSchedule.reject")),1)]),_:1})):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.withDirectives((e.openBlock(),e.createBlock(e.unref(d.ElButton),{disabled:b.value,plain:"",onClick:X,style:{"margin-top":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("workSchedule.exportExcel")),1)]),_:1},8,["disabled"])),[[f,b.value]]),e.createVNode(e.unref(d.ElDialog),{title:e.unref(n)("workSchedule.jobTitle"),modelValue:m.value,"onUpdate:modelValue":t[7]||(t[7]=l=>m.value=l),width:"400px"},{footer:e.withCtx(()=>[e.createVNode(e.unref(d.ElButton),{onClick:t[6]||(t[6]=l=>m.value=!1),size:"default"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.$t("workSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(d.ElButton),{size:"default",type:"primary",onClick:j},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.$t("workSchedule.select")),1)]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(d.ElForm),{model:N.value,autocomplete:"on"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,l=>(e.openBlock(),e.createBlock(e.unref(d.ElFormItem),null,{default:e.withCtx(()=>[e.createVNode(e.unref(d.ElSwitch),{modelValue:l.val,"onUpdate:modelValue":g=>l.val=g,"active-text":l.activeText},null,8,["modelValue","onUpdate:modelValue","active-text"])]),_:2},1024))),256))]),_:1},8,["model"])]),_:1},8,["title","modelValue"]),e.createVNode(e.unref(d.ElDialog),{title:e.unref(n)("vacationSchedule.pleaseCoordinate"),modelValue:c.value,"onUpdate:modelValue":t[10]||(t[10]=l=>c.value=l),width:"500px"},{footer:e.withCtx(()=>[e.createVNode(e.unref(d.ElButton),{onClick:t[9]||(t[9]=l=>c.value=!1),size:"default"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("workSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(d.ElButton),{size:"default",type:"primary",onClick:y},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("vacationSchedule.send")),1)]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(d.ElForm),{model:T.value,autocomplete:"on"},{default:e.withCtx(()=>[e.createVNode(e.unref(d.ElSelect),{modelValue:T.value.participants,"onUpdate:modelValue":t[8]||(t[8]=l=>T.value.participants=l),placeholder:e.unref(n)("vacationSchedule.fullName"),multiple:"",size:"default"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,l=>(e.openBlock(),e.createBlock(e.unref(d.ElOption),{key:l,label:l,value:l},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["model"])]),_:1},8,["title","modelValue"]),e.createVNode(e.unref(q.ContextMenu),{show:B.value,"onUpdate:show":t[14]||(t[14]=l=>B.value=l),options:Y.value},{default:e.withCtx(()=>[e.createVNode(e.unref(q.ContextMenuItem),{label:v.value.level===3&&typeof v.value.count<"u"?v.value.name+" "+v.value.count+" "+e.unref(n)("vacationSchedule.day",v.value.count)+` ${e.unref(n)("vacationSchedule.from")}: ${v.value.allCount()+parseInt(v.value.count)}`:v.value.name,disabled:""},null,8,["label"]),e.createVNode(e.unref(q.ContextMenuSeparator)),v.value.level===2?(e.openBlock(),e.createElementBlock("div",ye,[v.value.length>1?(e.openBlock(),e.createBlock(e.unref(q.ContextMenuItem),{key:0,label:e.unref(n)("vacationSchedule.deleteLast"),onClick:t[11]||(t[11]=l=>z("delete"))},null,8,["label"])):e.createCommentVNode("",!0),v.value.add?(e.openBlock(),e.createBlock(e.unref(q.ContextMenuItem),{key:1,label:e.unref(n)("vacationSchedule.addVacation"),onClick:t[12]||(t[12]=l=>z("add"))},null,8,["label"])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",ke,[e.createVNode(he,{data:v.value,range:"range",limitation:E(),onInput:s},null,8,["data","limitation"]),e.createElementVNode("div",null,[e.createVNode(e.unref(d.ElButton),{onClick:t[13]||(t[13]=l=>B.value=!1)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("vacationSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(d.ElButton),{onClick:r},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("vacationSchedule.save")),1)]),_:1})])]))]),_:1},8,["show","options"])])}}};module.exports=xe;
@@ -1,201 +1,202 @@
1
- import { ref as f, openBlock as h, createElementBlock as $, createElementVNode as y, toDisplayString as C, unref as a, Fragment as O, renderList as W, normalizeClass as re, createCommentVNode as R, watch as pe, computed as ye, resolveDirective as Ce, createBlock as B, withCtx as c, createVNode as v, createTextVNode as V, withDirectives as be } from "vue";
2
- import { p as G, h as De } from "./index-uVRk2ARj.js";
1
+ import { ref as f, openBlock as h, createElementBlock as $, createElementVNode as y, toDisplayString as b, unref as a, Fragment as P, renderList as W, normalizeClass as re, createCommentVNode as O, watch as ye, computed as Ce, resolveDirective as be, createBlock as B, withCtx as m, createVNode as v, createTextVNode as V, withDirectives as De } from "vue";
2
+ import { p as G, h as Se } from "./index-uVRk2ARj.js";
3
3
  import { useI18n as me } from "vue-i18n";
4
- import { saveAs as Se } from "file-saver";
5
- import * as we from "exceljs";
6
- import { ElSelect as de, ElOption as ie, ElButton as F, ElSkeleton as xe, ElSkeletonItem as ee, ElTable as ke, ElTableColumn as q, ElInput as Ee, ElDialog as ve, ElForm as ce, ElFormItem as $e, ElSwitch as Te } from "element-plus";
7
- import { ContextMenu as Ve, ContextMenuItem as se, ContextMenuSeparator as Me } from "@imengyu/vue3-context-menu";
8
- const Ie = (A, M) => {
4
+ import { saveAs as we } from "file-saver";
5
+ import * as xe from "exceljs";
6
+ import { ElSelect as ie, ElOption as de, ElButton as F, ElSkeleton as ke, ElSkeletonItem as le, ElTable as Ee, ElTableColumn as L, ElInput as $e, ElDialog as ve, ElForm as ce, ElFormItem as Te, ElSwitch as Ve } from "element-plus";
7
+ import { ContextMenu as Me, ContextMenuItem as se, ContextMenuSeparator as Ie } from "@imengyu/vue3-context-menu";
8
+ const _e = (A, M) => {
9
9
  const n = A.__vccOpts || A;
10
- for (const [w, u] of M)
11
- n[w] = u;
10
+ for (const [w, o] of M)
11
+ n[w] = o;
12
12
  return n;
13
- }, _e = { class: "wrapper" }, Ye = { class: "month_year" }, Be = { class: "text" }, Fe = { class: "week" }, Ge = { class: "month" }, Ae = ["onClick"], je = { key: 0 }, ze = { class: "month_year" }, Ne = { class: "text" }, Ue = { class: "week" }, Re = { class: "month" }, Oe = ["onClick"], Pe = {
13
+ }, Ye = { class: "wrapper" }, Be = { class: "month_year" }, Fe = { class: "text" }, Ge = { class: "week" }, Ae = { class: "month" }, je = ["onClick"], ze = { key: 0 }, Ne = { class: "month_year" }, Ue = { class: "text" }, Re = { class: "week" }, Oe = { class: "month" }, Pe = ["onClick"], qe = {
14
14
  __name: "DataPicker",
15
15
  props: {
16
16
  data: Object,
17
- limitation: { type: [Boolean, Object], default: () => !1 },
17
+ limitation: { type: [Boolean, Array], default: () => !1 },
18
18
  // {dateEnd:"30.12.2024",dateStart:"30.11.2024"}
19
19
  range: { type: String, default: () => "solid" }
20
20
  // range | solid
21
21
  },
22
22
  emits: ["init"],
23
23
  setup(A, { emit: M }) {
24
- var te, ae, ne, Q;
25
- const n = f(/* @__PURE__ */ new Date()), w = f(/* @__PURE__ */ new Date()), u = A, J = M, D = f((/* @__PURE__ */ new Date()).getFullYear()), j = f((/* @__PURE__ */ new Date()).getMonth()), X = f((/* @__PURE__ */ new Date()).getFullYear()), g = f((/* @__PURE__ */ new Date()).getMonth()), s = f([]), z = f(0), P = f(0), b = f(-1), k = f(-1), { locale: Z } = me(), _ = /en|zh|ja|he/.test(Z.value) ? 0 : 1, Y = u.range === "range" ? 2 : 1, N = (r) => {
26
- const d = r.split(r.match(/\D.*?\D?/));
27
- return d[0].length > 2 ? d.join("-") + "T00:00:01" : d.reverse().join("-") + "T00:00:01";
24
+ var ae, ne, oe, Q;
25
+ const n = f(/* @__PURE__ */ new Date()), w = f(/* @__PURE__ */ new Date()), o = A, J = M, S = f((/* @__PURE__ */ new Date()).getFullYear()), j = f((/* @__PURE__ */ new Date()).getMonth()), X = f((/* @__PURE__ */ new Date()).getFullYear()), g = f((/* @__PURE__ */ new Date()).getMonth()), s = f([]), z = f(0), q = f(0), D = f(-1), k = f(-1), { locale: Z } = me(), _ = /en|zh|ja|he/.test(Z.value) ? 0 : 1, Y = o.range === "range" ? 2 : 1, N = (r) => {
26
+ const i = r.split(r.match(/\D.*?\D?/));
27
+ return i[0].length > 2 ? i.join("-") + "T00:00:01" : i.reverse().join("-") + "T00:00:01";
28
28
  };
29
- typeof ((te = u.data) == null ? void 0 : te.startDate) < "u" && (n.value = new Date(N(u.data.startDate)), D.value = n.value.getFullYear(), g.value = n.value.getMonth()), typeof ((ae = u.data) == null ? void 0 : ae.endDate) < "u" && (w.value = new Date(N(u.data.endDate)), X.value = w.value.getFullYear(), j.value = w.value.getMonth());
30
- const m = () => {
31
- let r = new Date(D.value, g.value, 0);
29
+ typeof ((ae = o.data) == null ? void 0 : ae.startDate) < "u" && (n.value = new Date(N(o.data.startDate)), S.value = n.value.getFullYear(), g.value = n.value.getMonth()), typeof ((ne = o.data) == null ? void 0 : ne.endDate) < "u" && (w.value = new Date(N(o.data.endDate)), X.value = w.value.getFullYear(), j.value = w.value.getMonth());
30
+ const c = () => {
31
+ let r = new Date(S.value, g.value, 0);
32
32
  for (let t = r.getDate() - r.getDay() + _; t <= r.getDate() && r.getDay() !== 6 + _; t++)
33
33
  z.value++, s.value.push({ day: t, month: r.getMonth(), year: r.getFullYear(), class: [] });
34
- for (let t = 1; t <= new Date(D.value, g.value + 1, 0).getDate(); t++)
35
- z.value++, s.value.push({ day: t, month: g.value, year: D.value, class: [] });
36
- if (u.range === "range") {
37
- P.value = new Date(D.value, g.value + 2, 0);
38
- for (let t = 1; t <= P.value.getDate(); t++)
39
- s.value.push({ day: t, month: P.value.getMonth(), year: P.value.getFullYear(), class: [] });
34
+ for (let t = 1; t <= new Date(S.value, g.value + 1, 0).getDate(); t++)
35
+ z.value++, s.value.push({ day: t, month: g.value, year: S.value, class: [] });
36
+ if (o.range === "range") {
37
+ q.value = new Date(S.value, g.value + 2, 0);
38
+ for (let t = 1; t <= q.value.getDate(); t++)
39
+ s.value.push({ day: t, month: q.value.getMonth(), year: q.value.getFullYear(), class: [] });
40
40
  }
41
- let d = new Date(D.value, g.value + Y, 1);
42
- for (let t = 1; t <= (7 - d.getDay() + _) % 7 && d.getDay() !== _; t++)
43
- s.value.push({ day: t, month: d.getMonth(), year: d.getFullYear(), class: [] });
44
- u.data.holiday.length !== 0 && (u.data.holiday.preholidays.forEach((t) => {
45
- let i = t.split("-");
46
- const x = s.value.findIndex((T) => T.year == i[0] && T.month + 1 == i[1] && T.day == i[2]);
41
+ let i = new Date(S.value, g.value + Y, 1);
42
+ console.log(i.getDay());
43
+ for (let t = 1; t <= (7 - i.getDay() + _) % 7 && i.getDay() !== _; t++)
44
+ s.value.push({ day: t, month: i.getMonth(), year: i.getFullYear(), class: [] });
45
+ o.data.holiday.length !== 0 && (o.data.holiday.preholidays.forEach((t) => {
46
+ let d = t.split("-");
47
+ const x = s.value.findIndex((T) => T.year == d[0] && T.month + 1 == d[1] && T.day == d[2]);
47
48
  x !== -1 && (s.value[x].class[0] = "preholiday");
48
- }), u.data.holiday.holidays.forEach((t) => {
49
- let i = t.split("-");
50
- const x = s.value.findIndex((T) => T.year == i[0] && T.month + 1 == i[1] && T.day == i[2]);
49
+ }), o.data.holiday.holidays.forEach((t) => {
50
+ let d = t.split("-");
51
+ const x = s.value.findIndex((T) => T.year == d[0] && T.month + 1 == d[1] && T.day == d[2]);
51
52
  x !== -1 && (s.value[x].class[0] = "weekend");
52
- }), u.data.holiday.holiday.forEach((t) => {
53
- let i = t.split("-");
54
- const x = s.value.findIndex((T) => T.year == i[0] && T.month + 1 == i[1] && T.day == i[2]);
53
+ }), o.data.holiday.holiday.forEach((t) => {
54
+ let d = t.split("-");
55
+ const x = s.value.findIndex((T) => T.year == d[0] && T.month + 1 == d[1] && T.day == d[2]);
55
56
  x !== -1 && (s.value[x].class[0] = "holiday");
56
- }), u.data.holiday.nowork.forEach((t) => {
57
- let i = t.split("-");
58
- const x = s.value.findIndex((T) => T.year == i[0] && T.month + 1 == i[1] && T.day == i[2]);
57
+ }), o.data.holiday.nowork.forEach((t) => {
58
+ let d = t.split("-");
59
+ const x = s.value.findIndex((T) => T.year == d[0] && T.month + 1 == d[1] && T.day == d[2]);
59
60
  x !== -1 && (s.value[x].class[0] = "nowork");
60
61
  }));
61
- }, le = (r, d) => {
62
- let t = r - d + 1;
63
- for (let i = 0; i <= r - d; i++)
64
- s.value[i + d].class[0] === "holiday" && t--;
62
+ }, te = (r, i) => {
63
+ let t = r - i + 1;
64
+ for (let d = 0; d <= r - i; d++)
65
+ s.value[d + i].class[0] === "holiday" && t--;
65
66
  return t;
66
- }, E = (r, d) => {
67
+ }, E = (r, i) => {
67
68
  const t = G(new Date(r.year, r.month, r.day), "{dd}.{m}.{Y}");
68
- if (u.range === "range")
69
- if (console.log(b.value), k.value !== -1) {
70
- if (k.value <= b.value)
71
- for (let i = k.value; i <= b.value; i++) s.value[i].class[1] = "";
72
- else for (let i = b.value; i <= k.value; i++) s.value[i].class[1] = "";
73
- b.value = d, k.value = -1, s.value[d].class[1] = "active";
74
- } else if (b.value !== -1) {
75
- if (k.value = d, k.value >= b.value)
76
- for (let x = b.value + 1; x < d; x++) s.value[x].class[1] = "select";
77
- else for (let x = d + 1; x < b.value; x++) s.value[x].class[1] = "select";
78
- s.value[d].class[1] = "active";
79
- let i = G(new Date(s.value[b.value].year, s.value[b.value].month, s.value[b.value].day), "{dd}.{m}.{Y}");
80
- b.value > d ? J("input", { dateStart: t, dateEnd: i, count: le(b.value, d) }) : J("input", { dateStart: i, dateEnd: t, count: le(d, b.value) });
69
+ if (o.range === "range")
70
+ if (console.log(D.value), k.value !== -1) {
71
+ if (k.value <= D.value)
72
+ for (let d = k.value; d <= D.value; d++) s.value[d].class[1] = "";
73
+ else for (let d = D.value; d <= k.value; d++) s.value[d].class[1] = "";
74
+ D.value = i, k.value = -1, s.value[i].class[1] = "active";
75
+ } else if (D.value !== -1) {
76
+ if (k.value = i, k.value >= D.value)
77
+ for (let x = D.value + 1; x < i; x++) s.value[x].class[1] = "select";
78
+ else for (let x = i + 1; x < D.value; x++) s.value[x].class[1] = "select";
79
+ s.value[i].class[1] = "active";
80
+ let d = G(new Date(s.value[D.value].year, s.value[D.value].month, s.value[D.value].day), "{dd}.{m}.{Y}");
81
+ D.value > i ? J("input", { dateStart: t, dateEnd: d, count: te(D.value, i) }) : J("input", { dateStart: d, dateEnd: t, count: te(i, D.value) });
81
82
  } else
82
- b.value = d, s.value[d].class[1] = "active";
83
+ D.value = i, s.value[i].class[1] = "active";
83
84
  else
84
- s.value[b.value].class[1] = "", b.value = d, s.value[d].class[1] = "active", J("input", { dateStart: t, count: 1 });
85
+ s.value[D.value].class[1] = "", D.value = i, s.value[i].class[1] = "active", J("input", { dateStart: t, count: 1 });
85
86
  };
86
- if (m(), typeof ((ne = u.data) == null ? void 0 : ne.startDate) < "u" && (b.value = s.value.findIndex((r) => r.day === n.value.getDate() && r.month === g.value && r.year === D.value), s.value[b.value].class[1] = "active"), typeof ((Q = u.data) == null ? void 0 : Q.endDate) < "u" && u.range === "range") {
87
+ if (c(), typeof ((oe = o.data) == null ? void 0 : oe.startDate) < "u" && (D.value = s.value.findIndex((r) => r.day === n.value.getDate() && r.month === g.value && r.year === S.value), s.value[D.value].class[1] = "active"), typeof ((Q = o.data) == null ? void 0 : Q.endDate) < "u" && o.range === "range") {
87
88
  k.value = s.value.findIndex((r) => r.day === w.value.getDate() && r.month === j.value && r.year === X.value), s.value[k.value].class[1] = "active";
88
- for (let r = b.value + 1; r < k.value; r++) s.value[r].class[1] = "select";
89
+ for (let r = D.value + 1; r < k.value; r++) s.value[r].class[1] = "select";
89
90
  }
90
- const U = (r, d) => {
91
- H(r, d) && (s.value = [], z.value = 0, n.value = new Date(r, d, 1), D.value = n.value.getFullYear(), g.value = n.value.getMonth(), m());
92
- }, H = (r, d) => {
93
- if (!u.limitation) return !0;
94
- if (u.limitation.dateStart) {
95
- console.log(u.limitation.dateStart);
96
- let t = u.limitation.dateStart.split(u.limitation.dateStart.match(/\D.*?\D?/));
97
- if (t[0].length > 2 && t.reverse(), parseInt(t[2]) > r || parseInt(t[2]) === r && parseInt(t[1]) > d + 1) return !1;
91
+ const U = (r, i) => {
92
+ H(r, i) && (s.value = [], z.value = 0, n.value = new Date(r, i, 1), S.value = n.value.getFullYear(), g.value = n.value.getMonth(), c());
93
+ }, H = (r, i) => {
94
+ if (!o.limitation) return !0;
95
+ if (o.limitation[0].dateStart) {
96
+ console.log(o.limitation[0].dateStart);
97
+ let t = o.limitation[0].dateStart.split(o.limitation[0].dateStart.match(/\D.*?\D?/));
98
+ if (t[0].length > 2 && t.reverse(), parseInt(t[2]) > r || parseInt(t[2]) === r && parseInt(t[1]) > i + 1) return !1;
98
99
  }
99
- if (u.limitation.dateEnd) {
100
- console.log(u.limitation.dateEnd);
101
- let t = u.limitation.dateEnd.split(u.limitation.dateEnd.match(/\D.*?\D?/));
102
- if (t[0].length > 2 && t.reverse(), parseInt(t[2]) < r || parseInt(t[2]) === r && parseInt(t[1]) < d + Y) return !1;
100
+ if (o.limitation[o.limitation.length - 1].dateEnd) {
101
+ console.log(o.limitation[o.limitation.length - 1].dateEnd);
102
+ let t = o.limitation[o.limitation.length - 1].dateEnd.split(o.limitation[o.limitation.length - 1].dateEnd.match(/\D.*?\D?/));
103
+ if (t[0].length > 2 && t.reverse(), parseInt(t[2]) < r || parseInt(t[2]) === r && parseInt(t[1]) < i + Y) return !1;
103
104
  }
104
105
  return !0;
105
106
  };
106
- return (r, d) => (h(), $("div", _e, [
107
+ return (r, i) => (h(), $("div", Ye, [
107
108
  y("div", null, [
108
- y("p", Ye, [
109
+ y("p", Be, [
109
110
  y("span", null, [
110
111
  y("button", {
111
- onClick: d[0] || (d[0] = (t) => U(D.value - 1, g.value))
112
+ onClick: i[0] || (i[0] = (t) => U(S.value - 1, g.value))
112
113
  }, "«"),
113
114
  y("button", {
114
- onClick: d[1] || (d[1] = (t) => U(D.value, g.value - 1))
115
+ onClick: i[1] || (i[1] = (t) => U(S.value, g.value - 1))
115
116
  }, "‹")
116
117
  ]),
117
- y("span", Be, [
118
- y("button", null, C(D.value), 1),
119
- y("button", null, C(a(G)(n.value.setMonth(g.value), "{F}")), 1)
118
+ y("span", Fe, [
119
+ y("button", null, b(S.value), 1),
120
+ y("button", null, b(a(G)(n.value.setMonth(g.value), "{F}")), 1)
120
121
  ]),
121
122
  y("span", null, [
122
123
  y("button", {
123
- onClick: d[2] || (d[2] = (t) => U(D.value, g.value + 1))
124
+ onClick: i[2] || (i[2] = (t) => U(S.value, g.value + 1))
124
125
  }, "›"),
125
126
  y("button", {
126
- onClick: d[3] || (d[3] = (t) => U(D.value + 1, g.value))
127
+ onClick: i[3] || (i[3] = (t) => U(S.value + 1, g.value))
127
128
  }, "»")
128
129
  ])
129
130
  ]),
130
- y("div", Fe, [
131
- (h(), $(O, null, W(7, (t, i) => y("button", {
132
- key: i,
131
+ y("div", Ge, [
132
+ (h(), $(P, null, W(7, (t, d) => y("button", {
133
+ key: d,
133
134
  class: "disabled"
134
- }, C(a(G)(new Date(1970, 1, t + a(_)), "{D}")), 1)), 64))
135
+ }, b(a(G)(new Date(1970, 1, t + a(_)), "{D}")), 1)), 64))
135
136
  ]),
136
- y("div", Ge, [
137
- (h(!0), $(O, null, W(s.value, (t, i) => (h(), $(O, { key: i }, [
138
- i < z.value + (7 - new Date(D.value, g.value + 1, 1).getDay() + a(_)) % 7 ? (h(), $("button", {
137
+ y("div", Ae, [
138
+ (h(!0), $(P, null, W(s.value, (t, d) => (h(), $(P, { key: d }, [
139
+ d < z.value + (7 - new Date(S.value, g.value + 1, 1).getDay() + a(_)) % 7 ? (h(), $("button", {
139
140
  key: 0,
140
- class: re(t.month === g.value && (!u.limitation || new Date(t.year, t.month, t.day + 1).getTime() > new Date(N(u.limitation.dateStart)).getTime() && new Date(t.year, t.month, t.day).getTime() < new Date(N(u.limitation.dateEnd)).getTime()) ? t.class : "disabled"),
141
+ class: re(t.month === g.value && (!o.limitation || new Date(t.year, t.month, t.day + 1).getTime() > new Date(N(o.limitation[0].dateStart)).getTime() && new Date(t.year, t.month, t.day).getTime() < new Date(N(o.limitation[0].dateEnd)).getTime()) ? t.class : "disabled"),
141
142
  onClick: () => {
142
- t.month === g.value && E(t, i);
143
+ t.month === g.value && E(t, d);
143
144
  }
144
- }, C(t.day), 11, Ae)) : R("", !0)
145
+ }, b(t.day), 11, je)) : O("", !0)
145
146
  ], 64))), 128))
146
147
  ])
147
148
  ]),
148
- u.range === "range" ? (h(), $("div", je, [
149
- y("p", ze, [
149
+ o.range === "range" ? (h(), $("div", ze, [
150
+ y("p", Ne, [
150
151
  y("span", null, [
151
152
  y("button", {
152
- onClick: d[4] || (d[4] = (t) => U(D.value - 1, g.value))
153
+ onClick: i[4] || (i[4] = (t) => U(S.value - 1, g.value))
153
154
  }, "«"),
154
155
  y("button", {
155
- onClick: d[5] || (d[5] = (t) => U(D.value, g.value - 1))
156
+ onClick: i[5] || (i[5] = (t) => U(S.value, g.value - 1))
156
157
  }, "‹")
157
158
  ]),
158
- y("span", Ne, [
159
- y("button", null, C(new Date(D.value, g.value + 1).getFullYear()), 1),
160
- y("button", null, C(a(G)(n.value.setMonth(g.value + 1), "{F}")), 1)
159
+ y("span", Ue, [
160
+ y("button", null, b(new Date(S.value, g.value + 1).getFullYear()), 1),
161
+ y("button", null, b(a(G)(n.value.setMonth(g.value + 1), "{F}")), 1)
161
162
  ]),
162
163
  y("span", null, [
163
164
  y("button", {
164
- onClick: d[6] || (d[6] = (t) => U(D.value, g.value + 1))
165
+ onClick: i[6] || (i[6] = (t) => U(S.value, g.value + 1))
165
166
  }, "›"),
166
167
  y("button", {
167
- onClick: d[7] || (d[7] = (t) => U(D.value + 1, g.value))
168
+ onClick: i[7] || (i[7] = (t) => U(S.value + 1, g.value))
168
169
  }, "»")
169
170
  ])
170
171
  ]),
171
- y("div", Ue, [
172
- (h(), $(O, null, W(7, (t, i) => y("button", {
173
- key: i,
172
+ y("div", Re, [
173
+ (h(), $(P, null, W(7, (t, d) => y("button", {
174
+ key: d,
174
175
  class: "disabled"
175
- }, C(a(G)(new Date(1970, 1, t + a(_)), "{D}")), 1)), 64))
176
+ }, b(a(G)(new Date(1970, 1, t + a(_)), "{D}")), 1)), 64))
176
177
  ]),
177
- y("div", Re, [
178
- (h(!0), $(O, null, W(s.value, (t, i) => (h(), $(O, { key: i }, [
179
- i >= z.value - new Date(D.value, g.value + 1, 1).getDay() + a(_) ? (h(), $("button", {
178
+ y("div", Oe, [
179
+ (h(!0), $(P, null, W(s.value, (t, d) => (h(), $(P, { key: d }, [
180
+ d >= z.value - (7 + new Date(S.value, g.value + 1, 1).getDay() - a(_)) % 7 ? (h(), $("button", {
180
181
  key: 0,
181
- class: re(t.month === P.value.getMonth() && (!u.limitation || new Date(t.year, t.month, t.day + 1).getTime() > new Date(N(u.limitation.dateStart)).getTime() && new Date(t.year, t.month, t.day).getTime() < new Date(N(u.limitation.dateEnd)).getTime()) ? t.class : "disabled"),
182
+ class: re(t.month === q.value.getMonth() && (!o.limitation || new Date(t.year, t.month, t.day + 1).getTime() > new Date(N(o.limitation[0].dateStart)).getTime() && new Date(t.year, t.month, t.day).getTime() < new Date(N(o.limitation[0].dateEnd)).getTime()) ? t.class : "disabled"),
182
183
  onClick: () => {
183
- t.month === P.value.getMonth() && E(t, i);
184
+ t.month === q.value.getMonth() && E(t, d);
184
185
  }
185
- }, C(t.day), 11, Oe)) : R("", !0)
186
+ }, b(t.day), 11, Pe)) : O("", !0)
186
187
  ], 64))), 128))
187
188
  ])
188
- ])) : R("", !0)
189
+ ])) : O("", !0)
189
190
  ]));
190
191
  }
191
- }, qe = /* @__PURE__ */ Ie(Pe, [["__scopeId", "data-v-531eb182"]]), Le = {
192
+ }, Le = /* @__PURE__ */ _e(qe, [["__scopeId", "data-v-5b3d4c74"]]), We = {
192
193
  key: 1,
193
194
  class: "controls-container",
194
195
  style: { "margin-top": ".5rem" }
195
- }, We = { key: 0 }, Je = {
196
+ }, Je = { key: 0 }, Xe = {
196
197
  key: 1,
197
198
  style: { padding: "0 1rem .5rem" }
198
- }, ll = {
199
+ }, tl = {
199
200
  __name: "VacationTable",
200
201
  props: {
201
202
  checkEdit: { type: Boolean, default: () => !0 },
@@ -225,160 +226,160 @@ const Ie = (A, M) => {
225
226
  // }
226
227
  ]);
227
228
  f([]);
228
- const u = f((/* @__PURE__ */ new Date()).getFullYear()), J = f(!1), D = f(!1), j = f(!1), X = f({
229
+ const o = f((/* @__PURE__ */ new Date()).getFullYear()), J = f(!1), S = f(!1), j = f(!1), X = f({
229
230
  zIndex: 3,
230
231
  minWidth: 230,
231
232
  x: 500,
232
233
  y: 200
233
- }), g = f(!1), s = f(!1), z = f({ participants: [] }), P = f([]), b = f([]), k = f("all"), Z = f([{ value: "all", label: n("vacationSchedule.all"), key: "all" }]), _ = f(!1), Y = f([]), N = f(!1), m = f({ name: "", length: 0, code: "" }), le = (/* @__PURE__ */ new Date()).getMonth() > 11 ? [{ value: u.value, label: u.value }, { value: u.value + 1, label: u.value + 1 }] : [{ value: u.value - 1, label: u.value - 1 }, { value: u.value, label: u.value }];
234
- pe(k, async (o, e) => {
235
- o !== e && (Y.value = [], J.value = !1, M.odata.personalManagerData.forEach((p) => {
236
- (p.Status !== "Увольнение" && p.Group === o || o === "all") && (Y.value.some((l) => (l == null ? void 0 : l.activeText) === p.Role) || Y.value.push({ val: !0, activeText: p.Role }));
234
+ }), g = f(!1), s = f(!1), z = f({ participants: [] }), q = f([]), D = f([]), k = f("all"), Z = f([{ value: "all", label: n("vacationSchedule.all"), key: "all" }]), _ = f(!1), Y = f([]), N = f(!1), c = f({ name: "", length: 0, code: "" }), te = (/* @__PURE__ */ new Date()).getMonth() > 11 ? [{ value: o.value, label: o.value }, { value: o.value + 1, label: o.value + 1 }] : [{ value: o.value - 1, label: o.value - 1 }, { value: o.value, label: o.value }];
235
+ ye(k, async (u, e) => {
236
+ u !== e && (Y.value = [], J.value = !1, M.odata.personalManagerData.forEach((p) => {
237
+ (p.Status !== "Увольнение" && p.Group === u || u === "all") && (Y.value.some((l) => (l == null ? void 0 : l.activeText) === p.Role) || Y.value.push({ val: !0, activeText: p.Role }));
237
238
  }), H());
238
239
  });
239
- const E = ye(() => w.value.flatMap((o, e) => !o.days || o.days.length === 0 ? [{ ...o, key: 0, ids: e }] : o.days.map((p, l) => ({
240
+ const E = Ce(() => w.value.flatMap((u, e) => !u.days || u.days.length === 0 ? [{ ...u, key: 0, ids: e }] : u.days.map((p, l) => ({
240
241
  ids: e,
241
242
  key: l,
242
- ...o,
243
+ ...u,
243
244
  ...p
244
245
  })))), U = async () => {
245
- M.odata.getPersonalManagerData({}).then((o) => {
246
+ M.odata.getPersonalManagerData({}).then((u) => {
246
247
  var e;
247
- k.value = (e = o.find((p) => p.Status !== "Увольнение" && p.Description === M.fullName)) == null ? void 0 : e.Group, o.forEach((p) => {
248
+ k.value = (e = u.find((p) => p.Status !== "Увольнение" && p.Description === M.fullName)) == null ? void 0 : e.Group, u.forEach((p) => {
248
249
  p.Status !== "Увольнение" && (Z.value.some((l) => (l == null ? void 0 : l.value) === p.Group) || Z.value.push({ value: p.Group, label: p.Group, key: p.Group }), p.Group === k.value && !Y.value.some((l) => (l == null ? void 0 : l.activeText) === p.Role) && Y.value.push({ val: !0, activeText: p.Role }));
249
- }), H(), D.value = !1;
250
+ }), H(), S.value = !1;
250
251
  });
251
252
  }, H = () => {
252
253
  w.value = [];
253
- let o = [];
254
+ let u = [];
254
255
  M.odata.personalManagerData.forEach((e) => {
255
- e.Status !== "Увольнение" && (e.Group === k.value || k.value === "all") && Y.value.some((p) => p.val && p.activeText === e.Role) && (o.push(e.Code), w.value.push({ name: e.Description, days: [{ note: "" }], jobTitle: e.Role, code: e.Code }));
256
- }), te(o), g.value = !1;
257
- }, te = (o) => {
258
- M.workSchedule.getAllVacations({ year: u.value }).then(
256
+ e.Status !== "Увольнение" && (e.Group === k.value || k.value === "all") && Y.value.some((p) => p.val && p.activeText === e.Role) && (u.push(e.Code), w.value.push({ name: e.Description, days: [{ note: "" }], jobTitle: e.Role, code: e.Code }));
257
+ }), ae(u), g.value = !1;
258
+ }, ae = (u) => {
259
+ M.workSchedule.getAllVacations({ year: o.value }).then(
259
260
  (e) => {
260
- o.forEach((p, l) => {
261
- w.value[l].days = [{ note: "" }], e.forEach((S) => {
262
- p === S.code && (typeof w.value[l].days[0].dateStart > "u" ? w.value[l].days[0] = {
263
- dateStart: G(S.dateStart, "{dd}.{m}.{Y}"),
264
- dateEnd: G(S.dateEnd, "{dd}.{m}.{Y}"),
265
- note: S.note,
266
- count: S.count
261
+ u.forEach((p, l) => {
262
+ w.value[l].days = [{ note: "" }], e.forEach((C) => {
263
+ p === C.code && (typeof w.value[l].days[0].dateStart > "u" ? w.value[l].days[0] = {
264
+ dateStart: G(C.dateStart, "{dd}.{m}.{Y}"),
265
+ dateEnd: G(C.dateEnd, "{dd}.{m}.{Y}"),
266
+ note: C.note,
267
+ count: C.count
267
268
  } : w.value[l].days.push({
268
- dateStart: G(S.dateStart, "{dd}.{m}.{Y}"),
269
- dateEnd: G(S.dateEnd, "{dd}.{m}.{Y}"),
270
- note: S.note,
271
- count: S.count
269
+ dateStart: G(C.dateStart, "{dd}.{m}.{Y}"),
270
+ dateEnd: G(C.dateEnd, "{dd}.{m}.{Y}"),
271
+ note: C.note,
272
+ count: C.count
272
273
  }));
273
274
  });
274
275
  });
275
276
  }
276
277
  );
277
- }, ae = (o) => {
278
- if (o.columnIndex < 3 && E.value[o.rowIndex].key < E.value[o.rowIndex].days.length)
279
- return E.value[o.rowIndex].key === 0 ? {
280
- rowspan: E.value[o.rowIndex].days.length,
278
+ }, ne = (u) => {
279
+ if (u.columnIndex < 3 && E.value[u.rowIndex].key < E.value[u.rowIndex].days.length)
280
+ return E.value[u.rowIndex].key === 0 ? {
281
+ rowspan: E.value[u.rowIndex].days.length,
281
282
  colspan: 1
282
283
  } : {
283
284
  rowspan: 0,
284
285
  colspan: 0
285
286
  };
286
- }, ne = (o, e, p, l) => {
287
- m.value.ids = o.ids, m.value.key = o.key, m.value.startDate = o.dateStart, m.value.endDate = o.dateEnd, m.value.name = o.name, m.value.count = o.count, m.value.length = o.days.length, m.value.add = o.days.length > 0 && o.days[o.days.length - 1].count, m.value.level = e.level, m.value.holiday = b.value, X.value.y = l.clientY, X.value.x = l.clientX, e.level === 2 && e.no < 4 && (m.value.add || o.days.length > 1) && (j.value = !0), e.level === 3 && (j.value = !0);
288
- }, Q = (o) => {
289
- let e = w.value[m.value.ids];
290
- switch (o) {
287
+ }, oe = (u, e, p, l) => {
288
+ c.value.ids = u.ids, c.value.key = u.key, c.value.startDate = u.dateStart, c.value.endDate = u.dateEnd, c.value.name = u.name, c.value.count = u.count, c.value.allCount = () => u.days.length === 0 ? 0 : u.days.reduce((C, ee, R) => R !== u.key ? C + parseInt(ee.count) : C, 0), c.value.length = u.days.length, c.value.add = u.days.length > 0 && u.days[u.days.length - 1].count, c.value.level = e.level, c.value.holiday = D.value, X.value.y = l.clientY, X.value.x = l.clientX, e.level === 2 && e.no < 4 && (c.value.add || u.days.length > 1) && (j.value = !0), e.level === 3 && (j.value = !0);
289
+ }, Q = (u) => {
290
+ let e = w.value[c.value.ids];
291
+ switch (u) {
291
292
  case "add":
292
293
  e.days.push({ note: "" }), console.log(e.days.length);
293
294
  break;
294
295
  case "delete":
295
- delete e.days.pop(), t(m.value.ids);
296
+ delete e.days.pop(), t(c.value.ids);
296
297
  break;
297
298
  }
298
299
  j.value = !1;
299
- }, r = (o) => {
300
- N.value = o, m.value.count = o.count;
301
- }, d = () => {
302
- N.value && (w.value[m.value.ids].days[m.value.key] = { ...N.value, note: "" }, t(m.value.ids)), j.value = !1;
303
- }, t = (o) => {
300
+ }, r = (u) => {
301
+ N.value = u, c.value.count = u.count;
302
+ }, i = () => {
303
+ N.value && (w.value[c.value.ids].days[c.value.key] = { ...N.value, note: "" }, t(c.value.ids)), j.value = !1;
304
+ }, t = (u) => {
304
305
  M.workSchedule.rewriteFull({
305
- year: u.value,
306
- code: w.value[o].code,
307
- data: w.value[o].days.map((e) => ({
306
+ year: o.value,
307
+ code: w.value[u].code,
308
+ data: w.value[u].days.map((e) => ({
308
309
  dateStart: e.dateStart.split(".").reverse().join("-"),
309
310
  dateEnd: e.dateEnd.split(".").reverse().join("-"),
310
311
  note: e.note,
311
312
  count: e.count
312
313
  }))
313
314
  });
314
- }, i = (o) => {
315
- M.workSchedule.sendConfirmMessage({ fullname: M.fullName, confirm: o }), M.query = "";
315
+ }, d = (u) => {
316
+ M.workSchedule.sendConfirmMessage({ fullname: M.fullName, confirm: u }), M.query = "";
316
317
  }, x = () => {
317
318
  M.workSchedule.sendAgreementMessage({ users: z.value.participants }), s.value = !1;
318
319
  };
319
- M.workSchedule.getBoss().then((o) => {
320
- P.value = o[0].users;
321
- }), De().then((o) => {
322
- b.value = o, U();
320
+ M.workSchedule.getBoss().then((u) => {
321
+ q.value = u[0].users;
322
+ }), Se().then((u) => {
323
+ D.value = u, U();
323
324
  });
324
- const T = async () => {
325
+ const T = () => c.value.length < 2 ? [{ dateStart: "01.01." + o.value, dateEnd: "31.12." + o.value }] : [{ dateStart: "01.01." + o.value, dateEnd: "31.12." + o.value }], ge = async () => {
325
326
  _.value = !0;
326
- const o = new we.Workbook(), e = o.addWorksheet(u.value.toString(), { pageSetup: { paperSize: 9, orientation: "landscape", fitToPage: !0 } }), p = { vertical: "middle", horizontal: "center" }, l = { top: { style: "thin" }, left: { style: "thin" }, bottom: { style: "thin" }, right: { style: "thin" } }, S = { vertical: "middle", horizontal: "center", wrapText: !0 }, oe = { vertical: "middle", horizontal: "right", wrapText: !0 };
327
- e.mergeCells("D1:G1"), e.mergeCells("D2:G2"), e.mergeCells("D3:G3"), e.mergeCells("D4:G4"), e.mergeCells("A5:G5"), e.mergeCells("A6:G6"), e.mergeCells("A9:G9"), e.mergeCells("A10:A11"), e.mergeCells("B10:B11"), e.mergeCells("C10:C11"), e.mergeCells("D10:F10"), e.mergeCells("G10:G11"), e.getCell("D1").value = n("vacationSchedule.approve"), e.getCell("D2").value = n("vacationSchedule.dateApprove", { year: u.value - 1 }), e.getCell("D3").value = n("workSchedule.printPlace"), e.getCell("D4").value = n("vacationSchedule.dateApprove", { year: u.value - 1 }), e.getCell("A5").value = n("workSchedule.firm"), e.getCell("B7").value = n("vacationSchedule.vacationSchedule"), e.getCell("C7").value = n("vacationSchedule.numberDocs"), e.getCell("D7").value = n("vacationSchedule.compilation"), e.getCell("E7").value = n("vacationSchedule.year"), e.getCell("C8").value = "", e.getCell("D8").value = "", e.getCell("E8").value = u.value, e.getCell("E7").value = n("vacationSchedule.year"), e.getCell("A10").value = n("vacationSchedule.jobTitle"), e.getCell("B10").value = n("vacationSchedule.fullName"), e.getCell("C10").value = n("vacationSchedule.personnelNumber"), e.getCell("D10").value = n("vacationSchedule.vacation"), e.getCell("D11").value = n("vacationSchedule.days"), e.getCell("E11").value = n("vacationSchedule.date"), e.getCell("F11").value = n("vacationSchedule.endDate"), e.getCell("G11").value = n("vacationSchedule.note"), e.getRow(1).height = 80, e.getColumn(1).width = 28, e.getColumn(2).width = 28, e.getColumn(3).width = 18, e.getColumn(4).width = 18, e.getColumn(5).width = 14, e.getColumn(6).width = 14, e.getColumn(7).width = 14, e.getColumn(1).alignment = S, e.getColumn(2).alignment = S, e.getColumn(3).alignment = S, e.getColumn(4).alignment = S, e.getColumn(5).alignment = S, e.getColumn(6).alignment = S, e.getColumn(7).alignment = S, e.getCell("D1").alignment = oe, e.getCell("D2").alignment = oe, e.getCell("D4").alignment = oe, e.getCell("A5").alignment = p, e.getCell("C7").border = l, e.getCell("D7").border = l, e.getCell("E7").border = l, e.getCell("C8").border = l, e.getCell("D8").border = l, e.getCell("E8").border = l, e.getCell("A10").border = l, e.getCell("B10").border = l, e.getCell("C10").border = l, e.getCell("D10").border = l, e.getCell("G10").border = l, e.getCell("D11").border = l, e.getCell("E11").border = l, e.getCell("F11").border = l;
328
- let L = 11;
327
+ const u = new xe.Workbook(), e = u.addWorksheet(o.value.toString(), { pageSetup: { paperSize: 9, orientation: "landscape", fitToPage: !0 } }), p = { vertical: "middle", horizontal: "center" }, l = { top: { style: "thin" }, left: { style: "thin" }, bottom: { style: "thin" }, right: { style: "thin" } }, C = { vertical: "middle", horizontal: "center", wrapText: !0 }, ee = { vertical: "middle", horizontal: "right", wrapText: !0 };
328
+ e.mergeCells("D1:G1"), e.mergeCells("D2:G2"), e.mergeCells("D3:G3"), e.mergeCells("D4:G4"), e.mergeCells("A5:G5"), e.mergeCells("A6:G6"), e.mergeCells("A9:G9"), e.mergeCells("A10:A11"), e.mergeCells("B10:B11"), e.mergeCells("C10:C11"), e.mergeCells("D10:F10"), e.mergeCells("G10:G11"), e.getCell("D1").value = n("vacationSchedule.approve"), e.getCell("D2").value = n("vacationSchedule.dateApprove", { year: o.value - 1 }), e.getCell("D3").value = n("workSchedule.printPlace"), e.getCell("D4").value = n("vacationSchedule.dateApprove", { year: o.value - 1 }), e.getCell("A5").value = n("workSchedule.firm"), e.getCell("B7").value = n("vacationSchedule.vacationSchedule"), e.getCell("C7").value = n("vacationSchedule.numberDocs"), e.getCell("D7").value = n("vacationSchedule.compilation"), e.getCell("E7").value = n("vacationSchedule.year"), e.getCell("C8").value = "", e.getCell("D8").value = "", e.getCell("E8").value = o.value, e.getCell("E7").value = n("vacationSchedule.year"), e.getCell("A10").value = n("vacationSchedule.jobTitle"), e.getCell("B10").value = n("vacationSchedule.fullName"), e.getCell("C10").value = n("vacationSchedule.personnelNumber"), e.getCell("D10").value = n("vacationSchedule.vacation"), e.getCell("D11").value = n("vacationSchedule.days"), e.getCell("E11").value = n("vacationSchedule.date"), e.getCell("F11").value = n("vacationSchedule.endDate"), e.getCell("G11").value = n("vacationSchedule.note"), e.getRow(1).height = 80, e.getColumn(1).width = 28, e.getColumn(2).width = 28, e.getColumn(3).width = 18, e.getColumn(4).width = 18, e.getColumn(5).width = 14, e.getColumn(6).width = 14, e.getColumn(7).width = 14, e.getColumn(1).alignment = C, e.getColumn(2).alignment = C, e.getColumn(3).alignment = C, e.getColumn(4).alignment = C, e.getColumn(5).alignment = C, e.getColumn(6).alignment = C, e.getColumn(7).alignment = C, e.getCell("D1").alignment = ee, e.getCell("D2").alignment = ee, e.getCell("D4").alignment = ee, e.getCell("A5").alignment = p, e.getCell("C7").border = l, e.getCell("D7").border = l, e.getCell("E7").border = l, e.getCell("C8").border = l, e.getCell("D8").border = l, e.getCell("E8").border = l, e.getCell("A10").border = l, e.getCell("B10").border = l, e.getCell("C10").border = l, e.getCell("D10").border = l, e.getCell("G10").border = l, e.getCell("D11").border = l, e.getCell("E11").border = l, e.getCell("F11").border = l;
329
+ let R = 11;
329
330
  for (const I of w.value)
330
331
  if (I.days.length > 1)
331
332
  I.days.forEach((K) => {
332
333
  let ue = [I.jobTitle, I.name, I.code, K.count, K.dateStart, K.dateEnd, K.note];
333
- const fe = e.addRow(ue);
334
- fe.border = l, L++;
335
- }), e.mergeCells(`A${L - I.days.length + 1}:A${L}`), e.mergeCells(`B${L - I.days.length + 1}:B${L}`), e.mergeCells(`C${L - I.days.length + 1}:C${L}`);
334
+ const pe = e.addRow(ue);
335
+ pe.border = l, R++;
336
+ }), e.mergeCells(`A${R - I.days.length + 1}:A${R}`), e.mergeCells(`B${R - I.days.length + 1}:B${R}`), e.mergeCells(`C${R - I.days.length + 1}:C${R}`);
336
337
  else {
337
338
  let K = [I.jobTitle, I.name, I.code, I.days[0].count, I.days[0].dateStart, I.days[0].dateEnd, I.days[0].note];
338
339
  const ue = e.addRow(K);
339
- ue.border = l, L++;
340
+ ue.border = l, R++;
340
341
  }
341
- const ge = "export_" + G(Date.now(), "{dd}.{m}.{Y}") + ".xlsx", he = await o.xlsx.writeBuffer();
342
- Se(new Blob([he]), ge), _.value = !1;
342
+ const he = "export_" + G(Date.now(), "{dd}.{m}.{Y}") + ".xlsx", fe = await u.xlsx.writeBuffer();
343
+ we(new Blob([fe]), he), _.value = !1;
343
344
  };
344
- return (o, e) => {
345
- const p = Ce("loading");
345
+ return (u, e) => {
346
+ const p = be("loading");
346
347
  return h(), $("div", null, [
347
- A.checkEdit ? (h(), B(a(de), {
348
+ A.checkEdit ? (h(), B(a(ie), {
348
349
  key: 0,
349
350
  modelValue: k.value,
350
351
  "onUpdate:modelValue": e[0] || (e[0] = (l) => k.value = l),
351
352
  placeholder: "Select",
352
353
  style: { width: "240px", "margin-bottom": ".5rem", "margin-right": ".5rem" }
353
354
  }, {
354
- default: c(() => [
355
- (h(!0), $(O, null, W(Z.value, (l) => (h(), B(a(ie), {
355
+ default: m(() => [
356
+ (h(!0), $(P, null, W(Z.value, (l) => (h(), B(a(de), {
356
357
  key: l.value,
357
358
  label: l.label,
358
359
  value: l.value
359
360
  }, null, 8, ["label", "value"]))), 128))
360
361
  ]),
361
362
  _: 1
362
- }, 8, ["modelValue"])) : R("", !0),
363
+ }, 8, ["modelValue"])) : O("", !0),
363
364
  v(a(F), {
364
365
  plain: "",
365
366
  onClick: e[1] || (e[1] = (l) => g.value = !0),
366
367
  style: { "margin-bottom": ".5rem", "margin-right": ".5rem" }
367
368
  }, {
368
- default: c(() => [
369
- V(C(a(n)("workSchedule.jobTitle")), 1)
369
+ default: m(() => [
370
+ V(b(a(n)("workSchedule.jobTitle")), 1)
370
371
  ]),
371
372
  _: 1
372
373
  }),
373
- v(a(de), {
374
- modelValue: u.value,
375
- "onUpdate:modelValue": e[2] || (e[2] = (l) => u.value = l),
374
+ v(a(ie), {
375
+ modelValue: o.value,
376
+ "onUpdate:modelValue": e[2] || (e[2] = (l) => o.value = l),
376
377
  onChange: H,
377
378
  placeholder: "Year",
378
379
  style: { width: "80px", "margin-bottom": ".5rem", "margin-right": ".5rem" }
379
380
  }, {
380
- default: c(() => [
381
- (h(!0), $(O, null, W(a(le), (l) => (h(), B(a(ie), {
381
+ default: m(() => [
382
+ (h(!0), $(P, null, W(a(te), (l) => (h(), B(a(de), {
382
383
  key: l.value,
383
384
  label: l.label,
384
385
  value: l.value
@@ -386,127 +387,127 @@ const Ie = (A, M) => {
386
387
  ]),
387
388
  _: 1
388
389
  }, 8, ["modelValue"]),
389
- v(a(xe), {
390
+ v(a(ke), {
390
391
  style: { width: "100%" },
391
- loading: D.value,
392
+ loading: S.value,
392
393
  animated: ""
393
394
  }, {
394
- template: c(() => [
395
- v(a(ee), {
395
+ template: m(() => [
396
+ v(a(le), {
396
397
  variant: "text",
397
398
  style: { width: "100%", height: "2rem" }
398
399
  }),
399
- v(a(ee), {
400
+ v(a(le), {
400
401
  variant: "text",
401
402
  style: { width: "180px", height: "4rem", "margin-right": "4px" }
402
403
  }),
403
- v(a(ee), {
404
+ v(a(le), {
404
405
  variant: "text",
405
406
  style: { width: "calc( 100% - 184px)", height: "4rem" }
406
407
  }),
407
- v(a(ee), {
408
+ v(a(le), {
408
409
  variant: "text",
409
410
  style: { width: "180px", height: "8rem", "margin-right": "4px" }
410
411
  }),
411
- v(a(ee), {
412
+ v(a(le), {
412
413
  variant: "text",
413
414
  style: { width: "calc( 100% - 184px)", height: "8rem" }
414
415
  })
415
416
  ]),
416
- default: c(() => [
417
- v(a(ke), {
417
+ default: m(() => [
418
+ v(a(Ee), {
418
419
  id: "printTable",
419
420
  data: E.value,
420
- "span-method": ae,
421
- onCellClick: ne,
421
+ "span-method": ne,
422
+ onCellClick: oe,
422
423
  border: "",
423
424
  style: { width: "100%" },
424
425
  size: "small",
425
426
  "empty-text": a(n)("vacationSchedule.emptyText")
426
427
  }, {
427
- default: c(() => [
428
- v(a(q), {
429
- label: k.value !== "all" ? a(n)("vacationSchedule.title", { name: k.value }) : a(n)("vacationSchedule.enterprise") + ` ${u.value}`,
428
+ default: m(() => [
429
+ v(a(L), {
430
+ label: k.value !== "all" ? a(n)("vacationSchedule.title", { name: k.value }) : a(n)("vacationSchedule.enterprise") + ` ${o.value}`,
430
431
  align: "center",
431
432
  height: "34"
432
433
  }, {
433
- default: c(() => [
434
- v(a(q), {
434
+ default: m(() => [
435
+ v(a(L), {
435
436
  label: a(n)("vacationSchedule.jobTitle"),
436
437
  width: "180",
437
438
  align: "center"
438
439
  }, {
439
- default: c((l) => [
440
- V(C(E.value[l.$index].jobTitle), 1)
440
+ default: m((l) => [
441
+ V(b(E.value[l.$index].jobTitle), 1)
441
442
  ]),
442
443
  _: 1
443
444
  }, 8, ["label"]),
444
- v(a(q), {
445
+ v(a(L), {
445
446
  label: a(n)("vacationSchedule.fullName"),
446
447
  width: "180",
447
448
  align: "center"
448
449
  }, {
449
- default: c((l) => [
450
- V(C(E.value[l.$index].name), 1)
450
+ default: m((l) => [
451
+ V(b(E.value[l.$index].name), 1)
451
452
  ]),
452
453
  _: 1
453
454
  }, 8, ["label"]),
454
- v(a(q), {
455
+ v(a(L), {
455
456
  label: a(n)("vacationSchedule.personnelNumber"),
456
457
  align: "center"
457
458
  }, {
458
- default: c((l) => [
459
- V(C(E.value[l.$index].code), 1)
459
+ default: m((l) => [
460
+ V(b(E.value[l.$index].code), 1)
460
461
  ]),
461
462
  _: 1
462
463
  }, 8, ["label"]),
463
- v(a(q), {
464
+ v(a(L), {
464
465
  label: a(n)("vacationSchedule.vacation"),
465
466
  align: "center"
466
467
  }, {
467
- default: c(() => [
468
- v(a(q), {
468
+ default: m(() => [
469
+ v(a(L), {
469
470
  label: a(n)("vacationSchedule.days"),
470
471
  align: "center"
471
472
  }, {
472
- default: c((l) => [
473
- V(C(E.value[l.$index].count), 1)
473
+ default: m((l) => [
474
+ V(b(E.value[l.$index].count), 1)
474
475
  ]),
475
476
  _: 1
476
477
  }, 8, ["label"]),
477
- v(a(q), {
478
+ v(a(L), {
478
479
  label: a(n)("vacationSchedule.date"),
479
480
  align: "center"
480
481
  }, {
481
- default: c((l) => [
482
- V(C(E.value[l.$index].dateStart), 1)
482
+ default: m((l) => [
483
+ V(b(E.value[l.$index].dateStart), 1)
483
484
  ]),
484
485
  _: 1
485
486
  }, 8, ["label"]),
486
- v(a(q), {
487
+ v(a(L), {
487
488
  label: a(n)("vacationSchedule.endDate"),
488
489
  align: "center"
489
490
  }, {
490
- default: c((l) => [
491
- V(C(E.value[l.$index].dateEnd), 1)
491
+ default: m((l) => [
492
+ V(b(E.value[l.$index].dateEnd), 1)
492
493
  ]),
493
494
  _: 1
494
495
  }, 8, ["label"])
495
496
  ]),
496
497
  _: 1
497
498
  }, 8, ["label"]),
498
- v(a(q), {
499
+ v(a(L), {
499
500
  label: a(n)("vacationSchedule.note"),
500
501
  align: "center"
501
502
  }, {
502
- default: c((l) => [
503
- v(a(Ee), {
503
+ default: m((l) => [
504
+ v(a($e), {
504
505
  modelValue: w.value[E.value[l.$index].ids].days[E.value[l.$index].key].note,
505
- "onUpdate:modelValue": (S) => w.value[E.value[l.$index].ids].days[E.value[l.$index].key].note = S,
506
+ "onUpdate:modelValue": (C) => w.value[E.value[l.$index].ids].days[E.value[l.$index].key].note = C,
506
507
  style: { width: "100%" },
507
508
  placeholder: " ",
508
509
  class: "noBorder",
509
- onBlur: (S) => t(E.value[l.$index].ids)
510
+ onBlur: (C) => t(E.value[l.$index].ids)
510
511
  }, null, 8, ["modelValue", "onUpdate:modelValue", "onBlur"])
511
512
  ]),
512
513
  _: 1
@@ -520,46 +521,46 @@ const Ie = (A, M) => {
520
521
  ]),
521
522
  _: 1
522
523
  }, 8, ["loading"]),
523
- A.checkEdit ? (h(), $("div", Le, [
524
- J.value ? R("", !0) : (h(), B(a(F), {
524
+ A.checkEdit ? (h(), $("div", We, [
525
+ J.value ? O("", !0) : (h(), B(a(F), {
525
526
  key: 0,
526
527
  type: "primary",
527
528
  onClick: e[3] || (e[3] = (l) => s.value = !0)
528
529
  }, {
529
- default: c(() => [
530
- V(C(a(n)("vacationSchedule.sendInformation")), 1)
530
+ default: m(() => [
531
+ V(b(a(n)("vacationSchedule.sendInformation")), 1)
531
532
  ]),
532
533
  _: 1
533
534
  })),
534
535
  A.query === "confirm" ? (h(), B(a(F), {
535
536
  key: 1,
536
537
  type: "primary",
537
- onClick: e[4] || (e[4] = (l) => i(!0))
538
+ onClick: e[4] || (e[4] = (l) => d(!0))
538
539
  }, {
539
- default: c(() => [
540
- V(C(a(n)("vacationSchedule.agreeOn")), 1)
540
+ default: m(() => [
541
+ V(b(a(n)("vacationSchedule.agreeOn")), 1)
541
542
  ]),
542
543
  _: 1
543
- })) : R("", !0),
544
+ })) : O("", !0),
544
545
  A.query === "confirm" ? (h(), B(a(F), {
545
546
  key: 2,
546
547
  type: "primary",
547
- onClick: e[5] || (e[5] = (l) => i(!1))
548
+ onClick: e[5] || (e[5] = (l) => d(!1))
548
549
  }, {
549
- default: c(() => [
550
- V(C(a(n)("vacationSchedule.reject")), 1)
550
+ default: m(() => [
551
+ V(b(a(n)("vacationSchedule.reject")), 1)
551
552
  ]),
552
553
  _: 1
553
- })) : R("", !0)
554
- ])) : R("", !0),
555
- be((h(), B(a(F), {
554
+ })) : O("", !0)
555
+ ])) : O("", !0),
556
+ De((h(), B(a(F), {
556
557
  disabled: _.value,
557
558
  plain: "",
558
- onClick: T,
559
+ onClick: ge,
559
560
  style: { "margin-top": ".5rem" }
560
561
  }, {
561
- default: c(() => [
562
- V(C(a(n)("workSchedule.exportExcel")), 1)
562
+ default: m(() => [
563
+ V(b(a(n)("workSchedule.exportExcel")), 1)
563
564
  ]),
564
565
  _: 1
565
566
  }, 8, ["disabled"])), [
@@ -571,13 +572,13 @@ const Ie = (A, M) => {
571
572
  "onUpdate:modelValue": e[7] || (e[7] = (l) => g.value = l),
572
573
  width: "400px"
573
574
  }, {
574
- footer: c(() => [
575
+ footer: m(() => [
575
576
  v(a(F), {
576
577
  onClick: e[6] || (e[6] = (l) => g.value = !1),
577
578
  size: "default"
578
579
  }, {
579
- default: c(() => [
580
- V(C(o.$t("workSchedule.cancel")), 1)
580
+ default: m(() => [
581
+ V(b(u.$t("workSchedule.cancel")), 1)
581
582
  ]),
582
583
  _: 1
583
584
  }),
@@ -586,23 +587,23 @@ const Ie = (A, M) => {
586
587
  type: "primary",
587
588
  onClick: H
588
589
  }, {
589
- default: c(() => [
590
- V(C(o.$t("workSchedule.select")), 1)
590
+ default: m(() => [
591
+ V(b(u.$t("workSchedule.select")), 1)
591
592
  ]),
592
593
  _: 1
593
594
  })
594
595
  ]),
595
- default: c(() => [
596
+ default: m(() => [
596
597
  v(a(ce), {
597
598
  model: Y.value,
598
599
  autocomplete: "on"
599
600
  }, {
600
- default: c(() => [
601
- (h(!0), $(O, null, W(Y.value, (l) => (h(), B(a($e), null, {
602
- default: c(() => [
603
- v(a(Te), {
601
+ default: m(() => [
602
+ (h(!0), $(P, null, W(Y.value, (l) => (h(), B(a(Te), null, {
603
+ default: m(() => [
604
+ v(a(Ve), {
604
605
  modelValue: l.val,
605
- "onUpdate:modelValue": (S) => l.val = S,
606
+ "onUpdate:modelValue": (C) => l.val = C,
606
607
  "active-text": l.activeText
607
608
  }, null, 8, ["modelValue", "onUpdate:modelValue", "active-text"])
608
609
  ]),
@@ -620,13 +621,13 @@ const Ie = (A, M) => {
620
621
  "onUpdate:modelValue": e[10] || (e[10] = (l) => s.value = l),
621
622
  width: "500px"
622
623
  }, {
623
- footer: c(() => [
624
+ footer: m(() => [
624
625
  v(a(F), {
625
626
  onClick: e[9] || (e[9] = (l) => s.value = !1),
626
627
  size: "default"
627
628
  }, {
628
- default: c(() => [
629
- V(C(a(n)("workSchedule.cancel")), 1)
629
+ default: m(() => [
630
+ V(b(a(n)("workSchedule.cancel")), 1)
630
631
  ]),
631
632
  _: 1
632
633
  }),
@@ -635,27 +636,27 @@ const Ie = (A, M) => {
635
636
  type: "primary",
636
637
  onClick: x
637
638
  }, {
638
- default: c(() => [
639
- V(C(a(n)("vacationSchedule.send")), 1)
639
+ default: m(() => [
640
+ V(b(a(n)("vacationSchedule.send")), 1)
640
641
  ]),
641
642
  _: 1
642
643
  })
643
644
  ]),
644
- default: c(() => [
645
+ default: m(() => [
645
646
  v(a(ce), {
646
647
  model: z.value,
647
648
  autocomplete: "on"
648
649
  }, {
649
- default: c(() => [
650
- v(a(de), {
650
+ default: m(() => [
651
+ v(a(ie), {
651
652
  modelValue: z.value.participants,
652
653
  "onUpdate:modelValue": e[8] || (e[8] = (l) => z.value.participants = l),
653
654
  placeholder: a(n)("vacationSchedule.fullName"),
654
655
  multiple: "",
655
656
  size: "default"
656
657
  }, {
657
- default: c(() => [
658
- (h(!0), $(O, null, W(P.value, (l) => (h(), B(a(ie), {
658
+ default: m(() => [
659
+ (h(!0), $(P, null, W(q.value, (l) => (h(), B(a(de), {
659
660
  key: l,
660
661
  label: l,
661
662
  value: l
@@ -669,47 +670,47 @@ const Ie = (A, M) => {
669
670
  ]),
670
671
  _: 1
671
672
  }, 8, ["title", "modelValue"]),
672
- v(a(Ve), {
673
+ v(a(Me), {
673
674
  show: j.value,
674
675
  "onUpdate:show": e[14] || (e[14] = (l) => j.value = l),
675
676
  options: X.value
676
677
  }, {
677
- default: c(() => [
678
+ default: m(() => [
678
679
  v(a(se), {
679
- label: m.value.level === 3 && typeof m.value.count < "u" ? m.value.name + " " + m.value.count + " " + a(n)("vacationSchedule.day", m.value.count) : m.value.name,
680
+ label: c.value.level === 3 && typeof c.value.count < "u" ? c.value.name + " " + c.value.count + " " + a(n)("vacationSchedule.day", c.value.count) + ` ${a(n)("vacationSchedule.from")}: ${c.value.allCount() + parseInt(c.value.count)}` : c.value.name,
680
681
  disabled: ""
681
682
  }, null, 8, ["label"]),
682
- v(a(Me)),
683
- m.value.level === 2 ? (h(), $("div", We, [
684
- m.value.length > 1 ? (h(), B(a(se), {
683
+ v(a(Ie)),
684
+ c.value.level === 2 ? (h(), $("div", Je, [
685
+ c.value.length > 1 ? (h(), B(a(se), {
685
686
  key: 0,
686
687
  label: a(n)("vacationSchedule.deleteLast"),
687
688
  onClick: e[11] || (e[11] = (l) => Q("delete"))
688
- }, null, 8, ["label"])) : R("", !0),
689
- m.value.add ? (h(), B(a(se), {
689
+ }, null, 8, ["label"])) : O("", !0),
690
+ c.value.add ? (h(), B(a(se), {
690
691
  key: 1,
691
692
  label: a(n)("vacationSchedule.addVacation"),
692
693
  onClick: e[12] || (e[12] = (l) => Q("add"))
693
- }, null, 8, ["label"])) : R("", !0)
694
- ])) : (h(), $("div", Je, [
695
- v(qe, {
696
- data: m.value,
694
+ }, null, 8, ["label"])) : O("", !0)
695
+ ])) : (h(), $("div", Xe, [
696
+ v(Le, {
697
+ data: c.value,
697
698
  range: "range",
698
- limitation: { dateStart: "1.01." + u.value, dateEnd: "31.12." + u.value },
699
+ limitation: T(),
699
700
  onInput: r
700
701
  }, null, 8, ["data", "limitation"]),
701
702
  y("div", null, [
702
703
  v(a(F), {
703
704
  onClick: e[13] || (e[13] = (l) => j.value = !1)
704
705
  }, {
705
- default: c(() => [
706
- V(C(a(n)("vacationSchedule.cancel")), 1)
706
+ default: m(() => [
707
+ V(b(a(n)("vacationSchedule.cancel")), 1)
707
708
  ]),
708
709
  _: 1
709
710
  }),
710
- v(a(F), { onClick: d }, {
711
- default: c(() => [
712
- V(C(a(n)("vacationSchedule.save")), 1)
711
+ v(a(F), { onClick: i }, {
712
+ default: m(() => [
713
+ V(b(a(n)("vacationSchedule.save")), 1)
713
714
  ]),
714
715
  _: 1
715
716
  })
@@ -723,5 +724,5 @@ const Ie = (A, M) => {
723
724
  }
724
725
  };
725
726
  export {
726
- ll as default
727
+ tl as default
727
728
  };
@@ -1 +1 @@
1
- .wrapper[data-v-531eb182]{display:flex}.wrapper .month_year[data-v-531eb182]{display:flex;justify-content:space-around;align-items:center}.wrapper .month_year span:not(.text) button[data-v-531eb182]{font-size:1.3em}.wrapper>div[data-v-531eb182]:not(:first-child){margin-left:2rem}.wrapper button[data-v-531eb182]{height:30px;text-align:center;line-height:30px;cursor:pointer;background:none;border:none;border-radius:.2rem;transition:all .3s ease}.wrapper button[data-v-531eb182]:hover:not(.disabled):not(.active){color:var(--el-color-success)}.wrapper .week[data-v-531eb182]{border-bottom:1px solid var(--el-color-info);margin-bottom:.5rem}.wrapper .month[data-v-531eb182],.wrapper .week[data-v-531eb182]{width:250px;display:grid;grid-template-columns:1fr 1fr 1fr 1fr 1fr 1fr 1fr;gap:.2rem}.wrapper .month>button[data-v-531eb182],.wrapper .week>button[data-v-531eb182]{width:30px}.wrapper .month>button.disabled[data-v-531eb182],.wrapper .week>button.disabled[data-v-531eb182]{color:var(--el-color-info);cursor:not-allowed}.wrapper .month>button.preholiday[data-v-531eb182],.wrapper .week>button.preholiday[data-v-531eb182]{background-color:#ffe78070}.wrapper .month>button.weekend[data-v-531eb182],.wrapper .week>button.weekend[data-v-531eb182]{background-color:#ff808070}.wrapper .month>button.select[data-v-531eb182],.wrapper .week>button.select[data-v-531eb182]{background-color:#007bff70}.wrapper .month>button.holiday[data-v-531eb182],.wrapper .week>button.holiday[data-v-531eb182]{background-color:red}.wrapper .month>button.nowork[data-v-531eb182],.wrapper .week>button.nowork[data-v-531eb182]{background-color:red}.wrapper .month>button.active[data-v-531eb182],.wrapper .week>button.active[data-v-531eb182]{background-color:#007bff}.noBorder .el-input__wrapper{box-shadow:none}
1
+ .wrapper[data-v-5b3d4c74]{display:flex}.wrapper .month_year[data-v-5b3d4c74]{display:flex;justify-content:space-around;align-items:center}.wrapper .month_year span:not(.text) button[data-v-5b3d4c74]{font-size:1.3em}.wrapper>div[data-v-5b3d4c74]:not(:first-child){margin-left:2rem}.wrapper button[data-v-5b3d4c74]{height:30px;text-align:center;line-height:30px;cursor:pointer;background:none;border:none;border-radius:.2rem;transition:all .3s ease}.wrapper button[data-v-5b3d4c74]:hover:not(.disabled):not(.active){color:var(--el-color-success)}.wrapper .week[data-v-5b3d4c74]{border-bottom:1px solid var(--el-color-info);margin-bottom:.5rem}.wrapper .month[data-v-5b3d4c74],.wrapper .week[data-v-5b3d4c74]{width:250px;display:grid;grid-template-columns:1fr 1fr 1fr 1fr 1fr 1fr 1fr;gap:.2rem}.wrapper .month>button[data-v-5b3d4c74],.wrapper .week>button[data-v-5b3d4c74]{width:30px}.wrapper .month>button.disabled[data-v-5b3d4c74],.wrapper .week>button.disabled[data-v-5b3d4c74]{color:var(--el-color-info);cursor:not-allowed}.wrapper .month>button.preholiday[data-v-5b3d4c74],.wrapper .week>button.preholiday[data-v-5b3d4c74]{background-color:#ffe78070}.wrapper .month>button.weekend[data-v-5b3d4c74],.wrapper .week>button.weekend[data-v-5b3d4c74]{background-color:#ff808070}.wrapper .month>button.select[data-v-5b3d4c74],.wrapper .week>button.select[data-v-5b3d4c74]{background-color:#007bff70}.wrapper .month>button.holiday[data-v-5b3d4c74],.wrapper .week>button.holiday[data-v-5b3d4c74]{background-color:red}.wrapper .month>button.nowork[data-v-5b3d4c74],.wrapper .week>button.nowork[data-v-5b3d4c74]{background-color:red}.wrapper .month>button.active[data-v-5b3d4c74],.wrapper .week>button.active[data-v-5b3d4c74]{background-color:#007bff}.noBorder .el-input__wrapper{box-shadow:none}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@studio-west/employees",
3
- "version": "0.4.3",
3
+ "version": "0.4.5",
4
4
  "files": [
5
5
  "dist"
6
6
  ],