@studio-west/employees 0.7.7 → 0.7.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/WorkTable.cjs +4 -4
- package/dist/WorkTable.js +68 -68
- package/package.json +2 -2
package/dist/WorkTable.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),he=require("file-saver"),fe=require("exceljs"),v=require("./index-uKIn9vG1.cjs"),pe=require("vue-i18n"),i=require("element-plus"),oe=require("@imengyu/vue3-context-menu");function ye(V){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(V){for(const D in V)if(D!=="default"){const m=Object.getOwnPropertyDescriptor(V,D);Object.defineProperty(r,D,m.get?m:{enumerable:!0,get:()=>V[D]})}}return r.default=V,Object.freeze(r)}const we=ye(fe),ke={class:"work"},Ce={class:"nav"},Ve={style:{height:"100px",width:"100%",display:"inline-block"}},Se={style:{height:"100px",width:"100%",display:"inline-block"}},xe={key:0,class:"controls-container",style:{"margin-top":".5rem"}},De={class:"label"},Ne={key:0,style:{padding:"0.5em 1.5em"}},be={key:1,style:{padding:"0.5em 1.5em"}},Ee={__name:"WorkTable",props:{checkEdit:{type:Boolean,default:()=>!0},odata:Object,workSchedule:Object,fullName:{type:String,default:"Вы"},query:Object},setup(V){var _,ee,le,te,ae,ne;const{t:r,d:D}=pe.useI18n(),m=V,
|
|
2
|
-
`+((N=n.value[l].days[s])==null?void 0:N.time)},Z=()=>{n.value=[],j.value=[],A.value=[],m.odata.personal.forEach(t=>{if(S.value.includes(t.divisionName)&&E.value.some(l=>l.val&&l.activeText===t.roleName)&&(t.dismissalDate.length===0||new Date(t.dismissalDate)>new Date(f.value))){let l=v.byInitials(t.employeeName);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,j.value.push(t.code)}),m.workSchedule.getUsersYear({code:j.value,year:new Date(f.value).getFullYear()}).then(t=>{t.forEach(l=>{l.dateStart&&A.value.push({code:l.code,dateStart:l.dateStart,dateEnd:l.dateEnd})}),de(),M.value=!1})},de=()=>{m.workSchedule.getWorkSchedule({code:j.value,date:v.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)}),
|
|
3
|
-
`+(c-1),l.getColumn(c).width=6,l.getColumn(c).alignment=s,l.getCell(4,c).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(u.value.length+6).width=13,l.getColumn(1).alignment=s,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=s,l.getColumn(u.value.length+3).alignment=s,l.getColumn(u.value.length+4).alignment=s,l.getColumn(u.value.length+5).alignment=s,l.getColumn(u.value.length+6).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(3,u.value.length+6).border=d,l.getCell(4,u.value.length+3).border=d;let a=0;for(const c of n.value){let C=[c.name];for(let h=1;h<=u.value.length;h++){const{ind:
|
|
4
|
-
`+a.day.toString(),prop:"vacation"},{default:e.withCtx(w=>[e.createElementVNode("div",Se,e.toDisplayString(K(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:
|
|
1
|
+
"use strict";const e=require("vue"),he=require("file-saver"),fe=require("exceljs"),v=require("./index-uKIn9vG1.cjs"),pe=require("vue-i18n"),i=require("element-plus"),oe=require("@imengyu/vue3-context-menu");function ye(V){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(V){for(const D in V)if(D!=="default"){const m=Object.getOwnPropertyDescriptor(V,D);Object.defineProperty(r,D,m.get?m:{enumerable:!0,get:()=>V[D]})}}return r.default=V,Object.freeze(r)}const we=ye(fe),ke={class:"work"},Ce={class:"nav"},Ve={style:{height:"100px",width:"100%",display:"inline-block"}},Se={style:{height:"100px",width:"100%",display:"inline-block"}},xe={key:0,class:"controls-container",style:{"margin-top":".5rem"}},De={class:"label"},Ne={key:0,style:{padding:"0.5em 1.5em"}},be={key:1,style:{padding:"0.5em 1.5em"}},Ee={__name:"WorkTable",props:{checkEdit:{type:Boolean,default:()=>!0},odata:Object,workSchedule:Object,fullName:{type:String,default:"Вы"},query:Object},setup(V){var _,ee,le,te,ae,ne;const{t:r,d:D}=pe.useI18n(),m=V,R=e.ref(!1),n=e.ref([]),P=e.ref((_=m.query)!=null&&_.date?new Date(((ee=m.query)==null?void 0:ee.date)+"T00:00:01").getMonth():new Date().getMonth()),W=e.ref(!1),A=e.ref([]),f=e.ref(new Date(new Date().getFullYear(),new Date().getMonth(),1)),u=e.ref([]),b=e.ref([0,0]),y=e.ref(9),p=e.ref(8),F=e.ref(!1),M=e.ref(!1),L=e.ref("5"),z=e.ref(1),S=e.ref([]),G=e.ref([]),E=e.ref([]),j=e.ref([]),g=e.ref({name:"Имя",length:0,code:""}),q=e.ref(!1),J=e.ref({zIndex:3,minWidth:230,x:500,y:200}),x=e.ref({}),Y=e.ref("100%");e.watch(S,async(t,l)=>{t!==l&&(E.value=[],F.value=!1,m.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}))}),Z())}),e.watch(P,async t=>{let l=new Date().getMonth(),o=t===null?l:t-1;o=l-1<=o?o-l>=11?o-12:o:o+12,f.value=new Date(new Date().getFullYear(),o,1),F.value=!1,Q()});const ue=(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,J.value.y=d.clientY,J.value.x=d.clientX,l.level===2&&l.no===0&&m.checkEdit&&(g.value.name=r("workSchedule.autocomplete"),q.value=!0),l.level===3&&o.cellIndex-l.no===1&&m.checkEdit&&(B(o.cellIndex,t.ids),g.value.name=r("workSchedule.modeSelection"),q.value=!0)},re=({row:t,columnIndex:l})=>{if(!A.value||A.value.length===0||!W.value)return"";const o=new Date(new Date(f.value).getFullYear(),new Date(f.value).getMonth(),l).getTime()+1e3;for(let d of A.value){const{dateStart:s,dateEnd:a,code:w}=d;if(s&&a&&w===t.code&&l!==0&&l<=u.value.length){const N=new Date(v.parseDate(s)).getTime(),$=new Date(v.parseDate(a)).getTime();if(o>=N&&o<=$)return"vacation"}}return""},Q=()=>{var a,w,N,$,H,c;const t=new Date(f.value),l=new Date(t.getFullYear(),t.getMonth()+1,0).getDate();let o=[],d=0,s=0;for(let C=1;C<=l;C++){const k=v.parseTime(t.setDate(C),"{Y}-{m}-{dd}");d+=(a=x.value.nowork)!=null&&a.includes(k)||x.value.holidays.includes(k)?0:(w=x.value.preholidays)!=null&&w.includes(k)?7:8,s+=(N=x.value.nowork)!=null&&N.includes(k)||x.value.holidays.includes(k)?0:($=x.value.preholidays)!=null&&$.includes(k)?6:7;const h=(H=x.value.nowork)!=null&&H.includes(k)?"nowork":x.value.holidays.includes(k)?"holiday":(c=x.value.preholidays)!=null&&c.includes(k)?"preholiday":"";o.push({day:C,holidays:h,weekday:D(new Date(t.getFullYear(),t.getMonth(),C),"day")})}b.value[0]=d,b.value[1]=s,u.value=o,m.odata.getPersonal({dismissed:"false"}).then(C=>{var k;S.value.length===0&&(S.value=[(k=C.find(h=>h.employeeName===m.fullName&&h.dismissalDate.length===0))==null?void 0:k.divisionName]),C.forEach((h,I)=>{G.value.some(T=>h.dismissalDate.length>0&&new Date(h.dismissalDate)<new Date(f.value)||(T==null?void 0:T.value)===h.divisionName)||G.value.push({value:h.divisionName,label:h.divisionName,key:I}),S.value.includes(h.divisionName)&&!E.value.some(T=>(T==null?void 0:T.activeText)===h.roleName)&&E.value.push({val:!0,activeText:h.roleName})}),Z()})},ie=e.computed(()=>!n.value.some(t=>t.contHour!==b.value[0]&&t.contHour!==b.value[1])),K=(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")}`,s=(a=n.value[l])==null?void 0:a.days.findIndex($=>$.day===d);return l===-1||s===-1?"":((w=n.value[l].days[s])==null?void 0:w.tips)+`
|
|
2
|
+
`+((N=n.value[l].days[s])==null?void 0:N.time)},Z=()=>{n.value=[],j.value=[],A.value=[],m.odata.personal.forEach(t=>{if(S.value.includes(t.divisionName)&&E.value.some(l=>l.val&&l.activeText===t.roleName)&&(t.dismissalDate.length===0||new Date(t.dismissalDate)>new Date(f.value))){let l=v.byInitials(t.employeeName);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,j.value.push(t.code)}),m.workSchedule.getUsersYear({code:j.value,year:new Date(f.value).getFullYear()}).then(t=>{t.forEach(l=>{l.dateStart&&A.value.push({code:l.code,dateStart:l.dateStart,dateEnd:l.dateEnd})}),de(),M.value=!1})},de=()=>{m.workSchedule.getWorkSchedule({code:j.value,date:v.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)}),U()})},U=()=>{n.value.forEach(t=>{t.contHour=t.days.reduce((l,o)=>l+o.time,0)})},se=t=>{n.value[t].days=[],U()},ve=t=>{switch(L.value){case"5":for(let l=z.value;l<=u.value.length;l++)u.value[l-1].holidays===""&&B(l,t,!0),u.value[l-1].holidays==="preholiday"&&(p.value-=1,B(l,t,!0),p.value+=1);break;case"2x2":for(let l=z.value;l<=u.value.length;l+=4)B(l,t,!0),l+1<=u.value.length&&B(l+1,t,!0);break;case"2x5":for(let l=z.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,B(o,t,!0),p.value+=1):B(o,t,!0);break}},B=(t,l,o=!1)=>{const{date:d,ind:s}=O(t,l);s===-1?(n.value[l].days.push({day:d,time:p.value,tips:`(${y.value}:00 - ${p.value>=22?y.value+p.value+2:y.value+p.value+1}:00)`}),U()):o||(p.value=n.value[l].days[s].time,y.value=parseInt(n.value[l].days[s].tips.slice(1,-12)))},ce=(t,l)=>{const{ind:o}=O(t,l);n.value[l].days.splice(o,1),U(),document.querySelector(".app-main").click()},X=(t,l)=>{const{date:o,ind:d}=O(t,l);n.value[l].days[d]={day:o,time:p.value,tips:`(${y.value}:00 - ${p.value>=22?y.value+p.value+2:y.value+p.value+1}:00)`},U()},O=(t,l)=>{var s;const o=v.parseTime(new Date(f.value).setDate(t),"{Y}-{m}-{dd}"),d=(s=n.value[l])==null?void 0:s.days.findIndex(a=>a.day===o);return{date:o,ind:d}},me=async()=>{var H;R.value=!0;const t=new we.Workbook,l=t.addWorksheet(D(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"}},s={vertical:"middle",horizontal:"center",wrapText:!0};l.mergeCells(`A1:${v.cellsDynamically("A1",u.value.length+6)}1`),l.mergeCells(`A2:${v.cellsDynamically("A2",u.value.length+6)}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.mergeCells(`${v.cellsDynamically("B3",u.value.length+5)}3:${v.cellsDynamically("B4",u.value.length+5)}4`),l.getCell("A1").value=r("workSchedule.firm"),l.getCell("A2").value=r("workSchedule.title",{name:S.value[0]})+D(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.decryption"),l.getCell(3,u.value.length+6).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")} (${b.value[0]})`;for(let c=2;c<=u.value.length+1;c++)l.getCell(4,c).value=u.value[c-2].weekday+`
|
|
3
|
+
`+(c-1),l.getColumn(c).width=6,l.getColumn(c).alignment=s,l.getCell(4,c).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(u.value.length+6).width=13,l.getColumn(1).alignment=s,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=s,l.getColumn(u.value.length+3).alignment=s,l.getColumn(u.value.length+4).alignment=s,l.getColumn(u.value.length+5).alignment=s,l.getColumn(u.value.length+6).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(3,u.value.length+6).border=d,l.getCell(4,u.value.length+3).border=d;let a=0;for(const c of n.value){let C=[c.name];for(let h=1;h<=u.value.length;h++){const{ind:I}=O(h,a);I!==-1?C[h]=`${c.days[I].time} ${c.days[I].tips}`:C[h]=" "}C.push(((H=c.days)==null?void 0:H.length)||" ",c.contHour||0);const k=l.addRow(C);k.border=d,a++}let w="Щербина Е. В.";m.odata.personal.forEach(c=>{c.roleName==="Начальник отдела правовой и кадровой работы"&&(c.dismissalDate.length===0||new Date(c.dismissalDate)>new Date(thisMonth.value))&&(w=c.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(m.fullName),l.getCell(`AD${n.value.length+8}`).value=v.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_"+v.parseTime(Date.now(),"{dd}.{m}.{Y}")+".xlsx",$=await t.xlsx.writeBuffer();he.saveAs(new Blob([$]),N),R.value=!1},ge=async()=>{F.value||m.workSchedule.addWorkSchedule({data:n.value,date:v.parseTime(new Date(f.value),"{Y}-{m}-{dd}"),group:S.value[0]}).then(t=>F.value=t)};return(((le=m.query)==null?void 0:le.group)??!1)&&(S.value[0]=(te=m.query)==null?void 0:te.group),(((ae=m.query)==null?void 0:ae.date)??!1)&&(f.value=new Date(((ne=m.query)==null?void 0:ne.date)+"T00:00:01")),v.holidays().then(t=>{x.value=t,Q()}),(t,l)=>{const o=e.resolveComponent("el-date-picker"),d=e.resolveComponent("svg-icon"),s=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",ke,[e.createElementVNode("div",Ce,[V.checkEdit?(e.openBlock(),e.createBlock(e.unref(i.ElSelect),{key:0,modelValue:S.value,"onUpdate:modelValue":l[0]||(l[0]=a=>S.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(G.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),V.checkEdit?(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:1,plain:"",onClick:l[1]||(l[1]=a=>M.value=!0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.jobTitle")),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(o,{modelValue:P.value,"onUpdate:modelValue":l[2]||(l[2]=a=>P.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:Y.value,"onUpdate:modelValue":l[3]||(l[3]=a=>Y.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:W.value,"onUpdate:modelValue":l[4]||(l[4]=a=>W.value=a),"active-text":"Отпуска","active-value":!0,"inactive-value":!1},null,8,["modelValue"])]),e.createVNode(e.unref(i.ElTable),{id:"printTable",data:n.value,style:{width:"100%"},"max-height":Y.value,size:"small",align:"center",onCellClick:ue,"empty-text":e.unref(r)("workSchedule.emptyText"),"cell-class-name":re},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.title",{name:S.value[0]})+e.unref(D)(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:Y.value!=="100%"},{default:e.withCtx(a=>[e.createElementVNode("div",Ve,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:`${f.value.getTime()}-${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",Se,e.toDisplayString(K(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:Y.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")} ( ${b.value[0]} / ${b.value[1]} )`,align:"center"},{default:e.withCtx(a=>[e.createElementVNode("div",{style:e.normalizeStyle(`color: ${b.value.includes(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"]),ie.value&&V.checkEdit?(e.openBlock(),e.createElementBlock("div",xe,[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.chartsFilled"))+": ",1),F.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:0,type:"primary",onClick:ge},{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(V.fullName),1)])):e.createCommentVNode("",!0),e.withDirectives((e.openBlock(),e.createBlock(e.unref(i.ElButton),{disabled:R.value,plain:"",onClick:me,style:{"margin-top":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.exportExcel")),1)]),_:1},8,["disabled"])),[[s,R.value]]),e.createVNode(e.unref(i.ElDialog),{title:e.unref(r)("workSchedule.jobTitle"),modelValue:M.value,"onUpdate:modelValue":l[7]||(l[7]=a=>M.value=a),width:"400px"},{footer:e.withCtx(()=>[e.createVNode(e.unref(i.ElButton),{onClick:l[5]||(l[5]=a=>M.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=>{Z(),M.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(oe.ContextMenu),{show:q.value,"onUpdate:show":l[20]||(l[20]=a=>q.value=a),options:J.value},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"mx-context-menu-item",onClick:l[8]||(l[8]=a=>q.value=!1)},[e.createElementVNode("span",De,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(oe.ContextMenuSeparator)),g.value.level===2?(e.openBlock(),e.createElementBlock("div",Ne,[e.createVNode(e.unref(i.ElRadioGroup),{modelValue:L.value,"onUpdate:modelValue":l[9]||(l[9]=a=>L.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:z.value,"onUpdate:modelValue":l[10]||(l[10]=a=>z.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:y.value,"onUpdate:modelValue":l[11]||(l[11]=a=>y.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:p.value,"onUpdate:modelValue":l[12]||(l[12]=a=>p.value=a),step:1,min:4,max:e.unref(v.clamp)(y.value!==1?23-y.value:21,4,22)},null,8,["modelValue","max"]),e.createVNode(e.unref(i.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:l[13]||(l[13]=a=>ve(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=>se(g.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.clearRow")),1)]),_:1})])):(e.openBlock(),e.createElementBlock("div",be,[e.createElementVNode("div",null,e.toDisplayString(K(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:y.value,"onUpdate:modelValue":l[15]||(l[15]=a=>y.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:p.value,"onUpdate:modelValue":l[17]||(l[17]=a=>p.value=a),step:1,min:4,max:e.unref(v.clamp)(y.value!==1?23-y.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=>ce(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=Ee;
|
package/dist/WorkTable.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ref as v, watch as Se, computed as Ye, resolveComponent as be, resolveDirective as Ue, createElementBlock as U, openBlock as b, createElementVNode as k, createVNode as r, createCommentVNode as ae, withDirectives as He, createBlock as H, unref as t, withCtx as g, Fragment as re, renderList as se, createTextVNode as V, toDisplayString as h, normalizeStyle as Ie } from "vue";
|
|
2
2
|
import { saveAs as qe } from "file-saver";
|
|
3
3
|
import * as Re from "exceljs";
|
|
4
|
-
import { p as
|
|
4
|
+
import { p as Q, b as ve, h as We, c as xe, a as De, d as E } from "./index-DaZTfcYO.js";
|
|
5
5
|
import { useI18n as je } from "vue-i18n";
|
|
6
|
-
import { ElSelect as Pe, ElOption as Oe, ElButton as z, ElSwitch as ge, ElTable as Ge, ElTableColumn as I, ElDialog as Le, ElForm as Ze, ElFormItem as Je, ElRadioGroup as Qe, ElRadioButton as me, ElSlider as
|
|
6
|
+
import { ElSelect as Pe, ElOption as Oe, ElButton as z, ElSwitch as ge, ElTable as Ge, ElTableColumn as I, ElDialog as Le, ElForm as Ze, ElFormItem as Je, ElRadioGroup as Qe, ElRadioButton as me, ElSlider as K } from "element-plus";
|
|
7
7
|
import { ContextMenu as Ke, ContextMenuSeparator as Xe } from "@imengyu/vue3-context-menu";
|
|
8
8
|
const _e = { class: "work" }, el = { class: "nav" }, ll = { style: { height: "100px", width: "100%", display: "inline-block" } }, al = { style: { height: "100px", width: "100%", display: "inline-block" } }, tl = {
|
|
9
9
|
key: 0,
|
|
@@ -25,8 +25,8 @@ const _e = { class: "work" }, el = { class: "nav" }, ll = { style: { height: "10
|
|
|
25
25
|
query: Object
|
|
26
26
|
},
|
|
27
27
|
setup(R) {
|
|
28
|
-
var
|
|
29
|
-
const { t: d, d:
|
|
28
|
+
var fe, ye, we, ke, Ce, $e;
|
|
29
|
+
const { t: d, d: X } = je(), y = R, _ = v(!1), n = v([
|
|
30
30
|
// { name: 'Иванов П.М. (Ведущий работник месяца)',
|
|
31
31
|
// days: [], // {day: "2024-11-01", tips: '(9:00 - 18:00)', time: 8 }
|
|
32
32
|
// contHour: 0,
|
|
@@ -39,25 +39,25 @@ const _e = { class: "work" }, el = { class: "nav" }, ll = { style: { height: "10
|
|
|
39
39
|
// code: '0000-00052'
|
|
40
40
|
// ids: 1
|
|
41
41
|
// }
|
|
42
|
-
]), te = v((
|
|
42
|
+
]), te = v((fe = y.query) != null && fe.date ? (/* @__PURE__ */ new Date(((ye = y.query) == null ? void 0 : ye.date) + "T00:00:01")).getMonth() : (/* @__PURE__ */ new Date()).getMonth()), ne = v(!1), W = v([]), f = v(new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1)), o = v([]), T = v([0, 0]), C = v(9), w = v(8), j = v(!1), q = v(!1), ue = v("5"), P = v(1), D = v([]), oe = v([]), A = v([]), ee = v([]), c = v({ name: "Имя", length: 0, code: "" }), O = v(!1), de = v({
|
|
43
43
|
zIndex: 3,
|
|
44
44
|
minWidth: 230,
|
|
45
45
|
x: 500,
|
|
46
46
|
y: 200
|
|
47
|
-
}), M = v({}),
|
|
47
|
+
}), M = v({}), G = v("100%");
|
|
48
48
|
Se(D, async (l, e) => {
|
|
49
|
-
l !== e && (A.value = [],
|
|
49
|
+
l !== e && (A.value = [], j.value = !1, y.odata.personal.forEach((u) => {
|
|
50
50
|
l.includes(u.divisionName) && (A.value.some((i) => (i == null ? void 0 : i.activeText) === u.roleName) || A.value.push({ val: !0, activeText: u.roleName }));
|
|
51
51
|
}), ie());
|
|
52
52
|
}), Se(te, async (l) => {
|
|
53
53
|
let e = (/* @__PURE__ */ new Date()).getMonth(), u = l === null ? e : l - 1;
|
|
54
|
-
u = e - 1 <= u ? u - e >= 11 ? u - 12 : u : u + 12,
|
|
54
|
+
u = e - 1 <= u ? u - e >= 11 ? u - 12 : u : u + 12, f.value = new Date((/* @__PURE__ */ new Date()).getFullYear(), u, 1), j.value = !1, he();
|
|
55
55
|
});
|
|
56
56
|
const Ve = (l, e, u, i) => {
|
|
57
|
-
c.value.ids = l.ids, c.value.key = l.key, c.value.add = l.days.length > 0 && l.days[l.days.length - 1].cont, c.value.level = e.level, c.value.day = u.cellIndex, de.value.y = i.clientY, de.value.x = i.clientX, e.level === 2 && e.no === 0 &&
|
|
57
|
+
c.value.ids = l.ids, c.value.key = l.key, c.value.add = l.days.length > 0 && l.days[l.days.length - 1].cont, c.value.level = e.level, c.value.day = u.cellIndex, de.value.y = i.clientY, de.value.x = i.clientX, e.level === 2 && e.no === 0 && y.checkEdit && (c.value.name = d("workSchedule.autocomplete"), O.value = !0), e.level === 3 && u.cellIndex - e.no === 1 && y.checkEdit && (F(u.cellIndex, l.ids), c.value.name = d("workSchedule.modeSelection"), O.value = !0);
|
|
58
58
|
}, Ee = ({ row: l, columnIndex: e }) => {
|
|
59
59
|
if (!W.value || W.value.length === 0 || !ne.value) return "";
|
|
60
|
-
const u = new Date(new Date(
|
|
60
|
+
const u = new Date(new Date(f.value).getFullYear(), new Date(f.value).getMonth(), e).getTime() + 1e3;
|
|
61
61
|
for (let i of W.value) {
|
|
62
62
|
const { dateStart: s, dateEnd: a, code: $ } = i;
|
|
63
63
|
if (s && a && $ === l.code && e !== 0 && e <= o.value.length) {
|
|
@@ -67,65 +67,65 @@ const _e = { class: "work" }, el = { class: "nav" }, ll = { style: { height: "10
|
|
|
67
67
|
}
|
|
68
68
|
return "";
|
|
69
69
|
}, he = () => {
|
|
70
|
-
var a, $, N, B,
|
|
71
|
-
const l = new Date(
|
|
70
|
+
var a, $, N, B, Z, m;
|
|
71
|
+
const l = new Date(f.value), e = new Date(l.getFullYear(), l.getMonth() + 1, 0).getDate();
|
|
72
72
|
let u = [], i = 0, s = 0;
|
|
73
73
|
for (let x = 1; x <= e; x++) {
|
|
74
|
-
const S =
|
|
74
|
+
const S = Q(l.setDate(x), "{Y}-{m}-{dd}");
|
|
75
75
|
i += (a = M.value.nowork) != null && a.includes(S) || M.value.holidays.includes(S) ? 0 : ($ = M.value.preholidays) != null && $.includes(S) ? 7 : 8, s += (N = M.value.nowork) != null && N.includes(S) || M.value.holidays.includes(S) ? 0 : (B = M.value.preholidays) != null && B.includes(S) ? 6 : 7;
|
|
76
|
-
const p = (
|
|
77
|
-
u.push({ day: x, holidays: p, weekday:
|
|
76
|
+
const p = (Z = M.value.nowork) != null && Z.includes(S) ? "nowork" : M.value.holidays.includes(S) ? "holiday" : (m = M.value.preholidays) != null && m.includes(S) ? "preholiday" : "";
|
|
77
|
+
u.push({ day: x, holidays: p, weekday: X(new Date(l.getFullYear(), l.getMonth(), x), "day") });
|
|
78
78
|
}
|
|
79
|
-
T.value[0] = i, T.value[1] = s, o.value = u,
|
|
79
|
+
T.value[0] = i, T.value[1] = s, o.value = u, y.odata.getPersonal({ dismissed: "false" }).then((x) => {
|
|
80
80
|
var S;
|
|
81
|
-
D.value.length === 0 && (D.value = [(S = x.find((p) => p.employeeName ===
|
|
82
|
-
oe.value.some((Y) => p.dismissalDate.length > 0 && new Date(p.dismissalDate) < new Date(
|
|
81
|
+
D.value.length === 0 && (D.value = [(S = x.find((p) => p.employeeName === y.fullName && p.dismissalDate.length === 0)) == null ? void 0 : S.divisionName]), x.forEach((p, J) => {
|
|
82
|
+
oe.value.some((Y) => p.dismissalDate.length > 0 && new Date(p.dismissalDate) < new Date(f.value) || (Y == null ? void 0 : Y.value) === p.divisionName) || oe.value.push({ value: p.divisionName, label: p.divisionName, key: J }), D.value.includes(p.divisionName) && !A.value.some((Y) => (Y == null ? void 0 : Y.activeText) === p.roleName) && A.value.push({ val: !0, activeText: p.roleName });
|
|
83
83
|
}), ie();
|
|
84
84
|
});
|
|
85
|
-
}, Me = Ye(() => !n.value.some((l) => l.contHour !== T.value[0]
|
|
85
|
+
}, Me = Ye(() => !n.value.some((l) => l.contHour !== T.value[0] && l.contHour !== T.value[1])), ce = (l, e) => {
|
|
86
86
|
var a, $, N;
|
|
87
|
-
const u = new Date(
|
|
87
|
+
const u = new Date(f.value), i = `${u.getFullYear()}-${(u.getMonth() + 1).toString().padStart(2, "0")}-${l.toString().padStart(2, "0")}`, s = (a = n.value[e]) == null ? void 0 : a.days.findIndex((B) => B.day === i);
|
|
88
88
|
return e === -1 || s === -1 ? "" : (($ = n.value[e].days[s]) == null ? void 0 : $.tips) + `
|
|
89
89
|
` + ((N = n.value[e].days[s]) == null ? void 0 : N.time);
|
|
90
90
|
}, ie = () => {
|
|
91
|
-
n.value = [], ee.value = [], W.value = [],
|
|
92
|
-
if (D.value.includes(l.divisionName) && A.value.some((e) => e.val && e.activeText === l.roleName) && (l.dismissalDate.length === 0 || new Date(l.dismissalDate) > new Date(
|
|
91
|
+
n.value = [], ee.value = [], W.value = [], y.odata.personal.forEach((l) => {
|
|
92
|
+
if (D.value.includes(l.divisionName) && A.value.some((e) => e.val && e.activeText === l.roleName) && (l.dismissalDate.length === 0 || new Date(l.dismissalDate) > new Date(f.value))) {
|
|
93
93
|
let e = ve(l.employeeName);
|
|
94
94
|
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
97
|
l.ids = e, ee.value.push(l.code);
|
|
98
|
-
}),
|
|
98
|
+
}), y.workSchedule.getUsersYear({ code: ee.value, year: new Date(f.value).getFullYear() }).then((l) => {
|
|
99
99
|
l.forEach((e) => {
|
|
100
100
|
e.dateStart && W.value.push({ code: e.code, dateStart: e.dateStart, dateEnd: e.dateEnd });
|
|
101
101
|
}), Ne(), q.value = !1;
|
|
102
102
|
});
|
|
103
103
|
}, Ne = () => {
|
|
104
|
-
|
|
104
|
+
y.workSchedule.getWorkSchedule({ code: ee.value, date: Q(new Date(f.value), "{Y}-{m}-{dd}") }).then(
|
|
105
105
|
(l) => {
|
|
106
106
|
l.forEach((e, u) => {
|
|
107
107
|
e !== null && (n.value[u].days = e.data.days, n.value[u].id = e.id);
|
|
108
|
-
}),
|
|
108
|
+
}), L();
|
|
109
109
|
}
|
|
110
110
|
);
|
|
111
|
-
},
|
|
111
|
+
}, L = () => {
|
|
112
112
|
n.value.forEach((l) => {
|
|
113
113
|
l.contHour = l.days.reduce((e, u) => e + u.time, 0);
|
|
114
114
|
});
|
|
115
115
|
}, Te = (l) => {
|
|
116
|
-
n.value[l].days = [],
|
|
116
|
+
n.value[l].days = [], L();
|
|
117
117
|
}, Ae = (l) => {
|
|
118
118
|
switch (ue.value) {
|
|
119
119
|
case "5":
|
|
120
|
-
for (let e =
|
|
120
|
+
for (let e = P.value; e <= o.value.length; e++)
|
|
121
121
|
o.value[e - 1].holidays === "" && F(e, l, !0), o.value[e - 1].holidays === "preholiday" && (w.value -= 1, F(e, l, !0), w.value += 1);
|
|
122
122
|
break;
|
|
123
123
|
case "2x2":
|
|
124
|
-
for (let e =
|
|
124
|
+
for (let e = P.value; e <= o.value.length; e += 4)
|
|
125
125
|
F(e, l, !0), e + 1 <= o.value.length && F(e + 1, l, !0);
|
|
126
126
|
break;
|
|
127
127
|
case "2x5":
|
|
128
|
-
for (let e =
|
|
128
|
+
for (let e = P.value; e <= o.value.length; e += 7)
|
|
129
129
|
for (let u = e; u < e + 5 && u <= o.value.length; u++)
|
|
130
130
|
o.value[u - 1].holidays === "preholiday" ? (w.value -= 1, F(u, l, !0), w.value += 1) : F(u, l, !0);
|
|
131
131
|
break;
|
|
@@ -136,26 +136,26 @@ const _e = { class: "work" }, el = { class: "nav" }, ll = { style: { height: "10
|
|
|
136
136
|
day: i,
|
|
137
137
|
time: w.value,
|
|
138
138
|
tips: `(${C.value}:00 - ${w.value >= 22 ? C.value + w.value + 2 : C.value + w.value + 1}:00)`
|
|
139
|
-
}),
|
|
139
|
+
}), L()) : u || (w.value = n.value[e].days[s].time, C.value = parseInt(n.value[e].days[s].tips.slice(1, -12)));
|
|
140
140
|
}, Be = (l, e) => {
|
|
141
141
|
const { ind: u } = le(l, e);
|
|
142
|
-
n.value[e].days.splice(u, 1),
|
|
142
|
+
n.value[e].days.splice(u, 1), L(), document.querySelector(".app-main").click();
|
|
143
143
|
}, pe = (l, e) => {
|
|
144
144
|
const { date: u, ind: i } = le(l, e);
|
|
145
145
|
n.value[e].days[i] = {
|
|
146
146
|
day: u,
|
|
147
147
|
time: w.value,
|
|
148
148
|
tips: `(${C.value}:00 - ${w.value >= 22 ? C.value + w.value + 2 : C.value + w.value + 1}:00)`
|
|
149
|
-
},
|
|
149
|
+
}, L();
|
|
150
150
|
}, le = (l, e) => {
|
|
151
151
|
var s;
|
|
152
|
-
const u =
|
|
152
|
+
const u = Q(new Date(f.value).setDate(l), "{Y}-{m}-{dd}"), i = (s = n.value[e]) == null ? void 0 : s.days.findIndex((a) => a.day === u);
|
|
153
153
|
return { date: u, ind: i };
|
|
154
154
|
}, ze = async () => {
|
|
155
|
-
var
|
|
156
|
-
|
|
157
|
-
const l = new Re.Workbook(), e = l.addWorksheet(
|
|
158
|
-
e.mergeCells(`A1:${E("A1", o.value.length + 6)}1`), e.mergeCells(`A2:${E("A2", o.value.length + 6)}2`), e.mergeCells("A3:A4"), e.mergeCells(`B3:${E("B3", o.value.length)}3`), e.mergeCells(`${E("B3", o.value.length + 1)}3:${E("B3", o.value.length + 2)}3`), e.mergeCells(`${E("B3", o.value.length + 3)}3:${E("B4", o.value.length + 3)}4`), e.mergeCells(`${E("B3", o.value.length + 4)}3:${E("B4", o.value.length + 4)}4`), e.mergeCells(`${E("B3", o.value.length + 5)}3:${E("B4", o.value.length + 5)}4`), e.getCell("A1").value = d("workSchedule.firm"), e.getCell("A2").value = d("workSchedule.title", { name: D.value[0] }) +
|
|
155
|
+
var Z;
|
|
156
|
+
_.value = !0;
|
|
157
|
+
const l = new Re.Workbook(), e = l.addWorksheet(X(f.value, "month"), { pageSetup: { paperSize: 9, orientation: "landscape", fitToPage: !0 } }), u = { vertical: "middle", horizontal: "center" }, i = { top: { style: "thin" }, left: { style: "thin" }, bottom: { style: "thin" }, right: { style: "thin" } }, s = { vertical: "middle", horizontal: "center", wrapText: !0 };
|
|
158
|
+
e.mergeCells(`A1:${E("A1", o.value.length + 6)}1`), e.mergeCells(`A2:${E("A2", o.value.length + 6)}2`), e.mergeCells("A3:A4"), e.mergeCells(`B3:${E("B3", o.value.length)}3`), e.mergeCells(`${E("B3", o.value.length + 1)}3:${E("B3", o.value.length + 2)}3`), e.mergeCells(`${E("B3", o.value.length + 3)}3:${E("B4", o.value.length + 3)}4`), e.mergeCells(`${E("B3", o.value.length + 4)}3:${E("B4", o.value.length + 4)}4`), e.mergeCells(`${E("B3", o.value.length + 5)}3:${E("B4", o.value.length + 5)}4`), e.getCell("A1").value = d("workSchedule.firm"), e.getCell("A2").value = d("workSchedule.title", { name: D.value[0] }) + X(f.value, "month") + ` ${new Date(f.value).getFullYear()}`, e.getCell("A3").value = d("workSchedule.month"), e.getCell("B3").value = d("workSchedule.numbersMonth"), e.getCell(3, o.value.length + 2).value = d("workSchedule.onSchedule"), e.getCell(3, o.value.length + 4).value = d("workSchedule.acquainted"), e.getCell(3, o.value.length + 5).value = d("workSchedule.decryption"), e.getCell(3, o.value.length + 6).value = d("workSchedule.date"), e.getCell(4, o.value.length + 2).value = d("workSchedule.days"), e.getCell(4, o.value.length + 3).value = `${d("workSchedule.hours")} (${T.value[0]})`;
|
|
159
159
|
for (let m = 2; m <= o.value.length + 1; m++)
|
|
160
160
|
e.getCell(4, m).value = o.value[m - 2].weekday + `
|
|
161
161
|
` + (m - 1), e.getColumn(m).width = 6, e.getColumn(m).alignment = s, e.getCell(4, m).border = i;
|
|
@@ -164,23 +164,23 @@ const _e = { class: "work" }, el = { class: "nav" }, ll = { style: { height: "10
|
|
|
164
164
|
for (const m of n.value) {
|
|
165
165
|
let x = [m.name];
|
|
166
166
|
for (let p = 1; p <= o.value.length; p++) {
|
|
167
|
-
const { ind:
|
|
168
|
-
|
|
167
|
+
const { ind: J } = le(p, a);
|
|
168
|
+
J !== -1 ? x[p] = `${m.days[J].time} ${m.days[J].tips}` : x[p] = " ";
|
|
169
169
|
}
|
|
170
|
-
x.push(((
|
|
170
|
+
x.push(((Z = m.days) == null ? void 0 : Z.length) || " ", m.contHour || 0);
|
|
171
171
|
const S = e.addRow(x);
|
|
172
172
|
S.border = i, a++;
|
|
173
173
|
}
|
|
174
174
|
let $ = "Щербина Е. В.";
|
|
175
|
-
|
|
175
|
+
y.odata.personal.forEach((m) => {
|
|
176
176
|
m.roleName === "Начальник отдела правовой и кадровой работы" && (m.dismissalDate.length === 0 || new Date(m.dismissalDate) > new Date(thisMonth.value)) && ($ = m.employeeName);
|
|
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 = ve(
|
|
178
|
-
const N = "export_" +
|
|
179
|
-
qe(new Blob([B]), N),
|
|
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 = ve(y.fullName), e.getCell(`AD${n.value.length + 8}`).value = ve($), 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 = u, e.getCell(`F${n.value.length + 8}`).border = { bottom: { style: "thin" } }, e.getCell(`W${n.value.length + 8}`).border = { bottom: { style: "thin" } };
|
|
178
|
+
const N = "export_" + Q(Date.now(), "{dd}.{m}.{Y}") + ".xlsx", B = await l.xlsx.writeBuffer();
|
|
179
|
+
qe(new Blob([B]), N), _.value = !1;
|
|
180
180
|
}, Fe = async () => {
|
|
181
|
-
|
|
181
|
+
j.value || y.workSchedule.addWorkSchedule({ data: n.value, date: Q(new Date(f.value), "{Y}-{m}-{dd}"), group: D.value[0] }).then((l) => j.value = l);
|
|
182
182
|
};
|
|
183
|
-
return (((we =
|
|
183
|
+
return (((we = y.query) == null ? void 0 : we.group) ?? !1) && (D.value[0] = (ke = y.query) == null ? void 0 : ke.group), (((Ce = y.query) == null ? void 0 : Ce.date) ?? !1) && (f.value = /* @__PURE__ */ new Date((($e = y.query) == null ? void 0 : $e.date) + "T00:00:01")), We().then((l) => {
|
|
184
184
|
M.value = l, he();
|
|
185
185
|
}), (l, e) => {
|
|
186
186
|
const u = be("el-date-picker"), i = be("svg-icon"), s = Ue("loading");
|
|
@@ -225,8 +225,8 @@ const _e = { class: "work" }, el = { class: "nav" }, ll = { style: { height: "10
|
|
|
225
225
|
}, null, 8, ["modelValue"]),
|
|
226
226
|
e[21] || (e[21] = k("div", { class: "expander" }, null, -1)),
|
|
227
227
|
r(t(ge), {
|
|
228
|
-
modelValue:
|
|
229
|
-
"onUpdate:modelValue": e[3] || (e[3] = (a) =>
|
|
228
|
+
modelValue: G.value,
|
|
229
|
+
"onUpdate:modelValue": e[3] || (e[3] = (a) => G.value = a),
|
|
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))"
|
|
@@ -243,7 +243,7 @@ const _e = { class: "work" }, el = { class: "nav" }, ll = { style: { height: "10
|
|
|
243
243
|
id: "printTable",
|
|
244
244
|
data: n.value,
|
|
245
245
|
style: { width: "100%" },
|
|
246
|
-
"max-height":
|
|
246
|
+
"max-height": G.value,
|
|
247
247
|
size: "small",
|
|
248
248
|
align: "center",
|
|
249
249
|
onCellClick: Ve,
|
|
@@ -252,7 +252,7 @@ const _e = { class: "work" }, el = { class: "nav" }, ll = { style: { height: "10
|
|
|
252
252
|
}, {
|
|
253
253
|
default: g(() => [
|
|
254
254
|
r(t(I), {
|
|
255
|
-
label: t(d)("workSchedule.title", { name: D.value[0] }) + t(
|
|
255
|
+
label: t(d)("workSchedule.title", { name: D.value[0] }) + t(X)(f.value, "month") + ` ${new Date(f.value).getFullYear()}`,
|
|
256
256
|
align: "center",
|
|
257
257
|
height: "34"
|
|
258
258
|
}, {
|
|
@@ -261,7 +261,7 @@ const _e = { class: "work" }, el = { class: "nav" }, ll = { style: { height: "10
|
|
|
261
261
|
label: t(d)("workSchedule.month"),
|
|
262
262
|
width: "180",
|
|
263
263
|
align: "center",
|
|
264
|
-
fixed:
|
|
264
|
+
fixed: G.value !== "100%"
|
|
265
265
|
}, {
|
|
266
266
|
default: g((a) => [
|
|
267
267
|
k("div", ll, h(n.value[a.$index].name), 1)
|
|
@@ -274,7 +274,7 @@ const _e = { class: "work" }, el = { class: "nav" }, ll = { style: { height: "10
|
|
|
274
274
|
}, {
|
|
275
275
|
default: g(() => [
|
|
276
276
|
(b(!0), U(re, null, se(o.value, (a) => (b(), H(t(I), {
|
|
277
|
-
key: `${
|
|
277
|
+
key: `${f.value.getTime()}-${a.day}`,
|
|
278
278
|
width: "46",
|
|
279
279
|
"class-name": a.holidays,
|
|
280
280
|
align: "center",
|
|
@@ -293,7 +293,7 @@ const _e = { class: "work" }, el = { class: "nav" }, ll = { style: { height: "10
|
|
|
293
293
|
r(t(I), {
|
|
294
294
|
label: t(d)("workSchedule.onSchedule"),
|
|
295
295
|
align: "center",
|
|
296
|
-
fixed:
|
|
296
|
+
fixed: G.value !== "100%" ? "right" : !1
|
|
297
297
|
}, {
|
|
298
298
|
default: g(() => [
|
|
299
299
|
r(t(I), {
|
|
@@ -311,7 +311,7 @@ const _e = { class: "work" }, el = { class: "nav" }, ll = { style: { height: "10
|
|
|
311
311
|
}, {
|
|
312
312
|
default: g((a) => [
|
|
313
313
|
k("div", {
|
|
314
|
-
style: Ie(`color: ${T.value
|
|
314
|
+
style: Ie(`color: ${T.value.includes(a.row.contHour) ? "green" : "red"};`)
|
|
315
315
|
}, h(a.row.contHour), 5)
|
|
316
316
|
]),
|
|
317
317
|
_: 1
|
|
@@ -327,7 +327,7 @@ const _e = { class: "work" }, el = { class: "nav" }, ll = { style: { height: "10
|
|
|
327
327
|
}, 8, ["data", "max-height", "empty-text"]),
|
|
328
328
|
Me.value && R.checkEdit ? (b(), U("div", tl, [
|
|
329
329
|
V(h(t(d)("workSchedule.chartsFilled")) + ": ", 1),
|
|
330
|
-
|
|
330
|
+
j.value ? ae("", !0) : (b(), H(t(z), {
|
|
331
331
|
key: 0,
|
|
332
332
|
type: "primary",
|
|
333
333
|
onClick: Fe
|
|
@@ -341,7 +341,7 @@ const _e = { class: "work" }, el = { class: "nav" }, ll = { style: { height: "10
|
|
|
341
341
|
k("span", null, h(R.fullName), 1)
|
|
342
342
|
])) : ae("", !0),
|
|
343
343
|
He((b(), H(t(z), {
|
|
344
|
-
disabled:
|
|
344
|
+
disabled: _.value,
|
|
345
345
|
plain: "",
|
|
346
346
|
onClick: ze,
|
|
347
347
|
style: { "margin-top": ".5rem" }
|
|
@@ -351,7 +351,7 @@ const _e = { class: "work" }, el = { class: "nav" }, ll = { style: { height: "10
|
|
|
351
351
|
]),
|
|
352
352
|
_: 1
|
|
353
353
|
}, 8, ["disabled"])), [
|
|
354
|
-
[s,
|
|
354
|
+
[s, _.value]
|
|
355
355
|
]),
|
|
356
356
|
r(t(Le), {
|
|
357
357
|
title: t(d)("workSchedule.jobTitle"),
|
|
@@ -406,14 +406,14 @@ const _e = { class: "work" }, el = { class: "nav" }, ll = { style: { height: "10
|
|
|
406
406
|
_: 1
|
|
407
407
|
}, 8, ["title", "modelValue"]),
|
|
408
408
|
r(t(Ke), {
|
|
409
|
-
show:
|
|
410
|
-
"onUpdate:show": e[20] || (e[20] = (a) =>
|
|
409
|
+
show: O.value,
|
|
410
|
+
"onUpdate:show": e[20] || (e[20] = (a) => O.value = a),
|
|
411
411
|
options: de.value
|
|
412
412
|
}, {
|
|
413
413
|
default: g(() => [
|
|
414
414
|
k("div", {
|
|
415
415
|
class: "mx-context-menu-item",
|
|
416
|
-
onClick: e[8] || (e[8] = (a) =>
|
|
416
|
+
onClick: e[8] || (e[8] = (a) => O.value = !1)
|
|
417
417
|
}, [
|
|
418
418
|
k("span", nl, h(c.value.name), 1),
|
|
419
419
|
e[23] || (e[23] = k("div", { class: "expander" }, null, -1)),
|
|
@@ -444,15 +444,15 @@ const _e = { class: "work" }, el = { class: "nav" }, ll = { style: { height: "10
|
|
|
444
444
|
}, 8, ["modelValue"]),
|
|
445
445
|
e[24] || (e[24] = k("br", null, null, -1)),
|
|
446
446
|
k("span", null, h(t(d)("workSchedule.fromDate")) + ":", 1),
|
|
447
|
-
r(t(
|
|
448
|
-
modelValue:
|
|
449
|
-
"onUpdate:modelValue": e[10] || (e[10] = (a) =>
|
|
447
|
+
r(t(K), {
|
|
448
|
+
modelValue: P.value,
|
|
449
|
+
"onUpdate:modelValue": e[10] || (e[10] = (a) => P.value = a),
|
|
450
450
|
step: 1,
|
|
451
451
|
min: 1,
|
|
452
452
|
max: o.value.length
|
|
453
453
|
}, null, 8, ["modelValue", "max"]),
|
|
454
454
|
k("span", null, h(t(d)("workSchedule.with")) + ":", 1),
|
|
455
|
-
r(t(
|
|
455
|
+
r(t(K), {
|
|
456
456
|
modelValue: C.value,
|
|
457
457
|
"onUpdate:modelValue": e[11] || (e[11] = (a) => C.value = a),
|
|
458
458
|
step: 1,
|
|
@@ -460,7 +460,7 @@ const _e = { class: "work" }, el = { class: "nav" }, ll = { style: { height: "10
|
|
|
460
460
|
max: 19
|
|
461
461
|
}, null, 8, ["modelValue"]),
|
|
462
462
|
k("span", null, h(t(d)("workSchedule.duration")) + ":", 1),
|
|
463
|
-
r(t(
|
|
463
|
+
r(t(K), {
|
|
464
464
|
modelValue: w.value,
|
|
465
465
|
"onUpdate:modelValue": e[12] || (e[12] = (a) => w.value = a),
|
|
466
466
|
step: 1,
|
|
@@ -491,7 +491,7 @@ const _e = { class: "work" }, el = { class: "nav" }, ll = { style: { height: "10
|
|
|
491
491
|
k("div", null, h(ce(c.value.day, c.value.ids)), 1),
|
|
492
492
|
e[25] || (e[25] = k("br", null, null, -1)),
|
|
493
493
|
k("span", null, h(t(d)("workSchedule.with")) + ":", 1),
|
|
494
|
-
r(t(
|
|
494
|
+
r(t(K), {
|
|
495
495
|
modelValue: C.value,
|
|
496
496
|
"onUpdate:modelValue": e[15] || (e[15] = (a) => C.value = a),
|
|
497
497
|
step: 1,
|
|
@@ -500,7 +500,7 @@ const _e = { class: "work" }, el = { class: "nav" }, ll = { style: { height: "10
|
|
|
500
500
|
onChange: e[16] || (e[16] = (a) => pe(c.value.day, c.value.ids))
|
|
501
501
|
}, null, 8, ["modelValue"]),
|
|
502
502
|
k("span", null, h(t(d)("workSchedule.duration")) + ":", 1),
|
|
503
|
-
r(t(
|
|
503
|
+
r(t(K), {
|
|
504
504
|
modelValue: w.value,
|
|
505
505
|
"onUpdate:modelValue": e[17] || (e[17] = (a) => w.value = a),
|
|
506
506
|
step: 1,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@studio-west/employees",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.9",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist"
|
|
6
6
|
],
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"vite": "^6.2.0"
|
|
36
36
|
},
|
|
37
37
|
"author": "Alexander Efimov",
|
|
38
|
-
"license": "
|
|
38
|
+
"license": "public",
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@studio-west/component-sw": "^0.11.7",
|
|
41
41
|
"js-cookie": "^3.0.5",
|