Blame view

src/pages/Parent/parents.vue 38.2 KB
813e55a79   Neeraj Sharma   implement parents...
1
2
  <template>
    <v-app id="pages-dasboard">
687e0b929   Neeraj Sharma   add user,attenden...
3
      <v-tabs grow slider-color="gray">
813e55a79   Neeraj Sharma   implement parents...
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
        <v-tab
          ripple
          @click="activeTab('existing')"
          v-bind:class="{ active: isActive }"
          id="tab"
          class="subheading"
        >Existing Parents</v-tab>
        <v-tab
          ripple
          @click="activeTab('new')"
          v-bind:class="{ active: newActive }"
          id="tab1"
          User
          class="subheading"
        >Add New Parents</v-tab>
  
        <!-- ****** EDITS  Parents DETAILS ****** -->
  
        <v-tab-item>
          <v-snackbar
            :timeout="timeout"
            :top="y === 'top'"
            :right="x === 'right'"
            :vertical="mode === 'vertical'"
            v-model="snackbar"
            color="success"
          >{{ text }}</v-snackbar>
f4df757fe   Neeraj Sharma   responsive vie in...
31
          <v-dialog v-model="dialog" max-width="600px" scrollable>
813e55a79   Neeraj Sharma   implement parents...
32
33
34
35
            <v-card flat>
              <v-toolbar color="grey lighten-2" flat>
                <v-spacer></v-spacer>
                <v-toolbar-title>
f4df757fe   Neeraj Sharma   responsive vie in...
36
37
38
39
                  <h3 class="hidden-xs-only">Edit Parent Profile</h3>
                  <h5
                    class="hidden-sm-only hidden-md-only hidden-lg-only hidden-xl-only"
                  >Edit Parent Profile</h5>
813e55a79   Neeraj Sharma   implement parents...
40
41
                </v-toolbar-title>
                <v-spacer></v-spacer>
f4df757fe   Neeraj Sharma   responsive vie in...
42
43
44
45
46
47
                <v-icon @click="close" class="hidden-xs-only pr-2">close</v-icon>
                <v-icon
                  @click="close"
                  size="26"
                  class="hidden-sm-only hidden-md-only hidden-lg-only hidden-xl-only"
                >close</v-icon>
813e55a79   Neeraj Sharma   implement parents...
48
              </v-toolbar>
a910d5d2a   Neeraj Sharma   responsive design...
49
              <v-card-text style="height: 600px;" class="hidden-xs-only hidden-sm-only">
4efdca564   Neeraj Sharma   solve bugs parent...
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
92
93
94
95
96
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
                <v-form ref="editParentForm" v-model="validEditParent" lazy-validation>
                  <v-flex xs12>
                    <v-layout>
                      <v-flex xs3 sm4 class="pt-4 subheading">
                        <label class="right">Email ID:</label>
                      </v-flex>
                      <v-flex xs8 sm6 class="ml-3">
                        <v-text-field
                          placeholder="fill your email"
                          v-model="editedItem.email"
                          type="text"
                          name="email"
                          required
                        ></v-text-field>
                      </v-flex>
                    </v-layout>
                  </v-flex>
                  <v-flex xs12>
                    <v-layout>
                      <v-flex xs3 sm4 class="pt-4 subheading">
                        <label class="right">Father Name:</label>
                      </v-flex>
                      <v-flex xs8 sm6 class="ml-3">
                        <v-text-field
                          v-model="editedItem.fatherName"
                          placeholder="fill your father Name"
                          required
                        ></v-text-field>
                      </v-flex>
                    </v-layout>
                  </v-flex>
                  <v-flex xs12>
                    <v-layout>
                      <v-flex xs3 sm4 class="pt-4 subheading">
                        <label class="right">Father Cell No:</label>
                      </v-flex>
                      <v-flex xs8 sm6 class="ml-3">
                        <v-text-field
                          v-model="editedItem.fatherCellNo"
                          placeholder="fill your father Cell Number"
                          :rules="editFatherNoRule"
                          type="number"
                          required
                        ></v-text-field>
                      </v-flex>
                    </v-layout>
                  </v-flex>
                  <v-flex xs12>
                    <v-layout>
                      <v-flex xs3 sm4 class="pt-4 subheading">
                        <label class="right">Father Profession:</label>
                      </v-flex>
                      <v-flex xs8 sm6 class="ml-3">
                        <v-text-field
                          v-model="editedItem.fatherProfession"
                          placeholder="fill your father Profession"
                          required
                        ></v-text-field>
                      </v-flex>
                    </v-layout>
                  </v-flex>
                  <v-flex xs12>
                    <v-layout>
                      <v-flex xs3 sm4 class="pt-4 subheading">
                        <label class="right">Mother Name:</label>
                      </v-flex>
                      <v-flex xs8 sm6 class="ml-3">
                        <v-text-field
                          v-model="editedItem.motherName"
                          placeholder="fill your Mother Name"
                          type="text"
                          required
                        ></v-text-field>
                      </v-flex>
                    </v-layout>
                  </v-flex>
                  <v-flex xs12>
                    <v-layout>
                      <v-flex xs3 sm4 class="pt-4 subheading">
                        <label class="right">Mother Cell No:</label>
                      </v-flex>
                      <v-flex xs8 sm6 class="ml-3">
                        <v-text-field
                          v-model="editedItem.motherCellNo"
                          placeholder="fill your  Mother Cell Number"
                          type="number"
                          required
                        ></v-text-field>
                      </v-flex>
                    </v-layout>
                  </v-flex>
                  <v-flex xs12>
                    <v-layout>
                      <v-flex xs3 sm4 class="pt-4 subheading">
                        <label class="right">Mother Profession:</label>
                      </v-flex>
                      <v-flex xs8 sm6 class="ml-3">
                        <v-text-field
                          v-model="editedItem.motherProfession"
                          placeholder="fill your Mother Profession"
                          type="text"
                          required
                        ></v-text-field>
                      </v-flex>
                    </v-layout>
                  </v-flex>
fc77c38e0   Neeraj Sharma   fixed all task ch...
156
                  <v-layout>
4efdca564   Neeraj Sharma   solve bugs parent...
157
158
159
160
161
162
                    <v-flex xs12 sm12>
                      <v-card-actions>
                        <v-spacer></v-spacer>
                        <v-btn round dark @click="save">Save</v-btn>
                        <v-spacer></v-spacer>
                      </v-card-actions>
fc77c38e0   Neeraj Sharma   fixed all task ch...
163
164
                    </v-flex>
                  </v-layout>
4efdca564   Neeraj Sharma   solve bugs parent...
165
                </v-form>
a910d5d2a   Neeraj Sharma   responsive design...
166
              </v-card-text>
a0650f86b   Neeraj Sharma   implement class v...
167
168
169
170
              <v-card-text
                style="height: 600px;"
                class="hidden-lg-only hidden-xl-only hidden-md-only"
              >
a910d5d2a   Neeraj Sharma   responsive design...
171
172
173
174
175
176
177
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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
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
                <v-flex xs12>
                  <v-layout wrap>
                    <v-flex xs12 class="pt-4 subheading">
                      <label>Email ID:</label>
                    </v-flex>
                    <v-flex xs12>
                      <v-text-field
                        placeholder="fill your email"
                        v-model="editedItem.email"
                        type="text"
                        name="email"
                        required
                      ></v-text-field>
                    </v-flex>
                  </v-layout>
                </v-flex>
                <v-flex xs12>
                  <v-layout wrap>
                    <v-flex xs12 class="pt-4 subheading">
                      <label>Father Name:</label>
                    </v-flex>
                    <v-flex xs12>
                      <v-text-field
                        v-model="editedItem.fatherName"
                        placeholder="fill your father Name"
                        required
                      ></v-text-field>
                    </v-flex>
                  </v-layout>
                </v-flex>
                <v-flex xs12>
                  <v-layout wrap>
                    <v-flex xs12 class="pt-4 subheading">
                      <label>Father Cell No:</label>
                    </v-flex>
                    <v-flex xs12>
                      <v-text-field
                        v-model="editedItem.fatherCellNo"
                        placeholder="fill your father Cell Number"
                        type="number"
                        required
                      ></v-text-field>
                    </v-flex>
                  </v-layout>
                </v-flex>
                <v-flex xs12>
                  <v-layout wrap>
                    <v-flex xs12 class="pt-4 subheading">
                      <label>Father Profession:</label>
                    </v-flex>
                    <v-flex xs12>
                      <v-text-field
                        v-model="editedItem.fatherProfession"
                        placeholder="fill your father Profession"
                        required
                      ></v-text-field>
                    </v-flex>
                  </v-layout>
                </v-flex>
                <v-flex xs12>
                  <v-layout wrap>
                    <v-flex xs12 class="pt-4 subheading">
                      <label>Mother Name:</label>
                    </v-flex>
                    <v-flex xs12>
                      <v-text-field
                        v-model="editedItem.motherName"
                        placeholder="fill your Mother Name"
                        type="text"
                        required
                      ></v-text-field>
                    </v-flex>
                  </v-layout>
                </v-flex>
                <v-flex xs12>
                  <v-layout wrap>
                    <v-flex xs12 class="pt-4 subheading">
                      <label>Mother Cell No:</label>
                    </v-flex>
                    <v-flex xs12>
                      <v-text-field
                        v-model="editedItem.motherCellNo"
                        placeholder="fill your  Mother Cell Number"
                        type="number"
                        required
                      ></v-text-field>
                    </v-flex>
                  </v-layout>
                </v-flex>
                <v-flex xs12>
                  <v-layout wrap>
                    <v-flex xs12 class="pt-4 subheading">
                      <label>Mother Profession:</label>
                    </v-flex>
                    <v-flex xs12>
                      <v-text-field
                        v-model="editedItem.motherProfession"
                        placeholder="fill your Mother Profession"
                        type="text"
                        required
                      ></v-text-field>
                    </v-flex>
                  </v-layout>
                </v-flex>
                <v-layout>
                  <v-flex xs12 sm12>
                    <v-card-actions>
                      <v-spacer></v-spacer>
                      <v-btn round dark @click="save">Save</v-btn>
                      <v-spacer></v-spacer>
                    </v-card-actions>
                  </v-flex>
                </v-layout>
f4df757fe   Neeraj Sharma   responsive vie in...
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
              </v-card-text>
            </v-card>
          </v-dialog>
  
          <!-- ****** PROFILE VIEW Parents DEATILS ******  -->
  
          <v-dialog v-model="dialog1" max-width="600px" scrollable>
            <v-card>
              <v-toolbar color="grey lighten-2" flat>
                <v-spacer></v-spacer>
                <v-toolbar-title>Parent Profile</v-toolbar-title>
                <v-spacer></v-spacer>
                <v-icon @click="close1">close</v-icon>
              </v-toolbar>
              <v-container grid-list-md>
                <v-layout wrap>
                  <v-flex xs12>
813e55a79   Neeraj Sharma   implement parents...
301
                    <v-layout>
f4df757fe   Neeraj Sharma   responsive vie in...
302
                      <v-flex xs12 sm12>
813e55a79   Neeraj Sharma   implement parents...
303
                        <v-layout>
f4df757fe   Neeraj Sharma   responsive vie in...
304
305
306
307
                          <v-flex xs6>
                            <h5 class="right my-1">
                              <b>Email:</b>
                            </h5>
813e55a79   Neeraj Sharma   implement parents...
308
                          </v-flex>
f4df757fe   Neeraj Sharma   responsive vie in...
309
310
                          <v-flex xs6>
                            <h5 class="my-1">{{ editedItem.email }}</h5>
813e55a79   Neeraj Sharma   implement parents...
311
312
313
                          </v-flex>
                        </v-layout>
                      </v-flex>
f4df757fe   Neeraj Sharma   responsive vie in...
314
315
                    </v-layout>
                    <v-layout>
a17c68a03   Neeraj Sharma   implement two rou...
316
                      <v-flex xs12>
cfb5c6445   Neeraj Sharma   add task
317
                        <v-layout>
f4df757fe   Neeraj Sharma   responsive vie in...
318
319
320
321
322
323
                          <v-flex xs6>
                            <b>
                              <h5 class="right my-1">
                                <b>Fahter Name:</b>
                              </h5>
                            </b>
cfb5c6445   Neeraj Sharma   add task
324
                          </v-flex>
f4df757fe   Neeraj Sharma   responsive vie in...
325
326
                          <v-flex xs6>
                            <h5 class="my-1">{{ editedItem.fatherName }}</h5>
cfb5c6445   Neeraj Sharma   add task
327
328
329
                          </v-flex>
                        </v-layout>
                      </v-flex>
813e55a79   Neeraj Sharma   implement parents...
330
331
332
333
                    </v-layout>
                    <v-layout>
                      <v-flex xs12>
                        <v-layout>
f4df757fe   Neeraj Sharma   responsive vie in...
334
335
336
337
338
339
                          <v-flex xs6>
                            <b>
                              <h5 class="right my-1">
                                <b>Mother Name:</b>
                              </h5>
                            </b>
813e55a79   Neeraj Sharma   implement parents...
340
                          </v-flex>
f4df757fe   Neeraj Sharma   responsive vie in...
341
342
                          <v-flex xs6>
                            <h5 class="my-1">{{ editedItem.motherName }}</h5>
813e55a79   Neeraj Sharma   implement parents...
343
344
345
                          </v-flex>
                        </v-layout>
                      </v-flex>
f4df757fe   Neeraj Sharma   responsive vie in...
346
347
                    </v-layout>
                    <v-layout>
813e55a79   Neeraj Sharma   implement parents...
348
349
                      <v-flex xs12>
                        <v-layout>
f4df757fe   Neeraj Sharma   responsive vie in...
350
351
352
353
354
355
                          <v-flex sm6>
                            <b>
                              <h5 class="right my-1">
                                <b>Father Cell No:</b>
                              </h5>
                            </b>
813e55a79   Neeraj Sharma   implement parents...
356
                          </v-flex>
f4df757fe   Neeraj Sharma   responsive vie in...
357
358
                          <v-flex sm6>
                            <h5 class="my-1">{{ editedItem.fatherCellNo }}</h5>
813e55a79   Neeraj Sharma   implement parents...
359
360
361
                          </v-flex>
                        </v-layout>
                      </v-flex>
f4df757fe   Neeraj Sharma   responsive vie in...
362
363
                    </v-layout>
                    <v-layout>
813e55a79   Neeraj Sharma   implement parents...
364
365
                      <v-flex xs12>
                        <v-layout>
f4df757fe   Neeraj Sharma   responsive vie in...
366
367
368
369
370
371
                          <v-flex xs6>
                            <b>
                              <h5 class="right my-1">
                                <b>Mother Cell No:</b>
                              </h5>
                            </b>
813e55a79   Neeraj Sharma   implement parents...
372
                          </v-flex>
f4df757fe   Neeraj Sharma   responsive vie in...
373
374
                          <v-flex xs6>
                            <h5 class="my-1">{{ editedItem.motherCellNo }}</h5>
813e55a79   Neeraj Sharma   implement parents...
375
376
377
378
                          </v-flex>
                        </v-layout>
                      </v-flex>
                    </v-layout>
fc77c38e0   Neeraj Sharma   fixed all task ch...
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
                    <v-layout>
                      <v-flex xs12>
                        <v-layout>
                          <v-flex xs6>
                            <b>
                              <h5 class="right my-1">
                                <b>Father Profession:</b>
                              </h5>
                            </b>
                          </v-flex>
                          <v-flex xs6>
                            <h5 class="my-1">{{ editedItem.fatherProfession }}</h5>
                          </v-flex>
                        </v-layout>
                      </v-flex>
                    </v-layout>
                    <v-layout>
                      <v-flex xs12>
                        <v-layout>
                          <v-flex xs6>
                            <b>
                              <h5 class="right my-1">
                                <b>Mother Profession:</b>
                              </h5>
                            </b>
                          </v-flex>
                          <v-flex xs6>
                            <h5 class="my-1">{{ editedItem.motherProfession }}</h5>
                          </v-flex>
                        </v-layout>
                      </v-flex>
                    </v-layout>
f4df757fe   Neeraj Sharma   responsive vie in...
411
412
413
                  </v-flex>
                </v-layout>
              </v-container>
aa8fc5033   Neeraj Sharma   implenment all pa...
414
              <!-- </v-card-text> -->
813e55a79   Neeraj Sharma   implement parents...
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
            </v-card>
          </v-dialog>
  
          <v-snackbar
            :timeout="timeout"
            :top="y === 'top'"
            :right="x === 'right'"
            :vertical="mode === 'vertical'"
            v-model="snackbar"
            color="success"
          >{{ text }}</v-snackbar>
  
          <!-- ****** EXISTING-USERS Parents TABLE ****** -->
          <v-data-table
            :headers="headers"
            :items="parentsList"
            :pagination.sync="pagination"
            :search="search"
          >
            <template slot="items" slot-scope="props">
f4df757fe   Neeraj Sharma   responsive vie in...
435
              <td id="td" class="text-xs-center">{{ props.index + 1}}</td>
813e55a79   Neeraj Sharma   implement parents...
436
437
438
439
440
441
442
              <td id="td" class="text-xs-center">{{ props.item.email }}</td>
              <td id="td" class="text-xs-center">{{ props.item.fatherName }}</td>
              <td id="td" class="text-xs-center">{{ props.item.fatherCellNo }}</td>
              <td id="td" class="text-xs-center">{{ props.item.motherName }}</td>
              <td id="td" class="text-xs-center">{{ props.item.motherCellNo }}</td>
              <td class="text-xs-center">
                <span>
495e4037c   Neeraj Sharma   update
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
                  <v-tooltip top>
                    <img
                      slot="activator"
                      style="cursor:pointer; width:25px; height:18px; "
                      class="mr5"
                      @click="profile(props.item)"
                      src="/static/icon/eye1.png"
                    />
                    <span>View</span>
                  </v-tooltip>
                  <v-tooltip top>
                    <img
                      slot="activator"
                      style="cursor:pointer; width:20px; height:18px; "
                      class="mr5"
                      @click="editItem(props.item)"
                      src="/static/icon/edit1.png"
                    />
                    <span>Edit</span>
                  </v-tooltip>
813e55a79   Neeraj Sharma   implement parents...
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
                </span>
              </td>
            </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-tab-item>
  
        <!-- ****** ADD PARENTS DETAILS****** -->
        <v-tab-item>
          <v-container fluid class="mt-5">
            <v-layout align-center justify-center fill-height>
aa8fc5033   Neeraj Sharma   implenment all pa...
479
              <v-flex xs12 sm12 md10 lg11>
813e55a79   Neeraj Sharma   implement parents...
480
481
482
483
484
485
486
487
488
489
490
491
492
493
                <v-card>
                  <v-container fluid class>
                    <v-layout>
                      <v-flex xs12>
                        <v-snackbar
                          :timeout="timeout"
                          :top="y === 'top'"
                          :right="x === 'right'"
                          :vertical="mode === 'vertical'"
                          v-model="snackbar"
                          color="success"
                        >{{ text }}</v-snackbar>
                        <v-flex xs12 sm12>
                          <v-form ref="parentForm" v-model="valid" lazy-validation>
a910d5d2a   Neeraj Sharma   responsive design...
494
                            <v-container fluid class="hidden-xs-only hidden-sm-only">
813e55a79   Neeraj Sharma   implement parents...
495
496
497
498
                              <v-layout>
                                <v-flex xs12 sm6>
                                  <v-layout>
                                    <v-flex xs4 class="pt-4 subheading">
fc77c38e0   Neeraj Sharma   fixed all task ch...
499
500
501
502
503
504
505
506
                                      <label class="right">Father Cell No:</label>
                                    </v-flex>
                                    <v-flex xs8 class="ml-3">
                                      <v-text-field
                                        v-model="parentData.fatherCellNo"
                                        placeholder="fill your father Cell Number"
                                        type="number"
                                        :rules="fatheCellNoRules"
f6200ce53   Neeraj Sharma   send number via a...
507
                                        counter="10"
fc77c38e0   Neeraj Sharma   fixed all task ch...
508
509
510
511
512
513
514
515
                                        required
                                      ></v-text-field>
                                    </v-flex>
                                  </v-layout>
                                </v-flex>
                                <v-flex xs12 sm6>
                                  <v-layout>
                                    <v-flex xs4 class="pt-4 subheading">
813e55a79   Neeraj Sharma   implement parents...
516
517
518
519
520
                                      <label class="right">Parent Email Id:</label>
                                    </v-flex>
                                    <v-flex xs8 class="ml-3">
                                      <v-text-field
                                        placeholder="fill Parent email"
813e55a79   Neeraj Sharma   implement parents...
521
522
                                        v-model="parentData.email"
                                        type="text"
813e55a79   Neeraj Sharma   implement parents...
523
524
525
526
527
                                        required
                                      ></v-text-field>
                                    </v-flex>
                                  </v-layout>
                                </v-flex>
fc77c38e0   Neeraj Sharma   fixed all task ch...
528
529
                              </v-layout>
                              <v-layout>
813e55a79   Neeraj Sharma   implement parents...
530
531
532
533
534
535
536
537
                                <v-flex xs12 sm6>
                                  <v-layout>
                                    <v-flex xs4 class="pt-4 subheading">
                                      <label class="right">Father Name:</label>
                                    </v-flex>
                                    <v-flex xs8 class="ml-3">
                                      <v-text-field
                                        v-model="parentData.fatherName"
813e55a79   Neeraj Sharma   implement parents...
538
539
540
541
542
543
                                        placeholder="Fill your father Name"
                                        required
                                      ></v-text-field>
                                    </v-flex>
                                  </v-layout>
                                </v-flex>
813e55a79   Neeraj Sharma   implement parents...
544
545
546
                                <v-flex xs12 sm6>
                                  <v-layout>
                                    <v-flex xs4 class="pt-4 subheading">
fc77c38e0   Neeraj Sharma   fixed all task ch...
547
                                      <label class="right">Father Profession:</label>
813e55a79   Neeraj Sharma   implement parents...
548
549
550
                                    </v-flex>
                                    <v-flex xs8 class="ml-3">
                                      <v-text-field
fc77c38e0   Neeraj Sharma   fixed all task ch...
551
552
                                        v-model="parentData.fatherProfession"
                                        placeholder="fill your father Profession"
813e55a79   Neeraj Sharma   implement parents...
553
554
555
556
557
                                        required
                                      ></v-text-field>
                                    </v-flex>
                                  </v-layout>
                                </v-flex>
fc77c38e0   Neeraj Sharma   fixed all task ch...
558
559
                              </v-layout>
                              <v-layout>
813e55a79   Neeraj Sharma   implement parents...
560
561
562
563
564
565
566
567
568
                                <v-flex xs12 sm6>
                                  <v-layout>
                                    <v-flex xs4 class="pt-4 subheading">
                                      <label class="right">Mother Name:</label>
                                    </v-flex>
                                    <v-flex xs8 class="ml-3">
                                      <v-text-field
                                        v-model="parentData.motherName"
                                        placeholder="fill your Mother Name"
813e55a79   Neeraj Sharma   implement parents...
569
                                        type="text"
813e55a79   Neeraj Sharma   implement parents...
570
571
572
573
574
                                        required
                                      ></v-text-field>
                                    </v-flex>
                                  </v-layout>
                                </v-flex>
813e55a79   Neeraj Sharma   implement parents...
575
576
577
578
579
580
581
582
583
                                <v-flex xs12 sm6>
                                  <v-layout>
                                    <v-flex xs4 class="pt-4 subheading">
                                      <label class="right">Mother Cell No:</label>
                                    </v-flex>
                                    <v-flex xs8 class="ml-3">
                                      <v-text-field
                                        v-model="parentData.motherCellNo"
                                        placeholder="fill your  Mother Cell Number"
f6200ce53   Neeraj Sharma   send number via a...
584
                                        counter="10"
813e55a79   Neeraj Sharma   implement parents...
585
                                        type="number"
fc77c38e0   Neeraj Sharma   fixed all task ch...
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
                                        required
                                      ></v-text-field>
                                    </v-flex>
                                  </v-layout>
                                </v-flex>
                              </v-layout>
                              <v-layout>
                                <v-flex xs12 sm6>
                                  <v-layout>
                                    <v-flex xs4 class="pt-4 subheading">
                                      <label class="right">Mother Profession:</label>
                                    </v-flex>
                                    <v-flex xs8 class="ml-3">
                                      <v-text-field
                                        v-model="parentData.motherProfession"
                                        placeholder="fill your Mother Profession"
a910d5d2a   Neeraj Sharma   responsive design...
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
                                        type="text"
                                        required
                                      ></v-text-field>
                                    </v-flex>
                                  </v-layout>
                                </v-flex>
                              </v-layout>
                              <v-flex xs12 sm12>
                                <v-layout>
                                  <v-flex xs6 sm6 offset-sm1>
                                    <v-btn @click="clear" round dark class="ml-4">clear</v-btn>
                                  </v-flex>
                                  <v-flex xs6 sm6>
                                    <v-btn
                                      class="right"
                                      @click="submitParentDetails"
                                      round
                                      dark
                                      :loading="loading"
                                      v-show="showParent"
                                    >Add</v-btn>
                                  </v-flex>
                                </v-layout>
                              </v-flex>
                            </v-container>
                            <v-container fluid class="hidden-lg-only hidden-xl-only hidden-md-only">
                              <v-layout>
                                <v-flex xs12 sm6>
                                  <v-layout wrap>
                                    <v-flex xs12 class="pt-4 subheading">
                                      <label>Father Cell No:</label>
                                    </v-flex>
                                    <v-flex xs12>
                                      <v-text-field
                                        v-model="parentData.fatherCellNo"
f6200ce53   Neeraj Sharma   send number via a...
637
638
                                        :rules="fatheCellNoRules"
                                        counter="10"
a910d5d2a   Neeraj Sharma   responsive design...
639
640
                                        placeholder="fill your father Cell Number"
                                        type="number"
a910d5d2a   Neeraj Sharma   responsive design...
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
733
                                        required
                                      ></v-text-field>
                                    </v-flex>
                                  </v-layout>
                                </v-flex>
                                <v-flex xs12 sm6>
                                  <v-layout wrap>
                                    <v-flex xs12 class="pt-4 subheading">
                                      <label>Parent Email Id:</label>
                                    </v-flex>
                                    <v-flex xs12>
                                      <v-text-field
                                        placeholder="fill Parent email"
                                        v-model="parentData.email"
                                        type="text"
                                        required
                                      ></v-text-field>
                                    </v-flex>
                                  </v-layout>
                                </v-flex>
                              </v-layout>
                              <v-layout>
                                <v-flex xs12 sm6>
                                  <v-layout wrap>
                                    <v-flex xs12 class="pt-4 subheading">
                                      <label>Father Name:</label>
                                    </v-flex>
                                    <v-flex xs12>
                                      <v-text-field
                                        v-model="parentData.fatherName"
                                        placeholder="Fill your father Name"
                                        required
                                      ></v-text-field>
                                    </v-flex>
                                  </v-layout>
                                </v-flex>
                                <v-flex xs12 sm6>
                                  <v-layout wrap>
                                    <v-flex xs12 class="pt-4 subheading">
                                      <label>Father Profession:</label>
                                    </v-flex>
                                    <v-flex xs12>
                                      <v-text-field
                                        v-model="parentData.fatherProfession"
                                        placeholder="fill your father Profession"
                                        required
                                      ></v-text-field>
                                    </v-flex>
                                  </v-layout>
                                </v-flex>
                              </v-layout>
                              <v-layout>
                                <v-flex xs12 sm6>
                                  <v-layout wrap>
                                    <v-flex xs12 class="pt-4 subheading">
                                      <label>Mother Name:</label>
                                    </v-flex>
                                    <v-flex xs12>
                                      <v-text-field
                                        v-model="parentData.motherName"
                                        placeholder="fill your Mother Name"
                                        type="text"
                                        required
                                      ></v-text-field>
                                    </v-flex>
                                  </v-layout>
                                </v-flex>
                                <v-flex xs12 sm6>
                                  <v-layout wrap>
                                    <v-flex xs42 class="pt-4 subheading">
                                      <label>Mother Cell No:</label>
                                    </v-flex>
                                    <v-flex xs12>
                                      <v-text-field
                                        v-model="parentData.motherCellNo"
                                        placeholder="fill your  Mother Cell Number"
                                        type="number"
                                        required
                                      ></v-text-field>
                                    </v-flex>
                                  </v-layout>
                                </v-flex>
                              </v-layout>
                              <v-layout>
                                <v-flex xs12 sm6>
                                  <v-layout wrap>
                                    <v-flex xs12 class="pt-4 subheading">
                                      <label>Mother Profession:</label>
                                    </v-flex>
                                    <v-flex xs12>
                                      <v-text-field
                                        v-model="parentData.motherProfession"
                                        placeholder="fill your Mother Profession"
fc77c38e0   Neeraj Sharma   fixed all task ch...
734
                                        type="text"
813e55a79   Neeraj Sharma   implement parents...
735
736
737
738
739
740
741
                                        required
                                      ></v-text-field>
                                    </v-flex>
                                  </v-layout>
                                </v-flex>
                              </v-layout>
                              <v-flex xs12 sm12>
495e4037c   Neeraj Sharma   update
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
                                <v-layout>
                                  <v-flex xs6 sm6 offset-sm1>
                                    <v-btn @click="clear" round dark class="ml-4">clear</v-btn>
                                  </v-flex>
                                  <v-flex xs6 sm6>
                                    <v-btn
                                      class="right"
                                      @click="submitParentDetails"
                                      round
                                      dark
                                      :loading="loading"
                                      v-show="showParent"
                                    >Add</v-btn>
                                  </v-flex>
                                </v-layout>
813e55a79   Neeraj Sharma   implement parents...
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
                              </v-flex>
                            </v-container>
                          </v-form>
                        </v-flex>
                      </v-flex>
                    </v-layout>
                  </v-container>
                </v-card>
              </v-flex>
            </v-layout>
          </v-container>
        </v-tab-item>
      </v-tabs>
      <div class="loader" v-if="showLoader">
        <v-progress-circular indeterminate color="white"></v-progress-circular>
      </div>
    </v-app>
  </template>
  
  <script>
  import http from "@/Services/http.js";
  import Util from "@/util";
  import moment from "moment";
  
  export default {
    data: () => ({
      showParent: true,
      snackbar: false,
      y: "top",
      x: "right",
      mode: "",
      timeout: 3000,
      text: "",
      showLoader: false,
      loading: false,
      date: null,
      search: "",
      menu: false,
      menu1: false,
      dialog: false,
      dialog1: false,
      valid: true,
4efdca564   Neeraj Sharma   solve bugs parent...
799
      validEditParent: true,
813e55a79   Neeraj Sharma   implement parents...
800
801
802
803
804
805
806
      isActive: true,
      newActive: false,
      AddUsercredentials: {},
      pagination: {
        rowsPerPage: 15
      },
      fatherNameRules: [v => !!v || " Father Name is required"],
f6200ce53   Neeraj Sharma   send number via a...
807
808
809
810
      fatheCellNoRules: [
        v => !!v || " father Cell Number  is required",
        v => v <= 10000000000 || "Max 10 characters is required"
      ],
4efdca564   Neeraj Sharma   solve bugs parent...
811
812
      editFatherNoRule: [
        v => !!v || " father Cell Number  is required",
f6200ce53   Neeraj Sharma   send number via a...
813
814
        v => v <= 10000000000 || "Max 10 characters is required"
      ],
4efdca564   Neeraj Sharma   solve bugs parent...
815
816
  
      editfatherCellNo: [v => !!v || " Father Name is required"],
813e55a79   Neeraj Sharma   implement parents...
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
      errorMessages: "",
      emailRules: [
        v => !!v || "E-mail is required",
        v =>
          /^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(v) ||
          "E-mail must be valid"
      ],
      headers: [
        {
          text: "No",
          align: "center",
          sortable: false,
          value: "No"
        },
        { text: "Email", value: "email", sortable: false, align: "center" },
        {
          text: "Father Name",
          value: "fatherName",
          sortable: false,
          align: "center"
        },
        {
          text: "Father Cell No",
          value: "fatherName",
          sortable: false,
          align: "center"
        },
        {
          text: "Mother Name",
          value: "motherName",
          sortable: false,
          align: "center"
        },
        {
          text: "Mother Cell No",
          value: "motherCellNo",
          sortable: false,
          align: "center"
        },
        { text: "Action", value: "", sortable: false, align: "center" }
      ],
      parentsList: [],
      editedIndex: -1,
      parentData: {},
f6200ce53   Neeraj Sharma   send number via a...
861
      max: 10,
813e55a79   Neeraj Sharma   implement parents...
862
863
864
865
866
867
      editedItem: {
        fatherName: "",
        fatherCellNo: "",
        motherName: "",
        motherCellNo: "",
        email: ""
a17c68a03   Neeraj Sharma   implement two rou...
868
      }
813e55a79   Neeraj Sharma   implement parents...
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
    }),
    watch: {
      menu(val) {
        val && this.$nextTick(() => (this.$refs.picker.activePicker = "YEAR"));
      },
      menu1(val) {
        val && this.$nextTick(() => (this.$refs.picker.activePicker = "YEAR"));
      }
    },
    methods: {
      editItem(item) {
        this.editedIndex = this.parentsList.indexOf(item);
        this.editedItem = Object.assign({}, item);
        this.dialog = true;
      },
      profile(item) {
35c05b960   Neeraj Sharma   implement functio...
885
        // console.log("item", item);
813e55a79   Neeraj Sharma   implement parents...
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
        this.editedIndex = this.parentsList.indexOf(item);
        this.editedItem = Object.assign({}, item);
        this.dialog1 = true;
      },
      activeTab(type) {
        switch (type) {
          case "existing":
            this.newActive = false;
            this.isActive = true;
            break;
  
          default:
            this.newActive = true;
            this.isActive = false;
            break;
        }
      },
      close() {
        this.dialog = false;
        setTimeout(() => {
          this.editedItem = Object.assign({}, this.defaultItem);
          this.editedIndex = -1;
        }, 300);
      },
      close1() {
        this.dialog1 = false;
      },
      clear() {
        this.$refs.parentForm.reset();
      },
      save() {
4efdca564   Neeraj Sharma   solve bugs parent...
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
        if (this.$refs.editParentForm.validate()) {
          this.editedItem.parentId = this.editedItem._id;
          http()
            .put("/updateParent", this.editedItem)
            .then(response => {
              this.snackbar = true;
              this.color = "green";
              this.text = "Successfully Student Existing User";
              this.getParentDetails();
              this.close();
            })
            .catch(error => {
              this.snackbar = true;
              this.color = "error";
              this.text = error.response.data.message;
              if (error.response.data.statusText) {
                this.text = error.response.data.statusText;
              }
            });
        }
813e55a79   Neeraj Sharma   implement parents...
937
      },
f6200ce53   Neeraj Sharma   send number via a...
938
      async submitParentDetails() {
813e55a79   Neeraj Sharma   implement parents...
939
        if (this.$refs.parentForm.validate()) {
fc77c38e0   Neeraj Sharma   fixed all task ch...
940
          this.parentData.role = "PARENT";
813e55a79   Neeraj Sharma   implement parents...
941
          this.loading = true;
f6200ce53   Neeraj Sharma   send number via a...
942
          await http()
fc77c38e0   Neeraj Sharma   fixed all task ch...
943
            .post("/createParent", this.parentData)
813e55a79   Neeraj Sharma   implement parents...
944
945
            .then(response => {
              this.parentId = response.data.data.id;
a0650f86b   Neeraj Sharma   implement class v...
946
947
              this.snackbar = true;
              this.text = response.data.data.message;
813e55a79   Neeraj Sharma   implement parents...
948
949
950
951
952
              this.getParentDetails();
              this.clear();
              this.loading = false;
            })
            .catch(error => {
f6200ce53   Neeraj Sharma   send number via a...
953
              // console.log(error.response.data);
a0650f86b   Neeraj Sharma   implement class v...
954
955
956
              this.snackbar = true;
              this.text = error.response.data.message;
              if (error.response.data.statusText) {
813e55a79   Neeraj Sharma   implement parents...
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
                this.text = error.response.data.statusText;
              }
              this.loading = false;
            });
        }
      },
      getParentDetails() {
        http()
          .get("getParentsList", {
            headers: {
              Authorization: "Bearer " + this.$store.state.token
            }
          })
          .then(response => {
            this.parentsList = response.data.data;
          })
          .catch(error => {
00e4bc4e1   Neeraj Sharma   fixed auntentication
974
975
976
977
978
979
980
981
            // console.log("err====>", error.response.data.message);
            this.showLoader = false;
            if (error.response.status === 401) {
              this.$router.replace({ path: "/" });
              this.$store.dispatch("setToken", null);
              this.$store.dispatch("Id", null);
              this.$store.dispatch("Role", null);
            }
813e55a79   Neeraj Sharma   implement parents...
982
          });
813e55a79   Neeraj Sharma   implement parents...
983
984
985
986
987
      }
    },
    mounted() {
      this.getParentDetails();
    },
a17c68a03   Neeraj Sharma   implement two rou...
988
989
990
991
992
993
994
995
    created() {
      this.$root.$on("app:search", search => {
        this.search = search;
      });
    },
    beforeDestroy() {
      // dont forget to remove the listener
      this.$root.$off("app:search");
813e55a79   Neeraj Sharma   implement parents...
996
997
998
999
    }
  };
  </script>
  <style scoped>
813e55a79   Neeraj Sharma   implement parents...
1000
  .active {
687e0b929   Neeraj Sharma   add user,attenden...
1001
    background-color: gray;
813e55a79   Neeraj Sharma   implement parents...
1002
1003
1004
1005
1006
    color: white !important;
  }
  .activebtn {
    color: black !important;
  }
813e55a79   Neeraj Sharma   implement parents...
1007
  </style>