Commit be4bdd64161a1dfdab668fb7ce9ae3b9a350b1a5

Authored by Amber Dev
1 parent 7b5f451a3f

time select issue in time table

Showing 1 changed file with 1 additions and 1 deletions   Show diff stats
src/pages/TimeTable/timeTable.vue
1 <template> 1 <template>
2 <v-container fluid class="body-color"> 2 <v-container fluid class="body-color">
3 <!-- ****** EDIT TIME-TABLE****** --> 3 <!-- ****** EDIT TIME-TABLE****** -->
4 <v-dialog v-model="dialog" max-width="600px"> 4 <v-dialog v-model="dialog" max-width="600px">
5 <v-flex xs12 sm12> 5 <v-flex xs12 sm12>
6 <v-card flat class="card-style pa-2" dark> 6 <v-card flat class="card-style pa-2" dark>
7 <v-layout> 7 <v-layout>
8 <v-flex xs12> 8 <v-flex xs12>
9 <label class="title text-xs-center">Edit Time Table</label> 9 <label class="title text-xs-center">Edit Time Table</label>
10 <v-icon size="24" class="right" @click="dialog = false">cancel</v-icon> 10 <v-icon size="24" class="right" @click="dialog = false">cancel</v-icon>
11 </v-flex> 11 </v-flex>
12 </v-layout> 12 </v-layout>
13 <!-- <v-layout> 13 <!-- <v-layout>
14 <v-flex 14 <v-flex
15 xs12 15 xs12
16 class="text-xs-center text-sm-center text-md-center text-lg-center" 16 class="text-xs-center text-sm-center text-md-center text-lg-center"
17 > 17 >
18 <v-avatar size="100px"> 18 <v-avatar size="100px">
19 <img src="/static/icon/user.png" v-if="!imageUrl" /> 19 <img src="/static/icon/user.png" v-if="!imageUrl" />
20 </v-avatar> 20 </v-avatar>
21 <input 21 <input
22 type="file" 22 type="file"
23 style="display: none" 23 style="display: none"
24 ref="image" 24 ref="image"
25 accept="image/*" 25 accept="image/*"
26 @change="onFilePicked" 26 @change="onFilePicked"
27 /> 27 />
28 <img 28 <img
29 :src="imageData.imageUrl" 29 :src="imageData.imageUrl"
30 height="150" 30 height="150"
31 v-if="imageUrl" 31 v-if="imageUrl"
32 style="border-radius:50%; width:200px" 32 style="border-radius:50%; width:200px"
33 /> 33 />
34 </v-flex> 34 </v-flex>
35 </v-layout>--> 35 </v-layout>-->
36 <v-flex xs12 sm12> 36 <v-flex xs12 sm12>
37 <v-layout> 37 <v-layout>
38 <v-flex xs4 class="pt-4 subheading"> 38 <v-flex xs4 class="pt-4 subheading">
39 <label class="right hidden-xs-only hidden-sm-only">Select Class:</label> 39 <label class="right hidden-xs-only hidden-sm-only">Select Class:</label>
40 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Class:</label> 40 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Class:</label>
41 </v-flex> 41 </v-flex>
42 <v-flex xs8 sm5 class="ml-3"> 42 <v-flex xs8 sm5 class="ml-3">
43 <v-select 43 <v-select
44 :items="addclass" 44 :items="addclass"
45 label="Select Class" 45 label="Select Class"
46 v-model="editedItem.classNum" 46 v-model="editedItem.classNum"
47 item-text="classNum" 47 item-text="classNum"
48 item-value="_id" 48 item-value="_id"
49 @change="getSections(editedItem.classNum)" 49 @change="getSections(editedItem.classNum)"
50 ></v-select> 50 ></v-select>
51 </v-flex> 51 </v-flex>
52 </v-layout> 52 </v-layout>
53 </v-flex> 53 </v-flex>
54 <v-flex xs12 sm12> 54 <v-flex xs12 sm12>
55 <v-layout> 55 <v-layout>
56 <v-flex xs4 class="pt-4 subheading"> 56 <v-flex xs4 class="pt-4 subheading">
57 <label class="right hidden-xs-only hidden-sm-only">Section Name:</label> 57 <label class="right hidden-xs-only hidden-sm-only">Section Name:</label>
58 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Section:</label> 58 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Section:</label>
59 </v-flex> 59 </v-flex>
60 <v-flex xs8 sm5 class="ml-3"> 60 <v-flex xs8 sm5 class="ml-3">
61 <v-select 61 <v-select
62 :items="addSection" 62 :items="addSection"
63 label="Select Section" 63 label="Select Section"
64 v-model="editedItem.selectSection" 64 v-model="editedItem.selectSection"
65 item-text="name" 65 item-text="name"
66 item-value="_id" 66 item-value="_id"
67 ></v-select> 67 ></v-select>
68 </v-flex> 68 </v-flex>
69 </v-layout> 69 </v-layout>
70 </v-flex> 70 </v-flex>
71 <v-layout> 71 <v-layout>
72 <v-flex xs12 sm9 offset-sm1> 72 <v-flex xs12 sm9 offset-sm1>
73 <v-card-actions> 73 <v-card-actions>
74 <v-spacer></v-spacer> 74 <v-spacer></v-spacer>
75 <v-btn round dark @click.native="close" class="clear-button">Cancel</v-btn> 75 <v-btn round dark @click.native="close" class="clear-button">Cancel</v-btn>
76 <v-btn round dark @click="save" class="add-button">Save</v-btn> 76 <v-btn round dark @click="save" class="add-button">Save</v-btn>
77 </v-card-actions> 77 </v-card-actions>
78 </v-flex> 78 </v-flex>
79 </v-layout> 79 </v-layout>
80 </v-card> 80 </v-card>
81 </v-flex> 81 </v-flex>
82 </v-dialog> 82 </v-dialog>
83 83
84 <!-- ****** ADD Dialog Schedule IN TIME-TABLE ****** --> 84 <!-- ****** ADD Dialog Schedule IN TIME-TABLE ****** -->
85 85
86 <v-dialog v-model="dialogSchedule" max-width="600px"> 86 <v-dialog v-model="dialogSchedule" max-width="600px">
87 <v-flex xs12 sm12> 87 <v-flex xs12 sm12>
88 <v-card flat class="card-style pa-2" dark> 88 <v-card flat class="card-style pa-2" dark>
89 <v-layout> 89 <v-layout>
90 <v-flex xs12> 90 <v-flex xs12>
91 <label class="title text-xs-center">Add Schedule</label> 91 <label class="title text-xs-center">Add Schedule</label>
92 <v-icon size="24" class="right" @click="dialogSchedule = false">cancel</v-icon> 92 <v-icon size="24" class="right" @click="dialogSchedule = false">cancel</v-icon>
93 </v-flex> 93 </v-flex>
94 </v-layout> 94 </v-layout>
95 <v-form ref="formAddDay" v-model="validAddDay" lazy-validation> 95 <v-form ref="formAddDay" v-model="validAddDay" lazy-validation>
96 <v-container fluid> 96 <v-container fluid>
97 <v-flex xs12 sm12 class="py-3"> 97 <v-flex xs12 sm12 class="py-3">
98 <v-layout> 98 <v-layout>
99 <v-flex xs4 class="pt-4 subheading"> 99 <v-flex xs4 class="pt-4 subheading">
100 <label class="right hidden-xs-only hidden-sm-only">Select Day:</label> 100 <label class="right hidden-xs-only hidden-sm-only">Select Day:</label>
101 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Day:</label> 101 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Day:</label>
102 </v-flex> 102 </v-flex>
103 <v-flex xs12 sm5 class="pl-3"> 103 <v-flex xs12 sm5 class="pl-3">
104 <v-select 104 <v-select
105 :items="addOneDay" 105 :items="addOneDay"
106 label="Select Day" 106 label="Select Day"
107 v-model="schedule.selectDay" 107 v-model="schedule.selectDay"
108 :rules="selecDayRule" 108 :rules="selecDayRule"
109 ></v-select> 109 ></v-select>
110 </v-flex> 110 </v-flex>
111 </v-layout> 111 </v-layout>
112 </v-flex> 112 </v-flex>
113 <v-layout> 113 <v-layout>
114 <v-flex xs12 sm8 offset-sm2> 114 <v-flex xs12 sm8 offset-sm2>
115 <v-card-actions> 115 <v-card-actions>
116 <v-spacer></v-spacer> 116 <v-spacer></v-spacer>
117 <v-btn round dark @click="submitSchedule" class="add-button">Save</v-btn> 117 <v-btn round dark @click="submitSchedule" class="add-button">Save</v-btn>
118 <v-spacer></v-spacer> 118 <v-spacer></v-spacer>
119 </v-card-actions> 119 </v-card-actions>
120 </v-flex> 120 </v-flex>
121 </v-layout> 121 </v-layout>
122 </v-container> 122 </v-container>
123 </v-form> 123 </v-form>
124 </v-card> 124 </v-card>
125 </v-flex> 125 </v-flex>
126 </v-dialog> 126 </v-dialog>
127 127
128 <!-- ****** ADD LECTURES IN TIME-TABLE ****** --> 128 <!-- ****** ADD LECTURES IN TIME-TABLE ****** -->
129 129
130 <v-dialog v-model="dialogAddLecture" max-width="600px"> 130 <v-dialog v-model="dialogAddLecture" max-width="600px" persistent>
131 <v-flex xs12 sm12> 131 <v-flex xs12 sm12>
132 <v-card flat class="card-style pa-2" dark> 132 <v-card flat class="card-style pa-2" dark>
133 <v-layout> 133 <v-layout>
134 <v-flex xs12> 134 <v-flex xs12>
135 <label class="title text-xs-center">Add Lecture</label> 135 <label class="title text-xs-center">Add Lecture</label>
136 <v-icon size="24" class="right" @click="dialogAddLecture = false">cancel</v-icon> 136 <v-icon size="24" class="right" @click="dialogAddLecture = false">cancel</v-icon>
137 </v-flex> 137 </v-flex>
138 </v-layout> 138 </v-layout>
139 <v-form ref="lectureForm" v-model="valid" lazy-validation> 139 <v-form ref="lectureForm" v-model="valid" lazy-validation>
140 <v-container fluid> 140 <v-container fluid>
141 <v-flex xs12 sm12> 141 <v-flex xs12 sm12>
142 <v-layout> 142 <v-layout>
143 <v-flex xs4 class="pt-4 subheading"> 143 <v-flex xs4 class="pt-4 subheading">
144 <label class="right hidden-xs-only hidden-sm-only">Select Class:</label> 144 <label class="right hidden-xs-only hidden-sm-only">Select Class:</label>
145 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Class:</label> 145 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Class:</label>
146 </v-flex> 146 </v-flex>
147 <v-flex xs5 class="ml-3"> 147 <v-flex xs5 class="ml-3">
148 <v-select 148 <v-select
149 :items="addclass" 149 :items="addclass"
150 label="Select Class" 150 label="Select Class"
151 v-model="timeTable.select" 151 v-model="timeTable.select"
152 item-text="classNum" 152 item-text="classNum"
153 item-value="_id" 153 item-value="_id"
154 @change="getClassSubject(timeTable.select)" 154 @change="getClassSubject(timeTable.select)"
155 :rules="classRules" 155 :rules="classRules"
156 required 156 required
157 ></v-select> 157 ></v-select>
158 </v-flex> 158 </v-flex>
159 </v-layout> 159 </v-layout>
160 </v-flex> 160 </v-flex>
161 <v-flex xs12 sm12> 161 <v-flex xs12 sm12>
162 <v-layout> 162 <v-layout>
163 <v-flex xs4 class="pt-4 subheading"> 163 <v-flex xs4 class="pt-4 subheading">
164 <label class="right">Subject Name:</label> 164 <label class="right">Subject Name:</label>
165 </v-flex> 165 </v-flex>
166 <v-flex xs5 class="ml-3"> 166 <v-flex xs5 class="ml-3">
167 <v-select 167 <v-select
168 :items="subjectList.subjects" 168 :items="subjectList.subjects"
169 label="Select Subject" 169 label="Select Subject"
170 v-model="addlectures.subjectName" 170 v-model="addlectures.subjectName"
171 item-text="subjectName" 171 item-text="subjectName"
172 item-value="subjectName" 172 item-value="subjectName"
173 :rules="subjectNameRules" 173 :rules="subjectNameRules"
174 required 174 required
175 ></v-select> 175 ></v-select>
176 <!-- <v-text-field 176 <!-- <v-text-field
177 v-model="addlectures.subjectName" 177 v-model="addlectures.subjectName"
178 :rules="subjectNameRules" 178 :rules="subjectNameRules"
179 placeholder="fill your Subject Name" 179 placeholder="fill your Subject Name"
180 type="text" 180 type="text"
181 ></v-text-field>--> 181 ></v-text-field>-->
182 </v-flex> 182 </v-flex>
183 </v-layout> 183 </v-layout>
184 </v-flex> 184 </v-flex>
185 <v-flex xs12 sm12> 185 <v-flex xs12 sm12>
186 <v-layout> 186 <v-layout>
187 <v-flex xs4 class="pt-4 subheading"> 187 <v-flex xs4 class="pt-4 subheading">
188 <label class="right">Time In:</label> 188 <label class="right">Time In:</label>
189 </v-flex> 189 </v-flex>
190 <v-flex xs5 class="ml-3"> 190 <v-flex xs5 class="ml-3">
191 <v-menu 191 <v-menu
192 ref="menuD" 192 ref="menuD"
193 :close-on-content-click="false" 193 :close-on-content-click="false"
194 v-model="menu5" 194 v-model="menu5"
195 :nudge-right="40" 195 :nudge-right="40"
196 lazy 196 lazy
197 transition="scale-transition" 197 transition="scale-transition"
198 offset-y 198 offset-y
199 full-width 199 full-width
200 max-width="290px" 200 max-width="290px"
201 min-width="290px" 201 min-width="290px"
202 > 202 >
203 <v-text-field 203 <v-text-field
204 slot="activator" 204 slot="activator"
205 v-model="addlectures.timeIn" 205 v-model="addlectures.timeIn"
206 label="Select your Time In" 206 label="Select your Time In"
207 append-icon="access_time" 207 append-icon="access_time"
208 :rules="timeInRules" 208 :rules="timeInRules"
209 readonly 209 readonly
210 ></v-text-field> 210 ></v-text-field>
211 <v-time-picker v-model="addlectures.timeIn" @change="menu5 = false"></v-time-picker> 211 <v-time-picker v-model="addlectures.timeIn" @change="menu5 = false"></v-time-picker>
212 </v-menu> 212 </v-menu>
213 </v-flex> 213 </v-flex>
214 </v-layout> 214 </v-layout>
215 </v-flex> 215 </v-flex>
216 <v-flex xs12 sm12> 216 <v-flex xs12 sm12>
217 <v-layout> 217 <v-layout>
218 <v-flex xs4 class="pt-4 subheading"> 218 <v-flex xs4 class="pt-4 subheading">
219 <label class="right">Time Out:</label> 219 <label class="right">Time Out:</label>
220 </v-flex> 220 </v-flex>
221 <v-flex xs5 class="ml-3"> 221 <v-flex xs5 class="ml-3">
222 <v-menu 222 <v-menu
223 ref="menuE" 223 ref="menuE"
224 :close-on-content-click="false" 224 :close-on-content-click="false"
225 v-model="menu6" 225 v-model="menu6"
226 :nudge-right="40" 226 :nudge-right="40"
227 lazy 227 lazy
228 transition="scale-transition" 228 transition="scale-transition"
229 offset-y 229 offset-y
230 full-width 230 full-width
231 max-width="290px" 231 max-width="290px"
232 min-width="290px" 232 min-width="290px"
233 > 233 >
234 <v-text-field 234 <v-text-field
235 slot="activator" 235 slot="activator"
236 :rules="timeOutRules" 236 :rules="timeOutRules"
237 v-model="addlectures.timeOut" 237 v-model="addlectures.timeOut"
238 label="Select your Time Out" 238 label="Select your Time Out"
239 append-icon="access_time" 239 append-icon="access_time"
240 readonly 240 readonly
241 ></v-text-field> 241 ></v-text-field>
242 <v-time-picker v-model="addlectures.timeOut" @change="menu6 = false"></v-time-picker> 242 <v-time-picker v-model="addlectures.timeOut" @change="menu6 = false"></v-time-picker>
243 </v-menu> 243 </v-menu>
244 </v-flex> 244 </v-flex>
245 </v-layout> 245 </v-layout>
246 </v-flex> 246 </v-flex>
247 <v-flex xs12 sm12> 247 <v-flex xs12 sm12>
248 <v-layout> 248 <v-layout>
249 <v-flex xs4 class="pt-4 subheading"> 249 <v-flex xs4 class="pt-4 subheading">
250 <label class="right">Select Teacher:</label> 250 <label class="right">Select Teacher:</label>
251 </v-flex> 251 </v-flex>
252 <v-flex xs5 class="ml-3"> 252 <v-flex xs5 class="ml-3">
253 <v-select 253 <v-select
254 :items="addTeachers" 254 :items="addTeachers"
255 label="Select Teacher" 255 label="Select Teacher"
256 v-model="addlectures.teacherId" 256 v-model="addlectures.teacherId"
257 :rules="teacherRules" 257 :rules="teacherRules"
258 item-text="name" 258 item-text="name"
259 item-value="_id" 259 item-value="_id"
260 required 260 required
261 ></v-select> 261 ></v-select>
262 </v-flex> 262 </v-flex>
263 </v-layout> 263 </v-layout>
264 </v-flex> 264 </v-flex>
265 <v-layout> 265 <v-layout>
266 <v-flex xs12 sm8 offset-sm2> 266 <v-flex xs12 sm8 offset-sm2>
267 <v-card-actions> 267 <v-card-actions>
268 <v-spacer></v-spacer> 268 <v-spacer></v-spacer>
269 <v-btn round dark @click="AddLecture" class="add-button">Save</v-btn> 269 <v-btn round dark @click="AddLecture" class="add-button">Save</v-btn>
270 </v-card-actions> 270 </v-card-actions>
271 </v-flex> 271 </v-flex>
272 </v-layout> 272 </v-layout>
273 </v-container> 273 </v-container>
274 </v-form> 274 </v-form>
275 </v-card> 275 </v-card>
276 </v-flex> 276 </v-flex>
277 </v-dialog> 277 </v-dialog>
278 278
279 <!-- ****** EDIT PARTICULAR LECTURES TIME-TABLE ****** --> 279 <!-- ****** EDIT PARTICULAR LECTURES TIME-TABLE ****** -->
280 280
281 <v-dialog v-model="dialogUpdateLectures" max-width="600px"> 281 <v-dialog v-model="dialogUpdateLectures" max-width="600px">
282 <v-flex xs12 sm12 class> 282 <v-flex xs12 sm12 class>
283 <v-card flat class="card-style pa-2" dark> 283 <v-card flat class="card-style pa-2" dark>
284 <v-layout> 284 <v-layout>
285 <v-flex xs12> 285 <v-flex xs12>
286 <label class="title text-xs-center">Edit Lecture</label> 286 <label class="title text-xs-center">Edit Lecture</label>
287 <v-icon size="24" class="right" @click="dialogUpdateLectures = false">cancel</v-icon> 287 <v-icon size="24" class="right" @click="dialogUpdateLectures = false">cancel</v-icon>
288 </v-flex> 288 </v-flex>
289 </v-layout> 289 </v-layout>
290 <v-flex xs12 sm12> 290 <v-flex xs12 sm12>
291 <v-layout> 291 <v-layout>
292 <v-flex xs4 class="pt-4 subheading"> 292 <v-flex xs4 class="pt-4 subheading">
293 <label class="right hidden-xs-only hidden-sm-only">Select Class:</label> 293 <label class="right hidden-xs-only hidden-sm-only">Select Class:</label>
294 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Class:</label> 294 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Class:</label>
295 </v-flex> 295 </v-flex>
296 <v-flex xs7 sm6 class="ml-3"> 296 <v-flex xs7 sm6 class="ml-3">
297 <v-select 297 <v-select
298 :items="addclass" 298 :items="addclass"
299 label="Select Class" 299 label="Select Class"
300 v-model="updateLectures.select" 300 v-model="updateLectures.select"
301 item-text="classNum" 301 item-text="classNum"
302 item-value="_id" 302 item-value="_id"
303 @change="getClassSubject(updateLectures.select)" 303 @change="getClassSubject(updateLectures.select)"
304 required 304 required
305 ></v-select> 305 ></v-select>
306 </v-flex> 306 </v-flex>
307 </v-layout> 307 </v-layout>
308 </v-flex> 308 </v-flex>
309 <v-flex xs12 sm12> 309 <v-flex xs12 sm12>
310 <v-layout> 310 <v-layout>
311 <v-flex xs4 class="pt-4 subheading"> 311 <v-flex xs4 class="pt-4 subheading">
312 <label class="right hidden-xs-only hidden-sm-only">Select Subject:</label> 312 <label class="right hidden-xs-only hidden-sm-only">Select Subject:</label>
313 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Subject:</label> 313 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Subject:</label>
314 </v-flex> 314 </v-flex>
315 <v-flex xs7 sm6 class="ml-3"> 315 <v-flex xs7 sm6 class="ml-3">
316 <v-select 316 <v-select
317 :items="subjectList.subjects" 317 :items="subjectList.subjects"
318 label="Select Subject" 318 label="Select Subject"
319 v-model="updateLectures.subjectName" 319 v-model="updateLectures.subjectName"
320 item-text="subjectName" 320 item-text="subjectName"
321 item-value="subjectName" 321 item-value="subjectName"
322 required 322 required
323 ></v-select> 323 ></v-select>
324 <!-- <v-text-field 324 <!-- <v-text-field
325 v-model="updateLectures.subjectName" 325 v-model="updateLectures.subjectName"
326 placeholder="fill your Subject Name" 326 placeholder="fill your Subject Name"
327 type="text" 327 type="text"
328 ></v-text-field>--> 328 ></v-text-field>-->
329 </v-flex> 329 </v-flex>
330 </v-layout> 330 </v-layout>
331 </v-flex> 331 </v-flex>
332 <v-flex xs12 sm12> 332 <v-flex xs12 sm12>
333 <v-layout> 333 <v-layout>
334 <v-flex xs5 sm4 class="pt-4 subheading"> 334 <v-flex xs5 sm4 class="pt-4 subheading">
335 <label class="right">Time In:</label> 335 <label class="right">Time In:</label>
336 </v-flex> 336 </v-flex>
337 <v-flex xs7 sm6 class="ml-3"> 337 <v-flex xs7 sm6 class="ml-3">
338 <v-menu 338 <v-menu
339 ref="menuC" 339 ref="menuC"
340 :close-on-content-click="false" 340 :close-on-content-click="false"
341 v-model="menu4" 341 v-model="menu4"
342 :nudge-right="40" 342 :nudge-right="40"
343 lazy 343 lazy
344 transition="scale-transition" 344 transition="scale-transition"
345 offset-y 345 offset-y
346 full-width 346 full-width
347 max-width="290px" 347 max-width="290px"
348 min-width="290px" 348 min-width="290px"
349 > 349 >
350 <v-text-field 350 <v-text-field
351 slot="activator" 351 slot="activator"
352 v-model="updateLectures.timeIn" 352 v-model="updateLectures.timeIn"
353 placeholder="Select your Time In" 353 placeholder="Select your Time In"
354 append-icon="access_time" 354 append-icon="access_time"
355 readonly 355 readonly
356 ></v-text-field> 356 ></v-text-field>
357 <v-time-picker v-model="updateLectures.timeIn" @change="menu4= false"></v-time-picker> 357 <v-time-picker v-model="updateLectures.timeIn" @change="menu4= false"></v-time-picker>
358 </v-menu> 358 </v-menu>
359 </v-flex> 359 </v-flex>
360 </v-layout> 360 </v-layout>
361 </v-flex> 361 </v-flex>
362 <v-flex xs12 sm12> 362 <v-flex xs12 sm12>
363 <v-layout> 363 <v-layout>
364 <v-flex xs5 sm4 class="pt-4 subheading"> 364 <v-flex xs5 sm4 class="pt-4 subheading">
365 <label class="right">Time Out:</label> 365 <label class="right">Time Out:</label>
366 </v-flex> 366 </v-flex>
367 <v-flex xs7 sm6 class="ml-3"> 367 <v-flex xs7 sm6 class="ml-3">
368 <v-menu 368 <v-menu
369 ref="menuB" 369 ref="menuB"
370 :close-on-content-click="false" 370 :close-on-content-click="false"
371 v-model="menu3" 371 v-model="menu3"
372 :nudge-right="40" 372 :nudge-right="40"
373 lazy 373 lazy
374 transition="scale-transition" 374 transition="scale-transition"
375 offset-y 375 offset-y
376 full-width 376 full-width
377 max-width="290px" 377 max-width="290px"
378 min-width="290px" 378 min-width="290px"
379 > 379 >
380 <v-text-field 380 <v-text-field
381 slot="activator" 381 slot="activator"
382 v-model="updateLectures.timeOut" 382 v-model="updateLectures.timeOut"
383 placeholder="Select your Time Out" 383 placeholder="Select your Time Out"
384 append-icon="access_time" 384 append-icon="access_time"
385 readonly 385 readonly
386 ></v-text-field> 386 ></v-text-field>
387 <v-time-picker v-model="updateLectures.timeOut" @change="menu3 = false"></v-time-picker> 387 <v-time-picker v-model="updateLectures.timeOut" @change="menu3 = false"></v-time-picker>
388 </v-menu> 388 </v-menu>
389 </v-flex> 389 </v-flex>
390 </v-layout> 390 </v-layout>
391 </v-flex> 391 </v-flex>
392 <v-flex xs12 sm12> 392 <v-flex xs12 sm12>
393 <v-layout> 393 <v-layout>
394 <v-flex xs5 sm4 class="pt-4 subheading"> 394 <v-flex xs5 sm4 class="pt-4 subheading">
395 <label class="right">Select Teacher:</label> 395 <label class="right">Select Teacher:</label>
396 </v-flex> 396 </v-flex>
397 <v-flex xs7 sm6 class="ml-3"> 397 <v-flex xs7 sm6 class="ml-3">
398 <v-select 398 <v-select
399 :items="addTeachers" 399 :items="addTeachers"
400 label="Select Teacher" 400 label="Select Teacher"
401 v-model="updateLectures.teacherId" 401 v-model="updateLectures.teacherId"
402 item-text="name" 402 item-text="name"
403 item-value="_id" 403 item-value="_id"
404 required 404 required
405 ></v-select> 405 ></v-select>
406 </v-flex> 406 </v-flex>
407 </v-layout> 407 </v-layout>
408 </v-flex> 408 </v-flex>
409 <v-layout> 409 <v-layout>
410 <v-flex xs12 sm10 offset-sm1> 410 <v-flex xs12 sm10 offset-sm1>
411 <v-card-actions> 411 <v-card-actions>
412 <!-- <v-btn round dark @click.native="closeUpdateLectures">Cancel</v-btn> --> 412 <!-- <v-btn round dark @click.native="closeUpdateLectures">Cancel</v-btn> -->
413 <v-spacer></v-spacer> 413 <v-spacer></v-spacer>
414 <v-btn 414 <v-btn
415 round 415 round
416 dark 416 dark
417 class="add-button" 417 class="add-button"
418 @click="updateParticularTable(updateLectures.timeIn,updateLectures.timeOut)" 418 @click="updateParticularTable(updateLectures.timeIn,updateLectures.timeOut)"
419 >Save</v-btn> 419 >Save</v-btn>
420 </v-card-actions> 420 </v-card-actions>
421 </v-flex> 421 </v-flex>
422 </v-layout> 422 </v-layout>
423 </v-card> 423 </v-card>
424 </v-flex> 424 </v-flex>
425 </v-dialog> 425 </v-dialog>
426 <!-- ****** EXISTING-USERS TIME-TABLE ****** --> 426 <!-- ****** EXISTING-USERS TIME-TABLE ****** -->
427 427
428 <!-- <v-card flat> 428 <!-- <v-card flat>
429 <v-card-actions class="hidden-xs-only hidden-sm-only"> 429 <v-card-actions class="hidden-xs-only hidden-sm-only">
430 <v-layout> 430 <v-layout>
431 <label class="right mt-4 ml-5">Select Class:</label> 431 <label class="right mt-4 ml-5">Select Class:</label>
432 <v-select 432 <v-select
433 :items="addclass" 433 :items="addclass"
434 label="Select Class" 434 label="Select Class"
435 v-model="selectTimeTable.select" 435 v-model="selectTimeTable.select"
436 item-text="classNum" 436 item-text="classNum"
437 item-value="_id" 437 item-value="_id"
438 name="Select Class" 438 name="Select Class"
439 @change="getSections(selectTimeTable.select)" 439 @change="getSections(selectTimeTable.select)"
440 class="px-4" 440 class="px-4"
441 required 441 required
442 ></v-select> 442 ></v-select>
443 <label class="right mt-4">Select Section:</label> 443 <label class="right mt-4">Select Section:</label>
444 <v-select 444 <v-select
445 :items="addSection" 445 :items="addSection"
446 label="Select Section" 446 label="Select Section"
447 v-model="selectTimeTable.selectSection" 447 v-model="selectTimeTable.selectSection"
448 item-text="name" 448 item-text="name"
449 item-value="_id" 449 item-value="_id"
450 name="Select Section" 450 name="Select Section"
451 class="pl-3" 451 class="pl-3"
452 required 452 required
453 ></v-select> 453 ></v-select>
454 </v-layout> 454 </v-layout>
455 <v-spacer></v-spacer> 455 <v-spacer></v-spacer>
456 <v-btn @click="findTimeTable()" round dark :loading="loadingFindData" class="left">Find</v-btn> 456 <v-btn @click="findTimeTable()" round dark :loading="loadingFindData" class="left">Find</v-btn>
457 </v-card-actions> 457 </v-card-actions>
458 <v-layout class="hidden-xl-only hidden-lg-only hidden-md-only"> 458 <v-layout class="hidden-xl-only hidden-lg-only hidden-md-only">
459 <v-flex xs4 sm2 class="mt-4 ml-2"> 459 <v-flex xs4 sm2 class="mt-4 ml-2">
460 <label>Select Class:</label> 460 <label>Select Class:</label>
461 </v-flex> 461 </v-flex>
462 <v-flex xs6 sm9> 462 <v-flex xs6 sm9>
463 <v-select 463 <v-select
464 :items="addclass" 464 :items="addclass"
465 label="Select Class" 465 label="Select Class"
466 v-model="selectTimeTable.select" 466 v-model="selectTimeTable.select"
467 item-text="classNum" 467 item-text="classNum"
468 item-value="_id" 468 item-value="_id"
469 name="Select Class" 469 name="Select Class"
470 @change="getSections(selectTimeTable.select)" 470 @change="getSections(selectTimeTable.select)"
471 required 471 required
472 ></v-select> 472 ></v-select>
473 </v-flex> 473 </v-flex>
474 </v-layout> 474 </v-layout>
475 <v-layout class="hidden-xl-only hidden-lg-only hidden-md-only"> 475 <v-layout class="hidden-xl-only hidden-lg-only hidden-md-only">
476 <v-flex xs4 sm2 class="mt-4 ml-2"> 476 <v-flex xs4 sm2 class="mt-4 ml-2">
477 <label>Select Section:</label> 477 <label>Select Section:</label>
478 </v-flex> 478 </v-flex>
479 <v-flex xs6 sm9> 479 <v-flex xs6 sm9>
480 <v-select 480 <v-select
481 :items="addSection" 481 :items="addSection"
482 label="Select Section" 482 label="Select Section"
483 v-model="selectTimeTable.selectSection" 483 v-model="selectTimeTable.selectSection"
484 item-text="name" 484 item-text="name"
485 item-value="_id" 485 item-value="_id"
486 name="Select Section" 486 name="Select Section"
487 required 487 required
488 ></v-select> 488 ></v-select>
489 </v-flex> 489 </v-flex>
490 </v-layout> 490 </v-layout>
491 <v-layout class="hidden-xl-only hidden-lg-only hidden-md-only"> 491 <v-layout class="hidden-xl-only hidden-lg-only hidden-md-only">
492 <v-flex xs12> 492 <v-flex xs12>
493 <v-btn @click="findTimeTable()" round dark :loading="loading" class="right mr-4 mb-2">Find</v-btn> 493 <v-btn @click="findTimeTable()" round dark :loading="loading" class="right mr-4 mb-2">Find</v-btn>
494 </v-flex> 494 </v-flex>
495 </v-layout> 495 </v-layout>
496 </v-card>--> 496 </v-card>-->
497 <v-flex xs12> 497 <v-flex xs12>
498 <v-toolbar color="transparent" flat> 498 <v-toolbar color="transparent" flat>
499 <v-btn 499 <v-btn
500 fab 500 fab
501 dark 501 dark
502 class="open-dialog-button hidden-xl-only hidden-md-only hidden-lg-only" 502 class="open-dialog-button hidden-xl-only hidden-md-only hidden-lg-only"
503 small 503 small
504 @click="addTimeTableDialog = true" 504 @click="addTimeTableDialog = true"
505 > 505 >
506 <v-icon dark>add</v-icon> 506 <v-icon dark>add</v-icon>
507 </v-btn> 507 </v-btn>
508 <v-btn 508 <v-btn
509 round 509 round
510 class="open-dialog-button hidden-sm-only hidden-xs-only" 510 class="open-dialog-button hidden-sm-only hidden-xs-only"
511 dark 511 dark
512 @click="addTimeTableDialog = true" 512 @click="addTimeTableDialog = true"
513 > 513 >
514 <v-icon class="white--text pr-1" size="20">add</v-icon>Add Time Table 514 <v-icon class="white--text pr-1" size="20">add</v-icon>Add Time Table
515 </v-btn> 515 </v-btn>
516 <v-flex xs4 md2> 516 <v-flex xs4 md2>
517 <v-select 517 <v-select
518 :items="addclass" 518 :items="addclass"
519 label="Select Class" 519 label="Select Class"
520 v-model="selectTimeTable.select" 520 v-model="selectTimeTable.select"
521 item-text="classNum" 521 item-text="classNum"
522 item-value="_id" 522 item-value="_id"
523 name="Select Class" 523 name="Select Class"
524 @change="getSections(selectTimeTable.select)" 524 @change="getSections(selectTimeTable.select)"
525 required 525 required
526 ></v-select> 526 ></v-select>
527 </v-flex> 527 </v-flex>
528 <v-flex xs4 md2 class="ml-4"> 528 <v-flex xs4 md2 class="ml-4">
529 <v-select 529 <v-select
530 :items="addSection" 530 :items="addSection"
531 label="Select Section" 531 label="Select Section"
532 v-model="selectTimeTable.selectSection" 532 v-model="selectTimeTable.selectSection"
533 item-text="name" 533 item-text="name"
534 item-value="_id" 534 item-value="_id"
535 name="Select Section" 535 name="Select Section"
536 required 536 required
537 ></v-select> 537 ></v-select>
538 </v-flex> 538 </v-flex>
539 <v-spacer></v-spacer> 539 <v-spacer></v-spacer>
540 <v-btn 540 <v-btn
541 @click="findTimeTable()" 541 @click="findTimeTable()"
542 round 542 round
543 dark 543 dark
544 :loading="loading" 544 :loading="loading"
545 class="right mb-2 open-dialog-button" 545 class="right mb-2 open-dialog-button"
546 >Find</v-btn> 546 >Find</v-btn>
547 <v-card-title class="body-1" v-show="show"> 547 <v-card-title class="body-1" v-show="show">
548 <v-btn icon large flat @click="displaySearch"> 548 <v-btn icon large flat @click="displaySearch">
549 <v-avatar size="27"> 549 <v-avatar size="27">
550 <img src="/static/icon/search.png" alt="icon" /> 550 <img src="/static/icon/search.png" alt="icon" />
551 </v-avatar> 551 </v-avatar>
552 </v-btn> 552 </v-btn>
553 </v-card-title> 553 </v-card-title>
554 <v-flex xs8 sm8 md3 lg2 v-show="showSearch"> 554 <v-flex xs8 sm8 md3 lg2 v-show="showSearch">
555 <v-layout> 555 <v-layout>
556 <v-text-field 556 <v-text-field
557 v-model="search" 557 v-model="search"
558 label="Search" 558 label="Search"
559 prepend-inner-icon="search" 559 prepend-inner-icon="search"
560 color="primary" 560 color="primary"
561 ></v-text-field> 561 ></v-text-field>
562 <v-icon @click="closeSearch" color="error">close</v-icon> 562 <v-icon @click="closeSearch" color="error">close</v-icon>
563 </v-layout> 563 </v-layout>
564 </v-flex> 564 </v-flex>
565 </v-toolbar> 565 </v-toolbar>
566 <v-data-table 566 <v-data-table
567 :headers="headers" 567 :headers="headers"
568 :items="desserts" 568 :items="desserts"
569 :pagination.sync="pagination" 569 :pagination.sync="pagination"
570 :search="search" 570 :search="search"
571 item-key="_id" 571 item-key="_id"
572 > 572 >
573 <template slot="items" slot-scope="props"> 573 <template slot="items" slot-scope="props">
574 <tr 574 <tr
575 style="cursor: pointer;" 575 style="cursor: pointer;"
576 class="tr" 576 class="tr"
577 @click="getTimeTable(props.item), props.expanded = !props.expanded" 577 @click="getTimeTable(props.item), props.expanded = !props.expanded"
578 > 578 >
579 <td class="td td-row">{{ props.index + 1}}</td> 579 <td class="td td-row">{{ props.index + 1}}</td>
580 <td class="text-xs-center td td-row">{{ props.item.classData.classNum}}</td> 580 <td class="text-xs-center td td-row">{{ props.item.classData.classNum}}</td>
581 <td class="text-xs-center td td-row">{{ props.item.sectionData.name }}</td> 581 <td class="text-xs-center td td-row">{{ props.item.sectionData.name }}</td>
582 <td class="text-xs-center td td-row"> 582 <td class="text-xs-center td td-row">
583 <span> 583 <span>
584 <v-tooltip top> 584 <v-tooltip top>
585 <img 585 <img
586 slot="activator" 586 slot="activator"
587 style="cursor:pointer; width:20px; height:20px; " 587 style="cursor:pointer; width:20px; height:20px; "
588 class="mr-3" 588 class="mr-3"
589 @click="editItem(props.item)" 589 @click="editItem(props.item)"
590 src="/static/icon/edit.png" 590 src="/static/icon/edit.png"
591 /> 591 />
592 <span>Edit</span> 592 <span>Edit</span>
593 </v-tooltip> 593 </v-tooltip>
594 <v-tooltip top> 594 <v-tooltip top>
595 <img 595 <img
596 slot="activator" 596 slot="activator"
597 style="cursor:pointer; width:20px; height:20px; " 597 style="cursor:pointer; width:20px; height:20px; "
598 class="mr-3" 598 class="mr-3"
599 @click="deleteItem(props.item)" 599 @click="deleteItem(props.item)"
600 src="/static/icon/delete.png" 600 src="/static/icon/delete.png"
601 /> 601 />
602 <span>Delete</span> 602 <span>Delete</span>
603 </v-tooltip> 603 </v-tooltip>
604 <v-tooltip top> 604 <v-tooltip top>
605 <img 605 <img
606 slot="activator" 606 slot="activator"
607 style="cursor:pointer; width:20px; height:20px; " 607 style="cursor:pointer; width:20px; height:20px; "
608 class="mr-3" 608 class="mr-3"
609 src="/static/icon/add1.png" 609 src="/static/icon/add1.png"
610 @click="addSchedule(props.item._id)" 610 @click="addSchedule(props.item._id)"
611 /> 611 />
612 <span>Add</span> 612 <span>Add</span>
613 </v-tooltip> 613 </v-tooltip>
614 </span> 614 </span>
615 </td> 615 </td>
616 </tr> 616 </tr>
617 </template> 617 </template>
618 <template slot="expand" slot-scope="props"> 618 <template slot="expand" slot-scope="props">
619 <v-data-table 619 <v-data-table
620 :items="timeTableList.schedule" 620 :items="timeTableList.schedule"
621 hide-actions 621 hide-actions
622 item-key="title" 622 item-key="title"
623 style="width: auto;" 623 style="width: auto;"
624 > 624 >
625 <template slot="items" slot-scope="props"> 625 <template slot="items" slot-scope="props">
626 <tr class="tr"> 626 <tr class="tr">
627 <td class="text-xs-left subheading table-td td td-row"> 627 <td class="text-xs-left subheading table-td td td-row">
628 <b>{{ props.item.day }}</b> 628 <b>{{ props.item.day }}</b>
629 </td> 629 </td>
630 <td class="table-td td td-row"> 630 <td class="table-td td td-row">
631 <b>Subject</b> 631 <b>Subject</b>
632 <br /> 632 <br />
633 <b>Time In</b> 633 <b>Time In</b>
634 <br /> 634 <br />
635 <b>Time Out</b> 635 <b>Time Out</b>
636 </td> 636 </td>
637 <td v-for="list in props.item.lectures" class="table-td td td-row"> 637 <td v-for="list in props.item.lectures" class="table-td td td-row">
638 <b>{{ list.subjectName }}</b> 638 <b>{{ list.subjectName }}</b>
639 <img 639 <img
640 style="cursor:pointer; width:20px; height:18px; " 640 style="cursor:pointer; width:20px; height:18px; "
641 class="mr-2 ml-2" 641 class="mr-2 ml-2"
642 src="/static/icon/edit1.png" 642 src="/static/icon/edit1.png"
643 @click="updateTimeTable(list, timeTableList,props.item._id)" 643 @click="updateTimeTable(list, timeTableList,props.item._id)"
644 /> 644 />
645 <img 645 <img
646 style="cursor:pointer; width:20px; height:20px; " 646 style="cursor:pointer; width:20px; height:20px; "
647 src="/static/icon/delete1.png" 647 src="/static/icon/delete1.png"
648 @click="deleteTimeTable(list,props.item.lectures)" 648 @click="deleteTimeTable(list,props.item.lectures)"
649 /> 649 />
650 <br /> 650 <br />
651 {{list.timeIn}} 651 {{list.timeIn}}
652 <br /> 652 <br />
653 {{list.timeOut}} 653 {{list.timeOut}}
654 </td> 654 </td>
655 <td class="td td-row"> 655 <td class="td td-row">
656 <v-tooltip top> 656 <v-tooltip top>
657 <v-icon 657 <v-icon
658 slot="activator" 658 slot="activator"
659 color="black" 659 color="black"
660 @click="addLecture(props.item._id, timeTableList._id)" 660 @click="addLecture(props.item._id, timeTableList._id)"
661 >add_circle_outline</v-icon> 661 >add_circle_outline</v-icon>
662 <span>Add</span> 662 <span>Add</span>
663 </v-tooltip> 663 </v-tooltip>
664 </td> 664 </td>
665 </tr> 665 </tr>
666 </template> 666 </template>
667 </v-data-table> 667 </v-data-table>
668 </template> 668 </template>
669 <v-alert 669 <v-alert
670 slot="no-results" 670 slot="no-results"
671 :value="true" 671 :value="true"
672 color="error" 672 color="error"
673 icon="warning" 673 icon="warning"
674 >Your search for "{{ search }}" found no results.</v-alert> 674 >Your search for "{{ search }}" found no results.</v-alert>
675 </v-data-table> 675 </v-data-table>
676 <br /> 676 <br />
677 <br /> 677 <br />
678 </v-flex> 678 </v-flex>
679 679
680 <!-- ****** ADD TIME-TABLE ****** --> 680 <!-- ****** ADD TIME-TABLE ****** -->
681 <v-dialog v-model="addTimeTableDialog" max-width="600px"> 681 <v-dialog v-model="addTimeTableDialog" max-width="600px">
682 <v-card flat class="card-style pa-2" dark> 682 <v-card flat class="card-style pa-2" dark>
683 <v-layout> 683 <v-layout>
684 <v-flex xs12> 684 <v-flex xs12>
685 <label class="title text-xs-center">Add Time Table</label> 685 <label class="title text-xs-center">Add Time Table</label>
686 <v-icon size="24" class="right" @click="addTimeTableDialog = false">cancel</v-icon> 686 <v-icon size="24" class="right" @click="addTimeTableDialog = false">cancel</v-icon>
687 </v-flex> 687 </v-flex>
688 </v-layout> 688 </v-layout>
689 <v-form ref="form" v-model="valid" lazy-validation> 689 <v-form ref="form" v-model="valid" lazy-validation>
690 <v-container fluid class="pt-3"> 690 <v-container fluid class="pt-3">
691 <v-flex xs12> 691 <v-flex xs12>
692 <v-layout> 692 <v-layout>
693 <v-flex xs4 class="pt-4 subheading"> 693 <v-flex xs4 class="pt-4 subheading">
694 <label class="right hidden-xs-only hidden-sm-only">Select Class:</label> 694 <label class="right hidden-xs-only hidden-sm-only">Select Class:</label>
695 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Class:</label> 695 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Class:</label>
696 </v-flex> 696 </v-flex>
697 <v-flex xs8 sm6 class="ml-3"> 697 <v-flex xs8 sm6 class="ml-3">
698 <v-select 698 <v-select
699 :items="addclass" 699 :items="addclass"
700 label="Select Class" 700 label="Select Class"
701 v-model="timeTable.select" 701 v-model="timeTable.select"
702 item-text="classNum" 702 item-text="classNum"
703 item-value="_id" 703 item-value="_id"
704 @change="getSections(timeTable.select)" 704 @change="getSections(timeTable.select)"
705 :rules="classRules" 705 :rules="classRules"
706 required 706 required
707 ></v-select> 707 ></v-select>
708 </v-flex> 708 </v-flex>
709 </v-layout> 709 </v-layout>
710 </v-flex> 710 </v-flex>
711 <v-flex xs12> 711 <v-flex xs12>
712 <v-layout> 712 <v-layout>
713 <v-flex xs4 class="pt-4 subheading"> 713 <v-flex xs4 class="pt-4 subheading">
714 <label class="right hidden-xs-only hidden-sm-only">Select Section:</label> 714 <label class="right hidden-xs-only hidden-sm-only">Select Section:</label>
715 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Section:</label> 715 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Section:</label>
716 </v-flex> 716 </v-flex>
717 <v-flex sm6 xs8 class="ml-3"> 717 <v-flex sm6 xs8 class="ml-3">
718 <v-select 718 <v-select
719 :items="addSection" 719 :items="addSection"
720 label="Select Section" 720 label="Select Section"
721 v-model="timeTable.selectSection" 721 v-model="timeTable.selectSection"
722 item-text="name" 722 item-text="name"
723 item-value="_id" 723 item-value="_id"
724 :rules="sectionRules" 724 :rules="sectionRules"
725 @change="getClassSubject(timeTable.select)" 725 @change="getClassSubject(timeTable.select)"
726 required 726 required
727 ></v-select> 727 ></v-select>
728 </v-flex> 728 </v-flex>
729 </v-layout> 729 </v-layout>
730 <v-layout> 730 <v-layout>
731 <v-flex xs4 class="pt-4 subheading"> 731 <v-flex xs4 class="pt-4 subheading">
732 <label class="right hidden-xs-only hidden-sm-only">Subject Name:</label> 732 <label class="right hidden-xs-only hidden-sm-only">Subject Name:</label>
733 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Subject:</label> 733 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Subject:</label>
734 </v-flex> 734 </v-flex>
735 <v-flex xs8 sm6 class="ml-3"> 735 <v-flex xs8 sm6 class="ml-3">
736 <v-select 736 <v-select
737 :items="subjectList.subjects" 737 :items="subjectList.subjects"
738 label="Select Subject" 738 label="Select Subject"
739 v-model="timeTable.subjectName" 739 v-model="timeTable.subjectName"
740 item-text="subjectName" 740 item-text="subjectName"
741 item-value="subjectName" 741 item-value="subjectName"
742 :rules="subjectNameRules" 742 :rules="subjectNameRules"
743 required 743 required
744 ></v-select> 744 ></v-select>
745 </v-flex> 745 </v-flex>
746 </v-layout> 746 </v-layout>
747 </v-flex> 747 </v-flex>
748 <v-flex xs12> 748 <v-flex xs12>
749 <v-layout> 749 <v-layout>
750 <v-flex xs4 class="pt-4 subheading"> 750 <v-flex xs4 class="pt-4 subheading">
751 <label class="right hidden-xs-only hidden-sm-only">Select Teacher:</label> 751 <label class="right hidden-xs-only hidden-sm-only">Select Teacher:</label>
752 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Teacher:</label> 752 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Teacher:</label>
753 </v-flex> 753 </v-flex>
754 <v-flex xs8 sm6 class="ml-3"> 754 <v-flex xs8 sm6 class="ml-3">
755 <v-select 755 <v-select
756 :items="addTeachers" 756 :items="addTeachers"
757 label="Select Teacher" 757 label="Select Teacher"
758 v-model="timeTable.selectTeacher" 758 v-model="timeTable.selectTeacher"
759 item-text="name" 759 item-text="name"
760 item-value="_id" 760 item-value="_id"
761 :rules="teacherRules" 761 :rules="teacherRules"
762 required 762 required
763 ></v-select> 763 ></v-select>
764 </v-flex> 764 </v-flex>
765 </v-layout> 765 </v-layout>
766 </v-flex> 766 </v-flex>
767 <v-flex xs12> 767 <v-flex xs12>
768 <v-layout> 768 <v-layout>
769 <v-flex xs4 class="pt-4 subheading"> 769 <v-flex xs4 class="pt-4 subheading">
770 <label class="right">Select Day:</label> 770 <label class="right">Select Day:</label>
771 </v-flex> 771 </v-flex>
772 <v-flex xs8 sm6 class="ml-3"> 772 <v-flex xs8 sm6 class="ml-3">
773 <v-select 773 <v-select
774 :items="addOneDay" 774 :items="addOneDay"
775 label="Select Day" 775 label="Select Day"
776 v-model="timeTable.selectDay" 776 v-model="timeTable.selectDay"
777 :rules="dayRules" 777 :rules="dayRules"
778 item-text="name" 778 item-text="name"
779 item-value="_id" 779 item-value="_id"
780 required 780 required
781 ></v-select> 781 ></v-select>
782 </v-flex> 782 </v-flex>
783 </v-layout> 783 </v-layout>
784 </v-flex> 784 </v-flex>
785 <!-- <v-flex xs12> 785 <!-- <v-flex xs12>
786 <v-layout> 786 <v-layout>
787 <v-flex xs4 class="pt-4 subheading"> 787 <v-flex xs4 class="pt-4 subheading">
788 <label class="right hidden-xs-only hidden-sm-only">Subject Name:</label> 788 <label class="right hidden-xs-only hidden-sm-only">Subject Name:</label>
789 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Subject:</label> 789 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Subject:</label>
790 </v-flex> 790 </v-flex>
791 <v-flex xs8 sm6 class="ml-3"> 791 <v-flex xs8 sm6 class="ml-3">
792 <v-text-field 792 <v-text-field
793 placeholder="fill your Subject Name" 793 placeholder="fill your Subject Name"
794 :rules="subjectNameRules" 794 :rules="subjectNameRules"
795 v-model="timeTable.subjectName" 795 v-model="timeTable.subjectName"
796 type="text" 796 type="text"
797 required 797 required
798 ></v-text-field> 798 ></v-text-field>
799 </v-flex> 799 </v-flex>
800 </v-layout> 800 </v-layout>
801 </v-flex>--> 801 </v-flex>-->
802 <v-flex xs12> 802 <v-flex xs12>
803 <v-layout> 803 <v-layout>
804 <v-flex xs4 class="pt-4 subheading"> 804 <v-flex xs4 class="pt-4 subheading">
805 <label class="right">Time In:</label> 805 <label class="right">Time In:</label>
806 </v-flex> 806 </v-flex>
807 <v-flex xs8 sm6 class="ml-3"> 807 <v-flex xs8 sm6 class="ml-3">
808 <v-menu 808 <v-menu
809 ref="menuA" 809 ref="menuA"
810 :close-on-content-click="false" 810 :close-on-content-click="false"
811 v-model="menu2" 811 v-model="menu2"
812 :nudge-right="40" 812 :nudge-right="40"
813 :return-value.sync="timeTable.timeIn" 813 :return-value.sync="timeTable.timeIn"
814 lazy 814 lazy
815 transition="scale-transition" 815 transition="scale-transition"
816 offset-y 816 offset-y
817 full-width 817 full-width
818 max-width="290px" 818 max-width="290px"
819 min-width="290px" 819 min-width="290px"
820 > 820 >
821 <v-text-field 821 <v-text-field
822 slot="activator" 822 slot="activator"
823 v-model="timeTable.timeIn" 823 v-model="timeTable.timeIn"
824 label="Select your timeIn" 824 label="Select your timeIn"
825 append-icon="access_time" 825 append-icon="access_time"
826 :rules="timeInRules" 826 :rules="timeInRules"
827 readonly 827 readonly
828 ></v-text-field> 828 ></v-text-field>
829 <v-time-picker 829 <v-time-picker
830 v-model="timeTable.timeIn" 830 v-model="timeTable.timeIn"
831 @change="$refs.menuA.save(timeTable.timeIn)" 831 @change="$refs.menuA.save(timeTable.timeIn)"
832 ></v-time-picker> 832 ></v-time-picker>
833 </v-menu> 833 </v-menu>
834 </v-flex> 834 </v-flex>
835 </v-layout> 835 </v-layout>
836 </v-flex> 836 </v-flex>
837 <v-flex xs12> 837 <v-flex xs12>
838 <v-layout> 838 <v-layout>
839 <v-flex xs4 class="pt-4 subheading"> 839 <v-flex xs4 class="pt-4 subheading">
840 <label class="right">Time Out:</label> 840 <label class="right">Time Out:</label>
841 </v-flex> 841 </v-flex>
842 <v-flex xs8 sm6 class="ml-3"> 842 <v-flex xs8 sm6 class="ml-3">
843 <v-menu 843 <v-menu
844 ref="menu" 844 ref="menu"
845 :close-on-content-click="false" 845 :close-on-content-click="false"
846 v-model="menu1" 846 v-model="menu1"
847 :nudge-right="40" 847 :nudge-right="40"
848 :return-value.sync="timeTable.timeOut" 848 :return-value.sync="timeTable.timeOut"
849 lazy 849 lazy
850 transition="scale-transition" 850 transition="scale-transition"
851 offset-y 851 offset-y
852 full-width 852 full-width
853 max-width="290px" 853 max-width="290px"
854 min-width="290px" 854 min-width="290px"
855 > 855 >
856 <v-text-field 856 <v-text-field
857 slot="activator" 857 slot="activator"
858 v-model="timeTable.timeOut" 858 v-model="timeTable.timeOut"
859 label="Select your Time Out" 859 label="Select your Time Out"
860 append-icon="access_time" 860 append-icon="access_time"
861 :rules="timeOutRules" 861 :rules="timeOutRules"
862 readonly 862 readonly
863 ></v-text-field> 863 ></v-text-field>
864 <v-time-picker 864 <v-time-picker
865 v-model="timeTable.timeOut" 865 v-model="timeTable.timeOut"
866 @change="$refs.menu.save(timeTable.timeOut)" 866 @change="$refs.menu.save(timeTable.timeOut)"
867 ></v-time-picker> 867 ></v-time-picker>
868 </v-menu> 868 </v-menu>
869 </v-flex> 869 </v-flex>
870 </v-layout> 870 </v-layout>
871 </v-flex> 871 </v-flex>
872 <v-layout> 872 <v-layout>
873 <v-flex xs12 sm11> 873 <v-flex xs12 sm11>
874 <v-layout> 874 <v-layout>
875 <v-spacer></v-spacer> 875 <v-spacer></v-spacer>
876 <v-btn @click="clear" round class="clear-button" dark>clear</v-btn> 876 <v-btn @click="clear" round class="clear-button" dark>clear</v-btn>
877 <v-btn @click="submit" round dark :loading="loading" class="add-button">Add</v-btn> 877 <v-btn @click="submit" round dark :loading="loading" class="add-button">Add</v-btn>
878 </v-layout> 878 </v-layout>
879 </v-flex> 879 </v-flex>
880 </v-layout> 880 </v-layout>
881 </v-container> 881 </v-container>
882 </v-form> 882 </v-form>
883 </v-card> 883 </v-card>
884 </v-dialog> 884 </v-dialog>
885 <div class="loader" v-if="showLoader"> 885 <div class="loader" v-if="showLoader">
886 <v-progress-circular indeterminate color="white"></v-progress-circular> 886 <v-progress-circular indeterminate color="white"></v-progress-circular>
887 </div> 887 </div>
888 <v-snackbar 888 <v-snackbar
889 :timeout="timeout" 889 :timeout="timeout"
890 :top="y === 'top'" 890 :top="y === 'top'"
891 :right="x === 'right'" 891 :right="x === 'right'"
892 :vertical="mode === 'vertical'" 892 :vertical="mode === 'vertical'"
893 v-model="snackbar" 893 v-model="snackbar"
894 :color="color" 894 :color="color"
895 >{{ text }}</v-snackbar> 895 >{{ text }}</v-snackbar>
896 </v-container> 896 </v-container>
897 </template> 897 </template>
898 <script> 898 <script>
899 import http from "@/Services/http.js"; 899 import http from "@/Services/http.js";
900 import Util from "@/util"; 900 import Util from "@/util";
901 901
902 export default { 902 export default {
903 data: () => ({ 903 data: () => ({
904 y: "top", 904 y: "top",
905 x: "right", 905 x: "right",
906 mode: "", 906 mode: "",
907 timeout: 3000, 907 timeout: 3000,
908 text: "", 908 text: "",
909 search: "", 909 search: "",
910 color: "", 910 color: "",
911 snackbar: false, 911 snackbar: false,
912 loading: false, 912 loading: false,
913 showLoader: false, 913 showLoader: false,
914 dialog: false, 914 dialog: false,
915 show: true, 915 show: true,
916 showSearch: false, 916 showSearch: false,
917 dialogAddLecture: false, 917 dialogAddLecture: false,
918 dialogUpdateLectures: false, 918 dialogUpdateLectures: false,
919 dialogSchedule: false, 919 dialogSchedule: false,
920 dialog1: false, 920 dialog1: false,
921 valid: true, 921 valid: true,
922 addTimeTableDialog: false, 922 addTimeTableDialog: false,
923 validAddDay: true, 923 validAddDay: true,
924 loadingFindData: false, 924 loadingFindData: false,
925 addclass: [], 925 addclass: [],
926 addSection: [], 926 addSection: [],
927 subjectList: [], 927 subjectList: [],
928 addTeachers: [], 928 addTeachers: [],
929 gender: ["Male", "Female"], 929 gender: ["Male", "Female"],
930 pagination: { 930 pagination: {
931 rowsPerPage: 15 931 rowsPerPage: 15
932 }, 932 },
933 imageData: {}, 933 imageData: {},
934 imageName: "", 934 imageName: "",
935 imageUrl: "", 935 imageUrl: "",
936 imageFile: "", 936 imageFile: "",
937 timeInRules: [v => !!v || "Time In is required"], 937 timeInRules: [v => !!v || "Time In is required"],
938 timeOutRules: [v => !!v || "Time Out is required"], 938 timeOutRules: [v => !!v || "Time Out is required"],
939 lectureRules: [v => !!v || "Lecture No is required"], 939 lectureRules: [v => !!v || "Lecture No is required"],
940 subjectNameRules: [v => !!v || "Subject Name is required"], 940 subjectNameRules: [v => !!v || "Subject Name is required"],
941 classRules: [v => !!v || "Class Name is required"], 941 classRules: [v => !!v || "Class Name is required"],
942 sectionRules: [v => !!v || "Section Name is required"], 942 sectionRules: [v => !!v || "Section Name is required"],
943 sectionRules: [v => !!v || "Section Name is required"], 943 sectionRules: [v => !!v || "Section Name is required"],
944 teacherRules: [v => !!v || "Teacher Name is required"], 944 teacherRules: [v => !!v || "Teacher Name is required"],
945 selecDayRule: [v => !!v || "Day is required"], 945 selecDayRule: [v => !!v || "Day is required"],
946 dayRules: [v => !!v || "Day is required"], 946 dayRules: [v => !!v || "Day is required"],
947 getParticulerLecture: "", 947 getParticulerLecture: "",
948 headers: [ 948 headers: [
949 { 949 {
950 text: "No", 950 text: "No",
951 align: "", 951 align: "",
952 sortable: false, 952 sortable: false,
953 value: "No" 953 value: "No"
954 }, 954 },
955 { 955 {
956 text: "Class Name", 956 text: "Class Name",
957 value: "classData.classNum", 957 value: "classData.classNum",
958 sortable: false, 958 sortable: false,
959 align: "center" 959 align: "center"
960 }, 960 },
961 { 961 {
962 text: "Section Name", 962 text: "Section Name",
963 value: "sectionData.name", 963 value: "sectionData.name",
964 sortable: false, 964 sortable: false,
965 align: "center" 965 align: "center"
966 }, 966 },
967 { text: "Action", value: "", sortable: false, align: "center" } 967 { text: "Action", value: "", sortable: false, align: "center" }
968 ], 968 ],
969 daysHeaders: [ 969 daysHeaders: [
970 { text: "Day", value: "dayday", sortable: false, align: "center" }, 970 { text: "Day", value: "dayday", sortable: false, align: "center" },
971 { 971 {
972 text: "Subject Name", 972 text: "Subject Name",
973 value: "subjectName", 973 value: "subjectName",
974 sortable: false, 974 sortable: false,
975 align: "center" 975 align: "center"
976 }, 976 },
977 { text: "Time In", value: "timeIn", sortable: false, align: "center" }, 977 { text: "Time In", value: "timeIn", sortable: false, align: "center" },
978 { text: "Time Out", value: "timeOut", sortable: false, align: "center" } 978 { text: "Time Out", value: "timeOut", sortable: false, align: "center" }
979 ], 979 ],
980 addOneDay: [ 980 addOneDay: [
981 "Monday", 981 "Monday",
982 "Tuesday", 982 "Tuesday",
983 "Wednesday", 983 "Wednesday",
984 "Thursday", 984 "Thursday",
985 "Friday", 985 "Friday",
986 "Saturday", 986 "Saturday",
987 "Sunday" 987 "Sunday"
988 ], 988 ],
989 schedule: { 989 schedule: {
990 selectDay: "" 990 selectDay: ""
991 }, 991 },
992 desserts: [], 992 desserts: [],
993 timeTableList: [], 993 timeTableList: [],
994 editedIndex: -1, 994 editedIndex: -1,
995 selectTimeTable: { 995 selectTimeTable: {
996 select: "", 996 select: "",
997 selectSection: "" 997 selectSection: ""
998 }, 998 },
999 timeTable: { 999 timeTable: {
1000 select: "", 1000 select: "",
1001 selectSection: "", 1001 selectSection: "",
1002 selectDay: "", 1002 selectDay: "",
1003 timeIn: null, 1003 timeIn: null,
1004 timeOut: null, 1004 timeOut: null,
1005 subjectName: "", 1005 subjectName: "",
1006 selectTeacher: "" 1006 selectTeacher: ""
1007 }, 1007 },
1008 editedItem: { 1008 editedItem: {
1009 classNum: "", 1009 classNum: "",
1010 selectSection: "" 1010 selectSection: ""
1011 }, 1011 },
1012 addlectures: { 1012 addlectures: {
1013 timeIn: null, 1013 timeIn: null,
1014 timeOut: null, 1014 timeOut: null,
1015 subjectName: "", 1015 subjectName: "",
1016 teacherId: "", 1016 teacherId: "",
1017 scheduleId: "", 1017 scheduleId: "",
1018 timeTableId: "", 1018 timeTableId: "",
1019 select: "" 1019 select: ""
1020 }, 1020 },
1021 updateLectures: { 1021 updateLectures: {
1022 timeIn: null, 1022 timeIn: null,
1023 timeOut: null, 1023 timeOut: null,
1024 subjectName: "", 1024 subjectName: "",
1025 teacherId: "", 1025 teacherId: "",
1026 select: "" 1026 select: ""
1027 }, 1027 },
1028 updateLecturesId: { 1028 updateLecturesId: {
1029 lectureId: "", 1029 lectureId: "",
1030 scheduleId: "" 1030 scheduleId: ""
1031 }, 1031 },
1032 menu1: false, 1032 menu1: false,
1033 menu2: false, 1033 menu2: false,
1034 menu3: false, 1034 menu3: false,
1035 menu4: false, 1035 menu4: false,
1036 menu5: false, 1036 menu5: false,
1037 menu6: false, 1037 menu6: false,
1038 scheduleDayId: "" 1038 scheduleDayId: ""
1039 }), 1039 }),
1040 methods: { 1040 methods: {
1041 findTimeTable() { 1041 findTimeTable() {
1042 this.loadingFindData = true; 1042 this.loadingFindData = true;
1043 http() 1043 http()
1044 .get("/getParticularClassTimeTable", { 1044 .get("/getParticularClassTimeTable", {
1045 params: { 1045 params: {
1046 sectionId: this.selectTimeTable.selectSection, 1046 sectionId: this.selectTimeTable.selectSection,
1047 classId: this.selectTimeTable.select 1047 classId: this.selectTimeTable.select
1048 } 1048 }
1049 }) 1049 })
1050 .then(response => { 1050 .then(response => {
1051 this.desserts = response.data.data; 1051 this.desserts = response.data.data;
1052 this.loadingFindData = false; 1052 this.loadingFindData = false;
1053 }) 1053 })
1054 .catch(error => { 1054 .catch(error => {
1055 this.loadingFindData = false; 1055 this.loadingFindData = false;
1056 this.snackbar = true; 1056 this.snackbar = true;
1057 this.text = error.response.data.message; 1057 this.text = error.response.data.message;
1058 this.text = error.response.data.statusText; 1058 this.text = error.response.data.statusText;
1059 }); 1059 });
1060 }, 1060 },
1061 getSections(_id) { 1061 getSections(_id) {
1062 var token = this.$store.state.token; 1062 var token = this.$store.state.token;
1063 http() 1063 http()
1064 .get( 1064 .get(
1065 "/getSectionsList", 1065 "/getSectionsList",
1066 { params: { classId: _id } }, 1066 { params: { classId: _id } },
1067 { 1067 {
1068 headers: { Authorization: "Bearer " + token } 1068 headers: { Authorization: "Bearer " + token }
1069 } 1069 }
1070 ) 1070 )
1071 .then(response => { 1071 .then(response => {
1072 this.addSection = response.data.data; 1072 this.addSection = response.data.data;
1073 }) 1073 })
1074 .catch(err => { 1074 .catch(err => {
1075 // console.log("err====>", err); 1075 // console.log("err====>", err);
1076 }); 1076 });
1077 }, 1077 },
1078 getClassSubject(_id) { 1078 getClassSubject(_id) {
1079 this.showLoader = true; 1079 this.showLoader = true;
1080 // this.classId = this.classId; 1080 // this.classId = this.classId;
1081 http() 1081 http()
1082 .get( 1082 .get(
1083 "/getParticularClass", 1083 "/getParticularClass",
1084 { params: { classId: _id } }, 1084 { params: { classId: _id } },
1085 { 1085 {
1086 headers: { Authorization: "Bearer " + this.token } 1086 headers: { Authorization: "Bearer " + this.token }
1087 } 1087 }
1088 ) 1088 )
1089 .then(response => { 1089 .then(response => {
1090 this.subjectList = response.data.data; 1090 this.subjectList = response.data.data;
1091 this.showLoader = false; 1091 this.showLoader = false;
1092 }) 1092 })
1093 .catch(err => { 1093 .catch(err => {
1094 this.showLoader = false; 1094 this.showLoader = false;
1095 }); 1095 });
1096 }, 1096 },
1097 getTimeTable(item) { 1097 getTimeTable(item) {
1098 this.showLoader = true; 1098 this.showLoader = true;
1099 this.getParticulerLecture = item._id; 1099 this.getParticulerLecture = item._id;
1100 this.getTimeTableDayData(); 1100 this.getTimeTableDayData();
1101 }, 1101 },
1102 getTimeTableDayData() { 1102 getTimeTableDayData() {
1103 var token = this.$store.state.token; 1103 var token = this.$store.state.token;
1104 http() 1104 http()
1105 .get( 1105 .get(
1106 "/getParticularTimeTable", 1106 "/getParticularTimeTable",
1107 { params: { timeTableId: this.getParticulerLecture } }, 1107 { params: { timeTableId: this.getParticulerLecture } },
1108 { 1108 {
1109 headers: { Authorization: "Bearer " + token } 1109 headers: { Authorization: "Bearer " + token }
1110 } 1110 }
1111 ) 1111 )
1112 .then(response => { 1112 .then(response => {
1113 this.timeTableList = response.data.data; 1113 this.timeTableList = response.data.data;
1114 this.showLoader = false; 1114 this.showLoader = false;
1115 }) 1115 })
1116 .catch(err => { 1116 .catch(err => {
1117 this.showLoader = false; 1117 this.showLoader = false;
1118 // console.log("err====>", err); 1118 // console.log("err====>", err);
1119 }); 1119 });
1120 }, 1120 },
1121 pickFile() { 1121 pickFile() {
1122 this.$refs.image.click(); 1122 this.$refs.image.click();
1123 }, 1123 },
1124 1124
1125 onFilePicked(e) { 1125 onFilePicked(e) {
1126 const files = e.target.files; 1126 const files = e.target.files;
1127 this.imageData.upload = e.target.files[0]; 1127 this.imageData.upload = e.target.files[0];
1128 if (files[0] !== undefined) { 1128 if (files[0] !== undefined) {
1129 this.imageName = files[0].name; 1129 this.imageName = files[0].name;
1130 if (this.imageName.lastIndexOf(".") <= 0) { 1130 if (this.imageName.lastIndexOf(".") <= 0) {
1131 return; 1131 return;
1132 } 1132 }
1133 const fr = new FileReader(); 1133 const fr = new FileReader();
1134 fr.readAsDataURL(files[0]); 1134 fr.readAsDataURL(files[0]);
1135 fr.addEventListener("load", () => { 1135 fr.addEventListener("load", () => {
1136 this.imageUrl = fr.result; 1136 this.imageUrl = fr.result;
1137 this.imageFile = files[0]; // this is an image file that can be sent to server... 1137 this.imageFile = files[0]; // this is an image file that can be sent to server...
1138 this.imageData.imageUrl = URL.createObjectURL(this.imageFile); 1138 this.imageData.imageUrl = URL.createObjectURL(this.imageFile);
1139 }); 1139 });
1140 } else { 1140 } else {
1141 this.imageName = ""; 1141 this.imageName = "";
1142 this.imageFile = ""; 1142 this.imageFile = "";
1143 this.imageUrl = ""; 1143 this.imageUrl = "";
1144 } 1144 }
1145 }, 1145 },
1146 // getTimeTableList() { 1146 // getTimeTableList() {
1147 // this.showLoader = true; 1147 // this.showLoader = true;
1148 // var token = this.$store.state.token; 1148 // var token = this.$store.state.token;
1149 // http() 1149 // http()
1150 // .get("/getTimeTablesList", { 1150 // .get("/getTimeTablesList", {
1151 // headers: { Authorization: "Bearer " + token } 1151 // headers: { Authorization: "Bearer " + token }
1152 // }) 1152 // })
1153 // .then(response => { 1153 // .then(response => {
1154 // this.desserts = response.data.data; 1154 // this.desserts = response.data.data;
1155 // this.showLoader = false; 1155 // this.showLoader = false;
1156 // // console.log("getTimeTableList=====>", response.data.data); 1156 // // console.log("getTimeTableList=====>", response.data.data);
1157 // }) 1157 // })
1158 // .catch(err => { 1158 // .catch(err => {
1159 // // console.log("err====>", err); 1159 // // console.log("err====>", err);
1160 // this.showLoader = false; 1160 // this.showLoader = false;
1161 // this.$router.replace({ path: "/" }); 1161 // this.$router.replace({ path: "/" });
1162 // }); 1162 // });
1163 // }, 1163 // },
1164 editItem(item) { 1164 editItem(item) {
1165 this.editedIndex = this.desserts.indexOf(item); 1165 this.editedIndex = this.desserts.indexOf(item);
1166 this.editedItem = Object.assign({}, item); 1166 this.editedItem = Object.assign({}, item);
1167 this.dialog = true; 1167 this.dialog = true;
1168 }, 1168 },
1169 updateTimeTable(timeToUpdate, classToUpdate, scheduleId) { 1169 updateTimeTable(timeToUpdate, classToUpdate, scheduleId) {
1170 this.updateLecturesId.scheduleId = scheduleId; 1170 this.updateLecturesId.scheduleId = scheduleId;
1171 this.updateLecturesId.lectureId = timeToUpdate._id; 1171 this.updateLecturesId.lectureId = timeToUpdate._id;
1172 this.updateLectures = timeToUpdate; 1172 this.updateLectures = timeToUpdate;
1173 this.dialogUpdateLectures = true; 1173 this.dialogUpdateLectures = true;
1174 }, 1174 },
1175 addLecture(scheduleId, timeTableId) { 1175 addLecture(scheduleId, timeTableId) {
1176 this.addlectures.scheduleId = scheduleId; 1176 this.addlectures.scheduleId = scheduleId;
1177 this.addlectures.timeTableId = timeTableId; 1177 this.addlectures.timeTableId = timeTableId;
1178 this.dialogAddLecture = true; 1178 this.dialogAddLecture = true;
1179 }, 1179 },
1180 AddLecture() { 1180 AddLecture() {
1181 if (this.$refs.lectureForm.validate()) { 1181 if (this.$refs.lectureForm.validate()) {
1182 http() 1182 http()
1183 .post("/addLecture", this.addlectures) 1183 .post("/addLecture", this.addlectures)
1184 .then(response => { 1184 .then(response => {
1185 this.snackbar = true; 1185 this.snackbar = true;
1186 this.text = "New Add Lecture successfully"; 1186 this.text = "New Add Lecture successfully";
1187 var token = this.$store.state.token; 1187 var token = this.$store.state.token;
1188 http() 1188 http()
1189 .get( 1189 .get(
1190 "/getParticularTimeTable", 1190 "/getParticularTimeTable",
1191 { params: { timeTableId: this.getParticulerLecture } }, 1191 { params: { timeTableId: this.getParticulerLecture } },
1192 { 1192 {
1193 headers: { Authorization: "Bearer " + token } 1193 headers: { Authorization: "Bearer " + token }
1194 } 1194 }
1195 ) 1195 )
1196 .then(response => { 1196 .then(response => {
1197 this.timeTableList = response.data.data; 1197 this.timeTableList = response.data.data;
1198 this.snackbar = true; 1198 this.snackbar = true;
1199 this.text = response.data.message; 1199 this.text = response.data.message;
1200 this.color = "green"; 1200 this.color = "green";
1201 this.showLoader = false; 1201 this.showLoader = false;
1202 }) 1202 })
1203 .catch(err => { 1203 .catch(err => {
1204 this.showLoader = false; 1204 this.showLoader = false;
1205 // console.log("err====>", err); 1205 // console.log("err====>", err);
1206 this.snackbar = true; 1206 this.snackbar = true;
1207 this.color = "error"; 1207 this.color = "error";
1208 this.text = error.response.data.message; 1208 this.text = error.response.data.message;
1209 }); 1209 });
1210 this.closedialogLecture(); 1210 this.closedialogLecture();
1211 this.clearLeactureData(); 1211 this.clearLeactureData();
1212 }) 1212 })
1213 .catch(error => { 1213 .catch(error => {
1214 this.snackbar = true; 1214 this.snackbar = true;
1215 this.text = error.response.data.message; 1215 this.text = error.response.data.message;
1216 this.text = error.response.data.statusText; 1216 this.text = error.response.data.statusText;
1217 }); 1217 });
1218 } 1218 }
1219 }, 1219 },
1220 updateParticularTable() { 1220 updateParticularTable() {
1221 let EditLecture = { 1221 let EditLecture = {
1222 lectureId: this.updateLecturesId.lectureId, 1222 lectureId: this.updateLecturesId.lectureId,
1223 scheduleId: this.updateLecturesId.scheduleId, 1223 scheduleId: this.updateLecturesId.scheduleId,
1224 updatedLecture: { 1224 updatedLecture: {
1225 timeIn: this.updateLectures.timeIn, 1225 timeIn: this.updateLectures.timeIn,
1226 timeOut: this.updateLectures.timeOut, 1226 timeOut: this.updateLectures.timeOut,
1227 subjectName: this.updateLectures.subjectName, 1227 subjectName: this.updateLectures.subjectName,
1228 teacherId: this.updateLectures.teacherId 1228 teacherId: this.updateLectures.teacherId
1229 } 1229 }
1230 }; 1230 };
1231 http() 1231 http()
1232 .put("/updateLecture", EditLecture) 1232 .put("/updateLecture", EditLecture)
1233 .then(response => { 1233 .then(response => {
1234 console.log("updateLecture", EditLecture); 1234 console.log("updateLecture", EditLecture);
1235 this.snackbar = true; 1235 this.snackbar = true;
1236 this.text = response.data.message; 1236 this.text = response.data.message;
1237 this.color = "green"; 1237 this.color = "green";
1238 this.closeUpdateLectures(); 1238 this.closeUpdateLectures();
1239 }) 1239 })
1240 .catch(error => { 1240 .catch(error => {
1241 // console.log(error); 1241 // console.log(error);
1242 1242
1243 this.snackbar = true; 1243 this.snackbar = true;
1244 this.color = "error"; 1244 this.color = "error";
1245 this.text = error.response.data.message; 1245 this.text = error.response.data.message;
1246 if (error.response.data.statusText) { 1246 if (error.response.data.statusText) {
1247 this.text = error.response.data.statusText; 1247 this.text = error.response.data.statusText;
1248 } 1248 }
1249 }); 1249 });
1250 }, 1250 },
1251 deleteItem(item) { 1251 deleteItem(item) {
1252 let deleteTimeTable = { 1252 let deleteTimeTable = {
1253 timeTableId: item._id 1253 timeTableId: item._id
1254 }; 1254 };
1255 http() 1255 http()
1256 .delete( 1256 .delete(
1257 "/deleteTimeTable", 1257 "/deleteTimeTable",
1258 confirm("Are you sure you want to delete this?") && { 1258 confirm("Are you sure you want to delete this?") && {
1259 params: deleteTimeTable 1259 params: deleteTimeTable
1260 } 1260 }
1261 ) 1261 )
1262 .then(response => { 1262 .then(response => {
1263 // console.log("deleteUers",deleteTimeTable) 1263 // console.log("deleteUers",deleteTimeTable)
1264 this.snackbar = true; 1264 this.snackbar = true;
1265 this.text = response.data.message; 1265 this.text = response.data.message;
1266 this.color = "green"; 1266 this.color = "green";
1267 this.findTimeTable(); 1267 this.findTimeTable();
1268 }) 1268 })
1269 .catch(error => { 1269 .catch(error => {
1270 // console.log(error); 1270 // console.log(error);
1271 }); 1271 });
1272 }, 1272 },
1273 close() { 1273 close() {
1274 this.dialog = false; 1274 this.dialog = false;
1275 }, 1275 },
1276 close1() { 1276 close1() {
1277 this.dialog1 = false; 1277 this.dialog1 = false;
1278 }, 1278 },
1279 closedialogLecture() { 1279 closedialogLecture() {
1280 this.dialogAddLecture = false; 1280 this.dialogAddLecture = false;
1281 }, 1281 },
1282 closeUpdateLectures() { 1282 closeUpdateLectures() {
1283 this.dialogUpdateLectures = false; 1283 this.dialogUpdateLectures = false;
1284 }, 1284 },
1285 submit() { 1285 submit() {
1286 if (this.$refs.form.validate()) { 1286 if (this.$refs.form.validate()) {
1287 let imageData = new FormData(); 1287 let imageData = new FormData();
1288 imageData.append("upload", this.imageFile); 1288 imageData.append("upload", this.imageFile);
1289 let addTimeTable = { 1289 let addTimeTable = {
1290 sectionId: this.timeTable.selectSection, 1290 sectionId: this.timeTable.selectSection,
1291 classId: this.timeTable.select, 1291 classId: this.timeTable.select,
1292 schedule: [ 1292 schedule: [
1293 { 1293 {
1294 day: this.timeTable.selectDay, 1294 day: this.timeTable.selectDay,
1295 lectures: [ 1295 lectures: [
1296 { 1296 {
1297 timeIn: this.timeTable.timeIn, 1297 timeIn: this.timeTable.timeIn,
1298 timeOut: this.timeTable.timeOut, 1298 timeOut: this.timeTable.timeOut,
1299 subjectName: this.timeTable.subjectName, 1299 subjectName: this.timeTable.subjectName,
1300 teacherId: this.timeTable.selectTeacher 1300 teacherId: this.timeTable.selectTeacher
1301 } 1301 }
1302 ] 1302 ]
1303 } 1303 }
1304 ] 1304 ]
1305 }; 1305 };
1306 this.loading = true; 1306 this.loading = true;
1307 http() 1307 http()
1308 .post("/createTimeTable", addTimeTable) 1308 .post("/createTimeTable", addTimeTable)
1309 .then(response => { 1309 .then(response => {
1310 // console.log("addTimeTable=====>", addTimeTable); 1310 // console.log("addTimeTable=====>", addTimeTable);
1311 if ((this.snackbar = true)) { 1311 if ((this.snackbar = true)) {
1312 this.text = "New Time Table added successfully"; 1312 this.text = "New Time Table added successfully";
1313 } 1313 }
1314 this.color = "green"; 1314 this.color = "green";
1315 this.clear(); 1315 this.clear();
1316 this.addTimeTableDialog = false; 1316 this.addTimeTableDialog = false;
1317 this.loading = false; 1317 this.loading = false;
1318 }) 1318 })
1319 .catch(error => { 1319 .catch(error => {
1320 // console.log(error); 1320 // console.log(error);
1321 if ((this.snackbar = true)) { 1321 if ((this.snackbar = true)) {
1322 this.text = error.response.data.message; 1322 this.text = error.response.data.message;
1323 } 1323 }
1324 this.loading = false; 1324 this.loading = false;
1325 }); 1325 });
1326 } 1326 }
1327 }, 1327 },
1328 clear() { 1328 clear() {
1329 this.$refs.form.reset(); 1329 this.$refs.form.reset();
1330 }, 1330 },
1331 clearLeactureData() { 1331 clearLeactureData() {
1332 this.$refs.lectureForm.reset(); 1332 this.$refs.lectureForm.reset();
1333 }, 1333 },
1334 save() { 1334 save() {
1335 let imageData = new FormData(); 1335 let imageData = new FormData();
1336 imageData.append("upload", this.imageFile); 1336 imageData.append("upload", this.imageFile);
1337 // console.log(imageData); 1337 // console.log(imageData);
1338 let editTimeTable = { 1338 let editTimeTable = {
1339 timeTableId: this.editedItem._id, 1339 timeTableId: this.editedItem._id,
1340 classId: this.editedItem.classNum, 1340 classId: this.editedItem.classNum,
1341 sectionId: this.editedItem.selectSection 1341 sectionId: this.editedItem.selectSection
1342 // imageData 1342 // imageData
1343 }; 1343 };
1344 http() 1344 http()
1345 .put("/updateTimeTable", editTimeTable) 1345 .put("/updateTimeTable", editTimeTable)
1346 .then(response => { 1346 .then(response => {
1347 console.log("editTimeTable", editTimeTable); 1347 console.log("editTimeTable", editTimeTable);
1348 if ((this.snackbar = true)) { 1348 if ((this.snackbar = true)) {
1349 this.text = "Successfully Edit Existing Time Table"; 1349 this.text = "Successfully Edit Existing Time Table";
1350 } 1350 }
1351 this.findTimeTable(); 1351 this.findTimeTable();
1352 }) 1352 })
1353 .catch(error => { 1353 .catch(error => {
1354 // console.log(error); 1354 // console.log(error);
1355 if ((this.snackbar = true)) { 1355 if ((this.snackbar = true)) {
1356 this.text = error.response.data.message; 1356 this.text = error.response.data.message;
1357 } 1357 }
1358 }); 1358 });
1359 this.close(); 1359 this.close();
1360 }, 1360 },
1361 deleteTimeTable(timeToDelete, deleteLectures) { 1361 deleteTimeTable(timeToDelete, deleteLectures) {
1362 let deleteLecture = { 1362 let deleteLecture = {
1363 lectureId: timeToDelete._id 1363 lectureId: timeToDelete._id
1364 }; 1364 };
1365 http() 1365 http()
1366 .delete( 1366 .delete(
1367 "/deleteLecture", 1367 "/deleteLecture",
1368 confirm("Are you sure you want to delete this?") && { 1368 confirm("Are you sure you want to delete this?") && {
1369 params: deleteLecture 1369 params: deleteLecture
1370 } 1370 }
1371 ) 1371 )
1372 .then(response => { 1372 .then(response => {
1373 if ((this.snackbar = true)) { 1373 if ((this.snackbar = true)) {
1374 this.text = "Successfully delete Existing Time Table"; 1374 this.text = "Successfully delete Existing Time Table";
1375 } 1375 }
1376 const index = this.timeTableList.schedule.indexOf(deleteLectures); 1376 const index = this.timeTableList.schedule.indexOf(deleteLectures);
1377 for (let i = 0; i < this.timeTableList.schedule.length; i++) { 1377 for (let i = 0; i < this.timeTableList.schedule.length; i++) {
1378 this.timeTableList.schedule[i].lectures.splice(index, 1); 1378 this.timeTableList.schedule[i].lectures.splice(index, 1);
1379 } 1379 }
1380 }) 1380 })
1381 .catch(error => { 1381 .catch(error => {
1382 console.log(error); 1382 console.log(error);
1383 }); 1383 });
1384 }, 1384 },
1385 addSchedule(id) { 1385 addSchedule(id) {
1386 this.scheduleDayId = id; 1386 this.scheduleDayId = id;
1387 this.dialogSchedule = true; 1387 this.dialogSchedule = true;
1388 }, 1388 },
1389 submitSchedule() { 1389 submitSchedule() {
1390 if (this.$refs.formAddDay.validate()) { 1390 if (this.$refs.formAddDay.validate()) {
1391 let scheduleDayData = { 1391 let scheduleDayData = {
1392 timeTableId: this.scheduleDayId, 1392 timeTableId: this.scheduleDayId,
1393 day: this.schedule.selectDay 1393 day: this.schedule.selectDay
1394 }; 1394 };
1395 http() 1395 http()
1396 .post("/addSchedule", scheduleDayData) 1396 .post("/addSchedule", scheduleDayData)
1397 .then(response => { 1397 .then(response => {
1398 this.snackbar = true; 1398 this.snackbar = true;
1399 this.text = "New Schedule Day added successfully"; 1399 this.text = "New Schedule Day added successfully";
1400 this.dialogSchedule = false; 1400 this.dialogSchedule = false;
1401 this.loading = false; 1401 this.loading = false;
1402 this.getTimeTableDayData(); 1402 this.getTimeTableDayData();
1403 }) 1403 })
1404 .catch(error => { 1404 .catch(error => {
1405 // console.log(error); 1405 // console.log(error);
1406 this.snackbar = true; 1406 this.snackbar = true;
1407 this.text = error.response.data.message; 1407 this.text = error.response.data.message;
1408 this.loading = false; 1408 this.loading = false;
1409 }); 1409 });
1410 } 1410 }
1411 }, 1411 },
1412 displaySearch() { 1412 displaySearch() {
1413 (this.show = false), (this.showSearch = true); 1413 (this.show = false), (this.showSearch = true);
1414 }, 1414 },
1415 closeSearch() { 1415 closeSearch() {
1416 this.showSearch = false; 1416 this.showSearch = false;
1417 this.show = true; 1417 this.show = true;
1418 this.search = ""; 1418 this.search = "";
1419 } 1419 }
1420 }, 1420 },
1421 mounted() { 1421 mounted() {
1422 // this.getTimeTableList(); 1422 // this.getTimeTableList();
1423 var token = this.$store.state.token; 1423 var token = this.$store.state.token;
1424 http() 1424 http()
1425 .get("/getClassesList", { 1425 .get("/getClassesList", {
1426 headers: { Authorization: "Bearer " + token } 1426 headers: { Authorization: "Bearer " + token }
1427 }) 1427 })
1428 .then(response => { 1428 .then(response => {
1429 this.addclass = response.data.data; 1429 this.addclass = response.data.data;
1430 // console.log("getClassesList=====>",this.addclass) 1430 // console.log("getClassesList=====>",this.addclass)
1431 }) 1431 })
1432 .catch(error => { 1432 .catch(error => {
1433 this.showLoader = false; 1433 this.showLoader = false;
1434 if (error.response.status === 401) { 1434 if (error.response.status === 401) {
1435 this.$router.replace({ path: "/" }); 1435 this.$router.replace({ path: "/" });
1436 this.$store.dispatch("setToken", null); 1436 this.$store.dispatch("setToken", null);
1437 this.$store.dispatch("Id", null); 1437 this.$store.dispatch("Id", null);
1438 this.$store.dispatch("Role", null); 1438 this.$store.dispatch("Role", null);
1439 } 1439 }
1440 }); 1440 });
1441 1441
1442 http() 1442 http()
1443 .get("/getTeachersList", { 1443 .get("/getTeachersList", {
1444 headers: { Authorization: "Bearer " + token } 1444 headers: { Authorization: "Bearer " + token }
1445 }) 1445 })
1446 .then(response => { 1446 .then(response => {
1447 this.addTeachers = response.data.data; 1447 this.addTeachers = response.data.data;
1448 // console.log("getClassesList=====>",this.addTeachers) 1448 // console.log("getClassesList=====>",this.addTeachers)
1449 }) 1449 })
1450 .catch(error => { 1450 .catch(error => {
1451 this.showLoader = false; 1451 this.showLoader = false;
1452 if (error.response.status === 401) { 1452 if (error.response.status === 401) {
1453 this.$router.replace({ path: "/" }); 1453 this.$router.replace({ path: "/" });
1454 this.$store.dispatch("setToken", null); 1454 this.$store.dispatch("setToken", null);
1455 this.$store.dispatch("Id", null); 1455 this.$store.dispatch("Id", null);
1456 this.$store.dispatch("Role", null); 1456 this.$store.dispatch("Role", null);
1457 } 1457 }
1458 }); 1458 });
1459 } 1459 }
1460 }; 1460 };
1461 </script> 1461 </script>