@feedmepos/mf-hrm-portal 2.0.18-dev → 2.0.18-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AuditLogList-D4E8pss5.js +1037 -0
- package/dist/{EmployeeList-DcMvF9U5.js → EmployeeList-BfJO89pN.js} +302 -314
- package/dist/FormItem.vue_vue_type_script_setup_true_lang-D3MOFOUI.js +45 -0
- package/dist/{Main-CvW6Vu8N.js → Main-BbOMNP31.js} +9 -9
- package/dist/{Main-D7k57uq5.js → Main-XmxzThcC.js} +7 -8
- package/dist/{Main-CleutFvF.js → Main-dqgR1UXY.js} +11 -12
- package/dist/{PermissionSetList-CM7kbWkO.js → PermissionSetList-DO0PRS6Z.js} +6 -6
- package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Ces9YwYB.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-DL4_xvBZ.js} +708 -708
- package/dist/{RoleList-DR3eVJ9f.js → RoleList-DB3NfUYF.js} +7 -7
- package/dist/TeamMemberList-4hEx6L5r.js +1090 -0
- package/dist/{TimesheetList-WqqoKPbg.js → TimesheetList-D29EFj1Q.js} +6 -6
- package/dist/{app-R5EioPr4.js → app-SadE2J6-.js} +4 -4
- package/dist/app.js +1 -1
- package/dist/{dayjs.min-CN15Ft3o.js → dayjs.min-DKCxxK08.js} +1 -1
- package/dist/{employee-DwQlWLkL.js → employee-3KJs872J.js} +3 -3
- package/dist/{iteration-UBGGRoxQ.js → iteration-QZxp7XeE.js} +1 -1
- package/dist/{lodash-CC6qHVUo.js → lodash-DrksHyHu.js} +1 -1
- package/dist/{rule-B519XbW6.js → rule-CSsgDC6F.js} +2 -2
- package/dist/{timesheet-BylrXRfd.js → timesheet-sBe_HCZh.js} +2 -2
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{useAppStore-Akl8AoVN.js → useAppStore-BDADkWuX.js} +1 -1
- package/dist/useDebounce-CWb5QR9G.js +28 -0
- package/dist/{useLoading-rbrVwWuj.js → useLoading-PTqnaz_W.js} +1 -1
- package/dist/{useReportPermissions-BOEZU86S.js → useReportPermissions-C3Uzu7vB.js} +3 -3
- package/package.json +1 -1
- package/dist/AuditLogList-CaoW9uYd.js +0 -1011
- package/dist/FormItem.vue_vue_type_script_setup_true_lang-CoorkndT.js +0 -34
- package/dist/Skeleton.vue_vue_type_script_setup_true_lang-B4PxNMwq.js +0 -16
- package/dist/TeamMemberList-CZZv4Pu5.js +0 -1038
- package/dist/team-BGLhgx5P.js +0 -33
- package/dist/useSearch-BAPEUu1R.js +0 -15
|
@@ -1,41 +1,29 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toRaw as je, defineComponent as Me, ref as v, computed as I, watch as ae, resolveComponent as g, createElementBlock as j, openBlock as _, Fragment as pe, renderSlot as Ge, createVNode as u, unref as s, withCtx as b, createElementVNode as c, createBlock as B, createCommentVNode as T, toDisplayString as D, renderList as Le, withKeys as Fe, withModifiers as te, normalizeClass as Ae, onUnmounted as qe, isRef as Ie, createTextVNode as We, h as ce } from "vue";
|
|
2
2
|
import { useI18n as Pe, useCoreStore as He } from "@feedmepos/mf-common";
|
|
3
3
|
import { useSnackbar as De, components as Ne, useDialog as Je, useBreakpoints as Qe } from "@feedmepos/ui-library";
|
|
4
|
-
import { S as
|
|
5
|
-
import { _ as Ze, a as Xe } from "./app-
|
|
6
|
-
import { _ as ke,
|
|
7
|
-
import { u as
|
|
8
|
-
import { _ as
|
|
9
|
-
import { _ as Se } from "./
|
|
10
|
-
import { u as
|
|
11
|
-
import { u as
|
|
12
|
-
import {
|
|
13
|
-
import { l as ra } from "./lodash-CC6qHVUo.js";
|
|
4
|
+
import { S as me, _ as Ye } from "./SelectFilter-DUj7GBtT.js";
|
|
5
|
+
import { _ as Ze, a as Xe } from "./app-SadE2J6-.js";
|
|
6
|
+
import { _ as ke, u as ea, H as aa } from "./FormItem.vue_vue_type_script_setup_true_lang-D3MOFOUI.js";
|
|
7
|
+
import { u as ta, _ as la } from "./useDiscardConfirm-DPhEV6v0.js";
|
|
8
|
+
import { _ as sa } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
|
|
9
|
+
import { u as oa, _ as Se } from "./useDebounce-CWb5QR9G.js";
|
|
10
|
+
import { u as Oe, E as ra } from "./employee-3KJs872J.js";
|
|
11
|
+
import { u as ze } from "./iteration-QZxp7XeE.js";
|
|
12
|
+
import { l as na } from "./lodash-DrksHyHu.js";
|
|
14
13
|
import { _ as Re } from "./FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js";
|
|
15
|
-
import { u as
|
|
16
|
-
import { u as xe } from "./useAppStore-
|
|
14
|
+
import { u as Ke } from "./useLoading-PTqnaz_W.js";
|
|
15
|
+
import { u as xe } from "./useAppStore-BDADkWuX.js";
|
|
17
16
|
/* empty css */
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
const p = J(C, (Y) => {
|
|
21
|
-
y && clearTimeout(y), y = setTimeout(() => {
|
|
22
|
-
Q(Y);
|
|
23
|
-
}, u);
|
|
24
|
-
});
|
|
25
|
-
return () => {
|
|
26
|
-
p(), y && (clearTimeout(y), y = void 0);
|
|
27
|
-
};
|
|
17
|
+
function Ue(N) {
|
|
18
|
+
return JSON.parse(JSON.stringify(N));
|
|
28
19
|
}
|
|
29
|
-
function
|
|
30
|
-
return JSON.parse(JSON.stringify(C));
|
|
31
|
-
}
|
|
32
|
-
function Ce(C) {
|
|
20
|
+
function Ce(N) {
|
|
33
21
|
if (typeof structuredClone > "u")
|
|
34
|
-
return Ue(
|
|
22
|
+
return Ue(N);
|
|
35
23
|
try {
|
|
36
|
-
return structuredClone(je(
|
|
24
|
+
return structuredClone(je(N));
|
|
37
25
|
} catch {
|
|
38
|
-
return Ue(
|
|
26
|
+
return Ue(N);
|
|
39
27
|
}
|
|
40
28
|
}
|
|
41
29
|
const ua = { class: "fm-typo-en-title-md-600" }, ia = { class: "space-y-40" }, da = { class: "flex flex-row gap-16" }, ca = { class: "space-y-16" }, ma = { class: "rounded-lg border border-fm-color-neutral-gray-200 p-16 space-y-16" }, pa = { class: "fm-typo-en-title-sm-600" }, fa = { class: "space-y-16" }, va = { class: "grid grid-cols-[minmax(0,1fr)_minmax(0,1fr)_auto] gap-16" }, ya = { class: "text-sm font-semibold text-fm-color-typo-primary" }, ha = { class: "text-sm font-semibold text-fm-color-typo-primary" }, ga = { class: "flex justify-self-end" }, _a = ["aria-label", "onClick", "onKeydown"], ba = { class: "flex gap-8 items-center justify-start" }, $e = 4, wa = /* @__PURE__ */ Me({
|
|
@@ -47,32 +35,32 @@ const ua = { class: "fm-typo-en-title-md-600" }, ia = { class: "space-y-40" }, d
|
|
|
47
35
|
}
|
|
48
36
|
},
|
|
49
37
|
emits: ["submitted"],
|
|
50
|
-
setup(
|
|
51
|
-
const
|
|
38
|
+
setup(N, { expose: fe, emit: i }) {
|
|
39
|
+
const V = xe(), f = ze(), U = Oe(), ve = De(), L = Ke(ve), ye = i, { t: d } = Pe(), w = v(!1), A = v(!0);
|
|
52
40
|
function G() {
|
|
53
41
|
return {
|
|
54
42
|
restaurantId: "",
|
|
55
43
|
roleId: ""
|
|
56
44
|
};
|
|
57
45
|
}
|
|
58
|
-
function
|
|
59
|
-
if (!r) return
|
|
46
|
+
function le(r) {
|
|
47
|
+
if (!r) return J();
|
|
60
48
|
const t = Ce(r);
|
|
61
49
|
return {
|
|
62
50
|
code: t.code ?? "",
|
|
63
51
|
isMasterUser: t.isMasterUser ?? !1,
|
|
64
52
|
name: t.name ?? "",
|
|
65
53
|
passcode: t.passcode ?? "",
|
|
66
|
-
restaurants: t.restaurants.length > 0 ? t.restaurants.map(({ restaurantId: n, roleId:
|
|
54
|
+
restaurants: t.restaurants.length > 0 ? t.restaurants.map(({ restaurantId: n, roleId: y }) => ({
|
|
67
55
|
restaurantId: n,
|
|
68
|
-
roleId:
|
|
56
|
+
roleId: y
|
|
69
57
|
})) : [G()]
|
|
70
58
|
};
|
|
71
59
|
}
|
|
72
|
-
const
|
|
73
|
-
l.value =
|
|
60
|
+
const se = (r) => {
|
|
61
|
+
l.value = le(r), C.value = Ce(l.value), x.value = r == null ? void 0 : r._id, E.value = [], l.value.passcode && (E.value = l.value.passcode.split(""), O.value = !0), A.value = !r, w.value = !0;
|
|
74
62
|
};
|
|
75
|
-
function
|
|
63
|
+
function J() {
|
|
76
64
|
return {
|
|
77
65
|
code: "",
|
|
78
66
|
isMasterUser: !1,
|
|
@@ -81,30 +69,30 @@ const ua = { class: "fm-typo-en-title-md-600" }, ia = { class: "space-y-40" }, d
|
|
|
81
69
|
restaurants: [G()]
|
|
82
70
|
};
|
|
83
71
|
}
|
|
84
|
-
const
|
|
72
|
+
const k = I(() => A.value ? d("hr.employee.form.add") : d("hr.employee.form.update")), q = I(() => A.value ? d("common.create") : d("common.update")), C = v(J()), l = v(J()), x = v(void 0), oe = I(
|
|
85
73
|
() => l.value.restaurants.map((r) => r.restaurantId).filter(Boolean)
|
|
86
74
|
);
|
|
87
|
-
function
|
|
75
|
+
function S(r) {
|
|
88
76
|
var t;
|
|
89
|
-
return r ? !((t =
|
|
77
|
+
return r ? !((t = f.restaurants.value.find((n) => n._id === r)) != null && t.managable) : !1;
|
|
90
78
|
}
|
|
91
|
-
function
|
|
92
|
-
return
|
|
79
|
+
function re(r = "") {
|
|
80
|
+
return f.restaurants.value.filter((t) => t.managable || t._id === r).map((t) => ({
|
|
93
81
|
label: `${t.profile.code ? `${t.profile.code} - ` : ""}${t.profile.name}`,
|
|
94
82
|
value: t._id,
|
|
95
|
-
disabled:
|
|
83
|
+
disabled: oe.value.includes(t._id) && t._id !== r
|
|
96
84
|
}));
|
|
97
85
|
}
|
|
98
|
-
function
|
|
99
|
-
return r ?
|
|
86
|
+
function Q(r, t = "") {
|
|
87
|
+
return r ? V.roles.value.filter((n) => n.restaurants.some((y) => y.id == r)).map((n) => ({
|
|
100
88
|
label: n.name,
|
|
101
89
|
value: n._id,
|
|
102
90
|
disabled: !n.isUsable && n._id !== t
|
|
103
91
|
})) : [];
|
|
104
92
|
}
|
|
105
93
|
function he(r, t) {
|
|
106
|
-
var
|
|
107
|
-
const n = ((
|
|
94
|
+
var h, R, K, P;
|
|
95
|
+
const n = ((h = l.value.restaurants[r]) == null ? void 0 : h.roleId) ?? "", y = Q(t, n), F = ((R = y.find((M) => M.value === n && !M.disabled)) == null ? void 0 : R.value) ?? ((K = y.find((M) => !M.disabled)) == null ? void 0 : K.value) ?? ((P = y[0]) == null ? void 0 : P.value) ?? "";
|
|
108
96
|
l.value.restaurants[r] = {
|
|
109
97
|
restaurantId: t,
|
|
110
98
|
roleId: F
|
|
@@ -119,7 +107,7 @@ const ua = { class: "fm-typo-en-title-md-600" }, ia = { class: "space-y-40" }, d
|
|
|
119
107
|
G()
|
|
120
108
|
];
|
|
121
109
|
}
|
|
122
|
-
function
|
|
110
|
+
function Y(r) {
|
|
123
111
|
if (l.value.restaurants.length === 1) {
|
|
124
112
|
l.value.restaurants = [G()];
|
|
125
113
|
return;
|
|
@@ -128,31 +116,31 @@ const ua = { class: "fm-typo-en-title-md-600" }, ia = { class: "space-y-40" }, d
|
|
|
128
116
|
(t, n) => n !== r
|
|
129
117
|
);
|
|
130
118
|
}
|
|
131
|
-
const
|
|
132
|
-
const r =
|
|
133
|
-
(n) => n.managable && !
|
|
119
|
+
const W = I(() => {
|
|
120
|
+
const r = f.restaurants.value.some(
|
|
121
|
+
(n) => n.managable && !oe.value.includes(n._id)
|
|
134
122
|
), t = l.value.restaurants.every(
|
|
135
123
|
(n) => n.restaurantId && n.roleId
|
|
136
124
|
);
|
|
137
125
|
return r && t;
|
|
138
126
|
}), E = v([]), O = v(!1);
|
|
139
|
-
function
|
|
127
|
+
function Z() {
|
|
140
128
|
O.value && (O.value = !1, E.value = []);
|
|
141
129
|
}
|
|
142
|
-
const
|
|
143
|
-
async function
|
|
144
|
-
|
|
130
|
+
const $ = v(!1), z = v(!1);
|
|
131
|
+
async function ne() {
|
|
132
|
+
z.value = !0;
|
|
145
133
|
try {
|
|
146
|
-
const r = await
|
|
134
|
+
const r = await ra.generateEmployeePasscode();
|
|
147
135
|
O.value = !1, E.value = r.split("");
|
|
148
136
|
} finally {
|
|
149
|
-
|
|
137
|
+
z.value = !1;
|
|
150
138
|
}
|
|
151
139
|
}
|
|
152
|
-
const
|
|
153
|
-
() => !
|
|
140
|
+
const X = ta(
|
|
141
|
+
() => !na.isEqual(l.value, C.value),
|
|
154
142
|
() => {
|
|
155
|
-
|
|
143
|
+
w.value = !1;
|
|
156
144
|
}
|
|
157
145
|
);
|
|
158
146
|
async function be() {
|
|
@@ -164,113 +152,113 @@ const ua = { class: "fm-typo-en-title-md-600" }, ia = { class: "space-y-40" }, d
|
|
|
164
152
|
},
|
|
165
153
|
roles: l.value.restaurants
|
|
166
154
|
};
|
|
167
|
-
l.value.isMasterUser ? await
|
|
155
|
+
l.value.isMasterUser ? await U.createMasterEmployee(r) : (delete r.user.code, await U.createEmployee(r));
|
|
168
156
|
}
|
|
169
|
-
async function
|
|
170
|
-
var
|
|
171
|
-
const r =
|
|
157
|
+
async function ue() {
|
|
158
|
+
var y, F;
|
|
159
|
+
const r = C.value, t = x.value, n = {
|
|
172
160
|
user: {
|
|
173
161
|
name: l.value.name,
|
|
174
162
|
passcode: l.value.passcode
|
|
175
163
|
},
|
|
176
164
|
roles: l.value.restaurants,
|
|
177
|
-
previousRoles: (
|
|
178
|
-
restaurantId:
|
|
179
|
-
roleId:
|
|
165
|
+
previousRoles: (y = r.restaurants) == null ? void 0 : y.map((h) => ({
|
|
166
|
+
restaurantId: h.restaurantId,
|
|
167
|
+
roleId: h.roleId
|
|
180
168
|
}))
|
|
181
169
|
};
|
|
182
170
|
if (!l.value.isMasterUser)
|
|
183
|
-
await
|
|
171
|
+
await U.updateEmployee(t, n);
|
|
184
172
|
else {
|
|
185
|
-
const
|
|
173
|
+
const h = {
|
|
186
174
|
user: {
|
|
187
175
|
name: l.value.name,
|
|
188
176
|
passcode: l.value.passcode,
|
|
189
177
|
code: l.value.code
|
|
190
178
|
},
|
|
191
179
|
roles: l.value.restaurants,
|
|
192
|
-
previousRoles: (F = r.restaurants) == null ? void 0 : F.map((
|
|
193
|
-
restaurantId:
|
|
194
|
-
roleId:
|
|
180
|
+
previousRoles: (F = r.restaurants) == null ? void 0 : F.map((R) => ({
|
|
181
|
+
restaurantId: R.restaurantId,
|
|
182
|
+
roleId: R.roleId
|
|
195
183
|
}))
|
|
196
184
|
};
|
|
197
|
-
|
|
185
|
+
C.value.isMasterUser ? await U.updateMasterEmployee(t, h) : await U.migrateToMasterUser(t, h);
|
|
198
186
|
}
|
|
199
187
|
}
|
|
200
|
-
async function
|
|
201
|
-
|
|
188
|
+
async function ie() {
|
|
189
|
+
A.value ? await L.minor(
|
|
202
190
|
async () => {
|
|
203
191
|
await be();
|
|
204
192
|
},
|
|
205
193
|
{
|
|
206
194
|
successMessage: d("hr.employee.create.successMessage"),
|
|
207
|
-
isLoading:
|
|
195
|
+
isLoading: $
|
|
208
196
|
}
|
|
209
|
-
) : await
|
|
197
|
+
) : await L.minor(
|
|
210
198
|
async () => {
|
|
211
|
-
await
|
|
199
|
+
await ue();
|
|
212
200
|
},
|
|
213
201
|
{
|
|
214
202
|
successMessage: d("hr.employee.update.successMessage"),
|
|
215
|
-
isLoading:
|
|
203
|
+
isLoading: $
|
|
216
204
|
}
|
|
217
|
-
), ye("submitted"),
|
|
205
|
+
), ye("submitted"), w.value = !1;
|
|
218
206
|
}
|
|
219
|
-
return
|
|
220
|
-
() =>
|
|
207
|
+
return ae(
|
|
208
|
+
() => w.value,
|
|
221
209
|
(r) => {
|
|
222
210
|
}
|
|
223
|
-
),
|
|
224
|
-
show:
|
|
225
|
-
trigger:
|
|
211
|
+
), fe({
|
|
212
|
+
show: w,
|
|
213
|
+
trigger: se
|
|
226
214
|
}), (r, t) => {
|
|
227
|
-
const n =
|
|
228
|
-
return
|
|
229
|
-
Ge(r.$slots, "default", { trigger:
|
|
230
|
-
|
|
215
|
+
const n = g("FmSwitch"), y = g("FmTextField"), F = g("FmPinField"), h = g("FmFormGroup"), R = g("FmButton"), K = g("FmSelect"), P = g("FmIcon"), M = g("fm-button"), a = g("fm-side-sheet");
|
|
216
|
+
return _(), j(pe, null, [
|
|
217
|
+
Ge(r.$slots, "default", { trigger: se }),
|
|
218
|
+
u(a, {
|
|
231
219
|
id: "unit-form",
|
|
232
|
-
modelValue:
|
|
233
|
-
"onUpdate:modelValue": t[8] || (t[8] = (e) =>
|
|
220
|
+
modelValue: w.value,
|
|
221
|
+
"onUpdate:modelValue": t[8] || (t[8] = (e) => w.value = e),
|
|
234
222
|
"is-container": s(Ne).FmForm,
|
|
235
223
|
"is-container-props": {
|
|
236
|
-
onValidationSuccess:
|
|
224
|
+
onValidationSuccess: ie,
|
|
237
225
|
blameFormChildOnValidationFailed: !0
|
|
238
226
|
},
|
|
239
227
|
"max-width": 960,
|
|
240
|
-
"onOn:clickedAway": s(
|
|
228
|
+
"onOn:clickedAway": s(X)
|
|
241
229
|
}, {
|
|
242
|
-
"side-sheet-header":
|
|
243
|
-
c("p", ua,
|
|
230
|
+
"side-sheet-header": b(() => [
|
|
231
|
+
c("p", ua, D(k.value), 1)
|
|
244
232
|
]),
|
|
245
|
-
"side-sheet-footer":
|
|
233
|
+
"side-sheet-footer": b(() => [
|
|
246
234
|
c("div", ba, [
|
|
247
|
-
|
|
248
|
-
label:
|
|
235
|
+
u(M, {
|
|
236
|
+
label: q.value,
|
|
249
237
|
size: "lg",
|
|
250
238
|
type: "submit",
|
|
251
239
|
variant: "primary",
|
|
252
|
-
disabled:
|
|
240
|
+
disabled: $.value
|
|
253
241
|
}, null, 8, ["label", "disabled"]),
|
|
254
|
-
|
|
242
|
+
u(M, {
|
|
255
243
|
label: s(d)("common.cancel"),
|
|
256
244
|
size: "lg",
|
|
257
245
|
variant: "tertiary",
|
|
258
|
-
disabled:
|
|
259
|
-
onClick: t[7] || (t[7] = () =>
|
|
246
|
+
disabled: $.value,
|
|
247
|
+
onClick: t[7] || (t[7] = () => w.value = !1)
|
|
260
248
|
}, null, 8, ["label", "disabled"])
|
|
261
249
|
])
|
|
262
250
|
]),
|
|
263
|
-
default:
|
|
251
|
+
default: b(() => [
|
|
264
252
|
c("div", ia, [
|
|
265
|
-
|
|
253
|
+
u(Re, {
|
|
266
254
|
title: s(d)("hr.employee.form.employeeSetting")
|
|
267
255
|
}, {
|
|
268
|
-
default:
|
|
269
|
-
|
|
256
|
+
default: b(() => [
|
|
257
|
+
u(ke, {
|
|
270
258
|
label: s(d)("hr.employee.form.masterUserConfig")
|
|
271
259
|
}, {
|
|
272
|
-
default:
|
|
273
|
-
|
|
260
|
+
default: b(() => [
|
|
261
|
+
u(n, {
|
|
274
262
|
modelValue: l.value.isMasterUser,
|
|
275
263
|
"onUpdate:modelValue": t[0] || (t[0] = (e) => l.value.isMasterUser = e),
|
|
276
264
|
value: "masterUser",
|
|
@@ -282,13 +270,13 @@ const ua = { class: "fm-typo-en-title-md-600" }, ia = { class: "space-y-40" }, d
|
|
|
282
270
|
_: 1
|
|
283
271
|
}, 8, ["label"]),
|
|
284
272
|
c("div", da, [
|
|
285
|
-
l.value.isMasterUser ? (
|
|
273
|
+
l.value.isMasterUser ? (_(), B(y, {
|
|
286
274
|
key: 0,
|
|
287
275
|
modelValue: l.value.code,
|
|
288
276
|
"onUpdate:modelValue": t[1] || (t[1] = (e) => l.value.code = e),
|
|
289
277
|
label: s(d)("hr.employee.form.code")
|
|
290
|
-
}, null, 8, ["modelValue", "label"])) :
|
|
291
|
-
|
|
278
|
+
}, null, 8, ["modelValue", "label"])) : T("", !0),
|
|
279
|
+
u(y, {
|
|
292
280
|
modelValue: l.value.name,
|
|
293
281
|
"onUpdate:modelValue": t[2] || (t[2] = (e) => l.value.name = e),
|
|
294
282
|
class: "w-full",
|
|
@@ -296,38 +284,38 @@ const ua = { class: "fm-typo-en-title-md-600" }, ia = { class: "space-y-40" }, d
|
|
|
296
284
|
rules: [(e) => !!e || s(d)("hr.employee.form.required")]
|
|
297
285
|
}, null, 8, ["modelValue", "label", "rules"])
|
|
298
286
|
]),
|
|
299
|
-
|
|
287
|
+
u(ke, {
|
|
300
288
|
label: s(d)("hr.employee.form.passcode")
|
|
301
289
|
}, {
|
|
302
|
-
default:
|
|
290
|
+
default: b(() => [
|
|
303
291
|
c("div", ca, [
|
|
304
|
-
|
|
292
|
+
u(h, {
|
|
305
293
|
modelValue: E.value,
|
|
306
294
|
"onUpdate:modelValue": t[5] || (t[5] = (e) => E.value = e),
|
|
307
295
|
rules: [
|
|
308
296
|
(e) => (e == null ? void 0 : e.filter((o) => !!o).length) !== $e ? s(d)("hr.employee.form.passcodeRequired") : !0
|
|
309
297
|
]
|
|
310
298
|
}, {
|
|
311
|
-
default:
|
|
312
|
-
|
|
299
|
+
default: b(() => [
|
|
300
|
+
u(F, {
|
|
313
301
|
modelValue: E.value,
|
|
314
302
|
"onUpdate:modelValue": t[3] || (t[3] = (e) => E.value = e),
|
|
315
303
|
length: $e,
|
|
316
304
|
masked: O.value,
|
|
317
305
|
onComplete: t[4] || (t[4] = (e) => l.value.passcode = e),
|
|
318
|
-
onFocus:
|
|
306
|
+
onFocus: Z
|
|
319
307
|
}, null, 8, ["modelValue", "masked"])
|
|
320
308
|
]),
|
|
321
309
|
_: 1
|
|
322
310
|
}, 8, ["modelValue", "rules"]),
|
|
323
|
-
|
|
311
|
+
u(R, {
|
|
324
312
|
variant: "secondary",
|
|
325
313
|
"text-color": "primary",
|
|
326
314
|
"border-color": "primary",
|
|
327
315
|
label: s(d)("hr.employee.form.passcodeGenerate"),
|
|
328
316
|
size: "md",
|
|
329
|
-
loading:
|
|
330
|
-
onClick:
|
|
317
|
+
loading: z.value,
|
|
318
|
+
onClick: ne
|
|
331
319
|
}, null, 8, ["label", "loading"])
|
|
332
320
|
])
|
|
333
321
|
]),
|
|
@@ -336,9 +324,9 @@ const ua = { class: "fm-typo-en-title-md-600" }, ia = { class: "space-y-40" }, d
|
|
|
336
324
|
]),
|
|
337
325
|
_: 1
|
|
338
326
|
}, 8, ["title"]),
|
|
339
|
-
|
|
340
|
-
default:
|
|
341
|
-
|
|
327
|
+
u(Re, null, {
|
|
328
|
+
default: b(() => [
|
|
329
|
+
u(h, {
|
|
342
330
|
modelValue: l.value.restaurants,
|
|
343
331
|
"onUpdate:modelValue": t[6] || (t[6] = (e) => l.value.restaurants = e),
|
|
344
332
|
tag: "div",
|
|
@@ -347,62 +335,62 @@ const ua = { class: "fm-typo-en-title-md-600" }, ia = { class: "space-y-40" }, d
|
|
|
347
335
|
(e) => e.every((o) => o.restaurantId && o.roleId) || s(d)("hr.employee.form.roleRequired")
|
|
348
336
|
]
|
|
349
337
|
}, {
|
|
350
|
-
default:
|
|
338
|
+
default: b(() => [
|
|
351
339
|
c("div", ma, [
|
|
352
|
-
c("div", pa,
|
|
340
|
+
c("div", pa, D(s(d)("hr.employee.form.assignmentSection")), 1),
|
|
353
341
|
c("div", fa, [
|
|
354
342
|
c("div", va, [
|
|
355
|
-
c("div", ya,
|
|
356
|
-
c("div", ha,
|
|
343
|
+
c("div", ya, D(s(d)("hr.employee.columns.restaurants")), 1),
|
|
344
|
+
c("div", ha, D(s(d)("hr.employee.form.role")), 1),
|
|
357
345
|
t[9] || (t[9] = c("div", null, null, -1))
|
|
358
346
|
]),
|
|
359
|
-
(
|
|
347
|
+
(_(!0), j(pe, null, Le(l.value.restaurants, (e, o) => (_(), j("div", {
|
|
360
348
|
key: `${e.restaurantId || "new"}-${o}`,
|
|
361
349
|
class: "grid grid-cols-[minmax(0,1fr)_minmax(0,1fr)_auto] items-center gap-16"
|
|
362
350
|
}, [
|
|
363
|
-
|
|
351
|
+
u(K, {
|
|
364
352
|
class: "min-w-0",
|
|
365
353
|
"model-value": e.restaurantId,
|
|
366
|
-
items:
|
|
354
|
+
items: re(e.restaurantId),
|
|
367
355
|
multiselect: !1,
|
|
368
356
|
placeholder: s(d)("hr.employee.columns.restaurants"),
|
|
369
|
-
disabled:
|
|
370
|
-
"onUpdate:modelValue": (
|
|
357
|
+
disabled: S(e.restaurantId),
|
|
358
|
+
"onUpdate:modelValue": (p) => he(o, p)
|
|
371
359
|
}, null, 8, ["model-value", "items", "placeholder", "disabled", "onUpdate:modelValue"]),
|
|
372
|
-
|
|
360
|
+
u(K, {
|
|
373
361
|
class: "min-w-0",
|
|
374
362
|
"model-value": e.roleId,
|
|
375
|
-
items:
|
|
363
|
+
items: Q(e.restaurantId, e.roleId),
|
|
376
364
|
multiselect: !1,
|
|
377
365
|
placeholder: s(d)("hr.employee.form.role"),
|
|
378
|
-
disabled: !e.restaurantId ||
|
|
379
|
-
"onUpdate:modelValue": (
|
|
366
|
+
disabled: !e.restaurantId || S(e.restaurantId),
|
|
367
|
+
"onUpdate:modelValue": (p) => ge(o, p)
|
|
380
368
|
}, null, 8, ["model-value", "items", "placeholder", "disabled", "onUpdate:modelValue"]),
|
|
381
369
|
c("div", ga, [
|
|
382
|
-
l.value.restaurants.length > 1 ? (
|
|
370
|
+
l.value.restaurants.length > 1 ? (_(), j("div", {
|
|
383
371
|
key: 0,
|
|
384
372
|
role: "button",
|
|
385
373
|
tabindex: "0",
|
|
386
374
|
class: Ae(["inline-flex h-40 w-40 shrink-0 items-center justify-center rounded-lg text-fm-color-neutral-gray-400 transition-colors hover:bg-fm-color-neutral-gray-100 focus:outline-none focus:ring-2 focus:ring-fm-color-primary disabled:cursor-not-allowed disabled:text-fm-color-neutral-gray-200 disabled:hover:bg-transparent", {
|
|
387
|
-
"cursor-pointer": !
|
|
388
|
-
"pointer-events-none":
|
|
375
|
+
"cursor-pointer": !S(e.restaurantId),
|
|
376
|
+
"pointer-events-none": S(e.restaurantId)
|
|
389
377
|
}]),
|
|
390
378
|
"aria-label": s(d)("common.remove"),
|
|
391
|
-
onClick:
|
|
379
|
+
onClick: te((p) => Y(o), ["stop"]),
|
|
392
380
|
onKeydown: [
|
|
393
|
-
Fe(
|
|
394
|
-
Fe(
|
|
381
|
+
Fe(te((p) => Y(o), ["prevent", "stop"]), ["enter"]),
|
|
382
|
+
Fe(te((p) => Y(o), ["prevent", "stop"]), ["space"])
|
|
395
383
|
]
|
|
396
384
|
}, [
|
|
397
|
-
|
|
385
|
+
u(P, {
|
|
398
386
|
name: "delete",
|
|
399
387
|
size: "md"
|
|
400
388
|
})
|
|
401
|
-
], 42, _a)) :
|
|
389
|
+
], 42, _a)) : T("", !0)
|
|
402
390
|
])
|
|
403
391
|
]))), 128))
|
|
404
392
|
]),
|
|
405
|
-
|
|
393
|
+
u(R, {
|
|
406
394
|
type: "button",
|
|
407
395
|
variant: "secondary",
|
|
408
396
|
"text-color": "primary",
|
|
@@ -410,8 +398,8 @@ const ua = { class: "fm-typo-en-title-md-600" }, ia = { class: "space-y-40" }, d
|
|
|
410
398
|
"prepend-icon": "add",
|
|
411
399
|
label: s(d)("hr.employee.form.addAnother"),
|
|
412
400
|
size: "md",
|
|
413
|
-
disabled: !
|
|
414
|
-
onClick:
|
|
401
|
+
disabled: !W.value,
|
|
402
|
+
onClick: te(_e, ["stop"])
|
|
415
403
|
}, null, 8, ["label", "disabled"])
|
|
416
404
|
])
|
|
417
405
|
]),
|
|
@@ -456,132 +444,132 @@ const ua = { class: "fm-typo-en-title-md-600" }, ia = { class: "space-y-40" }, d
|
|
|
456
444
|
class: "text-fm-color-typo-secondary"
|
|
457
445
|
}, H = 200, Aa = /* @__PURE__ */ Me({
|
|
458
446
|
__name: "EmployeeList",
|
|
459
|
-
setup(
|
|
460
|
-
expose:
|
|
447
|
+
setup(N, {
|
|
448
|
+
expose: fe
|
|
461
449
|
}) {
|
|
462
450
|
const {
|
|
463
|
-
t:
|
|
464
|
-
} = Pe(),
|
|
465
|
-
currentBusiness:
|
|
451
|
+
t: i
|
|
452
|
+
} = Pe(), V = v(), f = Oe(), U = ze(), ve = He(), {
|
|
453
|
+
currentBusiness: L,
|
|
466
454
|
sessionUser: ye
|
|
467
|
-
} =
|
|
455
|
+
} = ve, d = xe(), w = v(U.restaurants.value.length === 0), A = v(d.roles.value.length === 0), G = ae(U.restaurants, (a) => {
|
|
468
456
|
if (a.length > 0) {
|
|
469
|
-
if (
|
|
457
|
+
if (w.value = !1, f.listEmployees.value.length > 0) {
|
|
470
458
|
const e = new Map(a.map((o) => [o._id, o]));
|
|
471
|
-
|
|
459
|
+
f.listEmployees.value = f.listEmployees.value.map((o) => ({
|
|
472
460
|
...o,
|
|
473
|
-
restaurants: o.restaurants.map((
|
|
474
|
-
var
|
|
461
|
+
restaurants: o.restaurants.map((p) => {
|
|
462
|
+
var ee, de;
|
|
475
463
|
return {
|
|
476
|
-
...
|
|
477
|
-
restaurantName: ((
|
|
478
|
-
restaurantCode: ((
|
|
464
|
+
...p,
|
|
465
|
+
restaurantName: ((ee = e.get(p.restaurantId)) == null ? void 0 : ee.profile.name) || p.restaurantName,
|
|
466
|
+
restaurantCode: ((de = e.get(p.restaurantId)) == null ? void 0 : de.profile.code) ?? void 0
|
|
479
467
|
};
|
|
480
468
|
})
|
|
481
469
|
}));
|
|
482
470
|
}
|
|
483
471
|
G();
|
|
484
472
|
}
|
|
485
|
-
}),
|
|
473
|
+
}), le = I(() => U.restaurants.value.map((a) => ({
|
|
486
474
|
label: `${a.profile.code ? `${a.profile.code} - ` : ""}${a.profile.name}`,
|
|
487
475
|
value: a._id
|
|
488
|
-
}))),
|
|
476
|
+
}))), se = ae(d.roles, (a) => {
|
|
489
477
|
if (a.length > 0) {
|
|
490
|
-
if (
|
|
478
|
+
if (A.value = !1, f.listEmployees.value.length > 0) {
|
|
491
479
|
const e = new Map(a.map((o) => [o._id, o.name]));
|
|
492
|
-
|
|
480
|
+
f.listEmployees.value = f.listEmployees.value.map((o) => ({
|
|
493
481
|
...o,
|
|
494
|
-
restaurants: o.restaurants.map((
|
|
495
|
-
...
|
|
496
|
-
roleName: e.get(
|
|
482
|
+
restaurants: o.restaurants.map((p) => ({
|
|
483
|
+
...p,
|
|
484
|
+
roleName: e.get(p.roleId) || p.roleName
|
|
497
485
|
}))
|
|
498
486
|
}));
|
|
499
487
|
}
|
|
500
|
-
|
|
488
|
+
se();
|
|
501
489
|
}
|
|
502
|
-
}),
|
|
503
|
-
searchKey:
|
|
504
|
-
} =
|
|
490
|
+
}), J = I(() => f.listEmployees.value), {
|
|
491
|
+
searchKey: k
|
|
492
|
+
} = ea(), q = v(""), C = I(() => J.value), l = I(() => f.totalEmployees.value), x = v(1), oe = I(() => f.isLoading.value), S = v(!1), re = I(() => {
|
|
505
493
|
var a;
|
|
506
494
|
return JSON.stringify({
|
|
507
|
-
businessId: ((a =
|
|
508
|
-
search:
|
|
509
|
-
restaurantIds: [...
|
|
495
|
+
businessId: ((a = L.value) == null ? void 0 : a._id) ?? "",
|
|
496
|
+
search: q.value.trim(),
|
|
497
|
+
restaurantIds: [...V.value ?? []].sort(),
|
|
510
498
|
roleIds: [...n.value ?? []].sort()
|
|
511
499
|
});
|
|
512
|
-
}),
|
|
500
|
+
}), Q = (a) => {
|
|
513
501
|
const e = a.restaurantCode, o = a.restaurantName;
|
|
514
502
|
return e ? `${e} - ${o}` : o;
|
|
515
503
|
}, he = (a) => a.roleName || "-";
|
|
516
504
|
function ge(a) {
|
|
517
505
|
return [{
|
|
518
|
-
label:
|
|
519
|
-
onClick: () =>
|
|
506
|
+
label: i("hr.employee.form.update"),
|
|
507
|
+
onClick: () => X(a)
|
|
520
508
|
}, {
|
|
521
|
-
label:
|
|
522
|
-
onClick: () =>
|
|
509
|
+
label: i("hr.employee.remove.title"),
|
|
510
|
+
onClick: () => ue(a),
|
|
523
511
|
itemClass: "text-fm-color-typo-error"
|
|
524
512
|
}];
|
|
525
513
|
}
|
|
526
514
|
const _e = ({
|
|
527
515
|
employee: a,
|
|
528
516
|
className: e = ""
|
|
529
|
-
}) =>
|
|
517
|
+
}) => u("div", {
|
|
530
518
|
class: e,
|
|
531
519
|
onClick: (o) => {
|
|
532
520
|
o.stopPropagation();
|
|
533
521
|
}
|
|
534
|
-
}, [
|
|
522
|
+
}, [u(la, {
|
|
535
523
|
items: ge(a)
|
|
536
|
-
}, null)]),
|
|
524
|
+
}, null)]), Y = [{
|
|
537
525
|
accessorKey: "code",
|
|
538
526
|
size: 100,
|
|
539
|
-
header: () =>
|
|
527
|
+
header: () => i("hr.employee.columns.code")
|
|
540
528
|
}, {
|
|
541
529
|
accessorKey: "name",
|
|
542
|
-
header: () =>
|
|
530
|
+
header: () => i("hr.employee.columns.name"),
|
|
543
531
|
enableSorting: !1,
|
|
544
532
|
cell(a) {
|
|
545
533
|
const e = a.row.original;
|
|
546
|
-
return
|
|
534
|
+
return u("div", {
|
|
547
535
|
class: "flex items-center gap-8"
|
|
548
|
-
}, [
|
|
536
|
+
}, [u(Ne.FmAvatar, {
|
|
549
537
|
initials: e.name,
|
|
550
538
|
size: "sm",
|
|
551
539
|
class: "shrink-0"
|
|
552
|
-
}, null),
|
|
540
|
+
}, null), u("span", {
|
|
553
541
|
class: "truncate"
|
|
554
542
|
}, [e.name])]);
|
|
555
543
|
}
|
|
556
544
|
}, {
|
|
557
545
|
accessorKey: "restaurants",
|
|
558
546
|
align: "center",
|
|
559
|
-
header: () =>
|
|
547
|
+
header: () => i("hr.employee.columns.restaurants"),
|
|
560
548
|
enableSorting: !1,
|
|
561
549
|
cell(a) {
|
|
562
|
-
return
|
|
563
|
-
const
|
|
564
|
-
return
|
|
565
|
-
` : "") +
|
|
550
|
+
return w.value || A.value ? ce(Se) : a.row.original.restaurants.map((e, o) => {
|
|
551
|
+
const p = Q(e);
|
|
552
|
+
return ce("div", (o ? `
|
|
553
|
+
` : "") + p);
|
|
566
554
|
});
|
|
567
555
|
}
|
|
568
556
|
}, {
|
|
569
557
|
accessorKey: "assignedRole",
|
|
570
558
|
align: "center",
|
|
571
|
-
header: () =>
|
|
559
|
+
header: () => i("hr.employee.columns.assignedRole"),
|
|
572
560
|
enableSorting: !1,
|
|
573
561
|
cell(a) {
|
|
574
|
-
return
|
|
562
|
+
return w.value || A.value ? ce(Se, {
|
|
575
563
|
width: "120px"
|
|
576
564
|
}) : a.row.original.restaurants.map((e, o) => {
|
|
577
|
-
const
|
|
578
|
-
return
|
|
579
|
-
` : "") +
|
|
565
|
+
const p = he(e);
|
|
566
|
+
return ce("div", (o ? `
|
|
567
|
+
` : "") + p);
|
|
580
568
|
});
|
|
581
569
|
}
|
|
582
570
|
}, {
|
|
583
571
|
accessorKey: "since",
|
|
584
|
-
header: () =>
|
|
572
|
+
header: () => i("hr.employee.columns.since"),
|
|
585
573
|
enableSorting: !1
|
|
586
574
|
}, {
|
|
587
575
|
id: "action",
|
|
@@ -596,244 +584,244 @@ const ua = { class: "fm-typo-en-title-md-600" }, ia = { class: "space-y-40" }, d
|
|
|
596
584
|
className: "flex w-full items-center justify-end"
|
|
597
585
|
});
|
|
598
586
|
}
|
|
599
|
-
}],
|
|
600
|
-
function
|
|
587
|
+
}], W = De(), E = Je(), O = Ke(W), Z = v(!1), $ = v(), z = v();
|
|
588
|
+
function ne(a) {
|
|
601
589
|
const e = a.isRestricted;
|
|
602
|
-
return e &&
|
|
603
|
-
message:
|
|
590
|
+
return e && W.open({
|
|
591
|
+
message: i("hr.employee.cannotUpdateMasterUser", {
|
|
604
592
|
name: a.name
|
|
605
593
|
}),
|
|
606
594
|
type: "error"
|
|
607
595
|
}), e;
|
|
608
596
|
}
|
|
609
|
-
const
|
|
597
|
+
const X = (a) => {
|
|
610
598
|
var o;
|
|
611
|
-
a &&
|
|
599
|
+
a && ne(a) || (o = z.value) == null || o.trigger(a);
|
|
612
600
|
}, {
|
|
613
601
|
breakpoints: be
|
|
614
|
-
} = Qe(),
|
|
615
|
-
|
|
616
|
-
title:
|
|
617
|
-
message:
|
|
602
|
+
} = Qe(), ue = (a) => {
|
|
603
|
+
ne(a) || E.open({
|
|
604
|
+
title: i("hr.employee.remove.title"),
|
|
605
|
+
message: i("hr.employee.remove.message", {
|
|
618
606
|
name: a.name
|
|
619
607
|
}),
|
|
620
608
|
minWidth: be.value.lg ? 588 : 0,
|
|
621
609
|
primaryActions: {
|
|
622
|
-
text:
|
|
610
|
+
text: i("common.remove"),
|
|
623
611
|
close: !1,
|
|
624
612
|
variant: "destructive",
|
|
625
|
-
isLoading:
|
|
613
|
+
isLoading: Z
|
|
626
614
|
},
|
|
627
615
|
secondaryActions: {
|
|
628
|
-
text:
|
|
616
|
+
text: i("common.cancel"),
|
|
629
617
|
close: !0
|
|
630
618
|
}
|
|
631
619
|
}).onPrimary(async () => {
|
|
632
|
-
if (
|
|
633
|
-
const o = a.isMasterUser ?
|
|
620
|
+
if (Z.value) return;
|
|
621
|
+
const o = a.isMasterUser ? f.deleteMasterEmployee : f.deleteEmployee;
|
|
634
622
|
await O.minor(async () => {
|
|
635
|
-
await o(a), await
|
|
623
|
+
await o(a), await h();
|
|
636
624
|
}, {
|
|
637
|
-
isLoading:
|
|
638
|
-
successMessage:
|
|
625
|
+
isLoading: Z,
|
|
626
|
+
successMessage: i("hr.employee.remove.successMessage", {
|
|
639
627
|
name: a.name
|
|
640
628
|
})
|
|
641
629
|
}).catch(() => {
|
|
642
630
|
}), E.close();
|
|
643
631
|
});
|
|
644
|
-
},
|
|
632
|
+
}, ie = v("");
|
|
645
633
|
function r() {
|
|
646
634
|
var a;
|
|
647
|
-
(a =
|
|
635
|
+
(a = z.value) == null || a.trigger();
|
|
648
636
|
}
|
|
649
637
|
const t = I(() => xe().roles.value.map((a) => ({
|
|
650
638
|
label: a.name,
|
|
651
639
|
value: a._id
|
|
652
640
|
}))), n = v();
|
|
653
|
-
async function
|
|
641
|
+
async function y() {
|
|
654
642
|
try {
|
|
655
|
-
await
|
|
656
|
-
message:
|
|
643
|
+
await f.syncUsersMeta(), await h(), W.open({
|
|
644
|
+
message: i("hr.employee.sync.successMessage"),
|
|
657
645
|
type: "success"
|
|
658
646
|
});
|
|
659
647
|
} catch (a) {
|
|
660
|
-
console.error("Error syncing users:", a),
|
|
661
|
-
message:
|
|
648
|
+
console.error("Error syncing users:", a), W.open({
|
|
649
|
+
message: i("hr.employee.sync.errorMessage"),
|
|
662
650
|
type: "error"
|
|
663
651
|
});
|
|
664
652
|
}
|
|
665
653
|
}
|
|
666
|
-
async function F(a =
|
|
654
|
+
async function F(a = x.value) {
|
|
667
655
|
var e, o;
|
|
668
|
-
await
|
|
656
|
+
await f.readEmployeesPage({
|
|
669
657
|
limit: H,
|
|
670
658
|
offset: (a - 1) * H,
|
|
671
|
-
search:
|
|
672
|
-
restaurantIds: (e =
|
|
659
|
+
search: q.value.trim() || void 0,
|
|
660
|
+
restaurantIds: (e = V.value) != null && e.length ? V.value : void 0,
|
|
673
661
|
roleIds: (o = n.value) != null && o.length ? n.value : void 0
|
|
674
662
|
});
|
|
675
663
|
}
|
|
676
|
-
async function
|
|
664
|
+
async function h() {
|
|
677
665
|
var e;
|
|
678
|
-
if (!((e =
|
|
679
|
-
await F(
|
|
666
|
+
if (!((e = L.value) != null && e._id)) return;
|
|
667
|
+
await F(x.value);
|
|
680
668
|
const a = Math.max(1, Math.ceil(l.value / H));
|
|
681
|
-
|
|
669
|
+
x.value > a && (x.value = a, await F(x.value));
|
|
682
670
|
}
|
|
683
|
-
async function
|
|
671
|
+
async function R() {
|
|
684
672
|
var a, e;
|
|
685
|
-
return await
|
|
686
|
-
search:
|
|
687
|
-
restaurantIds: (a =
|
|
673
|
+
return await f.readAllEmployeesPage({
|
|
674
|
+
search: q.value.trim() || void 0,
|
|
675
|
+
restaurantIds: (a = V.value) != null && a.length ? V.value : void 0,
|
|
688
676
|
roleIds: (e = n.value) != null && e.length ? n.value : void 0
|
|
689
677
|
}, l.value);
|
|
690
678
|
}
|
|
691
|
-
const
|
|
692
|
-
|
|
679
|
+
const K = oa(k, () => {
|
|
680
|
+
q.value = k.value;
|
|
693
681
|
}, 300);
|
|
694
|
-
|
|
695
|
-
let
|
|
696
|
-
async function
|
|
682
|
+
qe(K);
|
|
683
|
+
let P = !1;
|
|
684
|
+
async function M({
|
|
697
685
|
pageIndex: a
|
|
698
686
|
}) {
|
|
699
687
|
var e;
|
|
700
|
-
if ((e =
|
|
701
|
-
|
|
688
|
+
if ((e = L.value) != null && e._id && !P && !(a === 0 && x.value === 1 && C.value.length > 0)) {
|
|
689
|
+
P = !0, x.value = a + 1;
|
|
702
690
|
try {
|
|
703
|
-
await F(
|
|
691
|
+
await F(x.value);
|
|
704
692
|
} finally {
|
|
705
|
-
|
|
693
|
+
P = !1;
|
|
706
694
|
}
|
|
707
695
|
}
|
|
708
696
|
}
|
|
709
|
-
return
|
|
697
|
+
return ae(re, async () => {
|
|
710
698
|
var a;
|
|
711
|
-
|
|
699
|
+
x.value = 1, S.value = !1, (a = L.value) != null && a._id && (await F(1), S.value = !0);
|
|
712
700
|
}, {
|
|
713
701
|
immediate: !0
|
|
714
|
-
}),
|
|
715
|
-
a && a.length > 0 && (
|
|
716
|
-
}),
|
|
702
|
+
}), ae(() => $.value && $.value.restaurants, (a) => {
|
|
703
|
+
a && a.length > 0 && (ie.value = "");
|
|
704
|
+
}), fe({
|
|
717
705
|
create: r,
|
|
718
|
-
filteredEmployees:
|
|
719
|
-
exportEmployees:
|
|
706
|
+
filteredEmployees: C,
|
|
707
|
+
exportEmployees: R
|
|
720
708
|
}), (a, e) => {
|
|
721
709
|
var Ve, Ee;
|
|
722
|
-
const o =
|
|
723
|
-
return
|
|
710
|
+
const o = g("FmButton"), p = g("FmTooltip"), ee = g("FmSearch"), de = g("FmTable"), Be = g("FmListItem"), Te = g("FmList");
|
|
711
|
+
return _(), j(pe, null, [u(wa, {
|
|
724
712
|
ref_key: "employeeFormRef",
|
|
725
|
-
ref:
|
|
726
|
-
modelValue:
|
|
727
|
-
"onUpdate:modelValue": e[0] || (e[0] = (m) =>
|
|
728
|
-
"role-error-message":
|
|
713
|
+
ref: z,
|
|
714
|
+
modelValue: $.value,
|
|
715
|
+
"onUpdate:modelValue": e[0] || (e[0] = (m) => $.value = m),
|
|
716
|
+
"role-error-message": ie.value,
|
|
729
717
|
class: "gap-8",
|
|
730
|
-
onSubmitted:
|
|
731
|
-
}, null, 8, ["modelValue", "role-error-message"]), c("div", xa, [c("div", Va, [c("div", Ea, [
|
|
732
|
-
modelValue:
|
|
733
|
-
"onUpdate:modelValue": e[1] || (e[1] = (m) =>
|
|
718
|
+
onSubmitted: h
|
|
719
|
+
}, null, 8, ["modelValue", "role-error-message"]), c("div", xa, [c("div", Va, [c("div", Ea, [u(me, {
|
|
720
|
+
modelValue: V.value,
|
|
721
|
+
"onUpdate:modelValue": e[1] || (e[1] = (m) => V.value = m),
|
|
734
722
|
multiple: "",
|
|
735
|
-
items:
|
|
723
|
+
items: le.value,
|
|
736
724
|
variant: "dark",
|
|
737
|
-
"selected-prefix": s(
|
|
738
|
-
placeholder: s(
|
|
725
|
+
"selected-prefix": s(i)("hr.role.columns.restaurants"),
|
|
726
|
+
placeholder: s(i)("hr.role.columns.restaurants"),
|
|
739
727
|
class: "!w-auto"
|
|
740
|
-
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]),
|
|
728
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), u(me, {
|
|
741
729
|
modelValue: n.value,
|
|
742
730
|
"onUpdate:modelValue": e[2] || (e[2] = (m) => n.value = m),
|
|
743
731
|
multiple: "",
|
|
744
732
|
variant: "dark",
|
|
745
733
|
items: t.value,
|
|
746
|
-
"selected-prefix": s(
|
|
747
|
-
placeholder: s(
|
|
748
|
-
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])]), c("div", Fa, [(Ve = s(ye)) != null && Ve.role.isAdmin ? (
|
|
734
|
+
"selected-prefix": s(i)("hr.employee.filter.selected_role_prefix"),
|
|
735
|
+
placeholder: s(i)("hr.employee.filter.role_placeholder")
|
|
736
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])]), c("div", Fa, [(Ve = s(ye)) != null && Ve.role.isAdmin ? (_(), B(p, {
|
|
749
737
|
key: 0,
|
|
750
|
-
content: s(
|
|
738
|
+
content: s(i)("hr.employee.sync.tooltip")
|
|
751
739
|
}, {
|
|
752
|
-
default:
|
|
740
|
+
default: b(() => [u(o, {
|
|
753
741
|
icon: "refresh",
|
|
754
|
-
label: s(
|
|
742
|
+
label: s(i)("hr.employee.sync.tooltip"),
|
|
755
743
|
variant: "tertiary",
|
|
756
|
-
onClick:
|
|
744
|
+
onClick: y
|
|
757
745
|
}, null, 8, ["label"])]),
|
|
758
746
|
_: 1
|
|
759
|
-
}, 8, ["content"])) :
|
|
760
|
-
modelValue: s(
|
|
761
|
-
"onUpdate:modelValue": e[3] || (e[3] = (m) => Ie(
|
|
747
|
+
}, 8, ["content"])) : T("", !0), u(ee, {
|
|
748
|
+
modelValue: s(k),
|
|
749
|
+
"onUpdate:modelValue": e[3] || (e[3] = (m) => Ie(k) ? k.value = m : null),
|
|
762
750
|
autofocus: "",
|
|
763
751
|
class: "pl-4 w-[320px]",
|
|
764
|
-
placeholder: s(
|
|
765
|
-
}, null, 8, ["modelValue", "placeholder"])])]), c("div", Ia, [c("div", ka, [
|
|
766
|
-
modelValue: s(
|
|
767
|
-
"onUpdate:modelValue": e[4] || (e[4] = (m) => Ie(
|
|
752
|
+
placeholder: s(i)("hr.employee.search.placeholder")
|
|
753
|
+
}, null, 8, ["modelValue", "placeholder"])])]), c("div", Ia, [c("div", ka, [u(ee, {
|
|
754
|
+
modelValue: s(k),
|
|
755
|
+
"onUpdate:modelValue": e[4] || (e[4] = (m) => Ie(k) ? k.value = m : null),
|
|
768
756
|
autofocus: "",
|
|
769
|
-
placeholder: s(
|
|
770
|
-
}, null, 8, ["modelValue", "placeholder"])]),
|
|
771
|
-
modelValue:
|
|
772
|
-
"onUpdate:modelValue": e[5] || (e[5] = (m) =>
|
|
757
|
+
placeholder: s(i)("hr.employee.search.placeholder")
|
|
758
|
+
}, null, 8, ["modelValue", "placeholder"])]), u(aa), c("div", Sa, [u(me, {
|
|
759
|
+
modelValue: V.value,
|
|
760
|
+
"onUpdate:modelValue": e[5] || (e[5] = (m) => V.value = m),
|
|
773
761
|
multiple: "",
|
|
774
|
-
items:
|
|
762
|
+
items: le.value,
|
|
775
763
|
variant: "dark",
|
|
776
|
-
"selected-prefix": s(
|
|
777
|
-
placeholder: s(
|
|
764
|
+
"selected-prefix": s(i)("hr.role.columns.restaurants"),
|
|
765
|
+
placeholder: s(i)("hr.role.columns.restaurants"),
|
|
778
766
|
class: "!w-auto"
|
|
779
|
-
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]),
|
|
767
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), u(me, {
|
|
780
768
|
modelValue: n.value,
|
|
781
769
|
"onUpdate:modelValue": e[6] || (e[6] = (m) => n.value = m),
|
|
782
770
|
multiple: "",
|
|
783
771
|
items: t.value,
|
|
784
772
|
variant: "dark",
|
|
785
|
-
"selected-prefix": s(
|
|
786
|
-
placeholder: s(
|
|
787
|
-
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])]), (Ee = s(
|
|
773
|
+
"selected-prefix": s(i)("hr.employee.filter.selected_role_prefix"),
|
|
774
|
+
placeholder: s(i)("hr.employee.filter.role_placeholder")
|
|
775
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])]), (Ee = s(L)) != null && Ee._id ? (_(), B(Ze, {
|
|
788
776
|
key: 0
|
|
789
777
|
}, {
|
|
790
|
-
default:
|
|
778
|
+
default: b(() => [c("div", Ra, [!S.value && s(f).isLoading.value ? (_(), B(Xe, {
|
|
791
779
|
key: 0
|
|
792
|
-
})) : !
|
|
780
|
+
})) : !S.value || l.value === 0 ? (_(), B(s(sa), {
|
|
793
781
|
key: 1,
|
|
794
|
-
title: s(
|
|
795
|
-
subtitle: s(
|
|
796
|
-
}, null, 8, ["title", "subtitle"])) :
|
|
797
|
-
key:
|
|
782
|
+
title: s(i)("hr.employee.noData.title"),
|
|
783
|
+
subtitle: s(i)("hr.employee.noData.subtitle")
|
|
784
|
+
}, null, 8, ["title", "subtitle"])) : T("", !0), S.value ? (_(), B(de, {
|
|
785
|
+
key: re.value,
|
|
798
786
|
class: Ae(["xs:hidden employee-list-table min-h-0 flex-1", {
|
|
799
|
-
"employee-list-table--pagination-loading":
|
|
787
|
+
"employee-list-table--pagination-loading": oe.value
|
|
800
788
|
}]),
|
|
801
|
-
"column-defs":
|
|
802
|
-
"row-data":
|
|
789
|
+
"column-defs": Y,
|
|
790
|
+
"row-data": C.value,
|
|
803
791
|
"page-size": H,
|
|
804
792
|
"page-count": Math.ceil(l.value / H),
|
|
805
793
|
"row-count": l.value,
|
|
806
|
-
"fetch-fn":
|
|
794
|
+
"fetch-fn": M,
|
|
807
795
|
"hide-footer": l.value <= H,
|
|
808
|
-
loading: s(
|
|
796
|
+
loading: s(f).isLoading.value,
|
|
809
797
|
virtual: !1,
|
|
810
798
|
"pin-header-row": "",
|
|
811
|
-
onRowClick: e[7] || (e[7] = (m) =>
|
|
812
|
-
}, null, 8, ["class", "row-data", "page-count", "row-count", "hide-footer", "loading"])) :
|
|
799
|
+
onRowClick: e[7] || (e[7] = (m) => X(m.original))
|
|
800
|
+
}, null, 8, ["class", "row-data", "page-count", "row-count", "hide-footer", "loading"])) : T("", !0), c("div", Ua, [u(Te, {
|
|
813
801
|
separator: ""
|
|
814
802
|
}, {
|
|
815
|
-
default:
|
|
803
|
+
default: b(() => [(_(!0), j(pe, null, Le(C.value, (m) => (_(), B(Be, {
|
|
816
804
|
key: m._id,
|
|
817
805
|
class: "py-12 px-16 items-center justify-between",
|
|
818
|
-
onClick: (we) =>
|
|
806
|
+
onClick: (we) => X(m)
|
|
819
807
|
}, {
|
|
820
|
-
default:
|
|
821
|
-
restaurants: m.restaurants.map((we) =>
|
|
822
|
-
})), 1), c("p", null, " Since: " +
|
|
808
|
+
default: b(() => [c("div", Ca, [c("p", $a, [m.code ? (_(), j("span", Ma, D(m.code) + ".", 1)) : T("", !0), We(D(m.name), 1)]), c("div", La, [c("p", null, D(s(i)("hr.employee.restaurants", {
|
|
809
|
+
restaurants: m.restaurants.map((we) => Q(we)).join(", ")
|
|
810
|
+
})), 1), c("p", null, " Since: " + D(m.since), 1)])]), u(o, {
|
|
823
811
|
icon: "delete",
|
|
824
812
|
variant: "tertiary",
|
|
825
813
|
"text-color": "neutral-gray-400",
|
|
826
|
-
onClick:
|
|
814
|
+
onClick: te((we) => ue(m), ["stop"])
|
|
827
815
|
}, null, 8, ["onClick"])]),
|
|
828
816
|
_: 2
|
|
829
817
|
}, 1032, ["onClick"]))), 128))]),
|
|
830
818
|
_: 1
|
|
831
819
|
})])])]),
|
|
832
820
|
_: 1
|
|
833
|
-
})) :
|
|
821
|
+
})) : T("", !0)])], 64);
|
|
834
822
|
};
|
|
835
823
|
}
|
|
836
|
-
}),
|
|
824
|
+
}), Za = /* @__PURE__ */ Ye(Aa, [["__scopeId", "data-v-e931839a"]]);
|
|
837
825
|
export {
|
|
838
|
-
|
|
826
|
+
Za as default
|
|
839
827
|
};
|