@studio-west/employees 0.4.4 → 0.4.6

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