Commit 01b56330ee2dee7e8ee86380c41a36cdee3849f5

Authored by Shikha Mishra
1 parent b3f2f7ad75

add api of fee and collection in dashboard

Showing 1 changed file with 53 additions and 15 deletions   Show diff stats
src/pages/Dashboard/dashboard.vue
... ... @@ -116,7 +116,7 @@
116 116 <v-list-tile-title class="mt-2">
117 117 <p class="subheading font-color">Fees</p>
118 118 </v-list-tile-title>
119   - <v-list-tile-title>Rs 1000</v-list-tile-title>
  119 + <v-list-tile-title>Rs. {{ feeData.totalFees }}</v-list-tile-title>
120 120 </v-list-tile-content>
121 121 </v-list-tile>
122 122 <v-list-tile>
... ... @@ -127,7 +127,7 @@
127 127 <v-list-tile-title class="mt-2">
128 128 <p class="subheading font-color">Collection</p>
129 129 </v-list-tile-title>
130   - <v-list-tile-title>Rs 2000</v-list-tile-title>
  130 + <v-list-tile-title>Rs. {{ feeData.totalCollection }}</v-list-tile-title>
131 131 </v-list-tile-content>
132 132 </v-list-tile>
133 133 <v-list-tile>
... ... @@ -146,6 +146,7 @@
146 146 </v-flex>
147 147 <v-flex xs12 sm12 md9 lg9>
148 148 <!-- <div id="chart"> -->
  149 + <div v-if="this.series" title="Swarn Singh">
149 150 <apexchart
150 151 type="bar"
151 152 height="250"
... ... @@ -153,6 +154,7 @@
153 154 :options="chartOptions"
154 155 :series="series"
155 156 ></apexchart>
  157 + </div>
156 158 <!-- </div> -->
157 159 </v-flex>
158 160 </v-layout>
... ... @@ -328,6 +330,7 @@ export default {
328 330 }
329 331 },
330 332 selected: {},
  333 + barGraph: [],
331 334 // notice: {},
332 335 userData: {},
333 336 dated: new Date(2018, 0, 9),
... ... @@ -339,6 +342,9 @@ export default {
339 342 classes: "",
340 343 noticeData: [],
341 344 expenseData: [],
  345 + feeData: [],
  346 + collectionData: [],
  347 +
342 348 attrs: [
343 349 {
344 350 key: "today",
... ... @@ -356,7 +362,7 @@ export default {
356 362 series: [
357 363 {
358 364 name: "Total",
359   - data: [66, 44, 33]
  365 + data: []
360 366 }
361 367 ],
362 368 chartOptions: {
... ... @@ -448,6 +454,7 @@ export default {
448 454 this.getClasses();
449 455 this.getNoticeData();
450 456 this.getUserData();
  457 + this.getFeesAndCollectionsData();
451 458 this.getExpensesData();
452 459 // this.getUsersList();
453 460 },
... ... @@ -607,20 +614,51 @@ export default {
607 614 // }
608 615 });
609 616 },
  617 +
  618 + getFeesAndCollectionsData() {
  619 + http()
  620 + .get("/getTotalFeesAndCollections", {
  621 + headers: {
  622 + Authorization: "Bearer " + this.token
  623 + }
  624 + })
  625 + .then(response => {
  626 + this.feeData = response.data.data;
  627 + // this.collectionData = response.data.data;
  628 + this.series[0].data[0] = this.feeData.totalFees;
  629 + this.series[0].data[1] = this.feeData.totalCollection;
  630 + console.log("this.series====", this.series);
  631 +
  632 + this.showLoader = false;
  633 + })
  634 + .catch(error => {
  635 + this.showLoader = false;
  636 + });
  637 + },
610 638 getExpensesData() {
611 639 http()
612   - .get("/getTotalExpenses", {
613   - headers: {
614   - Authorization: "Bearer " + this.token
615   - }
616   - })
617   - .then(response => {
618   - this.expenseData = response.data.data;
619   - this.showLoader = false;
620   - })
621   - .catch(error => {
622   - this.showLoader = false;
623   - })
  640 + .get("/getTotalExpenses", {
  641 + headers: {
  642 + Authorization: "Bearer " + this.token
  643 + }
  644 + })
  645 + .then(response => {
  646 + this.expenseData = response.data.data;
  647 + // var array = response.data.data.sum;
  648 + this.series[0].data[2] = this.expenseData.sum;
  649 + // console.log("this.series.data", this.series[0].data);
  650 + // this.series = [
  651 + // {
  652 + // name: "Total",
  653 + // data: array
  654 + // }
  655 + // ];
  656 + // console.log("this.series====", this.series);
  657 + this.showLoader = false;
  658 + })
  659 + .catch(error => {
  660 + this.showLoader = false;
  661 + });
624 662 }
625 663 }
626 664 };
... ...