@studio-west/employees 0.6.26 → 0.6.27
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 +3 -3
- package/dist/SheetTable.js +263 -263
- package/package.json +1 -1
package/dist/SheetTable.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),se=require("vue-i18n"),v=require("./index-Dn3djtwj.cjs"),m=require("element-plus"),I=require("@imengyu/vue3-context-menu"),ie=require("file-saver"),de=require("exceljs");function ce($){const y=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if($){for(const r in $)if(r!=="default"){const E=Object.getOwnPropertyDescriptor($,r);Object.defineProperty(y,r,E.get?E:{enumerable:!0,get:()=>$[r]})}}return y.default=$,Object.freeze(y)}const ve=ce(de),he={class:"nav"},ge={style:{height:"20px",width:"100%",display:"inline-block"}},me={style:{height:"20px",width:"100%",display:"inline-block"}},fe={key:0,style:{padding:"0 1rem .5rem"}},ye={key:1,style:{padding:"0 1rem .5rem"}},pe={__name:"SheetTable",props:{checkEdit:{type:Boolean,default:()=>!0},odata:Object,workSchedule:Object,fullName:{type:String,default:"Вы"},group:String,date:String},setup($){const y=$,{t:r,d:E}=se.useI18n(),U=e.ref(!1),C=e.ref([]),O=e.ref("0"),p=e.ref(new Date(new Date().getFullYear(),new Date().getMonth(),1).setMonth(new Date().getMonth()+Number(O.value))),s=e.ref([]),N=e.ref("all"),H=e.ref([{value:"all",label:"Все",key:"all"}]),ee=e.ref([{value:"Я",label:r("sheet.valid.1")},{value:"К",label:r("sheet.valid.2")},{value:"ОТ",label:r("sheet.valid.3")},{value:"ДО",label:r("sheet.valid.4")},{value:"Р",label:r("sheet.valid.5")},{value:"ОЖ",label:r("sheet.valid.6")},{value:"Б",label:r("sheet.valid.7")},{value:"НН",label:r("sheet.valid.8")},{value:"ПР",label:r("sheet.valid.9")},{value:"У",label:r("sheet.valid.10")},{value:"УД",label:r("sheet.valid.11")},{value:"Г",label:r("sheet.valid.12")}]),J=e.ref([]),le=e.ref(0),D=e.ref(9),w=e.ref(8),S=e.ref(0),W=e.ref(0),A=e.ref([]),Y=e.ref(!1),R=e.ref([]),q=e.ref([]),B=e.ref(!1),P=e.ref(1),L=e.ref({zIndex:3,minWidth:230,x:500,y:200}),c=e.ref({name:"",length:0,code:""}),x=e.ref([]),f=e.computed(()=>C.value.flatMap((a,l)=>{const i=x.value.find(t=>t.code===a.code),o=new Map;a.days.forEach(t=>o.set(t.day,{...t})),i&&i.days.forEach(t=>o.set(t.day,{...t}));const n=Array.from(o.values());return[{...a,days:n,key:0,ids:l,numberNonAppearing:[0,0]},{...a,days:n,key:1,ids:l,numberNonAppearing:[0,0]}]}));e.watch(N,async(a,l)=>{a!==l&&(A.value=[],confirm.value=!1,y.odata.personal.forEach(i=>{i.divisionName===a&&(A.value.some(o=>(o==null?void 0:o.activeText)===i.roleName)||A.value.push({val:!0,activeText:i.roleName}))}),ne())}),e.watch(O,a=>{p.value=new Date(new Date().getFullYear(),new Date().getMonth(),1).setMonth(new Date().getMonth()+Number(a)),G()}),e.watch(w,()=>{Y.value=B.value}),e.watch(D,()=>{Y.value=B.value}),e.watch(P,()=>{Y.value=B.value});const te=(a,l,i,o)=>{if(l.level!==3||l.labelClassName==="turn"||l.no===15||l.no>s.value.length||!y.checkEdit)return"";c.value.ids=a.ids,c.value.key=a.key,c.value.day=l.no<15?l.no:l.no-1;const n=new Date(p.value),t=`${n.getFullYear()}-${(n.getMonth()+1).toString().padStart(2,"0")}-${(c.value.day+1).toString().padStart(2,"0")}`,d=x.value.findIndex(g=>g.code===a.code);c.value.id=d!==-1?x.value[d].days.findIndex(g=>(g==null?void 0:g.day)===t):d,c.value.rest=d!==-1&&c.value.id!==-1,D.value=typeof a.days[c.value.day].tips>"u"?9:parseInt(a.days[c.value.day].tips.match(/(\d{1,2})/)),S.value=typeof a.days[c.value.day].night>"u"?0:parseInt(a.days[c.value.day].night),W.value=typeof a.days[c.value.day].overtime>"u"?0:parseInt(a.days[c.value.day].overtime),w.value=a.days[c.value.day].time!=="-"?parseInt(a.days[c.value.day].time+S.value+W.value):8;const h=a.days.findIndex(g=>g.day===t);c.value.failure=a.days[h].state,L.value.y=o.clientY,L.value.x=o.clientX,c.value.name=r("sheet.choiceOfMode"),B.value=!0,Y.value=!1},j=a=>{const l=new Date(p.value),i=`${l.getFullYear()}-${(l.getMonth()+1).toString().padStart(2,"0")}-${(c.value.day+1).toString().padStart(2,"0")}`;let o=x.value.findIndex(b=>b.code===C.value[c.value.ids].code),n=C.value[c.value.ids].days[c.value.day].state,t=a,d="-",h,g,k;switch(a){case"Я":n==="В"&&(t="РВ"),d=8;break;case"КВ":case"К":n==="В"||n==="КВ"?t="КВ":t="К";break;case"save":let b=K.value.split('"');if(t=b[1],Y.value=!1,/^(|К|КВ|ОТ|Б|Р|ОЖ|НН|У|ДО|УД|Г)$/.test(b[1]))break;d=w.value-S.value-W.value,k="("+b[2].split("(")[1],h=S.value,g=W.value}a==="reset"?(t=n,x.value[o].days.splice(c.value.id,1)):o===-1?x.value.push({code:C.value[c.value.ids].code,days:[{day:i,state:t,time:d,night:h,overtime:g,tips:k}]}):c.value.id===-1?x.value[o].days.push({day:i,state:t,time:d,night:h,overtime:g,tips:k}):x.value[o].days[c.value.id]={day:i,state:t,time:d,night:h,overtime:g,tips:k},y.workSchedule.addWorkSheet({group:N.value,date:v.parseTime(new Date(p.value),"{Y}-{m}-{dd}"),data:[{name:C.value[c.value.ids].fio,days:x.value[o].days,code:C.value[c.value.ids].code}]}),c.value.failure=t,P.value>1&&(P.value--,c.value.day++,c.value.id=o!==-1?x.value[o].days.findIndex(b=>(b==null?void 0:b.day)===`${l.getFullYear()}-${(l.getMonth()+1).toString().padStart(2,"0")}-${(c.value.day+1).toString().padStart(2,"0")}`):o,j(c.value.failure)),X()},K=e.computed(()=>{let a=C.value[c.value.ids].days[c.value.day],l="",i=w.value>=22?D.value+w.value+2:D.value+w.value+1,o=c.value.failure.split("/")[0];o=/^Н(?!Н$)С?$/.test(o)?a.state!=="В"?"Я":"РВ":o,(D.value<6||i>22)&&(l="Н",S.value=D.value<6?Math.min(6,i)-D.value:0,i<=6&&(S.value=w.value,o=""),i===7&&S.value>3&&S.value--,S.value+=Math.max(22,i)-22),w.value>a.time&&o!=="РВ"&&(l+="С",W.value=w.value-a.time),l.length>0&&o.length>0&&(l="/"+l);let n=typeof(a==null?void 0:a.tips)<"u"?a.tips:`(${D.value}:00 - ${w.value>=22?D.value+w.value+2:D.value+w.value+1}:00)`,t=f.value[c.value.ids*2].days[c.value.day].time!=="-"?" "+w.value+" "+n:"";return'"'+o+l+'"'+t}),ae=a=>{if(a.columnIndex<2||a.columnIndex>s.value.length+3&&a.columnIndex<s.value.length+9||a.columnIndex>s.value.length+11)return f.value[a.rowIndex].key===0?{rowspan:2,colspan:1}:{rowspan:0,colspan:0}},G=()=>{const a=J.value,l=new Date(p.value),i=new Date(l.getFullYear(),l.getMonth()+1,0).getDate();let o=[],n=0;for(let t=1;t<=i;t++){const d=v.parseTime(l.setDate(t),"{Y}-{m}-{dd}");n+=a.nowork.includes(d)||a.holidays.includes(d)?0:a.preholidays.includes(d)?7:8;let h=a.nowork.includes(d)?"nowork":a.holidays.includes(d)?"holiday":a.preholidays.includes(d)?"preholiday":"";o.push({day:t,holidays:h,weekday:E(new Date(l.getFullYear(),l.getMonth(),t),"day")})}le.value=n,s.value=o,y.odata.getPersonal({}).then(t=>{var d;N.value=(d=t.find(h=>h.employeeName===y.fullName))==null?void 0:d.divisionName,t.forEach(h=>{H.value.some(g=>(g==null?void 0:g.value)===h.divisionName)||H.value.push({value:h.divisionName,label:h.divisionName,key:h.divisionName}),h.divisionName===N.value&&!A.value.some(g=>(g==null?void 0:g.activeText)===h.roleName)&&A.value.push({val:!0,activeText:h.roleName})})})},ne=()=>{C.value=[],q.value=[],R.value=[],y.odata.personal.forEach(a=>{if(a.divisionName===N.value&&A.value.some(l=>l.val&&l.activeText===a.roleName)){let l=v.byInitials(a.employeeName);q.value.push(a.employeeKey),C.value.push({fio:a.employeeName,name:l+" ("+a.roleName+")",code:a.employeeKey,days:[],contHour:0,id:!1,ids:C.value.length})}}),y.workSchedule.getUsersYear({code:q.value,year:new Date(p.value).getFullYear()}).then(a=>{a.forEach(l=>{l.dateStart&&R.value.push({code:l.code,dateStart:l.dateStart,dateEnd:l.dateEnd})}),ue()})},ue=()=>{y.workSchedule.getWorkSheet({code:q.value,date:v.parseTime(new Date(p.value),"{Y}-{m}-{dd}")}).then(a=>{x.value=[],a.forEach(l=>{l!==null&&x.value.push({code:l.code,days:l.data.days})})}),y.workSchedule.getWorkSchedule({code:q.value,date:v.parseTime(new Date(p.value),"{Y}-{m}-{dd}")}).then(a=>{a.forEach((l,i)=>{var o,n;if(C.value[i].days=[],l!==null){l.data.days.forEach(t=>t.state="Я");for(let t=1;t<=s.value.length;t++){let d=v.parseTime(new Date(p.value).setDate(t),"{Y}-{m}-{dd}");const h=(o=l.data)==null?void 0:o.days.findIndex(g=>g.day===d);h===-1?z(t,i,"-","В"):C.value[i].days.push((n=l.data)==null?void 0:n.days[h])}}else for(let t=1;t<=s.value.length;t++)s.value[t-1].holidays===""?z(t,i,8):s.value[t-1].holidays==="preholiday"?z(t,i,7):z(t,i,"-","В");for(let t=1;t<=s.value.length;t++){let d=new Date(new Date(p.value).getFullYear(),new Date(p.value).getMonth(),t).getTime()+1e3;for(let h of R.value){const{dateStart:g,dateEnd:k,code:b}=h;if(g&&k&&b===C.value[i].code){const M=new Date(v.parseDate(g)).getTime(),_=new Date(v.parseDate(k)).getTime();if(d>=M&&d<=_){const T=v.parseTime(new Date(p.value).setDate(t),"{Y}-{m}-{dd}"),u=C.value[i].days.findIndex(F=>F.day===T);u!==-1?C.value[i].days[u]={day:T,time:"-",state:"ОТ"}:C.value[i].days.push({day:T,time:"-",state:"ОТ"})}}}}}),X()})},z=(a,l,i,o="Я")=>{const n=v.parseTime(new Date(p.value).setDate(a),"{Y}-{m}-{dd}");C.value[l].days.push({day:n,time:i,state:o})},X=()=>{f.value.forEach(a=>{a.hourI=0,a.hourII=0,a.halfII=0,a.halfI=0,a.weekend=0,a.weekendDays=0,a.overtime=0,a.night=0,a.appearing={code:"-",count:"-"};const l=Object.entries(a.days.reduce((t,d)=>{if(d.hasOwnProperty("state")&&/^(|К|КВ|ОТ|Б|Р|ПР|ОЖ|НН|У|ДО|УД|Г)$/.test(d.state)){const h=d.state;t[h]=(t[h]||0)+1}return t},{})).map(([t,d])=>({code:t,count:d}));a.numberNonAppearing=[l.reduce((t,d)=>t+d.count,0),0];const i=Math.ceil(l.length/2),o=l.slice(0,i),n=l.slice(i);a.key===0&&o.length>0&&(a.appearing={code:o.map(t=>t.code).join("/"),count:o.map(t=>t.count).join("/")}),a.key===1&&n.length>0&&(a.appearing={code:n.map(t=>t.code).join("/"),count:n.map(t=>t.count).join("/")});for(let t=0;t<a.days.length;t++)t<15&&a.days[t].time!=="-"&&(a.hourI+=Number(a.days[t].time),a.days[t].night&&(a.hourI+=Number(a.days[t].night)),a.days[t].overtime&&(a.hourI+=Number(a.days[t].overtime)),a.halfI++),t>=15&&a.days[t].time!=="-"&&(a.days[t].night&&(a.hourII+=Number(a.days[t].night)),a.days[t].overtime&&(a.hourII+=Number(a.days[t].overtime)),a.hourII+=Number(a.days[t].time),a.halfII++),a.days[t].night&&(a.night+=Number(a.days[t].night)),a.days[t].overtime&&(a.overtime+=Number(a.days[t].overtime)),/{|РВ|}/.test(a.days[t].state)&&(a.weekend+=Number(a.days[t].time)),a.days[t].state==="В"&&a.weekendDays++;a.contDays=a.halfI+a.halfII,a.contHour=a.hourI+a.hourII})},Z=(a,l)=>{var h,g,k,b,M,_;if(l===-1)return"";const i=f.value[l],o=new Date(p.value),n=`${o.getFullYear()}-${(o.getMonth()+1).toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}`,t=i.days.findIndex(T=>T.day===n);let d=0;return(h=i.days[t])!=null&&h.night&&(d+=i.days[t].night),(g=i.days[t])!=null&&g.overtime&&(d+=i.days[t].overtime),t===-1?"":i.key===0?(k=i.days[t])==null?void 0:k.state:((b=i.days[t])==null?void 0:b.time)===0?d===0?"-":d:d===0?(M=i.days[t])==null?void 0:M.time:`${(_=i.days[t])==null?void 0:_.time}/${d}`};y.group&&(N.value=y.group),y.date&&(O.value=new Date(y.date+"T00:00:01").getMonth()),v.holidays().then(a=>{J.value=a,G()});const Q=a=>new Date(p.value).getMonth()===new Date().getMonth()&&a===new Date().getDate()?" today":"",oe=async()=>{var b,M,_,T;U.value=!0;const a=new ve.Workbook,l=a.addWorksheet(E(p.value,"month"),{pageSetup:{paperSize:9,orientation:"landscape",fitToPage:!0}}),i={vertical:"middle",horizontal:"center"},o={top:{style:"thin"},left:{style:"thin"},bottom:{style:"thin"},right:{style:"thin"}},n={vertical:"middle",horizontal:"center",wrapText:!0};l.mergeCells(`A1:${v.cellsDynamically("A1",s.value.length+15)}1`),l.mergeCells("A2:A4"),l.mergeCells("B2:B4"),l.mergeCells("C2:C4"),l.mergeCells("D5:R5"),l.mergeCells(`D2:${v.cellsDynamically("D2",s.value.length+2)}2`),l.mergeCells(`${v.cellsDynamically("D2",s.value.length+3)}2:${v.cellsDynamically("D2",s.value.length+8)}2`),l.mergeCells(`${v.cellsDynamically("D2",s.value.length+9)}2:${v.cellsDynamically("D2",s.value.length+9)}4`),l.mergeCells(`${v.cellsDynamically("D2",s.value.length+10)}2:${v.cellsDynamically("D2",s.value.length+11)}2`),l.mergeCells(`${v.cellsDynamically("D2",s.value.length+12)}2:${v.cellsDynamically("D2",s.value.length+12)}4`),l.mergeCells(`${v.cellsDynamically("D3",s.value.length+3)}3:${v.cellsDynamically("D3",s.value.length+3)}4`),l.mergeCells(`${v.cellsDynamically("D3",s.value.length+4)}3:${v.cellsDynamically("D3",s.value.length+8)}3`),l.mergeCells(`${v.cellsDynamically("D3",s.value.length+10)}3:${v.cellsDynamically("D3",s.value.length+10)}4`),l.mergeCells(`${v.cellsDynamically("D3",s.value.length+11)}3:${v.cellsDynamically("D3",s.value.length+11)}4`),l.mergeCells(`T5:${v.cellsDynamically("D5",s.value.length+1)}5`);for(let u=1;u<=s.value.length+2;u++)l.mergeCells(`${v.cellsDynamically("D3",u)}3:${v.cellsDynamically("D4",u)}4`),l.getColumn(u+3).width=5,l.getColumn(u+3).alignment=n,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=r("sheet.title",{name:N.value})+E(p.value,"month"),l.getCell("A2").value=r("sheet.listNumber"),l.getCell("B2").value=r("sheet.employee"),l.getCell("C2").value=r("sheet.personnelNumber"),l.getCell("D2").value=r("sheet.marks"),l.getCell("S3").value=r("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,s.value.length+5).value="7",l.getCell(2,s.value.length+6).value=r("sheet.workedMonth"),l.getCell(2,s.value.length+12).value=r("sheet.numberNonAppearing"),l.getCell(2,s.value.length+13).value=r("sheet.them"),l.getCell(2,s.value.length+15).value=r("sheet.countWeekend"),l.getCell(3,s.value.length+5).value=r("sheet.halfMonth",{half:"II"}),l.getCell(3,s.value.length+6).value=r("sheet.days"),l.getCell(3,s.value.length+7).value=r("sheet.hours"),l.getCell(4,s.value.length+7).value=r("sheet.all"),l.getCell(4,s.value.length+8).value=r("sheet.overtime"),l.getCell(4,s.value.length+9).value=r("sheet.night"),l.getCell(4,s.value.length+10).value=r("sheet.weekend"),l.getCell(4,s.value.length+13).value=r("sheet.code"),l.getCell(4,s.value.length+14).value=r("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(s.value.length+5).width=12,l.getColumn(s.value.length+12).width=11,l.getColumn(s.value.length+15).width=11,l.getCell("A1").alignment=i,l.getColumn(1).alignment=n,l.getColumn(2).alignment=n,l.getColumn(3).alignment=n;for(let u=6;u<=15;u++)l.getCell(5,s.value.length+u).value=u+2,l.getColumn(s.value.length+u).alignment=n,l.getCell(4,s.value.length+u).border=o,l.getCell(5,s.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,s.value.length+6).border=o,l.getCell(2,s.value.length+12).border=o,l.getCell(2,s.value.length+13).border=o,l.getCell(2,s.value.length+15).border=o,l.getCell(3,s.value.length+7).border=o;let t=1,d=5,h=!0;for(const u of f.value){let F=[t,u.name,u.code];for(let V=0;V<s.value.length;V++)V===15&&F.push(h?(u==null?void 0:u.halfI)||"":(u==null?void 0:u.hourI)||""),F.push(h?((b=u.days[V])==null?void 0:b.state)||"":((M=u.days[V])==null?void 0:M.time)||"");F.push(h?(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,"",h?(u==null?void 0:u.numberNonAppearing[0])||"":(u==null?void 0:u.numberNonAppearing[1])||0,((_=u==null?void 0:u.appearing)==null?void 0:_.code)||"-",((T=u==null?void 0:u.appearing)==null?void 0:T.count)||"-",(u==null?void 0:u.weekendDays)||0);const re=l.addRow(F);if(re.border=o,!h){l.mergeCells(`A${d+t*2-1}:A${d+t*2}`),l.mergeCells(`B${d+t*2-1}:B${d+t*2}`),l.mergeCells(`C${d+t*2-1}:C${d+t*2}`);for(let V=s.value.length+3;V<=s.value.length+8;V++)l.mergeCells(`${v.cellsDynamically("D",V)}${d+t*2-1}:${v.cellsDynamically("D",V)}${d+t*2}`);l.mergeCells(`${v.cellsDynamically("D",s.value.length+12)}${d+t*2-1}:${v.cellsDynamically("D",s.value.length+12)}${d+t*2}`),t++}h=!h}y.odata.personal.forEach(u=>{u.roleName==="Начальник отдела правовой и кадровой работы"&&u.employeeName});const g="export_"+v.parseTime(Date.now(),"{dd}.{m}.{Y}")+".xlsx",k=await a.xlsx.writeBuffer();ie.saveAs(new Blob([k]),g),U.value=!1};return(a,l)=>{const i=e.resolveComponent("el-slider"),o=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",he,[$.checkEdit?(e.openBlock(),e.createBlock(e.unref(m.ElSelect),{key:0,modelValue:N.value,"onUpdate:modelValue":l[0]||(l[0]=n=>N.value=n),placeholder:"Select",style:{width:"240px","margin-bottom":".5rem","margin-right":".5rem"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.value,n=>(e.openBlock(),e.createBlock(e.unref(m.ElOption),{key:n.value,label:n.label,value:n.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])):e.createCommentVNode("",!0),l[9]||(l[9]=e.createElementVNode("div",{class:"expander"},null,-1)),$.checkEdit?(e.openBlock(),e.createBlock(e.unref(m.ElSwitch),{key:1,modelValue:O.value,"onUpdate:modelValue":l[1]||(l[1]=n=>O.value=n),"active-text":e.unref(r)("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.ElTable),{id:"printTable",data:f.value,"span-method":ae,border:"",style:{width:"100%"},size:"small","empty-text":e.unref(r)("sheet.emptyText"),align:"center",onCellClick:te},{default:e.withCtx(()=>[e.createVNode(e.unref(m.ElTableColumn),{label:e.unref(r)("sheet.title",{name:N.value})+e.unref(E)(p.value,"month"),align:"center",height:"10"},{default:e.withCtx(()=>[e.createVNode(e.unref(m.ElTableColumn),{label:e.unref(r)("sheet.employee"),width:"180",align:"center"},{default:e.withCtx(n=>[e.createTextVNode(e.toDisplayString(f.value[n.$index].name),1)]),_:1},8,["label"]),e.createVNode(e.unref(m.ElTableColumn),{label:e.unref(r)("sheet.personnelNumber"),align:"center"},{default:e.withCtx(n=>[e.createTextVNode(e.toDisplayString(f.value[n.$index].code),1)]),_:1},8,["label"]),e.createVNode(e.unref(m.ElTableColumn),{label:e.unref(r)("sheet.marks"),align:"center"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,n=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:n.day},[n.day<=15?(e.openBlock(),e.createBlock(e.unref(m.ElTableColumn),{key:0,width:"30","class-name":n.holidays+Q(n.day),align:"center",label:n.day.toString()+`
|
|
2
|
-
`+n.weekday},{default:e.withCtx(
|
|
3
|
-
`+n.weekday},{default:e.withCtx(
|
|
1
|
+
"use strict";const e=require("vue"),se=require("vue-i18n"),v=require("./index-Dn3djtwj.cjs"),m=require("element-plus"),I=require("@imengyu/vue3-context-menu"),ie=require("file-saver"),de=require("exceljs");function ce($){const y=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if($){for(const s in $)if(s!=="default"){const T=Object.getOwnPropertyDescriptor($,s);Object.defineProperty(y,s,T.get?T:{enumerable:!0,get:()=>$[s]})}}return y.default=$,Object.freeze(y)}const ve=ce(de),he={class:"nav"},ge={style:{height:"20px",width:"100%",display:"inline-block"}},me={style:{height:"20px",width:"100%",display:"inline-block"}},fe={key:0,style:{padding:"0 1rem .5rem"}},ye={key:1,style:{padding:"0 1rem .5rem"}},pe={__name:"SheetTable",props:{checkEdit:{type:Boolean,default:()=>!0},odata:Object,workSchedule:Object,fullName:{type:String,default:"Вы"},group:String,date:String},setup($){const y=$,{t:s,d:T}=se.useI18n(),U=e.ref(!1),b=e.ref([]),O=e.ref("0"),p=e.ref(new Date(new Date().getFullYear(),new Date().getMonth(),1).setMonth(new Date().getMonth()+Number(O.value))),i=e.ref([]),N=e.ref(""),H=e.ref([{value:"all",label:"Все",key:"all"}]),te=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")}]),K=e.ref([]),ae=e.ref(0),D=e.ref(9),w=e.ref(8),S=e.ref(0),W=e.ref(0),A=e.ref([]),Y=e.ref(!1),R=e.ref([]),q=e.ref([]),E=e.ref(!1),P=e.ref(1),L=e.ref({zIndex:3,minWidth:230,x:500,y:200}),c=e.ref({name:"",length:0,code:""}),k=e.ref([]),f=e.computed(()=>b.value.flatMap((t,l)=>{const d=k.value.find(a=>a.code===t.code),o=new Map;t.days.forEach(a=>o.set(a.day,{...a})),d&&d.days.forEach(a=>o.set(a.day,{...a}));const n=Array.from(o.values());return[{...t,days:n,key:0,ids:l,numberNonAppearing:[0,0]},{...t,days:n,key:1,ids:l,numberNonAppearing:[0,0]}]}));e.watch(N,async(t,l)=>{t!==l&&(A.value=[],confirm.value=!1,y.odata.personal.forEach(d=>{d.divisionName===t&&(A.value.some(o=>(o==null?void 0:o.activeText)===d.roleName)||A.value.push({val:!0,activeText:d.roleName}))}),Z())}),e.watch(O,t=>{p.value=new Date(new Date().getFullYear(),new Date().getMonth(),1).setMonth(new Date().getMonth()+Number(t)),X(),Z()}),e.watch(w,()=>{Y.value=E.value}),e.watch(D,()=>{Y.value=E.value}),e.watch(P,()=>{Y.value=E.value});const ne=(t,l,d,o)=>{if(l.level!==3||l.labelClassName==="turn"||l.no===15||l.no>i.value.length||!y.checkEdit)return"";c.value.ids=t.ids,c.value.key=t.key,c.value.day=l.no<15?l.no:l.no-1;const n=new Date(p.value),a=`${n.getFullYear()}-${(n.getMonth()+1).toString().padStart(2,"0")}-${(c.value.day+1).toString().padStart(2,"0")}`,r=k.value.findIndex(g=>g.code===t.code);c.value.id=r!==-1?k.value[r].days.findIndex(g=>(g==null?void 0:g.day)===a):r,c.value.rest=r!==-1&&c.value.id!==-1,D.value=typeof t.days[c.value.day].tips>"u"?9:parseInt(t.days[c.value.day].tips.match(/(\d{1,2})/)),S.value=typeof t.days[c.value.day].night>"u"?0:parseInt(t.days[c.value.day].night),W.value=typeof t.days[c.value.day].overtime>"u"?0:parseInt(t.days[c.value.day].overtime),w.value=t.days[c.value.day].time!=="-"?parseInt(t.days[c.value.day].time+S.value+W.value):8;const h=t.days.findIndex(g=>g.day===a);c.value.failure=t.days[h].state,L.value.y=o.clientY,L.value.x=o.clientX,c.value.name=s("sheet.choiceOfMode"),E.value=!0,Y.value=!1},j=t=>{const l=new Date(p.value),d=`${l.getFullYear()}-${(l.getMonth()+1).toString().padStart(2,"0")}-${(c.value.day+1).toString().padStart(2,"0")}`;let o=k.value.findIndex(C=>C.code===b.value[c.value.ids].code),n=b.value[c.value.ids].days[c.value.day].state,a=t,r="-",h,g,x;switch(t){case"Я":n==="В"&&(a="РВ"),r=8;break;case"КВ":case"К":n==="В"||n==="КВ"?a="КВ":a="К";break;case"save":let C=G.value.split('"');if(a=C[1],Y.value=!1,/^(|К|КВ|ОТ|Б|Р|ОЖ|НН|У|ДО|УД|Г)$/.test(C[1]))break;r=w.value-S.value-W.value,x="("+C[2].split("(")[1],h=S.value,g=W.value}t==="reset"?(a=n,k.value[o].days.splice(c.value.id,1)):o===-1?k.value.push({code:b.value[c.value.ids].code,days:[{day:d,state:a,time:r,night:h,overtime:g,tips:x}]}):c.value.id===-1?k.value[o].days.push({day:d,state:a,time:r,night:h,overtime:g,tips:x}):k.value[o].days[c.value.id]={day:d,state:a,time:r,night:h,overtime:g,tips:x},y.workSchedule.addWorkSheet({group:N.value,date:v.parseTime(new Date(p.value),"{Y}-{m}-{dd}"),data:[{name:b.value[c.value.ids].fio,days:k.value[o].days,code:b.value[c.value.ids].code}]}),c.value.failure=a,P.value>1&&(P.value--,c.value.day++,c.value.id=o!==-1?k.value[o].days.findIndex(C=>(C==null?void 0:C.day)===`${l.getFullYear()}-${(l.getMonth()+1).toString().padStart(2,"0")}-${(c.value.day+1).toString().padStart(2,"0")}`):o,j(c.value.failure)),Q()},G=e.computed(()=>{let t=b.value[c.value.ids].days[c.value.day],l="",d=w.value>=22?D.value+w.value+2:D.value+w.value+1,o=c.value.failure.split("/")[0];o=/^Н(?!Н$)С?$/.test(o)?t.state!=="В"?"Я":"РВ":o,(D.value<6||d>22)&&(l="Н",S.value=D.value<6?Math.min(6,d)-D.value:0,d<=6&&(S.value=w.value,o=""),d===7&&S.value>3&&S.value--,S.value+=Math.max(22,d)-22),w.value>t.time&&o!=="РВ"&&(l+="С",W.value=w.value-t.time),l.length>0&&o.length>0&&(l="/"+l);let n=typeof(t==null?void 0:t.tips)<"u"?t.tips:`(${D.value}:00 - ${w.value>=22?D.value+w.value+2:D.value+w.value+1}:00)`,a=f.value[c.value.ids*2].days[c.value.day].time!=="-"?" "+w.value+" "+n:"";return'"'+o+l+'"'+a}),ue=t=>{if(t.columnIndex<2||t.columnIndex>i.value.length+3&&t.columnIndex<i.value.length+9||t.columnIndex>i.value.length+11)return f.value[t.rowIndex].key===0?{rowspan:2,colspan:1}:{rowspan:0,colspan:0}},X=()=>{const t=K.value,l=new Date(p.value),d=new Date(l.getFullYear(),l.getMonth()+1,0).getDate();let o=[],n=0;for(let a=1;a<=d;a++){const r=v.parseTime(l.setDate(a),"{Y}-{m}-{dd}");n+=t.nowork.includes(r)||t.holidays.includes(r)?0:t.preholidays.includes(r)?7:8;let h=t.nowork.includes(r)?"nowork":t.holidays.includes(r)?"holiday":t.preholidays.includes(r)?"preholiday":"";o.push({day:a,holidays:h,weekday:T(new Date(l.getFullYear(),l.getMonth(),a),"day")})}ae.value=n,i.value=o,y.odata.getPersonal({}).then(a=>{var r;N.value.length===0&&(N.value=(r=a.find(h=>h.employeeName===y.fullName))==null?void 0:r.divisionName),a.forEach(h=>{H.value.some(g=>(g==null?void 0:g.value)===h.divisionName)||H.value.push({value:h.divisionName,label:h.divisionName,key:h.divisionName}),h.divisionName===N.value&&!A.value.some(g=>(g==null?void 0:g.activeText)===h.roleName)&&A.value.push({val:!0,activeText:h.roleName})})})},Z=()=>{b.value=[],q.value=[],R.value=[],y.odata.personal.forEach(t=>{if(t.divisionName===N.value&&A.value.some(l=>l.val&&l.activeText===t.roleName)){let l=v.byInitials(t.employeeName);q.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})}}),y.workSchedule.getUsersYear({code:q.value,year:new Date(p.value).getFullYear()}).then(t=>{t.forEach(l=>{l.dateStart&&R.value.push({code:l.code,dateStart:l.dateStart,dateEnd:l.dateEnd})}),oe()})},oe=()=>{y.workSchedule.getWorkSheet({code:q.value,date:v.parseTime(new Date(p.value),"{Y}-{m}-{dd}")}).then(t=>{k.value=[],t.forEach(l=>{l!==null&&k.value.push({code:l.code,days:l.data.days})}),y.workSchedule.getWorkSchedule({code:q.value,date:v.parseTime(new Date(p.value),"{Y}-{m}-{dd}")}).then(l=>{l.forEach((d,o)=>{var n,a;if(d!==null){b.value[o].days=[],d.data.days.forEach(r=>r.state="Я");for(let r=1;r<=i.value.length;r++){let h=v.parseTime(new Date(p.value).setDate(r),"{Y}-{m}-{dd}");const g=(n=d.data)==null?void 0:n.days.findIndex(x=>x.day===h);g===-1?z(r,o,"-","В"):b.value[o].days.push((a=d.data)==null?void 0:a.days[g])}}else for(let r=1;r<=i.value.length;r++)i.value[r-1].holidays===""?z(r,o,8):i.value[r-1].holidays==="preholiday"?z(r,o,7):z(r,o,"-","В");for(let r=1;r<=i.value.length;r++){let h=new Date(new Date(p.value).getFullYear(),new Date(p.value).getMonth(),r).getTime()+1e3;for(let g of R.value){const{dateStart:x,dateEnd:C,code:B}=g;if(x&&C&&B===b.value[o].code){const M=new Date(v.parseDate(x)).getTime(),F=new Date(v.parseDate(C)).getTime();if(h>=M&&h<=F){const u=v.parseTime(new Date(p.value).setDate(r),"{Y}-{m}-{dd}"),_=b.value[o].days.findIndex(J=>J.day===u);_!==-1?b.value[o].days[_]={day:u,time:"-",state:"ОТ"}:b.value[o].days.push({day:u,time:"-",state:"ОТ"})}}}}}),Q()})})},z=(t,l,d,o="Я")=>{const n=v.parseTime(new Date(p.value).setDate(t),"{Y}-{m}-{dd}");b.value[l].days.push({day:n,time:d,state:o})},Q=()=>{f.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((a,r)=>{if(r.hasOwnProperty("state")&&/^(|К|КВ|ОТ|Б|Р|ПР|ОЖ|НН|У|ДО|УД|Г)$/.test(r.state)){const h=r.state;a[h]=(a[h]||0)+1}return a},{})).map(([a,r])=>({code:a,count:r}));t.numberNonAppearing=[l.reduce((a,r)=>a+r.count,0),0];const d=Math.ceil(l.length/2),o=l.slice(0,d),n=l.slice(d);t.key===0&&o.length>0&&(t.appearing={code:o.map(a=>a.code).join("/"),count:o.map(a=>a.count).join("/")}),t.key===1&&n.length>0&&(t.appearing={code:n.map(a=>a.code).join("/"),count:n.map(a=>a.count).join("/")});for(let a=0;a<t.days.length;a++)a<15&&t.days[a].time!=="-"&&(t.hourI+=Number(t.days[a].time),t.days[a].night&&(t.hourI+=Number(t.days[a].night)),t.days[a].overtime&&(t.hourI+=Number(t.days[a].overtime)),t.halfI++),a>=15&&t.days[a].time!=="-"&&(t.days[a].night&&(t.hourII+=Number(t.days[a].night)),t.days[a].overtime&&(t.hourII+=Number(t.days[a].overtime)),t.hourII+=Number(t.days[a].time),t.halfII++),t.days[a].night&&(t.night+=Number(t.days[a].night)),t.days[a].overtime&&(t.overtime+=Number(t.days[a].overtime)),/{|РВ|}/.test(t.days[a].state)&&(t.weekend+=Number(t.days[a].time)),t.days[a].state==="В"&&t.weekendDays++;t.contDays=t.halfI+t.halfII,t.contHour=t.hourI+t.hourII})},ee=(t,l)=>{var h,g,x,C,B,M;if(l===-1)return"";const d=f.value[l],o=new Date(p.value),n=`${o.getFullYear()}-${(o.getMonth()+1).toString().padStart(2,"0")}-${t.toString().padStart(2,"0")}`,a=d.days.findIndex(F=>F.day===n);let r=0;return(h=d.days[a])!=null&&h.night&&(r+=d.days[a].night),(g=d.days[a])!=null&&g.overtime&&(r+=d.days[a].overtime),a===-1?"":d.key===0?(x=d.days[a])==null?void 0:x.state:((C=d.days[a])==null?void 0:C.time)===0?r===0?"-":r:r===0?(B=d.days[a])==null?void 0:B.time:`${(M=d.days[a])==null?void 0:M.time}/${r}`};y.group&&(N.value=y.group),y.date&&(O.value=new Date(y.date+"T00:00:01").getMonth()),v.holidays().then(t=>{K.value=t,X()});const le=t=>new Date(p.value).getMonth()===new Date().getMonth()&&t===new Date().getDate()?" today":"",re=async()=>{var C,B,M,F;U.value=!0;const t=new ve.Workbook,l=t.addWorksheet(T(p.value,"month"),{pageSetup:{paperSize:9,orientation:"landscape",fitToPage:!0}}),d={vertical:"middle",horizontal:"center"},o={top:{style:"thin"},left:{style:"thin"},bottom:{style:"thin"},right:{style:"thin"}},n={vertical:"middle",horizontal:"center",wrapText:!0};l.mergeCells(`A1:${v.cellsDynamically("A1",i.value.length+15)}1`),l.mergeCells("A2:A4"),l.mergeCells("B2:B4"),l.mergeCells("C2:C4"),l.mergeCells("D5:R5"),l.mergeCells(`D2:${v.cellsDynamically("D2",i.value.length+2)}2`),l.mergeCells(`${v.cellsDynamically("D2",i.value.length+3)}2:${v.cellsDynamically("D2",i.value.length+8)}2`),l.mergeCells(`${v.cellsDynamically("D2",i.value.length+9)}2:${v.cellsDynamically("D2",i.value.length+9)}4`),l.mergeCells(`${v.cellsDynamically("D2",i.value.length+10)}2:${v.cellsDynamically("D2",i.value.length+11)}2`),l.mergeCells(`${v.cellsDynamically("D2",i.value.length+12)}2:${v.cellsDynamically("D2",i.value.length+12)}4`),l.mergeCells(`${v.cellsDynamically("D3",i.value.length+3)}3:${v.cellsDynamically("D3",i.value.length+3)}4`),l.mergeCells(`${v.cellsDynamically("D3",i.value.length+4)}3:${v.cellsDynamically("D3",i.value.length+8)}3`),l.mergeCells(`${v.cellsDynamically("D3",i.value.length+10)}3:${v.cellsDynamically("D3",i.value.length+10)}4`),l.mergeCells(`${v.cellsDynamically("D3",i.value.length+11)}3:${v.cellsDynamically("D3",i.value.length+11)}4`),l.mergeCells(`T5:${v.cellsDynamically("D5",i.value.length+1)}5`);for(let u=1;u<=i.value.length+2;u++)l.mergeCells(`${v.cellsDynamically("D3",u)}3:${v.cellsDynamically("D4",u)}4`),l.getColumn(u+3).width=5,l.getColumn(u+3).alignment=n,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:N.value})+T(p.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,i.value.length+5).value="7",l.getCell(2,i.value.length+6).value=s("sheet.workedMonth"),l.getCell(2,i.value.length+12).value=s("sheet.numberNonAppearing"),l.getCell(2,i.value.length+13).value=s("sheet.them"),l.getCell(2,i.value.length+15).value=s("sheet.countWeekend"),l.getCell(3,i.value.length+5).value=s("sheet.halfMonth",{half:"II"}),l.getCell(3,i.value.length+6).value=s("sheet.days"),l.getCell(3,i.value.length+7).value=s("sheet.hours"),l.getCell(4,i.value.length+7).value=s("sheet.all"),l.getCell(4,i.value.length+8).value=s("sheet.overtime"),l.getCell(4,i.value.length+9).value=s("sheet.night"),l.getCell(4,i.value.length+10).value=s("sheet.weekend"),l.getCell(4,i.value.length+13).value=s("sheet.code"),l.getCell(4,i.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(i.value.length+5).width=12,l.getColumn(i.value.length+12).width=11,l.getColumn(i.value.length+15).width=11,l.getCell("A1").alignment=d,l.getColumn(1).alignment=n,l.getColumn(2).alignment=n,l.getColumn(3).alignment=n;for(let u=6;u<=15;u++)l.getCell(5,i.value.length+u).value=u+2,l.getColumn(i.value.length+u).alignment=n,l.getCell(4,i.value.length+u).border=o,l.getCell(5,i.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,i.value.length+6).border=o,l.getCell(2,i.value.length+12).border=o,l.getCell(2,i.value.length+13).border=o,l.getCell(2,i.value.length+15).border=o,l.getCell(3,i.value.length+7).border=o;let a=1,r=5,h=!0;for(const u of f.value){let _=[a,u.name,u.code];for(let V=0;V<i.value.length;V++)V===15&&_.push(h?(u==null?void 0:u.halfI)||"":(u==null?void 0:u.hourI)||""),_.push(h?((C=u.days[V])==null?void 0:C.state)||"":((B=u.days[V])==null?void 0:B.time)||"");_.push(h?(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,"",h?(u==null?void 0:u.numberNonAppearing[0])||"":(u==null?void 0:u.numberNonAppearing[1])||0,((M=u==null?void 0:u.appearing)==null?void 0:M.code)||"-",((F=u==null?void 0:u.appearing)==null?void 0:F.count)||"-",(u==null?void 0:u.weekendDays)||0);const J=l.addRow(_);if(J.border=o,!h){l.mergeCells(`A${r+a*2-1}:A${r+a*2}`),l.mergeCells(`B${r+a*2-1}:B${r+a*2}`),l.mergeCells(`C${r+a*2-1}:C${r+a*2}`);for(let V=i.value.length+3;V<=i.value.length+8;V++)l.mergeCells(`${v.cellsDynamically("D",V)}${r+a*2-1}:${v.cellsDynamically("D",V)}${r+a*2}`);l.mergeCells(`${v.cellsDynamically("D",i.value.length+12)}${r+a*2-1}:${v.cellsDynamically("D",i.value.length+12)}${r+a*2}`),a++}h=!h}y.odata.personal.forEach(u=>{u.roleName==="Начальник отдела правовой и кадровой работы"&&u.employeeName});const g="export_"+v.parseTime(Date.now(),"{dd}.{m}.{Y}")+".xlsx",x=await t.xlsx.writeBuffer();ie.saveAs(new Blob([x]),g),U.value=!1};return(t,l)=>{const d=e.resolveComponent("el-slider"),o=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",he,[$.checkEdit?(e.openBlock(),e.createBlock(e.unref(m.ElSelect),{key:0,modelValue:N.value,"onUpdate:modelValue":l[0]||(l[0]=n=>N.value=n),placeholder:"Select",style:{width:"240px","margin-bottom":".5rem","margin-right":".5rem"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.value,n=>(e.openBlock(),e.createBlock(e.unref(m.ElOption),{key:n.value,label:n.label,value:n.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])):e.createCommentVNode("",!0),l[9]||(l[9]=e.createElementVNode("div",{class:"expander"},null,-1)),$.checkEdit?(e.openBlock(),e.createBlock(e.unref(m.ElSwitch),{key:1,modelValue:O.value,"onUpdate:modelValue":l[1]||(l[1]=n=>O.value=n),"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.ElTable),{id:"printTable",data:f.value,"span-method":ue,border:"",style:{width:"100%"},size:"small","empty-text":e.unref(s)("sheet.emptyText"),align:"center",onCellClick:ne},{default:e.withCtx(()=>[e.createVNode(e.unref(m.ElTableColumn),{label:e.unref(s)("sheet.title",{name:N.value})+e.unref(T)(p.value,"month"),align:"center",height:"10"},{default:e.withCtx(()=>[e.createVNode(e.unref(m.ElTableColumn),{label:e.unref(s)("sheet.employee"),width:"180",align:"center"},{default:e.withCtx(n=>[e.createTextVNode(e.toDisplayString(f.value[n.$index].name),1)]),_:1},8,["label"]),e.createVNode(e.unref(m.ElTableColumn),{label:e.unref(s)("sheet.personnelNumber"),align:"center"},{default:e.withCtx(n=>[e.createTextVNode(e.toDisplayString(f.value[n.$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(i.value,n=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:n.day},[n.day<=15?(e.openBlock(),e.createBlock(e.unref(m.ElTableColumn),{key:0,width:"30","class-name":n.holidays+le(n.day),align:"center",label:n.day.toString()+`
|
|
2
|
+
`+n.weekday},{default:e.withCtx(a=>[e.createElementVNode("div",ge,e.toDisplayString(ee(n.day,a.$index)||" "),1)]),_:2},1032,["class-name","label"])):e.createCommentVNode("",!0),n.day===15?(e.openBlock(),e.createBlock(e.unref(m.ElTableColumn),{key:1,label:e.unref(s)("sheet.halfMonth",{half:"I"}),align:"center"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(f.value[a.$index].key===0?f.value[a.$index].halfI:f.value[a.$index].hourI),1)]),_:1},8,["label"])):e.createCommentVNode("",!0),n.day>15?(e.openBlock(),e.createBlock(e.unref(m.ElTableColumn),{key:2,width:"30","class-name":n.holidays+le(n.day),align:"center",label:n.day.toString()+`
|
|
3
|
+
`+n.weekday},{default:e.withCtx(a=>[e.createElementVNode("div",me,e.toDisplayString(ee(n.day,a.$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"},{default:e.withCtx(n=>[e.createTextVNode(e.toDisplayString(f.value[n.$index].key===0?f.value[n.$index].halfII:f.value[n.$index].hourII),1)]),_:1},8,["label"])]),_:1},8,["label"]),e.createVNode(e.unref(m.ElTableColumn),{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(n=>[e.createTextVNode(e.toDisplayString(f.value[n.$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(n=>[e.createTextVNode(e.toDisplayString(f.value[n.$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(n=>[e.createTextVNode(e.toDisplayString(f.value[n.$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(n=>[e.createTextVNode(e.toDisplayString(f.value[n.$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(n=>[e.createTextVNode(e.toDisplayString(f.value[n.$index].weekend),1)]),_:1},8,["label"])]),_:1},8,["label"])]),_:1},8,["label"]),e.createVNode(e.unref(m.ElTableColumn),{label:e.unref(s)("sheet.numberNonAppearing"),align:"center"},{default:e.withCtx(n=>{var a;return[e.createTextVNode(e.toDisplayString((a=f.value[n.$index])==null?void 0:a.numberNonAppearing[f.value[n.$index].key]),1)]}),_:1},8,["label"]),e.createVNode(e.unref(m.ElTableColumn),{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(n=>{var a;return[e.createTextVNode(e.toDisplayString((a=f.value[n.$index].appearing)==null?void 0:a.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(n=>{var a;return[e.createTextVNode(e.toDisplayString((a=f.value[n.$index].appearing)==null?void 0:a.count),1)]}),_:1},8,["label"])]),_:1},8,["label"]),e.createVNode(e.unref(m.ElTableColumn),{label:e.unref(s)("sheet.countWeekend"),align:"center"},{default:e.withCtx(n=>[e.createTextVNode(e.toDisplayString(f.value[n.$index].weekendDays),1)]),_:1},8,["label"])]),_:1},8,["label"])]),_:1},8,["data","empty-text"]),e.withDirectives((e.openBlock(),e.createBlock(e.unref(m.ElButton),{disabled:U.value,plain:"",onClick:re,style:{"margin-top":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("workSchedule.exportExcel")),1)]),_:1},8,["disabled"])),[[o,U.value]]),e.createVNode(e.unref(I.ContextMenu),{show:E.value,"onUpdate:show":l[8]||(l[8]=n=>E.value=n),options:L.value},{default:e.withCtx(()=>[e.createVNode(e.unref(I.ContextMenuItem),{label:c.value.name,disabled:""},null,8,["label"]),e.createVNode(e.unref(I.ContextMenuSeparator)),e.createElementVNode("div",null,[e.createElementVNode("div",null,[e.createVNode(e.unref(I.ContextMenuGroup),{label:G.value,style:{padding:"0 0 .5rem"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(te.value,n=>(e.openBlock(),e.createBlock(e.unref(I.ContextMenuItem),{key:n.value,label:n.label,onClick:a=>j(n.value),clickClose:!1},null,8,["label","onClick"]))),128))]),_:1},8,["label"])]),/^(РВ|Я|Н(?![Н])).*$/.test(c.value.failure)?(e.openBlock(),e.createElementBlock("div",fe,[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(d,{modelValue:D.value,"onUpdate:modelValue":l[2]||(l[2]=n=>D.value=n),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(d,{modelValue:w.value,"onUpdate:modelValue":l[3]||(l[3]=n=>w.value=n),step:1,min:4,max:e.unref(v.clamp)(D.value!==1?23-D.value:21,4,22)},null,8,["modelValue","max"])])):e.createCommentVNode("",!0),/^(|К|КВ|ОТ|Б|Р|ОЖ|У|ДО|УД|Г)$/.test(c.value.failure)?(e.openBlock(),e.createElementBlock("div",ye,[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(d,{modelValue:P.value,"onUpdate:modelValue":l[4]||(l[4]=n=>P.value=n),step:1,min:1,max:i.value.length-c.value.day,style:{width:"100%"}},null,8,["modelValue","max"])])):e.createCommentVNode("",!0),e.createVNode(e.unref(I.ContextMenuItem),null,{default:e.withCtx(()=>[c.value.rest?(e.openBlock(),e.createBlock(e.unref(m.ElButton),{key:0,onClick:l[5]||(l[5]=n=>j("reset"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("sheet.reset")),1)]),_:1})):e.createCommentVNode("",!0),Y.value?(e.openBlock(),e.createBlock(e.unref(m.ElButton),{key:1,onClick:l[6]||(l[6]=n=>j("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[7]||(l[7]=n=>E.value=!1)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("sheet.cancel")),1)]),_:1})]),_:1})])]),_:1},8,["show","options"])],64)}}};module.exports=pe;
|
package/dist/SheetTable.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ref as p, computed as
|
|
1
|
+
import { ref as p, computed as fe, watch as q, resolveComponent as xe, resolveDirective as Ie, createElementBlock as R, openBlock as $, Fragment as Z, createElementVNode as V, createVNode as m, withDirectives as Se, createBlock as A, createCommentVNode as B, unref as s, withCtx as g, renderList as ie, createTextVNode as x, toDisplayString as b } from "vue";
|
|
2
2
|
import { useI18n as Ne } from "vue-i18n";
|
|
3
|
-
import { p as
|
|
3
|
+
import { p as F, b as Me, a as pe, h as _e, c as Ee, d as y } from "./index-2Mx6IUGl.js";
|
|
4
4
|
import { ElSelect as Te, ElOption as Ae, ElSwitch as Ye, ElTable as Ve, ElTableColumn as C, ElButton as te } from "element-plus";
|
|
5
5
|
import { ContextMenu as Be, ContextMenuItem as J, ContextMenuSeparator as Fe, ContextMenuGroup as We } from "@imengyu/vue3-context-menu";
|
|
6
6
|
import { saveAs as Ue } from "file-saver";
|
|
@@ -22,25 +22,25 @@ const Oe = { class: "nav" }, Re = { style: { height: "20px", width: "100%", disp
|
|
|
22
22
|
date: String
|
|
23
23
|
},
|
|
24
24
|
setup(ne) {
|
|
25
|
-
const S = ne, { t:
|
|
26
|
-
{ value: "Я", label:
|
|
27
|
-
{ value: "К", label:
|
|
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
|
-
]),
|
|
25
|
+
const S = ne, { t: i, d: Q } = Ne(), ee = p(!1), k = p([]), K = p("0"), w = p(new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1).setMonth((/* @__PURE__ */ new Date()).getMonth() + Number(K.value))), d = p([]), E = p(""), ue = p([{ value: "all", label: "Все", key: "all" }]), be = p([
|
|
26
|
+
{ value: "Я", label: i("sheet.valid.1") },
|
|
27
|
+
{ value: "К", label: i("sheet.valid.2") },
|
|
28
|
+
{ value: "ОТ", label: i("sheet.valid.3") },
|
|
29
|
+
{ value: "ДО", label: i("sheet.valid.4") },
|
|
30
|
+
{ value: "Р", label: i("sheet.valid.5") },
|
|
31
|
+
{ value: "ОЖ", label: i("sheet.valid.6") },
|
|
32
|
+
{ value: "Б", label: i("sheet.valid.7") },
|
|
33
|
+
{ value: "НН", label: i("sheet.valid.8") },
|
|
34
|
+
{ value: "ПР", label: i("sheet.valid.9") },
|
|
35
|
+
{ value: "У", label: i("sheet.valid.10") },
|
|
36
|
+
{ value: "УД", label: i("sheet.valid.11") },
|
|
37
|
+
{ value: "Г", label: i("sheet.valid.12") }
|
|
38
|
+
]), re = p([]), Ce = p(0), N = p(9), I = p(8), Y = p(0), L = p(0), z = p([]), P = p(!1), oe = p([]), G = p([]), W = p(!1), X = p(1), se = p({
|
|
39
39
|
zIndex: 3,
|
|
40
40
|
minWidth: 230,
|
|
41
41
|
x: 500,
|
|
42
42
|
y: 200
|
|
43
|
-
}), v = p({ name: "", length: 0, code: "" }),
|
|
43
|
+
}), v = p({ name: "", length: 0, code: "" }), _ = p([
|
|
44
44
|
// {code: '00ЗК-00336',
|
|
45
45
|
// days:[
|
|
46
46
|
// {
|
|
@@ -50,196 +50,196 @@ const Oe = { class: "nav" }, Re = { style: { height: "20px", width: "100%", disp
|
|
|
50
50
|
// }
|
|
51
51
|
// ]
|
|
52
52
|
// }
|
|
53
|
-
]), f =
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
const t = Array.from(
|
|
57
|
-
return [{ ...
|
|
53
|
+
]), f = fe(() => k.value.flatMap((l, e) => {
|
|
54
|
+
const r = _.value.find((a) => a.code === l.code), u = /* @__PURE__ */ new Map();
|
|
55
|
+
l.days.forEach((a) => u.set(a.day, { ...a })), r && r.days.forEach((a) => u.set(a.day, { ...a }));
|
|
56
|
+
const t = Array.from(u.values());
|
|
57
|
+
return [{ ...l, days: t, key: 0, ids: e, numberNonAppearing: [0, 0] }, { ...l, days: t, key: 1, ids: e, numberNonAppearing: [0, 0] }];
|
|
58
58
|
}));
|
|
59
|
-
q(E, async (
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}),
|
|
63
|
-
}), q(K, (
|
|
64
|
-
w.value = new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1).setMonth((/* @__PURE__ */ new Date()).getMonth() + Number(
|
|
59
|
+
q(E, async (l, e) => {
|
|
60
|
+
l !== e && (z.value = [], confirm.value = !1, S.odata.personal.forEach((r) => {
|
|
61
|
+
r.divisionName === l && (z.value.some((u) => (u == null ? void 0 : u.activeText) === r.roleName) || z.value.push({ val: !0, activeText: r.roleName }));
|
|
62
|
+
}), ge());
|
|
63
|
+
}), q(K, (l) => {
|
|
64
|
+
w.value = new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1).setMonth((/* @__PURE__ */ new Date()).getMonth() + Number(l)), he(), ge();
|
|
65
65
|
}), q(I, () => {
|
|
66
|
-
P.value =
|
|
66
|
+
P.value = W.value;
|
|
67
67
|
}), q(N, () => {
|
|
68
|
-
P.value =
|
|
68
|
+
P.value = W.value;
|
|
69
69
|
}), q(X, () => {
|
|
70
|
-
P.value =
|
|
70
|
+
P.value = W.value;
|
|
71
71
|
});
|
|
72
|
-
const
|
|
73
|
-
if (e.level !== 3 || e.labelClassName === "turn" || e.no === 15 || e.no >
|
|
74
|
-
v.value.ids =
|
|
75
|
-
const t = new Date(w.value),
|
|
76
|
-
v.value.id =
|
|
77
|
-
const h =
|
|
78
|
-
v.value.failure =
|
|
79
|
-
}, le = (
|
|
80
|
-
const e = new Date(w.value),
|
|
81
|
-
let
|
|
82
|
-
switch (
|
|
72
|
+
const we = (l, e, r, u) => {
|
|
73
|
+
if (e.level !== 3 || e.labelClassName === "turn" || e.no === 15 || e.no > d.value.length || !S.checkEdit) return "";
|
|
74
|
+
v.value.ids = l.ids, v.value.key = l.key, v.value.day = e.no < 15 ? e.no : e.no - 1;
|
|
75
|
+
const t = new Date(w.value), a = `${t.getFullYear()}-${(t.getMonth() + 1).toString().padStart(2, "0")}-${(v.value.day + 1).toString().padStart(2, "0")}`, o = _.value.findIndex((c) => c.code === l.code);
|
|
76
|
+
v.value.id = o !== -1 ? _.value[o].days.findIndex((c) => (c == null ? void 0 : c.day) === a) : o, v.value.rest = o !== -1 && v.value.id !== -1, N.value = typeof l.days[v.value.day].tips > "u" ? 9 : parseInt(l.days[v.value.day].tips.match(/(\d{1,2})/)), Y.value = typeof l.days[v.value.day].night > "u" ? 0 : parseInt(l.days[v.value.day].night), L.value = typeof l.days[v.value.day].overtime > "u" ? 0 : parseInt(l.days[v.value.day].overtime), I.value = l.days[v.value.day].time !== "-" ? parseInt(l.days[v.value.day].time + Y.value + L.value) : 8;
|
|
77
|
+
const h = l.days.findIndex((c) => c.day === a);
|
|
78
|
+
v.value.failure = l.days[h].state, se.value.y = u.clientY, se.value.x = u.clientX, v.value.name = i("sheet.choiceOfMode"), W.value = !0, P.value = !1;
|
|
79
|
+
}, le = (l) => {
|
|
80
|
+
const e = new Date(w.value), r = `${e.getFullYear()}-${(e.getMonth() + 1).toString().padStart(2, "0")}-${(v.value.day + 1).toString().padStart(2, "0")}`;
|
|
81
|
+
let u = _.value.findIndex((D) => D.code === k.value[v.value.ids].code), t = k.value[v.value.ids].days[v.value.day].state, a = l, o = "-", h, c, M;
|
|
82
|
+
switch (l) {
|
|
83
83
|
case "Я":
|
|
84
|
-
t === "В" && (
|
|
84
|
+
t === "В" && (a = "РВ"), o = 8;
|
|
85
85
|
break;
|
|
86
86
|
case "КВ":
|
|
87
87
|
case "К":
|
|
88
|
-
t === "В" || t === "КВ" ?
|
|
88
|
+
t === "В" || t === "КВ" ? a = "КВ" : a = "К";
|
|
89
89
|
break;
|
|
90
90
|
case "save":
|
|
91
|
-
let
|
|
92
|
-
if (
|
|
93
|
-
|
|
91
|
+
let D = ve.value.split('"');
|
|
92
|
+
if (a = D[1], P.value = !1, /^(|К|КВ|ОТ|Б|Р|ОЖ|НН|У|ДО|УД|Г)$/.test(D[1])) break;
|
|
93
|
+
o = I.value - Y.value - L.value, M = "(" + D[2].split("(")[1], h = Y.value, c = L.value;
|
|
94
94
|
}
|
|
95
|
-
|
|
95
|
+
l === "reset" ? (a = t, _.value[u].days.splice(v.value.id, 1)) : u === -1 ? _.value.push({ code: k.value[v.value.ids].code, days: [{ day: r, state: a, time: o, night: h, overtime: c, tips: M }] }) : v.value.id === -1 ? _.value[u].days.push({ day: r, state: a, time: o, night: h, overtime: c, tips: M }) : _.value[u].days[v.value.id] = { day: r, state: a, time: o, night: h, overtime: c, tips: M }, S.workSchedule.addWorkSheet({
|
|
96
96
|
group: E.value,
|
|
97
|
-
date:
|
|
97
|
+
date: F(new Date(w.value), "{Y}-{m}-{dd}"),
|
|
98
98
|
data: [{
|
|
99
|
-
name:
|
|
100
|
-
days:
|
|
101
|
-
code:
|
|
99
|
+
name: k.value[v.value.ids].fio,
|
|
100
|
+
days: _.value[u].days,
|
|
101
|
+
code: k.value[v.value.ids].code
|
|
102
102
|
}]
|
|
103
|
-
}), v.value.failure =
|
|
104
|
-
},
|
|
105
|
-
let
|
|
106
|
-
|
|
107
|
-
let t = typeof (
|
|
108
|
-
return '"' +
|
|
109
|
-
}),
|
|
110
|
-
if (
|
|
111
|
-
return f.value[
|
|
103
|
+
}), v.value.failure = a, X.value > 1 && (X.value--, v.value.day++, v.value.id = u !== -1 ? _.value[u].days.findIndex((D) => (D == null ? void 0 : D.day) === `${e.getFullYear()}-${(e.getMonth() + 1).toString().padStart(2, "0")}-${(v.value.day + 1).toString().padStart(2, "0")}`) : u, le(v.value.failure)), ce();
|
|
104
|
+
}, ve = fe(() => {
|
|
105
|
+
let l = k.value[v.value.ids].days[v.value.day], e = "", r = I.value >= 22 ? N.value + I.value + 2 : N.value + I.value + 1, u = v.value.failure.split("/")[0];
|
|
106
|
+
u = /^Н(?!Н$)С?$/.test(u) ? l.state !== "В" ? "Я" : "РВ" : u, (N.value < 6 || r > 22) && (e = "Н", Y.value = N.value < 6 ? Math.min(6, r) - N.value : 0, r <= 6 && (Y.value = I.value, u = ""), r === 7 && Y.value > 3 && Y.value--, Y.value += Math.max(22, r) - 22), I.value > l.time && u !== "РВ" && (e += "С", L.value = I.value - l.time), e.length > 0 && u.length > 0 && (e = "/" + e);
|
|
107
|
+
let t = typeof (l == null ? void 0 : l.tips) < "u" ? l.tips : `(${N.value}:00 - ${I.value >= 22 ? N.value + I.value + 2 : N.value + I.value + 1}:00)`, a = f.value[v.value.ids * 2].days[v.value.day].time !== "-" ? " " + I.value + " " + t : "";
|
|
108
|
+
return '"' + u + e + '"' + a;
|
|
109
|
+
}), De = (l) => {
|
|
110
|
+
if (l.columnIndex < 2 || l.columnIndex > d.value.length + 3 && l.columnIndex < d.value.length + 9 || l.columnIndex > d.value.length + 11)
|
|
111
|
+
return f.value[l.rowIndex].key === 0 ? {
|
|
112
112
|
rowspan: 2,
|
|
113
113
|
colspan: 1
|
|
114
114
|
} : {
|
|
115
115
|
rowspan: 0,
|
|
116
116
|
colspan: 0
|
|
117
117
|
};
|
|
118
|
-
},
|
|
119
|
-
const
|
|
120
|
-
let
|
|
121
|
-
for (let
|
|
122
|
-
const
|
|
123
|
-
t +=
|
|
124
|
-
let h =
|
|
125
|
-
|
|
118
|
+
}, he = () => {
|
|
119
|
+
const l = re.value, e = new Date(w.value), r = new Date(e.getFullYear(), e.getMonth() + 1, 0).getDate();
|
|
120
|
+
let u = [], t = 0;
|
|
121
|
+
for (let a = 1; a <= r; a++) {
|
|
122
|
+
const o = F(e.setDate(a), "{Y}-{m}-{dd}");
|
|
123
|
+
t += l.nowork.includes(o) || l.holidays.includes(o) ? 0 : l.preholidays.includes(o) ? 7 : 8;
|
|
124
|
+
let h = l.nowork.includes(o) ? "nowork" : l.holidays.includes(o) ? "holiday" : l.preholidays.includes(o) ? "preholiday" : "";
|
|
125
|
+
u.push({ day: a, holidays: h, weekday: Q(new Date(e.getFullYear(), e.getMonth(), a), "day") });
|
|
126
126
|
}
|
|
127
|
-
|
|
128
|
-
var
|
|
129
|
-
E.value = (
|
|
127
|
+
Ce.value = t, d.value = u, S.odata.getPersonal({}).then((a) => {
|
|
128
|
+
var o;
|
|
129
|
+
E.value.length === 0 && (E.value = (o = a.find((h) => h.employeeName === S.fullName)) == null ? void 0 : o.divisionName), a.forEach((h) => {
|
|
130
130
|
ue.value.some((c) => (c == null ? void 0 : c.value) === h.divisionName) || ue.value.push({ value: h.divisionName, label: h.divisionName, key: h.divisionName }), h.divisionName === E.value && !z.value.some((c) => (c == null ? void 0 : c.activeText) === h.roleName) && z.value.push({ val: !0, activeText: h.roleName });
|
|
131
131
|
});
|
|
132
132
|
});
|
|
133
|
-
},
|
|
134
|
-
|
|
135
|
-
if (
|
|
136
|
-
let e = Me(
|
|
137
|
-
G.value.push(
|
|
133
|
+
}, ge = () => {
|
|
134
|
+
k.value = [], G.value = [], oe.value = [], S.odata.personal.forEach((l) => {
|
|
135
|
+
if (l.divisionName === E.value && z.value.some((e) => e.val && e.activeText === l.roleName)) {
|
|
136
|
+
let e = Me(l.employeeName);
|
|
137
|
+
G.value.push(l.employeeKey), k.value.push({ fio: l.employeeName, name: e + " (" + l.roleName + ")", code: l.employeeKey, days: [], contHour: 0, id: !1, ids: k.value.length });
|
|
138
138
|
}
|
|
139
|
-
}), S.workSchedule.getUsersYear({ code: G.value, year: new Date(w.value).getFullYear() }).then((
|
|
140
|
-
|
|
139
|
+
}), S.workSchedule.getUsersYear({ code: G.value, year: new Date(w.value).getFullYear() }).then((l) => {
|
|
140
|
+
l.forEach((e) => {
|
|
141
141
|
e.dateStart && oe.value.push({ code: e.code, dateStart: e.dateStart, dateEnd: e.dateEnd });
|
|
142
|
-
}),
|
|
142
|
+
}), ke();
|
|
143
143
|
});
|
|
144
|
-
},
|
|
145
|
-
S.workSchedule.getWorkSheet({ code: G.value, date:
|
|
146
|
-
(
|
|
147
|
-
|
|
148
|
-
e !== null &&
|
|
149
|
-
})
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
144
|
+
}, ke = () => {
|
|
145
|
+
S.workSchedule.getWorkSheet({ code: G.value, date: F(new Date(w.value), "{Y}-{m}-{dd}") }).then(
|
|
146
|
+
(l) => {
|
|
147
|
+
_.value = [], l.forEach((e) => {
|
|
148
|
+
e !== null && _.value.push({ code: e.code, days: e.data.days });
|
|
149
|
+
}), S.workSchedule.getWorkSchedule({ code: G.value, date: F(new Date(w.value), "{Y}-{m}-{dd}") }).then(
|
|
150
|
+
(e) => {
|
|
151
|
+
e.forEach((r, u) => {
|
|
152
|
+
var t, a;
|
|
153
|
+
if (r !== null) {
|
|
154
|
+
k.value[u].days = [], r.data.days.forEach((o) => o.state = "Я");
|
|
155
|
+
for (let o = 1; o <= d.value.length; o++) {
|
|
156
|
+
let h = F(new Date(w.value).setDate(o), "{Y}-{m}-{dd}");
|
|
157
|
+
const c = (t = r.data) == null ? void 0 : t.days.findIndex((M) => M.day === h);
|
|
158
|
+
c === -1 ? ae(o, u, "-", "В") : k.value[u].days.push((a = r.data) == null ? void 0 : a.days[c]);
|
|
159
|
+
}
|
|
160
|
+
} else
|
|
161
|
+
for (let o = 1; o <= d.value.length; o++)
|
|
162
|
+
d.value[o - 1].holidays === "" ? ae(o, u, 8) : d.value[o - 1].holidays === "preholiday" ? ae(o, u, 7) : ae(o, u, "-", "В");
|
|
163
|
+
for (let o = 1; o <= d.value.length; o++) {
|
|
164
|
+
let h = new Date(new Date(w.value).getFullYear(), new Date(w.value).getMonth(), o).getTime() + 1e3;
|
|
165
|
+
for (let c of oe.value) {
|
|
166
|
+
const { dateStart: M, dateEnd: D, code: U } = c;
|
|
167
|
+
if (M && D && U === k.value[u].code) {
|
|
168
|
+
const H = new Date(pe(M)).getTime(), j = new Date(pe(D)).getTime();
|
|
169
|
+
if (h >= H && h <= j) {
|
|
170
|
+
const n = F(new Date(w.value).setDate(o), "{Y}-{m}-{dd}"), O = k.value[u].days.findIndex((de) => de.day === n);
|
|
171
|
+
O !== -1 ? k.value[u].days[O] = { day: n, time: "-", state: "ОТ" } : k.value[u].days.push({ day: n, time: "-", state: "ОТ" });
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
|
-
}
|
|
176
|
+
}), ce();
|
|
177
177
|
}
|
|
178
|
-
|
|
178
|
+
);
|
|
179
179
|
}
|
|
180
180
|
);
|
|
181
|
-
}, ae = (
|
|
182
|
-
const t =
|
|
183
|
-
|
|
181
|
+
}, ae = (l, e, r, u = "Я") => {
|
|
182
|
+
const t = F(new Date(w.value).setDate(l), "{Y}-{m}-{dd}");
|
|
183
|
+
k.value[e].days.push({
|
|
184
184
|
day: t,
|
|
185
|
-
time:
|
|
186
|
-
state:
|
|
185
|
+
time: r,
|
|
186
|
+
state: u
|
|
187
187
|
});
|
|
188
|
-
},
|
|
189
|
-
f.value.forEach((
|
|
190
|
-
|
|
188
|
+
}, ce = () => {
|
|
189
|
+
f.value.forEach((l) => {
|
|
190
|
+
l.hourI = 0, l.hourII = 0, l.halfII = 0, l.halfI = 0, l.weekend = 0, l.weekendDays = 0, l.overtime = 0, l.night = 0, l.appearing = {
|
|
191
191
|
code: "-",
|
|
192
192
|
count: "-"
|
|
193
193
|
};
|
|
194
194
|
const e = Object.entries(
|
|
195
|
-
|
|
196
|
-
if (
|
|
197
|
-
const h =
|
|
198
|
-
|
|
195
|
+
l.days.reduce((a, o) => {
|
|
196
|
+
if (o.hasOwnProperty("state") && /^(|К|КВ|ОТ|Б|Р|ПР|ОЖ|НН|У|ДО|УД|Г)$/.test(o.state)) {
|
|
197
|
+
const h = o.state;
|
|
198
|
+
a[h] = (a[h] || 0) + 1;
|
|
199
199
|
}
|
|
200
|
-
return
|
|
200
|
+
return a;
|
|
201
201
|
}, {})
|
|
202
|
-
).map(([
|
|
203
|
-
|
|
204
|
-
const
|
|
205
|
-
|
|
206
|
-
code:
|
|
207
|
-
count:
|
|
208
|
-
}),
|
|
209
|
-
code: t.map((
|
|
210
|
-
count: t.map((
|
|
202
|
+
).map(([a, o]) => ({ code: a, count: o }));
|
|
203
|
+
l.numberNonAppearing = [e.reduce((a, o) => a + o.count, 0), 0];
|
|
204
|
+
const r = Math.ceil(e.length / 2), u = e.slice(0, r), t = e.slice(r);
|
|
205
|
+
l.key === 0 && u.length > 0 && (l.appearing = {
|
|
206
|
+
code: u.map((a) => a.code).join("/"),
|
|
207
|
+
count: u.map((a) => a.count).join("/")
|
|
208
|
+
}), l.key === 1 && t.length > 0 && (l.appearing = {
|
|
209
|
+
code: t.map((a) => a.code).join("/"),
|
|
210
|
+
count: t.map((a) => a.count).join("/")
|
|
211
211
|
});
|
|
212
|
-
for (let
|
|
213
|
-
|
|
214
|
-
|
|
212
|
+
for (let a = 0; a < l.days.length; a++)
|
|
213
|
+
a < 15 && l.days[a].time !== "-" && (l.hourI += Number(l.days[a].time), l.days[a].night && (l.hourI += Number(l.days[a].night)), l.days[a].overtime && (l.hourI += Number(l.days[a].overtime)), l.halfI++), a >= 15 && l.days[a].time !== "-" && (l.days[a].night && (l.hourII += Number(l.days[a].night)), l.days[a].overtime && (l.hourII += Number(l.days[a].overtime)), l.hourII += Number(l.days[a].time), l.halfII++), l.days[a].night && (l.night += Number(l.days[a].night)), l.days[a].overtime && (l.overtime += Number(l.days[a].overtime)), /{|РВ|}/.test(l.days[a].state) && (l.weekend += Number(l.days[a].time)), l.days[a].state === "В" && l.weekendDays++;
|
|
214
|
+
l.contDays = l.halfI + l.halfII, l.contHour = l.hourI + l.hourII;
|
|
215
215
|
});
|
|
216
|
-
},
|
|
217
|
-
var h, c,
|
|
216
|
+
}, me = (l, e) => {
|
|
217
|
+
var h, c, M, D, U, H;
|
|
218
218
|
if (e === -1) return "";
|
|
219
|
-
const
|
|
220
|
-
let
|
|
221
|
-
return (h =
|
|
219
|
+
const r = f.value[e], u = new Date(w.value), t = `${u.getFullYear()}-${(u.getMonth() + 1).toString().padStart(2, "0")}-${l.toString().padStart(2, "0")}`, a = r.days.findIndex((j) => j.day === t);
|
|
220
|
+
let o = 0;
|
|
221
|
+
return (h = r.days[a]) != null && h.night && (o += r.days[a].night), (c = r.days[a]) != null && c.overtime && (o += r.days[a].overtime), a === -1 ? "" : r.key === 0 ? (M = r.days[a]) == null ? void 0 : M.state : ((D = r.days[a]) == null ? void 0 : D.time) === 0 ? o === 0 ? "-" : o : o === 0 ? (U = r.days[a]) == null ? void 0 : U.time : `${(H = r.days[a]) == null ? void 0 : H.time}/${o}`;
|
|
222
222
|
};
|
|
223
|
-
S.group && (E.value = S.group), S.date && (K.value = (/* @__PURE__ */ new Date(S.date + "T00:00:01")).getMonth()), _e().then((
|
|
224
|
-
|
|
223
|
+
S.group && (E.value = S.group), S.date && (K.value = (/* @__PURE__ */ new Date(S.date + "T00:00:01")).getMonth()), _e().then((l) => {
|
|
224
|
+
re.value = l, he();
|
|
225
225
|
});
|
|
226
|
-
const
|
|
227
|
-
var
|
|
226
|
+
const ye = (l) => new Date(w.value).getMonth() === (/* @__PURE__ */ new Date()).getMonth() && l === (/* @__PURE__ */ new Date()).getDate() ? " today" : "", $e = async () => {
|
|
227
|
+
var D, U, H, j;
|
|
228
228
|
ee.value = !0;
|
|
229
|
-
const
|
|
230
|
-
e.mergeCells(`A1:${y("A1",
|
|
231
|
-
for (let n = 1; n <=
|
|
232
|
-
e.mergeCells(`${y("D3", n)}3:${y("D4", n)}4`), e.getColumn(n + 3).width = 5, e.getColumn(n + 3).alignment = t, e.getCell(3, n + 3).border =
|
|
233
|
-
e.getCell("A1").value =
|
|
229
|
+
const l = new He.Workbook(), e = l.addWorksheet(Q(w.value, "month"), { pageSetup: { paperSize: 9, orientation: "landscape", fitToPage: !0 } }), r = { vertical: "middle", horizontal: "center" }, u = { top: { style: "thin" }, left: { style: "thin" }, bottom: { style: "thin" }, right: { style: "thin" } }, t = { vertical: "middle", horizontal: "center", wrapText: !0 };
|
|
230
|
+
e.mergeCells(`A1:${y("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:${y("D2", d.value.length + 2)}2`), e.mergeCells(`${y("D2", d.value.length + 3)}2:${y("D2", d.value.length + 8)}2`), e.mergeCells(`${y("D2", d.value.length + 9)}2:${y("D2", d.value.length + 9)}4`), e.mergeCells(`${y("D2", d.value.length + 10)}2:${y("D2", d.value.length + 11)}2`), e.mergeCells(`${y("D2", d.value.length + 12)}2:${y("D2", d.value.length + 12)}4`), e.mergeCells(`${y("D3", d.value.length + 3)}3:${y("D3", d.value.length + 3)}4`), e.mergeCells(`${y("D3", d.value.length + 4)}3:${y("D3", d.value.length + 8)}3`), e.mergeCells(`${y("D3", d.value.length + 10)}3:${y("D3", d.value.length + 10)}4`), e.mergeCells(`${y("D3", d.value.length + 11)}3:${y("D3", d.value.length + 11)}4`), e.mergeCells(`T5:${y("D5", d.value.length + 1)}5`);
|
|
231
|
+
for (let n = 1; n <= d.value.length + 2; n++)
|
|
232
|
+
e.mergeCells(`${y("D3", n)}3:${y("D4", n)}4`), e.getColumn(n + 3).width = 5, e.getColumn(n + 3).alignment = t, e.getCell(3, n + 3).border = u, n < 16 && (e.getCell(3, n + 3).value = n), n > 16 && (e.getCell(3, n + 3).value = n - 1);
|
|
233
|
+
e.getCell("A1").value = i("sheet.title", { name: E.value }) + Q(w.value, "month"), e.getCell("A2").value = i("sheet.listNumber"), e.getCell("B2").value = i("sheet.employee"), e.getCell("C2").value = i("sheet.personnelNumber"), e.getCell("D2").value = i("sheet.marks"), e.getCell("S3").value = i("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 = i("sheet.workedMonth"), e.getCell(2, d.value.length + 12).value = i("sheet.numberNonAppearing"), e.getCell(2, d.value.length + 13).value = i("sheet.them"), e.getCell(2, d.value.length + 15).value = i("sheet.countWeekend"), e.getCell(3, d.value.length + 5).value = i("sheet.halfMonth", { half: "II" }), e.getCell(3, d.value.length + 6).value = i("sheet.days"), e.getCell(3, d.value.length + 7).value = i("sheet.hours"), e.getCell(4, d.value.length + 7).value = i("sheet.all"), e.getCell(4, d.value.length + 8).value = i("sheet.overtime"), e.getCell(4, d.value.length + 9).value = i("sheet.night"), e.getCell(4, d.value.length + 10).value = i("sheet.weekend"), e.getCell(4, d.value.length + 13).value = i("sheet.code"), e.getCell(4, d.value.length + 14).value = i("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 = r, e.getColumn(1).alignment = t, e.getColumn(2).alignment = t, e.getColumn(3).alignment = t;
|
|
234
234
|
for (let n = 6; n <= 15; n++)
|
|
235
|
-
e.getCell(5,
|
|
236
|
-
e.getCell("A2").border =
|
|
237
|
-
let
|
|
235
|
+
e.getCell(5, d.value.length + n).value = n + 2, e.getColumn(d.value.length + n).alignment = t, e.getCell(4, d.value.length + n).border = u, e.getCell(5, d.value.length + n).border = u;
|
|
236
|
+
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;
|
|
237
|
+
let a = 1, o = 5, h = !0;
|
|
238
238
|
for (const n of f.value) {
|
|
239
|
-
let
|
|
240
|
-
for (let T = 0; T <
|
|
241
|
-
T === 15 &&
|
|
242
|
-
|
|
239
|
+
let O = [a, n.name, n.code];
|
|
240
|
+
for (let T = 0; T < d.value.length; T++)
|
|
241
|
+
T === 15 && O.push(h ? (n == null ? void 0 : n.halfI) || "" : (n == null ? void 0 : n.hourI) || ""), O.push(h ? ((D = n.days[T]) == null ? void 0 : D.state) || "" : ((U = n.days[T]) == null ? void 0 : U.time) || "");
|
|
242
|
+
O.push(
|
|
243
243
|
h ? (n == null ? void 0 : n.halfII) || 0 : (n == null ? void 0 : n.hourII) || 0,
|
|
244
244
|
(n == null ? void 0 : n.contDays) || 0,
|
|
245
245
|
(n == null ? void 0 : n.contHour) || 0,
|
|
@@ -248,30 +248,30 @@ const Oe = { class: "nav" }, Re = { style: { height: "20px", width: "100%", disp
|
|
|
248
248
|
(n == null ? void 0 : n.weekend) || 0,
|
|
249
249
|
"",
|
|
250
250
|
h ? (n == null ? void 0 : n.numberNonAppearing[0]) || "" : (n == null ? void 0 : n.numberNonAppearing[1]) || 0,
|
|
251
|
-
((
|
|
252
|
-
((
|
|
251
|
+
((H = n == null ? void 0 : n.appearing) == null ? void 0 : H.code) || "-",
|
|
252
|
+
((j = n == null ? void 0 : n.appearing) == null ? void 0 : j.count) || "-",
|
|
253
253
|
(n == null ? void 0 : n.weekendDays) || 0
|
|
254
254
|
);
|
|
255
|
-
const
|
|
256
|
-
if (
|
|
257
|
-
e.mergeCells(`A${
|
|
258
|
-
for (let T =
|
|
259
|
-
e.mergeCells(`${y("D", T)}${
|
|
260
|
-
e.mergeCells(`${y("D",
|
|
255
|
+
const de = e.addRow(O);
|
|
256
|
+
if (de.border = u, !h) {
|
|
257
|
+
e.mergeCells(`A${o + a * 2 - 1}:A${o + a * 2}`), e.mergeCells(`B${o + a * 2 - 1}:B${o + a * 2}`), e.mergeCells(`C${o + a * 2 - 1}:C${o + a * 2}`);
|
|
258
|
+
for (let T = d.value.length + 3; T <= d.value.length + 8; T++)
|
|
259
|
+
e.mergeCells(`${y("D", T)}${o + a * 2 - 1}:${y("D", T)}${o + a * 2}`);
|
|
260
|
+
e.mergeCells(`${y("D", d.value.length + 12)}${o + a * 2 - 1}:${y("D", d.value.length + 12)}${o + a * 2}`), a++;
|
|
261
261
|
}
|
|
262
262
|
h = !h;
|
|
263
263
|
}
|
|
264
264
|
S.odata.personal.forEach((n) => {
|
|
265
265
|
n.roleName === "Начальник отдела правовой и кадровой работы" && n.employeeName;
|
|
266
266
|
});
|
|
267
|
-
const c = "export_" +
|
|
268
|
-
Ue(new Blob([
|
|
267
|
+
const c = "export_" + F(Date.now(), "{dd}.{m}.{Y}") + ".xlsx", M = await l.xlsx.writeBuffer();
|
|
268
|
+
Ue(new Blob([M]), c), ee.value = !1;
|
|
269
269
|
};
|
|
270
|
-
return (
|
|
271
|
-
const
|
|
270
|
+
return (l, e) => {
|
|
271
|
+
const r = xe("el-slider"), u = Ie("loading");
|
|
272
272
|
return $(), R(Z, null, [
|
|
273
273
|
V("div", Oe, [
|
|
274
|
-
ne.checkEdit ? ($(), A(
|
|
274
|
+
ne.checkEdit ? ($(), A(s(Te), {
|
|
275
275
|
key: 0,
|
|
276
276
|
modelValue: E.value,
|
|
277
277
|
"onUpdate:modelValue": e[0] || (e[0] = (t) => E.value = t),
|
|
@@ -279,7 +279,7 @@ const Oe = { class: "nav" }, Re = { style: { height: "20px", width: "100%", disp
|
|
|
279
279
|
style: { width: "240px", "margin-bottom": ".5rem", "margin-right": ".5rem" }
|
|
280
280
|
}, {
|
|
281
281
|
default: g(() => [
|
|
282
|
-
($(!0), R(Z, null,
|
|
282
|
+
($(!0), R(Z, null, ie(ue.value, (t) => ($(), A(s(Ae), {
|
|
283
283
|
key: t.value,
|
|
284
284
|
label: t.label,
|
|
285
285
|
value: t.value
|
|
@@ -288,36 +288,36 @@ const Oe = { class: "nav" }, Re = { style: { height: "20px", width: "100%", disp
|
|
|
288
288
|
_: 1
|
|
289
289
|
}, 8, ["modelValue"])) : B("", !0),
|
|
290
290
|
e[9] || (e[9] = V("div", { class: "expander" }, null, -1)),
|
|
291
|
-
ne.checkEdit ? ($(), A(
|
|
291
|
+
ne.checkEdit ? ($(), A(s(Ye), {
|
|
292
292
|
key: 1,
|
|
293
293
|
modelValue: K.value,
|
|
294
294
|
"onUpdate:modelValue": e[1] || (e[1] = (t) => K.value = t),
|
|
295
|
-
"active-text":
|
|
295
|
+
"active-text": s(i)("workSchedule.currentMonth"),
|
|
296
296
|
"active-value": "0",
|
|
297
297
|
"inactive-value": "-1",
|
|
298
298
|
style: { "margin-bottom": ".5rem", "margin-left": ".5rem" }
|
|
299
299
|
}, null, 8, ["modelValue", "active-text"])) : B("", !0)
|
|
300
300
|
]),
|
|
301
|
-
m(
|
|
301
|
+
m(s(Ve), {
|
|
302
302
|
id: "printTable",
|
|
303
303
|
data: f.value,
|
|
304
|
-
"span-method":
|
|
304
|
+
"span-method": De,
|
|
305
305
|
border: "",
|
|
306
306
|
style: { width: "100%" },
|
|
307
307
|
size: "small",
|
|
308
|
-
"empty-text":
|
|
308
|
+
"empty-text": s(i)("sheet.emptyText"),
|
|
309
309
|
align: "center",
|
|
310
|
-
onCellClick:
|
|
310
|
+
onCellClick: we
|
|
311
311
|
}, {
|
|
312
312
|
default: g(() => [
|
|
313
|
-
m(
|
|
314
|
-
label:
|
|
313
|
+
m(s(C), {
|
|
314
|
+
label: s(i)("sheet.title", { name: E.value }) + s(Q)(w.value, "month"),
|
|
315
315
|
align: "center",
|
|
316
316
|
height: "10"
|
|
317
317
|
}, {
|
|
318
318
|
default: g(() => [
|
|
319
|
-
m(
|
|
320
|
-
label:
|
|
319
|
+
m(s(C), {
|
|
320
|
+
label: s(i)("sheet.employee"),
|
|
321
321
|
width: "180",
|
|
322
322
|
align: "center"
|
|
323
323
|
}, {
|
|
@@ -326,8 +326,8 @@ const Oe = { class: "nav" }, Re = { style: { height: "20px", width: "100%", disp
|
|
|
326
326
|
]),
|
|
327
327
|
_: 1
|
|
328
328
|
}, 8, ["label"]),
|
|
329
|
-
m(
|
|
330
|
-
label:
|
|
329
|
+
m(s(C), {
|
|
330
|
+
label: s(i)("sheet.personnelNumber"),
|
|
331
331
|
align: "center"
|
|
332
332
|
}, {
|
|
333
333
|
default: g((t) => [
|
|
@@ -335,53 +335,53 @@ const Oe = { class: "nav" }, Re = { style: { height: "20px", width: "100%", disp
|
|
|
335
335
|
]),
|
|
336
336
|
_: 1
|
|
337
337
|
}, 8, ["label"]),
|
|
338
|
-
m(
|
|
339
|
-
label:
|
|
338
|
+
m(s(C), {
|
|
339
|
+
label: s(i)("sheet.marks"),
|
|
340
340
|
align: "center"
|
|
341
341
|
}, {
|
|
342
342
|
default: g(() => [
|
|
343
|
-
($(!0), R(Z, null,
|
|
343
|
+
($(!0), R(Z, null, ie(d.value, (t) => ($(), R(Z, {
|
|
344
344
|
key: t.day
|
|
345
345
|
}, [
|
|
346
|
-
t.day <= 15 ? ($(), A(
|
|
346
|
+
t.day <= 15 ? ($(), A(s(C), {
|
|
347
347
|
key: 0,
|
|
348
348
|
width: "30",
|
|
349
|
-
"class-name": t.holidays +
|
|
349
|
+
"class-name": t.holidays + ye(t.day),
|
|
350
350
|
align: "center",
|
|
351
351
|
label: t.day.toString() + `
|
|
352
352
|
` + t.weekday
|
|
353
353
|
}, {
|
|
354
|
-
default: g((
|
|
355
|
-
V("div", Re, b(
|
|
354
|
+
default: g((a) => [
|
|
355
|
+
V("div", Re, b(me(t.day, a.$index) || " "), 1)
|
|
356
356
|
]),
|
|
357
357
|
_: 2
|
|
358
358
|
}, 1032, ["class-name", "label"])) : B("", !0),
|
|
359
|
-
t.day === 15 ? ($(), A(
|
|
359
|
+
t.day === 15 ? ($(), A(s(C), {
|
|
360
360
|
key: 1,
|
|
361
|
-
label:
|
|
361
|
+
label: s(i)("sheet.halfMonth", { half: "I" }),
|
|
362
362
|
align: "center"
|
|
363
363
|
}, {
|
|
364
|
-
default: g((
|
|
365
|
-
x(b(f.value[
|
|
364
|
+
default: g((a) => [
|
|
365
|
+
x(b(f.value[a.$index].key === 0 ? f.value[a.$index].halfI : f.value[a.$index].hourI), 1)
|
|
366
366
|
]),
|
|
367
367
|
_: 1
|
|
368
368
|
}, 8, ["label"])) : B("", !0),
|
|
369
|
-
t.day > 15 ? ($(), A(
|
|
369
|
+
t.day > 15 ? ($(), A(s(C), {
|
|
370
370
|
key: 2,
|
|
371
371
|
width: "30",
|
|
372
|
-
"class-name": t.holidays +
|
|
372
|
+
"class-name": t.holidays + ye(t.day),
|
|
373
373
|
align: "center",
|
|
374
374
|
label: t.day.toString() + `
|
|
375
375
|
` + t.weekday
|
|
376
376
|
}, {
|
|
377
|
-
default: g((
|
|
378
|
-
V("div", ze, b(
|
|
377
|
+
default: g((a) => [
|
|
378
|
+
V("div", ze, b(me(t.day, a.$index) || " "), 1)
|
|
379
379
|
]),
|
|
380
380
|
_: 2
|
|
381
381
|
}, 1032, ["class-name", "label"])) : B("", !0)
|
|
382
382
|
], 64))), 128)),
|
|
383
|
-
m(
|
|
384
|
-
label:
|
|
383
|
+
m(s(C), {
|
|
384
|
+
label: s(i)("sheet.halfMonth", { half: "II" }),
|
|
385
385
|
align: "center"
|
|
386
386
|
}, {
|
|
387
387
|
default: g((t) => [
|
|
@@ -392,13 +392,13 @@ const Oe = { class: "nav" }, Re = { style: { height: "20px", width: "100%", disp
|
|
|
392
392
|
]),
|
|
393
393
|
_: 1
|
|
394
394
|
}, 8, ["label"]),
|
|
395
|
-
m(
|
|
396
|
-
label:
|
|
395
|
+
m(s(C), {
|
|
396
|
+
label: s(i)("sheet.workedMonth"),
|
|
397
397
|
align: "center"
|
|
398
398
|
}, {
|
|
399
399
|
default: g(() => [
|
|
400
|
-
m(
|
|
401
|
-
label:
|
|
400
|
+
m(s(C), {
|
|
401
|
+
label: s(i)("sheet.days"),
|
|
402
402
|
align: "center",
|
|
403
403
|
"label-class-name": "turn",
|
|
404
404
|
width: "34"
|
|
@@ -408,13 +408,13 @@ const Oe = { class: "nav" }, Re = { style: { height: "20px", width: "100%", disp
|
|
|
408
408
|
]),
|
|
409
409
|
_: 1
|
|
410
410
|
}, 8, ["label"]),
|
|
411
|
-
m(
|
|
412
|
-
label:
|
|
411
|
+
m(s(C), {
|
|
412
|
+
label: s(i)("sheet.hours"),
|
|
413
413
|
align: "center"
|
|
414
414
|
}, {
|
|
415
415
|
default: g(() => [
|
|
416
|
-
m(
|
|
417
|
-
label:
|
|
416
|
+
m(s(C), {
|
|
417
|
+
label: s(i)("sheet.all"),
|
|
418
418
|
align: "center",
|
|
419
419
|
"label-class-name": "turn",
|
|
420
420
|
width: "40"
|
|
@@ -424,8 +424,8 @@ const Oe = { class: "nav" }, Re = { style: { height: "20px", width: "100%", disp
|
|
|
424
424
|
]),
|
|
425
425
|
_: 1
|
|
426
426
|
}, 8, ["label"]),
|
|
427
|
-
m(
|
|
428
|
-
label:
|
|
427
|
+
m(s(C), {
|
|
428
|
+
label: s(i)("sheet.overtime"),
|
|
429
429
|
align: "center",
|
|
430
430
|
"label-class-name": "turn",
|
|
431
431
|
width: "34"
|
|
@@ -435,8 +435,8 @@ const Oe = { class: "nav" }, Re = { style: { height: "20px", width: "100%", disp
|
|
|
435
435
|
]),
|
|
436
436
|
_: 1
|
|
437
437
|
}, 8, ["label"]),
|
|
438
|
-
m(
|
|
439
|
-
label:
|
|
438
|
+
m(s(C), {
|
|
439
|
+
label: s(i)("sheet.night"),
|
|
440
440
|
align: "center",
|
|
441
441
|
"label-class-name": "turn",
|
|
442
442
|
width: "34"
|
|
@@ -446,8 +446,8 @@ const Oe = { class: "nav" }, Re = { style: { height: "20px", width: "100%", disp
|
|
|
446
446
|
]),
|
|
447
447
|
_: 1
|
|
448
448
|
}, 8, ["label"]),
|
|
449
|
-
m(
|
|
450
|
-
label:
|
|
449
|
+
m(s(C), {
|
|
450
|
+
label: s(i)("sheet.weekend"),
|
|
451
451
|
align: "center",
|
|
452
452
|
"label-class-name": "turn",
|
|
453
453
|
width: "34"
|
|
@@ -463,47 +463,47 @@ const Oe = { class: "nav" }, Re = { style: { height: "20px", width: "100%", disp
|
|
|
463
463
|
]),
|
|
464
464
|
_: 1
|
|
465
465
|
}, 8, ["label"]),
|
|
466
|
-
m(
|
|
467
|
-
label:
|
|
466
|
+
m(s(C), {
|
|
467
|
+
label: s(i)("sheet.numberNonAppearing"),
|
|
468
468
|
align: "center"
|
|
469
469
|
}, {
|
|
470
470
|
default: g((t) => {
|
|
471
|
-
var
|
|
471
|
+
var a;
|
|
472
472
|
return [
|
|
473
|
-
x(b((
|
|
473
|
+
x(b((a = f.value[t.$index]) == null ? void 0 : a.numberNonAppearing[f.value[t.$index].key]), 1)
|
|
474
474
|
];
|
|
475
475
|
}),
|
|
476
476
|
_: 1
|
|
477
477
|
}, 8, ["label"]),
|
|
478
|
-
m(
|
|
479
|
-
label:
|
|
478
|
+
m(s(C), {
|
|
479
|
+
label: s(i)("sheet.them"),
|
|
480
480
|
align: "center"
|
|
481
481
|
}, {
|
|
482
482
|
default: g(() => [
|
|
483
|
-
m(
|
|
484
|
-
label:
|
|
483
|
+
m(s(C), {
|
|
484
|
+
label: s(i)("sheet.code"),
|
|
485
485
|
align: "center",
|
|
486
486
|
"label-class-name": "turn",
|
|
487
487
|
width: "30"
|
|
488
488
|
}, {
|
|
489
489
|
default: g((t) => {
|
|
490
|
-
var
|
|
490
|
+
var a;
|
|
491
491
|
return [
|
|
492
|
-
x(b((
|
|
492
|
+
x(b((a = f.value[t.$index].appearing) == null ? void 0 : a.code), 1)
|
|
493
493
|
];
|
|
494
494
|
}),
|
|
495
495
|
_: 1
|
|
496
496
|
}, 8, ["label"]),
|
|
497
|
-
m(
|
|
498
|
-
label:
|
|
497
|
+
m(s(C), {
|
|
498
|
+
label: s(i)("sheet.count"),
|
|
499
499
|
align: "center",
|
|
500
500
|
"label-class-name": "turn",
|
|
501
501
|
width: "30"
|
|
502
502
|
}, {
|
|
503
503
|
default: g((t) => {
|
|
504
|
-
var
|
|
504
|
+
var a;
|
|
505
505
|
return [
|
|
506
|
-
x(b((
|
|
506
|
+
x(b((a = f.value[t.$index].appearing) == null ? void 0 : a.count), 1)
|
|
507
507
|
];
|
|
508
508
|
}),
|
|
509
509
|
_: 1
|
|
@@ -511,8 +511,8 @@ const Oe = { class: "nav" }, Re = { style: { height: "20px", width: "100%", disp
|
|
|
511
511
|
]),
|
|
512
512
|
_: 1
|
|
513
513
|
}, 8, ["label"]),
|
|
514
|
-
m(
|
|
515
|
-
label:
|
|
514
|
+
m(s(C), {
|
|
515
|
+
label: s(i)("sheet.countWeekend"),
|
|
516
516
|
align: "center"
|
|
517
517
|
}, {
|
|
518
518
|
default: g((t) => [
|
|
@@ -526,41 +526,41 @@ const Oe = { class: "nav" }, Re = { style: { height: "20px", width: "100%", disp
|
|
|
526
526
|
]),
|
|
527
527
|
_: 1
|
|
528
528
|
}, 8, ["data", "empty-text"]),
|
|
529
|
-
Se(($(), A(
|
|
529
|
+
Se(($(), A(s(te), {
|
|
530
530
|
disabled: ee.value,
|
|
531
531
|
plain: "",
|
|
532
|
-
onClick:
|
|
532
|
+
onClick: $e,
|
|
533
533
|
style: { "margin-top": ".5rem" }
|
|
534
534
|
}, {
|
|
535
535
|
default: g(() => [
|
|
536
|
-
x(b(
|
|
536
|
+
x(b(s(i)("workSchedule.exportExcel")), 1)
|
|
537
537
|
]),
|
|
538
538
|
_: 1
|
|
539
539
|
}, 8, ["disabled"])), [
|
|
540
|
-
[
|
|
540
|
+
[u, ee.value]
|
|
541
541
|
]),
|
|
542
|
-
m(
|
|
543
|
-
show:
|
|
544
|
-
"onUpdate:show": e[8] || (e[8] = (t) =>
|
|
542
|
+
m(s(Be), {
|
|
543
|
+
show: W.value,
|
|
544
|
+
"onUpdate:show": e[8] || (e[8] = (t) => W.value = t),
|
|
545
545
|
options: se.value
|
|
546
546
|
}, {
|
|
547
547
|
default: g(() => [
|
|
548
|
-
m(
|
|
548
|
+
m(s(J), {
|
|
549
549
|
label: v.value.name,
|
|
550
550
|
disabled: ""
|
|
551
551
|
}, null, 8, ["label"]),
|
|
552
|
-
m(
|
|
552
|
+
m(s(Fe)),
|
|
553
553
|
V("div", null, [
|
|
554
554
|
V("div", null, [
|
|
555
|
-
m(
|
|
556
|
-
label:
|
|
555
|
+
m(s(We), {
|
|
556
|
+
label: ve.value,
|
|
557
557
|
style: { padding: "0 0 .5rem" }
|
|
558
558
|
}, {
|
|
559
559
|
default: g(() => [
|
|
560
|
-
($(!0), R(Z, null,
|
|
560
|
+
($(!0), R(Z, null, ie(be.value, (t) => ($(), A(s(J), {
|
|
561
561
|
key: t.value,
|
|
562
562
|
label: t.label,
|
|
563
|
-
onClick: (
|
|
563
|
+
onClick: (a) => le(t.value),
|
|
564
564
|
clickClose: !1
|
|
565
565
|
}, null, 8, ["label", "onClick"]))), 128))
|
|
566
566
|
]),
|
|
@@ -568,13 +568,13 @@ const Oe = { class: "nav" }, Re = { style: { height: "20px", width: "100%", disp
|
|
|
568
568
|
}, 8, ["label"])
|
|
569
569
|
]),
|
|
570
570
|
/^(РВ|Я|Н(?![Н])).*$/.test(v.value.failure) ? ($(), R("div", Pe, [
|
|
571
|
-
m(
|
|
571
|
+
m(s(J), { clickClose: !1 }, {
|
|
572
572
|
default: g(() => [
|
|
573
|
-
V("span", null, b(
|
|
573
|
+
V("span", null, b(s(i)("workSchedule.with")) + ":", 1)
|
|
574
574
|
]),
|
|
575
575
|
_: 1
|
|
576
576
|
}),
|
|
577
|
-
m(
|
|
577
|
+
m(r, {
|
|
578
578
|
modelValue: N.value,
|
|
579
579
|
"onUpdate:modelValue": e[2] || (e[2] = (t) => N.value = t),
|
|
580
580
|
step: 1,
|
|
@@ -582,61 +582,61 @@ const Oe = { class: "nav" }, Re = { style: { height: "20px", width: "100%", disp
|
|
|
582
582
|
max: 19,
|
|
583
583
|
style: { width: "100%" }
|
|
584
584
|
}, null, 8, ["modelValue"]),
|
|
585
|
-
m(
|
|
585
|
+
m(s(J), { clickClose: !1 }, {
|
|
586
586
|
default: g(() => [
|
|
587
|
-
V("span", null, b(
|
|
587
|
+
V("span", null, b(s(i)("workSchedule.duration")) + ":", 1)
|
|
588
588
|
]),
|
|
589
589
|
_: 1
|
|
590
590
|
}),
|
|
591
|
-
m(
|
|
591
|
+
m(r, {
|
|
592
592
|
modelValue: I.value,
|
|
593
593
|
"onUpdate:modelValue": e[3] || (e[3] = (t) => I.value = t),
|
|
594
594
|
step: 1,
|
|
595
595
|
min: 4,
|
|
596
|
-
max:
|
|
596
|
+
max: s(Ee)(N.value !== 1 ? 23 - N.value : 21, 4, 22)
|
|
597
597
|
}, null, 8, ["modelValue", "max"])
|
|
598
598
|
])) : B("", !0),
|
|
599
599
|
/^(|К|КВ|ОТ|Б|Р|ОЖ|У|ДО|УД|Г)$/.test(v.value.failure) ? ($(), R("div", je, [
|
|
600
|
-
m(
|
|
600
|
+
m(s(J), { clickClose: !1 }, {
|
|
601
601
|
default: g(() => [
|
|
602
|
-
V("span", null, b(
|
|
602
|
+
V("span", null, b(s(i)("sheet.count")) + ":", 1)
|
|
603
603
|
]),
|
|
604
604
|
_: 1
|
|
605
605
|
}),
|
|
606
|
-
m(
|
|
606
|
+
m(r, {
|
|
607
607
|
modelValue: X.value,
|
|
608
608
|
"onUpdate:modelValue": e[4] || (e[4] = (t) => X.value = t),
|
|
609
609
|
step: 1,
|
|
610
610
|
min: 1,
|
|
611
|
-
max:
|
|
611
|
+
max: d.value.length - v.value.day,
|
|
612
612
|
style: { width: "100%" }
|
|
613
613
|
}, null, 8, ["modelValue", "max"])
|
|
614
614
|
])) : B("", !0),
|
|
615
|
-
m(
|
|
615
|
+
m(s(J), null, {
|
|
616
616
|
default: g(() => [
|
|
617
|
-
v.value.rest ? ($(), A(
|
|
617
|
+
v.value.rest ? ($(), A(s(te), {
|
|
618
618
|
key: 0,
|
|
619
619
|
onClick: e[5] || (e[5] = (t) => le("reset"))
|
|
620
620
|
}, {
|
|
621
621
|
default: g(() => [
|
|
622
|
-
x(b(
|
|
622
|
+
x(b(s(i)("sheet.reset")), 1)
|
|
623
623
|
]),
|
|
624
624
|
_: 1
|
|
625
625
|
})) : B("", !0),
|
|
626
|
-
P.value ? ($(), A(
|
|
626
|
+
P.value ? ($(), A(s(te), {
|
|
627
627
|
key: 1,
|
|
628
628
|
onClick: e[6] || (e[6] = (t) => le("save"))
|
|
629
629
|
}, {
|
|
630
630
|
default: g(() => [
|
|
631
|
-
x(b(
|
|
631
|
+
x(b(s(i)("sheet.save")), 1)
|
|
632
632
|
]),
|
|
633
633
|
_: 1
|
|
634
634
|
})) : B("", !0),
|
|
635
|
-
m(
|
|
636
|
-
onClick: e[7] || (e[7] = (t) =>
|
|
635
|
+
m(s(te), {
|
|
636
|
+
onClick: e[7] || (e[7] = (t) => W.value = !1)
|
|
637
637
|
}, {
|
|
638
638
|
default: g(() => [
|
|
639
|
-
x(b(
|
|
639
|
+
x(b(s(i)("sheet.cancel")), 1)
|
|
640
640
|
]),
|
|
641
641
|
_: 1
|
|
642
642
|
})
|