From 5d5315b0f9af96cf1f42942a64f34694983def8b Mon Sep 17 00:00:00 2001 From: shikha Date: Mon, 3 Aug 2020 17:21:07 +0530 Subject: [PATCH] close add-notification dialogue box, hide delete option from teacher's list, handle password able/disable function in add student screen and show data of admit card and show messages if not available --- src/Services/http.js | 44 +++++++++++++++++---------------- src/pages/Notification/notification.vue | 1 + src/pages/Parent/parents.vue | 5 +++- src/pages/Report/admitCard.vue | 43 +++++++++++++++++++++----------- src/pages/Students/students.vue | 5 +++- src/pages/Teachers/teachers.vue | 4 +-- 6 files changed, 63 insertions(+), 39 deletions(-) diff --git a/src/Services/http.js b/src/Services/http.js index 0565e5a..10eb9bb 100644 --- a/src/Services/http.js +++ b/src/Services/http.js @@ -1,7 +1,7 @@ import axios from 'axios' import store from '@/store/store' import Vue from 'vue' -import {vm1} from "@/main.js" +import { vm1 } from "@/main.js" const baseDomain = "https://api-dashboard.intrack.in/v1"; @@ -45,29 +45,31 @@ export default () => { return Promise.reject(error) }) instance.interceptors.response.use((response) => { - // do something with the response data + // do something with the response data - return response; - }, error => { - // handle the response error - console.log("error in interceptor - ",error.response.status) - var customError - const errorNo = error.response.status + return response; + }, error => { + // handle the response error + console.log("error in interceptor - ", error.response.status) + var customError + const errorNo = error.response.status - switch (errorNo) { - case 401: - customError = "Session expired" - console.log("what is this - ", vm1) - vm1.$store.dispatch("setToken", null); - vm1.$router.replace({ path: "/" }); - - vm1.$store.dispatch("Id", null); - - break; - } - }) - // response parse + switch (errorNo) { + case 401: + customError = "Session expired" + console.log("what is this - ", vm1) + vm1.$store.dispatch("setToken", null); + vm1.$router.replace({ path: "/" }); + + vm1.$store.dispatch("Id", null); + + break; + } + + return Promise.reject(error); + }) + // response parse return instance; } \ No newline at end of file diff --git a/src/pages/Notification/notification.vue b/src/pages/Notification/notification.vue index e0d0208..a3ec109 100644 --- a/src/pages/Notification/notification.vue +++ b/src/pages/Notification/notification.vue @@ -420,6 +420,7 @@ export default { this.text = response.data.message; this.color = "green"; this.getNotifications(); + this.addNotificationDialog = false; this.clear(); this.loading = false; }) diff --git a/src/pages/Parent/parents.vue b/src/pages/Parent/parents.vue index 47b0c04..244b830 100644 --- a/src/pages/Parent/parents.vue +++ b/src/pages/Parent/parents.vue @@ -700,6 +700,7 @@ :type="e1 ? 'password' : 'text'" :rules="password" placeholder="Enter Your Password" + :disabled="isFatherCellExists" required > @@ -986,7 +987,8 @@ export default { }, editMpin: { mPin: "" - } + }, + isFatherCellExists: false }), watch: { menu(val) { @@ -1085,6 +1087,7 @@ export default { this.getParentDetails(); this.clear(); this.loading = false; + this.isFatherCellExists = true; this.addParentDialog = false; }) .catch(error => { diff --git a/src/pages/Report/admitCard.vue b/src/pages/Report/admitCard.vue index 0a381a7..019ce1f 100644 --- a/src/pages/Report/admitCard.vue +++ b/src/pages/Report/admitCard.vue @@ -83,7 +83,7 @@ v-model="getReport.form" item-text="name" item-value="value" - @change="getReport(getReport.form)" + required > @@ -148,8 +148,7 @@ - - + /> --> + + @@ -388,6 +398,7 @@ export default { getStudentsList: [], getScheduleList: [], getScheduleListArray: [], + getReport: {}, examName: [], typeList: [ { @@ -442,16 +453,6 @@ export default { }, methods: { - getReport() { - if (this.getReport.form === "frontPart") { - this.frontPart = true; - this.backPart = false; - } - if (this.getReport.form === "backPart") { - this.frontPart = false; - this.backPart = true; - } - }, getExamList() { this.showLoader = true; this.loadingSearch = true; @@ -543,7 +544,21 @@ export default { .then(response => { this.showTable = true; this.getScheduleList = response.data.data; + if (response.data.data.scheduleData.length === 0) { + this.showLoader = false; + this.snackbar = true; + this.text = 'Student not found!'; + return; + } this.showData = true; + if (this.getReport.form === "frontPart") { + this.frontPart = true; + this.backPart = false; + } + if (this.getReport.form === "backPart") { + this.frontPart = false; + this.backPart = true; + } this.showLoader = false; }) .catch(error => { diff --git a/src/pages/Students/students.vue b/src/pages/Students/students.vue index 30dca05..e079442 100644 --- a/src/pages/Students/students.vue +++ b/src/pages/Students/students.vue @@ -1322,6 +1322,7 @@ :rules="password" v-model="parentData.password" placeholder="Enter Your Password" + :disabled="isFatherCellExists" required > @@ -2053,7 +2054,8 @@ export default { weight: "", rollNo: "", establishmentYear: new Date().getFullYear() - } + }, + isFatherCellExists: false }), watch: { menu(val) { @@ -2388,6 +2390,7 @@ export default { this.parentData = response.data.data; this.parentId = response.data.data._id; this.showLoader = false; + this.isFatherCellExists = true; }) .catch(error => { console.log("err====>", error.response.data.message); diff --git a/src/pages/Teachers/teachers.vue b/src/pages/Teachers/teachers.vue index 202622b..405eaaa 100644 --- a/src/pages/Teachers/teachers.vue +++ b/src/pages/Teachers/teachers.vue @@ -540,7 +540,7 @@ /> Edit - + -- 2.0.0