@studio-west/employees 0.1.3 → 0.1.5

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,14 +1,14 @@
1
- import { ref as g, openBlock as h, createElementBlock as w, createElementVNode as c, toDisplayString as D, unref as a, Fragment as B, renderList as z, normalizeClass as H, createCommentVNode as Y, watch as Q, computed as ee, resolveDirective as ae, createBlock as T, withCtx as r, createVNode as v, createTextVNode as _, withDirectives as le } from "vue";
2
- import { p as I } from "./index-Cig-zEKI.js";
3
- import { useI18n as te } from "vue-i18n";
4
- import { ElSelect as K, ElOption as Z, ElButton as j, ElSkeleton as ne, ElSkeletonItem as A, ElTable as ue, ElTableColumn as N, ElInput as oe, ElDialog as de, ElForm as ve, ElFormItem as se, ElSwitch as ie } from "element-plus";
5
- import { ContextMenu as re, ContextMenuItem as q, ContextMenuSeparator as ce } from "@imengyu/vue3-context-menu";
6
- const pe = (G, $) => {
7
- const u = G.__vccOpts || G;
8
- for (const [k, y] of $)
9
- u[k] = y;
10
- return u;
11
- }, fe = { class: "wrapper" }, he = { class: "month_year" }, me = { class: "text" }, ge = { class: "week" }, ye = { class: "month" }, be = ["onClick"], De = { key: 0 }, ke = { class: "month_year" }, xe = { class: "text" }, Se = { class: "week" }, we = { class: "month" }, Ce = ["onClick"], Ee = {
1
+ import { ref as g, openBlock as y, createElementBlock as w, createElementVNode as f, toDisplayString as D, unref as a, Fragment as U, renderList as P, normalizeClass as K, createCommentVNode as Y, watch as ee, computed as ae, resolveDirective as le, createBlock as T, withCtx as p, createVNode as c, createTextVNode as _, withDirectives as te } from "vue";
2
+ import { p as F, h as ne } from "./index-BZDm1cKh.js";
3
+ import { useI18n as ue } from "vue-i18n";
4
+ import { ElSelect as Z, ElOption as Q, ElButton as B, ElSkeleton as oe, ElSkeletonItem as J, ElTable as de, ElTableColumn as G, ElInput as se, ElDialog as ve, ElForm as ie, ElFormItem as re, ElSwitch as ce } from "element-plus";
5
+ import { ContextMenu as he, ContextMenuItem as H, ContextMenuSeparator as pe } from "@imengyu/vue3-context-menu";
6
+ const fe = (O, M) => {
7
+ const d = O.__vccOpts || O;
8
+ for (const [k, h] of M)
9
+ d[k] = h;
10
+ return d;
11
+ }, me = { class: "wrapper" }, ye = { class: "month_year" }, ge = { class: "text" }, be = { class: "week" }, De = { class: "month" }, ke = ["onClick"], xe = { key: 0 }, Se = { class: "month_year" }, we = { class: "text" }, Ce = { class: "week" }, Ee = { class: "month" }, _e = ["onClick"], $e = {
12
12
  __name: "DataPicker",
13
13
  props: {
14
14
  data: Object,
@@ -16,134 +16,156 @@ const pe = (G, $) => {
16
16
  // range | solid
17
17
  },
18
18
  emits: ["init"],
19
- setup(G, { emit: $ }) {
20
- var R, J, W, X;
21
- const u = g(/* @__PURE__ */ new Date()), k = g(/* @__PURE__ */ new Date()), y = G, U = $, b = g((/* @__PURE__ */ new Date()).getFullYear()), M = g((/* @__PURE__ */ new Date()).getMonth()), P = g((/* @__PURE__ */ new Date()).getFullYear()), p = g((/* @__PURE__ */ new Date()).getMonth()), s = g([]), F = g(0), O = g(0), S = g(-1), C = g(-1), L = (f) => {
22
- const n = f.split(f.match(/\D.*?\D?/));
23
- return n[0].length > 2 ? n.join("-") + "T00:00:01" : n.reverse().join("-") + "T00:00:01";
19
+ setup(O, { emit: M }) {
20
+ var z, W, X, q;
21
+ const d = g(/* @__PURE__ */ new Date()), k = g(/* @__PURE__ */ new Date()), h = O, R = M, b = g((/* @__PURE__ */ new Date()).getFullYear()), V = g((/* @__PURE__ */ new Date()).getMonth()), L = g((/* @__PURE__ */ new Date()).getFullYear()), m = g((/* @__PURE__ */ new Date()).getMonth()), v = g([]), C = g(0), j = g(0), S = g(-1), N = g(-1), $ = (r) => {
22
+ const u = r.split(r.match(/\D.*?\D?/));
23
+ return u[0].length > 2 ? u.join("-") + "T00:00:01" : u.reverse().join("-") + "T00:00:01";
24
24
  };
25
- typeof ((R = y.data) == null ? void 0 : R.startDate) < "u" && (u.value = new Date(L(y.data.startDate)), b.value = u.value.getFullYear(), p.value = u.value.getMonth()), typeof ((J = y.data) == null ? void 0 : J.endDate) < "u" && (k.value = new Date(L(y.data.endDate)), P.value = k.value.getFullYear(), M.value = k.value.getMonth());
26
- const i = () => {
27
- let f = new Date(b.value, p.value, 0);
28
- for (let o = f.getDate() - f.getDay(); o <= f.getDate() && f.getDay() !== 6; o++)
29
- F.value++, s.value.push({ day: o, month: f.getMonth(), year: f.getFullYear() });
30
- for (let o = 1; o <= new Date(b.value, p.value + 1, 0).getDate(); o++)
31
- F.value++, s.value.push({ day: o, month: p.value, year: b.value });
32
- if (y.range === "range") {
33
- O.value = new Date(b.value, p.value + 2, 0);
34
- for (let o = 1; o <= O.value.getDate(); o++)
35
- s.value.push({ day: o, month: O.value.getMonth(), year: O.value.getFullYear() });
25
+ typeof ((z = h.data) == null ? void 0 : z.startDate) < "u" && (d.value = new Date($(h.data.startDate)), b.value = d.value.getFullYear(), m.value = d.value.getMonth()), typeof ((W = h.data) == null ? void 0 : W.endDate) < "u" && (k.value = new Date($(h.data.endDate)), L.value = k.value.getFullYear(), V.value = k.value.getMonth());
26
+ const A = () => {
27
+ let r = new Date(b.value, m.value, 0);
28
+ for (let n = r.getDate() - r.getDay(); n <= r.getDate() && r.getDay() !== 6; n++)
29
+ C.value++, v.value.push({ day: n, month: r.getMonth(), year: r.getFullYear(), class: [] });
30
+ for (let n = 1; n <= new Date(b.value, m.value + 1, 0).getDate(); n++)
31
+ C.value++, v.value.push({ day: n, month: m.value, year: b.value, class: [] });
32
+ if (h.range === "range") {
33
+ j.value = new Date(b.value, m.value + 2, 0);
34
+ for (let n = 1; n <= j.value.getDate(); n++)
35
+ v.value.push({ day: n, month: j.value.getMonth(), year: j.value.getFullYear(), class: [] });
36
36
  }
37
- let n = y.range === "range" ? 2 : 1, d = new Date(b.value, p.value + n, 1);
38
- for (let o = 1; o <= 7 - d.getDay() && d.getDay() !== 0; o++)
39
- s.value.push({ day: o, month: d.getMonth(), year: d.getFullYear() });
40
- }, x = (f, n) => {
41
- console.log(n);
42
- const d = I(new Date(f.year, f.month, f.day), "{dd}.{m}.{Y}");
43
- if (y.range === "range")
44
- if (console.log(S.value), C.value !== -1)
45
- s.value[C.value].class = "", s.value[S.value].class = "", S.value = n, C.value = -1, s.value[n].class = "active";
37
+ let u = h.range === "range" ? 2 : 1, s = new Date(b.value, m.value + u, 1);
38
+ for (let n = 1; n <= 7 - s.getDay() && s.getDay() !== 0; n++)
39
+ v.value.push({ day: n, month: s.getMonth(), year: s.getFullYear(), class: [] });
40
+ h.data.holiday.length !== 0 && (h.data.holiday.preholidays.forEach((n) => {
41
+ let e = n.split("-");
42
+ const t = v.value.findIndex((o) => o.year == e[0] && o.month + 1 == e[1] && o.day == e[2]);
43
+ t !== -1 && (v.value[t].class[0] = "preholiday");
44
+ }), h.data.holiday.holidays.forEach((n) => {
45
+ let e = n.split("-");
46
+ const t = v.value.findIndex((o) => o.year == e[0] && o.month + 1 == e[1] && o.day == e[2]);
47
+ t !== -1 && (v.value[t].class[0] = "weekend");
48
+ }), h.data.holiday.holiday.forEach((n) => {
49
+ let e = n.split("-");
50
+ const t = v.value.findIndex((o) => o.year == e[0] && o.month + 1 == e[1] && o.day == e[2]);
51
+ t !== -1 && (v.value[t].class[0] = "holiday");
52
+ }), h.data.holiday.nowork.forEach((n) => {
53
+ let e = n.split("-");
54
+ const t = v.value.findIndex((o) => o.year == e[0] && o.month + 1 == e[1] && o.day == e[2]);
55
+ t !== -1 && (v.value[t].class[0] = "nowork");
56
+ }));
57
+ }, i = (r, u) => {
58
+ let s = r - u + 1;
59
+ for (let n = 0; n <= r - u; n++)
60
+ v.value[n + u].class[0] === "holiday" && s--;
61
+ return s;
62
+ }, x = (r, u) => {
63
+ const s = F(new Date(r.year, r.month, r.day), "{dd}.{m}.{Y}");
64
+ if (h.range === "range")
65
+ if (console.log(S.value), N.value !== -1)
66
+ v.value[N.value].class[1] = "", v.value[S.value].class[1] = "", S.value = u, N.value = -1, v.value[u].class[1] = "active";
46
67
  else if (S.value !== -1) {
47
- C.value = n, s.value[n].class = "active";
48
- let o = I(new Date(s.value[S.value].year, s.value[S.value].month, s.value[S.value].day), "{dd}.{m}.{Y}");
49
- S.value > n ? U("input", { dateStart: d, dateEnd: o, count: S.value - n + 1 }) : U("input", { dateStart: o, dateEnd: d, count: n - S.value + 1 });
68
+ N.value = u, v.value[u].class[1] = "active";
69
+ let n = F(new Date(v.value[S.value].year, v.value[S.value].month, v.value[S.value].day), "{dd}.{m}.{Y}");
70
+ S.value > u ? R("input", { dateStart: s, dateEnd: n, count: i(S.value, u) }) : R("input", { dateStart: n, dateEnd: s, count: i(u, S.value) });
50
71
  } else
51
- S.value = n, s.value[n].class = "active";
72
+ S.value = u, v.value[u].class[1] = "active";
52
73
  else
53
- s.value[S.value].class = "", S.value = n, s.value[n].class = "active", U("input", { dateStart: d, count: 1 });
74
+ v.value[S.value].class[1] = "", S.value = u, v.value[u].class[1] = "active", R("input", { dateStart: s, count: 1 });
54
75
  };
55
- i(), typeof ((W = y.data) == null ? void 0 : W.startDate) < "u" && (S.value = s.value.findIndex((f) => f.day === u.value.getDate() && f.month === p.value && f.year === b.value), s.value[S.value].class = "active"), typeof ((X = y.data) == null ? void 0 : X.endDate) < "u" && y.range === "range" && (C.value = s.value.findIndex((f) => f.day === k.value.getDate() && f.month === M.value && f.year === P.value), s.value[C.value].class = "active");
56
- const V = (f, n) => {
57
- s.value = [], F.value = 0, u.value = new Date(f, n, 1), b.value = u.value.getFullYear(), p.value = u.value.getMonth(), i();
76
+ A(), typeof ((X = h.data) == null ? void 0 : X.startDate) < "u" && (S.value = v.value.findIndex((r) => r.day === d.value.getDate() && r.month === m.value && r.year === b.value), v.value[S.value].class[1] = "active"), typeof ((q = h.data) == null ? void 0 : q.endDate) < "u" && h.range === "range" && (N.value = v.value.findIndex((r) => r.day === k.value.getDate() && r.month === V.value && r.year === L.value), v.value[N.value].class[1] = "active");
77
+ const I = (r, u) => {
78
+ v.value = [], C.value = 0, d.value = new Date(r, u, 1), b.value = d.value.getFullYear(), m.value = d.value.getMonth(), A();
58
79
  };
59
- return (f, n) => (h(), w("div", fe, [
60
- c("div", null, [
61
- c("p", he, [
62
- c("span", null, [
63
- c("button", {
64
- onClick: n[0] || (n[0] = (d) => V(b.value - 1, p.value))
80
+ return (r, u) => (y(), w("div", me, [
81
+ f("div", null, [
82
+ f("p", ye, [
83
+ f("span", null, [
84
+ f("button", {
85
+ onClick: u[0] || (u[0] = (s) => I(b.value - 1, m.value))
65
86
  }, "«"),
66
- c("button", {
67
- onClick: n[1] || (n[1] = (d) => V(b.value, p.value - 1))
87
+ f("button", {
88
+ onClick: u[1] || (u[1] = (s) => I(b.value, m.value - 1))
68
89
  }, "‹")
69
90
  ]),
70
- c("span", me, [
71
- c("button", null, D(b.value), 1),
72
- c("button", null, D(a(I)(u.value, "{F}")), 1)
91
+ f("span", ge, [
92
+ f("button", null, D(b.value), 1),
93
+ f("button", null, D(a(F)(d.value, "{F}")), 1)
73
94
  ]),
74
- c("span", null, [
75
- c("button", {
76
- onClick: n[2] || (n[2] = (d) => V(b.value, p.value + 1))
95
+ f("span", null, [
96
+ f("button", {
97
+ onClick: u[2] || (u[2] = (s) => I(b.value, m.value + 1))
77
98
  }, "›"),
78
- c("button", {
79
- onClick: n[3] || (n[3] = (d) => V(b.value + 1, p.value))
99
+ f("button", {
100
+ onClick: u[3] || (u[3] = (s) => I(b.value + 1, m.value))
80
101
  }, "»")
81
102
  ])
82
103
  ]),
83
- c("div", ge, [
84
- (h(), w(B, null, z(7, (d, o) => c("button", {
85
- key: o,
104
+ f("div", be, [
105
+ (y(), w(U, null, P(7, (s, n) => f("button", {
106
+ key: n,
86
107
  class: "disabled"
87
- }, D(a(I)(new Date(1970, 1, d), "{D}")), 1)), 64))
108
+ }, D(a(F)(new Date(1970, 1, s), "{D}")), 1)), 64))
88
109
  ]),
89
- c("div", ye, [
90
- (h(!0), w(B, null, z(s.value, (d, o) => (h(), w(B, { key: o }, [
91
- o <= F.value + 5 - new Date(b.value, p.value + 1, 0).getDay() ? (h(), w("button", {
110
+ f("div", De, [
111
+ (y(!0), w(U, null, P(v.value, (s, n) => (y(), w(U, { key: n }, [
112
+ n <= C.value + 5 - new Date(b.value, m.value + 1, 0).getDay() ? (y(), w("button", {
92
113
  key: 0,
93
- class: H(d.month === p.value ? d.class : "disabled"),
94
- onClick: (l) => x(d, o)
95
- }, D(d.day), 11, be)) : Y("", !0)
114
+ class: K(s.month === m.value ? s.class : "disabled"),
115
+ onClick: (e) => x(s, n)
116
+ }, D(s.day), 11, ke)) : Y("", !0)
96
117
  ], 64))), 128))
97
118
  ])
98
119
  ]),
99
- y.range === "range" ? (h(), w("div", De, [
100
- c("p", ke, [
101
- c("span", null, [
102
- c("button", {
103
- onClick: n[4] || (n[4] = (d) => V(b.value - 1, p.value))
120
+ h.range === "range" ? (y(), w("div", xe, [
121
+ f("p", Se, [
122
+ f("span", null, [
123
+ f("button", {
124
+ onClick: u[4] || (u[4] = (s) => I(b.value - 1, m.value))
104
125
  }, "«"),
105
- c("button", {
106
- onClick: n[5] || (n[5] = (d) => V(b.value, p.value - 1))
126
+ f("button", {
127
+ onClick: u[5] || (u[5] = (s) => I(b.value, m.value - 1))
107
128
  }, "‹")
108
129
  ]),
109
- c("span", xe, [
110
- c("button", null, D(new Date(b.value, p.value + 1).getFullYear()), 1),
111
- c("button", null, D(a(I)(u.value.setMonth(p.value + 1), "{F}")), 1)
130
+ f("span", we, [
131
+ f("button", null, D(new Date(b.value, m.value + 1).getFullYear()), 1),
132
+ f("button", null, D(a(F)(d.value.setMonth(m.value + 1), "{F}")), 1)
112
133
  ]),
113
- c("span", null, [
114
- c("button", {
115
- onClick: n[6] || (n[6] = (d) => V(b.value, p.value + 1))
134
+ f("span", null, [
135
+ f("button", {
136
+ onClick: u[6] || (u[6] = (s) => I(b.value, m.value + 1))
116
137
  }, "›"),
117
- c("button", {
118
- onClick: n[7] || (n[7] = (d) => V(b.value + 1, p.value))
138
+ f("button", {
139
+ onClick: u[7] || (u[7] = (s) => I(b.value + 1, m.value))
119
140
  }, "»")
120
141
  ])
121
142
  ]),
122
- c("div", Se, [
123
- (h(), w(B, null, z(7, (d, o) => c("button", {
124
- key: o,
143
+ f("div", Ce, [
144
+ (y(), w(U, null, P(7, (s, n) => f("button", {
145
+ key: n,
125
146
  class: "disabled"
126
- }, D(a(I)(new Date(1970, 1, d), "{D}")), 1)), 64))
147
+ }, D(a(F)(new Date(1970, 1, s), "{D}")), 1)), 64))
127
148
  ]),
128
- c("div", we, [
129
- (h(!0), w(B, null, z(s.value, (d, o) => (h(), w(B, { key: o }, [
130
- o >= F.value - new Date(b.value, p.value + 1, 1).getDay() ? (h(), w("button", {
149
+ f("div", Ee, [
150
+ (y(!0), w(U, null, P(v.value, (s, n) => (y(), w(U, { key: n }, [
151
+ n >= C.value - new Date(b.value, m.value + 1, 1).getDay() ? (y(), w("button", {
131
152
  key: 0,
132
- class: H(d.month === O.value.getMonth() ? d.class : "disabled"),
133
- onClick: (l) => x(d, o)
134
- }, D(d.day), 11, Ce)) : Y("", !0)
153
+ class: K(s.month === j.value.getMonth() ? s.class : "disabled"),
154
+ onClick: (e) => x(s, n)
155
+ }, D(s.day), 11, _e)) : Y("", !0)
135
156
  ], 64))), 128))
136
157
  ])
137
158
  ])) : Y("", !0)
138
159
  ]));
139
160
  }
140
- }, _e = /* @__PURE__ */ pe(Ee, [["__scopeId", "data-v-1e7f76f5"]]), $e = {
161
+ }, Me = /* @__PURE__ */ fe($e, [["__scopeId", "data-v-a842f008"]]), Ve = {
141
162
  key: 1,
142
- class: "controls-container"
143
- }, Me = { key: 0 }, Ve = {
163
+ class: "controls-container",
164
+ style: { "margin-top": ".5rem" }
165
+ }, Ie = { key: 0 }, Te = {
144
166
  key: 1,
145
167
  style: { padding: "0 1rem .5rem" }
146
- }, Ne = {
168
+ }, Ge = {
147
169
  __name: "VacationTable",
148
170
  props: {
149
171
  checkEdit: { type: Boolean, default: () => !0 },
@@ -151,8 +173,8 @@ const pe = (G, $) => {
151
173
  workSchedule: Object,
152
174
  fullName: { type: String, default: "Вы" }
153
175
  },
154
- setup(G) {
155
- const $ = G, { t: u } = te(), k = g([
176
+ setup(O) {
177
+ const M = O, { t: d } = ue(), k = g([
156
178
  // { name: 'Иванов Петр Михалыч',
157
179
  // jobTitle: '(Ведущий работник месяца)',
158
180
  // days: [{dateStart: "03.05.2024", dateEnd: "06.06.2024", note: 'забил - сказал он ослик', count: 14 },
@@ -172,48 +194,48 @@ const pe = (G, $) => {
172
194
  // }
173
195
  ]);
174
196
  g([]);
175
- const y = g((/* @__PURE__ */ new Date()).getFullYear()), U = g(!1), b = g(!1), M = g(!1), P = g({
197
+ const h = g((/* @__PURE__ */ new Date()).getFullYear()), R = g(!1), b = g(!1), V = g(!1), L = g({
176
198
  zIndex: 3,
177
199
  minWidth: 230,
178
200
  x: 500,
179
201
  y: 200
180
- }), p = g(!1), s = g("Сектор разработок и эксплуатации сети"), F = g([{ value: "Сектор разработок и эксплуатации сети", label: "Сектор разработок и эксплуатации сети" }]), O = g([{ value: y.value, label: y.value }, { value: y.value + 1, label: y.value + 1 }]), S = g(!1), C = g([]), L = g(!1), i = g({ name: "Имя", length: 0, code: "" });
181
- Q(s, async (l, t) => {
182
- l !== t && (C.value = [], U.value = !1, $.odata.personalManagerData.forEach((m) => {
183
- m.Status !== "Увольнение" && m.Group === l && (C.value.some((e) => (e == null ? void 0 : e.activeText) === m.Role) || C.value.push({ val: !0, activeText: m.Role }));
184
- }), R());
202
+ }), m = g(!1), v = g([]), C = g("Сектор разработок и эксплуатации сети"), j = g([{ value: "all", label: d("vacationSchedule.all"), key: "all" }]), S = g([{ value: h.value, label: h.value }, { value: h.value + 1, label: h.value + 1 }]), N = g(!1), $ = g([]), A = g(!1), i = g({ name: "Имя", length: 0, code: "" });
203
+ ee(C, async (e, t) => {
204
+ e !== t && ($.value = [], R.value = !1, M.odata.personalManagerData.forEach((o) => {
205
+ (o.Status !== "Увольнение" && o.Group === e || e === "all") && ($.value.some((l) => (l == null ? void 0 : l.activeText) === o.Role) || $.value.push({ val: !0, activeText: o.Role }));
206
+ }), z());
185
207
  });
186
- const x = ee(() => k.value.flatMap((l, t) => !l.days || l.days.length === 0 ? [{ ...l, key: 0, ids: t }] : l.days.map((m, e) => ({
208
+ const x = ae(() => k.value.flatMap((e, t) => !e.days || e.days.length === 0 ? [{ ...e, key: 0, ids: t }] : e.days.map((o, l) => ({
187
209
  ids: t,
188
- key: e,
189
- ...l,
190
- ...m
191
- })))), V = async () => {
192
- $.odata.getPersonalManagerData({}).then((l) => {
210
+ key: l,
211
+ ...e,
212
+ ...o
213
+ })))), I = async () => {
214
+ M.odata.getPersonalManagerData({}).then((e) => {
193
215
  var t;
194
- s.value = (t = l.find((m) => m.Status !== "Увольнение" && m.Description === $.fullName)) == null ? void 0 : t.Group, l.forEach((m) => {
195
- m.Status !== "Увольнение" && (F.value.some((e) => (e == null ? void 0 : e.value) === m.Group) || F.value.push({ value: m.Group, label: m.Group, key: m.Group }), m.Group === s.value && !C.value.some((e) => (e == null ? void 0 : e.activeText) === m.Role) && C.value.push({ val: !0, activeText: m.Role }));
196
- }), R(), b.value = !1;
216
+ C.value = (t = e.find((o) => o.Status !== "Увольнение" && o.Description === M.fullName)) == null ? void 0 : t.Group, e.forEach((o) => {
217
+ o.Status !== "Увольнение" && (j.value.some((l) => (l == null ? void 0 : l.value) === o.Group) || j.value.push({ value: o.Group, label: o.Group, key: o.Group }), o.Group === C.value && !$.value.some((l) => (l == null ? void 0 : l.activeText) === o.Role) && $.value.push({ val: !0, activeText: o.Role }));
218
+ }), z(), b.value = !1;
197
219
  });
198
- }, R = () => {
220
+ }, z = () => {
199
221
  k.value = [];
200
- let l = [];
201
- $.odata.personalManagerData.forEach((t) => {
202
- t.Status !== "Увольнение" && t.Group === s.value && C.value.some((m) => m.val && m.activeText === t.Role) && (l.push(t.Code), k.value.push({ name: t.Description, days: [{ note: "" }], jobTitle: t.Role, code: t.Code }));
203
- }), J(l), p.value = !1;
204
- }, J = (l) => {
205
- $.workSchedule.getAllVacations({ year: y.value }).then(
222
+ let e = [];
223
+ M.odata.personalManagerData.forEach((t) => {
224
+ t.Status !== "Увольнение" && (t.Group === C.value || C.value === "all") && $.value.some((o) => o.val && o.activeText === t.Role) && (e.push(t.Code), k.value.push({ name: t.Description, days: [{ note: "" }], jobTitle: t.Role, code: t.Code }));
225
+ }), W(e), m.value = !1;
226
+ }, W = (e) => {
227
+ M.workSchedule.getAllVacations({ year: h.value }).then(
206
228
  (t) => {
207
- console.log(l), l.forEach((m, e) => {
208
- k.value[e].days = [{ note: "" }], t.forEach((E) => {
209
- m === E.code && (console.log(E), typeof k.value[e].days[0].dateStart > "u" ? k.value[e].days[0] = {
210
- dateStart: I(E.dateStart, "{dd}.{m}.{Y}"),
211
- dateEnd: I(E.dateEnd, "{dd}.{m}.{Y}"),
229
+ console.log(e), e.forEach((o, l) => {
230
+ k.value[l].days = [{ note: "" }], t.forEach((E) => {
231
+ o === E.code && (console.log(E), typeof k.value[l].days[0].dateStart > "u" ? k.value[l].days[0] = {
232
+ dateStart: F(E.dateStart, "{dd}.{m}.{Y}"),
233
+ dateEnd: F(E.dateEnd, "{dd}.{m}.{Y}"),
212
234
  note: E.note,
213
235
  count: E.count
214
- } : k.value[e].days.push({
215
- dateStart: I(E.dateStart, "{dd}.{m}.{Y}"),
216
- dateEnd: I(E.dateEnd, "{dd}.{m}.{Y}"),
236
+ } : k.value[l].days.push({
237
+ dateStart: F(E.dateStart, "{dd}.{m}.{Y}"),
238
+ dateEnd: F(E.dateEnd, "{dd}.{m}.{Y}"),
217
239
  note: E.note,
218
240
  count: E.count
219
241
  }));
@@ -221,206 +243,208 @@ const pe = (G, $) => {
221
243
  });
222
244
  }
223
245
  );
224
- }, W = (l) => {
225
- if (l.columnIndex < 3 && x.value[l.rowIndex].key < x.value[l.rowIndex].days.length)
226
- return x.value[l.rowIndex].key === 0 ? {
227
- rowspan: x.value[l.rowIndex].days.length,
246
+ }, X = (e) => {
247
+ if (e.columnIndex < 3 && x.value[e.rowIndex].key < x.value[e.rowIndex].days.length)
248
+ return x.value[e.rowIndex].key === 0 ? {
249
+ rowspan: x.value[e.rowIndex].days.length,
228
250
  colspan: 1
229
251
  } : {
230
252
  rowspan: 0,
231
253
  colspan: 0
232
254
  };
233
- }, X = (l, t, m, e) => {
234
- i.value.ids = l.ids, i.value.key = l.key, i.value.startDate = l.dateStart, i.value.endDate = l.dateEnd, i.value.name = l.name, i.value.count = l.count, i.value.length = l.days.length, i.value.add = l.days.length > 0 && l.days[l.days.length - 1].count, i.value.level = t.level, P.value.y = e.clientY, P.value.x = e.clientX, t.level === 2 && t.no < 4 && (i.value.add || l.days.length > 1) && (M.value = !0), t.level === 3 && (M.value = !0);
235
- }, f = (l) => {
236
- console.log(l);
255
+ }, q = (e, t, o, l) => {
256
+ i.value.ids = e.ids, i.value.key = e.key, i.value.startDate = e.dateStart, i.value.endDate = e.dateEnd, i.value.name = e.name, i.value.count = e.count, i.value.length = e.days.length, i.value.add = e.days.length > 0 && e.days[e.days.length - 1].count, i.value.level = t.level, i.value.holiday = v.value, L.value.y = l.clientY, L.value.x = l.clientX, t.level === 2 && t.no < 4 && (i.value.add || e.days.length > 1) && (V.value = !0), t.level === 3 && (V.value = !0);
257
+ }, r = (e) => {
258
+ console.log(e);
237
259
  let t = k.value[i.value.ids];
238
- switch (l) {
260
+ switch (e) {
239
261
  case "add":
240
262
  t.days.push({ note: "" }), console.log(t.days.length);
241
263
  break;
242
264
  case "delete":
243
- delete t.days.pop(), o(i.value.ids);
265
+ delete t.days.pop(), n(i.value.ids);
244
266
  break;
245
267
  }
246
- M.value = !1;
247
- }, n = (l) => {
248
- L.value = l, i.value.count = l.count;
249
- }, d = () => {
250
- L.value && (k.value[i.value.ids].days[i.value.key] = { ...L.value, note: "" }, o(i.value.ids)), M.value = !1;
251
- }, o = (l) => {
252
- $.workSchedule.rewriteFull({
253
- year: y.value,
254
- code: k.value[l].code,
255
- data: k.value[l].days.map((t) => (t.dateStart = t.dateStart.split(".").reverse().join("-"), t.dateEnd = t.dateEnd.split(".").reverse().join("-"), t))
268
+ V.value = !1;
269
+ }, u = (e) => {
270
+ A.value = e, i.value.count = e.count;
271
+ }, s = () => {
272
+ A.value && (k.value[i.value.ids].days[i.value.key] = { ...A.value, note: "" }, n(i.value.ids)), V.value = !1;
273
+ }, n = (e) => {
274
+ M.workSchedule.rewriteFull({
275
+ year: h.value,
276
+ code: k.value[e].code,
277
+ data: k.value[e].days.map((t) => (t.dateStart = t.dateStart.split(".").reverse().join("-"), t.dateEnd = t.dateEnd.split(".").reverse().join("-"), t))
256
278
  });
257
279
  };
258
- return V(), (l, t) => {
259
- const m = ae("loading");
260
- return h(), w("div", null, [
261
- G.checkEdit ? (h(), T(a(K), {
280
+ return ne().then((e) => {
281
+ v.value = e, I();
282
+ }), (e, t) => {
283
+ const o = le("loading");
284
+ return y(), w("div", null, [
285
+ O.checkEdit ? (y(), T(a(Z), {
262
286
  key: 0,
263
- modelValue: s.value,
264
- "onUpdate:modelValue": t[0] || (t[0] = (e) => s.value = e),
287
+ modelValue: C.value,
288
+ "onUpdate:modelValue": t[0] || (t[0] = (l) => C.value = l),
265
289
  placeholder: "Select",
266
290
  style: { width: "240px", "margin-bottom": ".5rem", "margin-right": ".5rem" }
267
291
  }, {
268
- default: r(() => [
269
- (h(!0), w(B, null, z(F.value, (e) => (h(), T(a(Z), {
270
- key: e.value,
271
- label: e.label,
272
- value: e.value
292
+ default: p(() => [
293
+ (y(!0), w(U, null, P(j.value, (l) => (y(), T(a(Q), {
294
+ key: l.value,
295
+ label: l.label,
296
+ value: l.value
273
297
  }, null, 8, ["label", "value"]))), 128))
274
298
  ]),
275
299
  _: 1
276
300
  }, 8, ["modelValue"])) : Y("", !0),
277
- v(a(j), {
301
+ c(a(B), {
278
302
  plain: "",
279
- onClick: t[1] || (t[1] = (e) => p.value = !0),
303
+ onClick: t[1] || (t[1] = (l) => m.value = !0),
280
304
  style: { "margin-bottom": ".5rem" }
281
305
  }, {
282
- default: r(() => [
283
- _(D(a(u)("workSchedule.jobTitle")), 1)
306
+ default: p(() => [
307
+ _(D(a(d)("workSchedule.jobTitle")), 1)
284
308
  ]),
285
309
  _: 1
286
310
  }),
287
- v(a(K), {
288
- modelValue: y.value,
289
- "onUpdate:modelValue": t[2] || (t[2] = (e) => y.value = e),
290
- onChange: R,
311
+ c(a(Z), {
312
+ modelValue: h.value,
313
+ "onUpdate:modelValue": t[2] || (t[2] = (l) => h.value = l),
314
+ onChange: z,
291
315
  placeholder: "Year",
292
316
  style: { width: "240px", "margin-bottom": ".5rem", "margin-right": ".5rem" }
293
317
  }, {
294
- default: r(() => [
295
- (h(!0), w(B, null, z(O.value, (e) => (h(), T(a(Z), {
296
- key: e.value,
297
- label: e.label,
298
- value: e.value
318
+ default: p(() => [
319
+ (y(!0), w(U, null, P(S.value, (l) => (y(), T(a(Q), {
320
+ key: l.value,
321
+ label: l.label,
322
+ value: l.value
299
323
  }, null, 8, ["label", "value"]))), 128))
300
324
  ]),
301
325
  _: 1
302
326
  }, 8, ["modelValue"]),
303
- v(a(ne), {
327
+ c(a(oe), {
304
328
  style: { width: "100%" },
305
329
  loading: b.value,
306
330
  animated: ""
307
331
  }, {
308
- template: r(() => [
309
- v(a(A), {
332
+ template: p(() => [
333
+ c(a(J), {
310
334
  variant: "text",
311
335
  style: { width: "100%", height: "2rem" }
312
336
  }),
313
- v(a(A), {
337
+ c(a(J), {
314
338
  variant: "text",
315
339
  style: { width: "180px", height: "4rem", "margin-right": "4px" }
316
340
  }),
317
- v(a(A), {
341
+ c(a(J), {
318
342
  variant: "text",
319
343
  style: { width: "calc( 100% - 184px)", height: "4rem" }
320
344
  }),
321
- v(a(A), {
345
+ c(a(J), {
322
346
  variant: "text",
323
347
  style: { width: "180px", height: "8rem", "margin-right": "4px" }
324
348
  }),
325
- v(a(A), {
349
+ c(a(J), {
326
350
  variant: "text",
327
351
  style: { width: "calc( 100% - 184px)", height: "8rem" }
328
352
  })
329
353
  ]),
330
- default: r(() => [
331
- v(a(ue), {
354
+ default: p(() => [
355
+ c(a(de), {
332
356
  id: "printTable",
333
357
  data: x.value,
334
- "span-method": W,
335
- onCellClick: X,
358
+ "span-method": X,
359
+ onCellClick: q,
336
360
  border: "",
337
361
  style: { width: "100%" },
338
362
  size: "small",
339
- "empty-text": a(u)("vacationSchedule.emptyText")
363
+ "empty-text": a(d)("vacationSchedule.emptyText")
340
364
  }, {
341
- default: r(() => [
342
- v(a(N), {
343
- label: a(u)("vacationSchedule.title", { name: s.value }) + ` ${y.value}`,
365
+ default: p(() => [
366
+ c(a(G), {
367
+ label: C.value !== "all" ? a(d)("vacationSchedule.title", { name: C.value }) : a(d)("vacationSchedule.enterprise") + ` ${h.value}`,
344
368
  align: "center",
345
369
  height: "34"
346
370
  }, {
347
- default: r(() => [
348
- v(a(N), {
349
- label: a(u)("vacationSchedule.jobTitle"),
371
+ default: p(() => [
372
+ c(a(G), {
373
+ label: a(d)("vacationSchedule.jobTitle"),
350
374
  width: "180",
351
375
  align: "center"
352
376
  }, {
353
- default: r((e) => [
354
- _(D(x.value[e.$index].jobTitle), 1)
377
+ default: p((l) => [
378
+ _(D(x.value[l.$index].jobTitle), 1)
355
379
  ]),
356
380
  _: 1
357
381
  }, 8, ["label"]),
358
- v(a(N), {
359
- label: a(u)("vacationSchedule.fullName"),
382
+ c(a(G), {
383
+ label: a(d)("vacationSchedule.fullName"),
360
384
  width: "180",
361
385
  align: "center"
362
386
  }, {
363
- default: r((e) => [
364
- _(D(x.value[e.$index].name), 1)
387
+ default: p((l) => [
388
+ _(D(x.value[l.$index].name), 1)
365
389
  ]),
366
390
  _: 1
367
391
  }, 8, ["label"]),
368
- v(a(N), {
369
- label: a(u)("vacationSchedule.personnelNumber"),
392
+ c(a(G), {
393
+ label: a(d)("vacationSchedule.personnelNumber"),
370
394
  align: "center"
371
395
  }, {
372
- default: r((e) => [
373
- _(D(x.value[e.$index].code), 1)
396
+ default: p((l) => [
397
+ _(D(x.value[l.$index].code), 1)
374
398
  ]),
375
399
  _: 1
376
400
  }, 8, ["label"]),
377
- v(a(N), {
378
- label: a(u)("vacationSchedule.vacation"),
401
+ c(a(G), {
402
+ label: a(d)("vacationSchedule.vacation"),
379
403
  align: "center"
380
404
  }, {
381
- default: r(() => [
382
- v(a(N), {
383
- label: a(u)("vacationSchedule.days"),
405
+ default: p(() => [
406
+ c(a(G), {
407
+ label: a(d)("vacationSchedule.days"),
384
408
  align: "center"
385
409
  }, {
386
- default: r((e) => [
387
- _(D(x.value[e.$index].count), 1)
410
+ default: p((l) => [
411
+ _(D(x.value[l.$index].count), 1)
388
412
  ]),
389
413
  _: 1
390
414
  }, 8, ["label"]),
391
- v(a(N), {
392
- label: a(u)("vacationSchedule.date"),
415
+ c(a(G), {
416
+ label: a(d)("vacationSchedule.date"),
393
417
  align: "center"
394
418
  }, {
395
- default: r((e) => [
396
- _(D(x.value[e.$index].dateStart), 1)
419
+ default: p((l) => [
420
+ _(D(x.value[l.$index].dateStart), 1)
397
421
  ]),
398
422
  _: 1
399
423
  }, 8, ["label"]),
400
- v(a(N), {
401
- label: a(u)("vacationSchedule.endDate"),
424
+ c(a(G), {
425
+ label: a(d)("vacationSchedule.endDate"),
402
426
  align: "center"
403
427
  }, {
404
- default: r((e) => [
405
- _(D(x.value[e.$index].dateEnd), 1)
428
+ default: p((l) => [
429
+ _(D(x.value[l.$index].dateEnd), 1)
406
430
  ]),
407
431
  _: 1
408
432
  }, 8, ["label"])
409
433
  ]),
410
434
  _: 1
411
435
  }, 8, ["label"]),
412
- v(a(N), {
413
- label: a(u)("vacationSchedule.note"),
436
+ c(a(G), {
437
+ label: a(d)("vacationSchedule.note"),
414
438
  align: "center"
415
439
  }, {
416
- default: r((e) => [
417
- v(a(oe), {
418
- modelValue: k.value[x.value[e.$index].ids].days[x.value[e.$index].key].note,
419
- "onUpdate:modelValue": (E) => k.value[x.value[e.$index].ids].days[x.value[e.$index].key].note = E,
440
+ default: p((l) => [
441
+ c(a(se), {
442
+ modelValue: k.value[x.value[l.$index].ids].days[x.value[l.$index].key].note,
443
+ "onUpdate:modelValue": (E) => k.value[x.value[l.$index].ids].days[x.value[l.$index].key].note = E,
420
444
  style: { width: "100%" },
421
445
  placeholder: " ",
422
446
  class: "noBorder",
423
- onBlur: (E) => o(x.value[e.$index].ids)
447
+ onBlur: (E) => n(x.value[l.$index].ids)
424
448
  }, null, 8, ["modelValue", "onUpdate:modelValue", "onBlur"])
425
449
  ]),
426
450
  _: 1
@@ -434,91 +458,91 @@ const pe = (G, $) => {
434
458
  ]),
435
459
  _: 1
436
460
  }, 8, ["loading"]),
437
- G.checkEdit ? (h(), w("div", $e, [
438
- U.value ? Y("", !0) : (h(), T(a(j), {
461
+ O.checkEdit ? (y(), w("div", Ve, [
462
+ R.value ? Y("", !0) : (y(), T(a(B), {
439
463
  key: 0,
440
464
  type: "primary",
441
- onClick: l.confirmData
465
+ onClick: e.confirmData
442
466
  }, {
443
- default: r(() => [
444
- _(D(a(u)("vacationSchedule.sendInformation")), 1)
467
+ default: p(() => [
468
+ _(D(a(d)("vacationSchedule.sendInformation")), 1)
445
469
  ]),
446
470
  _: 1
447
471
  }, 8, ["onClick"])),
448
- U.value ? Y("", !0) : (h(), T(a(j), {
472
+ R.value ? Y("", !0) : (y(), T(a(B), {
449
473
  key: 1,
450
474
  type: "primary",
451
- onClick: l.confirmData
475
+ onClick: e.confirmData
452
476
  }, {
453
- default: r(() => [
454
- _(D(a(u)("vacationSchedule.agreeOn")), 1)
477
+ default: p(() => [
478
+ _(D(a(d)("vacationSchedule.agreeOn")), 1)
455
479
  ]),
456
480
  _: 1
457
481
  }, 8, ["onClick"])),
458
- U.value ? Y("", !0) : (h(), T(a(j), {
482
+ R.value ? Y("", !0) : (y(), T(a(B), {
459
483
  key: 2,
460
484
  type: "primary",
461
- onClick: l.confirmData
485
+ onClick: e.confirmData
462
486
  }, {
463
- default: r(() => [
464
- _(D(a(u)("vacationSchedule.reject")), 1)
487
+ default: p(() => [
488
+ _(D(a(d)("vacationSchedule.reject")), 1)
465
489
  ]),
466
490
  _: 1
467
491
  }, 8, ["onClick"]))
468
492
  ])) : Y("", !0),
469
- le((h(), T(a(j), {
470
- disabled: S.value,
493
+ te((y(), T(a(B), {
494
+ disabled: N.value,
471
495
  plain: "",
472
- onClick: l.exportToExcel,
496
+ onClick: e.exportToExcel,
473
497
  style: { "margin-top": ".5rem" }
474
498
  }, {
475
- default: r(() => [
476
- _(D(a(u)("workSchedule.exportExcel")), 1)
499
+ default: p(() => [
500
+ _(D(a(d)("workSchedule.exportExcel")), 1)
477
501
  ]),
478
502
  _: 1
479
503
  }, 8, ["disabled", "onClick"])), [
480
- [m, S.value]
504
+ [o, N.value]
481
505
  ]),
482
- v(a(de), {
483
- title: a(u)("workSchedule.jobTitle"),
484
- modelValue: p.value,
485
- "onUpdate:modelValue": t[4] || (t[4] = (e) => p.value = e),
506
+ c(a(ve), {
507
+ title: a(d)("workSchedule.jobTitle"),
508
+ modelValue: m.value,
509
+ "onUpdate:modelValue": t[4] || (t[4] = (l) => m.value = l),
486
510
  width: "400px"
487
511
  }, {
488
- footer: r(() => [
489
- v(a(j), {
490
- onClick: t[3] || (t[3] = (e) => p.value = !1),
512
+ footer: p(() => [
513
+ c(a(B), {
514
+ onClick: t[3] || (t[3] = (l) => m.value = !1),
491
515
  size: "default"
492
516
  }, {
493
- default: r(() => [
494
- _(D(l.$t("workSchedule.cancel")), 1)
517
+ default: p(() => [
518
+ _(D(e.$t("workSchedule.cancel")), 1)
495
519
  ]),
496
520
  _: 1
497
521
  }),
498
- v(a(j), {
522
+ c(a(B), {
499
523
  size: "default",
500
524
  type: "primary",
501
- onClick: R
525
+ onClick: z
502
526
  }, {
503
- default: r(() => [
504
- _(D(l.$t("workSchedule.select")), 1)
527
+ default: p(() => [
528
+ _(D(e.$t("workSchedule.select")), 1)
505
529
  ]),
506
530
  _: 1
507
531
  })
508
532
  ]),
509
- default: r(() => [
510
- v(a(ve), {
533
+ default: p(() => [
534
+ c(a(ie), {
511
535
  ref: "dialogForm",
512
- model: C.value,
536
+ model: $.value,
513
537
  autocomplete: "on"
514
538
  }, {
515
- default: r(() => [
516
- (h(!0), w(B, null, z(C.value, (e) => (h(), T(a(se), null, {
517
- default: r(() => [
518
- v(a(ie), {
519
- modelValue: e.val,
520
- "onUpdate:modelValue": (E) => e.val = E,
521
- "active-text": e.activeText
539
+ default: p(() => [
540
+ (y(!0), w(U, null, P($.value, (l) => (y(), T(a(re), null, {
541
+ default: p(() => [
542
+ c(a(ce), {
543
+ modelValue: l.val,
544
+ "onUpdate:modelValue": (E) => l.val = E,
545
+ "active-text": l.activeText
522
546
  }, null, 8, ["modelValue", "onUpdate:modelValue", "active-text"])
523
547
  ]),
524
548
  _: 2
@@ -529,46 +553,46 @@ const pe = (G, $) => {
529
553
  ]),
530
554
  _: 1
531
555
  }, 8, ["title", "modelValue"]),
532
- v(a(re), {
533
- show: M.value,
534
- "onUpdate:show": t[8] || (t[8] = (e) => M.value = e),
535
- options: P.value
556
+ c(a(he), {
557
+ show: V.value,
558
+ "onUpdate:show": t[8] || (t[8] = (l) => V.value = l),
559
+ options: L.value
536
560
  }, {
537
- default: r(() => [
538
- v(a(q), {
539
- label: i.value.level === 3 && typeof i.value.count < "u" ? i.value.name + " " + i.value.count + " " + a(u)("vacationSchedule.day", i.value.count) : i.value.name,
561
+ default: p(() => [
562
+ c(a(H), {
563
+ label: i.value.level === 3 && typeof i.value.count < "u" ? i.value.name + " " + i.value.count + " " + a(d)("vacationSchedule.day", i.value.count) : i.value.name,
540
564
  disabled: ""
541
565
  }, null, 8, ["label"]),
542
- v(a(ce)),
543
- i.value.level === 2 ? (h(), w("div", Me, [
544
- i.value.length > 1 ? (h(), T(a(q), {
566
+ c(a(pe)),
567
+ i.value.level === 2 ? (y(), w("div", Ie, [
568
+ i.value.length > 1 ? (y(), T(a(H), {
545
569
  key: 0,
546
- label: a(u)("vacationSchedule.deleteLast"),
547
- onClick: t[5] || (t[5] = (e) => f("delete"))
570
+ label: a(d)("vacationSchedule.deleteLast"),
571
+ onClick: t[5] || (t[5] = (l) => r("delete"))
548
572
  }, null, 8, ["label"])) : Y("", !0),
549
- i.value.add ? (h(), T(a(q), {
573
+ i.value.add ? (y(), T(a(H), {
550
574
  key: 1,
551
- label: a(u)("vacationSchedule.addVacation"),
552
- onClick: t[6] || (t[6] = (e) => f("add"))
575
+ label: a(d)("vacationSchedule.addVacation"),
576
+ onClick: t[6] || (t[6] = (l) => r("add"))
553
577
  }, null, 8, ["label"])) : Y("", !0)
554
- ])) : (h(), w("div", Ve, [
555
- v(_e, {
578
+ ])) : (y(), w("div", Te, [
579
+ c(Me, {
556
580
  data: i.value,
557
581
  range: "range",
558
- onInput: n
582
+ onInput: u
559
583
  }, null, 8, ["data"]),
560
- c("div", null, [
561
- v(a(j), {
562
- onClick: t[7] || (t[7] = (e) => M.value = !1)
584
+ f("div", null, [
585
+ c(a(B), {
586
+ onClick: t[7] || (t[7] = (l) => V.value = !1)
563
587
  }, {
564
- default: r(() => [
565
- _(D(a(u)("vacationSchedule.cancel")), 1)
588
+ default: p(() => [
589
+ _(D(a(d)("vacationSchedule.cancel")), 1)
566
590
  ]),
567
591
  _: 1
568
592
  }),
569
- v(a(j), { onClick: d }, {
570
- default: r(() => [
571
- _(D(a(u)("vacationSchedule.save")), 1)
593
+ c(a(B), { onClick: s }, {
594
+ default: p(() => [
595
+ _(D(a(d)("vacationSchedule.save")), 1)
572
596
  ]),
573
597
  _: 1
574
598
  })
@@ -582,5 +606,5 @@ const pe = (G, $) => {
582
606
  }
583
607
  };
584
608
  export {
585
- Ne as default
609
+ Ge as default
586
610
  };