@studio-west/employees 0.6.51 → 0.6.53
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/SheetTable.cjs +1 -1
- package/dist/SheetTable.js +67 -67
- package/dist/VacationTable.cjs +1 -1
- package/dist/VacationTable.js +182 -182
- package/dist/WorkTable.cjs +4 -4
- package/dist/WorkTable.js +50 -50
- package/dist/employees.css +1 -1
- package/package.json +4 -2
package/dist/WorkTable.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),de=require("file-saver"),se=require("exceljs"),m=require("./index-Dn3djtwj.cjs"),ve=require("vue-i18n"),i=require("element-plus"),_=require("@imengyu/vue3-context-menu");function ce(C){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(C){for(const V in C)if(V!=="default"){const c=Object.getOwnPropertyDescriptor(C,V);Object.defineProperty(r,V,c.get?c:{enumerable:!0,get:()=>C[V]})}}return r.default=C,Object.freeze(r)}const me=ce(se),ge={class:"work"},he={class:"nav"},fe={style:{height:"100px",width:"100%",display:"inline-block"}},pe={style:{height:"100px",width:"100%",display:"inline-block"}},ye={key:0,class:"controls-container",style:{"margin-top":".5rem"}},we={class:"label"},ke={key:0,style:{padding:"0.5em 1.5em"}},Ce={key:1,style:{padding:"0.5em 1.5em"}},xe={__name:"WorkTable",props:{checkEdit:{type:Boolean,default:()=>!0},odata:Object,workSchedule:Object,fullName:{type:String,default:"Вы"},group:String,date:String},setup(C){const{t:r,d:V}=ve.useI18n(),c=C,
|
|
2
|
-
`+((N=n.value[l].days[v])==null?void 0:N.time)},W=()=>{n.value=[],
|
|
3
|
-
`+(s-1),l.getColumn(s).width=6,l.getColumn(s).alignment=v,l.getCell(4,s).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=v,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=v,l.getColumn(u.value.length+3).alignment=v,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 a=0;for(const s of n.value){let y=[s.name];for(let k=1;k<=u.value.length;k++){const{ind:G}=H(k,a);G!==-1?y[k]=`${s.days[G].time} ${s.days[G].tips}`:y[k]=" "}y.push(((S=s.days)==null?void 0:S.length)||" ",s.contHour||0);const L=l.addRow(y);L.border=d,a++}let w="Щербина Е. В.";c.odata.personal.forEach(s=>{s.roleName==="Начальник отдела правовой и кадровой работы"&&(w=s.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=m.byInitials(c.fullName),l.getCell(`AD${n.value.length+8}`).value=m.byInitials(w),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 N="export_"+m.parseTime(Date.now(),"{dd}.{m}.{Y}")+".xlsx",b=await t.xlsx.writeBuffer();de.saveAs(new Blob([b]),N),
|
|
4
|
-
`+a.day.toString(),prop:"vacation"},{default:e.withCtx(w=>[e.createElementVNode("div",pe,e.toDisplayString(
|
|
1
|
+
"use strict";const e=require("vue"),de=require("file-saver"),se=require("exceljs"),m=require("./index-Dn3djtwj.cjs"),ve=require("vue-i18n"),i=require("element-plus"),_=require("@imengyu/vue3-context-menu");function ce(C){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(C){for(const V in C)if(V!=="default"){const c=Object.getOwnPropertyDescriptor(C,V);Object.defineProperty(r,V,c.get?c:{enumerable:!0,get:()=>C[V]})}}return r.default=C,Object.freeze(r)}const me=ce(se),ge={class:"work"},he={class:"nav"},fe={style:{height:"100px",width:"100%",display:"inline-block"}},pe={style:{height:"100px",width:"100%",display:"inline-block"}},ye={key:0,class:"controls-container",style:{"margin-top":".5rem"}},we={class:"label"},ke={key:0,style:{padding:"0.5em 1.5em"}},Ce={key:1,style:{padding:"0.5em 1.5em"}},xe={__name:"WorkTable",props:{checkEdit:{type:Boolean,default:()=>!0},odata:Object,workSchedule:Object,fullName:{type:String,default:"Вы"},group:String,date:String},setup(C){const{t:r,d:V}=ve.useI18n(),c=C,Y=e.ref(!1),n=e.ref([]),R=e.ref(c.date?new Date(c.date+"T00:00:01").getMonth():new Date().getMonth()),j=e.ref(!1),B=e.ref([]),f=e.ref(new Date(new Date().getFullYear(),new Date().getMonth(),1)),u=e.ref([]),T=e.ref(0),p=e.ref(9),h=e.ref(8),U=e.ref(!1),J=e.ref(!0),$=e.ref(!1),q=e.ref("5"),M=e.ref(1),x=e.ref([]),O=e.ref([]),E=e.ref([]),A=e.ref([]),g=e.ref({name:"Имя",length:0,code:""}),z=e.ref(!1),P=e.ref({zIndex:3,minWidth:230,x:500,y:200}),Z=e.ref({}),F=e.ref("100%");e.watch(x,async(t,l)=>{t!==l&&(E.value=[],U.value=!1,c.odata.personal.forEach(o=>{t.includes(o.divisionName)&&(E.value.some(d=>(d==null?void 0:d.activeText)===o.roleName)||E.value.push({val:!0,activeText:o.roleName}))}),W())}),e.watch(R,async t=>{let l=new Date().getMonth(),o=t===null?l:t-1;o=l-1<=o?o:o+12,console.log("currentMonth",o),f.value=new Date(new Date().getFullYear(),o,1),K()});const ee=(t,l,o,d)=>{g.value.ids=t.ids,g.value.key=t.key,g.value.add=t.days.length>0&&t.days[t.days.length-1].cont,g.value.level=l.level,g.value.day=o.cellIndex,P.value.y=d.clientY,P.value.x=d.clientX,l.level===2&&l.no===0&&c.checkEdit&&(g.value.name=r("workSchedule.autocomplete"),z.value=!0),l.level===3&&o.cellIndex-l.no===1&&c.checkEdit&&(D(o.cellIndex,t.ids),g.value.name=r("workSchedule.modeSelection"),z.value=!0)},le=({row:t,columnIndex:l})=>{if(!B.value||B.value.length===0||!j.value)return"";const o=new Date(new Date(f.value).getFullYear(),new Date(f.value).getMonth(),l).getTime()+1e3;for(let d of B.value){const{dateStart:v,dateEnd:a,code:w}=d;if(v&&a&&w===t.code&&l!==0&&l<=u.value.length){const N=new Date(m.parseDate(v)).getTime(),b=new Date(m.parseDate(a)).getTime();if(o>=N&&o<=b)return"vacation"}}return""},K=()=>{var a,w,N,b;const t=Z.value,l=new Date(f.value),o=new Date(l.getFullYear(),l.getMonth()+1,0).getDate();let d=[],v=0;for(let S=1;S<=o;S++){const s=m.parseTime(l.setDate(S),"{Y}-{m}-{dd}");v+=(a=t.nowork)!=null&&a.includes(s)||t.holidays.includes(s)?0:(w=t.preholidays)!=null&&w.includes(s)?7:8;const y=(N=t.nowork)!=null&&N.includes(s)?"nowork":t.holidays.includes(s)?"holiday":(b=t.preholidays)!=null&&b.includes(s)?"preholiday":"";d.push({day:S,holidays:y,weekday:V(new Date(l.getFullYear(),l.getMonth(),S),"day")})}T.value=v,u.value=d,c.odata.getPersonal({}).then(S=>{var s;x.value.length===0&&(x.value=[(s=S.find(y=>y.employeeName===c.fullName))==null?void 0:s.divisionName]),S.forEach((y,L)=>{O.value.some(k=>(k==null?void 0:k.value)===y.divisionName)||O.value.push({value:y.divisionName,label:y.divisionName,key:L}),x.value.includes(y.divisionName)&&!E.value.some(k=>(k==null?void 0:k.activeText)===y.roleName)&&E.value.push({val:!0,activeText:y.roleName})}),W(),J.value=!1})},te=e.computed(()=>!n.value.some(t=>t.contHour!==T.value)),Q=(t,l)=>{var a,w,N;const o=new Date(f.value),d=`${o.getFullYear()}-${(o.getMonth()+1).toString().padStart(2,"0")}-${t.toString().padStart(2,"0")}`,v=(a=n.value[l])==null?void 0:a.days.findIndex(b=>b.day===d);return l===-1||v===-1?"":((w=n.value[l].days[v])==null?void 0:w.tips)+`
|
|
2
|
+
`+((N=n.value[l].days[v])==null?void 0:N.time)},W=()=>{n.value=[],A.value=[],B.value=[],c.odata.personal.forEach(t=>{if(x.value.includes(t.divisionName)&&E.value.some(l=>l.val&&l.activeText===t.roleName)){let l=m.byInitials(t.employeeName);A.value.push(t.employeeKey),n.value.push({name:l+" ("+t.roleName+")",days:[],contHour:0,code:t.employeeKey,id:!1})}}),n.value.sort((t,l)=>t.name<l.name?-1:t.name>l.name?1:0),n.value.forEach((t,l)=>{t.ids=l,A.value.push(t.code)}),c.workSchedule.getUsersYear({code:A.value,year:new Date(f.value).getFullYear()}).then(t=>{t.forEach(l=>{l.dateStart&&B.value.push({code:l.code,dateStart:l.dateStart,dateEnd:l.dateEnd})}),ae(),$.value=!1})},ae=()=>{c.workSchedule.getWorkSchedule({code:A.value,date:m.parseTime(new Date(f.value),"{Y}-{m}-{dd}")}).then(t=>{t.forEach((l,o)=>{l!==null&&(n.value[o].days=l.data.days,n.value[o].id=l.id)}),I()})},I=()=>{n.value.forEach(t=>{t.contHour=t.days.reduce((l,o)=>l+o.time,0)})},ne=t=>{n.value[t].days=[],I()},oe=t=>{switch(q.value){case"5":for(let l=M.value;l<=u.value.length;l++)u.value[l-1].holidays===""&&D(l,t,!0),u.value[l-1].holidays==="preholiday"&&(h.value-=1,D(l,t,!0),h.value+=1);break;case"2x2":for(let l=M.value;l<=u.value.length;l+=4)D(l,t,!0),l+1<=u.value.length&&D(l+1,t,!0);break;case"2x5":for(let l=M.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"?(h.value-=1,D(o,t,!0),h.value+=1):D(o,t,!0);break}},D=(t,l,o=!1)=>{const{date:d,ind:v}=H(t,l);v===-1?(n.value[l].days.push({day:d,time:h.value,tips:`(${p.value}:00 - ${h.value>=22?p.value+h.value+2:p.value+h.value+1}:00)`}),I()):o||(h.value=n.value[l].days[v].time,p.value=parseInt(n.value[l].days[v].tips.slice(1,-12)))},ue=(t,l)=>{const{ind:o}=H(t,l);n.value[l].days.splice(o,1),I(),document.querySelector(".app-main").click()},X=(t,l)=>{const{date:o,ind:d}=H(t,l);n.value[l].days[d]={day:o,time:h.value,tips:`(${p.value}:00 - ${h.value>=22?p.value+h.value+2:p.value+h.value+1}:00)`},I()},H=(t,l)=>{var v;const o=m.parseTime(new Date(f.value).setDate(t),"{Y}-{m}-{dd}"),d=(v=n.value[l])==null?void 0:v.days.findIndex(a=>a.day===o);return{date:o,ind:d}},re=async()=>{var S;Y.value=!0;const t=new me.Workbook,l=t.addWorksheet(V(f.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"}},v={vertical:"middle",horizontal:"center",wrapText:!0};l.mergeCells(`A1:${m.cellsDynamically("A1",u.value.length+5)}1`),l.mergeCells(`A2:${m.cellsDynamically("A2",u.value.length+5)}2`),l.mergeCells("A3:A4"),l.mergeCells(`B3:${m.cellsDynamically("B3",u.value.length)}3`),l.mergeCells(`${m.cellsDynamically("B3",u.value.length+1)}3:${m.cellsDynamically("B3",u.value.length+2)}3`),l.mergeCells(`${m.cellsDynamically("B3",u.value.length+3)}3:${m.cellsDynamically("B4",u.value.length+3)}4`),l.mergeCells(`${m.cellsDynamically("B3",u.value.length+4)}3:${m.cellsDynamically("B4",u.value.length+4)}4`),l.getCell("A1").value=r("workSchedule.firm"),l.getCell("A2").value=r("workSchedule.title",{name:x.value[0]})+V(f.value,"month")+` ${new Date(f.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")} (${T.value})`;for(let s=2;s<=u.value.length+1;s++)l.getCell(4,s).value=u.value[s-2].weekday+`
|
|
3
|
+
`+(s-1),l.getColumn(s).width=6,l.getColumn(s).alignment=v,l.getCell(4,s).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=v,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=v,l.getColumn(u.value.length+3).alignment=v,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 a=0;for(const s of n.value){let y=[s.name];for(let k=1;k<=u.value.length;k++){const{ind:G}=H(k,a);G!==-1?y[k]=`${s.days[G].time} ${s.days[G].tips}`:y[k]=" "}y.push(((S=s.days)==null?void 0:S.length)||" ",s.contHour||0);const L=l.addRow(y);L.border=d,a++}let w="Щербина Е. В.";c.odata.personal.forEach(s=>{s.roleName==="Начальник отдела правовой и кадровой работы"&&(w=s.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=m.byInitials(c.fullName),l.getCell(`AD${n.value.length+8}`).value=m.byInitials(w),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 N="export_"+m.parseTime(Date.now(),"{dd}.{m}.{Y}")+".xlsx",b=await t.xlsx.writeBuffer();de.saveAs(new Blob([b]),N),Y.value=!1},ie=async()=>{U.value||c.workSchedule.addWorkSchedule({data:n.value,date:m.parseTime(new Date(f.value),"{Y}-{m}-{dd}"),group:x.value[0]}).then(t=>U.value=t)};return console.log("props.group",c.group),console.log("props.date",c.date),c.group&&(x.value[0]=c.group),c.date&&(f.value=new Date(c.date+"T00:00:01")),m.holidays().then(t=>{Z.value=t,K()}),(t,l)=>{const o=e.resolveComponent("el-date-picker"),d=e.resolveComponent("svg-icon"),v=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",ge,[e.createElementVNode("div",he,[C.checkEdit?(e.openBlock(),e.createBlock(e.unref(i.ElSelect),{key:0,modelValue:x.value,"onUpdate:modelValue":l[0]||(l[0]=a=>x.value=a),multiple:"","collapse-tags":"","collapse-tags-tooltip":"",placeholder:"Select",style:{width:"240px"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O.value,a=>(e.openBlock(),e.createBlock(e.unref(i.ElOption),{key:a.key,label:a.label,value:a.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])):e.createCommentVNode("",!0),C.checkEdit?(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:1,plain:"",onClick:l[1]||(l[1]=a=>$.value=!0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.jobTitle")),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(o,{modelValue:R.value,"onUpdate:modelValue":l[2]||(l[2]=a=>R.value=a),type:"month",placeholder:"Выберите месяц",format:"MMM","value-format":"M"},null,8,["modelValue"]),l[21]||(l[21]=e.createElementVNode("div",{class:"expander"},null,-1)),e.createVNode(e.unref(i.ElSwitch),{modelValue:F.value,"onUpdate:modelValue":l[3]||(l[3]=a=>F.value=a),"active-text":t.$t("bids.currentHeight"),"active-value":"100%","inactive-value":"calc(100vh - var(--el-component-size)*5 - var(--el-main-padding)*2 - var(--header-height))"},null,8,["modelValue","active-text"]),e.createVNode(e.unref(i.ElSwitch),{modelValue:j.value,"onUpdate:modelValue":l[4]||(l[4]=a=>j.value=a),"active-text":"Отпуска","active-value":!0,"inactive-value":!1},null,8,["modelValue"])]),e.createVNode(e.unref(i.ElSkeleton),{style:{width:"100%"},loading:J.value,animated:""},{template:e.withCtx(()=>[e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"100%",height:"2rem"}}),e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"180px",height:"4rem","margin-right":"4px"}}),e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"calc( 100% - 184px)",height:"4rem"}}),e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"180px",height:"8rem","margin-right":"4px"}}),e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"calc( 100% - 184px)",height:"8rem"}})]),default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTable),{id:"printTable",data:n.value,style:{width:"100%"},"max-height":F.value,size:"small",align:"center",onCellClick:ee,"empty-text":e.unref(r)("workSchedule.emptyText"),"cell-class-name":le},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.title",{name:x.value[0]})+e.unref(V)(f.value,"month")+` ${new Date(f.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:F.value!=="100%"},{default:e.withCtx(a=>[e.createElementVNode("div",fe,e.toDisplayString(n.value[a.$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,a=>(e.openBlock(),e.createBlock(e.unref(i.ElTableColumn),{key:a.day,width:"46","class-name":a.holidays,align:"center",label:a.weekday+`
|
|
4
|
+
`+a.day.toString(),prop:"vacation"},{default:e.withCtx(w=>[e.createElementVNode("div",pe,e.toDisplayString(Q(a.day,w.$index)||" "),1)]),_:2},1032,["class-name","label"]))),128))]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.onSchedule"),align:"center",fixed:F.value!=="100%"?"right":!1},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.days"),align:"center"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(n.value[a.$index].days.length||0),1)]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:`${e.unref(r)("workSchedule.hours")} ( ${T.value} )`,align:"center"},{default:e.withCtx(a=>[e.createElementVNode("div",{style:e.normalizeStyle(`color: ${T.value===a.row.contHour?"green":"red"};`)},e.toDisplayString(a.row.contHour),5)]),_:1},8,["label"])]),_:1},8,["label","fixed"])]),_:1},8,["label"])]),_:1},8,["data","max-height","empty-text"])]),_:1},8,["loading"]),te.value&&C.checkEdit?(e.openBlock(),e.createElementBlock("div",ye,[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.chartsFilled"))+": ",1),U.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:0,type:"primary",onClick:ie},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.confirm")),1)]),_:1})),l[22]||(l[22]=e.createTextVNode()),e.createElementVNode("span",null,e.toDisplayString(C.fullName),1)])):e.createCommentVNode("",!0),e.withDirectives((e.openBlock(),e.createBlock(e.unref(i.ElButton),{disabled:Y.value,plain:"",onClick:re,style:{"margin-top":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.exportExcel")),1)]),_:1},8,["disabled"])),[[v,Y.value]]),e.createVNode(e.unref(i.ElDialog),{title:e.unref(r)("workSchedule.jobTitle"),modelValue:$.value,"onUpdate:modelValue":l[7]||(l[7]=a=>$.value=a),width:"400px"},{footer:e.withCtx(()=>[e.createVNode(e.unref(i.ElButton),{onClick:l[5]||(l[5]=a=>$.value=!1),size:"default"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.$t("workSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(i.ElButton),{size:"default",type:"primary",onClick:l[6]||(l[6]=a=>{W(),$.value=!1})},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.$t("workSchedule.select")),1)]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(i.ElForm),{ref:"dialogForm",model:E.value,autocomplete:"on"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.value,a=>(e.openBlock(),e.createBlock(e.unref(i.ElFormItem),null,{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElSwitch),{modelValue:a.val,"onUpdate:modelValue":w=>a.val=w,"active-text":a.activeText},null,8,["modelValue","onUpdate:modelValue","active-text"])]),_:2},1024))),256))]),_:1},8,["model"])]),_:1},8,["title","modelValue"]),e.createVNode(e.unref(_.ContextMenu),{show:z.value,"onUpdate:show":l[20]||(l[20]=a=>z.value=a),options:P.value},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"mx-context-menu-item",onClick:l[8]||(l[8]=a=>z.value=!1)},[e.createElementVNode("span",we,e.toDisplayString(g.value.name),1),l[23]||(l[23]=e.createElementVNode("div",{class:"expander"},null,-1)),e.createVNode(d,{"icon-class":"cross"})]),e.createVNode(e.unref(_.ContextMenuSeparator)),g.value.level===2?(e.openBlock(),e.createElementBlock("div",ke,[e.createVNode(e.unref(i.ElRadioGroup),{modelValue:q.value,"onUpdate:modelValue":l[9]||(l[9]=a=>q.value=a),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[24]||(l[24]=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:M.value,"onUpdate:modelValue":l[10]||(l[10]=a=>M.value=a),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:p.value,"onUpdate:modelValue":l[11]||(l[11]=a=>p.value=a),step:1,min:0,max:19},null,8,["modelValue"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.duration"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:h.value,"onUpdate:modelValue":l[12]||(l[12]=a=>h.value=a),step:1,min:4,max:e.unref(m.clamp)(p.value!==1?23-p.value:21,4,22)},null,8,["modelValue","max"]),e.createVNode(e.unref(i.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:l[13]||(l[13]=a=>oe(g.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[14]||(l[14]=a=>ne(g.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.clearRow")),1)]),_:1})])):(e.openBlock(),e.createElementBlock("div",Ce,[e.createElementVNode("div",null,e.toDisplayString(Q(g.value.day,g.value.ids)),1),l[25]||(l[25]=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:p.value,"onUpdate:modelValue":l[15]||(l[15]=a=>p.value=a),step:1,min:0,max:19,onChange:l[16]||(l[16]=a=>X(g.value.day,g.value.ids))},null,8,["modelValue"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.duration"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:h.value,"onUpdate:modelValue":l[17]||(l[17]=a=>h.value=a),step:1,min:4,max:e.unref(m.clamp)(p.value!==1?23-p.value:21,4,22),onChange:l[18]||(l[18]=a=>X(g.value.day,g.value.ids))},null,8,["modelValue","max"]),e.createVNode(e.unref(i.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:l[19]||(l[19]=a=>ue(g.value.day,g.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.delete")),1)]),_:1})]))]),_:1},8,["show","options"])])}}};module.exports=xe;
|
package/dist/WorkTable.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ref as g, watch as ye, computed as Ae, resolveComponent as we, resolveDirective as Te, createElementBlock as z, openBlock as S, createElementVNode as y, createVNode as i, createCommentVNode as _, withDirectives as Be, createBlock as F, unref as a, withCtx as v, Fragment as ie, renderList as re, createTextVNode as V, toDisplayString as h, normalizeStyle as ze } from "vue";
|
|
2
2
|
import { saveAs as Fe } from "file-saver";
|
|
3
3
|
import * as Ye from "exceljs";
|
|
4
|
-
import { p as
|
|
4
|
+
import { p as L, b as se, h as Ue, c as ke, a as Ce, d as M } from "./index-2Mx6IUGl.js";
|
|
5
5
|
import { useI18n as He } from "vue-i18n";
|
|
6
|
-
import { ElSelect as Ie, ElOption as Re, ElButton as T, ElSwitch as ve, ElSkeleton as We, ElTable as Pe, ElTableColumn as Y, ElSkeletonItem as
|
|
6
|
+
import { ElSelect as Ie, ElOption as Re, ElButton as T, ElSwitch as ve, ElSkeleton as We, ElTable as Pe, ElTableColumn as Y, ElSkeletonItem as Z, ElDialog as je, ElForm as Oe, ElFormItem as Ge, ElRadioGroup as Le, ElRadioButton as ge, ElSlider as q } from "element-plus";
|
|
7
7
|
import { ContextMenu as Ze, ContextMenuSeparator as qe } from "@imengyu/vue3-context-menu";
|
|
8
|
-
const Je = { class: "work" },
|
|
8
|
+
const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "100px", width: "100%", display: "inline-block" } }, Xe = { style: { height: "100px", width: "100%", display: "inline-block" } }, _e = {
|
|
9
9
|
key: 0,
|
|
10
10
|
class: "controls-container",
|
|
11
11
|
style: { "margin-top": ".5rem" }
|
|
@@ -26,7 +26,7 @@ const Je = { class: "work" }, Qe = { class: "nav" }, Ke = { style: { height: "10
|
|
|
26
26
|
date: String
|
|
27
27
|
},
|
|
28
28
|
setup(H) {
|
|
29
|
-
const { t: d, d:
|
|
29
|
+
const { t: d, d: J } = He(), c = H, K = g(!1), n = g([
|
|
30
30
|
// { name: 'Иванов П.М. (Ведущий работник месяца)',
|
|
31
31
|
// days: [], // {day: "2024-11-01", tips: '(9:00 - 18:00)', time: 8 }
|
|
32
32
|
// contHour: 0,
|
|
@@ -39,12 +39,12 @@ const Je = { class: "work" }, Qe = { class: "nav" }, Ke = { style: { height: "10
|
|
|
39
39
|
// code: '0000-00052'
|
|
40
40
|
// ids: 1
|
|
41
41
|
// }
|
|
42
|
-
]), ee = g(c.date ? (/* @__PURE__ */ new Date(c.date + "T00:00:01")).getMonth() : (/* @__PURE__ */ new Date()).getMonth()), le = g(!1), I = g([]), w = g(new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1)), u = g([]), R = g(0), k = g(9), f = g(8), Q = g(!1), me = g(!0), U = g(!1), te = g("5"), W = g(1), b = g([]), ae = g([]), N = g([]),
|
|
42
|
+
]), ee = g(c.date ? (/* @__PURE__ */ new Date(c.date + "T00:00:01")).getMonth() : (/* @__PURE__ */ new Date()).getMonth()), le = g(!1), I = g([]), w = g(new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1)), u = g([]), R = g(0), k = g(9), f = g(8), Q = g(!1), me = g(!0), U = g(!1), te = g("5"), W = g(1), b = g([]), ae = g([]), N = g([]), P = g([]), p = g({ name: "Имя", length: 0, code: "" }), j = g(!1), ne = g({
|
|
43
43
|
zIndex: 3,
|
|
44
44
|
minWidth: 230,
|
|
45
45
|
x: 500,
|
|
46
46
|
y: 200
|
|
47
|
-
}), he = g({}),
|
|
47
|
+
}), he = g({}), O = g("100%");
|
|
48
48
|
ye(b, async (l, e) => {
|
|
49
49
|
l !== e && (N.value = [], Q.value = !1, c.odata.personal.forEach((o) => {
|
|
50
50
|
l.includes(o.divisionName) && (N.value.some((r) => (r == null ? void 0 : r.activeText) === o.roleName) || N.value.push({ val: !0, activeText: o.roleName }));
|
|
@@ -54,7 +54,7 @@ const Je = { class: "work" }, Qe = { class: "nav" }, Ke = { style: { height: "10
|
|
|
54
54
|
o = e - 1 <= o ? o : o + 12, console.log("currentMonth", o), w.value = new Date((/* @__PURE__ */ new Date()).getFullYear(), o, 1), ce();
|
|
55
55
|
});
|
|
56
56
|
const xe = (l, e, o, r) => {
|
|
57
|
-
p.value.ids = l.ids, p.value.key = l.key, p.value.add = l.days.length > 0 && l.days[l.days.length - 1].cont, p.value.level = e.level, p.value.day = o.cellIndex, ne.value.y = r.clientY, ne.value.x = r.clientX, e.level === 2 && e.no === 0 && c.checkEdit && (p.value.name = d("workSchedule.autocomplete"),
|
|
57
|
+
p.value.ids = l.ids, p.value.key = l.key, p.value.add = l.days.length > 0 && l.days[l.days.length - 1].cont, p.value.level = e.level, p.value.day = o.cellIndex, ne.value.y = r.clientY, ne.value.x = r.clientX, e.level === 2 && e.no === 0 && c.checkEdit && (p.value.name = d("workSchedule.autocomplete"), j.value = !0), e.level === 3 && o.cellIndex - e.no === 1 && c.checkEdit && (B(o.cellIndex, l.ids), p.value.name = d("workSchedule.modeSelection"), j.value = !0);
|
|
58
58
|
}, Se = ({ row: l, columnIndex: e }) => {
|
|
59
59
|
if (!I.value || I.value.length === 0 || !le.value) return "";
|
|
60
60
|
const o = new Date(new Date(w.value).getFullYear(), new Date(w.value).getMonth(), e).getTime() + 1e3;
|
|
@@ -71,10 +71,10 @@ const Je = { class: "work" }, Qe = { class: "nav" }, Ke = { style: { height: "10
|
|
|
71
71
|
const l = he.value, e = new Date(w.value), o = new Date(e.getFullYear(), e.getMonth() + 1, 0).getDate();
|
|
72
72
|
let r = [], m = 0;
|
|
73
73
|
for (let D = 1; D <= o; D++) {
|
|
74
|
-
const s =
|
|
74
|
+
const s = L(e.setDate(D), "{Y}-{m}-{dd}");
|
|
75
75
|
m += (t = l.nowork) != null && t.includes(s) || l.holidays.includes(s) ? 0 : (x = l.preholidays) != null && x.includes(s) ? 7 : 8;
|
|
76
76
|
const C = (E = l.nowork) != null && E.includes(s) ? "nowork" : l.holidays.includes(s) ? "holiday" : (A = l.preholidays) != null && A.includes(s) ? "preholiday" : "";
|
|
77
|
-
r.push({ day: D, holidays: C, weekday:
|
|
77
|
+
r.push({ day: D, holidays: C, weekday: J(new Date(e.getFullYear(), e.getMonth(), D), "day") });
|
|
78
78
|
}
|
|
79
79
|
R.value = m, u.value = r, c.odata.getPersonal({}).then((D) => {
|
|
80
80
|
var s;
|
|
@@ -88,32 +88,32 @@ const Je = { class: "work" }, Qe = { class: "nav" }, Ke = { style: { height: "10
|
|
|
88
88
|
return e === -1 || m === -1 ? "" : ((x = n.value[e].days[m]) == null ? void 0 : x.tips) + `
|
|
89
89
|
` + ((E = n.value[e].days[m]) == null ? void 0 : E.time);
|
|
90
90
|
}, oe = () => {
|
|
91
|
-
n.value = [],
|
|
91
|
+
n.value = [], P.value = [], I.value = [], c.odata.personal.forEach((l) => {
|
|
92
92
|
if (b.value.includes(l.divisionName) && N.value.some((e) => e.val && e.activeText === l.roleName)) {
|
|
93
93
|
let e = se(l.employeeName);
|
|
94
|
-
n.value.push({ name: e + " (" + l.roleName + ")", days: [], contHour: 0, code: l.employeeKey, id: !1 });
|
|
94
|
+
P.value.push(l.employeeKey), n.value.push({ name: e + " (" + l.roleName + ")", days: [], contHour: 0, code: l.employeeKey, id: !1 });
|
|
95
95
|
}
|
|
96
96
|
}), n.value.sort((l, e) => l.name < e.name ? -1 : l.name > e.name ? 1 : 0), n.value.forEach((l, e) => {
|
|
97
|
-
l.ids = e,
|
|
98
|
-
}), c.workSchedule.getUsersYear({ code:
|
|
97
|
+
l.ids = e, P.value.push(l.code);
|
|
98
|
+
}), c.workSchedule.getUsersYear({ code: P.value, year: new Date(w.value).getFullYear() }).then((l) => {
|
|
99
99
|
l.forEach((e) => {
|
|
100
100
|
e.dateStart && I.value.push({ code: e.code, dateStart: e.dateStart, dateEnd: e.dateEnd });
|
|
101
101
|
}), be(), U.value = !1;
|
|
102
102
|
});
|
|
103
103
|
}, be = () => {
|
|
104
|
-
c.workSchedule.getWorkSchedule({ code:
|
|
104
|
+
c.workSchedule.getWorkSchedule({ code: P.value, date: L(new Date(w.value), "{Y}-{m}-{dd}") }).then(
|
|
105
105
|
(l) => {
|
|
106
106
|
l.forEach((e, o) => {
|
|
107
107
|
e !== null && (n.value[o].days = e.data.days, n.value[o].id = e.id);
|
|
108
|
-
}),
|
|
108
|
+
}), G();
|
|
109
109
|
}
|
|
110
110
|
);
|
|
111
|
-
},
|
|
111
|
+
}, G = () => {
|
|
112
112
|
n.value.forEach((l) => {
|
|
113
113
|
l.contHour = l.days.reduce((e, o) => e + o.time, 0);
|
|
114
114
|
});
|
|
115
115
|
}, De = (l) => {
|
|
116
|
-
n.value[l].days = [],
|
|
116
|
+
n.value[l].days = [], G();
|
|
117
117
|
}, Ve = (l) => {
|
|
118
118
|
switch (te.value) {
|
|
119
119
|
case "5":
|
|
@@ -136,26 +136,26 @@ const Je = { class: "work" }, Qe = { class: "nav" }, Ke = { style: { height: "10
|
|
|
136
136
|
day: r,
|
|
137
137
|
time: f.value,
|
|
138
138
|
tips: `(${k.value}:00 - ${f.value >= 22 ? k.value + f.value + 2 : k.value + f.value + 1}:00)`
|
|
139
|
-
}),
|
|
139
|
+
}), G()) : o || (f.value = n.value[e].days[m].time, k.value = parseInt(n.value[e].days[m].tips.slice(1, -12)));
|
|
140
140
|
}, Ee = (l, e) => {
|
|
141
141
|
const { ind: o } = X(l, e);
|
|
142
|
-
n.value[e].days.splice(o, 1),
|
|
142
|
+
n.value[e].days.splice(o, 1), G(), document.querySelector(".app-main").click();
|
|
143
143
|
}, fe = (l, e) => {
|
|
144
144
|
const { date: o, ind: r } = X(l, e);
|
|
145
145
|
n.value[e].days[r] = {
|
|
146
146
|
day: o,
|
|
147
147
|
time: f.value,
|
|
148
148
|
tips: `(${k.value}:00 - ${f.value >= 22 ? k.value + f.value + 2 : k.value + f.value + 1}:00)`
|
|
149
|
-
},
|
|
149
|
+
}, G();
|
|
150
150
|
}, X = (l, e) => {
|
|
151
151
|
var m;
|
|
152
|
-
const o =
|
|
152
|
+
const o = L(new Date(w.value).setDate(l), "{Y}-{m}-{dd}"), r = (m = n.value[e]) == null ? void 0 : m.days.findIndex((t) => t.day === o);
|
|
153
153
|
return { date: o, ind: r };
|
|
154
154
|
}, Me = async () => {
|
|
155
155
|
var D;
|
|
156
|
-
|
|
157
|
-
const l = new Ye.Workbook(), e = l.addWorksheet(
|
|
158
|
-
e.mergeCells(`A1:${M("A1", u.value.length + 5)}1`), e.mergeCells(`A2:${M("A2", u.value.length + 5)}2`), e.mergeCells("A3:A4"), e.mergeCells(`B3:${M("B3", u.value.length)}3`), e.mergeCells(`${M("B3", u.value.length + 1)}3:${M("B3", u.value.length + 2)}3`), e.mergeCells(`${M("B3", u.value.length + 3)}3:${M("B4", u.value.length + 3)}4`), e.mergeCells(`${M("B3", u.value.length + 4)}3:${M("B4", u.value.length + 4)}4`), e.getCell("A1").value = d("workSchedule.firm"), e.getCell("A2").value = d("workSchedule.title", { name: b.value[0] }) +
|
|
156
|
+
K.value = !0;
|
|
157
|
+
const l = new Ye.Workbook(), e = l.addWorksheet(J(w.value, "month"), { pageSetup: { paperSize: 9, orientation: "landscape", fitToPage: !0 } }), o = { vertical: "middle", horizontal: "center" }, r = { top: { style: "thin" }, left: { style: "thin" }, bottom: { style: "thin" }, right: { style: "thin" } }, m = { vertical: "middle", horizontal: "center", wrapText: !0 };
|
|
158
|
+
e.mergeCells(`A1:${M("A1", u.value.length + 5)}1`), e.mergeCells(`A2:${M("A2", u.value.length + 5)}2`), e.mergeCells("A3:A4"), e.mergeCells(`B3:${M("B3", u.value.length)}3`), e.mergeCells(`${M("B3", u.value.length + 1)}3:${M("B3", u.value.length + 2)}3`), e.mergeCells(`${M("B3", u.value.length + 3)}3:${M("B4", u.value.length + 3)}4`), e.mergeCells(`${M("B3", u.value.length + 4)}3:${M("B4", u.value.length + 4)}4`), e.getCell("A1").value = d("workSchedule.firm"), e.getCell("A2").value = d("workSchedule.title", { name: b.value[0] }) + J(w.value, "month") + ` ${new Date(w.value).getFullYear()}`, e.getCell("A3").value = d("workSchedule.month"), e.getCell("B3").value = d("workSchedule.numbersMonth"), e.getCell(3, u.value.length + 2).value = d("workSchedule.onSchedule"), e.getCell(3, u.value.length + 4).value = d("workSchedule.acquainted"), e.getCell(3, u.value.length + 5).value = d("workSchedule.date"), e.getCell(4, u.value.length + 2).value = d("workSchedule.days"), e.getCell(4, u.value.length + 3).value = `${d("workSchedule.hours")} (${R.value})`;
|
|
159
159
|
for (let s = 2; s <= u.value.length + 1; s++)
|
|
160
160
|
e.getCell(4, s).value = u.value[s - 2].weekday + `
|
|
161
161
|
` + (s - 1), e.getColumn(s).width = 6, e.getColumn(s).alignment = m, e.getCell(4, s).border = r;
|
|
@@ -175,17 +175,17 @@ const Je = { class: "work" }, Qe = { class: "nav" }, Ke = { style: { height: "10
|
|
|
175
175
|
c.odata.personal.forEach((s) => {
|
|
176
176
|
s.roleName === "Начальник отдела правовой и кадровой работы" && (x = s.employeeName);
|
|
177
177
|
}), 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 = se(c.fullName), e.getCell(`AD${n.value.length + 8}`).value = se(x), 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" } };
|
|
178
|
-
const E = "export_" +
|
|
179
|
-
Fe(new Blob([A]), E),
|
|
178
|
+
const E = "export_" + L(Date.now(), "{dd}.{m}.{Y}") + ".xlsx", A = await l.xlsx.writeBuffer();
|
|
179
|
+
Fe(new Blob([A]), E), K.value = !1;
|
|
180
180
|
}, Ne = async () => {
|
|
181
|
-
Q.value || c.workSchedule.addWorkSchedule({ data: n.value, date:
|
|
181
|
+
Q.value || c.workSchedule.addWorkSchedule({ data: n.value, date: L(new Date(w.value), "{Y}-{m}-{dd}"), group: b.value[0] }).then((l) => Q.value = l);
|
|
182
182
|
};
|
|
183
183
|
return console.log("props.group", c.group), console.log("props.date", c.date), c.group && (b.value[0] = c.group), c.date && (w.value = /* @__PURE__ */ new Date(c.date + "T00:00:01")), Ue().then((l) => {
|
|
184
184
|
he.value = l, ce();
|
|
185
185
|
}), (l, e) => {
|
|
186
186
|
const o = we("el-date-picker"), r = we("svg-icon"), m = Te("loading");
|
|
187
187
|
return S(), z("div", Je, [
|
|
188
|
-
y("div",
|
|
188
|
+
y("div", Ke, [
|
|
189
189
|
H.checkEdit ? (S(), F(a(Ie), {
|
|
190
190
|
key: 0,
|
|
191
191
|
modelValue: b.value,
|
|
@@ -225,8 +225,8 @@ const Je = { class: "work" }, Qe = { class: "nav" }, Ke = { style: { height: "10
|
|
|
225
225
|
}, null, 8, ["modelValue"]),
|
|
226
226
|
e[21] || (e[21] = y("div", { class: "expander" }, null, -1)),
|
|
227
227
|
i(a(ve), {
|
|
228
|
-
modelValue:
|
|
229
|
-
"onUpdate:modelValue": e[3] || (e[3] = (t) =>
|
|
228
|
+
modelValue: O.value,
|
|
229
|
+
"onUpdate:modelValue": e[3] || (e[3] = (t) => O.value = t),
|
|
230
230
|
"active-text": l.$t("bids.currentHeight"),
|
|
231
231
|
"active-value": "100%",
|
|
232
232
|
"inactive-value": "calc(100vh - var(--el-component-size)*5 - var(--el-main-padding)*2 - var(--header-height))"
|
|
@@ -245,23 +245,23 @@ const Je = { class: "work" }, Qe = { class: "nav" }, Ke = { style: { height: "10
|
|
|
245
245
|
animated: ""
|
|
246
246
|
}, {
|
|
247
247
|
template: v(() => [
|
|
248
|
-
i(a(
|
|
248
|
+
i(a(Z), {
|
|
249
249
|
variant: "text",
|
|
250
250
|
style: { width: "100%", height: "2rem" }
|
|
251
251
|
}),
|
|
252
|
-
i(a(
|
|
252
|
+
i(a(Z), {
|
|
253
253
|
variant: "text",
|
|
254
254
|
style: { width: "180px", height: "4rem", "margin-right": "4px" }
|
|
255
255
|
}),
|
|
256
|
-
i(a(
|
|
256
|
+
i(a(Z), {
|
|
257
257
|
variant: "text",
|
|
258
258
|
style: { width: "calc( 100% - 184px)", height: "4rem" }
|
|
259
259
|
}),
|
|
260
|
-
i(a(
|
|
260
|
+
i(a(Z), {
|
|
261
261
|
variant: "text",
|
|
262
262
|
style: { width: "180px", height: "8rem", "margin-right": "4px" }
|
|
263
263
|
}),
|
|
264
|
-
i(a(
|
|
264
|
+
i(a(Z), {
|
|
265
265
|
variant: "text",
|
|
266
266
|
style: { width: "calc( 100% - 184px)", height: "8rem" }
|
|
267
267
|
})
|
|
@@ -271,7 +271,7 @@ const Je = { class: "work" }, Qe = { class: "nav" }, Ke = { style: { height: "10
|
|
|
271
271
|
id: "printTable",
|
|
272
272
|
data: n.value,
|
|
273
273
|
style: { width: "100%" },
|
|
274
|
-
"max-height":
|
|
274
|
+
"max-height": O.value,
|
|
275
275
|
size: "small",
|
|
276
276
|
align: "center",
|
|
277
277
|
onCellClick: xe,
|
|
@@ -280,7 +280,7 @@ const Je = { class: "work" }, Qe = { class: "nav" }, Ke = { style: { height: "10
|
|
|
280
280
|
}, {
|
|
281
281
|
default: v(() => [
|
|
282
282
|
i(a(Y), {
|
|
283
|
-
label: a(d)("workSchedule.title", { name: b.value[0] }) + a(
|
|
283
|
+
label: a(d)("workSchedule.title", { name: b.value[0] }) + a(J)(w.value, "month") + ` ${new Date(w.value).getFullYear()}`,
|
|
284
284
|
align: "center",
|
|
285
285
|
height: "34"
|
|
286
286
|
}, {
|
|
@@ -289,10 +289,10 @@ const Je = { class: "work" }, Qe = { class: "nav" }, Ke = { style: { height: "10
|
|
|
289
289
|
label: a(d)("workSchedule.month"),
|
|
290
290
|
width: "180",
|
|
291
291
|
align: "center",
|
|
292
|
-
fixed:
|
|
292
|
+
fixed: O.value !== "100%"
|
|
293
293
|
}, {
|
|
294
294
|
default: v((t) => [
|
|
295
|
-
y("div",
|
|
295
|
+
y("div", Qe, h(n.value[t.$index].name), 1)
|
|
296
296
|
]),
|
|
297
297
|
_: 1
|
|
298
298
|
}, 8, ["label", "fixed"]),
|
|
@@ -321,7 +321,7 @@ const Je = { class: "work" }, Qe = { class: "nav" }, Ke = { style: { height: "10
|
|
|
321
321
|
i(a(Y), {
|
|
322
322
|
label: a(d)("workSchedule.onSchedule"),
|
|
323
323
|
align: "center",
|
|
324
|
-
fixed:
|
|
324
|
+
fixed: O.value !== "100%" ? "right" : !1
|
|
325
325
|
}, {
|
|
326
326
|
default: v(() => [
|
|
327
327
|
i(a(Y), {
|
|
@@ -372,7 +372,7 @@ const Je = { class: "work" }, Qe = { class: "nav" }, Ke = { style: { height: "10
|
|
|
372
372
|
y("span", null, h(H.fullName), 1)
|
|
373
373
|
])) : _("", !0),
|
|
374
374
|
Be((S(), F(a(T), {
|
|
375
|
-
disabled:
|
|
375
|
+
disabled: K.value,
|
|
376
376
|
plain: "",
|
|
377
377
|
onClick: Me,
|
|
378
378
|
style: { "margin-top": ".5rem" }
|
|
@@ -382,7 +382,7 @@ const Je = { class: "work" }, Qe = { class: "nav" }, Ke = { style: { height: "10
|
|
|
382
382
|
]),
|
|
383
383
|
_: 1
|
|
384
384
|
}, 8, ["disabled"])), [
|
|
385
|
-
[m,
|
|
385
|
+
[m, K.value]
|
|
386
386
|
]),
|
|
387
387
|
i(a(je), {
|
|
388
388
|
title: a(d)("workSchedule.jobTitle"),
|
|
@@ -437,14 +437,14 @@ const Je = { class: "work" }, Qe = { class: "nav" }, Ke = { style: { height: "10
|
|
|
437
437
|
_: 1
|
|
438
438
|
}, 8, ["title", "modelValue"]),
|
|
439
439
|
i(a(Ze), {
|
|
440
|
-
show:
|
|
441
|
-
"onUpdate:show": e[20] || (e[20] = (t) =>
|
|
440
|
+
show: j.value,
|
|
441
|
+
"onUpdate:show": e[20] || (e[20] = (t) => j.value = t),
|
|
442
442
|
options: ne.value
|
|
443
443
|
}, {
|
|
444
444
|
default: v(() => [
|
|
445
445
|
y("div", {
|
|
446
446
|
class: "mx-context-menu-item",
|
|
447
|
-
onClick: e[8] || (e[8] = (t) =>
|
|
447
|
+
onClick: e[8] || (e[8] = (t) => j.value = !1)
|
|
448
448
|
}, [
|
|
449
449
|
y("span", el, h(p.value.name), 1),
|
|
450
450
|
e[23] || (e[23] = y("div", { class: "expander" }, null, -1)),
|
|
@@ -475,7 +475,7 @@ const Je = { class: "work" }, Qe = { class: "nav" }, Ke = { style: { height: "10
|
|
|
475
475
|
}, 8, ["modelValue"]),
|
|
476
476
|
e[24] || (e[24] = y("br", null, null, -1)),
|
|
477
477
|
y("span", null, h(a(d)("workSchedule.fromDate")) + ":", 1),
|
|
478
|
-
i(a(
|
|
478
|
+
i(a(q), {
|
|
479
479
|
modelValue: W.value,
|
|
480
480
|
"onUpdate:modelValue": e[10] || (e[10] = (t) => W.value = t),
|
|
481
481
|
step: 1,
|
|
@@ -483,7 +483,7 @@ const Je = { class: "work" }, Qe = { class: "nav" }, Ke = { style: { height: "10
|
|
|
483
483
|
max: u.value.length
|
|
484
484
|
}, null, 8, ["modelValue", "max"]),
|
|
485
485
|
y("span", null, h(a(d)("workSchedule.with")) + ":", 1),
|
|
486
|
-
i(a(
|
|
486
|
+
i(a(q), {
|
|
487
487
|
modelValue: k.value,
|
|
488
488
|
"onUpdate:modelValue": e[11] || (e[11] = (t) => k.value = t),
|
|
489
489
|
step: 1,
|
|
@@ -491,7 +491,7 @@ const Je = { class: "work" }, Qe = { class: "nav" }, Ke = { style: { height: "10
|
|
|
491
491
|
max: 19
|
|
492
492
|
}, null, 8, ["modelValue"]),
|
|
493
493
|
y("span", null, h(a(d)("workSchedule.duration")) + ":", 1),
|
|
494
|
-
i(a(
|
|
494
|
+
i(a(q), {
|
|
495
495
|
modelValue: f.value,
|
|
496
496
|
"onUpdate:modelValue": e[12] || (e[12] = (t) => f.value = t),
|
|
497
497
|
step: 1,
|
|
@@ -522,7 +522,7 @@ const Je = { class: "work" }, Qe = { class: "nav" }, Ke = { style: { height: "10
|
|
|
522
522
|
y("div", null, h(pe(p.value.day, p.value.ids)), 1),
|
|
523
523
|
e[25] || (e[25] = y("br", null, null, -1)),
|
|
524
524
|
y("span", null, h(a(d)("workSchedule.with")) + ":", 1),
|
|
525
|
-
i(a(
|
|
525
|
+
i(a(q), {
|
|
526
526
|
modelValue: k.value,
|
|
527
527
|
"onUpdate:modelValue": e[15] || (e[15] = (t) => k.value = t),
|
|
528
528
|
step: 1,
|
|
@@ -531,7 +531,7 @@ const Je = { class: "work" }, Qe = { class: "nav" }, Ke = { style: { height: "10
|
|
|
531
531
|
onChange: e[16] || (e[16] = (t) => fe(p.value.day, p.value.ids))
|
|
532
532
|
}, null, 8, ["modelValue"]),
|
|
533
533
|
y("span", null, h(a(d)("workSchedule.duration")) + ":", 1),
|
|
534
|
-
i(a(
|
|
534
|
+
i(a(q), {
|
|
535
535
|
modelValue: f.value,
|
|
536
536
|
"onUpdate:modelValue": e[17] || (e[17] = (t) => f.value = t),
|
|
537
537
|
step: 1,
|
package/dist/employees.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.work>.nav{display:flex;gap:.5rem;margin-bottom:.5rem;flex-wrap:wrap}.work>.nav .expander{display:inline-block;height:1em;width:1em;flex-grow:3}.wrapper[data-v-d1aa0363]{display:flex}.wrapper .month_year[data-v-d1aa0363]{display:flex;justify-content:space-around;align-items:center}.wrapper .month_year span:not(.text) button[data-v-d1aa0363]{font-size:1.3em}.wrapper>div[data-v-d1aa0363]:not(:first-child){margin-left:2rem}.wrapper button[data-v-d1aa0363]{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-d1aa0363]:hover:not(.disabled):not(.active){color:var(--el-color-success)}.wrapper .week[data-v-d1aa0363]{border-bottom:1px solid var(--el-color-info);margin-bottom:.5rem}.wrapper .month[data-v-d1aa0363],.wrapper .week[data-v-d1aa0363]{width:250px;display:grid;grid-template-columns:1fr 1fr 1fr 1fr 1fr 1fr 1fr;gap:.2rem}.wrapper .month>button[data-v-d1aa0363],.wrapper .week>button[data-v-d1aa0363]{width:30px}.wrapper .month>button.disabled[data-v-d1aa0363],.wrapper .week>button.disabled[data-v-d1aa0363]{color:var(--el-color-info);cursor:not-allowed}.wrapper .month>button.preholiday[data-v-d1aa0363],.wrapper .week>button.preholiday[data-v-d1aa0363]{background-color:#ffe78070}.wrapper .month>button.weekend[data-v-d1aa0363],.wrapper .week>button.weekend[data-v-d1aa0363]{background-color:#ff808070}.wrapper .month>button.select[data-v-d1aa0363],.wrapper .week>button.select[data-v-d1aa0363]{background-color:#007bff70}.wrapper .month>button.holiday[data-v-d1aa0363],.wrapper .week>button.holiday[data-v-d1aa0363]{background-color:red}.wrapper .month>button.nowork[data-v-d1aa0363],.wrapper .week>button.nowork[data-v-d1aa0363]{background-color:red}.wrapper .month>button.active[data-v-d1aa0363],.wrapper .week>button.active[data-v-d1aa0363]{background-color:#007bff}.noBorder .el-input__wrapper{box-shadow:none}.wrap .mx-context-menu-item{flex-wrap:wrap;max-width:250px}.turn{writing-mode:vertical-rl;text-orientation:sideways;border-left:var(--el-table-border);transform:rotate(180deg)}.el-table tbody .cell{padding:0 1px}.nav{display:flex;gap:.5rem;margin-bottom:.5rem;flex-wrap:wrap}.nav .expander{display:inline-block;height:1em;width:1em;flex-grow:3}.sw-popover{min-width:20rem;width:50%;background:var(--el-bg-color);border-radius:var(--el-border-radius-base);box-shadow:var(--el-box-shadow);padding:1rem;overflow-wrap:break-word;border:none}.sw-popover>header{padding-bottom:1rem;line-height:var(--el-font-line-height-primary);font-size:var(--el-font-size-large);color:var(--el-text-color-primary)}.sw-popover>footer{padding-top:1rem;text-align:right;box-sizing:border-box}
|
|
1
|
+
.work>.nav{display:flex;gap:.5rem;margin-bottom:.5rem;flex-wrap:wrap;align-items:center}.work>.nav .expander{display:inline-block;height:1em;width:1em;flex-grow:3}.wrapper[data-v-d1aa0363]{display:flex}.wrapper .month_year[data-v-d1aa0363]{display:flex;justify-content:space-around;align-items:center}.wrapper .month_year span:not(.text) button[data-v-d1aa0363]{font-size:1.3em}.wrapper>div[data-v-d1aa0363]:not(:first-child){margin-left:2rem}.wrapper button[data-v-d1aa0363]{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-d1aa0363]:hover:not(.disabled):not(.active){color:var(--el-color-success)}.wrapper .week[data-v-d1aa0363]{border-bottom:1px solid var(--el-color-info);margin-bottom:.5rem}.wrapper .month[data-v-d1aa0363],.wrapper .week[data-v-d1aa0363]{width:250px;display:grid;grid-template-columns:1fr 1fr 1fr 1fr 1fr 1fr 1fr;gap:.2rem}.wrapper .month>button[data-v-d1aa0363],.wrapper .week>button[data-v-d1aa0363]{width:30px}.wrapper .month>button.disabled[data-v-d1aa0363],.wrapper .week>button.disabled[data-v-d1aa0363]{color:var(--el-color-info);cursor:not-allowed}.wrapper .month>button.preholiday[data-v-d1aa0363],.wrapper .week>button.preholiday[data-v-d1aa0363]{background-color:#ffe78070}.wrapper .month>button.weekend[data-v-d1aa0363],.wrapper .week>button.weekend[data-v-d1aa0363]{background-color:#ff808070}.wrapper .month>button.select[data-v-d1aa0363],.wrapper .week>button.select[data-v-d1aa0363]{background-color:#007bff70}.wrapper .month>button.holiday[data-v-d1aa0363],.wrapper .week>button.holiday[data-v-d1aa0363]{background-color:red}.wrapper .month>button.nowork[data-v-d1aa0363],.wrapper .week>button.nowork[data-v-d1aa0363]{background-color:red}.wrapper .month>button.active[data-v-d1aa0363],.wrapper .week>button.active[data-v-d1aa0363]{background-color:#007bff}.noBorder .el-input__wrapper{box-shadow:none}.wrap .mx-context-menu-item{flex-wrap:wrap;max-width:250px}.turn{writing-mode:vertical-rl;text-orientation:sideways;border-left:var(--el-table-border);transform:rotate(180deg)}.el-table tbody .cell{padding:0 1px}.nav{display:flex;gap:.5rem;margin-bottom:.5rem;flex-wrap:wrap;align-items:center}.nav .expander{display:inline-block;height:1em;width:1em;flex-grow:3}.sw-popover{min-width:20rem;width:50%;background:var(--el-bg-color);border-radius:var(--el-border-radius-base);box-shadow:var(--el-box-shadow);padding:1rem;overflow-wrap:break-word;border:none}.sw-popover>header{padding-bottom:1rem;line-height:var(--el-font-line-height-primary);font-size:var(--el-font-size-large);color:var(--el-text-color-primary)}.sw-popover>footer{padding-top:1rem;text-align:right;box-sizing:border-box}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@studio-west/employees",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.53",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist"
|
|
6
6
|
],
|
|
@@ -35,6 +35,8 @@
|
|
|
35
35
|
"author": "Alexander Efimov",
|
|
36
36
|
"license": "Commercial",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@studio-west/component-sw": "^0.10.
|
|
38
|
+
"@studio-west/component-sw": "^0.10.13",
|
|
39
|
+
"js-cookie": "^3.0.5",
|
|
40
|
+
"vue": "^3.5.25"
|
|
39
41
|
}
|
|
40
42
|
}
|