@studio-west/employees 0.6.17 → 0.6.19
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 +168 -150
- package/package.json +1 -1
package/dist/SheetTable.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),
|
|
2
|
-
`+
|
|
3
|
-
`+
|
|
1
|
+
"use strict";const e=require("vue"),O=require("vue-i18n"),v=require("./index-Dn3djtwj.cjs"),o=require("element-plus"),P={style:{height:"20px",width:"100%",display:"inline-block"}},U={style:{height:"20px",width:"100%",display:"inline-block"}},K={__name:"SheetTable",props:{checkEdit:{type:Boolean,default:()=>!0},odata:Object,workSchedule:Object,fullName:{type:String,default:"Вы"}},setup(x){const g=x,{t:i,d:C}=O.useI18n(),c=e.ref([]),w=e.ref("0"),h=e.ref(new Date(new Date().getFullYear(),new Date().getMonth(),1).setMonth(new Date().getMonth()+Number(w.value))),m=e.ref([]),p=e.ref("all"),N=e.ref([{value:"all",label:"Все",key:"all"}]),E=e.ref([]),k=e.ref(0),b=e.ref([]),D=e.ref([]),_=e.ref([]);e.watch(p,async(t,l)=>{t!==l&&(b.value=[],confirm.value=!1,g.odata.personal.forEach(a=>{a.divisionName===t&&(b.value.some(u=>(u==null?void 0:u.activeText)===a.roleName)||b.value.push({val:!0,activeText:a.roleName}))}),I())}),e.watch(w,t=>{h.value=new Date(new Date().getFullYear(),new Date().getMonth(),1).setMonth(new Date().getMonth()+Number(t)),V()});const r=e.computed(()=>c.value.flatMap((t,l)=>[{...t,key:0,ids:l},{...t,key:1,ids:l}])),F=t=>{if(t.columnIndex<2||t.columnIndex>m.value.length+3&&t.columnIndex<m.value.length+9||t.columnIndex>m.value.length+11)return r.value[t.rowIndex].key===0?{rowspan:2,colspan:1}:{rowspan:0,colspan:0}},V=()=>{const t=E.value,l=new Date(h.value),a=new Date(l.getFullYear(),l.getMonth()+1,0).getDate();let u=[],y=0;for(let n=1;n<=a;n++){const s=v.parseTime(l.setDate(n),"{Y}-{m}-{dd}");y+=t.nowork.includes(s)||t.holidays.includes(s)?0:t.preholidays.includes(s)?7:8;let d=t.nowork.includes(s)?"nowork":t.holidays.includes(s)?"holiday":t.preholidays.includes(s)?"preholiday":"";u.push({day:n,holidays:d,weekday:C(new Date(l.getFullYear(),l.getMonth(),n),"day")})}k.value=y,m.value=u,g.odata.getPersonal({}).then(n=>{var s;p.value=(s=n.find(d=>d.employeeName===g.fullName))==null?void 0:s.divisionName,n.forEach(d=>{N.value.some(f=>(f==null?void 0:f.value)===d.divisionName)||N.value.push({value:d.divisionName,label:d.divisionName,key:d.divisionName}),d.divisionName===p.value&&!b.value.some(f=>(f==null?void 0:f.activeText)===d.roleName)&&b.value.push({val:!0,activeText:d.roleName})}),I()})},I=()=>{c.value=[];let t=[];t.value=[],D.value=[],g.odata.personal.forEach(l=>{if(l.divisionName===p.value&&b.value.some(a=>a.val&&a.activeText===l.roleName)){let a=v.byInitials(l.employeeName);t.value.push(l.employeeKey),c.value.push({name:a+" ("+l.roleName+")",code:l.employeeKey,days:[],contHour:0,id:!1,ids:c.value.length})}}),g.workSchedule.getUsersYear({code:t.value,year:new Date(h.value).getFullYear()}).then(l=>{l.forEach(a=>{a.dateStart&&D.value.push({code:a.code,dateStart:a.dateStart,dateEnd:a.dateEnd})}),console.log(l),Y()})},Y=()=>{g.workSchedule.getWorkSchedule({code:_.value,date:v.parseTime(new Date(h.value),"{Y}-{m}-{dd}")}).then(t=>{t.forEach((l,a)=>{var u,y;if(l!==null){l.data.days.forEach(n=>n.state="Я");for(let n=1;n<=m.value.length;n++){let s=v.parseTime(new Date(h.value).setDate(n),"{Y}-{m}-{dd}");const d=(u=l.data)==null?void 0:u.days.findIndex(f=>f.day===s);d===-1?c.value[a].days.push({day:s,time:"-",state:"В"}):c.value[a].days.push((y=l.data)==null?void 0:y.days[d])}}else{c.value[a].days=[];for(let n=1;n<=m.value.length;n++)m.value[n-1].holidays===""?S(n,a,8):m.value[n-1].holidays==="preholiday"?S(n,a,7):c.value[a].days.push({day:v.parseTime(new Date(h.value).setDate(n),"{Y}-{m}-{dd}"),time:"-",state:"В"})}for(let n=1;n<=m.value.length;n++){let s=new Date(new Date(h.value).getFullYear(),new Date(h.value).getMonth(),n).getTime()+1e3;for(let d of D.value){const{dateStart:f,dateEnd:$,code:q}=d;if(f&&$&&q===l.code){const j=new Date(v.parseDate(f)).getTime(),A=new Date(v.parseDate($)).getTime();if(s>=j&&s<=A){const T=v.parseTime(new Date(h.value).setDate(n),"{Y}-{m}-{dd}"),M=c.value[a].days.findIndex(L=>L.day===T);M!==-1?c.value[a].days[M]={day:T,time:"-",state:"О"}:c.value[a].days.push({day:T,time:"-",state:"О"})}}}}}),H()})},S=(t,l,a)=>{const u=v.parseTime(new Date(h.value).setDate(t),"{Y}-{m}-{dd}");c.value[l].days.push({day:u,time:a,state:"Я"})},H=()=>{c.value.forEach(t=>{t.hourI=0,t.hourII=0,t.halfII=0,t.halfI=0,t.weekend=0,t.weekendDays=0,t.night=0;for(let l=0;l<t.days.length;l++)l<15&&t.days[l].time!=="-"&&(t.hourI+=t.days[l].time),l<15&&t.days[l].state==="Я"&&t.halfI++,l>=15&&t.days[l].time!=="-"&&(t.hourII+=t.days[l].time),l>=15&&t.days[l].state==="Я"&&t.halfII++,t.days[l].state==="Н"&&(t.night+=t.days[l].time),t.days[l].state==="РВ"&&(t.weekend+=t.days[l].time),t.days[l].state==="В"&&t.weekendDays++;t.contDays=t.halfI+t.halfII,t.contHour=t.hourI+t.hourII,t.overtime=0,k.value<t.contHour&&(t.overtime=t.contHour-k.value),t.numberNonAppearing=0,t.appearing={code:"-",countH:"-"}})},B=(t,l)=>{var n,s;if(l===-1)return"";const a=new Date(h.value),u=`${a.getFullYear()}-${(a.getMonth()+1).toString().padStart(2,"0")}-${t.toString().padStart(2,"0")}`,y=r.value[l].days.findIndex(d=>d.day===u);return y===-1?"":r.value[l].key===0?(n=r.value[l].days[y])==null?void 0:n.state:(s=r.value[l].days[y])==null?void 0:s.time};return v.holidays().then(t=>{E.value=t,V()}),(t,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[x.checkEdit?(e.openBlock(),e.createBlock(e.unref(o.ElSelect),{key:0,modelValue:p.value,"onUpdate:modelValue":l[0]||(l[0]=a=>p.value=a),placeholder:"Select",style:{width:"240px","margin-bottom":".5rem","margin-right":".5rem"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,a=>(e.openBlock(),e.createBlock(e.unref(o.ElOption),{key:a.value,label:a.label,value:a.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])):e.createCommentVNode("",!0),l[2]||(l[2]=e.createElementVNode("div",{class:"expander"},null,-1)),x.checkEdit?(e.openBlock(),e.createBlock(e.unref(o.ElSwitch),{key:1,modelValue:w.value,"onUpdate:modelValue":l[1]||(l[1]=a=>w.value=a),"active-text":e.unref(i)("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(o.ElTable),{id:"printTable",data:r.value,"span-method":F,border:"",style:{width:"100%"},size:"small","empty-text":e.unref(i)("sheet.emptyText"),align:"center",onCellClick:t.coMenu},{default:e.withCtx(()=>[e.createVNode(e.unref(o.ElTableColumn),{label:e.unref(i)("sheet.title",{name:p.value})+e.unref(C)(h.value,"month"),align:"center",height:"10"},{default:e.withCtx(()=>[e.createVNode(e.unref(o.ElTableColumn),{label:e.unref(i)("sheet.employee"),width:"180",align:"center"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(r.value[a.$index].name),1)]),_:1},8,["label"]),e.createVNode(e.unref(o.ElTableColumn),{label:e.unref(i)("sheet.personnelNumber"),align:"center"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(r.value[a.$index].code),1)]),_:1},8,["label"]),e.createVNode(e.unref(o.ElTableColumn),{label:e.unref(i)("sheet.marks"),align:"center"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,a=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:a.day},[a.day<=15?(e.openBlock(),e.createBlock(e.unref(o.ElTableColumn),{key:0,width:"30","class-name":a.holidays,align:"center",label:a.day.toString()+`
|
|
2
|
+
`+a.weekday},{default:e.withCtx(u=>[e.createElementVNode("div",P,e.toDisplayString(B(a.day,u.$index)||" "),1)]),_:2},1032,["class-name","label"])):e.createCommentVNode("",!0)],64))),128)),e.createVNode(e.unref(o.ElTableColumn),{label:e.unref(i)("sheet.halfMonth",{half:"I"}),align:"center"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(r.value[a.$index].key===0?r.value[a.$index].halfI:r.value[a.$index].hourI),1)]),_:1},8,["label"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,a=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:a.day},[a.day>15?(e.openBlock(),e.createBlock(e.unref(o.ElTableColumn),{key:0,width:"30","class-name":a.holidays,align:"center",label:a.day.toString()+`
|
|
3
|
+
`+a.weekday},{default:e.withCtx(u=>[e.createElementVNode("div",U,e.toDisplayString(B(a.day,u.$index)||" "),1)]),_:2},1032,["class-name","label"])):e.createCommentVNode("",!0)],64))),128)),e.createVNode(e.unref(o.ElTableColumn),{label:e.unref(i)("sheet.halfMonth",{half:"II"}),align:"center"},{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"]),e.createVNode(e.unref(o.ElTableColumn),{label:e.unref(i)("sheet.workedMonth"),align:"center"},{default:e.withCtx(()=>[e.createVNode(e.unref(o.ElTableColumn),{label:e.unref(i)("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(o.ElTableColumn),{label:e.unref(i)("sheet.hours"),align:"center"},{default:e.withCtx(()=>[e.createVNode(e.unref(o.ElTableColumn),{label:e.unref(i)("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(o.ElTableColumn),{label:e.unref(i)("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(o.ElTableColumn),{label:e.unref(i)("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(o.ElTableColumn),{label:e.unref(i)("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.createVNode(e.unref(o.ElTableColumn),{label:e.unref(i)("sheet.numberNonAppearing"),align:"center"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(r.value[a.$index].numberNonAppearing),1)]),_:1},8,["label"]),e.createVNode(e.unref(o.ElTableColumn),{label:e.unref(i)("sheet.them"),align:"center"},{default:e.withCtx(()=>[e.createVNode(e.unref(o.ElTableColumn),{label:e.unref(i)("sheet.code"),align:"center","label-class-name":"turn",width:"30"},{default:e.withCtx(a=>{var u;return[e.createTextVNode(e.toDisplayString((u=r.value[a.$index].appearing)==null?void 0:u.code),1)]}),_:1},8,["label"]),e.createVNode(e.unref(o.ElTableColumn),{label:e.unref(i)("sheet.count"),align:"center","label-class-name":"turn",width:"30"},{default:e.withCtx(a=>{var u;return[e.createTextVNode(e.toDisplayString((u=r.value[a.$index].appearing)==null?void 0:u.countH),1)]}),_:1},8,["label"])]),_:1},8,["label"]),e.createVNode(e.unref(o.ElTableColumn),{label:e.unref(i)("sheet.countWeekend"),align:"center"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(r.value[a.$index].weekendDays),1)]),_:1},8,["label"])]),_:1},8,["label"])]),_:1},8,["data","empty-text","onCellClick"])],64))}};module.exports=K;
|
package/dist/SheetTable.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { useI18n as
|
|
3
|
-
import { p as
|
|
4
|
-
import { ElSelect as
|
|
5
|
-
const
|
|
1
|
+
import { ref as b, watch as J, computed as le, createElementBlock as N, openBlock as w, Fragment as S, createBlock as M, createCommentVNode as E, createElementVNode as C, createVNode as r, unref as t, withCtx as s, renderList as B, createTextVNode as y, toDisplayString as v } from "vue";
|
|
2
|
+
import { useI18n as te } from "vue-i18n";
|
|
3
|
+
import { p as $, b as ne, a as L, h as oe } from "./index-2Mx6IUGl.js";
|
|
4
|
+
import { ElSelect as ue, ElOption as se, ElSwitch as ie, ElTable as de, ElTableColumn as d } from "element-plus";
|
|
5
|
+
const re = { style: { height: "20px", width: "100%", display: "inline-block" } }, ce = { style: { height: "20px", width: "100%", display: "inline-block" } }, fe = {
|
|
6
6
|
__name: "SheetTable",
|
|
7
7
|
props: {
|
|
8
8
|
checkEdit: { type: Boolean, default: () => !0 },
|
|
@@ -11,285 +11,303 @@ const ae = { style: { height: "20px", width: "100%", display: "inline-block" } }
|
|
|
11
11
|
fullName: { type: String, default: "Вы" }
|
|
12
12
|
},
|
|
13
13
|
setup(T) {
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}),
|
|
19
|
-
}),
|
|
20
|
-
|
|
14
|
+
const k = T, { t: i, d: j } = te(), m = b([]), _ = b("0"), f = b(new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1).setMonth((/* @__PURE__ */ new Date()).getMonth() + Number(_.value))), p = b([]), D = b("all"), Y = b([{ value: "all", label: "Все", key: "all" }]), A = b([]), V = b(0), I = b([]), F = b([]), q = b([]);
|
|
15
|
+
J(D, async (a, l) => {
|
|
16
|
+
a !== l && (I.value = [], confirm.value = !1, k.odata.personal.forEach((e) => {
|
|
17
|
+
e.divisionName === a && (I.value.some((u) => (u == null ? void 0 : u.activeText) === e.roleName) || I.value.push({ val: !0, activeText: e.roleName }));
|
|
18
|
+
}), U());
|
|
19
|
+
}), J(_, (a) => {
|
|
20
|
+
f.value = new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1).setMonth((/* @__PURE__ */ new Date()).getMonth() + Number(a)), O();
|
|
21
21
|
});
|
|
22
|
-
const
|
|
23
|
-
if (
|
|
24
|
-
return
|
|
22
|
+
const o = le(() => m.value.flatMap((a, l) => [{ ...a, key: 0, ids: l }, { ...a, key: 1, ids: l }])), G = (a) => {
|
|
23
|
+
if (a.columnIndex < 2 || a.columnIndex > p.value.length + 3 && a.columnIndex < p.value.length + 9 || a.columnIndex > p.value.length + 11)
|
|
24
|
+
return o.value[a.rowIndex].key === 0 ? {
|
|
25
25
|
rowspan: 2,
|
|
26
26
|
colspan: 1
|
|
27
27
|
} : {
|
|
28
28
|
rowspan: 0,
|
|
29
29
|
colspan: 0
|
|
30
30
|
};
|
|
31
|
-
},
|
|
32
|
-
const
|
|
33
|
-
let
|
|
34
|
-
for (let
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
let h =
|
|
38
|
-
|
|
31
|
+
}, O = () => {
|
|
32
|
+
const a = A.value, l = new Date(f.value), e = new Date(l.getFullYear(), l.getMonth() + 1, 0).getDate();
|
|
33
|
+
let u = [], x = 0;
|
|
34
|
+
for (let n = 1; n <= e; n++) {
|
|
35
|
+
const c = $(l.setDate(n), "{Y}-{m}-{dd}");
|
|
36
|
+
x += a.nowork.includes(c) || a.holidays.includes(c) ? 0 : a.preholidays.includes(c) ? 7 : 8;
|
|
37
|
+
let h = a.nowork.includes(c) ? "nowork" : a.holidays.includes(c) ? "holiday" : a.preholidays.includes(c) ? "preholiday" : "";
|
|
38
|
+
u.push({ day: n, holidays: h, weekday: j(new Date(l.getFullYear(), l.getMonth(), n), "day") });
|
|
39
39
|
}
|
|
40
|
-
|
|
41
|
-
var
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}),
|
|
40
|
+
V.value = x, p.value = u, k.odata.getPersonal({}).then((n) => {
|
|
41
|
+
var c;
|
|
42
|
+
D.value = (c = n.find((h) => h.employeeName === k.fullName)) == null ? void 0 : c.divisionName, n.forEach((h) => {
|
|
43
|
+
Y.value.some((g) => (g == null ? void 0 : g.value) === h.divisionName) || Y.value.push({ value: h.divisionName, label: h.divisionName, key: h.divisionName }), h.divisionName === D.value && !I.value.some((g) => (g == null ? void 0 : g.activeText) === h.roleName) && I.value.push({ val: !0, activeText: h.roleName });
|
|
44
|
+
}), U();
|
|
45
45
|
});
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
let
|
|
49
|
-
|
|
50
|
-
if (l.divisionName ===
|
|
51
|
-
let
|
|
52
|
-
|
|
46
|
+
}, U = () => {
|
|
47
|
+
m.value = [];
|
|
48
|
+
let a = [];
|
|
49
|
+
a.value = [], F.value = [], k.odata.personal.forEach((l) => {
|
|
50
|
+
if (l.divisionName === D.value && I.value.some((e) => e.val && e.activeText === l.roleName)) {
|
|
51
|
+
let e = ne(l.employeeName);
|
|
52
|
+
a.value.push(l.employeeKey), m.value.push({ name: e + " (" + l.roleName + ")", code: l.employeeKey, days: [], contHour: 0, id: !1, ids: m.value.length });
|
|
53
53
|
}
|
|
54
|
-
}),
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
(l)
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
54
|
+
}), k.workSchedule.getUsersYear({ code: a.value, year: new Date(f.value).getFullYear() }).then((l) => {
|
|
55
|
+
l.forEach((e) => {
|
|
56
|
+
e.dateStart && F.value.push({ code: e.code, dateStart: e.dateStart, dateEnd: e.dateEnd });
|
|
57
|
+
}), console.log(l), R();
|
|
58
|
+
});
|
|
59
|
+
}, R = () => {
|
|
60
|
+
k.workSchedule.getWorkSchedule({ code: q.value, date: $(new Date(f.value), "{Y}-{m}-{dd}") }).then(
|
|
61
|
+
(a) => {
|
|
62
|
+
a.forEach((l, e) => {
|
|
63
|
+
var u, x;
|
|
64
|
+
if (l !== null) {
|
|
65
|
+
l.data.days.forEach((n) => n.state = "Я");
|
|
66
|
+
for (let n = 1; n <= p.value.length; n++) {
|
|
67
|
+
let c = $(new Date(f.value).setDate(n), "{Y}-{m}-{dd}");
|
|
68
|
+
const h = (u = l.data) == null ? void 0 : u.days.findIndex((g) => g.day === c);
|
|
69
|
+
h === -1 ? m.value[e].days.push({
|
|
70
|
+
day: c,
|
|
67
71
|
time: "-",
|
|
68
72
|
state: "В"
|
|
69
|
-
}) :
|
|
73
|
+
}) : m.value[e].days.push((x = l.data) == null ? void 0 : x.days[h]);
|
|
70
74
|
}
|
|
71
75
|
} else {
|
|
72
|
-
|
|
73
|
-
for (let
|
|
74
|
-
|
|
75
|
-
day:
|
|
76
|
+
m.value[e].days = [];
|
|
77
|
+
for (let n = 1; n <= p.value.length; n++)
|
|
78
|
+
p.value[n - 1].holidays === "" ? K(n, e, 8) : p.value[n - 1].holidays === "preholiday" ? K(n, e, 7) : m.value[e].days.push({
|
|
79
|
+
day: $(new Date(f.value).setDate(n), "{Y}-{m}-{dd}"),
|
|
76
80
|
time: "-",
|
|
77
81
|
state: "В"
|
|
78
82
|
});
|
|
79
83
|
}
|
|
80
|
-
|
|
84
|
+
for (let n = 1; n <= p.value.length; n++) {
|
|
85
|
+
let c = new Date(new Date(f.value).getFullYear(), new Date(f.value).getMonth(), n).getTime() + 1e3;
|
|
86
|
+
for (let h of F.value) {
|
|
87
|
+
const { dateStart: g, dateEnd: W, code: Z } = h;
|
|
88
|
+
if (g && W && Z === l.code) {
|
|
89
|
+
const Q = new Date(L(g)).getTime(), ee = new Date(L(W)).getTime();
|
|
90
|
+
if (c >= Q && c <= ee) {
|
|
91
|
+
const H = $(new Date(f.value).setDate(n), "{Y}-{m}-{dd}"), z = m.value[e].days.findIndex((ae) => ae.day === H);
|
|
92
|
+
z !== -1 ? m.value[e].days[z] = { day: H, time: "-", state: "О" } : m.value[e].days.push({ day: H, time: "-", state: "О" });
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}), X();
|
|
81
98
|
}
|
|
82
99
|
);
|
|
83
|
-
},
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
day:
|
|
87
|
-
time:
|
|
100
|
+
}, K = (a, l, e) => {
|
|
101
|
+
const u = $(new Date(f.value).setDate(a), "{Y}-{m}-{dd}");
|
|
102
|
+
m.value[l].days.push({
|
|
103
|
+
day: u,
|
|
104
|
+
time: e,
|
|
88
105
|
state: "Я"
|
|
89
106
|
});
|
|
90
|
-
},
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
for (let l = 0; l <
|
|
94
|
-
l < 15 &&
|
|
95
|
-
|
|
107
|
+
}, X = () => {
|
|
108
|
+
m.value.forEach((a) => {
|
|
109
|
+
a.hourI = 0, a.hourII = 0, a.halfII = 0, a.halfI = 0, a.weekend = 0, a.weekendDays = 0, a.night = 0;
|
|
110
|
+
for (let l = 0; l < a.days.length; l++)
|
|
111
|
+
l < 15 && a.days[l].time !== "-" && (a.hourI += a.days[l].time), l < 15 && a.days[l].state === "Я" && a.halfI++, l >= 15 && a.days[l].time !== "-" && (a.hourII += a.days[l].time), l >= 15 && a.days[l].state === "Я" && a.halfII++, a.days[l].state === "Н" && (a.night += a.days[l].time), a.days[l].state === "РВ" && (a.weekend += a.days[l].time), a.days[l].state === "В" && a.weekendDays++;
|
|
112
|
+
a.contDays = a.halfI + a.halfII, a.contHour = a.hourI + a.hourII, a.overtime = 0, V.value < a.contHour && (a.overtime = a.contHour - V.value), a.numberNonAppearing = 0, a.appearing = {
|
|
96
113
|
code: "-",
|
|
97
114
|
countH: "-"
|
|
98
115
|
};
|
|
99
116
|
});
|
|
100
|
-
},
|
|
101
|
-
var
|
|
117
|
+
}, P = (a, l) => {
|
|
118
|
+
var n, c;
|
|
102
119
|
if (l === -1) return "";
|
|
103
|
-
const
|
|
104
|
-
return
|
|
120
|
+
const e = new Date(f.value), u = `${e.getFullYear()}-${(e.getMonth() + 1).toString().padStart(2, "0")}-${a.toString().padStart(2, "0")}`, x = o.value[l].days.findIndex((h) => h.day === u);
|
|
121
|
+
return x === -1 ? "" : o.value[l].key === 0 ? (n = o.value[l].days[x]) == null ? void 0 : n.state : (c = o.value[l].days[x]) == null ? void 0 : c.time;
|
|
105
122
|
};
|
|
106
|
-
return
|
|
107
|
-
|
|
108
|
-
}), (
|
|
109
|
-
T.checkEdit ? (
|
|
123
|
+
return oe().then((a) => {
|
|
124
|
+
A.value = a, O();
|
|
125
|
+
}), (a, l) => (w(), N(S, null, [
|
|
126
|
+
T.checkEdit ? (w(), M(t(ue), {
|
|
110
127
|
key: 0,
|
|
111
|
-
modelValue:
|
|
112
|
-
"onUpdate:modelValue": l[0] || (l[0] = (
|
|
128
|
+
modelValue: D.value,
|
|
129
|
+
"onUpdate:modelValue": l[0] || (l[0] = (e) => D.value = e),
|
|
113
130
|
placeholder: "Select",
|
|
114
131
|
style: { width: "240px", "margin-bottom": ".5rem", "margin-right": ".5rem" }
|
|
115
132
|
}, {
|
|
116
133
|
default: s(() => [
|
|
117
|
-
(
|
|
118
|
-
key:
|
|
119
|
-
label:
|
|
120
|
-
value:
|
|
134
|
+
(w(!0), N(S, null, B(Y.value, (e) => (w(), M(t(se), {
|
|
135
|
+
key: e.value,
|
|
136
|
+
label: e.label,
|
|
137
|
+
value: e.value
|
|
121
138
|
}, null, 8, ["label", "value"]))), 128))
|
|
122
139
|
]),
|
|
123
140
|
_: 1
|
|
124
141
|
}, 8, ["modelValue"])) : E("", !0),
|
|
125
|
-
|
|
142
|
+
l[2] || (l[2] = C("div", { class: "expander" }, null, -1)),
|
|
143
|
+
T.checkEdit ? (w(), M(t(ie), {
|
|
126
144
|
key: 1,
|
|
127
|
-
modelValue:
|
|
128
|
-
"onUpdate:modelValue": l[1] || (l[1] = (
|
|
145
|
+
modelValue: _.value,
|
|
146
|
+
"onUpdate:modelValue": l[1] || (l[1] = (e) => _.value = e),
|
|
129
147
|
"active-text": t(i)("workSchedule.currentMonth"),
|
|
130
148
|
"active-value": "0",
|
|
131
149
|
"inactive-value": "-1",
|
|
132
150
|
style: { "margin-bottom": ".5rem", "margin-left": ".5rem" }
|
|
133
151
|
}, null, 8, ["modelValue", "active-text"])) : E("", !0),
|
|
134
|
-
|
|
152
|
+
r(t(de), {
|
|
135
153
|
id: "printTable",
|
|
136
|
-
data:
|
|
137
|
-
"span-method":
|
|
154
|
+
data: o.value,
|
|
155
|
+
"span-method": G,
|
|
138
156
|
border: "",
|
|
139
157
|
style: { width: "100%" },
|
|
140
158
|
size: "small",
|
|
141
159
|
"empty-text": t(i)("sheet.emptyText"),
|
|
142
160
|
align: "center",
|
|
143
|
-
onCellClick:
|
|
161
|
+
onCellClick: a.coMenu
|
|
144
162
|
}, {
|
|
145
163
|
default: s(() => [
|
|
146
|
-
|
|
147
|
-
label: t(i)("sheet.title", { name:
|
|
164
|
+
r(t(d), {
|
|
165
|
+
label: t(i)("sheet.title", { name: D.value }) + t(j)(f.value, "month"),
|
|
148
166
|
align: "center",
|
|
149
167
|
height: "10"
|
|
150
168
|
}, {
|
|
151
169
|
default: s(() => [
|
|
152
|
-
|
|
170
|
+
r(t(d), {
|
|
153
171
|
label: t(i)("sheet.employee"),
|
|
154
172
|
width: "180",
|
|
155
173
|
align: "center"
|
|
156
174
|
}, {
|
|
157
|
-
default: s((
|
|
158
|
-
|
|
175
|
+
default: s((e) => [
|
|
176
|
+
y(v(o.value[e.$index].name), 1)
|
|
159
177
|
]),
|
|
160
178
|
_: 1
|
|
161
179
|
}, 8, ["label"]),
|
|
162
|
-
|
|
180
|
+
r(t(d), {
|
|
163
181
|
label: t(i)("sheet.personnelNumber"),
|
|
164
182
|
align: "center"
|
|
165
183
|
}, {
|
|
166
|
-
default: s((
|
|
167
|
-
|
|
184
|
+
default: s((e) => [
|
|
185
|
+
y(v(o.value[e.$index].code), 1)
|
|
168
186
|
]),
|
|
169
187
|
_: 1
|
|
170
188
|
}, 8, ["label"]),
|
|
171
|
-
|
|
189
|
+
r(t(d), {
|
|
172
190
|
label: t(i)("sheet.marks"),
|
|
173
191
|
align: "center"
|
|
174
192
|
}, {
|
|
175
193
|
default: s(() => [
|
|
176
|
-
(
|
|
177
|
-
key:
|
|
194
|
+
(w(!0), N(S, null, B(p.value, (e) => (w(), N(S, {
|
|
195
|
+
key: e.day
|
|
178
196
|
}, [
|
|
179
|
-
|
|
197
|
+
e.day <= 15 ? (w(), M(t(d), {
|
|
180
198
|
key: 0,
|
|
181
199
|
width: "30",
|
|
182
|
-
"class-name":
|
|
200
|
+
"class-name": e.holidays,
|
|
183
201
|
align: "center",
|
|
184
|
-
label:
|
|
185
|
-
` +
|
|
202
|
+
label: e.day.toString() + `
|
|
203
|
+
` + e.weekday
|
|
186
204
|
}, {
|
|
187
|
-
default: s((
|
|
188
|
-
|
|
205
|
+
default: s((u) => [
|
|
206
|
+
C("div", re, v(P(e.day, u.$index) || " "), 1)
|
|
189
207
|
]),
|
|
190
208
|
_: 2
|
|
191
209
|
}, 1032, ["class-name", "label"])) : E("", !0)
|
|
192
210
|
], 64))), 128)),
|
|
193
|
-
|
|
211
|
+
r(t(d), {
|
|
194
212
|
label: t(i)("sheet.halfMonth", { half: "I" }),
|
|
195
213
|
align: "center"
|
|
196
214
|
}, {
|
|
197
|
-
default: s((
|
|
198
|
-
|
|
215
|
+
default: s((e) => [
|
|
216
|
+
y(v(o.value[e.$index].key === 0 ? o.value[e.$index].halfI : o.value[e.$index].hourI), 1)
|
|
199
217
|
]),
|
|
200
218
|
_: 1
|
|
201
219
|
}, 8, ["label"]),
|
|
202
|
-
(
|
|
203
|
-
key:
|
|
220
|
+
(w(!0), N(S, null, B(p.value, (e) => (w(), N(S, {
|
|
221
|
+
key: e.day
|
|
204
222
|
}, [
|
|
205
|
-
|
|
223
|
+
e.day > 15 ? (w(), M(t(d), {
|
|
206
224
|
key: 0,
|
|
207
225
|
width: "30",
|
|
208
|
-
"class-name":
|
|
226
|
+
"class-name": e.holidays,
|
|
209
227
|
align: "center",
|
|
210
|
-
label:
|
|
211
|
-
` +
|
|
228
|
+
label: e.day.toString() + `
|
|
229
|
+
` + e.weekday
|
|
212
230
|
}, {
|
|
213
|
-
default: s((
|
|
214
|
-
|
|
231
|
+
default: s((u) => [
|
|
232
|
+
C("div", ce, v(P(e.day, u.$index) || " "), 1)
|
|
215
233
|
]),
|
|
216
234
|
_: 2
|
|
217
235
|
}, 1032, ["class-name", "label"])) : E("", !0)
|
|
218
236
|
], 64))), 128)),
|
|
219
|
-
|
|
237
|
+
r(t(d), {
|
|
220
238
|
label: t(i)("sheet.halfMonth", { half: "II" }),
|
|
221
239
|
align: "center"
|
|
222
240
|
}, {
|
|
223
|
-
default: s((
|
|
224
|
-
|
|
241
|
+
default: s((e) => [
|
|
242
|
+
y(v(o.value[e.$index].key === 0 ? o.value[e.$index].halfII : o.value[e.$index].hourII), 1)
|
|
225
243
|
]),
|
|
226
244
|
_: 1
|
|
227
245
|
}, 8, ["label"])
|
|
228
246
|
]),
|
|
229
247
|
_: 1
|
|
230
248
|
}, 8, ["label"]),
|
|
231
|
-
|
|
249
|
+
r(t(d), {
|
|
232
250
|
label: t(i)("sheet.workedMonth"),
|
|
233
251
|
align: "center"
|
|
234
252
|
}, {
|
|
235
253
|
default: s(() => [
|
|
236
|
-
|
|
254
|
+
r(t(d), {
|
|
237
255
|
label: t(i)("sheet.days"),
|
|
238
256
|
align: "center",
|
|
239
257
|
"label-class-name": "turn",
|
|
240
258
|
width: "34"
|
|
241
259
|
}, {
|
|
242
|
-
default: s((
|
|
243
|
-
|
|
260
|
+
default: s((e) => [
|
|
261
|
+
y(v(o.value[e.$index].contDays), 1)
|
|
244
262
|
]),
|
|
245
263
|
_: 1
|
|
246
264
|
}, 8, ["label"]),
|
|
247
|
-
|
|
265
|
+
r(t(d), {
|
|
248
266
|
label: t(i)("sheet.hours"),
|
|
249
267
|
align: "center"
|
|
250
268
|
}, {
|
|
251
269
|
default: s(() => [
|
|
252
|
-
|
|
270
|
+
r(t(d), {
|
|
253
271
|
label: t(i)("sheet.all"),
|
|
254
272
|
align: "center",
|
|
255
273
|
"label-class-name": "turn",
|
|
256
274
|
width: "40"
|
|
257
275
|
}, {
|
|
258
|
-
default: s((
|
|
259
|
-
|
|
276
|
+
default: s((e) => [
|
|
277
|
+
y(v(o.value[e.$index].contHour), 1)
|
|
260
278
|
]),
|
|
261
279
|
_: 1
|
|
262
280
|
}, 8, ["label"]),
|
|
263
|
-
|
|
281
|
+
r(t(d), {
|
|
264
282
|
label: t(i)("sheet.overtime"),
|
|
265
283
|
align: "center",
|
|
266
284
|
"label-class-name": "turn",
|
|
267
285
|
width: "34"
|
|
268
286
|
}, {
|
|
269
|
-
default: s((
|
|
270
|
-
|
|
287
|
+
default: s((e) => [
|
|
288
|
+
y(v(o.value[e.$index].overtime), 1)
|
|
271
289
|
]),
|
|
272
290
|
_: 1
|
|
273
291
|
}, 8, ["label"]),
|
|
274
|
-
|
|
292
|
+
r(t(d), {
|
|
275
293
|
label: t(i)("sheet.night"),
|
|
276
294
|
align: "center",
|
|
277
295
|
"label-class-name": "turn",
|
|
278
296
|
width: "34"
|
|
279
297
|
}, {
|
|
280
|
-
default: s((
|
|
281
|
-
|
|
298
|
+
default: s((e) => [
|
|
299
|
+
y(v(o.value[e.$index].night), 1)
|
|
282
300
|
]),
|
|
283
301
|
_: 1
|
|
284
302
|
}, 8, ["label"]),
|
|
285
|
-
|
|
303
|
+
r(t(d), {
|
|
286
304
|
label: t(i)("sheet.weekend"),
|
|
287
305
|
align: "center",
|
|
288
306
|
"label-class-name": "turn",
|
|
289
307
|
width: "34"
|
|
290
308
|
}, {
|
|
291
|
-
default: s((
|
|
292
|
-
|
|
309
|
+
default: s((e) => [
|
|
310
|
+
y(v(o.value[e.$index].weekend), 1)
|
|
293
311
|
]),
|
|
294
312
|
_: 1
|
|
295
313
|
}, 8, ["label"])
|
|
@@ -299,44 +317,44 @@ const ae = { style: { height: "20px", width: "100%", display: "inline-block" } }
|
|
|
299
317
|
]),
|
|
300
318
|
_: 1
|
|
301
319
|
}, 8, ["label"]),
|
|
302
|
-
|
|
320
|
+
r(t(d), {
|
|
303
321
|
label: t(i)("sheet.numberNonAppearing"),
|
|
304
322
|
align: "center"
|
|
305
323
|
}, {
|
|
306
|
-
default: s((
|
|
307
|
-
|
|
324
|
+
default: s((e) => [
|
|
325
|
+
y(v(o.value[e.$index].numberNonAppearing), 1)
|
|
308
326
|
]),
|
|
309
327
|
_: 1
|
|
310
328
|
}, 8, ["label"]),
|
|
311
|
-
|
|
329
|
+
r(t(d), {
|
|
312
330
|
label: t(i)("sheet.them"),
|
|
313
331
|
align: "center"
|
|
314
332
|
}, {
|
|
315
333
|
default: s(() => [
|
|
316
|
-
|
|
334
|
+
r(t(d), {
|
|
317
335
|
label: t(i)("sheet.code"),
|
|
318
336
|
align: "center",
|
|
319
337
|
"label-class-name": "turn",
|
|
320
338
|
width: "30"
|
|
321
339
|
}, {
|
|
322
|
-
default: s((
|
|
323
|
-
var
|
|
340
|
+
default: s((e) => {
|
|
341
|
+
var u;
|
|
324
342
|
return [
|
|
325
|
-
|
|
343
|
+
y(v((u = o.value[e.$index].appearing) == null ? void 0 : u.code), 1)
|
|
326
344
|
];
|
|
327
345
|
}),
|
|
328
346
|
_: 1
|
|
329
347
|
}, 8, ["label"]),
|
|
330
|
-
|
|
348
|
+
r(t(d), {
|
|
331
349
|
label: t(i)("sheet.count"),
|
|
332
350
|
align: "center",
|
|
333
351
|
"label-class-name": "turn",
|
|
334
352
|
width: "30"
|
|
335
353
|
}, {
|
|
336
|
-
default: s((
|
|
337
|
-
var
|
|
354
|
+
default: s((e) => {
|
|
355
|
+
var u;
|
|
338
356
|
return [
|
|
339
|
-
|
|
357
|
+
y(v((u = o.value[e.$index].appearing) == null ? void 0 : u.countH), 1)
|
|
340
358
|
];
|
|
341
359
|
}),
|
|
342
360
|
_: 1
|
|
@@ -344,12 +362,12 @@ const ae = { style: { height: "20px", width: "100%", display: "inline-block" } }
|
|
|
344
362
|
]),
|
|
345
363
|
_: 1
|
|
346
364
|
}, 8, ["label"]),
|
|
347
|
-
|
|
365
|
+
r(t(d), {
|
|
348
366
|
label: t(i)("sheet.countWeekend"),
|
|
349
367
|
align: "center"
|
|
350
368
|
}, {
|
|
351
|
-
default: s((
|
|
352
|
-
|
|
369
|
+
default: s((e) => [
|
|
370
|
+
y(v(o.value[e.$index].weekendDays), 1)
|
|
353
371
|
]),
|
|
354
372
|
_: 1
|
|
355
373
|
}, 8, ["label"])
|
|
@@ -363,5 +381,5 @@ const ae = { style: { height: "20px", width: "100%", display: "inline-block" } }
|
|
|
363
381
|
}
|
|
364
382
|
};
|
|
365
383
|
export {
|
|
366
|
-
|
|
384
|
+
fe as default
|
|
367
385
|
};
|