@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
|
@@ -10,21 +10,21 @@
|
|
|
10
10
|
v-model:page="page"
|
|
11
11
|
:pages="pages"
|
|
12
12
|
:pageRange="pageRange"
|
|
13
|
-
:no-data-text="`No
|
|
14
|
-
@refresh="
|
|
15
|
-
:canCreate="
|
|
16
|
-
createLabel="
|
|
13
|
+
:no-data-text="`No Equipment Items found for ${siteName}.`"
|
|
14
|
+
@refresh="getEquipmentItemsRefresh"
|
|
15
|
+
:canCreate="canCreateEquipmentItem"
|
|
16
|
+
createLabel="Equipment Item"
|
|
17
17
|
@row-click="handleRowClick"
|
|
18
18
|
>
|
|
19
19
|
<template #actions>
|
|
20
20
|
<v-row no-gutters align="center" class="w-100">
|
|
21
|
-
<v-col cols="auto" v-if="
|
|
21
|
+
<v-col cols="auto" v-if="canCreateEquipmentItem">
|
|
22
22
|
<v-btn
|
|
23
23
|
class="text-none"
|
|
24
24
|
rounded="pill"
|
|
25
25
|
variant="tonal"
|
|
26
26
|
size="large"
|
|
27
|
-
@click="
|
|
27
|
+
@click="openEquipmentItemDialog()"
|
|
28
28
|
>
|
|
29
29
|
Checkout Item
|
|
30
30
|
</v-btn>
|
|
@@ -147,7 +147,7 @@
|
|
|
147
147
|
|
|
148
148
|
<v-row no-gutters class="mb-2">
|
|
149
149
|
<v-col cols="5" class="text-subtitle-2 font-weight-bold">
|
|
150
|
-
|
|
150
|
+
Equipment Quantity:
|
|
151
151
|
</v-col>
|
|
152
152
|
<v-col cols="7" class="text-subtitle-2">
|
|
153
153
|
{{ selectedSupply.qty || "N/A" }}
|
|
@@ -177,28 +177,28 @@
|
|
|
177
177
|
</HygieneUpdateMoreAction>
|
|
178
178
|
</v-dialog>
|
|
179
179
|
|
|
180
|
-
<!-- Main
|
|
181
|
-
<v-dialog v-model="
|
|
180
|
+
<!-- Main Equipment Item Dialog -->
|
|
181
|
+
<v-dialog v-model="dialogEquipmentItem" max-width="540" persistent>
|
|
182
182
|
<v-card>
|
|
183
183
|
<v-card-title class="d-flex align-center pa-4">
|
|
184
|
-
<span class="text-h6 font-weight-bold">
|
|
184
|
+
<span class="text-h6 font-weight-bold">Equipment Item</span>
|
|
185
185
|
<v-spacer />
|
|
186
186
|
<v-btn
|
|
187
187
|
icon="mdi-close"
|
|
188
188
|
variant="text"
|
|
189
189
|
size="small"
|
|
190
|
-
@click="
|
|
190
|
+
@click="dialogEquipmentItem = false"
|
|
191
191
|
/>
|
|
192
192
|
</v-card-title>
|
|
193
193
|
|
|
194
194
|
<v-divider />
|
|
195
195
|
|
|
196
196
|
<v-card-text class="pa-6">
|
|
197
|
-
<v-form ref="
|
|
198
|
-
<!-- Add
|
|
197
|
+
<v-form ref="equipmentItemFormRef">
|
|
198
|
+
<!-- Add Equipment Section -->
|
|
199
199
|
<v-row no-gutters class="mb-4">
|
|
200
200
|
<v-col cols="12">
|
|
201
|
-
<InputLabel for="
|
|
201
|
+
<InputLabel for="equipment" title="Add Equipment" class="mb-2" />
|
|
202
202
|
<v-autocomplete
|
|
203
203
|
v-model="selectedSupplyForAdd"
|
|
204
204
|
:items="supplyItems"
|
|
@@ -207,14 +207,14 @@
|
|
|
207
207
|
item-value="value"
|
|
208
208
|
density="comfortable"
|
|
209
209
|
variant="outlined"
|
|
210
|
-
placeholder="Select
|
|
210
|
+
placeholder="Select equipment"
|
|
211
211
|
@update:model-value="addSupplyToList"
|
|
212
212
|
/>
|
|
213
213
|
</v-col>
|
|
214
214
|
</v-row>
|
|
215
215
|
|
|
216
|
-
<!-- Selected
|
|
217
|
-
<v-row no-gutters v-if="
|
|
216
|
+
<!-- Selected Equipment List -->
|
|
217
|
+
<v-row no-gutters v-if="equipmentItems.length > 0" class="mb-4">
|
|
218
218
|
<v-col cols="12">
|
|
219
219
|
<v-divider class="mb-4" />
|
|
220
220
|
|
|
@@ -223,7 +223,7 @@
|
|
|
223
223
|
</div>
|
|
224
224
|
|
|
225
225
|
<v-sheet
|
|
226
|
-
v-for="(item, index) in
|
|
226
|
+
v-for="(item, index) in equipmentItems"
|
|
227
227
|
:key="index"
|
|
228
228
|
rounded="lg"
|
|
229
229
|
variant="outlined"
|
|
@@ -234,7 +234,7 @@
|
|
|
234
234
|
<div class="text-body-2 font-weight-medium">
|
|
235
235
|
<span class="text-capitalize">{{ item.supplyName }}</span>
|
|
236
236
|
- (Available:
|
|
237
|
-
<span class="font-weight-bold">{{ item.
|
|
237
|
+
<span class="font-weight-bold">{{ item.stockQty }}</span
|
|
238
238
|
>)
|
|
239
239
|
</div>
|
|
240
240
|
</v-col>
|
|
@@ -283,7 +283,7 @@
|
|
|
283
283
|
>mdi-delete-outline</v-icon
|
|
284
284
|
>
|
|
285
285
|
</template>
|
|
286
|
-
<v-list-item-title>Remove
|
|
286
|
+
<v-list-item-title>Remove Equipment</v-list-item-title>
|
|
287
287
|
</v-list-item>
|
|
288
288
|
</v-list>
|
|
289
289
|
</v-menu>
|
|
@@ -342,7 +342,7 @@
|
|
|
342
342
|
size="large"
|
|
343
343
|
height="56"
|
|
344
344
|
class="text-none font-weight-medium rounded-0"
|
|
345
|
-
@click="
|
|
345
|
+
@click="dialogEquipmentItem = false"
|
|
346
346
|
>
|
|
347
347
|
Cancel
|
|
348
348
|
</v-btn>
|
|
@@ -356,9 +356,9 @@
|
|
|
356
356
|
height="56"
|
|
357
357
|
class="text-none font-weight-bold rounded-0"
|
|
358
358
|
:loading="submitting"
|
|
359
|
-
@click="
|
|
359
|
+
@click="_equipmentItem()"
|
|
360
360
|
>
|
|
361
|
-
|
|
361
|
+
Equipment Item
|
|
362
362
|
</v-btn>
|
|
363
363
|
</v-col>
|
|
364
364
|
</v-row>
|
|
@@ -374,7 +374,7 @@
|
|
|
374
374
|
<div>
|
|
375
375
|
<div class="text-h6 font-weight-bold">Item Photos</div>
|
|
376
376
|
<div class="text-caption text-medium-emphasis">
|
|
377
|
-
{{
|
|
377
|
+
{{ equipmentItems[activePhotoIndex ?? 0]?.supplyName || "Item" }}
|
|
378
378
|
</div>
|
|
379
379
|
</div>
|
|
380
380
|
|
|
@@ -438,16 +438,17 @@
|
|
|
438
438
|
</template>
|
|
439
439
|
|
|
440
440
|
<script setup lang="ts">
|
|
441
|
-
import
|
|
442
|
-
import {
|
|
441
|
+
import useEquipmentItem from "../composables/useEquipmentItem";
|
|
442
|
+
import { useEquipmentItemPermission } from "../composables/useEquipmentItemPermission";
|
|
443
443
|
import useSupply from "../composables/useSupply";
|
|
444
|
+
import useUtils from "../composables/useUtils";
|
|
444
445
|
|
|
445
446
|
const props = defineProps({
|
|
446
447
|
orgId: { type: String, default: "" },
|
|
447
448
|
site: { type: String, default: "" },
|
|
448
449
|
});
|
|
449
450
|
|
|
450
|
-
const {
|
|
451
|
+
const { canCreateEquipmentItem } = useEquipmentItemPermission();
|
|
451
452
|
|
|
452
453
|
const items = ref<Array<Record<string, any>>>([]);
|
|
453
454
|
const siteName = ref<string>("");
|
|
@@ -462,10 +463,10 @@ const headers = [
|
|
|
462
463
|
];
|
|
463
464
|
|
|
464
465
|
const {
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
} =
|
|
466
|
+
getEquipmentItems,
|
|
467
|
+
getEquipmentItemById,
|
|
468
|
+
equipmentItems: equipmentItemApi,
|
|
469
|
+
} = useEquipmentItem();
|
|
469
470
|
const { debounce, requiredRule, formatDate } = useUtils();
|
|
470
471
|
|
|
471
472
|
const searchInput = ref("");
|
|
@@ -475,16 +476,16 @@ const page = ref(1);
|
|
|
475
476
|
const pages = ref(0);
|
|
476
477
|
const pageRange = ref("-- - -- of --");
|
|
477
478
|
|
|
478
|
-
const
|
|
479
|
+
const selectedEquipmentItemId = ref("");
|
|
479
480
|
|
|
480
481
|
const {
|
|
481
|
-
data:
|
|
482
|
-
refresh:
|
|
482
|
+
data: getEquipmentItemsReq,
|
|
483
|
+
refresh: getEquipmentItemsRefresh,
|
|
483
484
|
pending: loading,
|
|
484
485
|
} = await useLazyAsyncData(
|
|
485
|
-
"get-all-
|
|
486
|
+
"get-all-equipment-items",
|
|
486
487
|
() =>
|
|
487
|
-
|
|
488
|
+
getEquipmentItems({
|
|
488
489
|
page: page.value,
|
|
489
490
|
search: searchInput.value,
|
|
490
491
|
site: props.site,
|
|
@@ -495,14 +496,14 @@ const {
|
|
|
495
496
|
);
|
|
496
497
|
|
|
497
498
|
watchEffect(() => {
|
|
498
|
-
if (
|
|
499
|
-
items.value =
|
|
500
|
-
pages.value =
|
|
501
|
-
pageRange.value =
|
|
499
|
+
if (getEquipmentItemsReq.value) {
|
|
500
|
+
items.value = getEquipmentItemsReq.value.items;
|
|
501
|
+
pages.value = getEquipmentItemsReq.value.pages;
|
|
502
|
+
pageRange.value = getEquipmentItemsReq.value.pageRange;
|
|
502
503
|
}
|
|
503
504
|
});
|
|
504
505
|
|
|
505
|
-
const debounceSearch = debounce(
|
|
506
|
+
const debounceSearch = debounce(getEquipmentItemsRefresh, 500);
|
|
506
507
|
watch(
|
|
507
508
|
[searchInput, endDate, startDate],
|
|
508
509
|
([]) => {
|
|
@@ -511,35 +512,35 @@ watch(
|
|
|
511
512
|
{ immediate: false, deep: true }
|
|
512
513
|
);
|
|
513
514
|
|
|
514
|
-
const { data:
|
|
515
|
-
await useLazyAsyncData(
|
|
516
|
-
"get-
|
|
517
|
-
() =>
|
|
515
|
+
const { data: getEquipmentItemByIdReq, refresh: getEquipmentItemByIdRefresh } =
|
|
516
|
+
await useLazyAsyncData<any>(
|
|
517
|
+
"get-equipment-item-by-id",
|
|
518
|
+
() => getEquipmentItemById(selectedEquipmentItemId.value),
|
|
518
519
|
{
|
|
519
520
|
immediate: false,
|
|
520
521
|
}
|
|
521
522
|
);
|
|
522
523
|
|
|
523
524
|
watchEffect(() => {
|
|
524
|
-
if (
|
|
525
|
+
if (getEquipmentItemByIdReq.value) {
|
|
525
526
|
selectedSupply.value = {
|
|
526
|
-
_id:
|
|
527
|
-
supplyName:
|
|
528
|
-
qty:
|
|
527
|
+
_id: getEquipmentItemByIdReq.value._id,
|
|
528
|
+
supplyName: getEquipmentItemByIdReq.value.supplyName || "N/A",
|
|
529
|
+
qty: getEquipmentItemByIdReq.value.qty || 0,
|
|
529
530
|
unitOfMeasurement:
|
|
530
|
-
|
|
531
|
-
status:
|
|
532
|
-
site:
|
|
531
|
+
getEquipmentItemByIdReq.value.supply?.unitOfMeasurement || "N/A",
|
|
532
|
+
status: getEquipmentItemByIdReq.value.status || "N/A",
|
|
533
|
+
site: getEquipmentItemByIdReq.value.site || "N/A",
|
|
533
534
|
supply:
|
|
534
|
-
|
|
535
|
-
|
|
535
|
+
getEquipmentItemByIdReq.value.supply ||
|
|
536
|
+
getEquipmentItemByIdReq.value.supply?._id ||
|
|
536
537
|
"N/A",
|
|
537
|
-
attachment: Array.isArray(
|
|
538
|
-
? [...
|
|
538
|
+
attachment: Array.isArray(getEquipmentItemByIdReq.value.attachment)
|
|
539
|
+
? [...getEquipmentItemByIdReq.value.attachment]
|
|
539
540
|
: [],
|
|
540
541
|
stockQty:
|
|
541
|
-
|
|
542
|
-
|
|
542
|
+
getEquipmentItemByIdReq.value.stockQty ||
|
|
543
|
+
getEquipmentItemByIdReq.value.supply?.stockQty ||
|
|
543
544
|
"N/A",
|
|
544
545
|
};
|
|
545
546
|
}
|
|
@@ -548,7 +549,7 @@ watchEffect(() => {
|
|
|
548
549
|
const { getSupplies } = useSupply();
|
|
549
550
|
|
|
550
551
|
const { data: getSuppliesReq } = await useLazyAsyncData(
|
|
551
|
-
"get-supplies-for-
|
|
552
|
+
"get-supplies-for-equipment-item",
|
|
552
553
|
() =>
|
|
553
554
|
getSupplies({
|
|
554
555
|
site: props.site,
|
|
@@ -562,13 +563,14 @@ watchEffect(() => {
|
|
|
562
563
|
supplyItems.value = getSuppliesReq.value.items.map((item: any) => ({
|
|
563
564
|
name: item.name,
|
|
564
565
|
value: item._id,
|
|
566
|
+
stockQty: item.qty ?? 0,
|
|
565
567
|
}));
|
|
566
568
|
}
|
|
567
569
|
});
|
|
568
570
|
|
|
569
|
-
const supplyItems = ref<Array<{ name: string; value: string }>>([]);
|
|
571
|
+
const supplyItems = ref<Array<{ name: string; value: string; stockQty: number }>>([]);
|
|
570
572
|
const selectedSupplyForAdd = ref<string>("");
|
|
571
|
-
const
|
|
573
|
+
const equipmentItems = ref<TEquipmentItem[]>([]);
|
|
572
574
|
|
|
573
575
|
const selectedSupply = ref<Record<string, any>>({});
|
|
574
576
|
const message = ref("");
|
|
@@ -576,7 +578,7 @@ const messageSnackbar = ref(false);
|
|
|
576
578
|
const messageColor = ref("");
|
|
577
579
|
|
|
578
580
|
const dialogShowMoreActions = ref(false);
|
|
579
|
-
const
|
|
581
|
+
const dialogEquipmentItem = ref(false);
|
|
580
582
|
const dialogPhotoForItem = ref(false);
|
|
581
583
|
const activePhotoIndex = ref<number | null>(null);
|
|
582
584
|
|
|
@@ -586,28 +588,29 @@ function showMessage(msg: string, color: string = "error") {
|
|
|
586
588
|
messageSnackbar.value = true;
|
|
587
589
|
}
|
|
588
590
|
|
|
589
|
-
function
|
|
590
|
-
|
|
591
|
+
function openEquipmentItemDialog() {
|
|
592
|
+
equipmentItems.value = [];
|
|
591
593
|
selectedSupplyForAdd.value = "";
|
|
592
|
-
|
|
594
|
+
dialogEquipmentItem.value = true;
|
|
593
595
|
}
|
|
594
596
|
|
|
595
597
|
function addSupplyToList(supplyId: string) {
|
|
596
598
|
if (!supplyId) return;
|
|
597
599
|
|
|
598
|
-
const exists =
|
|
600
|
+
const exists = equipmentItems.value.find((item) => item.supply === supplyId);
|
|
599
601
|
if (exists) {
|
|
600
|
-
showMessage("
|
|
602
|
+
showMessage("Equipment already added.");
|
|
601
603
|
selectedSupplyForAdd.value = "";
|
|
602
604
|
return;
|
|
603
605
|
}
|
|
604
606
|
|
|
605
607
|
const supply = supplyItems.value.find((s) => s.value === supplyId);
|
|
606
608
|
if (supply) {
|
|
607
|
-
|
|
609
|
+
equipmentItems.value.push({
|
|
608
610
|
supply: supplyId,
|
|
609
611
|
supplyName: supply.name,
|
|
610
612
|
qty: 1,
|
|
613
|
+
stockQty: supply.stockQty,
|
|
611
614
|
photos: [],
|
|
612
615
|
photoIds: [],
|
|
613
616
|
});
|
|
@@ -616,7 +619,7 @@ function addSupplyToList(supplyId: string) {
|
|
|
616
619
|
}
|
|
617
620
|
|
|
618
621
|
function removeSupplyFromList(index: number) {
|
|
619
|
-
|
|
622
|
+
equipmentItems.value.splice(index, 1);
|
|
620
623
|
}
|
|
621
624
|
|
|
622
625
|
function openPhotoDialog(index: number) {
|
|
@@ -627,25 +630,25 @@ function openPhotoDialog(index: number) {
|
|
|
627
630
|
async function handleRowClick(data: any) {
|
|
628
631
|
message.value = "";
|
|
629
632
|
|
|
630
|
-
|
|
633
|
+
selectedEquipmentItemId.value = data?.item?._id;
|
|
631
634
|
|
|
632
|
-
if (
|
|
633
|
-
await
|
|
635
|
+
if (selectedEquipmentItemId.value) {
|
|
636
|
+
await getEquipmentItemByIdRefresh();
|
|
634
637
|
}
|
|
635
638
|
|
|
636
639
|
dialogShowMoreActions.value = true;
|
|
637
640
|
}
|
|
638
641
|
|
|
639
|
-
async function
|
|
642
|
+
async function _equipmentItem() {
|
|
640
643
|
submitting.value = true;
|
|
641
644
|
try {
|
|
642
|
-
if (!
|
|
643
|
-
showMessage("Add at least one
|
|
645
|
+
if (!equipmentItems.value.length) {
|
|
646
|
+
showMessage("Add at least one equipment.");
|
|
644
647
|
submitting.value = false;
|
|
645
648
|
return;
|
|
646
649
|
}
|
|
647
650
|
|
|
648
|
-
const items =
|
|
651
|
+
const items = equipmentItems.value.map((item) => ({
|
|
649
652
|
supply: item.supply,
|
|
650
653
|
qty: item.qty,
|
|
651
654
|
...(item.photoIds && item.photoIds.length
|
|
@@ -653,16 +656,16 @@ async function _checkoutItem() {
|
|
|
653
656
|
: {}),
|
|
654
657
|
}));
|
|
655
658
|
|
|
656
|
-
await
|
|
659
|
+
await equipmentItemApi(props.site, { items });
|
|
657
660
|
|
|
658
661
|
showMessage(
|
|
659
|
-
`Checked out ${
|
|
662
|
+
`Checked out ${equipmentItems.value.length} item(s).`,
|
|
660
663
|
"success"
|
|
661
664
|
);
|
|
662
|
-
|
|
663
|
-
|
|
665
|
+
dialogEquipmentItem.value = false;
|
|
666
|
+
equipmentItems.value = [];
|
|
664
667
|
|
|
665
|
-
await
|
|
668
|
+
await getEquipmentItemsRefresh();
|
|
666
669
|
} catch (error: any) {
|
|
667
670
|
console.error(error);
|
|
668
671
|
showMessage(error?.data?.message, "error");
|
|
@@ -682,22 +685,22 @@ function viewAttachment(attachmentId: string) {
|
|
|
682
685
|
const currentPhotos = computed({
|
|
683
686
|
get() {
|
|
684
687
|
if (activePhotoIndex.value === null) return [];
|
|
685
|
-
return
|
|
688
|
+
return equipmentItems.value[activePhotoIndex.value]?.photos || [];
|
|
686
689
|
},
|
|
687
690
|
set(val) {
|
|
688
691
|
if (activePhotoIndex.value === null) return;
|
|
689
|
-
|
|
692
|
+
equipmentItems.value[activePhotoIndex.value].photos = val || [];
|
|
690
693
|
},
|
|
691
694
|
});
|
|
692
695
|
|
|
693
696
|
const currentPhotoIds = computed({
|
|
694
697
|
get() {
|
|
695
698
|
if (activePhotoIndex.value === null) return [];
|
|
696
|
-
return
|
|
699
|
+
return equipmentItems.value[activePhotoIndex.value]?.photoIds || [];
|
|
697
700
|
},
|
|
698
701
|
set(val) {
|
|
699
702
|
if (activePhotoIndex.value === null) return;
|
|
700
|
-
|
|
703
|
+
equipmentItems.value[activePhotoIndex.value].photoIds = val || [];
|
|
701
704
|
},
|
|
702
705
|
});
|
|
703
706
|
</script>
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
v-model:page="page"
|
|
11
11
|
:pages="pages"
|
|
12
12
|
:pageRange="pageRange"
|
|
13
|
-
:no-data-text="`No
|
|
13
|
+
:no-data-text="`No equipments found.`"
|
|
14
14
|
@refresh="updatePage"
|
|
15
15
|
:canCreate="true"
|
|
16
|
-
createLabel="Add
|
|
16
|
+
createLabel="Add Equipment"
|
|
17
17
|
@row-click="tableRowClickHandler"
|
|
18
18
|
>
|
|
19
19
|
<template #actions>
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
variant="tonal"
|
|
26
26
|
size="large"
|
|
27
27
|
>
|
|
28
|
-
Add
|
|
28
|
+
Add Equipment
|
|
29
29
|
</v-btn>
|
|
30
30
|
</v-col>
|
|
31
31
|
|
|
@@ -22,7 +22,7 @@ const prop = defineProps({
|
|
|
22
22
|
},
|
|
23
23
|
placeholder: {
|
|
24
24
|
type: String,
|
|
25
|
-
default: 'MM/
|
|
25
|
+
default: 'DD/MM/YYYY, HH:MM AM/PM'
|
|
26
26
|
}
|
|
27
27
|
})
|
|
28
28
|
|
|
@@ -53,17 +53,23 @@ function validate() {
|
|
|
53
53
|
function convertToReadableFormat(dateStr: string): string {
|
|
54
54
|
|
|
55
55
|
if (!dateStr) return "";
|
|
56
|
+
|
|
56
57
|
const date = new Date(dateStr)
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
const
|
|
66
|
-
|
|
58
|
+
|
|
59
|
+
const day = String(date.getDate()).padStart(2, '0')
|
|
60
|
+
const month = String(date.getMonth() + 1).padStart(2, '0')
|
|
61
|
+
const year = date.getFullYear()
|
|
62
|
+
|
|
63
|
+
let hours = date.getHours()
|
|
64
|
+
const minutes = String(date.getMinutes()).padStart(2, '0')
|
|
65
|
+
|
|
66
|
+
const ampm = hours >= 12 ? 'PM' : 'AM'
|
|
67
|
+
hours = hours % 12
|
|
68
|
+
hours = hours ? hours : 12
|
|
69
|
+
|
|
70
|
+
const formattedTime = `${String(hours).padStart(2, '0')}:${minutes} ${ampm}`
|
|
71
|
+
|
|
72
|
+
return `${day}/${month}/${year}, ${formattedTime}`
|
|
67
73
|
}
|
|
68
74
|
|
|
69
75
|
function handleInitialDate(){
|
|
@@ -141,6 +141,14 @@ watch(input, (newInput) => {
|
|
|
141
141
|
else phone.value = prefix + newInput
|
|
142
142
|
})
|
|
143
143
|
|
|
144
|
+
watch(
|
|
145
|
+
() => props.modelValue,
|
|
146
|
+
(val) => {
|
|
147
|
+
phone.value = val || ''
|
|
148
|
+
},
|
|
149
|
+
{ immediate: true }
|
|
150
|
+
)
|
|
151
|
+
|
|
144
152
|
|
|
145
153
|
watch(phone, (newVal) => {
|
|
146
154
|
const prefix = phonePrefix.value
|