Blame view

src/pages/Report/studentReport.vue 20.7 KB
006544386   Neeraj Sharma   implement task
1
  <template>
68d742034   Neeraj Sharma   implement new des...
2
    <v-container fluid class="body-color">
006544386   Neeraj Sharma   implement task
3
      <!-- ******  Student Report TABLE****** -->
68d742034   Neeraj Sharma   implement new des...
4
      <v-card flat class="elevation-0 transparent">
006544386   Neeraj Sharma   implement task
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 lg4>
                <v-layout>
495e4037c   Neeraj Sharma   update
10
                  <v-flex xs4 sm4 lg3 class="subheading mt-4">
006544386   Neeraj Sharma   implement task
11
12
                    <label class="right">Report For :</label>
                  </v-flex>
495e4037c   Neeraj Sharma   update
13
                  <v-flex xs7 sm6 lg8 class="ml-2">
ec5677f43   Neeraj Sharma   implement print o...
14
                    <v-autocomplete
006544386   Neeraj Sharma   implement task
15
16
17
18
19
20
21
22
                      v-model="report.form"
                      label="Select your report for"
                      :items="formList"
                      item-text="name"
                      item-value="value"
                      @change="getReport(report.form)"
                      :rules="formRules"
                      required
ec5677f43   Neeraj Sharma   implement print o...
23
                    ></v-autocomplete>
006544386   Neeraj Sharma   implement task
24
25
26
27
28
                  </v-flex>
                </v-layout>
              </v-flex>
              <v-flex xs12 sm12 lg4 v-if="bloodGroup">
                <v-layout>
495e4037c   Neeraj Sharma   update
29
                  <v-flex xs4 sm4 lg4 class="subheading mt-4">
006544386   Neeraj Sharma   implement task
30
31
                    <label class="right">Blood Group :</label>
                  </v-flex>
495e4037c   Neeraj Sharma   update
32
                  <v-flex xs7 sm6 lg8 class="ml-2">
ec5677f43   Neeraj Sharma   implement print o...
33
                    <v-autocomplete
006544386   Neeraj Sharma   implement task
34
35
36
37
38
                      v-model="report.bloodGroup"
                      label="Select your Blood Group "
                      :items="bloodGroupList"
                      :rules="bloodGroupRules"
                      required
ec5677f43   Neeraj Sharma   implement print o...
39
                    ></v-autocomplete>
006544386   Neeraj Sharma   implement task
40
41
42
43
44
                  </v-flex>
                </v-layout>
              </v-flex>
              <v-flex xs12 sm12 lg4 v-if="genderShow">
                <v-layout>
495e4037c   Neeraj Sharma   update
45
                  <v-flex xs4 sm4 lg4 class="subheading mt-4">
006544386   Neeraj Sharma   implement task
46
47
                    <label class="right">Gender:</label>
                  </v-flex>
495e4037c   Neeraj Sharma   update
48
                  <v-flex xs7 sm6 lg8 class="ml-2">
ec5677f43   Neeraj Sharma   implement print o...
49
                    <v-autocomplete
006544386   Neeraj Sharma   implement task
50
51
52
53
54
                      v-model="report.gender"
                      label="Select your gender "
                      :items="gender"
                      :rules="genderRules"
                      required
ec5677f43   Neeraj Sharma   implement print o...
55
                    ></v-autocomplete>
006544386   Neeraj Sharma   implement task
56
57
58
59
60
                  </v-flex>
                </v-layout>
              </v-flex>
              <v-flex xs12 sm12 lg4 v-if="TransportShow">
                <v-layout>
495e4037c   Neeraj Sharma   update
61
                  <v-flex xs4 sm4 lg4 class="subheading mt-4">
006544386   Neeraj Sharma   implement task
62
63
                    <label class="right">Route:</label>
                  </v-flex>
495e4037c   Neeraj Sharma   update
64
                  <v-flex xs7 sm6 lg8 class="ml-2">
ec5677f43   Neeraj Sharma   implement print o...
65
                    <v-autocomplete
006544386   Neeraj Sharma   implement task
66
67
68
69
70
                      v-model="report.route"
                      label="Select your gender "
                      :items="route"
                      :rules="routeRules"
                      required
ec5677f43   Neeraj Sharma   implement print o...
71
                    ></v-autocomplete>
006544386   Neeraj Sharma   implement task
72
73
74
75
76
                  </v-flex>
                </v-layout>
              </v-flex>
              <v-flex xs12 sm12 lg4 v-if="HostelShow">
                <v-layout>
495e4037c   Neeraj Sharma   update
77
                  <v-flex xs4 sm4 lg4 class="subheading mt-4">
006544386   Neeraj Sharma   implement task
78
79
                    <label class="right">Hostel:</label>
                  </v-flex>
495e4037c   Neeraj Sharma   update
80
                  <v-flex xs7 sm6 lg8 class="ml-2">
ec5677f43   Neeraj Sharma   implement print o...
81
                    <v-autocomplete
006544386   Neeraj Sharma   implement task
82
83
84
85
86
                      v-model="report.route"
                      label="Select your hostel "
                      :items="hostelList"
                      :rules="hostelRules"
                      required
ec5677f43   Neeraj Sharma   implement print o...
87
                    ></v-autocomplete>
006544386   Neeraj Sharma   implement task
88
89
90
91
92
                  </v-flex>
                </v-layout>
              </v-flex>
              <v-flex xs12 sm12 lg4 v-if="countryShow">
                <v-layout>
495e4037c   Neeraj Sharma   update
93
                  <v-flex xs4 sm4 lg4 class="subheading mt-4">
006544386   Neeraj Sharma   implement task
94
95
                    <label class="right">Country :</label>
                  </v-flex>
495e4037c   Neeraj Sharma   update
96
                  <v-flex xs7 sm6 lg8 class="ml-2">
ec5677f43   Neeraj Sharma   implement print o...
97
                    <v-autocomplete
006544386   Neeraj Sharma   implement task
98
99
100
101
102
                      v-model="report.country"
                      label="Select your Country "
                      :items="countryList"
                      :rules="countryRules"
                      required
ec5677f43   Neeraj Sharma   implement print o...
103
                    ></v-autocomplete>
006544386   Neeraj Sharma   implement task
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
                  </v-flex>
                </v-layout>
              </v-flex>
              <!-- <v-flex xs12 sm12 lg4 v-show="BirthdayShow">
              <v-layout>
                <v-flex xs3 sm6 lg4 class="subheading mt-4">
                  <label class="right">Country :</label>
                </v-flex>
                <v-flex xs12 sm12 lg8 class="ml-2">
                  <v-select
                    v-model="report.country"
                    label="Select your Country "
                    :items="countryList"
                    required
                  ></v-select>
                </v-flex>
              </v-layout>
              </v-flex>-->
79583580d   Neeraj Sharma   implement task ma...
122
              <v-flex xs12 sm12 lg4 v-if="classShow">
006544386   Neeraj Sharma   implement task
123
                <v-layout>
495e4037c   Neeraj Sharma   update
124
                  <v-flex xs4 sm4 lg3 class="subheading mt-4">
006544386   Neeraj Sharma   implement task
125
126
                    <label class="right">Class:</label>
                  </v-flex>
495e4037c   Neeraj Sharma   update
127
                  <v-flex xs7 sm6 lg8 class="ml-2">
ec5677f43   Neeraj Sharma   implement print o...
128
                    <v-autocomplete
006544386   Neeraj Sharma   implement task
129
130
131
132
133
134
135
136
137
                      v-model="report.classId"
                      label="Select your class"
                      type="text"
                      :rules="classRules"
                      :items="classList"
                      item-text="classNum"
                      item-value="_id"
                      @change="getSections(report.classId)"
                      required
ec5677f43   Neeraj Sharma   implement print o...
138
                    ></v-autocomplete>
006544386   Neeraj Sharma   implement task
139
140
141
142
143
                  </v-flex>
                </v-layout>
              </v-flex>
              <v-flex xs12 sm12 lg4 v-if="sectionShow">
                <v-layout>
495e4037c   Neeraj Sharma   update
144
                  <v-flex xs4 sm4 lg3 class="subheading mt-4">
006544386   Neeraj Sharma   implement task
145
146
                    <label class="right">Section:</label>
                  </v-flex>
495e4037c   Neeraj Sharma   update
147
                  <v-flex xs7 sm6 lg8 class="ml-2">
ec5677f43   Neeraj Sharma   implement print o...
148
                    <v-autocomplete
006544386   Neeraj Sharma   implement task
149
150
151
152
153
154
155
156
                      :items="addSection"
                      label="Select your Section"
                      v-model="report.sectionId"
                      :rules="sectionRules"
                      item-text="name"
                      item-value="_id"
                      name="Select Section"
                      required
ec5677f43   Neeraj Sharma   implement print o...
157
                    ></v-autocomplete>
006544386   Neeraj Sharma   implement task
158
159
160
                  </v-flex>
                </v-layout>
              </v-flex>
96f88269a   Neeraj Sharma   implement Student...
161
              <v-flex xs12 sm12 lg4 class="hidden-xs-only hidden-sm-only pl-5">
68d742034   Neeraj Sharma   implement new des...
162
163
164
165
166
167
168
                <v-btn
                  @click="getStudents"
                  round
                  dark
                  :loading="loading"
                  class="open-dialog-button mt-3 ml-5"
                >Get Report</v-btn>
006544386   Neeraj Sharma   implement task
169
              </v-flex>
495e4037c   Neeraj Sharma   update
170
              <v-flex xs12 sm12 lg4 class="hidden-lg-only hidden-md-only hidden-xl-only">
79583580d   Neeraj Sharma   implement task ma...
171
172
173
174
175
176
177
                <v-btn
                  @click="getStudents"
                  round
                  dark
                  :loading="loading"
                  class="mt-3 right"
                >Get Report</v-btn>
495e4037c   Neeraj Sharma   update
178
              </v-flex>
006544386   Neeraj Sharma   implement task
179
180
181
182
            </v-layout>
          </v-flex>
        </v-form>
      </v-card>
96f88269a   Neeraj Sharma   implement Student...
183
184
      <v-layout v-show="showTable">
        <v-flex xs12>
68d742034   Neeraj Sharma   implement new des...
185
          <v-card class="transparent elevation-0">
96f88269a   Neeraj Sharma   implement Student...
186
187
            <v-layout>
              <v-flex xs12>
25205ccca   Shikha Mishra   show school logo ...
188
                <v-btn class="open-dialog-button right" round dark @click="printStudentReport()">
96f88269a   Neeraj Sharma   implement Student...
189
190
191
192
193
194
                  Print
                  <v-icon right dark>print</v-icon>
                </v-btn>
              </v-flex>
            </v-layout>
            <v-layout>
25205ccca   Shikha Mishra   show school logo ...
195
              <v-flex xs12 sm12 md12 class="text-xs-center">
acb6c9e2b   Shikha Mishra   issues solved rel...
196
197
198
                <!-- <img :src="userData.schoolLogoUrl" width="140" alt="logo" /> -->
                <v-avatar>
                  <img :src="userData.schoolLogoUrl" v-if="userData.schoolLogoUrl" />
a5585d98e   Shikha Mishra   show school logo
199
200
201
202
                  <img
                    src="/static/schoolIcons/INTRACK_White.png"
                    v-else-if="!userData.schoolLogoUrl"
                  />
acb6c9e2b   Shikha Mishra   issues solved rel...
203
                </v-avatar>
96f88269a   Neeraj Sharma   implement Student...
204
205
206
207
208
209
210
211
212
213
214
                <p class="title">{{ userData.name }}</p>
                <p>{{ userData.address }}</p>
              </v-flex>
            </v-layout>
            <v-data-table
              :headers="headers"
              :items="getStudentsReportList"
              :pagination.sync="pagination"
              :search="search"
            >
              <template slot="items" slot-scope="props">
68d742034   Neeraj Sharma   implement new des...
215
216
                <tr class="tr">
                  <td class="td td-row">{{ props.index + 1}}</td>
08ed7ec1f   Neeraj Sharma   commit codde stud...
217
                  <td class="td td-row" style="text-align:center">
68d742034   Neeraj Sharma   implement new des...
218
219
220
221
222
223
224
225
226
                    <v-avatar>
                      <img :src="props.item.profilePicUrl" v-if="props.item.profilePicUrl" />
                      <img src="/static/icon/user.png" v-else-if="!props.item.profilePicUrl" />
                    </v-avatar>
                  </td>
                  <td class="td td-row text-xs-center">{{ props.item.name}}</td>
                  <td class="td td-row text-xs-center">{{ props.item.rollNo }}</td>
                  <td class="td td-row text-xs-center">{{ props.item.email }}</td>
                  <td class="td td-row text-xs-center">{{ props.item.classId.classNum }}</td>
ba420d0d1   Shikha Mishra   Solve add subject...
227
228
229
                  <td
                    class="td td-row text-xs-center"
                  >{{ props.item.sectionId ? props.item.sectionId.name: '-' }}</td>
68d742034   Neeraj Sharma   implement new des...
230
                </tr>
96f88269a   Neeraj Sharma   implement Student...
231
232
233
234
235
236
237
238
239
240
241
242
              </template>
              <v-alert
                slot="no-results"
                :value="true"
                color="error"
                icon="warning"
              >Your search for "{{ search }}" found no results.</v-alert>
            </v-data-table>
          </v-card>
          <v-flex xs12 id="printMe" v-show="hidePrintStudentReport">
            <v-layout>
              <v-flex xs12 style="text-align:center;margin-bottom:10px">
ba420d0d1   Shikha Mishra   Solve add subject...
243
244
245
246
247
248
249
250
                <!-- <img :src="userData.schoolLogoUrl" width="80" alt="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>
96f88269a   Neeraj Sharma   implement Student...
251
252
253
254
255
256
257
258
259
260
261
262
263
                <p class="title">{{ userData.name }}</p>
                <p>{{ userData.address }}</p>
              </v-flex>
            </v-layout>
            <table
              class="mb-5 tableRsponsive feeTypeTable"
              style="border: 1px solid lightgrey;
                    border-collapse: collapse;!important
                    table-layout: auto !important;
                    width: 100% !important;"
            >
              <thead style="border: 1px solid lightgrey !important;">
                <tr style="border: 1px solid lightgrey !important;padding:4px;">
08ed7ec1f   Neeraj Sharma   commit codde stud...
264
265
266
267
268
269
                  <td style="border: 1px solid lightgrey !important;padding: 4px;">Profile Pic</td>
                  <td style="border: 1px solid lightgrey !important;padding: 4px;">Name</td>
                  <td style="border: 1px solid lightgrey !important;padding: 4px;">Roll No</td>
                  <td style="border: 1px solid lightgrey !important;padding: 4px;">Email</td>
                  <td style="border: 1px solid lightgrey !important;padding: 4px;">Class</td>
                  <td style="border: 1px solid lightgrey !important;padding: 4px;">Section</td>
96f88269a   Neeraj Sharma   implement Student...
270
271
272
273
                </tr>
              </thead>
              <tbody style="border: 1px solid lightgrey !important;">
                <tr v-for="(studentReport,i) in getStudentsReportList" :key="i">
08ed7ec1f   Neeraj Sharma   commit codde stud...
274
                  <td style="border: 1px solid lightgrey !important;padding: 4px;text-align:center">
96f88269a   Neeraj Sharma   implement Student...
275
276
277
278
279
280
                    <v-avatar>
                      <img :src="studentReport.profilePicUrl" v-if="studentReport.profilePicUrl" />
                      <img src="/static/icon/user.png" v-else-if="!studentReport.profilePicUrl" />
                    </v-avatar>
                  </td>
                  <td
08ed7ec1f   Neeraj Sharma   commit codde stud...
281
                    style="border: 1px solid lightgrey !important;padding: 4px;"
96f88269a   Neeraj Sharma   implement Student...
282
                  >{{ studentReport.name }}</td>
96f88269a   Neeraj Sharma   implement Student...
283
                  <td
08ed7ec1f   Neeraj Sharma   commit codde stud...
284
285
286
287
                    style="border: 1px solid lightgrey !important;padding: 4px;"
                  >{{ studentReport.rollNo }}</td>
                  <td
                    style="border: 1px solid lightgrey !important;padding: 4px;"
96f88269a   Neeraj Sharma   implement Student...
288
289
                  >{{ studentReport.email }}</td>
                  <td
08ed7ec1f   Neeraj Sharma   commit codde stud...
290
                    style="border: 1px solid lightgrey !important;padding: 4px;"
96f88269a   Neeraj Sharma   implement Student...
291
                  >{{ studentReport.classId.classNum }}</td>
ba420d0d1   Shikha Mishra   Solve add subject...
292
293
294
295
                  <td style="border: 1px solid lightgrey !important;padding: 4px;">
                    {{ studentReport.sectionId ? studentReport.sectionId.name: '-'
                    }}
                  </td>
96f88269a   Neeraj Sharma   implement Student...
296
297
298
299
300
301
                </tr>
              </tbody>
            </table>
          </v-flex>
        </v-flex>
      </v-layout>
006544386   Neeraj Sharma   implement task
302
303
304
      <div class="loader" v-if="showLoader">
        <v-progress-circular indeterminate color="white"></v-progress-circular>
      </div>
68d742034   Neeraj Sharma   implement new des...
305
    </v-container>
006544386   Neeraj Sharma   implement task
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
  </template>
  
  <script>
  import http from "@/Services/http.js";
  import countryList from "@/script/country.js";
  
  import moment from "moment";
  
  export default {
    data: () => ({
      snackbar: false,
      color: "",
      y: "top",
      x: "right",
      mode: "",
      timeout: 10000,
      text: "",
      loading: false,
      valid: true,
      search: "",
      showLoader: false,
      bloodGroup: false,
      genderShow: false,
      countryShow: false,
      TransportShow: false,
      HostelShow: false,
      BirthdayShow: false,
      sectionShow: false,
      showTable: false,
96f88269a   Neeraj Sharma   implement Student...
335
336
      classShow: true,
      hidePrintStudentReport: false,
006544386   Neeraj Sharma   implement task
337
338
      addSection: [],
      pagination: {
ba420d0d1   Shikha Mishra   Solve add subject...
339
        rowsPerPage: 10,
006544386   Neeraj Sharma   implement task
340
      },
ba420d0d1   Shikha Mishra   Solve add subject...
341
342
343
344
345
346
347
348
      formRules: [(v) => !!v || "Form For is required"],
      bloodGroupRules: [(v) => !!v || "Blood group is required"],
      classRules: [(v) => !!v || "Class is required"],
      sectionRules: [(v) => !!v || "Class is required"],
      genderRules: [(v) => !!v || "Gender is required"],
      routeRules: [(v) => !!v || "RouteI is required"],
      hostelRules: [(v) => !!v || "Hostel is required"],
      countryRules: [(v) => !!v || "Country is required"],
006544386   Neeraj Sharma   implement task
349
350
      headers: [
        {
68d742034   Neeraj Sharma   implement new des...
351
          align: "",
006544386   Neeraj Sharma   implement task
352
353
          text: "No",
          sortable: false,
ba420d0d1   Shikha Mishra   Solve add subject...
354
          value: "No",
006544386   Neeraj Sharma   implement task
355
356
357
358
359
        },
        {
          text: "Profile Pic",
          vaue: "profilePicUrl",
          sortable: false,
ba420d0d1   Shikha Mishra   Solve add subject...
360
          align: "center",
006544386   Neeraj Sharma   implement task
361
362
363
364
365
        },
        {
          text: "Name",
          vaue: "name",
          sortable: false,
ba420d0d1   Shikha Mishra   Solve add subject...
366
          align: "center",
006544386   Neeraj Sharma   implement task
367
368
369
370
371
        },
        {
          text: "Roll No.",
          value: "rollNo",
          sortable: false,
ba420d0d1   Shikha Mishra   Solve add subject...
372
          align: "center",
006544386   Neeraj Sharma   implement task
373
374
375
376
377
        },
        {
          text: "Email",
          value: "email",
          sortable: false,
ba420d0d1   Shikha Mishra   Solve add subject...
378
          align: "center",
79583580d   Neeraj Sharma   implement task ma...
379
380
381
382
383
        },
        {
          text: "Class",
          value: "classId",
          sortable: false,
ba420d0d1   Shikha Mishra   Solve add subject...
384
          align: "center",
79583580d   Neeraj Sharma   implement task ma...
385
386
387
388
389
        },
        {
          text: "Section",
          value: "sectionId",
          sortable: false,
ba420d0d1   Shikha Mishra   Solve add subject...
390
391
          align: "center",
        },
006544386   Neeraj Sharma   implement task
392
393
394
      ],
      classList: [],
      report: {},
96f88269a   Neeraj Sharma   implement Student...
395
      userData: {},
006544386   Neeraj Sharma   implement task
396
397
398
399
      markData: [],
      formList: [
        {
          name: "Blood Group",
ba420d0d1   Shikha Mishra   Solve add subject...
400
          value: "bloodGroup",
006544386   Neeraj Sharma   implement task
401
402
403
404
        },
        "Country",
        "Gender",
        "Transport",
ba420d0d1   Shikha Mishra   Solve add subject...
405
        "Hostel",
006544386   Neeraj Sharma   implement task
406
407
408
409
410
411
412
413
414
415
        //   "Birthday"
      ],
      bloodGroupList: ["A+", "A-", "B+", "B-", "O+", "O-", "AB+", "AB-"],
      gender: ["Male", "female"],
      getStudentsReportList: [],
      studentReort: "",
      countryList: [],
      route: [],
      Hostel: [],
      hostelList: [],
ba420d0d1   Shikha Mishra   Solve add subject...
416
      token: "",
006544386   Neeraj Sharma   implement task
417
418
419
420
    }),
    methods: {
      clear() {
        this.$refs.form.reset();
006544386   Neeraj Sharma   implement task
421
422
      },
      getClass() {
ec5677f43   Neeraj Sharma   implement print o...
423
        this.showLoader = true;
006544386   Neeraj Sharma   implement task
424
425
        http()
          .get("/getClassesList", {
ba420d0d1   Shikha Mishra   Solve add subject...
426
            headers: { Authorization: "Bearer " + this.token },
006544386   Neeraj Sharma   implement task
427
          })
ba420d0d1   Shikha Mishra   Solve add subject...
428
          .then((response) => {
006544386   Neeraj Sharma   implement task
429
            this.classList = response.data.data;
ec5677f43   Neeraj Sharma   implement print o...
430
            this.showLoader = false;
006544386   Neeraj Sharma   implement task
431
          })
ba420d0d1   Shikha Mishra   Solve add subject...
432
          .catch((err) => {
ec5677f43   Neeraj Sharma   implement print o...
433
            this.showLoader = false;
00e4bc4e1   Neeraj Sharma   fixed auntentication
434
435
436
437
438
439
            if (error.response.status === 401) {
              this.$router.replace({ path: "/" });
              this.$store.dispatch("setToken", null);
              this.$store.dispatch("Id", null);
              this.$store.dispatch("Role", null);
            }
006544386   Neeraj Sharma   implement task
440
441
442
443
444
445
446
447
448
449
          });
      },
      getReport() {
        if (this.report.form === "bloodGroup") {
          this.bloodGroup = true;
          this.genderShow = false;
          this.TransportShow = false;
          this.countryShow = false;
          this.BirthdayShow = false;
          this.HostelShow = false;
79583580d   Neeraj Sharma   implement task ma...
450
451
          this.classShow = false;
          this.sectionShow = false;
006544386   Neeraj Sharma   implement task
452
453
454
455
456
457
458
459
        }
        if (this.report.form === "Gender") {
          this.genderShow = true;
          this.bloodGroup = false;
          this.TransportShow = false;
          this.BirthdayShow = false;
          this.countryShow = false;
          this.HostelShow = false;
79583580d   Neeraj Sharma   implement task ma...
460
          this.classShow = true;
006544386   Neeraj Sharma   implement task
461
462
463
464
465
466
467
468
        }
        if (this.report.form === "Transport") {
          this.TransportShow = true;
          this.genderShow = false;
          this.bloodGroup = false;
          this.BirthdayShow = false;
          this.countryShow = false;
          this.HostelShow = false;
79583580d   Neeraj Sharma   implement task ma...
469
          this.classShow = true;
006544386   Neeraj Sharma   implement task
470
471
472
473
474
475
476
477
        }
        if (this.report.form === "Country") {
          this.countryShow = true;
          this.TransportShow = false;
          this.genderShow = false;
          this.bloodGroup = false;
          this.BirthdayShow = false;
          this.HostelShow = false;
79583580d   Neeraj Sharma   implement task ma...
478
          this.classShow = true;
006544386   Neeraj Sharma   implement task
479
480
481
482
483
484
485
486
        }
        if (this.report.form === "Hostel") {
          this.HostelShow = true;
          this.TransportShow = false;
          this.genderShow = false;
          this.bloodGroup = false;
          this.countryShow = false;
          this.BirthdayShow = false;
79583580d   Neeraj Sharma   implement task ma...
487
          this.classShow = true;
006544386   Neeraj Sharma   implement task
488
489
490
491
492
493
494
495
        }
        if (this.report.form === "Birthday") {
          this.BirthdayShow = true;
          this.TransportShow = false;
          this.genderShow = false;
          this.HostelShow = false;
          this.bloodGroup = false;
          this.countryShow = false;
79583580d   Neeraj Sharma   implement task ma...
496
          this.classShow = true;
006544386   Neeraj Sharma   implement task
497
498
499
500
501
        }
      },
      getStudents() {
        if (this.$refs.form.validate()) {
          this.showLoader = true;
006544386   Neeraj Sharma   implement task
502
503
504
505
506
507
508
          http()
            .get("/getStudentReport", {
              params: {
                bloodGroup: this.report.bloodGroup,
                country: this.report.country,
                gender: this.report.gender,
                classId: this.report.classId,
ba420d0d1   Shikha Mishra   Solve add subject...
509
                sectionId: this.report.sectionId,
006544386   Neeraj Sharma   implement task
510
              },
ba420d0d1   Shikha Mishra   Solve add subject...
511
              headers: { Authorization: "Bearer " + this.token },
006544386   Neeraj Sharma   implement task
512
            })
ba420d0d1   Shikha Mishra   Solve add subject...
513
            .then((response) => {
006544386   Neeraj Sharma   implement task
514
515
516
517
518
519
              this.getStudentsReportList = response.data.data;
              this.showTable = true;
              this.showLoader = false;
              this.clear();
              // console.log("getSectionsList=====>", response.data.data);
            })
ba420d0d1   Shikha Mishra   Solve add subject...
520
521
            .catch((error) => {
              // console.log("err====>", error);
006544386   Neeraj Sharma   implement task
522
              this.showLoader = false;
ba420d0d1   Shikha Mishra   Solve add subject...
523
524
525
              this.snackbar = true;
              this.color = "error";
              this.text = error.response.data.message;
006544386   Neeraj Sharma   implement task
526
527
528
529
530
531
532
533
534
535
536
            });
        }
      },
      getSections() {
        this.sectionShow = true;
        this.showLoader = true;
        http()
          .get(
            "/getSectionsList",
            { params: { classId: this.report.classId } },
            {
ba420d0d1   Shikha Mishra   Solve add subject...
537
              headers: { Authorization: "Bearer " + this.token },
006544386   Neeraj Sharma   implement task
538
539
            }
          )
ba420d0d1   Shikha Mishra   Solve add subject...
540
          .then((response) => {
006544386   Neeraj Sharma   implement task
541
542
543
            this.addSection = response.data.data;
            this.showLoader = false;
          })
ba420d0d1   Shikha Mishra   Solve add subject...
544
545
          .catch((error) => {
            //   console.log("err====>", error);
006544386   Neeraj Sharma   implement task
546
            this.showLoader = false;
ba420d0d1   Shikha Mishra   Solve add subject...
547
548
549
            this.snackbar = true;
            this.color = "error";
            this.text = error.response.data.message;
006544386   Neeraj Sharma   implement task
550
          });
96f88269a   Neeraj Sharma   implement Student...
551
      },
006544386   Neeraj Sharma   implement task
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
      //     getFormList() {
      //       this.showLoader = true;
      //       http()
      //         .get("/getExamsList", {
      //           headers: { Authorization: "Bearer " + this.token }
      //         })
      //         .then(response => {
      //           this.formList = response.data.data;
      //           this.showLoader = false;
      //         })
      //         .catch(error => {
      //           // console.log("err====>", err);
      //           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);
      //           }
      //         });
      //     }
96f88269a   Neeraj Sharma   implement Student...
574
575
576
577
578
579
      printStudentReport() {
        this.$htmlToPaper("printMe");
      },
      getUserData() {
        http()
          .get("/getParticularUserDetail")
ba420d0d1   Shikha Mishra   Solve add subject...
580
          .then((response) => {
96f88269a   Neeraj Sharma   implement Student...
581
582
            this.userData = response.data.data;
          })
ba420d0d1   Shikha Mishra   Solve add subject...
583
          .catch((error) => {
25205ccca   Shikha Mishra   show school logo ...
584
585
586
587
588
            // if (error.response.status === 401) {
            //   this.$router.replace({ path: "/" });
            //   this.$store.dispatch("setToken", null);
            //   this.$store.dispatch("Id", null);
            // }
96f88269a   Neeraj Sharma   implement Student...
589
          });
ba420d0d1   Shikha Mishra   Solve add subject...
590
      },
006544386   Neeraj Sharma   implement task
591
592
593
    },
    mounted() {
      this.token = this.$store.state.token;
495e4037c   Neeraj Sharma   update
594
595
      const getCountryList = countryList();
      this.countryList = getCountryList;
96f88269a   Neeraj Sharma   implement Student...
596
      this.getUserData();
006544386   Neeraj Sharma   implement task
597
598
599
600
601
      // console.log("getindustryList", this.countryList);
      // this.getExamList();
      this.getClass();
    },
    created() {
ba420d0d1   Shikha Mishra   Solve add subject...
602
      this.$root.$on("app:search", (search) => {
006544386   Neeraj Sharma   implement task
603
604
605
606
607
608
        this.search = search;
      });
    },
    beforeDestroy() {
      // dont forget to remove the listener
      this.$root.$off("app:search");
ba420d0d1   Shikha Mishra   Solve add subject...
609
    },
006544386   Neeraj Sharma   implement task
610
611
612
613
614
615
616
617
618
619
  };
  </script>
  <style scoped>
  .active {
    background-color: gray;
    color: white !important;
  }
  .activebtn {
    color: black !important;
  }
819c223ec   Shikha Mishra   improve school an...
620
  </style>