@studio-west/employees 0.5.20 → 0.5.21
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 +83 -80
- 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 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=
|
|
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(
|
|
3
|
-
`+t.day.toString()},{default:e.withCtx(s=>[e.createElementVNode("div",
|
|
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=["innerHTML"],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(""),H=e.ref([]),S=e.ref([]),c=e.ref({name:"Имя",length:0,code:""}),A=e.ref(!1),Y=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=>{let l=new Date().getMonth(),o=a===null?l:a-1;o=l-1<=o?o:o+12,w.value=new Date(new Date().getFullYear(),o,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,Y.value.y=d.clientY,Y.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=>{H.value.some(k=>(k==null?void 0:k.value)===g.divisionName)||H.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(H.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",{style:{height:"100px",width:"100%",display:"inline-block"},innerHTML:J(t.day,s.$index)||" "},null,8,ge)]),_: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:Y.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,11 +1,11 @@
|
|
|
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
|
|
1
|
+
import { ref as s, watch as ce, computed as Se, resolveComponent as Ve, resolveDirective as De, createElementBlock as A, 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 b, toDisplayString as h, normalizeStyle as Ne } from "vue";
|
|
2
|
+
import { saveAs as Me } from "file-saver";
|
|
3
|
+
import * as Ae from "exceljs";
|
|
4
4
|
import { p as R, b as oe, h as Be, c as D } from "./index-DIjJDdmP.js";
|
|
5
|
-
import { useI18n as
|
|
6
|
-
import { ElSelect as
|
|
7
|
-
import { ContextMenu as Pe, ContextMenuItem as je, ContextMenuSeparator as
|
|
8
|
-
const
|
|
5
|
+
import { useI18n as Te } from "vue-i18n";
|
|
6
|
+
import { ElSelect as ze, ElOption as Fe, ElButton as N, ElSwitch as ue, ElSkeleton as Ie, ElTable as Ue, ElTableColumn as T, ElSkeletonItem as W, ElDialog as He, ElForm as Ye, ElFormItem as Re, ElRadioGroup as We, ElRadioButton as de, ElSlider as P } from "element-plus";
|
|
7
|
+
import { ContextMenu as Pe, ContextMenuItem as je, ContextMenuSeparator as Le } from "@imengyu/vue3-context-menu";
|
|
8
|
+
const Oe = { class: "work" }, Ge = { class: "nav" }, Ze = { style: { height: "100px", width: "100%", display: "inline-block" } }, qe = ["innerHTML"], Je = {
|
|
9
9
|
key: 0,
|
|
10
10
|
class: "controls-container",
|
|
11
11
|
style: { "margin-top": ".5rem" }
|
|
@@ -23,8 +23,8 @@ const Ge = { class: "work" }, Le = { class: "nav" }, Ze = { style: { height: "10
|
|
|
23
23
|
workSchedule: Object,
|
|
24
24
|
fullName: { type: String, default: "Вы" }
|
|
25
25
|
},
|
|
26
|
-
setup(
|
|
27
|
-
const { t: d, d: j } =
|
|
26
|
+
setup(z) {
|
|
27
|
+
const { t: d, d: j } = Te(), x = z, L = 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,22 +37,22 @@ const Ge = { class: "work" }, Le = { class: "nav" }, Ze = { style: { height: "10
|
|
|
37
37
|
// code: '0000-00052'
|
|
38
38
|
// ids: 1
|
|
39
39
|
// }
|
|
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),
|
|
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), O = s(!1), re = s(!0), I = s(!1), Q = s("5"), U = s(1), V = s(""), X = s([]), E = s([]), g = s({ name: "Имя", length: 0, code: "" }), G = s(!1), _ = s({
|
|
41
41
|
zIndex: 30,
|
|
42
42
|
minWidth: 220,
|
|
43
43
|
x: 500,
|
|
44
44
|
y: 200
|
|
45
45
|
}), ve = s({}), ee = s("100%");
|
|
46
46
|
ce(V, async (a, e) => {
|
|
47
|
-
a !== e && (E.value = [],
|
|
47
|
+
a !== e && (E.value = [], O.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
49
|
}), le());
|
|
50
50
|
}), ce(K, async (a) => {
|
|
51
51
|
let e = (/* @__PURE__ */ new Date()).getMonth(), o = a === null ? e : a - 1;
|
|
52
|
-
o = e - 1 <= o ? o : o +
|
|
52
|
+
o = e - 1 <= o ? o : o + 12, C.value = new Date((/* @__PURE__ */ new Date()).getFullYear(), o, 1), se();
|
|
53
53
|
});
|
|
54
54
|
const pe = (a, e, o, r) => {
|
|
55
|
-
|
|
55
|
+
g.value.ids = a.ids, g.value.key = a.key, g.value.add = a.days.length > 0 && a.days[a.days.length - 1].cont, g.value.level = e.level, g.value.day = o.cellIndex, _.value.y = r.clientY, _.value.x = r.clientX, e.level === 2 && e.no === 0 && x.checkEdit && (g.value.name = d("workSchedule.autocomplete"), G.value = !0), e.level === 3 && o.cellIndex - e.no === 1 && x.checkEdit && (M(o.cellIndex, a.ids), g.value.name = d("workSchedule.modeSelection"), G.value = !0);
|
|
56
56
|
}, se = () => {
|
|
57
57
|
const a = ve.value, e = new Date(C.value), o = new Date(e.getFullYear(), e.getMonth() + 1, 0).getDate();
|
|
58
58
|
let r = [], l = 0;
|
|
@@ -86,56 +86,56 @@ const Ge = { class: "work" }, Le = { class: "nav" }, Ze = { style: { height: "10
|
|
|
86
86
|
(e) => {
|
|
87
87
|
e.forEach((o, r) => {
|
|
88
88
|
o !== null && (n.value[r].days = o.data.days, n.value[r].id = o.id);
|
|
89
|
-
}),
|
|
89
|
+
}), H();
|
|
90
90
|
}
|
|
91
91
|
);
|
|
92
|
-
},
|
|
92
|
+
}, H = () => {
|
|
93
93
|
n.value.forEach((a) => {
|
|
94
94
|
a.contHour = a.days.reduce((e, o) => e + o.time, 0);
|
|
95
95
|
});
|
|
96
96
|
}, we = (a) => {
|
|
97
|
-
n.value[a].days = [],
|
|
97
|
+
n.value[a].days = [], H();
|
|
98
98
|
}, ke = (a) => {
|
|
99
99
|
switch (Q.value) {
|
|
100
100
|
case "5":
|
|
101
101
|
for (let e = U.value; e <= u.value.length; e++)
|
|
102
|
-
u.value[e - 1].holidays === "" &&
|
|
102
|
+
u.value[e - 1].holidays === "" && M(e, a, !0), u.value[e - 1].holidays === "preholiday" && (k.value -= 1, M(e, a, !0), k.value += 1);
|
|
103
103
|
break;
|
|
104
104
|
case "2x2":
|
|
105
105
|
for (let e = U.value; e <= u.value.length; e += 4)
|
|
106
|
-
|
|
106
|
+
M(e, a, !0), e + 1 <= u.value.length && M(e + 1, a, !0);
|
|
107
107
|
break;
|
|
108
108
|
case "2x5":
|
|
109
109
|
for (let e = U.value; e <= u.value.length; e += 7)
|
|
110
110
|
for (let o = e; o < e + 5 && o <= u.value.length; o++)
|
|
111
|
-
u.value[o - 1].holidays === "preholiday" ? (k.value -= 1,
|
|
111
|
+
u.value[o - 1].holidays === "preholiday" ? (k.value -= 1, M(o, a, !0), k.value += 1) : M(o, a, !0);
|
|
112
112
|
break;
|
|
113
113
|
}
|
|
114
|
-
},
|
|
114
|
+
}, M = (a, e, o = !1) => {
|
|
115
115
|
const { date: r, ind: l } = Z(a, e);
|
|
116
116
|
l === -1 ? (n.value[e].days.push({
|
|
117
117
|
day: r,
|
|
118
118
|
time: k.value,
|
|
119
119
|
tips: `(${S.value}:00 - ${S.value + k.value + 1}:00)`
|
|
120
|
-
}),
|
|
120
|
+
}), H()) : o || (k.value = n.value[e].days[l].time, S.value = parseInt(n.value[e].days[l].tips.slice(1, -12)));
|
|
121
121
|
}, Ce = (a, e) => {
|
|
122
122
|
const { ind: o } = Z(a, e);
|
|
123
|
-
n.value[e].days.splice(o, 1),
|
|
123
|
+
n.value[e].days.splice(o, 1), H(), document.querySelector(".app-main").click();
|
|
124
124
|
}, ge = (a, e) => {
|
|
125
125
|
const { date: o, ind: r } = Z(a, e);
|
|
126
126
|
n.value[e].days[r] = {
|
|
127
127
|
day: o,
|
|
128
128
|
time: k.value,
|
|
129
129
|
tips: `(${S.value}:00 - ${S.value + k.value + 1}:00)`
|
|
130
|
-
},
|
|
130
|
+
}, H();
|
|
131
131
|
}, Z = (a, e) => {
|
|
132
132
|
var l;
|
|
133
133
|
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);
|
|
134
134
|
return { date: o, ind: r };
|
|
135
135
|
}, $e = async () => {
|
|
136
136
|
var he;
|
|
137
|
-
|
|
138
|
-
const a = new
|
|
137
|
+
L.value = !0;
|
|
138
|
+
const a = new Ae.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 };
|
|
139
139
|
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})`;
|
|
140
140
|
for (let c = 2; c <= u.value.length + 1; c++)
|
|
141
141
|
e.getCell(4, c).value = u.value[c - 2].weekday + `
|
|
@@ -144,9 +144,9 @@ const Ge = { class: "work" }, Le = { class: "nav" }, Ze = { style: { height: "10
|
|
|
144
144
|
let m = 0;
|
|
145
145
|
for (const c of n.value) {
|
|
146
146
|
let q = [c.name];
|
|
147
|
-
for (let
|
|
148
|
-
const { ind: te } = Z(
|
|
149
|
-
te !== -1 ? q[
|
|
147
|
+
for (let Y = 1; Y <= u.value.length; Y++) {
|
|
148
|
+
const { ind: te } = Z(Y, m);
|
|
149
|
+
te !== -1 ? q[Y] = `${c.days[te].time} ${c.days[te].tips}` : q[Y] = " ";
|
|
150
150
|
}
|
|
151
151
|
q.push(((he = c.days) == null ? void 0 : he.length) || " ", c.contHour || 0);
|
|
152
152
|
const xe = e.addRow(q);
|
|
@@ -157,17 +157,17 @@ const Ge = { class: "work" }, Le = { class: "nav" }, Ze = { style: { height: "10
|
|
|
157
157
|
c.roleName === "Начальник отдела правовой и кадровой работы" && (y = c.employeeName);
|
|
158
158
|
}), 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" } };
|
|
159
159
|
const p = "export_" + R(Date.now(), "{dd}.{m}.{Y}") + ".xlsx", $ = await a.xlsx.writeBuffer();
|
|
160
|
-
|
|
160
|
+
Me(new Blob([$]), p), L.value = !1;
|
|
161
161
|
}, be = async () => {
|
|
162
|
-
|
|
162
|
+
O.value || x.workSchedule.addWorkSchedule({ data: n.value, date: R(new Date(C.value), "{Y}-{m}-{dd}") }).then((a) => O.value = a);
|
|
163
163
|
};
|
|
164
164
|
return Be().then((a) => {
|
|
165
165
|
ve.value = a, se();
|
|
166
166
|
}), (a, e) => {
|
|
167
167
|
const o = Ve("el-date-picker"), r = De("loading");
|
|
168
|
-
return f(),
|
|
169
|
-
w("div",
|
|
170
|
-
|
|
168
|
+
return f(), A("div", Oe, [
|
|
169
|
+
w("div", Ge, [
|
|
170
|
+
z.checkEdit ? (f(), B(t(ze), {
|
|
171
171
|
key: 0,
|
|
172
172
|
modelValue: V.value,
|
|
173
173
|
"onUpdate:modelValue": e[0] || (e[0] = (l) => V.value = l),
|
|
@@ -175,7 +175,7 @@ const Ge = { class: "work" }, Le = { class: "nav" }, Ze = { style: { height: "10
|
|
|
175
175
|
style: { width: "240px" }
|
|
176
176
|
}, {
|
|
177
177
|
default: v(() => [
|
|
178
|
-
(f(!0),
|
|
178
|
+
(f(!0), A(ae, null, ne(X.value, (l) => (f(), B(t(Fe), {
|
|
179
179
|
key: l.value,
|
|
180
180
|
label: l.label,
|
|
181
181
|
value: l.value
|
|
@@ -183,13 +183,13 @@ const Ge = { class: "work" }, Le = { class: "nav" }, Ze = { style: { height: "10
|
|
|
183
183
|
]),
|
|
184
184
|
_: 1
|
|
185
185
|
}, 8, ["modelValue"])) : J("", !0),
|
|
186
|
-
|
|
186
|
+
z.checkEdit ? (f(), B(t(N), {
|
|
187
187
|
key: 1,
|
|
188
188
|
plain: "",
|
|
189
189
|
onClick: e[1] || (e[1] = (l) => I.value = !0)
|
|
190
190
|
}, {
|
|
191
191
|
default: v(() => [
|
|
192
|
-
b(
|
|
192
|
+
b(h(t(d)("workSchedule.jobTitle")), 1)
|
|
193
193
|
]),
|
|
194
194
|
_: 1
|
|
195
195
|
})) : J("", !0),
|
|
@@ -256,28 +256,28 @@ const Ge = { class: "work" }, Le = { class: "nav" }, Ze = { style: { height: "10
|
|
|
256
256
|
"empty-text": t(d)("workSchedule.emptyText")
|
|
257
257
|
}, {
|
|
258
258
|
default: v(() => [
|
|
259
|
-
i(t(
|
|
259
|
+
i(t(T), {
|
|
260
260
|
label: t(d)("workSchedule.title", { name: V.value }) + t(j)(C.value, "month") + ` ${new Date(C.value).getFullYear()}`,
|
|
261
261
|
align: "center",
|
|
262
262
|
height: "34"
|
|
263
263
|
}, {
|
|
264
264
|
default: v(() => [
|
|
265
|
-
i(t(
|
|
265
|
+
i(t(T), {
|
|
266
266
|
label: t(d)("workSchedule.month"),
|
|
267
267
|
width: "180",
|
|
268
268
|
align: "center"
|
|
269
269
|
}, {
|
|
270
270
|
default: v((l) => [
|
|
271
|
-
w("div", Ze,
|
|
271
|
+
w("div", Ze, h(n.value[l.$index].name), 1)
|
|
272
272
|
]),
|
|
273
273
|
_: 1
|
|
274
274
|
}, 8, ["label"]),
|
|
275
|
-
i(t(
|
|
275
|
+
i(t(T), {
|
|
276
276
|
label: t(d)("workSchedule.numbersMonth"),
|
|
277
277
|
align: "center"
|
|
278
278
|
}, {
|
|
279
279
|
default: v(() => [
|
|
280
|
-
(f(!0),
|
|
280
|
+
(f(!0), A(ae, null, ne(u.value, (l) => (f(), B(t(T), {
|
|
281
281
|
key: l.day,
|
|
282
282
|
width: "45",
|
|
283
283
|
"class-name": l.holidays,
|
|
@@ -286,35 +286,38 @@ const Ge = { class: "work" }, Le = { class: "nav" }, Ze = { style: { height: "10
|
|
|
286
286
|
` + l.day.toString()
|
|
287
287
|
}, {
|
|
288
288
|
default: v((m) => [
|
|
289
|
-
w("div",
|
|
289
|
+
w("div", {
|
|
290
|
+
style: { height: "100px", width: "100%", display: "inline-block" },
|
|
291
|
+
innerHTML: me(l.day, m.$index) || " "
|
|
292
|
+
}, null, 8, qe)
|
|
290
293
|
]),
|
|
291
294
|
_: 2
|
|
292
295
|
}, 1032, ["class-name", "label"]))), 128))
|
|
293
296
|
]),
|
|
294
297
|
_: 1
|
|
295
298
|
}, 8, ["label"]),
|
|
296
|
-
i(t(
|
|
299
|
+
i(t(T), {
|
|
297
300
|
label: t(d)("workSchedule.onSchedule"),
|
|
298
301
|
align: "center"
|
|
299
302
|
}, {
|
|
300
303
|
default: v(() => [
|
|
301
|
-
i(t(
|
|
304
|
+
i(t(T), {
|
|
302
305
|
label: t(d)("workSchedule.days"),
|
|
303
306
|
align: "center"
|
|
304
307
|
}, {
|
|
305
308
|
default: v((l) => [
|
|
306
|
-
b(
|
|
309
|
+
b(h(n.value[l.$index].days.length || 0), 1)
|
|
307
310
|
]),
|
|
308
311
|
_: 1
|
|
309
312
|
}, 8, ["label"]),
|
|
310
|
-
i(t(
|
|
313
|
+
i(t(T), {
|
|
311
314
|
label: `${t(d)("workSchedule.hours")} ( ${F.value} )`,
|
|
312
315
|
align: "center"
|
|
313
316
|
}, {
|
|
314
317
|
default: v((l) => [
|
|
315
318
|
w("div", {
|
|
316
319
|
style: Ne(`color: ${F.value === l.row.contHour ? "green" : "red"};`)
|
|
317
|
-
},
|
|
320
|
+
}, h(l.row.contHour), 5)
|
|
318
321
|
]),
|
|
319
322
|
_: 1
|
|
320
323
|
}, 8, ["label"])
|
|
@@ -330,35 +333,35 @@ const Ge = { class: "work" }, Le = { class: "nav" }, Ze = { style: { height: "10
|
|
|
330
333
|
]),
|
|
331
334
|
_: 1
|
|
332
335
|
}, 8, ["loading"]),
|
|
333
|
-
ye.value &&
|
|
334
|
-
b(
|
|
335
|
-
|
|
336
|
+
ye.value && z.checkEdit ? (f(), A("div", Je, [
|
|
337
|
+
b(h(t(d)("workSchedule.chartsFilled")) + ": ", 1),
|
|
338
|
+
O.value ? J("", !0) : (f(), B(t(N), {
|
|
336
339
|
key: 0,
|
|
337
340
|
type: "primary",
|
|
338
341
|
onClick: be
|
|
339
342
|
}, {
|
|
340
343
|
default: v(() => [
|
|
341
|
-
b(
|
|
344
|
+
b(h(t(d)("workSchedule.confirm")), 1)
|
|
342
345
|
]),
|
|
343
346
|
_: 1
|
|
344
347
|
})),
|
|
345
348
|
e[20] || (e[20] = b()),
|
|
346
|
-
w("span", null,
|
|
349
|
+
w("span", null, h(z.fullName), 1)
|
|
347
350
|
])) : J("", !0),
|
|
348
351
|
Ee((f(), B(t(N), {
|
|
349
|
-
disabled:
|
|
352
|
+
disabled: L.value,
|
|
350
353
|
plain: "",
|
|
351
354
|
onClick: $e,
|
|
352
355
|
style: { "margin-top": ".5rem" }
|
|
353
356
|
}, {
|
|
354
357
|
default: v(() => [
|
|
355
|
-
b(
|
|
358
|
+
b(h(t(d)("workSchedule.exportExcel")), 1)
|
|
356
359
|
]),
|
|
357
360
|
_: 1
|
|
358
361
|
}, 8, ["disabled"])), [
|
|
359
|
-
[r,
|
|
362
|
+
[r, L.value]
|
|
360
363
|
]),
|
|
361
|
-
i(t(
|
|
364
|
+
i(t(He), {
|
|
362
365
|
title: t(d)("workSchedule.jobTitle"),
|
|
363
366
|
modelValue: I.value,
|
|
364
367
|
"onUpdate:modelValue": e[6] || (e[6] = (l) => I.value = l),
|
|
@@ -370,7 +373,7 @@ const Ge = { class: "work" }, Le = { class: "nav" }, Ze = { style: { height: "10
|
|
|
370
373
|
size: "default"
|
|
371
374
|
}, {
|
|
372
375
|
default: v(() => [
|
|
373
|
-
b(
|
|
376
|
+
b(h(a.$t("workSchedule.cancel")), 1)
|
|
374
377
|
]),
|
|
375
378
|
_: 1
|
|
376
379
|
}),
|
|
@@ -380,19 +383,19 @@ const Ge = { class: "work" }, Le = { class: "nav" }, Ze = { style: { height: "10
|
|
|
380
383
|
onClick: le
|
|
381
384
|
}, {
|
|
382
385
|
default: v(() => [
|
|
383
|
-
b(
|
|
386
|
+
b(h(a.$t("workSchedule.select")), 1)
|
|
384
387
|
]),
|
|
385
388
|
_: 1
|
|
386
389
|
})
|
|
387
390
|
]),
|
|
388
391
|
default: v(() => [
|
|
389
|
-
i(t(
|
|
392
|
+
i(t(Ye), {
|
|
390
393
|
ref: "dialogForm",
|
|
391
394
|
model: E.value,
|
|
392
395
|
autocomplete: "on"
|
|
393
396
|
}, {
|
|
394
397
|
default: v(() => [
|
|
395
|
-
(f(!0),
|
|
398
|
+
(f(!0), A(ae, null, ne(E.value, (l) => (f(), B(t(Re), null, {
|
|
396
399
|
default: v(() => [
|
|
397
400
|
i(t(ue), {
|
|
398
401
|
modelValue: l.val,
|
|
@@ -409,17 +412,17 @@ const Ge = { class: "work" }, Le = { class: "nav" }, Ze = { style: { height: "10
|
|
|
409
412
|
_: 1
|
|
410
413
|
}, 8, ["title", "modelValue"]),
|
|
411
414
|
i(t(Pe), {
|
|
412
|
-
show:
|
|
413
|
-
"onUpdate:show": e[18] || (e[18] = (l) =>
|
|
415
|
+
show: G.value,
|
|
416
|
+
"onUpdate:show": e[18] || (e[18] = (l) => G.value = l),
|
|
414
417
|
options: _.value
|
|
415
418
|
}, {
|
|
416
419
|
default: v(() => [
|
|
417
420
|
i(t(je), {
|
|
418
|
-
label:
|
|
421
|
+
label: g.value.name,
|
|
419
422
|
disabled: ""
|
|
420
423
|
}, null, 8, ["label"]),
|
|
421
|
-
i(t(
|
|
422
|
-
|
|
424
|
+
i(t(Le)),
|
|
425
|
+
g.value.level === 2 ? (f(), A("div", Ke, [
|
|
423
426
|
i(t(We), {
|
|
424
427
|
modelValue: Q.value,
|
|
425
428
|
"onUpdate:modelValue": e[7] || (e[7] = (l) => Q.value = l),
|
|
@@ -442,7 +445,7 @@ const Ge = { class: "work" }, Le = { class: "nav" }, Ze = { style: { height: "10
|
|
|
442
445
|
_: 1
|
|
443
446
|
}, 8, ["modelValue"]),
|
|
444
447
|
e[21] || (e[21] = w("br", null, null, -1)),
|
|
445
|
-
w("span", null,
|
|
448
|
+
w("span", null, h(t(d)("workSchedule.fromDate")) + ":", 1),
|
|
446
449
|
i(t(P), {
|
|
447
450
|
modelValue: U.value,
|
|
448
451
|
"onUpdate:modelValue": e[8] || (e[8] = (l) => U.value = l),
|
|
@@ -450,7 +453,7 @@ const Ge = { class: "work" }, Le = { class: "nav" }, Ze = { style: { height: "10
|
|
|
450
453
|
min: 1,
|
|
451
454
|
max: u.value.length
|
|
452
455
|
}, null, 8, ["modelValue", "max"]),
|
|
453
|
-
w("span", null,
|
|
456
|
+
w("span", null, h(t(d)("workSchedule.with")) + ":", 1),
|
|
454
457
|
i(t(P), {
|
|
455
458
|
modelValue: S.value,
|
|
456
459
|
"onUpdate:modelValue": e[9] || (e[9] = (l) => S.value = l),
|
|
@@ -458,7 +461,7 @@ const Ge = { class: "work" }, Le = { class: "nav" }, Ze = { style: { height: "10
|
|
|
458
461
|
min: 8,
|
|
459
462
|
max: 11
|
|
460
463
|
}, null, 8, ["modelValue"]),
|
|
461
|
-
w("span", null,
|
|
464
|
+
w("span", null, h(t(d)("workSchedule.duration")) + ":", 1),
|
|
462
465
|
i(t(P), {
|
|
463
466
|
modelValue: k.value,
|
|
464
467
|
"onUpdate:modelValue": e[10] || (e[10] = (l) => k.value = l),
|
|
@@ -469,51 +472,51 @@ const Ge = { class: "work" }, Le = { class: "nav" }, Ze = { style: { height: "10
|
|
|
469
472
|
i(t(N), {
|
|
470
473
|
style: { "margin-top": ".5rem" },
|
|
471
474
|
size: "small",
|
|
472
|
-
onClick: e[11] || (e[11] = (l) => ke(
|
|
475
|
+
onClick: e[11] || (e[11] = (l) => ke(g.value.ids))
|
|
473
476
|
}, {
|
|
474
477
|
default: v(() => [
|
|
475
|
-
b(
|
|
478
|
+
b(h(t(d)("workSchedule.fillOut")), 1)
|
|
476
479
|
]),
|
|
477
480
|
_: 1
|
|
478
481
|
}),
|
|
479
482
|
i(t(N), {
|
|
480
483
|
style: { "margin-top": ".5rem" },
|
|
481
484
|
size: "small",
|
|
482
|
-
onClick: e[12] || (e[12] = (l) => we(
|
|
485
|
+
onClick: e[12] || (e[12] = (l) => we(g.value.ids))
|
|
483
486
|
}, {
|
|
484
487
|
default: v(() => [
|
|
485
|
-
b(
|
|
488
|
+
b(h(t(d)("workSchedule.clearRow")), 1)
|
|
486
489
|
]),
|
|
487
490
|
_: 1
|
|
488
491
|
})
|
|
489
|
-
])) : (f(),
|
|
490
|
-
w("div", null,
|
|
492
|
+
])) : (f(), A("div", Qe, [
|
|
493
|
+
w("div", null, h(me(g.value.day, g.value.ids)), 1),
|
|
491
494
|
e[22] || (e[22] = w("br", null, null, -1)),
|
|
492
|
-
w("span", null,
|
|
495
|
+
w("span", null, h(t(d)("workSchedule.with")) + ":", 1),
|
|
493
496
|
i(t(P), {
|
|
494
497
|
modelValue: S.value,
|
|
495
498
|
"onUpdate:modelValue": e[13] || (e[13] = (l) => S.value = l),
|
|
496
499
|
step: 1,
|
|
497
500
|
min: 8,
|
|
498
501
|
max: 11,
|
|
499
|
-
onChange: e[14] || (e[14] = (l) => ge(
|
|
502
|
+
onChange: e[14] || (e[14] = (l) => ge(g.value.day, g.value.ids))
|
|
500
503
|
}, null, 8, ["modelValue"]),
|
|
501
|
-
w("span", null,
|
|
504
|
+
w("span", null, h(t(d)("workSchedule.duration")) + ":", 1),
|
|
502
505
|
i(t(P), {
|
|
503
506
|
modelValue: k.value,
|
|
504
507
|
"onUpdate:modelValue": e[15] || (e[15] = (l) => k.value = l),
|
|
505
508
|
step: 1,
|
|
506
509
|
min: 4,
|
|
507
510
|
max: 12,
|
|
508
|
-
onChange: e[16] || (e[16] = (l) => ge(
|
|
511
|
+
onChange: e[16] || (e[16] = (l) => ge(g.value.day, g.value.ids))
|
|
509
512
|
}, null, 8, ["modelValue"]),
|
|
510
513
|
i(t(N), {
|
|
511
514
|
style: { "margin-top": ".5rem" },
|
|
512
515
|
size: "small",
|
|
513
|
-
onClick: e[17] || (e[17] = (l) => Ce(
|
|
516
|
+
onClick: e[17] || (e[17] = (l) => Ce(g.value.day, g.value.ids))
|
|
514
517
|
}, {
|
|
515
518
|
default: v(() => [
|
|
516
|
-
b(
|
|
519
|
+
b(h(t(d)("workSchedule.delete")), 1)
|
|
517
520
|
]),
|
|
518
521
|
_: 1
|
|
519
522
|
})
|