Blame view

src/pages/Account/paymentHistory.vue 5.65 KB
687e0b929   Neeraj Sharma   add user,attenden...
1
  <template>
68d742034   Neeraj Sharma   implement new des...
2
3
4
5
6
7
8
    <v-container fluid class="body-color">
      <!-- ****** PAYMENT HOISTORY TABLE ****** -->
      <v-toolbar color="transparent" flat>
        <v-spacer></v-spacer>
        <v-card-title class="body-1" v-show="show">
          <v-btn icon large flat @click="displaySearch">
            <v-avatar size="27">
aa310d61a   Shikha Mishra   added functionali...
9
              <img src="/static/icon/search.png" alt="icon" />
68d742034   Neeraj Sharma   implement new des...
10
11
12
13
            </v-avatar>
          </v-btn>
        </v-card-title>
        <v-flex xs8 sm8 md3 lg2 v-show="showSearch">
687e0b929   Neeraj Sharma   add user,attenden...
14
          <v-layout>
68d742034   Neeraj Sharma   implement new des...
15
16
            <v-text-field v-model="search" label="Search" prepend-inner-icon="search" color="primary"></v-text-field>
            <v-icon @click="closeSearch" color="error">close</v-icon>
687e0b929   Neeraj Sharma   add user,attenden...
17
          </v-layout>
68d742034   Neeraj Sharma   implement new des...
18
19
        </v-flex>
      </v-toolbar>
687e0b929   Neeraj Sharma   add user,attenden...
20
21
22
23
24
25
26
      <v-data-table
        :headers="headers"
        :items="paymentHistory"
        :pagination.sync="pagination"
        :search="search"
      >
        <template slot="items" slot-scope="props">
68d742034   Neeraj Sharma   implement new des...
27
28
          <tr class="tr">
            <td class="td td-row ">{{ props.index + 1 }}</td>
37cb39130   Shikha Mishra   change the ui of ...
29
            <!-- <td class="td td-row text-xs-center">{{ props.item.studentId.name }}</td> -->
68d742034   Neeraj Sharma   implement new des...
30
31
32
33
34
35
            <td class="td td-row text-xs-center">{{ props.item.classId.classNum }}</td>
            <td class="td td-row text-xs-center">{{ props.item.feeType[0].feeTypeName }}</td>
            <td class="td td-row text-xs-center">{{ props.item.paymentMethod }}</td>
            <td class="td td-row text-xs-center">{{ props.item.totalPaidAmount }}</td>
            <td class="td td-row text-xs-center">{{ dates(props.item.date) }}</td>
            <!-- <td class="text-xs-center">
687e0b929   Neeraj Sharma   add user,attenden...
36
            <span>
ab54b5656   Neeraj Sharma   implement library...
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
              <v-tooltip top>
                <img
                  slot="activator"
                  style="cursor:pointer; width:20px; height:18px; "
                  class="mr-5"
                  @click="editItem(props.item)"
                  src="/static/icon/edit1.png"
                />
                <span>Edit</span>
              </v-tooltip>
              <v-tooltip top>
                <img
                  slot="activator"
                  style="cursor:pointer;width:20px; height:20px; "
                  class="mr-5"
                  @click="deleteItem(props.item)"
                  src="/static/icon/delete1.png"
                />
                <span>Delete</span>
              </v-tooltip>
687e0b929   Neeraj Sharma   add user,attenden...
57
            </span>
68d742034   Neeraj Sharma   implement new des...
58
59
            </td>-->
          </tr>
687e0b929   Neeraj Sharma   add user,attenden...
60
61
62
63
64
65
66
67
68
69
70
        </template>
        <v-alert
          slot="no-results"
          :value="true"
          color="error"
          icon="warning"
        >Your search for "{{ search }}" found no results.</v-alert>
      </v-data-table>
      <div class="loader" v-if="showLoader">
        <v-progress-circular indeterminate color="white"></v-progress-circular>
      </div>
68d742034   Neeraj Sharma   implement new des...
71
    </v-container>
687e0b929   Neeraj Sharma   add user,attenden...
72
73
74
75
76
77
78
79
80
81
  </template>
  
  <script>
  import http from "@/Services/http.js";
  import moment from "moment";
  
  export default {
    data: () => ({
      showLoader: false,
      search: "",
68d742034   Neeraj Sharma   implement new des...
82
83
      show: true,
      showSearch: false,
687e0b929   Neeraj Sharma   add user,attenden...
84
      pagination: {
68d742034   Neeraj Sharma   implement new des...
85
        rowsPerPage: 10
687e0b929   Neeraj Sharma   add user,attenden...
86
87
88
89
      },
      headers: [
        {
          text: "No",
68d742034   Neeraj Sharma   implement new des...
90
          align: "",
687e0b929   Neeraj Sharma   add user,attenden...
91
92
93
          sortable: false,
          value: "No"
        },
37cb39130   Shikha Mishra   change the ui of ...
94
95
96
97
98
99
        // {
        //   text: "Student",
        //   value: "student",
        //   sortable: false,
        //   align: "center"
        // },
687e0b929   Neeraj Sharma   add user,attenden...
100
        { text: "Class", value: "class", sortable: false, align: "center" },
ab54b5656   Neeraj Sharma   implement library...
101
102
103
104
105
106
107
108
109
110
111
112
        {
          text: "Fee Type",
          value: "feeTypeName",
          sortable: false,
          align: "center"
        },
        {
          text: "Method",
          value: "paymentMethod",
          sortable: false,
          align: "center"
        },
687e0b929   Neeraj Sharma   add user,attenden...
113
114
115
116
117
118
119
120
121
122
123
        {
          text: "Paid Amount",
          value: "totalPaidAmount",
          sortable: false,
          align: "center"
        },
        {
          text: "Date",
          value: "date",
          sortable: false,
          align: "center"
99cd79184   Neeraj Sharma   implement all tas...
124
        }
687e0b929   Neeraj Sharma   add user,attenden...
125
126
        // { text: "Action", value: "", sortable: false, align: "center" }
      ],
68d742034   Neeraj Sharma   implement new des...
127
128
      paymentHistory: [],
      addPaymentHistoryDialog: ""
687e0b929   Neeraj Sharma   add user,attenden...
129
130
131
132
133
134
135
136
137
138
    }),
    methods: {
      dates: function(date) {
        return moment(date).format("MMMM DD, YYYY");
      },
      getPaymentHistory() {
        this.showLoader = true;
        var token = this.$store.state.token;
        http()
          .get("/getInvoicesList", {
99cd79184   Neeraj Sharma   implement all tas...
139
140
141
142
            params: {
              paymentStatus: "FULLY_PAID",
              schoolId: this.$store.state.schoolId
            },
687e0b929   Neeraj Sharma   add user,attenden...
143
144
145
146
147
148
149
150
151
152
153
154
            headers: { Authorization: "Bearer " + token }
          })
          .then(response => {
            this.paymentHistory = response.data.data;
            this.showLoader = false;
          })
          .catch(error => {
            this.showLoader = false;
            if (error.response.status === 401) {
              this.$router.replace({ path: "/" });
              this.$store.dispatch("setToken", null);
              this.$store.dispatch("Id", null);
00e4bc4e1   Neeraj Sharma   fixed auntentication
155
              this.$store.dispatch("Role", null);
687e0b929   Neeraj Sharma   add user,attenden...
156
157
            }
          });
68d742034   Neeraj Sharma   implement new des...
158
159
160
161
162
163
164
165
      },
      displaySearch() {
        (this.show = false), (this.showSearch = true);
      },
      closeSearch() {
        this.showSearch = false;
        this.show = true;
        this.search = "";
687e0b929   Neeraj Sharma   add user,attenden...
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
      }
      // getRole() {
      //   this.showLoader = true;
      //   var token = this.$store.state.token;
      //   http()
      //     .get("/getRolesList", {
      //       headers: { Authorization: "Bearer " + token }
      //     })
      //     .then(response => {
      //       this.userRole = response.data.data;
      //       this.showLoader = false;
      //       // console.log("UserList=====>",this.desserts)
      //     })
      //     .catch(error => {
      //       this.showLoader = false;
      //       if (error.response.status === 401) {
      //         this.$router.replace({ path: "/" });
      //         this.$store.dispatch("setToken", null);
      //         this.$store.dispatch("Id", null);
      //       }
      //     });
      // }
    },
    mounted() {
      this.getPaymentHistory();
      // this.getRole();
687e0b929   Neeraj Sharma   add user,attenden...
192
193
    }
  };
68d742034   Neeraj Sharma   implement new des...
194
  </script>