Blame view

src/pages/Teachers/teachers.vue 46.7 KB
93a68cfa1   Jatinder Singh   first commit
1
  <template>
68d742034   Neeraj Sharma   implement new des...
2
3
    <v-container fluid class="body-color">
      <!-- ****** EDIT TEACHERS DETAILS ****** -->
db965de89   Amber Dev   added dialog pers...
4
      <v-dialog v-model="editTeacherDialog" max-width="1160px" scrollable persistent>
68d742034   Neeraj Sharma   implement new des...
5
6
7
8
        <v-card flat class="card-style" dark>
          <v-card-text>
            <v-layout>
              <v-flex xs12>
c8fc8e42e   Shikha Mishra   solved issues
9
                <label class="title text-xs-center">Edit Teacher Details</label>
68d742034   Neeraj Sharma   implement new des...
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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
81
82
83
84
85
86
87
88
89
90
91
                <v-icon size="24" class="right" @click="editTeacherDialog = false">cancel</v-icon>
              </v-flex>
            </v-layout>
            <v-container fluid>
              <v-layout>
                <v-flex xs12 class="text-xs-center text-sm-center text-md-center text-lg-center my-4">
                  <v-avatar size="100px" v-if="!editedItem.profilePicUrl && !imageUrl">
                    <img src="/static/icon/user.png" />
                  </v-avatar>
                  <img
                    :src="editedItem.profilePicUrl"
                    v-else-if="editedItem.profilePicUrl && !imageUrl"
                    height="150"
                    style="border-radius:50%; width:150px"
                  />
                  <img
                    v-if="imageUrl"
                    :src="imageUrl"
                    height="150"
                    style="border-radius:50%; width:150px"
                  />
                  <input
                    type="file"
                    style="display:none"
                    ref="image"
                    accept="image/*"
                    @change="onFilePicked"
                  />
                </v-flex>
              </v-layout>
              <v-layout wrap>
                <v-flex xs12 sm6>
                  <v-layout>
                    <v-flex xs4 class="pt-4 subheading">
                      <label class="right hidden-xs-only hidden-sm-only">Full Name:</label>
                      <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Name:</label>
                    </v-flex>
                    <v-flex xs8 class="ml-3">
                      <v-text-field
                        v-model="editedItem.name"
                        placeholder="fill your full Name"
                        type="text"
                        required
                      ></v-text-field>
                    </v-flex>
                  </v-layout>
                </v-flex>
                <v-flex xs12 sm6>
                  <v-layout>
                    <v-flex xs4 sm4 class="pt-4 subheading">
                      <label class="right">Email ID:</label>
                    </v-flex>
                    <v-flex xs8 sm8 class="ml-3">
                      <v-text-field
                        placeholder="fill your email"
                        v-model="editedItem.email"
                        type="text"
                        required
                      ></v-text-field>
                    </v-flex>
                  </v-layout>
                </v-flex>
              </v-layout>
              <v-layout wrap>
                <v-flex xs12 sm6>
                  <v-layout>
                    <v-flex xs4 class="pt-4 subheading">
                      <label class="right hidden-sm-only hidden-xs-only">Date of Birth:</label>
                      <label class="right hidden-lg-only hidden-xl-only hidden-md-only">D.O.B:</label>
                    </v-flex>
                    <v-flex xs8 class="ml-3">
                      <v-menu
                        ref="menu"
                        :close-on-content-click="false"
                        v-model="menu2"
                        :nudge-right="40"
                        lazy
                        transition="scale-transition"
                        offset-y
                        full-width
                        min-width="290px"
                      >
f4df757fe   Neeraj Sharma   responsive vie in...
92
                        <v-text-field
68d742034   Neeraj Sharma   implement new des...
93
94
95
                          slot="activator"
                          v-model="editedItem.dob"
                          placeholder="Select date"
f4df757fe   Neeraj Sharma   responsive vie in...
96
                        ></v-text-field>
68d742034   Neeraj Sharma   implement new des...
97
98
99
100
101
102
103
104
105
106
107
108
109
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
                        <v-date-picker
                          ref="picker"
                          v-model="editedItem.dob"
                          :max="new Date().toISOString().substr(0, 10)"
                          min="1950-01-01"
                          @input="menu2 = false"
                        ></v-date-picker>
                      </v-menu>
                    </v-flex>
                  </v-layout>
                </v-flex>
                <v-flex xs12 sm6>
                  <v-layout>
                    <v-flex xs4 class="pt-4 subheading">
                      <label class="right">City:</label>
                    </v-flex>
                    <v-flex xs8 class="ml-3">
                      <v-text-field
                        v-model="editedItem.city"
                        placeholder="fill your City Name"
                        type="text"
                        required
                      ></v-text-field>
                    </v-flex>
                  </v-layout>
                </v-flex>
              </v-layout>
              <v-layout wrap>
                <v-flex xs12 sm6>
                  <v-layout>
                    <v-flex xs4 class="pt-4 subheading">
                      <label class="right">State:</label>
                    </v-flex>
                    <v-flex xs8 class="ml-3">
                      <v-text-field
                        v-model="editedItem.state"
                        placeholder="fill your State Name"
                        type="text"
                        required
                      ></v-text-field>
                    </v-flex>
                  </v-layout>
                </v-flex>
                <v-flex xs12 sm6>
                  <v-layout>
                    <v-flex xs4 class="pt-4 subheading">
                      <label class="right">PinCode:</label>
                    </v-flex>
                    <v-flex xs8 class="ml-3">
                      <v-text-field
                        v-model="editedItem.pincode"
                        placeholder="fill your pincode"
                        type="number"
                        required
                      ></v-text-field>
                    </v-flex>
                  </v-layout>
                </v-flex>
              </v-layout>
              <v-layout wrap>
c29ba4fbb   Amber Dev   added country codes
157
                <!-- EDIT DETAILS MOBILE NUMBER -->
68d742034   Neeraj Sharma   implement new des...
158
159
160
161
162
163
164
                <v-flex xs12 sm6>
                  <v-layout>
                    <v-flex xs4 class="pt-4 subheading">
                      <label class="right hidden-xs-only hidden-sm-only">Mobile No:</label>
                      <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Mobile:</label>
                    </v-flex>
                    <v-flex xs8 class="ml-3">
c29ba4fbb   Amber Dev   added country codes
165
166
167
168
169
170
171
172
173
174
175
176
177
                      <v-layout row wrap>
                        <v-flex xs3 class="mt-3">
                          <vue-country-code @onSelect="editMobileCode" class="black--text"></vue-country-code>
                        </v-flex>
                        <v-flex xs9>
                          <v-text-field
                            v-model="editedItem.mobileNo"
                            placeholder="Fill MobileNo"
                            type="number"
                            required
                          ></v-text-field>
                        </v-flex>
                      </v-layout>
68d742034   Neeraj Sharma   implement new des...
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
                    </v-flex>
                  </v-layout>
                </v-flex>
                <v-flex xs12 sm6>
                  <v-layout>
                    <v-flex xs4 class="pt-4 subheading">
                      <label class="right hidden-xs-only hidden-sm-only">Select Country:</label>
                      <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Country:</label>
                    </v-flex>
                    <v-flex xs8 sm8 class="ml-3">
                      <v-autocomplete
                        v-model="editedItem.country"
                        :items="countries"
                        placeholder="Select Country Name"
                        required
                      ></v-autocomplete>
                    </v-flex>
                  </v-layout>
                </v-flex>
              </v-layout>
              <v-layout wrap>
                <v-flex xs12 sm6>
                  <v-layout>
                    <v-flex xs4 class="pt-4 subheading">
                      <label class="right">Join Date:</label>
                    </v-flex>
                    <v-flex xs8 sm8 class="ml-3">
                      <v-menu
                        ref="menu"
                        :close-on-content-click="false"
                        v-model="menu3"
                        :nudge-right="40"
                        lazy
                        transition="scale-transition"
                        offset-y
                        full-width
                        min-width="290px"
                      >
f4df757fe   Neeraj Sharma   responsive vie in...
216
                        <v-text-field
68d742034   Neeraj Sharma   implement new des...
217
218
219
                          slot="activator"
                          v-model="editedItem.joinDate"
                          placeholder="Select date"
f4df757fe   Neeraj Sharma   responsive vie in...
220
                        ></v-text-field>
68d742034   Neeraj Sharma   implement new des...
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
249
250
251
252
253
254
255
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
306
307
308
309
310
311
312
313
314
315
316
317
318
                        <v-date-picker
                          ref="picker"
                          v-model="editedItem.joinDate"
                          :max="new Date().toISOString().substr(0, 10)"
                          min="1950-01-01"
                          @input="menu3 = false"
                        ></v-date-picker>
                      </v-menu>
                    </v-flex>
                  </v-layout>
                </v-flex>
                <v-flex xs12 sm6>
                  <v-layout>
                    <v-flex xs4 class="pt-4 subheading">
                      <label class="right hidden-xs-only hidden-sm-only">Uplaod Image:</label>
                      <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Uplaod :</label>
                    </v-flex>
                    <v-flex xs8 sm8 class="ml-3">
                      <v-text-field
                        label="Select Image"
                        @click="pickFile"
                        v-model="imageName"
                        append-icon="attach_file"
                      ></v-text-field>
                    </v-flex>
                  </v-layout>
                </v-flex>
              </v-layout>
              <v-layout class="hidden-xs-only hidden-sm-only" wrap>
                <v-flex xs12 sm6>
                  <v-layout>
                    <v-flex xs4 sm4 class="pt-4 subheading">
                      <label class="right">Present Address:</label>
                    </v-flex>
                    <v-flex xs8 sm8 class="ml-3">
                      <v-text-field
                        name="input-4-3"
                        v-model="editedItem.presentAddress"
                        placeholder="fill Your present Address"
                        required
                      ></v-text-field>
                    </v-flex>
                  </v-layout>
                </v-flex>
                <v-flex xs12 sm6>
                  <v-layout>
                    <v-flex xs4 sm4 class="pt-4 subheading">
                      <label class="right">Permanent Address:</label>
                    </v-flex>
                    <v-flex xs12 sm8 class="ml-3">
                      <v-text-field
                        name="input-4-3"
                        v-model="editedItem.permanentAddress"
                        placeholder="fill Your Permanent Address"
                        required
                      ></v-text-field>
                    </v-flex>
                  </v-layout>
                </v-flex>
              </v-layout>
              <v-layout class="hidden-lg-only hidden-md-only hidden-xl-only" wrap>
                <v-flex xs12 sm12>
                  <v-layout>
                    <v-flex xs12 sm3 class="pt-4 subheading text-xs-center">
                      <label class>Present Address:</label>
                    </v-flex>
                  </v-layout>
                  <v-layout>
                    <v-flex xs12 sm12>
                      <v-textarea
                        name="input-4-3"
                        v-model="editedItem.presentAddress"
                        placeholder="fill Your present Address"
                        required
                      ></v-textarea>
                    </v-flex>
                  </v-layout>
                </v-flex>
                <v-flex xs12 sm12>
                  <v-layout>
                    <v-flex xs12 sm3 class="pt-4 pr-4 subheading text-xs-center addressForm">
                      <label>Permanent Address:</label>
                    </v-flex>
                  </v-layout>
                  <v-layout>
                    <v-flex xs12 sm12>
                      <v-textarea
                        name="input-4-3"
                        v-model="editedItem.permanentAddress"
                        placeholder="fill Your Permanent Address"
                        required
                      ></v-textarea>
                    </v-flex>
                  </v-layout>
                </v-flex>
              </v-layout>
              <v-layout>
                <v-flex xs12 sm12>
f4df757fe   Neeraj Sharma   responsive vie in...
319
                  <v-flex xs12 sm12>
68d742034   Neeraj Sharma   implement new des...
320
321
                    <v-layout class="right">
                      <v-btn @click="save" round dark :loading="loading" class="add-button">Save</v-btn>
f4df757fe   Neeraj Sharma   responsive vie in...
322
323
                    </v-layout>
                  </v-flex>
68d742034   Neeraj Sharma   implement new des...
324
325
326
327
328
329
                </v-flex>
              </v-layout>
            </v-container>
          </v-card-text>
        </v-card>
      </v-dialog>
6b6e4e83d   Neeraj Sharma   design modified i...
330

68d742034   Neeraj Sharma   implement new des...
331
      <!-- ****** PROFILE VIEW TEACHERS DETAILS ******  -->
6b6e4e83d   Neeraj Sharma   design modified i...
332

ba420d0d1   Shikha Mishra   Solve add subject...
333
      <v-dialog v-model="viewTeacherProfileDialog" max-width="500px" persistent>
68d742034   Neeraj Sharma   implement new des...
334
335
336
        <v-card flat class="card-style pa-3" dark>
          <v-layout>
            <v-flex xs12>
8c3acf4a9   Shikha Mishra   improve details
337
              <label class="title text-xs-center">View Teacher</label>
68d742034   Neeraj Sharma   implement new des...
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
              <v-icon size="24" class="right" @click="viewTeacherProfileDialog = false">cancel</v-icon>
            </v-flex>
          </v-layout>
          <v-card-text>
            <v-container grid-list-md>
              <v-layout wrap>
                <v-flex>
                  <v-flex align-center justify-center layout text-xs-center>
                    <v-avatar size="80">
                      <img src="/static/icon/user.png" v-if="!editedItem.profilePicUrl" />
                      <img :src="editedItem.profilePicUrl" v-else-if="editedItem.profilePicUrl" />
                    </v-avatar>
                  </v-flex>
                  <v-layout>
                    <v-flex xs5 sm6>
                      <h5 class="right my-1">
                        <b>Full Name:</b>
                      </h5>
                    </v-flex>
                    <v-flex sm6 xs8>
                      <h5 class="my-1">{{ editedItem.name }}</h5>
6b6e4e83d   Neeraj Sharma   design modified i...
359
360
                    </v-flex>
                  </v-layout>
68d742034   Neeraj Sharma   implement new des...
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
                  <v-layout>
                    <v-flex xs5 sm6>
                      <h5 class="right my-1">
                        <b>Email:</b>
                      </h5>
                    </v-flex>
                    <v-flex sm6 xs8>
                      <h5 class="my-1">{{ editedItem.email }}</h5>
                    </v-flex>
                  </v-layout>
                  <v-layout>
                    <v-flex xs5 sm6>
                      <h5 class="right my-1">
                        <b>City:</b>
                      </h5>
                    </v-flex>
                    <v-flex sm6 xs8>
                      <h5 class="my-1">{{ editedItem.city }}</h5>
                    </v-flex>
                  </v-layout>
                  <v-layout>
                    <v-flex xs5 sm6>
                      <h5 class="right my-1">
                        <b>State:</b>
                      </h5>
                    </v-flex>
                    <v-flex sm6 xs8>
                      <h5 class="my-1">{{ editedItem.state }}</h5>
                    </v-flex>
                  </v-layout>
                  <v-layout>
                    <v-flex xs5 sm6>
                      <h5 class="right my-1">
                        <b>Country:</b>
                      </h5>
                    </v-flex>
                    <v-flex sm6 xs8>
                      <h5 class="my-1">{{ editedItem.country }}</h5>
                    </v-flex>
                  </v-layout>
                  <v-layout>
                    <v-flex xs5 sm6>
                      <h5 class="right my-1">
                        <b>Pincode:</b>
                      </h5>
                    </v-flex>
                    <v-flex sm6 xs8>
                      <h5 class="my-1">{{ editedItem.pincode }}</h5>
                    </v-flex>
                  </v-layout>
                  <v-layout>
                    <v-flex xs5 sm6>
                      <h5 class="right my-1">
                        <b>Mobile No:</b>
                      </h5>
                    </v-flex>
                    <v-flex sm6 xs8>
                      <h5 class="my-1">{{ editedItem.mobileNo }}</h5>
                    </v-flex>
                  </v-layout>
                  <v-layout>
                    <v-flex xs5 sm6>
                      <h5 class="right my-1">
                        <b>Join Date:</b>
                      </h5>
                    </v-flex>
                    <v-flex sm6 xs8>
                      <h5 class="my-1">{{ dates(editedItem.joinDate) }}</h5>
                    </v-flex>
                  </v-layout>
                  <v-layout>
                    <v-flex xs5 sm6>
                      <h5 class="right my-1">
                        <b>D.O.B :</b>
                      </h5>
                    </v-flex>
                    <v-flex sm6 xs8>
                      <h5 class="my-1">{{ dates(editedItem.dob) }}</h5>
                    </v-flex>
                  </v-layout>
                  <v-layout>
                    <v-flex xs6 sm6>
                      <h5 class="right my-1">
                        <b>Permanent Address:</b>
                      </h5>
                    </v-flex>
                    <v-flex sm6 xs8>
                      <h5 class="my-1">{{ editedItem.permanentAddress }}</h5>
                    </v-flex>
                  </v-layout>
                  <v-layout>
                    <v-flex xs6 sm6>
                      <h5 class="right my-1">
                        <b>present Address:</b>
                      </h5>
                    </v-flex>
                    <v-flex sm6 xs8>
                      <h5 class="my-1">{{ editedItem.presentAddress }}</h5>
                    </v-flex>
                  </v-layout>
                </v-flex>
              </v-layout>
            </v-container>
          </v-card-text>
        </v-card>
      </v-dialog>
      <!-- ****** EXISTING-Teachers TABLE DATA****** -->
      <v-toolbar color="transparent" flat>
        <v-btn
          fab
          dark
          class="open-dialog-button hidden-xl-only hidden-md-only hidden-lg-only"
          small
          @click="addTeacherDialog = true"
        >
          <v-icon dark>add</v-icon>
        </v-btn>
        <v-btn
710438de6   Shikha Mishra   added teacher mod...
479
          v-if="role != 'TEACHER' "
68d742034   Neeraj Sharma   implement new des...
480
481
482
483
484
485
486
487
488
489
490
          round
          class="open-dialog-button hidden-sm-only hidden-xs-only"
          dark
          @click="addTeacherDialog = true"
        >
          <v-icon class="white--text pr-1" size="20">add</v-icon>Add Teacher
        </v-btn>
        <v-spacer></v-spacer>
        <v-card-title class="body-1" v-show="show">
          <v-btn icon large flat @click="displaySearch">
            <v-avatar size="27">
aa310d61a   Shikha Mishra   added functionali...
491
              <img src="/static/icon/search.png" alt="icon" />
68d742034   Neeraj Sharma   implement new des...
492
493
494
            </v-avatar>
          </v-btn>
        </v-card-title>
612b79bb4   Amber Dev   made serch auto f...
495
        <v-flex md2 lg2 sm6 xs8 v-if="showSearch">
68d742034   Neeraj Sharma   implement new des...
496
          <v-layout>
8e8d14254   Shikha Mishra   Cleared data whil...
497
498
499
500
501
502
503
            <v-text-field
              autofocus
              v-model="search"
              label="Search"
              prepend-inner-icon="search"
              color="primary"
            ></v-text-field>
68d742034   Neeraj Sharma   implement new des...
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
            <v-icon @click="closeSearch" color="error">close</v-icon>
          </v-layout>
        </v-flex>
      </v-toolbar>
      <v-data-table
        :headers="headers"
        :items="desserts"
        :pagination.sync="pagination"
        :search="search"
      >
        <template slot="items" slot-scope="props">
          <tr class="tr">
            <td class="td td-row">{{ props.index + 1}}</td>
            <td class="td td-row text-xs-center">
              <v-avatar size="40">
                <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.email }}</td>
            <td class="td td-row text-xs-center">{{ dates(props.item.dob) }}</td>
            <td class="td td-row text-xs-center">{{ dates(props.item.joinDate)}}</td>
            <td class="td td-row text-xs-center">{{ props.item.mobileNo }}</td>
            <td class="td td-row text-xs-center">
              <v-switch
                class="pl-3"
                v-model="props.item.status"
                @change="suspendStatus(props.item.status,props.item._id)"
              ></v-switch>
            </td>
            <td class="text-xs-center td td-row">
              <span>
                <v-tooltip top>
                  <img
                    slot="activator"
                    style="cursor:pointer; width:25px; height:25px; "
                    class="mr-3"
                    @click="profile(props.item)"
aa310d61a   Shikha Mishra   added functionali...
543
                    src="/static/icon/view.png"
68d742034   Neeraj Sharma   implement new des...
544
545
546
                  />
                  <span>View</span>
                </v-tooltip>
710438de6   Shikha Mishra   added teacher mod...
547
                <v-tooltip top v-if="role != 'TEACHER' ">
68d742034   Neeraj Sharma   implement new des...
548
549
550
551
552
                  <img
                    slot="activator"
                    style="cursor:pointer; width:20px; height:18px; "
                    class="mr-3"
                    @click="editItem(props.item)"
aa310d61a   Shikha Mishra   added functionali...
553
                    src="/static/icon/edit.png"
68d742034   Neeraj Sharma   implement new des...
554
555
556
                  />
                  <span>Edit</span>
                </v-tooltip>
5d5315b0f   Shikha Mishra   close add-notific...
557
                <!-- <v-tooltip top v-if="role != 'TEACHER' ">
68d742034   Neeraj Sharma   implement new des...
558
559
560
561
                  <img
                    slot="activator"
                    style="cursor:pointer; width:20px; height:20px; "
                    @click="deleteItem(props.item)"
aa310d61a   Shikha Mishra   added functionali...
562
                    src="/static/icon/delete.png"
68d742034   Neeraj Sharma   implement new des...
563
564
565
                    class="mr-3"
                  />
                  <span>Delete</span>
8e8d14254   Shikha Mishra   Cleared data whil...
566
                </v-tooltip>-->
68d742034   Neeraj Sharma   implement new des...
567
568
569
570
571
572
573
574
575
576
577
              </span>
            </td>
          </tr>
        </template>
        <v-alert
          slot="no-results"
          :value="true"
          color="error"
          icon="warning"
        >Your search for "{{ search }}" found no results.</v-alert>
      </v-data-table>
1c1942362   Neeraj Sharma   commit code Schoo...
578

7efe02762   Amber Dev   made forms reset
579
      <!-- ****** DIALOG BOX - Add Teachers Data****** -->
db965de89   Amber Dev   added dialog pers...
580
      <v-dialog v-model="addTeacherDialog" max-width="1160" v-if="addTeacherDialog" persistent>
68d742034   Neeraj Sharma   implement new des...
581
582
583
584
        <v-card flat class="card-style pa-2" dark>
          <v-layout>
            <v-flex xs12 class="pa-0">
              <label class="title text-xs-center">Add Teacher</label>
8e8d14254   Shikha Mishra   Cleared data whil...
585
586
587
588
589
              <v-icon
                size="24"
                class="right"
                @click="$refs.form.reset();addTeacherDialog = false"
              >cancel</v-icon>
6b6e4e83d   Neeraj Sharma   design modified i...
590
            </v-flex>
68d742034   Neeraj Sharma   implement new des...
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
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
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
          </v-layout>
          <v-form ref="form" v-model="valid" lazy-validation>
            <v-container fluid>
              <v-layout>
                <v-flex xs12 class="text-xs-center text-sm-center text-md-center text-lg-center my-4">
                  <v-avatar size="120px">
                    <img src="/static/icon/user.png" v-if="!imageUrl" />
                  </v-avatar>
                  <img
                    :src="imageUrl"
                    height="150"
                    v-if="imageUrl"
                    style="border-radius:50%; width:150px"
                  />
                </v-flex>
              </v-layout>
              <v-layout wrap>
                <v-flex xs12 sm6>
                  <v-layout>
                    <v-flex xs4 class="pt-4 subheading">
                      <label class="right hidden-sm-only hidden-xs-only">Full Name:</label>
                      <label class="right hidden-lg-only hidden-xl-only hidden-md-only">Full Name</label>
                    </v-flex>
                    <v-flex xs8 class="ml-3">
                      <v-text-field
                        v-model="addTeachers.name"
                        placeholder="fill your full Name"
                        name="name"
                        type="text"
                        :rules="nameRules"
                        required
                      ></v-text-field>
                    </v-flex>
                  </v-layout>
                </v-flex>
                <v-flex xs12 sm6>
                  <v-layout>
                    <v-flex xs4 class="pt-4 subheading">
                      <label class="right">Email ID:</label>
                    </v-flex>
                    <v-flex xs8 class="ml-3">
                      <v-text-field
                        placeholder="fill your email"
                        v-model="addTeachers.email"
                        type="text"
                        name="email"
                        required
                      ></v-text-field>
                    </v-flex>
                  </v-layout>
                </v-flex>
              </v-layout>
              <v-layout wrap>
                <v-flex xs12 sm6>
                  <v-layout>
                    <v-flex xs4 sm4 class="pt-4 subheading">
                      <label class="right hidden-sm-only hidden-xs-only">Date of Birth:</label>
                      <label class="right hidden-lg-only hidden-xl-only hidden-md-only">D.O.B:</label>
                    </v-flex>
                    <v-flex xs8 class="ml-3">
                      <v-menu
                        ref="menu"
                        :close-on-content-click="false"
                        v-model="menu"
                        :nudge-right="40"
                        lazy
                        transition="scale-transition"
                        offset-y
                        full-width
                        min-width="290px"
                      >
                        <v-text-field
                          slot="activator"
                          :rules="dateRules"
                          v-model="addTeachers.date"
                          placeholder="Select date"
                        ></v-text-field>
                        <v-date-picker
                          ref="picker"
                          v-model="addTeachers.date"
                          :max="new Date().toISOString().substr(0, 10)"
                          min="1950-01-01"
                          @input="menu = false"
                        ></v-date-picker>
                      </v-menu>
                    </v-flex>
                  </v-layout>
                </v-flex>
                <v-flex xs12 sm6>
                  <v-layout>
                    <v-flex xs4 class="pt-4 subheading">
                      <label class="right">City:</label>
                    </v-flex>
                    <v-flex xs8 class="ml-3">
                      <v-text-field
                        v-model="addTeachers.city"
                        placeholder="fill your City Name"
                        name="City"
                        type="text"
                        :rules="cityRules"
                        required
                      ></v-text-field>
                    </v-flex>
                  </v-layout>
                </v-flex>
              </v-layout>
              <v-layout wrap>
                <v-flex xs12 sm6>
                  <v-layout>
                    <v-flex xs4 class="pt-4 subheading">
                      <label class="right">State:</label>
                    </v-flex>
                    <v-flex xs8 class="ml-3">
                      <v-text-field
                        v-model="addTeachers.state"
                        placeholder="fill your State Name"
                        name="state"
                        type="text"
                        :rules="stateRules"
                        required
                      ></v-text-field>
                    </v-flex>
                  </v-layout>
                </v-flex>
                <v-flex xs12 sm6>
                  <v-layout>
                    <v-flex xs4 class="pt-4 subheading">
                      <label class="right">PinCode:</label>
                    </v-flex>
                    <v-flex xs8 class="ml-3">
                      <v-text-field
                        v-model="addTeachers.pincode"
                        placeholder="fill your pincode"
                        name="pincode"
                        type="number"
                        :rules="pincode"
                        required
                      ></v-text-field>
                    </v-flex>
                  </v-layout>
                </v-flex>
              </v-layout>
c29ba4fbb   Amber Dev   added country codes
733
              <!-- ADD TEACHER MOBILE -->
68d742034   Neeraj Sharma   implement new des...
734
735
736
737
738
739
740
741
              <v-layout wrap>
                <v-flex xs12 sm6>
                  <v-layout>
                    <v-flex xs4 class="pt-4 subheading">
                      <label class="right hidden-xs-only hidden-sm-only">Mobile No:</label>
                      <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Mobile:</label>
                    </v-flex>
                    <v-flex xs8 class="ml-3">
0a7184bf8   Amber Dev   added internation...
742
743
                      <v-layout row wrap>
                        <v-flex xs3 class="mt-3">
c29ba4fbb   Amber Dev   added country codes
744
                          <vue-country-code @onSelect="addTeacherMobileCode" class="black--text"></vue-country-code>
0a7184bf8   Amber Dev   added internation...
745
746
747
748
749
750
751
752
753
754
755
756
                        </v-flex>
                        <v-flex xs9>
                          <v-text-field
                            v-model="addTeachers.mobileNo"
                            placeholder="Fill your Mobile No."
                            name="mobileNo"
                            type="number"
                            :rules="mobileNoRules"
                            required
                          ></v-text-field>
                        </v-flex>
                      </v-layout>
68d742034   Neeraj Sharma   implement new des...
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
                    </v-flex>
                  </v-layout>
                </v-flex>
                <v-flex xs12 sm6>
                  <v-layout>
                    <v-flex xs4 class="pt-4 subheading">
                      <label class="right hidden-xs-only hidden-sm-only">Select Country:</label>
                      <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Country:</label>
                    </v-flex>
                    <v-flex xs8 class="ml-3">
                      <v-autocomplete
                        v-model="addTeachers.country"
                        :rules="country"
                        :items="countries"
                        placeholder="Select Country Name"
                        required
                      ></v-autocomplete>
                    </v-flex>
                  </v-layout>
                </v-flex>
              </v-layout>
              <v-layout wrap>
                <v-flex xs12 sm6>
                  <v-layout>
                    <v-flex xs4 class="pt-4 subheading">
                      <label class="right">Join Date:</label>
                    </v-flex>
                    <v-flex xs8 class="ml-3">
                      <v-menu
                        ref="menu1"
                        :close-on-content-click="false"
                        v-model="menu1"
                        :nudge-right="40"
                        lazy
                        transition="scale-transition"
                        offset-y
                        full-width
                        min-width="290px"
                      >
                        <v-text-field
                          slot="activator"
                          :rules="joinDateRules"
                          v-model="addTeachers.joinDate"
                          placeholder="Select date"
                        ></v-text-field>
                        <v-date-picker
                          ref="picker"
                          v-model="addTeachers.joinDate"
                          :max="new Date().toISOString().substr(0, 10)"
                          min="1950-01-01"
                          @input="menu1 = false"
                        ></v-date-picker>
                      </v-menu>
                    </v-flex>
                  </v-layout>
                </v-flex>
                <v-flex xs12 sm6>
                  <v-layout>
                    <v-flex xs4 class="pt-4 subheading">
                      <label class="right hidden-xs-only hidden-sm-only">Uplaod Image:</label>
                      <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Uplaod:</label>
                    </v-flex>
                    <v-flex xs8 class="ml-3">
                      <v-text-field
                        label="Select Image"
                        @click="pickFile"
                        v-model="imageName"
                        append-icon="attach_file"
                      ></v-text-field>
                      <input
                        type="file"
                        style="display:none"
                        ref="image"
                        accept="image/*"
                        @change="onFilePicked"
                      />
                    </v-flex>
                  </v-layout>
                </v-flex>
              </v-layout>
              <v-layout class="hidden-xs-only hidden-sm-only">
                <v-flex xs12 sm6>
                  <v-layout>
                    <v-flex xs4 md4 class="pt-4 subheading">
                      <label class="right">Present Address:</label>
                    </v-flex>
                    <v-flex xs8 md8 class="ml-3">
                      <v-text-field
                        name="input-4-3"
                        v-model="addTeachers.presentAddress"
                        :rules="presentAddress"
                        placeholder="fill Your present Address"
                        @keyup="copyData"
                      ></v-text-field>
                    </v-flex>
                  </v-layout>
                </v-flex>
                <v-flex xs12 sm6>
                  <v-layout>
                    <v-flex xs4 md4 class="pt-4 subheading addressForm">
                      <label class="right">Permanent Address:</label>
                    </v-flex>
                    <v-flex xs12 md8 class="ml-3">
                      <v-switch
                        v-model="addTeachers.permanentAddress"
                        label="Select Permanent Address"
                        :value="addTeachers.presentAddress"
                      ></v-switch>
                    </v-flex>
                  </v-layout>
                </v-flex>
              </v-layout>
              <v-layout class="hidden-xs-only hidden-sm-only">
                <v-flex xs12 sm6>
                  <v-layout>
                    <v-flex xs4 md4 class="pt-4 subheading addressForm">
                      <label class="right">Permanent Address:</label>
                    </v-flex>
                    <v-flex xs12 md8 class="ml-3">
                      <v-text-field
                        name="input-4-3"
                        v-model="addTeachers.permanentAddress"
                        :rules="permanentAddress"
                        placeholder="fill Your Permanent Address"
                        required
                      ></v-text-field>
                    </v-flex>
                  </v-layout>
                </v-flex>
              </v-layout>
              <v-layout class="hidden-lg-only hidden-md-only hidden-xl-only" wrap>
                <v-flex xs12 sm12>
                  <v-layout>
                    <v-flex xs12 sm12 class="pt-4 subheading text-xs-center">
                      <label class>Present Addres:</label>
                    </v-flex>
                  </v-layout>
                  <v-layout>
                    <v-flex xs12 sm12>
                      <v-textarea
                        name="input-4-3"
                        v-model="addTeachers.presentAddress"
                        :rules="presentAddress"
                        placeholder="fill Your present Address"
                        required
                      ></v-textarea>
                    </v-flex>
                  </v-layout>
                </v-flex>
                <v-flex xs12 sm12>
                  <v-layout>
                    <v-flex xs12 sm12 class="pt-4 pr-4 subheading text-xs-center addressForm">
                      <label>Permanent Address:</label>
                    </v-flex>
                  </v-layout>
                  <v-layout>
                    <v-flex xs12 sm12>
                      <v-textarea
                        name="input-4-3"
                        v-model="addTeachers.permanentAddress"
                        :rules="permanentAddress"
                        placeholder="fill Your Permanent Address"
                        required
                      ></v-textarea>
                    </v-flex>
                  </v-layout>
                </v-flex>
              </v-layout>
              <v-layout>
                <v-flex xs12 sm12>
                  <v-layout class="right">
                    <v-btn @click="clear" round dark class="clear-button">Clear</v-btn>
                    <v-btn @click="submit" round dark :loading="loading" class="add-button">Add</v-btn>
                  </v-layout>
                </v-flex>
              </v-layout>
            </v-container>
          </v-form>
        </v-card>
      </v-dialog>
36fc987df   Neeraj Sharma   add loader in all...
937
938
939
      <div class="loader" v-if="showLoader">
        <v-progress-circular indeterminate color="white"></v-progress-circular>
      </div>
68d742034   Neeraj Sharma   implement new des...
940
    </v-container>
93a68cfa1   Jatinder Singh   first commit
941
942
943
  </template>
  
  <script>
03dcbf0c1   Neeraj Sharma   fix all api and r...
944
  import http from "@/Services/http.js";
506be6fd7   Neeraj Sharma   implemet dyamic i...
945
  import moment from "moment";
495e4037c   Neeraj Sharma   update
946
  import countryList from "@/script/country.js";
03dcbf0c1   Neeraj Sharma   fix all api and r...
947

93a68cfa1   Jatinder Singh   first commit
948
  export default {
93a68cfa1   Jatinder Singh   first commit
949
    data: () => ({
c29ba4fbb   Amber Dev   added country codes
950
951
952
953
      /* EDIT MOBILE CELL */
      editedMobileCode: '',
      /* ADD FATHER CELL */
      addedTeacherMobileCode: '',
03dcbf0c1   Neeraj Sharma   fix all api and r...
954
955
956
957
      component: "report-generate",
      snackbar: false,
      y: "top",
      x: "right",
710438de6   Shikha Mishra   added teacher mod...
958
      role: "",
03dcbf0c1   Neeraj Sharma   fix all api and r...
959
960
961
      mode: "",
      timeout: 3000,
      text: "",
404356387   Neeraj Sharma   fixed snackbar co...
962
      color: "",
813e55a79   Neeraj Sharma   implement parents...
963
      showLoader: false,
03dcbf0c1   Neeraj Sharma   fix all api and r...
964
      loading: false,
6b6e4e83d   Neeraj Sharma   design modified i...
965
966
      date: null,
      search: "",
68d742034   Neeraj Sharma   implement new des...
967
968
      show: true,
      showSearch: false,
ac10393a4   Neeraj Sharma   add calender date...
969
      menu: false,
6b6e4e83d   Neeraj Sharma   design modified i...
970
      menu1: false,
813e55a79   Neeraj Sharma   implement parents...
971
      menu2: false,
6b6e4e83d   Neeraj Sharma   design modified i...
972
      menu3: false,
68d742034   Neeraj Sharma   implement new des...
973
974
975
      editTeacherDialog: false,
      viewTeacherProfileDialog: false,
      addTeacherDialog: false,
c35a8dafd   Jatinder Singh   minor changes
976
      valid: true,
5ac5570a9   Jatinder Singh   datatable changes
977
      pagination: {
8e8d14254   Shikha Mishra   Cleared data whil...
978
        rowsPerPage: 10,
5ac5570a9   Jatinder Singh   datatable changes
979
      },
6b6e4e83d   Neeraj Sharma   design modified i...
980
981
982
983
      imageData: {},
      imageName: "",
      imageUrl: "",
      imageFile: "",
8e8d14254   Shikha Mishra   Cleared data whil...
984
985
986
987
988
989
990
991
992
993
      nameRules: [(v) => !!v || " Full Name is required"],
      dateRules: [(v) => !!v || " DOB is required"],
      cityRules: [(v) => !!v || " City Name is required"],
      pincode: [(v) => !!v || " Pincode is required"],
      country: [(v) => !!v || " Country Name is required"],
      permanentAddress: [(v) => !!v || " Permanent Address is required"],
      presentAddress: [(v) => !!v || " Present Address  is required"],
      mobileNoRules: [(v) => !!v || "Mobile Number is required"],
      stateRules: [(v) => !!v || "State Name is required"],
      joinDateRules: [(v) => !!v || " Join Date is required"],
6b6e4e83d   Neeraj Sharma   design modified i...
994
      errorMessages: "",
200c2d171   Neeraj Sharma   implement change ...
995
      switch1: true,
495e4037c   Neeraj Sharma   update
996
      countries: [],
93a68cfa1   Jatinder Singh   first commit
997
998
      headers: [
        {
03dcbf0c1   Neeraj Sharma   fix all api and r...
999
          text: "No",
68d742034   Neeraj Sharma   implement new des...
1000
          align: "",
93a68cfa1   Jatinder Singh   first commit
1001
          sortable: false,
8e8d14254   Shikha Mishra   Cleared data whil...
1002
          value: "No",
c35a8dafd   Jatinder Singh   minor changes
1003
        },
813e55a79   Neeraj Sharma   implement parents...
1004
1005
1006
1007
        {
          text: "Profile Pic",
          value: "profilePicUrl",
          sortable: false,
8e8d14254   Shikha Mishra   Cleared data whil...
1008
          align: "center",
813e55a79   Neeraj Sharma   implement parents...
1009
        },
03dcbf0c1   Neeraj Sharma   fix all api and r...
1010
1011
        { text: "Name", value: "name", sortable: false, align: "center" },
        { text: "Email", value: "email", sortable: false, align: "center" },
6b6e4e83d   Neeraj Sharma   design modified i...
1012
        { text: "DOB", value: "dob", sortable: false, align: "center" },
813e55a79   Neeraj Sharma   implement parents...
1013
1014
1015
1016
        {
          text: "Join Date",
          value: "joinDate",
          sortable: false,
8e8d14254   Shikha Mishra   Cleared data whil...
1017
          align: "center",
813e55a79   Neeraj Sharma   implement parents...
1018
1019
1020
1021
1022
        },
        {
          text: "Mobile No",
          value: "mobileNo",
          sortable: false,
8e8d14254   Shikha Mishra   Cleared data whil...
1023
          align: "center",
813e55a79   Neeraj Sharma   implement parents...
1024
        },
200c2d171   Neeraj Sharma   implement change ...
1025
1026
1027
1028
        {
          text: "Status",
          value: "status",
          sortable: false,
8e8d14254   Shikha Mishra   Cleared data whil...
1029
          align: "center",
200c2d171   Neeraj Sharma   implement change ...
1030
        },
8e8d14254   Shikha Mishra   Cleared data whil...
1031
        { text: "Action", value: "", sortable: false, align: "center" },
93a68cfa1   Jatinder Singh   first commit
1032
      ],
03dcbf0c1   Neeraj Sharma   fix all api and r...
1033
      desserts: [],
93a68cfa1   Jatinder Singh   first commit
1034
      editedIndex: -1,
813e55a79   Neeraj Sharma   implement parents...
1035
      upload: "",
93a68cfa1   Jatinder Singh   first commit
1036
      editedItem: {
e3e2a04c6   Neeraj Sharma   first commit
1037
        role: "TEACHER",
03dcbf0c1   Neeraj Sharma   fix all api and r...
1038
        name: "",
03dcbf0c1   Neeraj Sharma   fix all api and r...
1039
        email: "",
6b6e4e83d   Neeraj Sharma   design modified i...
1040
1041
1042
1043
1044
1045
1046
1047
        date: null,
        city: "",
        pincode: "",
        country: "",
        permanentAddress: "",
        presentAddress: "",
        mobileNo: "",
        state: "",
8e8d14254   Shikha Mishra   Cleared data whil...
1048
        joinDate: null,
93a68cfa1   Jatinder Singh   first commit
1049
      },
6b6e4e83d   Neeraj Sharma   design modified i...
1050
      addTeachers: {
e3e2a04c6   Neeraj Sharma   first commit
1051
        role: "TEACHER",
03dcbf0c1   Neeraj Sharma   fix all api and r...
1052
        name: "",
03dcbf0c1   Neeraj Sharma   fix all api and r...
1053
        email: "",
6b6e4e83d   Neeraj Sharma   design modified i...
1054
1055
1056
1057
1058
1059
1060
1061
        date: null,
        city: "",
        pincode: "",
        country: "",
        permanentAddress: "",
        presentAddress: "",
        mobileNo: "",
        state: "",
8e8d14254   Shikha Mishra   Cleared data whil...
1062
        joinDate: null,
6b6e4e83d   Neeraj Sharma   design modified i...
1063
      },
8e8d14254   Shikha Mishra   Cleared data whil...
1064
      status: "",
93a68cfa1   Jatinder Singh   first commit
1065
    }),
6b6e4e83d   Neeraj Sharma   design modified i...
1066
1067
1068
    watch: {
      menu(val) {
        val && this.$nextTick(() => (this.$refs.picker.activePicker = "YEAR"));
ac10393a4   Neeraj Sharma   add calender date...
1069
      },
6b6e4e83d   Neeraj Sharma   design modified i...
1070
1071
      menu1(val) {
        val && this.$nextTick(() => (this.$refs.picker.activePicker = "YEAR"));
8e8d14254   Shikha Mishra   Cleared data whil...
1072
1073
1074
      },
      addTeacherDialog: function (val) {
        if (!val) {
2f9211c74   Shikha Mishra   done one round of...
1075
1076
1077
          this.addTeachers = {
            role: "TEACHER",
          };
8e8d14254   Shikha Mishra   Cleared data whil...
1078
1079
1080
1081
1082
          this.imageName = "";
          this.imageFile = "";
          this.imageUrl = "";
        }
      },
6b6e4e83d   Neeraj Sharma   design modified i...
1083
1084
    },
    methods: {
0a7184bf8   Amber Dev   added internation...
1085
      onSelect({ name, iso2, dialCode }) {
c29ba4fbb   Amber Dev   added country codes
1086
1087
1088
1089
        // console.log("country codes", name, iso2, dialCode);
      },
      editMobileCode({ name, iso2, dialCode }){
        // console.log("Edit father cell", name,iso2);
d0ffa80fe   Amber Dev   added dialcode
1090
        this.editedMobileCode = dialCode
c29ba4fbb   Amber Dev   added country codes
1091
1092
      },
      addTeacherMobileCode({ name, iso2, dialCode }){
d0ffa80fe   Amber Dev   added dialcode
1093
        this.addedTeacherMobileCode = dialCode
0a7184bf8   Amber Dev   added internation...
1094
      },
813e55a79   Neeraj Sharma   implement parents...
1095
1096
      save(date) {
        this.$refs.menu.save(date);
6b6e4e83d   Neeraj Sharma   design modified i...
1097
      },
813e55a79   Neeraj Sharma   implement parents...
1098
1099
      save(date) {
        this.$refs.menu1.save(date);
6b6e4e83d   Neeraj Sharma   design modified i...
1100
1101
      },
      pickFile() {
813e55a79   Neeraj Sharma   implement parents...
1102
        this.$refs.image.click();
6b6e4e83d   Neeraj Sharma   design modified i...
1103
      },
6b6e4e83d   Neeraj Sharma   design modified i...
1104
      onFilePicked(e) {
6b6e4e83d   Neeraj Sharma   design modified i...
1105
1106
        const files = e.target.files;
        this.upload = e.target.files[0];
6b6e4e83d   Neeraj Sharma   design modified i...
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
        if (files[0] !== undefined) {
          this.imageName = files[0].name;
          if (this.imageName.lastIndexOf(".") <= 0) {
            return;
          }
          const fr = new FileReader();
          fr.readAsDataURL(files[0]);
          fr.addEventListener("load", () => {
            this.imageUrl = fr.result;
            this.imageFile = files[0]; // this is an image file that can be sent to server...
6b6e4e83d   Neeraj Sharma   design modified i...
1117
1118
1119
1120
1121
1122
1123
          });
        } else {
          this.imageName = "";
          this.imageFile = "";
          this.imageUrl = "";
        }
      },
8e8d14254   Shikha Mishra   Cleared data whil...
1124
      dates: function (date) {
506be6fd7   Neeraj Sharma   implemet dyamic i...
1125
1126
        return moment(date).format("MMMM DD, YYYY");
      },
e3e2a04c6   Neeraj Sharma   first commit
1127
      getTeacherList() {
36fc987df   Neeraj Sharma   add loader in all...
1128
        this.showLoader = true;
03dcbf0c1   Neeraj Sharma   fix all api and r...
1129
        var token = this.$store.state.token;
6b6e4e83d   Neeraj Sharma   design modified i...
1130
1131
        http()
          .get("/getTeachersList", {
8e8d14254   Shikha Mishra   Cleared data whil...
1132
            headers: { Authorization: "Bearer " + token },
6b6e4e83d   Neeraj Sharma   design modified i...
1133
          })
8e8d14254   Shikha Mishra   Cleared data whil...
1134
          .then((response) => {
e3e2a04c6   Neeraj Sharma   first commit
1135
            this.desserts = response.data.data;
36fc987df   Neeraj Sharma   add loader in all...
1136
            this.showLoader = false;
1c1942362   Neeraj Sharma   commit code Schoo...
1137
            // console.log("getTeacherList=====>",this.desserts)
03dcbf0c1   Neeraj Sharma   fix all api and r...
1138
          })
8e8d14254   Shikha Mishra   Cleared data whil...
1139
          .catch((error) => {
36fc987df   Neeraj Sharma   add loader in all...
1140
            this.showLoader = false;
a17c68a03   Neeraj Sharma   implement two rou...
1141
1142
1143
1144
1145
            if (error.response.status === 401) {
              this.$router.replace({ path: "/" });
              this.$store.dispatch("setToken", null);
              this.$store.dispatch("Id", null);
            }
03dcbf0c1   Neeraj Sharma   fix all api and r...
1146
          });
e173bab21   Jatinder Singh   api
1147
      },
03dcbf0c1   Neeraj Sharma   fix all api and r...
1148
      editItem(item) {
93a68cfa1   Jatinder Singh   first commit
1149
1150
        this.editedIndex = this.desserts.indexOf(item);
        this.editedItem = Object.assign({}, item);
813e55a79   Neeraj Sharma   implement parents...
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
        this.editedItem.dob =
          this.editedItem.dob != undefined
            ? (this.editedItem.dob = this.editedItem.dob.substring(0, 10))
            : (this.editedItem.dob = "");
        this.editedItem.joinDate =
          this.editedItem.joinDate != undefined
            ? (this.editedItem.joinDate = this.editedItem.joinDate.substring(
                0,
                10
              ))
            : (this.editedItem.joinDate = "");
33cfa4432   Neeraj Sharma   solve bugs J-date...
1162

68d742034   Neeraj Sharma   implement new des...
1163
        this.editTeacherDialog = true;
93a68cfa1   Jatinder Singh   first commit
1164
      },
03dcbf0c1   Neeraj Sharma   fix all api and r...
1165
      profile(item) {
c35a8dafd   Jatinder Singh   minor changes
1166
1167
        this.editedIndex = this.desserts.indexOf(item);
        this.editedItem = Object.assign({}, item);
68d742034   Neeraj Sharma   implement new des...
1168
        this.viewTeacherProfileDialog = true;
c35a8dafd   Jatinder Singh   minor changes
1169
      },
03dcbf0c1   Neeraj Sharma   fix all api and r...
1170
      deleteItem(item) {
e3e2a04c6   Neeraj Sharma   first commit
1171
        let deleteTeachers = {
8e8d14254   Shikha Mishra   Cleared data whil...
1172
          teacherId: item._id,
03dcbf0c1   Neeraj Sharma   fix all api and r...
1173
1174
        };
        http()
6b6e4e83d   Neeraj Sharma   design modified i...
1175
1176
1177
          .delete(
            "/deleteTeacher",
            confirm("Are you sure you want to delete this?") && {
8e8d14254   Shikha Mishra   Cleared data whil...
1178
              params: deleteTeachers,
6b6e4e83d   Neeraj Sharma   design modified i...
1179
1180
            }
          )
8e8d14254   Shikha Mishra   Cleared data whil...
1181
          .then((response) => {
404356387   Neeraj Sharma   fixed snackbar co...
1182
1183
1184
            this.snackbar = true;
            this.text = "Successfully delete Existing Teacher";
            this.color = "green";
e3e2a04c6   Neeraj Sharma   first commit
1185
            this.getTeacherList();
03dcbf0c1   Neeraj Sharma   fix all api and r...
1186
          })
8e8d14254   Shikha Mishra   Cleared data whil...
1187
          .catch((error) => {
404356387   Neeraj Sharma   fixed snackbar co...
1188
1189
1190
            this.snackbar = true;
            this.text = error.response.data.message;
            this.color = "error";
03dcbf0c1   Neeraj Sharma   fix all api and r...
1191
          });
93a68cfa1   Jatinder Singh   first commit
1192
      },
68d742034   Neeraj Sharma   implement new des...
1193
1194
      closeEditTeacherDialog() {
        this.editTeacherDialog = false;
93a68cfa1   Jatinder Singh   first commit
1195
      },
03dcbf0c1   Neeraj Sharma   fix all api and r...
1196
      close1() {
68d742034   Neeraj Sharma   implement new des...
1197
        this.viewTeacherProfileDialog = false;
c35a8dafd   Jatinder Singh   minor changes
1198
      },
d9bb52b5b   Neeraj Sharma   implement trello ...
1199
1200
1201
      copyData() {
        this.addTeachers.permanentAddress = this.addTeachers.presentAddress;
      },
03dcbf0c1   Neeraj Sharma   fix all api and r...
1202
      submit() {
c35a8dafd   Jatinder Singh   minor changes
1203
        if (this.$refs.form.validate()) {
1c1942362   Neeraj Sharma   commit code Schoo...
1204
          let addTeacher = {
6b6e4e83d   Neeraj Sharma   design modified i...
1205
1206
1207
1208
1209
1210
1211
1212
1213
            name: this.addTeachers.name,
            email: this.addTeachers.email,
            role: this.addTeachers.role,
            dob: this.addTeachers.date,
            city: this.addTeachers.city,
            pincode: this.addTeachers.pincode,
            country: this.addTeachers.country,
            permanentAddress: this.addTeachers.permanentAddress,
            presentAddress: this.addTeachers.presentAddress,
c29ba4fbb   Amber Dev   added country codes
1214
            countryCode: this.addedTeacherMobileCode,
6b6e4e83d   Neeraj Sharma   design modified i...
1215
1216
            mobileNo: this.addTeachers.mobileNo,
            state: this.addTeachers.state,
8e8d14254   Shikha Mishra   Cleared data whil...
1217
            joinDate: this.addTeachers.joinDate,
03dcbf0c1   Neeraj Sharma   fix all api and r...
1218
          };
ebe04cc1d   Neeraj Sharma   solve issue uploa...
1219
1220
1221
1222
1223
          if (this.imageUrl) {
            var str = this.imageUrl;
            const [baseUrl, imageUrl] = str.split(/,/);
            addTeacher.upload = imageUrl;
          }
5f1d4b444   Neeraj Sharma   fix design and fi...
1224
          this.loading = true;
03dcbf0c1   Neeraj Sharma   fix all api and r...
1225
          http()
1c1942362   Neeraj Sharma   commit code Schoo...
1226
            .post("/createTeacher", addTeacher)
8e8d14254   Shikha Mishra   Cleared data whil...
1227
            .then((response) => {
0551a0f15   Neeraj Sharma   implemnet functio...
1228
              this.imageUrl = "";
e3e2a04c6   Neeraj Sharma   first commit
1229
              this.getTeacherList();
0551a0f15   Neeraj Sharma   implemnet functio...
1230
1231
              this.snackbar = true;
              this.text = "New Teacher added successfully";
404356387   Neeraj Sharma   fixed snackbar co...
1232
              this.color = "green";
6b6e4e83d   Neeraj Sharma   design modified i...
1233
              this.clear();
5f1d4b444   Neeraj Sharma   fix design and fi...
1234
              this.loading = false;
68d742034   Neeraj Sharma   implement new des...
1235
              this.addTeacherDialog = false;
03dcbf0c1   Neeraj Sharma   fix all api and r...
1236
            })
8e8d14254   Shikha Mishra   Cleared data whil...
1237
            .catch((error) => {
404356387   Neeraj Sharma   fixed snackbar co...
1238
1239
1240
              this.snackbar = true;
              this.text = error.response.data.message;
              this.color = "error";
5f1d4b444   Neeraj Sharma   fix design and fi...
1241
              this.loading = false;
03dcbf0c1   Neeraj Sharma   fix all api and r...
1242
            });
c35a8dafd   Jatinder Singh   minor changes
1243
1244
        }
      },
03dcbf0c1   Neeraj Sharma   fix all api and r...
1245
      clear() {
ee83012b3   Jatinder Singh   changes
1246
        this.$refs.form.reset();
0551a0f15   Neeraj Sharma   implemnet functio...
1247
        this.imageUrl = "";
ee83012b3   Jatinder Singh   changes
1248
      },
03dcbf0c1   Neeraj Sharma   fix all api and r...
1249
      save() {
813e55a79   Neeraj Sharma   implement parents...
1250
        this.loading = true;
1c1942362   Neeraj Sharma   commit code Schoo...
1251
        let editTeacher = {
6b6e4e83d   Neeraj Sharma   design modified i...
1252
          teacherId: this.editedItem._id,
5f2dd99ed   Neeraj Sharma   add full name in ...
1253
          name: this.editedItem.name,
03dcbf0c1   Neeraj Sharma   fix all api and r...
1254
          email: this.editedItem.email,
6b6e4e83d   Neeraj Sharma   design modified i...
1255
          role: this.editedItem.role,
0cd2fbfba   Neeraj Sharma   implement create ...
1256
          dob: this.editedItem.dob,
6b6e4e83d   Neeraj Sharma   design modified i...
1257
1258
1259
1260
1261
          city: this.editedItem.city,
          pincode: this.editedItem.pincode,
          country: this.editedItem.country,
          permanentAddress: this.editedItem.permanentAddress,
          presentAddress: this.editedItem.presentAddress,
c29ba4fbb   Amber Dev   added country codes
1262
          countryCode: this.editedMobileCode,
6b6e4e83d   Neeraj Sharma   design modified i...
1263
1264
          mobileNo: this.editedItem.mobileNo,
          state: this.editedItem.state,
8e8d14254   Shikha Mishra   Cleared data whil...
1265
          joinDate: this.editedItem.joinDate,
03dcbf0c1   Neeraj Sharma   fix all api and r...
1266
        };
813e55a79   Neeraj Sharma   implement parents...
1267
        if (this.imageUrl) {
ebe04cc1d   Neeraj Sharma   solve issue uploa...
1268
1269
1270
          var str = this.imageUrl;
          const [baseUrl, imageUrl] = str.split(/,/);
          editTeacher.upload = imageUrl;
813e55a79   Neeraj Sharma   implement parents...
1271
        }
03dcbf0c1   Neeraj Sharma   fix all api and r...
1272
        http()
68d742034   Neeraj Sharma   implement new des...
1273
          .put("/updateTeacher", editTeacher)
8e8d14254   Shikha Mishra   Cleared data whil...
1274
          .then((response) => {
0551a0f15   Neeraj Sharma   implemnet functio...
1275
1276
            this.snackbar = true;
            this.text = "Successfully Edit Existing Teacher";
404356387   Neeraj Sharma   fixed snackbar co...
1277
            this.color = "green";
d791fb8d2   Neeraj Sharma   edit image solve ...
1278
            this.loading = false;
6b6e4e83d   Neeraj Sharma   design modified i...
1279
            this.getTeacherList();
68d742034   Neeraj Sharma   implement new des...
1280
            this.closeEditTeacherDialog();
03dcbf0c1   Neeraj Sharma   fix all api and r...
1281
          })
8e8d14254   Shikha Mishra   Cleared data whil...
1282
          .catch((error) => {
404356387   Neeraj Sharma   fixed snackbar co...
1283
1284
1285
            this.snackbar = true;
            this.text = error.response.data.message;
            this.color = "error";
d791fb8d2   Neeraj Sharma   edit image solve ...
1286
            this.loading = false;
03dcbf0c1   Neeraj Sharma   fix all api and r...
1287
          });
200c2d171   Neeraj Sharma   implement change ...
1288
1289
      },
      suspendStatus(suspendStatus, id) {
200c2d171   Neeraj Sharma   implement change ...
1290
1291
        let suspendStatusData = {
          teacherId: id,
8e8d14254   Shikha Mishra   Cleared data whil...
1292
          status: suspendStatus,
200c2d171   Neeraj Sharma   implement change ...
1293
        };
68d742034   Neeraj Sharma   implement new des...
1294
        this.showLoader = true;
200c2d171   Neeraj Sharma   implement change ...
1295
1296
        http()
          .put("/suspendAccount", suspendStatusData)
8e8d14254   Shikha Mishra   Cleared data whil...
1297
          .then((response) => {
200c2d171   Neeraj Sharma   implement change ...
1298
1299
            this.getTeacherList();
            this.text = response.data.message;
68d742034   Neeraj Sharma   implement new des...
1300
            this.color = "green";
200c2d171   Neeraj Sharma   implement change ...
1301
            this.snackbar = true;
68d742034   Neeraj Sharma   implement new des...
1302
            this.showLoader = false;
200c2d171   Neeraj Sharma   implement change ...
1303
          })
8e8d14254   Shikha Mishra   Cleared data whil...
1304
          .catch((error) => {
404356387   Neeraj Sharma   fixed snackbar co...
1305
            this.snackbar = true;
68d742034   Neeraj Sharma   implement new des...
1306
            this.color = "error";
200c2d171   Neeraj Sharma   implement change ...
1307
            this.text = error.response.data.message;
68d742034   Neeraj Sharma   implement new des...
1308
            this.showLoader = false;
200c2d171   Neeraj Sharma   implement change ...
1309
          });
68d742034   Neeraj Sharma   implement new des...
1310
1311
1312
1313
1314
1315
1316
1317
      },
      displaySearch() {
        (this.show = false), (this.showSearch = true);
      },
      closeSearch() {
        this.showSearch = false;
        this.show = true;
        this.search = "";
8e8d14254   Shikha Mishra   Cleared data whil...
1318
      },
4413a8d93   Jatinder Singh   changes
1319
    },
03dcbf0c1   Neeraj Sharma   fix all api and r...
1320
    mounted() {
495e4037c   Neeraj Sharma   update
1321
1322
      const getCountryList = countryList();
      this.countries = getCountryList;
e3e2a04c6   Neeraj Sharma   first commit
1323
      this.getTeacherList();
710438de6   Shikha Mishra   added teacher mod...
1324
      this.role = this.$store.state.role;
8e8d14254   Shikha Mishra   Cleared data whil...
1325
    },
93a68cfa1   Jatinder Singh   first commit
1326
  };
93a68cfa1   Jatinder Singh   first commit
1327
  </script>
04e3fbc56   Jatinder Singh   minor fix
1328
  <style scoped>
ee83012b3   Jatinder Singh   changes
1329
  .active {
687e0b929   Neeraj Sharma   add user,attenden...
1330
    background-color: gray;
ee83012b3   Jatinder Singh   changes
1331
    color: white !important;
269061695   Jatinder Singh   changes
1332
  }
ab72cb628   Jatinder Singh   report changes
1333
1334
1335
  .activebtn {
    color: black !important;
  }
04e3fbc56   Jatinder Singh   minor fix
1336
  </style>