@7365admin1/layer-common 3.0.31-staging.23 → 3.0.31-staging.25

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.
@@ -97,7 +97,10 @@
97
97
  Rejected
98
98
  </v-chip>
99
99
  </div>
100
- <div v-if="item.remarks" class="text-body-2 text-medium-emphasis">
100
+ <div
101
+ v-if="item.remarks"
102
+ class="text-body-2 text-medium-emphasis"
103
+ >
101
104
  {{ item.remarks }}
102
105
  </div>
103
106
  <div
@@ -225,11 +228,7 @@
225
228
  <v-card-text class="pa-4">
226
229
  <v-row>
227
230
  <v-col cols="12">
228
- <InputLabel
229
- title="Remarks (Optional)"
230
- :required="false"
231
- class="mb-2"
232
- />
231
+ <InputLabel title="Remarks" :required="false" class="mb-2" />
233
232
  <v-textarea
234
233
  v-model="modalData.remark"
235
234
  placeholder="Enter your remarks here"
@@ -243,7 +242,7 @@
243
242
  <v-col cols="12">
244
243
  <v-divider class="mb-4" />
245
244
  <PhotoUpload
246
- title="Take/Upload Photo"
245
+ title="Take/Upload Photos"
247
246
  :required="false"
248
247
  v-model="modalData.photos"
249
248
  v-model:photo-ids="modalData.photoIds"
@@ -442,12 +441,12 @@ const { back } = useUtils();
442
441
  const route = useRoute();
443
442
  const scheduleTitle = computed(() => {
444
443
  const path = route.path;
445
- if (path.includes('cleaning-schedule')) return 'Cleaning Checklist';
446
- if (path.includes('technician-schedule')) return 'Technician Checklist';
447
- if (path.includes('landscape-schedule')) return 'Landscape Checklist';
448
- if (path.includes('pool-schedule')) return 'Pool Checklist';
449
- if (path.includes('pest-schedule')) return 'Pest Checklist';
450
- return 'Cleaner Checklist';
444
+ if (path.includes("cleaning-schedule")) return "Cleaning Checklist";
445
+ if (path.includes("technician-schedule")) return "Technician Checklist";
446
+ if (path.includes("landscape-schedule")) return "Landscape Checklist";
447
+ if (path.includes("pool-schedule")) return "Pool Checklist";
448
+ if (path.includes("pest-schedule")) return "Pest Checklist";
449
+ return "Cleaner Checklist";
451
450
  });
452
451
 
453
452
  const canAddRemarks = computed(() => props.canAddRemarks);
@@ -754,6 +754,7 @@ type SearchPerson = Omit<Partial<TPeople>, "contact"> & {
754
754
  contacts?: string | string[];
755
755
  plateNumbers?: string | string[];
756
756
  plateNumber?: string | string[];
757
+ plates?: { plateNumber?: string }[];
757
758
  };
758
759
 
759
760
  function getPeopleSearchItems(res: any): Partial<TPeople>[] {
@@ -803,7 +804,6 @@ async function handleAddNewContractorType() {
803
804
 
804
805
  combo.isMenuActive = false;
805
806
  combo.$el.querySelector("input")?.blur();
806
- ``;
807
807
  }
808
808
 
809
809
  async function handleSelectCompanyName(company: string) {
@@ -974,19 +974,44 @@ function applyNricSearchResult(
974
974
 
975
975
  currentAutofillSource.value = options.source || "nric";
976
976
 
977
- visitor.nric = item.nric || visitor.nric;
978
- visitor.name = item.name || visitor.name;
979
- visitor.contact = options.contacts || getPersonContactOptions(item)[0] || visitor.contact;
980
- visitor.plateNumber = options.plateNumber || getPersonPlateOptions(item)[0] || visitor.plateNumber;
977
+ const shouldAutofillField = (fieldSource?: Exclude<AutofillSource, null>) => {
978
+ if (!fieldSource) return false;
979
+ return currentAutofillSource.value === fieldSource;
980
+ };
981
+ const getAutofillValue = (
982
+ currentValue: string | undefined,
983
+ nextValue: string | undefined,
984
+ fieldSource?: Exclude<AutofillSource, null>
985
+ ) => {
986
+ if (!nextValue) return currentValue;
987
+ if (currentValue && !shouldAutofillField(fieldSource)) return currentValue;
988
+ return nextValue;
989
+ };
990
+
991
+ visitor.nric = getAutofillValue(visitor.nric, item.nric, "nric");
992
+ visitor.name = getAutofillValue(visitor.name, item.name);
993
+ visitor.contact = getAutofillValue(
994
+ visitor.contact,
995
+ options.contacts || getPersonContactOptions(item)[0],
996
+ "contact"
997
+ );
998
+
999
+ if(prop.type !== 'walk-in'){
1000
+ visitor.plateNumber = getAutofillValue(
1001
+ visitor.plateNumber,
1002
+ options.plateNumber || getPersonPlateOptions(item)[0],
1003
+ "vehicleNumber"
1004
+ );
1005
+ }
981
1006
 
982
1007
  companyNames.value = Array.isArray(item.companyName) ? item.companyName : [];
983
1008
 
984
- if (item.companyName && item.companyName.length === 1) {
1009
+ if (!visitor.company && item.companyName && item.companyName.length === 1) {
985
1010
  visitor.company = item.companyName?.[0] || visitor.company;
986
1011
  }
987
1012
 
988
- if (item.companyName && item.companyName.length > 1) {
989
- visitor.company = ""
1013
+ if (!visitor.company && item.companyName && item.companyName.length > 1) {
1014
+ visitor.company = "";
990
1015
  }
991
1016
 
992
1017
 
@@ -1019,7 +1044,10 @@ function selectAutofillSearchResult(item: Partial<TPeople>, source: Exclude<Auto
1019
1044
  const selectedPlate =
1020
1045
  findMatchingPlateOption(plateOptions, visitor.plateNumber) || plateOptions[0] || "";
1021
1046
 
1022
- if (contactOptions.length > 1 || plateOptions.length > 1) {
1047
+ const needsContactChoice = !visitor.contact?.trim() && contactOptions.length > 1;
1048
+ const needsPlateChoice = !visitor.plateNumber?.trim() && plateOptions.length > 1;
1049
+
1050
+ if (needsContactChoice || needsPlateChoice) {
1023
1051
  nricSearchMenu.value = false;
1024
1052
  phoneSearchMenu.value = false;
1025
1053
  vehicleSearchMenu.value = false;
@@ -1379,6 +1407,7 @@ function handleUpdateNRIC() {
1379
1407
  if (skipNricFetch.value) return;
1380
1408
  if (!isNricFieldFocused.value) return;
1381
1409
  if (visitor.nric && visitor.nric?.length < 4) return;
1410
+ if(prop.type === 'walk-in' || prop.type === 'drop-off') return;
1382
1411
  debounceFetchNRIC();
1383
1412
  }
1384
1413
 
@@ -1410,6 +1439,7 @@ function handleUpdatePhoneNumber() {
1410
1439
  phoneSearchMenu.value = false;
1411
1440
  return;
1412
1441
  }
1442
+ if(prop.type === 'walk-in' || prop.type === 'drop-off') return;
1413
1443
 
1414
1444
  debounceFetchPhoneNumber();
1415
1445
  }
@@ -1442,6 +1472,8 @@ function handleUpdateVehicleNumber() {
1442
1472
  return;
1443
1473
  }
1444
1474
 
1475
+ if(prop.type === 'walk-in' || prop.type === 'drop-off') return;
1476
+
1445
1477
  debounceFetchPlateNumber();
1446
1478
  }
1447
1479
 
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@7365admin1/layer-common",
3
3
  "license": "MIT",
4
4
  "type": "module",
5
- "version": "3.0.31-staging.23",
5
+ "version": "3.0.31-staging.25",
6
6
  "author": "7365admin1",
7
7
  "main": "./nuxt.config.ts",
8
8
  "publishConfig": {