@feedmepos/mf-hrm-portal 2.0.12 → 2.0.13
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-Bd00VQx_.js → AuditLogList-BRLWRnMw.js} +4 -4
- package/dist/{EmployeeList-CK7KmG5w.js → EmployeeList-CaZN66DH.js} +171 -168
- package/dist/{Main-BlREdQ9j.js → Main-CFRwFhOp.js} +9 -9
- package/dist/{Main-B_8kCVUX.js → Main-DDJqYruE.js} +4 -4
- package/dist/{Main-DkBOgy7G.js → Main-DX6DtLSq.js} +5 -5
- package/dist/{PermissionSetList-DfDMzjya.js → PermissionSetList-CfKgOGUa.js} +5 -5
- package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Akov0s-D.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CANjzJpE.js} +855 -855
- package/dist/{RoleList-BxXhMLc4.js → RoleList-DVW9rJKE.js} +7 -7
- package/dist/{TeamMemberList--YzyKgRn.js → TeamMemberList-CZDwbZVL.js} +322 -319
- package/dist/{TimesheetList-K8CKfOu5.js → TimesheetList-DMuID6CQ.js} +7 -7
- package/dist/{app-CDx8kP2V.js → app-jGOQVOD0.js} +4 -4
- package/dist/app.js +1 -1
- package/dist/{dayjs.min-SNComb-n.js → dayjs.min-D2KkLYBN.js} +1 -1
- package/dist/{employee-CGtCzQdZ.js → employee-Bh77woAn.js} +4 -4
- package/dist/{index-qJ7dWPV1.js → index-BpdsYZQZ.js} +2 -2
- package/dist/{index-Ctx7lXyr.js → index-DNRSCsVp.js} +1 -1
- package/dist/{iteration-Df2doI7u.js → iteration-iewRosUH.js} +1 -1
- package/dist/{lodash--VoFIg3j.js → lodash-BuzCumRN.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{timesheet-C8L7eQVO.js → timesheet-D-fS5DjW.js} +3 -3
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{useAppStore-FR1TO4HT.js → useAppStore-RlI38pvN.js} +1 -1
- package/dist/{useLoading-CKrnW2DY.js → useLoading-CJnGoe22.js} +1 -1
- package/dist/{useReportPermissions-BeiN0ZNJ.js → useReportPermissions-CwzEzTF1.js} +3 -3
- package/package.json +1 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { toRaw as
|
|
1
|
+
import { toRaw as De, defineComponent as Se, ref as p, computed as _, watch as ye, resolveComponent as f, createElementBlock as A, openBlock as w, Fragment as Y, renderSlot as Ne, createVNode as n, unref as t, withCtx as F, createElementVNode as c, createBlock as D, createCommentVNode as N, isRef as he, renderList as Ue, toDisplayString as Q, onUnmounted as Be, h as fe, normalizeClass as Te, createTextVNode as Ae, withModifiers as ze } from "vue";
|
|
2
2
|
import { useCoreStore as ke, useI18n as Ie, RestaurantSelector as _e } from "@feedmepos/mf-common";
|
|
3
|
-
import { useSnackbar as Ce, components as Me, useDialog as
|
|
4
|
-
import { S as be, _ as
|
|
5
|
-
import { _ as
|
|
6
|
-
import { H as
|
|
7
|
-
import { _ as
|
|
3
|
+
import { useSnackbar as Ce, components as Me, useDialog as Ke, useBreakpoints as Ge, FmButtonVariant as je } from "@feedmepos/ui-library";
|
|
4
|
+
import { S as be, _ as qe } from "./SelectFilter-DUj7GBtT.js";
|
|
5
|
+
import { _ as He } from "./app-jGOQVOD0.js";
|
|
6
|
+
import { H as Je } from "./HorizontalSplitter-o860F4xM.js";
|
|
7
|
+
import { _ as We } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
|
|
8
8
|
import { u as Re } from "./useSearch-B6WK1LBB.js";
|
|
9
|
-
import { u as
|
|
10
|
-
import { u as Le, E as
|
|
11
|
-
import { l as
|
|
9
|
+
import { u as Qe } from "./useDebounce-B8ZPVS5C.js";
|
|
10
|
+
import { u as Le, E as Ye } from "./employee-Bh77woAn.js";
|
|
11
|
+
import { l as Ze } from "./lodash-BuzCumRN.js";
|
|
12
12
|
import { _ as Ve, a as Fe } from "./FormSection.vue_vue_type_script_setup_true_lang-BVb8c4YU.js";
|
|
13
|
-
import { u as
|
|
14
|
-
import { u as Pe } from "./useLoading-
|
|
15
|
-
import { u as $e } from "./useAppStore-
|
|
13
|
+
import { u as Xe, a as el } from "./useRestaurantMap-e9fQJiLC.js";
|
|
14
|
+
import { u as Pe } from "./useLoading-CJnGoe22.js";
|
|
15
|
+
import { u as $e } from "./useAppStore-RlI38pvN.js";
|
|
16
16
|
/* empty css */
|
|
17
17
|
function we(P) {
|
|
18
18
|
return JSON.parse(JSON.stringify(P));
|
|
@@ -21,12 +21,12 @@ function xe(P) {
|
|
|
21
21
|
if (typeof structuredClone > "u")
|
|
22
22
|
return we(P);
|
|
23
23
|
try {
|
|
24
|
-
return structuredClone(
|
|
24
|
+
return structuredClone(De(P));
|
|
25
25
|
} catch {
|
|
26
26
|
return we(P);
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
const
|
|
29
|
+
const ll = { class: "fm-typo-en-title-md-600" }, al = { class: "space-y-40" }, tl = { class: "flex flex-row gap-16" }, sl = { class: "space-y-16" }, ol = { class: "flex gap-8 items-center justify-start" }, Ee = 4, rl = /* @__PURE__ */ Se({
|
|
30
30
|
__name: "EmployeeForm",
|
|
31
31
|
props: {
|
|
32
32
|
roleErrorMessage: {
|
|
@@ -36,8 +36,8 @@ const tl = { class: "fm-typo-en-title-md-600" }, sl = { class: "space-y-40" }, o
|
|
|
36
36
|
},
|
|
37
37
|
emits: ["submitted"],
|
|
38
38
|
setup(P, { expose: oe, emit: d }) {
|
|
39
|
-
const
|
|
40
|
-
s.value = e ? xe(e) : z(), $.value = xe(s.value),
|
|
39
|
+
const x = $e(), h = ke(), k = Le(), re = Ce(), Z = Pe(re), C = d, { t: u } = Ie(), b = p(!1), E = p(!0), S = (e) => {
|
|
40
|
+
s.value = e ? xe(e) : z(), $.value = xe(s.value), I.value = [], U.value = s.value.restaurants.map((l) => l.restaurantId), s.value.passcode && (I.value = s.value.passcode.split(""), y.value = !0), E.value = !e, b.value = !0;
|
|
41
41
|
};
|
|
42
42
|
function z() {
|
|
43
43
|
return {
|
|
@@ -48,9 +48,9 @@ const tl = { class: "fm-typo-en-title-md-600" }, sl = { class: "space-y-40" }, o
|
|
|
48
48
|
restaurants: []
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
|
-
const X = _(() => E.value ? u("hr.employee.form.add") : u("hr.employee.form.update")), ne = _(() => E.value ? u("common.create") : u("common.update")), $ = p(z()), s = p(z()), { searchKey:
|
|
51
|
+
const X = _(() => E.value ? u("hr.employee.form.add") : u("hr.employee.form.update")), ne = _(() => E.value ? u("common.create") : u("common.update")), $ = p(z()), s = p(z()), { searchKey: L, filter: ee } = Re(), ue = _(() => {
|
|
52
52
|
const e = {};
|
|
53
|
-
return
|
|
53
|
+
return x.roles.value.forEach((l) => {
|
|
54
54
|
e[l._id] = l.name;
|
|
55
55
|
}), e;
|
|
56
56
|
});
|
|
@@ -58,8 +58,8 @@ const tl = { class: "fm-typo-en-title-md-600" }, sl = { class: "space-y-40" }, o
|
|
|
58
58
|
const l = le(e) ?? "";
|
|
59
59
|
return ue.value[l] || "";
|
|
60
60
|
}
|
|
61
|
-
const M = _(() => h.restaurants.value.filter(({ _id: l, profile: r, managable: m }) => m ? ee([r.code, r.name, K(l)]) :
|
|
62
|
-
const g =
|
|
61
|
+
const M = _(() => h.restaurants.value.filter(({ _id: l, profile: r, managable: m }) => m ? ee([r.code, r.name, K(l)]) : U.value.includes(l)).map(({ _id: l, profile: r, managable: m }) => {
|
|
62
|
+
const g = x.roles.value.filter((v) => v.restaurants.some((V) => V.id == l)).map((v) => ({
|
|
63
63
|
label: v.name,
|
|
64
64
|
value: v._id,
|
|
65
65
|
disabled: !v.isUsable
|
|
@@ -83,15 +83,15 @@ const tl = { class: "fm-typo-en-title-md-600" }, sl = { class: "space-y-40" }, o
|
|
|
83
83
|
roleId: l
|
|
84
84
|
}
|
|
85
85
|
];
|
|
86
|
-
},
|
|
87
|
-
() =>
|
|
86
|
+
}, U = p(s.value.restaurants.map((e) => e.restaurantId)), j = _(
|
|
87
|
+
() => U.value.filter(
|
|
88
88
|
(e) => M.value.some((l) => l.value === e && !l.disabled)
|
|
89
89
|
)
|
|
90
90
|
), q = _(() => {
|
|
91
91
|
const e = M.value.filter((l) => !l.disabled).length;
|
|
92
92
|
return e > 0 && e === j.value.length;
|
|
93
93
|
}), te = () => {
|
|
94
|
-
const e =
|
|
94
|
+
const e = U.value.filter((l) => !j.value.includes(l));
|
|
95
95
|
if (q.value === !0)
|
|
96
96
|
H(e);
|
|
97
97
|
else {
|
|
@@ -99,38 +99,38 @@ const tl = { class: "fm-typo-en-title-md-600" }, sl = { class: "space-y-40" }, o
|
|
|
99
99
|
H([...l, ...e]);
|
|
100
100
|
}
|
|
101
101
|
}, H = (e) => {
|
|
102
|
-
|
|
102
|
+
U.value = e, s.value.restaurants = e.map((l) => {
|
|
103
103
|
var g, v;
|
|
104
|
-
const r = M.value.find((
|
|
104
|
+
const r = M.value.find((V) => V.value === l);
|
|
105
105
|
if (r != null && r.disabled)
|
|
106
|
-
return s.value.restaurants.find((
|
|
106
|
+
return s.value.restaurants.find((V) => V.restaurantId === l) ?? {
|
|
107
107
|
restaurantId: l,
|
|
108
108
|
roleId: ""
|
|
109
109
|
};
|
|
110
|
-
const m = ((g = r == null ? void 0 : r.roleOptions.find((
|
|
110
|
+
const m = ((g = r == null ? void 0 : r.roleOptions.find((V) => !V.disabled)) == null ? void 0 : g.value) || "";
|
|
111
111
|
return {
|
|
112
112
|
restaurantId: l,
|
|
113
|
-
roleId: ((v = s.value.restaurants.find((
|
|
113
|
+
roleId: ((v = s.value.restaurants.find((V) => V.restaurantId === l)) == null ? void 0 : v.roleId) || m
|
|
114
114
|
};
|
|
115
115
|
});
|
|
116
|
-
},
|
|
116
|
+
}, I = p([]), y = p(!1);
|
|
117
117
|
function ie() {
|
|
118
|
-
y.value && (y.value = !1,
|
|
118
|
+
y.value && (y.value = !1, I.value = []);
|
|
119
119
|
}
|
|
120
|
-
const
|
|
120
|
+
const R = p(!1), O = p(!1);
|
|
121
121
|
async function de() {
|
|
122
|
-
|
|
122
|
+
O.value = !0;
|
|
123
123
|
try {
|
|
124
|
-
const e = await
|
|
125
|
-
y.value = !1,
|
|
124
|
+
const e = await Ye.generateEmployeePasscode();
|
|
125
|
+
y.value = !1, I.value = e.split("");
|
|
126
126
|
} finally {
|
|
127
|
-
|
|
127
|
+
O.value = !1;
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
const ce =
|
|
131
|
-
() => !
|
|
130
|
+
const ce = Xe(
|
|
131
|
+
() => !Ze.isEqual(s.value, $.value),
|
|
132
132
|
() => {
|
|
133
|
-
|
|
133
|
+
b.value = !1;
|
|
134
134
|
}
|
|
135
135
|
);
|
|
136
136
|
async function J() {
|
|
@@ -142,7 +142,7 @@ const tl = { class: "fm-typo-en-title-md-600" }, sl = { class: "space-y-40" }, o
|
|
|
142
142
|
},
|
|
143
143
|
roles: s.value.restaurants
|
|
144
144
|
};
|
|
145
|
-
s.value.isMasterUser ? await
|
|
145
|
+
s.value.isMasterUser ? await k.createMasterEmployee(e) : (delete e.user.code, await k.createEmployee(e));
|
|
146
146
|
}
|
|
147
147
|
async function me() {
|
|
148
148
|
var r, m;
|
|
@@ -158,7 +158,7 @@ const tl = { class: "fm-typo-en-title-md-600" }, sl = { class: "space-y-40" }, o
|
|
|
158
158
|
}))
|
|
159
159
|
};
|
|
160
160
|
if (!s.value.isMasterUser)
|
|
161
|
-
await
|
|
161
|
+
await k.updateEmployee(e._id, l);
|
|
162
162
|
else {
|
|
163
163
|
const g = {
|
|
164
164
|
user: {
|
|
@@ -172,7 +172,7 @@ const tl = { class: "fm-typo-en-title-md-600" }, sl = { class: "space-y-40" }, o
|
|
|
172
172
|
roleId: v.roleId
|
|
173
173
|
}))
|
|
174
174
|
};
|
|
175
|
-
$.value.isMasterUser ? await
|
|
175
|
+
$.value.isMasterUser ? await k.updateMasterEmployee(e._id, g) : await k.migrateToMasterUser(e._id, g);
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
178
|
async function a() {
|
|
@@ -182,7 +182,7 @@ const tl = { class: "fm-typo-en-title-md-600" }, sl = { class: "space-y-40" }, o
|
|
|
182
182
|
},
|
|
183
183
|
{
|
|
184
184
|
successMessage: u("hr.employee.create.successMessage"),
|
|
185
|
-
isLoading:
|
|
185
|
+
isLoading: R
|
|
186
186
|
}
|
|
187
187
|
) : await Z.minor(
|
|
188
188
|
async () => {
|
|
@@ -190,25 +190,25 @@ const tl = { class: "fm-typo-en-title-md-600" }, sl = { class: "space-y-40" }, o
|
|
|
190
190
|
},
|
|
191
191
|
{
|
|
192
192
|
successMessage: u("hr.employee.update.successMessage"),
|
|
193
|
-
isLoading:
|
|
193
|
+
isLoading: R
|
|
194
194
|
}
|
|
195
|
-
), C("submitted"),
|
|
195
|
+
), C("submitted"), b.value = !1;
|
|
196
196
|
}
|
|
197
197
|
return ye(
|
|
198
|
-
() =>
|
|
198
|
+
() => b.value,
|
|
199
199
|
(e) => {
|
|
200
200
|
}
|
|
201
201
|
), oe({
|
|
202
|
-
show:
|
|
203
|
-
trigger:
|
|
202
|
+
show: b,
|
|
203
|
+
trigger: S
|
|
204
204
|
}), (e, l) => {
|
|
205
|
-
const r = f("FmSwitch"), m = f("FmTextField"), g = f("FmPinField"), v = f("FmFormGroup"),
|
|
206
|
-
return
|
|
207
|
-
Ne(e.$slots, "default", { trigger:
|
|
208
|
-
n(
|
|
205
|
+
const r = f("FmSwitch"), m = f("FmTextField"), g = f("FmPinField"), v = f("FmFormGroup"), V = f("FmButton"), se = f("FmSearch"), W = f("FmCheckbox"), i = f("FmSelect"), B = f("fm-button"), Oe = f("fm-side-sheet");
|
|
206
|
+
return w(), A(Y, null, [
|
|
207
|
+
Ne(e.$slots, "default", { trigger: S }),
|
|
208
|
+
n(Oe, {
|
|
209
209
|
id: "unit-form",
|
|
210
|
-
modelValue:
|
|
211
|
-
"onUpdate:modelValue": l[9] || (l[9] = (o) =>
|
|
210
|
+
modelValue: b.value,
|
|
211
|
+
"onUpdate:modelValue": l[9] || (l[9] = (o) => b.value = o),
|
|
212
212
|
"is-container": t(Me).FmForm,
|
|
213
213
|
"is-container-props": {
|
|
214
214
|
onValidationSuccess: a,
|
|
@@ -217,37 +217,37 @@ const tl = { class: "fm-typo-en-title-md-600" }, sl = { class: "space-y-40" }, o
|
|
|
217
217
|
"max-width": 560,
|
|
218
218
|
"onOn:clickedAway": t(ce)
|
|
219
219
|
}, {
|
|
220
|
-
"side-sheet-header":
|
|
221
|
-
c("p",
|
|
220
|
+
"side-sheet-header": F(() => [
|
|
221
|
+
c("p", ll, Q(X.value), 1)
|
|
222
222
|
]),
|
|
223
|
-
"side-sheet-footer":
|
|
224
|
-
c("div",
|
|
225
|
-
n(
|
|
223
|
+
"side-sheet-footer": F(() => [
|
|
224
|
+
c("div", ol, [
|
|
225
|
+
n(B, {
|
|
226
226
|
label: ne.value,
|
|
227
227
|
size: "lg",
|
|
228
228
|
type: "submit",
|
|
229
229
|
variant: "primary",
|
|
230
|
-
disabled:
|
|
230
|
+
disabled: R.value
|
|
231
231
|
}, null, 8, ["label", "disabled"]),
|
|
232
|
-
n(
|
|
232
|
+
n(B, {
|
|
233
233
|
label: t(u)("common.cancel"),
|
|
234
234
|
size: "lg",
|
|
235
235
|
variant: "tertiary",
|
|
236
|
-
disabled:
|
|
237
|
-
onClick: l[8] || (l[8] = () =>
|
|
236
|
+
disabled: R.value,
|
|
237
|
+
onClick: l[8] || (l[8] = () => b.value = !1)
|
|
238
238
|
}, null, 8, ["label", "disabled"])
|
|
239
239
|
])
|
|
240
240
|
]),
|
|
241
|
-
default:
|
|
242
|
-
c("div",
|
|
241
|
+
default: F(() => [
|
|
242
|
+
c("div", al, [
|
|
243
243
|
n(Ve, {
|
|
244
244
|
title: t(u)("hr.employee.form.employeeSetting")
|
|
245
245
|
}, {
|
|
246
|
-
default:
|
|
246
|
+
default: F(() => [
|
|
247
247
|
n(Fe, {
|
|
248
248
|
label: t(u)("hr.employee.form.masterUserConfig")
|
|
249
249
|
}, {
|
|
250
|
-
default:
|
|
250
|
+
default: F(() => [
|
|
251
251
|
n(r, {
|
|
252
252
|
modelValue: s.value.isMasterUser,
|
|
253
253
|
"onUpdate:modelValue": l[0] || (l[0] = (o) => s.value.isMasterUser = o),
|
|
@@ -259,13 +259,13 @@ const tl = { class: "fm-typo-en-title-md-600" }, sl = { class: "space-y-40" }, o
|
|
|
259
259
|
]),
|
|
260
260
|
_: 1
|
|
261
261
|
}, 8, ["label"]),
|
|
262
|
-
c("div",
|
|
263
|
-
s.value.isMasterUser ? (
|
|
262
|
+
c("div", tl, [
|
|
263
|
+
s.value.isMasterUser ? (w(), D(m, {
|
|
264
264
|
key: 0,
|
|
265
265
|
modelValue: s.value.code,
|
|
266
266
|
"onUpdate:modelValue": l[1] || (l[1] = (o) => s.value.code = o),
|
|
267
267
|
label: t(u)("hr.employee.form.code")
|
|
268
|
-
}, null, 8, ["modelValue", "label"])) :
|
|
268
|
+
}, null, 8, ["modelValue", "label"])) : N("", !0),
|
|
269
269
|
n(m, {
|
|
270
270
|
modelValue: s.value.name,
|
|
271
271
|
"onUpdate:modelValue": l[2] || (l[2] = (o) => s.value.name = o),
|
|
@@ -277,19 +277,19 @@ const tl = { class: "fm-typo-en-title-md-600" }, sl = { class: "space-y-40" }, o
|
|
|
277
277
|
n(Fe, {
|
|
278
278
|
label: t(u)("hr.employee.form.passcode")
|
|
279
279
|
}, {
|
|
280
|
-
default:
|
|
281
|
-
c("div",
|
|
280
|
+
default: F(() => [
|
|
281
|
+
c("div", sl, [
|
|
282
282
|
n(v, {
|
|
283
|
-
modelValue:
|
|
284
|
-
"onUpdate:modelValue": l[5] || (l[5] = (o) =>
|
|
283
|
+
modelValue: I.value,
|
|
284
|
+
"onUpdate:modelValue": l[5] || (l[5] = (o) => I.value = o),
|
|
285
285
|
rules: [
|
|
286
286
|
(o) => (o == null ? void 0 : o.filter((pe) => !!pe).length) !== Ee ? t(u)("hr.employee.form.passcodeRequired") : !0
|
|
287
287
|
]
|
|
288
288
|
}, {
|
|
289
|
-
default:
|
|
289
|
+
default: F(() => [
|
|
290
290
|
n(g, {
|
|
291
|
-
modelValue:
|
|
292
|
-
"onUpdate:modelValue": l[3] || (l[3] = (o) =>
|
|
291
|
+
modelValue: I.value,
|
|
292
|
+
"onUpdate:modelValue": l[3] || (l[3] = (o) => I.value = o),
|
|
293
293
|
length: Ee,
|
|
294
294
|
masked: y.value,
|
|
295
295
|
onComplete: l[4] || (l[4] = (o) => s.value.passcode = o),
|
|
@@ -298,13 +298,13 @@ const tl = { class: "fm-typo-en-title-md-600" }, sl = { class: "space-y-40" }, o
|
|
|
298
298
|
]),
|
|
299
299
|
_: 1
|
|
300
300
|
}, 8, ["modelValue", "rules"]),
|
|
301
|
-
n(
|
|
301
|
+
n(V, {
|
|
302
302
|
variant: "secondary",
|
|
303
303
|
"text-color": "primary",
|
|
304
304
|
"border-color": "primary",
|
|
305
305
|
label: t(u)("hr.employee.form.passcodeGenerate"),
|
|
306
306
|
size: "md",
|
|
307
|
-
loading:
|
|
307
|
+
loading: O.value,
|
|
308
308
|
onClick: de
|
|
309
309
|
}, null, 8, ["label", "loading"])
|
|
310
310
|
])
|
|
@@ -317,18 +317,18 @@ const tl = { class: "fm-typo-en-title-md-600" }, sl = { class: "space-y-40" }, o
|
|
|
317
317
|
n(Ve, {
|
|
318
318
|
title: t(u)("hr.employee.form.role")
|
|
319
319
|
}, {
|
|
320
|
-
default:
|
|
320
|
+
default: F(() => [
|
|
321
321
|
n(se, {
|
|
322
|
-
modelValue: t(
|
|
323
|
-
"onUpdate:modelValue": l[6] || (l[6] = (o) => he(
|
|
322
|
+
modelValue: t(L),
|
|
323
|
+
"onUpdate:modelValue": l[6] || (l[6] = (o) => he(L) ? L.value = o : null),
|
|
324
324
|
placeholder: t(u)("hr.restaurant.search.placeholder")
|
|
325
325
|
}, null, 8, ["modelValue", "placeholder"]),
|
|
326
326
|
n(v, {
|
|
327
|
-
modelValue:
|
|
328
|
-
"onUpdate:modelValue": l[7] || (l[7] = (o) =>
|
|
327
|
+
modelValue: U.value,
|
|
328
|
+
"onUpdate:modelValue": l[7] || (l[7] = (o) => U.value = o),
|
|
329
329
|
rules: [(o) => o.length > 0 || t(u)("hr.employee.form.atLeastOneRestaurant")]
|
|
330
330
|
}, {
|
|
331
|
-
default:
|
|
331
|
+
default: F(() => [
|
|
332
332
|
n(W, {
|
|
333
333
|
"model-value": q.value,
|
|
334
334
|
label: t(u)("hr.employee.form.all"),
|
|
@@ -336,17 +336,17 @@ const tl = { class: "fm-typo-en-title-md-600" }, sl = { class: "space-y-40" }, o
|
|
|
336
336
|
indeterminate: j.value.length > 0,
|
|
337
337
|
"onUpdate:modelValue": te
|
|
338
338
|
}, null, 8, ["model-value", "label", "indeterminate"]),
|
|
339
|
-
(
|
|
339
|
+
(w(!0), A(Y, null, Ue(M.value, (o, pe) => {
|
|
340
340
|
var ge;
|
|
341
|
-
return
|
|
341
|
+
return w(), A(Y, { key: pe }, [
|
|
342
342
|
n(W, {
|
|
343
|
-
"model-value":
|
|
343
|
+
"model-value": U.value,
|
|
344
344
|
label: o.label,
|
|
345
345
|
value: o.value,
|
|
346
346
|
disabled: o.disabled,
|
|
347
347
|
"onUpdate:modelValue": H
|
|
348
348
|
}, null, 8, ["model-value", "label", "value", "disabled"]),
|
|
349
|
-
|
|
349
|
+
U.value.includes(o.value) ? (w(), D(i, {
|
|
350
350
|
key: 0,
|
|
351
351
|
class: "ml-32 mr-8",
|
|
352
352
|
items: o.roleOptions,
|
|
@@ -355,7 +355,7 @@ const tl = { class: "fm-typo-en-title-md-600" }, sl = { class: "space-y-40" }, o
|
|
|
355
355
|
placeholder: ((ge = o.roleOptions.find((ve) => !ve.disabled) ?? o.roleOptions[0]) == null ? void 0 : ge.label) ?? "",
|
|
356
356
|
disabled: o.disabled,
|
|
357
357
|
"onUpdate:modelValue": (ve) => ae(o.value, ve)
|
|
358
|
-
}, null, 8, ["items", "model-value", "placeholder", "disabled", "onUpdate:modelValue"])) :
|
|
358
|
+
}, null, 8, ["items", "model-value", "placeholder", "disabled", "onUpdate:modelValue"])) : N("", !0)
|
|
359
359
|
], 64);
|
|
360
360
|
}), 128))
|
|
361
361
|
]),
|
|
@@ -371,54 +371,54 @@ const tl = { class: "fm-typo-en-title-md-600" }, sl = { class: "space-y-40" }, o
|
|
|
371
371
|
], 64);
|
|
372
372
|
};
|
|
373
373
|
}
|
|
374
|
-
}),
|
|
374
|
+
}), nl = {
|
|
375
375
|
class: "space-y-8"
|
|
376
|
-
},
|
|
376
|
+
}, ul = {
|
|
377
377
|
class: "xs:hidden flex w-full items-start justify-between"
|
|
378
|
-
},
|
|
378
|
+
}, il = {
|
|
379
379
|
class: "flex items-start gap-8"
|
|
380
|
-
},
|
|
380
|
+
}, dl = {
|
|
381
381
|
class: "flex"
|
|
382
|
-
},
|
|
382
|
+
}, cl = {
|
|
383
383
|
class: "space-y-4 sm:hidden md:hidden lg:hidden"
|
|
384
|
-
},
|
|
384
|
+
}, ml = {
|
|
385
385
|
class: "px-16"
|
|
386
|
-
},
|
|
386
|
+
}, pl = {
|
|
387
387
|
class: "px-16 flex items-start gap-8"
|
|
388
|
-
},
|
|
388
|
+
}, vl = {
|
|
389
389
|
class: "flex h-full flex-col overflow-auto"
|
|
390
|
-
},
|
|
390
|
+
}, fl = {
|
|
391
391
|
class: "pb-64 sm:hidden md:hidden lg:hidden"
|
|
392
|
-
},
|
|
392
|
+
}, yl = {
|
|
393
393
|
class: "space-y-4"
|
|
394
|
-
},
|
|
394
|
+
}, hl = {
|
|
395
395
|
class: "fm-typo-en-body-lg-600"
|
|
396
|
-
},
|
|
396
|
+
}, gl = {
|
|
397
397
|
key: 0,
|
|
398
398
|
class: "mr-4"
|
|
399
|
-
},
|
|
399
|
+
}, _l = {
|
|
400
400
|
class: "text-fm-color-typo-secondary"
|
|
401
|
-
},
|
|
401
|
+
}, T = 200, bl = /* @__PURE__ */ Se({
|
|
402
402
|
__name: "EmployeeList",
|
|
403
403
|
setup(P, {
|
|
404
404
|
expose: oe
|
|
405
405
|
}) {
|
|
406
406
|
const {
|
|
407
407
|
t: d
|
|
408
|
-
} = Ie(),
|
|
409
|
-
currentBusiness:
|
|
408
|
+
} = Ie(), x = p(), h = Le(), {
|
|
409
|
+
currentBusiness: k,
|
|
410
410
|
sessionUser: re
|
|
411
411
|
} = ke(), Z = _(() => h.listEmployees.value), {
|
|
412
412
|
searchKey: C
|
|
413
|
-
} = Re(""), u = p(""),
|
|
413
|
+
} = Re(""), u = p(""), b = _(() => Z.value), E = _(() => h.totalEmployees.value), S = p(1), z = _(() => h.isLoading.value), X = _(() => {
|
|
414
414
|
var a;
|
|
415
415
|
return JSON.stringify({
|
|
416
|
-
businessId: ((a =
|
|
416
|
+
businessId: ((a = k.value) == null ? void 0 : a._id) ?? "",
|
|
417
417
|
search: u.value.trim(),
|
|
418
|
-
restaurantIds: [...
|
|
418
|
+
restaurantIds: [...x.value ?? []].sort(),
|
|
419
419
|
roleIds: [...y.value ?? []].sort()
|
|
420
420
|
});
|
|
421
|
-
}), ne =
|
|
421
|
+
}), ne = el(), $ = (a) => {
|
|
422
422
|
const e = ne.value[a.restaurantId], l = e == null ? void 0 : e.profile.code;
|
|
423
423
|
let m = a.restaurantName || (e == null ? void 0 : e.profile.name) || "";
|
|
424
424
|
return a.roleName && (m = `${l ? l + " - " : ""}${m} (${a.roleName})`), m;
|
|
@@ -457,28 +457,28 @@ const tl = { class: "fm-typo-en-title-md-600" }, sl = { class: "space-y-40" }, o
|
|
|
457
457
|
class: "w-full flex justify-end items-center"
|
|
458
458
|
}, [fe(Me.FmButton, {
|
|
459
459
|
prependIcon: "delete",
|
|
460
|
-
variant:
|
|
460
|
+
variant: je.Tertiary,
|
|
461
461
|
textColor: "neutral-gray-400",
|
|
462
462
|
onClick: (e) => {
|
|
463
463
|
e.stopPropagation(), q(a.row.original);
|
|
464
464
|
}
|
|
465
465
|
})])
|
|
466
|
-
}],
|
|
466
|
+
}], L = Ce(), ee = Ke(), ue = Pe(L), K = p(!1), M = p(), G = p(), le = _(() => h.restrictEmployeeIds.value);
|
|
467
467
|
function ae(a) {
|
|
468
468
|
const e = le.value.includes(a._id);
|
|
469
|
-
return e &&
|
|
469
|
+
return e && L.open({
|
|
470
470
|
message: d("hr.employee.cannotUpdateMasterUser", {
|
|
471
471
|
name: a.name
|
|
472
472
|
}),
|
|
473
473
|
type: "error"
|
|
474
474
|
}), e;
|
|
475
475
|
}
|
|
476
|
-
const
|
|
476
|
+
const U = (a) => {
|
|
477
477
|
var l;
|
|
478
478
|
a && ae(a) || (l = G.value) == null || l.trigger(a);
|
|
479
479
|
}, {
|
|
480
480
|
breakpoints: j
|
|
481
|
-
} =
|
|
481
|
+
} = Ge(), q = (a) => {
|
|
482
482
|
ae(a) || ee.open({
|
|
483
483
|
title: d("hr.employee.remove.title"),
|
|
484
484
|
message: d("hr.employee.remove.message", {
|
|
@@ -499,7 +499,7 @@ const tl = { class: "fm-typo-en-title-md-600" }, sl = { class: "space-y-40" }, o
|
|
|
499
499
|
if (K.value) return;
|
|
500
500
|
const l = a.isMasterUser ? h.deleteMasterEmployee : h.deleteEmployee;
|
|
501
501
|
await ue.minor(async () => {
|
|
502
|
-
await l(a), await
|
|
502
|
+
await l(a), await O();
|
|
503
503
|
}, {
|
|
504
504
|
isLoading: K,
|
|
505
505
|
successMessage: d("hr.employee.remove.successMessage", {
|
|
@@ -513,49 +513,49 @@ const tl = { class: "fm-typo-en-title-md-600" }, sl = { class: "space-y-40" }, o
|
|
|
513
513
|
var a;
|
|
514
514
|
(a = G.value) == null || a.trigger();
|
|
515
515
|
}
|
|
516
|
-
const
|
|
516
|
+
const I = _(() => $e().roles.value.map((a) => ({
|
|
517
517
|
label: a.name,
|
|
518
518
|
value: a._id
|
|
519
519
|
}))), y = p();
|
|
520
520
|
async function ie() {
|
|
521
521
|
try {
|
|
522
|
-
await h.syncUsersMeta(), await
|
|
522
|
+
await h.syncUsersMeta(), await O(), L.open({
|
|
523
523
|
message: d("hr.employee.sync.successMessage"),
|
|
524
524
|
type: "success"
|
|
525
525
|
});
|
|
526
526
|
} catch (a) {
|
|
527
|
-
console.error("Error syncing users:", a),
|
|
527
|
+
console.error("Error syncing users:", a), L.open({
|
|
528
528
|
message: d("hr.employee.sync.errorMessage"),
|
|
529
529
|
type: "error"
|
|
530
530
|
});
|
|
531
531
|
}
|
|
532
532
|
}
|
|
533
|
-
async function
|
|
533
|
+
async function R(a = S.value) {
|
|
534
534
|
var e, l;
|
|
535
535
|
await h.readEmployeesPage({
|
|
536
|
-
limit:
|
|
537
|
-
offset: (a - 1) *
|
|
536
|
+
limit: T,
|
|
537
|
+
offset: (a - 1) * T,
|
|
538
538
|
search: u.value.trim() || void 0,
|
|
539
|
-
restaurantIds: (e =
|
|
539
|
+
restaurantIds: (e = x.value) != null && e.length ? x.value : void 0,
|
|
540
540
|
roleIds: (l = y.value) != null && l.length ? y.value : void 0
|
|
541
541
|
});
|
|
542
542
|
}
|
|
543
|
-
async function
|
|
543
|
+
async function O() {
|
|
544
544
|
var e;
|
|
545
|
-
if (!((e =
|
|
546
|
-
await
|
|
547
|
-
const a = Math.max(1, Math.ceil(E.value /
|
|
548
|
-
|
|
545
|
+
if (!((e = k.value) != null && e._id)) return;
|
|
546
|
+
await R(S.value);
|
|
547
|
+
const a = Math.max(1, Math.ceil(E.value / T));
|
|
548
|
+
S.value > a && (S.value = a, await R(S.value));
|
|
549
549
|
}
|
|
550
550
|
async function de() {
|
|
551
551
|
var a, e;
|
|
552
552
|
return await h.readAllEmployeesPage({
|
|
553
553
|
search: u.value.trim() || void 0,
|
|
554
|
-
restaurantIds: (a =
|
|
554
|
+
restaurantIds: (a = x.value) != null && a.length ? x.value : void 0,
|
|
555
555
|
roleIds: (e = y.value) != null && e.length ? y.value : void 0
|
|
556
556
|
}, E.value);
|
|
557
557
|
}
|
|
558
|
-
const ce =
|
|
558
|
+
const ce = Qe(C, () => {
|
|
559
559
|
u.value = C.value;
|
|
560
560
|
}, 300);
|
|
561
561
|
Be(ce);
|
|
@@ -564,37 +564,40 @@ const tl = { class: "fm-typo-en-title-md-600" }, sl = { class: "space-y-40" }, o
|
|
|
564
564
|
pageIndex: a
|
|
565
565
|
}) {
|
|
566
566
|
var e;
|
|
567
|
-
if ((e =
|
|
568
|
-
J = !0,
|
|
567
|
+
if ((e = k.value) != null && e._id && !J && !(a === 0 && S.value === 1 && b.value.length > 0)) {
|
|
568
|
+
J = !0, S.value = a + 1;
|
|
569
569
|
try {
|
|
570
|
-
await
|
|
570
|
+
await R(S.value);
|
|
571
571
|
} finally {
|
|
572
572
|
J = !1;
|
|
573
573
|
}
|
|
574
574
|
}
|
|
575
575
|
}
|
|
576
|
-
return ye(X, () => {
|
|
577
|
-
|
|
576
|
+
return ye(X, async () => {
|
|
577
|
+
var a;
|
|
578
|
+
S.value = 1, (a = k.value) != null && a._id && await R(1);
|
|
579
|
+
}, {
|
|
580
|
+
immediate: !0
|
|
578
581
|
}), ye(() => M.value && M.value.restaurants, (a) => {
|
|
579
582
|
a && a.length > 0 && (te.value = "");
|
|
580
583
|
}), oe({
|
|
581
584
|
create: H,
|
|
582
|
-
filteredEmployees:
|
|
585
|
+
filteredEmployees: b,
|
|
583
586
|
exportEmployees: de
|
|
584
587
|
}), (a, e) => {
|
|
585
588
|
var se, W;
|
|
586
|
-
const l = f("FmButton"), r = f("FmTooltip"), m = f("FmSearch"), g = f("FmTable"), v = f("FmListItem"),
|
|
587
|
-
return
|
|
589
|
+
const l = f("FmButton"), r = f("FmTooltip"), m = f("FmSearch"), g = f("FmTable"), v = f("FmListItem"), V = f("FmList");
|
|
590
|
+
return w(), A(Y, null, [n(rl, {
|
|
588
591
|
ref_key: "employeeFormRef",
|
|
589
592
|
ref: G,
|
|
590
593
|
modelValue: M.value,
|
|
591
594
|
"onUpdate:modelValue": e[0] || (e[0] = (i) => M.value = i),
|
|
592
595
|
"role-error-message": te.value,
|
|
593
596
|
class: "gap-8",
|
|
594
|
-
onSubmitted:
|
|
595
|
-
}, null, 8, ["modelValue", "role-error-message"]), c("div",
|
|
596
|
-
modelValue:
|
|
597
|
-
"onUpdate:modelValue": e[1] || (e[1] = (i) =>
|
|
597
|
+
onSubmitted: O
|
|
598
|
+
}, null, 8, ["modelValue", "role-error-message"]), c("div", nl, [c("div", ul, [c("div", il, [n(t(_e), {
|
|
599
|
+
modelValue: x.value,
|
|
600
|
+
"onUpdate:modelValue": e[1] || (e[1] = (i) => x.value = i),
|
|
598
601
|
"managable-only": !1,
|
|
599
602
|
multiple: "",
|
|
600
603
|
variant: "dark",
|
|
@@ -604,34 +607,34 @@ const tl = { class: "fm-typo-en-title-md-600" }, sl = { class: "space-y-40" }, o
|
|
|
604
607
|
"onUpdate:modelValue": e[2] || (e[2] = (i) => y.value = i),
|
|
605
608
|
multiple: "",
|
|
606
609
|
variant: "dark",
|
|
607
|
-
items:
|
|
610
|
+
items: I.value,
|
|
608
611
|
"selected-prefix": t(d)("hr.employee.filter.selected_role_prefix"),
|
|
609
612
|
placeholder: t(d)("hr.employee.filter.role_placeholder")
|
|
610
|
-
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])]), c("div",
|
|
613
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])]), c("div", dl, [(se = t(re)) != null && se.role.isAdmin ? (w(), D(r, {
|
|
611
614
|
key: 0,
|
|
612
615
|
content: t(d)("hr.employee.sync.tooltip")
|
|
613
616
|
}, {
|
|
614
|
-
default:
|
|
617
|
+
default: F(() => [n(l, {
|
|
615
618
|
icon: "refresh",
|
|
616
619
|
label: t(d)("hr.employee.sync.tooltip"),
|
|
617
620
|
variant: "tertiary",
|
|
618
621
|
onClick: ie
|
|
619
622
|
}, null, 8, ["label"])]),
|
|
620
623
|
_: 1
|
|
621
|
-
}, 8, ["content"])) :
|
|
624
|
+
}, 8, ["content"])) : N("", !0), n(m, {
|
|
622
625
|
modelValue: t(C),
|
|
623
626
|
"onUpdate:modelValue": e[3] || (e[3] = (i) => he(C) ? C.value = i : null),
|
|
624
627
|
autofocus: "",
|
|
625
628
|
class: "pl-4 w-[320px]",
|
|
626
629
|
placeholder: t(d)("hr.employee.search.placeholder")
|
|
627
|
-
}, null, 8, ["modelValue", "placeholder"])])]), c("div",
|
|
630
|
+
}, null, 8, ["modelValue", "placeholder"])])]), c("div", cl, [c("div", ml, [n(m, {
|
|
628
631
|
modelValue: t(C),
|
|
629
632
|
"onUpdate:modelValue": e[4] || (e[4] = (i) => he(C) ? C.value = i : null),
|
|
630
633
|
autofocus: "",
|
|
631
634
|
placeholder: t(d)("hr.employee.search.placeholder")
|
|
632
|
-
}, null, 8, ["modelValue", "placeholder"])]), n(
|
|
633
|
-
modelValue:
|
|
634
|
-
"onUpdate:modelValue": e[5] || (e[5] = (i) =>
|
|
635
|
+
}, null, 8, ["modelValue", "placeholder"])]), n(Je), c("div", pl, [n(t(_e), {
|
|
636
|
+
modelValue: x.value,
|
|
637
|
+
"onUpdate:modelValue": e[5] || (e[5] = (i) => x.value = i),
|
|
635
638
|
"managable-only": !1,
|
|
636
639
|
multiple: "",
|
|
637
640
|
variant: "dark",
|
|
@@ -640,58 +643,58 @@ const tl = { class: "fm-typo-en-title-md-600" }, sl = { class: "space-y-40" }, o
|
|
|
640
643
|
modelValue: y.value,
|
|
641
644
|
"onUpdate:modelValue": e[6] || (e[6] = (i) => y.value = i),
|
|
642
645
|
multiple: "",
|
|
643
|
-
items:
|
|
646
|
+
items: I.value,
|
|
644
647
|
variant: "dark",
|
|
645
648
|
"selected-prefix": t(d)("hr.employee.filter.selected_role_prefix"),
|
|
646
649
|
placeholder: t(d)("hr.employee.filter.role_placeholder")
|
|
647
|
-
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])]), (W = t(
|
|
650
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])]), (W = t(k)) != null && W._id ? (w(), D(He, {
|
|
648
651
|
key: 0
|
|
649
652
|
}, {
|
|
650
|
-
default:
|
|
653
|
+
default: F(() => [c("div", vl, [E.value === 0 && !t(h).isLoading.value ? (w(), D(t(We), {
|
|
651
654
|
key: 0,
|
|
652
655
|
title: t(d)("hr.employee.noData.title"),
|
|
653
656
|
subtitle: t(d)("hr.employee.noData.subtitle")
|
|
654
|
-
}, null, 8, ["title", "subtitle"])) :
|
|
657
|
+
}, null, 8, ["title", "subtitle"])) : N("", !0), E.value > 0 || t(h).isLoading.value ? (w(), D(g, {
|
|
655
658
|
key: X.value,
|
|
656
|
-
class:
|
|
659
|
+
class: Te(["xs:hidden employee-list-table min-h-0 flex-1", {
|
|
657
660
|
"employee-list-table--pagination-loading": z.value
|
|
658
661
|
}]),
|
|
659
662
|
"column-defs": s,
|
|
660
|
-
"row-data":
|
|
661
|
-
"page-size":
|
|
662
|
-
"page-count": Math.ceil(E.value /
|
|
663
|
+
"row-data": b.value,
|
|
664
|
+
"page-size": T,
|
|
665
|
+
"page-count": Math.ceil(E.value / T),
|
|
663
666
|
"row-count": E.value,
|
|
664
667
|
"fetch-fn": me,
|
|
665
|
-
"hide-footer": E.value <=
|
|
668
|
+
"hide-footer": E.value <= T,
|
|
666
669
|
loading: t(h).isLoading.value,
|
|
667
670
|
virtual: !1,
|
|
668
671
|
"pin-header-row": "",
|
|
669
|
-
onRowClick: e[7] || (e[7] = (i) =>
|
|
670
|
-
}, null, 8, ["class", "row-data", "page-count", "row-count", "hide-footer", "loading"]))
|
|
672
|
+
onRowClick: e[7] || (e[7] = (i) => U(i.original))
|
|
673
|
+
}, null, 8, ["class", "row-data", "page-count", "row-count", "hide-footer", "loading"])) : N("", !0), c("div", fl, [n(V, {
|
|
671
674
|
separator: ""
|
|
672
675
|
}, {
|
|
673
|
-
default:
|
|
676
|
+
default: F(() => [(w(!0), A(Y, null, Ue(b.value, (i) => (w(), D(v, {
|
|
674
677
|
key: i._id,
|
|
675
678
|
class: "py-12 px-16 items-center justify-between",
|
|
676
|
-
onClick: (
|
|
679
|
+
onClick: (B) => U(i)
|
|
677
680
|
}, {
|
|
678
|
-
default:
|
|
679
|
-
restaurants: i.restaurants.map((
|
|
681
|
+
default: F(() => [c("div", yl, [c("p", hl, [i.code ? (w(), A("span", gl, Q(i.code) + ".", 1)) : N("", !0), Ae(Q(i.name), 1)]), c("div", _l, [c("p", null, Q(t(d)("hr.employee.restaurants", {
|
|
682
|
+
restaurants: i.restaurants.map((B) => $(B)).join(", ")
|
|
680
683
|
})), 1), c("p", null, " Since: " + Q(i.since), 1)])]), n(l, {
|
|
681
684
|
icon: "delete",
|
|
682
685
|
variant: "tertiary",
|
|
683
686
|
"text-color": "neutral-gray-400",
|
|
684
|
-
onClick:
|
|
687
|
+
onClick: ze((B) => q(i), ["stop"])
|
|
685
688
|
}, null, 8, ["onClick"])]),
|
|
686
689
|
_: 2
|
|
687
690
|
}, 1032, ["onClick"]))), 128))]),
|
|
688
691
|
_: 1
|
|
689
692
|
})])])]),
|
|
690
693
|
_: 1
|
|
691
|
-
})) :
|
|
694
|
+
})) : N("", !0)])], 64);
|
|
692
695
|
};
|
|
693
696
|
}
|
|
694
|
-
}),
|
|
697
|
+
}), Dl = /* @__PURE__ */ qe(bl, [["__scopeId", "data-v-0db27cb8"]]);
|
|
695
698
|
export {
|
|
696
|
-
|
|
699
|
+
Dl as default
|
|
697
700
|
};
|