@studio-west/employees 0.7.1 → 0.7.3
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 +60 -59
- package/package.json +1 -1
package/dist/WorkTable.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),
|
|
2
|
-
`+((x=n.value[l].days[v])==null?void 0:x.time)},G=()=>{n.value=[],H.value=[],T.value=[],m.odata.personal.forEach(t=>{if(V.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,H.value.push(t.code)}),m.workSchedule.getUsersYear({code:H.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})}),
|
|
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 Y=1;Y<=u.value.length;Y++){const{ind:J}=R(Y,a);J!==-1?B[Y]=`${i.days[J].time} ${i.days[J].tips}`:B[Y]=" "}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();
|
|
4
|
-
`+a.day.toString(),prop:"vacation"},{default:e.withCtx(y=>[e.createElementVNode("div",
|
|
1
|
+
"use strict";const e=require("vue"),de=require("file-saver"),se=require("exceljs"),c=require("./index-uKIn9vG1.cjs"),ve=require("vue-i18n"),d=require("element-plus"),_=require("@imengyu/vue3-context-menu");function ce(k){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(k){for(const S in k)if(S!=="default"){const m=Object.getOwnPropertyDescriptor(k,S);Object.defineProperty(r,S,m.get?m:{enumerable:!0,get:()=>k[S]})}}return r.default=k,Object.freeze(r)}const me=ce(se),ge={class:"work"},he={class:"nav"},fe={style:{height:"100px",width:"100%",display:"inline-block"}},pe={style:{height:"100px",width:"100%",display:"inline-block"}},ye={key:0,class:"controls-container",style:{"margin-top":".5rem"}},we={class:"label"},Ce={key:0,style:{padding:"0.5em 1.5em"}},ke={key:1,style:{padding:"0.5em 1.5em"}},Ve={__name:"WorkTable",props:{checkEdit:{type:Boolean,default:()=>!0},odata:Object,workSchedule:Object,fullName:{type:String,default:"Вы"},query:Object},setup(k){var X;const{t:r,d:S}=ve.useI18n(),m=k,U=e.ref(!1),n=e.ref([]),j=e.ref((X=m.query)!=null&&X.date?new Date(m.query.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),I=e.ref(!1),$=e.ref(!1),P=e.ref("5"),A=e.ref(1),V=e.ref([]),W=e.ref([]),N=e.ref([]),H=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(V,async(t,l)=>{t!==l&&(N.value=[],I.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(j,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 ee=(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)},le=({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:S(new Date(t.getFullYear(),t.getMonth(),w),"day")})}M.value=s,u.value=o,m.odata.getPersonal({dismissed:"false"}).then(w=>{var C;V.value.length===0&&(V.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}),V.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()})},te=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=[],H.value=[],T.value=[],m.odata.personal.forEach(t=>{if(V.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,H.value.push(t.code)}),m.workSchedule.getUsersYear({code:H.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})}),ae(),$.value=!1})},ae=()=>{m.workSchedule.getWorkSchedule({code:H.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)}),q()})},q=()=>{n.value.forEach(t=>{t.contHour=t.days.reduce((l,o)=>l+o.time,0)})},ne=t=>{n.value[t].days=[],q()},oe=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}=R(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)`}),q()):o||(f.value=n.value[l].days[v].time,p.value=parseInt(n.value[l].days[v].tips.slice(1,-12)))},ue=(t,l)=>{const{ind:o}=R(t,l);n.value[l].days.splice(o,1),q(),document.querySelector(".app-main").click()},K=(t,l)=>{const{date:o,ind:s}=R(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)`},q()},R=(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}},re=async()=>{var C;U.value=!0;const t=new me.Workbook,l=t.addWorksheet(S(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+6)}1`),l.mergeCells(`A2:${c.cellsDynamically("A2",u.value.length+6)}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:V.value[0]})+S(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 Y=1;Y<=u.value.length;Y++){const{ind:J}=R(Y,a);J!==-1?B[Y]=`${i.days[J].time} ${i.days[J].tips}`:B[Y]=" "}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();de.saveAs(new Blob([w]),x),U.value=!1},ie=async()=>{I.value||m.workSchedule.addWorkSchedule({data:n.value,date:c.parseTime(new Date(h.value),"{Y}-{m}-{dd}"),group:V.value[0]}).then(t=>I.value=t)};return m.query.group&&(V.value[0]=m.query.group),m.query.date&&(h.value=new Date(m.query.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",ge,[e.createElementVNode("div",he,[k.checkEdit?(e.openBlock(),e.createBlock(e.unref(d.ElSelect),{key:0,modelValue:V.value,"onUpdate:modelValue":l[0]||(l[0]=a=>V.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:j.value,"onUpdate:modelValue":l[2]||(l[2]=a=>j.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:ee,"empty-text":e.unref(r)("workSchedule.emptyText"),"cell-class-name":le},{default:e.withCtx(()=>[e.createVNode(e.unref(d.ElTableColumn),{label:e.unref(r)("workSchedule.title",{name:V.value[0]})+e.unref(S)(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",fe,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:`${h.value.getTime()}-${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",pe,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"]),te.value&&k.checkEdit?(e.openBlock(),e.createElementBlock("div",ye,[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.chartsFilled"))+": ",1),I.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(d.ElButton),{key:0,type:"primary",onClick:ie},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.confirm")),1)]),_:1})),l[22]||(l[22]=e.createTextVNode()),e.createElementVNode("span",null,e.toDisplayString(k.fullName),1)])):e.createCommentVNode("",!0),e.withDirectives((e.openBlock(),e.createBlock(e.unref(d.ElButton),{disabled:U.value,plain:"",onClick:re,style:{"margin-top":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.exportExcel")),1)]),_:1},8,["disabled"])),[[v,U.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(_.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",we,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(_.ContextMenuSeparator)),g.value.level===2?(e.openBlock(),e.createElementBlock("div",Ce,[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=>oe(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=>ne(g.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.clearRow")),1)]),_:1})])):(e.openBlock(),e.createElementBlock("div",ke,[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=>ue(g.value.day,g.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.delete")),1)]),_:1})]))]),_:1},8,["show","options"])])}}};module.exports=Ve;
|
package/dist/WorkTable.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { ref as g, watch as
|
|
2
|
-
import { saveAs as
|
|
3
|
-
import * as
|
|
4
|
-
import { p as L, b as se, h as
|
|
5
|
-
import { useI18n as
|
|
6
|
-
import { ElSelect as
|
|
7
|
-
import { ContextMenu as
|
|
8
|
-
const
|
|
1
|
+
import { ref as g, watch as fe, computed as Ne, resolveComponent as ye, resolveDirective as Te, 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 ze } from "file-saver";
|
|
3
|
+
import * as Fe from "exceljs";
|
|
4
|
+
import { p as L, b as se, h as Ye, c as we, a as ke, d as V } from "./index-DaZTfcYO.js";
|
|
5
|
+
import { useI18n as Ue } from "vue-i18n";
|
|
6
|
+
import { ElSelect as He, ElOption as Ie, ElButton as T, ElSwitch as ve, ElTable as qe, ElTableColumn as Y, ElDialog as Re, ElForm as We, ElFormItem as je, ElRadioGroup as Pe, ElRadioButton as ge, ElSlider as Z } from "element-plus";
|
|
7
|
+
import { ContextMenu as Oe, ContextMenuSeparator as Ge } from "@imengyu/vue3-context-menu";
|
|
8
|
+
const Le = { class: "work" }, Ze = { class: "nav" }, Je = { style: { height: "100px", width: "100%", display: "inline-block" } }, Qe = { style: { height: "100px", width: "100%", display: "inline-block" } }, Ke = {
|
|
9
9
|
key: 0,
|
|
10
10
|
class: "controls-container",
|
|
11
11
|
style: { "margin-top": ".5rem" }
|
|
12
|
-
},
|
|
12
|
+
}, Xe = { class: "label" }, _e = {
|
|
13
13
|
key: 0,
|
|
14
14
|
style: { padding: "0.5em 1.5em" }
|
|
15
|
-
},
|
|
15
|
+
}, el = {
|
|
16
16
|
key: 1,
|
|
17
17
|
style: { padding: "0.5em 1.5em" }
|
|
18
|
-
},
|
|
18
|
+
}, dl = {
|
|
19
19
|
__name: "WorkTable",
|
|
20
20
|
props: {
|
|
21
21
|
checkEdit: { type: Boolean, default: () => !0 },
|
|
@@ -25,7 +25,8 @@ const Ge = { class: "work" }, Le = { class: "nav" }, Ze = { style: { height: "10
|
|
|
25
25
|
query: Object
|
|
26
26
|
},
|
|
27
27
|
setup(I) {
|
|
28
|
-
|
|
28
|
+
var pe;
|
|
29
|
+
const { t: d, d: J } = Ue(), f = I, Q = g(!1), n = g([
|
|
29
30
|
// { name: 'Иванов П.М. (Ведущий работник месяца)',
|
|
30
31
|
// days: [], // {day: "2024-11-01", tips: '(9:00 - 18:00)', time: 8 }
|
|
31
32
|
// contHour: 0,
|
|
@@ -38,29 +39,29 @@ const Ge = { class: "work" }, Le = { class: "nav" }, Ze = { style: { height: "10
|
|
|
38
39
|
// code: '0000-00052'
|
|
39
40
|
// ids: 1
|
|
40
41
|
// }
|
|
41
|
-
]), le = g(f.query.date ? (/* @__PURE__ */ new Date(f.query.date + "T00:00:01")).getMonth() : (/* @__PURE__ */ new Date()).getMonth()), ae = g(!1), q = g([]), p = g(new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1)), o = g([]), R = g(0), k = g(9), y = g(8), K = g(!1), U = g(!1), te = g("5"), W = g(1), x = g([]), ne = g([]), N = g([]), X = g([]), c = g({ name: "Имя", length: 0, code: "" }), j = g(!1), ue = g({
|
|
42
|
+
]), le = g((pe = f.query) != null && pe.date ? (/* @__PURE__ */ new Date(f.query.date + "T00:00:01")).getMonth() : (/* @__PURE__ */ new Date()).getMonth()), ae = g(!1), q = g([]), p = g(new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1)), o = g([]), R = g(0), k = g(9), y = g(8), K = g(!1), U = g(!1), te = g("5"), W = g(1), x = g([]), ne = g([]), N = g([]), X = g([]), c = g({ name: "Имя", length: 0, code: "" }), j = g(!1), ue = g({
|
|
42
43
|
zIndex: 3,
|
|
43
44
|
minWidth: 230,
|
|
44
45
|
x: 500,
|
|
45
46
|
y: 200
|
|
46
47
|
}), A = g({}), P = g("100%");
|
|
47
|
-
|
|
48
|
+
fe(x, async (l, e) => {
|
|
48
49
|
l !== e && (N.value = [], K.value = !1, f.odata.personal.forEach((u) => {
|
|
49
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 }));
|
|
50
51
|
}), oe());
|
|
51
|
-
}),
|
|
52
|
+
}), fe(le, async (l) => {
|
|
52
53
|
let e = (/* @__PURE__ */ new Date()).getMonth(), u = l === null ? e : l - 1;
|
|
53
54
|
u = e - 1 <= u ? u - e >= 11 ? u - 12 : u : u + 12, p.value = new Date((/* @__PURE__ */ new Date()).getFullYear(), u, 1), me();
|
|
54
55
|
});
|
|
55
|
-
const
|
|
56
|
+
const Ce = (l, e, u, r) => {
|
|
56
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, ue.value.y = r.clientY, ue.value.x = r.clientX, e.level === 2 && e.no === 0 && f.checkEdit && (c.value.name = d("workSchedule.autocomplete"), j.value = !0), e.level === 3 && u.cellIndex - e.no === 1 && f.checkEdit && (B(u.cellIndex, l.ids), c.value.name = d("workSchedule.modeSelection"), j.value = !0);
|
|
57
|
-
},
|
|
58
|
+
}, $e = ({ row: l, columnIndex: e }) => {
|
|
58
59
|
if (!q.value || q.value.length === 0 || !ae.value) return "";
|
|
59
60
|
const u = new Date(new Date(p.value).getFullYear(), new Date(p.value).getMonth(), e).getTime() + 1e3;
|
|
60
61
|
for (let r of q.value) {
|
|
61
62
|
const { dateStart: v, dateEnd: a, code: C } = r;
|
|
62
63
|
if (v && a && C === l.code && e !== 0 && e <= o.value.length) {
|
|
63
|
-
const E = new Date(
|
|
64
|
+
const E = new Date(ke(v)).getTime(), $ = new Date(ke(a)).getTime();
|
|
64
65
|
if (u >= E && u <= $) return "vacation";
|
|
65
66
|
}
|
|
66
67
|
}
|
|
@@ -81,7 +82,7 @@ const Ge = { class: "work" }, Le = { class: "nav" }, Ze = { style: { height: "10
|
|
|
81
82
|
ne.value.some((M) => i.dismissalDate.length > 0 && new Date(i.dismissalDate) < new Date(p.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 });
|
|
82
83
|
}), oe();
|
|
83
84
|
});
|
|
84
|
-
},
|
|
85
|
+
}, Se = Ne(() => !n.value.some((l) => l.contHour !== R.value)), he = (l, e) => {
|
|
85
86
|
var a, C, E;
|
|
86
87
|
const u = new Date(p.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);
|
|
87
88
|
return e === -1 || v === -1 ? "" : ((C = n.value[e].days[v]) == null ? void 0 : C.tips) + `
|
|
@@ -97,9 +98,9 @@ const Ge = { class: "work" }, Le = { class: "nav" }, Ze = { style: { height: "10
|
|
|
97
98
|
}), f.workSchedule.getUsersYear({ code: X.value, year: new Date(p.value).getFullYear() }).then((l) => {
|
|
98
99
|
l.forEach((e) => {
|
|
99
100
|
e.dateStart && q.value.push({ code: e.code, dateStart: e.dateStart, dateEnd: e.dateEnd });
|
|
100
|
-
}),
|
|
101
|
+
}), be(), U.value = !1;
|
|
101
102
|
});
|
|
102
|
-
},
|
|
103
|
+
}, be = () => {
|
|
103
104
|
f.workSchedule.getWorkSchedule({ code: X.value, date: L(new Date(p.value), "{Y}-{m}-{dd}") }).then(
|
|
104
105
|
(l) => {
|
|
105
106
|
l.forEach((e, u) => {
|
|
@@ -111,9 +112,9 @@ const Ge = { class: "work" }, Le = { class: "nav" }, Ze = { style: { height: "10
|
|
|
111
112
|
n.value.forEach((l) => {
|
|
112
113
|
l.contHour = l.days.reduce((e, u) => e + u.time, 0);
|
|
113
114
|
});
|
|
114
|
-
}, be = (l) => {
|
|
115
|
-
n.value[l].days = [], O();
|
|
116
115
|
}, xe = (l) => {
|
|
116
|
+
n.value[l].days = [], O();
|
|
117
|
+
}, De = (l) => {
|
|
117
118
|
switch (te.value) {
|
|
118
119
|
case "5":
|
|
119
120
|
for (let e = W.value; e <= o.value.length; e++)
|
|
@@ -136,7 +137,7 @@ const Ge = { class: "work" }, Le = { class: "nav" }, Ze = { style: { height: "10
|
|
|
136
137
|
time: y.value,
|
|
137
138
|
tips: `(${k.value}:00 - ${y.value >= 22 ? k.value + y.value + 2 : k.value + y.value + 1}:00)`
|
|
138
139
|
}), O()) : u || (y.value = n.value[e].days[v].time, k.value = parseInt(n.value[e].days[v].tips.slice(1, -12)));
|
|
139
|
-
},
|
|
140
|
+
}, Ve = (l, e) => {
|
|
140
141
|
const { ind: u } = _(l, e);
|
|
141
142
|
n.value[e].days.splice(u, 1), O(), document.querySelector(".app-main").click();
|
|
142
143
|
}, ce = (l, e) => {
|
|
@@ -150,10 +151,10 @@ const Ge = { class: "work" }, Le = { class: "nav" }, Ze = { style: { height: "10
|
|
|
150
151
|
var v;
|
|
151
152
|
const u = L(new Date(p.value).setDate(l), "{Y}-{m}-{dd}"), r = (v = n.value[e]) == null ? void 0 : v.days.findIndex((a) => a.day === u);
|
|
152
153
|
return { date: u, ind: r };
|
|
153
|
-
},
|
|
154
|
+
}, Ee = async () => {
|
|
154
155
|
var b;
|
|
155
156
|
Q.value = !0;
|
|
156
|
-
const l = new
|
|
157
|
+
const l = new Fe.Workbook(), e = l.addWorksheet(J(p.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 };
|
|
157
158
|
e.mergeCells(`A1:${V("A1", o.value.length + 6)}1`), e.mergeCells(`A2:${V("A2", o.value.length + 6)}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(p.value, "month") + ` ${new Date(p.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")} (${R.value})`;
|
|
158
159
|
for (let i = 2; i <= o.value.length + 1; i++)
|
|
159
160
|
e.getCell(4, i).value = o.value[i - 2].weekday + `
|
|
@@ -175,17 +176,17 @@ const Ge = { class: "work" }, Le = { class: "nav" }, Ze = { style: { height: "10
|
|
|
175
176
|
i.roleName === "Начальник отдела правовой и кадровой работы" && (i.dismissalDate.length === 0 || new Date(i.dismissalDate) > new Date(thisMonth.value)) && (C = i.employeeName);
|
|
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(f.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" } };
|
|
177
178
|
const E = "export_" + L(Date.now(), "{dd}.{m}.{Y}") + ".xlsx", $ = await l.xlsx.writeBuffer();
|
|
178
|
-
|
|
179
|
-
},
|
|
179
|
+
ze(new Blob([$]), E), Q.value = !1;
|
|
180
|
+
}, Me = async () => {
|
|
180
181
|
K.value || f.workSchedule.addWorkSchedule({ data: n.value, date: L(new Date(p.value), "{Y}-{m}-{dd}"), group: x.value[0] }).then((l) => K.value = l);
|
|
181
182
|
};
|
|
182
|
-
return f.query.group && (x.value[0] = f.query.group), f.query.date && (p.value = /* @__PURE__ */ new Date(f.query.date + "T00:00:01")),
|
|
183
|
+
return f.query.group && (x.value[0] = f.query.group), f.query.date && (p.value = /* @__PURE__ */ new Date(f.query.date + "T00:00:01")), Ye().then((l) => {
|
|
183
184
|
A.value = l, me();
|
|
184
185
|
}), (l, e) => {
|
|
185
|
-
const u =
|
|
186
|
-
return S(), z("div",
|
|
187
|
-
w("div",
|
|
188
|
-
I.checkEdit ? (S(), F(t(
|
|
186
|
+
const u = ye("el-date-picker"), r = ye("svg-icon"), v = Te("loading");
|
|
187
|
+
return S(), z("div", Le, [
|
|
188
|
+
w("div", Ze, [
|
|
189
|
+
I.checkEdit ? (S(), F(t(He), {
|
|
189
190
|
key: 0,
|
|
190
191
|
modelValue: x.value,
|
|
191
192
|
"onUpdate:modelValue": e[0] || (e[0] = (a) => x.value = a),
|
|
@@ -196,7 +197,7 @@ const Ge = { class: "work" }, Le = { class: "nav" }, Ze = { style: { height: "10
|
|
|
196
197
|
style: { width: "240px" }
|
|
197
198
|
}, {
|
|
198
199
|
default: m(() => [
|
|
199
|
-
(S(!0), z(ie, null, re(ne.value, (a) => (S(), F(t(
|
|
200
|
+
(S(!0), z(ie, null, re(ne.value, (a) => (S(), F(t(Ie), {
|
|
200
201
|
key: a.key,
|
|
201
202
|
label: a.label,
|
|
202
203
|
value: a.value
|
|
@@ -238,16 +239,16 @@ const Ge = { class: "work" }, Le = { class: "nav" }, Ze = { style: { height: "10
|
|
|
238
239
|
"inactive-value": !1
|
|
239
240
|
}, null, 8, ["modelValue"])
|
|
240
241
|
]),
|
|
241
|
-
s(t(
|
|
242
|
+
s(t(qe), {
|
|
242
243
|
id: "printTable",
|
|
243
244
|
data: n.value,
|
|
244
245
|
style: { width: "100%" },
|
|
245
246
|
"max-height": P.value,
|
|
246
247
|
size: "small",
|
|
247
248
|
align: "center",
|
|
248
|
-
onCellClick:
|
|
249
|
+
onCellClick: Ce,
|
|
249
250
|
"empty-text": t(d)("workSchedule.emptyText"),
|
|
250
|
-
"cell-class-name":
|
|
251
|
+
"cell-class-name": $e
|
|
251
252
|
}, {
|
|
252
253
|
default: m(() => [
|
|
253
254
|
s(t(Y), {
|
|
@@ -263,7 +264,7 @@ const Ge = { class: "work" }, Le = { class: "nav" }, Ze = { style: { height: "10
|
|
|
263
264
|
fixed: P.value !== "100%"
|
|
264
265
|
}, {
|
|
265
266
|
default: m((a) => [
|
|
266
|
-
w("div",
|
|
267
|
+
w("div", Je, h(n.value[a.$index].name), 1)
|
|
267
268
|
]),
|
|
268
269
|
_: 1
|
|
269
270
|
}, 8, ["label", "fixed"]),
|
|
@@ -282,7 +283,7 @@ const Ge = { class: "work" }, Le = { class: "nav" }, Ze = { style: { height: "10
|
|
|
282
283
|
prop: "vacation"
|
|
283
284
|
}, {
|
|
284
285
|
default: m((C) => [
|
|
285
|
-
w("div",
|
|
286
|
+
w("div", Qe, h(he(a.day, C.$index) || " "), 1)
|
|
286
287
|
]),
|
|
287
288
|
_: 2
|
|
288
289
|
}, 1032, ["class-name", "label"]))), 128))
|
|
@@ -310,7 +311,7 @@ const Ge = { class: "work" }, Le = { class: "nav" }, Ze = { style: { height: "10
|
|
|
310
311
|
}, {
|
|
311
312
|
default: m((a) => [
|
|
312
313
|
w("div", {
|
|
313
|
-
style:
|
|
314
|
+
style: Be(`color: ${R.value === a.row.contHour ? "green" : "red"};`)
|
|
314
315
|
}, h(a.row.contHour), 5)
|
|
315
316
|
]),
|
|
316
317
|
_: 1
|
|
@@ -324,12 +325,12 @@ const Ge = { class: "work" }, Le = { class: "nav" }, Ze = { style: { height: "10
|
|
|
324
325
|
]),
|
|
325
326
|
_: 1
|
|
326
327
|
}, 8, ["data", "max-height", "empty-text"]),
|
|
327
|
-
|
|
328
|
+
Se.value && I.checkEdit ? (S(), z("div", Ke, [
|
|
328
329
|
D(h(t(d)("workSchedule.chartsFilled")) + ": ", 1),
|
|
329
330
|
K.value ? ee("", !0) : (S(), F(t(T), {
|
|
330
331
|
key: 0,
|
|
331
332
|
type: "primary",
|
|
332
|
-
onClick:
|
|
333
|
+
onClick: Me
|
|
333
334
|
}, {
|
|
334
335
|
default: m(() => [
|
|
335
336
|
D(h(t(d)("workSchedule.confirm")), 1)
|
|
@@ -339,10 +340,10 @@ const Ge = { class: "work" }, Le = { class: "nav" }, Ze = { style: { height: "10
|
|
|
339
340
|
e[22] || (e[22] = D()),
|
|
340
341
|
w("span", null, h(I.fullName), 1)
|
|
341
342
|
])) : ee("", !0),
|
|
342
|
-
|
|
343
|
+
Ae((S(), F(t(T), {
|
|
343
344
|
disabled: Q.value,
|
|
344
345
|
plain: "",
|
|
345
|
-
onClick:
|
|
346
|
+
onClick: Ee,
|
|
346
347
|
style: { "margin-top": ".5rem" }
|
|
347
348
|
}, {
|
|
348
349
|
default: m(() => [
|
|
@@ -352,7 +353,7 @@ const Ge = { class: "work" }, Le = { class: "nav" }, Ze = { style: { height: "10
|
|
|
352
353
|
}, 8, ["disabled"])), [
|
|
353
354
|
[v, Q.value]
|
|
354
355
|
]),
|
|
355
|
-
s(t(
|
|
356
|
+
s(t(Re), {
|
|
356
357
|
title: t(d)("workSchedule.jobTitle"),
|
|
357
358
|
modelValue: U.value,
|
|
358
359
|
"onUpdate:modelValue": e[7] || (e[7] = (a) => U.value = a),
|
|
@@ -382,13 +383,13 @@ const Ge = { class: "work" }, Le = { class: "nav" }, Ze = { style: { height: "10
|
|
|
382
383
|
})
|
|
383
384
|
]),
|
|
384
385
|
default: m(() => [
|
|
385
|
-
s(t(
|
|
386
|
+
s(t(We), {
|
|
386
387
|
ref: "dialogForm",
|
|
387
388
|
model: N.value,
|
|
388
389
|
autocomplete: "on"
|
|
389
390
|
}, {
|
|
390
391
|
default: m(() => [
|
|
391
|
-
(S(!0), z(ie, null, re(N.value, (a) => (S(), F(t(
|
|
392
|
+
(S(!0), z(ie, null, re(N.value, (a) => (S(), F(t(je), null, {
|
|
392
393
|
default: m(() => [
|
|
393
394
|
s(t(ve), {
|
|
394
395
|
modelValue: a.val,
|
|
@@ -404,7 +405,7 @@ const Ge = { class: "work" }, Le = { class: "nav" }, Ze = { style: { height: "10
|
|
|
404
405
|
]),
|
|
405
406
|
_: 1
|
|
406
407
|
}, 8, ["title", "modelValue"]),
|
|
407
|
-
s(t(
|
|
408
|
+
s(t(Oe), {
|
|
408
409
|
show: j.value,
|
|
409
410
|
"onUpdate:show": e[20] || (e[20] = (a) => j.value = a),
|
|
410
411
|
options: ue.value
|
|
@@ -414,13 +415,13 @@ const Ge = { class: "work" }, Le = { class: "nav" }, Ze = { style: { height: "10
|
|
|
414
415
|
class: "mx-context-menu-item",
|
|
415
416
|
onClick: e[8] || (e[8] = (a) => j.value = !1)
|
|
416
417
|
}, [
|
|
417
|
-
w("span",
|
|
418
|
+
w("span", Xe, h(c.value.name), 1),
|
|
418
419
|
e[23] || (e[23] = w("div", { class: "expander" }, null, -1)),
|
|
419
420
|
s(r, { "icon-class": "cross" })
|
|
420
421
|
]),
|
|
421
|
-
s(t(
|
|
422
|
-
c.value.level === 2 ? (S(), z("div",
|
|
423
|
-
s(t(
|
|
422
|
+
s(t(Ge)),
|
|
423
|
+
c.value.level === 2 ? (S(), z("div", _e, [
|
|
424
|
+
s(t(Pe), {
|
|
424
425
|
modelValue: te.value,
|
|
425
426
|
"onUpdate:modelValue": e[9] || (e[9] = (a) => te.value = a),
|
|
426
427
|
size: "small"
|
|
@@ -464,12 +465,12 @@ const Ge = { class: "work" }, Le = { class: "nav" }, Ze = { style: { height: "10
|
|
|
464
465
|
"onUpdate:modelValue": e[12] || (e[12] = (a) => y.value = a),
|
|
465
466
|
step: 1,
|
|
466
467
|
min: 4,
|
|
467
|
-
max: t(
|
|
468
|
+
max: t(we)(k.value !== 1 ? 23 - k.value : 21, 4, 22)
|
|
468
469
|
}, null, 8, ["modelValue", "max"]),
|
|
469
470
|
s(t(T), {
|
|
470
471
|
style: { "margin-top": ".5rem" },
|
|
471
472
|
size: "small",
|
|
472
|
-
onClick: e[13] || (e[13] = (a) =>
|
|
473
|
+
onClick: e[13] || (e[13] = (a) => De(c.value.ids))
|
|
473
474
|
}, {
|
|
474
475
|
default: m(() => [
|
|
475
476
|
D(h(t(d)("workSchedule.fillOut")), 1)
|
|
@@ -479,14 +480,14 @@ const Ge = { class: "work" }, Le = { class: "nav" }, Ze = { style: { height: "10
|
|
|
479
480
|
s(t(T), {
|
|
480
481
|
style: { "margin-top": ".5rem" },
|
|
481
482
|
size: "small",
|
|
482
|
-
onClick: e[14] || (e[14] = (a) =>
|
|
483
|
+
onClick: e[14] || (e[14] = (a) => xe(c.value.ids))
|
|
483
484
|
}, {
|
|
484
485
|
default: m(() => [
|
|
485
486
|
D(h(t(d)("workSchedule.clearRow")), 1)
|
|
486
487
|
]),
|
|
487
488
|
_: 1
|
|
488
489
|
})
|
|
489
|
-
])) : (S(), z("div",
|
|
490
|
+
])) : (S(), z("div", el, [
|
|
490
491
|
w("div", null, h(he(c.value.day, c.value.ids)), 1),
|
|
491
492
|
e[25] || (e[25] = w("br", null, null, -1)),
|
|
492
493
|
w("span", null, h(t(d)("workSchedule.with")) + ":", 1),
|
|
@@ -504,13 +505,13 @@ const Ge = { class: "work" }, Le = { class: "nav" }, Ze = { style: { height: "10
|
|
|
504
505
|
"onUpdate:modelValue": e[17] || (e[17] = (a) => y.value = a),
|
|
505
506
|
step: 1,
|
|
506
507
|
min: 4,
|
|
507
|
-
max: t(
|
|
508
|
+
max: t(we)(k.value !== 1 ? 23 - k.value : 21, 4, 22),
|
|
508
509
|
onChange: e[18] || (e[18] = (a) => ce(c.value.day, c.value.ids))
|
|
509
510
|
}, null, 8, ["modelValue", "max"]),
|
|
510
511
|
s(t(T), {
|
|
511
512
|
style: { "margin-top": ".5rem" },
|
|
512
513
|
size: "small",
|
|
513
|
-
onClick: e[19] || (e[19] = (a) =>
|
|
514
|
+
onClick: e[19] || (e[19] = (a) => Ve(c.value.day, c.value.ids))
|
|
514
515
|
}, {
|
|
515
516
|
default: m(() => [
|
|
516
517
|
D(h(t(d)("workSchedule.delete")), 1)
|
|
@@ -526,5 +527,5 @@ const Ge = { class: "work" }, Le = { class: "nav" }, Ze = { style: { height: "10
|
|
|
526
527
|
}
|
|
527
528
|
};
|
|
528
529
|
export {
|
|
529
|
-
|
|
530
|
+
dl as default
|
|
530
531
|
};
|