Blame view
src/pages/Parent/parents.vue
44.4 KB
813e55a79
|
1 |
<template> |
68d742034
|
2 |
<v-container fluid class="body-color"> |
db965de89
|
3 |
<v-dialog v-model="editParentDilaog" max-width="600px" scrollable persistent> |
4da08fe72
|
4 |
<v-card flat class="Card-style pa-2"> |
68d742034
|
5 6 |
<v-layout> <v-flex xs12> |
688f289c3
|
7 |
<label class="title text-xs-center">Edit Parents Details</label> |
68d742034
|
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 |
<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> |
c29ba4fbb
|
43 |
<!-- EDIT FATHER CELL NUMBER - HIDDEN AT xs and sm screen --> |
68d742034
|
44 45 46 47 48 49 |
<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"> |
c29ba4fbb
|
50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
<v-layout row wrap> <v-flex md3 class="mt-3"> <vue-country-code @onSelect="editFatherCellCode" class="black--text"></vue-country-code> </v-flex> <v-flex md9> <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> |
68d742034
|
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 |
</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"> |
c29ba4fbb
|
102 103 104 105 106 107 |
<v-layout row wrap> <v-flex md3 class="mt-3"> <vue-country-code @onSelect="onSelect" class="black--text"></vue-country-code> </v-flex> <v-flex md9> <v-text-field |
f808d5875
|
108 109 110 |
v-model="editedItem.motherCellNo" placeholder="fill your Mother Cell Number" type="number" |
c29ba4fbb
|
111 112 113 114 |
required ></v-text-field> </v-flex> </v-layout> |
68d742034
|
115 116 |
</v-flex> </v-layout> |
f808d5875
|
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
</v-flex> <v-flex xs12> <!-- EDIT MOTHER CELL NUMBER - HIDDEN AT xs and sm screen --> <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
|
133 134 135 136 137 138 |
<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 |
229463bd5
|
139 140 141 |
v-model="editedItem.password" placeholder="Enter Password" type="text" |
11797ea5a
|
142 143 144 145 |
required ></v-text-field> </v-flex> </v-layout> |
68d742034
|
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 |
</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> |
c29ba4fbb
|
190 |
<!-- EDIT FATHER CELL NUMBER - visible AT xs and sm screen --> |
68d742034
|
191 192 193 194 195 |
<v-layout wrap> <v-flex xs12 class="pt-4 subheading"> <label>Father Cell No:</label> </v-flex> <v-flex xs12> |
c29ba4fbb
|
196 197 198 199 200 201 202 203 204 205 206 207 208 |
<v-layout row wrap> <v-flex sm3 class="mt-3"> <vue-country-code @onSelect="editFatherCellCode" class="black--text"></vue-country-code> </v-flex> <v-flex sm9> <v-text-field v-model="editedItem.fatherCellNo" placeholder="fill your father Cell Number" type="number" required ></v-text-field> </v-flex> </v-layout> |
68d742034
|
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 |
</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> |
c29ba4fbb
|
242 |
<!-- EDIT MOTHER CELL NUMBER - VISIBLE ONLY AT xs and sm screen --> |
68d742034
|
243 244 245 246 247 |
<v-layout wrap> <v-flex xs12 class="pt-4 subheading"> <label>Mother Cell No:</label> </v-flex> <v-flex xs12> |
c29ba4fbb
|
248 249 250 251 252 253 254 255 256 257 258 259 260 |
<v-layout row wrap> <v-flex sm3 class="mt-3"> <vue-country-code @onSelect="onSelect" class="black--text"></vue-country-code> </v-flex> <v-flex sm9> <v-text-field v-model="editedItem.motherCellNo" placeholder="fill your Mother Cell Number" type="number" required ></v-text-field> </v-flex> </v-layout> |
68d742034
|
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 |
</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
|
277 278 279 280 281 282 283 284 285 286 287 |
<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
|
288 289 290 291 292 293 294 295 296 297 298 299 300 301 |
</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
|
302 |
|
cb844617e
|
303 |
<!-- ****** RESET Parents MPIN ****** --> |
db965de89
|
304 |
<v-dialog v-model="resetParentMpin" max-width="500px" scrollable persistent> |
4da08fe72
|
305 |
<v-card class="Card-style pa-2"> |
cb844617e
|
306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 |
<v-layout> <v-flex xs12> <label class="title text-xs-center">Reset Mpin</label> <v-icon size="24" class="right" @click="resetParentMpin = false">cancel</v-icon> </v-flex> </v-layout> <v-card-text class="hidden-xs-only hidden-sm-only"> <v-form ref="resetParentMpinForm" v-model="validParentMpin" lazy-validation> <v-flex xs12> <v-layout> <v-flex xs3 sm4 class="pt-4 subheading"> <label class="right">Change Mpin:</label> </v-flex> <v-flex xs8 sm6 class="ml-3"> <v-text-field placeholder="change mpin" :rules="mPinRules" v-model="editMpin.mPin" type="number" counter="4" required ></v-text-field> </v-flex> </v-layout> </v-flex> </v-form> <v-layout> <v-flex xs12 sm12> <v-card-actions> <v-spacer></v-spacer> <v-btn round dark @click="resetMpin" class="add-button">Reset</v-btn> <v-spacer></v-spacer> </v-card-actions> </v-flex> </v-layout> </v-card-text> </v-card> |
058c4a6cf
|
343 |
</v-dialog> |
cb844617e
|
344 |
|
68d742034
|
345 |
<!-- ****** PROFILE VIEW Parents DEATILS ****** --> |
813e55a79
|
346 |
|
ba420d0d1
|
347 |
<v-dialog v-model="profileParentDialog" max-width="700px" persistent> |
4da08fe72
|
348 |
<v-card class="Card-style pa-2"> |
68d742034
|
349 350 |
<v-layout> <v-flex xs12> |
688f289c3
|
351 |
<label class="title text-xs-center">View Parent Details</label> |
68d742034
|
352 353 354 |
<v-icon size="24" class="right" @click="profileParentDialog = false">cancel</v-icon> </v-flex> </v-layout> |
710438de6
|
355 356 357 358 359 360 |
<v-flex align-center justify-center layout text-xs-center class="mt-3"> <v-avatar size="100px"> <img src="/static/icon/user.png" v-if="!editedItem.profilePicUrl" /> <img :src="editedItem.profilePicUrl" v-else-if="editedItem.profilePicUrl" /> </v-avatar> </v-flex> |
68d742034
|
361 362 363 364 365 |
<v-container grid-list-md> <v-layout wrap> <v-flex xs12> <v-layout> <v-flex xs12 sm12> |
4efdca564
|
366 |
<v-layout> |
68d742034
|
367 368 369 370 |
<v-flex xs6> <h5 class="right my-1"> <b>Email:</b> </h5> |
4efdca564
|
371 |
</v-flex> |
68d742034
|
372 373 |
<v-flex xs6> <h5 class="my-1">{{ editedItem.email }}</h5> |
4efdca564
|
374 375 376 |
</v-flex> </v-layout> </v-flex> |
68d742034
|
377 378 |
</v-layout> <v-layout> |
4efdca564
|
379 380 |
<v-flex xs12> <v-layout> |
68d742034
|
381 382 383 384 385 386 |
<v-flex xs6> <b> <h5 class="right my-1"> <b>Fahter Name:</b> </h5> </b> |
4efdca564
|
387 |
</v-flex> |
68d742034
|
388 389 |
<v-flex xs6> <h5 class="my-1">{{ editedItem.fatherName }}</h5> |
4efdca564
|
390 391 392 |
</v-flex> </v-layout> </v-flex> |
68d742034
|
393 394 |
</v-layout> <v-layout> |
4efdca564
|
395 396 |
<v-flex xs12> <v-layout> |
68d742034
|
397 398 399 400 401 402 |
<v-flex xs6> <b> <h5 class="right my-1"> <b>Mother Name:</b> </h5> </b> |
4efdca564
|
403 |
</v-flex> |
68d742034
|
404 405 |
<v-flex xs6> <h5 class="my-1">{{ editedItem.motherName }}</h5> |
4efdca564
|
406 407 408 |
</v-flex> </v-layout> </v-flex> |
68d742034
|
409 410 |
</v-layout> <v-layout> |
4efdca564
|
411 412 |
<v-flex xs12> <v-layout> |
68d742034
|
413 414 415 416 417 418 |
<v-flex sm6 xs6> <b> <h5 class="right my-1"> <b>Father Cell No:</b> </h5> </b> |
4efdca564
|
419 |
</v-flex> |
68d742034
|
420 421 |
<v-flex sm6 xs6> <h5 class="my-1">{{ editedItem.fatherCellNo }}</h5> |
4efdca564
|
422 423 424 |
</v-flex> </v-layout> </v-flex> |
68d742034
|
425 426 |
</v-layout> <v-layout> |
4efdca564
|
427 428 |
<v-flex xs12> <v-layout> |
68d742034
|
429 430 431 432 433 434 |
<v-flex xs6> <b> <h5 class="right my-1"> <b>Mother Cell No:</b> </h5> </b> |
4efdca564
|
435 |
</v-flex> |
68d742034
|
436 437 |
<v-flex xs6> <h5 class="my-1">{{ editedItem.motherCellNo }}</h5> |
4efdca564
|
438 439 440 |
</v-flex> </v-layout> </v-flex> |
68d742034
|
441 442 |
</v-layout> <v-layout> |
4efdca564
|
443 444 |
<v-flex xs12> <v-layout> |
68d742034
|
445 446 447 448 449 450 451 452 453 |
<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
|
454 |
</v-flex> |
68d742034
|
455 456 |
<v-flex xs6> <h5 class="my-1">{{ editedItem.fatherProfession }}</h5> |
4efdca564
|
457 458 459 |
</v-flex> </v-layout> </v-flex> |
68d742034
|
460 461 |
</v-layout> <v-layout> |
4efdca564
|
462 463 |
<v-flex xs12> <v-layout> |
68d742034
|
464 465 466 467 468 469 470 471 472 |
<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
|
473 |
</v-flex> |
68d742034
|
474 475 |
<v-flex xs6> <h5 class="my-1">{{ editedItem.motherProfession }}</h5> |
4efdca564
|
476 477 |
</v-flex> </v-layout> |
688f289c3
|
478 |
<!-- <v-layout> |
11797ea5a
|
479 480 481 482 483 484 485 486 487 488 489 490 491 |
<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> |
710438de6
|
492 |
</v-layout>--> |
11797ea5a
|
493 |
</v-flex> |
a910d5d2a
|
494 |
</v-layout> |
68d742034
|
495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 |
</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 |
710438de6
|
512 |
v-if="role != 'TEACHER' " |
68d742034
|
513 514 515 516 517 518 519 520 521 522 523 |
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
|
524 |
<img src="/static/icon/search.png" alt="icon" /> |
68d742034
|
525 526 527 |
</v-avatar> </v-btn> </v-card-title> |
612b79bb4
|
528 |
<v-flex xs8 sm8 md2 lg2 v-if="showSearch"> |
68d742034
|
529 530 531 532 533 534 |
<v-layout> <v-text-field v-model="search" label="Search" prepend-inner-icon="search" color="primary" |
612b79bb4
|
535 536 |
ref="searchField" autofocus |
68d742034
|
537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 |
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
|
565 |
src="/static/icon/view.png" |
68d742034
|
566 567 568 |
/> <span>View</span> </v-tooltip> |
710438de6
|
569 |
<v-tooltip top v-if="role != 'TEACHER' "> |
68d742034
|
570 571 572 573 |
<img slot="activator" style="cursor:pointer; width:20px; height:18px; " @click="editItem(props.item)" |
aa310d61a
|
574 |
src="/static/icon/edit.png" |
68d742034
|
575 576 577 578 |
class="mr-3" /> <span>Edit</span> </v-tooltip> |
058c4a6cf
|
579 580 581 582 |
<span v-if="role === 'ADMIN' "> <i class="material-icons md-18" style="cursor:pointer; width:20px; height:18px;" |
cb844617e
|
583 584 585 |
@click="resetParentMPIN(props.item)" >vpn_key</i> </span> |
68d742034
|
586 587 588 589 590 591 592 593 594 595 596 |
</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
|
597 |
|
7efe02762
|
598 |
<!-- ******DIALOG BOX - ADD PARENTS DETAILS****** --> |
db965de89
|
599 |
<v-dialog v-model="addParentDialog" max-width="1100px" v-if="addParentDialog" persistent> |
4da08fe72
|
600 |
<v-card flat class="Card-style pa-2"> |
68d742034
|
601 602 603 |
<v-layout> <v-flex xs12> <label class="title text-xs-center">Add Parent</label> |
8e8d14254
|
604 605 606 607 608 |
<v-icon size="24" class="right" @click="$refs.parentForm.reset();addParentDialog = false" >cancel</v-icon> |
68d742034
|
609 610 611 612 613 614 615 |
</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
|
616 |
<v-layout> |
c29ba4fbb
|
617 |
<!-- ADD FATHER CELL NUMBER HIDDEN ON xs and sm screen--> |
68d742034
|
618 |
<v-flex xs12 sm6> |
813e55a79
|
619 |
<v-layout> |
68d742034
|
620 621 |
<v-flex xs4 class="pt-4 subheading"> <label class="right">Father Cell No:</label> |
813e55a79
|
622 |
</v-flex> |
68d742034
|
623 |
<v-flex xs8 class="ml-3"> |
0a7184bf8
|
624 625 |
<v-layout row wrap> <v-flex md3 class="mt-3"> |
c29ba4fbb
|
626 |
<vue-country-code @onSelect="addFatherCellCode" class="black--text"></vue-country-code> |
0a7184bf8
|
627 628 629 630 631 632 633 634 635 636 637 638 |
</v-flex> <v-flex md9> <v-text-field v-model="parentData.fatherCellNo" placeholder="Father Cell Number" type="number" :rules="fatheCellNoRules" counter="10" required ></v-text-field> </v-flex> </v-layout> |
813e55a79
|
639 640 641 |
</v-flex> </v-layout> </v-flex> |
68d742034
|
642 |
<v-flex xs12 sm6> |
cfb5c6445
|
643 |
<v-layout> |
68d742034
|
644 645 |
<v-flex xs4 class="pt-4 subheading"> <label class="right">Parent Email Id:</label> |
cfb5c6445
|
646 |
</v-flex> |
68d742034
|
647 648 649 650 651 652 653 |
<v-flex xs8 class="ml-3"> <v-text-field placeholder="fill Parent email" v-model="parentData.email" type="text" required ></v-text-field> |
cfb5c6445
|
654 655 656 |
</v-flex> </v-layout> </v-flex> |
813e55a79
|
657 658 |
</v-layout> <v-layout> |
68d742034
|
659 |
<v-flex xs12 sm6> |
813e55a79
|
660 |
<v-layout> |
68d742034
|
661 662 |
<v-flex xs4 class="pt-4 subheading"> <label class="right">Father Name:</label> |
813e55a79
|
663 |
</v-flex> |
68d742034
|
664 665 666 667 668 669 |
<v-flex xs8 class="ml-3"> <v-text-field v-model="parentData.fatherName" placeholder="Fill your father Name" required ></v-text-field> |
813e55a79
|
670 671 672 |
</v-flex> </v-layout> </v-flex> |
68d742034
|
673 |
<v-flex xs12 sm6> |
813e55a79
|
674 |
<v-layout> |
68d742034
|
675 676 |
<v-flex xs4 class="pt-4 subheading"> <label class="right">Father Profession:</label> |
813e55a79
|
677 |
</v-flex> |
68d742034
|
678 679 680 681 682 683 |
<v-flex xs8 class="ml-3"> <v-text-field v-model="parentData.fatherProfession" placeholder="fill your father Profession" required ></v-text-field> |
813e55a79
|
684 685 686 |
</v-flex> </v-layout> </v-flex> |
f4df757fe
|
687 688 |
</v-layout> <v-layout> |
68d742034
|
689 |
<v-flex xs12 sm6> |
813e55a79
|
690 |
<v-layout> |
68d742034
|
691 692 |
<v-flex xs4 class="pt-4 subheading"> <label class="right">Mother Name:</label> |
813e55a79
|
693 |
</v-flex> |
68d742034
|
694 695 696 697 698 699 700 |
<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
|
701 702 703 |
</v-flex> </v-layout> </v-flex> |
0a7184bf8
|
704 |
<!-- MOTHER CELL NUMBER HIDDEN ON xs and sm screen --> |
68d742034
|
705 |
<v-flex xs12 sm6> |
fc77c38e0
|
706 |
<v-layout> |
68d742034
|
707 708 |
<v-flex xs4 class="pt-4 subheading"> <label class="right">Mother Cell No:</label> |
fc77c38e0
|
709 |
</v-flex> |
68d742034
|
710 |
<v-flex xs8 class="ml-3"> |
0a7184bf8
|
711 712 713 714 715 716 717 718 719 720 721 722 723 724 |
<v-layout row wrap> <v-flex md3 class="mt-3"> <vue-country-code @onSelect="onSelect" class="black--text"></vue-country-code> </v-flex> <v-flex md9> <v-text-field v-model="parentData.motherCellNo" placeholder="Mother Cell Number" counter="10" type="number" required ></v-text-field> </v-flex> </v-layout> |
fc77c38e0
|
725 726 727 728 729 |
</v-flex> </v-layout> </v-flex> </v-layout> <v-layout> |
68d742034
|
730 |
<v-flex xs12 sm6> |
fc77c38e0
|
731 |
<v-layout> |
68d742034
|
732 733 |
<v-flex xs4 class="pt-4 subheading"> <label class="right">Mother Profession:</label> |
fc77c38e0
|
734 |
</v-flex> |
68d742034
|
735 736 737 738 739 740 741 |
<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
|
742 743 744 |
</v-flex> </v-layout> </v-flex> |
11797ea5a
|
745 746 747 748 749 750 751 752 753 754 755 756 757 |
<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" |
5d5315b0f
|
758 |
:disabled="isFatherCellExists" |
11797ea5a
|
759 760 761 762 763 |
required ></v-text-field> </v-flex> </v-layout> </v-flex> |
fc77c38e0
|
764 |
</v-layout> |
68d742034
|
765 766 |
<v-flex xs12 sm12> <v-layout> |
813e55a79
|
767 |
<v-flex xs12 sm12> |
68d742034
|
768 769 770 771 772 773 774 775 776 |
<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
|
777 |
</v-flex> |
68d742034
|
778 779 780 781 782 |
</v-layout> </v-flex> </v-container> <v-container fluid class="hidden-lg-only hidden-xl-only hidden-md-only"> <v-layout wrap> |
c29ba4fbb
|
783 |
<!-- ADD FATHER CELL NUMBER -- VISIBLE ON xs and sm screens --> |
68d742034
|
784 785 786 787 788 |
<v-flex xs12 sm6> <v-layout wrap> <v-flex xs12 class="pt-4 subheading"> <label>Father Cell No:</label> </v-flex> |
0a7184bf8
|
789 790 |
<v-layout row wrap xs12> <v-flex sm3 class="mt-3"> |
c29ba4fbb
|
791 |
<vue-country-code @onSelect="addFatherCellCode" class="black--text"></vue-country-code> |
0a7184bf8
|
792 793 794 795 796 797 798 799 800 801 802 803 804 |
</v-flex> <v-flex sm9> <v-text-field v-model="parentData.fatherCellNo" :rules="fatheCellNoRules" counter="10" placeholder="Father Cell Number" type="number" required ></v-text-field> </v-flex> </v-layout> |
68d742034
|
805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 |
</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
|
851 852 |
</v-flex> </v-layout> |
68d742034
|
853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 |
<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> |
0a7184bf8
|
869 |
<!-- MOTHER CELL NUMBER - VISIBLE ONLY ON xs and sm screen--> |
68d742034
|
870 871 872 873 874 875 |
<v-flex xs12 sm6> <v-layout wrap> <v-flex xs42 class="pt-4 subheading"> <label>Mother Cell No:</label> </v-flex> <v-flex xs12> |
0a7184bf8
|
876 877 878 879 880 881 882 883 884 885 886 887 888 |
<v-layout row wrap> <v-flex sm3 class="mt-3"> <vue-country-code @onSelect="onSelect" class="black--text"></vue-country-code> </v-flex> <v-flex sm9> <v-text-field v-model="parentData.motherCellNo" placeholder="fill your Mother Cell Number" type="number" required ></v-text-field> </v-flex> </v-layout> |
68d742034
|
889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 |
</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
|
927 |
</v-container> |
68d742034
|
928 |
</v-form> |
813e55a79
|
929 930 931 |
</v-flex> </v-layout> </v-container> |
68d742034
|
932 933 |
</v-card> </v-dialog> |
813e55a79
|
934 935 936 |
<div class="loader" v-if="showLoader"> <v-progress-circular indeterminate color="white"></v-progress-circular> </div> |
68d742034
|
937 938 939 940 941 942 943 944 945 |
<v-snackbar :timeout="timeout" :top="y === 'top'" :right="x === 'right'" :vertical="mode === 'vertical'" v-model="snackbar" color="success" >{{ text }}</v-snackbar> </v-container> |
813e55a79
|
946 947 948 949 950 951 952 953 954 |
</template> <script> import http from "@/Services/http.js"; import Util from "@/util"; import moment from "moment"; export default { data: () => ({ |
c29ba4fbb
|
955 |
/* EDIT FATHER CELL */ |
f808d5875
|
956 |
editedFatherCellCode: "", |
c29ba4fbb
|
957 |
/* ADD FATHER CELL */ |
f808d5875
|
958 |
addedFatherCellCode: "", |
11797ea5a
|
959 |
e1: true, |
813e55a79
|
960 961 |
showParent: true, snackbar: false, |
710438de6
|
962 963 |
role: "", // TEACHER: "", |
813e55a79
|
964 965 |
y: "top", x: "right", |
68d742034
|
966 |
color: "", |
813e55a79
|
967 968 969 |
mode: "", timeout: 3000, text: "", |
68d742034
|
970 971 |
show: true, showSearch: false, |
813e55a79
|
972 973 974 975 |
showLoader: false, loading: false, date: null, search: "", |
11797ea5a
|
976 |
password: "", |
68d742034
|
977 |
addParentDialog: false, |
813e55a79
|
978 979 |
menu: false, menu1: false, |
68d742034
|
980 981 |
editParentDilaog: false, profileParentDialog: false, |
cb844617e
|
982 |
resetParentMpin: false, |
68d742034
|
983 |
viewProfileParentDialog: false, |
813e55a79
|
984 |
valid: true, |
4efdca564
|
985 |
validEditParent: true, |
cb844617e
|
986 |
validParentMpin: true, |
813e55a79
|
987 |
pagination: { |
058c4a6cf
|
988 |
rowsPerPage: 10, |
813e55a79
|
989 |
}, |
058c4a6cf
|
990 |
fatherNameRules: [(v) => !!v || " Father Name is required"], |
f6200ce53
|
991 |
fatheCellNoRules: [ |
058c4a6cf
|
992 993 |
(v) => !!v || " father Cell Number is required", (v) => v <= 10000000000 || "Max 10 characters is required", |
f6200ce53
|
994 |
], |
11797ea5a
|
995 |
password: [ |
058c4a6cf
|
996 |
(v) => !!v || "Password field is Required.", |
3c297e236
|
997 |
// v => (/^(?=.*[a-z])(?=.*[0-9])(?=.*[!@#$%^&*])(?=.{8,})/).test(v) && v.length >= 8 || 'Min 8 characters lower case symbol required' |
11797ea5a
|
998 |
], |
4efdca564
|
999 |
editFatherNoRule: [ |
058c4a6cf
|
1000 1001 |
(v) => !!v || " father Cell Number is required", (v) => v <= 10000000000 || "Max 10 characters is required", |
f6200ce53
|
1002 |
], |
4efdca564
|
1003 |
|
058c4a6cf
|
1004 |
editfatherCellNo: [(v) => !!v || " Father Name is required"], |
813e55a79
|
1005 1006 |
errorMessages: "", emailRules: [ |
058c4a6cf
|
1007 1008 |
(v) => !!v || "E-mail is required", (v) => |
813e55a79
|
1009 |
/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(v) || |
058c4a6cf
|
1010 |
"E-mail must be valid", |
813e55a79
|
1011 |
], |
cb844617e
|
1012 |
mPinRules: [ |
058c4a6cf
|
1013 1014 |
(v) => !!v || "MPIN is required", (v) => v <= 10000 || "Max 4 numbers are required", |
cb844617e
|
1015 |
], |
813e55a79
|
1016 1017 1018 1019 1020 |
headers: [ { text: "No", align: "center", sortable: false, |
058c4a6cf
|
1021 |
value: "No", |
813e55a79
|
1022 1023 1024 1025 1026 1027 |
}, { text: "Email", value: "email", sortable: false, align: "center" }, { text: "Father Name", value: "fatherName", sortable: false, |
058c4a6cf
|
1028 |
align: "center", |
813e55a79
|
1029 1030 1031 1032 1033 |
}, { text: "Father Cell No", value: "fatherName", sortable: false, |
058c4a6cf
|
1034 |
align: "center", |
813e55a79
|
1035 1036 1037 1038 1039 |
}, { text: "Mother Name", value: "motherName", sortable: false, |
058c4a6cf
|
1040 |
align: "center", |
813e55a79
|
1041 1042 1043 1044 1045 |
}, { text: "Mother Cell No", value: "motherCellNo", sortable: false, |
058c4a6cf
|
1046 |
align: "center", |
813e55a79
|
1047 |
}, |
058c4a6cf
|
1048 |
{ text: "Action", value: "", sortable: false, align: "center" }, |
813e55a79
|
1049 1050 1051 1052 |
], parentsList: [], editedIndex: -1, parentData: {}, |
f6200ce53
|
1053 |
max: 10, |
813e55a79
|
1054 1055 1056 1057 1058 |
editedItem: { fatherName: "", fatherCellNo: "", motherName: "", motherCellNo: "", |
11797ea5a
|
1059 |
email: "", |
058c4a6cf
|
1060 |
password: "", |
cb844617e
|
1061 1062 |
}, editMpin: { |
058c4a6cf
|
1063 |
mPin: "", |
5d5315b0f
|
1064 |
}, |
058c4a6cf
|
1065 |
isFatherCellExists: false, |
813e55a79
|
1066 1067 1068 1069 1070 1071 1072 |
}), watch: { menu(val) { val && this.$nextTick(() => (this.$refs.picker.activePicker = "YEAR")); }, menu1(val) { val && this.$nextTick(() => (this.$refs.picker.activePicker = "YEAR")); |
058c4a6cf
|
1073 |
}, |
8e8d14254
|
1074 1075 1076 1077 1078 |
addParentDialog: function (val) { if (!val) { this.parentData = []; } }, |
813e55a79
|
1079 1080 |
}, methods: { |
0a7184bf8
|
1081 |
onSelect({ name, iso2, dialCode }) { |
c29ba4fbb
|
1082 1083 1084 |
// console.log("country codes", name, iso2, dialCode); // this.countryCode = iso2 }, |
f808d5875
|
1085 |
editFatherCellCode({ name, iso2, dialCode }) { |
c29ba4fbb
|
1086 |
// console.log("Edit father cell", name,iso2); |
f808d5875
|
1087 |
this.editedFatherCellCode = dialCode; |
c29ba4fbb
|
1088 |
}, |
f808d5875
|
1089 1090 |
addFatherCellCode({ name, iso2, dialCode }) { this.addedFatherCellCode = dialCode; |
0a7184bf8
|
1091 |
}, |
813e55a79
|
1092 1093 1094 |
editItem(item) { this.editedIndex = this.parentsList.indexOf(item); this.editedItem = Object.assign({}, item); |
68d742034
|
1095 |
this.editParentDilaog = true; |
813e55a79
|
1096 1097 |
}, profile(item) { |
813e55a79
|
1098 1099 |
this.editedIndex = this.parentsList.indexOf(item); this.editedItem = Object.assign({}, item); |
68d742034
|
1100 |
this.profileParentDialog = true; |
813e55a79
|
1101 |
}, |
cb844617e
|
1102 1103 1104 1105 |
resetParentMPIN(item) { this.editMpin = Object.assign({}, item); this.resetParentMpin = true; }, |
813e55a79
|
1106 |
close() { |
68d742034
|
1107 |
this.editParentDilaog = false; |
813e55a79
|
1108 |
}, |
68d742034
|
1109 1110 |
closeProfile() { this.profileParentDialog = false; |
813e55a79
|
1111 |
}, |
cb844617e
|
1112 1113 1114 |
closeReset() { this.resetParentMpin = false; }, |
813e55a79
|
1115 1116 1117 1118 |
clear() { this.$refs.parentForm.reset(); }, save() { |
4efdca564
|
1119 1120 |
if (this.$refs.editParentForm.validate()) { this.editedItem.parentId = this.editedItem._id; |
c29ba4fbb
|
1121 |
this.editedItem.countryCode = this.editedFatherCellCode; |
4efdca564
|
1122 1123 |
http() .put("/updateParent", this.editedItem) |
058c4a6cf
|
1124 |
.then((response) => { |
4efdca564
|
1125 1126 |
this.snackbar = true; this.color = "green"; |
68d742034
|
1127 |
this.text = response.data.message; |
4efdca564
|
1128 1129 1130 |
this.getParentDetails(); this.close(); }) |
058c4a6cf
|
1131 |
.catch((error) => { |
4efdca564
|
1132 1133 1134 1135 |
this.snackbar = true; this.color = "error"; this.text = error.response.data.message; if (error.response.data.statusText) { |
cb844617e
|
1136 1137 1138 1139 1140 1141 1142 1143 1144 |
this.text = error.response.data.statusText; } }); } }, resetMpin() { if (this.$refs.resetParentMpinForm.validate()) { var changeMpin = { parentId: this.editMpin._id, |
058c4a6cf
|
1145 |
mPin: this.editMpin.mPin, |
cb844617e
|
1146 1147 1148 |
}; http() .put("/resetMPin", changeMpin) |
058c4a6cf
|
1149 |
.then((response) => { |
cb844617e
|
1150 1151 1152 1153 1154 1155 1156 |
this.snackbar = true; this.color = "green"; this.text = response.data.message; this.getParentDetails(); this.resetParentMpin = false; this.closeReset(); }) |
058c4a6cf
|
1157 |
.catch((error) => { |
cb844617e
|
1158 1159 1160 1161 |
this.snackbar = true; this.color = "error"; this.text = error.response.data.message; if (error.response.data.statusText) { |
4efdca564
|
1162 1163 1164 1165 |
this.text = error.response.data.statusText; } }); } |
813e55a79
|
1166 |
}, |
f6200ce53
|
1167 |
async submitParentDetails() { |
813e55a79
|
1168 |
if (this.$refs.parentForm.validate()) { |
fc77c38e0
|
1169 |
this.parentData.role = "PARENT"; |
813e55a79
|
1170 |
this.loading = true; |
f808d5875
|
1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 |
(this.parentData.countryCode = this.addedFatherCellCode), await http() .post("/createParent", this.parentData) .then((response) => { this.parentId = response.data.data.id; this.snackbar = true; this.color = "green"; this.text = response.data.message; this.getParentDetails(); this.clear(); this.loading = false; this.isFatherCellExists = true; this.addParentDialog = false; }) .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; } this.loading = false; }); |
813e55a79
|
1194 1195 1196 1197 1198 1199 |
} }, getParentDetails() { http() .get("getParentsList", { headers: { |
058c4a6cf
|
1200 1201 |
Authorization: "Bearer " + this.$store.state.token, }, |
813e55a79
|
1202 |
}) |
058c4a6cf
|
1203 |
.then((response) => { |
813e55a79
|
1204 1205 |
this.parentsList = response.data.data; }) |
058c4a6cf
|
1206 |
.catch((error) => { |
00e4bc4e1
|
1207 1208 1209 1210 1211 1212 1213 1214 |
// 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
|
1215 |
}); |
68d742034
|
1216 1217 |
}, displaySearch() { |
8e8d14254
|
1218 |
this.show = false; |
612b79bb4
|
1219 1220 |
this.showSearch = true; // this.$refs.searchField.focus() |
68d742034
|
1221 1222 1223 1224 1225 |
}, closeSearch() { this.showSearch = false; this.show = true; this.search = ""; |
058c4a6cf
|
1226 |
}, |
813e55a79
|
1227 1228 1229 |
}, mounted() { this.getParentDetails(); |
710438de6
|
1230 1231 |
// console.log("role", this.$store.state.role); this.role = this.$store.state.role; |
058c4a6cf
|
1232 |
}, |
813e55a79
|
1233 |
}; |
68d742034
|
1234 |
</script> |