Commit 8e8d14254aba599c809fbc97d4ad2c789a65389a
1 parent
52d274996e
Exists in
master
and in
2 other branches
Cleared data while clicking outside the add/edit model and also on cross icon wh…
…ile login any role, Improve getParticularClass API, and Improve getStudentWithClass API
Showing
39 changed files
with
1870 additions
and
1118 deletions
Show diff stats
src/pages/Academic/assignment.vue
... | ... | @@ -316,12 +316,12 @@ |
316 | 316 | v-model="snackbar" |
317 | 317 | :color="color" |
318 | 318 | >{{ text }}</v-snackbar> |
319 | - <v-dialog v-model="addAssignmentDialog" max-width="400px"> | |
319 | + <v-dialog v-model="addAssignmentDialog" max-width="400px" v-if="addAssignmentDialog"> | |
320 | 320 | <v-card flat class="card-style pa-2" dark> |
321 | 321 | <v-layout> |
322 | 322 | <v-flex xs12> |
323 | 323 | <label class="title text-xs-center">Add Assignment</label> |
324 | - <v-icon size="24" class="right" @click="addAssignmentDialog = false">cancel</v-icon> | |
324 | + <v-icon size="24" class="right" @click="closeAddAssignmentModel">cancel</v-icon> | |
325 | 325 | </v-flex> |
326 | 326 | </v-layout> |
327 | 327 | <v-container fluid fill-height> |
... | ... | @@ -609,6 +609,14 @@ export default { |
609 | 609 | subjectRules: [(v) => !!v || "Student is required"], |
610 | 610 | fileRules: [(v) => !!v || "File is required"], |
611 | 611 | }), |
612 | + watch: { | |
613 | + addAssignmentDialog: function (val) { | |
614 | + if (!val) { | |
615 | + this.addAssignment = []; | |
616 | + this.imageName = ""; | |
617 | + } | |
618 | + }, | |
619 | + }, | |
612 | 620 | methods: { |
613 | 621 | dates: function (date) { |
614 | 622 | return moment(date).format("MMMM DD, YYYY"); |
... | ... | @@ -660,6 +668,12 @@ export default { |
660 | 668 | close1() { |
661 | 669 | this.viewAssignmentDialog = false; |
662 | 670 | }, |
671 | + closeAddAssignmentModel() { | |
672 | + this.addAssignmentDialog = false; | |
673 | + this.assignmentData = []; | |
674 | + this.addAssignment = []; | |
675 | + this.imageName = ""; | |
676 | + }, | |
663 | 677 | submit() { |
664 | 678 | var addAssignment = { |
665 | 679 | title: this.addAssignment.title, | ... | ... |
src/pages/Academic/routine.vue
... | ... | @@ -23,7 +23,7 @@ |
23 | 23 | item-text="classNum" |
24 | 24 | item-value="_id" |
25 | 25 | :rules="classRules" |
26 | - @change="getClassSubject(addRoutine.classId)" | |
26 | + @change="getClassSubject(editedItem.classId)" | |
27 | 27 | required |
28 | 28 | ></v-select> |
29 | 29 | </v-flex> |
... | ... | @@ -222,7 +222,7 @@ |
222 | 222 | <v-flex xs9 sm9 md2 lg2 xl2 v-if="showSearch"> |
223 | 223 | <v-layout> |
224 | 224 | <v-text-field |
225 | - autofocus | |
225 | + autofocus | |
226 | 226 | v-model="search" |
227 | 227 | label="Search" |
228 | 228 | prepend-inner-icon="search" |
... | ... | @@ -372,12 +372,13 @@ |
372 | 372 | v-model="snackbar" |
373 | 373 | :color="color" |
374 | 374 | >{{ text }}</v-snackbar> |
375 | - <v-dialog v-model="addRoutineDialog" max-width="600px"> | |
375 | + <v-dialog v-model="addRoutineDialog" max-width="600px" v-if="addRoutineDialog"> | |
376 | + v-if="addRoutineDialog" | |
376 | 377 | <v-card flat class="card-style pa-2" dark> |
377 | 378 | <v-layout> |
378 | 379 | <v-flex xs12> |
379 | 380 | <label class="title text-xs-center">Add Routine</label> |
380 | - <v-icon size="24" class="right" @click="addRoutineDialog = false">cancel</v-icon> | |
381 | + <v-icon size="24" class="right" @click="closeAddRoutineModel">cancel</v-icon> | |
381 | 382 | </v-flex> |
382 | 383 | </v-layout> |
383 | 384 | <v-container fluid fill-height> |
... | ... | @@ -671,6 +672,13 @@ export default { |
671 | 672 | startingTime: "", |
672 | 673 | editedItem: {}, |
673 | 674 | }), |
675 | + watch: { | |
676 | + addRoutineDialog: function (val) { | |
677 | + if (!val) { | |
678 | + this.addRoutine = []; | |
679 | + } | |
680 | + }, | |
681 | + }, | |
674 | 682 | methods: { |
675 | 683 | editItem(item, routineData) { |
676 | 684 | console.log("routineData", routineData); |
... | ... | @@ -709,7 +717,11 @@ export default { |
709 | 717 | close() { |
710 | 718 | this.editRoutineDialog = false; |
711 | 719 | }, |
712 | - | |
720 | + closeAddRoutineModel() { | |
721 | + this.addRoutineDialog = false; | |
722 | + this.classList = []; | |
723 | + this.addRoutine = []; | |
724 | + }, | |
713 | 725 | create() { |
714 | 726 | var routineData = { |
715 | 727 | schoolYear: this.addRoutine.schoolYear, | ... | ... |
src/pages/Academic/subject.vue
... | ... | @@ -285,7 +285,7 @@ |
285 | 285 | <v-flex xs9 sm9 md2 lg2 xl2 v-if="showSearch"> |
286 | 286 | <v-layout> |
287 | 287 | <v-text-field |
288 | - autofocus | |
288 | + autofocus | |
289 | 289 | v-model="search" |
290 | 290 | label="Search" |
291 | 291 | prepend-inner-icon="search" |
... | ... | @@ -365,12 +365,16 @@ |
365 | 365 | v-model="snackbar" |
366 | 366 | :color="color" |
367 | 367 | >{{ text }}</v-snackbar> |
368 | - <v-dialog v-model="addSubjectDialog" max-width="600px"> | |
368 | + <v-dialog v-model="addSubjectDialog" max-width="600px" v-if="addSubjectDialog"> | |
369 | 369 | <v-card flat class="card-style pa-2" dark> |
370 | 370 | <v-layout> |
371 | 371 | <v-flex xs12> |
372 | 372 | <label class="title text-xs-center">Add Subject</label> |
373 | - <v-icon size="24" class="right" @click="$refs.form.reset();addSubjectDialog = false">cancel</v-icon> | |
373 | + <v-icon | |
374 | + size="24" | |
375 | + class="right" | |
376 | + @click="$refs.form.reset();addSubjectDialog = false" | |
377 | + >cancel</v-icon> | |
374 | 378 | </v-flex> |
375 | 379 | </v-layout> |
376 | 380 | <v-container fluid fill-height> |
... | ... | @@ -625,6 +629,13 @@ export default { |
625 | 629 | // subjectAuthor: "" |
626 | 630 | }, |
627 | 631 | }), |
632 | + watch: { | |
633 | + addSubjectDialog: function (val) { | |
634 | + if (!val) { | |
635 | + this.addSubject = []; | |
636 | + } | |
637 | + }, | |
638 | + }, | |
628 | 639 | methods: { |
629 | 640 | pickFile() { |
630 | 641 | this.$refs.image.click(); |
... | ... | @@ -682,7 +693,7 @@ export default { |
682 | 693 | this.text = "New Subject added successfully"; |
683 | 694 | this.color = "green"; |
684 | 695 | this.addLoading = false; |
685 | - this.$refs.form.reset() | |
696 | + this.$refs.form.reset(); | |
686 | 697 | this.addSubjectDialog = false; |
687 | 698 | this.getClassSubject(_id); |
688 | 699 | }) | ... | ... |
src/pages/Academic/syllabus.vue
... | ... | @@ -165,7 +165,7 @@ |
165 | 165 | <v-flex xs9 sm9 md2 lg2 xl2 v-if="showSearch"> |
166 | 166 | <v-layout> |
167 | 167 | <v-text-field |
168 | - autofocus | |
168 | + autofocus | |
169 | 169 | v-model="search" |
170 | 170 | label="Search" |
171 | 171 | prepend-inner-icon="search" |
... | ... | @@ -192,10 +192,7 @@ |
192 | 192 | class="text-xs-center td td-row" |
193 | 193 | v-if="props.item.teacherId" |
194 | 194 | >{{ props.item.teacherId.name }}</td> |
195 | - <td | |
196 | - class="text-xs-center td td-row" | |
197 | - v-else | |
198 | - >{{ props.item.schoolId.name }}</td> | |
195 | + <td class="text-xs-center td td-row" v-else>{{ props.item.schoolId.name }}</td> | |
199 | 196 | <td class="text-xs-center td td-row"> |
200 | 197 | <v-btn |
201 | 198 | class="add-button" |
... | ... | @@ -246,12 +243,12 @@ |
246 | 243 | v-model="snackbar" |
247 | 244 | :color="color" |
248 | 245 | >{{ text }}</v-snackbar> |
249 | - <v-dialog v-model="addSyllabusDialog" max-width="400px"> | |
246 | + <v-dialog v-model="addSyllabusDialog" max-width="400px" v-if="addSyllabusDialog"> | |
250 | 247 | <v-card flat class="card-style pa-2" dark> |
251 | 248 | <v-layout> |
252 | 249 | <v-flex xs12> |
253 | 250 | <label class="title text-xs-center">Add Syllabus</label> |
254 | - <v-icon size="24" class="right" @click="addSyllabusDialog = false">cancel</v-icon> | |
251 | + <v-icon size="24" class="right" @click="closeAddStudentModel">cancel</v-icon> | |
255 | 252 | </v-flex> |
256 | 253 | </v-layout> |
257 | 254 | <v-container fluid fill-height> |
... | ... | @@ -398,52 +395,52 @@ export default { |
398 | 395 | loadingPdf: false, |
399 | 396 | |
400 | 397 | pagination: { |
401 | - rowsPerPage: 10 | |
398 | + rowsPerPage: 10, | |
402 | 399 | }, |
403 | 400 | token: "", |
404 | 401 | upload: "", |
405 | - titleRules: [v => !!v || " Title is required"], | |
406 | - descriptionRules: [v => !!v || " Description is required"], | |
407 | - classRules: [v => !!v || " Class Name is required"], | |
408 | - fileRules: [v => !!v || " File is required"], | |
402 | + titleRules: [(v) => !!v || " Title is required"], | |
403 | + descriptionRules: [(v) => !!v || " Description is required"], | |
404 | + classRules: [(v) => !!v || " Class Name is required"], | |
405 | + fileRules: [(v) => !!v || " File is required"], | |
409 | 406 | headers: [ |
410 | 407 | { |
411 | 408 | text: "No", |
412 | 409 | align: "", |
413 | 410 | sortable: false, |
414 | - value: "No" | |
411 | + value: "No", | |
415 | 412 | }, |
416 | 413 | { |
417 | 414 | text: "Title", |
418 | 415 | value: "title", |
419 | 416 | sortable: false, |
420 | - align: "center" | |
417 | + align: "center", | |
421 | 418 | }, |
422 | 419 | { |
423 | 420 | text: "Description", |
424 | 421 | value: "description", |
425 | 422 | sortable: false, |
426 | - align: "center" | |
423 | + align: "center", | |
427 | 424 | }, |
428 | 425 | { |
429 | 426 | text: "Date", |
430 | 427 | value: "created", |
431 | 428 | sortable: false, |
432 | - align: "center" | |
429 | + align: "center", | |
433 | 430 | }, |
434 | 431 | { |
435 | 432 | text: "Uploader", |
436 | 433 | value: "upload", |
437 | 434 | sortable: false, |
438 | - align: "center" | |
435 | + align: "center", | |
439 | 436 | }, |
440 | 437 | { |
441 | 438 | text: "File", |
442 | 439 | value: "documentUrl", |
443 | 440 | sortable: false, |
444 | - align: "center" | |
441 | + align: "center", | |
445 | 442 | }, |
446 | - { text: "Action", value: "", sortable: false, align: "center" } | |
443 | + { text: "Action", value: "", sortable: false, align: "center" }, | |
447 | 444 | ], |
448 | 445 | syllabusList: [], |
449 | 446 | classList: [], |
... | ... | @@ -453,19 +450,28 @@ export default { |
453 | 450 | showSyllabus: {}, |
454 | 451 | |
455 | 452 | editedItem: { |
456 | - subjectName: "" | |
453 | + subjectName: "", | |
457 | 454 | }, |
458 | 455 | imageData: {}, |
459 | 456 | imageName: "", |
460 | 457 | imageUrl: "", |
461 | - imageFile: "" | |
458 | + imageFile: "", | |
462 | 459 | }), |
463 | 460 | |
461 | + watch: { | |
462 | + addSyllabusDialog: function (val) { | |
463 | + if (!val) { | |
464 | + this.addSyllabus = []; | |
465 | + this.imageName = ""; | |
466 | + } | |
467 | + }, | |
468 | + }, | |
469 | + | |
464 | 470 | methods: { |
465 | 471 | pickFile() { |
466 | 472 | this.$refs.image.click(); |
467 | 473 | }, |
468 | - dates: function(date) { | |
474 | + dates: function (date) { | |
469 | 475 | return moment(date).format("MMMM DD, YYYY"); |
470 | 476 | }, |
471 | 477 | editItem(item) { |
... | ... | @@ -481,22 +487,22 @@ export default { |
481 | 487 | }, |
482 | 488 | deleteItem(item) { |
483 | 489 | let deleteSyallabus = { |
484 | - syallabusId: item._id | |
490 | + syallabusId: item._id, | |
485 | 491 | }; |
486 | 492 | http() |
487 | 493 | .delete( |
488 | 494 | "/deleteSyallabus", |
489 | 495 | confirm("Are you sure you want to delete this?") && { |
490 | - params: deleteSyallabus | |
496 | + params: deleteSyallabus, | |
491 | 497 | } |
492 | 498 | ) |
493 | - .then(response => { | |
499 | + .then((response) => { | |
494 | 500 | this.getSyallabusList(); |
495 | 501 | this.snackbar = true; |
496 | 502 | this.color = "green"; |
497 | 503 | this.text = "Successfully delete Existing Syllabus"; |
498 | 504 | }) |
499 | - .catch(error => { | |
505 | + .catch((error) => { | |
500 | 506 | this.snackbar = true; |
501 | 507 | this.text = error.response.data.message; |
502 | 508 | this.color = "error"; |
... | ... | @@ -505,6 +511,12 @@ export default { |
505 | 511 | close() { |
506 | 512 | this.editSyllabusDialog = false; |
507 | 513 | }, |
514 | + closeAddStudentModel() { | |
515 | + this.addSyllabusDialog = false; | |
516 | + this.syllabusList = []; | |
517 | + this.addSyllabus = []; | |
518 | + this.imageName = ""; | |
519 | + }, | |
508 | 520 | |
509 | 521 | submit() { |
510 | 522 | // var addSyllabus = { |
... | ... | @@ -521,7 +533,7 @@ export default { |
521 | 533 | "/": "image", |
522 | 534 | AAABAA: "image", |
523 | 535 | IywiV2hhdC: "other", |
524 | - bmFtZSxl: "other" | |
536 | + bmFtZSxl: "other", | |
525 | 537 | }; |
526 | 538 | function detectMimeType(b64) { |
527 | 539 | for (var s in signatures) { |
... | ... | @@ -540,7 +552,7 @@ export default { |
540 | 552 | } |
541 | 553 | http() |
542 | 554 | .post("/createSyallabus", this.addSyllabus) |
543 | - .then(response => { | |
555 | + .then((response) => { | |
544 | 556 | this.getSyallabusList(); |
545 | 557 | this.snackbar = true; |
546 | 558 | this.text = "Syllabus added successfully"; |
... | ... | @@ -548,7 +560,7 @@ export default { |
548 | 560 | this.color = "green"; |
549 | 561 | this.addSyllabusDialog = false; |
550 | 562 | }) |
551 | - .catch(error => { | |
563 | + .catch((error) => { | |
552 | 564 | // console.log(error); |
553 | 565 | this.snackbar = true; |
554 | 566 | this.text = error.response.data.message; |
... | ... | @@ -590,7 +602,7 @@ export default { |
590 | 602 | description: this.editedItem.description, |
591 | 603 | upload: this.editedItem.upload, |
592 | 604 | fileType: this.editedItem.fileType, |
593 | - fileName: this.imageName | |
605 | + fileName: this.imageName, | |
594 | 606 | }; |
595 | 607 | this.editLoading = true; |
596 | 608 | var signatures = { |
... | ... | @@ -599,7 +611,7 @@ export default { |
599 | 611 | UEsDBBQ: "other", |
600 | 612 | "/": "image", |
601 | 613 | AAABAA: "image", |
602 | - IywiV2hhdC: "other" | |
614 | + IywiV2hhdC: "other", | |
603 | 615 | }; |
604 | 616 | function detectMimeType(b64) { |
605 | 617 | for (var s in signatures) { |
... | ... | @@ -616,7 +628,7 @@ export default { |
616 | 628 | } |
617 | 629 | http() |
618 | 630 | .put("/updateSyallabus", syllabusData) |
619 | - .then(response => { | |
631 | + .then((response) => { | |
620 | 632 | this.snackbar = true; |
621 | 633 | this.text = "Successfully Edit Existing Syllabus"; |
622 | 634 | this.color = "green"; |
... | ... | @@ -627,23 +639,23 @@ export default { |
627 | 639 | "/getSyallabusList", |
628 | 640 | { params: { classId: this.addSyllabus.classId } }, |
629 | 641 | { |
630 | - headers: { Authorization: "Bearer " + this.token } | |
642 | + headers: { Authorization: "Bearer " + this.token }, | |
631 | 643 | } |
632 | 644 | ) |
633 | - .then(response => { | |
645 | + .then((response) => { | |
634 | 646 | this.syllabusList = response.data.data; |
635 | 647 | this.getSyallabusList(); |
636 | 648 | this.snackbar = true; |
637 | 649 | this.color = "green"; |
638 | 650 | this.close(); |
639 | 651 | }) |
640 | - .catch(err => { | |
652 | + .catch((err) => { | |
641 | 653 | console.log("err====>", err); |
642 | 654 | this.text = error.response.data.message; |
643 | 655 | this.color = "error"; |
644 | 656 | }); |
645 | 657 | }) |
646 | - .catch(error => { | |
658 | + .catch((error) => { | |
647 | 659 | this.editLoading = false; |
648 | 660 | }); |
649 | 661 | } |
... | ... | @@ -655,26 +667,26 @@ export default { |
655 | 667 | "/getSyallabusList", |
656 | 668 | { params: { classId: this.showSyllabus.classId } }, |
657 | 669 | { |
658 | - headers: { Authorization: "Bearer " + this.token } | |
670 | + headers: { Authorization: "Bearer " + this.token }, | |
659 | 671 | } |
660 | 672 | ) |
661 | - .then(response => { | |
673 | + .then((response) => { | |
662 | 674 | this.syllabusList = response.data.data; |
663 | 675 | this.showLoader = false; |
664 | 676 | }) |
665 | - .catch(err => { | |
677 | + .catch((err) => { | |
666 | 678 | this.showLoader = false; |
667 | 679 | }); |
668 | 680 | }, |
669 | 681 | getClass() { |
670 | 682 | http() |
671 | 683 | .get("/getClassesList", { |
672 | - headers: { Authorization: "Bearer " + this.token } | |
684 | + headers: { Authorization: "Bearer " + this.token }, | |
673 | 685 | }) |
674 | - .then(response => { | |
686 | + .then((response) => { | |
675 | 687 | this.classList = response.data.data; |
676 | 688 | }) |
677 | - .catch(error => { | |
689 | + .catch((error) => { | |
678 | 690 | if (error.response.status === 401) { |
679 | 691 | this.$router.replace({ path: "/" }); |
680 | 692 | this.$store.dispatch("setToken", null); |
... | ... | @@ -690,14 +702,14 @@ export default { |
690 | 702 | "/getSectionsList", |
691 | 703 | { params: { classId: _id } }, |
692 | 704 | { |
693 | - headers: { Authorization: "Bearer " + token } | |
705 | + headers: { Authorization: "Bearer " + token }, | |
694 | 706 | } |
695 | 707 | ) |
696 | - .then(response => { | |
708 | + .then((response) => { | |
697 | 709 | this.addSection = response.data.data; |
698 | 710 | this.showLoader = false; |
699 | 711 | }) |
700 | - .catch(err => { | |
712 | + .catch((err) => { | |
701 | 713 | this.showLoader = false; |
702 | 714 | }); |
703 | 715 | }, |
... | ... | @@ -768,12 +780,12 @@ export default { |
768 | 780 | // link.download = dataType |
769 | 781 | // link.click() |
770 | 782 | // URL.revokeObjectURL(link.href) |
771 | - } | |
783 | + }, | |
772 | 784 | }, |
773 | 785 | mounted() { |
774 | 786 | this.token = this.$store.state.token; |
775 | 787 | this.role = this.$store.state.role; |
776 | 788 | this.getClass(); |
777 | - } | |
789 | + }, | |
778 | 790 | }; |
779 | 791 | </script> |
780 | 792 | \ No newline at end of file | ... | ... |
src/pages/Account/expense.vue
... | ... | @@ -18,7 +18,11 @@ |
18 | 18 | <v-avatar size="140px" v-if="!editedItem.fileUrl && !imageUrl"> |
19 | 19 | <img src="/static/icon/user.png" /> |
20 | 20 | </v-avatar> |
21 | - <img :src="editedItem.fileUrl" v-else-if="editedItem.fileUrl && !imageUrl" style="border-radius:50%; width:150px"/> | |
21 | + <img | |
22 | + :src="editedItem.fileUrl" | |
23 | + v-else-if="editedItem.fileUrl && !imageUrl" | |
24 | + style="border-radius:50%; width:150px" | |
25 | + /> | |
22 | 26 | <img |
23 | 27 | v-if="imageUrl" |
24 | 28 | :src="imageUrl" |
... | ... | @@ -238,7 +242,13 @@ |
238 | 242 | </v-card-title> |
239 | 243 | <v-flex xs8 sm8 md3 lg2 v-if="showSearch"> |
240 | 244 | <v-layout> |
241 | - <v-text-field autofocus v-model="search" label="Search" prepend-inner-icon="search" color="primary"></v-text-field> | |
245 | + <v-text-field | |
246 | + autofocus | |
247 | + v-model="search" | |
248 | + label="Search" | |
249 | + prepend-inner-icon="search" | |
250 | + color="primary" | |
251 | + ></v-text-field> | |
242 | 252 | <v-icon @click="closeSearch" color="error">close</v-icon> |
243 | 253 | </v-layout> |
244 | 254 | </v-flex> |
... | ... | @@ -307,12 +317,12 @@ |
307 | 317 | </v-data-table> |
308 | 318 | |
309 | 319 | <!-- ****** Add Expense Data ****** --> |
310 | - <v-dialog v-model="addExpenseDialog" max-width="600px"> | |
320 | + <v-dialog v-model="addExpenseDialog" max-width="600px" v-if="addExpenseDialog"> | |
311 | 321 | <v-card flat class="card-style pa-2" dark> |
312 | 322 | <v-layout> |
313 | 323 | <v-flex xs12> |
314 | 324 | <label class="title text-xs-center">Add Expense</label> |
315 | - <v-icon size="24" class="right" @click="addExpenseDialog = false">cancel</v-icon> | |
325 | + <v-icon size="24" class="right" @click="closeAddExpenseModel">cancel</v-icon> | |
316 | 326 | </v-flex> |
317 | 327 | </v-layout> |
318 | 328 | <v-flex xs12 sm12> |
... | ... | @@ -504,37 +514,37 @@ export default { |
504 | 514 | addExpenseDialog: false, |
505 | 515 | showSearch: false, |
506 | 516 | pagination: { |
507 | - rowsPerPage: 10 | |
517 | + rowsPerPage: 10, | |
508 | 518 | }, |
509 | 519 | imageData: {}, |
510 | 520 | token: "", |
511 | 521 | imageName: "", |
512 | 522 | imageUrl: "", |
513 | 523 | imageFile: "", |
514 | - nameRules: [v => !!v || " Full Name is required"], | |
515 | - amountRules: [v => !!v || "Amount is required"], | |
516 | - noteRules: [v => !!v || "Note Name is required"], | |
517 | - joinDateRules: [v => !!v || "Date is required"], | |
524 | + nameRules: [(v) => !!v || " Full Name is required"], | |
525 | + amountRules: [(v) => !!v || "Amount is required"], | |
526 | + noteRules: [(v) => !!v || "Note Name is required"], | |
527 | + joinDateRules: [(v) => !!v || "Date is required"], | |
518 | 528 | errorMessages: "", |
519 | 529 | headers: [ |
520 | 530 | { |
521 | 531 | text: "No", |
522 | 532 | align: "center", |
523 | 533 | sortable: false, |
524 | - value: "No" | |
534 | + value: "No", | |
525 | 535 | }, |
526 | 536 | { |
527 | 537 | text: "Profile Pic", |
528 | 538 | value: "profilePicUrl", |
529 | 539 | sortable: false, |
530 | - align: "center" | |
540 | + align: "center", | |
531 | 541 | }, |
532 | 542 | { text: "Name", value: "name", sortable: false, align: "center" }, |
533 | 543 | { text: "Date", value: "date", sortable: false, align: "center" }, |
534 | 544 | { text: "User", value: "user", sortable: false, align: "center" }, |
535 | 545 | { text: "Amount", value: "amount", sortable: false, align: "center" }, |
536 | 546 | { text: "Note", value: "note", sortable: false, align: "center" }, |
537 | - { text: "Action", value: "", sortable: false, align: "center" } | |
547 | + { text: "Action", value: "", sortable: false, align: "center" }, | |
538 | 548 | ], |
539 | 549 | expenseList: [], |
540 | 550 | editedIndex: -1, |
... | ... | @@ -551,9 +561,9 @@ export default { |
551 | 561 | presentAddress: "", |
552 | 562 | mobileNo: "", |
553 | 563 | state: "", |
554 | - joinDate: null | |
564 | + joinDate: null, | |
555 | 565 | }, |
556 | - addExpense: {} | |
566 | + addExpense: {}, | |
557 | 567 | }), |
558 | 568 | watch: { |
559 | 569 | menu(val) { |
... | ... | @@ -561,7 +571,16 @@ export default { |
561 | 571 | }, |
562 | 572 | menu1(val) { |
563 | 573 | val && this.$nextTick(() => (this.$refs.picker.activePicker = "YEAR")); |
564 | - } | |
574 | + }, | |
575 | + addExpenseDialog: function (val) { | |
576 | + if (!val) { | |
577 | + this.addExpense = []; | |
578 | + this.menu1 = false; | |
579 | + this.imageName = ""; | |
580 | + this.imageFile = ""; | |
581 | + this.imageUrl = ""; | |
582 | + } | |
583 | + }, | |
565 | 584 | }, |
566 | 585 | methods: { |
567 | 586 | save(date) { |
... | ... | @@ -573,7 +592,7 @@ export default { |
573 | 592 | pickFile() { |
574 | 593 | this.$refs.image.click(); |
575 | 594 | }, |
576 | - dates: function(date) { | |
595 | + dates: function (date) { | |
577 | 596 | return moment(date).format("MMMM DD, YYYY"); |
578 | 597 | }, |
579 | 598 | onFilePicked(e) { |
... | ... | @@ -605,14 +624,14 @@ export default { |
605 | 624 | http() |
606 | 625 | .get("/getExpensesList", { |
607 | 626 | params: { schoolId: this.$store.state.schoolId }, |
608 | - headers: { Authorization: "Bearer " + this.token } | |
627 | + headers: { Authorization: "Bearer " + this.token }, | |
609 | 628 | }) |
610 | - .then(response => { | |
629 | + .then((response) => { | |
611 | 630 | this.expenseList = response.data.data; |
612 | 631 | this.showLoader = false; |
613 | 632 | // console.log("getTeacherList=====>",this.expenseList) |
614 | 633 | }) |
615 | - .catch(error => { | |
634 | + .catch((error) => { | |
616 | 635 | this.showLoader = false; |
617 | 636 | // if (error.response.status === 401) { |
618 | 637 | // this.$router.replace({ path: "/" }); |
... | ... | @@ -638,24 +657,24 @@ export default { |
638 | 657 | }, |
639 | 658 | deleteItem(item) { |
640 | 659 | let deleteExpense = { |
641 | - expenseId: item._id | |
660 | + expenseId: item._id, | |
642 | 661 | }; |
643 | 662 | // console.log("deleteUers",deleteTeachers) |
644 | 663 | http() |
645 | 664 | .delete( |
646 | 665 | "/deleteExpense", |
647 | 666 | confirm("Are you sure you want to delete this?") && { |
648 | - params: deleteExpense | |
667 | + params: deleteExpense, | |
649 | 668 | } |
650 | 669 | ) |
651 | - .then(response => { | |
670 | + .then((response) => { | |
652 | 671 | // console.log("deleteUers",deleteTeachers) |
653 | 672 | this.snackbar = true; |
654 | 673 | this.text = response.data.message; |
655 | 674 | this.color = "green"; |
656 | 675 | this.getExpenseList(); |
657 | 676 | }) |
658 | - .catch(error => { | |
677 | + .catch((error) => { | |
659 | 678 | this.snackbar = true; |
660 | 679 | this.text = error.response.data.message; |
661 | 680 | this.color = "error"; |
... | ... | @@ -664,6 +683,14 @@ export default { |
664 | 683 | close() { |
665 | 684 | this.editExpenseDialog = false; |
666 | 685 | }, |
686 | + closeAddExpenseModel() { | |
687 | + this.addExpenseDialog = false; | |
688 | + this.addExpense = []; | |
689 | + this.menu1 = false; | |
690 | + this.imageName = ""; | |
691 | + this.imageFile = ""; | |
692 | + this.imageUrl = ""; | |
693 | + }, | |
667 | 694 | submit() { |
668 | 695 | if (this.$refs.form.validate()) { |
669 | 696 | if (this.imageUrl) { |
... | ... | @@ -675,7 +702,7 @@ export default { |
675 | 702 | // this.addExpense = this.$store.state.schoolId; |
676 | 703 | http() |
677 | 704 | .post("/createExpense", this.addExpense) |
678 | - .then(response => { | |
705 | + .then((response) => { | |
679 | 706 | this.getExpenseList(); |
680 | 707 | this.snackbar = true; |
681 | 708 | this.text = response.data.message; |
... | ... | @@ -685,7 +712,7 @@ export default { |
685 | 712 | this.loading = false; |
686 | 713 | this.addExpenseDialog = false; |
687 | 714 | }) |
688 | - .catch(error => { | |
715 | + .catch((error) => { | |
689 | 716 | // console.log(error); |
690 | 717 | this.snackbar = true; |
691 | 718 | this.color = "error"; |
... | ... | @@ -707,7 +734,7 @@ export default { |
707 | 734 | } |
708 | 735 | http() |
709 | 736 | .put("/updateExpense", this.editedItem) |
710 | - .then(response => { | |
737 | + .then((response) => { | |
711 | 738 | this.snackbar = true; |
712 | 739 | this.text = response.data.message; |
713 | 740 | this.color = "green"; |
... | ... | @@ -715,7 +742,7 @@ export default { |
715 | 742 | this.getExpenseList(); |
716 | 743 | this.close(); |
717 | 744 | }) |
718 | - .catch(error => { | |
745 | + .catch((error) => { | |
719 | 746 | this.snackbar = true; |
720 | 747 | this.text = error.response.data.message; |
721 | 748 | this.color = "error"; |
... | ... | @@ -728,11 +755,11 @@ export default { |
728 | 755 | this.showSearch = false; |
729 | 756 | this.show = true; |
730 | 757 | this.search = ""; |
731 | - } | |
758 | + }, | |
732 | 759 | }, |
733 | 760 | mounted() { |
734 | 761 | this.token = this.$store.state.token; |
735 | 762 | this.getExpenseList(); |
736 | - } | |
763 | + }, | |
737 | 764 | }; |
738 | 765 | </script> |
739 | 766 | \ No newline at end of file | ... | ... |
src/pages/Account/feeTypes.vue
... | ... | @@ -40,11 +40,11 @@ |
40 | 40 | ></v-textarea> |
41 | 41 | </v-flex> |
42 | 42 | </v-layout> |
43 | - <v-card-actions class="hidden-xs-only hidden-sm-only "> | |
43 | + <v-card-actions class="hidden-xs-only hidden-sm-only"> | |
44 | 44 | <v-spacer></v-spacer> |
45 | 45 | <v-btn round dark @click="save" class="add-button">Save</v-btn> |
46 | 46 | </v-card-actions> |
47 | - <v-card-actions class="hidden-md-only hidden-lg-only hidden-xl-only"> | |
47 | + <v-card-actions class="hidden-md-only hidden-lg-only hidden-xl-only"> | |
48 | 48 | <v-spacer></v-spacer> |
49 | 49 | <v-btn round dark @click="save" class="add-button">Save</v-btn> |
50 | 50 | <v-spacer></v-spacer> |
... | ... | @@ -123,7 +123,13 @@ |
123 | 123 | </v-card-title> |
124 | 124 | <v-flex xs8 sm8 md3 lg2 v-if="showSearch"> |
125 | 125 | <v-layout> |
126 | - <v-text-field autofocus v-model="search" label="Search" prepend-inner-icon="search" color="primary"></v-text-field> | |
126 | + <v-text-field | |
127 | + autofocus | |
128 | + v-model="search" | |
129 | + label="Search" | |
130 | + prepend-inner-icon="search" | |
131 | + color="primary" | |
132 | + ></v-text-field> | |
127 | 133 | <v-icon @click="closeSearch" color="error">close</v-icon> |
128 | 134 | </v-layout> |
129 | 135 | </v-flex> |
... | ... | @@ -186,12 +192,12 @@ |
186 | 192 | </v-data-table> |
187 | 193 | |
188 | 194 | <!-- ****** ADD Fee Type ****** --> |
189 | - <v-dialog v-model="addFeeTypeDialog" max-width="500px"> | |
195 | + <v-dialog v-model="addFeeTypeDialog" max-width="500px" v-if="addFeeTypeDialog"> | |
190 | 196 | <v-card flat class="card-style pa-2" dark> |
191 | 197 | <v-layout> |
192 | 198 | <v-flex xs12> |
193 | 199 | <label class="title text-xs-center">Add Fee Type</label> |
194 | - <v-icon size="24" class="right" @click="addFeeTypeDialog = false">cancel</v-icon> | |
200 | + <v-icon size="24" class="right" @click="closeAddFeeTypeModel">cancel</v-icon> | |
195 | 201 | </v-flex> |
196 | 202 | </v-layout> |
197 | 203 | <v-container fluid fill-height> |
... | ... | @@ -293,47 +299,54 @@ export default { |
293 | 299 | addFeeTypeDialog: false, |
294 | 300 | validEdit: true, |
295 | 301 | pagination: { |
296 | - rowsPerPage: 10 | |
302 | + rowsPerPage: 10, | |
297 | 303 | }, |
298 | - feetTypeRules: [v => !!v || " Fee Type Name is required"], | |
299 | - monthlyRules: [v => !!v || " Select Monthly"], | |
300 | - noteRules: [v => !!v || " Note is required"], | |
304 | + feetTypeRules: [(v) => !!v || " Fee Type Name is required"], | |
305 | + monthlyRules: [(v) => !!v || " Select Monthly"], | |
306 | + noteRules: [(v) => !!v || " Note is required"], | |
301 | 307 | headers: [ |
302 | 308 | { |
303 | 309 | text: "No", |
304 | 310 | align: "", |
305 | 311 | sortable: false, |
306 | - value: "No" | |
312 | + value: "No", | |
307 | 313 | }, |
308 | 314 | { |
309 | 315 | text: "fee Type", |
310 | 316 | value: "feeType", |
311 | 317 | sortable: false, |
312 | - align: "center" | |
318 | + align: "center", | |
313 | 319 | }, |
314 | 320 | { text: "Note", value: "note", sortable: false, align: "center" }, |
315 | 321 | // { text: "Session", value: "session", sortable: false, align: "center" }, |
316 | - { text: "Action", value: "", sortable: false, align: "center" } | |
322 | + { text: "Action", value: "", sortable: false, align: "center" }, | |
317 | 323 | ], |
318 | 324 | feeTypeList: [], |
319 | 325 | select: "", |
320 | 326 | token: "", |
321 | 327 | editedItem: {}, |
322 | - feeTypeData: {} | |
328 | + feeTypeData: {}, | |
323 | 329 | }), |
330 | + watch: { | |
331 | + addFeeTypeDialog: function (val) { | |
332 | + if (!val) { | |
333 | + this.feeTypeData = []; | |
334 | + } | |
335 | + }, | |
336 | + }, | |
324 | 337 | methods: { |
325 | 338 | getFeeTypeList() { |
326 | 339 | this.showLoader = true; |
327 | 340 | http() |
328 | 341 | .get("/getFeesList", { |
329 | 342 | params: { schoolId: this.$store.state.schoolId }, |
330 | - headers: { Authorization: "Bearer " + this.token } | |
343 | + headers: { Authorization: "Bearer " + this.token }, | |
331 | 344 | }) |
332 | - .then(response => { | |
345 | + .then((response) => { | |
333 | 346 | this.feeTypeList = response.data.data; |
334 | 347 | this.showLoader = false; |
335 | 348 | }) |
336 | - .catch(error => { | |
349 | + .catch((error) => { | |
337 | 350 | this.showLoader = false; |
338 | 351 | if (error.response.status === 401) { |
339 | 352 | this.$router.replace({ path: "/" }); |
... | ... | @@ -355,22 +368,22 @@ export default { |
355 | 368 | }, |
356 | 369 | deleteItem(item) { |
357 | 370 | let deleteFeeType = { |
358 | - feeId: item._id | |
371 | + feeId: item._id, | |
359 | 372 | }; |
360 | 373 | http() |
361 | 374 | .delete( |
362 | 375 | "/deleteFee", |
363 | 376 | confirm("Are you sure you want to delete this?") && { |
364 | - params: deleteFeeType | |
377 | + params: deleteFeeType, | |
365 | 378 | } |
366 | 379 | ) |
367 | - .then(response => { | |
380 | + .then((response) => { | |
368 | 381 | this.snackbar = true; |
369 | 382 | this.text = response.data.message; |
370 | 383 | this.color = "green"; |
371 | 384 | this.getFeeTypeList(); |
372 | 385 | }) |
373 | - .catch(error => { | |
386 | + .catch((error) => { | |
374 | 387 | this.snackbar = true; |
375 | 388 | this.color = "error"; |
376 | 389 | this.text = error.response.data.message; |
... | ... | @@ -385,13 +398,17 @@ export default { |
385 | 398 | close2() { |
386 | 399 | this.dialog2 = false; |
387 | 400 | }, |
401 | + closeAddFeeTypeModel() { | |
402 | + this.addFeeTypeDialog = false; | |
403 | + this.feeTypeData = []; | |
404 | + }, | |
388 | 405 | submit() { |
389 | 406 | if (this.$refs.form.validate()) { |
390 | 407 | this.loading = true; |
391 | 408 | this.schoolId = this.$store.state.schoolId; |
392 | 409 | http() |
393 | 410 | .post("/createFee", this.feeTypeData) |
394 | - .then(response => { | |
411 | + .then((response) => { | |
395 | 412 | this.getFeeTypeList(); |
396 | 413 | this.snackbar = true; |
397 | 414 | this.text = response.data.message; |
... | ... | @@ -400,7 +417,7 @@ export default { |
400 | 417 | this.addFeeTypeDialog = false; |
401 | 418 | this.loading = false; |
402 | 419 | }) |
403 | - .catch(error => { | |
420 | + .catch((error) => { | |
404 | 421 | // console.log(error); |
405 | 422 | this.snackbar = true; |
406 | 423 | this.color = "error"; |
... | ... | @@ -416,7 +433,7 @@ export default { |
416 | 433 | this.editedItem.feeId = this.editedItem._id; |
417 | 434 | http() |
418 | 435 | .put("/updateFee", this.editedItem) |
419 | - .then(response => { | |
436 | + .then((response) => { | |
420 | 437 | this.snackbar = true; |
421 | 438 | this.text = response.data.message; |
422 | 439 | this.color = "green"; |
... | ... | @@ -424,7 +441,7 @@ export default { |
424 | 441 | this.editFeeTypeDialog = false; |
425 | 442 | this.close(); |
426 | 443 | }) |
427 | - .catch(error => { | |
444 | + .catch((error) => { | |
428 | 445 | this.snackbar = true; |
429 | 446 | this.color = "error"; |
430 | 447 | this.text = error.response.data.message; |
... | ... | @@ -437,11 +454,11 @@ export default { |
437 | 454 | this.showSearch = false; |
438 | 455 | this.show = true; |
439 | 456 | this.search = ""; |
440 | - } | |
457 | + }, | |
441 | 458 | }, |
442 | 459 | mounted() { |
443 | 460 | this.token = this.$store.state.token; |
444 | 461 | this.getFeeTypeList(); |
445 | - } | |
462 | + }, | |
446 | 463 | }; |
447 | 464 | </script> |
448 | 465 | \ No newline at end of file | ... | ... |
src/pages/Account/income.vue
... | ... | @@ -132,7 +132,7 @@ |
132 | 132 | </v-flex> |
133 | 133 | </v-layout> |
134 | 134 | <v-layout> |
135 | - <v-flex xs12 > | |
135 | + <v-flex xs12> | |
136 | 136 | <v-card-actions> |
137 | 137 | <v-spacer></v-spacer> |
138 | 138 | <v-btn round dark :loading="loading" @click="save" class="add-button">Save</v-btn> |
... | ... | @@ -239,7 +239,13 @@ |
239 | 239 | </v-card-title> |
240 | 240 | <v-flex xs8 sm8 md3 lg2 v-if="showSearch"> |
241 | 241 | <v-layout> |
242 | - <v-text-field autofocus v-model="search" label="Search" prepend-inner-icon="search" color="primary"></v-text-field> | |
242 | + <v-text-field | |
243 | + autofocus | |
244 | + v-model="search" | |
245 | + label="Search" | |
246 | + prepend-inner-icon="search" | |
247 | + color="primary" | |
248 | + ></v-text-field> | |
243 | 249 | <v-icon @click="closeSearch" color="error">close</v-icon> |
244 | 250 | </v-layout> |
245 | 251 | </v-flex> |
... | ... | @@ -308,12 +314,12 @@ |
308 | 314 | </v-data-table> |
309 | 315 | |
310 | 316 | <!-- ****** Add Income Data****** --> |
311 | - <v-dialog v-model="addIncomeDialog" max-width="600px"> | |
317 | + <v-dialog v-model="addIncomeDialog" max-width="600px" v-if="addIncomeDialog"> | |
312 | 318 | <v-card flat class="card-style pa-2" dark> |
313 | 319 | <v-layout> |
314 | 320 | <v-flex xs12> |
315 | 321 | <label class="title text-xs-center">Add Income</label> |
316 | - <v-icon size="24" class="right" @click="addIncomeDialog = false">cancel</v-icon> | |
322 | + <v-icon size="24" class="right" @click="closeAddIncomeModel">cancel</v-icon> | |
317 | 323 | </v-flex> |
318 | 324 | </v-layout> |
319 | 325 | <v-form ref="form" v-model="valid" lazy-validation> |
... | ... | @@ -495,42 +501,42 @@ export default { |
495 | 501 | profileIncomeDialog: false, |
496 | 502 | valid: true, |
497 | 503 | pagination: { |
498 | - rowsPerPage: 10 | |
504 | + rowsPerPage: 10, | |
499 | 505 | }, |
500 | 506 | imageData: {}, |
501 | 507 | imageName: "", |
502 | 508 | imageUrl: "", |
503 | 509 | imageFile: "", |
504 | - nameRules: [v => !!v || " Full Name is required"], | |
505 | - amountRules: [v => !!v || "Amount is required"], | |
506 | - noteRules: [v => !!v || "Note Name is required"], | |
507 | - joinDateRules: [v => !!v || "Date is required"], | |
510 | + nameRules: [(v) => !!v || " Full Name is required"], | |
511 | + amountRules: [(v) => !!v || "Amount is required"], | |
512 | + noteRules: [(v) => !!v || "Note Name is required"], | |
513 | + joinDateRules: [(v) => !!v || "Date is required"], | |
508 | 514 | errorMessages: "", |
509 | 515 | headers: [ |
510 | 516 | { |
511 | 517 | text: "No", |
512 | 518 | align: "", |
513 | 519 | sortable: false, |
514 | - value: "No" | |
520 | + value: "No", | |
515 | 521 | }, |
516 | 522 | { |
517 | 523 | text: "Profile Pic", |
518 | 524 | value: "profilePicUrl", |
519 | 525 | sortable: false, |
520 | - align: "center" | |
526 | + align: "center", | |
521 | 527 | }, |
522 | 528 | { text: "Name", value: "name", sortable: false, align: "center" }, |
523 | 529 | { text: "Date", value: "date", sortable: false, align: "center" }, |
524 | 530 | { text: "User", value: "user", sortable: false, align: "center" }, |
525 | 531 | { text: "Amount", value: "amount", sortable: false, align: "center" }, |
526 | 532 | { text: "Note", value: "note", sortable: false, align: "center" }, |
527 | - { text: "Action", value: "", sortable: false, align: "center" } | |
533 | + { text: "Action", value: "", sortable: false, align: "center" }, | |
528 | 534 | ], |
529 | 535 | incomeList: [], |
530 | 536 | editedIndex: -1, |
531 | 537 | upload: "", |
532 | 538 | editedItem: {}, |
533 | - addIncome: {} | |
539 | + addIncome: {}, | |
534 | 540 | }), |
535 | 541 | watch: { |
536 | 542 | menu(val) { |
... | ... | @@ -538,7 +544,16 @@ export default { |
538 | 544 | }, |
539 | 545 | menu1(val) { |
540 | 546 | val && this.$nextTick(() => (this.$refs.picker.activePicker = "YEAR")); |
541 | - } | |
547 | + }, | |
548 | + addIncomeDialog: function (val) { | |
549 | + if (!val) { | |
550 | + this.addIncome = []; | |
551 | + this.menu1 = false; | |
552 | + this.imageName = ""; | |
553 | + this.imageUrl = ""; | |
554 | + this.imageFile = ""; | |
555 | + } | |
556 | + }, | |
542 | 557 | }, |
543 | 558 | methods: { |
544 | 559 | save(date) { |
... | ... | @@ -575,7 +590,7 @@ export default { |
575 | 590 | this.imageUrl = ""; |
576 | 591 | } |
577 | 592 | }, |
578 | - dates: function(date) { | |
593 | + dates: function (date) { | |
579 | 594 | return moment(date).format("MMMM DD, YYYY"); |
580 | 595 | }, |
581 | 596 | getIncomeList() { |
... | ... | @@ -584,14 +599,14 @@ export default { |
584 | 599 | http() |
585 | 600 | .get("/getIncomesList", { |
586 | 601 | params: { schoolId: this.$store.state.schoolId }, |
587 | - headers: { Authorization: "Bearer " + token } | |
602 | + headers: { Authorization: "Bearer " + token }, | |
588 | 603 | }) |
589 | - .then(response => { | |
604 | + .then((response) => { | |
590 | 605 | this.incomeList = response.data.data; |
591 | 606 | this.showLoader = false; |
592 | 607 | // console.log("getTeacherList=====>",this.incomeList) |
593 | 608 | }) |
594 | - .catch(error => { | |
609 | + .catch((error) => { | |
595 | 610 | this.showLoader = false; |
596 | 611 | if (error.response.status === 401) { |
597 | 612 | this.$router.replace({ path: "/" }); |
... | ... | @@ -617,23 +632,23 @@ export default { |
617 | 632 | }, |
618 | 633 | deleteItem(item) { |
619 | 634 | let deleteIncome = { |
620 | - incomeId: item._id | |
635 | + incomeId: item._id, | |
621 | 636 | }; |
622 | 637 | http() |
623 | 638 | .delete( |
624 | 639 | "/deleteIncome", |
625 | 640 | confirm("Are you sure you want to delete this?") && { |
626 | - params: deleteIncome | |
641 | + params: deleteIncome, | |
627 | 642 | } |
628 | 643 | ) |
629 | - .then(response => { | |
644 | + .then((response) => { | |
630 | 645 | // console.log("deleteUers",deleteTeachers) |
631 | 646 | if ((this.snackbar = true)) { |
632 | 647 | this.text = "Successfully delete Existing Income"; |
633 | 648 | } |
634 | 649 | this.getIncomeList(); |
635 | 650 | }) |
636 | - .catch(error => { | |
651 | + .catch((error) => { | |
637 | 652 | console.log(error); |
638 | 653 | }); |
639 | 654 | }, |
... | ... | @@ -643,6 +658,14 @@ export default { |
643 | 658 | close1() { |
644 | 659 | this.dialog1 = false; |
645 | 660 | }, |
661 | + closeAddIncomeModel() { | |
662 | + this.addIncomeDialog = false; | |
663 | + this.addIncome = []; | |
664 | + this.menu1 = false; | |
665 | + this.imageName = ""; | |
666 | + this.imageUrl = ""; | |
667 | + this.imageFile = ""; | |
668 | + }, | |
646 | 669 | submit() { |
647 | 670 | if (this.$refs.form.validate()) { |
648 | 671 | if (this.imageUrl) { |
... | ... | @@ -654,7 +677,7 @@ export default { |
654 | 677 | // this.addIncome = this.$store.state.schoolId; |
655 | 678 | http() |
656 | 679 | .post("/createIncome", this.addIncome) |
657 | - .then(response => { | |
680 | + .then((response) => { | |
658 | 681 | this.getIncomeList(); |
659 | 682 | this.snackbar = true; |
660 | 683 | this.text = response.data.message; |
... | ... | @@ -663,7 +686,7 @@ export default { |
663 | 686 | this.clear(); |
664 | 687 | this.loading = false; |
665 | 688 | }) |
666 | - .catch(error => { | |
689 | + .catch((error) => { | |
667 | 690 | // console.log(error); |
668 | 691 | this.loading = false; |
669 | 692 | this.snackbar = true; |
... | ... | @@ -685,7 +708,7 @@ export default { |
685 | 708 | } |
686 | 709 | http() |
687 | 710 | .put("/updateIncome", this.editedItem) |
688 | - .then(response => { | |
711 | + .then((response) => { | |
689 | 712 | this.snackbar = true; |
690 | 713 | this.text = response.data.message; |
691 | 714 | this.color = "green"; |
... | ... | @@ -693,7 +716,7 @@ export default { |
693 | 716 | this.getIncomeList(); |
694 | 717 | this.close(); |
695 | 718 | }) |
696 | - .catch(error => { | |
719 | + .catch((error) => { | |
697 | 720 | this.loading = false; |
698 | 721 | this.snackbar = true; |
699 | 722 | this.color = "error"; |
... | ... | @@ -708,10 +731,10 @@ export default { |
708 | 731 | this.showSearch = false; |
709 | 732 | this.show = true; |
710 | 733 | this.search = ""; |
711 | - } | |
734 | + }, | |
712 | 735 | }, |
713 | 736 | mounted() { |
714 | 737 | this.getIncomeList(); |
715 | - } | |
738 | + }, | |
716 | 739 | }; |
717 | 740 | </script> |
718 | 741 | \ No newline at end of file | ... | ... |
src/pages/Account/invoice.vue
... | ... | @@ -118,7 +118,13 @@ |
118 | 118 | </v-card-title> |
119 | 119 | <v-flex xs8 sm8 md3 lg2 v-if="showSearch"> |
120 | 120 | <v-layout> |
121 | - <v-text-field autofocus v-model="search" label="Search" prepend-inner-icon="search" color="primary"></v-text-field> | |
121 | + <v-text-field | |
122 | + autofocus | |
123 | + v-model="search" | |
124 | + label="Search" | |
125 | + prepend-inner-icon="search" | |
126 | + color="primary" | |
127 | + ></v-text-field> | |
122 | 128 | <v-icon @click="closeSearch" color="error">close</v-icon> |
123 | 129 | </v-layout> |
124 | 130 | </v-flex> |
... | ... | @@ -255,12 +261,12 @@ |
255 | 261 | v-model="snackbar" |
256 | 262 | :color="color" |
257 | 263 | >{{ text }}</v-snackbar> |
258 | - <v-dialog v-model="addInvoiceDialog"> | |
264 | + <v-dialog v-model="addInvoiceDialog" v-if="addInvoiceDialog"> | |
259 | 265 | <v-card flat class="text-xs-center white--text"> |
260 | 266 | <v-layout> |
261 | 267 | <v-flex xs12 class="card-styles pa-2"> |
262 | 268 | <label class="title text-xs-center">Add Invoice</label> |
263 | - <v-icon size="24" class="right white--text" @click="addInvoiceDialog = false">cancel</v-icon> | |
269 | + <v-icon size="24" class="right white--text" @click="closeAddInvoiceModel">cancel</v-icon> | |
264 | 270 | </v-flex> |
265 | 271 | </v-layout> |
266 | 272 | <v-flex xs12 sm12> |
... | ... | @@ -527,7 +533,7 @@ import moment from "moment"; |
527 | 533 | export default { |
528 | 534 | components: { |
529 | 535 | editInvoice: editInvoice, |
530 | - paymentTemplate: paymentTemplate | |
536 | + paymentTemplate: paymentTemplate, | |
531 | 537 | }, |
532 | 538 | data: () => ({ |
533 | 539 | snackbar: false, |
... | ... | @@ -563,11 +569,11 @@ export default { |
563 | 569 | editPayment: { |
564 | 570 | studentId: { |
565 | 571 | name: "", |
566 | - rollNo: "" | |
572 | + rollNo: "", | |
567 | 573 | }, |
568 | 574 | classId: { |
569 | - classNum: "" | |
570 | - } | |
575 | + classNum: "", | |
576 | + }, | |
571 | 577 | }, |
572 | 578 | menu1: false, |
573 | 579 | paymentMethods: ["Cash", "Cheque"], |
... | ... | @@ -576,40 +582,40 @@ export default { |
576 | 582 | discount: "0.00", |
577 | 583 | subTotal: "0.00", |
578 | 584 | paidAmount: "0.00", |
579 | - feeTypeName: "" | |
585 | + feeTypeName: "", | |
580 | 586 | }, |
581 | 587 | |
582 | 588 | feeTypeData: [], |
583 | 589 | editFeeTypeData: [], |
584 | 590 | paymentFeeTypeData: [], |
585 | 591 | pagination: { |
586 | - rowsPerPage: 10 | |
592 | + rowsPerPage: 10, | |
587 | 593 | }, |
588 | - classRules: [v => !!v || " Class Name is required"], | |
589 | - inchargeRules: [v => !!v || "Student Name is required"], | |
590 | - dateRules: [v => !!v || " Date is required"], | |
591 | - paymentStatusRules: [v => !!v || "Payment Status is required"], | |
592 | - paymentMethodsRules: [v => !!v || "payment Method is required"], | |
593 | - feeTypeRules: [v => !!v || "Fee Type is required"], | |
594 | - feeTypeNameRules: [v => !!v || "Fee Type Name is required"], | |
595 | - amountRules: [v => !!v || "Amount is required"], | |
596 | - discountRules: [v => !!v || "Discount is required"], | |
597 | - subtotalRules: [v => !!v || "Subtotal is required"], | |
598 | - paymentRules: [v => !!v || "Payment is required"], | |
599 | - paidAmountRules: [v => !!v || "Paid Amount is required"], | |
594 | + classRules: [(v) => !!v || " Class Name is required"], | |
595 | + inchargeRules: [(v) => !!v || "Student Name is required"], | |
596 | + dateRules: [(v) => !!v || " Date is required"], | |
597 | + paymentStatusRules: [(v) => !!v || "Payment Status is required"], | |
598 | + paymentMethodsRules: [(v) => !!v || "payment Method is required"], | |
599 | + feeTypeRules: [(v) => !!v || "Fee Type is required"], | |
600 | + feeTypeNameRules: [(v) => !!v || "Fee Type Name is required"], | |
601 | + amountRules: [(v) => !!v || "Amount is required"], | |
602 | + discountRules: [(v) => !!v || "Discount is required"], | |
603 | + subtotalRules: [(v) => !!v || "Subtotal is required"], | |
604 | + paymentRules: [(v) => !!v || "Payment is required"], | |
605 | + paidAmountRules: [(v) => !!v || "Paid Amount is required"], | |
600 | 606 | paymentMethodRules: [], |
601 | 607 | headers: [ |
602 | 608 | { |
603 | 609 | text: "No", |
604 | 610 | align: "", |
605 | 611 | sortable: false, |
606 | - value: "No" | |
612 | + value: "No", | |
607 | 613 | }, |
608 | 614 | { |
609 | 615 | text: "Student", |
610 | 616 | value: "name", |
611 | 617 | sortable: false, |
612 | - align: "center" | |
618 | + align: "center", | |
613 | 619 | }, |
614 | 620 | { text: "Class", value: "class", sortable: false, align: "center" }, |
615 | 621 | { text: "Total", value: "subtotal", sortable: false, align: "center" }, |
... | ... | @@ -617,66 +623,76 @@ export default { |
617 | 623 | text: "Discount", |
618 | 624 | value: "discount", |
619 | 625 | sortable: false, |
620 | - align: "center" | |
626 | + align: "center", | |
621 | 627 | }, |
622 | 628 | { |
623 | 629 | text: "Paid Amount", |
624 | 630 | value: "paidAmount", |
625 | 631 | sortable: false, |
626 | - align: "center" | |
632 | + align: "center", | |
627 | 633 | }, |
628 | 634 | { |
629 | 635 | text: "Balance", |
630 | 636 | value: "Balance", |
631 | 637 | sortable: false, |
632 | - align: "center" | |
638 | + align: "center", | |
633 | 639 | }, |
634 | 640 | { |
635 | 641 | text: "Status", |
636 | 642 | value: "paymentStatus", |
637 | 643 | sortable: false, |
638 | - align: "center" | |
644 | + align: "center", | |
639 | 645 | }, |
640 | 646 | { |
641 | 647 | text: "Date", |
642 | 648 | value: "date", |
643 | 649 | sortable: false, |
644 | - align: "center" | |
650 | + align: "center", | |
645 | 651 | }, |
646 | - { text: "Action", value: "", sortable: false, align: "center" } | |
652 | + { text: "Action", value: "", sortable: false, align: "center" }, | |
647 | 653 | ], |
648 | 654 | |
649 | 655 | studentId: { |
650 | - name: "" | |
656 | + name: "", | |
651 | 657 | }, |
652 | 658 | token: "", |
653 | 659 | editedItem: {}, |
654 | 660 | invoiceData: { |
655 | 661 | paymentStatus: "", |
656 | - students: [] | |
662 | + students: [], | |
657 | 663 | }, |
658 | 664 | addclass: [], |
659 | 665 | studentList: [], |
660 | 666 | paymentStatus: [ |
661 | 667 | { |
662 | 668 | name: "Not Paid", |
663 | - value: "NOT_PAID" | |
669 | + value: "NOT_PAID", | |
664 | 670 | }, |
665 | 671 | { |
666 | 672 | name: "Partially Paid", |
667 | - value: "PARTIALLY_PAID" | |
673 | + value: "PARTIALLY_PAID", | |
668 | 674 | }, |
669 | 675 | { |
670 | 676 | name: "Fully Paid", |
671 | - value: "FULLY_PAID" | |
672 | - } | |
673 | - ] | |
677 | + value: "FULLY_PAID", | |
678 | + }, | |
679 | + ], | |
674 | 680 | }), |
681 | + watch: { | |
682 | + addInvoiceDialog: function (val) { | |
683 | + if (!val) { | |
684 | + this.invoiceData = []; | |
685 | + this.menu1 = false; | |
686 | + this.feeType = []; | |
687 | + this.feeTypeData = []; | |
688 | + } | |
689 | + }, | |
690 | + }, | |
675 | 691 | methods: { |
676 | 692 | save(date) { |
677 | 693 | this.$refs.menu1.save(date); |
678 | 694 | }, |
679 | - dates: function(date) { | |
695 | + dates: function (date) { | |
680 | 696 | return moment(date).format("MMMM DD, YYYY"); |
681 | 697 | }, |
682 | 698 | profile(item) { |
... | ... | @@ -710,29 +726,29 @@ export default { |
710 | 726 | }, |
711 | 727 | deleteItem(item) { |
712 | 728 | let deleteInvoice = { |
713 | - invoiceId: item._id | |
729 | + invoiceId: item._id, | |
714 | 730 | }; |
715 | 731 | http() |
716 | 732 | .delete( |
717 | 733 | "/deleteInvoice", |
718 | 734 | confirm("Are you sure you want to delete this?") && { |
719 | - params: deleteInvoice | |
735 | + params: deleteInvoice, | |
720 | 736 | } |
721 | 737 | ) |
722 | - .then(response => { | |
738 | + .then((response) => { | |
723 | 739 | this.snackbar = true; |
724 | 740 | this.text = "Successfully delete Existing Invoice"; |
725 | 741 | this.color = "green"; |
726 | 742 | this.dialog1 = false; |
727 | 743 | this.getInvoiceList(); |
728 | 744 | }) |
729 | - .catch(error => { | |
745 | + .catch((error) => { | |
730 | 746 | // console.log(error); |
731 | 747 | }); |
732 | 748 | }, |
733 | 749 | deletePayment(editedItem) { |
734 | 750 | let deleteInvoice = { |
735 | - invoiceId: editedItem._id | |
751 | + invoiceId: editedItem._id, | |
736 | 752 | }; |
737 | 753 | http() |
738 | 754 | .put( |
... | ... | @@ -740,24 +756,31 @@ export default { |
740 | 756 | deleteInvoice, |
741 | 757 | confirm("Are you sure you want to delete this?") && { |
742 | 758 | headers: { |
743 | - Authorization: "Bearer " + this.token | |
744 | - } | |
759 | + Authorization: "Bearer " + this.token, | |
760 | + }, | |
745 | 761 | } |
746 | 762 | ) |
747 | - .then(response => { | |
763 | + .then((response) => { | |
748 | 764 | this.snackbar = true; |
749 | 765 | this.text = "Successfully delete Existing Invoice"; |
750 | 766 | this.color = "green"; |
751 | 767 | this.dialog1 = false; |
752 | 768 | this.getInvoiceList(); |
753 | 769 | }) |
754 | - .catch(error => { | |
770 | + .catch((error) => { | |
755 | 771 | // console.log(error); |
756 | 772 | }); |
757 | 773 | }, |
758 | 774 | close() { |
759 | 775 | this.dialog = false; |
760 | 776 | }, |
777 | + closeAddInvoiceModel() { | |
778 | + this.addInvoiceDialog = false; | |
779 | + this.invoiceData = []; | |
780 | + this.menu1 = false; | |
781 | + this.feeType = []; | |
782 | + this.feeTypeData = []; | |
783 | + }, | |
761 | 784 | // totalAmount() { |
762 | 785 | // // console.log("this.feeType.paidAmount ", this.feeType.paidAmount); |
763 | 786 | // // console.log( |
... | ... | @@ -793,7 +816,7 @@ export default { |
793 | 816 | totalAmount: this.feeType.amount.toString(), |
794 | 817 | totalDiscount: this.feeType.discount.toString(), |
795 | 818 | totalSubTotal: this.feeType.subTotal.toString(), |
796 | - totalPaidAmount: this.feeType.paidAmount | |
819 | + totalPaidAmount: this.feeType.paidAmount, | |
797 | 820 | }; |
798 | 821 | |
799 | 822 | if (invoiceData.paymentStatus == "NOT_PAID") { |
... | ... | @@ -822,7 +845,7 @@ export default { |
822 | 845 | } |
823 | 846 | http() |
824 | 847 | .post("/createInvoice", invoiceData) |
825 | - .then(response => { | |
848 | + .then((response) => { | |
826 | 849 | this.getInvoiceList(); |
827 | 850 | this.snackbar = true; |
828 | 851 | this.text = "New Invoice added successfully"; |
... | ... | @@ -835,13 +858,13 @@ export default { |
835 | 858 | discount: "0.00", |
836 | 859 | paidAmount: "0.00", |
837 | 860 | subTotal: "0.00", |
838 | - feeTypeList: "" | |
861 | + feeTypeList: "", | |
839 | 862 | }; |
840 | 863 | } |
841 | 864 | this.loading = false; |
842 | 865 | this.addInvoiceDialog = false; |
843 | 866 | }) |
844 | - .catch(error => { | |
867 | + .catch((error) => { | |
845 | 868 | this.snackbar = true; |
846 | 869 | this.text = error.response.data.errors[0].messages[0]; |
847 | 870 | this.color = "error"; |
... | ... | @@ -857,13 +880,13 @@ export default { |
857 | 880 | http() |
858 | 881 | .get("/getInvoicesList", { |
859 | 882 | params: { schoolId: this.$store.state.schoolId }, |
860 | - headers: { Authorization: "Bearer " + this.token } | |
883 | + headers: { Authorization: "Bearer " + this.token }, | |
861 | 884 | }) |
862 | - .then(response => { | |
885 | + .then((response) => { | |
863 | 886 | this.invoiceList = response.data.data; |
864 | 887 | this.showLoader = false; |
865 | 888 | }) |
866 | - .catch(error => { | |
889 | + .catch((error) => { | |
867 | 890 | // console.log("err====>", err); |
868 | 891 | this.showLoader = false; |
869 | 892 | if (error.response.status === 401) { |
... | ... | @@ -877,7 +900,7 @@ export default { |
877 | 900 | this.showFeeType = true; |
878 | 901 | this.feeTypeData.push({ feeTypeName: this.feeType.feeTypeName }); |
879 | 902 | }, |
880 | - deleteSelectFee: function(index, feeTyp) { | |
903 | + deleteSelectFee: function (index, feeTyp) { | |
881 | 904 | console.log("---index----", index); |
882 | 905 | this.feeTypeData.splice(index, 1); |
883 | 906 | this.getAmmountDetails(feeTyp); |
... | ... | @@ -887,7 +910,7 @@ export default { |
887 | 910 | discount: "0.00", |
888 | 911 | paidAmount: "0.00", |
889 | 912 | subTotal: "0.00", |
890 | - feeTypeName: "" | |
913 | + feeTypeName: "", | |
891 | 914 | }; |
892 | 915 | } |
893 | 916 | }, |
... | ... | @@ -895,12 +918,12 @@ export default { |
895 | 918 | http() |
896 | 919 | .get("/getClassesList", { |
897 | 920 | params: { schoolId: this.$store.state.schoolId }, |
898 | - headers: { Authorization: "Bearer " + this.token } | |
921 | + headers: { Authorization: "Bearer " + this.token }, | |
899 | 922 | }) |
900 | - .then(response => { | |
923 | + .then((response) => { | |
901 | 924 | this.addclass = response.data.data; |
902 | 925 | }) |
903 | - .catch(err => { | |
926 | + .catch((err) => { | |
904 | 927 | // console.log("err====>", err); |
905 | 928 | // this.$router.replace({ path: "/" }); |
906 | 929 | }); |
... | ... | @@ -911,19 +934,19 @@ export default { |
911 | 934 | .get("/getStudentsList", { |
912 | 935 | params: { |
913 | 936 | classId: this.invoiceData.classNum, |
914 | - schoolId: this.$store.state.schoolId | |
937 | + schoolId: this.$store.state.schoolId, | |
915 | 938 | }, |
916 | - headers: { Authorization: "Bearer " + this.token } | |
939 | + headers: { Authorization: "Bearer " + this.token }, | |
917 | 940 | }) |
918 | - .then(response => { | |
941 | + .then((response) => { | |
919 | 942 | response.data.data.unshift({ |
920 | 943 | name: "Select All", |
921 | - _id: "Select All" | |
944 | + _id: "Select All", | |
922 | 945 | }); |
923 | 946 | this.studentList = response.data.data; |
924 | 947 | this.showLoader = false; |
925 | 948 | }) |
926 | - .catch(err => { | |
949 | + .catch((err) => { | |
927 | 950 | this.showLoader = false; |
928 | 951 | // console.log("err====>", err); |
929 | 952 | // this.$router.replace({ path: "/" }); |
... | ... | @@ -933,14 +956,14 @@ export default { |
933 | 956 | http() |
934 | 957 | .get("/getFeesList", { |
935 | 958 | params: { |
936 | - schoolId: this.$store.state.schoolId | |
959 | + schoolId: this.$store.state.schoolId, | |
937 | 960 | }, |
938 | - headers: { Authorization: "Bearer " + this.token } | |
961 | + headers: { Authorization: "Bearer " + this.token }, | |
939 | 962 | }) |
940 | - .then(response => { | |
963 | + .then((response) => { | |
941 | 964 | this.feeTypes = response.data.data; |
942 | 965 | }) |
943 | - .catch(err => { | |
966 | + .catch((err) => { | |
944 | 967 | // console.log("err====>", err); |
945 | 968 | // this.$router.replace({ path: "/" }); |
946 | 969 | }); |
... | ... | @@ -952,7 +975,7 @@ export default { |
952 | 975 | discount: "0.00", |
953 | 976 | subTotal: "0.00", |
954 | 977 | subParticularTotal: "0.00", |
955 | - paidAmount: "" | |
978 | + paidAmount: "", | |
956 | 979 | }; |
957 | 980 | for (let i = 0; i < this.feeTypeData.length; i++) { |
958 | 981 | // *********** AMOUNT *********** |
... | ... | @@ -1037,10 +1060,10 @@ export default { |
1037 | 1060 | getPayMethodList() { |
1038 | 1061 | if (this.invoiceData.paymentStatus == "PARTIALLY_PAID") { |
1039 | 1062 | this.showPayMethods = true; |
1040 | - this.paymentMethodRules = [v => !!v || "Payment Method is required"]; | |
1063 | + this.paymentMethodRules = [(v) => !!v || "Payment Method is required"]; | |
1041 | 1064 | } else if (this.invoiceData.paymentStatus == "FULLY_PAID") { |
1042 | 1065 | this.showPayMethods = true; |
1043 | - this.paymentMethodRules = [v => !!v || "Payment Method is required"]; | |
1066 | + this.paymentMethodRules = [(v) => !!v || "Payment Method is required"]; | |
1044 | 1067 | } else if (this.invoiceData.paymentStatus == "NOT_PAID") { |
1045 | 1068 | for (let i = 0; i < this.feeTypeData.length; i++) { |
1046 | 1069 | this.feeTypeData[i].paidAmount = "0.00"; |
... | ... | @@ -1084,7 +1107,7 @@ export default { |
1084 | 1107 | this.snackbar = true; |
1085 | 1108 | this.text = "Payment added successfully"; |
1086 | 1109 | this.color = "green"; |
1087 | - } | |
1110 | + }, | |
1088 | 1111 | }, |
1089 | 1112 | mounted() { |
1090 | 1113 | this.token = this.$store.state.token; |
... | ... | @@ -1092,7 +1115,7 @@ export default { |
1092 | 1115 | this.getAllClasses(); |
1093 | 1116 | this.getfeeType(); |
1094 | 1117 | this.getAllStudents(); |
1095 | - } | |
1118 | + }, | |
1096 | 1119 | }; |
1097 | 1120 | </script> |
1098 | 1121 | ... | ... |
src/pages/Administrator/academicYear.vue
... | ... | @@ -217,7 +217,13 @@ |
217 | 217 | </v-card-title> |
218 | 218 | <v-flex xs8 sm8 md3 lg2 v-if="showSearch"> |
219 | 219 | <v-layout> |
220 | - <v-text-field autofocus v-model="search" label="Search" prepend-inner-icon="search" color="primary"></v-text-field> | |
220 | + <v-text-field | |
221 | + autofocus | |
222 | + v-model="search" | |
223 | + label="Search" | |
224 | + prepend-inner-icon="search" | |
225 | + color="primary" | |
226 | + ></v-text-field> | |
221 | 227 | <v-icon @click="closeSearch" color="error">close</v-icon> |
222 | 228 | </v-layout> |
223 | 229 | </v-flex> |
... | ... | @@ -279,12 +285,12 @@ |
279 | 285 | >Your search for "{{ search }}" found no results.</v-alert> |
280 | 286 | </v-data-table> |
281 | 287 | <!-- ****** ADD ACADEMIC YEAR ****** --> |
282 | - <v-dialog v-model="addAcademicYearDialog" max-width="600px"> | |
288 | + <v-dialog v-model="addAcademicYearDialog" max-width="600px" v-if="addAcademicYearDialog"> | |
283 | 289 | <v-card flat class="card-style pa-2" dark> |
284 | 290 | <v-layout> |
285 | 291 | <v-flex xs12> |
286 | 292 | <label class="title text-xs-center">Add Academic Year</label> |
287 | - <v-icon size="24" class="right" @click="addAcademicYearDialog = false">cancel</v-icon> | |
293 | + <v-icon size="24" class="right" @click="closeAddAcademicYearModel">cancel</v-icon> | |
288 | 294 | </v-flex> |
289 | 295 | </v-layout> |
290 | 296 | <v-form ref="form" v-model="valid" lazy-validation> |
... | ... | @@ -444,67 +450,74 @@ export default { |
444 | 450 | viewAcademinYearDialog: false, |
445 | 451 | valid: true, |
446 | 452 | pagination: { |
447 | - rowsPerPage: 10 | |
453 | + rowsPerPage: 10, | |
448 | 454 | }, |
449 | 455 | date: null, |
450 | 456 | menu1: false, |
451 | 457 | menu: false, |
452 | 458 | menuStart: false, |
453 | 459 | menuEndDate: false, |
454 | - yearRules: [v => !!v || "Year is required"], | |
455 | - yearTitleRules: [v => !!v || "Year Title is required"], | |
456 | - startDateRules: [v => !!v || "startDate is required"], | |
457 | - endDateRules: [v => !!v || "endDate is required"], | |
460 | + yearRules: [(v) => !!v || "Year is required"], | |
461 | + yearTitleRules: [(v) => !!v || "Year Title is required"], | |
462 | + startDateRules: [(v) => !!v || "startDate is required"], | |
463 | + endDateRules: [(v) => !!v || "endDate is required"], | |
458 | 464 | headers: [ |
459 | 465 | { |
460 | 466 | text: "No", |
461 | 467 | align: "center", |
462 | 468 | sortable: false, |
463 | - value: "No" | |
469 | + value: "No", | |
464 | 470 | }, |
465 | 471 | { text: "Year", value: "year", sortable: false, align: "center" }, |
466 | 472 | { |
467 | 473 | text: "Year Title", |
468 | 474 | value: "yearTitle", |
469 | 475 | sortable: false, |
470 | - align: "center" | |
476 | + align: "center", | |
471 | 477 | }, |
472 | 478 | |
473 | 479 | { |
474 | 480 | text: "Starting Date", |
475 | 481 | value: "startingDate", |
476 | 482 | sortable: false, |
477 | - align: "center" | |
483 | + align: "center", | |
478 | 484 | }, |
479 | 485 | { |
480 | 486 | text: "Ending Date", |
481 | 487 | value: "endingDate", |
482 | 488 | sortable: false, |
483 | - align: "center" | |
489 | + align: "center", | |
484 | 490 | }, |
485 | - { text: "Action", value: "", sortable: false, align: "center" } | |
491 | + { text: "Action", value: "", sortable: false, align: "center" }, | |
486 | 492 | ], |
487 | 493 | getAcademicYearList: [], |
488 | 494 | editedIndex: -1, |
489 | 495 | addAcademicYear: {}, |
490 | 496 | editedItem: {}, |
491 | - token: "" | |
497 | + token: "", | |
492 | 498 | }), |
499 | + watch: { | |
500 | + addAcademicYearDialog: function (val) { | |
501 | + if (!val) { | |
502 | + this.addAcademicYear = []; | |
503 | + } | |
504 | + }, | |
505 | + }, | |
493 | 506 | methods: { |
494 | - dates: function(date) { | |
507 | + dates: function (date) { | |
495 | 508 | return moment(date).format("MMMM DD, YYYY"); |
496 | 509 | }, |
497 | 510 | getAcademicYear() { |
498 | 511 | this.showLoader = true; |
499 | 512 | http() |
500 | 513 | .get("/getAcademicsList", { |
501 | - headers: { Authorization: "Bearer " + this.token } | |
514 | + headers: { Authorization: "Bearer " + this.token }, | |
502 | 515 | }) |
503 | - .then(response => { | |
516 | + .then((response) => { | |
504 | 517 | this.getAcademicYearList = response.data.data; |
505 | 518 | this.showLoader = false; |
506 | 519 | }) |
507 | - .catch(error => { | |
520 | + .catch((error) => { | |
508 | 521 | this.showLoader = false; |
509 | 522 | if (error.response.status === 401) { |
510 | 523 | this.$router.replace({ path: "/" }); |
... | ... | @@ -527,22 +540,22 @@ export default { |
527 | 540 | |
528 | 541 | deleteItem(item) { |
529 | 542 | let deleteAcademic = { |
530 | - academicId: item._id | |
543 | + academicId: item._id, | |
531 | 544 | }; |
532 | 545 | http() |
533 | 546 | .delete( |
534 | 547 | "/deleteAcademic", |
535 | 548 | confirm("Are you sure you want to delete this?") && { |
536 | - params: deleteAcademic | |
549 | + params: deleteAcademic, | |
537 | 550 | } |
538 | 551 | ) |
539 | - .then(response => { | |
552 | + .then((response) => { | |
540 | 553 | this.snackbar = true; |
541 | 554 | this.text = response.data.message; |
542 | 555 | this.color = "green"; |
543 | 556 | this.getAcademicYear(); |
544 | 557 | }) |
545 | - .catch(error => { | |
558 | + .catch((error) => { | |
546 | 559 | this.snackbar = true; |
547 | 560 | this.text = error.response.data.message; |
548 | 561 | this.color = "error"; |
... | ... | @@ -551,12 +564,17 @@ export default { |
551 | 564 | close() { |
552 | 565 | this.editAcademinYearDialog = false; |
553 | 566 | }, |
567 | + closeAddAcademicYearModel() { | |
568 | + this.addAcademicYearDialog = false; | |
569 | + this.getAcademicYearList = []; | |
570 | + this.addAcademicYear = []; | |
571 | + }, | |
554 | 572 | submit() { |
555 | 573 | if (this.$refs.form.validate()) { |
556 | 574 | this.loading = true; |
557 | 575 | http() |
558 | 576 | .post("/createAcademic", this.addAcademicYear) |
559 | - .then(response => { | |
577 | + .then((response) => { | |
560 | 578 | this.snackbar = true; |
561 | 579 | this.text = response.data.message; |
562 | 580 | this.color = "green"; |
... | ... | @@ -565,7 +583,7 @@ export default { |
565 | 583 | this.loading = false; |
566 | 584 | this.addAcademicYearDialog = false; |
567 | 585 | }) |
568 | - .catch(error => { | |
586 | + .catch((error) => { | |
569 | 587 | this.snackbar = true; |
570 | 588 | this.text = error.response.data.message; |
571 | 589 | this.color = "error"; |
... | ... | @@ -580,16 +598,16 @@ export default { |
580 | 598 | this.editedItem.academicId = this.editedItem._id; |
581 | 599 | http() |
582 | 600 | .put("/updateAcademic", this.editedItem, { |
583 | - headers: { Authorization: "Bearer " + this.token } | |
601 | + headers: { Authorization: "Bearer " + this.token }, | |
584 | 602 | }) |
585 | - .then(response => { | |
603 | + .then((response) => { | |
586 | 604 | this.snackbar = true; |
587 | 605 | this.text = response.data.message; |
588 | 606 | this.color = "green"; |
589 | 607 | this.getAcademicYear(); |
590 | 608 | this.close(); |
591 | 609 | }) |
592 | - .catch(error => { | |
610 | + .catch((error) => { | |
593 | 611 | this.snackbar = true; |
594 | 612 | this.text = error.response.data.message; |
595 | 613 | this.color = "error"; |
... | ... | @@ -602,11 +620,11 @@ export default { |
602 | 620 | this.showSearch = false; |
603 | 621 | this.show = true; |
604 | 622 | this.search = ""; |
605 | - } | |
623 | + }, | |
606 | 624 | }, |
607 | 625 | mounted() { |
608 | 626 | this.token = this.$store.state.token; |
609 | 627 | this.getAcademicYear(); |
610 | - } | |
628 | + }, | |
611 | 629 | }; |
612 | 630 | </script> |
613 | 631 | \ No newline at end of file | ... | ... |
src/pages/Annoucement/annoucement.vue
... | ... | @@ -224,7 +224,13 @@ |
224 | 224 | </v-card-title> |
225 | 225 | <v-flex xs8 sm7 lg2 md3 v-if="showSearch"> |
226 | 226 | <v-layout> |
227 | - <v-text-field autofocus v-model="search" label="Search" prepend-inner-icon="search" color="primary"></v-text-field> | |
227 | + <v-text-field | |
228 | + autofocus | |
229 | + v-model="search" | |
230 | + label="Search" | |
231 | + prepend-inner-icon="search" | |
232 | + color="primary" | |
233 | + ></v-text-field> | |
228 | 234 | <v-icon @click="closeSearch" color="error">close</v-icon> |
229 | 235 | </v-layout> |
230 | 236 | </v-flex> |
... | ... | @@ -318,12 +324,16 @@ |
318 | 324 | >Your search for "{{ search }}" found no results.</v-alert> |
319 | 325 | </v-data-table> |
320 | 326 | <!-- ****** Add Annoucement DETAILS******--> |
321 | - <v-dialog v-model="addAnnoucementDialog" max-width="500"> | |
327 | + <v-dialog v-model="addAnnoucementDialog" max-width="500" v-if="addAnnoucementDialog"> | |
322 | 328 | <v-card flat class="card-style pa-2" dark> |
323 | 329 | <v-layout> |
324 | 330 | <v-flex xs12> |
325 | 331 | <label class="title text-xs-center">Add Annoucement</label> |
326 | - <v-icon size="24" class="right" @click="$refs.form.reset();addAnnoucementDialog = false">cancel</v-icon> | |
332 | + <v-icon | |
333 | + size="24" | |
334 | + class="right" | |
335 | + @click="$refs.form.reset();addAnnoucementDialog = false" | |
336 | + >cancel</v-icon> | |
327 | 337 | </v-flex> |
328 | 338 | </v-layout> |
329 | 339 | <v-container fluid> |
... | ... | @@ -533,6 +543,16 @@ export default { |
533 | 543 | editedItem: {}, |
534 | 544 | annoucementData: [], |
535 | 545 | }), |
546 | + watch: { | |
547 | + addAnnoucementDialog: function (val) { | |
548 | + if (!val) { | |
549 | + this.addAnnoucement = []; | |
550 | + this.imageName = ""; | |
551 | + this.imageFile = ""; | |
552 | + this.imageUrl = ""; | |
553 | + } | |
554 | + }, | |
555 | + }, | |
536 | 556 | methods: { |
537 | 557 | getCourses(selectCourseId) { |
538 | 558 | this.showLoader = true; | ... | ... |
src/pages/Attendence/studentAttendence.vue
... | ... | @@ -56,7 +56,7 @@ |
56 | 56 | item-text="name" |
57 | 57 | item-value="_id" |
58 | 58 | name="Select Section" |
59 | - @change="getStudents(getAttendence.sectionId)" | |
59 | + @change="getStudentsDetail(getAttendence.sectionId)" | |
60 | 60 | class="px-2" |
61 | 61 | required |
62 | 62 | ></v-select> |
... | ... | @@ -70,7 +70,13 @@ |
70 | 70 | </v-card-title> |
71 | 71 | <v-flex xs8 sm8 md3 lg2 v-if="showSearch"> |
72 | 72 | <v-layout> |
73 | - <v-text-field autofocus v-model="search" label="Search" prepend-inner-icon="search" color="primary"></v-text-field> | |
73 | + <v-text-field | |
74 | + autofocus | |
75 | + v-model="search" | |
76 | + label="Search" | |
77 | + prepend-inner-icon="search" | |
78 | + color="primary" | |
79 | + ></v-text-field> | |
74 | 80 | <v-icon @click="closeSearch" color="error">close</v-icon> |
75 | 81 | </v-layout> |
76 | 82 | </v-flex> |
... | ... | @@ -116,12 +122,16 @@ |
116 | 122 | >Your search for "{{ search }}" found no results.</v-alert> |
117 | 123 | </v-data-table> |
118 | 124 | <!-- ****** Add Students Attendece****** --> |
119 | - <v-dialog v-model="addStudentAttendenceDialog" width="1600"> | |
125 | + <v-dialog v-model="addStudentAttendenceDialog" width="1600" v-if="addStudentAttendenceDialog"> | |
120 | 126 | <v-card flat class="pa-2"> |
121 | 127 | <v-layout> |
122 | 128 | <v-flex xs12> |
123 | 129 | <label class="title text-xs-center">Add Student Attendence</label> |
124 | - <v-icon size="24" class="right" @click="$refs.form.reset();addStudentAttendenceDialog = false">cancel</v-icon> | |
130 | + <v-icon | |
131 | + size="24" | |
132 | + class="right" | |
133 | + @click="$refs.form.reset();addStudentAttendenceDialog = false" | |
134 | + >cancel</v-icon> | |
125 | 135 | </v-flex> |
126 | 136 | </v-layout> |
127 | 137 | <v-flex xs12 class="mt-4"> |
... | ... | @@ -345,6 +355,14 @@ export default { |
345 | 355 | }, |
346 | 356 | ], |
347 | 357 | }), |
358 | + watch: { | |
359 | + addStudentAttendenceDialog: function (val) { | |
360 | + if (!val) { | |
361 | + this.getReport = []; | |
362 | + this.studentsData = []; | |
363 | + } | |
364 | + }, | |
365 | + }, | |
348 | 366 | methods: { |
349 | 367 | save(date) { |
350 | 368 | this.$refs.menu.save(date); |
... | ... | @@ -390,6 +408,29 @@ export default { |
390 | 408 | http() |
391 | 409 | .get("/getStudentWithClass", { |
392 | 410 | params: { |
411 | + classId: this.getReport.classId, | |
412 | + sectionId: this.getReport.sectionId, | |
413 | + }, | |
414 | + }) | |
415 | + .then((response) => { | |
416 | + this.studentsData = response.data.data; | |
417 | + this.showLoader = false; | |
418 | + // this.addStudentAttendenceDialog = false; | |
419 | + var attendence = ""; | |
420 | + for (let i = 0; i < this.studentsData.length; i++) { | |
421 | + this.studentsData[i].attendence = true; | |
422 | + } | |
423 | + }) | |
424 | + .catch((error) => { | |
425 | + console.log("err====>", error); | |
426 | + this.showLoader = false; | |
427 | + }); | |
428 | + }, | |
429 | + getStudentsDetail(_id) { | |
430 | + this.showLoader = true; | |
431 | + http() | |
432 | + .get("/getStudentWithClass", { | |
433 | + params: { | |
393 | 434 | classId: this.getAttendence.classId, |
394 | 435 | sectionId: this.getAttendence.sectionId, |
395 | 436 | }, |
... | ... | @@ -437,8 +478,8 @@ export default { |
437 | 478 | }, |
438 | 479 | |
439 | 480 | displaySearch() { |
440 | - this.show = false | |
441 | - this.showSearch = true; | |
481 | + this.show = false; | |
482 | + this.showSearch = true; | |
442 | 483 | }, |
443 | 484 | closeSearch() { |
444 | 485 | this.showSearch = false; | ... | ... |
src/pages/Attendence/teacherAttendence.vue
... | ... | @@ -30,7 +30,13 @@ |
30 | 30 | </v-card-title> |
31 | 31 | <v-flex xs8 sm8 md3 lg2 v-if="showSearch"> |
32 | 32 | <v-layout> |
33 | - <v-text-field autofocus v-model="search" label="Search" prepend-inner-icon="search" color="primary"></v-text-field> | |
33 | + <v-text-field | |
34 | + autofocus | |
35 | + v-model="search" | |
36 | + label="Search" | |
37 | + prepend-inner-icon="search" | |
38 | + color="primary" | |
39 | + ></v-text-field> | |
34 | 40 | <v-icon @click="closeSearch" color="error">close</v-icon> |
35 | 41 | </v-layout> |
36 | 42 | </v-flex> |
... | ... | @@ -79,12 +85,16 @@ |
79 | 85 | >Your search for "{{ search }}" found no results.</v-alert> |
80 | 86 | </v-data-table> |
81 | 87 | <!-- ****** Add Teachers Attendece****** --> |
82 | - <v-dialog v-model="addTeacherAttendenceDialog" width="1600"> | |
88 | + <v-dialog v-model="addTeacherAttendenceDialog" width="1600" v-if="addTeacherAttendenceDialog"> | |
83 | 89 | <v-card flat class="pa-2"> |
84 | 90 | <v-layout> |
85 | 91 | <v-flex xs12> |
86 | 92 | <label class="title text-xs-center">Add Teacher Attendence</label> |
87 | - <v-icon size="24" class="right" @click="$refs.form.reset();addTeacherAttendenceDialog = false">cancel</v-icon> | |
93 | + <v-icon | |
94 | + size="24" | |
95 | + class="right" | |
96 | + @click="$refs.form.reset();addTeacherAttendenceDialog = false" | |
97 | + >cancel</v-icon> | |
88 | 98 | </v-flex> |
89 | 99 | </v-layout> |
90 | 100 | <v-flex xs12 class="mt-4"> |
... | ... | @@ -209,40 +219,40 @@ export default { |
209 | 219 | valid: true, |
210 | 220 | isActive: true, |
211 | 221 | newActive: false, |
212 | - dataValid: [v => !!v || "Date is required"], | |
222 | + dataValid: [(v) => !!v || "Date is required"], | |
213 | 223 | attendenceType: [ |
214 | 224 | { |
215 | 225 | label: "Present", |
216 | - value: "present" | |
226 | + value: "present", | |
217 | 227 | }, |
218 | 228 | { |
219 | 229 | label: "Late Present With Excuset", |
220 | - value: "latePresentWithExcuse" | |
230 | + value: "latePresentWithExcuse", | |
221 | 231 | }, |
222 | 232 | { |
223 | 233 | label: "Late Present", |
224 | - value: "latePresent" | |
234 | + value: "latePresent", | |
225 | 235 | }, |
226 | 236 | { |
227 | 237 | label: "Absent", |
228 | - value: "absent" | |
229 | - } | |
238 | + value: "absent", | |
239 | + }, | |
230 | 240 | ], |
231 | 241 | pagination: { |
232 | - rowsPerPage: 8 | |
242 | + rowsPerPage: 8, | |
233 | 243 | }, |
234 | 244 | headers: [ |
235 | 245 | { |
236 | 246 | text: "No", |
237 | 247 | align: "", |
238 | 248 | sortable: false, |
239 | - value: "No" | |
249 | + value: "No", | |
240 | 250 | }, |
241 | 251 | { |
242 | 252 | text: "Profile Pic", |
243 | 253 | value: "profilePicUrl", |
244 | 254 | sortable: false, |
245 | - align: "center" | |
255 | + align: "center", | |
246 | 256 | }, |
247 | 257 | { text: "Name", value: "name", sortable: false, align: "center" }, |
248 | 258 | { text: "Email", value: "email", sortable: false, align: "center" }, |
... | ... | @@ -250,18 +260,25 @@ export default { |
250 | 260 | text: "Mobile No", |
251 | 261 | value: "mobileNo", |
252 | 262 | sortable: false, |
253 | - align: "center" | |
263 | + align: "center", | |
254 | 264 | }, |
255 | - { text: "Attendance", value: "", sortable: false, align: "center" } | |
265 | + { text: "Attendance", value: "", sortable: false, align: "center" }, | |
256 | 266 | ], |
257 | 267 | desserts: [], |
258 | 268 | teachersData: [], |
259 | - addTeachers: {} | |
269 | + addTeachers: {}, | |
260 | 270 | }), |
261 | 271 | watch: { |
262 | 272 | menu(val) { |
263 | 273 | val && this.$nextTick(() => (this.$refs.picker.activePicker = "DAY")); |
264 | - } | |
274 | + }, | |
275 | + addTeacherAttendenceDialog: function (val) { | |
276 | + if (!val) { | |
277 | + this.teachersData = []; | |
278 | + this.date = null; | |
279 | + this.menu = false; | |
280 | + } | |
281 | + }, | |
265 | 282 | }, |
266 | 283 | methods: { |
267 | 284 | save(date) { |
... | ... | @@ -276,9 +293,9 @@ export default { |
276 | 293 | var token = this.$store.state.token; |
277 | 294 | http() |
278 | 295 | .get("/getTeachersList", { |
279 | - headers: { Authorization: "Bearer " + token } | |
296 | + headers: { Authorization: "Bearer " + token }, | |
280 | 297 | }) |
281 | - .then(response => { | |
298 | + .then((response) => { | |
282 | 299 | this.teachersData = response.data.data; |
283 | 300 | // this.desserts = response.data.data; |
284 | 301 | var attendence = ""; |
... | ... | @@ -288,9 +305,8 @@ export default { |
288 | 305 | this.showLoader = false; |
289 | 306 | // console.log("getTeacherList=====>",this.desserts) |
290 | 307 | // console.log("getTeacherList=====>",this.teachersData) |
291 | - | |
292 | 308 | }) |
293 | - .catch(error => { | |
309 | + .catch((error) => { | |
294 | 310 | this.showLoader = false; |
295 | 311 | if (error.response.status === 401) { |
296 | 312 | this.$router.replace({ path: "/" }); |
... | ... | @@ -304,23 +320,23 @@ export default { |
304 | 320 | for (var j = 0; j < this.teachersData.length; j++) { |
305 | 321 | teachersAttendence.push({ |
306 | 322 | teacherId: this.teachersData[j]._id, |
307 | - attendanceType: this.teachersData[j].attendence | |
323 | + attendanceType: this.teachersData[j].attendence, | |
308 | 324 | }); |
309 | 325 | } |
310 | 326 | if (this.$refs.form.validate()) { |
311 | 327 | let attendanceData = { |
312 | 328 | date: this.date, |
313 | - teachers: teachersAttendence | |
329 | + teachers: teachersAttendence, | |
314 | 330 | }; |
315 | 331 | http() |
316 | 332 | .post("/createTeacherAttendance", attendanceData) |
317 | - .then(response => { | |
333 | + .then((response) => { | |
318 | 334 | this.snackbar = true; |
319 | 335 | this.text = response.data.message; |
320 | 336 | this.addTeacherAttendenceDialog = false; |
321 | 337 | this.clear(); |
322 | 338 | }) |
323 | - .catch(error => { | |
339 | + .catch((error) => { | |
324 | 340 | this.snackbar = true; |
325 | 341 | this.text = error.response.data.message; |
326 | 342 | }); |
... | ... | @@ -338,11 +354,11 @@ export default { |
338 | 354 | this.showSearch = false; |
339 | 355 | this.show = true; |
340 | 356 | this.search = ""; |
341 | - } | |
357 | + }, | |
342 | 358 | }, |
343 | 359 | mounted() { |
344 | 360 | this.getTeacherList(); |
345 | 361 | this.role = this.$store.state.role; |
346 | - } | |
362 | + }, | |
347 | 363 | }; |
348 | 364 | </script> |
349 | 365 | \ No newline at end of file | ... | ... |
src/pages/Class/addclass.vue
... | ... | @@ -82,7 +82,13 @@ |
82 | 82 | </v-card-title> |
83 | 83 | <v-flex xs8 sm8 md3 lg2 v-if="showSearch"> |
84 | 84 | <v-layout> |
85 | - <v-text-field autofocus v-model="search" label="Search" prepend-inner-icon="search" color="primary"></v-text-field> | |
85 | + <v-text-field | |
86 | + autofocus | |
87 | + v-model="search" | |
88 | + label="Search" | |
89 | + prepend-inner-icon="search" | |
90 | + color="primary" | |
91 | + ></v-text-field> | |
86 | 92 | <v-icon @click="closeSearch" color="error">close</v-icon> |
87 | 93 | </v-layout> |
88 | 94 | </v-flex> |
... | ... | @@ -141,12 +147,16 @@ |
141 | 147 | </v-data-table> |
142 | 148 | |
143 | 149 | <!-- DIALOG BOX - ADD Class --> |
144 | - <v-dialog v-model="addClassDialog" max-width="400px"> | |
150 | + <v-dialog v-model="addClassDialog" max-width="400px" v-if="addClassDialog"> | |
145 | 151 | <v-card flat class="card-style pa-2" dark> |
146 | 152 | <v-layout> |
147 | 153 | <v-flex xs12> |
148 | 154 | <label class="title text-xs-center">Add Class</label> |
149 | - <v-icon size="24" class="right" @click="$refs.form.reset();addClassDialog = false">cancel</v-icon> | |
155 | + <v-icon | |
156 | + size="24" | |
157 | + class="right" | |
158 | + @click="$refs.form.reset();addClassDialog = false" | |
159 | + >cancel</v-icon> | |
150 | 160 | </v-flex> |
151 | 161 | </v-layout> |
152 | 162 | <v-container fluid fill-height> |
... | ... | @@ -245,6 +255,13 @@ export default { |
245 | 255 | classNum: "", |
246 | 256 | }, |
247 | 257 | }), |
258 | + watch: { | |
259 | + addClassDialog: function (val) { | |
260 | + if (!val) { | |
261 | + this.addclasses = []; | |
262 | + } | |
263 | + }, | |
264 | + }, | |
248 | 265 | methods: { |
249 | 266 | getClassList() { |
250 | 267 | this.showLoader = true; |
... | ... | @@ -318,7 +335,7 @@ export default { |
318 | 335 | this.color = "green"; |
319 | 336 | // this.clear(); |
320 | 337 | this.loading = false; |
321 | - this.$refs.form.reset() | |
338 | + this.$refs.form.reset(); | |
322 | 339 | this.addClassDialog = false; |
323 | 340 | }) |
324 | 341 | .catch((error) => { | ... | ... |
src/pages/Course/course.vue
... | ... | @@ -191,7 +191,13 @@ |
191 | 191 | </v-card-title> |
192 | 192 | <v-flex xs8 sm7 lg2 md3 v-if="showSearch"> |
193 | 193 | <v-layout> |
194 | - <v-text-field autofocus v-model="search" label="Search" prepend-inner-icon="search" color="primary"></v-text-field> | |
194 | + <v-text-field | |
195 | + autofocus | |
196 | + v-model="search" | |
197 | + label="Search" | |
198 | + prepend-inner-icon="search" | |
199 | + color="primary" | |
200 | + ></v-text-field> | |
195 | 201 | <v-icon @click="closeSearch" color="error">close</v-icon> |
196 | 202 | </v-layout> |
197 | 203 | </v-flex> |
... | ... | @@ -281,12 +287,12 @@ |
281 | 287 | >Your search for "{{ search }}" found no results.</v-alert> |
282 | 288 | </v-data-table> |
283 | 289 | <!-- ****** Add CourseS DETAILS****** --> |
284 | - <v-dialog v-model="addCourseDialog" max-width="500"> | |
290 | + <v-dialog v-model="addCourseDialog" max-width="500" v-if="addCourseDialog"> | |
285 | 291 | <v-card flat class="card-style pa-2" dark> |
286 | 292 | <v-layout> |
287 | 293 | <v-flex xs12> |
288 | 294 | <label class="title text-xs-center">Add Course</label> |
289 | - <v-icon size="24" class="right" @click="addCourseDialog = false">cancel</v-icon> | |
295 | + <v-icon size="24" class="right" @click="closeAddCourseModel">cancel</v-icon> | |
290 | 296 | </v-flex> |
291 | 297 | </v-layout> |
292 | 298 | <v-container fluid> |
... | ... | @@ -473,6 +479,16 @@ export default { |
473 | 479 | }, |
474 | 480 | editedItem: {}, |
475 | 481 | }), |
482 | + watch: { | |
483 | + addCourseDialog: function (val) { | |
484 | + if (!val) { | |
485 | + this.addCourses = []; | |
486 | + this.imageName = ""; | |
487 | + this.imageFile = ""; | |
488 | + this.imageUrl = ""; | |
489 | + } | |
490 | + }, | |
491 | + }, | |
476 | 492 | methods: { |
477 | 493 | getCourses() { |
478 | 494 | this.showLoader = true; |
... | ... | @@ -602,6 +618,14 @@ export default { |
602 | 618 | closeStudentProfile() { |
603 | 619 | this.profileStudentDialog = false; |
604 | 620 | }, |
621 | + closeAddCourseModel() { | |
622 | + this.addCourseDialog = false; | |
623 | + this.courseData = []; | |
624 | + this.addCourses = []; | |
625 | + this.imageName = ""; | |
626 | + this.imageFile = ""; | |
627 | + this.imageUrl = ""; | |
628 | + }, | |
605 | 629 | submit() { |
606 | 630 | if (this.$refs.form.validate()) { |
607 | 631 | let addCourse = { | ... | ... |
src/pages/Course/courseDetail.vue
... | ... | @@ -403,7 +403,11 @@ |
403 | 403 | style="text-decoration: none!important;" |
404 | 404 | > |
405 | 405 | <v-btn flat block> |
406 | - <span><h5><b>Open PDF</b></h5></span> | |
406 | + <span> | |
407 | + <h5> | |
408 | + <b>Open PDF</b> | |
409 | + </h5> | |
410 | + </span> | |
407 | 411 | </v-btn> |
408 | 412 | </a> |
409 | 413 | </div> |
... | ... | @@ -471,7 +475,7 @@ |
471 | 475 | <v-flex xs12 sm3 md3 v-if="showSearch"> |
472 | 476 | <div style="display: inline-block;width: 70%;"> |
473 | 477 | <v-text-field |
474 | - autofocus | |
478 | + autofocus | |
475 | 479 | v-model="search" |
476 | 480 | label="Search" |
477 | 481 | prepend-inner-icon="search" | ... | ... |
src/pages/Event/event.vue
... | ... | @@ -168,7 +168,13 @@ |
168 | 168 | </v-card-title> |
169 | 169 | <v-flex xs8 sm8 md3 lg2 v-if="showSearch"> |
170 | 170 | <v-layout> |
171 | - <v-text-field autofocus v-model="search" label="Search" prepend-inner-icon="search" color="primary"></v-text-field> | |
171 | + <v-text-field | |
172 | + autofocus | |
173 | + v-model="search" | |
174 | + label="Search" | |
175 | + prepend-inner-icon="search" | |
176 | + color="primary" | |
177 | + ></v-text-field> | |
172 | 178 | <v-icon @click="closeSearch" color="error">close</v-icon> |
173 | 179 | </v-layout> |
174 | 180 | </v-flex> |
... | ... | @@ -224,12 +230,12 @@ |
224 | 230 | >Your search for "{{ search }}" found no results.</v-alert> |
225 | 231 | </v-data-table> |
226 | 232 | <!-- ****** ADD MULTIPLE EVENT ****** --> |
227 | - <v-dialog v-model="addEventDialog" max-width="500px"> | |
233 | + <v-dialog v-model="addEventDialog" max-width="500px" v-if="addEventDialog"> | |
228 | 234 | <v-card flat class="card-style pa-2" dark> |
229 | 235 | <v-layout> |
230 | 236 | <v-flex xs12> |
231 | 237 | <label class="title text-xs-center">Add Event</label> |
232 | - <v-icon size="24" class="right" @click="addEventDialog = false">cancel</v-icon> | |
238 | + <v-icon size="24" class="right" @click="closeAddEventModel">cancel</v-icon> | |
233 | 239 | </v-flex> |
234 | 240 | </v-layout> |
235 | 241 | <v-form ref="form" v-model="valid" lazy-validation> |
... | ... | @@ -352,20 +358,20 @@ export default { |
352 | 358 | viewEventdialog: false, |
353 | 359 | valid: true, |
354 | 360 | pagination: { |
355 | - rowsPerPage: 10 | |
361 | + rowsPerPage: 10, | |
356 | 362 | }, |
357 | 363 | date: null, |
358 | 364 | menu1: false, |
359 | 365 | menu: false, |
360 | - titleRules: [v => !!v || " Tilte is required"], | |
361 | - descriptionRules: [v => !!v || " Discription is required"], | |
362 | - dateRules: [v => !!v || "Date is required"], | |
366 | + titleRules: [(v) => !!v || " Tilte is required"], | |
367 | + descriptionRules: [(v) => !!v || " Discription is required"], | |
368 | + dateRules: [(v) => !!v || "Date is required"], | |
363 | 369 | headers: [ |
364 | 370 | { |
365 | 371 | text: "No", |
366 | 372 | align: "", |
367 | 373 | sortable: false, |
368 | - value: "No" | |
374 | + value: "No", | |
369 | 375 | }, |
370 | 376 | { text: "Title", value: "title", sortable: false, align: "center" }, |
371 | 377 | { text: "Date", value: "date", sortable: false, align: "center" }, |
... | ... | @@ -374,17 +380,25 @@ export default { |
374 | 380 | text: "Description", |
375 | 381 | value: "description", |
376 | 382 | sortable: false, |
377 | - align: "center" | |
383 | + align: "center", | |
378 | 384 | }, |
379 | - { text: "Action", value: "", sortable: false, align: "center" } | |
385 | + { text: "Action", value: "", sortable: false, align: "center" }, | |
380 | 386 | ], |
381 | 387 | events: [], |
382 | 388 | editedIndex: -1, |
383 | 389 | addEvent: {}, |
384 | - editedItem: {} | |
390 | + editedItem: {}, | |
385 | 391 | }), |
392 | + watch: { | |
393 | + addEventDialog: function (val) { | |
394 | + if (!val) { | |
395 | + this.addEvent = []; | |
396 | + this.menu1 = false; | |
397 | + } | |
398 | + }, | |
399 | + }, | |
386 | 400 | methods: { |
387 | - dates: function(date) { | |
401 | + dates: function (date) { | |
388 | 402 | return moment(date).format("MMMM DD, YYYY"); |
389 | 403 | }, |
390 | 404 | getEvents() { |
... | ... | @@ -392,13 +406,13 @@ export default { |
392 | 406 | var token = this.$store.state.token; |
393 | 407 | http() |
394 | 408 | .get("/getSchoolEventsList", { |
395 | - headers: { Authorization: "Bearer " + token } | |
409 | + headers: { Authorization: "Bearer " + token }, | |
396 | 410 | }) |
397 | - .then(response => { | |
411 | + .then((response) => { | |
398 | 412 | this.events = response.data.data; |
399 | 413 | this.showLoader = false; |
400 | 414 | }) |
401 | - .catch(error => { | |
415 | + .catch((error) => { | |
402 | 416 | // console.log("err====>", err); |
403 | 417 | this.showLoader = false; |
404 | 418 | if (error.response.status === 401) { |
... | ... | @@ -422,16 +436,16 @@ export default { |
422 | 436 | |
423 | 437 | deleteItem(item) { |
424 | 438 | let deleteEvent = { |
425 | - schoolEventId: item._id | |
439 | + schoolEventId: item._id, | |
426 | 440 | }; |
427 | 441 | http() |
428 | 442 | .delete( |
429 | 443 | "/deleteSchoolEvent", |
430 | 444 | confirm("Are you sure you want to delete this?") && { |
431 | - params: deleteEvent | |
445 | + params: deleteEvent, | |
432 | 446 | } |
433 | 447 | ) |
434 | - .then(response => { | |
448 | + .then((response) => { | |
435 | 449 | this.snackbar = true; |
436 | 450 | this.text = response.data.message; |
437 | 451 | this.getEvents(); |
... | ... | @@ -439,7 +453,7 @@ export default { |
439 | 453 | this.color = "green"; |
440 | 454 | this.text = response.data.message; |
441 | 455 | }) |
442 | - .catch(error => { | |
456 | + .catch((error) => { | |
443 | 457 | this.snackbar = true; |
444 | 458 | this.text = error.response.data.message; |
445 | 459 | this.color = "error"; |
... | ... | @@ -449,12 +463,17 @@ export default { |
449 | 463 | close() { |
450 | 464 | this.editEventdialog = false; |
451 | 465 | }, |
466 | + closeAddEventModel() { | |
467 | + this.addEventDialog = false; | |
468 | + this.addEvent = []; | |
469 | + this.menu1 = false; | |
470 | + }, | |
452 | 471 | submit() { |
453 | 472 | if (this.$refs.form.validate()) { |
454 | 473 | this.loading = true; |
455 | 474 | http() |
456 | 475 | .post("/createSchoolEvent", this.addEvent) |
457 | - .then(response => { | |
476 | + .then((response) => { | |
458 | 477 | this.snackbar = true; |
459 | 478 | this.text = response.data.message; |
460 | 479 | this.color = "green"; |
... | ... | @@ -463,7 +482,7 @@ export default { |
463 | 482 | this.loading = false; |
464 | 483 | this.addEventDialog = false; |
465 | 484 | }) |
466 | - .catch(error => { | |
485 | + .catch((error) => { | |
467 | 486 | this.snackbar = true; |
468 | 487 | this.text = error.response.data.message; |
469 | 488 | this.color = "error"; |
... | ... | @@ -477,14 +496,14 @@ export default { |
477 | 496 | save() { |
478 | 497 | http() |
479 | 498 | .put("/updateSchoolEvent", this.editedItem) |
480 | - .then(response => { | |
499 | + .then((response) => { | |
481 | 500 | this.snackbar = true; |
482 | 501 | this.text = response.data.message; |
483 | 502 | this.color = "green"; |
484 | 503 | this.getEvents(); |
485 | 504 | this.close(); |
486 | 505 | }) |
487 | - .catch(error => { | |
506 | + .catch((error) => { | |
488 | 507 | this.snackbar = true; |
489 | 508 | this.text = error.response.data.message; |
490 | 509 | this.color = "error"; |
... | ... | @@ -497,10 +516,10 @@ export default { |
497 | 516 | this.showSearch = false; |
498 | 517 | this.show = true; |
499 | 518 | this.search = ""; |
500 | - } | |
519 | + }, | |
501 | 520 | }, |
502 | 521 | mounted() { |
503 | 522 | this.getEvents(); |
504 | - } | |
523 | + }, | |
505 | 524 | }; |
506 | 525 | </script> |
507 | 526 | \ No newline at end of file | ... | ... |
src/pages/Exam/exam.vue
... | ... | @@ -166,7 +166,13 @@ |
166 | 166 | </v-card-title> |
167 | 167 | <v-flex xs8 sm8 md3 lg2 v-if="showSearch"> |
168 | 168 | <v-layout> |
169 | - <v-text-field autofocus v-model="search" label="Search" prepend-inner-icon="search" color="primary"></v-text-field> | |
169 | + <v-text-field | |
170 | + autofocus | |
171 | + v-model="search" | |
172 | + label="Search" | |
173 | + prepend-inner-icon="search" | |
174 | + color="primary" | |
175 | + ></v-text-field> | |
170 | 176 | <v-icon @click="closeSearch" color="error">close</v-icon> |
171 | 177 | </v-layout> |
172 | 178 | </v-flex> |
... | ... | @@ -228,7 +234,7 @@ |
228 | 234 | </v-data-table> |
229 | 235 | |
230 | 236 | <!-- ****** ADD EXAM ****** --> |
231 | - <v-dialog v-model="addExamDialog" max-width="500px"> | |
237 | + <v-dialog v-model="addExamDialog" max-width="500px" v-if="addExamDialog"> | |
232 | 238 | <v-card flat class="card-style pa-2" dark> |
233 | 239 | <v-layout> |
234 | 240 | <v-flex xs12> |
... | ... | @@ -292,10 +298,7 @@ |
292 | 298 | <label class="right">Note:</label> |
293 | 299 | </v-flex> |
294 | 300 | <v-flex xs8 sm7 class="ml-3"> |
295 | - <v-text-field | |
296 | - placeholder="fill your Note" | |
297 | - v-model="addExam.note" | |
298 | - ></v-text-field> | |
301 | + <v-text-field placeholder="fill your Note" v-model="addExam.note"></v-text-field> | |
299 | 302 | </v-flex> |
300 | 303 | </v-layout> |
301 | 304 | </v-flex> |
... | ... | @@ -355,43 +358,50 @@ export default { |
355 | 358 | profileExamDialog: false, |
356 | 359 | valid: true, |
357 | 360 | pagination: { |
358 | - rowsPerPage: 10 | |
361 | + rowsPerPage: 10, | |
359 | 362 | }, |
360 | - libraryIDRules: [v => !!v || " Library ID is required"], | |
361 | - bookRules: [v => !!v || " book Name is required"], | |
362 | - authorRules: [v => !!v || "Author Name is required"], | |
363 | - subjectCodeRules: [v => !!v || "Subject Code is required"], | |
364 | - authorRules: [v => !!v || "Author is required"], | |
365 | - examDateRules: [v => !!v || "Date is required"], | |
363 | + libraryIDRules: [(v) => !!v || " Library ID is required"], | |
364 | + bookRules: [(v) => !!v || " book Name is required"], | |
365 | + authorRules: [(v) => !!v || "Author Name is required"], | |
366 | + subjectCodeRules: [(v) => !!v || "Subject Code is required"], | |
367 | + authorRules: [(v) => !!v || "Author is required"], | |
368 | + examDateRules: [(v) => !!v || "Date is required"], | |
366 | 369 | headers: [ |
367 | 370 | { |
368 | 371 | align: "", |
369 | 372 | text: "No", |
370 | 373 | sortable: false, |
371 | - value: "No" | |
374 | + value: "No", | |
372 | 375 | }, |
373 | 376 | { text: "Exam Name", vaue: "examName", sortable: false, align: "center" }, |
374 | 377 | { |
375 | 378 | text: "Date", |
376 | 379 | value: "date", |
377 | 380 | sortable: false, |
378 | - align: "center" | |
381 | + align: "center", | |
379 | 382 | }, |
380 | 383 | { |
381 | 384 | text: "Note", |
382 | 385 | value: "note", |
383 | 386 | sortable: false, |
384 | - align: "center" | |
387 | + align: "center", | |
385 | 388 | }, |
386 | - { text: "Action", value: "", sortable: false, align: "center" } | |
389 | + { text: "Action", value: "", sortable: false, align: "center" }, | |
387 | 390 | ], |
388 | 391 | examData: [], |
389 | 392 | addExam: {}, |
390 | 393 | editedItem: {}, |
391 | - token: "" | |
394 | + token: "", | |
392 | 395 | }), |
396 | + watch: { | |
397 | + addExamDialog: function (val) { | |
398 | + if (!val) { | |
399 | + this.addExam = []; | |
400 | + } | |
401 | + }, | |
402 | + }, | |
393 | 403 | methods: { |
394 | - dates: function(date) { | |
404 | + dates: function (date) { | |
395 | 405 | return moment(date).format("MMMM DD, YYYY"); |
396 | 406 | }, |
397 | 407 | pickFile() { |
... | ... | @@ -402,14 +412,14 @@ export default { |
402 | 412 | this.loadingSearch = true; |
403 | 413 | http() |
404 | 414 | .get("/getExamsList", { |
405 | - headers: { Authorization: "Bearer " + this.token } | |
415 | + headers: { Authorization: "Bearer " + this.token }, | |
406 | 416 | }) |
407 | - .then(response => { | |
417 | + .then((response) => { | |
408 | 418 | this.examData = response.data.data; |
409 | 419 | this.showLoader = false; |
410 | 420 | this.loadingSearch = false; |
411 | 421 | }) |
412 | - .catch(error => { | |
422 | + .catch((error) => { | |
413 | 423 | // console.log("err====>", err); |
414 | 424 | this.showLoader = false; |
415 | 425 | this.loadingSearch = false; |
... | ... | @@ -438,23 +448,23 @@ export default { |
438 | 448 | }, |
439 | 449 | deleteItem(item) { |
440 | 450 | let Exam = { |
441 | - examId: item._id | |
451 | + examId: item._id, | |
442 | 452 | }; |
443 | 453 | http() |
444 | 454 | .delete( |
445 | 455 | "/deleteExam", |
446 | 456 | confirm("Are you sure you want to Delete this?") && { |
447 | - params: Exam | |
457 | + params: Exam, | |
448 | 458 | } |
449 | 459 | ) |
450 | - .then(response => { | |
460 | + .then((response) => { | |
451 | 461 | this.snackbar = true; |
452 | 462 | this.text = "Successfully Delete Exam "; |
453 | 463 | this.text = response.data.message; |
454 | 464 | this.color = "green"; |
455 | 465 | this.getExamList(); |
456 | 466 | }) |
457 | - .catch(error => { | |
467 | + .catch((error) => { | |
458 | 468 | this.snackbar = true; |
459 | 469 | this.text = error.response.data.message; |
460 | 470 | this.color = "red"; |
... | ... | @@ -468,7 +478,7 @@ export default { |
468 | 478 | this.loading = true; |
469 | 479 | http() |
470 | 480 | .post("/createExam", this.addExam) |
471 | - .then(response => { | |
481 | + .then((response) => { | |
472 | 482 | this.snackbar = true; |
473 | 483 | this.text = response.data.message; |
474 | 484 | this.color = "green"; |
... | ... | @@ -478,7 +488,7 @@ export default { |
478 | 488 | this.loading = false; |
479 | 489 | this.clear(); |
480 | 490 | }) |
481 | - .catch(error => { | |
491 | + .catch((error) => { | |
482 | 492 | this.snackbar = true; |
483 | 493 | this.text = error.response.data.message; |
484 | 494 | this.color = "red"; |
... | ... | @@ -494,14 +504,14 @@ export default { |
494 | 504 | this.editedItem.examId = this.editedItem._id; |
495 | 505 | http() |
496 | 506 | .put("/updateExam", this.editedItem) |
497 | - .then(response => { | |
507 | + .then((response) => { | |
498 | 508 | this.snackbar = true; |
499 | 509 | this.text = response.data.message; |
500 | 510 | this.color = "green"; |
501 | 511 | this.getExamList(); |
502 | 512 | this.close(); |
503 | 513 | }) |
504 | - .catch(error => { | |
514 | + .catch((error) => { | |
505 | 515 | this.snackbar = true; |
506 | 516 | this.text = error.response.data.message; |
507 | 517 | this.color = "red"; |
... | ... | @@ -514,11 +524,11 @@ export default { |
514 | 524 | this.showSearch = false; |
515 | 525 | this.show = true; |
516 | 526 | this.search = ""; |
517 | - } | |
527 | + }, | |
518 | 528 | }, |
519 | 529 | mounted() { |
520 | 530 | this.token = this.$store.state.token; |
521 | 531 | this.getExamList(); |
522 | - } | |
532 | + }, | |
523 | 533 | }; |
524 | 534 | </script> |
525 | 535 | \ No newline at end of file | ... | ... |
src/pages/Exam/examSchedule.vue
... | ... | @@ -348,7 +348,13 @@ |
348 | 348 | </v-card-title> |
349 | 349 | <v-flex xs8 sm8 md3 lg2 v-if="showSearch"> |
350 | 350 | <v-layout> |
351 | - <v-text-field autofocus v-model="search" label="Search" prepend-inner-icon="search" color="primary"></v-text-field> | |
351 | + <v-text-field | |
352 | + autofocus | |
353 | + v-model="search" | |
354 | + label="Search" | |
355 | + prepend-inner-icon="search" | |
356 | + color="primary" | |
357 | + ></v-text-field> | |
352 | 358 | <v-icon @click="closeSearch" color="error">close</v-icon> |
353 | 359 | </v-layout> |
354 | 360 | </v-flex> |
... | ... | @@ -412,12 +418,16 @@ |
412 | 418 | </v-data-table> |
413 | 419 | |
414 | 420 | <!-- ****** ADD Exam Schedule ****** --> |
415 | - <v-dialog v-model="addExamScheduleDialog" max-width="600"> | |
421 | + <v-dialog v-model="addExamScheduleDialog" max-width="600" v-if="addExamScheduleDialog"> | |
416 | 422 | <v-card flat class="card-style pa-2" dark> |
417 | 423 | <v-layout> |
418 | 424 | <v-flex xs12> |
419 | 425 | <label class="title text-xs-center">Add Exam Schedule</label> |
420 | - <v-icon size="24" class="right" @click="$refs.form.reset();addExamScheduleDialog = false">cancel</v-icon> | |
426 | + <v-icon | |
427 | + size="24" | |
428 | + class="right" | |
429 | + @click="$refs.form.reset();addExamScheduleDialog = false" | |
430 | + >cancel</v-icon> | |
421 | 431 | </v-flex> |
422 | 432 | </v-layout> |
423 | 433 | <v-form ref="form" v-model="valid" lazy-validation> |
... | ... | @@ -675,34 +685,34 @@ export default { |
675 | 685 | valid: true, |
676 | 686 | role: "", |
677 | 687 | pagination: { |
678 | - rowsPerPage: 10 | |
688 | + rowsPerPage: 10, | |
679 | 689 | }, |
680 | - examRules: [v => !!v || "Exam Name is required"], | |
681 | - classRules: [v => !!v || "Class Name is required"], | |
682 | - sectionRules: [v => !!v || "section is required"], | |
683 | - subjectRules: [v => !!v || "Subject is required"], | |
684 | - timeInRules: [v => !!v || "Time In is required"], | |
685 | - timeOutRules: [v => !!v || "time Out s is required"], | |
686 | - roomRules: [v => !!v || "Room is required"], | |
687 | - examScheduleDateRules: [v => !!v || "Date is required"], | |
690 | + examRules: [(v) => !!v || "Exam Name is required"], | |
691 | + classRules: [(v) => !!v || "Class Name is required"], | |
692 | + sectionRules: [(v) => !!v || "section is required"], | |
693 | + subjectRules: [(v) => !!v || "Subject is required"], | |
694 | + timeInRules: [(v) => !!v || "Time In is required"], | |
695 | + timeOutRules: [(v) => !!v || "time Out s is required"], | |
696 | + roomRules: [(v) => !!v || "Room is required"], | |
697 | + examScheduleDateRules: [(v) => !!v || "Date is required"], | |
688 | 698 | headers: [ |
689 | 699 | { |
690 | 700 | align: "", |
691 | 701 | text: "No", |
692 | 702 | sortable: false, |
693 | - value: "No" | |
703 | + value: "No", | |
694 | 704 | }, |
695 | 705 | { |
696 | 706 | text: "Exam Name", |
697 | 707 | vaue: "examId.examName", |
698 | 708 | sortable: false, |
699 | - align: "center" | |
709 | + align: "center", | |
700 | 710 | }, |
701 | 711 | { |
702 | 712 | text: "Class", |
703 | 713 | value: "classId.classNum", |
704 | 714 | sortable: false, |
705 | - align: "center" | |
715 | + align: "center", | |
706 | 716 | }, |
707 | 717 | // { |
708 | 718 | // text: "Section", |
... | ... | @@ -714,27 +724,27 @@ export default { |
714 | 724 | text: "Subject Name", |
715 | 725 | value: "subjectName", |
716 | 726 | sortable: false, |
717 | - align: "center" | |
727 | + align: "center", | |
718 | 728 | }, |
719 | 729 | { |
720 | 730 | text: "Date", |
721 | 731 | value: "date", |
722 | 732 | sortable: false, |
723 | - align: "center" | |
733 | + align: "center", | |
724 | 734 | }, |
725 | 735 | { |
726 | 736 | text: "Time", |
727 | 737 | value: "timeFrom", |
728 | 738 | sortable: false, |
729 | - align: "center" | |
739 | + align: "center", | |
730 | 740 | }, |
731 | 741 | { |
732 | 742 | text: "Room", |
733 | 743 | value: "room", |
734 | 744 | sortable: false, |
735 | - align: "center" | |
745 | + align: "center", | |
736 | 746 | }, |
737 | - { text: "Action", value: "", sortable: false, align: "center" } | |
747 | + { text: "Action", value: "", sortable: false, align: "center" }, | |
738 | 748 | ], |
739 | 749 | classList: [], |
740 | 750 | addSection: [], |
... | ... | @@ -743,15 +753,22 @@ export default { |
743 | 753 | addSchedule: {}, |
744 | 754 | editedItem: { |
745 | 755 | sectionId: { |
746 | - name: "" | |
747 | - } | |
756 | + name: "", | |
757 | + }, | |
748 | 758 | }, |
749 | 759 | getScheduleData: {}, |
750 | 760 | ScheduleData: [], |
751 | - token: "" | |
761 | + token: "", | |
752 | 762 | }), |
763 | + watch: { | |
764 | + addExamScheduleDialog: function (val) { | |
765 | + if (!val) { | |
766 | + this.addSchedule = []; | |
767 | + } | |
768 | + }, | |
769 | + }, | |
753 | 770 | methods: { |
754 | - dates: function(date) { | |
771 | + dates: function (date) { | |
755 | 772 | return moment(date).format("MMMM DD, YYYY"); |
756 | 773 | }, |
757 | 774 | pickFile() { |
... | ... | @@ -766,16 +783,16 @@ export default { |
766 | 783 | .get("/getSchedulesList", { |
767 | 784 | params: { |
768 | 785 | classId: this.getScheduleData.classId, |
769 | - sectionId: this.getScheduleData.sectionId | |
786 | + sectionId: this.getScheduleData.sectionId, | |
770 | 787 | }, |
771 | - headers: { Authorization: "Bearer " + this.token } | |
788 | + headers: { Authorization: "Bearer " + this.token }, | |
772 | 789 | }) |
773 | - .then(response => { | |
790 | + .then((response) => { | |
774 | 791 | this.ScheduleData = response.data.data; |
775 | 792 | // console.log("this.ScheduleData", this.ScheduleData); |
776 | 793 | this.showLoader = false; |
777 | 794 | }) |
778 | - .catch(error => { | |
795 | + .catch((error) => { | |
779 | 796 | // console.log("err====>", err); |
780 | 797 | this.showLoader = false; |
781 | 798 | this.loadingSearch = false; |
... | ... | @@ -818,22 +835,22 @@ export default { |
818 | 835 | }, |
819 | 836 | deleteSchedule(item) { |
820 | 837 | let deleteSchedule = { |
821 | - scheduleId: item._id | |
838 | + scheduleId: item._id, | |
822 | 839 | }; |
823 | 840 | http() |
824 | 841 | .delete( |
825 | 842 | "/deleteSchedule", |
826 | 843 | confirm("Are you sure you want to Delete this?") && { |
827 | - params: deleteSchedule | |
844 | + params: deleteSchedule, | |
828 | 845 | } |
829 | 846 | ) |
830 | - .then(response => { | |
847 | + .then((response) => { | |
831 | 848 | this.snackbar = true; |
832 | 849 | this.text = response.data.message; |
833 | 850 | this.color = "green"; |
834 | 851 | this.getSchedulesList(); |
835 | 852 | }) |
836 | - .catch(error => { | |
853 | + .catch((error) => { | |
837 | 854 | this.snackbar = true; |
838 | 855 | this.color = "error"; |
839 | 856 | this.text = error.response.data.message; |
... | ... | @@ -847,7 +864,7 @@ export default { |
847 | 864 | this.loading = true; |
848 | 865 | http() |
849 | 866 | .post("/createSchedule", this.addSchedule) |
850 | - .then(response => { | |
867 | + .then((response) => { | |
851 | 868 | this.loading = false; |
852 | 869 | this.snackbar = true; |
853 | 870 | this.text = response.data.message; |
... | ... | @@ -856,7 +873,7 @@ export default { |
856 | 873 | this.getSchedulesList(); |
857 | 874 | this.clear(); |
858 | 875 | }) |
859 | - .catch(error => { | |
876 | + .catch((error) => { | |
860 | 877 | this.snackbar = true; |
861 | 878 | this.text = error.response.data.message; |
862 | 879 | this.color = "red"; |
... | ... | @@ -873,7 +890,7 @@ export default { |
873 | 890 | this.editedItem.scheduleId = this.editedItem._id; |
874 | 891 | http() |
875 | 892 | .put("/updateSchedule", this.editedItem) |
876 | - .then(response => { | |
893 | + .then((response) => { | |
877 | 894 | this.snackbar = true; |
878 | 895 | this.text = "Successfully Edit Exam Schedule"; |
879 | 896 | this.color = "green"; |
... | ... | @@ -881,7 +898,7 @@ export default { |
881 | 898 | this.getSchedulesList(); |
882 | 899 | this.close(); |
883 | 900 | }) |
884 | - .catch(error => { | |
901 | + .catch((error) => { | |
885 | 902 | this.snackbar = true; |
886 | 903 | this.text = error.response.data.messages; |
887 | 904 | this.color = "error"; |
... | ... | @@ -891,12 +908,12 @@ export default { |
891 | 908 | getClass() { |
892 | 909 | http() |
893 | 910 | .get("/getClassesList", { |
894 | - headers: { Authorization: "Bearer " + this.token } | |
911 | + headers: { Authorization: "Bearer " + this.token }, | |
895 | 912 | }) |
896 | - .then(response => { | |
913 | + .then((response) => { | |
897 | 914 | this.classList = response.data.data; |
898 | 915 | }) |
899 | - .catch(err => { | |
916 | + .catch((err) => { | |
900 | 917 | // console.log("err====>", err); |
901 | 918 | }); |
902 | 919 | }, |
... | ... | @@ -911,27 +928,27 @@ export default { |
911 | 928 | "/getSectionsList", |
912 | 929 | { params: { classId: _id } }, |
913 | 930 | { |
914 | - headers: { Authorization: "Bearer " + this.token } | |
931 | + headers: { Authorization: "Bearer " + this.token }, | |
915 | 932 | } |
916 | 933 | ) |
917 | - .then(response => { | |
934 | + .then((response) => { | |
918 | 935 | this.addSection = response.data.data; |
919 | 936 | }) |
920 | - .catch(err => {}); | |
937 | + .catch((err) => {}); | |
921 | 938 | }, |
922 | 939 | getExamList() { |
923 | 940 | this.showLoader = true; |
924 | 941 | this.loadingSearch = true; |
925 | 942 | http() |
926 | 943 | .get("/getExamsList", { |
927 | - headers: { Authorization: "Bearer " + this.token } | |
944 | + headers: { Authorization: "Bearer " + this.token }, | |
928 | 945 | }) |
929 | - .then(response => { | |
946 | + .then((response) => { | |
930 | 947 | this.examList = response.data.data; |
931 | 948 | this.showLoader = false; |
932 | 949 | this.loadingSearch = false; |
933 | 950 | }) |
934 | - .catch(error => { | |
951 | + .catch((error) => { | |
935 | 952 | this.showLoader = false; |
936 | 953 | this.loadingSearch = false; |
937 | 954 | this.snackbar = true; |
... | ... | @@ -950,13 +967,13 @@ export default { |
950 | 967 | this.showSearch = false; |
951 | 968 | this.show = true; |
952 | 969 | this.search = ""; |
953 | - } | |
970 | + }, | |
954 | 971 | }, |
955 | 972 | mounted() { |
956 | 973 | this.token = this.$store.state.token; |
957 | 974 | this.getClass(); |
958 | 975 | this.getExamList(); |
959 | 976 | this.role = this.$store.state.role; |
960 | - } | |
977 | + }, | |
961 | 978 | }; |
962 | 979 | </script> |
963 | 980 | \ No newline at end of file | ... | ... |
src/pages/Exam/grade.vue
... | ... | @@ -200,7 +200,13 @@ |
200 | 200 | </v-card-title> |
201 | 201 | <v-flex xs8 sm8 md3 lg2 v-if="showSearch"> |
202 | 202 | <v-layout> |
203 | - <v-text-field autofocus v-model="search" label="Search" prepend-inner-icon="search" color="primary"></v-text-field> | |
203 | + <v-text-field | |
204 | + autofocus | |
205 | + v-model="search" | |
206 | + label="Search" | |
207 | + prepend-inner-icon="search" | |
208 | + color="primary" | |
209 | + ></v-text-field> | |
204 | 210 | <v-icon @click="closeSearch" color="error">close</v-icon> |
205 | 211 | </v-layout> |
206 | 212 | </v-flex> |
... | ... | @@ -263,12 +269,16 @@ |
263 | 269 | >Your search for "{{ search }}" found no results.</v-alert> |
264 | 270 | </v-data-table> |
265 | 271 | <!-- ****** ADD GRADE ****** --> |
266 | - <v-dialog v-model="addGradeDialog" max-width="500px"> | |
272 | + <v-dialog v-model="addGradeDialog" max-width="500px" v-if="addGradeDialog"> | |
267 | 273 | <v-card flat class="card-style pa-2" dark> |
268 | 274 | <v-layout> |
269 | 275 | <v-flex xs12> |
270 | 276 | <label class="title text-xs-center">Add Grade</label> |
271 | - <v-icon size="24" class="right" @click="$refs.form.reset();addGradeDialog = false">cancel</v-icon> | |
277 | + <v-icon | |
278 | + size="24" | |
279 | + class="right" | |
280 | + @click="$refs.form.reset();addGradeDialog = false" | |
281 | + >cancel</v-icon> | |
272 | 282 | </v-flex> |
273 | 283 | </v-layout> |
274 | 284 | <v-form ref="form" v-model="valid" lazy-validation> |
... | ... | @@ -402,65 +412,72 @@ export default { |
402 | 412 | valid: true, |
403 | 413 | validEditGrade: true, |
404 | 414 | pagination: { |
405 | - rowsPerPage: 10 | |
415 | + rowsPerPage: 10, | |
406 | 416 | }, |
407 | - gradeNameRules: [v => !!v || "Grade Name is required"], | |
408 | - gradePointRules: [v => !!v || "Grade Point required"], | |
409 | - markFromRules: [v => !!v || "Mark From is required"], | |
410 | - markUptoRules: [v => !!v || "Mark Upto is required"], | |
411 | - authorRules: [v => !!v || "Author is required"], | |
412 | - noteRules: [v => !!v || "Note is required"], | |
413 | - editGradeName: [v => !!v || "Grade Name is required"], | |
414 | - editGradeName: [v => !!v || "Grade Name is required"], | |
415 | - editGradePoint: [v => !!v || "Grade Point required"], | |
416 | - editMarksFrom: [v => !!v || "Mark From is required"], | |
417 | - editMarksUpTo: [v => !!v || "Mark Upto is required"], | |
417 | + gradeNameRules: [(v) => !!v || "Grade Name is required"], | |
418 | + gradePointRules: [(v) => !!v || "Grade Point required"], | |
419 | + markFromRules: [(v) => !!v || "Mark From is required"], | |
420 | + markUptoRules: [(v) => !!v || "Mark Upto is required"], | |
421 | + authorRules: [(v) => !!v || "Author is required"], | |
422 | + noteRules: [(v) => !!v || "Note is required"], | |
423 | + editGradeName: [(v) => !!v || "Grade Name is required"], | |
424 | + editGradeName: [(v) => !!v || "Grade Name is required"], | |
425 | + editGradePoint: [(v) => !!v || "Grade Point required"], | |
426 | + editMarksFrom: [(v) => !!v || "Mark From is required"], | |
427 | + editMarksUpTo: [(v) => !!v || "Mark Upto is required"], | |
418 | 428 | headers: [ |
419 | 429 | { |
420 | 430 | align: "", |
421 | 431 | text: "No", |
422 | 432 | sortable: false, |
423 | - value: "No" | |
433 | + value: "No", | |
424 | 434 | }, |
425 | 435 | { |
426 | 436 | text: "Grade Name", |
427 | 437 | vaue: "gradeName", |
428 | 438 | sortable: false, |
429 | - align: "center" | |
439 | + align: "center", | |
430 | 440 | }, |
431 | 441 | { |
432 | 442 | text: "Grade Point", |
433 | 443 | value: "gradePoint", |
434 | 444 | sortable: false, |
435 | - align: "center" | |
445 | + align: "center", | |
436 | 446 | }, |
437 | 447 | { |
438 | 448 | text: "Mark From", |
439 | 449 | value: "marksFrom", |
440 | 450 | sortable: false, |
441 | - align: "center" | |
451 | + align: "center", | |
442 | 452 | }, |
443 | 453 | { |
444 | 454 | text: "Mark Upto", |
445 | 455 | value: "marksUpTo", |
446 | 456 | sortable: false, |
447 | - align: "center" | |
457 | + align: "center", | |
448 | 458 | }, |
449 | 459 | { |
450 | 460 | text: "Note", |
451 | 461 | value: "note", |
452 | 462 | sortable: false, |
453 | - align: "center" | |
463 | + align: "center", | |
454 | 464 | }, |
455 | - { text: "Action", value: "", sortable: false, align: "center" } | |
465 | + { text: "Action", value: "", sortable: false, align: "center" }, | |
456 | 466 | ], |
457 | 467 | gradeData: [], |
458 | 468 | addGrade: {}, |
459 | 469 | editedItem: {}, |
460 | - token: "" | |
470 | + token: "", | |
461 | 471 | }), |
472 | + watch: { | |
473 | + addGradeDialog: function (val) { | |
474 | + if (!val) { | |
475 | + this.addGrade = []; | |
476 | + } | |
477 | + }, | |
478 | + }, | |
462 | 479 | methods: { |
463 | - dates: function(date) { | |
480 | + dates: function (date) { | |
464 | 481 | return moment(date).format("MMMM DD, YYYY"); |
465 | 482 | }, |
466 | 483 | pickFile() { |
... | ... | @@ -471,14 +488,14 @@ export default { |
471 | 488 | this.loadingSearch = true; |
472 | 489 | http() |
473 | 490 | .get("/getGradesList", { |
474 | - headers: { Authorization: "Bearer " + this.token } | |
491 | + headers: { Authorization: "Bearer " + this.token }, | |
475 | 492 | }) |
476 | - .then(response => { | |
493 | + .then((response) => { | |
477 | 494 | this.gradeData = response.data.data; |
478 | 495 | this.showLoader = false; |
479 | 496 | this.loadingSearch = false; |
480 | 497 | }) |
481 | - .catch(error => { | |
498 | + .catch((error) => { | |
482 | 499 | // console.log("err====>", err); |
483 | 500 | this.showLoader = false; |
484 | 501 | this.loadingSearch = false; |
... | ... | @@ -508,22 +525,22 @@ export default { |
508 | 525 | }, |
509 | 526 | deleteGrade(item) { |
510 | 527 | let deleteGrade = { |
511 | - gradeId: item._id | |
528 | + gradeId: item._id, | |
512 | 529 | }; |
513 | 530 | http() |
514 | 531 | .delete( |
515 | 532 | "/deleteGrade", |
516 | 533 | confirm("Are you sure you want to Delete this?") && { |
517 | - params: deleteGrade | |
534 | + params: deleteGrade, | |
518 | 535 | } |
519 | 536 | ) |
520 | - .then(response => { | |
537 | + .then((response) => { | |
521 | 538 | this.snackbar = true; |
522 | 539 | this.text = response.data.message; |
523 | 540 | this.color = "green"; |
524 | 541 | this.getGradeList(); |
525 | 542 | }) |
526 | - .catch(error => { | |
543 | + .catch((error) => { | |
527 | 544 | this.loading = false; |
528 | 545 | this.snackbar = true; |
529 | 546 | this.color = "error"; |
... | ... | @@ -538,7 +555,7 @@ export default { |
538 | 555 | this.loading = true; |
539 | 556 | http() |
540 | 557 | .post("/createGrade", this.addGrade) |
541 | - .then(response => { | |
558 | + .then((response) => { | |
542 | 559 | this.snackbar = true; |
543 | 560 | this.text = response.data.message; |
544 | 561 | this.color = "green"; |
... | ... | @@ -547,7 +564,7 @@ export default { |
547 | 564 | this.clear(); |
548 | 565 | this.getGradeList(); |
549 | 566 | }) |
550 | - .catch(error => { | |
567 | + .catch((error) => { | |
551 | 568 | this.snackbar = true; |
552 | 569 | this.text = error.response.data.message; |
553 | 570 | this.color = "red"; |
... | ... | @@ -565,14 +582,14 @@ export default { |
565 | 582 | this.editedItem.gradeId = this.editedItem._id; |
566 | 583 | http() |
567 | 584 | .put("/updateGrade", this.editedItem) |
568 | - .then(response => { | |
585 | + .then((response) => { | |
569 | 586 | this.snackbar = true; |
570 | 587 | this.text = response.data.message; |
571 | 588 | this.color = "green"; |
572 | 589 | this.getGradeList(); |
573 | 590 | this.close(); |
574 | 591 | }) |
575 | - .catch(error => { | |
592 | + .catch((error) => { | |
576 | 593 | this.snackbar = true; |
577 | 594 | this.text = error.response.data.message; |
578 | 595 | this.color = "red"; |
... | ... | @@ -586,11 +603,11 @@ export default { |
586 | 603 | this.showSearch = false; |
587 | 604 | this.show = true; |
588 | 605 | this.search = ""; |
589 | - } | |
606 | + }, | |
590 | 607 | }, |
591 | 608 | mounted() { |
592 | 609 | this.token = this.$store.state.token; |
593 | 610 | this.getGradeList(); |
594 | - } | |
611 | + }, | |
595 | 612 | }; |
596 | 613 | </script> |
597 | 614 | \ No newline at end of file | ... | ... |
src/pages/Gallery/gallery.vue
... | ... | @@ -292,7 +292,13 @@ |
292 | 292 | </v-card-title> |
293 | 293 | <v-flex xs8 sm8 md3 lg2 v-if="showSearch"> |
294 | 294 | <v-layout> |
295 | - <v-text-field autofocus v-model="search" label="Search" prepend-inner-icon="search" color="primary"></v-text-field> | |
295 | + <v-text-field | |
296 | + autofocus | |
297 | + v-model="search" | |
298 | + label="Search" | |
299 | + prepend-inner-icon="search" | |
300 | + color="primary" | |
301 | + ></v-text-field> | |
296 | 302 | <v-icon @click="closeSearch" color="error">close</v-icon> |
297 | 303 | </v-layout> |
298 | 304 | </v-flex> |
... | ... | @@ -352,12 +358,12 @@ |
352 | 358 | >Your search for "{{ search }}" found no results.</v-alert> |
353 | 359 | </v-data-table> |
354 | 360 | <!-- ****** ADD Gallery ****** --> |
355 | - <v-dialog v-model="addGalleryDialog" max-width="600px"> | |
361 | + <v-dialog v-model="addGalleryDialog" max-width="600px" v-if="addGalleryDialog"> | |
356 | 362 | <v-card flat class="card-style pa-2" dark> |
357 | 363 | <v-layout> |
358 | 364 | <v-flex xs12> |
359 | 365 | <label class="title text-xs-center">Add Gallery</label> |
360 | - <v-icon size="24" class="right" @click="addGalleryDialog = false">cancel</v-icon> | |
366 | + <v-icon size="24" class="right" @click="closeAddGalleryModel">cancel</v-icon> | |
361 | 367 | </v-flex> |
362 | 368 | </v-layout> |
363 | 369 | <v-form ref="form" v-model="valid" lazy-validation> |
... | ... | @@ -529,10 +535,10 @@ export default { |
529 | 535 | updates: [{ youTubeLink: "" }], |
530 | 536 | youTubeLink: {}, |
531 | 537 | addGallery: { |
532 | - youTubeLinkUrl: [] | |
538 | + youTubeLinkUrl: [], | |
533 | 539 | }, |
534 | 540 | pagination: { |
535 | - rowsPerPage: 10 | |
541 | + rowsPerPage: 10, | |
536 | 542 | }, |
537 | 543 | imageName: "", |
538 | 544 | imageUrl: "", |
... | ... | @@ -543,29 +549,41 @@ export default { |
543 | 549 | editFiles: [], |
544 | 550 | files: [], |
545 | 551 | token: "", |
546 | - titleRules: [v => !!v || " Tilte is required"], | |
547 | - descriptionRules: [v => !!v || " Description is required"], | |
552 | + titleRules: [(v) => !!v || " Tilte is required"], | |
553 | + descriptionRules: [(v) => !!v || " Description is required"], | |
548 | 554 | headers: [ |
549 | 555 | { |
550 | 556 | align: "", |
551 | 557 | text: "No", |
552 | 558 | sortable: false, |
553 | - value: "index" | |
559 | + value: "index", | |
554 | 560 | }, |
555 | 561 | { text: "Title", value: "title", sortable: false, align: "center" }, |
556 | 562 | { |
557 | 563 | text: "Description", |
558 | 564 | value: "description", |
559 | 565 | sortable: false, |
560 | - align: "center" | |
566 | + align: "center", | |
561 | 567 | }, |
562 | - { text: "Action", value: "", sortable: false, align: "center" } | |
568 | + { text: "Action", value: "", sortable: false, align: "center" }, | |
563 | 569 | ], |
564 | 570 | desserts: [], |
565 | 571 | editedIndex: -1, |
566 | 572 | editedItem: {}, |
567 | - index: "" | |
573 | + index: "", | |
568 | 574 | }), |
575 | + watch: { | |
576 | + addGalleryDialog: function (val) { | |
577 | + if (!val) { | |
578 | + this.addGallery = []; | |
579 | + this.imageName = ""; | |
580 | + this.youTubeLinkUrl = []; | |
581 | + this.youTubeLink = {}; | |
582 | + this.index = ""; | |
583 | + this.files = []; | |
584 | + } | |
585 | + }, | |
586 | + }, | |
569 | 587 | methods: { |
570 | 588 | pickFile() { |
571 | 589 | this.$refs.image.click(); |
... | ... | @@ -586,8 +604,8 @@ export default { |
586 | 604 | /** Select many image and showing many image add to Gallery card **/ |
587 | 605 | const test = Array.from(files).forEach((file, idx) => { |
588 | 606 | const fr = new FileReader(); |
589 | - const getResult = new Promise(resolve => { | |
590 | - fr.onload = e => { | |
607 | + const getResult = new Promise((resolve) => { | |
608 | + fr.onload = (e) => { | |
591 | 609 | this.files.push( |
592 | 610 | // id: idx, |
593 | 611 | e.target.result |
... | ... | @@ -596,7 +614,7 @@ export default { |
596 | 614 | console.log("uploadImage=======>", this.files); |
597 | 615 | }); |
598 | 616 | fr.readAsDataURL(file); |
599 | - return getResult.then(file => { | |
617 | + return getResult.then((file) => { | |
600 | 618 | return file; |
601 | 619 | }); |
602 | 620 | }); |
... | ... | @@ -622,8 +640,8 @@ export default { |
622 | 640 | /** Select many image and showing many image add to Gallery card **/ |
623 | 641 | const test = Array.from(files).forEach((file, idx) => { |
624 | 642 | const fr = new FileReader(); |
625 | - const getResult = new Promise(resolve => { | |
626 | - fr.onload = e => { | |
643 | + const getResult = new Promise((resolve) => { | |
644 | + fr.onload = (e) => { | |
627 | 645 | this.editFiles.push( |
628 | 646 | // id: idx, |
629 | 647 | e.target.result |
... | ... | @@ -632,7 +650,7 @@ export default { |
632 | 650 | console.log("uploadeditFilesImage=======>", this.editFiles); |
633 | 651 | }); |
634 | 652 | fr.readAsDataURL(file); |
635 | - return getResult.then(file => { | |
653 | + return getResult.then((file) => { | |
636 | 654 | return file; |
637 | 655 | }); |
638 | 656 | }); |
... | ... | @@ -650,13 +668,13 @@ export default { |
650 | 668 | this.showLoader = true; |
651 | 669 | http() |
652 | 670 | .get("/getGalleryList", { |
653 | - headers: { Authorization: "Bearer " + this.token } | |
671 | + headers: { Authorization: "Bearer " + this.token }, | |
654 | 672 | }) |
655 | - .then(response => { | |
673 | + .then((response) => { | |
656 | 674 | this.desserts = response.data.data; |
657 | 675 | this.showLoader = false; |
658 | 676 | }) |
659 | - .catch(error => { | |
677 | + .catch((error) => { | |
660 | 678 | // console.log("err====>", err); |
661 | 679 | this.showLoader = false; |
662 | 680 | if (error.response.status === 401) { |
... | ... | @@ -679,7 +697,7 @@ export default { |
679 | 697 | }, |
680 | 698 | deleteItem(item) { |
681 | 699 | let deleteGallery = { |
682 | - galleryId: item._id | |
700 | + galleryId: item._id, | |
683 | 701 | }; |
684 | 702 | http() |
685 | 703 | .delete( |
... | ... | @@ -687,17 +705,17 @@ export default { |
687 | 705 | confirm("Are you sure you want to delete this?") && { |
688 | 706 | params: deleteGallery, |
689 | 707 | headers: { |
690 | - Authorization: "Bearer " + this.token | |
691 | - } | |
708 | + Authorization: "Bearer " + this.token, | |
709 | + }, | |
692 | 710 | } |
693 | 711 | ) |
694 | - .then(response => { | |
712 | + .then((response) => { | |
695 | 713 | this.snackbar = true; |
696 | 714 | this.text = "Successfully delete Existing Gallery"; |
697 | 715 | this.color = "green"; |
698 | 716 | this.getGalleryList(); |
699 | 717 | }) |
700 | - .catch(error => { | |
718 | + .catch((error) => { | |
701 | 719 | // console.log(error); |
702 | 720 | this.snackbar = true; |
703 | 721 | this.text = error.response.data.message; |
... | ... | @@ -707,18 +725,18 @@ export default { |
707 | 725 | deleteImage(imageId, id) { |
708 | 726 | let deleteImages = { |
709 | 727 | galleryId: id, |
710 | - imageId: imageId | |
728 | + imageId: imageId, | |
711 | 729 | }; |
712 | 730 | http() |
713 | 731 | .put("/deleteImage", deleteImages) |
714 | - .then(response => { | |
732 | + .then((response) => { | |
715 | 733 | this.snackbar = true; |
716 | 734 | this.text = response.data.message; |
717 | 735 | this.color = "green"; |
718 | 736 | this.getGalleryList(); |
719 | 737 | this.close(); |
720 | 738 | }) |
721 | - .catch(error => { | |
739 | + .catch((error) => { | |
722 | 740 | this.snackbar = true; |
723 | 741 | this.text = error.response.data.message; |
724 | 742 | this.color = "error"; |
... | ... | @@ -730,6 +748,15 @@ export default { |
730 | 748 | closeProfileGallery() { |
731 | 749 | this.viewProfileGallery = false; |
732 | 750 | }, |
751 | + closeAddGalleryModel() { | |
752 | + this.addGalleryDialog = false; | |
753 | + this.addGallery = []; | |
754 | + this.imageName = ""; | |
755 | + this.youTubeLinkUrl = []; | |
756 | + this.youTubeLink = {}; | |
757 | + this.index = ""; | |
758 | + this.files = []; | |
759 | + }, | |
733 | 760 | submit() { |
734 | 761 | for (let i = 0; i < this.finds.length; i++) { |
735 | 762 | this.addGallery.youTubeLinkUrl.push(this.finds[i].value); |
... | ... | @@ -750,12 +777,12 @@ export default { |
750 | 777 | classId: this.addGallery.classNum, |
751 | 778 | title: this.addGallery.title, |
752 | 779 | description: this.addGallery.description, |
753 | - upload: this.addGallery.upload | |
780 | + upload: this.addGallery.upload, | |
754 | 781 | }; |
755 | 782 | this.loading = true; |
756 | 783 | http() |
757 | 784 | .post("/createGallery", galleryData) |
758 | - .then(response => { | |
785 | + .then((response) => { | |
759 | 786 | this.getGalleryList(); |
760 | 787 | this.addGalleryDialog = false; |
761 | 788 | this.loading = false; |
... | ... | @@ -765,7 +792,7 @@ export default { |
765 | 792 | this.clear(); |
766 | 793 | this.files = ""; |
767 | 794 | }) |
768 | - .catch(error => { | |
795 | + .catch((error) => { | |
769 | 796 | this.snackbar = true; |
770 | 797 | this.text = error.response.data.message; |
771 | 798 | this.color = "error"; |
... | ... | @@ -775,7 +802,7 @@ export default { |
775 | 802 | this.loading = true; |
776 | 803 | http() |
777 | 804 | .post("/createGallery", this.addGallery) |
778 | - .then(response => { | |
805 | + .then((response) => { | |
779 | 806 | this.getGalleryList(); |
780 | 807 | this.addGalleryDialog = false; |
781 | 808 | this.files = "nmn"; |
... | ... | @@ -787,7 +814,7 @@ export default { |
787 | 814 | this.removeAddFind(); |
788 | 815 | this.files = ""; |
789 | 816 | }) |
790 | - .catch(error => { | |
817 | + .catch((error) => { | |
791 | 818 | this.snackbar = true; |
792 | 819 | this.text = error.response.data.message; |
793 | 820 | this.loading = false; |
... | ... | @@ -823,7 +850,7 @@ export default { |
823 | 850 | classId: this.editedItem.classNum, |
824 | 851 | uploadImage: this.editedItem.editFiles, |
825 | 852 | title: this.editedItem.title, |
826 | - updateYouTubeLinkUrl: linkUrl | |
853 | + updateYouTubeLinkUrl: linkUrl, | |
827 | 854 | }; |
828 | 855 | } else if (linkUrl == "") { |
829 | 856 | var updateData = { |
... | ... | @@ -831,13 +858,13 @@ export default { |
831 | 858 | description: this.editedItem.description, |
832 | 859 | classId: this.editedItem.classNum, |
833 | 860 | uploadImage: this.editedItem.editFiles, |
834 | - title: this.editedItem.title | |
861 | + title: this.editedItem.title, | |
835 | 862 | }; |
836 | 863 | } |
837 | 864 | this.editGalleryLoading = true; |
838 | 865 | http() |
839 | 866 | .put("/updateGallery", updateData) |
840 | - .then(response => { | |
867 | + .then((response) => { | |
841 | 868 | this.getGalleryList(); |
842 | 869 | this.close(); |
843 | 870 | this.snackbar = true; |
... | ... | @@ -847,7 +874,7 @@ export default { |
847 | 874 | this.editImageName = ""; |
848 | 875 | this.editFiles = []; |
849 | 876 | }) |
850 | - .catch(error => { | |
877 | + .catch((error) => { | |
851 | 878 | this.editGalleryLoading = false; |
852 | 879 | this.snackbar = true; |
853 | 880 | this.text = error.response.data.message; |
... | ... | @@ -857,49 +884,49 @@ export default { |
857 | 884 | getAllClasses() { |
858 | 885 | http() |
859 | 886 | .get("/getClassesList", { |
860 | - headers: { Authorization: "Bearer " + this.token } | |
887 | + headers: { Authorization: "Bearer " + this.token }, | |
861 | 888 | }) |
862 | - .then(response => { | |
889 | + .then((response) => { | |
863 | 890 | this.addclass = response.data.data; |
864 | 891 | }) |
865 | - .catch(err => { | |
892 | + .catch((err) => { | |
866 | 893 | // console.log("err====>", err); |
867 | 894 | }); |
868 | 895 | }, |
869 | - removeAddFind: function() { | |
896 | + removeAddFind: function () { | |
870 | 897 | this.finds = [{ value: "" }]; |
871 | 898 | }, |
872 | - addFind: function() { | |
899 | + addFind: function () { | |
873 | 900 | this.finds.push({ value: "" }); |
874 | 901 | }, |
875 | - update: function() { | |
902 | + update: function () { | |
876 | 903 | this.updates.push({ youTubeLink: "" }); |
877 | 904 | }, |
878 | - deleteFind: function(index) { | |
905 | + deleteFind: function (index) { | |
879 | 906 | this.finds.splice(index, 1); |
880 | 907 | if (index === 0) this.addFind(); |
881 | 908 | }, |
882 | - deleteUpdate: function(index) { | |
909 | + deleteUpdate: function (index) { | |
883 | 910 | this.updates.splice(index, 1); |
884 | 911 | if (index === 0) this.update(); |
885 | 912 | }, |
886 | - deleteUrl: function(index, youTubelinkId, id) { | |
913 | + deleteUrl: function (index, youTubelinkId, id) { | |
887 | 914 | this.editedItem.youTubeLinkUrl.splice(index, 1); |
888 | 915 | if (index === 0) this.update(); |
889 | 916 | let deleteYouTubeUrl = { |
890 | 917 | galleryId: id, |
891 | - youTubeId: youTubelinkId | |
918 | + youTubeId: youTubelinkId, | |
892 | 919 | }; |
893 | 920 | http() |
894 | 921 | .put("/deleteYoutubeLink", deleteYouTubeUrl) |
895 | - .then(response => { | |
922 | + .then((response) => { | |
896 | 923 | this.snackbar = true; |
897 | 924 | this.text = response.data.message; |
898 | 925 | this.color = "green"; |
899 | 926 | this.getGalleryList(); |
900 | 927 | this.close(); |
901 | 928 | }) |
902 | - .catch(error => { | |
929 | + .catch((error) => { | |
903 | 930 | this.snackbar = true; |
904 | 931 | this.text = error.response.data.message; |
905 | 932 | this.color = "error"; |
... | ... | @@ -913,12 +940,12 @@ export default { |
913 | 940 | this.showSearch = false; |
914 | 941 | this.show = true; |
915 | 942 | this.search = ""; |
916 | - } | |
943 | + }, | |
917 | 944 | }, |
918 | 945 | mounted() { |
919 | 946 | this.token = this.$store.state.token; |
920 | 947 | this.getAllClasses(); |
921 | 948 | this.getGalleryList(); |
922 | - } | |
949 | + }, | |
923 | 950 | }; |
924 | 951 | </script> |
925 | 952 | \ No newline at end of file | ... | ... |
src/pages/Holiday/holiday.vue
... | ... | @@ -146,7 +146,13 @@ |
146 | 146 | </v-card-title> |
147 | 147 | <v-flex xs8 sm8 md3 lg2 v-if="showSearch"> |
148 | 148 | <v-layout> |
149 | - <v-text-field autofocus v-model="search" label="Search" prepend-inner-icon="search" color="primary"></v-text-field> | |
149 | + <v-text-field | |
150 | + autofocus | |
151 | + v-model="search" | |
152 | + label="Search" | |
153 | + prepend-inner-icon="search" | |
154 | + color="primary" | |
155 | + ></v-text-field> | |
150 | 156 | <v-icon @click="closeSearch" color="error">close</v-icon> |
151 | 157 | </v-layout> |
152 | 158 | </v-flex> |
... | ... | @@ -206,12 +212,12 @@ |
206 | 212 | >Your search for "{{ search }}" found no results.</v-alert> |
207 | 213 | </v-data-table> |
208 | 214 | <!-- ****** ADD MULTIPLE Holiday ****** --> |
209 | - <v-dialog v-model="addHolidayDialog" max-width="400px"> | |
215 | + <v-dialog v-model="addHolidayDialog" max-width="400px" v-if="addHolidayDialog"> | |
210 | 216 | <v-card flat class="card-style pa-3" dark> |
211 | 217 | <v-layout> |
212 | 218 | <v-flex xs12> |
213 | 219 | <label class="title text-xs-center">Add Holiday</label> |
214 | - <v-icon size="24" class="right" @click="addHolidayDialog = false">cancel</v-icon> | |
220 | + <v-icon size="24" class="right" @click="closeaddHolidayDialog">cancel</v-icon> | |
215 | 221 | </v-flex> |
216 | 222 | </v-layout> |
217 | 223 | <v-form ref="form" v-model="valid" lazy-validation> |
... | ... | @@ -317,36 +323,44 @@ export default { |
317 | 323 | viewHolidayDialog: false, |
318 | 324 | valid: true, |
319 | 325 | pagination: { |
320 | - rowsPerPage: 10 | |
326 | + rowsPerPage: 10, | |
321 | 327 | }, |
322 | 328 | date: null, |
323 | 329 | menu1: false, |
324 | 330 | menu: false, |
325 | - occasionRules: [v => !!v || "Occasion is required"], | |
326 | - dateRules: [v => !!v || "Date is required"], | |
331 | + occasionRules: [(v) => !!v || "Occasion is required"], | |
332 | + dateRules: [(v) => !!v || "Date is required"], | |
327 | 333 | headers: [ |
328 | 334 | { |
329 | 335 | text: "No", |
330 | 336 | align: "", |
331 | 337 | sortable: false, |
332 | - value: "No" | |
338 | + value: "No", | |
333 | 339 | }, |
334 | 340 | { text: "Occasion", value: "occasion", sortable: false, align: "center" }, |
335 | 341 | { |
336 | 342 | text: "Date Of Holiday", |
337 | 343 | value: "dateOfHoliday", |
338 | 344 | sortable: false, |
339 | - align: "center" | |
345 | + align: "center", | |
340 | 346 | }, |
341 | - { text: "Action", value: "", sortable: false, align: "center" } | |
347 | + { text: "Action", value: "", sortable: false, align: "center" }, | |
342 | 348 | ], |
343 | 349 | holidays: [], |
344 | 350 | editedIndex: -1, |
345 | 351 | addHoliday: {}, |
346 | - editedItem: {} | |
352 | + editedItem: {}, | |
347 | 353 | }), |
354 | + watch: { | |
355 | + addHolidayDialog: function (val) { | |
356 | + if (!val) { | |
357 | + this.addHoliday = []; | |
358 | + this.menu1 = false; | |
359 | + } | |
360 | + }, | |
361 | + }, | |
348 | 362 | methods: { |
349 | - dates: function(date) { | |
363 | + dates: function (date) { | |
350 | 364 | return moment(date).format("MMMM DD, YYYY"); |
351 | 365 | }, |
352 | 366 | getHolidays() { |
... | ... | @@ -354,13 +368,13 @@ export default { |
354 | 368 | var token = this.$store.state.token; |
355 | 369 | http() |
356 | 370 | .get("/getHolidaysList", { |
357 | - headers: { Authorization: "Bearer " + token } | |
371 | + headers: { Authorization: "Bearer " + token }, | |
358 | 372 | }) |
359 | - .then(response => { | |
373 | + .then((response) => { | |
360 | 374 | this.holidays = response.data.data; |
361 | 375 | this.showLoader = false; |
362 | 376 | }) |
363 | - .catch(err => { | |
377 | + .catch((err) => { | |
364 | 378 | this.showLoader = false; |
365 | 379 | if (error.response.status === 401) { |
366 | 380 | this.$router.replace({ path: "/" }); |
... | ... | @@ -383,22 +397,22 @@ export default { |
383 | 397 | |
384 | 398 | deleteItem(item) { |
385 | 399 | let deleteHoliday = { |
386 | - holidayId: item._id | |
400 | + holidayId: item._id, | |
387 | 401 | }; |
388 | 402 | http() |
389 | 403 | .delete( |
390 | 404 | "/deleteHoliday", |
391 | 405 | confirm("Are you sure you want to delete this?") && { |
392 | - params: deleteHoliday | |
406 | + params: deleteHoliday, | |
393 | 407 | } |
394 | 408 | ) |
395 | - .then(response => { | |
409 | + .then((response) => { | |
396 | 410 | this.snackbar = true; |
397 | 411 | this.text = response.data.message; |
398 | 412 | this.color = "green"; |
399 | 413 | this.getHolidays(); |
400 | 414 | }) |
401 | - .catch(error => { | |
415 | + .catch((error) => { | |
402 | 416 | this.snackbar = true; |
403 | 417 | this.text = error.response.data.message; |
404 | 418 | this.color = "error"; |
... | ... | @@ -407,12 +421,17 @@ export default { |
407 | 421 | close() { |
408 | 422 | this.editHolidayDialog = false; |
409 | 423 | }, |
424 | + closeaddHolidayDialog() { | |
425 | + this.addHolidayDialog = false; | |
426 | + this.addHoliday = []; | |
427 | + this.menu1 = false; | |
428 | + }, | |
410 | 429 | submit() { |
411 | 430 | if (this.$refs.form.validate()) { |
412 | 431 | this.loading = true; |
413 | 432 | http() |
414 | 433 | .post("/createHoliday", this.addHoliday) |
415 | - .then(response => { | |
434 | + .then((response) => { | |
416 | 435 | this.snackbar = true; |
417 | 436 | this.text = response.data.message; |
418 | 437 | this.color = "green"; |
... | ... | @@ -421,7 +440,7 @@ export default { |
421 | 440 | this.clear(); |
422 | 441 | this.loading = false; |
423 | 442 | }) |
424 | - .catch(error => { | |
443 | + .catch((error) => { | |
425 | 444 | this.snackbar = true; |
426 | 445 | this.text = error.response.data.message; |
427 | 446 | this.loading = false; |
... | ... | @@ -435,14 +454,14 @@ export default { |
435 | 454 | save() { |
436 | 455 | http() |
437 | 456 | .put("/updateHoliday", this.editedItem) |
438 | - .then(response => { | |
457 | + .then((response) => { | |
439 | 458 | this.snackbar = true; |
440 | 459 | this.text = response.data.message; |
441 | 460 | this.getHolidays(); |
442 | 461 | this.color = "green"; |
443 | 462 | this.close(); |
444 | 463 | }) |
445 | - .catch(error => { | |
464 | + .catch((error) => { | |
446 | 465 | this.snackbar = true; |
447 | 466 | this.text = error.response.data.message; |
448 | 467 | this.loading = false; |
... | ... | @@ -456,10 +475,10 @@ export default { |
456 | 475 | this.showSearch = false; |
457 | 476 | this.show = true; |
458 | 477 | this.search = ""; |
459 | - } | |
478 | + }, | |
460 | 479 | }, |
461 | 480 | mounted() { |
462 | 481 | this.getHolidays(); |
463 | - } | |
482 | + }, | |
464 | 483 | }; |
465 | 484 | </script> |
466 | 485 | \ No newline at end of file | ... | ... |
src/pages/Library/books.vue
... | ... | @@ -195,7 +195,13 @@ |
195 | 195 | </v-card-title> |
196 | 196 | <v-flex xs8 sm8 md3 lg2 v-if="showSearch"> |
197 | 197 | <v-layout> |
198 | - <v-text-field autofocus v-model="search" label="Search" prepend-inner-icon="search" color="primary"></v-text-field> | |
198 | + <v-text-field | |
199 | + autofocus | |
200 | + v-model="search" | |
201 | + label="Search" | |
202 | + prepend-inner-icon="search" | |
203 | + color="primary" | |
204 | + ></v-text-field> | |
199 | 205 | <v-icon @click="closeSearch" color="error">close</v-icon> |
200 | 206 | </v-layout> |
201 | 207 | </v-flex> |
... | ... | @@ -266,7 +272,7 @@ |
266 | 272 | >Your search for "{{ search }}" found no results.</v-alert> |
267 | 273 | </v-data-table> |
268 | 274 | <!-- ****** ADD BOOK ****** --> |
269 | - <v-dialog v-model="addBookDialog" max-width="600px"> | |
275 | + <v-dialog v-model="addBookDialog" max-width="600px" v-if="addBookDialog"> | |
270 | 276 | <v-card flat class="card-style pa-2" dark> |
271 | 277 | <v-layout> |
272 | 278 | <v-flex xs12> |
... | ... | @@ -455,6 +461,13 @@ export default { |
455 | 461 | editedItem: {}, |
456 | 462 | BooksData: {}, |
457 | 463 | }), |
464 | + watch: { | |
465 | + addBookDialog: function (val) { | |
466 | + if (!val) { | |
467 | + this.BooksData = []; | |
468 | + } | |
469 | + }, | |
470 | + }, | |
458 | 471 | methods: { |
459 | 472 | getBookData() { |
460 | 473 | this.showLoader = true; | ... | ... |
src/pages/Library/eBook.vue
... | ... | @@ -225,7 +225,13 @@ |
225 | 225 | </v-card-title> |
226 | 226 | <v-flex xs8 sm8 md3 lg2 v-if="showSearch"> |
227 | 227 | <v-layout> |
228 | - <v-text-field autofocus v-model="search" label="Search" prepend-inner-icon="search" color="primary"></v-text-field> | |
228 | + <v-text-field | |
229 | + autofocus | |
230 | + v-model="search" | |
231 | + label="Search" | |
232 | + prepend-inner-icon="search" | |
233 | + color="primary" | |
234 | + ></v-text-field> | |
229 | 235 | <v-icon @click="closeSearch" color="error">close</v-icon> |
230 | 236 | </v-layout> |
231 | 237 | </v-flex> |
... | ... | @@ -291,12 +297,12 @@ |
291 | 297 | >Your search for "{{ search }}" found no results.</v-alert> |
292 | 298 | </v-data-table> |
293 | 299 | <!-- ****** ADD MULTIPLE E-BOOK ****** --> |
294 | - <v-dialog v-model="addEBookDialog" max-width="600px"> | |
300 | + <v-dialog v-model="addEBookDialog" max-width="600px" v-if="addEBookDialog"> | |
295 | 301 | <v-card flat class="card-style pa-2" dark> |
296 | 302 | <v-layout> |
297 | 303 | <v-flex xs12> |
298 | 304 | <label class="title text-xs-center">Add E-Book</label> |
299 | - <v-icon size="24" class="right" @click="addEBookDialog = false">cancel</v-icon> | |
305 | + <v-icon size="24" class="right" @click="closeAddEBookModel">cancel</v-icon> | |
300 | 306 | </v-flex> |
301 | 307 | </v-layout> |
302 | 308 | <v-form ref="form" v-model="valid" lazy-validation> |
... | ... | @@ -511,6 +517,16 @@ export default { |
511 | 517 | editAnyFile: "", |
512 | 518 | editFileName: "", |
513 | 519 | }), |
520 | + watch: { | |
521 | + addEBookDialog: function (val) { | |
522 | + if (!val) { | |
523 | + this.addEBooks = []; | |
524 | + this.imageName = ""; | |
525 | + this.fileName = ""; | |
526 | + this.files = ""; | |
527 | + } | |
528 | + }, | |
529 | + }, | |
514 | 530 | methods: { |
515 | 531 | editPickImage() { |
516 | 532 | this.$refs.editImage.click(); |
... | ... | @@ -666,6 +682,14 @@ export default { |
666 | 682 | close1() { |
667 | 683 | this.viewEbookDialog = false; |
668 | 684 | }, |
685 | + closeAddEBookModel() { | |
686 | + this.addEBookDialog = false; | |
687 | + this.eBookData = []; | |
688 | + this.addEBooks = []; | |
689 | + this.imageName = ""; | |
690 | + this.fileName = ""; | |
691 | + this.files = ""; | |
692 | + }, | |
669 | 693 | submit() { |
670 | 694 | if (this.$refs.form.validate()) { |
671 | 695 | this.loading = true; | ... | ... |
src/pages/Library/issue.vue
... | ... | @@ -302,7 +302,13 @@ |
302 | 302 | </v-card-title> |
303 | 303 | <v-flex xs8 sm8 md3 lg2 v-if="showSearch"> |
304 | 304 | <v-layout> |
305 | - <v-text-field autofocus v-model="search" label="Search" prepend-inner-icon="search" color="primary"></v-text-field> | |
305 | + <v-text-field | |
306 | + autofocus | |
307 | + v-model="search" | |
308 | + label="Search" | |
309 | + prepend-inner-icon="search" | |
310 | + color="primary" | |
311 | + ></v-text-field> | |
306 | 312 | <v-icon @click="closeSearch" color="error">close</v-icon> |
307 | 313 | </v-layout> |
308 | 314 | </v-flex> |
... | ... | @@ -374,12 +380,12 @@ |
374 | 380 | </v-data-table> |
375 | 381 | |
376 | 382 | <!-- ****** ADD Issue ****** --> |
377 | - <v-dialog v-model="addIssueDialog" max-width="600px"> | |
383 | + <v-dialog v-model="addIssueDialog" max-width="600px" v-if="addIssueDialog"> | |
378 | 384 | <v-card flat class="card-style pa-2" dark> |
379 | 385 | <v-layout> |
380 | 386 | <v-flex xs12> |
381 | 387 | <label class="title text-xs-center">Add Issue</label> |
382 | - <v-icon size="24" class="right" @click="addIssueDialog = false">cancel</v-icon> | |
388 | + <v-icon size="24" class="right" @click="closeAddIssueModel">cancel</v-icon> | |
383 | 389 | </v-flex> |
384 | 390 | </v-layout> |
385 | 391 | <v-form ref="form" v-model="valid" lazy-validation> |
... | ... | @@ -570,48 +576,48 @@ export default { |
570 | 576 | addclass: [], |
571 | 577 | addSection: [], |
572 | 578 | pagination: { |
573 | - rowsPerPage: 10 | |
579 | + rowsPerPage: 10, | |
574 | 580 | }, |
575 | - libraryIDRules: [v => !!v || " Library ID is required"], | |
576 | - bookRules: [v => !!v || " book Name is required"], | |
577 | - authorRules: [v => !!v || "Author Name is required"], | |
578 | - subjectCodeRules: [v => !!v || "Subject Code is required"], | |
579 | - authorRules: [v => !!v || "Author is required"], | |
580 | - noteRules: [v => !!v || "Note is required"], | |
581 | - dueDateRule: [v => !!v || "Due Date is required"], | |
581 | + libraryIDRules: [(v) => !!v || " Library ID is required"], | |
582 | + bookRules: [(v) => !!v || " book Name is required"], | |
583 | + authorRules: [(v) => !!v || "Author Name is required"], | |
584 | + subjectCodeRules: [(v) => !!v || "Subject Code is required"], | |
585 | + authorRules: [(v) => !!v || "Author is required"], | |
586 | + noteRules: [(v) => !!v || "Note is required"], | |
587 | + dueDateRule: [(v) => !!v || "Due Date is required"], | |
582 | 588 | headers: [ |
583 | 589 | { |
584 | 590 | align: "justify-center", |
585 | 591 | text: "No", |
586 | 592 | sortable: false, |
587 | - value: "No" | |
593 | + value: "No", | |
588 | 594 | }, |
589 | 595 | { text: "Book", vaue: "name", sortable: false, align: "center" }, |
590 | 596 | { |
591 | 597 | text: "Serial Number", |
592 | 598 | value: "serialNumber", |
593 | 599 | sortable: false, |
594 | - align: "center" | |
600 | + align: "center", | |
595 | 601 | }, |
596 | 602 | { |
597 | 603 | text: "Issue Date", |
598 | 604 | value: "created", |
599 | 605 | sortable: false, |
600 | - align: "center" | |
606 | + align: "center", | |
601 | 607 | }, |
602 | 608 | { |
603 | 609 | text: "Due Date", |
604 | 610 | value: "dueDate", |
605 | 611 | sortable: false, |
606 | - align: "center" | |
612 | + align: "center", | |
607 | 613 | }, |
608 | 614 | { |
609 | 615 | text: "Status", |
610 | 616 | value: "status", |
611 | 617 | sortable: false, |
612 | - align: "center" | |
618 | + align: "center", | |
613 | 619 | }, |
614 | - { text: "Action", value: "", sortable: false, align: "center" } | |
620 | + { text: "Action", value: "", sortable: false, align: "center" }, | |
615 | 621 | ], |
616 | 622 | desserts: [], |
617 | 623 | addIssue: {}, |
... | ... | @@ -622,10 +628,23 @@ export default { |
622 | 628 | editedItem: {}, |
623 | 629 | books: [], |
624 | 630 | token: "", |
625 | - disable: false | |
631 | + disable: false, | |
626 | 632 | }), |
633 | + watch: { | |
634 | + addIssueDialog: function (val) { | |
635 | + if (!val) { | |
636 | + this.addIssue = []; | |
637 | + this.libraryID = ""; | |
638 | + this.bookId = ""; | |
639 | + this.serialNo = ""; | |
640 | + this.menu2 = false; | |
641 | + this.date = null; | |
642 | + this.note = ""; | |
643 | + } | |
644 | + }, | |
645 | + }, | |
627 | 646 | methods: { |
628 | - dates: function(date) { | |
647 | + dates: function (date) { | |
629 | 648 | return moment(date).format("MMMM DD, YYYY"); |
630 | 649 | }, |
631 | 650 | pickFile() { |
... | ... | @@ -643,19 +662,19 @@ export default { |
643 | 662 | { |
644 | 663 | params: { |
645 | 664 | libraryId: this.libraryId, |
646 | - schoolId: this.$store.state.schoolId | |
647 | - } | |
665 | + schoolId: this.$store.state.schoolId, | |
666 | + }, | |
648 | 667 | }, |
649 | 668 | { |
650 | - headers: { Authorization: "Bearer " + this.token } | |
669 | + headers: { Authorization: "Bearer " + this.token }, | |
651 | 670 | } |
652 | 671 | ) |
653 | - .then(response => { | |
672 | + .then((response) => { | |
654 | 673 | this.desserts = response.data.data; |
655 | 674 | this.showLoader = false; |
656 | 675 | this.loadingSearch = false; |
657 | 676 | }) |
658 | - .catch(error => { | |
677 | + .catch((error) => { | |
659 | 678 | this.showLoader = false; |
660 | 679 | this.loadingSearch = false; |
661 | 680 | this.snackbar = true; |
... | ... | @@ -689,16 +708,16 @@ export default { |
689 | 708 | }, |
690 | 709 | deleteItem(item) { |
691 | 710 | let deleteParticularIssue = { |
692 | - bookIssueId: item._id | |
711 | + bookIssueId: item._id, | |
693 | 712 | }; |
694 | 713 | http() |
695 | 714 | .delete( |
696 | 715 | "/deleteBookIssue", |
697 | 716 | confirm("Are you sure you want to delete this?") && { |
698 | - params: deleteParticularIssue | |
717 | + params: deleteParticularIssue, | |
699 | 718 | } |
700 | 719 | ) |
701 | - .then(response => { | |
720 | + .then((response) => { | |
702 | 721 | this.snackbar = true; |
703 | 722 | this.text = "Delete Successfully"; |
704 | 723 | this.getIssueList(); |
... | ... | @@ -713,7 +732,7 @@ export default { |
713 | 732 | this.color = "green"; |
714 | 733 | this.loading = false; |
715 | 734 | }) |
716 | - .catch(error => { | |
735 | + .catch((error) => { | |
717 | 736 | // console.log(error); |
718 | 737 | this.snackbar = true; |
719 | 738 | this.text = error.response.data.message; |
... | ... | @@ -722,19 +741,19 @@ export default { |
722 | 741 | }, |
723 | 742 | returnBook(item) { |
724 | 743 | let returnBook = { |
725 | - bookIssueId: item._id | |
744 | + bookIssueId: item._id, | |
726 | 745 | }; |
727 | 746 | http() |
728 | 747 | .put( |
729 | 748 | "/returnBook", |
730 | 749 | confirm("Are you sure you want to return this?") && returnBook |
731 | 750 | ) |
732 | - .then(response => { | |
751 | + .then((response) => { | |
733 | 752 | this.snackbar = true; |
734 | 753 | this.text = "Successfully return Issue a Book "; |
735 | 754 | this.getIssueList(); |
736 | 755 | }) |
737 | - .catch(error => {}); | |
756 | + .catch((error) => {}); | |
738 | 757 | }, |
739 | 758 | close() { |
740 | 759 | this.editIssueDialog = false; |
... | ... | @@ -742,6 +761,17 @@ export default { |
742 | 761 | close1() { |
743 | 762 | this.viewIssueDialog = false; |
744 | 763 | }, |
764 | + closeAddIssueModel() { | |
765 | + this.addIssueDialog = false; | |
766 | + this.desserts = []; | |
767 | + this.addIssue = []; | |
768 | + this.libraryID = ""; | |
769 | + this.bookId = ""; | |
770 | + this.serialNo = ""; | |
771 | + this.menu2 = false; | |
772 | + this.date = null; | |
773 | + this.note = ""; | |
774 | + }, | |
745 | 775 | submit() { |
746 | 776 | if (this.$refs.form.validate()) { |
747 | 777 | let createBook = { |
... | ... | @@ -752,12 +782,12 @@ export default { |
752 | 782 | serialNumber: this.serialNo, |
753 | 783 | note: this.note, |
754 | 784 | dueDate: this.date, |
755 | - schoolId: this.$store.state.schoolId | |
785 | + schoolId: this.$store.state.schoolId, | |
756 | 786 | }; |
757 | 787 | this.loading = true; |
758 | 788 | http() |
759 | 789 | .post("/createBookIssue", createBook) |
760 | - .then(response => { | |
790 | + .then((response) => { | |
761 | 791 | this.getIssueList(); |
762 | 792 | this.snackbar = true; |
763 | 793 | this.text = response.data.message; |
... | ... | @@ -766,7 +796,7 @@ export default { |
766 | 796 | this.loading = false; |
767 | 797 | this.clear(); |
768 | 798 | }) |
769 | - .catch(error => { | |
799 | + .catch((error) => { | |
770 | 800 | this.snackbar = true; |
771 | 801 | this.text = error.response.data.message; |
772 | 802 | this.color = "red"; |
... | ... | @@ -783,7 +813,7 @@ export default { |
783 | 813 | this.editedItem.bookId = this.editedItem.bookId; |
784 | 814 | http() |
785 | 815 | .put("/updateBookIssue", this.editedItem) |
786 | - .then(response => { | |
816 | + .then((response) => { | |
787 | 817 | this.editIssueDialog = false; |
788 | 818 | this.snackbar = true; |
789 | 819 | this.text = "Successfully Edit Issue a Book"; |
... | ... | @@ -791,7 +821,7 @@ export default { |
791 | 821 | this.getIssueList(); |
792 | 822 | this.close(); |
793 | 823 | }) |
794 | - .catch(error => { | |
824 | + .catch((error) => { | |
795 | 825 | this.snackbar = true; |
796 | 826 | this.text = error.response.data.message; |
797 | 827 | this.color = "red"; |
... | ... | @@ -802,15 +832,15 @@ export default { |
802 | 832 | http() |
803 | 833 | .get("/getBooksList", { |
804 | 834 | params: { |
805 | - schoolId: this.$store.state.schoolId | |
835 | + schoolId: this.$store.state.schoolId, | |
806 | 836 | }, |
807 | - headers: { Authorization: "Bearer " + this.token } | |
837 | + headers: { Authorization: "Bearer " + this.token }, | |
808 | 838 | }) |
809 | - .then(response => { | |
839 | + .then((response) => { | |
810 | 840 | this.books = response.data.data; |
811 | 841 | this.showLoader = false; |
812 | 842 | }) |
813 | - .catch(error => { | |
843 | + .catch((error) => { | |
814 | 844 | this.showLoader = false; |
815 | 845 | if (error.response.status === 401) { |
816 | 846 | this.$router.replace({ path: "/" }); |
... | ... | @@ -832,7 +862,7 @@ export default { |
832 | 862 | } |
833 | 863 | this.addIssue = { |
834 | 864 | author: this.books[i].author, |
835 | - subjectCode: this.books[i].subjectCode | |
865 | + subjectCode: this.books[i].subjectCode, | |
836 | 866 | }; |
837 | 867 | } |
838 | 868 | } |
... | ... | @@ -845,12 +875,12 @@ export default { |
845 | 875 | this.showSearch = false; |
846 | 876 | this.show = true; |
847 | 877 | this.search = ""; |
848 | - } | |
878 | + }, | |
849 | 879 | }, |
850 | 880 | mounted() { |
851 | 881 | this.token = this.$store.state.token; |
852 | 882 | this.getBookData(); |
853 | - } | |
883 | + }, | |
854 | 884 | }; |
855 | 885 | </script> |
856 | 886 | <style scoped> | ... | ... |
src/pages/Library/member.vue
... | ... | @@ -398,12 +398,17 @@ |
398 | 398 | </v-layout> |
399 | 399 | <v-layout> |
400 | 400 | <v-flex xs12 sm12> |
401 | - <v-layout> | |
401 | + <v-layout class="right"> | |
402 | 402 | <v-flex xs6> |
403 | - <v-btn round dark @click.native="closeEditStudentDialog">Cancel</v-btn> | |
403 | + <v-btn | |
404 | + round | |
405 | + dark | |
406 | + class="clear-button" | |
407 | + @click.native="closeEditStudentDialog" | |
408 | + >Cancel</v-btn> | |
404 | 409 | </v-flex> |
405 | 410 | <v-flex xs6> |
406 | - <v-btn @click="save" round dark :loading="loading" class="right">Save</v-btn> | |
411 | + <v-btn @click="save" round dark :loading="loading" class="add-button">Save</v-btn> | |
407 | 412 | </v-flex> |
408 | 413 | </v-layout> |
409 | 414 | </v-flex> |
... | ... | @@ -415,15 +420,14 @@ |
415 | 420 | </v-dialog> |
416 | 421 | <!-- Add Student Library Member Dialog --> |
417 | 422 | |
418 | - <v-dialog v-model="addLibrary" max-width="600px"> | |
419 | - <v-toolbar dark class="card-styles" flat> | |
420 | - <v-spacer></v-spacer> | |
421 | - <v-toolbar-title> | |
422 | - <h3>Library Member</h3> | |
423 | - </v-toolbar-title> | |
424 | - <v-spacer></v-spacer> | |
425 | - </v-toolbar> | |
426 | - <v-card> | |
423 | + <v-dialog v-model="addLibrary" max-width="600px" v-if="addLibrary"> | |
424 | + <v-card flat class="card-style pa-2" dark> | |
425 | + <v-layout> | |
426 | + <v-flex xs12> | |
427 | + <label class="title text-xs-center">Library Member</label> | |
428 | + <v-icon size="24" class="right" @click="closeAddLibraryModel">cancel</v-icon> | |
429 | + </v-flex> | |
430 | + </v-layout> | |
427 | 431 | <v-card-text> |
428 | 432 | <v-layout wrap justify-center> |
429 | 433 | <v-flex xs12 sm12 md10> |
... | ... | @@ -454,11 +458,19 @@ |
454 | 458 | ></v-text-field> |
455 | 459 | </v-flex> |
456 | 460 | </v-layout> |
457 | - <v-card-actions> | |
458 | - <v-btn round dark @click.native="addLibrary = false">Cancel</v-btn> | |
459 | - <v-spacer></v-spacer> | |
460 | - <v-btn round dark @click="submit" :loading="loading">Add Member</v-btn> | |
461 | - </v-card-actions> | |
461 | + <v-layout> | |
462 | + <v-flex xs12 sm12> | |
463 | + <v-layout class="right"> | |
464 | + <v-btn | |
465 | + round | |
466 | + dark | |
467 | + class="clear-button" | |
468 | + @click.native="addLibrary = false" | |
469 | + >Cancel</v-btn> | |
470 | + <v-btn round dark :loading="loading" class="add-button" @click="submit">Add</v-btn> | |
471 | + </v-layout> | |
472 | + </v-flex> | |
473 | + </v-layout> | |
462 | 474 | </v-form> |
463 | 475 | </v-flex> |
464 | 476 | </v-layout> |
... | ... | @@ -625,6 +637,13 @@ export default { |
625 | 637 | selectStudents: {}, |
626 | 638 | editedIndex: -1, |
627 | 639 | }), |
640 | + watch: { | |
641 | + addLibrary: function (val) { | |
642 | + if (!val) { | |
643 | + this.addBook = []; | |
644 | + } | |
645 | + }, | |
646 | + }, | |
628 | 647 | methods: { |
629 | 648 | getAllStudents() { |
630 | 649 | this.showLoader = true; |
... | ... | @@ -697,6 +716,11 @@ export default { |
697 | 716 | closeViewStudent() { |
698 | 717 | this.dialogStudents = false; |
699 | 718 | }, |
719 | + closeAddLibraryModel() { | |
720 | + this.addLibrary = false; | |
721 | + this.addclass = []; | |
722 | + this.addBook = []; | |
723 | + }, | |
700 | 724 | submit() { |
701 | 725 | if (this.$refs.form.validate()) { |
702 | 726 | this.loading = true; | ... | ... |
src/pages/Mark/mark.vue
... | ... | @@ -62,7 +62,13 @@ |
62 | 62 | </v-card-title> |
63 | 63 | <v-flex xs8 sm8 md3 lg2 v-if="showSearch"> |
64 | 64 | <v-layout> |
65 | - <v-text-field autofocus v-model="search" label="Search" prepend-inner-icon="search" color="primary"></v-text-field> | |
65 | + <v-text-field | |
66 | + autofocus | |
67 | + v-model="search" | |
68 | + label="Search" | |
69 | + prepend-inner-icon="search" | |
70 | + color="primary" | |
71 | + ></v-text-field> | |
66 | 72 | <v-icon @click="closeSearch" color="error">close</v-icon> |
67 | 73 | </v-layout> |
68 | 74 | </v-flex> |
... | ... | @@ -161,12 +167,16 @@ |
161 | 167 | >Your search for "{{ search }}" found no results.</v-alert> |
162 | 168 | </v-data-table> |
163 | 169 | <!-- ****** ADD Mark Schedule ****** --> |
164 | - <v-dialog v-model="addMarkDialog" max-width> | |
170 | + <v-dialog v-model="addMarkDialog" max-width v-if="addMarkDialog"> | |
165 | 171 | <v-card flat class> |
166 | 172 | <v-layout class="pa-3 card-style white--text"> |
167 | 173 | <v-flex xs12> |
168 | 174 | <label class="title text-xs-center">Add Mark</label> |
169 | - <v-icon size="24" class="right white--text" @click="$refs.form.reset();addMarkDialog = false">cancel</v-icon> | |
175 | + <v-icon | |
176 | + size="24" | |
177 | + class="right white--text" | |
178 | + @click="$refs.form.reset();addMarkDialog = false" | |
179 | + >cancel</v-icon> | |
170 | 180 | </v-flex> |
171 | 181 | </v-layout> |
172 | 182 | <v-form ref="form" v-model="valid" lazy-validation> |
... | ... | @@ -355,71 +365,71 @@ export default { |
355 | 365 | addMarkDialog: false, |
356 | 366 | addSection: [], |
357 | 367 | pagination: { |
358 | - rowsPerPage: 10 | |
368 | + rowsPerPage: 10, | |
359 | 369 | }, |
360 | - classRules: [v => !!v || "Class is required"], | |
361 | - sectionRules: [v => !!v || "section is required"], | |
362 | - subjectRules: [v => !!v || "Subject is required"], | |
363 | - examRules: [v => !!v || "Exam is required"], | |
370 | + classRules: [(v) => !!v || "Class is required"], | |
371 | + sectionRules: [(v) => !!v || "section is required"], | |
372 | + subjectRules: [(v) => !!v || "Subject is required"], | |
373 | + examRules: [(v) => !!v || "Exam is required"], | |
364 | 374 | |
365 | 375 | headerOfMark: [ |
366 | 376 | { |
367 | 377 | align: "", |
368 | 378 | text: "No", |
369 | 379 | sortable: false, |
370 | - value: "No" | |
380 | + value: "No", | |
371 | 381 | }, |
372 | 382 | { |
373 | 383 | text: "Profile Pic", |
374 | 384 | vaue: "profilePicUrl", |
375 | 385 | sortable: false, |
376 | - align: "center" | |
386 | + align: "center", | |
377 | 387 | }, |
378 | 388 | { |
379 | 389 | text: "Name", |
380 | 390 | vaue: "name", |
381 | 391 | sortable: false, |
382 | - align: "center" | |
392 | + align: "center", | |
383 | 393 | }, |
384 | 394 | { |
385 | 395 | text: "Roll No.", |
386 | 396 | value: "rollNo", |
387 | 397 | sortable: false, |
388 | - align: "center" | |
389 | - } | |
398 | + align: "center", | |
399 | + }, | |
390 | 400 | ], |
391 | 401 | headers: [ |
392 | 402 | { |
393 | 403 | align: "", |
394 | 404 | text: "No", |
395 | 405 | sortable: false, |
396 | - value: "No" | |
406 | + value: "No", | |
397 | 407 | }, |
398 | 408 | { |
399 | 409 | text: "Profile Pic", |
400 | 410 | vaue: "profilePicUrl", |
401 | 411 | sortable: false, |
402 | - align: "center" | |
412 | + align: "center", | |
403 | 413 | }, |
404 | 414 | { |
405 | 415 | text: "Name", |
406 | 416 | vaue: "name", |
407 | 417 | sortable: false, |
408 | - align: "center" | |
418 | + align: "center", | |
409 | 419 | }, |
410 | 420 | { |
411 | 421 | text: "Roll No.", |
412 | 422 | value: "rollNo", |
413 | 423 | sortable: false, |
414 | - align: "center" | |
424 | + align: "center", | |
415 | 425 | }, |
416 | 426 | { |
417 | 427 | text: "Email", |
418 | 428 | value: "email", |
419 | 429 | sortable: false, |
420 | - align: "center" | |
430 | + align: "center", | |
421 | 431 | }, |
422 | - { text: "Action", value: "", sortable: false, align: "center" } | |
432 | + { text: "Action", value: "", sortable: false, align: "center" }, | |
423 | 433 | ], |
424 | 434 | classList: [], |
425 | 435 | examList: [], |
... | ... | @@ -430,20 +440,28 @@ export default { |
430 | 440 | markData: [], |
431 | 441 | getStudentData: [], |
432 | 442 | getStudentsList: [], |
433 | - token: "" | |
443 | + token: "", | |
434 | 444 | }), |
445 | + watch: { | |
446 | + addMarkDialog: function (val) { | |
447 | + if (!val) { | |
448 | + this.addMark = []; | |
449 | + this.getStudentData = []; | |
450 | + } | |
451 | + }, | |
452 | + }, | |
435 | 453 | methods: { |
436 | 454 | getClass() { |
437 | 455 | this.showLoader = true; |
438 | 456 | http() |
439 | 457 | .get("/getClassesList", { |
440 | - headers: { Authorization: "Bearer " + this.token } | |
458 | + headers: { Authorization: "Bearer " + this.token }, | |
441 | 459 | }) |
442 | - .then(response => { | |
460 | + .then((response) => { | |
443 | 461 | this.classList = response.data.data; |
444 | 462 | this.showLoader = false; |
445 | 463 | }) |
446 | - .catch(err => { | |
464 | + .catch((err) => { | |
447 | 465 | // console.log("err====>", err); |
448 | 466 | this.showLoader = false; |
449 | 467 | }); |
... | ... | @@ -460,14 +478,14 @@ export default { |
460 | 478 | "/getSectionsList", |
461 | 479 | { params: { classId: _id } }, |
462 | 480 | { |
463 | - headers: { Authorization: "Bearer " + this.token } | |
481 | + headers: { Authorization: "Bearer " + this.token }, | |
464 | 482 | } |
465 | 483 | ) |
466 | - .then(response => { | |
484 | + .then((response) => { | |
467 | 485 | this.addSection = response.data.data; |
468 | 486 | this.showLoader = false; |
469 | 487 | }) |
470 | - .catch(err => { | |
488 | + .catch((err) => { | |
471 | 489 | this.showLoader = false; |
472 | 490 | // console.log("err====>", err); |
473 | 491 | }); |
... | ... | @@ -477,14 +495,14 @@ export default { |
477 | 495 | this.loadingSearch = true; |
478 | 496 | http() |
479 | 497 | .get("/getExamsList", { |
480 | - headers: { Authorization: "Bearer " + this.token } | |
498 | + headers: { Authorization: "Bearer " + this.token }, | |
481 | 499 | }) |
482 | - .then(response => { | |
500 | + .then((response) => { | |
483 | 501 | this.examList = response.data.data; |
484 | 502 | this.showLoader = false; |
485 | 503 | this.loadingSearch = false; |
486 | 504 | }) |
487 | - .catch(error => { | |
505 | + .catch((error) => { | |
488 | 506 | // console.log("err====>", err); |
489 | 507 | this.showLoader = false; |
490 | 508 | this.loadingSearch = false; |
... | ... | @@ -506,18 +524,18 @@ export default { |
506 | 524 | .get("/getStudentWithClass", { |
507 | 525 | params: { |
508 | 526 | classId: this.addMark.classId, |
509 | - sectionId: this.addMark.sectionId | |
510 | - } | |
527 | + sectionId: this.addMark.sectionId, | |
528 | + }, | |
511 | 529 | }) |
512 | - .then(response => { | |
530 | + .then((response) => { | |
513 | 531 | this.getStudentData = response.data.data; |
514 | 532 | // this.showLoader = false; |
515 | 533 | this.showLoader = true; |
516 | 534 | http() |
517 | 535 | .get("/getMarkDistributionsList", { |
518 | - params: this.addMark | |
536 | + params: this.addMark, | |
519 | 537 | }) |
520 | - .then(response => { | |
538 | + .then((response) => { | |
521 | 539 | this.showLoader = false; |
522 | 540 | this.headerOfMark.length = 4; |
523 | 541 | for (var i = 0; i < response.data.data.length; i++) { |
... | ... | @@ -528,7 +546,7 @@ export default { |
528 | 546 | response.data.data[i].markValue + |
529 | 547 | ")", |
530 | 548 | sortable: false, |
531 | - align: "center" | |
549 | + align: "center", | |
532 | 550 | }); |
533 | 551 | } |
534 | 552 | for (var n = 0; n < this.getStudentData.length; n++) { |
... | ... | @@ -538,7 +556,7 @@ export default { |
538 | 556 | markDistributionId: response.data.data[j]._id, |
539 | 557 | marksScored: 0, |
540 | 558 | markValue: response.data.data[j].markValue, |
541 | - distributionType: response.data.data[j].distributionType | |
559 | + distributionType: response.data.data[j].distributionType, | |
542 | 560 | }); |
543 | 561 | } |
544 | 562 | // if (marks.marksScored > marks.marksObtained) { |
... | ... | @@ -547,11 +565,11 @@ export default { |
547 | 565 | // } |
548 | 566 | } |
549 | 567 | }) |
550 | - .catch(error => { | |
568 | + .catch((error) => { | |
551 | 569 | this.showLoader = false; |
552 | 570 | }); |
553 | 571 | }) |
554 | - .catch(error => { | |
572 | + .catch((error) => { | |
555 | 573 | this.showLoader = false; |
556 | 574 | }); |
557 | 575 | } |
... | ... | @@ -575,7 +593,7 @@ export default { |
575 | 593 | sectionId: this.addMark.sectionId, |
576 | 594 | subjectId: this.addMark.subjectId, |
577 | 595 | studentId: item._id, |
578 | - studentsMarks: item.marksObtained | |
596 | + studentsMarks: item.marksObtained, | |
579 | 597 | }; |
580 | 598 | try { |
581 | 599 | let response = await http().post("/createMark", data); |
... | ... | @@ -585,7 +603,7 @@ export default { |
585 | 603 | this.addMarkDialog = false; |
586 | 604 | this.text = response.data.message; |
587 | 605 | this.color = "green"; |
588 | - this.$refs.form.reset() | |
606 | + this.$refs.form.reset(); | |
589 | 607 | } |
590 | 608 | } catch (error) { |
591 | 609 | this.snackbar = true; |
... | ... | @@ -600,14 +618,14 @@ export default { |
600 | 618 | .get("/getStudentWithClass", { |
601 | 619 | params: { |
602 | 620 | classId: this.getMark.classId, |
603 | - sectionId: this.getMark.sectionId | |
604 | - } | |
621 | + sectionId: this.getMark.sectionId, | |
622 | + }, | |
605 | 623 | }) |
606 | - .then(response => { | |
624 | + .then((response) => { | |
607 | 625 | this.getStudentsList = response.data.data; |
608 | 626 | this.showLoader = false; |
609 | 627 | }) |
610 | - .catch(error => { | |
628 | + .catch((error) => { | |
611 | 629 | console.log("err====>", error); |
612 | 630 | this.showLoader = false; |
613 | 631 | }); |
... | ... | @@ -619,13 +637,13 @@ export default { |
619 | 637 | this.showSearch = false; |
620 | 638 | this.show = true; |
621 | 639 | this.search = ""; |
622 | - } | |
640 | + }, | |
623 | 641 | }, |
624 | 642 | mounted() { |
625 | 643 | this.token = this.$store.state.token; |
626 | 644 | this.getClass(); |
627 | 645 | this.getExamList(); |
628 | - } | |
646 | + }, | |
629 | 647 | }; |
630 | 648 | </script> |
631 | 649 | <style scoped> | ... | ... |
src/pages/News/news.vue
... | ... | @@ -206,7 +206,13 @@ |
206 | 206 | </v-card-title> |
207 | 207 | <v-flex xs8 sm8 md3 lg2 v-if="showSearch"> |
208 | 208 | <v-layout> |
209 | - <v-text-field autofocus v-model="search" label="Search" prepend-inner-icon="search" color="primary"></v-text-field> | |
209 | + <v-text-field | |
210 | + autofocus | |
211 | + v-model="search" | |
212 | + label="Search" | |
213 | + prepend-inner-icon="search" | |
214 | + color="primary" | |
215 | + ></v-text-field> | |
210 | 216 | <v-icon @click="closeSearch" color="error">close</v-icon> |
211 | 217 | </v-layout> |
212 | 218 | </v-flex> |
... | ... | @@ -277,12 +283,12 @@ |
277 | 283 | >Your search for "{{ search }}" found no results.</v-alert> |
278 | 284 | </v-data-table> |
279 | 285 | <!-- ****** ADD NEWS ****** --> |
280 | - <v-dialog v-model="addNewsDialog" max-width="600px"> | |
286 | + <v-dialog v-model="addNewsDialog" max-width="600px" v-if="addNewsDialog"> | |
281 | 287 | <v-card flat class="card-style pa-2" dark> |
282 | 288 | <v-layout> |
283 | 289 | <v-flex xs12> |
284 | 290 | <label class="title text-xs-center">Add News</label> |
285 | - <v-icon size="24" class="right" @click="addNewsDialog = false">cancel</v-icon> | |
291 | + <v-icon size="24" class="right" @click="closeAddNewsModel">cancel</v-icon> | |
286 | 292 | </v-flex> |
287 | 293 | </v-layout> |
288 | 294 | <v-form ref="form" v-model="valid" lazy-validation> |
... | ... | @@ -400,7 +406,7 @@ export default { |
400 | 406 | addclass: [], |
401 | 407 | addSection: [], |
402 | 408 | pagination: { |
403 | - rowsPerPage: 10 | |
409 | + rowsPerPage: 10, | |
404 | 410 | }, |
405 | 411 | imageName: "", |
406 | 412 | imageUrl: "", |
... | ... | @@ -408,14 +414,14 @@ export default { |
408 | 414 | image: [], |
409 | 415 | upload: "", |
410 | 416 | files: [], |
411 | - titleRules: [v => !!v || " Tilte is required"], | |
412 | - descriptionRules: [v => !!v || " Description is required"], | |
417 | + titleRules: [(v) => !!v || " Tilte is required"], | |
418 | + descriptionRules: [(v) => !!v || " Description is required"], | |
413 | 419 | headers: [ |
414 | 420 | { |
415 | 421 | align: "justify-center", |
416 | 422 | text: "No", |
417 | 423 | sortable: false, |
418 | - value: "No" | |
424 | + value: "No", | |
419 | 425 | }, |
420 | 426 | { text: "Image", vaue: "image", sortable: false, align: "center" }, |
421 | 427 | { text: "Title", value: "title", sortable: false, align: "center" }, |
... | ... | @@ -423,25 +429,36 @@ export default { |
423 | 429 | text: "Description", |
424 | 430 | value: "description", |
425 | 431 | sortable: false, |
426 | - align: "center" | |
432 | + align: "center", | |
427 | 433 | }, |
428 | - { text: "Action", value: "", sortable: false, align: "center" } | |
434 | + { text: "Action", value: "", sortable: false, align: "center" }, | |
429 | 435 | ], |
430 | 436 | desserts: [], |
431 | 437 | editedIndex: -1, |
432 | 438 | addNews: { |
433 | 439 | title: "", |
434 | - description: "" | |
440 | + description: "", | |
435 | 441 | }, |
436 | 442 | editedItem: { |
437 | 443 | title: "", |
438 | - description: "" | |
444 | + description: "", | |
439 | 445 | }, |
440 | 446 | defaultItem: { |
441 | 447 | title: "", |
442 | - description: "" | |
443 | - } | |
448 | + description: "", | |
449 | + }, | |
444 | 450 | }), |
451 | + watch: { | |
452 | + addNewsDialog: function (val) { | |
453 | + if (!val) { | |
454 | + this.addNews = []; | |
455 | + this.imageName = ""; | |
456 | + this.imageFile = ""; | |
457 | + this.imageUrl = ""; | |
458 | + this.files = []; | |
459 | + } | |
460 | + }, | |
461 | + }, | |
445 | 462 | methods: { |
446 | 463 | getSections(_id) { |
447 | 464 | var token = this.$store.state.token; |
... | ... | @@ -450,13 +467,13 @@ export default { |
450 | 467 | "/getSectionsList", |
451 | 468 | { params: { classId: _id } }, |
452 | 469 | { |
453 | - headers: { Authorization: "Bearer " + token } | |
470 | + headers: { Authorization: "Bearer " + token }, | |
454 | 471 | } |
455 | 472 | ) |
456 | - .then(response => { | |
473 | + .then((response) => { | |
457 | 474 | this.addSection = response.data.data; |
458 | 475 | }) |
459 | - .catch(err => { | |
476 | + .catch((err) => { | |
460 | 477 | console.log("err====>", err); |
461 | 478 | }); |
462 | 479 | }, |
... | ... | @@ -477,8 +494,8 @@ export default { |
477 | 494 | /** Select many image and showing many image add to news card **/ |
478 | 495 | const test = Array.from(files).forEach((file, idx) => { |
479 | 496 | const fr = new FileReader(); |
480 | - const getResult = new Promise(resolve => { | |
481 | - fr.onload = e => { | |
497 | + const getResult = new Promise((resolve) => { | |
498 | + fr.onload = (e) => { | |
482 | 499 | this.files.push( |
483 | 500 | // id: idx, |
484 | 501 | e.target.result |
... | ... | @@ -486,7 +503,7 @@ export default { |
486 | 503 | }; |
487 | 504 | }); |
488 | 505 | fr.readAsDataURL(file); |
489 | - return getResult.then(file => { | |
506 | + return getResult.then((file) => { | |
490 | 507 | return file; |
491 | 508 | }); |
492 | 509 | }); |
... | ... | @@ -507,13 +524,13 @@ export default { |
507 | 524 | var token = this.$store.state.token; |
508 | 525 | http() |
509 | 526 | .get("/getNewsList", { |
510 | - headers: { Authorization: "Bearer " + token } | |
527 | + headers: { Authorization: "Bearer " + token }, | |
511 | 528 | }) |
512 | - .then(response => { | |
529 | + .then((response) => { | |
513 | 530 | this.desserts = response.data.data; |
514 | 531 | this.showLoader = false; |
515 | 532 | }) |
516 | - .catch(error => { | |
533 | + .catch((error) => { | |
517 | 534 | this.showLoader = false; |
518 | 535 | if (error.response.status === 401) { |
519 | 536 | this.$router.replace({ path: "/" }); |
... | ... | @@ -535,22 +552,22 @@ export default { |
535 | 552 | }, |
536 | 553 | deleteItem(item) { |
537 | 554 | let deleteNews = { |
538 | - newsId: item._id | |
555 | + newsId: item._id, | |
539 | 556 | }; |
540 | 557 | http() |
541 | 558 | .delete( |
542 | 559 | "/deleteNews", |
543 | 560 | confirm("Are you sure you want to delete this?") && { |
544 | - params: deleteNews | |
561 | + params: deleteNews, | |
545 | 562 | } |
546 | 563 | ) |
547 | - .then(response => { | |
564 | + .then((response) => { | |
548 | 565 | this.snackbar = true; |
549 | 566 | this.text = response.data.message; |
550 | 567 | this.color = "green"; |
551 | 568 | this.getNewsList(); |
552 | 569 | }) |
553 | - .catch(error => { | |
570 | + .catch((error) => { | |
554 | 571 | this.snackbar = true; |
555 | 572 | this.color = "error"; |
556 | 573 | this.text = error.response.data.message; |
... | ... | @@ -559,17 +576,17 @@ export default { |
559 | 576 | deleteImage(imageId, newsId) { |
560 | 577 | let deleteImages = { |
561 | 578 | newsId: newsId, |
562 | - imageId: imageId | |
579 | + imageId: imageId, | |
563 | 580 | }; |
564 | 581 | http() |
565 | 582 | .put("/deleteImages", deleteImages) |
566 | - .then(response => { | |
583 | + .then((response) => { | |
567 | 584 | this.snackbar = true; |
568 | 585 | this.text = response.data.message; |
569 | 586 | this.color = "green"; |
570 | 587 | this.close(); |
571 | 588 | }) |
572 | - .catch(error => { | |
589 | + .catch((error) => { | |
573 | 590 | this.snackbar = true; |
574 | 591 | this.color = "error"; |
575 | 592 | this.text = error.response.data.message; |
... | ... | @@ -581,11 +598,19 @@ export default { |
581 | 598 | close1() { |
582 | 599 | this.dialog1 = false; |
583 | 600 | }, |
601 | + closeAddNewsModel() { | |
602 | + this.addNewsDialog = false; | |
603 | + this.addNews = []; | |
604 | + this.imageName = ""; | |
605 | + this.imageFile = ""; | |
606 | + this.imageUrl = ""; | |
607 | + this.files = []; | |
608 | + }, | |
584 | 609 | submit() { |
585 | 610 | if (this.$refs.form.validate()) { |
586 | 611 | let newsData = { |
587 | 612 | title: this.addNews.title, |
588 | - description: this.addNews.description | |
613 | + description: this.addNews.description, | |
589 | 614 | }; |
590 | 615 | if (this.files) { |
591 | 616 | var ary = []; |
... | ... | @@ -600,7 +625,7 @@ export default { |
600 | 625 | this.loading = true; |
601 | 626 | http() |
602 | 627 | .post("/createNews", newsData) |
603 | - .then(response => { | |
628 | + .then((response) => { | |
604 | 629 | this.files = []; |
605 | 630 | this.snackbar = true; |
606 | 631 | this.text = response.data.message; |
... | ... | @@ -610,7 +635,7 @@ export default { |
610 | 635 | this.loading = false; |
611 | 636 | this.clear(); |
612 | 637 | }) |
613 | - .catch(error => { | |
638 | + .catch((error) => { | |
614 | 639 | this.snackbar = true; |
615 | 640 | this.text = error.response.data.message; |
616 | 641 | this.color = "error"; |
... | ... | @@ -625,7 +650,7 @@ export default { |
625 | 650 | let editNews = { |
626 | 651 | title: this.editedItem.title, |
627 | 652 | description: this.editedItem.description, |
628 | - newsId: this.editedItem._id | |
653 | + newsId: this.editedItem._id, | |
629 | 654 | }; |
630 | 655 | if (this.files) { |
631 | 656 | var ary = []; |
... | ... | @@ -639,7 +664,7 @@ export default { |
639 | 664 | } |
640 | 665 | http() |
641 | 666 | .put("/updateNews", editNews) |
642 | - .then(response => { | |
667 | + .then((response) => { | |
643 | 668 | this.snackbar = true; |
644 | 669 | this.text = "Successfully updated News"; |
645 | 670 | this.color = "green"; |
... | ... | @@ -647,7 +672,7 @@ export default { |
647 | 672 | this.getNewsList(); |
648 | 673 | this.close(); |
649 | 674 | }) |
650 | - .catch(error => { | |
675 | + .catch((error) => { | |
651 | 676 | this.snackbar = true; |
652 | 677 | this.color = "error"; |
653 | 678 | this.text = error.response.data.message; |
... | ... | @@ -660,11 +685,11 @@ export default { |
660 | 685 | this.showSearch = false; |
661 | 686 | this.show = true; |
662 | 687 | this.search = ""; |
663 | - } | |
688 | + }, | |
664 | 689 | }, |
665 | 690 | mounted() { |
666 | 691 | this.getNewsList(); |
667 | 692 | this.editItem; |
668 | - } | |
693 | + }, | |
669 | 694 | }; |
670 | 695 | </script> |
671 | 696 | \ No newline at end of file | ... | ... |
src/pages/NoticeBoard/noticeBoard.vue
... | ... | @@ -178,7 +178,13 @@ |
178 | 178 | </v-card-title> |
179 | 179 | <v-flex xs8 sm8 md3 lg2 v-if="showSearch"> |
180 | 180 | <v-layout> |
181 | - <v-text-field autofocus v-model="search" label="Search" prepend-inner-icon="search" color="primary"></v-text-field> | |
181 | + <v-text-field | |
182 | + autofocus | |
183 | + v-model="search" | |
184 | + label="Search" | |
185 | + prepend-inner-icon="search" | |
186 | + color="primary" | |
187 | + ></v-text-field> | |
182 | 188 | <v-icon @click="closeSearch" color="error">close</v-icon> |
183 | 189 | </v-layout> |
184 | 190 | </v-flex> |
... | ... | @@ -250,12 +256,12 @@ |
250 | 256 | >Your search for "{{ search }}" found no results.</v-alert> |
251 | 257 | </v-data-table> |
252 | 258 | <!-- ****** ADD Notice Board ****** --> |
253 | - <v-dialog v-model="addNoticeBoardDialog" max-width="600px"> | |
259 | + <v-dialog v-model="addNoticeBoardDialog" max-width="600px" v-if="addNoticeBoardDialog"> | |
254 | 260 | <v-card flat class="card-style pa-2" dark> |
255 | 261 | <v-layout> |
256 | 262 | <v-flex xs12> |
257 | 263 | <label class="title text-xs-center">Add Notice Board</label> |
258 | - <v-icon size="24" class="right" @click="addNoticeBoardDialog = false">cancel</v-icon> | |
264 | + <v-icon size="24" class="right" @click="closeNoticeBoardModel">cancel</v-icon> | |
259 | 265 | </v-flex> |
260 | 266 | </v-layout> |
261 | 267 | <v-container fluid fill-height> |
... | ... | @@ -386,7 +392,7 @@ export default { |
386 | 392 | addSection: [], |
387 | 393 | gender: ["Male", "Female"], |
388 | 394 | pagination: { |
389 | - rowsPerPage: 10 | |
395 | + rowsPerPage: 10, | |
390 | 396 | }, |
391 | 397 | imageName: "", |
392 | 398 | imageUrl: "", |
... | ... | @@ -394,38 +400,48 @@ export default { |
394 | 400 | upload: "", |
395 | 401 | loadingPdf: false, |
396 | 402 | |
397 | - titleRules: [v => !!v || " Title is required"], | |
398 | - descriptionRules: [v => !!v || " Description is required"], | |
403 | + titleRules: [(v) => !!v || " Title is required"], | |
404 | + descriptionRules: [(v) => !!v || " Description is required"], | |
399 | 405 | headers: [ |
400 | 406 | { |
401 | 407 | text: "No", |
402 | 408 | align: "", |
403 | 409 | sortable: false, |
404 | - value: "No" | |
410 | + value: "No", | |
405 | 411 | }, |
406 | 412 | { |
407 | 413 | text: "Event Image", |
408 | 414 | align: "center", |
409 | 415 | sortable: false, |
410 | - value: "eventImageUrl" | |
416 | + value: "eventImageUrl", | |
411 | 417 | }, |
412 | 418 | { text: "Title", value: "title", sortable: false, align: "center" }, |
413 | 419 | { |
414 | 420 | text: "File", |
415 | 421 | value: "eventImageUrl", |
416 | 422 | sortable: false, |
417 | - align: "center" | |
423 | + align: "center", | |
418 | 424 | }, |
419 | - { text: "Action", value: "", sortable: false, align: "center" } | |
425 | + { text: "Action", value: "", sortable: false, align: "center" }, | |
420 | 426 | ], |
421 | 427 | notices: [], |
422 | 428 | editedIndex: -1, |
423 | 429 | addNoticeBoard: {}, |
424 | 430 | editedItem: { |
425 | 431 | title: "", |
426 | - description: "" | |
427 | - } | |
432 | + description: "", | |
433 | + }, | |
428 | 434 | }), |
435 | + watch: { | |
436 | + addNoticeBoardDialog: function (val) { | |
437 | + if (!val) { | |
438 | + this.addNoticeBoard = []; | |
439 | + this.imageName = ""; | |
440 | + this.imageFile = ""; | |
441 | + this.imageUrl = ""; | |
442 | + } | |
443 | + }, | |
444 | + }, | |
429 | 445 | methods: { |
430 | 446 | pickFile() { |
431 | 447 | this.$refs.image.click(); |
... | ... | @@ -435,13 +451,13 @@ export default { |
435 | 451 | var token = this.$store.state.token; |
436 | 452 | http() |
437 | 453 | .get("/getEventsList", { |
438 | - headers: { Authorization: "Bearer " + token } | |
454 | + headers: { Authorization: "Bearer " + token }, | |
439 | 455 | }) |
440 | - .then(response => { | |
456 | + .then((response) => { | |
441 | 457 | this.notices = response.data.data; |
442 | 458 | this.showLoader = false; |
443 | 459 | }) |
444 | - .catch(error => { | |
460 | + .catch((error) => { | |
445 | 461 | this.showLoader = false; |
446 | 462 | if (error.response.status === 401) { |
447 | 463 | this.$router.replace({ path: "/" }); |
... | ... | @@ -462,16 +478,16 @@ export default { |
462 | 478 | }, |
463 | 479 | deleteItem(item) { |
464 | 480 | let deleteEvent = { |
465 | - eventId: item._id | |
481 | + eventId: item._id, | |
466 | 482 | }; |
467 | 483 | http() |
468 | 484 | .delete( |
469 | 485 | "/deleteEvent", |
470 | 486 | confirm("Are you sure you want to delete this?") && { |
471 | - params: deleteEvent | |
487 | + params: deleteEvent, | |
472 | 488 | } |
473 | 489 | ) |
474 | - .then(response => { | |
490 | + .then((response) => { | |
475 | 491 | // console.log("deleteUers",deleteEvent) |
476 | 492 | if ((this.snackbar = true)) { |
477 | 493 | this.text = "Successfully delete Existing Notice Data"; |
... | ... | @@ -480,7 +496,7 @@ export default { |
480 | 496 | this.color = "green"; |
481 | 497 | this.getNoticeDataList(); |
482 | 498 | }) |
483 | - .catch(error => { | |
499 | + .catch((error) => { | |
484 | 500 | // console.log(error); |
485 | 501 | this.snackbar = true; |
486 | 502 | this.text = error.response.data.message; |
... | ... | @@ -490,6 +506,13 @@ export default { |
490 | 506 | close() { |
491 | 507 | this.editNoticeBoardDialog = false; |
492 | 508 | }, |
509 | + closeNoticeBoardModel() { | |
510 | + this.addNoticeBoardDialog = false; | |
511 | + this.addNoticeBoard = []; | |
512 | + this.imageName = ""; | |
513 | + this.imageFile = ""; | |
514 | + this.imageUrl = ""; | |
515 | + }, | |
493 | 516 | submit() { |
494 | 517 | var signatures = { |
495 | 518 | JVBERi0: "other", |
... | ... | @@ -498,7 +521,7 @@ export default { |
498 | 521 | "/": "image", |
499 | 522 | AAABAA: "image", |
500 | 523 | IywiV2hhdC: "other", |
501 | - bmFtZSxl: "other" | |
524 | + bmFtZSxl: "other", | |
502 | 525 | }; |
503 | 526 | function detectMimeType(b64) { |
504 | 527 | for (var s in signatures) { |
... | ... | @@ -513,11 +536,11 @@ export default { |
513 | 536 | const [baseUrl, imageUrl] = str.split(/,/); |
514 | 537 | this.addNoticeBoard.upload = imageUrl; |
515 | 538 | this.addNoticeBoard.fileType = detectMimeType(imageUrl); |
516 | - this.addNoticeBoard.fileName = this.imageName | |
539 | + this.addNoticeBoard.fileName = this.imageName; | |
517 | 540 | } |
518 | 541 | http() |
519 | 542 | .post("/createEvent", this.addNoticeBoard) |
520 | - .then(response => { | |
543 | + .then((response) => { | |
521 | 544 | this.imageUrl = ""; |
522 | 545 | this.snackbar = true; |
523 | 546 | this.color = "green"; |
... | ... | @@ -526,7 +549,7 @@ export default { |
526 | 549 | this.addNoticeBoardDialog = false; |
527 | 550 | this.clear(); |
528 | 551 | }) |
529 | - .catch(error => { | |
552 | + .catch((error) => { | |
530 | 553 | this.snackbar = true; |
531 | 554 | this.text = error.response.data.message; |
532 | 555 | this.color = "error"; |
... | ... | @@ -563,7 +586,7 @@ export default { |
563 | 586 | eventId: this.editedItem._id, |
564 | 587 | title: this.editedItem.title, |
565 | 588 | description: this.editedItem.description, |
566 | - fileName: this.imageName | |
589 | + fileName: this.imageName, | |
567 | 590 | }; |
568 | 591 | var signatures = { |
569 | 592 | JVBERi0: "other", |
... | ... | @@ -571,7 +594,7 @@ export default { |
571 | 594 | UEsDBBQ: "other", |
572 | 595 | "/": "image", |
573 | 596 | AAABAA: "image", |
574 | - IywiV2hhdC: "other" | |
597 | + IywiV2hhdC: "other", | |
575 | 598 | }; |
576 | 599 | function detectMimeType(b64) { |
577 | 600 | for (var s in signatures) { |
... | ... | @@ -588,7 +611,7 @@ export default { |
588 | 611 | } |
589 | 612 | http() |
590 | 613 | .put("/updateEvent", editNoticeBoard) |
591 | - .then(response => { | |
614 | + .then((response) => { | |
592 | 615 | if ((this.snackbar = true)) { |
593 | 616 | this.text = "Successfully Edit Existing Notice Data"; |
594 | 617 | } |
... | ... | @@ -597,7 +620,7 @@ export default { |
597 | 620 | this.getNoticeDataList(); |
598 | 621 | this.close(); |
599 | 622 | }) |
600 | - .catch(error => { | |
623 | + .catch((error) => { | |
601 | 624 | // console.log(error); |
602 | 625 | this.snackbar = true; |
603 | 626 | this.text = error.response.data.message; |
... | ... | @@ -623,10 +646,10 @@ export default { |
623 | 646 | } |
624 | 647 | var FileSaver = require("file-saver"); |
625 | 648 | FileSaver.saveAs(item.eventImageUrl, "image.jpg"); |
626 | - } | |
649 | + }, | |
627 | 650 | }, |
628 | 651 | mounted() { |
629 | 652 | this.getNoticeDataList(); |
630 | - } | |
653 | + }, | |
631 | 654 | }; |
632 | 655 | </script> |
633 | 656 | \ No newline at end of file | ... | ... |
src/pages/Notification/notification.vue
... | ... | @@ -119,9 +119,15 @@ |
119 | 119 | </v-avatar> |
120 | 120 | </v-btn> |
121 | 121 | </v-card-title> |
122 | - <v-flex xs8 sm8 md3 lg2 v-if="showSearch"> | |
122 | + <v-flex xs8 sm8 md3 lg2 v-if="showSearch"> | |
123 | 123 | <v-layout> |
124 | - <v-text-field autofocus v-model="search" label="Search" prepend-inner-icon="search" color="primary"></v-text-field> | |
124 | + <v-text-field | |
125 | + autofocus | |
126 | + v-model="search" | |
127 | + label="Search" | |
128 | + prepend-inner-icon="search" | |
129 | + color="primary" | |
130 | + ></v-text-field> | |
125 | 131 | <v-icon @click="closeSearch" color="error">close</v-icon> |
126 | 132 | </v-layout> |
127 | 133 | </v-flex> |
... | ... | @@ -182,12 +188,12 @@ |
182 | 188 | </v-data-table> |
183 | 189 | |
184 | 190 | <!-- ****** ADD MULTIPLE NOTIFICATION ****** --> |
185 | - <v-dialog v-model="addNotificationDialog" max-width="480px"> | |
191 | + <v-dialog v-model="addNotificationDialog" max-width="480px" v-if="addNotificationDialog"> | |
186 | 192 | <v-card flat class="card-style pa-2" dark> |
187 | 193 | <v-layout> |
188 | 194 | <v-flex xs12> |
189 | 195 | <label class="title text-xs-center">Add Notification</label> |
190 | - <v-icon size="24" class="right" @click="addNotificationDialog = false">cancel</v-icon> | |
196 | + <v-icon size="24" class="right" @click="closeAddNotificationModel">cancel</v-icon> | |
191 | 197 | </v-flex> |
192 | 198 | </v-layout> |
193 | 199 | <v-form ref="form" v-model="valid" lazy-validation> |
... | ... | @@ -283,41 +289,48 @@ export default { |
283 | 289 | valid: true, |
284 | 290 | addNotificationDialog: false, |
285 | 291 | pagination: { |
286 | - rowsPerPage: 10 | |
292 | + rowsPerPage: 10, | |
287 | 293 | }, |
288 | 294 | imageData: {}, |
289 | 295 | imageName: "", |
290 | 296 | imageUrl: "", |
291 | 297 | imageFile: "", |
292 | - titleRules: [v => !!v || " Tilte is required"], | |
293 | - descriptionRules: [v => !!v || " Description is required"], | |
298 | + titleRules: [(v) => !!v || " Tilte is required"], | |
299 | + descriptionRules: [(v) => !!v || " Description is required"], | |
294 | 300 | headers: [ |
295 | 301 | { |
296 | 302 | text: "No", |
297 | 303 | align: "", |
298 | 304 | sortable: false, |
299 | - value: "No" | |
305 | + value: "No", | |
300 | 306 | }, |
301 | 307 | { text: "Title", value: "title", sortable: false, align: "center" }, |
302 | 308 | { |
303 | 309 | text: "Description", |
304 | 310 | value: "description", |
305 | 311 | sortable: false, |
306 | - align: "center" | |
312 | + align: "center", | |
307 | 313 | }, |
308 | - { text: "Action", value: "", sortable: false, align: "center" } | |
314 | + { text: "Action", value: "", sortable: false, align: "center" }, | |
309 | 315 | ], |
310 | 316 | notifications: [], |
311 | 317 | editedIndex: -1, |
312 | 318 | addNotification: { |
313 | 319 | title: "", |
314 | - description: "" | |
320 | + description: "", | |
315 | 321 | }, |
316 | 322 | editedItem: { |
317 | 323 | title: "", |
318 | - description: "" | |
319 | - } | |
324 | + description: "", | |
325 | + }, | |
320 | 326 | }), |
327 | + watch: { | |
328 | + addNotificationDialog: function (val) { | |
329 | + if (!val) { | |
330 | + this.addNotification = []; | |
331 | + } | |
332 | + }, | |
333 | + }, | |
321 | 334 | methods: { |
322 | 335 | pickFile() { |
323 | 336 | this.$refs.image.click(); |
... | ... | @@ -349,13 +362,13 @@ export default { |
349 | 362 | var token = this.$store.state.token; |
350 | 363 | http() |
351 | 364 | .get("/getNotificationsList", { |
352 | - headers: { Authorization: "Bearer " + token } | |
365 | + headers: { Authorization: "Bearer " + token }, | |
353 | 366 | }) |
354 | - .then(response => { | |
367 | + .then((response) => { | |
355 | 368 | this.notifications = response.data.data; |
356 | 369 | this.showLoader = false; |
357 | 370 | }) |
358 | - .catch(error => { | |
371 | + .catch((error) => { | |
359 | 372 | this.showLoader = false; |
360 | 373 | if (error.response.status === 401) { |
361 | 374 | this.$router.replace({ path: "/" }); |
... | ... | @@ -377,22 +390,22 @@ export default { |
377 | 390 | |
378 | 391 | deleteItem(item) { |
379 | 392 | let deleteNotification = { |
380 | - notificationId: item._id | |
393 | + notificationId: item._id, | |
381 | 394 | }; |
382 | 395 | http() |
383 | 396 | .delete( |
384 | 397 | "/deleteNotification", |
385 | 398 | confirm("Are you sure you want to delete this?") && { |
386 | - params: deleteNotification | |
399 | + params: deleteNotification, | |
387 | 400 | } |
388 | 401 | ) |
389 | - .then(response => { | |
402 | + .then((response) => { | |
390 | 403 | this.snackbar = true; |
391 | 404 | this.text = response.data.message; |
392 | 405 | this.color = "green"; |
393 | 406 | this.getNotifications(); |
394 | 407 | }) |
395 | - .catch(error => { | |
408 | + .catch((error) => { | |
396 | 409 | this.snackbar = true; |
397 | 410 | this.text = error.response.data.message; |
398 | 411 | this.color = "error"; |
... | ... | @@ -404,18 +417,22 @@ export default { |
404 | 417 | closeNotificationDialog() { |
405 | 418 | this.profileNotificationDialog = false; |
406 | 419 | }, |
420 | + closeAddNotificationModel() { | |
421 | + this.addNotificationDialog = false; | |
422 | + this.addNotification = []; | |
423 | + }, | |
407 | 424 | submit() { |
408 | 425 | if (this.$refs.form.validate()) { |
409 | 426 | let imageData = new FormData(); |
410 | 427 | imageData.append("upload", this.imageFile); |
411 | 428 | let create = { |
412 | 429 | title: this.addNotification.title, |
413 | - description: this.addNotification.description | |
430 | + description: this.addNotification.description, | |
414 | 431 | }; |
415 | 432 | this.loading = true; |
416 | 433 | http() |
417 | 434 | .post("/createNotification", create) |
418 | - .then(response => { | |
435 | + .then((response) => { | |
419 | 436 | this.snackbar = true; |
420 | 437 | this.text = response.data.message; |
421 | 438 | this.color = "green"; |
... | ... | @@ -424,7 +441,7 @@ export default { |
424 | 441 | this.clear(); |
425 | 442 | this.loading = false; |
426 | 443 | }) |
427 | - .catch(error => { | |
444 | + .catch((error) => { | |
428 | 445 | this.snackbar = true; |
429 | 446 | this.text = error.response.data.message; |
430 | 447 | this.color = "error"; |
... | ... | @@ -441,12 +458,12 @@ export default { |
441 | 458 | let editNotification = { |
442 | 459 | notificationId: this.editedItem._id, |
443 | 460 | title: this.editedItem.title, |
444 | - description: this.editedItem.description | |
461 | + description: this.editedItem.description, | |
445 | 462 | }; |
446 | 463 | this.editLoading = true; |
447 | 464 | http() |
448 | 465 | .put("/updateNotification", editNotification) |
449 | - .then(response => { | |
466 | + .then((response) => { | |
450 | 467 | this.snackbar = true; |
451 | 468 | this.text = response.data.message; |
452 | 469 | this.color = "green"; |
... | ... | @@ -454,7 +471,7 @@ export default { |
454 | 471 | this.close(); |
455 | 472 | this.editLoading = false; |
456 | 473 | }) |
457 | - .catch(error => { | |
474 | + .catch((error) => { | |
458 | 475 | this.editLoading = false; |
459 | 476 | this.snackbar = true; |
460 | 477 | this.color = "error"; |
... | ... | @@ -468,10 +485,10 @@ export default { |
468 | 485 | this.showSearch = false; |
469 | 486 | this.show = true; |
470 | 487 | this.search = ""; |
471 | - } | |
488 | + }, | |
472 | 489 | }, |
473 | 490 | mounted() { |
474 | 491 | this.getNotifications(); |
475 | - } | |
492 | + }, | |
476 | 493 | }; |
477 | 494 | </script> |
478 | 495 | \ No newline at end of file | ... | ... |
src/pages/Parent/parents.vue
... | ... | @@ -564,12 +564,16 @@ |
564 | 564 | </v-data-table> |
565 | 565 | |
566 | 566 | <!-- ******DIALOG BOX - ADD PARENTS DETAILS****** --> |
567 | - <v-dialog v-model="addParentDialog" max-width="1100px"> | |
567 | + <v-dialog v-model="addParentDialog" max-width="1100px" v-if="addParentDialog"> | |
568 | 568 | <v-card flat class="card-style pa-2" dark> |
569 | 569 | <v-layout> |
570 | 570 | <v-flex xs12> |
571 | 571 | <label class="title text-xs-center">Add Parent</label> |
572 | - <v-icon size="24" class="right" @click="$refs.parentForm.reset();addParentDialog = false">cancel</v-icon> | |
572 | + <v-icon | |
573 | + size="24" | |
574 | + class="right" | |
575 | + @click="$refs.parentForm.reset();addParentDialog = false" | |
576 | + >cancel</v-icon> | |
573 | 577 | </v-flex> |
574 | 578 | </v-layout> |
575 | 579 | <v-container fluid fill-height> |
... | ... | @@ -1000,6 +1004,11 @@ export default { |
1000 | 1004 | menu1(val) { |
1001 | 1005 | val && this.$nextTick(() => (this.$refs.picker.activePicker = "YEAR")); |
1002 | 1006 | }, |
1007 | + addParentDialog: function (val) { | |
1008 | + if (!val) { | |
1009 | + this.parentData = []; | |
1010 | + } | |
1011 | + }, | |
1003 | 1012 | }, |
1004 | 1013 | methods: { |
1005 | 1014 | editItem(item) { |
... | ... | @@ -1126,7 +1135,7 @@ export default { |
1126 | 1135 | }); |
1127 | 1136 | }, |
1128 | 1137 | displaySearch() { |
1129 | - this.show = false | |
1138 | + this.show = false; | |
1130 | 1139 | this.showSearch = true; |
1131 | 1140 | // this.$refs.searchField.focus() |
1132 | 1141 | }, | ... | ... |
src/pages/Payroll/hourlyTemplate.vue
... | ... | @@ -80,7 +80,13 @@ |
80 | 80 | </v-card-title> |
81 | 81 | <v-flex xs8 sm8 md3 lg2 v-if="showSearch"> |
82 | 82 | <v-layout> |
83 | - <v-text-field autofocus v-model="search" label="Search" prepend-inner-icon="search" color="primary"></v-text-field> | |
83 | + <v-text-field | |
84 | + autofocus | |
85 | + v-model="search" | |
86 | + label="Search" | |
87 | + prepend-inner-icon="search" | |
88 | + color="primary" | |
89 | + ></v-text-field> | |
84 | 90 | <v-icon @click="closeSearch" color="error">close</v-icon> |
85 | 91 | </v-layout> |
86 | 92 | </v-flex> |
... | ... | @@ -133,12 +139,12 @@ |
133 | 139 | </v-data-table> |
134 | 140 | |
135 | 141 | <!-- **** Add Hourly Template **** --> |
136 | - <v-dialog v-model="addHourDialog" max-width="400px"> | |
142 | + <v-dialog v-model="addHourDialog" max-width="400px" v-if="addHourDialog"> | |
137 | 143 | <v-card flat class="card-style pa-2" dark> |
138 | 144 | <v-layout> |
139 | 145 | <v-flex xs12> |
140 | 146 | <label class="title text-xs-center">Add Hourly Template</label> |
141 | - <v-icon size="24" class="right" @click="addHourDialog = false">cancel</v-icon> | |
147 | + <v-icon size="24" class="right" @click="closeAddHourModel">cancel</v-icon> | |
142 | 148 | </v-flex> |
143 | 149 | </v-layout> |
144 | 150 | <v-form ref="form" v-model="valid" lazy-validation> |
... | ... | @@ -231,51 +237,63 @@ export default { |
231 | 237 | valid: true, |
232 | 238 | disabled: true, |
233 | 239 | pagination: { |
234 | - rowsPerPage: 10 | |
240 | + rowsPerPage: 10, | |
235 | 241 | }, |
236 | - hourRules: [v => !!v || "Field is required"], | |
242 | + hourRules: [(v) => !!v || "Field is required"], | |
237 | 243 | |
238 | 244 | headers: [ |
239 | 245 | { |
240 | 246 | align: "", |
241 | 247 | text: "No", |
242 | 248 | sortable: false, |
243 | - value: "No" | |
249 | + value: "No", | |
244 | 250 | }, |
245 | 251 | { |
246 | 252 | text: "Hourly Grades", |
247 | 253 | value: "hourlyGrades", |
248 | 254 | sortable: false, |
249 | - align: "center" | |
255 | + align: "center", | |
250 | 256 | }, |
251 | 257 | { |
252 | 258 | text: "Hourly Rate", |
253 | 259 | value: "hourlyRate", |
254 | 260 | sortable: false, |
255 | - align: "center" | |
261 | + align: "center", | |
256 | 262 | }, |
257 | - { text: "Action", value: "", sortable: false, align: "center" } | |
263 | + { text: "Action", value: "", sortable: false, align: "center" }, | |
258 | 264 | ], |
259 | 265 | hourlyTypes: [], |
260 | 266 | hourlyData: [], |
261 | - editedItem: {} | |
267 | + editedItem: {}, | |
262 | 268 | }), |
269 | + watch: { | |
270 | + addHourDialog: function (val) { | |
271 | + if (!val) { | |
272 | + this.hourlyTypes = []; | |
273 | + } | |
274 | + }, | |
275 | + }, | |
263 | 276 | methods: { |
264 | - close() { | |
277 | + close() { | |
265 | 278 | this.editHourDialog = false; |
266 | 279 | }, |
280 | + closeAddHourModel() { | |
281 | + this.addHourDialog = false; | |
282 | + this.hourlyData = []; | |
283 | + this.hourlyTypes = []; | |
284 | + }, | |
267 | 285 | submit() { |
268 | 286 | var Hour = { |
269 | 287 | hourlyGrades: this.hourlyTypes.hourlyGrades, |
270 | - hourlyRate: this.hourlyTypes.hourlyRate | |
288 | + hourlyRate: this.hourlyTypes.hourlyRate, | |
271 | 289 | }; |
272 | 290 | if (this.$refs.form.validate()) { |
273 | 291 | this.loading = true; |
274 | 292 | http() |
275 | 293 | .post("/createHourly", Hour, { |
276 | - headers: { Authorization: "Bearer " + this.token } | |
294 | + headers: { Authorization: "Bearer " + this.token }, | |
277 | 295 | }) |
278 | - .then(response => { | |
296 | + .then((response) => { | |
279 | 297 | this.snackbar = true; |
280 | 298 | this.text = response.data.message; |
281 | 299 | this.getHourlyList(); |
... | ... | @@ -285,7 +303,7 @@ export default { |
285 | 303 | this.clear(); |
286 | 304 | this.loading = false; |
287 | 305 | }) |
288 | - .catch(error => { | |
306 | + .catch((error) => { | |
289 | 307 | console.log("error", error); |
290 | 308 | this.snackbar = true; |
291 | 309 | this.color = "red"; |
... | ... | @@ -299,14 +317,14 @@ export default { |
299 | 317 | this.loadingSearch = true; |
300 | 318 | http() |
301 | 319 | .get("/getHourlyList", { |
302 | - headers: { Authorization: "Bearer " + this.token } | |
320 | + headers: { Authorization: "Bearer " + this.token }, | |
303 | 321 | }) |
304 | - .then(response => { | |
322 | + .then((response) => { | |
305 | 323 | this.hourlyData = response.data.data; |
306 | 324 | this.showLoader = false; |
307 | 325 | this.loadingSearch = false; |
308 | 326 | }) |
309 | - .catch(error => { | |
327 | + .catch((error) => { | |
310 | 328 | // console.log("err====>", err); |
311 | 329 | this.showLoader = false; |
312 | 330 | this.loadingSearch = false; |
... | ... | @@ -327,28 +345,28 @@ export default { |
327 | 345 | }, |
328 | 346 | deleteItem(item) { |
329 | 347 | let deleteGrade = { |
330 | - hourlyId: item._id | |
348 | + hourlyId: item._id, | |
331 | 349 | }; |
332 | 350 | http() |
333 | 351 | .delete( |
334 | 352 | "/deleteHourly", |
335 | 353 | confirm("Are you sure you want to delete this?") && { |
336 | - params: deleteGrade | |
354 | + params: deleteGrade, | |
337 | 355 | }, |
338 | 356 | { |
339 | 357 | headers: { |
340 | - Authorization: "Bearer " + this.token | |
341 | - } | |
358 | + Authorization: "Bearer " + this.token, | |
359 | + }, | |
342 | 360 | } |
343 | 361 | ) |
344 | - .then(response => { | |
362 | + .then((response) => { | |
345 | 363 | this.snackbar = true; |
346 | - // this.text = "Successfully Delete Salary "; | |
364 | + // this.text = "Successfully Delete Salary "; | |
347 | 365 | this.text = response.data.message; |
348 | 366 | this.color = "green"; |
349 | 367 | this.getHourlyList(); |
350 | 368 | }) |
351 | - .catch(error => { | |
369 | + .catch((error) => { | |
352 | 370 | console.log("error", error); |
353 | 371 | this.snackbar = true; |
354 | 372 | this.text = error.response.data.message; |
... | ... | @@ -357,19 +375,19 @@ export default { |
357 | 375 | }, |
358 | 376 | |
359 | 377 | save() { |
360 | - var updateHourly = { | |
361 | - hourlyId: this.editedItem._id, | |
362 | - hourlyGrades: this.editedItem.hourlyGrades, | |
363 | - hourlyRate: this.editedItem.hourlyRate, | |
364 | - }; | |
378 | + var updateHourly = { | |
379 | + hourlyId: this.editedItem._id, | |
380 | + hourlyGrades: this.editedItem.hourlyGrades, | |
381 | + hourlyRate: this.editedItem.hourlyRate, | |
382 | + }; | |
365 | 383 | http() |
366 | 384 | .put("/updateHourly", updateHourly, { |
367 | 385 | headers: { |
368 | - Authorization: "Bearer " + this.token | |
369 | - } | |
386 | + Authorization: "Bearer " + this.token, | |
387 | + }, | |
370 | 388 | }) |
371 | - .then(response => { | |
372 | - // this.text = "Successfully Edit Notification"; | |
389 | + .then((response) => { | |
390 | + // this.text = "Successfully Edit Notification"; | |
373 | 391 | this.getHourlyList(); |
374 | 392 | this.close(); |
375 | 393 | this.snackbar = true; |
... | ... | @@ -377,10 +395,10 @@ export default { |
377 | 395 | this.color = "green"; |
378 | 396 | this.editHourDialog = false; |
379 | 397 | }) |
380 | - .catch(error => { | |
398 | + .catch((error) => { | |
381 | 399 | console.log("error", error); |
382 | 400 | this.snackbar = true; |
383 | - // this.text = error.response.data.message; | |
401 | + // this.text = error.response.data.message; | |
384 | 402 | this.color = "red"; |
385 | 403 | }); |
386 | 404 | }, |
... | ... | @@ -395,12 +413,12 @@ export default { |
395 | 413 | }, |
396 | 414 | clear() { |
397 | 415 | this.$refs.form.reset(); |
398 | - } | |
416 | + }, | |
399 | 417 | }, |
400 | 418 | mounted() { |
401 | 419 | this.token = this.$store.state.token; |
402 | 420 | this.getHourlyList(); |
403 | - } | |
421 | + }, | |
404 | 422 | }; |
405 | 423 | </script> |
406 | 424 | ... | ... |
src/pages/Payroll/salaryTemplate.vue
... | ... | @@ -333,31 +333,31 @@ |
333 | 333 | </v-flex> |
334 | 334 | </v-layout> |
335 | 335 | <!-- <v-flex xs12 sm12 md6> --> |
336 | - <v-card flat> | |
337 | - <v-toolbar dark class="card-styles" flat> | |
338 | - <v-spacer></v-spacer> | |
339 | - <h3>Deduction</h3> | |
340 | - <v-spacer></v-spacer> | |
341 | - </v-toolbar> | |
342 | - <v-layout v-for="(editedItem,index) in editedItem.deduction" :key="index"> | |
343 | - <v-flex xs4 class="mt-4 hidden-xs-only hidden-sm-only"> | |
344 | - <v-text-field | |
345 | - solo | |
346 | - readonly | |
347 | - label="Enter Deduction Label" | |
348 | - v-model="editedItem.deductionName" | |
349 | - ></v-text-field> | |
350 | - </v-flex> | |
351 | - <v-flex xs8 sm4 class="mt-4 hidden-xs-only hidden-sm-only"> | |
352 | - <v-text-field | |
353 | - solo | |
354 | - readonly | |
355 | - label="Enter Deduction Value" | |
356 | - v-model="editedItem.deductionValue" | |
357 | - ></v-text-field> | |
358 | - </v-flex> | |
359 | - </v-layout> | |
360 | - </v-card> | |
336 | + <v-card flat> | |
337 | + <v-toolbar dark class="card-styles" flat> | |
338 | + <v-spacer></v-spacer> | |
339 | + <h3>Deduction</h3> | |
340 | + <v-spacer></v-spacer> | |
341 | + </v-toolbar> | |
342 | + <v-layout v-for="(editedItem,index) in editedItem.deduction" :key="index"> | |
343 | + <v-flex xs4 class="mt-4 hidden-xs-only hidden-sm-only"> | |
344 | + <v-text-field | |
345 | + solo | |
346 | + readonly | |
347 | + label="Enter Deduction Label" | |
348 | + v-model="editedItem.deductionName" | |
349 | + ></v-text-field> | |
350 | + </v-flex> | |
351 | + <v-flex xs8 sm4 class="mt-4 hidden-xs-only hidden-sm-only"> | |
352 | + <v-text-field | |
353 | + solo | |
354 | + readonly | |
355 | + label="Enter Deduction Value" | |
356 | + v-model="editedItem.deductionValue" | |
357 | + ></v-text-field> | |
358 | + </v-flex> | |
359 | + </v-layout> | |
360 | + </v-card> | |
361 | 361 | <!-- </v-flex> --> |
362 | 362 | </v-card> |
363 | 363 | </v-flex> |
... | ... | @@ -420,7 +420,9 @@ |
420 | 420 | </v-flex> |
421 | 421 | <v-flex xs8 sm7 class="mt-4 hidden-xs-only hidden-sm-only"> |
422 | 422 | <v-flex xs8 sm7 class="ml-3"> |
423 | - <b> <v-text-field v-model="editedItem.netSalary" solo readonly></v-text-field></b> | |
423 | + <b> | |
424 | + <v-text-field v-model="editedItem.netSalary" solo readonly></v-text-field> | |
425 | + </b> | |
424 | 426 | </v-flex> |
425 | 427 | </v-flex> |
426 | 428 | </v-layout> |
... | ... | @@ -461,7 +463,13 @@ |
461 | 463 | </v-card-title> |
462 | 464 | <v-flex xs8 sm8 md3 lg2 v-if="showSearch"> |
463 | 465 | <v-layout> |
464 | - <v-text-field autofocus v-model="search" label="Search" prepend-inner-icon="search" color="primary"></v-text-field> | |
466 | + <v-text-field | |
467 | + autofocus | |
468 | + v-model="search" | |
469 | + label="Search" | |
470 | + prepend-inner-icon="search" | |
471 | + color="primary" | |
472 | + ></v-text-field> | |
465 | 473 | <v-icon @click="closeSearch" color="error">close</v-icon> |
466 | 474 | </v-layout> |
467 | 475 | </v-flex> |
... | ... | @@ -523,12 +531,12 @@ |
523 | 531 | </v-data-table> |
524 | 532 | |
525 | 533 | <!-- ****** ADD SALARY ****** --> |
526 | - <v-dialog v-model="addSalaryDialog"> | |
534 | + <v-dialog v-model="addSalaryDialog" v-if="addSalaryDialog"> | |
527 | 535 | <v-card flat class="text-xs-center white--text"> |
528 | 536 | <v-layout> |
529 | 537 | <v-flex xs12 class="card-style pa-2"> |
530 | 538 | <label class="title text-xs-center">Add Salary</label> |
531 | - <v-icon size="24" color="white" class="right" @click="addSalaryDialog = false">cancel</v-icon> | |
539 | + <v-icon size="24" color="white" class="right" @click="closeAddSalaryModel">cancel</v-icon> | |
532 | 540 | </v-flex> |
533 | 541 | </v-layout> |
534 | 542 | |
... | ... | @@ -801,22 +809,22 @@ export default { |
801 | 809 | showAllowances: false, |
802 | 810 | showDeduction: false, |
803 | 811 | pagination: { |
804 | - rowsPerPage: 10 | |
812 | + rowsPerPage: 10, | |
805 | 813 | }, |
806 | 814 | salaryTypes: [], |
807 | 815 | salaryTypeData: [ |
808 | 816 | { |
809 | 817 | allowancesValue: "", |
810 | 818 | allowancesName: "House Rent", |
811 | - totalAllowances: 0 | |
812 | - } | |
819 | + totalAllowances: 0, | |
820 | + }, | |
813 | 821 | ], |
814 | 822 | salaryTypeDeductionData: [ |
815 | 823 | { |
816 | 824 | deductionValue: "", |
817 | 825 | deductionName: "Provident fund", |
818 | - totalDeductions: 0 | |
819 | - } | |
826 | + totalDeductions: 0, | |
827 | + }, | |
820 | 828 | ], |
821 | 829 | grossSalary: 0, |
822 | 830 | totalDeduction: 0, |
... | ... | @@ -825,58 +833,81 @@ export default { |
825 | 833 | salaryGrades: "", |
826 | 834 | allowancesValue: "", |
827 | 835 | deductionValue: "", |
828 | - overtimeRate: "" | |
836 | + overtimeRate: "", | |
829 | 837 | }, |
830 | 838 | |
831 | - basicRules: [v => !!v || " Basic Salary is required"], | |
832 | - salaryRules: [v => !!v || "Salary Grades is required"], | |
833 | - overtimeRules: [v => !!v || "Overtime Rate is required"], | |
839 | + basicRules: [(v) => !!v || " Basic Salary is required"], | |
840 | + salaryRules: [(v) => !!v || "Salary Grades is required"], | |
841 | + overtimeRules: [(v) => !!v || "Overtime Rate is required"], | |
834 | 842 | |
835 | 843 | headers: [ |
836 | 844 | { |
837 | 845 | align: "", |
838 | 846 | text: "No", |
839 | 847 | sortable: false, |
840 | - value: "No" | |
848 | + value: "No", | |
841 | 849 | }, |
842 | 850 | { |
843 | 851 | text: "Salary Grades", |
844 | 852 | value: "salaryGrades", |
845 | 853 | sortable: false, |
846 | - align: "center" | |
854 | + align: "center", | |
847 | 855 | }, |
848 | 856 | { |
849 | 857 | text: "Basic Salary", |
850 | 858 | value: "basicSalary", |
851 | 859 | sortable: false, |
852 | - align: "center" | |
860 | + align: "center", | |
853 | 861 | }, |
854 | 862 | { |
855 | 863 | text: "Overtime Rate", |
856 | 864 | value: "overtimeRate", |
857 | 865 | sortable: false, |
858 | - align: "center" | |
866 | + align: "center", | |
859 | 867 | }, |
860 | - { text: "Action", value: "", sortable: false, align: "center" } | |
868 | + { text: "Action", value: "", sortable: false, align: "center" }, | |
861 | 869 | ], |
862 | 870 | salaryData: [], |
863 | 871 | editedItem: {}, |
864 | - token: "" | |
872 | + token: "", | |
865 | 873 | }), |
874 | + watch: { | |
875 | + addSalaryDialog: function (val) { | |
876 | + if (!val) { | |
877 | + this.salaryType = []; | |
878 | + this.grossSalary = 0; | |
879 | + this.totalDeduction = 0; | |
880 | + (this.salaryTypeData = [ | |
881 | + { | |
882 | + allowancesValue: "", | |
883 | + allowancesName: "", | |
884 | + totalAllowances: 0, | |
885 | + }, | |
886 | + ]), | |
887 | + (this.salaryTypeDeductionData = [ | |
888 | + { | |
889 | + deductionValue: "", | |
890 | + deductionName: "", | |
891 | + totalDeductions: 0, | |
892 | + }, | |
893 | + ]); | |
894 | + } | |
895 | + }, | |
896 | + }, | |
866 | 897 | methods: { |
867 | 898 | getSalaryList() { |
868 | 899 | this.showLoader = true; |
869 | 900 | this.loadingSearch = true; |
870 | 901 | http() |
871 | 902 | .get("/getSalaryList", { |
872 | - headers: { Authorization: "Bearer " + this.token } | |
903 | + headers: { Authorization: "Bearer " + this.token }, | |
873 | 904 | }) |
874 | - .then(response => { | |
905 | + .then((response) => { | |
875 | 906 | this.salaryData = response.data.data; |
876 | 907 | this.showLoader = false; |
877 | 908 | this.loadingSearch = false; |
878 | 909 | }) |
879 | - .catch(error => { | |
910 | + .catch((error) => { | |
880 | 911 | // console.log("err====>", err); |
881 | 912 | this.showLoader = false; |
882 | 913 | this.loadingSearch = false; |
... | ... | @@ -905,26 +936,26 @@ export default { |
905 | 936 | }, |
906 | 937 | deleteItem(item) { |
907 | 938 | let Salary = { |
908 | - salaryId: item._id | |
939 | + salaryId: item._id, | |
909 | 940 | }; |
910 | 941 | http() |
911 | 942 | .delete( |
912 | 943 | "/deleteSalary", |
913 | 944 | confirm("Are you sure you want to Delete this?") && { |
914 | - params: Salary | |
945 | + params: Salary, | |
915 | 946 | }, |
916 | 947 | { |
917 | - headers: { Authorization: "Bearer " + this.token } | |
948 | + headers: { Authorization: "Bearer " + this.token }, | |
918 | 949 | } |
919 | 950 | ) |
920 | - .then(response => { | |
951 | + .then((response) => { | |
921 | 952 | this.snackbar = true; |
922 | 953 | this.text = "Successfully Delete Salary "; |
923 | 954 | this.text = response.data.message; |
924 | 955 | this.color = "green"; |
925 | 956 | this.getSalaryList(); |
926 | 957 | }) |
927 | - .catch(error => { | |
958 | + .catch((error) => { | |
928 | 959 | this.snackbar = true; |
929 | 960 | this.text = error.response.data.message; |
930 | 961 | this.color = "red"; |
... | ... | @@ -933,6 +964,27 @@ export default { |
933 | 964 | close() { |
934 | 965 | this.editSalaryDialog = false; |
935 | 966 | }, |
967 | + closeAddSalaryModel() { | |
968 | + this.addSalaryDialog = false; | |
969 | + this.salaryData = []; | |
970 | + this.salaryType = []; | |
971 | + this.grossSalary = 0; | |
972 | + this.totalDeduction = 0; | |
973 | + (this.salaryTypeData = [ | |
974 | + { | |
975 | + allowancesValue: "", | |
976 | + allowancesName: "", | |
977 | + totalAllowances: 0, | |
978 | + }, | |
979 | + ]), | |
980 | + (this.salaryTypeDeductionData = [ | |
981 | + { | |
982 | + deductionValue: "", | |
983 | + deductionName: "", | |
984 | + totalDeductions: 0, | |
985 | + }, | |
986 | + ]); | |
987 | + }, | |
936 | 988 | submit() { |
937 | 989 | var salary = { |
938 | 990 | salaryGrades: this.salaryType.salaryGrades, |
... | ... | @@ -942,14 +994,14 @@ export default { |
942 | 994 | deduction: this.salaryTypeDeductionData, |
943 | 995 | grossSalary: this.grossSalary, |
944 | 996 | totalDeduction: this.totalDeduction, |
945 | - netSalary: this.salaryType.netSalary | |
997 | + netSalary: this.salaryType.netSalary, | |
946 | 998 | }; |
947 | 999 | if (this.$refs.form.validate()) { |
948 | 1000 | this.loading = true; |
949 | 1001 | // console.log("api data", this.salaryType); |
950 | 1002 | http() |
951 | 1003 | .post("/createSalary", salary) |
952 | - .then(response => { | |
1004 | + .then((response) => { | |
953 | 1005 | // console.log("response", response); |
954 | 1006 | this.snackbar = true; |
955 | 1007 | this.text = "Successfully Created Salary "; |
... | ... | @@ -966,7 +1018,7 @@ export default { |
966 | 1018 | this.loading = false; |
967 | 1019 | this.clear(); |
968 | 1020 | }) |
969 | - .catch(error => { | |
1021 | + .catch((error) => { | |
970 | 1022 | console.log("error", error); |
971 | 1023 | this.snackbar = true; |
972 | 1024 | this.text = error.response.data.message; |
... | ... | @@ -977,11 +1029,11 @@ export default { |
977 | 1029 | }, |
978 | 1030 | selectAllowances() { |
979 | 1031 | this.salaryTypeData.push({ |
980 | - allowancesValue: (this.salaryType.allowancesValue = "") | |
1032 | + allowancesValue: (this.salaryType.allowancesValue = ""), | |
981 | 1033 | }); |
982 | 1034 | // console.log("this.salaryTypeData", this.salaryTypeData); |
983 | 1035 | var totalAllowances = ""; |
984 | - this.salaryTypeData.forEach(allowancesValue_ => { | |
1036 | + this.salaryTypeData.forEach((allowancesValue_) => { | |
985 | 1037 | if (allowancesValue_.allowancesValue != "") { |
986 | 1038 | // console.log("allowances", allowancesValue_.allowancesValue); |
987 | 1039 | totalAllowances = |
... | ... | @@ -993,10 +1045,10 @@ export default { |
993 | 1045 | }, |
994 | 1046 | allowancesAdd() { |
995 | 1047 | this.editedItem.allowances.push({ |
996 | - allowancesValue: (this.salaryType.allowancesValue = "") | |
1048 | + allowancesValue: (this.salaryType.allowancesValue = ""), | |
997 | 1049 | }); |
998 | 1050 | var totalAllowances = ""; |
999 | - this.editedItem.allowances.forEach(allowancesValue_ => { | |
1051 | + this.editedItem.allowances.forEach((allowancesValue_) => { | |
1000 | 1052 | if (allowancesValue_.allowancesValue != "") { |
1001 | 1053 | // console.log("allowances", allowancesValue_.allowancesValue); |
1002 | 1054 | totalAllowances = |
... | ... | @@ -1005,15 +1057,15 @@ export default { |
1005 | 1057 | } |
1006 | 1058 | this.editedItem.grossSalary = |
1007 | 1059 | totalAllowances + Number(this.editedItem.basicSalary); |
1008 | - console.log("this.editedItem.grossSalary", this.editedItem.grossSalary); | |
1060 | + console.log("this.editedItem.grossSalary", this.editedItem.grossSalary); | |
1009 | 1061 | }); |
1010 | 1062 | }, |
1011 | 1063 | selectDeduction() { |
1012 | 1064 | this.salaryTypeDeductionData.push({ |
1013 | - deductionValue: (this.salaryType.deductionValue = "") | |
1065 | + deductionValue: (this.salaryType.deductionValue = ""), | |
1014 | 1066 | }); |
1015 | 1067 | var totalDeductions = ""; |
1016 | - this.salaryTypeDeductionData.forEach(deductionValue_ => { | |
1068 | + this.salaryTypeDeductionData.forEach((deductionValue_) => { | |
1017 | 1069 | if (deductionValue_.deductionValue != "") { |
1018 | 1070 | // console.log("deduction", deductionValue_.deductionValue); |
1019 | 1071 | totalDeductions = |
... | ... | @@ -1023,10 +1075,10 @@ export default { |
1023 | 1075 | }, |
1024 | 1076 | deductionAdd() { |
1025 | 1077 | this.editedItem.deduction.push({ |
1026 | - deductionValue: (this.salaryType.deductionValue = "") | |
1078 | + deductionValue: (this.salaryType.deductionValue = ""), | |
1027 | 1079 | }); |
1028 | 1080 | var totalDeductions = ""; |
1029 | - this.editedItem.deduction.forEach(deductionValue_ => { | |
1081 | + this.editedItem.deduction.forEach((deductionValue_) => { | |
1030 | 1082 | if (deductionValue_.deductionValue != "") { |
1031 | 1083 | // console.log("deduction", deductionValue_.deductionValue); |
1032 | 1084 | totalDeductions = |
... | ... | @@ -1037,16 +1089,16 @@ export default { |
1037 | 1089 | // console.log("this.totalDeduction", this.editedItem.totalDeduction); |
1038 | 1090 | }); |
1039 | 1091 | }, |
1040 | - deleteSelectAllowances: function(index) { | |
1092 | + deleteSelectAllowances: function (index) { | |
1041 | 1093 | this.salaryTypeData.splice(index, 1); |
1042 | 1094 | }, |
1043 | - deleteallowancesAdd: function(index) { | |
1095 | + deleteallowancesAdd: function (index) { | |
1044 | 1096 | this.editedItem.allowances.splice(index, 1); |
1045 | 1097 | }, |
1046 | - deleteSelectDeduction: function(index) { | |
1098 | + deleteSelectDeduction: function (index) { | |
1047 | 1099 | this.salaryTypeDeductionData.splice(index, 1); |
1048 | 1100 | }, |
1049 | - deletedeductionAdd: function(index) { | |
1101 | + deletedeductionAdd: function (index) { | |
1050 | 1102 | this.editedItem.deduction.splice(index, 1); |
1051 | 1103 | }, |
1052 | 1104 | clear() { |
... | ... | @@ -1063,18 +1115,18 @@ export default { |
1063 | 1115 | deduction: this.salaryTypeDeductionData, |
1064 | 1116 | grossSalary: this.editedItem.grossSalary, |
1065 | 1117 | totalDeduction: this.editedItem.totalDeduction, |
1066 | - netSalary: this.editedItem.netSalary | |
1118 | + netSalary: this.editedItem.netSalary, | |
1067 | 1119 | }; |
1068 | 1120 | http() |
1069 | 1121 | .put("/updateSalary", updateSalary) |
1070 | - .then(response => { | |
1122 | + .then((response) => { | |
1071 | 1123 | this.snackbar = true; |
1072 | 1124 | this.text = response.data.message; |
1073 | 1125 | this.color = "green"; |
1074 | 1126 | this.getSalaryList(); |
1075 | 1127 | this.close(); |
1076 | 1128 | }) |
1077 | - .catch(error => { | |
1129 | + .catch((error) => { | |
1078 | 1130 | this.snackbar = true; |
1079 | 1131 | this.text = error.response.data.message; |
1080 | 1132 | this.color = "red"; |
... | ... | @@ -1088,14 +1140,14 @@ export default { |
1088 | 1140 | this.show = true; |
1089 | 1141 | this.search = ""; |
1090 | 1142 | }, |
1091 | - addSalary: function() { | |
1143 | + addSalary: function () { | |
1092 | 1144 | var showSalary = this.salaryType.basicSalary; |
1093 | 1145 | this.grossSalary = showSalary; |
1094 | 1146 | // console.log("salary", this.grossSalary); |
1095 | 1147 | }, |
1096 | - addAllowances: function() { | |
1148 | + addAllowances: function () { | |
1097 | 1149 | var totalAllowances = ""; |
1098 | - this.salaryTypeData.forEach(allowancesValue_ => { | |
1150 | + this.salaryTypeData.forEach((allowancesValue_) => { | |
1099 | 1151 | if (allowancesValue_.allowancesValue != "") { |
1100 | 1152 | totalAllowances = |
1101 | 1153 | Number(totalAllowances) + Number(allowancesValue_.allowancesValue); |
... | ... | @@ -1106,9 +1158,9 @@ export default { |
1106 | 1158 | Number(this.salaryType.allowancesValue); |
1107 | 1159 | }); |
1108 | 1160 | }, |
1109 | - addAllowancesValue: function() { | |
1161 | + addAllowancesValue: function () { | |
1110 | 1162 | var totalAllowances = ""; |
1111 | - this.editedItem.allowances.forEach(allowancesValue_ => { | |
1163 | + this.editedItem.allowances.forEach((allowancesValue_) => { | |
1112 | 1164 | if (allowancesValue_.allowancesValue != "") { |
1113 | 1165 | totalAllowances = |
1114 | 1166 | Number(totalAllowances) + Number(allowancesValue_.allowancesValue); |
... | ... | @@ -1119,13 +1171,13 @@ export default { |
1119 | 1171 | Number(this.editedItem.allowancesValue); |
1120 | 1172 | }); |
1121 | 1173 | }, |
1122 | - addDeduction: function() { | |
1174 | + addDeduction: function () { | |
1123 | 1175 | // console.log( |
1124 | 1176 | // "this.salaryType.deductionValue", |
1125 | 1177 | // this.salaryType.deductionValue |
1126 | 1178 | // ); |
1127 | 1179 | var totalDeductions = ""; |
1128 | - this.salaryTypeDeductionData.forEach(deductionValue_ => { | |
1180 | + this.salaryTypeDeductionData.forEach((deductionValue_) => { | |
1129 | 1181 | if (deductionValue_.deductionValue != "") { |
1130 | 1182 | totalDeductions = |
1131 | 1183 | Number(totalDeductions) + Number(deductionValue_.deductionValue); |
... | ... | @@ -1135,9 +1187,9 @@ export default { |
1135 | 1187 | this.totalDeduction = totalDeductions; |
1136 | 1188 | this.salaryType.netSalary = this.grossSalary - this.totalDeduction; |
1137 | 1189 | }, |
1138 | - addDeductionValue: function() { | |
1190 | + addDeductionValue: function () { | |
1139 | 1191 | var totalDeductions = ""; |
1140 | - this.editedItem.deduction.forEach(deductionValue_ => { | |
1192 | + this.editedItem.deduction.forEach((deductionValue_) => { | |
1141 | 1193 | if (deductionValue_.deductionValue != "") { |
1142 | 1194 | totalDeductions = |
1143 | 1195 | Number(totalDeductions) + Number(deductionValue_.deductionValue); |
... | ... | @@ -1148,13 +1200,13 @@ export default { |
1148 | 1200 | this.editedItem.totalDeduction = totalDeductions; |
1149 | 1201 | this.editedItem.netSalary = |
1150 | 1202 | this.editedItem.grossSalary - this.editedItem.totalDeduction; |
1151 | - } | |
1203 | + }, | |
1152 | 1204 | }, |
1153 | 1205 | |
1154 | 1206 | mounted() { |
1155 | 1207 | this.token = this.$store.state.token; |
1156 | 1208 | this.getSalaryList(); |
1157 | - } | |
1209 | + }, | |
1158 | 1210 | }; |
1159 | 1211 | </script> |
1160 | 1212 | ... | ... |
src/pages/Section/section.vue
... | ... | @@ -167,7 +167,7 @@ |
167 | 167 | <v-flex xs8 v-if="showSearch"> |
168 | 168 | <v-layout> |
169 | 169 | <v-text-field |
170 | - autofocus | |
170 | + autofocus | |
171 | 171 | v-model="search" |
172 | 172 | label="Search" |
173 | 173 | prepend-inner-icon="search" |
... | ... | @@ -221,7 +221,7 @@ |
221 | 221 | class="mr-3" |
222 | 222 | /> |
223 | 223 | <span>Delete</span> |
224 | - </v-tooltip> --> | |
224 | + </v-tooltip>--> | |
225 | 225 | </span> |
226 | 226 | </td> |
227 | 227 | </tr> |
... | ... | @@ -236,12 +236,16 @@ |
236 | 236 | <!-- </v-tab-item> --> |
237 | 237 | |
238 | 238 | <!-- DIALOG BOX - ADD Students Dialog box --> |
239 | - <v-dialog v-model="addSectionDialog" max-width="400px"> | |
239 | + <v-dialog v-model="addSectionDialog" max-width="400px" v-if="addSectionDialog"> | |
240 | 240 | <v-card flat class="card-style pa-2" dark> |
241 | 241 | <v-layout> |
242 | 242 | <v-flex xs12> |
243 | 243 | <label class="title text-xs-center">Add Section</label> |
244 | - <v-icon size="24" class="right" @click="$refs.form.reset();addSectionDialog = false">cancel</v-icon> | |
244 | + <v-icon | |
245 | + size="24" | |
246 | + class="right" | |
247 | + @click="$refs.form.reset();addSectionDialog = false" | |
248 | + >cancel</v-icon> | |
245 | 249 | </v-flex> |
246 | 250 | </v-layout> |
247 | 251 | <v-container fluid fill-height> |
... | ... | @@ -368,29 +372,29 @@ export default { |
368 | 372 | editLoading: false, |
369 | 373 | details: [], |
370 | 374 | pagination: { |
371 | - rowsPerPage: 10 | |
375 | + rowsPerPage: 10, | |
372 | 376 | }, |
373 | - nameRules: [v => !!v || " Section Name is required"], | |
374 | - classRules: [v => !!v || " Class Name is required"], | |
375 | - sessionRules: [v => !!v || " Session is required"], | |
376 | - inchargeRules: [v => !!v || " Incharge Name is required"], | |
377 | + nameRules: [(v) => !!v || " Section Name is required"], | |
378 | + classRules: [(v) => !!v || " Class Name is required"], | |
379 | + sessionRules: [(v) => !!v || " Session is required"], | |
380 | + inchargeRules: [(v) => !!v || " Incharge Name is required"], | |
377 | 381 | SectionName: ["A", "B", "C", "D", "E", "F"], |
378 | 382 | headers: [ |
379 | 383 | { |
380 | 384 | text: "No", |
381 | 385 | align: "", |
382 | 386 | sortable: false, |
383 | - value: "No" | |
387 | + value: "No", | |
384 | 388 | }, |
385 | 389 | { |
386 | 390 | text: "Class Name", |
387 | 391 | value: "classData.classNum", |
388 | 392 | sortable: false, |
389 | - align: "center" | |
393 | + align: "center", | |
390 | 394 | }, |
391 | 395 | { text: "Section Name", value: "name", sortable: false, align: "center" }, |
392 | 396 | { text: "Session", value: "session", sortable: false, align: "center" }, |
393 | - { text: "Action", value: "", sortable: false, align: "center" } | |
397 | + { text: "Action", value: "", sortable: false, align: "center" }, | |
394 | 398 | ], |
395 | 399 | sectionList: [], |
396 | 400 | addclass: [], |
... | ... | @@ -401,34 +405,41 @@ export default { |
401 | 405 | editedIndex: -1, |
402 | 406 | editedItem: { |
403 | 407 | classData: { |
404 | - classNum: "" | |
408 | + classNum: "", | |
405 | 409 | }, |
406 | 410 | teacherData: [ |
407 | 411 | { |
408 | - name: "" | |
409 | - } | |
410 | - ] | |
412 | + name: "", | |
413 | + }, | |
414 | + ], | |
411 | 415 | // name: "", |
412 | 416 | // session: new Date().getFullYear() |
413 | 417 | }, |
414 | 418 | sectionData: { |
415 | - session: new Date().getFullYear() | |
416 | - } | |
419 | + session: new Date().getFullYear(), | |
420 | + }, | |
417 | 421 | }), |
422 | + watch: { | |
423 | + addSectionDialog: function (val) { | |
424 | + if (!val) { | |
425 | + this.sectionData = []; | |
426 | + } | |
427 | + }, | |
428 | + }, | |
418 | 429 | methods: { |
419 | 430 | getSectionList() { |
420 | 431 | // const { data } = await getSectionData.get(); |
421 | 432 | this.showLoader = true; |
422 | 433 | http() |
423 | 434 | .get("/getAllSections", { |
424 | - headers: { Authorization: "Bearer " + this.token } | |
435 | + headers: { Authorization: "Bearer " + this.token }, | |
425 | 436 | }) |
426 | - .then(response => { | |
437 | + .then((response) => { | |
427 | 438 | this.sectionList = response.data.data; |
428 | 439 | this.showLoader = false; |
429 | 440 | // console.log("getAllSections=====>",response.data.data) |
430 | 441 | }) |
431 | - .catch(error => { | |
442 | + .catch((error) => { | |
432 | 443 | this.showLoader = false; |
433 | 444 | if (error.response.status === 401) { |
434 | 445 | this.$router.replace({ path: "/" }); |
... | ... | @@ -449,22 +460,22 @@ export default { |
449 | 460 | }, |
450 | 461 | deleteItem(item) { |
451 | 462 | let deleteStudent = { |
452 | - sectionId: item._id | |
463 | + sectionId: item._id, | |
453 | 464 | }; |
454 | 465 | http() |
455 | 466 | .delete( |
456 | 467 | "/deleteSection", |
457 | 468 | confirm("Are you sure you want to delete this?") && { |
458 | - params: deleteStudent | |
469 | + params: deleteStudent, | |
459 | 470 | } |
460 | 471 | ) |
461 | - .then(response => { | |
472 | + .then((response) => { | |
462 | 473 | this.snackbar = true; |
463 | 474 | this.text = response.data.message; |
464 | 475 | this.color = "green"; |
465 | 476 | this.getSectionList(); |
466 | 477 | }) |
467 | - .catch(error => { | |
478 | + .catch((error) => { | |
468 | 479 | this.snackbar = true; |
469 | 480 | this.text = error.response.data.message; |
470 | 481 | this.color = "green"; |
... | ... | @@ -482,12 +493,12 @@ export default { |
482 | 493 | name: this.sectionData.name, |
483 | 494 | classId: this.sectionData.classNum, |
484 | 495 | session: this.sectionData.session, |
485 | - classInchargeId: this.sectionData.sectionId | |
496 | + classInchargeId: this.sectionData.sectionId, | |
486 | 497 | }; |
487 | 498 | this.loading = true; |
488 | 499 | http() |
489 | 500 | .post("/createSection", addSection) |
490 | - .then(response => { | |
501 | + .then((response) => { | |
491 | 502 | this.getSectionList(); |
492 | 503 | this.snackbar = true; |
493 | 504 | this.color = "green"; |
... | ... | @@ -496,7 +507,7 @@ export default { |
496 | 507 | this.addSectionDialog = false; |
497 | 508 | this.loading = false; |
498 | 509 | }) |
499 | - .catch(error => { | |
510 | + .catch((error) => { | |
500 | 511 | this.snackbar = true; |
501 | 512 | this.color = "error"; |
502 | 513 | this.text = error.response.data.message; |
... | ... | @@ -512,7 +523,7 @@ export default { |
512 | 523 | this.editLoading = true; |
513 | 524 | http() |
514 | 525 | .put("/updateSection", this.editedItem) |
515 | - .then(response => { | |
526 | + .then((response) => { | |
516 | 527 | this.editLoading = false; |
517 | 528 | this.snackbar = true; |
518 | 529 | this.color = "green"; |
... | ... | @@ -520,7 +531,7 @@ export default { |
520 | 531 | this.getSectionList(); |
521 | 532 | this.closeSectionDialog(); |
522 | 533 | }) |
523 | - .catch(error => { | |
534 | + .catch((error) => { | |
524 | 535 | this.editLoading = false; |
525 | 536 | this.snackbar = true; |
526 | 537 | this.color = "error"; |
... | ... | @@ -530,13 +541,13 @@ export default { |
530 | 541 | getAllTeacher() { |
531 | 542 | http() |
532 | 543 | .get("/getTeachersList", { |
533 | - headers: { Authorization: "Bearer " + this.token } | |
544 | + headers: { Authorization: "Bearer " + this.token }, | |
534 | 545 | }) |
535 | - .then(response => { | |
546 | + .then((response) => { | |
536 | 547 | this.teacherList = response.data.data; |
537 | 548 | this.showLoader = false; |
538 | 549 | }) |
539 | - .catch(err => { | |
550 | + .catch((err) => { | |
540 | 551 | // console.log("err====>", err); |
541 | 552 | this.showLoader = false; |
542 | 553 | }); |
... | ... | @@ -544,12 +555,12 @@ export default { |
544 | 555 | getAllClasses() { |
545 | 556 | http() |
546 | 557 | .get("/getClassesList", { |
547 | - headers: { Authorization: "Bearer " + this.token } | |
558 | + headers: { Authorization: "Bearer " + this.token }, | |
548 | 559 | }) |
549 | - .then(response => { | |
560 | + .then((response) => { | |
550 | 561 | this.addclass = response.data.data; |
551 | 562 | }) |
552 | - .catch(err => { | |
563 | + .catch((err) => { | |
553 | 564 | // console.log("err====>", err); |
554 | 565 | // this.$router.replace({ path: "/" }); |
555 | 566 | }); |
... | ... | @@ -561,13 +572,13 @@ export default { |
561 | 572 | this.showSearch = false; |
562 | 573 | this.show = true; |
563 | 574 | this.search = ""; |
564 | - } | |
575 | + }, | |
565 | 576 | }, |
566 | 577 | mounted() { |
567 | 578 | this.token = this.$store.state.token; |
568 | 579 | this.getSectionList(); |
569 | 580 | this.getAllClasses(); |
570 | 581 | this.getAllTeacher(); |
571 | - } | |
582 | + }, | |
572 | 583 | }; |
573 | 584 | </script> | ... | ... |
src/pages/Students/students.vue
... | ... | @@ -1016,7 +1016,7 @@ |
1016 | 1016 | >Your search for "{{ search }}" found no results.</v-alert> |
1017 | 1017 | </v-data-table> |
1018 | 1018 | <!-- DIALOG -- ADD STUDENTS DETAILS --> |
1019 | - <v-dialog v-model="addStudentDialog" max-width="1280"> | |
1019 | + <v-dialog v-model="addStudentDialog" max-width="1280" v-if="addStudentDialog"> | |
1020 | 1020 | <v-card flat class="card-style pa-2" dark> |
1021 | 1021 | <v-layout> |
1022 | 1022 | <v-flex xs12> |
... | ... | @@ -2075,6 +2075,15 @@ export default { |
2075 | 2075 | menu1(val) { |
2076 | 2076 | val && this.$nextTick(() => (this.$refs.picker.activePicker = "YEAR")); |
2077 | 2077 | }, |
2078 | + addStudentDialog: function (val) { | |
2079 | + if (!val) { | |
2080 | + this.parentData = []; | |
2081 | + this.addStudents = []; | |
2082 | + this.imageName = ""; | |
2083 | + this.imageFile = ""; | |
2084 | + this.imageUrl = ""; | |
2085 | + } | |
2086 | + }, | |
2078 | 2087 | }, |
2079 | 2088 | methods: { |
2080 | 2089 | findStudents() { |
... | ... | @@ -2412,6 +2421,7 @@ export default { |
2412 | 2421 | console.log("err====>", error.response.data.message); |
2413 | 2422 | this.text = error.response.data.message; |
2414 | 2423 | this.snackbar = true; |
2424 | + this.color = "error"; | |
2415 | 2425 | if (this.text === "Data not found!") { |
2416 | 2426 | this.showNext = false; |
2417 | 2427 | this.showParent = true; | ... | ... |
src/pages/Teachers/teachers.vue
... | ... | @@ -486,7 +486,13 @@ |
486 | 486 | </v-card-title> |
487 | 487 | <v-flex md2 lg2 sm6 xs8 v-if="showSearch"> |
488 | 488 | <v-layout> |
489 | - <v-text-field autofocus v-model="search" label="Search" prepend-inner-icon="search" color="primary"></v-text-field> | |
489 | + <v-text-field | |
490 | + autofocus | |
491 | + v-model="search" | |
492 | + label="Search" | |
493 | + prepend-inner-icon="search" | |
494 | + color="primary" | |
495 | + ></v-text-field> | |
490 | 496 | <v-icon @click="closeSearch" color="error">close</v-icon> |
491 | 497 | </v-layout> |
492 | 498 | </v-flex> |
... | ... | @@ -549,7 +555,7 @@ |
549 | 555 | class="mr-3" |
550 | 556 | /> |
551 | 557 | <span>Delete</span> |
552 | - </v-tooltip> --> | |
558 | + </v-tooltip>--> | |
553 | 559 | </span> |
554 | 560 | </td> |
555 | 561 | </tr> |
... | ... | @@ -563,12 +569,16 @@ |
563 | 569 | </v-data-table> |
564 | 570 | |
565 | 571 | <!-- ****** DIALOG BOX - Add Teachers Data****** --> |
566 | - <v-dialog v-model="addTeacherDialog" max-width="1160"> | |
572 | + <v-dialog v-model="addTeacherDialog" max-width="1160" v-if="addTeacherDialog"> | |
567 | 573 | <v-card flat class="card-style pa-2" dark> |
568 | 574 | <v-layout> |
569 | 575 | <v-flex xs12 class="pa-0"> |
570 | 576 | <label class="title text-xs-center">Add Teacher</label> |
571 | - <v-icon size="24" class="right" @click="$refs.form.reset();addTeacherDialog = false">cancel</v-icon> | |
577 | + <v-icon | |
578 | + size="24" | |
579 | + class="right" | |
580 | + @click="$refs.form.reset();addTeacherDialog = false" | |
581 | + >cancel</v-icon> | |
572 | 582 | </v-flex> |
573 | 583 | </v-layout> |
574 | 584 | <v-form ref="form" v-model="valid" lazy-validation> |
... | ... | @@ -945,22 +955,22 @@ export default { |
945 | 955 | addTeacherDialog: false, |
946 | 956 | valid: true, |
947 | 957 | pagination: { |
948 | - rowsPerPage: 10 | |
958 | + rowsPerPage: 10, | |
949 | 959 | }, |
950 | 960 | imageData: {}, |
951 | 961 | imageName: "", |
952 | 962 | imageUrl: "", |
953 | 963 | imageFile: "", |
954 | - nameRules: [v => !!v || " Full Name is required"], | |
955 | - dateRules: [v => !!v || " DOB is required"], | |
956 | - cityRules: [v => !!v || " City Name is required"], | |
957 | - pincode: [v => !!v || " Pincode is required"], | |
958 | - country: [v => !!v || " Country Name is required"], | |
959 | - permanentAddress: [v => !!v || " Permanent Address is required"], | |
960 | - presentAddress: [v => !!v || " Present Address is required"], | |
961 | - mobileNoRules: [v => !!v || "Mobile Number is required"], | |
962 | - stateRules: [v => !!v || "State Name is required"], | |
963 | - joinDateRules: [v => !!v || " Join Date is required"], | |
964 | + nameRules: [(v) => !!v || " Full Name is required"], | |
965 | + dateRules: [(v) => !!v || " DOB is required"], | |
966 | + cityRules: [(v) => !!v || " City Name is required"], | |
967 | + pincode: [(v) => !!v || " Pincode is required"], | |
968 | + country: [(v) => !!v || " Country Name is required"], | |
969 | + permanentAddress: [(v) => !!v || " Permanent Address is required"], | |
970 | + presentAddress: [(v) => !!v || " Present Address is required"], | |
971 | + mobileNoRules: [(v) => !!v || "Mobile Number is required"], | |
972 | + stateRules: [(v) => !!v || "State Name is required"], | |
973 | + joinDateRules: [(v) => !!v || " Join Date is required"], | |
964 | 974 | errorMessages: "", |
965 | 975 | switch1: true, |
966 | 976 | countries: [], |
... | ... | @@ -969,13 +979,13 @@ export default { |
969 | 979 | text: "No", |
970 | 980 | align: "", |
971 | 981 | sortable: false, |
972 | - value: "No" | |
982 | + value: "No", | |
973 | 983 | }, |
974 | 984 | { |
975 | 985 | text: "Profile Pic", |
976 | 986 | value: "profilePicUrl", |
977 | 987 | sortable: false, |
978 | - align: "center" | |
988 | + align: "center", | |
979 | 989 | }, |
980 | 990 | { text: "Name", value: "name", sortable: false, align: "center" }, |
981 | 991 | { text: "Email", value: "email", sortable: false, align: "center" }, |
... | ... | @@ -984,21 +994,21 @@ export default { |
984 | 994 | text: "Join Date", |
985 | 995 | value: "joinDate", |
986 | 996 | sortable: false, |
987 | - align: "center" | |
997 | + align: "center", | |
988 | 998 | }, |
989 | 999 | { |
990 | 1000 | text: "Mobile No", |
991 | 1001 | value: "mobileNo", |
992 | 1002 | sortable: false, |
993 | - align: "center" | |
1003 | + align: "center", | |
994 | 1004 | }, |
995 | 1005 | { |
996 | 1006 | text: "Status", |
997 | 1007 | value: "status", |
998 | 1008 | sortable: false, |
999 | - align: "center" | |
1009 | + align: "center", | |
1000 | 1010 | }, |
1001 | - { text: "Action", value: "", sortable: false, align: "center" } | |
1011 | + { text: "Action", value: "", sortable: false, align: "center" }, | |
1002 | 1012 | ], |
1003 | 1013 | desserts: [], |
1004 | 1014 | editedIndex: -1, |
... | ... | @@ -1015,7 +1025,7 @@ export default { |
1015 | 1025 | presentAddress: "", |
1016 | 1026 | mobileNo: "", |
1017 | 1027 | state: "", |
1018 | - joinDate: null | |
1028 | + joinDate: null, | |
1019 | 1029 | }, |
1020 | 1030 | addTeachers: { |
1021 | 1031 | role: "TEACHER", |
... | ... | @@ -1029,9 +1039,9 @@ export default { |
1029 | 1039 | presentAddress: "", |
1030 | 1040 | mobileNo: "", |
1031 | 1041 | state: "", |
1032 | - joinDate: null | |
1042 | + joinDate: null, | |
1033 | 1043 | }, |
1034 | - status: "" | |
1044 | + status: "", | |
1035 | 1045 | }), |
1036 | 1046 | watch: { |
1037 | 1047 | menu(val) { |
... | ... | @@ -1039,7 +1049,15 @@ export default { |
1039 | 1049 | }, |
1040 | 1050 | menu1(val) { |
1041 | 1051 | val && this.$nextTick(() => (this.$refs.picker.activePicker = "YEAR")); |
1042 | - } | |
1052 | + }, | |
1053 | + addTeacherDialog: function (val) { | |
1054 | + if (!val) { | |
1055 | + this.addTeachers = []; | |
1056 | + this.imageName = ""; | |
1057 | + this.imageFile = ""; | |
1058 | + this.imageUrl = ""; | |
1059 | + } | |
1060 | + }, | |
1043 | 1061 | }, |
1044 | 1062 | methods: { |
1045 | 1063 | save(date) { |
... | ... | @@ -1071,7 +1089,7 @@ export default { |
1071 | 1089 | this.imageUrl = ""; |
1072 | 1090 | } |
1073 | 1091 | }, |
1074 | - dates: function(date) { | |
1092 | + dates: function (date) { | |
1075 | 1093 | return moment(date).format("MMMM DD, YYYY"); |
1076 | 1094 | }, |
1077 | 1095 | getTeacherList() { |
... | ... | @@ -1079,14 +1097,14 @@ export default { |
1079 | 1097 | var token = this.$store.state.token; |
1080 | 1098 | http() |
1081 | 1099 | .get("/getTeachersList", { |
1082 | - headers: { Authorization: "Bearer " + token } | |
1100 | + headers: { Authorization: "Bearer " + token }, | |
1083 | 1101 | }) |
1084 | - .then(response => { | |
1102 | + .then((response) => { | |
1085 | 1103 | this.desserts = response.data.data; |
1086 | 1104 | this.showLoader = false; |
1087 | 1105 | // console.log("getTeacherList=====>",this.desserts) |
1088 | 1106 | }) |
1089 | - .catch(error => { | |
1107 | + .catch((error) => { | |
1090 | 1108 | this.showLoader = false; |
1091 | 1109 | if (error.response.status === 401) { |
1092 | 1110 | this.$router.replace({ path: "/" }); |
... | ... | @@ -1119,22 +1137,22 @@ export default { |
1119 | 1137 | }, |
1120 | 1138 | deleteItem(item) { |
1121 | 1139 | let deleteTeachers = { |
1122 | - teacherId: item._id | |
1140 | + teacherId: item._id, | |
1123 | 1141 | }; |
1124 | 1142 | http() |
1125 | 1143 | .delete( |
1126 | 1144 | "/deleteTeacher", |
1127 | 1145 | confirm("Are you sure you want to delete this?") && { |
1128 | - params: deleteTeachers | |
1146 | + params: deleteTeachers, | |
1129 | 1147 | } |
1130 | 1148 | ) |
1131 | - .then(response => { | |
1149 | + .then((response) => { | |
1132 | 1150 | this.snackbar = true; |
1133 | 1151 | this.text = "Successfully delete Existing Teacher"; |
1134 | 1152 | this.color = "green"; |
1135 | 1153 | this.getTeacherList(); |
1136 | 1154 | }) |
1137 | - .catch(error => { | |
1155 | + .catch((error) => { | |
1138 | 1156 | this.snackbar = true; |
1139 | 1157 | this.text = error.response.data.message; |
1140 | 1158 | this.color = "error"; |
... | ... | @@ -1163,7 +1181,7 @@ export default { |
1163 | 1181 | presentAddress: this.addTeachers.presentAddress, |
1164 | 1182 | mobileNo: this.addTeachers.mobileNo, |
1165 | 1183 | state: this.addTeachers.state, |
1166 | - joinDate: this.addTeachers.joinDate | |
1184 | + joinDate: this.addTeachers.joinDate, | |
1167 | 1185 | }; |
1168 | 1186 | if (this.imageUrl) { |
1169 | 1187 | var str = this.imageUrl; |
... | ... | @@ -1173,7 +1191,7 @@ export default { |
1173 | 1191 | this.loading = true; |
1174 | 1192 | http() |
1175 | 1193 | .post("/createTeacher", addTeacher) |
1176 | - .then(response => { | |
1194 | + .then((response) => { | |
1177 | 1195 | this.imageUrl = ""; |
1178 | 1196 | this.getTeacherList(); |
1179 | 1197 | this.snackbar = true; |
... | ... | @@ -1183,7 +1201,7 @@ export default { |
1183 | 1201 | this.loading = false; |
1184 | 1202 | this.addTeacherDialog = false; |
1185 | 1203 | }) |
1186 | - .catch(error => { | |
1204 | + .catch((error) => { | |
1187 | 1205 | this.snackbar = true; |
1188 | 1206 | this.text = error.response.data.message; |
1189 | 1207 | this.color = "error"; |
... | ... | @@ -1210,7 +1228,7 @@ export default { |
1210 | 1228 | presentAddress: this.editedItem.presentAddress, |
1211 | 1229 | mobileNo: this.editedItem.mobileNo, |
1212 | 1230 | state: this.editedItem.state, |
1213 | - joinDate: this.editedItem.joinDate | |
1231 | + joinDate: this.editedItem.joinDate, | |
1214 | 1232 | }; |
1215 | 1233 | if (this.imageUrl) { |
1216 | 1234 | var str = this.imageUrl; |
... | ... | @@ -1219,7 +1237,7 @@ export default { |
1219 | 1237 | } |
1220 | 1238 | http() |
1221 | 1239 | .put("/updateTeacher", editTeacher) |
1222 | - .then(response => { | |
1240 | + .then((response) => { | |
1223 | 1241 | this.snackbar = true; |
1224 | 1242 | this.text = "Successfully Edit Existing Teacher"; |
1225 | 1243 | this.color = "green"; |
... | ... | @@ -1227,7 +1245,7 @@ export default { |
1227 | 1245 | this.getTeacherList(); |
1228 | 1246 | this.closeEditTeacherDialog(); |
1229 | 1247 | }) |
1230 | - .catch(error => { | |
1248 | + .catch((error) => { | |
1231 | 1249 | this.snackbar = true; |
1232 | 1250 | this.text = error.response.data.message; |
1233 | 1251 | this.color = "error"; |
... | ... | @@ -1237,19 +1255,19 @@ export default { |
1237 | 1255 | suspendStatus(suspendStatus, id) { |
1238 | 1256 | let suspendStatusData = { |
1239 | 1257 | teacherId: id, |
1240 | - status: suspendStatus | |
1258 | + status: suspendStatus, | |
1241 | 1259 | }; |
1242 | 1260 | this.showLoader = true; |
1243 | 1261 | http() |
1244 | 1262 | .put("/suspendAccount", suspendStatusData) |
1245 | - .then(response => { | |
1263 | + .then((response) => { | |
1246 | 1264 | this.getTeacherList(); |
1247 | 1265 | this.text = response.data.message; |
1248 | 1266 | this.color = "green"; |
1249 | 1267 | this.snackbar = true; |
1250 | 1268 | this.showLoader = false; |
1251 | 1269 | }) |
1252 | - .catch(error => { | |
1270 | + .catch((error) => { | |
1253 | 1271 | this.snackbar = true; |
1254 | 1272 | this.color = "error"; |
1255 | 1273 | this.text = error.response.data.message; |
... | ... | @@ -1263,14 +1281,14 @@ export default { |
1263 | 1281 | this.showSearch = false; |
1264 | 1282 | this.show = true; |
1265 | 1283 | this.search = ""; |
1266 | - } | |
1284 | + }, | |
1267 | 1285 | }, |
1268 | 1286 | mounted() { |
1269 | 1287 | const getCountryList = countryList(); |
1270 | 1288 | this.countries = getCountryList; |
1271 | 1289 | this.getTeacherList(); |
1272 | 1290 | this.role = this.$store.state.role; |
1273 | - } | |
1291 | + }, | |
1274 | 1292 | }; |
1275 | 1293 | </script> |
1276 | 1294 | <style scoped> | ... | ... |
src/pages/TimeTable/timeTable.vue
... | ... | @@ -554,7 +554,7 @@ |
554 | 554 | <v-flex xs8 sm8 md3 lg2 v-if="showSearch"> |
555 | 555 | <v-layout> |
556 | 556 | <v-text-field |
557 | - autofocus | |
557 | + autofocus | |
558 | 558 | v-model="search" |
559 | 559 | label="Search" |
560 | 560 | prepend-inner-icon="search" |
... | ... | @@ -679,12 +679,12 @@ |
679 | 679 | </v-flex> |
680 | 680 | |
681 | 681 | <!-- ****** ADD TIME-TABLE ****** --> |
682 | - <v-dialog v-model="addTimeTableDialog" max-width="600px"> | |
682 | + <v-dialog v-model="addTimeTableDialog" max-width="600px" v-if="addTimeTableDialog"> | |
683 | 683 | <v-card flat class="card-style pa-2" dark> |
684 | 684 | <v-layout> |
685 | 685 | <v-flex xs12> |
686 | 686 | <label class="title text-xs-center">Add Time Table</label> |
687 | - <v-icon size="24" class="right" @click="addTimeTableDialog = false">cancel</v-icon> | |
687 | + <v-icon size="24" class="right" @click="closeAddTimeTableModel">cancel</v-icon> | |
688 | 688 | </v-flex> |
689 | 689 | </v-layout> |
690 | 690 | <v-form ref="form" v-model="valid" lazy-validation> |
... | ... | @@ -929,43 +929,43 @@ export default { |
929 | 929 | addTeachers: [], |
930 | 930 | gender: ["Male", "Female"], |
931 | 931 | pagination: { |
932 | - rowsPerPage: 15 | |
932 | + rowsPerPage: 15, | |
933 | 933 | }, |
934 | 934 | imageData: {}, |
935 | 935 | imageName: "", |
936 | 936 | imageUrl: "", |
937 | 937 | imageFile: "", |
938 | - timeInRules: [v => !!v || "Time In is required"], | |
939 | - timeOutRules: [v => !!v || "Time Out is required"], | |
940 | - lectureRules: [v => !!v || "Lecture No is required"], | |
941 | - subjectNameRules: [v => !!v || "Subject Name is required"], | |
942 | - classRules: [v => !!v || "Class Name is required"], | |
943 | - sectionRules: [v => !!v || "Section Name is required"], | |
944 | - sectionRules: [v => !!v || "Section Name is required"], | |
945 | - teacherRules: [v => !!v || "Teacher Name is required"], | |
946 | - selecDayRule: [v => !!v || "Day is required"], | |
947 | - dayRules: [v => !!v || "Day is required"], | |
938 | + timeInRules: [(v) => !!v || "Time In is required"], | |
939 | + timeOutRules: [(v) => !!v || "Time Out is required"], | |
940 | + lectureRules: [(v) => !!v || "Lecture No is required"], | |
941 | + subjectNameRules: [(v) => !!v || "Subject Name is required"], | |
942 | + classRules: [(v) => !!v || "Class Name is required"], | |
943 | + sectionRules: [(v) => !!v || "Section Name is required"], | |
944 | + sectionRules: [(v) => !!v || "Section Name is required"], | |
945 | + teacherRules: [(v) => !!v || "Teacher Name is required"], | |
946 | + selecDayRule: [(v) => !!v || "Day is required"], | |
947 | + dayRules: [(v) => !!v || "Day is required"], | |
948 | 948 | getParticulerLecture: "", |
949 | 949 | headers: [ |
950 | 950 | { |
951 | 951 | text: "No", |
952 | 952 | align: "", |
953 | 953 | sortable: false, |
954 | - value: "No" | |
954 | + value: "No", | |
955 | 955 | }, |
956 | 956 | { |
957 | 957 | text: "Class Name", |
958 | 958 | value: "classData.classNum", |
959 | 959 | sortable: false, |
960 | - align: "center" | |
960 | + align: "center", | |
961 | 961 | }, |
962 | 962 | { |
963 | 963 | text: "Section Name", |
964 | 964 | value: "sectionData.name", |
965 | 965 | sortable: false, |
966 | - align: "center" | |
966 | + align: "center", | |
967 | 967 | }, |
968 | - { text: "Action", value: "", sortable: false, align: "center" } | |
968 | + { text: "Action", value: "", sortable: false, align: "center" }, | |
969 | 969 | ], |
970 | 970 | daysHeaders: [ |
971 | 971 | { text: "Day", value: "dayday", sortable: false, align: "center" }, |
... | ... | @@ -973,10 +973,10 @@ export default { |
973 | 973 | text: "Subject Name", |
974 | 974 | value: "subjectName", |
975 | 975 | sortable: false, |
976 | - align: "center" | |
976 | + align: "center", | |
977 | 977 | }, |
978 | 978 | { text: "Time In", value: "timeIn", sortable: false, align: "center" }, |
979 | - { text: "Time Out", value: "timeOut", sortable: false, align: "center" } | |
979 | + { text: "Time Out", value: "timeOut", sortable: false, align: "center" }, | |
980 | 980 | ], |
981 | 981 | addOneDay: [ |
982 | 982 | "Monday", |
... | ... | @@ -985,17 +985,17 @@ export default { |
985 | 985 | "Thursday", |
986 | 986 | "Friday", |
987 | 987 | "Saturday", |
988 | - "Sunday" | |
988 | + "Sunday", | |
989 | 989 | ], |
990 | 990 | schedule: { |
991 | - selectDay: "" | |
991 | + selectDay: "", | |
992 | 992 | }, |
993 | 993 | desserts: [], |
994 | 994 | timeTableList: [], |
995 | 995 | editedIndex: -1, |
996 | 996 | selectTimeTable: { |
997 | 997 | select: "", |
998 | - selectSection: "" | |
998 | + selectSection: "", | |
999 | 999 | }, |
1000 | 1000 | timeTable: { |
1001 | 1001 | select: "", |
... | ... | @@ -1004,11 +1004,11 @@ export default { |
1004 | 1004 | timeIn: null, |
1005 | 1005 | timeOut: null, |
1006 | 1006 | subjectName: "", |
1007 | - selectTeacher: "" | |
1007 | + selectTeacher: "", | |
1008 | 1008 | }, |
1009 | 1009 | editedItem: { |
1010 | 1010 | classNum: "", |
1011 | - selectSection: "" | |
1011 | + selectSection: "", | |
1012 | 1012 | }, |
1013 | 1013 | addlectures: { |
1014 | 1014 | timeIn: null, |
... | ... | @@ -1017,18 +1017,18 @@ export default { |
1017 | 1017 | teacherId: "", |
1018 | 1018 | scheduleId: "", |
1019 | 1019 | timeTableId: "", |
1020 | - select: "" | |
1020 | + select: "", | |
1021 | 1021 | }, |
1022 | 1022 | updateLectures: { |
1023 | 1023 | timeIn: null, |
1024 | 1024 | timeOut: null, |
1025 | 1025 | subjectName: "", |
1026 | 1026 | teacherId: "", |
1027 | - select: "" | |
1027 | + select: "", | |
1028 | 1028 | }, |
1029 | 1029 | updateLecturesId: { |
1030 | 1030 | lectureId: "", |
1031 | - scheduleId: "" | |
1031 | + scheduleId: "", | |
1032 | 1032 | }, |
1033 | 1033 | menu1: false, |
1034 | 1034 | menu2: false, |
... | ... | @@ -1036,8 +1036,15 @@ export default { |
1036 | 1036 | menu4: false, |
1037 | 1037 | menu5: false, |
1038 | 1038 | menu6: false, |
1039 | - scheduleDayId: "" | |
1039 | + scheduleDayId: "", | |
1040 | 1040 | }), |
1041 | + watch: { | |
1042 | + addTimeTableDialog: function (val) { | |
1043 | + if (!val) { | |
1044 | + this.timeTable = []; | |
1045 | + } | |
1046 | + }, | |
1047 | + }, | |
1041 | 1048 | methods: { |
1042 | 1049 | findTimeTable() { |
1043 | 1050 | this.loadingFindData = true; |
... | ... | @@ -1045,14 +1052,14 @@ export default { |
1045 | 1052 | .get("/getParticularClassTimeTable", { |
1046 | 1053 | params: { |
1047 | 1054 | sectionId: this.selectTimeTable.selectSection, |
1048 | - classId: this.selectTimeTable.select | |
1049 | - } | |
1055 | + classId: this.selectTimeTable.select, | |
1056 | + }, | |
1050 | 1057 | }) |
1051 | - .then(response => { | |
1058 | + .then((response) => { | |
1052 | 1059 | this.desserts = response.data.data; |
1053 | 1060 | this.loadingFindData = false; |
1054 | 1061 | }) |
1055 | - .catch(error => { | |
1062 | + .catch((error) => { | |
1056 | 1063 | this.loadingFindData = false; |
1057 | 1064 | this.snackbar = true; |
1058 | 1065 | this.text = error.response.data.message; |
... | ... | @@ -1066,13 +1073,13 @@ export default { |
1066 | 1073 | "/getSectionsList", |
1067 | 1074 | { params: { classId: _id } }, |
1068 | 1075 | { |
1069 | - headers: { Authorization: "Bearer " + token } | |
1076 | + headers: { Authorization: "Bearer " + token }, | |
1070 | 1077 | } |
1071 | 1078 | ) |
1072 | - .then(response => { | |
1079 | + .then((response) => { | |
1073 | 1080 | this.addSection = response.data.data; |
1074 | 1081 | }) |
1075 | - .catch(err => { | |
1082 | + .catch((err) => { | |
1076 | 1083 | // console.log("err====>", err); |
1077 | 1084 | }); |
1078 | 1085 | }, |
... | ... | @@ -1084,14 +1091,14 @@ export default { |
1084 | 1091 | "/getParticularClass", |
1085 | 1092 | { params: { classId: _id } }, |
1086 | 1093 | { |
1087 | - headers: { Authorization: "Bearer " + this.token } | |
1094 | + headers: { Authorization: "Bearer " + this.token }, | |
1088 | 1095 | } |
1089 | 1096 | ) |
1090 | - .then(response => { | |
1097 | + .then((response) => { | |
1091 | 1098 | this.subjectList = response.data.data; |
1092 | 1099 | this.showLoader = false; |
1093 | 1100 | }) |
1094 | - .catch(err => { | |
1101 | + .catch((err) => { | |
1095 | 1102 | this.showLoader = false; |
1096 | 1103 | }); |
1097 | 1104 | }, |
... | ... | @@ -1107,14 +1114,14 @@ export default { |
1107 | 1114 | "/getParticularTimeTable", |
1108 | 1115 | { params: { timeTableId: this.getParticulerLecture } }, |
1109 | 1116 | { |
1110 | - headers: { Authorization: "Bearer " + token } | |
1117 | + headers: { Authorization: "Bearer " + token }, | |
1111 | 1118 | } |
1112 | 1119 | ) |
1113 | - .then(response => { | |
1120 | + .then((response) => { | |
1114 | 1121 | this.timeTableList = response.data.data; |
1115 | 1122 | this.showLoader = false; |
1116 | 1123 | }) |
1117 | - .catch(err => { | |
1124 | + .catch((err) => { | |
1118 | 1125 | this.showLoader = false; |
1119 | 1126 | // console.log("err====>", err); |
1120 | 1127 | }); |
... | ... | @@ -1182,7 +1189,7 @@ export default { |
1182 | 1189 | if (this.$refs.lectureForm.validate()) { |
1183 | 1190 | http() |
1184 | 1191 | .post("/addLecture", this.addlectures) |
1185 | - .then(response => { | |
1192 | + .then((response) => { | |
1186 | 1193 | this.snackbar = true; |
1187 | 1194 | this.text = "New Add Lecture successfully"; |
1188 | 1195 | var token = this.$store.state.token; |
... | ... | @@ -1191,17 +1198,17 @@ export default { |
1191 | 1198 | "/getParticularTimeTable", |
1192 | 1199 | { params: { timeTableId: this.getParticulerLecture } }, |
1193 | 1200 | { |
1194 | - headers: { Authorization: "Bearer " + token } | |
1201 | + headers: { Authorization: "Bearer " + token }, | |
1195 | 1202 | } |
1196 | 1203 | ) |
1197 | - .then(response => { | |
1204 | + .then((response) => { | |
1198 | 1205 | this.timeTableList = response.data.data; |
1199 | 1206 | this.snackbar = true; |
1200 | 1207 | this.text = response.data.message; |
1201 | 1208 | this.color = "green"; |
1202 | 1209 | this.showLoader = false; |
1203 | 1210 | }) |
1204 | - .catch(err => { | |
1211 | + .catch((err) => { | |
1205 | 1212 | this.showLoader = false; |
1206 | 1213 | // console.log("err====>", err); |
1207 | 1214 | this.snackbar = true; |
... | ... | @@ -1211,7 +1218,7 @@ export default { |
1211 | 1218 | this.closedialogLecture(); |
1212 | 1219 | this.clearLeactureData(); |
1213 | 1220 | }) |
1214 | - .catch(error => { | |
1221 | + .catch((error) => { | |
1215 | 1222 | this.snackbar = true; |
1216 | 1223 | this.text = error.response.data.message; |
1217 | 1224 | this.text = error.response.data.statusText; |
... | ... | @@ -1226,19 +1233,19 @@ export default { |
1226 | 1233 | timeIn: this.updateLectures.timeIn, |
1227 | 1234 | timeOut: this.updateLectures.timeOut, |
1228 | 1235 | subjectName: this.updateLectures.subjectName, |
1229 | - teacherId: this.updateLectures.teacherId | |
1230 | - } | |
1236 | + teacherId: this.updateLectures.teacherId, | |
1237 | + }, | |
1231 | 1238 | }; |
1232 | 1239 | http() |
1233 | 1240 | .put("/updateLecture", EditLecture) |
1234 | - .then(response => { | |
1241 | + .then((response) => { | |
1235 | 1242 | console.log("updateLecture", EditLecture); |
1236 | 1243 | this.snackbar = true; |
1237 | 1244 | this.text = response.data.message; |
1238 | 1245 | this.color = "green"; |
1239 | 1246 | this.closeUpdateLectures(); |
1240 | 1247 | }) |
1241 | - .catch(error => { | |
1248 | + .catch((error) => { | |
1242 | 1249 | // console.log(error); |
1243 | 1250 | |
1244 | 1251 | this.snackbar = true; |
... | ... | @@ -1251,23 +1258,23 @@ export default { |
1251 | 1258 | }, |
1252 | 1259 | deleteItem(item) { |
1253 | 1260 | let deleteTimeTable = { |
1254 | - timeTableId: item._id | |
1261 | + timeTableId: item._id, | |
1255 | 1262 | }; |
1256 | 1263 | http() |
1257 | 1264 | .delete( |
1258 | 1265 | "/deleteTimeTable", |
1259 | 1266 | confirm("Are you sure you want to delete this?") && { |
1260 | - params: deleteTimeTable | |
1267 | + params: deleteTimeTable, | |
1261 | 1268 | } |
1262 | 1269 | ) |
1263 | - .then(response => { | |
1270 | + .then((response) => { | |
1264 | 1271 | // console.log("deleteUers",deleteTimeTable) |
1265 | 1272 | this.snackbar = true; |
1266 | 1273 | this.text = response.data.message; |
1267 | 1274 | this.color = "green"; |
1268 | 1275 | this.findTimeTable(); |
1269 | 1276 | }) |
1270 | - .catch(error => { | |
1277 | + .catch((error) => { | |
1271 | 1278 | // console.log(error); |
1272 | 1279 | }); |
1273 | 1280 | }, |
... | ... | @@ -1283,6 +1290,11 @@ export default { |
1283 | 1290 | closeUpdateLectures() { |
1284 | 1291 | this.dialogUpdateLectures = false; |
1285 | 1292 | }, |
1293 | + closeAddTimeTableModel() { | |
1294 | + this.addTimeTableDialog = false; | |
1295 | + this.timeTableList = []; | |
1296 | + this.timeTable = []; | |
1297 | + }, | |
1286 | 1298 | submit() { |
1287 | 1299 | if (this.$refs.form.validate()) { |
1288 | 1300 | let imageData = new FormData(); |
... | ... | @@ -1298,16 +1310,16 @@ export default { |
1298 | 1310 | timeIn: this.timeTable.timeIn, |
1299 | 1311 | timeOut: this.timeTable.timeOut, |
1300 | 1312 | subjectName: this.timeTable.subjectName, |
1301 | - teacherId: this.timeTable.selectTeacher | |
1302 | - } | |
1303 | - ] | |
1304 | - } | |
1305 | - ] | |
1313 | + teacherId: this.timeTable.selectTeacher, | |
1314 | + }, | |
1315 | + ], | |
1316 | + }, | |
1317 | + ], | |
1306 | 1318 | }; |
1307 | 1319 | this.loading = true; |
1308 | 1320 | http() |
1309 | 1321 | .post("/createTimeTable", addTimeTable) |
1310 | - .then(response => { | |
1322 | + .then((response) => { | |
1311 | 1323 | // console.log("addTimeTable=====>", addTimeTable); |
1312 | 1324 | if ((this.snackbar = true)) { |
1313 | 1325 | this.text = "New Time Table added successfully"; |
... | ... | @@ -1317,7 +1329,7 @@ export default { |
1317 | 1329 | this.addTimeTableDialog = false; |
1318 | 1330 | this.loading = false; |
1319 | 1331 | }) |
1320 | - .catch(error => { | |
1332 | + .catch((error) => { | |
1321 | 1333 | // console.log(error); |
1322 | 1334 | if ((this.snackbar = true)) { |
1323 | 1335 | this.text = error.response.data.message; |
... | ... | @@ -1339,19 +1351,19 @@ export default { |
1339 | 1351 | let editTimeTable = { |
1340 | 1352 | timeTableId: this.editedItem._id, |
1341 | 1353 | classId: this.editedItem.classNum, |
1342 | - sectionId: this.editedItem.selectSection | |
1354 | + sectionId: this.editedItem.selectSection, | |
1343 | 1355 | // imageData |
1344 | 1356 | }; |
1345 | 1357 | http() |
1346 | 1358 | .put("/updateTimeTable", editTimeTable) |
1347 | - .then(response => { | |
1359 | + .then((response) => { | |
1348 | 1360 | console.log("editTimeTable", editTimeTable); |
1349 | 1361 | if ((this.snackbar = true)) { |
1350 | 1362 | this.text = "Successfully Edit Existing Time Table"; |
1351 | 1363 | } |
1352 | 1364 | this.findTimeTable(); |
1353 | 1365 | }) |
1354 | - .catch(error => { | |
1366 | + .catch((error) => { | |
1355 | 1367 | // console.log(error); |
1356 | 1368 | if ((this.snackbar = true)) { |
1357 | 1369 | this.text = error.response.data.message; |
... | ... | @@ -1361,16 +1373,16 @@ export default { |
1361 | 1373 | }, |
1362 | 1374 | deleteTimeTable(timeToDelete, deleteLectures) { |
1363 | 1375 | let deleteLecture = { |
1364 | - lectureId: timeToDelete._id | |
1376 | + lectureId: timeToDelete._id, | |
1365 | 1377 | }; |
1366 | 1378 | http() |
1367 | 1379 | .delete( |
1368 | 1380 | "/deleteLecture", |
1369 | 1381 | confirm("Are you sure you want to delete this?") && { |
1370 | - params: deleteLecture | |
1382 | + params: deleteLecture, | |
1371 | 1383 | } |
1372 | 1384 | ) |
1373 | - .then(response => { | |
1385 | + .then((response) => { | |
1374 | 1386 | if ((this.snackbar = true)) { |
1375 | 1387 | this.text = "Successfully delete Existing Time Table"; |
1376 | 1388 | } |
... | ... | @@ -1379,7 +1391,7 @@ export default { |
1379 | 1391 | this.timeTableList.schedule[i].lectures.splice(index, 1); |
1380 | 1392 | } |
1381 | 1393 | }) |
1382 | - .catch(error => { | |
1394 | + .catch((error) => { | |
1383 | 1395 | console.log(error); |
1384 | 1396 | }); |
1385 | 1397 | }, |
... | ... | @@ -1391,18 +1403,18 @@ export default { |
1391 | 1403 | if (this.$refs.formAddDay.validate()) { |
1392 | 1404 | let scheduleDayData = { |
1393 | 1405 | timeTableId: this.scheduleDayId, |
1394 | - day: this.schedule.selectDay | |
1406 | + day: this.schedule.selectDay, | |
1395 | 1407 | }; |
1396 | 1408 | http() |
1397 | 1409 | .post("/addSchedule", scheduleDayData) |
1398 | - .then(response => { | |
1410 | + .then((response) => { | |
1399 | 1411 | this.snackbar = true; |
1400 | 1412 | this.text = "New Schedule Day added successfully"; |
1401 | 1413 | this.dialogSchedule = false; |
1402 | 1414 | this.loading = false; |
1403 | 1415 | this.getTimeTableDayData(); |
1404 | 1416 | }) |
1405 | - .catch(error => { | |
1417 | + .catch((error) => { | |
1406 | 1418 | // console.log(error); |
1407 | 1419 | this.snackbar = true; |
1408 | 1420 | this.text = error.response.data.message; |
... | ... | @@ -1417,20 +1429,20 @@ export default { |
1417 | 1429 | this.showSearch = false; |
1418 | 1430 | this.show = true; |
1419 | 1431 | this.search = ""; |
1420 | - } | |
1432 | + }, | |
1421 | 1433 | }, |
1422 | 1434 | mounted() { |
1423 | 1435 | // this.getTimeTableList(); |
1424 | 1436 | var token = this.$store.state.token; |
1425 | 1437 | http() |
1426 | 1438 | .get("/getClassesList", { |
1427 | - headers: { Authorization: "Bearer " + token } | |
1439 | + headers: { Authorization: "Bearer " + token }, | |
1428 | 1440 | }) |
1429 | - .then(response => { | |
1441 | + .then((response) => { | |
1430 | 1442 | this.addclass = response.data.data; |
1431 | 1443 | // console.log("getClassesList=====>",this.addclass) |
1432 | 1444 | }) |
1433 | - .catch(error => { | |
1445 | + .catch((error) => { | |
1434 | 1446 | this.showLoader = false; |
1435 | 1447 | if (error.response.status === 401) { |
1436 | 1448 | this.$router.replace({ path: "/" }); |
... | ... | @@ -1442,13 +1454,13 @@ export default { |
1442 | 1454 | |
1443 | 1455 | http() |
1444 | 1456 | .get("/getTeachersList", { |
1445 | - headers: { Authorization: "Bearer " + token } | |
1457 | + headers: { Authorization: "Bearer " + token }, | |
1446 | 1458 | }) |
1447 | - .then(response => { | |
1459 | + .then((response) => { | |
1448 | 1460 | this.addTeachers = response.data.data; |
1449 | 1461 | // console.log("getClassesList=====>",this.addTeachers) |
1450 | 1462 | }) |
1451 | - .catch(error => { | |
1463 | + .catch((error) => { | |
1452 | 1464 | this.showLoader = false; |
1453 | 1465 | if (error.response.status === 401) { |
1454 | 1466 | this.$router.replace({ path: "/" }); |
... | ... | @@ -1457,6 +1469,6 @@ export default { |
1457 | 1469 | this.$store.dispatch("Role", null); |
1458 | 1470 | } |
1459 | 1471 | }); |
1460 | - } | |
1472 | + }, | |
1461 | 1473 | }; |
1462 | 1474 | </script> |
1463 | 1475 | \ No newline at end of file | ... | ... |
src/pages/User/user.vue
... | ... | @@ -406,7 +406,13 @@ |
406 | 406 | </v-card-title> |
407 | 407 | <v-flex xs8 sm8 lg2 md3 v-if="showSearch"> |
408 | 408 | <v-layout> |
409 | - <v-text-field autofocus v-model="search" label="Search" prepend-inner-icon="search" color="primary"></v-text-field> | |
409 | + <v-text-field | |
410 | + autofocus | |
411 | + v-model="search" | |
412 | + label="Search" | |
413 | + prepend-inner-icon="search" | |
414 | + color="primary" | |
415 | + ></v-text-field> | |
410 | 416 | <v-icon @click="closeSearch" color="error">close</v-icon> |
411 | 417 | </v-layout> |
412 | 418 | </v-flex> |
... | ... | @@ -475,7 +481,7 @@ |
475 | 481 | >Your search for "{{ search }}" found no results.</v-alert> |
476 | 482 | </v-data-table> |
477 | 483 | <!-- DIALOG BOX - Add User Data --> |
478 | - <v-dialog v-model="addUserDialog" max-width="900px"> | |
484 | + <v-dialog v-model="addUserDialog" max-width="900px" v-if="addUserDialog"> | |
479 | 485 | <v-card flat class="card-style pa-2" dark> |
480 | 486 | <v-layout> |
481 | 487 | <v-flex xs12> |
... | ... | @@ -697,7 +703,7 @@ |
697 | 703 | ></v-text-field> |
698 | 704 | </v-flex> |
699 | 705 | </v-layout> |
700 | - </v-flex> --> | |
706 | + </v-flex>--> | |
701 | 707 | <v-flex xs12 sm6> |
702 | 708 | <v-layout> |
703 | 709 | <v-flex xs4 class="pt-4 subheading"> |
... | ... | @@ -768,7 +774,7 @@ |
768 | 774 | import http from "@/Services/http.js"; |
769 | 775 | import Util from "@/util"; |
770 | 776 | import moment from "moment"; |
771 | -import _ from 'lodash'; | |
777 | +import _ from "lodash"; | |
772 | 778 | |
773 | 779 | export default { |
774 | 780 | data: () => ({ |
... | ... | @@ -797,31 +803,31 @@ export default { |
797 | 803 | isActive: true, |
798 | 804 | newActive: false, |
799 | 805 | pagination: { |
800 | - rowsPerPage: 10 | |
806 | + rowsPerPage: 10, | |
801 | 807 | }, |
802 | 808 | imageData: {}, |
803 | 809 | imageName: "", |
804 | 810 | imageUrl: "", |
805 | 811 | imageFile: "", |
806 | - nameRules: [v => !!v || "Name is required"], | |
807 | - dateRules: [v => !!v || " DOB is required"], | |
808 | - genderRules: [v => !!v || " Gender Name is required"], | |
809 | - pincode: [v => !!v || " Pincode is required"], | |
810 | - role: [v => !!v || "Role Name is required"], | |
811 | - permanentAddress: [v => !!v || " Permanent Address is required"], | |
812 | - presentAddress: [v => !!v || " Present Address is required"], | |
813 | - mobileNoRules: [v => !!v || "Phone Number is required"], | |
814 | - religionRules: [v => !!v || "Religion Name is required"], | |
815 | - joinDateRules: [v => !!v || " Join Date is required"], | |
816 | - userNameRules: [v => !!v || " User Name is required"], | |
817 | - passwordRules: [v => !!v || " Password is required"], | |
812 | + nameRules: [(v) => !!v || "Name is required"], | |
813 | + dateRules: [(v) => !!v || " DOB is required"], | |
814 | + genderRules: [(v) => !!v || " Gender Name is required"], | |
815 | + pincode: [(v) => !!v || " Pincode is required"], | |
816 | + role: [(v) => !!v || "Role Name is required"], | |
817 | + permanentAddress: [(v) => !!v || " Permanent Address is required"], | |
818 | + presentAddress: [(v) => !!v || " Present Address is required"], | |
819 | + mobileNoRules: [(v) => !!v || "Phone Number is required"], | |
820 | + religionRules: [(v) => !!v || "Religion Name is required"], | |
821 | + joinDateRules: [(v) => !!v || " Join Date is required"], | |
822 | + userNameRules: [(v) => !!v || " User Name is required"], | |
823 | + passwordRules: [(v) => !!v || " Password is required"], | |
818 | 824 | errorMessages: "", |
819 | 825 | userRole: [], |
820 | 826 | emailRules: [ |
821 | - v => !!v || "E-mail is required", | |
822 | - v => | |
827 | + (v) => !!v || "E-mail is required", | |
828 | + (v) => | |
823 | 829 | /^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(v) || |
824 | - "E-mail must be valid" | |
830 | + "E-mail must be valid", | |
825 | 831 | ], |
826 | 832 | gender: ["Male", "Female"], |
827 | 833 | headers: [ |
... | ... | @@ -829,13 +835,13 @@ export default { |
829 | 835 | text: "No", |
830 | 836 | align: "", |
831 | 837 | sortable: false, |
832 | - value: "No" | |
838 | + value: "No", | |
833 | 839 | }, |
834 | 840 | { |
835 | 841 | text: "Profile Pic", |
836 | 842 | value: "profilePicUrl", |
837 | 843 | sortable: false, |
838 | - align: "center" | |
844 | + align: "center", | |
839 | 845 | }, |
840 | 846 | { text: "Name", value: "name", sortable: false, align: "center" }, |
841 | 847 | { text: "Email", value: "email", sortable: false, align: "center" }, |
... | ... | @@ -844,21 +850,21 @@ export default { |
844 | 850 | text: "Joining Date", |
845 | 851 | value: "joiningDate", |
846 | 852 | sortable: false, |
847 | - align: "center" | |
853 | + align: "center", | |
848 | 854 | }, |
849 | 855 | { |
850 | 856 | text: "Phone", |
851 | 857 | value: "phone", |
852 | 858 | sortable: false, |
853 | - align: "center" | |
859 | + align: "center", | |
854 | 860 | }, |
855 | 861 | { |
856 | 862 | text: "Status", |
857 | 863 | value: "status", |
858 | 864 | sortable: false, |
859 | - align: "center" | |
865 | + align: "center", | |
860 | 866 | }, |
861 | - { text: "Action", value: "", sortable: false, align: "center" } | |
867 | + { text: "Action", value: "", sortable: false, align: "center" }, | |
862 | 868 | ], |
863 | 869 | Users: [], |
864 | 870 | editedIndex: -1, |
... | ... | @@ -873,7 +879,7 @@ export default { |
873 | 879 | address: "", |
874 | 880 | phone: "", |
875 | 881 | religion: "", |
876 | - joiningDate: null | |
882 | + joiningDate: null, | |
877 | 883 | }, |
878 | 884 | addUser: { |
879 | 885 | role: "", |
... | ... | @@ -887,8 +893,8 @@ export default { |
887 | 893 | presentAddress: "", |
888 | 894 | mobileNo: "", |
889 | 895 | religion: "", |
890 | - joiningDate: null | |
891 | - } | |
896 | + joiningDate: null, | |
897 | + }, | |
892 | 898 | }), |
893 | 899 | watch: { |
894 | 900 | menu(val) { |
... | ... | @@ -896,7 +902,15 @@ export default { |
896 | 902 | }, |
897 | 903 | menu1(val) { |
898 | 904 | val && this.$nextTick(() => (this.$refs.picker.activePicker = "YEAR")); |
899 | - } | |
905 | + }, | |
906 | + addUserDialog: function (val) { | |
907 | + if (!val) { | |
908 | + this.addUser = []; | |
909 | + this.imageName = ""; | |
910 | + this.imageFile = ""; | |
911 | + this.imageUrl = ""; | |
912 | + } | |
913 | + }, | |
900 | 914 | }, |
901 | 915 | methods: { |
902 | 916 | save(date) { |
... | ... | @@ -933,7 +947,7 @@ export default { |
933 | 947 | this.imageUrl = ""; |
934 | 948 | } |
935 | 949 | }, |
936 | - dates: function(date) { | |
950 | + dates: function (date) { | |
937 | 951 | return moment(date).format("MMMM DD, YYYY"); |
938 | 952 | }, |
939 | 953 | getUsersList() { |
... | ... | @@ -941,13 +955,13 @@ export default { |
941 | 955 | var token = this.$store.state.token; |
942 | 956 | http() |
943 | 957 | .get("/getUsersList", { |
944 | - headers: { Authorization: "Bearer " + token } | |
958 | + headers: { Authorization: "Bearer " + token }, | |
945 | 959 | }) |
946 | - .then(response => { | |
960 | + .then((response) => { | |
947 | 961 | this.Users = response.data.data; |
948 | 962 | this.showLoader = false; |
949 | 963 | }) |
950 | - .catch(error => { | |
964 | + .catch((error) => { | |
951 | 965 | this.showLoader = false; |
952 | 966 | if (error.response.status === 401) { |
953 | 967 | this.$router.replace({ path: "/" }); |
... | ... | @@ -982,22 +996,22 @@ export default { |
982 | 996 | }, |
983 | 997 | deleteItem(item) { |
984 | 998 | let deleteUser = { |
985 | - userId: item._id | |
999 | + userId: item._id, | |
986 | 1000 | }; |
987 | 1001 | http() |
988 | 1002 | .delete( |
989 | 1003 | "/deleteUser", |
990 | 1004 | confirm("Are you sure you want to delete this?") && { |
991 | - params: deleteUser | |
1005 | + params: deleteUser, | |
992 | 1006 | } |
993 | 1007 | ) |
994 | - .then(response => { | |
1008 | + .then((response) => { | |
995 | 1009 | this.snackbar = true; |
996 | 1010 | this.text = response.data.message; |
997 | 1011 | this.color = "green"; |
998 | 1012 | this.getUsersList(); |
999 | 1013 | }) |
1000 | - .catch(error => { | |
1014 | + .catch((error) => { | |
1001 | 1015 | this.snackbar = true; |
1002 | 1016 | this.color = "error"; |
1003 | 1017 | this.text = error.response.data.message; |
... | ... | @@ -1021,7 +1035,7 @@ export default { |
1021 | 1035 | address: this.addUser.presentAddress, |
1022 | 1036 | phone: this.addUser.mobileNo, |
1023 | 1037 | religion: this.addUser.religion, |
1024 | - joiningDate: this.addUser.joinDate | |
1038 | + joiningDate: this.addUser.joinDate, | |
1025 | 1039 | }; |
1026 | 1040 | if (this.imageUrl) { |
1027 | 1041 | var str = this.imageUrl; |
... | ... | @@ -1031,7 +1045,7 @@ export default { |
1031 | 1045 | this.loading = true; |
1032 | 1046 | http() |
1033 | 1047 | .post("/createUser", addUserData) |
1034 | - .then(response => { | |
1048 | + .then((response) => { | |
1035 | 1049 | this.imageUrl = ""; |
1036 | 1050 | this.getUsersList(); |
1037 | 1051 | this.snackbar = true; |
... | ... | @@ -1041,7 +1055,7 @@ export default { |
1041 | 1055 | this.clear(); |
1042 | 1056 | this.loading = false; |
1043 | 1057 | }) |
1044 | - .catch(error => { | |
1058 | + .catch((error) => { | |
1045 | 1059 | this.loading = false; |
1046 | 1060 | this.snackbar = true; |
1047 | 1061 | this.color = "error"; |
... | ... | @@ -1068,7 +1082,7 @@ export default { |
1068 | 1082 | } |
1069 | 1083 | http() |
1070 | 1084 | .put("/updateUser", this.editedItem) |
1071 | - .then(response => { | |
1085 | + .then((response) => { | |
1072 | 1086 | this.snackbar = true; |
1073 | 1087 | this.text = response.data.message; |
1074 | 1088 | this.color = "green"; |
... | ... | @@ -1076,7 +1090,7 @@ export default { |
1076 | 1090 | this.getUsersList(); |
1077 | 1091 | this.close(); |
1078 | 1092 | }) |
1079 | - .catch(error => { | |
1093 | + .catch((error) => { | |
1080 | 1094 | this.loading = false; |
1081 | 1095 | this.snackbar = true; |
1082 | 1096 | this.text = error.response.data.message; |
... | ... | @@ -1088,37 +1102,42 @@ export default { |
1088 | 1102 | var token = this.$store.state.token; |
1089 | 1103 | http() |
1090 | 1104 | .get("/getRolesList", { |
1091 | - headers: { Authorization: "Bearer " + token } | |
1105 | + headers: { Authorization: "Bearer " + token }, | |
1092 | 1106 | }) |
1093 | - .then(response => { | |
1107 | + .then((response) => { | |
1094 | 1108 | this.userRole = response.data.data; |
1095 | 1109 | this.showLoader = false; |
1096 | 1110 | this.userRole = response.data.data; |
1097 | - var removedRoles = _.remove(this.userRole, function(c) { | |
1111 | + var removedRoles = _.remove(this.userRole, function (c) { | |
1098 | 1112 | //remove if color is green or yellow |
1099 | - return c.name === "ADMIN" ||c.name === "SUPERADMIN" || c.name === "TEACHER" || c.name === "STUDENT" || c.name === "PARENT" ; | |
1100 | - }); | |
1113 | + return ( | |
1114 | + c.name === "ADMIN" || | |
1115 | + c.name === "SUPERADMIN" || | |
1116 | + c.name === "TEACHER" || | |
1117 | + c.name === "STUDENT" || | |
1118 | + c.name === "PARENT" | |
1119 | + ); | |
1120 | + }); | |
1101 | 1121 | }) |
1102 | - .catch(error => { | |
1122 | + .catch((error) => { | |
1103 | 1123 | this.showLoader = false; |
1104 | - | |
1105 | 1124 | }); |
1106 | 1125 | }, |
1107 | 1126 | suspendStatus(suspendStatus, id) { |
1108 | 1127 | let suspendStatusData = { |
1109 | 1128 | userId: id, |
1110 | - status: suspendStatus | |
1129 | + status: suspendStatus, | |
1111 | 1130 | }; |
1112 | 1131 | this.showLoader = true; |
1113 | 1132 | http() |
1114 | 1133 | .put("/suspendUserAccount", suspendStatusData) |
1115 | - .then(response => { | |
1134 | + .then((response) => { | |
1116 | 1135 | this.getUsersList(); |
1117 | 1136 | this.text = response.data.message; |
1118 | 1137 | this.snackbar = true; |
1119 | 1138 | this.showLoader = false; |
1120 | 1139 | }) |
1121 | - .catch(error => { | |
1140 | + .catch((error) => { | |
1122 | 1141 | // console.log(error.response.data.data); |
1123 | 1142 | this.snackbar = true; |
1124 | 1143 | this.text = error.response.data.message; |
... | ... | @@ -1132,11 +1151,11 @@ export default { |
1132 | 1151 | this.showSearch = false; |
1133 | 1152 | this.show = true; |
1134 | 1153 | this.search = ""; |
1135 | - } | |
1154 | + }, | |
1136 | 1155 | }, |
1137 | 1156 | mounted() { |
1138 | 1157 | this.getUsersList(); |
1139 | 1158 | this.getRole(); |
1140 | - } | |
1159 | + }, | |
1141 | 1160 | }; |
1142 | 1161 | </script> |
1143 | 1162 | \ No newline at end of file | ... | ... |
src/pages/meetingEvent/meetingEvent.vue
... | ... | @@ -232,7 +232,13 @@ |
232 | 232 | </v-card-title> |
233 | 233 | <v-flex xs8 sm8 md3 lg2 v-if="showSearch"> |
234 | 234 | <v-layout> |
235 | - <v-text-field autofocus v-model="search" label="Search" prepend-inner-icon="search" color="primary"></v-text-field> | |
235 | + <v-text-field | |
236 | + autofocus | |
237 | + v-model="search" | |
238 | + label="Search" | |
239 | + prepend-inner-icon="search" | |
240 | + color="primary" | |
241 | + ></v-text-field> | |
236 | 242 | <v-icon @click="closeSearch" color="error">close</v-icon> |
237 | 243 | </v-layout> |
238 | 244 | </v-flex> |
... | ... | @@ -291,15 +297,19 @@ |
291 | 297 | >Your search for "{{ search }}" found no results.</v-alert> |
292 | 298 | </v-data-table> |
293 | 299 | <!-- ****** ADD MULTIPLE EVENT ****** --> |
294 | - <v-dialog v-model="meetEventDialog" max-width="500px" persistent> | |
300 | + <v-dialog v-model="meetEventDialog" max-width="500px" persistent v-if="meetEventDialog"> | |
295 | 301 | <v-card flat class="card-style pa-2" dark> |
296 | 302 | <v-layout> |
297 | 303 | <v-flex xs12> |
298 | 304 | <label class="title text-xs-center">Add Meeting Event</label> |
299 | - <v-icon size="24" class="right" @click="meetEventDialog = false; $refs.form.reset()">cancel</v-icon> | |
305 | + <v-icon | |
306 | + size="24" | |
307 | + class="right" | |
308 | + @click="meetEventDialog = false; $refs.form.reset()" | |
309 | + >cancel</v-icon> | |
300 | 310 | </v-flex> |
301 | 311 | </v-layout> |
302 | - <v-form ref="form" v-model="valid" lazy-validation > | |
312 | + <v-form ref="form" v-model="valid" lazy-validation> | |
303 | 313 | <v-container fluid> |
304 | 314 | <v-flex xs12> |
305 | 315 | <v-layout> |
... | ... | @@ -399,7 +409,6 @@ |
399 | 409 | label="Select Type Of Event" |
400 | 410 | v-model="meetEvent.typeOfEvent" |
401 | 411 | :rules="typeOfEventRules" |
402 | - | |
403 | 412 | ></v-select> |
404 | 413 | </v-flex> |
405 | 414 | </v-layout> |
... | ... | @@ -507,59 +516,66 @@ export default { |
507 | 516 | addclass: [], |
508 | 517 | courseData: [], |
509 | 518 | pagination: { |
510 | - rowsPerPage: 10 | |
519 | + rowsPerPage: 10, | |
511 | 520 | }, |
512 | 521 | date: null, |
513 | 522 | menu1: false, |
514 | 523 | menu: false, |
515 | 524 | menuEditTime: false, |
516 | 525 | menuEditDate: false, |
517 | - titleRules: [v => !!v || " Tilte is required"], | |
518 | - descriptionRules: [v => !!v || " Discription is required"], | |
519 | - dateRules: [v => !!v || "Date of event is required"], | |
520 | - startTimeRules: [v => !!v || "Start Time is required"], | |
521 | - typeOfEventRules: [v => !!v || "Type of event is required"], | |
526 | + titleRules: [(v) => !!v || " Tilte is required"], | |
527 | + descriptionRules: [(v) => !!v || " Discription is required"], | |
528 | + dateRules: [(v) => !!v || "Date of event is required"], | |
529 | + startTimeRules: [(v) => !!v || "Start Time is required"], | |
530 | + typeOfEventRules: [(v) => !!v || "Type of event is required"], | |
522 | 531 | headers: [ |
523 | 532 | { |
524 | 533 | text: "No", |
525 | 534 | align: "", |
526 | 535 | sortable: false, |
527 | - value: "No" | |
536 | + value: "No", | |
528 | 537 | }, |
529 | 538 | { |
530 | 539 | text: "Class", |
531 | 540 | value: "classNum", |
532 | 541 | sortable: false, |
533 | - align: "center" | |
542 | + align: "center", | |
534 | 543 | }, |
535 | 544 | { text: "Title", value: "title", sortable: false, align: "center" }, |
536 | 545 | { |
537 | 546 | text: "Date Of Event", |
538 | 547 | value: "dateOfEvent", |
539 | 548 | sortable: false, |
540 | - align: "center" | |
549 | + align: "center", | |
541 | 550 | }, |
542 | 551 | { |
543 | 552 | text: "Start Time", |
544 | 553 | value: "startTime", |
545 | 554 | sortable: false, |
546 | - align: "center" | |
555 | + align: "center", | |
547 | 556 | }, |
548 | - { text: "Action", value: "", sortable: false, align: "center" } | |
557 | + { text: "Action", value: "", sortable: false, align: "center" }, | |
549 | 558 | ], |
550 | 559 | events: [], |
551 | 560 | typeOfEvent: ["Class", "Course"], |
552 | 561 | editedIndex: -1, |
553 | 562 | meetEvent: { |
554 | - startTime: null | |
563 | + startTime: null, | |
555 | 564 | }, |
556 | 565 | editedItem: {}, |
557 | 566 | menu1: false, |
558 | 567 | menu2: false, |
559 | - loginId: "" | |
568 | + loginId: "", | |
560 | 569 | }), |
570 | + watch: { | |
571 | + meetEventDialog: function (val) { | |
572 | + if (!val) { | |
573 | + this.meetEvent = []; | |
574 | + } | |
575 | + }, | |
576 | + }, | |
561 | 577 | methods: { |
562 | - dates: function(date) { | |
578 | + dates: function (date) { | |
563 | 579 | return moment(date).format("MMMM DD, YYYY"); |
564 | 580 | }, |
565 | 581 | getEvents() { |
... | ... | @@ -568,13 +584,13 @@ export default { |
568 | 584 | http() |
569 | 585 | .get("/getMeetingEventesList", { |
570 | 586 | params: { teacherId: this.loginId }, |
571 | - headers: { Authorization: "Bearer " + token } | |
587 | + headers: { Authorization: "Bearer " + token }, | |
572 | 588 | }) |
573 | - .then(response => { | |
589 | + .then((response) => { | |
574 | 590 | this.events = response.data.data; |
575 | 591 | this.showLoader = false; |
576 | 592 | }) |
577 | - .catch(error => { | |
593 | + .catch((error) => { | |
578 | 594 | // console.log("err====>", err); |
579 | 595 | this.showLoader = false; |
580 | 596 | if (error.response.status === 401) { |
... | ... | @@ -588,7 +604,9 @@ export default { |
588 | 604 | this.editedIndex = this.events.indexOf(item); |
589 | 605 | this.editedItem = Object.assign({}, item); |
590 | 606 | this.editedItem.meetingEventId = item._id; |
591 | - this.editedItem.startTime = moment(this.editedItem.startTime, ["h:mm A"]).format("HH:mm"); | |
607 | + this.editedItem.startTime = moment(this.editedItem.startTime, [ | |
608 | + "h:mm A", | |
609 | + ]).format("HH:mm"); | |
592 | 610 | this.editEventdialog = true; |
593 | 611 | }, |
594 | 612 | profile(item) { |
... | ... | @@ -599,16 +617,16 @@ export default { |
599 | 617 | |
600 | 618 | deleteItem(item) { |
601 | 619 | let deleteEvent = { |
602 | - meetingEventId: item._id | |
620 | + meetingEventId: item._id, | |
603 | 621 | }; |
604 | 622 | http() |
605 | 623 | .delete( |
606 | 624 | "/deleteMeetingEvent", |
607 | 625 | confirm("Are you sure you want to delete this?") && { |
608 | - params: deleteEvent | |
626 | + params: deleteEvent, | |
609 | 627 | } |
610 | 628 | ) |
611 | - .then(response => { | |
629 | + .then((response) => { | |
612 | 630 | this.snackbar = true; |
613 | 631 | this.text = response.data.message; |
614 | 632 | this.getEvents(); |
... | ... | @@ -616,7 +634,7 @@ export default { |
616 | 634 | this.color = "green"; |
617 | 635 | this.text = response.data.message; |
618 | 636 | }) |
619 | - .catch(error => { | |
637 | + .catch((error) => { | |
620 | 638 | this.snackbar = true; |
621 | 639 | this.text = error.response.data.message; |
622 | 640 | this.color = "error"; |
... | ... | @@ -626,10 +644,10 @@ export default { |
626 | 644 | getAllClass() { |
627 | 645 | http() |
628 | 646 | .get("/getClassesList") |
629 | - .then(response => { | |
647 | + .then((response) => { | |
630 | 648 | this.addclass = response.data.data; |
631 | 649 | }) |
632 | - .catch(error => { | |
650 | + .catch((error) => { | |
633 | 651 | // console.log("err====>", err); |
634 | 652 | // this.$router.replace({ path: "/" }); |
635 | 653 | }); |
... | ... | @@ -639,14 +657,14 @@ export default { |
639 | 657 | http() |
640 | 658 | .get("/getCourseesList", { |
641 | 659 | params: { |
642 | - classId: classId | |
643 | - } | |
660 | + classId: classId, | |
661 | + }, | |
644 | 662 | }) |
645 | - .then(response => { | |
663 | + .then((response) => { | |
646 | 664 | this.courseData = response.data.data; |
647 | 665 | this.showLoader = false; |
648 | 666 | }) |
649 | - .catch(err => { | |
667 | + .catch((err) => { | |
650 | 668 | console.log("err====>", err); |
651 | 669 | this.showLoader = false; |
652 | 670 | }); |
... | ... | @@ -657,10 +675,13 @@ export default { |
657 | 675 | submit() { |
658 | 676 | if (this.$refs.form.validate()) { |
659 | 677 | this.loading = true; |
660 | - this.meetEvent.startTime = moment(this.meetEvent.startTime, "hh:mm").format("LT"); | |
678 | + this.meetEvent.startTime = moment( | |
679 | + this.meetEvent.startTime, | |
680 | + "hh:mm" | |
681 | + ).format("LT"); | |
661 | 682 | http() |
662 | 683 | .post("/createMeetingEvent", this.meetEvent) |
663 | - .then(response => { | |
684 | + .then((response) => { | |
664 | 685 | this.snackbar = true; |
665 | 686 | this.text = response.data.message; |
666 | 687 | this.color = "green"; |
... | ... | @@ -669,7 +690,7 @@ export default { |
669 | 690 | this.loading = false; |
670 | 691 | this.meetEventDialog = false; |
671 | 692 | }) |
672 | - .catch(error => { | |
693 | + .catch((error) => { | |
673 | 694 | this.snackbar = true; |
674 | 695 | this.text = error.response.data.message; |
675 | 696 | this.color = "error"; |
... | ... | @@ -681,23 +702,26 @@ export default { |
681 | 702 | this.$refs.form.reset(); |
682 | 703 | }, |
683 | 704 | save() { |
684 | - console.log('=======this.editedItem=====', this.editedItem); | |
705 | + console.log("=======this.editedItem=====", this.editedItem); | |
685 | 706 | if (this.editedItem.courseId) { |
686 | 707 | this.editedItem.courseId = this.editedItem.courseId._id; |
687 | 708 | } |
688 | 709 | delete this.editedItem.classId; |
689 | - | |
690 | - this.editedItem.startTime = moment(this.editedItem.startTime, "hh:mm").format("LT"); | |
710 | + | |
711 | + this.editedItem.startTime = moment( | |
712 | + this.editedItem.startTime, | |
713 | + "hh:mm" | |
714 | + ).format("LT"); | |
691 | 715 | http() |
692 | 716 | .put("/updateMeetingEvent", this.editedItem) |
693 | - .then(response => { | |
717 | + .then((response) => { | |
694 | 718 | this.snackbar = true; |
695 | 719 | this.text = response.data.message; |
696 | 720 | this.color = "green"; |
697 | 721 | this.getEvents(); |
698 | 722 | this.close(); |
699 | 723 | }) |
700 | - .catch(error => { | |
724 | + .catch((error) => { | |
701 | 725 | this.snackbar = true; |
702 | 726 | this.text = error.response.data.message; |
703 | 727 | this.color = "error"; |
... | ... | @@ -710,12 +734,12 @@ export default { |
710 | 734 | this.showSearch = false; |
711 | 735 | this.show = true; |
712 | 736 | this.search = ""; |
713 | - } | |
737 | + }, | |
714 | 738 | }, |
715 | 739 | mounted() { |
716 | 740 | this.loginId = this.$store.state.id; |
717 | 741 | this.getEvents(); |
718 | 742 | this.getAllClass(); |
719 | - } | |
743 | + }, | |
720 | 744 | }; |
721 | 745 | </script> |
722 | 746 | \ No newline at end of file | ... | ... |
src/pages/socialMedia/socialMedia.vue
... | ... | @@ -114,9 +114,15 @@ |
114 | 114 | </v-avatar> |
115 | 115 | </v-btn> |
116 | 116 | </v-card-title> |
117 | - <v-flex xs8 sm8 md3 lg2 v-if="showSearch"> | |
117 | + <v-flex xs8 sm8 md3 lg2 v-if="showSearch"> | |
118 | 118 | <v-layout> |
119 | - <v-text-field autofocus v-model="search" label="Search" prepend-inner-icon="search" color="primary"></v-text-field> | |
119 | + <v-text-field | |
120 | + autofocus | |
121 | + v-model="search" | |
122 | + label="Search" | |
123 | + prepend-inner-icon="search" | |
124 | + color="primary" | |
125 | + ></v-text-field> | |
120 | 126 | <v-icon @click="closeSearch" color="error">close</v-icon> |
121 | 127 | </v-layout> |
122 | 128 | </v-flex> |
... | ... | @@ -176,12 +182,12 @@ |
176 | 182 | >Your search for "{{ search }}" found no results.</v-alert> |
177 | 183 | </v-data-table> |
178 | 184 | <!-- ****** ADD MULTIPLE REMINDER ****** --> |
179 | - <v-dialog v-model="addSocialMediaDialog" max-width="400px"> | |
185 | + <v-dialog v-model="addSocialMediaDialog" max-width="400px" v-if="addSocialMediaDialog"> | |
180 | 186 | <v-card flat class="card-style pa-2" dark> |
181 | 187 | <v-layout> |
182 | 188 | <v-flex xs12> |
183 | 189 | <label class="title text-xs-center">Add Social Media</label> |
184 | - <v-icon size="24" class="right" @click="addSocialMediaDialog = false">cancel</v-icon> | |
190 | + <v-icon size="24" class="right" @click="closeAddSocialMediaModel">cancel</v-icon> | |
185 | 191 | </v-flex> |
186 | 192 | </v-layout> |
187 | 193 | <v-form ref="form" v-model="valid" lazy-validation> |
... | ... | @@ -272,29 +278,29 @@ export default { |
272 | 278 | profileSocialMediaDialog: false, |
273 | 279 | valid: true, |
274 | 280 | pagination: { |
275 | - rowsPerPage: 10 | |
281 | + rowsPerPage: 10, | |
276 | 282 | }, |
277 | 283 | imageData: {}, |
278 | 284 | imageName: "", |
279 | 285 | imageUrl: "", |
280 | 286 | imageFile: "", |
281 | - socialRules: [v => !!v || " Social media type is required"], | |
282 | - linkUrlnRules: [v => !!v || " Link Url is required"], | |
287 | + socialRules: [(v) => !!v || " Social media type is required"], | |
288 | + linkUrlnRules: [(v) => !!v || " Link Url is required"], | |
283 | 289 | headers: [ |
284 | 290 | { |
285 | 291 | text: "No", |
286 | 292 | align: "", |
287 | 293 | sortable: false, |
288 | - value: "No" | |
294 | + value: "No", | |
289 | 295 | }, |
290 | 296 | { text: "Type", value: "type", sortable: false, align: "center" }, |
291 | 297 | { |
292 | 298 | text: "Link Url", |
293 | 299 | value: "linkUrl", |
294 | 300 | sortable: false, |
295 | - align: "center" | |
301 | + align: "center", | |
296 | 302 | }, |
297 | - { text: "Action", value: "", sortable: false, align: "center" } | |
303 | + { text: "Action", value: "", sortable: false, align: "center" }, | |
298 | 304 | ], |
299 | 305 | desserts: [], |
300 | 306 | editedIndex: -1, |
... | ... | @@ -303,15 +309,22 @@ export default { |
303 | 309 | socialLink: [ |
304 | 310 | { |
305 | 311 | name: "Face Book", |
306 | - value: "FACEBOOK" | |
312 | + value: "FACEBOOK", | |
307 | 313 | }, |
308 | 314 | { |
309 | 315 | name: "You Tube", |
310 | - value: "YOUTUBE" | |
311 | - } | |
316 | + value: "YOUTUBE", | |
317 | + }, | |
312 | 318 | ], |
313 | - userName: "" | |
319 | + userName: "", | |
314 | 320 | }), |
321 | + watch: { | |
322 | + addSocialMediaDialog: function (val) { | |
323 | + if (!val) { | |
324 | + this.socialMedia = []; | |
325 | + } | |
326 | + }, | |
327 | + }, | |
315 | 328 | methods: { |
316 | 329 | // pickFile() { |
317 | 330 | // this.$refs.image.click(); |
... | ... | @@ -346,13 +359,13 @@ export default { |
346 | 359 | var token = this.$store.state.token; |
347 | 360 | http() |
348 | 361 | .get("/getSocialList", { |
349 | - headers: { Authorization: "Bearer " + token } | |
362 | + headers: { Authorization: "Bearer " + token }, | |
350 | 363 | }) |
351 | - .then(response => { | |
364 | + .then((response) => { | |
352 | 365 | this.desserts = response.data.data; |
353 | 366 | this.showLoader = false; |
354 | 367 | }) |
355 | - .catch(error => { | |
368 | + .catch((error) => { | |
356 | 369 | this.showLoader = false; |
357 | 370 | if (error.response.status === 401) { |
358 | 371 | this.$router.replace({ path: "/" }); |
... | ... | @@ -374,22 +387,22 @@ export default { |
374 | 387 | |
375 | 388 | deleteItem(item) { |
376 | 389 | let deleteSocialMedia = { |
377 | - socialId: item._id | |
390 | + socialId: item._id, | |
378 | 391 | }; |
379 | 392 | http() |
380 | 393 | .delete( |
381 | 394 | "/deleteSocial", |
382 | 395 | confirm("Are you sure you want to delete this?") && { |
383 | - params: deleteSocialMedia | |
396 | + params: deleteSocialMedia, | |
384 | 397 | } |
385 | 398 | ) |
386 | - .then(response => { | |
399 | + .then((response) => { | |
387 | 400 | this.snackbar = true; |
388 | 401 | this.text = response.data.message; |
389 | 402 | this.color = "green"; |
390 | 403 | this.getSocialMedia(); |
391 | 404 | }) |
392 | - .catch(error => { | |
405 | + .catch((error) => { | |
393 | 406 | this.snackbar = true; |
394 | 407 | this.text = error.response.data.message; |
395 | 408 | this.color = "error"; |
... | ... | @@ -398,12 +411,16 @@ export default { |
398 | 411 | close() { |
399 | 412 | this.editSocialMediaDialog = false; |
400 | 413 | }, |
414 | + closeAddSocialMediaModel() { | |
415 | + this.addSocialMediaDialog = false; | |
416 | + this.socialMedia = []; | |
417 | + }, | |
401 | 418 | submit() { |
402 | 419 | if (this.$refs.form.validate()) { |
403 | 420 | this.loading = true; |
404 | 421 | http() |
405 | 422 | .post("/addSocialLinks", this.socialMedia) |
406 | - .then(response => { | |
423 | + .then((response) => { | |
407 | 424 | this.snackbar = true; |
408 | 425 | this.text = response.data.message; |
409 | 426 | this.color = "green"; |
... | ... | @@ -412,7 +429,7 @@ export default { |
412 | 429 | this.addSocialMediaDialog = false; |
413 | 430 | this.loading = false; |
414 | 431 | }) |
415 | - .catch(error => { | |
432 | + .catch((error) => { | |
416 | 433 | this.snackbar = true; |
417 | 434 | this.color = "error"; |
418 | 435 | this.text = error.response.data.message; |
... | ... | @@ -427,14 +444,14 @@ export default { |
427 | 444 | (this.editedItem.socialId = this.editedItem._id), |
428 | 445 | http() |
429 | 446 | .put("/updateSocial", this.editedItem) |
430 | - .then(response => { | |
447 | + .then((response) => { | |
431 | 448 | this.snackbar = true; |
432 | 449 | this.text = response.data.message; |
433 | 450 | this.color = "green"; |
434 | 451 | this.getSocialMedia(); |
435 | 452 | this.close(); |
436 | 453 | }) |
437 | - .catch(error => { | |
454 | + .catch((error) => { | |
438 | 455 | this.snackbar = true; |
439 | 456 | this.text = error.response.data.message; |
440 | 457 | this.color = "error"; |
... | ... | @@ -447,10 +464,10 @@ export default { |
447 | 464 | this.showSearch = false; |
448 | 465 | this.show = true; |
449 | 466 | this.search = ""; |
450 | - } | |
467 | + }, | |
451 | 468 | }, |
452 | 469 | mounted() { |
453 | 470 | this.getSocialMedia(); |
454 | - } | |
471 | + }, | |
455 | 472 | }; |
456 | 473 | </script> |
457 | 474 | \ No newline at end of file | ... | ... |