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