@studio-west/employees 0.4.6 → 0.4.7

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.
@@ -0,0 +1,728 @@
1
+ import { ref as f, openBlock as h, createElementBlock as $, createElementVNode as p, toDisplayString as b, unref as a, Fragment as q, renderList as W, normalizeClass as re, createCommentVNode as P, watch as ye, computed as Ce, resolveDirective as be, createBlock as B, withCtx as m, createVNode as v, createTextVNode as V, withDirectives as De } from "vue";
2
+ import { p as A, h as Se } from "./index-uVRk2ARj.js";
3
+ import { useI18n as me } from "vue-i18n";
4
+ import { saveAs as we } from "file-saver";
5
+ import * as xe from "exceljs";
6
+ import { ElSelect as ie, ElOption as de, ElButton as F, ElSkeleton as ke, ElSkeletonItem as le, ElTable as Ee, ElTableColumn as R, ElInput as $e, ElDialog as ve, ElForm as ce, ElFormItem as Te, ElSwitch as Ve } from "element-plus";
7
+ import { ContextMenu as Ie, ContextMenuItem as se, ContextMenuSeparator as Ne } from "@imengyu/vue3-context-menu";
8
+ const Me = (j, I) => {
9
+ const o = j.__vccOpts || j;
10
+ for (const [w, n] of I)
11
+ o[w] = n;
12
+ return o;
13
+ }, _e = { class: "wrapper" }, Ye = { class: "month_year" }, Be = { class: "text" }, Fe = { class: "week" }, Ae = { class: "month" }, je = ["onClick"], ze = { key: 0 }, Ge = { class: "month_year" }, Ue = { class: "text" }, Oe = { class: "week" }, Pe = { class: "month" }, qe = ["onClick"], Le = {
14
+ __name: "DataPicker",
15
+ props: {
16
+ data: Object,
17
+ limitation: { type: [Boolean, Array], default: () => !1 },
18
+ // {dateEnd:"30.12.2024",dateStart:"30.11.2024"}
19
+ range: { type: String, default: () => "solid" }
20
+ // range | solid
21
+ },
22
+ emits: ["init"],
23
+ setup(j, { emit: I }) {
24
+ var ae, ne, oe, Q;
25
+ const o = f(/* @__PURE__ */ new Date()), w = f(/* @__PURE__ */ new Date()), n = j, J = I, S = f((/* @__PURE__ */ new Date()).getFullYear()), z = f((/* @__PURE__ */ new Date()).getMonth()), K = f((/* @__PURE__ */ new Date()).getFullYear()), g = f((/* @__PURE__ */ new Date()).getMonth()), s = f([]), G = f(0), L = f(0), D = f(-1), k = f(-1), { locale: H } = me(), M = /en|zh|ja|he/.test(H.value) ? 0 : 1, _ = n.range === "range" ? 2 : 1, U = (r) => {
26
+ const i = r.split(r.match(/\D.*?\D?/));
27
+ return i[0].length > 2 ? i.join("-") + "T00:00:01" : i.reverse().join("-") + "T00:00:01";
28
+ };
29
+ typeof ((ae = n.data) == null ? void 0 : ae.startDate) < "u" && (o.value = new Date(U(n.data.startDate)), S.value = o.value.getFullYear(), g.value = o.value.getMonth()), typeof ((ne = n.data) == null ? void 0 : ne.endDate) < "u" && (w.value = new Date(U(n.data.endDate)), K.value = w.value.getFullYear(), z.value = w.value.getMonth());
30
+ const c = () => {
31
+ let r = new Date(S.value, g.value, 0);
32
+ for (let t = r.getDate() - r.getDay() + M; t <= r.getDate() && r.getDay() !== 6 + M; t++)
33
+ G.value++, s.value.push({ day: t, month: r.getMonth(), year: r.getFullYear(), class: [] });
34
+ for (let t = 1; t <= new Date(S.value, g.value + 1, 0).getDate(); t++)
35
+ G.value++, s.value.push({ day: t, month: g.value, year: S.value, class: [] });
36
+ if (n.range === "range") {
37
+ L.value = new Date(S.value, g.value + 2, 0);
38
+ for (let t = 1; t <= L.value.getDate(); t++)
39
+ s.value.push({ day: t, month: L.value.getMonth(), year: L.value.getFullYear(), class: [] });
40
+ }
41
+ let i = new Date(S.value, g.value + _, 1);
42
+ console.log(i.getDay());
43
+ for (let t = 1; t <= (7 - i.getDay() + M) % 7 && i.getDay() !== M; t++)
44
+ s.value.push({ day: t, month: i.getMonth(), year: i.getFullYear(), class: [] });
45
+ n.data.holiday.length !== 0 && (n.data.holiday.preholidays.forEach((t) => {
46
+ let d = t.split("-");
47
+ const x = s.value.findIndex((T) => T.year == d[0] && T.month + 1 == d[1] && T.day == d[2]);
48
+ x !== -1 && (s.value[x].class[0] = "preholiday");
49
+ }), n.data.holiday.holidays.forEach((t) => {
50
+ let d = t.split("-");
51
+ const x = s.value.findIndex((T) => T.year == d[0] && T.month + 1 == d[1] && T.day == d[2]);
52
+ x !== -1 && (s.value[x].class[0] = "weekend");
53
+ }), n.data.holiday.holiday.forEach((t) => {
54
+ let d = t.split("-");
55
+ const x = s.value.findIndex((T) => T.year == d[0] && T.month + 1 == d[1] && T.day == d[2]);
56
+ x !== -1 && (s.value[x].class[0] = "holiday");
57
+ }), n.data.holiday.nowork.forEach((t) => {
58
+ let d = t.split("-");
59
+ const x = s.value.findIndex((T) => T.year == d[0] && T.month + 1 == d[1] && T.day == d[2]);
60
+ x !== -1 && (s.value[x].class[0] = "nowork");
61
+ }));
62
+ }, te = (r, i) => {
63
+ let t = r - i + 1;
64
+ for (let d = 0; d <= r - i; d++)
65
+ s.value[d + i].class[0] === "holiday" && t--;
66
+ return t;
67
+ }, E = (r, i) => {
68
+ const t = A(new Date(r.year, r.month, r.day), "{dd}.{m}.{Y}");
69
+ if (n.range === "range")
70
+ if (console.log(D.value), k.value !== -1) {
71
+ if (k.value <= D.value)
72
+ for (let d = k.value; d <= D.value; d++) s.value[d].class[1] = "";
73
+ else for (let d = D.value; d <= k.value; d++) s.value[d].class[1] = "";
74
+ D.value = i, k.value = -1, s.value[i].class[1] = "active";
75
+ } else if (D.value !== -1) {
76
+ if (k.value = i, k.value >= D.value)
77
+ for (let x = D.value + 1; x < i; x++) s.value[x].class[1] = "select";
78
+ else for (let x = i + 1; x < D.value; x++) s.value[x].class[1] = "select";
79
+ s.value[i].class[1] = "active";
80
+ let d = A(new Date(s.value[D.value].year, s.value[D.value].month, s.value[D.value].day), "{dd}.{m}.{Y}");
81
+ D.value > i ? J("input", { dateStart: t, dateEnd: d, count: te(D.value, i) }) : J("input", { dateStart: d, dateEnd: t, count: te(i, D.value) });
82
+ } else
83
+ D.value = i, s.value[i].class[1] = "active";
84
+ else
85
+ s.value[D.value].class[1] = "", D.value = i, s.value[i].class[1] = "active", J("input", { dateStart: t, count: 1 });
86
+ };
87
+ if (c(), typeof ((oe = n.data) == null ? void 0 : oe.startDate) < "u" && (D.value = s.value.findIndex((r) => r.day === o.value.getDate() && r.month === g.value && r.year === S.value), s.value[D.value].class[1] = "active"), typeof ((Q = n.data) == null ? void 0 : Q.endDate) < "u" && n.range === "range") {
88
+ k.value = s.value.findIndex((r) => r.day === w.value.getDate() && r.month === z.value && r.year === K.value), s.value[k.value].class[1] = "active";
89
+ for (let r = D.value + 1; r < k.value; r++) s.value[r].class[1] = "select";
90
+ }
91
+ const Y = (r, i) => {
92
+ Z(r, i) && (s.value = [], G.value = 0, o.value = new Date(r, i, 1), S.value = o.value.getFullYear(), g.value = o.value.getMonth(), c());
93
+ }, Z = (r, i) => {
94
+ if (!n.limitation) return !0;
95
+ if (n.limitation[0].dateStart) {
96
+ console.log(n.limitation[0].dateStart);
97
+ let t = n.limitation[0].dateStart.split(n.limitation[0].dateStart.match(/\D.*?\D?/));
98
+ if (t[0].length > 2 && t.reverse(), parseInt(t[2]) > r || parseInt(t[2]) === r && parseInt(t[1]) > i + 1) return !1;
99
+ }
100
+ if (n.limitation[n.limitation.length - 1].dateEnd) {
101
+ console.log(n.limitation[n.limitation.length - 1].dateEnd);
102
+ let t = n.limitation[n.limitation.length - 1].dateEnd.split(n.limitation[n.limitation.length - 1].dateEnd.match(/\D.*?\D?/));
103
+ if (t[0].length > 2 && t.reverse(), parseInt(t[2]) < r || parseInt(t[2]) === r && parseInt(t[1]) < i + _) return !1;
104
+ }
105
+ return !0;
106
+ };
107
+ return (r, i) => (h(), $("div", _e, [
108
+ p("div", null, [
109
+ p("p", Ye, [
110
+ p("span", null, [
111
+ p("button", {
112
+ onClick: i[0] || (i[0] = (t) => Y(S.value - 1, g.value))
113
+ }, "«"),
114
+ p("button", {
115
+ onClick: i[1] || (i[1] = (t) => Y(S.value, g.value - 1))
116
+ }, "‹")
117
+ ]),
118
+ p("span", Be, [
119
+ p("button", null, b(S.value), 1),
120
+ p("button", null, b(a(A)(o.value.setMonth(g.value), "{F}")), 1)
121
+ ]),
122
+ p("span", null, [
123
+ p("button", {
124
+ onClick: i[2] || (i[2] = (t) => Y(S.value, g.value + 1))
125
+ }, "›"),
126
+ p("button", {
127
+ onClick: i[3] || (i[3] = (t) => Y(S.value + 1, g.value))
128
+ }, "»")
129
+ ])
130
+ ]),
131
+ p("div", Fe, [
132
+ (h(), $(q, null, W(7, (t, d) => p("button", {
133
+ key: d,
134
+ class: "disabled"
135
+ }, b(a(A)(new Date(1970, 1, t + a(M)), "{D}")), 1)), 64))
136
+ ]),
137
+ p("div", Ae, [
138
+ (h(!0), $(q, null, W(s.value, (t, d) => (h(), $(q, { key: d }, [
139
+ d < G.value + (7 - new Date(S.value, g.value + 1, 1).getDay() + a(M)) % 7 ? (h(), $("button", {
140
+ key: 0,
141
+ class: re(t.month === g.value && (!n.limitation || new Date(t.year, t.month, t.day + 1).getTime() > new Date(U(n.limitation[0].dateStart)).getTime() && new Date(t.year, t.month, t.day).getTime() < new Date(U(n.limitation[0].dateEnd)).getTime()) ? t.class : "disabled"),
142
+ onClick: () => {
143
+ t.month === g.value && E(t, d);
144
+ }
145
+ }, b(t.day), 11, je)) : P("", !0)
146
+ ], 64))), 128))
147
+ ])
148
+ ]),
149
+ n.range === "range" ? (h(), $("div", ze, [
150
+ p("p", Ge, [
151
+ p("span", null, [
152
+ p("button", {
153
+ onClick: i[4] || (i[4] = (t) => Y(S.value - 1, g.value))
154
+ }, "«"),
155
+ p("button", {
156
+ onClick: i[5] || (i[5] = (t) => Y(S.value, g.value - 1))
157
+ }, "‹")
158
+ ]),
159
+ p("span", Ue, [
160
+ p("button", null, b(new Date(S.value, g.value + 1).getFullYear()), 1),
161
+ p("button", null, b(a(A)(o.value.setMonth(g.value + 1), "{F}")), 1)
162
+ ]),
163
+ p("span", null, [
164
+ p("button", {
165
+ onClick: i[6] || (i[6] = (t) => Y(S.value, g.value + 1))
166
+ }, "›"),
167
+ p("button", {
168
+ onClick: i[7] || (i[7] = (t) => Y(S.value + 1, g.value))
169
+ }, "»")
170
+ ])
171
+ ]),
172
+ p("div", Oe, [
173
+ (h(), $(q, null, W(7, (t, d) => p("button", {
174
+ key: d,
175
+ class: "disabled"
176
+ }, b(a(A)(new Date(1970, 1, t + a(M)), "{D}")), 1)), 64))
177
+ ]),
178
+ p("div", Pe, [
179
+ (h(!0), $(q, null, W(s.value, (t, d) => (h(), $(q, { key: d }, [
180
+ d >= G.value - (7 + new Date(S.value, g.value + 1, 1).getDay() - a(M)) % 7 ? (h(), $("button", {
181
+ key: 0,
182
+ class: re(t.month === L.value.getMonth() && (!n.limitation || new Date(t.year, t.month, t.day + 1).getTime() > new Date(U(n.limitation[0].dateStart)).getTime() && new Date(t.year, t.month, t.day).getTime() < new Date(U(n.limitation[0].dateEnd)).getTime()) ? t.class : "disabled"),
183
+ onClick: () => {
184
+ t.month === L.value.getMonth() && E(t, d);
185
+ }
186
+ }, b(t.day), 11, qe)) : P("", !0)
187
+ ], 64))), 128))
188
+ ])
189
+ ])) : P("", !0)
190
+ ]));
191
+ }
192
+ }, Re = /* @__PURE__ */ Me(Le, [["__scopeId", "data-v-5b3d4c74"]]), We = {
193
+ key: 1,
194
+ class: "controls-container",
195
+ style: { "margin-top": ".5rem" }
196
+ }, Je = { key: 0 }, Ke = {
197
+ key: 1,
198
+ style: { padding: "0 1rem .5rem" }
199
+ }, tl = {
200
+ __name: "VacationTable",
201
+ props: {
202
+ checkEdit: { type: Boolean, default: () => !0 },
203
+ odata: Object,
204
+ workSchedule: Object,
205
+ query: String,
206
+ fullName: { type: String, default: "Вы" }
207
+ },
208
+ setup(j) {
209
+ const I = j, { t: o } = me(), w = f([
210
+ // { name: 'Иванов Петр Михалыч',
211
+ // jobTitle: '(Ведущий работник месяца)',
212
+ // days: [{dateStart: "03.05.2024", dateEnd: "06.06.2024", note: 'забил - сказал он ослик', count: 14 },
213
+ // {dateStart: "23.07.2024", dateEnd: "06.08.2024", note: 'забил - сказал он осёл', count: 14 }
214
+ // ],
215
+ // code: '0000-00052'
216
+ // },
217
+ // { name: 'Петров Илья Пророкович',
218
+ // jobTitle: '(Ведущий работник года)',
219
+ // days: [{dateStart: "23.12.2024", dateEnd: "30.12.2024", note: 'забил - сказал он ослик', count: 14 }],
220
+ // code: '0000-00053'
221
+ // },
222
+ // { name: 'Хренова Гадя Петрович',
223
+ // jobTitle: '(Ведущий работник дня)',
224
+ // days: [{note:''}],
225
+ // code: '0000-00053'
226
+ // }
227
+ ]);
228
+ f([]);
229
+ const n = f((/* @__PURE__ */ new Date()).getFullYear()), J = f(!1), S = f(!1), z = f(!1), K = f({
230
+ zIndex: 3,
231
+ minWidth: 230,
232
+ x: 500,
233
+ y: 200
234
+ }), g = f(!1), s = f(!1), G = f({ participants: [] }), L = f([]), D = f([]), k = f("all"), H = f([{ value: "all", label: o("vacationSchedule.all"), key: "all" }]), M = f(!1), _ = f([]), U = f(!1), c = f({ name: "", length: 0, code: "" }), te = (/* @__PURE__ */ new Date()).getMonth() > 11 ? [{ value: n.value, label: n.value }, { value: n.value + 1, label: n.value + 1 }] : [{ value: n.value - 1, label: n.value - 1 }, { value: n.value, label: n.value }];
235
+ ye(k, async (u, e) => {
236
+ u !== e && (console.log(u), _.value = [], J.value = !1, I.odata.employee.forEach((y) => {
237
+ (y.divisionName === u || u === "all") && (_.value.some((l) => (l == null ? void 0 : l.activeText) === y.roleName) || _.value.push({ val: !0, activeText: y.roleName }));
238
+ }), Z());
239
+ });
240
+ const E = Ce(() => w.value.flatMap((u, e) => !u.days || u.days.length === 0 ? [{ ...u, key: 0, ids: e }] : u.days.map((y, l) => ({
241
+ ids: e,
242
+ key: l,
243
+ ...u,
244
+ ...y
245
+ })))), Y = async () => {
246
+ I.odata.getEmployee(n.value - 1 + "-12-16T00:01:00").then((u) => {
247
+ var e;
248
+ k.value = (e = u.find((y) => y.employeeName === I.fullName)) == null ? void 0 : e.divisionName, u.forEach((y) => {
249
+ H.value.some((l) => (l == null ? void 0 : l.value) === y.divisionName) || H.value.push({ value: y.divisionName, label: y.divisionName, key: y.divisionName }), y.divisionName === k.value && !_.value.some((l) => (l == null ? void 0 : l.activeText) === y.roleName) && _.value.push({ val: !0, activeText: y.roleName });
250
+ }), Z(), S.value = !1;
251
+ });
252
+ }, Z = () => {
253
+ w.value = [];
254
+ let u = [];
255
+ I.odata.employee.forEach((e) => {
256
+ (e.divisionName === k.value || k.value === "all") && _.value.some((y) => y.val && y.activeText === e.roleName) && (u.push(e.employeeKey), w.value.push({ name: e.employeeName, days: [{ note: "" }], jobTitle: e.roleName, code: e.employeeKey }));
257
+ }), ae(u), g.value = !1;
258
+ }, ae = (u) => {
259
+ I.workSchedule.getAllVacations({ year: n.value }).then(
260
+ (e) => {
261
+ u.forEach((y, l) => {
262
+ w.value[l].days = [{ note: "" }], e.forEach((C) => {
263
+ y === C.code && (typeof w.value[l].days[0].dateStart > "u" ? w.value[l].days[0] = {
264
+ dateStart: A(C.dateStart, "{dd}.{m}.{Y}"),
265
+ dateEnd: A(C.dateEnd, "{dd}.{m}.{Y}"),
266
+ note: C.note,
267
+ count: C.count
268
+ } : w.value[l].days.push({
269
+ dateStart: A(C.dateStart, "{dd}.{m}.{Y}"),
270
+ dateEnd: A(C.dateEnd, "{dd}.{m}.{Y}"),
271
+ note: C.note,
272
+ count: C.count
273
+ }));
274
+ });
275
+ });
276
+ }
277
+ );
278
+ }, ne = (u) => {
279
+ if (u.columnIndex < 3 && E.value[u.rowIndex].key < E.value[u.rowIndex].days.length)
280
+ return E.value[u.rowIndex].key === 0 ? {
281
+ rowspan: E.value[u.rowIndex].days.length,
282
+ colspan: 1
283
+ } : {
284
+ rowspan: 0,
285
+ colspan: 0
286
+ };
287
+ }, oe = (u, e, y, l) => {
288
+ c.value.ids = u.ids, c.value.key = u.key, c.value.startDate = u.dateStart, c.value.endDate = u.dateEnd, c.value.name = u.name, c.value.count = u.count, c.value.allCount = () => u.days.length === 0 ? 0 : u.days.reduce((C, ee, O) => O !== u.key ? C + parseInt(ee.count) : C, 0), c.value.length = u.days.length, c.value.add = u.days.length > 0 && u.days[u.days.length - 1].count, c.value.level = e.level, c.value.holiday = D.value, K.value.y = l.clientY, K.value.x = l.clientX, e.level === 2 && e.no < 4 && (c.value.add || u.days.length > 1) && (z.value = !0), e.level === 3 && (z.value = !0);
289
+ }, Q = (u) => {
290
+ let e = w.value[c.value.ids];
291
+ switch (u) {
292
+ case "add":
293
+ e.days.push({ note: "" }), console.log(e.days.length);
294
+ break;
295
+ case "delete":
296
+ delete e.days.pop(), t(c.value.ids);
297
+ break;
298
+ }
299
+ z.value = !1;
300
+ }, r = (u) => {
301
+ U.value = u, c.value.count = u.count;
302
+ }, i = () => {
303
+ U.value && (w.value[c.value.ids].days[c.value.key] = { ...U.value, note: "" }, t(c.value.ids)), z.value = !1;
304
+ }, t = (u) => {
305
+ I.workSchedule.rewriteFull({
306
+ year: n.value,
307
+ code: w.value[u].code,
308
+ data: w.value[u].days.map((e) => ({
309
+ dateStart: e.dateStart.split(".").reverse().join("-"),
310
+ dateEnd: e.dateEnd.split(".").reverse().join("-"),
311
+ note: e.note,
312
+ count: e.count
313
+ }))
314
+ });
315
+ }, d = (u) => {
316
+ I.workSchedule.sendConfirmMessage({ fullname: I.fullName, confirm: u }), I.query = "";
317
+ }, x = () => {
318
+ I.workSchedule.sendAgreementMessage({ users: G.value.participants }), s.value = !1;
319
+ };
320
+ I.workSchedule.getBoss().then((u) => {
321
+ L.value = u[0].users;
322
+ }), Se().then((u) => {
323
+ D.value = u, Y();
324
+ });
325
+ const T = () => c.value.length < 2 ? [{ dateStart: "01.01." + n.value, dateEnd: "31.12." + n.value }] : [{ dateStart: "01.01." + n.value, dateEnd: "31.12." + n.value }], ge = async () => {
326
+ M.value = !0;
327
+ const u = new xe.Workbook(), e = u.addWorksheet(n.value.toString(), { pageSetup: { paperSize: 9, orientation: "landscape", fitToPage: !0 } }), y = { vertical: "middle", horizontal: "center" }, l = { top: { style: "thin" }, left: { style: "thin" }, bottom: { style: "thin" }, right: { style: "thin" } }, C = { vertical: "middle", horizontal: "center", wrapText: !0 }, ee = { vertical: "middle", horizontal: "right", wrapText: !0 };
328
+ e.mergeCells("D1:G1"), e.mergeCells("D2:G2"), e.mergeCells("D3:G3"), e.mergeCells("D4:G4"), e.mergeCells("A5:G5"), e.mergeCells("A6:G6"), e.mergeCells("A9:G9"), e.mergeCells("A10:A11"), e.mergeCells("B10:B11"), e.mergeCells("C10:C11"), e.mergeCells("D10:F10"), e.mergeCells("G10:G11"), e.getCell("D1").value = o("vacationSchedule.approve"), e.getCell("D2").value = o("vacationSchedule.dateApprove", { year: n.value - 1 }), e.getCell("D3").value = o("workSchedule.printPlace"), e.getCell("D4").value = o("vacationSchedule.dateApprove", { year: n.value - 1 }), e.getCell("A5").value = o("workSchedule.firm"), e.getCell("B7").value = o("vacationSchedule.vacationSchedule"), e.getCell("C7").value = o("vacationSchedule.numberDocs"), e.getCell("D7").value = o("vacationSchedule.compilation"), e.getCell("E7").value = o("vacationSchedule.year"), e.getCell("C8").value = "", e.getCell("D8").value = "", e.getCell("E8").value = n.value, e.getCell("E7").value = o("vacationSchedule.year"), e.getCell("A10").value = o("vacationSchedule.jobTitle"), e.getCell("B10").value = o("vacationSchedule.fullName"), e.getCell("C10").value = o("vacationSchedule.personnelNumber"), e.getCell("D10").value = o("vacationSchedule.vacation"), e.getCell("D11").value = o("vacationSchedule.days"), e.getCell("E11").value = o("vacationSchedule.date"), e.getCell("F11").value = o("vacationSchedule.endDate"), e.getCell("G11").value = o("vacationSchedule.note"), e.getRow(1).height = 80, e.getColumn(1).width = 28, e.getColumn(2).width = 28, e.getColumn(3).width = 18, e.getColumn(4).width = 18, e.getColumn(5).width = 14, e.getColumn(6).width = 14, e.getColumn(7).width = 14, e.getColumn(1).alignment = C, e.getColumn(2).alignment = C, e.getColumn(3).alignment = C, e.getColumn(4).alignment = C, e.getColumn(5).alignment = C, e.getColumn(6).alignment = C, e.getColumn(7).alignment = C, e.getCell("D1").alignment = ee, e.getCell("D2").alignment = ee, e.getCell("D4").alignment = ee, e.getCell("A5").alignment = y, e.getCell("C7").border = l, e.getCell("D7").border = l, e.getCell("E7").border = l, e.getCell("C8").border = l, e.getCell("D8").border = l, e.getCell("E8").border = l, e.getCell("A10").border = l, e.getCell("B10").border = l, e.getCell("C10").border = l, e.getCell("D10").border = l, e.getCell("G10").border = l, e.getCell("D11").border = l, e.getCell("E11").border = l, e.getCell("F11").border = l;
329
+ let O = 11;
330
+ for (const N of w.value)
331
+ if (N.days.length > 1)
332
+ N.days.forEach((X) => {
333
+ let ue = [N.jobTitle, N.name, N.code, X.count, X.dateStart, X.dateEnd, X.note];
334
+ const pe = e.addRow(ue);
335
+ pe.border = l, O++;
336
+ }), e.mergeCells(`A${O - N.days.length + 1}:A${O}`), e.mergeCells(`B${O - N.days.length + 1}:B${O}`), e.mergeCells(`C${O - N.days.length + 1}:C${O}`);
337
+ else {
338
+ let X = [N.jobTitle, N.name, N.code, N.days[0].count, N.days[0].dateStart, N.days[0].dateEnd, N.days[0].note];
339
+ const ue = e.addRow(X);
340
+ ue.border = l, O++;
341
+ }
342
+ const he = "export_" + A(Date.now(), "{dd}.{m}.{Y}") + ".xlsx", fe = await u.xlsx.writeBuffer();
343
+ we(new Blob([fe]), he), M.value = !1;
344
+ };
345
+ return (u, e) => {
346
+ const y = be("loading");
347
+ return h(), $("div", null, [
348
+ j.checkEdit ? (h(), B(a(ie), {
349
+ key: 0,
350
+ modelValue: k.value,
351
+ "onUpdate:modelValue": e[0] || (e[0] = (l) => k.value = l),
352
+ placeholder: "Select",
353
+ style: { width: "240px", "margin-bottom": ".5rem", "margin-right": ".5rem" }
354
+ }, {
355
+ default: m(() => [
356
+ (h(!0), $(q, null, W(H.value, (l) => (h(), B(a(de), {
357
+ key: l.value,
358
+ label: l.label,
359
+ value: l.value
360
+ }, null, 8, ["label", "value"]))), 128))
361
+ ]),
362
+ _: 1
363
+ }, 8, ["modelValue"])) : P("", !0),
364
+ v(a(F), {
365
+ plain: "",
366
+ onClick: e[1] || (e[1] = (l) => g.value = !0),
367
+ style: { "margin-bottom": ".5rem", "margin-right": ".5rem" }
368
+ }, {
369
+ default: m(() => [
370
+ V(b(a(o)("workSchedule.jobTitle")), 1)
371
+ ]),
372
+ _: 1
373
+ }),
374
+ v(a(ie), {
375
+ modelValue: n.value,
376
+ "onUpdate:modelValue": e[2] || (e[2] = (l) => n.value = l),
377
+ onChange: Y,
378
+ placeholder: "Year",
379
+ style: { width: "80px", "margin-bottom": ".5rem", "margin-right": ".5rem" }
380
+ }, {
381
+ default: m(() => [
382
+ (h(!0), $(q, null, W(a(te), (l) => (h(), B(a(de), {
383
+ key: l.value,
384
+ label: l.label,
385
+ value: l.value
386
+ }, null, 8, ["label", "value"]))), 128))
387
+ ]),
388
+ _: 1
389
+ }, 8, ["modelValue"]),
390
+ v(a(ke), {
391
+ style: { width: "100%" },
392
+ loading: S.value,
393
+ animated: ""
394
+ }, {
395
+ template: m(() => [
396
+ v(a(le), {
397
+ variant: "text",
398
+ style: { width: "100%", height: "2rem" }
399
+ }),
400
+ v(a(le), {
401
+ variant: "text",
402
+ style: { width: "180px", height: "4rem", "margin-right": "4px" }
403
+ }),
404
+ v(a(le), {
405
+ variant: "text",
406
+ style: { width: "calc( 100% - 184px)", height: "4rem" }
407
+ }),
408
+ v(a(le), {
409
+ variant: "text",
410
+ style: { width: "180px", height: "8rem", "margin-right": "4px" }
411
+ }),
412
+ v(a(le), {
413
+ variant: "text",
414
+ style: { width: "calc( 100% - 184px)", height: "8rem" }
415
+ })
416
+ ]),
417
+ default: m(() => [
418
+ v(a(Ee), {
419
+ id: "printTable",
420
+ data: E.value,
421
+ "span-method": ne,
422
+ onCellClick: oe,
423
+ border: "",
424
+ style: { width: "100%" },
425
+ size: "small",
426
+ "empty-text": a(o)("vacationSchedule.emptyText")
427
+ }, {
428
+ default: m(() => [
429
+ v(a(R), {
430
+ label: k.value !== "all" ? a(o)("vacationSchedule.title", { name: k.value }) : a(o)("vacationSchedule.enterprise") + ` ${n.value}`,
431
+ align: "center",
432
+ height: "34"
433
+ }, {
434
+ default: m(() => [
435
+ v(a(R), {
436
+ label: a(o)("vacationSchedule.jobTitle"),
437
+ width: "180",
438
+ align: "center"
439
+ }, {
440
+ default: m((l) => [
441
+ V(b(E.value[l.$index].jobTitle), 1)
442
+ ]),
443
+ _: 1
444
+ }, 8, ["label"]),
445
+ v(a(R), {
446
+ label: a(o)("vacationSchedule.fullName"),
447
+ width: "180",
448
+ align: "center"
449
+ }, {
450
+ default: m((l) => [
451
+ V(b(E.value[l.$index].name), 1)
452
+ ]),
453
+ _: 1
454
+ }, 8, ["label"]),
455
+ v(a(R), {
456
+ label: a(o)("vacationSchedule.personnelNumber"),
457
+ align: "center"
458
+ }, {
459
+ default: m((l) => [
460
+ V(b(E.value[l.$index].code), 1)
461
+ ]),
462
+ _: 1
463
+ }, 8, ["label"]),
464
+ v(a(R), {
465
+ label: a(o)("vacationSchedule.vacation"),
466
+ align: "center"
467
+ }, {
468
+ default: m(() => [
469
+ v(a(R), {
470
+ label: a(o)("vacationSchedule.days"),
471
+ align: "center"
472
+ }, {
473
+ default: m((l) => [
474
+ V(b(E.value[l.$index].count), 1)
475
+ ]),
476
+ _: 1
477
+ }, 8, ["label"]),
478
+ v(a(R), {
479
+ label: a(o)("vacationSchedule.date"),
480
+ align: "center"
481
+ }, {
482
+ default: m((l) => [
483
+ V(b(E.value[l.$index].dateStart), 1)
484
+ ]),
485
+ _: 1
486
+ }, 8, ["label"]),
487
+ v(a(R), {
488
+ label: a(o)("vacationSchedule.endDate"),
489
+ align: "center"
490
+ }, {
491
+ default: m((l) => [
492
+ V(b(E.value[l.$index].dateEnd), 1)
493
+ ]),
494
+ _: 1
495
+ }, 8, ["label"])
496
+ ]),
497
+ _: 1
498
+ }, 8, ["label"]),
499
+ v(a(R), {
500
+ label: a(o)("vacationSchedule.note"),
501
+ align: "center"
502
+ }, {
503
+ default: m((l) => [
504
+ v(a($e), {
505
+ modelValue: w.value[E.value[l.$index].ids].days[E.value[l.$index].key].note,
506
+ "onUpdate:modelValue": (C) => w.value[E.value[l.$index].ids].days[E.value[l.$index].key].note = C,
507
+ style: { width: "100%" },
508
+ placeholder: " ",
509
+ class: "noBorder",
510
+ onBlur: (C) => t(E.value[l.$index].ids)
511
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "onBlur"])
512
+ ]),
513
+ _: 1
514
+ }, 8, ["label"])
515
+ ]),
516
+ _: 1
517
+ }, 8, ["label"])
518
+ ]),
519
+ _: 1
520
+ }, 8, ["data", "empty-text"])
521
+ ]),
522
+ _: 1
523
+ }, 8, ["loading"]),
524
+ j.checkEdit ? (h(), $("div", We, [
525
+ J.value ? P("", !0) : (h(), B(a(F), {
526
+ key: 0,
527
+ type: "primary",
528
+ onClick: e[3] || (e[3] = (l) => s.value = !0)
529
+ }, {
530
+ default: m(() => [
531
+ V(b(a(o)("vacationSchedule.sendInformation")), 1)
532
+ ]),
533
+ _: 1
534
+ })),
535
+ j.query === "confirm" ? (h(), B(a(F), {
536
+ key: 1,
537
+ type: "primary",
538
+ onClick: e[4] || (e[4] = (l) => d(!0))
539
+ }, {
540
+ default: m(() => [
541
+ V(b(a(o)("vacationSchedule.agreeOn")), 1)
542
+ ]),
543
+ _: 1
544
+ })) : P("", !0),
545
+ j.query === "confirm" ? (h(), B(a(F), {
546
+ key: 2,
547
+ type: "primary",
548
+ onClick: e[5] || (e[5] = (l) => d(!1))
549
+ }, {
550
+ default: m(() => [
551
+ V(b(a(o)("vacationSchedule.reject")), 1)
552
+ ]),
553
+ _: 1
554
+ })) : P("", !0)
555
+ ])) : P("", !0),
556
+ De((h(), B(a(F), {
557
+ disabled: M.value,
558
+ plain: "",
559
+ onClick: ge,
560
+ style: { "margin-top": ".5rem" }
561
+ }, {
562
+ default: m(() => [
563
+ V(b(a(o)("workSchedule.exportExcel")), 1)
564
+ ]),
565
+ _: 1
566
+ }, 8, ["disabled"])), [
567
+ [y, M.value]
568
+ ]),
569
+ v(a(ve), {
570
+ title: a(o)("workSchedule.jobTitle"),
571
+ modelValue: g.value,
572
+ "onUpdate:modelValue": e[7] || (e[7] = (l) => g.value = l),
573
+ width: "400px"
574
+ }, {
575
+ footer: m(() => [
576
+ v(a(F), {
577
+ onClick: e[6] || (e[6] = (l) => g.value = !1),
578
+ size: "default"
579
+ }, {
580
+ default: m(() => [
581
+ V(b(u.$t("workSchedule.cancel")), 1)
582
+ ]),
583
+ _: 1
584
+ }),
585
+ v(a(F), {
586
+ size: "default",
587
+ type: "primary",
588
+ onClick: Z
589
+ }, {
590
+ default: m(() => [
591
+ V(b(u.$t("workSchedule.select")), 1)
592
+ ]),
593
+ _: 1
594
+ })
595
+ ]),
596
+ default: m(() => [
597
+ v(a(ce), {
598
+ model: _.value,
599
+ autocomplete: "on"
600
+ }, {
601
+ default: m(() => [
602
+ (h(!0), $(q, null, W(_.value, (l) => (h(), B(a(Te), null, {
603
+ default: m(() => [
604
+ v(a(Ve), {
605
+ modelValue: l.val,
606
+ "onUpdate:modelValue": (C) => l.val = C,
607
+ "active-text": l.activeText
608
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "active-text"])
609
+ ]),
610
+ _: 2
611
+ }, 1024))), 256))
612
+ ]),
613
+ _: 1
614
+ }, 8, ["model"])
615
+ ]),
616
+ _: 1
617
+ }, 8, ["title", "modelValue"]),
618
+ v(a(ve), {
619
+ title: a(o)("vacationSchedule.pleaseCoordinate"),
620
+ modelValue: s.value,
621
+ "onUpdate:modelValue": e[10] || (e[10] = (l) => s.value = l),
622
+ width: "500px"
623
+ }, {
624
+ footer: m(() => [
625
+ v(a(F), {
626
+ onClick: e[9] || (e[9] = (l) => s.value = !1),
627
+ size: "default"
628
+ }, {
629
+ default: m(() => [
630
+ V(b(a(o)("workSchedule.cancel")), 1)
631
+ ]),
632
+ _: 1
633
+ }),
634
+ v(a(F), {
635
+ size: "default",
636
+ type: "primary",
637
+ onClick: x
638
+ }, {
639
+ default: m(() => [
640
+ V(b(a(o)("vacationSchedule.send")), 1)
641
+ ]),
642
+ _: 1
643
+ })
644
+ ]),
645
+ default: m(() => [
646
+ v(a(ce), {
647
+ model: G.value,
648
+ autocomplete: "on"
649
+ }, {
650
+ default: m(() => [
651
+ v(a(ie), {
652
+ modelValue: G.value.participants,
653
+ "onUpdate:modelValue": e[8] || (e[8] = (l) => G.value.participants = l),
654
+ placeholder: a(o)("vacationSchedule.fullName"),
655
+ multiple: "",
656
+ size: "default"
657
+ }, {
658
+ default: m(() => [
659
+ (h(!0), $(q, null, W(L.value, (l) => (h(), B(a(de), {
660
+ key: l,
661
+ label: l,
662
+ value: l
663
+ }, null, 8, ["label", "value"]))), 128))
664
+ ]),
665
+ _: 1
666
+ }, 8, ["modelValue", "placeholder"])
667
+ ]),
668
+ _: 1
669
+ }, 8, ["model"])
670
+ ]),
671
+ _: 1
672
+ }, 8, ["title", "modelValue"]),
673
+ v(a(Ie), {
674
+ show: z.value,
675
+ "onUpdate:show": e[14] || (e[14] = (l) => z.value = l),
676
+ options: K.value
677
+ }, {
678
+ default: m(() => [
679
+ v(a(se), {
680
+ label: c.value.level === 3 && typeof c.value.count < "u" ? c.value.name + " " + c.value.count + " " + a(o)("vacationSchedule.day", c.value.count) + ` ${a(o)("vacationSchedule.from")}: ${c.value.allCount() + parseInt(c.value.count)}` : c.value.name,
681
+ disabled: ""
682
+ }, null, 8, ["label"]),
683
+ v(a(Ne)),
684
+ c.value.level === 2 ? (h(), $("div", Je, [
685
+ c.value.length > 1 ? (h(), B(a(se), {
686
+ key: 0,
687
+ label: a(o)("vacationSchedule.deleteLast"),
688
+ onClick: e[11] || (e[11] = (l) => Q("delete"))
689
+ }, null, 8, ["label"])) : P("", !0),
690
+ c.value.add ? (h(), B(a(se), {
691
+ key: 1,
692
+ label: a(o)("vacationSchedule.addVacation"),
693
+ onClick: e[12] || (e[12] = (l) => Q("add"))
694
+ }, null, 8, ["label"])) : P("", !0)
695
+ ])) : (h(), $("div", Ke, [
696
+ v(Re, {
697
+ data: c.value,
698
+ range: "range",
699
+ limitation: T(),
700
+ onInput: r
701
+ }, null, 8, ["data", "limitation"]),
702
+ p("div", null, [
703
+ v(a(F), {
704
+ onClick: e[13] || (e[13] = (l) => z.value = !1)
705
+ }, {
706
+ default: m(() => [
707
+ V(b(a(o)("vacationSchedule.cancel")), 1)
708
+ ]),
709
+ _: 1
710
+ }),
711
+ v(a(F), { onClick: i }, {
712
+ default: m(() => [
713
+ V(b(a(o)("vacationSchedule.save")), 1)
714
+ ]),
715
+ _: 1
716
+ })
717
+ ])
718
+ ]))
719
+ ]),
720
+ _: 1
721
+ }, 8, ["show", "options"])
722
+ ]);
723
+ };
724
+ }
725
+ };
726
+ export {
727
+ tl as default
728
+ };