@feedmepos/mf-hrm-portal 2.3.1 → 2.3.2-dev.10
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-CcvVEriB.js → ApprovalCodeList-RKU5B8SO.js} +14 -15
- package/dist/{AuditLogList-C61-SnWG.js → AuditLogList-DuDCMjGR.js} +796 -720
- package/dist/ConditionBuilderForm.vue_vue_type_script_setup_true_lang-pL2zRc67.js +459 -0
- package/dist/EmployeeList-nrYsS5uz.js +896 -0
- package/dist/FormSection.vue_vue_type_script_setup_true_lang-7S2w36aY.js +90 -0
- package/dist/{GrantUserList-1ErIV7b7.js → GrantUserList-BSjeC4MC.js} +15 -16
- package/dist/{Main-R0qyd8Ea.js → Main-CpuHaXU6.js} +5 -5
- package/dist/Main-DbdoVLCE.js +101 -0
- package/dist/{Main-CD8OS1rM.js → Main-DtmCBbTR.js} +1005 -999
- package/dist/MyPosProfile-CsTCfGNT.js +360 -0
- package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-TXPEqa46.js +126 -0
- package/dist/{PermissionSetList-ig3oxdhh.js → PermissionSetList-B1c-uGZO.js} +80 -80
- package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Toq6qrLx.js +4208 -0
- package/dist/PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-D6Z9z_Yt.js +1831 -0
- package/dist/RoleForm.vue_vue_type_script_setup_true_lang-TWTVo_9Y.js +547 -0
- package/dist/RoleList-CwaGNsFy.js +265 -0
- package/dist/{ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-Dg7S6nFO.js → ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-C2ekVXdR.js} +1 -1
- package/dist/{ScheduleGeneralPage-QYijA95u.js → ScheduleGeneralPage-BVtXmxtp.js} +2 -2
- package/dist/{ScheduleModal.vue_vue_type_script_setup_true_lang-Bnyqna_E.js → ScheduleModal.vue_vue_type_script_setup_true_lang-DdsQ8v-5.js} +187 -186
- package/dist/{SchedulePage-BrBZmuMj.js → SchedulePage-3qksmT2I.js} +193 -205
- package/dist/{SchedulePositionPage-NCvNg8v5.js → SchedulePositionPage-DAU20KPZ.js} +3 -3
- package/dist/{SelectFilter-r-QOCO99.js → SelectFilter-BpzBwBmQ.js} +2 -3
- package/dist/TeamMemberList-Bdpm40i3.js +2087 -0
- package/dist/TimesheetList-CL_eJp2h.js +437 -0
- package/dist/{app-DKHtjxyC.js → app-DEZT4wdV.js} +7789 -3967
- package/dist/app.js +3 -3
- package/dist/{approval-code-BIpLingm.js → approval-code-BZTz5OXK.js} +4 -4
- package/dist/{dayjs.min-CNNMpacl.js → dayjs.min-B55I-uhI.js} +21 -21
- package/dist/employee-C6z5i6O4.js +172 -0
- package/dist/{grant-user-uZmvD_bw.js → grant-user-B2rYztyf.js} +2 -2
- package/dist/{iteration-DkcNkScw.js → index-Bfdseotz.js} +698 -726
- package/dist/iteration-CcXrOMQe.js +30 -0
- package/dist/{lodash-g-62RoFP.js → lodash-B8bqa6a9.js} +1 -1
- package/dist/member-grant-BIpKkuu8.js +54 -0
- package/dist/restaurant-ejyX2jEG.js +52 -0
- package/dist/role-C_t3DDlG.js +98 -0
- package/dist/rule-Ccopk8R_.js +843 -0
- package/dist/src/api/audit-log/index.d.ts +2 -0
- package/dist/src/api/employee/index.d.ts +1 -2
- 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/api/timesheet/index.d.ts +1 -1
- 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/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/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/menu-access-guard.d.ts +17 -0
- package/dist/src/router/shared.d.ts +3 -1
- package/dist/src/stores/approval-code.d.ts +1 -1
- package/dist/src/stores/employee.d.ts +3 -9
- package/dist/src/stores/grant-user.d.ts +1 -1
- package/dist/src/stores/permission-assignment.d.ts +2 -2
- package/dist/src/stores/permission-set.d.ts +2 -2
- package/dist/src/stores/restaurant.d.ts +70 -10
- package/dist/src/stores/role.d.ts +2 -2
- package/dist/src/stores/team.d.ts +31 -1
- package/dist/src/stores/timesheet.d.ts +68 -53
- 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/types/timesheet.d.ts +3 -0
- package/dist/src/views/audit-log/locales/index.d.ts +40 -0
- package/dist/src/views/audit-log/useTraceIdDeepLink.d.ts +19 -0
- package/dist/src/views/hr/locales/index.d.ts +24 -4
- package/dist/src/views/hr/role/RoleForm.vue.d.ts +29 -2
- 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/timesheet-CZHcebqS.js +76 -0
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{useAppStore-Bp0PwbAN.js → useAppStore-DfqsbhT2.js} +1 -1
- package/dist/{useLoading-sgL8DRUz.js → useLoading-CQnX5WjI.js} +1 -1
- package/dist/useMessage-_ywT_N9X.js +17 -0
- package/dist/{useReportPermissions-CcIHwTRI.js → useReportPermissions-kTjftFk7.js} +13 -13
- package/package.json +4 -4
- package/dist/ConditionBuilderForm.vue_vue_type_script_setup_true_lang-BZ-ZDviW.js +0 -438
- package/dist/EmployeeList-Cucr2mxn.js +0 -776
- package/dist/FormItem.vue_vue_type_script_setup_true_lang-4XV2qPxn.js +0 -45
- package/dist/FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js +0 -49
- package/dist/Main-B-F_cdM_.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-ClG4YhnF.js +0 -4167
- package/dist/PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-DaAx79pC.js +0 -35
- package/dist/RoleList-BqR_Vf8H.js +0 -740
- package/dist/TeamMemberList-B6ZnfKV0.js +0 -1154
- package/dist/TimesheetList-BvsUk6kd.js +0 -402
- package/dist/TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-D3--3EhR.js +0 -58
- package/dist/employee-H2J0xRqJ.js +0 -209
- package/dist/restaurant-CHpkjUPy.js +0 -1880
- package/dist/role-CkxDtfst.js +0 -92
- package/dist/rule-BWvSqhBk.js +0 -783
- package/dist/string-VNuQNweN.js +0 -15
|
@@ -0,0 +1,437 @@
|
|
|
1
|
+
import { ref as m, computed as v, defineComponent as fe, onMounted as pe, watch as X, resolveComponent as d, createElementBlock as P, openBlock as L, Fragment as Z, createVNode as s, createElementVNode as i, unref as n, withCtx as w, createCommentVNode as ve, toDisplayString as T, createTextVNode as he, isRef as ge, renderList as De, createBlock as ee, nextTick as we } from "vue";
|
|
2
|
+
import { d as l } from "./dayjs.min-B55I-uhI.js";
|
|
3
|
+
import { useI18n as Ye } from "@feedmepos/mf-common";
|
|
4
|
+
import { useSnackbar as be, components as ye } from "@feedmepos/ui-library";
|
|
5
|
+
import { S as _e } from "./SelectFilter-BpzBwBmQ.js";
|
|
6
|
+
import { _ as Me } from "./app-DEZT4wdV.js";
|
|
7
|
+
import { _ as xe } from "./TableEmptyState.vue_vue_type_script_setup_true_lang-IfAZmWr0.js";
|
|
8
|
+
import { u as ke } from "./useLoading-CQnX5WjI.js";
|
|
9
|
+
import { g as Se, s as Ve } from "./iteration-CcXrOMQe.js";
|
|
10
|
+
import { f as Ce } from "./utils-BZkjJbju.js";
|
|
11
|
+
import { n as Fe } from "./string-DZQ1uNjn.js";
|
|
12
|
+
import { u as Le } from "./restaurant-ejyX2jEG.js";
|
|
13
|
+
import { u as Te } from "./timesheet-CZHcebqS.js";
|
|
14
|
+
function Oe(Y, a) {
|
|
15
|
+
return ["years", "months"].find((y) => {
|
|
16
|
+
const _ = Y.startOf(y), p = Y.endOf(y);
|
|
17
|
+
return Y.isSame(_, "day") && a.isSame(p, "day");
|
|
18
|
+
}) || "days";
|
|
19
|
+
}
|
|
20
|
+
function Re() {
|
|
21
|
+
const Y = {
|
|
22
|
+
startDate: l().format("YYYY-MM-DD"),
|
|
23
|
+
endDate: l().format("YYYY-MM-DD")
|
|
24
|
+
}, a = m(Y), b = v(() => {
|
|
25
|
+
if (!a.value) return "No dates selected.";
|
|
26
|
+
const p = a.value.startDate ?? "Start", g = a.value.endDate ?? "End";
|
|
27
|
+
return `${p} - ${g}`;
|
|
28
|
+
}), y = v(() => ({
|
|
29
|
+
startDate: new Date(a.value.startDate),
|
|
30
|
+
endDate: new Date(a.value.endDate)
|
|
31
|
+
}));
|
|
32
|
+
function _(p) {
|
|
33
|
+
const g = l(a.value.startDate), c = l(a.value.endDate), h = Oe(g, c), M = h === "days" ? c.diff(g, "days") + 1 : 1, O = p === "subtract" ? (D) => D.subtract(M, h) : (D) => D.add(M, h);
|
|
34
|
+
a.value = {
|
|
35
|
+
startDate: O(g).startOf(h).format("YYYY-MM-DD"),
|
|
36
|
+
endDate: O(c).endOf(h).format("YYYY-MM-DD")
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
return { dateRange: a, parsedDateRange: y, dateRangeLabel: b, setRange: _ };
|
|
40
|
+
}
|
|
41
|
+
const Ie = {
|
|
42
|
+
class: "my-16 flex w-[350px] flex-col gap-40"
|
|
43
|
+
}, $e = {
|
|
44
|
+
class: "flex gap-16"
|
|
45
|
+
}, Ae = {
|
|
46
|
+
class: "flex flex-col gap-4"
|
|
47
|
+
}, Ee = {
|
|
48
|
+
class: "fm-typo-body-md-400 text-fm-color-typo-secondary"
|
|
49
|
+
}, Ke = {
|
|
50
|
+
class: "fm-typo-body-md-700 text-fm-color-typo-primary"
|
|
51
|
+
}, Ne = {
|
|
52
|
+
class: "flex flex-col gap-8"
|
|
53
|
+
}, Ue = {
|
|
54
|
+
class: "fm-typo-body-xl-700"
|
|
55
|
+
}, ze = {
|
|
56
|
+
class: "flex flex-col gap-24"
|
|
57
|
+
}, Be = {
|
|
58
|
+
class: "flex flex-col gap-8"
|
|
59
|
+
}, Pe = {
|
|
60
|
+
class: "fm-typo-body-xl-700"
|
|
61
|
+
}, je = {
|
|
62
|
+
class: "flex flex-col gap-24"
|
|
63
|
+
}, He = {
|
|
64
|
+
key: 0,
|
|
65
|
+
class: "fm-typo-body-sm-400 text-fm-color-typo-error mt-1 flex items-center gap-4"
|
|
66
|
+
}, Ge = {
|
|
67
|
+
class: "flex items-center justify-start gap-8"
|
|
68
|
+
}, qe = {
|
|
69
|
+
class: "space-y-8"
|
|
70
|
+
}, Je = {
|
|
71
|
+
class: "flex items-start gap-8 flex-wrap xs:px-16"
|
|
72
|
+
}, Qe = {
|
|
73
|
+
class: "flex items-center gap-8"
|
|
74
|
+
}, We = {
|
|
75
|
+
class: "flex h-full flex-col overflow-auto"
|
|
76
|
+
}, ct = /* @__PURE__ */ fe({
|
|
77
|
+
__name: "TimesheetList",
|
|
78
|
+
setup(Y) {
|
|
79
|
+
const {
|
|
80
|
+
t: a
|
|
81
|
+
} = Ye(), b = be(), y = ke(b), _ = [{
|
|
82
|
+
label: a("hr.timesheet.listView"),
|
|
83
|
+
value: "listView"
|
|
84
|
+
}, {
|
|
85
|
+
label: a("hr.timesheet.userView"),
|
|
86
|
+
value: "userView"
|
|
87
|
+
}], p = m("listView"), g = v(() => {
|
|
88
|
+
var t;
|
|
89
|
+
return (t = _.find((e) => e.value === p.value)) == null ? void 0 : t.label;
|
|
90
|
+
}), c = m(""), h = Te(), M = Le(), O = v(() => new Map(M.restaurants.value.map((t) => [t._id, t.profile.code]))), D = v(() => h.timesheets.value.map((r) => {
|
|
91
|
+
const u = O.value.get(r.restaurantId);
|
|
92
|
+
return {
|
|
93
|
+
...r,
|
|
94
|
+
restaurantCode: u
|
|
95
|
+
};
|
|
96
|
+
})), R = v(() => D.value.filter((t) => {
|
|
97
|
+
var e, r;
|
|
98
|
+
return t.user.name.toLowerCase().includes(c.value.toLowerCase()) || t.restaurantName.toLowerCase().includes(c.value.toLowerCase()) || ((e = t.restaurantCode) == null ? void 0 : e.toLowerCase().includes(c.value.toLowerCase())) || ((r = t.user.code) == null ? void 0 : r.toLowerCase().includes(c.value.toLowerCase()));
|
|
99
|
+
})), j = v(() => {
|
|
100
|
+
const t = Se(D.value, (r) => r.user.name), e = Object.entries(t).map(([r, u]) => ({
|
|
101
|
+
key: r,
|
|
102
|
+
user: u[0].user.name,
|
|
103
|
+
code: u[0].user.code || "",
|
|
104
|
+
timesheets: u,
|
|
105
|
+
total: Ce(u.reduce((A, B) => A + B.totalMin, 0))
|
|
106
|
+
}));
|
|
107
|
+
return Ve(e, {
|
|
108
|
+
selector: "user"
|
|
109
|
+
});
|
|
110
|
+
}), H = v(() => j.value.filter((t) => {
|
|
111
|
+
var e;
|
|
112
|
+
return t.user.toLowerCase().includes(c.value.toLowerCase()) || ((e = t.code) == null ? void 0 : e.toLowerCase().includes(c.value.toLowerCase()));
|
|
113
|
+
})), K = m(!1), N = v(() => K.value && D.value.length === 0), U = async () => {
|
|
114
|
+
const {
|
|
115
|
+
startDate: t,
|
|
116
|
+
endDate: e
|
|
117
|
+
} = x.value;
|
|
118
|
+
K.value = !0;
|
|
119
|
+
try {
|
|
120
|
+
await h.readTimesheet(new Date(t), new Date(e), I.value), await we(), z.value = Object.fromEntries(Object.entries(new Array(j.value.length).fill(!0)));
|
|
121
|
+
} catch (r) {
|
|
122
|
+
b.open({
|
|
123
|
+
title: r instanceof Error ? r.message : `${r}`,
|
|
124
|
+
type: "error"
|
|
125
|
+
});
|
|
126
|
+
} finally {
|
|
127
|
+
K.value = !1;
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
pe(async () => {
|
|
131
|
+
try {
|
|
132
|
+
await M.readRestaurants();
|
|
133
|
+
} catch (t) {
|
|
134
|
+
console.error("Failed to load timesheet dependencies:", t), b.open({
|
|
135
|
+
message: t instanceof Error ? t.message : String(t),
|
|
136
|
+
type: "error"
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
U();
|
|
140
|
+
});
|
|
141
|
+
const I = m(), te = v(() => M.restaurants.value.filter((t) => t.managable).map((t) => ({
|
|
142
|
+
label: `${t.profile.code ? `${t.profile.code} - ` : ""}${t.profile.name}`,
|
|
143
|
+
value: t._id
|
|
144
|
+
}))), {
|
|
145
|
+
dateRange: x,
|
|
146
|
+
dateRangeLabel: ae,
|
|
147
|
+
setRange: G
|
|
148
|
+
} = Re(), oe = [{
|
|
149
|
+
label: "Today",
|
|
150
|
+
value: {
|
|
151
|
+
startDate: l().format("YYYY-MM-DD"),
|
|
152
|
+
endDate: l().format("YYYY-MM-DD")
|
|
153
|
+
}
|
|
154
|
+
}, {
|
|
155
|
+
label: "Yesterday",
|
|
156
|
+
value: {
|
|
157
|
+
startDate: l().subtract(1, "day").format("YYYY-MM-DD"),
|
|
158
|
+
endDate: l().subtract(1, "day").format("YYYY-MM-DD")
|
|
159
|
+
}
|
|
160
|
+
}, {
|
|
161
|
+
label: "This week",
|
|
162
|
+
value: {
|
|
163
|
+
startDate: l().startOf("week").format("YYYY-MM-DD"),
|
|
164
|
+
endDate: l().endOf("week").format("YYYY-MM-DD")
|
|
165
|
+
}
|
|
166
|
+
}, {
|
|
167
|
+
label: "Last week",
|
|
168
|
+
value: {
|
|
169
|
+
startDate: l().subtract(1, "week").startOf("week").format("YYYY-MM-DD"),
|
|
170
|
+
endDate: l().subtract(1, "week").endOf("week").format("YYYY-MM-DD")
|
|
171
|
+
}
|
|
172
|
+
}, {
|
|
173
|
+
label: "Last 7 days",
|
|
174
|
+
value: {
|
|
175
|
+
startDate: l().subtract(7, "day").format("YYYY-MM-DD"),
|
|
176
|
+
endDate: l().subtract(1, "day").format("YYYY-MM-DD")
|
|
177
|
+
}
|
|
178
|
+
}, {
|
|
179
|
+
label: "This month",
|
|
180
|
+
value: {
|
|
181
|
+
startDate: l().startOf("month").format("YYYY-MM-DD"),
|
|
182
|
+
endDate: l().endOf("month").format("YYYY-MM-DD")
|
|
183
|
+
}
|
|
184
|
+
}, {
|
|
185
|
+
label: "Last month",
|
|
186
|
+
value: {
|
|
187
|
+
startDate: l().subtract(1, "month").startOf("month").format("YYYY-MM-DD"),
|
|
188
|
+
endDate: l().subtract(1, "month").endOf("month").format("YYYY-MM-DD")
|
|
189
|
+
}
|
|
190
|
+
}];
|
|
191
|
+
X([x, I], async () => {
|
|
192
|
+
U();
|
|
193
|
+
});
|
|
194
|
+
const se = [{
|
|
195
|
+
accessorKey: "user.code",
|
|
196
|
+
size: 100,
|
|
197
|
+
header: () => a("hr.employee.columns.code"),
|
|
198
|
+
cell: (t) => t.row.original.user.code || "--",
|
|
199
|
+
enableSorting: !0
|
|
200
|
+
}, {
|
|
201
|
+
accessorKey: "user",
|
|
202
|
+
header: () => a("hr.timesheet.columns.name"),
|
|
203
|
+
cell: (t) => t.row.original.user.name,
|
|
204
|
+
enableSorting: !1
|
|
205
|
+
}, {
|
|
206
|
+
accessorKey: "restaurantName",
|
|
207
|
+
header: () => a("hr.timesheet.columns.restaurant"),
|
|
208
|
+
cell: (t) => {
|
|
209
|
+
const e = t.row.original.restaurantCode, r = t.row.original.restaurantName;
|
|
210
|
+
return `${e ? e + " - " : ""}${r}`;
|
|
211
|
+
},
|
|
212
|
+
enableSorting: !0
|
|
213
|
+
}, {
|
|
214
|
+
accessorKey: "start",
|
|
215
|
+
header: () => a("hr.timesheet.columns.start"),
|
|
216
|
+
cell: (t) => t.row.original.start || "--",
|
|
217
|
+
enableSorting: !0
|
|
218
|
+
}, {
|
|
219
|
+
accessorKey: "end",
|
|
220
|
+
header: () => a("hr.timesheet.columns.end"),
|
|
221
|
+
cell: (t) => t.row.original.end || "--",
|
|
222
|
+
enableSorting: !0
|
|
223
|
+
}, {
|
|
224
|
+
name: "duration",
|
|
225
|
+
accessorKey: "duration",
|
|
226
|
+
header: () => a("hr.timesheet.columns.duration"),
|
|
227
|
+
cell: (t) => t.row.original.duration || "--",
|
|
228
|
+
enableSorting: !0
|
|
229
|
+
}], z = m({}), le = [{
|
|
230
|
+
accessorKey: "code",
|
|
231
|
+
size: 100,
|
|
232
|
+
header: () => a("hr.employee.columns.code"),
|
|
233
|
+
cell: (t) => t.row.original.code,
|
|
234
|
+
enableSorting: !1
|
|
235
|
+
}, {
|
|
236
|
+
accessorKey: "user",
|
|
237
|
+
header: () => a("hr.timesheet.columns.name"),
|
|
238
|
+
cell: (t) => {
|
|
239
|
+
const e = t.row.original;
|
|
240
|
+
if (typeof e.user == "string") {
|
|
241
|
+
const r = t.row.getIsExpanded();
|
|
242
|
+
return s("div", {
|
|
243
|
+
class: "flex items-center gap-8"
|
|
244
|
+
}, [s("div", {
|
|
245
|
+
onClick: (u) => {
|
|
246
|
+
u.stopPropagation(), t.row.getToggleExpandedHandler()(u);
|
|
247
|
+
}
|
|
248
|
+
}, [s(ye.FmButton, {
|
|
249
|
+
variant: "tertiary",
|
|
250
|
+
icon: r ? "keyboard_arrow_up" : "keyboard_arrow_down"
|
|
251
|
+
}, null)]), e.user]);
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
enableSorting: !1
|
|
255
|
+
}, {
|
|
256
|
+
accessorKey: "start",
|
|
257
|
+
header: () => a("hr.timesheet.columns.start"),
|
|
258
|
+
cell: (t) => {
|
|
259
|
+
const e = t.row.original;
|
|
260
|
+
return (e == null ? void 0 : e.start) || "--";
|
|
261
|
+
},
|
|
262
|
+
enableSorting: !1
|
|
263
|
+
}, {
|
|
264
|
+
accessorKey: "end",
|
|
265
|
+
header: () => a("hr.timesheet.columns.end"),
|
|
266
|
+
cell: (t) => {
|
|
267
|
+
const e = t.row.original;
|
|
268
|
+
return (e == null ? void 0 : e.end) || "--";
|
|
269
|
+
},
|
|
270
|
+
enableSorting: !1
|
|
271
|
+
}, {
|
|
272
|
+
name: "duration",
|
|
273
|
+
accessorKey: "duration",
|
|
274
|
+
header: () => a("hr.timesheet.columns.hourMinute"),
|
|
275
|
+
cell: (t) => {
|
|
276
|
+
const e = t.row.original;
|
|
277
|
+
return e.total ? `Total: ${e.total}` : e.duration;
|
|
278
|
+
},
|
|
279
|
+
enableSorting: !1
|
|
280
|
+
}], k = m(!1);
|
|
281
|
+
function q(t) {
|
|
282
|
+
f.value = t, S.value = l(f.value.startedAt).format("YYYY-MM-DD"), C.value = l(f.value.endedAt || f.value.startedAt).format("YYYY-MM-DD"), V.value = l(f.value.startedAt).format("HH:mm"), F.value = l(f.value.endedAt || f.value.startedAt).format("HH:mm"), k.value = !0;
|
|
283
|
+
}
|
|
284
|
+
const S = m(), V = m(), C = m(), F = m(), f = m(), $ = m("");
|
|
285
|
+
async function re() {
|
|
286
|
+
const t = J(S.value, V.value), e = J(C.value, F.value);
|
|
287
|
+
if (l(t).isAfter(e)) {
|
|
288
|
+
$.value = a("hr.timesheet.checkOutMustBeforeCheckIn");
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
y.minor(async () => {
|
|
292
|
+
await h.updateTimesheet(f.value, t, e);
|
|
293
|
+
}, {
|
|
294
|
+
successMessage: a("hr.timesheet.update.successMessage")
|
|
295
|
+
}), U(), k.value = !1;
|
|
296
|
+
}
|
|
297
|
+
const J = (t, e) => l(t).set("h", parseInt(e.split(":")[0])).set("m", parseInt(e.split(":")[1])).toISOString();
|
|
298
|
+
return X([S, C, V, F], ([t, e, r, u]) => {
|
|
299
|
+
(t || e || r || u) && ($.value = "");
|
|
300
|
+
}), (t, e) => {
|
|
301
|
+
const r = d("FmAvatar"), u = d("FmDatePicker"), A = d("FmTimePicker"), B = d("FmIcon"), E = d("FmButton"), ne = d("FmSideSheet"), Q = d("FmChip"), ie = d("FmDateRangePicker"), ue = d("FmMenuItem"), de = d("FmMenu"), me = d("FmSpacer"), ce = d("FmSearch"), W = d("FmTable");
|
|
302
|
+
return L(), P(Z, null, [s(ne, {
|
|
303
|
+
modelValue: k.value,
|
|
304
|
+
"onUpdate:modelValue": e[5] || (e[5] = (o) => k.value = o),
|
|
305
|
+
"dismiss-away": "",
|
|
306
|
+
header: n(a)("hr.timesheet.update.title")
|
|
307
|
+
}, {
|
|
308
|
+
"side-sheet-footer": w(() => [i("div", Ge, [s(E, {
|
|
309
|
+
label: n(a)("common.update"),
|
|
310
|
+
size: "md",
|
|
311
|
+
variant: "primary",
|
|
312
|
+
onClick: re
|
|
313
|
+
}, null, 8, ["label"]), s(E, {
|
|
314
|
+
label: n(a)("common.cancel"),
|
|
315
|
+
size: "md",
|
|
316
|
+
variant: "secondary",
|
|
317
|
+
onClick: e[4] || (e[4] = (o) => k.value = !1)
|
|
318
|
+
}, null, 8, ["label"])])]),
|
|
319
|
+
default: w(() => [i("div", Ie, [i("div", $e, [s(r, {
|
|
320
|
+
name: f.value.user.name,
|
|
321
|
+
initials: n(Fe)(f.value.user.name),
|
|
322
|
+
size: "lg"
|
|
323
|
+
}, null, 8, ["name", "initials"]), i("div", Ae, [i("div", Ee, T(n(a)("hr.timesheet.employeeName")), 1), i("div", Ke, T(f.value.user.name), 1)])]), i("div", Ne, [i("div", Ue, T(n(a)("hr.timesheet.update.checkIn")), 1), i("div", ze, [s(u, {
|
|
324
|
+
modelValue: S.value,
|
|
325
|
+
"onUpdate:modelValue": e[0] || (e[0] = (o) => S.value = o),
|
|
326
|
+
disabled: !1,
|
|
327
|
+
label: n(a)("hr.timesheet.update.date")
|
|
328
|
+
}, null, 8, ["modelValue", "label"]), s(A, {
|
|
329
|
+
modelValue: V.value,
|
|
330
|
+
"onUpdate:modelValue": e[1] || (e[1] = (o) => V.value = o),
|
|
331
|
+
label: n(a)("hr.timesheet.update.time")
|
|
332
|
+
}, null, 8, ["modelValue", "label"])])]), i("div", Be, [i("div", Pe, T(n(a)("hr.timesheet.update.checkOut")), 1), i("div", je, [s(u, {
|
|
333
|
+
modelValue: C.value,
|
|
334
|
+
"onUpdate:modelValue": e[2] || (e[2] = (o) => C.value = o),
|
|
335
|
+
disabled: !1,
|
|
336
|
+
label: n(a)("hr.timesheet.update.date")
|
|
337
|
+
}, null, 8, ["modelValue", "label"]), s(A, {
|
|
338
|
+
modelValue: F.value,
|
|
339
|
+
"onUpdate:modelValue": e[3] || (e[3] = (o) => F.value = o),
|
|
340
|
+
label: n(a)("hr.timesheet.update.time")
|
|
341
|
+
}, null, 8, ["modelValue", "label"])])]), $.value ? (L(), P("div", He, [s(B, {
|
|
342
|
+
color: "#FF3B30",
|
|
343
|
+
name: "error",
|
|
344
|
+
size: "sm"
|
|
345
|
+
}), he(" " + T($.value), 1)])) : ve("", !0)])]),
|
|
346
|
+
_: 1
|
|
347
|
+
}, 8, ["modelValue", "header"]), i("div", qe, [i("div", Je, [s(_e, {
|
|
348
|
+
modelValue: I.value,
|
|
349
|
+
"onUpdate:modelValue": e[6] || (e[6] = (o) => I.value = o),
|
|
350
|
+
multiple: "",
|
|
351
|
+
items: te.value,
|
|
352
|
+
variant: "dark",
|
|
353
|
+
"selected-prefix": n(a)("hr.role.columns.restaurants"),
|
|
354
|
+
placeholder: n(a)("hr.role.columns.restaurants"),
|
|
355
|
+
class: "!w-auto pt-[3px]"
|
|
356
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), i("div", Qe, [s(ie, {
|
|
357
|
+
modelValue: n(x),
|
|
358
|
+
"onUpdate:modelValue": e[7] || (e[7] = (o) => ge(x) ? x.value = o : null),
|
|
359
|
+
"show-predefined-range": "",
|
|
360
|
+
"predefined-range": oe
|
|
361
|
+
}, {
|
|
362
|
+
"trigger-button": w(() => [s(Q, {
|
|
363
|
+
label: n(ae)
|
|
364
|
+
}, null, 8, ["label"])]),
|
|
365
|
+
_: 1
|
|
366
|
+
}, 8, ["modelValue"]), s(E, {
|
|
367
|
+
icon: "chevron_left",
|
|
368
|
+
variant: "tertiary",
|
|
369
|
+
onClick: e[8] || (e[8] = (o) => n(G)("subtract"))
|
|
370
|
+
}), s(E, {
|
|
371
|
+
icon: "chevron_right",
|
|
372
|
+
variant: "tertiary",
|
|
373
|
+
onClick: e[9] || (e[9] = (o) => n(G)("add"))
|
|
374
|
+
})]), s(de, {
|
|
375
|
+
class: "pt-[3px]"
|
|
376
|
+
}, {
|
|
377
|
+
"menu-button": w(() => [s(Q, {
|
|
378
|
+
label: g.value,
|
|
379
|
+
"right-icon": "keyboard_arrow_down"
|
|
380
|
+
}, null, 8, ["label"])]),
|
|
381
|
+
default: w(() => [(L(), P(Z, null, De(_, (o) => s(ue, {
|
|
382
|
+
key: o.value,
|
|
383
|
+
label: o.label,
|
|
384
|
+
onClick: (Xe) => p.value = o.value
|
|
385
|
+
}, null, 8, ["label", "onClick"])), 64))]),
|
|
386
|
+
_: 1
|
|
387
|
+
}), s(me), s(ce, {
|
|
388
|
+
modelValue: c.value,
|
|
389
|
+
"onUpdate:modelValue": e[10] || (e[10] = (o) => c.value = o),
|
|
390
|
+
class: "w-[320px]",
|
|
391
|
+
placeholder: n(a)("hr.timesheet.search.placeholder")
|
|
392
|
+
}, null, 8, ["modelValue", "placeholder"])]), s(Me, {
|
|
393
|
+
class: "w-full xs:px-16"
|
|
394
|
+
}, {
|
|
395
|
+
default: w(() => [i("div", We, [s(xe, {
|
|
396
|
+
"is-loading": N.value,
|
|
397
|
+
"is-empty": p.value === "listView" ? R.value.length === 0 : H.value.length === 0,
|
|
398
|
+
"collapse-at": !1,
|
|
399
|
+
title: n(a)("hr.timesheet.noData.title"),
|
|
400
|
+
subtitle: ""
|
|
401
|
+
}, {
|
|
402
|
+
default: w(() => [p.value === "listView" ? (L(), ee(W, {
|
|
403
|
+
key: 0,
|
|
404
|
+
class: "min-w-[640px]",
|
|
405
|
+
"column-defs": se,
|
|
406
|
+
"row-data": R.value,
|
|
407
|
+
"page-size": R.value.length,
|
|
408
|
+
loading: N.value,
|
|
409
|
+
virtual: R.value.length > 0,
|
|
410
|
+
"pin-header-row": "",
|
|
411
|
+
"hide-footer": "",
|
|
412
|
+
"shrink-at": !1,
|
|
413
|
+
onRowClick: e[11] || (e[11] = (o) => q(o.original))
|
|
414
|
+
}, null, 8, ["row-data", "page-size", "loading", "virtual"])) : (L(), ee(W, {
|
|
415
|
+
key: 1,
|
|
416
|
+
class: "min-w-[640px]",
|
|
417
|
+
"column-defs": le,
|
|
418
|
+
"row-data": H.value,
|
|
419
|
+
"page-size": 100,
|
|
420
|
+
loading: N.value,
|
|
421
|
+
"pin-header-row": "",
|
|
422
|
+
"shrink-at": !1,
|
|
423
|
+
"expanded-state": z.value,
|
|
424
|
+
"get-sub-row": (o) => o.timesheets,
|
|
425
|
+
"onUpdate:expandedState": e[12] || (e[12] = (o) => z.value = o),
|
|
426
|
+
onRowClick: e[13] || (e[13] = (o) => q(o.original))
|
|
427
|
+
}, null, 8, ["row-data", "loading", "expanded-state", "get-sub-row"]))]),
|
|
428
|
+
_: 1
|
|
429
|
+
}, 8, ["is-loading", "is-empty", "title"])])]),
|
|
430
|
+
_: 1
|
|
431
|
+
})])], 64);
|
|
432
|
+
};
|
|
433
|
+
}
|
|
434
|
+
});
|
|
435
|
+
export {
|
|
436
|
+
ct as default
|
|
437
|
+
};
|