@7365admin1/layer-common 1.8.6 → 1.10.0
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/AccessCardAddForm.vue +235 -27
- package/components/BuildingUnitFormAdd.vue +13 -11
- package/components/Button/Close.vue +16 -0
- package/components/Dialog/UpdateMoreAction.vue +6 -1
- package/components/DocumentManagement.vue +4 -9
- package/components/FeedbackDetail.vue +21 -10
- package/components/IncidentReport/Authorities.vue +226 -0
- package/components/IncidentReport/IncidentInformation.vue +258 -0
- package/components/IncidentReport/affectedEntities.vue +167 -0
- package/components/Input/DatePicker.vue +102 -0
- package/components/InvitationMain.vue +19 -17
- package/components/PasswordConfirmation.vue +95 -0
- package/components/RolePermissionMain.vue +17 -15
- package/components/ServiceProviderMain.vue +27 -7
- package/components/VisitorForm.vue +3 -1
- package/components/VisitorManagement.vue +6 -1
- package/components/WorkOrder/Detail.vue +179 -2
- package/components/WorkOrder/Main.vue +65 -4
- package/composables/useBuildingUnit.ts +1 -1
- package/composables/useDOBEntries.ts +13 -0
- package/composables/useDocument.ts +3 -2
- package/composables/useFeedback.ts +3 -2
- package/composables/useFile.ts +4 -6
- package/composables/useNFCPatrolSettings.ts +1 -1
- package/composables/useRole.ts +3 -2
- package/composables/useWorkOrder.ts +8 -0
- package/package.json +1 -1
- package/types/card.d.ts +5 -0
- package/types/verification.d.ts +1 -1
- /package/components/{NFC/PatrolSettings.vue → Nfc/NFCPatrolSettings.vue} +0 -0
|
@@ -65,6 +65,9 @@
|
|
|
65
65
|
@click:row="tableRowClickHandler"
|
|
66
66
|
style="max-height: calc(100vh - (200px))"
|
|
67
67
|
>
|
|
68
|
+
<template v-slot:item.createdAt="{ item }">
|
|
69
|
+
{{ formatDateDDMMYYYYLocal(item.createdAt) }}
|
|
70
|
+
</template>
|
|
68
71
|
</v-data-table>
|
|
69
72
|
</v-card>
|
|
70
73
|
</v-col>
|
|
@@ -88,6 +91,39 @@
|
|
|
88
91
|
@submit="submitWorkOrder"
|
|
89
92
|
/>
|
|
90
93
|
|
|
94
|
+
<ConfirmDialog
|
|
95
|
+
v-model="showDeleteDialog"
|
|
96
|
+
:loading="submitting"
|
|
97
|
+
@submit="submitDelete"
|
|
98
|
+
:image-src="'/images/icons/delete-icon.png'"
|
|
99
|
+
>
|
|
100
|
+
<template #image>
|
|
101
|
+
<v-img
|
|
102
|
+
height="120"
|
|
103
|
+
src="/images/icons/delete-icon.png"
|
|
104
|
+
alt="Delete Icon"
|
|
105
|
+
contain
|
|
106
|
+
/>
|
|
107
|
+
</template>
|
|
108
|
+
|
|
109
|
+
<template #title>
|
|
110
|
+
Are you sure you want to delete this work order?
|
|
111
|
+
</template>
|
|
112
|
+
|
|
113
|
+
<template #footer>
|
|
114
|
+
<v-btn
|
|
115
|
+
color="primary-button"
|
|
116
|
+
variant="flat"
|
|
117
|
+
class="font-weight-bold py-5 d-flex align-center justify-center"
|
|
118
|
+
@click="submitDelete"
|
|
119
|
+
:loading="submitting"
|
|
120
|
+
block
|
|
121
|
+
>
|
|
122
|
+
Confirm
|
|
123
|
+
</v-btn>
|
|
124
|
+
</template>
|
|
125
|
+
</ConfirmDialog>
|
|
126
|
+
|
|
91
127
|
<Snackbar v-model="messageSnackbar" :text="message" :color="messageColor" />
|
|
92
128
|
|
|
93
129
|
<!-- Preview Dialog -->
|
|
@@ -235,7 +271,8 @@ const message = ref("");
|
|
|
235
271
|
const messageColor = ref("");
|
|
236
272
|
const messageSnackbar = ref(false);
|
|
237
273
|
|
|
238
|
-
const { getColorStatus, formatDate, debounce } =
|
|
274
|
+
const { getColorStatus, formatDate, debounce, formatDateDDMMYYYYLocal } =
|
|
275
|
+
useUtils();
|
|
239
276
|
|
|
240
277
|
const _workOrder = ref<TWorkOrderCreate>({
|
|
241
278
|
attachments: [],
|
|
@@ -272,12 +309,14 @@ const submitting = ref(false);
|
|
|
272
309
|
const selected = ref<string[]>([]);
|
|
273
310
|
const route = useRoute();
|
|
274
311
|
const { customers } = useCustomer();
|
|
312
|
+
const showDeleteDialog = ref(false);
|
|
275
313
|
|
|
276
314
|
const {
|
|
277
315
|
getWorkOrders: _getWorkOrders,
|
|
278
316
|
createWorkOrder,
|
|
279
317
|
getWorkOrderById,
|
|
280
318
|
updateWorkOrder,
|
|
319
|
+
deleteWorkOrder,
|
|
281
320
|
} = useWorkOrder();
|
|
282
321
|
|
|
283
322
|
const page = ref(1);
|
|
@@ -444,8 +483,8 @@ async function submitWorkOrder() {
|
|
|
444
483
|
|
|
445
484
|
showMessage(res.message, "success");
|
|
446
485
|
showCreateDialog.value = false;
|
|
486
|
+
await getAllReqRefresh();
|
|
447
487
|
resetWorkOrderForm();
|
|
448
|
-
getAllReqRefresh();
|
|
449
488
|
} catch (err) {
|
|
450
489
|
showMessage((err as Error).message, "error");
|
|
451
490
|
} finally {
|
|
@@ -468,7 +507,6 @@ function onViewWorkOrder(item: any) {
|
|
|
468
507
|
async function editWorkOrder(item: any) {
|
|
469
508
|
try {
|
|
470
509
|
const _workOrders = await getWorkOrderById(item._id);
|
|
471
|
-
console.log(_workOrders);
|
|
472
510
|
_workOrder.value = {
|
|
473
511
|
attachments: (_workOrders.attachments || []) as string[],
|
|
474
512
|
category: _workOrders.category || "",
|
|
@@ -488,7 +526,30 @@ async function editWorkOrder(item: any) {
|
|
|
488
526
|
|
|
489
527
|
async function _updateWorkOrder() {}
|
|
490
528
|
|
|
491
|
-
function confirmDeleteWorkOrder(item: any) {
|
|
529
|
+
function confirmDeleteWorkOrder(item: any) {
|
|
530
|
+
workOrderToDelete.value = item;
|
|
531
|
+
showDeleteDialog.value = true;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
const workOrderToDelete = ref<any>(null);
|
|
535
|
+
|
|
536
|
+
async function submitDelete() {
|
|
537
|
+
if (!workOrderToDelete.value) return;
|
|
538
|
+
submitting.value = true;
|
|
539
|
+
try {
|
|
540
|
+
const response = await deleteWorkOrder(workOrderToDelete.value._id);
|
|
541
|
+
showMessage(response.message, "success");
|
|
542
|
+
await getAllReqRefresh();
|
|
543
|
+
} catch (error) {
|
|
544
|
+
console.error("Failed to delete work order:", error);
|
|
545
|
+
showMessage("Failed to delete work order!", "error");
|
|
546
|
+
} finally {
|
|
547
|
+
submitting.value = false;
|
|
548
|
+
showDeleteDialog.value = false;
|
|
549
|
+
workOrderToDelete.value = null;
|
|
550
|
+
dialogPreview.value = false;
|
|
551
|
+
}
|
|
552
|
+
}
|
|
492
553
|
|
|
493
554
|
function tableRowClickHandler(_: any, data: any) {
|
|
494
555
|
selectedWorkOrder.value = data.item;
|
|
@@ -73,7 +73,7 @@ export default function useBuildingUnit() {
|
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
function add(data: { labels: string[]; unit: TBuildingUnit
|
|
76
|
+
function add(data: { labels: string[]; unit: Partial<TBuildingUnit>; qty?: number }) {
|
|
77
77
|
return useNuxtApp().$api("/api/building-units", {
|
|
78
78
|
method: "POST",
|
|
79
79
|
body: data,
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export default function () {
|
|
2
|
+
async function confirmPassword({ userId, password} : { userId: string; password: string}) {
|
|
3
|
+
return await useNuxtApp().$api<Record<string, any>>(`/api/auth/verify-password/id/${userId}`, {
|
|
4
|
+
method: "POST",
|
|
5
|
+
body: { password},
|
|
6
|
+
});
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
return {
|
|
11
|
+
confirmPassword
|
|
12
|
+
};
|
|
13
|
+
}
|
|
@@ -26,8 +26,9 @@ export default function useDocument() {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
function deleteById(id: string) {
|
|
29
|
-
return useNuxtApp().$api(`/api/documents
|
|
30
|
-
method: "
|
|
29
|
+
return useNuxtApp().$api<Record<string, any>>(`/api/documents/deleted/document`, {
|
|
30
|
+
method: "PUT",
|
|
31
|
+
query: { id },
|
|
31
32
|
});
|
|
32
33
|
}
|
|
33
34
|
|
|
@@ -75,8 +75,9 @@ export default function useFeedback() {
|
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
function deleteFeedback(id: string) {
|
|
78
|
-
return useNuxtApp().$api<Record<string, any>>(`/api/feedbacks
|
|
78
|
+
return useNuxtApp().$api<Record<string, any>>(`/api/feedbacks/deleted/feedback`, {
|
|
79
79
|
method: "DELETE",
|
|
80
|
+
query: { id },
|
|
80
81
|
});
|
|
81
82
|
}
|
|
82
83
|
|
|
@@ -94,7 +95,7 @@ export default function useFeedback() {
|
|
|
94
95
|
|
|
95
96
|
function updateStatusComplete(id: string, payload: TFeedbackStatusComplete) {
|
|
96
97
|
return useNuxtApp().$api<Record<string, any>>(
|
|
97
|
-
`/api/feedbacks/${id}/status
|
|
98
|
+
`/api/feedbacks/${id}/status/complete`,
|
|
98
99
|
{
|
|
99
100
|
method: "PUT",
|
|
100
101
|
body: payload,
|
package/composables/useFile.ts
CHANGED
|
@@ -30,12 +30,10 @@ export default function useFile() {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
function deleteFile(attachmentId: string) {
|
|
33
|
-
return useNuxtApp().$api<Record<string, any>>(
|
|
34
|
-
|
|
35
|
-
{
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
);
|
|
33
|
+
return useNuxtApp().$api<Record<string, any>>(`/api/files/deleted/file`, {
|
|
34
|
+
method: "PUT",
|
|
35
|
+
query: { id: attachmentId },
|
|
36
|
+
});
|
|
39
37
|
}
|
|
40
38
|
|
|
41
39
|
function getFileById(id: string) {
|
package/composables/useRole.ts
CHANGED
|
@@ -58,8 +58,9 @@ export default function useRole() {
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
function deleteRole(_id: string) {
|
|
61
|
-
return useNuxtApp().$api<Record<string, any>>(`/api/roles
|
|
62
|
-
method: "
|
|
61
|
+
return useNuxtApp().$api<Record<string, any>>(`/api/roles/deleted/role`, {
|
|
62
|
+
method: "PUT",
|
|
63
|
+
query: { id: _id },
|
|
63
64
|
});
|
|
64
65
|
}
|
|
65
66
|
|
|
@@ -71,6 +71,13 @@ export default function useWorkOrder() {
|
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
+
function deleteWorkOrder(id: string) {
|
|
75
|
+
return useNuxtApp().$api<Record<string, any>>(`/api/work-orders/deleted/work-order`, {
|
|
76
|
+
method: "DELETE",
|
|
77
|
+
query: { id },
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
|
|
74
81
|
return {
|
|
75
82
|
workOrders,
|
|
76
83
|
workOrder,
|
|
@@ -81,5 +88,6 @@ export default function useWorkOrder() {
|
|
|
81
88
|
getWorkOrders,
|
|
82
89
|
getWorkOrderById,
|
|
83
90
|
updateWorkOrder,
|
|
91
|
+
deleteWorkOrder,
|
|
84
92
|
};
|
|
85
93
|
}
|
package/package.json
CHANGED
package/types/card.d.ts
CHANGED
package/types/verification.d.ts
CHANGED
|
File without changes
|