@studio-west/employees 0.6.16 → 0.6.17
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 +56 -56
- 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-Dn3djtwj.cjs"),ve=require("vue-i18n"),i=require("element-plus"),G=require("@imengyu/vue3-context-menu");function ce(k){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(k){for(const S in k)if(S!=="default"){const p=Object.getOwnPropertyDescriptor(k,S);Object.defineProperty(r,S,p.get?p:{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(),p=k,z=e.ref(!1),n=e.ref([]),R=e.ref(new Date().getMonth()+1),j=e.ref(!1),E=e.ref([]),
|
|
2
|
-
`+((h=n.value[l].days[t])==null?void 0:h.time)},W=()=>{n.value=[],I.value=[],E.value=[],p.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})}}),p.workSchedule.getUsersYear({code:I.value,year:new Date(
|
|
3
|
-
`+(f-1),l.getColumn(f).width=6,l.getColumn(f).alignment=t,l.getCell(4,f).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 f of n.value){let H=[f.name];for(let A=1;A<=u.value.length;A++){const{ind:L}=U(A,s);L!==-1?H[A]=`${f.days[L].time} ${f.days[L].tips}`:H[A]=" "}H.push(((x=f.days)==null?void 0:x.length)||" ",f.contHour||0);const ie=l.addRow(H);ie.border=d,s++}let g="Щербина Е. В.";p.odata.personal.forEach(f=>{f.roleName==="Начальник отдела правовой и кадровой работы"&&(g=f.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(p.fullName),l.getCell(`AD${n.value.length+8}`).value=v.byInitials(g),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 h="export_"+v.parseTime(Date.now(),"{dd}.{m}.{Y}")+".xlsx",b=await a.xlsx.writeBuffer();de.saveAs(new Blob([b]),h),z.value=!1},re=async()=>{F.value||p.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:
|
|
1
|
+
"use strict";const e=require("vue"),de=require("file-saver"),se=require("exceljs"),v=require("./index-Dn3djtwj.cjs"),ve=require("vue-i18n"),i=require("element-plus"),G=require("@imengyu/vue3-context-menu");function ce(k){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(k){for(const S in k)if(S!=="default"){const p=Object.getOwnPropertyDescriptor(k,S);Object.defineProperty(r,S,p.get?p:{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(),p=k,z=e.ref(!1),n=e.ref([]),R=e.ref(new Date().getMonth()+1),j=e.ref(!1),E=e.ref([]),w=e.ref(new Date(new Date().getFullYear(),new Date().getMonth(),1)),u=e.ref([]),D=e.ref(0),y=e.ref(9),m=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,p.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,w.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&&p.checkEdit&&(c.value.name=r("workSchedule.autocomplete"),Y.value=!0),l.level===3&&o.cellIndex-l.no===1&&p.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(w.value).getFullYear(),new Date(w.value).getMonth(),l).getTime()+1e3;for(let d of E.value){const{dateStart:t,dateEnd:s,code:g}=d;if(t&&s&&g===a.code&&l!==0&&l<=u.value.length){const h=new Date(v.parseDate(t)).getTime(),b=new Date(v.parseDate(s)).getTime();if(o>=h&&o<=b)return"vacation"}}return""},K=()=>{const a=Z.value,l=new Date(w.value),o=new Date(l.getFullYear(),l.getMonth()+1,0).getDate();let d=[],t=0;for(let s=1;s<=o;s++){const g=v.parseTime(l.setDate(s),"{Y}-{m}-{dd}");t+=a.nowork.includes(g)||a.holidays.includes(g)?0:a.preholidays.includes(g)?7:8;const h=a.nowork.includes(g)?"nowork":a.holidays.includes(g)?"holiday":a.preholidays.includes(g)?"preholiday":"";d.push({day:s,holidays:h,weekday:S(new Date(l.getFullYear(),l.getMonth(),s),"day")})}D.value=t,u.value=d,p.odata.getPersonal({}).then(s=>{var g;C.value.length===0&&(C.value=(g=s.find(h=>h.employeeName===p.fullName))==null?void 0:g.divisionName),s.forEach((h,b)=>{O.value.some(x=>(x==null?void 0:x.value)===h.divisionName)||O.value.push({value:h.divisionName,label:h.divisionName,key:b}),h.divisionName===C.value&&!V.value.some(x=>(x==null?void 0:x.activeText)===h.roleName)&&V.value.push({val:!0,activeText:h.roleName})}),W(),J.value=!1})},le=e.computed(()=>!n.value.some(a=>a.contHour!==D.value)),Q=(a,l)=>{var s,g,h;const o=new Date(w.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?"":((g=n.value[l].days[t])==null?void 0:g.tips)+`
|
|
2
|
+
`+((h=n.value[l].days[t])==null?void 0:h.time)},W=()=>{n.value=[],I.value=[],E.value=[],p.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})}}),p.workSchedule.getUsersYear({code:I.value,year:new Date(w.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=()=>{p.workSchedule.getWorkSchedule({code:I.value,date:v.parseTime(new Date(w.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"&&(m.value-=1,N(l,a,!0),m.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"?(m.value-=1,N(o,a,!0),m.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:m.value,tips:`(${y.value}:00 - ${m.value>=22?y.value+m.value+2:y.value+m.value+1}:00)`}),M()):o||(m.value=n.value[l].days[t].time,y.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:m.value,tips:`(${y.value}:00 - ${m.value>=22?y.value+m.value+2:y.value+m.value+1}:00)`},M()},U=(a,l)=>{var t;const o=v.parseTime(new Date(w.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(w.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(w.value,"month")+` ${new Date(w.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 f=2;f<=u.value.length+1;f++)l.getCell(4,f).value=u.value[f-2].weekday+`
|
|
3
|
+
`+(f-1),l.getColumn(f).width=6,l.getColumn(f).alignment=t,l.getCell(4,f).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 f of n.value){let H=[f.name];for(let A=1;A<=u.value.length;A++){const{ind:L}=U(A,s);L!==-1?H[A]=`${f.days[L].time} ${f.days[L].tips}`:H[A]=" "}H.push(((x=f.days)==null?void 0:x.length)||" ",f.contHour||0);const ie=l.addRow(H);ie.border=d,s++}let g="Щербина Е. В.";p.odata.personal.forEach(f=>{f.roleName==="Начальник отдела правовой и кадровой работы"&&(g=f.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(p.fullName),l.getCell(`AD${n.value.length+8}`).value=v.byInitials(g),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 h="export_"+v.parseTime(Date.now(),"{dd}.{m}.{Y}")+".xlsx",b=await a.xlsx.writeBuffer();de.saveAs(new Blob([b]),h),z.value=!1},re=async()=>{F.value||p.workSchedule.addWorkSchedule({data:n.value,date:v.parseTime(new Date(w.value),"{Y}-{m}-{dd}"),group:C.value}).then(a=>F.value=a)};return p.group&&(C.value=p.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)(w.value,"month")+` ${new Date(w.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:y.value,"onUpdate:modelValue":l[9]||(l[9]=t=>y.value=t),step:1,min:0,max:19},null,8,["modelValue"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.duration"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:m.value,"onUpdate:modelValue":l[10]||(l[10]=t=>m.value=t),step:1,min:4,max:e.unref(v.clamp)(y.value!==1?23-y.value:21,4,22)},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:y.value,"onUpdate:modelValue":l[13]||(l[13]=t=>y.value=t),step:1,min:0,max:19,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:m.value,"onUpdate:modelValue":l[15]||(l[15]=t=>m.value=t),step:1,min:4,max:e.unref(v.clamp)(y.value!==1?23-y.value:21,4,22),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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref as s, watch as ye, computed as Ae, resolveComponent as Me, resolveDirective as Be, createElementBlock as B, openBlock as
|
|
1
|
+
import { ref as s, watch as ye, computed as Ae, resolveComponent as Me, resolveDirective as Be, createElementBlock as B, openBlock as C, createElementVNode as x, createVNode as i, createCommentVNode as _, withDirectives as Te, createBlock as T, unref as a, withCtx as v, Fragment as de, renderList as ie, createTextVNode as b, toDisplayString as m, normalizeStyle as ze } from "vue";
|
|
2
2
|
import { saveAs as Fe } from "file-saver";
|
|
3
3
|
import * as Ye from "exceljs";
|
|
4
4
|
import { p as j, b as re, h as Ue, c as fe, a as we, d as D } from "./index-2Mx6IUGl.js";
|
|
@@ -25,7 +25,7 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
|
|
|
25
25
|
group: String
|
|
26
26
|
},
|
|
27
27
|
setup(F) {
|
|
28
|
-
const { t: d, d: L } = Ie(),
|
|
28
|
+
const { t: d, d: L } = Ie(), S = F, Z = s(!1), n = s([
|
|
29
29
|
// { name: 'Иванов П.М. (Ведущий работник месяца)',
|
|
30
30
|
// days: [], // {day: "2024-11-01", tips: '(9:00 - 18:00)', time: 8 }
|
|
31
31
|
// contHour: 0,
|
|
@@ -38,25 +38,25 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { 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([]), k = s(new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1)), u = s([]), U = s(0), w = s(9), c = 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,
|
|
45
45
|
y: 200
|
|
46
46
|
}), me = s({}), R = s("100%");
|
|
47
47
|
ye($, async (t, e) => {
|
|
48
|
-
t !== e && (E.value = [], q.value = !1,
|
|
48
|
+
t !== e && (E.value = [], q.value = !1, S.odata.personal.forEach((o) => {
|
|
49
49
|
o.divisionName === t && (E.value.some((r) => (r == null ? void 0 : r.activeText) === o.roleName) || E.value.push({ val: !0, activeText: o.roleName }));
|
|
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, k.value = new Date((/* @__PURE__ */ new Date()).getFullYear(), o, 1), he();
|
|
54
54
|
});
|
|
55
55
|
const ke = (t, e, o, r) => {
|
|
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 &&
|
|
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 && S.checkEdit && (h.value.name = d("workSchedule.autocomplete"), K.value = !0), e.level === 3 && o.cellIndex - e.no === 1 && S.checkEdit && (A(o.cellIndex, t.ids), h.value.name = d("workSchedule.modeSelection"), K.value = !0);
|
|
57
57
|
}, Ce = ({ 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(k.value).getFullYear(), new Date(k.value).getMonth(), e).getTime() + 1e3;
|
|
60
60
|
for (let r of Y.value) {
|
|
61
61
|
const { dateStart: l, dateEnd: g, code: p } = r;
|
|
62
62
|
if (l && g && p === t.code && e !== 0 && e <= u.value.length) {
|
|
@@ -66,7 +66,7 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { 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(k.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 p = j(e.setDate(g), "{Y}-{m}-{dd}");
|
|
@@ -74,30 +74,30 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
|
|
|
74
74
|
const y = t.nowork.includes(p) ? "nowork" : t.holidays.includes(p) ? "holiday" : t.preholidays.includes(p) ? "preholiday" : "";
|
|
75
75
|
r.push({ day: g, holidays: y, weekday: L(new Date(e.getFullYear(), e.getMonth(), g), "day") });
|
|
76
76
|
}
|
|
77
|
-
U.value = l, u.value = r,
|
|
77
|
+
U.value = l, u.value = r, S.odata.getPersonal({}).then((g) => {
|
|
78
78
|
var p;
|
|
79
|
-
$.value.length === 0 && ($.value = (p = g.find((y) => y.employeeName ===
|
|
79
|
+
$.value.length === 0 && ($.value = (p = g.find((y) => y.employeeName === S.fullName)) == null ? void 0 : p.divisionName), g.forEach((y, M) => {
|
|
80
80
|
ae.value.some((V) => (V == null ? void 0 : V.value) === y.divisionName) || ae.value.push({ value: y.divisionName, label: y.divisionName, key: M }), y.divisionName === $.value && !E.value.some((V) => (V == null ? void 0 : V.activeText) === y.roleName) && E.value.push({ val: !0, activeText: y.roleName });
|
|
81
81
|
}), oe(), ge.value = !1;
|
|
82
82
|
});
|
|
83
83
|
}, xe = Ae(() => !n.value.some((t) => t.contHour !== U.value)), ce = (t, e) => {
|
|
84
84
|
var g, p, y;
|
|
85
|
-
const o = new Date(
|
|
85
|
+
const o = new Date(k.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 ? "" : ((p = n.value[e].days[l]) == null ? void 0 : p.tips) + `
|
|
87
87
|
` + ((y = n.value[e].days[l]) == null ? void 0 : y.time);
|
|
88
88
|
}, oe = () => {
|
|
89
|
-
n.value = [], J.value = [], Y.value = [],
|
|
89
|
+
n.value = [], J.value = [], Y.value = [], S.odata.personal.forEach((t) => {
|
|
90
90
|
if (t.divisionName === $.value && E.value.some((e) => e.val && e.activeText === t.roleName)) {
|
|
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
|
-
}),
|
|
94
|
+
}), S.workSchedule.getUsersYear({ code: J.value, year: new Date(k.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), Se(), I.value = !1;
|
|
98
98
|
});
|
|
99
99
|
}, Se = () => {
|
|
100
|
-
|
|
100
|
+
S.workSchedule.getWorkSchedule({ code: J.value, date: j(new Date(k.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);
|
|
@@ -131,8 +131,8 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
|
|
|
131
131
|
l === -1 ? (n.value[e].days.push({
|
|
132
132
|
day: r,
|
|
133
133
|
time: c.value,
|
|
134
|
-
tips: `(${
|
|
135
|
-
}), W()) : o || (c.value = n.value[e].days[l].time,
|
|
134
|
+
tips: `(${w.value}:00 - ${c.value >= 22 ? w.value + c.value + 2 : w.value + c.value + 1}:00)`
|
|
135
|
+
}), W()) : o || (c.value = n.value[e].days[l].time, w.value = parseInt(n.value[e].days[l].tips.slice(1, -12)));
|
|
136
136
|
}, Ve = (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();
|
|
@@ -141,17 +141,17 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
|
|
|
141
141
|
n.value[e].days[r] = {
|
|
142
142
|
day: o,
|
|
143
143
|
time: c.value,
|
|
144
|
-
tips: `(${
|
|
144
|
+
tips: `(${w.value}:00 - ${c.value >= 22 ? w.value + c.value + 2 : w.value + c.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(k.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
|
}, De = async () => {
|
|
151
151
|
var V;
|
|
152
152
|
Z.value = !0;
|
|
153
|
-
const t = new Ye.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 Ye.Workbook(), e = t.addWorksheet(L(k.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(k.value, "month") + ` ${new Date(k.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 f = 2; f <= u.value.length + 1; f++)
|
|
156
156
|
e.getCell(4, f).value = u.value[f - 2].weekday + `
|
|
157
157
|
` + (f - 1), e.getColumn(f).width = 6, e.getColumn(f).alignment = l, e.getCell(4, f).border = r;
|
|
@@ -168,21 +168,21 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
|
|
|
168
168
|
Ne.border = r, g++;
|
|
169
169
|
}
|
|
170
170
|
let p = "Щербина Е. В.";
|
|
171
|
-
|
|
171
|
+
S.odata.personal.forEach((f) => {
|
|
172
172
|
f.roleName === "Начальник отдела правовой и кадровой работы" && (p = f.employeeName);
|
|
173
|
-
}), e.mergeCells(`A${n.value.length + 6}:P${n.value.length + 6}`), e.mergeCells(`Q${n.value.length + 6}:AG${n.value.length + 6}`), e.mergeCells(`B${n.value.length + 8}:E${n.value.length + 8}`), e.mergeCells(`F${n.value.length + 8}:L${n.value.length + 8}`), e.mergeCells(`M${n.value.length + 8}:P${n.value.length + 8}`), e.mergeCells(`S${n.value.length + 8}:V${n.value.length + 8}`), e.mergeCells(`W${n.value.length + 8}:AC${n.value.length + 8}`), e.mergeCells(`AD${n.value.length + 8}:AG${n.value.length + 8}`), e.mergeCells(`Z${n.value.length + 9}:AA${n.value.length + 9}`), e.getCell(`A${n.value.length + 6}`).value = d("workSchedule.byInitials"), e.getCell(`Q${n.value.length + 6}`).value = d("workSchedule.supervisorHR"), e.getCell(`B${n.value.length + 8}`).value = d("workSchedule.compiled") + ":", e.getCell(`S${n.value.length + 8}`).value = d("workSchedule.approved") + ":", e.getCell(`M${n.value.length + 8}`).value = re(
|
|
173
|
+
}), e.mergeCells(`A${n.value.length + 6}:P${n.value.length + 6}`), e.mergeCells(`Q${n.value.length + 6}:AG${n.value.length + 6}`), e.mergeCells(`B${n.value.length + 8}:E${n.value.length + 8}`), e.mergeCells(`F${n.value.length + 8}:L${n.value.length + 8}`), e.mergeCells(`M${n.value.length + 8}:P${n.value.length + 8}`), e.mergeCells(`S${n.value.length + 8}:V${n.value.length + 8}`), e.mergeCells(`W${n.value.length + 8}:AC${n.value.length + 8}`), e.mergeCells(`AD${n.value.length + 8}:AG${n.value.length + 8}`), e.mergeCells(`Z${n.value.length + 9}:AA${n.value.length + 9}`), e.getCell(`A${n.value.length + 6}`).value = d("workSchedule.byInitials"), e.getCell(`Q${n.value.length + 6}`).value = d("workSchedule.supervisorHR"), e.getCell(`B${n.value.length + 8}`).value = d("workSchedule.compiled") + ":", e.getCell(`S${n.value.length + 8}`).value = d("workSchedule.approved") + ":", e.getCell(`M${n.value.length + 8}`).value = re(S.fullName), e.getCell(`AD${n.value.length + 8}`).value = re(p), e.getCell(`Z${n.value.length + 9}`).value = d("workSchedule.printPlace"), e.getCell(`A${n.value.length + 6}`).alignment = { vertical: "middle", horizontal: "right" }, e.getCell(`Q${n.value.length + 6}`).alignment = { vertical: "middle", horizontal: "right" }, e.getCell(`B${n.value.length + 8}`).alignment = { vertical: "middle", horizontal: "right" }, e.getCell(`F${n.value.length + 8}`).alignment = { vertical: "middle", horizontal: "right" }, e.getCell(`M${n.value.length + 8}`).alignment = { vertical: "middle", horizontal: "left" }, e.getCell(`AD${n.value.length + 8}`).alignment = { vertical: "middle", horizontal: "left" }, e.getCell(`Z${n.value.length + 9}`).alignment = o, e.getCell(`F${n.value.length + 8}`).border = { bottom: { style: "thin" } }, e.getCell(`W${n.value.length + 8}`).border = { bottom: { style: "thin" } };
|
|
174
174
|
const y = "export_" + j(Date.now(), "{dd}.{m}.{Y}") + ".xlsx", M = await t.xlsx.writeBuffer();
|
|
175
175
|
Fe(new Blob([M]), y), Z.value = !1;
|
|
176
176
|
}, Ee = async () => {
|
|
177
|
-
q.value ||
|
|
177
|
+
q.value || S.workSchedule.addWorkSchedule({ data: n.value, date: j(new Date(k.value), "{Y}-{m}-{dd}"), group: $.value }).then((t) => q.value = t);
|
|
178
178
|
};
|
|
179
|
-
return
|
|
179
|
+
return S.group && ($.value = S.group), Ue().then((t) => {
|
|
180
180
|
me.value = t, he();
|
|
181
181
|
}), (t, e) => {
|
|
182
182
|
const o = Me("el-date-picker"), r = Be("loading");
|
|
183
|
-
return
|
|
184
|
-
|
|
185
|
-
F.checkEdit ? (
|
|
183
|
+
return C(), B("div", Ke, [
|
|
184
|
+
x("div", Qe, [
|
|
185
|
+
F.checkEdit ? (C(), T(a(He), {
|
|
186
186
|
key: 0,
|
|
187
187
|
modelValue: $.value,
|
|
188
188
|
"onUpdate:modelValue": e[0] || (e[0] = (l) => $.value = l),
|
|
@@ -190,7 +190,7 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
|
|
|
190
190
|
style: { width: "240px" }
|
|
191
191
|
}, {
|
|
192
192
|
default: v(() => [
|
|
193
|
-
(
|
|
193
|
+
(C(!0), B(de, null, ie(ae.value, (l) => (C(), T(a(Re), {
|
|
194
194
|
key: l.key,
|
|
195
195
|
label: l.label,
|
|
196
196
|
value: l.value
|
|
@@ -198,7 +198,7 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
|
|
|
198
198
|
]),
|
|
199
199
|
_: 1
|
|
200
200
|
}, 8, ["modelValue"])) : _("", !0),
|
|
201
|
-
F.checkEdit ? (
|
|
201
|
+
F.checkEdit ? (C(), T(a(N), {
|
|
202
202
|
key: 1,
|
|
203
203
|
plain: "",
|
|
204
204
|
onClick: e[1] || (e[1] = (l) => I.value = !0)
|
|
@@ -216,7 +216,7 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
|
|
|
216
216
|
format: "MMM",
|
|
217
217
|
"value-format": "M"
|
|
218
218
|
}, null, 8, ["modelValue"]),
|
|
219
|
-
e[19] || (e[19] =
|
|
219
|
+
e[19] || (e[19] = x("div", { class: "expander" }, null, -1)),
|
|
220
220
|
i(a(ve), {
|
|
221
221
|
modelValue: R.value,
|
|
222
222
|
"onUpdate:modelValue": e[3] || (e[3] = (l) => R.value = l),
|
|
@@ -273,7 +273,7 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { 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)(k.value, "month") + ` ${new Date(k.value).getFullYear()}`,
|
|
277
277
|
align: "center",
|
|
278
278
|
height: "34"
|
|
279
279
|
}, {
|
|
@@ -285,7 +285,7 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
|
|
|
285
285
|
fixed: R.value !== "100%"
|
|
286
286
|
}, {
|
|
287
287
|
default: v((l) => [
|
|
288
|
-
|
|
288
|
+
x("div", Xe, m(n.value[l.$index].name), 1)
|
|
289
289
|
]),
|
|
290
290
|
_: 1
|
|
291
291
|
}, 8, ["label", "fixed"]),
|
|
@@ -294,7 +294,7 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
|
|
|
294
294
|
align: "center"
|
|
295
295
|
}, {
|
|
296
296
|
default: v(() => [
|
|
297
|
-
(
|
|
297
|
+
(C(!0), B(de, null, ie(u.value, (l) => (C(), T(a(z), {
|
|
298
298
|
key: l.day,
|
|
299
299
|
width: "46",
|
|
300
300
|
"class-name": l.holidays,
|
|
@@ -304,7 +304,7 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
|
|
|
304
304
|
prop: "vacation"
|
|
305
305
|
}, {
|
|
306
306
|
default: v((g) => [
|
|
307
|
-
|
|
307
|
+
x("div", _e, m(ce(l.day, g.$index) || " "), 1)
|
|
308
308
|
]),
|
|
309
309
|
_: 2
|
|
310
310
|
}, 1032, ["class-name", "label"]))), 128))
|
|
@@ -331,7 +331,7 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
|
|
|
331
331
|
align: "center"
|
|
332
332
|
}, {
|
|
333
333
|
default: v((l) => [
|
|
334
|
-
|
|
334
|
+
x("div", {
|
|
335
335
|
style: ze(`color: ${U.value === l.row.contHour ? "green" : "red"};`)
|
|
336
336
|
}, m(l.row.contHour), 5)
|
|
337
337
|
]),
|
|
@@ -349,9 +349,9 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
|
|
|
349
349
|
]),
|
|
350
350
|
_: 1
|
|
351
351
|
}, 8, ["loading"]),
|
|
352
|
-
xe.value && F.checkEdit ? (
|
|
352
|
+
xe.value && F.checkEdit ? (C(), B("div", el, [
|
|
353
353
|
b(m(a(d)("workSchedule.chartsFilled")) + ": ", 1),
|
|
354
|
-
q.value ? _("", !0) : (
|
|
354
|
+
q.value ? _("", !0) : (C(), T(a(N), {
|
|
355
355
|
key: 0,
|
|
356
356
|
type: "primary",
|
|
357
357
|
onClick: Ee
|
|
@@ -362,9 +362,9 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
|
|
|
362
362
|
_: 1
|
|
363
363
|
})),
|
|
364
364
|
e[20] || (e[20] = b()),
|
|
365
|
-
|
|
365
|
+
x("span", null, m(F.fullName), 1)
|
|
366
366
|
])) : _("", !0),
|
|
367
|
-
Te((
|
|
367
|
+
Te((C(), T(a(N), {
|
|
368
368
|
disabled: Z.value,
|
|
369
369
|
plain: "",
|
|
370
370
|
onClick: De,
|
|
@@ -411,7 +411,7 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
|
|
|
411
411
|
autocomplete: "on"
|
|
412
412
|
}, {
|
|
413
413
|
default: v(() => [
|
|
414
|
-
(
|
|
414
|
+
(C(!0), B(de, null, ie(E.value, (l) => (C(), T(a(Ge), null, {
|
|
415
415
|
default: v(() => [
|
|
416
416
|
i(a(ve), {
|
|
417
417
|
modelValue: l.val,
|
|
@@ -438,7 +438,7 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
|
|
|
438
438
|
disabled: ""
|
|
439
439
|
}, null, 8, ["label"]),
|
|
440
440
|
i(a(Je)),
|
|
441
|
-
h.value.level === 2 ? (
|
|
441
|
+
h.value.level === 2 ? (C(), B("div", ll, [
|
|
442
442
|
i(a(Le), {
|
|
443
443
|
modelValue: te.value,
|
|
444
444
|
"onUpdate:modelValue": e[7] || (e[7] = (l) => te.value = l),
|
|
@@ -460,8 +460,8 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
|
|
|
460
460
|
]),
|
|
461
461
|
_: 1
|
|
462
462
|
}, 8, ["modelValue"]),
|
|
463
|
-
e[21] || (e[21] =
|
|
464
|
-
|
|
463
|
+
e[21] || (e[21] = x("br", null, null, -1)),
|
|
464
|
+
x("span", null, m(a(d)("workSchedule.fromDate")) + ":", 1),
|
|
465
465
|
i(a(G), {
|
|
466
466
|
modelValue: H.value,
|
|
467
467
|
"onUpdate:modelValue": e[8] || (e[8] = (l) => H.value = l),
|
|
@@ -469,21 +469,21 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
|
|
|
469
469
|
min: 1,
|
|
470
470
|
max: u.value.length
|
|
471
471
|
}, null, 8, ["modelValue", "max"]),
|
|
472
|
-
|
|
472
|
+
x("span", null, m(a(d)("workSchedule.with")) + ":", 1),
|
|
473
473
|
i(a(G), {
|
|
474
|
-
modelValue:
|
|
475
|
-
"onUpdate:modelValue": e[9] || (e[9] = (l) =>
|
|
474
|
+
modelValue: w.value,
|
|
475
|
+
"onUpdate:modelValue": e[9] || (e[9] = (l) => w.value = l),
|
|
476
476
|
step: 1,
|
|
477
477
|
min: 0,
|
|
478
478
|
max: 19
|
|
479
479
|
}, null, 8, ["modelValue"]),
|
|
480
|
-
|
|
480
|
+
x("span", null, m(a(d)("workSchedule.duration")) + ":", 1),
|
|
481
481
|
i(a(G), {
|
|
482
482
|
modelValue: c.value,
|
|
483
483
|
"onUpdate:modelValue": e[10] || (e[10] = (l) => c.value = l),
|
|
484
484
|
step: 1,
|
|
485
485
|
min: 4,
|
|
486
|
-
max: a(fe)(23 -
|
|
486
|
+
max: a(fe)(w.value !== 1 ? 23 - w.value : 21, 4, 22)
|
|
487
487
|
}, null, 8, ["modelValue", "max"]),
|
|
488
488
|
i(a(N), {
|
|
489
489
|
style: { "margin-top": ".5rem" },
|
|
@@ -505,25 +505,25 @@ const Ke = { class: "work" }, Qe = { class: "nav" }, Xe = { style: { height: "10
|
|
|
505
505
|
]),
|
|
506
506
|
_: 1
|
|
507
507
|
})
|
|
508
|
-
])) : (
|
|
509
|
-
|
|
510
|
-
e[22] || (e[22] =
|
|
511
|
-
|
|
508
|
+
])) : (C(), B("div", tl, [
|
|
509
|
+
x("div", null, m(ce(h.value.day, h.value.ids)), 1),
|
|
510
|
+
e[22] || (e[22] = x("br", null, null, -1)),
|
|
511
|
+
x("span", null, m(a(d)("workSchedule.with")) + ":", 1),
|
|
512
512
|
i(a(G), {
|
|
513
|
-
modelValue:
|
|
514
|
-
"onUpdate:modelValue": e[13] || (e[13] = (l) =>
|
|
513
|
+
modelValue: w.value,
|
|
514
|
+
"onUpdate:modelValue": e[13] || (e[13] = (l) => w.value = l),
|
|
515
515
|
step: 1,
|
|
516
516
|
min: 0,
|
|
517
517
|
max: 19,
|
|
518
518
|
onChange: e[14] || (e[14] = (l) => pe(h.value.day, h.value.ids))
|
|
519
519
|
}, null, 8, ["modelValue"]),
|
|
520
|
-
|
|
520
|
+
x("span", null, m(a(d)("workSchedule.duration")) + ":", 1),
|
|
521
521
|
i(a(G), {
|
|
522
522
|
modelValue: c.value,
|
|
523
523
|
"onUpdate:modelValue": e[15] || (e[15] = (l) => c.value = l),
|
|
524
524
|
step: 1,
|
|
525
525
|
min: 4,
|
|
526
|
-
max: a(fe)(23 -
|
|
526
|
+
max: a(fe)(w.value !== 1 ? 23 - w.value : 21, 4, 22),
|
|
527
527
|
onChange: e[16] || (e[16] = (l) => pe(h.value.day, h.value.ids))
|
|
528
528
|
}, null, 8, ["modelValue", "max"]),
|
|
529
529
|
i(a(N), {
|