@studio-west/employees 0.6.8 → 0.6.9
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.
- package/dist/WorkTable.cjs +4 -4
- package/dist/WorkTable.js +23 -23
- package/package.json +1 -1
package/dist/WorkTable.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),de=require("file-saver"),se=require("exceljs"),v=require("./index-DxdyeKnm.cjs"),ve=require("vue-i18n"),i=require("element-plus"),G=require("@imengyu/vue3-context-menu");function ce(k){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(k){for(const S in k)if(S!=="default"){const f=Object.getOwnPropertyDescriptor(k,S);Object.defineProperty(r,S,f.get?f:{enumerable:!0,get:()=>k[S]})}}return r.default=k,Object.freeze(r)}const me=ce(se),ge={class:"work"},he={class:"nav"},fe={style:{height:"100px",width:"100%",display:"inline-block"}},pe={style:{height:"100px",width:"100%",display:"inline-block"}},ye={key:0,class:"controls-container",style:{"margin-top":".5rem"}},we={key:0,style:{padding:"0.5em 1.5em"}},ke={key:1,style:{padding:"0.5em 1.5em"}},Ce={__name:"WorkTable",props:{checkEdit:{type:Boolean,default:()=>!0},odata:Object,workSchedule:Object,fullName:{type:String,default:"Вы"},group:String},setup(k){const{t:r,d:S}=ve.useI18n(),f=k,z=e.ref(!1),n=e.ref([]),R=e.ref(new Date().getMonth()+1),j=e.ref(!1),E=e.ref([]),
|
|
2
|
-
`+((g=n.value[l].days[t])==null?void 0:g.time)},W=()=>{n.value=[],I.value=[],E.value=[],f.odata.personal.forEach(a=>{if(a.divisionName===C.value&&V.value.some(l=>l.val&&l.activeText===a.roleName)){let l=v.byInitials(a.employeeName);I.value.push(a.employeeKey),n.value.push({name:l+" ("+a.roleName+")",days:[],contHour:0,code:a.employeeKey,id:!1,ids:n.value.length})}}),f.workSchedule.getUsersYear({code:I.value,year:new Date(
|
|
3
|
-
`+(h-1),l.getColumn(h).width=6,l.getColumn(h).alignment=t,l.getCell(4,h).border=d;l.getRow(1).height=40,l.getRow(2).height=30,l.getRow(3).height=20,l.getColumn(1).width=15,l.getColumn(u.value.length+2).width=5,l.getColumn(u.value.length+3).width=6,l.getColumn(u.value.length+4).width=13,l.getColumn(u.value.length+5).width=13,l.getColumn(1).alignment=t,l.getCell("A2").alignment=o,l.getCell("A3").alignment=o,l.getCell("B3").alignment=o,l.getCell(3,u.value.length+2).alignment=o,l.getColumn(u.value.length+2).alignment=t,l.getColumn(u.value.length+3).alignment=t,l.getColumn(u.value.length+4).alignment=o,l.getColumn(u.value.length+5).alignment=o,l.getCell("A3").border=d,l.getCell("B3").border=d,l.getCell(3,u.value.length+2).border=d,l.getCell(4,u.value.length+2).border=d,l.getCell(3,u.value.length+4).border=d,l.getCell(3,u.value.length+5).border=d,l.getCell(4,u.value.length+3).border=d;let s=0;for(const h of n.value){let H=[h.name];for(let A=1;A<=u.value.length;A++){const{ind:L}=U(A,s);L!==-1?H[A]=`${h.days[L].time} ${h.days[L].tips}`:H[A]=" "}H.push(((x=h.days)==null?void 0:x.length)||" ",h.contHour||0);const ie=l.addRow(H);ie.border=d,s++}let m="Щербина Е. В.";f.odata.personal.forEach(h=>{h.roleName==="Начальник отдела правовой и кадровой работы"&&(m=h.employeeName)}),l.mergeCells(`A${n.value.length+6}:P${n.value.length+6}`),l.mergeCells(`Q${n.value.length+6}:AG${n.value.length+6}`),l.mergeCells(`B${n.value.length+8}:E${n.value.length+8}`),l.mergeCells(`F${n.value.length+8}:L${n.value.length+8}`),l.mergeCells(`M${n.value.length+8}:P${n.value.length+8}`),l.mergeCells(`S${n.value.length+8}:V${n.value.length+8}`),l.mergeCells(`W${n.value.length+8}:AC${n.value.length+8}`),l.mergeCells(`AD${n.value.length+8}:AG${n.value.length+8}`),l.mergeCells(`Z${n.value.length+9}:AA${n.value.length+9}`),l.getCell(`A${n.value.length+6}`).value=r("workSchedule.byInitials"),l.getCell(`Q${n.value.length+6}`).value=r("workSchedule.supervisorHR"),l.getCell(`B${n.value.length+8}`).value=r("workSchedule.compiled")+":",l.getCell(`S${n.value.length+8}`).value=r("workSchedule.approved")+":",l.getCell(`M${n.value.length+8}`).value=v.byInitials(f.fullName),l.getCell(`AD${n.value.length+8}`).value=v.byInitials(m),l.getCell(`Z${n.value.length+9}`).value=r("workSchedule.printPlace"),l.getCell(`A${n.value.length+6}`).alignment={vertical:"middle",horizontal:"right"},l.getCell(`Q${n.value.length+6}`).alignment={vertical:"middle",horizontal:"right"},l.getCell(`B${n.value.length+8}`).alignment={vertical:"middle",horizontal:"right"},l.getCell(`F${n.value.length+8}`).alignment={vertical:"middle",horizontal:"right"},l.getCell(`M${n.value.length+8}`).alignment={vertical:"middle",horizontal:"left"},l.getCell(`AD${n.value.length+8}`).alignment={vertical:"middle",horizontal:"left"},l.getCell(`Z${n.value.length+9}`).alignment=o,l.getCell(`F${n.value.length+8}`).border={bottom:{style:"thin"}},l.getCell(`W${n.value.length+8}`).border={bottom:{style:"thin"}};const g="export_"+v.parseTime(Date.now(),"{dd}.{m}.{Y}")+".xlsx",b=await a.xlsx.writeBuffer();de.saveAs(new Blob([b]),g),z.value=!1},re=async()=>{F.value||f.workSchedule.addWorkSchedule({data:n.value,date:v.parseTime(new Date(
|
|
4
|
-
`+t.day.toString(),prop:"vacation"},{default:e.withCtx(s=>[e.createElementVNode("div",pe,e.toDisplayString(Q(t.day,s.$index)||" "),1)]),_:2},1032,["class-name","label"]))),128))]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.onSchedule"),align:"center",fixed:T.value!=="100%"?"right":!1},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.days"),align:"center"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(n.value[t.$index].days.length||0),1)]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:`${e.unref(r)("workSchedule.hours")} ( ${D.value} )`,align:"center"},{default:e.withCtx(t=>[e.createElementVNode("div",{style:e.normalizeStyle(`color: ${D.value===t.row.contHour?"green":"red"};`)},e.toDisplayString(t.row.contHour),5)]),_:1},8,["label"])]),_:1},8,["label","fixed"])]),_:1},8,["label"])]),_:1},8,["data","max-height","empty-text"])]),_:1},8,["loading"]),le.value&&k.checkEdit?(e.openBlock(),e.createElementBlock("div",ye,[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.chartsFilled"))+": ",1),F.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:0,type:"primary",onClick:re},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.confirm")),1)]),_:1})),l[20]||(l[20]=e.createTextVNode()),e.createElementVNode("span",null,e.toDisplayString(k.fullName),1)])):e.createCommentVNode("",!0),e.withDirectives((e.openBlock(),e.createBlock(e.unref(i.ElButton),{disabled:z.value,plain:"",onClick:ue,style:{"margin-top":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.exportExcel")),1)]),_:1},8,["disabled"])),[[d,z.value]]),e.createVNode(e.unref(i.ElDialog),{title:e.unref(r)("workSchedule.jobTitle"),modelValue:$.value,"onUpdate:modelValue":l[6]||(l[6]=t=>$.value=t),width:"400px"},{footer:e.withCtx(()=>[e.createVNode(e.unref(i.ElButton),{onClick:l[5]||(l[5]=t=>$.value=!1),size:"default"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.$t("workSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(i.ElButton),{size:"default",type:"primary",onClick:W},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.$t("workSchedule.select")),1)]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(i.ElForm),{ref:"dialogForm",model:V.value,autocomplete:"on"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.value,t=>(e.openBlock(),e.createBlock(e.unref(i.ElFormItem),null,{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElSwitch),{modelValue:t.val,"onUpdate:modelValue":s=>t.val=s,"active-text":t.activeText},null,8,["modelValue","onUpdate:modelValue","active-text"])]),_:2},1024))),256))]),_:1},8,["model"])]),_:1},8,["title","modelValue"]),e.createVNode(e.unref(G.ContextMenu),{show:Y.value,"onUpdate:show":l[18]||(l[18]=t=>Y.value=t),options:P.value},{default:e.withCtx(()=>[e.createVNode(e.unref(G.ContextMenuItem),{label:c.value.name,disabled:""},null,8,["label"]),e.createVNode(e.unref(G.ContextMenuSeparator)),c.value.level===2?(e.openBlock(),e.createElementBlock("div",we,[e.createVNode(e.unref(i.ElRadioGroup),{modelValue:q.value,"onUpdate:modelValue":l[7]||(l[7]=t=>q.value=t),size:"small"},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElRadioButton),{label:e.unref(r)("workSchedule.Days5"),value:"5"},null,8,["label"]),e.createVNode(e.unref(i.ElRadioButton),{label:"2 Х 2",value:"2x2"}),e.createVNode(e.unref(i.ElRadioButton),{label:"2 Х 5",value:"2x5"})]),_:1},8,["modelValue"]),l[21]||(l[21]=e.createElementVNode("br",null,null,-1)),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.fromDate"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:B.value,"onUpdate:modelValue":l[8]||(l[8]=t=>B.value=t),step:1,min:1,max:u.value.length},null,8,["modelValue","max"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.with"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:w.value,"onUpdate:modelValue":l[9]||(l[9]=t=>w.value=t),step:1,min:0,max:20},null,8,["modelValue"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.duration"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:
|
|
1
|
+
"use strict";const e=require("vue"),de=require("file-saver"),se=require("exceljs"),v=require("./index-DxdyeKnm.cjs"),ve=require("vue-i18n"),i=require("element-plus"),G=require("@imengyu/vue3-context-menu");function ce(k){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(k){for(const S in k)if(S!=="default"){const f=Object.getOwnPropertyDescriptor(k,S);Object.defineProperty(r,S,f.get?f:{enumerable:!0,get:()=>k[S]})}}return r.default=k,Object.freeze(r)}const me=ce(se),ge={class:"work"},he={class:"nav"},fe={style:{height:"100px",width:"100%",display:"inline-block"}},pe={style:{height:"100px",width:"100%",display:"inline-block"}},ye={key:0,class:"controls-container",style:{"margin-top":".5rem"}},we={key:0,style:{padding:"0.5em 1.5em"}},ke={key:1,style:{padding:"0.5em 1.5em"}},Ce={__name:"WorkTable",props:{checkEdit:{type:Boolean,default:()=>!0},odata:Object,workSchedule:Object,fullName:{type:String,default:"Вы"},group:String},setup(k){const{t:r,d:S}=ve.useI18n(),f=k,z=e.ref(!1),n=e.ref([]),R=e.ref(new Date().getMonth()+1),j=e.ref(!1),E=e.ref([]),y=e.ref(new Date(new Date().getFullYear(),new Date().getMonth(),1)),u=e.ref([]),D=e.ref(0),w=e.ref(9),p=e.ref(8),F=e.ref(!1),J=e.ref(!0),$=e.ref(!1),q=e.ref("5"),B=e.ref(1),C=e.ref(""),O=e.ref([]),V=e.ref([]),I=e.ref([]),c=e.ref({name:"Имя",length:0,code:""}),Y=e.ref(!1),P=e.ref({zIndex:30,minWidth:220,x:500,y:200}),Z=e.ref({}),T=e.ref("100%");e.watch(C,async(a,l)=>{a!==l&&(V.value=[],F.value=!1,f.odata.personal.forEach(o=>{o.divisionName===a&&(V.value.some(d=>(d==null?void 0:d.activeText)===o.roleName)||V.value.push({val:!0,activeText:o.roleName}))}),W())}),e.watch(R,async a=>{let l=new Date().getMonth(),o=a===null?l:a-1;o=l-1<=o?o:o+12,y.value=new Date(new Date().getFullYear(),o,1),K()});const _=(a,l,o,d)=>{c.value.ids=a.ids,c.value.key=a.key,c.value.add=a.days.length>0&&a.days[a.days.length-1].cont,c.value.level=l.level,c.value.day=o.cellIndex,P.value.y=d.clientY,P.value.x=d.clientX,l.level===2&&l.no===0&&f.checkEdit&&(c.value.name=r("workSchedule.autocomplete"),Y.value=!0),l.level===3&&o.cellIndex-l.no===1&&f.checkEdit&&(N(o.cellIndex,a.ids),c.value.name=r("workSchedule.modeSelection"),Y.value=!0)},ee=({row:a,columnIndex:l})=>{if(!E.value||E.value.length===0||!j.value)return"";const o=new Date(new Date(y.value).getFullYear(),new Date(y.value).getMonth(),l).getTime()+1e3;for(let d of E.value){const{dateStart:t,dateEnd:s,code:m}=d;if(t&&s&&m===a.code&&l!==0&&l<=u.value.length){const g=new Date(v.parseDate(t)).getTime(),b=new Date(v.parseDate(s)).getTime();if(o>=g&&o<=b)return"vacation"}}return""},K=()=>{const a=Z.value,l=new Date(y.value),o=new Date(l.getFullYear(),l.getMonth()+1,0).getDate();let d=[],t=0;for(let s=1;s<=o;s++){const m=v.parseTime(l.setDate(s),"{Y}-{m}-{dd}");t+=a.nowork.includes(m)||a.holidays.includes(m)?0:a.preholidays.includes(m)?7:8;const g=a.nowork.includes(m)?"nowork":a.holidays.includes(m)?"holiday":a.preholidays.includes(m)?"preholiday":"";d.push({day:s,holidays:g,weekday:S(new Date(l.getFullYear(),l.getMonth(),s),"day")})}D.value=t,u.value=d,f.odata.getPersonal({}).then(s=>{var m;C.value.length===0&&(C.value=(m=s.find(g=>g.employeeName===f.fullName))==null?void 0:m.divisionName),s.forEach((g,b)=>{O.value.some(x=>(x==null?void 0:x.value)===g.divisionName)||O.value.push({value:g.divisionName,label:g.divisionName,key:b}),g.divisionName===C.value&&!V.value.some(x=>(x==null?void 0:x.activeText)===g.roleName)&&V.value.push({val:!0,activeText:g.roleName})}),W(),J.value=!1})},le=e.computed(()=>!n.value.some(a=>a.contHour!==D.value)),Q=(a,l)=>{var s,m,g;const o=new Date(y.value),d=`${o.getFullYear()}-${(o.getMonth()+1).toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}`,t=(s=n.value[l])==null?void 0:s.days.findIndex(b=>b.day===d);return l===-1||t===-1?"":((m=n.value[l].days[t])==null?void 0:m.tips)+`
|
|
2
|
+
`+((g=n.value[l].days[t])==null?void 0:g.time)},W=()=>{n.value=[],I.value=[],E.value=[],f.odata.personal.forEach(a=>{if(a.divisionName===C.value&&V.value.some(l=>l.val&&l.activeText===a.roleName)){let l=v.byInitials(a.employeeName);I.value.push(a.employeeKey),n.value.push({name:l+" ("+a.roleName+")",days:[],contHour:0,code:a.employeeKey,id:!1,ids:n.value.length})}}),f.workSchedule.getUsersYear({code:I.value,year:new Date(y.value).getFullYear()}).then(a=>{a.forEach(l=>{l.dateStart&&E.value.push({code:l.code,dateStart:l.dateStart,dateEnd:l.dateEnd})}),console.log(a),te(),$.value=!1})},te=()=>{f.workSchedule.getWorkSchedule({code:I.value,date:v.parseTime(new Date(y.value),"{Y}-{m}-{dd}")}).then(a=>{a.forEach((l,o)=>{l!==null&&(n.value[o].days=l.data.days,n.value[o].id=l.id)}),M()})},M=()=>{n.value.forEach(a=>{a.contHour=a.days.reduce((l,o)=>l+o.time,0)})},ae=a=>{n.value[a].days=[],M()},ne=a=>{switch(q.value){case"5":for(let l=B.value;l<=u.value.length;l++)u.value[l-1].holidays===""&&N(l,a,!0),u.value[l-1].holidays==="preholiday"&&(p.value-=1,N(l,a,!0),p.value+=1);break;case"2x2":for(let l=B.value;l<=u.value.length;l+=4)N(l,a,!0),l+1<=u.value.length&&N(l+1,a,!0);break;case"2x5":for(let l=B.value;l<=u.value.length;l+=7)for(let o=l;o<l+5&&o<=u.value.length;o++)u.value[o-1].holidays==="preholiday"?(p.value-=1,N(o,a,!0),p.value+=1):N(o,a,!0);break}},N=(a,l,o=!1)=>{const{date:d,ind:t}=U(a,l);t===-1?(n.value[l].days.push({day:d,time:p.value,tips:`(${w.value}:00 - ${w.value+p.value===22?24:w.value+p.value+1}:00)`}),M()):o||(p.value=n.value[l].days[t].time,w.value=parseInt(n.value[l].days[t].tips.slice(1,-12)))},oe=(a,l)=>{const{ind:o}=U(a,l);n.value[l].days.splice(o,1),M(),document.querySelector(".app-main").click()},X=(a,l)=>{const{date:o,ind:d}=U(a,l);n.value[l].days[d]={day:o,time:p.value,tips:`(${w.value}:00 - ${w.value+p.value===22?24:w.value+p.value+1}:00)`},M()},U=(a,l)=>{var t;const o=v.parseTime(new Date(y.value).setDate(a),"{Y}-{m}-{dd}"),d=(t=n.value[l])==null?void 0:t.days.findIndex(s=>s.day===o);return{date:o,ind:d}},ue=async()=>{var x;z.value=!0;const a=new me.Workbook,l=a.addWorksheet(S(y.value,"month"),{pageSetup:{paperSize:9,orientation:"landscape",fitToPage:!0}}),o={vertical:"middle",horizontal:"center"},d={top:{style:"thin"},left:{style:"thin"},bottom:{style:"thin"},right:{style:"thin"}},t={vertical:"middle",horizontal:"center",wrapText:!0};l.mergeCells(`A1:${v.cellsDynamically("A1",u.value.length+5)}1`),l.mergeCells(`A2:${v.cellsDynamically("A2",u.value.length+5)}2`),l.mergeCells("A3:A4"),l.mergeCells(`B3:${v.cellsDynamically("B3",u.value.length)}3`),l.mergeCells(`${v.cellsDynamically("B3",u.value.length+1)}3:${v.cellsDynamically("B3",u.value.length+2)}3`),l.mergeCells(`${v.cellsDynamically("B3",u.value.length+3)}3:${v.cellsDynamically("B4",u.value.length+3)}4`),l.mergeCells(`${v.cellsDynamically("B3",u.value.length+4)}3:${v.cellsDynamically("B4",u.value.length+4)}4`),l.getCell("A1").value=r("workSchedule.firm"),l.getCell("A2").value=r("workSchedule.title",{name:C.value})+S(y.value,"month")+` ${new Date(y.value).getFullYear()}`,l.getCell("A3").value=r("workSchedule.month"),l.getCell("B3").value=r("workSchedule.numbersMonth"),l.getCell(3,u.value.length+2).value=r("workSchedule.onSchedule"),l.getCell(3,u.value.length+4).value=r("workSchedule.acquainted"),l.getCell(3,u.value.length+5).value=r("workSchedule.date"),l.getCell(4,u.value.length+2).value=r("workSchedule.days"),l.getCell(4,u.value.length+3).value=`${r("workSchedule.hours")} (${D.value})`;for(let h=2;h<=u.value.length+1;h++)l.getCell(4,h).value=u.value[h-2].weekday+`
|
|
3
|
+
`+(h-1),l.getColumn(h).width=6,l.getColumn(h).alignment=t,l.getCell(4,h).border=d;l.getRow(1).height=40,l.getRow(2).height=30,l.getRow(3).height=20,l.getColumn(1).width=15,l.getColumn(u.value.length+2).width=5,l.getColumn(u.value.length+3).width=6,l.getColumn(u.value.length+4).width=13,l.getColumn(u.value.length+5).width=13,l.getColumn(1).alignment=t,l.getCell("A2").alignment=o,l.getCell("A3").alignment=o,l.getCell("B3").alignment=o,l.getCell(3,u.value.length+2).alignment=o,l.getColumn(u.value.length+2).alignment=t,l.getColumn(u.value.length+3).alignment=t,l.getColumn(u.value.length+4).alignment=o,l.getColumn(u.value.length+5).alignment=o,l.getCell("A3").border=d,l.getCell("B3").border=d,l.getCell(3,u.value.length+2).border=d,l.getCell(4,u.value.length+2).border=d,l.getCell(3,u.value.length+4).border=d,l.getCell(3,u.value.length+5).border=d,l.getCell(4,u.value.length+3).border=d;let s=0;for(const h of n.value){let H=[h.name];for(let A=1;A<=u.value.length;A++){const{ind:L}=U(A,s);L!==-1?H[A]=`${h.days[L].time} ${h.days[L].tips}`:H[A]=" "}H.push(((x=h.days)==null?void 0:x.length)||" ",h.contHour||0);const ie=l.addRow(H);ie.border=d,s++}let m="Щербина Е. В.";f.odata.personal.forEach(h=>{h.roleName==="Начальник отдела правовой и кадровой работы"&&(m=h.employeeName)}),l.mergeCells(`A${n.value.length+6}:P${n.value.length+6}`),l.mergeCells(`Q${n.value.length+6}:AG${n.value.length+6}`),l.mergeCells(`B${n.value.length+8}:E${n.value.length+8}`),l.mergeCells(`F${n.value.length+8}:L${n.value.length+8}`),l.mergeCells(`M${n.value.length+8}:P${n.value.length+8}`),l.mergeCells(`S${n.value.length+8}:V${n.value.length+8}`),l.mergeCells(`W${n.value.length+8}:AC${n.value.length+8}`),l.mergeCells(`AD${n.value.length+8}:AG${n.value.length+8}`),l.mergeCells(`Z${n.value.length+9}:AA${n.value.length+9}`),l.getCell(`A${n.value.length+6}`).value=r("workSchedule.byInitials"),l.getCell(`Q${n.value.length+6}`).value=r("workSchedule.supervisorHR"),l.getCell(`B${n.value.length+8}`).value=r("workSchedule.compiled")+":",l.getCell(`S${n.value.length+8}`).value=r("workSchedule.approved")+":",l.getCell(`M${n.value.length+8}`).value=v.byInitials(f.fullName),l.getCell(`AD${n.value.length+8}`).value=v.byInitials(m),l.getCell(`Z${n.value.length+9}`).value=r("workSchedule.printPlace"),l.getCell(`A${n.value.length+6}`).alignment={vertical:"middle",horizontal:"right"},l.getCell(`Q${n.value.length+6}`).alignment={vertical:"middle",horizontal:"right"},l.getCell(`B${n.value.length+8}`).alignment={vertical:"middle",horizontal:"right"},l.getCell(`F${n.value.length+8}`).alignment={vertical:"middle",horizontal:"right"},l.getCell(`M${n.value.length+8}`).alignment={vertical:"middle",horizontal:"left"},l.getCell(`AD${n.value.length+8}`).alignment={vertical:"middle",horizontal:"left"},l.getCell(`Z${n.value.length+9}`).alignment=o,l.getCell(`F${n.value.length+8}`).border={bottom:{style:"thin"}},l.getCell(`W${n.value.length+8}`).border={bottom:{style:"thin"}};const g="export_"+v.parseTime(Date.now(),"{dd}.{m}.{Y}")+".xlsx",b=await a.xlsx.writeBuffer();de.saveAs(new Blob([b]),g),z.value=!1},re=async()=>{F.value||f.workSchedule.addWorkSchedule({data:n.value,date:v.parseTime(new Date(y.value),"{Y}-{m}-{dd}"),group:C.value}).then(a=>F.value=a)};return f.group&&(C.value=f.group),v.holidays().then(a=>{Z.value=a,K()}),(a,l)=>{const o=e.resolveComponent("el-date-picker"),d=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",ge,[e.createElementVNode("div",he,[k.checkEdit?(e.openBlock(),e.createBlock(e.unref(i.ElSelect),{key:0,modelValue:C.value,"onUpdate:modelValue":l[0]||(l[0]=t=>C.value=t),placeholder:"Select",style:{width:"240px"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O.value,t=>(e.openBlock(),e.createBlock(e.unref(i.ElOption),{key:t.key,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])):e.createCommentVNode("",!0),k.checkEdit?(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:1,plain:"",onClick:l[1]||(l[1]=t=>$.value=!0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.jobTitle")),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(o,{modelValue:R.value,"onUpdate:modelValue":l[2]||(l[2]=t=>R.value=t),type:"month",placeholder:"Выберите месяц",format:"MMM","value-format":"M"},null,8,["modelValue"]),l[19]||(l[19]=e.createElementVNode("div",{class:"expander"},null,-1)),e.createVNode(e.unref(i.ElSwitch),{modelValue:T.value,"onUpdate:modelValue":l[3]||(l[3]=t=>T.value=t),"active-text":a.$t("bids.currentHeight"),"active-value":"100%","inactive-value":"calc(100vh - var(--el-component-size)*4 - var(--el-main-padding)*2 - var(--header-height))"},null,8,["modelValue","active-text"]),e.createVNode(e.unref(i.ElSwitch),{modelValue:j.value,"onUpdate:modelValue":l[4]||(l[4]=t=>j.value=t),"active-text":"Отпуска","active-value":!0,"inactive-value":!1},null,8,["modelValue"])]),e.createVNode(e.unref(i.ElSkeleton),{style:{width:"100%"},loading:J.value,animated:""},{template:e.withCtx(()=>[e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"100%",height:"2rem"}}),e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"180px",height:"4rem","margin-right":"4px"}}),e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"calc( 100% - 184px)",height:"4rem"}}),e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"180px",height:"8rem","margin-right":"4px"}}),e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"calc( 100% - 184px)",height:"8rem"}})]),default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTable),{id:"printTable",data:n.value,style:{width:"100%"},"max-height":T.value,size:"small",align:"center",onCellClick:_,"empty-text":e.unref(r)("workSchedule.emptyText"),"cell-class-name":ee},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.title",{name:C.value})+e.unref(S)(y.value,"month")+` ${new Date(y.value).getFullYear()}`,align:"center",height:"34"},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.month"),width:"180",align:"center",fixed:T.value!=="100%"},{default:e.withCtx(t=>[e.createElementVNode("div",fe,e.toDisplayString(n.value[t.$index].name),1)]),_:1},8,["label","fixed"]),e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.numbersMonth"),align:"center"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,t=>(e.openBlock(),e.createBlock(e.unref(i.ElTableColumn),{key:t.day,width:"46","class-name":t.holidays,align:"center",label:t.weekday+`
|
|
4
|
+
`+t.day.toString(),prop:"vacation"},{default:e.withCtx(s=>[e.createElementVNode("div",pe,e.toDisplayString(Q(t.day,s.$index)||" "),1)]),_:2},1032,["class-name","label"]))),128))]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.onSchedule"),align:"center",fixed:T.value!=="100%"?"right":!1},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.days"),align:"center"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(n.value[t.$index].days.length||0),1)]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:`${e.unref(r)("workSchedule.hours")} ( ${D.value} )`,align:"center"},{default:e.withCtx(t=>[e.createElementVNode("div",{style:e.normalizeStyle(`color: ${D.value===t.row.contHour?"green":"red"};`)},e.toDisplayString(t.row.contHour),5)]),_:1},8,["label"])]),_:1},8,["label","fixed"])]),_:1},8,["label"])]),_:1},8,["data","max-height","empty-text"])]),_:1},8,["loading"]),le.value&&k.checkEdit?(e.openBlock(),e.createElementBlock("div",ye,[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.chartsFilled"))+": ",1),F.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:0,type:"primary",onClick:re},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.confirm")),1)]),_:1})),l[20]||(l[20]=e.createTextVNode()),e.createElementVNode("span",null,e.toDisplayString(k.fullName),1)])):e.createCommentVNode("",!0),e.withDirectives((e.openBlock(),e.createBlock(e.unref(i.ElButton),{disabled:z.value,plain:"",onClick:ue,style:{"margin-top":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.exportExcel")),1)]),_:1},8,["disabled"])),[[d,z.value]]),e.createVNode(e.unref(i.ElDialog),{title:e.unref(r)("workSchedule.jobTitle"),modelValue:$.value,"onUpdate:modelValue":l[6]||(l[6]=t=>$.value=t),width:"400px"},{footer:e.withCtx(()=>[e.createVNode(e.unref(i.ElButton),{onClick:l[5]||(l[5]=t=>$.value=!1),size:"default"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.$t("workSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(i.ElButton),{size:"default",type:"primary",onClick:W},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.$t("workSchedule.select")),1)]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(i.ElForm),{ref:"dialogForm",model:V.value,autocomplete:"on"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.value,t=>(e.openBlock(),e.createBlock(e.unref(i.ElFormItem),null,{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElSwitch),{modelValue:t.val,"onUpdate:modelValue":s=>t.val=s,"active-text":t.activeText},null,8,["modelValue","onUpdate:modelValue","active-text"])]),_:2},1024))),256))]),_:1},8,["model"])]),_:1},8,["title","modelValue"]),e.createVNode(e.unref(G.ContextMenu),{show:Y.value,"onUpdate:show":l[18]||(l[18]=t=>Y.value=t),options:P.value},{default:e.withCtx(()=>[e.createVNode(e.unref(G.ContextMenuItem),{label:c.value.name,disabled:""},null,8,["label"]),e.createVNode(e.unref(G.ContextMenuSeparator)),c.value.level===2?(e.openBlock(),e.createElementBlock("div",we,[e.createVNode(e.unref(i.ElRadioGroup),{modelValue:q.value,"onUpdate:modelValue":l[7]||(l[7]=t=>q.value=t),size:"small"},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElRadioButton),{label:e.unref(r)("workSchedule.Days5"),value:"5"},null,8,["label"]),e.createVNode(e.unref(i.ElRadioButton),{label:"2 Х 2",value:"2x2"}),e.createVNode(e.unref(i.ElRadioButton),{label:"2 Х 5",value:"2x5"})]),_:1},8,["modelValue"]),l[21]||(l[21]=e.createElementVNode("br",null,null,-1)),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.fromDate"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:B.value,"onUpdate:modelValue":l[8]||(l[8]=t=>B.value=t),step:1,min:1,max:u.value.length},null,8,["modelValue","max"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.with"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:w.value,"onUpdate:modelValue":l[9]||(l[9]=t=>w.value=t),step:1,min:0,max:20},null,8,["modelValue"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.duration"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:p.value,"onUpdate:modelValue":l[10]||(l[10]=t=>p.value=t),step:1,min:4,max:22-w.value},null,8,["modelValue","max"]),e.createVNode(e.unref(i.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:l[11]||(l[11]=t=>ne(c.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.fillOut")),1)]),_:1}),e.createVNode(e.unref(i.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:l[12]||(l[12]=t=>ae(c.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.clearRow")),1)]),_:1})])):(e.openBlock(),e.createElementBlock("div",ke,[e.createElementVNode("div",null,e.toDisplayString(Q(c.value.day,c.value.ids)),1),l[22]||(l[22]=e.createElementVNode("br",null,null,-1)),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.with"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:w.value,"onUpdate:modelValue":l[13]||(l[13]=t=>w.value=t),step:1,min:0,max:20,onChange:l[14]||(l[14]=t=>X(c.value.day,c.value.ids))},null,8,["modelValue"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.duration"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:p.value,"onUpdate:modelValue":l[15]||(l[15]=t=>p.value=t),step:1,min:4,max:22-w.value,onChange:l[16]||(l[16]=t=>X(c.value.day,c.value.ids))},null,8,["modelValue","max"]),e.createVNode(e.unref(i.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:l[17]||(l[17]=t=>oe(c.value.day,c.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.delete")),1)]),_:1})]))]),_:1},8,["show","options"])])}}};module.exports=Ce;
|
package/dist/WorkTable.js
CHANGED
|
@@ -38,7 +38,7 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
|
|
|
38
38
|
// code: '0000-00052'
|
|
39
39
|
// ids: 1
|
|
40
40
|
// }
|
|
41
|
-
]), ee = s((/* @__PURE__ */ new Date()).getMonth() + 1), le = s(!1), Y = s([]),
|
|
41
|
+
]), ee = s((/* @__PURE__ */ new Date()).getMonth() + 1), le = s(!1), Y = s([]), w = s(new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1)), u = s([]), U = s(0), S = s(9), f = s(8), q = s(!1), ge = s(!0), I = s(!1), te = s("5"), H = s(1), $ = s(""), ae = s([]), E = s([]), J = s([]), h = s({ name: "Имя", length: 0, code: "" }), K = s(!1), ne = s({
|
|
42
42
|
zIndex: 30,
|
|
43
43
|
minWidth: 220,
|
|
44
44
|
x: 500,
|
|
@@ -50,13 +50,13 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
|
|
|
50
50
|
}), oe());
|
|
51
51
|
}), ye(ee, async (t) => {
|
|
52
52
|
let e = (/* @__PURE__ */ new Date()).getMonth(), o = t === null ? e : t - 1;
|
|
53
|
-
o = e - 1 <= o ? o : o + 12,
|
|
53
|
+
o = e - 1 <= o ? o : o + 12, w.value = new Date((/* @__PURE__ */ new Date()).getFullYear(), o, 1), he();
|
|
54
54
|
});
|
|
55
55
|
const we = (t, e, o, r) => {
|
|
56
56
|
h.value.ids = t.ids, h.value.key = t.key, h.value.add = t.days.length > 0 && t.days[t.days.length - 1].cont, h.value.level = e.level, h.value.day = o.cellIndex, ne.value.y = r.clientY, ne.value.x = r.clientX, e.level === 2 && e.no === 0 && x.checkEdit && (h.value.name = d("workSchedule.autocomplete"), K.value = !0), e.level === 3 && o.cellIndex - e.no === 1 && x.checkEdit && (A(o.cellIndex, t.ids), h.value.name = d("workSchedule.modeSelection"), K.value = !0);
|
|
57
57
|
}, ke = ({ row: t, columnIndex: e }) => {
|
|
58
58
|
if (!Y.value || Y.value.length === 0 || !le.value) return "";
|
|
59
|
-
const o = new Date(new Date(
|
|
59
|
+
const o = new Date(new Date(w.value).getFullYear(), new Date(w.value).getMonth(), e).getTime() + 1e3;
|
|
60
60
|
for (let r of Y.value) {
|
|
61
61
|
const { dateStart: l, dateEnd: g, code: c } = r;
|
|
62
62
|
if (l && g && c === t.code && e !== 0 && e <= u.value.length) {
|
|
@@ -66,7 +66,7 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
|
|
|
66
66
|
}
|
|
67
67
|
return "";
|
|
68
68
|
}, he = () => {
|
|
69
|
-
const t = me.value, e = new Date(
|
|
69
|
+
const t = me.value, e = new Date(w.value), o = new Date(e.getFullYear(), e.getMonth() + 1, 0).getDate();
|
|
70
70
|
let r = [], l = 0;
|
|
71
71
|
for (let g = 1; g <= o; g++) {
|
|
72
72
|
const c = j(e.setDate(g), "{Y}-{m}-{dd}");
|
|
@@ -82,7 +82,7 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
|
|
|
82
82
|
});
|
|
83
83
|
}, Ce = Ne(() => !n.value.some((t) => t.contHour !== U.value)), ce = (t, e) => {
|
|
84
84
|
var g, c, p;
|
|
85
|
-
const o = new Date(
|
|
85
|
+
const o = new Date(w.value), r = `${o.getFullYear()}-${(o.getMonth() + 1).toString().padStart(2, "0")}-${t.toString().padStart(2, "0")}`, l = (g = n.value[e]) == null ? void 0 : g.days.findIndex((M) => M.day === r);
|
|
86
86
|
return e === -1 || l === -1 ? "" : ((c = n.value[e].days[l]) == null ? void 0 : c.tips) + `
|
|
87
87
|
` + ((p = n.value[e].days[l]) == null ? void 0 : p.time);
|
|
88
88
|
}, oe = () => {
|
|
@@ -91,13 +91,13 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
|
|
|
91
91
|
let e = re(t.employeeName);
|
|
92
92
|
J.value.push(t.employeeKey), n.value.push({ name: e + " (" + t.roleName + ")", days: [], contHour: 0, code: t.employeeKey, id: !1, ids: n.value.length });
|
|
93
93
|
}
|
|
94
|
-
}), x.workSchedule.getUsersYear({ code: J.value, year: new Date(
|
|
94
|
+
}), x.workSchedule.getUsersYear({ code: J.value, year: new Date(w.value).getFullYear() }).then((t) => {
|
|
95
95
|
t.forEach((e) => {
|
|
96
96
|
e.dateStart && Y.value.push({ code: e.code, dateStart: e.dateStart, dateEnd: e.dateEnd });
|
|
97
97
|
}), console.log(t), xe(), I.value = !1;
|
|
98
98
|
});
|
|
99
99
|
}, xe = () => {
|
|
100
|
-
x.workSchedule.getWorkSchedule({ code: J.value, date: j(new Date(
|
|
100
|
+
x.workSchedule.getWorkSchedule({ code: J.value, date: j(new Date(w.value), "{Y}-{m}-{dd}") }).then(
|
|
101
101
|
(t) => {
|
|
102
102
|
t.forEach((e, o) => {
|
|
103
103
|
e !== null && (n.value[o].days = e.data.days, n.value[o].id = e.id);
|
|
@@ -114,7 +114,7 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
|
|
|
114
114
|
switch (te.value) {
|
|
115
115
|
case "5":
|
|
116
116
|
for (let e = H.value; e <= u.value.length; e++)
|
|
117
|
-
u.value[e - 1].holidays === "" && A(e, t, !0), u.value[e - 1].holidays === "preholiday" && (
|
|
117
|
+
u.value[e - 1].holidays === "" && A(e, t, !0), u.value[e - 1].holidays === "preholiday" && (f.value -= 1, A(e, t, !0), f.value += 1);
|
|
118
118
|
break;
|
|
119
119
|
case "2x2":
|
|
120
120
|
for (let e = H.value; e <= u.value.length; e += 4)
|
|
@@ -123,16 +123,16 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
|
|
|
123
123
|
case "2x5":
|
|
124
124
|
for (let e = H.value; e <= u.value.length; e += 7)
|
|
125
125
|
for (let o = e; o < e + 5 && o <= u.value.length; o++)
|
|
126
|
-
u.value[o - 1].holidays === "preholiday" ? (
|
|
126
|
+
u.value[o - 1].holidays === "preholiday" ? (f.value -= 1, A(o, t, !0), f.value += 1) : A(o, t, !0);
|
|
127
127
|
break;
|
|
128
128
|
}
|
|
129
129
|
}, A = (t, e, o = !1) => {
|
|
130
130
|
const { date: r, ind: l } = Q(t, e);
|
|
131
131
|
l === -1 ? (n.value[e].days.push({
|
|
132
132
|
day: r,
|
|
133
|
-
time:
|
|
134
|
-
tips: `(${S.value}:00 - ${S.value +
|
|
135
|
-
}), W()) : o || (
|
|
133
|
+
time: f.value,
|
|
134
|
+
tips: `(${S.value}:00 - ${S.value + f.value === 22 ? 24 : S.value + f.value + 1}:00)`
|
|
135
|
+
}), W()) : o || (f.value = n.value[e].days[l].time, S.value = parseInt(n.value[e].days[l].tips.slice(1, -12)));
|
|
136
136
|
}, be = (t, e) => {
|
|
137
137
|
const { ind: o } = Q(t, e);
|
|
138
138
|
n.value[e].days.splice(o, 1), W(), document.querySelector(".app-main").click();
|
|
@@ -140,18 +140,18 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
|
|
|
140
140
|
const { date: o, ind: r } = Q(t, e);
|
|
141
141
|
n.value[e].days[r] = {
|
|
142
142
|
day: o,
|
|
143
|
-
time:
|
|
144
|
-
tips: `(${S.value}:00 - ${S.value +
|
|
143
|
+
time: f.value,
|
|
144
|
+
tips: `(${S.value}:00 - ${S.value + f.value === 22 ? 24 : S.value + f.value + 1}:00)`
|
|
145
145
|
}, W();
|
|
146
146
|
}, Q = (t, e) => {
|
|
147
147
|
var l;
|
|
148
|
-
const o = j(new Date(
|
|
148
|
+
const o = j(new Date(w.value).setDate(t), "{Y}-{m}-{dd}"), r = (l = n.value[e]) == null ? void 0 : l.days.findIndex((g) => g.day === o);
|
|
149
149
|
return { date: o, ind: r };
|
|
150
150
|
}, Ve = async () => {
|
|
151
151
|
var V;
|
|
152
152
|
Z.value = !0;
|
|
153
|
-
const t = new Fe.Workbook(), e = t.addWorksheet(L(
|
|
154
|
-
e.mergeCells(`A1:${D("A1", u.value.length + 5)}1`), e.mergeCells(`A2:${D("A2", u.value.length + 5)}2`), e.mergeCells("A3:A4"), e.mergeCells(`B3:${D("B3", u.value.length)}3`), e.mergeCells(`${D("B3", u.value.length + 1)}3:${D("B3", u.value.length + 2)}3`), e.mergeCells(`${D("B3", u.value.length + 3)}3:${D("B4", u.value.length + 3)}4`), e.mergeCells(`${D("B3", u.value.length + 4)}3:${D("B4", u.value.length + 4)}4`), e.getCell("A1").value = d("workSchedule.firm"), e.getCell("A2").value = d("workSchedule.title", { name: $.value }) + L(
|
|
153
|
+
const t = new Fe.Workbook(), e = t.addWorksheet(L(w.value, "month"), { pageSetup: { paperSize: 9, orientation: "landscape", fitToPage: !0 } }), o = { vertical: "middle", horizontal: "center" }, r = { top: { style: "thin" }, left: { style: "thin" }, bottom: { style: "thin" }, right: { style: "thin" } }, l = { vertical: "middle", horizontal: "center", wrapText: !0 };
|
|
154
|
+
e.mergeCells(`A1:${D("A1", u.value.length + 5)}1`), e.mergeCells(`A2:${D("A2", u.value.length + 5)}2`), e.mergeCells("A3:A4"), e.mergeCells(`B3:${D("B3", u.value.length)}3`), e.mergeCells(`${D("B3", u.value.length + 1)}3:${D("B3", u.value.length + 2)}3`), e.mergeCells(`${D("B3", u.value.length + 3)}3:${D("B4", u.value.length + 3)}4`), e.mergeCells(`${D("B3", u.value.length + 4)}3:${D("B4", u.value.length + 4)}4`), e.getCell("A1").value = d("workSchedule.firm"), e.getCell("A2").value = d("workSchedule.title", { name: $.value }) + L(w.value, "month") + ` ${new Date(w.value).getFullYear()}`, e.getCell("A3").value = d("workSchedule.month"), e.getCell("B3").value = d("workSchedule.numbersMonth"), e.getCell(3, u.value.length + 2).value = d("workSchedule.onSchedule"), e.getCell(3, u.value.length + 4).value = d("workSchedule.acquainted"), e.getCell(3, u.value.length + 5).value = d("workSchedule.date"), e.getCell(4, u.value.length + 2).value = d("workSchedule.days"), e.getCell(4, u.value.length + 3).value = `${d("workSchedule.hours")} (${U.value})`;
|
|
155
155
|
for (let y = 2; y <= u.value.length + 1; y++)
|
|
156
156
|
e.getCell(4, y).value = u.value[y - 2].weekday + `
|
|
157
157
|
` + (y - 1), e.getColumn(y).width = 6, e.getColumn(y).alignment = l, e.getCell(4, y).border = r;
|
|
@@ -174,7 +174,7 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
|
|
|
174
174
|
const p = "export_" + j(Date.now(), "{dd}.{m}.{Y}") + ".xlsx", M = await t.xlsx.writeBuffer();
|
|
175
175
|
ze(new Blob([M]), p), Z.value = !1;
|
|
176
176
|
}, De = async () => {
|
|
177
|
-
q.value || x.workSchedule.addWorkSchedule({ data: n.value, date: j(new Date(
|
|
177
|
+
q.value || x.workSchedule.addWorkSchedule({ data: n.value, date: j(new Date(w.value), "{Y}-{m}-{dd}"), group: $.value }).then((t) => q.value = t);
|
|
178
178
|
};
|
|
179
179
|
return x.group && ($.value = x.group), Ye().then((t) => {
|
|
180
180
|
me.value = t, he();
|
|
@@ -273,7 +273,7 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
|
|
|
273
273
|
}, {
|
|
274
274
|
default: v(() => [
|
|
275
275
|
i(a(z), {
|
|
276
|
-
label: a(d)("workSchedule.title", { name: $.value }) + a(L)(
|
|
276
|
+
label: a(d)("workSchedule.title", { name: $.value }) + a(L)(w.value, "month") + ` ${new Date(w.value).getFullYear()}`,
|
|
277
277
|
align: "center",
|
|
278
278
|
height: "34"
|
|
279
279
|
}, {
|
|
@@ -479,8 +479,8 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
|
|
|
479
479
|
}, null, 8, ["modelValue"]),
|
|
480
480
|
C("span", null, m(a(d)("workSchedule.duration")) + ":", 1),
|
|
481
481
|
i(a(G), {
|
|
482
|
-
modelValue:
|
|
483
|
-
"onUpdate:modelValue": e[10] || (e[10] = (l) =>
|
|
482
|
+
modelValue: f.value,
|
|
483
|
+
"onUpdate:modelValue": e[10] || (e[10] = (l) => f.value = l),
|
|
484
484
|
step: 1,
|
|
485
485
|
min: 4,
|
|
486
486
|
max: 22 - S.value
|
|
@@ -519,8 +519,8 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
|
|
|
519
519
|
}, null, 8, ["modelValue"]),
|
|
520
520
|
C("span", null, m(a(d)("workSchedule.duration")) + ":", 1),
|
|
521
521
|
i(a(G), {
|
|
522
|
-
modelValue:
|
|
523
|
-
"onUpdate:modelValue": e[15] || (e[15] = (l) =>
|
|
522
|
+
modelValue: f.value,
|
|
523
|
+
"onUpdate:modelValue": e[15] || (e[15] = (l) => f.value = l),
|
|
524
524
|
step: 1,
|
|
525
525
|
min: 4,
|
|
526
526
|
max: 22 - S.value,
|