@studio-west/employees 0.6.62 → 0.6.63
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 +7 -3
- package/dist/SheetTable.js +4325 -485
- package/dist/WorkTable.cjs +4 -4
- package/dist/WorkTable.js +94 -94
- package/dist/employees.css +1 -1
- package/package.json +3 -1
package/dist/WorkTable.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),ie=require("file-saver"),de=require("exceljs"),
|
|
2
|
-
`+((x=n.value[l].days[v])==null?void 0:x.time)},G=()=>{n.value=[],R.value=[],T.value=[],
|
|
3
|
-
`+(
|
|
4
|
-
`+a.day.toString(),prop:"vacation"},{default:e.withCtx(y=>[e.createElementVNode("div",fe,e.toDisplayString(Q(a.day,y.$index)||" "),1)]),_:2},1032,["class-name","label"]))),128))]),_:1},8,["label"]),e.createVNode(e.unref(
|
|
1
|
+
"use strict";const e=require("vue"),ie=require("file-saver"),de=require("exceljs"),c=require("./index-Dn3djtwj.cjs"),se=require("vue-i18n"),d=require("element-plus"),X=require("@imengyu/vue3-context-menu");function ve(k){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(k){for(const V in k)if(V!=="default"){const m=Object.getOwnPropertyDescriptor(k,V);Object.defineProperty(r,V,m.get?m:{enumerable:!0,get:()=>k[V]})}}return r.default=k,Object.freeze(r)}const ce=ve(de),me={class:"work"},ge={class:"nav"},he={style:{height:"100px",width:"100%",display:"inline-block"}},fe={style:{height:"100px",width:"100%",display:"inline-block"}},pe={key:0,class:"controls-container",style:{"margin-top":".5rem"}},ye={class:"label"},we={key:0,style:{padding:"0.5em 1.5em"}},Ce={key:1,style:{padding:"0.5em 1.5em"}},ke={__name:"WorkTable",props:{checkEdit:{type:Boolean,default:()=>!0},odata:Object,workSchedule:Object,fullName:{type:String,default:"Вы"},group:String,date:String},setup(k){const{t:r,d:V}=se.useI18n(),m=k,I=e.ref(!1),n=e.ref([]),q=e.ref(m.date?new Date(m.date+"T00:00:01").getMonth():new Date().getMonth()),O=e.ref(!1),T=e.ref([]),h=e.ref(new Date(new Date().getFullYear(),new Date().getMonth(),1)),u=e.ref([]),M=e.ref(0),p=e.ref(9),f=e.ref(8),H=e.ref(!1),$=e.ref(!1),P=e.ref("5"),A=e.ref(1),S=e.ref([]),W=e.ref([]),N=e.ref([]),R=e.ref([]),g=e.ref({name:"Имя",length:0,code:""}),z=e.ref(!1),L=e.ref({zIndex:3,minWidth:230,x:500,y:200}),b=e.ref({}),F=e.ref("100%");e.watch(S,async(t,l)=>{t!==l&&(N.value=[],H.value=!1,m.odata.personal.forEach(o=>{t.includes(o.divisionName)&&(N.value.some(s=>(s==null?void 0:s.activeText)===o.roleName)||N.value.push({val:!0,activeText:o.roleName}))}),G())}),e.watch(q,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,h.value=new Date(new Date().getFullYear(),o,1),Z()});const _=(t,l,o,s)=>{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,L.value.y=s.clientY,L.value.x=s.clientX,l.level===2&&l.no===0&&m.checkEdit&&(g.value.name=r("workSchedule.autocomplete"),z.value=!0),l.level===3&&o.cellIndex-l.no===1&&m.checkEdit&&(E(o.cellIndex,t.ids),g.value.name=r("workSchedule.modeSelection"),z.value=!0)},ee=({row:t,columnIndex:l})=>{if(!T.value||T.value.length===0||!O.value)return"";const o=new Date(new Date(h.value).getFullYear(),new Date(h.value).getMonth(),l).getTime()+1e3;for(let s of T.value){const{dateStart:v,dateEnd:a,code:y}=s;if(v&&a&&y===t.code&&l!==0&&l<=u.value.length){const x=new Date(c.parseDate(v)).getTime(),w=new Date(c.parseDate(a)).getTime();if(o>=x&&o<=w)return"vacation"}}return""},Z=()=>{var v,a,y,x;const t=new Date(h.value),l=new Date(t.getFullYear(),t.getMonth()+1,0).getDate();let o=[],s=0;for(let w=1;w<=l;w++){const C=c.parseTime(t.setDate(w),"{Y}-{m}-{dd}");s+=(v=b.value.nowork)!=null&&v.includes(C)||b.value.holidays.includes(C)?0:(a=b.value.preholidays)!=null&&a.includes(C)?7:8;const i=(y=b.value.nowork)!=null&&y.includes(C)?"nowork":b.value.holidays.includes(C)?"holiday":(x=b.value.preholidays)!=null&&x.includes(C)?"preholiday":"";o.push({day:w,holidays:i,weekday:V(new Date(t.getFullYear(),t.getMonth(),w),"day")})}M.value=s,u.value=o,m.odata.getPersonal({dismissed:"false"}).then(w=>{var C;S.value.length===0&&(S.value=[(C=w.find(i=>i.employeeName===m.fullName&&i.dismissalDate.length===0))==null?void 0:C.divisionName]),w.forEach((i,B)=>{W.value.some(D=>i.dismissalDate.length>0&&new Date(i.dismissalDate)<new Date(h.value)||(D==null?void 0:D.value)===i.divisionName)||W.value.push({value:i.divisionName,label:i.divisionName,key:B}),S.value.includes(i.divisionName)&&!N.value.some(D=>(D==null?void 0:D.activeText)===i.roleName)&&N.value.push({val:!0,activeText:i.roleName})}),G()})},le=e.computed(()=>!n.value.some(t=>t.contHour!==M.value)),Q=(t,l)=>{var a,y,x;const o=new Date(h.value),s=`${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(w=>w.day===s);return l===-1||v===-1?"":((y=n.value[l].days[v])==null?void 0:y.tips)+`
|
|
2
|
+
`+((x=n.value[l].days[v])==null?void 0:x.time)},G=()=>{n.value=[],R.value=[],T.value=[],m.odata.personal.forEach(t=>{if(S.value.includes(t.divisionName)&&N.value.some(l=>l.val&&l.activeText===t.roleName)&&(t.dismissalDate.length===0||new Date(t.dismissalDate)>new Date(h.value))){let l=c.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,R.value.push(t.code)}),m.workSchedule.getUsersYear({code:R.value,year:new Date(h.value).getFullYear()}).then(t=>{t.forEach(l=>{l.dateStart&&T.value.push({code:l.code,dateStart:l.dateStart,dateEnd:l.dateEnd})}),te(),$.value=!1})},te=()=>{m.workSchedule.getWorkSchedule({code:R.value,date:c.parseTime(new Date(h.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)}),Y()})},Y=()=>{n.value.forEach(t=>{t.contHour=t.days.reduce((l,o)=>l+o.time,0)})},ae=t=>{n.value[t].days=[],Y()},ne=t=>{switch(P.value){case"5":for(let l=A.value;l<=u.value.length;l++)u.value[l-1].holidays===""&&E(l,t,!0),u.value[l-1].holidays==="preholiday"&&(f.value-=1,E(l,t,!0),f.value+=1);break;case"2x2":for(let l=A.value;l<=u.value.length;l+=4)E(l,t,!0),l+1<=u.value.length&&E(l+1,t,!0);break;case"2x5":for(let l=A.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"?(f.value-=1,E(o,t,!0),f.value+=1):E(o,t,!0);break}},E=(t,l,o=!1)=>{const{date:s,ind:v}=j(t,l);v===-1?(n.value[l].days.push({day:s,time:f.value,tips:`(${p.value}:00 - ${f.value>=22?p.value+f.value+2:p.value+f.value+1}:00)`}),Y()):o||(f.value=n.value[l].days[v].time,p.value=parseInt(n.value[l].days[v].tips.slice(1,-12)))},oe=(t,l)=>{const{ind:o}=j(t,l);n.value[l].days.splice(o,1),Y(),document.querySelector(".app-main").click()},K=(t,l)=>{const{date:o,ind:s}=j(t,l);n.value[l].days[s]={day:o,time:f.value,tips:`(${p.value}:00 - ${f.value>=22?p.value+f.value+2:p.value+f.value+1}:00)`},Y()},j=(t,l)=>{var v;const o=c.parseTime(new Date(h.value).setDate(t),"{Y}-{m}-{dd}"),s=(v=n.value[l])==null?void 0:v.days.findIndex(a=>a.day===o);return{date:o,ind:s}},ue=async()=>{var C;I.value=!0;const t=new ce.Workbook,l=t.addWorksheet(V(h.value,"month"),{pageSetup:{paperSize:9,orientation:"landscape",fitToPage:!0}}),o={vertical:"middle",horizontal:"center"},s={top:{style:"thin"},left:{style:"thin"},bottom:{style:"thin"},right:{style:"thin"}},v={vertical:"middle",horizontal:"center",wrapText:!0};l.mergeCells(`A1:${c.cellsDynamically("A1",u.value.length+5)}1`),l.mergeCells(`A2:${c.cellsDynamically("A2",u.value.length+5)}2`),l.mergeCells("A3:A4"),l.mergeCells(`B3:${c.cellsDynamically("B3",u.value.length)}3`),l.mergeCells(`${c.cellsDynamically("B3",u.value.length+1)}3:${c.cellsDynamically("B3",u.value.length+2)}3`),l.mergeCells(`${c.cellsDynamically("B3",u.value.length+3)}3:${c.cellsDynamically("B4",u.value.length+3)}4`),l.mergeCells(`${c.cellsDynamically("B3",u.value.length+4)}3:${c.cellsDynamically("B4",u.value.length+4)}4`),l.mergeCells(`${c.cellsDynamically("B3",u.value.length+5)}3:${c.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]})+V(h.value,"month")+` ${new Date(h.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")} (${M.value})`;for(let i=2;i<=u.value.length+1;i++)l.getCell(4,i).value=u.value[i-2].weekday+`
|
|
3
|
+
`+(i-1),l.getColumn(i).width=6,l.getColumn(i).alignment=v,l.getCell(4,i).border=s;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=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=v,l.getColumn(u.value.length+5).alignment=v,l.getColumn(u.value.length+6).alignment=o,l.getCell("A3").border=s,l.getCell("B3").border=s,l.getCell(3,u.value.length+2).border=s,l.getCell(4,u.value.length+2).border=s,l.getCell(3,u.value.length+4).border=s,l.getCell(3,u.value.length+5).border=s,l.getCell(3,u.value.length+6).border=s,l.getCell(4,u.value.length+3).border=s;let a=0;for(const i of n.value){let B=[i.name];for(let U=1;U<=u.value.length;U++){const{ind:J}=j(U,a);J!==-1?B[U]=`${i.days[J].time} ${i.days[J].tips}`:B[U]=" "}B.push(((C=i.days)==null?void 0:C.length)||" ",i.contHour||0);const D=l.addRow(B);D.border=s,a++}let y="Щербина Е. В.";m.odata.personal.forEach(i=>{i.roleName==="Начальник отдела правовой и кадровой работы"&&(i.dismissalDate.length===0||new Date(i.dismissalDate)>new Date(thisMonth.value))&&(y=i.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=c.byInitials(m.fullName),l.getCell(`AD${n.value.length+8}`).value=c.byInitials(y),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 x="export_"+c.parseTime(Date.now(),"{dd}.{m}.{Y}")+".xlsx",w=await t.xlsx.writeBuffer();ie.saveAs(new Blob([w]),x),I.value=!1},re=async()=>{H.value||m.workSchedule.addWorkSchedule({data:n.value,date:c.parseTime(new Date(h.value),"{Y}-{m}-{dd}"),group:S.value[0]}).then(t=>H.value=t)};return console.log("props.group",m.group),console.log("props.date",m.date),m.group&&(S.value[0]=m.group),m.date&&(h.value=new Date(m.date+"T00:00:01")),c.holidays().then(t=>{b.value=t,Z()}),(t,l)=>{const o=e.resolveComponent("el-date-picker"),s=e.resolveComponent("svg-icon"),v=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",me,[e.createElementVNode("div",ge,[k.checkEdit?(e.openBlock(),e.createBlock(e.unref(d.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(W.value,a=>(e.openBlock(),e.createBlock(e.unref(d.ElOption),{key:a.key,label:a.label,value:a.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])):e.createCommentVNode("",!0),k.checkEdit?(e.openBlock(),e.createBlock(e.unref(d.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:q.value,"onUpdate:modelValue":l[2]||(l[2]=a=>q.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(d.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(d.ElSwitch),{modelValue:O.value,"onUpdate:modelValue":l[4]||(l[4]=a=>O.value=a),"active-text":"Отпуска","active-value":!0,"inactive-value":!1},null,8,["modelValue"])]),e.createVNode(e.unref(d.ElTable),{id:"printTable",data:n.value,style:{width:"100%"},"max-height":F.value,size:"small",align:"center",onCellClick:_,"empty-text":e.unref(r)("workSchedule.emptyText"),"cell-class-name":ee},{default:e.withCtx(()=>[e.createVNode(e.unref(d.ElTableColumn),{label:e.unref(r)("workSchedule.title",{name:S.value[0]})+e.unref(V)(h.value,"month")+` ${new Date(h.value).getFullYear()}`,align:"center",height:"34"},{default:e.withCtx(()=>[e.createVNode(e.unref(d.ElTableColumn),{label:e.unref(r)("workSchedule.month"),width:"180",align:"center",fixed:F.value!=="100%"},{default:e.withCtx(a=>[e.createElementVNode("div",he,e.toDisplayString(n.value[a.$index].name),1)]),_:1},8,["label","fixed"]),e.createVNode(e.unref(d.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(d.ElTableColumn),{key:a.day,width:"46","class-name":a.holidays,align:"center",label:a.weekday+`
|
|
4
|
+
`+a.day.toString(),prop:"vacation"},{default:e.withCtx(y=>[e.createElementVNode("div",fe,e.toDisplayString(Q(a.day,y.$index)||" "),1)]),_:2},1032,["class-name","label"]))),128))]),_:1},8,["label"]),e.createVNode(e.unref(d.ElTableColumn),{label:e.unref(r)("workSchedule.onSchedule"),align:"center",fixed:F.value!=="100%"?"right":!1},{default:e.withCtx(()=>[e.createVNode(e.unref(d.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(d.ElTableColumn),{label:`${e.unref(r)("workSchedule.hours")} ( ${M.value} )`,align:"center"},{default:e.withCtx(a=>[e.createElementVNode("div",{style:e.normalizeStyle(`color: ${M.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"]),le.value&&k.checkEdit?(e.openBlock(),e.createElementBlock("div",pe,[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.chartsFilled"))+": ",1),H.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(d.ElButton),{key:0,type:"primary",onClick:re},{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(k.fullName),1)])):e.createCommentVNode("",!0),e.withDirectives((e.openBlock(),e.createBlock(e.unref(d.ElButton),{disabled:I.value,plain:"",onClick:ue,style:{"margin-top":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.exportExcel")),1)]),_:1},8,["disabled"])),[[v,I.value]]),e.createVNode(e.unref(d.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(d.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(d.ElButton),{size:"default",type:"primary",onClick:l[6]||(l[6]=a=>{G(),$.value=!1})},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.$t("workSchedule.select")),1)]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(d.ElForm),{ref:"dialogForm",model:N.value,autocomplete:"on"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,a=>(e.openBlock(),e.createBlock(e.unref(d.ElFormItem),null,{default:e.withCtx(()=>[e.createVNode(e.unref(d.ElSwitch),{modelValue:a.val,"onUpdate:modelValue":y=>a.val=y,"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(X.ContextMenu),{show:z.value,"onUpdate:show":l[20]||(l[20]=a=>z.value=a),options:L.value},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"mx-context-menu-item",onClick:l[8]||(l[8]=a=>z.value=!1)},[e.createElementVNode("span",ye,e.toDisplayString(g.value.name),1),l[23]||(l[23]=e.createElementVNode("div",{class:"expander"},null,-1)),e.createVNode(s,{"icon-class":"cross"})]),e.createVNode(e.unref(X.ContextMenuSeparator)),g.value.level===2?(e.openBlock(),e.createElementBlock("div",we,[e.createVNode(e.unref(d.ElRadioGroup),{modelValue:P.value,"onUpdate:modelValue":l[9]||(l[9]=a=>P.value=a),size:"small"},{default:e.withCtx(()=>[e.createVNode(e.unref(d.ElRadioButton),{label:e.unref(r)("workSchedule.Days5"),value:"5"},null,8,["label"]),e.createVNode(e.unref(d.ElRadioButton),{label:"2 Х 2",value:"2x2"}),e.createVNode(e.unref(d.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(d.ElSlider),{modelValue:A.value,"onUpdate:modelValue":l[10]||(l[10]=a=>A.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(d.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(d.ElSlider),{modelValue:f.value,"onUpdate:modelValue":l[12]||(l[12]=a=>f.value=a),step:1,min:4,max:e.unref(c.clamp)(p.value!==1?23-p.value:21,4,22)},null,8,["modelValue","max"]),e.createVNode(e.unref(d.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:l[13]||(l[13]=a=>ne(g.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.fillOut")),1)]),_:1}),e.createVNode(e.unref(d.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:l[14]||(l[14]=a=>ae(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(d.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=>K(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(d.ElSlider),{modelValue:f.value,"onUpdate:modelValue":l[17]||(l[17]=a=>f.value=a),step:1,min:4,max:e.unref(c.clamp)(p.value!==1?23-p.value:21,4,22),onChange:l[18]||(l[18]=a=>K(g.value.day,g.value.ids))},null,8,["modelValue","max"]),e.createVNode(e.unref(d.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:l[19]||(l[19]=a=>oe(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=ke;
|
package/dist/WorkTable.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ref as g, watch as pe, computed as
|
|
2
|
-
import { saveAs as
|
|
1
|
+
import { ref as g, watch as pe, computed as Me, resolveComponent as fe, resolveDirective as Ne, createElementBlock as z, openBlock as S, createElementVNode as w, createVNode as s, createCommentVNode as ee, withDirectives as Ae, createBlock as F, unref as t, withCtx as m, Fragment as ie, renderList as re, createTextVNode as D, toDisplayString as h, normalizeStyle as Be } from "vue";
|
|
2
|
+
import { saveAs as Te } from "file-saver";
|
|
3
3
|
import * as ze from "exceljs";
|
|
4
|
-
import { p as Z, b as se, h as Fe, c as ye, a as we, d as
|
|
4
|
+
import { p as Z, b as se, h as Fe, c as ye, a as we, d as V } from "./index-2Mx6IUGl.js";
|
|
5
5
|
import { useI18n as Ye } from "vue-i18n";
|
|
6
|
-
import { ElSelect as Ue, ElOption as He, ElButton as
|
|
6
|
+
import { ElSelect as Ue, ElOption as He, ElButton as A, ElSwitch as ve, ElTable as Ie, ElTableColumn as Y, ElDialog as Re, ElForm as We, ElFormItem as Pe, ElRadioGroup as je, ElRadioButton as ge, ElSlider as q } from "element-plus";
|
|
7
7
|
import { ContextMenu as Oe, ContextMenuSeparator as Ge } from "@imengyu/vue3-context-menu";
|
|
8
8
|
const Le = { class: "work" }, Ze = { class: "nav" }, qe = { style: { height: "100px", width: "100%", display: "inline-block" } }, Je = { style: { height: "100px", width: "100%", display: "inline-block" } }, Qe = {
|
|
9
9
|
key: 0,
|
|
@@ -15,7 +15,7 @@ const Le = { class: "work" }, Ze = { class: "nav" }, qe = { style: { height: "10
|
|
|
15
15
|
}, _e = {
|
|
16
16
|
key: 1,
|
|
17
17
|
style: { padding: "0.5em 1.5em" }
|
|
18
|
-
},
|
|
18
|
+
}, ol = {
|
|
19
19
|
__name: "WorkTable",
|
|
20
20
|
props: {
|
|
21
21
|
checkEdit: { type: Boolean, default: () => !0 },
|
|
@@ -39,57 +39,57 @@ const Le = { class: "work" }, Ze = { class: "nav" }, qe = { style: { height: "10
|
|
|
39
39
|
// code: '0000-00052'
|
|
40
40
|
// ids: 1
|
|
41
41
|
// }
|
|
42
|
-
]), le = g(c.date ? (/* @__PURE__ */ new Date(c.date + "T00:00:01")).getMonth() : (/* @__PURE__ */ new Date()).getMonth()), ae = g(!1), R = g([]), f = g(new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1)),
|
|
42
|
+
]), le = g(c.date ? (/* @__PURE__ */ new Date(c.date + "T00:00:01")).getMonth() : (/* @__PURE__ */ new Date()).getMonth()), ae = g(!1), R = g([]), f = g(new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1)), o = g([]), W = g(0), k = g(9), y = g(8), K = g(!1), U = g(!1), te = g("5"), P = g(1), x = g([]), ne = g([]), N = g([]), X = g([]), p = g({ name: "Имя", length: 0, code: "" }), j = g(!1), ue = g({
|
|
43
43
|
zIndex: 3,
|
|
44
44
|
minWidth: 230,
|
|
45
45
|
x: 500,
|
|
46
46
|
y: 200
|
|
47
|
-
}),
|
|
47
|
+
}), B = g({}), O = g("100%");
|
|
48
48
|
pe(x, async (l, e) => {
|
|
49
|
-
l !== e && (
|
|
50
|
-
l.includes(
|
|
51
|
-
}),
|
|
49
|
+
l !== e && (N.value = [], K.value = !1, c.odata.personal.forEach((u) => {
|
|
50
|
+
l.includes(u.divisionName) && (N.value.some((r) => (r == null ? void 0 : r.activeText) === u.roleName) || N.value.push({ val: !0, activeText: u.roleName }));
|
|
51
|
+
}), oe());
|
|
52
52
|
}), pe(le, async (l) => {
|
|
53
|
-
let e = (/* @__PURE__ */ new Date()).getMonth(),
|
|
54
|
-
|
|
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, f.value = new Date((/* @__PURE__ */ new Date()).getFullYear(), u, 1), me();
|
|
55
55
|
});
|
|
56
|
-
const ke = (l, e,
|
|
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 =
|
|
56
|
+
const ke = (l, e, u, 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 = u.cellIndex, ue.value.y = r.clientY, ue.value.x = r.clientX, e.level === 2 && e.no === 0 && c.checkEdit && (p.value.name = d("workSchedule.autocomplete"), j.value = !0), e.level === 3 && u.cellIndex - e.no === 1 && c.checkEdit && (T(u.cellIndex, l.ids), p.value.name = d("workSchedule.modeSelection"), j.value = !0);
|
|
58
58
|
}, Ce = ({ row: l, columnIndex: e }) => {
|
|
59
59
|
if (!R.value || R.value.length === 0 || !ae.value) return "";
|
|
60
|
-
const
|
|
61
|
-
for (let
|
|
62
|
-
const { dateStart: v, dateEnd: a, code: C } =
|
|
63
|
-
if (v && a && C === l.code && e !== 0 && e <=
|
|
64
|
-
const
|
|
65
|
-
if (
|
|
60
|
+
const u = new Date(new Date(f.value).getFullYear(), new Date(f.value).getMonth(), e).getTime() + 1e3;
|
|
61
|
+
for (let r of R.value) {
|
|
62
|
+
const { dateStart: v, dateEnd: a, code: C } = r;
|
|
63
|
+
if (v && a && C === l.code && e !== 0 && e <= o.value.length) {
|
|
64
|
+
const E = new Date(we(v)).getTime(), $ = new Date(we(a)).getTime();
|
|
65
|
+
if (u >= E && u <= $) return "vacation";
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
return "";
|
|
69
69
|
}, me = () => {
|
|
70
|
-
var v, a, C,
|
|
70
|
+
var v, a, C, E;
|
|
71
71
|
const l = new Date(f.value), e = new Date(l.getFullYear(), l.getMonth() + 1, 0).getDate();
|
|
72
|
-
let
|
|
72
|
+
let u = [], r = 0;
|
|
73
73
|
for (let $ = 1; $ <= e; $++) {
|
|
74
74
|
const b = Z(l.setDate($), "{Y}-{m}-{dd}");
|
|
75
|
-
|
|
76
|
-
const
|
|
77
|
-
|
|
75
|
+
r += (v = B.value.nowork) != null && v.includes(b) || B.value.holidays.includes(b) ? 0 : (a = B.value.preholidays) != null && a.includes(b) ? 7 : 8;
|
|
76
|
+
const i = (C = B.value.nowork) != null && C.includes(b) ? "nowork" : B.value.holidays.includes(b) ? "holiday" : (E = B.value.preholidays) != null && E.includes(b) ? "preholiday" : "";
|
|
77
|
+
u.push({ day: $, holidays: i, weekday: J(new Date(l.getFullYear(), l.getMonth(), $), "day") });
|
|
78
78
|
}
|
|
79
|
-
W.value =
|
|
79
|
+
W.value = r, o.value = u, c.odata.getPersonal({ dismissed: "false" }).then(($) => {
|
|
80
80
|
var b;
|
|
81
|
-
x.value.length === 0 && (x.value = [(b = $.find((
|
|
82
|
-
ne.value.some((
|
|
83
|
-
}),
|
|
81
|
+
x.value.length === 0 && (x.value = [(b = $.find((i) => i.employeeName === c.fullName && i.dismissalDate.length === 0)) == null ? void 0 : b.divisionName]), $.forEach((i, H) => {
|
|
82
|
+
ne.value.some((M) => i.dismissalDate.length > 0 && new Date(i.dismissalDate) < new Date(f.value) || (M == null ? void 0 : M.value) === i.divisionName) || ne.value.push({ value: i.divisionName, label: i.divisionName, key: H }), x.value.includes(i.divisionName) && !N.value.some((M) => (M == null ? void 0 : M.activeText) === i.roleName) && N.value.push({ val: !0, activeText: i.roleName });
|
|
83
|
+
}), oe();
|
|
84
84
|
});
|
|
85
|
-
}, $e =
|
|
86
|
-
var a, C,
|
|
87
|
-
const
|
|
85
|
+
}, $e = Me(() => !n.value.some((l) => l.contHour !== W.value)), he = (l, e) => {
|
|
86
|
+
var a, C, E;
|
|
87
|
+
const u = new Date(f.value), r = `${u.getFullYear()}-${(u.getMonth() + 1).toString().padStart(2, "0")}-${l.toString().padStart(2, "0")}`, v = (a = n.value[e]) == null ? void 0 : a.days.findIndex(($) => $.day === r);
|
|
88
88
|
return e === -1 || v === -1 ? "" : ((C = n.value[e].days[v]) == null ? void 0 : C.tips) + `
|
|
89
|
-
` + ((
|
|
90
|
-
},
|
|
89
|
+
` + ((E = n.value[e].days[v]) == null ? void 0 : E.time);
|
|
90
|
+
}, oe = () => {
|
|
91
91
|
n.value = [], X.value = [], R.value = [], c.odata.personal.forEach((l) => {
|
|
92
|
-
if (x.value.includes(l.divisionName) &&
|
|
92
|
+
if (x.value.includes(l.divisionName) && N.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 = se(l.employeeName);
|
|
94
94
|
n.value.push({ name: e + " (" + l.roleName + ")", days: [], contHour: 0, code: l.employeeKey, id: !1 });
|
|
95
95
|
}
|
|
@@ -103,87 +103,87 @@ const Le = { class: "work" }, Ze = { class: "nav" }, qe = { style: { height: "10
|
|
|
103
103
|
}, Se = () => {
|
|
104
104
|
c.workSchedule.getWorkSchedule({ code: X.value, date: Z(new Date(f.value), "{Y}-{m}-{dd}") }).then(
|
|
105
105
|
(l) => {
|
|
106
|
-
l.forEach((e,
|
|
107
|
-
e !== null && (n.value[
|
|
106
|
+
l.forEach((e, u) => {
|
|
107
|
+
e !== null && (n.value[u].days = e.data.days, n.value[u].id = e.id);
|
|
108
108
|
}), G();
|
|
109
109
|
}
|
|
110
110
|
);
|
|
111
111
|
}, G = () => {
|
|
112
112
|
n.value.forEach((l) => {
|
|
113
|
-
l.contHour = l.days.reduce((e,
|
|
113
|
+
l.contHour = l.days.reduce((e, u) => e + u.time, 0);
|
|
114
114
|
});
|
|
115
115
|
}, be = (l) => {
|
|
116
116
|
n.value[l].days = [], G();
|
|
117
117
|
}, xe = (l) => {
|
|
118
118
|
switch (te.value) {
|
|
119
119
|
case "5":
|
|
120
|
-
for (let e = P.value; e <=
|
|
121
|
-
|
|
120
|
+
for (let e = P.value; e <= o.value.length; e++)
|
|
121
|
+
o.value[e - 1].holidays === "" && T(e, l, !0), o.value[e - 1].holidays === "preholiday" && (y.value -= 1, T(e, l, !0), y.value += 1);
|
|
122
122
|
break;
|
|
123
123
|
case "2x2":
|
|
124
|
-
for (let e = P.value; e <=
|
|
125
|
-
|
|
124
|
+
for (let e = P.value; e <= o.value.length; e += 4)
|
|
125
|
+
T(e, l, !0), e + 1 <= o.value.length && T(e + 1, l, !0);
|
|
126
126
|
break;
|
|
127
127
|
case "2x5":
|
|
128
|
-
for (let e = P.value; e <=
|
|
129
|
-
for (let
|
|
130
|
-
|
|
128
|
+
for (let e = P.value; e <= o.value.length; e += 7)
|
|
129
|
+
for (let u = e; u < e + 5 && u <= o.value.length; u++)
|
|
130
|
+
o.value[u - 1].holidays === "preholiday" ? (y.value -= 1, T(u, l, !0), y.value += 1) : T(u, l, !0);
|
|
131
131
|
break;
|
|
132
132
|
}
|
|
133
|
-
},
|
|
134
|
-
const { date:
|
|
133
|
+
}, T = (l, e, u = !1) => {
|
|
134
|
+
const { date: r, ind: v } = _(l, e);
|
|
135
135
|
v === -1 ? (n.value[e].days.push({
|
|
136
|
-
day:
|
|
136
|
+
day: r,
|
|
137
137
|
time: y.value,
|
|
138
138
|
tips: `(${k.value}:00 - ${y.value >= 22 ? k.value + y.value + 2 : k.value + y.value + 1}:00)`
|
|
139
|
-
}), G()) :
|
|
139
|
+
}), G()) : u || (y.value = n.value[e].days[v].time, k.value = parseInt(n.value[e].days[v].tips.slice(1, -12)));
|
|
140
140
|
}, De = (l, e) => {
|
|
141
|
-
const { ind:
|
|
142
|
-
n.value[e].days.splice(
|
|
141
|
+
const { ind: u } = _(l, e);
|
|
142
|
+
n.value[e].days.splice(u, 1), G(), document.querySelector(".app-main").click();
|
|
143
143
|
}, ce = (l, e) => {
|
|
144
|
-
const { date:
|
|
145
|
-
n.value[e].days[
|
|
146
|
-
day:
|
|
144
|
+
const { date: u, ind: r } = _(l, e);
|
|
145
|
+
n.value[e].days[r] = {
|
|
146
|
+
day: u,
|
|
147
147
|
time: y.value,
|
|
148
148
|
tips: `(${k.value}:00 - ${y.value >= 22 ? k.value + y.value + 2 : k.value + y.value + 1}:00)`
|
|
149
149
|
}, G();
|
|
150
150
|
}, _ = (l, e) => {
|
|
151
151
|
var v;
|
|
152
|
-
const
|
|
153
|
-
return { date:
|
|
152
|
+
const u = Z(new Date(f.value).setDate(l), "{Y}-{m}-{dd}"), r = (v = n.value[e]) == null ? void 0 : v.days.findIndex((a) => a.day === u);
|
|
153
|
+
return { date: u, ind: r };
|
|
154
154
|
}, Ve = async () => {
|
|
155
155
|
var b;
|
|
156
156
|
Q.value = !0;
|
|
157
|
-
const l = new ze.Workbook(), e = l.addWorksheet(J(f.value, "month"), { pageSetup: { paperSize: 9, orientation: "landscape", fitToPage: !0 } }),
|
|
158
|
-
e.mergeCells(`A1:${
|
|
159
|
-
for (let
|
|
160
|
-
e.getCell(4,
|
|
161
|
-
` + (
|
|
162
|
-
e.getRow(1).height = 40, e.getRow(2).height = 30, e.getRow(3).height = 20, e.getColumn(1).width = 15, e.getColumn(
|
|
157
|
+
const l = new ze.Workbook(), e = l.addWorksheet(J(f.value, "month"), { pageSetup: { paperSize: 9, orientation: "landscape", fitToPage: !0 } }), u = { vertical: "middle", horizontal: "center" }, r = { top: { style: "thin" }, left: { style: "thin" }, bottom: { style: "thin" }, right: { style: "thin" } }, v = { vertical: "middle", horizontal: "center", wrapText: !0 };
|
|
158
|
+
e.mergeCells(`A1:${V("A1", o.value.length + 5)}1`), e.mergeCells(`A2:${V("A2", o.value.length + 5)}2`), e.mergeCells("A3:A4"), e.mergeCells(`B3:${V("B3", o.value.length)}3`), e.mergeCells(`${V("B3", o.value.length + 1)}3:${V("B3", o.value.length + 2)}3`), e.mergeCells(`${V("B3", o.value.length + 3)}3:${V("B4", o.value.length + 3)}4`), e.mergeCells(`${V("B3", o.value.length + 4)}3:${V("B4", o.value.length + 4)}4`), e.mergeCells(`${V("B3", o.value.length + 5)}3:${V("B4", o.value.length + 5)}4`), e.getCell("A1").value = d("workSchedule.firm"), e.getCell("A2").value = d("workSchedule.title", { name: x.value[0] }) + J(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")} (${W.value})`;
|
|
159
|
+
for (let i = 2; i <= o.value.length + 1; i++)
|
|
160
|
+
e.getCell(4, i).value = o.value[i - 2].weekday + `
|
|
161
|
+
` + (i - 1), e.getColumn(i).width = 6, e.getColumn(i).alignment = v, e.getCell(4, i).border = r;
|
|
162
|
+
e.getRow(1).height = 40, e.getRow(2).height = 30, e.getRow(3).height = 20, e.getColumn(1).width = 15, e.getColumn(o.value.length + 2).width = 5, e.getColumn(o.value.length + 3).width = 6, e.getColumn(o.value.length + 4).width = 13, e.getColumn(o.value.length + 5).width = 13, e.getColumn(o.value.length + 6).width = 13, e.getColumn(1).alignment = v, e.getCell("A2").alignment = u, e.getCell("A3").alignment = u, e.getCell("B3").alignment = u, e.getCell(3, o.value.length + 2).alignment = u, e.getColumn(o.value.length + 2).alignment = v, e.getColumn(o.value.length + 3).alignment = v, e.getColumn(o.value.length + 4).alignment = v, e.getColumn(o.value.length + 5).alignment = v, e.getColumn(o.value.length + 6).alignment = u, e.getCell("A3").border = r, e.getCell("B3").border = r, e.getCell(3, o.value.length + 2).border = r, e.getCell(4, o.value.length + 2).border = r, e.getCell(3, o.value.length + 4).border = r, e.getCell(3, o.value.length + 5).border = r, e.getCell(3, o.value.length + 6).border = r, e.getCell(4, o.value.length + 3).border = r;
|
|
163
163
|
let a = 0;
|
|
164
|
-
for (const
|
|
165
|
-
let H = [
|
|
166
|
-
for (let L = 1; L <=
|
|
164
|
+
for (const i of n.value) {
|
|
165
|
+
let H = [i.name];
|
|
166
|
+
for (let L = 1; L <= o.value.length; L++) {
|
|
167
167
|
const { ind: de } = _(L, a);
|
|
168
|
-
de !== -1 ? H[L] = `${
|
|
168
|
+
de !== -1 ? H[L] = `${i.days[de].time} ${i.days[de].tips}` : H[L] = " ";
|
|
169
169
|
}
|
|
170
|
-
H.push(((b =
|
|
171
|
-
const
|
|
172
|
-
|
|
170
|
+
H.push(((b = i.days) == null ? void 0 : b.length) || " ", i.contHour || 0);
|
|
171
|
+
const M = e.addRow(H);
|
|
172
|
+
M.border = r, a++;
|
|
173
173
|
}
|
|
174
174
|
let C = "Щербина Е. В.";
|
|
175
|
-
c.odata.personal.forEach((
|
|
176
|
-
|
|
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(C), 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 =
|
|
178
|
-
const
|
|
179
|
-
|
|
175
|
+
c.odata.personal.forEach((i) => {
|
|
176
|
+
i.roleName === "Начальник отдела правовой и кадровой работы" && (i.dismissalDate.length === 0 || new Date(i.dismissalDate) > new Date(thisMonth.value)) && (C = i.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 = se(c.fullName), e.getCell(`AD${n.value.length + 8}`).value = se(C), 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 E = "export_" + Z(Date.now(), "{dd}.{m}.{Y}") + ".xlsx", $ = await l.xlsx.writeBuffer();
|
|
179
|
+
Te(new Blob([$]), E), Q.value = !1;
|
|
180
180
|
}, Ee = async () => {
|
|
181
181
|
K.value || c.workSchedule.addWorkSchedule({ data: n.value, date: Z(new Date(f.value), "{Y}-{m}-{dd}"), group: x.value[0] }).then((l) => K.value = l);
|
|
182
182
|
};
|
|
183
183
|
return console.log("props.group", c.group), console.log("props.date", c.date), c.group && (x.value[0] = c.group), c.date && (f.value = /* @__PURE__ */ new Date(c.date + "T00:00:01")), Fe().then((l) => {
|
|
184
|
-
|
|
184
|
+
B.value = l, me();
|
|
185
185
|
}), (l, e) => {
|
|
186
|
-
const
|
|
186
|
+
const u = fe("el-date-picker"), r = fe("svg-icon"), v = Ne("loading");
|
|
187
187
|
return S(), z("div", Le, [
|
|
188
188
|
w("div", Ze, [
|
|
189
189
|
I.checkEdit ? (S(), F(t(Ue), {
|
|
@@ -205,7 +205,7 @@ const Le = { class: "work" }, Ze = { class: "nav" }, qe = { style: { height: "10
|
|
|
205
205
|
]),
|
|
206
206
|
_: 1
|
|
207
207
|
}, 8, ["modelValue"])) : ee("", !0),
|
|
208
|
-
I.checkEdit ? (S(), F(t(
|
|
208
|
+
I.checkEdit ? (S(), F(t(A), {
|
|
209
209
|
key: 1,
|
|
210
210
|
plain: "",
|
|
211
211
|
onClick: e[1] || (e[1] = (a) => U.value = !0)
|
|
@@ -215,7 +215,7 @@ const Le = { class: "work" }, Ze = { class: "nav" }, qe = { style: { height: "10
|
|
|
215
215
|
]),
|
|
216
216
|
_: 1
|
|
217
217
|
})) : ee("", !0),
|
|
218
|
-
s(
|
|
218
|
+
s(u, {
|
|
219
219
|
modelValue: le.value,
|
|
220
220
|
"onUpdate:modelValue": e[2] || (e[2] = (a) => le.value = a),
|
|
221
221
|
type: "month",
|
|
@@ -273,7 +273,7 @@ const Le = { class: "work" }, Ze = { class: "nav" }, qe = { style: { height: "10
|
|
|
273
273
|
align: "center"
|
|
274
274
|
}, {
|
|
275
275
|
default: m(() => [
|
|
276
|
-
(S(!0), z(ie, null, re(
|
|
276
|
+
(S(!0), z(ie, null, re(o.value, (a) => (S(), F(t(Y), {
|
|
277
277
|
key: a.day,
|
|
278
278
|
width: "46",
|
|
279
279
|
"class-name": a.holidays,
|
|
@@ -311,7 +311,7 @@ const Le = { class: "work" }, Ze = { class: "nav" }, qe = { style: { height: "10
|
|
|
311
311
|
}, {
|
|
312
312
|
default: m((a) => [
|
|
313
313
|
w("div", {
|
|
314
|
-
style:
|
|
314
|
+
style: Be(`color: ${W.value === a.row.contHour ? "green" : "red"};`)
|
|
315
315
|
}, h(a.row.contHour), 5)
|
|
316
316
|
]),
|
|
317
317
|
_: 1
|
|
@@ -327,7 +327,7 @@ const Le = { class: "work" }, Ze = { class: "nav" }, qe = { style: { height: "10
|
|
|
327
327
|
}, 8, ["data", "max-height", "empty-text"]),
|
|
328
328
|
$e.value && I.checkEdit ? (S(), z("div", Qe, [
|
|
329
329
|
D(h(t(d)("workSchedule.chartsFilled")) + ": ", 1),
|
|
330
|
-
K.value ? ee("", !0) : (S(), F(t(
|
|
330
|
+
K.value ? ee("", !0) : (S(), F(t(A), {
|
|
331
331
|
key: 0,
|
|
332
332
|
type: "primary",
|
|
333
333
|
onClick: Ee
|
|
@@ -340,7 +340,7 @@ const Le = { class: "work" }, Ze = { class: "nav" }, qe = { style: { height: "10
|
|
|
340
340
|
e[22] || (e[22] = D()),
|
|
341
341
|
w("span", null, h(I.fullName), 1)
|
|
342
342
|
])) : ee("", !0),
|
|
343
|
-
|
|
343
|
+
Ae((S(), F(t(A), {
|
|
344
344
|
disabled: Q.value,
|
|
345
345
|
plain: "",
|
|
346
346
|
onClick: Ve,
|
|
@@ -360,7 +360,7 @@ const Le = { class: "work" }, Ze = { class: "nav" }, qe = { style: { height: "10
|
|
|
360
360
|
width: "400px"
|
|
361
361
|
}, {
|
|
362
362
|
footer: m(() => [
|
|
363
|
-
s(t(
|
|
363
|
+
s(t(A), {
|
|
364
364
|
onClick: e[5] || (e[5] = (a) => U.value = !1),
|
|
365
365
|
size: "default"
|
|
366
366
|
}, {
|
|
@@ -369,11 +369,11 @@ const Le = { class: "work" }, Ze = { class: "nav" }, qe = { style: { height: "10
|
|
|
369
369
|
]),
|
|
370
370
|
_: 1
|
|
371
371
|
}),
|
|
372
|
-
s(t(
|
|
372
|
+
s(t(A), {
|
|
373
373
|
size: "default",
|
|
374
374
|
type: "primary",
|
|
375
375
|
onClick: e[6] || (e[6] = (a) => {
|
|
376
|
-
|
|
376
|
+
oe(), U.value = !1;
|
|
377
377
|
})
|
|
378
378
|
}, {
|
|
379
379
|
default: m(() => [
|
|
@@ -385,11 +385,11 @@ const Le = { class: "work" }, Ze = { class: "nav" }, qe = { style: { height: "10
|
|
|
385
385
|
default: m(() => [
|
|
386
386
|
s(t(We), {
|
|
387
387
|
ref: "dialogForm",
|
|
388
|
-
model:
|
|
388
|
+
model: N.value,
|
|
389
389
|
autocomplete: "on"
|
|
390
390
|
}, {
|
|
391
391
|
default: m(() => [
|
|
392
|
-
(S(!0), z(ie, null, re(
|
|
392
|
+
(S(!0), z(ie, null, re(N.value, (a) => (S(), F(t(Pe), null, {
|
|
393
393
|
default: m(() => [
|
|
394
394
|
s(t(ve), {
|
|
395
395
|
modelValue: a.val,
|
|
@@ -408,7 +408,7 @@ const Le = { class: "work" }, Ze = { class: "nav" }, qe = { style: { height: "10
|
|
|
408
408
|
s(t(Oe), {
|
|
409
409
|
show: j.value,
|
|
410
410
|
"onUpdate:show": e[20] || (e[20] = (a) => j.value = a),
|
|
411
|
-
options:
|
|
411
|
+
options: ue.value
|
|
412
412
|
}, {
|
|
413
413
|
default: m(() => [
|
|
414
414
|
w("div", {
|
|
@@ -417,7 +417,7 @@ const Le = { class: "work" }, Ze = { class: "nav" }, qe = { style: { height: "10
|
|
|
417
417
|
}, [
|
|
418
418
|
w("span", Ke, h(p.value.name), 1),
|
|
419
419
|
e[23] || (e[23] = w("div", { class: "expander" }, null, -1)),
|
|
420
|
-
s(
|
|
420
|
+
s(r, { "icon-class": "cross" })
|
|
421
421
|
]),
|
|
422
422
|
s(t(Ge)),
|
|
423
423
|
p.value.level === 2 ? (S(), z("div", Xe, [
|
|
@@ -449,7 +449,7 @@ const Le = { class: "work" }, Ze = { class: "nav" }, qe = { style: { height: "10
|
|
|
449
449
|
"onUpdate:modelValue": e[10] || (e[10] = (a) => P.value = a),
|
|
450
450
|
step: 1,
|
|
451
451
|
min: 1,
|
|
452
|
-
max:
|
|
452
|
+
max: o.value.length
|
|
453
453
|
}, null, 8, ["modelValue", "max"]),
|
|
454
454
|
w("span", null, h(t(d)("workSchedule.with")) + ":", 1),
|
|
455
455
|
s(t(q), {
|
|
@@ -467,7 +467,7 @@ const Le = { class: "work" }, Ze = { class: "nav" }, qe = { style: { height: "10
|
|
|
467
467
|
min: 4,
|
|
468
468
|
max: t(ye)(k.value !== 1 ? 23 - k.value : 21, 4, 22)
|
|
469
469
|
}, null, 8, ["modelValue", "max"]),
|
|
470
|
-
s(t(
|
|
470
|
+
s(t(A), {
|
|
471
471
|
style: { "margin-top": ".5rem" },
|
|
472
472
|
size: "small",
|
|
473
473
|
onClick: e[13] || (e[13] = (a) => xe(p.value.ids))
|
|
@@ -477,7 +477,7 @@ const Le = { class: "work" }, Ze = { class: "nav" }, qe = { style: { height: "10
|
|
|
477
477
|
]),
|
|
478
478
|
_: 1
|
|
479
479
|
}),
|
|
480
|
-
s(t(
|
|
480
|
+
s(t(A), {
|
|
481
481
|
style: { "margin-top": ".5rem" },
|
|
482
482
|
size: "small",
|
|
483
483
|
onClick: e[14] || (e[14] = (a) => be(p.value.ids))
|
|
@@ -508,7 +508,7 @@ const Le = { class: "work" }, Ze = { class: "nav" }, qe = { style: { height: "10
|
|
|
508
508
|
max: t(ye)(k.value !== 1 ? 23 - k.value : 21, 4, 22),
|
|
509
509
|
onChange: e[18] || (e[18] = (a) => ce(p.value.day, p.value.ids))
|
|
510
510
|
}, null, 8, ["modelValue", "max"]),
|
|
511
|
-
s(t(
|
|
511
|
+
s(t(A), {
|
|
512
512
|
style: { "margin-top": ".5rem" },
|
|
513
513
|
size: "small",
|
|
514
514
|
onClick: e[19] || (e[19] = (a) => De(p.value.day, p.value.ids))
|
|
@@ -527,5 +527,5 @@ const Le = { class: "work" }, Ze = { class: "nav" }, qe = { style: { height: "10
|
|
|
527
527
|
}
|
|
528
528
|
};
|
|
529
529
|
export {
|
|
530
|
-
|
|
530
|
+
ol as default
|
|
531
531
|
};
|