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