From c0b01ae20e75a0c20e5bac2cdaa07f64bf9803dd Mon Sep 17 00:00:00 2001 From: Neeraj Sharma Date: Thu, 16 Jan 2020 00:37:00 +0530 Subject: [PATCH] solve bugs in progressCardReport --- src/pages/Report/progressCardReport.vue | 253 ++++++++++++++++---------------- 1 file changed, 129 insertions(+), 124 deletions(-) diff --git a/src/pages/Report/progressCardReport.vue b/src/pages/Report/progressCardReport.vue index d6f0571..36b3883 100644 --- a/src/pages/Report/progressCardReport.vue +++ b/src/pages/Report/progressCardReport.vue @@ -84,11 +84,10 @@ - - - + + - + Print print @@ -97,106 +96,64 @@ - - - - - -

Profile

-
- -
-
- - - - - - - - - - - - - -

- {{ value[0].studentId.name }} -

-

Student

-
-
- - -

- RollNo -

-
- -

: {{ value[0].studentId.rollNo }}

-
-
- - -

- Class -

-
- -

: {{value[0].classId.classNum }}

-
-
- - -

- Section -

-
- -

: {{ value[0].sectionId.name}}

-
-
-
-
-
-
- - - - - - - -

Mark

-
- -
-
+ + + + + + + + + + +

+ {{ userData.name }} +
+ {{ userData.address }} +

+

phone : {{ userData.mobile }}

+

Email : {{ userData.email }}

+
+ +

{{ value[0].studentId.name }}

+

Class : {{ value[0].classId.classNum }}

+

Roll NO : {{ value[0].studentId.rollNo }}

+

Section : {{ value[0].sectionId.name }}

+
+ + + + + + +
{{value[0].examId.examName}} - + - + + + + - + @@ -260,6 +214,26 @@ >{{subject.totalMarks}} +
Subject{{exam.markDistributionId.distributionType}}Total
MarkMark
@@ -296,11 +270,13 @@ export default { studentRules: [v => !!v || "Student is required"], getReport: {}, classList: [], - output: null + output: null, + userData: {} }), mounted() { this.token = this.$store.state.token; this.getClass(); + this.getUserData(); }, methods: { clear() { @@ -316,12 +292,13 @@ export default { this.classList = response.data.data; this.showLoader = false; }) - .catch(err => { + .catch(error => { this.showLoader = false; // console.log("err====>", err); }); }, getSections(_id) { + this.showLoader = true; http() .get( "/getSectionsList", @@ -332,8 +309,10 @@ export default { ) .then(response => { this.addSection = response.data.data; + this.showLoader = false; }) .catch(err => { + this.showLoader = false; // console.log("err====>", err); }); }, @@ -349,7 +328,7 @@ export default { .then(response => { this.getStudentsList = response.data.data; this.showLoader = false; - console.log("getSectionsList=====>", response.data.data); + // console.log("getSectionsList=====>", response.data.data); }) .catch(error => { console.log("err====>", error); @@ -357,7 +336,7 @@ export default { }); }, getMarkReportList() { - this.showLoader = true; + // this.showLoader = true; this.showReport = true; http() .get("/getParticularMark", { @@ -365,13 +344,23 @@ export default { headers: { Authorization: "Bearer " + this.token } }) .then(response => { + this.showLoader = false; let newData = response.data.data; + // console.log("response", newData); for (var i = 0; i < newData.length; i++) { newData[i].examination = newData[i].examId._id; + // console.log("newData[i].examination", newData[i].examination); } this.filterData = _.groupBy(newData, ["examination"]); for (let data in this.filterData) { + // console.log("data+++++++++++++++++++++++++++++++++++", data); + for (let item in this.filterData[data]) { + console.log( + "filterData[data]==========================>", + this.filterData[data] + ); + console.log("filterData[item]==========================>", item); var totalMarks = 0; for ( let i = 0; @@ -382,9 +371,11 @@ export default { .marksScored; } this.filterData[data][item].totalMarks = totalMarks; + // var total = 0; + // total += this.filterData[data][item].totalMarks ; + // console.log("total", total); } } - this.showLoader = false; }) .catch(error => { // console.log("err====>", err); @@ -401,6 +392,20 @@ export default { print() { // Pass the element id here this.$htmlToPaper("printMe"); + }, + getUserData() { + http() + .get("/getParticularUserDetail") + .then(response => { + this.userData = response.data.data; + }) + .catch(error => { + if (error.response.status === 401) { + this.$router.replace({ path: "/" }); + this.$store.dispatch("setToken", null); + this.$store.dispatch("Id", null); + } + }); } } }; -- 2.0.0