@studio-west/employees 0.6.41 → 0.6.43
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/SheetTable.cjs +1 -1
- package/dist/SheetTable.js +123 -121
- package/dist/WorkTable.cjs +1 -1
- package/dist/WorkTable.js +39 -37
- package/package.json +1 -1
package/dist/SheetTable.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),be=require("vue-i18n"),c=require("./index-Dn3djtwj.cjs"),m=require("element-plus"),I=require("@imengyu/vue3-context-menu"),se=require("file-saver"),we=require("exceljs");function xe(N){const p=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(N){for(const s in N)if(s!=="default"){const B=Object.getOwnPropertyDescriptor(N,s);Object.defineProperty(p,s,B.get?B:{enumerable:!0,get:()=>N[s]})}}return p.default=N,Object.freeze(p)}const $e=xe(we),De={class:"nav"},ke={style:{height:"20px",width:"100%",display:"inline-block"}},Ne={style:{height:"20px",width:"100%",display:"inline-block"}},Ve={class:"label"},Se={key:0,style:{padding:"0 1rem .5rem"}},Te={key:1,style:{padding:"0 1rem .5rem"}},Ee={__name:"SheetTable",props:{checkEdit:{type:Boolean,default:()=>!0},odata:Object,workSchedule:Object,fullName:{type:String,default:"Вы"},group:String,date:String,logo:{type:URL,default:"#"},editor:{type:Object,default:()=>({})}},setup(N){const p=N,{t:s,d:B}=be.useI18n(),q=e.ref(!1),b=e.ref([]),H=e.ref("0"),C=e.ref(new Date(new Date().getFullYear(),new Date().getMonth(),1).setMonth(new Date().getMonth()+Number(H.value))),d=e.ref([]),V=e.ref([]),Z=e.ref("100%"),_=e.ref("true"),Q=e.ref([]),de=e.ref([{value:"Я",label:s("sheet.valid.1")},{value:"К",label:s("sheet.valid.2")},{value:"ОТ",label:s("sheet.valid.3")},{value:"ДО",label:s("sheet.valid.4")},{value:"Р",label:s("sheet.valid.5")},{value:"ОЖ",label:s("sheet.valid.6")},{value:"Б",label:s("sheet.valid.7")},{value:"НН",label:s("sheet.valid.8")},{value:"ПР",label:s("sheet.valid.9")},{value:"У",label:s("sheet.valid.10")},{value:"УД",label:s("sheet.valid.11")},{value:"Г",label:s("sheet.valid.12")}]),ae=e.ref([]),ve=e.ref(0),$=e.ref(9),x=e.ref(8),k=e.ref(0),F=e.ref(0),O=e.ref([]),M=e.ref(!1),P=e.ref(!1),ee=e.ref([]),j=e.ref([]),T=e.ref(!1),J=e.ref(!1),L=e.ref(1),ne=e.ref(null),le=e.ref({zIndex:3,minWidth:230,x:500,y:200}),v=e.ref({name:"",length:0,code:""}),D=e.ref([]),G=e.ref(""),R=e.ref("_____"),r=e.computed(()=>b.value.flatMap((t,l)=>{const h=D.value.find(n=>n.code===t.code),o=new Map;t.days.forEach(n=>o.set(n.day,{...n})),h&&h.days.forEach(n=>o.set(n.day,{...n}));const f=Array.from(o.values());return[{...t,days:f,key:0,ids:l,numberNonAppearing:[0,0]},{...t,days:f,key:1,ids:l,numberNonAppearing:[0,0]}]}));e.watch(V,async(t,l)=>{t!==l&&(O.value=[],confirm.value=!1,p.odata.personal.forEach(h=>{t.includes(h.divisionName)&&(O.value.some(o=>(o==null?void 0:o.activeText)===h.roleName)||O.value.push({val:!0,activeText:h.roleName}))}),te())}),e.watch(H,t=>{C.value=new Date(new Date().getFullYear(),new Date().getMonth(),1).setMonth(new Date().getMonth()+Number(t)),oe(),te()}),e.watch(x,()=>M.value=T.value),e.watch($,()=>M.value=T.value),e.watch(L,()=>M.value=T.value);const ce=async(t,l,h,o)=>{if(l.level!==3||l.labelClassName==="turn"||l.no===15||l.no>d.value.length||!p.checkEdit)return"";v.value.ids=t.ids,v.value.key=t.key,v.value.day=l.no<15?l.no:l.no-1;const f=new Date(C.value),n=`${f.getFullYear()}-${(f.getMonth()+1).toString().padStart(2,"0")}-${(v.value.day+1).toString().padStart(2,"0")}`,i=D.value.findIndex(a=>a.code===t.code);v.value.id=i!==-1?D.value[i].days.findIndex(a=>(a==null?void 0:a.day)===n):i,$.value=typeof t.days[v.value.day].tips>"u"?9:parseInt(t.days[v.value.day].tips.match(/(\d{1,2})/)),k.value=typeof t.days[v.value.day].night>"u"?0:parseInt(t.days[v.value.day].night),F.value=typeof t.days[v.value.day].overtime>"u"?0:parseInt(t.days[v.value.day].overtime),x.value=t.days[v.value.day].time!=="-"?parseInt(t.days[v.value.day].time):8;const g=t.days.findIndex(a=>a.day===n);v.value.failure=t.days[g].state,le.value.y=o.clientY,le.value.x=o.clientX,v.value.rest=i!==-1&&v.value.id!==-1,v.value.name=c.byInitials(t.fio),T.value=!0,await e.nextTick(),M.value=!1},K=t=>{const l=new Date(C.value),h=`${l.getFullYear()}-${(l.getMonth()+1).toString().padStart(2,"0")}-${(v.value.day+1).toString().padStart(2,"0")}`;let o=D.value.findIndex(w=>w.code===b.value[v.value.ids].code);v.value.id=o!==-1?D.value[o].days.findIndex(w=>(w==null?void 0:w.day)===`${l.getFullYear()}-${(l.getMonth()+1).toString().padStart(2,"0")}-${(v.value.day+1).toString().padStart(2,"0")}`):o;let f=b.value[v.value.ids].days[v.value.day].state,n=t,i="-",g,a,y;switch(t){case"Я":f==="В"&&(n="РВ"),i=8;break;case"КВ":case"К":f==="В"||f==="КВ"?n="КВ":n="К";break;case"save":let w=W.value.split('"');n=w[1],M.value=!1,w[2]!==""&&(i=x.value,y="("+w[2].split("(")[1],g=k.value,a=F.value)}t==="reset"?(n=f,D.value[o].days.splice(v.value.id,1)):o===-1?D.value.push({code:b.value[v.value.ids].code,days:[{day:h,state:n,time:i,night:g,overtime:a,tips:y}]}):v.value.id===-1?D.value[o].days.push({day:h,state:n,time:i,night:g,overtime:a,tips:y}):D.value[o].days[v.value.id]={day:h,state:n,time:i,night:g,overtime:a,tips:y},o=D.value.findIndex(w=>w.code===b.value[v.value.ids].code),p.workSchedule.addWorkSheet({date:c.parseTime(new Date(C.value),"{Y}-{m}-{dd}"),data:[{name:b.value[v.value.ids].fio,days:D.value[o].days,code:b.value[v.value.ids].code}]}),v.value.failure=n,L.value>1&&(L.value--,v.value.day++,K(n)),ue()},W=e.computed(()=>{J.value=!1;let t=b.value[v.value.ids].days[v.value.day],l="";k.value=0,F.value=0;let h=x.value>=22?$.value+x.value+2:$.value+x.value+1,o=v.value.failure.split("/")[0];o=/^Н(?!Н$)С?$/.test(o)?t.state!=="В"?"Я":"РВ":o,/^(|Я|РВ)$/.test(o)&&(($.value<6||h>22)&&(l="Н",k.value=$.value<6?Math.min(6,h)-$.value:0,h<=6&&(k.value=x.value,o=""),h===7&&k.value>3&&k.value--,k.value+=Math.max(22,h)-22),x.value>t.time&&o!=="РВ"&&(l+="С",J.value=!0,F.value=x.value-t.time),/РВ/.test(o)&&(J.value=!0)),l.length>0&&o.length>0&&(l="/"+l);let f=`(${$.value}:00 - ${x.value>=22?$.value+x.value+2:$.value+x.value+1}:00)`,n=r.value[v.value.ids*2].days[v.value.day].time!=="-"?" "+x.value+" "+f:"";return'"'+o+l+'"'+n}),he=t=>{if(t.columnIndex<2||t.columnIndex>d.value.length+3&&t.columnIndex<d.value.length+9||t.columnIndex>d.value.length+11)return r.value[t.rowIndex].key===0?{rowspan:2,colspan:1}:{rowspan:0,colspan:0}},oe=()=>{const t=ae.value,l=new Date(C.value),h=new Date(l.getFullYear(),l.getMonth()+1,0).getDate();let o=[],f=0;for(let n=1;n<=h;n++){const i=c.parseTime(l.setDate(n),"{Y}-{m}-{dd}");f+=t.nowork.includes(i)||t.holidays.includes(i)?0:t.preholidays.includes(i)?7:8;let g=t.nowork.includes(i)?"nowork":t.holidays.includes(i)?"holiday":t.preholidays.includes(i)?"preholiday":"";o.push({day:n,holidays:g,weekday:B(new Date(l.getFullYear(),l.getMonth(),n),"day")})}return ve.value=f,d.value=o,p.odata.getPersonal({}).then(n=>{var i;V.value.length===0&&(V.value=[(i=n.find(g=>g.employeeName===p.fullName))==null?void 0:i.divisionName]),n.forEach(g=>{Q.value.some(a=>(a==null?void 0:a.value)===g.divisionName)||Q.value.push({value:g.divisionName,label:g.divisionName,key:g.divisionName})})}),!0},te=()=>{b.value=[],j.value=[],ee.value=[],p.odata.personal.forEach(t=>{if(V.value.includes(t.divisionName)&&O.value.some(l=>l.val&&l.activeText===t.roleName)){let l=c.byInitials(t.employeeName);j.value.push(t.employeeKey),b.value.push({fio:t.employeeName,name:l+" ("+t.roleName+")",code:t.employeeKey,days:[],contHour:0,id:!1,ids:b.value.length})}t.employeeName===p.fullName&&(R.value=t.roleName)}),p.workSchedule.getUsersYear({code:j.value,year:new Date(C.value).getFullYear()}).then(t=>{t.forEach(l=>{l.dateStart&&ee.value.push({code:l.code,dateStart:l.dateStart,dateEnd:l.dateEnd})}),me()})},me=()=>{p.workSchedule.getWorkSheet({code:j.value,date:c.parseTime(new Date(C.value),"{Y}-{m}-{dd}")}).then(t=>{D.value=[],t.forEach(l=>{l!==null&&D.value.push({code:l.code,days:l.data.days})}),p.workSchedule.getWorkSchedule({code:j.value,date:c.parseTime(new Date(C.value),"{Y}-{m}-{dd}")}).then(l=>{l.forEach((h,o)=>{var f,n;if(h!==null){b.value[o].days=[],h.data.days.forEach(i=>i.state="Я");for(let i=1;i<=d.value.length;i++){let g=c.parseTime(new Date(C.value).setDate(i),"{Y}-{m}-{dd}");const a=(f=h.data)==null?void 0:f.days.findIndex(y=>y.day===g);a===-1?X(i,o,"-","В"):b.value[o].days.push((n=h.data)==null?void 0:n.days[a])}}else for(let i=1;i<=d.value.length;i++)d.value[i-1].holidays===""?X(i,o,8):d.value[i-1].holidays==="preholiday"?X(i,o,7):X(i,o,"-","В");for(let i=1;i<=d.value.length;i++){let g=new Date(new Date(C.value).getFullYear(),new Date(C.value).getMonth(),i).getTime()+1e3;for(let a of ee.value){const{dateStart:y,dateEnd:w,code:A}=a;if(y&&w&&A===b.value[o].code){const Y=new Date(c.parseDate(y)).getTime(),z=new Date(c.parseDate(w)).getTime();if(g>=Y&&g<=z){const E=c.parseTime(new Date(C.value).setDate(i),"{Y}-{m}-{dd}"),u=b.value[o].days.findIndex(U=>U.day===E);u!==-1?b.value[o].days[u]={day:E,time:"-",state:"ОТ"}:b.value[o].days.push({day:E,time:"-",state:"ОТ"})}}}}}),ue()})})},X=(t,l,h,o="Я")=>{const f=c.parseTime(new Date(C.value).setDate(t),"{Y}-{m}-{dd}");b.value[l].days.push({day:f,time:h,state:o})},ue=()=>{r.value.forEach(t=>{t.hourI=0,t.hourII=0,t.halfII=0,t.halfI=0,t.weekend=0,t.weekendDays=0,t.overtime=0,t.night=0,t.appearing={code:"-",count:"-"};const l=Object.entries(t.days.reduce((n,i)=>{if(i.hasOwnProperty("state")&&/^(|К|КВ|ОТ|Б|Р|ПР|ОЖ|НН|У|ДО|УД|Г)$/.test(i.state)){const g=i.state;n[g]=(n[g]||0)+1}return n},{})).map(([n,i])=>({code:n,count:i}));t.numberNonAppearing=[l.reduce((n,i)=>n+i.count,0),0];const h=Math.ceil(l.length/2),o=l.slice(0,h),f=l.slice(h);t.key===0&&o.length>0&&(t.appearing={code:o.map(n=>n.code).join("/"),count:o.map(n=>n.count).join("/")}),t.key===1&&f.length>0&&(t.appearing={code:f.map(n=>n.code).join("/"),count:f.map(n=>n.count).join("/")});for(let n=0;n<t.days.length;n++)n<15&&t.days[n].time!=="-"&&(t.hourI+=Number(t.days[n].time),t.days[n].overtime&&(t.hourI+=Number(t.days[n].overtime)),t.halfI++),n>=15&&t.days[n].time!=="-"&&(t.days[n].overtime&&(t.hourII+=Number(t.days[n].overtime)),t.hourII+=Number(t.days[n].time),t.halfII++),t.days[n].night&&(t.night+=Number(t.days[n].night)),t.days[n].overtime&&(t.overtime+=Number(t.days[n].overtime)),/{|РВ|}/.test(t.days[n].state)&&(t.weekend+=Number(t.days[n].time)),t.days[n].state==="В"&&t.weekendDays++;t.contDays=t.halfI+t.halfII,t.contHour=t.hourI+t.hourII})},re=(t,l)=>{var g,a,y,w,A,Y,z;if(l===-1)return"";const h=r.value[l],o=new Date(C.value),f=`${o.getFullYear()}-${(o.getMonth()+1).toString().padStart(2,"0")}-${t.toString().padStart(2,"0")}`,n=h.days.findIndex(E=>E.day===f);let i=0;return(g=h.days[n])!=null&&g.night&&(i+=h.days[n].night),(a=h.days[n])!=null&&a.overtime&&(i+=h.days[n].overtime),n===-1?"":h.key===0?(y=h.days[n])==null?void 0:y.state:((w=h.days[n])==null?void 0:w.time)===0?i===0?"-":i:i===0||i===((A=h.days[n])==null?void 0:A.time)?(Y=h.days[n])==null?void 0:Y.time:`${(z=h.days[n])==null?void 0:z.time}/${i}`};p.group&&(V.value[0]=p.group),p.date&&(H.value=new Date(p.date+"T00:00:01").getMonth()),c.holidays().then(t=>{ae.value=t,oe()});const ie=t=>new Date(C.value).getMonth()===new Date().getMonth()&&t===new Date().getDate()?" today":"",ge=()=>{let t=W.value.match(/(\d{1,2}):\d{2}\s*-\s*(\d{1,2})/),l=b.value[v.value.ids].days[v.value.day+1].tips;return l=typeof l<"u"?l.match(/(\d{1,2}):\d{2}\s*-\s*(\d{1,2})/):[0,9,18],k.value>0&&(Number(t[1])<=6?t[1]=Number(t[1])+k.value:t[2]=Number(t[2])-k.value),Number(t[1])<Number(l[1])?`${t[1]}:00 по ${Number(t[1])+F.value}:00`:`${Number(t[2])-F.value}:00 по ${t[2]}:00`},fe=()=>{let t=/РВ/.test(W.value),l=t?W.value.match(/\(([^)]+)\)/)[1].replace("-"," по "):ge();G.value=`<p style="position: absolute;"><img src="https://cp.avanta-telecom.ru${p.logo}" style="height: 3rem;"></p><div style="display:inline-block;margin-left:66%;width:34%;">Директору<br>ООО "АВАНТА ТЕЛЕКОМ" Майстренко И.С.<br><br>от ${R.value} ${c.byInitials(p.fullName)}</div><p>${V.value[0]}<br>СЛУЖЕБНАЯ ЗАПИСКА<br>${c.parseTime(new Date(C.value).setDate(v.value.day+1),'"{dd}" {F} {Y}')}г.</p><p style="text-align:center;">Уважаемый Иван Сергеевич!</p><p>В связи с производственной необходимостью _________________, прошу привлечь к ${t?"к работе в выходной день":"сверхурочной работе"}, ${c.parseTime(new Date(C.value).setDate(v.value.day+1),"{dd}.{m}.{Y}")} c ${l}, ${r.value[v.value.ids*2].name.match(/\(([^)]+)\)/)[1]} ${r.value[v.value.ids*2].fio} для выполнения вышеуказанных работ с его(её) письменного согласия.</p><p>${R.value} ________________ ${c.byInitials(p.fullName)}</p>`},ye=async()=>{var A,Y,z,E;q.value=!0;const t=new $e.Workbook,l=t.addWorksheet(B(C.value,"month"),{pageSetup:{paperSize:9,orientation:"landscape",fitToPage:!0}}),h={vertical:"middle",horizontal:"center"},o={top:{style:"thin"},left:{style:"thin"},bottom:{style:"thin"},right:{style:"thin"}},f={vertical:"middle",horizontal:"center",wrapText:!0};l.mergeCells(`A1:${c.cellsDynamically("A1",d.value.length+15)}1`),l.mergeCells("A2:A4"),l.mergeCells("B2:B4"),l.mergeCells("C2:C4"),l.mergeCells("D5:R5"),l.mergeCells(`D2:${c.cellsDynamically("D2",d.value.length+2)}2`),l.mergeCells(`${c.cellsDynamically("D2",d.value.length+3)}2:${c.cellsDynamically("D2",d.value.length+8)}2`),l.mergeCells(`${c.cellsDynamically("D2",d.value.length+9)}2:${c.cellsDynamically("D2",d.value.length+9)}4`),l.mergeCells(`${c.cellsDynamically("D2",d.value.length+10)}2:${c.cellsDynamically("D2",d.value.length+11)}2`),l.mergeCells(`${c.cellsDynamically("D2",d.value.length+12)}2:${c.cellsDynamically("D2",d.value.length+12)}4`),l.mergeCells(`${c.cellsDynamically("D3",d.value.length+3)}3:${c.cellsDynamically("D3",d.value.length+3)}4`),l.mergeCells(`${c.cellsDynamically("D3",d.value.length+4)}3:${c.cellsDynamically("D3",d.value.length+8)}3`),l.mergeCells(`${c.cellsDynamically("D3",d.value.length+10)}3:${c.cellsDynamically("D3",d.value.length+10)}4`),l.mergeCells(`${c.cellsDynamically("D3",d.value.length+11)}3:${c.cellsDynamically("D3",d.value.length+11)}4`),l.mergeCells(`T5:${c.cellsDynamically("D5",d.value.length+1)}5`);for(let u=1;u<=d.value.length+2;u++)l.mergeCells(`${c.cellsDynamically("D3",u)}3:${c.cellsDynamically("D4",u)}4`),l.getColumn(u+3).width=5,l.getColumn(u+3).alignment=f,l.getCell(3,u+3).border=o,u<16&&(l.getCell(3,u+3).value=u),u>16&&(l.getCell(3,u+3).value=u-1);l.getCell("A1").value=s("sheet.title",{name:V.value[0]})+B(C.value,"month"),l.getCell("A2").value=s("sheet.listNumber"),l.getCell("B2").value=s("sheet.employee"),l.getCell("C2").value=s("sheet.personnelNumber"),l.getCell("D2").value=s("sheet.marks"),l.getCell("S3").value=s("sheet.halfMonth",{half:"I"}),l.getCell("A5").value="1",l.getCell("B5").value="2",l.getCell("C5").value="3",l.getCell("D5").value="4",l.getCell("S5").value="5",l.getCell("T5").value="6",l.getCell(5,d.value.length+5).value="7",l.getCell(2,d.value.length+6).value=s("sheet.workedMonth"),l.getCell(2,d.value.length+12).value=s("sheet.numberNonAppearing"),l.getCell(2,d.value.length+13).value=s("sheet.them"),l.getCell(2,d.value.length+15).value=s("sheet.countWeekend"),l.getCell(3,d.value.length+5).value=s("sheet.halfMonth",{half:"II"}),l.getCell(3,d.value.length+6).value=s("sheet.days"),l.getCell(3,d.value.length+7).value=s("sheet.hours"),l.getCell(4,d.value.length+7).value=s("sheet.all"),l.getCell(4,d.value.length+8).value=s("sheet.overtime"),l.getCell(4,d.value.length+9).value=s("sheet.night"),l.getCell(4,d.value.length+10).value=s("sheet.weekend"),l.getCell(4,d.value.length+13).value=s("sheet.code"),l.getCell(4,d.value.length+14).value=s("sheet.count"),l.getRow(1).height=40,l.getRow(2).height=32,l.getRow(3).height=20,l.getRow(4).height=60,l.getColumn(1).width=6,l.getColumn(2).width=30,l.getColumn(3).width=17,l.getColumn(19).width=12,l.getColumn(d.value.length+5).width=12,l.getColumn(d.value.length+12).width=11,l.getColumn(d.value.length+15).width=11,l.getCell("A1").alignment=h,l.getColumn(1).alignment=f,l.getColumn(2).alignment=f,l.getColumn(3).alignment=f;for(let u=6;u<=15;u++)l.getCell(5,d.value.length+u).value=u+2,l.getColumn(d.value.length+u).alignment=f,l.getCell(4,d.value.length+u).border=o,l.getCell(5,d.value.length+u).border=o;l.getCell("A2").border=o,l.getCell("B2").border=o,l.getCell("C2").border=o,l.getCell("D2").border=o,l.getCell("D2").border=o,l.getCell("A5").border=o,l.getCell("B5").border=o,l.getCell("C5").border=o,l.getCell("D5").border=o,l.getCell("S5").border=o,l.getCell("T5").border=o,l.getCell(2,d.value.length+6).border=o,l.getCell(2,d.value.length+12).border=o,l.getCell(2,d.value.length+13).border=o,l.getCell(2,d.value.length+15).border=o,l.getCell(3,d.value.length+7).border=o;let n=1,i=5,g=!0;for(const u of r.value){let U=[n,u.name,u.code];for(let S=0;S<d.value.length;S++)S===15&&U.push(g?(u==null?void 0:u.halfI)||"":(u==null?void 0:u.hourI)||""),U.push(g?((A=u.days[S])==null?void 0:A.state)||"":((Y=u.days[S])==null?void 0:Y.time)||"");U.push(g?(u==null?void 0:u.halfII)||0:(u==null?void 0:u.hourII)||0,(u==null?void 0:u.contDays)||0,(u==null?void 0:u.contHour)||0,(u==null?void 0:u.overtime)||0,(u==null?void 0:u.night)||0,(u==null?void 0:u.weekend)||0,"",g?(u==null?void 0:u.numberNonAppearing[0])||"":(u==null?void 0:u.numberNonAppearing[1])||0,((z=u==null?void 0:u.appearing)==null?void 0:z.code)||"-",((E=u==null?void 0:u.appearing)==null?void 0:E.count)||"-",(u==null?void 0:u.weekendDays)||0);const Ce=l.addRow(U);if(Ce.border=o,!g){l.mergeCells(`A${i+n*2-1}:A${i+n*2}`),l.mergeCells(`B${i+n*2-1}:B${i+n*2}`),l.mergeCells(`C${i+n*2-1}:C${i+n*2}`);for(let S=d.value.length+3;S<=d.value.length+8;S++)l.mergeCells(`${c.cellsDynamically("D",S)}${i+n*2-1}:${c.cellsDynamically("D",S)}${i+n*2}`);l.mergeCells(`${c.cellsDynamically("D",d.value.length+12)}${i+n*2-1}:${c.cellsDynamically("D",d.value.length+12)}${i+n*2}`),n++}g=!g}let a="Чемарина Н. Ю.";p.odata.personal.forEach(u=>{u.roleName==="Специалист по кадрам и кадровому делопроизводству"&&(a=u.employeeName)}),l.mergeCells(`A${r.value.length+7}:B${r.value.length+7}`),l.mergeCells(`C${r.value.length+7}:G${r.value.length+7}`),l.mergeCells(`H${r.value.length+7}:M${r.value.length+7}`),l.mergeCells(`O${r.value.length+7}:T${r.value.length+7}`),l.mergeCells(`V${r.value.length+7}:AC${r.value.length+7}`),l.mergeCells(`AD${r.value.length+7}:AI${r.value.length+7}`),l.mergeCells(`AJ${r.value.length+7}:AL${r.value.length+7}`),l.mergeCells(`AM${r.value.length+7}:AP${r.value.length+7}`),l.mergeCells(`V${r.value.length+9}:AC${r.value.length+9}`),l.mergeCells(`AD${r.value.length+9}:AI${r.value.length+9}`),l.mergeCells(`AJ${r.value.length+9}:AL${r.value.length+9}`),l.mergeCells(`AM${r.value.length+9}:AP${r.value.length+9}`),l.getCell(`A${r.value.length+7}`).value=s("sheet.responsiblePerson"),l.getCell(`V${r.value.length+7}`).value=s("sheet.headStructural"),l.getCell(`C${r.value.length+7}`).value=R.value+":",l.getCell(`O${r.value.length+7}`).value=c.byInitials(p.fullName),l.getCell(`AD${r.value.length+7}`).value=R.value+":",l.getCell(`AM${r.value.length+7}`).value=c.byInitials(p.fullName),l.getCell(`V${r.value.length+9}`).value=s("sheet.HREmployee"),l.getCell(`AD${r.value.length+9}`).value="Специалист по кадрам и кадровому делопроизводству:",l.getCell(`AM${r.value.length+9}`).value=c.byInitials(a),l.getCell(`A${r.value.length+7}`).alignment={vertical:"middle",horizontal:"right",wrapText:!0},l.getCell(`C${r.value.length+7}`).alignment={vertical:"middle",horizontal:"right",wrapText:!0},l.getCell(`O${r.value.length+7}`).alignment={vertical:"middle",horizontal:"left"},l.getCell(`V${r.value.length+7}`).alignment={vertical:"middle",horizontal:"right",wrapText:!0},l.getCell(`AD${r.value.length+7}`).alignment={vertical:"middle",horizontal:"right",wrapText:!0},l.getCell(`AM${r.value.length+7}`).alignment={vertical:"middle",horizontal:"left"},l.getCell(`V${r.value.length+9}`).alignment={vertical:"middle",horizontal:"right",wrapText:!0},l.getCell(`AD${r.value.length+9}`).alignment={vertical:"middle",horizontal:"right",wrapText:!0},l.getCell(`AM${r.value.length+9}`).alignment={vertical:"middle",horizontal:"left"},l.getCell(`H${r.value.length+7}`).border={bottom:{style:"thin"}},l.getCell(`AJ${r.value.length+7}`).border={bottom:{style:"thin"}},l.getCell(`AJ${r.value.length+9}`).border={bottom:{style:"thin"}};const y=`export_${c.parseTime(Date.now(),"{dd}.{m}.{Y}")}.xlsx`,w=await t.xlsx.writeBuffer();se.saveAs(new Blob([w]),y),q.value=!1},pe=()=>{let t=new Blob([G.value],{type:"text/plain;charset=utf-8"});se.saveAs(t,`Служебка_${c.byInitials(r.value[v.value.ids*2].fio)}_${c.parseTime(Date.now(),"{dd}.{m}.{Y}")}.html`)};return(t,l)=>{const h=e.resolveComponent("el-form-item"),o=e.resolveComponent("el-form"),f=e.resolveComponent("el-dialog"),n=e.resolveComponent("svg-icon"),i=e.resolveComponent("el-slider"),g=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",De,[N.checkEdit?(e.openBlock(),e.createBlock(e.unref(m.ElSelect),{key:0,modelValue:V.value,"onUpdate:modelValue":l[0]||(l[0]=a=>V.value=a),multiple:"","collapse-tags":"","collapse-tags-tooltip":"",placeholder:"Select",style:{width:"240px","margin-bottom":".5rem","margin-right":".5rem"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.value,a=>(e.openBlock(),e.createBlock(e.unref(m.ElOption),{key:a.value,label:a.label,value:a.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])):e.createCommentVNode("",!0),N.checkEdit?(e.openBlock(),e.createBlock(e.unref(m.ElButton),{key:1,plain:"",onClick:l[1]||(l[1]=a=>P.value=!0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("workSchedule.jobTitle")),1)]),_:1})):e.createCommentVNode("",!0),l[19]||(l[19]=e.createElementVNode("div",{class:"expander"},null,-1)),N.checkEdit?(e.openBlock(),e.createBlock(e.unref(m.ElSwitch),{key:2,modelValue:H.value,"onUpdate:modelValue":l[2]||(l[2]=a=>H.value=a),"active-text":e.unref(s)("workSchedule.currentMonth"),"active-value":"0","inactive-value":"-1",style:{"margin-bottom":".5rem","margin-left":".5rem"}},null,8,["modelValue","active-text"])):e.createCommentVNode("",!0),e.createVNode(e.unref(m.ElSwitch),{modelValue:Z.value,"onUpdate:modelValue":l[3]||(l[3]=a=>Z.value=a),"active-text":t.$t("sheet.currentHeight"),"active-value":"100%","inactive-value":"calc(100vh - var(--el-component-size)*5 - var(--el-main-padding)*2 - var(--header-height))"},null,8,["modelValue","active-text"]),e.createVNode(e.unref(m.ElSwitch),{modelValue:_.value,"onUpdate:modelValue":l[4]||(l[4]=a=>_.value=a),"active-text":t.$t("sheet.simplified"),"active-value":"true","inactive-value":"false"},null,8,["modelValue","active-text"])]),e.createVNode(e.unref(m.ElTable),{id:"printTable",data:r.value,"span-method":he,border:"",style:{width:"100%"},size:"small","empty-text":e.unref(s)("sheet.emptyText"),align:"center",onCellClick:ce,"max-height":Z.value,"default-sort":{prop:"mame",order:"descending"}},{default:e.withCtx(()=>[e.createVNode(e.unref(m.ElTableColumn),{label:e.unref(s)("sheet.title",{name:V.value[0]})+e.unref(B)(C.value,"month"),align:"center",height:"10"},{default:e.withCtx(()=>[e.createVNode(e.unref(m.ElTableColumn),{label:e.unref(s)("sheet.employee"),width:_.value==="false"?180:t.auto,align:"center"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(r.value[a.$index].name),1)]),_:1},8,["label","width"]),e.createVNode(e.unref(m.ElTableColumn),{label:e.unref(s)("sheet.personnelNumber"),align:"center",width:"108"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(r.value[a.$index].code),1)]),_:1},8,["label"]),e.createVNode(e.unref(m.ElTableColumn),{label:e.unref(s)("sheet.marks"),align:"center"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,a=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:a.day},[a.day<=15?(e.openBlock(),e.createBlock(e.unref(m.ElTableColumn),{key:0,width:"30","class-name":a.holidays+ie(a.day),align:"center",label:a.day.toString()+`
|
|
1
|
+
"use strict";const e=require("vue"),be=require("vue-i18n"),c=require("./index-Dn3djtwj.cjs"),m=require("element-plus"),I=require("@imengyu/vue3-context-menu"),se=require("file-saver"),we=require("exceljs");function xe(N){const p=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(N){for(const s in N)if(s!=="default"){const B=Object.getOwnPropertyDescriptor(N,s);Object.defineProperty(p,s,B.get?B:{enumerable:!0,get:()=>N[s]})}}return p.default=N,Object.freeze(p)}const $e=xe(we),De={class:"nav"},ke={style:{height:"20px",width:"100%",display:"inline-block"}},Ne={style:{height:"20px",width:"100%",display:"inline-block"}},Ve={class:"label"},Se={key:0,style:{padding:"0 1rem .5rem"}},Te={key:1,style:{padding:"0 1rem .5rem"}},Ee={__name:"SheetTable",props:{checkEdit:{type:Boolean,default:()=>!0},odata:Object,workSchedule:Object,fullName:{type:String,default:"Вы"},group:String,date:String,logo:{type:URL,default:"#"},editor:{type:Object,default:()=>({})}},setup(N){const p=N,{t:s,d:B}=be.useI18n(),q=e.ref(!1),C=e.ref([]),H=e.ref("0"),b=e.ref(new Date(new Date().getFullYear(),new Date().getMonth(),1).setMonth(new Date().getMonth()+Number(H.value))),d=e.ref([]),V=e.ref([]),Z=e.ref("100%"),_=e.ref("true"),Q=e.ref([]),de=e.ref([{value:"Я",label:s("sheet.valid.1")},{value:"К",label:s("sheet.valid.2")},{value:"ОТ",label:s("sheet.valid.3")},{value:"ДО",label:s("sheet.valid.4")},{value:"Р",label:s("sheet.valid.5")},{value:"ОЖ",label:s("sheet.valid.6")},{value:"Б",label:s("sheet.valid.7")},{value:"НН",label:s("sheet.valid.8")},{value:"ПР",label:s("sheet.valid.9")},{value:"У",label:s("sheet.valid.10")},{value:"УД",label:s("sheet.valid.11")},{value:"Г",label:s("sheet.valid.12")}]),ae=e.ref([]),ve=e.ref(0),$=e.ref(9),x=e.ref(8),k=e.ref(0),F=e.ref(0),O=e.ref([]),M=e.ref(!1),P=e.ref(!1),ee=e.ref([]),j=e.ref([]),T=e.ref(!1),J=e.ref(!1),L=e.ref(1),ne=e.ref(null),le=e.ref({zIndex:3,minWidth:230,x:500,y:200}),v=e.ref({name:"",length:0,code:""}),D=e.ref([]),G=e.ref(""),R=e.ref("_____"),r=e.computed(()=>C.value.flatMap((t,l)=>{const h=D.value.find(n=>n.code===t.code),o=new Map;t.days.forEach(n=>o.set(n.day,{...n})),h&&h.days.forEach(n=>o.set(n.day,{...n}));const f=Array.from(o.values());return[{...t,days:f,key:0,ids:l,numberNonAppearing:[0,0]},{...t,days:f,key:1,ids:l,numberNonAppearing:[0,0]}]}));e.watch(V,async(t,l)=>{t!==l&&(O.value=[],confirm.value=!1,p.odata.personal.forEach(h=>{t.includes(h.divisionName)&&(O.value.some(o=>(o==null?void 0:o.activeText)===h.roleName)||O.value.push({val:!0,activeText:h.roleName}))}),te())}),e.watch(H,t=>{b.value=new Date(new Date().getFullYear(),new Date().getMonth(),1).setMonth(new Date().getMonth()+Number(t)),oe(),te()}),e.watch(x,()=>M.value=T.value),e.watch($,()=>M.value=T.value),e.watch(L,()=>M.value=T.value);const ce=async(t,l,h,o)=>{if(l.level!==3||l.labelClassName==="turn"||l.no===15||l.no>d.value.length||!p.checkEdit)return"";v.value.ids=t.ids,v.value.key=t.key,v.value.day=l.no<15?l.no:l.no-1;const f=new Date(b.value),n=`${f.getFullYear()}-${(f.getMonth()+1).toString().padStart(2,"0")}-${(v.value.day+1).toString().padStart(2,"0")}`,i=D.value.findIndex(a=>a.code===t.code);v.value.id=i!==-1?D.value[i].days.findIndex(a=>(a==null?void 0:a.day)===n):i,$.value=typeof t.days[v.value.day].tips>"u"?9:parseInt(t.days[v.value.day].tips.match(/(\d{1,2})/)),k.value=typeof t.days[v.value.day].night>"u"?0:parseInt(t.days[v.value.day].night),F.value=typeof t.days[v.value.day].overtime>"u"?0:parseInt(t.days[v.value.day].overtime),x.value=t.days[v.value.day].time!=="-"?parseInt(t.days[v.value.day].time):8;const g=t.days.findIndex(a=>a.day===n);v.value.failure=t.days[g].state,le.value.y=o.clientY,le.value.x=o.clientX,v.value.rest=i!==-1&&v.value.id!==-1,v.value.name=c.byInitials(t.fio),T.value=!0,await e.nextTick(),M.value=!1},K=t=>{const l=new Date(b.value),h=`${l.getFullYear()}-${(l.getMonth()+1).toString().padStart(2,"0")}-${(v.value.day+1).toString().padStart(2,"0")}`;let o=D.value.findIndex(w=>w.code===C.value[v.value.ids].code);v.value.id=o!==-1?D.value[o].days.findIndex(w=>(w==null?void 0:w.day)===`${l.getFullYear()}-${(l.getMonth()+1).toString().padStart(2,"0")}-${(v.value.day+1).toString().padStart(2,"0")}`):o;let f=C.value[v.value.ids].days[v.value.day].state,n=t,i="-",g,a,y;switch(t){case"Я":f==="В"&&(n="РВ"),i=8;break;case"КВ":case"К":f==="В"||f==="КВ"?n="КВ":n="К";break;case"save":let w=W.value.split('"');n=w[1],M.value=!1,w[2]!==""&&(i=x.value,y="("+w[2].split("(")[1],g=k.value,a=F.value)}t==="reset"?(n=f,D.value[o].days.splice(v.value.id,1)):o===-1?D.value.push({code:C.value[v.value.ids].code,days:[{day:h,state:n,time:i,night:g,overtime:a,tips:y}]}):v.value.id===-1?D.value[o].days.push({day:h,state:n,time:i,night:g,overtime:a,tips:y}):D.value[o].days[v.value.id]={day:h,state:n,time:i,night:g,overtime:a,tips:y},o=D.value.findIndex(w=>w.code===C.value[v.value.ids].code),p.workSchedule.addWorkSheet({date:c.parseTime(new Date(b.value),"{Y}-{m}-{dd}"),data:[{name:C.value[v.value.ids].fio,days:D.value[o].days,code:C.value[v.value.ids].code}]}),v.value.failure=n,L.value>1&&(L.value--,v.value.day++,K(n)),ue()},W=e.computed(()=>{J.value=!1;let t=C.value[v.value.ids].days[v.value.day],l="";k.value=0,F.value=0;let h=x.value>=22?$.value+x.value+2:$.value+x.value+1,o=v.value.failure.split("/")[0];o=/^Н(?!Н$)С?$/.test(o)?t.state!=="В"?"Я":"РВ":o,/^(|Я|РВ)$/.test(o)&&(($.value<6||h>22)&&(l="Н",k.value=$.value<6?Math.min(6,h)-$.value:0,h<=6&&(k.value=x.value,o=""),h===7&&k.value>3&&k.value--,k.value+=Math.max(22,h)-22),x.value>t.time&&o!=="РВ"&&(l+="С",J.value=!0,F.value=x.value-t.time),/РВ/.test(o)&&(J.value=!0)),l.length>0&&o.length>0&&(l="/"+l);let f=`(${$.value}:00 - ${x.value>=22?$.value+x.value+2:$.value+x.value+1}:00)`,n=r.value[v.value.ids*2].days[v.value.day].time!=="-"?" "+x.value+" "+f:"";return'"'+o+l+'"'+n}),he=t=>{if(t.columnIndex<2||t.columnIndex>d.value.length+3&&t.columnIndex<d.value.length+9||t.columnIndex>d.value.length+11)return r.value[t.rowIndex].key===0?{rowspan:2,colspan:1}:{rowspan:0,colspan:0}},oe=()=>{const t=ae.value,l=new Date(b.value),h=new Date(l.getFullYear(),l.getMonth()+1,0).getDate();let o=[],f=0;for(let n=1;n<=h;n++){const i=c.parseTime(l.setDate(n),"{Y}-{m}-{dd}");f+=t.nowork.includes(i)||t.holidays.includes(i)?0:t.preholidays.includes(i)?7:8;let g=t.nowork.includes(i)?"nowork":t.holidays.includes(i)?"holiday":t.preholidays.includes(i)?"preholiday":"";o.push({day:n,holidays:g,weekday:B(new Date(l.getFullYear(),l.getMonth(),n),"day")})}return ve.value=f,d.value=o,p.odata.getPersonal({}).then(n=>{var i;V.value.length===0&&(V.value=[(i=n.find(g=>g.employeeName===p.fullName))==null?void 0:i.divisionName]),n.forEach(g=>{Q.value.some(a=>(a==null?void 0:a.value)===g.divisionName)||Q.value.push({value:g.divisionName,label:g.divisionName,key:g.divisionName})})}),!0},te=()=>{C.value=[],j.value=[],ee.value=[],p.odata.personal.forEach(t=>{if(V.value.includes(t.divisionName)&&O.value.some(l=>l.val&&l.activeText===t.roleName)){let l=c.byInitials(t.employeeName);j.value.push(t.employeeKey),C.value.push({fio:t.employeeName,name:l+" ("+t.roleName+")",code:t.employeeKey,days:[],contHour:0,id:!1})}t.employeeName===p.fullName&&(R.value=t.roleName)}),C.value.sort((t,l)=>t.fio<l.fio?-1:t.fio>l.fio?1:0),C.value.forEach((t,l)=>{t.ids=l}),p.workSchedule.getUsersYear({code:j.value,year:new Date(b.value).getFullYear()}).then(t=>{t.forEach(l=>{l.dateStart&&ee.value.push({code:l.code,dateStart:l.dateStart,dateEnd:l.dateEnd})}),me()})},me=()=>{p.workSchedule.getWorkSheet({code:j.value,date:c.parseTime(new Date(b.value),"{Y}-{m}-{dd}")}).then(t=>{D.value=[],t.forEach(l=>{l!==null&&D.value.push({code:l.code,days:l.data.days})}),p.workSchedule.getWorkSchedule({code:j.value,date:c.parseTime(new Date(b.value),"{Y}-{m}-{dd}")}).then(l=>{l.forEach((h,o)=>{var f,n;if(h!==null){C.value[o].days=[],h.data.days.forEach(i=>i.state="Я");for(let i=1;i<=d.value.length;i++){let g=c.parseTime(new Date(b.value).setDate(i),"{Y}-{m}-{dd}");const a=(f=h.data)==null?void 0:f.days.findIndex(y=>y.day===g);a===-1?X(i,o,"-","В"):C.value[o].days.push((n=h.data)==null?void 0:n.days[a])}}else for(let i=1;i<=d.value.length;i++)d.value[i-1].holidays===""?X(i,o,8):d.value[i-1].holidays==="preholiday"?X(i,o,7):X(i,o,"-","В");for(let i=1;i<=d.value.length;i++){let g=new Date(new Date(b.value).getFullYear(),new Date(b.value).getMonth(),i).getTime()+1e3;for(let a of ee.value){const{dateStart:y,dateEnd:w,code:A}=a;if(y&&w&&A===C.value[o].code){const Y=new Date(c.parseDate(y)).getTime(),z=new Date(c.parseDate(w)).getTime();if(g>=Y&&g<=z){const E=c.parseTime(new Date(b.value).setDate(i),"{Y}-{m}-{dd}"),u=C.value[o].days.findIndex(U=>U.day===E);u!==-1?C.value[o].days[u]={day:E,time:"-",state:"ОТ"}:C.value[o].days.push({day:E,time:"-",state:"ОТ"})}}}}}),ue()})})},X=(t,l,h,o="Я")=>{const f=c.parseTime(new Date(b.value).setDate(t),"{Y}-{m}-{dd}");C.value[l].days.push({day:f,time:h,state:o})},ue=()=>{r.value.forEach(t=>{t.hourI=0,t.hourII=0,t.halfII=0,t.halfI=0,t.weekend=0,t.weekendDays=0,t.overtime=0,t.night=0,t.appearing={code:"-",count:"-"};const l=Object.entries(t.days.reduce((n,i)=>{if(i.hasOwnProperty("state")&&/^(|К|КВ|ОТ|Б|Р|ПР|ОЖ|НН|У|ДО|УД|Г)$/.test(i.state)){const g=i.state;n[g]=(n[g]||0)+1}return n},{})).map(([n,i])=>({code:n,count:i}));t.numberNonAppearing=[l.reduce((n,i)=>n+i.count,0),0];const h=Math.ceil(l.length/2),o=l.slice(0,h),f=l.slice(h);t.key===0&&o.length>0&&(t.appearing={code:o.map(n=>n.code).join("/"),count:o.map(n=>n.count).join("/")}),t.key===1&&f.length>0&&(t.appearing={code:f.map(n=>n.code).join("/"),count:f.map(n=>n.count).join("/")});for(let n=0;n<t.days.length;n++)n<15&&t.days[n].time!=="-"&&(t.hourI+=Number(t.days[n].time),t.days[n].overtime&&(t.hourI+=Number(t.days[n].overtime)),t.halfI++),n>=15&&t.days[n].time!=="-"&&(t.days[n].overtime&&(t.hourII+=Number(t.days[n].overtime)),t.hourII+=Number(t.days[n].time),t.halfII++),t.days[n].night&&(t.night+=Number(t.days[n].night)),t.days[n].overtime&&(t.overtime+=Number(t.days[n].overtime)),/{|РВ|}/.test(t.days[n].state)&&(t.weekend+=Number(t.days[n].time)),t.days[n].state==="В"&&t.weekendDays++;t.contDays=t.halfI+t.halfII,t.contHour=t.hourI+t.hourII})},re=(t,l)=>{var g,a,y,w,A,Y,z;if(l===-1)return"";const h=r.value[l],o=new Date(b.value),f=`${o.getFullYear()}-${(o.getMonth()+1).toString().padStart(2,"0")}-${t.toString().padStart(2,"0")}`,n=h.days.findIndex(E=>E.day===f);let i=0;return(g=h.days[n])!=null&&g.night&&(i+=h.days[n].night),(a=h.days[n])!=null&&a.overtime&&(i+=h.days[n].overtime),n===-1?"":h.key===0?(y=h.days[n])==null?void 0:y.state:((w=h.days[n])==null?void 0:w.time)===0?i===0?"-":i:i===0||i===((A=h.days[n])==null?void 0:A.time)?(Y=h.days[n])==null?void 0:Y.time:`${(z=h.days[n])==null?void 0:z.time}/${i}`};p.group&&(V.value[0]=p.group),p.date&&(H.value=new Date(p.date+"T00:00:01").getMonth()),c.holidays().then(t=>{ae.value=t,oe()});const ie=t=>new Date(b.value).getMonth()===new Date().getMonth()&&t===new Date().getDate()?" today":"",ge=()=>{let t=W.value.match(/(\d{1,2}):\d{2}\s*-\s*(\d{1,2})/),l=C.value[v.value.ids].days[v.value.day+1].tips;return l=typeof l<"u"?l.match(/(\d{1,2}):\d{2}\s*-\s*(\d{1,2})/):[0,9,18],k.value>0&&(Number(t[1])<=6?t[1]=Number(t[1])+k.value:t[2]=Number(t[2])-k.value),Number(t[1])<Number(l[1])?`${t[1]}:00 по ${Number(t[1])+F.value}:00`:`${Number(t[2])-F.value}:00 по ${t[2]}:00`},fe=()=>{let t=/РВ/.test(W.value),l=t?W.value.match(/\(([^)]+)\)/)[1].replace("-"," по "):ge();G.value=`<p style="position: absolute;"><img src="https://cp.avanta-telecom.ru${p.logo}" style="height: 3rem;"></p><div style="display:inline-block;margin-left:66%;width:34%;">Директору<br>ООО "АВАНТА ТЕЛЕКОМ" Майстренко И.С.<br><br>от ${R.value} ${c.byInitials(p.fullName)}</div><p>${V.value[0]}<br>СЛУЖЕБНАЯ ЗАПИСКА<br>${c.parseTime(new Date(b.value).setDate(v.value.day+1),'"{dd}" {F} {Y}')}г.</p><p style="text-align:center;">Уважаемый Иван Сергеевич!</p><p>В связи с производственной необходимостью _________________, прошу привлечь к ${t?"к работе в выходной день":"сверхурочной работе"}, ${c.parseTime(new Date(b.value).setDate(v.value.day+1),"{dd}.{m}.{Y}")} c ${l}, ${r.value[v.value.ids*2].name.match(/\(([^)]+)\)/)[1]} ${r.value[v.value.ids*2].fio} для выполнения вышеуказанных работ с его(её) письменного согласия.</p><p>${R.value} ________________ ${c.byInitials(p.fullName)}</p>`},ye=async()=>{var A,Y,z,E;q.value=!0;const t=new $e.Workbook,l=t.addWorksheet(B(b.value,"month"),{pageSetup:{paperSize:9,orientation:"landscape",fitToPage:!0}}),h={vertical:"middle",horizontal:"center"},o={top:{style:"thin"},left:{style:"thin"},bottom:{style:"thin"},right:{style:"thin"}},f={vertical:"middle",horizontal:"center",wrapText:!0};l.mergeCells(`A1:${c.cellsDynamically("A1",d.value.length+15)}1`),l.mergeCells("A2:A4"),l.mergeCells("B2:B4"),l.mergeCells("C2:C4"),l.mergeCells("D5:R5"),l.mergeCells(`D2:${c.cellsDynamically("D2",d.value.length+2)}2`),l.mergeCells(`${c.cellsDynamically("D2",d.value.length+3)}2:${c.cellsDynamically("D2",d.value.length+8)}2`),l.mergeCells(`${c.cellsDynamically("D2",d.value.length+9)}2:${c.cellsDynamically("D2",d.value.length+9)}4`),l.mergeCells(`${c.cellsDynamically("D2",d.value.length+10)}2:${c.cellsDynamically("D2",d.value.length+11)}2`),l.mergeCells(`${c.cellsDynamically("D2",d.value.length+12)}2:${c.cellsDynamically("D2",d.value.length+12)}4`),l.mergeCells(`${c.cellsDynamically("D3",d.value.length+3)}3:${c.cellsDynamically("D3",d.value.length+3)}4`),l.mergeCells(`${c.cellsDynamically("D3",d.value.length+4)}3:${c.cellsDynamically("D3",d.value.length+8)}3`),l.mergeCells(`${c.cellsDynamically("D3",d.value.length+10)}3:${c.cellsDynamically("D3",d.value.length+10)}4`),l.mergeCells(`${c.cellsDynamically("D3",d.value.length+11)}3:${c.cellsDynamically("D3",d.value.length+11)}4`),l.mergeCells(`T5:${c.cellsDynamically("D5",d.value.length+1)}5`);for(let u=1;u<=d.value.length+2;u++)l.mergeCells(`${c.cellsDynamically("D3",u)}3:${c.cellsDynamically("D4",u)}4`),l.getColumn(u+3).width=5,l.getColumn(u+3).alignment=f,l.getCell(3,u+3).border=o,u<16&&(l.getCell(3,u+3).value=u),u>16&&(l.getCell(3,u+3).value=u-1);l.getCell("A1").value=s("sheet.title",{name:V.value[0]})+B(b.value,"month"),l.getCell("A2").value=s("sheet.listNumber"),l.getCell("B2").value=s("sheet.employee"),l.getCell("C2").value=s("sheet.personnelNumber"),l.getCell("D2").value=s("sheet.marks"),l.getCell("S3").value=s("sheet.halfMonth",{half:"I"}),l.getCell("A5").value="1",l.getCell("B5").value="2",l.getCell("C5").value="3",l.getCell("D5").value="4",l.getCell("S5").value="5",l.getCell("T5").value="6",l.getCell(5,d.value.length+5).value="7",l.getCell(2,d.value.length+6).value=s("sheet.workedMonth"),l.getCell(2,d.value.length+12).value=s("sheet.numberNonAppearing"),l.getCell(2,d.value.length+13).value=s("sheet.them"),l.getCell(2,d.value.length+15).value=s("sheet.countWeekend"),l.getCell(3,d.value.length+5).value=s("sheet.halfMonth",{half:"II"}),l.getCell(3,d.value.length+6).value=s("sheet.days"),l.getCell(3,d.value.length+7).value=s("sheet.hours"),l.getCell(4,d.value.length+7).value=s("sheet.all"),l.getCell(4,d.value.length+8).value=s("sheet.overtime"),l.getCell(4,d.value.length+9).value=s("sheet.night"),l.getCell(4,d.value.length+10).value=s("sheet.weekend"),l.getCell(4,d.value.length+13).value=s("sheet.code"),l.getCell(4,d.value.length+14).value=s("sheet.count"),l.getRow(1).height=40,l.getRow(2).height=32,l.getRow(3).height=20,l.getRow(4).height=60,l.getColumn(1).width=6,l.getColumn(2).width=30,l.getColumn(3).width=17,l.getColumn(19).width=12,l.getColumn(d.value.length+5).width=12,l.getColumn(d.value.length+12).width=11,l.getColumn(d.value.length+15).width=11,l.getCell("A1").alignment=h,l.getColumn(1).alignment=f,l.getColumn(2).alignment=f,l.getColumn(3).alignment=f;for(let u=6;u<=15;u++)l.getCell(5,d.value.length+u).value=u+2,l.getColumn(d.value.length+u).alignment=f,l.getCell(4,d.value.length+u).border=o,l.getCell(5,d.value.length+u).border=o;l.getCell("A2").border=o,l.getCell("B2").border=o,l.getCell("C2").border=o,l.getCell("D2").border=o,l.getCell("D2").border=o,l.getCell("A5").border=o,l.getCell("B5").border=o,l.getCell("C5").border=o,l.getCell("D5").border=o,l.getCell("S5").border=o,l.getCell("T5").border=o,l.getCell(2,d.value.length+6).border=o,l.getCell(2,d.value.length+12).border=o,l.getCell(2,d.value.length+13).border=o,l.getCell(2,d.value.length+15).border=o,l.getCell(3,d.value.length+7).border=o;let n=1,i=5,g=!0;for(const u of r.value){let U=[n,u.name,u.code];for(let S=0;S<d.value.length;S++)S===15&&U.push(g?(u==null?void 0:u.halfI)||"":(u==null?void 0:u.hourI)||""),U.push(g?((A=u.days[S])==null?void 0:A.state)||"":((Y=u.days[S])==null?void 0:Y.time)||"");U.push(g?(u==null?void 0:u.halfII)||0:(u==null?void 0:u.hourII)||0,(u==null?void 0:u.contDays)||0,(u==null?void 0:u.contHour)||0,(u==null?void 0:u.overtime)||0,(u==null?void 0:u.night)||0,(u==null?void 0:u.weekend)||0,"",g?(u==null?void 0:u.numberNonAppearing[0])||"":(u==null?void 0:u.numberNonAppearing[1])||0,((z=u==null?void 0:u.appearing)==null?void 0:z.code)||"-",((E=u==null?void 0:u.appearing)==null?void 0:E.count)||"-",(u==null?void 0:u.weekendDays)||0);const Ce=l.addRow(U);if(Ce.border=o,!g){l.mergeCells(`A${i+n*2-1}:A${i+n*2}`),l.mergeCells(`B${i+n*2-1}:B${i+n*2}`),l.mergeCells(`C${i+n*2-1}:C${i+n*2}`);for(let S=d.value.length+3;S<=d.value.length+8;S++)l.mergeCells(`${c.cellsDynamically("D",S)}${i+n*2-1}:${c.cellsDynamically("D",S)}${i+n*2}`);l.mergeCells(`${c.cellsDynamically("D",d.value.length+12)}${i+n*2-1}:${c.cellsDynamically("D",d.value.length+12)}${i+n*2}`),n++}g=!g}let a="Чемарина Н. Ю.";p.odata.personal.forEach(u=>{u.roleName==="Специалист по кадрам и кадровому делопроизводству"&&(a=u.employeeName)}),l.mergeCells(`A${r.value.length+7}:B${r.value.length+7}`),l.mergeCells(`C${r.value.length+7}:G${r.value.length+7}`),l.mergeCells(`H${r.value.length+7}:M${r.value.length+7}`),l.mergeCells(`O${r.value.length+7}:T${r.value.length+7}`),l.mergeCells(`V${r.value.length+7}:AC${r.value.length+7}`),l.mergeCells(`AD${r.value.length+7}:AI${r.value.length+7}`),l.mergeCells(`AJ${r.value.length+7}:AL${r.value.length+7}`),l.mergeCells(`AM${r.value.length+7}:AP${r.value.length+7}`),l.mergeCells(`V${r.value.length+9}:AC${r.value.length+9}`),l.mergeCells(`AD${r.value.length+9}:AI${r.value.length+9}`),l.mergeCells(`AJ${r.value.length+9}:AL${r.value.length+9}`),l.mergeCells(`AM${r.value.length+9}:AP${r.value.length+9}`),l.getCell(`A${r.value.length+7}`).value=s("sheet.responsiblePerson"),l.getCell(`V${r.value.length+7}`).value=s("sheet.headStructural"),l.getCell(`C${r.value.length+7}`).value=R.value+":",l.getCell(`O${r.value.length+7}`).value=c.byInitials(p.fullName),l.getCell(`AD${r.value.length+7}`).value=R.value+":",l.getCell(`AM${r.value.length+7}`).value=c.byInitials(p.fullName),l.getCell(`V${r.value.length+9}`).value=s("sheet.HREmployee"),l.getCell(`AD${r.value.length+9}`).value="Специалист по кадрам и кадровому делопроизводству:",l.getCell(`AM${r.value.length+9}`).value=c.byInitials(a),l.getCell(`A${r.value.length+7}`).alignment={vertical:"middle",horizontal:"right",wrapText:!0},l.getCell(`C${r.value.length+7}`).alignment={vertical:"middle",horizontal:"right",wrapText:!0},l.getCell(`O${r.value.length+7}`).alignment={vertical:"middle",horizontal:"left"},l.getCell(`V${r.value.length+7}`).alignment={vertical:"middle",horizontal:"right",wrapText:!0},l.getCell(`AD${r.value.length+7}`).alignment={vertical:"middle",horizontal:"right",wrapText:!0},l.getCell(`AM${r.value.length+7}`).alignment={vertical:"middle",horizontal:"left"},l.getCell(`V${r.value.length+9}`).alignment={vertical:"middle",horizontal:"right",wrapText:!0},l.getCell(`AD${r.value.length+9}`).alignment={vertical:"middle",horizontal:"right",wrapText:!0},l.getCell(`AM${r.value.length+9}`).alignment={vertical:"middle",horizontal:"left"},l.getCell(`H${r.value.length+7}`).border={bottom:{style:"thin"}},l.getCell(`AJ${r.value.length+7}`).border={bottom:{style:"thin"}},l.getCell(`AJ${r.value.length+9}`).border={bottom:{style:"thin"}};const y=`export_${c.parseTime(Date.now(),"{dd}.{m}.{Y}")}.xlsx`,w=await t.xlsx.writeBuffer();se.saveAs(new Blob([w]),y),q.value=!1},pe=()=>{let t=new Blob([G.value],{type:"text/plain;charset=utf-8"});se.saveAs(t,`Служебка_${c.byInitials(r.value[v.value.ids*2].fio)}_${c.parseTime(Date.now(),"{dd}.{m}.{Y}")}.html`)};return(t,l)=>{const h=e.resolveComponent("el-form-item"),o=e.resolveComponent("el-form"),f=e.resolveComponent("el-dialog"),n=e.resolveComponent("svg-icon"),i=e.resolveComponent("el-slider"),g=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",De,[N.checkEdit?(e.openBlock(),e.createBlock(e.unref(m.ElSelect),{key:0,modelValue:V.value,"onUpdate:modelValue":l[0]||(l[0]=a=>V.value=a),multiple:"","collapse-tags":"","collapse-tags-tooltip":"",placeholder:"Select",style:{width:"240px","margin-bottom":".5rem","margin-right":".5rem"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.value,a=>(e.openBlock(),e.createBlock(e.unref(m.ElOption),{key:a.value,label:a.label,value:a.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])):e.createCommentVNode("",!0),N.checkEdit?(e.openBlock(),e.createBlock(e.unref(m.ElButton),{key:1,plain:"",onClick:l[1]||(l[1]=a=>P.value=!0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("workSchedule.jobTitle")),1)]),_:1})):e.createCommentVNode("",!0),l[19]||(l[19]=e.createElementVNode("div",{class:"expander"},null,-1)),N.checkEdit?(e.openBlock(),e.createBlock(e.unref(m.ElSwitch),{key:2,modelValue:H.value,"onUpdate:modelValue":l[2]||(l[2]=a=>H.value=a),"active-text":e.unref(s)("workSchedule.currentMonth"),"active-value":"0","inactive-value":"-1",style:{"margin-bottom":".5rem","margin-left":".5rem"}},null,8,["modelValue","active-text"])):e.createCommentVNode("",!0),e.createVNode(e.unref(m.ElSwitch),{modelValue:Z.value,"onUpdate:modelValue":l[3]||(l[3]=a=>Z.value=a),"active-text":t.$t("sheet.currentHeight"),"active-value":"100%","inactive-value":"calc(100vh - var(--el-component-size)*5 - var(--el-main-padding)*2 - var(--header-height))"},null,8,["modelValue","active-text"]),e.createVNode(e.unref(m.ElSwitch),{modelValue:_.value,"onUpdate:modelValue":l[4]||(l[4]=a=>_.value=a),"active-text":t.$t("sheet.simplified"),"active-value":"true","inactive-value":"false"},null,8,["modelValue","active-text"])]),e.createVNode(e.unref(m.ElTable),{id:"printTable",data:r.value,"span-method":he,border:"",style:{width:"100%"},size:"small","empty-text":e.unref(s)("sheet.emptyText"),align:"center",onCellClick:ce,"max-height":Z.value,"default-sort":{prop:"mame",order:"descending"}},{default:e.withCtx(()=>[e.createVNode(e.unref(m.ElTableColumn),{label:e.unref(s)("sheet.title",{name:V.value[0]})+e.unref(B)(b.value,"month"),align:"center",height:"10"},{default:e.withCtx(()=>[e.createVNode(e.unref(m.ElTableColumn),{label:e.unref(s)("sheet.employee"),width:_.value==="false"?180:t.auto,align:"center"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(r.value[a.$index].name),1)]),_:1},8,["label","width"]),e.createVNode(e.unref(m.ElTableColumn),{label:e.unref(s)("sheet.personnelNumber"),align:"center",width:"108"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(r.value[a.$index].code),1)]),_:1},8,["label"]),e.createVNode(e.unref(m.ElTableColumn),{label:e.unref(s)("sheet.marks"),align:"center"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,a=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:a.day},[a.day<=15?(e.openBlock(),e.createBlock(e.unref(m.ElTableColumn),{key:0,width:"30","class-name":a.holidays+ie(a.day),align:"center",label:a.day.toString()+`
|
|
2
2
|
`+a.weekday},{default:e.withCtx(y=>[e.createElementVNode("div",ke,e.toDisplayString(re(a.day,y.$index)||" "),1)]),_:2},1032,["class-name","label"])):e.createCommentVNode("",!0),a.day===15?(e.openBlock(),e.createBlock(e.unref(m.ElTableColumn),{key:1,label:e.unref(s)("sheet.halfMonth",{half:"I"}),align:"center",width:"120"},{default:e.withCtx(y=>[e.createTextVNode(e.toDisplayString(r.value[y.$index].key===0?r.value[y.$index].halfI:r.value[y.$index].hourI),1)]),_:1},8,["label"])):e.createCommentVNode("",!0),a.day>15?(e.openBlock(),e.createBlock(e.unref(m.ElTableColumn),{key:2,width:"30","class-name":a.holidays+ie(a.day),align:"center",label:a.day.toString()+`
|
|
3
3
|
`+a.weekday},{default:e.withCtx(y=>[e.createElementVNode("div",Ne,e.toDisplayString(re(a.day,y.$index)||" "),1)]),_:2},1032,["class-name","label"])):e.createCommentVNode("",!0)],64))),128)),e.createVNode(e.unref(m.ElTableColumn),{label:e.unref(s)("sheet.halfMonth",{half:"II"}),align:"center",width:"120"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(r.value[a.$index].key===0?r.value[a.$index].halfII:r.value[a.$index].hourII),1)]),_:1},8,["label"])]),_:1},8,["label"]),_.value==="false"?(e.openBlock(),e.createBlock(e.unref(m.ElTableColumn),{key:0,label:e.unref(s)("sheet.workedMonth"),align:"center"},{default:e.withCtx(()=>[e.createVNode(e.unref(m.ElTableColumn),{label:e.unref(s)("sheet.days"),align:"center","label-class-name":"turn",width:"34"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(r.value[a.$index].contDays),1)]),_:1},8,["label"]),e.createVNode(e.unref(m.ElTableColumn),{label:e.unref(s)("sheet.hours"),align:"center"},{default:e.withCtx(()=>[e.createVNode(e.unref(m.ElTableColumn),{label:e.unref(s)("sheet.all"),align:"center","label-class-name":"turn",width:"40"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(r.value[a.$index].contHour),1)]),_:1},8,["label"]),e.createVNode(e.unref(m.ElTableColumn),{label:e.unref(s)("sheet.overtime"),align:"center","label-class-name":"turn",width:"34"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(r.value[a.$index].overtime),1)]),_:1},8,["label"]),e.createVNode(e.unref(m.ElTableColumn),{label:e.unref(s)("sheet.night"),align:"center","label-class-name":"turn",width:"34"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(r.value[a.$index].night),1)]),_:1},8,["label"]),e.createVNode(e.unref(m.ElTableColumn),{label:e.unref(s)("sheet.weekend"),align:"center","label-class-name":"turn",width:"34"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(r.value[a.$index].weekend),1)]),_:1},8,["label"])]),_:1},8,["label"])]),_:1},8,["label"])):e.createCommentVNode("",!0),_.value==="false"?(e.openBlock(),e.createBlock(e.unref(m.ElTableColumn),{key:1,label:e.unref(s)("sheet.numberNonAppearing"),align:"center"},{default:e.withCtx(a=>{var y;return[e.createTextVNode(e.toDisplayString((y=r.value[a.$index])==null?void 0:y.numberNonAppearing[r.value[a.$index].key]),1)]}),_:1},8,["label"])):e.createCommentVNode("",!0),_.value==="false"?(e.openBlock(),e.createBlock(e.unref(m.ElTableColumn),{key:2,label:e.unref(s)("sheet.them"),align:"center"},{default:e.withCtx(()=>[e.createVNode(e.unref(m.ElTableColumn),{label:e.unref(s)("sheet.code"),align:"center","label-class-name":"turn",width:"30"},{default:e.withCtx(a=>{var y;return[e.createTextVNode(e.toDisplayString((y=r.value[a.$index].appearing)==null?void 0:y.code),1)]}),_:1},8,["label"]),e.createVNode(e.unref(m.ElTableColumn),{label:e.unref(s)("sheet.count"),align:"center","label-class-name":"turn",width:"30"},{default:e.withCtx(a=>{var y;return[e.createTextVNode(e.toDisplayString((y=r.value[a.$index].appearing)==null?void 0:y.count),1)]}),_:1},8,["label"])]),_:1},8,["label"])):e.createCommentVNode("",!0),_.value==="false"?(e.openBlock(),e.createBlock(e.unref(m.ElTableColumn),{key:3,label:e.unref(s)("sheet.countWeekend"),align:"center"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(r.value[a.$index].weekendDays),1)]),_:1},8,["label"])):e.createCommentVNode("",!0)]),_:1},8,["label"])]),_:1},8,["data","empty-text","max-height"]),e.withDirectives((e.openBlock(),e.createBlock(e.unref(m.ElButton),{disabled:q.value,plain:"",onClick:ye,style:{"margin-top":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("workSchedule.exportExcel")),1)]),_:1},8,["disabled"])),[[g,q.value]]),e.createVNode(f,{title:e.unref(s)("workSchedule.jobTitle"),modelValue:P.value,"onUpdate:modelValue":l[7]||(l[7]=a=>P.value=a),width:"400px"},{footer:e.withCtx(()=>[e.createVNode(e.unref(m.ElButton),{onClick:l[5]||(l[5]=a=>P.value=!1),size:"default"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.$t("workSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(m.ElButton),{size:"default",type:"primary",onClick:l[6]||(l[6]=a=>{te(),P.value=!1})},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.$t("workSchedule.select")),1)]),_:1})]),default:e.withCtx(()=>[e.createVNode(o,{ref:"dialogForm",model:O.value,autocomplete:"on"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O.value,a=>(e.openBlock(),e.createBlock(h,null,{default:e.withCtx(()=>[e.createVNode(e.unref(m.ElSwitch),{modelValue:a.val,"onUpdate:modelValue":y=>a.val=y,"active-text":a.activeText},null,8,["modelValue","onUpdate:modelValue","active-text"])]),_:2},1024))),256))]),_:1},8,["model"])]),_:1},8,["title","modelValue"]),e.createVNode(e.unref(I.ContextMenu),{show:T.value,"onUpdate:show":l[16]||(l[16]=a=>T.value=a),options:le.value},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"mx-context-menu-item",onClick:l[8]||(l[8]=a=>T.value=!1)},[e.createElementVNode("span",Ve,e.toDisplayString(v.value.name),1),l[20]||(l[20]=e.createElementVNode("div",{class:"expander"},null,-1)),e.createVNode(n,{"icon-class":"cross"})]),e.createVNode(e.unref(I.ContextMenuSeparator)),e.createElementVNode("div",null,[e.createElementVNode("div",null,[e.createVNode(e.unref(I.ContextMenuGroup),{label:W.value,style:{padding:"0 0 .5rem"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(de.value,a=>(e.openBlock(),e.createBlock(e.unref(I.ContextMenuItem),{key:a.value,label:a.label,onClick:y=>{v.value.rest=!0,M.value=!1,K(a.value)},clickClose:!1},null,8,["label","onClick"]))),128))]),_:1},8,["label"])]),/^(РВ|Я|Н(?![Н])).*$/.test(v.value.failure)?(e.openBlock(),e.createElementBlock("div",Se,[e.createVNode(e.unref(I.ContextMenuItem),{clickClose:!1},{default:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(e.unref(s)("workSchedule.with"))+":",1)]),_:1}),e.createVNode(i,{modelValue:$.value,"onUpdate:modelValue":l[9]||(l[9]=a=>$.value=a),step:1,min:0,max:19,style:{width:"100%"}},null,8,["modelValue"]),e.createVNode(e.unref(I.ContextMenuItem),{clickClose:!1},{default:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(e.unref(s)("workSchedule.duration"))+":",1)]),_:1}),e.createVNode(i,{modelValue:x.value,"onUpdate:modelValue":l[10]||(l[10]=a=>x.value=a),step:1,min:4,max:e.unref(c.clamp)($.value!==1?23-$.value:21,4,22)},null,8,["modelValue","max"])])):e.createCommentVNode("",!0),/^(|К|КВ|ОТ|Б|Р|ОЖ|У|ДО|УД|Г)$/.test(v.value.failure)?(e.openBlock(),e.createElementBlock("div",Te,[e.createVNode(e.unref(I.ContextMenuItem),{clickClose:!1},{default:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(e.unref(s)("sheet.count"))+":",1)]),_:1}),e.createVNode(i,{modelValue:L.value,"onUpdate:modelValue":l[11]||(l[11]=a=>L.value=a),step:1,min:1,max:d.value.length-v.value.day,style:{width:"100%"}},null,8,["modelValue","max"])])):e.createCommentVNode("",!0),e.createVNode(e.unref(I.ContextMenuItem),{class:"wrap"},{default:e.withCtx(()=>[v.value.rest?(e.openBlock(),e.createBlock(e.unref(m.ElButton),{key:0,onClick:l[12]||(l[12]=a=>K("reset"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("sheet.reset")),1)]),_:1})):e.createCommentVNode("",!0),M.value?(e.openBlock(),e.createBlock(e.unref(m.ElButton),{key:1,onClick:l[13]||(l[13]=a=>K("save"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("sheet.save")),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(m.ElButton),{onClick:l[14]||(l[14]=a=>T.value=!1)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("sheet.cancel")),1)]),_:1}),J.value?(e.openBlock(),e.createBlock(e.unref(m.ElButton),{key:2,onClick:l[15]||(l[15]=a=>fe()),popovertarget:"my-service"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("sheet.service")),1)]),_:1})):e.createCommentVNode("",!0)]),_:1})])]),_:1},8,["show","options"]),e.createElementVNode("div",{id:"my-service",class:"sw-popover",popover:"",ref_key:"myService",ref:ne},[l[21]||(l[21]=e.createElementVNode("header",null,"Служебная записка",-1)),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(p.editor),{modelValue:G.value,"onUpdate:modelValue":l[17]||(l[17]=a=>G.value=a)},null,8,["modelValue"])),e.createElementVNode("footer",null,[e.createVNode(e.unref(m.ElButton),{onClick:l[18]||(l[18]=a=>ne.value.hidePopover()),size:"default"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.$t("calendar.cancel")),1)]),_:1}),e.createVNode(e.unref(m.ElButton),{type:"success",plain:"",onClick:pe},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.$t("calendar.save")),1)]),_:1})])],512)],64)}}};module.exports=Ee;
|
package/dist/SheetTable.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ref as y, computed as Se, watch as ne, resolveComponent as ue, resolveDirective as He, createElementBlock as O, openBlock as b, Fragment as q, createElementVNode as A, createVNode as c, withDirectives as Oe, createBlock as _, createCommentVNode as M, unref as n, withCtx as g, renderList as me, createTextVNode as w, toDisplayString as C, resolveDynamicComponent as Pe, nextTick as Re } from "vue";
|
|
2
2
|
import { useI18n as We } from "vue-i18n";
|
|
3
3
|
import { p as Y, b as P, a as _e, h as Je, c as je, d as $ } from "./index-2Mx6IUGl.js";
|
|
4
|
-
import { ElSelect as Le, ElOption as Ge, ElButton as F, ElSwitch as ce, ElTable as Ke, ElTableColumn as
|
|
4
|
+
import { ElSelect as Le, ElOption as Ge, ElButton as F, ElSwitch as ce, ElTable as Ke, ElTableColumn as I } from "element-plus";
|
|
5
5
|
import { ContextMenu as Xe, ContextMenuSeparator as qe, ContextMenuGroup as Ze, ContextMenuItem as oe } from "@imengyu/vue3-context-menu";
|
|
6
6
|
import { saveAs as Ne } from "file-saver";
|
|
7
7
|
import * as Qe from "exceljs";
|
|
@@ -24,20 +24,20 @@ const el = { class: "nav" }, ll = { style: { height: "20px", width: "100%", disp
|
|
|
24
24
|
editor: { type: Object, default: () => ({}) }
|
|
25
25
|
},
|
|
26
26
|
setup(se) {
|
|
27
|
-
const k = se, { t:
|
|
28
|
-
{ value: "Я", label:
|
|
29
|
-
{ value: "К", label:
|
|
30
|
-
{ value: "ОТ", label:
|
|
31
|
-
{ value: "ДО", label:
|
|
32
|
-
{ value: "Р", label:
|
|
33
|
-
{ value: "ОЖ", label:
|
|
34
|
-
{ value: "Б", label:
|
|
35
|
-
{ value: "НН", label:
|
|
36
|
-
{ value: "ПР", label:
|
|
37
|
-
{ value: "У", label:
|
|
38
|
-
{ value: "УД", label:
|
|
39
|
-
{ value: "Г", label:
|
|
40
|
-
]), $e = y([]), Me = y(0), V = y(9), N = y(8), E = y(0), G = y(0), K = y([]), W = y(!1), Q = y(!1), ye = y([]), ee = y([]), U = y(!1),
|
|
27
|
+
const k = se, { t: r, d: ie } = We(), re = y(!1), D = y([]), Z = y("0"), x = y(new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1).setMonth((/* @__PURE__ */ new Date()).getMonth() + Number(Z.value))), d = y([]), z = y([]), fe = y("100%"), R = y("true"), pe = y([]), Ae = y([
|
|
28
|
+
{ value: "Я", label: r("sheet.valid.1") },
|
|
29
|
+
{ value: "К", label: r("sheet.valid.2") },
|
|
30
|
+
{ value: "ОТ", label: r("sheet.valid.3") },
|
|
31
|
+
{ value: "ДО", label: r("sheet.valid.4") },
|
|
32
|
+
{ value: "Р", label: r("sheet.valid.5") },
|
|
33
|
+
{ value: "ОЖ", label: r("sheet.valid.6") },
|
|
34
|
+
{ value: "Б", label: r("sheet.valid.7") },
|
|
35
|
+
{ value: "НН", label: r("sheet.valid.8") },
|
|
36
|
+
{ value: "ПР", label: r("sheet.valid.9") },
|
|
37
|
+
{ value: "У", label: r("sheet.valid.10") },
|
|
38
|
+
{ value: "УД", label: r("sheet.valid.11") },
|
|
39
|
+
{ value: "Г", label: r("sheet.valid.12") }
|
|
40
|
+
]), $e = y([]), Me = y(0), V = y(9), N = y(8), E = y(0), G = y(0), K = y([]), W = y(!1), Q = y(!1), ye = y([]), ee = y([]), U = y(!1), de = y(!1), le = y(1), we = y(null), Ce = y({
|
|
41
41
|
zIndex: 3,
|
|
42
42
|
minWidth: 230,
|
|
43
43
|
x: 500,
|
|
@@ -52,7 +52,7 @@ const el = { class: "nav" }, ll = { style: { height: "20px", width: "100%", disp
|
|
|
52
52
|
// }
|
|
53
53
|
// ]
|
|
54
54
|
// }
|
|
55
|
-
]), ve = y(""), ae = y("_____"), s = Se(() =>
|
|
55
|
+
]), ve = y(""), ae = y("_____"), s = Se(() => D.value.flatMap((l, e) => {
|
|
56
56
|
const h = T.value.find((t) => t.code === l.code), u = /* @__PURE__ */ new Map();
|
|
57
57
|
l.days.forEach((t) => u.set(t.day, { ...t })), h && h.days.forEach((t) => u.set(t.day, { ...t }));
|
|
58
58
|
const f = Array.from(u.values());
|
|
@@ -63,20 +63,20 @@ const el = { class: "nav" }, ll = { style: { height: "20px", width: "100%", disp
|
|
|
63
63
|
l.includes(h.divisionName) && (K.value.some((u) => (u == null ? void 0 : u.activeText) === h.roleName) || K.value.push({ val: !0, activeText: h.roleName }));
|
|
64
64
|
}), be());
|
|
65
65
|
}), ne(Z, (l) => {
|
|
66
|
-
|
|
66
|
+
x.value = new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1).setMonth((/* @__PURE__ */ new Date()).getMonth() + Number(l)), ke(), be();
|
|
67
67
|
}), ne(N, () => W.value = U.value), ne(V, () => W.value = U.value), ne(le, () => W.value = U.value);
|
|
68
68
|
const Ve = async (l, e, h, u) => {
|
|
69
|
-
if (e.level !== 3 || e.labelClassName === "turn" || e.no === 15 || e.no >
|
|
69
|
+
if (e.level !== 3 || e.labelClassName === "turn" || e.no === 15 || e.no > d.value.length || !k.checkEdit) return "";
|
|
70
70
|
v.value.ids = l.ids, v.value.key = l.key, v.value.day = e.no < 15 ? e.no : e.no - 1;
|
|
71
|
-
const f = new Date(
|
|
71
|
+
const f = new Date(x.value), t = `${f.getFullYear()}-${(f.getMonth() + 1).toString().padStart(2, "0")}-${(v.value.day + 1).toString().padStart(2, "0")}`, i = T.value.findIndex((a) => a.code === l.code);
|
|
72
72
|
v.value.id = i !== -1 ? T.value[i].days.findIndex((a) => (a == null ? void 0 : a.day) === t) : i, V.value = typeof l.days[v.value.day].tips > "u" ? 9 : parseInt(l.days[v.value.day].tips.match(/(\d{1,2})/)), E.value = typeof l.days[v.value.day].night > "u" ? 0 : parseInt(l.days[v.value.day].night), G.value = typeof l.days[v.value.day].overtime > "u" ? 0 : parseInt(l.days[v.value.day].overtime), N.value = l.days[v.value.day].time !== "-" ? parseInt(l.days[v.value.day].time) : 8;
|
|
73
73
|
const m = l.days.findIndex((a) => a.day === t);
|
|
74
74
|
v.value.failure = l.days[m].state, Ce.value.y = u.clientY, Ce.value.x = u.clientX, v.value.rest = i !== -1 && v.value.id !== -1, v.value.name = P(l.fio), U.value = !0, await Re(), W.value = !1;
|
|
75
75
|
}, he = (l) => {
|
|
76
|
-
const e = new Date(
|
|
77
|
-
let u = T.value.findIndex((S) => S.code ===
|
|
76
|
+
const e = new Date(x.value), h = `${e.getFullYear()}-${(e.getMonth() + 1).toString().padStart(2, "0")}-${(v.value.day + 1).toString().padStart(2, "0")}`;
|
|
77
|
+
let u = T.value.findIndex((S) => S.code === D.value[v.value.ids].code);
|
|
78
78
|
v.value.id = u !== -1 ? T.value[u].days.findIndex((S) => (S == null ? void 0 : S.day) === `${e.getFullYear()}-${(e.getMonth() + 1).toString().padStart(2, "0")}-${(v.value.day + 1).toString().padStart(2, "0")}`) : u;
|
|
79
|
-
let f =
|
|
79
|
+
let f = D.value[v.value.ids].days[v.value.day].state, t = l, i = "-", m, a, p;
|
|
80
80
|
switch (l) {
|
|
81
81
|
case "Я":
|
|
82
82
|
f === "В" && (t = "РВ"), i = 8;
|
|
@@ -89,24 +89,24 @@ const el = { class: "nav" }, ll = { style: { height: "20px", width: "100%", disp
|
|
|
89
89
|
let S = te.value.split('"');
|
|
90
90
|
t = S[1], W.value = !1, S[2] !== "" && (i = N.value, p = "(" + S[2].split("(")[1], m = E.value, a = G.value);
|
|
91
91
|
}
|
|
92
|
-
l === "reset" ? (t = f, T.value[u].days.splice(v.value.id, 1)) : u === -1 ? T.value.push({ code:
|
|
93
|
-
date: Y(new Date(
|
|
92
|
+
l === "reset" ? (t = f, T.value[u].days.splice(v.value.id, 1)) : u === -1 ? T.value.push({ code: D.value[v.value.ids].code, days: [{ day: h, state: t, time: i, night: m, overtime: a, tips: p }] }) : v.value.id === -1 ? T.value[u].days.push({ day: h, state: t, time: i, night: m, overtime: a, tips: p }) : T.value[u].days[v.value.id] = { day: h, state: t, time: i, night: m, overtime: a, tips: p }, u = T.value.findIndex((S) => S.code === D.value[v.value.ids].code), k.workSchedule.addWorkSheet({
|
|
93
|
+
date: Y(new Date(x.value), "{Y}-{m}-{dd}"),
|
|
94
94
|
data: [{
|
|
95
|
-
name:
|
|
95
|
+
name: D.value[v.value.ids].fio,
|
|
96
96
|
days: T.value[u].days,
|
|
97
|
-
code:
|
|
97
|
+
code: D.value[v.value.ids].code
|
|
98
98
|
}]
|
|
99
99
|
}), v.value.failure = t, le.value > 1 && (le.value--, v.value.day++, he(t)), De();
|
|
100
100
|
}, te = Se(() => {
|
|
101
|
-
|
|
102
|
-
let l =
|
|
101
|
+
de.value = !1;
|
|
102
|
+
let l = D.value[v.value.ids].days[v.value.day], e = "";
|
|
103
103
|
E.value = 0, G.value = 0;
|
|
104
104
|
let h = N.value >= 22 ? V.value + N.value + 2 : V.value + N.value + 1, u = v.value.failure.split("/")[0];
|
|
105
|
-
u = /^Н(?!Н$)С?$/.test(u) ? l.state !== "В" ? "Я" : "РВ" : u, /^(|Я|РВ)$/.test(u) && ((V.value < 6 || h > 22) && (e = "Н", E.value = V.value < 6 ? Math.min(6, h) - V.value : 0, h <= 6 && (E.value = N.value, u = ""), h === 7 && E.value > 3 && E.value--, E.value += Math.max(22, h) - 22), N.value > l.time && u !== "РВ" && (e += "С",
|
|
105
|
+
u = /^Н(?!Н$)С?$/.test(u) ? l.state !== "В" ? "Я" : "РВ" : u, /^(|Я|РВ)$/.test(u) && ((V.value < 6 || h > 22) && (e = "Н", E.value = V.value < 6 ? Math.min(6, h) - V.value : 0, h <= 6 && (E.value = N.value, u = ""), h === 7 && E.value > 3 && E.value--, E.value += Math.max(22, h) - 22), N.value > l.time && u !== "РВ" && (e += "С", de.value = !0, G.value = N.value - l.time), /РВ/.test(u) && (de.value = !0)), e.length > 0 && u.length > 0 && (e = "/" + e);
|
|
106
106
|
let f = `(${V.value}:00 - ${N.value >= 22 ? V.value + N.value + 2 : V.value + N.value + 1}:00)`, t = s.value[v.value.ids * 2].days[v.value.day].time !== "-" ? " " + N.value + " " + f : "";
|
|
107
107
|
return '"' + u + e + '"' + t;
|
|
108
108
|
}), Te = (l) => {
|
|
109
|
-
if (l.columnIndex < 2 || l.columnIndex >
|
|
109
|
+
if (l.columnIndex < 2 || l.columnIndex > d.value.length + 3 && l.columnIndex < d.value.length + 9 || l.columnIndex > d.value.length + 11)
|
|
110
110
|
return s.value[l.rowIndex].key === 0 ? {
|
|
111
111
|
rowspan: 2,
|
|
112
112
|
colspan: 1
|
|
@@ -115,7 +115,7 @@ const el = { class: "nav" }, ll = { style: { height: "20px", width: "100%", disp
|
|
|
115
115
|
colspan: 0
|
|
116
116
|
};
|
|
117
117
|
}, ke = () => {
|
|
118
|
-
const l = $e.value, e = new Date(
|
|
118
|
+
const l = $e.value, e = new Date(x.value), h = new Date(e.getFullYear(), e.getMonth() + 1, 0).getDate();
|
|
119
119
|
let u = [], f = 0;
|
|
120
120
|
for (let t = 1; t <= h; t++) {
|
|
121
121
|
const i = Y(e.setDate(t), "{Y}-{m}-{dd}");
|
|
@@ -123,52 +123,54 @@ const el = { class: "nav" }, ll = { style: { height: "20px", width: "100%", disp
|
|
|
123
123
|
let m = l.nowork.includes(i) ? "nowork" : l.holidays.includes(i) ? "holiday" : l.preholidays.includes(i) ? "preholiday" : "";
|
|
124
124
|
u.push({ day: t, holidays: m, weekday: ie(new Date(e.getFullYear(), e.getMonth(), t), "day") });
|
|
125
125
|
}
|
|
126
|
-
return Me.value = f,
|
|
126
|
+
return Me.value = f, d.value = u, k.odata.getPersonal({}).then((t) => {
|
|
127
127
|
var i;
|
|
128
128
|
z.value.length === 0 && (z.value = [(i = t.find((m) => m.employeeName === k.fullName)) == null ? void 0 : i.divisionName]), t.forEach((m) => {
|
|
129
129
|
pe.value.some((a) => (a == null ? void 0 : a.value) === m.divisionName) || pe.value.push({ value: m.divisionName, label: m.divisionName, key: m.divisionName });
|
|
130
130
|
});
|
|
131
131
|
}), !0;
|
|
132
132
|
}, be = () => {
|
|
133
|
-
|
|
133
|
+
D.value = [], ee.value = [], ye.value = [], k.odata.personal.forEach((l) => {
|
|
134
134
|
if (z.value.includes(l.divisionName) && K.value.some((e) => e.val && e.activeText === l.roleName)) {
|
|
135
135
|
let e = P(l.employeeName);
|
|
136
|
-
ee.value.push(l.employeeKey),
|
|
136
|
+
ee.value.push(l.employeeKey), D.value.push({ fio: l.employeeName, name: e + " (" + l.roleName + ")", code: l.employeeKey, days: [], contHour: 0, id: !1 });
|
|
137
137
|
}
|
|
138
138
|
l.employeeName === k.fullName && (ae.value = l.roleName);
|
|
139
|
-
}),
|
|
139
|
+
}), D.value.sort((l, e) => l.fio < e.fio ? -1 : l.fio > e.fio ? 1 : 0), D.value.forEach((l, e) => {
|
|
140
|
+
l.ids = e;
|
|
141
|
+
}), k.workSchedule.getUsersYear({ code: ee.value, year: new Date(x.value).getFullYear() }).then((l) => {
|
|
140
142
|
l.forEach((e) => {
|
|
141
143
|
e.dateStart && ye.value.push({ code: e.code, dateStart: e.dateStart, dateEnd: e.dateEnd });
|
|
142
144
|
}), Ee();
|
|
143
145
|
});
|
|
144
146
|
}, Ee = () => {
|
|
145
|
-
k.workSchedule.getWorkSheet({ code: ee.value, date: Y(new Date(
|
|
147
|
+
k.workSchedule.getWorkSheet({ code: ee.value, date: Y(new Date(x.value), "{Y}-{m}-{dd}") }).then(
|
|
146
148
|
(l) => {
|
|
147
149
|
T.value = [], l.forEach((e) => {
|
|
148
150
|
e !== null && T.value.push({ code: e.code, days: e.data.days });
|
|
149
|
-
}), k.workSchedule.getWorkSchedule({ code: ee.value, date: Y(new Date(
|
|
151
|
+
}), k.workSchedule.getWorkSchedule({ code: ee.value, date: Y(new Date(x.value), "{Y}-{m}-{dd}") }).then(
|
|
150
152
|
(e) => {
|
|
151
153
|
e.forEach((h, u) => {
|
|
152
154
|
var f, t;
|
|
153
155
|
if (h !== null) {
|
|
154
|
-
|
|
155
|
-
for (let i = 1; i <=
|
|
156
|
-
let m = Y(new Date(
|
|
156
|
+
D.value[u].days = [], h.data.days.forEach((i) => i.state = "Я");
|
|
157
|
+
for (let i = 1; i <= d.value.length; i++) {
|
|
158
|
+
let m = Y(new Date(x.value).setDate(i), "{Y}-{m}-{dd}");
|
|
157
159
|
const a = (f = h.data) == null ? void 0 : f.days.findIndex((p) => p.day === m);
|
|
158
|
-
a === -1 ? ge(i, u, "-", "В") :
|
|
160
|
+
a === -1 ? ge(i, u, "-", "В") : D.value[u].days.push((t = h.data) == null ? void 0 : t.days[a]);
|
|
159
161
|
}
|
|
160
162
|
} else
|
|
161
|
-
for (let i = 1; i <=
|
|
162
|
-
|
|
163
|
-
for (let i = 1; i <=
|
|
164
|
-
let m = new Date(new Date(
|
|
163
|
+
for (let i = 1; i <= d.value.length; i++)
|
|
164
|
+
d.value[i - 1].holidays === "" ? ge(i, u, 8) : d.value[i - 1].holidays === "preholiday" ? ge(i, u, 7) : ge(i, u, "-", "В");
|
|
165
|
+
for (let i = 1; i <= d.value.length; i++) {
|
|
166
|
+
let m = new Date(new Date(x.value).getFullYear(), new Date(x.value).getMonth(), i).getTime() + 1e3;
|
|
165
167
|
for (let a of ye.value) {
|
|
166
168
|
const { dateStart: p, dateEnd: S, code: J } = a;
|
|
167
|
-
if (p && S && J ===
|
|
169
|
+
if (p && S && J === D.value[u].code) {
|
|
168
170
|
const j = new Date(_e(p)).getTime(), L = new Date(_e(S)).getTime();
|
|
169
171
|
if (m >= j && m <= L) {
|
|
170
|
-
const H = Y(new Date(
|
|
171
|
-
o !== -1 ?
|
|
172
|
+
const H = Y(new Date(x.value).setDate(i), "{Y}-{m}-{dd}"), o = D.value[u].days.findIndex((X) => X.day === H);
|
|
173
|
+
o !== -1 ? D.value[u].days[o] = { day: H, time: "-", state: "ОТ" } : D.value[u].days.push({ day: H, time: "-", state: "ОТ" });
|
|
172
174
|
}
|
|
173
175
|
}
|
|
174
176
|
}
|
|
@@ -179,8 +181,8 @@ const el = { class: "nav" }, ll = { style: { height: "20px", width: "100%", disp
|
|
|
179
181
|
}
|
|
180
182
|
);
|
|
181
183
|
}, ge = (l, e, h, u = "Я") => {
|
|
182
|
-
const f = Y(new Date(
|
|
183
|
-
|
|
184
|
+
const f = Y(new Date(x.value).setDate(l), "{Y}-{m}-{dd}");
|
|
185
|
+
D.value[e].days.push({
|
|
184
186
|
day: f,
|
|
185
187
|
time: h,
|
|
186
188
|
state: u
|
|
@@ -216,34 +218,34 @@ const el = { class: "nav" }, ll = { style: { height: "20px", width: "100%", disp
|
|
|
216
218
|
}, xe = (l, e) => {
|
|
217
219
|
var m, a, p, S, J, j, L;
|
|
218
220
|
if (e === -1) return "";
|
|
219
|
-
const h = s.value[e], u = new Date(
|
|
221
|
+
const h = s.value[e], u = new Date(x.value), f = `${u.getFullYear()}-${(u.getMonth() + 1).toString().padStart(2, "0")}-${l.toString().padStart(2, "0")}`, t = h.days.findIndex((H) => H.day === f);
|
|
220
222
|
let i = 0;
|
|
221
223
|
return (m = h.days[t]) != null && m.night && (i += h.days[t].night), (a = h.days[t]) != null && a.overtime && (i += h.days[t].overtime), t === -1 ? "" : h.key === 0 ? (p = h.days[t]) == null ? void 0 : p.state : ((S = h.days[t]) == null ? void 0 : S.time) === 0 ? i === 0 ? "-" : i : i === 0 || i === ((J = h.days[t]) == null ? void 0 : J.time) ? (j = h.days[t]) == null ? void 0 : j.time : `${(L = h.days[t]) == null ? void 0 : L.time}/${i}`;
|
|
222
224
|
};
|
|
223
225
|
k.group && (z.value[0] = k.group), k.date && (Z.value = (/* @__PURE__ */ new Date(k.date + "T00:00:01")).getMonth()), Je().then((l) => {
|
|
224
226
|
$e.value = l, ke();
|
|
225
227
|
});
|
|
226
|
-
const Ie = (l) => new Date(
|
|
227
|
-
let l = te.value.match(/(\d{1,2}):\d{2}\s*-\s*(\d{1,2})/), e =
|
|
228
|
+
const Ie = (l) => new Date(x.value).getMonth() === (/* @__PURE__ */ new Date()).getMonth() && l === (/* @__PURE__ */ new Date()).getDate() ? " today" : "", Ye = () => {
|
|
229
|
+
let l = te.value.match(/(\d{1,2}):\d{2}\s*-\s*(\d{1,2})/), e = D.value[v.value.ids].days[v.value.day + 1].tips;
|
|
228
230
|
return e = typeof e < "u" ? e.match(/(\d{1,2}):\d{2}\s*-\s*(\d{1,2})/) : [0, 9, 18], E.value > 0 && (Number(l[1]) <= 6 ? l[1] = Number(l[1]) + E.value : l[2] = Number(l[2]) - E.value), Number(l[1]) < Number(e[1]) ? `${l[1]}:00 по ${Number(l[1]) + G.value}:00` : `${Number(l[2]) - G.value}:00 по ${l[2]}:00`;
|
|
229
231
|
}, ze = () => {
|
|
230
232
|
let l = /РВ/.test(te.value), e = l ? te.value.match(/\(([^)]+)\)/)[1].replace("-", " по ") : Ye();
|
|
231
|
-
ve.value = `<p style="position: absolute;"><img src="https://cp.avanta-telecom.ru${k.logo}" style="height: 3rem;"></p><div style="display:inline-block;margin-left:66%;width:34%;">Директору<br>ООО "АВАНТА ТЕЛЕКОМ" Майстренко И.С.<br><br>от ${ae.value} ${P(k.fullName)}</div><p>${z.value[0]}<br>СЛУЖЕБНАЯ ЗАПИСКА<br>${Y(new Date(
|
|
233
|
+
ve.value = `<p style="position: absolute;"><img src="https://cp.avanta-telecom.ru${k.logo}" style="height: 3rem;"></p><div style="display:inline-block;margin-left:66%;width:34%;">Директору<br>ООО "АВАНТА ТЕЛЕКОМ" Майстренко И.С.<br><br>от ${ae.value} ${P(k.fullName)}</div><p>${z.value[0]}<br>СЛУЖЕБНАЯ ЗАПИСКА<br>${Y(new Date(x.value).setDate(v.value.day + 1), '"{dd}" {F} {Y}')}г.</p><p style="text-align:center;">Уважаемый Иван Сергеевич!</p><p>В связи с производственной необходимостью _________________, прошу привлечь к ${l ? "к работе в выходной день" : "сверхурочной работе"}, ${Y(new Date(x.value).setDate(v.value.day + 1), "{dd}.{m}.{Y}")} c ${e}, ${s.value[v.value.ids * 2].name.match(/\(([^)]+)\)/)[1]} ${s.value[v.value.ids * 2].fio} для выполнения вышеуказанных работ с его(её) письменного согласия.</p><p>${ae.value} ________________ ${P(k.fullName)}</p>`;
|
|
232
234
|
}, Be = async () => {
|
|
233
235
|
var J, j, L, H;
|
|
234
|
-
|
|
235
|
-
const l = new Qe.Workbook(), e = l.addWorksheet(ie(
|
|
236
|
-
e.mergeCells(`A1:${$("A1",
|
|
237
|
-
for (let o = 1; o <=
|
|
236
|
+
re.value = !0;
|
|
237
|
+
const l = new Qe.Workbook(), e = l.addWorksheet(ie(x.value, "month"), { pageSetup: { paperSize: 9, orientation: "landscape", fitToPage: !0 } }), h = { vertical: "middle", horizontal: "center" }, u = { top: { style: "thin" }, left: { style: "thin" }, bottom: { style: "thin" }, right: { style: "thin" } }, f = { vertical: "middle", horizontal: "center", wrapText: !0 };
|
|
238
|
+
e.mergeCells(`A1:${$("A1", d.value.length + 15)}1`), e.mergeCells("A2:A4"), e.mergeCells("B2:B4"), e.mergeCells("C2:C4"), e.mergeCells("D5:R5"), e.mergeCells(`D2:${$("D2", d.value.length + 2)}2`), e.mergeCells(`${$("D2", d.value.length + 3)}2:${$("D2", d.value.length + 8)}2`), e.mergeCells(`${$("D2", d.value.length + 9)}2:${$("D2", d.value.length + 9)}4`), e.mergeCells(`${$("D2", d.value.length + 10)}2:${$("D2", d.value.length + 11)}2`), e.mergeCells(`${$("D2", d.value.length + 12)}2:${$("D2", d.value.length + 12)}4`), e.mergeCells(`${$("D3", d.value.length + 3)}3:${$("D3", d.value.length + 3)}4`), e.mergeCells(`${$("D3", d.value.length + 4)}3:${$("D3", d.value.length + 8)}3`), e.mergeCells(`${$("D3", d.value.length + 10)}3:${$("D3", d.value.length + 10)}4`), e.mergeCells(`${$("D3", d.value.length + 11)}3:${$("D3", d.value.length + 11)}4`), e.mergeCells(`T5:${$("D5", d.value.length + 1)}5`);
|
|
239
|
+
for (let o = 1; o <= d.value.length + 2; o++)
|
|
238
240
|
e.mergeCells(`${$("D3", o)}3:${$("D4", o)}4`), e.getColumn(o + 3).width = 5, e.getColumn(o + 3).alignment = f, e.getCell(3, o + 3).border = u, o < 16 && (e.getCell(3, o + 3).value = o), o > 16 && (e.getCell(3, o + 3).value = o - 1);
|
|
239
|
-
e.getCell("A1").value =
|
|
241
|
+
e.getCell("A1").value = r("sheet.title", { name: z.value[0] }) + ie(x.value, "month"), e.getCell("A2").value = r("sheet.listNumber"), e.getCell("B2").value = r("sheet.employee"), e.getCell("C2").value = r("sheet.personnelNumber"), e.getCell("D2").value = r("sheet.marks"), e.getCell("S3").value = r("sheet.halfMonth", { half: "I" }), e.getCell("A5").value = "1", e.getCell("B5").value = "2", e.getCell("C5").value = "3", e.getCell("D5").value = "4", e.getCell("S5").value = "5", e.getCell("T5").value = "6", e.getCell(5, d.value.length + 5).value = "7", e.getCell(2, d.value.length + 6).value = r("sheet.workedMonth"), e.getCell(2, d.value.length + 12).value = r("sheet.numberNonAppearing"), e.getCell(2, d.value.length + 13).value = r("sheet.them"), e.getCell(2, d.value.length + 15).value = r("sheet.countWeekend"), e.getCell(3, d.value.length + 5).value = r("sheet.halfMonth", { half: "II" }), e.getCell(3, d.value.length + 6).value = r("sheet.days"), e.getCell(3, d.value.length + 7).value = r("sheet.hours"), e.getCell(4, d.value.length + 7).value = r("sheet.all"), e.getCell(4, d.value.length + 8).value = r("sheet.overtime"), e.getCell(4, d.value.length + 9).value = r("sheet.night"), e.getCell(4, d.value.length + 10).value = r("sheet.weekend"), e.getCell(4, d.value.length + 13).value = r("sheet.code"), e.getCell(4, d.value.length + 14).value = r("sheet.count"), e.getRow(1).height = 40, e.getRow(2).height = 32, e.getRow(3).height = 20, e.getRow(4).height = 60, e.getColumn(1).width = 6, e.getColumn(2).width = 30, e.getColumn(3).width = 17, e.getColumn(19).width = 12, e.getColumn(d.value.length + 5).width = 12, e.getColumn(d.value.length + 12).width = 11, e.getColumn(d.value.length + 15).width = 11, e.getCell("A1").alignment = h, e.getColumn(1).alignment = f, e.getColumn(2).alignment = f, e.getColumn(3).alignment = f;
|
|
240
242
|
for (let o = 6; o <= 15; o++)
|
|
241
|
-
e.getCell(5,
|
|
242
|
-
e.getCell("A2").border = u, e.getCell("B2").border = u, e.getCell("C2").border = u, e.getCell("D2").border = u, e.getCell("D2").border = u, e.getCell("A5").border = u, e.getCell("B5").border = u, e.getCell("C5").border = u, e.getCell("D5").border = u, e.getCell("S5").border = u, e.getCell("T5").border = u, e.getCell(2,
|
|
243
|
+
e.getCell(5, d.value.length + o).value = o + 2, e.getColumn(d.value.length + o).alignment = f, e.getCell(4, d.value.length + o).border = u, e.getCell(5, d.value.length + o).border = u;
|
|
244
|
+
e.getCell("A2").border = u, e.getCell("B2").border = u, e.getCell("C2").border = u, e.getCell("D2").border = u, e.getCell("D2").border = u, e.getCell("A5").border = u, e.getCell("B5").border = u, e.getCell("C5").border = u, e.getCell("D5").border = u, e.getCell("S5").border = u, e.getCell("T5").border = u, e.getCell(2, d.value.length + 6).border = u, e.getCell(2, d.value.length + 12).border = u, e.getCell(2, d.value.length + 13).border = u, e.getCell(2, d.value.length + 15).border = u, e.getCell(3, d.value.length + 7).border = u;
|
|
243
245
|
let t = 1, i = 5, m = !0;
|
|
244
246
|
for (const o of s.value) {
|
|
245
247
|
let X = [t, o.name, o.code];
|
|
246
|
-
for (let B = 0; B <
|
|
248
|
+
for (let B = 0; B < d.value.length; B++)
|
|
247
249
|
B === 15 && X.push(m ? (o == null ? void 0 : o.halfI) || "" : (o == null ? void 0 : o.hourI) || ""), X.push(m ? ((J = o.days[B]) == null ? void 0 : J.state) || "" : ((j = o.days[B]) == null ? void 0 : j.time) || "");
|
|
248
250
|
X.push(
|
|
249
251
|
m ? (o == null ? void 0 : o.halfII) || 0 : (o == null ? void 0 : o.hourII) || 0,
|
|
@@ -261,18 +263,18 @@ const el = { class: "nav" }, ll = { style: { height: "20px", width: "100%", disp
|
|
|
261
263
|
const Ue = e.addRow(X);
|
|
262
264
|
if (Ue.border = u, !m) {
|
|
263
265
|
e.mergeCells(`A${i + t * 2 - 1}:A${i + t * 2}`), e.mergeCells(`B${i + t * 2 - 1}:B${i + t * 2}`), e.mergeCells(`C${i + t * 2 - 1}:C${i + t * 2}`);
|
|
264
|
-
for (let B =
|
|
266
|
+
for (let B = d.value.length + 3; B <= d.value.length + 8; B++)
|
|
265
267
|
e.mergeCells(`${$("D", B)}${i + t * 2 - 1}:${$("D", B)}${i + t * 2}`);
|
|
266
|
-
e.mergeCells(`${$("D",
|
|
268
|
+
e.mergeCells(`${$("D", d.value.length + 12)}${i + t * 2 - 1}:${$("D", d.value.length + 12)}${i + t * 2}`), t++;
|
|
267
269
|
}
|
|
268
270
|
m = !m;
|
|
269
271
|
}
|
|
270
272
|
let a = "Чемарина Н. Ю.";
|
|
271
273
|
k.odata.personal.forEach((o) => {
|
|
272
274
|
o.roleName === "Специалист по кадрам и кадровому делопроизводству" && (a = o.employeeName);
|
|
273
|
-
}), e.mergeCells(`A${s.value.length + 7}:B${s.value.length + 7}`), e.mergeCells(`C${s.value.length + 7}:G${s.value.length + 7}`), e.mergeCells(`H${s.value.length + 7}:M${s.value.length + 7}`), e.mergeCells(`O${s.value.length + 7}:T${s.value.length + 7}`), e.mergeCells(`V${s.value.length + 7}:AC${s.value.length + 7}`), e.mergeCells(`AD${s.value.length + 7}:AI${s.value.length + 7}`), e.mergeCells(`AJ${s.value.length + 7}:AL${s.value.length + 7}`), e.mergeCells(`AM${s.value.length + 7}:AP${s.value.length + 7}`), e.mergeCells(`V${s.value.length + 9}:AC${s.value.length + 9}`), e.mergeCells(`AD${s.value.length + 9}:AI${s.value.length + 9}`), e.mergeCells(`AJ${s.value.length + 9}:AL${s.value.length + 9}`), e.mergeCells(`AM${s.value.length + 9}:AP${s.value.length + 9}`), e.getCell(`A${s.value.length + 7}`).value =
|
|
275
|
+
}), e.mergeCells(`A${s.value.length + 7}:B${s.value.length + 7}`), e.mergeCells(`C${s.value.length + 7}:G${s.value.length + 7}`), e.mergeCells(`H${s.value.length + 7}:M${s.value.length + 7}`), e.mergeCells(`O${s.value.length + 7}:T${s.value.length + 7}`), e.mergeCells(`V${s.value.length + 7}:AC${s.value.length + 7}`), e.mergeCells(`AD${s.value.length + 7}:AI${s.value.length + 7}`), e.mergeCells(`AJ${s.value.length + 7}:AL${s.value.length + 7}`), e.mergeCells(`AM${s.value.length + 7}:AP${s.value.length + 7}`), e.mergeCells(`V${s.value.length + 9}:AC${s.value.length + 9}`), e.mergeCells(`AD${s.value.length + 9}:AI${s.value.length + 9}`), e.mergeCells(`AJ${s.value.length + 9}:AL${s.value.length + 9}`), e.mergeCells(`AM${s.value.length + 9}:AP${s.value.length + 9}`), e.getCell(`A${s.value.length + 7}`).value = r("sheet.responsiblePerson"), e.getCell(`V${s.value.length + 7}`).value = r("sheet.headStructural"), e.getCell(`C${s.value.length + 7}`).value = ae.value + ":", e.getCell(`O${s.value.length + 7}`).value = P(k.fullName), e.getCell(`AD${s.value.length + 7}`).value = ae.value + ":", e.getCell(`AM${s.value.length + 7}`).value = P(k.fullName), e.getCell(`V${s.value.length + 9}`).value = r("sheet.HREmployee"), e.getCell(`AD${s.value.length + 9}`).value = "Специалист по кадрам и кадровому делопроизводству:", e.getCell(`AM${s.value.length + 9}`).value = P(a), e.getCell(`A${s.value.length + 7}`).alignment = { vertical: "middle", horizontal: "right", wrapText: !0 }, e.getCell(`C${s.value.length + 7}`).alignment = { vertical: "middle", horizontal: "right", wrapText: !0 }, e.getCell(`O${s.value.length + 7}`).alignment = { vertical: "middle", horizontal: "left" }, e.getCell(`V${s.value.length + 7}`).alignment = { vertical: "middle", horizontal: "right", wrapText: !0 }, e.getCell(`AD${s.value.length + 7}`).alignment = { vertical: "middle", horizontal: "right", wrapText: !0 }, e.getCell(`AM${s.value.length + 7}`).alignment = { vertical: "middle", horizontal: "left" }, e.getCell(`V${s.value.length + 9}`).alignment = { vertical: "middle", horizontal: "right", wrapText: !0 }, e.getCell(`AD${s.value.length + 9}`).alignment = { vertical: "middle", horizontal: "right", wrapText: !0 }, e.getCell(`AM${s.value.length + 9}`).alignment = { vertical: "middle", horizontal: "left" }, e.getCell(`H${s.value.length + 7}`).border = { bottom: { style: "thin" } }, e.getCell(`AJ${s.value.length + 7}`).border = { bottom: { style: "thin" } }, e.getCell(`AJ${s.value.length + 9}`).border = { bottom: { style: "thin" } };
|
|
274
276
|
const p = `export_${Y(Date.now(), "{dd}.{m}.{Y}")}.xlsx`, S = await l.xlsx.writeBuffer();
|
|
275
|
-
Ne(new Blob([S]), p),
|
|
277
|
+
Ne(new Blob([S]), p), re.value = !1;
|
|
276
278
|
}, Fe = () => {
|
|
277
279
|
let l = new Blob([ve.value], { type: "text/plain;charset=utf-8" });
|
|
278
280
|
Ne(l, `Служебка_${P(s.value[v.value.ids * 2].fio)}_${Y(Date.now(), "{dd}.{m}.{Y}")}.html`);
|
|
@@ -306,7 +308,7 @@ const el = { class: "nav" }, ll = { style: { height: "20px", width: "100%", disp
|
|
|
306
308
|
onClick: e[1] || (e[1] = (a) => Q.value = !0)
|
|
307
309
|
}, {
|
|
308
310
|
default: g(() => [
|
|
309
|
-
w(C(n(
|
|
311
|
+
w(C(n(r)("workSchedule.jobTitle")), 1)
|
|
310
312
|
]),
|
|
311
313
|
_: 1
|
|
312
314
|
})) : M("", !0),
|
|
@@ -315,7 +317,7 @@ const el = { class: "nav" }, ll = { style: { height: "20px", width: "100%", disp
|
|
|
315
317
|
key: 2,
|
|
316
318
|
modelValue: Z.value,
|
|
317
319
|
"onUpdate:modelValue": e[2] || (e[2] = (a) => Z.value = a),
|
|
318
|
-
"active-text": n(
|
|
320
|
+
"active-text": n(r)("workSchedule.currentMonth"),
|
|
319
321
|
"active-value": "0",
|
|
320
322
|
"inactive-value": "-1",
|
|
321
323
|
style: { "margin-bottom": ".5rem", "margin-left": ".5rem" }
|
|
@@ -342,21 +344,21 @@ const el = { class: "nav" }, ll = { style: { height: "20px", width: "100%", disp
|
|
|
342
344
|
border: "",
|
|
343
345
|
style: { width: "100%" },
|
|
344
346
|
size: "small",
|
|
345
|
-
"empty-text": n(
|
|
347
|
+
"empty-text": n(r)("sheet.emptyText"),
|
|
346
348
|
align: "center",
|
|
347
349
|
onCellClick: Ve,
|
|
348
350
|
"max-height": fe.value,
|
|
349
351
|
"default-sort": { prop: "mame", order: "descending" }
|
|
350
352
|
}, {
|
|
351
353
|
default: g(() => [
|
|
352
|
-
c(n(
|
|
353
|
-
label: n(
|
|
354
|
+
c(n(I), {
|
|
355
|
+
label: n(r)("sheet.title", { name: z.value[0] }) + n(ie)(x.value, "month"),
|
|
354
356
|
align: "center",
|
|
355
357
|
height: "10"
|
|
356
358
|
}, {
|
|
357
359
|
default: g(() => [
|
|
358
|
-
c(n(
|
|
359
|
-
label: n(
|
|
360
|
+
c(n(I), {
|
|
361
|
+
label: n(r)("sheet.employee"),
|
|
360
362
|
width: R.value === "false" ? 180 : l.auto,
|
|
361
363
|
align: "center"
|
|
362
364
|
}, {
|
|
@@ -365,8 +367,8 @@ const el = { class: "nav" }, ll = { style: { height: "20px", width: "100%", disp
|
|
|
365
367
|
]),
|
|
366
368
|
_: 1
|
|
367
369
|
}, 8, ["label", "width"]),
|
|
368
|
-
c(n(
|
|
369
|
-
label: n(
|
|
370
|
+
c(n(I), {
|
|
371
|
+
label: n(r)("sheet.personnelNumber"),
|
|
370
372
|
align: "center",
|
|
371
373
|
width: "108"
|
|
372
374
|
}, {
|
|
@@ -375,15 +377,15 @@ const el = { class: "nav" }, ll = { style: { height: "20px", width: "100%", disp
|
|
|
375
377
|
]),
|
|
376
378
|
_: 1
|
|
377
379
|
}, 8, ["label"]),
|
|
378
|
-
c(n(
|
|
379
|
-
label: n(
|
|
380
|
+
c(n(I), {
|
|
381
|
+
label: n(r)("sheet.marks"),
|
|
380
382
|
align: "center"
|
|
381
383
|
}, {
|
|
382
384
|
default: g(() => [
|
|
383
|
-
(b(!0), O(q, null, me(
|
|
385
|
+
(b(!0), O(q, null, me(d.value, (a) => (b(), O(q, {
|
|
384
386
|
key: a.day
|
|
385
387
|
}, [
|
|
386
|
-
a.day <= 15 ? (b(), _(n(
|
|
388
|
+
a.day <= 15 ? (b(), _(n(I), {
|
|
387
389
|
key: 0,
|
|
388
390
|
width: "30",
|
|
389
391
|
"class-name": a.holidays + Ie(a.day),
|
|
@@ -396,9 +398,9 @@ const el = { class: "nav" }, ll = { style: { height: "20px", width: "100%", disp
|
|
|
396
398
|
]),
|
|
397
399
|
_: 2
|
|
398
400
|
}, 1032, ["class-name", "label"])) : M("", !0),
|
|
399
|
-
a.day === 15 ? (b(), _(n(
|
|
401
|
+
a.day === 15 ? (b(), _(n(I), {
|
|
400
402
|
key: 1,
|
|
401
|
-
label: n(
|
|
403
|
+
label: n(r)("sheet.halfMonth", { half: "I" }),
|
|
402
404
|
align: "center",
|
|
403
405
|
width: "120"
|
|
404
406
|
}, {
|
|
@@ -407,7 +409,7 @@ const el = { class: "nav" }, ll = { style: { height: "20px", width: "100%", disp
|
|
|
407
409
|
]),
|
|
408
410
|
_: 1
|
|
409
411
|
}, 8, ["label"])) : M("", !0),
|
|
410
|
-
a.day > 15 ? (b(), _(n(
|
|
412
|
+
a.day > 15 ? (b(), _(n(I), {
|
|
411
413
|
key: 2,
|
|
412
414
|
width: "30",
|
|
413
415
|
"class-name": a.holidays + Ie(a.day),
|
|
@@ -421,8 +423,8 @@ const el = { class: "nav" }, ll = { style: { height: "20px", width: "100%", disp
|
|
|
421
423
|
_: 2
|
|
422
424
|
}, 1032, ["class-name", "label"])) : M("", !0)
|
|
423
425
|
], 64))), 128)),
|
|
424
|
-
c(n(
|
|
425
|
-
label: n(
|
|
426
|
+
c(n(I), {
|
|
427
|
+
label: n(r)("sheet.halfMonth", { half: "II" }),
|
|
426
428
|
align: "center",
|
|
427
429
|
width: "120"
|
|
428
430
|
}, {
|
|
@@ -434,14 +436,14 @@ const el = { class: "nav" }, ll = { style: { height: "20px", width: "100%", disp
|
|
|
434
436
|
]),
|
|
435
437
|
_: 1
|
|
436
438
|
}, 8, ["label"]),
|
|
437
|
-
R.value === "false" ? (b(), _(n(
|
|
439
|
+
R.value === "false" ? (b(), _(n(I), {
|
|
438
440
|
key: 0,
|
|
439
|
-
label: n(
|
|
441
|
+
label: n(r)("sheet.workedMonth"),
|
|
440
442
|
align: "center"
|
|
441
443
|
}, {
|
|
442
444
|
default: g(() => [
|
|
443
|
-
c(n(
|
|
444
|
-
label: n(
|
|
445
|
+
c(n(I), {
|
|
446
|
+
label: n(r)("sheet.days"),
|
|
445
447
|
align: "center",
|
|
446
448
|
"label-class-name": "turn",
|
|
447
449
|
width: "34"
|
|
@@ -451,13 +453,13 @@ const el = { class: "nav" }, ll = { style: { height: "20px", width: "100%", disp
|
|
|
451
453
|
]),
|
|
452
454
|
_: 1
|
|
453
455
|
}, 8, ["label"]),
|
|
454
|
-
c(n(
|
|
455
|
-
label: n(
|
|
456
|
+
c(n(I), {
|
|
457
|
+
label: n(r)("sheet.hours"),
|
|
456
458
|
align: "center"
|
|
457
459
|
}, {
|
|
458
460
|
default: g(() => [
|
|
459
|
-
c(n(
|
|
460
|
-
label: n(
|
|
461
|
+
c(n(I), {
|
|
462
|
+
label: n(r)("sheet.all"),
|
|
461
463
|
align: "center",
|
|
462
464
|
"label-class-name": "turn",
|
|
463
465
|
width: "40"
|
|
@@ -467,8 +469,8 @@ const el = { class: "nav" }, ll = { style: { height: "20px", width: "100%", disp
|
|
|
467
469
|
]),
|
|
468
470
|
_: 1
|
|
469
471
|
}, 8, ["label"]),
|
|
470
|
-
c(n(
|
|
471
|
-
label: n(
|
|
472
|
+
c(n(I), {
|
|
473
|
+
label: n(r)("sheet.overtime"),
|
|
472
474
|
align: "center",
|
|
473
475
|
"label-class-name": "turn",
|
|
474
476
|
width: "34"
|
|
@@ -478,8 +480,8 @@ const el = { class: "nav" }, ll = { style: { height: "20px", width: "100%", disp
|
|
|
478
480
|
]),
|
|
479
481
|
_: 1
|
|
480
482
|
}, 8, ["label"]),
|
|
481
|
-
c(n(
|
|
482
|
-
label: n(
|
|
483
|
+
c(n(I), {
|
|
484
|
+
label: n(r)("sheet.night"),
|
|
483
485
|
align: "center",
|
|
484
486
|
"label-class-name": "turn",
|
|
485
487
|
width: "34"
|
|
@@ -489,8 +491,8 @@ const el = { class: "nav" }, ll = { style: { height: "20px", width: "100%", disp
|
|
|
489
491
|
]),
|
|
490
492
|
_: 1
|
|
491
493
|
}, 8, ["label"]),
|
|
492
|
-
c(n(
|
|
493
|
-
label: n(
|
|
494
|
+
c(n(I), {
|
|
495
|
+
label: n(r)("sheet.weekend"),
|
|
494
496
|
align: "center",
|
|
495
497
|
"label-class-name": "turn",
|
|
496
498
|
width: "34"
|
|
@@ -506,9 +508,9 @@ const el = { class: "nav" }, ll = { style: { height: "20px", width: "100%", disp
|
|
|
506
508
|
]),
|
|
507
509
|
_: 1
|
|
508
510
|
}, 8, ["label"])) : M("", !0),
|
|
509
|
-
R.value === "false" ? (b(), _(n(
|
|
511
|
+
R.value === "false" ? (b(), _(n(I), {
|
|
510
512
|
key: 1,
|
|
511
|
-
label: n(
|
|
513
|
+
label: n(r)("sheet.numberNonAppearing"),
|
|
512
514
|
align: "center"
|
|
513
515
|
}, {
|
|
514
516
|
default: g((a) => {
|
|
@@ -519,14 +521,14 @@ const el = { class: "nav" }, ll = { style: { height: "20px", width: "100%", disp
|
|
|
519
521
|
}),
|
|
520
522
|
_: 1
|
|
521
523
|
}, 8, ["label"])) : M("", !0),
|
|
522
|
-
R.value === "false" ? (b(), _(n(
|
|
524
|
+
R.value === "false" ? (b(), _(n(I), {
|
|
523
525
|
key: 2,
|
|
524
|
-
label: n(
|
|
526
|
+
label: n(r)("sheet.them"),
|
|
525
527
|
align: "center"
|
|
526
528
|
}, {
|
|
527
529
|
default: g(() => [
|
|
528
|
-
c(n(
|
|
529
|
-
label: n(
|
|
530
|
+
c(n(I), {
|
|
531
|
+
label: n(r)("sheet.code"),
|
|
530
532
|
align: "center",
|
|
531
533
|
"label-class-name": "turn",
|
|
532
534
|
width: "30"
|
|
@@ -539,8 +541,8 @@ const el = { class: "nav" }, ll = { style: { height: "20px", width: "100%", disp
|
|
|
539
541
|
}),
|
|
540
542
|
_: 1
|
|
541
543
|
}, 8, ["label"]),
|
|
542
|
-
c(n(
|
|
543
|
-
label: n(
|
|
544
|
+
c(n(I), {
|
|
545
|
+
label: n(r)("sheet.count"),
|
|
544
546
|
align: "center",
|
|
545
547
|
"label-class-name": "turn",
|
|
546
548
|
width: "30"
|
|
@@ -556,9 +558,9 @@ const el = { class: "nav" }, ll = { style: { height: "20px", width: "100%", disp
|
|
|
556
558
|
]),
|
|
557
559
|
_: 1
|
|
558
560
|
}, 8, ["label"])) : M("", !0),
|
|
559
|
-
R.value === "false" ? (b(), _(n(
|
|
561
|
+
R.value === "false" ? (b(), _(n(I), {
|
|
560
562
|
key: 3,
|
|
561
|
-
label: n(
|
|
563
|
+
label: n(r)("sheet.countWeekend"),
|
|
562
564
|
align: "center"
|
|
563
565
|
}, {
|
|
564
566
|
default: g((a) => [
|
|
@@ -573,20 +575,20 @@ const el = { class: "nav" }, ll = { style: { height: "20px", width: "100%", disp
|
|
|
573
575
|
_: 1
|
|
574
576
|
}, 8, ["data", "empty-text", "max-height"]),
|
|
575
577
|
Oe((b(), _(n(F), {
|
|
576
|
-
disabled:
|
|
578
|
+
disabled: re.value,
|
|
577
579
|
plain: "",
|
|
578
580
|
onClick: Be,
|
|
579
581
|
style: { "margin-top": ".5rem" }
|
|
580
582
|
}, {
|
|
581
583
|
default: g(() => [
|
|
582
|
-
w(C(n(
|
|
584
|
+
w(C(n(r)("workSchedule.exportExcel")), 1)
|
|
583
585
|
]),
|
|
584
586
|
_: 1
|
|
585
587
|
}, 8, ["disabled"])), [
|
|
586
|
-
[m,
|
|
588
|
+
[m, re.value]
|
|
587
589
|
]),
|
|
588
590
|
c(f, {
|
|
589
|
-
title: n(
|
|
591
|
+
title: n(r)("workSchedule.jobTitle"),
|
|
590
592
|
modelValue: Q.value,
|
|
591
593
|
"onUpdate:modelValue": e[7] || (e[7] = (a) => Q.value = a),
|
|
592
594
|
width: "400px"
|
|
@@ -674,7 +676,7 @@ const el = { class: "nav" }, ll = { style: { height: "20px", width: "100%", disp
|
|
|
674
676
|
/^(РВ|Я|Н(?![Н])).*$/.test(v.value.failure) ? (b(), O("div", nl, [
|
|
675
677
|
c(n(oe), { clickClose: !1 }, {
|
|
676
678
|
default: g(() => [
|
|
677
|
-
A("span", null, C(n(
|
|
679
|
+
A("span", null, C(n(r)("workSchedule.with")) + ":", 1)
|
|
678
680
|
]),
|
|
679
681
|
_: 1
|
|
680
682
|
}),
|
|
@@ -688,7 +690,7 @@ const el = { class: "nav" }, ll = { style: { height: "20px", width: "100%", disp
|
|
|
688
690
|
}, null, 8, ["modelValue"]),
|
|
689
691
|
c(n(oe), { clickClose: !1 }, {
|
|
690
692
|
default: g(() => [
|
|
691
|
-
A("span", null, C(n(
|
|
693
|
+
A("span", null, C(n(r)("workSchedule.duration")) + ":", 1)
|
|
692
694
|
]),
|
|
693
695
|
_: 1
|
|
694
696
|
}),
|
|
@@ -703,7 +705,7 @@ const el = { class: "nav" }, ll = { style: { height: "20px", width: "100%", disp
|
|
|
703
705
|
/^(|К|КВ|ОТ|Б|Р|ОЖ|У|ДО|УД|Г)$/.test(v.value.failure) ? (b(), O("div", ul, [
|
|
704
706
|
c(n(oe), { clickClose: !1 }, {
|
|
705
707
|
default: g(() => [
|
|
706
|
-
A("span", null, C(n(
|
|
708
|
+
A("span", null, C(n(r)("sheet.count")) + ":", 1)
|
|
707
709
|
]),
|
|
708
710
|
_: 1
|
|
709
711
|
}),
|
|
@@ -712,7 +714,7 @@ const el = { class: "nav" }, ll = { style: { height: "20px", width: "100%", disp
|
|
|
712
714
|
"onUpdate:modelValue": e[11] || (e[11] = (a) => le.value = a),
|
|
713
715
|
step: 1,
|
|
714
716
|
min: 1,
|
|
715
|
-
max:
|
|
717
|
+
max: d.value.length - v.value.day,
|
|
716
718
|
style: { width: "100%" }
|
|
717
719
|
}, null, 8, ["modelValue", "max"])
|
|
718
720
|
])) : M("", !0),
|
|
@@ -723,7 +725,7 @@ const el = { class: "nav" }, ll = { style: { height: "20px", width: "100%", disp
|
|
|
723
725
|
onClick: e[12] || (e[12] = (a) => he("reset"))
|
|
724
726
|
}, {
|
|
725
727
|
default: g(() => [
|
|
726
|
-
w(C(n(
|
|
728
|
+
w(C(n(r)("sheet.reset")), 1)
|
|
727
729
|
]),
|
|
728
730
|
_: 1
|
|
729
731
|
})) : M("", !0),
|
|
@@ -732,7 +734,7 @@ const el = { class: "nav" }, ll = { style: { height: "20px", width: "100%", disp
|
|
|
732
734
|
onClick: e[13] || (e[13] = (a) => he("save"))
|
|
733
735
|
}, {
|
|
734
736
|
default: g(() => [
|
|
735
|
-
w(C(n(
|
|
737
|
+
w(C(n(r)("sheet.save")), 1)
|
|
736
738
|
]),
|
|
737
739
|
_: 1
|
|
738
740
|
})) : M("", !0),
|
|
@@ -740,17 +742,17 @@ const el = { class: "nav" }, ll = { style: { height: "20px", width: "100%", disp
|
|
|
740
742
|
onClick: e[14] || (e[14] = (a) => U.value = !1)
|
|
741
743
|
}, {
|
|
742
744
|
default: g(() => [
|
|
743
|
-
w(C(n(
|
|
745
|
+
w(C(n(r)("sheet.cancel")), 1)
|
|
744
746
|
]),
|
|
745
747
|
_: 1
|
|
746
748
|
}),
|
|
747
|
-
|
|
749
|
+
de.value ? (b(), _(n(F), {
|
|
748
750
|
key: 2,
|
|
749
751
|
onClick: e[15] || (e[15] = (a) => ze()),
|
|
750
752
|
popovertarget: "my-service"
|
|
751
753
|
}, {
|
|
752
754
|
default: g(() => [
|
|
753
|
-
w(C(n(
|
|
755
|
+
w(C(n(r)("sheet.service")), 1)
|
|
754
756
|
]),
|
|
755
757
|
_: 1
|
|
756
758
|
})) : M("", !0)
|
package/dist/WorkTable.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";const e=require("vue"),de=require("file-saver"),se=require("exceljs"),m=require("./index-Dn3djtwj.cjs"),ve=require("vue-i18n"),i=require("element-plus"),_=require("@imengyu/vue3-context-menu");function ce(C){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(C){for(const V in C)if(V!=="default"){const c=Object.getOwnPropertyDescriptor(C,V);Object.defineProperty(r,V,c.get?c:{enumerable:!0,get:()=>C[V]})}}return r.default=C,Object.freeze(r)}const me=ce(se),ge={class:"work"},he={class:"nav"},fe={style:{height:"100px",width:"100%",display:"inline-block"}},pe={style:{height:"100px",width:"100%",display:"inline-block"}},ye={key:0,class:"controls-container",style:{"margin-top":".5rem"}},we={class:"label"},ke={key:0,style:{padding:"0.5em 1.5em"}},Ce={key:1,style:{padding:"0.5em 1.5em"}},xe={__name:"WorkTable",props:{checkEdit:{type:Boolean,default:()=>!0},odata:Object,workSchedule:Object,fullName:{type:String,default:"Вы"},group:String,date:String},setup(C){const{t:r,d:V}=ve.useI18n(),c=C,I=e.ref(!1),n=e.ref([]),R=e.ref(c.date?new Date(c.date+"T00:00:01").getMonth():new Date().getMonth()),j=e.ref(!1),B=e.ref([]),f=e.ref(new Date(new Date().getFullYear(),new Date().getMonth(),1)),u=e.ref([]),T=e.ref(0),p=e.ref(9),h=e.ref(8),Y=e.ref(!1),J=e.ref(!0),$=e.ref(!1),q=e.ref("5"),M=e.ref(1),x=e.ref([]),O=e.ref([]),E=e.ref([]),U=e.ref([]),g=e.ref({name:"Имя",length:0,code:""}),A=e.ref(!1),P=e.ref({zIndex:3,minWidth:230,x:500,y:200}),Z=e.ref({}),z=e.ref("100%");e.watch(x,async(t,l)=>{t!==l&&(E.value=[],Y.value=!1,c.odata.personal.forEach(o=>{t.includes(o.divisionName)&&(E.value.some(d=>(d==null?void 0:d.activeText)===o.roleName)||E.value.push({val:!0,activeText:o.roleName}))}),W())}),e.watch(R,async t=>{let l=new Date().getMonth(),o=t===null?l:t-1;o=l-1<=o?o:o+12,console.log("currentMonth",o),f.value=new Date(new Date().getFullYear(),o,1),K()});const ee=(t,l,o,d)=>{g.value.ids=t.ids,g.value.key=t.key,g.value.add=t.days.length>0&&t.days[t.days.length-1].cont,g.value.level=l.level,g.value.day=o.cellIndex,P.value.y=d.clientY,P.value.x=d.clientX,l.level===2&&l.no===0&&c.checkEdit&&(g.value.name=r("workSchedule.autocomplete"),A.value=!0),l.level===3&&o.cellIndex-l.no===1&&c.checkEdit&&(D(o.cellIndex,t.ids),g.value.name=r("workSchedule.modeSelection"),A.value=!0)},le=({row:t,columnIndex:l})=>{if(!B.value||B.value.length===0||!j.value)return"";const o=new Date(new Date(f.value).getFullYear(),new Date(f.value).getMonth(),l).getTime()+1e3;for(let d of B.value){const{dateStart:v,dateEnd:a,code:w}=d;if(v&&a&&w===t.code&&l!==0&&l<=u.value.length){const N=new Date(m.parseDate(v)).getTime(),b=new Date(m.parseDate(a)).getTime();if(o>=N&&o<=b)return"vacation"}}return""},K=()=>{var a,w,N,b;const t=Z.value,l=new Date(f.value),o=new Date(l.getFullYear(),l.getMonth()+1,0).getDate();let d=[],v=0;for(let S=1;S<=o;S++){const s=m.parseTime(l.setDate(S),"{Y}-{m}-{dd}");v+=(a=t.nowork)!=null&&a.includes(s)||t.holidays.includes(s)?0:(w=t.preholidays)!=null&&w.includes(s)?7:8;const y=(N=t.nowork)!=null&&N.includes(s)?"nowork":t.holidays.includes(s)?"holiday":(b=t.preholidays)!=null&&b.includes(s)?"preholiday":"";d.push({day:S,holidays:y,weekday:V(new Date(l.getFullYear(),l.getMonth(),S),"day")})}T.value=v,u.value=d,c.odata.getPersonal({}).then(S=>{var s;x.value.length===0&&(x.value=[(s=S.find(y=>y.employeeName===c.fullName))==null?void 0:s.divisionName]),S.forEach((y,L)=>{O.value.some(k=>(k==null?void 0:k.value)===y.divisionName)||O.value.push({value:y.divisionName,label:y.divisionName,key:L}),x.value.includes(y.divisionName)&&!E.value.some(k=>(k==null?void 0:k.activeText)===y.roleName)&&E.value.push({val:!0,activeText:y.roleName})}),W(),J.value=!1})},te=e.computed(()=>!n.value.some(t=>t.contHour!==T.value)),Q=(t,l)=>{var a,w,N;const o=new Date(f.value),d=`${o.getFullYear()}-${(o.getMonth()+1).toString().padStart(2,"0")}-${t.toString().padStart(2,"0")}`,v=(a=n.value[l])==null?void 0:a.days.findIndex(b=>b.day===d);return l===-1||v===-1?"":((w=n.value[l].days[v])==null?void 0:w.tips)+`
|
|
2
|
-
`+((N=n.value[l].days[v])==null?void 0:N.time)},W=()=>{n.value=[],U.value=[],B.value=[],c.odata.personal.forEach(t=>{if(x.value.includes(t.divisionName)&&E.value.some(l=>l.val&&l.activeText===t.roleName)){let l=m.byInitials(t.employeeName);U.value.push(t.employeeKey),n.value.push({name:l+" ("+t.roleName+")",days:[],contHour:0,code:t.employeeKey,id:!1,
|
|
2
|
+
`+((N=n.value[l].days[v])==null?void 0:N.time)},W=()=>{n.value=[],U.value=[],B.value=[],c.odata.personal.forEach(t=>{if(x.value.includes(t.divisionName)&&E.value.some(l=>l.val&&l.activeText===t.roleName)){let l=m.byInitials(t.employeeName);U.value.push(t.employeeKey),n.value.push({name:l+" ("+t.roleName+")",days:[],contHour:0,code:t.employeeKey,id:!1})}}),n.value.sort((t,l)=>t.fio<l.fio?-1:t.fio>l.fio?1:0),n.value.forEach((t,l)=>{t.ids=l}),c.workSchedule.getUsersYear({code:U.value,year:new Date(f.value).getFullYear()}).then(t=>{t.forEach(l=>{l.dateStart&&B.value.push({code:l.code,dateStart:l.dateStart,dateEnd:l.dateEnd})}),ae(),$.value=!1})},ae=()=>{c.workSchedule.getWorkSchedule({code:U.value,date:m.parseTime(new Date(f.value),"{Y}-{m}-{dd}")}).then(t=>{t.forEach((l,o)=>{l!==null&&(n.value[o].days=l.data.days,n.value[o].id=l.id)}),F()})},F=()=>{n.value.forEach(t=>{t.contHour=t.days.reduce((l,o)=>l+o.time,0)})},ne=t=>{n.value[t].days=[],F()},oe=t=>{switch(q.value){case"5":for(let l=M.value;l<=u.value.length;l++)u.value[l-1].holidays===""&&D(l,t,!0),u.value[l-1].holidays==="preholiday"&&(h.value-=1,D(l,t,!0),h.value+=1);break;case"2x2":for(let l=M.value;l<=u.value.length;l+=4)D(l,t,!0),l+1<=u.value.length&&D(l+1,t,!0);break;case"2x5":for(let l=M.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"?(h.value-=1,D(o,t,!0),h.value+=1):D(o,t,!0);break}},D=(t,l,o=!1)=>{const{date:d,ind:v}=H(t,l);v===-1?(n.value[l].days.push({day:d,time:h.value,tips:`(${p.value}:00 - ${h.value>=22?p.value+h.value+2:p.value+h.value+1}:00)`}),F()):o||(h.value=n.value[l].days[v].time,p.value=parseInt(n.value[l].days[v].tips.slice(1,-12)))},ue=(t,l)=>{const{ind:o}=H(t,l);n.value[l].days.splice(o,1),F(),document.querySelector(".app-main").click()},X=(t,l)=>{const{date:o,ind:d}=H(t,l);n.value[l].days[d]={day:o,time:h.value,tips:`(${p.value}:00 - ${h.value>=22?p.value+h.value+2:p.value+h.value+1}:00)`},F()},H=(t,l)=>{var v;const o=m.parseTime(new Date(f.value).setDate(t),"{Y}-{m}-{dd}"),d=(v=n.value[l])==null?void 0:v.days.findIndex(a=>a.day===o);return{date:o,ind:d}},re=async()=>{var S;I.value=!0;const t=new me.Workbook,l=t.addWorksheet(V(f.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"}},v={vertical:"middle",horizontal:"center",wrapText:!0};l.mergeCells(`A1:${m.cellsDynamically("A1",u.value.length+5)}1`),l.mergeCells(`A2:${m.cellsDynamically("A2",u.value.length+5)}2`),l.mergeCells("A3:A4"),l.mergeCells(`B3:${m.cellsDynamically("B3",u.value.length)}3`),l.mergeCells(`${m.cellsDynamically("B3",u.value.length+1)}3:${m.cellsDynamically("B3",u.value.length+2)}3`),l.mergeCells(`${m.cellsDynamically("B3",u.value.length+3)}3:${m.cellsDynamically("B4",u.value.length+3)}4`),l.mergeCells(`${m.cellsDynamically("B3",u.value.length+4)}3:${m.cellsDynamically("B4",u.value.length+4)}4`),l.getCell("A1").value=r("workSchedule.firm"),l.getCell("A2").value=r("workSchedule.title",{name:x.value[0]})+V(f.value,"month")+` ${new Date(f.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")} (${T.value})`;for(let s=2;s<=u.value.length+1;s++)l.getCell(4,s).value=u.value[s-2].weekday+`
|
|
3
3
|
`+(s-1),l.getColumn(s).width=6,l.getColumn(s).alignment=v,l.getCell(4,s).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=v,l.getCell("A2").alignment=o,l.getCell("A3").alignment=o,l.getCell("B3").alignment=o,l.getCell(3,u.value.length+2).alignment=o,l.getColumn(u.value.length+2).alignment=v,l.getColumn(u.value.length+3).alignment=v,l.getColumn(u.value.length+4).alignment=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 a=0;for(const s of n.value){let y=[s.name];for(let k=1;k<=u.value.length;k++){const{ind:G}=H(k,a);G!==-1?y[k]=`${s.days[G].time} ${s.days[G].tips}`:y[k]=" "}y.push(((S=s.days)==null?void 0:S.length)||" ",s.contHour||0);const L=l.addRow(y);L.border=d,a++}let w="Щербина Е. В.";c.odata.personal.forEach(s=>{s.roleName==="Начальник отдела правовой и кадровой работы"&&(w=s.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=m.byInitials(c.fullName),l.getCell(`AD${n.value.length+8}`).value=m.byInitials(w),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 N="export_"+m.parseTime(Date.now(),"{dd}.{m}.{Y}")+".xlsx",b=await t.xlsx.writeBuffer();de.saveAs(new Blob([b]),N),I.value=!1},ie=async()=>{Y.value||c.workSchedule.addWorkSchedule({data:n.value,date:m.parseTime(new Date(f.value),"{Y}-{m}-{dd}"),group:x.value[0]}).then(t=>Y.value=t)};return console.log("props.group",c.group),console.log("props.date",c.date),c.group&&(x.value[0]=c.group),c.date&&(f.value=new Date(c.date+"T00:00:01")),m.holidays().then(t=>{Z.value=t,K()}),(t,l)=>{const o=e.resolveComponent("el-date-picker"),d=e.resolveComponent("svg-icon"),v=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",ge,[e.createElementVNode("div",he,[C.checkEdit?(e.openBlock(),e.createBlock(e.unref(i.ElSelect),{key:0,modelValue:x.value,"onUpdate:modelValue":l[0]||(l[0]=a=>x.value=a),multiple:"","collapse-tags":"","collapse-tags-tooltip":"",placeholder:"Select",style:{width:"240px"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O.value,a=>(e.openBlock(),e.createBlock(e.unref(i.ElOption),{key:a.key,label:a.label,value:a.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])):e.createCommentVNode("",!0),C.checkEdit?(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:1,plain:"",onClick:l[1]||(l[1]=a=>$.value=!0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.jobTitle")),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(o,{modelValue:R.value,"onUpdate:modelValue":l[2]||(l[2]=a=>R.value=a),type:"month",placeholder:"Выберите месяц",format:"MMM","value-format":"M"},null,8,["modelValue"]),l[21]||(l[21]=e.createElementVNode("div",{class:"expander"},null,-1)),e.createVNode(e.unref(i.ElSwitch),{modelValue:z.value,"onUpdate:modelValue":l[3]||(l[3]=a=>z.value=a),"active-text":t.$t("bids.currentHeight"),"active-value":"100%","inactive-value":"calc(100vh - var(--el-component-size)*5 - var(--el-main-padding)*2 - var(--header-height))"},null,8,["modelValue","active-text"]),e.createVNode(e.unref(i.ElSwitch),{modelValue:j.value,"onUpdate:modelValue":l[4]||(l[4]=a=>j.value=a),"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":z.value,size:"small",align:"center",onCellClick:ee,"empty-text":e.unref(r)("workSchedule.emptyText"),"cell-class-name":le},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.title",{name:x.value[0]})+e.unref(V)(f.value,"month")+` ${new Date(f.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:z.value!=="100%"},{default:e.withCtx(a=>[e.createElementVNode("div",fe,e.toDisplayString(n.value[a.$index].name),1)]),_:1},8,["label","fixed"]),e.createVNode(e.unref(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,a=>(e.openBlock(),e.createBlock(e.unref(i.ElTableColumn),{key:a.day,width:"46","class-name":a.holidays,align:"center",label:a.weekday+`
|
|
4
4
|
`+a.day.toString(),prop:"vacation"},{default:e.withCtx(w=>[e.createElementVNode("div",pe,e.toDisplayString(Q(a.day,w.$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:z.value!=="100%"?"right":!1},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.days"),align:"center"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(n.value[a.$index].days.length||0),1)]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:`${e.unref(r)("workSchedule.hours")} ( ${T.value} )`,align:"center"},{default:e.withCtx(a=>[e.createElementVNode("div",{style:e.normalizeStyle(`color: ${T.value===a.row.contHour?"green":"red"};`)},e.toDisplayString(a.row.contHour),5)]),_:1},8,["label"])]),_:1},8,["label","fixed"])]),_:1},8,["label"])]),_:1},8,["data","max-height","empty-text"])]),_:1},8,["loading"]),te.value&&C.checkEdit?(e.openBlock(),e.createElementBlock("div",ye,[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.chartsFilled"))+": ",1),Y.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:0,type:"primary",onClick:ie},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.confirm")),1)]),_:1})),l[22]||(l[22]=e.createTextVNode()),e.createElementVNode("span",null,e.toDisplayString(C.fullName),1)])):e.createCommentVNode("",!0),e.withDirectives((e.openBlock(),e.createBlock(e.unref(i.ElButton),{disabled:I.value,plain:"",onClick:re,style:{"margin-top":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.exportExcel")),1)]),_:1},8,["disabled"])),[[v,I.value]]),e.createVNode(e.unref(i.ElDialog),{title:e.unref(r)("workSchedule.jobTitle"),modelValue:$.value,"onUpdate:modelValue":l[7]||(l[7]=a=>$.value=a),width:"400px"},{footer:e.withCtx(()=>[e.createVNode(e.unref(i.ElButton),{onClick:l[5]||(l[5]=a=>$.value=!1),size:"default"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.$t("workSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(i.ElButton),{size:"default",type:"primary",onClick:l[6]||(l[6]=a=>{W(),$.value=!1})},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.$t("workSchedule.select")),1)]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(i.ElForm),{ref:"dialogForm",model:E.value,autocomplete:"on"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.value,a=>(e.openBlock(),e.createBlock(e.unref(i.ElFormItem),null,{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElSwitch),{modelValue:a.val,"onUpdate:modelValue":w=>a.val=w,"active-text":a.activeText},null,8,["modelValue","onUpdate:modelValue","active-text"])]),_:2},1024))),256))]),_:1},8,["model"])]),_:1},8,["title","modelValue"]),e.createVNode(e.unref(_.ContextMenu),{show:A.value,"onUpdate:show":l[20]||(l[20]=a=>A.value=a),options:P.value},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"mx-context-menu-item",onClick:l[8]||(l[8]=a=>A.value=!1)},[e.createElementVNode("span",we,e.toDisplayString(g.value.name),1),l[23]||(l[23]=e.createElementVNode("div",{class:"expander"},null,-1)),e.createVNode(d,{"icon-class":"cross"})]),e.createVNode(e.unref(_.ContextMenuSeparator)),g.value.level===2?(e.openBlock(),e.createElementBlock("div",ke,[e.createVNode(e.unref(i.ElRadioGroup),{modelValue:q.value,"onUpdate:modelValue":l[9]||(l[9]=a=>q.value=a),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[24]||(l[24]=e.createElementVNode("br",null,null,-1)),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.fromDate"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:M.value,"onUpdate:modelValue":l[10]||(l[10]=a=>M.value=a),step:1,min:1,max:u.value.length},null,8,["modelValue","max"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.with"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:p.value,"onUpdate:modelValue":l[11]||(l[11]=a=>p.value=a),step:1,min:0,max:19},null,8,["modelValue"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.duration"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:h.value,"onUpdate:modelValue":l[12]||(l[12]=a=>h.value=a),step:1,min:4,max:e.unref(m.clamp)(p.value!==1?23-p.value:21,4,22)},null,8,["modelValue","max"]),e.createVNode(e.unref(i.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:l[13]||(l[13]=a=>oe(g.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.fillOut")),1)]),_:1}),e.createVNode(e.unref(i.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:l[14]||(l[14]=a=>ne(g.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.clearRow")),1)]),_:1})])):(e.openBlock(),e.createElementBlock("div",Ce,[e.createElementVNode("div",null,e.toDisplayString(Q(g.value.day,g.value.ids)),1),l[25]||(l[25]=e.createElementVNode("br",null,null,-1)),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.with"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:p.value,"onUpdate:modelValue":l[15]||(l[15]=a=>p.value=a),step:1,min:0,max:19,onChange:l[16]||(l[16]=a=>X(g.value.day,g.value.ids))},null,8,["modelValue"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.duration"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:h.value,"onUpdate:modelValue":l[17]||(l[17]=a=>h.value=a),step:1,min:4,max:e.unref(m.clamp)(p.value!==1?23-p.value:21,4,22),onChange:l[18]||(l[18]=a=>X(g.value.day,g.value.ids))},null,8,["modelValue","max"]),e.createVNode(e.unref(i.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:l[19]||(l[19]=a=>ue(g.value.day,g.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.delete")),1)]),_:1})]))]),_:1},8,["show","options"])])}}};module.exports=xe;
|
package/dist/WorkTable.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref as g, watch as
|
|
1
|
+
import { ref as g, watch as ye, computed as Ae, resolveComponent as we, resolveDirective as Te, createElementBlock as z, openBlock as S, createElementVNode as y, createVNode as i, createCommentVNode as _, withDirectives as Be, createBlock as F, unref as a, withCtx as v, Fragment as ie, renderList as re, createTextVNode as V, toDisplayString as h, normalizeStyle as ze } from "vue";
|
|
2
2
|
import { saveAs as Fe } from "file-saver";
|
|
3
3
|
import * as Ye from "exceljs";
|
|
4
4
|
import { p as G, b as se, h as Ue, c as ke, a as Ce, d as M } from "./index-2Mx6IUGl.js";
|
|
@@ -39,17 +39,17 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
|
|
|
39
39
|
// code: '0000-00052'
|
|
40
40
|
// ids: 1
|
|
41
41
|
// }
|
|
42
|
-
]), ee = g(c.date ? (/* @__PURE__ */ new Date(c.date + "T00:00:01")).getMonth() : (/* @__PURE__ */ new Date()).getMonth()), le = g(!1), I = g([]), w = g(new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1)), u = g([]), R = g(0), k = g(9),
|
|
42
|
+
]), ee = g(c.date ? (/* @__PURE__ */ new Date(c.date + "T00:00:01")).getMonth() : (/* @__PURE__ */ new Date()).getMonth()), le = g(!1), I = g([]), w = g(new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1)), u = g([]), R = g(0), k = g(9), f = g(8), K = g(!1), me = g(!0), U = g(!1), te = g("5"), W = g(1), b = g([]), ae = g([]), N = g([]), Q = g([]), p = g({ name: "Имя", length: 0, code: "" }), P = g(!1), ne = g({
|
|
43
43
|
zIndex: 3,
|
|
44
44
|
minWidth: 230,
|
|
45
45
|
x: 500,
|
|
46
46
|
y: 200
|
|
47
47
|
}), he = g({}), j = g("100%");
|
|
48
|
-
|
|
48
|
+
ye(b, async (l, e) => {
|
|
49
49
|
l !== e && (N.value = [], K.value = !1, c.odata.personal.forEach((o) => {
|
|
50
50
|
l.includes(o.divisionName) && (N.value.some((r) => (r == null ? void 0 : r.activeText) === o.roleName) || N.value.push({ val: !0, activeText: o.roleName }));
|
|
51
51
|
}), oe());
|
|
52
|
-
}),
|
|
52
|
+
}), ye(ee, async (l) => {
|
|
53
53
|
let e = (/* @__PURE__ */ new Date()).getMonth(), o = l === null ? e : l - 1;
|
|
54
54
|
o = e - 1 <= o ? o : o + 12, console.log("currentMonth", o), w.value = new Date((/* @__PURE__ */ new Date()).getFullYear(), o, 1), ce();
|
|
55
55
|
});
|
|
@@ -91,12 +91,14 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
|
|
|
91
91
|
n.value = [], Q.value = [], I.value = [], c.odata.personal.forEach((l) => {
|
|
92
92
|
if (b.value.includes(l.divisionName) && N.value.some((e) => e.val && e.activeText === l.roleName)) {
|
|
93
93
|
let e = se(l.employeeName);
|
|
94
|
-
Q.value.push(l.employeeKey), n.value.push({ name: e + " (" + l.roleName + ")", days: [], contHour: 0, code: l.employeeKey, id: !1
|
|
94
|
+
Q.value.push(l.employeeKey), n.value.push({ name: e + " (" + l.roleName + ")", days: [], contHour: 0, code: l.employeeKey, id: !1 });
|
|
95
95
|
}
|
|
96
|
+
}), n.value.sort((l, e) => l.fio < e.fio ? -1 : l.fio > e.fio ? 1 : 0), n.value.forEach((l, e) => {
|
|
97
|
+
l.ids = e;
|
|
96
98
|
}), c.workSchedule.getUsersYear({ code: Q.value, year: new Date(w.value).getFullYear() }).then((l) => {
|
|
97
99
|
l.forEach((e) => {
|
|
98
100
|
e.dateStart && I.value.push({ code: e.code, dateStart: e.dateStart, dateEnd: e.dateEnd });
|
|
99
|
-
}),
|
|
101
|
+
}), be(), U.value = !1;
|
|
100
102
|
});
|
|
101
103
|
}, be = () => {
|
|
102
104
|
c.workSchedule.getWorkSchedule({ code: Q.value, date: G(new Date(w.value), "{Y}-{m}-{dd}") }).then(
|
|
@@ -116,7 +118,7 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
|
|
|
116
118
|
switch (te.value) {
|
|
117
119
|
case "5":
|
|
118
120
|
for (let e = W.value; e <= u.value.length; e++)
|
|
119
|
-
u.value[e - 1].holidays === "" && B(e, l, !0), u.value[e - 1].holidays === "preholiday" && (
|
|
121
|
+
u.value[e - 1].holidays === "" && B(e, l, !0), u.value[e - 1].holidays === "preholiday" && (f.value -= 1, B(e, l, !0), f.value += 1);
|
|
120
122
|
break;
|
|
121
123
|
case "2x2":
|
|
122
124
|
for (let e = W.value; e <= u.value.length; e += 4)
|
|
@@ -125,25 +127,25 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
|
|
|
125
127
|
case "2x5":
|
|
126
128
|
for (let e = W.value; e <= u.value.length; e += 7)
|
|
127
129
|
for (let o = e; o < e + 5 && o <= u.value.length; o++)
|
|
128
|
-
u.value[o - 1].holidays === "preholiday" ? (
|
|
130
|
+
u.value[o - 1].holidays === "preholiday" ? (f.value -= 1, B(o, l, !0), f.value += 1) : B(o, l, !0);
|
|
129
131
|
break;
|
|
130
132
|
}
|
|
131
133
|
}, B = (l, e, o = !1) => {
|
|
132
134
|
const { date: r, ind: m } = X(l, e);
|
|
133
135
|
m === -1 ? (n.value[e].days.push({
|
|
134
136
|
day: r,
|
|
135
|
-
time:
|
|
136
|
-
tips: `(${k.value}:00 - ${
|
|
137
|
-
}), O()) : o || (
|
|
137
|
+
time: f.value,
|
|
138
|
+
tips: `(${k.value}:00 - ${f.value >= 22 ? k.value + f.value + 2 : k.value + f.value + 1}:00)`
|
|
139
|
+
}), O()) : o || (f.value = n.value[e].days[m].time, k.value = parseInt(n.value[e].days[m].tips.slice(1, -12)));
|
|
138
140
|
}, Ee = (l, e) => {
|
|
139
141
|
const { ind: o } = X(l, e);
|
|
140
142
|
n.value[e].days.splice(o, 1), O(), document.querySelector(".app-main").click();
|
|
141
|
-
},
|
|
143
|
+
}, fe = (l, e) => {
|
|
142
144
|
const { date: o, ind: r } = X(l, e);
|
|
143
145
|
n.value[e].days[r] = {
|
|
144
146
|
day: o,
|
|
145
|
-
time:
|
|
146
|
-
tips: `(${k.value}:00 - ${
|
|
147
|
+
time: f.value,
|
|
148
|
+
tips: `(${k.value}:00 - ${f.value >= 22 ? k.value + f.value + 2 : k.value + f.value + 1}:00)`
|
|
147
149
|
}, O();
|
|
148
150
|
}, X = (l, e) => {
|
|
149
151
|
var m;
|
|
@@ -183,7 +185,7 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
|
|
|
183
185
|
}), (l, e) => {
|
|
184
186
|
const o = we("el-date-picker"), r = we("svg-icon"), m = Te("loading");
|
|
185
187
|
return S(), z("div", Je, [
|
|
186
|
-
|
|
188
|
+
y("div", Ke, [
|
|
187
189
|
H.checkEdit ? (S(), F(a(Ie), {
|
|
188
190
|
key: 0,
|
|
189
191
|
modelValue: b.value,
|
|
@@ -221,7 +223,7 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
|
|
|
221
223
|
format: "MMM",
|
|
222
224
|
"value-format": "M"
|
|
223
225
|
}, null, 8, ["modelValue"]),
|
|
224
|
-
e[21] || (e[21] =
|
|
226
|
+
e[21] || (e[21] = y("div", { class: "expander" }, null, -1)),
|
|
225
227
|
i(a(ve), {
|
|
226
228
|
modelValue: j.value,
|
|
227
229
|
"onUpdate:modelValue": e[3] || (e[3] = (t) => j.value = t),
|
|
@@ -290,7 +292,7 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
|
|
|
290
292
|
fixed: j.value !== "100%"
|
|
291
293
|
}, {
|
|
292
294
|
default: v((t) => [
|
|
293
|
-
|
|
295
|
+
y("div", Qe, h(n.value[t.$index].name), 1)
|
|
294
296
|
]),
|
|
295
297
|
_: 1
|
|
296
298
|
}, 8, ["label", "fixed"]),
|
|
@@ -309,7 +311,7 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
|
|
|
309
311
|
prop: "vacation"
|
|
310
312
|
}, {
|
|
311
313
|
default: v((x) => [
|
|
312
|
-
|
|
314
|
+
y("div", Xe, h(pe(t.day, x.$index) || " "), 1)
|
|
313
315
|
]),
|
|
314
316
|
_: 2
|
|
315
317
|
}, 1032, ["class-name", "label"]))), 128))
|
|
@@ -336,7 +338,7 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
|
|
|
336
338
|
align: "center"
|
|
337
339
|
}, {
|
|
338
340
|
default: v((t) => [
|
|
339
|
-
|
|
341
|
+
y("div", {
|
|
340
342
|
style: ze(`color: ${R.value === t.row.contHour ? "green" : "red"};`)
|
|
341
343
|
}, h(t.row.contHour), 5)
|
|
342
344
|
]),
|
|
@@ -367,7 +369,7 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
|
|
|
367
369
|
_: 1
|
|
368
370
|
})),
|
|
369
371
|
e[22] || (e[22] = V()),
|
|
370
|
-
|
|
372
|
+
y("span", null, h(H.fullName), 1)
|
|
371
373
|
])) : _("", !0),
|
|
372
374
|
Be((S(), F(a(T), {
|
|
373
375
|
disabled: J.value,
|
|
@@ -440,12 +442,12 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
|
|
|
440
442
|
options: ne.value
|
|
441
443
|
}, {
|
|
442
444
|
default: v(() => [
|
|
443
|
-
|
|
445
|
+
y("div", {
|
|
444
446
|
class: "mx-context-menu-item",
|
|
445
447
|
onClick: e[8] || (e[8] = (t) => P.value = !1)
|
|
446
448
|
}, [
|
|
447
|
-
|
|
448
|
-
e[23] || (e[23] =
|
|
449
|
+
y("span", el, h(p.value.name), 1),
|
|
450
|
+
e[23] || (e[23] = y("div", { class: "expander" }, null, -1)),
|
|
449
451
|
i(r, { "icon-class": "cross" })
|
|
450
452
|
]),
|
|
451
453
|
i(a(qe)),
|
|
@@ -471,8 +473,8 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
|
|
|
471
473
|
]),
|
|
472
474
|
_: 1
|
|
473
475
|
}, 8, ["modelValue"]),
|
|
474
|
-
e[24] || (e[24] =
|
|
475
|
-
|
|
476
|
+
e[24] || (e[24] = y("br", null, null, -1)),
|
|
477
|
+
y("span", null, h(a(d)("workSchedule.fromDate")) + ":", 1),
|
|
476
478
|
i(a(Z), {
|
|
477
479
|
modelValue: W.value,
|
|
478
480
|
"onUpdate:modelValue": e[10] || (e[10] = (t) => W.value = t),
|
|
@@ -480,7 +482,7 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
|
|
|
480
482
|
min: 1,
|
|
481
483
|
max: u.value.length
|
|
482
484
|
}, null, 8, ["modelValue", "max"]),
|
|
483
|
-
|
|
485
|
+
y("span", null, h(a(d)("workSchedule.with")) + ":", 1),
|
|
484
486
|
i(a(Z), {
|
|
485
487
|
modelValue: k.value,
|
|
486
488
|
"onUpdate:modelValue": e[11] || (e[11] = (t) => k.value = t),
|
|
@@ -488,10 +490,10 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
|
|
|
488
490
|
min: 0,
|
|
489
491
|
max: 19
|
|
490
492
|
}, null, 8, ["modelValue"]),
|
|
491
|
-
|
|
493
|
+
y("span", null, h(a(d)("workSchedule.duration")) + ":", 1),
|
|
492
494
|
i(a(Z), {
|
|
493
|
-
modelValue:
|
|
494
|
-
"onUpdate:modelValue": e[12] || (e[12] = (t) =>
|
|
495
|
+
modelValue: f.value,
|
|
496
|
+
"onUpdate:modelValue": e[12] || (e[12] = (t) => f.value = t),
|
|
495
497
|
step: 1,
|
|
496
498
|
min: 4,
|
|
497
499
|
max: a(ke)(k.value !== 1 ? 23 - k.value : 21, 4, 22)
|
|
@@ -517,25 +519,25 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
|
|
|
517
519
|
_: 1
|
|
518
520
|
})
|
|
519
521
|
])) : (S(), z("div", tl, [
|
|
520
|
-
|
|
521
|
-
e[25] || (e[25] =
|
|
522
|
-
|
|
522
|
+
y("div", null, h(pe(p.value.day, p.value.ids)), 1),
|
|
523
|
+
e[25] || (e[25] = y("br", null, null, -1)),
|
|
524
|
+
y("span", null, h(a(d)("workSchedule.with")) + ":", 1),
|
|
523
525
|
i(a(Z), {
|
|
524
526
|
modelValue: k.value,
|
|
525
527
|
"onUpdate:modelValue": e[15] || (e[15] = (t) => k.value = t),
|
|
526
528
|
step: 1,
|
|
527
529
|
min: 0,
|
|
528
530
|
max: 19,
|
|
529
|
-
onChange: e[16] || (e[16] = (t) =>
|
|
531
|
+
onChange: e[16] || (e[16] = (t) => fe(p.value.day, p.value.ids))
|
|
530
532
|
}, null, 8, ["modelValue"]),
|
|
531
|
-
|
|
533
|
+
y("span", null, h(a(d)("workSchedule.duration")) + ":", 1),
|
|
532
534
|
i(a(Z), {
|
|
533
|
-
modelValue:
|
|
534
|
-
"onUpdate:modelValue": e[17] || (e[17] = (t) =>
|
|
535
|
+
modelValue: f.value,
|
|
536
|
+
"onUpdate:modelValue": e[17] || (e[17] = (t) => f.value = t),
|
|
535
537
|
step: 1,
|
|
536
538
|
min: 4,
|
|
537
539
|
max: a(ke)(k.value !== 1 ? 23 - k.value : 21, 4, 22),
|
|
538
|
-
onChange: e[18] || (e[18] = (t) =>
|
|
540
|
+
onChange: e[18] || (e[18] = (t) => fe(p.value.day, p.value.ids))
|
|
539
541
|
}, null, 8, ["modelValue", "max"]),
|
|
540
542
|
i(a(T), {
|
|
541
543
|
style: { "margin-top": ".5rem" },
|