@feedmepos/mf-hrm-portal 2.3.2-dev.6 → 2.3.2-dev.8
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-ix9OeJEQ.js → ApprovalCodeList-DIYhVMGW.js} +7 -7
- package/dist/{AuditLogList-D5H_O9Q0.js → AuditLogList-DIc3Jgpr.js} +795 -719
- package/dist/{ConditionBuilderForm.vue_vue_type_script_setup_true_lang-CuELLYY4.js → ConditionBuilderForm.vue_vue_type_script_setup_true_lang-4YsF7lXu.js} +2 -2
- package/dist/{EmployeeList-DICzZjVM.js → EmployeeList-iVg4pI9Y.js} +8 -8
- package/dist/{FormSection.vue_vue_type_script_setup_true_lang-BQzSWAqC.js → FormSection.vue_vue_type_script_setup_true_lang-C9AE0EHw.js} +1 -1
- package/dist/{GrantUserList-DoMN7Eks.js → GrantUserList-8zmzFk9z.js} +8 -8
- package/dist/{Main-DwYh9cxQ.js → Main-ClJox3pV.js} +10 -10
- package/dist/{Main-CHIExpOV.js → Main-DYzFd_qa.js} +5 -5
- package/dist/{Main-CQ42sYi9.js → Main-gRu17-N6.js} +1005 -999
- package/dist/{MyPosProfile-DaUdREQX.js → MyPosProfile-ARRrolbz.js} +1 -1
- package/dist/{PermissionSetList-B7WM9N-p.js → PermissionSetList-CL42jQY4.js} +13 -12
- package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BSVtyLlL.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-DkA0XbZw.js} +804 -803
- package/dist/{PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-C7fnnbme.js → PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-CA87qQ4b.js} +1 -1
- package/dist/{RoleForm.vue_vue_type_script_setup_true_lang-AbQIllkX.js → RoleForm.vue_vue_type_script_setup_true_lang-B3N3hTcU.js} +9 -9
- package/dist/{RoleList-vQsHxlNc.js → RoleList-F9ZORhgE.js} +7 -7
- package/dist/{ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-D52LhvGG.js → ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-B9NMhw9Z.js} +1 -1
- package/dist/{ScheduleGeneralPage-BLqh7jH6.js → ScheduleGeneralPage-751cEUwS.js} +2 -2
- package/dist/{ScheduleModal.vue_vue_type_script_setup_true_lang-C9doSgov.js → ScheduleModal.vue_vue_type_script_setup_true_lang-CBDNfiIM.js} +4 -4
- package/dist/{SchedulePage-YADV_6w9.js → SchedulePage-C-NcbGIl.js} +189 -201
- package/dist/{SchedulePositionPage-BowDQMG_.js → SchedulePositionPage-Ba0iiSRg.js} +3 -3
- package/dist/{SelectFilter-CBp1qxLd.js → SelectFilter-Dpsq165k.js} +1 -1
- package/dist/{TeamMemberList-BoJ87moU.js → TeamMemberList-DZ0aRbxg.js} +28 -27
- package/dist/TimesheetList-DO5T__dL.js +437 -0
- package/dist/{app-DOFDND9j.js → app-DXkKrcRn.js} +38 -10
- package/dist/app.js +1 -1
- package/dist/{approval-code-Dgj6S82q.js → approval-code-D2pGW-sI.js} +4 -4
- package/dist/{dayjs.min-AoirQCgL.js → dayjs.min-BAz84JAQ.js} +1 -1
- package/dist/employee-yYhuhc9L.js +172 -0
- package/dist/{grant-user-C-ptrq7l.js → grant-user-B95RDjkR.js} +2 -2
- package/dist/{iteration-DmuDXP8U.js → index-TrBkLxJe.js} +698 -726
- package/dist/iteration-CcXrOMQe.js +30 -0
- package/dist/{lodash-CBFO-xTu.js → lodash-DXRsZpTB.js} +1 -1
- package/dist/{member-grant-CHOB8eQ_.js → member-grant-ByAQ1Qja.js} +2 -2
- package/dist/{restaurant-DH2Fxzi7.js → restaurant-COSpCpTQ.js} +2 -2
- package/dist/{role-DUpHwRiY.js → role-ZmCd2yG4.js} +8 -7
- package/dist/{rule-aUPH1VOW.js → rule-Bty9eoI3.js} +38 -37
- 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/timesheet/index.d.ts +1 -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 +2 -2
- package/dist/src/stores/role.d.ts +2 -2
- package/dist/src/stores/team.d.ts +1 -1
- package/dist/src/stores/timesheet.d.ts +68 -53
- package/dist/src/types/timesheet.d.ts +3 -0
- package/dist/src/views/audit-log/locales/index.d.ts +28 -0
- package/dist/src/views/audit-log/useTraceIdDeepLink.d.ts +19 -0
- package/dist/style.css +1 -1
- package/dist/timesheet-CFD6XPiG.js +76 -0
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{useAppStore-DwmJbpf-.js → useAppStore-7O0GMkXY.js} +1 -1
- package/dist/{useLoading-Dmlm4oSU.js → useLoading-BZXydjer.js} +1 -1
- package/dist/useMessage-_ywT_N9X.js +17 -0
- package/dist/{useReportPermissions-XPn-p57R.js → useReportPermissions-Cn3ntCJ9.js} +3 -3
- package/package.json +3 -3
- package/dist/TimesheetList-BULw75oo.js +0 -401
- package/dist/TimesheetList.vue_vue_type_style_index_0_scoped_c98b0b84_lang-VlnjH9aQ.js +0 -58
- package/dist/employee-VB6YmuSS.js +0 -210
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { computed as I, isRef as L, watch as M } from "vue";
|
|
2
2
|
import { SnackbarPosition as y } from "@feedmepos/ui-library";
|
|
3
|
-
import { u as w, v } from "./useAppStore-
|
|
3
|
+
import { u as w, v } from "./useAppStore-7O0GMkXY.js";
|
|
4
4
|
const E = (r) => {
|
|
5
5
|
async function d(u, e) {
|
|
6
6
|
var l, a;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useSnackbar as u } from "@feedmepos/ui-library";
|
|
2
|
+
function a() {
|
|
3
|
+
const c = u();
|
|
4
|
+
function s(r, e) {
|
|
5
|
+
c.open({ title: r, type: "success", position: e == null ? void 0 : e.position });
|
|
6
|
+
}
|
|
7
|
+
function t(r, e) {
|
|
8
|
+
c.open({ title: r, type: "error", position: e == null ? void 0 : e.position });
|
|
9
|
+
}
|
|
10
|
+
return {
|
|
11
|
+
success: s,
|
|
12
|
+
error: t
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
a as u
|
|
17
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { computed as r, ref as n } from "vue";
|
|
2
|
-
import { e as d } from "./
|
|
2
|
+
import { e as d } from "./index-TrBkLxJe.js";
|
|
3
3
|
import { useCoreStore as h } from "@feedmepos/mf-common";
|
|
4
|
-
import { R as K } from "./rule-
|
|
5
|
-
import { s as g } from "./app-
|
|
4
|
+
import { R as K } from "./rule-Bty9eoI3.js";
|
|
5
|
+
import { s as g } from "./app-DXkKrcRn.js";
|
|
6
6
|
const a = n([]), i = n(!1), l = n(!1), f = n(null), p = n(null), u = n(!1);
|
|
7
7
|
function B() {
|
|
8
8
|
const v = h();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@feedmepos/mf-hrm-portal",
|
|
3
|
-
"version": "2.3.2-dev.
|
|
3
|
+
"version": "2.3.2-dev.8",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist"
|
|
6
6
|
],
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"vue-router": "^4.3.2",
|
|
31
31
|
"vue3-lottie": "^3.3.0",
|
|
32
32
|
"xlsx": "^0.18.5",
|
|
33
|
-
"@feedmepos/hrm-
|
|
34
|
-
"@feedmepos/hrm-
|
|
33
|
+
"@feedmepos/hrm-schedule-contract": "1.0.0",
|
|
34
|
+
"@feedmepos/hrm-permission": "1.2.2"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@casl/ability": "^3.4.0",
|
|
@@ -1,401 +0,0 @@
|
|
|
1
|
-
import { ref as d, computed as p, defineComponent as fe, onMounted as he, watch as Z, resolveComponent as u, createElementBlock as P, openBlock as E, Fragment as ee, createVNode as l, createElementVNode as i, unref as n, withCtx as y, createCommentVNode as ge, toDisplayString as O, createTextVNode as we, isRef as ye, renderList as be, createBlock as te, nextTick as _e } from "vue";
|
|
2
|
-
import { d as f } from "./dayjs.min-AoirQCgL.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-CBp1qxLd.js";
|
|
6
|
-
import { _ as Ce, a as ke } from "./app-DOFDND9j.js";
|
|
7
|
-
import { _ as Fe } from "./TableEmptyState.vue_vue_type_script_setup_true_lang-IfAZmWr0.js";
|
|
8
|
-
import { u as Me } from "./useLoading-Dmlm4oSU.js";
|
|
9
|
-
import { g as Ye, s as Le } from "./iteration-DmuDXP8U.js";
|
|
10
|
-
import { f as Te } from "./utils-BZkjJbju.js";
|
|
11
|
-
import { n as Ie } from "./string-DZQ1uNjn.js";
|
|
12
|
-
import { u as Re } from "./employee-VB6YmuSS.js";
|
|
13
|
-
import { u as $e } from "./restaurant-DH2Fxzi7.js";
|
|
14
|
-
import { u as Ee } from "./TimesheetList.vue_vue_type_style_index_0_scoped_c98b0b84_lang-VlnjH9aQ.js";
|
|
15
|
-
function Oe(b, a) {
|
|
16
|
-
return ["years", "months"].find((x) => {
|
|
17
|
-
const D = b.startOf(x), v = b.endOf(x);
|
|
18
|
-
return b.isSame(D, "day") && a.isSame(v, "day");
|
|
19
|
-
}) || "days";
|
|
20
|
-
}
|
|
21
|
-
function Ae() {
|
|
22
|
-
const b = {
|
|
23
|
-
startDate: f().format("YYYY-MM-DD"),
|
|
24
|
-
endDate: f().format("YYYY-MM-DD")
|
|
25
|
-
}, a = d(b), _ = p(() => {
|
|
26
|
-
if (!a.value) return "No dates selected.";
|
|
27
|
-
const v = a.value.startDate ?? "Start", w = a.value.endDate ?? "End";
|
|
28
|
-
return `${v} - ${w}`;
|
|
29
|
-
}), x = p(() => ({
|
|
30
|
-
startDate: new Date(a.value.startDate),
|
|
31
|
-
endDate: new Date(a.value.endDate)
|
|
32
|
-
}));
|
|
33
|
-
function D(v) {
|
|
34
|
-
const w = f(a.value.startDate), c = f(a.value.endDate), h = Oe(w, c), S = h === "days" ? c.diff(w, "days") + 1 : 1, V = v === "subtract" ? (C) => C.subtract(S, h) : (C) => C.add(S, h);
|
|
35
|
-
a.value = {
|
|
36
|
-
startDate: V(w).startOf(h).format("YYYY-MM-DD"),
|
|
37
|
-
endDate: V(c).endOf(h).format("YYYY-MM-DD")
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
return { dateRange: a, parsedDateRange: x, dateRangeLabel: _, setRange: D };
|
|
41
|
-
}
|
|
42
|
-
const Ke = {
|
|
43
|
-
class: "my-16 flex w-[350px] flex-col gap-40"
|
|
44
|
-
}, ze = {
|
|
45
|
-
class: "flex gap-16"
|
|
46
|
-
}, Be = {
|
|
47
|
-
class: "flex flex-col gap-4"
|
|
48
|
-
}, Ne = {
|
|
49
|
-
class: "fm-typo-body-md-400 text-fm-color-typo-secondary"
|
|
50
|
-
}, Ue = {
|
|
51
|
-
class: "fm-typo-body-md-700 text-fm-color-typo-primary"
|
|
52
|
-
}, Pe = {
|
|
53
|
-
class: "flex flex-col gap-8"
|
|
54
|
-
}, je = {
|
|
55
|
-
class: "fm-typo-body-xl-700"
|
|
56
|
-
}, He = {
|
|
57
|
-
class: "flex flex-col gap-24"
|
|
58
|
-
}, Ge = {
|
|
59
|
-
class: "flex flex-col gap-8"
|
|
60
|
-
}, qe = {
|
|
61
|
-
class: "fm-typo-body-xl-700"
|
|
62
|
-
}, Je = {
|
|
63
|
-
class: "flex flex-col gap-24"
|
|
64
|
-
}, Qe = {
|
|
65
|
-
key: 0,
|
|
66
|
-
class: "fm-typo-body-sm-400 text-fm-color-typo-error mt-1 flex items-center gap-4"
|
|
67
|
-
}, We = {
|
|
68
|
-
class: "flex items-center justify-start gap-8"
|
|
69
|
-
}, Xe = {
|
|
70
|
-
class: "space-y-8"
|
|
71
|
-
}, Ze = {
|
|
72
|
-
class: "flex items-start gap-8 flex-wrap xs:px-16"
|
|
73
|
-
}, et = {
|
|
74
|
-
class: "flex items-center gap-8"
|
|
75
|
-
}, tt = {
|
|
76
|
-
class: "flex h-full flex-col overflow-auto"
|
|
77
|
-
}, at = /* @__PURE__ */ fe({
|
|
78
|
-
__name: "TimesheetList",
|
|
79
|
-
setup(b) {
|
|
80
|
-
const {
|
|
81
|
-
t: a
|
|
82
|
-
} = xe(), _ = De(), x = Me(_), D = [{
|
|
83
|
-
label: a("hr.timesheet.listView"),
|
|
84
|
-
value: "listView"
|
|
85
|
-
}, {
|
|
86
|
-
label: a("hr.timesheet.userView"),
|
|
87
|
-
value: "userView"
|
|
88
|
-
}], v = d("listView"), w = p(() => {
|
|
89
|
-
var e;
|
|
90
|
-
return (e = D.find((t) => t.value === v.value)) == null ? void 0 : e.label;
|
|
91
|
-
}), c = d(""), h = Ee(), S = Re(), V = $e(), C = p(() => S.employees.value), ae = p(() => new Map(C.value.map((e) => [e._id, e]))), oe = p(() => new Map(V.restaurants.value.map((e) => [e._id, e.profile.code]))), j = p(() => h.timesheets.value.filter((s) => !A.value || A.value.includes(s.restaurantId)).map((s) => {
|
|
92
|
-
const r = oe.value.get(s.restaurantId), g = ae.value.get(s.user.id);
|
|
93
|
-
return {
|
|
94
|
-
...s,
|
|
95
|
-
restaurantCode: r,
|
|
96
|
-
user: {
|
|
97
|
-
...s.user,
|
|
98
|
-
code: g ? g.code : ""
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
})), z = p(() => j.value.filter((e) => {
|
|
102
|
-
var t, s;
|
|
103
|
-
return e.user.name.toLowerCase().includes(c.value.toLowerCase()) || e.restaurantName.toLowerCase().includes(c.value.toLowerCase()) || ((t = e.restaurantCode) == null ? void 0 : t.toLowerCase().includes(c.value.toLowerCase())) || ((s = e.user.code) == null ? void 0 : s.toLowerCase().includes(c.value.toLowerCase()));
|
|
104
|
-
})), H = p(() => {
|
|
105
|
-
const e = Ye(j.value, (s) => s.user.name), t = Object.entries(e).map(([s, r]) => {
|
|
106
|
-
const g = C.value.find(($) => $._id === r[0].user.id);
|
|
107
|
-
return {
|
|
108
|
-
key: s,
|
|
109
|
-
user: r[0].user.name,
|
|
110
|
-
code: g ? g.code : r[0].user.code || "",
|
|
111
|
-
timesheets: r,
|
|
112
|
-
total: Te(r.reduce(($, k) => $ + k.totalMin, 0))
|
|
113
|
-
};
|
|
114
|
-
});
|
|
115
|
-
return Le(t, {
|
|
116
|
-
selector: "user"
|
|
117
|
-
});
|
|
118
|
-
}), B = p(() => H.value.filter((e) => {
|
|
119
|
-
var t;
|
|
120
|
-
return e.user.toLowerCase().includes(c.value.toLowerCase()) || ((t = e.code) == null ? void 0 : t.toLowerCase().includes(c.value.toLowerCase()));
|
|
121
|
-
})), F = d(!1), N = async () => {
|
|
122
|
-
const {
|
|
123
|
-
startDate: e,
|
|
124
|
-
endDate: t
|
|
125
|
-
} = M.value;
|
|
126
|
-
F.value = !0;
|
|
127
|
-
try {
|
|
128
|
-
await h.readTimesheet(new Date(e), new Date(t)), await _e(), U.value = Object.fromEntries(Object.entries(new Array(H.value.length).fill(!0)));
|
|
129
|
-
} catch (s) {
|
|
130
|
-
_.open({
|
|
131
|
-
title: s instanceof Error ? s.message : `${s}`,
|
|
132
|
-
type: "error"
|
|
133
|
-
});
|
|
134
|
-
} finally {
|
|
135
|
-
F.value = !1;
|
|
136
|
-
}
|
|
137
|
-
};
|
|
138
|
-
he(async () => {
|
|
139
|
-
N();
|
|
140
|
-
try {
|
|
141
|
-
await V.readRestaurants(), S.employees.value.length === 0 && await S.readEmployees();
|
|
142
|
-
} catch (e) {
|
|
143
|
-
console.error("Failed to load timesheet dependencies:", e), _.open({
|
|
144
|
-
message: e instanceof Error ? e.message : String(e),
|
|
145
|
-
type: "error"
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
});
|
|
149
|
-
const A = d(), se = p(() => V.restaurants.value.filter((e) => e.managable).map((e) => ({
|
|
150
|
-
label: `${e.profile.code ? `${e.profile.code} - ` : ""}${e.profile.name}`,
|
|
151
|
-
value: e._id
|
|
152
|
-
}))), {
|
|
153
|
-
dateRange: M,
|
|
154
|
-
dateRangeLabel: le,
|
|
155
|
-
setRange: G
|
|
156
|
-
} = Ae();
|
|
157
|
-
Z(M, async () => {
|
|
158
|
-
N();
|
|
159
|
-
});
|
|
160
|
-
const ne = [{
|
|
161
|
-
accessorKey: "user.code",
|
|
162
|
-
size: 100,
|
|
163
|
-
header: () => a("hr.employee.columns.code"),
|
|
164
|
-
cell: (e) => e.row.original.user.code || "--",
|
|
165
|
-
enableSorting: !0
|
|
166
|
-
}, {
|
|
167
|
-
accessorKey: "user",
|
|
168
|
-
header: () => a("hr.timesheet.columns.name"),
|
|
169
|
-
cell: (e) => e.row.original.user.name,
|
|
170
|
-
enableSorting: !1
|
|
171
|
-
}, {
|
|
172
|
-
accessorKey: "restaurantName",
|
|
173
|
-
header: () => a("hr.timesheet.columns.restaurant"),
|
|
174
|
-
cell: (e) => {
|
|
175
|
-
const t = e.row.original.restaurantCode, s = e.row.original.restaurantName;
|
|
176
|
-
return `${t ? t + " - " : ""}${s}`;
|
|
177
|
-
},
|
|
178
|
-
enableSorting: !0
|
|
179
|
-
}, {
|
|
180
|
-
accessorKey: "start",
|
|
181
|
-
header: () => a("hr.timesheet.columns.start"),
|
|
182
|
-
cell: (e) => e.row.original.start || "--",
|
|
183
|
-
enableSorting: !0
|
|
184
|
-
}, {
|
|
185
|
-
accessorKey: "end",
|
|
186
|
-
header: () => a("hr.timesheet.columns.end"),
|
|
187
|
-
cell: (e) => e.row.original.end || "--",
|
|
188
|
-
enableSorting: !0
|
|
189
|
-
}, {
|
|
190
|
-
name: "duration",
|
|
191
|
-
accessorKey: "duration",
|
|
192
|
-
header: () => a("hr.timesheet.columns.duration"),
|
|
193
|
-
cell: (e) => e.row.original.duration || "--",
|
|
194
|
-
enableSorting: !0
|
|
195
|
-
}], U = d({}), re = [{
|
|
196
|
-
accessorKey: "code",
|
|
197
|
-
size: 100,
|
|
198
|
-
header: () => a("hr.employee.columns.code"),
|
|
199
|
-
cell: (e) => e.row.original.code,
|
|
200
|
-
enableSorting: !1
|
|
201
|
-
}, {
|
|
202
|
-
accessorKey: "user",
|
|
203
|
-
header: () => a("hr.timesheet.columns.name"),
|
|
204
|
-
cell: (e) => {
|
|
205
|
-
const t = e.row.original;
|
|
206
|
-
if (typeof t.user == "string") {
|
|
207
|
-
const s = e.row.getIsExpanded();
|
|
208
|
-
return l("div", {
|
|
209
|
-
class: "flex items-center gap-8"
|
|
210
|
-
}, [l("div", {
|
|
211
|
-
onClick: (r) => {
|
|
212
|
-
r.stopPropagation(), e.row.getToggleExpandedHandler()(r);
|
|
213
|
-
}
|
|
214
|
-
}, [l(Se.FmButton, {
|
|
215
|
-
variant: "tertiary",
|
|
216
|
-
icon: s ? "keyboard_arrow_up" : "keyboard_arrow_down"
|
|
217
|
-
}, null)]), t.user]);
|
|
218
|
-
}
|
|
219
|
-
},
|
|
220
|
-
enableSorting: !1
|
|
221
|
-
}, {
|
|
222
|
-
accessorKey: "start",
|
|
223
|
-
header: () => a("hr.timesheet.columns.start"),
|
|
224
|
-
cell: (e) => {
|
|
225
|
-
const t = e.row.original;
|
|
226
|
-
return (t == null ? void 0 : t.start) || "--";
|
|
227
|
-
},
|
|
228
|
-
enableSorting: !1
|
|
229
|
-
}, {
|
|
230
|
-
accessorKey: "end",
|
|
231
|
-
header: () => a("hr.timesheet.columns.end"),
|
|
232
|
-
cell: (e) => {
|
|
233
|
-
const t = e.row.original;
|
|
234
|
-
return (t == null ? void 0 : t.end) || "--";
|
|
235
|
-
},
|
|
236
|
-
enableSorting: !1
|
|
237
|
-
}, {
|
|
238
|
-
name: "duration",
|
|
239
|
-
accessorKey: "duration",
|
|
240
|
-
header: () => a("hr.timesheet.columns.hourMinute"),
|
|
241
|
-
cell: (e) => {
|
|
242
|
-
const t = e.row.original;
|
|
243
|
-
return t.total ? `Total: ${t.total}` : t.duration;
|
|
244
|
-
},
|
|
245
|
-
enableSorting: !1
|
|
246
|
-
}], Y = d(!1);
|
|
247
|
-
function q(e) {
|
|
248
|
-
m.value = e, L.value = f(m.value.startedAt).format("YYYY-MM-DD"), I.value = f(m.value.endedAt || m.value.startedAt).format("YYYY-MM-DD"), T.value = f(m.value.startedAt).format("HH:mm"), R.value = f(m.value.endedAt || m.value.startedAt).format("HH:mm"), Y.value = !0;
|
|
249
|
-
}
|
|
250
|
-
const L = d(), T = d(), I = d(), R = d(), m = d(), K = d("");
|
|
251
|
-
async function ie() {
|
|
252
|
-
const e = J(L.value, T.value), t = J(I.value, R.value);
|
|
253
|
-
if (f(e).isAfter(t)) {
|
|
254
|
-
K.value = a("hr.timesheet.checkOutMustBeforeCheckIn");
|
|
255
|
-
return;
|
|
256
|
-
}
|
|
257
|
-
x.minor(async () => {
|
|
258
|
-
await h.updateTimesheet(m.value, e, t);
|
|
259
|
-
}, {
|
|
260
|
-
successMessage: a("hr.timesheet.update.successMessage")
|
|
261
|
-
}), N(), Y.value = !1;
|
|
262
|
-
}
|
|
263
|
-
const J = (e, t) => f(e).set("h", parseInt(t.split(":")[0])).set("m", parseInt(t.split(":")[1])).toISOString();
|
|
264
|
-
return Z([L, I, T, R], ([e, t, s, r]) => {
|
|
265
|
-
(e || t || s || r) && (K.value = "");
|
|
266
|
-
}), (e, t) => {
|
|
267
|
-
const s = u("FmAvatar"), r = u("FmDatePicker"), g = u("FmTimePicker"), $ = u("FmIcon"), k = u("FmButton"), ue = u("FmSideSheet"), Q = u("FmChip"), de = u("FmDateRangePicker"), ce = u("FmMenuItem"), me = u("FmMenu"), pe = u("FmSpacer"), ve = u("FmSearch"), W = u("FmTable");
|
|
268
|
-
return E(), P(ee, null, [l(ue, {
|
|
269
|
-
modelValue: Y.value,
|
|
270
|
-
"onUpdate:modelValue": t[5] || (t[5] = (o) => Y.value = o),
|
|
271
|
-
"dismiss-away": "",
|
|
272
|
-
header: n(a)("hr.timesheet.update.title")
|
|
273
|
-
}, {
|
|
274
|
-
"side-sheet-footer": y(() => [i("div", We, [l(k, {
|
|
275
|
-
label: n(a)("common.update"),
|
|
276
|
-
size: "md",
|
|
277
|
-
variant: "primary",
|
|
278
|
-
onClick: ie
|
|
279
|
-
}, null, 8, ["label"]), l(k, {
|
|
280
|
-
label: n(a)("common.cancel"),
|
|
281
|
-
size: "md",
|
|
282
|
-
variant: "secondary",
|
|
283
|
-
onClick: t[4] || (t[4] = (o) => Y.value = !1)
|
|
284
|
-
}, null, 8, ["label"])])]),
|
|
285
|
-
default: y(() => [i("div", Ke, [i("div", ze, [l(s, {
|
|
286
|
-
name: m.value.user.name,
|
|
287
|
-
initials: n(Ie)(m.value.user.name),
|
|
288
|
-
size: "lg"
|
|
289
|
-
}, null, 8, ["name", "initials"]), i("div", Be, [i("div", Ne, O(n(a)("hr.timesheet.employeeName")), 1), i("div", Ue, O(m.value.user.name), 1)])]), i("div", Pe, [i("div", je, O(n(a)("hr.timesheet.update.checkIn")), 1), i("div", He, [l(r, {
|
|
290
|
-
modelValue: L.value,
|
|
291
|
-
"onUpdate:modelValue": t[0] || (t[0] = (o) => L.value = o),
|
|
292
|
-
disabled: !1,
|
|
293
|
-
label: n(a)("hr.timesheet.update.date")
|
|
294
|
-
}, null, 8, ["modelValue", "label"]), l(g, {
|
|
295
|
-
modelValue: T.value,
|
|
296
|
-
"onUpdate:modelValue": t[1] || (t[1] = (o) => T.value = o),
|
|
297
|
-
label: n(a)("hr.timesheet.update.time")
|
|
298
|
-
}, null, 8, ["modelValue", "label"])])]), i("div", Ge, [i("div", qe, O(n(a)("hr.timesheet.update.checkOut")), 1), i("div", Je, [l(r, {
|
|
299
|
-
modelValue: I.value,
|
|
300
|
-
"onUpdate:modelValue": t[2] || (t[2] = (o) => I.value = o),
|
|
301
|
-
disabled: !1,
|
|
302
|
-
label: n(a)("hr.timesheet.update.date")
|
|
303
|
-
}, null, 8, ["modelValue", "label"]), l(g, {
|
|
304
|
-
modelValue: R.value,
|
|
305
|
-
"onUpdate:modelValue": t[3] || (t[3] = (o) => R.value = o),
|
|
306
|
-
label: n(a)("hr.timesheet.update.time")
|
|
307
|
-
}, null, 8, ["modelValue", "label"])])]), K.value ? (E(), P("div", Qe, [l($, {
|
|
308
|
-
color: "#FF3B30",
|
|
309
|
-
name: "error",
|
|
310
|
-
size: "sm"
|
|
311
|
-
}), we(" " + O(K.value), 1)])) : ge("", !0)])]),
|
|
312
|
-
_: 1
|
|
313
|
-
}, 8, ["modelValue", "header"]), i("div", Xe, [i("div", Ze, [l(Ve, {
|
|
314
|
-
modelValue: A.value,
|
|
315
|
-
"onUpdate:modelValue": t[6] || (t[6] = (o) => A.value = o),
|
|
316
|
-
multiple: "",
|
|
317
|
-
items: se.value,
|
|
318
|
-
variant: "dark",
|
|
319
|
-
"selected-prefix": n(a)("hr.role.columns.restaurants"),
|
|
320
|
-
placeholder: n(a)("hr.role.columns.restaurants"),
|
|
321
|
-
class: "!w-auto pt-[3px]"
|
|
322
|
-
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), i("div", et, [l(de, {
|
|
323
|
-
modelValue: n(M),
|
|
324
|
-
"onUpdate:modelValue": t[7] || (t[7] = (o) => ye(M) ? M.value = o : null),
|
|
325
|
-
"show-predefined-range": ""
|
|
326
|
-
}, {
|
|
327
|
-
"trigger-button": y(() => [l(Q, {
|
|
328
|
-
label: n(le)
|
|
329
|
-
}, null, 8, ["label"])]),
|
|
330
|
-
_: 1
|
|
331
|
-
}, 8, ["modelValue"]), l(k, {
|
|
332
|
-
icon: "chevron_left",
|
|
333
|
-
variant: "tertiary",
|
|
334
|
-
onClick: t[8] || (t[8] = (o) => n(G)("subtract"))
|
|
335
|
-
}), l(k, {
|
|
336
|
-
icon: "chevron_right",
|
|
337
|
-
variant: "tertiary",
|
|
338
|
-
onClick: t[9] || (t[9] = (o) => n(G)("add"))
|
|
339
|
-
})]), l(me, {
|
|
340
|
-
class: "pt-[3px]"
|
|
341
|
-
}, {
|
|
342
|
-
"menu-button": y(() => [l(Q, {
|
|
343
|
-
label: w.value,
|
|
344
|
-
"right-icon": "keyboard_arrow_down"
|
|
345
|
-
}, null, 8, ["label"])]),
|
|
346
|
-
default: y(() => [(E(), P(ee, null, be(D, (o) => l(ce, {
|
|
347
|
-
key: o.value,
|
|
348
|
-
label: o.label,
|
|
349
|
-
onClick: (X) => v.value = o.value
|
|
350
|
-
}, null, 8, ["label", "onClick"])), 64))]),
|
|
351
|
-
_: 1
|
|
352
|
-
}), l(pe), l(ve, {
|
|
353
|
-
modelValue: c.value,
|
|
354
|
-
"onUpdate:modelValue": t[10] || (t[10] = (o) => c.value = o),
|
|
355
|
-
class: "w-[320px]",
|
|
356
|
-
placeholder: n(a)("hr.timesheet.search.placeholder")
|
|
357
|
-
}, null, 8, ["modelValue", "placeholder"])]), l(Ce, {
|
|
358
|
-
class: "w-full xs:px-16"
|
|
359
|
-
}, {
|
|
360
|
-
default: y(() => [i("div", tt, [l(Fe, {
|
|
361
|
-
"is-loading": F.value,
|
|
362
|
-
"is-empty": v.value === "listView" ? z.value.length === 0 : B.value.length === 0,
|
|
363
|
-
"collapse-at": !1,
|
|
364
|
-
title: n(a)("hr.timesheet.noData.title"),
|
|
365
|
-
subtitle: ""
|
|
366
|
-
}, {
|
|
367
|
-
default: y(() => [v.value === "listView" ? (E(), te(W, {
|
|
368
|
-
key: 0,
|
|
369
|
-
class: "min-w-[640px]",
|
|
370
|
-
"column-defs": ne,
|
|
371
|
-
"row-data": z.value,
|
|
372
|
-
"page-size": z.value.length,
|
|
373
|
-
loading: F.value,
|
|
374
|
-
"pin-header-row": "",
|
|
375
|
-
"hide-footer": "",
|
|
376
|
-
"shrink-at": !1,
|
|
377
|
-
onRowClick: t[11] || (t[11] = (o) => q(o.original))
|
|
378
|
-
}, null, 8, ["row-data", "page-size", "loading"])) : (E(), te(W, {
|
|
379
|
-
key: 1,
|
|
380
|
-
class: "min-w-[640px] timesheet-user-view",
|
|
381
|
-
"column-defs": re,
|
|
382
|
-
"row-data": B.value,
|
|
383
|
-
"page-size": B.value.reduce((o, X) => o + 1 + X.timesheets.length, 0),
|
|
384
|
-
loading: F.value,
|
|
385
|
-
"pin-header-row": "",
|
|
386
|
-
"shrink-at": !1,
|
|
387
|
-
"expanded-state": U.value,
|
|
388
|
-
"get-sub-row": (o) => o.timesheets,
|
|
389
|
-
"onUpdate:expandedState": t[12] || (t[12] = (o) => U.value = o),
|
|
390
|
-
onRowClick: t[13] || (t[13] = (o) => q(o.original))
|
|
391
|
-
}, null, 8, ["row-data", "page-size", "loading", "expanded-state", "get-sub-row"]))]),
|
|
392
|
-
_: 1
|
|
393
|
-
}, 8, ["is-loading", "is-empty", "title"])])]),
|
|
394
|
-
_: 1
|
|
395
|
-
})])], 64);
|
|
396
|
-
};
|
|
397
|
-
}
|
|
398
|
-
}), gt = /* @__PURE__ */ ke(at, [["__scopeId", "data-v-c98b0b84"]]);
|
|
399
|
-
export {
|
|
400
|
-
gt as default
|
|
401
|
-
};
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { d as i } from "./dayjs.min-AoirQCgL.js";
|
|
2
|
-
import { defineStore as p, storeToRefs as T } from "pinia";
|
|
3
|
-
import { ref as l } from "vue";
|
|
4
|
-
import { b as c, g as y } from "./app-DOFDND9j.js";
|
|
5
|
-
import { s as S } from "./iteration-DmuDXP8U.js";
|
|
6
|
-
import { i as f, f as g } from "./utils-BZkjJbju.js";
|
|
7
|
-
const u = {
|
|
8
|
-
async readTimesheets(t, e) {
|
|
9
|
-
return y(await c().get(`timesheet?start=${t}&end=${e}`));
|
|
10
|
-
},
|
|
11
|
-
async updateTimesheet(t, e) {
|
|
12
|
-
await c().put(`timesheet/${t}`, e);
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
function A(t) {
|
|
16
|
-
const e = t.map((n) => {
|
|
17
|
-
const { startedAt: s, endedAt: r } = n, a = i(f(s)), o = r ? i(f(r)) : null, m = (o == null ? void 0 : o.diff(a, "minute", !1)) || 0, h = o ? g(m) : "", d = "YYYY-MM-DD hh:mm a";
|
|
18
|
-
return {
|
|
19
|
-
...n,
|
|
20
|
-
start: a.format(d),
|
|
21
|
-
end: o ? o.format(d) : "",
|
|
22
|
-
totalMin: m,
|
|
23
|
-
duration: h
|
|
24
|
-
};
|
|
25
|
-
});
|
|
26
|
-
return S(e, { selector: "start" });
|
|
27
|
-
}
|
|
28
|
-
const D = p("timesheet", () => {
|
|
29
|
-
const t = l([]);
|
|
30
|
-
async function e(s, r) {
|
|
31
|
-
const a = await u.readTimesheets(
|
|
32
|
-
i(s).startOf("day").toISOString(),
|
|
33
|
-
i(r).endOf("day").toISOString()
|
|
34
|
-
);
|
|
35
|
-
t.value = A(a);
|
|
36
|
-
}
|
|
37
|
-
async function n(s, r, a) {
|
|
38
|
-
await u.updateTimesheet(s.restaurantId, {
|
|
39
|
-
id: s._id,
|
|
40
|
-
startAt: r,
|
|
41
|
-
endAt: a
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
return {
|
|
45
|
-
timesheets: t,
|
|
46
|
-
readTimesheet: e,
|
|
47
|
-
updateTimesheet: n
|
|
48
|
-
};
|
|
49
|
-
}), b = () => {
|
|
50
|
-
const t = D();
|
|
51
|
-
return {
|
|
52
|
-
...t,
|
|
53
|
-
...T(t)
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
export {
|
|
57
|
-
b as u
|
|
58
|
-
};
|