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