From c62132b757cbc007b14dbdc910d0553e2b496a5c Mon Sep 17 00:00:00 2001 From: shikha Date: Sun, 10 May 2020 18:58:15 +0530 Subject: [PATCH] invoice,progress-card report improvement --- src/pages/Account/invoice.vue | 94 ++++----- src/pages/Report/progressCardReport.vue | 325 ++++++++++++++++++++++---------- 2 files changed, 282 insertions(+), 137 deletions(-) diff --git a/src/pages/Account/invoice.vue b/src/pages/Account/invoice.vue index 2b84f0e..ccaa792 100644 --- a/src/pages/Account/invoice.vue +++ b/src/pages/Account/invoice.vue @@ -98,7 +98,7 @@ item-text="name" item-value="value" label="Select Payment Status" - @change="getPayMethodList" + @change="getPaymentMethod" :rules="paymentStatusRules" required > @@ -276,7 +276,7 @@

Profile

- + @@ -379,7 +379,6 @@ # Fee Type Amount - Discount(%) Subtotal Paid Amount @@ -390,18 +389,9 @@ :key="index" v-on:keyup="getAmmountDetails(feeType)" > - {{index + 1}} + {{index + 1}} {{ feeType.feeTypeName }} - {{feeType.amount}} - - + {{feeType.amount}} Total: {{ feeType.amount }} - {{ feeType.discount }} {{ feeType.subTotal }} {{ feeType.paidAmount }} @@ -469,8 +458,8 @@ cancel - - + +
@@ -479,9 +468,7 @@ - + @@ -491,7 +478,7 @@ - + {{ props.item.studentId.name }} - + @@ -601,6 +586,18 @@ + + + >{{cardData.totalMarks}} - - --> - - - - - - + + + + + + + + - - + - + - - -
# DateWeaver Action
1 {{dates( editedItem.date) }} {{ editedItem.paymentMethod }}{{ props.item.classId.classNum }} {{ props.item.totalAmount }}{{ props.item.totalDiscount}}{{ props.item.totalDiscount}} {{ props.item.totalPaidAmount ? props.item.totalPaidAmount : 0}} @@ -896,8 +891,6 @@ v-model="feeType.paidAmount" type="number" :disabled="disabled" - :rules="paymentRules" - required > @@ -980,11 +971,11 @@ export default { invoiceList: [], editPayment: { studentId: { - name: '', - rollNo: '' + name: "", + rollNo: "" }, classId: { - classNum: '' + classNum: "" } }, menu1: false, @@ -996,7 +987,7 @@ export default { paidAmount: "0.00", feeTypeName: "" }, - + feeTypeData: [], pagination: { rowsPerPage: 10 @@ -1028,7 +1019,12 @@ export default { }, { text: "Class", value: "class", sortable: false, align: "center" }, { text: "Total", value: "subtotal", sortable: false, align: "center" }, - { text: "Discount(%)", value: "discount", sortable: false, align: "center" }, + { + text: "Discount(%)", + value: "discount", + sortable: false, + align: "center" + }, { text: "Paid Amount", value: "paidAmount", @@ -1137,11 +1133,15 @@ export default { invoiceId: editedItem._id }; http() - .put("/removePayment", deleteInvoice, confirm("Are you sure you want to delete this?") && { - headers: { - Authorization: "Bearer " + this.token + .put( + "/removePayment", + deleteInvoice, + confirm("Are you sure you want to delete this?") && { + headers: { + Authorization: "Bearer " + this.token + } } - }) + ) .then(response => { this.snackbar = true; this.text = "Successfully delete Existing Invoice"; @@ -1263,7 +1263,17 @@ export default { add() { var updatePayment = { invoiceId: this.editPayment._id, - totalPaidAmount: this.editPayment.paidAmount + // totalPaidAmount: this.editPayment.paidAmount + classId: this.editPayment.classNum, + students: this.editPayment.students, + date: this.editPayment.date, + paymentStatus: this.editPayment.paymentStatus, + paymentMethod: this.editPayment.paymentMethod, + feeType: this.feeTypeData, + totalAmount: this.feeType.amount, + totalDiscount: this.feeType.discount, + totalSubTotal: this.feeType.subTotal, + totalPaidAmount: this.feeType.paidAmount }; http() .put("/updateInvoice", updatePayment, { @@ -1381,7 +1391,7 @@ export default { // this.$router.replace({ path: "/" }); }); }, - + getAmmountDetails(feeTyp) { let feeType = { amount: "", @@ -1441,7 +1451,7 @@ export default { this.showPayMethods = false; } }, - getPayMethodList() { + getPaymentMethod() { if (this.editData.paymentStatus == "PARTIALLY_PAID") { this.showPayMethods = true; } else if (this.editData.paymentStatus == "FULLY_PAID") { diff --git a/src/pages/Report/progressCardReport.vue b/src/pages/Report/progressCardReport.vue index 1ed34cc..91e6cef 100644 --- a/src/pages/Report/progressCardReport.vue +++ b/src/pages/Report/progressCardReport.vue @@ -92,18 +92,26 @@ - + >--> +

{{ userData.name }}

@@ -115,90 +123,192 @@

{{ userData.address }}

- +
- - +
- - - - - - - + rowspan="2" + style="border: 1px solid lightgrey !important;padding: 10px;" + >Subject + + + + + + + + + + + + + + + +
Subject
{{subject.subjectName}}{{subject.totalMarks}}
+ +
+ Total Marks : + Total Marks
+ GPA : +
+ + --> + @@ -254,7 +344,7 @@ import _ from "underscore"; export default { data: () => ({ showLoader: false, - markData: [], + cardData: [], token: "", markDistributions: [], markParticularDistributionData: [], @@ -273,6 +363,12 @@ export default { output: null, userData: {}, newData: [], + gradeAPlus: "A+", + gradeA: "A", + gradeBPlus: "B+", + gradeB: "B", + gradeCPlus: "C+", + gradeC: "C" }), mounted() { this.token = this.$store.state.token; @@ -339,44 +435,83 @@ export default { getMarkReportList() { // this.showLoader = true; this.showReport = true; + // http() + // .get("/getParticularMark", { + // params: { studentId: this.getReport.studentId }, + // headers: { Authorization: "Bearer " + this.token } + // }) + // .then(response => { + // this.showLoader = false; + // this.cardData = response.data.data; + // let newData = response.data.data; + // for (var i = 0; i < newData.length; i++) { + // newData[i].examination = newData[i].examId._id; + // } + // this.filterData = _.groupBy(newData, ["examination"]); + // for (let data in this.filterData) { + + // for (let item in this.filterData[data]) { + // var totalMarks = 0; + // for ( + // let i = 0; + // i < this.filterData[data][item].studentsMarks.length; + // i++ + // ) { + // totalMarks += this.filterData[data][item].studentsMarks[i] + // .marksScored; + // } + // this.filterData[data][item].totalMarks = totalMarks; + // var total = 0; + // total += this.filterData[data][item].totalMarks ; + // console.log("total", total); + // } + // } + // }) http() .get("/getParticularMark", { params: { studentId: this.getReport.studentId }, headers: { Authorization: "Bearer " + this.token } }) .then(response => { - this.showLoader = false; + this.cardData = response.data.data; let newData = response.data.data; - // console.log("response", newData); + // console.log("newData", 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"]); + // console.log("this.filterData", this.filterData); 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; i < this.filterData[data][item].studentsMarks.length; i++ ) { + // console.log("this.filterData[data][item].studentsMarks[i]",this.filterData[data][item].studentsMarks[i] + // .marksScored) totalMarks += this.filterData[data][item].studentsMarks[i] .marksScored; } this.filterData[data][item].totalMarks = totalMarks; - // var total = 0; - // total += this.filterData[data][item].totalMarks ; - // console.log("total", total); + // console.log("this.filterData[data][item].grade", this.filterData[data][item].grade); + if (totalMarks > 90) { + this.filterData[data][item].grade = this.gradeAPlus; + } else if (totalMarks > 80 && totalMarks < 90) { + this.filterData[data][item].grade = this.gradeA; + } else if (totalMarks > 70 && totalMarks < 80) { + this.filterData[data][item].grade = this.gradeBPlus; + } else if (totalMarks > 60 && totalMarks < 70) { + this.filterData[data][item].grade = this.gradeB; + } else if (totalMarks > 50 && totalMarks < 60) { + this.filterData[data][item].grade = this.gradeCPlus; + } else if (totalMarks > 40 && totalMarks < 50) { + this.filterData[data][item].grade = this.gradeC; + } } } + this.showLoader = false; }) .catch(error => { // console.log("err====>", err); -- 2.0.0