@studio-west/employees 0.4.6 → 0.4.7
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/VacationTable.cjs +1 -0
- package/dist/VacationTable.js +728 -0
- package/dist/WorkTable.cjs +3 -0
- package/dist/WorkTable.js +513 -0
- package/dist/employees.css +1 -0
- package/dist/index-CHGzf-XH.cjs +1 -0
- package/dist/index-uVRk2ARj.js +100 -0
- package/package.json +1 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";const e=require("vue"),ne=require("file-saver"),oe=require("exceljs"),c=require("./index-CHGzf-XH.cjs"),ue=require("vue-i18n"),i=require("element-plus"),H=require("@imengyu/vue3-context-menu");function re(p){const u=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(p){for(const C in p)if(C!=="default"){const f=Object.getOwnPropertyDescriptor(p,C);Object.defineProperty(u,C,f.get?f:{enumerable:!0,get:()=>p[C]})}}return u.default=p,Object.freeze(u)}const ie=re(oe),de={style:{height:"100px",width:"100%",display:"inline-block"}},se={style:{height:"100px",width:"100%",display:"inline-block"}},ce={key:3,class:"controls-container",style:{"margin-top":".5rem"}},ve={key:0,style:{padding:"0.5em 1.5em"}},me={key:1,style:{padding:"0.5em 1.5em"}},ge={__name:"WorkTable",props:{checkEdit:{type:Boolean,default:()=>!0},odata:Object,workSchedule:Object,fullName:{type:String,default:"Вы"}},setup(p){const{t:u,d:C}=ue.useI18n(),f=p,T=e.ref(!1),n=e.ref([]),M=e.ref("1"),w=e.ref(new Date(new Date().getFullYear(),new Date().getMonth(),1).setMonth(new Date().getMonth()+Number(M.value))),r=e.ref([]),N=e.ref(0),x=e.ref(9),y=e.ref(8),A=e.ref(!1),O=e.ref(!0),E=e.ref(!1),Y=e.ref("5"),$=e.ref(1),S=e.ref("Сектор разработок и эксплуатации сети"),U=e.ref([]),V=e.ref([]),s=e.ref({name:"Имя",length:0,code:""}),I=e.ref(!1),R=e.ref({zIndex:30,minWidth:220,x:500,y:200}),P=e.ref({});e.watch(S,async(a,l)=>{a!==l&&(V.value=[],A.value=!1,f.odata.personal.forEach(o=>{o.Group===a&&(V.value.some(t=>(t==null?void 0:t.activeText)===o.roleName)||V.value.push({val:!0,activeText:o.roleName}))}),j())}),e.watch(M,async(a,l)=>{w.value=new Date(new Date().getFullYear(),new Date().getMonth(),1).setMonth(new Date().getMonth()+Number(a)),W()});const Z=(a,l,o,t)=>{s.value.ids=a.ids,s.value.key=a.key,s.value.add=a.days.length>0&&a.days[a.days.length-1].cont,s.value.level=l.level,s.value.day=o.cellIndex,R.value.y=t.clientY,R.value.x=t.clientX,l.level===2&&l.no===0&&f.checkEdit&&(s.value.name=u("workSchedule.autocomplete"),I.value=!0),l.level===3&&o.cellIndex-l.no===1&&f.checkEdit&&(b(o.cellIndex,a.ids),s.value.name=u("workSchedule.modeSelection"),I.value=!0)},W=()=>{const a=P.value,l=new Date(w.value),o=new Date(l.getFullYear(),l.getMonth()+1,0).getDate();let t=[],d=0;for(let g=1;g<=o;g++){const h=c.parseTime(l.setDate(g),"{Y}-{m}-{dd}");d+=a.nowork.includes(h)||a.holidays.includes(h)?0:a.preholidays.includes(h)?7:8;const v=a.nowork.includes(h)?"nowork":a.holidays.includes(h)?"holiday":a.preholidays.includes(h)?"preholiday":"";t.push({day:g,holidays:v,weekday:C(new Date(l.getFullYear(),l.getMonth(),g),"day")})}N.value=d,r.value=t,f.odata.getPersonal({}).then(g=>{var h;S.value=(h=g.find(v=>v.employeeName===f.fullName))==null?void 0:h.divisionName,g.forEach(v=>{v.status!=="Увольнение"&&(U.value.some(k=>(k==null?void 0:k.value)===v.divisionName)||U.value.push({value:v.divisionName,label:v.divisionName,key:v.divisionName}),v.divisionName===S.value&&!V.value.some(k=>(k==null?void 0:k.activeText)===v.roleName)&&V.value.push({val:!0,activeText:v.roleName}))}),j(),O.value=!1})},K=e.computed(()=>!n.value.some(a=>a.contHour!==N.value)),L=(a,l)=>{var g,h,v;const o=new Date(w.value),t=`${o.getFullYear()}-${(o.getMonth()+1).toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}`,d=(g=n.value[l])==null?void 0:g.days.findIndex(k=>k.day===t);return l===-1||d===-1?"":((h=n.value[l].days[d])==null?void 0:h.time)+" "+((v=n.value[l].days[d])==null?void 0:v.tips)},j=()=>{n.value=[];let a=[];f.odata.personal.forEach(l=>{if(l.divisionName===S.value&&V.value.some(o=>o.val&&o.activeText===l.roleName)){let o=c.byInitials(l.employeeName);a.push(l.employeeKey),n.value.push({name:o+" ("+l.roleName+")",days:[],contHour:0,code:l.employeeKey,id:!1,ids:n.value.length})}}),Q(a),E.value=!1},Q=a=>{f.workSchedule.getWorkSchedule({code:a,date:c.parseTime(new Date(w.value),"{Y}-{m}-{dd}")}).then(l=>{l.forEach((o,t)=>{o!==null&&(n.value[t].days=o.data.days,n.value[t].id=o.id)}),D()})},D=()=>{n.value.forEach(a=>{a.contHour=a.days.reduce((l,o)=>l+o.time,0)})},X=a=>{n.value[a].days=[],D()},_=a=>{switch(Y.value){case"5":for(let l=$.value;l<=r.value.length;l++)r.value[l-1].holidays===""&&b(l,a,!0),r.value[l-1].holidays==="preholiday"&&(y.value-=1,b(l,a,!0),y.value+=1);break;case"2x2":for(let l=$.value;l<=r.value.length;l+=4)b(l,a,!0),l+1<=r.value.length&&b(l+1,a,!0);break;case"2x5":for(let l=$.value;l<=r.value.length;l+=7)for(let o=l;o<l+5&&o<=r.value.length;o++)r.value[o-1].holidays==="preholiday"?(y.value-=1,b(o,a,!0),y.value+=1):b(o,a,!0);break}},b=(a,l,o=!1)=>{const{date:t,ind:d}=z(a,l);d===-1?(n.value[l].days.push({day:t,time:y.value,tips:`(${x.value}:00 - ${x.value+y.value+1}:00)`}),D()):o||(y.value=n.value[l].days[d].time,x.value=parseInt(n.value[l].days[d].tips.slice(1,-12)))},ee=(a,l)=>{const{ind:o}=z(a,l);n.value[l].days.splice(o,1),D(),document.querySelector(".app-main").click()},G=(a,l)=>{const{date:o,ind:t}=z(a,l);n.value[l].days[t]={day:o,time:y.value,tips:`(${x.value}:00 - ${x.value+y.value+1}:00)`},D()},z=(a,l)=>{var d;const o=c.parseTime(new Date(w.value).setDate(a),"{Y}-{m}-{dd}"),t=(d=n.value[l])==null?void 0:d.days.findIndex(g=>g.day===o);return{date:o,ind:t}},le=async()=>{var J;T.value=!0;const a=new ie.Workbook,l=a.addWorksheet(C(w.value,"month"),{pageSetup:{paperSize:9,orientation:"landscape",fitToPage:!0}}),o={vertical:"middle",horizontal:"center"},t={top:{style:"thin"},left:{style:"thin"},bottom:{style:"thin"},right:{style:"thin"}},d={vertical:"middle",horizontal:"center",wrapText:!0};l.mergeCells(`A1:${c.cellsDynamically("A1",r.value.length+5)}1`),l.mergeCells(`A2:${c.cellsDynamically("A2",r.value.length+5)}2`),l.mergeCells("A3:A4"),l.mergeCells(`B3:${c.cellsDynamically("B3",r.value.length)}3`),l.mergeCells(`${c.cellsDynamically("B3",r.value.length+1)}3:${c.cellsDynamically("B3",r.value.length+2)}3`),l.mergeCells(`${c.cellsDynamically("B3",r.value.length+3)}3:${c.cellsDynamically("B4",r.value.length+3)}4`),l.mergeCells(`${c.cellsDynamically("B3",r.value.length+4)}3:${c.cellsDynamically("B4",r.value.length+4)}4`),l.getCell("A1").value=u("workSchedule.firm"),l.getCell("A2").value=u("workSchedule.title",{name:S.value})+C(w.value,"month")+` ${new Date(w.value).getFullYear()}`,l.getCell("A3").value=u("workSchedule.month"),l.getCell("B3").value=u("workSchedule.numbersMonth"),l.getCell(3,r.value.length+2).value=u("workSchedule.onSchedule"),l.getCell(3,r.value.length+4).value=u("workSchedule.acquainted"),l.getCell(3,r.value.length+5).value=u("workSchedule.date"),l.getCell(4,r.value.length+2).value=u("workSchedule.days"),l.getCell(4,r.value.length+3).value=`${u("workSchedule.hours")} (${N.value})`;for(let m=2;m<=r.value.length+1;m++)l.getCell(4,m).value=r.value[m-2].weekday+`
|
|
2
|
+
`+(m-1),l.getColumn(m).width=6,l.getColumn(m).alignment=d,l.getCell(4,m).border=t;l.getRow(1).height=40,l.getRow(2).height=30,l.getRow(3).height=20,l.getColumn(1).width=15,l.getColumn(r.value.length+2).width=5,l.getColumn(r.value.length+3).width=6,l.getColumn(r.value.length+4).width=13,l.getColumn(r.value.length+5).width=13,l.getColumn(1).alignment=d,l.getCell("A2").alignment=o,l.getCell("A3").alignment=o,l.getCell("B3").alignment=o,l.getCell(3,r.value.length+2).alignment=o,l.getColumn(r.value.length+2).alignment=d,l.getColumn(r.value.length+3).alignment=d,l.getColumn(r.value.length+4).alignment=o,l.getColumn(r.value.length+5).alignment=o,l.getCell("A3").border=t,l.getCell("B3").border=t,l.getCell(3,r.value.length+2).border=t,l.getCell(4,r.value.length+2).border=t,l.getCell(3,r.value.length+4).border=t,l.getCell(3,r.value.length+5).border=t,l.getCell(4,r.value.length+3).border=t;let g=0;for(const m of n.value){let F=[m.name];for(let B=1;B<=r.value.length;B++){const{ind:q}=z(B,g);q!==-1?F[B]=`${m.days[q].time} ${m.days[q].tips}`:F[B]=" "}F.push(((J=m.days)==null?void 0:J.length)||" ",m.contHour||0);const ae=l.addRow(F);ae.border=t,g++}let h="Щербина Е. В.";f.odata.personal.forEach(m=>{m.roleName==="Начальник отдела правовой и кадровой работы"&&(h=m.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=u("workSchedule.byInitials"),l.getCell(`Q${n.value.length+6}`).value=u("workSchedule.supervisorHR"),l.getCell(`B${n.value.length+8}`).value=u("workSchedule.compiled")+":",l.getCell(`S${n.value.length+8}`).value=u("workSchedule.approved")+":",l.getCell(`M${n.value.length+8}`).value=c.byInitials(f.fullName),l.getCell(`AD${n.value.length+8}`).value=c.byInitials(h),l.getCell(`Z${n.value.length+9}`).value=u("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 v="export_"+c.parseTime(Date.now(),"{dd}.{m}.{Y}")+".xlsx",k=await a.xlsx.writeBuffer();ne.saveAs(new Blob([k]),v),T.value=!1},te=async()=>{A.value||f.workSchedule.addWorkSchedule({data:n.value,date:c.parseTime(new Date(w.value),"{Y}-{m}-{dd}")}).then(a=>A.value=a)};return c.holidays().then(a=>{P.value=a,W()}),(a,l)=>{const o=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",null,[p.checkEdit?(e.openBlock(),e.createBlock(e.unref(i.ElSelect),{key:0,modelValue:S.value,"onUpdate:modelValue":l[0]||(l[0]=t=>S.value=t),placeholder:"Select",style:{width:"240px","margin-bottom":".5rem","margin-right":".5rem"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value,t=>(e.openBlock(),e.createBlock(e.unref(i.ElOption),{key:t.value,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])):e.createCommentVNode("",!0),p.checkEdit?(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:1,plain:"",onClick:l[1]||(l[1]=t=>E.value=!0),style:{"margin-bottom":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)("workSchedule.jobTitle")),1)]),_:1})):e.createCommentVNode("",!0),p.checkEdit?(e.openBlock(),e.createBlock(e.unref(i.ElSwitch),{key:2,modelValue:M.value,"onUpdate:modelValue":l[2]||(l[2]=t=>M.value=t),"active-text":e.unref(u)("workSchedule.currentMonth"),"active-value":"0","inactive-value":"1",style:{"margin-bottom":".5rem","margin-left":".5rem"}},null,8,["modelValue","active-text"])):e.createCommentVNode("",!0),e.createVNode(e.unref(i.ElSkeleton),{style:{width:"100%"},loading:O.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%"},size:"small",align:"center",onCellClick:Z,"empty-text":e.unref(u)("workSchedule.emptyText")},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(u)("workSchedule.title",{name:S.value})+e.unref(C)(w.value,"month")+` ${new Date(w.value).getFullYear()}`,align:"center",height:"34"},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(u)("workSchedule.month"),width:"180",align:"center"},{default:e.withCtx(t=>[e.createElementVNode("div",de,e.toDisplayString(n.value[t.$index].name),1)]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(u)("workSchedule.numbersMonth"),align:"center"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,t=>(e.openBlock(),e.createBlock(e.unref(i.ElTableColumn),{key:t.day,width:"45","class-name":t.holidays,align:"center",label:t.weekday+`
|
|
3
|
+
`+t.day.toString()},{default:e.withCtx(d=>[e.createElementVNode("div",se,e.toDisplayString(L(t.day,d.$index)||" "),1)]),_:2},1032,["class-name","label"]))),128))]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(u)("workSchedule.onSchedule"),align:"center"},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(u)("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(u)("workSchedule.hours")} ( ${N.value} )`,align:"center"},{default:e.withCtx(t=>[e.createElementVNode("div",{style:e.normalizeStyle(`color: ${N.value===t.row.contHour?"green":"red"};`)},e.toDisplayString(t.row.contHour),5)]),_:1},8,["label"])]),_:1},8,["label"])]),_:1},8,["label"])]),_:1},8,["data","empty-text"])]),_:1},8,["loading"]),K.value&&p.checkEdit?(e.openBlock(),e.createElementBlock("div",ce,[e.createTextVNode(e.toDisplayString(e.unref(u)("workSchedule.chartsFilled"))+": ",1),A.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:0,type:"primary",onClick:te},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)("workSchedule.confirm")),1)]),_:1})),l[17]||(l[17]=e.createTextVNode()),e.createElementVNode("span",null,e.toDisplayString(p.fullName),1)])):e.createCommentVNode("",!0),e.withDirectives((e.openBlock(),e.createBlock(e.unref(i.ElButton),{disabled:T.value,plain:"",onClick:le,style:{"margin-top":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)("workSchedule.exportExcel")),1)]),_:1},8,["disabled"])),[[o,T.value]]),e.createVNode(e.unref(i.ElDialog),{title:e.unref(u)("workSchedule.jobTitle"),modelValue:E.value,"onUpdate:modelValue":l[4]||(l[4]=t=>E.value=t),width:"400px"},{footer:e.withCtx(()=>[e.createVNode(e.unref(i.ElButton),{onClick:l[3]||(l[3]=t=>E.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:j},{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":d=>t.val=d,"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(H.ContextMenu),{show:I.value,"onUpdate:show":l[16]||(l[16]=t=>I.value=t),options:R.value},{default:e.withCtx(()=>[e.createVNode(e.unref(H.ContextMenuItem),{label:s.value.name,disabled:""},null,8,["label"]),e.createVNode(e.unref(H.ContextMenuSeparator)),s.value.level===2?(e.openBlock(),e.createElementBlock("div",ve,[e.createVNode(e.unref(i.ElRadioGroup),{modelValue:Y.value,"onUpdate:modelValue":l[5]||(l[5]=t=>Y.value=t),size:"small"},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElRadioButton),{label:e.unref(u)("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[18]||(l[18]=e.createElementVNode("br",null,null,-1)),e.createElementVNode("span",null,e.toDisplayString(e.unref(u)("workSchedule.fromDate"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:$.value,"onUpdate:modelValue":l[6]||(l[6]=t=>$.value=t),step:1,min:1,max:r.value.length},null,8,["modelValue","max"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(u)("workSchedule.with"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:x.value,"onUpdate:modelValue":l[7]||(l[7]=t=>x.value=t),step:1,min:8,max:11},null,8,["modelValue"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(u)("workSchedule.duration"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:y.value,"onUpdate:modelValue":l[8]||(l[8]=t=>y.value=t),step:1,min:4,max:12},null,8,["modelValue"]),e.createVNode(e.unref(i.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:l[9]||(l[9]=t=>_(s.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)("workSchedule.fillOut")),1)]),_:1}),e.createVNode(e.unref(i.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:l[10]||(l[10]=t=>X(s.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)("workSchedule.clearRow")),1)]),_:1})])):(e.openBlock(),e.createElementBlock("div",me,[e.createElementVNode("div",null,e.toDisplayString(L(s.value.day,s.value.ids)),1),l[19]||(l[19]=e.createElementVNode("br",null,null,-1)),e.createElementVNode("span",null,e.toDisplayString(e.unref(u)("workSchedule.with"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:x.value,"onUpdate:modelValue":l[11]||(l[11]=t=>x.value=t),step:1,min:8,max:11,onChange:l[12]||(l[12]=t=>G(s.value.day,s.value.ids))},null,8,["modelValue"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(u)("workSchedule.duration"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:y.value,"onUpdate:modelValue":l[13]||(l[13]=t=>y.value=t),step:1,min:4,max:12,onChange:l[14]||(l[14]=t=>G(s.value.day,s.value.ids))},null,8,["modelValue"]),e.createVNode(e.unref(i.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:l[15]||(l[15]=t=>ee(s.value.day,s.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)("workSchedule.delete")),1)]),_:1})]))]),_:1},8,["show","options"])])}}};module.exports=ge;
|
|
@@ -0,0 +1,513 @@
|
|
|
1
|
+
import { ref as v, watch as me, computed as $e, resolveDirective as Se, openBlock as f, createElementBlock as B, createBlock as N, unref as t, withCtx as r, Fragment as te, renderList as ae, createCommentVNode as R, createTextVNode as $, toDisplayString as m, createVNode as i, createElementVNode as k, normalizeStyle as xe, withDirectives as De } from "vue";
|
|
2
|
+
import { saveAs as Ve } from "file-saver";
|
|
3
|
+
import * as Ee from "exceljs";
|
|
4
|
+
import { p as W, b as ne, h as Ne, c as D } from "./index-uVRk2ARj.js";
|
|
5
|
+
import { useI18n as Ae } from "vue-i18n";
|
|
6
|
+
import { ElSelect as Me, ElOption as Be, ElButton as A, ElSwitch as ge, ElSkeleton as Te, ElSkeletonItem as P, ElTable as ze, ElTableColumn as T, ElDialog as Fe, ElForm as Ie, ElFormItem as Ye, ElRadioGroup as Ue, ElRadioButton as oe, ElSlider as j } from "element-plus";
|
|
7
|
+
import { ContextMenu as He, ContextMenuItem as Re, ContextMenuSeparator as We } from "@imengyu/vue3-context-menu";
|
|
8
|
+
const Pe = { style: { height: "100px", width: "100%", display: "inline-block" } }, je = { style: { height: "100px", width: "100%", display: "inline-block" } }, Ge = {
|
|
9
|
+
key: 3,
|
|
10
|
+
class: "controls-container",
|
|
11
|
+
style: { "margin-top": ".5rem" }
|
|
12
|
+
}, Oe = {
|
|
13
|
+
key: 0,
|
|
14
|
+
style: { padding: "0.5em 1.5em" }
|
|
15
|
+
}, Le = {
|
|
16
|
+
key: 1,
|
|
17
|
+
style: { padding: "0.5em 1.5em" }
|
|
18
|
+
}, _e = {
|
|
19
|
+
__name: "WorkTable",
|
|
20
|
+
props: {
|
|
21
|
+
checkEdit: { type: Boolean, default: () => !0 },
|
|
22
|
+
odata: Object,
|
|
23
|
+
workSchedule: Object,
|
|
24
|
+
fullName: { type: String, default: "Вы" }
|
|
25
|
+
},
|
|
26
|
+
setup(z) {
|
|
27
|
+
const { t: d, d: G } = Ae(), S = z, O = v(!1), n = v([
|
|
28
|
+
// { name: 'Иванов П.М. (Ведущий работник месяца)',
|
|
29
|
+
// days: [], // {day: "2024-11-01", tips: '(9:00 - 18:00)', time: 8 }
|
|
30
|
+
// contHour: 0,
|
|
31
|
+
// code: '0000-00052',
|
|
32
|
+
// ids: 0
|
|
33
|
+
// },
|
|
34
|
+
// { name: 'Петров И.С. (Ведущий работник месяца)',
|
|
35
|
+
// days: [], // {day: "2024-11-01", tips: '(9:00 - 18:00)', time: 8 }
|
|
36
|
+
// contHour: 0,
|
|
37
|
+
// code: '0000-00052'
|
|
38
|
+
// ids: 1
|
|
39
|
+
// }
|
|
40
|
+
]), L = v("1"), C = v(new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1).setMonth((/* @__PURE__ */ new Date()).getMonth() + Number(L.value))), u = v([]), F = v(0), x = v(9), w = v(8), Z = v(!1), ue = v(!0), I = v(!1), Q = v("5"), Y = v(1), V = v("Сектор разработок и эксплуатации сети"), X = v([]), E = v([]), g = v({ name: "Имя", length: 0, code: "" }), q = v(!1), _ = v({
|
|
41
|
+
zIndex: 30,
|
|
42
|
+
minWidth: 220,
|
|
43
|
+
x: 500,
|
|
44
|
+
y: 200
|
|
45
|
+
}), de = v({});
|
|
46
|
+
me(V, async (a, e) => {
|
|
47
|
+
a !== e && (E.value = [], Z.value = !1, S.odata.personal.forEach((o) => {
|
|
48
|
+
o.Group === a && (E.value.some((l) => (l == null ? void 0 : l.activeText) === o.roleName) || E.value.push({ val: !0, activeText: o.roleName }));
|
|
49
|
+
}), ee());
|
|
50
|
+
}), me(L, async (a, e) => {
|
|
51
|
+
C.value = new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1).setMonth((/* @__PURE__ */ new Date()).getMonth() + Number(a)), ie();
|
|
52
|
+
});
|
|
53
|
+
const he = (a, e, o, l) => {
|
|
54
|
+
g.value.ids = a.ids, g.value.key = a.key, g.value.add = a.days.length > 0 && a.days[a.days.length - 1].cont, g.value.level = e.level, g.value.day = o.cellIndex, _.value.y = l.clientY, _.value.x = l.clientX, e.level === 2 && e.no === 0 && S.checkEdit && (g.value.name = d("workSchedule.autocomplete"), q.value = !0), e.level === 3 && o.cellIndex - e.no === 1 && S.checkEdit && (M(o.cellIndex, a.ids), g.value.name = d("workSchedule.modeSelection"), q.value = !0);
|
|
55
|
+
}, ie = () => {
|
|
56
|
+
const a = de.value, e = new Date(C.value), o = new Date(e.getFullYear(), e.getMonth() + 1, 0).getDate();
|
|
57
|
+
let l = [], s = 0;
|
|
58
|
+
for (let y = 1; y <= o; y++) {
|
|
59
|
+
const p = W(e.setDate(y), "{Y}-{m}-{dd}");
|
|
60
|
+
s += a.nowork.includes(p) || a.holidays.includes(p) ? 0 : a.preholidays.includes(p) ? 7 : 8;
|
|
61
|
+
const h = a.nowork.includes(p) ? "nowork" : a.holidays.includes(p) ? "holiday" : a.preholidays.includes(p) ? "preholiday" : "";
|
|
62
|
+
l.push({ day: y, holidays: h, weekday: G(new Date(e.getFullYear(), e.getMonth(), y), "day") });
|
|
63
|
+
}
|
|
64
|
+
F.value = s, u.value = l, S.odata.getPersonal({}).then((y) => {
|
|
65
|
+
var p;
|
|
66
|
+
V.value = (p = y.find((h) => h.employeeName === S.fullName)) == null ? void 0 : p.divisionName, y.forEach((h) => {
|
|
67
|
+
h.status !== "Увольнение" && (X.value.some((b) => (b == null ? void 0 : b.value) === h.divisionName) || X.value.push({ value: h.divisionName, label: h.divisionName, key: h.divisionName }), h.divisionName === V.value && !E.value.some((b) => (b == null ? void 0 : b.activeText) === h.roleName) && E.value.push({ val: !0, activeText: h.roleName }));
|
|
68
|
+
}), ee(), ue.value = !1;
|
|
69
|
+
});
|
|
70
|
+
}, ce = $e(() => !n.value.some((a) => a.contHour !== F.value)), re = (a, e) => {
|
|
71
|
+
var y, p, h;
|
|
72
|
+
const o = new Date(C.value), l = `${o.getFullYear()}-${(o.getMonth() + 1).toString().padStart(2, "0")}-${a.toString().padStart(2, "0")}`, s = (y = n.value[e]) == null ? void 0 : y.days.findIndex((b) => b.day === l);
|
|
73
|
+
return e === -1 || s === -1 ? "" : ((p = n.value[e].days[s]) == null ? void 0 : p.time) + " " + ((h = n.value[e].days[s]) == null ? void 0 : h.tips);
|
|
74
|
+
}, ee = () => {
|
|
75
|
+
n.value = [];
|
|
76
|
+
let a = [];
|
|
77
|
+
S.odata.personal.forEach((e) => {
|
|
78
|
+
if (e.divisionName === V.value && E.value.some((o) => o.val && o.activeText === e.roleName)) {
|
|
79
|
+
let o = ne(e.employeeName);
|
|
80
|
+
a.push(e.employeeKey), n.value.push({ name: o + " (" + e.roleName + ")", days: [], contHour: 0, code: e.employeeKey, id: !1, ids: n.value.length });
|
|
81
|
+
}
|
|
82
|
+
}), ye(a), I.value = !1;
|
|
83
|
+
}, ye = (a) => {
|
|
84
|
+
S.workSchedule.getWorkSchedule({ code: a, date: W(new Date(C.value), "{Y}-{m}-{dd}") }).then(
|
|
85
|
+
(e) => {
|
|
86
|
+
e.forEach((o, l) => {
|
|
87
|
+
o !== null && (n.value[l].days = o.data.days, n.value[l].id = o.id);
|
|
88
|
+
}), U();
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
}, U = () => {
|
|
92
|
+
n.value.forEach((a) => {
|
|
93
|
+
a.contHour = a.days.reduce((e, o) => e + o.time, 0);
|
|
94
|
+
});
|
|
95
|
+
}, pe = (a) => {
|
|
96
|
+
n.value[a].days = [], U();
|
|
97
|
+
}, fe = (a) => {
|
|
98
|
+
switch (Q.value) {
|
|
99
|
+
case "5":
|
|
100
|
+
for (let e = Y.value; e <= u.value.length; e++)
|
|
101
|
+
u.value[e - 1].holidays === "" && M(e, a, !0), u.value[e - 1].holidays === "preholiday" && (w.value -= 1, M(e, a, !0), w.value += 1);
|
|
102
|
+
break;
|
|
103
|
+
case "2x2":
|
|
104
|
+
for (let e = Y.value; e <= u.value.length; e += 4)
|
|
105
|
+
M(e, a, !0), e + 1 <= u.value.length && M(e + 1, a, !0);
|
|
106
|
+
break;
|
|
107
|
+
case "2x5":
|
|
108
|
+
for (let e = Y.value; e <= u.value.length; e += 7)
|
|
109
|
+
for (let o = e; o < e + 5 && o <= u.value.length; o++)
|
|
110
|
+
u.value[o - 1].holidays === "preholiday" ? (w.value -= 1, M(o, a, !0), w.value += 1) : M(o, a, !0);
|
|
111
|
+
break;
|
|
112
|
+
}
|
|
113
|
+
}, M = (a, e, o = !1) => {
|
|
114
|
+
const { date: l, ind: s } = J(a, e);
|
|
115
|
+
s === -1 ? (n.value[e].days.push({
|
|
116
|
+
day: l,
|
|
117
|
+
time: w.value,
|
|
118
|
+
tips: `(${x.value}:00 - ${x.value + w.value + 1}:00)`
|
|
119
|
+
}), U()) : o || (w.value = n.value[e].days[s].time, x.value = parseInt(n.value[e].days[s].tips.slice(1, -12)));
|
|
120
|
+
}, we = (a, e) => {
|
|
121
|
+
const { ind: o } = J(a, e);
|
|
122
|
+
n.value[e].days.splice(o, 1), U(), document.querySelector(".app-main").click();
|
|
123
|
+
}, se = (a, e) => {
|
|
124
|
+
const { date: o, ind: l } = J(a, e);
|
|
125
|
+
n.value[e].days[l] = {
|
|
126
|
+
day: o,
|
|
127
|
+
time: w.value,
|
|
128
|
+
tips: `(${x.value}:00 - ${x.value + w.value + 1}:00)`
|
|
129
|
+
}, U();
|
|
130
|
+
}, J = (a, e) => {
|
|
131
|
+
var s;
|
|
132
|
+
const o = W(new Date(C.value).setDate(a), "{Y}-{m}-{dd}"), l = (s = n.value[e]) == null ? void 0 : s.days.findIndex((y) => y.day === o);
|
|
133
|
+
return { date: o, ind: l };
|
|
134
|
+
}, ke = async () => {
|
|
135
|
+
var ve;
|
|
136
|
+
O.value = !0;
|
|
137
|
+
const a = new Ee.Workbook(), e = a.addWorksheet(G(C.value, "month"), { pageSetup: { paperSize: 9, orientation: "landscape", fitToPage: !0 } }), o = { vertical: "middle", horizontal: "center" }, l = { top: { style: "thin" }, left: { style: "thin" }, bottom: { style: "thin" }, right: { style: "thin" } }, s = { vertical: "middle", horizontal: "center", wrapText: !0 };
|
|
138
|
+
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: V.value }) + G(C.value, "month") + ` ${new Date(C.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")} (${F.value})`;
|
|
139
|
+
for (let c = 2; c <= u.value.length + 1; c++)
|
|
140
|
+
e.getCell(4, c).value = u.value[c - 2].weekday + `
|
|
141
|
+
` + (c - 1), e.getColumn(c).width = 6, e.getColumn(c).alignment = s, e.getCell(4, c).border = l;
|
|
142
|
+
e.getRow(1).height = 40, e.getRow(2).height = 30, e.getRow(3).height = 20, e.getColumn(1).width = 15, e.getColumn(u.value.length + 2).width = 5, e.getColumn(u.value.length + 3).width = 6, e.getColumn(u.value.length + 4).width = 13, e.getColumn(u.value.length + 5).width = 13, e.getColumn(1).alignment = s, e.getCell("A2").alignment = o, e.getCell("A3").alignment = o, e.getCell("B3").alignment = o, e.getCell(3, u.value.length + 2).alignment = o, e.getColumn(u.value.length + 2).alignment = s, e.getColumn(u.value.length + 3).alignment = s, e.getColumn(u.value.length + 4).alignment = o, e.getColumn(u.value.length + 5).alignment = o, e.getCell("A3").border = l, e.getCell("B3").border = l, e.getCell(3, u.value.length + 2).border = l, e.getCell(4, u.value.length + 2).border = l, e.getCell(3, u.value.length + 4).border = l, e.getCell(3, u.value.length + 5).border = l, e.getCell(4, u.value.length + 3).border = l;
|
|
143
|
+
let y = 0;
|
|
144
|
+
for (const c of n.value) {
|
|
145
|
+
let K = [c.name];
|
|
146
|
+
for (let H = 1; H <= u.value.length; H++) {
|
|
147
|
+
const { ind: le } = J(H, y);
|
|
148
|
+
le !== -1 ? K[H] = `${c.days[le].time} ${c.days[le].tips}` : K[H] = " ";
|
|
149
|
+
}
|
|
150
|
+
K.push(((ve = c.days) == null ? void 0 : ve.length) || " ", c.contHour || 0);
|
|
151
|
+
const be = e.addRow(K);
|
|
152
|
+
be.border = l, y++;
|
|
153
|
+
}
|
|
154
|
+
let p = "Щербина Е. В.";
|
|
155
|
+
S.odata.personal.forEach((c) => {
|
|
156
|
+
c.roleName === "Начальник отдела правовой и кадровой работы" && (p = c.employeeName);
|
|
157
|
+
}), 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 = ne(S.fullName), e.getCell(`AD${n.value.length + 8}`).value = ne(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" } };
|
|
158
|
+
const h = "export_" + W(Date.now(), "{dd}.{m}.{Y}") + ".xlsx", b = await a.xlsx.writeBuffer();
|
|
159
|
+
Ve(new Blob([b]), h), O.value = !1;
|
|
160
|
+
}, Ce = async () => {
|
|
161
|
+
Z.value || S.workSchedule.addWorkSchedule({ data: n.value, date: W(new Date(C.value), "{Y}-{m}-{dd}") }).then((a) => Z.value = a);
|
|
162
|
+
};
|
|
163
|
+
return Ne().then((a) => {
|
|
164
|
+
de.value = a, ie();
|
|
165
|
+
}), (a, e) => {
|
|
166
|
+
const o = Se("loading");
|
|
167
|
+
return f(), B("div", null, [
|
|
168
|
+
z.checkEdit ? (f(), N(t(Me), {
|
|
169
|
+
key: 0,
|
|
170
|
+
modelValue: V.value,
|
|
171
|
+
"onUpdate:modelValue": e[0] || (e[0] = (l) => V.value = l),
|
|
172
|
+
placeholder: "Select",
|
|
173
|
+
style: { width: "240px", "margin-bottom": ".5rem", "margin-right": ".5rem" }
|
|
174
|
+
}, {
|
|
175
|
+
default: r(() => [
|
|
176
|
+
(f(!0), B(te, null, ae(X.value, (l) => (f(), N(t(Be), {
|
|
177
|
+
key: l.value,
|
|
178
|
+
label: l.label,
|
|
179
|
+
value: l.value
|
|
180
|
+
}, null, 8, ["label", "value"]))), 128))
|
|
181
|
+
]),
|
|
182
|
+
_: 1
|
|
183
|
+
}, 8, ["modelValue"])) : R("", !0),
|
|
184
|
+
z.checkEdit ? (f(), N(t(A), {
|
|
185
|
+
key: 1,
|
|
186
|
+
plain: "",
|
|
187
|
+
onClick: e[1] || (e[1] = (l) => I.value = !0),
|
|
188
|
+
style: { "margin-bottom": ".5rem" }
|
|
189
|
+
}, {
|
|
190
|
+
default: r(() => [
|
|
191
|
+
$(m(t(d)("workSchedule.jobTitle")), 1)
|
|
192
|
+
]),
|
|
193
|
+
_: 1
|
|
194
|
+
})) : R("", !0),
|
|
195
|
+
z.checkEdit ? (f(), N(t(ge), {
|
|
196
|
+
key: 2,
|
|
197
|
+
modelValue: L.value,
|
|
198
|
+
"onUpdate:modelValue": e[2] || (e[2] = (l) => L.value = l),
|
|
199
|
+
"active-text": t(d)("workSchedule.currentMonth"),
|
|
200
|
+
"active-value": "0",
|
|
201
|
+
"inactive-value": "1",
|
|
202
|
+
style: { "margin-bottom": ".5rem", "margin-left": ".5rem" }
|
|
203
|
+
}, null, 8, ["modelValue", "active-text"])) : R("", !0),
|
|
204
|
+
i(t(Te), {
|
|
205
|
+
style: { width: "100%" },
|
|
206
|
+
loading: ue.value,
|
|
207
|
+
animated: ""
|
|
208
|
+
}, {
|
|
209
|
+
template: r(() => [
|
|
210
|
+
i(t(P), {
|
|
211
|
+
variant: "text",
|
|
212
|
+
style: { width: "100%", height: "2rem" }
|
|
213
|
+
}),
|
|
214
|
+
i(t(P), {
|
|
215
|
+
variant: "text",
|
|
216
|
+
style: { width: "180px", height: "4rem", "margin-right": "4px" }
|
|
217
|
+
}),
|
|
218
|
+
i(t(P), {
|
|
219
|
+
variant: "text",
|
|
220
|
+
style: { width: "calc( 100% - 184px)", height: "4rem" }
|
|
221
|
+
}),
|
|
222
|
+
i(t(P), {
|
|
223
|
+
variant: "text",
|
|
224
|
+
style: { width: "180px", height: "8rem", "margin-right": "4px" }
|
|
225
|
+
}),
|
|
226
|
+
i(t(P), {
|
|
227
|
+
variant: "text",
|
|
228
|
+
style: { width: "calc( 100% - 184px)", height: "8rem" }
|
|
229
|
+
})
|
|
230
|
+
]),
|
|
231
|
+
default: r(() => [
|
|
232
|
+
i(t(ze), {
|
|
233
|
+
id: "printTable",
|
|
234
|
+
data: n.value,
|
|
235
|
+
style: { width: "100%" },
|
|
236
|
+
size: "small",
|
|
237
|
+
align: "center",
|
|
238
|
+
onCellClick: he,
|
|
239
|
+
"empty-text": t(d)("workSchedule.emptyText")
|
|
240
|
+
}, {
|
|
241
|
+
default: r(() => [
|
|
242
|
+
i(t(T), {
|
|
243
|
+
label: t(d)("workSchedule.title", { name: V.value }) + t(G)(C.value, "month") + ` ${new Date(C.value).getFullYear()}`,
|
|
244
|
+
align: "center",
|
|
245
|
+
height: "34"
|
|
246
|
+
}, {
|
|
247
|
+
default: r(() => [
|
|
248
|
+
i(t(T), {
|
|
249
|
+
label: t(d)("workSchedule.month"),
|
|
250
|
+
width: "180",
|
|
251
|
+
align: "center"
|
|
252
|
+
}, {
|
|
253
|
+
default: r((l) => [
|
|
254
|
+
k("div", Pe, m(n.value[l.$index].name), 1)
|
|
255
|
+
]),
|
|
256
|
+
_: 1
|
|
257
|
+
}, 8, ["label"]),
|
|
258
|
+
i(t(T), {
|
|
259
|
+
label: t(d)("workSchedule.numbersMonth"),
|
|
260
|
+
align: "center"
|
|
261
|
+
}, {
|
|
262
|
+
default: r(() => [
|
|
263
|
+
(f(!0), B(te, null, ae(u.value, (l) => (f(), N(t(T), {
|
|
264
|
+
key: l.day,
|
|
265
|
+
width: "45",
|
|
266
|
+
"class-name": l.holidays,
|
|
267
|
+
align: "center",
|
|
268
|
+
label: l.weekday + `
|
|
269
|
+
` + l.day.toString()
|
|
270
|
+
}, {
|
|
271
|
+
default: r((s) => [
|
|
272
|
+
k("div", je, m(re(l.day, s.$index) || " "), 1)
|
|
273
|
+
]),
|
|
274
|
+
_: 2
|
|
275
|
+
}, 1032, ["class-name", "label"]))), 128))
|
|
276
|
+
]),
|
|
277
|
+
_: 1
|
|
278
|
+
}, 8, ["label"]),
|
|
279
|
+
i(t(T), {
|
|
280
|
+
label: t(d)("workSchedule.onSchedule"),
|
|
281
|
+
align: "center"
|
|
282
|
+
}, {
|
|
283
|
+
default: r(() => [
|
|
284
|
+
i(t(T), {
|
|
285
|
+
label: t(d)("workSchedule.days"),
|
|
286
|
+
align: "center"
|
|
287
|
+
}, {
|
|
288
|
+
default: r((l) => [
|
|
289
|
+
$(m(n.value[l.$index].days.length || 0), 1)
|
|
290
|
+
]),
|
|
291
|
+
_: 1
|
|
292
|
+
}, 8, ["label"]),
|
|
293
|
+
i(t(T), {
|
|
294
|
+
label: `${t(d)("workSchedule.hours")} ( ${F.value} )`,
|
|
295
|
+
align: "center"
|
|
296
|
+
}, {
|
|
297
|
+
default: r((l) => [
|
|
298
|
+
k("div", {
|
|
299
|
+
style: xe(`color: ${F.value === l.row.contHour ? "green" : "red"};`)
|
|
300
|
+
}, m(l.row.contHour), 5)
|
|
301
|
+
]),
|
|
302
|
+
_: 1
|
|
303
|
+
}, 8, ["label"])
|
|
304
|
+
]),
|
|
305
|
+
_: 1
|
|
306
|
+
}, 8, ["label"])
|
|
307
|
+
]),
|
|
308
|
+
_: 1
|
|
309
|
+
}, 8, ["label"])
|
|
310
|
+
]),
|
|
311
|
+
_: 1
|
|
312
|
+
}, 8, ["data", "empty-text"])
|
|
313
|
+
]),
|
|
314
|
+
_: 1
|
|
315
|
+
}, 8, ["loading"]),
|
|
316
|
+
ce.value && z.checkEdit ? (f(), B("div", Ge, [
|
|
317
|
+
$(m(t(d)("workSchedule.chartsFilled")) + ": ", 1),
|
|
318
|
+
Z.value ? R("", !0) : (f(), N(t(A), {
|
|
319
|
+
key: 0,
|
|
320
|
+
type: "primary",
|
|
321
|
+
onClick: Ce
|
|
322
|
+
}, {
|
|
323
|
+
default: r(() => [
|
|
324
|
+
$(m(t(d)("workSchedule.confirm")), 1)
|
|
325
|
+
]),
|
|
326
|
+
_: 1
|
|
327
|
+
})),
|
|
328
|
+
e[17] || (e[17] = $()),
|
|
329
|
+
k("span", null, m(z.fullName), 1)
|
|
330
|
+
])) : R("", !0),
|
|
331
|
+
De((f(), N(t(A), {
|
|
332
|
+
disabled: O.value,
|
|
333
|
+
plain: "",
|
|
334
|
+
onClick: ke,
|
|
335
|
+
style: { "margin-top": ".5rem" }
|
|
336
|
+
}, {
|
|
337
|
+
default: r(() => [
|
|
338
|
+
$(m(t(d)("workSchedule.exportExcel")), 1)
|
|
339
|
+
]),
|
|
340
|
+
_: 1
|
|
341
|
+
}, 8, ["disabled"])), [
|
|
342
|
+
[o, O.value]
|
|
343
|
+
]),
|
|
344
|
+
i(t(Fe), {
|
|
345
|
+
title: t(d)("workSchedule.jobTitle"),
|
|
346
|
+
modelValue: I.value,
|
|
347
|
+
"onUpdate:modelValue": e[4] || (e[4] = (l) => I.value = l),
|
|
348
|
+
width: "400px"
|
|
349
|
+
}, {
|
|
350
|
+
footer: r(() => [
|
|
351
|
+
i(t(A), {
|
|
352
|
+
onClick: e[3] || (e[3] = (l) => I.value = !1),
|
|
353
|
+
size: "default"
|
|
354
|
+
}, {
|
|
355
|
+
default: r(() => [
|
|
356
|
+
$(m(a.$t("workSchedule.cancel")), 1)
|
|
357
|
+
]),
|
|
358
|
+
_: 1
|
|
359
|
+
}),
|
|
360
|
+
i(t(A), {
|
|
361
|
+
size: "default",
|
|
362
|
+
type: "primary",
|
|
363
|
+
onClick: ee
|
|
364
|
+
}, {
|
|
365
|
+
default: r(() => [
|
|
366
|
+
$(m(a.$t("workSchedule.select")), 1)
|
|
367
|
+
]),
|
|
368
|
+
_: 1
|
|
369
|
+
})
|
|
370
|
+
]),
|
|
371
|
+
default: r(() => [
|
|
372
|
+
i(t(Ie), {
|
|
373
|
+
ref: "dialogForm",
|
|
374
|
+
model: E.value,
|
|
375
|
+
autocomplete: "on"
|
|
376
|
+
}, {
|
|
377
|
+
default: r(() => [
|
|
378
|
+
(f(!0), B(te, null, ae(E.value, (l) => (f(), N(t(Ye), null, {
|
|
379
|
+
default: r(() => [
|
|
380
|
+
i(t(ge), {
|
|
381
|
+
modelValue: l.val,
|
|
382
|
+
"onUpdate:modelValue": (s) => l.val = s,
|
|
383
|
+
"active-text": l.activeText
|
|
384
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "active-text"])
|
|
385
|
+
]),
|
|
386
|
+
_: 2
|
|
387
|
+
}, 1024))), 256))
|
|
388
|
+
]),
|
|
389
|
+
_: 1
|
|
390
|
+
}, 8, ["model"])
|
|
391
|
+
]),
|
|
392
|
+
_: 1
|
|
393
|
+
}, 8, ["title", "modelValue"]),
|
|
394
|
+
i(t(He), {
|
|
395
|
+
show: q.value,
|
|
396
|
+
"onUpdate:show": e[16] || (e[16] = (l) => q.value = l),
|
|
397
|
+
options: _.value
|
|
398
|
+
}, {
|
|
399
|
+
default: r(() => [
|
|
400
|
+
i(t(Re), {
|
|
401
|
+
label: g.value.name,
|
|
402
|
+
disabled: ""
|
|
403
|
+
}, null, 8, ["label"]),
|
|
404
|
+
i(t(We)),
|
|
405
|
+
g.value.level === 2 ? (f(), B("div", Oe, [
|
|
406
|
+
i(t(Ue), {
|
|
407
|
+
modelValue: Q.value,
|
|
408
|
+
"onUpdate:modelValue": e[5] || (e[5] = (l) => Q.value = l),
|
|
409
|
+
size: "small"
|
|
410
|
+
}, {
|
|
411
|
+
default: r(() => [
|
|
412
|
+
i(t(oe), {
|
|
413
|
+
label: t(d)("workSchedule.Days5"),
|
|
414
|
+
value: "5"
|
|
415
|
+
}, null, 8, ["label"]),
|
|
416
|
+
i(t(oe), {
|
|
417
|
+
label: "2 Х 2",
|
|
418
|
+
value: "2x2"
|
|
419
|
+
}),
|
|
420
|
+
i(t(oe), {
|
|
421
|
+
label: "2 Х 5",
|
|
422
|
+
value: "2x5"
|
|
423
|
+
})
|
|
424
|
+
]),
|
|
425
|
+
_: 1
|
|
426
|
+
}, 8, ["modelValue"]),
|
|
427
|
+
e[18] || (e[18] = k("br", null, null, -1)),
|
|
428
|
+
k("span", null, m(t(d)("workSchedule.fromDate")) + ":", 1),
|
|
429
|
+
i(t(j), {
|
|
430
|
+
modelValue: Y.value,
|
|
431
|
+
"onUpdate:modelValue": e[6] || (e[6] = (l) => Y.value = l),
|
|
432
|
+
step: 1,
|
|
433
|
+
min: 1,
|
|
434
|
+
max: u.value.length
|
|
435
|
+
}, null, 8, ["modelValue", "max"]),
|
|
436
|
+
k("span", null, m(t(d)("workSchedule.with")) + ":", 1),
|
|
437
|
+
i(t(j), {
|
|
438
|
+
modelValue: x.value,
|
|
439
|
+
"onUpdate:modelValue": e[7] || (e[7] = (l) => x.value = l),
|
|
440
|
+
step: 1,
|
|
441
|
+
min: 8,
|
|
442
|
+
max: 11
|
|
443
|
+
}, null, 8, ["modelValue"]),
|
|
444
|
+
k("span", null, m(t(d)("workSchedule.duration")) + ":", 1),
|
|
445
|
+
i(t(j), {
|
|
446
|
+
modelValue: w.value,
|
|
447
|
+
"onUpdate:modelValue": e[8] || (e[8] = (l) => w.value = l),
|
|
448
|
+
step: 1,
|
|
449
|
+
min: 4,
|
|
450
|
+
max: 12
|
|
451
|
+
}, null, 8, ["modelValue"]),
|
|
452
|
+
i(t(A), {
|
|
453
|
+
style: { "margin-top": ".5rem" },
|
|
454
|
+
size: "small",
|
|
455
|
+
onClick: e[9] || (e[9] = (l) => fe(g.value.ids))
|
|
456
|
+
}, {
|
|
457
|
+
default: r(() => [
|
|
458
|
+
$(m(t(d)("workSchedule.fillOut")), 1)
|
|
459
|
+
]),
|
|
460
|
+
_: 1
|
|
461
|
+
}),
|
|
462
|
+
i(t(A), {
|
|
463
|
+
style: { "margin-top": ".5rem" },
|
|
464
|
+
size: "small",
|
|
465
|
+
onClick: e[10] || (e[10] = (l) => pe(g.value.ids))
|
|
466
|
+
}, {
|
|
467
|
+
default: r(() => [
|
|
468
|
+
$(m(t(d)("workSchedule.clearRow")), 1)
|
|
469
|
+
]),
|
|
470
|
+
_: 1
|
|
471
|
+
})
|
|
472
|
+
])) : (f(), B("div", Le, [
|
|
473
|
+
k("div", null, m(re(g.value.day, g.value.ids)), 1),
|
|
474
|
+
e[19] || (e[19] = k("br", null, null, -1)),
|
|
475
|
+
k("span", null, m(t(d)("workSchedule.with")) + ":", 1),
|
|
476
|
+
i(t(j), {
|
|
477
|
+
modelValue: x.value,
|
|
478
|
+
"onUpdate:modelValue": e[11] || (e[11] = (l) => x.value = l),
|
|
479
|
+
step: 1,
|
|
480
|
+
min: 8,
|
|
481
|
+
max: 11,
|
|
482
|
+
onChange: e[12] || (e[12] = (l) => se(g.value.day, g.value.ids))
|
|
483
|
+
}, null, 8, ["modelValue"]),
|
|
484
|
+
k("span", null, m(t(d)("workSchedule.duration")) + ":", 1),
|
|
485
|
+
i(t(j), {
|
|
486
|
+
modelValue: w.value,
|
|
487
|
+
"onUpdate:modelValue": e[13] || (e[13] = (l) => w.value = l),
|
|
488
|
+
step: 1,
|
|
489
|
+
min: 4,
|
|
490
|
+
max: 12,
|
|
491
|
+
onChange: e[14] || (e[14] = (l) => se(g.value.day, g.value.ids))
|
|
492
|
+
}, null, 8, ["modelValue"]),
|
|
493
|
+
i(t(A), {
|
|
494
|
+
style: { "margin-top": ".5rem" },
|
|
495
|
+
size: "small",
|
|
496
|
+
onClick: e[15] || (e[15] = (l) => we(g.value.day, g.value.ids))
|
|
497
|
+
}, {
|
|
498
|
+
default: r(() => [
|
|
499
|
+
$(m(t(d)("workSchedule.delete")), 1)
|
|
500
|
+
]),
|
|
501
|
+
_: 1
|
|
502
|
+
})
|
|
503
|
+
]))
|
|
504
|
+
]),
|
|
505
|
+
_: 1
|
|
506
|
+
}, 8, ["show", "options"])
|
|
507
|
+
]);
|
|
508
|
+
};
|
|
509
|
+
}
|
|
510
|
+
};
|
|
511
|
+
export {
|
|
512
|
+
_e as default
|
|
513
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.wrapper[data-v-5b3d4c74]{display:flex}.wrapper .month_year[data-v-5b3d4c74]{display:flex;justify-content:space-around;align-items:center}.wrapper .month_year span:not(.text) button[data-v-5b3d4c74]{font-size:1.3em}.wrapper>div[data-v-5b3d4c74]:not(:first-child){margin-left:2rem}.wrapper button[data-v-5b3d4c74]{height:30px;text-align:center;line-height:30px;cursor:pointer;background:none;border:none;border-radius:.2rem;transition:all .3s ease}.wrapper button[data-v-5b3d4c74]:hover:not(.disabled):not(.active){color:var(--el-color-success)}.wrapper .week[data-v-5b3d4c74]{border-bottom:1px solid var(--el-color-info);margin-bottom:.5rem}.wrapper .month[data-v-5b3d4c74],.wrapper .week[data-v-5b3d4c74]{width:250px;display:grid;grid-template-columns:1fr 1fr 1fr 1fr 1fr 1fr 1fr;gap:.2rem}.wrapper .month>button[data-v-5b3d4c74],.wrapper .week>button[data-v-5b3d4c74]{width:30px}.wrapper .month>button.disabled[data-v-5b3d4c74],.wrapper .week>button.disabled[data-v-5b3d4c74]{color:var(--el-color-info);cursor:not-allowed}.wrapper .month>button.preholiday[data-v-5b3d4c74],.wrapper .week>button.preholiday[data-v-5b3d4c74]{background-color:#ffe78070}.wrapper .month>button.weekend[data-v-5b3d4c74],.wrapper .week>button.weekend[data-v-5b3d4c74]{background-color:#ff808070}.wrapper .month>button.select[data-v-5b3d4c74],.wrapper .week>button.select[data-v-5b3d4c74]{background-color:#007bff70}.wrapper .month>button.holiday[data-v-5b3d4c74],.wrapper .week>button.holiday[data-v-5b3d4c74]{background-color:red}.wrapper .month>button.nowork[data-v-5b3d4c74],.wrapper .week>button.nowork[data-v-5b3d4c74]{background-color:red}.wrapper .month>button.active[data-v-5b3d4c74],.wrapper .week>button.active[data-v-5b3d4c74]{background-color:#007bff}.noBorder .el-input__wrapper{box-shadow:none}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const i=require("js-cookie");function u(t,e){if(arguments.length===0||!t)return null;const o=e||"{Y}-{m}-{d} {G}:{i}:{s}";let r;typeof t=="object"?r=t:(typeof t=="string"&&(/^[0-9]+$/.test(t)?t=parseInt(t):t=t.replace(new RegExp(/-/gm),"/")),typeof t=="number"&&t.toString().length===10&&(t=t*1e3),r=new Date(t));const a="ru-RU",l={Y:r.getFullYear(),m:(r.getMonth()+1).toString().padStart(2,"0"),d:r.getDate(),dd:r.getDate().toString().padStart(2,"0"),G:r.getHours(),H:r.getHours().toString().padStart(2,"0"),i:r.getMinutes().toString().padStart(2,"0"),s:r.getSeconds().toString().padStart(2,"0"),D:new Intl.DateTimeFormat(a,{weekday:"short"}).format(r),F:new Intl.DateTimeFormat(a,{month:"long"}).format(r),M:new Intl.DateTimeFormat(a,{month:"short"}).format(r)};return o.replace(/{(dd|[YmdGHisDFM])+}/g,(m,c)=>l[c])}function f(t,e){let r=t.replace(/[0-9]/g,"").split("").reverse().map(a=>a.charCodeAt(0));return s(r,e,0),r.map(a=>String.fromCharCode(a)).reverse().join("")}function p(t){return t.split(" ",3).map((e,o)=>o!==0?e.slice(0,1)+".":e).join(" ")}let n={};async function g(){if(n!=null&&n.holidays)return n;try{const t=await fetch("https://cp.avanta-telecom.ru/api/v2/calendar/getHoliday",{method:"GET",mode:"cors",cache:"default",credentials:"same-origin",headers:{"Content-Type":"application/json",Accept:"text/html","X-Token":h(),"Cache-Control":"no-cache"},redirect:"follow",referrerPolicy:"no-referrer"});if(!t.ok)throw new Error(`HTTP error! Status: ${t.status}`);const e=await t.json();return e.result.holiday=["2024-01-01","2024-01-02","2024-01-03","2024-01-04","2024-01-05","2024-01-06","2024-01-07","2024-01-08","2024-02-23","2024-03-08","2024-05-01","2024-05-09","2024-06-12","2024-11-04","2025-01-01","2025-01-02","2025-01-03","2025-01-04","2025-01-05","2025-01-06","2025-01-07","2025-01-08","2025-02-23","2025-03-08","2025-05-01","2025-05-09","2025-06-12","2025-11-04"],n=e.result,n}catch(t){throw console.error("Ошибка загрузки данных о праздниках:",t),t}}function s(t,e,o){if(typeof e!="number"||e<1)return!0;if(e=e-1,(typeof t[o]!="number"||t[o]<65)&&(t[o]=65),t[o]+e<=90)t[o]=t[o]+e;else{let r=Math.floor((t[o]-65+e)/26);t[o]=(t[o]-65+e)%26+65,s(t,r,o+1)}}const h=()=>i.get("X-Token")||!1;exports.byInitials=p;exports.cellsDynamically=f;exports.holidays=g;exports.parseTime=u;
|