@7365admin1/layer-common 1.11.12 → 1.11.13
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
CHANGED
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
|
|
55
55
|
<v-col v-if="shouldShowField('nric')" cols="12">
|
|
56
56
|
<InputLabel class="text-capitalize" title="NRIC" required />
|
|
57
|
-
<InputNRICNumber v-model="vehicle.nric" density="comfortable" :rules="[requiredRule]" :disabled="disablePrefilledInputs" />
|
|
57
|
+
<InputNRICNumber v-model="vehicle.nric" density="comfortable" :rules="[requiredRule]" :disabled="disablePrefilledInputs && type !== 'blocklist'" />
|
|
58
58
|
</v-col>
|
|
59
59
|
|
|
60
60
|
<v-col v-if="shouldShowField('name')" cols="12">
|
|
@@ -184,7 +184,7 @@
|
|
|
184
184
|
</v-toolbar>
|
|
185
185
|
|
|
186
186
|
<v-dialog v-model="showMatchingPeopleDialog" max-width="700" persistent>
|
|
187
|
-
<v-card :loading="
|
|
187
|
+
<v-card :loading="checkingUnit">
|
|
188
188
|
<v-toolbar>
|
|
189
189
|
<v-toolbar-title>
|
|
190
190
|
<v-row no-gutters class="d-flex align-center justify-space-between">
|
|
@@ -192,14 +192,14 @@
|
|
|
192
192
|
Matching Records for "{{ searchUnitName ?? "-" }}"
|
|
193
193
|
</span>
|
|
194
194
|
<span>
|
|
195
|
-
<v-btn
|
|
196
|
-
@click="
|
|
195
|
+
<v-btn icon="mdi-close" variant="text"
|
|
196
|
+
@click="handleCloseMatchDialog" />
|
|
197
197
|
</span>
|
|
198
198
|
</v-row>
|
|
199
199
|
</v-toolbar-title>
|
|
200
200
|
</v-toolbar>
|
|
201
201
|
|
|
202
|
-
<v-card-text>
|
|
202
|
+
<v-card-text max-height="400" style="overflow-y: auto">
|
|
203
203
|
|
|
204
204
|
<v-list lines="three">
|
|
205
205
|
<v-list-item v-if="matchingPeople.length > 0 || checkingUnit" v-for="v in matchingPeople" :key="v._id"
|
|
@@ -743,6 +743,13 @@ const resetVehicleDetails = () => {
|
|
|
743
743
|
}
|
|
744
744
|
|
|
745
745
|
|
|
746
|
+
function handleCloseMatchDialog() {
|
|
747
|
+
showMatchingPeopleDialog.value = false;
|
|
748
|
+
if(matchingPeople.value.length > 0) {
|
|
749
|
+
vehicle.unit = null
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
|
|
746
753
|
|
|
747
754
|
|
|
748
755
|
|
|
@@ -89,17 +89,18 @@
|
|
|
89
89
|
</DialogUpdateMoreAction>
|
|
90
90
|
</v-dialog>
|
|
91
91
|
<v-dialog v-model="dialog.deleteVehicle" persistent width="540">
|
|
92
|
-
<DialogDeleteConfirmation :
|
|
92
|
+
<DialogDeleteConfirmation :loading="deletingVehicle" :prompt-title="`Are you sure want to delete this vehicle - ${selectedPlateNumberObject?.plateNumber}?`"
|
|
93
93
|
@delete="submitDelete" @close="closeDeleteDialog" />
|
|
94
94
|
</v-dialog>
|
|
95
95
|
<v-dialog v-model="dialog.approveVehicle" persistent width="540">
|
|
96
|
-
<DialogReusablePrompt :
|
|
96
|
+
<DialogReusablePrompt :loading="approvingVehicle" :prompt-title="`Are you sure want to approve this vehicle - ${selectedPlateNumberObject?.plateNumber}?`"
|
|
97
97
|
@approve="submitApprove" @close="dialog.approveVehicle = false" />
|
|
98
98
|
</v-dialog>
|
|
99
99
|
<v-dialog v-model="dialog.restoreVehicle" persistent width="540">
|
|
100
|
-
<DialogReusablePrompt :
|
|
101
|
-
@
|
|
100
|
+
<DialogReusablePrompt :loading="restoringVehicle" :prompt-title="`Are you sure want to restore this vehicle - ${selectedPlateNumberObject?.plateNumber}?`"
|
|
101
|
+
@proceed="submitRestore" @close="dialog.restoreVehicle = false" />
|
|
102
102
|
</v-dialog>
|
|
103
|
+
<Snackbar v-model="messageSnackbar" :text="message" :color="messageColor" />
|
|
103
104
|
</v-row>
|
|
104
105
|
</template>
|
|
105
106
|
|
|
@@ -199,7 +200,7 @@ const formattedFields: Partial<Record<keyof TVehicle, string>> = {
|
|
|
199
200
|
nric: "NRIC",
|
|
200
201
|
block: "Block",
|
|
201
202
|
level: "Level",
|
|
202
|
-
|
|
203
|
+
unitName: "Unit",
|
|
203
204
|
start: "Start",
|
|
204
205
|
end: "End",
|
|
205
206
|
category: "Category",
|
|
@@ -365,7 +366,10 @@ async function submitDelete() {
|
|
|
365
366
|
|
|
366
367
|
async function submitRestore() {
|
|
367
368
|
|
|
369
|
+
console.log("Submitting restore for plate number ID:", selectedPlateNumberObject.value);
|
|
368
370
|
const plateNumberId = selectedPlateNumberObject.value?._id;
|
|
371
|
+
|
|
372
|
+
|
|
369
373
|
if (!plateNumberId) {
|
|
370
374
|
showMessage("Invalid plate number selected for restoration.", "error");
|
|
371
375
|
return;
|
|
@@ -382,7 +386,9 @@ async function submitRestore() {
|
|
|
382
386
|
getVehiclesRefresh();
|
|
383
387
|
} catch (error: any) {
|
|
384
388
|
console.error("Error restoring vehicle:", error);
|
|
385
|
-
|
|
389
|
+
const errMessage = error?.response?._data?.message || "Failed to restore vehicle";
|
|
390
|
+
showMessage(errMessage, "error");
|
|
391
|
+
// message.value = error.response._data.message;
|
|
386
392
|
} finally {
|
|
387
393
|
restoringVehicle.value = false;
|
|
388
394
|
}
|
|
@@ -408,7 +414,8 @@ async function submitApprove() {
|
|
|
408
414
|
getVehiclesRefresh();
|
|
409
415
|
} catch (error: any) {
|
|
410
416
|
console.error("Error approving vehicle:", error);
|
|
411
|
-
|
|
417
|
+
const errMessage = error?.response?._data?.message || "Failed to approve vehicle";
|
|
418
|
+
showMessage(errMessage, "error");
|
|
412
419
|
} finally {
|
|
413
420
|
approvingVehicle.value = false;
|
|
414
421
|
}
|
|
@@ -75,7 +75,7 @@ export default function useVehicle() {
|
|
|
75
75
|
|
|
76
76
|
async function approveVehicle({ site, org, id }: { site: string, org: string, id: string}){
|
|
77
77
|
return await useNuxtApp().$api<Record<string, any>>(
|
|
78
|
-
`/api/vehicles/approve
|
|
78
|
+
`/api/vehicles/approve/${id}`,
|
|
79
79
|
{
|
|
80
80
|
method: "PUT",
|
|
81
81
|
body: {
|