@feedmepos/mf-hrm-portal 2.3.0-dev.3 → 2.3.0-dev.31
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/{ApprovalCodeList-SjyWZghY.js → ApprovalCodeList-CWch1fPp.js} +7 -7
- package/dist/{AuditLogList-aTI3QeO0.js → AuditLogList-Dghwxogp.js} +18 -19
- package/dist/{ConditionBuilderForm.vue_vue_type_script_setup_true_lang--JTV7non.js → ConditionBuilderForm.vue_vue_type_script_setup_true_lang-BrZD73bP.js} +2 -2
- package/dist/{EmployeeList-D2Q_2ZE0.js → EmployeeList-BSrQTgKS.js} +255 -266
- package/dist/{FormItem.vue_vue_type_script_setup_true_lang-CUnlKsxk.js → FormItem.vue_vue_type_script_setup_true_lang-BaoNK72R.js} +6 -6
- package/dist/{GrantUserList-6YXLPuHR.js → GrantUserList-Cqlm7SC8.js} +8 -8
- package/dist/{Main-dSqOeBRJ.js → Main-Cv6emTjo.js} +11 -11
- package/dist/{Main-B-a6F9g8.js → Main-Cy39OsdC.js} +8 -8
- package/dist/{Main-CFIWlIaC.js → Main-GFkUfBG7.js} +5 -5
- package/dist/{PermissionSetList-DxkaPCMs.js → PermissionSetList-DckK2K9d.js} +19 -18
- package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CLegdfVG.js +4167 -0
- package/dist/{PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-fe-Rdwn4.js → PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-DQcgZ0nF.js} +1 -1
- package/dist/ResponsiveContextMenu.vue_vue_type_script_setup_true_lang-mSJFKo7r.js +132 -0
- package/dist/{RoleList-DQZ_w5uM.js → RoleList-Bfpgb4WK.js} +21 -20
- package/dist/ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-Tqp7ALu_.js +530 -0
- package/dist/ScheduleGeneralPage-DpvA2Qmg.js +776 -0
- package/dist/ScheduleModal.vue_vue_type_script_setup_true_lang-DgXhOBUA.js +2457 -0
- package/dist/SchedulePage-DGBxv7Xl.js +19366 -0
- package/dist/{SchedulePositionPage-BGrZBU3g.js → SchedulePositionPage-CoDH-_GS.js} +79 -81
- package/dist/{SelectFilter-CG13h83-.js → SelectFilter-BmPl0nGk.js} +1 -1
- package/dist/{TeamMemberList-BiTHVJwE.js → TeamMemberList-C4sRgPCJ.js} +27 -27
- package/dist/{TimesheetList-CUkYacGW.js → TimesheetList-BvbGXbQJ.js} +52 -53
- package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-B1Y587O-.js → TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-CjlquA4w.js} +3 -3
- package/dist/{app-CAKCDrbJ.js → app-P7IBQlke.js} +2891 -2474
- package/dist/app.js +1 -1
- package/dist/{approval-code-C9DmR4Md.js → approval-code-BXUiojPH.js} +1 -1
- package/dist/{dayjs.min-CZ8QYRoc.js → dayjs.min-F98FDy4j.js} +1 -1
- package/dist/{employee-D56eWEFe.js → employee-1Xm80pW8.js} +51 -47
- package/dist/{grant-user-Bv-pJ9Wt.js → grant-user-CBJ3gEgW.js} +1 -1
- package/dist/{iteration-BVJdyLNq.js → iteration-BdSsaLV1.js} +1 -1
- package/dist/{lodash-BcIRkQPW.js → lodash-DbhAtFh7.js} +1 -1
- package/dist/object-Dwyg2LgX.js +16 -0
- package/dist/{restaurant-D7PEQjPY.js → restaurant-D2mfKHaH.js} +48 -48
- package/dist/{role-B-eZDaBX.js → role-BPGfYbnf.js} +2 -2
- package/dist/{rule-D6AIfx8b.js → rule-C3777WTe.js} +3 -3
- package/dist/src/api/employee/index.d.ts +2 -2
- package/dist/src/api/schedule/index.d.ts +17 -2
- package/dist/src/components/layout/SchedulePromoBanner.vue.d.ts +2 -0
- package/dist/src/composables/useDiscardConfirm.d.ts +3 -1
- package/dist/src/composables/useMessage.d.ts +8 -2
- package/dist/src/stores/employee.d.ts +12 -12
- package/dist/src/types/schedule.d.ts +3 -4
- package/dist/src/views/audit-log/locales/index.d.ts +252 -0
- package/dist/src/views/scheduling/components/ScheduleAreaRows.vue.d.ts +4 -8
- package/dist/src/views/scheduling/components/{ScheduleAssignEmployeePopover.vue.d.ts → ScheduleAutoScheduleDetailsModal.vue.d.ts} +2 -2
- package/dist/src/views/scheduling/components/ScheduleAutoScheduleDoneArt.vue.d.ts +2 -0
- package/dist/src/views/scheduling/components/ScheduleBoardAreaRows.vue.d.ts +1 -4
- package/dist/src/views/scheduling/components/ScheduleBoardEditOverlays.vue.d.ts +0 -2
- package/dist/src/views/scheduling/components/ScheduleBoardEmployeeRows.vue.d.ts +0 -7
- package/dist/src/views/scheduling/components/ScheduleBoardGridHeader.vue.d.ts +5 -0
- package/dist/src/views/scheduling/components/ScheduleBoardInteractionOverlays.vue.d.ts +2 -6
- package/dist/src/views/scheduling/components/ScheduleBoardOnboardingOverlays.vue.d.ts +1 -0
- package/dist/src/views/scheduling/components/ScheduleBoardToolbar.vue.d.ts +0 -1
- package/dist/src/views/scheduling/components/ScheduleCompletionDialog.vue.d.ts +1 -1
- package/dist/src/views/scheduling/components/ScheduleConfirmModal.vue.d.ts +4 -1
- package/dist/src/views/scheduling/components/ScheduleContextMenu.vue.d.ts +1 -5
- package/dist/src/views/scheduling/components/ScheduleDayTimeline.vue.d.ts +5 -0
- package/dist/src/views/scheduling/components/ScheduleLoadState.vue.d.ts +0 -1
- package/dist/src/views/scheduling/components/ScheduleOnboardingAssignPositionModal.vue.d.ts +6 -0
- package/dist/src/views/scheduling/components/ScheduleOnboardingSettings.vue.d.ts +6 -0
- package/dist/src/views/scheduling/components/SchedulePublishShareArt.vue.d.ts +2 -0
- package/dist/src/views/scheduling/components/ScheduleSelect.vue.d.ts +10 -0
- package/dist/src/views/scheduling/components/ScheduleShiftPopover.vue.d.ts +1 -1
- package/dist/src/views/scheduling/components/ScheduleStaffRows.vue.d.ts +0 -10
- package/dist/src/views/scheduling/composables/auto-schedule-mapping.d.ts +33 -0
- package/dist/src/views/scheduling/composables/onboarding-types.d.ts +2 -1
- package/dist/src/views/scheduling/composables/remyPrompt.d.ts +15 -0
- package/dist/src/views/scheduling/composables/schedule-add-employee-form.d.ts +12 -8
- package/dist/src/views/scheduling/composables/schedule-board-helpers.d.ts +4 -0
- package/dist/src/views/scheduling/composables/schedule-day-meta.d.ts +1 -3
- package/dist/src/views/scheduling/composables/schedule-demand-domain.d.ts +13 -1
- package/dist/src/views/scheduling/composables/schedule-error.d.ts +1 -0
- package/dist/src/views/scheduling/composables/schedule-quick-pick.d.ts +22 -0
- package/dist/src/views/scheduling/composables/schedule-shift-time.d.ts +3 -0
- package/dist/src/views/scheduling/composables/useRemyAppStore.d.ts +16 -0
- package/dist/src/views/scheduling/composables/useScheduleAddEmployee.d.ts +46 -11
- package/dist/src/views/scheduling/composables/useScheduleAddPick.d.ts +3 -11
- package/dist/src/views/scheduling/composables/useScheduleAreaBoard.d.ts +0 -13
- package/dist/src/views/scheduling/composables/useScheduleAreaDragDrop.d.ts +2 -9
- package/dist/src/views/scheduling/composables/useScheduleAutoSchedule.d.ts +126 -4
- package/dist/src/views/scheduling/composables/useScheduleBoard.d.ts +86 -11
- package/dist/src/views/scheduling/composables/useScheduleCopyWeek.d.ts +3 -10
- package/dist/src/views/scheduling/composables/useScheduleCostRail.d.ts +13 -1
- package/dist/src/views/scheduling/composables/useScheduleDayNote.d.ts +0 -1
- package/dist/src/views/scheduling/composables/useScheduleDayTimeline.d.ts +16 -5
- package/dist/src/views/scheduling/composables/useScheduleDemand.d.ts +3 -5
- package/dist/src/views/scheduling/composables/useScheduleDemandSheet.d.ts +14 -3
- package/dist/src/views/scheduling/composables/useScheduleDragDrop.d.ts +1 -0
- package/dist/src/views/scheduling/composables/useScheduleEmployeeAccess.d.ts +20 -7
- package/dist/src/views/scheduling/composables/useScheduleEmployeeAvailability.d.ts +1 -1
- package/dist/src/views/scheduling/composables/useScheduleEmployeeCandidates.d.ts +26 -3
- package/dist/src/views/scheduling/composables/useScheduleEmployeePersistence.d.ts +7 -0
- package/dist/src/views/scheduling/composables/useScheduleEmployeeValidation.d.ts +2 -2
- package/dist/src/views/scheduling/composables/useScheduleGapPopover.d.ts +2 -0
- package/dist/src/views/scheduling/composables/useScheduleOnboardingDemand.d.ts +1 -1
- package/dist/src/views/scheduling/composables/useScheduleOnboardingEmployees.d.ts +48 -4
- package/dist/src/views/scheduling/composables/useScheduleOnboardingWizard.d.ts +425 -29
- package/dist/src/views/scheduling/composables/useScheduleOutlet.d.ts +11 -8
- package/dist/src/views/scheduling/composables/useSchedulePageActions.d.ts +1 -1
- package/dist/src/views/scheduling/composables/useSchedulePageCellDrop.d.ts +3 -1
- package/dist/src/views/scheduling/composables/useSchedulePageClearActions.d.ts +1 -0
- package/dist/src/views/scheduling/composables/useSchedulePageOverlays.d.ts +0 -4
- package/dist/src/views/scheduling/composables/useSchedulePositionModal.d.ts +1 -0
- package/dist/src/views/scheduling/composables/useSchedulePositions.d.ts +7 -1
- package/dist/src/views/scheduling/composables/useSchedulePublish.d.ts +3 -0
- package/dist/src/views/scheduling/composables/useScheduleRoster.d.ts +70 -4
- package/dist/src/views/scheduling/composables/useScheduleSettings.d.ts +7 -2
- package/dist/src/views/scheduling/composables/useScheduleSetupBanner.d.ts +2 -2
- package/dist/src/views/scheduling/composables/useScheduleShiftActions.d.ts +41 -3
- package/dist/src/views/scheduling/composables/useScheduleShiftDraft.d.ts +1 -0
- package/dist/src/views/scheduling/composables/useScheduleShiftPopover.d.ts +47 -6
- package/dist/src/views/scheduling/country-rules/index.d.ts +9 -4
- package/dist/src/views/scheduling/data.d.ts +22 -1
- package/dist/src/views/scheduling/locales/index.d.ts +28 -0
- package/dist/src/views/scheduling/schedule-state.d.ts +362 -298
- package/dist/src/views/scheduling/schedule-store.d.ts +41 -12
- package/dist/src/views/scheduling/types.d.ts +33 -5
- package/dist/style.css +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{useAppStore-d_nHyK5u.js → useAppStore-DZCdxlCd.js} +1 -1
- package/dist/useDiscardConfirm-CzZSPyvh.js +28 -0
- package/dist/{useLoading-JFoghhRz.js → useLoading-Nygx2zn8.js} +1 -1
- package/dist/{useReportPermissions-DHA0jrIr.js → useReportPermissions-CW4Tk5tm.js} +3 -3
- package/package.json +3 -2
- package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-DnKckKZ0.js +0 -4167
- package/dist/ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-Dr6QruG6.js +0 -470
- package/dist/ScheduleGeneralPage-CvskrXcV.js +0 -666
- package/dist/ScheduleModal.vue_vue_type_script_setup_true_lang-C4On5sVD.js +0 -2157
- package/dist/SchedulePage-CW-K836l.js +0 -18248
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
- package/dist/src/views/scheduling/components/ScheduleAllShiftsRow.vue.d.ts +0 -22
- package/dist/src/views/scheduling/components/ScheduleStackPopover.vue.d.ts +0 -14
- package/dist/src/views/scheduling/composables/scheduleAutoSolver.d.ts +0 -23
- package/dist/src/views/scheduling/composables/useScheduleAllShiftsRow.d.ts +0 -77
- package/dist/src/views/scheduling/composables/useScheduleAssign.d.ts +0 -124
- package/dist/src/views/scheduling/composables/useScheduleOpenShiftCard.d.ts +0 -23
- package/dist/useDiscardConfirm-DPhEV6v0.js +0 -157
|
@@ -1,35 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useI18n as
|
|
3
|
-
import { useSnackbar as
|
|
4
|
-
import { S as
|
|
5
|
-
import { _ as
|
|
6
|
-
import { _ as
|
|
7
|
-
import {
|
|
8
|
-
import { _ as
|
|
9
|
-
import { s as
|
|
10
|
-
import { u as
|
|
11
|
-
import { n as
|
|
12
|
-
import { u as
|
|
13
|
-
import { u as
|
|
14
|
-
import { l as
|
|
15
|
-
import { _ as
|
|
16
|
-
import { u as
|
|
17
|
-
import { u as
|
|
1
|
+
import { defineComponent as Ce, ref as v, computed as h, watch as Z, resolveComponent as E, createElementBlock as X, openBlock as g, Fragment as Ue, renderSlot as Ke, createVNode as i, unref as l, withCtx as y, createElementVNode as f, createBlock as I, createCommentVNode as B, toDisplayString as j, onUnmounted as Oe, isRef as be, normalizeClass as ke, createTextVNode as ye, withModifiers as Ge, resolveDynamicComponent as Be, h as ne } from "vue";
|
|
2
|
+
import { useI18n as Fe, useCoreStore as je } from "@feedmepos/mf-common";
|
|
3
|
+
import { useSnackbar as Ie, components as Me, useDialog as qe, useBreakpoints as He } from "@feedmepos/ui-library";
|
|
4
|
+
import { S as ie } from "./SelectFilter-BmPl0nGk.js";
|
|
5
|
+
import { _ as We, b as Je, a as Qe } from "./app-P7IBQlke.js";
|
|
6
|
+
import { _ as we, u as Ye, H as Ze } from "./FormItem.vue_vue_type_script_setup_true_lang-BaoNK72R.js";
|
|
7
|
+
import { _ as Xe } from "./ResponsiveContextMenu.vue_vue_type_script_setup_true_lang-mSJFKo7r.js";
|
|
8
|
+
import { _ as ea } from "./TableEmptyState.vue_vue_type_script_setup_true_lang-IfAZmWr0.js";
|
|
9
|
+
import { s as aa, _ as la, a as sa, b as ta, c as xe } from "./PasscodePinField.vue_vue_type_script_setup_true_lang-CqG0v0Sz.js";
|
|
10
|
+
import { u as oa } from "./useDebounce-B8ZPVS5C.js";
|
|
11
|
+
import { n as ra } from "./string-VNuQNweN.js";
|
|
12
|
+
import { u as Re, E as na } from "./employee-1Xm80pW8.js";
|
|
13
|
+
import { u as $e } from "./restaurant-D2mfKHaH.js";
|
|
14
|
+
import { l as ia } from "./lodash-DbhAtFh7.js";
|
|
15
|
+
import { _ as Ee } from "./FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js";
|
|
16
|
+
import { u as ua } from "./useDiscardConfirm-CzZSPyvh.js";
|
|
17
|
+
import { u as Le } from "./useLoading-Nygx2zn8.js";
|
|
18
|
+
import { c as Ve } from "./object-Dwyg2LgX.js";
|
|
19
|
+
import { u as ge } from "./role-BPGfYbnf.js";
|
|
18
20
|
/* empty css */
|
|
19
|
-
|
|
20
|
-
function Se($) {
|
|
21
|
-
return JSON.parse(JSON.stringify($));
|
|
22
|
-
}
|
|
23
|
-
function Ce($) {
|
|
24
|
-
if (typeof structuredClone > "u")
|
|
25
|
-
return Se($);
|
|
26
|
-
try {
|
|
27
|
-
return structuredClone(Ke($));
|
|
28
|
-
} catch {
|
|
29
|
-
return Se($);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
const da = { class: "flex w-full items-center justify-between" }, pa = { class: "fm-typo-en-title-md-600" }, fa = { class: "space-y-40" }, va = { class: "flex flex-row gap-16" }, ya = { class: "space-y-16" }, ga = { class: "flex gap-8 items-center justify-start" }, Ue = 4, ha = /* @__PURE__ */ Fe({
|
|
21
|
+
const ma = { class: "flex w-full items-center justify-between" }, ca = { class: "fm-typo-en-title-md-600" }, da = { class: "space-y-40" }, pa = { class: "flex flex-row gap-16" }, fa = { class: "space-y-16" }, va = { class: "flex gap-8 items-center justify-start" }, Se = 4, ya = /* @__PURE__ */ Ce({
|
|
33
22
|
__name: "EmployeeForm",
|
|
34
23
|
props: {
|
|
35
24
|
roleErrorMessage: {
|
|
@@ -38,30 +27,30 @@ const da = { class: "flex w-full items-center justify-between" }, pa = { class:
|
|
|
38
27
|
}
|
|
39
28
|
},
|
|
40
29
|
emits: ["submitted"],
|
|
41
|
-
setup(
|
|
42
|
-
const
|
|
43
|
-
function
|
|
30
|
+
setup(Pe, { expose: ue, emit: n }) {
|
|
31
|
+
const w = ge(), d = $e(), C = Re(), me = Ie(), U = Le(me), ce = n, { t: m } = Fe(), V = v(!1), M = v(!0);
|
|
32
|
+
function A() {
|
|
44
33
|
return {
|
|
45
34
|
restaurantId: "",
|
|
46
35
|
roleId: ""
|
|
47
36
|
};
|
|
48
37
|
}
|
|
49
|
-
function
|
|
38
|
+
function de(u) {
|
|
50
39
|
if (!u) return _();
|
|
51
|
-
const o =
|
|
40
|
+
const o = Ve(u);
|
|
52
41
|
return {
|
|
53
42
|
code: o.code ?? "",
|
|
54
43
|
isMasterUser: o.isMasterUser ?? !1,
|
|
55
44
|
name: o.name ?? "",
|
|
56
45
|
passcode: o.passcode ?? "",
|
|
57
|
-
restaurants: o.restaurants.length > 0 ? o.restaurants.map(({ restaurantId:
|
|
58
|
-
restaurantId:
|
|
46
|
+
restaurants: o.restaurants.length > 0 ? o.restaurants.map(({ restaurantId: k, roleId: S }) => ({
|
|
47
|
+
restaurantId: k,
|
|
59
48
|
roleId: S
|
|
60
|
-
})) : [
|
|
49
|
+
})) : [A()]
|
|
61
50
|
};
|
|
62
51
|
}
|
|
63
|
-
const
|
|
64
|
-
s.value =
|
|
52
|
+
const ee = (u) => {
|
|
53
|
+
s.value = de(u), b.value = Ve(s.value), H.value = u == null ? void 0 : u._id, F.value = [], s.value.passcode ? (F.value = s.value.passcode.split(""), L.value = !0) : L.value = !1, M.value = !u, V.value = !0;
|
|
65
54
|
};
|
|
66
55
|
function _() {
|
|
67
56
|
return {
|
|
@@ -69,41 +58,41 @@ const da = { class: "flex w-full items-center justify-between" }, pa = { class:
|
|
|
69
58
|
isMasterUser: !1,
|
|
70
59
|
name: "",
|
|
71
60
|
passcode: "",
|
|
72
|
-
restaurants: [
|
|
61
|
+
restaurants: [A()]
|
|
73
62
|
};
|
|
74
63
|
}
|
|
75
|
-
const T = h(() =>
|
|
76
|
-
() =>
|
|
64
|
+
const T = h(() => M.value ? m("hr.employee.form.add") : m("hr.employee.form.update")), q = h(() => M.value ? m("common.create") : m("common.update")), b = v(_()), s = v(_()), H = v(void 0), $ = h(
|
|
65
|
+
() => aa(s.value.restaurants)
|
|
77
66
|
);
|
|
78
|
-
function
|
|
67
|
+
function ae(u) {
|
|
79
68
|
var o;
|
|
80
|
-
return u ? !((o = d.restaurants.value.find((
|
|
69
|
+
return u ? !((o = d.restaurants.value.find((k) => k._id === u)) != null && o.managable) : !1;
|
|
81
70
|
}
|
|
82
|
-
function
|
|
71
|
+
function le(u) {
|
|
83
72
|
return u.isUsable;
|
|
84
73
|
}
|
|
85
|
-
const F = v([]),
|
|
86
|
-
async function
|
|
87
|
-
if (
|
|
74
|
+
const F = v([]), L = v(!1), z = v(!1), W = v(!1), se = h(() => $.value.length > 0);
|
|
75
|
+
async function P() {
|
|
76
|
+
if (se.value)
|
|
88
77
|
try {
|
|
89
78
|
const u = await U.custom(
|
|
90
|
-
() =>
|
|
91
|
-
restaurantIds:
|
|
92
|
-
excludePosUserId:
|
|
79
|
+
() => na.generateEmployeePasscode({
|
|
80
|
+
restaurantIds: $.value,
|
|
81
|
+
excludePosUserId: H.value
|
|
93
82
|
}),
|
|
94
83
|
{ isLoading: W }
|
|
95
84
|
);
|
|
96
|
-
|
|
85
|
+
L.value = !1, F.value = u.split(""), s.value.passcode = u;
|
|
97
86
|
} catch {
|
|
98
87
|
}
|
|
99
88
|
}
|
|
100
|
-
const K =
|
|
101
|
-
() => !
|
|
89
|
+
const K = ua(
|
|
90
|
+
() => !ia.isEqual(s.value, b.value),
|
|
102
91
|
() => {
|
|
103
92
|
V.value = !1;
|
|
104
93
|
}
|
|
105
94
|
);
|
|
106
|
-
async function
|
|
95
|
+
async function pe() {
|
|
107
96
|
const u = {
|
|
108
97
|
user: {
|
|
109
98
|
name: s.value.name,
|
|
@@ -114,9 +103,9 @@ const da = { class: "flex w-full items-center justify-between" }, pa = { class:
|
|
|
114
103
|
};
|
|
115
104
|
s.value.isMasterUser ? await C.createMasterEmployee(u) : (delete u.user.code, await C.createEmployee(u));
|
|
116
105
|
}
|
|
117
|
-
async function
|
|
118
|
-
var S,
|
|
119
|
-
const u = b.value, o =
|
|
106
|
+
async function J() {
|
|
107
|
+
var S, R;
|
|
108
|
+
const u = b.value, o = H.value, k = {
|
|
120
109
|
user: {
|
|
121
110
|
name: s.value.name,
|
|
122
111
|
passcode: s.value.passcode
|
|
@@ -128,7 +117,7 @@ const da = { class: "flex w-full items-center justify-between" }, pa = { class:
|
|
|
128
117
|
}))
|
|
129
118
|
};
|
|
130
119
|
if (!s.value.isMasterUser)
|
|
131
|
-
await C.updateEmployee(o,
|
|
120
|
+
await C.updateEmployee(o, k);
|
|
132
121
|
else {
|
|
133
122
|
const x = {
|
|
134
123
|
user: {
|
|
@@ -137,51 +126,51 @@ const da = { class: "flex w-full items-center justify-between" }, pa = { class:
|
|
|
137
126
|
code: s.value.code
|
|
138
127
|
},
|
|
139
128
|
roles: s.value.restaurants,
|
|
140
|
-
previousRoles: (
|
|
141
|
-
restaurantId:
|
|
142
|
-
roleId:
|
|
129
|
+
previousRoles: (R = u.restaurants) == null ? void 0 : R.map((D) => ({
|
|
130
|
+
restaurantId: D.restaurantId,
|
|
131
|
+
roleId: D.roleId
|
|
143
132
|
}))
|
|
144
133
|
};
|
|
145
134
|
b.value.isMasterUser ? await C.updateMasterEmployee(o, x) : await C.migrateToMasterUser(o, x);
|
|
146
135
|
}
|
|
147
136
|
}
|
|
148
|
-
async function
|
|
149
|
-
|
|
137
|
+
async function O() {
|
|
138
|
+
M.value ? await U.minor(
|
|
150
139
|
async () => {
|
|
151
|
-
await
|
|
140
|
+
await pe();
|
|
152
141
|
},
|
|
153
142
|
{
|
|
154
|
-
successMessage:
|
|
143
|
+
successMessage: m("hr.employee.create.successMessage"),
|
|
155
144
|
isLoading: z
|
|
156
145
|
}
|
|
157
146
|
) : await U.minor(
|
|
158
147
|
async () => {
|
|
159
|
-
await
|
|
148
|
+
await J();
|
|
160
149
|
},
|
|
161
150
|
{
|
|
162
|
-
successMessage:
|
|
151
|
+
successMessage: m("hr.employee.update.successMessage"),
|
|
163
152
|
isLoading: z
|
|
164
153
|
}
|
|
165
|
-
),
|
|
154
|
+
), ce("submitted"), V.value = !1;
|
|
166
155
|
}
|
|
167
|
-
return
|
|
156
|
+
return Z(
|
|
168
157
|
() => V.value,
|
|
169
158
|
(u) => {
|
|
170
159
|
}
|
|
171
|
-
),
|
|
160
|
+
), ue({
|
|
172
161
|
show: V,
|
|
173
|
-
trigger:
|
|
162
|
+
trigger: ee
|
|
174
163
|
}), (u, o) => {
|
|
175
|
-
const
|
|
176
|
-
return g(),
|
|
177
|
-
|
|
178
|
-
i(
|
|
164
|
+
const k = E("FmIcon"), S = E("FmSwitch"), R = E("FmTextField"), x = E("FmFormGroup"), D = E("fm-button"), te = E("fm-side-sheet");
|
|
165
|
+
return g(), X(Ue, null, [
|
|
166
|
+
Ke(u.$slots, "default", { trigger: ee }),
|
|
167
|
+
i(te, {
|
|
179
168
|
id: "unit-form",
|
|
180
169
|
modelValue: V.value,
|
|
181
170
|
"onUpdate:modelValue": o[9] || (o[9] = (t) => V.value = t),
|
|
182
|
-
"is-container": l(
|
|
171
|
+
"is-container": l(Me).FmForm,
|
|
183
172
|
"is-container-props": {
|
|
184
|
-
onValidationSuccess:
|
|
173
|
+
onValidationSuccess: O,
|
|
185
174
|
blameFormChildOnValidationFailed: !0
|
|
186
175
|
},
|
|
187
176
|
"max-width": 960,
|
|
@@ -189,9 +178,9 @@ const da = { class: "flex w-full items-center justify-between" }, pa = { class:
|
|
|
189
178
|
"onOn:clickedAway": l(K)
|
|
190
179
|
}, {
|
|
191
180
|
"side-sheet-header": y(() => [
|
|
192
|
-
f("div",
|
|
193
|
-
f("p",
|
|
194
|
-
i(
|
|
181
|
+
f("div", ma, [
|
|
182
|
+
f("p", ca, j(T.value), 1),
|
|
183
|
+
i(k, {
|
|
195
184
|
name: "close",
|
|
196
185
|
size: "md",
|
|
197
186
|
class: "cursor-pointer",
|
|
@@ -200,16 +189,16 @@ const da = { class: "flex w-full items-center justify-between" }, pa = { class:
|
|
|
200
189
|
])
|
|
201
190
|
]),
|
|
202
191
|
"side-sheet-footer": y(() => [
|
|
203
|
-
f("div",
|
|
204
|
-
i(
|
|
205
|
-
label:
|
|
192
|
+
f("div", va, [
|
|
193
|
+
i(D, {
|
|
194
|
+
label: q.value,
|
|
206
195
|
size: "lg",
|
|
207
196
|
type: "submit",
|
|
208
197
|
variant: "primary",
|
|
209
198
|
disabled: z.value
|
|
210
199
|
}, null, 8, ["label", "disabled"]),
|
|
211
|
-
i(
|
|
212
|
-
label: l(
|
|
200
|
+
i(D, {
|
|
201
|
+
label: l(m)("common.cancel"),
|
|
213
202
|
size: "lg",
|
|
214
203
|
variant: "tertiary",
|
|
215
204
|
disabled: z.value,
|
|
@@ -218,72 +207,72 @@ const da = { class: "flex w-full items-center justify-between" }, pa = { class:
|
|
|
218
207
|
])
|
|
219
208
|
]),
|
|
220
209
|
default: y(() => [
|
|
221
|
-
f("div",
|
|
222
|
-
i(
|
|
223
|
-
title: l(
|
|
210
|
+
f("div", da, [
|
|
211
|
+
i(Ee, {
|
|
212
|
+
title: l(m)("hr.employee.form.employeeSetting")
|
|
224
213
|
}, {
|
|
225
214
|
default: y(() => [
|
|
226
|
-
i(
|
|
227
|
-
label: l(
|
|
215
|
+
i(we, {
|
|
216
|
+
label: l(m)("hr.employee.form.masterUserConfig")
|
|
228
217
|
}, {
|
|
229
218
|
default: y(() => [
|
|
230
219
|
i(S, {
|
|
231
220
|
modelValue: s.value.isMasterUser,
|
|
232
221
|
"onUpdate:modelValue": o[0] || (o[0] = (t) => s.value.isMasterUser = t),
|
|
233
222
|
value: "masterUser",
|
|
234
|
-
label: l(
|
|
235
|
-
sublabel: l(
|
|
223
|
+
label: l(m)("hr.employee.form.masterUser"),
|
|
224
|
+
sublabel: l(m)("hr.employee.form.masterUserSublabel"),
|
|
236
225
|
"label-placement": "right"
|
|
237
226
|
}, null, 8, ["modelValue", "label", "sublabel"])
|
|
238
227
|
]),
|
|
239
228
|
_: 1
|
|
240
229
|
}, 8, ["label"]),
|
|
241
|
-
f("div",
|
|
242
|
-
s.value.isMasterUser ? (g(), I(
|
|
230
|
+
f("div", pa, [
|
|
231
|
+
s.value.isMasterUser ? (g(), I(R, {
|
|
243
232
|
key: 0,
|
|
244
233
|
modelValue: s.value.code,
|
|
245
234
|
"onUpdate:modelValue": o[1] || (o[1] = (t) => s.value.code = t),
|
|
246
|
-
label: l(
|
|
247
|
-
}, null, 8, ["modelValue", "label"])) :
|
|
248
|
-
i(
|
|
235
|
+
label: l(m)("hr.employee.form.code")
|
|
236
|
+
}, null, 8, ["modelValue", "label"])) : B("", !0),
|
|
237
|
+
i(R, {
|
|
249
238
|
modelValue: s.value.name,
|
|
250
239
|
"onUpdate:modelValue": o[2] || (o[2] = (t) => s.value.name = t),
|
|
251
240
|
class: "w-full",
|
|
252
|
-
label: l(
|
|
253
|
-
rules: [(t) => !!t || l(
|
|
241
|
+
label: l(m)("hr.employee.form.name"),
|
|
242
|
+
rules: [(t) => !!t || l(m)("hr.employee.form.required")]
|
|
254
243
|
}, null, 8, ["modelValue", "label", "rules"])
|
|
255
244
|
]),
|
|
256
|
-
i(
|
|
257
|
-
label: l(
|
|
245
|
+
i(we, {
|
|
246
|
+
label: l(m)("hr.employee.form.passcode")
|
|
258
247
|
}, {
|
|
259
248
|
default: y(() => [
|
|
260
|
-
f("div",
|
|
249
|
+
f("div", fa, [
|
|
261
250
|
i(x, {
|
|
262
251
|
modelValue: F.value,
|
|
263
252
|
"onUpdate:modelValue": o[6] || (o[6] = (t) => F.value = t),
|
|
264
253
|
rules: [
|
|
265
|
-
(t) => (t == null ? void 0 : t.filter((
|
|
254
|
+
(t) => (t == null ? void 0 : t.filter((G) => !!G).length) !== Se ? l(m)("hr.employee.form.passcodeRequired") : !0
|
|
266
255
|
]
|
|
267
256
|
}, {
|
|
268
257
|
default: y(() => [
|
|
269
|
-
i(
|
|
258
|
+
i(la, {
|
|
270
259
|
modelValue: F.value,
|
|
271
260
|
"onUpdate:modelValue": o[3] || (o[3] = (t) => F.value = t),
|
|
272
|
-
masked:
|
|
273
|
-
"onUpdate:masked": o[4] || (o[4] = (t) =>
|
|
274
|
-
length:
|
|
275
|
-
"toggle-label": l(
|
|
261
|
+
masked: L.value,
|
|
262
|
+
"onUpdate:masked": o[4] || (o[4] = (t) => L.value = t),
|
|
263
|
+
length: Se,
|
|
264
|
+
"toggle-label": l(m)("hr.employee.form.passcodeToggleVisibility"),
|
|
276
265
|
onComplete: o[5] || (o[5] = (t) => s.value.passcode = t)
|
|
277
266
|
}, null, 8, ["modelValue", "masked", "toggle-label"])
|
|
278
267
|
]),
|
|
279
268
|
_: 1
|
|
280
269
|
}, 8, ["modelValue", "rules"]),
|
|
281
|
-
i(
|
|
282
|
-
label: l(
|
|
283
|
-
hint: l(
|
|
270
|
+
i(sa, {
|
|
271
|
+
label: l(m)("hr.employee.form.passcodeGenerate"),
|
|
272
|
+
hint: l(m)("hr.employee.form.passcodeSelectOutletFirst"),
|
|
284
273
|
loading: W.value,
|
|
285
|
-
disabled: !
|
|
286
|
-
onClick:
|
|
274
|
+
disabled: !se.value,
|
|
275
|
+
onClick: P
|
|
287
276
|
}, null, 8, ["label", "hint", "loading", "disabled"])
|
|
288
277
|
])
|
|
289
278
|
]),
|
|
@@ -292,31 +281,31 @@ const da = { class: "flex w-full items-center justify-between" }, pa = { class:
|
|
|
292
281
|
]),
|
|
293
282
|
_: 1
|
|
294
283
|
}, 8, ["title"]),
|
|
295
|
-
i(
|
|
284
|
+
i(Ee, null, {
|
|
296
285
|
default: y(() => [
|
|
297
286
|
i(x, {
|
|
298
287
|
modelValue: s.value.restaurants,
|
|
299
288
|
"onUpdate:modelValue": o[8] || (o[8] = (t) => s.value.restaurants = t),
|
|
300
289
|
tag: "div",
|
|
301
290
|
rules: [
|
|
302
|
-
(t) => t.length > 0 || l(
|
|
303
|
-
(t) => t.every((
|
|
291
|
+
(t) => t.length > 0 || l(m)("hr.employee.form.atLeastOneRestaurant"),
|
|
292
|
+
(t) => t.every((G) => G.restaurantId && G.roleId) || l(m)("hr.employee.form.roleRequired")
|
|
304
293
|
]
|
|
305
294
|
}, {
|
|
306
295
|
default: y(() => [
|
|
307
|
-
i(
|
|
296
|
+
i(ta, {
|
|
308
297
|
modelValue: s.value.restaurants,
|
|
309
298
|
"onUpdate:modelValue": o[7] || (o[7] = (t) => s.value.restaurants = t),
|
|
310
299
|
restaurants: l(d).restaurants.value,
|
|
311
|
-
roles: l(
|
|
312
|
-
"is-role-usable":
|
|
313
|
-
"is-restaurant-locked":
|
|
314
|
-
"create-row":
|
|
315
|
-
title: l(
|
|
316
|
-
"restaurant-label": l(
|
|
317
|
-
"role-label": l(
|
|
318
|
-
"add-label": l(
|
|
319
|
-
"remove-label": l(
|
|
300
|
+
roles: l(w).roles.value,
|
|
301
|
+
"is-role-usable": le,
|
|
302
|
+
"is-restaurant-locked": ae,
|
|
303
|
+
"create-row": A,
|
|
304
|
+
title: l(m)("hr.employee.form.assignmentSection"),
|
|
305
|
+
"restaurant-label": l(m)("hr.employee.columns.restaurants"),
|
|
306
|
+
"role-label": l(m)("hr.employee.form.role"),
|
|
307
|
+
"add-label": l(m)("hr.employee.form.addAnother"),
|
|
308
|
+
"remove-label": l(m)("common.remove")
|
|
320
309
|
}, null, 8, ["modelValue", "restaurants", "roles", "title", "restaurant-label", "role-label", "add-label", "remove-label"])
|
|
321
310
|
]),
|
|
322
311
|
_: 1
|
|
@@ -331,70 +320,70 @@ const da = { class: "flex w-full items-center justify-between" }, pa = { class:
|
|
|
331
320
|
], 64);
|
|
332
321
|
};
|
|
333
322
|
}
|
|
334
|
-
}),
|
|
323
|
+
}), ga = {
|
|
335
324
|
class: "space-y-8"
|
|
336
|
-
},
|
|
325
|
+
}, ha = {
|
|
337
326
|
key: 0,
|
|
338
327
|
class: "flex w-full items-start justify-between"
|
|
339
|
-
},
|
|
328
|
+
}, _a = {
|
|
340
329
|
class: "flex items-start gap-8"
|
|
341
|
-
},
|
|
330
|
+
}, ba = {
|
|
342
331
|
class: "flex"
|
|
343
|
-
},
|
|
332
|
+
}, ka = {
|
|
344
333
|
key: 1,
|
|
345
334
|
class: "space-y-4"
|
|
346
|
-
},
|
|
335
|
+
}, wa = {
|
|
347
336
|
class: "px-16"
|
|
348
|
-
},
|
|
337
|
+
}, xa = {
|
|
349
338
|
class: "px-16 flex items-start gap-8"
|
|
350
|
-
},
|
|
339
|
+
}, Ea = {
|
|
351
340
|
class: "flex h-full flex-col overflow-auto"
|
|
352
|
-
},
|
|
341
|
+
}, Va = {
|
|
353
342
|
class: "space-y-4"
|
|
354
|
-
},
|
|
343
|
+
}, Sa = {
|
|
355
344
|
class: "fm-typo-en-body-lg-600"
|
|
356
|
-
},
|
|
345
|
+
}, Ca = {
|
|
357
346
|
key: 0,
|
|
358
347
|
class: "mr-4"
|
|
359
|
-
},
|
|
348
|
+
}, Ua = {
|
|
360
349
|
class: "text-fm-color-typo-secondary"
|
|
361
|
-
},
|
|
350
|
+
}, Fa = {
|
|
362
351
|
class: "line-clamp-2"
|
|
363
|
-
},
|
|
352
|
+
}, Ia = {
|
|
364
353
|
class: "font-bold"
|
|
365
|
-
},
|
|
354
|
+
}, N = 200, Ma = /* @__PURE__ */ Ce({
|
|
366
355
|
__name: "EmployeeList",
|
|
367
|
-
setup(
|
|
368
|
-
expose:
|
|
356
|
+
setup(Pe, {
|
|
357
|
+
expose: ue
|
|
369
358
|
}) {
|
|
370
359
|
const {
|
|
371
360
|
t: n
|
|
372
|
-
} =
|
|
361
|
+
} = Fe(), w = v(), d = Re(), C = $e(), me = je(), {
|
|
373
362
|
currentBusiness: U,
|
|
374
|
-
sessionUser:
|
|
375
|
-
} = me,
|
|
376
|
-
|
|
363
|
+
sessionUser: ce
|
|
364
|
+
} = me, m = ge(), V = h(() => C.isLoading.value), M = v(m.roles.value.length === 0);
|
|
365
|
+
Z(C.restaurants, (e) => {
|
|
377
366
|
if (e.length > 0 && d.listEmployees.value.length > 0) {
|
|
378
367
|
const a = new Map(e.map((r) => [r._id, r]));
|
|
379
368
|
d.listEmployees.value = d.listEmployees.value.map((r) => ({
|
|
380
369
|
...r,
|
|
381
370
|
restaurants: r.restaurants.map((p) => {
|
|
382
|
-
var
|
|
371
|
+
var Q, Y;
|
|
383
372
|
return {
|
|
384
373
|
...p,
|
|
385
|
-
restaurantName: ((
|
|
386
|
-
restaurantCode: ((
|
|
374
|
+
restaurantName: ((Q = a.get(p.restaurantId)) == null ? void 0 : Q.profile.name) || p.restaurantName,
|
|
375
|
+
restaurantCode: ((Y = a.get(p.restaurantId)) == null ? void 0 : Y.profile.code) ?? void 0
|
|
387
376
|
};
|
|
388
377
|
})
|
|
389
378
|
}));
|
|
390
379
|
}
|
|
391
380
|
});
|
|
392
|
-
const
|
|
381
|
+
const A = h(() => C.restaurants.value.map((e) => ({
|
|
393
382
|
label: `${e.profile.code ? `${e.profile.code} - ` : ""}${e.profile.name}`,
|
|
394
383
|
value: e._id
|
|
395
|
-
}))),
|
|
384
|
+
}))), de = Z(m.roles, (e) => {
|
|
396
385
|
if (e.length > 0) {
|
|
397
|
-
if (
|
|
386
|
+
if (M.value = !1, d.listEmployees.value.length > 0) {
|
|
398
387
|
const a = new Map(e.map((r) => [r._id, r.name]));
|
|
399
388
|
d.listEmployees.value = d.listEmployees.value.map((r) => ({
|
|
400
389
|
...r,
|
|
@@ -404,29 +393,29 @@ const da = { class: "flex w-full items-center justify-between" }, pa = { class:
|
|
|
404
393
|
}))
|
|
405
394
|
}));
|
|
406
395
|
}
|
|
407
|
-
|
|
396
|
+
de();
|
|
408
397
|
}
|
|
409
|
-
}),
|
|
398
|
+
}), ee = h(() => d.listEmployees.value), {
|
|
410
399
|
searchKey: _
|
|
411
|
-
} =
|
|
400
|
+
} = Ye(), T = v(""), q = h(() => ee.value), b = h(() => d.totalEmployees.value), s = v(1), H = h(() => d.isLoading.value), $ = v(!1), ae = h(() => {
|
|
412
401
|
var e;
|
|
413
402
|
return JSON.stringify({
|
|
414
403
|
businessId: ((e = U.value) == null ? void 0 : e._id) ?? "",
|
|
415
404
|
search: T.value.trim(),
|
|
416
|
-
restaurantIds: [...
|
|
405
|
+
restaurantIds: [...w.value ?? []].sort(),
|
|
417
406
|
roleIds: [...t.value ?? []].sort()
|
|
418
407
|
});
|
|
419
|
-
}),
|
|
408
|
+
}), le = (e) => {
|
|
420
409
|
const a = e.restaurantCode, r = e.restaurantName;
|
|
421
410
|
return a ? `${a} - ${r}` : r;
|
|
422
411
|
}, F = (e) => e.roleName || "-";
|
|
423
|
-
function
|
|
412
|
+
function L(e) {
|
|
424
413
|
return [{
|
|
425
414
|
label: n("hr.employee.form.update"),
|
|
426
|
-
onClick: () =>
|
|
415
|
+
onClick: () => k(e)
|
|
427
416
|
}, {
|
|
428
417
|
label: n("hr.employee.remove.title"),
|
|
429
|
-
onClick: () =>
|
|
418
|
+
onClick: () => R(e),
|
|
430
419
|
itemClass: "text-fm-color-typo-error"
|
|
431
420
|
}];
|
|
432
421
|
}
|
|
@@ -438,8 +427,8 @@ const da = { class: "flex w-full items-center justify-between" }, pa = { class:
|
|
|
438
427
|
onClick: (r) => {
|
|
439
428
|
r.stopPropagation();
|
|
440
429
|
}
|
|
441
|
-
}, [i(
|
|
442
|
-
items:
|
|
430
|
+
}, [i(Xe, {
|
|
431
|
+
items: L(e)
|
|
443
432
|
}, null)]), W = [{
|
|
444
433
|
accessorKey: "code",
|
|
445
434
|
size: 100,
|
|
@@ -452,9 +441,9 @@ const da = { class: "flex w-full items-center justify-between" }, pa = { class:
|
|
|
452
441
|
const a = e.row.original;
|
|
453
442
|
return i("div", {
|
|
454
443
|
class: "flex items-center gap-8"
|
|
455
|
-
}, [i(
|
|
444
|
+
}, [i(Me.FmAvatar, {
|
|
456
445
|
name: a.name,
|
|
457
|
-
initials:
|
|
446
|
+
initials: ra(a.name),
|
|
458
447
|
size: "sm",
|
|
459
448
|
class: "shrink-0"
|
|
460
449
|
}, null), i("span", {
|
|
@@ -467,9 +456,9 @@ const da = { class: "flex w-full items-center justify-between" }, pa = { class:
|
|
|
467
456
|
header: () => n("hr.employee.columns.restaurants"),
|
|
468
457
|
enableSorting: !1,
|
|
469
458
|
cell(e) {
|
|
470
|
-
return V.value ||
|
|
471
|
-
const p =
|
|
472
|
-
return
|
|
459
|
+
return V.value || M.value ? ne(xe) : e.row.original.restaurants.map((a, r) => {
|
|
460
|
+
const p = le(a);
|
|
461
|
+
return ne("div", {
|
|
473
462
|
key: a.restaurantId || r
|
|
474
463
|
}, (r ? `
|
|
475
464
|
` : "") + p);
|
|
@@ -481,11 +470,11 @@ const da = { class: "flex w-full items-center justify-between" }, pa = { class:
|
|
|
481
470
|
header: () => n("hr.employee.columns.assignedRole"),
|
|
482
471
|
enableSorting: !1,
|
|
483
472
|
cell(e) {
|
|
484
|
-
return V.value ||
|
|
473
|
+
return V.value || M.value ? ne(xe, {
|
|
485
474
|
width: "120px"
|
|
486
475
|
}) : e.row.original.restaurants.map((a, r) => {
|
|
487
476
|
const p = F(a);
|
|
488
|
-
return
|
|
477
|
+
return ne("div", {
|
|
489
478
|
key: a.restaurantId || r
|
|
490
479
|
}, (r ? `
|
|
491
480
|
` : "") + p);
|
|
@@ -508,7 +497,7 @@ const da = { class: "flex w-full items-center justify-between" }, pa = { class:
|
|
|
508
497
|
className: "flex w-full items-center justify-end"
|
|
509
498
|
});
|
|
510
499
|
}
|
|
511
|
-
}],
|
|
500
|
+
}], se = ({
|
|
512
501
|
employee: e
|
|
513
502
|
}) => i("div", {
|
|
514
503
|
class: "flex flex-col gap-4 grow p-8"
|
|
@@ -519,22 +508,22 @@ const da = { class: "flex w-full items-center justify-between" }, pa = { class:
|
|
|
519
508
|
row: {
|
|
520
509
|
original: e
|
|
521
510
|
}
|
|
522
|
-
}) : e[a.accessorKey]]))]),
|
|
511
|
+
}) : e[a.accessorKey]]))]), P = Ie(), K = qe(), pe = Le(P), J = v(!1), O = v(), u = v();
|
|
523
512
|
function o(e) {
|
|
524
513
|
const a = e.isRestricted;
|
|
525
|
-
return a &&
|
|
514
|
+
return a && P.open({
|
|
526
515
|
message: n("hr.employee.cannotUpdateMasterUser", {
|
|
527
516
|
name: e.name
|
|
528
517
|
}),
|
|
529
518
|
type: "error"
|
|
530
519
|
}), a;
|
|
531
520
|
}
|
|
532
|
-
const
|
|
521
|
+
const k = (e) => {
|
|
533
522
|
var r;
|
|
534
523
|
e && o(e) || (r = u.value) == null || r.trigger(e);
|
|
535
524
|
}, {
|
|
536
525
|
breakpoints: S
|
|
537
|
-
} =
|
|
526
|
+
} = He(), R = (e) => {
|
|
538
527
|
o(e) || K.open({
|
|
539
528
|
title: n("hr.employee.remove.title"),
|
|
540
529
|
message: n("hr.employee.remove.message", {
|
|
@@ -545,19 +534,19 @@ const da = { class: "flex w-full items-center justify-between" }, pa = { class:
|
|
|
545
534
|
text: n("common.remove"),
|
|
546
535
|
close: !1,
|
|
547
536
|
variant: "destructive",
|
|
548
|
-
isLoading:
|
|
537
|
+
isLoading: J
|
|
549
538
|
},
|
|
550
539
|
secondaryActions: {
|
|
551
540
|
text: n("common.cancel"),
|
|
552
541
|
close: !0
|
|
553
542
|
}
|
|
554
543
|
}).onPrimary(async () => {
|
|
555
|
-
if (
|
|
544
|
+
if (J.value) return;
|
|
556
545
|
const r = e.isMasterUser ? d.deleteMasterEmployee : d.deleteEmployee;
|
|
557
|
-
await
|
|
558
|
-
await r(e), await
|
|
546
|
+
await pe.minor(async () => {
|
|
547
|
+
await r(e), await fe();
|
|
559
548
|
}, {
|
|
560
|
-
isLoading:
|
|
549
|
+
isLoading: J,
|
|
561
550
|
successMessage: n("hr.employee.remove.successMessage", {
|
|
562
551
|
name: e.name
|
|
563
552
|
})
|
|
@@ -565,141 +554,141 @@ const da = { class: "flex w-full items-center justify-between" }, pa = { class:
|
|
|
565
554
|
}), K.close();
|
|
566
555
|
});
|
|
567
556
|
}, x = v("");
|
|
568
|
-
function
|
|
557
|
+
function D() {
|
|
569
558
|
var e;
|
|
570
559
|
(e = u.value) == null || e.trigger();
|
|
571
560
|
}
|
|
572
|
-
const
|
|
561
|
+
const te = h(() => ge().roles.value.map((e) => ({
|
|
573
562
|
label: e.name,
|
|
574
563
|
value: e._id
|
|
575
564
|
}))), t = v();
|
|
576
|
-
async function
|
|
565
|
+
async function G() {
|
|
577
566
|
try {
|
|
578
|
-
await d.syncUsersMeta(), await
|
|
567
|
+
await d.syncUsersMeta(), await fe(), P.open({
|
|
579
568
|
message: n("hr.employee.sync.successMessage"),
|
|
580
569
|
type: "success"
|
|
581
570
|
});
|
|
582
571
|
} catch (e) {
|
|
583
|
-
console.error("Error syncing users:", e),
|
|
572
|
+
console.error("Error syncing users:", e), P.open({
|
|
584
573
|
message: n("hr.employee.sync.errorMessage"),
|
|
585
574
|
type: "error"
|
|
586
575
|
});
|
|
587
576
|
}
|
|
588
577
|
}
|
|
589
|
-
async function
|
|
578
|
+
async function oe(e = s.value) {
|
|
590
579
|
var a, r;
|
|
591
580
|
try {
|
|
592
581
|
await d.readEmployeesPage({
|
|
593
|
-
limit:
|
|
594
|
-
offset: (e - 1) *
|
|
582
|
+
limit: N,
|
|
583
|
+
offset: (e - 1) * N,
|
|
595
584
|
search: T.value.trim() || void 0,
|
|
596
|
-
restaurantIds: (a =
|
|
585
|
+
restaurantIds: (a = w.value) != null && a.length ? w.value : void 0,
|
|
597
586
|
roleIds: (r = t.value) != null && r.length ? t.value : void 0
|
|
598
587
|
});
|
|
599
588
|
} catch (p) {
|
|
600
|
-
console.error("Failed to load employees:", p),
|
|
589
|
+
console.error("Failed to load employees:", p), P.open({
|
|
601
590
|
message: p instanceof Error ? p.message : String(p),
|
|
602
591
|
type: "error"
|
|
603
592
|
});
|
|
604
593
|
}
|
|
605
594
|
}
|
|
606
|
-
async function
|
|
595
|
+
async function fe() {
|
|
607
596
|
var a;
|
|
608
597
|
if (!((a = U.value) != null && a._id)) return;
|
|
609
|
-
await
|
|
610
|
-
const e = Math.max(1, Math.ceil(b.value /
|
|
611
|
-
s.value > e && (s.value = e, await
|
|
598
|
+
await oe(s.value);
|
|
599
|
+
const e = Math.max(1, Math.ceil(b.value / N));
|
|
600
|
+
s.value > e && (s.value = e, await oe(s.value));
|
|
612
601
|
}
|
|
613
|
-
async function
|
|
602
|
+
async function De() {
|
|
614
603
|
var e, a;
|
|
615
604
|
return await d.readAllEmployeesPage({
|
|
616
605
|
search: T.value.trim() || void 0,
|
|
617
|
-
restaurantIds: (e =
|
|
606
|
+
restaurantIds: (e = w.value) != null && e.length ? w.value : void 0,
|
|
618
607
|
roleIds: (a = t.value) != null && a.length ? t.value : void 0
|
|
619
608
|
}, b.value);
|
|
620
609
|
}
|
|
621
|
-
const
|
|
610
|
+
const Ne = oa(_, () => {
|
|
622
611
|
T.value = _.value;
|
|
623
612
|
}, 300);
|
|
624
|
-
|
|
625
|
-
let
|
|
626
|
-
async function
|
|
613
|
+
Oe(Ne);
|
|
614
|
+
let ve = !1;
|
|
615
|
+
async function Ae({
|
|
627
616
|
pageIndex: e
|
|
628
617
|
}) {
|
|
629
618
|
var a;
|
|
630
|
-
if ((a = U.value) != null && a._id && !
|
|
631
|
-
|
|
619
|
+
if ((a = U.value) != null && a._id && !ve && !(e === 0 && s.value === 1 && q.value.length > 0)) {
|
|
620
|
+
ve = !0, s.value = e + 1;
|
|
632
621
|
try {
|
|
633
|
-
await
|
|
622
|
+
await oe(s.value);
|
|
634
623
|
} finally {
|
|
635
|
-
|
|
624
|
+
ve = !1;
|
|
636
625
|
}
|
|
637
626
|
}
|
|
638
627
|
}
|
|
639
|
-
|
|
628
|
+
Z(ae, async () => {
|
|
640
629
|
var e;
|
|
641
|
-
s.value = 1,
|
|
630
|
+
s.value = 1, $.value = !1, (e = U.value) != null && e._id && (await oe(1), $.value = !0);
|
|
642
631
|
}, {
|
|
643
632
|
immediate: !0
|
|
644
|
-
}),
|
|
633
|
+
}), Z(() => O.value && O.value.restaurants, (e) => {
|
|
645
634
|
e && e.length > 0 && (x.value = "");
|
|
646
635
|
});
|
|
647
|
-
const Te = h(() => b.value >
|
|
648
|
-
return
|
|
649
|
-
create:
|
|
650
|
-
filteredEmployees:
|
|
651
|
-
exportEmployees:
|
|
636
|
+
const Te = h(() => b.value > N);
|
|
637
|
+
return ue({
|
|
638
|
+
create: D,
|
|
639
|
+
filteredEmployees: q,
|
|
640
|
+
exportEmployees: De,
|
|
652
641
|
getHasPaginationFooter: () => Te.value
|
|
653
642
|
}), (e, a) => {
|
|
654
|
-
var
|
|
655
|
-
const r = E("FmButton"), p = E("FmTooltip"),
|
|
656
|
-
return g(),
|
|
643
|
+
var he, _e;
|
|
644
|
+
const r = E("FmButton"), p = E("FmTooltip"), Q = E("FmSearch"), Y = E("FmListItem"), ze = E("FmTable");
|
|
645
|
+
return g(), X(Ue, null, [i(ya, {
|
|
657
646
|
ref_key: "employeeFormRef",
|
|
658
647
|
ref: u,
|
|
659
|
-
modelValue:
|
|
660
|
-
"onUpdate:modelValue": a[0] || (a[0] = (
|
|
648
|
+
modelValue: O.value,
|
|
649
|
+
"onUpdate:modelValue": a[0] || (a[0] = (c) => O.value = c),
|
|
661
650
|
"role-error-message": x.value,
|
|
662
651
|
class: "gap-8",
|
|
663
|
-
onSubmitted:
|
|
664
|
-
}, null, 8, ["modelValue", "role-error-message"]), f("div",
|
|
652
|
+
onSubmitted: fe
|
|
653
|
+
}, null, 8, ["modelValue", "role-error-message"]), f("div", ga, [l(S).xs ? (g(), X("div", ka, [f("div", wa, [i(Q, {
|
|
665
654
|
modelValue: l(_),
|
|
666
|
-
"onUpdate:modelValue": a[4] || (a[4] = (
|
|
655
|
+
"onUpdate:modelValue": a[4] || (a[4] = (c) => be(_) ? _.value = c : null),
|
|
667
656
|
placeholder: l(n)("hr.employee.search.placeholder")
|
|
668
|
-
}, null, 8, ["modelValue", "placeholder"])]), i(
|
|
669
|
-
modelValue:
|
|
670
|
-
"onUpdate:modelValue": a[5] || (a[5] = (
|
|
657
|
+
}, null, 8, ["modelValue", "placeholder"])]), i(Ze), f("div", xa, [i(ie, {
|
|
658
|
+
modelValue: w.value,
|
|
659
|
+
"onUpdate:modelValue": a[5] || (a[5] = (c) => w.value = c),
|
|
671
660
|
multiple: "",
|
|
672
|
-
items:
|
|
661
|
+
items: A.value,
|
|
673
662
|
variant: "dark",
|
|
674
663
|
"selected-prefix": l(n)("hr.role.columns.restaurants"),
|
|
675
664
|
placeholder: l(n)("hr.role.columns.restaurants"),
|
|
676
665
|
class: "!w-auto"
|
|
677
|
-
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), i(
|
|
666
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), i(ie, {
|
|
678
667
|
modelValue: t.value,
|
|
679
|
-
"onUpdate:modelValue": a[6] || (a[6] = (
|
|
668
|
+
"onUpdate:modelValue": a[6] || (a[6] = (c) => t.value = c),
|
|
680
669
|
multiple: "",
|
|
681
|
-
items:
|
|
670
|
+
items: te.value,
|
|
682
671
|
variant: "dark",
|
|
683
672
|
"selected-prefix": l(n)("hr.employee.filter.selected_role_prefix"),
|
|
684
673
|
placeholder: l(n)("hr.employee.filter.role_placeholder")
|
|
685
|
-
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])])) : (g(),
|
|
686
|
-
modelValue:
|
|
687
|
-
"onUpdate:modelValue": a[1] || (a[1] = (
|
|
674
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])])) : (g(), X("div", ha, [f("div", _a, [i(ie, {
|
|
675
|
+
modelValue: w.value,
|
|
676
|
+
"onUpdate:modelValue": a[1] || (a[1] = (c) => w.value = c),
|
|
688
677
|
multiple: "",
|
|
689
|
-
items:
|
|
678
|
+
items: A.value,
|
|
690
679
|
variant: "dark",
|
|
691
680
|
"selected-prefix": l(n)("hr.role.columns.restaurants"),
|
|
692
681
|
placeholder: l(n)("hr.role.columns.restaurants"),
|
|
693
682
|
class: "!w-auto"
|
|
694
|
-
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), i(
|
|
683
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), i(ie, {
|
|
695
684
|
modelValue: t.value,
|
|
696
|
-
"onUpdate:modelValue": a[2] || (a[2] = (
|
|
685
|
+
"onUpdate:modelValue": a[2] || (a[2] = (c) => t.value = c),
|
|
697
686
|
multiple: "",
|
|
698
687
|
variant: "dark",
|
|
699
|
-
items:
|
|
688
|
+
items: te.value,
|
|
700
689
|
"selected-prefix": l(n)("hr.employee.filter.selected_role_prefix"),
|
|
701
690
|
placeholder: l(n)("hr.employee.filter.role_placeholder")
|
|
702
|
-
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])]), f("div",
|
|
691
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])]), f("div", ba, [(he = l(ce)) != null && he.role.isAdmin ? (g(), I(p, {
|
|
703
692
|
key: 0,
|
|
704
693
|
content: l(n)("hr.employee.sync.tooltip")
|
|
705
694
|
}, {
|
|
@@ -707,21 +696,21 @@ const da = { class: "flex w-full items-center justify-between" }, pa = { class:
|
|
|
707
696
|
icon: "refresh",
|
|
708
697
|
label: l(n)("hr.employee.sync.tooltip"),
|
|
709
698
|
variant: "tertiary",
|
|
710
|
-
onClick:
|
|
699
|
+
onClick: G
|
|
711
700
|
}, null, 8, ["label"])]),
|
|
712
701
|
_: 1
|
|
713
|
-
}, 8, ["content"])) :
|
|
702
|
+
}, 8, ["content"])) : B("", !0), i(Q, {
|
|
714
703
|
modelValue: l(_),
|
|
715
|
-
"onUpdate:modelValue": a[3] || (a[3] = (
|
|
704
|
+
"onUpdate:modelValue": a[3] || (a[3] = (c) => be(_) ? _.value = c : null),
|
|
716
705
|
autofocus: "",
|
|
717
706
|
class: "pl-4 w-[320px]",
|
|
718
707
|
placeholder: l(n)("hr.employee.search.placeholder")
|
|
719
|
-
}, null, 8, ["modelValue", "placeholder"])])])), (
|
|
708
|
+
}, null, 8, ["modelValue", "placeholder"])])])), (_e = l(U)) != null && _e._id ? (g(), I(We, {
|
|
720
709
|
key: 2
|
|
721
710
|
}, {
|
|
722
|
-
default: y(() => [f("div",
|
|
711
|
+
default: y(() => [f("div", Ea, [!$.value && l(d).isLoading.value ? (g(), I(Je, {
|
|
723
712
|
key: 0
|
|
724
|
-
})) :
|
|
713
|
+
})) : B("", !0), $.value ? (g(), I(ea, {
|
|
725
714
|
key: 1,
|
|
726
715
|
"is-loading": l(d).isLoading.value,
|
|
727
716
|
"is-empty": b.value === 0,
|
|
@@ -729,59 +718,59 @@ const da = { class: "flex w-full items-center justify-between" }, pa = { class:
|
|
|
729
718
|
subtitle: l(n)("hr.employee.noData.subtitle")
|
|
730
719
|
}, {
|
|
731
720
|
default: y(() => [(g(), I(ze, {
|
|
732
|
-
key:
|
|
721
|
+
key: ae.value,
|
|
733
722
|
class: ke(["employee-list-table h-full", {
|
|
734
|
-
"employee-list-table--pagination-loading":
|
|
723
|
+
"employee-list-table--pagination-loading": H.value
|
|
735
724
|
}]),
|
|
736
725
|
"column-defs": W,
|
|
737
|
-
"row-data":
|
|
738
|
-
"page-size":
|
|
739
|
-
"page-count": Math.ceil(b.value /
|
|
726
|
+
"row-data": q.value,
|
|
727
|
+
"page-size": N,
|
|
728
|
+
"page-count": Math.ceil(b.value / N),
|
|
740
729
|
"row-count": b.value,
|
|
741
|
-
"fetch-fn":
|
|
742
|
-
"hide-footer": b.value <=
|
|
730
|
+
"fetch-fn": Ae,
|
|
731
|
+
"hide-footer": b.value <= N,
|
|
743
732
|
loading: l(d).isLoading.value,
|
|
744
733
|
virtual: !1,
|
|
745
734
|
"pin-header-row": "",
|
|
746
|
-
onRowClick: a[7] || (a[7] = (
|
|
735
|
+
onRowClick: a[7] || (a[7] = (c) => k(c.original))
|
|
747
736
|
}, {
|
|
748
|
-
"list-row": y((
|
|
737
|
+
"list-row": y((c) => [l(S).xs ? (g(), I(Y, {
|
|
749
738
|
key: 0,
|
|
750
739
|
class: ke(["py-12 px-16 items-center justify-between", {
|
|
751
|
-
"border-t border-fm-color-neutral-gray-100":
|
|
740
|
+
"border-t border-fm-color-neutral-gray-100": c.index > 0
|
|
752
741
|
}]),
|
|
753
|
-
onClick: (
|
|
742
|
+
onClick: (re) => k(c.original)
|
|
754
743
|
}, {
|
|
755
|
-
default: y(() => [f("div",
|
|
744
|
+
default: y(() => [f("div", Va, [f("p", Sa, [c.original.code ? (g(), X("span", Ca, j(c.original.code) + ".", 1)) : B("", !0), ye(j(c.original.name), 1)]), f("div", Ua, [f("p", Fa, [f("span", Ia, j(l(n)("hr.employee.columns.restaurants")) + ":", 1), ye(" " + j(c.original.restaurants.map((re) => le(re)).join(", ")), 1)]), f("p", null, [a[8] || (a[8] = f("span", {
|
|
756
745
|
class: "font-bold"
|
|
757
|
-
}, "Since:", -1)),
|
|
746
|
+
}, "Since:", -1)), ye(" " + j(c.original.since), 1)])])]), i(r, {
|
|
758
747
|
icon: "delete",
|
|
759
748
|
variant: "tertiary",
|
|
760
749
|
"text-color": "neutral-gray-400",
|
|
761
|
-
onClick:
|
|
750
|
+
onClick: Ge((re) => R(c.original), ["stop"])
|
|
762
751
|
}, null, 8, ["onClick"])]),
|
|
763
752
|
_: 2
|
|
764
|
-
}, 1032, ["class", "onClick"])) : (g(), I(
|
|
753
|
+
}, 1032, ["class", "onClick"])) : (g(), I(Y, {
|
|
765
754
|
key: 1,
|
|
766
755
|
style: {
|
|
767
756
|
padding: "0"
|
|
768
757
|
},
|
|
769
|
-
onClick: (
|
|
758
|
+
onClick: (re) => k(c.original)
|
|
770
759
|
}, {
|
|
771
|
-
default: y(() => [(g(), I(
|
|
772
|
-
employee:
|
|
760
|
+
default: y(() => [(g(), I(Be(se), {
|
|
761
|
+
employee: c.original
|
|
773
762
|
}, null, 8, ["employee"]))]),
|
|
774
763
|
_: 2
|
|
775
764
|
}, 1032, ["onClick"]))]),
|
|
776
765
|
_: 1
|
|
777
766
|
}, 8, ["class", "row-data", "page-count", "row-count", "hide-footer", "loading"]))]),
|
|
778
767
|
_: 1
|
|
779
|
-
}, 8, ["is-loading", "is-empty", "title", "subtitle"])) :
|
|
768
|
+
}, 8, ["is-loading", "is-empty", "title", "subtitle"])) : B("", !0)])]),
|
|
780
769
|
_: 1
|
|
781
|
-
})) :
|
|
770
|
+
})) : B("", !0)])], 64);
|
|
782
771
|
};
|
|
783
772
|
}
|
|
784
|
-
}),
|
|
773
|
+
}), Za = /* @__PURE__ */ Qe(Ma, [["__scopeId", "data-v-5aed0d1c"]]);
|
|
785
774
|
export {
|
|
786
|
-
|
|
775
|
+
Za as default
|
|
787
776
|
};
|