@eeplatform/nuxt-layer-common 1.7.28 → 1.7.30

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.
@@ -27,8 +27,9 @@
27
27
  :items="provinces"
28
28
  item-title="name"
29
29
  item-value="code"
30
+ :return-object="false"
30
31
  :loading="provincesStatus"
31
- :disabled="provincesStatus"
32
+ :disabled="provincesStatus || !enrollment.region"
32
33
  ></v-autocomplete>
33
34
  </v-col>
34
35
  </v-row>
@@ -44,7 +45,7 @@
44
45
  item-title="name"
45
46
  item-value="code"
46
47
  :loading="citiesMunicipalitiesStatus"
47
- :disabled="citiesMunicipalitiesStatus"
48
+ :disabled="citiesMunicipalitiesStatus || !enrollment.province"
48
49
  >
49
50
  </v-autocomplete>
50
51
  </v-col>
@@ -318,14 +319,11 @@
318
319
 
319
320
  <v-col cols="4">
320
321
  <v-row no-gutters>
321
- <InputLabel
322
- v-model="enrollment.learnerInfo.middleName"
323
- class="text-capitalize"
324
- title="Middle Name"
325
- required
326
- />
322
+ <InputLabel class="text-capitalize" title="Middle Name" />
327
323
  <v-col cols="12">
328
- <v-text-field></v-text-field>
324
+ <v-text-field
325
+ v-model="enrollment.learnerInfo.middleName"
326
+ ></v-text-field>
329
327
  </v-col>
330
328
  </v-row>
331
329
  </v-col>
@@ -387,12 +385,13 @@
387
385
  <v-col cols="2">
388
386
  <v-row no-gutters>
389
387
  <v-col cols="12">
390
- <InputLabel class="text-capitalize" title="Sex" />
388
+ <InputLabel class="text-capitalize" title="Sex" required />
391
389
  </v-col>
392
390
  <v-col cols="12">
393
391
  <v-select
394
392
  v-model="enrollment.learnerInfo.sex"
395
393
  :items="['Male', 'Female']"
394
+ :rules="[requiredRule]"
396
395
  placeholder="Select Sex"
397
396
  ></v-select>
398
397
  </v-col>
@@ -403,35 +402,90 @@
403
402
 
404
403
  <v-col cols="12" class="mt-4">
405
404
  <v-row>
406
- <v-col cols="4">
405
+ <v-col cols="6">
407
406
  <v-row no-gutters>
408
- <InputLabel
409
- class="text-capitalize"
410
- title="Place of Birth (Municipality/City)"
411
- required
412
- />
413
407
  <v-col cols="12">
414
- <v-autocomplete
415
- v-model="enrollment.learnerInfo.placeOfBirth"
416
- :rules="[requiredRule]"
417
- :items="citiesMunicipalities"
418
- item-title="name"
419
- items-value="name"
420
- :hide-no-data="false"
421
- >
422
- <template v-slot:no-data>
423
- <v-list-item>
424
- <v-list-item-title>
425
- No results matching "<strong>search</strong>". Press
426
- <kbd>enter</kbd> to create a new one
427
- </v-list-item-title>
428
- </v-list-item>
429
- </template>
430
- </v-autocomplete>
408
+ <span class="font-weight-bold text-subtitle-1">
409
+ Place of Birth
410
+ </span>
431
411
  </v-col>
412
+
413
+ <v-row>
414
+ <v-col cols="6">
415
+ <v-row no-gutters>
416
+ <InputLabel
417
+ class="text-capitalize"
418
+ title="Province"
419
+ required
420
+ />
421
+ <v-col cols="12">
422
+ <v-combobox
423
+ v-model="enrollment.learnerInfo.placeOfBirth.province"
424
+ :rules="[requiredRule]"
425
+ :items="birthProvinces"
426
+ item-title="name"
427
+ item-value="code"
428
+ :return-object="false"
429
+ :hide-no-data="false"
430
+ :loading="loadingBirthProvinces"
431
+ @keydown.enter="getBirthCityMun()"
432
+ >
433
+ <template v-slot:no-data>
434
+ <v-list-item>
435
+ <v-list-item-title>
436
+ No results found. Press <kbd>enter</kbd> to
437
+ search
438
+ </v-list-item-title>
439
+ </v-list-item>
440
+ </template>
441
+ </v-combobox>
442
+ </v-col>
443
+ </v-row>
444
+ </v-col>
445
+
446
+ <v-col cols="6">
447
+ <v-row no-gutters>
448
+ <InputLabel
449
+ class="text-capitalize"
450
+ title="Municipality/City"
451
+ required
452
+ />
453
+ <v-col cols="12">
454
+ <v-combobox
455
+ v-model="
456
+ enrollment.learnerInfo.placeOfBirth.cityMunicipality
457
+ "
458
+ :rules="[requiredRule]"
459
+ :items="birthCitiesMunicipalities"
460
+ item-title="name"
461
+ item-value="code"
462
+ :return-object="false"
463
+ :hide-no-data="false"
464
+ :disabled="
465
+ !enrollment.learnerInfo.placeOfBirth.province
466
+ "
467
+ :loading="loadingBirthCityMun"
468
+ >
469
+ <template v-slot:no-data>
470
+ <v-list-item>
471
+ <v-list-item-title>
472
+ No results found. Press <kbd>enter</kbd> to
473
+ search
474
+ </v-list-item-title>
475
+ </v-list-item>
476
+ </template>
477
+ </v-combobox>
478
+ </v-col>
479
+ </v-row>
480
+ </v-col>
481
+ </v-row>
432
482
  </v-row>
433
483
  </v-col>
484
+ </v-row>
485
+ </v-col>
434
486
 
487
+ <v-col cols="12">
488
+ <v-row>
435
489
  <v-col cols="3">
436
490
  <v-row no-gutters>
437
491
  <InputLabel
@@ -460,14 +514,12 @@
460
514
  </v-col>
461
515
 
462
516
  <v-col cols="4">
463
- <v-row>
464
- <v-col cols="12" class="pb-0">
465
- <InputLabel
466
- class="text-capitalize"
467
- title="Indigenous People/Cultural Community"
468
- />
469
- </v-col>
470
- <v-col cols="9" class="pt-0">
517
+ <v-row no-gutters>
518
+ <InputLabel
519
+ class="text-capitalize"
520
+ title="Indigenous People/Cultural Community"
521
+ />
522
+ <v-col cols="12" class="pt-0">
471
523
  <v-combobox
472
524
  v-model="enrollment.learnerInfo.indigenousCommunity"
473
525
  :items="indigenousCommunitiesPhilippines"
@@ -485,21 +537,19 @@
485
537
  </v-col>
486
538
  </v-row>
487
539
  </v-col>
488
- </v-row>
489
- </v-col>
490
540
 
491
- <v-col cols="12">
492
- <v-row>
493
- <v-col cols="12" class="pb-0">
494
- <InputLabel
495
- class="text-capitalize"
496
- title="4Ps Household ID Number"
497
- />
498
- </v-col>
499
- <v-col cols="4" class="pt-0">
500
- <v-text-field
501
- v-model="enrollment.learnerInfo.fourPsHouseholdId"
502
- ></v-text-field>
541
+ <v-col cols="3">
542
+ <v-row no-gutters>
543
+ <InputLabel
544
+ class="text-capitalize"
545
+ title="4Ps Household ID Number"
546
+ />
547
+ <v-col cols="12" class="pt-0">
548
+ <v-text-field
549
+ v-model="enrollment.learnerInfo.fourPsHouseholdId"
550
+ ></v-text-field>
551
+ </v-col>
552
+ </v-row>
503
553
  </v-col>
504
554
  </v-row>
505
555
  </v-col>
@@ -669,21 +719,16 @@
669
719
  <v-row>
670
720
  <v-col cols="3">
671
721
  <v-row no-gutters>
672
- <InputLabel class="text-capitalize" title="House No." />
673
- <v-col cols="12">
674
- <v-text-field
675
- v-model="enrollment.address.current.houseNumber"
676
- ></v-text-field>
677
- </v-col>
678
- </v-row>
679
- </v-col>
680
-
681
- <v-col cols="3">
682
- <v-row no-gutters>
683
- <InputLabel class="text-capitalize" title="Street" />
722
+ <InputLabel
723
+ class="text-capitalize"
724
+ title="Country"
725
+ required
726
+ />
684
727
  <v-col cols="12">
685
728
  <v-text-field
686
- v-model="enrollment.address.current.streetName"
729
+ v-model="enrollment.address.current.country"
730
+ :rules="[requiredRule]"
731
+ readonly
687
732
  ></v-text-field>
688
733
  </v-col>
689
734
  </v-row>
@@ -693,22 +738,35 @@
693
738
  <v-row no-gutters>
694
739
  <InputLabel
695
740
  class="text-capitalize"
696
- title="Barangay"
741
+ title="Province"
697
742
  required
698
743
  />
699
744
  <v-col cols="12">
700
- <v-text-field
701
- v-model="enrollment.address.current.barangay"
745
+ <v-combobox
746
+ v-model="enrollment.address.current.province"
702
747
  :rules="[requiredRule]"
703
- ></v-text-field>
748
+ :items="currentProvinces"
749
+ item-title="name"
750
+ item-value="code"
751
+ :return-object="false"
752
+ :hide-no-data="false"
753
+ :loading="loadingCurrentProvinces"
754
+ @keydown.enter="getCurrentCityMun()"
755
+ >
756
+ <template v-slot:no-data>
757
+ <v-list-item>
758
+ <v-list-item-title>
759
+ No results matching "<strong>search</strong>".
760
+ Press
761
+ <kbd>enter</kbd> to create a new one
762
+ </v-list-item-title>
763
+ </v-list-item>
764
+ </template>
765
+ </v-combobox>
704
766
  </v-col>
705
767
  </v-row>
706
768
  </v-col>
707
- </v-row>
708
- </v-col>
709
769
 
710
- <v-col cols="12">
711
- <v-row>
712
770
  <v-col cols="3">
713
771
  <v-row no-gutters>
714
772
  <InputLabel
@@ -720,10 +778,13 @@
720
778
  <v-combobox
721
779
  v-model="enrollment.address.current.municipalityCity"
722
780
  :rules="[requiredRule]"
723
- :items="citiesMunicipalities"
781
+ :items="currentCitiesMunicipalities"
724
782
  item-title="name"
725
- item-value="name"
783
+ item-value="code"
784
+ :return-object="false"
726
785
  :hide-no-data="false"
786
+ :disabled="!enrollment.address.current.province"
787
+ :loading="loadingCurrentCityMun"
727
788
  >
728
789
  <template v-slot:no-data>
729
790
  <v-list-item>
@@ -739,21 +800,39 @@
739
800
  </v-row>
740
801
  </v-col>
741
802
 
803
+ <v-col cols="2">
804
+ <v-row no-gutters>
805
+ <InputLabel class="text-capitalize" title="Zip Code" />
806
+ <v-col cols="12">
807
+ <v-text-field
808
+ v-model="enrollment.address.current.zipCode"
809
+ ></v-text-field>
810
+ </v-col>
811
+ </v-row>
812
+ </v-col>
813
+ </v-row>
814
+ </v-col>
815
+
816
+ <v-col cols="12">
817
+ <v-row>
742
818
  <v-col cols="3">
743
819
  <v-row no-gutters>
744
820
  <InputLabel
745
821
  class="text-capitalize"
746
- title="Province"
822
+ title="Barangay"
747
823
  required
748
824
  />
749
825
  <v-col cols="12">
750
826
  <v-combobox
751
- v-model="enrollment.address.current.province"
827
+ v-model="enrollment.address.current.barangay"
752
828
  :rules="[requiredRule]"
753
- :items="provinces"
829
+ :items="currentBarangays"
754
830
  item-title="name"
755
- item-value="name"
831
+ item-value="code"
832
+ :return-object="false"
756
833
  :hide-no-data="false"
834
+ :disabled="!enrollment.address.current.municipalityCity"
835
+ :loading="loadingCurrentBarangay"
757
836
  >
758
837
  <template v-slot:no-data>
759
838
  <v-list-item>
@@ -771,32 +850,21 @@
771
850
 
772
851
  <v-col cols="3">
773
852
  <v-row no-gutters>
774
- <InputLabel
775
- class="text-capitalize"
776
- title="Country"
777
- required
778
- />
853
+ <InputLabel class="text-capitalize" title="Street" />
779
854
  <v-col cols="12">
780
855
  <v-text-field
781
- v-model="enrollment.address.current.country"
782
- :rules="[requiredRule]"
783
- readonly
856
+ v-model="enrollment.address.current.streetName"
784
857
  ></v-text-field>
785
858
  </v-col>
786
859
  </v-row>
787
860
  </v-col>
788
861
 
789
- <v-col cols="2">
862
+ <v-col cols="3">
790
863
  <v-row no-gutters>
791
- <InputLabel
792
- class="text-capitalize"
793
- title="Zip Code"
794
- required
795
- />
864
+ <InputLabel class="text-capitalize" title="House No." />
796
865
  <v-col cols="12">
797
866
  <v-text-field
798
- v-model="enrollment.address.current.zipCode"
799
- :rules="[requiredRule]"
867
+ v-model="enrollment.address.current.houseNumber"
800
868
  ></v-text-field>
801
869
  </v-col>
802
870
  </v-row>
@@ -827,22 +895,15 @@
827
895
  <v-row>
828
896
  <v-col cols="3">
829
897
  <v-row no-gutters>
830
- <InputLabel class="text-capitalize" title="House No." />
831
- <v-col cols="12">
832
- <v-text-field
833
- v-model="enrollment.address.permanent.houseNumber"
834
- :readonly="sameAsCurrentAddress"
835
- ></v-text-field>
836
- </v-col>
837
- </v-row>
838
- </v-col>
839
-
840
- <v-col cols="3">
841
- <v-row no-gutters>
842
- <InputLabel class="text-capitalize" title="Street" />
898
+ <InputLabel
899
+ class="text-capitalize"
900
+ title="Country"
901
+ required
902
+ />
843
903
  <v-col cols="12">
844
904
  <v-text-field
845
- v-model="enrollment.address.permanent.streetName"
905
+ v-model="enrollment.address.permanent.country"
906
+ :rules="[requiredRule]"
846
907
  :readonly="sameAsCurrentAddress"
847
908
  ></v-text-field>
848
909
  </v-col>
@@ -853,23 +914,36 @@
853
914
  <v-row no-gutters>
854
915
  <InputLabel
855
916
  class="text-capitalize"
856
- title="Barangay"
917
+ title="Province"
857
918
  required
858
919
  />
859
920
  <v-col cols="12">
860
- <v-text-field
861
- v-model="enrollment.address.permanent.barangay"
921
+ <v-combobox
922
+ v-model="enrollment.address.permanent.province"
862
923
  :rules="[requiredRule]"
863
924
  :readonly="sameAsCurrentAddress"
864
- ></v-text-field>
925
+ :items="permanentProvinces"
926
+ item-title="name"
927
+ item-value="code"
928
+ :return-object="false"
929
+ :hide-no-data="false"
930
+ :loading="loadingPermanentProvinces"
931
+ @keydown.enter="getPermanentCityMun()"
932
+ >
933
+ <template v-slot:no-data>
934
+ <v-list-item>
935
+ <v-list-item-title>
936
+ No results matching "<strong>search</strong>".
937
+ Press
938
+ <kbd>enter</kbd> to create a new one
939
+ </v-list-item-title>
940
+ </v-list-item>
941
+ </template>
942
+ </v-combobox>
865
943
  </v-col>
866
944
  </v-row>
867
945
  </v-col>
868
- </v-row>
869
- </v-col>
870
946
 
871
- <v-col cols="12">
872
- <v-row>
873
947
  <v-col cols="3">
874
948
  <v-row no-gutters>
875
949
  <InputLabel
@@ -882,10 +956,13 @@
882
956
  v-model="enrollment.address.permanent.municipalityCity"
883
957
  :rules="[requiredRule]"
884
958
  :readonly="sameAsCurrentAddress"
885
- :items="citiesMunicipalities"
959
+ :items="permanentCitiesMunicipalities"
886
960
  item-title="name"
887
- item-value="name"
961
+ item-value="code"
962
+ :return-object="false"
888
963
  :hide-no-data="false"
964
+ :disabled="!enrollment.address.permanent.province"
965
+ :loading="loadingPermanentCityMun"
889
966
  >
890
967
  <template v-slot:no-data>
891
968
  <v-list-item>
@@ -901,22 +978,44 @@
901
978
  </v-row>
902
979
  </v-col>
903
980
 
981
+ <v-col cols="2">
982
+ <v-row no-gutters>
983
+ <InputLabel class="text-capitalize" title="Zip Code" />
984
+ <v-col cols="12">
985
+ <v-text-field
986
+ v-model="enrollment.address.permanent.zipCode"
987
+ :readonly="sameAsCurrentAddress"
988
+ ></v-text-field>
989
+ </v-col>
990
+ </v-row>
991
+ </v-col>
992
+ </v-row>
993
+ </v-col>
994
+
995
+ <v-col cols="12">
996
+ <v-row>
904
997
  <v-col cols="3">
905
998
  <v-row no-gutters>
906
999
  <InputLabel
907
1000
  class="text-capitalize"
908
- title="Province"
1001
+ title="Barangay"
909
1002
  required
910
1003
  />
911
1004
  <v-col cols="12">
912
1005
  <v-combobox
913
- v-model="enrollment.address.permanent.province"
1006
+ v-model="enrollment.address.permanent.barangay"
914
1007
  :rules="[requiredRule]"
915
1008
  :readonly="sameAsCurrentAddress"
916
- :items="provinces"
1009
+ :items="permanentBarangays"
917
1010
  item-title="name"
918
- item-value="name"
1011
+ item-value="code"
1012
+ :return-object="false"
919
1013
  :hide-no-data="false"
1014
+ :disabled="
1015
+ !enrollment.address.permanent.municipalityCity ||
1016
+ sameAsCurrentAddress
1017
+ "
1018
+ :loading="loadingPermanentBarangay"
920
1019
  >
921
1020
  <template v-slot:no-data>
922
1021
  <v-list-item>
@@ -934,32 +1033,22 @@
934
1033
 
935
1034
  <v-col cols="3">
936
1035
  <v-row no-gutters>
937
- <InputLabel
938
- class="text-capitalize"
939
- title="Country"
940
- required
941
- />
1036
+ <InputLabel class="text-capitalize" title="Street" />
942
1037
  <v-col cols="12">
943
1038
  <v-text-field
944
- v-model="enrollment.address.permanent.country"
945
- :rules="[requiredRule]"
1039
+ v-model="enrollment.address.permanent.streetName"
946
1040
  :readonly="sameAsCurrentAddress"
947
1041
  ></v-text-field>
948
1042
  </v-col>
949
1043
  </v-row>
950
1044
  </v-col>
951
1045
 
952
- <v-col cols="2">
1046
+ <v-col cols="3">
953
1047
  <v-row no-gutters>
954
- <InputLabel
955
- class="text-capitalize"
956
- title="Zip Code"
957
- required
958
- />
1048
+ <InputLabel class="text-capitalize" title="House No." />
959
1049
  <v-col cols="12">
960
1050
  <v-text-field
961
- v-model="enrollment.address.permanent.zipCode"
962
- :rules="[requiredRule]"
1051
+ v-model="enrollment.address.permanent.houseNumber"
963
1052
  :readonly="sameAsCurrentAddress"
964
1053
  ></v-text-field>
965
1054
  </v-col>
@@ -988,15 +1077,10 @@
988
1077
  <v-row>
989
1078
  <v-col cols="3">
990
1079
  <v-row no-gutters>
991
- <InputLabel
992
- class="text-capitalize"
993
- title="Last Name"
994
- required
995
- />
1080
+ <InputLabel class="text-capitalize" title="Last Name" />
996
1081
  <v-col cols="12">
997
1082
  <v-text-field
998
1083
  v-model="enrollment.parentGuardianInfo.father.lastName"
999
- :rules="[requiredRule]"
1000
1084
  ></v-text-field>
1001
1085
  </v-col>
1002
1086
  </v-row>
@@ -1004,15 +1088,10 @@
1004
1088
 
1005
1089
  <v-col cols="3">
1006
1090
  <v-row no-gutters>
1007
- <InputLabel
1008
- class="text-capitalize"
1009
- title="First Name"
1010
- required
1011
- />
1091
+ <InputLabel class="text-capitalize" title="First Name" />
1012
1092
  <v-col cols="12">
1013
1093
  <v-text-field
1014
1094
  v-model="enrollment.parentGuardianInfo.father.firstName"
1015
- :rules="[requiredRule]"
1016
1095
  ></v-text-field>
1017
1096
  </v-col>
1018
1097
  </v-row>
@@ -1144,42 +1223,16 @@
1144
1223
  </span>
1145
1224
  </v-col>
1146
1225
 
1147
- <v-col cols="3">
1148
- <v-checkbox
1149
- v-model="fatherLegalGuardianSame"
1150
- label="Father is the Legal Guardian"
1151
- hide-details
1152
- density="compact"
1153
- ></v-checkbox>
1154
- </v-col>
1155
-
1156
- <v-col cols="3">
1157
- <v-checkbox
1158
- v-model="motherLegalGuardianSame"
1159
- label="Mother is the Legal Guardian"
1160
- hide-details
1161
- density="compact"
1162
- ></v-checkbox>
1163
- </v-col>
1164
-
1165
1226
  <v-col cols="12">
1166
1227
  <v-row>
1167
1228
  <v-col cols="3">
1168
1229
  <v-row no-gutters>
1169
- <InputLabel
1170
- class="text-capitalize"
1171
- title="Last Name"
1172
- required
1173
- />
1230
+ <InputLabel class="text-capitalize" title="Last Name" />
1174
1231
  <v-col cols="12">
1175
1232
  <v-text-field
1176
1233
  v-model="
1177
1234
  enrollment.parentGuardianInfo.legalGuardian.lastName
1178
1235
  "
1179
- :rules="[requiredRule]"
1180
- :readonly="
1181
- fatherLegalGuardianSame || motherLegalGuardianSame
1182
- "
1183
1236
  ></v-text-field>
1184
1237
  </v-col>
1185
1238
  </v-row>
@@ -1190,17 +1243,14 @@
1190
1243
  <InputLabel
1191
1244
  class="text-capitalize"
1192
1245
  title="First Name"
1193
- required
1246
+ :required="isGuardianRequired"
1194
1247
  />
1195
1248
  <v-col cols="12">
1196
1249
  <v-text-field
1197
1250
  v-model="
1198
1251
  enrollment.parentGuardianInfo.legalGuardian.firstName
1199
1252
  "
1200
- :rules="[requiredRule]"
1201
- :readonly="
1202
- fatherLegalGuardianSame || motherLegalGuardianSame
1203
- "
1253
+ :rules="isGuardianRequired ? [requiredRule] : []"
1204
1254
  ></v-text-field>
1205
1255
  </v-col>
1206
1256
  </v-row>
@@ -1214,9 +1264,6 @@
1214
1264
  v-model="
1215
1265
  enrollment.parentGuardianInfo.legalGuardian.middleName
1216
1266
  "
1217
- :readonly="
1218
- fatherLegalGuardianSame || motherLegalGuardianSame
1219
- "
1220
1267
  ></v-text-field>
1221
1268
  </v-col>
1222
1269
  </v-row>
@@ -1243,9 +1290,6 @@
1243
1290
  placeholder="09XX-XXX-XXXX"
1244
1291
  variant="outlined"
1245
1292
  density="comfortable"
1246
- :readonly="
1247
- fatherLegalGuardianSame || motherLegalGuardianSame
1248
- "
1249
1293
  ></v-mask-input>
1250
1294
  </v-col>
1251
1295
  </v-row>
@@ -1367,21 +1411,21 @@
1367
1411
  </v-col>
1368
1412
  </v-row>
1369
1413
  </v-col>
1370
- </v-row>
1371
- </v-col>
1372
1414
 
1373
- <v-col cols="8">
1374
- <v-row no-gutters>
1375
- <InputLabel
1376
- class="text-capitalize"
1377
- title="Last School Attended"
1378
- :required="!isKindergarten"
1379
- />
1380
- <v-col cols="12">
1381
- <v-text-field
1382
- v-model="enrollment.returningLearnerInfo.lastSchoolAttended"
1383
- :rules="isKindergarten ? [] : [requiredRule]"
1384
- ></v-text-field>
1415
+ <v-col cols="6">
1416
+ <v-row no-gutters>
1417
+ <InputLabel
1418
+ class="text-capitalize"
1419
+ title="Last School Attended"
1420
+ :required="!isKindergarten"
1421
+ />
1422
+ <v-col cols="12">
1423
+ <v-text-field
1424
+ v-model="enrollment.returningLearnerInfo.lastSchoolAttended"
1425
+ :rules="isKindergarten ? [] : [requiredRule]"
1426
+ ></v-text-field>
1427
+ </v-col>
1428
+ </v-row>
1385
1429
  </v-col>
1386
1430
  </v-row>
1387
1431
  </v-col>
@@ -1459,7 +1503,7 @@ const prop = defineProps({
1459
1503
  });
1460
1504
 
1461
1505
  import { VMaskInput } from "vuetify/labs/VMaskInput";
1462
- const { requiredRule } = useUtils();
1506
+ const { requiredRule, debounce } = useUtils();
1463
1507
 
1464
1508
  const enrollment = defineModel<TTLearner>({
1465
1509
  default: () => useEnrollment().enrollment,
@@ -1483,10 +1527,15 @@ if (!enrollment.value.address.permanent.country) {
1483
1527
  enrollment.value.address.permanent.country = "Philippines";
1484
1528
  }
1485
1529
 
1530
+ const isGuardianRequired = computed(
1531
+ () => !!enrollment.value.parentGuardianInfo.legalGuardian.lastName
1532
+ );
1533
+
1486
1534
  const { getAll: getAllPSGC } = usePSGC();
1487
1535
 
1488
1536
  const region = ref("");
1489
1537
  const regions = ref<Array<Record<string, any>>>([]);
1538
+ const selectCurrentRegion = computed(() => enrollment.value.region);
1490
1539
 
1491
1540
  const { data: getAllRegPSGCData, status: getAllRegionStatus } =
1492
1541
  await useLazyAsyncData("get-all-psgc-region", () =>
@@ -1504,12 +1553,25 @@ watchEffect(() => {
1504
1553
  const provinces = ref<Array<Record<string, any>>>([]);
1505
1554
  const province = ref("");
1506
1555
 
1556
+ const selectedProvince = computed(() => enrollment.value.province);
1557
+
1558
+ const selectCurrentProvince = computed(() =>
1559
+ provinces.value.find(
1560
+ (p) => p.name === enrollment.value.address.current.province
1561
+ )
1562
+ );
1563
+
1507
1564
  const { data: getAllPSGCProvData, status: getAllProvStatus } =
1508
1565
  await useLazyAsyncData(
1509
1566
  "get-all-psgc-provinces",
1510
- () => getAllPSGC({ type: "Prov", prefix: region.value.slice(0, 2) }),
1567
+ () =>
1568
+ getAllPSGC({
1569
+ type: "Prov",
1570
+ prefix: selectCurrentRegion.value.slice(0, 2),
1571
+ limit: 100,
1572
+ }),
1511
1573
  {
1512
- watch: [region],
1574
+ watch: [selectCurrentRegion],
1513
1575
  }
1514
1576
  );
1515
1577
 
@@ -1521,9 +1583,37 @@ watchEffect(() => {
1521
1583
  }
1522
1584
  });
1523
1585
 
1586
+ const currentProvinces = ref<Array<Record<string, any>>>([]);
1587
+
1588
+ const { data: dataCurrentProvinces, status: statusCurrentProvinces } =
1589
+ await useLazyAsyncData(
1590
+ "get-all-psgc-current-provinces",
1591
+ () =>
1592
+ getAllPSGC({
1593
+ type: "Prov",
1594
+ limit: 100,
1595
+ }),
1596
+ {
1597
+ watch: [selectCurrentRegion],
1598
+ }
1599
+ );
1600
+
1601
+ const loadingCurrentProvinces = computed(
1602
+ () => statusCurrentProvinces.value === "pending"
1603
+ );
1604
+
1605
+ watchEffect(() => {
1606
+ if (dataCurrentProvinces.value) {
1607
+ currentProvinces.value = dataCurrentProvinces.value.items;
1608
+ }
1609
+ });
1610
+
1524
1611
  const citiesMunicipalities = ref<Array<Record<string, any>>>([]);
1525
1612
  const cityMunicipality = ref("");
1526
1613
 
1614
+ // Flag to prevent cascade when clearing location fields programmatically
1615
+ const isLocationClearingSchool = ref(false);
1616
+
1527
1617
  watch(province, () => {
1528
1618
  cityMunicipality.value = "";
1529
1619
  });
@@ -1533,6 +1623,33 @@ watch(region, () => {
1533
1623
  cityMunicipality.value = "";
1534
1624
  });
1535
1625
 
1626
+ watch(
1627
+ () => enrollment.value.province,
1628
+ (val) => {
1629
+ if (!val) {
1630
+ enrollment.value.cityMunicipality = "";
1631
+ isLocationClearingSchool.value = true;
1632
+ enrollment.value.schoolId = "";
1633
+ nextTick(() => {
1634
+ isLocationClearingSchool.value = false;
1635
+ });
1636
+ }
1637
+ }
1638
+ );
1639
+
1640
+ watch(
1641
+ () => enrollment.value.cityMunicipality,
1642
+ (val) => {
1643
+ if (!val) {
1644
+ isLocationClearingSchool.value = true;
1645
+ enrollment.value.schoolId = "";
1646
+ nextTick(() => {
1647
+ isLocationClearingSchool.value = false;
1648
+ });
1649
+ }
1650
+ }
1651
+ );
1652
+
1536
1653
  const cityMunicipalityPrefix = computed(() => {
1537
1654
  let prefix = "";
1538
1655
  if (region.value) {
@@ -1552,11 +1669,11 @@ const { data: getAllPSGCCityMunData, status: getAllCityMunStatus } =
1552
1669
  () =>
1553
1670
  getAllPSGC({
1554
1671
  type: "City",
1555
- prefix: cityMunicipalityPrefix.value,
1672
+ prefix: selectedProvince.value.slice(0, 5),
1556
1673
  limit: 2000,
1557
1674
  }),
1558
1675
  {
1559
- watch: [cityMunicipalityPrefix],
1676
+ watch: [selectedProvince],
1560
1677
  }
1561
1678
  );
1562
1679
 
@@ -1570,6 +1687,268 @@ watchEffect(() => {
1570
1687
  }
1571
1688
  });
1572
1689
 
1690
+ const currentCitiesMunicipalities = ref<Array<Record<string, any>>>([]);
1691
+ const selectedCurrentProvince = computed(() => {
1692
+ return enrollment.value.address.current.province || "";
1693
+ });
1694
+
1695
+ const loadingCurrentCityMun = ref(false);
1696
+
1697
+ const getCurrentCityMun = debounce(async () => {
1698
+ if (!selectedCurrentProvince.value) {
1699
+ currentCitiesMunicipalities.value = [];
1700
+ return;
1701
+ }
1702
+
1703
+ try {
1704
+ loadingCurrentCityMun.value = true;
1705
+ const res = await getAllPSGC({
1706
+ type: "City",
1707
+ prefix: selectedCurrentProvince.value.slice(0, 5),
1708
+ limit: 2000,
1709
+ });
1710
+ currentCitiesMunicipalities.value = res.items;
1711
+ } catch (error) {
1712
+ currentCitiesMunicipalities.value = [];
1713
+ } finally {
1714
+ loadingCurrentCityMun.value = false;
1715
+ }
1716
+ }, 500);
1717
+
1718
+ watch(selectedCurrentProvince, () => {
1719
+ getCurrentCityMun();
1720
+ });
1721
+
1722
+ // Current Address - Barangays
1723
+ const currentBarangays = ref<Array<Record<string, any>>>([]);
1724
+ const selectedCurrentCityMun = computed(() => {
1725
+ return enrollment.value.address.current.municipalityCity || "";
1726
+ });
1727
+
1728
+ const loadingCurrentBarangay = ref(false);
1729
+
1730
+ const getCurrentBarangays = debounce(async () => {
1731
+ if (!selectedCurrentCityMun.value) {
1732
+ currentBarangays.value = [];
1733
+ return;
1734
+ }
1735
+
1736
+ try {
1737
+ loadingCurrentBarangay.value = true;
1738
+ const res = await getAllPSGC({
1739
+ type: "Bgy",
1740
+ prefix: selectedCurrentCityMun.value.slice(0, 7),
1741
+ limit: 200,
1742
+ });
1743
+ currentBarangays.value = res.items;
1744
+ } catch (error) {
1745
+ currentBarangays.value = [];
1746
+ } finally {
1747
+ loadingCurrentBarangay.value = false;
1748
+ }
1749
+ }, 500);
1750
+
1751
+ watch(selectedCurrentCityMun, () => {
1752
+ getCurrentBarangays();
1753
+ });
1754
+
1755
+ // Permanent Address - Province and City/Municipality
1756
+ const permanentProvinces = ref<Array<Record<string, any>>>([]);
1757
+
1758
+ const { data: dataPermanentProvinces, status: statusPermanentProvinces } =
1759
+ await useLazyAsyncData("get-all-psgc-permanent-provinces", () =>
1760
+ getAllPSGC({
1761
+ type: "Prov",
1762
+ limit: 100,
1763
+ })
1764
+ );
1765
+
1766
+ const loadingPermanentProvinces = computed(
1767
+ () => statusPermanentProvinces.value === "pending"
1768
+ );
1769
+
1770
+ watchEffect(() => {
1771
+ if (dataPermanentProvinces.value) {
1772
+ permanentProvinces.value = dataPermanentProvinces.value.items;
1773
+ }
1774
+ });
1775
+
1776
+ const permanentCitiesMunicipalities = ref<Array<Record<string, any>>>([]);
1777
+ const selectedPermanentProvince = computed(() => {
1778
+ return enrollment.value.address.permanent.province || "";
1779
+ });
1780
+
1781
+ const loadingPermanentCityMun = ref(false);
1782
+
1783
+ const getPermanentCityMun = debounce(async () => {
1784
+ if (!selectedPermanentProvince.value) {
1785
+ permanentCitiesMunicipalities.value = [];
1786
+ return;
1787
+ }
1788
+
1789
+ try {
1790
+ loadingPermanentCityMun.value = true;
1791
+ const res = await getAllPSGC({
1792
+ type: "City",
1793
+ prefix: selectedPermanentProvince.value.slice(0, 5),
1794
+ limit: 200,
1795
+ });
1796
+ permanentCitiesMunicipalities.value = res.items;
1797
+ } catch (error) {
1798
+ permanentCitiesMunicipalities.value = [];
1799
+ } finally {
1800
+ loadingPermanentCityMun.value = false;
1801
+ }
1802
+ }, 500);
1803
+
1804
+ watch(selectedPermanentProvince, () => {
1805
+ getPermanentCityMun();
1806
+ });
1807
+
1808
+ // Permanent Address - Barangays
1809
+ const permanentBarangays = ref<Array<Record<string, any>>>([]);
1810
+ const selectedPermanentCityMun = computed(() => {
1811
+ return enrollment.value.address.permanent.municipalityCity || "";
1812
+ });
1813
+
1814
+ const loadingPermanentBarangay = ref(false);
1815
+
1816
+ const getPermanentBarangays = debounce(async () => {
1817
+ if (!selectedPermanentCityMun.value) {
1818
+ permanentBarangays.value = [];
1819
+ return;
1820
+ }
1821
+
1822
+ try {
1823
+ loadingPermanentBarangay.value = true;
1824
+ const res = await getAllPSGC({
1825
+ type: "Bgy",
1826
+ prefix: selectedPermanentCityMun.value.slice(0, 7),
1827
+ limit: 200,
1828
+ });
1829
+ permanentBarangays.value = res.items;
1830
+ } catch (error) {
1831
+ permanentBarangays.value = [];
1832
+ } finally {
1833
+ loadingPermanentBarangay.value = false;
1834
+ }
1835
+ }, 500);
1836
+
1837
+ watch(selectedPermanentCityMun, () => {
1838
+ getPermanentBarangays();
1839
+ });
1840
+
1841
+ // Place of Birth - Province and City/Municipality
1842
+ const birthProvinces = ref<Array<Record<string, any>>>([]);
1843
+
1844
+ const { data: dataBirthProvinces, status: statusBirthProvinces } =
1845
+ await useLazyAsyncData("get-all-psgc-birth-provinces", () =>
1846
+ getAllPSGC({
1847
+ type: "Prov",
1848
+ limit: 100,
1849
+ })
1850
+ );
1851
+
1852
+ const loadingBirthProvinces = computed(
1853
+ () => statusBirthProvinces.value === "pending"
1854
+ );
1855
+
1856
+ watchEffect(() => {
1857
+ if (dataBirthProvinces.value) {
1858
+ birthProvinces.value = dataBirthProvinces.value.items;
1859
+ }
1860
+ });
1861
+
1862
+ const birthCitiesMunicipalities = ref<Array<Record<string, any>>>([]);
1863
+ const selectedBirthProvince = computed(() => {
1864
+ const province = birthProvinces.value.find(
1865
+ (p) => p.code === enrollment.value.learnerInfo.placeOfBirth.province
1866
+ );
1867
+
1868
+ if (!province) {
1869
+ return "";
1870
+ }
1871
+
1872
+ return province.code;
1873
+ });
1874
+
1875
+ const loadingBirthCityMun = ref(false);
1876
+
1877
+ const getBirthCityMun = debounce(async () => {
1878
+ if (!selectedBirthProvince.value) {
1879
+ birthCitiesMunicipalities.value = [];
1880
+ return;
1881
+ }
1882
+
1883
+ try {
1884
+ loadingBirthCityMun.value = true;
1885
+ const res = await getAllPSGC({
1886
+ type: "City",
1887
+ prefix: selectedBirthProvince.value.slice(0, 5),
1888
+ limit: 2000,
1889
+ });
1890
+ birthCitiesMunicipalities.value = res.items;
1891
+ } catch (error) {
1892
+ birthCitiesMunicipalities.value = [];
1893
+ } finally {
1894
+ loadingBirthCityMun.value = false;
1895
+ }
1896
+ }, 500);
1897
+
1898
+ watch(selectedBirthProvince, () => {
1899
+ getBirthCityMun();
1900
+ });
1901
+
1902
+ // Auto-fill place of birth region and region name when province is selected
1903
+ watch(
1904
+ () => enrollment.value.learnerInfo.placeOfBirth.province,
1905
+ (provinceCode) => {
1906
+ if (!provinceCode) {
1907
+ enrollment.value.learnerInfo.placeOfBirth.region = "";
1908
+ enrollment.value.learnerInfo.placeOfBirth.regionName = "";
1909
+ enrollment.value.learnerInfo.placeOfBirth.provinceName = "";
1910
+ enrollment.value.learnerInfo.placeOfBirth.cityMunicipality = "";
1911
+ enrollment.value.learnerInfo.placeOfBirth.cityMunicipalityName = "";
1912
+ return;
1913
+ }
1914
+
1915
+ const province = birthProvinces.value.find((p) => p.code === provinceCode);
1916
+ if (province) {
1917
+ // Set province name
1918
+ enrollment.value.learnerInfo.placeOfBirth.provinceName = province.name;
1919
+
1920
+ // Get region code from province code (first 2 digits + zeros)
1921
+ const regionCode = province.code.slice(0, 2) + "00000000";
1922
+ enrollment.value.learnerInfo.placeOfBirth.region = regionCode;
1923
+
1924
+ // Find and set region name
1925
+ const region = regions.value.find((r) => r.code === regionCode);
1926
+ if (region) {
1927
+ enrollment.value.learnerInfo.placeOfBirth.regionName = region.name;
1928
+ }
1929
+ }
1930
+ }
1931
+ );
1932
+
1933
+ // Auto-fill place of birth city/municipality name when selected
1934
+ watch(
1935
+ () => enrollment.value.learnerInfo.placeOfBirth.cityMunicipality,
1936
+ (cityMunCode) => {
1937
+ if (!cityMunCode) {
1938
+ enrollment.value.learnerInfo.placeOfBirth.cityMunicipalityName = "";
1939
+ return;
1940
+ }
1941
+
1942
+ const cityMun = birthCitiesMunicipalities.value.find(
1943
+ (c) => c.code === cityMunCode
1944
+ );
1945
+ if (cityMun) {
1946
+ enrollment.value.learnerInfo.placeOfBirth.cityMunicipalityName =
1947
+ cityMun.name;
1948
+ }
1949
+ }
1950
+ );
1951
+
1573
1952
  const { getAll } = useProgram();
1574
1953
 
1575
1954
  const programs = ref<Array<Record<string, any>>>([]);
@@ -1687,6 +2066,17 @@ const selectedSchool = computed(() => enrollment.value.schoolId);
1687
2066
 
1688
2067
  watch(selectedSchool, (val) => {
1689
2068
  enrollment.value.gradeLevel = "";
2069
+
2070
+ // Clear region, province, and cityMunicipality when schoolId is removed by user (not programmatically)
2071
+ if (!val) {
2072
+ if (!isLocationClearingSchool.value) {
2073
+ enrollment.value.region = "";
2074
+ enrollment.value.province = "";
2075
+ enrollment.value.cityMunicipality = "";
2076
+ }
2077
+ return;
2078
+ }
2079
+
1690
2080
  const school = schools.value.find((s) => s.id === val);
1691
2081
 
1692
2082
  if (school?.name) {
@@ -1696,16 +2086,11 @@ watch(selectedSchool, (val) => {
1696
2086
 
1697
2087
  enrollment.value.cityMunicipality = school?.cityMunicipalityPSGC ?? "";
1698
2088
 
1699
- if (school?.province) {
1700
- enrollment.value.province = school?.province;
1701
- }
1702
-
1703
- const regionPSGC = school?.cityMunicipalityPSGC
1704
- ? school?.cityMunicipalityPSGC.slice(0, 2) + "00000000"
1705
- : "";
1706
-
1707
- if (school?.region && regionPSGC) {
1708
- enrollment.value.region = regionPSGC;
2089
+ if (school && school.cityMunicipalityPSGC) {
2090
+ enrollment.value.province =
2091
+ school.cityMunicipalityPSGC.slice(0, 5) + "00000";
2092
+ enrollment.value.region =
2093
+ school.cityMunicipalityPSGC.slice(0, 2) + "00000000";
1709
2094
  }
1710
2095
 
1711
2096
  if (school?.regionName) {
@@ -1808,11 +2193,16 @@ const allowedLastGradeLevels = computed(() => {
1808
2193
  const currentIndex = gradeOrder.indexOf(currentGrade);
1809
2194
  if (currentIndex === -1) return gradeLevels;
1810
2195
 
2196
+ // Special case for grade-1: include both kindergarten and kinder
2197
+ let startIndex;
2198
+ if (currentGrade === "grade-1") {
2199
+ startIndex = 0; // Include from kindergarten
2200
+ } else {
2201
+ startIndex = Math.max(0, currentIndex - 1);
2202
+ }
2203
+
1811
2204
  // Get grades that are equal to or one level below current grade
1812
- const allowedGrades = gradeOrder.slice(
1813
- Math.max(0, currentIndex - 1),
1814
- currentIndex + 1
1815
- );
2205
+ const allowedGrades = gradeOrder.slice(startIndex, currentIndex + 1);
1816
2206
 
1817
2207
  // Filter gradeLevels to only include allowed grades
1818
2208
  return gradeLevels.filter((level) => {
@@ -1898,8 +2288,6 @@ const indigenousCommunitiesPhilippines = [
1898
2288
  ];
1899
2289
 
1900
2290
  const sameAsCurrentAddress = ref(false);
1901
- const fatherLegalGuardianSame = ref(false);
1902
- const motherLegalGuardianSame = ref(false);
1903
2291
 
1904
2292
  const alternativeLearning = [
1905
2293
  "Modular (Print)",
@@ -1921,7 +2309,12 @@ watch(enrollment, (val) => {
1921
2309
  enrollment.value.learnerInfo.lastName = "";
1922
2310
  enrollment.value.learnerInfo.extensionName = "";
1923
2311
  enrollment.value.learnerInfo.birthDate = "";
1924
- enrollment.value.learnerInfo.placeOfBirth = "";
2312
+ enrollment.value.learnerInfo.placeOfBirth.region = "";
2313
+ enrollment.value.learnerInfo.placeOfBirth.regionName = "";
2314
+ enrollment.value.learnerInfo.placeOfBirth.province = "";
2315
+ enrollment.value.learnerInfo.placeOfBirth.provinceName = "";
2316
+ enrollment.value.learnerInfo.placeOfBirth.cityMunicipality = "";
2317
+ enrollment.value.learnerInfo.placeOfBirth.cityMunicipalityName = "";
1925
2318
  enrollment.value.learnerInfo.sex = "";
1926
2319
  enrollment.value.learnerInfo.motherTongue = "";
1927
2320
  enrollment.value.learnerInfo.age = 0;
@@ -1990,44 +2383,6 @@ watchEffect(() => {
1990
2383
  }
1991
2384
  });
1992
2385
 
1993
- watchEffect(() => {
1994
- if (fatherLegalGuardianSame.value) {
1995
- enrollment.value.parentGuardianInfo.legalGuardian.firstName =
1996
- enrollment.value.parentGuardianInfo.father.firstName;
1997
- enrollment.value.parentGuardianInfo.legalGuardian.lastName =
1998
- enrollment.value.parentGuardianInfo.father.lastName;
1999
- enrollment.value.parentGuardianInfo.legalGuardian.middleName =
2000
- enrollment.value.parentGuardianInfo.father.middleName;
2001
- enrollment.value.parentGuardianInfo.legalGuardian.contactNumber =
2002
- enrollment.value.parentGuardianInfo.father.contactNumber;
2003
- motherLegalGuardianSame.value = false;
2004
- } else {
2005
- enrollment.value.parentGuardianInfo.legalGuardian.firstName = "";
2006
- enrollment.value.parentGuardianInfo.legalGuardian.lastName = "";
2007
- enrollment.value.parentGuardianInfo.legalGuardian.middleName = "";
2008
- enrollment.value.parentGuardianInfo.legalGuardian.contactNumber = "";
2009
- }
2010
- });
2011
-
2012
- watchEffect(() => {
2013
- if (motherLegalGuardianSame.value) {
2014
- enrollment.value.parentGuardianInfo.legalGuardian.firstName =
2015
- enrollment.value.parentGuardianInfo.mother.firstName;
2016
- enrollment.value.parentGuardianInfo.legalGuardian.lastName =
2017
- enrollment.value.parentGuardianInfo.mother.lastName;
2018
- enrollment.value.parentGuardianInfo.legalGuardian.middleName =
2019
- enrollment.value.parentGuardianInfo.mother.middleName;
2020
- enrollment.value.parentGuardianInfo.legalGuardian.contactNumber =
2021
- enrollment.value.parentGuardianInfo.mother.contactNumber;
2022
- fatherLegalGuardianSame.value = false;
2023
- } else {
2024
- enrollment.value.parentGuardianInfo.legalGuardian.firstName = "";
2025
- enrollment.value.parentGuardianInfo.legalGuardian.lastName = "";
2026
- enrollment.value.parentGuardianInfo.legalGuardian.middleName = "";
2027
- enrollment.value.parentGuardianInfo.legalGuardian.contactNumber = "";
2028
- }
2029
- });
2030
-
2031
2386
  import { useMask } from "vuetify";
2032
2387
 
2033
2388
  watchEffect(() => {