@studio-west/employees 0.5.22 → 0.5.24
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 +3 -3
- package/dist/WorkTable.js +101 -99
- package/package.json +1 -1
package/dist/WorkTable.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),re=require("file-saver"),ie=require("exceljs"),v=require("./index-CmFQ6bqG.cjs"),de=require("vue-i18n"),i=require("element-plus"),W=require("@imengyu/vue3-context-menu");function se(w){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(w){for(const C in w)if(C!=="default"){const f=Object.getOwnPropertyDescriptor(w,C);Object.defineProperty(r,C,f.get?f:{enumerable:!0,get:()=>w[C]})}}return r.default=w,Object.freeze(r)}const ce=se(ie),ve={class:"work"},me={class:"nav"},ge={style:{height:"100px",width:"100%",display:"inline-block"}},he=["innerHTML"],fe={key:0,class:"controls-container",style:{"margin-top":".5rem"}},pe={key:0,style:{padding:"0.5em 1.5em"}},ye={key:1,style:{padding:"0.5em 1.5em"}},we={__name:"WorkTable",props:{checkEdit:{type:Boolean,default:()=>!0},odata:Object,workSchedule:Object,fullName:{type:String,default:"Вы"}},setup(w){const{t:r,d:C}=de.useI18n(),f=w,
|
|
2
|
-
`+(m-1),l.getColumn(m).width=6,l.getColumn(m).alignment=t,l.getCell(4,m).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 m of n.value){let
|
|
3
|
-
`+t.day.toString()},{default:e.withCtx(s=>[e.createElementVNode("div",{style:{height:"100px",width:"100%",display:"inline-block"},innerHTML:Z(t.day,s.$index)||" "},null,8,he)]),_:2},1032,["class-name","label"]))),128))]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.onSchedule"),align:"center"},{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")} ( ${
|
|
1
|
+
"use strict";const e=require("vue"),re=require("file-saver"),ie=require("exceljs"),v=require("./index-CmFQ6bqG.cjs"),de=require("vue-i18n"),i=require("element-plus"),W=require("@imengyu/vue3-context-menu");function se(w){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(w){for(const C in w)if(C!=="default"){const f=Object.getOwnPropertyDescriptor(w,C);Object.defineProperty(r,C,f.get?f:{enumerable:!0,get:()=>w[C]})}}return r.default=w,Object.freeze(r)}const ce=se(ie),ve={class:"work"},me={class:"nav"},ge={style:{height:"100px",width:"100%",display:"inline-block"}},he=["innerHTML"],fe={key:0,class:"controls-container",style:{"margin-top":".5rem"}},pe={key:0,style:{padding:"0.5em 1.5em"}},ye={key:1,style:{padding:"0.5em 1.5em"}},we={__name:"WorkTable",props:{checkEdit:{type:Boolean,default:()=>!0},odata:Object,workSchedule:Object,fullName:{type:String,default:"Вы"}},setup(w){const{t:r,d:C}=de.useI18n(),f=w,T=e.ref(!1),n=e.ref([]),Y=e.ref(new Date().getMonth()+1),H=e.ref(!1),y=e.ref(new Date(new Date().getFullYear(),new Date().getMonth(),1)),u=e.ref([]),M=e.ref(0),x=e.ref(9),p=e.ref(8),A=e.ref(!1),L=e.ref(!0),b=e.ref(!1),R=e.ref("5"),E=e.ref(1),V=e.ref(""),j=e.ref([]),S=e.ref([]),I=e.ref([]),c=e.ref({name:"Имя",length:0,code:""}),z=e.ref(!1),q=e.ref({zIndex:30,minWidth:220,x:500,y:200}),G=e.ref({}),$=e.ref("100%");e.watch(V,async(a,l)=>{a!==l&&(S.value=[],A.value=!1,f.odata.personal.forEach(o=>{o.divisionName===a&&(S.value.some(d=>(d==null?void 0:d.activeText)===o.roleName)||S.value.push({val:!0,activeText:o.roleName}))}),O())}),e.watch(Y,async a=>{let l=new Date().getMonth(),o=a===null?l:a-1;o=l-1<=o?o:o+12,y.value=new Date(new Date().getFullYear(),o,1),J()}),e.watch(H,a=>{a&&_()});const X=(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,q.value.y=d.clientY,q.value.x=d.clientX,l.level===2&&l.no===0&&f.checkEdit&&(c.value.name=r("workSchedule.autocomplete"),z.value=!0),l.level===3&&o.cellIndex-l.no===1&&f.checkEdit&&(N(o.cellIndex,a.ids),c.value.name=r("workSchedule.modeSelection"),z.value=!0)},_=()=>{f.workSchedule.getUsersYear({code:I.value,year:new Date(y.value).getFullYear()}).then(a=>{a.forEach(l=>{console.log(l)})})},J=()=>{const a=G.value,l=new Date(y.value),o=new Date(l.getFullYear(),l.getMonth()+1,0).getDate();let d=[],t=0;for(let s=1;s<=o;s++){const h=v.parseTime(l.setDate(s),"{Y}-{m}-{dd}");t+=a.nowork.includes(h)||a.holidays.includes(h)?0:a.preholidays.includes(h)?7:8;const g=a.nowork.includes(h)?"nowork":a.holidays.includes(h)?"holiday":a.preholidays.includes(h)?"preholiday":"";d.push({day:s,holidays:g,weekday:C(new Date(l.getFullYear(),l.getMonth(),s),"day")})}M.value=t,u.value=d,f.odata.getPersonal({}).then(s=>{var h;V.value.length===0&&(V.value=(h=s.find(g=>g.employeeName===f.fullName))==null?void 0:h.divisionName),s.forEach(g=>{j.value.some(k=>(k==null?void 0:k.value)===g.divisionName)||j.value.push({value:g.divisionName,label:g.divisionName,key:g.divisionName}),g.divisionName===V.value&&!S.value.some(k=>(k==null?void 0:k.activeText)===g.roleName)&&S.value.push({val:!0,activeText:g.roleName})}),O(),L.value=!1})},Z=(a,l)=>{var s,h,g;const o=new Date(y.value),d=`${o.getFullYear()}-${(o.getMonth()+1).toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}`,t=(s=n.value[l])==null?void 0:s.days.findIndex(k=>k.day===d);return l===-1||t===-1?"":((h=n.value[l].days[t])==null?void 0:h.tips)+"<br>"+((g=n.value[l].days[t])==null?void 0:g.time)},O=()=>{n.value=[],I.value=[],f.odata.personal.forEach(a=>{if(a.divisionName===V.value&&S.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})}}),ee(),b.value=!1},ee=()=>{f.workSchedule.getWorkSchedule({code:I.value,date:v.parseTime(new Date(y.value),"{Y}-{m}-{dd}")}).then(a=>{a.forEach((l,o)=>{l!==null&&(n.value[o].days=l.data.days,n.value[o].id=l.id)}),D()})},D=()=>{n.value.forEach(a=>{a.contHour=a.days.reduce((l,o)=>l+o.time,0)})},le=a=>{n.value[a].days=[],D()},te=a=>{switch(R.value){case"5":for(let l=E.value;l<=u.value.length;l++)u.value[l-1].holidays===""&&N(l,a,!0),u.value[l-1].holidays==="preholiday"&&(p.value-=1,N(l,a,!0),p.value+=1);break;case"2x2":for(let l=E.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=E.value;l<=u.value.length;l+=7)for(let o=l;o<l+5&&o<=u.value.length;o++)u.value[o-1].holidays==="preholiday"?(p.value-=1,N(o,a,!0),p.value+=1):N(o,a,!0);break}},N=(a,l,o=!1)=>{const{date:d,ind:t}=F(a,l);t===-1?(n.value[l].days.push({day:d,time:p.value,tips:`(${x.value}:00 - ${x.value+p.value+1}:00)`}),D()):o||(p.value=n.value[l].days[t].time,x.value=parseInt(n.value[l].days[t].tips.slice(1,-12)))},ae=(a,l)=>{const{ind:o}=F(a,l);n.value[l].days.splice(o,1),D(),document.querySelector(".app-main").click()},K=(a,l)=>{const{date:o,ind:d}=F(a,l);n.value[l].days[d]={day:o,time:p.value,tips:`(${x.value}:00 - ${x.value+p.value+1}:00)`},D()},F=(a,l)=>{var t;const o=v.parseTime(new Date(y.value).setDate(a),"{Y}-{m}-{dd}"),d=(t=n.value[l])==null?void 0:t.days.findIndex(s=>s.day===o);return{date:o,ind:d}},ne=async()=>{var Q;T.value=!0;const a=new ce.Workbook,l=a.addWorksheet(C(y.value,"month"),{pageSetup:{paperSize:9,orientation:"landscape",fitToPage:!0}}),o={vertical:"middle",horizontal:"center"},d={top:{style:"thin"},left:{style:"thin"},bottom:{style:"thin"},right:{style:"thin"}},t={vertical:"middle",horizontal:"center",wrapText:!0};l.mergeCells(`A1:${v.cellsDynamically("A1",u.value.length+5)}1`),l.mergeCells(`A2:${v.cellsDynamically("A2",u.value.length+5)}2`),l.mergeCells("A3:A4"),l.mergeCells(`B3:${v.cellsDynamically("B3",u.value.length)}3`),l.mergeCells(`${v.cellsDynamically("B3",u.value.length+1)}3:${v.cellsDynamically("B3",u.value.length+2)}3`),l.mergeCells(`${v.cellsDynamically("B3",u.value.length+3)}3:${v.cellsDynamically("B4",u.value.length+3)}4`),l.mergeCells(`${v.cellsDynamically("B3",u.value.length+4)}3:${v.cellsDynamically("B4",u.value.length+4)}4`),l.getCell("A1").value=r("workSchedule.firm"),l.getCell("A2").value=r("workSchedule.title",{name:V.value})+C(y.value,"month")+` ${new Date(y.value).getFullYear()}`,l.getCell("A3").value=r("workSchedule.month"),l.getCell("B3").value=r("workSchedule.numbersMonth"),l.getCell(3,u.value.length+2).value=r("workSchedule.onSchedule"),l.getCell(3,u.value.length+4).value=r("workSchedule.acquainted"),l.getCell(3,u.value.length+5).value=r("workSchedule.date"),l.getCell(4,u.value.length+2).value=r("workSchedule.days"),l.getCell(4,u.value.length+3).value=`${r("workSchedule.hours")} (${M.value})`;for(let m=2;m<=u.value.length+1;m++)l.getCell(4,m).value=u.value[m-2].weekday+`
|
|
2
|
+
`+(m-1),l.getColumn(m).width=6,l.getColumn(m).alignment=t,l.getCell(4,m).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 m of n.value){let U=[m.name];for(let B=1;B<=u.value.length;B++){const{ind:P}=F(B,s);P!==-1?U[B]=`${m.days[P].time} ${m.days[P].tips}`:U[B]=" "}U.push(((Q=m.days)==null?void 0:Q.length)||" ",m.contHour||0);const ue=l.addRow(U);ue.border=d,s++}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=r("workSchedule.byInitials"),l.getCell(`Q${n.value.length+6}`).value=r("workSchedule.supervisorHR"),l.getCell(`B${n.value.length+8}`).value=r("workSchedule.compiled")+":",l.getCell(`S${n.value.length+8}`).value=r("workSchedule.approved")+":",l.getCell(`M${n.value.length+8}`).value=v.byInitials(f.fullName),l.getCell(`AD${n.value.length+8}`).value=v.byInitials(h),l.getCell(`Z${n.value.length+9}`).value=r("workSchedule.printPlace"),l.getCell(`A${n.value.length+6}`).alignment={vertical:"middle",horizontal:"right"},l.getCell(`Q${n.value.length+6}`).alignment={vertical:"middle",horizontal:"right"},l.getCell(`B${n.value.length+8}`).alignment={vertical:"middle",horizontal:"right"},l.getCell(`F${n.value.length+8}`).alignment={vertical:"middle",horizontal:"right"},l.getCell(`M${n.value.length+8}`).alignment={vertical:"middle",horizontal:"left"},l.getCell(`AD${n.value.length+8}`).alignment={vertical:"middle",horizontal:"left"},l.getCell(`Z${n.value.length+9}`).alignment=o,l.getCell(`F${n.value.length+8}`).border={bottom:{style:"thin"}},l.getCell(`W${n.value.length+8}`).border={bottom:{style:"thin"}};const g="export_"+v.parseTime(Date.now(),"{dd}.{m}.{Y}")+".xlsx",k=await a.xlsx.writeBuffer();re.saveAs(new Blob([k]),g),T.value=!1},oe=async()=>{A.value||f.workSchedule.addWorkSchedule({data:n.value,date:v.parseTime(new Date(y.value),"{Y}-{m}-{dd}")}).then(a=>A.value=a)};return v.holidays().then(a=>{G.value=a,J()}),(a,l)=>{const o=e.resolveComponent("el-date-picker"),d=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",ve,[e.createElementVNode("div",me,[w.checkEdit?(e.openBlock(),e.createBlock(e.unref(i.ElSelect),{key:0,modelValue:V.value,"onUpdate:modelValue":l[0]||(l[0]=t=>V.value=t),placeholder:"Select",style:{width:"240px"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(j.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),w.checkEdit?(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:1,plain:"",onClick:l[1]||(l[1]=t=>b.value=!0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.jobTitle")),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(o,{modelValue:Y.value,"onUpdate:modelValue":l[2]||(l[2]=t=>Y.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:$.value,"onUpdate:modelValue":l[3]||(l[3]=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:H.value,"onUpdate:modelValue":l[4]||(l[4]=t=>H.value=t),"active-text":"Отпуска","active-value":!0,"inactive-value":!1},null,8,["modelValue"])]),e.createVNode(e.unref(i.ElSkeleton),{style:{width:"100%"},loading:L.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":$.value,size:"small",align:"center",onCellClick:X,"empty-text":e.unref(r)("workSchedule.emptyText")},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.title",{name:V.value})+e.unref(C)(y.value,"month")+` ${new Date(y.value).getFullYear()}`,align:"center",height:"34"},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.month"),width:"180",align:"center",fixed:$.value!=="100%"},{default:e.withCtx(t=>[e.createElementVNode("div",ge,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:"45","class-name":t.holidays,align:"center",label:t.weekday+`
|
|
3
|
+
`+t.day.toString()},{default:e.withCtx(s=>[e.createElementVNode("div",{style:{height:"100px",width:"100%",display:"inline-block"},innerHTML:Z(t.day,s.$index)||" "},null,8,he)]),_:2},1032,["class-name","label"]))),128))]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.onSchedule"),align:"center",fixed:$.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")} ( ${M.value} )`,align:"center"},{default:e.withCtx(t=>[e.createElementVNode("div",{style:e.normalizeStyle(`color: ${M.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"]),w.checkEdit?(e.openBlock(),e.createElementBlock("div",fe,[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.chartsFilled"))+": ",1),A.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:0,type:"primary",onClick:oe},{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(w.fullName),1)])):e.createCommentVNode("",!0),e.withDirectives((e.openBlock(),e.createBlock(e.unref(i.ElButton),{disabled:T.value,plain:"",onClick:ne,style:{"margin-top":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.exportExcel")),1)]),_:1},8,["disabled"])),[[d,T.value]]),e.createVNode(e.unref(i.ElDialog),{title:e.unref(r)("workSchedule.jobTitle"),modelValue:b.value,"onUpdate:modelValue":l[6]||(l[6]=t=>b.value=t),width:"400px"},{footer:e.withCtx(()=>[e.createVNode(e.unref(i.ElButton),{onClick:l[5]||(l[5]=t=>b.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:O},{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:S.value,autocomplete:"on"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.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(W.ContextMenu),{show:z.value,"onUpdate:show":l[18]||(l[18]=t=>z.value=t),options:q.value},{default:e.withCtx(()=>[e.createVNode(e.unref(W.ContextMenuItem),{label:c.value.name,disabled:""},null,8,["label"]),e.createVNode(e.unref(W.ContextMenuSeparator)),c.value.level===2?(e.openBlock(),e.createElementBlock("div",pe,[e.createVNode(e.unref(i.ElRadioGroup),{modelValue:R.value,"onUpdate:modelValue":l[7]||(l[7]=t=>R.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:E.value,"onUpdate:modelValue":l[8]||(l[8]=t=>E.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:x.value,"onUpdate:modelValue":l[9]||(l[9]=t=>x.value=t),step:1,min:8,max:11},null,8,["modelValue"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.duration"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:p.value,"onUpdate:modelValue":l[10]||(l[10]=t=>p.value=t),step:1,min:4,max:12},null,8,["modelValue"]),e.createVNode(e.unref(i.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:l[11]||(l[11]=t=>te(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=>le(c.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.clearRow")),1)]),_:1})])):(e.openBlock(),e.createElementBlock("div",ye,[e.createElementVNode("div",null,e.toDisplayString(Z(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:x.value,"onUpdate:modelValue":l[13]||(l[13]=t=>x.value=t),step:1,min:8,max:11,onChange:l[14]||(l[14]=t=>K(c.value.day,c.value.ids))},null,8,["modelValue"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.duration"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:p.value,"onUpdate:modelValue":l[15]||(l[15]=t=>p.value=t),step:1,min:4,max:12,onChange:l[16]||(l[16]=t=>K(c.value.day,c.value.ids))},null,8,["modelValue"]),e.createVNode(e.unref(i.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:l[17]||(l[17]=t=>ae(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=we;
|
package/dist/WorkTable.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ref as s, watch as oe, resolveComponent as Ve, resolveDirective as De, createElementBlock as A, openBlock as f, createElementVNode as w, createVNode as i, createCommentVNode as
|
|
1
|
+
import { ref as s, watch as oe, resolveComponent as Ve, resolveDirective as De, createElementBlock as A, openBlock as f, createElementVNode as w, createVNode as i, createCommentVNode as Q, withDirectives as Ee, createBlock as B, unref as a, withCtx as v, Fragment as ue, renderList as de, createTextVNode as b, toDisplayString as h, normalizeStyle as Ne } from "vue";
|
|
2
2
|
import { saveAs as Me } from "file-saver";
|
|
3
3
|
import * as Ae from "exceljs";
|
|
4
|
-
import { p as
|
|
4
|
+
import { p as R, b as ie, h as Be, c as D } from "./index-DIjJDdmP.js";
|
|
5
5
|
import { useI18n as Te } from "vue-i18n";
|
|
6
|
-
import { ElSelect as ze, ElOption as Fe, ElButton as N, ElSwitch as re, ElSkeleton as Ue, ElTable as Ye, ElTableColumn as T, ElSkeletonItem as
|
|
6
|
+
import { ElSelect as ze, ElOption as Fe, ElButton as N, ElSwitch as re, ElSkeleton as Ue, ElTable as Ye, ElTableColumn as T, ElSkeletonItem as W, ElDialog as Ie, ElForm as He, ElFormItem as Re, ElRadioGroup as We, ElRadioButton as ve, ElSlider as P } from "element-plus";
|
|
7
7
|
import { ContextMenu as Pe, ContextMenuItem as je, ContextMenuSeparator as Le } from "@imengyu/vue3-context-menu";
|
|
8
8
|
const Oe = { class: "work" }, Ge = { class: "nav" }, Ze = { style: { height: "100px", width: "100%", display: "inline-block" } }, qe = ["innerHTML"], Je = {
|
|
9
9
|
key: 0,
|
|
@@ -24,7 +24,7 @@ const Oe = { class: "work" }, Ge = { class: "nav" }, Ze = { style: { height: "10
|
|
|
24
24
|
fullName: { type: String, default: "Вы" }
|
|
25
25
|
},
|
|
26
26
|
setup(z) {
|
|
27
|
-
const { t: d, d:
|
|
27
|
+
const { t: d, d: j } = Te(), x = z, L = s(!1), n = s([
|
|
28
28
|
// { name: 'Иванов П.М. (Ведущий работник месяца)',
|
|
29
29
|
// days: [], // {day: "2024-11-01", tips: '(9:00 - 18:00)', time: 8 }
|
|
30
30
|
// contHour: 0,
|
|
@@ -37,26 +37,26 @@ const Oe = { class: "work" }, Ge = { class: "nav" }, Ze = { style: { height: "10
|
|
|
37
37
|
// code: '0000-00052'
|
|
38
38
|
// ids: 1
|
|
39
39
|
// }
|
|
40
|
-
]),
|
|
40
|
+
]), X = s((/* @__PURE__ */ new Date()).getMonth() + 1), _ = s(!1), C = s(new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1)), u = s([]), O = s(0), S = s(9), k = s(8), G = s(!1), se = s(!0), F = s(!1), ee = s("5"), U = s(1), V = s(""), le = s([]), E = s([]), Z = s([]), m = s({ name: "Имя", length: 0, code: "" }), q = s(!1), te = s({
|
|
41
41
|
zIndex: 30,
|
|
42
42
|
minWidth: 220,
|
|
43
43
|
x: 500,
|
|
44
44
|
y: 200
|
|
45
|
-
}), ge = s({}),
|
|
45
|
+
}), ge = s({}), Y = s("100%");
|
|
46
46
|
oe(V, async (t, e) => {
|
|
47
|
-
t !== e && (E.value = [],
|
|
47
|
+
t !== e && (E.value = [], G.value = !1, x.odata.personal.forEach((o) => {
|
|
48
48
|
o.divisionName === t && (E.value.some((r) => (r == null ? void 0 : r.activeText) === o.roleName) || E.value.push({ val: !0, activeText: o.roleName }));
|
|
49
49
|
}), ae());
|
|
50
|
-
}), oe(
|
|
50
|
+
}), oe(X, async (t) => {
|
|
51
51
|
let e = (/* @__PURE__ */ new Date()).getMonth(), o = t === null ? e : t - 1;
|
|
52
52
|
o = e - 1 <= o ? o : o + 12, C.value = new Date((/* @__PURE__ */ new Date()).getFullYear(), o, 1), me();
|
|
53
|
-
}), oe(
|
|
53
|
+
}), oe(_, (t) => {
|
|
54
54
|
t && fe();
|
|
55
55
|
});
|
|
56
56
|
const ye = (t, e, o, r) => {
|
|
57
|
-
m.value.ids = t.ids, m.value.key = t.key, m.value.add = t.days.length > 0 && t.days[t.days.length - 1].cont, m.value.level = e.level, m.value.day = o.cellIndex,
|
|
57
|
+
m.value.ids = t.ids, m.value.key = t.key, m.value.add = t.days.length > 0 && t.days[t.days.length - 1].cont, m.value.level = e.level, m.value.day = o.cellIndex, te.value.y = r.clientY, te.value.x = r.clientX, e.level === 2 && e.no === 0 && x.checkEdit && (m.value.name = d("workSchedule.autocomplete"), q.value = !0), e.level === 3 && o.cellIndex - e.no === 1 && x.checkEdit && (M(o.cellIndex, t.ids), m.value.name = d("workSchedule.modeSelection"), q.value = !0);
|
|
58
58
|
}, fe = () => {
|
|
59
|
-
|
|
59
|
+
x.workSchedule.getUsersYear({ code: Z.value, year: new Date(C.value).getFullYear() }).then((t) => {
|
|
60
60
|
t.forEach((e) => {
|
|
61
61
|
console.log(e);
|
|
62
62
|
});
|
|
@@ -65,44 +65,44 @@ const Oe = { class: "work" }, Ge = { class: "nav" }, Ze = { style: { height: "10
|
|
|
65
65
|
const t = ge.value, e = new Date(C.value), o = new Date(e.getFullYear(), e.getMonth() + 1, 0).getDate();
|
|
66
66
|
let r = [], l = 0;
|
|
67
67
|
for (let g = 1; g <= o; g++) {
|
|
68
|
-
const y =
|
|
68
|
+
const y = R(e.setDate(g), "{Y}-{m}-{dd}");
|
|
69
69
|
l += t.nowork.includes(y) || t.holidays.includes(y) ? 0 : t.preholidays.includes(y) ? 7 : 8;
|
|
70
70
|
const p = t.nowork.includes(y) ? "nowork" : t.holidays.includes(y) ? "holiday" : t.preholidays.includes(y) ? "preholiday" : "";
|
|
71
|
-
r.push({ day: g, holidays: p, weekday:
|
|
71
|
+
r.push({ day: g, holidays: p, weekday: j(new Date(e.getFullYear(), e.getMonth(), g), "day") });
|
|
72
72
|
}
|
|
73
|
-
|
|
73
|
+
O.value = l, u.value = r, x.odata.getPersonal({}).then((g) => {
|
|
74
74
|
var y;
|
|
75
|
-
V.value.length === 0 && (V.value = (y = g.find((p) => p.employeeName ===
|
|
76
|
-
|
|
75
|
+
V.value.length === 0 && (V.value = (y = g.find((p) => p.employeeName === x.fullName)) == null ? void 0 : y.divisionName), g.forEach((p) => {
|
|
76
|
+
le.value.some(($) => ($ == null ? void 0 : $.value) === p.divisionName) || le.value.push({ value: p.divisionName, label: p.divisionName, key: p.divisionName }), p.divisionName === V.value && !E.value.some(($) => ($ == null ? void 0 : $.activeText) === p.roleName) && E.value.push({ val: !0, activeText: p.roleName });
|
|
77
77
|
}), ae(), se.value = !1;
|
|
78
78
|
});
|
|
79
79
|
}, he = (t, e) => {
|
|
80
80
|
var g, y, p;
|
|
81
|
-
const o = new Date(C.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((
|
|
81
|
+
const o = new Date(C.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(($) => $.day === r);
|
|
82
82
|
return e === -1 || l === -1 ? "" : ((y = n.value[e].days[l]) == null ? void 0 : y.tips) + "<br>" + ((p = n.value[e].days[l]) == null ? void 0 : p.time);
|
|
83
83
|
}, ae = () => {
|
|
84
|
-
n.value = [],
|
|
84
|
+
n.value = [], Z.value = [], x.odata.personal.forEach((t) => {
|
|
85
85
|
if (t.divisionName === V.value && E.value.some((e) => e.val && e.activeText === t.roleName)) {
|
|
86
86
|
let e = ie(t.employeeName);
|
|
87
|
-
|
|
87
|
+
Z.value.push(t.employeeKey), n.value.push({ name: e + " (" + t.roleName + ")", days: [], contHour: 0, code: t.employeeKey, id: !1, ids: n.value.length });
|
|
88
88
|
}
|
|
89
89
|
}), we(), F.value = !1;
|
|
90
90
|
}, we = () => {
|
|
91
|
-
|
|
91
|
+
x.workSchedule.getWorkSchedule({ code: Z.value, date: R(new Date(C.value), "{Y}-{m}-{dd}") }).then(
|
|
92
92
|
(t) => {
|
|
93
93
|
t.forEach((e, o) => {
|
|
94
94
|
e !== null && (n.value[o].days = e.data.days, n.value[o].id = e.id);
|
|
95
|
-
}),
|
|
95
|
+
}), I();
|
|
96
96
|
}
|
|
97
97
|
);
|
|
98
|
-
},
|
|
98
|
+
}, I = () => {
|
|
99
99
|
n.value.forEach((t) => {
|
|
100
100
|
t.contHour = t.days.reduce((e, o) => e + o.time, 0);
|
|
101
101
|
});
|
|
102
102
|
}, ke = (t) => {
|
|
103
|
-
n.value[t].days = [],
|
|
103
|
+
n.value[t].days = [], I();
|
|
104
104
|
}, Ce = (t) => {
|
|
105
|
-
switch (
|
|
105
|
+
switch (ee.value) {
|
|
106
106
|
case "5":
|
|
107
107
|
for (let e = U.value; e <= u.value.length; e++)
|
|
108
108
|
u.value[e - 1].holidays === "" && M(e, t, !0), u.value[e - 1].holidays === "preholiday" && (k.value -= 1, M(e, t, !0), k.value += 1);
|
|
@@ -118,54 +118,54 @@ const Oe = { class: "work" }, Ge = { class: "nav" }, Ze = { style: { height: "10
|
|
|
118
118
|
break;
|
|
119
119
|
}
|
|
120
120
|
}, M = (t, e, o = !1) => {
|
|
121
|
-
const { date: r, ind: l } =
|
|
121
|
+
const { date: r, ind: l } = J(t, e);
|
|
122
122
|
l === -1 ? (n.value[e].days.push({
|
|
123
123
|
day: r,
|
|
124
124
|
time: k.value,
|
|
125
125
|
tips: `(${S.value}:00 - ${S.value + k.value + 1}:00)`
|
|
126
|
-
}),
|
|
127
|
-
},
|
|
128
|
-
const { ind: o } =
|
|
129
|
-
n.value[e].days.splice(o, 1),
|
|
126
|
+
}), I()) : o || (k.value = n.value[e].days[l].time, S.value = parseInt(n.value[e].days[l].tips.slice(1, -12)));
|
|
127
|
+
}, xe = (t, e) => {
|
|
128
|
+
const { ind: o } = J(t, e);
|
|
129
|
+
n.value[e].days.splice(o, 1), I(), document.querySelector(".app-main").click();
|
|
130
130
|
}, ce = (t, e) => {
|
|
131
|
-
const { date: o, ind: r } =
|
|
131
|
+
const { date: o, ind: r } = J(t, e);
|
|
132
132
|
n.value[e].days[r] = {
|
|
133
133
|
day: o,
|
|
134
134
|
time: k.value,
|
|
135
135
|
tips: `(${S.value}:00 - ${S.value + k.value + 1}:00)`
|
|
136
|
-
},
|
|
137
|
-
},
|
|
136
|
+
}, I();
|
|
137
|
+
}, J = (t, e) => {
|
|
138
138
|
var l;
|
|
139
|
-
const o =
|
|
139
|
+
const o = R(new Date(C.value).setDate(t), "{Y}-{m}-{dd}"), r = (l = n.value[e]) == null ? void 0 : l.days.findIndex((g) => g.day === o);
|
|
140
140
|
return { date: o, ind: r };
|
|
141
|
-
},
|
|
141
|
+
}, $e = async () => {
|
|
142
142
|
var pe;
|
|
143
|
-
|
|
144
|
-
const t = new Ae.Workbook(), e = t.addWorksheet(
|
|
145
|
-
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 }) +
|
|
143
|
+
L.value = !0;
|
|
144
|
+
const t = new Ae.Workbook(), e = t.addWorksheet(j(C.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 };
|
|
145
|
+
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 }) + j(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")} (${O.value})`;
|
|
146
146
|
for (let c = 2; c <= u.value.length + 1; c++)
|
|
147
147
|
e.getCell(4, c).value = u.value[c - 2].weekday + `
|
|
148
148
|
` + (c - 1), e.getColumn(c).width = 6, e.getColumn(c).alignment = l, e.getCell(4, c).border = r;
|
|
149
149
|
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 = l, 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 = l, e.getColumn(u.value.length + 3).alignment = l, e.getColumn(u.value.length + 4).alignment = o, e.getColumn(u.value.length + 5).alignment = o, e.getCell("A3").border = r, e.getCell("B3").border = r, e.getCell(3, u.value.length + 2).border = r, e.getCell(4, u.value.length + 2).border = r, e.getCell(3, u.value.length + 4).border = r, e.getCell(3, u.value.length + 5).border = r, e.getCell(4, u.value.length + 3).border = r;
|
|
150
150
|
let g = 0;
|
|
151
151
|
for (const c of n.value) {
|
|
152
|
-
let
|
|
153
|
-
for (let
|
|
154
|
-
const { ind: ne } =
|
|
155
|
-
ne !== -1 ?
|
|
152
|
+
let K = [c.name];
|
|
153
|
+
for (let H = 1; H <= u.value.length; H++) {
|
|
154
|
+
const { ind: ne } = J(H, g);
|
|
155
|
+
ne !== -1 ? K[H] = `${c.days[ne].time} ${c.days[ne].tips}` : K[H] = " ";
|
|
156
156
|
}
|
|
157
|
-
|
|
158
|
-
const Se = e.addRow(
|
|
157
|
+
K.push(((pe = c.days) == null ? void 0 : pe.length) || " ", c.contHour || 0);
|
|
158
|
+
const Se = e.addRow(K);
|
|
159
159
|
Se.border = r, g++;
|
|
160
160
|
}
|
|
161
161
|
let y = "Щербина Е. В.";
|
|
162
|
-
|
|
162
|
+
x.odata.personal.forEach((c) => {
|
|
163
163
|
c.roleName === "Начальник отдела правовой и кадровой работы" && (y = c.employeeName);
|
|
164
|
-
}), 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 = ie(
|
|
165
|
-
const p = "export_" +
|
|
166
|
-
Me(new Blob([
|
|
167
|
-
},
|
|
168
|
-
|
|
164
|
+
}), 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 = ie(x.fullName), e.getCell(`AD${n.value.length + 8}`).value = ie(y), 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" } };
|
|
165
|
+
const p = "export_" + R(Date.now(), "{dd}.{m}.{Y}") + ".xlsx", $ = await t.xlsx.writeBuffer();
|
|
166
|
+
Me(new Blob([$]), p), L.value = !1;
|
|
167
|
+
}, be = async () => {
|
|
168
|
+
G.value || x.workSchedule.addWorkSchedule({ data: n.value, date: R(new Date(C.value), "{Y}-{m}-{dd}") }).then((t) => G.value = t);
|
|
169
169
|
};
|
|
170
170
|
return Be().then((t) => {
|
|
171
171
|
ge.value = t, me();
|
|
@@ -181,27 +181,27 @@ const Oe = { class: "work" }, Ge = { class: "nav" }, Ze = { style: { height: "10
|
|
|
181
181
|
style: { width: "240px" }
|
|
182
182
|
}, {
|
|
183
183
|
default: v(() => [
|
|
184
|
-
(f(!0), A(ue, null, de(
|
|
184
|
+
(f(!0), A(ue, null, de(le.value, (l) => (f(), B(a(Fe), {
|
|
185
185
|
key: l.value,
|
|
186
186
|
label: l.label,
|
|
187
187
|
value: l.value
|
|
188
188
|
}, null, 8, ["label", "value"]))), 128))
|
|
189
189
|
]),
|
|
190
190
|
_: 1
|
|
191
|
-
}, 8, ["modelValue"])) :
|
|
191
|
+
}, 8, ["modelValue"])) : Q("", !0),
|
|
192
192
|
z.checkEdit ? (f(), B(a(N), {
|
|
193
193
|
key: 1,
|
|
194
194
|
plain: "",
|
|
195
195
|
onClick: e[1] || (e[1] = (l) => F.value = !0)
|
|
196
196
|
}, {
|
|
197
197
|
default: v(() => [
|
|
198
|
-
|
|
198
|
+
b(h(a(d)("workSchedule.jobTitle")), 1)
|
|
199
199
|
]),
|
|
200
200
|
_: 1
|
|
201
|
-
})) :
|
|
201
|
+
})) : Q("", !0),
|
|
202
202
|
i(o, {
|
|
203
|
-
modelValue:
|
|
204
|
-
"onUpdate:modelValue": e[2] || (e[2] = (l) =>
|
|
203
|
+
modelValue: X.value,
|
|
204
|
+
"onUpdate:modelValue": e[2] || (e[2] = (l) => X.value = l),
|
|
205
205
|
type: "month",
|
|
206
206
|
placeholder: "Выберите месяц",
|
|
207
207
|
format: "MMM",
|
|
@@ -209,15 +209,15 @@ const Oe = { class: "work" }, Ge = { class: "nav" }, Ze = { style: { height: "10
|
|
|
209
209
|
}, null, 8, ["modelValue"]),
|
|
210
210
|
e[19] || (e[19] = w("div", { class: "expander" }, null, -1)),
|
|
211
211
|
i(a(re), {
|
|
212
|
-
modelValue:
|
|
213
|
-
"onUpdate:modelValue": e[3] || (e[3] = (l) =>
|
|
212
|
+
modelValue: Y.value,
|
|
213
|
+
"onUpdate:modelValue": e[3] || (e[3] = (l) => Y.value = l),
|
|
214
214
|
"active-text": t.$t("bids.currentHeight"),
|
|
215
215
|
"active-value": "100%",
|
|
216
216
|
"inactive-value": "calc(100vh - var(--el-component-size)*4 - var(--el-main-padding)*2 - var(--header-height))"
|
|
217
217
|
}, null, 8, ["modelValue", "active-text"]),
|
|
218
218
|
i(a(re), {
|
|
219
|
-
modelValue:
|
|
220
|
-
"onUpdate:modelValue": e[4] || (e[4] = (l) =>
|
|
219
|
+
modelValue: _.value,
|
|
220
|
+
"onUpdate:modelValue": e[4] || (e[4] = (l) => _.value = l),
|
|
221
221
|
"active-text": "Отпуска",
|
|
222
222
|
"active-value": !0,
|
|
223
223
|
"inactive-value": !1
|
|
@@ -229,23 +229,23 @@ const Oe = { class: "work" }, Ge = { class: "nav" }, Ze = { style: { height: "10
|
|
|
229
229
|
animated: ""
|
|
230
230
|
}, {
|
|
231
231
|
template: v(() => [
|
|
232
|
-
i(a(
|
|
232
|
+
i(a(W), {
|
|
233
233
|
variant: "text",
|
|
234
234
|
style: { width: "100%", height: "2rem" }
|
|
235
235
|
}),
|
|
236
|
-
i(a(
|
|
236
|
+
i(a(W), {
|
|
237
237
|
variant: "text",
|
|
238
238
|
style: { width: "180px", height: "4rem", "margin-right": "4px" }
|
|
239
239
|
}),
|
|
240
|
-
i(a(
|
|
240
|
+
i(a(W), {
|
|
241
241
|
variant: "text",
|
|
242
242
|
style: { width: "calc( 100% - 184px)", height: "4rem" }
|
|
243
243
|
}),
|
|
244
|
-
i(a(
|
|
244
|
+
i(a(W), {
|
|
245
245
|
variant: "text",
|
|
246
246
|
style: { width: "180px", height: "8rem", "margin-right": "4px" }
|
|
247
247
|
}),
|
|
248
|
-
i(a(
|
|
248
|
+
i(a(W), {
|
|
249
249
|
variant: "text",
|
|
250
250
|
style: { width: "calc( 100% - 184px)", height: "8rem" }
|
|
251
251
|
})
|
|
@@ -255,7 +255,7 @@ const Oe = { class: "work" }, Ge = { class: "nav" }, Ze = { style: { height: "10
|
|
|
255
255
|
id: "printTable",
|
|
256
256
|
data: n.value,
|
|
257
257
|
style: { width: "100%" },
|
|
258
|
-
"max-height":
|
|
258
|
+
"max-height": Y.value,
|
|
259
259
|
size: "small",
|
|
260
260
|
align: "center",
|
|
261
261
|
onCellClick: ye,
|
|
@@ -263,7 +263,7 @@ const Oe = { class: "work" }, Ge = { class: "nav" }, Ze = { style: { height: "10
|
|
|
263
263
|
}, {
|
|
264
264
|
default: v(() => [
|
|
265
265
|
i(a(T), {
|
|
266
|
-
label: a(d)("workSchedule.title", { name: V.value }) + a(
|
|
266
|
+
label: a(d)("workSchedule.title", { name: V.value }) + a(j)(C.value, "month") + ` ${new Date(C.value).getFullYear()}`,
|
|
267
267
|
align: "center",
|
|
268
268
|
height: "34"
|
|
269
269
|
}, {
|
|
@@ -271,13 +271,14 @@ const Oe = { class: "work" }, Ge = { class: "nav" }, Ze = { style: { height: "10
|
|
|
271
271
|
i(a(T), {
|
|
272
272
|
label: a(d)("workSchedule.month"),
|
|
273
273
|
width: "180",
|
|
274
|
-
align: "center"
|
|
274
|
+
align: "center",
|
|
275
|
+
fixed: Y.value !== "100%"
|
|
275
276
|
}, {
|
|
276
277
|
default: v((l) => [
|
|
277
278
|
w("div", Ze, h(n.value[l.$index].name), 1)
|
|
278
279
|
]),
|
|
279
280
|
_: 1
|
|
280
|
-
}, 8, ["label"]),
|
|
281
|
+
}, 8, ["label", "fixed"]),
|
|
281
282
|
i(a(T), {
|
|
282
283
|
label: a(d)("workSchedule.numbersMonth"),
|
|
283
284
|
align: "center"
|
|
@@ -304,7 +305,8 @@ const Oe = { class: "work" }, Ge = { class: "nav" }, Ze = { style: { height: "10
|
|
|
304
305
|
}, 8, ["label"]),
|
|
305
306
|
i(a(T), {
|
|
306
307
|
label: a(d)("workSchedule.onSchedule"),
|
|
307
|
-
align: "center"
|
|
308
|
+
align: "center",
|
|
309
|
+
fixed: Y.value !== "100%" ? "right" : !1
|
|
308
310
|
}, {
|
|
309
311
|
default: v(() => [
|
|
310
312
|
i(a(T), {
|
|
@@ -312,24 +314,24 @@ const Oe = { class: "work" }, Ge = { class: "nav" }, Ze = { style: { height: "10
|
|
|
312
314
|
align: "center"
|
|
313
315
|
}, {
|
|
314
316
|
default: v((l) => [
|
|
315
|
-
|
|
317
|
+
b(h(n.value[l.$index].days.length || 0), 1)
|
|
316
318
|
]),
|
|
317
319
|
_: 1
|
|
318
320
|
}, 8, ["label"]),
|
|
319
321
|
i(a(T), {
|
|
320
|
-
label: `${a(d)("workSchedule.hours")} ( ${
|
|
322
|
+
label: `${a(d)("workSchedule.hours")} ( ${O.value} )`,
|
|
321
323
|
align: "center"
|
|
322
324
|
}, {
|
|
323
325
|
default: v((l) => [
|
|
324
326
|
w("div", {
|
|
325
|
-
style: Ne(`color: ${
|
|
327
|
+
style: Ne(`color: ${O.value === l.row.contHour ? "green" : "red"};`)
|
|
326
328
|
}, h(l.row.contHour), 5)
|
|
327
329
|
]),
|
|
328
330
|
_: 1
|
|
329
331
|
}, 8, ["label"])
|
|
330
332
|
]),
|
|
331
333
|
_: 1
|
|
332
|
-
}, 8, ["label"])
|
|
334
|
+
}, 8, ["label", "fixed"])
|
|
333
335
|
]),
|
|
334
336
|
_: 1
|
|
335
337
|
}, 8, ["label"])
|
|
@@ -340,32 +342,32 @@ const Oe = { class: "work" }, Ge = { class: "nav" }, Ze = { style: { height: "10
|
|
|
340
342
|
_: 1
|
|
341
343
|
}, 8, ["loading"]),
|
|
342
344
|
z.checkEdit ? (f(), A("div", Je, [
|
|
343
|
-
|
|
344
|
-
|
|
345
|
+
b(h(a(d)("workSchedule.chartsFilled")) + ": ", 1),
|
|
346
|
+
G.value ? Q("", !0) : (f(), B(a(N), {
|
|
345
347
|
key: 0,
|
|
346
348
|
type: "primary",
|
|
347
|
-
onClick:
|
|
349
|
+
onClick: be
|
|
348
350
|
}, {
|
|
349
351
|
default: v(() => [
|
|
350
|
-
|
|
352
|
+
b(h(a(d)("workSchedule.confirm")), 1)
|
|
351
353
|
]),
|
|
352
354
|
_: 1
|
|
353
355
|
})),
|
|
354
|
-
e[20] || (e[20] =
|
|
356
|
+
e[20] || (e[20] = b()),
|
|
355
357
|
w("span", null, h(z.fullName), 1)
|
|
356
|
-
])) :
|
|
358
|
+
])) : Q("", !0),
|
|
357
359
|
Ee((f(), B(a(N), {
|
|
358
|
-
disabled:
|
|
360
|
+
disabled: L.value,
|
|
359
361
|
plain: "",
|
|
360
|
-
onClick:
|
|
362
|
+
onClick: $e,
|
|
361
363
|
style: { "margin-top": ".5rem" }
|
|
362
364
|
}, {
|
|
363
365
|
default: v(() => [
|
|
364
|
-
|
|
366
|
+
b(h(a(d)("workSchedule.exportExcel")), 1)
|
|
365
367
|
]),
|
|
366
368
|
_: 1
|
|
367
369
|
}, 8, ["disabled"])), [
|
|
368
|
-
[r,
|
|
370
|
+
[r, L.value]
|
|
369
371
|
]),
|
|
370
372
|
i(a(Ie), {
|
|
371
373
|
title: a(d)("workSchedule.jobTitle"),
|
|
@@ -379,7 +381,7 @@ const Oe = { class: "work" }, Ge = { class: "nav" }, Ze = { style: { height: "10
|
|
|
379
381
|
size: "default"
|
|
380
382
|
}, {
|
|
381
383
|
default: v(() => [
|
|
382
|
-
|
|
384
|
+
b(h(t.$t("workSchedule.cancel")), 1)
|
|
383
385
|
]),
|
|
384
386
|
_: 1
|
|
385
387
|
}),
|
|
@@ -389,7 +391,7 @@ const Oe = { class: "work" }, Ge = { class: "nav" }, Ze = { style: { height: "10
|
|
|
389
391
|
onClick: ae
|
|
390
392
|
}, {
|
|
391
393
|
default: v(() => [
|
|
392
|
-
|
|
394
|
+
b(h(t.$t("workSchedule.select")), 1)
|
|
393
395
|
]),
|
|
394
396
|
_: 1
|
|
395
397
|
})
|
|
@@ -418,9 +420,9 @@ const Oe = { class: "work" }, Ge = { class: "nav" }, Ze = { style: { height: "10
|
|
|
418
420
|
_: 1
|
|
419
421
|
}, 8, ["title", "modelValue"]),
|
|
420
422
|
i(a(Pe), {
|
|
421
|
-
show:
|
|
422
|
-
"onUpdate:show": e[18] || (e[18] = (l) =>
|
|
423
|
-
options:
|
|
423
|
+
show: q.value,
|
|
424
|
+
"onUpdate:show": e[18] || (e[18] = (l) => q.value = l),
|
|
425
|
+
options: te.value
|
|
424
426
|
}, {
|
|
425
427
|
default: v(() => [
|
|
426
428
|
i(a(je), {
|
|
@@ -430,8 +432,8 @@ const Oe = { class: "work" }, Ge = { class: "nav" }, Ze = { style: { height: "10
|
|
|
430
432
|
i(a(Le)),
|
|
431
433
|
m.value.level === 2 ? (f(), A("div", Ke, [
|
|
432
434
|
i(a(We), {
|
|
433
|
-
modelValue:
|
|
434
|
-
"onUpdate:modelValue": e[7] || (e[7] = (l) =>
|
|
435
|
+
modelValue: ee.value,
|
|
436
|
+
"onUpdate:modelValue": e[7] || (e[7] = (l) => ee.value = l),
|
|
435
437
|
size: "small"
|
|
436
438
|
}, {
|
|
437
439
|
default: v(() => [
|
|
@@ -452,7 +454,7 @@ const Oe = { class: "work" }, Ge = { class: "nav" }, Ze = { style: { height: "10
|
|
|
452
454
|
}, 8, ["modelValue"]),
|
|
453
455
|
e[21] || (e[21] = w("br", null, null, -1)),
|
|
454
456
|
w("span", null, h(a(d)("workSchedule.fromDate")) + ":", 1),
|
|
455
|
-
i(a(
|
|
457
|
+
i(a(P), {
|
|
456
458
|
modelValue: U.value,
|
|
457
459
|
"onUpdate:modelValue": e[8] || (e[8] = (l) => U.value = l),
|
|
458
460
|
step: 1,
|
|
@@ -460,7 +462,7 @@ const Oe = { class: "work" }, Ge = { class: "nav" }, Ze = { style: { height: "10
|
|
|
460
462
|
max: u.value.length
|
|
461
463
|
}, null, 8, ["modelValue", "max"]),
|
|
462
464
|
w("span", null, h(a(d)("workSchedule.with")) + ":", 1),
|
|
463
|
-
i(a(
|
|
465
|
+
i(a(P), {
|
|
464
466
|
modelValue: S.value,
|
|
465
467
|
"onUpdate:modelValue": e[9] || (e[9] = (l) => S.value = l),
|
|
466
468
|
step: 1,
|
|
@@ -468,7 +470,7 @@ const Oe = { class: "work" }, Ge = { class: "nav" }, Ze = { style: { height: "10
|
|
|
468
470
|
max: 11
|
|
469
471
|
}, null, 8, ["modelValue"]),
|
|
470
472
|
w("span", null, h(a(d)("workSchedule.duration")) + ":", 1),
|
|
471
|
-
i(a(
|
|
473
|
+
i(a(P), {
|
|
472
474
|
modelValue: k.value,
|
|
473
475
|
"onUpdate:modelValue": e[10] || (e[10] = (l) => k.value = l),
|
|
474
476
|
step: 1,
|
|
@@ -481,7 +483,7 @@ const Oe = { class: "work" }, Ge = { class: "nav" }, Ze = { style: { height: "10
|
|
|
481
483
|
onClick: e[11] || (e[11] = (l) => Ce(m.value.ids))
|
|
482
484
|
}, {
|
|
483
485
|
default: v(() => [
|
|
484
|
-
|
|
486
|
+
b(h(a(d)("workSchedule.fillOut")), 1)
|
|
485
487
|
]),
|
|
486
488
|
_: 1
|
|
487
489
|
}),
|
|
@@ -491,7 +493,7 @@ const Oe = { class: "work" }, Ge = { class: "nav" }, Ze = { style: { height: "10
|
|
|
491
493
|
onClick: e[12] || (e[12] = (l) => ke(m.value.ids))
|
|
492
494
|
}, {
|
|
493
495
|
default: v(() => [
|
|
494
|
-
|
|
496
|
+
b(h(a(d)("workSchedule.clearRow")), 1)
|
|
495
497
|
]),
|
|
496
498
|
_: 1
|
|
497
499
|
})
|
|
@@ -499,7 +501,7 @@ const Oe = { class: "work" }, Ge = { class: "nav" }, Ze = { style: { height: "10
|
|
|
499
501
|
w("div", null, h(he(m.value.day, m.value.ids)), 1),
|
|
500
502
|
e[22] || (e[22] = w("br", null, null, -1)),
|
|
501
503
|
w("span", null, h(a(d)("workSchedule.with")) + ":", 1),
|
|
502
|
-
i(a(
|
|
504
|
+
i(a(P), {
|
|
503
505
|
modelValue: S.value,
|
|
504
506
|
"onUpdate:modelValue": e[13] || (e[13] = (l) => S.value = l),
|
|
505
507
|
step: 1,
|
|
@@ -508,7 +510,7 @@ const Oe = { class: "work" }, Ge = { class: "nav" }, Ze = { style: { height: "10
|
|
|
508
510
|
onChange: e[14] || (e[14] = (l) => ce(m.value.day, m.value.ids))
|
|
509
511
|
}, null, 8, ["modelValue"]),
|
|
510
512
|
w("span", null, h(a(d)("workSchedule.duration")) + ":", 1),
|
|
511
|
-
i(a(
|
|
513
|
+
i(a(P), {
|
|
512
514
|
modelValue: k.value,
|
|
513
515
|
"onUpdate:modelValue": e[15] || (e[15] = (l) => k.value = l),
|
|
514
516
|
step: 1,
|
|
@@ -519,10 +521,10 @@ const Oe = { class: "work" }, Ge = { class: "nav" }, Ze = { style: { height: "10
|
|
|
519
521
|
i(a(N), {
|
|
520
522
|
style: { "margin-top": ".5rem" },
|
|
521
523
|
size: "small",
|
|
522
|
-
onClick: e[17] || (e[17] = (l) =>
|
|
524
|
+
onClick: e[17] || (e[17] = (l) => xe(m.value.day, m.value.ids))
|
|
523
525
|
}, {
|
|
524
526
|
default: v(() => [
|
|
525
|
-
|
|
527
|
+
b(h(a(d)("workSchedule.delete")), 1)
|
|
526
528
|
]),
|
|
527
529
|
_: 1
|
|
528
530
|
})
|