diff --git a/src/pages/Dashboard/dashboard.vue b/src/pages/Dashboard/dashboard.vue
index 2a353b4..a2afa6c 100644
--- a/src/pages/Dashboard/dashboard.vue
+++ b/src/pages/Dashboard/dashboard.vue
@@ -116,7 +116,7 @@
Fees
- Rs 1000
+ Rs. {{ feeData.totalFees }}
@@ -127,7 +127,7 @@
Collection
- Rs 2000
+ Rs. {{ feeData.totalCollection }}
@@ -146,6 +146,7 @@
+
@@ -328,6 +330,7 @@ export default {
}
},
selected: {},
+ barGraph: [],
// notice: {},
userData: {},
dated: new Date(2018, 0, 9),
@@ -339,6 +342,9 @@ export default {
classes: "",
noticeData: [],
expenseData: [],
+ feeData: [],
+ collectionData: [],
+
attrs: [
{
key: "today",
@@ -356,7 +362,7 @@ export default {
series: [
{
name: "Total",
- data: [66, 44, 33]
+ data: []
}
],
chartOptions: {
@@ -448,6 +454,7 @@ export default {
this.getClasses();
this.getNoticeData();
this.getUserData();
+ this.getFeesAndCollectionsData();
this.getExpensesData();
// this.getUsersList();
},
@@ -607,20 +614,51 @@ export default {
// }
});
},
+
+ getFeesAndCollectionsData() {
+ http()
+ .get("/getTotalFeesAndCollections", {
+ headers: {
+ Authorization: "Bearer " + this.token
+ }
+ })
+ .then(response => {
+ this.feeData = response.data.data;
+ // this.collectionData = response.data.data;
+ this.series[0].data[0] = this.feeData.totalFees;
+ this.series[0].data[1] = this.feeData.totalCollection;
+ console.log("this.series====", this.series);
+
+ this.showLoader = false;
+ })
+ .catch(error => {
+ this.showLoader = false;
+ });
+ },
getExpensesData() {
http()
- .get("/getTotalExpenses", {
- headers: {
- Authorization: "Bearer " + this.token
- }
- })
- .then(response => {
- this.expenseData = response.data.data;
- this.showLoader = false;
- })
- .catch(error => {
- this.showLoader = false;
- })
+ .get("/getTotalExpenses", {
+ headers: {
+ Authorization: "Bearer " + this.token
+ }
+ })
+ .then(response => {
+ this.expenseData = response.data.data;
+ // var array = response.data.data.sum;
+ this.series[0].data[2] = this.expenseData.sum;
+ // console.log("this.series.data", this.series[0].data);
+ // this.series = [
+ // {
+ // name: "Total",
+ // data: array
+ // }
+ // ];
+ // console.log("this.series====", this.series);
+ this.showLoader = false;
+ })
+ .catch(error => {
+ this.showLoader = false;
+ });
}
}
};