@eeplatform/nuxt-layer-common 1.7.30 → 1.7.32
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/EnrollmentForm.vue +351 -203
- package/composables/useBasicEdu.ts +9 -0
- package/composables/useEnrollment.ts +5 -0
- package/composables/useProgram.ts +1 -0
- package/package.json +1 -1
- package/types/enrollment.d.ts +3 -0
- package/types/program.d.ts +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @eeplatform/nuxt-layer-common
|
|
2
2
|
|
|
3
|
+
## 1.7.32
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 9403626: Set track/strand names and update autocompletes
|
|
8
|
+
|
|
9
|
+
## 1.7.31
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- b19de01: Fix enrollment form address
|
|
14
|
+
|
|
3
15
|
## 1.7.30
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
</v-row>
|
|
117
117
|
</v-col>
|
|
118
118
|
|
|
119
|
-
<v-col cols="
|
|
119
|
+
<v-col cols="3" class="pb-0">
|
|
120
120
|
<v-row no-gutters>
|
|
121
121
|
<InputLabel class="text-capitalize" title="Grade Level" required />
|
|
122
122
|
<v-col cols="12">
|
|
@@ -167,6 +167,28 @@
|
|
|
167
167
|
</v-row>
|
|
168
168
|
</v-col>
|
|
169
169
|
|
|
170
|
+
<v-col
|
|
171
|
+
v-if="
|
|
172
|
+
enrollment.specialProgram && selectedProgram.majors.length
|
|
173
|
+
"
|
|
174
|
+
cols="12"
|
|
175
|
+
>
|
|
176
|
+
<v-row no-gutters>
|
|
177
|
+
<InputLabel
|
|
178
|
+
class="text-capitalize"
|
|
179
|
+
title="Major"
|
|
180
|
+
required
|
|
181
|
+
/>
|
|
182
|
+
<v-col cols="12">
|
|
183
|
+
<v-autocomplete
|
|
184
|
+
v-model="enrollment.specialProgramMajor"
|
|
185
|
+
:rules="[requiredRule]"
|
|
186
|
+
:items="selectedProgram.majors"
|
|
187
|
+
></v-autocomplete>
|
|
188
|
+
</v-col>
|
|
189
|
+
</v-row>
|
|
190
|
+
</v-col>
|
|
191
|
+
|
|
170
192
|
<v-col
|
|
171
193
|
v-if="enrollment.specialProgram && selectedProgram.gwa"
|
|
172
194
|
cols="12"
|
|
@@ -402,83 +424,35 @@
|
|
|
402
424
|
|
|
403
425
|
<v-col cols="12" class="mt-4">
|
|
404
426
|
<v-row>
|
|
405
|
-
<v-col cols="
|
|
427
|
+
<v-col cols="3">
|
|
406
428
|
<v-row no-gutters>
|
|
429
|
+
<InputLabel
|
|
430
|
+
class="text-capitalize"
|
|
431
|
+
title="Place of Birth(Municipality/City)"
|
|
432
|
+
required
|
|
433
|
+
/>
|
|
407
434
|
<v-col cols="12">
|
|
408
|
-
<
|
|
409
|
-
|
|
410
|
-
|
|
435
|
+
<v-combobox
|
|
436
|
+
v-model="
|
|
437
|
+
enrollment.learnerInfo.placeOfBirth.cityMunicipality
|
|
438
|
+
"
|
|
439
|
+
:rules="[requiredRule]"
|
|
440
|
+
:items="birthCitiesMunicipalities"
|
|
441
|
+
item-title="name"
|
|
442
|
+
item-value="code"
|
|
443
|
+
:return-object="false"
|
|
444
|
+
:hide-no-data="false"
|
|
445
|
+
:loading="loadingBirthCityMun"
|
|
446
|
+
>
|
|
447
|
+
<template v-slot:no-data>
|
|
448
|
+
<v-list-item>
|
|
449
|
+
<v-list-item-title>
|
|
450
|
+
No results found. Press <kbd>enter</kbd> to search
|
|
451
|
+
</v-list-item-title>
|
|
452
|
+
</v-list-item>
|
|
453
|
+
</template>
|
|
454
|
+
</v-combobox>
|
|
411
455
|
</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>
|
|
482
456
|
</v-row>
|
|
483
457
|
</v-col>
|
|
484
458
|
</v-row>
|
|
@@ -736,22 +710,16 @@
|
|
|
736
710
|
|
|
737
711
|
<v-col cols="3">
|
|
738
712
|
<v-row no-gutters>
|
|
739
|
-
<InputLabel
|
|
740
|
-
class="text-capitalize"
|
|
741
|
-
title="Province"
|
|
742
|
-
required
|
|
743
|
-
/>
|
|
713
|
+
<InputLabel class="text-capitalize" title="Province" />
|
|
744
714
|
<v-col cols="12">
|
|
745
715
|
<v-combobox
|
|
746
716
|
v-model="enrollment.address.current.province"
|
|
747
|
-
:rules="[requiredRule]"
|
|
748
717
|
:items="currentProvinces"
|
|
749
718
|
item-title="name"
|
|
750
719
|
item-value="code"
|
|
751
720
|
:return-object="false"
|
|
752
721
|
:hide-no-data="false"
|
|
753
722
|
:loading="loadingCurrentProvinces"
|
|
754
|
-
@keydown.enter="getCurrentCityMun()"
|
|
755
723
|
>
|
|
756
724
|
<template v-slot:no-data>
|
|
757
725
|
<v-list-item>
|
|
@@ -783,7 +751,6 @@
|
|
|
783
751
|
item-value="code"
|
|
784
752
|
:return-object="false"
|
|
785
753
|
:hide-no-data="false"
|
|
786
|
-
:disabled="!enrollment.address.current.province"
|
|
787
754
|
:loading="loadingCurrentCityMun"
|
|
788
755
|
>
|
|
789
756
|
<template v-slot:no-data>
|
|
@@ -912,15 +879,10 @@
|
|
|
912
879
|
|
|
913
880
|
<v-col cols="3">
|
|
914
881
|
<v-row no-gutters>
|
|
915
|
-
<InputLabel
|
|
916
|
-
class="text-capitalize"
|
|
917
|
-
title="Province"
|
|
918
|
-
required
|
|
919
|
-
/>
|
|
882
|
+
<InputLabel class="text-capitalize" title="Province" />
|
|
920
883
|
<v-col cols="12">
|
|
921
884
|
<v-combobox
|
|
922
885
|
v-model="enrollment.address.permanent.province"
|
|
923
|
-
:rules="[requiredRule]"
|
|
924
886
|
:readonly="sameAsCurrentAddress"
|
|
925
887
|
:items="permanentProvinces"
|
|
926
888
|
item-title="name"
|
|
@@ -928,7 +890,7 @@
|
|
|
928
890
|
:return-object="false"
|
|
929
891
|
:hide-no-data="false"
|
|
930
892
|
:loading="loadingPermanentProvinces"
|
|
931
|
-
|
|
893
|
+
:disabled="sameAsCurrentAddress"
|
|
932
894
|
>
|
|
933
895
|
<template v-slot:no-data>
|
|
934
896
|
<v-list-item>
|
|
@@ -961,7 +923,7 @@
|
|
|
961
923
|
item-value="code"
|
|
962
924
|
:return-object="false"
|
|
963
925
|
:hide-no-data="false"
|
|
964
|
-
:disabled="
|
|
926
|
+
:disabled="sameAsCurrentAddress"
|
|
965
927
|
:loading="loadingPermanentCityMun"
|
|
966
928
|
>
|
|
967
929
|
<template v-slot:no-data>
|
|
@@ -1340,6 +1302,9 @@
|
|
|
1340
1302
|
<v-col cols="12">
|
|
1341
1303
|
<v-autocomplete
|
|
1342
1304
|
v-model="enrollment.seniorHighInfo.track"
|
|
1305
|
+
item-title="title"
|
|
1306
|
+
item-value="value"
|
|
1307
|
+
:return-object="false"
|
|
1343
1308
|
:items="tracks"
|
|
1344
1309
|
></v-autocomplete>
|
|
1345
1310
|
</v-col>
|
|
@@ -1356,6 +1321,9 @@
|
|
|
1356
1321
|
<v-col cols="12">
|
|
1357
1322
|
<v-autocomplete
|
|
1358
1323
|
v-model="enrollment.seniorHighInfo.strand"
|
|
1324
|
+
item-title="title"
|
|
1325
|
+
item-value="value"
|
|
1326
|
+
:return-object="false"
|
|
1359
1327
|
:items="selectedTrackStrands"
|
|
1360
1328
|
></v-autocomplete>
|
|
1361
1329
|
</v-col>
|
|
@@ -1688,26 +1656,26 @@ watchEffect(() => {
|
|
|
1688
1656
|
});
|
|
1689
1657
|
|
|
1690
1658
|
const currentCitiesMunicipalities = ref<Array<Record<string, any>>>([]);
|
|
1691
|
-
const selectedCurrentProvince = computed(() => {
|
|
1692
|
-
return enrollment.value.address.current.province || "";
|
|
1693
|
-
});
|
|
1694
1659
|
|
|
1695
1660
|
const loadingCurrentCityMun = ref(false);
|
|
1696
1661
|
|
|
1697
1662
|
const getCurrentCityMun = debounce(async () => {
|
|
1698
|
-
if (!selectedCurrentProvince.value) {
|
|
1699
|
-
currentCitiesMunicipalities.value = [];
|
|
1700
|
-
return;
|
|
1701
|
-
}
|
|
1702
|
-
|
|
1703
1663
|
try {
|
|
1704
1664
|
loadingCurrentCityMun.value = true;
|
|
1705
1665
|
const res = await getAllPSGC({
|
|
1706
1666
|
type: "City",
|
|
1707
|
-
prefix:
|
|
1708
|
-
|
|
1667
|
+
prefix: enrollment.value.address.current.province
|
|
1668
|
+
? enrollment.value.address.current.province.slice(0, 5)
|
|
1669
|
+
: "",
|
|
1670
|
+
limit: 1700,
|
|
1709
1671
|
});
|
|
1710
|
-
|
|
1672
|
+
|
|
1673
|
+
currentCitiesMunicipalities.value = res.items.map((i: any) => ({
|
|
1674
|
+
...i,
|
|
1675
|
+
props: {
|
|
1676
|
+
subtitle: `${i.region}${i.province ? ` - ${i.province}` : ""}`,
|
|
1677
|
+
},
|
|
1678
|
+
}));
|
|
1711
1679
|
} catch (error) {
|
|
1712
1680
|
currentCitiesMunicipalities.value = [];
|
|
1713
1681
|
} finally {
|
|
@@ -1715,9 +1683,14 @@ const getCurrentCityMun = debounce(async () => {
|
|
|
1715
1683
|
}
|
|
1716
1684
|
}, 500);
|
|
1717
1685
|
|
|
1718
|
-
watch(
|
|
1719
|
-
|
|
1720
|
-
|
|
1686
|
+
watch(
|
|
1687
|
+
() => enrollment.value.address.current.province,
|
|
1688
|
+
() => {
|
|
1689
|
+
getCurrentCityMun();
|
|
1690
|
+
}
|
|
1691
|
+
);
|
|
1692
|
+
|
|
1693
|
+
getCurrentCityMun();
|
|
1721
1694
|
|
|
1722
1695
|
// Current Address - Barangays
|
|
1723
1696
|
const currentBarangays = ref<Array<Record<string, any>>>([]);
|
|
@@ -1738,7 +1711,7 @@ const getCurrentBarangays = debounce(async () => {
|
|
|
1738
1711
|
const res = await getAllPSGC({
|
|
1739
1712
|
type: "Bgy",
|
|
1740
1713
|
prefix: selectedCurrentCityMun.value.slice(0, 7),
|
|
1741
|
-
limit:
|
|
1714
|
+
limit: 1000,
|
|
1742
1715
|
});
|
|
1743
1716
|
currentBarangays.value = res.items;
|
|
1744
1717
|
} catch (error) {
|
|
@@ -1774,26 +1747,26 @@ watchEffect(() => {
|
|
|
1774
1747
|
});
|
|
1775
1748
|
|
|
1776
1749
|
const permanentCitiesMunicipalities = ref<Array<Record<string, any>>>([]);
|
|
1777
|
-
const selectedPermanentProvince = computed(() => {
|
|
1778
|
-
return enrollment.value.address.permanent.province || "";
|
|
1779
|
-
});
|
|
1780
1750
|
|
|
1781
1751
|
const loadingPermanentCityMun = ref(false);
|
|
1782
1752
|
|
|
1783
1753
|
const getPermanentCityMun = debounce(async () => {
|
|
1784
|
-
if (!selectedPermanentProvince.value) {
|
|
1785
|
-
permanentCitiesMunicipalities.value = [];
|
|
1786
|
-
return;
|
|
1787
|
-
}
|
|
1788
|
-
|
|
1789
1754
|
try {
|
|
1790
1755
|
loadingPermanentCityMun.value = true;
|
|
1791
1756
|
const res = await getAllPSGC({
|
|
1792
1757
|
type: "City",
|
|
1793
|
-
prefix:
|
|
1794
|
-
|
|
1758
|
+
prefix: enrollment.value.address.permanent.province
|
|
1759
|
+
? enrollment.value.address.permanent.province.slice(0, 5)
|
|
1760
|
+
: "",
|
|
1761
|
+
limit: 1700,
|
|
1795
1762
|
});
|
|
1796
|
-
|
|
1763
|
+
|
|
1764
|
+
permanentCitiesMunicipalities.value = res.items.map((i: any) => ({
|
|
1765
|
+
...i,
|
|
1766
|
+
props: {
|
|
1767
|
+
subtitle: `${i.region}${i.province ? ` - ${i.province}` : ""}`,
|
|
1768
|
+
},
|
|
1769
|
+
}));
|
|
1797
1770
|
} catch (error) {
|
|
1798
1771
|
permanentCitiesMunicipalities.value = [];
|
|
1799
1772
|
} finally {
|
|
@@ -1801,9 +1774,14 @@ const getPermanentCityMun = debounce(async () => {
|
|
|
1801
1774
|
}
|
|
1802
1775
|
}, 500);
|
|
1803
1776
|
|
|
1804
|
-
watch(
|
|
1805
|
-
|
|
1806
|
-
|
|
1777
|
+
watch(
|
|
1778
|
+
() => enrollment.value.address.permanent.province,
|
|
1779
|
+
() => {
|
|
1780
|
+
getPermanentCityMun();
|
|
1781
|
+
}
|
|
1782
|
+
);
|
|
1783
|
+
|
|
1784
|
+
getPermanentCityMun();
|
|
1807
1785
|
|
|
1808
1786
|
// Permanent Address - Barangays
|
|
1809
1787
|
const permanentBarangays = ref<Array<Record<string, any>>>([]);
|
|
@@ -1824,7 +1802,7 @@ const getPermanentBarangays = debounce(async () => {
|
|
|
1824
1802
|
const res = await getAllPSGC({
|
|
1825
1803
|
type: "Bgy",
|
|
1826
1804
|
prefix: selectedPermanentCityMun.value.slice(0, 7),
|
|
1827
|
-
limit:
|
|
1805
|
+
limit: 1000,
|
|
1828
1806
|
});
|
|
1829
1807
|
permanentBarangays.value = res.items;
|
|
1830
1808
|
} catch (error) {
|
|
@@ -1838,56 +1816,24 @@ watch(selectedPermanentCityMun, () => {
|
|
|
1838
1816
|
getPermanentBarangays();
|
|
1839
1817
|
});
|
|
1840
1818
|
|
|
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
1819
|
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
1820
|
|
|
1875
1821
|
const loadingBirthCityMun = ref(false);
|
|
1876
1822
|
|
|
1877
1823
|
const getBirthCityMun = debounce(async () => {
|
|
1878
|
-
if (!selectedBirthProvince.value) {
|
|
1879
|
-
birthCitiesMunicipalities.value = [];
|
|
1880
|
-
return;
|
|
1881
|
-
}
|
|
1882
|
-
|
|
1883
1824
|
try {
|
|
1884
1825
|
loadingBirthCityMun.value = true;
|
|
1885
1826
|
const res = await getAllPSGC({
|
|
1886
1827
|
type: "City",
|
|
1887
|
-
|
|
1888
|
-
limit: 2000,
|
|
1828
|
+
limit: 1700,
|
|
1889
1829
|
});
|
|
1890
|
-
|
|
1830
|
+
|
|
1831
|
+
birthCitiesMunicipalities.value = res.items.map((i: any) => ({
|
|
1832
|
+
...i,
|
|
1833
|
+
props: {
|
|
1834
|
+
subtitle: `${i.region}${i.province ? ` - ${i.province}` : ""}`,
|
|
1835
|
+
},
|
|
1836
|
+
}));
|
|
1891
1837
|
} catch (error) {
|
|
1892
1838
|
birthCitiesMunicipalities.value = [];
|
|
1893
1839
|
} finally {
|
|
@@ -1895,61 +1841,216 @@ const getBirthCityMun = debounce(async () => {
|
|
|
1895
1841
|
}
|
|
1896
1842
|
}, 500);
|
|
1897
1843
|
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1844
|
+
getBirthCityMun();
|
|
1845
|
+
|
|
1846
|
+
// Auto-fill place of birth city/municipality name when selected
|
|
1847
|
+
watch(
|
|
1848
|
+
() => enrollment.value.learnerInfo.placeOfBirth.cityMunicipality,
|
|
1849
|
+
(cityMunCode) => {
|
|
1850
|
+
if (!cityMunCode) {
|
|
1851
|
+
enrollment.value.learnerInfo.placeOfBirth.cityMunicipalityName = "";
|
|
1852
|
+
return;
|
|
1853
|
+
}
|
|
1854
|
+
|
|
1855
|
+
const cityMun = birthCitiesMunicipalities.value.find(
|
|
1856
|
+
(c) => c.code === cityMunCode
|
|
1857
|
+
);
|
|
1858
|
+
if (cityMun) {
|
|
1859
|
+
enrollment.value.learnerInfo.placeOfBirth.cityMunicipalityName =
|
|
1860
|
+
cityMun.name;
|
|
1861
|
+
enrollment.value.learnerInfo.placeOfBirth.province = cityMun.province
|
|
1862
|
+
? cityMun.code.slice(0, 5) + "00000"
|
|
1863
|
+
: "";
|
|
1864
|
+
enrollment.value.learnerInfo.placeOfBirth.provinceName =
|
|
1865
|
+
cityMun.province ?? "";
|
|
1866
|
+
enrollment.value.learnerInfo.placeOfBirth.region =
|
|
1867
|
+
cityMun.code.slice(0, 2) + "00000000";
|
|
1868
|
+
enrollment.value.learnerInfo.placeOfBirth.regionName = cityMun.region;
|
|
1869
|
+
}
|
|
1870
|
+
}
|
|
1871
|
+
);
|
|
1901
1872
|
|
|
1902
|
-
// Auto-fill
|
|
1873
|
+
// Auto-fill current address province name when province is selected
|
|
1903
1874
|
watch(
|
|
1904
|
-
() => enrollment.value.
|
|
1875
|
+
() => enrollment.value.address.current.province,
|
|
1905
1876
|
(provinceCode) => {
|
|
1906
1877
|
if (!provinceCode) {
|
|
1907
|
-
enrollment.value.
|
|
1908
|
-
enrollment.value.
|
|
1909
|
-
enrollment.value.
|
|
1910
|
-
enrollment.value.
|
|
1911
|
-
enrollment.value.
|
|
1878
|
+
enrollment.value.address.current.provinceName = "";
|
|
1879
|
+
enrollment.value.address.current.municipalityCity = "";
|
|
1880
|
+
enrollment.value.address.current.municipalityCityName = "";
|
|
1881
|
+
enrollment.value.address.current.barangay = "";
|
|
1882
|
+
enrollment.value.address.current.barangayName = "";
|
|
1883
|
+
enrollment.value.address.current.streetName = "";
|
|
1884
|
+
enrollment.value.address.current.houseNumber = "";
|
|
1912
1885
|
return;
|
|
1913
1886
|
}
|
|
1914
1887
|
|
|
1915
|
-
|
|
1888
|
+
// Clear dependent fields when province changes
|
|
1889
|
+
enrollment.value.address.current.municipalityCity = "";
|
|
1890
|
+
enrollment.value.address.current.municipalityCityName = "";
|
|
1891
|
+
enrollment.value.address.current.barangay = "";
|
|
1892
|
+
enrollment.value.address.current.barangayName = "";
|
|
1893
|
+
enrollment.value.address.current.streetName = "";
|
|
1894
|
+
enrollment.value.address.current.houseNumber = "";
|
|
1895
|
+
|
|
1896
|
+
const province = currentProvinces.value.find(
|
|
1897
|
+
(p) => p.code === provinceCode
|
|
1898
|
+
);
|
|
1916
1899
|
if (province) {
|
|
1917
|
-
|
|
1918
|
-
|
|
1900
|
+
enrollment.value.address.current.provinceName = province.name;
|
|
1901
|
+
}
|
|
1902
|
+
}
|
|
1903
|
+
);
|
|
1919
1904
|
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1905
|
+
// Auto-fill current address city/municipality, province, and region when selected
|
|
1906
|
+
watch(
|
|
1907
|
+
() => enrollment.value.address.current.municipalityCity,
|
|
1908
|
+
(cityMunCode) => {
|
|
1909
|
+
if (!cityMunCode) {
|
|
1910
|
+
enrollment.value.address.current.municipalityCityName = "";
|
|
1911
|
+
enrollment.value.address.current.barangay = "";
|
|
1912
|
+
enrollment.value.address.current.barangayName = "";
|
|
1913
|
+
enrollment.value.address.current.streetName = "";
|
|
1914
|
+
enrollment.value.address.current.houseNumber = "";
|
|
1915
|
+
return;
|
|
1916
|
+
}
|
|
1923
1917
|
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1918
|
+
// Clear dependent fields when city/municipality changes
|
|
1919
|
+
enrollment.value.address.current.barangay = "";
|
|
1920
|
+
enrollment.value.address.current.barangayName = "";
|
|
1921
|
+
enrollment.value.address.current.streetName = "";
|
|
1922
|
+
enrollment.value.address.current.houseNumber = "";
|
|
1923
|
+
|
|
1924
|
+
const cityMun = currentCitiesMunicipalities.value.find(
|
|
1925
|
+
(c) => c.code === cityMunCode
|
|
1926
|
+
);
|
|
1927
|
+
if (cityMun) {
|
|
1928
|
+
enrollment.value.address.current.municipalityCityName = cityMun.name;
|
|
1929
|
+
enrollment.value.address.current.province = cityMun.province
|
|
1930
|
+
? cityMun.code.slice(0, 5) + "00000"
|
|
1931
|
+
: "";
|
|
1932
|
+
enrollment.value.address.current.provinceName = cityMun.province ?? "";
|
|
1933
|
+
enrollment.value.address.current.region =
|
|
1934
|
+
cityMun.code.slice(0, 2) + "00000000";
|
|
1935
|
+
enrollment.value.address.current.regionName = cityMun.region;
|
|
1929
1936
|
}
|
|
1930
1937
|
}
|
|
1931
1938
|
);
|
|
1932
1939
|
|
|
1933
|
-
// Auto-fill
|
|
1940
|
+
// Auto-fill current address barangay name when selected
|
|
1934
1941
|
watch(
|
|
1935
|
-
() => enrollment.value.
|
|
1942
|
+
() => enrollment.value.address.current.barangay,
|
|
1943
|
+
(barangayCode) => {
|
|
1944
|
+
if (!barangayCode) {
|
|
1945
|
+
enrollment.value.address.current.barangayName = "";
|
|
1946
|
+
return;
|
|
1947
|
+
}
|
|
1948
|
+
|
|
1949
|
+
const barangay = currentBarangays.value.find(
|
|
1950
|
+
(b) => b.code === barangayCode
|
|
1951
|
+
);
|
|
1952
|
+
if (barangay) {
|
|
1953
|
+
enrollment.value.address.current.barangayName = barangay.name;
|
|
1954
|
+
}
|
|
1955
|
+
}
|
|
1956
|
+
);
|
|
1957
|
+
|
|
1958
|
+
// Auto-fill permanent address province name when province is selected
|
|
1959
|
+
watch(
|
|
1960
|
+
() => enrollment.value.address.permanent.province,
|
|
1961
|
+
(provinceCode) => {
|
|
1962
|
+
// Don't clear fields if permanent address is same as current address
|
|
1963
|
+
if (sameAsCurrentAddress.value) {
|
|
1964
|
+
return;
|
|
1965
|
+
}
|
|
1966
|
+
|
|
1967
|
+
if (!provinceCode) {
|
|
1968
|
+
enrollment.value.address.permanent.provinceName = "";
|
|
1969
|
+
enrollment.value.address.permanent.municipalityCity = "";
|
|
1970
|
+
enrollment.value.address.permanent.municipalityCityName = "";
|
|
1971
|
+
enrollment.value.address.permanent.barangay = "";
|
|
1972
|
+
enrollment.value.address.permanent.barangayName = "";
|
|
1973
|
+
enrollment.value.address.permanent.streetName = "";
|
|
1974
|
+
enrollment.value.address.permanent.houseNumber = "";
|
|
1975
|
+
return;
|
|
1976
|
+
}
|
|
1977
|
+
|
|
1978
|
+
// Clear dependent fields when province changes
|
|
1979
|
+
enrollment.value.address.permanent.municipalityCity = "";
|
|
1980
|
+
enrollment.value.address.permanent.municipalityCityName = "";
|
|
1981
|
+
enrollment.value.address.permanent.barangay = "";
|
|
1982
|
+
enrollment.value.address.permanent.barangayName = "";
|
|
1983
|
+
enrollment.value.address.permanent.streetName = "";
|
|
1984
|
+
enrollment.value.address.permanent.houseNumber = "";
|
|
1985
|
+
|
|
1986
|
+
const province = permanentProvinces.value.find(
|
|
1987
|
+
(p) => p.code === provinceCode
|
|
1988
|
+
);
|
|
1989
|
+
if (province) {
|
|
1990
|
+
enrollment.value.address.permanent.provinceName = province.name;
|
|
1991
|
+
}
|
|
1992
|
+
}
|
|
1993
|
+
);
|
|
1994
|
+
|
|
1995
|
+
// Auto-fill permanent address city/municipality, province, and region when selected
|
|
1996
|
+
watch(
|
|
1997
|
+
() => enrollment.value.address.permanent.municipalityCity,
|
|
1936
1998
|
(cityMunCode) => {
|
|
1999
|
+
// Don't clear fields if permanent address is same as current address
|
|
2000
|
+
if (sameAsCurrentAddress.value) {
|
|
2001
|
+
return;
|
|
2002
|
+
}
|
|
2003
|
+
|
|
1937
2004
|
if (!cityMunCode) {
|
|
1938
|
-
enrollment.value.
|
|
2005
|
+
enrollment.value.address.permanent.municipalityCityName = "";
|
|
2006
|
+
enrollment.value.address.permanent.barangay = "";
|
|
2007
|
+
enrollment.value.address.permanent.barangayName = "";
|
|
2008
|
+
enrollment.value.address.permanent.streetName = "";
|
|
2009
|
+
enrollment.value.address.permanent.houseNumber = "";
|
|
1939
2010
|
return;
|
|
1940
2011
|
}
|
|
1941
2012
|
|
|
1942
|
-
|
|
2013
|
+
// Clear dependent fields when city/municipality changes
|
|
2014
|
+
enrollment.value.address.permanent.barangay = "";
|
|
2015
|
+
enrollment.value.address.permanent.barangayName = "";
|
|
2016
|
+
enrollment.value.address.permanent.streetName = "";
|
|
2017
|
+
enrollment.value.address.permanent.houseNumber = "";
|
|
2018
|
+
|
|
2019
|
+
const cityMun = permanentCitiesMunicipalities.value.find(
|
|
1943
2020
|
(c) => c.code === cityMunCode
|
|
1944
2021
|
);
|
|
1945
2022
|
if (cityMun) {
|
|
1946
|
-
enrollment.value.
|
|
1947
|
-
|
|
2023
|
+
enrollment.value.address.permanent.municipalityCityName = cityMun.name;
|
|
2024
|
+
enrollment.value.address.permanent.province = cityMun.province
|
|
2025
|
+
? cityMun.code.slice(0, 5) + "00000"
|
|
2026
|
+
: "";
|
|
2027
|
+
enrollment.value.address.permanent.provinceName = cityMun.province ?? "";
|
|
2028
|
+
enrollment.value.address.permanent.region =
|
|
2029
|
+
cityMun.code.slice(0, 2) + "00000000";
|
|
2030
|
+
enrollment.value.address.permanent.regionName = cityMun.region;
|
|
1948
2031
|
}
|
|
1949
2032
|
}
|
|
1950
2033
|
);
|
|
1951
2034
|
|
|
1952
|
-
|
|
2035
|
+
// Auto-fill permanent address barangay name when selected
|
|
2036
|
+
watch(
|
|
2037
|
+
() => enrollment.value.address.permanent.barangay,
|
|
2038
|
+
(barangayCode) => {
|
|
2039
|
+
if (!barangayCode) {
|
|
2040
|
+
enrollment.value.address.permanent.barangayName = "";
|
|
2041
|
+
return;
|
|
2042
|
+
}
|
|
2043
|
+
|
|
2044
|
+
const barangay = permanentBarangays.value.find(
|
|
2045
|
+
(b) => b.code === barangayCode
|
|
2046
|
+
);
|
|
2047
|
+
if (barangay) {
|
|
2048
|
+
enrollment.value.address.permanent.barangayName = barangay.name;
|
|
2049
|
+
}
|
|
2050
|
+
}
|
|
2051
|
+
);
|
|
2052
|
+
|
|
2053
|
+
const { getAll: getSpecialPrograms } = useProgram();
|
|
1953
2054
|
|
|
1954
2055
|
const programs = ref<Array<Record<string, any>>>([]);
|
|
1955
2056
|
|
|
@@ -1958,7 +2059,7 @@ const enrollmentSchool = computed(() => enrollment.value.school);
|
|
|
1958
2059
|
const { data: getPrograms } = await useLazyAsyncData(
|
|
1959
2060
|
`get-programs-as-options-enrollment-form-${enrollment.value.school}`,
|
|
1960
2061
|
() =>
|
|
1961
|
-
|
|
2062
|
+
getSpecialPrograms({
|
|
1962
2063
|
limit: 20,
|
|
1963
2064
|
school: enrollment.value.school,
|
|
1964
2065
|
}),
|
|
@@ -1996,19 +2097,11 @@ watchEffect(() => {
|
|
|
1996
2097
|
});
|
|
1997
2098
|
|
|
1998
2099
|
const hasSpecialProgram = computed(() => {
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
const juniorHigh = ["grade-7", "grade-8", "grade-9", "grade-10"];
|
|
2004
|
-
|
|
2005
|
-
const isJuniorHigh = juniorHigh.includes(enrollment.value.gradeLevel);
|
|
2006
|
-
|
|
2007
|
-
if (isJuniorHigh && programs.value.length > 0) {
|
|
2008
|
-
return true;
|
|
2009
|
-
}
|
|
2100
|
+
const program = programs.value.filter((i) =>
|
|
2101
|
+
i.gradeLevels.includes(enrollment.value.gradeLevel)
|
|
2102
|
+
);
|
|
2010
2103
|
|
|
2011
|
-
return
|
|
2104
|
+
return program.length > 0;
|
|
2012
2105
|
});
|
|
2013
2106
|
|
|
2014
2107
|
const schools = ref<TSchool[]>([]);
|
|
@@ -2111,7 +2204,9 @@ watch(selectedSchool, (val) => {
|
|
|
2111
2204
|
watch(
|
|
2112
2205
|
() => enrollment.value.gradeLevel,
|
|
2113
2206
|
() => {
|
|
2114
|
-
enrollment.value.returningLearnerInfo
|
|
2207
|
+
if (enrollment.value.returningLearnerInfo) {
|
|
2208
|
+
enrollment.value.returningLearnerInfo.lastGradeLevelCompleted = "";
|
|
2209
|
+
}
|
|
2115
2210
|
}
|
|
2116
2211
|
);
|
|
2117
2212
|
|
|
@@ -2163,6 +2258,34 @@ const isSeniorHighSchool = computed(() => {
|
|
|
2163
2258
|
return ["grade-11", "grade-12"].includes(gradeLevel);
|
|
2164
2259
|
});
|
|
2165
2260
|
|
|
2261
|
+
// Watch for track selection and set trackName
|
|
2262
|
+
watch(
|
|
2263
|
+
() => enrollment.value.seniorHighInfo?.track,
|
|
2264
|
+
(trackValue) => {
|
|
2265
|
+
if (!trackValue || !enrollment.value.seniorHighInfo) return;
|
|
2266
|
+
|
|
2267
|
+
const selectedTrack = tracks.find((track) => track.value === trackValue);
|
|
2268
|
+
if (selectedTrack && enrollment.value.seniorHighInfo) {
|
|
2269
|
+
enrollment.value.seniorHighInfo.trackName = selectedTrack.title ?? "";
|
|
2270
|
+
}
|
|
2271
|
+
}
|
|
2272
|
+
);
|
|
2273
|
+
|
|
2274
|
+
// Watch for strand selection and set strandName
|
|
2275
|
+
watch(
|
|
2276
|
+
() => enrollment.value.seniorHighInfo?.strand,
|
|
2277
|
+
(strandValue) => {
|
|
2278
|
+
if (!strandValue || !enrollment.value.seniorHighInfo) return;
|
|
2279
|
+
|
|
2280
|
+
const selectedStrand = selectedTrackStrands.value.find(
|
|
2281
|
+
(strand) => strand.value === strandValue
|
|
2282
|
+
);
|
|
2283
|
+
if (selectedStrand && enrollment.value.seniorHighInfo) {
|
|
2284
|
+
enrollment.value.seniorHighInfo.strandName = selectedStrand.title ?? "";
|
|
2285
|
+
}
|
|
2286
|
+
}
|
|
2287
|
+
);
|
|
2288
|
+
|
|
2166
2289
|
const isKindergarten = computed(() => {
|
|
2167
2290
|
const gradeLevel = enrollment.value.gradeLevel;
|
|
2168
2291
|
return gradeLevel === "kindergarten" || gradeLevel === "kinder";
|
|
@@ -2338,16 +2461,26 @@ watch(enrollment, (val) => {
|
|
|
2338
2461
|
enrollment.value.address.current.streetName = "";
|
|
2339
2462
|
enrollment.value.address.current.sitio = "";
|
|
2340
2463
|
enrollment.value.address.current.barangay = "";
|
|
2464
|
+
enrollment.value.address.current.barangayName = "";
|
|
2341
2465
|
enrollment.value.address.current.municipalityCity = "";
|
|
2466
|
+
enrollment.value.address.current.municipalityCityName = "";
|
|
2342
2467
|
enrollment.value.address.current.province = "";
|
|
2468
|
+
enrollment.value.address.current.provinceName = "";
|
|
2469
|
+
enrollment.value.address.current.region = "";
|
|
2470
|
+
enrollment.value.address.current.regionName = "";
|
|
2343
2471
|
enrollment.value.address.current.country = "Philippines";
|
|
2344
2472
|
enrollment.value.address.current.zipCode = "";
|
|
2345
2473
|
enrollment.value.address.permanent.houseNumber = "";
|
|
2346
2474
|
enrollment.value.address.permanent.streetName = "";
|
|
2347
2475
|
enrollment.value.address.permanent.sitio = "";
|
|
2348
2476
|
enrollment.value.address.permanent.barangay = "";
|
|
2477
|
+
enrollment.value.address.permanent.barangayName = "";
|
|
2349
2478
|
enrollment.value.address.permanent.municipalityCity = "";
|
|
2479
|
+
enrollment.value.address.permanent.municipalityCityName = "";
|
|
2350
2480
|
enrollment.value.address.permanent.province = "";
|
|
2481
|
+
enrollment.value.address.permanent.provinceName = "";
|
|
2482
|
+
enrollment.value.address.permanent.region = "";
|
|
2483
|
+
enrollment.value.address.permanent.regionName = "";
|
|
2351
2484
|
enrollment.value.address.permanent.country = "Philippines";
|
|
2352
2485
|
enrollment.value.address.permanent.zipCode = "";
|
|
2353
2486
|
}
|
|
@@ -2363,10 +2496,20 @@ watchEffect(() => {
|
|
|
2363
2496
|
enrollment.value.address.current.sitio;
|
|
2364
2497
|
enrollment.value.address.permanent.barangay =
|
|
2365
2498
|
enrollment.value.address.current.barangay;
|
|
2499
|
+
enrollment.value.address.permanent.barangayName =
|
|
2500
|
+
enrollment.value.address.current.barangayName;
|
|
2366
2501
|
enrollment.value.address.permanent.municipalityCity =
|
|
2367
2502
|
enrollment.value.address.current.municipalityCity;
|
|
2503
|
+
enrollment.value.address.permanent.municipalityCityName =
|
|
2504
|
+
enrollment.value.address.current.municipalityCityName;
|
|
2368
2505
|
enrollment.value.address.permanent.province =
|
|
2369
2506
|
enrollment.value.address.current.province;
|
|
2507
|
+
enrollment.value.address.permanent.provinceName =
|
|
2508
|
+
enrollment.value.address.current.provinceName;
|
|
2509
|
+
enrollment.value.address.permanent.region =
|
|
2510
|
+
enrollment.value.address.current.region;
|
|
2511
|
+
enrollment.value.address.permanent.regionName =
|
|
2512
|
+
enrollment.value.address.current.regionName;
|
|
2370
2513
|
enrollment.value.address.permanent.country =
|
|
2371
2514
|
enrollment.value.address.current.country || "Philippines";
|
|
2372
2515
|
enrollment.value.address.permanent.zipCode =
|
|
@@ -2376,8 +2519,13 @@ watchEffect(() => {
|
|
|
2376
2519
|
enrollment.value.address.permanent.streetName = "";
|
|
2377
2520
|
enrollment.value.address.permanent.sitio = "";
|
|
2378
2521
|
enrollment.value.address.permanent.barangay = "";
|
|
2522
|
+
enrollment.value.address.permanent.barangayName = "";
|
|
2379
2523
|
enrollment.value.address.permanent.municipalityCity = "";
|
|
2524
|
+
enrollment.value.address.permanent.municipalityCityName = "";
|
|
2380
2525
|
enrollment.value.address.permanent.province = "";
|
|
2526
|
+
enrollment.value.address.permanent.provinceName = "";
|
|
2527
|
+
enrollment.value.address.permanent.region = "";
|
|
2528
|
+
enrollment.value.address.permanent.regionName = "";
|
|
2381
2529
|
enrollment.value.address.permanent.country = "Philippines";
|
|
2382
2530
|
enrollment.value.address.permanent.zipCode = "";
|
|
2383
2531
|
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
export default function useBasicEdu() {
|
|
2
2
|
const educationLevels = [
|
|
3
|
+
{
|
|
4
|
+
title: "Non Grade Level",
|
|
5
|
+
value: "non-grade-level",
|
|
6
|
+
},
|
|
3
7
|
{
|
|
4
8
|
title: "Elementary",
|
|
5
9
|
value: "elementary",
|
|
@@ -37,6 +41,11 @@ export default function useBasicEdu() {
|
|
|
37
41
|
}
|
|
38
42
|
|
|
39
43
|
const gradeLevels = [
|
|
44
|
+
{
|
|
45
|
+
title: "Non-Grade Level",
|
|
46
|
+
value: "non-grade-level",
|
|
47
|
+
level: "non-grade-level",
|
|
48
|
+
},
|
|
40
49
|
{
|
|
41
50
|
title: "Kindergarten",
|
|
42
51
|
value: "kindergarten",
|
|
@@ -72,6 +72,8 @@ export default function useEnrollment() {
|
|
|
72
72
|
municipalityCityName: "",
|
|
73
73
|
province: "",
|
|
74
74
|
provinceName: "",
|
|
75
|
+
region: "",
|
|
76
|
+
regionName: "",
|
|
75
77
|
country: "",
|
|
76
78
|
zipCode: "",
|
|
77
79
|
},
|
|
@@ -81,7 +83,10 @@ export default function useEnrollment() {
|
|
|
81
83
|
sitio: "",
|
|
82
84
|
barangay: "",
|
|
83
85
|
municipalityCity: "",
|
|
86
|
+
municipalityCityName: "",
|
|
84
87
|
province: "",
|
|
88
|
+
region: "",
|
|
89
|
+
regionName: "",
|
|
85
90
|
country: "",
|
|
86
91
|
zipCode: "",
|
|
87
92
|
},
|
package/package.json
CHANGED
package/types/enrollment.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ declare type TTLearner = {
|
|
|
17
17
|
specialProgram?: string;
|
|
18
18
|
specialProgramName?: string;
|
|
19
19
|
specialProgramCode?: string;
|
|
20
|
+
specialProgramMajor?: string;
|
|
20
21
|
gwa?: number;
|
|
21
22
|
subjects?: { title: string; grade: number }[];
|
|
22
23
|
returningLearner: boolean;
|
|
@@ -94,6 +95,8 @@ declare type EnrAddress = {
|
|
|
94
95
|
municipalityCityName?: string;
|
|
95
96
|
province: string;
|
|
96
97
|
provinceName?: string;
|
|
98
|
+
region?: string;
|
|
99
|
+
regionName?: string;
|
|
97
100
|
country?: string;
|
|
98
101
|
zipCode?: string;
|
|
99
102
|
};
|
package/types/program.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ declare type TProgram = {
|
|
|
7
7
|
gradeLevels?: string[];
|
|
8
8
|
gwa?: number;
|
|
9
9
|
subjects?: { title: string; grade: number }[];
|
|
10
|
+
majors?: { title: string; value: string }[];
|
|
10
11
|
description?: string;
|
|
11
12
|
status?: string;
|
|
12
13
|
createdAt?: string;
|
|
@@ -21,7 +22,8 @@ declare type TProgramScreening = {
|
|
|
21
22
|
schoolYear: string;
|
|
22
23
|
gradeLevel: string;
|
|
23
24
|
specialProgram: string;
|
|
24
|
-
specialProgramName
|
|
25
|
+
specialProgramName: string;
|
|
26
|
+
specialProgramMajor: string;
|
|
25
27
|
applicant: string;
|
|
26
28
|
applicantName?: string;
|
|
27
29
|
gwa?: number;
|