Commit 7014df603e9e53bfcf01d624be2f5b7603068636

Authored by Shikha Mishra
1 parent dc7f013460

Improve placeholder name while changing passowrd, Clear preavious data while sel…

…ecting class from drop-down in student attendence, exam schedule, marks, students, routine, time table,global payment, progress card report and id card report and Student data was not showing at some times issue solved
src/pages/Academic/routine.vue
1 <template> 1 <template>
2 <v-container fluid class="body-color"> 2 <v-container fluid class="body-color">
3 <!-- ****** EDIT Subject ****** --> 3 <!-- ****** EDIT Subject ****** -->
4 <v-dialog v-model="editRoutineDialog" max-width="600px" persistent> 4 <v-dialog v-model="editRoutineDialog" max-width="600px" persistent>
5 <v-card flat class="card-style pa-2" dark> 5 <v-card flat class="card-style pa-2" dark>
6 <v-layout> 6 <v-layout>
7 <v-flex xs12> 7 <v-flex xs12>
8 <label class="title text-xs-center">Edit Routine</label> 8 <label class="title text-xs-center">Edit Routine</label>
9 <v-icon size="24" class="right" @click="editRoutineDialog = false">cancel</v-icon> 9 <v-icon size="24" class="right" @click="editRoutineDialog = false">cancel</v-icon>
10 </v-flex> 10 </v-flex>
11 </v-layout> 11 </v-layout>
12 <v-container fluid> 12 <v-container fluid>
13 <v-form ref="formEditRoutine" v-model="validEditRoutine" lazy-validation> 13 <v-form ref="formEditRoutine" v-model="validEditRoutine" lazy-validation>
14 <v-layout> 14 <v-layout>
15 <v-flex xs3 sm4 class="pt-4 subheading"> 15 <v-flex xs3 sm4 class="pt-4 subheading">
16 <label class="right">Class :</label> 16 <label class="right">Class :</label>
17 </v-flex> 17 </v-flex>
18 <v-flex xs8 sm8 class="ml-2"> 18 <v-flex xs8 sm8 class="ml-2">
19 <v-select 19 <v-select
20 :items="classList" 20 :items="classList"
21 label="Select your Class" 21 label="Select your Class"
22 v-model="editedItem.classId" 22 v-model="editedItem.classId"
23 item-text="classNum" 23 item-text="classNum"
24 item-value="_id" 24 item-value="_id"
25 :rules="classRules" 25 :rules="classRules"
26 @change="getClassSubject(editedItem.classId)" 26 @change="getClassSubject(editedItem.classId)"
27 required 27 required
28 ></v-select> 28 ></v-select>
29 </v-flex> 29 </v-flex>
30 </v-layout> 30 </v-layout>
31 <v-layout> 31 <v-layout>
32 <v-flex xs3 sm4 class="pt-4 subheading"> 32 <v-flex xs3 sm4 class="pt-4 subheading">
33 <label class="right">Subject :</label> 33 <label class="right">Subject :</label>
34 </v-flex> 34 </v-flex>
35 <v-flex xs8 sm8 class="ml-2"> 35 <v-flex xs8 sm8 class="ml-2">
36 <v-select 36 <v-select
37 :items="subjectList.subjects" 37 :items="subjectList.subjects"
38 label="Select your subject" 38 label="Select your subject"
39 v-model="editedItem.subjectName" 39 v-model="editedItem.subjectName"
40 item-text="subjectName" 40 item-text="subjectName"
41 item-value="_id" 41 item-value="_id"
42 :rules="subjectRules" 42 :rules="subjectRules"
43 required 43 required
44 ></v-select> 44 ></v-select>
45 </v-flex> 45 </v-flex>
46 </v-layout> 46 </v-layout>
47 <v-layout> 47 <v-layout>
48 <v-flex xs4 sm4 class="pt-4 subheading"> 48 <v-flex xs4 sm4 class="pt-4 subheading">
49 <label class="right">Teacher Name :</label> 49 <label class="right">Teacher Name :</label>
50 </v-flex> 50 </v-flex>
51 <v-flex xs8 sm8 class="ml-3"> 51 <v-flex xs8 sm8 class="ml-3">
52 <v-select 52 <v-select
53 :items="teacherList" 53 :items="teacherList"
54 label="Select your teacher" 54 label="Select your teacher"
55 v-model="editedItem.teacherId" 55 v-model="editedItem.teacherId"
56 item-text="name" 56 item-text="name"
57 item-value="_id" 57 item-value="_id"
58 :rules="teacherRules" 58 :rules="teacherRules"
59 required 59 required
60 ></v-select> 60 ></v-select>
61 </v-flex> 61 </v-flex>
62 </v-layout> 62 </v-layout>
63 <v-layout> 63 <v-layout>
64 <v-flex xs5 sm4 class="pt-4 subheading"> 64 <v-flex xs5 sm4 class="pt-4 subheading">
65 <label class="right">Starting time:</label> 65 <label class="right">Starting time:</label>
66 </v-flex> 66 </v-flex>
67 <v-flex xs7 sm6 class="ml-3"> 67 <v-flex xs7 sm6 class="ml-3">
68 <v-menu 68 <v-menu
69 ref="menuC" 69 ref="menuC"
70 :close-on-content-click="false" 70 :close-on-content-click="false"
71 v-model="menu4" 71 v-model="menu4"
72 :nudge-right="40" 72 :nudge-right="40"
73 lazy 73 lazy
74 transition="scale-transition" 74 transition="scale-transition"
75 offset-y 75 offset-y
76 full-width 76 full-width
77 max-width="290px" 77 max-width="290px"
78 min-width="290px" 78 min-width="290px"
79 > 79 >
80 <v-text-field 80 <v-text-field
81 slot="activator" 81 slot="activator"
82 v-model="editedItem.startingTime" 82 v-model="editedItem.startingTime"
83 placeholder="Select your starting time" 83 placeholder="Select your starting time"
84 append-icon="access_time" 84 append-icon="access_time"
85 readonly 85 readonly
86 ></v-text-field> 86 ></v-text-field>
87 <v-time-picker v-model="editedItem.startingTime" @change="menu4= false"></v-time-picker> 87 <v-time-picker v-model="editedItem.startingTime" @change="menu4= false"></v-time-picker>
88 </v-menu> 88 </v-menu>
89 </v-flex> 89 </v-flex>
90 </v-layout> 90 </v-layout>
91 <v-layout> 91 <v-layout>
92 <v-flex xs5 sm4 class="pt-4 subheading"> 92 <v-flex xs5 sm4 class="pt-4 subheading">
93 <label class="right">Ending Time:</label> 93 <label class="right">Ending Time:</label>
94 </v-flex> 94 </v-flex>
95 <v-flex xs7 sm6 class="ml-3"> 95 <v-flex xs7 sm6 class="ml-3">
96 <v-menu 96 <v-menu
97 ref="menuB" 97 ref="menuB"
98 :close-on-content-click="false" 98 :close-on-content-click="false"
99 v-model="menu3" 99 v-model="menu3"
100 :nudge-right="40" 100 :nudge-right="40"
101 lazy 101 lazy
102 transition="scale-transition" 102 transition="scale-transition"
103 offset-y 103 offset-y
104 full-width 104 full-width
105 max-width="290px" 105 max-width="290px"
106 min-width="290px" 106 min-width="290px"
107 > 107 >
108 <v-text-field 108 <v-text-field
109 slot="activator" 109 slot="activator"
110 v-model="editedItem.endingTime" 110 v-model="editedItem.endingTime"
111 placeholder="Select your end time" 111 placeholder="Select your end time"
112 append-icon="access_time" 112 append-icon="access_time"
113 readonly 113 readonly
114 ></v-text-field> 114 ></v-text-field>
115 <v-time-picker v-model="editedItem.endingTime" @change="menu3 = false"></v-time-picker> 115 <v-time-picker v-model="editedItem.endingTime" @change="menu3 = false"></v-time-picker>
116 </v-menu> 116 </v-menu>
117 </v-flex> 117 </v-flex>
118 </v-layout> 118 </v-layout>
119 <v-layout> 119 <v-layout>
120 <v-flex xs4 sm4 class="pt-4 subheading"> 120 <v-flex xs4 sm4 class="pt-4 subheading">
121 <label class="right">Room:</label> 121 <label class="right">Room:</label>
122 </v-flex> 122 </v-flex>
123 <v-flex xs8 sm8 class="ml-3"> 123 <v-flex xs8 sm8 class="ml-3">
124 <v-text-field 124 <v-text-field
125 label="fill your room" 125 label="fill your room"
126 :rules="roomRules" 126 :rules="roomRules"
127 v-model="editedItem.room" 127 v-model="editedItem.room"
128 @keyup.enter="submit" 128 @keyup.enter="submit"
129 ></v-text-field> 129 ></v-text-field>
130 </v-flex> 130 </v-flex>
131 </v-layout> 131 </v-layout>
132 <v-layout> 132 <v-layout>
133 <v-flex xs4 sm4 class="pt-4 subheading"> 133 <v-flex xs4 sm4 class="pt-4 subheading">
134 <label class="right">Period:</label> 134 <label class="right">Period:</label>
135 </v-flex> 135 </v-flex>
136 <v-flex xs8 sm8 class="ml-3"> 136 <v-flex xs8 sm8 class="ml-3">
137 <v-text-field 137 <v-text-field
138 label="fill your period" 138 label="fill your period"
139 :rules="periodRules" 139 :rules="periodRules"
140 v-model="editedItem.period" 140 v-model="editedItem.period"
141 @keyup.enter="submit" 141 @keyup.enter="submit"
142 ></v-text-field> 142 ></v-text-field>
143 </v-flex> 143 </v-flex>
144 </v-layout> 144 </v-layout>
145 <v-layout> 145 <v-layout>
146 <v-flex xs12 sm12> 146 <v-flex xs12 sm12>
147 <v-card-actions> 147 <v-card-actions>
148 <v-spacer></v-spacer> 148 <v-spacer></v-spacer>
149 <v-btn 149 <v-btn
150 @click="update" 150 @click="update"
151 round 151 round
152 dark 152 dark
153 :loading="loading" 153 :loading="loading"
154 class="add-button" 154 class="add-button"
155 >Update Routine</v-btn> 155 >Update Routine</v-btn>
156 </v-card-actions> 156 </v-card-actions>
157 </v-flex> 157 </v-flex>
158 </v-layout> 158 </v-layout>
159 </v-form> 159 </v-form>
160 </v-container> 160 </v-container>
161 </v-card> 161 </v-card>
162 </v-dialog> 162 </v-dialog>
163 163
164 <!-- ****** EXISTING ROUTINE TABLE ****** --> 164 <!-- ****** EXISTING ROUTINE TABLE ****** -->
165 <v-toolbar color="transparent" flat> 165 <v-toolbar color="transparent" flat>
166 <v-btn 166 <v-btn
167 fab 167 fab
168 dark 168 dark
169 class="open-dialog-button hidden-xl-only hidden-md-only hidden-lg-only" 169 class="open-dialog-button hidden-xl-only hidden-md-only hidden-lg-only"
170 small 170 small
171 @click="addRoutineDialog = true" 171 @click="addRoutineDialog = true"
172 > 172 >
173 <v-icon dark>add</v-icon> 173 <v-icon dark>add</v-icon>
174 </v-btn> 174 </v-btn>
175 <v-flex xs1 class="hidden-sm-only hidden-xs-only"> 175 <v-flex xs1 class="hidden-sm-only hidden-xs-only">
176 <v-btn 176 <v-btn
177 round 177 round
178 class="open-dialog-button" 178 class="open-dialog-button"
179 dark 179 dark
180 @click="addRoutineDialog = true" 180 @click="addRoutineDialog = true"
181 v-if="role != 'TEACHER' " 181 v-if="role != 'TEACHER' "
182 > 182 >
183 <v-icon class="white--text pr-1" size="20">add</v-icon>Add Routine 183 <v-icon class="white--text pr-1" size="20">add</v-icon>Add Routine
184 </v-btn> 184 </v-btn>
185 </v-flex> 185 </v-flex>
186 <v-spacer></v-spacer> 186 <v-spacer></v-spacer>
187 <v-flex lg2 md2 xs12 v-show="show"> 187 <v-flex lg2 md2 xs12 v-show="show">
188 <v-select 188 <v-select
189 :items="classList" 189 :items="classList"
190 label="Select Your Class" 190 label="Select Your Class"
191 v-model="addRoutineList.classId" 191 v-model="addRoutineList.classId"
192 item-text="classNum" 192 item-text="classNum"
193 item-value="_id" 193 item-value="_id"
194 name="Select Class" 194 name="Select Class"
195 :rules="classRules" 195 :rules="classRules"
196 @change="getSections(addRoutineList.classId)" 196 @change="getSections(addRoutineList.classId)"
197 class="pl-2" 197 class="pl-2"
198 required 198 required
199 ></v-select> 199 ></v-select>
200 </v-flex> 200 </v-flex>
201 <v-flex xs8 sm3 md2 class="mr-3"> 201 <v-flex xs8 sm3 md2 class="mr-3">
202 <v-select 202 <v-select
203 v-model="addRoutineList.sectionId" 203 v-model="addRoutineList.sectionId"
204 label="Select your section" 204 label="Select your section"
205 :items="addSection" 205 :items="addSection"
206 item-text="name" 206 item-text="name"
207 item-value="_id" 207 item-value="_id"
208 name="Select Section" 208 name="Select Section"
209 :rules="sectionRules" 209 :rules="sectionRules"
210 @change="getRoutineList()" 210 @change="getRoutineList()"
211 class="pl-2" 211 class="pl-2"
212 required 212 required
213 ></v-select> 213 ></v-select>
214 </v-flex> 214 </v-flex>
215 <v-card-title class="body-1" v-show="show"> 215 <v-card-title class="body-1" v-show="show">
216 <v-btn icon flat @click="displaySearch"> 216 <v-btn icon flat @click="displaySearch">
217 <v-avatar size="27"> 217 <v-avatar size="27">
218 <img src="/static/icon/search.png" alt="icon" /> 218 <img src="/static/icon/search.png" alt="icon" />
219 </v-avatar> 219 </v-avatar>
220 </v-btn> 220 </v-btn>
221 </v-card-title> 221 </v-card-title>
222 <v-flex xs9 sm9 md2 lg2 xl2 v-if="showSearch"> 222 <v-flex xs9 sm9 md2 lg2 xl2 v-if="showSearch">
223 <v-layout> 223 <v-layout>
224 <v-text-field 224 <v-text-field
225 autofocus 225 autofocus
226 v-model="search" 226 v-model="search"
227 label="Search" 227 label="Search"
228 prepend-inner-icon="search" 228 prepend-inner-icon="search"
229 color="primary" 229 color="primary"
230 style="transition: 0.8s cubic-bezier(0.25, 0.8, 0.25, 1); !important" 230 style="transition: 0.8s cubic-bezier(0.25, 0.8, 0.25, 1); !important"
231 ></v-text-field> 231 ></v-text-field>
232 <v-icon @click="closeSearch" color="error">close</v-icon> 232 <v-icon @click="closeSearch" color="error">close</v-icon>
233 </v-layout> 233 </v-layout>
234 </v-flex> 234 </v-flex>
235 </v-toolbar> 235 </v-toolbar>
236 236
237 <div class="col-sm-12"> 237 <div class="col-sm-12">
238 <div class="box-body"> 238 <div class="box-body">
239 <div class="row"> 239 <div class="row">
240 <div class="col-sm-12"> 240 <div class="col-sm-12">
241 <div class="nav-tabs-custom"> 241 <div class="nav-tabs-custom">
242 <ul class="nav nav-tabs"> 242 <ul class="nav nav-tabs">
243 <li class="active"> 243 <li class="active">
244 <a data-toggle="tab" href="#all" aria-expanded="true">All Routines</a> 244 <a data-toggle="tab" href="#all" aria-expanded="true">All Routines</a>
245 </li> 245 </li>
246 </ul> 246 </ul>
247 247
248 <div class="tab-content" v-show="hideTable"> 248 <div class="tab-content" v-show="hideTable">
249 <div id="all" class="tab-pane active mCustomScrollbar _mCS_1 mCS_no_scrollbar"> 249 <div id="all" class="tab-pane active mCustomScrollbar _mCS_1 mCS_no_scrollbar">
250 <div 250 <div
251 id="mCSB_1" 251 id="mCSB_1"
252 class="mCustomScrollBox mCS-light" 252 class="mCustomScrollBox mCS-light"
253 style="max-height: none;" 253 style="max-height: none;"
254 tabindex="0" 254 tabindex="0"
255 > 255 >
256 <div 256 <div
257 id="mCSB_1_container" 257 id="mCSB_1_container"
258 class="mCSB_container mCS_x_hidden mCS_no_scrollbar_x" 258 class="mCSB_container mCS_x_hidden mCS_no_scrollbar_x"
259 style="position: relative; top: 0px; left: 0px; width: 100%;" 259 style="position: relative; top: 0px; left: 0px; width: 100%;"
260 dir="ltr" 260 dir="ltr"
261 > 261 >
262 <div id="hide-table-2"> 262 <div id="hide-table-2">
263 <table id="table" class="table table-striped"> 263 <table id="table" class="table table-striped">
264 <tbody> 264 <tbody>
265 <tr> 265 <tr>
266 <td>MONDAY</td> 266 <td>MONDAY</td>
267 </tr> 267 </tr>
268 <tr> 268 <tr>
269 <td>TUESDAY</td> 269 <td>TUESDAY</td>
270 </tr> 270 </tr>
271 <tr> 271 <tr>
272 <td>WEDNESDAY</td> 272 <td>WEDNESDAY</td>
273 </tr> 273 </tr>
274 <tr> 274 <tr>
275 <td>THURSDAY</td> 275 <td>THURSDAY</td>
276 </tr> 276 </tr>
277 <tr> 277 <tr>
278 <td>FRIDAY</td> 278 <td>FRIDAY</td>
279 </tr> 279 </tr>
280 <tr> 280 <tr>
281 <td>SATURDAY</td> 281 <td>SATURDAY</td>
282 </tr> 282 </tr>
283 </tbody> 283 </tbody>
284 </table> 284 </table>
285 </div> 285 </div>
286 </div> 286 </div>
287 <div 287 <div
288 id="mCSB_1_scrollbar_horizontal" 288 id="mCSB_1_scrollbar_horizontal"
289 class="mCSB_scrollTools mCSB_1_scrollbar mCS-light mCSB_scrollTools_horizontal" 289 class="mCSB_scrollTools mCSB_1_scrollbar mCS-light mCSB_scrollTools_horizontal"
290 style="display: none;" 290 style="display: none;"
291 > 291 >
292 <div class="mCSB_draggerContainer"> 292 <div class="mCSB_draggerContainer">
293 <div 293 <div
294 id="mCSB_1_dragger_horizontal" 294 id="mCSB_1_dragger_horizontal"
295 class="mCSB_dragger" 295 class="mCSB_dragger"
296 style="position: absolute; min-width: 30px; width: 0px; left: 0px;" 296 style="position: absolute; min-width: 30px; width: 0px; left: 0px;"
297 > 297 >
298 <div class="mCSB_dragger_bar"></div> 298 <div class="mCSB_dragger_bar"></div>
299 </div> 299 </div>
300 <div class="mCSB_draggerRail"></div> 300 <div class="mCSB_draggerRail"></div>
301 </div> 301 </div>
302 </div> 302 </div>
303 </div> 303 </div>
304 </div> 304 </div>
305 </div> 305 </div>
306 <div> 306 <div>
307 <table id="table" class="table table-bordered" v-show="showTable"> 307 <table id="table" class="table table-bordered" v-show="showTable">
308 <tbody> 308 <tbody>
309 <div class="nav-tabs-custom"> 309 <div class="nav-tabs-custom">
310 <div class="tab-content" id="scrolling"> 310 <div class="tab-content" id="scrolling">
311 <div id="hide-table-2"> 311 <div id="hide-table-2">
312 <v-data-table :items="routineList"> 312 <v-data-table :items="routineList">
313 <template slot="items" slot-scope="props"> 313 <template slot="items" slot-scope="props">
314 <tr class="tr"> 314 <tr class="tr">
315 <td>{{ props.item.day }}</td> 315 <td>{{ props.item.day }}</td>
316 <td class="text-center" v-for="list in props.item.lectureRoutine"> 316 <td class="text-center" v-for="list in props.item.lectureRoutine">
317 {{ props.item.classId.classNum }} 317 {{ props.item.classId.classNum }}
318 <br /> 318 <br />
319 {{ props.item.sectionId.name }} 319 {{ props.item.sectionId.name }}
320 <br /> 320 <br />
321 {{ list.startingTime }} - {{ list.endingTime }} 321 {{ list.startingTime }} - {{ list.endingTime }}
322 <br /> 322 <br />
323 {{ list.room }} 323 {{ list.room }}
324 <br /> 324 <br />
325 {{ list.subjectName }} 325 {{ list.subjectName }}
326 <br /> 326 <br />
327 {{ list.teacherId.name}} 327 {{ list.teacherId.name}}
328 <br /> 328 <br />
329 <span> 329 <span>
330 <v-tooltip top> 330 <v-tooltip top>
331 <img 331 <img
332 slot="activator" 332 slot="activator"
333 style="cursor:pointer; width:20px; height:18px; " 333 style="cursor:pointer; width:20px; height:18px; "
334 class="mr-3" 334 class="mr-3"
335 @click="editItem(list, props.item)" 335 @click="editItem(list, props.item)"
336 src="/static/icon/edit.png" 336 src="/static/icon/edit.png"
337 /> 337 />
338 <span>Edit</span> 338 <span>Edit</span>
339 </v-tooltip> 339 </v-tooltip>
340 <v-tooltip top> 340 <v-tooltip top>
341 <img 341 <img
342 slot="activator" 342 slot="activator"
343 style="cursor:pointer; width:20px; height:18px; " 343 style="cursor:pointer; width:20px; height:18px; "
344 class="mr-3" 344 class="mr-3"
345 @click="deleteItem(props.item)" 345 @click="deleteItem(props.item)"
346 src="/static/icon/delete.png" 346 src="/static/icon/delete.png"
347 /> 347 />
348 <span>Delete</span> 348 <span>Delete</span>
349 </v-tooltip> 349 </v-tooltip>
350 </span> 350 </span>
351 </td> 351 </td>
352 </tr> 352 </tr>
353 </template> 353 </template>
354 </v-data-table> 354 </v-data-table>
355 </div> 355 </div>
356 </div> 356 </div>
357 </div> 357 </div>
358 </tbody> 358 </tbody>
359 </table> 359 </table>
360 </div> 360 </div>
361 </div> 361 </div>
362 </div> 362 </div>
363 </div> 363 </div>
364 </div> 364 </div>
365 </div> 365 </div>
366 <!-- ****** ADD MULTIPLE Subject ****** --> 366 <!-- ****** ADD MULTIPLE Subject ****** -->
367 <v-snackbar 367 <v-snackbar
368 :timeout="timeout" 368 :timeout="timeout"
369 :top="y === 'top'" 369 :top="y === 'top'"
370 :right="x === 'right'" 370 :right="x === 'right'"
371 :vertical="mode === 'vertical'" 371 :vertical="mode === 'vertical'"
372 v-model="snackbar" 372 v-model="snackbar"
373 :color="color" 373 :color="color"
374 >{{ text }}</v-snackbar> 374 >{{ text }}</v-snackbar>
375 <v-dialog v-model="addRoutineDialog" max-width="600px" v-if="addRoutineDialog" persistent> 375 <v-dialog v-model="addRoutineDialog" max-width="600px" v-if="addRoutineDialog" persistent>
376 v-if="addRoutineDialog" 376 v-if="addRoutineDialog"
377 <v-card flat class="card-style pa-2" dark> 377 <v-card flat class="card-style pa-2" dark>
378 <v-layout> 378 <v-layout>
379 <v-flex xs12> 379 <v-flex xs12>
380 <label class="title text-xs-center">Add Routine</label> 380 <label class="title text-xs-center">Add Routine</label>
381 <v-icon size="24" class="right" @click="closeAddRoutineModel">cancel</v-icon> 381 <v-icon size="24" class="right" @click="closeAddRoutineModel">cancel</v-icon>
382 </v-flex> 382 </v-flex>
383 </v-layout> 383 </v-layout>
384 <v-container fluid fill-height> 384 <v-container fluid fill-height>
385 <v-layout align-center> 385 <v-layout align-center>
386 <v-flex xs12> 386 <v-flex xs12>
387 <v-form ref="form" v-model="valid" lazy-validation> 387 <v-form ref="form" v-model="valid" lazy-validation>
388 <v-layout> 388 <v-layout>
389 <v-flex xs4 sm4 class="pt-4 subheading"> 389 <v-flex xs4 sm4 class="pt-4 subheading">
390 <label class="right">School Year :</label> 390 <label class="right">School Year :</label>
391 </v-flex> 391 </v-flex>
392 <v-flex xs8 sm8 class="ml-3"> 392 <v-flex xs8 sm8 class="ml-3">
393 <v-text-field 393 <v-text-field
394 label="fill your year" 394 label="fill your year"
395 :rules="schoolRules" 395 :rules="schoolRules"
396 v-model="addRoutine.schoolYear" 396 v-model="addRoutine.schoolYear"
397 ></v-text-field> 397 ></v-text-field>
398 </v-flex> 398 </v-flex>
399 </v-layout> 399 </v-layout>
400 <v-layout> 400 <v-layout>
401 <v-flex xs4 sm4 class="pt-4 subheading"> 401 <v-flex xs4 sm4 class="pt-4 subheading">
402 <label class="right">Class :</label> 402 <label class="right">Class :</label>
403 </v-flex> 403 </v-flex>
404 <v-flex xs8 sm8 class="ml-3"> 404 <v-flex xs8 sm8 class="ml-3">
405 <v-select 405 <v-select
406 :items="classList" 406 :items="classList"
407 item-text="classNum" 407 item-text="classNum"
408 item-value="_id" 408 item-value="_id"
409 v-model="addRoutine.classId" 409 v-model="addRoutine.classId"
410 label="Select Class" 410 label="Select Class"
411 :rules="classRules" 411 :rules="classRules"
412 @change="getSections(addRoutine.classId)" 412 @change="getSections(addRoutine.classId)"
413 class="pl-2" 413 class="pl-2"
414 required 414 required
415 ></v-select> 415 ></v-select>
416 </v-flex> 416 </v-flex>
417 </v-layout> 417 </v-layout>
418 <v-layout> 418 <v-layout>
419 <v-flex xs4 sm4 class="pt-4 subheading"> 419 <v-flex xs4 sm4 class="pt-4 subheading">
420 <label class="right">Section :</label> 420 <label class="right">Section :</label>
421 </v-flex> 421 </v-flex>
422 <v-flex xs8 sm8 class="ml-3"> 422 <v-flex xs8 sm8 class="ml-3">
423 <v-select 423 <v-select
424 :items="addSection" 424 :items="addSection"
425 item-text="name" 425 item-text="name"
426 item-value="_id" 426 item-value="_id"
427 v-model="addRoutine.sectionId" 427 v-model="addRoutine.sectionId"
428 label="Select Section" 428 label="Select Section"
429 :rules="sectionRules" 429 :rules="sectionRules"
430 @change="getClassSubject(addRoutine.classId)" 430 @change="getClassSubject(addRoutine.classId)"
431 class="px-2" 431 class="px-2"
432 required 432 required
433 ></v-select> 433 ></v-select>
434 </v-flex> 434 </v-flex>
435 </v-layout> 435 </v-layout>
436 <v-layout> 436 <v-layout>
437 <v-flex xs3 sm4 class="pt-4 subheading"> 437 <v-flex xs3 sm4 class="pt-4 subheading">
438 <label class="right">Subject :</label> 438 <label class="right">Subject :</label>
439 </v-flex> 439 </v-flex>
440 <v-flex xs8 sm8 class="ml-2"> 440 <v-flex xs8 sm8 class="ml-2">
441 <v-select 441 <v-select
442 :items="subjectList.subjects" 442 :items="subjectList.subjects"
443 label="Select your subject" 443 label="Select your subject"
444 v-model="addRoutine.subjectName" 444 v-model="addRoutine.subjectName"
445 item-text="subjectName" 445 item-text="subjectName"
446 item-value="subjectName" 446 item-value="subjectName"
447 :rules="subjectRules" 447 :rules="subjectRules"
448 required 448 required
449 ></v-select> 449 ></v-select>
450 </v-flex> 450 </v-flex>
451 </v-layout> 451 </v-layout>
452 <v-layout> 452 <v-layout>
453 <v-flex xs3 sm4 class="pt-4 subheading"> 453 <v-flex xs3 sm4 class="pt-4 subheading">
454 <label class="right">Day :</label> 454 <label class="right">Day :</label>
455 </v-flex> 455 </v-flex>
456 <v-flex xs8 sm8 class="ml-2"> 456 <v-flex xs8 sm8 class="ml-2">
457 <v-select 457 <v-select
458 :items="day" 458 :items="day"
459 label="Select your day" 459 label="Select your day"
460 v-model="addRoutine.day" 460 v-model="addRoutine.day"
461 item-text="text" 461 item-text="text"
462 :rules="dayRules" 462 :rules="dayRules"
463 required 463 required
464 ></v-select> 464 ></v-select>
465 </v-flex> 465 </v-flex>
466 </v-layout> 466 </v-layout>
467 <v-layout> 467 <v-layout>
468 <v-flex xs4 sm4 class="pt-4 subheading"> 468 <v-flex xs4 sm4 class="pt-4 subheading">
469 <label class="right">Teacher Name :</label> 469 <label class="right">Teacher Name :</label>
470 </v-flex> 470 </v-flex>
471 <v-flex xs8 sm8 class="ml-3"> 471 <v-flex xs8 sm8 class="ml-3">
472 <v-select 472 <v-select
473 v-model="addRoutine.teacherId" 473 v-model="addRoutine.teacherId"
474 label="Select your teacher" 474 label="Select your teacher"
475 type="text" 475 type="text"
476 :items="teacherList" 476 :items="teacherList"
477 item-text="name" 477 item-text="name"
478 item-value="_id" 478 item-value="_id"
479 :rules="teacherRules" 479 :rules="teacherRules"
480 required 480 required
481 ></v-select> 481 ></v-select>
482 </v-flex> 482 </v-flex>
483 </v-layout> 483 </v-layout>
484 <v-layout> 484 <v-layout>
485 <v-flex xs4 class="pt-4 subheading"> 485 <v-flex xs4 class="pt-4 subheading">
486 <label class="right">Starting time:</label> 486 <label class="right">Starting time:</label>
487 </v-flex> 487 </v-flex>
488 <v-flex xs8 sm6 class="ml-3"> 488 <v-flex xs8 sm6 class="ml-3">
489 <v-menu 489 <v-menu
490 ref="menuA" 490 ref="menuA"
491 :close-on-content-click="false" 491 :close-on-content-click="false"
492 v-model="menu2" 492 v-model="menu2"
493 :nudge-right="40" 493 :nudge-right="40"
494 :return-value.sync="addRoutine.startingTime" 494 :return-value.sync="addRoutine.startingTime"
495 lazy 495 lazy
496 transition="scale-transition" 496 transition="scale-transition"
497 offset-y 497 offset-y
498 full-width 498 full-width
499 max-width="290px" 499 max-width="290px"
500 min-width="290px" 500 min-width="290px"
501 > 501 >
502 <v-text-field 502 <v-text-field
503 slot="activator" 503 slot="activator"
504 v-model="addRoutine.startingTime" 504 v-model="addRoutine.startingTime"
505 label="Select your starting time" 505 label="Select your starting time"
506 append-icon="access_time" 506 append-icon="access_time"
507 :rules="timeInRules" 507 :rules="timeInRules"
508 readonly 508 readonly
509 ></v-text-field> 509 ></v-text-field>
510 <v-time-picker 510 <v-time-picker
511 v-model="addRoutine.startingTime" 511 v-model="addRoutine.startingTime"
512 @change="$refs.menuA.save(addRoutine.startingTime)" 512 @change="$refs.menuA.save(addRoutine.startingTime)"
513 ></v-time-picker> 513 ></v-time-picker>
514 </v-menu> 514 </v-menu>
515 </v-flex> 515 </v-flex>
516 </v-layout> 516 </v-layout>
517 <v-layout> 517 <v-layout>
518 <v-flex xs4 class="pt-4 subheading"> 518 <v-flex xs4 class="pt-4 subheading">
519 <label class="right">Ending Time:</label> 519 <label class="right">Ending Time:</label>
520 </v-flex> 520 </v-flex>
521 <v-flex xs8 sm6 class="ml-3"> 521 <v-flex xs8 sm6 class="ml-3">
522 <v-menu 522 <v-menu
523 ref="menu" 523 ref="menu"
524 :close-on-content-click="false" 524 :close-on-content-click="false"
525 v-model="menu1" 525 v-model="menu1"
526 :nudge-right="40" 526 :nudge-right="40"
527 :return-value.sync="addRoutine.endingTime" 527 :return-value.sync="addRoutine.endingTime"
528 lazy 528 lazy
529 transition="scale-transition" 529 transition="scale-transition"
530 offset-y 530 offset-y
531 full-width 531 full-width
532 max-width="290px" 532 max-width="290px"
533 min-width="290px" 533 min-width="290px"
534 > 534 >
535 <v-text-field 535 <v-text-field
536 slot="activator" 536 slot="activator"
537 v-model="addRoutine.endingTime" 537 v-model="addRoutine.endingTime"
538 label="Select your end time" 538 label="Select your end time"
539 append-icon="access_time" 539 append-icon="access_time"
540 :rules="timeOutRules" 540 :rules="timeOutRules"
541 readonly 541 readonly
542 ></v-text-field> 542 ></v-text-field>
543 <v-time-picker 543 <v-time-picker
544 v-model="addRoutine.endingTime" 544 v-model="addRoutine.endingTime"
545 @change="$refs.menu.save(addRoutine.endingTime)" 545 @change="$refs.menu.save(addRoutine.endingTime)"
546 ></v-time-picker> 546 ></v-time-picker>
547 </v-menu> 547 </v-menu>
548 </v-flex> 548 </v-flex>
549 </v-layout> 549 </v-layout>
550 <v-layout> 550 <v-layout>
551 <v-flex xs4 sm4 class="pt-4 subheading"> 551 <v-flex xs4 sm4 class="pt-4 subheading">
552 <label class="right">Room:</label> 552 <label class="right">Room:</label>
553 </v-flex> 553 </v-flex>
554 <v-flex xs8 sm8 class="ml-3"> 554 <v-flex xs8 sm8 class="ml-3">
555 <v-text-field 555 <v-text-field
556 label="fill your room" 556 label="fill your room"
557 :rules="roomRules" 557 :rules="roomRules"
558 v-model="addRoutine.room" 558 v-model="addRoutine.room"
559 @keyup.enter="submit" 559 @keyup.enter="submit"
560 ></v-text-field> 560 ></v-text-field>
561 </v-flex> 561 </v-flex>
562 </v-layout> 562 </v-layout>
563 <v-layout> 563 <v-layout>
564 <v-flex xs4 sm4 class="pt-4 subheading"> 564 <v-flex xs4 sm4 class="pt-4 subheading">
565 <label class="right">Period:</label> 565 <label class="right">Period:</label>
566 </v-flex> 566 </v-flex>
567 <v-flex xs8 sm8 class="ml-3"> 567 <v-flex xs8 sm8 class="ml-3">
568 <v-text-field 568 <v-text-field
569 label="fill your period" 569 label="fill your period"
570 :rules="periodRules" 570 :rules="periodRules"
571 v-model="addRoutine.period" 571 v-model="addRoutine.period"
572 @keyup.enter="submit" 572 @keyup.enter="submit"
573 ></v-text-field> 573 ></v-text-field>
574 </v-flex> 574 </v-flex>
575 </v-layout> 575 </v-layout>
576 <v-layout> 576 <v-layout>
577 <v-flex xs12 sm12> 577 <v-flex xs12 sm12>
578 <v-card-actions> 578 <v-card-actions>
579 <v-spacer></v-spacer> 579 <v-spacer></v-spacer>
580 <v-btn 580 <v-btn
581 @click="create" 581 @click="create"
582 round 582 round
583 dark 583 dark
584 :loading="loading" 584 :loading="loading"
585 class="add-button" 585 class="add-button"
586 >Add Routine</v-btn> 586 >Add Routine</v-btn>
587 </v-card-actions> 587 </v-card-actions>
588 </v-flex> 588 </v-flex>
589 </v-layout> 589 </v-layout>
590 </v-form> 590 </v-form>
591 </v-flex> 591 </v-flex>
592 </v-layout> 592 </v-layout>
593 </v-container> 593 </v-container>
594 </v-card> 594 </v-card>
595 </v-dialog> 595 </v-dialog>
596 <div class="loader" v-if="showLoader"> 596 <div class="loader" v-if="showLoader">
597 <v-progress-circular indeterminate color="white"></v-progress-circular> 597 <v-progress-circular indeterminate color="white"></v-progress-circular>
598 </div> 598 </div>
599 </v-container> 599 </v-container>
600 </template> 600 </template>
601 601
602 <script> 602 <script>
603 import http from "@/Services/http.js"; 603 import http from "@/Services/http.js";
604 import Util from "@/util"; 604 import Util from "@/util";
605 605
606 export default { 606 export default {
607 data: () => ({ 607 data: () => ({
608 snackbar: false, 608 snackbar: false,
609 y: "top", 609 y: "top",
610 x: "right", 610 x: "right",
611 role: "", 611 role: "",
612 mode: "", 612 mode: "",
613 timeout: 3000, 613 timeout: 3000,
614 text: "", 614 text: "",
615 color: "", 615 color: "",
616 show: true, 616 show: true,
617 showSearch: false, 617 showSearch: false,
618 showLoader: false, 618 showLoader: false,
619 loading: false, 619 loading: false,
620 editLoading: false, 620 editLoading: false,
621 date: null, 621 date: null,
622 search: "", 622 search: "",
623 editRoutineDialog: false, 623 editRoutineDialog: false,
624 valid: true, 624 valid: true,
625 validEditRoutine: true, 625 validEditRoutine: true,
626 addRoutineDialog: false, 626 addRoutineDialog: false,
627 showTable: false, 627 showTable: false,
628 hideTable: true, 628 hideTable: true,
629 name: "", 629 name: "",
630 630
631 day: [ 631 day: [
632 "Monday", 632 "Monday",
633 "Tuesday", 633 "Tuesday",
634 "Wednesday", 634 "Wednesday",
635 "Thursday", 635 "Thursday",
636 "Friday", 636 "Friday",
637 "Saturday", 637 "Saturday",
638 "Sunday", 638 "Sunday",
639 ], 639 ],
640 640
641 token: "", 641 token: "",
642 642
643 menu1: false, 643 menu1: false,
644 menu2: false, 644 menu2: false,
645 menu4: false, 645 menu4: false,
646 menu3: false, 646 menu3: false,
647 647
648 schoolRules: [(v) => !!v || "School Year is required"], 648 schoolRules: [(v) => !!v || "School Year is required"],
649 classRules: [(v) => !!v || " Class Name is required"], 649 classRules: [(v) => !!v || " Class Name is required"],
650 teacherRules: [(v) => !!v || " Teacher Name is required"], 650 teacherRules: [(v) => !!v || " Teacher Name is required"],
651 sectionRules: [(v) => !!v || "Section is required"], 651 sectionRules: [(v) => !!v || "Section is required"],
652 studentRules: [(v) => !!v || " Student is required"], 652 studentRules: [(v) => !!v || " Student is required"],
653 finalRules: [(v) => !!v || "Final MArk is required"], 653 finalRules: [(v) => !!v || "Final MArk is required"],
654 subjectRules: [(v) => !!v || " Subject Name is required"], 654 subjectRules: [(v) => !!v || " Subject Name is required"],
655 dayRules: [(v) => !!v || "Day is required"], 655 dayRules: [(v) => !!v || "Day is required"],
656 timeInRules: [(v) => !!v || "Start Time is required"], 656 timeInRules: [(v) => !!v || "Start Time is required"],
657 timeOutRules: [(v) => !!v || "End Time is required"], 657 timeOutRules: [(v) => !!v || "End Time is required"],
658 roomRules: [(v) => !!v || "Room is required"], 658 roomRules: [(v) => !!v || "Room is required"],
659 periodRules: [(v) => !!v || "Period is required"], 659 periodRules: [(v) => !!v || "Period is required"],
660 660
661 classList: [], 661 classList: [],
662 addSection: [], 662 addSection: [],
663 subjectList: [], 663 subjectList: [],
664 teacherList: [], 664 teacherList: [],
665 titleRules: [], 665 titleRules: [],
666 markRules: [], 666 markRules: [],
667 typeRules: [], 667 typeRules: [],
668 routineList: [], 668 routineList: [],
669 editedIndex: -1, 669 editedIndex: -1,
670 addRoutine: {}, 670 addRoutine: {},
671 addRoutineList: {}, 671 addRoutineList: {},
672 startingTime: "", 672 startingTime: "",
673 editedItem: {}, 673 editedItem: {},
674 }), 674 }),
675 watch: { 675 watch: {
676 addRoutineDialog: function (val) { 676 addRoutineDialog: function (val) {
677 if (!val) { 677 if (!val) {
678 this.addRoutine = []; 678 this.addRoutine = [];
679 } 679 }
680 }, 680 },
681 }, 681 },
682 methods: { 682 methods: {
683 editItem(item, routineData) { 683 editItem(item, routineData) {
684 this.editedIndex = this.routineList; 684 this.editedIndex = this.routineList;
685 this.editedItem = Object.assign({}, item); 685 this.editedItem = Object.assign({}, item);
686 this.editedItem.lectureRoutineId = item._id; 686 this.editedItem.lectureRoutineId = item._id;
687 this.editedItem.routineId = routineData._id; 687 this.editedItem.routineId = routineData._id;
688 this.dialog = true; 688 this.dialog = true;
689 this.editRoutineDialog = true; 689 this.editRoutineDialog = true;
690 }, 690 },
691 deleteItem(item) { 691 deleteItem(item) {
692 let deleteLecture = { 692 let deleteLecture = {
693 routineId: item._id, 693 routineId: item._id,
694 lectureId: item.lectureRoutine[0]._id, 694 lectureId: item.lectureRoutine[0]._id,
695 }; 695 };
696 http() 696 http()
697 .delete( 697 .delete(
698 "/deleteRoutineLecture", 698 "/deleteRoutineLecture",
699 confirm("Are you sure you want to delete this?") && { 699 confirm("Are you sure you want to delete this?") && {
700 params: deleteLecture, 700 params: deleteLecture,
701 } 701 }
702 ) 702 )
703 .then((response) => { 703 .then((response) => {
704 this.snackbar = true; 704 this.snackbar = true;
705 this.text = "Successfully delete Existing Routine"; 705 this.text = "Successfully delete Existing Routine";
706 this.color = "green"; 706 this.color = "green";
707 this.getRoutineList(); 707 this.getRoutineList();
708 }) 708 })
709 .catch((error) => { 709 .catch((error) => {
710 this.snackbar = true; 710 this.snackbar = true;
711 this.text = error.response.data.message; 711 this.text = error.response.data.message;
712 this.color = "error"; 712 this.color = "error";
713 }); 713 });
714 }, 714 },
715 close() { 715 close() {
716 this.editRoutineDialog = false; 716 this.editRoutineDialog = false;
717 }, 717 },
718 closeAddRoutineModel() { 718 closeAddRoutineModel() {
719 this.addRoutineDialog = false; 719 this.addRoutineDialog = false;
720 this.classList = []; 720 this.classList = [];
721 this.addRoutine = []; 721 this.addRoutine = [];
722 }, 722 },
723 create() { 723 create() {
724 var routineData = { 724 var routineData = {
725 schoolYear: this.addRoutine.schoolYear, 725 schoolYear: this.addRoutine.schoolYear,
726 classId: this.addRoutine.classId, 726 classId: this.addRoutine.classId,
727 sectionId: this.addRoutine.sectionId, 727 sectionId: this.addRoutine.sectionId,
728 day: this.addRoutine.day, 728 day: this.addRoutine.day,
729 lectureRoutine: [], 729 lectureRoutine: [],
730 }; 730 };
731 if (this.$refs.form.validate()) { 731 if (this.$refs.form.validate()) {
732 routineData.lectureRoutine.push({ 732 routineData.lectureRoutine.push({
733 teacherId: this.addRoutine.teacherId, 733 teacherId: this.addRoutine.teacherId,
734 startingTime: this.addRoutine.startingTime, 734 startingTime: this.addRoutine.startingTime,
735 endingTime: this.addRoutine.endingTime, 735 endingTime: this.addRoutine.endingTime,
736 room: this.addRoutine.room, 736 room: this.addRoutine.room,
737 period: this.addRoutine.period, 737 period: this.addRoutine.period,
738 subjectName: this.addRoutine.subjectName, 738 subjectName: this.addRoutine.subjectName,
739 }); 739 });
740 http() 740 http()
741 .post("/createRoutine", routineData) 741 .post("/createRoutine", routineData)
742 .then((response) => { 742 .then((response) => {
743 this.text = "Routine added successfully"; 743 this.text = "Routine added successfully";
744 // this.clear(); 744 // this.clear();
745 this.snackbar = true; 745 this.snackbar = true;
746 this.color = "green"; 746 this.color = "green";
747 // console.log("===this.addRoutine===", this.addRoutine); 747 // console.log("===this.addRoutine===", this.addRoutine);
748 http() 748 http()
749 .get( 749 .get(
750 "/getRoutineList", 750 "/getRoutineList",
751 { 751 {
752 params: { 752 params: {
753 classId: this.addRoutine.classId, 753 classId: this.addRoutine.classId,
754 sectionId: this.addRoutine.sectionId, 754 sectionId: this.addRoutine.sectionId,
755 }, 755 },
756 }, 756 },
757 { 757 {
758 headers: { Authorization: "Bearer " + this.token }, 758 headers: { Authorization: "Bearer " + this.token },
759 } 759 }
760 ) 760 )
761 .then((response) => { 761 .then((response) => {
762 this.routineList = response.data.data; 762 this.routineList = response.data.data;
763 this.showLoader = false; 763 this.showLoader = false;
764 this.showTable = true; 764 this.showTable = true;
765 this.hideTable = false; 765 this.hideTable = false;
766 }) 766 })
767 .catch((err) => { 767 .catch((err) => {
768 // console.log("err====>", err); 768 // console.log("err====>", err);
769 this.snackbar = true; 769 this.snackbar = true;
770 this.text = error.response.data.message; 770 this.text = error.response.data.message;
771 this.color = "error"; 771 this.color = "error";
772 }); 772 });
773 this.addRoutineDialog = false; 773 this.addRoutineDialog = false;
774 }) 774 })
775 .catch((error) => { 775 .catch((error) => {
776 // console.log(error); 776 // console.log(error);
777 this.snackbar = true; 777 this.snackbar = true;
778 this.text = error.response.data.message; 778 this.text = error.response.data.message;
779 this.color = "error"; 779 this.color = "error";
780 }); 780 });
781 } 781 }
782 }, 782 },
783 clear() { 783 clear() {
784 this.$refs.form.reset(); 784 this.$refs.form.reset();
785 }, 785 },
786 786
787 update() { 787 update() {
788 if (this.$refs.formEditRoutine.validate()) { 788 if (this.$refs.formEditRoutine.validate()) {
789 let editRoutine = { 789 let editRoutine = {
790 routineId: this.editedItem.routineId, 790 routineId: this.editedItem.routineId,
791 lectureRoutineId: this.editedItem.lectureRoutineId, 791 lectureRoutineId: this.editedItem.lectureRoutineId,
792 subjectName: this.editedItem.subjectName, 792 subjectName: this.editedItem.subjectName,
793 teacherId: this.editedItem.teacherId._id, 793 teacherId: this.editedItem.teacherId._id,
794 startingTime: this.editedItem.startingTime, 794 startingTime: this.editedItem.startingTime,
795 endingTime: this.editedItem.endingTime, 795 endingTime: this.editedItem.endingTime,
796 room: this.editedItem.room, 796 room: this.editedItem.room,
797 period: this.editedItem.period, 797 period: this.editedItem.period,
798 }; 798 };
799 this.editLoading = true; 799 this.editLoading = true;
800 http() 800 http()
801 .put("/updateRoutine", editRoutine) 801 .put("/updateRoutine", editRoutine)
802 .then((response) => { 802 .then((response) => {
803 this.snackbar = true; 803 this.snackbar = true;
804 this.text = "Successfully Edit Existing Routine"; 804 this.text = "Successfully Edit Existing Routine";
805 this.color = "green"; 805 this.color = "green";
806 this.editLoading = false; 806 this.editLoading = false;
807 this.editRoutineDialog = false; 807 this.editRoutineDialog = false;
808 this.getRoutineList(); 808 this.getRoutineList();
809 // http() 809 // http()
810 // .get( 810 // .get(
811 // "/getRoutineList", 811 // "/getRoutineList",
812 // { 812 // {
813 // params: { 813 // params: {
814 // classId: this.addRoutine.classId, 814 // classId: this.addRoutine.classId,
815 // sectionId: this.addRoutine.sectionId 815 // sectionId: this.addRoutine.sectionId
816 // } 816 // }
817 // }, 817 // },
818 // { 818 // {
819 // headers: { Authorization: "Bearer " + this.token } 819 // headers: { Authorization: "Bearer " + this.token }
820 // } 820 // }
821 // ) 821 // )
822 // .then(response => { 822 // .then(response => {
823 // this.routineList = response.data.data; 823 // this.routineList = response.data.data;
824 // this.showLoader = false; 824 // this.showLoader = false;
825 // this.showTable = true; 825 // this.showTable = true;
826 // this.hideTable = false; 826 // this.hideTable = false;
827 // }) 827 // })
828 // .catch(err => { 828 // .catch(err => {
829 // console.log("err====>", err); 829 // console.log("err====>", err);
830 // }); 830 // });
831 }) 831 })
832 .catch((error) => { 832 .catch((error) => {
833 this.editLoading = false; 833 this.editLoading = false;
834 }); 834 });
835 } 835 }
836 }, 836 },
837 getClass() { 837 getClass() {
838 http() 838 http()
839 .get("/getClassesList", { 839 .get("/getClassesList", {
840 headers: { Authorization: "Bearer " + this.token }, 840 headers: { Authorization: "Bearer " + this.token },
841 }) 841 })
842 .then((response) => { 842 .then((response) => {
843 this.classList = response.data.data; 843 this.classList = response.data.data;
844 }) 844 })
845 .catch((error) => { 845 .catch((error) => {
846 if (error.response.status === 401) { 846 if (error.response.status === 401) {
847 this.$router.replace({ path: "/" }); 847 this.$router.replace({ path: "/" });
848 this.$store.dispatch("setToken", null); 848 this.$store.dispatch("setToken", null);
849 this.$store.dispatch("Id", null); 849 this.$store.dispatch("Id", null);
850 } 850 }
851 }); 851 });
852 }, 852 },
853 getSections(_id) { 853 getSections(_id) {
854 var token = this.$store.state.token; 854 var token = this.$store.state.token;
855 this.showLoader = true; 855 this.showLoader = true;
856 this.routineList = [];
856 http() 857 http()
857 .get( 858 .get(
858 "/getSectionsList", 859 "/getSectionsList",
859 { params: { classId: _id } }, 860 { params: { classId: _id } },
860 { 861 {
861 headers: { Authorization: "Bearer " + token }, 862 headers: { Authorization: "Bearer " + token },
862 } 863 }
863 ) 864 )
864 .then((response) => { 865 .then((response) => {
865 this.addSection = response.data.data; 866 this.addSection = response.data.data;
866 this.showLoader = false; 867 this.showLoader = false;
867 }) 868 })
868 .catch((err) => { 869 .catch((err) => {
869 this.showLoader = false; 870 this.showLoader = false;
870 }); 871 });
871 }, 872 },
872 getClassSubject(_id) { 873 getClassSubject(_id) {
873 this.showLoader = true; 874 this.showLoader = true;
874 // this.classId = this.classId; 875 // this.classId = this.classId;
875 http() 876 http()
876 .get( 877 .get(
877 "/getParticularClass", 878 "/getParticularClass",
878 { params: { classId: _id } }, 879 { params: { classId: _id } },
879 { 880 {
880 headers: { Authorization: "Bearer " + this.token }, 881 headers: { Authorization: "Bearer " + this.token },
881 } 882 }
882 ) 883 )
883 .then((response) => { 884 .then((response) => {
884 this.subjectList = response.data.data; 885 this.subjectList = response.data.data;
885 this.showLoader = false; 886 this.showLoader = false;
886 }) 887 })
887 .catch((err) => { 888 .catch((err) => {
888 this.showLoader = false; 889 this.showLoader = false;
889 }); 890 });
890 }, 891 },
891 getTeacherList() { 892 getTeacherList() {
892 this.showLoader = true; 893 this.showLoader = true;
893 var token = this.$store.state.token; 894 var token = this.$store.state.token;
894 http() 895 http()
895 .get("/getTeachersList", { 896 .get("/getTeachersList", {
896 headers: { Authorization: "Bearer " + token }, 897 headers: { Authorization: "Bearer " + token },
897 }) 898 })
898 .then((response) => { 899 .then((response) => {
899 this.teacherList = response.data.data; 900 this.teacherList = response.data.data;
900 this.showLoader = false; 901 this.showLoader = false;
901 // console.log("getTeacherList=====>",this.desserts) 902 // console.log("getTeacherList=====>",this.desserts)
902 }) 903 })
903 .catch((error) => { 904 .catch((error) => {
904 this.showLoader = false; 905 this.showLoader = false;
905 if (error.response.status === 401) { 906 if (error.response.status === 401) {
906 this.$router.replace({ path: "/" }); 907 this.$router.replace({ path: "/" });
907 this.$store.dispatch("setToken", null); 908 this.$store.dispatch("setToken", null);
908 this.$store.dispatch("Id", null); 909 this.$store.dispatch("Id", null);
909 } 910 }
910 }); 911 });
911 }, 912 },
912 getRoutineList() { 913 getRoutineList() {
913 this.showLoader = true; 914 this.showLoader = true;
914 http() 915 http()
915 .get( 916 .get(
916 "/getRoutineList", 917 "/getRoutineList",
917 { 918 {
918 params: { 919 params: {
919 classId: this.addRoutineList.classId, 920 classId: this.addRoutineList.classId,
920 sectionId: this.addRoutineList.sectionId, 921 sectionId: this.addRoutineList.sectionId,
921 }, 922 },
922 }, 923 },
923 { 924 {
924 headers: { Authorization: "Bearer " + this.token }, 925 headers: { Authorization: "Bearer " + this.token },
925 } 926 }
926 ) 927 )
927 .then((response) => { 928 .then((response) => {
928 this.routineList = response.data.data; 929 this.routineList = response.data.data;
929 this.showLoader = false; 930 this.showLoader = false;
930 this.showTable = true; 931 this.showTable = true;
931 this.hideTable = false; 932 this.hideTable = false;
932 }) 933 })
933 .catch((err) => { 934 .catch((err) => {
934 this.showLoader = false; 935 this.showLoader = false;
935 }); 936 });
936 }, 937 },
937 displaySearch() { 938 displaySearch() {
938 (this.show = false), (this.showSearch = true); 939 (this.show = false), (this.showSearch = true);
939 }, 940 },
940 closeSearch() { 941 closeSearch() {
941 this.showSearch = false; 942 this.showSearch = false;
942 this.show = true; 943 this.show = true;
943 this.search = ""; 944 this.search = "";
944 }, 945 },
945 }, 946 },
946 mounted() { 947 mounted() {
947 this.token = this.$store.state.token; 948 this.token = this.$store.state.token;
948 this.getClass(); 949 this.getClass();
949 this.getTeacherList(); 950 this.getTeacherList();
950 this.role = this.$store.state.role; 951 this.role = this.$store.state.role;
951 }, 952 },
952 }; 953 };
953 </script> 954 </script>
954 955
955 <style scoped> 956 <style scoped>
956 html, 957 html,
957 body { 958 body {
958 font-family: "OpenSans Regular"; 959 font-family: "OpenSans Regular";
959 } 960 }
960 .box .box-body { 961 .box .box-body {
961 padding: 15px; 962 padding: 15px;
962 border-top-left-radius: 0; 963 border-top-left-radius: 0;
963 border-top-right-radius: 0; 964 border-top-right-radius: 0;
964 border-bottom-right-radius: 3px; 965 border-bottom-right-radius: 3px;
965 border-bottom-left-radius: 3px; 966 border-bottom-left-radius: 3px;
966 } 967 }
967 .nav-tabs-custom { 968 .nav-tabs-custom {
968 margin-bottom: 20px; 969 margin-bottom: 20px;
969 background: #fff; 970 background: #fff;
970 box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.1); 971 box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.1);
971 } 972 }
972 .nav-tabs { 973 .nav-tabs {
973 border-bottom: 1px solid #ddd; 974 border-bottom: 1px solid #ddd;
974 } 975 }
975 .nav { 976 .nav {
976 padding-left: 0; 977 padding-left: 0;
977 list-style: none; 978 list-style: none;
978 } 979 }
979 .tab-content > .active { 980 .tab-content > .active {
980 display: block; 981 display: block;
981 } 982 }
982 .nav-tabs-custom > .nav-tabs > li.active > a { 983 .nav-tabs-custom > .nav-tabs > li.active > a {
983 border-top: 0; 984 border-top: 0;
984 border-left-color: #09a3a3; 985 border-left-color: #09a3a3;
985 border-right-color: #09a3a3; 986 border-right-color: #09a3a3;
986 } 987 }
987 .nav-tabs-custom > .nav-tabs { 988 .nav-tabs-custom > .nav-tabs {
988 background-color: #e5e5e5; 989 background-color: #e5e5e5;
989 margin: 0; 990 margin: 0;
990 border-bottom-color: #e5e5e5; 991 border-bottom-color: #e5e5e5;
991 } 992 }
992 .nav-tabs-custom > .nav-tabs > li:first-of-type { 993 .nav-tabs-custom > .nav-tabs > li:first-of-type {
993 margin-left: 0px; 994 margin-left: 0px;
994 } 995 }
995 .nav-tabs-custom > .nav-tabs > li.active { 996 .nav-tabs-custom > .nav-tabs > li.active {
996 border-bottom-color: #09a3a3; 997 border-bottom-color: #09a3a3;
997 } 998 }
998 .nav-tabs-custom > .nav-tabs > li { 999 .nav-tabs-custom > .nav-tabs > li {
999 border-bottom: 2px solid transparent; 1000 border-bottom: 2px solid transparent;
1000 border-top: 3px solid transparent; 1001 border-top: 3px solid transparent;
1001 margin-bottom: -2px; 1002 margin-bottom: -2px;
1002 margin-right: 5px; 1003 margin-right: 5px;
1003 } 1004 }
1004 .nav-tabs-custom > .nav-tabs > li:first-of-type.active > a { 1005 .nav-tabs-custom > .nav-tabs > li:first-of-type.active > a {
1005 border-left-width: 0; 1006 border-left-width: 0;
1006 } 1007 }
1007 .nav-tabs-custom > .nav-tabs > li.active > a { 1008 .nav-tabs-custom > .nav-tabs > li.active > a {
1008 border-top: 0; 1009 border-top: 0;
1009 border-bottom-color: #09a3a3; 1010 border-bottom-color: #09a3a3;
1010 } 1011 }
1011 .nav-tabs-custom > .nav-tabs > li.active > a, 1012 .nav-tabs-custom > .nav-tabs > li.active > a,
1012 .nav-tabs-custom > .nav-tabs > li.active:hover > a { 1013 .nav-tabs-custom > .nav-tabs > li.active:hover > a {
1013 background-color: #e5e5e5; 1014 background-color: #e5e5e5;
1014 border: 0px; 1015 border: 0px;
1015 color: #000000db; 1016 color: #000000db;
1016 } 1017 }
1017 .nav-tabs-custom > .nav-tabs > li > a, 1018 .nav-tabs-custom > .nav-tabs > li > a,
1018 .nav-tabs-custom > .nav-tabs > li > a:hover { 1019 .nav-tabs-custom > .nav-tabs > li > a:hover {
1019 border-radius: 0 !important; 1020 border-radius: 0 !important;
1020 } 1021 }
1021 .nav-tabs-custom > .tab-content { 1022 .nav-tabs-custom > .tab-content {
1022 background: #fff; 1023 background: #fff;
1023 padding: 10px; 1024 padding: 10px;
1024 } 1025 }
1025 .page-header { 1026 .page-header {
1026 margin: 10px 0 20px 0; 1027 margin: 10px 0 20px 0;
1027 padding: 0px 0px 16px; 1028 padding: 0px 0px 16px;
1028 font-size: 22px; 1029 font-size: 22px;
1029 border: none; 1030 border: none;
1030 } 1031 }
1031 .table { 1032 .table {
1032 width: 100%; 1033 width: 100%;
1033 border-collapse: collapse; 1034 border-collapse: collapse;
1034 border-spacing: 0; 1035 border-spacing: 0;
1035 } 1036 }
1036 .table > tbody > tr > th, 1037 .table > tbody > tr > th,
1037 .table > tfoot > tr > th, 1038 .table > tfoot > tr > th,
1038 .table > tbody > tr > td, 1039 .table > tbody > tr > td,
1039 .table > tfoot > tr > td { 1040 .table > tfoot > tr > td {
1040 padding: 8px; 1041 padding: 8px;
1041 line-height: 1.428571429; 1042 line-height: 1.428571429;
1042 vertical-align: top; 1043 vertical-align: top;
1043 border-top: 1px solid #ddd; 1044 border-top: 1px solid #ddd;
1044 } 1045 }
1045 .nav::before, 1046 .nav::before,
1046 .nav::after { 1047 .nav::after {
1047 display: table; 1048 display: table;
1048 content: ""; 1049 content: "";
1049 } 1050 }
1050 .box .box-body .table { 1051 .box .box-body .table {
1051 margin-bottom: 0; 1052 margin-bottom: 0;
1052 } 1053 }
1053 .table-bordered { 1054 .table-bordered {
1054 border: 1px solid #e2e7eb; 1055 border: 1px solid #e2e7eb;
1055 } 1056 }
1056 .table-striped > tbody > tr:nth-child(2n + 1) > td, 1057 .table-striped > tbody > tr:nth-child(2n + 1) > td,
1057 .table-striped > tbody > tr:nth-child(2n + 1) > th { 1058 .table-striped > tbody > tr:nth-child(2n + 1) > th {
1058 background-color: #f0f3f5; 1059 background-color: #f0f3f5;
1059 } 1060 }
1060 .table-bordered > tbody > v-data-table > template > tr > th, 1061 .table-bordered > tbody > v-data-table > template > tr > th,
1061 .table-bordered > tbody > tr > td { 1062 .table-bordered > tbody > tr > td {
1062 border-color: #e2e7eb; 1063 border-color: #e2e7eb;
1063 font-size: 12px; 1064 font-size: 12px;
1064 } 1065 }
1065 .table-bordered > tbody > tr > td { 1066 .table-bordered > tbody > tr > td {
1066 color: #707070; 1067 color: #707070;
1067 } 1068 }
1068 /* 1069 /*
1069 .table-bordered > tbody > tr > th, 1070 .table-bordered > tbody > tr > th,
1070 .table-bordered > tfoot > tr > th, 1071 .table-bordered > tfoot > tr > th,
1071 .table-bordered > tbody > tr > td, 1072 .table-bordered > tbody > tr > td,
1072 .table-bordered > tfoot > tr > td { 1073 .table-bordered > tfoot > tr > td {
1073 border: 1px solid #ddd; 1074 border: 1px solid #ddd;
1074 } */ 1075 } */
1075 .mCustomScrollbar.mCS_no_scrollbar, 1076 .mCustomScrollbar.mCS_no_scrollbar,
1076 .mCustomScrollbar.mCS_touch_action { 1077 .mCustomScrollbar.mCS_touch_action {
1077 touch-action: auto; 1078 touch-action: auto;
1078 } 1079 }
1079 .mCSB_scrollTools.mCSB_scrollTools_horizontal { 1080 .mCSB_scrollTools.mCSB_scrollTools_horizontal {
1080 width: auto; 1081 width: auto;
1081 height: 16px; 1082 height: 16px;
1082 top: auto; 1083 top: auto;
1083 right: 0; 1084 right: 0;
1084 bottom: 0; 1085 bottom: 0;
1085 left: 0; 1086 left: 0;
1086 } 1087 }
1087 .mCSB_scrollTools { 1088 .mCSB_scrollTools {
1088 opacity: 0.75; 1089 opacity: 0.75;
1089 } 1090 }
1090 .mCSB_scrollTools .mCSB_draggerContainer { 1091 .mCSB_scrollTools .mCSB_draggerContainer {
1091 position: absolute; 1092 position: absolute;
1092 height: auto; 1093 height: auto;
1093 top: 0; 1094 top: 0;
1094 left: 0; 1095 left: 0;
1095 bottom: 0; 1096 bottom: 0;
1096 right: 0; 1097 right: 0;
1097 } 1098 }
1098 .mCSB_scrollTools.mCSB_scrollTools_horizontal .mCSB_dragger { 1099 .mCSB_scrollTools.mCSB_scrollTools_horizontal .mCSB_dragger {
1099 height: 100%; 1100 height: 100%;
1100 } 1101 }
1101 .mCSB_scrollTools .mCSB_dragger { 1102 .mCSB_scrollTools .mCSB_dragger {
1102 cursor: pointer; 1103 cursor: pointer;
1103 z-index: 1; 1104 z-index: 1;
1104 } 1105 }
1105 .mCSB_scrollTools.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar { 1106 .mCSB_scrollTools.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar {
1106 width: 100%; 1107 width: 100%;
1107 height: 4px; 1108 height: 4px;
1108 margin: 6px auto; 1109 margin: 6px auto;
1109 } 1110 }
1110 .mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { 1111 .mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar {
1111 background-color: rgba(255, 255, 255, 0.75); 1112 background-color: rgba(255, 255, 255, 0.75);
1112 } 1113 }
1113 .mCSB_scrollTools.mCSB_scrollTools_horizontal .mCSB_draggerRail { 1114 .mCSB_scrollTools.mCSB_scrollTools_horizontal .mCSB_draggerRail {
1114 width: 100%; 1115 width: 100%;
1115 height: 2px; 1116 height: 2px;
1116 margin: 7px 0; 1117 margin: 7px 0;
1117 } 1118 }
1118 .mCSB_scrollTools .mCSB_draggerRail { 1119 .mCSB_scrollTools .mCSB_draggerRail {
1119 background-color: rgba(0, 0, 0, 0.4); 1120 background-color: rgba(0, 0, 0, 0.4);
1120 border-radius: 16px; 1121 border-radius: 16px;
1121 } 1122 }
1122 .mCustomScrollBox { 1123 .mCustomScrollBox {
1123 position: relative; 1124 position: relative;
1124 overflow: hidden; 1125 overflow: hidden;
1125 height: 100%; 1126 height: 100%;
1126 max-width: 100%; 1127 max-width: 100%;
1127 outline: none; 1128 outline: none;
1128 direction: ltr; 1129 direction: ltr;
1129 } 1130 }
1130 /* .mCSB_horizontal > .mCSB_container.mCS_no_scrollbar_x.mCS_x_hidden { 1131 /* .mCSB_horizontal > .mCSB_container.mCS_no_scrollbar_x.mCS_x_hidden {
1131 margin-bottom: 0; 1132 margin-bottom: 0;
1132 } 1133 }
1133 .mCSB_horizontal.mCSB_inside > .mCSB_container { 1134 .mCSB_horizontal.mCSB_inside > .mCSB_container {
1134 margin-right: 0; 1135 margin-right: 0;
1135 } */ 1136 } */
1136 .mCSB_container { 1137 .mCSB_container {
1137 overflow: hidden; 1138 overflow: hidden;
1138 height: auto; 1139 height: auto;
1139 } 1140 }
1140 1141
1141 @media (min-width: 768px) { 1142 @media (min-width: 768px) {
1142 .col-sm-12 { 1143 .col-sm-12 {
1143 width: 100%; 1144 width: 100%;
1144 } 1145 }
1145 } 1146 }
1146 </style> 1147 </style>
src/pages/Account/globalPayment.vue
1 <template> 1 <template>
2 <v-container fluid class="body-color"> 2 <v-container fluid class="body-color">
3 <!-- ****** EXISTING GLOBAL PAYMENT TABLE ****** --> 3 <!-- ****** EXISTING GLOBAL PAYMENT TABLE ****** -->
4 <v-form ref="form" v-model="valid" lazy-validation> 4 <v-form ref="form" v-model="valid" lazy-validation>
5 <v-container fluid> 5 <v-container fluid>
6 <v-flex xs12 sm12 lg12> 6 <v-flex xs12 sm12 lg12>
7 <v-layout wrap> 7 <v-layout wrap>
8 <v-flex xs12 sm12 lg10> 8 <v-flex xs12 sm12 lg10>
9 <v-layout wrap> 9 <v-layout wrap>
10 <v-flex xs12 sm12 lg4> 10 <v-flex xs12 sm12 lg4>
11 <v-flex xs12 sm4 lg4 class="subheading"> 11 <v-flex xs12 sm4 lg4 class="subheading">
12 <label class="mt-4">Class:</label> 12 <label class="mt-4">Class:</label>
13 </v-flex> 13 </v-flex>
14 <v-flex xs12 sm12 lg10> 14 <v-flex xs12 sm12 lg10>
15 <v-select 15 <v-select
16 :items="addclass" 16 :items="addclass"
17 label="Select Class" 17 label="Select Class"
18 v-model="selectStudents.selectClassId" 18 v-model="selectStudents.selectClassId"
19 item-text="classNum" 19 item-text="classNum"
20 item-value="_id" 20 item-value="_id"
21 name="Select Class" 21 name="Select Class"
22 :rules="classRules" 22 :rules="classRules"
23 @change="getSection()" 23 @change="getSection()"
24 required 24 required
25 ></v-select> 25 ></v-select>
26 </v-flex> 26 </v-flex>
27 </v-flex> 27 </v-flex>
28 <v-flex xs12 sm12 lg4> 28 <v-flex xs12 sm12 lg4>
29 <v-flex xs12 sm4 lg4 class="subheading"> 29 <v-flex xs12 sm4 lg4 class="subheading">
30 <label class="mt-4">Section:</label> 30 <label class="mt-4">Section:</label>
31 </v-flex> 31 </v-flex>
32 <v-flex xs12 sm12 lg10 class> 32 <v-flex xs12 sm12 lg10 class>
33 <v-select 33 <v-select
34 :items="addSection" 34 :items="addSection"
35 label="Select Section" 35 label="Select Section"
36 v-model="selectStudents.selectSection" 36 v-model="selectStudents.selectSection"
37 item-text="name" 37 item-text="name"
38 item-value="_id" 38 item-value="_id"
39 name="Select Section" 39 name="Select Section"
40 :rules="sectionRules" 40 :rules="sectionRules"
41 @change="getStudents()" 41 @change="getStudents()"
42 required 42 required
43 ></v-select> 43 ></v-select>
44 </v-flex> 44 </v-flex>
45 </v-flex> 45 </v-flex>
46 <v-flex xs12 sm12 lg4> 46 <v-flex xs12 sm12 lg4>
47 <v-flex xs12 sm4 lg4 class="subheading"> 47 <v-flex xs12 sm4 lg4 class="subheading">
48 <label class="mt-4">Student:</label> 48 <label class="mt-4">Student:</label>
49 </v-flex> 49 </v-flex>
50 <v-flex xs12 sm12 lg10 class> 50 <v-flex xs12 sm12 lg10 class>
51 <v-select 51 <v-select
52 :items="studentData" 52 :items="studentData"
53 label="Select Student" 53 label="Select Student"
54 v-model="selectStudents.selectId" 54 v-model="selectStudents.selectId"
55 item-text="name" 55 item-text="name"
56 item-value="_id" 56 item-value="_id"
57 :rules="studentRules"
58 required 57 required
59 ></v-select> 58 ></v-select>
60 </v-flex> 59 </v-flex>
61 </v-flex> 60 </v-flex>
62 </v-layout> 61 </v-layout>
63 </v-flex> 62 </v-flex>
64 <v-flex xs12 sm12 lg2> 63 <v-flex xs12 sm12 lg2>
65 <v-flex xs12 sm12 lg12> 64 <v-flex xs12 sm12 lg12>
66 <v-btn 65 <v-btn
67 @click="getInvoicesData()" 66 @click="getInvoicesData()"
68 round 67 round
69 dark 68 dark
70 :loading="loading" 69 :loading="loading"
71 class="right mt-4 open-dialog-button" 70 class="right mt-4 open-dialog-button"
72 >Search</v-btn> 71 >Search</v-btn>
73 </v-flex> 72 </v-flex>
74 </v-flex> 73 </v-flex>
75 </v-layout> 74 </v-layout>
76 </v-flex> 75 </v-flex>
77 </v-container> 76 </v-container>
78 </v-form> 77 </v-form>
79 <v-container fluid grid-list-md> 78 <v-container fluid grid-list-md>
80 <v-flex xs12> 79 <v-flex xs12>
81 <v-layout wrap> 80 <v-layout wrap>
82 <v-flex xs12 sm12 md4> 81 <v-flex xs12 sm12 md4>
83 <v-card 82 <v-card
84 flat 83 flat
85 class="pa-3" 84 class="pa-3"
86 v-for="(invoiceData,i) in studentInvoiceData" 85 v-for="(invoiceData,i) in studentInvoiceData"
87 :key="i" 86 :key="i"
88 v-if="i === 0" 87 v-if="i === 0"
89 > 88 >
90 <v-layout> 89 <v-layout>
91 <v-flex xs12> 90 <v-flex xs12>
92 <v-avatar 91 <v-avatar
93 size="80px" 92 size="80px"
94 style="margin: auto;display:block;margin-bottom:10px !important" 93 style="margin: auto;display:block;margin-bottom:10px !important"
95 > 94 >
96 <img src="/static/icon/user.png" v-if="!invoiceData.studentId.profilePicUrl" /> 95 <img src="/static/icon/user.png" v-if="!invoiceData.studentId.profilePicUrl" />
97 <img 96 <img
98 :src="invoiceData.studentId.profilePicUrl" 97 :src="invoiceData.studentId.profilePicUrl"
99 v-else-if="invoiceData.studentId.profilePicUrl" 98 v-else-if="invoiceData.studentId.profilePicUrl"
100 /> 99 />
101 </v-avatar> 100 </v-avatar>
102 </v-flex> 101 </v-flex>
103 </v-layout> 102 </v-layout>
104 <v-layout class="studentProfile"> 103 <v-layout class="studentProfile">
105 <v-flex xs4 sm3 md3> 104 <v-flex xs4 sm3 md3>
106 <h4> 105 <h4>
107 <b>Name</b> 106 <b>Name</b>
108 </h4> 107 </h4>
109 </v-flex> 108 </v-flex>
110 <v-flex sm9 xs8 md9> 109 <v-flex sm9 xs8 md9>
111 <h4>: {{ invoiceData.studentId.name }}</h4> 110 <h4>: {{ invoiceData.studentId.name }}</h4>
112 </v-flex> 111 </v-flex>
113 </v-layout> 112 </v-layout>
114 <v-layout class="studentProfile"> 113 <v-layout class="studentProfile">
115 <v-flex xs4 sm3 md3> 114 <v-flex xs4 sm3 md3>
116 <h4> 115 <h4>
117 <b>Class</b> 116 <b>Class</b>
118 </h4> 117 </h4>
119 </v-flex> 118 </v-flex>
120 <v-flex sm9 xs8 md9> 119 <v-flex sm9 xs8 md9>
121 <h4>: {{ invoiceData.classId.classNum }}</h4> 120 <h4>: {{ invoiceData.classId.classNum }}</h4>
122 </v-flex> 121 </v-flex>
123 </v-layout> 122 </v-layout>
124 <v-layout class="studentProfile"> 123 <v-layout class="studentProfile">
125 <v-flex xs4 sm3 md3> 124 <v-flex xs4 sm3 md3>
126 <h4> 125 <h4>
127 <b>Roll No</b> 126 <b>Roll No</b>
128 </h4> 127 </h4>
129 </v-flex> 128 </v-flex>
130 <v-flex sm9 xs8 md9> 129 <v-flex sm9 xs8 md9>
131 <h4>: {{ invoiceData.studentId.rollNo }}</h4> 130 <h4>: {{ invoiceData.studentId.rollNo }}</h4>
132 </v-flex> 131 </v-flex>
133 </v-layout> 132 </v-layout>
134 </v-card> 133 </v-card>
135 </v-flex> 134 </v-flex>
136 <v-flex xs12 sm12 md8 v-show="showInvoiceTable"> 135 <v-flex xs12 sm12 md8 v-show="showInvoiceTable">
137 <v-card class="transparent"> 136 <v-card class="transparent">
138 <v-data-table 137 <v-data-table
139 :headers="headers" 138 :headers="headers"
140 :items="studentInvoiceData" 139 :items="studentInvoiceData"
141 :search="search" 140 :search="search"
142 hide-actions 141 hide-actions
143 > 142 >
144 <template slot="items" slot-scope="props"> 143 <template slot="items" slot-scope="props">
145 <tr class="tr"> 144 <tr class="tr">
146 <td class="td td-row text-xs-center">{{ props.item.invoiceNumber }}</td> 145 <td class="td td-row text-xs-center">{{ props.item.invoiceNumber }}</td>
147 <td class="td td-row text-xs-center">{{ props.item.totalAmount }}</td> 146 <td class="td td-row text-xs-center">{{ props.item.totalAmount }}</td>
148 <td class="td td-row text-xs-center">{{ props.item.totalDiscount }}</td> 147 <td class="td td-row text-xs-center">{{ props.item.totalDiscount }}</td>
149 <td class="td td-row text-xs-center">{{ props.item.totalSubTotal }}</td> 148 <td class="td td-row text-xs-center">{{ props.item.totalSubTotal }}</td>
150 <td class="td td-row text-xs-center">{{ props.item.paymentStatus}}</td> 149 <td class="td td-row text-xs-center">{{ props.item.paymentStatus}}</td>
151 <td class="td td-row text-xs-center">{{ dates(props.item.date) }}</td> 150 <td class="td td-row text-xs-center">{{ dates(props.item.date) }}</td>
152 <td class="text-xs-center td td-row"> 151 <td class="text-xs-center td td-row">
153 <router-link 152 <router-link
154 :to="{ name:'View Invoice',params: { viewInvoiceId:props.item._id } }" 153 :to="{ name:'View Invoice',params: { viewInvoiceId:props.item._id } }"
155 > 154 >
156 <v-tooltip top> 155 <v-tooltip top>
157 <img 156 <img
158 slot="activator" 157 slot="activator"
159 style="cursor:pointer; width:25px; height:18px; " 158 style="cursor:pointer; width:25px; height:18px; "
160 src="/static/icon/eye1.png" 159 src="/static/icon/eye1.png"
161 /> 160 />
162 <span>View</span> 161 <span>View</span>
163 </v-tooltip> 162 </v-tooltip>
164 </router-link> 163 </router-link>
165 </td> 164 </td>
166 </tr> 165 </tr>
167 </template> 166 </template>
168 <v-alert 167 <v-alert
169 slot="no-results" 168 slot="no-results"
170 :value="true" 169 :value="true"
171 color="error" 170 color="error"
172 icon="warning" 171 icon="warning"
173 >Your search for "{{ search }}" found no results.</v-alert> 172 >Your search for "{{ search }}" found no results.</v-alert>
174 </v-data-table> 173 </v-data-table>
175 </v-card> 174 </v-card>
176 </v-flex> 175 </v-flex>
177 </v-layout> 176 </v-layout>
178 </v-flex> 177 </v-flex>
179 178
180 <v-flex xs12> 179 <v-flex xs12>
181 <v-layout wrap> 180 <v-layout wrap>
182 <v-flex xs12 sm12 md12 v-show="showInvoiceTable"> 181 <v-flex xs12 sm12 md12 v-show="showInvoiceTable">
183 <v-card class="transparent"> 182 <v-card class="transparent">
184 <v-data-table 183 <v-data-table
185 :headers="header" 184 :headers="header"
186 :items="studentInvoiceData" 185 :items="studentInvoiceData"
187 :search="search" 186 :search="search"
188 hide-actions 187 hide-actions
189 > 188 >
190 <template slot="items" slot-scope="props"> 189 <template slot="items" slot-scope="props">
191 <tr class="tr" v-for="feetype in props.item.feeType"> 190 <tr class="tr" v-for="feetype in props.item.feeType">
192 <td class="td td-row">{{ props.index + 1}}</td> 191 <td class="td td-row">{{ props.index + 1}}</td>
193 <td class="td td-row text-xs-center">{{ feetype.feeTypeName}}</td> 192 <td class="td td-row text-xs-center">{{ feetype.feeTypeName}}</td>
194 <td class="td td-row text-xs-center">{{ feetype.amount }}</td> 193 <td class="td td-row text-xs-center">{{ feetype.amount }}</td>
195 <td 194 <td
196 class="td td-row text-xs-center" 195 class="td td-row text-xs-center"
197 >{{ props.item.totalSubTotal - props.item.totalPaidAmount }}</td> 196 >{{ props.item.totalSubTotal - props.item.totalPaidAmount }}</td>
198 <td class="td td-row text-xs-center">{{ feetype.paidAmount }}</td> 197 <td class="td td-row text-xs-center">{{ feetype.paidAmount }}</td>
199 <td class="td td-row text-xs-center"> 198 <td class="td td-row text-xs-center">
200 <input type="text" maxlength="20" /> 199 <input type="text" maxlength="20" />
201 </td> 200 </td>
202 </tr> 201 </tr>
203 </template> 202 </template>
204 <v-alert 203 <v-alert
205 slot="no-results" 204 slot="no-results"
206 :value="true" 205 :value="true"
207 color="error" 206 color="error"
208 icon="warning" 207 icon="warning"
209 >Your search for "{{ search }}" found no results.</v-alert> 208 >Your search for "{{ search }}" found no results.</v-alert>
210 </v-data-table> 209 </v-data-table>
211 </v-card> 210 </v-card>
212 </v-flex> 211 </v-flex>
213 </v-layout> 212 </v-layout>
214 </v-flex> 213 </v-flex>
215 </v-container> 214 </v-container>
216 <div class="loader" v-if="showLoader"> 215 <div class="loader" v-if="showLoader">
217 <v-progress-circular indeterminate color="white"></v-progress-circular> 216 <v-progress-circular indeterminate color="white"></v-progress-circular>
218 </div> 217 </div>
219 </v-container> 218 </v-container>
220 </template> 219 </template>
221 220
222 <script> 221 <script>
223 import http from "@/Services/http.js"; 222 import http from "@/Services/http.js";
224 import moment from "moment"; 223 import moment from "moment";
225 224
226 export default { 225 export default {
227 data: () => ({ 226 data: () => ({
228 snackbar: false, 227 snackbar: false,
229 showInvoiceTable: false, 228 showInvoiceTable: false,
230 y: "top", 229 y: "top",
231 x: "right", 230 x: "right",
232 mode: "", 231 mode: "",
233 timeout: 3000, 232 timeout: 3000,
234 text: "", 233 text: "",
235 showLoader: false, 234 showLoader: false,
236 loading: false, 235 loading: false,
237 search: "", 236 search: "",
238 valid: true, 237 valid: true,
239 addclass: [], 238 addclass: [],
240 // index: '', 239 // index: '',
241 feeType: { 240 feeType: {
242 amount: "", 241 amount: "",
243 discount: "", 242 discount: "",
244 totalPaidAmount: "", 243 totalPaidAmount: "",
245 subTotal: "", 244 subTotal: "",
246 feeTypeName: "", 245 feeTypeName: "",
247 userData: {}, 246 userData: {},
248 }, 247 },
249 feeTypeData: [], 248 feeTypeData: [],
250 selectStudents: {}, 249 selectStudents: {},
251 addSection: [], 250 addSection: [],
252 classRules: [(v) => !!v || " Class Name is required"], 251 classRules: [(v) => !!v || " Class Name is required"],
253 sectionRules: [(v) => !!v || " Section Name is required"], 252 sectionRules: [(v) => !!v || " Section Name is required"],
254 studentRules: [(v) => !!v || "Student Name is required"], 253 studentRules: [(v) => !!v || "Student Name is required"],
255 headers: [ 254 headers: [
256 { 255 {
257 text: "Invoice Number", 256 text: "Invoice Number",
258 align: "center", 257 align: "center",
259 sortable: false, 258 sortable: false,
260 value: "invoiceNumber", 259 value: "invoiceNumber",
261 }, 260 },
262 { 261 {
263 text: "Total Pay", 262 text: "Total Pay",
264 value: "totalAmount", 263 value: "totalAmount",
265 sortable: false, 264 sortable: false,
266 align: "center", 265 align: "center",
267 }, 266 },
268 { 267 {
269 text: "Weaver", 268 text: "Weaver",
270 value: "totalDiscount", 269 value: "totalDiscount",
271 sortable: false, 270 sortable: false,
272 align: "center", 271 align: "center",
273 }, 272 },
274 { 273 {
275 text: " Total Collection", 274 text: " Total Collection",
276 value: "totalSubTotal", 275 value: "totalSubTotal",
277 sortable: false, 276 sortable: false,
278 align: "center", 277 align: "center",
279 }, 278 },
280 { 279 {
281 text: "Clearance", 280 text: "Clearance",
282 value: "paymentStatus", 281 value: "paymentStatus",
283 sortable: false, 282 sortable: false,
284 align: "center", 283 align: "center",
285 }, 284 },
286 { text: "Payment Date", value: "date", sortable: false, align: "center" }, 285 { text: "Payment Date", value: "date", sortable: false, align: "center" },
287 { text: "Action", value: "", sortable: false, align: "center" }, 286 { text: "Action", value: "", sortable: false, align: "center" },
288 ], 287 ],
289 288
290 header: [ 289 header: [
291 { 290 {
292 text: "#", 291 text: "#",
293 // align: "center", 292 // align: "center",
294 sortable: false, 293 sortable: false,
295 }, 294 },
296 { 295 {
297 text: "Fees Name", 296 text: "Fees Name",
298 align: "center", 297 align: "center",
299 sortable: false, 298 sortable: false,
300 value: "feeTypeName", 299 value: "feeTypeName",
301 }, 300 },
302 { 301 {
303 text: "Fees Amount", 302 text: "Fees Amount",
304 align: "center", 303 align: "center",
305 sortable: false, 304 sortable: false,
306 value: "amount", 305 value: "amount",
307 }, 306 },
308 { 307 {
309 text: "Due", 308 text: "Due",
310 align: "center", 309 align: "center",
311 sortable: false, 310 sortable: false,
312 }, 311 },
313 { 312 {
314 text: "Paid Amount", 313 text: "Paid Amount",
315 align: "center", 314 align: "center",
316 sortable: false, 315 sortable: false,
317 value: "paidAmount", 316 value: "paidAmount",
318 }, 317 },
319 { 318 {
320 text: "Weaver", 319 text: "Weaver",
321 align: "center", 320 align: "center",
322 sortable: false, 321 sortable: false,
323 value: "paidAmount", 322 value: "paidAmount",
324 }, 323 },
325 ], 324 ],
326 studentData: [], 325 studentData: [],
327 studentInvoiceData: [], 326 studentInvoiceData: [],
328 }), 327 }),
329 methods: { 328 methods: {
330 dates: function (date) { 329 dates: function (date) {
331 return moment(date).format("MMMM DD, YYYY"); 330 return moment(date).format("MMMM DD, YYYY");
332 }, 331 },
333 getSection() { 332 getSection() {
334 var token = this.$store.state.token; 333 var token = this.$store.state.token;
335 this.showLoader = true; 334 this.showLoader = true;
335 this.studentInvoiceData = [];
336 http() 336 http()
337 .get( 337 .get(
338 "/getSectionsList", 338 "/getSectionsList",
339 { 339 {
340 params: { 340 params: {
341 classId: this.selectStudents.selectClassId, 341 classId: this.selectStudents.selectClassId,
342 schoolId: this.$store.state.schoolId, 342 schoolId: this.$store.state.schoolId,
343 }, 343 },
344 }, 344 },
345 { 345 {
346 headers: { Authorization: "Bearer " + token }, 346 headers: { Authorization: "Bearer " + token },
347 } 347 }
348 ) 348 )
349 .then((response) => { 349 .then((response) => {
350 this.addSection = response.data.data; 350 this.addSection = response.data.data;
351 this.showLoader = false; 351 this.showLoader = false;
352 // console.log("getSectionsList=====>", this.addSection); 352 // console.log("getSectionsList=====>", this.addSection);
353 }) 353 })
354 .catch((error) => { 354 .catch((error) => {
355 this.showLoader = false; 355 this.showLoader = false;
356 // console.log("err====>", err); 356 // console.log("err====>", err);
357 // this.$router.replace({ path: '/' }); 357 // this.$router.replace({ path: '/' });
358 }); 358 });
359 }, 359 },
360 getStudents() { 360 getStudents() {
361 this.showLoader = true; 361 this.showLoader = true;
362 http() 362 http()
363 .get("/getStudentWithClass", { 363 .get("/getStudentWithClass", {
364 params: { 364 params: {
365 classId: this.selectStudents.selectClassId, 365 classId: this.selectStudents.selectClassId,
366 sectionId: this.selectStudents.selectSection, 366 sectionId: this.selectStudents.selectSection,
367 schoolId: this.$store.state.schoolId, 367 schoolId: this.$store.state.schoolId,
368 }, 368 },
369 }) 369 })
370 .then((response) => { 370 .then((response) => {
371 this.studentData = response.data.data; 371 this.studentData = response.data.data;
372 this.showLoader = false; 372 this.showLoader = false;
373 }) 373 })
374 .catch((err) => { 374 .catch((err) => {
375 // console.log("err====>", err); 375 // console.log("err====>", err);
376 this.showLoader = false; 376 this.showLoader = false;
377 }); 377 });
378 }, 378 },
379 getInvoicesData() { 379 getInvoicesData() {
380 this.showLoader = true; 380 this.showLoader = true;
381 this.showInvoiceTable = true; 381 this.showInvoiceTable = true;
382 http() 382 http()
383 .get("/getInvoicesList", { 383 .get("/getInvoicesList", {
384 params: { 384 params: {
385 classId: this.selectStudents.selectClassId, 385 classId: this.selectStudents.selectClassId,
386 studentId: this.selectStudents.selectId, 386 studentId: this.selectStudents.selectId,
387 schoolId: this.$store.state.schoolId, 387 schoolId: this.$store.state.schoolId,
388 }, 388 },
389 }) 389 })
390 .then((response) => { 390 .then((response) => {
391 this.studentInvoiceData = response.data.data; 391 this.studentInvoiceData = response.data.data;
392 // console.log("this.studentInvoiceData", this.studentInvoiceData); 392 // console.log("this.studentInvoiceData", this.studentInvoiceData);
393 this.showLoader = false; 393 this.showLoader = false;
394 }) 394 })
395 .catch((err) => { 395 .catch((err) => {
396 // console.log("err====>", err); 396 // console.log("err====>", err);
397 this.showLoader = false; 397 this.showLoader = false;
398 }); 398 });
399 }, 399 },
400 getAmmountDetails(feeTyp) { 400 getAmmountDetails(feeTyp) {
401 let feeType = { 401 let feeType = {
402 subTotal: "", 402 subTotal: "",
403 subParticularTotal: "", 403 subParticularTotal: "",
404 paidAmount: "", 404 paidAmount: "",
405 }; 405 };
406 // *********** SUBTOTAL *********** 406 // *********** SUBTOTAL ***********
407 feeType.subTotal = 407 feeType.subTotal =
408 Number(feeType.subTotal) + Number(this.feeTypeData[i].subTotal); 408 Number(feeType.subTotal) + Number(this.feeTypeData[i].subTotal);
409 this.feeType.subTotal = feeType.subTotal.toFixed(2); 409 this.feeType.subTotal = feeType.subTotal.toFixed(2);
410 // *********** PAID-AMOUNT *********** 410 // *********** PAID-AMOUNT ***********
411 feeType.paidAmount = 411 feeType.paidAmount =
412 Number(feeType.paidAmount) + Number(this.feeTypeData[i].paidAmount); 412 Number(feeType.paidAmount) + Number(this.feeTypeData[i].paidAmount);
413 this.feeType.paidAmount = feeType.paidAmount.toFixed(2); 413 this.feeType.paidAmount = feeType.paidAmount.toFixed(2);
414 }, 414 },
415 }, 415 },
416 mounted() { 416 mounted() {
417 var token = this.$store.state.token; 417 var token = this.$store.state.token;
418 http() 418 http()
419 .get("/getClassesList", { 419 .get("/getClassesList", {
420 params: { 420 params: {
421 schoolId: this.$store.state.schoolId, 421 schoolId: this.$store.state.schoolId,
422 }, 422 },
423 headers: { Authorization: "Bearer " + token }, 423 headers: { Authorization: "Bearer " + token },
424 }) 424 })
425 .then((response) => { 425 .then((response) => {
426 this.addclass = response.data.data; 426 this.addclass = response.data.data;
427 }) 427 })
428 .catch((error) => { 428 .catch((error) => {
429 this.showLoader = false; 429 this.showLoader = false;
430 if (error.response.status === 401) { 430 if (error.response.status === 401) {
431 this.$router.replace({ path: "/" }); 431 this.$router.replace({ path: "/" });
432 this.$store.dispatch("setToken", null); 432 this.$store.dispatch("setToken", null);
433 this.$store.dispatch("Id", null); 433 this.$store.dispatch("Id", null);
434 this.$store.dispatch("Role", null); 434 this.$store.dispatch("Role", null);
435 } 435 }
436 }); 436 });
437 }, 437 },
438 // created() { 438 // created() {
439 // this.$root.$on("app:search", search => { 439 // this.$root.$on("app:search", search => {
440 // this.search = search; 440 // this.search = search;
441 // }); 441 // });
442 // }, 442 // },
443 // beforeDestroy() { 443 // beforeDestroy() {
444 // // dont forget to remove the listener 444 // // dont forget to remove the listener
445 // this.$root.$off("app:search"); 445 // this.$root.$off("app:search");
446 // } 446 // }
447 }; 447 };
448 </script> 448 </script>
449 449
450 450
451 <style scoped> 451 <style scoped>
452 .studentProfile { 452 .studentProfile {
453 border: 1px solid lightgrey; 453 border: 1px solid lightgrey;
454 } 454 }
src/pages/Administrator/resetPassword.vue
1 <template> 1 <template>
2 <v-app id="login"> 2 <v-app id="login">
3 <v-container fluid fill-height> 3 <v-container fluid fill-height>
4 <v-layout> 4 <v-layout>
5 <v-flex xs12 sm8 md8 lg5 offset-sm2 offset-lg3 class="mt-5"> 5 <v-flex xs12 sm8 md8 lg5 offset-sm2 offset-lg3 class="mt-5">
6 <v-toolbar class="card-styles mt-5" dark> 6 <v-toolbar class="card-styles mt-5" dark>
7 <v-spacer></v-spacer> 7 <v-spacer></v-spacer>
8 <v-toolbar-title>Change Password</v-toolbar-title> 8 <v-toolbar-title>Change Password</v-toolbar-title>
9 <v-spacer></v-spacer> 9 <v-spacer></v-spacer>
10 </v-toolbar> 10 </v-toolbar>
11 <v-card class="elevation-1 pa-3" id="form"> 11 <v-card class="elevation-1 pa-3" id="form">
12 <v-card-text> 12 <v-card-text>
13 <v-flex xs12 sm8 md8 lg8 offset-sm2> 13 <v-flex xs12 sm8 md8 lg8 offset-sm2>
14 <v-form class="mt-3" ref="form" v-model="valid" lazy-validation> 14 <v-form class="mt-3" ref="form" v-model="valid" lazy-validation>
15 <!-- <v-select 15 <!-- <v-select
16 :rules="userRule" 16 :rules="userRule"
17 label="Select User" 17 label="Select User"
18 :items="getRoles" 18 :items="getRoles"
19 item-text="name" 19 item-text="name"
20 item-value="name" 20 item-value="name"
21 v-model="resetPassword.name" 21 v-model="resetPassword.name"
22 @change="getUsers(resetPassword.name)" 22 @change="getUsers(resetPassword.name)"
23 ></v-select> 23 ></v-select>
24 <v-select 24 <v-select
25 :rules="userNameRule" 25 :rules="userNameRule"
26 label="Select User Name" 26 label="Select User Name"
27 :items="getUsersName" 27 :items="getUsersName"
28 item-text="email" 28 item-text="email"
29 item-value="email" 29 item-value="email"
30 v-model="resetPassword.email" 30 v-model="resetPassword.email"
31 ></v-select> --> 31 ></v-select>-->
32 <v-text-field 32 <v-text-field
33 :append-icon="e1 ? 'visibility_off' : 'visibility'" 33 :append-icon="e1 ? 'visibility_off' : 'visibility'"
34 :append-icon-cb="() => (e1 = !e1)" 34 :append-icon-cb="() => (e1 = !e1)"
35 :type="e1 ? 'password' : 'text'" 35 :type="e1 ? 'password' : 'text'"
36 :rules="oldPasswordRule" 36 :rules="oldPasswordRule"
37 v-model="resetPassword.oldPassword" 37 v-model="resetPassword.oldPassword"
38 :error-messages="errors.collect('resetPassword.oldPassword')" 38 :error-messages="errors.collect('resetPassword.oldPassword')"
39 v-validate="'required'" 39 v-validate="'required'"
40 data-vv-name="resetPassword.oldPassword" 40 data-vv-name="resetPassword.oldPassword"
41 label="Old Password" 41 label="Old Password"
42 ></v-text-field> 42 ></v-text-field>
43 <v-text-field 43 <v-text-field
44 :append-icon="e1 ? 'visibility_off' : 'visibility'" 44 :append-icon="e1 ? 'visibility_off' : 'visibility'"
45 :append-icon-cb="() => (e1 = !e1)" 45 :append-icon-cb="() => (e1 = !e1)"
46 :type="e1 ? 'password' : 'text'" 46 :type="e1 ? 'password' : 'text'"
47 :rules="newPasswordRule" 47 :rules="newPasswordRule"
48 v-model="resetPassword.newPassword" 48 v-model="resetPassword.newPassword"
49 :error-messages="errors.collect('resetPassword.newPassword')" 49 :error-messages="errors.collect('resetPassword.newPassword')"
50 v-validate="'required'" 50 v-validate="'required'"
51 data-vv-name="resetPassword.newPassword" 51 data-vv-name="resetPassword.newPassword"
52 label="New Password" 52 label="New Password"
53 ></v-text-field> 53 ></v-text-field>
54 <v-text-field 54 <v-text-field
55 :append-icon="e1 ? 'visibility_off' : 'visibility'" 55 :append-icon="e1 ? 'visibility_off' : 'visibility'"
56 :append-icon-cb="() => (e1 = !e1)" 56 :append-icon-cb="() => (e1 = !e1)"
57 :type="e1 ? 'password' : 'text'" 57 :type="e1 ? 'password' : 'text'"
58 v-model="resetPassword.confirmPassword" 58 v-model="resetPassword.confirmPassword"
59 :rules="rePasswordRule" 59 :rules="rePasswordRule"
60 :error-messages="errors.collect('password2')" 60 :error-messages="errors.collect('password2')"
61 v-validate="{ required: false, is: resetPassword.newPassword }" 61 v-validate="{ required: false, is: resetPassword.newPassword }"
62 data-vv-name="password2" 62 data-vv-name="password2"
63 data-vv-as="password" 63 data-vv-as="password"
64 label="Renter New Password" 64 label="Re-enter New Password"
65 ></v-text-field> 65 ></v-text-field>
66 </v-form> 66 </v-form>
67 </v-flex> 67 </v-flex>
68 </v-card-text> 68 </v-card-text>
69 <v-card-actions> 69 <v-card-actions>
70 <v-flex text-xs-center> 70 <v-flex text-xs-center>
71 <v-btn 71 <v-btn
72 style="background-color: #71d9ea; color: #0c0754;" 72 style="background-color: #71d9ea; color: #0c0754;"
73 dark 73 dark
74 flat 74 flat
75 large 75 large
76 :loading="loading" 76 :loading="loading"
77 @click="reset" 77 @click="reset"
78 >Change Password</v-btn> 78 >Change Password</v-btn>
79 </v-flex> 79 </v-flex>
80 </v-card-actions> 80 </v-card-actions>
81 <v-snackbar 81 <v-snackbar
82 :timeout="timeout" 82 :timeout="timeout"
83 :top="y === 'top'" 83 :top="y === 'top'"
84 :right="x === 'right'" 84 :right="x === 'right'"
85 :vertical="mode === 'vertical'" 85 :vertical="mode === 'vertical'"
86 v-model="snackbar" 86 v-model="snackbar"
87 :color="color" 87 :color="color"
88 >{{ text }}</v-snackbar> 88 >{{ text }}</v-snackbar>
89 </v-card> 89 </v-card>
90 </v-flex> 90 </v-flex>
91 </v-layout> 91 </v-layout>
92 </v-container> 92 </v-container>
93 </v-app> 93 </v-app>
94 </template> 94 </template>
95 <script> 95 <script>
96 import http from "@/Services/http.js"; 96 import http from "@/Services/http.js";
97 97
98 export default { 98 export default {
99 data() { 99 data() {
100 return { 100 return {
101 snackbar: false, 101 snackbar: false,
102 y: "top", 102 y: "top",
103 x: "right", 103 x: "right",
104 mode: "", 104 mode: "",
105 timeout: 4000, 105 timeout: 4000,
106 text: "", 106 text: "",
107 color: "", 107 color: "",
108 e1: true, 108 e1: true,
109 password2: "", 109 password2: "",
110 resetPassword: {}, 110 resetPassword: {},
111 getUsersName: [], 111 getUsersName: [],
112 getRoles: [], 112 getRoles: [],
113 valid: true, 113 valid: true,
114 loading: false, 114 loading: false,
115 text: "Password Changed", 115 text: "Password Changed",
116 newPassword: "", 116 newPassword: "",
117 oldPassword: "", 117 oldPassword: "",
118 userRule: [v => !!v || "User is required"], 118 userRule: [(v) => !!v || "User is required"],
119 userNameRule: [v => !!v || "User Name is required"], 119 userNameRule: [(v) => !!v || "User Name is required"],
120 oldPasswordRule: [v => !!v || "Old Password is required"], 120 oldPasswordRule: [(v) => !!v || "Old Password is required"],
121 newPasswordRule: [v => !!v || "New Password is required"], 121 newPasswordRule: [(v) => !!v || "New Password is required"],
122 rePasswordRule: [v => !!v || "Re-Password is required"] 122 rePasswordRule: [(v) => !!v || "Re-Password is required"],
123 }; 123 };
124 }, 124 },
125 mounted() { 125 mounted() {
126 this.token = this.$store.state.token; 126 this.token = this.$store.state.token;
127 if (this.$store.state.role != "PARENT"){ 127 if (this.$store.state.role != "PARENT") {
128 this.getRole(); 128 this.getRole();
129 } 129 }
130 }, 130 },
131 methods: { 131 methods: {
132 reset() { 132 reset() {
133 if ( 133 if (
134 this.$refs.form.validate() && 134 this.$refs.form.validate() &&
135 this.resetPassword.oldPassword === this.resetPassword.oldPassword 135 this.resetPassword.oldPassword === this.resetPassword.oldPassword
136 ) { 136 ) {
137 this.loading = true; 137 this.loading = true;
138 this.resetPassword.newPassword = this.resetPassword.newPassword; 138 this.resetPassword.newPassword = this.resetPassword.newPassword;
139 http() 139 http()
140 .put("/change-password", this.resetPassword, { 140 .put("/change-password", this.resetPassword, {
141 headers: { Authorization: "Bearer " + this.token } 141 headers: { Authorization: "Bearer " + this.token },
142 }) 142 })
143 .then(response => { 143 .then((response) => {
144 this.loading = false; 144 this.loading = false;
145 this.snackbar = true; 145 this.snackbar = true;
146 this.text = "Successfully Restet password !!"; 146 this.text = "Successfully Restet password !!";
147 this.color = "green"; 147 this.color = "green";
148 this.clear(); 148 this.clear();
149 }) 149 })
150 .catch(error => { 150 .catch((error) => {
151 // console.log("err====>",err); 151 // console.log("err====>",err);
152 this.snackbar = true; 152 this.snackbar = true;
153 this.text = "User Not Found or Incorrect currentPassword"; 153 this.text = "User Not Found or Incorrect currentPassword";
154 this.color = "error"; 154 this.color = "error";
155 this.loading = false; 155 this.loading = false;
156 }); 156 });
157 } 157 }
158 }, 158 },
159 getRole() { 159 getRole() {
160 this.showLoader = true; 160 this.showLoader = true;
161 http() 161 http()
162 .get("/getRolesList", { 162 .get("/getRolesList", {
163 headers: { Authorization: "Bearer " + this.token } 163 headers: { Authorization: "Bearer " + this.token },
164 }) 164 })
165 .then(response => { 165 .then((response) => {
166 for (let i = 0; i < response.data.data.length; i++) { 166 for (let i = 0; i < response.data.data.length; i++) {
167 if ( 167 if (
168 response.data.data[i].name != "SUPERADMIN" && 168 response.data.data[i].name != "SUPERADMIN" &&
169 response.data.data[i].name != "ADMIN" 169 response.data.data[i].name != "ADMIN"
170 ) { 170 ) {
171 this.getRoles.push(response.data.data[i]); 171 this.getRoles.push(response.data.data[i]);
172 this.showLoader = false; 172 this.showLoader = false;
173 } 173 }
174 } 174 }
175 }) 175 })
176 .catch(error => { 176 .catch((error) => {
177 this.showLoader = false; 177 this.showLoader = false;
178 if (error.response.status === 401) { 178 if (error.response.status === 401) {
179 this.$router.replace({ path: "/" }); 179 this.$router.replace({ path: "/" });
180 this.$store.dispatch("setToken", null); 180 this.$store.dispatch("setToken", null);
181 this.$store.dispatch("Id", null); 181 this.$store.dispatch("Id", null);
182 } 182 }
183 }); 183 });
184 }, 184 },
185 clear() { 185 clear() {
186 this.$refs.form.reset(); 186 this.$refs.form.reset();
187 }, 187 },
188 getUsers(roles) { 188 getUsers(roles) {
189 this.showLoader = true; 189 this.showLoader = true;
190 http() 190 http()
191 .get("/getUserWithRole", { 191 .get("/getUserWithRole", {
192 params: { 192 params: {
193 name: roles 193 name: roles,
194 }, 194 },
195 headers: { Authorization: "Bearer " + this.token } 195 headers: { Authorization: "Bearer " + this.token },
196 }) 196 })
197 .then(response => { 197 .then((response) => {
198 this.getUsersName = response.data.data; 198 this.getUsersName = response.data.data;
199 }) 199 })
200 .catch(error => { 200 .catch((error) => {
201 this.showLoader = false; 201 this.showLoader = false;
202 if (error.response.status === 401) { 202 if (error.response.status === 401) {
203 this.$router.replace({ path: "/" }); 203 this.$router.replace({ path: "/" });
204 this.$store.dispatch("setToken", null); 204 this.$store.dispatch("setToken", null);
205 this.$store.dispatch("Id", null); 205 this.$store.dispatch("Id", null);
206 } 206 }
207 }); 207 });
208 } 208 },
209 } 209 },
210 }; 210 };
211 </script> 211 </script>
212 <style scoped> 212 <style scoped>
213 .card-styles { 213 .card-styles {
214 background: #7f62f8 !important; 214 background: #7f62f8 !important;
215 border-color: #7f62f8 !important; 215 border-color: #7f62f8 !important;
216 } 216 }
217 </style> 217 </style>
218 218
src/pages/Attendence/studentAttendence.vue
1 <template> 1 <template>
2 <v-container fluid class="body-color"> 2 <v-container fluid class="body-color">
3 <v-snackbar 3 <v-snackbar
4 :timeout="timeout" 4 :timeout="timeout"
5 :top="y === 'top'" 5 :top="y === 'top'"
6 :right="x === 'right'" 6 :right="x === 'right'"
7 :vertical="mode === 'vertical'" 7 :vertical="mode === 'vertical'"
8 v-model="snackbar" 8 v-model="snackbar"
9 color="success" 9 color="success"
10 >{{ text }}</v-snackbar> 10 >{{ text }}</v-snackbar>
11 <!-- ****** ATTENDENCE STUDENTS TABLE ****** --> 11 <!-- ****** ATTENDENCE STUDENTS TABLE ****** -->
12 <!-- <download-csv :data="json_data"> 12 <!-- <download-csv :data="json_data">
13 <v-btn>Download Data</v-btn> 13 <v-btn>Download Data</v-btn>
14 </download-csv>--> 14 </download-csv>-->
15 <v-toolbar color="transparent" flat> 15 <v-toolbar color="transparent" flat>
16 <v-btn 16 <v-btn
17 fab 17 fab
18 dark 18 dark
19 class="open-dialog-button hidden-xl-only hidden-md-only hidden-lg-only" 19 class="open-dialog-button hidden-xl-only hidden-md-only hidden-lg-only"
20 small 20 small
21 @click="addStudentAttendenceDialog = true" 21 @click="addStudentAttendenceDialog = true"
22 > 22 >
23 <v-icon dark>add</v-icon> 23 <v-icon dark>add</v-icon>
24 </v-btn> 24 </v-btn>
25 <v-btn 25 <v-btn
26 v-if="role != 'ADMIN' && schoolRole != 'SCHOOLADMIN' " 26 v-if="role != 'ADMIN' && schoolRole != 'SCHOOLADMIN' "
27 round 27 round
28 class="open-dialog-button hidden-sm-only hidden-xs-only" 28 class="open-dialog-button hidden-sm-only hidden-xs-only"
29 dark 29 dark
30 @click="addStudentAttendenceDialog = true" 30 @click="addStudentAttendenceDialog = true"
31 > 31 >
32 <v-icon class="white--text pr-1" size="20">add</v-icon>Add Student Attendence 32 <v-icon class="white--text pr-1" size="20">add</v-icon>Add Student Attendence
33 </v-btn> 33 </v-btn>
34 34
35 <v-spacer></v-spacer> 35 <v-spacer></v-spacer>
36 <v-flex xs12 sm4 md2> 36 <v-flex xs12 sm4 md2>
37 <v-select 37 <v-select
38 small 38 small
39 :items="addclass" 39 :items="addclass"
40 label="Select Class" 40 label="Select Class"
41 v-model="getAttendence.classId" 41 v-model="getAttendence.classId"
42 item-text="classNum" 42 item-text="classNum"
43 item-value="_id" 43 item-value="_id"
44 name="Select Class" 44 name="Select Class"
45 @change="getSection(getAttendence.classId)" 45 @change="getSection(getAttendence.classId)"
46 class="px-2" 46 class="px-2"
47 required 47 required
48 ></v-select> 48 ></v-select>
49 </v-flex> 49 </v-flex>
50 <v-flex xs12 sm4 md2> 50 <v-flex xs12 sm4 md2>
51 <v-select 51 <v-select
52 small 52 small
53 :items="addSection" 53 :items="addSection"
54 label="Select Section" 54 label="Select Section"
55 v-model="getAttendence.sectionId" 55 v-model="getAttendence.sectionId"
56 item-text="name" 56 item-text="name"
57 item-value="_id" 57 item-value="_id"
58 name="Select Section" 58 name="Select Section"
59 @change="getStudentsDetail(getAttendence.sectionId)" 59 @change="getStudentsDetail(getAttendence.sectionId)"
60 class="px-2" 60 class="px-2"
61 required 61 required
62 ></v-select> 62 ></v-select>
63 </v-flex> 63 </v-flex>
64 <v-card-title class="body-1" v-show="show"> 64 <v-card-title class="body-1" v-show="show">
65 <v-btn icon large flat @click="displaySearch"> 65 <v-btn icon large flat @click="displaySearch">
66 <v-avatar size="27"> 66 <v-avatar size="27">
67 <img src="/static/icon/search.png" alt="icon" /> 67 <img src="/static/icon/search.png" alt="icon" />
68 </v-avatar> 68 </v-avatar>
69 </v-btn> 69 </v-btn>
70 </v-card-title> 70 </v-card-title>
71 <v-flex xs8 sm8 md3 lg2 v-if="showSearch"> 71 <v-flex xs8 sm8 md3 lg2 v-if="showSearch">
72 <v-layout> 72 <v-layout>
73 <v-text-field 73 <v-text-field
74 autofocus 74 autofocus
75 v-model="search" 75 v-model="search"
76 label="Search" 76 label="Search"
77 prepend-inner-icon="search" 77 prepend-inner-icon="search"
78 color="primary" 78 color="primary"
79 ></v-text-field> 79 ></v-text-field>
80 <v-icon @click="closeSearch" color="error">close</v-icon> 80 <v-icon @click="closeSearch" color="error">close</v-icon>
81 </v-layout> 81 </v-layout>
82 </v-flex> 82 </v-flex>
83 </v-toolbar> 83 </v-toolbar>
84 <v-data-table 84 <v-data-table
85 :headers="headers" 85 :headers="headers"
86 :items="studentsData" 86 :items="studentsData"
87 :pagination.sync="pagination" 87 :pagination.sync="pagination"
88 :search="search" 88 :search="search"
89 > 89 >
90 <template slot="items" slot-scope="props"> 90 <template slot="items" slot-scope="props">
91 <tr class="tr"> 91 <tr class="tr">
92 <td class="td td-row">{{ props.index + 1}}</td> 92 <td class="td td-row">{{ props.index + 1}}</td>
93 <td class="text-xs-center td td-row"> 93 <td class="text-xs-center td td-row">
94 <v-avatar size="40"> 94 <v-avatar size="40">
95 <img :src="props.item.profilePicUrl" v-if="props.item.profilePicUrl" /> 95 <img :src="props.item.profilePicUrl" v-if="props.item.profilePicUrl" />
96 <img src="/static/icon/user.png" v-else-if="!props.item.profilePicUrl" /> 96 <img src="/static/icon/user.png" v-else-if="!props.item.profilePicUrl" />
97 </v-avatar> 97 </v-avatar>
98 </td> 98 </td>
99 <td class="text-xs-center td td-row">{{ props.item.name}}</td> 99 <td class="text-xs-center td td-row">{{ props.item.name}}</td>
100 <td class="text-xs-center td td-row">{{ props.item.fatherCellNo}}</td> 100 <td class="text-xs-center td td-row">{{ props.item.fatherCellNo}}</td>
101 <td class="text-xs-center td td-row">{{ props.item.email }}</td> 101 <td class="text-xs-center td td-row">{{ props.item.email }}</td>
102 <td class="text-xs-center td td-row"> 102 <td class="text-xs-center td td-row">
103 <router-link :to="{ name:'View Students Attendence',params: { id:props.item._id } }"> 103 <router-link :to="{ name:'View Students Attendence',params: { id:props.item._id } }">
104 <v-tooltip top> 104 <v-tooltip top>
105 <img 105 <img
106 slot="activator" 106 slot="activator"
107 style="cursor:pointer; width:20px; height:25px; " 107 style="cursor:pointer; width:20px; height:25px; "
108 class="mr-3" 108 class="mr-3"
109 src="/static/icon/view.png" 109 src="/static/icon/view.png"
110 /> 110 />
111 <span>View</span> 111 <span>View</span>
112 </v-tooltip> 112 </v-tooltip>
113 </router-link> 113 </router-link>
114 </td> 114 </td>
115 </tr> 115 </tr>
116 </template> 116 </template>
117 <v-alert 117 <v-alert
118 slot="no-results" 118 slot="no-results"
119 :value="true" 119 :value="true"
120 color="error" 120 color="error"
121 icon="warning" 121 icon="warning"
122 >Your search for "{{ search }}" found no results.</v-alert> 122 >Your search for "{{ search }}" found no results.</v-alert>
123 </v-data-table> 123 </v-data-table>
124 <!-- ****** Add Students Attendece****** --> 124 <!-- ****** Add Students Attendece****** -->
125 <v-dialog 125 <v-dialog
126 v-model="addStudentAttendenceDialog" 126 v-model="addStudentAttendenceDialog"
127 width="1600" 127 width="1600"
128 v-if="addStudentAttendenceDialog" 128 v-if="addStudentAttendenceDialog"
129 persistent 129 persistent
130 > 130 >
131 <v-card flat class="pa-2"> 131 <v-card flat class="pa-2">
132 <v-layout> 132 <v-layout>
133 <v-flex xs12> 133 <v-flex xs12>
134 <label class="title text-xs-center">Add Student Attendence</label> 134 <label class="title text-xs-center">Add Student Attendence</label>
135 <v-icon 135 <v-icon
136 size="24" 136 size="24"
137 class="right" 137 class="right"
138 @click="$refs.form.reset();addStudentAttendenceDialog = false" 138 @click="$refs.form.reset();addStudentAttendenceDialog = false"
139 >cancel</v-icon> 139 >cancel</v-icon>
140 </v-flex> 140 </v-flex>
141 </v-layout> 141 </v-layout>
142 <v-flex xs12 class="mt-4"> 142 <v-flex xs12 class="mt-4">
143 <v-form ref="form" v-model="valid" lazy-validation> 143 <v-form ref="form" v-model="valid" lazy-validation>
144 <v-flex xs12 sm12 lg12> 144 <v-flex xs12 sm12 lg12>
145 <v-layout wrap> 145 <v-layout wrap>
146 <v-flex xs6 sm6 lg3 md4> 146 <v-flex xs6 sm6 lg3 md4>
147 <v-layout> 147 <v-layout>
148 <v-flex xs3 sm6 lg2 class="subheading mt-4"> 148 <v-flex xs3 sm6 lg2 class="subheading mt-4">
149 <label class="right">Class:</label> 149 <label class="right">Class:</label>
150 </v-flex> 150 </v-flex>
151 <v-flex xs9 sm6 lg8 class="ml-2"> 151 <v-flex xs9 sm6 lg8 class="ml-2">
152 <v-select 152 <v-select
153 v-model="getReport.classId" 153 v-model="getReport.classId"
154 label="Select your class" 154 label="Select your class"
155 type="text" 155 type="text"
156 :items="addclass" 156 :items="addclass"
157 item-text="classNum" 157 item-text="classNum"
158 item-value="_id" 158 item-value="_id"
159 :rules="classRules" 159 :rules="classRules"
160 @change="getSection(getReport.classId)" 160 @change="getSection(getReport.classId)"
161 required 161 required
162 ></v-select> 162 ></v-select>
163 </v-flex> 163 </v-flex>
164 </v-layout> 164 </v-layout>
165 </v-flex> 165 </v-flex>
166 <v-flex xs6 sm6 lg3 md8> 166 <v-flex xs6 sm6 lg3 md8>
167 <v-layout> 167 <v-layout>
168 <v-flex xs3 sm6 lg2 class="subheading mt-4"> 168 <v-flex xs3 sm6 lg2 class="subheading mt-4">
169 <label class="right">Section:</label> 169 <label class="right">Section:</label>
170 </v-flex> 170 </v-flex>
171 <v-flex xs9 sm6 lg8 class="ml-2"> 171 <v-flex xs9 sm6 lg8 class="ml-2">
172 <v-select 172 <v-select
173 :items="addSection" 173 :items="addSection"
174 label="Select your Section" 174 label="Select your Section"
175 v-model="getReport.sectionId" 175 v-model="getReport.sectionId"
176 item-text="name" 176 item-text="name"
177 item-value="_id" 177 item-value="_id"
178 name="Select Section" 178 name="Select Section"
179 :rules="sectionRules" 179 :rules="sectionRules"
180 required 180 required
181 ></v-select> 181 ></v-select>
182 </v-flex> 182 </v-flex>
183 </v-layout> 183 </v-layout>
184 </v-flex> 184 </v-flex>
185 <v-flex xs6 sm6 lg3 md4> 185 <v-flex xs6 sm6 lg3 md4>
186 <v-menu 186 <v-menu
187 ref="menu" 187 ref="menu"
188 :close-on-content-click="false" 188 :close-on-content-click="false"
189 v-model="menu" 189 v-model="menu"
190 :nudge-right="40" 190 :nudge-right="40"
191 lazy 191 lazy
192 transition="scale-transition" 192 transition="scale-transition"
193 offset-y 193 offset-y
194 full-width 194 full-width
195 min-width="290px" 195 min-width="290px"
196 > 196 >
197 <v-text-field 197 <v-text-field
198 slot="activator" 198 slot="activator"
199 v-model="date" 199 v-model="date"
200 label="Select Date" 200 label="Select Date"
201 append-icon="event" 201 append-icon="event"
202 :rules="dataValid" 202 :rules="dataValid"
203 readonly 203 readonly
204 ></v-text-field> 204 ></v-text-field>
205 <v-date-picker 205 <v-date-picker
206 ref="picker" 206 ref="picker"
207 v-model="date" 207 v-model="date"
208 :max="new Date().toISOString().substr(0, 10)" 208 :max="new Date().toISOString().substr(0, 10)"
209 min="1950-01-01" 209 min="1950-01-01"
210 @change="save" 210 @change="save"
211 ></v-date-picker> 211 ></v-date-picker>
212 </v-menu> 212 </v-menu>
213 </v-flex> 213 </v-flex>
214 <v-flex xs6 sm6 lg9 md8> 214 <v-flex xs6 sm6 lg9 md8>
215 <v-btn round dark class="add-button" @click="showTable">Attendence</v-btn> 215 <v-btn round dark class="add-button" @click="showTable">Attendence</v-btn>
216 </v-flex> 216 </v-flex>
217 </v-layout> 217 </v-layout>
218 </v-flex> 218 </v-flex>
219 </v-form> 219 </v-form>
220 </v-flex> 220 </v-flex>
221 <v-flex xs12 v-show="attendeceTable" class> 221 <v-flex xs12 v-show="attendeceTable" class>
222 <v-data-table 222 <v-data-table
223 :headers="headers" 223 :headers="headers"
224 :items="studentsData" 224 :items="studentsData"
225 :pagination.sync="pagination" 225 :pagination.sync="pagination"
226 :search="search" 226 :search="search"
227 > 227 >
228 <template slot="items" slot-scope="props"> 228 <template slot="items" slot-scope="props">
229 <tr class="tr"> 229 <tr class="tr">
230 <td class="td td-row">{{ props.index + 1}}</td> 230 <td class="td td-row">{{ props.index + 1}}</td>
231 <td class="text-xs-center td td-row"> 231 <td class="text-xs-center td td-row">
232 <v-avatar size="40"> 232 <v-avatar size="40">
233 <img :src="props.item.profilePicUrl" v-if="props.item.profilePicUrl" /> 233 <img :src="props.item.profilePicUrl" v-if="props.item.profilePicUrl" />
234 <img src="/static/icon/user.png" v-else-if="!props.item.profilePicUrl" /> 234 <img src="/static/icon/user.png" v-else-if="!props.item.profilePicUrl" />
235 </v-avatar> 235 </v-avatar>
236 </td> 236 </td>
237 <td class="text-xs-center td td-row">{{ props.item.name}}</td> 237 <td class="text-xs-center td td-row">{{ props.item.name}}</td>
238 <td class="text-xs-center td td-row">{{ props.item.fatherCellNo }}</td> 238 <td class="text-xs-center td td-row">{{ props.item.fatherCellNo }}</td>
239 <td class="text-xs-center td td-row">{{ props.item.email }}</td> 239 <td class="text-xs-center td td-row">{{ props.item.email }}</td>
240 <td class="text-xs-center td td-row"> 240 <td class="text-xs-center td td-row">
241 <v-radio-group v-model="props.item.attendence" :mandatory="false" row> 241 <v-radio-group v-model="props.item.attendence" :mandatory="false" row>
242 <v-radio 242 <v-radio
243 v-for="attendences in attendenceType" 243 v-for="attendences in attendenceType"
244 :key="attendences.value" 244 :key="attendences.value"
245 :label="`${attendences.label}`" 245 :label="`${attendences.label}`"
246 :value="attendences.value" 246 :value="attendences.value"
247 ></v-radio> 247 ></v-radio>
248 </v-radio-group> 248 </v-radio-group>
249 </td> 249 </td>
250 </tr> 250 </tr>
251 </template> 251 </template>
252 </v-data-table> 252 </v-data-table>
253 <v-flex xs12> 253 <v-flex xs12>
254 <v-card-actions> 254 <v-card-actions>
255 <v-spacer></v-spacer> 255 <v-spacer></v-spacer>
256 <v-btn @click="update()" class="add-button" round dark>Submit</v-btn> 256 <v-btn @click="update()" class="add-button" round dark>Submit</v-btn>
257 </v-card-actions> 257 </v-card-actions>
258 </v-flex> 258 </v-flex>
259 </v-flex> 259 </v-flex>
260 </v-card> 260 </v-card>
261 </v-dialog> 261 </v-dialog>
262 <v-snackbar 262 <v-snackbar
263 :timeout="timeout" 263 :timeout="timeout"
264 :top="y === 'top'" 264 :top="y === 'top'"
265 :right="x === 'right'" 265 :right="x === 'right'"
266 :vertical="mode === 'vertical'" 266 :vertical="mode === 'vertical'"
267 v-model="snackbar" 267 v-model="snackbar"
268 color="success" 268 color="success"
269 >{{ text }}</v-snackbar> 269 >{{ text }}</v-snackbar>
270 <div class="loader" v-if="showLoader"> 270 <div class="loader" v-if="showLoader">
271 <v-progress-circular indeterminate color="white"></v-progress-circular> 271 <v-progress-circular indeterminate color="white"></v-progress-circular>
272 </div> 272 </div>
273 </v-container> 273 </v-container>
274 </template> 274 </template>
275 275
276 <script> 276 <script>
277 import http from "@/Services/http.js"; 277 import http from "@/Services/http.js";
278 import moment from "moment"; 278 import moment from "moment";
279 279
280 export default { 280 export default {
281 data: () => ({ 281 data: () => ({
282 snackbar: false, 282 snackbar: false,
283 y: "top", 283 y: "top",
284 x: "right", 284 x: "right",
285 mode: "", 285 mode: "",
286 timeout: 3000, 286 timeout: 3000,
287 text: "", 287 text: "",
288 show: true, 288 show: true,
289 showSearch: false, 289 showSearch: false,
290 showLoader: false, 290 showLoader: false,
291 loading: false, 291 loading: false,
292 date: null, 292 date: null,
293 search: "", 293 search: "",
294 addclass: [], 294 addclass: [],
295 pagination: { 295 pagination: {
296 rowsPerPage: 10, 296 rowsPerPage: 10,
297 }, 297 },
298 imageData: {}, 298 imageData: {},
299 imageName: "", 299 imageName: "",
300 imageUrl: "", 300 imageUrl: "",
301 imageFile: "", 301 imageFile: "",
302 headers: [ 302 headers: [
303 { 303 {
304 text: "No", 304 text: "No",
305 align: "", 305 align: "",
306 sortable: false, 306 sortable: false,
307 value: "index", 307 value: "index",
308 }, 308 },
309 { 309 {
310 text: "Profile Pic", 310 text: "Profile Pic",
311 value: "profilprofilePicUrlePicUrl", 311 value: "profilprofilePicUrlePicUrl",
312 sortable: false, 312 sortable: false,
313 align: "center", 313 align: "center",
314 }, 314 },
315 { text: "Name", value: "name", sortable: false, align: "center" }, 315 { text: "Name", value: "name", sortable: false, align: "center" },
316 { 316 {
317 text: "Mobile No", 317 text: "Mobile No",
318 value: "fatherCellNo", 318 value: "fatherCellNo",
319 sortable: false, 319 sortable: false,
320 align: "center", 320 align: "center",
321 }, 321 },
322 { text: "Email", value: "email", sortable: false, align: "center" }, 322 { text: "Email", value: "email", sortable: false, align: "center" },
323 { text: "Attendance", value: "", sortable: false, align: "center" }, 323 { text: "Attendance", value: "", sortable: false, align: "center" },
324 ], 324 ],
325 // json_data: [], 325 // json_data: [],
326 parentId: "", 326 parentId: "",
327 token: "", 327 token: "",
328 selectStudents: { 328 selectStudents: {
329 select: "", 329 select: "",
330 selectSection: "", 330 selectSection: "",
331 }, 331 },
332 332
333 role: "", 333 role: "",
334 schoolRole: "", 334 schoolRole: "",
335 addStudentAttendenceDialog: false, 335 addStudentAttendenceDialog: false,
336 attendeceTable: false, 336 attendeceTable: false,
337 menu: false, 337 menu: false,
338 valid: true, 338 valid: true,
339 339
340 getReport: {}, 340 getReport: {},
341 getAttendence: {}, 341 getAttendence: {},
342 studentsList: [], 342 studentsList: [],
343 studentsData: [], 343 studentsData: [],
344 addSection: [], 344 addSection: [],
345 345
346 SectionName: ["A", "B", "C", "D", "E", "F"], 346 SectionName: ["A", "B", "C", "D", "E", "F"],
347 classRules: [(v) => !!v || "Class is required"], 347 classRules: [(v) => !!v || "Class is required"],
348 sectionRules: [(v) => !!v || "Class is required"], 348 sectionRules: [(v) => !!v || "Class is required"],
349 studentRules: [(v) => !!v || "Student is required"], 349 studentRules: [(v) => !!v || "Student is required"],
350 dataValid: [(v) => !!v || "Date is required"], 350 dataValid: [(v) => !!v || "Date is required"],
351 351
352 attendenceType: [ 352 attendenceType: [
353 { 353 {
354 label: "Present", 354 label: "Present",
355 value: true, 355 value: true,
356 }, 356 },
357 { 357 {
358 label: "Absent", 358 label: "Absent",
359 value: false, 359 value: false,
360 }, 360 },
361 ], 361 ],
362 }), 362 }),
363 watch: { 363 watch: {
364 addStudentAttendenceDialog: function (val) { 364 addStudentAttendenceDialog: function (val) {
365 if (!val) { 365 if (!val) {
366 this.getReport = []; 366 this.getReport = [];
367 // this.studentsData = []; 367 // this.studentsData = [];
368 } 368 }
369 }, 369 },
370 }, 370 },
371 methods: { 371 methods: {
372 save(date) { 372 save(date) {
373 this.$refs.menu.save(date); 373 this.$refs.menu.save(date);
374 }, 374 },
375 showTable() { 375 showTable() {
376 this.attendeceTable = true; 376 this.attendeceTable = true;
377 this.getStudents(); 377 this.getStudents();
378 }, 378 },
379 getAllClass() { 379 getAllClass() {
380 http() 380 http()
381 .get("/getClassesList", { 381 .get("/getClassesList", {
382 headers: { Authorization: "Bearer " + this.token }, 382 headers: { Authorization: "Bearer " + this.token },
383 }) 383 })
384 .then((response) => { 384 .then((response) => {
385 this.addclass = response.data.data; 385 this.addclass = response.data.data;
386 }) 386 })
387 .catch((error) => { 387 .catch((error) => {
388 // console.log("err====>", err); 388 // console.log("err====>", err);
389 // this.$router.replace({ path: "/" }); 389 // this.$router.replace({ path: "/" });
390 this.snackbar = true; 390 this.snackbar = true;
391 this.color = "error"; 391 this.color = "error";
392 this.text = error.response.data.message; 392 this.text = error.response.data.message;
393 }); 393 });
394 }, 394 },
395 getSection(_id) { 395 getSection(_id) {
396 this.showLoader = true; 396 this.showLoader = true;
397 this.studentsData = [];
397 http() 398 http()
398 .get( 399 .get(
399 "/getSectionsList", 400 "/getSectionsList",
400 { params: { classId: _id } }, 401 { params: { classId: _id } },
401 { 402 {
402 headers: { Authorization: "Bearer " + this.token }, 403 headers: { Authorization: "Bearer " + this.token },
403 } 404 }
404 ) 405 )
405 .then((response) => { 406 .then((response) => {
406 this.addSection = response.data.data; 407 this.addSection = response.data.data;
407 this.showLoader = false; 408 this.showLoader = false;
408 }) 409 })
409 .catch((err) => { 410 .catch((err) => {
410 this.showLoader = false; 411 this.showLoader = false;
411 this.snackbar = true; 412 this.snackbar = true;
412 this.color = "error"; 413 this.color = "error";
413 this.text = error.response.data.message; 414 this.text = error.response.data.message;
414 // console.log("err====>", err); 415 // console.log("err====>", err);
415 }); 416 });
416 }, 417 },
417 getStudents(_id) { 418 getStudents(_id) {
418 this.showLoader = true; 419 this.showLoader = true;
419 http() 420 http()
420 .get("/getStudentWithClass", { 421 .get("/getStudentWithClass", {
421 params: { 422 params: {
422 classId: this.getReport.classId, 423 classId: this.getReport.classId,
423 sectionId: this.getReport.sectionId, 424 sectionId: this.getReport.sectionId,
424 }, 425 },
425 }) 426 })
426 .then((response) => { 427 .then((response) => {
427 this.studentsData = response.data.data; 428 this.studentsData = response.data.data;
428 this.showLoader = false; 429 this.showLoader = false;
429 // this.addStudentAttendenceDialog = false; 430 // this.addStudentAttendenceDialog = false;
430 var attendence = ""; 431 var attendence = "";
431 for (let i = 0; i < this.studentsData.length; i++) { 432 for (let i = 0; i < this.studentsData.length; i++) {
432 this.studentsData[i].attendence = true; 433 this.studentsData[i].attendence = true;
433 } 434 }
434 }) 435 })
435 .catch((error) => { 436 .catch((error) => {
436 // console.log("err====>", error); 437 // console.log("err====>", error);
437 this.showLoader = false; 438 this.showLoader = false;
438 this.snackbar = true; 439 this.snackbar = true;
439 this.color = "error"; 440 this.color = "error";
440 this.text = error.response.data.message; 441 this.text = error.response.data.message;
441 }); 442 });
442 }, 443 },
443 getStudentsDetail(_id) { 444 getStudentsDetail(_id) {
444 this.showLoader = true; 445 this.showLoader = true;
445 http() 446 http()
446 .get("/getStudentWithClass", { 447 .get("/getStudentWithClass", {
447 params: { 448 params: {
448 classId: this.getAttendence.classId, 449 classId: this.getAttendence.classId,
449 sectionId: this.getAttendence.sectionId, 450 sectionId: this.getAttendence.sectionId,
450 }, 451 },
451 }) 452 })
452 .then((response) => { 453 .then((response) => {
453 this.studentsData = response.data.data; 454 this.studentsData = response.data.data;
454 this.showLoader = false; 455 this.showLoader = false;
455 // this.addStudentAttendenceDialog = false; 456 // this.addStudentAttendenceDialog = false;
456 var attendence = ""; 457 var attendence = "";
457 for (let i = 0; i < this.studentsData.length; i++) { 458 for (let i = 0; i < this.studentsData.length; i++) {
458 this.studentsData[i].attendence = true; 459 this.studentsData[i].attendence = true;
459 } 460 }
460 }) 461 })
461 .catch((error) => { 462 .catch((error) => {
462 // console.log("err====>", error); 463 // console.log("err====>", error);
463 this.showLoader = false; 464 this.showLoader = false;
464 this.snackbar = true; 465 this.snackbar = true;
465 this.color = "error"; 466 this.color = "error";
466 this.text = error.response.data.message; 467 this.text = error.response.data.message;
467 }); 468 });
468 }, 469 },
469 update() { 470 update() {
470 var studentsAttendence = []; 471 var studentsAttendence = [];
471 for (var j = 0; j < this.studentsData.length; j++) { 472 for (var j = 0; j < this.studentsData.length; j++) {
472 studentsAttendence.push({ 473 studentsAttendence.push({
473 studentId: this.studentsData[j]._id, 474 studentId: this.studentsData[j]._id,
474 isPresent: this.studentsData[j].attendence, 475 isPresent: this.studentsData[j].attendence,
475 }); 476 });
476 } 477 }
477 if (this.$refs.form.validate()) { 478 if (this.$refs.form.validate()) {
478 let attendanceData = { 479 let attendanceData = {
479 sectionId: this.getReport.sectionId, 480 sectionId: this.getReport.sectionId,
480 date: this.date, 481 date: this.date,
481 students: studentsAttendence, 482 students: studentsAttendence,
482 }; 483 };
483 http() 484 http()
484 .put("/updateAttendance", attendanceData) 485 .put("/updateAttendance", attendanceData)
485 .then((response) => { 486 .then((response) => {
486 this.snackbar = true; 487 this.snackbar = true;
487 this.text = response.data.message; 488 this.text = response.data.message;
488 this.addStudentAttendenceDialog = false; 489 this.addStudentAttendenceDialog = false;
489 }) 490 })
490 .catch((error) => { 491 .catch((error) => {
491 this.snackbar = true; 492 this.snackbar = true;
492 this.text = error.response.data.message; 493 this.text = error.response.data.message;
493 }); 494 });
494 } 495 }
495 }, 496 },
496 497
497 displaySearch() { 498 displaySearch() {
498 this.show = false; 499 this.show = false;
499 this.showSearch = true; 500 this.showSearch = true;
500 }, 501 },
501 closeSearch() { 502 closeSearch() {
502 this.showSearch = false; 503 this.showSearch = false;
503 this.show = true; 504 this.show = true;
504 this.search = ""; 505 this.search = "";
505 }, 506 },
506 }, 507 },
507 mounted() { 508 mounted() {
508 // this.getStudentList(); 509 // this.getStudentList();
509 this.token = this.$store.state.token; 510 this.token = this.$store.state.token;
510 this.getAllClass(); 511 this.getAllClass();
511 this.role = this.$store.state.role; 512 this.role = this.$store.state.role;
512 }, 513 },
513 }; 514 };
514 </script> 515 </script>
src/pages/Dashboard/LiveOnlineClass.vue
1 <template> 1 <template>
2 <div class="body-color"> 2 <div class="body-color">
3 <!-- LOADER --> 3 <!-- LOADER -->
4 <div class="loader" v-if="showLoader"> 4 <div class="loader" v-if="showLoader">
5 <v-progress-circular indeterminate color="white"></v-progress-circular> 5 <v-progress-circular indeterminate color="white"></v-progress-circular>
6 </div> 6 </div>
7 7
8 <!-- SNACKBAR --> 8 <!-- SNACKBAR -->
9 <v-snackbar 9 <v-snackbar
10 :timeout="timeout" 10 :timeout="timeout"
11 :top="y === 'top'" 11 :top="y === 'top'"
12 :right="x === 'right'" 12 :right="x === 'right'"
13 :vertical="mode === 'vertical'" 13 :vertical="mode === 'vertical'"
14 v-model="snackbar" 14 v-model="snackbar"
15 :color="snackbarColor" 15 :color="snackbarColor"
16 > 16 >
17 {{ text }} 17 {{ text }}
18 <v-spacer></v-spacer> 18 <v-spacer></v-spacer>
19 <v-btn flat text @click="snackbar = false">X</v-btn> 19 <v-btn flat text @click="snackbar = false">X</v-btn>
20 </v-snackbar> 20 </v-snackbar>
21 21
22 <v-container grid-list-xl class="pt-0"> 22 <v-container grid-list-xl class="pt-0">
23 <v-layout row wrap class="mt-1"> 23 <v-layout row wrap class="mt-1">
24 <!-- if logged in user is parent --> 24 <!-- if logged in user is parent -->
25 <v-flex xs12 sm12 md9 v-if=" $store.state.role === 'PARENT' "> 25 <v-flex xs12 sm12 md9 v-if=" $store.state.role === 'PARENT' ">
26 <v-layout column> 26 <v-layout column>
27 <!-- HEADING --> 27 <!-- HEADING -->
28 <v-flex> 28 <v-flex>
29 <div 29 <div
30 class="title side-bar-color font-weight-bold" 30 class="title side-bar-color font-weight-bold"
31 >Live Online Classes - {{$route.query.chapterName}}</div> 31 >Live Online Classes - {{$route.query.chapterName}}</div>
32 <!-- <div class="subheading grey--text lighten-1">{{liveLink}}</div> --> 32 <!-- <div class="subheading grey--text lighten-1">{{liveLink}}</div> -->
33 <!-- <div 33 <!-- <div
34 class="subheading grey--text lighten-1" 34 class="subheading grey--text lighten-1"
35 >The session started at 1:00 there is 1 moderator</div>--> 35 >The session started at 1:00 there is 1 moderator</div>-->
36 </v-flex> 36 </v-flex>
37 37
38 <!-- JOIN OR END SESSION --> 38 <!-- JOIN OR END SESSION -->
39 <v-flex> 39 <v-flex>
40 <div> 40 <div>
41 <v-btn 41 <v-btn
42 round 42 round
43 class="open-dialog-button" 43 class="open-dialog-button"
44 dark 44 dark
45 v-if="studentBtn" 45 v-if="studentBtn"
46 @click="showLoader = true;startChat();" 46 @click="showLoader = true;startChat();"
47 >{{studentBtn}}</v-btn> 47 >{{studentBtn}}</v-btn>
48 <span class="subheading grey--twxt lighten-1" v-else>Session hasnt started yet</span> 48 <span class="subheading grey--twxt lighten-1" v-else>Session hasnt started yet</span>
49 </div> 49 </div>
50 </v-flex> 50 </v-flex>
51 <v-flex id="studentClone"> 51 <v-flex id="studentClone">
52 <div id="jitsi-container"></div> 52 <div id="jitsi-container"></div>
53 </v-flex> 53 </v-flex>
54 </v-layout> 54 </v-layout>
55 </v-flex> 55 </v-flex>
56 56
57 <!-- if logged in user is teacher --> 57 <!-- if logged in user is teacher -->
58 <v-flex xs12 sm12 md12 v-else> 58 <v-flex xs12 sm12 md12 v-else>
59 <v-layout column> 59 <v-layout column>
60 <!-- HEADING --> 60 <!-- HEADING -->
61 <v-flex> 61 <v-flex>
62 <div 62 <div
63 class="title side-bar-color font-weight-bold" 63 class="title side-bar-color font-weight-bold"
64 >Live Online Classes - {{$route.query.chapterName}}</div> 64 >Live Online Classes - {{$route.query.chapterName}}</div>
65 <!-- <div class="subheading grey--text lighten-1"></div> --> 65 <!-- <div class="subheading grey--text lighten-1"></div> -->
66 <!-- <div 66 <!-- <div
67 class="subheading grey--text lighten-1" 67 class="subheading grey--text lighten-1"
68 >The session started at 1:00 there is 1 moderator</div>--> 68 >The session started at 1:00 there is 1 moderator</div>-->
69 </v-flex> 69 </v-flex>
70 70
71 <!-- JOIN OR END SESSION --> 71 <!-- JOIN OR END SESSION -->
72 <v-flex> 72 <v-flex>
73 <div> 73 <div>
74 <v-btn 74 <v-btn
75 round 75 round
76 class="open-dialog-button" 76 class="open-dialog-button"
77 dark 77 dark
78 @click="showLoader = true;startChat()" 78 @click="showLoader = true;startChat()"
79 >Start Session</v-btn> 79 >Start Session</v-btn>
80 </div> 80 </div>
81 </v-flex> 81 </v-flex>
82 <v-flex id="teacherClone"> 82 <v-flex id="teacherClone">
83 <div id="jitsi-container"></div> 83 <div id="jitsi-container"></div>
84 </v-flex> 84 </v-flex>
85 </v-layout> 85 </v-layout>
86 </v-flex> 86 </v-flex>
87 87
88 <v-spacer></v-spacer> 88 <v-spacer></v-spacer>
89 89
90 <!-- COURSES SIDE BAR- positioned to the right of the page --> 90 <!-- COURSES SIDE BAR- positioned to the right of the page -->
91 <!-- <v-flex xs3> 91 <!-- <v-flex xs3>
92 <v-card class="elevation-0 card-border" height="100%"> 92 <v-card class="elevation-0 card-border" height="100%">
93 <CoursesSideBar></CoursesSideBar> 93 <CoursesSideBar></CoursesSideBar>
94 </v-card> 94 </v-card>
95 </v-flex>--> 95 </v-flex>-->
96 </v-layout> 96 </v-layout>
97 </v-container> 97 </v-container>
98 </div> 98 </div>
99 </template> 99 </template>
100 <script> 100 <script>
101 import AllApiCalls from "@/Services/AllApiCalls.js"; 101 import AllApiCalls from "@/Services/AllApiCalls.js";
102 import http from "@/Services/http.js"; 102 import http from "@/Services/http.js";
103 import moment from "moment"; 103 import moment from "moment";
104 import Meet from "@/pages/Meet/meet.vue"; 104 import Meet from "@/pages/Meet/meet.vue";
105 import CoursesSideBar from "@/pages/Common/CoursesSideBar.vue"; 105 import CoursesSideBar from "@/pages/Common/CoursesSideBar.vue";
106 export default { 106 export default {
107 mixins: [AllApiCalls], 107 mixins: [AllApiCalls],
108 components: { 108 components: {
109 CoursesSideBar, 109 CoursesSideBar,
110 }, 110 },
111 data() { 111 data() {
112 return { 112 return {
113 startLiveSession: "", 113 startLiveSession: "",
114 studentBtn: "", 114 studentBtn: "",
115 115
116 // DATA TABLE 116 // DATA TABLE
117 search: "", 117 search: "",
118 pagination: { 118 pagination: {
119 rowsPerPage: 10, 119 rowsPerPage: 10,
120 }, 120 },
121 liveOnlineHeaders: [ 121 liveOnlineHeaders: [
122 { 122 {
123 text: "Playback", 123 text: "Playback",
124 value: "attachementUrl", 124 value: "attachementUrl",
125 sortable: false, 125 sortable: false,
126 align: "center", 126 align: "center",
127 }, 127 },
128 { 128 {
129 text: "Meeting", 129 text: "Meeting",
130 align: "center", 130 align: "center",
131 sortable: false, 131 sortable: false,
132 value: "", 132 value: "",
133 }, 133 },
134 { 134 {
135 text: "Recording", 135 text: "Recording",
136 value: "", 136 value: "",
137 sortable: false, 137 sortable: false,
138 align: "center", 138 align: "center",
139 }, 139 },
140 { 140 {
141 text: "Description Preview", 141 text: "Description Preview",
142 value: "", 142 value: "",
143 sortable: false, 143 sortable: false,
144 align: "center", 144 align: "center",
145 }, 145 },
146 { text: "Date", value: "", sortable: false, align: "center" }, 146 { text: "Date", value: "", sortable: false, align: "center" },
147 { text: "Duration", value: "", sortable: false, align: "center" }, 147 { text: "Duration", value: "", sortable: false, align: "center" },
148 { text: "Toolbar", value: "", sortable: false, align: "center" }, 148 { text: "Toolbar", value: "", sortable: false, align: "center" },
149 ], 149 ],
150 liveOnlineItems: [], 150 liveOnlineItems: [],
151 151
152 // JITSI CONTAINER 152 // JITSI CONTAINER
153 liveLink: "", 153 liveLink: "",
154 livePassword: "",
154 token: "", 155 token: "",
155 selectStudents: {}, 156 selectStudents: {},
156 classRules: [(v) => !!v || " Class Name is required"], 157 classRules: [(v) => !!v || " Class Name is required"],
157 sectionRules: [(v) => !!v || " Section Name is required"], 158 sectionRules: [(v) => !!v || " Section Name is required"],
158 addclass: [], 159 addclass: [],
159 addSection: [], 160 addSection: [],
160 loading: false, 161 loading: false,
161 room: "", 162 room: "",
162 username: "", 163 username: "",
163 roomPassword: "", 164 roomPassword: "",
164 counter: 0, 165 counter: 0,
165 }; 166 };
166 }, 167 },
167 methods: { 168 methods: {
168 async startChat() { 169 async startChat() {
169 if (this.$store.state.role === "PARENT") { 170 if (this.$store.state.role === "PARENT") {
170 if (this.counter == 0) { 171 if (this.counter == 0) {
171 // console.log("enter start chat"); 172 // console.log("enter start chat");
172 this.startConference(); 173 this.startConference();
173 this.counter += 1; 174 this.counter += 1;
174 } 175 }
175 } 176 }
176 if (this.$store.state.role === "TEACHER") { 177 if (this.$store.state.role === "TEACHER") {
177 if (this.counter == 0) { 178 if (this.counter == 0) {
178 this.createRoom(); 179 this.createRoom();
179 this.counter += 1; 180 this.counter += 1;
180 } 181 }
181 } 182 }
182 }, 183 },
183 // JITSI CONTAINER 184 // JITSI CONTAINER
184 startConference() { 185 startConference() {
185 // console.log("yes session started"); 186 // console.log("yes session started");
186 var _this = this; 187 var _this = this;
187 try { 188 try {
188 const domain = "meet.intrack.in"; 189 const domain = "meet.intrack.in";
189 const options = { 190 const options = {
190 audioInput: "<deviceLabel>", 191 audioInput: "<deviceLabel>",
191 audioOutput: "<deviceLabel>", 192 audioOutput: "<deviceLabel>",
192 videoInput: "<deviceLabel>", 193 videoInput: "<deviceLabel>",
193 prejoinPageEnabled: false, 194 prejoinPageEnabled: false,
194 roomName: this.room, 195 roomName: this.room,
195 height: 500, 196 height: 500,
196 parentNode: document.getElementById("jitsi-container"), 197 parentNode: document.getElementById("jitsi-container"),
197 interfaceConfigOverwrite: { 198 interfaceConfigOverwrite: {
198 filmStripOnly: false, 199 filmStripOnly: false,
199 SHOW_PROMOTIONAL_CLOSE_PAGE: false, 200 SHOW_PROMOTIONAL_CLOSE_PAGE: false,
200 SHOW_POWERED_BY: false, 201 SHOW_POWERED_BY: false,
201 SHOW_JITSI_WATERMARK: false, 202 SHOW_JITSI_WATERMARK: false,
202 TOOLBAR_BUTTONS: [ 203 TOOLBAR_BUTTONS: [
203 "microphone", 204 "microphone",
204 "camera", 205 "camera",
205 "closedcaptions", 206 "closedcaptions",
206 "desktop", 207 "desktop",
207 "fullscreen", 208 "fullscreen",
208 "fodeviceselection", 209 "fodeviceselection",
209 "hangup", 210 "hangup",
210 "profile", 211 "profile",
211 "info", 212 "info",
212 "chat", 213 "chat",
213 "recording", 214 "recording",
214 "livestreaming", 215 "livestreaming",
215 "etherpad", 216 "etherpad",
216 "sharedvideo", 217 "sharedvideo",
217 "settings", 218 "settings",
218 "raisehand", 219 "raisehand",
219 "videoquality", 220 "videoquality",
220 "filmstrip", 221 "filmstrip",
221 "invite", 222 "invite",
222 "feedback", 223 "feedback",
223 "stats", 224 "stats",
224 "shortcuts", 225 "shortcuts",
225 "tileview", 226 "tileview",
226 ], 227 ],
227 }, 228 },
228 configOverwrite: { 229 configOverwrite: {
229 disableSimulcast: false, 230 disableSimulcast: false,
230 }, 231 },
231 teacherName: "", 232 teacherName: "",
232 romm: "", 233 romm: "",
233 }; 234 };
234 _this.api = new JitsiMeetExternalAPI(domain, options); 235 _this.api = new JitsiMeetExternalAPI(domain, options);
235 // console.log("this.api ", this.api); 236 // console.log("this.api ", this.api);
236 _this.api.addEventListener("videoConferenceJoined", () => { 237 _this.api.addEventListener("videoConferenceJoined", () => {
237 // console.log("Local User Joined"); 238 // console.log("Local User Joined");
238 this.showLoader = false; 239 this.showLoader = false;
239 _this.api.executeCommand("displayName", _this.username); 240 _this.api.executeCommand("displayName", _this.username);
240 _this.api.executeCommand("password", _this.roomPassword); 241 _this.api.executeCommand("password", _this.roomPassword);
241 }); 242 });
242 243
243 _this.api.on("readyToClose", () => { 244 _this.api.on("readyToClose", () => {
244 this.$router.push({ name: "Refresh" }); 245 this.$router.push({ name: "Refresh" });
245 }); 246 });
246 } catch (error) { 247 } catch (error) {
247 // console.error("Failed to load Jitsi API", error); 248 // console.error("Failed to load Jitsi API", error);
248 } 249 }
249 }, 250 },
250 openRoom() { 251 openRoom() {
251 // verify the JitsiMeetExternalAPI constructor is added to the global.. 252 // verify the JitsiMeetExternalAPI constructor is added to the global..
252 // if (this.teacherName != "" || this.room != "") { 253 // if (this.teacherName != "" || this.room != "") {
253 // if (window.JitsiMeetExternalAPI) { 254 // if (window.JitsiMeetExternalAPI) {
254 // // var person = prompt("Please enter your name:", "Rabie"); 255 // // var person = prompt("Please enter your name:", "Rabie");
255 // if (person != null || person != "") this.username = this.teacherName; 256 // if (person != null || person != "") this.username = this.teacherName;
256 // var room = prompt("Please enter your room:", "Test Room"); 257 // var room = prompt("Please enter your room:", "Test Room");
257 // if (room != null || room != "") this.room = this.room; 258 // if (room != null || room != "") this.room = this.room;
258 // this.startConference(); 259 // this.startConference();
259 // } else alert("Jitsi Meet API script not loaded"); 260 // } else alert("Jitsi Meet API script not loaded");
260 // } 261 // }
261 }, 262 },
262 263
263 createRoom(classId) { 264 createRoom(classId) {
264 // this.showLoader = true; 265 // this.showLoader = true;
265 var classId = { 266 var classId = {
266 classId: classId, 267 classId: classId,
267 }; 268 };
268 http() 269 http()
269 .post("/createLiveClasses", { 270 .post("/createLiveClasses", {
270 classId: this.$route.query.classId, 271 classId: this.$route.query.classId,
271 courseId: this.$route.query.courseId, 272 courseId: this.$route.query.courseId,
272 chapterId: this.$route.query.chapterId, 273 chapterId: this.$route.query.chapterId,
273 }) 274 })
274 .then((response) => { 275 .then((response) => {
275 // this.addSection = response.data.data; 276 // this.addSection = response.data.data;
276 // console.log("CREATE___ROOOM", response.data); 277 // console.log("CREATE___ROOOM", response.data);
277 var room = response.data.data.roomName; 278 var room = response.data.data.roomName;
278 var username = localStorage.getItem("teacherName"); 279 var username = localStorage.getItem("teacherName");
279 var roomPassword = response.data.data.password; 280 var roomPassword = response.data.data.password;
280 // console.log( 281 // console.log(
281 // "room", 282 // "room",
282 // room, 283 // room,
283 // "username", 284 // "username",
284 // username, 285 // username,
285 // "roomPassword", 286 // "roomPassword",
286 // roomPassword 287 // roomPassword
287 // ); 288 // );
288 var this_ = this; 289 var this_ = this;
289 if (username != "" || room != "") { 290 if (username != "" || room != "") {
290 if (window.JitsiMeetExternalAPI) { 291 if (window.JitsiMeetExternalAPI) {
291 // var person = prompt("Please enter your name:", "Rabie"); 292 // var person = prompt("Please enter your name:", "Rabie");
292 if (username != null || username != "") { 293 if (username != null || username != "") {
293 this_.username = username; 294 this_.username = username;
294 } 295 }
295 // var room = prompt("Please enter your room:", "Test Room"); 296 // var room = prompt("Please enter your room:", "Test Room");
296 if (room != null || room != "") { 297 if (room != null || room != "") {
297 this_.room = room; 298 this_.room = room;
298 } 299 }
299 if (roomPassword != null || roomPassword != "") { 300 if (roomPassword != null || roomPassword != "") {
300 this_.password = roomPassword; 301 this_.password = roomPassword;
301 } 302 }
302 } else alert("Jitsi Meet API script not loaded"); 303 } else alert("Jitsi Meet API script not loaded");
303 this_.startConference(); 304 this_.startConference();
304 } 305 }
305 }) 306 })
306 .catch((err) => { 307 .catch((err) => {
307 this.showLoader = false; 308 this.showLoader = false;
308 }); 309 });
309 }, 310 },
310 async studentClasses() { 311 async studentClasses() {
311 this.liveLink = ""; 312 this.liveLink = "";
313 this.livePassword = "";
312 this.room = ""; 314 this.room = "";
313 this.username = ""; 315 this.username = "";
314 this.roomPassword = ""; 316 this.roomPassword = "";
315 /* getLiveClassesesList - To up date line under heading*/ 317 /* getLiveClassesesList - To up date line under heading*/
316 let response = await this.getLiveClassesesList({ 318 let response = await this.getLiveClassesesList({
317 classId: this.$route.query.classId, 319 classId: this.$route.query.classId,
318 courseId: this.$route.query.courseId, 320 courseId: this.$route.query.courseId,
319 chapterId: this.$route.query.chapterId, 321 chapterId: this.$route.query.chapterId,
320 }); 322 });
321 // console.log("response getLiveClassesesList- ", response); 323 // console.log("response getLiveClassesesList- ", response);
322 324
323 /* CHECK RESPONSE TO ASSIGN MESSAGE INSIDE BUTTON */ 325 /* CHECK RESPONSE TO ASSIGN MESSAGE INSIDE BUTTON */
324 if (response.data.data[0].sessionStatus == "ENDED") { 326 if (response.data.data[0].sessionStatus == "ENDED") {
325 // this.startLiveSession = "Start Session"; 327 // this.startLiveSession = "Start Session";
326 this.studentBtn = ""; 328 this.studentBtn = "";
327 } 329 }
328 if (response.data.data[0].sessionStatus == "STARTED") { 330 if (response.data.data[0].sessionStatus == "STARTED") {
329 // this.startLiveSession = "Join Session"; 331 // this.startLiveSession = "Join Session";
330 this.studentBtn = "Join Session"; 332 this.studentBtn = "Join Session";
331 } 333 }
332 if (response.data.data.length == 0) { 334 if (response.data.data.length == 0) {
333 this.startLiveSession = "Start Session"; 335 this.startLiveSession = "Start Session";
334 this.studentBtn = ""; 336 this.studentBtn = "";
335 } else { 337 } else {
336 this.liveLink = response.data.data[0].link; 338 this.liveLink = response.data.data[0].link;
339 this.livePassword = response.data.data[0].password;
337 var room = response.data.data[0].roomName; 340 var room = response.data.data[0].roomName;
338 var username = this.currentUser; 341 var username = this.currentUser;
339 var roomPassword = response.data.data[0].password; 342 var roomPassword = response.data.data[0].password;
340 var this_ = this; 343 var this_ = this;
341 // console.log(this.room, this.roomPassword, this.username); 344 // console.log(this.room, this.roomPassword, this.username);
345 // console.log("live session link", this.liveLink);
346 // console.log("live session password", this.livePassword);
342 347
343 if (username != "" || room != "") { 348 if (username != "" || room != "") {
344 if (window.JitsiMeetExternalAPI) { 349 if (window.JitsiMeetExternalAPI) {
345 // var person = prompt("Please enter your name:", "Rabie"); 350 // var person = prompt("Please enter your name:", "Rabie");
346 if (username != null || username != "") { 351 if (username != null || username != "") {
347 this_.username = username; 352 this_.username = username;
348 } 353 }
349 if (roomPassword != null || roomPassword != "") { 354 if (roomPassword != null || roomPassword != "") {
350 this_.roomPassword = roomPassword; 355 this_.roomPassword = roomPassword;
351 } 356 }
352 // var room = prompt("Please enter your room:", "Test Room"); 357 // var room = prompt("Please enter your room:", "Test Room");
353 if (room != null || room != "") { 358 if (room != null || room != "") {
354 this_.room = room; 359 this_.room = room;
355 } 360 }
356 // this.startConference(); 361 // this.startConference();
357 } 362 }
358 } 363 }
359 } 364 }
360 }, 365 },
361 }, 366 },
362 367
363 async created() { 368 async created() {
364 // console.log( 369 // console.log(
365 // "this.$store.state.studentsData", 370 // "this.$store.state.studentsData",
366 // this.$store.state.studentsData[0].name 371 // this.$store.state.studentsData[0].name
367 // ); 372 // );
368 this.currentUser = localStorage.getItem("studentName"); 373 this.currentUser = localStorage.getItem("studentName");
369 this.token = this.$store.state.token; 374 this.token = this.$store.state.token;
370 if (this.$store.state.role === "PARENT") { 375 if (this.$store.state.role === "PARENT") {
371 await this.studentClasses(); 376 await this.studentClasses();
372 } 377 }
373 378
374 /* getStudentCourses - to get courseData - defined in GetApis.js*/ 379 /* getStudentCourses - to get courseData - defined in GetApis.js*/
375 if (this.$store.state.role === "PARENT") { 380 if (this.$store.state.role === "PARENT") {
376 await this.getStudentCourses({ 381 await this.getStudentCourses({
377 classId: localStorage.getItem("parentClassId"), 382 classId: localStorage.getItem("parentClassId"),
378 studentId: localStorage.getItem("parentStudentId"), 383 studentId: localStorage.getItem("parentStudentId"),
379 }); 384 });
380 } 385 }
381 }, 386 },
382 }; 387 };
383 </script> 388 </script>
384 <style scoped> 389 <style scoped>
385 .side-bar-color { 390 .side-bar-color {
386 color: #827bfa !important; 391 color: #827bfa !important;
387 /* border-top-right-radius: 74px !important; */ 392 /* border-top-right-radius: 74px !important; */
388 } 393 }
389 .card-border { 394 .card-border {
390 border: 1px #bdbdbd solid; 395 border: 1px #bdbdbd solid;
391 border-radius: 3px; 396 border-radius: 3px;
392 } 397 }
393 .reply-desc { 398 .reply-desc {
394 border: 1px solid #f2f2f2; 399 border: 1px solid #f2f2f2;
395 } 400 }
396 .open-dialog-button { 401 .open-dialog-button {
397 background: #827bfa !important; 402 background: #827bfa !important;
398 border-color: #827bfa !important; 403 border-color: #827bfa !important;
399 text-transform: none !important; 404 text-transform: none !important;
400 } 405 }
401 406
402 .reply-btn { 407 .reply-btn {
403 background: #feb83c !important; 408 background: #feb83c !important;
404 border-color: #feb83c !important; 409 border-color: #feb83c !important;
405 text-transform: none !important; 410 text-transform: none !important;
406 -webkit-box-shadow: none !important; 411 -webkit-box-shadow: none !important;
407 box-shadow: none !important; 412 box-shadow: none !important;
408 } 413 }
409 #jitsi-container { 414 #jitsi-container {
410 height: 100vh; 415 height: 100vh;
411 } 416 }
412 </style> 417 </style>
src/pages/Exam/examSchedule.vue
1 <template> 1 <template>
2 <v-container fluid class="body-color"> 2 <v-container fluid class="body-color">
3 <!-- ****** Edit Exam Schedule****** --> 3 <!-- ****** Edit Exam Schedule****** -->
4 <v-dialog v-model="editExamScheduleDialog" max-width="800px" scrollable persistent> 4 <v-dialog v-model="editExamScheduleDialog" max-width="800px" scrollable persistent>
5 <v-card flat class="card-style pa-2" dark> 5 <v-card flat class="card-style pa-2" dark>
6 <v-layout> 6 <v-layout>
7 <v-flex xs12> 7 <v-flex xs12>
8 <label class="title text-xs-center">Edit Exam Schedule</label> 8 <label class="title text-xs-center">Edit Exam Schedule</label>
9 <v-icon size="24" class="right" @click="editExamScheduleDialog = false">cancel</v-icon> 9 <v-icon size="24" class="right" @click="editExamScheduleDialog = false">cancel</v-icon>
10 </v-flex> 10 </v-flex>
11 </v-layout> 11 </v-layout>
12 <v-card-text> 12 <v-card-text>
13 <v-form ref="form"> 13 <v-form ref="form">
14 <v-container fluid> 14 <v-container fluid>
15 <v-layout wrap> 15 <v-layout wrap>
16 <v-flex xs12 sm12> 16 <v-flex xs12 sm12>
17 <v-layout> 17 <v-layout>
18 <v-flex xs4 class="pt-4 subheading"> 18 <v-flex xs4 class="pt-4 subheading">
19 <label class="right">Exam Name:</label> 19 <label class="right">Exam Name:</label>
20 </v-flex> 20 </v-flex>
21 <v-flex xs7 class="ml-3"> 21 <v-flex xs7 class="ml-3">
22 <v-select 22 <v-select
23 :rules="examRules" 23 :rules="examRules"
24 :items="examList" 24 :items="examList"
25 v-model="editedItem.examId" 25 v-model="editedItem.examId"
26 label="Select your Exam Name" 26 label="Select your Exam Name"
27 item-text="examName" 27 item-text="examName"
28 item-value="_id" 28 item-value="_id"
29 ></v-select> 29 ></v-select>
30 </v-flex> 30 </v-flex>
31 </v-layout> 31 </v-layout>
32 </v-flex> 32 </v-flex>
33 <v-flex xs12 sm12> 33 <v-flex xs12 sm12>
34 <v-layout> 34 <v-layout>
35 <v-flex xs4 class="pt-4 subheading"> 35 <v-flex xs4 class="pt-4 subheading">
36 <label class="right">Class:</label> 36 <label class="right">Class:</label>
37 </v-flex> 37 </v-flex>
38 <v-flex xs7 class="ml-3"> 38 <v-flex xs7 class="ml-3">
39 <v-select 39 <v-select
40 v-model="editedItem.classId" 40 v-model="editedItem.classId"
41 label="Select your Class" 41 label="Select your Class"
42 type="text" 42 type="text"
43 :items="classList" 43 :items="classList"
44 item-text="classNum" 44 item-text="classNum"
45 item-value="_id" 45 item-value="_id"
46 @change="getSections(editedItem.classId)" 46 @change="getSections(editedItem.classId)"
47 required 47 required
48 ></v-select> 48 ></v-select>
49 </v-flex> 49 </v-flex>
50 </v-layout> 50 </v-layout>
51 </v-flex> 51 </v-flex>
52 <v-flex xs12 sm12> 52 <v-flex xs12 sm12>
53 <v-layout> 53 <v-layout>
54 <v-flex xs4 class="pt-4 subheading"> 54 <v-flex xs4 class="pt-4 subheading">
55 <label class="right">Subject Name:</label> 55 <label class="right">Subject Name:</label>
56 </v-flex> 56 </v-flex>
57 <v-flex xs7 class="ml-3"> 57 <v-flex xs7 class="ml-3">
58 <v-select 58 <v-select
59 :items="subjects" 59 :items="subjects"
60 label="Select your Subject" 60 label="Select your Subject"
61 v-model="editedItem.subjectName" 61 v-model="editedItem.subjectName"
62 item-text="subjectName" 62 item-text="subjectName"
63 item-value="subjectName" 63 item-value="subjectName"
64 name="Select Subject" 64 name="Select Subject"
65 required 65 required
66 ></v-select> 66 ></v-select>
67 </v-flex> 67 </v-flex>
68 </v-layout> 68 </v-layout>
69 </v-flex> 69 </v-flex>
70 <v-flex xs12 sm12> 70 <v-flex xs12 sm12>
71 <v-layout> 71 <v-layout>
72 <v-flex xs4 class="pt-4 subheading"> 72 <v-flex xs4 class="pt-4 subheading">
73 <label class="right">Date:</label> 73 <label class="right">Date:</label>
74 </v-flex> 74 </v-flex>
75 <v-flex xs7 class="ml-3"> 75 <v-flex xs7 class="ml-3">
76 <v-menu 76 <v-menu
77 ref="editDate" 77 ref="editDate"
78 :close-on-content-click="false" 78 :close-on-content-click="false"
79 v-model="editDate" 79 v-model="editDate"
80 :nudge-right="40" 80 :nudge-right="40"
81 :return-value.sync="editDate" 81 :return-value.sync="editDate"
82 lazy 82 lazy
83 transition="scale-transition" 83 transition="scale-transition"
84 offset-y 84 offset-y
85 full-width 85 full-width
86 min-width="290px" 86 min-width="290px"
87 > 87 >
88 <v-text-field 88 <v-text-field
89 slot="activator" 89 slot="activator"
90 v-model="editedItem.date" 90 v-model="editedItem.date"
91 label="Select Date" 91 label="Select Date"
92 append-icon="event" 92 append-icon="event"
93 readonly 93 readonly
94 ></v-text-field> 94 ></v-text-field>
95 <v-date-picker v-model="editedItem.date" @input="editDate = false"></v-date-picker> 95 <v-date-picker v-model="editedItem.date" @input="editDate = false"></v-date-picker>
96 </v-menu> 96 </v-menu>
97 </v-flex> 97 </v-flex>
98 </v-layout> 98 </v-layout>
99 </v-flex> 99 </v-flex>
100 <v-flex xs12 sm12> 100 <v-flex xs12 sm12>
101 <v-layout> 101 <v-layout>
102 <v-flex xs4 class="pt-4 subheading"> 102 <v-flex xs4 class="pt-4 subheading">
103 <label class="right">Time From:</label> 103 <label class="right">Time From:</label>
104 </v-flex> 104 </v-flex>
105 <v-flex xs7 class="ml-3"> 105 <v-flex xs7 class="ml-3">
106 <v-menu 106 <v-menu
107 ref="menuEdit" 107 ref="menuEdit"
108 :close-on-content-click="false" 108 :close-on-content-click="false"
109 v-model="menuEdit" 109 v-model="menuEdit"
110 :nudge-right="40" 110 :nudge-right="40"
111 :return-value.sync="editedItem.timeFrom" 111 :return-value.sync="editedItem.timeFrom"
112 lazy 112 lazy
113 transition="scale-transition" 113 transition="scale-transition"
114 offset-y 114 offset-y
115 full-width 115 full-width
116 max-width="290px" 116 max-width="290px"
117 min-width="290px" 117 min-width="290px"
118 > 118 >
119 <v-text-field 119 <v-text-field
120 slot="activator" 120 slot="activator"
121 v-model="editedItem.timeFrom" 121 v-model="editedItem.timeFrom"
122 label="Select your time From" 122 label="Select your time From"
123 append-icon="access_time" 123 append-icon="access_time"
124 readonly 124 readonly
125 ></v-text-field> 125 ></v-text-field>
126 <v-time-picker 126 <v-time-picker
127 v-model="editedItem.timeIn" 127 v-model="editedItem.timeIn"
128 @change="$refs.menuEdit.save(editedItem.timeIn)" 128 @change="$refs.menuEdit.save(editedItem.timeIn)"
129 ></v-time-picker> 129 ></v-time-picker>
130 </v-menu> 130 </v-menu>
131 </v-flex> 131 </v-flex>
132 </v-layout> 132 </v-layout>
133 </v-flex> 133 </v-flex>
134 <v-flex xs12 sm12> 134 <v-flex xs12 sm12>
135 <v-layout> 135 <v-layout>
136 <v-flex xs4 class="pt-4 subheading"> 136 <v-flex xs4 class="pt-4 subheading">
137 <label class="right">Time To:</label> 137 <label class="right">Time To:</label>
138 </v-flex> 138 </v-flex>
139 <v-flex xs7 class="ml-3"> 139 <v-flex xs7 class="ml-3">
140 <v-menu 140 <v-menu
141 ref="timeToEdit" 141 ref="timeToEdit"
142 :close-on-content-click="false" 142 :close-on-content-click="false"
143 v-model="timeToEdit" 143 v-model="timeToEdit"
144 :nudge-right="40" 144 :nudge-right="40"
145 :return-value.sync="editedItem.timeTo" 145 :return-value.sync="editedItem.timeTo"
146 lazy 146 lazy
147 transition="scale-transition" 147 transition="scale-transition"
148 offset-y 148 offset-y
149 full-width 149 full-width
150 max-width="290px" 150 max-width="290px"
151 min-width="290px" 151 min-width="290px"
152 > 152 >
153 <v-text-field 153 <v-text-field
154 slot="activator" 154 slot="activator"
155 v-model="editedItem.timeTo" 155 v-model="editedItem.timeTo"
156 label="Select your Time To" 156 label="Select your Time To"
157 append-icon="access_time" 157 append-icon="access_time"
158 readonly 158 readonly
159 ></v-text-field> 159 ></v-text-field>
160 <v-time-picker 160 <v-time-picker
161 v-model="editedItem.timeTo" 161 v-model="editedItem.timeTo"
162 @change="$refs.timeToEdit.save(editedItem.timeTo)" 162 @change="$refs.timeToEdit.save(editedItem.timeTo)"
163 ></v-time-picker> 163 ></v-time-picker>
164 </v-menu> 164 </v-menu>
165 </v-flex> 165 </v-flex>
166 </v-layout> 166 </v-layout>
167 </v-flex> 167 </v-flex>
168 <v-flex xs12 sm12> 168 <v-flex xs12 sm12>
169 <v-layout> 169 <v-layout>
170 <v-flex xs4 class="pt-4 subheading"> 170 <v-flex xs4 class="pt-4 subheading">
171 <label class="right">Room:</label> 171 <label class="right">Room:</label>
172 </v-flex> 172 </v-flex>
173 <v-flex xs7 class="ml-3"> 173 <v-flex xs7 class="ml-3">
174 <v-text-field 174 <v-text-field
175 placeholder="fill your room" 175 placeholder="fill your room"
176 v-model="editedItem.room" 176 v-model="editedItem.room"
177 @keyup.enter="save" 177 @keyup.enter="save"
178 ></v-text-field> 178 ></v-text-field>
179 </v-flex> 179 </v-flex>
180 </v-layout> 180 </v-layout>
181 </v-flex> 181 </v-flex>
182 </v-layout> 182 </v-layout>
183 <v-layout> 183 <v-layout>
184 <v-flex xs12> 184 <v-flex xs12>
185 <v-card-actions> 185 <v-card-actions>
186 <v-spacer></v-spacer> 186 <v-spacer></v-spacer>
187 <v-btn round dark @click="update" class="add-button">Save</v-btn> 187 <v-btn round dark @click="update" class="add-button">Save</v-btn>
188 </v-card-actions> 188 </v-card-actions>
189 </v-flex> 189 </v-flex>
190 </v-layout> 190 </v-layout>
191 </v-container> 191 </v-container>
192 </v-form> 192 </v-form>
193 </v-card-text> 193 </v-card-text>
194 </v-card> 194 </v-card>
195 </v-dialog> 195 </v-dialog>
196 196
197 <!-- ****** PROFILE VIEW Exam Schedule DATA ****** --> 197 <!-- ****** PROFILE VIEW Exam Schedule DATA ****** -->
198 198
199 <v-dialog v-model="profileExamScheduleDialog" max-width="600px" persistent> 199 <v-dialog v-model="profileExamScheduleDialog" max-width="600px" persistent>
200 <v-card flat class="card-style pa-3" dark> 200 <v-card flat class="card-style pa-3" dark>
201 <v-layout> 201 <v-layout>
202 <v-flex xs12> 202 <v-flex xs12>
203 <label class="title text-xs-center">View Exam Schedule</label> 203 <label class="title text-xs-center">View Exam Schedule</label>
204 <v-icon size="24" class="right" @click="profileExamScheduleDialog = false">cancel</v-icon> 204 <v-icon size="24" class="right" @click="profileExamScheduleDialog = false">cancel</v-icon>
205 </v-flex> 205 </v-flex>
206 </v-layout> 206 </v-layout>
207 <v-card-text> 207 <v-card-text>
208 <v-container grid-list-md> 208 <v-container grid-list-md>
209 <v-layout wrap> 209 <v-layout wrap>
210 <v-flex> 210 <v-flex>
211 <v-layout> 211 <v-layout>
212 <v-flex xs5 sm6> 212 <v-flex xs5 sm6>
213 <h5 class="right my-1"> 213 <h5 class="right my-1">
214 <b>Exam Name:</b> 214 <b>Exam Name:</b>
215 </h5> 215 </h5>
216 </v-flex> 216 </v-flex>
217 <v-flex sm6 xs8> 217 <v-flex sm6 xs8>
218 <h5 class="my-1">{{ editedItem.examId}}</h5> 218 <h5 class="my-1">{{ editedItem.examId}}</h5>
219 </v-flex> 219 </v-flex>
220 </v-layout> 220 </v-layout>
221 <v-layout> 221 <v-layout>
222 <v-flex xs5 sm6> 222 <v-flex xs5 sm6>
223 <h5 class="right my-1"> 223 <h5 class="right my-1">
224 <b>Class:</b> 224 <b>Class:</b>
225 </h5> 225 </h5>
226 </v-flex> 226 </v-flex>
227 <v-flex sm6 xs8> 227 <v-flex sm6 xs8>
228 <h5 class="my-1">{{ editedItem.classId }}</h5> 228 <h5 class="my-1">{{ editedItem.classId }}</h5>
229 </v-flex> 229 </v-flex>
230 </v-layout> 230 </v-layout>
231 <v-layout> 231 <v-layout>
232 <v-flex xs5 sm6> 232 <v-flex xs5 sm6>
233 <h5 class="right my-1"> 233 <h5 class="right my-1">
234 <b>Section:</b> 234 <b>Section:</b>
235 </h5> 235 </h5>
236 </v-flex> 236 </v-flex>
237 <v-flex sm6 xs8> 237 <v-flex sm6 xs8>
238 <h5 class="my-1">{{ editedItem.sectionId }}</h5> 238 <h5 class="my-1">{{ editedItem.sectionId }}</h5>
239 </v-flex> 239 </v-flex>
240 </v-layout> 240 </v-layout>
241 <v-layout> 241 <v-layout>
242 <v-flex xs5 sm6> 242 <v-flex xs5 sm6>
243 <h5 class="right my-1"> 243 <h5 class="right my-1">
244 <b>Subject Name:</b> 244 <b>Subject Name:</b>
245 </h5> 245 </h5>
246 </v-flex> 246 </v-flex>
247 <v-flex sm6 xs8> 247 <v-flex sm6 xs8>
248 <h5 class="my-1">{{ editedItem.subjectName }}</h5> 248 <h5 class="my-1">{{ editedItem.subjectName }}</h5>
249 </v-flex> 249 </v-flex>
250 </v-layout> 250 </v-layout>
251 <v-layout> 251 <v-layout>
252 <v-flex xs5 sm6> 252 <v-flex xs5 sm6>
253 <h5 class="right my-1"> 253 <h5 class="right my-1">
254 <b>Date:</b> 254 <b>Date:</b>
255 </h5> 255 </h5>
256 </v-flex> 256 </v-flex>
257 <v-flex sm6 xs8> 257 <v-flex sm6 xs8>
258 <h5 class="my-1">{{ dates(editedItem.date) }}</h5> 258 <h5 class="my-1">{{ dates(editedItem.date) }}</h5>
259 </v-flex> 259 </v-flex>
260 </v-layout> 260 </v-layout>
261 <v-layout> 261 <v-layout>
262 <v-flex xs5 sm6> 262 <v-flex xs5 sm6>
263 <h5 class="right my-1"> 263 <h5 class="right my-1">
264 <b>Time From:</b> 264 <b>Time From:</b>
265 </h5> 265 </h5>
266 </v-flex> 266 </v-flex>
267 <v-flex sm6 xs8> 267 <v-flex sm6 xs8>
268 <h5 class="my-1">{{ editedItem.timeFrom }}</h5> 268 <h5 class="my-1">{{ editedItem.timeFrom }}</h5>
269 </v-flex> 269 </v-flex>
270 </v-layout> 270 </v-layout>
271 <v-layout> 271 <v-layout>
272 <v-flex xs5 sm6> 272 <v-flex xs5 sm6>
273 <h5 class="right my-1"> 273 <h5 class="right my-1">
274 <b>Time To:</b> 274 <b>Time To:</b>
275 </h5> 275 </h5>
276 </v-flex> 276 </v-flex>
277 <v-flex sm6 xs8> 277 <v-flex sm6 xs8>
278 <h5 class="my-1">{{ editedItem.timeTo }}</h5> 278 <h5 class="my-1">{{ editedItem.timeTo }}</h5>
279 </v-flex> 279 </v-flex>
280 </v-layout> 280 </v-layout>
281 <v-layout> 281 <v-layout>
282 <v-flex xs5 sm6> 282 <v-flex xs5 sm6>
283 <h5 class="right my-1"> 283 <h5 class="right my-1">
284 <b>Room:</b> 284 <b>Room:</b>
285 </h5> 285 </h5>
286 </v-flex> 286 </v-flex>
287 <v-flex sm6 xs8> 287 <v-flex sm6 xs8>
288 <h5 class="my-1">{{ editedItem.room }}</h5> 288 <h5 class="my-1">{{ editedItem.room }}</h5>
289 </v-flex> 289 </v-flex>
290 </v-layout> 290 </v-layout>
291 </v-flex> 291 </v-flex>
292 </v-layout> 292 </v-layout>
293 </v-container> 293 </v-container>
294 </v-card-text> 294 </v-card-text>
295 </v-card> 295 </v-card>
296 </v-dialog> 296 </v-dialog>
297 <!-- ***** Exam Schedule TABLE****** --> 297 <!-- ***** Exam Schedule TABLE****** -->
298 <v-toolbar color="transparent" flat> 298 <v-toolbar color="transparent" flat>
299 <v-btn 299 <v-btn
300 fab 300 fab
301 dark 301 dark
302 class="open-dialog-button hidden-xl-only hidden-md-only hidden-lg-only" 302 class="open-dialog-button hidden-xl-only hidden-md-only hidden-lg-only"
303 small 303 small
304 @click="addExamScheduleDialog = true" 304 @click="addExamScheduleDialog = true"
305 > 305 >
306 <v-icon dark>add</v-icon> 306 <v-icon dark>add</v-icon>
307 </v-btn> 307 </v-btn>
308 <v-btn 308 <v-btn
309 v-if="role != 'TEACHER' " 309 v-if="role != 'TEACHER' "
310 round 310 round
311 class="open-dialog-button hidden-sm-only hidden-xs-only" 311 class="open-dialog-button hidden-sm-only hidden-xs-only"
312 dark 312 dark
313 @click="addExamScheduleDialog = true" 313 @click="addExamScheduleDialog = true"
314 > 314 >
315 <v-icon class="white--text pr-1" size="20">add</v-icon>Add Exam Schedule 315 <v-icon class="white--text pr-1" size="20">add</v-icon>Add Exam Schedule
316 </v-btn> 316 </v-btn>
317 <v-spacer></v-spacer> 317 <v-spacer></v-spacer>
318 <v-flex xs8 sm3 md2 class="mr-3"> 318 <v-flex xs8 sm3 md2 class="mr-3">
319 <v-select 319 <v-select
320 v-model="getScheduleData.classId" 320 v-model="getScheduleData.classId"
321 label="Select your class" 321 label="Select your class"
322 type="text" 322 type="text"
323 :items="classList" 323 :items="classList"
324 item-text="classNum" 324 item-text="classNum"
325 item-value="_id" 325 item-value="_id"
326 @change="getSections(getScheduleData.classId)" 326 @change="getSections(getScheduleData.classId)"
327 required 327 required
328 ></v-select> 328 ></v-select>
329 </v-flex> 329 </v-flex>
330 <v-flex xs8 sm3 md2 class="mr-3"> 330 <v-flex xs8 sm3 md2 class="mr-3">
331 <v-select 331 <v-select
332 v-model="getScheduleData.sectionId" 332 v-model="getScheduleData.sectionId"
333 label="Select your section" 333 label="Select your section"
334 type="text" 334 type="text"
335 :items="addSection" 335 :items="addSection"
336 item-text="name" 336 item-text="name"
337 item-value="_id" 337 item-value="_id"
338 @change="getSchedulesList(getScheduleData.classId,getScheduleData.sectionId)" 338 @change="getSchedulesList(getScheduleData.classId,getScheduleData.sectionId)"
339 required 339 required
340 ></v-select> 340 ></v-select>
341 </v-flex> 341 </v-flex>
342 <v-card-title class="body-1" v-show="show"> 342 <v-card-title class="body-1" v-show="show">
343 <v-btn icon large flat @click="displaySearch"> 343 <v-btn icon large flat @click="displaySearch">
344 <v-avatar size="27"> 344 <v-avatar size="27">
345 <img src="/static/icon/search.png" alt="icon" /> 345 <img src="/static/icon/search.png" alt="icon" />
346 </v-avatar> 346 </v-avatar>
347 </v-btn> 347 </v-btn>
348 </v-card-title> 348 </v-card-title>
349 <v-flex xs8 sm8 md3 lg2 v-if="showSearch"> 349 <v-flex xs8 sm8 md3 lg2 v-if="showSearch">
350 <v-layout> 350 <v-layout>
351 <v-text-field 351 <v-text-field
352 autofocus 352 autofocus
353 v-model="search" 353 v-model="search"
354 label="Search" 354 label="Search"
355 prepend-inner-icon="search" 355 prepend-inner-icon="search"
356 color="primary" 356 color="primary"
357 ></v-text-field> 357 ></v-text-field>
358 <v-icon @click="closeSearch" color="error">close</v-icon> 358 <v-icon @click="closeSearch" color="error">close</v-icon>
359 </v-layout> 359 </v-layout>
360 </v-flex> 360 </v-flex>
361 </v-toolbar> 361 </v-toolbar>
362 <v-data-table 362 <v-data-table
363 :headers="headers" 363 :headers="headers"
364 :items="ScheduleData" 364 :items="ScheduleData"
365 :pagination.sync="pagination" 365 :pagination.sync="pagination"
366 :search="search" 366 :search="search"
367 > 367 >
368 <template slot="items" slot-scope="props"> 368 <template slot="items" slot-scope="props">
369 <tr class="tr"> 369 <tr class="tr">
370 <td class="td td-row">{{ props.index + 1}}</td> 370 <td class="td td-row">{{ props.index + 1}}</td>
371 <td class="td td-row text-xs-center">{{ props.item.examId.examName}}</td> 371 <td class="td td-row text-xs-center">{{ props.item.examId.examName}}</td>
372 <td class="td td-row text-xs-center">{{ props.item.classId.classNum}}</td> 372 <td class="td td-row text-xs-center">{{ props.item.classId.classNum}}</td>
373 <td class="td td-row text-xs-center">{{ props.item.subjectName }}</td> 373 <td class="td td-row text-xs-center">{{ props.item.subjectName }}</td>
374 <td class="td td-row text-xs-center">{{ dates(props.item.date) }}</td> 374 <td class="td td-row text-xs-center">{{ dates(props.item.date) }}</td>
375 <td class="td td-row text-xs-center">{{ props.item.timeFrom }} - {{ props.item.timeTo }}</td> 375 <td class="td td-row text-xs-center">{{ props.item.timeFrom }} - {{ props.item.timeTo }}</td>
376 <td class="td td-row text-xs-center">{{ props.item.room }}</td> 376 <td class="td td-row text-xs-center">{{ props.item.room }}</td>
377 <td class="td td-row text-xs-center"> 377 <td class="td td-row text-xs-center">
378 <span> 378 <span>
379 <v-tooltip top> 379 <v-tooltip top>
380 <img 380 <img
381 slot="activator" 381 slot="activator"
382 style="cursor:pointer; width:25px; height:25px; " 382 style="cursor:pointer; width:25px; height:25px; "
383 class="mr-3" 383 class="mr-3"
384 @click="profile(props.item)" 384 @click="profile(props.item)"
385 src="/static/icon/view.png" 385 src="/static/icon/view.png"
386 /> 386 />
387 <span>View</span> 387 <span>View</span>
388 </v-tooltip> 388 </v-tooltip>
389 <v-tooltip top v-if="role != 'TEACHER' "> 389 <v-tooltip top v-if="role != 'TEACHER' ">
390 <img 390 <img
391 slot="activator" 391 slot="activator"
392 style="cursor:pointer; width:20px; height:18px; " 392 style="cursor:pointer; width:20px; height:18px; "
393 class="mr-3" 393 class="mr-3"
394 @click="editItem(props.item)" 394 @click="editItem(props.item)"
395 src="/static/icon/edit.png" 395 src="/static/icon/edit.png"
396 /> 396 />
397 <span>Edit</span> 397 <span>Edit</span>
398 </v-tooltip> 398 </v-tooltip>
399 <v-tooltip top v-if="role != 'TEACHER' "> 399 <v-tooltip top v-if="role != 'TEACHER' ">
400 <img 400 <img
401 slot="activator" 401 slot="activator"
402 style="cursor:pointer; width:20px; height:20px; " 402 style="cursor:pointer; width:20px; height:20px; "
403 @click="deleteSchedule(props.item)" 403 @click="deleteSchedule(props.item)"
404 src="/static/icon/delete.png" 404 src="/static/icon/delete.png"
405 /> 405 />
406 <span>Delete</span> 406 <span>Delete</span>
407 </v-tooltip> 407 </v-tooltip>
408 </span> 408 </span>
409 </td> 409 </td>
410 </tr> 410 </tr>
411 </template> 411 </template>
412 <v-alert 412 <v-alert
413 slot="no-results" 413 slot="no-results"
414 :value="true" 414 :value="true"
415 color="error" 415 color="error"
416 icon="warning" 416 icon="warning"
417 >Your search for "{{ search }}" found no results.</v-alert> 417 >Your search for "{{ search }}" found no results.</v-alert>
418 </v-data-table> 418 </v-data-table>
419 419
420 <!-- ****** ADD Exam Schedule ****** --> 420 <!-- ****** ADD Exam Schedule ****** -->
421 <v-dialog v-model="addExamScheduleDialog" max-width="600" v-if="addExamScheduleDialog" persistent> 421 <v-dialog
422 v-model="addExamScheduleDialog"
423 max-width="600"
424 v-if="addExamScheduleDialog"
425 persistent
426 >
422 <v-card flat class="card-style pa-2" dark> 427 <v-card flat class="card-style pa-2" dark>
423 <v-layout> 428 <v-layout>
424 <v-flex xs12> 429 <v-flex xs12>
425 <label class="title text-xs-center">Add Exam Schedule</label> 430 <label class="title text-xs-center">Add Exam Schedule</label>
426 <v-icon 431 <v-icon
427 size="24" 432 size="24"
428 class="right" 433 class="right"
429 @click="$refs.form.reset();addExamScheduleDialog = false" 434 @click="$refs.form.reset();addExamScheduleDialog = false"
430 >cancel</v-icon> 435 >cancel</v-icon>
431 </v-flex> 436 </v-flex>
432 </v-layout> 437 </v-layout>
433 <v-form ref="form" v-model="valid" lazy-validation> 438 <v-form ref="form" v-model="valid" lazy-validation>
434 <v-container fluid> 439 <v-container fluid>
435 <v-flex xs12> 440 <v-flex xs12>
436 <v-layout> 441 <v-layout>
437 <v-flex xs5 class="pt-4 subheading"> 442 <v-flex xs5 class="pt-4 subheading">
438 <label class="right">Exam Name:</label> 443 <label class="right">Exam Name:</label>
439 </v-flex> 444 </v-flex>
440 <v-flex xs7 sm7 md6 class="ml-3"> 445 <v-flex xs7 sm7 md6 class="ml-3">
441 <v-select 446 <v-select
442 label="Select your Exam Name" 447 label="Select your Exam Name"
443 :rules="examRules" 448 :rules="examRules"
444 :items="examList" 449 :items="examList"
445 v-model="addSchedule.examId" 450 v-model="addSchedule.examId"
446 item-text="examName" 451 item-text="examName"
447 item-value="_id" 452 item-value="_id"
448 ></v-select> 453 ></v-select>
449 </v-flex> 454 </v-flex>
450 </v-layout> 455 </v-layout>
451 </v-flex> 456 </v-flex>
452 <v-flex xs12> 457 <v-flex xs12>
453 <v-layout> 458 <v-layout>
454 <v-flex xs5 class="pt-4 subheading"> 459 <v-flex xs5 class="pt-4 subheading">
455 <label class="right">Class:</label> 460 <label class="right">Class:</label>
456 </v-flex> 461 </v-flex>
457 <v-flex xs7 sm7 md6 class="ml-3"> 462 <v-flex xs7 sm7 md6 class="ml-3">
458 <v-select 463 <v-select
459 v-model="addSchedule.classId" 464 v-model="addSchedule.classId"
460 label="Select your class" 465 label="Select your class"
461 type="text" 466 type="text"
462 :items="classList" 467 :items="classList"
463 item-text="classNum" 468 item-text="classNum"
464 item-value="_id" 469 item-value="_id"
465 :rules="classRules" 470 :rules="classRules"
466 @change="getSections(addSchedule.classId)" 471 @change="getSections(addSchedule.classId)"
467 required 472 required
468 ></v-select> 473 ></v-select>
469 </v-flex> 474 </v-flex>
470 </v-layout> 475 </v-layout>
471 </v-flex> 476 </v-flex>
472 <v-flex xs12> 477 <v-flex xs12>
473 <v-layout> 478 <v-layout>
474 <v-flex xs5 class="pt-4 subheading"> 479 <v-flex xs5 class="pt-4 subheading">
475 <label class="right">Section:</label> 480 <label class="right">Section:</label>
476 </v-flex> 481 </v-flex>
477 <v-flex xs7 sm7 md6 class="ml-3"> 482 <v-flex xs7 sm7 md6 class="ml-3">
478 <v-select 483 <v-select
479 :items="addSection" 484 :items="addSection"
480 label="Select Section" 485 label="Select Section"
481 v-model="addSchedule.sectionId" 486 v-model="addSchedule.sectionId"
482 item-text="name" 487 item-text="name"
483 item-value="_id" 488 item-value="_id"
484 name="Select Section" 489 name="Select Section"
485 :rules="sectionRules" 490 :rules="sectionRules"
486 required 491 required
487 ></v-select> 492 ></v-select>
488 </v-flex> 493 </v-flex>
489 </v-layout> 494 </v-layout>
490 </v-flex> 495 </v-flex>
491 <v-flex xs12> 496 <v-flex xs12>
492 <v-layout> 497 <v-layout>
493 <v-flex xs5 class="pt-4 subheading"> 498 <v-flex xs5 class="pt-4 subheading">
494 <label class="right">Subject Name:</label> 499 <label class="right">Subject Name:</label>
495 </v-flex> 500 </v-flex>
496 <v-flex xs7 sm7 md6 class="ml-3"> 501 <v-flex xs7 sm7 md6 class="ml-3">
497 <v-select 502 <v-select
498 :items="subjects" 503 :items="subjects"
499 label="Select Subject" 504 label="Select Subject"
500 v-model="addSchedule.subjectName" 505 v-model="addSchedule.subjectName"
501 item-text="subjectName" 506 item-text="subjectName"
502 item-value="subjectName" 507 item-value="subjectName"
503 name="Select Section" 508 name="Select Section"
504 :rules="subjectRules" 509 :rules="subjectRules"
505 required 510 required
506 ></v-select> 511 ></v-select>
507 </v-flex> 512 </v-flex>
508 </v-layout> 513 </v-layout>
509 </v-flex> 514 </v-flex>
510 <v-flex xs12> 515 <v-flex xs12>
511 <v-layout> 516 <v-layout>
512 <v-flex xs5 class="pt-4 subheading"> 517 <v-flex xs5 class="pt-4 subheading">
513 <label class="right">Date:</label> 518 <label class="right">Date:</label>
514 </v-flex> 519 </v-flex>
515 <v-flex xs7 sm7 md6 class="ml-3"> 520 <v-flex xs7 sm7 md6 class="ml-3">
516 <v-menu 521 <v-menu
517 ref="menu2" 522 ref="menu2"
518 :close-on-content-click="false" 523 :close-on-content-click="false"
519 v-model="menu2" 524 v-model="menu2"
520 :nudge-right="40" 525 :nudge-right="40"
521 :return-value.sync="addSchedule.date" 526 :return-value.sync="addSchedule.date"
522 lazy 527 lazy
523 transition="scale-transition" 528 transition="scale-transition"
524 offset-y 529 offset-y
525 full-width 530 full-width
526 min-width="290px" 531 min-width="290px"
527 > 532 >
528 <v-text-field 533 <v-text-field
529 slot="activator" 534 slot="activator"
530 v-model="addSchedule.date" 535 v-model="addSchedule.date"
531 :rules="examScheduleDateRules" 536 :rules="examScheduleDateRules"
532 label="Select Date" 537 label="Select Date"
533 append-icon="event" 538 append-icon="event"
534 readonly 539 readonly
535 ></v-text-field> 540 ></v-text-field>
536 <v-date-picker 541 <v-date-picker
537 v-model="addSchedule.date" 542 v-model="addSchedule.date"
538 @input="$refs.menu2.save(addSchedule.date)" 543 @input="$refs.menu2.save(addSchedule.date)"
539 ></v-date-picker> 544 ></v-date-picker>
540 </v-menu> 545 </v-menu>
541 </v-flex> 546 </v-flex>
542 </v-layout> 547 </v-layout>
543 </v-flex> 548 </v-flex>
544 <v-flex xs12> 549 <v-flex xs12>
545 <v-layout> 550 <v-layout>
546 <v-flex xs5 class="pt-4 subheading"> 551 <v-flex xs5 class="pt-4 subheading">
547 <label class="right">Time From:</label> 552 <label class="right">Time From:</label>
548 </v-flex> 553 </v-flex>
549 <v-flex xs7 sm7 md6 class="ml-3"> 554 <v-flex xs7 sm7 md6 class="ml-3">
550 <v-menu 555 <v-menu
551 ref="menuA" 556 ref="menuA"
552 :close-on-content-click="false" 557 :close-on-content-click="false"
553 v-model="menuB" 558 v-model="menuB"
554 :nudge-right="40" 559 :nudge-right="40"
555 :return-value.sync="addSchedule.timeFrom" 560 :return-value.sync="addSchedule.timeFrom"
556 lazy 561 lazy
557 transition="scale-transition" 562 transition="scale-transition"
558 offset-y 563 offset-y
559 full-width 564 full-width
560 max-width="290px" 565 max-width="290px"
561 min-width="290px" 566 min-width="290px"
562 > 567 >
563 <v-text-field 568 <v-text-field
564 slot="activator" 569 slot="activator"
565 v-model="addSchedule.timeIn" 570 v-model="addSchedule.timeIn"
566 label="Select your time From" 571 label="Select your time From"
567 append-icon="access_time" 572 append-icon="access_time"
568 :rules="timeInRules" 573 :rules="timeInRules"
569 readonly 574 readonly
570 ></v-text-field> 575 ></v-text-field>
571 <v-time-picker 576 <v-time-picker
572 v-model="addSchedule.timeIn" 577 v-model="addSchedule.timeIn"
573 @change="$refs.menuA.save(addSchedule.timeIn)" 578 @change="$refs.menuA.save(addSchedule.timeIn)"
574 ></v-time-picker> 579 ></v-time-picker>
575 </v-menu> 580 </v-menu>
576 </v-flex> 581 </v-flex>
577 </v-layout> 582 </v-layout>
578 </v-flex> 583 </v-flex>
579 <v-flex xs12> 584 <v-flex xs12>
580 <v-layout> 585 <v-layout>
581 <v-flex xs5 class="pt-4 subheading"> 586 <v-flex xs5 class="pt-4 subheading">
582 <label class="right">Time To:</label> 587 <label class="right">Time To:</label>
583 </v-flex> 588 </v-flex>
584 <v-flex xs7 sm7 md6 class="ml-3"> 589 <v-flex xs7 sm7 md6 class="ml-3">
585 <v-menu 590 <v-menu
586 ref="menu" 591 ref="menu"
587 :close-on-content-click="false" 592 :close-on-content-click="false"
588 v-model="menu1" 593 v-model="menu1"
589 :nudge-right="40" 594 :nudge-right="40"
590 :return-value.sync="addSchedule.timeTo" 595 :return-value.sync="addSchedule.timeTo"
591 lazy 596 lazy
592 transition="scale-transition" 597 transition="scale-transition"
593 offset-y 598 offset-y
594 full-width 599 full-width
595 max-width="290px" 600 max-width="290px"
596 min-width="290px" 601 min-width="290px"
597 > 602 >
598 <v-text-field 603 <v-text-field
599 slot="activator" 604 slot="activator"
600 v-model="addSchedule.timeTo" 605 v-model="addSchedule.timeTo"
601 label="Select your Time To" 606 label="Select your Time To"
602 append-icon="access_time" 607 append-icon="access_time"
603 :rules="timeOutRules" 608 :rules="timeOutRules"
604 readonly 609 readonly
605 ></v-text-field> 610 ></v-text-field>
606 <v-time-picker 611 <v-time-picker
607 v-model="addSchedule.timeTo" 612 v-model="addSchedule.timeTo"
608 @change="$refs.menu.save(addSchedule.timeTo)" 613 @change="$refs.menu.save(addSchedule.timeTo)"
609 ></v-time-picker> 614 ></v-time-picker>
610 </v-menu> 615 </v-menu>
611 </v-flex> 616 </v-flex>
612 </v-layout> 617 </v-layout>
613 </v-flex> 618 </v-flex>
614 <v-flex xs12> 619 <v-flex xs12>
615 <v-layout> 620 <v-layout>
616 <v-flex xs5 class="pt-4 subheading"> 621 <v-flex xs5 class="pt-4 subheading">
617 <label class="right">Room:</label> 622 <label class="right">Room:</label>
618 </v-flex> 623 </v-flex>
619 <v-flex xs7 sm7 md6 class="ml-3"> 624 <v-flex xs7 sm7 md6 class="ml-3">
620 <v-text-field 625 <v-text-field
621 placeholder="fill your room" 626 placeholder="fill your room"
622 :rules="roomRules" 627 :rules="roomRules"
623 v-model="addSchedule.room" 628 v-model="addSchedule.room"
624 @keyup.enter="submit" 629 @keyup.enter="submit"
625 ></v-text-field> 630 ></v-text-field>
626 </v-flex> 631 </v-flex>
627 </v-layout> 632 </v-layout>
628 </v-flex> 633 </v-flex>
629 <v-layout> 634 <v-layout>
630 <v-flex xs12> 635 <v-flex xs12>
631 <v-card-actions> 636 <v-card-actions>
632 <v-spacer class="hidden-xs-only"></v-spacer> 637 <v-spacer class="hidden-xs-only"></v-spacer>
633 <v-btn @click="clear" round dark class="clear-button">clear</v-btn> 638 <v-btn @click="clear" round dark class="clear-button">clear</v-btn>
634 <v-btn @click="submit" round dark :loading="loading" class="add-button">Add</v-btn> 639 <v-btn @click="submit" round dark :loading="loading" class="add-button">Add</v-btn>
635 </v-card-actions> 640 </v-card-actions>
636 </v-flex> 641 </v-flex>
637 </v-layout> 642 </v-layout>
638 </v-container> 643 </v-container>
639 </v-form> 644 </v-form>
640 </v-card> 645 </v-card>
641 </v-dialog> 646 </v-dialog>
642 <v-snackbar 647 <v-snackbar
643 :timeout="timeout" 648 :timeout="timeout"
644 :top="y === 'top'" 649 :top="y === 'top'"
645 :right="x === 'right'" 650 :right="x === 'right'"
646 :vertical="mode === 'vertical'" 651 :vertical="mode === 'vertical'"
647 v-model="snackbar" 652 v-model="snackbar"
648 :color="color" 653 :color="color"
649 >{{ text }}</v-snackbar> 654 >{{ text }}</v-snackbar>
650 <div class="loader" v-if="showLoader"> 655 <div class="loader" v-if="showLoader">
651 <v-progress-circular indeterminate color="white"></v-progress-circular> 656 <v-progress-circular indeterminate color="white"></v-progress-circular>
652 </div> 657 </div>
653 </v-container> 658 </v-container>
654 </template> 659 </template>
655 660
656 <script> 661 <script>
657 import http from "@/Services/http.js"; 662 import http from "@/Services/http.js";
658 import moment from "moment"; 663 import moment from "moment";
659 664
660 export default { 665 export default {
661 data: () => ({ 666 data: () => ({
662 snackbar: false, 667 snackbar: false,
663 date: null, 668 date: null,
664 editDate: false, 669 editDate: false,
665 menu1: false, 670 menu1: false,
666 menuB: false, 671 menuB: false,
667 menu2: false, 672 menu2: false,
668 menuEdit: false, 673 menuEdit: false,
669 timeToEdit: false, 674 timeToEdit: false,
670 show: true, 675 show: true,
671 showSearch: false, 676 showSearch: false,
672 addExamScheduleDialog: false, 677 addExamScheduleDialog: false,
673 color: "", 678 color: "",
674 y: "top", 679 y: "top",
675 x: "right", 680 x: "right",
676 mode: "", 681 mode: "",
677 timeout: 10000, 682 timeout: 10000,
678 text: "", 683 text: "",
679 loading: false, 684 loading: false,
680 date: null, 685 date: null,
681 search: "", 686 search: "",
682 showLoader: false, 687 showLoader: false,
683 editExamScheduleDialog: false, 688 editExamScheduleDialog: false,
684 profileExamScheduleDialog: false, 689 profileExamScheduleDialog: false,
685 valid: true, 690 valid: true,
686 role: "", 691 role: "",
687 pagination: { 692 pagination: {
688 rowsPerPage: 10, 693 rowsPerPage: 10,
689 }, 694 },
690 examRules: [(v) => !!v || "Exam Name is required"], 695 examRules: [(v) => !!v || "Exam Name is required"],
691 classRules: [(v) => !!v || "Class Name is required"], 696 classRules: [(v) => !!v || "Class Name is required"],
692 sectionRules: [(v) => !!v || "section is required"], 697 sectionRules: [(v) => !!v || "section is required"],
693 subjectRules: [(v) => !!v || "Subject is required"], 698 subjectRules: [(v) => !!v || "Subject is required"],
694 timeInRules: [(v) => !!v || "Time In is required"], 699 timeInRules: [(v) => !!v || "Time In is required"],
695 timeOutRules: [(v) => !!v || "time Out s is required"], 700 timeOutRules: [(v) => !!v || "time Out s is required"],
696 roomRules: [(v) => !!v || "Room is required"], 701 roomRules: [(v) => !!v || "Room is required"],
697 examScheduleDateRules: [(v) => !!v || "Date is required"], 702 examScheduleDateRules: [(v) => !!v || "Date is required"],
698 headers: [ 703 headers: [
699 { 704 {
700 align: "", 705 align: "",
701 text: "No", 706 text: "No",
702 sortable: false, 707 sortable: false,
703 value: "No", 708 value: "No",
704 }, 709 },
705 { 710 {
706 text: "Exam Name", 711 text: "Exam Name",
707 vaue: "examId.examName", 712 vaue: "examId.examName",
708 sortable: false, 713 sortable: false,
709 align: "center", 714 align: "center",
710 }, 715 },
711 { 716 {
712 text: "Class", 717 text: "Class",
713 value: "classId.classNum", 718 value: "classId.classNum",
714 sortable: false, 719 sortable: false,
715 align: "center", 720 align: "center",
716 }, 721 },
717 // { 722 // {
718 // text: "Section", 723 // text: "Section",
719 // value: "sectionId.name", 724 // value: "sectionId.name",
720 // sortable: false, 725 // sortable: false,
721 // align: "center" 726 // align: "center"
722 // }, 727 // },
723 { 728 {
724 text: "Subject Name", 729 text: "Subject Name",
725 value: "subjectName", 730 value: "subjectName",
726 sortable: false, 731 sortable: false,
727 align: "center", 732 align: "center",
728 }, 733 },
729 { 734 {
730 text: "Date", 735 text: "Date",
731 value: "date", 736 value: "date",
732 sortable: false, 737 sortable: false,
733 align: "center", 738 align: "center",
734 }, 739 },
735 { 740 {
736 text: "Time", 741 text: "Time",
737 value: "timeFrom", 742 value: "timeFrom",
738 sortable: false, 743 sortable: false,
739 align: "center", 744 align: "center",
740 }, 745 },
741 { 746 {
742 text: "Room", 747 text: "Room",
743 value: "room", 748 value: "room",
744 sortable: false, 749 sortable: false,
745 align: "center", 750 align: "center",
746 }, 751 },
747 { text: "Action", value: "", sortable: false, align: "center" }, 752 { text: "Action", value: "", sortable: false, align: "center" },
748 ], 753 ],
749 classList: [], 754 classList: [],
750 addSection: [], 755 addSection: [],
751 examList: [], 756 examList: [],
752 subjects: [], 757 subjects: [],
753 addSchedule: {}, 758 addSchedule: {},
754 editedItem: { 759 editedItem: {
755 sectionId: { 760 sectionId: {
756 name: "", 761 name: "",
757 }, 762 },
758 }, 763 },
759 getScheduleData: {}, 764 getScheduleData: {},
760 ScheduleData: [], 765 ScheduleData: [],
761 token: "", 766 token: "",
762 }), 767 }),
763 watch: { 768 watch: {
764 addExamScheduleDialog: function (val) { 769 addExamScheduleDialog: function (val) {
765 if (!val) { 770 if (!val) {
766 this.addSchedule = []; 771 this.addSchedule = [];
767 } 772 }
768 }, 773 },
769 }, 774 },
770 methods: { 775 methods: {
771 dates: function (date) { 776 dates: function (date) {
772 return moment(date).format("MMMM DD, YYYY"); 777 return moment(date).format("MMMM DD, YYYY");
773 }, 778 },
774 pickFile() { 779 pickFile() {
775 this.$refs.image.click(); 780 this.$refs.image.click();
776 }, 781 },
777 getSchedulesList() { 782 getSchedulesList() {
778 if (this.addSchedule.classId) { 783 if (this.addSchedule.classId) {
779 this.getScheduleData.classId = this.addSchedule.classId; 784 this.getScheduleData.classId = this.addSchedule.classId;
780 } 785 }
781 this.showLoader = true; 786 this.showLoader = true;
782 http() 787 http()
783 .get("/getSchedulesList", { 788 .get("/getSchedulesList", {
784 params: { 789 params: {
785 classId: this.getScheduleData.classId, 790 classId: this.getScheduleData.classId,
786 sectionId: this.getScheduleData.sectionId, 791 sectionId: this.getScheduleData.sectionId,
787 }, 792 },
788 headers: { Authorization: "Bearer " + this.token }, 793 headers: { Authorization: "Bearer " + this.token },
789 }) 794 })
790 .then((response) => { 795 .then((response) => {
791 this.ScheduleData = response.data.data; 796 this.ScheduleData = response.data.data;
792 // console.log("this.ScheduleData", this.ScheduleData); 797 // console.log("this.ScheduleData", this.ScheduleData);
793 this.showLoader = false; 798 this.showLoader = false;
794 }) 799 })
795 .catch((error) => { 800 .catch((error) => {
796 // console.log("err====>", err); 801 // console.log("err====>", err);
797 this.showLoader = false; 802 this.showLoader = false;
798 this.loadingSearch = false; 803 this.loadingSearch = false;
799 this.snackbar = true; 804 this.snackbar = true;
800 this.color = "error"; 805 this.color = "error";
801 this.text = error.response.data.message; 806 this.text = error.response.data.message;
802 if (error.response.status === 401) { 807 if (error.response.status === 401) {
803 this.$router.replace({ path: "/" }); 808 this.$router.replace({ path: "/" });
804 this.$store.dispatch("setToken", null); 809 this.$store.dispatch("setToken", null);
805 this.$store.dispatch("Id", null); 810 this.$store.dispatch("Id", null);
806 } 811 }
807 }); 812 });
808 }, 813 },
809 editItem(item) { 814 editItem(item) {
810 // console.log("item", item); 815 // console.log("item", item);
811 this.editedIndex = this.ScheduleData.indexOf(item); 816 this.editedIndex = this.ScheduleData.indexOf(item);
812 this.editedItem = Object.assign({}, item); 817 this.editedItem = Object.assign({}, item);
813 this.editedItem.examId = this.editedItem.examId._id; 818 this.editedItem.examId = this.editedItem.examId._id;
814 this.editedItem.classId = this.editedItem.classId._id; 819 this.editedItem.classId = this.editedItem.classId._id;
815 this.editedItem.sectionId = 820 this.editedItem.sectionId =
816 this.editedItem.sectionId === null 821 this.editedItem.sectionId === null
817 ? (this.editedItem.sectionId = this.editedItem.sectionId = "") 822 ? (this.editedItem.sectionId = this.editedItem.sectionId = "")
818 : this.editedItem.sectionId._id; 823 : this.editedItem.sectionId._id;
819 this.editedItem.date = 824 this.editedItem.date =
820 this.editedItem.date != undefined 825 this.editedItem.date != undefined
821 ? (this.editedItem.date = this.editedItem.date.substring(0, 10)) 826 ? (this.editedItem.date = this.editedItem.date.substring(0, 10))
822 : (this.editedItem.date = ""); 827 : (this.editedItem.date = "");
823 this.editExamScheduleDialog = true; 828 this.editExamScheduleDialog = true;
824 }, 829 },
825 profile(item) { 830 profile(item) {
826 this.editedIndex = this.ScheduleData.indexOf(item); 831 this.editedIndex = this.ScheduleData.indexOf(item);
827 this.editedItem = Object.assign({}, item); 832 this.editedItem = Object.assign({}, item);
828 this.editedItem.examId = this.editedItem.examId.examName; 833 this.editedItem.examId = this.editedItem.examId.examName;
829 this.editedItem.classId = this.editedItem.classId.classNum; 834 this.editedItem.classId = this.editedItem.classId.classNum;
830 this.editedItem.sectionId = 835 this.editedItem.sectionId =
831 this.editedItem.sectionId === null 836 this.editedItem.sectionId === null
832 ? (this.editedItem.sectionId = this.editedItem.sectionId = "") 837 ? (this.editedItem.sectionId = this.editedItem.sectionId = "")
833 : this.editedItem.sectionId.name; 838 : this.editedItem.sectionId.name;
834 this.profileExamScheduleDialog = true; 839 this.profileExamScheduleDialog = true;
835 }, 840 },
836 deleteSchedule(item) { 841 deleteSchedule(item) {
837 let deleteSchedule = { 842 let deleteSchedule = {
838 scheduleId: item._id, 843 scheduleId: item._id,
839 }; 844 };
840 http() 845 http()
841 .delete( 846 .delete(
842 "/deleteSchedule", 847 "/deleteSchedule",
843 confirm("Are you sure you want to Delete this?") && { 848 confirm("Are you sure you want to Delete this?") && {
844 params: deleteSchedule, 849 params: deleteSchedule,
845 } 850 }
846 ) 851 )
847 .then((response) => { 852 .then((response) => {
848 this.snackbar = true; 853 this.snackbar = true;
849 this.text = response.data.message; 854 this.text = response.data.message;
850 this.color = "green"; 855 this.color = "green";
851 this.getSchedulesList(); 856 this.getSchedulesList();
852 }) 857 })
853 .catch((error) => { 858 .catch((error) => {
854 this.snackbar = true; 859 this.snackbar = true;
855 this.color = "error"; 860 this.color = "error";
856 this.text = error.response.data.message; 861 this.text = error.response.data.message;
857 }); 862 });
858 }, 863 },
859 close() { 864 close() {
860 this.dialog = false; 865 this.dialog = false;
861 }, 866 },
862 submit() { 867 submit() {
863 if (this.$refs.form.validate()) { 868 if (this.$refs.form.validate()) {
864 this.loading = true; 869 this.loading = true;
865 http() 870 http()
866 .post("/createSchedule", this.addSchedule) 871 .post("/createSchedule", this.addSchedule)
867 .then((response) => { 872 .then((response) => {
868 this.loading = false; 873 this.loading = false;
869 this.snackbar = true; 874 this.snackbar = true;
870 this.text = response.data.message; 875 this.text = response.data.message;
871 this.color = "green"; 876 this.color = "green";
872 http() 877 http()
873 .get("/getSchedulesList", { 878 .get("/getSchedulesList", {
874 params: { 879 params: {
875 classId: this.addSchedule.classId, 880 classId: this.addSchedule.classId,
876 sectionId: this.addSchedule.sectionId, 881 sectionId: this.addSchedule.sectionId,
877 }, 882 },
878 headers: { Authorization: "Bearer " + this.token }, 883 headers: { Authorization: "Bearer " + this.token },
879 }) 884 })
880 .then((response) => { 885 .then((response) => {
881 this.ScheduleData = response.data.data; 886 this.ScheduleData = response.data.data;
882 this.showLoader = false; 887 this.showLoader = false;
883 }) 888 })
884 .catch((error) => { 889 .catch((error) => {
885 this.showLoader = false; 890 this.showLoader = false;
886 this.loadingSearch = false; 891 this.loadingSearch = false;
887 this.snackbar = true; 892 this.snackbar = true;
888 this.color = "error"; 893 this.color = "error";
889 this.text = error.response.data.message; 894 this.text = error.response.data.message;
890 if (error.response.status === 401) { 895 if (error.response.status === 401) {
891 this.$router.replace({ path: "/" }); 896 this.$router.replace({ path: "/" });
892 this.$store.dispatch("setToken", null); 897 this.$store.dispatch("setToken", null);
893 this.$store.dispatch("Id", null); 898 this.$store.dispatch("Id", null);
894 } 899 }
895 }); 900 });
896 this.addExamScheduleDialog = false; 901 this.addExamScheduleDialog = false;
897 // this.clear(); 902 // this.clear();
898 }) 903 })
899 .catch((error) => { 904 .catch((error) => {
900 this.snackbar = true; 905 this.snackbar = true;
901 this.text = error.response.data.message; 906 this.text = error.response.data.message;
902 this.color = "red"; 907 this.color = "red";
903 this.loading = false; 908 this.loading = false;
904 }); 909 });
905 } 910 }
906 }, 911 },
907 clear() { 912 clear() {
908 this.$refs.form.reset(); 913 this.$refs.form.reset();
909 this.disable = false; 914 this.disable = false;
910 this.loading = false; 915 this.loading = false;
911 }, 916 },
912 update() { 917 update() {
913 this.editedItem.scheduleId = this.editedItem._id; 918 this.editedItem.scheduleId = this.editedItem._id;
914 http() 919 http()
915 .put("/updateSchedule", this.editedItem) 920 .put("/updateSchedule", this.editedItem)
916 .then((response) => { 921 .then((response) => {
917 this.snackbar = true; 922 this.snackbar = true;
918 this.text = "Successfully Edit Exam Schedule"; 923 this.text = "Successfully Edit Exam Schedule";
919 this.color = "green"; 924 this.color = "green";
920 this.editExamScheduleDialog = false; 925 this.editExamScheduleDialog = false;
921 this.getSchedulesList(); 926 this.getSchedulesList();
922 this.close(); 927 this.close();
923 }) 928 })
924 .catch((error) => { 929 .catch((error) => {
925 this.snackbar = true; 930 this.snackbar = true;
926 this.text = error.response.data.messages; 931 this.text = error.response.data.messages;
927 this.color = "error"; 932 this.color = "error";
928 this.loading = false; 933 this.loading = false;
929 }); 934 });
930 }, 935 },
931 getClass() { 936 getClass() {
932 http() 937 http()
933 .get("/getClassesList", { 938 .get("/getClassesList", {
934 headers: { Authorization: "Bearer " + this.token }, 939 headers: { Authorization: "Bearer " + this.token },
935 }) 940 })
936 .then((response) => { 941 .then((response) => {
937 this.classList = response.data.data; 942 this.classList = response.data.data;
938 }) 943 })
939 .catch((err) => { 944 .catch((err) => {
940 // console.log("err====>", err); 945 // console.log("err====>", err);
941 }); 946 });
942 }, 947 },
943 getSections(_id) { 948 getSections(_id) {
944 for (let i = 0; i < this.classList.length; i++) { 949 for (let i = 0; i < this.classList.length; i++) {
945 if (_id == this.classList[i]._id) { 950 if (_id == this.classList[i]._id) {
946 this.subjects = this.classList[i].subjects; 951 this.subjects = this.classList[i].subjects;
947 } 952 }
948 } 953 }
954 this.ScheduleData = [];
949 http() 955 http()
950 .get( 956 .get(
951 "/getSectionsList", 957 "/getSectionsList",
952 { params: { classId: _id } }, 958 { params: { classId: _id } },
953 { 959 {
954 headers: { Authorization: "Bearer " + this.token }, 960 headers: { Authorization: "Bearer " + this.token },
955 } 961 }
956 ) 962 )
957 .then((response) => { 963 .then((response) => {
958 this.addSection = response.data.data; 964 this.addSection = response.data.data;
959 }) 965 })
960 .catch((err) => {}); 966 .catch((err) => {});
961 }, 967 },
962 getExamList() { 968 getExamList() {
963 this.showLoader = true; 969 this.showLoader = true;
964 this.loadingSearch = true; 970 this.loadingSearch = true;
965 http() 971 http()
966 .get("/getExamsList", { 972 .get("/getExamsList", {
967 headers: { Authorization: "Bearer " + this.token }, 973 headers: { Authorization: "Bearer " + this.token },
968 }) 974 })
969 .then((response) => { 975 .then((response) => {
970 this.examList = response.data.data; 976 this.examList = response.data.data;
971 this.showLoader = false; 977 this.showLoader = false;
972 this.loadingSearch = false; 978 this.loadingSearch = false;
973 }) 979 })
974 .catch((error) => { 980 .catch((error) => {
975 this.showLoader = false; 981 this.showLoader = false;
976 this.loadingSearch = false; 982 this.loadingSearch = false;
977 this.snackbar = true; 983 this.snackbar = true;
978 this.text = error.response.data.message; 984 this.text = error.response.data.message;
979 if (error.response.status === 401) { 985 if (error.response.status === 401) {
980 this.$router.replace({ path: "/" }); 986 this.$router.replace({ path: "/" });
981 this.$store.dispatch("setToken", null); 987 this.$store.dispatch("setToken", null);
982 this.$store.dispatch("Id", null); 988 this.$store.dispatch("Id", null);
983 } 989 }
984 }); 990 });
985 }, 991 },
986 displaySearch() { 992 displaySearch() {
987 (this.show = false), (this.showSearch = true); 993 (this.show = false), (this.showSearch = true);
988 }, 994 },
989 closeSearch() { 995 closeSearch() {
990 this.showSearch = false; 996 this.showSearch = false;
991 this.show = true; 997 this.show = true;
992 this.search = ""; 998 this.search = "";
993 }, 999 },
994 }, 1000 },
995 mounted() { 1001 mounted() {
996 this.token = this.$store.state.token; 1002 this.token = this.$store.state.token;
997 this.getClass(); 1003 this.getClass();
998 this.getExamList(); 1004 this.getExamList();
999 this.role = this.$store.state.role; 1005 this.role = this.$store.state.role;
1000 }, 1006 },
1001 }; 1007 };
1002 </script> 1008 </script>
src/pages/Mark/mark.vue
1 <template> 1 <template>
2 <v-container fluid class="body-color"> 2 <v-container fluid class="body-color">
3 <!-- ****** EXISTING MARK TABLE ****** --> 3 <!-- ****** EXISTING MARK TABLE ****** -->
4 <v-toolbar color="transparent" flat> 4 <v-toolbar color="transparent" flat>
5 <v-btn 5 <v-btn
6 fab 6 fab
7 dark 7 dark
8 class="open-dialog-button hidden-xl-only hidden-md-only hidden-lg-only" 8 class="open-dialog-button hidden-xl-only hidden-md-only hidden-lg-only"
9 small 9 small
10 @click="addMarkDialog = true" 10 @click="addMarkDialog = true"
11 > 11 >
12 <v-icon dark>add</v-icon> 12 <v-icon dark>add</v-icon>
13 </v-btn> 13 </v-btn>
14 <v-btn 14 <v-btn
15 round 15 round
16 class="open-dialog-button hidden-sm-only hidden-xs-only" 16 class="open-dialog-button hidden-sm-only hidden-xs-only"
17 dark 17 dark
18 @click="addMarkDialog = true" 18 @click="addMarkDialog = true"
19 > 19 >
20 <v-icon class="white--text pr-1" size="20">add</v-icon>Add Mark 20 <v-icon class="white--text pr-1" size="20">add</v-icon>Add Mark
21 </v-btn> 21 </v-btn>
22 <v-layout class="hidden-sm-only hidden-xs-only"> 22 <v-layout class="hidden-sm-only hidden-xs-only">
23 <v-flex md3 lg2 class="ml-2"> 23 <v-flex md3 lg2 class="ml-2">
24 <v-select 24 <v-select
25 v-model="getMark.classId" 25 v-model="getMark.classId"
26 label="Select your class" 26 label="Select your class"
27 type="text" 27 type="text"
28 :items="classList" 28 :items="classList"
29 item-text="classNum" 29 item-text="classNum"
30 item-value="_id" 30 item-value="_id"
31 @change="getSections(getMark.classId)" 31 @change="getSections(getMark.classId)"
32 required 32 required
33 ></v-select> 33 ></v-select>
34 </v-flex> 34 </v-flex>
35 <v-flex md3 lg2 class="ml-2"> 35 <v-flex md3 lg2 class="ml-2">
36 <v-select 36 <v-select
37 :items="addSection" 37 :items="addSection"
38 label="Select your Section" 38 label="Select your Section"
39 v-model="getMark.sectionId" 39 v-model="getMark.sectionId"
40 item-text="name" 40 item-text="name"
41 item-value="_id" 41 item-value="_id"
42 name="Select Section" 42 name="Select Section"
43 required 43 required
44 ></v-select> 44 ></v-select>
45 </v-flex> 45 </v-flex>
46 <v-spacer></v-spacer> 46 <v-spacer></v-spacer>
47 <v-btn 47 <v-btn
48 @click="getStudents" 48 @click="getStudents"
49 round 49 round
50 dark 50 dark
51 :loading="loading" 51 :loading="loading"
52 class="right open-dialog-button mt-2" 52 class="right open-dialog-button mt-2"
53 >Mark</v-btn> 53 >Mark</v-btn>
54 </v-layout> 54 </v-layout>
55 <v-spacer class="hidden-lg-only hidden-xl-only hidden-md-only"></v-spacer> 55 <v-spacer class="hidden-lg-only hidden-xl-only hidden-md-only"></v-spacer>
56 <v-card-title class="body-1" v-show="show"> 56 <v-card-title class="body-1" v-show="show">
57 <v-btn icon large flat @click="displaySearch"> 57 <v-btn icon large flat @click="displaySearch">
58 <v-avatar size="27"> 58 <v-avatar size="27">
59 <img src="/static/icon/search.png" alt="icon" /> 59 <img src="/static/icon/search.png" alt="icon" />
60 </v-avatar> 60 </v-avatar>
61 </v-btn> 61 </v-btn>
62 </v-card-title> 62 </v-card-title>
63 <v-flex xs8 sm8 md3 lg2 v-if="showSearch"> 63 <v-flex xs8 sm8 md3 lg2 v-if="showSearch">
64 <v-layout> 64 <v-layout>
65 <v-text-field 65 <v-text-field
66 autofocus 66 autofocus
67 v-model="search" 67 v-model="search"
68 label="Search" 68 label="Search"
69 prepend-inner-icon="search" 69 prepend-inner-icon="search"
70 color="primary" 70 color="primary"
71 ></v-text-field> 71 ></v-text-field>
72 <v-icon @click="closeSearch" color="error">close</v-icon> 72 <v-icon @click="closeSearch" color="error">close</v-icon>
73 </v-layout> 73 </v-layout>
74 </v-flex> 74 </v-flex>
75 </v-toolbar> 75 </v-toolbar>
76 <v-card flat class="elevation-0 transparent hidden-lg-only hidden-xl-only hidden-md-only"> 76 <v-card flat class="elevation-0 transparent hidden-lg-only hidden-xl-only hidden-md-only">
77 <v-flex xs12 sm12 lg12> 77 <v-flex xs12 sm12 lg12>
78 <v-layout wrap> 78 <v-layout wrap>
79 <v-flex xs12 sm12 lg3> 79 <v-flex xs12 sm12 lg3>
80 <v-layout> 80 <v-layout>
81 <v-flex xs3 sm6 lg2 class="subheading mt-4"> 81 <v-flex xs3 sm6 lg2 class="subheading mt-4">
82 <label class="right">Class:</label> 82 <label class="right">Class:</label>
83 </v-flex> 83 </v-flex>
84 <v-flex xs12 sm12 lg8 class="ml-2"> 84 <v-flex xs12 sm12 lg8 class="ml-2">
85 <v-select 85 <v-select
86 v-model="getMark.classId" 86 v-model="getMark.classId"
87 label="Select your class" 87 label="Select your class"
88 type="text" 88 type="text"
89 :items="classList" 89 :items="classList"
90 item-text="classNum" 90 item-text="classNum"
91 item-value="_id" 91 item-value="_id"
92 @change="getSections(getMark.classId)" 92 @change="getSections(getMark.classId)"
93 required 93 required
94 ></v-select> 94 ></v-select>
95 </v-flex> 95 </v-flex>
96 </v-layout> 96 </v-layout>
97 </v-flex> 97 </v-flex>
98 <v-flex xs12 sm12 lg3> 98 <v-flex xs12 sm12 lg3>
99 <v-layout> 99 <v-layout>
100 <v-flex xs3 sm6 lg2 class="subheading mt-4"> 100 <v-flex xs3 sm6 lg2 class="subheading mt-4">
101 <label class="right">Section:</label> 101 <label class="right">Section:</label>
102 </v-flex> 102 </v-flex>
103 <v-flex xs12 sm12 lg8 class="ml-2"> 103 <v-flex xs12 sm12 lg8 class="ml-2">
104 <v-select 104 <v-select
105 :items="addSection" 105 :items="addSection"
106 label="Select your Section" 106 label="Select your Section"
107 v-model="getMark.sectionId" 107 v-model="getMark.sectionId"
108 item-text="name" 108 item-text="name"
109 item-value="_id" 109 item-value="_id"
110 name="Select Section" 110 name="Select Section"
111 required 111 required
112 ></v-select> 112 ></v-select>
113 </v-flex> 113 </v-flex>
114 </v-layout> 114 </v-layout>
115 </v-flex> 115 </v-flex>
116 <v-flex xs12 sm12 lg6> 116 <v-flex xs12 sm12 lg6>
117 <v-btn 117 <v-btn
118 @click="getStudents" 118 @click="getStudents"
119 round 119 round
120 dark 120 dark
121 :loading="loading" 121 :loading="loading"
122 class="right mt-3 open-dialog-button" 122 class="right mt-3 open-dialog-button"
123 >Mark</v-btn> 123 >Mark</v-btn>
124 </v-flex> 124 </v-flex>
125 </v-layout> 125 </v-layout>
126 </v-flex> 126 </v-flex>
127 </v-card> 127 </v-card>
128 <v-data-table 128 <v-data-table
129 :headers="headers" 129 :headers="headers"
130 :items="getStudentsList" 130 :items="getStudentsList"
131 :pagination.sync="pagination" 131 :pagination.sync="pagination"
132 :search="search" 132 :search="search"
133 > 133 >
134 <template slot="items" slot-scope="props"> 134 <template slot="items" slot-scope="props">
135 <tr class="tr"> 135 <tr class="tr">
136 <td class="td td-row">{{ props.index + 1}}</td> 136 <td class="td td-row">{{ props.index + 1}}</td>
137 <td class="td td-row text-xs-center"> 137 <td class="td td-row text-xs-center">
138 <v-avatar size="40"> 138 <v-avatar size="40">
139 <img :src="props.item.profilePicUrl" v-if="props.item.profilePicUrl" /> 139 <img :src="props.item.profilePicUrl" v-if="props.item.profilePicUrl" />
140 <img src="/static/icon/user.png" v-else-if="!props.item.profilePicUrl" /> 140 <img src="/static/icon/user.png" v-else-if="!props.item.profilePicUrl" />
141 </v-avatar> 141 </v-avatar>
142 </td> 142 </td>
143 <td class="td td-row text-xs-center">{{ props.item.name}}</td> 143 <td class="td td-row text-xs-center">{{ props.item.name}}</td>
144 <td class="td td-row text-xs-center">{{ props.item.rollNo }}</td> 144 <td class="td td-row text-xs-center">{{ props.item.rollNo }}</td>
145 <td class="td td-row text-xs-center">{{ props.item.email }}</td> 145 <td class="td td-row text-xs-center">{{ props.item.email }}</td>
146 <td class="td td-row text-xs-center"> 146 <td class="td td-row text-xs-center">
147 <span> 147 <span>
148 <router-link :to="{ name:'view Mark',params: { markId:props.item._id } }"> 148 <router-link :to="{ name:'view Mark',params: { markId:props.item._id } }">
149 <v-tooltip top> 149 <v-tooltip top>
150 <img 150 <img
151 slot="activator" 151 slot="activator"
152 style="cursor:pointer; width:25px; height:25px; " 152 style="cursor:pointer; width:25px; height:25px; "
153 src="/static/icon/view.png" 153 src="/static/icon/view.png"
154 /> 154 />
155 <span>View</span> 155 <span>View</span>
156 </v-tooltip> 156 </v-tooltip>
157 </router-link> 157 </router-link>
158 </span> 158 </span>
159 </td> 159 </td>
160 </tr> 160 </tr>
161 </template> 161 </template>
162 <v-alert 162 <v-alert
163 slot="no-results" 163 slot="no-results"
164 :value="true" 164 :value="true"
165 color="error" 165 color="error"
166 icon="warning" 166 icon="warning"
167 >Your search for "{{ search }}" found no results.</v-alert> 167 >Your search for "{{ search }}" found no results.</v-alert>
168 </v-data-table> 168 </v-data-table>
169 <!-- ****** ADD Mark Schedule ****** --> 169 <!-- ****** ADD Mark Schedule ****** -->
170 <v-dialog v-model="addMarkDialog" max-width v-if="addMarkDialog" persistent> 170 <v-dialog v-model="addMarkDialog" max-width v-if="addMarkDialog" persistent>
171 <v-card flat class> 171 <v-card flat class>
172 <v-layout class="pa-3 card-style white--text"> 172 <v-layout class="pa-3 card-style white--text">
173 <v-flex xs12> 173 <v-flex xs12>
174 <label class="title text-xs-center">Add Mark</label> 174 <label class="title text-xs-center">Add Mark</label>
175 <v-icon 175 <v-icon
176 size="24" 176 size="24"
177 class="right white--text" 177 class="right white--text"
178 @click="$refs.form.reset();addMarkDialog = false" 178 @click="$refs.form.reset();addMarkDialog = false"
179 >cancel</v-icon> 179 >cancel</v-icon>
180 </v-flex> 180 </v-flex>
181 </v-layout> 181 </v-layout>
182 <v-form ref="form" v-model="valid" lazy-validation> 182 <v-form ref="form" v-model="valid" lazy-validation>
183 <v-container fluid> 183 <v-container fluid>
184 <v-flex xs12 sm12 lg12> 184 <v-flex xs12 sm12 lg12>
185 <v-layout wrap> 185 <v-layout wrap>
186 <v-flex xs12 sm12 lg10> 186 <v-flex xs12 sm12 lg10>
187 <v-layout wrap> 187 <v-layout wrap>
188 <v-flex xs12 sm12 lg3> 188 <v-flex xs12 sm12 lg3>
189 <v-flex xs3 sm2 lg2 class="subheading"> 189 <v-flex xs3 sm2 lg2 class="subheading">
190 <label>Exam:</label> 190 <label>Exam:</label>
191 </v-flex> 191 </v-flex>
192 <v-flex xs12 sm12 lg10> 192 <v-flex xs12 sm12 lg10>
193 <v-select 193 <v-select
194 label="Select your Exam Name" 194 label="Select your Exam Name"
195 :items="examList" 195 :items="examList"
196 v-model="addMark.examId" 196 v-model="addMark.examId"
197 :rules="examRules" 197 :rules="examRules"
198 item-text="examName" 198 item-text="examName"
199 item-value="_id" 199 item-value="_id"
200 ></v-select> 200 ></v-select>
201 </v-flex> 201 </v-flex>
202 </v-flex> 202 </v-flex>
203 <v-flex xs12 sm12 lg3> 203 <v-flex xs12 sm12 lg3>
204 <v-flex xs3 sm6 lg2 class="subheading"> 204 <v-flex xs3 sm6 lg2 class="subheading">
205 <label>Class:</label> 205 <label>Class:</label>
206 </v-flex> 206 </v-flex>
207 <v-flex xs12 sm12 lg10 class> 207 <v-flex xs12 sm12 lg10 class>
208 <v-select 208 <v-select
209 v-model="addMark.classId" 209 v-model="addMark.classId"
210 label="Select your class" 210 label="Select your class"
211 type="text" 211 type="text"
212 :items="classList" 212 :items="classList"
213 item-text="classNum" 213 item-text="classNum"
214 item-value="_id" 214 item-value="_id"
215 :rules="classRules" 215 :rules="classRules"
216 @change="getSections(addMark.classId)" 216 @change="getSections(addMark.classId)"
217 required 217 required
218 ></v-select> 218 ></v-select>
219 </v-flex> 219 </v-flex>
220 </v-flex> 220 </v-flex>
221 <v-flex xs12 sm12 lg3> 221 <v-flex xs12 sm12 lg3>
222 <v-flex xs3 sm6 lg2 class="subheading"> 222 <v-flex xs3 sm6 lg2 class="subheading">
223 <label>Section:</label> 223 <label>Section:</label>
224 </v-flex> 224 </v-flex>
225 <v-flex xs12 sm12 lg10 class> 225 <v-flex xs12 sm12 lg10 class>
226 <v-select 226 <v-select
227 :items="addSection" 227 :items="addSection"
228 label="Select your Section" 228 label="Select your Section"
229 v-model="addMark.sectionId" 229 v-model="addMark.sectionId"
230 item-text="name" 230 item-text="name"
231 item-value="_id" 231 item-value="_id"
232 name="Select Section" 232 name="Select Section"
233 :rules="sectionRules" 233 :rules="sectionRules"
234 required 234 required
235 ></v-select> 235 ></v-select>
236 </v-flex> 236 </v-flex>
237 </v-flex> 237 </v-flex>
238 <v-flex xs12 sm12 lg3> 238 <v-flex xs12 sm12 lg3>
239 <v-flex xs3 sm6 lg2 class="subheading"> 239 <v-flex xs3 sm6 lg2 class="subheading">
240 <label>Subject:</label> 240 <label>Subject:</label>
241 </v-flex> 241 </v-flex>
242 <v-flex xs12 sm12 lg10 class> 242 <v-flex xs12 sm12 lg10 class>
243 <v-select 243 <v-select
244 :items="subjects" 244 :items="subjects"
245 label="Select your Subject" 245 label="Select your Subject"
246 v-model="addMark.subjectId" 246 v-model="addMark.subjectId"
247 item-text="subjectName" 247 item-text="subjectName"
248 item-value="_id" 248 item-value="_id"
249 name="Select Section" 249 name="Select Section"
250 :rules="subjectRules" 250 :rules="subjectRules"
251 required 251 required
252 ></v-select> 252 ></v-select>
253 </v-flex> 253 </v-flex>
254 </v-flex> 254 </v-flex>
255 </v-layout> 255 </v-layout>
256 </v-flex> 256 </v-flex>
257 <v-flex xs12 sm12 lg2> 257 <v-flex xs12 sm12 lg2>
258 <v-flex xs12 sm12 lg12> 258 <v-flex xs12 sm12 lg12>
259 <v-btn 259 <v-btn
260 @click="findStudents" 260 @click="findStudents"
261 round 261 round
262 dark 262 dark
263 :loading="loading" 263 :loading="loading"
264 class="right mt-4 open-dialog-button" 264 class="right mt-4 open-dialog-button"
265 >Mark</v-btn> 265 >Mark</v-btn>
266 </v-flex> 266 </v-flex>
267 </v-flex> 267 </v-flex>
268 </v-layout> 268 </v-layout>
269 </v-flex> 269 </v-flex>
270 <!-- ****** ADD MARK TABLE DATA ****** --> 270 <!-- ****** ADD MARK TABLE DATA ****** -->
271 <v-card class="mt-4 elevation-0 body-color"> 271 <v-card class="mt-4 elevation-0 body-color">
272 <v-data-table 272 <v-data-table
273 :headers="headerOfMark" 273 :headers="headerOfMark"
274 :items="getStudentData" 274 :items="getStudentData"
275 :pagination.sync="pagination" 275 :pagination.sync="pagination"
276 :search="search" 276 :search="search"
277 class="body-color" 277 class="body-color"
278 > 278 >
279 <template slot="items" slot-scope="props"> 279 <template slot="items" slot-scope="props">
280 <tr class="tr"> 280 <tr class="tr">
281 <td class="td td-row">{{ props.index + 1}}</td> 281 <td class="td td-row">{{ props.index + 1}}</td>
282 <td class="text-xs-center td td-row"> 282 <td class="text-xs-center td td-row">
283 <v-avatar size="40"> 283 <v-avatar size="40">
284 <img :src="props.item.profilePicUrl" v-if="props.item.profilePicUrl" /> 284 <img :src="props.item.profilePicUrl" v-if="props.item.profilePicUrl" />
285 <img src="/static/icon/user.png" v-else-if="!props.item.profilePicUrl" /> 285 <img src="/static/icon/user.png" v-else-if="!props.item.profilePicUrl" />
286 </v-avatar> 286 </v-avatar>
287 </td> 287 </td>
288 <td class="text-xs-center td td-row">{{ props.item.name}}</td> 288 <td class="text-xs-center td td-row">{{ props.item.name}}</td>
289 <td class="text-xs-center td td-row">{{ props.item.rollNo }}</td> 289 <td class="text-xs-center td td-row">{{ props.item.rollNo }}</td>
290 <td 290 <td
291 class="text-xs-center markTable td td-row" 291 class="text-xs-center markTable td td-row"
292 v-for="(marks, index) in props.item.marksObtained" 292 v-for="(marks, index) in props.item.marksObtained"
293 :key="'A'+ index" 293 :key="'A'+ index"
294 > 294 >
295 <v-text-field v-model="marks.marksScored"></v-text-field> 295 <v-text-field v-model="marks.marksScored"></v-text-field>
296 </td> 296 </td>
297 </tr> 297 </tr>
298 </template> 298 </template>
299 <v-alert 299 <v-alert
300 slot="no-results" 300 slot="no-results"
301 :value="true" 301 :value="true"
302 color="error" 302 color="error"
303 icon="warning" 303 icon="warning"
304 >Your search for "{{ search }}" found no results.</v-alert> 304 >Your search for "{{ search }}" found no results.</v-alert>
305 </v-data-table> 305 </v-data-table>
306 </v-card> 306 </v-card>
307 <v-layout class="mt-2"> 307 <v-layout class="mt-2">
308 <v-flex xs12 sm12> 308 <v-flex xs12 sm12>
309 <v-layout> 309 <v-layout>
310 <v-flex xs12> 310 <v-flex xs12>
311 <v-btn 311 <v-btn
312 @click="submit" 312 @click="submit"
313 round 313 round
314 dark 314 dark
315 :loading="loading" 315 :loading="loading"
316 class="right add-button" 316 class="right add-button"
317 >Add Mark</v-btn> 317 >Add Mark</v-btn>
318 </v-flex> 318 </v-flex>
319 </v-layout> 319 </v-layout>
320 </v-flex> 320 </v-flex>
321 </v-layout> 321 </v-layout>
322 </v-container> 322 </v-container>
323 </v-form> 323 </v-form>
324 </v-card> 324 </v-card>
325 </v-dialog> 325 </v-dialog>
326 <div class="loader" v-if="showLoader"> 326 <div class="loader" v-if="showLoader">
327 <v-progress-circular indeterminate color="white"></v-progress-circular> 327 <v-progress-circular indeterminate color="white"></v-progress-circular>
328 </div> 328 </div>
329 <v-snackbar 329 <v-snackbar
330 :timeout="timeout" 330 :timeout="timeout"
331 :top="y === 'top'" 331 :top="y === 'top'"
332 :right="x === 'right'" 332 :right="x === 'right'"
333 :vertical="mode === 'vertical'" 333 :vertical="mode === 'vertical'"
334 v-model="snackbar" 334 v-model="snackbar"
335 :color="color" 335 :color="color"
336 >{{ text }}</v-snackbar> 336 >{{ text }}</v-snackbar>
337 </v-container> 337 </v-container>
338 </template> 338 </template>
339 339
340 <script> 340 <script>
341 import http from "@/Services/http.js"; 341 import http from "@/Services/http.js";
342 import moment from "moment"; 342 import moment from "moment";
343 343
344 export default { 344 export default {
345 data: () => ({ 345 data: () => ({
346 show: true, 346 show: true,
347 showSearch: false, 347 showSearch: false,
348 snackbar: false, 348 snackbar: false,
349 date: null, 349 date: null,
350 color: "", 350 color: "",
351 y: "top", 351 y: "top",
352 x: "right", 352 x: "right",
353 mode: "", 353 mode: "",
354 timeout: 10000, 354 timeout: 10000,
355 text: "", 355 text: "",
356 loading: false, 356 loading: false,
357 search: "", 357 search: "",
358 show: true, 358 show: true,
359 showSearch: false, 359 showSearch: false,
360 showLoader: false, 360 showLoader: false,
361 dialog: false, 361 dialog: false,
362 dialog1: false, 362 dialog1: false,
363 valid: true, 363 valid: true,
364 364
365 addMarkDialog: false, 365 addMarkDialog: false,
366 addSection: [], 366 addSection: [],
367 pagination: { 367 pagination: {
368 rowsPerPage: 10, 368 rowsPerPage: 10,
369 }, 369 },
370 classRules: [(v) => !!v || "Class is required"], 370 classRules: [(v) => !!v || "Class is required"],
371 sectionRules: [(v) => !!v || "section is required"], 371 sectionRules: [(v) => !!v || "section is required"],
372 subjectRules: [(v) => !!v || "Subject is required"], 372 subjectRules: [(v) => !!v || "Subject is required"],
373 examRules: [(v) => !!v || "Exam is required"], 373 examRules: [(v) => !!v || "Exam is required"],
374 374
375 headerOfMark: [ 375 headerOfMark: [
376 { 376 {
377 align: "", 377 align: "",
378 text: "No", 378 text: "No",
379 sortable: false, 379 sortable: false,
380 value: "No", 380 value: "No",
381 }, 381 },
382 { 382 {
383 text: "Profile Pic", 383 text: "Profile Pic",
384 vaue: "profilePicUrl", 384 vaue: "profilePicUrl",
385 sortable: false, 385 sortable: false,
386 align: "center", 386 align: "center",
387 }, 387 },
388 { 388 {
389 text: "Name", 389 text: "Name",
390 vaue: "name", 390 vaue: "name",
391 sortable: false, 391 sortable: false,
392 align: "center", 392 align: "center",
393 }, 393 },
394 { 394 {
395 text: "Roll No.", 395 text: "Roll No.",
396 value: "rollNo", 396 value: "rollNo",
397 sortable: false, 397 sortable: false,
398 align: "center", 398 align: "center",
399 }, 399 },
400 ], 400 ],
401 headers: [ 401 headers: [
402 { 402 {
403 align: "", 403 align: "",
404 text: "No", 404 text: "No",
405 sortable: false, 405 sortable: false,
406 value: "No", 406 value: "No",
407 }, 407 },
408 { 408 {
409 text: "Profile Pic", 409 text: "Profile Pic",
410 vaue: "profilePicUrl", 410 vaue: "profilePicUrl",
411 sortable: false, 411 sortable: false,
412 align: "center", 412 align: "center",
413 }, 413 },
414 { 414 {
415 text: "Name", 415 text: "Name",
416 vaue: "name", 416 vaue: "name",
417 sortable: false, 417 sortable: false,
418 align: "center", 418 align: "center",
419 }, 419 },
420 { 420 {
421 text: "Roll No.", 421 text: "Roll No.",
422 value: "rollNo", 422 value: "rollNo",
423 sortable: false, 423 sortable: false,
424 align: "center", 424 align: "center",
425 }, 425 },
426 { 426 {
427 text: "Email", 427 text: "Email",
428 value: "email", 428 value: "email",
429 sortable: false, 429 sortable: false,
430 align: "center", 430 align: "center",
431 }, 431 },
432 { text: "Action", value: "", sortable: false, align: "center" }, 432 { text: "Action", value: "", sortable: false, align: "center" },
433 ], 433 ],
434 classList: [], 434 classList: [],
435 examList: [], 435 examList: [],
436 subjects: [], 436 subjects: [],
437 addMark: {}, 437 addMark: {},
438 getMark: {}, 438 getMark: {},
439 getScheduleData: {}, 439 getScheduleData: {},
440 markData: [], 440 markData: [],
441 getStudentData: [], 441 getStudentData: [],
442 getStudentsList: [], 442 getStudentsList: [],
443 token: "", 443 token: "",
444 }), 444 }),
445 watch: { 445 watch: {
446 addMarkDialog: function (val) { 446 addMarkDialog: function (val) {
447 if (!val) { 447 if (!val) {
448 this.addMark = []; 448 this.addMark = [];
449 this.getStudentData = []; 449 this.getStudentData = [];
450 } 450 }
451 }, 451 },
452 }, 452 },
453 methods: { 453 methods: {
454 getClass() { 454 getClass() {
455 this.showLoader = true; 455 this.showLoader = true;
456 http() 456 http()
457 .get("/getClassesList", { 457 .get("/getClassesList", {
458 headers: { Authorization: "Bearer " + this.token }, 458 headers: { Authorization: "Bearer " + this.token },
459 }) 459 })
460 .then((response) => { 460 .then((response) => {
461 this.classList = response.data.data; 461 this.classList = response.data.data;
462 this.showLoader = false; 462 this.showLoader = false;
463 }) 463 })
464 .catch((err) => { 464 .catch((err) => {
465 // console.log("err====>", err); 465 // console.log("err====>", err);
466 this.showLoader = false; 466 this.showLoader = false;
467 }); 467 });
468 }, 468 },
469 getSections(_id) { 469 getSections(_id) {
470 this.showLoader = true; 470 this.showLoader = true;
471 for (let i = 0; i < this.classList.length; i++) { 471 for (let i = 0; i < this.classList.length; i++) {
472 if (_id == this.classList[i]._id) { 472 if (_id == this.classList[i]._id) {
473 this.subjects = this.classList[i].subjects; 473 this.subjects = this.classList[i].subjects;
474 } 474 }
475 } 475 }
476 this.getStudentsList = [];
476 http() 477 http()
477 .get( 478 .get(
478 "/getSectionsList", 479 "/getSectionsList",
479 { params: { classId: _id } }, 480 { params: { classId: _id } },
480 { 481 {
481 headers: { Authorization: "Bearer " + this.token }, 482 headers: { Authorization: "Bearer " + this.token },
482 } 483 }
483 ) 484 )
484 .then((response) => { 485 .then((response) => {
485 this.addSection = response.data.data; 486 this.addSection = response.data.data;
486 this.showLoader = false; 487 this.showLoader = false;
487 }) 488 })
488 .catch((err) => { 489 .catch((err) => {
489 this.showLoader = false; 490 this.showLoader = false;
490 // console.log("err====>", err); 491 // console.log("err====>", err);
491 }); 492 });
492 }, 493 },
493 getExamList() { 494 getExamList() {
494 this.showLoader = true; 495 this.showLoader = true;
495 this.loadingSearch = true; 496 this.loadingSearch = true;
496 http() 497 http()
497 .get("/getExamsList", { 498 .get("/getExamsList", {
498 headers: { Authorization: "Bearer " + this.token }, 499 headers: { Authorization: "Bearer " + this.token },
499 }) 500 })
500 .then((response) => { 501 .then((response) => {
501 this.examList = response.data.data; 502 this.examList = response.data.data;
502 this.showLoader = false; 503 this.showLoader = false;
503 this.loadingSearch = false; 504 this.loadingSearch = false;
504 }) 505 })
505 .catch((error) => { 506 .catch((error) => {
506 // console.log("err====>", err); 507 // console.log("err====>", err);
507 this.showLoader = false; 508 this.showLoader = false;
508 this.loadingSearch = false; 509 this.loadingSearch = false;
509 this.snackbar = true; 510 this.snackbar = true;
510 this.text = error.response.data.message; 511 this.text = error.response.data.message;
511 if (error.response.status === 401) { 512 if (error.response.status === 401) {
512 this.$router.replace({ path: "/" }); 513 this.$router.replace({ path: "/" });
513 this.$store.dispatch("setToken", null); 514 this.$store.dispatch("setToken", null);
514 this.$store.dispatch("Id", null); 515 this.$store.dispatch("Id", null);
515 this.$store.dispatch("Role", null); 516 this.$store.dispatch("Role", null);
516 } 517 }
517 }); 518 });
518 }, 519 },
519 findStudents() { 520 findStudents() {
520 this.getStudentData = []; 521 this.getStudentData = [];
521 if (this.$refs.form.validate()) { 522 if (this.$refs.form.validate()) {
522 this.showLoader = true; 523 this.showLoader = true;
523 http() 524 http()
524 .get("/getStudentWithClass", { 525 .get("/getStudentWithClass", {
525 params: { 526 params: {
526 classId: this.addMark.classId, 527 classId: this.addMark.classId,
527 sectionId: this.addMark.sectionId, 528 sectionId: this.addMark.sectionId,
528 }, 529 },
529 }) 530 })
530 .then((response) => { 531 .then((response) => {
531 this.getStudentData = response.data.data; 532 this.getStudentData = response.data.data;
532 // this.showLoader = false; 533 // this.showLoader = false;
533 this.showLoader = true; 534 this.showLoader = true;
534 http() 535 http()
535 .get("/getMarkDistributionsList", { 536 .get("/getMarkDistributionsList", {
536 params: this.addMark, 537 params: this.addMark,
537 }) 538 })
538 .then((response) => { 539 .then((response) => {
539 this.showLoader = false; 540 this.showLoader = false;
540 this.headerOfMark.length = 4; 541 this.headerOfMark.length = 4;
541 for (var i = 0; i < response.data.data.length; i++) { 542 for (var i = 0; i < response.data.data.length; i++) {
542 this.headerOfMark.push({ 543 this.headerOfMark.push({
543 text: 544 text:
544 response.data.data[i].distributionType + 545 response.data.data[i].distributionType +
545 " (" + 546 " (" +
546 response.data.data[i].markValue + 547 response.data.data[i].markValue +
547 ")", 548 ")",
548 sortable: false, 549 sortable: false,
549 align: "center", 550 align: "center",
550 }); 551 });
551 } 552 }
552 for (var n = 0; n < this.getStudentData.length; n++) { 553 for (var n = 0; n < this.getStudentData.length; n++) {
553 this.getStudentData[n].marksObtained = []; 554 this.getStudentData[n].marksObtained = [];
554 for (var j = 0; j < response.data.data.length; j++) { 555 for (var j = 0; j < response.data.data.length; j++) {
555 this.getStudentData[n].marksObtained.push({ 556 this.getStudentData[n].marksObtained.push({
556 markDistributionId: response.data.data[j]._id, 557 markDistributionId: response.data.data[j]._id,
557 marksScored: 0, 558 marksScored: 0,
558 markValue: response.data.data[j].markValue, 559 markValue: response.data.data[j].markValue,
559 distributionType: response.data.data[j].distributionType, 560 distributionType: response.data.data[j].distributionType,
560 }); 561 });
561 } 562 }
562 // if (marks.marksScored > marks.marksObtained) { 563 // if (marks.marksScored > marks.marksObtained) {
563 // this.getStudentData[n].marksScored = this.getStudentData[n].marksObtained; 564 // this.getStudentData[n].marksScored = this.getStudentData[n].marksObtained;
564 // this.marks.marksScored = marks.marksObtained; 565 // this.marks.marksScored = marks.marksObtained;
565 // } 566 // }
566 } 567 }
567 }) 568 })
568 .catch((error) => { 569 .catch((error) => {
569 this.showLoader = false; 570 this.showLoader = false;
570 }); 571 });
571 }) 572 })
572 .catch((error) => { 573 .catch((error) => {
573 this.showLoader = false; 574 this.showLoader = false;
574 }); 575 });
575 } 576 }
576 }, 577 },
577 async submit() { 578 async submit() {
578 for (let [j, item] of this.getStudentData.entries()) { 579 for (let [j, item] of this.getStudentData.entries()) {
579 for (var k = 0; k < item.marksObtained.length; k++) { 580 for (var k = 0; k < item.marksObtained.length; k++) {
580 if ( 581 if (
581 item.marksObtained[k].marksScored > item.marksObtained[k].markValue 582 item.marksObtained[k].marksScored > item.marksObtained[k].markValue
582 ) { 583 ) {
583 this.snackbar = true; 584 this.snackbar = true;
584 this.text = `Student (${item.name}) marks (${item.marksObtained[k].marksScored}) in 585 this.text = `Student (${item.name}) marks (${item.marksObtained[k].marksScored}) in
585 "${item.marksObtained[k].distributionType}" should not be greater than Total Marks (${item.marksObtained[k].markValue})`; 586 "${item.marksObtained[k].distributionType}" should not be greater than Total Marks (${item.marksObtained[k].markValue})`;
586 this.color = "error"; 587 this.color = "error";
587 return; 588 return;
588 } 589 }
589 } 590 }
590 let data = { 591 let data = {
591 examId: this.addMark.examId, 592 examId: this.addMark.examId,
592 classId: this.addMark.classId, 593 classId: this.addMark.classId,
593 sectionId: this.addMark.sectionId, 594 sectionId: this.addMark.sectionId,
594 subjectId: this.addMark.subjectId, 595 subjectId: this.addMark.subjectId,
595 studentId: item._id, 596 studentId: item._id,
596 studentsMarks: item.marksObtained, 597 studentsMarks: item.marksObtained,
597 }; 598 };
598 try { 599 try {
599 let response = await http().post("/createMark", data); 600 let response = await http().post("/createMark", data);
600 if (j + 1 === this.getStudentData.length) { 601 if (j + 1 === this.getStudentData.length) {
601 this.getStudentData = []; 602 this.getStudentData = [];
602 this.snackbar = true; 603 this.snackbar = true;
603 this.addMarkDialog = false; 604 this.addMarkDialog = false;
604 this.text = response.data.message; 605 this.text = response.data.message;
605 this.color = "green"; 606 this.color = "green";
606 this.$refs.form.reset(); 607 this.$refs.form.reset();
607 } 608 }
608 } catch (error) { 609 } catch (error) {
609 this.snackbar = true; 610 this.snackbar = true;
610 this.text = error.response.data.message; 611 this.text = error.response.data.message;
611 this.color = "red"; 612 this.color = "red";
612 } 613 }
613 } 614 }
614 }, 615 },
615 getStudents() { 616 getStudents() {
616 this.showLoader = true; 617 this.showLoader = true;
617 http() 618 http()
618 .get("/getStudentWithClass", { 619 .get("/getStudentWithClass", {
619 params: { 620 params: {
620 classId: this.getMark.classId, 621 classId: this.getMark.classId,
621 sectionId: this.getMark.sectionId, 622 sectionId: this.getMark.sectionId,
622 }, 623 },
623 }) 624 })
624 .then((response) => { 625 .then((response) => {
625 this.getStudentsList = response.data.data; 626 this.getStudentsList = response.data.data;
626 this.showLoader = false; 627 this.showLoader = false;
627 }) 628 })
628 .catch((error) => { 629 .catch((error) => {
629 // console.log("err====>", error); 630 // console.log("err====>", error);
630 this.showLoader = false; 631 this.showLoader = false;
631 this.snackbar = true; 632 this.snackbar = true;
632 this.color = "error"; 633 this.color = "error";
633 this.text = error.response.data.message; 634 this.text = error.response.data.message;
634 }); 635 });
635 }, 636 },
636 displaySearch() { 637 displaySearch() {
637 (this.show = false), (this.showSearch = true); 638 (this.show = false), (this.showSearch = true);
638 }, 639 },
639 closeSearch() { 640 closeSearch() {
640 this.showSearch = false; 641 this.showSearch = false;
641 this.show = true; 642 this.show = true;
642 this.search = ""; 643 this.search = "";
643 }, 644 },
644 }, 645 },
645 mounted() { 646 mounted() {
646 this.token = this.$store.state.token; 647 this.token = this.$store.state.token;
647 this.getClass(); 648 this.getClass();
648 this.getExamList(); 649 this.getExamList();
649 }, 650 },
650 }; 651 };
651 </script> 652 </script>
652 <style scoped> 653 <style scoped>
653 .markTable { 654 .markTable {
654 max-width: 80px !important; 655 max-width: 80px !important;
655 } 656 }
656 </style> 657 </style>
657 658
658 659
659 660
660 661
661 662
662 663
663 664
664 665
665 666
666 667
667 668
668 669
669 670
670 671
671 672
672 673
673 674
674 675
675 676
676 677
677 678
678 679
src/pages/Report/idCard.vue
1 <template> 1 <template>
2 <v-container fluid class="body-color"> 2 <v-container fluid class="body-color">
3 <!-- **** Id Card Select options **** --> 3 <!-- **** Id Card Select options **** -->
4 <v-card flat class="elevation-0 transparent"> 4 <v-card flat class="elevation-0 transparent">
5 <v-form ref="form" v-model="valid" lazy-validation> 5 <v-form ref="form" v-model="valid" lazy-validation>
6 <v-flex xs12 sm12 lg12> 6 <v-flex xs12 sm12 lg12>
7 <v-layout wrap> 7 <v-layout wrap>
8 <v-flex xs12 sm12 lg4> 8 <v-flex xs12 sm12 lg4>
9 <v-layout> 9 <v-layout>
10 <v-flex xs12 sm12 lg10 class="ml-2"> 10 <v-flex xs12 sm12 lg10 class="ml-2">
11 <v-autocomplete 11 <v-autocomplete
12 v-model="getReport.role" 12 v-model="getReport.role"
13 label="Select Type" 13 label="Select Type"
14 :items="getRoles" 14 :items="getRoles"
15 item-text="name" 15 item-text="name"
16 return-object 16 return-object
17 @change="getRoleInputs(getReport.role)" 17 @change="getRoleInputs(getReport.role)"
18 required 18 required
19 ></v-autocomplete> 19 ></v-autocomplete>
20 </v-flex> 20 </v-flex>
21 </v-layout> 21 </v-layout>
22 </v-flex> 22 </v-flex>
23 <!-- SELECT CLASS --> 23 <!-- SELECT CLASS -->
24 <v-flex xs12 sm12 lg4 v-if="showClass"> 24 <v-flex xs12 sm12 lg4 v-if="showClass">
25 <v-layout> 25 <v-layout>
26 <v-flex xs12 sm12 lg10 class="ml-2"> 26 <v-flex xs12 sm12 lg10 class="ml-2">
27 <v-select 27 <v-select
28 v-model="getReport.classId" 28 v-model="getReport.classId"
29 label="Select Class" 29 label="Select Class"
30 :items="classList" 30 :items="classList"
31 item-text="classNum" 31 item-text="classNum"
32 item-value="_id" 32 item-value="_id"
33 @change="getSections(getReport.classId)" 33 @change="getSections(getReport.classId)"
34 required 34 required
35 ></v-select> 35 ></v-select>
36 </v-flex> 36 </v-flex>
37 </v-layout> 37 </v-layout>
38 </v-flex> 38 </v-flex>
39 <!-- SELECT SECTION --> 39 <!-- SELECT SECTION -->
40 <v-flex xs12 sm12 lg4 v-if="showSections"> 40 <v-flex xs12 sm12 lg4 v-if="showSections">
41 <v-layout> 41 <v-layout>
42 <v-flex xs12 sm12 lg10 class="ml-2"> 42 <v-flex xs12 sm12 lg10 class="ml-2">
43 <v-select 43 <v-select
44 :items="addSection" 44 :items="addSection"
45 label="Select Section" 45 label="Select Section"
46 v-model="getReport.sectionId" 46 v-model="getReport.sectionId"
47 item-text="name" 47 item-text="name"
48 item-value="_id" 48 item-value="_id"
49 name="Select Section" 49 name="Select Section"
50 @change="getStudents" 50 @change="getStudents"
51 required 51 required
52 ></v-select> 52 ></v-select>
53 </v-flex> 53 </v-flex>
54 </v-layout> 54 </v-layout>
55 </v-flex> 55 </v-flex>
56 <!-- SELECT STUDENT --> 56 <!-- SELECT STUDENT -->
57 <v-flex xs12 sm12 lg4 v-if="showStudents"> 57 <v-flex xs12 sm12 lg4 v-if="showStudents">
58 <v-layout> 58 <v-layout>
59 <v-flex xs12 sm12 lg10 class="ml-2"> 59 <v-flex xs12 sm12 lg10 class="ml-2">
60 <v-select 60 <v-select
61 :items="getSelectUserData" 61 :items="getSelectUserData"
62 label="Select Student" 62 label="Select Student"
63 v-model="getReport._id" 63 v-model="getReport._id"
64 item-text="name" 64 item-text="name"
65 item-value="_id" 65 item-value="_id"
66 required 66 required
67 ></v-select> 67 ></v-select>
68 </v-flex> 68 </v-flex>
69 </v-layout> 69 </v-layout>
70 </v-flex> 70 </v-flex>
71 <v-flex xs12 sm12 lg4 v-if="showTeacher"> 71 <v-flex xs12 sm12 lg4 v-if="showTeacher">
72 <v-layout> 72 <v-layout>
73 <v-flex xs12 sm12 lg10 class="ml-2"> 73 <v-flex xs12 sm12 lg10 class="ml-2">
74 <v-select 74 <v-select
75 v-model="getReport._id" 75 v-model="getReport._id"
76 label="Select Teacher" 76 label="Select Teacher"
77 :items="getSelectUserData" 77 :items="getSelectUserData"
78 item-text="name" 78 item-text="name"
79 item-value="_id" 79 item-value="_id"
80 required 80 required
81 ></v-select> 81 ></v-select>
82 </v-flex> 82 </v-flex>
83 </v-layout> 83 </v-layout>
84 </v-flex> 84 </v-flex>
85 <v-flex xs12 sm12 lg4 v-if="showAdmin"> 85 <v-flex xs12 sm12 lg4 v-if="showAdmin">
86 <v-layout> 86 <v-layout>
87 <v-flex xs12 sm12 lg10 class="ml-2"> 87 <v-flex xs12 sm12 lg10 class="ml-2">
88 <v-select 88 <v-select
89 v-model="getReport._id" 89 v-model="getReport._id"
90 label="Select Admin" 90 label="Select Admin"
91 :items="getSelectUserData" 91 :items="getSelectUserData"
92 item-text="name" 92 item-text="name"
93 item-value="_id" 93 item-value="_id"
94 required 94 required
95 ></v-select> 95 ></v-select>
96 </v-flex> 96 </v-flex>
97 </v-layout> 97 </v-layout>
98 </v-flex> 98 </v-flex>
99 <v-flex xs12 sm12 lg4 v-if="showAccountant"> 99 <v-flex xs12 sm12 lg4 v-if="showAccountant">
100 <v-layout> 100 <v-layout>
101 <v-flex xs12 sm12 lg10 class="ml-2"> 101 <v-flex xs12 sm12 lg10 class="ml-2">
102 <v-select 102 <v-select
103 v-model="getReport._id" 103 v-model="getReport._id"
104 label="Select Accountant" 104 label="Select Accountant"
105 :items="getSelectUserData" 105 :items="getSelectUserData"
106 item-text="name" 106 item-text="name"
107 item-value="_id" 107 item-value="_id"
108 required 108 required
109 ></v-select> 109 ></v-select>
110 </v-flex> 110 </v-flex>
111 </v-layout> 111 </v-layout>
112 </v-flex> 112 </v-flex>
113 <v-flex xs12 sm12 lg4 v-if="showLibrarian"> 113 <v-flex xs12 sm12 lg4 v-if="showLibrarian">
114 <v-layout> 114 <v-layout>
115 <v-flex xs12 sm12 lg10 class="ml-2"> 115 <v-flex xs12 sm12 lg10 class="ml-2">
116 <v-select 116 <v-select
117 v-model="getReport._id" 117 v-model="getReport._id"
118 label="Select Librarian" 118 label="Select Librarian"
119 :items="getSelectUserData " 119 :items="getSelectUserData "
120 item-text="name" 120 item-text="name"
121 item-value="_id" 121 item-value="_id"
122 required 122 required
123 ></v-select> 123 ></v-select>
124 </v-flex> 124 </v-flex>
125 </v-layout> 125 </v-layout>
126 </v-flex> 126 </v-flex>
127 <v-flex xs12 sm12 lg4> 127 <v-flex xs12 sm12 lg4>
128 <v-layout> 128 <v-layout>
129 <v-flex xs12 sm12 lg10 class="ml-2"> 129 <v-flex xs12 sm12 lg10 class="ml-2">
130 <v-autocomplete 130 <v-autocomplete
131 label="Select View Type" 131 label="Select View Type"
132 type="text" 132 type="text"
133 :items="typeList" 133 :items="typeList"
134 v-model="getReport.viewType" 134 v-model="getReport.viewType"
135 item-text="name" 135 item-text="name"
136 item-value="value" 136 item-value="value"
137 :rules="typeRules" 137 :rules="typeRules"
138 @change="getReportType(getReport.viewType)" 138 @change="getReportType(getReport.viewType)"
139 required 139 required
140 ></v-autocomplete> 140 ></v-autocomplete>
141 </v-flex> 141 </v-flex>
142 </v-layout> 142 </v-layout>
143 </v-flex> 143 </v-flex>
144 <v-flex xs12 sm12 lg4> 144 <v-flex xs12 sm12 lg4>
145 <v-btn 145 <v-btn
146 @click="getCards" 146 @click="getCards"
147 round 147 round
148 dark 148 dark
149 :loading="loading" 149 :loading="loading"
150 class="open-dialog-button mt-3" 150 class="open-dialog-button mt-3"
151 >Get Report</v-btn> 151 >Get Report</v-btn>
152 </v-flex> 152 </v-flex>
153 </v-layout> 153 </v-layout>
154 </v-flex> 154 </v-flex>
155 </v-form> 155 </v-form>
156 </v-card> 156 </v-card>
157 <div> 157 <div>
158 <v-layout v-show="showReport"> 158 <v-layout v-show="showReport">
159 <v-flex xs12> 159 <v-flex xs12>
160 <v-card class="transparent elevation-0"> 160 <v-card class="transparent elevation-0">
161 <!-- print button --> 161 <!-- print button -->
162 <v-layout> 162 <v-layout>
163 <v-flex xs12> 163 <v-flex xs12>
164 <v-btn class="open-dialog-button right" round dark @click="prindIDCardReport()"> 164 <v-btn class="open-dialog-button right" round dark @click="prindIDCardReport()">
165 Print 165 Print
166 <v-icon right dark>print</v-icon> 166 <v-icon right dark>print</v-icon>
167 </v-btn> 167 </v-btn>
168 </v-flex> 168 </v-flex>
169 </v-layout> 169 </v-layout>
170 </v-card> 170 </v-card>
171 <v-layout row wrap id="printMe" justify-center> 171 <v-layout row wrap id="printMe" justify-center>
172 <div 172 <div
173 v-for="(getCard,index) in getCard" 173 v-for="(getCard,index) in getCard"
174 :key="index" 174 :key="index"
175 style="page-break-after: always; width:100%;margin:14px auto;background:transparent;" 175 style="page-break-after: always; width:100%;margin:14px auto;background:transparent;"
176 > 176 >
177 <v-container grid-list-md> 177 <v-container grid-list-md>
178 <v-layout class="col-sm-12"> 178 <v-layout class="col-sm-12">
179 <div 179 <div
180 style="font-family: arial; 180 style="font-family: arial;
181 max-width: 794px; 181 max-width: 794px;
182 max-height: 1123px; 182 max-height: 1123px;
183 margin-left: auto; 183 margin-left: auto;
184 margin-right: auto; 184 margin-right: auto;
185 -webkit-print-color-adjust: exact;" 185 -webkit-print-color-adjust: exact;"
186 > 186 >
187 <div 187 <div
188 style=" 188 style="
189 float: left; 189 float: left;
190 190
191 width: 520px; 191 width: 520px;
192 background: #fff; 192 background: #fff;
193 border: 1px solid lightgray; 193 border: 1px solid lightgray;
194 position:relative;" 194 position:relative;"
195 > 195 >
196 <!-- bottom-right-side-image --> 196 <!-- bottom-right-side-image -->
197 <img 197 <img
198 src="/static/icon/shape1.png" 198 src="/static/icon/shape1.png"
199 alt="shape" 199 alt="shape"
200 style="position:absolute;width: 90px;" 200 style="position:absolute;width: 90px;"
201 /> 201 />
202 <!-- Front Side --> 202 <!-- Front Side -->
203 <v-layout 203 <v-layout
204 style=" 204 style="
205 text-align: center; 205 text-align: center;
206 " 206 "
207 v-if="frontPart" 207 v-if="frontPart"
208 > 208 >
209 <v-flex xs12> 209 <v-flex xs12>
210 <!-- school Logo Url --> 210 <!-- school Logo Url -->
211 <img 211 <img
212 v-if="getCard.schoolLogoUrl" 212 v-if="getCard.schoolLogoUrl"
213 :src="getCard.schoolLogoUrl" 213 :src="getCard.schoolLogoUrl"
214 alt="schoollogo" 214 alt="schoollogo"
215 style=" 215 style="
216 width: 110px; 216 width: 110px;
217 margin-top:10px; 217 margin-top:10px;
218 overflow:hidden" 218 overflow:hidden"
219 /> 219 />
220 <img 220 <img
221 src="/static/default_thumb.png" 221 src="/static/default_thumb.png"
222 v-if="!getCard.schoolLogoUrl" 222 v-if="!getCard.schoolLogoUrl"
223 alt="schoollogo" 223 alt="schoollogo"
224 style=" 224 style="
225 width: 110px; 225 width: 110px;
226 margin-top:10px; 226 margin-top:10px;
227 overflow:hidden" 227 overflow:hidden"
228 /> 228 />
229 <v-layout style="margin:auto"> 229 <v-layout style="margin:auto">
230 <!-- profile url --> 230 <!-- profile url -->
231 <img 231 <img
232 v-if="getCard.profilePicUrl" 232 v-if="getCard.profilePicUrl"
233 :src="getCard.profilePicUrl" 233 :src="getCard.profilePicUrl"
234 alt="profileImage" 234 alt="profileImage"
235 style="; 235 style=";
236 width: 110px; 236 width: 110px;
237 margin:10px auto; 237 margin:10px auto;
238 width: 110px; 238 width: 110px;
239 margin: 10px auto; 239 margin: 10px auto;
240 border: 3px solid #323232; 240 border: 3px solid #323232;
241 border-radius: 12px;" 241 border-radius: 12px;"
242 /> 242 />
243 <img 243 <img
244 style=" 244 style="
245 width: 110px; 245 width: 110px;
246 margin:10px auto; 246 margin:10px auto;
247 width: 110px; 247 width: 110px;
248 margin: 10px auto;" 248 margin: 10px auto;"
249 alt="dummy" 249 alt="dummy"
250 src="/static/icon/user.png" 250 src="/static/icon/user.png"
251 v-if="!getCard.profilePicUrl && getCard.role != '2'" 251 v-if="!getCard.profilePicUrl && getCard.role != '2'"
252 /> 252 />
253 </v-layout> 253 </v-layout>
254 254
255 <p 255 <p
256 style="color: #302653;font-size:24px; 256 style="color: #302653;font-size:24px;
257 letter-spacing: 4px; 257 letter-spacing: 4px;
258 margin-bottom:14px;" 258 margin-bottom:14px;"
259 > 259 >
260 <b>{{ getCard.name}}</b> 260 <b>{{ getCard.name}}</b>
261 </p> 261 </p>
262 <p 262 <p
263 style="color: #302653; 263 style="color: #302653;
264 font-size:14px; 264 font-size:14px;
265 letter-spacing: 4px; 265 letter-spacing: 4px;
266 margin-bottom:14px;" 266 margin-bottom:14px;"
267 > 267 >
268 <b>{{ getCard.gender}}</b> 268 <b>{{ getCard.gender}}</b>
269 </p> 269 </p>
270 <p 270 <p
271 v-if="getCard.classId" 271 v-if="getCard.classId"
272 style="color: #302653; 272 style="color: #302653;
273 font-size:24px; 273 font-size:24px;
274 letter-spacing: 4px; 274 letter-spacing: 4px;
275 margin-bottom:14px;" 275 margin-bottom:14px;"
276 >{{ getCard.classId.classNum }}</p> 276 >{{ getCard.classId.classNum }}</p>
277 <p 277 <p
278 v-if="getCard.classId" 278 v-if="getCard.classId"
279 style="color: #302653; 279 style="color: #302653;
280 font-size:24px; 280 font-size:24px;
281 letter-spacing: 4px; 281 letter-spacing: 4px;
282 margin-bottom:14px;" 282 margin-bottom:14px;"
283 >{{ getCard.sectionId.name }}</p> 283 >{{ getCard.sectionId.name }}</p>
284 <p 284 <p
285 v-if="getCard.rollNo" 285 v-if="getCard.rollNo"
286 style="color: #302653; 286 style="color: #302653;
287 font-size:24px; 287 font-size:24px;
288 letter-spacing: 2px; 288 letter-spacing: 2px;
289 margin-bottom:10px;" 289 margin-bottom:10px;"
290 >Roll: {{ getCard.rollNo }}</p> 290 >Roll: {{ getCard.rollNo }}</p>
291 <p 291 <p
292 v-if="getCard.joinDate" 292 v-if="getCard.joinDate"
293 style="color: #302653; 293 style="color: #302653;
294 margin-bottom:10px; 294 margin-bottom:10px;
295 font-size:16px; 295 font-size:16px;
296 letter-spacing: 2px;" 296 letter-spacing: 2px;"
297 >{{ dates(getCard.joinDate) }}</p> 297 >{{ dates(getCard.joinDate) }}</p>
298 <p 298 <p
299 v-if="getCard.joiningDate" 299 v-if="getCard.joiningDate"
300 style="color: #302653; 300 style="color: #302653;
301 margin-bottom:10px; 301 margin-bottom:10px;
302 font-size:16px; 302 font-size:16px;
303 letter-spacing: 2px;" 303 letter-spacing: 2px;"
304 >{{ dates(getCard.joiningDate) }}</p> 304 >{{ dates(getCard.joiningDate) }}</p>
305 <p 305 <p
306 v-if="getCard.phone" 306 v-if="getCard.phone"
307 style="color: #302653; 307 style="color: #302653;
308 margin-bottom:10px; 308 margin-bottom:10px;
309 font-size:16px; 309 font-size:16px;
310 letter-spacing: 2px;" 310 letter-spacing: 2px;"
311 >{{ getCard.phone }}</p> 311 >{{ getCard.phone }}</p>
312 <p 312 <p
313 style=" 313 style="
314 font-size: 19px; 314 font-size: 19px;
315 font-weight: 100; 315 font-weight: 100;
316 color: rgb(48, 38, 83); 316 color: rgb(48, 38, 83);
317 letter-spacing: 5px; 317 letter-spacing: 5px;
318 margin-bottom:10px;" 318 margin-bottom:10px;"
319 > 319 >
320 <span v-if="getCard.mobile">{{ getCard.mobile}}</span> 320 <span v-if="getCard.mobile">{{ getCard.mobile}}</span>
321 <span v-if="getCard.mobileNo">{{ getCard.mobileNo }}</span> 321 <span v-if="getCard.mobileNo">{{ getCard.mobileNo }}</span>
322 </p> 322 </p>
323 <p 323 <p
324 style=" 324 style="
325 font-size: 17px; 325 font-size: 17px;
326 font-weight: 100; 326 font-weight: 100;
327 color: rgb(48, 38, 83); 327 color: rgb(48, 38, 83);
328 letter-spacing: 4px; 328 letter-spacing: 4px;
329 margin-bottom:14px;" 329 margin-bottom:14px;"
330 >{{ getCard.email}}</p> 330 >{{ getCard.email}}</p>
331 </v-flex> 331 </v-flex>
332 </v-layout> 332 </v-layout>
333 <!-- back side --> 333 <!-- back side -->
334 <v-layout style=" 334 <v-layout style="
335 text-align: center;" v-if="backPart"> 335 text-align: center;" v-if="backPart">
336 <v-flex xs12> 336 <v-flex xs12>
337 <!-- school Logo Url --> 337 <!-- school Logo Url -->
338 <img 338 <img
339 v-if="getCard.schoolLogoUrl" 339 v-if="getCard.schoolLogoUrl"
340 :src="getCard.schoolLogoUrl" 340 :src="getCard.schoolLogoUrl"
341 alt="schoollogo" 341 alt="schoollogo"
342 style=" 342 style="
343 width: 110px; 343 width: 110px;
344 margin-top:10px; 344 margin-top:10px;
345 overflow:hidden" 345 overflow:hidden"
346 /> 346 />
347 <img 347 <img
348 v-if="getCard.schoolId" 348 v-if="getCard.schoolId"
349 :src="getCard.schoolId.schoolLogoUrl" 349 :src="getCard.schoolId.schoolLogoUrl"
350 alt="schoollogo" 350 alt="schoollogo"
351 style=" 351 style="
352 width: 110px; 352 width: 110px;
353 margin-top:10px; 353 margin-top:10px;
354 overflow:hidden" 354 overflow:hidden"
355 /> 355 />
356 <p 356 <p
357 v-if="getCard.schoolLogoUrl" 357 v-if="getCard.schoolLogoUrl"
358 style="color: #302653; 358 style="color: #302653;
359 font-size:24px; 359 font-size:24px;
360 letter-spacing: 4px; 360 letter-spacing: 4px;
361 margin-bottom:14px;" 361 margin-bottom:14px;"
362 > 362 >
363 <b>{{ getCard.name}}</b> 363 <b>{{ getCard.name}}</b>
364 </p> 364 </p>
365 365
366 <p 366 <p
367 v-if="getCard.city" 367 v-if="getCard.city"
368 style=" 368 style="
369 font-size: 17px; 369 font-size: 17px;
370 font-weight: 100; 370 font-weight: 100;
371 color: rgb(48, 38, 83); 371 color: rgb(48, 38, 83);
372 letter-spacing: 4px; 372 letter-spacing: 4px;
373 margin-bottom:14px;" 373 margin-bottom:14px;"
374 >{{ getCard.city}}</p> 374 >{{ getCard.city}}</p>
375 <p 375 <p
376 style=" 376 style="
377 font-size: 17px; 377 font-size: 17px;
378 font-weight: 100; 378 font-weight: 100;
379 color: rgb(48, 38, 83); 379 color: rgb(48, 38, 83);
380 letter-spacing: 4px; 380 letter-spacing: 4px;
381 margin-bottom:14px;" 381 margin-bottom:14px;"
382 > 382 >
383 {{ getCard.address }} 383 {{ getCard.address }}
384 {{ getCard.presentAddress }} 384 {{ getCard.presentAddress }}
385 <span 385 <span
386 v-if="getCard.state" 386 v-if="getCard.state"
387 >({{ getCard.state }})</span> 387 >({{ getCard.state }})</span>
388 </p> 388 </p>
389 <p 389 <p
390 v-if="getCard.establishmentYear" 390 v-if="getCard.establishmentYear"
391 style=" 391 style="
392 font-size: 17px; 392 font-size: 17px;
393 font-weight: 100; 393 font-weight: 100;
394 color: rgb(48, 38, 83); 394 color: rgb(48, 38, 83);
395 letter-spacing: 4px; 395 letter-spacing: 4px;
396 margin-bottom:14px;" 396 margin-bottom:14px;"
397 >{{ getCard.establishmentYear }}</p> 397 >{{ getCard.establishmentYear }}</p>
398 </v-flex> 398 </v-flex>
399 </v-layout> 399 </v-layout>
400 <!-- bottom-right-side-image --> 400 <!-- bottom-right-side-image -->
401 <img 401 <img
402 src="static/icon/shape2.png" 402 src="static/icon/shape2.png"
403 alt="shape2" 403 alt="shape2"
404 style="bottom: 0; 404 style="bottom: 0;
405 position: absolute; 405 position: absolute;
406 right: 0; 406 right: 0;
407 width: 110px;" 407 width: 110px;"
408 /> 408 />
409 </div> 409 </div>
410 </div> 410 </div>
411 </v-layout> 411 </v-layout>
412 </v-container> 412 </v-container>
413 </div> 413 </div>
414 </v-layout> 414 </v-layout>
415 </v-flex> 415 </v-flex>
416 </v-layout> 416 </v-layout>
417 </div> 417 </div>
418 <v-snackbar 418 <v-snackbar
419 :timeout="timeout" 419 :timeout="timeout"
420 :top="y === 'top'" 420 :top="y === 'top'"
421 :right="x === 'right'" 421 :right="x === 'right'"
422 :vertical="mode === 'vertical'" 422 :vertical="mode === 'vertical'"
423 v-model="snackbar" 423 v-model="snackbar"
424 :color="color" 424 :color="color"
425 >{{ text }}</v-snackbar> 425 >{{ text }}</v-snackbar>
426 <div class="loader" v-if="showLoader"> 426 <div class="loader" v-if="showLoader">
427 <v-progress-circular indeterminate color="white"></v-progress-circular> 427 <v-progress-circular indeterminate color="white"></v-progress-circular>
428 </div> 428 </div>
429 </v-container> 429 </v-container>
430 </template> 430 </template>
431 431
432 <script> 432 <script>
433 import http from "@/Services/http.js"; 433 import http from "@/Services/http.js";
434 import moment from "moment"; 434 import moment from "moment";
435 var qs = require("qs"); 435 var qs = require("qs");
436 436
437 export default { 437 export default {
438 data: () => ({ 438 data: () => ({
439 showLoader: false, 439 showLoader: false,
440 valid: true, 440 valid: true,
441 report: {}, 441 report: {},
442 userData: {}, 442 userData: {},
443 snackbar: false, 443 snackbar: false,
444 color: "", 444 color: "",
445 y: "top", 445 y: "top",
446 x: "right", 446 x: "right",
447 mode: "", 447 mode: "",
448 timeout: 10000, 448 timeout: 10000,
449 text: "", 449 text: "",
450 loading: false, 450 loading: false,
451 showReport: false, 451 showReport: false,
452 frontPart: false, 452 frontPart: false,
453 backPart: false, 453 backPart: false,
454 showClass: false, 454 showClass: false,
455 showTeacher: false, 455 showTeacher: false,
456 showAdmin: false, 456 showAdmin: false,
457 showAccountant: false, 457 showAccountant: false,
458 showLibrarian: false, 458 showLibrarian: false,
459 hideprintIdCard: false, 459 hideprintIdCard: false,
460 hidebackprintIdCard: false, 460 hidebackprintIdCard: false,
461 showStudents: false, 461 showStudents: false,
462 showSections: false, 462 showSections: false,
463 getRoles: [], 463 getRoles: [],
464 classList: [], 464 classList: [],
465 getCard: [], 465 getCard: [],
466 addSection: [], 466 addSection: [],
467 // getStudentsList: 467 // getStudentsList:
468 // teacherList: [], 468 // teacherList: [],
469 getSelectUserData: [], 469 getSelectUserData: [],
470 // Users: [], 470 // Users: [],
471 getReport: {}, 471 getReport: {},
472 typeRules: [(v) => !!v || "Type is required"], 472 typeRules: [(v) => !!v || "Type is required"],
473 typeList: [ 473 typeList: [
474 { 474 {
475 name: "Front Part", 475 name: "Front Part",
476 value: "frontPart", 476 value: "frontPart",
477 }, 477 },
478 { 478 {
479 name: "Back Part", 479 name: "Back Part",
480 value: "backPart", 480 value: "backPart",
481 }, 481 },
482 ], 482 ],
483 backgroundList: ["Yes", "No"], 483 backgroundList: ["Yes", "No"],
484 }), 484 }),
485 485
486 mounted() { 486 mounted() {
487 this.token = this.$store.state.token; 487 this.token = this.$store.state.token;
488 this.getUserData(); 488 this.getUserData();
489 this.getRole(); 489 this.getRole();
490 }, 490 },
491 491
492 methods: { 492 methods: {
493 dates: function (date) { 493 dates: function (date) {
494 return moment(date).format("MMMM DD, YYYY"); 494 return moment(date).format("MMMM DD, YYYY");
495 return date; 495 return date;
496 }, 496 },
497 getReportType() { 497 getReportType() {
498 if (this.getReport.viewType === "frontPart") { 498 if (this.getReport.viewType === "frontPart") {
499 this.frontPart = true; 499 this.frontPart = true;
500 this.backPart = false; 500 this.backPart = false;
501 } 501 }
502 if (this.getReport.viewType === "backPart") { 502 if (this.getReport.viewType === "backPart") {
503 this.frontPart = false; 503 this.frontPart = false;
504 this.backPart = true; 504 this.backPart = true;
505 } 505 }
506 }, 506 },
507 getRoleInputs(role) { 507 getRoleInputs(role) {
508 // console.log("role", role); 508 // console.log("role", role);
509 this.showReport = false; 509 this.showReport = false;
510 this.getReport._id = ""; 510 this.getReport._id = "";
511 this.getCard = ""; 511 this.getCard = "";
512 this.classList = []; 512 this.classList = [];
513 this.addSection = []; 513 this.addSection = [];
514 this.getReport.classId = ""; 514 this.getReport.classId = "";
515 this.getReport.sectionId = ""; 515 this.getReport.sectionId = "";
516 this.getReport._id = ""; 516 this.getReport._id = "";
517 this.getSelectUserData = []; 517 this.getSelectUserData = [];
518 if (role.name === "STUDENT") { 518 if (role.name === "STUDENT") {
519 // console.log("role", role); 519 // console.log("role", role);
520 this.showClass = true; 520 this.showClass = true;
521 this.showTeacher = false; 521 this.showTeacher = false;
522 this.showAdmin = false; 522 this.showAdmin = false;
523 this.showAccountant = false; 523 this.showAccountant = false;
524 this.showLibrarian = false; 524 this.showLibrarian = false;
525 this.showStudents = false; 525 this.showStudents = false;
526 this.showSections = false; 526 this.showSections = false;
527 this.getClass(); 527 this.getClass();
528 } 528 }
529 if (role.name === "TEACHER") { 529 if (role.name === "TEACHER") {
530 this.showTeacher = true; 530 this.showTeacher = true;
531 this.showClass = false; 531 this.showClass = false;
532 this.showAdmin = false; 532 this.showAdmin = false;
533 this.showAccountant = false; 533 this.showAccountant = false;
534 this.showLibrarian = false; 534 this.showLibrarian = false;
535 this.showStudents = false; 535 this.showStudents = false;
536 this.showSections = false; 536 this.showSections = false;
537 this.getTeacherList(); 537 this.getTeacherList();
538 } 538 }
539 if (role.name === "ADMIN") { 539 if (role.name === "ADMIN") {
540 this.showAdmin = true; 540 this.showAdmin = true;
541 this.showTeacher = false; 541 this.showTeacher = false;
542 this.showClass = false; 542 this.showClass = false;
543 this.showAccountant = false; 543 this.showAccountant = false;
544 this.showLibrarian = false; 544 this.showLibrarian = false;
545 this.showStudents = false; 545 this.showStudents = false;
546 this.showSections = false; 546 this.showSections = false;
547 this.getUsersList(role.role); 547 this.getUsersList(role.role);
548 } 548 }
549 if (role.name === "ACCOUNTANT") { 549 if (role.name === "ACCOUNTANT") {
550 this.showAccountant = true; 550 this.showAccountant = true;
551 this.showAdmin = false; 551 this.showAdmin = false;
552 this.showTeacher = false; 552 this.showTeacher = false;
553 this.showClass = false; 553 this.showClass = false;
554 this.showLibrarian = false; 554 this.showLibrarian = false;
555 this.showStudents = false; 555 this.showStudents = false;
556 this.showSections = false; 556 this.showSections = false;
557 this.getUsersList(role.role); 557 this.getUsersList(role.role);
558 } 558 }
559 if (role.name === "LIBRARIAN") { 559 if (role.name === "LIBRARIAN") {
560 this.showLibrarian = true; 560 this.showLibrarian = true;
561 this.showAccountant = false; 561 this.showAccountant = false;
562 this.showAdmin = false; 562 this.showAdmin = false;
563 this.showTeacher = false; 563 this.showTeacher = false;
564 this.showClass = false; 564 this.showClass = false;
565 this.showStudents = false; 565 this.showStudents = false;
566 this.showSections = false; 566 this.showSections = false;
567 this.getUsersList(role.role); 567 this.getUsersList(role.role);
568 } 568 }
569 }, 569 },
570 570
571 prindIDCardReport() { 571 prindIDCardReport() {
572 // Pass the element id here 572 // Pass the element id here
573 this.$htmlToPaper("printMe"); 573 this.$htmlToPaper("printMe");
574 }, 574 },
575 getUserData() { 575 getUserData() {
576 this.getSelectUserData = []; 576 this.getSelectUserData = [];
577 this.showLoader = true; 577 this.showLoader = true;
578 http() 578 http()
579 .get("/getParticularUserDetail") 579 .get("/getParticularUserDetail")
580 .then((response) => { 580 .then((response) => {
581 let mergeObj = { 581 let mergeObj = {
582 name: "Select All", 582 name: "Select All",
583 id: "Select All", 583 id: "Select All",
584 }; 584 };
585 this.getSelectUserData.push(mergeObj); 585 this.getSelectUserData.push(mergeObj);
586 let getUserDetails = response.data.data; 586 let getUserDetails = response.data.data;
587 this.getSelectUserData.push(getUserDetails); 587 this.getSelectUserData.push(getUserDetails);
588 this.showLoader = false; 588 this.showLoader = false;
589 // this.adminList = response.data.data; 589 // this.adminList = response.data.data;
590 }) 590 })
591 .catch((error) => { 591 .catch((error) => {
592 this.showLoader = false; 592 this.showLoader = false;
593 if (error.response.status === 401) { 593 if (error.response.status === 401) {
594 this.$router.replace({ path: "/" }); 594 this.$router.replace({ path: "/" });
595 this.$store.dispatch("setToken", null); 595 this.$store.dispatch("setToken", null);
596 this.$store.dispatch("Id", null); 596 this.$store.dispatch("Id", null);
597 } 597 }
598 }); 598 });
599 }, 599 },
600 getRole() { 600 getRole() {
601 this.showLoader = true; 601 this.showLoader = true;
602 http() 602 http()
603 .get("/getRolesList", { 603 .get("/getRolesList", {
604 headers: { Authorization: "Bearer " + this.token }, 604 headers: { Authorization: "Bearer " + this.token },
605 }) 605 })
606 .then((response) => { 606 .then((response) => {
607 var getRoles = []; 607 var getRoles = [];
608 getRoles = response.data.data; 608 getRoles = response.data.data;
609 for (let i = 0; i < getRoles.length; i++) { 609 for (let i = 0; i < getRoles.length; i++) {
610 if ( 610 if (
611 getRoles[i].name != "SUPERADMIN" && 611 getRoles[i].name != "SUPERADMIN" &&
612 getRoles[i].name != "PARENT" 612 getRoles[i].name != "PARENT"
613 ) { 613 ) {
614 this.getRoles.push(getRoles[i]); 614 this.getRoles.push(getRoles[i]);
615 } 615 }
616 } 616 }
617 this.showLoader = false; 617 this.showLoader = false;
618 }) 618 })
619 .catch((error) => { 619 .catch((error) => {
620 this.showLoader = false; 620 this.showLoader = false;
621 if (error.response.status === 401) { 621 if (error.response.status === 401) {
622 this.$router.replace({ path: "/" }); 622 this.$router.replace({ path: "/" });
623 this.$store.dispatch("setToken", null); 623 this.$store.dispatch("setToken", null);
624 this.$store.dispatch("Id", null); 624 this.$store.dispatch("Id", null);
625 this.$store.dispatch("Role", null); 625 this.$store.dispatch("Role", null);
626 } 626 }
627 }); 627 });
628 }, 628 },
629 getClass() { 629 getClass() {
630 // console.log("get classes"); 630 // console.log("get classes");
631 this.showLoader = true; 631 this.showLoader = true;
632 http() 632 http()
633 .get("/getClassesList", { 633 .get("/getClassesList", {
634 headers: { Authorization: "Bearer " + this.token }, 634 headers: { Authorization: "Bearer " + this.token },
635 }) 635 })
636 .then((response) => { 636 .then((response) => {
637 this.classList = response.data.data; 637 this.classList = response.data.data;
638 this.showLoader = false; 638 this.showLoader = false;
639 }) 639 })
640 .catch((error) => { 640 .catch((error) => {
641 this.showLoader = false; 641 this.showLoader = false;
642 // console.log("err====>", err); 642 // console.log("err====>", err);
643 }); 643 });
644 }, 644 },
645 getSections(_id) { 645 getSections(_id) {
646 this.showLoader = true; 646 this.showLoader = true;
647 this.getCard = [];
647 http() 648 http()
648 .get( 649 .get(
649 "/getSectionsList", 650 "/getSectionsList",
650 { params: { classId: _id } }, 651 { params: { classId: _id } },
651 { 652 {
652 headers: { Authorization: "Bearer " + this.token }, 653 headers: { Authorization: "Bearer " + this.token },
653 } 654 }
654 ) 655 )
655 .then((response) => { 656 .then((response) => {
656 this.addSection = response.data.data; 657 this.addSection = response.data.data;
657 this.showSections = true; 658 this.showSections = true;
658 this.showLoader = false; 659 this.showLoader = false;
659 }) 660 })
660 .catch((err) => { 661 .catch((err) => {
661 this.showLoader = false; 662 this.showLoader = false;
662 // console.log("err====>", err); 663 // console.log("err====>", err);
663 }); 664 });
664 }, 665 },
665 getStudents() { 666 getStudents() {
666 this.getSelectUserData = []; 667 this.getSelectUserData = [];
667 this.showLoader = true; 668 this.showLoader = true;
668 http() 669 http()
669 .get("/getStudentWithClass", { 670 .get("/getStudentWithClass", {
670 params: { 671 params: {
671 classId: this.getReport.classId, 672 classId: this.getReport.classId,
672 sectionId: this.getReport.sectionId, 673 sectionId: this.getReport.sectionId,
673 }, 674 },
674 }) 675 })
675 .then((response) => { 676 .then((response) => {
676 response.data.data.unshift({ 677 response.data.data.unshift({
677 name: "Select All", 678 name: "Select All",
678 _id: "Select All", 679 _id: "Select All",
679 }); 680 });
680 this.getSelectUserData = response.data.data; 681 this.getSelectUserData = response.data.data;
681 this.showStudents = true; 682 this.showStudents = true;
682 this.showLoader = false; 683 this.showLoader = false;
683 }) 684 })
684 .catch((error) => { 685 .catch((error) => {
685 // console.log("err====>", error); 686 // console.log("err====>", error);
686 this.showLoader = false; 687 this.showLoader = false;
687 this.snackbar = true; 688 this.snackbar = true;
688 this.color = "error"; 689 this.color = "error";
689 this.text = error.response.data.message; 690 this.text = error.response.data.message;
690 }); 691 });
691 }, 692 },
692 getCards() { 693 getCards() {
693 var getSelectUserId = []; 694 var getSelectUserId = [];
694 for (let i = 0; i < this.getSelectUserData.length; i++) { 695 for (let i = 0; i < this.getSelectUserData.length; i++) {
695 /* if the selected user id mathches any id in the original user data then push it in 696 /* if the selected user id mathches any id in the original user data then push it in
696 array, this way only one id will be pushed */ 697 array, this way only one id will be pushed */
697 if (this.getReport._id === this.getSelectUserData[i]._id) { 698 if (this.getReport._id === this.getSelectUserData[i]._id) {
698 getSelectUserId.push(this.getSelectUserData[i]._id); 699 getSelectUserId.push(this.getSelectUserData[i]._id);
699 } /* else if select all option is selected then all ids will be pushed */ else if ( 700 } /* else if select all option is selected then all ids will be pushed */ else if (
700 this.getReport._id == "Select All" 701 this.getReport._id == "Select All"
701 ) { 702 ) {
702 getSelectUserId.push(this.getSelectUserData[i]._id); 703 getSelectUserId.push(this.getSelectUserData[i]._id);
703 if ( 704 if (
704 getSelectUserId[0] == undefined || 705 getSelectUserId[0] == undefined ||
705 getSelectUserId[0] == "Select All" 706 getSelectUserId[0] == "Select All"
706 ) { 707 ) {
707 getSelectUserId.shift(); 708 getSelectUserId.shift();
708 } 709 }
709 } 710 }
710 } 711 }
711 712
712 if (this.$refs.form.validate()) { 713 if (this.$refs.form.validate()) {
713 this.showLoader = true; 714 this.showLoader = true;
714 // var strigified = JSON.stringify(getSelectUserId) 715 // var strigified = JSON.stringify(getSelectUserId)
715 // var profileId = []; 716 // var profileId = [];
716 // profileId = getSelectUserId; 717 // profileId = getSelectUserId;
717 var idcardPayload = { 718 var idcardPayload = {
718 profileId: getSelectUserId, 719 profileId: getSelectUserId,
719 role: this.getReport.role.role, 720 role: this.getReport.role.role,
720 }; 721 };
721 http() 722 http()
722 .put("/getIdCardDetail", idcardPayload, { 723 .put("/getIdCardDetail", idcardPayload, {
723 headers: { 724 headers: {
724 Authorization: "Bearer " + this.token, 725 Authorization: "Bearer " + this.token,
725 }, 726 },
726 paramsSerializer: (params) => { 727 paramsSerializer: (params) => {
727 return qs.stringify(params); 728 return qs.stringify(params);
728 }, 729 },
729 // params: { 730 // params: {
730 // profileId: strigified, 731 // profileId: strigified,
731 // role: this.getReport.role.role, 732 // role: this.getReport.role.role,
732 // }, 733 // },
733 }) 734 })
734 .then((response) => { 735 .then((response) => {
735 this.getCard = ""; 736 this.getCard = "";
736 737
737 var data = response.data.data; 738 var data = response.data.data;
738 739
739 if (data.adminData && data.adminData.length != 0) { 740 if (data.adminData && data.adminData.length != 0) {
740 this.getCard = response.data.data.adminData; 741 this.getCard = response.data.data.adminData;
741 // console.log("this.getCard ", this.getCard); 742 // console.log("this.getCard ", this.getCard);
742 } 743 }
743 if (data.teachersData && data.teachersData.length != 0) { 744 if (data.teachersData && data.teachersData.length != 0) {
744 this.getCard = response.data.data.teachersData; 745 this.getCard = response.data.data.teachersData;
745 } 746 }
746 if (data.studentData && data.studentData.length != 0) { 747 if (data.studentData && data.studentData.length != 0) {
747 this.getCard = response.data.data.studentData; 748 this.getCard = response.data.data.studentData;
748 // console.log("this.getCard--studentData ", this.getCard); 749 // console.log("this.getCard--studentData ", this.getCard);
749 } 750 }
750 if (data.usersData && data.usersData.length != 0) { 751 if (data.usersData && data.usersData.length != 0) {
751 this.getCard = response.data.data.usersData; 752 this.getCard = response.data.data.usersData;
752 // console.log("this.getCard--usersData ", this.getCard); 753 // console.log("this.getCard--usersData ", this.getCard);
753 } 754 }
754 // console.log("this.getCard--all ", response.data.data); 755 // console.log("this.getCard--all ", response.data.data);
755 this.showLoader = false; 756 this.showLoader = false;
756 this.showReport = true; 757 this.showReport = true;
757 }) 758 })
758 .catch((error) => { 759 .catch((error) => {
759 this.showLoader = false; 760 this.showLoader = false;
760 // console.log("error", error.response.data.errors); 761 // console.log("error", error.response.data.errors);
761 // if (error.response.data.errors) { 762 // if (error.response.data.errors) {
762 // this.snackbar = true; 763 // this.snackbar = true;
763 // this.text = " Field is required"; 764 // this.text = " Field is required";
764 // this.color = "error"; 765 // this.color = "error";
765 // } 766 // }
766 }); 767 });
767 } 768 }
768 }, 769 },
769 getTeacherList() { 770 getTeacherList() {
770 this.getSelectUserData = []; 771 this.getSelectUserData = [];
771 this.showLoader = true; 772 this.showLoader = true;
772 var token = this.$store.state.token; 773 var token = this.$store.state.token;
773 http() 774 http()
774 .get("/getTeachersList", { 775 .get("/getTeachersList", {
775 headers: { Authorization: "Bearer " + token }, 776 headers: { Authorization: "Bearer " + token },
776 }) 777 })
777 .then((response) => { 778 .then((response) => {
778 response.data.data.unshift({ 779 response.data.data.unshift({
779 name: "Select All", 780 name: "Select All",
780 _id: "Select All", 781 _id: "Select All",
781 }); 782 });
782 this.getSelectUserData = response.data.data; 783 this.getSelectUserData = response.data.data;
783 this.showLoader = false; 784 this.showLoader = false;
784 }) 785 })
785 .catch((error) => { 786 .catch((error) => {
786 this.showLoader = false; 787 this.showLoader = false;
787 if (error.response.status === 401) { 788 if (error.response.status === 401) {
788 this.$router.replace({ path: "/" }); 789 this.$router.replace({ path: "/" });
789 this.$store.dispatch("setToken", null); 790 this.$store.dispatch("setToken", null);
790 this.$store.dispatch("Id", null); 791 this.$store.dispatch("Id", null);
791 } 792 }
792 }); 793 });
793 }, 794 },
794 getUsersList(role) { 795 getUsersList(role) {
795 this.getSelectUserData = []; 796 this.getSelectUserData = [];
796 this.showLoader = true; 797 this.showLoader = true;
797 var token = this.$store.state.token; 798 var token = this.$store.state.token;
798 http() 799 http()
799 .get("/getUsersList?role=" + role, { 800 .get("/getUsersList?role=" + role, {
800 headers: { Authorization: "Bearer " + token }, 801 headers: { Authorization: "Bearer " + token },
801 }) 802 })
802 .then((response) => { 803 .then((response) => {
803 response.data.data.unshift({ 804 response.data.data.unshift({
804 name: "Select All", 805 name: "Select All",
805 _id: "Select All", 806 _id: "Select All",
806 }); 807 });
807 this.getSelectUserData = response.data.data; 808 this.getSelectUserData = response.data.data;
808 this.showLoader = false; 809 this.showLoader = false;
809 }) 810 })
810 .catch((error) => { 811 .catch((error) => {
811 this.showLoader = false; 812 this.showLoader = false;
812 if (error.response.status === 401) { 813 if (error.response.status === 401) {
813 this.$router.replace({ path: "/" }); 814 this.$router.replace({ path: "/" });
814 this.$store.dispatch("setToken", null); 815 this.$store.dispatch("setToken", null);
815 this.$store.dispatch("Id", null); 816 this.$store.dispatch("Id", null);
816 } 817 }
817 }); 818 });
818 }, 819 },
819 getParentDetails() { 820 getParentDetails() {
820 http() 821 http()
821 .get("getParentsList", { 822 .get("getParentsList", {
822 headers: { 823 headers: {
823 Authorization: "Bearer " + this.$store.state.token, 824 Authorization: "Bearer " + this.$store.state.token,
824 }, 825 },
825 }) 826 })
826 .then((response) => { 827 .then((response) => {
827 this.parentsList = response.data.data; 828 this.parentsList = response.data.data;
828 }) 829 })
829 .catch((error) => { 830 .catch((error) => {
830 // console.log("err====>", error.response.data.message); 831 // console.log("err====>", error.response.data.message);
831 this.showLoader = false; 832 this.showLoader = false;
832 if (error.response.status === 401) { 833 if (error.response.status === 401) {
833 this.$router.replace({ path: "/" }); 834 this.$router.replace({ path: "/" });
834 this.$store.dispatch("setToken", null); 835 this.$store.dispatch("setToken", null);
835 this.$store.dispatch("Id", null); 836 this.$store.dispatch("Id", null);
836 this.$store.dispatch("Role", null); 837 this.$store.dispatch("Role", null);
837 } 838 }
838 }); 839 });
839 }, 840 },
840 }, 841 },
841 }; 842 };
842 </script> 843 </script>
843 844
844 <style scoped> 845 <style scoped>
845 .Data { 846 .Data {
846 width: 100%; 847 width: 100%;
847 float: left; 848 float: left;
848 margin-bottom: 0px; 849 margin-bottom: 0px;
849 padding: 0 15px; 850 padding: 0 15px;
850 font-size: 14px; 851 font-size: 14px;
851 margin-top: 5px; 852 margin-top: 5px;
852 text-align: justify; 853 text-align: justify;
853 } 854 }
854 .idcardreport { 855 .idcardreport {
855 font-family: arial; 856 font-family: arial;
856 max-width: 794px; 857 max-width: 794px;
857 max-height: 1123px; 858 max-height: 1123px;
858 margin-left: auto; 859 margin-left: auto;
859 margin-right: auto; 860 margin-right: auto;
860 -webkit-print-color-adjust: exact; 861 -webkit-print-color-adjust: exact;
861 } 862 }
862 .idcardreport1 { 863 .idcardreport1 {
863 text-align: center; 864 text-align: center;
864 margin-left: 35%; 865 margin-left: 35%;
865 } 866 }
866 .icard-front { 867 .icard-front {
867 margin: 3px; 868 margin: 3px;
868 float: left; 869 float: left;
869 padding: 10px; 870 padding: 10px;
870 text-align: center; 871 text-align: center;
871 /* height: 520px; */ 872 /* height: 520px; */
872 width: 520px; 873 width: 520px;
873 background: #fff; 874 background: #fff;
874 border: 1px solid lightgray; 875 border: 1px solid lightgray;
875 } 876 }
876 .print-data { 877 .print-data {
877 margin: 3px; 878 margin: 3px;
878 float: left; 879 float: left;
879 /* border: 1px solid #000; */ 880 /* border: 1px solid #000; */
880 padding: 10px; 881 padding: 10px;
881 /* width: 55%; */ 882 /* width: 55%; */
882 text-align: center; 883 text-align: center;
883 height: 95%; 884 height: 95%;
884 } 885 }
885 .rightside { 886 .rightside {
886 float: right !important; 887 float: right !important;
887 } 888 }
888 .icard-front h2 { 889 .icard-front h2 {
889 font-size: 30px; 890 font-size: 30px;
890 } 891 }
891 .icard-back h2 { 892 .icard-back h2 {
892 font-size: 30px; 893 font-size: 30px;
893 } 894 }
894 .print-data h2 { 895 .print-data h2 {
895 font-size: 30px; 896 font-size: 30px;
896 text-align: center; 897 text-align: center;
897 } 898 }
898 .print-data img { 899 .print-data img {
899 width: 70px; 900 width: 70px;
900 height: 70px; 901 height: 70px;
901 margin-bottom: 5px; 902 margin-bottom: 5px;
902 } 903 }
903 .icard-front img { 904 .icard-front img {
904 width: 70px; 905 width: 70px;
905 height: 70px; 906 height: 70px;
906 margin-bottom: 5px; 907 margin-bottom: 5px;
907 } 908 }
908 .icard-back img { 909 .icard-back img {
909 width: 50px; 910 width: 50px;
910 height: 50px; 911 height: 50px;
911 margin-bottom: 5px; 912 margin-bottom: 5px;
912 } 913 }
913 .icard-img { 914 .icard-img {
914 width: 50px; 915 width: 50px;
915 height: 50px; 916 height: 50px;
916 margin-bottom: 5px; 917 margin-bottom: 5px;
917 margin-top: 5px; 918 margin-top: 5px;
918 border: 1px solid #ddd; 919 border: 1px solid #ddd;
919 } 920 }
920 .icard-data { 921 .icard-data {
921 /* font-family: Arial; */ 922 /* font-family: Arial; */
922 max-width: 794px; 923 max-width: 794px;
923 max-height: 1123px; 924 max-height: 1123px;
924 margin-left: auto; 925 margin-left: auto;
925 margin-right: auto; 926 margin-right: auto;
926 -webkit-print-color-adjust: exact; 927 -webkit-print-color-adjust: exact;
927 } 928 }
928 .icard-back { 929 .icard-back {
929 margin: 3px; 930 margin: 3px;
930 /* float: left; */ 931 /* float: left; */
931 /* border: 1px solid #000; */ 932 /* border: 1px solid #000; */
932 padding: 10px; 933 padding: 10px;
933 /* width: 55%; */ 934 /* width: 55%; */
934 text-align: center; 935 text-align: center;
935 /* height: 95%; */ 936 /* height: 95%; */
936 /* margin-top: 35%; */ 937 /* margin-top: 35%; */
937 } 938 }
938 .back-icard { 939 .back-icard {
939 margin: 3px; 940 margin: 3px;
940 padding: 10px; 941 padding: 10px;
941 } 942 }
942 .icard-back h3 { 943 .icard-back h3 {
943 background-color: #000; 944 background-color: #000;
944 color: #fff; 945 color: #fff;
945 font-size: 13px; 946 font-size: 13px;
946 padding: 5px 0px; 947 padding: 5px 0px;
947 margin: 5px; 948 margin: 5px;
948 margin-top: 13px; 949 margin-top: 13px;
949 } 950 }
950 .icard-back h5 { 951 .icard-back h5 {
951 font-size: 11px; 952 font-size: 11px;
952 color: #000; 953 color: #000;
953 font-weight: bold; 954 font-weight: bold;
954 padding: 5px 0px; 955 padding: 5px 0px;
955 } 956 }
956 /* .icard-back p { 957 /* .icard-back p {
957 font-size: 15px; 958 font-size: 15px;
958 color: #000; 959 color: #000;
959 font-weight: 500px; 960 font-weight: 500px;
960 line-height: 17px; 961 line-height: 17px;
961 } */ 962 } */
962 .school-address { 963 .school-address {
963 /* width: 40%; */ 964 /* width: 40%; */
964 font-weight: 500px; 965 font-weight: 500px;
965 color: #000; 966 color: #000;
966 } 967 }
967 .address { 968 .address {
968 font-weight: 500px; 969 font-weight: 500px;
969 color: #000; 970 color: #000;
970 text-align: center; 971 text-align: center;
971 } 972 }
972 .icard-bottom { 973 .icard-bottom {
973 padding-top: 5px; 974 padding-top: 5px;
974 text-align: center; 975 text-align: center;
975 } 976 }
976 .qrcode { 977 .qrcode {
977 float: left; 978 float: left;
978 width: 50%; 979 width: 50%;
979 } 980 }
980 .qrcode img { 981 .qrcode img {
981 width: 60px; 982 width: 60px;
982 height: 60px; 983 height: 60px;
983 margin-top: 15px; 984 margin-top: 15px;
984 } 985 }
985 .session { 986 .session {
986 float: right; 987 float: right;
987 width: 70%; 988 width: 70%;
988 margin-top: 15px; 989 margin-top: 15px;
989 } 990 }
990 991
991 @media screen and (max-width: 360px) { 992 @media screen and (max-width: 360px) {
992 .icard-front { 993 .icard-front {
993 width: 316px; 994 width: 316px;
994 height: 418px; 995 height: 418px;
995 float: inherit; 996 float: inherit;
996 } 997 }
997 .icard-back { 998 .icard-back {
998 float: left; 999 float: left;
999 } 1000 }
1000 } 1001 }
1001 </style> 1002 </style>
src/pages/Report/progressCardReport.vue
1 <template> 1 <template>
2 <v-container fluid class="body-color"> 2 <v-container fluid class="body-color">
3 <!-- ****** Progress Card Report Table****** --> 3 <!-- ****** Progress Card Report Table****** -->
4 <v-card flat class="elevation-0 transparent"> 4 <v-card flat class="elevation-0 transparent">
5 <v-form ref="form" v-model="valid" lazy-validation> 5 <v-form ref="form" v-model="valid" lazy-validation>
6 <v-flex xs12 sm12 lg12> 6 <v-flex xs12 sm12 lg12>
7 <v-layout wrap> 7 <v-layout wrap>
8 <v-flex xs12 sm12 lg3> 8 <v-flex xs12 sm12 lg3>
9 <v-layout> 9 <v-layout>
10 <v-flex xs3 sm3 lg2 class="subheading mt-4"> 10 <v-flex xs3 sm3 lg2 class="subheading mt-4">
11 <label class="right">Class:</label> 11 <label class="right">Class:</label>
12 </v-flex> 12 </v-flex>
13 <v-flex xs9 sm6 lg8 class="ml-2"> 13 <v-flex xs9 sm6 lg8 class="ml-2">
14 <v-select 14 <v-select
15 v-model="getReport.classId" 15 v-model="getReport.classId"
16 label="Select your class" 16 label="Select your class"
17 type="text" 17 type="text"
18 :items="classList" 18 :items="classList"
19 item-text="classNum" 19 item-text="classNum"
20 item-value="_id" 20 item-value="_id"
21 :rules="classRules" 21 :rules="classRules"
22 @change="getSections(getReport.classId)" 22 @change="getSections(getReport.classId)"
23 required 23 required
24 ></v-select> 24 ></v-select>
25 </v-flex> 25 </v-flex>
26 </v-layout> 26 </v-layout>
27 </v-flex> 27 </v-flex>
28 <v-flex xs12 sm12 lg3> 28 <v-flex xs12 sm12 lg3>
29 <v-layout> 29 <v-layout>
30 <v-flex xs3 sm3 lg2 class="subheading mt-4"> 30 <v-flex xs3 sm3 lg2 class="subheading mt-4">
31 <label class="right">Section:</label> 31 <label class="right">Section:</label>
32 </v-flex> 32 </v-flex>
33 <v-flex xs9 sm6 lg8 class="ml-2"> 33 <v-flex xs9 sm6 lg8 class="ml-2">
34 <v-select 34 <v-select
35 :items="addSection" 35 :items="addSection"
36 label="Select your Section" 36 label="Select your Section"
37 v-model="getReport.sectionId" 37 v-model="getReport.sectionId"
38 item-text="name" 38 item-text="name"
39 item-value="_id" 39 item-value="_id"
40 name="Select Section" 40 name="Select Section"
41 @change="getStudents" 41 @change="getStudents"
42 :rules="sectionRules" 42 :rules="sectionRules"
43 required 43 required
44 ></v-select> 44 ></v-select>
45 </v-flex> 45 </v-flex>
46 </v-layout> 46 </v-layout>
47 </v-flex> 47 </v-flex>
48 <v-flex xs12 sm12 lg3> 48 <v-flex xs12 sm12 lg3>
49 <v-layout> 49 <v-layout>
50 <v-flex xs3 sm3 lg2 class="subheading mt-4"> 50 <v-flex xs3 sm3 lg2 class="subheading mt-4">
51 <label class="right">Student:</label> 51 <label class="right">Student:</label>
52 </v-flex> 52 </v-flex>
53 <v-flex xs9 sm6 lg8 class="ml-2"> 53 <v-flex xs9 sm6 lg8 class="ml-2">
54 <v-select 54 <v-select
55 :items="getStudentsList" 55 :items="getStudentsList"
56 label="Select your student" 56 label="Select your student"
57 v-model="getReport.studentId" 57 v-model="getReport.studentId"
58 item-text="name" 58 item-text="name"
59 item-value="_id" 59 item-value="_id"
60 :rules="studentRules" 60 :rules="studentRules"
61 required 61 required
62 ></v-select> 62 ></v-select>
63 </v-flex> 63 </v-flex>
64 </v-layout> 64 </v-layout>
65 </v-flex> 65 </v-flex>
66 <v-flex xs12 sm12 lg3> 66 <v-flex xs12 sm12 lg3>
67 <v-btn 67 <v-btn
68 style="margin: auto; 68 style="margin: auto;
69 display: block;" 69 display: block;"
70 @click="getMarkReportList" 70 @click="getMarkReportList"
71 round 71 round
72 dark 72 dark
73 :loading="loading" 73 :loading="loading"
74 class="open-dialog-button mt-3" 74 class="open-dialog-button mt-3"
75 >Get Report</v-btn> 75 >Get Report</v-btn>
76 </v-flex> 76 </v-flex>
77 </v-layout> 77 </v-layout>
78 </v-flex> 78 </v-flex>
79 </v-form> 79 </v-form>
80 </v-card> 80 </v-card>
81 81
82 <v-layout v-show="showReport"> 82 <v-layout v-show="showReport">
83 <v-flex xs12> 83 <v-flex xs12>
84 <v-card class="transparent elevation-0"> 84 <v-card class="transparent elevation-0">
85 <v-container grid-list-md class="report"> 85 <v-container grid-list-md class="report">
86 <v-flex xs12 sm12> 86 <v-flex xs12 sm12>
87 <v-layout wrap> 87 <v-layout wrap>
88 <!-- ****** TABLE DATA MARK ****** --> 88 <!-- ****** TABLE DATA MARK ****** -->
89 <v-flex xs12 sm12 md12> 89 <v-flex xs12 sm12 md12>
90 <v-layout> 90 <v-layout>
91 <v-flex xs12> 91 <v-flex xs12>
92 <v-btn 92 <v-btn
93 class="open-dialog-button" 93 class="open-dialog-button"
94 :loading="printLoader" 94 :loading="printLoader"
95 round 95 round
96 dark 96 dark
97 @click="printProgressReport()" 97 @click="printProgressReport()"
98 > 98 >
99 Print 99 Print
100 <v-icon right dark>print</v-icon> 100 <v-icon right dark>print</v-icon>
101 </v-btn> 101 </v-btn>
102 </v-flex> 102 </v-flex>
103 </v-layout> 103 </v-layout>
104 <div id="printMe"> 104 <div id="printMe">
105 <card class="elevation-0" v-for="(value, id, Index) in filterData" :key="Index"> 105 <card class="elevation-0" v-for="(value, id, Index) in filterData" :key="Index">
106 <v-card 106 <v-card
107 class="ma-3" 107 class="ma-3"
108 style=" 108 style="
109 border: 1px solid lightgrey; 109 border: 1px solid lightgrey;
110 margin-bottom:0px; 110 margin-bottom:0px;
111 padding: 0px" 111 padding: 0px"
112 > 112 >
113 <div style="border: 1px solid lightgray;"> 113 <div style="border: 1px solid lightgray;">
114 <v-layout> 114 <v-layout>
115 <v-flex xs12 sm12 md12> 115 <v-flex xs12 sm12 md12>
116 <div 116 <div
117 style=" 117 style="
118 border-bottom: 1px solid #ddd; 118 border-bottom: 1px solid #ddd;
119 overflow: hidden; 119 overflow: hidden;
120 vertical-align: middle; 120 vertical-align: middle;
121 margin: 10px; 121 margin: 10px;
122 padding-bottom: 0px;" 122 padding-bottom: 0px;"
123 > 123 >
124 <!-- <v-flex xs12 sm12 md12> --> 124 <!-- <v-flex xs12 sm12 md12> -->
125 <v-layout> 125 <v-layout>
126 <div class="school-logo"> 126 <div class="school-logo">
127 <img 127 <img
128 :src="userData.schoolLogoUrl" 128 :src="userData.schoolLogoUrl"
129 v-if="userData.schoolLogoUrl" 129 v-if="userData.schoolLogoUrl"
130 style="width:40px !important;height:40px !important; float: left;" 130 style="width:40px !important;height:40px !important; float: left;"
131 /> 131 />
132 <img 132 <img
133 src="/static/schoolIcons/INTRACK_White.png" 133 src="/static/schoolIcons/INTRACK_White.png"
134 v-else-if="!userData.schoolLogoUrl" 134 v-else-if="!userData.schoolLogoUrl"
135 style="width:40px !important;height:40px !important; float: left;" 135 style="width:40px !important;height:40px !important; float: left;"
136 /> 136 />
137 </div> 137 </div>
138 <div class="school-name"> 138 <div class="school-name">
139 <h3>{{ schoolData.name }}</h3> 139 <h3>{{ schoolData.name }}</h3>
140 </div> 140 </div>
141 </v-layout> 141 </v-layout>
142 <!-- </v-flex> --> 142 <!-- </v-flex> -->
143 </div> 143 </div>
144 <!-- Profile School --> 144 <!-- Profile School -->
145 <v-flex xs12 sm12 md12 lg12 style="margin:0px 0px; "> 145 <v-flex xs12 sm12 md12 lg12 style="margin:0px 0px; ">
146 <v-layout> 146 <v-layout>
147 <div 147 <div
148 style="flex-basis: 40%; 148 style="flex-basis: 40%;
149 -webkit-box-flex: 0; 149 -webkit-box-flex: 0;
150 -ms-flex-positive: 0; 150 -ms-flex-positive: 0;
151 flex-grow: 0; 151 flex-grow: 0;
152 max-width: 40%;" 152 max-width: 40%;"
153 > 153 >
154 <div 154 <div
155 style="padding: 4px; 155 style="padding: 4px;
156 padding-left: 16px !important;" 156 padding-left: 16px !important;"
157 > 157 >
158 <p 158 <p
159 style="font-size:20px;margin-bottom: 0px;" 159 style="font-size:20px;margin-bottom: 0px;"
160 >{{ schoolData.name }}</p> 160 >{{ schoolData.name }}</p>
161 <p 161 <p
162 style="font-size: 15px;color: #707478;margin:0px;margin-bottom:8px;" 162 style="font-size: 15px;color: #707478;margin:0px;margin-bottom:8px;"
163 >{{ schoolData.address }}</p> 163 >{{ schoolData.address }}</p>
164 <p 164 <p
165 style="font-size: 15px;color: #707478;margin:0px;margin-bottom:8px;" 165 style="font-size: 15px;color: #707478;margin:0px;margin-bottom:8px;"
166 >Phone : {{ schoolData.mobile }}</p> 166 >Phone : {{ schoolData.mobile }}</p>
167 <p 167 <p
168 style="font-size: 15px;color: #707478;margin:0px;margin-bottom:8px;" 168 style="font-size: 15px;color: #707478;margin:0px;margin-bottom:8px;"
169 >Email : {{ schoolData.email }}</p> 169 >Email : {{ schoolData.email }}</p>
170 </div> 170 </div>
171 </div> 171 </div>
172 <!-- Profile Student Report Card--> 172 <!-- Profile Student Report Card-->
173 <div 173 <div
174 style="flex-basis: 40%; 174 style="flex-basis: 40%;
175 -webkit-box-flex: 0; 175 -webkit-box-flex: 0;
176 -ms-flex-positive: 0; 176 -ms-flex-positive: 0;
177 flex-grow: 0; 177 flex-grow: 0;
178 max-width: 40%;" 178 max-width: 40%;"
179 > 179 >
180 <div v-for="(studentMark,i,index) in value" :key="index"> 180 <div v-for="(studentMark,i,index) in value" :key="index">
181 <p 181 <p
182 v-if="index == 0" 182 v-if="index == 0"
183 style="font-size:20px;margin-bottom: 0px;" 183 style="font-size:20px;margin-bottom: 0px;"
184 >{{ studentMark[0].studentId.name }}</p> 184 >{{ studentMark[0].studentId.name }}</p>
185 <p 185 <p
186 v-if="index == 0" 186 v-if="index == 0"
187 style="font-size: 15px;color: #707478;margin:0px;margin-bottom:8px;" 187 style="font-size: 15px;color: #707478;margin:0px;margin-bottom:8px;"
188 > 188 >
189 Class : 189 Class :
190 <b>{{ studentMark[0].classId.classNum }}</b> 190 <b>{{ studentMark[0].classId.classNum }}</b>
191 </p> 191 </p>
192 <p 192 <p
193 v-if="index == 0" 193 v-if="index == 0"
194 style="font-size: 15px;color: #707478;margin:0px;margin-bottom:8px;" 194 style="font-size: 15px;color: #707478;margin:0px;margin-bottom:8px;"
195 > 195 >
196 Section : 196 Section :
197 <b>{{ studentMark[0].sectionId.name }}</b> 197 <b>{{ studentMark[0].sectionId.name }}</b>
198 </p> 198 </p>
199 <p 199 <p
200 v-if="index == 0" 200 v-if="index == 0"
201 style="font-size: 15px;color: #707478;margin:0px;margin-bottom:8px;" 201 style="font-size: 15px;color: #707478;margin:0px;margin-bottom:8px;"
202 > 202 >
203 Roll NO : 203 Roll NO :
204 <b>{{ studentMark[0].studentId.rollNo }}</b> 204 <b>{{ studentMark[0].studentId.rollNo }}</b>
205 </p> 205 </p>
206 </div> 206 </div>
207 </div> 207 </div>
208 <div 208 <div
209 style=" 209 style="
210 -ms-flex-preferred-size: 20%; 210 -ms-flex-preferred-size: 20%;
211 flex-basis: 20%; 211 flex-basis: 20%;
212 -webkit-box-flex: 0; 212 -webkit-box-flex: 0;
213 -ms-flex-positive: 0; 213 -ms-flex-positive: 0;
214 flex-grow: 0; 214 flex-grow: 0;
215 max-width: 20%;" 215 max-width: 20%;"
216 > 216 >
217 <div v-for="(studentMark,i,index) in value" :key="index"> 217 <div v-for="(studentMark,i,index) in value" :key="index">
218 <div 218 <div
219 style="padding-top:16px" 219 style="padding-top:16px"
220 v-if="index == 0" 220 v-if="index == 0"
221 class="hidden-sm-only hidden-xs-only" 221 class="hidden-sm-only hidden-xs-only"
222 > 222 >
223 <img 223 <img
224 src="/static/icon/user.png" 224 src="/static/icon/user.png"
225 v-if="!studentMark[0].studentId.profilePicUrl" 225 v-if="!studentMark[0].studentId.profilePicUrl"
226 style="width:60px;height:60px;" 226 style="width:60px;height:60px;"
227 /> 227 />
228 <img 228 <img
229 :src="studentMark[0].studentId.profilePicUrl" 229 :src="studentMark[0].studentId.profilePicUrl"
230 v-else-if="studentMark[0].studentId.profilePicUrl" 230 v-else-if="studentMark[0].studentId.profilePicUrl"
231 style="width:60px;height:60px;" 231 style="width:60px;height:60px;"
232 /> 232 />
233 </div> 233 </div>
234 </div> 234 </div>
235 </div> 235 </div>
236 </v-layout> 236 </v-layout>
237 </v-flex> 237 </v-flex>
238 </v-flex> 238 </v-flex>
239 </v-layout> 239 </v-layout>
240 <v-card 240 <v-card
241 v-for="studentMarks in value" 241 v-for="studentMarks in value"
242 :key="studentMarks" 242 :key="studentMarks"
243 style=" 243 style="
244 background-color: #fff; 244 background-color: #fff;
245 border-color: #fff; 245 border-color: #fff;
246 color: rgba(0,0,0,0.87); 246 color: rgba(0,0,0,0.87);
247 overflow-x: auto; 247 overflow-x: auto;
248 display: block; 248 display: block;
249 webkit-box-shadow: 0px 0px 0px 0px rgba(0,0,0,0.2), 0px 0px 0px 0px rgba(0,0,0,0.14), 0px 0px 0px 0px rgba(0,0,0,0.12) !important; 249 webkit-box-shadow: 0px 0px 0px 0px rgba(0,0,0,0.2), 0px 0px 0px 0px rgba(0,0,0,0.14), 0px 0px 0px 0px rgba(0,0,0,0.12) !important;
250 box-shadow: 0px 0px 0px 0px rgba(0,0,0,0.2), 0px 0px 0px 0px rgba(0,0,0,0.14), 0px 0px 0px 0px rgba(0,0,0,0.12) !important;" 250 box-shadow: 0px 0px 0px 0px rgba(0,0,0,0.2), 0px 0px 0px 0px rgba(0,0,0,0.14), 0px 0px 0px 0px rgba(0,0,0,0.12) !important;"
251 > 251 >
252 <table 252 <table
253 v-for="(studentMark,key) in studentMarks" 253 v-for="(studentMark,key) in studentMarks"
254 :key="key" 254 :key="key"
255 class="tableRsponsive feeTypeTable subheading" 255 class="tableRsponsive feeTypeTable subheading"
256 style="border: 1px solid black; 256 style="border: 1px solid black;
257 border-collapse: collapse;!important 257 border-collapse: collapse;!important
258 table-layout: auto !important; 258 table-layout: auto !important;
259 width: 100% !important; 259 width: 100% !important;
260 overflow: hidden;" 260 overflow: hidden;"
261 > 261 >
262 <thead 262 <thead
263 style="border: 1px solid transparent !important" 263 style="border: 1px solid transparent !important"
264 v-if="key == 0" 264 v-if="key == 0"
265 > 265 >
266 <tr style="border: 1px solid transparent !important"> 266 <tr style="border: 1px solid transparent !important">
267 <td 267 <td
268 colspan="4" 268 colspan="4"
269 style="text-align: inherit !important; 269 style="text-align: inherit !important;
270 border-right: inherit; 270 border-right: inherit;
271 border-top: inherit; 271 border-top: inherit;
272 padding:14px;" 272 padding:14px;"
273 >{{studentMark.examId.examName}}</td> 273 >{{studentMark.examId.examName}}</td>
274 </tr> 274 </tr>
275 <tr style="border: 1px solid lightgrey !important;padding:4px;"> 275 <tr style="border: 1px solid lightgrey !important;padding:4px;">
276 <td 276 <td
277 rowspan="2" 277 rowspan="2"
278 style="border: 1px solid lightgrey !important;padding: 0px;" 278 style="border: 1px solid lightgrey !important;padding: 0px;"
279 >Subject</td> 279 >Subject</td>
280 <template> 280 <template>
281 <td 281 <td
282 v-for="(studentMarkData,i) in studentMark.studentsMarks" 282 v-for="(studentMarkData,i) in studentMark.studentsMarks"
283 :key="i" 283 :key="i"
284 colspan="2" 284 colspan="2"
285 style="border: 1px solid lightgrey !important;padding: 0px;" 285 style="border: 1px solid lightgrey !important;padding: 0px;"
286 >{{studentMarkData.markDistributionId.distributionType}}</td> 286 >{{studentMarkData.markDistributionId.distributionType}}</td>
287 <td 287 <td
288 style="border: 1px solid lightgrey !important;padding: 0px;" 288 style="border: 1px solid lightgrey !important;padding: 0px;"
289 >Total Marks</td> 289 >Total Marks</td>
290 </template> 290 </template>
291 </tr> 291 </tr>
292 <tr style="border: 1px solid lightgrey !important;"> 292 <tr style="border: 1px solid lightgrey !important;">
293 <template v-for="(exam, ind) in studentMark.studentsMarks"> 293 <template v-for="(exam, ind) in studentMark.studentsMarks">
294 <td 294 <td
295 :key="ind" 295 :key="ind"
296 style="border: 1px solid lightgrey !important;padding: 0px;" 296 style="border: 1px solid lightgrey !important;padding: 0px;"
297 >Marks</td> 297 >Marks</td>
298 <td 298 <td
299 :key="ind" 299 :key="ind"
300 style="border: 1px solid lightgrey !important;padding: 0px;" 300 style="border: 1px solid lightgrey !important;padding: 0px;"
301 >Highest Marks</td> 301 >Highest Marks</td>
302 </template> 302 </template>
303 </tr> 303 </tr>
304 </thead> 304 </thead>
305 <tbody 305 <tbody
306 style="border: 1px solid lightgrey !important;" 306 style="border: 1px solid lightgrey !important;"
307 v-if="key == 0" 307 v-if="key == 0"
308 > 308 >
309 <tr v-for="studentMark in studentMarks" :key="studentMark"> 309 <tr v-for="studentMark in studentMarks" :key="studentMark">
310 <td 310 <td
311 style="border: 1px solid lightgrey !important;padding: 0px;" 311 style="border: 1px solid lightgrey !important;padding: 0px;"
312 >{{studentMark.subjectName}}</td> 312 >{{studentMark.subjectName}}</td>
313 <template v-for="(exam, index) in studentMark.studentsMarks"> 313 <template v-for="(exam, index) in studentMark.studentsMarks">
314 <td 314 <td
315 :key="index" 315 :key="index"
316 style="border: 1px solid lightgrey !important;padding: 0px;" 316 style="border: 1px solid lightgrey !important;padding: 0px;"
317 >{{exam.marksScored}}</td> 317 >{{exam.marksScored}}</td>
318 <td 318 <td
319 :key="index" 319 :key="index"
320 style="border: 1px solid lightgrey !important;padding: 0px;" 320 style="border: 1px solid lightgrey !important;padding: 0px;"
321 >{{exam.markDistributionId.markValue}}</td> 321 >{{exam.markDistributionId.markValue}}</td>
322 </template> 322 </template>
323 <td 323 <td
324 style="border: 1px solid lightgrey !important;padding: 0px;" 324 style="border: 1px solid lightgrey !important;padding: 0px;"
325 >{{studentMark.totalMarks}}</td> 325 >{{studentMark.totalMarks}}</td>
326 </tr> 326 </tr>
327 </tbody> 327 </tbody>
328 <tfoot v-if="key == studentMarks.length - 1"> 328 <tfoot v-if="key == studentMarks.length - 1">
329 <tr style="border: 1px solid lightgrey !important;"> 329 <tr style="border: 1px solid lightgrey !important;">
330 <td 330 <td
331 colspan="5" 331 colspan="5"
332 class="subheding" 332 class="subheding"
333 style=" 333 style="
334 border: 1px solid #e2e7eb; 334 border: 1px solid #e2e7eb;
335 text-align:center 335 text-align:center
336 padding: 0px;" 336 padding: 0px;"
337 >Total Marks</td> 337 >Total Marks</td>
338 <td 338 <td
339 colspan="7" 339 colspan="7"
340 style="border: 1px solid lightgrey !important;padding: 0px;" 340 style="border: 1px solid lightgrey !important;padding: 0px;"
341 >{{ studentMark.allSubjectTotalMarks }}</td> 341 >{{ studentMark.allSubjectTotalMarks }}</td>
342 </tr> 342 </tr>
343 <tr> 343 <tr>
344 <td 344 <td
345 colspan="5" 345 colspan="5"
346 class="subheding" 346 class="subheding"
347 style=" 347 style="
348 border: 1px solid #e2e7eb; 348 border: 1px solid #e2e7eb;
349 text-align:center 349 text-align:center
350 padding: 0px;" 350 padding: 0px;"
351 >Grade</td> 351 >Grade</td>
352 <td 352 <td
353 colspan="7" 353 colspan="7"
354 style="border: 1px solid lightgrey !important;padding: 0px;" 354 style="border: 1px solid lightgrey !important;padding: 0px;"
355 >{{ studentMark.grade ? studentMark.grade : "-" }}</td> 355 >{{ studentMark.grade ? studentMark.grade : "-" }}</td>
356 </tr> 356 </tr>
357 <tr> 357 <tr>
358 <td 358 <td
359 colspan="5" 359 colspan="5"
360 style=" 360 style="
361 border: 1px solid #e2e7eb; 361 border: 1px solid #e2e7eb;
362 text-align:center 362 text-align:center
363 padding: 0px;" 363 padding: 0px;"
364 class="subheding" 364 class="subheding"
365 >Average Mark</td> 365 >Average Mark</td>
366 <td 366 <td
367 colspan="7" 367 colspan="7"
368 style="border: 1px solid lightgrey !important;padding: 0px;" 368 style="border: 1px solid lightgrey !important;padding: 0px;"
369 >-</td> 369 >-</td>
370 </tr> 370 </tr>
371 <tr> 371 <tr>
372 <td 372 <td
373 colspan="5" 373 colspan="5"
374 style=" 374 style="
375 border: 1px solid #e2e7eb; 375 border: 1px solid #e2e7eb;
376 text-align:center 376 text-align:center
377 padding: 0px; !important; 377 padding: 0px; !important;
378 font-size: 16px !important;" 378 font-size: 16px !important;"
379 class="subheding" 379 class="subheding"
380 >GPA</td> 380 >GPA</td>
381 <td 381 <td
382 colspan="7" 382 colspan="7"
383 style="border: 1px solid lightgrey !important;padding: 0px !important;font-size: 16px !important;" 383 style="border: 1px solid lightgrey !important;padding: 0px !important;font-size: 16px !important;"
384 >-</td> 384 >-</td>
385 </tr> 385 </tr>
386 </tfoot> 386 </tfoot>
387 </table> 387 </table>
388 </v-card> 388 </v-card>
389 </div> 389 </div>
390 </v-card> 390 </v-card>
391 <p style="page-break-after: always;">&nbsp;</p> 391 <p style="page-break-after: always;">&nbsp;</p>
392 </card> 392 </card>
393 </div> 393 </div>
394 </v-flex> 394 </v-flex>
395 </v-layout> 395 </v-layout>
396 </v-flex> 396 </v-flex>
397 </v-container> 397 </v-container>
398 </v-card> 398 </v-card>
399 </v-flex> 399 </v-flex>
400 </v-layout> 400 </v-layout>
401 <div class="loader" v-if="showLoader"> 401 <div class="loader" v-if="showLoader">
402 <v-progress-circular indeterminate color="white"></v-progress-circular> 402 <v-progress-circular indeterminate color="white"></v-progress-circular>
403 </div> 403 </div>
404 </v-container> 404 </v-container>
405 </template> 405 </template>
406 406
407 <script> 407 <script>
408 import http from "@/Services/http.js"; 408 import http from "@/Services/http.js";
409 import moment from "moment"; 409 import moment from "moment";
410 import _ from "underscore"; 410 import _ from "underscore";
411 411
412 export default { 412 export default {
413 data: () => ({ 413 data: () => ({
414 showLoader: false, 414 showLoader: false,
415 cardData: [], 415 cardData: [],
416 token: "", 416 token: "",
417 markDistributions: [], 417 markDistributions: [],
418 markParticularDistributionData: [], 418 markParticularDistributionData: [],
419 loading: false, 419 loading: false,
420 valid: true, 420 valid: true,
421 loading: false, 421 loading: false,
422 showReport: false, 422 showReport: false,
423 printLoader: false, 423 printLoader: false,
424 addSection: [], 424 addSection: [],
425 filterData: [], 425 filterData: [],
426 getStudentsList: [], 426 getStudentsList: [],
427 classRules: [(v) => !!v || "Class is required"], 427 classRules: [(v) => !!v || "Class is required"],
428 sectionRules: [(v) => !!v || "Class is required"], 428 sectionRules: [(v) => !!v || "Section is required"],
429 studentRules: [(v) => !!v || "Student is required"], 429 studentRules: [(v) => !!v || "Student is required"],
430 getReport: {}, 430 getReport: {},
431 classList: [], 431 classList: [],
432 output: null, 432 output: null,
433 userData: {}, 433 userData: {},
434 newData: [], 434 newData: [],
435 gradeAPlus: "A+", 435 gradeAPlus: "A+",
436 gradeA: "A", 436 gradeA: "A",
437 gradeBPlus: "B+", 437 gradeBPlus: "B+",
438 gradeB: "B", 438 gradeB: "B",
439 gradeCPlus: "C+", 439 gradeCPlus: "C+",
440 gradeC: "C", 440 gradeC: "C",
441 totalMarks: "", 441 totalMarks: "",
442 }), 442 }),
443 mounted() { 443 mounted() {
444 this.token = this.$store.state.token; 444 this.token = this.$store.state.token;
445 this.getClass(); 445 this.getClass();
446 this.getUserData(); 446 this.getUserData();
447 }, 447 },
448 methods: { 448 methods: {
449 clear() { 449 clear() {
450 this.$refs.form.reset(); 450 this.$refs.form.reset();
451 }, 451 },
452 getClass() { 452 getClass() {
453 this.showLoader = true; 453 this.showLoader = true;
454 http() 454 http()
455 .get("/getClassesList", { 455 .get("/getClassesList", {
456 headers: { Authorization: "Bearer " + this.token }, 456 headers: { Authorization: "Bearer " + this.token },
457 }) 457 })
458 .then((response) => { 458 .then((response) => {
459 this.classList = response.data.data; 459 this.classList = response.data.data;
460 this.showLoader = false; 460 this.showLoader = false;
461 }) 461 })
462 .catch((error) => { 462 .catch((error) => {
463 this.showLoader = false; 463 this.showLoader = false;
464 // console.log("err====>", err); 464 // console.log("err====>", err);
465 }); 465 });
466 }, 466 },
467 getSections(_id) { 467 getSections(_id) {
468 this.showLoader = true; 468 this.showLoader = true;
469 this.cardData = [];
470 this.schoolData = [];
471 this.showReport = false;
472 this.filterData = [];
469 http() 473 http()
470 .get( 474 .get(
471 "/getSectionsList", 475 "/getSectionsList",
472 { params: { classId: _id } }, 476 { params: { classId: _id } },
473 { 477 {
474 headers: { Authorization: "Bearer " + this.token }, 478 headers: { Authorization: "Bearer " + this.token },
475 } 479 }
476 ) 480 )
477 .then((response) => { 481 .then((response) => {
478 this.addSection = response.data.data; 482 this.addSection = response.data.data;
479 this.showLoader = false; 483 this.showLoader = false;
480 }) 484 })
481 .catch((err) => { 485 .catch((err) => {
482 this.showLoader = false; 486 this.showLoader = false;
483 // console.log("err====>", err); 487 // console.log("err====>", err);
484 }); 488 });
485 }, 489 },
486 getStudents() { 490 getStudents() {
487 this.showLoader = true; 491 this.showLoader = true;
488 http() 492 http()
489 .get("/getStudentWithClass", { 493 .get("/getStudentWithClass", {
490 params: { 494 params: {
491 classId: this.getReport.classId, 495 classId: this.getReport.classId,
492 sectionId: this.getReport.sectionId, 496 sectionId: this.getReport.sectionId,
493 }, 497 },
494 }) 498 })
495 .then((response) => { 499 .then((response) => {
496 response.data.data.unshift({ 500 response.data.data.unshift({
497 name: "Select All", 501 name: "Select All",
498 _id: "Select All", 502 _id: "Select All",
499 }); 503 });
500 this.getStudentsList = response.data.data; 504 this.getStudentsList = response.data.data;
501 this.showLoader = false; 505 this.showLoader = false;
502 }) 506 })
503 .catch((error) => { 507 .catch((error) => {
504 // console.log("err====>", error); 508 // console.log("err====>", error);
505 this.showLoader = false; 509 this.showLoader = false;
506 this.snackbar = true; 510 this.snackbar = true;
507 this.color = "error"; 511 this.color = "error";
508 this.text = error.response.data.message; 512 this.text = error.response.data.message;
509 }); 513 });
510 }, 514 },
511 getMarkReportList() { 515 getMarkReportList() {
512 this.showLoader = true; 516 this.showLoader = true;
513 this.showReport = true; 517 this.showReport = true;
514 var getSelectMarks = {}; 518 var getSelectMarks = {};
515 if (this.getReport.studentId == "Select All") { 519 if (this.getReport.studentId == "Select All") {
516 getSelectMarks = { 520 getSelectMarks = {
517 classId: this.getReport.classId, 521 classId: this.getReport.classId,
518 sectionId: this.getReport.sectionId, 522 sectionId: this.getReport.sectionId,
519 }; 523 };
520 } else if (this.getReport.studentId != "Select All") { 524 } else if (this.getReport.studentId != "Select All") {
521 getSelectMarks = { 525 getSelectMarks = {
522 classId: this.getReport.classId, 526 classId: this.getReport.classId,
523 sectionId: this.getReport.sectionId, 527 sectionId: this.getReport.sectionId,
524 studentId: this.getReport.studentId, 528 studentId: this.getReport.studentId,
525 }; 529 };
526 } 530 }
527 http() 531 http()
528 .get("/getParticularMark", { 532 .get("/getParticularMark", {
529 params: getSelectMarks, 533 params: getSelectMarks,
530 headers: { Authorization: "Bearer " + this.token }, 534 headers: { Authorization: "Bearer " + this.token },
531 }) 535 })
532 .then((response) => { 536 .then((response) => {
533 // console.log("===response===", response.data.data[0].schoolId); 537 // console.log("===response===", response.data.data[0].schoolId);
534 this.cardData = response.data.data; 538 this.cardData = response.data.data;
535 this.schoolData = response.data.data[0].schoolId; 539 this.schoolData = response.data.data[0].schoolId;
536 let newData = response.data.data; 540 let newData = response.data.data;
537 for (var i = 0; i < newData.length; i++) { 541 for (var i = 0; i < newData.length; i++) {
538 newData[i].examination = newData[i].examId._id; 542 newData[i].examination = newData[i].examId._id;
539 newData[i].studentsId = newData[i].studentId._id; 543 newData[i].studentsId = newData[i].studentId._id;
540 } 544 }
541 var studentMarkArray = []; 545 var studentMarkArray = [];
542 studentMarkArray = _.groupBy(newData, ["studentsId"]); 546 studentMarkArray = _.groupBy(newData, ["studentsId"]);
543 for (let data in studentMarkArray) { 547 for (let data in studentMarkArray) {
544 studentMarkArray[data] = _.groupBy(studentMarkArray[data], [ 548 studentMarkArray[data] = _.groupBy(studentMarkArray[data], [
545 "examination", 549 "examination",
546 ]); 550 ]);
547 } 551 }
548 this.filterData = studentMarkArray; 552 this.filterData = studentMarkArray;
549 for (let data in this.filterData) { 553 for (let data in this.filterData) {
550 for (let item in this.filterData[data]) { 554 for (let item in this.filterData[data]) {
551 var allSubjectTotalMarks = 0; 555 var allSubjectTotalMarks = 0;
552 for (let i = 0; i < this.filterData[data][item].length; i++) { 556 for (let i = 0; i < this.filterData[data][item].length; i++) {
553 var totalMarks = 0; 557 var totalMarks = 0;
554 for ( 558 for (
555 let j = 0; 559 let j = 0;
556 j < studentMarkArray[data][item][i].studentsMarks.length; 560 j < studentMarkArray[data][item][i].studentsMarks.length;
557 j++ 561 j++
558 ) { 562 ) {
559 totalMarks += 563 totalMarks +=
560 studentMarkArray[data][item][i].studentsMarks[j] 564 studentMarkArray[data][item][i].studentsMarks[j]
561 .marksScored; 565 .marksScored;
562 } 566 }
563 this.filterData[data][item][i].totalMarks = totalMarks; 567 this.filterData[data][item][i].totalMarks = totalMarks;
564 568
565 allSubjectTotalMarks += this.filterData[data][item][i] 569 allSubjectTotalMarks += this.filterData[data][item][i]
566 .totalMarks; 570 .totalMarks;
567 this.filterData[data][item][ 571 this.filterData[data][item][
568 i 572 i
569 ].allSubjectTotalMarks = allSubjectTotalMarks; 573 ].allSubjectTotalMarks = allSubjectTotalMarks;
570 } 574 }
571 575
572 // this.totalMarks = totalMarks; 576 // this.totalMarks = totalMarks;
573 if (totalMarks > 90) { 577 if (totalMarks > 90) {
574 this.filterData[data][item].grade = this.gradeAPlus; 578 this.filterData[data][item].grade = this.gradeAPlus;
575 } else if (totalMarks > 80 && totalMarks < 90) { 579 } else if (totalMarks > 80 && totalMarks < 90) {
576 this.filterData[data][item].grade = this.gradeA; 580 this.filterData[data][item].grade = this.gradeA;
577 } else if (totalMarks > 70 && totalMarks < 80) { 581 } else if (totalMarks > 70 && totalMarks < 80) {
578 this.filterData[data][item].grade = this.gradeBPlus; 582 this.filterData[data][item].grade = this.gradeBPlus;
579 } else if (totalMarks > 60 && totalMarks < 70) { 583 } else if (totalMarks > 60 && totalMarks < 70) {
580 this.filterData[data][item].grade = this.gradeB; 584 this.filterData[data][item].grade = this.gradeB;
581 } else if (totalMarks > 50 && totalMarks < 60) { 585 } else if (totalMarks > 50 && totalMarks < 60) {
582 this.filterData[data][item].grade = this.gradeCPlus; 586 this.filterData[data][item].grade = this.gradeCPlus;
583 } else if (totalMarks > 40 && totalMarks < 50) { 587 } else if (totalMarks > 40 && totalMarks < 50) {
584 this.filterData[data][item].grade = this.gradeC; 588 this.filterData[data][item].grade = this.gradeC;
585 } 589 }
586 } 590 }
587 } 591 }
588 // console.log("this.filterData-----------last", this.filterData); 592 // console.log("this.filterData-----------last", this.filterData);
589 593
590 this.showLoader = false; 594 this.showLoader = false;
591 }) 595 })
592 .catch((error) => { 596 .catch((error) => {
593 // console.log("err====>", err); 597 // console.log("err====>", err);
594 this.showLoader = false; 598 this.showLoader = false;
595 this.snackbar = true; 599 this.snackbar = true;
596 // this.text = error.response.data.message; 600 // this.text = error.response.data.message;
597 // if (error.response.status === 401) { 601 // if (error.response.status === 401) {
598 // this.$router.replace({ path: "/" }); 602 // this.$router.replace({ path: "/" });
599 // this.$store.dispatch("setToken", null); 603 // this.$store.dispatch("setToken", null);
600 // this.$store.dispatch("Id", null); 604 // this.$store.dispatch("Id", null);
601 // } 605 // }
602 }); 606 });
603 }, 607 },
604 printProgressReport() { 608 printProgressReport() {
605 this.printLoader = true; 609 this.printLoader = true;
606 setTimeout(() => { 610 setTimeout(() => {
607 // Pass the element id here 611 // Pass the element id here
608 this.$htmlToPaper("printMe"); 612 this.$htmlToPaper("printMe");
609 this.printLoader = false; 613 this.printLoader = false;
610 }, 4000); 614 }, 4000);
611 }, 615 },
612 getUserData() { 616 getUserData() {
613 http() 617 http()
614 .get("/getParticularUserDetail") 618 .get("/getParticularUserDetail")
615 .then((response) => { 619 .then((response) => {
616 this.userData = response.data.data; 620 this.userData = response.data.data;
617 }) 621 })
618 .catch((error) => { 622 .catch((error) => {
619 if (error.response.status === 401) { 623 if (error.response.status === 401) {
620 this.$router.replace({ path: "/" }); 624 this.$router.replace({ path: "/" });
621 this.$store.dispatch("setToken", null); 625 this.$store.dispatch("setToken", null);
622 this.$store.dispatch("Id", null); 626 this.$store.dispatch("Id", null);
623 } 627 }
624 }); 628 });
625 }, 629 },
626 }, 630 },
627 }; 631 };
628 </script> 632 </script>
629 633
630 <style scoped> 634 <style scoped>
631 table { 635 table {
632 border-collapse: collapse; 636 border-collapse: collapse;
633 border: 1px solid #e2e7eb; 637 border: 1px solid #e2e7eb;
634 } 638 }
635 639
636 th, 640 th,
637 td { 641 td {
638 border: 1px solid #e2e7eb; 642 border: 1px solid #e2e7eb;
639 padding: 0px; 643 padding: 0px;
640 text-align: center; 644 text-align: center;
641 } 645 }
642 table.feeTypeTable { 646 table.feeTypeTable {
643 table-layout: auto !important; 647 table-layout: auto !important;
644 width: 100% !important; 648 width: 100% !important;
645 } 649 }
646 .bg-sky { 650 .bg-sky {
647 background-color: #98b2cc !important; 651 background-color: #98b2cc !important;
648 } 652 }
649 .bg-sky-light { 653 .bg-sky-light {
650 background-color: #89a0b8; 654 background-color: #89a0b8;
651 } 655 }
652 .bg-purple { 656 .bg-purple {
653 background-color: #9583ac; 657 background-color: #9583ac;
654 } 658 }
655 .bg-skyDark { 659 .bg-skyDark {
656 background-color: #956785; 660 background-color: #956785;
657 } 661 }
658 662
659 /* .report { 663 /* .report {
660 overflow: hidden; 664 overflow: hidden;
661 max-width: 794px; 665 max-width: 794px;
662 margin: 0px auto; 666 margin: 0px auto;
663 margin-bottom: 10px; 667 margin-bottom: 10px;
664 padding: 30px; 668 padding: 30px;
665 } */ 669 } */
666 .line { 670 .line {
667 border-bottom: 1px solid #ddd; 671 border-bottom: 1px solid #ddd;
668 overflow: hidden; 672 overflow: hidden;
669 padding-bottom: 10px; 673 padding-bottom: 10px;
670 vertical-align: middle; 674 vertical-align: middle;
671 margin-bottom: 4px; 675 margin-bottom: 4px;
672 } 676 }
673 .school-logo { 677 .school-logo {
674 float: left; 678 float: left;
675 } 679 }
676 .school-name { 680 .school-name {
677 box-sizing: border-box; 681 box-sizing: border-box;
678 } 682 }
679 .school-info { 683 .school-info {
680 width: 100%; 684 width: 100%;
681 overflow: hidden; 685 overflow: hidden;
682 } 686 }
683 .school-address { 687 .school-address {
684 float: left; 688 float: left;
685 width: 40%; 689 width: 40%;
686 } 690 }
687 .student-data { 691 .student-data {
688 float: right; 692 float: right;
689 width: 40%; 693 width: 40%;
690 } 694 }
691 .student-info { 695 .student-info {
692 float: left; 696 float: left;
693 } 697 }
694 @media screen and (max-width: 380px) { 698 @media screen and (max-width: 380px) {
695 .tableRsponsive { 699 .tableRsponsive {
696 /* display: block; */ 700 /* display: block; */
697 position: relative; 701 position: relative;
698 overflow: scroll; 702 overflow: scroll;
699 } 703 }
700 } 704 }
701 </style> s 705 </style> s
src/pages/Students/students.vue
1 <template> 1 <template>
2 <v-container fluid class="body-color"> 2 <v-container fluid class="body-color">
3 <!-- ****** EDITS STUDENTS DETAILS ****** --> 3 <!-- ****** EDITS STUDENTS DETAILS ****** -->
4 <v-dialog v-model="editStudentDialog" max-width="1700px" scrollable persistent> 4 <v-dialog v-model="editStudentDialog" max-width="1700px" scrollable persistent>
5 <v-card flat class="card-style pa-2" dark> 5 <v-card flat class="card-style pa-2" dark>
6 <v-layout> 6 <v-layout>
7 <v-flex xs12> 7 <v-flex xs12>
8 <label class="title text-xs-center">Edit Student Details</label> 8 <label class="title text-xs-center">Edit Student Details</label>
9 <v-icon size="24" class="right" @click="editStudentDialog = false">cancel</v-icon> 9 <v-icon size="24" class="right" @click="editStudentDialog = false">cancel</v-icon>
10 </v-flex> 10 </v-flex>
11 </v-layout> 11 </v-layout>
12 <v-card-text> 12 <v-card-text>
13 <v-form ref="form"> 13 <v-form ref="form">
14 <v-container fluid> 14 <v-container fluid>
15 <v-layout> 15 <v-layout>
16 <v-flex xs12 class="text-xs-center text-sm-center text-md-center text-lg-center"> 16 <v-flex xs12 class="text-xs-center text-sm-center text-md-center text-lg-center">
17 <v-avatar size="100px" v-if="!editedItem.profilePicUrl && !editImageUrl"> 17 <v-avatar size="100px" v-if="!editedItem.profilePicUrl && !editImageUrl">
18 <img src="/static/icon/user.png" /> 18 <img src="/static/icon/user.png" />
19 </v-avatar> 19 </v-avatar>
20 <img 20 <img
21 :src="editedItem.profilePicUrl" 21 :src="editedItem.profilePicUrl"
22 v-else-if="editedItem.profilePicUrl && !editImageUrl" 22 v-else-if="editedItem.profilePicUrl && !editImageUrl"
23 height="150" 23 height="150"
24 style="border-radius:50%; width:150px" 24 style="border-radius:50%; width:150px"
25 /> 25 />
26 <img 26 <img
27 v-if="editImageUrl" 27 v-if="editImageUrl"
28 :src="editImageUrl" 28 :src="editImageUrl"
29 style="border-radius:50%; width:150px;height:150px" 29 style="border-radius:50%; width:150px;height:150px"
30 /> 30 />
31 <input 31 <input
32 type="file" 32 type="file"
33 style="display: none" 33 style="display: none"
34 ref="editDataImage" 34 ref="editDataImage"
35 accept="image/*" 35 accept="image/*"
36 @change="onEditFilePicked" 36 @change="onEditFilePicked"
37 /> 37 />
38 </v-flex> 38 </v-flex>
39 </v-layout> 39 </v-layout>
40 <v-layout wrap> 40 <v-layout wrap>
41 <v-flex xs12 sm4> 41 <v-flex xs12 sm4>
42 <v-layout> 42 <v-layout>
43 <v-flex xs4 class="pt-4 subheading"> 43 <v-flex xs4 class="pt-4 subheading">
44 <label class="right hidden-xs-only hidden-sm-only">Select Class:</label> 44 <label class="right hidden-xs-only hidden-sm-only">Select Class:</label>
45 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Class:</label> 45 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Class:</label>
46 </v-flex> 46 </v-flex>
47 <v-flex xs8 class="ml-3"> 47 <v-flex xs8 class="ml-3">
48 <v-select 48 <v-select
49 :items="addclass" 49 :items="addclass"
50 label="Select Class" 50 label="Select Class"
51 v-model="editedItem.select" 51 v-model="editedItem.select"
52 item-text="classNum" 52 item-text="classNum"
53 item-value="_id" 53 item-value="_id"
54 name="Select Class" 54 name="Select Class"
55 @change="getSections(editedItem.select)" 55 @change="getSections(editedItem.select)"
56 required 56 required
57 ></v-select> 57 ></v-select>
58 </v-flex> 58 </v-flex>
59 </v-layout> 59 </v-layout>
60 </v-flex> 60 </v-flex>
61 <v-flex xs12 sm4> 61 <v-flex xs12 sm4>
62 <v-layout> 62 <v-layout>
63 <v-flex xs4 class="pt-4 subheading"> 63 <v-flex xs4 class="pt-4 subheading">
64 <label class="right hidden-xs-only hidden-sm-only">Select Section:</label> 64 <label class="right hidden-xs-only hidden-sm-only">Select Section:</label>
65 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Section:</label> 65 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Section:</label>
66 </v-flex> 66 </v-flex>
67 <v-flex xs8 class="ml-3"> 67 <v-flex xs8 class="ml-3">
68 <v-select 68 <v-select
69 :items="addSection" 69 :items="addSection"
70 label="Select Section" 70 label="Select Section"
71 v-model="editedItem.selectSection" 71 v-model="editedItem.selectSection"
72 item-text="name" 72 item-text="name"
73 item-value="_id" 73 item-value="_id"
74 name="Select Section" 74 name="Select Section"
75 required 75 required
76 ></v-select> 76 ></v-select>
77 </v-flex> 77 </v-flex>
78 </v-layout> 78 </v-layout>
79 </v-flex> 79 </v-flex>
80 <v-flex xs12 sm4> 80 <v-flex xs12 sm4>
81 <v-layout> 81 <v-layout>
82 <v-flex xs4 class="pt-4 subheading"> 82 <v-flex xs4 class="pt-4 subheading">
83 <label class="right hidden-xs-only hidden-sm-only">Full Name:</label> 83 <label class="right hidden-xs-only hidden-sm-only">Full Name:</label>
84 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Name:</label> 84 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Name:</label>
85 </v-flex> 85 </v-flex>
86 <v-flex xs8 class="ml-3"> 86 <v-flex xs8 class="ml-3">
87 <v-text-field 87 <v-text-field
88 v-model="editedItem.name" 88 v-model="editedItem.name"
89 placeholder="fill your full Name" 89 placeholder="fill your full Name"
90 name="name" 90 name="name"
91 type="text" 91 type="text"
92 required 92 required
93 ></v-text-field> 93 ></v-text-field>
94 </v-flex> 94 </v-flex>
95 </v-layout> 95 </v-layout>
96 </v-flex> 96 </v-flex>
97 </v-layout> 97 </v-layout>
98 <v-layout wrap> 98 <v-layout wrap>
99 <v-flex xs12 sm4> 99 <v-flex xs12 sm4>
100 <v-layout> 100 <v-layout>
101 <v-flex xs4 class="pt-4 subheading"> 101 <v-flex xs4 class="pt-4 subheading">
102 <label class="right hidden-xs-only hidden-sm-only">Email Id:</label> 102 <label class="right hidden-xs-only hidden-sm-only">Email Id:</label>
103 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Email:</label> 103 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Email:</label>
104 </v-flex> 104 </v-flex>
105 <v-flex xs8 class="ml-3"> 105 <v-flex xs8 class="ml-3">
106 <v-text-field 106 <v-text-field
107 placeholder="fill your email" 107 placeholder="fill your email"
108 v-model="editedItem.email" 108 v-model="editedItem.email"
109 type="text" 109 type="text"
110 name="email" 110 name="email"
111 required 111 required
112 ></v-text-field> 112 ></v-text-field>
113 </v-flex> 113 </v-flex>
114 </v-layout> 114 </v-layout>
115 </v-flex> 115 </v-flex>
116 <v-flex xs12 sm4> 116 <v-flex xs12 sm4>
117 <v-layout> 117 <v-layout>
118 <v-flex xs4 class="pt-4 subheading"> 118 <v-flex xs4 class="pt-4 subheading">
119 <label class="right hidden-sm-only hidden-xs-only">Date of Birth:</label> 119 <label class="right hidden-sm-only hidden-xs-only">Date of Birth:</label>
120 <label class="right hidden-lg-only hidden-xl-only hidden-md-only">D.O.B:</label> 120 <label class="right hidden-lg-only hidden-xl-only hidden-md-only">D.O.B:</label>
121 </v-flex> 121 </v-flex>
122 <v-flex xs8 class="ml-3"> 122 <v-flex xs8 class="ml-3">
123 <v-menu 123 <v-menu
124 ref="menu" 124 ref="menu"
125 :close-on-content-click="false" 125 :close-on-content-click="false"
126 v-model="menu1" 126 v-model="menu1"
127 :nudge-right="40" 127 :nudge-right="40"
128 lazy 128 lazy
129 transition="scale-transition" 129 transition="scale-transition"
130 offset-y 130 offset-y
131 full-width 131 full-width
132 min-width="290px" 132 min-width="290px"
133 > 133 >
134 <v-text-field 134 <v-text-field
135 slot="activator" 135 slot="activator"
136 v-model="editedItem.dob" 136 v-model="editedItem.dob"
137 placeholder="Select Dob" 137 placeholder="Select Dob"
138 ></v-text-field> 138 ></v-text-field>
139 <v-date-picker 139 <v-date-picker
140 ref="picker" 140 ref="picker"
141 v-model="editedItem.dob" 141 v-model="editedItem.dob"
142 :max="new Date().toISOString().substr(0, 10)" 142 :max="new Date().toISOString().substr(0, 10)"
143 min="1950-01-01" 143 min="1950-01-01"
144 @input="menu1 = false" 144 @input="menu1 = false"
145 ></v-date-picker> 145 ></v-date-picker>
146 </v-menu> 146 </v-menu>
147 </v-flex> 147 </v-flex>
148 </v-layout> 148 </v-layout>
149 </v-flex> 149 </v-flex>
150 <v-flex xs12 sm4> 150 <v-flex xs12 sm4>
151 <v-layout> 151 <v-layout>
152 <v-flex xs4 class="pt-4 subheading"> 152 <v-flex xs4 class="pt-4 subheading">
153 <label class="right">City:</label> 153 <label class="right">City:</label>
154 </v-flex> 154 </v-flex>
155 <v-flex xs8 class="ml-3"> 155 <v-flex xs8 class="ml-3">
156 <v-text-field 156 <v-text-field
157 v-model="editedItem.city" 157 v-model="editedItem.city"
158 placeholder="fill your City Name" 158 placeholder="fill your City Name"
159 name="City" 159 name="City"
160 type="text" 160 type="text"
161 required 161 required
162 ></v-text-field> 162 ></v-text-field>
163 </v-flex> 163 </v-flex>
164 </v-layout> 164 </v-layout>
165 </v-flex> 165 </v-flex>
166 </v-layout> 166 </v-layout>
167 <v-layout wrap> 167 <v-layout wrap>
168 <v-flex xs12 sm4> 168 <v-flex xs12 sm4>
169 <v-layout> 169 <v-layout>
170 <v-flex xs4 class="pt-4 subheading"> 170 <v-flex xs4 class="pt-4 subheading">
171 <label class="right hidden-xs-only hidden-sm-only">Blood Group:</label> 171 <label class="right hidden-xs-only hidden-sm-only">Blood Group:</label>
172 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Blood:</label> 172 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Blood:</label>
173 </v-flex> 173 </v-flex>
174 <v-flex xs8 class="ml-3"> 174 <v-flex xs8 class="ml-3">
175 <v-text-field 175 <v-text-field
176 v-model="editedItem.bloodGroup" 176 v-model="editedItem.bloodGroup"
177 placeholder="fill your BloodGroup" 177 placeholder="fill your BloodGroup"
178 name="state" 178 name="state"
179 type="text" 179 type="text"
180 required 180 required
181 ></v-text-field> 181 ></v-text-field>
182 </v-flex> 182 </v-flex>
183 </v-layout> 183 </v-layout>
184 </v-flex> 184 </v-flex>
185 <v-flex xs12 sm4> 185 <v-flex xs12 sm4>
186 <v-layout> 186 <v-layout>
187 <v-flex xs4 class="pt-4 subheading"> 187 <v-flex xs4 class="pt-4 subheading">
188 <label class="right">Gender:</label> 188 <label class="right">Gender:</label>
189 </v-flex> 189 </v-flex>
190 <v-flex xs8 class="ml-3"> 190 <v-flex xs8 class="ml-3">
191 <v-select 191 <v-select
192 :items="gender" 192 :items="gender"
193 v-model="editedItem.gender" 193 v-model="editedItem.gender"
194 placeholder="Select Gender" 194 placeholder="Select Gender"
195 required 195 required
196 ></v-select> 196 ></v-select>
197 </v-flex> 197 </v-flex>
198 </v-layout> 198 </v-layout>
199 </v-flex> 199 </v-flex>
200 <v-flex xs12 sm4> 200 <v-flex xs12 sm4>
201 <v-layout> 201 <v-layout>
202 <v-flex xs4 class="pt-4 subheading"> 202 <v-flex xs4 class="pt-4 subheading">
203 <label class="right">Medical Notes:</label> 203 <label class="right">Medical Notes:</label>
204 </v-flex> 204 </v-flex>
205 <v-flex xs8 class="ml-3"> 205 <v-flex xs8 class="ml-3">
206 <v-text-field 206 <v-text-field
207 v-model="editedItem.medicalNotes" 207 v-model="editedItem.medicalNotes"
208 placeholder="fill your medicalNotes" 208 placeholder="fill your medicalNotes"
209 required 209 required
210 ></v-text-field> 210 ></v-text-field>
211 </v-flex> 211 </v-flex>
212 </v-layout> 212 </v-layout>
213 </v-flex> 213 </v-flex>
214 </v-layout> 214 </v-layout>
215 <v-layout wrap> 215 <v-layout wrap>
216 <v-flex xs12 sm4> 216 <v-flex xs12 sm4>
217 <v-layout> 217 <v-layout>
218 <v-flex xs4 class="pt-4 subheading"> 218 <v-flex xs4 class="pt-4 subheading">
219 <label class="right">Height:</label> 219 <label class="right">Height:</label>
220 </v-flex> 220 </v-flex>
221 <v-flex xs8 class="ml-3"> 221 <v-flex xs8 class="ml-3">
222 <v-text-field 222 <v-text-field
223 v-model="editedItem.height" 223 v-model="editedItem.height"
224 placeholder="fill your Height" 224 placeholder="fill your Height"
225 name="state" 225 name="state"
226 type="text" 226 type="text"
227 required 227 required
228 ></v-text-field> 228 ></v-text-field>
229 </v-flex> 229 </v-flex>
230 </v-layout> 230 </v-layout>
231 </v-flex> 231 </v-flex>
232 <v-flex xs12 sm4> 232 <v-flex xs12 sm4>
233 <v-layout> 233 <v-layout>
234 <v-flex xs4 class="pt-4 subheading"> 234 <v-flex xs4 class="pt-4 subheading">
235 <label class="right">Weight:</label> 235 <label class="right">Weight:</label>
236 </v-flex> 236 </v-flex>
237 <v-flex xs8 class="ml-3"> 237 <v-flex xs8 class="ml-3">
238 <v-text-field 238 <v-text-field
239 v-model="editedItem.weight" 239 v-model="editedItem.weight"
240 placeholder="fill your Weight" 240 placeholder="fill your Weight"
241 name="pincode" 241 name="pincode"
242 required 242 required
243 ></v-text-field> 243 ></v-text-field>
244 </v-flex> 244 </v-flex>
245 </v-layout> 245 </v-layout>
246 </v-flex> 246 </v-flex>
247 <v-flex xs12 sm4> 247 <v-flex xs12 sm4>
248 <v-layout> 248 <v-layout>
249 <v-flex xs4 class="pt-4 subheading"> 249 <v-flex xs4 class="pt-4 subheading">
250 <label class="right hidden-xs-only hidden-sm-only">Uplaod Image:</label> 250 <label class="right hidden-xs-only hidden-sm-only">Uplaod Image:</label>
251 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Uplaod:</label> 251 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Uplaod:</label>
252 </v-flex> 252 </v-flex>
253 <v-flex xs8 class="ml-3"> 253 <v-flex xs8 class="ml-3">
254 <v-text-field 254 <v-text-field
255 label="Select Image" 255 label="Select Image"
256 @click="pickEditFile" 256 @click="pickEditFile"
257 v-model="editImageName" 257 v-model="editImageName"
258 append-icon="attach_file" 258 append-icon="attach_file"
259 ></v-text-field> 259 ></v-text-field>
260 </v-flex> 260 </v-flex>
261 </v-layout> 261 </v-layout>
262 </v-flex> 262 </v-flex>
263 </v-layout> 263 </v-layout>
264 <v-layout wrap> 264 <v-layout wrap>
265 <v-flex xs12 sm4> 265 <v-flex xs12 sm4>
266 <v-layout> 266 <v-layout>
267 <v-flex xs4 class="pt-4 subheading"> 267 <v-flex xs4 class="pt-4 subheading">
268 <label class="right">State:</label> 268 <label class="right">State:</label>
269 </v-flex> 269 </v-flex>
270 <v-flex xs8 class="ml-3"> 270 <v-flex xs8 class="ml-3">
271 <v-text-field 271 <v-text-field
272 v-model="editedItem.state" 272 v-model="editedItem.state"
273 placeholder="fill your State Name" 273 placeholder="fill your State Name"
274 name="state" 274 name="state"
275 type="text" 275 type="text"
276 required 276 required
277 ></v-text-field> 277 ></v-text-field>
278 </v-flex> 278 </v-flex>
279 </v-layout> 279 </v-layout>
280 </v-flex> 280 </v-flex>
281 <v-flex xs12 sm4> 281 <v-flex xs12 sm4>
282 <v-layout> 282 <v-layout>
283 <v-flex xs4 class="pt-4 subheading"> 283 <v-flex xs4 class="pt-4 subheading">
284 <label class="right">Pincode:</label> 284 <label class="right">Pincode:</label>
285 </v-flex> 285 </v-flex>
286 <v-flex xs8 class="ml-3"> 286 <v-flex xs8 class="ml-3">
287 <v-text-field 287 <v-text-field
288 v-model="editedItem.pincode" 288 v-model="editedItem.pincode"
289 placeholder="fill your pincode" 289 placeholder="fill your pincode"
290 name="pincode" 290 name="pincode"
291 type="number" 291 type="number"
292 required 292 required
293 ></v-text-field> 293 ></v-text-field>
294 </v-flex> 294 </v-flex>
295 </v-layout> 295 </v-layout>
296 </v-flex> 296 </v-flex>
297 <v-flex xs12 sm4> 297 <v-flex xs12 sm4>
298 <v-layout> 298 <v-layout>
299 <v-flex xs4 class="pt-4 subheading"> 299 <v-flex xs4 class="pt-4 subheading">
300 <label class="right hidden-xs-only hidden-sm-only">Mobile No:</label> 300 <label class="right hidden-xs-only hidden-sm-only">Mobile No:</label>
301 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Mobile:</label> 301 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Mobile:</label>
302 </v-flex> 302 </v-flex>
303 <v-flex xs8 class="ml-3"> 303 <v-flex xs8 class="ml-3">
304 <v-text-field 304 <v-text-field
305 v-model="editedItem.mobile" 305 v-model="editedItem.mobile"
306 placeholder="fill your MobileNo" 306 placeholder="fill your MobileNo"
307 name="mobileNo" 307 name="mobileNo"
308 type="number" 308 type="number"
309 required 309 required
310 ></v-text-field> 310 ></v-text-field>
311 </v-flex> 311 </v-flex>
312 </v-layout> 312 </v-layout>
313 </v-flex> 313 </v-flex>
314 </v-layout> 314 </v-layout>
315 <v-layout wrap> 315 <v-layout wrap>
316 <v-flex xs12 sm4> 316 <v-flex xs12 sm4>
317 <v-layout> 317 <v-layout>
318 <v-flex xs4 class="pt-4 subheading"> 318 <v-flex xs4 class="pt-4 subheading">
319 <label class="right hidden-xs-only hidden-sm-only">Select Country:</label> 319 <label class="right hidden-xs-only hidden-sm-only">Select Country:</label>
320 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Country:</label> 320 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Country:</label>
321 </v-flex> 321 </v-flex>
322 <v-flex xs8 class="ml-3"> 322 <v-flex xs8 class="ml-3">
323 <v-autocomplete 323 <v-autocomplete
324 v-model="editedItem.country" 324 v-model="editedItem.country"
325 :items="countries" 325 :items="countries"
326 placeholder="Select Country Name" 326 placeholder="Select Country Name"
327 required 327 required
328 ></v-autocomplete> 328 ></v-autocomplete>
329 </v-flex> 329 </v-flex>
330 </v-layout> 330 </v-layout>
331 </v-flex> 331 </v-flex>
332 <v-flex xs12 sm4 class="hidden-xs-only hidden-sm-only"> 332 <v-flex xs12 sm4 class="hidden-xs-only hidden-sm-only">
333 <v-layout> 333 <v-layout>
334 <v-flex xs4 class="pt-4 subheading"> 334 <v-flex xs4 class="pt-4 subheading">
335 <label class="right hidden-xs-only hidden-sm-only">Roll Number:</label> 335 <label class="right hidden-xs-only hidden-sm-only">Roll Number:</label>
336 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Roll No:</label> 336 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Roll No:</label>
337 </v-flex> 337 </v-flex>
338 <v-flex xs8 class="ml-3"> 338 <v-flex xs8 class="ml-3">
339 <v-text-field 339 <v-text-field
340 v-model="editedItem.rollNo" 340 v-model="editedItem.rollNo"
341 placeholder="fill roll number" 341 placeholder="fill roll number"
342 required 342 required
343 ></v-text-field> 343 ></v-text-field>
344 </v-flex> 344 </v-flex>
345 </v-layout> 345 </v-layout>
346 </v-flex> 346 </v-flex>
347 <v-flex xs12 sm4 class="hidden-xs-only hidden-sm-only"> 347 <v-flex xs12 sm4 class="hidden-xs-only hidden-sm-only">
348 <v-layout> 348 <v-layout>
349 <v-flex xs4 sm4 class="pt-4 subheading"> 349 <v-flex xs4 sm4 class="pt-4 subheading">
350 <label class="right hidden-xs-only hidden-sm-only">Permanent Address:</label> 350 <label class="right hidden-xs-only hidden-sm-only">Permanent Address:</label>
351 <label 351 <label
352 class="right hidden-lg-only hidden-md-only hidden-xl-only" 352 class="right hidden-lg-only hidden-md-only hidden-xl-only"
353 >Permanent Address:</label> 353 >Permanent Address:</label>
354 </v-flex> 354 </v-flex>
355 <v-flex xs12 sm8 class="ml-3"> 355 <v-flex xs12 sm8 class="ml-3">
356 <v-text-field 356 <v-text-field
357 v-model="editedItem.permanentAddress" 357 v-model="editedItem.permanentAddress"
358 placeholder="fill Your Permanent Address" 358 placeholder="fill Your Permanent Address"
359 required 359 required
360 ></v-text-field> 360 ></v-text-field>
361 </v-flex> 361 </v-flex>
362 </v-layout> 362 </v-layout>
363 </v-flex> 363 </v-flex>
364 </v-layout> 364 </v-layout>
365 <v-layout class="hidden-xs-only hidden-sm-only"> 365 <v-layout class="hidden-xs-only hidden-sm-only">
366 <v-flex xs12 sm4> 366 <v-flex xs12 sm4>
367 <v-layout> 367 <v-layout>
368 <v-flex xs4 class="pt-4 subheading"> 368 <v-flex xs4 class="pt-4 subheading">
369 <label class="right hidden-xs-only hidden-sm-only">Present Address:</label> 369 <label class="right hidden-xs-only hidden-sm-only">Present Address:</label>
370 <label 370 <label
371 class="right hidden-lg-only hidden-md-only hidden-xl-only" 371 class="right hidden-lg-only hidden-md-only hidden-xl-only"
372 >Present Address:</label> 372 >Present Address:</label>
373 </v-flex> 373 </v-flex>
374 <v-flex xs8 class="ml-3"> 374 <v-flex xs8 class="ml-3">
375 <v-text-field 375 <v-text-field
376 v-model="editedItem.presentAddress" 376 v-model="editedItem.presentAddress"
377 placeholder="Select Country Name" 377 placeholder="Select Country Name"
378 required 378 required
379 ></v-text-field> 379 ></v-text-field>
380 </v-flex> 380 </v-flex>
381 </v-layout> 381 </v-layout>
382 </v-flex> 382 </v-flex>
383 </v-layout> 383 </v-layout>
384 <v-layout class="hidden-lg-only hidden-md-only hidden-xl-only" wrap> 384 <v-layout class="hidden-lg-only hidden-md-only hidden-xl-only" wrap>
385 <v-flex xs12 sm12> 385 <v-flex xs12 sm12>
386 <v-layout> 386 <v-layout>
387 <v-flex xs4 class="pt-4 subheading"> 387 <v-flex xs4 class="pt-4 subheading">
388 <label class="right hidden-xs-only hidden-sm-only">Roll Number:</label> 388 <label class="right hidden-xs-only hidden-sm-only">Roll Number:</label>
389 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Roll No:</label> 389 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Roll No:</label>
390 </v-flex> 390 </v-flex>
391 <v-flex xs8 class="ml-3"> 391 <v-flex xs8 class="ml-3">
392 <v-text-field 392 <v-text-field
393 v-model="editedItem.rollNo" 393 v-model="editedItem.rollNo"
394 placeholder="fill roll number" 394 placeholder="fill roll number"
395 required 395 required
396 ></v-text-field> 396 ></v-text-field>
397 </v-flex> 397 </v-flex>
398 </v-layout> 398 </v-layout>
399 </v-flex> 399 </v-flex>
400 </v-layout> 400 </v-layout>
401 <v-layout class="hidden-lg-only hidden-md-only hidden-xl-only" wrap> 401 <v-layout class="hidden-lg-only hidden-md-only hidden-xl-only" wrap>
402 <v-flex xs12 sm12> 402 <v-flex xs12 sm12>
403 <v-layout> 403 <v-layout>
404 <v-flex xs12 sm3 class="pt-4 subheading text-xs-center"> 404 <v-flex xs12 sm3 class="pt-4 subheading text-xs-center">
405 <label class>Present Address :</label> 405 <label class>Present Address :</label>
406 </v-flex> 406 </v-flex>
407 </v-layout> 407 </v-layout>
408 <v-layout> 408 <v-layout>
409 <v-flex xs12 sm12> 409 <v-flex xs12 sm12>
410 <v-textarea 410 <v-textarea
411 v-model="editedItem.presentAddress" 411 v-model="editedItem.presentAddress"
412 placeholder="fill Your present Address" 412 placeholder="fill Your present Address"
413 required 413 required
414 ></v-textarea> 414 ></v-textarea>
415 </v-flex> 415 </v-flex>
416 </v-layout> 416 </v-layout>
417 </v-flex> 417 </v-flex>
418 <v-flex xs12 sm12> 418 <v-flex xs12 sm12>
419 <v-layout> 419 <v-layout>
420 <v-flex xs12 sm3 class="pt-4 pr-4 subheading text-xs-center addressForm"> 420 <v-flex xs12 sm3 class="pt-4 pr-4 subheading text-xs-center addressForm">
421 <label>Permanent addr:</label> 421 <label>Permanent addr:</label>
422 </v-flex> 422 </v-flex>
423 </v-layout> 423 </v-layout>
424 <v-layout> 424 <v-layout>
425 <v-flex xs12 sm12> 425 <v-flex xs12 sm12>
426 <v-textarea 426 <v-textarea
427 name="input-4-3" 427 name="input-4-3"
428 v-model="editedItem.permanentAddress" 428 v-model="editedItem.permanentAddress"
429 placeholder="fill Your Permanent Address" 429 placeholder="fill Your Permanent Address"
430 required 430 required
431 ></v-textarea> 431 ></v-textarea>
432 </v-flex> 432 </v-flex>
433 </v-layout> 433 </v-layout>
434 </v-flex> 434 </v-flex>
435 </v-layout> 435 </v-layout>
436 <v-layout> 436 <v-layout>
437 <v-flex xs12 sm12> 437 <v-flex xs12 sm12>
438 <v-layout class="right"> 438 <v-layout class="right">
439 <v-btn @click="save" round dark :loading="editLoading" class="add-button">Save</v-btn> 439 <v-btn @click="save" round dark :loading="editLoading" class="add-button">Save</v-btn>
440 </v-layout> 440 </v-layout>
441 </v-flex> 441 </v-flex>
442 </v-layout> 442 </v-layout>
443 </v-container> 443 </v-container>
444 </v-form> 444 </v-form>
445 </v-card-text> 445 </v-card-text>
446 </v-card> 446 </v-card>
447 </v-dialog> 447 </v-dialog>
448 448
449 <!-- ****** PROFILE VIEW STUDENTS DEATILS ****** --> 449 <!-- ****** PROFILE VIEW STUDENTS DEATILS ****** -->
450 450
451 <v-dialog v-model="profileStudentDialog" max-width="1000px" scrollable persistent> 451 <v-dialog v-model="profileStudentDialog" max-width="1000px" scrollable persistent>
452 <v-card flat class="card-style pa-3" dark> 452 <v-card flat class="card-style pa-3" dark>
453 <v-layout> 453 <v-layout>
454 <v-flex xs12> 454 <v-flex xs12>
455 <label class="title text-xs-center">View Student Details</label> 455 <label class="title text-xs-center">View Student Details</label>
456 <v-icon size="24" class="right" @click="profileStudentDialog = false">cancel</v-icon> 456 <v-icon size="24" class="right" @click="profileStudentDialog = false">cancel</v-icon>
457 </v-flex> 457 </v-flex>
458 </v-layout> 458 </v-layout>
459 <v-card-text> 459 <v-card-text>
460 <v-flex align-center justify-center layout text-xs-center class="mt-3"> 460 <v-flex align-center justify-center layout text-xs-center class="mt-3">
461 <v-avatar size="100px"> 461 <v-avatar size="100px">
462 <img src="/static/icon/user.png" v-if="!editedItem.profilePicUrl" /> 462 <img src="/static/icon/user.png" v-if="!editedItem.profilePicUrl" />
463 <img :src="editedItem.profilePicUrl" v-else-if="editedItem.profilePicUrl" /> 463 <img :src="editedItem.profilePicUrl" v-else-if="editedItem.profilePicUrl" />
464 </v-avatar> 464 </v-avatar>
465 </v-flex> 465 </v-flex>
466 <v-container grid-list-md> 466 <v-container grid-list-md>
467 <v-layout wrap> 467 <v-layout wrap>
468 <v-flex xs12 sm5> 468 <v-flex xs12 sm5>
469 <v-layout> 469 <v-layout>
470 <v-flex xs6 sm6> 470 <v-flex xs6 sm6>
471 <h5 class="right my-1"> 471 <h5 class="right my-1">
472 <b>Full Name:</b> 472 <b>Full Name:</b>
473 </h5> 473 </h5>
474 </v-flex> 474 </v-flex>
475 <v-flex sm6 xs6> 475 <v-flex sm6 xs6>
476 <h5 class="my-1 left">{{ editedItem.name }}</h5> 476 <h5 class="my-1 left">{{ editedItem.name }}</h5>
477 </v-flex> 477 </v-flex>
478 </v-layout> 478 </v-layout>
479 </v-flex> 479 </v-flex>
480 <v-flex xs12 sm7> 480 <v-flex xs12 sm7>
481 <v-layout> 481 <v-layout>
482 <v-flex xs6 sm4> 482 <v-flex xs6 sm4>
483 <h5 class="right my-1"> 483 <h5 class="right my-1">
484 <b>Email:</b> 484 <b>Email:</b>
485 </h5> 485 </h5>
486 </v-flex> 486 </v-flex>
487 <v-flex sm8 xs6> 487 <v-flex sm8 xs6>
488 <h5 class="my-1 left">{{ editedItem.email }}</h5> 488 <h5 class="my-1 left">{{ editedItem.email }}</h5>
489 </v-flex> 489 </v-flex>
490 </v-layout> 490 </v-layout>
491 </v-flex> 491 </v-flex>
492 </v-layout> 492 </v-layout>
493 <v-layout wrap> 493 <v-layout wrap>
494 <v-flex xs12 sm5> 494 <v-flex xs12 sm5>
495 <v-layout> 495 <v-layout>
496 <v-flex xs6 sm6> 496 <v-flex xs6 sm6>
497 <b> 497 <b>
498 <h5 class="right my-1"> 498 <h5 class="right my-1">
499 <b>Gender:</b> 499 <b>Gender:</b>
500 </h5> 500 </h5>
501 </b> 501 </b>
502 </v-flex> 502 </v-flex>
503 <v-flex sm6 xs6> 503 <v-flex sm6 xs6>
504 <h5 class="my-1 left">{{ editedItem.gender }}</h5> 504 <h5 class="my-1 left">{{ editedItem.gender }}</h5>
505 </v-flex> 505 </v-flex>
506 </v-layout> 506 </v-layout>
507 </v-flex> 507 </v-flex>
508 <v-flex xs12 sm7> 508 <v-flex xs12 sm7>
509 <v-layout> 509 <v-layout>
510 <v-flex xs6 sm4> 510 <v-flex xs6 sm4>
511 <b> 511 <b>
512 <h5 class="right my-1"> 512 <h5 class="right my-1">
513 <b>D.O.B:</b> 513 <b>D.O.B:</b>
514 </h5> 514 </h5>
515 </b> 515 </b>
516 </v-flex> 516 </v-flex>
517 <v-flex sm8 xs6> 517 <v-flex sm8 xs6>
518 <h5 class="my-1">{{ dates(editedItem.dob) }}</h5> 518 <h5 class="my-1">{{ dates(editedItem.dob) }}</h5>
519 </v-flex> 519 </v-flex>
520 </v-layout> 520 </v-layout>
521 </v-flex> 521 </v-flex>
522 </v-layout> 522 </v-layout>
523 <v-layout wrap> 523 <v-layout wrap>
524 <v-flex xs12 sm5> 524 <v-flex xs12 sm5>
525 <v-layout> 525 <v-layout>
526 <v-flex xs6 sm6> 526 <v-flex xs6 sm6>
527 <b> 527 <b>
528 <h5 class="right my-1"> 528 <h5 class="right my-1">
529 <b>BloodGroup:</b> 529 <b>BloodGroup:</b>
530 </h5> 530 </h5>
531 </b> 531 </b>
532 </v-flex> 532 </v-flex>
533 <v-flex sm6 xs6> 533 <v-flex sm6 xs6>
534 <h5 class="my-1 left">{{ editedItem.bloodGroup }}</h5> 534 <h5 class="my-1 left">{{ editedItem.bloodGroup }}</h5>
535 </v-flex> 535 </v-flex>
536 </v-layout> 536 </v-layout>
537 </v-flex> 537 </v-flex>
538 <v-flex xs12 sm7> 538 <v-flex xs12 sm7>
539 <v-layout> 539 <v-layout>
540 <v-flex xs6 sm4> 540 <v-flex xs6 sm4>
541 <b> 541 <b>
542 <h5 class="right my-1"> 542 <h5 class="right my-1">
543 <b>Roll No. :</b> 543 <b>Roll No. :</b>
544 </h5> 544 </h5>
545 </b> 545 </b>
546 </v-flex> 546 </v-flex>
547 <v-flex sm8 xs6> 547 <v-flex sm8 xs6>
548 <h5 class="my-1">{{ editedItem.rollNo }}</h5> 548 <h5 class="my-1">{{ editedItem.rollNo }}</h5>
549 </v-flex> 549 </v-flex>
550 </v-layout> 550 </v-layout>
551 </v-flex> 551 </v-flex>
552 </v-layout> 552 </v-layout>
553 <v-layout wrap> 553 <v-layout wrap>
554 <v-flex xs12 sm5> 554 <v-flex xs12 sm5>
555 <v-layout> 555 <v-layout>
556 <v-flex xs6 sm6> 556 <v-flex xs6 sm6>
557 <b> 557 <b>
558 <h5 class="right my-1"> 558 <h5 class="right my-1">
559 <b>Height:</b> 559 <b>Height:</b>
560 </h5> 560 </h5>
561 </b> 561 </b>
562 </v-flex> 562 </v-flex>
563 <v-flex sm6 xs6> 563 <v-flex sm6 xs6>
564 <h5 class="my-1 left">{{ editedItem.height }}</h5> 564 <h5 class="my-1 left">{{ editedItem.height }}</h5>
565 </v-flex> 565 </v-flex>
566 </v-layout> 566 </v-layout>
567 </v-flex> 567 </v-flex>
568 <v-flex xs12 sm7> 568 <v-flex xs12 sm7>
569 <v-layout> 569 <v-layout>
570 <v-flex xs6 sm4> 570 <v-flex xs6 sm4>
571 <b> 571 <b>
572 <h5 class="right my-1"> 572 <h5 class="right my-1">
573 <b>Weight:</b> 573 <b>Weight:</b>
574 </h5> 574 </h5>
575 </b> 575 </b>
576 </v-flex> 576 </v-flex>
577 <v-flex sm8 xs6> 577 <v-flex sm8 xs6>
578 <h5 class="my-1">{{ editedItem.weight }}</h5> 578 <h5 class="my-1">{{ editedItem.weight }}</h5>
579 </v-flex> 579 </v-flex>
580 </v-layout> 580 </v-layout>
581 </v-flex> 581 </v-flex>
582 </v-layout> 582 </v-layout>
583 <v-layout wrap> 583 <v-layout wrap>
584 <v-flex xs12 sm5> 584 <v-flex xs12 sm5>
585 <v-layout> 585 <v-layout>
586 <v-flex xs6 sm6> 586 <v-flex xs6 sm6>
587 <b> 587 <b>
588 <h5 class="right my-1"> 588 <h5 class="right my-1">
589 <b>City:</b> 589 <b>City:</b>
590 </h5> 590 </h5>
591 </b> 591 </b>
592 </v-flex> 592 </v-flex>
593 <v-flex sm6 xs6> 593 <v-flex sm6 xs6>
594 <h5 class="my-1 left">{{ editedItem.city }}</h5> 594 <h5 class="my-1 left">{{ editedItem.city }}</h5>
595 </v-flex> 595 </v-flex>
596 </v-layout> 596 </v-layout>
597 </v-flex> 597 </v-flex>
598 <v-flex xs12 sm7> 598 <v-flex xs12 sm7>
599 <v-layout> 599 <v-layout>
600 <v-flex xs6 sm4> 600 <v-flex xs6 sm4>
601 <b> 601 <b>
602 <h5 class="right my-1"> 602 <h5 class="right my-1">
603 <b>State:</b> 603 <b>State:</b>
604 </h5> 604 </h5>
605 </b> 605 </b>
606 </v-flex> 606 </v-flex>
607 <v-flex sm8 xs6> 607 <v-flex sm8 xs6>
608 <h5 class="my-1">{{ editedItem.state }}</h5> 608 <h5 class="my-1">{{ editedItem.state }}</h5>
609 </v-flex> 609 </v-flex>
610 </v-layout> 610 </v-layout>
611 </v-flex> 611 </v-flex>
612 </v-layout> 612 </v-layout>
613 <v-layout wrap> 613 <v-layout wrap>
614 <v-flex xs12 sm5> 614 <v-flex xs12 sm5>
615 <v-layout> 615 <v-layout>
616 <v-flex xs6 sm6> 616 <v-flex xs6 sm6>
617 <b> 617 <b>
618 <h5 class="right my-1"> 618 <h5 class="right my-1">
619 <b>Pincode:</b> 619 <b>Pincode:</b>
620 </h5> 620 </h5>
621 </b> 621 </b>
622 </v-flex> 622 </v-flex>
623 <v-flex sm6 xs6> 623 <v-flex sm6 xs6>
624 <h5 class="my-1">{{ editedItem.pincode }}</h5> 624 <h5 class="my-1">{{ editedItem.pincode }}</h5>
625 </v-flex> 625 </v-flex>
626 </v-layout> 626 </v-layout>
627 </v-flex> 627 </v-flex>
628 <v-flex xs12 sm7> 628 <v-flex xs12 sm7>
629 <v-layout> 629 <v-layout>
630 <v-flex xs6 sm4> 630 <v-flex xs6 sm4>
631 <b> 631 <b>
632 <h5 class="right my-1"> 632 <h5 class="right my-1">
633 <b>Country:</b> 633 <b>Country:</b>
634 </h5> 634 </h5>
635 </b> 635 </b>
636 </v-flex> 636 </v-flex>
637 <v-flex sm7 xs6> 637 <v-flex sm7 xs6>
638 <h5 class="my-1">{{ editedItem.country }}</h5> 638 <h5 class="my-1">{{ editedItem.country }}</h5>
639 </v-flex> 639 </v-flex>
640 </v-layout> 640 </v-layout>
641 </v-flex> 641 </v-flex>
642 </v-layout> 642 </v-layout>
643 <v-layout wrap> 643 <v-layout wrap>
644 <v-flex xs12 sm5> 644 <v-flex xs12 sm5>
645 <v-layout> 645 <v-layout>
646 <v-flex sm6 xs6> 646 <v-flex sm6 xs6>
647 <b> 647 <b>
648 <h5 class="right my-1"> 648 <h5 class="right my-1">
649 <b>Mobile No:</b> 649 <b>Mobile No:</b>
650 </h5> 650 </h5>
651 </b> 651 </b>
652 </v-flex> 652 </v-flex>
653 <v-flex sm6 xs6> 653 <v-flex sm6 xs6>
654 <h5 class="my-1">{{ editedItem.mobile }}</h5> 654 <h5 class="my-1">{{ editedItem.mobile }}</h5>
655 </v-flex> 655 </v-flex>
656 </v-layout> 656 </v-layout>
657 </v-flex> 657 </v-flex>
658 <v-flex xs12 sm7> 658 <v-flex xs12 sm7>
659 <v-layout> 659 <v-layout>
660 <v-flex xs6 sm4> 660 <v-flex xs6 sm4>
661 <b> 661 <b>
662 <h5 class="right my-1"> 662 <h5 class="right my-1">
663 <b>FahterName:</b> 663 <b>FahterName:</b>
664 </h5> 664 </h5>
665 </b> 665 </b>
666 </v-flex> 666 </v-flex>
667 <v-flex sm8 xs6> 667 <v-flex sm8 xs6>
668 <h5 class="my-1">{{ editedItem.fatherName }}</h5> 668 <h5 class="my-1">{{ editedItem.fatherName }}</h5>
669 </v-flex> 669 </v-flex>
670 </v-layout> 670 </v-layout>
671 </v-flex> 671 </v-flex>
672 </v-layout> 672 </v-layout>
673 <v-layout wrap> 673 <v-layout wrap>
674 <v-flex xs12 sm5> 674 <v-flex xs12 sm5>
675 <v-layout> 675 <v-layout>
676 <v-flex xs6 sm6> 676 <v-flex xs6 sm6>
677 <b> 677 <b>
678 <h5 class="right my-1"> 678 <h5 class="right my-1">
679 <b>MotherName:</b> 679 <b>MotherName:</b>
680 </h5> 680 </h5>
681 </b> 681 </b>
682 </v-flex> 682 </v-flex>
683 <v-flex sm6 xs6> 683 <v-flex sm6 xs6>
684 <h5 class="my-1">{{ editedItem.motherName }}</h5> 684 <h5 class="my-1">{{ editedItem.motherName }}</h5>
685 </v-flex> 685 </v-flex>
686 </v-layout> 686 </v-layout>
687 </v-flex> 687 </v-flex>
688 <v-flex xs12 sm7> 688 <v-flex xs12 sm7>
689 <v-layout> 689 <v-layout>
690 <v-flex xs6 sm4> 690 <v-flex xs6 sm4>
691 <b> 691 <b>
692 <h5 class="right my-1"> 692 <h5 class="right my-1">
693 <b>FatherCellNo:</b> 693 <b>FatherCellNo:</b>
694 </h5> 694 </h5>
695 </b> 695 </b>
696 </v-flex> 696 </v-flex>
697 <v-flex sm6 xs6> 697 <v-flex sm6 xs6>
698 <h5 class="my-1">{{ editedItem.fatherCellNo }}</h5> 698 <h5 class="my-1">{{ editedItem.fatherCellNo }}</h5>
699 </v-flex> 699 </v-flex>
700 </v-layout> 700 </v-layout>
701 </v-flex> 701 </v-flex>
702 </v-layout> 702 </v-layout>
703 <v-layout wrap> 703 <v-layout wrap>
704 <v-flex xs12 sm5> 704 <v-flex xs12 sm5>
705 <v-layout> 705 <v-layout>
706 <v-flex xs6 sm6> 706 <v-flex xs6 sm6>
707 <b> 707 <b>
708 <h5 class="right my-1"> 708 <h5 class="right my-1">
709 <b>MotherCellNo:</b> 709 <b>MotherCellNo:</b>
710 </h5> 710 </h5>
711 </b> 711 </b>
712 </v-flex> 712 </v-flex>
713 <v-flex sm6 xs6> 713 <v-flex sm6 xs6>
714 <h5 class="my-1">{{ editedItem.motherCellNo }}</h5> 714 <h5 class="my-1">{{ editedItem.motherCellNo }}</h5>
715 </v-flex> 715 </v-flex>
716 </v-layout> 716 </v-layout>
717 </v-flex> 717 </v-flex>
718 <v-flex xs12 sm7> 718 <v-flex xs12 sm7>
719 <v-layout> 719 <v-layout>
720 <v-flex xs6 sm4> 720 <v-flex xs6 sm4>
721 <b> 721 <b>
722 <h5 class="my-1 right"> 722 <h5 class="my-1 right">
723 <b>AcademicYear:</b> 723 <b>AcademicYear:</b>
724 </h5> 724 </h5>
725 </b> 725 </b>
726 </v-flex> 726 </v-flex>
727 <v-flex sm5 xs8> 727 <v-flex sm5 xs8>
728 <h5 class="my-1">{{ editedItem.establishmentYear }}</h5> 728 <h5 class="my-1">{{ editedItem.establishmentYear }}</h5>
729 </v-flex> 729 </v-flex>
730 </v-layout> 730 </v-layout>
731 </v-flex> 731 </v-flex>
732 </v-layout> 732 </v-layout>
733 <v-layout wrap> 733 <v-layout wrap>
734 <v-flex xs12 sm5> 734 <v-flex xs12 sm5>
735 <v-layout> 735 <v-layout>
736 <v-flex xs6 sm6> 736 <v-flex xs6 sm6>
737 <b> 737 <b>
738 <h5 class="my-1 right"> 738 <h5 class="my-1 right">
739 <b>MedicalNotes:</b> 739 <b>MedicalNotes:</b>
740 </h5> 740 </h5>
741 </b> 741 </b>
742 </v-flex> 742 </v-flex>
743 <v-flex sm5 xs6> 743 <v-flex sm5 xs6>
744 <h5 class="my-1">{{ editedItem.medicalNotes }}</h5> 744 <h5 class="my-1">{{ editedItem.medicalNotes }}</h5>
745 </v-flex> 745 </v-flex>
746 </v-layout> 746 </v-layout>
747 </v-flex> 747 </v-flex>
748 <v-flex xs12 sm7 class="hidden-xs-only"> 748 <v-flex xs12 sm7 class="hidden-xs-only">
749 <v-layout wrap> 749 <v-layout wrap>
750 <v-flex sm4> 750 <v-flex sm4>
751 <b> 751 <b>
752 <h5 class="my-1 right"> 752 <h5 class="my-1 right">
753 <b>present Address:</b> 753 <b>present Address:</b>
754 </h5> 754 </h5>
755 </b> 755 </b>
756 </v-flex> 756 </v-flex>
757 <v-flex sm8> 757 <v-flex sm8>
758 <h5 class="my-1">{{ editedItem.presentAddress }}</h5> 758 <h5 class="my-1">{{ editedItem.presentAddress }}</h5>
759 </v-flex> 759 </v-flex>
760 </v-layout> 760 </v-layout>
761 </v-flex> 761 </v-flex>
762 <v-flex sm6 class="hidden-xs-only"> 762 <v-flex sm6 class="hidden-xs-only">
763 <v-layout wrap> 763 <v-layout wrap>
764 <v-flex sm5> 764 <v-flex sm5>
765 <b> 765 <b>
766 <h5 class="my-1 right"> 766 <h5 class="my-1 right">
767 <b>Permanent Address:</b> 767 <b>Permanent Address:</b>
768 </h5> 768 </h5>
769 </b> 769 </b>
770 </v-flex> 770 </v-flex>
771 <v-flex sm7> 771 <v-flex sm7>
772 <h5 class="my-1">{{ editedItem.permanentAddress }}</h5> 772 <h5 class="my-1">{{ editedItem.permanentAddress }}</h5>
773 </v-flex> 773 </v-flex>
774 </v-layout> 774 </v-layout>
775 </v-flex> 775 </v-flex>
776 </v-layout> 776 </v-layout>
777 <v-layout wrap class="hidden-sm-only hidden-md-only hidden-lg-only hidden-xl-only"> 777 <v-layout wrap class="hidden-sm-only hidden-md-only hidden-lg-only hidden-xl-only">
778 <v-flex xs12 sm5> 778 <v-flex xs12 sm5>
779 <v-layout wrap> 779 <v-layout wrap>
780 <v-flex xs12 sm6> 780 <v-flex xs12 sm6>
781 <b> 781 <b>
782 <h5 class="my-1"> 782 <h5 class="my-1">
783 <b>present Address:-</b> 783 <b>present Address:-</b>
784 </h5> 784 </h5>
785 </b> 785 </b>
786 </v-flex> 786 </v-flex>
787 <v-flex sm5 xs12> 787 <v-flex sm5 xs12>
788 <h5 class="my-1">{{ editedItem.presentAddress }}</h5> 788 <h5 class="my-1">{{ editedItem.presentAddress }}</h5>
789 </v-flex> 789 </v-flex>
790 </v-layout> 790 </v-layout>
791 </v-flex> 791 </v-flex>
792 <v-flex xs12 sm6> 792 <v-flex xs12 sm6>
793 <v-layout wrap> 793 <v-layout wrap>
794 <v-flex xs12 sm6> 794 <v-flex xs12 sm6>
795 <b> 795 <b>
796 <h5 class="my-1"> 796 <h5 class="my-1">
797 <b>Permanent Address:-</b> 797 <b>Permanent Address:-</b>
798 </h5> 798 </h5>
799 </b> 799 </b>
800 </v-flex> 800 </v-flex>
801 <v-flex sm6 xs12> 801 <v-flex sm6 xs12>
802 <h5 class="my-1">{{ editedItem.permanentAddress }}</h5> 802 <h5 class="my-1">{{ editedItem.permanentAddress }}</h5>
803 </v-flex> 803 </v-flex>
804 </v-layout> 804 </v-layout>
805 </v-flex> 805 </v-flex>
806 </v-layout> 806 </v-layout>
807 </v-container> 807 </v-container>
808 </v-card-text> 808 </v-card-text>
809 </v-card> 809 </v-card>
810 </v-dialog> 810 </v-dialog>
811 811
812 <!-- ****** STUDENTS TABLE ****** --> 812 <!-- ****** STUDENTS TABLE ****** -->
813 <v-toolbar color="transparent" flat> 813 <v-toolbar color="transparent" flat>
814 <v-btn 814 <v-btn
815 fab 815 fab
816 dark 816 dark
817 class="open-dialog-button hidden-xl-only hidden-md-only hidden-lg-only" 817 class="open-dialog-button hidden-xl-only hidden-md-only hidden-lg-only"
818 small 818 small
819 @click="addStudentDialog = true" 819 @click="addStudentDialog = true"
820 > 820 >
821 <v-icon dark>add</v-icon> 821 <v-icon dark>add</v-icon>
822 </v-btn> 822 </v-btn>
823 <v-btn 823 <v-btn
824 v-if="role != 'TEACHER' " 824 v-if="role != 'TEACHER' "
825 round 825 round
826 class="open-dialog-button hidden-sm-only hidden-xs-only" 826 class="open-dialog-button hidden-sm-only hidden-xs-only"
827 dark 827 dark
828 @click="addStudentDialog = true" 828 @click="addStudentDialog = true"
829 > 829 >
830 <v-icon class="white--text pr-1" size="20">add</v-icon>Add Student 830 <v-icon class="white--text pr-1" size="20">add</v-icon>Add Student
831 </v-btn> 831 </v-btn>
832 <v-card-actions class="hidden-xs-only hidden-sm-only"> 832 <v-card-actions class="hidden-xs-only hidden-sm-only">
833 <v-flex md13 lg12> 833 <v-flex md13 lg12>
834 <v-layout> 834 <v-layout>
835 <v-flex lg3 md4> 835 <v-flex lg3 md4>
836 <v-select 836 <v-select
837 :items="addclass" 837 :items="addclass"
838 label="Select Class" 838 label="Select Class"
839 v-model="selectStudents.select" 839 v-model="selectStudents.select"
840 item-text="classNum" 840 item-text="classNum"
841 item-value="_id" 841 item-value="_id"
842 name="Select Class" 842 name="Select Class"
843 :rules="classRules" 843 :rules="classRules"
844 @change="getSections(selectStudents.select)" 844 @change="getSections(selectStudents.select)"
845 required 845 required
846 class="ml-2" 846 class="ml-2"
847 ></v-select> 847 ></v-select>
848 </v-flex> 848 </v-flex>
849 <v-flex lg3 md4 class="ml-2"> 849 <v-flex lg3 md4 class="ml-2">
850 <v-layout> 850 <v-layout>
851 <v-select 851 <v-select
852 :items="addSection" 852 :items="addSection"
853 label="Select Section" 853 label="Select Section"
854 v-model="selectStudents.selectSection" 854 v-model="selectStudents.selectSection"
855 item-text="name" 855 item-text="name"
856 item-value="_id" 856 item-value="_id"
857 name="Select Section" 857 name="Select Section"
858 :rules="sectionRules"
859 required 858 required
860 ></v-select> 859 ></v-select>
861 </v-layout> 860 </v-layout>
862 </v-flex> 861 </v-flex>
863 </v-layout> 862 </v-layout>
864 </v-flex> 863 </v-flex>
865 </v-card-actions> 864 </v-card-actions>
866 <v-spacer></v-spacer> 865 <v-spacer></v-spacer>
867 <v-btn 866 <v-btn
868 @click="findStudents()" 867 @click="findStudents()"
869 round 868 round
870 dark 869 dark
871 :loading="loading" 870 :loading="loading"
872 class="open-dialog-button hidden-xs-only hidden-sm-only" 871 class="open-dialog-button hidden-xs-only hidden-sm-only"
873 >Find</v-btn> 872 >Find</v-btn>
874 <v-card-title class="body-1" v-show="show"> 873 <v-card-title class="body-1" v-show="show">
875 <v-btn icon large flat @click="displaySearch"> 874 <v-btn icon large flat @click="displaySearch">
876 <v-avatar size="27"> 875 <v-avatar size="27">
877 <img src="/static/icon/search.png" alt="icon" /> 876 <img src="/static/icon/search.png" alt="icon" />
878 </v-avatar> 877 </v-avatar>
879 </v-btn> 878 </v-btn>
880 </v-card-title> 879 </v-card-title>
881 <v-flex xs8 sm7 lg2 md3 v-if="showSearch"> 880 <v-flex xs8 sm7 lg2 md3 v-if="showSearch">
882 <v-layout> 881 <v-layout>
883 <v-text-field 882 <v-text-field
884 autofocus 883 autofocus
885 v-model="search" 884 v-model="search"
886 label="Search" 885 label="Search"
887 prepend-inner-icon="search" 886 prepend-inner-icon="search"
888 color="primary" 887 color="primary"
889 ></v-text-field> 888 ></v-text-field>
890 <v-icon @click="closeSearch" color="error">close</v-icon> 889 <v-icon @click="closeSearch" color="error">close</v-icon>
891 </v-layout> 890 </v-layout>
892 </v-flex> 891 </v-flex>
893 </v-toolbar> 892 </v-toolbar>
894 <v-card flat class="elevation-0 transparent"> 893 <v-card flat class="elevation-0 transparent">
895 <v-flex class="hidden-xl-only hidden-lg-only hidden-md-only"> 894 <v-flex class="hidden-xl-only hidden-lg-only hidden-md-only">
896 <v-layout> 895 <v-layout>
897 <v-flex xs4> 896 <v-flex xs4>
898 <label class="right mt-4">Select Class:</label> 897 <label class="right mt-4">Select Class:</label>
899 </v-flex> 898 </v-flex>
900 <v-flex xs8> 899 <v-flex xs8>
901 <v-select 900 <v-select
902 :items="addclass" 901 :items="addclass"
903 label="Select Class" 902 label="Select Class"
904 v-model="selectStudents.select" 903 v-model="selectStudents.select"
905 item-text="classNum" 904 item-text="classNum"
906 item-value="_id" 905 item-value="_id"
907 name="Select Class" 906 name="Select Class"
908 :rules="classRules" 907 :rules="classRules"
909 @change="getSections(selectStudents.select)" 908 @change="getSections(selectStudents.select)"
910 class="px-2" 909 class="px-2"
911 ></v-select> 910 ></v-select>
912 </v-flex> 911 </v-flex>
913 </v-layout> 912 </v-layout>
914 <v-layout> 913 <v-layout>
915 <v-flex xs4> 914 <v-flex xs4>
916 <label class="right mt-4">Select Section:</label> 915 <label class="right mt-4">Select Section:</label>
917 </v-flex> 916 </v-flex>
918 <v-flex xs8> 917 <v-flex xs8>
919 <v-select 918 <v-select
920 :items="addSection" 919 :items="addSection"
921 label="Select Section" 920 label="Select Section"
922 v-model="selectStudents.selectSection" 921 v-model="selectStudents.selectSection"
923 item-text="name" 922 item-text="name"
924 item-value="_id" 923 item-value="_id"
925 name="Select Section" 924 name="Select Section"
926 :rules="sectionRules" 925 :rules="sectionRules"
927 class="px-2" 926 class="px-2"
928 required 927 required
929 ></v-select> 928 ></v-select>
930 </v-flex> 929 </v-flex>
931 </v-layout> 930 </v-layout>
932 <v-layout> 931 <v-layout>
933 <v-flex xs5 class="mx-auto mb-2"> 932 <v-flex xs5 class="mx-auto mb-2">
934 <v-btn 933 <v-btn
935 @click="findStudents()" 934 @click="findStudents()"
936 block 935 block
937 round 936 round
938 dark 937 dark
939 :loading="loading" 938 :loading="loading"
940 class="add-button" 939 class="add-button"
941 >Find</v-btn> 940 >Find</v-btn>
942 </v-flex> 941 </v-flex>
943 </v-layout> 942 </v-layout>
944 </v-flex> 943 </v-flex>
945 </v-card> 944 </v-card>
946 <v-data-table 945 <v-data-table
947 :headers="headers" 946 :headers="headers"
948 :items="studentsData" 947 :items="studentsData"
949 :pagination.sync="pagination" 948 :pagination.sync="pagination"
950 :search="search" 949 :search="search"
951 > 950 >
952 <template slot="items" slot-scope="props"> 951 <template slot="items" slot-scope="props">
953 <tr class="tr"> 952 <tr class="tr">
954 <td class="text-xs-center td td-row">{{ props.item.rollNo}}</td> 953 <td class="text-xs-center td td-row">{{ props.item.rollNo}}</td>
955 <td class="text-xs-center td td-row"> 954 <td class="text-xs-center td td-row">
956 <v-avatar size="40"> 955 <v-avatar size="40">
957 <img :src="props.item.profilePicUrl" v-if="props.item.profilePicUrl" /> 956 <img :src="props.item.profilePicUrl" v-if="props.item.profilePicUrl" />
958 <img src="/static/icon/user.png" v-else-if="!props.item.profilePicUrl" /> 957 <img src="/static/icon/user.png" v-else-if="!props.item.profilePicUrl" />
959 </v-avatar> 958 </v-avatar>
960 </td> 959 </td>
961 <td class="text-xs-center td td-row">{{ props.item.name}}</td> 960 <td class="text-xs-center td td-row">{{ props.item.name}}</td>
962 <td class="text-xs-center td td-row">{{ props.item.gender }}</td> 961 <td class="text-xs-center td td-row">{{ props.item.gender }}</td>
963 <td class="text-xs-center td td-row">{{ props.item.parentId.fatherName }}</td> 962 <td
964 <td class="text-xs-center td td-row">{{ props.item.parentId.motherName }}</td> 963 class="text-xs-center td td-row"
964 >{{ props.item.parentId ? props.item.parentId.fatherName: '-' }}</td>
965 <td
966 class="text-xs-center td td-row"
967 >{{ props.item.parentId ? props.item.parentId.motherName: '-' }}</td>
965 <td class="text-xs-center td td-row">{{ props.item.establishmentYear }}</td> 968 <td class="text-xs-center td td-row">{{ props.item.establishmentYear }}</td>
966 <!-- <td class="text-xs-center td td-row">{{ props.item.mobile}}</td> --> 969 <!-- <td class="text-xs-center td td-row">{{ props.item.mobile}}</td> -->
967 <td class="text-xs-center td td-row"> 970 <td class="text-xs-center td td-row">
968 <v-switch 971 <v-switch
969 class="pl-3" 972 class="pl-3"
970 :disabled="role === 'TEACHER'" 973 :disabled="role === 'TEACHER'"
971 v-model="props.item.status" 974 v-model="props.item.status"
972 @change="suspendStudentStatus(props.item.status,props.item._id)" 975 @change="suspendStudentStatus(props.item.status,props.item._id)"
973 ></v-switch> 976 ></v-switch>
974 </td> 977 </td>
975 <td class="text-xs-center td td-row"> 978 <td class="text-xs-center td td-row">
976 <span> 979 <span>
977 <v-tooltip top> 980 <v-tooltip top>
978 <img 981 <img
979 slot="activator" 982 slot="activator"
980 style="cursor:pointer; width:25px; height:25px; " 983 style="cursor:pointer; width:25px; height:25px; "
981 class="mr-3" 984 class="mr-3"
982 @click="profile(props.item)" 985 @click="profile(props.item)"
983 src="/static/icon/view.png" 986 src="/static/icon/view.png"
984 /> 987 />
985 <span>View</span> 988 <span>View</span>
986 </v-tooltip> 989 </v-tooltip>
987 <v-tooltip top v-if="role != 'TEACHER' "> 990 <v-tooltip top v-if="role != 'TEACHER' ">
988 <img 991 <img
989 slot="activator" 992 slot="activator"
990 style="cursor:pointer; width:20px; height:18px; " 993 style="cursor:pointer; width:20px; height:18px; "
991 class="mr-3" 994 class="mr-3"
992 @click="editItem(props.item)" 995 @click="editItem(props.item)"
993 src="/static/icon/edit.png" 996 src="/static/icon/edit.png"
994 /> 997 />
995 <span>Edit</span> 998 <span>Edit</span>
996 </v-tooltip> 999 </v-tooltip>
997 <v-tooltip top v-if="role != 'TEACHER' "> 1000 <v-tooltip top v-if="role != 'TEACHER' ">
998 <img 1001 <img
999 slot="activator" 1002 slot="activator"
1000 style="cursor:pointer; width:20px; height:20px; " 1003 style="cursor:pointer; width:20px; height:20px; "
1001 class="mr-3" 1004 class="mr-3"
1002 @click="deleteItem(props.item)" 1005 @click="deleteItem(props.item)"
1003 src="/static/icon/delete.png" 1006 src="/static/icon/delete.png"
1004 /> 1007 />
1005 <span>Delete</span> 1008 <span>Delete</span>
1006 </v-tooltip> 1009 </v-tooltip>
1007 </span> 1010 </span>
1008 </td> 1011 </td>
1009 </tr> 1012 </tr>
1010 </template> 1013 </template>
1011 <v-alert 1014 <v-alert
1012 slot="no-results" 1015 slot="no-results"
1013 :value="true" 1016 :value="true"
1014 color="error" 1017 color="error"
1015 icon="warning" 1018 icon="warning"
1016 >Your search for "{{ search }}" found no results.</v-alert> 1019 >Your search for "{{ search }}" found no results.</v-alert>
1017 </v-data-table> 1020 </v-data-table>
1018 <!-- DIALOG -- ADD STUDENTS DETAILS --> 1021 <!-- DIALOG -- ADD STUDENTS DETAILS -->
1019 <v-dialog v-model="addStudentDialog" max-width="1280" v-if="addStudentDialog" persistent> 1022 <v-dialog v-model="addStudentDialog" max-width="1280" v-if="addStudentDialog" persistent>
1020 <v-card flat class="card-style pa-2" dark> 1023 <v-card flat class="card-style pa-2" dark>
1021 <v-layout> 1024 <v-layout>
1022 <v-flex xs12> 1025 <v-flex xs12>
1023 <label class="title text-xs-center">Add Student</label> 1026 <label class="title text-xs-center">Add Student</label>
1024 <v-icon 1027 <v-icon
1025 size="24" 1028 size="24"
1026 class="right" 1029 class="right"
1027 @click="$refs.parentForm.reset();$refs.parentFormLgScr.reset();$refs.form.reset();e2 = 1;addStudentDialog = false" 1030 @click="$refs.parentForm.reset();$refs.parentFormLgScr.reset();$refs.form.reset();e2 = 1;addStudentDialog = false"
1028 >cancel</v-icon> 1031 >cancel</v-icon>
1029 </v-flex> 1032 </v-flex>
1030 </v-layout> 1033 </v-layout>
1031 <v-container fluid> 1034 <v-container fluid>
1032 <v-layout align-center> 1035 <v-layout align-center>
1033 <v-flex xs12> 1036 <v-flex xs12>
1034 <v-stepper v-model="e2" flat class="card-style elevation-0" dark> 1037 <v-stepper v-model="e2" flat class="card-style elevation-0" dark>
1035 <v-stepper-header> 1038 <v-stepper-header>
1036 <v-stepper-step :complete="e2 > 1" step="1">Fill parent Details</v-stepper-step> 1039 <v-stepper-step :complete="e2 > 1" step="1">Fill parent Details</v-stepper-step>
1037 <v-divider></v-divider> 1040 <v-divider></v-divider>
1038 <v-stepper-step step="2">Fill Student Details</v-stepper-step> 1041 <v-stepper-step step="2">Fill Student Details</v-stepper-step>
1039 </v-stepper-header> 1042 </v-stepper-header>
1040 <v-stepper-items> 1043 <v-stepper-items>
1041 <v-stepper-content step="1"> 1044 <v-stepper-content step="1">
1042 <v-container fluid class> 1045 <v-container fluid class>
1043 <v-flex xs12 sm12 class="hidden-md-only hidden-lg-only hidden-xl-only"> 1046 <v-flex xs12 sm12 class="hidden-md-only hidden-lg-only hidden-xl-only">
1044 <v-form ref="parentForm" v-model="valid" lazy-validation> 1047 <v-form ref="parentForm" v-model="valid" lazy-validation>
1045 <v-layout wrap> 1048 <v-layout wrap>
1046 <v-flex xs12 sm6> 1049 <v-flex xs12 sm6>
1047 <v-layout wrap> 1050 <v-layout wrap>
1048 <v-flex xs12 class="pt-4 subheading"> 1051 <v-flex xs12 class="pt-4 subheading">
1049 <label>Father Cell No:</label> 1052 <label>Father Cell No:</label>
1050 </v-flex> 1053 </v-flex>
1051 <v-flex xs12> 1054 <v-flex xs12>
1052 <v-text-field 1055 <v-text-field
1053 v-model.trim="parentData.fatherCellNo" 1056 v-model.trim="parentData.fatherCellNo"
1054 placeholder="fill your father Cell Number" 1057 placeholder="fill your father Cell Number"
1055 type="number" 1058 type="number"
1056 :rules="fatheCellNoRules" 1059 :rules="fatheCellNoRules"
1057 counter="10" 1060 counter="10"
1058 v-on:keyup="getParentDetails()" 1061 v-on:keyup="getParentDetails()"
1059 required 1062 required
1060 ></v-text-field> 1063 ></v-text-field>
1061 </v-flex> 1064 </v-flex>
1062 </v-layout> 1065 </v-layout>
1063 </v-flex> 1066 </v-flex>
1064 <v-flex xs12 sm6> 1067 <v-flex xs12 sm6>
1065 <v-layout wrap> 1068 <v-layout wrap>
1066 <v-flex xs12 class="pt-4 subheading"> 1069 <v-flex xs12 class="pt-4 subheading">
1067 <label>Parent Email Id:</label> 1070 <label>Parent Email Id:</label>
1068 </v-flex> 1071 </v-flex>
1069 <v-flex xs12> 1072 <v-flex xs12>
1070 <v-text-field 1073 <v-text-field
1071 placeholder="fill Parent email" 1074 placeholder="fill Parent email"
1072 v-model="parentData.email" 1075 v-model="parentData.email"
1073 type="text" 1076 type="text"
1074 required 1077 required
1075 ></v-text-field> 1078 ></v-text-field>
1076 </v-flex> 1079 </v-flex>
1077 </v-layout> 1080 </v-layout>
1078 </v-flex> 1081 </v-flex>
1079 </v-layout> 1082 </v-layout>
1080 <v-layout wrap> 1083 <v-layout wrap>
1081 <v-flex xs12 sm6> 1084 <v-flex xs12 sm6>
1082 <v-layout wrap> 1085 <v-layout wrap>
1083 <v-flex xs12 class="pt-4 subheading"> 1086 <v-flex xs12 class="pt-4 subheading">
1084 <label>Father Name:</label> 1087 <label>Father Name:</label>
1085 </v-flex> 1088 </v-flex>
1086 <v-flex xs12> 1089 <v-flex xs12>
1087 <v-text-field 1090 <v-text-field
1088 v-model="parentData.fatherName" 1091 v-model="parentData.fatherName"
1089 placeholder="Fill your father Name" 1092 placeholder="Fill your father Name"
1090 required 1093 required
1091 ></v-text-field> 1094 ></v-text-field>
1092 </v-flex> 1095 </v-flex>
1093 </v-layout> 1096 </v-layout>
1094 </v-flex> 1097 </v-flex>
1095 <v-flex xs12 sm6> 1098 <v-flex xs12 sm6>
1096 <v-layout wrap> 1099 <v-layout wrap>
1097 <v-flex xs12 class="pt-4 subheading"> 1100 <v-flex xs12 class="pt-4 subheading">
1098 <label>Mother Name:</label> 1101 <label>Mother Name:</label>
1099 </v-flex> 1102 </v-flex>
1100 <v-flex xs12> 1103 <v-flex xs12>
1101 <v-text-field 1104 <v-text-field
1102 v-model="parentData.motherName" 1105 v-model="parentData.motherName"
1103 placeholder="fill your Mother Name" 1106 placeholder="fill your Mother Name"
1104 type="text" 1107 type="text"
1105 required 1108 required
1106 ></v-text-field> 1109 ></v-text-field>
1107 </v-flex> 1110 </v-flex>
1108 </v-layout> 1111 </v-layout>
1109 </v-flex> 1112 </v-flex>
1110 </v-layout> 1113 </v-layout>
1111 <v-layout wrap> 1114 <v-layout wrap>
1112 <v-flex xs12 sm6> 1115 <v-flex xs12 sm6>
1113 <v-layout wrap> 1116 <v-layout wrap>
1114 <v-flex xs12 class="pt-4 subheading"> 1117 <v-flex xs12 class="pt-4 subheading">
1115 <label>Mother Cell No:</label> 1118 <label>Mother Cell No:</label>
1116 </v-flex> 1119 </v-flex>
1117 <v-flex xs12> 1120 <v-flex xs12>
1118 <v-text-field 1121 <v-text-field
1119 v-model="parentData.motherCellNo" 1122 v-model="parentData.motherCellNo"
1120 placeholder="fill your Mother Cell Number" 1123 placeholder="fill your Mother Cell Number"
1121 type="number" 1124 type="number"
1122 required 1125 required
1123 ></v-text-field> 1126 ></v-text-field>
1124 </v-flex> 1127 </v-flex>
1125 </v-layout> 1128 </v-layout>
1126 </v-flex> 1129 </v-flex>
1127 <v-flex xs12 sm6> 1130 <v-flex xs12 sm6>
1128 <v-layout wrap> 1131 <v-layout wrap>
1129 <v-flex xs12 class="pt-4 subheading"> 1132 <v-flex xs12 class="pt-4 subheading">
1130 <label>Father Profession:</label> 1133 <label>Father Profession:</label>
1131 </v-flex> 1134 </v-flex>
1132 <v-flex xs12> 1135 <v-flex xs12>
1133 <v-text-field 1136 <v-text-field
1134 v-model="parentData.fatherProfession" 1137 v-model="parentData.fatherProfession"
1135 placeholder="fill your father profession" 1138 placeholder="fill your father profession"
1136 ></v-text-field> 1139 ></v-text-field>
1137 </v-flex> 1140 </v-flex>
1138 </v-layout> 1141 </v-layout>
1139 </v-flex> 1142 </v-flex>
1140 </v-layout> 1143 </v-layout>
1141 <v-layout wrap> 1144 <v-layout wrap>
1142 <v-flex xs12 sm6> 1145 <v-flex xs12 sm6>
1143 <v-layout wrap> 1146 <v-layout wrap>
1144 <v-flex xs12 class="pt-4 subheading"> 1147 <v-flex xs12 class="pt-4 subheading">
1145 <label>Mother Profession:</label> 1148 <label>Mother Profession:</label>
1146 </v-flex> 1149 </v-flex>
1147 <v-flex xs12> 1150 <v-flex xs12>
1148 <v-text-field 1151 <v-text-field
1149 v-model="parentData.motherProfession" 1152 v-model="parentData.motherProfession"
1150 placeholder="fill your mother profession" 1153 placeholder="fill your mother profession"
1151 ></v-text-field> 1154 ></v-text-field>
1152 </v-flex> 1155 </v-flex>
1153 </v-layout> 1156 </v-layout>
1154 </v-flex> 1157 </v-flex>
1155 <v-flex xs12 sm6> 1158 <v-flex xs12 sm6>
1156 <v-layout wrap> 1159 <v-layout wrap>
1157 <v-flex xs12 class="pt-4 subheading"> 1160 <v-flex xs12 class="pt-4 subheading">
1158 <label>Password:</label> 1161 <label>Password:</label>
1159 </v-flex> 1162 </v-flex>
1160 <v-flex xs12> 1163 <v-flex xs12>
1161 <v-text-field 1164 <v-text-field
1162 v-model="parentData.password" 1165 v-model="parentData.password"
1163 placeholder="Enter Your Password" 1166 placeholder="Enter Your Password"
1164 ></v-text-field> 1167 ></v-text-field>
1165 </v-flex> 1168 </v-flex>
1166 </v-layout> 1169 </v-layout>
1167 </v-flex> 1170 </v-flex>
1168 </v-layout> 1171 </v-layout>
1169 <v-flex sm12 class="hidden-xs-only"> 1172 <v-flex sm12 class="hidden-xs-only">
1170 <v-card-actions> 1173 <v-card-actions>
1171 <v-spacer></v-spacer> 1174 <v-spacer></v-spacer>
1172 <v-btn 1175 <v-btn
1173 @click="submitParentDetails" 1176 @click="submitParentDetails"
1174 round 1177 round
1175 dark 1178 dark
1176 :loading="loading" 1179 :loading="loading"
1177 v-show="showParent" 1180 v-show="showParent"
1178 class="add-button" 1181 class="add-button"
1179 >Add</v-btn> 1182 >Add</v-btn>
1180 <v-btn 1183 <v-btn
1181 v-show="showNext" 1184 v-show="showNext"
1182 @click="e2 = 2" 1185 @click="e2 = 2"
1183 round 1186 round
1184 dark 1187 dark
1185 class="add-button" 1188 class="add-button"
1186 >Next</v-btn> 1189 >Next</v-btn>
1187 </v-card-actions> 1190 </v-card-actions>
1188 </v-flex> 1191 </v-flex>
1189 <v-flex 1192 <v-flex
1190 xs6 1193 xs6
1191 class="hidden-md-only hidden-sm-only hidden-lg-only hidden-xl-only mx-auto mt-2" 1194 class="hidden-md-only hidden-sm-only hidden-lg-only hidden-xl-only mx-auto mt-2"
1192 > 1195 >
1193 <v-btn 1196 <v-btn
1194 @click="submitParentDetails" 1197 @click="submitParentDetails"
1195 round 1198 round
1196 dark 1199 dark
1197 :loading="loading" 1200 :loading="loading"
1198 v-show="showParent" 1201 v-show="showParent"
1199 class="add-button" 1202 class="add-button"
1200 >Add</v-btn> 1203 >Add</v-btn>
1201 <v-btn 1204 <v-btn
1202 v-show="showNext" 1205 v-show="showNext"
1203 @click="e2 = 2" 1206 @click="e2 = 2"
1204 round 1207 round
1205 dark 1208 dark
1206 class="add-button" 1209 class="add-button"
1207 >Next</v-btn> 1210 >Next</v-btn>
1208 </v-flex> 1211 </v-flex>
1209 </v-form> 1212 </v-form>
1210 </v-flex> 1213 </v-flex>
1211 <v-flex xs12 sm12 class="hidden-xs-only hidden-sm-only"> 1214 <v-flex xs12 sm12 class="hidden-xs-only hidden-sm-only">
1212 <v-form ref="parentFormLgScr" v-model="valid" lazy-validation> 1215 <v-form ref="parentFormLgScr" v-model="valid" lazy-validation>
1213 <v-layout wrap> 1216 <v-layout wrap>
1214 <v-flex xs12 sm6> 1217 <v-flex xs12 sm6>
1215 <v-layout> 1218 <v-layout>
1216 <v-flex xs4 class="pt-4 subheading"> 1219 <v-flex xs4 class="pt-4 subheading">
1217 <label class="right">Father Cell No:</label> 1220 <label class="right">Father Cell No:</label>
1218 </v-flex> 1221 </v-flex>
1219 <v-flex xs8 class="ml-3"> 1222 <v-flex xs8 class="ml-3">
1220 <v-text-field 1223 <v-text-field
1221 v-model.trim="parentData.fatherCellNo" 1224 v-model.trim="parentData.fatherCellNo"
1222 placeholder="fill your father Cell Number" 1225 placeholder="fill your father Cell Number"
1223 type="number" 1226 type="number"
1224 :rules="fatheCellNoRules" 1227 :rules="fatheCellNoRules"
1225 counter="10" 1228 counter="10"
1226 required 1229 required
1227 v-on:keyup="getParentDetails()" 1230 v-on:keyup="getParentDetails()"
1228 ></v-text-field> 1231 ></v-text-field>
1229 </v-flex> 1232 </v-flex>
1230 </v-layout> 1233 </v-layout>
1231 </v-flex> 1234 </v-flex>
1232 <v-flex xs12 sm6> 1235 <v-flex xs12 sm6>
1233 <v-layout> 1236 <v-layout>
1234 <v-flex xs4 class="pt-4 subheading"> 1237 <v-flex xs4 class="pt-4 subheading">
1235 <label class="right">Parent Email Id:</label> 1238 <label class="right">Parent Email Id:</label>
1236 </v-flex> 1239 </v-flex>
1237 <v-flex xs8 class="ml-3"> 1240 <v-flex xs8 class="ml-3">
1238 <v-text-field 1241 <v-text-field
1239 placeholder="fill Parent email" 1242 placeholder="fill Parent email"
1240 v-model="parentData.email" 1243 v-model="parentData.email"
1241 type="text" 1244 type="text"
1242 required 1245 required
1243 ></v-text-field> 1246 ></v-text-field>
1244 </v-flex> 1247 </v-flex>
1245 </v-layout> 1248 </v-layout>
1246 </v-flex> 1249 </v-flex>
1247 </v-layout> 1250 </v-layout>
1248 <v-layout wrap> 1251 <v-layout wrap>
1249 <v-flex xs12 sm6> 1252 <v-flex xs12 sm6>
1250 <v-layout> 1253 <v-layout>
1251 <v-flex xs4 class="pt-4 subheading"> 1254 <v-flex xs4 class="pt-4 subheading">
1252 <label class="right">Father Name:</label> 1255 <label class="right">Father Name:</label>
1253 </v-flex> 1256 </v-flex>
1254 <v-flex xs8 class="ml-3"> 1257 <v-flex xs8 class="ml-3">
1255 <v-text-field 1258 <v-text-field
1256 v-model="parentData.fatherName" 1259 v-model="parentData.fatherName"
1257 placeholder="Fill your father Name" 1260 placeholder="Fill your father Name"
1258 required 1261 required
1259 ></v-text-field> 1262 ></v-text-field>
1260 </v-flex> 1263 </v-flex>
1261 </v-layout> 1264 </v-layout>
1262 </v-flex> 1265 </v-flex>
1263 <v-flex xs12 sm6> 1266 <v-flex xs12 sm6>
1264 <v-layout> 1267 <v-layout>
1265 <v-flex xs4 class="pt-4 subheading"> 1268 <v-flex xs4 class="pt-4 subheading">
1266 <label class="right">Mother Name:</label> 1269 <label class="right">Mother Name:</label>
1267 </v-flex> 1270 </v-flex>
1268 <v-flex xs8 class="ml-3"> 1271 <v-flex xs8 class="ml-3">
1269 <v-text-field 1272 <v-text-field
1270 v-model="parentData.motherName" 1273 v-model="parentData.motherName"
1271 placeholder="fill your Mother Name" 1274 placeholder="fill your Mother Name"
1272 type="text" 1275 type="text"
1273 required 1276 required
1274 ></v-text-field> 1277 ></v-text-field>
1275 </v-flex> 1278 </v-flex>
1276 </v-layout> 1279 </v-layout>
1277 </v-flex> 1280 </v-flex>
1278 </v-layout> 1281 </v-layout>
1279 <v-layout wrap> 1282 <v-layout wrap>
1280 <v-flex xs12 sm6> 1283 <v-flex xs12 sm6>
1281 <v-layout> 1284 <v-layout>
1282 <v-flex xs4 class="pt-4 subheading"> 1285 <v-flex xs4 class="pt-4 subheading">
1283 <label class="right">Mother Cell No:</label> 1286 <label class="right">Mother Cell No:</label>
1284 </v-flex> 1287 </v-flex>
1285 <v-flex xs8 class="ml-3"> 1288 <v-flex xs8 class="ml-3">
1286 <v-text-field 1289 <v-text-field
1287 v-model="parentData.motherCellNo" 1290 v-model="parentData.motherCellNo"
1288 placeholder="fill your Mother Cell Number" 1291 placeholder="fill your Mother Cell Number"
1289 type="number" 1292 type="number"
1290 required 1293 required
1291 ></v-text-field> 1294 ></v-text-field>
1292 </v-flex> 1295 </v-flex>
1293 </v-layout> 1296 </v-layout>
1294 </v-flex> 1297 </v-flex>
1295 <v-flex xs12 sm6> 1298 <v-flex xs12 sm6>
1296 <v-layout> 1299 <v-layout>
1297 <v-flex xs4 class="pt-4 subheading"> 1300 <v-flex xs4 class="pt-4 subheading">
1298 <label class="right">Father Profession:</label> 1301 <label class="right">Father Profession:</label>
1299 </v-flex> 1302 </v-flex>
1300 <v-flex xs8 class="ml-3"> 1303 <v-flex xs8 class="ml-3">
1301 <v-text-field 1304 <v-text-field
1302 v-model="parentData.fatherProfession" 1305 v-model="parentData.fatherProfession"
1303 placeholder="fill your father profession" 1306 placeholder="fill your father profession"
1304 ></v-text-field> 1307 ></v-text-field>
1305 </v-flex> 1308 </v-flex>
1306 </v-layout> 1309 </v-layout>
1307 </v-flex> 1310 </v-flex>
1308 </v-layout> 1311 </v-layout>
1309 <v-layout wrap> 1312 <v-layout wrap>
1310 <v-flex xs12 sm6> 1313 <v-flex xs12 sm6>
1311 <v-layout> 1314 <v-layout>
1312 <v-flex xs4 class="pt-4 subheading"> 1315 <v-flex xs4 class="pt-4 subheading">
1313 <label class="right">Mother Profession:</label> 1316 <label class="right">Mother Profession:</label>
1314 </v-flex> 1317 </v-flex>
1315 <v-flex xs8 class="ml-3"> 1318 <v-flex xs8 class="ml-3">
1316 <v-text-field 1319 <v-text-field
1317 v-model="parentData.motherProfession" 1320 v-model="parentData.motherProfession"
1318 placeholder="fill your mother profession" 1321 placeholder="fill your mother profession"
1319 ></v-text-field> 1322 ></v-text-field>
1320 </v-flex> 1323 </v-flex>
1321 </v-layout> 1324 </v-layout>
1322 </v-flex> 1325 </v-flex>
1323 <v-flex xs12 sm6> 1326 <v-flex xs12 sm6>
1324 <v-layout> 1327 <v-layout>
1325 <v-flex xs4 class="pt-4 subheading"> 1328 <v-flex xs4 class="pt-4 subheading">
1326 <label class="right">Password:</label> 1329 <label class="right">Password:</label>
1327 </v-flex> 1330 </v-flex>
1328 <v-flex xs8 class="ml-3"> 1331 <v-flex xs8 class="ml-3">
1329 <v-text-field 1332 <v-text-field
1330 :append-icon="e1 ? 'visibility_off' : 'visibility'" 1333 :append-icon="e1 ? 'visibility_off' : 'visibility'"
1331 :append-icon-cb="() => (e1 = !e1)" 1334 :append-icon-cb="() => (e1 = !e1)"
1332 :type="e1 ? 'password' : 'text'" 1335 :type="e1 ? 'password' : 'text'"
1333 :rules="password" 1336 :rules="password"
1334 v-model="parentData.password" 1337 v-model="parentData.password"
1335 placeholder="Enter Your Password" 1338 placeholder="Enter Your Password"
1336 :disabled="isFatherCellExists" 1339 :disabled="isFatherCellExists"
1337 required 1340 required
1338 ></v-text-field> 1341 ></v-text-field>
1339 </v-flex> 1342 </v-flex>
1340 </v-layout> 1343 </v-layout>
1341 </v-flex> 1344 </v-flex>
1342 </v-layout> 1345 </v-layout>
1343 <v-flex sm12 class="hidden-xs-only"> 1346 <v-flex sm12 class="hidden-xs-only">
1344 <v-card-actions> 1347 <v-card-actions>
1345 <v-spacer></v-spacer> 1348 <v-spacer></v-spacer>
1346 <v-btn 1349 <v-btn
1347 @click="submitParentDetails" 1350 @click="submitParentDetails"
1348 round 1351 round
1349 dark 1352 dark
1350 :loading="loading" 1353 :loading="loading"
1351 v-show="showParent" 1354 v-show="showParent"
1352 class="add-button" 1355 class="add-button"
1353 >Add</v-btn> 1356 >Add</v-btn>
1354 <v-btn 1357 <v-btn
1355 v-show="showNext" 1358 v-show="showNext"
1356 @click="e2 = 2" 1359 @click="e2 = 2"
1357 round 1360 round
1358 dark 1361 dark
1359 class="add-button" 1362 class="add-button"
1360 >Next</v-btn> 1363 >Next</v-btn>
1361 </v-card-actions> 1364 </v-card-actions>
1362 </v-flex> 1365 </v-flex>
1363 <v-flex 1366 <v-flex
1364 xs6 1367 xs6
1365 class="hidden-md-only hidden-sm-only hidden-lg-only hidden-xl-only mx-auto mt-2" 1368 class="hidden-md-only hidden-sm-only hidden-lg-only hidden-xl-only mx-auto mt-2"
1366 > 1369 >
1367 <v-btn 1370 <v-btn
1368 @click="submitParentDetails" 1371 @click="submitParentDetails"
1369 round 1372 round
1370 dark 1373 dark
1371 :loading="loading" 1374 :loading="loading"
1372 v-show="showParent" 1375 v-show="showParent"
1373 class="add-button" 1376 class="add-button"
1374 >Add</v-btn> 1377 >Add</v-btn>
1375 <v-btn 1378 <v-btn
1376 v-show="showNext" 1379 v-show="showNext"
1377 @click="e2 = 2" 1380 @click="e2 = 2"
1378 round 1381 round
1379 dark 1382 dark
1380 class="add-button" 1383 class="add-button"
1381 >Next</v-btn> 1384 >Next</v-btn>
1382 </v-flex> 1385 </v-flex>
1383 </v-form> 1386 </v-form>
1384 </v-flex> 1387 </v-flex>
1385 </v-container> 1388 </v-container>
1386 </v-stepper-content> 1389 </v-stepper-content>
1387 <v-stepper-content step="2"> 1390 <v-stepper-content step="2">
1388 <v-flex xs12 sm12> 1391 <v-flex xs12 sm12>
1389 <v-form ref="form" v-model="valid" lazy-validation> 1392 <v-form ref="form" v-model="valid" lazy-validation>
1390 <v-layout> 1393 <v-layout>
1391 <v-flex 1394 <v-flex
1392 xs12 1395 xs12
1393 class="text-xs-center text-sm-center text-md-center text-lg-center" 1396 class="text-xs-center text-sm-center text-md-center text-lg-center"
1394 > 1397 >
1395 <v-avatar size="100px"> 1398 <v-avatar size="100px">
1396 <img src="/static/icon/user.png" v-if="!imageUrl" /> 1399 <img src="/static/icon/user.png" v-if="!imageUrl" />
1397 </v-avatar> 1400 </v-avatar>
1398 <input 1401 <input
1399 type="file" 1402 type="file"
1400 style="display: none" 1403 style="display: none"
1401 ref="image" 1404 ref="image"
1402 accept="image/*" 1405 accept="image/*"
1403 @change="onFilePicked" 1406 @change="onFilePicked"
1404 /> 1407 />
1405 <img 1408 <img
1406 :src="imageData.imageUrl" 1409 :src="imageData.imageUrl"
1407 height="150" 1410 height="150"
1408 v-if="imageUrl" 1411 v-if="imageUrl"
1409 style="border-radius:50%; width:200px" 1412 style="border-radius:50%; width:200px"
1410 /> 1413 />
1411 </v-flex> 1414 </v-flex>
1412 </v-layout> 1415 </v-layout>
1413 <v-layout wrap> 1416 <v-layout wrap>
1414 <v-flex xs12 sm6> 1417 <v-flex xs12 sm6>
1415 <v-layout> 1418 <v-layout>
1416 <v-flex x4 sm4 class="pt-4 subheading"> 1419 <v-flex x4 sm4 class="pt-4 subheading">
1417 <label class="right hidden-xs-only hidden-sm-only">Select Class:</label> 1420 <label class="right hidden-xs-only hidden-sm-only">Select Class:</label>
1418 <label 1421 <label
1419 class="right hidden-lg-only hidden-md-only hidden-xl-only" 1422 class="right hidden-lg-only hidden-md-only hidden-xl-only"
1420 >Class:</label> 1423 >Class:</label>
1421 </v-flex> 1424 </v-flex>
1422 <v-flex xs8 sm8 class="ml-3"> 1425 <v-flex xs8 sm8 class="ml-3">
1423 <v-select 1426 <v-select
1424 :items="addclass" 1427 :items="addclass"
1425 label="Select Class" 1428 label="Select Class"
1426 v-model="addStudents.select" 1429 v-model="addStudents.select"
1427 item-text="classNum" 1430 item-text="classNum"
1428 item-value="_id" 1431 item-value="_id"
1429 name="Select Class" 1432 name="Select Class"
1430 :rules="classRules" 1433 :rules="classRules"
1431 @change="getSection(addStudents.select)" 1434 @change="getSection(addStudents.select)"
1432 required 1435 required
1433 ></v-select> 1436 ></v-select>
1434 </v-flex> 1437 </v-flex>
1435 </v-layout> 1438 </v-layout>
1436 </v-flex> 1439 </v-flex>
1437 <v-flex xs12 sm6> 1440 <v-flex xs12 sm6>
1438 <v-layout> 1441 <v-layout>
1439 <v-flex xs4 class="pt-4 subheading"> 1442 <v-flex xs4 class="pt-4 subheading">
1440 <label class="right hidden-xs-only hidden-sm-only">Select Section:</label> 1443 <label class="right hidden-xs-only hidden-sm-only">Select Section:</label>
1441 <label 1444 <label
1442 class="right hidden-lg-only hidden-md-only hidden-xl-only" 1445 class="right hidden-lg-only hidden-md-only hidden-xl-only"
1443 >Section:</label> 1446 >Section:</label>
1444 </v-flex> 1447 </v-flex>
1445 <v-flex xs8 class="ml-3"> 1448 <v-flex xs8 class="ml-3">
1446 <v-select 1449 <v-select
1447 :items="addSection" 1450 :items="addSection"
1448 label="Select Section" 1451 label="Select Section"
1449 v-model="addStudents.selectSection" 1452 v-model="addStudents.selectSection"
1450 item-text="name" 1453 item-text="name"
1451 item-value="_id" 1454 item-value="_id"
1452 name="Select Section" 1455 name="Select Section"
1453 :rules="sectionRules" 1456 :rules="sectionRules"
1454 required 1457 required
1455 ></v-select> 1458 ></v-select>
1456 </v-flex> 1459 </v-flex>
1457 </v-layout> 1460 </v-layout>
1458 </v-flex> 1461 </v-flex>
1459 </v-layout> 1462 </v-layout>
1460 <v-layout wrap> 1463 <v-layout wrap>
1461 <v-flex xs12 sm6> 1464 <v-flex xs12 sm6>
1462 <v-layout> 1465 <v-layout>
1463 <v-flex xs4 sm4 class="pt-4 subheading"> 1466 <v-flex xs4 sm4 class="pt-4 subheading">
1464 <label class="right hidden-xs-only hidden-sm-only">Full Name:</label> 1467 <label class="right hidden-xs-only hidden-sm-only">Full Name:</label>
1465 <label 1468 <label
1466 class="right hidden-lg-only hidden-md-only hidden-xl-only" 1469 class="right hidden-lg-only hidden-md-only hidden-xl-only"
1467 >Name:</label> 1470 >Name:</label>
1468 </v-flex> 1471 </v-flex>
1469 <v-flex xs8 sm8 class="ml-3"> 1472 <v-flex xs8 sm8 class="ml-3">
1470 <v-text-field 1473 <v-text-field
1471 v-model="addStudents.name" 1474 v-model="addStudents.name"
1472 placeholder="fill your full Name" 1475 placeholder="fill your full Name"
1473 name="name" 1476 name="name"
1474 type="text" 1477 type="text"
1475 :rules="nameRules" 1478 :rules="nameRules"
1476 required 1479 required
1477 ></v-text-field> 1480 ></v-text-field>
1478 </v-flex> 1481 </v-flex>
1479 </v-layout> 1482 </v-layout>
1480 </v-flex> 1483 </v-flex>
1481 <v-flex xs12 sm6> 1484 <v-flex xs12 sm6>
1482 <v-layout> 1485 <v-layout>
1483 <v-flex xs4 sm4 class="pt-4 subheading"> 1486 <v-flex xs4 sm4 class="pt-4 subheading">
1484 <label class="right">Email:</label> 1487 <label class="right">Email:</label>
1485 </v-flex> 1488 </v-flex>
1486 <v-flex xs8 sm8 class="ml-3"> 1489 <v-flex xs8 sm8 class="ml-3">
1487 <v-text-field 1490 <v-text-field
1488 placeholder="fill your email" 1491 placeholder="fill your email"
1489 v-model="addStudents.email" 1492 v-model="addStudents.email"
1490 type="text" 1493 type="text"
1491 name="email" 1494 name="email"
1492 required 1495 required
1493 ></v-text-field> 1496 ></v-text-field>
1494 </v-flex> 1497 </v-flex>
1495 </v-layout> 1498 </v-layout>
1496 </v-flex> 1499 </v-flex>
1497 </v-layout> 1500 </v-layout>
1498 <v-layout wrap> 1501 <v-layout wrap>
1499 <v-flex xs12 sm6> 1502 <v-flex xs12 sm6>
1500 <v-layout> 1503 <v-layout>
1501 <v-flex xs4 sm4 class="pt-4 subheading"> 1504 <v-flex xs4 sm4 class="pt-4 subheading">
1502 <label class="right hidden-sm-only hidden-xs-only">Date of Birth:</label> 1505 <label class="right hidden-sm-only hidden-xs-only">Date of Birth:</label>
1503 <label 1506 <label
1504 class="right hidden-lg-only hidden-xl-only hidden-md-only" 1507 class="right hidden-lg-only hidden-xl-only hidden-md-only"
1505 >D.O.B:</label> 1508 >D.O.B:</label>
1506 </v-flex> 1509 </v-flex>
1507 <v-flex xs8 sm8 class="ml-3"> 1510 <v-flex xs8 sm8 class="ml-3">
1508 <v-menu 1511 <v-menu
1509 ref="menu" 1512 ref="menu"
1510 :close-on-content-click="false" 1513 :close-on-content-click="false"
1511 v-model="menu" 1514 v-model="menu"
1512 :nudge-right="40" 1515 :nudge-right="40"
1513 lazy 1516 lazy
1514 transition="scale-transition" 1517 transition="scale-transition"
1515 offset-y 1518 offset-y
1516 full-width 1519 full-width
1517 min-width="290px" 1520 min-width="290px"
1518 > 1521 >
1519 <v-text-field 1522 <v-text-field
1520 slot="activator" 1523 slot="activator"
1521 :rules="dateRules" 1524 :rules="dateRules"
1522 v-model="addStudents.date" 1525 v-model="addStudents.date"
1523 placeholder="Select date" 1526 placeholder="Select date"
1524 ></v-text-field> 1527 ></v-text-field>
1525 <v-date-picker 1528 <v-date-picker
1526 ref="picker" 1529 ref="picker"
1527 v-model="addStudents.date" 1530 v-model="addStudents.date"
1528 :max="new Date().toISOString().substr(0, 10)" 1531 :max="new Date().toISOString().substr(0, 10)"
1529 min="1950-01-01" 1532 min="1950-01-01"
1530 @input="menu = false" 1533 @input="menu = false"
1531 ></v-date-picker> 1534 ></v-date-picker>
1532 </v-menu> 1535 </v-menu>
1533 </v-flex> 1536 </v-flex>
1534 </v-layout> 1537 </v-layout>
1535 </v-flex> 1538 </v-flex>
1536 <v-flex xs12 sm6> 1539 <v-flex xs12 sm6>
1537 <v-layout> 1540 <v-layout>
1538 <v-flex xs4 class="pt-4 subheading"> 1541 <v-flex xs4 class="pt-4 subheading">
1539 <label class="right">City:</label> 1542 <label class="right">City:</label>
1540 </v-flex> 1543 </v-flex>
1541 <v-flex xs8 class="ml-3"> 1544 <v-flex xs8 class="ml-3">
1542 <v-text-field 1545 <v-text-field
1543 v-model="addStudents.city" 1546 v-model="addStudents.city"
1544 placeholder="fill your City Name" 1547 placeholder="fill your City Name"
1545 name="City" 1548 name="City"
1546 type="text" 1549 type="text"
1547 :rules="cityRules" 1550 :rules="cityRules"
1548 required 1551 required
1549 ></v-text-field> 1552 ></v-text-field>
1550 </v-flex> 1553 </v-flex>
1551 </v-layout> 1554 </v-layout>
1552 </v-flex> 1555 </v-flex>
1553 </v-layout> 1556 </v-layout>
1554 <v-layout wrap> 1557 <v-layout wrap>
1555 <v-flex xs12 sm6> 1558 <v-flex xs12 sm6>
1556 <v-layout> 1559 <v-layout>
1557 <v-flex xs4 class="pt-4 subheading"> 1560 <v-flex xs4 class="pt-4 subheading">
1558 <label class="right">State:</label> 1561 <label class="right">State:</label>
1559 </v-flex> 1562 </v-flex>
1560 <v-flex xs8 class="ml-3"> 1563 <v-flex xs8 class="ml-3">
1561 <v-text-field 1564 <v-text-field
1562 v-model="addStudents.state" 1565 v-model="addStudents.state"
1563 placeholder="fill your State Name" 1566 placeholder="fill your State Name"
1564 name="state" 1567 name="state"
1565 type="text" 1568 type="text"
1566 :rules="stateRules" 1569 :rules="stateRules"
1567 required 1570 required
1568 ></v-text-field> 1571 ></v-text-field>
1569 </v-flex> 1572 </v-flex>
1570 </v-layout> 1573 </v-layout>
1571 </v-flex> 1574 </v-flex>
1572 <v-flex xs12 sm6> 1575 <v-flex xs12 sm6>
1573 <v-layout> 1576 <v-layout>
1574 <v-flex xs4 class="pt-4 subheading"> 1577 <v-flex xs4 class="pt-4 subheading">
1575 <label class="right">Pincode:</label> 1578 <label class="right">Pincode:</label>
1576 </v-flex> 1579 </v-flex>
1577 <v-flex xs8 class="ml-3"> 1580 <v-flex xs8 class="ml-3">
1578 <v-text-field 1581 <v-text-field
1579 v-model="addStudents.pincode" 1582 v-model="addStudents.pincode"
1580 placeholder="fill your pincode" 1583 placeholder="fill your pincode"
1581 name="pincode" 1584 name="pincode"
1582 type="number" 1585 type="number"
1583 :rules="pincode" 1586 :rules="pincode"
1584 required 1587 required
1585 ></v-text-field> 1588 ></v-text-field>
1586 </v-flex> 1589 </v-flex>
1587 </v-layout> 1590 </v-layout>
1588 </v-flex> 1591 </v-flex>
1589 </v-layout> 1592 </v-layout>
1590 <v-layout wrap> 1593 <v-layout wrap>
1591 <v-flex xs12 sm6> 1594 <v-flex xs12 sm6>
1592 <v-layout> 1595 <v-layout>
1593 <v-flex xs4 class="pt-4 subheading"> 1596 <v-flex xs4 class="pt-4 subheading">
1594 <label class="right hidden-xs-only hidden-sm-only">Mobile No:</label> 1597 <label class="right hidden-xs-only hidden-sm-only">Mobile No:</label>
1595 <label 1598 <label
1596 class="right hidden-lg-only hidden-md-only hidden-xl-only" 1599 class="right hidden-lg-only hidden-md-only hidden-xl-only"
1597 >Mobile:</label> 1600 >Mobile:</label>
1598 </v-flex> 1601 </v-flex>
1599 <v-flex xs8 class="ml-3"> 1602 <v-flex xs8 class="ml-3">
1600 <v-text-field 1603 <v-text-field
1601 v-model="addStudents.mobile" 1604 v-model="addStudents.mobile"
1602 placeholder="fill your MobileNo" 1605 placeholder="fill your MobileNo"
1603 name="mobileNo" 1606 name="mobileNo"
1604 type="number" 1607 type="number"
1605 ></v-text-field> 1608 ></v-text-field>
1606 </v-flex> 1609 </v-flex>
1607 </v-layout> 1610 </v-layout>
1608 </v-flex> 1611 </v-flex>
1609 <v-flex xs12 sm6> 1612 <v-flex xs12 sm6>
1610 <v-layout> 1613 <v-layout>
1611 <v-flex xs4 class="pt-4 subheading"> 1614 <v-flex xs4 class="pt-4 subheading">
1612 <label class="right hidden-xs-only hidden-sm-only">Select Country:</label> 1615 <label class="right hidden-xs-only hidden-sm-only">Select Country:</label>
1613 <label 1616 <label
1614 class="right hidden-lg-only hidden-md-only hidden-xl-only" 1617 class="right hidden-lg-only hidden-md-only hidden-xl-only"
1615 >Country:</label> 1618 >Country:</label>
1616 </v-flex> 1619 </v-flex>
1617 <v-flex xs8 class="ml-3"> 1620 <v-flex xs8 class="ml-3">
1618 <v-autocomplete 1621 <v-autocomplete
1619 v-model="addStudents.country" 1622 v-model="addStudents.country"
1620 :rules="country" 1623 :rules="country"
1621 :items="countries" 1624 :items="countries"
1622 placeholder="Select Country Name" 1625 placeholder="Select Country Name"
1623 required 1626 required
1624 ></v-autocomplete> 1627 ></v-autocomplete>
1625 </v-flex> 1628 </v-flex>
1626 </v-layout> 1629 </v-layout>
1627 </v-flex> 1630 </v-flex>
1628 </v-layout> 1631 </v-layout>
1629 <v-layout wrap> 1632 <v-layout wrap>
1630 <v-flex xs12 sm6> 1633 <v-flex xs12 sm6>
1631 <v-layout> 1634 <v-layout>
1632 <v-flex xs4 class="pt-4 subheading"> 1635 <v-flex xs4 class="pt-4 subheading">
1633 <label class="right">Gender:</label> 1636 <label class="right">Gender:</label>
1634 </v-flex> 1637 </v-flex>
1635 <v-flex xs8 class="ml-3"> 1638 <v-flex xs8 class="ml-3">
1636 <v-select 1639 <v-select
1637 :items="gender" 1640 :items="gender"
1638 v-model="addStudents.gender" 1641 v-model="addStudents.gender"
1639 :rules="genderRules" 1642 :rules="genderRules"
1640 label="Select Gender" 1643 label="Select Gender"
1641 required 1644 required
1642 ></v-select> 1645 ></v-select>
1643 </v-flex> 1646 </v-flex>
1644 </v-layout> 1647 </v-layout>
1645 </v-flex> 1648 </v-flex>
1646 <v-flex xs12 sm6> 1649 <v-flex xs12 sm6>
1647 <v-layout> 1650 <v-layout>
1648 <v-flex xs4 class="pt-4 subheading"> 1651 <v-flex xs4 class="pt-4 subheading">
1649 <label class="right hidden-xs-only hidden-sm-only">Blood Group:</label> 1652 <label class="right hidden-xs-only hidden-sm-only">Blood Group:</label>
1650 <label 1653 <label
1651 class="right hidden-lg-only hidden-md-only hidden-xl-only" 1654 class="right hidden-lg-only hidden-md-only hidden-xl-only"
1652 >Blood:</label> 1655 >Blood:</label>
1653 </v-flex> 1656 </v-flex>
1654 <v-flex xs8 class="ml-3"> 1657 <v-flex xs8 class="ml-3">
1655 <v-text-field 1658 <v-text-field
1656 v-model="addStudents.bloodGroup" 1659 v-model="addStudents.bloodGroup"
1657 placeholder="Fill your Blood Group" 1660 placeholder="Fill your Blood Group"
1658 required 1661 required
1659 ></v-text-field> 1662 ></v-text-field>
1660 </v-flex> 1663 </v-flex>
1661 </v-layout> 1664 </v-layout>
1662 </v-flex> 1665 </v-flex>
1663 </v-layout> 1666 </v-layout>
1664 <v-layout wrap> 1667 <v-layout wrap>
1665 <v-flex xs12 sm6> 1668 <v-flex xs12 sm6>
1666 <v-layout> 1669 <v-layout>
1667 <v-flex xs4 class="pt-4 subheading"> 1670 <v-flex xs4 class="pt-4 subheading">
1668 <label class="right hidden-xs-only hidden-sm-only">Roll Number:</label> 1671 <label class="right hidden-xs-only hidden-sm-only">Roll Number:</label>
1669 <label 1672 <label
1670 class="right hidden-lg-only hidden-md-only hidden-xl-only" 1673 class="right hidden-lg-only hidden-md-only hidden-xl-only"
1671 >Roll No:</label> 1674 >Roll No:</label>
1672 </v-flex> 1675 </v-flex>
1673 <v-flex xs8 class="ml-3"> 1676 <v-flex xs8 class="ml-3">
1674 <v-text-field 1677 <v-text-field
1675 v-model="addStudents.rollNo" 1678 v-model="addStudents.rollNo"
1676 placeholder="Fill your Roll Number" 1679 placeholder="Fill your Roll Number"
1677 :rules="rollNo" 1680 :rules="rollNo"
1678 required 1681 required
1679 ></v-text-field> 1682 ></v-text-field>
1680 </v-flex> 1683 </v-flex>
1681 </v-layout> 1684 </v-layout>
1682 </v-flex> 1685 </v-flex>
1683 <v-flex xs12 sm6> 1686 <v-flex xs12 sm6>
1684 <v-layout> 1687 <v-layout>
1685 <v-flex xs4 class="pt-4 subheading"> 1688 <v-flex xs4 class="pt-4 subheading">
1686 <label class="right hidden-xs-only hidden-sm-only">Medical Notes:</label> 1689 <label class="right hidden-xs-only hidden-sm-only">Medical Notes:</label>
1687 <label 1690 <label
1688 class="right hidden-lg-only hidden-md-only hidden-xl-only" 1691 class="right hidden-lg-only hidden-md-only hidden-xl-only"
1689 >Medical:</label> 1692 >Medical:</label>
1690 </v-flex> 1693 </v-flex>
1691 <v-flex xs8 class="ml-3"> 1694 <v-flex xs8 class="ml-3">
1692 <v-text-field 1695 <v-text-field
1693 v-model="addStudents.medicalNotes" 1696 v-model="addStudents.medicalNotes"
1694 placeholder="Fill your Medical Notes" 1697 placeholder="Fill your Medical Notes"
1695 required 1698 required
1696 ></v-text-field> 1699 ></v-text-field>
1697 </v-flex> 1700 </v-flex>
1698 </v-layout> 1701 </v-layout>
1699 </v-flex> 1702 </v-flex>
1700 </v-layout> 1703 </v-layout>
1701 <v-layout wrap> 1704 <v-layout wrap>
1702 <v-flex xs12 sm6> 1705 <v-flex xs12 sm6>
1703 <v-layout> 1706 <v-layout>
1704 <v-flex xs4 class="pt-4 subheading"> 1707 <v-flex xs4 class="pt-4 subheading">
1705 <label class="right">Height:</label> 1708 <label class="right">Height:</label>
1706 </v-flex> 1709 </v-flex>
1707 <v-flex xs8 class="ml-3"> 1710 <v-flex xs8 class="ml-3">
1708 <v-text-field 1711 <v-text-field
1709 v-model="addStudents.height" 1712 v-model="addStudents.height"
1710 placeholder="Fill your Height" 1713 placeholder="Fill your Height"
1711 required 1714 required
1712 ></v-text-field> 1715 ></v-text-field>
1713 </v-flex> 1716 </v-flex>
1714 </v-layout> 1717 </v-layout>
1715 </v-flex> 1718 </v-flex>
1716 <v-flex xs12 sm6> 1719 <v-flex xs12 sm6>
1717 <v-layout> 1720 <v-layout>
1718 <v-flex xs4 class="pt-4 subheading"> 1721 <v-flex xs4 class="pt-4 subheading">
1719 <label class="right">Weight:</label> 1722 <label class="right">Weight:</label>
1720 </v-flex> 1723 </v-flex>
1721 <v-flex xs8 class="ml-3"> 1724 <v-flex xs8 class="ml-3">
1722 <v-text-field 1725 <v-text-field
1723 v-model="addStudents.weight" 1726 v-model="addStudents.weight"
1724 placeholder="Fill your Weight" 1727 placeholder="Fill your Weight"
1725 required 1728 required
1726 ></v-text-field> 1729 ></v-text-field>
1727 </v-flex> 1730 </v-flex>
1728 </v-layout> 1731 </v-layout>
1729 </v-flex> 1732 </v-flex>
1730 </v-layout> 1733 </v-layout>
1731 <v-layout wrap> 1734 <v-layout wrap>
1732 <v-flex xs12 sm6> 1735 <v-flex xs12 sm6>
1733 <v-layout> 1736 <v-layout>
1734 <v-flex xs4 class="pt-4 subheading"> 1737 <v-flex xs4 class="pt-4 subheading">
1735 <label class="right hidden-xs-only hidden-sm-only">Uplaod Image:</label> 1738 <label class="right hidden-xs-only hidden-sm-only">Uplaod Image:</label>
1736 <label 1739 <label
1737 class="right hidden-lg-only hidden-md-only hidden-xl-only" 1740 class="right hidden-lg-only hidden-md-only hidden-xl-only"
1738 >Uplaod :</label> 1741 >Uplaod :</label>
1739 </v-flex> 1742 </v-flex>
1740 <v-flex xs8 class="ml-3"> 1743 <v-flex xs8 class="ml-3">
1741 <v-text-field 1744 <v-text-field
1742 label="Select Image" 1745 label="Select Image"
1743 @click="pickFile" 1746 @click="pickFile"
1744 v-model="imageName" 1747 v-model="imageName"
1745 append-icon="attach_file" 1748 append-icon="attach_file"
1746 ></v-text-field> 1749 ></v-text-field>
1747 </v-flex> 1750 </v-flex>
1748 </v-layout> 1751 </v-layout>
1749 </v-flex> 1752 </v-flex>
1750 <v-flex xs12 sm6> 1753 <v-flex xs12 sm6>
1751 <v-layout> 1754 <v-layout>
1752 <v-flex xs4 class="pt-4 subheading"> 1755 <v-flex xs4 class="pt-4 subheading">
1753 <label class="right hidden-xs-only hidden-sm-only">Academic Year:</label> 1756 <label class="right hidden-xs-only hidden-sm-only">Academic Year:</label>
1754 <label 1757 <label
1755 class="right hidden-lg-only hidden-md-only hidden-xl-only" 1758 class="right hidden-lg-only hidden-md-only hidden-xl-only"
1756 >Year:</label> 1759 >Year:</label>
1757 </v-flex> 1760 </v-flex>
1758 <v-flex xs8 class="ml-3"> 1761 <v-flex xs8 class="ml-3">
1759 <v-text-field 1762 <v-text-field
1760 v-model="addStudents.establishmentYear" 1763 v-model="addStudents.establishmentYear"
1761 placeholder="fill your Academic Year" 1764 placeholder="fill your Academic Year"
1762 name="state" 1765 name="state"
1763 type="number" 1766 type="number"
1764 :rules="establishmentYearRules" 1767 :rules="establishmentYearRules"
1765 required 1768 required
1766 ></v-text-field> 1769 ></v-text-field>
1767 </v-flex> 1770 </v-flex>
1768 </v-layout> 1771 </v-layout>
1769 </v-flex> 1772 </v-flex>
1770 </v-layout> 1773 </v-layout>
1771 <v-layout wrap class="hidden-xs-only hidden-sm-only"> 1774 <v-layout wrap class="hidden-xs-only hidden-sm-only">
1772 <v-flex xs12 sm6> 1775 <v-flex xs12 sm6>
1773 <v-layout> 1776 <v-layout>
1774 <v-flex xs4 sm4 class="pt-4 subheading"> 1777 <v-flex xs4 sm4 class="pt-4 subheading">
1775 <label class="right">Present Address:</label> 1778 <label class="right">Present Address:</label>
1776 </v-flex> 1779 </v-flex>
1777 <v-flex xs8 sm8 class="ml-3"> 1780 <v-flex xs8 sm8 class="ml-3">
1778 <v-text-field 1781 <v-text-field
1779 v-model="addStudents.presentAddress" 1782 v-model="addStudents.presentAddress"
1780 :rules="presentAddress" 1783 :rules="presentAddress"
1781 placeholder="fill Your present Address" 1784 placeholder="fill Your present Address"
1782 @keyup="copyData" 1785 @keyup="copyData"
1783 ></v-text-field> 1786 ></v-text-field>
1784 </v-flex> 1787 </v-flex>
1785 </v-layout> 1788 </v-layout>
1786 </v-flex> 1789 </v-flex>
1787 <v-flex xs12 sm6> 1790 <v-flex xs12 sm6>
1788 <v-layout> 1791 <v-layout>
1789 <v-flex xs4 sm4 class="pt-4 subheading addressForm"> 1792 <v-flex xs4 sm4 class="pt-4 subheading addressForm">
1790 <label class="right">Permanent Address:</label> 1793 <label class="right">Permanent Address:</label>
1791 </v-flex> 1794 </v-flex>
1792 <v-flex xs12 sm8 class="ml-3"> 1795 <v-flex xs12 sm8 class="ml-3">
1793 <v-switch 1796 <v-switch
1794 v-model="addStudents.permanentAddress" 1797 v-model="addStudents.permanentAddress"
1795 label="Select Permanent Address" 1798 label="Select Permanent Address"
1796 :value="addStudents.presentAddress" 1799 :value="addStudents.presentAddress"
1797 ></v-switch> 1800 ></v-switch>
1798 </v-flex> 1801 </v-flex>
1799 </v-layout> 1802 </v-layout>
1800 </v-flex> 1803 </v-flex>
1801 </v-layout> 1804 </v-layout>
1802 <v-layout class="hidden-xs-only hidden-sm-only"> 1805 <v-layout class="hidden-xs-only hidden-sm-only">
1803 <v-flex xs12 sm6> 1806 <v-flex xs12 sm6>
1804 <v-layout> 1807 <v-layout>
1805 <v-flex xs4 sm4 class="pt-4 subheading addressForm"> 1808 <v-flex xs4 sm4 class="pt-4 subheading addressForm">
1806 <label class="right">Permanent Address:</label> 1809 <label class="right">Permanent Address:</label>
1807 </v-flex> 1810 </v-flex>
1808 <v-flex xs12 sm8 class="ml-3"> 1811 <v-flex xs12 sm8 class="ml-3">
1809 <v-text-field 1812 <v-text-field
1810 v-model="addStudents.permanentAddress" 1813 v-model="addStudents.permanentAddress"
1811 :rules="permanentAddress" 1814 :rules="permanentAddress"
1812 placeholder="fill Your Permanent Address" 1815 placeholder="fill Your Permanent Address"
1813 ></v-text-field> 1816 ></v-text-field>
1814 </v-flex> 1817 </v-flex>
1815 </v-layout> 1818 </v-layout>
1816 </v-flex> 1819 </v-flex>
1817 </v-layout> 1820 </v-layout>
1818 <v-layout class="hidden-lg-only hidden-md-only hidden-xl-only" wrap> 1821 <v-layout class="hidden-lg-only hidden-md-only hidden-xl-only" wrap>
1819 <v-flex xs12 sm12> 1822 <v-flex xs12 sm12>
1820 <v-layout> 1823 <v-layout>
1821 <v-flex xs12 sm12 class="pt-4 subheading text-xs-center"> 1824 <v-flex xs12 sm12 class="pt-4 subheading text-xs-center">
1822 <label class>Present Address:</label> 1825 <label class>Present Address:</label>
1823 </v-flex> 1826 </v-flex>
1824 </v-layout> 1827 </v-layout>
1825 <v-layout> 1828 <v-layout>
1826 <v-flex xs12 sm12> 1829 <v-flex xs12 sm12>
1827 <v-textarea 1830 <v-textarea
1828 name="input-4-3" 1831 name="input-4-3"
1829 v-model="addStudents.presentAddress" 1832 v-model="addStudents.presentAddress"
1830 :rules="presentAddress" 1833 :rules="presentAddress"
1831 placeholder="fill Your present Address" 1834 placeholder="fill Your present Address"
1832 required 1835 required
1833 ></v-textarea> 1836 ></v-textarea>
1834 </v-flex> 1837 </v-flex>
1835 </v-layout> 1838 </v-layout>
1836 </v-flex> 1839 </v-flex>
1837 <v-flex xs12 sm12> 1840 <v-flex xs12 sm12>
1838 <v-layout> 1841 <v-layout>
1839 <v-flex 1842 <v-flex
1840 xs12 1843 xs12
1841 sm12 1844 sm12
1842 class="pt-4 pr-4 subheading text-xs-center addressForm" 1845 class="pt-4 pr-4 subheading text-xs-center addressForm"
1843 > 1846 >
1844 <label>Permanent Address:</label> 1847 <label>Permanent Address:</label>
1845 </v-flex> 1848 </v-flex>
1846 </v-layout> 1849 </v-layout>
1847 <v-layout> 1850 <v-layout>
1848 <v-flex xs12 sm12> 1851 <v-flex xs12 sm12>
1849 <v-textarea 1852 <v-textarea
1850 name="input-4-3" 1853 name="input-4-3"
1851 v-model="addStudents.permanentAddress" 1854 v-model="addStudents.permanentAddress"
1852 :rules="permanentAddress" 1855 :rules="permanentAddress"
1853 placeholder="fill Your Permanent Address" 1856 placeholder="fill Your Permanent Address"
1854 required 1857 required
1855 ></v-textarea> 1858 ></v-textarea>
1856 </v-flex> 1859 </v-flex>
1857 </v-layout> 1860 </v-layout>
1858 </v-flex> 1861 </v-flex>
1859 </v-layout> 1862 </v-layout>
1860 <v-layout> 1863 <v-layout>
1861 <v-flex xs12 sm12> 1864 <v-flex xs12 sm12>
1862 <v-layout class="right"> 1865 <v-layout class="right">
1863 <!-- <v-flex xs6> --> 1866 <!-- <v-flex xs6> -->
1864 <v-btn round dark @click="e2 = 1" class="clear-button">Back</v-btn> 1867 <v-btn round dark @click="e2 = 1" class="clear-button">Back</v-btn>
1865 <!-- </v-flex> 1868 <!-- </v-flex>
1866 <v-flex xs6>--> 1869 <v-flex xs6>-->
1867 <v-btn 1870 <v-btn
1868 @click="submit" 1871 @click="submit"
1869 round 1872 round
1870 dark 1873 dark
1871 :loading="loading" 1874 :loading="loading"
1872 class="add-button" 1875 class="add-button"
1873 >Add</v-btn> 1876 >Add</v-btn>
1874 <!-- </v-flex> --> 1877 <!-- </v-flex> -->
1875 </v-layout> 1878 </v-layout>
1876 </v-flex> 1879 </v-flex>
1877 </v-layout> 1880 </v-layout>
1878 </v-form> 1881 </v-form>
1879 </v-flex> 1882 </v-flex>
1880 </v-stepper-content> 1883 </v-stepper-content>
1881 </v-stepper-items> 1884 </v-stepper-items>
1882 </v-stepper> 1885 </v-stepper>
1883 </v-flex> 1886 </v-flex>
1884 </v-layout> 1887 </v-layout>
1885 </v-container> 1888 </v-container>
1886 </v-card> 1889 </v-card>
1887 </v-dialog> 1890 </v-dialog>
1888 <v-snackbar 1891 <v-snackbar
1889 :timeout="timeout" 1892 :timeout="timeout"
1890 :top="y === 'top'" 1893 :top="y === 'top'"
1891 :right="x === 'right'" 1894 :right="x === 'right'"
1892 :vertical="mode === 'vertical'" 1895 :vertical="mode === 'vertical'"
1893 v-model="snackbar" 1896 v-model="snackbar"
1894 :color="color" 1897 :color="color"
1895 >{{ text }}</v-snackbar> 1898 >{{ text }}</v-snackbar>
1896 <div class="loader" v-if="showLoader"> 1899 <div class="loader" v-if="showLoader">
1897 <v-progress-circular indeterminate color="white"></v-progress-circular> 1900 <v-progress-circular indeterminate color="white"></v-progress-circular>
1898 </div> 1901 </div>
1899 </v-container> 1902 </v-container>
1900 </template> 1903 </template>
1901 1904
1902 <script> 1905 <script>
1903 import http from "@/Services/http.js"; 1906 import http from "@/Services/http.js";
1904 import moment from "moment"; 1907 import moment from "moment";
1905 import countryList from "@/script/country.js"; 1908 import countryList from "@/script/country.js";
1906 import parent from "@/script/parents.js"; 1909 import parent from "@/script/parents.js";
1907 1910
1908 export default { 1911 export default {
1909 data: () => ({ 1912 data: () => ({
1910 e1: true, 1913 e1: true,
1911 e2: 0, 1914 e2: 0,
1912 showParent: true, 1915 showParent: true,
1913 showNext: false, 1916 showNext: false,
1914 snackbar: false, 1917 snackbar: false,
1915 y: "top", 1918 y: "top",
1916 x: "right", 1919 x: "right",
1917 role: "", 1920 role: "",
1918 mode: "", 1921 mode: "",
1919 append: "", 1922 append: "",
1920 timeout: 3000, 1923 timeout: 3000,
1921 text: "", 1924 text: "",
1922 show: true, 1925 show: true,
1923 color: "", 1926 color: "",
1924 showSearch: false, 1927 showSearch: false,
1925 showLoader: false, 1928 showLoader: false,
1926 loading: false, 1929 loading: false,
1927 editLoading: false, 1930 editLoading: false,
1928 date: null, 1931 date: null,
1929 search: "", 1932 search: "",
1930 password: "", 1933 password: "",
1931 menu: false, 1934 menu: false,
1932 menu1: false, 1935 menu1: false,
1933 editStudentDialog: false, 1936 editStudentDialog: false,
1934 profileStudentDialog: false, 1937 profileStudentDialog: false,
1935 addStudentDialog: false, 1938 addStudentDialog: false,
1936 valid: true, 1939 valid: true,
1937 addclass: [], 1940 addclass: [],
1938 addSection: [], 1941 addSection: [],
1939 gender: ["Male", "Female"], 1942 gender: ["Male", "Female"],
1940 pagination: { 1943 pagination: {
1941 rowsPerPage: 10, 1944 rowsPerPage: 10,
1942 }, 1945 },
1943 imageData: {}, 1946 imageData: {},
1944 imageName: "", 1947 imageName: "",
1945 imageUrl: "", 1948 imageUrl: "",
1946 imageFile: "", 1949 imageFile: "",
1947 editImageName: "", 1950 editImageName: "",
1948 editImageUrl: "", 1951 editImageUrl: "",
1949 nameRules: [(v) => !!v || " Full Name is required"], 1952 nameRules: [(v) => !!v || " Full Name is required"],
1950 dateRules: [(v) => !!v || " DOB is required"], 1953 dateRules: [(v) => !!v || " DOB is required"],
1951 cityRules: [(v) => !!v || " City Name is required"], 1954 cityRules: [(v) => !!v || " City Name is required"],
1952 pincode: [(v) => !!v || " Pincode is required"], 1955 pincode: [(v) => !!v || " Pincode is required"],
1953 country: [(v) => !!v || " Country Name is required"], 1956 country: [(v) => !!v || " Country Name is required"],
1954 rollNo: [(v) => !!v || "Roll No is required"], 1957 rollNo: [(v) => !!v || "Roll No is required"],
1955 permanentAddress: [(v) => !!v || " Permanent Address is required"], 1958 permanentAddress: [(v) => !!v || " Permanent Address is required"],
1956 presentAddress: [(v) => !!v || " Present Address is required"], 1959 presentAddress: [(v) => !!v || " Present Address is required"],
1957 stateRules: [(v) => !!v || "State Name is required"], 1960 stateRules: [(v) => !!v || "State Name is required"],
1958 classRules: [(v) => !!v || " Class Name is required"], 1961 classRules: [(v) => !!v || " Class Name is required"],
1959 sectionRules: [(v) => !!v || " Section Name is required"], 1962 sectionRules: [(v) => !!v || " Section Name is required"],
1960 genderRules: [(v) => !!v || " Select Gender is required"], 1963 genderRules: [(v) => !!v || " Select Gender is required"],
1961 fatheCellNoRules: [ 1964 fatheCellNoRules: [
1962 (v) => !!v || " father Cell Number is required", 1965 (v) => !!v || " father Cell Number is required",
1963 (v) => v <= 10000000000 || "Max 10 characters is required", 1966 (v) => v <= 10000000000 || "Max 10 characters is required",
1964 ], 1967 ],
1965 password: [ 1968 password: [
1966 (v) => !!v || "Password field is Required.", 1969 (v) => !!v || "Password field is Required.",
1967 // v => (/^(?=.*[a-z])(?=.*[0-9])(?=.*[!@#$%^&*])(?=.{8,})/).test(v) && v.length >= 8 1970 // v => (/^(?=.*[a-z])(?=.*[0-9])(?=.*[!@#$%^&*])(?=.{8,})/).test(v) && v.length >= 8
1968 ], 1971 ],
1969 mobileNoRule: [(v) => !!v || " Mobile Number is required"], 1972 mobileNoRule: [(v) => !!v || " Mobile Number is required"],
1970 establishmentYearRules: [(v) => !!v || " Academic Year is required"], 1973 establishmentYearRules: [(v) => !!v || " Academic Year is required"],
1971 errorMessages: "", 1974 errorMessages: "",
1972 countries: [], 1975 countries: [],
1973 headers: [ 1976 headers: [
1974 { 1977 {
1975 text: "Roll No.", 1978 text: "Roll No.",
1976 align: "center", 1979 align: "center",
1977 sortable: false, 1980 sortable: false,
1978 value: "rollNo", 1981 value: "rollNo",
1979 }, 1982 },
1980 { 1983 {
1981 text: "Profile Pic", 1984 text: "Profile Pic",
1982 value: "profilePicUrl", 1985 value: "profilePicUrl",
1983 sortable: false, 1986 sortable: false,
1984 align: "center", 1987 align: "center",
1985 }, 1988 },
1986 { text: "Name", value: "name", sortable: false, align: "center" }, 1989 { text: "Name", value: "name", sortable: false, align: "center" },
1987 { text: "Gender", value: "gender", sortable: false, align: "center" }, 1990 { text: "Gender", value: "gender", sortable: false, align: "center" },
1988 { 1991 {
1989 text: "Father Name", 1992 text: "Father Name",
1990 value: "fatherName", 1993 value: "fatherName",
1991 sortable: false, 1994 sortable: false,
1992 align: "center", 1995 align: "center",
1993 }, 1996 },
1994 { 1997 {
1995 text: "Mother Name", 1998 text: "Mother Name",
1996 value: "motherName", 1999 value: "motherName",
1997 sortable: false, 2000 sortable: false,
1998 align: "center", 2001 align: "center",
1999 }, 2002 },
2000 { 2003 {
2001 text: "Academic Year", 2004 text: "Academic Year",
2002 value: "establishmentYear", 2005 value: "establishmentYear",
2003 sortable: false, 2006 sortable: false,
2004 align: "center", 2007 align: "center",
2005 }, 2008 },
2006 // { text: "Mobile No", value: "mobile", sortable: false, align: "center" }, 2009 // { text: "Mobile No", value: "mobile", sortable: false, align: "center" },
2007 { 2010 {
2008 text: "Status", 2011 text: "Status",
2009 value: "status", 2012 value: "status",
2010 sortable: false, 2013 sortable: false,
2011 align: "center", 2014 align: "center",
2012 }, 2015 },
2013 { text: "Action", value: "", sortable: false, align: "center" }, 2016 { text: "Action", value: "", sortable: false, align: "center" },
2014 ], 2017 ],
2015 studentsData: [], 2018 studentsData: [],
2016 parentId: "", 2019 parentId: "",
2017 editedIndex: -1, 2020 editedIndex: -1,
2018 parentData: {}, 2021 parentData: {},
2019 addStudents: { 2022 addStudents: {
2020 role: "STUDENT", 2023 role: "STUDENT",
2021 name: "", 2024 name: "",
2022 email: "", 2025 email: "",
2023 date: "", 2026 date: "",
2024 city: "", 2027 city: "",
2025 pincode: "", 2028 pincode: "",
2026 country: "", 2029 country: "",
2027 permanentAddress: "", 2030 permanentAddress: "",
2028 presentAddress: "", 2031 presentAddress: "",
2029 mobile: "", 2032 mobile: "",
2030 state: "", 2033 state: "",
2031 gender: "", 2034 gender: "",
2032 select: "", 2035 select: "",
2033 selectSection: "", 2036 selectSection: "",
2034 bloodGroup: "", 2037 bloodGroup: "",
2035 allergies: "", 2038 allergies: "",
2036 medicalNotes: "", 2039 medicalNotes: "",
2037 height: "", 2040 height: "",
2038 weight: "", 2041 weight: "",
2039 rollNo: "", 2042 rollNo: "",
2040 establishmentYear: new Date().getFullYear(), 2043 establishmentYear: new Date().getFullYear(),
2041 }, 2044 },
2042 selectStudents: { 2045 selectStudents: {
2043 select: "", 2046 select: "",
2044 selectSection: "", 2047 selectSection: "",
2045 }, 2048 },
2046 editedItem: { 2049 editedItem: {
2047 role: "STUDENT", 2050 role: "STUDENT",
2048 name: "", 2051 name: "",
2049 email: "", 2052 email: "",
2050 dob: "", 2053 dob: "",
2051 city: "", 2054 city: "",
2052 pincode: "", 2055 pincode: "",
2053 country: "", 2056 country: "",
2054 permanentAddress: "", 2057 permanentAddress: "",
2055 presentAddress: "", 2058 presentAddress: "",
2056 mobile: "", 2059 mobile: "",
2057 state: "", 2060 state: "",
2058 gender: "", 2061 gender: "",
2059 select: "", 2062 select: "",
2060 selectSection: "", 2063 selectSection: "",
2061 bloodGroup: "", 2064 bloodGroup: "",
2062 allergies: "", 2065 allergies: "",
2063 medicalNotes: "", 2066 medicalNotes: "",
2064 height: "", 2067 height: "",
2065 weight: "", 2068 weight: "",
2066 rollNo: "", 2069 rollNo: "",
2067 establishmentYear: new Date().getFullYear(), 2070 establishmentYear: new Date().getFullYear(),
2068 }, 2071 },
2069 isFatherCellExists: false, 2072 isFatherCellExists: false,
2070 }), 2073 }),
2071 watch: { 2074 watch: {
2072 menu(val) { 2075 menu(val) {
2073 val && this.$nextTick(() => (this.$refs.picker.activePicker = "YEAR")); 2076 val && this.$nextTick(() => (this.$refs.picker.activePicker = "YEAR"));
2074 }, 2077 },
2075 menu1(val) { 2078 menu1(val) {
2076 val && this.$nextTick(() => (this.$refs.picker.activePicker = "YEAR")); 2079 val && this.$nextTick(() => (this.$refs.picker.activePicker = "YEAR"));
2077 }, 2080 },
2078 addStudentDialog: function (val) { 2081 addStudentDialog: function (val) {
2079 if (!val) { 2082 if (!val) {
2080 this.parentData = []; 2083 this.parentData = [];
2081 this.addStudents = []; 2084 this.addStudents = [];
2082 this.imageName = ""; 2085 this.imageName = "";
2083 this.imageFile = ""; 2086 this.imageFile = "";
2084 this.imageUrl = ""; 2087 this.imageUrl = "";
2085 this.e2 = 1; 2088 this.e2 = 1;
2086 } 2089 }
2087 }, 2090 },
2088 }, 2091 },
2089 methods: { 2092 methods: {
2090 findStudents() { 2093 findStudents() {
2091 this.showLoader = true; 2094 this.showLoader = true;
2092 http() 2095 http()
2093 .get("/getStudentWithClass", { 2096 .get("/getStudentWithClass", {
2094 params: { 2097 params: {
2095 classId: this.selectStudents.select, 2098 classId: this.selectStudents.select,
2096 sectionId: this.selectStudents.selectSection, 2099 sectionId: this.selectStudents.selectSection,
2097 }, 2100 },
2098 }) 2101 })
2099 .then((response) => { 2102 .then((response) => {
2100 this.studentsData = response.data.data; 2103 this.studentsData = response.data.data;
2101 this.showLoader = false; 2104 this.showLoader = false;
2102 }) 2105 })
2103 .catch((err) => { 2106 .catch((err) => {
2104 // console.log("err====>", err); 2107 // console.log("err====>", err);
2105 this.showLoader = false; 2108 this.showLoader = false;
2106 this.snackbar = true; 2109 this.snackbar = true;
2107 this.color = "error"; 2110 this.color = "error";
2108 this.text = error.response.data.message; 2111 this.text = error.response.data.message;
2109 }); 2112 });
2110 }, 2113 },
2111 getSections(_id) { 2114 getSections(_id) {
2112 var token = this.$store.state.token; 2115 var token = this.$store.state.token;
2113 this.showLoader = true; 2116 this.showLoader = true;
2117 this.studentsData = [];
2114 http() 2118 http()
2115 .get( 2119 .get(
2116 "/getSectionsList", 2120 "/getSectionsList",
2117 { params: { classId: _id } }, 2121 { params: { classId: _id } },
2118 { 2122 {
2119 headers: { Authorization: "Bearer " + token }, 2123 headers: { Authorization: "Bearer " + token },
2120 } 2124 }
2121 ) 2125 )
2122 .then((response) => { 2126 .then((response) => {
2123 this.addSection = response.data.data; 2127 this.addSection = response.data.data;
2124 this.showLoader = false; 2128 this.showLoader = false;
2125 }) 2129 })
2126 .catch((err) => { 2130 .catch((err) => {
2127 this.showLoader = false; 2131 this.showLoader = false;
2128 }); 2132 });
2129 }, 2133 },
2130 getSection(_id) { 2134 getSection(_id) {
2131 var token = this.$store.state.token; 2135 var token = this.$store.state.token;
2132 this.showLoader = true; 2136 this.showLoader = true;
2133 http() 2137 http()
2134 .get( 2138 .get(
2135 "/getSectionsList", 2139 "/getSectionsList",
2136 { params: { classId: _id } }, 2140 { params: { classId: _id } },
2137 { 2141 {
2138 headers: { Authorization: "Bearer " + token }, 2142 headers: { Authorization: "Bearer " + token },
2139 } 2143 }
2140 ) 2144 )
2141 .then((response) => { 2145 .then((response) => {
2142 this.addSection = response.data.data; 2146 this.addSection = response.data.data;
2143 this.showLoader = false; 2147 this.showLoader = false;
2144 }) 2148 })
2145 .catch((err) => { 2149 .catch((err) => {
2146 this.showLoader = false; 2150 this.showLoader = false;
2147 }); 2151 });
2148 }, 2152 },
2149 pickFile() { 2153 pickFile() {
2150 this.$refs.image.click(); 2154 this.$refs.image.click();
2151 }, 2155 },
2152 pickEditFile() { 2156 pickEditFile() {
2153 this.$refs.editDataImage.click(); 2157 this.$refs.editDataImage.click();
2154 }, 2158 },
2155 dates: function (date) { 2159 dates: function (date) {
2156 return moment(date).format("MMMM DD, YYYY"); 2160 return moment(date).format("MMMM DD, YYYY");
2157 return date; 2161 return date;
2158 }, 2162 },
2159 onFilePicked(e) { 2163 onFilePicked(e) {
2160 // console.log(e) 2164 // console.log(e)
2161 const files = e.target.files; 2165 const files = e.target.files;
2162 this.imageData.upload = e.target.files[0]; 2166 this.imageData.upload = e.target.files[0];
2163 if (files[0] !== undefined) { 2167 if (files[0] !== undefined) {
2164 this.imageName = files[0].name; 2168 this.imageName = files[0].name;
2165 if (this.imageName.lastIndexOf(".") <= 0) { 2169 if (this.imageName.lastIndexOf(".") <= 0) {
2166 return; 2170 return;
2167 } 2171 }
2168 const fr = new FileReader(); 2172 const fr = new FileReader();
2169 fr.readAsDataURL(files[0]); 2173 fr.readAsDataURL(files[0]);
2170 fr.addEventListener("load", () => { 2174 fr.addEventListener("load", () => {
2171 this.imageUrl = fr.result; 2175 this.imageUrl = fr.result;
2172 this.imageFile = files[0]; // this is an image file that can be sent to server... 2176 this.imageFile = files[0]; // this is an image file that can be sent to server...
2173 this.imageData.imageUrl = URL.createObjectURL(this.imageFile); 2177 this.imageData.imageUrl = URL.createObjectURL(this.imageFile);
2174 }); 2178 });
2175 } else { 2179 } else {
2176 this.imageName = ""; 2180 this.imageName = "";
2177 this.imageFile = ""; 2181 this.imageFile = "";
2178 this.imageUrl = ""; 2182 this.imageUrl = "";
2179 } 2183 }
2180 }, 2184 },
2181 onEditFilePicked(e) { 2185 onEditFilePicked(e) {
2182 // console.log(e); 2186 // console.log(e);
2183 const files = e.target.files; 2187 const files = e.target.files;
2184 if (files[0] !== undefined) { 2188 if (files[0] !== undefined) {
2185 this.editImageName = files[0].name; 2189 this.editImageName = files[0].name;
2186 // console.log("this.editImageName", this.editImageName); 2190 // console.log("this.editImageName", this.editImageName);
2187 2191
2188 if (this.editImageName.lastIndexOf(".") <= 0) { 2192 if (this.editImageName.lastIndexOf(".") <= 0) {
2189 return; 2193 return;
2190 } 2194 }
2191 const fr = new FileReader(); 2195 const fr = new FileReader();
2192 fr.readAsDataURL(files[0]); 2196 fr.readAsDataURL(files[0]);
2193 fr.addEventListener("load", () => { 2197 fr.addEventListener("load", () => {
2194 this.editImageUrl = fr.result; 2198 this.editImageUrl = fr.result;
2195 this.editiImageFile = files[0]; // this is an image file that can be sent to server... 2199 this.editiImageFile = files[0]; // this is an image file that can be sent to server...
2196 }); 2200 });
2197 } else { 2201 } else {
2198 this.editImageName = ""; 2202 this.editImageName = "";
2199 this.editiImageFile = ""; 2203 this.editiImageFile = "";
2200 } 2204 }
2201 }, 2205 },
2202 editItem(item) { 2206 editItem(item) {
2203 this.editedIndex = this.studentsData.indexOf(item); 2207 this.editedIndex = this.studentsData.indexOf(item);
2204 this.editedItem = Object.assign({}, item); 2208 this.editedItem = Object.assign({}, item);
2205 this.editedItem.fatherName = item.parentId.fatherName; 2209 this.editedItem.fatherName = item.parentId.fatherName;
2206 this.editedItem.fatherCellNo = item.parentId.fatherCellNo; 2210 this.editedItem.fatherCellNo = item.parentId.fatherCellNo;
2207 this.editedItem.motherName = item.parentId.motherName; 2211 this.editedItem.motherName = item.parentId.motherName;
2208 this.editedItem.motherCellNo = item.parentId.motherCellNo; 2212 this.editedItem.motherCellNo = item.parentId.motherCellNo;
2209 this.editedItem.dob = 2213 this.editedItem.dob =
2210 this.editedItem.dob != undefined 2214 this.editedItem.dob != undefined
2211 ? (this.editedItem.dob = this.editedItem.dob.substring(0, 10)) 2215 ? (this.editedItem.dob = this.editedItem.dob.substring(0, 10))
2212 : (this.editedItem.dob = ""); 2216 : (this.editedItem.dob = "");
2213 this.editStudentDialog = true; 2217 this.editStudentDialog = true;
2214 }, 2218 },
2215 profile(item) { 2219 profile(item) {
2216 this.editedIndex = this.studentsData.indexOf(item); 2220 this.editedIndex = this.studentsData.indexOf(item);
2217 this.editedItem = Object.assign({}, item); 2221 this.editedItem = Object.assign({}, item);
2218 this.editedItem.fatherName = item.parentId.fatherName; 2222 this.editedItem.fatherName = item.parentId.fatherName;
2219 this.editedItem.fatherCellNo = item.parentId.fatherCellNo; 2223 this.editedItem.fatherCellNo = item.parentId.fatherCellNo;
2220 this.editedItem.motherName = item.parentId.motherName; 2224 this.editedItem.motherName = item.parentId.motherName;
2221 this.editedItem.motherCellNo = item.parentId.motherCellNo; 2225 this.editedItem.motherCellNo = item.parentId.motherCellNo;
2222 2226
2223 this.profileStudentDialog = true; 2227 this.profileStudentDialog = true;
2224 }, 2228 },
2225 deleteItem(item) { 2229 deleteItem(item) {
2226 let deleteStudent = { 2230 let deleteStudent = {
2227 studentId: item._id, 2231 studentId: item._id,
2228 }; 2232 };
2229 http() 2233 http()
2230 .delete( 2234 .delete(
2231 "/deleteStudent", 2235 "/deleteStudent",
2232 confirm("Are you sure you want to delete this?") && { 2236 confirm("Are you sure you want to delete this?") && {
2233 params: deleteStudent, 2237 params: deleteStudent,
2234 } 2238 }
2235 ) 2239 )
2236 .then((response) => { 2240 .then((response) => {
2237 this.snackbar = true; 2241 this.snackbar = true;
2238 this.text = response.data.message; 2242 this.text = response.data.message;
2239 this.color = "green"; 2243 this.color = "green";
2240 this.findStudents(); 2244 this.findStudents();
2241 }) 2245 })
2242 .catch((error) => { 2246 .catch((error) => {
2243 this.snackbar = true; 2247 this.snackbar = true;
2244 this.text = error.response.data.message; 2248 this.text = error.response.data.message;
2245 this.color = "error"; 2249 this.color = "error";
2246 }); 2250 });
2247 }, 2251 },
2248 close() { 2252 close() {
2249 this.editStudentDialog = false; 2253 this.editStudentDialog = false;
2250 }, 2254 },
2251 closeStudentProfile() { 2255 closeStudentProfile() {
2252 this.profileStudentDialog = false; 2256 this.profileStudentDialog = false;
2253 }, 2257 },
2254 copyData() { 2258 copyData() {
2255 this.addStudents.permanentAddress = this.addStudents.presentAddress; 2259 this.addStudents.permanentAddress = this.addStudents.presentAddress;
2256 }, 2260 },
2257 submit() { 2261 submit() {
2258 if (this.$refs.form.validate()) { 2262 if (this.$refs.form.validate()) {
2259 let addStudent = { 2263 let addStudent = {
2260 parentId: this.parentId, 2264 parentId: this.parentId,
2261 name: this.addStudents.name, 2265 name: this.addStudents.name,
2262 email: this.addStudents.email, 2266 email: this.addStudents.email,
2263 role: this.addStudents.role, 2267 role: this.addStudents.role,
2264 dob: this.addStudents.date, 2268 dob: this.addStudents.date,
2265 city: this.addStudents.city, 2269 city: this.addStudents.city,
2266 pincode: this.addStudents.pincode, 2270 pincode: this.addStudents.pincode,
2267 country: this.addStudents.country, 2271 country: this.addStudents.country,
2268 permanentAddress: this.addStudents.permanentAddress, 2272 permanentAddress: this.addStudents.permanentAddress,
2269 presentAddress: this.addStudents.presentAddress, 2273 presentAddress: this.addStudents.presentAddress,
2270 mobile: this.addStudents.mobile, 2274 mobile: this.addStudents.mobile,
2271 state: this.addStudents.state, 2275 state: this.addStudents.state,
2272 gender: this.addStudents.gender, 2276 gender: this.addStudents.gender,
2273 establishmentYear: this.addStudents.establishmentYear, 2277 establishmentYear: this.addStudents.establishmentYear,
2274 classId: this.addStudents.select, 2278 classId: this.addStudents.select,
2275 sectionId: this.addStudents.selectSection, 2279 sectionId: this.addStudents.selectSection,
2276 bloodGroup: this.addStudents.bloodGroup, 2280 bloodGroup: this.addStudents.bloodGroup,
2277 medicalNotes: this.addStudents.medicalNotes, 2281 medicalNotes: this.addStudents.medicalNotes,
2278 height: this.addStudents.height, 2282 height: this.addStudents.height,
2279 weight: this.addStudents.weight, 2283 weight: this.addStudents.weight,
2280 rollNo: this.addStudents.rollNo, 2284 rollNo: this.addStudents.rollNo,
2281 }; 2285 };
2282 if (this.imageUrl) { 2286 if (this.imageUrl) {
2283 var str = this.imageUrl; 2287 var str = this.imageUrl;
2284 const [baseUrl, imageUrl] = str.split(/,/); 2288 const [baseUrl, imageUrl] = str.split(/,/);
2285 addStudent.upload = imageUrl; 2289 addStudent.upload = imageUrl;
2286 } 2290 }
2287 this.loading = true; 2291 this.loading = true;
2288 http() 2292 http()
2289 .post("/createStudent", addStudent) 2293 .post("/createStudent", addStudent)
2290 .then((response) => { 2294 .then((response) => {
2291 this.snackbar = true; 2295 this.snackbar = true;
2292 this.text = "New Student added successfully"; 2296 this.text = "New Student added successfully";
2293 this.color = "green"; 2297 this.color = "green";
2294 this.addStudentDialog = false; 2298 this.addStudentDialog = false;
2295 this.$refs.parentForm.reset(); 2299 this.$refs.parentForm.reset();
2296 this.$refs.parentFormLgScr.reset(); 2300 this.$refs.parentFormLgScr.reset();
2297 this.$refs.form.reset(); 2301 this.$refs.form.reset();
2298 this.e2 = 1; 2302 this.e2 = 1;
2299 // this.clear(); 2303 // this.clear();
2300 // this.clearParents(); 2304 // this.clearParents();
2301 this.loading = false; 2305 this.loading = false;
2302 }) 2306 })
2303 .catch((error) => { 2307 .catch((error) => {
2304 this.snackbar = true; 2308 this.snackbar = true;
2305 this.text = error.response.data.message; 2309 this.text = error.response.data.message;
2306 this.color = "error"; 2310 this.color = "error";
2307 this.loading = false; 2311 this.loading = false;
2308 }); 2312 });
2309 } 2313 }
2310 }, 2314 },
2311 clear() { 2315 clear() {
2312 this.$refs.form.reset(); 2316 this.$refs.form.reset();
2313 this.imageUrl = ""; 2317 this.imageUrl = "";
2314 }, 2318 },
2315 clearParents() { 2319 clearParents() {
2316 this.$refs.parentForm.reset(); 2320 this.$refs.parentForm.reset();
2317 }, 2321 },
2318 save() { 2322 save() {
2319 let editStudent = { 2323 let editStudent = {
2320 studentId: this.editedItem._id, 2324 studentId: this.editedItem._id,
2321 name: this.editedItem.name, 2325 name: this.editedItem.name,
2322 email: this.editedItem.email, 2326 email: this.editedItem.email,
2323 role: this.editedItem.role, 2327 role: this.editedItem.role,
2324 dob: this.editedItem.dob, 2328 dob: this.editedItem.dob,
2325 city: this.editedItem.city, 2329 city: this.editedItem.city,
2326 pincode: this.editedItem.pincode, 2330 pincode: this.editedItem.pincode,
2327 country: this.editedItem.country, 2331 country: this.editedItem.country,
2328 permanentAddress: this.editedItem.permanentAddress, 2332 permanentAddress: this.editedItem.permanentAddress,
2329 presentAddress: this.editedItem.presentAddress, 2333 presentAddress: this.editedItem.presentAddress,
2330 mobile: this.editedItem.mobile, 2334 mobile: this.editedItem.mobile,
2331 state: this.editedItem.state, 2335 state: this.editedItem.state,
2332 gender: this.editedItem.gender, 2336 gender: this.editedItem.gender,
2333 establishmentYear: this.editedItem.establishmentYear, 2337 establishmentYear: this.editedItem.establishmentYear,
2334 classId: this.editedItem.select, 2338 classId: this.editedItem.select,
2335 sectionId: this.editedItem.selectSection, 2339 sectionId: this.editedItem.selectSection,
2336 bloodGroup: this.editedItem.bloodGroup, 2340 bloodGroup: this.editedItem.bloodGroup,
2337 medicalNotes: this.editedItem.medicalNotes, 2341 medicalNotes: this.editedItem.medicalNotes,
2338 height: this.editedItem.height, 2342 height: this.editedItem.height,
2339 weight: this.editedItem.weight, 2343 weight: this.editedItem.weight,
2340 rollNo: this.editedItem.rollNo, 2344 rollNo: this.editedItem.rollNo,
2341 }; 2345 };
2342 if (this.editImageUrl) { 2346 if (this.editImageUrl) {
2343 var str = this.editImageUrl; 2347 var str = this.editImageUrl;
2344 const [baseUrl, editImageUrl] = str.split(/,/); 2348 const [baseUrl, editImageUrl] = str.split(/,/);
2345 editStudent.upload = editImageUrl; 2349 editStudent.upload = editImageUrl;
2346 } 2350 }
2347 this.editLoading = true; 2351 this.editLoading = true;
2348 http() 2352 http()
2349 .put("/updateStudent", editStudent) 2353 .put("/updateStudent", editStudent)
2350 .then((response) => { 2354 .then((response) => {
2351 this.snackbar = true; 2355 this.snackbar = true;
2352 this.text = response.data.message; 2356 this.text = response.data.message;
2353 this.color = "green"; 2357 this.color = "green";
2354 this.imageUrl = ""; 2358 this.imageUrl = "";
2355 this.findStudents(); 2359 this.findStudents();
2356 this.close(); 2360 this.close();
2357 this.editLoading = false; 2361 this.editLoading = false;
2358 }) 2362 })
2359 .catch((error) => { 2363 .catch((error) => {
2360 this.snackbar = true; 2364 this.snackbar = true;
2361 this.text = error.response.data.statusText; 2365 this.text = error.response.data.statusText;
2362 this.color = "error"; 2366 this.color = "error";
2363 this.editLoading = false; 2367 this.editLoading = false;
2364 }); 2368 });
2365 }, 2369 },
2366 submitParentDetails() { 2370 submitParentDetails() {
2367 if (this.$refs.parentForm.validate()) { 2371 if (this.$refs.parentForm.validate()) {
2368 this.parentData.fatherCellNo = this.parentData.fatherCellNo; 2372 this.parentData.fatherCellNo = this.parentData.fatherCellNo;
2369 this.parentData.motherCellNo = this.parentData.motherCellNo; 2373 this.parentData.motherCellNo = this.parentData.motherCellNo;
2370 let addparentDetails = { 2374 let addparentDetails = {
2371 email: this.parentData.email, 2375 email: this.parentData.email,
2372 fatherName: this.parentData.fatherName, 2376 fatherName: this.parentData.fatherName,
2373 fatherCellNo: this.parentData.fatherCellNo, 2377 fatherCellNo: this.parentData.fatherCellNo,
2374 motherName: this.parentData.motherName, 2378 motherName: this.parentData.motherName,
2375 motherCellNo: this.parentData.motherCellNo, 2379 motherCellNo: this.parentData.motherCellNo,
2376 fatherProfession: this.parentData.fatherProfession, 2380 fatherProfession: this.parentData.fatherProfession,
2377 motherProfession: this.parentData.motherProfession, 2381 motherProfession: this.parentData.motherProfession,
2378 password: this.parentData.password, 2382 password: this.parentData.password,
2379 role: "PARENT", 2383 role: "PARENT",
2380 }; 2384 };
2381 this.loading = true; 2385 this.loading = true;
2382 http() 2386 http()
2383 .post("/createParent", addparentDetails) 2387 .post("/createParent", addparentDetails)
2384 .then((response) => { 2388 .then((response) => {
2385 this.parentId = response.data.data.id; 2389 this.parentId = response.data.data.id;
2386 this.e2 = 2; 2390 this.e2 = 2;
2387 this.snackbar = true; 2391 this.snackbar = true;
2388 this.text = response.data.message; 2392 this.text = response.data.message;
2389 this.color = "green"; 2393 this.color = "green";
2390 // this.getStudentList(); 2394 // this.getStudentList();
2391 this.clear(); 2395 this.clear();
2392 this.loading = false; 2396 this.loading = false;
2393 }) 2397 })
2394 .catch((error) => { 2398 .catch((error) => {
2395 this.snackbar = true; 2399 this.snackbar = true;
2396 this.text = error.response.data.message; 2400 this.text = error.response.data.message;
2397 this.color = "error"; 2401 this.color = "error";
2398 if (error.response.data.statusText) { 2402 if (error.response.data.statusText) {
2399 this.text = error.response.data.statusText; 2403 this.text = error.response.data.statusText;
2400 } 2404 }
2401 this.loading = false; 2405 this.loading = false;
2402 }); 2406 });
2403 } 2407 }
2404 }, 2408 },
2405 getParentDetails() { 2409 getParentDetails() {
2406 if (this.parentData.fatherCellNo.length > 9) { 2410 if (this.parentData.fatherCellNo.length > 9) {
2407 this.showLoader = true; 2411 this.showLoader = true;
2408 this.isFatherCellExists = false; 2412 this.isFatherCellExists = false;
2409 http() 2413 http()
2410 .get("getParticularParent", { 2414 .get("getParticularParent", {
2411 params: { fatherCellNo: this.parentData.fatherCellNo }, 2415 params: { fatherCellNo: this.parentData.fatherCellNo },
2412 headers: { 2416 headers: {
2413 Authorization: "Bearer " + this.$store.state.token, 2417 Authorization: "Bearer " + this.$store.state.token,
2414 }, 2418 },
2415 }) 2419 })
2416 .then((response) => { 2420 .then((response) => {
2417 this.showNext = true; 2421 this.showNext = true;
2418 this.showParent = false; 2422 this.showParent = false;
2419 this.parentData = response.data.data; 2423 this.parentData = response.data.data;
2420 this.parentId = response.data.data._id; 2424 this.parentId = response.data.data._id;
2421 this.showLoader = false; 2425 this.showLoader = false;
2422 this.isFatherCellExists = true; 2426 this.isFatherCellExists = true;
2423 }) 2427 })
2424 .catch((error) => { 2428 .catch((error) => {
2425 // console.log("err====>", error.response.data.message); 2429 // console.log("err====>", error.response.data.message);
2426 this.text = error.response.data.message; 2430 this.text = error.response.data.message;
2427 this.snackbar = true; 2431 this.snackbar = true;
2428 this.color = "error"; 2432 this.color = "error";
2429 if (this.text === "Data not found!") { 2433 if (this.text === "Data not found!") {
2430 this.showNext = false; 2434 this.showNext = false;
2431 this.showParent = true; 2435 this.showParent = true;
2432 this.parentData.email = ""; 2436 this.parentData.email = "";
2433 this.parentData.fatherName = ""; 2437 this.parentData.fatherName = "";
2434 this.parentData.motherName = ""; 2438 this.parentData.motherName = "";
2435 this.parentData.motherCellNo = ""; 2439 this.parentData.motherCellNo = "";
2436 this.parentData.fatherProfession = ""; 2440 this.parentData.fatherProfession = "";
2437 this.parentData.motherProfession = ""; 2441 this.parentData.motherProfession = "";
2438 this.parentData.password = ""; 2442 this.parentData.password = "";
2439 } 2443 }
2440 this.showLoader = false; 2444 this.showLoader = false;
2441 }); 2445 });
2442 } 2446 }
2443 }, 2447 },
2444 suspendStudentStatus(status, id) { 2448 suspendStudentStatus(status, id) {
2445 let suspendStudentData = { 2449 let suspendStudentData = {
2446 studentId: id, 2450 studentId: id,
2447 status: status, 2451 status: status,
2448 }; 2452 };
2449 http() 2453 http()
2450 .put("/suspendStudentAccount", suspendStudentData) 2454 .put("/suspendStudentAccount", suspendStudentData)
2451 .then((response) => { 2455 .then((response) => {
2452 this.findStudents(); 2456 this.findStudents();
2453 this.text = response.data.message; 2457 this.text = response.data.message;
2454 this.color = "green"; 2458 this.color = "green";
2455 this.snackbar = true; 2459 this.snackbar = true;
2456 }) 2460 })
2457 .catch((error) => { 2461 .catch((error) => {
2458 this.snackbar = true; 2462 this.snackbar = true;
2459 this.color = "error"; 2463 this.color = "error";
2460 this.text = error.response.data.message; 2464 this.text = error.response.data.message;
2461 }); 2465 });
2462 }, 2466 },
2463 displaySearch() { 2467 displaySearch() {
2464 (this.show = false), (this.showSearch = true); 2468 (this.show = false), (this.showSearch = true);
2465 }, 2469 },
2466 closeSearch() { 2470 closeSearch() {
2467 this.showSearch = false; 2471 this.showSearch = false;
2468 this.show = true; 2472 this.show = true;
2469 this.search = ""; 2473 this.search = "";
2470 }, 2474 },
2471 }, 2475 },
2472 mounted() { 2476 mounted() {
2473 const getCountryList = countryList(); 2477 const getCountryList = countryList();
2474 this.role = this.$store.state.role; 2478 this.role = this.$store.state.role;
2475 this.countries = getCountryList; 2479 this.countries = getCountryList;
2476 var token = this.$store.state.token; 2480 var token = this.$store.state.token;
2477 http() 2481 http()
2478 .get("/getClassesList", { 2482 .get("/getClassesList", {
2479 headers: { Authorization: "Bearer " + token }, 2483 headers: { Authorization: "Bearer " + token },
2480 }) 2484 })
2481 .then((response) => { 2485 .then((response) => {
2482 this.addclass = response.data.data; 2486 this.addclass = response.data.data;
2483 }) 2487 })
2484 .catch((error) => { 2488 .catch((error) => {
2485 this.showLoader = false; 2489 this.showLoader = false;
2486 if (error.response.status === 401) { 2490 if (error.response.status === 401) {
2487 this.$router.replace({ path: "/" }); 2491 this.$router.replace({ path: "/" });
2488 this.$store.dispatch("setToken", null); 2492 this.$store.dispatch("setToken", null);
2489 this.$store.dispatch("Id", null); 2493 this.$store.dispatch("Id", null);
2490 this.$store.dispatch("Role", null); 2494 this.$store.dispatch("Role", null);
2491 } 2495 }
2492 }); 2496 });
2493 }, 2497 },
2494 }; 2498 };
2495 </script> 2499 </script>
2496 <style scoped> 2500 <style scoped>
2497 .active { 2501 .active {
2498 background-color: gray; 2502 background-color: gray;
2499 color: white !important; 2503 color: white !important;
2500 } 2504 }
2501 .activebtn { 2505 .activebtn {
2502 color: black !important; 2506 color: black !important;
2503 } 2507 }
src/pages/TimeTable/timeTable.vue
1 <template> 1 <template>
2 <v-container fluid class="body-color"> 2 <v-container fluid class="body-color">
3 <!-- ****** EDIT TIME-TABLE****** --> 3 <!-- ****** EDIT TIME-TABLE****** -->
4 <v-dialog v-model="dialog" max-width="600px" persistent> 4 <v-dialog v-model="dialog" max-width="600px" persistent>
5 <v-flex xs12 sm12> 5 <v-flex xs12 sm12>
6 <v-card flat class="card-style pa-2" dark> 6 <v-card flat class="card-style pa-2" dark>
7 <v-layout> 7 <v-layout>
8 <v-flex xs12> 8 <v-flex xs12>
9 <label class="title text-xs-center">Edit Time Table</label> 9 <label class="title text-xs-center">Edit Time Table</label>
10 <v-icon size="24" class="right" @click="dialog = false">cancel</v-icon> 10 <v-icon size="24" class="right" @click="dialog = false">cancel</v-icon>
11 </v-flex> 11 </v-flex>
12 </v-layout> 12 </v-layout>
13 <!-- <v-layout> 13 <!-- <v-layout>
14 <v-flex 14 <v-flex
15 xs12 15 xs12
16 class="text-xs-center text-sm-center text-md-center text-lg-center" 16 class="text-xs-center text-sm-center text-md-center text-lg-center"
17 > 17 >
18 <v-avatar size="100px"> 18 <v-avatar size="100px">
19 <img src="/static/icon/user.png" v-if="!imageUrl" /> 19 <img src="/static/icon/user.png" v-if="!imageUrl" />
20 </v-avatar> 20 </v-avatar>
21 <input 21 <input
22 type="file" 22 type="file"
23 style="display: none" 23 style="display: none"
24 ref="image" 24 ref="image"
25 accept="image/*" 25 accept="image/*"
26 @change="onFilePicked" 26 @change="onFilePicked"
27 /> 27 />
28 <img 28 <img
29 :src="imageData.imageUrl" 29 :src="imageData.imageUrl"
30 height="150" 30 height="150"
31 v-if="imageUrl" 31 v-if="imageUrl"
32 style="border-radius:50%; width:200px" 32 style="border-radius:50%; width:200px"
33 /> 33 />
34 </v-flex> 34 </v-flex>
35 </v-layout>--> 35 </v-layout>-->
36 <v-flex xs12 sm12> 36 <v-flex xs12 sm12>
37 <v-layout> 37 <v-layout>
38 <v-flex xs4 class="pt-4 subheading"> 38 <v-flex xs4 class="pt-4 subheading">
39 <label class="right hidden-xs-only hidden-sm-only">Select Class:</label> 39 <label class="right hidden-xs-only hidden-sm-only">Select Class:</label>
40 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Class:</label> 40 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Class:</label>
41 </v-flex> 41 </v-flex>
42 <v-flex xs8 sm5 class="ml-3"> 42 <v-flex xs8 sm5 class="ml-3">
43 <v-select 43 <v-select
44 :items="addclass" 44 :items="addclass"
45 label="Select Class" 45 label="Select Class"
46 v-model="editedItem.classNum" 46 v-model="editedItem.classNum"
47 item-text="classNum" 47 item-text="classNum"
48 item-value="_id" 48 item-value="_id"
49 @change="getSections(editedItem.classNum)" 49 @change="getSections(editedItem.classNum)"
50 ></v-select> 50 ></v-select>
51 </v-flex> 51 </v-flex>
52 </v-layout> 52 </v-layout>
53 </v-flex> 53 </v-flex>
54 <v-flex xs12 sm12> 54 <v-flex xs12 sm12>
55 <v-layout> 55 <v-layout>
56 <v-flex xs4 class="pt-4 subheading"> 56 <v-flex xs4 class="pt-4 subheading">
57 <label class="right hidden-xs-only hidden-sm-only">Section Name:</label> 57 <label class="right hidden-xs-only hidden-sm-only">Section Name:</label>
58 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Section:</label> 58 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Section:</label>
59 </v-flex> 59 </v-flex>
60 <v-flex xs8 sm5 class="ml-3"> 60 <v-flex xs8 sm5 class="ml-3">
61 <v-select 61 <v-select
62 :items="addSection" 62 :items="addSection"
63 label="Select Section" 63 label="Select Section"
64 v-model="editedItem.selectSection" 64 v-model="editedItem.selectSection"
65 item-text="name" 65 item-text="name"
66 item-value="_id" 66 item-value="_id"
67 ></v-select> 67 ></v-select>
68 </v-flex> 68 </v-flex>
69 </v-layout> 69 </v-layout>
70 </v-flex> 70 </v-flex>
71 <v-layout> 71 <v-layout>
72 <v-flex xs12 sm9 offset-sm1> 72 <v-flex xs12 sm9 offset-sm1>
73 <v-card-actions> 73 <v-card-actions>
74 <v-spacer></v-spacer> 74 <v-spacer></v-spacer>
75 <v-btn round dark @click.native="close" class="clear-button">Cancel</v-btn> 75 <v-btn round dark @click.native="close" class="clear-button">Cancel</v-btn>
76 <v-btn round dark @click="save" class="add-button">Save</v-btn> 76 <v-btn round dark @click="save" class="add-button">Save</v-btn>
77 </v-card-actions> 77 </v-card-actions>
78 </v-flex> 78 </v-flex>
79 </v-layout> 79 </v-layout>
80 </v-card> 80 </v-card>
81 </v-flex> 81 </v-flex>
82 </v-dialog> 82 </v-dialog>
83 83
84 <!-- ****** ADD Dialog Schedule IN TIME-TABLE ****** --> 84 <!-- ****** ADD Dialog Schedule IN TIME-TABLE ****** -->
85 85
86 <v-dialog v-model="dialogSchedule" max-width="600px" persistent> 86 <v-dialog v-model="dialogSchedule" max-width="600px" persistent>
87 <v-flex xs12 sm12> 87 <v-flex xs12 sm12>
88 <v-card flat class="card-style pa-2" dark> 88 <v-card flat class="card-style pa-2" dark>
89 <v-layout> 89 <v-layout>
90 <v-flex xs12> 90 <v-flex xs12>
91 <label class="title text-xs-center">Add Schedule</label> 91 <label class="title text-xs-center">Add Schedule</label>
92 <v-icon size="24" class="right" @click="dialogSchedule = false">cancel</v-icon> 92 <v-icon size="24" class="right" @click="dialogSchedule = false">cancel</v-icon>
93 </v-flex> 93 </v-flex>
94 </v-layout> 94 </v-layout>
95 <v-form ref="formAddDay" v-model="validAddDay" lazy-validation> 95 <v-form ref="formAddDay" v-model="validAddDay" lazy-validation>
96 <v-container fluid> 96 <v-container fluid>
97 <v-flex xs12 sm12 class="py-3"> 97 <v-flex xs12 sm12 class="py-3">
98 <v-layout> 98 <v-layout>
99 <v-flex xs4 class="pt-4 subheading"> 99 <v-flex xs4 class="pt-4 subheading">
100 <label class="right hidden-xs-only hidden-sm-only">Select Day:</label> 100 <label class="right hidden-xs-only hidden-sm-only">Select Day:</label>
101 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Day:</label> 101 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Day:</label>
102 </v-flex> 102 </v-flex>
103 <v-flex xs12 sm5 class="pl-3"> 103 <v-flex xs12 sm5 class="pl-3">
104 <v-select 104 <v-select
105 :items="addOneDay" 105 :items="addOneDay"
106 label="Select Day" 106 label="Select Day"
107 v-model="schedule.selectDay" 107 v-model="schedule.selectDay"
108 :rules="selecDayRule" 108 :rules="selecDayRule"
109 ></v-select> 109 ></v-select>
110 </v-flex> 110 </v-flex>
111 </v-layout> 111 </v-layout>
112 </v-flex> 112 </v-flex>
113 <v-layout> 113 <v-layout>
114 <v-flex xs12 sm8 offset-sm2> 114 <v-flex xs12 sm8 offset-sm2>
115 <v-card-actions> 115 <v-card-actions>
116 <v-spacer></v-spacer> 116 <v-spacer></v-spacer>
117 <v-btn round dark @click="submitSchedule" class="add-button">Save</v-btn> 117 <v-btn round dark @click="submitSchedule" class="add-button">Save</v-btn>
118 <v-spacer></v-spacer> 118 <v-spacer></v-spacer>
119 </v-card-actions> 119 </v-card-actions>
120 </v-flex> 120 </v-flex>
121 </v-layout> 121 </v-layout>
122 </v-container> 122 </v-container>
123 </v-form> 123 </v-form>
124 </v-card> 124 </v-card>
125 </v-flex> 125 </v-flex>
126 </v-dialog> 126 </v-dialog>
127 127
128 <!-- ****** ADD LECTURES IN TIME-TABLE ****** --> 128 <!-- ****** ADD LECTURES IN TIME-TABLE ****** -->
129 129
130 <v-dialog v-model="dialogAddLecture" max-width="600px" persistent> 130 <v-dialog v-model="dialogAddLecture" max-width="600px" persistent>
131 <v-flex xs12 sm12> 131 <v-flex xs12 sm12>
132 <v-card flat class="card-style pa-2" dark> 132 <v-card flat class="card-style pa-2" dark>
133 <v-layout> 133 <v-layout>
134 <v-flex xs12> 134 <v-flex xs12>
135 <label class="title text-xs-center">Add Lecture</label> 135 <label class="title text-xs-center">Add Lecture</label>
136 <v-icon size="24" class="right" @click="dialogAddLecture = false">cancel</v-icon> 136 <v-icon size="24" class="right" @click="dialogAddLecture = false">cancel</v-icon>
137 </v-flex> 137 </v-flex>
138 </v-layout> 138 </v-layout>
139 <v-form ref="lectureForm" v-model="valid" lazy-validation> 139 <v-form ref="lectureForm" v-model="valid" lazy-validation>
140 <v-container fluid> 140 <v-container fluid>
141 <v-flex xs12 sm12> 141 <v-flex xs12 sm12>
142 <v-layout> 142 <v-layout>
143 <v-flex xs4 class="pt-4 subheading"> 143 <v-flex xs4 class="pt-4 subheading">
144 <label class="right hidden-xs-only hidden-sm-only">Select Class:</label> 144 <label class="right hidden-xs-only hidden-sm-only">Select Class:</label>
145 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Class:</label> 145 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Class:</label>
146 </v-flex> 146 </v-flex>
147 <v-flex xs5 class="ml-3"> 147 <v-flex xs5 class="ml-3">
148 <v-select 148 <v-select
149 :items="addclass" 149 :items="addclass"
150 label="Select Class" 150 label="Select Class"
151 v-model="timeTable.select" 151 v-model="timeTable.select"
152 item-text="classNum" 152 item-text="classNum"
153 item-value="_id" 153 item-value="_id"
154 @change="getClassSubject(timeTable.select)" 154 @change="getClassSubject(timeTable.select)"
155 :rules="classRules" 155 :rules="classRules"
156 required 156 required
157 ></v-select> 157 ></v-select>
158 </v-flex> 158 </v-flex>
159 </v-layout> 159 </v-layout>
160 </v-flex> 160 </v-flex>
161 <v-flex xs12 sm12> 161 <v-flex xs12 sm12>
162 <v-layout> 162 <v-layout>
163 <v-flex xs4 class="pt-4 subheading"> 163 <v-flex xs4 class="pt-4 subheading">
164 <label class="right">Subject Name:</label> 164 <label class="right">Subject Name:</label>
165 </v-flex> 165 </v-flex>
166 <v-flex xs5 class="ml-3"> 166 <v-flex xs5 class="ml-3">
167 <v-select 167 <v-select
168 :items="subjectList.subjects" 168 :items="subjectList.subjects"
169 label="Select Subject" 169 label="Select Subject"
170 v-model="addlectures.subjectName" 170 v-model="addlectures.subjectName"
171 item-text="subjectName" 171 item-text="subjectName"
172 item-value="subjectName" 172 item-value="subjectName"
173 :rules="subjectNameRules" 173 :rules="subjectNameRules"
174 required 174 required
175 ></v-select> 175 ></v-select>
176 <!-- <v-text-field 176 <!-- <v-text-field
177 v-model="addlectures.subjectName" 177 v-model="addlectures.subjectName"
178 :rules="subjectNameRules" 178 :rules="subjectNameRules"
179 placeholder="fill your Subject Name" 179 placeholder="fill your Subject Name"
180 type="text" 180 type="text"
181 ></v-text-field>--> 181 ></v-text-field>-->
182 </v-flex> 182 </v-flex>
183 </v-layout> 183 </v-layout>
184 </v-flex> 184 </v-flex>
185 <v-flex xs12 sm12> 185 <v-flex xs12 sm12>
186 <v-layout> 186 <v-layout>
187 <v-flex xs4 class="pt-4 subheading"> 187 <v-flex xs4 class="pt-4 subheading">
188 <label class="right">Time In:</label> 188 <label class="right">Time In:</label>
189 </v-flex> 189 </v-flex>
190 <v-flex xs5 class="ml-3"> 190 <v-flex xs5 class="ml-3">
191 <v-menu 191 <v-menu
192 ref="menuD" 192 ref="menuD"
193 :close-on-content-click="false" 193 :close-on-content-click="false"
194 v-model="menu5" 194 v-model="menu5"
195 :nudge-right="40" 195 :nudge-right="40"
196 lazy 196 lazy
197 transition="scale-transition" 197 transition="scale-transition"
198 offset-y 198 offset-y
199 full-width 199 full-width
200 max-width="290px" 200 max-width="290px"
201 min-width="290px" 201 min-width="290px"
202 > 202 >
203 <v-text-field 203 <v-text-field
204 slot="activator" 204 slot="activator"
205 v-model="addlectures.timeIn" 205 v-model="addlectures.timeIn"
206 label="Select your Time In" 206 label="Select your Time In"
207 append-icon="access_time" 207 append-icon="access_time"
208 :rules="timeInRules" 208 :rules="timeInRules"
209 readonly 209 readonly
210 ></v-text-field> 210 ></v-text-field>
211 <v-time-picker v-model="addlectures.timeIn" @change="menu5 = false"></v-time-picker> 211 <v-time-picker v-model="addlectures.timeIn" @change="menu5 = false"></v-time-picker>
212 </v-menu> 212 </v-menu>
213 </v-flex> 213 </v-flex>
214 </v-layout> 214 </v-layout>
215 </v-flex> 215 </v-flex>
216 <v-flex xs12 sm12> 216 <v-flex xs12 sm12>
217 <v-layout> 217 <v-layout>
218 <v-flex xs4 class="pt-4 subheading"> 218 <v-flex xs4 class="pt-4 subheading">
219 <label class="right">Time Out:</label> 219 <label class="right">Time Out:</label>
220 </v-flex> 220 </v-flex>
221 <v-flex xs5 class="ml-3"> 221 <v-flex xs5 class="ml-3">
222 <v-menu 222 <v-menu
223 ref="menuE" 223 ref="menuE"
224 :close-on-content-click="false" 224 :close-on-content-click="false"
225 v-model="menu6" 225 v-model="menu6"
226 :nudge-right="40" 226 :nudge-right="40"
227 lazy 227 lazy
228 transition="scale-transition" 228 transition="scale-transition"
229 offset-y 229 offset-y
230 full-width 230 full-width
231 max-width="290px" 231 max-width="290px"
232 min-width="290px" 232 min-width="290px"
233 > 233 >
234 <v-text-field 234 <v-text-field
235 slot="activator" 235 slot="activator"
236 :rules="timeOutRules" 236 :rules="timeOutRules"
237 v-model="addlectures.timeOut" 237 v-model="addlectures.timeOut"
238 label="Select your Time Out" 238 label="Select your Time Out"
239 append-icon="access_time" 239 append-icon="access_time"
240 readonly 240 readonly
241 ></v-text-field> 241 ></v-text-field>
242 <v-time-picker v-model="addlectures.timeOut" @change="menu6 = false"></v-time-picker> 242 <v-time-picker v-model="addlectures.timeOut" @change="menu6 = false"></v-time-picker>
243 </v-menu> 243 </v-menu>
244 </v-flex> 244 </v-flex>
245 </v-layout> 245 </v-layout>
246 </v-flex> 246 </v-flex>
247 <v-flex xs12 sm12> 247 <v-flex xs12 sm12>
248 <v-layout> 248 <v-layout>
249 <v-flex xs4 class="pt-4 subheading"> 249 <v-flex xs4 class="pt-4 subheading">
250 <label class="right">Select Teacher:</label> 250 <label class="right">Select Teacher:</label>
251 </v-flex> 251 </v-flex>
252 <v-flex xs5 class="ml-3"> 252 <v-flex xs5 class="ml-3">
253 <v-select 253 <v-select
254 :items="addTeachers" 254 :items="addTeachers"
255 label="Select Teacher" 255 label="Select Teacher"
256 v-model="addlectures.teacherId" 256 v-model="addlectures.teacherId"
257 :rules="teacherRules" 257 :rules="teacherRules"
258 item-text="name" 258 item-text="name"
259 item-value="_id" 259 item-value="_id"
260 required 260 required
261 ></v-select> 261 ></v-select>
262 </v-flex> 262 </v-flex>
263 </v-layout> 263 </v-layout>
264 </v-flex> 264 </v-flex>
265 <v-layout> 265 <v-layout>
266 <v-flex xs12 sm8 offset-sm2> 266 <v-flex xs12 sm8 offset-sm2>
267 <v-card-actions> 267 <v-card-actions>
268 <v-spacer></v-spacer> 268 <v-spacer></v-spacer>
269 <v-btn round dark @click="AddLecture" class="add-button">Save</v-btn> 269 <v-btn round dark @click="AddLecture" class="add-button">Save</v-btn>
270 </v-card-actions> 270 </v-card-actions>
271 </v-flex> 271 </v-flex>
272 </v-layout> 272 </v-layout>
273 </v-container> 273 </v-container>
274 </v-form> 274 </v-form>
275 </v-card> 275 </v-card>
276 </v-flex> 276 </v-flex>
277 </v-dialog> 277 </v-dialog>
278 278
279 <!-- ****** EDIT PARTICULAR LECTURES TIME-TABLE ****** --> 279 <!-- ****** EDIT PARTICULAR LECTURES TIME-TABLE ****** -->
280 280
281 <v-dialog v-model="dialogUpdateLectures" max-width="600px" persistent> 281 <v-dialog v-model="dialogUpdateLectures" max-width="600px" persistent>
282 <v-flex xs12 sm12 class> 282 <v-flex xs12 sm12 class>
283 <v-card flat class="card-style pa-2" dark> 283 <v-card flat class="card-style pa-2" dark>
284 <v-layout> 284 <v-layout>
285 <v-flex xs12> 285 <v-flex xs12>
286 <label class="title text-xs-center">Edit Lecture</label> 286 <label class="title text-xs-center">Edit Lecture</label>
287 <v-icon size="24" class="right" @click="dialogUpdateLectures = false">cancel</v-icon> 287 <v-icon size="24" class="right" @click="dialogUpdateLectures = false">cancel</v-icon>
288 </v-flex> 288 </v-flex>
289 </v-layout> 289 </v-layout>
290 <v-flex xs12 sm12> 290 <v-flex xs12 sm12>
291 <v-layout> 291 <v-layout>
292 <v-flex xs4 class="pt-4 subheading"> 292 <v-flex xs4 class="pt-4 subheading">
293 <label class="right hidden-xs-only hidden-sm-only">Select Class:</label> 293 <label class="right hidden-xs-only hidden-sm-only">Select Class:</label>
294 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Class:</label> 294 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Class:</label>
295 </v-flex> 295 </v-flex>
296 <v-flex xs7 sm6 class="ml-3"> 296 <v-flex xs7 sm6 class="ml-3">
297 <v-select 297 <v-select
298 :items="addclass" 298 :items="addclass"
299 label="Select Class" 299 label="Select Class"
300 v-model="updateLectures.select" 300 v-model="updateLectures.select"
301 item-text="classNum" 301 item-text="classNum"
302 item-value="_id" 302 item-value="_id"
303 @change="getClassSubject(updateLectures.select)" 303 @change="getClassSubject(updateLectures.select)"
304 required 304 required
305 ></v-select> 305 ></v-select>
306 </v-flex> 306 </v-flex>
307 </v-layout> 307 </v-layout>
308 </v-flex> 308 </v-flex>
309 <v-flex xs12 sm12> 309 <v-flex xs12 sm12>
310 <v-layout> 310 <v-layout>
311 <v-flex xs4 class="pt-4 subheading"> 311 <v-flex xs4 class="pt-4 subheading">
312 <label class="right hidden-xs-only hidden-sm-only">Select Subject:</label> 312 <label class="right hidden-xs-only hidden-sm-only">Select Subject:</label>
313 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Subject:</label> 313 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Subject:</label>
314 </v-flex> 314 </v-flex>
315 <v-flex xs7 sm6 class="ml-3"> 315 <v-flex xs7 sm6 class="ml-3">
316 <v-select 316 <v-select
317 :items="subjectList.subjects" 317 :items="subjectList.subjects"
318 label="Select Subject" 318 label="Select Subject"
319 v-model="updateLectures.subjectName" 319 v-model="updateLectures.subjectName"
320 item-text="subjectName" 320 item-text="subjectName"
321 item-value="subjectName" 321 item-value="subjectName"
322 required 322 required
323 ></v-select> 323 ></v-select>
324 <!-- <v-text-field 324 <!-- <v-text-field
325 v-model="updateLectures.subjectName" 325 v-model="updateLectures.subjectName"
326 placeholder="fill your Subject Name" 326 placeholder="fill your Subject Name"
327 type="text" 327 type="text"
328 ></v-text-field>--> 328 ></v-text-field>-->
329 </v-flex> 329 </v-flex>
330 </v-layout> 330 </v-layout>
331 </v-flex> 331 </v-flex>
332 <v-flex xs12 sm12> 332 <v-flex xs12 sm12>
333 <v-layout> 333 <v-layout>
334 <v-flex xs5 sm4 class="pt-4 subheading"> 334 <v-flex xs5 sm4 class="pt-4 subheading">
335 <label class="right">Time In:</label> 335 <label class="right">Time In:</label>
336 </v-flex> 336 </v-flex>
337 <v-flex xs7 sm6 class="ml-3"> 337 <v-flex xs7 sm6 class="ml-3">
338 <v-menu 338 <v-menu
339 ref="menuC" 339 ref="menuC"
340 :close-on-content-click="false" 340 :close-on-content-click="false"
341 v-model="menu4" 341 v-model="menu4"
342 :nudge-right="40" 342 :nudge-right="40"
343 lazy 343 lazy
344 transition="scale-transition" 344 transition="scale-transition"
345 offset-y 345 offset-y
346 full-width 346 full-width
347 max-width="290px" 347 max-width="290px"
348 min-width="290px" 348 min-width="290px"
349 > 349 >
350 <v-text-field 350 <v-text-field
351 slot="activator" 351 slot="activator"
352 v-model="updateLectures.timeIn" 352 v-model="updateLectures.timeIn"
353 placeholder="Select your Time In" 353 placeholder="Select your Time In"
354 append-icon="access_time" 354 append-icon="access_time"
355 readonly 355 readonly
356 ></v-text-field> 356 ></v-text-field>
357 <v-time-picker v-model="updateLectures.timeIn" @change="menu4= false"></v-time-picker> 357 <v-time-picker v-model="updateLectures.timeIn" @change="menu4= false"></v-time-picker>
358 </v-menu> 358 </v-menu>
359 </v-flex> 359 </v-flex>
360 </v-layout> 360 </v-layout>
361 </v-flex> 361 </v-flex>
362 <v-flex xs12 sm12> 362 <v-flex xs12 sm12>
363 <v-layout> 363 <v-layout>
364 <v-flex xs5 sm4 class="pt-4 subheading"> 364 <v-flex xs5 sm4 class="pt-4 subheading">
365 <label class="right">Time Out:</label> 365 <label class="right">Time Out:</label>
366 </v-flex> 366 </v-flex>
367 <v-flex xs7 sm6 class="ml-3"> 367 <v-flex xs7 sm6 class="ml-3">
368 <v-menu 368 <v-menu
369 ref="menuB" 369 ref="menuB"
370 :close-on-content-click="false" 370 :close-on-content-click="false"
371 v-model="menu3" 371 v-model="menu3"
372 :nudge-right="40" 372 :nudge-right="40"
373 lazy 373 lazy
374 transition="scale-transition" 374 transition="scale-transition"
375 offset-y 375 offset-y
376 full-width 376 full-width
377 max-width="290px" 377 max-width="290px"
378 min-width="290px" 378 min-width="290px"
379 > 379 >
380 <v-text-field 380 <v-text-field
381 slot="activator" 381 slot="activator"
382 v-model="updateLectures.timeOut" 382 v-model="updateLectures.timeOut"
383 placeholder="Select your Time Out" 383 placeholder="Select your Time Out"
384 append-icon="access_time" 384 append-icon="access_time"
385 readonly 385 readonly
386 ></v-text-field> 386 ></v-text-field>
387 <v-time-picker v-model="updateLectures.timeOut" @change="menu3 = false"></v-time-picker> 387 <v-time-picker v-model="updateLectures.timeOut" @change="menu3 = false"></v-time-picker>
388 </v-menu> 388 </v-menu>
389 </v-flex> 389 </v-flex>
390 </v-layout> 390 </v-layout>
391 </v-flex> 391 </v-flex>
392 <v-flex xs12 sm12> 392 <v-flex xs12 sm12>
393 <v-layout> 393 <v-layout>
394 <v-flex xs5 sm4 class="pt-4 subheading"> 394 <v-flex xs5 sm4 class="pt-4 subheading">
395 <label class="right">Select Teacher:</label> 395 <label class="right">Select Teacher:</label>
396 </v-flex> 396 </v-flex>
397 <v-flex xs7 sm6 class="ml-3"> 397 <v-flex xs7 sm6 class="ml-3">
398 <v-select 398 <v-select
399 :items="addTeachers" 399 :items="addTeachers"
400 label="Select Teacher" 400 label="Select Teacher"
401 v-model="updateLectures.teacherId" 401 v-model="updateLectures.teacherId"
402 item-text="name" 402 item-text="name"
403 item-value="_id" 403 item-value="_id"
404 required 404 required
405 ></v-select> 405 ></v-select>
406 </v-flex> 406 </v-flex>
407 </v-layout> 407 </v-layout>
408 </v-flex> 408 </v-flex>
409 <v-layout> 409 <v-layout>
410 <v-flex xs12 sm10 offset-sm1> 410 <v-flex xs12 sm10 offset-sm1>
411 <v-card-actions> 411 <v-card-actions>
412 <!-- <v-btn round dark @click.native="closeUpdateLectures">Cancel</v-btn> --> 412 <!-- <v-btn round dark @click.native="closeUpdateLectures">Cancel</v-btn> -->
413 <v-spacer></v-spacer> 413 <v-spacer></v-spacer>
414 <v-btn 414 <v-btn
415 round 415 round
416 dark 416 dark
417 class="add-button" 417 class="add-button"
418 @click="updateParticularTable(updateLectures.timeIn,updateLectures.timeOut)" 418 @click="updateParticularTable(updateLectures.timeIn,updateLectures.timeOut)"
419 >Save</v-btn> 419 >Save</v-btn>
420 </v-card-actions> 420 </v-card-actions>
421 </v-flex> 421 </v-flex>
422 </v-layout> 422 </v-layout>
423 </v-card> 423 </v-card>
424 </v-flex> 424 </v-flex>
425 </v-dialog> 425 </v-dialog>
426 <!-- ****** EXISTING-USERS TIME-TABLE ****** --> 426 <!-- ****** EXISTING-USERS TIME-TABLE ****** -->
427 427
428 <!-- <v-card flat> 428 <!-- <v-card flat>
429 <v-card-actions class="hidden-xs-only hidden-sm-only"> 429 <v-card-actions class="hidden-xs-only hidden-sm-only">
430 <v-layout> 430 <v-layout>
431 <label class="right mt-4 ml-5">Select Class:</label> 431 <label class="right mt-4 ml-5">Select Class:</label>
432 <v-select 432 <v-select
433 :items="addclass" 433 :items="addclass"
434 label="Select Class" 434 label="Select Class"
435 v-model="selectTimeTable.select" 435 v-model="selectTimeTable.select"
436 item-text="classNum" 436 item-text="classNum"
437 item-value="_id" 437 item-value="_id"
438 name="Select Class" 438 name="Select Class"
439 @change="getSections(selectTimeTable.select)" 439 @change="getSections(selectTimeTable.select)"
440 class="px-4" 440 class="px-4"
441 required 441 required
442 ></v-select> 442 ></v-select>
443 <label class="right mt-4">Select Section:</label> 443 <label class="right mt-4">Select Section:</label>
444 <v-select 444 <v-select
445 :items="addSection" 445 :items="addSection"
446 label="Select Section" 446 label="Select Section"
447 v-model="selectTimeTable.selectSection" 447 v-model="selectTimeTable.selectSection"
448 item-text="name" 448 item-text="name"
449 item-value="_id" 449 item-value="_id"
450 name="Select Section" 450 name="Select Section"
451 class="pl-3" 451 class="pl-3"
452 required 452 required
453 ></v-select> 453 ></v-select>
454 </v-layout> 454 </v-layout>
455 <v-spacer></v-spacer> 455 <v-spacer></v-spacer>
456 <v-btn @click="findTimeTable()" round dark :loading="loadingFindData" class="left">Find</v-btn> 456 <v-btn @click="findTimeTable()" round dark :loading="loadingFindData" class="left">Find</v-btn>
457 </v-card-actions> 457 </v-card-actions>
458 <v-layout class="hidden-xl-only hidden-lg-only hidden-md-only"> 458 <v-layout class="hidden-xl-only hidden-lg-only hidden-md-only">
459 <v-flex xs4 sm2 class="mt-4 ml-2"> 459 <v-flex xs4 sm2 class="mt-4 ml-2">
460 <label>Select Class:</label> 460 <label>Select Class:</label>
461 </v-flex> 461 </v-flex>
462 <v-flex xs6 sm9> 462 <v-flex xs6 sm9>
463 <v-select 463 <v-select
464 :items="addclass" 464 :items="addclass"
465 label="Select Class" 465 label="Select Class"
466 v-model="selectTimeTable.select" 466 v-model="selectTimeTable.select"
467 item-text="classNum" 467 item-text="classNum"
468 item-value="_id" 468 item-value="_id"
469 name="Select Class" 469 name="Select Class"
470 @change="getSections(selectTimeTable.select)" 470 @change="getSections(selectTimeTable.select)"
471 required 471 required
472 ></v-select> 472 ></v-select>
473 </v-flex> 473 </v-flex>
474 </v-layout> 474 </v-layout>
475 <v-layout class="hidden-xl-only hidden-lg-only hidden-md-only"> 475 <v-layout class="hidden-xl-only hidden-lg-only hidden-md-only">
476 <v-flex xs4 sm2 class="mt-4 ml-2"> 476 <v-flex xs4 sm2 class="mt-4 ml-2">
477 <label>Select Section:</label> 477 <label>Select Section:</label>
478 </v-flex> 478 </v-flex>
479 <v-flex xs6 sm9> 479 <v-flex xs6 sm9>
480 <v-select 480 <v-select
481 :items="addSection" 481 :items="addSection"
482 label="Select Section" 482 label="Select Section"
483 v-model="selectTimeTable.selectSection" 483 v-model="selectTimeTable.selectSection"
484 item-text="name" 484 item-text="name"
485 item-value="_id" 485 item-value="_id"
486 name="Select Section" 486 name="Select Section"
487 required 487 required
488 ></v-select> 488 ></v-select>
489 </v-flex> 489 </v-flex>
490 </v-layout> 490 </v-layout>
491 <v-layout class="hidden-xl-only hidden-lg-only hidden-md-only"> 491 <v-layout class="hidden-xl-only hidden-lg-only hidden-md-only">
492 <v-flex xs12> 492 <v-flex xs12>
493 <v-btn @click="findTimeTable()" round dark :loading="loading" class="right mr-4 mb-2">Find</v-btn> 493 <v-btn @click="findTimeTable()" round dark :loading="loading" class="right mr-4 mb-2">Find</v-btn>
494 </v-flex> 494 </v-flex>
495 </v-layout> 495 </v-layout>
496 </v-card>--> 496 </v-card>-->
497 <v-flex xs12> 497 <v-flex xs12>
498 <v-toolbar color="transparent" flat> 498 <v-toolbar color="transparent" flat>
499 <v-btn 499 <v-btn
500 fab 500 fab
501 dark 501 dark
502 class="open-dialog-button hidden-xl-only hidden-md-only hidden-lg-only" 502 class="open-dialog-button hidden-xl-only hidden-md-only hidden-lg-only"
503 small 503 small
504 @click="addTimeTableDialog = true" 504 @click="addTimeTableDialog = true"
505 > 505 >
506 <v-icon dark>add</v-icon> 506 <v-icon dark>add</v-icon>
507 </v-btn> 507 </v-btn>
508 <v-btn 508 <v-btn
509 round 509 round
510 class="open-dialog-button hidden-sm-only hidden-xs-only" 510 class="open-dialog-button hidden-sm-only hidden-xs-only"
511 dark 511 dark
512 @click="addTimeTableDialog = true" 512 @click="addTimeTableDialog = true"
513 > 513 >
514 <v-icon class="white--text pr-1" size="20">add</v-icon>Add Time Table 514 <v-icon class="white--text pr-1" size="20">add</v-icon>Add Time Table
515 </v-btn> 515 </v-btn>
516 <v-flex xs4 md2> 516 <v-flex xs4 md2>
517 <v-select 517 <v-select
518 :items="addclass" 518 :items="addclass"
519 label="Select Class" 519 label="Select Class"
520 v-model="selectTimeTable.select" 520 v-model="selectTimeTable.select"
521 item-text="classNum" 521 item-text="classNum"
522 item-value="_id" 522 item-value="_id"
523 name="Select Class" 523 name="Select Class"
524 @change="getSections(selectTimeTable.select)" 524 @change="getSections(selectTimeTable.select)"
525 required 525 required
526 ></v-select> 526 ></v-select>
527 </v-flex> 527 </v-flex>
528 <v-flex xs4 md2 class="ml-4"> 528 <v-flex xs4 md2 class="ml-4">
529 <v-select 529 <v-select
530 :items="addSection" 530 :items="addSection"
531 label="Select Section" 531 label="Select Section"
532 v-model="selectTimeTable.selectSection" 532 v-model="selectTimeTable.selectSection"
533 item-text="name" 533 item-text="name"
534 item-value="_id" 534 item-value="_id"
535 name="Select Section" 535 name="Select Section"
536 required 536 required
537 ></v-select> 537 ></v-select>
538 </v-flex> 538 </v-flex>
539 <v-spacer></v-spacer> 539 <v-spacer></v-spacer>
540 <v-btn 540 <v-btn
541 @click="findTimeTable()" 541 @click="findTimeTable()"
542 round 542 round
543 dark 543 dark
544 :loading="loading" 544 :loading="loading"
545 class="right mb-2 open-dialog-button" 545 class="right mb-2 open-dialog-button"
546 >Find</v-btn> 546 >Find</v-btn>
547 <v-card-title class="body-1" v-show="show"> 547 <v-card-title class="body-1" v-show="show">
548 <v-btn icon large flat @click="displaySearch"> 548 <v-btn icon large flat @click="displaySearch">
549 <v-avatar size="27"> 549 <v-avatar size="27">
550 <img src="/static/icon/search.png" alt="icon" /> 550 <img src="/static/icon/search.png" alt="icon" />
551 </v-avatar> 551 </v-avatar>
552 </v-btn> 552 </v-btn>
553 </v-card-title> 553 </v-card-title>
554 <v-flex xs8 sm8 md3 lg2 v-if="showSearch"> 554 <v-flex xs8 sm8 md3 lg2 v-if="showSearch">
555 <v-layout> 555 <v-layout>
556 <v-text-field 556 <v-text-field
557 autofocus 557 autofocus
558 v-model="search" 558 v-model="search"
559 label="Search" 559 label="Search"
560 prepend-inner-icon="search" 560 prepend-inner-icon="search"
561 color="primary" 561 color="primary"
562 ></v-text-field> 562 ></v-text-field>
563 <v-icon @click="closeSearch" color="error">close</v-icon> 563 <v-icon @click="closeSearch" color="error">close</v-icon>
564 </v-layout> 564 </v-layout>
565 </v-flex> 565 </v-flex>
566 </v-toolbar> 566 </v-toolbar>
567 <v-data-table 567 <v-data-table
568 :headers="headers" 568 :headers="headers"
569 :items="desserts" 569 :items="desserts"
570 :pagination.sync="pagination" 570 :pagination.sync="pagination"
571 :search="search" 571 :search="search"
572 item-key="_id" 572 item-key="_id"
573 > 573 >
574 <template slot="items" slot-scope="props"> 574 <template slot="items" slot-scope="props">
575 <tr 575 <tr
576 style="cursor: pointer;" 576 style="cursor: pointer;"
577 class="tr" 577 class="tr"
578 @click="getTimeTable(props.item), props.expanded = !props.expanded" 578 @click="getTimeTable(props.item), props.expanded = !props.expanded"
579 > 579 >
580 <td class="td td-row">{{ props.index + 1}}</td> 580 <td class="td td-row">{{ props.index + 1}}</td>
581 <td class="text-xs-center td td-row">{{ props.item.classData.classNum}}</td> 581 <td class="text-xs-center td td-row">{{ props.item.classData.classNum}}</td>
582 <td class="text-xs-center td td-row">{{ props.item.sectionData.name }}</td> 582 <td class="text-xs-center td td-row">{{ props.item.sectionData.name }}</td>
583 <td class="text-xs-center td td-row"> 583 <td class="text-xs-center td td-row">
584 <span> 584 <span>
585 <v-tooltip top> 585 <v-tooltip top>
586 <img 586 <img
587 slot="activator" 587 slot="activator"
588 style="cursor:pointer; width:20px; height:20px; " 588 style="cursor:pointer; width:20px; height:20px; "
589 class="mr-3" 589 class="mr-3"
590 @click="editItem(props.item)" 590 @click="editItem(props.item)"
591 src="/static/icon/edit.png" 591 src="/static/icon/edit.png"
592 /> 592 />
593 <span>Edit</span> 593 <span>Edit</span>
594 </v-tooltip> 594 </v-tooltip>
595 <v-tooltip top> 595 <v-tooltip top>
596 <img 596 <img
597 slot="activator" 597 slot="activator"
598 style="cursor:pointer; width:20px; height:20px; " 598 style="cursor:pointer; width:20px; height:20px; "
599 class="mr-3" 599 class="mr-3"
600 @click="deleteItem(props.item)" 600 @click="deleteItem(props.item)"
601 src="/static/icon/delete.png" 601 src="/static/icon/delete.png"
602 /> 602 />
603 <span>Delete</span> 603 <span>Delete</span>
604 </v-tooltip> 604 </v-tooltip>
605 <v-tooltip top> 605 <v-tooltip top>
606 <img 606 <img
607 slot="activator" 607 slot="activator"
608 style="cursor:pointer; width:20px; height:20px; " 608 style="cursor:pointer; width:20px; height:20px; "
609 class="mr-3" 609 class="mr-3"
610 src="/static/icon/add1.png" 610 src="/static/icon/add1.png"
611 @click="addSchedule(props.item._id)" 611 @click="addSchedule(props.item._id)"
612 /> 612 />
613 <span>Add</span> 613 <span>Add</span>
614 </v-tooltip> 614 </v-tooltip>
615 </span> 615 </span>
616 </td> 616 </td>
617 </tr> 617 </tr>
618 </template> 618 </template>
619 <template slot="expand" slot-scope="props"> 619 <template slot="expand" slot-scope="props">
620 <v-data-table 620 <v-data-table
621 :items="timeTableList.schedule" 621 :items="timeTableList.schedule"
622 hide-actions 622 hide-actions
623 item-key="title" 623 item-key="title"
624 style="width: auto;" 624 style="width: auto;"
625 > 625 >
626 <template slot="items" slot-scope="props"> 626 <template slot="items" slot-scope="props">
627 <tr class="tr"> 627 <tr class="tr">
628 <td class="text-xs-left subheading table-td td td-row"> 628 <td class="text-xs-left subheading table-td td td-row">
629 <b>{{ props.item.day }}</b> 629 <b>{{ props.item.day }}</b>
630 </td> 630 </td>
631 <td class="table-td td td-row"> 631 <td class="table-td td td-row">
632 <b>Subject</b> 632 <b>Subject</b>
633 <br /> 633 <br />
634 <b>Time In</b> 634 <b>Time In</b>
635 <br /> 635 <br />
636 <b>Time Out</b> 636 <b>Time Out</b>
637 </td> 637 </td>
638 <td v-for="list in props.item.lectures" class="table-td td td-row"> 638 <td v-for="list in props.item.lectures" class="table-td td td-row">
639 <b>{{ list.subjectName }}</b> 639 <b>{{ list.subjectName }}</b>
640 <img 640 <img
641 style="cursor:pointer; width:20px; height:18px; " 641 style="cursor:pointer; width:20px; height:18px; "
642 class="mr-2 ml-2" 642 class="mr-2 ml-2"
643 src="/static/icon/edit1.png" 643 src="/static/icon/edit1.png"
644 @click="updateTimeTable(list, timeTableList,props.item._id)" 644 @click="updateTimeTable(list, timeTableList,props.item._id)"
645 /> 645 />
646 <img 646 <img
647 style="cursor:pointer; width:20px; height:20px; " 647 style="cursor:pointer; width:20px; height:20px; "
648 src="/static/icon/delete1.png" 648 src="/static/icon/delete1.png"
649 @click="deleteTimeTable(list,props.item.lectures)" 649 @click="deleteTimeTable(list,props.item.lectures)"
650 /> 650 />
651 <br /> 651 <br />
652 {{list.timeIn}} 652 {{list.timeIn}}
653 <br /> 653 <br />
654 {{list.timeOut}} 654 {{list.timeOut}}
655 </td> 655 </td>
656 <td class="td td-row"> 656 <td class="td td-row">
657 <v-tooltip top> 657 <v-tooltip top>
658 <v-icon 658 <v-icon
659 slot="activator" 659 slot="activator"
660 color="black" 660 color="black"
661 @click="addLecture(props.item._id, timeTableList._id)" 661 @click="addLecture(props.item._id, timeTableList._id)"
662 >add_circle_outline</v-icon> 662 >add_circle_outline</v-icon>
663 <span>Add</span> 663 <span>Add</span>
664 </v-tooltip> 664 </v-tooltip>
665 </td> 665 </td>
666 </tr> 666 </tr>
667 </template> 667 </template>
668 </v-data-table> 668 </v-data-table>
669 </template> 669 </template>
670 <v-alert 670 <v-alert
671 slot="no-results" 671 slot="no-results"
672 :value="true" 672 :value="true"
673 color="error" 673 color="error"
674 icon="warning" 674 icon="warning"
675 >Your search for "{{ search }}" found no results.</v-alert> 675 >Your search for "{{ search }}" found no results.</v-alert>
676 </v-data-table> 676 </v-data-table>
677 <br /> 677 <br />
678 <br /> 678 <br />
679 </v-flex> 679 </v-flex>
680 680
681 <!-- ****** ADD TIME-TABLE ****** --> 681 <!-- ****** ADD TIME-TABLE ****** -->
682 <v-dialog v-model="addTimeTableDialog" max-width="600px" v-if="addTimeTableDialog" persistent> 682 <v-dialog v-model="addTimeTableDialog" max-width="600px" v-if="addTimeTableDialog" persistent>
683 <v-card flat class="card-style pa-2" dark> 683 <v-card flat class="card-style pa-2" dark>
684 <v-layout> 684 <v-layout>
685 <v-flex xs12> 685 <v-flex xs12>
686 <label class="title text-xs-center">Add Time Table</label> 686 <label class="title text-xs-center">Add Time Table</label>
687 <v-icon size="24" class="right" @click="closeAddTimeTableModel">cancel</v-icon> 687 <v-icon size="24" class="right" @click="closeAddTimeTableModel">cancel</v-icon>
688 </v-flex> 688 </v-flex>
689 </v-layout> 689 </v-layout>
690 <v-form ref="form" v-model="valid" lazy-validation> 690 <v-form ref="form" v-model="valid" lazy-validation>
691 <v-container fluid class="pt-3"> 691 <v-container fluid class="pt-3">
692 <v-flex xs12> 692 <v-flex xs12>
693 <v-layout> 693 <v-layout>
694 <v-flex xs4 class="pt-4 subheading"> 694 <v-flex xs4 class="pt-4 subheading">
695 <label class="right hidden-xs-only hidden-sm-only">Select Class:</label> 695 <label class="right hidden-xs-only hidden-sm-only">Select Class:</label>
696 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Class:</label> 696 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Class:</label>
697 </v-flex> 697 </v-flex>
698 <v-flex xs8 sm6 class="ml-3"> 698 <v-flex xs8 sm6 class="ml-3">
699 <v-select 699 <v-select
700 :items="addclass" 700 :items="addclass"
701 label="Select Class" 701 label="Select Class"
702 v-model="timeTable.select" 702 v-model="timeTable.select"
703 item-text="classNum" 703 item-text="classNum"
704 item-value="_id" 704 item-value="_id"
705 @change="getSections(timeTable.select)" 705 @change="getSections(timeTable.select)"
706 :rules="classRules" 706 :rules="classRules"
707 required 707 required
708 ></v-select> 708 ></v-select>
709 </v-flex> 709 </v-flex>
710 </v-layout> 710 </v-layout>
711 </v-flex> 711 </v-flex>
712 <v-flex xs12> 712 <v-flex xs12>
713 <v-layout> 713 <v-layout>
714 <v-flex xs4 class="pt-4 subheading"> 714 <v-flex xs4 class="pt-4 subheading">
715 <label class="right hidden-xs-only hidden-sm-only">Select Section:</label> 715 <label class="right hidden-xs-only hidden-sm-only">Select Section:</label>
716 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Section:</label> 716 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Section:</label>
717 </v-flex> 717 </v-flex>
718 <v-flex sm6 xs8 class="ml-3"> 718 <v-flex sm6 xs8 class="ml-3">
719 <v-select 719 <v-select
720 :items="addSection" 720 :items="addSection"
721 label="Select Section" 721 label="Select Section"
722 v-model="timeTable.selectSection" 722 v-model="timeTable.selectSection"
723 item-text="name" 723 item-text="name"
724 item-value="_id" 724 item-value="_id"
725 :rules="sectionRules" 725 :rules="sectionRules"
726 @change="getClassSubject(timeTable.select)" 726 @change="getClassSubject(timeTable.select)"
727 required 727 required
728 ></v-select> 728 ></v-select>
729 </v-flex> 729 </v-flex>
730 </v-layout> 730 </v-layout>
731 <v-layout> 731 <v-layout>
732 <v-flex xs4 class="pt-4 subheading"> 732 <v-flex xs4 class="pt-4 subheading">
733 <label class="right hidden-xs-only hidden-sm-only">Subject Name:</label> 733 <label class="right hidden-xs-only hidden-sm-only">Subject Name:</label>
734 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Subject:</label> 734 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Subject:</label>
735 </v-flex> 735 </v-flex>
736 <v-flex xs8 sm6 class="ml-3"> 736 <v-flex xs8 sm6 class="ml-3">
737 <v-select 737 <v-select
738 :items="subjectList.subjects" 738 :items="subjectList.subjects"
739 label="Select Subject" 739 label="Select Subject"
740 v-model="timeTable.subjectName" 740 v-model="timeTable.subjectName"
741 item-text="subjectName" 741 item-text="subjectName"
742 item-value="subjectName" 742 item-value="subjectName"
743 :rules="subjectNameRules" 743 :rules="subjectNameRules"
744 required 744 required
745 ></v-select> 745 ></v-select>
746 </v-flex> 746 </v-flex>
747 </v-layout> 747 </v-layout>
748 </v-flex> 748 </v-flex>
749 <v-flex xs12> 749 <v-flex xs12>
750 <v-layout> 750 <v-layout>
751 <v-flex xs4 class="pt-4 subheading"> 751 <v-flex xs4 class="pt-4 subheading">
752 <label class="right hidden-xs-only hidden-sm-only">Select Teacher:</label> 752 <label class="right hidden-xs-only hidden-sm-only">Select Teacher:</label>
753 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Teacher:</label> 753 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Teacher:</label>
754 </v-flex> 754 </v-flex>
755 <v-flex xs8 sm6 class="ml-3"> 755 <v-flex xs8 sm6 class="ml-3">
756 <v-select 756 <v-select
757 :items="addTeachers" 757 :items="addTeachers"
758 label="Select Teacher" 758 label="Select Teacher"
759 v-model="timeTable.selectTeacher" 759 v-model="timeTable.selectTeacher"
760 item-text="name" 760 item-text="name"
761 item-value="_id" 761 item-value="_id"
762 :rules="teacherRules" 762 :rules="teacherRules"
763 required 763 required
764 ></v-select> 764 ></v-select>
765 </v-flex> 765 </v-flex>
766 </v-layout> 766 </v-layout>
767 </v-flex> 767 </v-flex>
768 <v-flex xs12> 768 <v-flex xs12>
769 <v-layout> 769 <v-layout>
770 <v-flex xs4 class="pt-4 subheading"> 770 <v-flex xs4 class="pt-4 subheading">
771 <label class="right">Select Day:</label> 771 <label class="right">Select Day:</label>
772 </v-flex> 772 </v-flex>
773 <v-flex xs8 sm6 class="ml-3"> 773 <v-flex xs8 sm6 class="ml-3">
774 <v-select 774 <v-select
775 :items="addOneDay" 775 :items="addOneDay"
776 label="Select Day" 776 label="Select Day"
777 v-model="timeTable.selectDay" 777 v-model="timeTable.selectDay"
778 :rules="dayRules" 778 :rules="dayRules"
779 item-text="name" 779 item-text="name"
780 item-value="_id" 780 item-value="_id"
781 required 781 required
782 ></v-select> 782 ></v-select>
783 </v-flex> 783 </v-flex>
784 </v-layout> 784 </v-layout>
785 </v-flex> 785 </v-flex>
786 <!-- <v-flex xs12> 786 <!-- <v-flex xs12>
787 <v-layout> 787 <v-layout>
788 <v-flex xs4 class="pt-4 subheading"> 788 <v-flex xs4 class="pt-4 subheading">
789 <label class="right hidden-xs-only hidden-sm-only">Subject Name:</label> 789 <label class="right hidden-xs-only hidden-sm-only">Subject Name:</label>
790 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Subject:</label> 790 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Subject:</label>
791 </v-flex> 791 </v-flex>
792 <v-flex xs8 sm6 class="ml-3"> 792 <v-flex xs8 sm6 class="ml-3">
793 <v-text-field 793 <v-text-field
794 placeholder="fill your Subject Name" 794 placeholder="fill your Subject Name"
795 :rules="subjectNameRules" 795 :rules="subjectNameRules"
796 v-model="timeTable.subjectName" 796 v-model="timeTable.subjectName"
797 type="text" 797 type="text"
798 required 798 required
799 ></v-text-field> 799 ></v-text-field>
800 </v-flex> 800 </v-flex>
801 </v-layout> 801 </v-layout>
802 </v-flex>--> 802 </v-flex>-->
803 <v-flex xs12> 803 <v-flex xs12>
804 <v-layout> 804 <v-layout>
805 <v-flex xs4 class="pt-4 subheading"> 805 <v-flex xs4 class="pt-4 subheading">
806 <label class="right">Time In:</label> 806 <label class="right">Time In:</label>
807 </v-flex> 807 </v-flex>
808 <v-flex xs8 sm6 class="ml-3"> 808 <v-flex xs8 sm6 class="ml-3">
809 <v-menu 809 <v-menu
810 ref="menuA" 810 ref="menuA"
811 :close-on-content-click="false" 811 :close-on-content-click="false"
812 v-model="menu2" 812 v-model="menu2"
813 :nudge-right="40" 813 :nudge-right="40"
814 :return-value.sync="timeTable.timeIn" 814 :return-value.sync="timeTable.timeIn"
815 lazy 815 lazy
816 transition="scale-transition" 816 transition="scale-transition"
817 offset-y 817 offset-y
818 full-width 818 full-width
819 max-width="290px" 819 max-width="290px"
820 min-width="290px" 820 min-width="290px"
821 > 821 >
822 <v-text-field 822 <v-text-field
823 slot="activator" 823 slot="activator"
824 v-model="timeTable.timeIn" 824 v-model="timeTable.timeIn"
825 label="Select your timeIn" 825 label="Select your timeIn"
826 append-icon="access_time" 826 append-icon="access_time"
827 :rules="timeInRules" 827 :rules="timeInRules"
828 readonly 828 readonly
829 ></v-text-field> 829 ></v-text-field>
830 <v-time-picker 830 <v-time-picker
831 v-model="timeTable.timeIn" 831 v-model="timeTable.timeIn"
832 @change="$refs.menuA.save(timeTable.timeIn)" 832 @change="$refs.menuA.save(timeTable.timeIn)"
833 ></v-time-picker> 833 ></v-time-picker>
834 </v-menu> 834 </v-menu>
835 </v-flex> 835 </v-flex>
836 </v-layout> 836 </v-layout>
837 </v-flex> 837 </v-flex>
838 <v-flex xs12> 838 <v-flex xs12>
839 <v-layout> 839 <v-layout>
840 <v-flex xs4 class="pt-4 subheading"> 840 <v-flex xs4 class="pt-4 subheading">
841 <label class="right">Time Out:</label> 841 <label class="right">Time Out:</label>
842 </v-flex> 842 </v-flex>
843 <v-flex xs8 sm6 class="ml-3"> 843 <v-flex xs8 sm6 class="ml-3">
844 <v-menu 844 <v-menu
845 ref="menu" 845 ref="menu"
846 :close-on-content-click="false" 846 :close-on-content-click="false"
847 v-model="menu1" 847 v-model="menu1"
848 :nudge-right="40" 848 :nudge-right="40"
849 :return-value.sync="timeTable.timeOut" 849 :return-value.sync="timeTable.timeOut"
850 lazy 850 lazy
851 transition="scale-transition" 851 transition="scale-transition"
852 offset-y 852 offset-y
853 full-width 853 full-width
854 max-width="290px" 854 max-width="290px"
855 min-width="290px" 855 min-width="290px"
856 > 856 >
857 <v-text-field 857 <v-text-field
858 slot="activator" 858 slot="activator"
859 v-model="timeTable.timeOut" 859 v-model="timeTable.timeOut"
860 label="Select your Time Out" 860 label="Select your Time Out"
861 append-icon="access_time" 861 append-icon="access_time"
862 :rules="timeOutRules" 862 :rules="timeOutRules"
863 readonly 863 readonly
864 ></v-text-field> 864 ></v-text-field>
865 <v-time-picker 865 <v-time-picker
866 v-model="timeTable.timeOut" 866 v-model="timeTable.timeOut"
867 @change="$refs.menu.save(timeTable.timeOut)" 867 @change="$refs.menu.save(timeTable.timeOut)"
868 ></v-time-picker> 868 ></v-time-picker>
869 </v-menu> 869 </v-menu>
870 </v-flex> 870 </v-flex>
871 </v-layout> 871 </v-layout>
872 </v-flex> 872 </v-flex>
873 <v-layout> 873 <v-layout>
874 <v-flex xs12 sm11> 874 <v-flex xs12 sm11>
875 <v-layout> 875 <v-layout>
876 <v-spacer></v-spacer> 876 <v-spacer></v-spacer>
877 <v-btn @click="clear" round class="clear-button" dark>clear</v-btn> 877 <v-btn @click="clear" round class="clear-button" dark>clear</v-btn>
878 <v-btn @click="submit" round dark :loading="loading" class="add-button">Add</v-btn> 878 <v-btn @click="submit" round dark :loading="loading" class="add-button">Add</v-btn>
879 </v-layout> 879 </v-layout>
880 </v-flex> 880 </v-flex>
881 </v-layout> 881 </v-layout>
882 </v-container> 882 </v-container>
883 </v-form> 883 </v-form>
884 </v-card> 884 </v-card>
885 </v-dialog> 885 </v-dialog>
886 <div class="loader" v-if="showLoader"> 886 <div class="loader" v-if="showLoader">
887 <v-progress-circular indeterminate color="white"></v-progress-circular> 887 <v-progress-circular indeterminate color="white"></v-progress-circular>
888 </div> 888 </div>
889 <v-snackbar 889 <v-snackbar
890 :timeout="timeout" 890 :timeout="timeout"
891 :top="y === 'top'" 891 :top="y === 'top'"
892 :right="x === 'right'" 892 :right="x === 'right'"
893 :vertical="mode === 'vertical'" 893 :vertical="mode === 'vertical'"
894 v-model="snackbar" 894 v-model="snackbar"
895 :color="color" 895 :color="color"
896 >{{ text }}</v-snackbar> 896 >{{ text }}</v-snackbar>
897 </v-container> 897 </v-container>
898 </template> 898 </template>
899 <script> 899 <script>
900 import http from "@/Services/http.js"; 900 import http from "@/Services/http.js";
901 import Util from "@/util"; 901 import Util from "@/util";
902 902
903 export default { 903 export default {
904 data: () => ({ 904 data: () => ({
905 y: "top", 905 y: "top",
906 x: "right", 906 x: "right",
907 mode: "", 907 mode: "",
908 timeout: 3000, 908 timeout: 3000,
909 text: "", 909 text: "",
910 search: "", 910 search: "",
911 color: "", 911 color: "",
912 snackbar: false, 912 snackbar: false,
913 loading: false, 913 loading: false,
914 showLoader: false, 914 showLoader: false,
915 dialog: false, 915 dialog: false,
916 show: true, 916 show: true,
917 showSearch: false, 917 showSearch: false,
918 dialogAddLecture: false, 918 dialogAddLecture: false,
919 dialogUpdateLectures: false, 919 dialogUpdateLectures: false,
920 dialogSchedule: false, 920 dialogSchedule: false,
921 dialog1: false, 921 dialog1: false,
922 valid: true, 922 valid: true,
923 addTimeTableDialog: false, 923 addTimeTableDialog: false,
924 validAddDay: true, 924 validAddDay: true,
925 loadingFindData: false, 925 loadingFindData: false,
926 addclass: [], 926 addclass: [],
927 addSection: [], 927 addSection: [],
928 subjectList: [], 928 subjectList: [],
929 addTeachers: [], 929 addTeachers: [],
930 gender: ["Male", "Female"], 930 gender: ["Male", "Female"],
931 pagination: { 931 pagination: {
932 rowsPerPage: 15, 932 rowsPerPage: 15,
933 }, 933 },
934 imageData: {}, 934 imageData: {},
935 imageName: "", 935 imageName: "",
936 imageUrl: "", 936 imageUrl: "",
937 imageFile: "", 937 imageFile: "",
938 timeInRules: [(v) => !!v || "Time In is required"], 938 timeInRules: [(v) => !!v || "Time In is required"],
939 timeOutRules: [(v) => !!v || "Time Out is required"], 939 timeOutRules: [(v) => !!v || "Time Out is required"],
940 lectureRules: [(v) => !!v || "Lecture No is required"], 940 lectureRules: [(v) => !!v || "Lecture No is required"],
941 subjectNameRules: [(v) => !!v || "Subject Name is required"], 941 subjectNameRules: [(v) => !!v || "Subject Name is required"],
942 classRules: [(v) => !!v || "Class Name is required"], 942 classRules: [(v) => !!v || "Class Name is required"],
943 sectionRules: [(v) => !!v || "Section Name is required"], 943 sectionRules: [(v) => !!v || "Section Name is required"],
944 sectionRules: [(v) => !!v || "Section Name is required"], 944 sectionRules: [(v) => !!v || "Section Name is required"],
945 teacherRules: [(v) => !!v || "Teacher Name is required"], 945 teacherRules: [(v) => !!v || "Teacher Name is required"],
946 selecDayRule: [(v) => !!v || "Day is required"], 946 selecDayRule: [(v) => !!v || "Day is required"],
947 dayRules: [(v) => !!v || "Day is required"], 947 dayRules: [(v) => !!v || "Day is required"],
948 getParticulerLecture: "", 948 getParticulerLecture: "",
949 headers: [ 949 headers: [
950 { 950 {
951 text: "No", 951 text: "No",
952 align: "", 952 align: "",
953 sortable: false, 953 sortable: false,
954 value: "No", 954 value: "No",
955 }, 955 },
956 { 956 {
957 text: "Class Name", 957 text: "Class Name",
958 value: "classData.classNum", 958 value: "classData.classNum",
959 sortable: false, 959 sortable: false,
960 align: "center", 960 align: "center",
961 }, 961 },
962 { 962 {
963 text: "Section Name", 963 text: "Section Name",
964 value: "sectionData.name", 964 value: "sectionData.name",
965 sortable: false, 965 sortable: false,
966 align: "center", 966 align: "center",
967 }, 967 },
968 { text: "Action", value: "", sortable: false, align: "center" }, 968 { text: "Action", value: "", sortable: false, align: "center" },
969 ], 969 ],
970 daysHeaders: [ 970 daysHeaders: [
971 { text: "Day", value: "dayday", sortable: false, align: "center" }, 971 { text: "Day", value: "dayday", sortable: false, align: "center" },
972 { 972 {
973 text: "Subject Name", 973 text: "Subject Name",
974 value: "subjectName", 974 value: "subjectName",
975 sortable: false, 975 sortable: false,
976 align: "center", 976 align: "center",
977 }, 977 },
978 { text: "Time In", value: "timeIn", sortable: false, align: "center" }, 978 { text: "Time In", value: "timeIn", sortable: false, align: "center" },
979 { text: "Time Out", value: "timeOut", sortable: false, align: "center" }, 979 { text: "Time Out", value: "timeOut", sortable: false, align: "center" },
980 ], 980 ],
981 addOneDay: [ 981 addOneDay: [
982 "Monday", 982 "Monday",
983 "Tuesday", 983 "Tuesday",
984 "Wednesday", 984 "Wednesday",
985 "Thursday", 985 "Thursday",
986 "Friday", 986 "Friday",
987 "Saturday", 987 "Saturday",
988 "Sunday", 988 "Sunday",
989 ], 989 ],
990 schedule: { 990 schedule: {
991 selectDay: "", 991 selectDay: "",
992 }, 992 },
993 desserts: [], 993 desserts: [],
994 timeTableList: [], 994 timeTableList: [],
995 editedIndex: -1, 995 editedIndex: -1,
996 selectTimeTable: { 996 selectTimeTable: {
997 select: "", 997 select: "",
998 selectSection: "", 998 selectSection: "",
999 }, 999 },
1000 timeTable: { 1000 timeTable: {
1001 select: "", 1001 select: "",
1002 selectSection: "", 1002 selectSection: "",
1003 selectDay: "", 1003 selectDay: "",
1004 timeIn: null, 1004 timeIn: null,
1005 timeOut: null, 1005 timeOut: null,
1006 subjectName: "", 1006 subjectName: "",
1007 selectTeacher: "", 1007 selectTeacher: "",
1008 }, 1008 },
1009 editedItem: { 1009 editedItem: {
1010 classNum: "", 1010 classNum: "",
1011 selectSection: "", 1011 selectSection: "",
1012 }, 1012 },
1013 addlectures: { 1013 addlectures: {
1014 timeIn: null, 1014 timeIn: null,
1015 timeOut: null, 1015 timeOut: null,
1016 subjectName: "", 1016 subjectName: "",
1017 teacherId: "", 1017 teacherId: "",
1018 scheduleId: "", 1018 scheduleId: "",
1019 timeTableId: "", 1019 timeTableId: "",
1020 select: "", 1020 select: "",
1021 }, 1021 },
1022 updateLectures: { 1022 updateLectures: {
1023 timeIn: null, 1023 timeIn: null,
1024 timeOut: null, 1024 timeOut: null,
1025 subjectName: "", 1025 subjectName: "",
1026 teacherId: "", 1026 teacherId: "",
1027 select: "", 1027 select: "",
1028 }, 1028 },
1029 updateLecturesId: { 1029 updateLecturesId: {
1030 lectureId: "", 1030 lectureId: "",
1031 scheduleId: "", 1031 scheduleId: "",
1032 }, 1032 },
1033 menu1: false, 1033 menu1: false,
1034 menu2: false, 1034 menu2: false,
1035 menu3: false, 1035 menu3: false,
1036 menu4: false, 1036 menu4: false,
1037 menu5: false, 1037 menu5: false,
1038 menu6: false, 1038 menu6: false,
1039 scheduleDayId: "", 1039 scheduleDayId: "",
1040 showData: false, 1040 showData: false,
1041 }), 1041 }),
1042 watch: { 1042 watch: {
1043 addTimeTableDialog: function (val) { 1043 addTimeTableDialog: function (val) {
1044 if (!val) { 1044 if (!val) {
1045 this.timeTable = []; 1045 this.timeTable = [];
1046 } 1046 }
1047 }, 1047 },
1048 }, 1048 },
1049 methods: { 1049 methods: {
1050 findTimeTable() { 1050 findTimeTable() {
1051 this.loadingFindData = true; 1051 this.loadingFindData = true;
1052 http() 1052 http()
1053 .get("/getParticularClassTimeTable", { 1053 .get("/getParticularClassTimeTable", {
1054 params: { 1054 params: {
1055 sectionId: this.selectTimeTable.selectSection, 1055 sectionId: this.selectTimeTable.selectSection,
1056 classId: this.selectTimeTable.select, 1056 classId: this.selectTimeTable.select,
1057 }, 1057 },
1058 }) 1058 })
1059 .then((response) => { 1059 .then((response) => {
1060 this.desserts = response.data.data; 1060 this.desserts = response.data.data;
1061 if (this.desserts.length === 0) { 1061 if (this.desserts.length === 0) {
1062 this.showLoader = false; 1062 this.showLoader = false;
1063 this.snackbar = true; 1063 this.snackbar = true;
1064 this.text = "Data not found!"; 1064 this.text = "Data not found!";
1065 this.color = "error"; 1065 this.color = "error";
1066 return; 1066 return;
1067 } 1067 }
1068 this.showData = true; 1068 this.showData = true;
1069 this.loadingFindData = false; 1069 this.loadingFindData = false;
1070 }) 1070 })
1071 .catch((error) => { 1071 .catch((error) => {
1072 this.loadingFindData = false; 1072 this.loadingFindData = false;
1073 this.snackbar = true; 1073 this.snackbar = true;
1074 this.text = error.response.data.message; 1074 this.text = error.response.data.message;
1075 this.text = error.response.data.statusText; 1075 this.text = error.response.data.statusText;
1076 }); 1076 });
1077 }, 1077 },
1078 getSections(_id) { 1078 getSections(_id) {
1079 var token = this.$store.state.token; 1079 var token = this.$store.state.token;
1080 this.desserts = [];
1080 http() 1081 http()
1081 .get( 1082 .get(
1082 "/getSectionsList", 1083 "/getSectionsList",
1083 { params: { classId: _id } }, 1084 { params: { classId: _id } },
1084 { 1085 {
1085 headers: { Authorization: "Bearer " + token }, 1086 headers: { Authorization: "Bearer " + token },
1086 } 1087 }
1087 ) 1088 )
1088 .then((response) => { 1089 .then((response) => {
1089 this.addSection = response.data.data; 1090 this.addSection = response.data.data;
1090 }) 1091 })
1091 .catch((err) => { 1092 .catch((err) => {
1092 // console.log("err====>", err); 1093 // console.log("err====>", err);
1093 }); 1094 });
1094 }, 1095 },
1095 getClassSubject(_id) { 1096 getClassSubject(_id) {
1096 this.showLoader = true; 1097 this.showLoader = true;
1097 // this.classId = this.classId; 1098 // this.classId = this.classId;
1098 http() 1099 http()
1099 .get( 1100 .get(
1100 "/getParticularClass", 1101 "/getParticularClass",
1101 { params: { classId: _id } }, 1102 { params: { classId: _id } },
1102 { 1103 {
1103 headers: { Authorization: "Bearer " + this.token }, 1104 headers: { Authorization: "Bearer " + this.token },
1104 } 1105 }
1105 ) 1106 )
1106 .then((response) => { 1107 .then((response) => {
1107 this.subjectList = response.data.data; 1108 this.subjectList = response.data.data;
1108 this.showLoader = false; 1109 this.showLoader = false;
1109 }) 1110 })
1110 .catch((err) => { 1111 .catch((err) => {
1111 this.showLoader = false; 1112 this.showLoader = false;
1112 }); 1113 });
1113 }, 1114 },
1114 getTimeTable(item) { 1115 getTimeTable(item) {
1115 this.showLoader = true; 1116 this.showLoader = true;
1116 this.getParticulerLecture = item._id; 1117 this.getParticulerLecture = item._id;
1117 this.getTimeTableDayData(); 1118 this.getTimeTableDayData();
1118 }, 1119 },
1119 getTimeTableDayData() { 1120 getTimeTableDayData() {
1120 var token = this.$store.state.token; 1121 var token = this.$store.state.token;
1121 http() 1122 http()
1122 .get( 1123 .get(
1123 "/getParticularTimeTable", 1124 "/getParticularTimeTable",
1124 { params: { timeTableId: this.getParticulerLecture } }, 1125 { params: { timeTableId: this.getParticulerLecture } },
1125 { 1126 {
1126 headers: { Authorization: "Bearer " + token }, 1127 headers: { Authorization: "Bearer " + token },
1127 } 1128 }
1128 ) 1129 )
1129 .then((response) => { 1130 .then((response) => {
1130 this.timeTableList = response.data.data; 1131 this.timeTableList = response.data.data;
1131 this.showLoader = false; 1132 this.showLoader = false;
1132 }) 1133 })
1133 .catch((err) => { 1134 .catch((err) => {
1134 this.showLoader = false; 1135 this.showLoader = false;
1135 // console.log("err====>", err); 1136 // console.log("err====>", err);
1136 }); 1137 });
1137 }, 1138 },
1138 pickFile() { 1139 pickFile() {
1139 this.$refs.image.click(); 1140 this.$refs.image.click();
1140 }, 1141 },
1141 1142
1142 onFilePicked(e) { 1143 onFilePicked(e) {
1143 const files = e.target.files; 1144 const files = e.target.files;
1144 this.imageData.upload = e.target.files[0]; 1145 this.imageData.upload = e.target.files[0];
1145 if (files[0] !== undefined) { 1146 if (files[0] !== undefined) {
1146 this.imageName = files[0].name; 1147 this.imageName = files[0].name;
1147 if (this.imageName.lastIndexOf(".") <= 0) { 1148 if (this.imageName.lastIndexOf(".") <= 0) {
1148 return; 1149 return;
1149 } 1150 }
1150 const fr = new FileReader(); 1151 const fr = new FileReader();
1151 fr.readAsDataURL(files[0]); 1152 fr.readAsDataURL(files[0]);
1152 fr.addEventListener("load", () => { 1153 fr.addEventListener("load", () => {
1153 this.imageUrl = fr.result; 1154 this.imageUrl = fr.result;
1154 this.imageFile = files[0]; // this is an image file that can be sent to server... 1155 this.imageFile = files[0]; // this is an image file that can be sent to server...
1155 this.imageData.imageUrl = URL.createObjectURL(this.imageFile); 1156 this.imageData.imageUrl = URL.createObjectURL(this.imageFile);
1156 }); 1157 });
1157 } else { 1158 } else {
1158 this.imageName = ""; 1159 this.imageName = "";
1159 this.imageFile = ""; 1160 this.imageFile = "";
1160 this.imageUrl = ""; 1161 this.imageUrl = "";
1161 } 1162 }
1162 }, 1163 },
1163 // getTimeTableList() { 1164 // getTimeTableList() {
1164 // this.showLoader = true; 1165 // this.showLoader = true;
1165 // var token = this.$store.state.token; 1166 // var token = this.$store.state.token;
1166 // http() 1167 // http()
1167 // .get("/getTimeTablesList", { 1168 // .get("/getTimeTablesList", {
1168 // headers: { Authorization: "Bearer " + token } 1169 // headers: { Authorization: "Bearer " + token }
1169 // }) 1170 // })
1170 // .then(response => { 1171 // .then(response => {
1171 // this.desserts = response.data.data; 1172 // this.desserts = response.data.data;
1172 // this.showLoader = false; 1173 // this.showLoader = false;
1173 // // console.log("getTimeTableList=====>", response.data.data); 1174 // // console.log("getTimeTableList=====>", response.data.data);
1174 // }) 1175 // })
1175 // .catch(err => { 1176 // .catch(err => {
1176 // // console.log("err====>", err); 1177 // // console.log("err====>", err);
1177 // this.showLoader = false; 1178 // this.showLoader = false;
1178 // this.$router.replace({ path: "/" }); 1179 // this.$router.replace({ path: "/" });
1179 // }); 1180 // });
1180 // }, 1181 // },
1181 editItem(item) { 1182 editItem(item) {
1182 this.editedIndex = this.desserts.indexOf(item); 1183 this.editedIndex = this.desserts.indexOf(item);
1183 this.editedItem = Object.assign({}, item); 1184 this.editedItem = Object.assign({}, item);
1184 this.dialog = true; 1185 this.dialog = true;
1185 }, 1186 },
1186 updateTimeTable(timeToUpdate, classToUpdate, scheduleId) { 1187 updateTimeTable(timeToUpdate, classToUpdate, scheduleId) {
1187 this.updateLecturesId.scheduleId = scheduleId; 1188 this.updateLecturesId.scheduleId = scheduleId;
1188 this.updateLecturesId.lectureId = timeToUpdate._id; 1189 this.updateLecturesId.lectureId = timeToUpdate._id;
1189 this.updateLectures = timeToUpdate; 1190 this.updateLectures = timeToUpdate;
1190 this.dialogUpdateLectures = true; 1191 this.dialogUpdateLectures = true;
1191 }, 1192 },
1192 addLecture(scheduleId, timeTableId) { 1193 addLecture(scheduleId, timeTableId) {
1193 this.addlectures.scheduleId = scheduleId; 1194 this.addlectures.scheduleId = scheduleId;
1194 this.addlectures.timeTableId = timeTableId; 1195 this.addlectures.timeTableId = timeTableId;
1195 this.dialogAddLecture = true; 1196 this.dialogAddLecture = true;
1196 }, 1197 },
1197 AddLecture() { 1198 AddLecture() {
1198 if (this.$refs.lectureForm.validate()) { 1199 if (this.$refs.lectureForm.validate()) {
1199 http() 1200 http()
1200 .post("/addLecture", this.addlectures) 1201 .post("/addLecture", this.addlectures)
1201 .then((response) => { 1202 .then((response) => {
1202 this.snackbar = true; 1203 this.snackbar = true;
1203 this.text = "New Add Lecture successfully"; 1204 this.text = "New Add Lecture successfully";
1204 var token = this.$store.state.token; 1205 var token = this.$store.state.token;
1205 http() 1206 http()
1206 .get( 1207 .get(
1207 "/getParticularTimeTable", 1208 "/getParticularTimeTable",
1208 { params: { timeTableId: this.getParticulerLecture } }, 1209 { params: { timeTableId: this.getParticulerLecture } },
1209 { 1210 {
1210 headers: { Authorization: "Bearer " + token }, 1211 headers: { Authorization: "Bearer " + token },
1211 } 1212 }
1212 ) 1213 )
1213 .then((response) => { 1214 .then((response) => {
1214 this.timeTableList = response.data.data; 1215 this.timeTableList = response.data.data;
1215 this.snackbar = true; 1216 this.snackbar = true;
1216 this.text = response.data.message; 1217 this.text = response.data.message;
1217 this.color = "green"; 1218 this.color = "green";
1218 this.showLoader = false; 1219 this.showLoader = false;
1219 }) 1220 })
1220 .catch((err) => { 1221 .catch((err) => {
1221 this.showLoader = false; 1222 this.showLoader = false;
1222 // console.log("err====>", err); 1223 // console.log("err====>", err);
1223 this.snackbar = true; 1224 this.snackbar = true;
1224 this.color = "error"; 1225 this.color = "error";
1225 this.text = error.response.data.message; 1226 this.text = error.response.data.message;
1226 }); 1227 });
1227 this.closedialogLecture(); 1228 this.closedialogLecture();
1228 this.clearLeactureData(); 1229 this.clearLeactureData();
1229 }) 1230 })
1230 .catch((error) => { 1231 .catch((error) => {
1231 this.snackbar = true; 1232 this.snackbar = true;
1232 this.text = error.response.data.message; 1233 this.text = error.response.data.message;
1233 this.text = error.response.data.statusText; 1234 this.text = error.response.data.statusText;
1234 }); 1235 });
1235 } 1236 }
1236 }, 1237 },
1237 updateParticularTable() { 1238 updateParticularTable() {
1238 let EditLecture = { 1239 let EditLecture = {
1239 lectureId: this.updateLecturesId.lectureId, 1240 lectureId: this.updateLecturesId.lectureId,
1240 scheduleId: this.updateLecturesId.scheduleId, 1241 scheduleId: this.updateLecturesId.scheduleId,
1241 updatedLecture: { 1242 updatedLecture: {
1242 timeIn: this.updateLectures.timeIn, 1243 timeIn: this.updateLectures.timeIn,
1243 timeOut: this.updateLectures.timeOut, 1244 timeOut: this.updateLectures.timeOut,
1244 subjectName: this.updateLectures.subjectName, 1245 subjectName: this.updateLectures.subjectName,
1245 teacherId: this.updateLectures.teacherId, 1246 teacherId: this.updateLectures.teacherId,
1246 }, 1247 },
1247 }; 1248 };
1248 http() 1249 http()
1249 .put("/updateLecture", EditLecture) 1250 .put("/updateLecture", EditLecture)
1250 .then((response) => { 1251 .then((response) => {
1251 // console.log("updateLecture", EditLecture); 1252 // console.log("updateLecture", EditLecture);
1252 this.snackbar = true; 1253 this.snackbar = true;
1253 this.text = response.data.message; 1254 this.text = response.data.message;
1254 this.color = "green"; 1255 this.color = "green";
1255 this.closeUpdateLectures(); 1256 this.closeUpdateLectures();
1256 }) 1257 })
1257 .catch((error) => { 1258 .catch((error) => {
1258 // console.log(error); 1259 // console.log(error);
1259 1260
1260 this.snackbar = true; 1261 this.snackbar = true;
1261 this.color = "error"; 1262 this.color = "error";
1262 this.text = error.response.data.message; 1263 this.text = error.response.data.message;
1263 if (error.response.data.statusText) { 1264 if (error.response.data.statusText) {
1264 this.text = error.response.data.statusText; 1265 this.text = error.response.data.statusText;
1265 } 1266 }
1266 }); 1267 });
1267 }, 1268 },
1268 deleteItem(item) { 1269 deleteItem(item) {
1269 let deleteTimeTable = { 1270 let deleteTimeTable = {
1270 timeTableId: item._id, 1271 timeTableId: item._id,
1271 }; 1272 };
1272 http() 1273 http()
1273 .delete( 1274 .delete(
1274 "/deleteTimeTable", 1275 "/deleteTimeTable",
1275 confirm("Are you sure you want to delete this?") && { 1276 confirm("Are you sure you want to delete this?") && {
1276 params: deleteTimeTable, 1277 params: deleteTimeTable,
1277 } 1278 }
1278 ) 1279 )
1279 .then((response) => { 1280 .then((response) => {
1280 // console.log("deleteUers",deleteTimeTable) 1281 // console.log("deleteUers",deleteTimeTable)
1281 this.snackbar = true; 1282 this.snackbar = true;
1282 this.text = response.data.message; 1283 this.text = response.data.message;
1283 this.color = "green"; 1284 this.color = "green";
1284 this.findTimeTable(); 1285 this.findTimeTable();
1285 }) 1286 })
1286 .catch((error) => { 1287 .catch((error) => {
1287 // console.log(error); 1288 // console.log(error);
1288 }); 1289 });
1289 }, 1290 },
1290 close() { 1291 close() {
1291 this.dialog = false; 1292 this.dialog = false;
1292 }, 1293 },
1293 close1() { 1294 close1() {
1294 this.dialog1 = false; 1295 this.dialog1 = false;
1295 }, 1296 },
1296 closedialogLecture() { 1297 closedialogLecture() {
1297 this.dialogAddLecture = false; 1298 this.dialogAddLecture = false;
1298 }, 1299 },
1299 closeUpdateLectures() { 1300 closeUpdateLectures() {
1300 this.dialogUpdateLectures = false; 1301 this.dialogUpdateLectures = false;
1301 }, 1302 },
1302 closeAddTimeTableModel() { 1303 closeAddTimeTableModel() {
1303 this.addTimeTableDialog = false; 1304 this.addTimeTableDialog = false;
1304 this.timeTableList = []; 1305 this.timeTableList = [];
1305 this.timeTable = []; 1306 this.timeTable = [];
1306 }, 1307 },
1307 submit() { 1308 submit() {
1308 if (this.$refs.form.validate()) { 1309 if (this.$refs.form.validate()) {
1309 let imageData = new FormData(); 1310 let imageData = new FormData();
1310 imageData.append("upload", this.imageFile); 1311 imageData.append("upload", this.imageFile);
1311 let addTimeTable = { 1312 let addTimeTable = {
1312 sectionId: this.timeTable.selectSection, 1313 sectionId: this.timeTable.selectSection,
1313 classId: this.timeTable.select, 1314 classId: this.timeTable.select,
1314 schedule: [ 1315 schedule: [
1315 { 1316 {
1316 day: this.timeTable.selectDay, 1317 day: this.timeTable.selectDay,
1317 lectures: [ 1318 lectures: [
1318 { 1319 {
1319 timeIn: this.timeTable.timeIn, 1320 timeIn: this.timeTable.timeIn,
1320 timeOut: this.timeTable.timeOut, 1321 timeOut: this.timeTable.timeOut,
1321 subjectName: this.timeTable.subjectName, 1322 subjectName: this.timeTable.subjectName,
1322 teacherId: this.timeTable.selectTeacher, 1323 teacherId: this.timeTable.selectTeacher,
1323 }, 1324 },
1324 ], 1325 ],
1325 }, 1326 },
1326 ], 1327 ],
1327 }; 1328 };
1328 this.loading = true; 1329 this.loading = true;
1329 http() 1330 http()
1330 .post("/createTimeTable", addTimeTable) 1331 .post("/createTimeTable", addTimeTable)
1331 .then((response) => { 1332 .then((response) => {
1332 // console.log("addTimeTable=====>", addTimeTable); 1333 // console.log("addTimeTable=====>", addTimeTable);
1333 if ((this.snackbar = true)) { 1334 if ((this.snackbar = true)) {
1334 this.text = "New Time Table added successfully"; 1335 this.text = "New Time Table added successfully";
1335 } 1336 }
1336 this.color = "green"; 1337 this.color = "green";
1337 // this.clear(); 1338 // this.clear();
1338 http() 1339 http()
1339 .get("/getParticularClassTimeTable", { 1340 .get("/getParticularClassTimeTable", {
1340 params: { 1341 params: {
1341 classId: this.timeTable.select, 1342 classId: this.timeTable.select,
1342 sectionId: this.timeTable.selectSection, 1343 sectionId: this.timeTable.selectSection,
1343 }, 1344 },
1344 }) 1345 })
1345 .then((response) => { 1346 .then((response) => {
1346 this.desserts = response.data.data; 1347 this.desserts = response.data.data;
1347 this.showData = true; 1348 this.showData = true;
1348 this.loadingFindData = false; 1349 this.loadingFindData = false;
1349 }) 1350 })
1350 .catch((error) => { 1351 .catch((error) => {
1351 this.loadingFindData = false; 1352 this.loadingFindData = false;
1352 this.snackbar = true; 1353 this.snackbar = true;
1353 this.text = error.response.data.message; 1354 this.text = error.response.data.message;
1354 this.text = error.response.data.statusText; 1355 this.text = error.response.data.statusText;
1355 }); 1356 });
1356 this.addTimeTableDialog = false; 1357 this.addTimeTableDialog = false;
1357 this.loading = false; 1358 this.loading = false;
1358 }) 1359 })
1359 .catch((error) => { 1360 .catch((error) => {
1360 // console.log(error); 1361 // console.log(error);
1361 if ((this.snackbar = true)) { 1362 if ((this.snackbar = true)) {
1362 this.text = error.response.data.message; 1363 this.text = error.response.data.message;
1363 } 1364 }
1364 this.loading = false; 1365 this.loading = false;
1365 }); 1366 });
1366 } 1367 }
1367 }, 1368 },
1368 clear() { 1369 clear() {
1369 this.$refs.form.reset(); 1370 this.$refs.form.reset();
1370 }, 1371 },
1371 clearLeactureData() { 1372 clearLeactureData() {
1372 this.$refs.lectureForm.reset(); 1373 this.$refs.lectureForm.reset();
1373 }, 1374 },
1374 save() { 1375 save() {
1375 let imageData = new FormData(); 1376 let imageData = new FormData();
1376 imageData.append("upload", this.imageFile); 1377 imageData.append("upload", this.imageFile);
1377 // console.log(imageData); 1378 // console.log(imageData);
1378 let editTimeTable = { 1379 let editTimeTable = {
1379 timeTableId: this.editedItem._id, 1380 timeTableId: this.editedItem._id,
1380 classId: this.editedItem.classNum, 1381 classId: this.editedItem.classNum,
1381 sectionId: this.editedItem.selectSection, 1382 sectionId: this.editedItem.selectSection,
1382 // imageData 1383 // imageData
1383 }; 1384 };
1384 http() 1385 http()
1385 .put("/updateTimeTable", editTimeTable) 1386 .put("/updateTimeTable", editTimeTable)
1386 .then((response) => { 1387 .then((response) => {
1387 // console.log("editTimeTable", editTimeTable); 1388 // console.log("editTimeTable", editTimeTable);
1388 if ((this.snackbar = true)) { 1389 if ((this.snackbar = true)) {
1389 this.text = "Successfully Edit Existing Time Table"; 1390 this.text = "Successfully Edit Existing Time Table";
1390 this.color = "success"; 1391 this.color = "success";
1391 } 1392 }
1392 http() 1393 http()
1393 .get("/getParticularClassTimeTable", { 1394 .get("/getParticularClassTimeTable", {
1394 params: { 1395 params: {
1395 classId: this.editedItem.classNum, 1396 classId: this.editedItem.classNum,
1396 sectionId: this.editedItem.selectSection, 1397 sectionId: this.editedItem.selectSection,
1397 }, 1398 },
1398 }) 1399 })
1399 .then((response) => { 1400 .then((response) => {
1400 this.desserts = response.data.data; 1401 this.desserts = response.data.data;
1401 this.showData = true; 1402 this.showData = true;
1402 this.loadingFindData = false; 1403 this.loadingFindData = false;
1403 }) 1404 })
1404 .catch((error) => { 1405 .catch((error) => {
1405 this.loadingFindData = false; 1406 this.loadingFindData = false;
1406 this.snackbar = true; 1407 this.snackbar = true;
1407 this.text = error.response.data.message; 1408 this.text = error.response.data.message;
1408 this.text = error.response.data.statusText; 1409 this.text = error.response.data.statusText;
1409 }); 1410 });
1410 }) 1411 })
1411 .catch((error) => { 1412 .catch((error) => {
1412 // console.log(error); 1413 // console.log(error);
1413 if ((this.snackbar = true)) { 1414 if ((this.snackbar = true)) {
1414 this.text = error.response.data.message; 1415 this.text = error.response.data.message;
1415 } 1416 }
1416 }); 1417 });
1417 this.close(); 1418 this.close();
1418 }, 1419 },
1419 deleteTimeTable(timeToDelete, deleteLectures) { 1420 deleteTimeTable(timeToDelete, deleteLectures) {
1420 let deleteLecture = { 1421 let deleteLecture = {
1421 lectureId: timeToDelete._id, 1422 lectureId: timeToDelete._id,
1422 }; 1423 };
1423 http() 1424 http()
1424 .delete( 1425 .delete(
1425 "/deleteLecture", 1426 "/deleteLecture",
1426 confirm("Are you sure you want to delete this?") && { 1427 confirm("Are you sure you want to delete this?") && {
1427 params: deleteLecture, 1428 params: deleteLecture,
1428 } 1429 }
1429 ) 1430 )
1430 .then((response) => { 1431 .then((response) => {
1431 if ((this.snackbar = true)) { 1432 if ((this.snackbar = true)) {
1432 this.text = "Successfully delete Existing Time Table"; 1433 this.text = "Successfully delete Existing Time Table";
1433 } 1434 }
1434 const index = this.timeTableList.schedule.indexOf(deleteLectures); 1435 const index = this.timeTableList.schedule.indexOf(deleteLectures);
1435 for (let i = 0; i < this.timeTableList.schedule.length; i++) { 1436 for (let i = 0; i < this.timeTableList.schedule.length; i++) {
1436 this.timeTableList.schedule[i].lectures.splice(index, 1); 1437 this.timeTableList.schedule[i].lectures.splice(index, 1);
1437 } 1438 }
1438 }) 1439 })
1439 .catch((error) => { 1440 .catch((error) => {
1440 // console.log(error); 1441 // console.log(error);
1441 this.snackbar = true; 1442 this.snackbar = true;
1442 this.color = "error"; 1443 this.color = "error";
1443 this.text = error.response.data.message; 1444 this.text = error.response.data.message;
1444 }); 1445 });
1445 }, 1446 },
1446 addSchedule(id) { 1447 addSchedule(id) {
1447 this.scheduleDayId = id; 1448 this.scheduleDayId = id;
1448 this.dialogSchedule = true; 1449 this.dialogSchedule = true;
1449 }, 1450 },
1450 submitSchedule() { 1451 submitSchedule() {
1451 if (this.$refs.formAddDay.validate()) { 1452 if (this.$refs.formAddDay.validate()) {
1452 let scheduleDayData = { 1453 let scheduleDayData = {
1453 timeTableId: this.scheduleDayId, 1454 timeTableId: this.scheduleDayId,
1454 day: this.schedule.selectDay, 1455 day: this.schedule.selectDay,
1455 }; 1456 };
1456 http() 1457 http()
1457 .post("/addSchedule", scheduleDayData) 1458 .post("/addSchedule", scheduleDayData)
1458 .then((response) => { 1459 .then((response) => {
1459 this.snackbar = true; 1460 this.snackbar = true;
1460 this.text = "New Schedule Day added successfully"; 1461 this.text = "New Schedule Day added successfully";
1461 this.dialogSchedule = false; 1462 this.dialogSchedule = false;
1462 this.loading = false; 1463 this.loading = false;
1463 this.getTimeTableDayData(); 1464 this.getTimeTableDayData();
1464 }) 1465 })
1465 .catch((error) => { 1466 .catch((error) => {
1466 // console.log(error); 1467 // console.log(error);
1467 this.snackbar = true; 1468 this.snackbar = true;
1468 this.text = error.response.data.message; 1469 this.text = error.response.data.message;
1469 this.loading = false; 1470 this.loading = false;
1470 }); 1471 });
1471 } 1472 }
1472 }, 1473 },
1473 displaySearch() { 1474 displaySearch() {
1474 (this.show = false), (this.showSearch = true); 1475 (this.show = false), (this.showSearch = true);
1475 }, 1476 },
1476 closeSearch() { 1477 closeSearch() {
1477 this.showSearch = false; 1478 this.showSearch = false;
1478 this.show = true; 1479 this.show = true;
1479 this.search = ""; 1480 this.search = "";
1480 }, 1481 },
1481 }, 1482 },
1482 mounted() { 1483 mounted() {
1483 // this.getTimeTableList(); 1484 // this.getTimeTableList();
1484 var token = this.$store.state.token; 1485 var token = this.$store.state.token;
1485 http() 1486 http()
1486 .get("/getClassesList", { 1487 .get("/getClassesList", {
1487 headers: { Authorization: "Bearer " + token }, 1488 headers: { Authorization: "Bearer " + token },
1488 }) 1489 })
1489 .then((response) => { 1490 .then((response) => {
1490 this.addclass = response.data.data; 1491 this.addclass = response.data.data;
1491 // console.log("getClassesList=====>",this.addclass) 1492 // console.log("getClassesList=====>",this.addclass)
1492 }) 1493 })
1493 .catch((error) => { 1494 .catch((error) => {
1494 this.showLoader = false; 1495 this.showLoader = false;
1495 if (error.response.status === 401) { 1496 if (error.response.status === 401) {
1496 this.$router.replace({ path: "/" }); 1497 this.$router.replace({ path: "/" });
1497 this.$store.dispatch("setToken", null); 1498 this.$store.dispatch("setToken", null);
1498 this.$store.dispatch("Id", null); 1499 this.$store.dispatch("Id", null);
1499 this.$store.dispatch("Role", null); 1500 this.$store.dispatch("Role", null);
1500 } 1501 }
1501 }); 1502 });
1502 1503
1503 http() 1504 http()
1504 .get("/getTeachersList", { 1505 .get("/getTeachersList", {
1505 headers: { Authorization: "Bearer " + token }, 1506 headers: { Authorization: "Bearer " + token },
1506 }) 1507 })
1507 .then((response) => { 1508 .then((response) => {
1508 this.addTeachers = response.data.data; 1509 this.addTeachers = response.data.data;
1509 // console.log("getClassesList=====>",this.addTeachers) 1510 // console.log("getClassesList=====>",this.addTeachers)
1510 }) 1511 })
1511 .catch((error) => { 1512 .catch((error) => {
1512 this.showLoader = false; 1513 this.showLoader = false;
1513 if (error.response.status === 401) { 1514 if (error.response.status === 401) {
1514 this.$router.replace({ path: "/" }); 1515 this.$router.replace({ path: "/" });
1515 this.$store.dispatch("setToken", null); 1516 this.$store.dispatch("setToken", null);
1516 this.$store.dispatch("Id", null); 1517 this.$store.dispatch("Id", null);
1517 this.$store.dispatch("Role", null); 1518 this.$store.dispatch("Role", null);
1518 } 1519 }
1519 }); 1520 });
1520 }, 1521 },
1521 }; 1522 };
1522 </script> 1523 </script>