Blame view
src/pages/Mark/viewMark.vue
11.7 KB
006544386
|
1 2 |
<template> <v-app id="pages-dasboard"> |
495e4037c
|
3 |
<!-- ****** PROFILE MARK ****** --> |
006544386
|
4 |
<v-container fluid grid-list-md> |
ec5677f43
|
5 |
<v-layout> |
66a5c3b75
|
6 |
<v-flex xs12 sm8 md10> |
68d742034
|
7 |
<v-btn class="open-dialog-button mt-3" round dark @click="print()"> |
ec5677f43
|
8 |
|
68d742034
|
9 |
<v-icon size="18" right dark>print</v-icon> |
ec5677f43
|
10 11 |
</v-btn> </v-flex> |
66a5c3b75
|
12 13 14 15 16 17 18 19 20 |
<v-flex xs12 sm4 md2 class="right"> <v-select class :items="selectMark" label="Select" v-model="selectMarkList" @change="selectMarkData(selectMarkList)" ></v-select> </v-flex> |
ec5677f43
|
21 22 23 |
</v-layout> <v-flex xs12 sm12 id="printMe"> <v-layout wrap> |
67a276510
|
24 25 |
<!-- ****** TABLE DATA MARK ****** --> <v-flex xs12 sm12 md12> |
ec5677f43
|
26 27 28 29 |
<v-card v-for="(value, id, index) in filterData" :key="index" flat |
67a276510
|
30 |
style="border: 1px solid lightgrey;margin-bottom:14px;padding:20px" |
ec5677f43
|
31 |
> |
67a276510
|
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
<v-layout v-if="index === 0"> <v-flex xs12 style="border-bottom: 1px solid #707478;padding-bottom:6px !important"> <img :src="userData.schoolLogoUrl" v-if="userData.schoolLogoUrl" width="100" /> <img src="/static/icon/user.png" v-else-if="!userData.schoolLogoUrl" width="100" /> </v-flex> </v-layout> <v-layout style="padding-top:10px" v-if="index === 0"> <v-flex xs5> <p style="margin:0px;margin-bottom:4px"> <span style="font-size:20px">{{ userData.name }}</span> <br /> <span style="font-size: 15px;color: #707478;">{{ userData.address }}</span> </p> <p style="font-size: 15px;color: #707478;margin:0px;margin-bottom:4px;" >phone : {{ userData.mobile }}</p> <p style="font-size: 15px;color: #707478;margin:0px;margin-bottom:4px;" >Email : {{ userData.email }}</p> </v-flex> <v-flex xs5> <p style="font-size:20px;margin:0px;margin-bottom:4px;" >{{ value[0].studentId.name }}</p> <p style="font-size: 15px;color: #707478;margin:0px;margin-bottom:4px;" >Class : {{ value[0].classId.classNum }}</p> <p style="font-size: 15px;color: #707478;margin:0px;margin-bottom:4px;" >Roll NO : {{ value[0].studentId.rollNo }}</p> <p style="font-size: 15px;color: #707478;margin:0px;margin-bottom:4px;" >Section : {{ value[0].sectionId.name }}</p> </v-flex> <v-flex xs2> <v-avatar size="100"> <img :src="value[0].studentId.profilePicUrl" v-if="value[0].studentId.profilePicUrl" width="100px" /> <img src="/static/icon/user.png" v-else-if="!value[0].studentId.profilePicUrl" width="100px" /> </v-avatar> </v-flex> </v-layout> |
ec5677f43
|
81 82 83 84 85 86 |
<v-card-title class="subheading">{{value[0].examId.examName}}</v-card-title> <table class="mb-5 tableRsponsive feeTypeTable" style="border: 1px solid lightgrey; border-collapse: collapse;!important table-layout: auto !important; |
67a276510
|
87 88 89 90 |
width: 100% !important; overflow: hidden; display: block;" |
ec5677f43
|
91 92 |
> <thead style="border: 1px solid lightgrey !important;"> |
67a276510
|
93 |
<tr style="border: 1px solid lightgrey !important;padding:4px;"> |
ec5677f43
|
94 95 96 97 |
<td rowspan="2" style="border: 1px solid lightgrey !important;padding: 10px;" >Subject</td> |
4d1fcaddc
|
98 99 100 101 102 103 104 105 |
<template v-for="studentData in value"> <td colspan="2" v-for="studentMark in studentData.studentsMarks" style="border: 1px solid lightgrey !important;padding: 10px;" >{{studentMark.markDistributionId.distributionType}}</td> <td style="border: 1px solid lightgrey !important;padding: 10px;">Total</td> </template> |
ec5677f43
|
106 107 108 109 110 111 112 113 |
</tr> <tr v-for="(subject, ind) in value" v-if="ind == 0" style="border: 1px solid lightgrey !important;" > <template v-for="(exam, i) in subject.studentsMarks"> <td |
67a276510
|
114 |
|
ec5677f43
|
115 116 |
style="border: 1px solid lightgrey !important;padding: 10px;" >Mark</td> |
79583580d
|
117 |
<td |
67a276510
|
118 |
|
ec5677f43
|
119 120 121 122 |
style="border: 1px solid lightgrey !important;padding: 10px;" >Highest Mark</td> </template> <td |
67a276510
|
123 |
|
ec5677f43
|
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
style="border: 1px solid lightgrey !important;padding: 10px;" >Mark</td> </tr> </thead> <tbody style="border: 1px solid lightgrey !important;"> <tr v-for="subject in value" style="border: 1px solid lightgrey !important;"> <td style="border: 1px solid lightgrey !important;padding: 10px;" >{{subject.subjectName}}</td> <template v-for="(exam, i) in subject.studentsMarks"> <td style="border: 1px solid lightgrey !important;padding: 10px;" >{{exam.marksScored}}</td> <td style="border: 1px solid lightgrey !important;padding: 10px;" >{{exam.markDistributionId.markValue}}</td> </template> <td style="border: 1px solid lightgrey !important;padding: 10px;" >{{subject.totalMarks}}</td> </tr> </tbody> </table> </v-card> </v-flex> </v-layout> |
006544386
|
150 151 152 153 154 155 156 157 158 159 160 |
</v-flex> </v-container> <div class="loader" v-if="showLoader"> <v-progress-circular indeterminate color="white"></v-progress-circular> </div> </v-app> </template> <script> import http from "@/Services/http.js"; import moment from "moment"; |
79583580d
|
161 |
import _ from "underscore"; |
006544386
|
162 163 164 |
export default { data: () => ({ |
ec5677f43
|
165 166 |
showLoader: true, nameShow: false, |
66a5c3b75
|
167 168 |
showMark: true, showGrade: false, |
006544386
|
169 170 171 |
markData: [], token: "", markDistributions: [], |
79583580d
|
172 |
markParticularDistributionData: [], |
ec5677f43
|
173 |
filterData: [], |
66a5c3b75
|
174 175 176 177 178 179 180 181 182 |
output: null, gradeAPlus: "A+", gradeA: "A", gradeBPlus: "B+", gradeB: "B", gradeCPlus: "C+", gradeC: "C", selectMarkList: "Mark", selectMark: ["Mark", "Grade"], |
67a276510
|
183 184 |
MarkData: "", userData: {} |
006544386
|
185 186 187 188 |
}), mounted() { this.token = this.$store.state.token; this.getMarkList(); |
67a276510
|
189 |
this.getUserData(); |
006544386
|
190 191 192 |
}, methods: { getMarkList() { |
ec5677f43
|
193 |
this.showLoader = true; |
006544386
|
194 195 196 197 198 199 |
http() .get("/getParticularMark", { params: { studentId: this.$route.params.markId }, headers: { Authorization: "Bearer " + this.token } }) .then(response => { |
66a5c3b75
|
200 |
this.markData = response.data.data; |
79583580d
|
201 |
let newData = response.data.data; |
4d1fcaddc
|
202 |
// console.log("newData", newData); |
79583580d
|
203 204 205 206 |
for (var i = 0; i < newData.length; i++) { newData[i].examination = newData[i].examId._id; } this.filterData = _.groupBy(newData, ["examination"]); |
4d1fcaddc
|
207 |
// console.log("this.filterData", this.filterData); |
79583580d
|
208 |
for (let data in this.filterData) { |
79583580d
|
209 |
for (let item in this.filterData[data]) { |
79583580d
|
210 |
var totalMarks = 0; |
006544386
|
211 |
for ( |
79583580d
|
212 213 214 |
let i = 0; i < this.filterData[data][item].studentsMarks.length; i++ |
006544386
|
215 |
) { |
4d1fcaddc
|
216 217 |
// console.log("this.filterData[data][item].studentsMarks[i]",this.filterData[data][item].studentsMarks[i] // .marksScored) |
79583580d
|
218 219 |
totalMarks += this.filterData[data][item].studentsMarks[i] .marksScored; |
006544386
|
220 |
} |
79583580d
|
221 |
this.filterData[data][item].totalMarks = totalMarks; |
4d1fcaddc
|
222 |
|
66a5c3b75
|
223 224 225 226 227 228 229 230 231 232 233 234 235 |
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; } |
006544386
|
236 237 |
} } |
ec5677f43
|
238 |
this.showLoader = false; |
006544386
|
239 240 |
}) .catch(error => { |
006544386
|
241 242 243 244 245 246 247 248 249 |
this.showLoader = false; this.snackbar = true; 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); } }); |
ec5677f43
|
250 251 252 253 |
}, print() { // Pass the element id here this.$htmlToPaper("printMe"); |
66a5c3b75
|
254 |
}, |
67a276510
|
255 256 257 258 259 260 261 262 263 264 265 266 267 268 |
getUserData() { http() .get("/getParticularUserDetail") .then(response => { this.userData = response.data.data; }) .catch(error => { if (error.response.status === 401) { this.$router.replace({ path: "/" }); this.$store.dispatch("setToken", null); this.$store.dispatch("Id", null); } }); }, |
66a5c3b75
|
269 270 271 272 273 274 275 276 |
selectMarkData(select) { if (select == "Mark") { this.showMark = true; this.showGrade = false; } else if (select == "Grade") { this.showGrade = true; this.showMark = false; } |
006544386
|
277 278 279 280 281 282 |
} } }; </script> <style scoped> |
68d742034
|
283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 |
.add-button { background: #feb83c !important; border-color: #feb83c !important; text-transform: none !important; -webkit-box-shadow: none !important; box-shadow: none !important; } .card-styles { background: #7f62f8 !important; border-color: #7f62f8 !important; } .open-dialog-button { background: #827bfa !important; border-color: #827bfa !important; text-transform: none !important; } |
006544386
|
299 300 301 302 |
table { border-collapse: collapse; border: 1px solid #e2e7eb; } |
006544386
|
303 304 305 |
th, td { border: 1px solid #e2e7eb; |
006544386
|
306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 |
text-align: center; } 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; } |
ec5677f43
|
324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 |
.loader { width: 100%; height: 100%; position: fixed; top: 0; left: 0; text-align: center; background-color: rgba(0, 0, 0, 0.5); z-index: 999; } .loader > div { position: relative; top: calc(50% - 16px); } |
006544386
|
339 340 341 342 343 344 345 |
@media screen and (max-width: 380px) { .tableRsponsive { display: block; position: relative; overflow: scroll; } } |
ec5677f43
|
346 |
</style> |