@studio-west/employees 0.3.1 → 0.4.1

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