Blame view

src/pages/Report/progressCardReport.vue 26.8 KB
006544386   Neeraj Sharma   implement task
1
  <template>
68d742034   Neeraj Sharma   implement new des...
2
    <v-container fluid class="body-color">
495e4037c   Neeraj Sharma   update
3
      <!-- ******  Progress Card Report Table****** -->
68d742034   Neeraj Sharma   implement new des...
4
      <v-card flat class="elevation-0 transparent">
495e4037c   Neeraj Sharma   update
5
6
7
8
9
        <v-form ref="form" v-model="valid" lazy-validation>
          <v-flex xs12 sm12 lg12>
            <v-layout wrap>
              <v-flex xs12 sm12 lg3>
                <v-layout>
c571cc325   Neeraj Sharma   responsive progre...
10
                  <v-flex xs3 sm3 lg2 class="subheading mt-4">
495e4037c   Neeraj Sharma   update
11
12
                    <label class="right">Class:</label>
                  </v-flex>
79583580d   Neeraj Sharma   implement task ma...
13
                  <v-flex xs9 sm6 lg8 class="ml-2">
495e4037c   Neeraj Sharma   update
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
                    <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>
c571cc325   Neeraj Sharma   responsive progre...
30
                  <v-flex xs3 sm3 lg2 class="subheading mt-4">
495e4037c   Neeraj Sharma   update
31
32
                    <label class="right">Section:</label>
                  </v-flex>
79583580d   Neeraj Sharma   implement task ma...
33
                  <v-flex xs9 sm6 lg8 class="ml-2">
495e4037c   Neeraj Sharma   update
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
                    <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>
c571cc325   Neeraj Sharma   responsive progre...
50
                  <v-flex xs3 sm3 lg2 class="subheading mt-4">
495e4037c   Neeraj Sharma   update
51
52
                    <label class="right">Student:</label>
                  </v-flex>
ec5677f43   Neeraj Sharma   implement print o...
53
                  <v-flex xs9 sm6 lg8 class="ml-2">
495e4037c   Neeraj Sharma   update
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>
c571cc325   Neeraj Sharma   responsive progre...
66
              <v-flex xs12 sm12 lg3>
79583580d   Neeraj Sharma   implement task ma...
67
                <v-btn
c571cc325   Neeraj Sharma   responsive progre...
68
69
                  style="margin: auto;
                  display: block;"
79583580d   Neeraj Sharma   implement task ma...
70
71
72
73
                  @click="getMarkReportList"
                  round
                  dark
                  :loading="loading"
3e79b2f9f   Neeraj Sharma   implement functio...
74
                  class="open-dialog-button mt-3"
79583580d   Neeraj Sharma   implement task ma...
75
                >Get Report</v-btn>
495e4037c   Neeraj Sharma   update
76
77
78
79
              </v-flex>
            </v-layout>
          </v-flex>
        </v-form>
006544386   Neeraj Sharma   implement task
80
      </v-card>
1d7227237   Neeraj Sharma   implement view ma...
81

d4735dce7   Shikha Mishra   show school logo ...
82
83
84
      <v-layout v-show="showReport">
        <v-flex xs12>
          <v-card class="transparent elevation-0">
1d7227237   Neeraj Sharma   implement view ma...
85
            <v-container grid-list-md class="report">
4d8198ee4   Neeraj Sharma   implement pdf fun...
86
              <v-flex xs12 sm12>
d4735dce7   Shikha Mishra   show school logo ...
87
88
89
                <v-layout wrap>
                  <!-- ****** TABLE DATA MARK  ****** -->
                  <v-flex xs12 sm12 md12>
3e79b2f9f   Neeraj Sharma   implement functio...
90
91
                    <v-layout>
                      <v-flex xs12>
e03bf1f92   Neeraj Sharma   solved bugs add i...
92
                        <v-btn class="open-dialog-button" round dark @click="printProgressReport()">
3e79b2f9f   Neeraj Sharma   implement functio...
93
94
95
96
97
                          Print
                          <v-icon right dark>print</v-icon>
                        </v-btn>
                      </v-flex>
                    </v-layout>
4d8198ee4   Neeraj Sharma   implement pdf fun...
98
99
100
101
                    <div>
                      <card class="elevation-0" v-for="(value, id, Index) in filterData" :key="Index">
                        <!-- <v-flex xs12  flat> -->
                        <!-- {{value}}---{{id}}---{{index}} -->
bdaae72ca   Neeraj Sharma   complete task of ...
102
                        <v-card
4d8198ee4   Neeraj Sharma   implement pdf fun...
103
104
105
106
107
108
                          id="printMe"
                          class="ma-3"
                          style="
                          border: 1px solid lightgrey;
                          margin-bottom:14px;
                          padding:20px"
bdaae72ca   Neeraj Sharma   complete task of ...
109
                        >
4d8198ee4   Neeraj Sharma   implement pdf fun...
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
                          <div style="border: 1px solid lightgray;">
                            <v-layout>
                              <v-flex xs12 sm12 md12>
                                <div
                                  style="    
                                border-bottom: 1px solid #ddd;
                                overflow: hidden;
                                vertical-align: middle;
                                margin: 10px;
                                padding-bottom: 10px;"
                                >
                                  <v-flex xs12 sm12 md12>
                                    <v-layout>
                                      <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>
                                    </v-layout>
                                  </v-flex>
                                </div>
                                <!-- Profile School -->
c571cc325   Neeraj Sharma   responsive progre...
142
                                <v-flex xs12 sm12 md12 lg12 style="margin:0px 10px; ">
4d8198ee4   Neeraj Sharma   implement pdf fun...
143
144
145
                                  <v-layout>
                                    <v-flex
                                      xs5
c571cc325   Neeraj Sharma   responsive progre...
146
147
148
                                      sm5
                                      md5
                                      lg5
4d8198ee4   Neeraj Sharma   implement pdf fun...
149
150
151
152
153
154
155
156
157
158
159
                                      style="padding: 4px;    
                                      padding-left: 16px !important;"
                                    >
                                      <p
                                        style="font-size:20px;margin-bottom: 16px;"
                                      >{{ userData.name }}</p>
                                      <p
                                        style="font-size: 15px;color: #707478;margin:0px;margin-bottom:8px;"
                                      >{{ userData.address }}</p>
                                      <p
                                        style="font-size: 15px;color: #707478;margin:0px;margin-bottom:8px;"
c571cc325   Neeraj Sharma   responsive progre...
160
                                      >Phone : {{ userData.mobile }}</p>
4d8198ee4   Neeraj Sharma   implement pdf fun...
161
162
                                      <p
                                        style="font-size: 15px;color: #707478;margin:0px;margin-bottom:8px;"
c571cc325   Neeraj Sharma   responsive progre...
163
                                      >Email : {{ userData.email }}</p>
4d8198ee4   Neeraj Sharma   implement pdf fun...
164
165
                                    </v-flex>
                                    <!-- Profile Student Report Card-->
c571cc325   Neeraj Sharma   responsive progre...
166
                                    <v-flex xs5 sm5 md5 lg5>
4d8198ee4   Neeraj Sharma   implement pdf fun...
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
                                      <div v-for="(studentMark,i,index) in value" :key="index">
                                        <p
                                          v-if="index == 0"
                                          style="font-size:20px;margin-bottom: 16px;"
                                        >{{ studentMark[0].studentId.name }}</p>
                                        <p
                                          v-if="index == 0"
                                          style="font-size: 15px;color: #707478;margin:0px;margin-bottom:8px;"
                                        >
                                          Class :
                                          <b>{{ studentMark[0].classId.classNum }}</b>
                                        </p>
                                        <p
                                          v-if="index == 0"
                                          style="font-size: 15px;color: #707478;margin:0px;margin-bottom:8px;"
                                        >
                                          Section :
                                          <b>{{ studentMark[0].sectionId.name }}</b>
                                        </p>
                                        <p
                                          v-if="index == 0"
                                          style="font-size: 15px;color: #707478;margin:0px;margin-bottom:8px;"
                                        >
                                          Roll NO :
                                          <b>{{ studentMark[0].studentId.rollNo }}</b>
                                        </p>
                                      </div>
                                    </v-flex>
c571cc325   Neeraj Sharma   responsive progre...
195
                                    <v-flex xs2 sm2 md2 lg2>
4d8198ee4   Neeraj Sharma   implement pdf fun...
196
197
198
199
200
                                      <div v-for="(studentMark,i,index) in value" :key="index">
                                        <v-avatar
                                          size="100"
                                          style="margin-top:16px"
                                          v-if="index == 0"
c571cc325   Neeraj Sharma   responsive progre...
201
                                          class="hidden-sm-only hidden-xs-only"
4d8198ee4   Neeraj Sharma   implement pdf fun...
202
203
204
205
206
207
208
209
210
211
212
213
214
                                        >
                                          <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>
                                    </v-flex>
                                  </v-layout>
c571cc325   Neeraj Sharma   responsive progre...
215
                                </v-flex>
4d8198ee4   Neeraj Sharma   implement pdf fun...
216
217
218
219
220
221
                              </v-flex>
                            </v-layout>
                            <v-card
                              v-for="studentMarks in value"
                              :key="studentMarks"
                              style="    
c571cc325   Neeraj Sharma   responsive progre...
222
223
224
225
226
227
228
                             background-color: #fff;
                             border-color: #fff;
                             color: rgba(0,0,0,0.87);
                             overflow-x: auto;
                             display: block;
                             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;
                             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;"
4d8198ee4   Neeraj Sharma   implement pdf fun...
229
230
231
                            >
                              <!-- {{studentMark}} -->
                              <!-- <div
bdaae72ca   Neeraj Sharma   complete task of ...
232
233
                            style="overflow-x:auto;    
                          border: 1px solid lightgrey !important;"
4d8198ee4   Neeraj Sharma   implement pdf fun...
234
235
236
237
238
239
                              >-->
                              <table
                                v-for="(studentMark,key) in studentMarks"
                                :key="key"
                                class="tableRsponsive feeTypeTable subheading"
                                style="border: 1px solid black;
bdaae72ca   Neeraj Sharma   complete task of ...
240
241
242
243
                               border-collapse: collapse;!important
                               table-layout: auto !important;
                               width: 100% !important;
                               overflow: hidden;"
4d8198ee4   Neeraj Sharma   implement pdf fun...
244
245
246
247
248
249
250
251
252
                              >
                                <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;
bdaae72ca   Neeraj Sharma   complete task of ...
253
254
255
                                      border-right: inherit;
                                      border-top: inherit;
                                      padding:14px;"
4d8198ee4   Neeraj Sharma   implement pdf fun...
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
                                    >{{studentMark.examId.examName}}</td>
                                  </tr>
                                  <tr style="border: 1px solid lightgrey !important;padding:4px;">
                                    <td
                                      rowspan="2"
                                      style="border: 1px solid lightgrey !important;padding: 6px;"
                                    >Subject</td>
                                    <template>
                                      <td
                                        v-for="(studentMarkData,i) in studentMark.studentsMarks"
                                        :key="i"
                                        colspan="2"
                                        style="border: 1px solid lightgrey !important;padding: 6px;"
                                      >{{studentMarkData.markDistributionId.distributionType}}</td>
                                      <td
                                        style="border: 1px solid lightgrey !important;padding: 6px;"
                                      >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: 6px;"
                                      >Marks</td>
                                      <td
                                        :key="ind"
                                        style="border: 1px solid lightgrey !important;padding: 6px;"
                                      >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">
                                    <td
                                      style="border: 1px solid lightgrey !important;padding: 6px;"
                                    >{{studentMark.subjectName}}</td>
                                    <template v-for="(exam, index) in  studentMark.studentsMarks">
                                      <td
                                        :key="index"
                                        style="border: 1px solid lightgrey !important;padding: 6px;"
                                      >{{exam.marksScored}}</td>
                                      <td
                                        :key="index"
                                        style="border: 1px solid lightgrey !important;padding: 6px;"
                                      >{{exam.markDistributionId.markValue}}</td>
                                    </template>
bdaae72ca   Neeraj Sharma   complete task of ...
306
                                    <td
4d8198ee4   Neeraj Sharma   implement pdf fun...
307
308
309
310
311
312
                                      style="border: 1px solid lightgrey !important;padding: 6px;"
                                    >{{studentMark.totalMarks}}</td>
                                  </tr>
                                </tbody>
                                <tfoot v-if="key == studentMarks.length - 1">
                                  <tr style="border: 1px solid lightgrey !important;">
bdaae72ca   Neeraj Sharma   complete task of ...
313
                                    <td
4d8198ee4   Neeraj Sharma   implement pdf fun...
314
315
316
317
318
319
                                      colspan="5"
                                      class="subheding"
                                      style="    
                                      border: 1px solid #e2e7eb;
                                      text-align:center
                                      padding: 6px;"
bdaae72ca   Neeraj Sharma   complete task of ...
320
                                    >Total Marks</td>
bdaae72ca   Neeraj Sharma   complete task of ...
321
                                    <td
4d8198ee4   Neeraj Sharma   implement pdf fun...
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
                                      colspan="7"
                                      style="border: 1px solid lightgrey !important;padding: 6px;"
                                    >{{ studentMark.allSubjectTotalMarks }}</td>
                                  </tr>
                                  <tr>
                                    <td
                                      colspan="5"
                                      class="subheding"
                                      style="    
                                      border: 1px solid #e2e7eb;
                                      text-align:center
                                      padding: 6px;"
                                    >Grade</td>
                                    <td
                                      colspan="7"
                                      style="border: 1px solid lightgrey !important;padding: 6px;"
                                    >{{ studentMark.grade ? studentMark.grade : "-" }}</td>
                                  </tr>
                                  <tr>
                                    <td
                                      colspan="5"
                                      style="
                                       border: 1px solid #e2e7eb;
                                      text-align:center
                                      padding: 6px;"
                                      class="subheding"
                                    >Average Mark</td>
bdaae72ca   Neeraj Sharma   complete task of ...
349
                                    <td
4d8198ee4   Neeraj Sharma   implement pdf fun...
350
351
352
353
354
                                      colspan="7"
                                      style="border: 1px solid lightgrey !important;padding: 6px;"
                                    >-</td>
                                  </tr>
                                  <tr>
bdaae72ca   Neeraj Sharma   complete task of ...
355
                                    <td
4d8198ee4   Neeraj Sharma   implement pdf fun...
356
357
358
359
360
361
362
363
                                      colspan="5"
                                      style="
                                      border: 1px solid #e2e7eb;
                                      text-align:center
                                      padding: 6px; !important;
                                      font-size: 16px !important;"
                                      class="subheding"
                                    >GPA</td>
bdaae72ca   Neeraj Sharma   complete task of ...
364
                                    <td
4d8198ee4   Neeraj Sharma   implement pdf fun...
365
366
367
368
369
370
371
372
                                      colspan="7"
                                      style="border: 1px solid lightgrey !important;padding: 6px !important;font-size: 16px !important;"
                                    >-</td>
                                  </tr>
                                </tfoot>
                              </table>
                              <!-- </div> -->
                            </v-card>
bdaae72ca   Neeraj Sharma   complete task of ...
373
                          </div>
962a41f53   Neeraj Sharma   fixed multiple pr...
374
                        </v-card>
4d8198ee4   Neeraj Sharma   implement pdf fun...
375
376
377
378
                        <!-- </v-flex> -->
                      </card>
                    </div>
                    <p style="page-break-after: always;">&nbsp;</p>
d4735dce7   Shikha Mishra   show school logo ...
379
380
381
382
383
                  </v-flex>
                </v-layout>
              </v-flex>
            </v-container>
          </v-card>
79583580d   Neeraj Sharma   implement task ma...
384
        </v-flex>
d4735dce7   Shikha Mishra   show school logo ...
385
      </v-layout>
006544386   Neeraj Sharma   implement task
386
387
388
      <div class="loader" v-if="showLoader">
        <v-progress-circular indeterminate color="white"></v-progress-circular>
      </div>
68d742034   Neeraj Sharma   implement new des...
389
    </v-container>
006544386   Neeraj Sharma   implement task
390
391
392
393
394
  </template>
  
  <script>
  import http from "@/Services/http.js";
  import moment from "moment";
79583580d   Neeraj Sharma   implement task ma...
395
  import _ from "underscore";
006544386   Neeraj Sharma   implement task
396
397
398
  
  export default {
    data: () => ({
006544386   Neeraj Sharma   implement task
399
      showLoader: false,
c62132b75   Shikha Mishra   invoice,progress-...
400
      cardData: [],
79583580d   Neeraj Sharma   implement task ma...
401
402
403
404
      token: "",
      markDistributions: [],
      markParticularDistributionData: [],
      loading: false,
495e4037c   Neeraj Sharma   update
405
      valid: true,
79583580d   Neeraj Sharma   implement task ma...
406
407
      loading: false,
      showReport: false,
006544386   Neeraj Sharma   implement task
408
      addSection: [],
79583580d   Neeraj Sharma   implement task ma...
409
410
      filterData: [],
      getStudentsList: [],
495e4037c   Neeraj Sharma   update
411
412
413
      classRules: [v => !!v || "Class is required"],
      sectionRules: [v => !!v || "Class is required"],
      studentRules: [v => !!v || "Student is required"],
495e4037c   Neeraj Sharma   update
414
      getReport: {},
ec5677f43   Neeraj Sharma   implement print o...
415
      classList: [],
c0b01ae20   Neeraj Sharma   solve bugs in pro...
416
      output: null,
710438de6   Shikha Mishra   added teacher mod...
417
418
      userData: {},
      newData: [],
c62132b75   Shikha Mishra   invoice,progress-...
419
420
421
422
423
      gradeAPlus: "A+",
      gradeA: "A",
      gradeBPlus: "B+",
      gradeB: "B",
      gradeCPlus: "C+",
3e79b2f9f   Neeraj Sharma   implement functio...
424
425
      gradeC: "C",
      totalMarks: ""
006544386   Neeraj Sharma   implement task
426
    }),
79583580d   Neeraj Sharma   implement task ma...
427
428
429
    mounted() {
      this.token = this.$store.state.token;
      this.getClass();
c0b01ae20   Neeraj Sharma   solve bugs in pro...
430
      this.getUserData();
79583580d   Neeraj Sharma   implement task ma...
431
    },
006544386   Neeraj Sharma   implement task
432
    methods: {
495e4037c   Neeraj Sharma   update
433
434
435
      clear() {
        this.$refs.form.reset();
      },
006544386   Neeraj Sharma   implement task
436
      getClass() {
ec5677f43   Neeraj Sharma   implement print o...
437
        this.showLoader = true;
006544386   Neeraj Sharma   implement task
438
439
440
441
442
443
        http()
          .get("/getClassesList", {
            headers: { Authorization: "Bearer " + this.token }
          })
          .then(response => {
            this.classList = response.data.data;
ec5677f43   Neeraj Sharma   implement print o...
444
            this.showLoader = false;
006544386   Neeraj Sharma   implement task
445
          })
c0b01ae20   Neeraj Sharma   solve bugs in pro...
446
          .catch(error => {
ec5677f43   Neeraj Sharma   implement print o...
447
            this.showLoader = false;
006544386   Neeraj Sharma   implement task
448
449
450
451
            // console.log("err====>", err);
          });
      },
      getSections(_id) {
c0b01ae20   Neeraj Sharma   solve bugs in pro...
452
        this.showLoader = true;
006544386   Neeraj Sharma   implement task
453
454
455
456
457
458
459
460
461
462
        http()
          .get(
            "/getSectionsList",
            { params: { classId: _id } },
            {
              headers: { Authorization: "Bearer " + this.token }
            }
          )
          .then(response => {
            this.addSection = response.data.data;
c0b01ae20   Neeraj Sharma   solve bugs in pro...
463
            this.showLoader = false;
006544386   Neeraj Sharma   implement task
464
465
          })
          .catch(err => {
c0b01ae20   Neeraj Sharma   solve bugs in pro...
466
            this.showLoader = false;
006544386   Neeraj Sharma   implement task
467
468
469
470
471
472
473
474
            // console.log("err====>", err);
          });
      },
      getStudents() {
        this.showLoader = true;
        http()
          .get("/getStudentWithClass", {
            params: {
495e4037c   Neeraj Sharma   update
475
476
              classId: this.getReport.classId,
              sectionId: this.getReport.sectionId
006544386   Neeraj Sharma   implement task
477
478
479
            }
          })
          .then(response => {
e03bf1f92   Neeraj Sharma   solved bugs add i...
480
481
482
483
            response.data.data.unshift({
              name: "Select All",
              _id: "Select All"
            });
006544386   Neeraj Sharma   implement task
484
485
            this.getStudentsList = response.data.data;
            this.showLoader = false;
c0b01ae20   Neeraj Sharma   solve bugs in pro...
486
            // console.log("getSectionsList=====>", response.data.data);
006544386   Neeraj Sharma   implement task
487
488
489
490
491
492
          })
          .catch(error => {
            console.log("err====>", error);
            this.showLoader = false;
          });
      },
79583580d   Neeraj Sharma   implement task ma...
493
      getMarkReportList() {
1d7227237   Neeraj Sharma   implement view ma...
494
        this.showLoader = true;
79583580d   Neeraj Sharma   implement task ma...
495
        this.showReport = true;
c765369af   Neeraj Sharma   solve bugs
496
497
498
499
500
501
        var getSelectMarks = {};
        if (this.getReport.studentId == "Select All") {
          getSelectMarks = {
            classId: this.getReport.classId,
            sectionId: this.getReport.sectionId
          };
962a41f53   Neeraj Sharma   fixed multiple pr...
502
        } else if (this.getReport.studentId != "Select All") {
c765369af   Neeraj Sharma   solve bugs
503
504
505
506
507
508
          getSelectMarks = {
            classId: this.getReport.classId,
            sectionId: this.getReport.sectionId,
            studentId: this.getReport.studentId
          };
        }
79583580d   Neeraj Sharma   implement task ma...
509
510
        http()
          .get("/getParticularMark", {
c765369af   Neeraj Sharma   solve bugs
511
            params: getSelectMarks,
79583580d   Neeraj Sharma   implement task ma...
512
513
514
            headers: { Authorization: "Bearer " + this.token }
          })
          .then(response => {
c62132b75   Shikha Mishra   invoice,progress-...
515
            this.cardData = response.data.data;
79583580d   Neeraj Sharma   implement task ma...
516
517
518
            let newData = response.data.data;
            for (var i = 0; i < newData.length; i++) {
              newData[i].examination = newData[i].examId._id;
1d7227237   Neeraj Sharma   implement view ma...
519
520
521
522
523
524
525
526
              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   Neeraj Sharma   implement task ma...
527
            }
1d7227237   Neeraj Sharma   implement view ma...
528
            this.filterData = studentMarkArray;
79583580d   Neeraj Sharma   implement task ma...
529
            for (let data in this.filterData) {
79583580d   Neeraj Sharma   implement task ma...
530
              for (let item in this.filterData[data]) {
bdaae72ca   Neeraj Sharma   complete task of ...
531
                var allSubjectTotalMarks = 0;
1d7227237   Neeraj Sharma   implement view ma...
532
                for (let i = 0; i < this.filterData[data][item].length; i++) {
bdaae72ca   Neeraj Sharma   complete task of ...
533
                  var totalMarks = 0;
1d7227237   Neeraj Sharma   implement view ma...
534
535
536
537
538
539
540
541
                  for (
                    let j = 0;
                    j < studentMarkArray[data][item][i].studentsMarks.length;
                    j++
                  ) {
                    totalMarks +=
                      studentMarkArray[data][item][i].studentsMarks[j]
                        .marksScored;
1d7227237   Neeraj Sharma   implement view ma...
542
543
                  }
                  this.filterData[data][item][i].totalMarks = totalMarks;
bdaae72ca   Neeraj Sharma   complete task of ...
544
545
546
547
548
549
  
                  allSubjectTotalMarks += this.filterData[data][item][i]
                    .totalMarks;
                  this.filterData[data][item][
                    i
                  ].allSubjectTotalMarks = allSubjectTotalMarks;
c62132b75   Shikha Mishra   invoice,progress-...
550
                }
bdaae72ca   Neeraj Sharma   complete task of ...
551

1d7227237   Neeraj Sharma   implement view ma...
552
                // this.totalMarks = totalMarks;
bdaae72ca   Neeraj Sharma   complete task of ...
553
554
555
556
557
558
559
560
561
562
563
564
565
                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   Neeraj Sharma   implement task ma...
566
567
              }
            }
bdaae72ca   Neeraj Sharma   complete task of ...
568
            // console.log("this.filterData-----------last", this.filterData);
1d7227237   Neeraj Sharma   implement view ma...
569

c62132b75   Shikha Mishra   invoice,progress-...
570
            this.showLoader = false;
79583580d   Neeraj Sharma   implement task ma...
571
572
573
574
575
          })
          .catch(error => {
            // console.log("err====>", err);
            this.showLoader = false;
            this.snackbar = true;
710438de6   Shikha Mishra   added teacher mod...
576
577
578
579
580
581
            // 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   Neeraj Sharma   implement task ma...
582
          });
ec5677f43   Neeraj Sharma   implement print o...
583
      },
d4735dce7   Shikha Mishra   show school logo ...
584
      printProgressReport() {
ec5677f43   Neeraj Sharma   implement print o...
585
586
        // Pass the element id here
        this.$htmlToPaper("printMe");
c0b01ae20   Neeraj Sharma   solve bugs in pro...
587
588
589
590
591
592
593
594
      },
      getUserData() {
        http()
          .get("/getParticularUserDetail")
          .then(response => {
            this.userData = response.data.data;
          })
          .catch(error => {
25205ccca   Shikha Mishra   show school logo ...
595
596
597
598
599
            // if (error.response.status === 401) {
            //   this.$router.replace({ path: "/" });
            //   this.$store.dispatch("setToken", null);
            //   this.$store.dispatch("Id", null);
            // }
c0b01ae20   Neeraj Sharma   solve bugs in pro...
600
          });
006544386   Neeraj Sharma   implement task
601
      }
006544386   Neeraj Sharma   implement task
602
603
604
    }
  };
  </script>
79583580d   Neeraj Sharma   implement task ma...
605

006544386   Neeraj Sharma   implement task
606
  <style scoped>
79583580d   Neeraj Sharma   implement task ma...
607
608
609
610
611
612
613
614
  table {
    border-collapse: collapse;
    border: 1px solid #e2e7eb;
  }
  
  th,
  td {
    border: 1px solid #e2e7eb;
4d8198ee4   Neeraj Sharma   implement pdf fun...
615
    padding: 6px;
79583580d   Neeraj Sharma   implement task ma...
616
    text-align: center;
006544386   Neeraj Sharma   implement task
617
  }
79583580d   Neeraj Sharma   implement task ma...
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
  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   Shikha Mishra   solve issue login
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
  
  /* .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   Neeraj Sharma   implement task ma...
670
671
  @media screen and (max-width: 380px) {
    .tableRsponsive {
d4735dce7   Shikha Mishra   show school logo ...
672
      /* display: block; */
79583580d   Neeraj Sharma   implement task ma...
673
674
675
      position: relative;
      overflow: scroll;
    }
006544386   Neeraj Sharma   implement task
676
  }
79583580d   Neeraj Sharma   implement task ma...
677
  </style> s