Blame view
src/pages/Report/progressCardReport.vue
22.9 KB
006544386
|
1 |
<template> |
68d742034
|
2 |
<v-container fluid class="body-color"> |
495e4037c
|
3 |
<!-- ****** Progress Card Report Table****** --> |
68d742034
|
4 |
<v-card flat class="elevation-0 transparent"> |
495e4037c
|
5 6 7 8 9 10 11 12 |
<v-form ref="form" v-model="valid" lazy-validation> <v-flex xs12 sm12 lg12> <v-layout wrap> <v-flex xs12 sm12 lg3> <v-layout> <v-flex xs3 sm6 lg2 class="subheading mt-4"> <label class="right">Class:</label> </v-flex> |
79583580d
|
13 |
<v-flex xs9 sm6 lg8 class="ml-2"> |
495e4037c
|
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
<v-select v-model="getReport.classId" label="Select your class" type="text" :items="classList" item-text="classNum" item-value="_id" :rules="classRules" @change="getSections(getReport.classId)" required ></v-select> </v-flex> </v-layout> </v-flex> <v-flex xs12 sm12 lg3> <v-layout> <v-flex xs3 sm6 lg2 class="subheading mt-4"> <label class="right">Section:</label> </v-flex> |
79583580d
|
33 |
<v-flex xs9 sm6 lg8 class="ml-2"> |
495e4037c
|
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
<v-select :items="addSection" label="Select your Section" v-model="getReport.sectionId" item-text="name" item-value="_id" name="Select Section" @change="getStudents" :rules="sectionRules" required ></v-select> </v-flex> </v-layout> </v-flex> <v-flex xs12 sm12 lg3> <v-layout> <v-flex xs3 sm6 lg2 class="subheading mt-4"> <label class="right">Student:</label> </v-flex> |
ec5677f43
|
53 |
<v-flex xs9 sm6 lg8 class="ml-2"> |
495e4037c
|
54 55 56 57 58 59 60 61 62 63 64 65 |
<v-select :items="getStudentsList" label="Select your student" v-model="getReport.studentId" item-text="name" item-value="_id" :rules="studentRules" required ></v-select> </v-flex> </v-layout> </v-flex> |
3e79b2f9f
|
66 |
<v-flex xs12 sm12 lg3 class="hidden-xs-only hidden-sm-only"> |
79583580d
|
67 68 69 70 71 |
<v-btn @click="getMarkReportList" round dark :loading="loading" |
3e79b2f9f
|
72 |
class="open-dialog-button mt-3" |
79583580d
|
73 |
>Get Report</v-btn> |
495e4037c
|
74 75 76 77 |
</v-flex> </v-layout> </v-flex> </v-form> |
006544386
|
78 |
</v-card> |
1d7227237
|
79 |
|
d4735dce7
|
80 81 82 |
<v-layout v-show="showReport"> <v-flex xs12> <v-card class="transparent elevation-0"> |
1d7227237
|
83 |
<v-container grid-list-md class="report"> |
d4735dce7
|
84 85 86 87 |
<v-flex xs12 sm12 id="printMe"> <v-layout wrap> <!-- ****** TABLE DATA MARK ****** --> <v-flex xs12 sm12 md12> |
3e79b2f9f
|
88 89 |
<v-layout> <v-flex xs12> |
e03bf1f92
|
90 |
<v-btn class="open-dialog-button" round dark @click="printProgressReport()"> |
3e79b2f9f
|
91 92 93 94 95 |
Print <v-icon right dark>print</v-icon> </v-btn> </v-flex> </v-layout> |
bdaae72ca
|
96 |
<v-flex xs12 v-for="(value, id, Index) in filterData" :key="Index" flat> |
1d7227237
|
97 |
<!-- {{value}}---{{id}}---{{index}} --> |
962a41f53
|
98 |
<v-card |
1d7227237
|
99 |
class="ma-3" |
962a41f53
|
100 101 |
style="border: 1px solid lightgrey;margin-bottom:14px;padding:20px" > |
962a41f53
|
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
<v-layout> <v-flex xs12 sm12 md12> <div> <div class="school-logo"> <v-avatar> <img :src="userData.schoolLogoUrl" v-if="userData.schoolLogoUrl" /> <img src="/static/schoolIcons/INTRACK_White.png" v-else-if="!userData.schoolLogoUrl" /> </v-avatar> </div> <div class="school-name"> <h2>{{ userData.name }}</h2> </div> |
46993dc1d
|
117 |
</div> |
962a41f53
|
118 119 |
<hr style="border:1px solid #ddd; |
3e79b2f9f
|
120 121 |
overflow: hidden; vertical-align: middle; |
1d7227237
|
122 |
margin: 10px; 0px;" |
962a41f53
|
123 |
/> |
1d7227237
|
124 |
<!-- Profile School --> |
962a41f53
|
125 126 127 128 |
<div class="school-info"> <v-layout> <v-flex xs5 class="pl-3"> <p style="font-size:20px;">{{ userData.name }}</p> |
3e79b2f9f
|
129 130 |
<p style="font-size: 15px;color: #707478;margin:0px;margin-bottom:8px;" |
962a41f53
|
131 |
>{{ userData.address }}</p> |
3e79b2f9f
|
132 133 |
<p style="font-size: 15px;color: #707478;margin:0px;margin-bottom:8px;" |
962a41f53
|
134 |
>{{ userData.mobile }}</p> |
3e79b2f9f
|
135 136 |
<p style="font-size: 15px;color: #707478;margin:0px;margin-bottom:8px;" |
962a41f53
|
137 138 139 140 |
>{{ userData.email }}</p> </v-flex> <!-- Profile Student Report Card--> <v-flex xs5> |
1d7227237
|
141 142 143 144 145 |
<div v-for="(studentMark,i,index) in value" :key="index"> <p v-if="index == 0" style="font-size:20px;" >{{ studentMark[0].studentId.name }}</p> |
962a41f53
|
146 |
<p |
1d7227237
|
147 |
v-if="index == 0" |
962a41f53
|
148 149 150 |
style="font-size: 15px;color: #707478;margin:0px;margin-bottom:8px;" > Class : |
1d7227237
|
151 |
<b>{{ studentMark[0].classId.classNum }}</b> |
962a41f53
|
152 153 |
</p> <p |
1d7227237
|
154 |
v-if="index == 0" |
962a41f53
|
155 156 157 |
style="font-size: 15px;color: #707478;margin:0px;margin-bottom:8px;" > Section : |
1d7227237
|
158 |
<b>{{ studentMark[0].sectionId.name }}</b> |
962a41f53
|
159 160 |
</p> <p |
1d7227237
|
161 |
v-if="index == 0" |
962a41f53
|
162 163 164 |
style="font-size: 15px;color: #707478;margin:0px;margin-bottom:8px;" > Roll NO : |
1d7227237
|
165 |
<b>{{ studentMark[0].studentId.rollNo }}</b> |
962a41f53
|
166 167 168 169 |
</p> </div> </v-flex> <v-flex xs2> |
1d7227237
|
170 171 172 173 174 175 176 177 178 179 180 181 |
<div v-for="(studentMark,i,index) in value" :key="index"> <v-avatar size="100" style="padding-top:20px" v-if="index == 0"> <img src="/static/icon/user.png" v-if="!studentMark[0].studentId.profilePicUrl" /> <img :src="studentMark[0].studentId.profilePicUrl" v-else-if="studentMark[0].studentId.profilePicUrl" /> </v-avatar> </div> |
962a41f53
|
182 183 184 185 186 |
</v-flex> </v-layout> </div> </v-flex> </v-layout> |
bdaae72ca
|
187 188 189 190 191 |
<v-card v-for="studentMarks in value" :key="studentMarks" class="my-4 elevation-0" > |
1d7227237
|
192 |
<!-- {{studentMark}} --> |
bdaae72ca
|
193 194 195 |
<div style="overflow-x:auto; border: 1px solid lightgrey !important;" |
962a41f53
|
196 |
> |
bdaae72ca
|
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
<table v-for="(studentMark,key) in studentMarks" :key="key" class="tableRsponsive feeTypeTable subheading" style="border: 1px solid black; border-collapse: collapse;!important table-layout: auto !important; width: 100% !important; overflow: hidden;" > <thead style="border: 1px solid transparent !important" v-if="key == 0"> <tr style="border: 1px solid transparent !important"> <td colspan="4" style="text-align: inherit !important; border-right: inherit; border-top: inherit; padding:14px;" >{{studentMark.examId.examName}}</td> </tr> <tr style="border: 1px solid lightgrey !important;padding:4px;"> <td rowspan="2" style="border: 1px solid lightgrey !important;padding: 10px;" >Subject</td> <template> <td v-for="(studentMarkData,i) in studentMark.studentsMarks" :key="i" colspan="2" style="border: 1px solid lightgrey !important;padding: 10px;" >{{studentMarkData.markDistributionId.distributionType}}</td> <td style="border: 1px solid lightgrey !important;padding: 10px;" >Total Marks</td> </template> </tr> <tr style="border: 1px solid lightgrey !important;"> <template v-for="(exam, ind) in studentMark.studentsMarks"> <td :key="ind" style="border: 1px solid lightgrey !important;padding: 10px;" >Marks</td> <td :key="ind" style="border: 1px solid lightgrey !important;padding: 10px;" >Highest Marks</td> </template> </tr> </thead> <tbody style="border: 1px solid lightgrey !important;" v-if="key == 0"> <tr v-for="studentMark in studentMarks" :key="studentMark"> |
962a41f53
|
249 |
<td |
962a41f53
|
250 |
style="border: 1px solid lightgrey !important;padding: 10px;" |
bdaae72ca
|
251 252 253 254 255 256 257 258 259 260 261 |
>{{studentMark.subjectName}}</td> <template v-for="(exam, index) in studentMark.studentsMarks"> <td :key="index" style="border: 1px solid lightgrey !important;padding: 10px;" >{{exam.marksScored}}</td> <td :key="index" style="border: 1px solid lightgrey !important;padding: 10px;" >{{exam.markDistributionId.markValue}}</td> </template> |
962a41f53
|
262 263 |
<td style="border: 1px solid lightgrey !important;padding: 10px;" |
bdaae72ca
|
264 265 266 267 268 269 270 271 272 |
>{{studentMark.totalMarks}}</td> </tr> </tbody> <tfoot v-if="key == studentMarks.length - 1"> <tr style="border: 1px solid lightgrey !important;"> <td colspan="5" style="text-align:center" class="subheding" |
962a41f53
|
273 |
>Total Marks</td> |
962a41f53
|
274 |
<td |
bdaae72ca
|
275 |
colspan="7" |
962a41f53
|
276 |
style="border: 1px solid lightgrey !important;padding: 10px;" |
bdaae72ca
|
277 278 279 280 |
>{{ studentMark.allSubjectTotalMarks }}</td> </tr> <tr> <td colspan="5" style="text-align:center" class="subheding">Grade</td> |
962a41f53
|
281 |
<td |
bdaae72ca
|
282 |
colspan="7" |
962a41f53
|
283 |
style="border: 1px solid lightgrey !important;padding: 10px;" |
bdaae72ca
|
284 285 286 287 288 289 290 291 |
>{{ studentMark.grade }}</td> </tr> <tr> <td colspan="5" style="text-align:center" class="subheding" >Average Mark</td> |
962a41f53
|
292 |
<td |
bdaae72ca
|
293 |
colspan="7" |
962a41f53
|
294 |
style="border: 1px solid lightgrey !important;padding: 10px;" |
bdaae72ca
|
295 296 297 298 |
></td> </tr> <tr> <td colspan="5" style="text-align:center" class="subheding">GPA</td> |
962a41f53
|
299 |
<td |
bdaae72ca
|
300 |
colspan="7" |
962a41f53
|
301 |
style="border: 1px solid lightgrey !important;padding: 10px;" |
bdaae72ca
|
302 303 304 305 306 |
></td> </tr> </tfoot> </table> </div> |
962a41f53
|
307 |
</v-card> |
3e79b2f9f
|
308 |
</v-card> |
962a41f53
|
309 |
</v-flex> |
d4735dce7
|
310 311 312 313 314 |
</v-flex> </v-layout> </v-flex> </v-container> </v-card> |
79583580d
|
315 |
</v-flex> |
d4735dce7
|
316 |
</v-layout> |
006544386
|
317 318 319 |
<div class="loader" v-if="showLoader"> <v-progress-circular indeterminate color="white"></v-progress-circular> </div> |
68d742034
|
320 |
</v-container> |
006544386
|
321 322 323 324 325 |
</template> <script> import http from "@/Services/http.js"; import moment from "moment"; |
79583580d
|
326 |
import _ from "underscore"; |
006544386
|
327 328 329 |
export default { data: () => ({ |
006544386
|
330 |
showLoader: false, |
c62132b75
|
331 |
cardData: [], |
79583580d
|
332 333 334 335 |
token: "", markDistributions: [], markParticularDistributionData: [], loading: false, |
495e4037c
|
336 |
valid: true, |
79583580d
|
337 338 |
loading: false, showReport: false, |
006544386
|
339 |
addSection: [], |
79583580d
|
340 341 |
filterData: [], getStudentsList: [], |
495e4037c
|
342 343 344 |
classRules: [v => !!v || "Class is required"], sectionRules: [v => !!v || "Class is required"], studentRules: [v => !!v || "Student is required"], |
495e4037c
|
345 |
getReport: {}, |
ec5677f43
|
346 |
classList: [], |
c0b01ae20
|
347 |
output: null, |
710438de6
|
348 349 |
userData: {}, newData: [], |
c62132b75
|
350 351 352 353 354 |
gradeAPlus: "A+", gradeA: "A", gradeBPlus: "B+", gradeB: "B", gradeCPlus: "C+", |
3e79b2f9f
|
355 356 |
gradeC: "C", totalMarks: "" |
006544386
|
357 |
}), |
79583580d
|
358 359 360 |
mounted() { this.token = this.$store.state.token; this.getClass(); |
c0b01ae20
|
361 |
this.getUserData(); |
79583580d
|
362 |
}, |
006544386
|
363 |
methods: { |
495e4037c
|
364 365 366 |
clear() { this.$refs.form.reset(); }, |
006544386
|
367 |
getClass() { |
ec5677f43
|
368 |
this.showLoader = true; |
006544386
|
369 370 371 372 373 374 |
http() .get("/getClassesList", { headers: { Authorization: "Bearer " + this.token } }) .then(response => { this.classList = response.data.data; |
ec5677f43
|
375 |
this.showLoader = false; |
006544386
|
376 |
}) |
c0b01ae20
|
377 |
.catch(error => { |
ec5677f43
|
378 |
this.showLoader = false; |
006544386
|
379 380 381 382 |
// console.log("err====>", err); }); }, getSections(_id) { |
c0b01ae20
|
383 |
this.showLoader = true; |
006544386
|
384 385 386 387 388 389 390 391 392 393 |
http() .get( "/getSectionsList", { params: { classId: _id } }, { headers: { Authorization: "Bearer " + this.token } } ) .then(response => { this.addSection = response.data.data; |
c0b01ae20
|
394 |
this.showLoader = false; |
006544386
|
395 396 |
}) .catch(err => { |
c0b01ae20
|
397 |
this.showLoader = false; |
006544386
|
398 399 400 401 402 403 404 405 |
// console.log("err====>", err); }); }, getStudents() { this.showLoader = true; http() .get("/getStudentWithClass", { params: { |
495e4037c
|
406 407 |
classId: this.getReport.classId, sectionId: this.getReport.sectionId |
006544386
|
408 409 410 |
} }) .then(response => { |
e03bf1f92
|
411 412 413 414 |
response.data.data.unshift({ name: "Select All", _id: "Select All" }); |
006544386
|
415 416 |
this.getStudentsList = response.data.data; this.showLoader = false; |
c0b01ae20
|
417 |
// console.log("getSectionsList=====>", response.data.data); |
006544386
|
418 419 420 421 422 423 |
}) .catch(error => { console.log("err====>", error); this.showLoader = false; }); }, |
79583580d
|
424 |
getMarkReportList() { |
1d7227237
|
425 |
this.showLoader = true; |
79583580d
|
426 |
this.showReport = true; |
c765369af
|
427 428 429 430 431 432 |
var getSelectMarks = {}; if (this.getReport.studentId == "Select All") { getSelectMarks = { classId: this.getReport.classId, sectionId: this.getReport.sectionId }; |
962a41f53
|
433 |
} else if (this.getReport.studentId != "Select All") { |
c765369af
|
434 435 436 437 438 439 |
getSelectMarks = { classId: this.getReport.classId, sectionId: this.getReport.sectionId, studentId: this.getReport.studentId }; } |
79583580d
|
440 441 |
http() .get("/getParticularMark", { |
c765369af
|
442 |
params: getSelectMarks, |
79583580d
|
443 444 445 |
headers: { Authorization: "Bearer " + this.token } }) .then(response => { |
c62132b75
|
446 |
this.cardData = response.data.data; |
79583580d
|
447 448 449 |
let newData = response.data.data; for (var i = 0; i < newData.length; i++) { newData[i].examination = newData[i].examId._id; |
1d7227237
|
450 451 452 453 454 455 456 457 |
newData[i].studentsId = newData[i].studentId._id; } var studentMarkArray = []; studentMarkArray = _.groupBy(newData, ["studentsId"]); for (let data in studentMarkArray) { studentMarkArray[data] = _.groupBy(studentMarkArray[data], [ "examination" ]); |
79583580d
|
458 |
} |
1d7227237
|
459 |
this.filterData = studentMarkArray; |
79583580d
|
460 |
for (let data in this.filterData) { |
79583580d
|
461 |
for (let item in this.filterData[data]) { |
bdaae72ca
|
462 |
var allSubjectTotalMarks = 0; |
1d7227237
|
463 |
for (let i = 0; i < this.filterData[data][item].length; i++) { |
bdaae72ca
|
464 |
var totalMarks = 0; |
1d7227237
|
465 466 467 468 469 470 471 472 |
for ( let j = 0; j < studentMarkArray[data][item][i].studentsMarks.length; j++ ) { totalMarks += studentMarkArray[data][item][i].studentsMarks[j] .marksScored; |
1d7227237
|
473 474 |
} this.filterData[data][item][i].totalMarks = totalMarks; |
bdaae72ca
|
475 476 477 478 479 480 |
allSubjectTotalMarks += this.filterData[data][item][i] .totalMarks; this.filterData[data][item][ i ].allSubjectTotalMarks = allSubjectTotalMarks; |
c62132b75
|
481 |
} |
bdaae72ca
|
482 |
|
1d7227237
|
483 |
// this.totalMarks = totalMarks; |
bdaae72ca
|
484 485 486 487 488 489 490 491 492 493 494 495 496 |
if (totalMarks > 90) { this.filterData[data][item].grade = this.gradeAPlus; } else if (totalMarks > 80 && totalMarks < 90) { this.filterData[data][item].grade = this.gradeA; } else if (totalMarks > 70 && totalMarks < 80) { this.filterData[data][item].grade = this.gradeBPlus; } else if (totalMarks > 60 && totalMarks < 70) { this.filterData[data][item].grade = this.gradeB; } else if (totalMarks > 50 && totalMarks < 60) { this.filterData[data][item].grade = this.gradeCPlus; } else if (totalMarks > 40 && totalMarks < 50) { this.filterData[data][item].grade = this.gradeC; } |
79583580d
|
497 498 |
} } |
bdaae72ca
|
499 |
// console.log("this.filterData-----------last", this.filterData); |
1d7227237
|
500 |
|
c62132b75
|
501 |
this.showLoader = false; |
79583580d
|
502 503 504 505 506 |
}) .catch(error => { // console.log("err====>", err); this.showLoader = false; this.snackbar = true; |
710438de6
|
507 508 509 510 511 512 |
// this.text = error.response.data.message; // if (error.response.status === 401) { // this.$router.replace({ path: "/" }); // this.$store.dispatch("setToken", null); // this.$store.dispatch("Id", null); // } |
79583580d
|
513 |
}); |
ec5677f43
|
514 |
}, |
d4735dce7
|
515 |
printProgressReport() { |
ec5677f43
|
516 517 |
// Pass the element id here this.$htmlToPaper("printMe"); |
c0b01ae20
|
518 519 520 521 522 523 524 525 |
}, getUserData() { http() .get("/getParticularUserDetail") .then(response => { this.userData = response.data.data; }) .catch(error => { |
25205ccca
|
526 527 528 529 530 |
// if (error.response.status === 401) { // this.$router.replace({ path: "/" }); // this.$store.dispatch("setToken", null); // this.$store.dispatch("Id", null); // } |
c0b01ae20
|
531 |
}); |
006544386
|
532 |
} |
006544386
|
533 534 535 |
} }; </script> |
79583580d
|
536 |
|
006544386
|
537 |
<style scoped> |
79583580d
|
538 539 540 541 542 543 544 545 546 547 |
table { border-collapse: collapse; border: 1px solid #e2e7eb; } th, td { border: 1px solid #e2e7eb; padding: 10px; text-align: center; |
006544386
|
548 |
} |
79583580d
|
549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 |
table.feeTypeTable { table-layout: auto !important; width: 100% !important; } .bg-sky { background-color: #98b2cc !important; } .bg-sky-light { background-color: #89a0b8; } .bg-purple { background-color: #9583ac; } .bg-skyDark { background-color: #956785; } |
46993dc1d
|
565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 |
/* .report { overflow: hidden; max-width: 794px; margin: 0px auto; margin-bottom: 10px; padding: 30px; } */ .line { border-bottom: 1px solid #ddd; overflow: hidden; padding-bottom: 10px; vertical-align: middle; margin-bottom: 4px; } .school-logo { float: left; } .school-name { box-sizing: border-box; } .school-info { width: 100%; overflow: hidden; } .school-address { float: left; width: 40%; } .student-data { float: right; width: 40%; } .student-info { float: left; } |
79583580d
|
601 602 |
@media screen and (max-width: 380px) { .tableRsponsive { |
d4735dce7
|
603 |
/* display: block; */ |
79583580d
|
604 605 606 |
position: relative; overflow: scroll; } |
006544386
|
607 |
} |
79583580d
|
608 |
</style> s |