Blame view

src/pages/Parent/parents.vue 36.6 KB
813e55a79   Neeraj Sharma   implement parents...
1
  <template>
68d742034   Neeraj Sharma   implement new des...
2
3
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
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
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
    <v-container fluid class="body-color">
      <v-dialog v-model="editParentDilaog" max-width="600px" scrollable>
        <v-card flat class="card-style pa-2" dark>
          <v-layout>
            <v-flex xs12>
              <label class="title text-xs-center">Edit Parents</label>
              <v-icon size="24" class="right" @click="editParentDilaog = false">cancel</v-icon>
            </v-flex>
          </v-layout>
          <v-card-text class="hidden-xs-only hidden-sm-only">
            <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>
11797ea5a   Shikha Mishra   added password field
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
                <v-layout>
                  <v-flex xs4 class="pt-4 subheading">
                    <label class="right">Password:</label>
                  </v-flex>
                  <v-flex xs8 class="ml-3">
                    <v-text-field
                      :append-icon="e1 ? 'visibility_off' : 'visibility'"
                      :append-icon-cb="() => (e1 = !e1)"
                      :type="e1 ? 'password' : 'text'"
                      :rules="password"
                      placeholder="Enter Your Password"
                      required
                    ></v-text-field>
                  </v-flex>
                </v-layout>
68d742034   Neeraj Sharma   implement new des...
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
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
              </v-flex>
              <v-layout>
                <v-flex xs12 sm12>
                  <v-card-actions>
                    <v-spacer></v-spacer>
                    <v-btn round dark @click="save" class="add-button">Save</v-btn>
                    <v-spacer></v-spacer>
                  </v-card-actions>
                </v-flex>
              </v-layout>
            </v-form>
          </v-card-text>
          <v-card-text style="height: 600px;" class="hidden-lg-only hidden-xl-only hidden-md-only">
            <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>
11797ea5a   Shikha Mishra   added password field
247
248
249
250
251
252
253
254
255
256
257
                <v-flex xs12 class="pt-4 subheading">
                  <label>Password:</label>
                </v-flex>
                <v-flex xs12>
                  <v-text-field
                    v-model="editedItem.password"
                    placeholder="Enter Password"
                    type="text"
                    required
                  ></v-text-field>
                </v-flex>
68d742034   Neeraj Sharma   implement new des...
258
259
260
261
262
263
264
265
266
267
268
269
270
271
              </v-layout>
            </v-flex>
            <v-layout>
              <v-flex xs12 sm12>
                <v-card-actions>
                  <v-spacer></v-spacer>
                  <v-btn round dark @click="save" class="add-button">Save</v-btn>
                  <v-spacer></v-spacer>
                </v-card-actions>
              </v-flex>
            </v-layout>
          </v-card-text>
        </v-card>
      </v-dialog>
813e55a79   Neeraj Sharma   implement parents...
272

68d742034   Neeraj Sharma   implement new des...
273
      <!-- ****** PROFILE VIEW Parents DEATILS ******  -->
813e55a79   Neeraj Sharma   implement parents...
274

68d742034   Neeraj Sharma   implement new des...
275
276
277
278
279
280
281
282
283
284
285
286
287
      <v-dialog v-model="profileParentDialog" max-width="500px" scrollable>
        <v-card class="card-style pa-2" dark>
          <v-layout>
            <v-flex xs12>
              <label class="title text-xs-center">View Parent</label>
              <v-icon size="24" class="right" @click="profileParentDialog = false">cancel</v-icon>
            </v-flex>
          </v-layout>
          <v-container grid-list-md>
            <v-layout wrap>
              <v-flex xs12>
                <v-layout>
                  <v-flex xs12 sm12>
4efdca564   Neeraj Sharma   solve bugs parent...
288
                    <v-layout>
68d742034   Neeraj Sharma   implement new des...
289
290
291
292
                      <v-flex xs6>
                        <h5 class="right my-1">
                          <b>Email:</b>
                        </h5>
4efdca564   Neeraj Sharma   solve bugs parent...
293
                      </v-flex>
68d742034   Neeraj Sharma   implement new des...
294
295
                      <v-flex xs6>
                        <h5 class="my-1">{{ editedItem.email }}</h5>
4efdca564   Neeraj Sharma   solve bugs parent...
296
297
298
                      </v-flex>
                    </v-layout>
                  </v-flex>
68d742034   Neeraj Sharma   implement new des...
299
300
                </v-layout>
                <v-layout>
4efdca564   Neeraj Sharma   solve bugs parent...
301
302
                  <v-flex xs12>
                    <v-layout>
68d742034   Neeraj Sharma   implement new des...
303
304
305
306
307
308
                      <v-flex xs6>
                        <b>
                          <h5 class="right my-1">
                            <b>Fahter Name:</b>
                          </h5>
                        </b>
4efdca564   Neeraj Sharma   solve bugs parent...
309
                      </v-flex>
68d742034   Neeraj Sharma   implement new des...
310
311
                      <v-flex xs6>
                        <h5 class="my-1">{{ editedItem.fatherName }}</h5>
4efdca564   Neeraj Sharma   solve bugs parent...
312
313
314
                      </v-flex>
                    </v-layout>
                  </v-flex>
68d742034   Neeraj Sharma   implement new des...
315
316
                </v-layout>
                <v-layout>
4efdca564   Neeraj Sharma   solve bugs parent...
317
318
                  <v-flex xs12>
                    <v-layout>
68d742034   Neeraj Sharma   implement new des...
319
320
321
322
323
324
                      <v-flex xs6>
                        <b>
                          <h5 class="right my-1">
                            <b>Mother Name:</b>
                          </h5>
                        </b>
4efdca564   Neeraj Sharma   solve bugs parent...
325
                      </v-flex>
68d742034   Neeraj Sharma   implement new des...
326
327
                      <v-flex xs6>
                        <h5 class="my-1">{{ editedItem.motherName }}</h5>
4efdca564   Neeraj Sharma   solve bugs parent...
328
329
330
                      </v-flex>
                    </v-layout>
                  </v-flex>
68d742034   Neeraj Sharma   implement new des...
331
332
                </v-layout>
                <v-layout>
4efdca564   Neeraj Sharma   solve bugs parent...
333
334
                  <v-flex xs12>
                    <v-layout>
68d742034   Neeraj Sharma   implement new des...
335
336
337
338
339
340
                      <v-flex sm6 xs6>
                        <b>
                          <h5 class="right my-1">
                            <b>Father Cell No:</b>
                          </h5>
                        </b>
4efdca564   Neeraj Sharma   solve bugs parent...
341
                      </v-flex>
68d742034   Neeraj Sharma   implement new des...
342
343
                      <v-flex sm6 xs6>
                        <h5 class="my-1">{{ editedItem.fatherCellNo }}</h5>
4efdca564   Neeraj Sharma   solve bugs parent...
344
345
346
                      </v-flex>
                    </v-layout>
                  </v-flex>
68d742034   Neeraj Sharma   implement new des...
347
348
                </v-layout>
                <v-layout>
4efdca564   Neeraj Sharma   solve bugs parent...
349
350
                  <v-flex xs12>
                    <v-layout>
68d742034   Neeraj Sharma   implement new des...
351
352
353
354
355
356
                      <v-flex xs6>
                        <b>
                          <h5 class="right my-1">
                            <b>Mother Cell No:</b>
                          </h5>
                        </b>
4efdca564   Neeraj Sharma   solve bugs parent...
357
                      </v-flex>
68d742034   Neeraj Sharma   implement new des...
358
359
                      <v-flex xs6>
                        <h5 class="my-1">{{ editedItem.motherCellNo }}</h5>
4efdca564   Neeraj Sharma   solve bugs parent...
360
361
362
                      </v-flex>
                    </v-layout>
                  </v-flex>
68d742034   Neeraj Sharma   implement new des...
363
364
                </v-layout>
                <v-layout>
4efdca564   Neeraj Sharma   solve bugs parent...
365
366
                  <v-flex xs12>
                    <v-layout>
68d742034   Neeraj Sharma   implement new des...
367
368
369
370
371
372
373
374
375
                      <v-flex xs6>
                        <b>
                          <h5 class="right my-1 hidden-lg-only hidden-xl-only hidden-md-only">
                            <b>FatherProfession:</b>
                          </h5>
                          <h5 class="right my-1 hidden-sm-only hidden-xs-only">
                            <b>Father Profession:</b>
                          </h5>
                        </b>
4efdca564   Neeraj Sharma   solve bugs parent...
376
                      </v-flex>
68d742034   Neeraj Sharma   implement new des...
377
378
                      <v-flex xs6>
                        <h5 class="my-1">{{ editedItem.fatherProfession }}</h5>
4efdca564   Neeraj Sharma   solve bugs parent...
379
380
381
                      </v-flex>
                    </v-layout>
                  </v-flex>
68d742034   Neeraj Sharma   implement new des...
382
383
                </v-layout>
                <v-layout>
4efdca564   Neeraj Sharma   solve bugs parent...
384
385
                  <v-flex xs12>
                    <v-layout>
68d742034   Neeraj Sharma   implement new des...
386
387
388
389
390
391
392
393
394
                      <v-flex xs6>
                        <b>
                          <h5 class="right my-1 hidden-lg-only hidden-xl-only hidden-md-only">
                            <b>MotherProfession:</b>
                          </h5>
                          <h5 class="right my-1 hidden-sm-only hidden-xs-only">
                            <b>Mother Profession:</b>
                          </h5>
                        </b>
4efdca564   Neeraj Sharma   solve bugs parent...
395
                      </v-flex>
68d742034   Neeraj Sharma   implement new des...
396
397
                      <v-flex xs6>
                        <h5 class="my-1">{{ editedItem.motherProfession }}</h5>
4efdca564   Neeraj Sharma   solve bugs parent...
398
399
400
                      </v-flex>
                    </v-layout>
                  </v-flex>
11797ea5a   Shikha Mishra   added password field
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
                  <v-flex xs12>
                    <v-layout>
                      <v-flex xs6>
                        <b>
                          <h5 class="right my-1 hidden-lg-only hidden-xl-only hidden-md-only">
                            <b>Password:</b>
                          </h5>
                          <h5 class="right my-1 hidden-sm-only hidden-xs-only">
                            <b>Password:</b>
                          </h5>
                        </b>
                      </v-flex>
                      <v-flex xs6>
                        <h5 class="my-1">{{ editedItem.password }}</h5>
                      </v-flex>
                    </v-layout>
                  </v-flex>
a910d5d2a   Neeraj Sharma   responsive design...
418
                </v-layout>
68d742034   Neeraj Sharma   implement new des...
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
              </v-flex>
            </v-layout>
          </v-container>
        </v-card>
      </v-dialog>
      <!-- ****** EXISTING-USERS Parents TABLE ****** -->
      <v-toolbar color="transparent" flat>
        <v-btn
          fab
          dark
          class="open-dialog-button hidden-xl-only hidden-md-only hidden-lg-only"
          small
          @click="addParentDialog = true"
        >
          <v-icon dark>add</v-icon>
        </v-btn>
        <v-btn
          round
          class="open-dialog-button hidden-sm-only hidden-xs-only"
          dark
          @click="addParentDialog = true"
        >
          <v-icon class="white--text pr-1" size="20">add</v-icon>Add Parent
        </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...
447
              <img src="/static/icon/search.png" alt="icon" />
68d742034   Neeraj Sharma   implement new des...
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
479
480
481
482
483
484
485
            </v-avatar>
          </v-btn>
        </v-card-title>
        <v-flex xs8 sm8 md2 lg2 v-show="showSearch">
          <v-layout>
            <v-text-field
              v-model="search"
              label="Search"
              prepend-inner-icon="search"
              color="primary"
              style="transition: 0.8s cubic-bezier(0.25, 0.8, 0.25, 1); !important"
            ></v-text-field>
            <v-icon @click="closeSearch" color="error">close</v-icon>
          </v-layout>
        </v-flex>
      </v-toolbar>
      <v-data-table
        :headers="headers"
        :items="parentsList"
        :pagination.sync="pagination"
        :search="search"
      >
        <template slot="items" slot-scope="props">
          <tr class="tr">
            <td class="text-xs-center td td-row">{{ props.index + 1}}</td>
            <td class="text-xs-center td td-row">{{ props.item.email }}</td>
            <td class="text-xs-center td td-row">{{ props.item.fatherName }}</td>
            <td class="text-xs-center td td-row">{{ props.item.fatherCellNo }}</td>
            <td class="text-xs-center td td-row">{{ props.item.motherName }}</td>
            <td class="text-xs-center td td-row">{{ props.item.motherCellNo }}</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...
486
                    src="/static/icon/view.png"
68d742034   Neeraj Sharma   implement new des...
487
488
489
490
491
492
493
494
                  />
                  <span>View</span>
                </v-tooltip>
                <v-tooltip top>
                  <img
                    slot="activator"
                    style="cursor:pointer; width:20px; height:18px; "
                    @click="editItem(props.item)"
aa310d61a   Shikha Mishra   added functionali...
495
                    src="/static/icon/edit.png"
68d742034   Neeraj Sharma   implement new des...
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
                    class="mr-3"
                  />
                  <span>Edit</span>
                </v-tooltip>
              </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>
f4df757fe   Neeraj Sharma   responsive vie in...
511

68d742034   Neeraj Sharma   implement new des...
512
513
514
515
516
517
518
519
520
521
522
523
524
525
      <!-- ****** ADD PARENTS DETAILS****** -->
      <v-dialog v-model="addParentDialog" max-width="1100px">
        <v-card flat class="card-style pa-2" dark>
          <v-layout>
            <v-flex xs12>
              <label class="title text-xs-center">Add Parent</label>
              <v-icon size="24" class="right" @click="addParentDialog = false">cancel</v-icon>
            </v-flex>
          </v-layout>
          <v-container fluid fill-height>
            <v-layout align-center>
              <v-flex xs12 sm12>
                <v-form ref="parentForm" v-model="valid" lazy-validation>
                  <v-container fluid class="hidden-xs-only hidden-sm-only">
813e55a79   Neeraj Sharma   implement parents...
526
                    <v-layout>
68d742034   Neeraj Sharma   implement new des...
527
                      <v-flex xs12 sm6>
813e55a79   Neeraj Sharma   implement parents...
528
                        <v-layout>
68d742034   Neeraj Sharma   implement new des...
529
530
                          <v-flex xs4 class="pt-4 subheading">
                            <label class="right">Father Cell No:</label>
813e55a79   Neeraj Sharma   implement parents...
531
                          </v-flex>
68d742034   Neeraj Sharma   implement new des...
532
533
534
535
536
537
538
539
540
                          <v-flex xs8 class="ml-3">
                            <v-text-field
                              v-model="parentData.fatherCellNo"
                              placeholder="fill your father Cell Number"
                              type="number"
                              :rules="fatheCellNoRules"
                              counter="10"
                              required
                            ></v-text-field>
813e55a79   Neeraj Sharma   implement parents...
541
542
543
                          </v-flex>
                        </v-layout>
                      </v-flex>
68d742034   Neeraj Sharma   implement new des...
544
                      <v-flex xs12 sm6>
cfb5c6445   Neeraj Sharma   add task
545
                        <v-layout>
68d742034   Neeraj Sharma   implement new des...
546
547
                          <v-flex xs4 class="pt-4 subheading">
                            <label class="right">Parent Email Id:</label>
cfb5c6445   Neeraj Sharma   add task
548
                          </v-flex>
68d742034   Neeraj Sharma   implement new des...
549
550
551
552
553
554
555
                          <v-flex xs8 class="ml-3">
                            <v-text-field
                              placeholder="fill Parent email"
                              v-model="parentData.email"
                              type="text"
                              required
                            ></v-text-field>
cfb5c6445   Neeraj Sharma   add task
556
557
558
                          </v-flex>
                        </v-layout>
                      </v-flex>
813e55a79   Neeraj Sharma   implement parents...
559
560
                    </v-layout>
                    <v-layout>
68d742034   Neeraj Sharma   implement new des...
561
                      <v-flex xs12 sm6>
813e55a79   Neeraj Sharma   implement parents...
562
                        <v-layout>
68d742034   Neeraj Sharma   implement new des...
563
564
                          <v-flex xs4 class="pt-4 subheading">
                            <label class="right">Father Name:</label>
813e55a79   Neeraj Sharma   implement parents...
565
                          </v-flex>
68d742034   Neeraj Sharma   implement new des...
566
567
568
569
570
571
                          <v-flex xs8 class="ml-3">
                            <v-text-field
                              v-model="parentData.fatherName"
                              placeholder="Fill your father Name"
                              required
                            ></v-text-field>
813e55a79   Neeraj Sharma   implement parents...
572
573
574
                          </v-flex>
                        </v-layout>
                      </v-flex>
68d742034   Neeraj Sharma   implement new des...
575
                      <v-flex xs12 sm6>
813e55a79   Neeraj Sharma   implement parents...
576
                        <v-layout>
68d742034   Neeraj Sharma   implement new des...
577
578
                          <v-flex xs4 class="pt-4 subheading">
                            <label class="right">Father Profession:</label>
813e55a79   Neeraj Sharma   implement parents...
579
                          </v-flex>
68d742034   Neeraj Sharma   implement new des...
580
581
582
583
584
585
                          <v-flex xs8 class="ml-3">
                            <v-text-field
                              v-model="parentData.fatherProfession"
                              placeholder="fill your father Profession"
                              required
                            ></v-text-field>
813e55a79   Neeraj Sharma   implement parents...
586
587
588
                          </v-flex>
                        </v-layout>
                      </v-flex>
f4df757fe   Neeraj Sharma   responsive vie in...
589
590
                    </v-layout>
                    <v-layout>
68d742034   Neeraj Sharma   implement new des...
591
                      <v-flex xs12 sm6>
813e55a79   Neeraj Sharma   implement parents...
592
                        <v-layout>
68d742034   Neeraj Sharma   implement new des...
593
594
                          <v-flex xs4 class="pt-4 subheading">
                            <label class="right">Mother Name:</label>
813e55a79   Neeraj Sharma   implement parents...
595
                          </v-flex>
68d742034   Neeraj Sharma   implement new des...
596
597
598
599
600
601
602
                          <v-flex xs8 class="ml-3">
                            <v-text-field
                              v-model="parentData.motherName"
                              placeholder="fill your Mother Name"
                              type="text"
                              required
                            ></v-text-field>
813e55a79   Neeraj Sharma   implement parents...
603
604
605
                          </v-flex>
                        </v-layout>
                      </v-flex>
68d742034   Neeraj Sharma   implement new des...
606
                      <v-flex xs12 sm6>
fc77c38e0   Neeraj Sharma   fixed all task ch...
607
                        <v-layout>
68d742034   Neeraj Sharma   implement new des...
608
609
                          <v-flex xs4 class="pt-4 subheading">
                            <label class="right">Mother Cell No:</label>
fc77c38e0   Neeraj Sharma   fixed all task ch...
610
                          </v-flex>
68d742034   Neeraj Sharma   implement new des...
611
612
613
614
615
616
617
618
                          <v-flex xs8 class="ml-3">
                            <v-text-field
                              v-model="parentData.motherCellNo"
                              placeholder="fill your  Mother Cell Number"
                              counter="10"
                              type="number"
                              required
                            ></v-text-field>
fc77c38e0   Neeraj Sharma   fixed all task ch...
619
620
621
622
623
                          </v-flex>
                        </v-layout>
                      </v-flex>
                    </v-layout>
                    <v-layout>
68d742034   Neeraj Sharma   implement new des...
624
                      <v-flex xs12 sm6>
fc77c38e0   Neeraj Sharma   fixed all task ch...
625
                        <v-layout>
68d742034   Neeraj Sharma   implement new des...
626
627
                          <v-flex xs4 class="pt-4 subheading">
                            <label class="right">Mother Profession:</label>
fc77c38e0   Neeraj Sharma   fixed all task ch...
628
                          </v-flex>
68d742034   Neeraj Sharma   implement new des...
629
630
631
632
633
634
635
                          <v-flex xs8 class="ml-3">
                            <v-text-field
                              v-model="parentData.motherProfession"
                              placeholder="fill your Mother Profession"
                              type="text"
                              required
                            ></v-text-field>
fc77c38e0   Neeraj Sharma   fixed all task ch...
636
637
638
                          </v-flex>
                        </v-layout>
                      </v-flex>
11797ea5a   Shikha Mishra   added password field
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
                      <v-flex xs12 sm6>
                        <v-layout>
                          <v-flex xs4 class="pt-4 subheading">
                            <label class="right">Password:</label>
                          </v-flex>
                          <v-flex xs8 class="ml-3">
                            <v-text-field
                              v-model="parentData.password"
                              :append-icon="e1 ? 'visibility_off' : 'visibility'"
                              :append-icon-cb="() => (e1 = !e1)"
                              :type="e1 ? 'password' : 'text'"
                              :rules="password"
                              placeholder="Enter Your Password"
                              required
                            ></v-text-field>
                          </v-flex>
                        </v-layout>
                      </v-flex>
fc77c38e0   Neeraj Sharma   fixed all task ch...
657
                    </v-layout>
68d742034   Neeraj Sharma   implement new des...
658
659
                    <v-flex xs12 sm12>
                      <v-layout>
813e55a79   Neeraj Sharma   implement parents...
660
                        <v-flex xs12 sm12>
68d742034   Neeraj Sharma   implement new des...
661
662
663
664
665
666
667
668
669
                          <v-btn
                            class="right add-button"
                            @click="submitParentDetails"
                            round
                            dark
                            :loading="loading"
                            v-show="showParent"
                          >Add</v-btn>
                          <v-btn @click="clear" round dark class="clear-button right">Clear</v-btn>
813e55a79   Neeraj Sharma   implement parents...
670
                        </v-flex>
68d742034   Neeraj Sharma   implement new des...
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
734
735
736
                      </v-layout>
                    </v-flex>
                  </v-container>
                  <v-container fluid class="hidden-lg-only hidden-xl-only hidden-md-only">
                    <v-layout wrap>
                      <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"
                              :rules="fatheCellNoRules"
                              counter="10"
                              placeholder="fill your father Cell Number"
                              type="number"
                              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 wrap>
                      <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>
813e55a79   Neeraj Sharma   implement parents...
737
738
                      </v-flex>
                    </v-layout>
68d742034   Neeraj Sharma   implement new des...
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
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
                    <v-layout wrap>
                      <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 wrap>
                      <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"
                              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" class="clear-button" round dark>clear</v-btn>
                        </v-flex>
                        <v-flex xs6 sm6>
                          <v-btn
                            class="add-button"
                            @click="submitParentDetails"
                            round
                            dark
                            :loading="loading"
                            v-show="showParent"
                          >Add</v-btn>
                        </v-flex>
                      </v-layout>
                    </v-flex>
813e55a79   Neeraj Sharma   implement parents...
805
                  </v-container>
68d742034   Neeraj Sharma   implement new des...
806
                </v-form>
813e55a79   Neeraj Sharma   implement parents...
807
808
809
              </v-flex>
            </v-layout>
          </v-container>
68d742034   Neeraj Sharma   implement new des...
810
811
        </v-card>
      </v-dialog>
813e55a79   Neeraj Sharma   implement parents...
812
813
814
      <div class="loader" v-if="showLoader">
        <v-progress-circular indeterminate color="white"></v-progress-circular>
      </div>
68d742034   Neeraj Sharma   implement new des...
815
816
817
818
819
820
821
822
823
      <v-snackbar
        :timeout="timeout"
        :top="y === 'top'"
        :right="x === 'right'"
        :vertical="mode === 'vertical'"
        v-model="snackbar"
        color="success"
      >{{ text }}</v-snackbar>
    </v-container>
813e55a79   Neeraj Sharma   implement parents...
824
825
826
827
828
829
830
831
832
  </template>
  
  <script>
  import http from "@/Services/http.js";
  import Util from "@/util";
  import moment from "moment";
  
  export default {
    data: () => ({
11797ea5a   Shikha Mishra   added password field
833
      e1: true,
813e55a79   Neeraj Sharma   implement parents...
834
835
836
837
      showParent: true,
      snackbar: false,
      y: "top",
      x: "right",
68d742034   Neeraj Sharma   implement new des...
838
      color: "",
813e55a79   Neeraj Sharma   implement parents...
839
840
841
      mode: "",
      timeout: 3000,
      text: "",
68d742034   Neeraj Sharma   implement new des...
842
843
      show: true,
      showSearch: false,
813e55a79   Neeraj Sharma   implement parents...
844
845
846
847
      showLoader: false,
      loading: false,
      date: null,
      search: "",
11797ea5a   Shikha Mishra   added password field
848
      password: "",
68d742034   Neeraj Sharma   implement new des...
849
      addParentDialog: false,
813e55a79   Neeraj Sharma   implement parents...
850
851
      menu: false,
      menu1: false,
68d742034   Neeraj Sharma   implement new des...
852
853
854
      editParentDilaog: false,
      profileParentDialog: false,
      viewProfileParentDialog: false,
813e55a79   Neeraj Sharma   implement parents...
855
      valid: true,
4efdca564   Neeraj Sharma   solve bugs parent...
856
      validEditParent: true,
813e55a79   Neeraj Sharma   implement parents...
857
      pagination: {
68d742034   Neeraj Sharma   implement new des...
858
        rowsPerPage: 10
813e55a79   Neeraj Sharma   implement parents...
859
860
      },
      fatherNameRules: [v => !!v || " Father Name is required"],
f6200ce53   Neeraj Sharma   send number via a...
861
862
863
864
      fatheCellNoRules: [
        v => !!v || " father Cell Number  is required",
        v => v <= 10000000000 || "Max 10 characters is required"
      ],
11797ea5a   Shikha Mishra   added password field
865
866
867
868
      password: [
        v => !!v || "Password field is Required.",
        v => (/^(?=.*[a-z])(?=.*[0-9])(?=.*[!@#$%^&*])(?=.{8,})/).test(v) && v.length >= 8 || 'Min 8 characters lower case symbol required'
      ],
4efdca564   Neeraj Sharma   solve bugs parent...
869
870
      editFatherNoRule: [
        v => !!v || " father Cell Number  is required",
f6200ce53   Neeraj Sharma   send number via a...
871
872
        v => v <= 10000000000 || "Max 10 characters is required"
      ],
4efdca564   Neeraj Sharma   solve bugs parent...
873
874
  
      editfatherCellNo: [v => !!v || " Father Name is required"],
813e55a79   Neeraj Sharma   implement parents...
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
      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...
919
      max: 10,
813e55a79   Neeraj Sharma   implement parents...
920
921
922
923
924
      editedItem: {
        fatherName: "",
        fatherCellNo: "",
        motherName: "",
        motherCellNo: "",
11797ea5a   Shikha Mishra   added password field
925
926
        email: "",
        password: ""
a17c68a03   Neeraj Sharma   implement two rou...
927
      }
813e55a79   Neeraj Sharma   implement parents...
928
929
930
931
932
933
934
935
936
937
938
939
940
    }),
    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);
68d742034   Neeraj Sharma   implement new des...
941
        this.editParentDilaog = true;
813e55a79   Neeraj Sharma   implement parents...
942
943
      },
      profile(item) {
813e55a79   Neeraj Sharma   implement parents...
944
945
        this.editedIndex = this.parentsList.indexOf(item);
        this.editedItem = Object.assign({}, item);
68d742034   Neeraj Sharma   implement new des...
946
        this.profileParentDialog = true;
813e55a79   Neeraj Sharma   implement parents...
947
948
      },
      close() {
68d742034   Neeraj Sharma   implement new des...
949
        this.editParentDilaog = false;
813e55a79   Neeraj Sharma   implement parents...
950
      },
68d742034   Neeraj Sharma   implement new des...
951
952
      closeProfile() {
        this.profileParentDialog = false;
813e55a79   Neeraj Sharma   implement parents...
953
954
955
956
957
      },
      clear() {
        this.$refs.parentForm.reset();
      },
      save() {
4efdca564   Neeraj Sharma   solve bugs parent...
958
959
960
961
962
963
964
        if (this.$refs.editParentForm.validate()) {
          this.editedItem.parentId = this.editedItem._id;
          http()
            .put("/updateParent", this.editedItem)
            .then(response => {
              this.snackbar = true;
              this.color = "green";
68d742034   Neeraj Sharma   implement new des...
965
              this.text = response.data.message;
4efdca564   Neeraj Sharma   solve bugs parent...
966
967
968
969
970
971
972
973
974
975
976
977
              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...
978
      },
f6200ce53   Neeraj Sharma   send number via a...
979
      async submitParentDetails() {
813e55a79   Neeraj Sharma   implement parents...
980
        if (this.$refs.parentForm.validate()) {
fc77c38e0   Neeraj Sharma   fixed all task ch...
981
          this.parentData.role = "PARENT";
813e55a79   Neeraj Sharma   implement parents...
982
          this.loading = true;
f6200ce53   Neeraj Sharma   send number via a...
983
          await http()
fc77c38e0   Neeraj Sharma   fixed all task ch...
984
            .post("/createParent", this.parentData)
813e55a79   Neeraj Sharma   implement parents...
985
986
            .then(response => {
              this.parentId = response.data.data.id;
a0650f86b   Neeraj Sharma   implement class v...
987
              this.snackbar = true;
68d742034   Neeraj Sharma   implement new des...
988
989
              this.color = "green";
              this.text = response.data.message;
813e55a79   Neeraj Sharma   implement parents...
990
991
992
              this.getParentDetails();
              this.clear();
              this.loading = false;
68d742034   Neeraj Sharma   implement new des...
993
              this.addParentDialog = false;
813e55a79   Neeraj Sharma   implement parents...
994
995
            })
            .catch(error => {
f6200ce53   Neeraj Sharma   send number via a...
996
              // console.log(error.response.data);
a0650f86b   Neeraj Sharma   implement class v...
997
              this.snackbar = true;
68d742034   Neeraj Sharma   implement new des...
998
              this.color = "error";
a0650f86b   Neeraj Sharma   implement class v...
999
1000
              this.text = error.response.data.message;
              if (error.response.data.statusText) {
813e55a79   Neeraj Sharma   implement parents...
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
                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
1018
1019
1020
1021
1022
1023
1024
1025
            // 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...
1026
          });
68d742034   Neeraj Sharma   implement new des...
1027
1028
1029
1030
1031
1032
1033
1034
      },
      displaySearch() {
        (this.show = false), (this.showSearch = true);
      },
      closeSearch() {
        this.showSearch = false;
        this.show = true;
        this.search = "";
813e55a79   Neeraj Sharma   implement parents...
1035
1036
1037
1038
      }
    },
    mounted() {
      this.getParentDetails();
813e55a79   Neeraj Sharma   implement parents...
1039
1040
    }
  };
68d742034   Neeraj Sharma   implement new des...
1041
  </script>