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