@7365admin1/layer-common 1.10.6 → 1.10.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/CHANGELOG.md +12 -0
- package/components/AccessCardQrTagging.vue +314 -34
- package/components/AccessCardQrTaggingPrintQr.vue +75 -0
- package/components/{AddSupplyForm.vue → AddEqupmentForm.vue} +5 -5
- package/components/AreaChecklistHistoryLogs.vue +9 -0
- package/components/BuildingForm.vue +36 -5
- package/components/BuildingManagement/buildings.vue +18 -9
- package/components/BuildingManagement/units.vue +13 -115
- package/components/BuildingUnitFormAdd.vue +42 -33
- package/components/BuildingUnitFormEdit.vue +334 -139
- package/components/CleaningScheduleMain.vue +60 -13
- package/components/Dialog/DeleteConfirmation.vue +2 -2
- package/components/Dialog/UpdateMoreAction.vue +2 -2
- package/components/EntryPassInformation.vue +443 -0
- package/components/{CheckoutItemMain.vue → EquipmentItemMain.vue} +88 -85
- package/components/{SupplyManagement.vue → EquipmentManagement.vue} +3 -3
- package/components/Input/DateTimePicker.vue +17 -11
- package/components/Input/InputPhoneNumberV2.vue +8 -0
- package/components/ManageChecklistMain.vue +400 -36
- package/components/ScheduleAreaMain.vue +56 -0
- package/components/TableHygiene.vue +47 -430
- package/components/UnitPersonCard.vue +123 -0
- package/components/VehicleAddSelection.vue +2 -2
- package/components/VehicleForm.vue +78 -19
- package/components/VehicleManagement.vue +164 -40
- package/components/VisitorForm.vue +95 -20
- package/components/VisitorFormSelection.vue +13 -2
- package/components/VisitorManagement.vue +83 -55
- package/composables/useAccessManagement.ts +52 -0
- package/composables/useCleaningPermission.ts +7 -7
- package/composables/useDashboardData.ts +2 -2
- package/composables/{useSupply.ts → useEquipment.ts} +11 -11
- package/composables/{useCheckout.ts → useEquipmentItem.ts} +7 -7
- package/composables/{useCheckoutPermission.ts → useEquipmentItemPermission.ts} +13 -13
- package/composables/useEquipmentManagementPermission.ts +96 -0
- package/composables/{useSupplyPermission.ts → useEquipmentPermission.ts} +9 -9
- package/composables/usePeople.ts +4 -3
- package/composables/useVehicle.ts +35 -2
- package/composables/useVisitor.ts +3 -3
- package/composables/useWorkOrder.ts +25 -3
- package/package.json +3 -2
- package/types/building.d.ts +1 -1
- package/types/cleaner-schedule.d.ts +1 -0
- package/types/{checkout-item.d.ts → equipment-item.d.ts} +3 -3
- package/types/{supply.d.ts → equipment.d.ts} +2 -2
- package/types/html2pdf.d.ts +19 -0
- package/types/people.d.ts +5 -2
- package/types/site.d.ts +8 -0
- package/types/vehicle.d.ts +4 -3
- package/types/visitor.d.ts +2 -1
- package/.playground/app.vue +0 -41
- package/.playground/eslint.config.mjs +0 -6
- package/.playground/nuxt.config.ts +0 -22
- package/.playground/pages/feedback.vue +0 -30
|
@@ -172,6 +172,55 @@ export default function useAccessManagement() {
|
|
|
172
172
|
);
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
+
function saveVisitorAccessCardQrTag(
|
|
176
|
+
siteId: string,
|
|
177
|
+
payloads: Array<{
|
|
178
|
+
_id: string;
|
|
179
|
+
cardNo: string;
|
|
180
|
+
qrTag: string;
|
|
181
|
+
qrTagCardNo: string;
|
|
182
|
+
}>
|
|
183
|
+
) {
|
|
184
|
+
return useNuxtApp().$api<Record<string, any>>(
|
|
185
|
+
`/api/access-management/qr-tag/${siteId}`,
|
|
186
|
+
{
|
|
187
|
+
method: "POST",
|
|
188
|
+
body: payloads,
|
|
189
|
+
}
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
function getAllVisitorAccessCardsQrTags(site: string) {
|
|
194
|
+
return useNuxtApp().$api<Record<string, any>>(
|
|
195
|
+
`/api/access-management/qr-tag`,
|
|
196
|
+
{
|
|
197
|
+
method: "GET",
|
|
198
|
+
query: { site },
|
|
199
|
+
}
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
function getVisitorAccessCards(params: {
|
|
204
|
+
page?: number;
|
|
205
|
+
limit?: number;
|
|
206
|
+
site?: string;
|
|
207
|
+
search?: string;
|
|
208
|
+
} = {}) {
|
|
209
|
+
return useNuxtApp().$api<Record<string, any>>(
|
|
210
|
+
`/api/access-management/visitor-access-cards`,
|
|
211
|
+
{
|
|
212
|
+
method: "GET",
|
|
213
|
+
query: {
|
|
214
|
+
type: "Visitor/Resident",
|
|
215
|
+
...(params.page ? { page: params.page } : {}),
|
|
216
|
+
...(params.limit ? { limit: params.limit } : {}),
|
|
217
|
+
...(params.site ? { site: params.site } : {}),
|
|
218
|
+
...(params.search ? { search: params.search } : {}),
|
|
219
|
+
},
|
|
220
|
+
}
|
|
221
|
+
);
|
|
222
|
+
}
|
|
223
|
+
|
|
175
224
|
return {
|
|
176
225
|
getDoorAccessLevels,
|
|
177
226
|
getLiftAccessLevels,
|
|
@@ -186,5 +235,8 @@ export default function useAccessManagement() {
|
|
|
186
235
|
deleteCard,
|
|
187
236
|
getCardHistory,
|
|
188
237
|
getCardDetails,
|
|
238
|
+
getVisitorAccessCards,
|
|
239
|
+
saveVisitorAccessCardQrTag,
|
|
240
|
+
getAllVisitorAccessCardsQrTags,
|
|
189
241
|
};
|
|
190
242
|
}
|
|
@@ -162,27 +162,27 @@ export default function useCleaningPermission() {
|
|
|
162
162
|
description: "Allows the user to check in and check out.",
|
|
163
163
|
},
|
|
164
164
|
},
|
|
165
|
-
//
|
|
165
|
+
// equipment management permissions
|
|
166
166
|
"supply-mgmt": {
|
|
167
167
|
"see-all-supplies": {
|
|
168
168
|
check: true,
|
|
169
|
-
description: "Allows the user to view the list of all
|
|
169
|
+
description: "Allows the user to view the list of all equipments.",
|
|
170
170
|
},
|
|
171
171
|
"add-supply": {
|
|
172
172
|
check: true,
|
|
173
|
-
description: "Allows the user to create/add a new
|
|
173
|
+
description: "Allows the user to create/add a new equipment item.",
|
|
174
174
|
},
|
|
175
175
|
"update-supply": {
|
|
176
176
|
check: true,
|
|
177
|
-
description: "Allows the user to update/edit
|
|
177
|
+
description: "Allows the user to update/edit equipment details.",
|
|
178
178
|
},
|
|
179
179
|
"delete-supply": {
|
|
180
180
|
check: true,
|
|
181
|
-
description: "Allows the user to delete/remove
|
|
181
|
+
description: "Allows the user to delete/remove an equipment item.",
|
|
182
182
|
},
|
|
183
183
|
"add-stock": {
|
|
184
184
|
check: true,
|
|
185
|
-
description: "Allows the user to add stock to
|
|
185
|
+
description: "Allows the user to add stock to equipment items.",
|
|
186
186
|
},
|
|
187
187
|
"view-stock": {
|
|
188
188
|
check: true,
|
|
@@ -190,7 +190,7 @@ export default function useCleaningPermission() {
|
|
|
190
190
|
},
|
|
191
191
|
"checkout-item": {
|
|
192
192
|
check: true,
|
|
193
|
-
description: "Allows the user to checkout
|
|
193
|
+
description: "Allows the user to checkout equipment items.",
|
|
194
194
|
},
|
|
195
195
|
},
|
|
196
196
|
// checkout item management permissions
|
|
@@ -137,7 +137,7 @@ const dashboardDataMap: Record<string, ModuleData> = {
|
|
|
137
137
|
color: '#43A047',
|
|
138
138
|
},
|
|
139
139
|
{
|
|
140
|
-
title: '
|
|
140
|
+
title: 'Equipment Management',
|
|
141
141
|
value: 42,
|
|
142
142
|
percentage: 12.5,
|
|
143
143
|
isPositive: true,
|
|
@@ -166,7 +166,7 @@ const dashboardDataMap: Record<string, ModuleData> = {
|
|
|
166
166
|
'Work Orders',
|
|
167
167
|
'Schedule Task Ticket',
|
|
168
168
|
'Attendance',
|
|
169
|
-
'
|
|
169
|
+
'Equipment Management',
|
|
170
170
|
'Checkout Items',
|
|
171
171
|
'Cleaning Schedule - Checklist, Area, Unit',
|
|
172
172
|
],
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export default function
|
|
2
|
-
function
|
|
1
|
+
export default function useEquipment() {
|
|
2
|
+
function getEquipments({ page = 1, search = "", limit = 10, site = "" } = {}) {
|
|
3
3
|
return useNuxtApp().$api<Record<string, any>>(
|
|
4
4
|
`/api/hygiene-supplies/site/${site}`,
|
|
5
5
|
{
|
|
@@ -9,7 +9,7 @@ export default function useSupply() {
|
|
|
9
9
|
);
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
function
|
|
12
|
+
function getEquipmentById(id: string) {
|
|
13
13
|
return useNuxtApp().$api<Record<string, any>>(
|
|
14
14
|
`/api/hygiene-supplies/id/${id}`,
|
|
15
15
|
{
|
|
@@ -18,7 +18,7 @@ export default function useSupply() {
|
|
|
18
18
|
);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
function
|
|
21
|
+
function createEquipment(payload: TEquipmentCreate, site: string) {
|
|
22
22
|
return useNuxtApp().$api<Record<string, any>>(
|
|
23
23
|
`/api/hygiene-supplies/site/${site}`,
|
|
24
24
|
{
|
|
@@ -31,7 +31,7 @@ export default function useSupply() {
|
|
|
31
31
|
);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
function
|
|
34
|
+
function updateEquipment(id: string, payload: TEquipmentCreate) {
|
|
35
35
|
return useNuxtApp().$api<Record<string, any>>(
|
|
36
36
|
`/api/hygiene-supplies/id/${id}`,
|
|
37
37
|
{
|
|
@@ -44,7 +44,7 @@ export default function useSupply() {
|
|
|
44
44
|
);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
function
|
|
47
|
+
function deleteEquipment(id: string) {
|
|
48
48
|
return useNuxtApp().$api<Record<string, any>>(
|
|
49
49
|
`/api/hygiene-supplies/id/${id}`,
|
|
50
50
|
{
|
|
@@ -54,10 +54,10 @@ export default function useSupply() {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
return {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
57
|
+
getEquipments,
|
|
58
|
+
getEquipmentById,
|
|
59
|
+
createEquipment,
|
|
60
|
+
updateEquipment,
|
|
61
|
+
deleteEquipment,
|
|
62
62
|
};
|
|
63
63
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export default function
|
|
2
|
-
function
|
|
1
|
+
export default function useEquipmentItem() {
|
|
2
|
+
function getEquipmentItems({
|
|
3
3
|
page = 1,
|
|
4
4
|
search = "",
|
|
5
5
|
limit = 10,
|
|
@@ -14,7 +14,7 @@ export default function useCheckout() {
|
|
|
14
14
|
);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
function
|
|
17
|
+
function getEquipmentItemById(id: string) {
|
|
18
18
|
return useNuxtApp().$api<Record<string, any>>(
|
|
19
19
|
`/api/hygiene-checkout-items/id/${id}`,
|
|
20
20
|
{
|
|
@@ -23,7 +23,7 @@ export default function useCheckout() {
|
|
|
23
23
|
);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
function
|
|
26
|
+
function equipmentItems(site: string, payload: TEquipmentItemCreate) {
|
|
27
27
|
return useNuxtApp().$api<Record<string, any>>(
|
|
28
28
|
`/api/hygiene-checkout-items/site/${site}/batch`,
|
|
29
29
|
{
|
|
@@ -52,9 +52,9 @@ export default function useCheckout() {
|
|
|
52
52
|
);
|
|
53
53
|
}
|
|
54
54
|
return {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
getEquipmentItems,
|
|
56
|
+
getEquipmentItemById,
|
|
57
|
+
equipmentItems,
|
|
58
58
|
approveItem,
|
|
59
59
|
disapproveItem,
|
|
60
60
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export function
|
|
1
|
+
export function useEquipmentItemPermission() {
|
|
2
2
|
const { hasPermission } = usePermission();
|
|
3
3
|
const { permissions } = useCleaningPermission();
|
|
4
4
|
const { userAppRole } = useLocalSetup();
|
|
5
5
|
|
|
6
|
-
const
|
|
6
|
+
const canViewAllEquipmentItems = computed(() => {
|
|
7
7
|
if (!userAppRole.value) return true;
|
|
8
8
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
9
9
|
return hasPermission(
|
|
@@ -14,7 +14,7 @@ export function useCheckoutPermission() {
|
|
|
14
14
|
);
|
|
15
15
|
});
|
|
16
16
|
|
|
17
|
-
const
|
|
17
|
+
const canCreateEquipmentItem = computed(() => {
|
|
18
18
|
if (!userAppRole.value) return true;
|
|
19
19
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
20
20
|
return hasPermission(
|
|
@@ -25,7 +25,7 @@ export function useCheckoutPermission() {
|
|
|
25
25
|
);
|
|
26
26
|
});
|
|
27
27
|
|
|
28
|
-
const
|
|
28
|
+
const canUpdateEquipmentItem = computed(() => {
|
|
29
29
|
if (!userAppRole.value) return true;
|
|
30
30
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
31
31
|
return hasPermission(
|
|
@@ -36,7 +36,7 @@ export function useCheckoutPermission() {
|
|
|
36
36
|
);
|
|
37
37
|
});
|
|
38
38
|
|
|
39
|
-
const
|
|
39
|
+
const canApproveEquipmentItem = computed(() => {
|
|
40
40
|
if (!userAppRole.value) return true;
|
|
41
41
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
42
42
|
return hasPermission(
|
|
@@ -47,7 +47,7 @@ export function useCheckoutPermission() {
|
|
|
47
47
|
);
|
|
48
48
|
});
|
|
49
49
|
|
|
50
|
-
const
|
|
50
|
+
const canDisapproveEquipmentItem = computed(() => {
|
|
51
51
|
if (!userAppRole.value) return true;
|
|
52
52
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
53
53
|
return hasPermission(
|
|
@@ -58,7 +58,7 @@ export function useCheckoutPermission() {
|
|
|
58
58
|
);
|
|
59
59
|
});
|
|
60
60
|
|
|
61
|
-
const
|
|
61
|
+
const canViewEquipmentItemDetails = computed(() => {
|
|
62
62
|
if (!userAppRole.value) return true;
|
|
63
63
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
64
64
|
return hasPermission(
|
|
@@ -70,11 +70,11 @@ export function useCheckoutPermission() {
|
|
|
70
70
|
});
|
|
71
71
|
|
|
72
72
|
return {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
73
|
+
canViewAllEquipmentItems,
|
|
74
|
+
canCreateEquipmentItem,
|
|
75
|
+
canUpdateEquipmentItem,
|
|
76
|
+
canApproveEquipmentItem,
|
|
77
|
+
canDisapproveEquipmentItem,
|
|
78
|
+
canViewEquipmentItemDetails,
|
|
79
79
|
};
|
|
80
80
|
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import useCleaningPermission from "./useCleaningPermission";
|
|
2
|
+
import { useLocalSetup } from "./useLocalSetup";
|
|
3
|
+
import usePermission from "./usePermission";
|
|
4
|
+
|
|
5
|
+
export function useEquipmentManagementPermission() {
|
|
6
|
+
const { hasPermission } = usePermission();
|
|
7
|
+
const { permissions } = useCleaningPermission();
|
|
8
|
+
const { userAppRole } = useLocalSetup();
|
|
9
|
+
|
|
10
|
+
const canViewEquipments = computed(() => {
|
|
11
|
+
if (!userAppRole.value) return true;
|
|
12
|
+
if (userAppRole.value.permissions.includes("*")) return true;
|
|
13
|
+
return hasPermission(
|
|
14
|
+
userAppRole.value,
|
|
15
|
+
permissions,
|
|
16
|
+
"supply-mgmt",
|
|
17
|
+
"see-all-supplies"
|
|
18
|
+
);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const canAddEquipment = computed(() => {
|
|
22
|
+
if (!userAppRole.value) return true;
|
|
23
|
+
if (userAppRole.value.permissions.includes("*")) return true;
|
|
24
|
+
return hasPermission(
|
|
25
|
+
userAppRole.value,
|
|
26
|
+
permissions,
|
|
27
|
+
"supply-mgmt",
|
|
28
|
+
"add-supply"
|
|
29
|
+
);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
const canUpdateEquipment = computed(() => {
|
|
33
|
+
if (!userAppRole.value) return true;
|
|
34
|
+
if (userAppRole.value.permissions.includes("*")) return true;
|
|
35
|
+
return hasPermission(
|
|
36
|
+
userAppRole.value,
|
|
37
|
+
permissions,
|
|
38
|
+
"supply-mgmt",
|
|
39
|
+
"update-supply"
|
|
40
|
+
);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
const canDeleteEquipment = computed(() => {
|
|
44
|
+
if (!userAppRole.value) return true;
|
|
45
|
+
if (userAppRole.value.permissions.includes("*")) return true;
|
|
46
|
+
return hasPermission(
|
|
47
|
+
userAppRole.value,
|
|
48
|
+
permissions,
|
|
49
|
+
"supply-mgmt",
|
|
50
|
+
"delete-supply"
|
|
51
|
+
);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
const canAddStock = computed(() => {
|
|
55
|
+
if (!userAppRole.value) return true;
|
|
56
|
+
if (userAppRole.value.permissions.includes("*")) return true;
|
|
57
|
+
return hasPermission(
|
|
58
|
+
userAppRole.value,
|
|
59
|
+
permissions,
|
|
60
|
+
"supply-mgmt",
|
|
61
|
+
"add-stock"
|
|
62
|
+
);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
const canViewStock = computed(() => {
|
|
66
|
+
if (!userAppRole.value) return true;
|
|
67
|
+
if (userAppRole.value.permissions.includes("*")) return true;
|
|
68
|
+
return hasPermission(
|
|
69
|
+
userAppRole.value,
|
|
70
|
+
permissions,
|
|
71
|
+
"supply-mgmt",
|
|
72
|
+
"view-stock"
|
|
73
|
+
);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
const canRequestItem = computed(() => {
|
|
77
|
+
if (!userAppRole.value) return true;
|
|
78
|
+
if (userAppRole.value.permissions.includes("*")) return true;
|
|
79
|
+
return hasPermission(
|
|
80
|
+
userAppRole.value,
|
|
81
|
+
permissions,
|
|
82
|
+
"supply-mgmt",
|
|
83
|
+
"request-item"
|
|
84
|
+
);
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
return {
|
|
88
|
+
canViewEquipments,
|
|
89
|
+
canAddEquipment,
|
|
90
|
+
canUpdateEquipment,
|
|
91
|
+
canDeleteEquipment,
|
|
92
|
+
canAddStock,
|
|
93
|
+
canViewStock,
|
|
94
|
+
canRequestItem,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export function
|
|
1
|
+
export function useEquipmentPermission() {
|
|
2
2
|
const { hasPermission } = usePermission();
|
|
3
3
|
const { permissions } = useCleaningPermission();
|
|
4
4
|
const { userAppRole } = useLocalSetup();
|
|
5
5
|
|
|
6
|
-
const
|
|
6
|
+
const canViewEquipments = computed(() => {
|
|
7
7
|
if (!userAppRole.value) return true;
|
|
8
8
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
9
9
|
return hasPermission(
|
|
@@ -14,7 +14,7 @@ export function useSupplyPermission() {
|
|
|
14
14
|
);
|
|
15
15
|
});
|
|
16
16
|
|
|
17
|
-
const
|
|
17
|
+
const canAddEquipment = computed(() => {
|
|
18
18
|
if (!userAppRole.value) return true;
|
|
19
19
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
20
20
|
return hasPermission(
|
|
@@ -25,7 +25,7 @@ export function useSupplyPermission() {
|
|
|
25
25
|
);
|
|
26
26
|
});
|
|
27
27
|
|
|
28
|
-
const
|
|
28
|
+
const canUpdateEquipment = computed(() => {
|
|
29
29
|
if (!userAppRole.value) return true;
|
|
30
30
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
31
31
|
return hasPermission(
|
|
@@ -36,7 +36,7 @@ export function useSupplyPermission() {
|
|
|
36
36
|
);
|
|
37
37
|
});
|
|
38
38
|
|
|
39
|
-
const
|
|
39
|
+
const canDeleteEquipment = computed(() => {
|
|
40
40
|
if (!userAppRole.value) return true;
|
|
41
41
|
if (userAppRole.value.permissions.includes("*")) return true;
|
|
42
42
|
return hasPermission(
|
|
@@ -81,10 +81,10 @@ export function useSupplyPermission() {
|
|
|
81
81
|
});
|
|
82
82
|
|
|
83
83
|
return {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
84
|
+
canViewEquipments,
|
|
85
|
+
canAddEquipment,
|
|
86
|
+
canUpdateEquipment,
|
|
87
|
+
canDeleteEquipment,
|
|
88
88
|
canAddStock,
|
|
89
89
|
canViewStock,
|
|
90
90
|
canRequestItem,
|
package/composables/usePeople.ts
CHANGED
|
@@ -10,10 +10,11 @@ export default function () {
|
|
|
10
10
|
dateFrom = "",
|
|
11
11
|
type = "",
|
|
12
12
|
displayNoCheckOut = false,
|
|
13
|
+
status = "",
|
|
13
14
|
} = {}) {
|
|
14
15
|
return await useNuxtApp().$api<Record<string, any>>("/api/people", {
|
|
15
16
|
method: "GET",
|
|
16
|
-
query: { page, limit, sort, search, org, site, dateTo, dateFrom, type },
|
|
17
|
+
query: { page, limit, sort, search, org, site, dateTo, dateFrom, type, status },
|
|
17
18
|
});
|
|
18
19
|
}
|
|
19
20
|
|
|
@@ -87,13 +88,13 @@ export default function () {
|
|
|
87
88
|
|
|
88
89
|
async function getPeopleByUnit(
|
|
89
90
|
_id: string,
|
|
90
|
-
{ status = "active", type = "
|
|
91
|
+
{ status = "active", type = "" } = {}
|
|
91
92
|
) {
|
|
92
93
|
return await useNuxtApp().$api<Record<string, any>>(
|
|
93
94
|
`/api/people/unit/${_id}`,
|
|
94
95
|
{
|
|
95
96
|
method: "GET",
|
|
96
|
-
query: { status
|
|
97
|
+
query: { status },
|
|
97
98
|
}
|
|
98
99
|
);
|
|
99
100
|
}
|
|
@@ -43,6 +43,16 @@ export default function useVehicle() {
|
|
|
43
43
|
);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
async function searchMultipleVehiclesByUnitId({unitId, page = 1, limit = 10}: {unitId: string, page?: number, limit?: number}) {
|
|
47
|
+
return await useNuxtApp().$api<Record<string, any>>(
|
|
48
|
+
`/api/vehicles/unit/${unitId}`,
|
|
49
|
+
{
|
|
50
|
+
method: "GET",
|
|
51
|
+
query: { page, limit },
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
46
56
|
interface IDeleteVehicleParams {
|
|
47
57
|
site: string;
|
|
48
58
|
id: string;
|
|
@@ -64,6 +74,19 @@ export default function useVehicle() {
|
|
|
64
74
|
);
|
|
65
75
|
}
|
|
66
76
|
|
|
77
|
+
async function approveVehicle({ site, org, id }: { site: string, org: string, id: string}){
|
|
78
|
+
return await useNuxtApp().$api<Record<string, any>>(
|
|
79
|
+
`/api/vehicles/approve/ ${id}`,
|
|
80
|
+
{
|
|
81
|
+
method: "PUT",
|
|
82
|
+
body: {
|
|
83
|
+
site,
|
|
84
|
+
org,
|
|
85
|
+
},
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
|
|
67
90
|
async function getVehicleByNRIC(search: string) {
|
|
68
91
|
return await useNuxtApp().$api<Record<string, any>>(
|
|
69
92
|
`/api/vehicles/nric`,
|
|
@@ -77,7 +100,7 @@ export default function useVehicle() {
|
|
|
77
100
|
}
|
|
78
101
|
|
|
79
102
|
|
|
80
|
-
function formatVehicleStatus(status:
|
|
103
|
+
function formatVehicleStatus(status: TVehicleStatus) {
|
|
81
104
|
let label = ""
|
|
82
105
|
let color = ""
|
|
83
106
|
switch (status) {
|
|
@@ -93,6 +116,14 @@ export default function useVehicle() {
|
|
|
93
116
|
label = "Rejected"
|
|
94
117
|
color = "red"
|
|
95
118
|
break;
|
|
119
|
+
case 'deleted':
|
|
120
|
+
label = "Deleted"
|
|
121
|
+
color = "grey"
|
|
122
|
+
break;
|
|
123
|
+
case 'inactive':
|
|
124
|
+
label = "Deleted"
|
|
125
|
+
color = "grey"
|
|
126
|
+
break;
|
|
96
127
|
default:
|
|
97
128
|
label = status?.charAt(0).toUpperCase() + status?.slice(1) || ""
|
|
98
129
|
color = "grey"
|
|
@@ -109,6 +140,8 @@ export default function useVehicle() {
|
|
|
109
140
|
updateVehicle,
|
|
110
141
|
deleteVehicle,
|
|
111
142
|
getVehicleByNRIC,
|
|
112
|
-
formatVehicleStatus
|
|
143
|
+
formatVehicleStatus,
|
|
144
|
+
approveVehicle,
|
|
145
|
+
searchMultipleVehiclesByUnitId
|
|
113
146
|
};
|
|
114
147
|
}
|
|
@@ -5,7 +5,7 @@ export default function () {
|
|
|
5
5
|
};
|
|
6
6
|
|
|
7
7
|
const visitorSelection: TVisitorSelection[] =[
|
|
8
|
-
|
|
8
|
+
{ label: "Drive-in", value: "guest" },
|
|
9
9
|
{ label: "Contractor", value: "contractor" },
|
|
10
10
|
{ label: "Walk-In", value: "walk-in" },
|
|
11
11
|
{ label: "Delivery", value: "delivery" },
|
|
@@ -14,7 +14,7 @@ export default function () {
|
|
|
14
14
|
];
|
|
15
15
|
|
|
16
16
|
const typeFieldMap: Record<TVisitorType, (keyof TVisitorPayload)[]> = {
|
|
17
|
-
guest: ['name', 'nric', 'contact', '
|
|
17
|
+
guest: ['name', 'nric', 'contact', 'block', 'plateNumber', 'level', 'unit' , 'unitName', 'remarks'],
|
|
18
18
|
contractor: ['contractorType', 'name', 'nric', 'company', 'contact', 'plateNumber', 'block', 'level', 'unit', 'unitName', 'remarks'],
|
|
19
19
|
'walk-in': ['name', 'company', 'nric', 'contact', 'block', 'level', 'unit' , 'unitName', 'remarks'],
|
|
20
20
|
delivery: ['attachments', 'name', 'deliveryType', 'company', 'nric', 'contact', 'plateNumber', 'block', 'level', 'unit' , 'unitName', 'remarks'],
|
|
@@ -54,7 +54,7 @@ export default function () {
|
|
|
54
54
|
dateTo = "",
|
|
55
55
|
dateFrom = "",
|
|
56
56
|
type = "",
|
|
57
|
-
status = "
|
|
57
|
+
status = "",
|
|
58
58
|
// status = "registered"
|
|
59
59
|
checkedOut
|
|
60
60
|
}: GetVisitorsParams = {}) {
|
|
@@ -72,9 +72,29 @@ export default function useWorkOrder() {
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
function deleteWorkOrder(id: string) {
|
|
75
|
-
return useNuxtApp().$api<Record<string, any>>(
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
return useNuxtApp().$api<Record<string, any>>(
|
|
76
|
+
`/api/work-orders/deleted/work-order/${id}`,
|
|
77
|
+
{
|
|
78
|
+
method: "PUT",
|
|
79
|
+
// query: { id },
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function getWorkOrderSettings(_workOrderSettings: Record<string, any>) {
|
|
85
|
+
return useNuxtApp().$api<Record<string, any>>(
|
|
86
|
+
"/api/work-order-settings/get-by-site",
|
|
87
|
+
{
|
|
88
|
+
method: "POST",
|
|
89
|
+
body: _workOrderSettings,
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function createWorkOrderSettings(_workOrderSettings: Record<string, any>) {
|
|
95
|
+
return useNuxtApp().$api<Record<string, any>>("/api/work-order-settings", {
|
|
96
|
+
method: "POST",
|
|
97
|
+
body: _workOrderSettings,
|
|
78
98
|
});
|
|
79
99
|
}
|
|
80
100
|
|
|
@@ -89,5 +109,7 @@ export default function useWorkOrder() {
|
|
|
89
109
|
getWorkOrderById,
|
|
90
110
|
updateWorkOrder,
|
|
91
111
|
deleteWorkOrder,
|
|
112
|
+
getWorkOrderSettings,
|
|
113
|
+
createWorkOrderSettings,
|
|
92
114
|
};
|
|
93
115
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@7365admin1/layer-common",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "1.10.
|
|
5
|
+
"version": "1.10.8",
|
|
6
6
|
"author": "7365admin1",
|
|
7
7
|
"main": "./nuxt.config.ts",
|
|
8
8
|
"publishConfig": {
|
|
@@ -30,11 +30,12 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@ckeditor/ckeditor5-vue": "^7.3.0",
|
|
32
32
|
"@iconify/vue": "^5.0.0",
|
|
33
|
-
"qrcode.vue": "^3.4.1",
|
|
34
33
|
"@mdi/font": "^7.4.47",
|
|
35
34
|
"@types/qrcode": "^1.5.6",
|
|
36
35
|
"ckeditor5": "^47.2.0",
|
|
36
|
+
"html2pdf.js": "^0.10.2",
|
|
37
37
|
"qrcode": "^1.5.4",
|
|
38
|
+
"qrcode.vue": "^3.4.1",
|
|
38
39
|
"sass": "^1.80.6",
|
|
39
40
|
"vue3-signature": "^0.2.4",
|
|
40
41
|
"zod": "^3.24.2"
|
package/types/building.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare type
|
|
1
|
+
declare type TEquipmentItemApi = {
|
|
2
2
|
_id: string;
|
|
3
3
|
createdAt: string;
|
|
4
4
|
name: string;
|
|
@@ -10,7 +10,7 @@ declare type TCheckoutItemApi = {
|
|
|
10
10
|
attachment?: string[];
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
declare type
|
|
13
|
+
declare type TEquipmentItemCreate = {
|
|
14
14
|
items: Array<{
|
|
15
15
|
supply: string;
|
|
16
16
|
qty: number;
|
|
@@ -18,7 +18,7 @@ declare type TCheckoutItemCreate = {
|
|
|
18
18
|
}>;
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
declare type
|
|
21
|
+
declare type TEquipmentItem = {
|
|
22
22
|
supply: string;
|
|
23
23
|
supplyName: string;
|
|
24
24
|
qty: number;
|