Commit 0cd2fbfba4d050be584a1a84b5180128293fa2da
1 parent
29ac0dbb24
Exists in
master
and in
3 other branches
implement create teacher antendece and view teahers attendence
Showing
7 changed files
with
716 additions
and
112 deletions
Show diff stats
src/api/menu.js
... | ... | @@ -53,7 +53,7 @@ const adminMenu = [ |
53 | 53 | icon: '/static/schoolIcons/Attendance.png', |
54 | 54 | items: [ |
55 | 55 | { name: 'studentAttendence', title: 'Student Attendance', component: 'studentAttendence', action: '', }, |
56 | - // { name: 'teacherAttendence', title: 'Teacher Attendance', component: 'teacherAttendence', action: '', }, | |
56 | + { name: 'teacherAttendence', title: 'Teacher Attendance', component: 'teacherAttendence', action: '', } | |
57 | 57 | // { name: 'userAttendence', title: 'User Attendance', component: 'userAttendence', action: '', }, |
58 | 58 | ] |
59 | 59 | }, | ... | ... |
src/pages/Attendence/teacherAttendence.vue
1 | 1 | <template> |
2 | 2 | <v-app id="pages-dasboard"> |
3 | - <!-- ****** EXISTING-Teachers TABLE DATA****** --> | |
4 | - <v-card flat> | |
5 | - <v-card-actions> | |
6 | - <v-layout> | |
7 | - <h4 class="right mt-2 ml-2">Teacher Attendence</h4> | |
8 | - </v-layout> | |
9 | - <v-spacer></v-spacer> | |
10 | - </v-card-actions> | |
11 | - </v-card> | |
12 | - <v-data-table | |
13 | - :headers="headers" | |
14 | - :items="desserts" | |
15 | - :pagination.sync="pagination" | |
16 | - :search="search" | |
17 | - > | |
18 | - <template slot="items" slot-scope="props"> | |
19 | - <td id="td" class="text-xs-center">{{ props.index + 1}}</td> | |
20 | - <td id="td" class="text-xs-center"> | |
21 | - <v-avatar> | |
22 | - <img :src="props.item.profilePicUrl" v-if="props.item.profilePicUrl" /> | |
23 | - <img src="/static/icon/user.png" v-else-if="!props.item.profilePicUrl" /> | |
24 | - </v-avatar> | |
25 | - </td> | |
26 | - <td id="td" class="text-xs-center">{{ props.item.name}}</td> | |
27 | - <td id="td" class="text-xs-center">{{ props.item.email }}</td> | |
28 | - <td id="td" class="text-xs-center">{{ dates(props.item.dob) }}</td> | |
29 | - <td id="td" class="text-xs-center">{{ dates(props.item.joinDate)}}</td> | |
30 | - <td id="td" class="text-xs-center">{{ props.item.mobileNo }}</td> | |
31 | - <td class="text-xs-center"> | |
32 | - <span> | |
33 | - <img | |
34 | - style="cursor:pointer; width:25px; height:18px; " | |
35 | - class="mr-5" | |
36 | - @click="profile(props.item)" | |
37 | - src="/static/icon/eye1.png" | |
38 | - /> | |
39 | - </span> | |
40 | - </td> | |
41 | - </template> | |
42 | - <v-alert | |
43 | - slot="no-results" | |
44 | - :value="true" | |
45 | - color="error" | |
46 | - icon="warning" | |
47 | - >Your search for "{{ search }}" found no results.</v-alert> | |
48 | - </v-data-table> | |
3 | + <v-tabs grow slider-color="gray"> | |
4 | + <v-tab | |
5 | + ripple | |
6 | + @click="activeTab('existing')" | |
7 | + v-bind:class="{ active: isActive }" | |
8 | + id="tab" | |
9 | + class="subheading" | |
10 | + >Existing Teacher Attendence</v-tab> | |
11 | + <v-tab | |
12 | + ripple | |
13 | + @click="activeTab('new')" | |
14 | + v-bind:class="{ active: newActive }" | |
15 | + id="tab1" | |
16 | + User | |
17 | + class="subheading" | |
18 | + >Add Teachers Attendence</v-tab> | |
19 | + <v-tab-item> | |
20 | + <!-- ****** EXISTING TACHERS-TABLE DATA****** --> | |
21 | + <v-data-table | |
22 | + :headers="headers" | |
23 | + :items="desserts" | |
24 | + :pagination.sync="pagination" | |
25 | + :search="search" | |
26 | + > | |
27 | + <template slot="items" slot-scope="props"> | |
28 | + <td id="td" class="text-xs-center">{{ props.index + 1}}</td> | |
29 | + <td id="td" class="text-xs-center"> | |
30 | + <v-avatar> | |
31 | + <img :src="props.item.profilePicUrl" v-if="props.item.profilePicUrl" /> | |
32 | + <img src="/static/icon/user.png" v-else-if="!props.item.profilePicUrl" /> | |
33 | + </v-avatar> | |
34 | + </td> | |
35 | + <td id="td" class="text-xs-center">{{ props.item.name}}</td> | |
36 | + <td id="td" class="text-xs-center">{{ props.item.email }}</td> | |
37 | + <td id="td" class="text-xs-center">{{ props.item.mobileNo }}</td> | |
38 | + <td class="text-xs-center"> | |
39 | + <router-link :to="{ name:'ViewTeacherAttendence',params: { teacherId:props.item._id } }"> | |
40 | + <span> | |
41 | + <v-tooltip top> | |
42 | + <img | |
43 | + slot="activator" | |
44 | + style="cursor:pointer; width:25px; height:18px; " | |
45 | + class="mr5" | |
46 | + src="/static/icon/eye1.png" | |
47 | + /> | |
48 | + <span>View</span> | |
49 | + </v-tooltip> | |
50 | + </span> | |
51 | + </router-link> | |
52 | + </td> | |
53 | + </template> | |
54 | + <v-alert | |
55 | + slot="no-results" | |
56 | + :value="true" | |
57 | + color="error" | |
58 | + icon="warning" | |
59 | + >Your search for "{{ search }}" found no results.</v-alert> | |
60 | + </v-data-table> | |
61 | + </v-tab-item> | |
62 | + <!-- ****** Add Teachers Attendece****** --> | |
63 | + <v-tab-item> | |
64 | + <v-card flat> | |
65 | + <v-flex xs12> | |
66 | + <v-layout wrap> | |
67 | + <v-flex xs12 md6> | |
68 | + <v-layout> | |
69 | + <v-flex xs4 sm4 md2> | |
70 | + <label class="title right mr-3 mt-4">Date:</label> | |
71 | + </v-flex> | |
72 | + <v-flex xs6> | |
73 | + <v-menu | |
74 | + ref="menu" | |
75 | + :close-on-content-click="false" | |
76 | + v-model="menu" | |
77 | + :nudge-right="40" | |
78 | + lazy | |
79 | + transition="scale-transition" | |
80 | + offset-y | |
81 | + full-width | |
82 | + min-width="290px" | |
83 | + > | |
84 | + <v-text-field | |
85 | + slot="activator" | |
86 | + v-model="date" | |
87 | + label="Select Date" | |
88 | + append-icon="event" | |
89 | + readonly | |
90 | + ></v-text-field> | |
91 | + <v-date-picker | |
92 | + ref="picker" | |
93 | + v-model="date" | |
94 | + :max="new Date().toISOString().substr(0, 10)" | |
95 | + min="1950-01-01" | |
96 | + @change="save" | |
97 | + ></v-date-picker> | |
98 | + </v-menu> | |
99 | + </v-flex> | |
100 | + </v-layout> | |
101 | + </v-flex> | |
102 | + <v-flex xs8 sm8 md6> | |
103 | + <v-btn class="right mt-3 black" dark round @click="showTable">Attendence</v-btn> | |
104 | + </v-flex> | |
105 | + </v-layout> | |
106 | + </v-flex> | |
107 | + </v-card> | |
108 | + <v-flex xs12 v-show="attendeceTable"> | |
109 | + <v-data-table | |
110 | + :headers="headers" | |
111 | + :items="teachersData" | |
112 | + :pagination.sync="pagination" | |
113 | + :search="search" | |
114 | + > | |
115 | + <template slot="items" slot-scope="props"> | |
116 | + <td id="td" class="text-xs-center">{{ props.index + 1}}</td> | |
117 | + <td id="td" class="text-xs-center"> | |
118 | + <v-avatar> | |
119 | + <img :src="props.item.profilePicUrl" v-if="props.item.profilePicUrl" /> | |
120 | + <img src="/static/icon/user.png" v-else-if="!props.item.profilePicUrl" /> | |
121 | + </v-avatar> | |
122 | + </td> | |
123 | + <td id="td" class="text-xs-center">{{ props.item.name}}</td> | |
124 | + <td id="td" class="text-xs-center">{{ props.item.email }}</td> | |
125 | + <td id="td" class="text-xs-center">{{ props.item.mobileNo }}</td> | |
126 | + <td class="text-xs-center"> | |
127 | + <v-radio-group v-model="props.item.attendence" :mandatory="false" row> | |
128 | + <v-radio | |
129 | + v-for="attendences in attendenceType" | |
130 | + :key="attendences.value" | |
131 | + :label="`${attendences.label}`" | |
132 | + :value="attendences.value" | |
133 | + ></v-radio> | |
134 | + </v-radio-group> | |
135 | + </td> | |
136 | + </template> | |
137 | + </v-data-table> | |
138 | + <v-btn @click="submit()" class="right black" round dark>Submit</v-btn> | |
139 | + </v-flex> | |
140 | + </v-tab-item> | |
141 | + </v-tabs> | |
142 | + <v-snackbar | |
143 | + :timeout="timeout" | |
144 | + :top="y === 'top'" | |
145 | + :right="x === 'right'" | |
146 | + :vertical="mode === 'vertical'" | |
147 | + v-model="snackbar" | |
148 | + color="success" | |
149 | + >{{ text }}</v-snackbar> | |
49 | 150 | <div class="loader" v-if="showLoader"> |
50 | 151 | <v-progress-circular indeterminate color="white"></v-progress-circular> |
51 | 152 | </div> |
... | ... | @@ -54,13 +155,43 @@ |
54 | 155 | |
55 | 156 | <script> |
56 | 157 | import http from "@/Services/http.js"; |
57 | -import Util from "@/util"; | |
58 | 158 | import moment from "moment"; |
59 | 159 | |
60 | 160 | export default { |
61 | 161 | data: () => ({ |
162 | + snackbar: false, | |
163 | + y: "top", | |
164 | + x: "right", | |
165 | + mode: "", | |
166 | + timeout: 3000, | |
167 | + text: "", | |
168 | + date: null, | |
169 | + menu: false, | |
170 | + attendeceTable: false, | |
62 | 171 | showLoader: false, |
172 | + loading: false, | |
63 | 173 | search: "", |
174 | + valid: true, | |
175 | + isActive: true, | |
176 | + newActive: false, | |
177 | + attendenceType: [ | |
178 | + { | |
179 | + label: "Present", | |
180 | + value: "present" | |
181 | + }, | |
182 | + { | |
183 | + label: "Late Present With Excuset", | |
184 | + value: "latePresentWithExcuse" | |
185 | + }, | |
186 | + { | |
187 | + label: "Late Present", | |
188 | + value: "latePresent" | |
189 | + }, | |
190 | + { | |
191 | + label: "Absent", | |
192 | + value: "absent" | |
193 | + } | |
194 | + ], | |
64 | 195 | pagination: { |
65 | 196 | rowsPerPage: 15 |
66 | 197 | }, |
... | ... | @@ -79,26 +210,31 @@ export default { |
79 | 210 | }, |
80 | 211 | { text: "Name", value: "name", sortable: false, align: "center" }, |
81 | 212 | { text: "Email", value: "email", sortable: false, align: "center" }, |
82 | - { text: "DOB", value: "dob", sortable: false, align: "center" }, | |
83 | - { | |
84 | - text: "Join Date", | |
85 | - value: "joinDate", | |
86 | - sortable: false, | |
87 | - align: "center" | |
88 | - }, | |
89 | 213 | { |
90 | 214 | text: "Mobile No", |
91 | 215 | value: "mobileNo", |
92 | 216 | sortable: false, |
93 | 217 | align: "center" |
94 | 218 | }, |
95 | - { text: "Action", value: "", sortable: false, align: "center" } | |
219 | + { text: "Attendance", value: "", sortable: false, align: "center" } | |
96 | 220 | ], |
97 | - desserts: [] | |
221 | + desserts: [], | |
222 | + teachersData: [], | |
223 | + addTeachers: {} | |
98 | 224 | }), |
225 | + watch: { | |
226 | + menu(val) { | |
227 | + val && this.$nextTick(() => (this.$refs.picker.activePicker = "DAY")); | |
228 | + } | |
229 | + }, | |
99 | 230 | methods: { |
100 | - dates: function(date) { | |
101 | - return moment(date).format("MMMM DD, YYYY"); | |
231 | + save(date) { | |
232 | + this.$refs.menu.save(date); | |
233 | + }, | |
234 | + showTable() { | |
235 | + this.attendeceTable = true; | |
236 | + this.getTeacherList(); | |
237 | + console.log("date", this.date); | |
102 | 238 | }, |
103 | 239 | getTeacherList() { |
104 | 240 | this.showLoader = true; |
... | ... | @@ -108,7 +244,12 @@ export default { |
108 | 244 | headers: { Authorization: "Bearer " + token } |
109 | 245 | }) |
110 | 246 | .then(response => { |
247 | + this.teachersData = response.data.data; | |
111 | 248 | this.desserts = response.data.data; |
249 | + var attendence = ""; | |
250 | + for (let i = 0; i < this.teachersData.length; i++) { | |
251 | + this.teachersData[i].attendence = "present"; | |
252 | + } | |
112 | 253 | this.showLoader = false; |
113 | 254 | // console.log("getTeacherList=====>",this.desserts) |
114 | 255 | }) |
... | ... | @@ -120,6 +261,46 @@ export default { |
120 | 261 | this.$store.dispatch("Id", null); |
121 | 262 | } |
122 | 263 | }); |
264 | + }, | |
265 | + activeTab(type) { | |
266 | + switch (type) { | |
267 | + case "existing": | |
268 | + this.newActive = false; | |
269 | + this.isActive = true; | |
270 | + break; | |
271 | + | |
272 | + default: | |
273 | + this.newActive = true; | |
274 | + this.isActive = false; | |
275 | + break; | |
276 | + } | |
277 | + }, | |
278 | + submit() { | |
279 | + var teachersAttendence = []; | |
280 | + for (var j = 0; j < this.teachersData.length; j++) { | |
281 | + teachersAttendence.push({ | |
282 | + teacherId: this.teachersData[j]._id, | |
283 | + attendanceType: this.teachersData[j].attendence | |
284 | + }); | |
285 | + } | |
286 | + let attendanceData = { | |
287 | + date: this.date, | |
288 | + teachers: teachersAttendence | |
289 | + }; | |
290 | + http() | |
291 | + .post("/createTeacherAttendance", attendanceData) | |
292 | + .then(response => { | |
293 | + this.snackbar = true; | |
294 | + this.text = response.data.message; | |
295 | + }) | |
296 | + .catch(error => { | |
297 | + this.snackbar = true; | |
298 | + this.text = error.response.data.message; | |
299 | + }); | |
300 | + }, | |
301 | + clear() { | |
302 | + this.$refs.form.reset(); | |
303 | + this.imageUrl = ""; | |
123 | 304 | } |
124 | 305 | }, |
125 | 306 | mounted() { | ... | ... |
src/pages/Attendence/viewTeacherAttendence.vue
... | ... | @@ -0,0 +1,417 @@ |
1 | +<template> | |
2 | + <v-container fluid grid-list-md> | |
3 | + <!-- <div v-show="hideData"> --> | |
4 | + <!-- <v-layout row> | |
5 | + <v-btn color="grey" @click="exportPdf" class="right" dark> | |
6 | + Export Pdf | |
7 | + <v-icon dark right size="20">save_alt</v-icon> | |
8 | + </v-btn> | |
9 | + <v-dialog v-model="dialogExport" max-width="500px"> | |
10 | + <v-btn slot="activator" color="grey" class="right" dark> | |
11 | + Export csv | |
12 | + <v-icon dark right size="20">save_alt</v-icon> | |
13 | + </v-btn> | |
14 | + <v-card> | |
15 | + <h3 class="text-xs-center py-2 grey lighten-1 white--text">Export</h3> | |
16 | + <v-card-text> | |
17 | + <v-container grid-list-md> | |
18 | + <v-layout wrap> | |
19 | + <v-flex xs12> | |
20 | + <v-menu | |
21 | + ref="menuStartDate" | |
22 | + :close-on-content-click="false" | |
23 | + v-model="menuStartDate" | |
24 | + :nudge-right="40" | |
25 | + :return-value.sync="startDate" | |
26 | + lazy | |
27 | + transition="scale-transition" | |
28 | + offset-y | |
29 | + full-width | |
30 | + min-width="290px" | |
31 | + > | |
32 | + <v-text-field | |
33 | + slot="activator" | |
34 | + v-model="startDate" | |
35 | + label="Select Start Date" | |
36 | + prepend-icon="event" | |
37 | + readonly | |
38 | + ></v-text-field> | |
39 | + <v-date-picker | |
40 | + v-model="startDate" | |
41 | + @input="$refs.menuStartDate.save(startDate)" | |
42 | + ></v-date-picker> | |
43 | + </v-menu> | |
44 | + </v-flex> | |
45 | + <v-flex xs12> | |
46 | + <v-menu | |
47 | + ref="menuEndDate" | |
48 | + :close-on-content-click="false" | |
49 | + v-model="menuEndDate" | |
50 | + :nudge-right="40" | |
51 | + :return-value.sync="endDate" | |
52 | + lazy | |
53 | + transition="scale-transition" | |
54 | + offset-y | |
55 | + full-width | |
56 | + min-width="290px" | |
57 | + > | |
58 | + <v-text-field | |
59 | + slot="activator" | |
60 | + v-model="endDate" | |
61 | + label="Select End Date" | |
62 | + prepend-icon="event" | |
63 | + readonly | |
64 | + ></v-text-field> | |
65 | + <v-date-picker v-model="endDate" @input="$refs.menuEndDate.save(endDate)"></v-date-picker> | |
66 | + </v-menu> | |
67 | + </v-flex> | |
68 | + </v-layout> | |
69 | + </v-container> | |
70 | + </v-card-text> | |
71 | + <v-card-actions> | |
72 | + <v-spacer></v-spacer> | |
73 | + <v-btn color="blue darken-1" flat @click.native="dialogExport = false">Close</v-btn> | |
74 | + <download-csv :data="json_data"> | |
75 | + <v-btn color="blue darken-1" flat @click.native="exportData">Export</v-btn> | |
76 | + </download-csv> | |
77 | + </v-card-actions> | |
78 | + </v-card> | |
79 | + </v-dialog> | |
80 | + </v-layout> --> | |
81 | + <v-layout wrap> | |
82 | + <v-flex xs12 sm12 md4> | |
83 | + <v-card flat> | |
84 | + <h3 class="text-xs-center py-2 grey lighten-1 white--text">Profile</h3> | |
85 | + <v-card-text> | |
86 | + <v-container> | |
87 | + <v-layout wrap> | |
88 | + <v-flex xs12> | |
89 | + <v-layout> | |
90 | + <v-flex | |
91 | + xs12 | |
92 | + class="text-xs-center text-sm-center text-md-center text-lg-center" | |
93 | + > | |
94 | + <v-avatar size="160px"> | |
95 | + <img src="/static/icon/user.png" v-if="!teacherData.teacherData.profilePicUrl" /> | |
96 | + <img | |
97 | + :src="teacherData.teacherData.profilePicUrl" | |
98 | + v-else-if="teacherData.teacherData.profilePicUrl" | |
99 | + /> | |
100 | + </v-avatar> | |
101 | + </v-flex> | |
102 | + </v-layout> | |
103 | + <v-layout> | |
104 | + <v-flex xs12 sm12> | |
105 | + <h3 class="text-xs-center"> | |
106 | + <b>{{ teacherData.teacherData.name }}</b> | |
107 | + </h3> | |
108 | + <p class="text-xs-center grey--text">Teacher</p> | |
109 | + </v-flex> | |
110 | + </v-layout> | |
111 | + <!-- <v-layout style="border: 1px solid lightgrey;"> | |
112 | + <v-flex xs6 sm6 class="pa-0"> | |
113 | + <h4 class="right"> | |
114 | + <b>Gender :</b> | |
115 | + </h4> | |
116 | + </v-flex> | |
117 | + <v-flex sm6 xs6 class="pa-0"> | |
118 | + <h4>{{ teacherData.teacherData.gender }}</h4> | |
119 | + </v-flex> | |
120 | + </v-layout> --> | |
121 | + <v-layout style="border: 1px solid lightgrey;"> | |
122 | + <v-flex xs6 sm6 class="pa-0"> | |
123 | + <h4 class="right"> | |
124 | + <b>D.O.B:</b> | |
125 | + </h4> | |
126 | + </v-flex> | |
127 | + <v-flex sm6 xs6 class="right pa-0"> | |
128 | + <h4>{{ dates(teacherData.teacherData.dob) }}</h4> | |
129 | + </v-flex> | |
130 | + </v-layout> | |
131 | + <v-layout style="border: 1px solid lightgrey;"> | |
132 | + <v-flex xs6 sm6 class="right pa-0"> | |
133 | + <h4 class="right"> | |
134 | + <b>Phone :</b> | |
135 | + </h4> | |
136 | + </v-flex> | |
137 | + <v-flex sm6 xs6 class="right pa-0"> | |
138 | + <h4>{{ teacherData.teacherData.mobileNo}}</h4> | |
139 | + </v-flex> | |
140 | + </v-layout> | |
141 | + </v-flex> | |
142 | + </v-layout> | |
143 | + </v-container> | |
144 | + </v-card-text> | |
145 | + </v-card> | |
146 | + </v-flex> | |
147 | + <v-flex xs12 sm12 md8> | |
148 | + <v-card flat> | |
149 | + <h3 class="py-2 text-xs-center grey lighten-1 white--text"> | |
150 | + Attendence | |
151 | + <span class="ml-4"> | |
152 | + <v-avatar class="green caption" size="12"></v-avatar> | |
153 | + <span class="subheading">Present</span> | |
154 | + </span> | |
155 | + <span class="ml-4"> | |
156 | + <v-avatar color="red caption" size="12" class></v-avatar> | |
157 | + <span class="subheading">Absent</span> | |
158 | + </span> | |
159 | + </h3> | |
160 | + <!-- <YearCalendar | |
161 | + v-model="year" | |
162 | + :activeDates="activeDates" | |
163 | + prefixClass="your_customized_wrapper_class" | |
164 | + :activeClass="activeClass" | |
165 | + ></YearCalendar> --> | |
166 | + </v-card> | |
167 | + </v-flex> | |
168 | + </v-layout> | |
169 | + </div> | |
170 | + <v-layout v-show="showPdfData"> | |
171 | + <v-container> | |
172 | + <v-flex xs12 sm12 md8 offset-sm2> | |
173 | + <!-- <v-btn | |
174 | + color="grey" | |
175 | + @click="generatePDF2Canvas()" | |
176 | + :loading="loadingPdf" | |
177 | + class="right" | |
178 | + dark | |
179 | + > | |
180 | + Download | |
181 | + <v-icon dark right size="20">save_alt</v-icon> | |
182 | + </v-btn> --> | |
183 | + </v-flex> | |
184 | + </v-container> | |
185 | + </v-layout> | |
186 | + <v-layout v-show="showPdfData"> | |
187 | + <v-container> | |
188 | + <v-layout v-show="showPdfData"> | |
189 | + <v-flex xs12 sm12 md8 offset-sm2> | |
190 | + <div ref="printMe"> | |
191 | + <v-flex xs12 class="pl-3"> | |
192 | + <!-- <v-layout> | |
193 | + <v-flex xs6 sm2 class="pa-0 mb-1"> | |
194 | + <h4> | |
195 | + <b>Name</b> | |
196 | + </h4> | |
197 | + </v-flex> | |
198 | + <v-flex sm10 xs6 class="pa-0"> | |
199 | + <h4>: {{ studentData.name }}</h4> | |
200 | + </v-flex> | |
201 | + </v-layout> | |
202 | + <v-layout> | |
203 | + <v-flex xs6 sm2 class="pa-0 mb-1"> | |
204 | + <h4> | |
205 | + <b>Type</b> | |
206 | + </h4> | |
207 | + </v-flex> | |
208 | + <v-flex sm10 xs6 class="pa-0 mb-1"> | |
209 | + <h4>: Student</h4> | |
210 | + </v-flex> | |
211 | + </v-layout> | |
212 | + <v-layout> | |
213 | + <v-flex xs6 sm2 class="pa-0 mb-1"> | |
214 | + <h4> | |
215 | + <b>Roll No</b> | |
216 | + </h4> | |
217 | + </v-flex> | |
218 | + <v-flex sm10 xs6 class="pa-0 mb-1"> | |
219 | + <h4>: {{ studentData.rollNo }}</h4> | |
220 | + </v-flex> | |
221 | + </v-layout> | |
222 | + <v-layout> | |
223 | + <v-flex xs6 sm2 class="pa-0 mb-1"> | |
224 | + <h4> | |
225 | + <b>Class</b> | |
226 | + </h4> | |
227 | + </v-flex> | |
228 | + <v-flex sm10 xs6 class="pa-0 mb-1"> | |
229 | + <h4>: {{ studentData.classId.classNum }}</h4> | |
230 | + </v-flex> | |
231 | + </v-layout> | |
232 | + <v-layout> | |
233 | + <v-flex xs6 sm2 class="pa-0 mb-1"> | |
234 | + <h4> | |
235 | + <b>Section</b> | |
236 | + </h4> | |
237 | + </v-flex> | |
238 | + <v-flex sm10 xs6 class="pa-0 mb-3"> | |
239 | + <h4>: {{ studentData.sectionId.name}}</h4> | |
240 | + </v-flex> | |
241 | + </v-layout> --> | |
242 | + </v-flex> | |
243 | + <!-- <v-card flat> | |
244 | + <h3 class="py-2 text-xs-center grey lighten-1 white--text"> | |
245 | + Attendence | |
246 | + <span class="ml-4"> | |
247 | + <v-avatar class="green caption" size="12"></v-avatar> | |
248 | + <span class="subheading">Present</span> | |
249 | + </span> | |
250 | + <span class="ml-4"> | |
251 | + <v-avatar color="red caption" size="12" class></v-avatar> | |
252 | + <span class="subheading">Absent</span> | |
253 | + </span> | |
254 | + </h3> | |
255 | + <YearCalendar | |
256 | + v-model="year" | |
257 | + :activeDates="activeDates" | |
258 | + prefixClass="your_customized_wrapper_class" | |
259 | + :activeClass="activeClass" | |
260 | + ></YearCalendar> | |
261 | + </v-card> --> | |
262 | + </div> | |
263 | + </v-flex> | |
264 | + </v-layout> | |
265 | + </v-container> | |
266 | + </v-layout> | |
267 | + <!-- <img :src="output" v-show="false"/> --> | |
268 | + <div class="loader" v-if="showLoader"> | |
269 | + <v-progress-circular indeterminate color="white"></v-progress-circular> | |
270 | + </div> | |
271 | + </v-container> | |
272 | +</template> | |
273 | + | |
274 | +<script lang="js"> | |
275 | +import moment from "moment"; | |
276 | +import http from "@/Services/http.js"; | |
277 | +import YearCalendar from "vue-material-year-calendar"; | |
278 | +import jsPDF from 'jspdf'; | |
279 | + // eslint-disable-next-line | |
280 | +import autoTable from 'jspdf-autotable'; | |
281 | + | |
282 | +export default { | |
283 | + components: { YearCalendar }, | |
284 | + data() { | |
285 | + return { | |
286 | + showPdfData:false, | |
287 | + hideData:true, | |
288 | + loadingPdf:false, | |
289 | + output:null, | |
290 | + studentsList: [], | |
291 | + json_data: [], | |
292 | + dialogExport: false, | |
293 | + startDate: "", | |
294 | + endDate: "", | |
295 | + menuEndDate: false, | |
296 | + menuStartDate: false, | |
297 | + showLoader: false, | |
298 | + token: "", | |
299 | + year: new Date().getFullYear(), | |
300 | + activeDates: [], | |
301 | + activeClass: "", | |
302 | + teacherData: {} | |
303 | + }; | |
304 | + }, | |
305 | + mounted() { | |
306 | + this.token = this.$store.state.token; | |
307 | + this.getTeacherAttendence(); | |
308 | + // this.getStudentData(); | |
309 | + }, | |
310 | + methods: { | |
311 | + dates: function(date) { | |
312 | + return moment(date).format("MMMM DD, YYYY"); | |
313 | + }, | |
314 | + getTeacherAttendence() { | |
315 | + this.showLoader = true; | |
316 | + http() | |
317 | + .get( | |
318 | + "/teacherAttendance", | |
319 | + { params: { teacherId: this.$route.params.teacherId } }, | |
320 | + { | |
321 | + headers: { Authorization: "Bearer " + this.token } | |
322 | + } | |
323 | + ) | |
324 | + .then(response => { | |
325 | + this.showLoader = false; | |
326 | + this.teacherData = response.data.data; | |
327 | + // let array = []; | |
328 | + // for (let i = 0; i < response.data.data.length; i++) { | |
329 | + // if (response.data.data[i].students[0].isPresent == true) { | |
330 | + // array.push({ | |
331 | + // date: response.data.data[i].date, | |
332 | + // className: "green" | |
333 | + // }); | |
334 | + // } else if (response.data.data[i].students[0].isPresent == false) { | |
335 | + // array.push({ | |
336 | + // date: response.data.data[i].date, | |
337 | + // className: "red" | |
338 | + // }); | |
339 | + // } | |
340 | + // } | |
341 | + // this.activeDates = array; | |
342 | + }) | |
343 | + .catch(error => { | |
344 | + this.showLoader = false; | |
345 | + if (error.response.status === 401) { | |
346 | + this.$router.replace({ path: "/" }); | |
347 | + this.$store.dispatch("setToken", null); | |
348 | + this.$store.dispatch("Id", null); | |
349 | + this.$store.dispatch("Role", null); | |
350 | + } | |
351 | + }); | |
352 | + }, | |
353 | +// getStudentData() { | |
354 | +// http() | |
355 | +// .get( | |
356 | +// "/getParticularStudentDetail", | |
357 | +// { params: { studentId: this.$route.params.id } }, | |
358 | +// { | |
359 | +// headers: { Authorization: "Bearer " + this.token } | |
360 | +// } | |
361 | +// ) | |
362 | +// .then(response => { | |
363 | +// this.studentData = response.data.data; | |
364 | +// }) | |
365 | +// .catch(err => { | |
366 | +// console.log("err====>", err); | |
367 | +// // this.$router.replace({ path: '/' }); | |
368 | +// }); | |
369 | +// }, | |
370 | +// exportData() { | |
371 | +// http() | |
372 | +// .get( | |
373 | +// "/studentAttendanceByMonth", | |
374 | +// { | |
375 | +// params: { | |
376 | +// studentId: this.$route.params.id, | |
377 | +// startDate: this.startDate, | |
378 | +// endDate: this.endDate | |
379 | +// } | |
380 | +// }, | |
381 | +// { | |
382 | +// headers: { Authorization: "Bearer " + this.token } | |
383 | +// } | |
384 | +// ) | |
385 | +// .then(response => { | |
386 | +// this.json_data = response.data.data; | |
387 | +// this.dialogExport = true; | |
388 | +// }) | |
389 | +// .catch(err => { | |
390 | +// console.log("err====>", err); | |
391 | +// // this.$router.replace({ path: '/' }); | |
392 | +// }); | |
393 | +// }, | |
394 | +// exportPdf(){ | |
395 | +// this.hideData = false; | |
396 | +// this.showPdfData = true | |
397 | +// }, | |
398 | +// async generatePDF2Canvas(){ | |
399 | +// this.loadingPdf = true | |
400 | +// const el = this.$refs.printMe; | |
401 | +// // add option type to get the image version | |
402 | +// // if not provided the promise will return | |
403 | +// // the canvas. | |
404 | +// const options = { | |
405 | +// type: 'dataURL' | |
406 | +// } | |
407 | +// this.output = await this.$html2canvas(el, options); | |
408 | +// if(this.output) { | |
409 | +// this.loadingPdf = false | |
410 | +// } | |
411 | +// let doc = new jsPDF(); | |
412 | +// doc.addImage(this.output, 'JPEG', 5, 10, 200, 280); | |
413 | +// doc.save("Attendance.pdf"); | |
414 | +// } | |
415 | + } | |
416 | +}; | |
417 | +</script> | ... | ... |
src/pages/Mark/mark.vue
... | ... | @@ -455,12 +455,6 @@ export default { |
455 | 455 | }, |
456 | 456 | findStudents() { |
457 | 457 | this.getStudentData = []; |
458 | - // for (let k = 0; k < this.headerOfMark.length; k++) { | |
459 | - // this.headerOfMark[k].slice(5); | |
460 | - // console.log(this.headerOfMark); | |
461 | - // } | |
462 | - // console.log(this.headerOfMark); | |
463 | - | |
464 | 458 | if (this.$refs.form.validate()) { |
465 | 459 | this.showLoader = true; |
466 | 460 | http() |
... | ... | @@ -471,8 +465,6 @@ export default { |
471 | 465 | } |
472 | 466 | }) |
473 | 467 | .then(response => { |
474 | - console.log(" bbbbbbbbbbbbbbbbbbb", this.headerOfMark); | |
475 | - | |
476 | 468 | this.getStudentData = response.data.data; |
477 | 469 | this.showLoader = false; |
478 | 470 | this.showLoader = true; |
... | ... | @@ -483,7 +475,6 @@ export default { |
483 | 475 | .then(response => { |
484 | 476 | this.showLoader = false; |
485 | 477 | this.headerOfMark.length = 4; |
486 | - // console.log("getSectionsList=====>", response.data.data); | |
487 | 478 | for (var i = 0; i < response.data.data.length; i++) { |
488 | 479 | this.headerOfMark.push({ |
489 | 480 | text: | ... | ... |
src/pages/Students/students.vue
... | ... | @@ -28,7 +28,7 @@ |
28 | 28 | v-model="snackbar" |
29 | 29 | color="success" |
30 | 30 | >{{ text }}</v-snackbar> |
31 | - <v-dialog v-model="dialog" max-width="1500px" scrollable> | |
31 | + <v-dialog v-model="dialog" max-width="170 0px" scrollable> | |
32 | 32 | <v-card flat> |
33 | 33 | <v-toolbar color="grey lighten-2" flat> |
34 | 34 | <v-spacer></v-spacer> |
... | ... | @@ -37,13 +37,13 @@ |
37 | 37 | </v-toolbar-title> |
38 | 38 | <v-spacer></v-spacer> |
39 | 39 | </v-toolbar> |
40 | - <v-card-text style="height: 586px;"> | |
40 | + <v-card-text style="height: 680px;"> | |
41 | 41 | <v-form ref="form"> |
42 | 42 | <v-container fluid> |
43 | 43 | <v-layout> |
44 | 44 | <v-flex |
45 | 45 | xs12 |
46 | - class="text-xs-center text-sm-center text-md-center text-lg-center mr-4" | |
46 | + class="text-xs-center text-sm-center text-md-center text-lg-center" | |
47 | 47 | > |
48 | 48 | <v-avatar size="160px"> |
49 | 49 | <img |
... | ... | @@ -281,7 +281,7 @@ |
281 | 281 | <v-layout> |
282 | 282 | <v-flex xs4 class="pt-4 subheading"> |
283 | 283 | <label class="right hidden-xs-only hidden-sm-only">Uplaod Image:</label> |
284 | - <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Uplaod :</label> | |
284 | + <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Uplaod:</label> | |
285 | 285 | </v-flex> |
286 | 286 | <v-flex xs8 class="ml-3"> |
287 | 287 | <v-text-field |
... | ... | @@ -395,31 +395,35 @@ |
395 | 395 | </v-flex> |
396 | 396 | </v-layout> |
397 | 397 | <v-layout class="hidden-xs-only hidden-sm-only"> |
398 | - <v-flex xs12 sm12> | |
398 | + <v-flex xs12 sm4> | |
399 | 399 | <v-layout> |
400 | - <v-flex xs4 sm2 class="pt-4 subheading ml-5"> | |
401 | - <label class="right pr-4">Present Address:</label> | |
400 | + <v-flex xs4 sm4 class="pt-4 subheading"> | |
401 | + <label class="right hidden-xs-only hidden-sm-only">Permanent Address:</label> | |
402 | + <label | |
403 | + class="right hidden-lg-only hidden-md-only hidden-xl-only" | |
404 | + >Permanent Address:</label> | |
402 | 405 | </v-flex> |
403 | - <v-flex xs8 sm12> | |
406 | + <v-flex xs12 sm8 class="ml-3"> | |
404 | 407 | <v-text-field |
405 | - name="input-4-3" | |
406 | - v-model="editedItem.presentAddress" | |
407 | - placeholder="fill Your present Address" | |
408 | + v-model="editedItem.permanentAddress" | |
409 | + placeholder="fill Your Permanent Address" | |
408 | 410 | required |
409 | 411 | ></v-text-field> |
410 | 412 | </v-flex> |
411 | 413 | </v-layout> |
412 | 414 | </v-flex> |
413 | - <v-flex xs12 sm12> | |
415 | + <v-flex xs12 sm4> | |
414 | 416 | <v-layout> |
415 | - <v-flex xs4 sm2 class="pt-4 subheading ml-5 addressForm"> | |
416 | - <label class>Permanent Address:</label> | |
417 | + <v-flex xs4 class="pt-4 subheading"> | |
418 | + <label class="right hidden-xs-only hidden-sm-only">Present Address:</label> | |
419 | + <label | |
420 | + class="right hidden-lg-only hidden-md-only hidden-xl-only" | |
421 | + >Present Address:</label> | |
417 | 422 | </v-flex> |
418 | - <v-flex xs12 sm12> | |
423 | + <v-flex xs8 class="ml-3"> | |
419 | 424 | <v-text-field |
420 | - name="input-4-3" | |
421 | - v-model="editedItem.permanentAddress" | |
422 | - placeholder="fill Your Permanent Address" | |
425 | + v-model="editedItem.presentAddress" | |
426 | + placeholder="Select Country Name" | |
423 | 427 | required |
424 | 428 | ></v-text-field> |
425 | 429 | </v-flex> |
... | ... | @@ -436,7 +440,6 @@ |
436 | 440 | <v-layout> |
437 | 441 | <v-flex xs12 sm12> |
438 | 442 | <v-textarea |
439 | - name="input-4-3" | |
440 | 443 | v-model="editedItem.presentAddress" |
441 | 444 | placeholder="fill Your present Address" |
442 | 445 | required |
... | ... | @@ -1697,7 +1700,7 @@ |
1697 | 1700 | import http from "@/Services/http.js"; |
1698 | 1701 | import moment from "moment"; |
1699 | 1702 | import countryList from "@/script/country.js"; |
1700 | -import parent from '@/script/parents.js' | |
1703 | +import parent from "@/script/parents.js"; | |
1701 | 1704 | |
1702 | 1705 | export default { |
1703 | 1706 | data: () => ({ | ... | ... |
src/pages/Teachers/teachers.vue
... | ... | @@ -26,14 +26,14 @@ |
26 | 26 | v-model="snackbar" |
27 | 27 | color="success" |
28 | 28 | >{{ text }}</v-snackbar> |
29 | - <v-dialog v-model="dialog" max-width="1100px" scrollable> | |
29 | + <v-dialog v-model="dialog" max-width="1400px" scrollable> | |
30 | 30 | <v-card flat> |
31 | 31 | <v-toolbar color="grey lighten-2" flat> |
32 | 32 | <v-spacer></v-spacer> |
33 | 33 | <v-toolbar-title>Edit Teacher Profile</v-toolbar-title> |
34 | 34 | <v-spacer></v-spacer> |
35 | 35 | </v-toolbar> |
36 | - <v-card-text style="height: 800px;"> | |
36 | + <v-card-text style="height: 740px;"> | |
37 | 37 | <v-layout> |
38 | 38 | <v-flex |
39 | 39 | xs12 |
... | ... | @@ -263,12 +263,12 @@ |
263 | 263 | </v-flex> |
264 | 264 | </v-layout> |
265 | 265 | <v-layout class="hidden-xs-only hidden-sm-only" wrap> |
266 | - <v-flex xs12 sm12> | |
266 | + <v-flex xs12 sm6> | |
267 | 267 | <v-layout> |
268 | - <v-flex xs4 sm2 class="pt-4 subheading ml-5"> | |
269 | - <label class="right pr-2">Present Address:</label> | |
268 | + <v-flex xs4 sm4 class="pt-4 subheading"> | |
269 | + <label class="right">Present Address:</label> | |
270 | 270 | </v-flex> |
271 | - <v-flex xs8 sm10> | |
271 | + <v-flex xs8 sm6 class="ml-3"> | |
272 | 272 | <v-text-field |
273 | 273 | name="input-4-3" |
274 | 274 | v-model="editedItem.presentAddress" |
... | ... | @@ -278,12 +278,12 @@ |
278 | 278 | </v-flex> |
279 | 279 | </v-layout> |
280 | 280 | </v-flex> |
281 | - <v-flex xs12 sm12> | |
281 | + <v-flex xs12 sm6> | |
282 | 282 | <v-layout> |
283 | - <v-flex xs4 sm2 class="pt-4 subheading ml-5 addressForm"> | |
284 | - <label class="pr-2">Permanent Address:</label> | |
283 | + <v-flex xs4 sm4 class="pt-4 subheading"> | |
284 | + <label class="right">Permanent Address:</label> | |
285 | 285 | </v-flex> |
286 | - <v-flex xs12 sm10> | |
286 | + <v-flex xs12 sm6 class="ml-3"> | |
287 | 287 | <v-text-field |
288 | 288 | name="input-4-3" |
289 | 289 | v-model="editedItem.permanentAddress" |
... | ... | @@ -331,7 +331,7 @@ |
331 | 331 | </v-flex> |
332 | 332 | </v-layout> |
333 | 333 | <v-layout> |
334 | - <v-flex xs12 sm12> | |
334 | + <v-flex xs12 sm10 offset-sm1> | |
335 | 335 | <v-layout> |
336 | 336 | <v-flex xs6> |
337 | 337 | <v-btn round dark @click.native="close">Cancel</v-btn> |
... | ... | @@ -1217,7 +1217,7 @@ export default { |
1217 | 1217 | name: this.editedItem.name, |
1218 | 1218 | email: this.editedItem.email, |
1219 | 1219 | role: this.editedItem.role, |
1220 | - dob: this.editedItem.date, | |
1220 | + dob: this.editedItem.dob, | |
1221 | 1221 | city: this.editedItem.city, |
1222 | 1222 | pincode: this.editedItem.pincode, |
1223 | 1223 | country: this.editedItem.country, | ... | ... |
src/router/paths.js
... | ... | @@ -297,18 +297,18 @@ export default [{ |
297 | 297 | `@/pages/Attendence/teacherAttendence.vue` |
298 | 298 | ) |
299 | 299 | }, |
300 | - { | |
301 | - path: '/AttendenceUser', | |
302 | - meta: {}, | |
303 | - name: 'userAttendence', | |
304 | - props: (route) => ({ type: route.query.type }), | |
305 | - component: () => | |
306 | - import ( | |
307 | - /* webpackChunkName: "routes" */ | |
308 | - /* webpackMode: "lazy-once" */ | |
309 | - `@/pages/Attendence/userAttendence.vue` | |
310 | - ) | |
311 | - }, | |
300 | + // { | |
301 | + // path: '/AttendenceUser', | |
302 | + // meta: {}, | |
303 | + // name: 'userAttendence', | |
304 | + // props: (route) => ({ type: route.query.type }), | |
305 | + // component: () => | |
306 | + // import ( | |
307 | + // /* webpackChunkName: "routes" */ | |
308 | + // /* webpackMode: "lazy-once" */ | |
309 | + // `@/pages/Attendence/userAttendence.vue` | |
310 | + // ) | |
311 | + // }, | |
312 | 312 | { |
313 | 313 | path: '/feeTypes', |
314 | 314 | meta: {}, |
... | ... | @@ -442,6 +442,18 @@ export default [{ |
442 | 442 | ) |
443 | 443 | }, |
444 | 444 | { |
445 | + path: '/TeacherAttendence/:teacherId', | |
446 | + meta: {}, | |
447 | + name: 'ViewTeacherAttendence', | |
448 | + props: (route) => ({ type: route.query.type }), | |
449 | + component: () => | |
450 | + import ( | |
451 | + /* webpackChunkName: "routes" */ | |
452 | + /* webpackMode: "lazy-once" */ | |
453 | + `@/pages/Attendence/viewTeacherAttendence.vue` | |
454 | + ) | |
455 | + }, | |
456 | + { | |
445 | 457 | path: '/viewInvoice/:viewInvoiceId', |
446 | 458 | meta: {}, |
447 | 459 | name: 'ViewInvoice', | ... | ... |