@feedmepos/mf-hrm-portal 2.3.2-dev.17 → 2.3.2-dev.19
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-Bo8IbNxV.js → ApprovalCodeList-CiZcp75s.js} +14 -15
- package/dist/{AuditLogList-C7CjPILA.js → AuditLogList-AVdhUk22.js} +823 -833
- package/dist/ConditionBuilderForm.vue_vue_type_script_setup_true_lang-CGsOJ4bA.js +459 -0
- package/dist/EmployeeList-DmB3wCwv.js +896 -0
- package/dist/FormSection.vue_vue_type_script_setup_true_lang-Qsc3hk6l.js +90 -0
- package/dist/{GrantUserList-CXWGr3Wo.js → GrantUserList-CUWnDKaH.js} +15 -16
- package/dist/Main-CbJjQFFR.js +101 -0
- package/dist/{Main-bru10M5U.js → Main-D7CAtkiV.js} +2274 -2280
- package/dist/{Main-DeuWov9n.js → Main-DT4TJPRM.js} +5 -5
- package/dist/MyPosProfile-EWK8IPlZ.js +360 -0
- package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-TXPEqa46.js +126 -0
- package/dist/{PermissionSetList--xt0piQz.js → PermissionSetList-D2HDsSFi.js} +136 -137
- package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BUSup81G.js +4212 -0
- package/dist/PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-B1sb_3ow.js +1797 -0
- package/dist/RoleForm.vue_vue_type_script_setup_true_lang-D-Gve4l8.js +547 -0
- package/dist/RoleList-DRFTQcwP.js +274 -0
- package/dist/{ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-Cqo5kHcF.js → ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-b96QQsiZ.js} +1 -1
- package/dist/{ScheduleGeneralPage-DxhgBLix.js → ScheduleGeneralPage-DO6ZO_7t.js} +2 -2
- package/dist/{ScheduleModal.vue_vue_type_script_setup_true_lang-DGPwmNQb.js → ScheduleModal.vue_vue_type_script_setup_true_lang-BG0-qg1-.js} +187 -186
- package/dist/{SchedulePage-oBdEvGWN.js → SchedulePage-m9fYfgEO.js} +20 -20
- package/dist/{SchedulePositionPage-BZps-kKs.js → SchedulePositionPage-B9M8bgu1.js} +3 -3
- package/dist/{SelectFilter-Bs_LCk3L.js → SelectFilter-qanI8DEh.js} +1 -1
- package/dist/TeamMemberList-D7PIM3xv.js +2082 -0
- package/dist/TimesheetList-C_XQe3jl.js +408 -0
- package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-Dv66Af5C.js → TimesheetList.vue_vue_type_style_index_0_scoped_ffd7f807_lang-D6qTouaS.js} +7 -7
- package/dist/{app-B8xnhtVI.js → app-BuJGxfu4.js} +7973 -4103
- package/dist/app.js +3 -3
- package/dist/{approval-code-B0jU1bvk.js → approval-code-HPeWQne5.js} +1 -1
- package/dist/{dayjs.min-CdpSCqn1.js → dayjs.min-CLUgksBW.js} +34 -34
- package/dist/employee-DrsTtOKq.js +237 -0
- package/dist/{grant-user-C3C6glCk.js → grant-user-J6TSUXHn.js} +1 -1
- package/dist/{iteration-BM0iyDBd.js → index-Dl7XhjSB.js} +573 -558
- package/dist/{lodash-KK9U7NAy.js → lodash-CMqarlaS.js} +1 -1
- package/dist/member-grant-BeNgG3hd.js +54 -0
- package/dist/restaurant-9Y8x8pCL.js +49 -0
- package/dist/role-COuuwMES.js +91 -0
- package/dist/rule-50_hBJQJ.js +845 -0
- package/dist/src/api/my-pos-profile/index.d.ts +3 -0
- package/dist/src/api/sso-provider/index.d.ts +5 -0
- package/dist/src/api/staff-invite/index.d.ts +16 -0
- package/dist/src/components/CollapsibleWrapper.vue.d.ts +11 -3
- package/dist/src/components/form/SegmentedTabs.vue.d.ts +23 -0
- package/dist/src/composables/useMenuAccess.d.ts +56 -0
- package/dist/src/composables/useSsoProviders.d.ts +19 -0
- package/dist/src/composables/useStaffInviteProviders.d.ts +8 -0
- package/dist/src/composables/useTenant.d.ts +11 -0
- package/dist/src/helpers/employee-merge.d.ts +33 -0
- package/dist/src/helpers/iteration.d.ts +9 -2
- package/dist/src/helpers/member-grant.d.ts +36 -0
- package/dist/src/helpers/my-pos-profile.d.ts +37 -0
- package/dist/src/helpers/permission-set.d.ts +1 -102
- package/dist/src/helpers/pos-assignment-rows.d.ts +28 -0
- package/dist/src/helpers/restaurant-lookup.d.ts +19 -0
- package/dist/src/helpers/role-merge.d.ts +11 -0
- package/dist/src/helpers/rule.d.ts +2 -2
- package/dist/src/helpers/staff-invite.d.ts +54 -0
- package/dist/src/helpers/string.d.ts +10 -1
- package/dist/src/router/courtGuard.d.ts +4 -0
- package/dist/src/router/menu-access-guard.d.ts +17 -0
- package/dist/src/router/shared.d.ts +3 -1
- package/dist/src/stores/restaurant.d.ts +7 -7
- package/dist/src/stores/team.d.ts +31 -1
- package/dist/src/types/my-pos-profile.d.ts +24 -0
- package/dist/src/types/sso-provider.d.ts +10 -0
- package/dist/src/types/staff-invite.d.ts +100 -0
- package/dist/src/types/team.d.ts +17 -1
- package/dist/src/views/audit-log/locales/index.d.ts +12 -0
- package/dist/src/views/audit-log/useTraceIdDeepLink.d.ts +1 -1
- package/dist/src/views/hr/locales/index.d.ts +20 -0
- package/dist/src/views/hr/role/RoleForm.vue.d.ts +29 -2
- package/dist/src/views/hr/timesheet/timesheet-view.d.ts +29 -0
- package/dist/src/views/my-pos-profile/MyPosProfile.vue.d.ts +2 -0
- package/dist/src/views/my-pos-profile/components/PasscodeChangedDialog.vue.d.ts +4 -0
- package/dist/src/views/my-pos-profile/locales/index.d.ts +236 -0
- package/dist/src/views/scheduling/composables/useScheduleOnboardingAvailability.d.ts +1 -1
- package/dist/src/views/scheduling/composables/useScheduleOnboardingWizard.d.ts +1 -1
- package/dist/src/views/scheduling/composables/useScheduleShiftDraft.d.ts +1 -1
- package/dist/src/views/scheduling/composables/useScheduleShiftPopover.d.ts +1 -1
- package/dist/src/views/team/components/BasePermission.vue.d.ts +11 -0
- package/dist/src/views/team/components/ConditionPermission.vue.d.ts +11 -0
- package/dist/src/views/team/components/MemberGrantFields.vue.d.ts +51 -0
- package/dist/src/views/team/{member/MemberInfo.vue.d.ts → components/MemberStatusBadge.vue.d.ts} +2 -2
- package/dist/src/views/team/components/PortalPermissionEditor.vue.d.ts +21 -0
- package/dist/src/views/team/components/PosAssignmentRows.vue.d.ts +44 -0
- package/dist/src/views/team/components/PosRolePermission.vue.d.ts +11 -0
- package/dist/src/views/team/locales/index.d.ts +716 -0
- package/dist/src/views/team/member/AddMemberForm.vue.d.ts +48 -3
- package/dist/src/views/team/member/ExistingMemberNotice.vue.d.ts +11 -0
- package/dist/src/views/team/member/MemberDetailsCard.vue.d.ts +35 -0
- package/dist/src/views/team/member/MemberHeaderCard.vue.d.ts +19 -0
- package/dist/src/views/team/member/TeamMemberList.vue.d.ts +1 -0
- package/dist/string-DZQ1uNjn.js +22 -0
- package/dist/style.css +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{useAppStore-C1lk2Q2j.js → useAppStore-BCvZUxKY.js} +1 -1
- package/dist/{useLoading-CXdGsnHm.js → useLoading-BOt2Is3p.js} +1 -1
- package/dist/useReportPermissions-BVTpovDL.js +80 -0
- package/dist/useSsoProviders-Bec-WHC7.js +41 -0
- package/package.json +2 -2
- package/dist/ConditionBuilderForm.vue_vue_type_script_setup_true_lang-C-4BaMN-.js +0 -438
- package/dist/EmployeeList-BOP-gaTp.js +0 -776
- package/dist/FormItem.vue_vue_type_script_setup_true_lang-BEOR-8QD.js +0 -45
- package/dist/FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js +0 -49
- package/dist/Main-BrP1frfO.js +0 -96
- package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-CqG0v0Sz.js +0 -243
- package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-D5nvRsW3.js +0 -4167
- package/dist/PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-DiNDrCy0.js +0 -35
- package/dist/RoleList-BEE-8EQK.js +0 -740
- package/dist/TeamMemberList-DCgNcs4P.js +0 -1154
- package/dist/TimesheetList-BW6iCigo.js +0 -402
- package/dist/employee-DlFGiUgI.js +0 -209
- package/dist/restaurant-C7o2Yk6j.js +0 -2688
- package/dist/role-DYCorsOh.js +0 -92
- package/dist/rule-BhGHZqKO.js +0 -783
- package/dist/string-VNuQNweN.js +0 -15
- package/dist/useReportPermissions-D_I4rFVo.js +0 -82
|
@@ -0,0 +1,408 @@
|
|
|
1
|
+
import { ref as f, computed as _, toRaw as E, defineComponent as ve, onMounted as he, watch as ee, resolveComponent as p, createElementBlock as N, openBlock as I, Fragment as te, createVNode as s, createElementVNode as i, unref as n, withCtx as D, createCommentVNode as ge, toDisplayString as R, createTextVNode as ye, isRef as we, renderList as be, createBlock as ae, nextTick as _e } from "vue";
|
|
2
|
+
import { d as b } from "./dayjs.min-CLUgksBW.js";
|
|
3
|
+
import { useI18n as xe } from "@feedmepos/mf-common";
|
|
4
|
+
import { useSnackbar as De, components as Se } from "@feedmepos/ui-library";
|
|
5
|
+
import { S as Ve } from "./SelectFilter-qanI8DEh.js";
|
|
6
|
+
import { _ as ke, a as Ce } from "./app-BuJGxfu4.js";
|
|
7
|
+
import { _ as Fe } from "./TableEmptyState.vue_vue_type_script_setup_true_lang-IfAZmWr0.js";
|
|
8
|
+
import { u as Ye } from "./useLoading-BOt2Is3p.js";
|
|
9
|
+
import { n as Me } from "./string-DZQ1uNjn.js";
|
|
10
|
+
import { u as Te } from "./employee-DrsTtOKq.js";
|
|
11
|
+
import { u as Le } from "./restaurant-9Y8x8pCL.js";
|
|
12
|
+
import { u as Ie } from "./TimesheetList.vue_vue_type_style_index_0_scoped_ffd7f807_lang-D6qTouaS.js";
|
|
13
|
+
import { g as Re, s as $e } from "./index-Dl7XhjSB.js";
|
|
14
|
+
import { f as Be } from "./utils-BZkjJbju.js";
|
|
15
|
+
function Ee(v, a) {
|
|
16
|
+
return ["years", "months"].find((g) => {
|
|
17
|
+
const h = v.startOf(g), r = v.endOf(g);
|
|
18
|
+
return v.isSame(h, "day") && a.isSame(r, "day");
|
|
19
|
+
}) || "days";
|
|
20
|
+
}
|
|
21
|
+
function Oe() {
|
|
22
|
+
const v = {
|
|
23
|
+
startDate: b().format("YYYY-MM-DD"),
|
|
24
|
+
endDate: b().format("YYYY-MM-DD")
|
|
25
|
+
}, a = f(v), u = _(() => {
|
|
26
|
+
if (!a.value) return "No dates selected.";
|
|
27
|
+
const r = a.value.startDate ?? "Start", d = a.value.endDate ?? "End";
|
|
28
|
+
return `${r} - ${d}`;
|
|
29
|
+
}), g = _(() => ({
|
|
30
|
+
startDate: new Date(a.value.startDate),
|
|
31
|
+
endDate: new Date(a.value.endDate)
|
|
32
|
+
}));
|
|
33
|
+
function h(r) {
|
|
34
|
+
const d = b(a.value.startDate), l = b(a.value.endDate), c = Ee(d, l), y = c === "days" ? l.diff(d, "days") + 1 : 1, S = r === "subtract" ? (V) => V.subtract(y, c) : (V) => V.add(y, c);
|
|
35
|
+
a.value = {
|
|
36
|
+
startDate: S(d).startOf(c).format("YYYY-MM-DD"),
|
|
37
|
+
endDate: S(l).endOf(c).format("YYYY-MM-DD")
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
return { dateRange: a, parsedDateRange: g, dateRangeLabel: u, setRange: h };
|
|
41
|
+
}
|
|
42
|
+
function P(v) {
|
|
43
|
+
const a = /* @__PURE__ */ new Map();
|
|
44
|
+
for (const u of v)
|
|
45
|
+
a.has(u._id) || a.set(u._id, u);
|
|
46
|
+
return a;
|
|
47
|
+
}
|
|
48
|
+
function Ae(v, a, u, g) {
|
|
49
|
+
const h = P(E(a)), r = P(E(u)), d = g ? new Set(g) : null;
|
|
50
|
+
return E(v).filter((l) => !d || d.has(l.restaurantId)).map((l) => {
|
|
51
|
+
var y;
|
|
52
|
+
const c = r.get(l.user.id);
|
|
53
|
+
return {
|
|
54
|
+
...l,
|
|
55
|
+
restaurantCode: (y = h.get(l.restaurantId)) == null ? void 0 : y.profile.code,
|
|
56
|
+
user: { ...l.user, code: c ? c.code : "" }
|
|
57
|
+
};
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
function Ke(v, a) {
|
|
61
|
+
const u = P(E(a)), g = Object.entries(Re([...v], (h) => h.user.name)).map(([h, r]) => {
|
|
62
|
+
const d = r[0], l = u.get(d.user.id);
|
|
63
|
+
return {
|
|
64
|
+
key: h,
|
|
65
|
+
user: d.user.name,
|
|
66
|
+
code: l ? l.code : d.user.code || "",
|
|
67
|
+
timesheets: r,
|
|
68
|
+
total: Be(r.reduce((c, y) => c + y.totalMin, 0))
|
|
69
|
+
};
|
|
70
|
+
});
|
|
71
|
+
return $e(g, { selector: "user" });
|
|
72
|
+
}
|
|
73
|
+
const Ue = {
|
|
74
|
+
class: "my-16 flex w-[350px] flex-col gap-40"
|
|
75
|
+
}, ze = {
|
|
76
|
+
class: "flex gap-16"
|
|
77
|
+
}, Ne = {
|
|
78
|
+
class: "flex flex-col gap-4"
|
|
79
|
+
}, Pe = {
|
|
80
|
+
class: "fm-typo-body-md-400 text-fm-color-typo-secondary"
|
|
81
|
+
}, je = {
|
|
82
|
+
class: "fm-typo-body-md-700 text-fm-color-typo-primary"
|
|
83
|
+
}, He = {
|
|
84
|
+
class: "flex flex-col gap-8"
|
|
85
|
+
}, Ge = {
|
|
86
|
+
class: "fm-typo-body-xl-700"
|
|
87
|
+
}, qe = {
|
|
88
|
+
class: "flex flex-col gap-24"
|
|
89
|
+
}, Je = {
|
|
90
|
+
class: "flex flex-col gap-8"
|
|
91
|
+
}, Qe = {
|
|
92
|
+
class: "fm-typo-body-xl-700"
|
|
93
|
+
}, We = {
|
|
94
|
+
class: "flex flex-col gap-24"
|
|
95
|
+
}, Xe = {
|
|
96
|
+
key: 0,
|
|
97
|
+
class: "fm-typo-body-sm-400 text-fm-color-typo-error mt-1 flex items-center gap-4"
|
|
98
|
+
}, Ze = {
|
|
99
|
+
class: "flex items-center justify-start gap-8"
|
|
100
|
+
}, et = {
|
|
101
|
+
class: "space-y-8"
|
|
102
|
+
}, tt = {
|
|
103
|
+
class: "flex items-start gap-8 flex-wrap xs:px-16"
|
|
104
|
+
}, at = {
|
|
105
|
+
class: "flex items-center gap-8"
|
|
106
|
+
}, ot = {
|
|
107
|
+
class: "flex h-full flex-col overflow-auto"
|
|
108
|
+
}, st = /* @__PURE__ */ ve({
|
|
109
|
+
__name: "TimesheetList",
|
|
110
|
+
setup(v) {
|
|
111
|
+
const {
|
|
112
|
+
t: a
|
|
113
|
+
} = xe(), u = De(), g = Ye(u), h = [{
|
|
114
|
+
label: a("hr.timesheet.listView"),
|
|
115
|
+
value: "listView"
|
|
116
|
+
}, {
|
|
117
|
+
label: a("hr.timesheet.userView"),
|
|
118
|
+
value: "userView"
|
|
119
|
+
}], r = f("listView"), d = _(() => {
|
|
120
|
+
var t;
|
|
121
|
+
return (t = h.find((e) => e.value === r.value)) == null ? void 0 : t.label;
|
|
122
|
+
}), l = f(""), c = Ie(), y = Te(), S = Le(), V = _(() => y.employees.value), j = _(() => Ae(c.timesheets.value, S.restaurants.value, V.value, U.value)), O = _(() => j.value.filter((t) => {
|
|
123
|
+
var e, m;
|
|
124
|
+
return t.user.name.toLowerCase().includes(l.value.toLowerCase()) || t.restaurantName.toLowerCase().includes(l.value.toLowerCase()) || ((e = t.restaurantCode) == null ? void 0 : e.toLowerCase().includes(l.value.toLowerCase())) || ((m = t.user.code) == null ? void 0 : m.toLowerCase().includes(l.value.toLowerCase()));
|
|
125
|
+
})), H = _(() => Ke(j.value, V.value)), A = _(() => H.value.filter((t) => {
|
|
126
|
+
var e;
|
|
127
|
+
return t.user.toLowerCase().includes(l.value.toLowerCase()) || ((e = t.code) == null ? void 0 : e.toLowerCase().includes(l.value.toLowerCase()));
|
|
128
|
+
})), k = f(!1), K = async () => {
|
|
129
|
+
const {
|
|
130
|
+
startDate: t,
|
|
131
|
+
endDate: e
|
|
132
|
+
} = C.value;
|
|
133
|
+
k.value = !0;
|
|
134
|
+
try {
|
|
135
|
+
await c.readTimesheet(new Date(t), new Date(e)), await _e(), z.value = Object.fromEntries(Object.entries(new Array(H.value.length).fill(!0)));
|
|
136
|
+
} catch (m) {
|
|
137
|
+
u.open({
|
|
138
|
+
title: m instanceof Error ? m.message : `${m}`,
|
|
139
|
+
type: "error"
|
|
140
|
+
});
|
|
141
|
+
} finally {
|
|
142
|
+
k.value = !1;
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
he(async () => {
|
|
146
|
+
try {
|
|
147
|
+
await S.readRestaurants(), y.employees.value.length === 0 && await y.readEmployees();
|
|
148
|
+
} catch (t) {
|
|
149
|
+
console.error("Failed to load timesheet dependencies:", t), u.open({
|
|
150
|
+
message: t instanceof Error ? t.message : String(t),
|
|
151
|
+
type: "error"
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
K();
|
|
155
|
+
});
|
|
156
|
+
const U = f(), oe = _(() => S.restaurants.value.filter((t) => t.managable).map((t) => ({
|
|
157
|
+
label: `${t.profile.code ? `${t.profile.code} - ` : ""}${t.profile.name}`,
|
|
158
|
+
value: t._id
|
|
159
|
+
}))), {
|
|
160
|
+
dateRange: C,
|
|
161
|
+
dateRangeLabel: se,
|
|
162
|
+
setRange: G
|
|
163
|
+
} = Oe();
|
|
164
|
+
ee(C, async () => {
|
|
165
|
+
K();
|
|
166
|
+
});
|
|
167
|
+
const le = [{
|
|
168
|
+
accessorKey: "user.code",
|
|
169
|
+
size: 100,
|
|
170
|
+
header: () => a("hr.employee.columns.code"),
|
|
171
|
+
cell: (t) => t.row.original.user.code || "--",
|
|
172
|
+
enableSorting: !0
|
|
173
|
+
}, {
|
|
174
|
+
accessorKey: "user",
|
|
175
|
+
header: () => a("hr.timesheet.columns.name"),
|
|
176
|
+
cell: (t) => t.row.original.user.name,
|
|
177
|
+
enableSorting: !1
|
|
178
|
+
}, {
|
|
179
|
+
accessorKey: "restaurantName",
|
|
180
|
+
header: () => a("hr.timesheet.columns.restaurant"),
|
|
181
|
+
cell: (t) => {
|
|
182
|
+
const e = t.row.original.restaurantCode, m = t.row.original.restaurantName;
|
|
183
|
+
return `${e ? e + " - " : ""}${m}`;
|
|
184
|
+
},
|
|
185
|
+
enableSorting: !0
|
|
186
|
+
}, {
|
|
187
|
+
accessorKey: "start",
|
|
188
|
+
header: () => a("hr.timesheet.columns.start"),
|
|
189
|
+
cell: (t) => t.row.original.start || "--",
|
|
190
|
+
enableSorting: !0
|
|
191
|
+
}, {
|
|
192
|
+
accessorKey: "end",
|
|
193
|
+
header: () => a("hr.timesheet.columns.end"),
|
|
194
|
+
cell: (t) => t.row.original.end || "--",
|
|
195
|
+
enableSorting: !0
|
|
196
|
+
}, {
|
|
197
|
+
name: "duration",
|
|
198
|
+
accessorKey: "duration",
|
|
199
|
+
header: () => a("hr.timesheet.columns.duration"),
|
|
200
|
+
cell: (t) => t.row.original.duration || "--",
|
|
201
|
+
enableSorting: !0
|
|
202
|
+
}], z = f({}), ne = [{
|
|
203
|
+
accessorKey: "code",
|
|
204
|
+
size: 100,
|
|
205
|
+
header: () => a("hr.employee.columns.code"),
|
|
206
|
+
cell: (t) => t.row.original.code,
|
|
207
|
+
enableSorting: !1
|
|
208
|
+
}, {
|
|
209
|
+
accessorKey: "user",
|
|
210
|
+
header: () => a("hr.timesheet.columns.name"),
|
|
211
|
+
cell: (t) => {
|
|
212
|
+
const e = t.row.original;
|
|
213
|
+
if (typeof e.user == "string") {
|
|
214
|
+
const m = t.row.getIsExpanded();
|
|
215
|
+
return s("div", {
|
|
216
|
+
class: "flex items-center gap-8"
|
|
217
|
+
}, [s("div", {
|
|
218
|
+
onClick: (x) => {
|
|
219
|
+
x.stopPropagation(), t.row.getToggleExpandedHandler()(x);
|
|
220
|
+
}
|
|
221
|
+
}, [s(Se.FmButton, {
|
|
222
|
+
variant: "tertiary",
|
|
223
|
+
icon: m ? "keyboard_arrow_up" : "keyboard_arrow_down"
|
|
224
|
+
}, null)]), e.user]);
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
enableSorting: !1
|
|
228
|
+
}, {
|
|
229
|
+
accessorKey: "start",
|
|
230
|
+
header: () => a("hr.timesheet.columns.start"),
|
|
231
|
+
cell: (t) => {
|
|
232
|
+
const e = t.row.original;
|
|
233
|
+
return (e == null ? void 0 : e.start) || "--";
|
|
234
|
+
},
|
|
235
|
+
enableSorting: !1
|
|
236
|
+
}, {
|
|
237
|
+
accessorKey: "end",
|
|
238
|
+
header: () => a("hr.timesheet.columns.end"),
|
|
239
|
+
cell: (t) => {
|
|
240
|
+
const e = t.row.original;
|
|
241
|
+
return (e == null ? void 0 : e.end) || "--";
|
|
242
|
+
},
|
|
243
|
+
enableSorting: !1
|
|
244
|
+
}, {
|
|
245
|
+
name: "duration",
|
|
246
|
+
accessorKey: "duration",
|
|
247
|
+
header: () => a("hr.timesheet.columns.hourMinute"),
|
|
248
|
+
cell: (t) => {
|
|
249
|
+
const e = t.row.original;
|
|
250
|
+
return e.total ? `Total: ${e.total}` : e.duration;
|
|
251
|
+
},
|
|
252
|
+
enableSorting: !1
|
|
253
|
+
}], F = f(!1);
|
|
254
|
+
function q(t) {
|
|
255
|
+
w.value = t, Y.value = b(w.value.startedAt).format("YYYY-MM-DD"), T.value = b(w.value.endedAt || w.value.startedAt).format("YYYY-MM-DD"), M.value = b(w.value.startedAt).format("HH:mm"), L.value = b(w.value.endedAt || w.value.startedAt).format("HH:mm"), F.value = !0;
|
|
256
|
+
}
|
|
257
|
+
const Y = f(), M = f(), T = f(), L = f(), w = f(), $ = f("");
|
|
258
|
+
async function re() {
|
|
259
|
+
const t = J(Y.value, M.value), e = J(T.value, L.value);
|
|
260
|
+
if (b(t).isAfter(e)) {
|
|
261
|
+
$.value = a("hr.timesheet.checkOutMustBeforeCheckIn");
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
g.minor(async () => {
|
|
265
|
+
await c.updateTimesheet(w.value, t, e);
|
|
266
|
+
}, {
|
|
267
|
+
successMessage: a("hr.timesheet.update.successMessage")
|
|
268
|
+
}), K(), F.value = !1;
|
|
269
|
+
}
|
|
270
|
+
const J = (t, e) => b(t).set("h", parseInt(e.split(":")[0])).set("m", parseInt(e.split(":")[1])).toISOString();
|
|
271
|
+
return ee([Y, T, M, L], ([t, e, m, x]) => {
|
|
272
|
+
(t || e || m || x) && ($.value = "");
|
|
273
|
+
}), (t, e) => {
|
|
274
|
+
const m = p("FmAvatar"), x = p("FmDatePicker"), Q = p("FmTimePicker"), ie = p("FmIcon"), B = p("FmButton"), ue = p("FmSideSheet"), W = p("FmChip"), de = p("FmDateRangePicker"), ce = p("FmMenuItem"), me = p("FmMenu"), pe = p("FmSpacer"), fe = p("FmSearch"), X = p("FmTable");
|
|
275
|
+
return I(), N(te, null, [s(ue, {
|
|
276
|
+
modelValue: F.value,
|
|
277
|
+
"onUpdate:modelValue": e[5] || (e[5] = (o) => F.value = o),
|
|
278
|
+
"dismiss-away": "",
|
|
279
|
+
header: n(a)("hr.timesheet.update.title")
|
|
280
|
+
}, {
|
|
281
|
+
"side-sheet-footer": D(() => [i("div", Ze, [s(B, {
|
|
282
|
+
label: n(a)("common.update"),
|
|
283
|
+
size: "md",
|
|
284
|
+
variant: "primary",
|
|
285
|
+
onClick: re
|
|
286
|
+
}, null, 8, ["label"]), s(B, {
|
|
287
|
+
label: n(a)("common.cancel"),
|
|
288
|
+
size: "md",
|
|
289
|
+
variant: "secondary",
|
|
290
|
+
onClick: e[4] || (e[4] = (o) => F.value = !1)
|
|
291
|
+
}, null, 8, ["label"])])]),
|
|
292
|
+
default: D(() => [i("div", Ue, [i("div", ze, [s(m, {
|
|
293
|
+
name: w.value.user.name,
|
|
294
|
+
initials: n(Me)(w.value.user.name),
|
|
295
|
+
size: "lg"
|
|
296
|
+
}, null, 8, ["name", "initials"]), i("div", Ne, [i("div", Pe, R(n(a)("hr.timesheet.employeeName")), 1), i("div", je, R(w.value.user.name), 1)])]), i("div", He, [i("div", Ge, R(n(a)("hr.timesheet.update.checkIn")), 1), i("div", qe, [s(x, {
|
|
297
|
+
modelValue: Y.value,
|
|
298
|
+
"onUpdate:modelValue": e[0] || (e[0] = (o) => Y.value = o),
|
|
299
|
+
disabled: !1,
|
|
300
|
+
label: n(a)("hr.timesheet.update.date")
|
|
301
|
+
}, null, 8, ["modelValue", "label"]), s(Q, {
|
|
302
|
+
modelValue: M.value,
|
|
303
|
+
"onUpdate:modelValue": e[1] || (e[1] = (o) => M.value = o),
|
|
304
|
+
label: n(a)("hr.timesheet.update.time")
|
|
305
|
+
}, null, 8, ["modelValue", "label"])])]), i("div", Je, [i("div", Qe, R(n(a)("hr.timesheet.update.checkOut")), 1), i("div", We, [s(x, {
|
|
306
|
+
modelValue: T.value,
|
|
307
|
+
"onUpdate:modelValue": e[2] || (e[2] = (o) => T.value = o),
|
|
308
|
+
disabled: !1,
|
|
309
|
+
label: n(a)("hr.timesheet.update.date")
|
|
310
|
+
}, null, 8, ["modelValue", "label"]), s(Q, {
|
|
311
|
+
modelValue: L.value,
|
|
312
|
+
"onUpdate:modelValue": e[3] || (e[3] = (o) => L.value = o),
|
|
313
|
+
label: n(a)("hr.timesheet.update.time")
|
|
314
|
+
}, null, 8, ["modelValue", "label"])])]), $.value ? (I(), N("div", Xe, [s(ie, {
|
|
315
|
+
color: "#FF3B30",
|
|
316
|
+
name: "error",
|
|
317
|
+
size: "sm"
|
|
318
|
+
}), ye(" " + R($.value), 1)])) : ge("", !0)])]),
|
|
319
|
+
_: 1
|
|
320
|
+
}, 8, ["modelValue", "header"]), i("div", et, [i("div", tt, [s(Ve, {
|
|
321
|
+
modelValue: U.value,
|
|
322
|
+
"onUpdate:modelValue": e[6] || (e[6] = (o) => U.value = o),
|
|
323
|
+
multiple: "",
|
|
324
|
+
items: oe.value,
|
|
325
|
+
variant: "dark",
|
|
326
|
+
"selected-prefix": n(a)("hr.role.columns.restaurants"),
|
|
327
|
+
placeholder: n(a)("hr.role.columns.restaurants"),
|
|
328
|
+
class: "!w-auto pt-[3px]"
|
|
329
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), i("div", at, [s(de, {
|
|
330
|
+
modelValue: n(C),
|
|
331
|
+
"onUpdate:modelValue": e[7] || (e[7] = (o) => we(C) ? C.value = o : null),
|
|
332
|
+
"show-predefined-range": ""
|
|
333
|
+
}, {
|
|
334
|
+
"trigger-button": D(() => [s(W, {
|
|
335
|
+
label: n(se)
|
|
336
|
+
}, null, 8, ["label"])]),
|
|
337
|
+
_: 1
|
|
338
|
+
}, 8, ["modelValue"]), s(B, {
|
|
339
|
+
icon: "chevron_left",
|
|
340
|
+
variant: "tertiary",
|
|
341
|
+
onClick: e[8] || (e[8] = (o) => n(G)("subtract"))
|
|
342
|
+
}), s(B, {
|
|
343
|
+
icon: "chevron_right",
|
|
344
|
+
variant: "tertiary",
|
|
345
|
+
onClick: e[9] || (e[9] = (o) => n(G)("add"))
|
|
346
|
+
})]), s(me, {
|
|
347
|
+
class: "pt-[3px]"
|
|
348
|
+
}, {
|
|
349
|
+
"menu-button": D(() => [s(W, {
|
|
350
|
+
label: d.value,
|
|
351
|
+
"right-icon": "keyboard_arrow_down"
|
|
352
|
+
}, null, 8, ["label"])]),
|
|
353
|
+
default: D(() => [(I(), N(te, null, be(h, (o) => s(ce, {
|
|
354
|
+
key: o.value,
|
|
355
|
+
label: o.label,
|
|
356
|
+
onClick: (Z) => r.value = o.value
|
|
357
|
+
}, null, 8, ["label", "onClick"])), 64))]),
|
|
358
|
+
_: 1
|
|
359
|
+
}), s(pe), s(fe, {
|
|
360
|
+
modelValue: l.value,
|
|
361
|
+
"onUpdate:modelValue": e[10] || (e[10] = (o) => l.value = o),
|
|
362
|
+
class: "w-[320px]",
|
|
363
|
+
placeholder: n(a)("hr.timesheet.search.placeholder")
|
|
364
|
+
}, null, 8, ["modelValue", "placeholder"])]), s(ke, {
|
|
365
|
+
class: "w-full xs:px-16"
|
|
366
|
+
}, {
|
|
367
|
+
default: D(() => [i("div", ot, [s(Fe, {
|
|
368
|
+
"is-loading": k.value,
|
|
369
|
+
"is-empty": r.value === "listView" ? O.value.length === 0 : A.value.length === 0,
|
|
370
|
+
"collapse-at": !1,
|
|
371
|
+
title: n(a)("hr.timesheet.noData.title"),
|
|
372
|
+
subtitle: ""
|
|
373
|
+
}, {
|
|
374
|
+
default: D(() => [r.value === "listView" ? (I(), ae(X, {
|
|
375
|
+
key: 0,
|
|
376
|
+
class: "min-w-[640px]",
|
|
377
|
+
"column-defs": le,
|
|
378
|
+
"row-data": O.value,
|
|
379
|
+
"page-size": O.value.length,
|
|
380
|
+
loading: k.value,
|
|
381
|
+
"pin-header-row": "",
|
|
382
|
+
"hide-footer": "",
|
|
383
|
+
"shrink-at": !1,
|
|
384
|
+
onRowClick: e[11] || (e[11] = (o) => q(o.original))
|
|
385
|
+
}, null, 8, ["row-data", "page-size", "loading"])) : (I(), ae(X, {
|
|
386
|
+
key: 1,
|
|
387
|
+
class: "min-w-[640px] timesheet-user-view",
|
|
388
|
+
"column-defs": ne,
|
|
389
|
+
"row-data": A.value,
|
|
390
|
+
"page-size": A.value.reduce((o, Z) => o + 1 + Z.timesheets.length, 0),
|
|
391
|
+
loading: k.value,
|
|
392
|
+
"pin-header-row": "",
|
|
393
|
+
"shrink-at": !1,
|
|
394
|
+
"expanded-state": z.value,
|
|
395
|
+
"get-sub-row": (o) => o.timesheets,
|
|
396
|
+
"onUpdate:expandedState": e[12] || (e[12] = (o) => z.value = o),
|
|
397
|
+
onRowClick: e[13] || (e[13] = (o) => q(o.original))
|
|
398
|
+
}, null, 8, ["row-data", "page-size", "loading", "expanded-state", "get-sub-row"]))]),
|
|
399
|
+
_: 1
|
|
400
|
+
}, 8, ["is-loading", "is-empty", "title"])])]),
|
|
401
|
+
_: 1
|
|
402
|
+
})])], 64);
|
|
403
|
+
};
|
|
404
|
+
}
|
|
405
|
+
}), wt = /* @__PURE__ */ Ce(st, [["__scopeId", "data-v-ffd7f807"]]);
|
|
406
|
+
export {
|
|
407
|
+
wt as default
|
|
408
|
+
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { d as i } from "./dayjs.min-
|
|
1
|
+
import { d as i } from "./dayjs.min-CLUgksBW.js";
|
|
2
2
|
import { defineStore as p, storeToRefs as T } from "pinia";
|
|
3
3
|
import { ref as l } from "vue";
|
|
4
|
-
import { b as c, g as
|
|
5
|
-
import { s as
|
|
4
|
+
import { b as c, g as S } from "./app-BuJGxfu4.js";
|
|
5
|
+
import { s as y } from "./index-Dl7XhjSB.js";
|
|
6
6
|
import { i as f, f as g } from "./utils-BZkjJbju.js";
|
|
7
7
|
const u = {
|
|
8
8
|
async readTimesheets(t, e) {
|
|
9
|
-
return
|
|
9
|
+
return S(await c().get(`timesheet?start=${t}&end=${e}`));
|
|
10
10
|
},
|
|
11
11
|
async updateTimesheet(t, e) {
|
|
12
12
|
await c().put(`timesheet/${t}`, e);
|
|
@@ -23,9 +23,9 @@ function A(t) {
|
|
|
23
23
|
duration: h
|
|
24
24
|
};
|
|
25
25
|
});
|
|
26
|
-
return
|
|
26
|
+
return y(e, { selector: "start" });
|
|
27
27
|
}
|
|
28
|
-
const
|
|
28
|
+
const w = p("hrm-timesheet", () => {
|
|
29
29
|
const t = l([]);
|
|
30
30
|
async function e(s, r) {
|
|
31
31
|
const a = await u.readTimesheets(
|
|
@@ -47,7 +47,7 @@ const D = p("hrm-timesheet", () => {
|
|
|
47
47
|
updateTimesheet: n
|
|
48
48
|
};
|
|
49
49
|
}), b = () => {
|
|
50
|
-
const t =
|
|
50
|
+
const t = w();
|
|
51
51
|
return {
|
|
52
52
|
...t,
|
|
53
53
|
...T(t)
|