From 8e8d14254aba599c809fbc97d4ad2c789a65389a Mon Sep 17 00:00:00 2001 From: Shikha Mishra Date: Thu, 13 Aug 2020 18:30:44 +0530 Subject: [PATCH] Cleared data while clicking outside the add/edit model and also on cross icon while login any role, Improve getParticularClass API, and Improve getStudentWithClass API --- src/pages/Academic/assignment.vue | 18 ++- src/pages/Academic/routine.vue | 22 ++- src/pages/Academic/subject.vue | 19 ++- src/pages/Academic/syllabus.vue | 106 +++++++------- src/pages/Account/expense.vue | 85 ++++++++---- src/pages/Account/feeTypes.vue | 69 +++++---- src/pages/Account/income.vue | 79 +++++++---- src/pages/Account/invoice.vue | 167 ++++++++++++---------- src/pages/Administrator/academicYear.vue | 76 ++++++---- src/pages/Annoucement/annoucement.vue | 26 +++- src/pages/Attendence/studentAttendence.vue | 53 ++++++- src/pages/Attendence/teacherAttendence.vue | 68 +++++---- src/pages/Class/addclass.vue | 25 +++- src/pages/Course/course.vue | 30 +++- src/pages/Course/courseDetail.vue | 8 +- src/pages/Event/event.vue | 69 +++++---- src/pages/Exam/exam.vue | 74 +++++----- src/pages/Exam/examSchedule.vue | 111 ++++++++------- src/pages/Exam/grade.vue | 91 +++++++----- src/pages/Gallery/gallery.vue | 129 ++++++++++------- src/pages/Holiday/holiday.vue | 67 +++++---- src/pages/Library/books.vue | 17 ++- src/pages/Library/eBook.vue | 30 +++- src/pages/Library/issue.vue | 116 ++++++++++------ src/pages/Library/member.vue | 58 +++++--- src/pages/Mark/mark.vue | 110 +++++++++------ src/pages/News/news.vue | 99 ++++++++----- src/pages/NoticeBoard/noticeBoard.vue | 81 +++++++---- src/pages/Notification/notification.vue | 73 ++++++---- src/pages/Parent/parents.vue | 15 +- src/pages/Payroll/hourlyTemplate.vue | 94 ++++++++----- src/pages/Payroll/salaryTemplate.vue | 216 ++++++++++++++++++----------- src/pages/Section/section.vue | 87 +++++++----- src/pages/Students/students.vue | 12 +- src/pages/Teachers/teachers.vue | 106 ++++++++------ src/pages/TimeTable/timeTable.vue | 172 ++++++++++++----------- src/pages/User/user.vue | 129 +++++++++-------- src/pages/meetingEvent/meetingEvent.vue | 110 +++++++++------ src/pages/socialMedia/socialMedia.vue | 71 ++++++---- 39 files changed, 1870 insertions(+), 1118 deletions(-) diff --git a/src/pages/Academic/assignment.vue b/src/pages/Academic/assignment.vue index 776d359..303ee6e 100644 --- a/src/pages/Academic/assignment.vue +++ b/src/pages/Academic/assignment.vue @@ -316,12 +316,12 @@ v-model="snackbar" :color="color" >{{ text }} - + - cancel + cancel @@ -609,6 +609,14 @@ export default { subjectRules: [(v) => !!v || "Student is required"], fileRules: [(v) => !!v || "File is required"], }), + watch: { + addAssignmentDialog: function (val) { + if (!val) { + this.addAssignment = []; + this.imageName = ""; + } + }, + }, methods: { dates: function (date) { return moment(date).format("MMMM DD, YYYY"); @@ -660,6 +668,12 @@ export default { close1() { this.viewAssignmentDialog = false; }, + closeAddAssignmentModel() { + this.addAssignmentDialog = false; + this.assignmentData = []; + this.addAssignment = []; + this.imageName = ""; + }, submit() { var addAssignment = { title: this.addAssignment.title, diff --git a/src/pages/Academic/routine.vue b/src/pages/Academic/routine.vue index 1271688..4370a8c 100644 --- a/src/pages/Academic/routine.vue +++ b/src/pages/Academic/routine.vue @@ -23,7 +23,7 @@ item-text="classNum" item-value="_id" :rules="classRules" - @change="getClassSubject(addRoutine.classId)" + @change="getClassSubject(editedItem.classId)" required > @@ -222,7 +222,7 @@ {{ text }} - + + v-if="addRoutineDialog" - cancel + cancel @@ -671,6 +672,13 @@ export default { startingTime: "", editedItem: {}, }), + watch: { + addRoutineDialog: function (val) { + if (!val) { + this.addRoutine = []; + } + }, + }, methods: { editItem(item, routineData) { console.log("routineData", routineData); @@ -709,7 +717,11 @@ export default { close() { this.editRoutineDialog = false; }, - + closeAddRoutineModel() { + this.addRoutineDialog = false; + this.classList = []; + this.addRoutine = []; + }, create() { var routineData = { schoolYear: this.addRoutine.schoolYear, diff --git a/src/pages/Academic/subject.vue b/src/pages/Academic/subject.vue index 96b9abd..1537a8b 100644 --- a/src/pages/Academic/subject.vue +++ b/src/pages/Academic/subject.vue @@ -285,7 +285,7 @@ {{ text }} - + - cancel + cancel @@ -625,6 +629,13 @@ export default { // subjectAuthor: "" }, }), + watch: { + addSubjectDialog: function (val) { + if (!val) { + this.addSubject = []; + } + }, + }, methods: { pickFile() { this.$refs.image.click(); @@ -682,7 +693,7 @@ export default { this.text = "New Subject added successfully"; this.color = "green"; this.addLoading = false; - this.$refs.form.reset() + this.$refs.form.reset(); this.addSubjectDialog = false; this.getClassSubject(_id); }) diff --git a/src/pages/Academic/syllabus.vue b/src/pages/Academic/syllabus.vue index c45f6f9..5101d3a 100644 --- a/src/pages/Academic/syllabus.vue +++ b/src/pages/Academic/syllabus.vue @@ -165,7 +165,7 @@ {{ props.item.teacherId.name }} - {{ props.item.schoolId.name }} + {{ props.item.schoolId.name }} {{ text }} - + - cancel + cancel @@ -398,52 +395,52 @@ export default { loadingPdf: false, pagination: { - rowsPerPage: 10 + rowsPerPage: 10, }, token: "", upload: "", - titleRules: [v => !!v || " Title is required"], - descriptionRules: [v => !!v || " Description is required"], - classRules: [v => !!v || " Class Name is required"], - fileRules: [v => !!v || " File is required"], + titleRules: [(v) => !!v || " Title is required"], + descriptionRules: [(v) => !!v || " Description is required"], + classRules: [(v) => !!v || " Class Name is required"], + fileRules: [(v) => !!v || " File is required"], headers: [ { text: "No", align: "", sortable: false, - value: "No" + value: "No", }, { text: "Title", value: "title", sortable: false, - align: "center" + align: "center", }, { text: "Description", value: "description", sortable: false, - align: "center" + align: "center", }, { text: "Date", value: "created", sortable: false, - align: "center" + align: "center", }, { text: "Uploader", value: "upload", sortable: false, - align: "center" + align: "center", }, { text: "File", value: "documentUrl", sortable: false, - align: "center" + align: "center", }, - { text: "Action", value: "", sortable: false, align: "center" } + { text: "Action", value: "", sortable: false, align: "center" }, ], syllabusList: [], classList: [], @@ -453,19 +450,28 @@ export default { showSyllabus: {}, editedItem: { - subjectName: "" + subjectName: "", }, imageData: {}, imageName: "", imageUrl: "", - imageFile: "" + imageFile: "", }), + watch: { + addSyllabusDialog: function (val) { + if (!val) { + this.addSyllabus = []; + this.imageName = ""; + } + }, + }, + methods: { pickFile() { this.$refs.image.click(); }, - dates: function(date) { + dates: function (date) { return moment(date).format("MMMM DD, YYYY"); }, editItem(item) { @@ -481,22 +487,22 @@ export default { }, deleteItem(item) { let deleteSyallabus = { - syallabusId: item._id + syallabusId: item._id, }; http() .delete( "/deleteSyallabus", confirm("Are you sure you want to delete this?") && { - params: deleteSyallabus + params: deleteSyallabus, } ) - .then(response => { + .then((response) => { this.getSyallabusList(); this.snackbar = true; this.color = "green"; this.text = "Successfully delete Existing Syllabus"; }) - .catch(error => { + .catch((error) => { this.snackbar = true; this.text = error.response.data.message; this.color = "error"; @@ -505,6 +511,12 @@ export default { close() { this.editSyllabusDialog = false; }, + closeAddStudentModel() { + this.addSyllabusDialog = false; + this.syllabusList = []; + this.addSyllabus = []; + this.imageName = ""; + }, submit() { // var addSyllabus = { @@ -521,7 +533,7 @@ export default { "/": "image", AAABAA: "image", IywiV2hhdC: "other", - bmFtZSxl: "other" + bmFtZSxl: "other", }; function detectMimeType(b64) { for (var s in signatures) { @@ -540,7 +552,7 @@ export default { } http() .post("/createSyallabus", this.addSyllabus) - .then(response => { + .then((response) => { this.getSyallabusList(); this.snackbar = true; this.text = "Syllabus added successfully"; @@ -548,7 +560,7 @@ export default { this.color = "green"; this.addSyllabusDialog = false; }) - .catch(error => { + .catch((error) => { // console.log(error); this.snackbar = true; this.text = error.response.data.message; @@ -590,7 +602,7 @@ export default { description: this.editedItem.description, upload: this.editedItem.upload, fileType: this.editedItem.fileType, - fileName: this.imageName + fileName: this.imageName, }; this.editLoading = true; var signatures = { @@ -599,7 +611,7 @@ export default { UEsDBBQ: "other", "/": "image", AAABAA: "image", - IywiV2hhdC: "other" + IywiV2hhdC: "other", }; function detectMimeType(b64) { for (var s in signatures) { @@ -616,7 +628,7 @@ export default { } http() .put("/updateSyallabus", syllabusData) - .then(response => { + .then((response) => { this.snackbar = true; this.text = "Successfully Edit Existing Syllabus"; this.color = "green"; @@ -627,23 +639,23 @@ export default { "/getSyallabusList", { params: { classId: this.addSyllabus.classId } }, { - headers: { Authorization: "Bearer " + this.token } + headers: { Authorization: "Bearer " + this.token }, } ) - .then(response => { + .then((response) => { this.syllabusList = response.data.data; this.getSyallabusList(); this.snackbar = true; this.color = "green"; this.close(); }) - .catch(err => { + .catch((err) => { console.log("err====>", err); this.text = error.response.data.message; this.color = "error"; }); }) - .catch(error => { + .catch((error) => { this.editLoading = false; }); } @@ -655,26 +667,26 @@ export default { "/getSyallabusList", { params: { classId: this.showSyllabus.classId } }, { - headers: { Authorization: "Bearer " + this.token } + headers: { Authorization: "Bearer " + this.token }, } ) - .then(response => { + .then((response) => { this.syllabusList = response.data.data; this.showLoader = false; }) - .catch(err => { + .catch((err) => { this.showLoader = false; }); }, getClass() { http() .get("/getClassesList", { - headers: { Authorization: "Bearer " + this.token } + headers: { Authorization: "Bearer " + this.token }, }) - .then(response => { + .then((response) => { this.classList = response.data.data; }) - .catch(error => { + .catch((error) => { if (error.response.status === 401) { this.$router.replace({ path: "/" }); this.$store.dispatch("setToken", null); @@ -690,14 +702,14 @@ export default { "/getSectionsList", { params: { classId: _id } }, { - headers: { Authorization: "Bearer " + token } + headers: { Authorization: "Bearer " + token }, } ) - .then(response => { + .then((response) => { this.addSection = response.data.data; this.showLoader = false; }) - .catch(err => { + .catch((err) => { this.showLoader = false; }); }, @@ -768,12 +780,12 @@ export default { // link.download = dataType // link.click() // URL.revokeObjectURL(link.href) - } + }, }, mounted() { this.token = this.$store.state.token; this.role = this.$store.state.role; this.getClass(); - } + }, }; \ No newline at end of file diff --git a/src/pages/Account/expense.vue b/src/pages/Account/expense.vue index 645f43b..9e44e41 100644 --- a/src/pages/Account/expense.vue +++ b/src/pages/Account/expense.vue @@ -18,7 +18,11 @@ - + - + close @@ -307,12 +317,12 @@ - + - cancel + cancel @@ -504,37 +514,37 @@ export default { addExpenseDialog: false, showSearch: false, pagination: { - rowsPerPage: 10 + rowsPerPage: 10, }, imageData: {}, token: "", imageName: "", imageUrl: "", imageFile: "", - nameRules: [v => !!v || " Full Name is required"], - amountRules: [v => !!v || "Amount is required"], - noteRules: [v => !!v || "Note Name is required"], - joinDateRules: [v => !!v || "Date is required"], + nameRules: [(v) => !!v || " Full Name is required"], + amountRules: [(v) => !!v || "Amount is required"], + noteRules: [(v) => !!v || "Note Name is required"], + joinDateRules: [(v) => !!v || "Date is required"], errorMessages: "", headers: [ { text: "No", align: "center", sortable: false, - value: "No" + value: "No", }, { text: "Profile Pic", value: "profilePicUrl", sortable: false, - align: "center" + align: "center", }, { text: "Name", value: "name", sortable: false, align: "center" }, { text: "Date", value: "date", sortable: false, align: "center" }, { text: "User", value: "user", sortable: false, align: "center" }, { text: "Amount", value: "amount", sortable: false, align: "center" }, { text: "Note", value: "note", sortable: false, align: "center" }, - { text: "Action", value: "", sortable: false, align: "center" } + { text: "Action", value: "", sortable: false, align: "center" }, ], expenseList: [], editedIndex: -1, @@ -551,9 +561,9 @@ export default { presentAddress: "", mobileNo: "", state: "", - joinDate: null + joinDate: null, }, - addExpense: {} + addExpense: {}, }), watch: { menu(val) { @@ -561,7 +571,16 @@ export default { }, menu1(val) { val && this.$nextTick(() => (this.$refs.picker.activePicker = "YEAR")); - } + }, + addExpenseDialog: function (val) { + if (!val) { + this.addExpense = []; + this.menu1 = false; + this.imageName = ""; + this.imageFile = ""; + this.imageUrl = ""; + } + }, }, methods: { save(date) { @@ -573,7 +592,7 @@ export default { pickFile() { this.$refs.image.click(); }, - dates: function(date) { + dates: function (date) { return moment(date).format("MMMM DD, YYYY"); }, onFilePicked(e) { @@ -605,14 +624,14 @@ export default { http() .get("/getExpensesList", { params: { schoolId: this.$store.state.schoolId }, - headers: { Authorization: "Bearer " + this.token } + headers: { Authorization: "Bearer " + this.token }, }) - .then(response => { + .then((response) => { this.expenseList = response.data.data; this.showLoader = false; // console.log("getTeacherList=====>",this.expenseList) }) - .catch(error => { + .catch((error) => { this.showLoader = false; // if (error.response.status === 401) { // this.$router.replace({ path: "/" }); @@ -638,24 +657,24 @@ export default { }, deleteItem(item) { let deleteExpense = { - expenseId: item._id + expenseId: item._id, }; // console.log("deleteUers",deleteTeachers) http() .delete( "/deleteExpense", confirm("Are you sure you want to delete this?") && { - params: deleteExpense + params: deleteExpense, } ) - .then(response => { + .then((response) => { // console.log("deleteUers",deleteTeachers) this.snackbar = true; this.text = response.data.message; this.color = "green"; this.getExpenseList(); }) - .catch(error => { + .catch((error) => { this.snackbar = true; this.text = error.response.data.message; this.color = "error"; @@ -664,6 +683,14 @@ export default { close() { this.editExpenseDialog = false; }, + closeAddExpenseModel() { + this.addExpenseDialog = false; + this.addExpense = []; + this.menu1 = false; + this.imageName = ""; + this.imageFile = ""; + this.imageUrl = ""; + }, submit() { if (this.$refs.form.validate()) { if (this.imageUrl) { @@ -675,7 +702,7 @@ export default { // this.addExpense = this.$store.state.schoolId; http() .post("/createExpense", this.addExpense) - .then(response => { + .then((response) => { this.getExpenseList(); this.snackbar = true; this.text = response.data.message; @@ -685,7 +712,7 @@ export default { this.loading = false; this.addExpenseDialog = false; }) - .catch(error => { + .catch((error) => { // console.log(error); this.snackbar = true; this.color = "error"; @@ -707,7 +734,7 @@ export default { } http() .put("/updateExpense", this.editedItem) - .then(response => { + .then((response) => { this.snackbar = true; this.text = response.data.message; this.color = "green"; @@ -715,7 +742,7 @@ export default { this.getExpenseList(); this.close(); }) - .catch(error => { + .catch((error) => { this.snackbar = true; this.text = error.response.data.message; this.color = "error"; @@ -728,11 +755,11 @@ export default { this.showSearch = false; this.show = true; this.search = ""; - } + }, }, mounted() { this.token = this.$store.state.token; this.getExpenseList(); - } + }, }; \ No newline at end of file diff --git a/src/pages/Account/feeTypes.vue b/src/pages/Account/feeTypes.vue index 78bdf95..362746a 100644 --- a/src/pages/Account/feeTypes.vue +++ b/src/pages/Account/feeTypes.vue @@ -40,11 +40,11 @@ > - + Save - + Save @@ -123,7 +123,13 @@ - + close @@ -186,12 +192,12 @@ - + - cancel + cancel @@ -293,47 +299,54 @@ export default { addFeeTypeDialog: false, validEdit: true, pagination: { - rowsPerPage: 10 + rowsPerPage: 10, }, - feetTypeRules: [v => !!v || " Fee Type Name is required"], - monthlyRules: [v => !!v || " Select Monthly"], - noteRules: [v => !!v || " Note is required"], + feetTypeRules: [(v) => !!v || " Fee Type Name is required"], + monthlyRules: [(v) => !!v || " Select Monthly"], + noteRules: [(v) => !!v || " Note is required"], headers: [ { text: "No", align: "", sortable: false, - value: "No" + value: "No", }, { text: "fee Type", value: "feeType", sortable: false, - align: "center" + align: "center", }, { text: "Note", value: "note", sortable: false, align: "center" }, // { text: "Session", value: "session", sortable: false, align: "center" }, - { text: "Action", value: "", sortable: false, align: "center" } + { text: "Action", value: "", sortable: false, align: "center" }, ], feeTypeList: [], select: "", token: "", editedItem: {}, - feeTypeData: {} + feeTypeData: {}, }), + watch: { + addFeeTypeDialog: function (val) { + if (!val) { + this.feeTypeData = []; + } + }, + }, methods: { getFeeTypeList() { this.showLoader = true; http() .get("/getFeesList", { params: { schoolId: this.$store.state.schoolId }, - headers: { Authorization: "Bearer " + this.token } + headers: { Authorization: "Bearer " + this.token }, }) - .then(response => { + .then((response) => { this.feeTypeList = response.data.data; this.showLoader = false; }) - .catch(error => { + .catch((error) => { this.showLoader = false; if (error.response.status === 401) { this.$router.replace({ path: "/" }); @@ -355,22 +368,22 @@ export default { }, deleteItem(item) { let deleteFeeType = { - feeId: item._id + feeId: item._id, }; http() .delete( "/deleteFee", confirm("Are you sure you want to delete this?") && { - params: deleteFeeType + params: deleteFeeType, } ) - .then(response => { + .then((response) => { this.snackbar = true; this.text = response.data.message; this.color = "green"; this.getFeeTypeList(); }) - .catch(error => { + .catch((error) => { this.snackbar = true; this.color = "error"; this.text = error.response.data.message; @@ -385,13 +398,17 @@ export default { close2() { this.dialog2 = false; }, + closeAddFeeTypeModel() { + this.addFeeTypeDialog = false; + this.feeTypeData = []; + }, submit() { if (this.$refs.form.validate()) { this.loading = true; this.schoolId = this.$store.state.schoolId; http() .post("/createFee", this.feeTypeData) - .then(response => { + .then((response) => { this.getFeeTypeList(); this.snackbar = true; this.text = response.data.message; @@ -400,7 +417,7 @@ export default { this.addFeeTypeDialog = false; this.loading = false; }) - .catch(error => { + .catch((error) => { // console.log(error); this.snackbar = true; this.color = "error"; @@ -416,7 +433,7 @@ export default { this.editedItem.feeId = this.editedItem._id; http() .put("/updateFee", this.editedItem) - .then(response => { + .then((response) => { this.snackbar = true; this.text = response.data.message; this.color = "green"; @@ -424,7 +441,7 @@ export default { this.editFeeTypeDialog = false; this.close(); }) - .catch(error => { + .catch((error) => { this.snackbar = true; this.color = "error"; this.text = error.response.data.message; @@ -437,11 +454,11 @@ export default { this.showSearch = false; this.show = true; this.search = ""; - } + }, }, mounted() { this.token = this.$store.state.token; this.getFeeTypeList(); - } + }, }; \ No newline at end of file diff --git a/src/pages/Account/income.vue b/src/pages/Account/income.vue index f01df34..52d24aa 100644 --- a/src/pages/Account/income.vue +++ b/src/pages/Account/income.vue @@ -132,7 +132,7 @@ - + Save @@ -239,7 +239,13 @@ - + close @@ -308,12 +314,12 @@ - + - cancel + cancel @@ -495,42 +501,42 @@ export default { profileIncomeDialog: false, valid: true, pagination: { - rowsPerPage: 10 + rowsPerPage: 10, }, imageData: {}, imageName: "", imageUrl: "", imageFile: "", - nameRules: [v => !!v || " Full Name is required"], - amountRules: [v => !!v || "Amount is required"], - noteRules: [v => !!v || "Note Name is required"], - joinDateRules: [v => !!v || "Date is required"], + nameRules: [(v) => !!v || " Full Name is required"], + amountRules: [(v) => !!v || "Amount is required"], + noteRules: [(v) => !!v || "Note Name is required"], + joinDateRules: [(v) => !!v || "Date is required"], errorMessages: "", headers: [ { text: "No", align: "", sortable: false, - value: "No" + value: "No", }, { text: "Profile Pic", value: "profilePicUrl", sortable: false, - align: "center" + align: "center", }, { text: "Name", value: "name", sortable: false, align: "center" }, { text: "Date", value: "date", sortable: false, align: "center" }, { text: "User", value: "user", sortable: false, align: "center" }, { text: "Amount", value: "amount", sortable: false, align: "center" }, { text: "Note", value: "note", sortable: false, align: "center" }, - { text: "Action", value: "", sortable: false, align: "center" } + { text: "Action", value: "", sortable: false, align: "center" }, ], incomeList: [], editedIndex: -1, upload: "", editedItem: {}, - addIncome: {} + addIncome: {}, }), watch: { menu(val) { @@ -538,7 +544,16 @@ export default { }, menu1(val) { val && this.$nextTick(() => (this.$refs.picker.activePicker = "YEAR")); - } + }, + addIncomeDialog: function (val) { + if (!val) { + this.addIncome = []; + this.menu1 = false; + this.imageName = ""; + this.imageUrl = ""; + this.imageFile = ""; + } + }, }, methods: { save(date) { @@ -575,7 +590,7 @@ export default { this.imageUrl = ""; } }, - dates: function(date) { + dates: function (date) { return moment(date).format("MMMM DD, YYYY"); }, getIncomeList() { @@ -584,14 +599,14 @@ export default { http() .get("/getIncomesList", { params: { schoolId: this.$store.state.schoolId }, - headers: { Authorization: "Bearer " + token } + headers: { Authorization: "Bearer " + token }, }) - .then(response => { + .then((response) => { this.incomeList = response.data.data; this.showLoader = false; // console.log("getTeacherList=====>",this.incomeList) }) - .catch(error => { + .catch((error) => { this.showLoader = false; if (error.response.status === 401) { this.$router.replace({ path: "/" }); @@ -617,23 +632,23 @@ export default { }, deleteItem(item) { let deleteIncome = { - incomeId: item._id + incomeId: item._id, }; http() .delete( "/deleteIncome", confirm("Are you sure you want to delete this?") && { - params: deleteIncome + params: deleteIncome, } ) - .then(response => { + .then((response) => { // console.log("deleteUers",deleteTeachers) if ((this.snackbar = true)) { this.text = "Successfully delete Existing Income"; } this.getIncomeList(); }) - .catch(error => { + .catch((error) => { console.log(error); }); }, @@ -643,6 +658,14 @@ export default { close1() { this.dialog1 = false; }, + closeAddIncomeModel() { + this.addIncomeDialog = false; + this.addIncome = []; + this.menu1 = false; + this.imageName = ""; + this.imageUrl = ""; + this.imageFile = ""; + }, submit() { if (this.$refs.form.validate()) { if (this.imageUrl) { @@ -654,7 +677,7 @@ export default { // this.addIncome = this.$store.state.schoolId; http() .post("/createIncome", this.addIncome) - .then(response => { + .then((response) => { this.getIncomeList(); this.snackbar = true; this.text = response.data.message; @@ -663,7 +686,7 @@ export default { this.clear(); this.loading = false; }) - .catch(error => { + .catch((error) => { // console.log(error); this.loading = false; this.snackbar = true; @@ -685,7 +708,7 @@ export default { } http() .put("/updateIncome", this.editedItem) - .then(response => { + .then((response) => { this.snackbar = true; this.text = response.data.message; this.color = "green"; @@ -693,7 +716,7 @@ export default { this.getIncomeList(); this.close(); }) - .catch(error => { + .catch((error) => { this.loading = false; this.snackbar = true; this.color = "error"; @@ -708,10 +731,10 @@ export default { this.showSearch = false; this.show = true; this.search = ""; - } + }, }, mounted() { this.getIncomeList(); - } + }, }; \ No newline at end of file diff --git a/src/pages/Account/invoice.vue b/src/pages/Account/invoice.vue index 85fae81..7ef4078 100644 --- a/src/pages/Account/invoice.vue +++ b/src/pages/Account/invoice.vue @@ -118,7 +118,13 @@ - + close @@ -255,12 +261,12 @@ v-model="snackbar" :color="color" >{{ text }} - + - cancel + cancel @@ -527,7 +533,7 @@ import moment from "moment"; export default { components: { editInvoice: editInvoice, - paymentTemplate: paymentTemplate + paymentTemplate: paymentTemplate, }, data: () => ({ snackbar: false, @@ -563,11 +569,11 @@ export default { editPayment: { studentId: { name: "", - rollNo: "" + rollNo: "", }, classId: { - classNum: "" - } + classNum: "", + }, }, menu1: false, paymentMethods: ["Cash", "Cheque"], @@ -576,40 +582,40 @@ export default { discount: "0.00", subTotal: "0.00", paidAmount: "0.00", - feeTypeName: "" + feeTypeName: "", }, feeTypeData: [], editFeeTypeData: [], paymentFeeTypeData: [], pagination: { - rowsPerPage: 10 + rowsPerPage: 10, }, - classRules: [v => !!v || " Class Name is required"], - inchargeRules: [v => !!v || "Student Name is required"], - dateRules: [v => !!v || " Date is required"], - paymentStatusRules: [v => !!v || "Payment Status is required"], - paymentMethodsRules: [v => !!v || "payment Method is required"], - feeTypeRules: [v => !!v || "Fee Type is required"], - feeTypeNameRules: [v => !!v || "Fee Type Name is required"], - amountRules: [v => !!v || "Amount is required"], - discountRules: [v => !!v || "Discount is required"], - subtotalRules: [v => !!v || "Subtotal is required"], - paymentRules: [v => !!v || "Payment is required"], - paidAmountRules: [v => !!v || "Paid Amount is required"], + classRules: [(v) => !!v || " Class Name is required"], + inchargeRules: [(v) => !!v || "Student Name is required"], + dateRules: [(v) => !!v || " Date is required"], + paymentStatusRules: [(v) => !!v || "Payment Status is required"], + paymentMethodsRules: [(v) => !!v || "payment Method is required"], + feeTypeRules: [(v) => !!v || "Fee Type is required"], + feeTypeNameRules: [(v) => !!v || "Fee Type Name is required"], + amountRules: [(v) => !!v || "Amount is required"], + discountRules: [(v) => !!v || "Discount is required"], + subtotalRules: [(v) => !!v || "Subtotal is required"], + paymentRules: [(v) => !!v || "Payment is required"], + paidAmountRules: [(v) => !!v || "Paid Amount is required"], paymentMethodRules: [], headers: [ { text: "No", align: "", sortable: false, - value: "No" + value: "No", }, { text: "Student", value: "name", sortable: false, - align: "center" + align: "center", }, { text: "Class", value: "class", sortable: false, align: "center" }, { text: "Total", value: "subtotal", sortable: false, align: "center" }, @@ -617,66 +623,76 @@ export default { text: "Discount", value: "discount", sortable: false, - align: "center" + align: "center", }, { text: "Paid Amount", value: "paidAmount", sortable: false, - align: "center" + align: "center", }, { text: "Balance", value: "Balance", sortable: false, - align: "center" + align: "center", }, { text: "Status", value: "paymentStatus", sortable: false, - align: "center" + align: "center", }, { text: "Date", value: "date", sortable: false, - align: "center" + align: "center", }, - { text: "Action", value: "", sortable: false, align: "center" } + { text: "Action", value: "", sortable: false, align: "center" }, ], studentId: { - name: "" + name: "", }, token: "", editedItem: {}, invoiceData: { paymentStatus: "", - students: [] + students: [], }, addclass: [], studentList: [], paymentStatus: [ { name: "Not Paid", - value: "NOT_PAID" + value: "NOT_PAID", }, { name: "Partially Paid", - value: "PARTIALLY_PAID" + value: "PARTIALLY_PAID", }, { name: "Fully Paid", - value: "FULLY_PAID" - } - ] + value: "FULLY_PAID", + }, + ], }), + watch: { + addInvoiceDialog: function (val) { + if (!val) { + this.invoiceData = []; + this.menu1 = false; + this.feeType = []; + this.feeTypeData = []; + } + }, + }, methods: { save(date) { this.$refs.menu1.save(date); }, - dates: function(date) { + dates: function (date) { return moment(date).format("MMMM DD, YYYY"); }, profile(item) { @@ -710,29 +726,29 @@ export default { }, deleteItem(item) { let deleteInvoice = { - invoiceId: item._id + invoiceId: item._id, }; http() .delete( "/deleteInvoice", confirm("Are you sure you want to delete this?") && { - params: deleteInvoice + params: deleteInvoice, } ) - .then(response => { + .then((response) => { this.snackbar = true; this.text = "Successfully delete Existing Invoice"; this.color = "green"; this.dialog1 = false; this.getInvoiceList(); }) - .catch(error => { + .catch((error) => { // console.log(error); }); }, deletePayment(editedItem) { let deleteInvoice = { - invoiceId: editedItem._id + invoiceId: editedItem._id, }; http() .put( @@ -740,24 +756,31 @@ export default { deleteInvoice, confirm("Are you sure you want to delete this?") && { headers: { - Authorization: "Bearer " + this.token - } + Authorization: "Bearer " + this.token, + }, } ) - .then(response => { + .then((response) => { this.snackbar = true; this.text = "Successfully delete Existing Invoice"; this.color = "green"; this.dialog1 = false; this.getInvoiceList(); }) - .catch(error => { + .catch((error) => { // console.log(error); }); }, close() { this.dialog = false; }, + closeAddInvoiceModel() { + this.addInvoiceDialog = false; + this.invoiceData = []; + this.menu1 = false; + this.feeType = []; + this.feeTypeData = []; + }, // totalAmount() { // // console.log("this.feeType.paidAmount ", this.feeType.paidAmount); // // console.log( @@ -793,7 +816,7 @@ export default { totalAmount: this.feeType.amount.toString(), totalDiscount: this.feeType.discount.toString(), totalSubTotal: this.feeType.subTotal.toString(), - totalPaidAmount: this.feeType.paidAmount + totalPaidAmount: this.feeType.paidAmount, }; if (invoiceData.paymentStatus == "NOT_PAID") { @@ -822,7 +845,7 @@ export default { } http() .post("/createInvoice", invoiceData) - .then(response => { + .then((response) => { this.getInvoiceList(); this.snackbar = true; this.text = "New Invoice added successfully"; @@ -835,13 +858,13 @@ export default { discount: "0.00", paidAmount: "0.00", subTotal: "0.00", - feeTypeList: "" + feeTypeList: "", }; } this.loading = false; this.addInvoiceDialog = false; }) - .catch(error => { + .catch((error) => { this.snackbar = true; this.text = error.response.data.errors[0].messages[0]; this.color = "error"; @@ -857,13 +880,13 @@ export default { http() .get("/getInvoicesList", { params: { schoolId: this.$store.state.schoolId }, - headers: { Authorization: "Bearer " + this.token } + headers: { Authorization: "Bearer " + this.token }, }) - .then(response => { + .then((response) => { this.invoiceList = response.data.data; this.showLoader = false; }) - .catch(error => { + .catch((error) => { // console.log("err====>", err); this.showLoader = false; if (error.response.status === 401) { @@ -877,7 +900,7 @@ export default { this.showFeeType = true; this.feeTypeData.push({ feeTypeName: this.feeType.feeTypeName }); }, - deleteSelectFee: function(index, feeTyp) { + deleteSelectFee: function (index, feeTyp) { console.log("---index----", index); this.feeTypeData.splice(index, 1); this.getAmmountDetails(feeTyp); @@ -887,7 +910,7 @@ export default { discount: "0.00", paidAmount: "0.00", subTotal: "0.00", - feeTypeName: "" + feeTypeName: "", }; } }, @@ -895,12 +918,12 @@ export default { http() .get("/getClassesList", { params: { schoolId: this.$store.state.schoolId }, - headers: { Authorization: "Bearer " + this.token } + headers: { Authorization: "Bearer " + this.token }, }) - .then(response => { + .then((response) => { this.addclass = response.data.data; }) - .catch(err => { + .catch((err) => { // console.log("err====>", err); // this.$router.replace({ path: "/" }); }); @@ -911,19 +934,19 @@ export default { .get("/getStudentsList", { params: { classId: this.invoiceData.classNum, - schoolId: this.$store.state.schoolId + schoolId: this.$store.state.schoolId, }, - headers: { Authorization: "Bearer " + this.token } + headers: { Authorization: "Bearer " + this.token }, }) - .then(response => { + .then((response) => { response.data.data.unshift({ name: "Select All", - _id: "Select All" + _id: "Select All", }); this.studentList = response.data.data; this.showLoader = false; }) - .catch(err => { + .catch((err) => { this.showLoader = false; // console.log("err====>", err); // this.$router.replace({ path: "/" }); @@ -933,14 +956,14 @@ export default { http() .get("/getFeesList", { params: { - schoolId: this.$store.state.schoolId + schoolId: this.$store.state.schoolId, }, - headers: { Authorization: "Bearer " + this.token } + headers: { Authorization: "Bearer " + this.token }, }) - .then(response => { + .then((response) => { this.feeTypes = response.data.data; }) - .catch(err => { + .catch((err) => { // console.log("err====>", err); // this.$router.replace({ path: "/" }); }); @@ -952,7 +975,7 @@ export default { discount: "0.00", subTotal: "0.00", subParticularTotal: "0.00", - paidAmount: "" + paidAmount: "", }; for (let i = 0; i < this.feeTypeData.length; i++) { // *********** AMOUNT *********** @@ -1037,10 +1060,10 @@ export default { getPayMethodList() { if (this.invoiceData.paymentStatus == "PARTIALLY_PAID") { this.showPayMethods = true; - this.paymentMethodRules = [v => !!v || "Payment Method is required"]; + this.paymentMethodRules = [(v) => !!v || "Payment Method is required"]; } else if (this.invoiceData.paymentStatus == "FULLY_PAID") { this.showPayMethods = true; - this.paymentMethodRules = [v => !!v || "Payment Method is required"]; + this.paymentMethodRules = [(v) => !!v || "Payment Method is required"]; } else if (this.invoiceData.paymentStatus == "NOT_PAID") { for (let i = 0; i < this.feeTypeData.length; i++) { this.feeTypeData[i].paidAmount = "0.00"; @@ -1084,7 +1107,7 @@ export default { this.snackbar = true; this.text = "Payment added successfully"; this.color = "green"; - } + }, }, mounted() { this.token = this.$store.state.token; @@ -1092,7 +1115,7 @@ export default { this.getAllClasses(); this.getfeeType(); this.getAllStudents(); - } + }, }; diff --git a/src/pages/Administrator/academicYear.vue b/src/pages/Administrator/academicYear.vue index 88e5b83..0206ae7 100644 --- a/src/pages/Administrator/academicYear.vue +++ b/src/pages/Administrator/academicYear.vue @@ -217,7 +217,13 @@ - + close @@ -279,12 +285,12 @@ >Your search for "{{ search }}" found no results. - + - cancel + cancel @@ -444,67 +450,74 @@ export default { viewAcademinYearDialog: false, valid: true, pagination: { - rowsPerPage: 10 + rowsPerPage: 10, }, date: null, menu1: false, menu: false, menuStart: false, menuEndDate: false, - yearRules: [v => !!v || "Year is required"], - yearTitleRules: [v => !!v || "Year Title is required"], - startDateRules: [v => !!v || "startDate is required"], - endDateRules: [v => !!v || "endDate is required"], + yearRules: [(v) => !!v || "Year is required"], + yearTitleRules: [(v) => !!v || "Year Title is required"], + startDateRules: [(v) => !!v || "startDate is required"], + endDateRules: [(v) => !!v || "endDate is required"], headers: [ { text: "No", align: "center", sortable: false, - value: "No" + value: "No", }, { text: "Year", value: "year", sortable: false, align: "center" }, { text: "Year Title", value: "yearTitle", sortable: false, - align: "center" + align: "center", }, { text: "Starting Date", value: "startingDate", sortable: false, - align: "center" + align: "center", }, { text: "Ending Date", value: "endingDate", sortable: false, - align: "center" + align: "center", }, - { text: "Action", value: "", sortable: false, align: "center" } + { text: "Action", value: "", sortable: false, align: "center" }, ], getAcademicYearList: [], editedIndex: -1, addAcademicYear: {}, editedItem: {}, - token: "" + token: "", }), + watch: { + addAcademicYearDialog: function (val) { + if (!val) { + this.addAcademicYear = []; + } + }, + }, methods: { - dates: function(date) { + dates: function (date) { return moment(date).format("MMMM DD, YYYY"); }, getAcademicYear() { this.showLoader = true; http() .get("/getAcademicsList", { - headers: { Authorization: "Bearer " + this.token } + headers: { Authorization: "Bearer " + this.token }, }) - .then(response => { + .then((response) => { this.getAcademicYearList = response.data.data; this.showLoader = false; }) - .catch(error => { + .catch((error) => { this.showLoader = false; if (error.response.status === 401) { this.$router.replace({ path: "/" }); @@ -527,22 +540,22 @@ export default { deleteItem(item) { let deleteAcademic = { - academicId: item._id + academicId: item._id, }; http() .delete( "/deleteAcademic", confirm("Are you sure you want to delete this?") && { - params: deleteAcademic + params: deleteAcademic, } ) - .then(response => { + .then((response) => { this.snackbar = true; this.text = response.data.message; this.color = "green"; this.getAcademicYear(); }) - .catch(error => { + .catch((error) => { this.snackbar = true; this.text = error.response.data.message; this.color = "error"; @@ -551,12 +564,17 @@ export default { close() { this.editAcademinYearDialog = false; }, + closeAddAcademicYearModel() { + this.addAcademicYearDialog = false; + this.getAcademicYearList = []; + this.addAcademicYear = []; + }, submit() { if (this.$refs.form.validate()) { this.loading = true; http() .post("/createAcademic", this.addAcademicYear) - .then(response => { + .then((response) => { this.snackbar = true; this.text = response.data.message; this.color = "green"; @@ -565,7 +583,7 @@ export default { this.loading = false; this.addAcademicYearDialog = false; }) - .catch(error => { + .catch((error) => { this.snackbar = true; this.text = error.response.data.message; this.color = "error"; @@ -580,16 +598,16 @@ export default { this.editedItem.academicId = this.editedItem._id; http() .put("/updateAcademic", this.editedItem, { - headers: { Authorization: "Bearer " + this.token } + headers: { Authorization: "Bearer " + this.token }, }) - .then(response => { + .then((response) => { this.snackbar = true; this.text = response.data.message; this.color = "green"; this.getAcademicYear(); this.close(); }) - .catch(error => { + .catch((error) => { this.snackbar = true; this.text = error.response.data.message; this.color = "error"; @@ -602,11 +620,11 @@ export default { this.showSearch = false; this.show = true; this.search = ""; - } + }, }, mounted() { this.token = this.$store.state.token; this.getAcademicYear(); - } + }, }; \ No newline at end of file diff --git a/src/pages/Annoucement/annoucement.vue b/src/pages/Annoucement/annoucement.vue index a773be1..776ced0 100644 --- a/src/pages/Annoucement/annoucement.vue +++ b/src/pages/Annoucement/annoucement.vue @@ -224,7 +224,13 @@ - + close @@ -318,12 +324,16 @@ >Your search for "{{ search }}" found no results. - + - cancel + cancel @@ -533,6 +543,16 @@ export default { editedItem: {}, annoucementData: [], }), + watch: { + addAnnoucementDialog: function (val) { + if (!val) { + this.addAnnoucement = []; + this.imageName = ""; + this.imageFile = ""; + this.imageUrl = ""; + } + }, + }, methods: { getCourses(selectCourseId) { this.showLoader = true; diff --git a/src/pages/Attendence/studentAttendence.vue b/src/pages/Attendence/studentAttendence.vue index 1e3c8a3..5650549 100644 --- a/src/pages/Attendence/studentAttendence.vue +++ b/src/pages/Attendence/studentAttendence.vue @@ -56,7 +56,7 @@ item-text="name" item-value="_id" name="Select Section" - @change="getStudents(getAttendence.sectionId)" + @change="getStudentsDetail(getAttendence.sectionId)" class="px-2" required > @@ -70,7 +70,13 @@ - + close @@ -116,12 +122,16 @@ >Your search for "{{ search }}" found no results. - + - cancel + cancel @@ -345,6 +355,14 @@ export default { }, ], }), + watch: { + addStudentAttendenceDialog: function (val) { + if (!val) { + this.getReport = []; + this.studentsData = []; + } + }, + }, methods: { save(date) { this.$refs.menu.save(date); @@ -390,6 +408,29 @@ export default { http() .get("/getStudentWithClass", { params: { + classId: this.getReport.classId, + sectionId: this.getReport.sectionId, + }, + }) + .then((response) => { + this.studentsData = response.data.data; + this.showLoader = false; + // this.addStudentAttendenceDialog = false; + var attendence = ""; + for (let i = 0; i < this.studentsData.length; i++) { + this.studentsData[i].attendence = true; + } + }) + .catch((error) => { + console.log("err====>", error); + this.showLoader = false; + }); + }, + getStudentsDetail(_id) { + this.showLoader = true; + http() + .get("/getStudentWithClass", { + params: { classId: this.getAttendence.classId, sectionId: this.getAttendence.sectionId, }, @@ -437,8 +478,8 @@ export default { }, displaySearch() { - this.show = false - this.showSearch = true; + this.show = false; + this.showSearch = true; }, closeSearch() { this.showSearch = false; diff --git a/src/pages/Attendence/teacherAttendence.vue b/src/pages/Attendence/teacherAttendence.vue index 272e371..f38c517 100644 --- a/src/pages/Attendence/teacherAttendence.vue +++ b/src/pages/Attendence/teacherAttendence.vue @@ -30,7 +30,13 @@ - + close @@ -79,12 +85,16 @@ >Your search for "{{ search }}" found no results. - + - cancel + cancel @@ -209,40 +219,40 @@ export default { valid: true, isActive: true, newActive: false, - dataValid: [v => !!v || "Date is required"], + dataValid: [(v) => !!v || "Date is required"], attendenceType: [ { label: "Present", - value: "present" + value: "present", }, { label: "Late Present With Excuset", - value: "latePresentWithExcuse" + value: "latePresentWithExcuse", }, { label: "Late Present", - value: "latePresent" + value: "latePresent", }, { label: "Absent", - value: "absent" - } + value: "absent", + }, ], pagination: { - rowsPerPage: 8 + rowsPerPage: 8, }, headers: [ { text: "No", align: "", sortable: false, - value: "No" + value: "No", }, { text: "Profile Pic", value: "profilePicUrl", sortable: false, - align: "center" + align: "center", }, { text: "Name", value: "name", sortable: false, align: "center" }, { text: "Email", value: "email", sortable: false, align: "center" }, @@ -250,18 +260,25 @@ export default { text: "Mobile No", value: "mobileNo", sortable: false, - align: "center" + align: "center", }, - { text: "Attendance", value: "", sortable: false, align: "center" } + { text: "Attendance", value: "", sortable: false, align: "center" }, ], desserts: [], teachersData: [], - addTeachers: {} + addTeachers: {}, }), watch: { menu(val) { val && this.$nextTick(() => (this.$refs.picker.activePicker = "DAY")); - } + }, + addTeacherAttendenceDialog: function (val) { + if (!val) { + this.teachersData = []; + this.date = null; + this.menu = false; + } + }, }, methods: { save(date) { @@ -276,9 +293,9 @@ export default { var token = this.$store.state.token; http() .get("/getTeachersList", { - headers: { Authorization: "Bearer " + token } + headers: { Authorization: "Bearer " + token }, }) - .then(response => { + .then((response) => { this.teachersData = response.data.data; // this.desserts = response.data.data; var attendence = ""; @@ -288,9 +305,8 @@ export default { this.showLoader = false; // console.log("getTeacherList=====>",this.desserts) // console.log("getTeacherList=====>",this.teachersData) - }) - .catch(error => { + .catch((error) => { this.showLoader = false; if (error.response.status === 401) { this.$router.replace({ path: "/" }); @@ -304,23 +320,23 @@ export default { for (var j = 0; j < this.teachersData.length; j++) { teachersAttendence.push({ teacherId: this.teachersData[j]._id, - attendanceType: this.teachersData[j].attendence + attendanceType: this.teachersData[j].attendence, }); } if (this.$refs.form.validate()) { let attendanceData = { date: this.date, - teachers: teachersAttendence + teachers: teachersAttendence, }; http() .post("/createTeacherAttendance", attendanceData) - .then(response => { + .then((response) => { this.snackbar = true; this.text = response.data.message; this.addTeacherAttendenceDialog = false; this.clear(); }) - .catch(error => { + .catch((error) => { this.snackbar = true; this.text = error.response.data.message; }); @@ -338,11 +354,11 @@ export default { this.showSearch = false; this.show = true; this.search = ""; - } + }, }, mounted() { this.getTeacherList(); this.role = this.$store.state.role; - } + }, }; \ No newline at end of file diff --git a/src/pages/Class/addclass.vue b/src/pages/Class/addclass.vue index ecaab31..7d02121 100644 --- a/src/pages/Class/addclass.vue +++ b/src/pages/Class/addclass.vue @@ -82,7 +82,13 @@ - + close @@ -141,12 +147,16 @@ - + - cancel + cancel @@ -245,6 +255,13 @@ export default { classNum: "", }, }), + watch: { + addClassDialog: function (val) { + if (!val) { + this.addclasses = []; + } + }, + }, methods: { getClassList() { this.showLoader = true; @@ -318,7 +335,7 @@ export default { this.color = "green"; // this.clear(); this.loading = false; - this.$refs.form.reset() + this.$refs.form.reset(); this.addClassDialog = false; }) .catch((error) => { diff --git a/src/pages/Course/course.vue b/src/pages/Course/course.vue index 78a2ef6..e1cce50 100644 --- a/src/pages/Course/course.vue +++ b/src/pages/Course/course.vue @@ -191,7 +191,13 @@ - + close @@ -281,12 +287,12 @@ >Your search for "{{ search }}" found no results. - + - cancel + cancel @@ -473,6 +479,16 @@ export default { }, editedItem: {}, }), + watch: { + addCourseDialog: function (val) { + if (!val) { + this.addCourses = []; + this.imageName = ""; + this.imageFile = ""; + this.imageUrl = ""; + } + }, + }, methods: { getCourses() { this.showLoader = true; @@ -602,6 +618,14 @@ export default { closeStudentProfile() { this.profileStudentDialog = false; }, + closeAddCourseModel() { + this.addCourseDialog = false; + this.courseData = []; + this.addCourses = []; + this.imageName = ""; + this.imageFile = ""; + this.imageUrl = ""; + }, submit() { if (this.$refs.form.validate()) { let addCourse = { diff --git a/src/pages/Course/courseDetail.vue b/src/pages/Course/courseDetail.vue index 97a309a..00d2dca 100644 --- a/src/pages/Course/courseDetail.vue +++ b/src/pages/Course/courseDetail.vue @@ -403,7 +403,11 @@ style="text-decoration: none!important;" > -
Open PDF
+ +
+ Open PDF +
+
@@ -471,7 +475,7 @@
- + close @@ -224,12 +230,12 @@ >Your search for "{{ search }}" found no results. - + - cancel + cancel @@ -352,20 +358,20 @@ export default { viewEventdialog: false, valid: true, pagination: { - rowsPerPage: 10 + rowsPerPage: 10, }, date: null, menu1: false, menu: false, - titleRules: [v => !!v || " Tilte is required"], - descriptionRules: [v => !!v || " Discription is required"], - dateRules: [v => !!v || "Date is required"], + titleRules: [(v) => !!v || " Tilte is required"], + descriptionRules: [(v) => !!v || " Discription is required"], + dateRules: [(v) => !!v || "Date is required"], headers: [ { text: "No", align: "", sortable: false, - value: "No" + value: "No", }, { text: "Title", value: "title", sortable: false, align: "center" }, { text: "Date", value: "date", sortable: false, align: "center" }, @@ -374,17 +380,25 @@ export default { text: "Description", value: "description", sortable: false, - align: "center" + align: "center", }, - { text: "Action", value: "", sortable: false, align: "center" } + { text: "Action", value: "", sortable: false, align: "center" }, ], events: [], editedIndex: -1, addEvent: {}, - editedItem: {} + editedItem: {}, }), + watch: { + addEventDialog: function (val) { + if (!val) { + this.addEvent = []; + this.menu1 = false; + } + }, + }, methods: { - dates: function(date) { + dates: function (date) { return moment(date).format("MMMM DD, YYYY"); }, getEvents() { @@ -392,13 +406,13 @@ export default { var token = this.$store.state.token; http() .get("/getSchoolEventsList", { - headers: { Authorization: "Bearer " + token } + headers: { Authorization: "Bearer " + token }, }) - .then(response => { + .then((response) => { this.events = response.data.data; this.showLoader = false; }) - .catch(error => { + .catch((error) => { // console.log("err====>", err); this.showLoader = false; if (error.response.status === 401) { @@ -422,16 +436,16 @@ export default { deleteItem(item) { let deleteEvent = { - schoolEventId: item._id + schoolEventId: item._id, }; http() .delete( "/deleteSchoolEvent", confirm("Are you sure you want to delete this?") && { - params: deleteEvent + params: deleteEvent, } ) - .then(response => { + .then((response) => { this.snackbar = true; this.text = response.data.message; this.getEvents(); @@ -439,7 +453,7 @@ export default { this.color = "green"; this.text = response.data.message; }) - .catch(error => { + .catch((error) => { this.snackbar = true; this.text = error.response.data.message; this.color = "error"; @@ -449,12 +463,17 @@ export default { close() { this.editEventdialog = false; }, + closeAddEventModel() { + this.addEventDialog = false; + this.addEvent = []; + this.menu1 = false; + }, submit() { if (this.$refs.form.validate()) { this.loading = true; http() .post("/createSchoolEvent", this.addEvent) - .then(response => { + .then((response) => { this.snackbar = true; this.text = response.data.message; this.color = "green"; @@ -463,7 +482,7 @@ export default { this.loading = false; this.addEventDialog = false; }) - .catch(error => { + .catch((error) => { this.snackbar = true; this.text = error.response.data.message; this.color = "error"; @@ -477,14 +496,14 @@ export default { save() { http() .put("/updateSchoolEvent", this.editedItem) - .then(response => { + .then((response) => { this.snackbar = true; this.text = response.data.message; this.color = "green"; this.getEvents(); this.close(); }) - .catch(error => { + .catch((error) => { this.snackbar = true; this.text = error.response.data.message; this.color = "error"; @@ -497,10 +516,10 @@ export default { this.showSearch = false; this.show = true; this.search = ""; - } + }, }, mounted() { this.getEvents(); - } + }, }; \ No newline at end of file diff --git a/src/pages/Exam/exam.vue b/src/pages/Exam/exam.vue index c1099f4..feb4c25 100644 --- a/src/pages/Exam/exam.vue +++ b/src/pages/Exam/exam.vue @@ -166,7 +166,13 @@ - + close @@ -228,7 +234,7 @@ - + @@ -292,10 +298,7 @@ - + @@ -355,43 +358,50 @@ export default { profileExamDialog: false, valid: true, pagination: { - rowsPerPage: 10 + rowsPerPage: 10, }, - libraryIDRules: [v => !!v || " Library ID is required"], - bookRules: [v => !!v || " book Name is required"], - authorRules: [v => !!v || "Author Name is required"], - subjectCodeRules: [v => !!v || "Subject Code is required"], - authorRules: [v => !!v || "Author is required"], - examDateRules: [v => !!v || "Date is required"], + libraryIDRules: [(v) => !!v || " Library ID is required"], + bookRules: [(v) => !!v || " book Name is required"], + authorRules: [(v) => !!v || "Author Name is required"], + subjectCodeRules: [(v) => !!v || "Subject Code is required"], + authorRules: [(v) => !!v || "Author is required"], + examDateRules: [(v) => !!v || "Date is required"], headers: [ { align: "", text: "No", sortable: false, - value: "No" + value: "No", }, { text: "Exam Name", vaue: "examName", sortable: false, align: "center" }, { text: "Date", value: "date", sortable: false, - align: "center" + align: "center", }, { text: "Note", value: "note", sortable: false, - align: "center" + align: "center", }, - { text: "Action", value: "", sortable: false, align: "center" } + { text: "Action", value: "", sortable: false, align: "center" }, ], examData: [], addExam: {}, editedItem: {}, - token: "" + token: "", }), + watch: { + addExamDialog: function (val) { + if (!val) { + this.addExam = []; + } + }, + }, methods: { - dates: function(date) { + dates: function (date) { return moment(date).format("MMMM DD, YYYY"); }, pickFile() { @@ -402,14 +412,14 @@ export default { this.loadingSearch = true; http() .get("/getExamsList", { - headers: { Authorization: "Bearer " + this.token } + headers: { Authorization: "Bearer " + this.token }, }) - .then(response => { + .then((response) => { this.examData = response.data.data; this.showLoader = false; this.loadingSearch = false; }) - .catch(error => { + .catch((error) => { // console.log("err====>", err); this.showLoader = false; this.loadingSearch = false; @@ -438,23 +448,23 @@ export default { }, deleteItem(item) { let Exam = { - examId: item._id + examId: item._id, }; http() .delete( "/deleteExam", confirm("Are you sure you want to Delete this?") && { - params: Exam + params: Exam, } ) - .then(response => { + .then((response) => { this.snackbar = true; this.text = "Successfully Delete Exam "; this.text = response.data.message; this.color = "green"; this.getExamList(); }) - .catch(error => { + .catch((error) => { this.snackbar = true; this.text = error.response.data.message; this.color = "red"; @@ -468,7 +478,7 @@ export default { this.loading = true; http() .post("/createExam", this.addExam) - .then(response => { + .then((response) => { this.snackbar = true; this.text = response.data.message; this.color = "green"; @@ -478,7 +488,7 @@ export default { this.loading = false; this.clear(); }) - .catch(error => { + .catch((error) => { this.snackbar = true; this.text = error.response.data.message; this.color = "red"; @@ -494,14 +504,14 @@ export default { this.editedItem.examId = this.editedItem._id; http() .put("/updateExam", this.editedItem) - .then(response => { + .then((response) => { this.snackbar = true; this.text = response.data.message; this.color = "green"; this.getExamList(); this.close(); }) - .catch(error => { + .catch((error) => { this.snackbar = true; this.text = error.response.data.message; this.color = "red"; @@ -514,11 +524,11 @@ export default { this.showSearch = false; this.show = true; this.search = ""; - } + }, }, mounted() { this.token = this.$store.state.token; this.getExamList(); - } + }, }; \ No newline at end of file diff --git a/src/pages/Exam/examSchedule.vue b/src/pages/Exam/examSchedule.vue index 4b57fbf..8160d34 100644 --- a/src/pages/Exam/examSchedule.vue +++ b/src/pages/Exam/examSchedule.vue @@ -348,7 +348,13 @@ - + close @@ -412,12 +418,16 @@ - + - cancel + cancel @@ -675,34 +685,34 @@ export default { valid: true, role: "", pagination: { - rowsPerPage: 10 + rowsPerPage: 10, }, - examRules: [v => !!v || "Exam Name is required"], - classRules: [v => !!v || "Class Name is required"], - sectionRules: [v => !!v || "section is required"], - subjectRules: [v => !!v || "Subject is required"], - timeInRules: [v => !!v || "Time In is required"], - timeOutRules: [v => !!v || "time Out s is required"], - roomRules: [v => !!v || "Room is required"], - examScheduleDateRules: [v => !!v || "Date is required"], + examRules: [(v) => !!v || "Exam Name is required"], + classRules: [(v) => !!v || "Class Name is required"], + sectionRules: [(v) => !!v || "section is required"], + subjectRules: [(v) => !!v || "Subject is required"], + timeInRules: [(v) => !!v || "Time In is required"], + timeOutRules: [(v) => !!v || "time Out s is required"], + roomRules: [(v) => !!v || "Room is required"], + examScheduleDateRules: [(v) => !!v || "Date is required"], headers: [ { align: "", text: "No", sortable: false, - value: "No" + value: "No", }, { text: "Exam Name", vaue: "examId.examName", sortable: false, - align: "center" + align: "center", }, { text: "Class", value: "classId.classNum", sortable: false, - align: "center" + align: "center", }, // { // text: "Section", @@ -714,27 +724,27 @@ export default { text: "Subject Name", value: "subjectName", sortable: false, - align: "center" + align: "center", }, { text: "Date", value: "date", sortable: false, - align: "center" + align: "center", }, { text: "Time", value: "timeFrom", sortable: false, - align: "center" + align: "center", }, { text: "Room", value: "room", sortable: false, - align: "center" + align: "center", }, - { text: "Action", value: "", sortable: false, align: "center" } + { text: "Action", value: "", sortable: false, align: "center" }, ], classList: [], addSection: [], @@ -743,15 +753,22 @@ export default { addSchedule: {}, editedItem: { sectionId: { - name: "" - } + name: "", + }, }, getScheduleData: {}, ScheduleData: [], - token: "" + token: "", }), + watch: { + addExamScheduleDialog: function (val) { + if (!val) { + this.addSchedule = []; + } + }, + }, methods: { - dates: function(date) { + dates: function (date) { return moment(date).format("MMMM DD, YYYY"); }, pickFile() { @@ -766,16 +783,16 @@ export default { .get("/getSchedulesList", { params: { classId: this.getScheduleData.classId, - sectionId: this.getScheduleData.sectionId + sectionId: this.getScheduleData.sectionId, }, - headers: { Authorization: "Bearer " + this.token } + headers: { Authorization: "Bearer " + this.token }, }) - .then(response => { + .then((response) => { this.ScheduleData = response.data.data; // console.log("this.ScheduleData", this.ScheduleData); this.showLoader = false; }) - .catch(error => { + .catch((error) => { // console.log("err====>", err); this.showLoader = false; this.loadingSearch = false; @@ -818,22 +835,22 @@ export default { }, deleteSchedule(item) { let deleteSchedule = { - scheduleId: item._id + scheduleId: item._id, }; http() .delete( "/deleteSchedule", confirm("Are you sure you want to Delete this?") && { - params: deleteSchedule + params: deleteSchedule, } ) - .then(response => { + .then((response) => { this.snackbar = true; this.text = response.data.message; this.color = "green"; this.getSchedulesList(); }) - .catch(error => { + .catch((error) => { this.snackbar = true; this.color = "error"; this.text = error.response.data.message; @@ -847,7 +864,7 @@ export default { this.loading = true; http() .post("/createSchedule", this.addSchedule) - .then(response => { + .then((response) => { this.loading = false; this.snackbar = true; this.text = response.data.message; @@ -856,7 +873,7 @@ export default { this.getSchedulesList(); this.clear(); }) - .catch(error => { + .catch((error) => { this.snackbar = true; this.text = error.response.data.message; this.color = "red"; @@ -873,7 +890,7 @@ export default { this.editedItem.scheduleId = this.editedItem._id; http() .put("/updateSchedule", this.editedItem) - .then(response => { + .then((response) => { this.snackbar = true; this.text = "Successfully Edit Exam Schedule"; this.color = "green"; @@ -881,7 +898,7 @@ export default { this.getSchedulesList(); this.close(); }) - .catch(error => { + .catch((error) => { this.snackbar = true; this.text = error.response.data.messages; this.color = "error"; @@ -891,12 +908,12 @@ export default { getClass() { http() .get("/getClassesList", { - headers: { Authorization: "Bearer " + this.token } + headers: { Authorization: "Bearer " + this.token }, }) - .then(response => { + .then((response) => { this.classList = response.data.data; }) - .catch(err => { + .catch((err) => { // console.log("err====>", err); }); }, @@ -911,27 +928,27 @@ export default { "/getSectionsList", { params: { classId: _id } }, { - headers: { Authorization: "Bearer " + this.token } + headers: { Authorization: "Bearer " + this.token }, } ) - .then(response => { + .then((response) => { this.addSection = response.data.data; }) - .catch(err => {}); + .catch((err) => {}); }, getExamList() { this.showLoader = true; this.loadingSearch = true; http() .get("/getExamsList", { - headers: { Authorization: "Bearer " + this.token } + headers: { Authorization: "Bearer " + this.token }, }) - .then(response => { + .then((response) => { this.examList = response.data.data; this.showLoader = false; this.loadingSearch = false; }) - .catch(error => { + .catch((error) => { this.showLoader = false; this.loadingSearch = false; this.snackbar = true; @@ -950,13 +967,13 @@ export default { this.showSearch = false; this.show = true; this.search = ""; - } + }, }, mounted() { this.token = this.$store.state.token; this.getClass(); this.getExamList(); this.role = this.$store.state.role; - } + }, }; \ No newline at end of file diff --git a/src/pages/Exam/grade.vue b/src/pages/Exam/grade.vue index 1d5af01..e4ae975 100644 --- a/src/pages/Exam/grade.vue +++ b/src/pages/Exam/grade.vue @@ -200,7 +200,13 @@ - + close @@ -263,12 +269,16 @@ >Your search for "{{ search }}" found no results. - + - cancel + cancel @@ -402,65 +412,72 @@ export default { valid: true, validEditGrade: true, pagination: { - rowsPerPage: 10 + rowsPerPage: 10, }, - gradeNameRules: [v => !!v || "Grade Name is required"], - gradePointRules: [v => !!v || "Grade Point required"], - markFromRules: [v => !!v || "Mark From is required"], - markUptoRules: [v => !!v || "Mark Upto is required"], - authorRules: [v => !!v || "Author is required"], - noteRules: [v => !!v || "Note is required"], - editGradeName: [v => !!v || "Grade Name is required"], - editGradeName: [v => !!v || "Grade Name is required"], - editGradePoint: [v => !!v || "Grade Point required"], - editMarksFrom: [v => !!v || "Mark From is required"], - editMarksUpTo: [v => !!v || "Mark Upto is required"], + gradeNameRules: [(v) => !!v || "Grade Name is required"], + gradePointRules: [(v) => !!v || "Grade Point required"], + markFromRules: [(v) => !!v || "Mark From is required"], + markUptoRules: [(v) => !!v || "Mark Upto is required"], + authorRules: [(v) => !!v || "Author is required"], + noteRules: [(v) => !!v || "Note is required"], + editGradeName: [(v) => !!v || "Grade Name is required"], + editGradeName: [(v) => !!v || "Grade Name is required"], + editGradePoint: [(v) => !!v || "Grade Point required"], + editMarksFrom: [(v) => !!v || "Mark From is required"], + editMarksUpTo: [(v) => !!v || "Mark Upto is required"], headers: [ { align: "", text: "No", sortable: false, - value: "No" + value: "No", }, { text: "Grade Name", vaue: "gradeName", sortable: false, - align: "center" + align: "center", }, { text: "Grade Point", value: "gradePoint", sortable: false, - align: "center" + align: "center", }, { text: "Mark From", value: "marksFrom", sortable: false, - align: "center" + align: "center", }, { text: "Mark Upto", value: "marksUpTo", sortable: false, - align: "center" + align: "center", }, { text: "Note", value: "note", sortable: false, - align: "center" + align: "center", }, - { text: "Action", value: "", sortable: false, align: "center" } + { text: "Action", value: "", sortable: false, align: "center" }, ], gradeData: [], addGrade: {}, editedItem: {}, - token: "" + token: "", }), + watch: { + addGradeDialog: function (val) { + if (!val) { + this.addGrade = []; + } + }, + }, methods: { - dates: function(date) { + dates: function (date) { return moment(date).format("MMMM DD, YYYY"); }, pickFile() { @@ -471,14 +488,14 @@ export default { this.loadingSearch = true; http() .get("/getGradesList", { - headers: { Authorization: "Bearer " + this.token } + headers: { Authorization: "Bearer " + this.token }, }) - .then(response => { + .then((response) => { this.gradeData = response.data.data; this.showLoader = false; this.loadingSearch = false; }) - .catch(error => { + .catch((error) => { // console.log("err====>", err); this.showLoader = false; this.loadingSearch = false; @@ -508,22 +525,22 @@ export default { }, deleteGrade(item) { let deleteGrade = { - gradeId: item._id + gradeId: item._id, }; http() .delete( "/deleteGrade", confirm("Are you sure you want to Delete this?") && { - params: deleteGrade + params: deleteGrade, } ) - .then(response => { + .then((response) => { this.snackbar = true; this.text = response.data.message; this.color = "green"; this.getGradeList(); }) - .catch(error => { + .catch((error) => { this.loading = false; this.snackbar = true; this.color = "error"; @@ -538,7 +555,7 @@ export default { this.loading = true; http() .post("/createGrade", this.addGrade) - .then(response => { + .then((response) => { this.snackbar = true; this.text = response.data.message; this.color = "green"; @@ -547,7 +564,7 @@ export default { this.clear(); this.getGradeList(); }) - .catch(error => { + .catch((error) => { this.snackbar = true; this.text = error.response.data.message; this.color = "red"; @@ -565,14 +582,14 @@ export default { this.editedItem.gradeId = this.editedItem._id; http() .put("/updateGrade", this.editedItem) - .then(response => { + .then((response) => { this.snackbar = true; this.text = response.data.message; this.color = "green"; this.getGradeList(); this.close(); }) - .catch(error => { + .catch((error) => { this.snackbar = true; this.text = error.response.data.message; this.color = "red"; @@ -586,11 +603,11 @@ export default { this.showSearch = false; this.show = true; this.search = ""; - } + }, }, mounted() { this.token = this.$store.state.token; this.getGradeList(); - } + }, }; \ No newline at end of file diff --git a/src/pages/Gallery/gallery.vue b/src/pages/Gallery/gallery.vue index f461ee2..f6d3a7a 100644 --- a/src/pages/Gallery/gallery.vue +++ b/src/pages/Gallery/gallery.vue @@ -292,7 +292,13 @@ - + close @@ -352,12 +358,12 @@ >Your search for "{{ search }}" found no results. - + - cancel + cancel @@ -529,10 +535,10 @@ export default { updates: [{ youTubeLink: "" }], youTubeLink: {}, addGallery: { - youTubeLinkUrl: [] + youTubeLinkUrl: [], }, pagination: { - rowsPerPage: 10 + rowsPerPage: 10, }, imageName: "", imageUrl: "", @@ -543,29 +549,41 @@ export default { editFiles: [], files: [], token: "", - titleRules: [v => !!v || " Tilte is required"], - descriptionRules: [v => !!v || " Description is required"], + titleRules: [(v) => !!v || " Tilte is required"], + descriptionRules: [(v) => !!v || " Description is required"], headers: [ { align: "", text: "No", sortable: false, - value: "index" + value: "index", }, { text: "Title", value: "title", sortable: false, align: "center" }, { text: "Description", value: "description", sortable: false, - align: "center" + align: "center", }, - { text: "Action", value: "", sortable: false, align: "center" } + { text: "Action", value: "", sortable: false, align: "center" }, ], desserts: [], editedIndex: -1, editedItem: {}, - index: "" + index: "", }), + watch: { + addGalleryDialog: function (val) { + if (!val) { + this.addGallery = []; + this.imageName = ""; + this.youTubeLinkUrl = []; + this.youTubeLink = {}; + this.index = ""; + this.files = []; + } + }, + }, methods: { pickFile() { this.$refs.image.click(); @@ -586,8 +604,8 @@ export default { /** Select many image and showing many image add to Gallery card **/ const test = Array.from(files).forEach((file, idx) => { const fr = new FileReader(); - const getResult = new Promise(resolve => { - fr.onload = e => { + const getResult = new Promise((resolve) => { + fr.onload = (e) => { this.files.push( // id: idx, e.target.result @@ -596,7 +614,7 @@ export default { console.log("uploadImage=======>", this.files); }); fr.readAsDataURL(file); - return getResult.then(file => { + return getResult.then((file) => { return file; }); }); @@ -622,8 +640,8 @@ export default { /** Select many image and showing many image add to Gallery card **/ const test = Array.from(files).forEach((file, idx) => { const fr = new FileReader(); - const getResult = new Promise(resolve => { - fr.onload = e => { + const getResult = new Promise((resolve) => { + fr.onload = (e) => { this.editFiles.push( // id: idx, e.target.result @@ -632,7 +650,7 @@ export default { console.log("uploadeditFilesImage=======>", this.editFiles); }); fr.readAsDataURL(file); - return getResult.then(file => { + return getResult.then((file) => { return file; }); }); @@ -650,13 +668,13 @@ export default { this.showLoader = true; http() .get("/getGalleryList", { - headers: { Authorization: "Bearer " + this.token } + headers: { Authorization: "Bearer " + this.token }, }) - .then(response => { + .then((response) => { this.desserts = response.data.data; this.showLoader = false; }) - .catch(error => { + .catch((error) => { // console.log("err====>", err); this.showLoader = false; if (error.response.status === 401) { @@ -679,7 +697,7 @@ export default { }, deleteItem(item) { let deleteGallery = { - galleryId: item._id + galleryId: item._id, }; http() .delete( @@ -687,17 +705,17 @@ export default { confirm("Are you sure you want to delete this?") && { params: deleteGallery, headers: { - Authorization: "Bearer " + this.token - } + Authorization: "Bearer " + this.token, + }, } ) - .then(response => { + .then((response) => { this.snackbar = true; this.text = "Successfully delete Existing Gallery"; this.color = "green"; this.getGalleryList(); }) - .catch(error => { + .catch((error) => { // console.log(error); this.snackbar = true; this.text = error.response.data.message; @@ -707,18 +725,18 @@ export default { deleteImage(imageId, id) { let deleteImages = { galleryId: id, - imageId: imageId + imageId: imageId, }; http() .put("/deleteImage", deleteImages) - .then(response => { + .then((response) => { this.snackbar = true; this.text = response.data.message; this.color = "green"; this.getGalleryList(); this.close(); }) - .catch(error => { + .catch((error) => { this.snackbar = true; this.text = error.response.data.message; this.color = "error"; @@ -730,6 +748,15 @@ export default { closeProfileGallery() { this.viewProfileGallery = false; }, + closeAddGalleryModel() { + this.addGalleryDialog = false; + this.addGallery = []; + this.imageName = ""; + this.youTubeLinkUrl = []; + this.youTubeLink = {}; + this.index = ""; + this.files = []; + }, submit() { for (let i = 0; i < this.finds.length; i++) { this.addGallery.youTubeLinkUrl.push(this.finds[i].value); @@ -750,12 +777,12 @@ export default { classId: this.addGallery.classNum, title: this.addGallery.title, description: this.addGallery.description, - upload: this.addGallery.upload + upload: this.addGallery.upload, }; this.loading = true; http() .post("/createGallery", galleryData) - .then(response => { + .then((response) => { this.getGalleryList(); this.addGalleryDialog = false; this.loading = false; @@ -765,7 +792,7 @@ export default { this.clear(); this.files = ""; }) - .catch(error => { + .catch((error) => { this.snackbar = true; this.text = error.response.data.message; this.color = "error"; @@ -775,7 +802,7 @@ export default { this.loading = true; http() .post("/createGallery", this.addGallery) - .then(response => { + .then((response) => { this.getGalleryList(); this.addGalleryDialog = false; this.files = "nmn"; @@ -787,7 +814,7 @@ export default { this.removeAddFind(); this.files = ""; }) - .catch(error => { + .catch((error) => { this.snackbar = true; this.text = error.response.data.message; this.loading = false; @@ -823,7 +850,7 @@ export default { classId: this.editedItem.classNum, uploadImage: this.editedItem.editFiles, title: this.editedItem.title, - updateYouTubeLinkUrl: linkUrl + updateYouTubeLinkUrl: linkUrl, }; } else if (linkUrl == "") { var updateData = { @@ -831,13 +858,13 @@ export default { description: this.editedItem.description, classId: this.editedItem.classNum, uploadImage: this.editedItem.editFiles, - title: this.editedItem.title + title: this.editedItem.title, }; } this.editGalleryLoading = true; http() .put("/updateGallery", updateData) - .then(response => { + .then((response) => { this.getGalleryList(); this.close(); this.snackbar = true; @@ -847,7 +874,7 @@ export default { this.editImageName = ""; this.editFiles = []; }) - .catch(error => { + .catch((error) => { this.editGalleryLoading = false; this.snackbar = true; this.text = error.response.data.message; @@ -857,49 +884,49 @@ export default { getAllClasses() { http() .get("/getClassesList", { - headers: { Authorization: "Bearer " + this.token } + headers: { Authorization: "Bearer " + this.token }, }) - .then(response => { + .then((response) => { this.addclass = response.data.data; }) - .catch(err => { + .catch((err) => { // console.log("err====>", err); }); }, - removeAddFind: function() { + removeAddFind: function () { this.finds = [{ value: "" }]; }, - addFind: function() { + addFind: function () { this.finds.push({ value: "" }); }, - update: function() { + update: function () { this.updates.push({ youTubeLink: "" }); }, - deleteFind: function(index) { + deleteFind: function (index) { this.finds.splice(index, 1); if (index === 0) this.addFind(); }, - deleteUpdate: function(index) { + deleteUpdate: function (index) { this.updates.splice(index, 1); if (index === 0) this.update(); }, - deleteUrl: function(index, youTubelinkId, id) { + deleteUrl: function (index, youTubelinkId, id) { this.editedItem.youTubeLinkUrl.splice(index, 1); if (index === 0) this.update(); let deleteYouTubeUrl = { galleryId: id, - youTubeId: youTubelinkId + youTubeId: youTubelinkId, }; http() .put("/deleteYoutubeLink", deleteYouTubeUrl) - .then(response => { + .then((response) => { this.snackbar = true; this.text = response.data.message; this.color = "green"; this.getGalleryList(); this.close(); }) - .catch(error => { + .catch((error) => { this.snackbar = true; this.text = error.response.data.message; this.color = "error"; @@ -913,12 +940,12 @@ export default { this.showSearch = false; this.show = true; this.search = ""; - } + }, }, mounted() { this.token = this.$store.state.token; this.getAllClasses(); this.getGalleryList(); - } + }, }; \ No newline at end of file diff --git a/src/pages/Holiday/holiday.vue b/src/pages/Holiday/holiday.vue index bc8b17e..0bc41f4 100644 --- a/src/pages/Holiday/holiday.vue +++ b/src/pages/Holiday/holiday.vue @@ -146,7 +146,13 @@ - + close @@ -206,12 +212,12 @@ >Your search for "{{ search }}" found no results. - + - cancel + cancel @@ -317,36 +323,44 @@ export default { viewHolidayDialog: false, valid: true, pagination: { - rowsPerPage: 10 + rowsPerPage: 10, }, date: null, menu1: false, menu: false, - occasionRules: [v => !!v || "Occasion is required"], - dateRules: [v => !!v || "Date is required"], + occasionRules: [(v) => !!v || "Occasion is required"], + dateRules: [(v) => !!v || "Date is required"], headers: [ { text: "No", align: "", sortable: false, - value: "No" + value: "No", }, { text: "Occasion", value: "occasion", sortable: false, align: "center" }, { text: "Date Of Holiday", value: "dateOfHoliday", sortable: false, - align: "center" + align: "center", }, - { text: "Action", value: "", sortable: false, align: "center" } + { text: "Action", value: "", sortable: false, align: "center" }, ], holidays: [], editedIndex: -1, addHoliday: {}, - editedItem: {} + editedItem: {}, }), + watch: { + addHolidayDialog: function (val) { + if (!val) { + this.addHoliday = []; + this.menu1 = false; + } + }, + }, methods: { - dates: function(date) { + dates: function (date) { return moment(date).format("MMMM DD, YYYY"); }, getHolidays() { @@ -354,13 +368,13 @@ export default { var token = this.$store.state.token; http() .get("/getHolidaysList", { - headers: { Authorization: "Bearer " + token } + headers: { Authorization: "Bearer " + token }, }) - .then(response => { + .then((response) => { this.holidays = response.data.data; this.showLoader = false; }) - .catch(err => { + .catch((err) => { this.showLoader = false; if (error.response.status === 401) { this.$router.replace({ path: "/" }); @@ -383,22 +397,22 @@ export default { deleteItem(item) { let deleteHoliday = { - holidayId: item._id + holidayId: item._id, }; http() .delete( "/deleteHoliday", confirm("Are you sure you want to delete this?") && { - params: deleteHoliday + params: deleteHoliday, } ) - .then(response => { + .then((response) => { this.snackbar = true; this.text = response.data.message; this.color = "green"; this.getHolidays(); }) - .catch(error => { + .catch((error) => { this.snackbar = true; this.text = error.response.data.message; this.color = "error"; @@ -407,12 +421,17 @@ export default { close() { this.editHolidayDialog = false; }, + closeaddHolidayDialog() { + this.addHolidayDialog = false; + this.addHoliday = []; + this.menu1 = false; + }, submit() { if (this.$refs.form.validate()) { this.loading = true; http() .post("/createHoliday", this.addHoliday) - .then(response => { + .then((response) => { this.snackbar = true; this.text = response.data.message; this.color = "green"; @@ -421,7 +440,7 @@ export default { this.clear(); this.loading = false; }) - .catch(error => { + .catch((error) => { this.snackbar = true; this.text = error.response.data.message; this.loading = false; @@ -435,14 +454,14 @@ export default { save() { http() .put("/updateHoliday", this.editedItem) - .then(response => { + .then((response) => { this.snackbar = true; this.text = response.data.message; this.getHolidays(); this.color = "green"; this.close(); }) - .catch(error => { + .catch((error) => { this.snackbar = true; this.text = error.response.data.message; this.loading = false; @@ -456,10 +475,10 @@ export default { this.showSearch = false; this.show = true; this.search = ""; - } + }, }, mounted() { this.getHolidays(); - } + }, }; \ No newline at end of file diff --git a/src/pages/Library/books.vue b/src/pages/Library/books.vue index 9ff4ffb..ba0fbbd 100644 --- a/src/pages/Library/books.vue +++ b/src/pages/Library/books.vue @@ -195,7 +195,13 @@ - + close @@ -266,7 +272,7 @@ >Your search for "{{ search }}" found no results. - + @@ -455,6 +461,13 @@ export default { editedItem: {}, BooksData: {}, }), + watch: { + addBookDialog: function (val) { + if (!val) { + this.BooksData = []; + } + }, + }, methods: { getBookData() { this.showLoader = true; diff --git a/src/pages/Library/eBook.vue b/src/pages/Library/eBook.vue index a7e73e8..1021ce3 100644 --- a/src/pages/Library/eBook.vue +++ b/src/pages/Library/eBook.vue @@ -225,7 +225,13 @@ - + close @@ -291,12 +297,12 @@ >Your search for "{{ search }}" found no results. - + - cancel + cancel @@ -511,6 +517,16 @@ export default { editAnyFile: "", editFileName: "", }), + watch: { + addEBookDialog: function (val) { + if (!val) { + this.addEBooks = []; + this.imageName = ""; + this.fileName = ""; + this.files = ""; + } + }, + }, methods: { editPickImage() { this.$refs.editImage.click(); @@ -666,6 +682,14 @@ export default { close1() { this.viewEbookDialog = false; }, + closeAddEBookModel() { + this.addEBookDialog = false; + this.eBookData = []; + this.addEBooks = []; + this.imageName = ""; + this.fileName = ""; + this.files = ""; + }, submit() { if (this.$refs.form.validate()) { this.loading = true; diff --git a/src/pages/Library/issue.vue b/src/pages/Library/issue.vue index 5826b11..7e748d2 100644 --- a/src/pages/Library/issue.vue +++ b/src/pages/Library/issue.vue @@ -302,7 +302,13 @@ - + close @@ -374,12 +380,12 @@ - + - cancel + cancel @@ -570,48 +576,48 @@ export default { addclass: [], addSection: [], pagination: { - rowsPerPage: 10 + rowsPerPage: 10, }, - libraryIDRules: [v => !!v || " Library ID is required"], - bookRules: [v => !!v || " book Name is required"], - authorRules: [v => !!v || "Author Name is required"], - subjectCodeRules: [v => !!v || "Subject Code is required"], - authorRules: [v => !!v || "Author is required"], - noteRules: [v => !!v || "Note is required"], - dueDateRule: [v => !!v || "Due Date is required"], + libraryIDRules: [(v) => !!v || " Library ID is required"], + bookRules: [(v) => !!v || " book Name is required"], + authorRules: [(v) => !!v || "Author Name is required"], + subjectCodeRules: [(v) => !!v || "Subject Code is required"], + authorRules: [(v) => !!v || "Author is required"], + noteRules: [(v) => !!v || "Note is required"], + dueDateRule: [(v) => !!v || "Due Date is required"], headers: [ { align: "justify-center", text: "No", sortable: false, - value: "No" + value: "No", }, { text: "Book", vaue: "name", sortable: false, align: "center" }, { text: "Serial Number", value: "serialNumber", sortable: false, - align: "center" + align: "center", }, { text: "Issue Date", value: "created", sortable: false, - align: "center" + align: "center", }, { text: "Due Date", value: "dueDate", sortable: false, - align: "center" + align: "center", }, { text: "Status", value: "status", sortable: false, - align: "center" + align: "center", }, - { text: "Action", value: "", sortable: false, align: "center" } + { text: "Action", value: "", sortable: false, align: "center" }, ], desserts: [], addIssue: {}, @@ -622,10 +628,23 @@ export default { editedItem: {}, books: [], token: "", - disable: false + disable: false, }), + watch: { + addIssueDialog: function (val) { + if (!val) { + this.addIssue = []; + this.libraryID = ""; + this.bookId = ""; + this.serialNo = ""; + this.menu2 = false; + this.date = null; + this.note = ""; + } + }, + }, methods: { - dates: function(date) { + dates: function (date) { return moment(date).format("MMMM DD, YYYY"); }, pickFile() { @@ -643,19 +662,19 @@ export default { { params: { libraryId: this.libraryId, - schoolId: this.$store.state.schoolId - } + schoolId: this.$store.state.schoolId, + }, }, { - headers: { Authorization: "Bearer " + this.token } + headers: { Authorization: "Bearer " + this.token }, } ) - .then(response => { + .then((response) => { this.desserts = response.data.data; this.showLoader = false; this.loadingSearch = false; }) - .catch(error => { + .catch((error) => { this.showLoader = false; this.loadingSearch = false; this.snackbar = true; @@ -689,16 +708,16 @@ export default { }, deleteItem(item) { let deleteParticularIssue = { - bookIssueId: item._id + bookIssueId: item._id, }; http() .delete( "/deleteBookIssue", confirm("Are you sure you want to delete this?") && { - params: deleteParticularIssue + params: deleteParticularIssue, } ) - .then(response => { + .then((response) => { this.snackbar = true; this.text = "Delete Successfully"; this.getIssueList(); @@ -713,7 +732,7 @@ export default { this.color = "green"; this.loading = false; }) - .catch(error => { + .catch((error) => { // console.log(error); this.snackbar = true; this.text = error.response.data.message; @@ -722,19 +741,19 @@ export default { }, returnBook(item) { let returnBook = { - bookIssueId: item._id + bookIssueId: item._id, }; http() .put( "/returnBook", confirm("Are you sure you want to return this?") && returnBook ) - .then(response => { + .then((response) => { this.snackbar = true; this.text = "Successfully return Issue a Book "; this.getIssueList(); }) - .catch(error => {}); + .catch((error) => {}); }, close() { this.editIssueDialog = false; @@ -742,6 +761,17 @@ export default { close1() { this.viewIssueDialog = false; }, + closeAddIssueModel() { + this.addIssueDialog = false; + this.desserts = []; + this.addIssue = []; + this.libraryID = ""; + this.bookId = ""; + this.serialNo = ""; + this.menu2 = false; + this.date = null; + this.note = ""; + }, submit() { if (this.$refs.form.validate()) { let createBook = { @@ -752,12 +782,12 @@ export default { serialNumber: this.serialNo, note: this.note, dueDate: this.date, - schoolId: this.$store.state.schoolId + schoolId: this.$store.state.schoolId, }; this.loading = true; http() .post("/createBookIssue", createBook) - .then(response => { + .then((response) => { this.getIssueList(); this.snackbar = true; this.text = response.data.message; @@ -766,7 +796,7 @@ export default { this.loading = false; this.clear(); }) - .catch(error => { + .catch((error) => { this.snackbar = true; this.text = error.response.data.message; this.color = "red"; @@ -783,7 +813,7 @@ export default { this.editedItem.bookId = this.editedItem.bookId; http() .put("/updateBookIssue", this.editedItem) - .then(response => { + .then((response) => { this.editIssueDialog = false; this.snackbar = true; this.text = "Successfully Edit Issue a Book"; @@ -791,7 +821,7 @@ export default { this.getIssueList(); this.close(); }) - .catch(error => { + .catch((error) => { this.snackbar = true; this.text = error.response.data.message; this.color = "red"; @@ -802,15 +832,15 @@ export default { http() .get("/getBooksList", { params: { - schoolId: this.$store.state.schoolId + schoolId: this.$store.state.schoolId, }, - headers: { Authorization: "Bearer " + this.token } + headers: { Authorization: "Bearer " + this.token }, }) - .then(response => { + .then((response) => { this.books = response.data.data; this.showLoader = false; }) - .catch(error => { + .catch((error) => { this.showLoader = false; if (error.response.status === 401) { this.$router.replace({ path: "/" }); @@ -832,7 +862,7 @@ export default { } this.addIssue = { author: this.books[i].author, - subjectCode: this.books[i].subjectCode + subjectCode: this.books[i].subjectCode, }; } } @@ -845,12 +875,12 @@ export default { this.showSearch = false; this.show = true; this.search = ""; - } + }, }, mounted() { this.token = this.$store.state.token; this.getBookData(); - } + }, };