@7365admin1/layer-common 3.0.6 → 3.0.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.
@@ -1,51 +1,137 @@
1
1
  <template>
2
2
  <v-row no-gutters>
3
- <TableMain :headers="headers" :items="items" :loading="getVisitorPending" :page="page" :pages="pages"
4
- :extension-height="110" :offset="300" :pageRange="pageRange" @refresh="getVisitorRefresh"
5
- @update:page="handleUpdatePage" show-header @row-click="handleRowClick">
3
+ <TableMain
4
+ :headers="headers"
5
+ :items="items"
6
+ :loading="getVisitorPending"
7
+ :page="page"
8
+ :pages="pages"
9
+ :extension-height="110"
10
+ :offset="300"
11
+ :pageRange="pageRange"
12
+ @refresh="getVisitorRefresh"
13
+ @update:page="handleUpdatePage"
14
+ show-header
15
+ @row-click="handleRowClick"
16
+ >
6
17
  <template #actions>
7
18
  <v-row no-gutters>
8
- <v-btn v-if="canAddVisitor" class="text-none" rounded="pill" variant="tonal" size="large"
9
- @click="handleAddNew" text="Add Visitor" />
10
- <v-btn v-if="canScanVisitorQRCode" text="Scan QR Code" class="text-none ml-2" rounded="pill" variant="tonal"
11
- size="large" @click="dialog.scanVisitorQRCode = true" />
19
+ <v-btn
20
+ v-if="canAddVisitor"
21
+ class="text-none"
22
+ rounded="pill"
23
+ variant="tonal"
24
+ size="large"
25
+ @click="handleAddNew"
26
+ text="Add Visitor"
27
+ />
28
+ <v-btn
29
+ v-if="canScanVisitorQRCode"
30
+ text="Scan QR Code"
31
+ class="text-none ml-2"
32
+ rounded="pill"
33
+ variant="tonal"
34
+ size="large"
35
+ @click="dialog.scanVisitorQRCode = true"
36
+ />
12
37
  <v-menu>
13
38
  <template #activator="{ props }">
14
- <v-btn v-bind="props" text="Download Report" class="text-none ml-2" prepend-icon="mdi-download"
15
- rounded="pill" variant="tonal" size="large" />
39
+ <v-btn
40
+ v-bind="props"
41
+ text="Download Report"
42
+ class="text-none ml-2"
43
+ prepend-icon="mdi-download"
44
+ rounded="pill"
45
+ variant="tonal"
46
+ size="large"
47
+ />
16
48
  </template>
17
49
  <v-list>
18
- <v-list-item prepend-icon="mdi-file-pdf" title="Download PDF Report" @click="handleDownloadPDFReport" />
19
- <v-list-item prepend-icon="mdi-file-csv" title="Download CSV Report" @click="handleDownloadCSVReport" />
50
+ <v-list-item
51
+ prepend-icon="mdi-file-pdf"
52
+ title="Download PDF Report"
53
+ @click="handleDownloadPDFReport"
54
+ />
55
+ <v-list-item
56
+ prepend-icon="mdi-file-csv"
57
+ title="Download CSV Report"
58
+ @click="handleDownloadCSVReport"
59
+ />
20
60
  </v-list>
21
61
  </v-menu>
22
62
  </v-row>
23
63
  </template>
24
64
  <template #extension>
25
65
  <v-row no-gutters class="w-100 d-flex flex-column">
26
- <v-tabs v-model="activeTab" color="primary" :height="40" @update:model-value="toRoute" class="w-100">
27
- <v-tab v-for="tab in tabOptions" :value="tab.value" :key="tab.value" class="text-capitalize">
66
+ <v-tabs
67
+ v-model="activeTab"
68
+ color="primary"
69
+ :height="40"
70
+ @update:model-value="toRoute"
71
+ class="w-100"
72
+ >
73
+ <v-tab
74
+ v-for="tab in tabOptions"
75
+ :value="tab.value"
76
+ :key="tab.value"
77
+ class="text-capitalize"
78
+ >
28
79
  {{ tab.name }}
29
80
  </v-tab>
30
81
  </v-tabs>
31
82
 
32
- <v-card class="w-100 px-3 d-flex align-center ga-5 py-2" flat :height="60">
33
- <v-text-field v-model="searchInput" density="compact" placeholder="Search" clearable max-width="300"
34
- append-inner-icon="mdi-magnify" hide-details />
35
- <v-checkbox v-model="displayNotCheckedOut" class="text-subtitle-2" hide-details>
83
+ <v-card
84
+ class="w-100 px-3 d-flex align-center ga-5 py-2"
85
+ flat
86
+ :height="60"
87
+ >
88
+ <v-text-field
89
+ v-model="searchInput"
90
+ density="compact"
91
+ placeholder="Search"
92
+ clearable
93
+ max-width="300"
94
+ append-inner-icon="mdi-magnify"
95
+ hide-details
96
+ />
97
+ <v-checkbox
98
+ v-model="displayNotCheckedOut"
99
+ class="text-subtitle-2"
100
+ hide-details
101
+ >
36
102
  <template #label>
37
103
  <span class="text-caption">Not Checked Out</span>
38
104
  </template>
39
105
  </v-checkbox>
40
- <InputDatePicker v-model="dateFrom" density="compact" hide-details />
106
+ <InputDatePicker
107
+ v-model="dateFrom"
108
+ density="compact"
109
+ hide-details
110
+ />
41
111
  <InputDatePicker v-model="dateTo" density="compact" hide-details />
42
- <v-select v-if="activeTab == 'registered'" v-model="filterTypes" label="Filter by types" item-title="label"
43
- item-value="value" :items="visitorSelection" density="compact" clearable multiple max-width="200"
44
- hide-details>
112
+ <v-select
113
+ v-if="activeTab == 'registered'"
114
+ v-model="filterTypes"
115
+ label="Filter by types"
116
+ item-title="label"
117
+ item-value="value"
118
+ :items="visitorSelection"
119
+ density="compact"
120
+ clearable
121
+ multiple
122
+ max-width="200"
123
+ hide-details
124
+ >
45
125
  <template v-slot:selection="{ item, index }">
46
126
  <div class="d-flex align-center text-caption text-nowrap">
47
- <v-chip v-if="index === 0" color="error" :text="filterTypeSelectionLabel()" size="x-small"
48
- variant="tonal" class="ml-2" />
127
+ <v-chip
128
+ v-if="index === 0"
129
+ color="error"
130
+ :text="filterTypeSelectionLabel()"
131
+ size="x-small"
132
+ variant="tonal"
133
+ class="ml-2"
134
+ />
49
135
  </div>
50
136
  </template>
51
137
  </v-select>
@@ -60,8 +146,9 @@
60
146
  </span>
61
147
  <span class="text-capitalize">{{ item?.name }}</span>
62
148
  </span>
63
- <span class="text-grey text-caption" v-if="item?.members?.length > 0">( +{{ item?.members?.length }}
64
- members)</span>
149
+ <span class="text-grey text-caption" v-if="item?.members?.length > 0"
150
+ >( +{{ item?.members?.length }} members)</span
151
+ >
65
152
  </template>
66
153
 
67
154
  <template v-slot:item.email="{ value }">
@@ -70,7 +157,12 @@
70
157
 
71
158
  <template v-slot:item.invited-by="{ item }">
72
159
  <span class="d-flex align-center ga-2">
73
- <AvatarMain v-if="item?.inviterName" :name="item?.inviterName" :size="20" :id="item?._id" />
160
+ <AvatarMain
161
+ v-if="item?.inviterName"
162
+ :name="item?.inviterName"
163
+ :size="20"
164
+ :id="item?._id"
165
+ />
74
166
  <span class="text-capitalize">{{ item?.inviterName ?? "N/A" }}</span>
75
167
  </span>
76
168
  </template>
@@ -80,7 +172,7 @@
80
172
  <v-icon icon="mdi-user" size="15" />
81
173
  <span v-if="item.type === 'contractor'" class="text-capitalize">{{
82
174
  formatCamelCaseToWords(item.contractorType)
83
- }}</span>
175
+ }}</span>
84
176
  <span v-else class="text-capitalize">{{ formatType(item) }}</span>
85
177
  </span>
86
178
  <span class="d-flex align-center ga-2">
@@ -116,26 +208,52 @@
116
208
  <template v-slot:item.checkin-out="{ item }">
117
209
  <v-row no-gutters class="d-flex flex-column py-2">
118
210
  <span class="d-flex align-center ga-2">
119
- <v-icon icon="mdi-clock-time-four-outline" color="green" size="20" />
211
+ <v-icon
212
+ icon="mdi-clock-time-four-outline"
213
+ color="green"
214
+ size="20"
215
+ />
120
216
  <span class="text-capitalize">{{
121
217
  UTCToLocalTIme(item.checkIn) || "-"
122
- }}</span>
218
+ }}</span>
123
219
  <span>
124
- <v-icon v-if="item?.snapshotEntryImage" size="17" icon="mdi-image"
125
- @click.stop="handleViewImage(item.snapshotEntryImage)" />
220
+ <v-icon
221
+ v-if="item?.snapshotEntryImage"
222
+ size="17"
223
+ icon="mdi-image"
224
+ @click.stop="handleViewImage(item.snapshotEntryImage)"
225
+ />
126
226
  </span>
127
227
  </span>
128
228
 
129
- <span v-if="
130
- !item.checkOut &&
131
- (item?.status === 'registered' ||
132
- item?.status === 'unregistered') &&
133
- canCheckoutVisitor
134
- ">
135
- <span class="d-flex align-center ga-2" v-bind="menuProps" style="cursor: pointer">
136
- <v-icon icon="mdi-clock-time-eight-outline" color="red" size="20" />
137
- <v-btn size="x-small" class="text-capitalize" color="red" text="Checkout" :loading="loading.checkingOut && item?._id === selectedVisitorId
138
- " @click.stop="handleCheckout(item._id)" />
229
+ <span
230
+ v-if="
231
+ !item.checkOut &&
232
+ (item?.status === 'registered' ||
233
+ item?.status === 'unregistered') &&
234
+ canCheckoutVisitor
235
+ "
236
+ >
237
+ <span
238
+ class="d-flex align-center ga-2"
239
+ v-bind="menuProps"
240
+ style="cursor: pointer"
241
+ >
242
+ <v-icon
243
+ icon="mdi-clock-time-eight-outline"
244
+ color="red"
245
+ size="20"
246
+ />
247
+ <v-btn
248
+ size="x-small"
249
+ class="text-capitalize"
250
+ color="red"
251
+ text="Checkout"
252
+ :loading="
253
+ loading.checkingOut && item?._id === selectedVisitorId
254
+ "
255
+ @click.stop="handleCheckout(item._id)"
256
+ />
139
257
  </span>
140
258
  </span>
141
259
  <span v-else class="d-flex align-center ga-2">
@@ -143,50 +261,96 @@
143
261
  <template v-if="item.checkOut">
144
262
  <span class="text-capitalize">{{
145
263
  UTCToLocalTIme(item.checkOut)
146
- }}</span>
264
+ }}</span>
147
265
  <span>
148
- <v-icon v-if="item?.snapshotExitImage" size="17" icon="mdi-image"
149
- @click.stop="handleViewImage(item.snapshotExitImage)" />
266
+ <v-icon
267
+ v-if="item?.snapshotExitImage"
268
+ size="17"
269
+ icon="mdi-image"
270
+ @click.stop="handleViewImage(item.snapshotExitImage)"
271
+ />
150
272
  </span>
151
273
  <span v-if="item?.manualCheckout">
152
- <TooltipInfo text="Manual Checkout" density="compact" size="x-small" />
274
+ <TooltipInfo
275
+ text="Manual Checkout"
276
+ density="compact"
277
+ size="x-small"
278
+ />
153
279
  </span>
154
280
  </template>
155
281
  <template v-else> <span class="mt-1"> N/A </span> </template>
156
282
  </span>
157
283
 
158
- <div v-if="showAddPassKeyButton(item)" class="d-flex flex-wrap ga-1 mt-1" v-bind="menuProps"
159
- style="cursor: pointer">
160
- <v-chip size="x-small" variant="tonal" prepend-icon="mdi-key" @click.stop="handleOpenAddPassKey(item)">Add
161
- Pass/Key</v-chip>
284
+ <div
285
+ v-if="showAddPassKeyButton(item)"
286
+ class="d-flex flex-wrap ga-1 mt-1"
287
+ v-bind="menuProps"
288
+ style="cursor: pointer"
289
+ >
290
+ <v-chip
291
+ size="x-small"
292
+ variant="tonal"
293
+ prepend-icon="mdi-key"
294
+ @click.stop="handleOpenAddPassKey(item)"
295
+ >Add Pass/Key</v-chip
296
+ >
162
297
  </div>
163
298
 
164
299
  <v-menu :close-on-content-click="true">
165
300
  <template v-slot:activator="{ props: menuProps }">
166
- <div v-if="
167
- (item.visitorPass?.length ?? 0) > 0 ||
168
- (item.passKeys?.length ?? 0) > 0
169
- " class="d-flex flex-wrap ga-1 mt-1" v-bind="menuProps" style="cursor: pointer">
170
- <v-chip v-for="pass in item.visitorPass" :key="(pass as any)._id ?? (pass as any).keyId"
171
- prepend-icon="mdi-card-bulleted-outline" size="x-small" variant="tonal" color="blue">
301
+ <div
302
+ v-if="
303
+ (item.visitorPass?.length ?? 0) > 0 ||
304
+ (item.passKeys?.length ?? 0) > 0
305
+ "
306
+ class="d-flex flex-wrap ga-1 mt-1"
307
+ v-bind="menuProps"
308
+ style="cursor: pointer"
309
+ >
310
+ <v-chip
311
+ v-for="pass in item.visitorPass"
312
+ :key="(pass as any)._id ?? (pass as any).keyId"
313
+ prepend-icon="mdi-card-bulleted-outline"
314
+ size="x-small"
315
+ variant="tonal"
316
+ color="blue"
317
+ >
172
318
  {{ (pass as any)?.prefixAndName }}
173
319
  </v-chip>
174
- <v-chip v-for="key in item.passKeys" :key="(key as any)._id ?? (key as any).keyId"
175
- prepend-icon="mdi-key" size="x-small" variant="tonal" color="orange">
320
+ <v-chip
321
+ v-for="key in item.passKeys"
322
+ :key="(key as any)._id ?? (key as any).keyId"
323
+ prepend-icon="mdi-key"
324
+ size="x-small"
325
+ variant="tonal"
326
+ color="orange"
327
+ >
176
328
  {{ (key as any)?.prefixAndName }}
177
329
  </v-chip>
178
330
  </div>
179
331
  </template>
180
332
  <v-list density="compact">
181
- <v-list-item v-if="!item?.checkOut" prepend-icon="mdi-logout" title="Checkout"
182
- @click.stop="handleCheckout(item._id)" />
183
- <v-list-item v-if="
184
- (item.visitorPass?.length ?? 0) > 0 ||
185
- (item.passKeys?.length ?? 0) > 0
186
- " prepend-icon="mdi-card-bulleted-outline" :title="item.checkOut ? 'View Pass/Key' : 'Edit Pass/Key'"
187
- @click.stop="handleOpenEditPassKey(item)" />
188
- <v-list-item v-if="showAddPassKeyButton(item)" prepend-icon="mdi-plus" title="Add Pass/Key"
189
- @click.stop="handleOpenAddPassKey(item)" />
333
+ <v-list-item
334
+ v-if="!item?.checkOut"
335
+ prepend-icon="mdi-logout"
336
+ title="Checkout"
337
+ @click.stop="handleCheckout(item._id)"
338
+ />
339
+ <v-list-item
340
+ v-if="
341
+ (item.visitorPass?.length ?? 0) > 0 ||
342
+ (item.passKeys?.length ?? 0) > 0
343
+ "
344
+ prepend-icon="mdi-card-bulleted-outline"
345
+ :title="item.checkOut ? 'View Pass/Key' : 'Edit Pass/Key'"
346
+ @click.stop="handleOpenEditPassKey(item)"
347
+ />
348
+ <v-list-item
349
+ v-if="showAddPassKeyButton(item)"
350
+ prepend-icon="mdi-plus"
351
+ title="Add Pass/Key"
352
+ @click.stop="handleOpenAddPassKey(item)"
353
+ />
190
354
  </v-list>
191
355
  </v-menu>
192
356
  </v-row>
@@ -205,27 +369,44 @@
205
369
 
206
370
  <span v-if="!item.checkIn && canUpdateVisitor">
207
371
  <span class="d-flex align-center ga-2 cursor-pointer">
208
- <v-icon icon="mdi-clock-time-eight-outline" color="success" size="20" />
209
- <v-btn size="x-small" class="text-capitalize" color="success" text="Checkin"
210
- @click.stop="handleCheckin(item)" />
372
+ <v-icon
373
+ icon="mdi-clock-time-eight-outline"
374
+ color="success"
375
+ size="20"
376
+ />
377
+ <v-btn
378
+ size="x-small"
379
+ class="text-capitalize"
380
+ color="success"
381
+ text="Checkin"
382
+ @click.stop="handleCheckin(item)"
383
+ />
211
384
  </span>
212
385
  </span>
213
386
  </v-row>
214
387
  </template>
215
388
 
216
389
  <template v-slot:item.status="{ item }">
217
- <v-card v-if="item?.overnightParking?.status" size="small"
390
+ <v-card
391
+ v-if="item?.overnightParking?.status"
392
+ size="small"
218
393
  class="rounded-xl text-capitalize text-center elevation-0 py-1 px-2"
219
394
  :color="getOvernightParkingRequestStatusColor(item?.overnightParking?.status as string)"
220
- style="max-width: 150px; margin: auto">
395
+ style="max-width: 150px; margin: auto"
396
+ >
221
397
  {{ item?.overnightParking?.status }}
222
398
  </v-card>
223
399
  <span v-else> N/A </span>
224
400
  </template>
225
401
 
226
402
  <template v-slot:item.action="{ item }">
227
- <v-btn v-if="activeTab === 'unregistered' && canAddVisitor" size="small" color="primary" text="Register"
228
- @click.stop="handleRegistrationUnregisteredVisitor(item)" />
403
+ <v-btn
404
+ v-if="activeTab === 'unregistered' && canAddVisitor"
405
+ size="small"
406
+ color="primary"
407
+ text="Register"
408
+ @click.stop="handleRegistrationUnregisteredVisitor(item)"
409
+ />
229
410
  <v-menu v-else-if="activeTab === 'overnight-parking'">
230
411
  <template #activator="{ props }">
231
412
  <v-avatar v-bind="props" class="rounded-xl border-md">
@@ -234,17 +415,20 @@
234
415
  </template>
235
416
 
236
417
  <v-card>
237
- <v-list-item v-if="
238
- !overNightParkingListActions[0].disabled ||
239
- !['approved', 'rejected'].includes(
240
- item?.overnightParking?.status
241
- )
242
- " @click.stop="
418
+ <v-list-item
419
+ v-if="
420
+ !overNightParkingListActions[0].disabled ||
421
+ !['approved', 'rejected'].includes(
422
+ item?.overnightParking?.status
423
+ )
424
+ "
425
+ @click.stop="
243
426
  openApproveRejectOverNightParkingRequestDialog(
244
427
  item,
245
428
  overNightParkingListActions[0].status
246
429
  )
247
- ">
430
+ "
431
+ >
248
432
  <template #title>
249
433
  <span class="text-caption">
250
434
  {{ overNightParkingListActions[0].text }}
@@ -252,30 +436,36 @@
252
436
  </template>
253
437
  </v-list-item>
254
438
  <v-divider />
255
- <v-list-item v-if="
256
- !overNightParkingListActions[1].disabled ||
257
- !['approved', 'rejected'].includes(
258
- item?.overnightParking?.status
259
- )
260
- " @click="
439
+ <v-list-item
440
+ v-if="
441
+ !overNightParkingListActions[1].disabled ||
442
+ !['approved', 'rejected'].includes(
443
+ item?.overnightParking?.status
444
+ )
445
+ "
446
+ @click="
261
447
  openApproveRejectOverNightParkingRequestDialog(
262
448
  item,
263
449
  overNightParkingListActions[1].status
264
450
  )
265
- ">
451
+ "
452
+ >
266
453
  <template #title>
267
454
  <span class="text-caption">
268
455
  {{ overNightParkingListActions[1].text }}
269
456
  </span>
270
457
  </template>
271
458
  </v-list-item>
272
- <v-list-item v-if="item?.overnightParking?.remarks" @click="
273
- openApproveRejectOverNightParkingRequestDialog(
274
- item,
275
- overNightParkingListActions[2].status,
276
- item?.overnightParking?.remarks
277
- )
278
- ">
459
+ <v-list-item
460
+ v-if="item?.overnightParking?.remarks"
461
+ @click="
462
+ openApproveRejectOverNightParkingRequestDialog(
463
+ item,
464
+ overNightParkingListActions[2].status,
465
+ item?.overnightParking?.remarks
466
+ )
467
+ "
468
+ >
279
469
  <template #title>
280
470
  <span class="text-caption">
281
471
  {{ overNightParkingListActions[2].text }}
@@ -289,75 +479,147 @@
289
479
 
290
480
  <template v-slot:item.checkInRemarks="{ item }">
291
481
  <span>
292
- <v-btn variant="text" color="blue-darken-2" density="compact" size="small"
293
- @click.stop="handleOpenRemarks(item, 'checkIn')">{{ item.checkInRemarks ? "View Remarks" : "Add Remarks"
294
- }}</v-btn>
482
+ <v-btn
483
+ variant="text"
484
+ color="blue-darken-2"
485
+ density="compact"
486
+ size="small"
487
+ @click.stop="handleOpenRemarks(item, 'checkIn')"
488
+ >{{ item.checkInRemarks ? "View Remarks" : "Add Remarks" }}</v-btn
489
+ >
295
490
  </span>
296
491
  </template>
297
492
  <template v-slot:item.checkOutRemarks="{ item }">
298
493
  <span>
299
- <v-btn variant="text" color="blue-darken-2" density="compact" size="small"
300
- @click.stop="handleOpenRemarks(item, 'checkOut')">{{ item.checkOutRemarks ? "View Remarks" : "Add Remarks"
301
- }}</v-btn>
494
+ <v-btn
495
+ variant="text"
496
+ color="blue-darken-2"
497
+ density="compact"
498
+ size="small"
499
+ @click.stop="handleOpenRemarks(item, 'checkOut')"
500
+ >{{ item.checkOutRemarks ? "View Remarks" : "Add Remarks" }}</v-btn
501
+ >
302
502
  </span>
303
503
  </template>
304
504
  </TableMain>
305
505
 
306
506
  <v-dialog v-model="dialog.showSelection" width="450" persistent>
307
- <VisitorFormSelection :mode="mode" @cancel="dialog.showSelection = false" @select="handleSelectVisitorType" />
507
+ <VisitorFormSelection
508
+ :mode="mode"
509
+ @cancel="dialog.showSelection = false"
510
+ @select="handleSelectVisitorType"
511
+ />
308
512
  </v-dialog>
309
513
 
310
- <v-dialog v-model="dialog.showForm" v-if="activeVisitorFormType" width="450" persistent>
311
- <VisitorForm :mode="mode" :org="orgId" :site="siteId" :visitor-data="selectedVisitorDataObject"
312
- :type="activeVisitorFormType" @back="handleClickBack" @done="handleVisitorFormDone"
313
- @done:more="handleVisitorFormCreateMore" @close:all="handleCloseAll" />
514
+ <v-dialog
515
+ v-model="dialog.showForm"
516
+ v-if="activeVisitorFormType"
517
+ width="450"
518
+ persistent
519
+ >
520
+ <VisitorForm
521
+ :mode="mode"
522
+ :org="orgId"
523
+ :site="siteId"
524
+ :visitor-data="selectedVisitorDataObject"
525
+ :current-user="currentUser._id"
526
+ :type="activeVisitorFormType"
527
+ @back="handleClickBack"
528
+ @done="handleVisitorFormDone"
529
+ @done:more="handleVisitorFormCreateMore"
530
+ @close:all="handleCloseAll"
531
+ />
314
532
  </v-dialog>
315
533
 
316
534
  <v-dialog v-model="dialog.viewVisitor" width="450" persistent>
317
- <VehicleUpdateMoreAction title="Preview" :can-update="false" :can-delete="false"
318
- @close="dialog.viewVisitor = false" edit-button-label="Edit Visitor">
535
+ <VehicleUpdateMoreAction
536
+ title="Preview"
537
+ :can-update="false"
538
+ :can-delete="false"
539
+ @close="dialog.viewVisitor = false"
540
+ edit-button-label="Edit Visitor"
541
+ >
319
542
  <template v-slot:content>
320
543
  <v-row no-gutters class="mb-4">
321
544
  <v-col v-for="(label, key) in formattedFields" :key="key" cols="12">
322
- <span v-if="
323
- key === 'checkIn' &&
324
- !selectedVisitorObject[key] &&
325
- canUpdateVisitor
326
- " class="d-flex align-center">
545
+ <span
546
+ v-if="
547
+ key === 'checkIn' &&
548
+ !selectedVisitorObject[key] &&
549
+ canUpdateVisitor
550
+ "
551
+ class="d-flex align-center"
552
+ >
327
553
  <strong>{{ label }}:</strong>
328
- <v-btn size="x-small" class="ml-3 text-capitalize" color="success" text="Checkin"
329
- :disabled="isVisitorDataFromScannedQRCodeCheckingInOut" @click="handleCheckin(selectedVisitorObject)"
330
- :loading="isVisitorDataFromScannedQRCodeCheckingInOut" />
554
+ <v-btn
555
+ size="x-small"
556
+ class="ml-3 text-capitalize"
557
+ color="success"
558
+ text="Checkin"
559
+ :disabled="isVisitorDataFromScannedQRCodeCheckingInOut"
560
+ @click="handleCheckin(selectedVisitorObject)"
561
+ :loading="isVisitorDataFromScannedQRCodeCheckingInOut"
562
+ />
331
563
  </span>
332
- <span v-if="
333
- key === 'checkOut' &&
334
- selectedVisitorObject['checkIn'] &&
335
- !selectedVisitorObject[key] &&
336
- canCheckoutVisitor
337
- " class="d-flex align-center">
564
+ <span
565
+ v-if="
566
+ key === 'checkOut' &&
567
+ selectedVisitorObject['checkIn'] &&
568
+ !selectedVisitorObject[key] &&
569
+ canCheckoutVisitor
570
+ "
571
+ class="d-flex align-center"
572
+ >
338
573
  <strong>{{ label }}:</strong>
339
- <v-btn size="x-small" class="ml-3 text-capitalize" color="red" text="Checkout"
340
- :disabled="loading.checkingOut" @click="handleCheckout(selectedVisitorId as string)" />
574
+ <v-btn
575
+ size="x-small"
576
+ class="ml-3 text-capitalize"
577
+ color="red"
578
+ text="Checkout"
579
+ :disabled="loading.checkingOut"
580
+ @click="handleCheckout(selectedVisitorId as string)"
581
+ />
341
582
  </span>
342
583
 
343
- <span v-else-if="
344
- key === 'nric' && selectedVisitorObject['nric']" class="d-flex align-center">
584
+ <span
585
+ v-else-if="key === 'nric' && selectedVisitorObject['nric']"
586
+ class="d-flex align-center"
587
+ >
345
588
  <strong>{{ label }}:</strong>
346
- <span class="ml-2">{{ maskNRIC(selectedVisitorObject[key]) }}</span>
589
+ <span v-tooltip:top="selectedVisitorObject[key]" class="ml-2">{{
590
+ maskNRIC(selectedVisitorObject[key])
591
+ }}</span>
347
592
  </span>
348
- <span v-else-if="key === 'attachments' && selectedVisitorObject?.[key]?.length > 0"
349
- class="d-flex flex-column">
593
+ <span
594
+ v-else-if="
595
+ key === 'attachments' &&
596
+ selectedVisitorObject?.[key]?.length > 0
597
+ "
598
+ class="d-flex flex-column"
599
+ >
350
600
  <strong class="w-full">{{ label }}:</strong>
351
601
  <div class="d-flex flex-wrap ga-2">
352
- <AttachmentsViewer :files="mappedAttachments(selectedVisitorObject.attachments)" title=""
353
- show-file-type-title />
602
+ <AttachmentsViewer
603
+ :files="
604
+ mappedAttachments(selectedVisitorObject.attachments)
605
+ "
606
+ title=""
607
+ show-file-type-title
608
+ />
354
609
  </div>
355
610
  </span>
356
611
 
357
- <span v-else-if="selectedVisitorObject[key]" class="d-flex ga-3 align-start"><strong>{{ label
358
- }}:</strong>
612
+ <span
613
+ v-else-if="selectedVisitorObject[key]"
614
+ class="d-flex ga-3 align-start"
615
+ ><strong>{{ label }}:</strong>
359
616
  {{ formatValues(key, selectedVisitorObject[key]) }}
360
- <TooltipInfo v-if="key === 'checkOut'" text="Manual Checkout" density="compact" size="x-small" />
617
+ <TooltipInfo
618
+ v-if="key === 'checkOut'"
619
+ text="Manual Checkout"
620
+ density="compact"
621
+ size="x-small"
622
+ />
361
623
  </span>
362
624
  </v-col>
363
625
  </v-row>
@@ -369,7 +631,11 @@
369
631
  <v-card>
370
632
  <v-card-title class="d-flex justify-space-between align-center">
371
633
  <span>Snapshot</span>
372
- <v-btn icon="mdi-close" variant="text" @click="dialog.snapshotImage = false" />
634
+ <v-btn
635
+ icon="mdi-close"
636
+ variant="text"
637
+ @click="dialog.snapshotImage = false"
638
+ />
373
639
  </v-card-title>
374
640
  <v-card-text class="pa-2 d-flex justify-center">
375
641
  <v-img :src="snapshotImageUrl" max-height="600" contain />
@@ -379,25 +645,51 @@
379
645
 
380
646
  <v-dialog v-model="dialog.remarks" max-width="450" persistent>
381
647
  <v-card>
382
- <v-card-title class="d-flex justify-space-between align-center pt-4 px-4">
648
+ <v-card-title
649
+ class="d-flex justify-space-between align-center pt-4 px-4"
650
+ >
383
651
  <span>{{
384
652
  remarksType === "checkIn" ? "Check-In Remarks" : "Check-Out Remarks"
385
- }}</span>
386
- <v-btn icon="mdi-close" variant="text" @click="dialog.remarks = false" />
653
+ }}</span>
654
+ <v-btn
655
+ icon="mdi-close"
656
+ variant="text"
657
+ @click="dialog.remarks = false"
658
+ />
387
659
  </v-card-title>
388
660
  <v-card-text class="px-4 pb-2">
389
- <v-textarea v-model="remarksInput" label="Remarks" rows="4" auto-grow variant="outlined"
390
- :readonly="remarksViewOnly" />
661
+ <v-textarea
662
+ v-model="remarksInput"
663
+ label="Remarks"
664
+ rows="4"
665
+ auto-grow
666
+ variant="outlined"
667
+ :readonly="remarksViewOnly"
668
+ />
391
669
  </v-card-text>
392
670
  <v-toolbar class="pa-0" density="compact">
393
671
  <v-row no-gutters>
394
672
  <v-col cols="6">
395
- <v-btn variant="text" block :disabled="loading.savingRemarks"
396
- @click="dialog.remarks = false">Cancel</v-btn>
673
+ <v-btn
674
+ variant="text"
675
+ block
676
+ :disabled="loading.savingRemarks"
677
+ @click="dialog.remarks = false"
678
+ >Cancel</v-btn
679
+ >
397
680
  </v-col>
398
681
  <v-col cols="6">
399
- <v-btn color="primary" variant="flat" height="48" rounded="0" block :loading="loading.savingRemarks"
400
- :disabled="!remarksInput.trim()" @click="handleSaveRemarks">Save</v-btn>
682
+ <v-btn
683
+ color="primary"
684
+ variant="flat"
685
+ height="48"
686
+ rounded="0"
687
+ block
688
+ :loading="loading.savingRemarks"
689
+ :disabled="!remarksInput.trim()"
690
+ @click="handleSaveRemarks"
691
+ >Save</v-btn
692
+ >
401
693
  </v-col>
402
694
  </v-row>
403
695
  </v-toolbar>
@@ -407,9 +699,16 @@
407
699
  <v-dialog v-model="dialog.returnPassesKeys" max-width="450" persistent>
408
700
  <v-card>
409
701
  <v-toolbar density="compact" color="">
410
- <v-row no-gutters class="d-flex fill-height justify-space-between align-center px-4">
702
+ <v-row
703
+ no-gutters
704
+ class="d-flex fill-height justify-space-between align-center px-4"
705
+ >
411
706
  <span class="font-weight-bold">Return Passes &amp; Keys</span>
412
- <v-btn icon="mdi-close" variant="text" @click="dialog.returnPassesKeys = false" />
707
+ <v-btn
708
+ icon="mdi-close"
709
+ variant="text"
710
+ @click="dialog.returnPassesKeys = false"
711
+ />
413
712
  </v-row>
414
713
  </v-toolbar>
415
714
  <v-card-text class="px-4 pb-2">
@@ -419,55 +718,134 @@
419
718
 
420
719
  <div>
421
720
  <InputLabel class="text-capitalize" title="Full Name" />
422
- <v-text-field v-model="selectedVisitorObject.name" density="comfortable" readonly />
721
+ <v-text-field
722
+ v-model="selectedVisitorObject.name"
723
+ density="comfortable"
724
+ readonly
725
+ />
423
726
  </div>
424
727
 
425
728
  <div>
426
729
  <InputLabel class="text-capitalize" title="Location" />
427
- <v-text-field v-model="selectedVisitorObject.location" density="comfortable" readonly />
730
+ <v-text-field
731
+ v-model="selectedVisitorObject.location"
732
+ density="comfortable"
733
+ readonly
734
+ />
428
735
  </div>
429
736
 
430
737
  <div v-if="passReturnStatuses.length > 0" class="mb-2">
431
738
  <p class="text-caption text-medium-emphasis mb-1">Passes</p>
432
- <v-row no-gutters v-for="pass in passReturnStatuses" :key="(pass as any)._id ?? (pass as any).keyId"
433
- class="d-flex flex-wrap justify-space-between align-center ga-5 mb-2">
434
- <v-chip prepend-icon="mdi-card-bulleted-outline" size="small" variant="tonal" color="blue">
739
+ <v-row
740
+ no-gutters
741
+ v-for="pass in passReturnStatuses"
742
+ :key="(pass as any)._id ?? (pass as any).keyId"
743
+ class="d-flex flex-wrap justify-space-between align-center ga-5 mb-2"
744
+ >
745
+ <v-chip
746
+ prepend-icon="mdi-card-bulleted-outline"
747
+ size="small"
748
+ variant="tonal"
749
+ color="blue"
750
+ >
435
751
  {{ (pass as any)?.prefixAndName }}
436
752
  </v-chip>
437
- <v-select hide-details max-width="200px" density="compact" :items="passStatusOptions" item-title="label"
438
- item-value="value" v-model="pass.status" :disabled="selectedVisitorObject.checkOut"></v-select>
439
- <v-textarea v-if="pass.status === 'Lost' || pass.status === 'Damaged'" no-resize rows="3" class="w-100"
440
- density="compact" v-model="pass.remarks" :disabled="selectedVisitorObject.checkOut"></v-textarea>
753
+ <v-select
754
+ hide-details
755
+ max-width="200px"
756
+ density="compact"
757
+ :items="passStatusOptions"
758
+ item-title="label"
759
+ item-value="value"
760
+ v-model="pass.status"
761
+ :disabled="selectedVisitorObject.checkOut"
762
+ ></v-select>
763
+ <v-textarea
764
+ v-if="pass.status === 'Lost' || pass.status === 'Damaged'"
765
+ no-resize
766
+ rows="3"
767
+ class="w-100"
768
+ density="compact"
769
+ v-model="pass.remarks"
770
+ :disabled="selectedVisitorObject.checkOut"
771
+ ></v-textarea>
441
772
  </v-row>
442
773
  </div>
443
774
  <div v-if="keyReturnStatuses.length > 0" class="mb-2">
444
775
  <p class="text-caption text-medium-emphasis mb-1">Keys</p>
445
- <v-row no-gutters v-for="key in keyReturnStatuses" :key="(key as any)._id ?? (key as any).keyId"
446
- class="d-flex flex-wrap justify-space-between align-center ga-5 mb-2">
447
- <v-chip prepend-icon="mdi-key" size="small" variant="tonal" color="orange">
776
+ <v-row
777
+ no-gutters
778
+ v-for="key in keyReturnStatuses"
779
+ :key="(key as any)._id ?? (key as any).keyId"
780
+ class="d-flex flex-wrap justify-space-between align-center ga-5 mb-2"
781
+ >
782
+ <v-chip
783
+ prepend-icon="mdi-key"
784
+ size="small"
785
+ variant="tonal"
786
+ color="orange"
787
+ >
448
788
  {{ (key as any)?.prefixAndName }}
449
789
  </v-chip>
450
- <v-select hide-details max-width="200px" density="compact" :items="passStatusOptions" item-title="label"
451
- item-value="value" v-model="key.status" :disabled="selectedVisitorObject.checkOut"></v-select>
452
- <v-textarea v-if="key.status === 'Lost' || key.status === 'Damaged'" no-resize rows="3" class="w-100"
453
- density="compact" v-model="key.remarks" :disabled="selectedVisitorObject.checkOut"></v-textarea>
790
+ <v-select
791
+ hide-details
792
+ max-width="200px"
793
+ density="compact"
794
+ :items="passStatusOptions"
795
+ item-title="label"
796
+ item-value="value"
797
+ v-model="key.status"
798
+ :disabled="selectedVisitorObject.checkOut"
799
+ ></v-select>
800
+ <v-textarea
801
+ v-if="key.status === 'Lost' || key.status === 'Damaged'"
802
+ no-resize
803
+ rows="3"
804
+ class="w-100"
805
+ density="compact"
806
+ v-model="key.remarks"
807
+ :disabled="selectedVisitorObject.checkOut"
808
+ ></v-textarea>
454
809
  </v-row>
455
810
  </div>
456
811
 
457
812
  <v-row no-gutters class="my-5">
458
- <v-btn variant="flat" color="blue" density="comfortable" class="text-capitalize"
459
- :disabled="selectedVisitorObject.checkOut" :loading="loading.updatingPassKeys"
460
- @click.stop="handleUpdatePassKeys">Update Pass/Keys</v-btn>
813
+ <v-btn
814
+ variant="flat"
815
+ color="blue"
816
+ density="comfortable"
817
+ class="text-capitalize"
818
+ :disabled="selectedVisitorObject.checkOut"
819
+ :loading="loading.updatingPassKeys"
820
+ @click.stop="handleUpdatePassKeys"
821
+ >Update Pass/Keys</v-btn
822
+ >
461
823
  </v-row>
462
824
  </v-card-text>
463
825
  <v-toolbar class="pa-0" density="compact">
464
826
  <v-row no-gutters>
465
827
  <v-col cols="6">
466
- <v-btn variant="text" block @click="dialog.returnPassesKeys = false">Close</v-btn>
828
+ <v-btn
829
+ variant="text"
830
+ block
831
+ @click="dialog.returnPassesKeys = false"
832
+ >Close</v-btn
833
+ >
467
834
  </v-col>
468
835
  <v-col cols="6">
469
- <v-btn color="red" variant="flat" height="48" rounded="0" block :loading="loading.checkingOut" :disabled="!canConfirmCheckout || selectedVisitorObject.checkOut
470
- " @click="proceedCheckout">Confirm Checkout</v-btn>
836
+ <v-btn
837
+ color="red"
838
+ variant="flat"
839
+ height="48"
840
+ rounded="0"
841
+ block
842
+ :loading="loading.checkingOut"
843
+ :disabled="
844
+ !canConfirmCheckout || selectedVisitorObject.checkOut
845
+ "
846
+ @click="proceedCheckout"
847
+ >Confirm Checkout</v-btn
848
+ >
471
849
  </v-col>
472
850
  </v-row>
473
851
  </v-toolbar>
@@ -475,50 +853,87 @@
475
853
  </v-dialog>
476
854
 
477
855
  <v-dialog v-model="dialog.addPassKey" width="450" persistent>
478
- <AddPassKeyToVisitor mode="add" :visitor="selectedVisitorDataObject" :site="siteId"
479
- @close="dialog.addPassKey = false" @done="
856
+ <AddPassKeyToVisitor
857
+ mode="add"
858
+ :visitor="selectedVisitorDataObject"
859
+ :site="siteId"
860
+ @close="dialog.addPassKey = false"
861
+ @done="
480
862
  () => {
481
863
  dialog.addPassKey = false;
482
864
  getVisitorRefresh();
483
865
  }
484
- " />
866
+ "
867
+ />
485
868
  </v-dialog>
486
869
 
487
870
  <v-dialog v-model="dialog.editPassKey" width="450" persistent>
488
- <AddPassKeyToVisitor mode="edit" :visitor="selectedVisitorDataObject" :site="siteId"
489
- @close="dialog.editPassKey = false" @done="
871
+ <AddPassKeyToVisitor
872
+ mode="edit"
873
+ :visitor="selectedVisitorDataObject"
874
+ :site="siteId"
875
+ @close="dialog.editPassKey = false"
876
+ @done="
490
877
  () => {
491
878
  dialog.editPassKey = false;
492
879
  getVisitorRefresh();
493
880
  }
494
- " />
881
+ "
882
+ />
495
883
  </v-dialog>
496
884
 
497
- <ScanVisitorQRCode :dialog="dialog.scanVisitorQRCode" :site="siteId" @open-visitor-data-from-scanned-qr-code-dialog="
498
- handleShowVisitorDataFromScannedQRCodeDialog
499
- " @close-dialog="dialog.scanVisitorQRCode = false" />
500
-
501
- <v-dialog v-model="dialog.showVisitorDataFromScannedQRCode" width="450" persistent>
502
- <VisitorDataFromScannedQRCodeForm :site="siteId" :visitor-data="visitorDataFromScannedQRCode"
885
+ <ScanVisitorQRCode
886
+ :dialog="dialog.scanVisitorQRCode"
887
+ :site="siteId"
888
+ @open-visitor-data-from-scanned-qr-code-dialog="
889
+ handleShowVisitorDataFromScannedQRCodeDialog
890
+ "
891
+ @close-dialog="dialog.scanVisitorQRCode = false"
892
+ />
893
+
894
+ <v-dialog
895
+ v-model="dialog.showVisitorDataFromScannedQRCode"
896
+ width="450"
897
+ persistent
898
+ >
899
+ <VisitorDataFromScannedQRCodeForm
900
+ :site="siteId"
901
+ :visitor-data="visitorDataFromScannedQRCode"
503
902
  @check-in-out="handleVisitorDataFromScannedQRCodeCheckInOut"
504
903
  :processing="isVisitorDataFromScannedQRCodeCheckingInOut"
505
- @close="handleCloseVisitorDataFromScannedQRCodeDialog" />
904
+ @close="handleCloseVisitorDataFromScannedQRCodeDialog"
905
+ />
506
906
  </v-dialog>
507
907
 
508
- <v-dialog v-model="dialog.approveRejectOvernightParkingRequestDialog" transition="dialog-bottom-transition"
509
- persistent width="60vh">
908
+ <v-dialog
909
+ v-model="dialog.approveRejectOvernightParkingRequestDialog"
910
+ transition="dialog-bottom-transition"
911
+ persistent
912
+ width="60vh"
913
+ >
510
914
  <v-card>
511
915
  <v-toolbar density="compact">
512
- <v-row no-gutters class="d-flex fill-height justify-space-between align-center px-4">
916
+ <v-row
917
+ no-gutters
918
+ class="d-flex fill-height justify-space-between align-center px-4"
919
+ >
513
920
  <span class="font-weight-bold"> Overnight Parking Request </span>
514
- <v-btn icon="mdi-close" variant="text" @click="dialog.approveRejectOvernightParkingRequestDialog = false" />
921
+ <v-btn
922
+ icon="mdi-close"
923
+ variant="text"
924
+ @click="dialog.approveRejectOvernightParkingRequestDialog = false"
925
+ />
515
926
  </v-row>
516
927
  </v-toolbar>
517
928
  <v-card-text class="px-4 pb-6">
518
929
  <v-row no-gutters justify="center" align-content="center">
519
- <v-col v-if="
520
- approveRejectOvernightParkingRequestDialog.status !== 'remarks'
521
- " cols="12" class="text-h6 text-center">
930
+ <v-col
931
+ v-if="
932
+ approveRejectOvernightParkingRequestDialog.status !== 'remarks'
933
+ "
934
+ cols="12"
935
+ class="text-h6 text-center"
936
+ >
522
937
  {{
523
938
  `Are you sure you want to ${approveRejectOvernightParkingRequestDialog.text} the visitor's overnight
524
939
  parking
@@ -527,28 +942,58 @@
527
942
  </v-col>
528
943
 
529
944
  <v-col cols="12" md="8" class="mt-4">
530
- <v-textarea v-model="overNightParkingRequestApproveRejectRemarks" label="Remarks"
531
- placeholder="Enter remarks" outlined rows="3" clearable :hide-details="approveRejectOvernightParkingRequestDialog.status ===
945
+ <v-textarea
946
+ v-model="overNightParkingRequestApproveRejectRemarks"
947
+ label="Remarks"
948
+ placeholder="Enter remarks"
949
+ outlined
950
+ rows="3"
951
+ clearable
952
+ :hide-details="
953
+ approveRejectOvernightParkingRequestDialog.status ===
532
954
  'remarks'
533
- " :readonly="approveRejectOvernightParkingRequestDialog.status ===
955
+ "
956
+ :readonly="
957
+ approveRejectOvernightParkingRequestDialog.status ===
534
958
  'remarks'
535
- " />
959
+ "
960
+ />
536
961
  </v-col>
537
962
  </v-row>
538
963
  </v-card-text>
539
- <v-toolbar v-if="approveRejectOvernightParkingRequestDialog.status !== 'remarks'" class="pa-0"
540
- density="compact">
964
+ <v-toolbar
965
+ v-if="approveRejectOvernightParkingRequestDialog.status !== 'remarks'"
966
+ class="pa-0"
967
+ density="compact"
968
+ >
541
969
  <v-row no-gutters>
542
970
  <v-col cols="6">
543
- <v-btn text="No" color="grey-lighten-3" variant="flat" height="48" tile block
971
+ <v-btn
972
+ text="No"
973
+ color="grey-lighten-3"
974
+ variant="flat"
975
+ height="48"
976
+ tile
977
+ block
544
978
  :disabled="isApprovingRejectingOvernightParkingRequest"
545
- @click="closeApproveRejectOvernightParkingDialog" />
979
+ @click="closeApproveRejectOvernightParkingDialog"
980
+ />
546
981
  </v-col>
547
982
  <v-col cols="6">
548
- <v-btn text="Yes" color="success" variant="flat" height="48" tile block :disabled="!overNightParkingRequestApproveRejectRemarks ||
549
- isApprovingRejectingOvernightParkingRequest
550
- " @click="updateOvernightParkingRequestStatus"
551
- :loading="isApprovingRejectingOvernightParkingRequest" />
983
+ <v-btn
984
+ text="Yes"
985
+ color="success"
986
+ variant="flat"
987
+ height="48"
988
+ tile
989
+ block
990
+ :disabled="
991
+ !overNightParkingRequestApproveRejectRemarks ||
992
+ isApprovingRejectingOvernightParkingRequest
993
+ "
994
+ @click="updateOvernightParkingRequestStatus"
995
+ :loading="isApprovingRejectingOvernightParkingRequest"
996
+ />
552
997
  </v-col>
553
998
  </v-row>
554
999
  </v-toolbar>
@@ -819,8 +1264,8 @@ function mappedAttachments(attachments: string[]) {
819
1264
  return attachments.map((x, index) => {
820
1265
  return {
821
1266
  id: x,
822
- name: `Attachment ${index + 1}`
823
- }
1267
+ name: `Attachment ${index + 1}`,
1268
+ };
824
1269
  });
825
1270
  }
826
1271
 
@@ -1392,10 +1837,12 @@ async function handleDownloadPDFReport() {
1392
1837
  if (displayNotCheckedOut.value) queryParams.append("checkedOut", "true");
1393
1838
 
1394
1839
  const queryString = queryParams.toString();
1395
- const url = `/${route.params.org}/${siteId}/visitor-management/preview${queryString ? "?" + queryString : ""
1396
- }`;
1397
- const title = `Visitor-Report-${siteId}-${new Date().toISOString().split("T")[0]
1398
- }`;
1840
+ const url = `/${route.params.org}/${siteId}/visitor-management/preview${
1841
+ queryString ? "?" + queryString : ""
1842
+ }`;
1843
+ const title = `Visitor-Report-${siteId}-${
1844
+ new Date().toISOString().split("T")[0]
1845
+ }`;
1399
1846
 
1400
1847
  await downloadPDF({ url, title, orientation: "P", appKey: "SECURITY" });
1401
1848
  showMessage("PDF report downloaded successfully!", "success");