@eeplatform/nuxt-layer-common 1.7.52 → 1.7.54
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 +64 -17
- package/components/EnrollmentQuestion.vue +738 -0
- package/components/InvitationForm.vue +4 -4
- package/composables/useStrand.ts +21 -0
- package/composables/useTrack.ts +20 -0
- package/nuxt.config.ts +1 -0
- package/package.json +1 -1
- package/types/enrollment.d.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1295,10 +1295,11 @@
|
|
|
1295
1295
|
<v-col cols="12">
|
|
1296
1296
|
<v-autocomplete
|
|
1297
1297
|
v-model="enrollment.seniorHighInfo.track"
|
|
1298
|
-
item-title="
|
|
1299
|
-
item-value="
|
|
1298
|
+
item-title="name"
|
|
1299
|
+
item-value="_id"
|
|
1300
1300
|
:return-object="false"
|
|
1301
|
-
:items="
|
|
1301
|
+
:items="schoolTracks"
|
|
1302
|
+
:loading="loadingTracks"
|
|
1302
1303
|
:rules="[requiredRule]"
|
|
1303
1304
|
></v-autocomplete>
|
|
1304
1305
|
</v-col>
|
|
@@ -1315,10 +1316,11 @@
|
|
|
1315
1316
|
<v-col cols="12">
|
|
1316
1317
|
<v-autocomplete
|
|
1317
1318
|
v-model="enrollment.seniorHighInfo.strand"
|
|
1318
|
-
item-title="
|
|
1319
|
-
item-value="
|
|
1319
|
+
item-title="name"
|
|
1320
|
+
item-value="_id"
|
|
1320
1321
|
:return-object="false"
|
|
1321
1322
|
:items="selectedTrackStrands"
|
|
1323
|
+
:loading="loadingStrands"
|
|
1322
1324
|
:rules="[requiredRule]"
|
|
1323
1325
|
></v-autocomplete>
|
|
1324
1326
|
</v-col>
|
|
@@ -2292,8 +2294,10 @@ watch(
|
|
|
2292
2294
|
}
|
|
2293
2295
|
);
|
|
2294
2296
|
|
|
2295
|
-
const { gradeLevels, generateSchoolYears, motherTongueOptions
|
|
2296
|
-
|
|
2297
|
+
const { gradeLevels, generateSchoolYears, motherTongueOptions } = useBasicEdu();
|
|
2298
|
+
|
|
2299
|
+
const { getAll: getAllTracks } = useTrack();
|
|
2300
|
+
const { getAll: getAllStrands } = useStrand();
|
|
2297
2301
|
|
|
2298
2302
|
const gradeLevelOffering = ref<Record<string, any>[]>([]);
|
|
2299
2303
|
|
|
@@ -2301,6 +2305,52 @@ const { getAll: getGradeLevels } = useGradeLevel();
|
|
|
2301
2305
|
|
|
2302
2306
|
const theSchool = computed(() => prop.school || enrollment.value.school);
|
|
2303
2307
|
|
|
2308
|
+
const schoolTracks = ref<Array<Record<string, any>>>([]);
|
|
2309
|
+
|
|
2310
|
+
const { data: getTracksData, status: getTracksStatus } = await useLazyAsyncData(
|
|
2311
|
+
`get-tracks-enrollment-form-${theSchool.value}`,
|
|
2312
|
+
() => getAllTracks({ school: theSchool.value, limit: 100 }),
|
|
2313
|
+
{
|
|
2314
|
+
watch: [theSchool],
|
|
2315
|
+
}
|
|
2316
|
+
);
|
|
2317
|
+
|
|
2318
|
+
const loadingTracks = computed(() => getTracksStatus.value === "pending");
|
|
2319
|
+
|
|
2320
|
+
watchEffect(() => {
|
|
2321
|
+
if (getTracksData.value) {
|
|
2322
|
+
schoolTracks.value = getTracksData.value.items;
|
|
2323
|
+
}
|
|
2324
|
+
});
|
|
2325
|
+
|
|
2326
|
+
const schoolStrands = ref<Array<Record<string, any>>>([]);
|
|
2327
|
+
|
|
2328
|
+
const selectedTrackId = computed(
|
|
2329
|
+
() => enrollment.value.seniorHighInfo?.track || ""
|
|
2330
|
+
);
|
|
2331
|
+
|
|
2332
|
+
const { data: getStrandsData, status: getStrandsStatus } =
|
|
2333
|
+
await useLazyAsyncData(
|
|
2334
|
+
`get-strands-enrollment-form-${theSchool.value}-${selectedTrackId.value}`,
|
|
2335
|
+
() =>
|
|
2336
|
+
getAllStrands({
|
|
2337
|
+
school: theSchool.value,
|
|
2338
|
+
track: selectedTrackId.value,
|
|
2339
|
+
limit: 100,
|
|
2340
|
+
}),
|
|
2341
|
+
{
|
|
2342
|
+
watch: [theSchool, selectedTrackId],
|
|
2343
|
+
}
|
|
2344
|
+
);
|
|
2345
|
+
|
|
2346
|
+
const loadingStrands = computed(() => getStrandsStatus.value === "pending");
|
|
2347
|
+
|
|
2348
|
+
watchEffect(() => {
|
|
2349
|
+
if (getStrandsData.value) {
|
|
2350
|
+
schoolStrands.value = getStrandsData.value.items;
|
|
2351
|
+
}
|
|
2352
|
+
});
|
|
2353
|
+
|
|
2304
2354
|
const { data: getGradeLevelReq, status: statusGradeLevel } =
|
|
2305
2355
|
await useLazyAsyncData(
|
|
2306
2356
|
"get-grade-level-offerings" + theSchool.value,
|
|
@@ -2328,12 +2378,7 @@ watchEffect(() => {
|
|
|
2328
2378
|
}
|
|
2329
2379
|
});
|
|
2330
2380
|
|
|
2331
|
-
const selectedTrackStrands = computed(
|
|
2332
|
-
() =>
|
|
2333
|
-
tracks.find(
|
|
2334
|
-
(track) => track.value === enrollment.value.seniorHighInfo?.track
|
|
2335
|
-
)?.strands || []
|
|
2336
|
-
);
|
|
2381
|
+
const selectedTrackStrands = computed(() => schoolStrands.value);
|
|
2337
2382
|
|
|
2338
2383
|
const isSeniorHighSchool = computed(() => {
|
|
2339
2384
|
const gradeLevel = enrollment.value.gradeLevel;
|
|
@@ -2350,9 +2395,11 @@ watch(
|
|
|
2350
2395
|
enrollment.value.seniorHighInfo.strand = "";
|
|
2351
2396
|
enrollment.value.seniorHighInfo.strandName = "";
|
|
2352
2397
|
|
|
2353
|
-
const selectedTrack =
|
|
2398
|
+
const selectedTrack = schoolTracks.value.find(
|
|
2399
|
+
(track: Record<string, any>) => track._id === trackValue
|
|
2400
|
+
);
|
|
2354
2401
|
if (selectedTrack && enrollment.value.seniorHighInfo) {
|
|
2355
|
-
enrollment.value.seniorHighInfo.trackName = selectedTrack.
|
|
2402
|
+
enrollment.value.seniorHighInfo.trackName = selectedTrack.name ?? "";
|
|
2356
2403
|
}
|
|
2357
2404
|
}
|
|
2358
2405
|
);
|
|
@@ -2364,10 +2411,10 @@ watch(
|
|
|
2364
2411
|
if (!strandValue || !enrollment.value.seniorHighInfo) return;
|
|
2365
2412
|
|
|
2366
2413
|
const selectedStrand = selectedTrackStrands.value.find(
|
|
2367
|
-
(strand) => strand.
|
|
2414
|
+
(strand: Record<string, any>) => strand._id === strandValue
|
|
2368
2415
|
);
|
|
2369
2416
|
if (selectedStrand && enrollment.value.seniorHighInfo) {
|
|
2370
|
-
enrollment.value.seniorHighInfo.strandName = selectedStrand.
|
|
2417
|
+
enrollment.value.seniorHighInfo.strandName = selectedStrand.name ?? "";
|
|
2371
2418
|
}
|
|
2372
2419
|
}
|
|
2373
2420
|
);
|
|
@@ -0,0 +1,738 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-row no-gutters class="fill-height" justify="center" align-content="start">
|
|
3
|
+
<v-col cols="6" class="mt-4">
|
|
4
|
+
<v-row no-gutters>
|
|
5
|
+
<v-col cols="12">
|
|
6
|
+
<v-row no-gutters justify="space-between">
|
|
7
|
+
<v-btn icon variant="text" density="comfortable" @click="goBack">
|
|
8
|
+
<v-icon> ph:arrow-left-bold </v-icon>
|
|
9
|
+
</v-btn>
|
|
10
|
+
</v-row>
|
|
11
|
+
</v-col>
|
|
12
|
+
|
|
13
|
+
<v-col cols="12" class="pl-2 mt-2">
|
|
14
|
+
<v-progress-linear
|
|
15
|
+
:model-value="progress"
|
|
16
|
+
rounded="lg"
|
|
17
|
+
height="10"
|
|
18
|
+
></v-progress-linear>
|
|
19
|
+
</v-col>
|
|
20
|
+
|
|
21
|
+
<v-col v-if="currentStep === 1" cols="12" class="mt-8 pl-2">
|
|
22
|
+
<v-row no-gutters>
|
|
23
|
+
<v-col cols="12">
|
|
24
|
+
<v-form v-model="step1.valid">
|
|
25
|
+
<v-row no-gutters>
|
|
26
|
+
<v-col cols="12" class="mb-6">
|
|
27
|
+
<span class="text-h5 font-weight-bold">
|
|
28
|
+
{{ step1.question }}
|
|
29
|
+
</span>
|
|
30
|
+
</v-col>
|
|
31
|
+
|
|
32
|
+
<v-col v-if="isSelfService" cols="12">
|
|
33
|
+
<InputLabel title="Region" />
|
|
34
|
+
<v-autocomplete
|
|
35
|
+
v-model="step1.answer.region"
|
|
36
|
+
:items="regions"
|
|
37
|
+
item-title="name"
|
|
38
|
+
item-value="code"
|
|
39
|
+
:loading="regionStatus"
|
|
40
|
+
:disabled="regionStatus"
|
|
41
|
+
></v-autocomplete>
|
|
42
|
+
</v-col>
|
|
43
|
+
|
|
44
|
+
<v-col v-if="isSelfService" cols="12">
|
|
45
|
+
<InputLabel title="Province" />
|
|
46
|
+
<v-autocomplete
|
|
47
|
+
v-model="step1.answer.province"
|
|
48
|
+
:items="step1Provinces"
|
|
49
|
+
item-title="name"
|
|
50
|
+
item-value="code"
|
|
51
|
+
:return-object="false"
|
|
52
|
+
:loading="step1ProvincesStatus"
|
|
53
|
+
:disabled="step1ProvincesStatus || !step1.answer.region"
|
|
54
|
+
></v-autocomplete>
|
|
55
|
+
</v-col>
|
|
56
|
+
|
|
57
|
+
<v-col v-if="isSelfService" cols="12">
|
|
58
|
+
<InputLabel title="City/Municipality" />
|
|
59
|
+
<v-autocomplete
|
|
60
|
+
v-model="step1.answer.cityMunicipality"
|
|
61
|
+
:items="step1CitiesMunicipalities"
|
|
62
|
+
item-title="name"
|
|
63
|
+
item-value="code"
|
|
64
|
+
:loading="step1CitiesMunicipalitiesStatus"
|
|
65
|
+
:disabled="
|
|
66
|
+
step1CitiesMunicipalitiesStatus ||
|
|
67
|
+
!step1.answer.province
|
|
68
|
+
"
|
|
69
|
+
></v-autocomplete>
|
|
70
|
+
</v-col>
|
|
71
|
+
|
|
72
|
+
<v-col cols="12">
|
|
73
|
+
<InputLabel title="School" required />
|
|
74
|
+
<v-combobox
|
|
75
|
+
v-model="step1.answer.schoolId"
|
|
76
|
+
v-model:search="searchSchool"
|
|
77
|
+
:rules="[requiredRule]"
|
|
78
|
+
:items="schools"
|
|
79
|
+
item-title="name"
|
|
80
|
+
item-value="id"
|
|
81
|
+
:return-object="false"
|
|
82
|
+
:loading="schoolsStatus"
|
|
83
|
+
:disabled="schoolsStatus"
|
|
84
|
+
:hide-no-data="false"
|
|
85
|
+
>
|
|
86
|
+
<template v-slot:no-data>
|
|
87
|
+
<v-list-item>
|
|
88
|
+
<v-list-item-title>
|
|
89
|
+
No results matching "<strong>{{
|
|
90
|
+
searchSchool
|
|
91
|
+
}}</strong
|
|
92
|
+
>". Click the search button and try again.
|
|
93
|
+
</v-list-item-title>
|
|
94
|
+
</v-list-item>
|
|
95
|
+
</template>
|
|
96
|
+
|
|
97
|
+
<template #append>
|
|
98
|
+
<v-btn
|
|
99
|
+
variant="tonal"
|
|
100
|
+
:disabled="schoolsStatus"
|
|
101
|
+
class="text-none"
|
|
102
|
+
size="48"
|
|
103
|
+
width="100"
|
|
104
|
+
icon
|
|
105
|
+
@click="refreshSchools()"
|
|
106
|
+
>
|
|
107
|
+
<v-icon>ph:magnifying-glass-bold</v-icon>
|
|
108
|
+
</v-btn>
|
|
109
|
+
</template>
|
|
110
|
+
</v-combobox>
|
|
111
|
+
</v-col>
|
|
112
|
+
|
|
113
|
+
<v-col cols="12" class="mt-4">
|
|
114
|
+
<v-btn
|
|
115
|
+
class="text-none px-4"
|
|
116
|
+
size="large"
|
|
117
|
+
variant="flat"
|
|
118
|
+
color="black"
|
|
119
|
+
rounded="lg"
|
|
120
|
+
@click="step1.save()"
|
|
121
|
+
:disabled="!step1.valid"
|
|
122
|
+
>
|
|
123
|
+
Continue
|
|
124
|
+
</v-btn>
|
|
125
|
+
</v-col>
|
|
126
|
+
</v-row>
|
|
127
|
+
</v-form>
|
|
128
|
+
</v-col>
|
|
129
|
+
</v-row>
|
|
130
|
+
</v-col>
|
|
131
|
+
</v-row>
|
|
132
|
+
</v-col>
|
|
133
|
+
</v-row>
|
|
134
|
+
</template>
|
|
135
|
+
|
|
136
|
+
<script setup lang="ts">
|
|
137
|
+
const localProps = defineProps({
|
|
138
|
+
type: {
|
|
139
|
+
type: String as PropType<"self-service" | "encoder">,
|
|
140
|
+
default: "encoder",
|
|
141
|
+
},
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
const { loggedInUser, currentUser } = useLocalAuth();
|
|
145
|
+
|
|
146
|
+
const isEncoder = computed(() => localProps.type === "encoder");
|
|
147
|
+
const isSelfService = computed(() => localProps.type === "self-service");
|
|
148
|
+
|
|
149
|
+
const { enrollment } = useEnrollment();
|
|
150
|
+
|
|
151
|
+
const emit = defineEmits(["close"]);
|
|
152
|
+
|
|
153
|
+
const { requiredRule } = useUtils();
|
|
154
|
+
|
|
155
|
+
// enrollment questions — matched to useEnrollment().enrollment
|
|
156
|
+
|
|
157
|
+
// enrollment.region, .regionName, .province, .cityMunicipality, .schoolId, .school, .schoolName
|
|
158
|
+
const step1 = ref({
|
|
159
|
+
question: "Which school do you want to enroll in?",
|
|
160
|
+
answer: {
|
|
161
|
+
region: "",
|
|
162
|
+
regionName: "",
|
|
163
|
+
province: "",
|
|
164
|
+
cityMunicipality: "",
|
|
165
|
+
schoolId: "",
|
|
166
|
+
school: "",
|
|
167
|
+
schoolName: "",
|
|
168
|
+
},
|
|
169
|
+
save() {
|
|
170
|
+
const school = schools.value.find(
|
|
171
|
+
(s) => s.id === step1.value.answer.schoolId
|
|
172
|
+
);
|
|
173
|
+
|
|
174
|
+
if (school) {
|
|
175
|
+
step1.value.answer.school = school._id ?? "";
|
|
176
|
+
step1.value.answer.schoolName = school.name;
|
|
177
|
+
step1.value.answer.cityMunicipality = school.cityMunicipalityPSGC ?? "";
|
|
178
|
+
step1.value.answer.province = school.cityMunicipalityPSGC
|
|
179
|
+
? school.cityMunicipalityPSGC.slice(0, 5) + "00000"
|
|
180
|
+
: "";
|
|
181
|
+
step1.value.answer.region = school.cityMunicipalityPSGC
|
|
182
|
+
? school.cityMunicipalityPSGC.slice(0, 2) + "00000000"
|
|
183
|
+
: "";
|
|
184
|
+
step1.value.answer.regionName = school.regionName ?? "";
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
enrollment.value.region = step1.value.answer.region;
|
|
188
|
+
enrollment.value.regionName = step1.value.answer.regionName;
|
|
189
|
+
enrollment.value.province = step1.value.answer.province;
|
|
190
|
+
enrollment.value.cityMunicipality = step1.value.answer.cityMunicipality;
|
|
191
|
+
enrollment.value.schoolId = step1.value.answer.schoolId;
|
|
192
|
+
enrollment.value.school = step1.value.answer.school;
|
|
193
|
+
enrollment.value.schoolName = step1.value.answer.schoolName;
|
|
194
|
+
currentStep.value++;
|
|
195
|
+
},
|
|
196
|
+
valid: false,
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
// Step 1 data fetching
|
|
200
|
+
const { getAll: getAllPSGC } = usePSGC();
|
|
201
|
+
const { getAll: getAllSchools } = useSchool();
|
|
202
|
+
|
|
203
|
+
// Regions
|
|
204
|
+
const regions = ref<Array<Record<string, any>>>([]);
|
|
205
|
+
|
|
206
|
+
const { data: step1RegionsData, status: step1RegionsStatus } = useLazyAsyncData(
|
|
207
|
+
"eq-psgc-regions",
|
|
208
|
+
() => getAllPSGC({ type: "Reg" })
|
|
209
|
+
);
|
|
210
|
+
|
|
211
|
+
const regionStatus = computed(() => step1RegionsStatus.value === "pending");
|
|
212
|
+
|
|
213
|
+
watchEffect(() => {
|
|
214
|
+
if (step1RegionsData.value) {
|
|
215
|
+
regions.value = step1RegionsData.value.items;
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
// Provinces (filtered by selected region)
|
|
220
|
+
const step1Provinces = ref<Array<Record<string, any>>>([]);
|
|
221
|
+
|
|
222
|
+
const step1SelectedRegion = computed(() => step1.value.answer.region);
|
|
223
|
+
|
|
224
|
+
const { data: step1ProvData, status: step1ProvReqStatus } = useLazyAsyncData(
|
|
225
|
+
"eq-psgc-provinces",
|
|
226
|
+
() =>
|
|
227
|
+
getAllPSGC({
|
|
228
|
+
type: "Prov",
|
|
229
|
+
prefix: step1SelectedRegion.value.slice(0, 2),
|
|
230
|
+
limit: 100,
|
|
231
|
+
}),
|
|
232
|
+
{ watch: [step1SelectedRegion] }
|
|
233
|
+
);
|
|
234
|
+
|
|
235
|
+
const step1ProvincesStatus = computed(
|
|
236
|
+
() => step1ProvReqStatus.value === "pending"
|
|
237
|
+
);
|
|
238
|
+
|
|
239
|
+
watchEffect(() => {
|
|
240
|
+
if (step1ProvData.value) {
|
|
241
|
+
step1Provinces.value = step1ProvData.value.items;
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
// Cities/Municipalities (filtered by selected province)
|
|
246
|
+
const step1CitiesMunicipalities = ref<Array<Record<string, any>>>([]);
|
|
247
|
+
|
|
248
|
+
const step1SelectedProvince = computed(() => step1.value.answer.province);
|
|
249
|
+
|
|
250
|
+
const { data: step1CityMunData, status: step1CityMunReqStatus } =
|
|
251
|
+
useLazyAsyncData(
|
|
252
|
+
"eq-psgc-cities-municipalities",
|
|
253
|
+
() =>
|
|
254
|
+
getAllPSGC({
|
|
255
|
+
type: "City",
|
|
256
|
+
prefix: step1SelectedProvince.value.slice(0, 5),
|
|
257
|
+
limit: 2000,
|
|
258
|
+
}),
|
|
259
|
+
{ watch: [step1SelectedProvince] }
|
|
260
|
+
);
|
|
261
|
+
|
|
262
|
+
const step1CitiesMunicipalitiesStatus = computed(
|
|
263
|
+
() => step1CityMunReqStatus.value === "pending"
|
|
264
|
+
);
|
|
265
|
+
|
|
266
|
+
watchEffect(() => {
|
|
267
|
+
if (step1CityMunData.value) {
|
|
268
|
+
step1CitiesMunicipalities.value = step1CityMunData.value.items;
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
// Clear cascade: region -> province -> city
|
|
273
|
+
watch(
|
|
274
|
+
() => step1.value.answer.region,
|
|
275
|
+
() => {
|
|
276
|
+
step1.value.answer.province = "";
|
|
277
|
+
step1.value.answer.cityMunicipality = "";
|
|
278
|
+
step1.value.answer.schoolId = "";
|
|
279
|
+
}
|
|
280
|
+
);
|
|
281
|
+
|
|
282
|
+
watch(
|
|
283
|
+
() => step1.value.answer.province,
|
|
284
|
+
() => {
|
|
285
|
+
step1.value.answer.cityMunicipality = "";
|
|
286
|
+
step1.value.answer.schoolId = "";
|
|
287
|
+
}
|
|
288
|
+
);
|
|
289
|
+
|
|
290
|
+
watch(
|
|
291
|
+
() => step1.value.answer.cityMunicipality,
|
|
292
|
+
() => {
|
|
293
|
+
step1.value.answer.schoolId = "";
|
|
294
|
+
}
|
|
295
|
+
);
|
|
296
|
+
|
|
297
|
+
// Schools (filtered by PSGC prefix)
|
|
298
|
+
const schools = ref<TSchool[]>([]);
|
|
299
|
+
const searchSchool = ref("");
|
|
300
|
+
|
|
301
|
+
const psgcSchoolPrefix = computed(() => {
|
|
302
|
+
if (step1.value.answer.cityMunicipality) {
|
|
303
|
+
return step1.value.answer.cityMunicipality.slice(0, 7);
|
|
304
|
+
}
|
|
305
|
+
if (step1.value.answer.province) {
|
|
306
|
+
return step1.value.answer.province.slice(0, 5);
|
|
307
|
+
}
|
|
308
|
+
if (step1.value.answer.region) {
|
|
309
|
+
return step1.value.answer.region.slice(0, 2);
|
|
310
|
+
}
|
|
311
|
+
return "";
|
|
312
|
+
});
|
|
313
|
+
|
|
314
|
+
const {
|
|
315
|
+
data: step1SchoolsData,
|
|
316
|
+
status: step1SchoolsReqStatus,
|
|
317
|
+
refresh: refreshSchools,
|
|
318
|
+
} = useLazyAsyncData(
|
|
319
|
+
"eq-schools",
|
|
320
|
+
() =>
|
|
321
|
+
getAllSchools({
|
|
322
|
+
limit: 100,
|
|
323
|
+
psgc: psgcSchoolPrefix.value,
|
|
324
|
+
search: searchSchool.value,
|
|
325
|
+
}),
|
|
326
|
+
{ watch: [psgcSchoolPrefix] }
|
|
327
|
+
);
|
|
328
|
+
|
|
329
|
+
const schoolsStatus = computed(() => step1SchoolsReqStatus.value === "pending");
|
|
330
|
+
|
|
331
|
+
watchEffect(() => {
|
|
332
|
+
if (step1SchoolsData.value) {
|
|
333
|
+
schools.value = step1SchoolsData.value.items;
|
|
334
|
+
}
|
|
335
|
+
});
|
|
336
|
+
|
|
337
|
+
// enrollment.schoolYear
|
|
338
|
+
const step2 = ref({
|
|
339
|
+
question: "Which school year do you want to enroll in?",
|
|
340
|
+
answer: {
|
|
341
|
+
schoolYear: "",
|
|
342
|
+
},
|
|
343
|
+
save() {
|
|
344
|
+
enrollment.value.schoolYear = step2.value.answer.schoolYear;
|
|
345
|
+
},
|
|
346
|
+
valid: false,
|
|
347
|
+
});
|
|
348
|
+
|
|
349
|
+
// enrollment.gradeLevel
|
|
350
|
+
const step3 = ref({
|
|
351
|
+
question: "Which grade level do you want to enroll in?",
|
|
352
|
+
answer: {
|
|
353
|
+
gradeLevel: "",
|
|
354
|
+
},
|
|
355
|
+
save() {
|
|
356
|
+
enrollment.value.gradeLevel = step3.value.answer.gradeLevel;
|
|
357
|
+
},
|
|
358
|
+
valid: false,
|
|
359
|
+
});
|
|
360
|
+
|
|
361
|
+
// enrollment.seniorHighInfo.semester (shown when grade 11 or 12)
|
|
362
|
+
const step4 = ref({
|
|
363
|
+
question: "What semester do you want to enroll in?",
|
|
364
|
+
answer: {
|
|
365
|
+
semester: "",
|
|
366
|
+
},
|
|
367
|
+
save() {
|
|
368
|
+
enrollment.value.seniorHighInfo!.semester = step4.value.answer.semester;
|
|
369
|
+
},
|
|
370
|
+
valid: false,
|
|
371
|
+
});
|
|
372
|
+
|
|
373
|
+
// enrollment.seniorHighInfo.track, .trackName (shown when grade 11 or 12)
|
|
374
|
+
const step5 = ref({
|
|
375
|
+
question: "What track do you want to enroll in?",
|
|
376
|
+
answer: {
|
|
377
|
+
track: "",
|
|
378
|
+
trackName: "",
|
|
379
|
+
},
|
|
380
|
+
save() {
|
|
381
|
+
enrollment.value.seniorHighInfo!.track = step5.value.answer.track;
|
|
382
|
+
enrollment.value.seniorHighInfo!.trackName = step5.value.answer.trackName;
|
|
383
|
+
},
|
|
384
|
+
valid: false,
|
|
385
|
+
});
|
|
386
|
+
|
|
387
|
+
// enrollment.seniorHighInfo.strand, .strandName (shown when grade 11 or 12)
|
|
388
|
+
const step6 = ref({
|
|
389
|
+
question: "What strand do you want to enroll in?",
|
|
390
|
+
answer: {
|
|
391
|
+
strand: "",
|
|
392
|
+
strandName: "",
|
|
393
|
+
},
|
|
394
|
+
save() {
|
|
395
|
+
enrollment.value.seniorHighInfo!.strand = step6.value.answer.strand;
|
|
396
|
+
enrollment.value.seniorHighInfo!.strandName = step6.value.answer.strandName;
|
|
397
|
+
},
|
|
398
|
+
valid: false,
|
|
399
|
+
});
|
|
400
|
+
|
|
401
|
+
// enrollment.returningLearner
|
|
402
|
+
const step7 = ref({
|
|
403
|
+
question: "Is the learner a returning learner?",
|
|
404
|
+
answer: {
|
|
405
|
+
returningLearner: false,
|
|
406
|
+
},
|
|
407
|
+
save() {
|
|
408
|
+
enrollment.value.returningLearner = step7.value.answer.returningLearner;
|
|
409
|
+
},
|
|
410
|
+
valid: false,
|
|
411
|
+
});
|
|
412
|
+
|
|
413
|
+
// enrollment.learnerInfo.psaBirthCertificateNo, .lrn
|
|
414
|
+
const step8 = ref({
|
|
415
|
+
question: "What is the learner's PSA Birth Certificate No. and LRN?",
|
|
416
|
+
answer: {
|
|
417
|
+
psaBirthCertificateNo: "",
|
|
418
|
+
lrn: "",
|
|
419
|
+
},
|
|
420
|
+
save() {
|
|
421
|
+
enrollment.value.learnerInfo.psaBirthCertificateNo =
|
|
422
|
+
step8.value.answer.psaBirthCertificateNo;
|
|
423
|
+
enrollment.value.learnerInfo.lrn = step8.value.answer.lrn;
|
|
424
|
+
},
|
|
425
|
+
valid: false,
|
|
426
|
+
});
|
|
427
|
+
|
|
428
|
+
// enrollment.learnerInfo.lastName, .firstName, .middleName, .extensionName
|
|
429
|
+
const step9 = ref({
|
|
430
|
+
question: "What is the learner's full name?",
|
|
431
|
+
answer: {
|
|
432
|
+
lastName: "",
|
|
433
|
+
firstName: "",
|
|
434
|
+
middleName: "",
|
|
435
|
+
extensionName: "",
|
|
436
|
+
},
|
|
437
|
+
save() {
|
|
438
|
+
enrollment.value.learnerInfo.lastName = step9.value.answer.lastName;
|
|
439
|
+
enrollment.value.learnerInfo.firstName = step9.value.answer.firstName;
|
|
440
|
+
enrollment.value.learnerInfo.middleName = step9.value.answer.middleName;
|
|
441
|
+
enrollment.value.learnerInfo.extensionName =
|
|
442
|
+
step9.value.answer.extensionName;
|
|
443
|
+
},
|
|
444
|
+
valid: false,
|
|
445
|
+
});
|
|
446
|
+
|
|
447
|
+
// enrollment.learnerInfo.birthDate, .age
|
|
448
|
+
const step10 = ref({
|
|
449
|
+
question: "What is the learner's birthdate?",
|
|
450
|
+
answer: {
|
|
451
|
+
birthDate: "",
|
|
452
|
+
age: 0,
|
|
453
|
+
},
|
|
454
|
+
save() {
|
|
455
|
+
enrollment.value.learnerInfo.birthDate = step10.value.answer.birthDate;
|
|
456
|
+
enrollment.value.learnerInfo.age = step10.value.answer.age;
|
|
457
|
+
},
|
|
458
|
+
valid: false,
|
|
459
|
+
});
|
|
460
|
+
|
|
461
|
+
// enrollment.learnerInfo.sex
|
|
462
|
+
const step11 = ref({
|
|
463
|
+
question: "What is the learner's sex?",
|
|
464
|
+
answer: {
|
|
465
|
+
sex: "",
|
|
466
|
+
},
|
|
467
|
+
save() {
|
|
468
|
+
enrollment.value.learnerInfo.sex = step11.value.answer.sex;
|
|
469
|
+
},
|
|
470
|
+
valid: false,
|
|
471
|
+
});
|
|
472
|
+
|
|
473
|
+
// enrollment.learnerInfo.placeOfBirth
|
|
474
|
+
const step12 = ref({
|
|
475
|
+
question: "What is the learner's place of birth?",
|
|
476
|
+
answer: {
|
|
477
|
+
placeOfBirth: {
|
|
478
|
+
region: "",
|
|
479
|
+
regionName: "",
|
|
480
|
+
province: "",
|
|
481
|
+
provinceName: "",
|
|
482
|
+
cityMunicipality: "",
|
|
483
|
+
cityMunicipalityName: "",
|
|
484
|
+
},
|
|
485
|
+
},
|
|
486
|
+
save() {
|
|
487
|
+
enrollment.value.learnerInfo.placeOfBirth = {
|
|
488
|
+
...step12.value.answer.placeOfBirth,
|
|
489
|
+
};
|
|
490
|
+
},
|
|
491
|
+
valid: false,
|
|
492
|
+
});
|
|
493
|
+
|
|
494
|
+
// enrollment.learnerInfo.motherTongue
|
|
495
|
+
const step13 = ref({
|
|
496
|
+
question: "What is the learner's mother tongue?",
|
|
497
|
+
answer: {
|
|
498
|
+
motherTongue: "",
|
|
499
|
+
},
|
|
500
|
+
save() {
|
|
501
|
+
enrollment.value.learnerInfo.motherTongue =
|
|
502
|
+
step13.value.answer.motherTongue;
|
|
503
|
+
},
|
|
504
|
+
valid: false,
|
|
505
|
+
});
|
|
506
|
+
|
|
507
|
+
// enrollment.learnerInfo.indigenousCommunity
|
|
508
|
+
const step14 = ref({
|
|
509
|
+
question: "Is the learner part of an indigenous community?",
|
|
510
|
+
answer: {
|
|
511
|
+
indigenousCommunity: "",
|
|
512
|
+
},
|
|
513
|
+
save() {
|
|
514
|
+
enrollment.value.learnerInfo.indigenousCommunity =
|
|
515
|
+
step14.value.answer.indigenousCommunity;
|
|
516
|
+
},
|
|
517
|
+
valid: false,
|
|
518
|
+
});
|
|
519
|
+
|
|
520
|
+
// enrollment.learnerInfo.fourPsHouseholdId
|
|
521
|
+
const step15 = ref({
|
|
522
|
+
question: "Is the learner part of a 4Ps household?",
|
|
523
|
+
answer: {
|
|
524
|
+
fourPsHouseholdId: "",
|
|
525
|
+
},
|
|
526
|
+
save() {
|
|
527
|
+
enrollment.value.learnerInfo.fourPsHouseholdId =
|
|
528
|
+
step15.value.answer.fourPsHouseholdId;
|
|
529
|
+
},
|
|
530
|
+
valid: false,
|
|
531
|
+
});
|
|
532
|
+
|
|
533
|
+
// enrollment.learnerInfo.withDisability, .disabilities
|
|
534
|
+
const step16 = ref({
|
|
535
|
+
question: "Does the learner have a disability?",
|
|
536
|
+
answer: {
|
|
537
|
+
withDisability: false,
|
|
538
|
+
disabilities: [] as string[],
|
|
539
|
+
},
|
|
540
|
+
save() {
|
|
541
|
+
enrollment.value.learnerInfo.withDisability =
|
|
542
|
+
step16.value.answer.withDisability;
|
|
543
|
+
enrollment.value.learnerInfo.disabilities = [
|
|
544
|
+
...step16.value.answer.disabilities,
|
|
545
|
+
];
|
|
546
|
+
},
|
|
547
|
+
valid: false,
|
|
548
|
+
});
|
|
549
|
+
|
|
550
|
+
// enrollment.address.current
|
|
551
|
+
const step17 = ref({
|
|
552
|
+
question: "What is the learner's current address?",
|
|
553
|
+
answer: {
|
|
554
|
+
houseNumber: "",
|
|
555
|
+
streetName: "",
|
|
556
|
+
sitio: "",
|
|
557
|
+
barangay: "",
|
|
558
|
+
barangayName: "",
|
|
559
|
+
municipalityCity: "",
|
|
560
|
+
municipalityCityName: "",
|
|
561
|
+
province: "",
|
|
562
|
+
provinceName: "",
|
|
563
|
+
region: "",
|
|
564
|
+
regionName: "",
|
|
565
|
+
country: "",
|
|
566
|
+
zipCode: "",
|
|
567
|
+
},
|
|
568
|
+
save() {
|
|
569
|
+
enrollment.value.address.current = { ...step17.value.answer };
|
|
570
|
+
},
|
|
571
|
+
valid: false,
|
|
572
|
+
});
|
|
573
|
+
|
|
574
|
+
// enrollment.address.permanent
|
|
575
|
+
const step18 = ref({
|
|
576
|
+
question: "What is the learner's permanent address?",
|
|
577
|
+
answer: {
|
|
578
|
+
houseNumber: "",
|
|
579
|
+
streetName: "",
|
|
580
|
+
sitio: "",
|
|
581
|
+
barangay: "",
|
|
582
|
+
municipalityCity: "",
|
|
583
|
+
municipalityCityName: "",
|
|
584
|
+
province: "",
|
|
585
|
+
region: "",
|
|
586
|
+
regionName: "",
|
|
587
|
+
country: "",
|
|
588
|
+
zipCode: "",
|
|
589
|
+
},
|
|
590
|
+
save() {
|
|
591
|
+
enrollment.value.address.permanent = { ...step18.value.answer };
|
|
592
|
+
},
|
|
593
|
+
valid: false,
|
|
594
|
+
});
|
|
595
|
+
|
|
596
|
+
// enrollment.parentGuardianInfo.father
|
|
597
|
+
const step19 = ref({
|
|
598
|
+
question: "What is the learner's father's name?",
|
|
599
|
+
answer: {
|
|
600
|
+
firstName: "",
|
|
601
|
+
lastName: "",
|
|
602
|
+
middleName: "",
|
|
603
|
+
contactNumber: "",
|
|
604
|
+
},
|
|
605
|
+
save() {
|
|
606
|
+
enrollment.value.parentGuardianInfo.father = { ...step19.value.answer };
|
|
607
|
+
},
|
|
608
|
+
valid: false,
|
|
609
|
+
});
|
|
610
|
+
|
|
611
|
+
// enrollment.parentGuardianInfo.mother
|
|
612
|
+
const step20 = ref({
|
|
613
|
+
question: "What is the learner's mother's name?",
|
|
614
|
+
answer: {
|
|
615
|
+
firstName: "",
|
|
616
|
+
lastName: "",
|
|
617
|
+
middleName: "",
|
|
618
|
+
contactNumber: "",
|
|
619
|
+
},
|
|
620
|
+
save() {
|
|
621
|
+
enrollment.value.parentGuardianInfo.mother = { ...step20.value.answer };
|
|
622
|
+
},
|
|
623
|
+
valid: false,
|
|
624
|
+
});
|
|
625
|
+
|
|
626
|
+
// enrollment.parentGuardianInfo.legalGuardian
|
|
627
|
+
const step21 = ref({
|
|
628
|
+
question: "What is the learner's legal guardian's name?",
|
|
629
|
+
answer: {
|
|
630
|
+
firstName: "",
|
|
631
|
+
lastName: "",
|
|
632
|
+
middleName: "",
|
|
633
|
+
contactNumber: "",
|
|
634
|
+
},
|
|
635
|
+
save() {
|
|
636
|
+
enrollment.value.parentGuardianInfo.legalGuardian = {
|
|
637
|
+
...step21.value.answer,
|
|
638
|
+
};
|
|
639
|
+
},
|
|
640
|
+
valid: false,
|
|
641
|
+
});
|
|
642
|
+
|
|
643
|
+
// enrollment.returningLearnerInfo.lastGradeLevelCompleted
|
|
644
|
+
const step22 = ref({
|
|
645
|
+
question: "What grade level did the learner last complete?",
|
|
646
|
+
answer: {
|
|
647
|
+
lastGradeLevelCompleted: "",
|
|
648
|
+
},
|
|
649
|
+
save() {
|
|
650
|
+
enrollment.value.returningLearnerInfo.lastGradeLevelCompleted =
|
|
651
|
+
step22.value.answer.lastGradeLevelCompleted;
|
|
652
|
+
},
|
|
653
|
+
valid: false,
|
|
654
|
+
});
|
|
655
|
+
|
|
656
|
+
// enrollment.returningLearnerInfo.lastSchoolYearCompleted
|
|
657
|
+
const step23 = ref({
|
|
658
|
+
question: "What school year did the learner last complete?",
|
|
659
|
+
answer: {
|
|
660
|
+
lastSchoolYearCompleted: "",
|
|
661
|
+
},
|
|
662
|
+
save() {
|
|
663
|
+
enrollment.value.returningLearnerInfo.lastSchoolYearCompleted =
|
|
664
|
+
step23.value.answer.lastSchoolYearCompleted;
|
|
665
|
+
},
|
|
666
|
+
valid: false,
|
|
667
|
+
});
|
|
668
|
+
|
|
669
|
+
// enrollment.returningLearnerInfo.lastSchoolAttended, .lastSchoolId
|
|
670
|
+
const step24 = ref({
|
|
671
|
+
question: "What school did the learner last attend?",
|
|
672
|
+
answer: {
|
|
673
|
+
lastSchoolAttended: "",
|
|
674
|
+
lastSchoolId: "",
|
|
675
|
+
},
|
|
676
|
+
save() {
|
|
677
|
+
enrollment.value.returningLearnerInfo.lastSchoolAttended =
|
|
678
|
+
step24.value.answer.lastSchoolAttended;
|
|
679
|
+
enrollment.value.returningLearnerInfo.lastSchoolId =
|
|
680
|
+
step24.value.answer.lastSchoolId;
|
|
681
|
+
},
|
|
682
|
+
valid: false,
|
|
683
|
+
});
|
|
684
|
+
|
|
685
|
+
// enrollment.alternativeLearningOptions
|
|
686
|
+
const step25 = ref({
|
|
687
|
+
question: "What alternative learning options do you want to enroll in?",
|
|
688
|
+
answer: {
|
|
689
|
+
alternativeLearningOptions: [] as string[],
|
|
690
|
+
},
|
|
691
|
+
save() {
|
|
692
|
+
enrollment.value.alternativeLearningOptions = [
|
|
693
|
+
...step25.value.answer.alternativeLearningOptions,
|
|
694
|
+
];
|
|
695
|
+
},
|
|
696
|
+
valid: false,
|
|
697
|
+
});
|
|
698
|
+
|
|
699
|
+
// enrollment.isCertifiedAndConsented
|
|
700
|
+
const step26 = ref({
|
|
701
|
+
question: `I hereby certify that the above information given are true and
|
|
702
|
+
correct to the best of my knowledge and I allow the Department of
|
|
703
|
+
Education to use my child's details to create and/or update his/her
|
|
704
|
+
learner profile in the Learner Information System. The information
|
|
705
|
+
herein shall be treated as confidential in compliance with the Data
|
|
706
|
+
Privacy Act of 2012.`,
|
|
707
|
+
answer: {
|
|
708
|
+
isCertifiedAndConsented: false,
|
|
709
|
+
},
|
|
710
|
+
save() {
|
|
711
|
+
enrollment.value.isCertifiedAndConsented =
|
|
712
|
+
step26.value.answer.isCertifiedAndConsented;
|
|
713
|
+
},
|
|
714
|
+
valid: false,
|
|
715
|
+
});
|
|
716
|
+
|
|
717
|
+
const currentStep = ref(1);
|
|
718
|
+
|
|
719
|
+
function goBack() {
|
|
720
|
+
if (currentStep.value === 1) {
|
|
721
|
+
emit("close");
|
|
722
|
+
} else {
|
|
723
|
+
currentStep.value--;
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
const isSeniorHigh = computed(
|
|
728
|
+
() =>
|
|
729
|
+
step3.value.answer.gradeLevel === "Grade 11" ||
|
|
730
|
+
step3.value.answer.gradeLevel === "Grade 12"
|
|
731
|
+
);
|
|
732
|
+
|
|
733
|
+
const totalSteps = computed(() => (isSeniorHigh.value ? 26 : 23));
|
|
734
|
+
|
|
735
|
+
const progress = computed(() =>
|
|
736
|
+
Math.round((currentStep.value / totalSteps.value) * 100)
|
|
737
|
+
);
|
|
738
|
+
</script>
|
|
@@ -143,15 +143,15 @@ const invite = ref({
|
|
|
143
143
|
const searchRole = ref("");
|
|
144
144
|
const roles = ref<Array<Record<string, any>>>([]);
|
|
145
145
|
|
|
146
|
-
const {
|
|
146
|
+
const { getAll } = useRole();
|
|
147
147
|
|
|
148
148
|
const { data: getRolesData, status: getRolesStatus } = await useLazyAsyncData(
|
|
149
149
|
"get-roles",
|
|
150
150
|
() =>
|
|
151
|
-
|
|
151
|
+
getAll({
|
|
152
152
|
search: searchRole.value,
|
|
153
|
-
|
|
154
|
-
|
|
153
|
+
app: prop.app,
|
|
154
|
+
org: prop.org,
|
|
155
155
|
limit: 20,
|
|
156
156
|
})
|
|
157
157
|
);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export default function useStrand() {
|
|
2
|
+
function getAll({
|
|
3
|
+
page = 1,
|
|
4
|
+
search = "",
|
|
5
|
+
status = "active",
|
|
6
|
+
limit = 100,
|
|
7
|
+
school = "",
|
|
8
|
+
track = "",
|
|
9
|
+
} = {}) {
|
|
10
|
+
return useNuxtApp().$api<Record<string, any>>(
|
|
11
|
+
`/api/basic-education/strands/school/${school}`,
|
|
12
|
+
{
|
|
13
|
+
query: { page, search, status, limit, track },
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return {
|
|
19
|
+
getAll,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export default function useTrack() {
|
|
2
|
+
function getAll({
|
|
3
|
+
page = 1,
|
|
4
|
+
search = "",
|
|
5
|
+
status = "active",
|
|
6
|
+
limit = 100,
|
|
7
|
+
school = "",
|
|
8
|
+
} = {}) {
|
|
9
|
+
return useNuxtApp().$api<Record<string, any>>(
|
|
10
|
+
`/api/basic-education/tracks/school/${school}`,
|
|
11
|
+
{
|
|
12
|
+
query: { page, search, status, limit },
|
|
13
|
+
}
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return {
|
|
18
|
+
getAll,
|
|
19
|
+
};
|
|
20
|
+
}
|
package/nuxt.config.ts
CHANGED
|
@@ -36,6 +36,7 @@ export default defineNuxtConfig({
|
|
|
36
36
|
APP_LOCAL_GOV_PROV: (process.env.APP_LOCAL_GOV_PROV as string) ?? "",
|
|
37
37
|
APP_LOCAL_GOV_CITY: (process.env.APP_LOCAL_GOV_CITY as string) ?? "",
|
|
38
38
|
APP_LOCAL_GOV_BRGY: (process.env.APP_LOCAL_GOV_BRGY as string) ?? "",
|
|
39
|
+
ENROLLMENT: (process.env.ENROLLMENT as string) ?? "",
|
|
39
40
|
},
|
|
40
41
|
},
|
|
41
42
|
|
package/package.json
CHANGED
package/types/enrollment.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ declare type TLearner = {
|
|
|
24
24
|
learnerInfo: EnrLearnerInfo;
|
|
25
25
|
parentGuardianInfo: EnrParentGuardianInfo;
|
|
26
26
|
address: AddressInformation;
|
|
27
|
-
returningLearnerInfo
|
|
27
|
+
returningLearnerInfo: EnrReturningLearnerInfo;
|
|
28
28
|
seniorHighInfo?: EnrSeniorHighInformation;
|
|
29
29
|
lastGradeLevelCompleted?: string;
|
|
30
30
|
lastSchoolYearCompleted?: string;
|