Commit c1975052aa11e4941e32b2f817a13f0167627810
1 parent
558365e7b3
Exists in
master
and in
3 other branches
show data in table
Showing
1 changed file
with
11 additions
and
8 deletions
Show diff stats
src/pages/Exam/examSchedule.vue
1 | <template> | 1 | <template> |
2 | <v-container fluid class="body-color"> | 2 | <v-container fluid class="body-color"> |
3 | <!-- ****** Edit Exam Schedule****** --> | 3 | <!-- ****** Edit Exam Schedule****** --> |
4 | <v-dialog v-model="editExamScheduleDialog" max-width="800px" scrollable> | 4 | <v-dialog v-model="editExamScheduleDialog" max-width="800px" scrollable> |
5 | <v-card flat class="card-style pa-2" dark> | 5 | <v-card flat class="card-style pa-2" dark> |
6 | <v-layout> | 6 | <v-layout> |
7 | <v-flex xs12> | 7 | <v-flex xs12> |
8 | <label class="title text-xs-center">Edit Exam Schedule</label> | 8 | <label class="title text-xs-center">Edit Exam Schedule</label> |
9 | <v-icon size="24" class="right" @click="editExamScheduleDialog = false">cancel</v-icon> | 9 | <v-icon size="24" class="right" @click="editExamScheduleDialog = false">cancel</v-icon> |
10 | </v-flex> | 10 | </v-flex> |
11 | </v-layout> | 11 | </v-layout> |
12 | <v-card-text> | 12 | <v-card-text> |
13 | <v-form ref="form"> | 13 | <v-form ref="form"> |
14 | <v-container fluid> | 14 | <v-container fluid> |
15 | <v-layout wrap> | 15 | <v-layout wrap> |
16 | <v-flex xs12 sm12> | 16 | <v-flex xs12 sm12> |
17 | <v-layout> | 17 | <v-layout> |
18 | <v-flex xs4 class="pt-4 subheading"> | 18 | <v-flex xs4 class="pt-4 subheading"> |
19 | <label class="right">Exam Name:</label> | 19 | <label class="right">Exam Name:</label> |
20 | </v-flex> | 20 | </v-flex> |
21 | <v-flex xs7 class="ml-3"> | 21 | <v-flex xs7 class="ml-3"> |
22 | <v-select | 22 | <v-select |
23 | :rules="examRules" | 23 | :rules="examRules" |
24 | :items="examList" | 24 | :items="examList" |
25 | v-model="editedItem.examId" | 25 | v-model="editedItem.examId" |
26 | label="Select your Exam Name" | 26 | label="Select your Exam Name" |
27 | item-text="examName" | 27 | item-text="examName" |
28 | item-value="_id" | 28 | item-value="_id" |
29 | ></v-select> | 29 | ></v-select> |
30 | </v-flex> | 30 | </v-flex> |
31 | </v-layout> | 31 | </v-layout> |
32 | </v-flex> | 32 | </v-flex> |
33 | <v-flex xs12 sm12> | 33 | <v-flex xs12 sm12> |
34 | <v-layout> | 34 | <v-layout> |
35 | <v-flex xs4 class="pt-4 subheading"> | 35 | <v-flex xs4 class="pt-4 subheading"> |
36 | <label class="right">Class:</label> | 36 | <label class="right">Class:</label> |
37 | </v-flex> | 37 | </v-flex> |
38 | <v-flex xs7 class="ml-3"> | 38 | <v-flex xs7 class="ml-3"> |
39 | <v-select | 39 | <v-select |
40 | v-model="editedItem.classId" | 40 | v-model="editedItem.classId" |
41 | label="Select your Class" | 41 | label="Select your Class" |
42 | type="text" | 42 | type="text" |
43 | :items="classList" | 43 | :items="classList" |
44 | item-text="classNum" | 44 | item-text="classNum" |
45 | item-value="_id" | 45 | item-value="_id" |
46 | @change="getSections(editedItem.classId)" | 46 | @change="getSections(editedItem.classId)" |
47 | required | 47 | required |
48 | ></v-select> | 48 | ></v-select> |
49 | </v-flex> | 49 | </v-flex> |
50 | </v-layout> | 50 | </v-layout> |
51 | </v-flex> | 51 | </v-flex> |
52 | <v-flex xs12 sm12> | 52 | <v-flex xs12 sm12> |
53 | <v-layout> | 53 | <v-layout> |
54 | <v-flex xs4 class="pt-4 subheading"> | 54 | <v-flex xs4 class="pt-4 subheading"> |
55 | <label class="right">Section:</label> | 55 | <label class="right">Section:</label> |
56 | </v-flex> | 56 | </v-flex> |
57 | <v-flex xs7 class="ml-3"> | 57 | <v-flex xs7 class="ml-3"> |
58 | <v-select | 58 | <v-select |
59 | :items="addSection" | 59 | :items="addSection" |
60 | label="Select your section" | 60 | label="Select your section" |
61 | v-model="editedItem.sectionId" | 61 | v-model="editedItem.sectionId" |
62 | item-text="name" | 62 | item-text="name" |
63 | item-value="_id" | 63 | item-value="_id" |
64 | name="Select Section" | 64 | name="Select Section" |
65 | required | 65 | required |
66 | ></v-select> | 66 | ></v-select> |
67 | </v-flex> | 67 | </v-flex> |
68 | </v-layout> | 68 | </v-layout> |
69 | </v-flex> | 69 | </v-flex> |
70 | <v-flex xs12 sm12> | 70 | <v-flex xs12 sm12> |
71 | <v-layout> | 71 | <v-layout> |
72 | <v-flex xs4 class="pt-4 subheading"> | 72 | <v-flex xs4 class="pt-4 subheading"> |
73 | <label class="right">Subject Name:</label> | 73 | <label class="right">Subject Name:</label> |
74 | </v-flex> | 74 | </v-flex> |
75 | <v-flex xs7 class="ml-3"> | 75 | <v-flex xs7 class="ml-3"> |
76 | <v-select | 76 | <v-select |
77 | :items="subjects" | 77 | :items="subjects" |
78 | label="Select your Subject Name" | 78 | label="Select your Subject Name" |
79 | v-model="editedItem.subjectName" | 79 | v-model="editedItem.subjectName" |
80 | item-text="subjectName" | 80 | item-text="subjectName" |
81 | item-value="subjectName" | 81 | item-value="subjectName" |
82 | name="Select Section" | 82 | name="Select Section" |
83 | required | 83 | required |
84 | ></v-select> | 84 | ></v-select> |
85 | </v-flex> | 85 | </v-flex> |
86 | </v-layout> | 86 | </v-layout> |
87 | </v-flex> | 87 | </v-flex> |
88 | <v-flex xs12 sm12> | 88 | <v-flex xs12 sm12> |
89 | <v-layout> | 89 | <v-layout> |
90 | <v-flex xs4 class="pt-4 subheading"> | 90 | <v-flex xs4 class="pt-4 subheading"> |
91 | <label class="right">Date:</label> | 91 | <label class="right">Date:</label> |
92 | </v-flex> | 92 | </v-flex> |
93 | <v-flex xs7 class="ml-3"> | 93 | <v-flex xs7 class="ml-3"> |
94 | <v-menu | 94 | <v-menu |
95 | ref="editDate" | 95 | ref="editDate" |
96 | :close-on-content-click="false" | 96 | :close-on-content-click="false" |
97 | v-model="editDate" | 97 | v-model="editDate" |
98 | :nudge-right="40" | 98 | :nudge-right="40" |
99 | :return-value.sync="editDate" | 99 | :return-value.sync="editDate" |
100 | lazy | 100 | lazy |
101 | transition="scale-transition" | 101 | transition="scale-transition" |
102 | offset-y | 102 | offset-y |
103 | full-width | 103 | full-width |
104 | min-width="290px" | 104 | min-width="290px" |
105 | > | 105 | > |
106 | <v-text-field | 106 | <v-text-field |
107 | slot="activator" | 107 | slot="activator" |
108 | v-model="editedItem.date" | 108 | v-model="editedItem.date" |
109 | label="Select Date" | 109 | label="Select Date" |
110 | append-icon="event" | 110 | append-icon="event" |
111 | readonly | 111 | readonly |
112 | ></v-text-field> | 112 | ></v-text-field> |
113 | <v-date-picker v-model="editedItem.date" @input="editDate = false"></v-date-picker> | 113 | <v-date-picker v-model="editedItem.date" @input="editDate = false"></v-date-picker> |
114 | </v-menu> | 114 | </v-menu> |
115 | </v-flex> | 115 | </v-flex> |
116 | </v-layout> | 116 | </v-layout> |
117 | </v-flex> | 117 | </v-flex> |
118 | <v-flex xs12 sm12> | 118 | <v-flex xs12 sm12> |
119 | <v-layout> | 119 | <v-layout> |
120 | <v-flex xs4 class="pt-4 subheading"> | 120 | <v-flex xs4 class="pt-4 subheading"> |
121 | <label class="right">Time From:</label> | 121 | <label class="right">Time From:</label> |
122 | </v-flex> | 122 | </v-flex> |
123 | <v-flex xs7 class="ml-3"> | 123 | <v-flex xs7 class="ml-3"> |
124 | <v-menu | 124 | <v-menu |
125 | ref="menuEdit" | 125 | ref="menuEdit" |
126 | :close-on-content-click="false" | 126 | :close-on-content-click="false" |
127 | v-model="menuEdit" | 127 | v-model="menuEdit" |
128 | :nudge-right="40" | 128 | :nudge-right="40" |
129 | :return-value.sync="editedItem.timeFrom" | 129 | :return-value.sync="editedItem.timeFrom" |
130 | lazy | 130 | lazy |
131 | transition="scale-transition" | 131 | transition="scale-transition" |
132 | offset-y | 132 | offset-y |
133 | full-width | 133 | full-width |
134 | max-width="290px" | 134 | max-width="290px" |
135 | min-width="290px" | 135 | min-width="290px" |
136 | > | 136 | > |
137 | <v-text-field | 137 | <v-text-field |
138 | slot="activator" | 138 | slot="activator" |
139 | v-model="editedItem.timeFrom" | 139 | v-model="editedItem.timeFrom" |
140 | label="Select your time From" | 140 | label="Select your time From" |
141 | append-icon="access_time" | 141 | append-icon="access_time" |
142 | readonly | 142 | readonly |
143 | ></v-text-field> | 143 | ></v-text-field> |
144 | <v-time-picker | 144 | <v-time-picker |
145 | v-model="editedItem.timeIn" | 145 | v-model="editedItem.timeIn" |
146 | @change="$refs.menuEdit.save(editedItem.timeIn)" | 146 | @change="$refs.menuEdit.save(editedItem.timeIn)" |
147 | ></v-time-picker> | 147 | ></v-time-picker> |
148 | </v-menu> | 148 | </v-menu> |
149 | </v-flex> | 149 | </v-flex> |
150 | </v-layout> | 150 | </v-layout> |
151 | </v-flex> | 151 | </v-flex> |
152 | <v-flex xs12 sm12> | 152 | <v-flex xs12 sm12> |
153 | <v-layout> | 153 | <v-layout> |
154 | <v-flex xs4 class="pt-4 subheading"> | 154 | <v-flex xs4 class="pt-4 subheading"> |
155 | <label class="right">Time To:</label> | 155 | <label class="right">Time To:</label> |
156 | </v-flex> | 156 | </v-flex> |
157 | <v-flex xs7 class="ml-3"> | 157 | <v-flex xs7 class="ml-3"> |
158 | <v-menu | 158 | <v-menu |
159 | ref="timeToEdit" | 159 | ref="timeToEdit" |
160 | :close-on-content-click="false" | 160 | :close-on-content-click="false" |
161 | v-model="timeToEdit" | 161 | v-model="timeToEdit" |
162 | :nudge-right="40" | 162 | :nudge-right="40" |
163 | :return-value.sync="editedItem.timeTo" | 163 | :return-value.sync="editedItem.timeTo" |
164 | lazy | 164 | lazy |
165 | transition="scale-transition" | 165 | transition="scale-transition" |
166 | offset-y | 166 | offset-y |
167 | full-width | 167 | full-width |
168 | max-width="290px" | 168 | max-width="290px" |
169 | min-width="290px" | 169 | min-width="290px" |
170 | > | 170 | > |
171 | <v-text-field | 171 | <v-text-field |
172 | slot="activator" | 172 | slot="activator" |
173 | v-model="editedItem.timeTo" | 173 | v-model="editedItem.timeTo" |
174 | label="Select your Time To" | 174 | label="Select your Time To" |
175 | append-icon="access_time" | 175 | append-icon="access_time" |
176 | readonly | 176 | readonly |
177 | ></v-text-field> | 177 | ></v-text-field> |
178 | <v-time-picker | 178 | <v-time-picker |
179 | v-model="editedItem.timeTo" | 179 | v-model="editedItem.timeTo" |
180 | @change="$refs.timeToEdit.save(editedItem.timeTo)" | 180 | @change="$refs.timeToEdit.save(editedItem.timeTo)" |
181 | ></v-time-picker> | 181 | ></v-time-picker> |
182 | </v-menu> | 182 | </v-menu> |
183 | </v-flex> | 183 | </v-flex> |
184 | </v-layout> | 184 | </v-layout> |
185 | </v-flex> | 185 | </v-flex> |
186 | <v-flex xs12 sm12> | 186 | <v-flex xs12 sm12> |
187 | <v-layout> | 187 | <v-layout> |
188 | <v-flex xs4 class="pt-4 subheading"> | 188 | <v-flex xs4 class="pt-4 subheading"> |
189 | <label class="right">Room:</label> | 189 | <label class="right">Room:</label> |
190 | </v-flex> | 190 | </v-flex> |
191 | <v-flex xs7 class="ml-3"> | 191 | <v-flex xs7 class="ml-3"> |
192 | <v-text-field | 192 | <v-text-field |
193 | placeholder="fill your room" | 193 | placeholder="fill your room" |
194 | v-model="editedItem.room" | 194 | v-model="editedItem.room" |
195 | @keyup.enter="save" | 195 | @keyup.enter="save" |
196 | ></v-text-field> | 196 | ></v-text-field> |
197 | </v-flex> | 197 | </v-flex> |
198 | </v-layout> | 198 | </v-layout> |
199 | </v-flex> | 199 | </v-flex> |
200 | </v-layout> | 200 | </v-layout> |
201 | <v-layout> | 201 | <v-layout> |
202 | <v-flex xs12> | 202 | <v-flex xs12> |
203 | <v-card-actions> | 203 | <v-card-actions> |
204 | <v-spacer></v-spacer> | 204 | <v-spacer></v-spacer> |
205 | <v-btn round dark @click="save" class="add-button">Save</v-btn> | 205 | <v-btn round dark @click="save" class="add-button">Save</v-btn> |
206 | </v-card-actions> | 206 | </v-card-actions> |
207 | </v-flex> | 207 | </v-flex> |
208 | </v-layout> | 208 | </v-layout> |
209 | </v-container> | 209 | </v-container> |
210 | </v-form> | 210 | </v-form> |
211 | </v-card-text> | 211 | </v-card-text> |
212 | </v-card> | 212 | </v-card> |
213 | </v-dialog> | 213 | </v-dialog> |
214 | 214 | ||
215 | <!-- ****** PROFILE VIEW Exam Schedule DATA ****** --> | 215 | <!-- ****** PROFILE VIEW Exam Schedule DATA ****** --> |
216 | 216 | ||
217 | <v-dialog v-model="profileExamScheduleDialog" max-width="600px"> | 217 | <v-dialog v-model="profileExamScheduleDialog" max-width="600px"> |
218 | <v-card flat class="card-style pa-3" dark> | 218 | <v-card flat class="card-style pa-3" dark> |
219 | <v-layout> | 219 | <v-layout> |
220 | <v-flex xs12> | 220 | <v-flex xs12> |
221 | <label class="title text-xs-center">View Exam Schedule</label> | 221 | <label class="title text-xs-center">View Exam Schedule</label> |
222 | <v-icon size="24" class="right" @click="profileExamScheduleDialog = false">cancel</v-icon> | 222 | <v-icon size="24" class="right" @click="profileExamScheduleDialog = false">cancel</v-icon> |
223 | </v-flex> | 223 | </v-flex> |
224 | </v-layout> | 224 | </v-layout> |
225 | <v-card-text> | 225 | <v-card-text> |
226 | <v-container grid-list-md> | 226 | <v-container grid-list-md> |
227 | <v-layout wrap> | 227 | <v-layout wrap> |
228 | <v-flex> | 228 | <v-flex> |
229 | <v-layout> | 229 | <v-layout> |
230 | <v-flex xs5 sm6> | 230 | <v-flex xs5 sm6> |
231 | <h5 class="right my-1"> | 231 | <h5 class="right my-1"> |
232 | <b>Exam Name:</b> | 232 | <b>Exam Name:</b> |
233 | </h5> | 233 | </h5> |
234 | </v-flex> | 234 | </v-flex> |
235 | <v-flex sm6 xs8> | 235 | <v-flex sm6 xs8> |
236 | <h5 class="my-1">{{ editedItem.examId}}</h5> | 236 | <h5 class="my-1">{{ editedItem.examId}}</h5> |
237 | </v-flex> | 237 | </v-flex> |
238 | </v-layout> | 238 | </v-layout> |
239 | <v-layout> | 239 | <v-layout> |
240 | <v-flex xs5 sm6> | 240 | <v-flex xs5 sm6> |
241 | <h5 class="right my-1"> | 241 | <h5 class="right my-1"> |
242 | <b>Class:</b> | 242 | <b>Class:</b> |
243 | </h5> | 243 | </h5> |
244 | </v-flex> | 244 | </v-flex> |
245 | <v-flex sm6 xs8> | 245 | <v-flex sm6 xs8> |
246 | <h5 class="my-1">{{ editedItem.classId }}</h5> | 246 | <h5 class="my-1">{{ editedItem.classId }}</h5> |
247 | </v-flex> | 247 | </v-flex> |
248 | </v-layout> | 248 | </v-layout> |
249 | <v-layout> | 249 | <v-layout> |
250 | <v-flex xs5 sm6> | 250 | <v-flex xs5 sm6> |
251 | <h5 class="right my-1"> | 251 | <h5 class="right my-1"> |
252 | <b>Section:</b> | 252 | <b>Section:</b> |
253 | </h5> | 253 | </h5> |
254 | </v-flex> | 254 | </v-flex> |
255 | <v-flex sm6 xs8> | 255 | <v-flex sm6 xs8> |
256 | <h5 class="my-1">{{ editedItem.sectionId }}</h5> | 256 | <h5 class="my-1">{{ editedItem.sectionId }}</h5> |
257 | </v-flex> | 257 | </v-flex> |
258 | </v-layout> | 258 | </v-layout> |
259 | <v-layout> | 259 | <v-layout> |
260 | <v-flex xs5 sm6> | 260 | <v-flex xs5 sm6> |
261 | <h5 class="right my-1"> | 261 | <h5 class="right my-1"> |
262 | <b>Subject Name:</b> | 262 | <b>Subject Name:</b> |
263 | </h5> | 263 | </h5> |
264 | </v-flex> | 264 | </v-flex> |
265 | <v-flex sm6 xs8> | 265 | <v-flex sm6 xs8> |
266 | <h5 class="my-1">{{ editedItem.subjectName }}</h5> | 266 | <h5 class="my-1">{{ editedItem.subjectName }}</h5> |
267 | </v-flex> | 267 | </v-flex> |
268 | </v-layout> | 268 | </v-layout> |
269 | <v-layout> | 269 | <v-layout> |
270 | <v-flex xs5 sm6> | 270 | <v-flex xs5 sm6> |
271 | <h5 class="right my-1"> | 271 | <h5 class="right my-1"> |
272 | <b>Date:</b> | 272 | <b>Date:</b> |
273 | </h5> | 273 | </h5> |
274 | </v-flex> | 274 | </v-flex> |
275 | <v-flex sm6 xs8> | 275 | <v-flex sm6 xs8> |
276 | <h5 class="my-1">{{ dates(editedItem.date) }}</h5> | 276 | <h5 class="my-1">{{ dates(editedItem.date) }}</h5> |
277 | </v-flex> | 277 | </v-flex> |
278 | </v-layout> | 278 | </v-layout> |
279 | <v-layout> | 279 | <v-layout> |
280 | <v-flex xs5 sm6> | 280 | <v-flex xs5 sm6> |
281 | <h5 class="right my-1"> | 281 | <h5 class="right my-1"> |
282 | <b>Time From:</b> | 282 | <b>Time From:</b> |
283 | </h5> | 283 | </h5> |
284 | </v-flex> | 284 | </v-flex> |
285 | <v-flex sm6 xs8> | 285 | <v-flex sm6 xs8> |
286 | <h5 class="my-1">{{ editedItem.timeFrom }}</h5> | 286 | <h5 class="my-1">{{ editedItem.timeFrom }}</h5> |
287 | </v-flex> | 287 | </v-flex> |
288 | </v-layout> | 288 | </v-layout> |
289 | <v-layout> | 289 | <v-layout> |
290 | <v-flex xs5 sm6> | 290 | <v-flex xs5 sm6> |
291 | <h5 class="right my-1"> | 291 | <h5 class="right my-1"> |
292 | <b>Time To:</b> | 292 | <b>Time To:</b> |
293 | </h5> | 293 | </h5> |
294 | </v-flex> | 294 | </v-flex> |
295 | <v-flex sm6 xs8> | 295 | <v-flex sm6 xs8> |
296 | <h5 class="my-1">{{ editedItem.timeTo }}</h5> | 296 | <h5 class="my-1">{{ editedItem.timeTo }}</h5> |
297 | </v-flex> | 297 | </v-flex> |
298 | </v-layout> | 298 | </v-layout> |
299 | <v-layout> | 299 | <v-layout> |
300 | <v-flex xs5 sm6> | 300 | <v-flex xs5 sm6> |
301 | <h5 class="right my-1"> | 301 | <h5 class="right my-1"> |
302 | <b>Room:</b> | 302 | <b>Room:</b> |
303 | </h5> | 303 | </h5> |
304 | </v-flex> | 304 | </v-flex> |
305 | <v-flex sm6 xs8> | 305 | <v-flex sm6 xs8> |
306 | <h5 class="my-1">{{ editedItem.room }}</h5> | 306 | <h5 class="my-1">{{ editedItem.room }}</h5> |
307 | </v-flex> | 307 | </v-flex> |
308 | </v-layout> | 308 | </v-layout> |
309 | </v-flex> | 309 | </v-flex> |
310 | </v-layout> | 310 | </v-layout> |
311 | </v-container> | 311 | </v-container> |
312 | </v-card-text> | 312 | </v-card-text> |
313 | </v-card> | 313 | </v-card> |
314 | </v-dialog> | 314 | </v-dialog> |
315 | <!-- ***** Exam Schedule TABLE****** --> | 315 | <!-- ***** Exam Schedule TABLE****** --> |
316 | <v-toolbar color="transparent" flat> | 316 | <v-toolbar color="transparent" flat> |
317 | <v-btn | 317 | <v-btn |
318 | fab | 318 | fab |
319 | dark | 319 | dark |
320 | class="open-dialog-button hidden-xl-only hidden-md-only hidden-lg-only" | 320 | class="open-dialog-button hidden-xl-only hidden-md-only hidden-lg-only" |
321 | small | 321 | small |
322 | @click="addExamScheduleDialog = true" | 322 | @click="addExamScheduleDialog = true" |
323 | > | 323 | > |
324 | <v-icon dark>add</v-icon> | 324 | <v-icon dark>add</v-icon> |
325 | </v-btn> | 325 | </v-btn> |
326 | <v-btn | 326 | <v-btn |
327 | round | 327 | round |
328 | class="open-dialog-button hidden-sm-only hidden-xs-only" | 328 | class="open-dialog-button hidden-sm-only hidden-xs-only" |
329 | dark | 329 | dark |
330 | @click="addExamScheduleDialog = true" | 330 | @click="addExamScheduleDialog = true" |
331 | > | 331 | > |
332 | <v-icon class="white--text pr-1" size="20">add</v-icon>Add Exam Schedule | 332 | <v-icon class="white--text pr-1" size="20">add</v-icon>Add Exam Schedule |
333 | </v-btn> | 333 | </v-btn> |
334 | <v-spacer></v-spacer> | 334 | <v-spacer></v-spacer> |
335 | <v-flex xs8 sm3 md2 class="mr-3"> | 335 | <v-flex xs8 sm3 md2 class="mr-3"> |
336 | <v-select | 336 | <v-select |
337 | v-model="getScheduleData.classId" | 337 | v-model="getScheduleData.classId" |
338 | label="Select your class" | 338 | label="Select your class" |
339 | type="text" | 339 | type="text" |
340 | :items="classList" | 340 | :items="classList" |
341 | item-text="classNum" | 341 | item-text="classNum" |
342 | item-value="_id" | 342 | item-value="_id" |
343 | @change="getSchedulesList()" | 343 | @change="getSchedulesList()" |
344 | required | 344 | required |
345 | ></v-select> | 345 | ></v-select> |
346 | </v-flex> | 346 | </v-flex> |
347 | <v-card-title class="body-1" v-show="show"> | 347 | <v-card-title class="body-1" v-show="show"> |
348 | <v-btn icon large flat @click="displaySearch"> | 348 | <v-btn icon large flat @click="displaySearch"> |
349 | <v-avatar size="27"> | 349 | <v-avatar size="27"> |
350 | <img src="/static/icon/search.png" alt="icon" /> | 350 | <img src="/static/icon/search.png" alt="icon" /> |
351 | </v-avatar> | 351 | </v-avatar> |
352 | </v-btn> | 352 | </v-btn> |
353 | </v-card-title> | 353 | </v-card-title> |
354 | <v-flex xs8 sm8 md3 lg2 v-show="showSearch"> | 354 | <v-flex xs8 sm8 md3 lg2 v-show="showSearch"> |
355 | <v-layout> | 355 | <v-layout> |
356 | <v-text-field v-model="search" label="Search" prepend-inner-icon="search" color="primary"></v-text-field> | 356 | <v-text-field v-model="search" label="Search" prepend-inner-icon="search" color="primary"></v-text-field> |
357 | <v-icon @click="closeSearch" color="error">close</v-icon> | 357 | <v-icon @click="closeSearch" color="error">close</v-icon> |
358 | </v-layout> | 358 | </v-layout> |
359 | </v-flex> | 359 | </v-flex> |
360 | </v-toolbar> | 360 | </v-toolbar> |
361 | <v-data-table | 361 | <v-data-table |
362 | :headers="headers" | 362 | :headers="headers" |
363 | :items="ScheduleData" | 363 | :items="ScheduleData" |
364 | :pagination.sync="pagination" | 364 | :pagination.sync="pagination" |
365 | :search="search" | 365 | :search="search" |
366 | > | 366 | > |
367 | <template slot="items" slot-scope="props"> | 367 | <template slot="items" slot-scope="props"> |
368 | <tr class="tr"> | 368 | <tr class="tr"> |
369 | <td class="td td-row">{{ props.index + 1}}</td> | 369 | <td class="td td-row">{{ props.index + 1}}</td> |
370 | <td class="td td-row text-xs-center">{{ props.item.examId.examName}}</td> | 370 | <td class="td td-row text-xs-center">{{ props.item.examId.examName}}</td> |
371 | <td class="td td-row text-xs-center">{{ props.item.classId.classNum}}</td> | 371 | <td class="td td-row text-xs-center">{{ props.item.classId.classNum}}</td> |
372 | <td class="td td-row text-xs-center">{{ props.item.sectionId.name }}</td> | ||
373 | <td class="td td-row text-xs-center">{{ props.item.subjectName }}</td> | 372 | <td class="td td-row text-xs-center">{{ props.item.subjectName }}</td> |
374 | <td class="td td-row text-xs-center">{{ dates(props.item.date) }}</td> | 373 | <td class="td td-row text-xs-center">{{ dates(props.item.date) }}</td> |
375 | <td class="td td-row text-xs-center">{{ props.item.timeFrom }} - {{ props.item.timeTo }}</td> | 374 | <td class="td td-row text-xs-center">{{ props.item.timeFrom }} - {{ props.item.timeTo }}</td> |
376 | <td class="td td-row text-xs-center">{{ props.item.room }}</td> | 375 | <td class="td td-row text-xs-center">{{ props.item.room }}</td> |
377 | <td class="td td-row text-xs-center"> | 376 | <td class="td td-row text-xs-center"> |
378 | <span> | 377 | <span> |
379 | <v-tooltip top> | 378 | <v-tooltip top> |
380 | <img | 379 | <img |
381 | slot="activator" | 380 | slot="activator" |
382 | style="cursor:pointer; width:25px; height:25px; " | 381 | style="cursor:pointer; width:25px; height:25px; " |
383 | class="mr-3" | 382 | class="mr-3" |
384 | @click="profile(props.item)" | 383 | @click="profile(props.item)" |
385 | src="/static/icon/view.png" | 384 | src="/static/icon/view.png" |
386 | /> | 385 | /> |
387 | <span>View</span> | 386 | <span>View</span> |
388 | </v-tooltip> | 387 | </v-tooltip> |
389 | <v-tooltip top> | 388 | <v-tooltip top> |
390 | <img | 389 | <img |
391 | slot="activator" | 390 | slot="activator" |
392 | style="cursor:pointer; width:20px; height:18px; " | 391 | style="cursor:pointer; width:20px; height:18px; " |
393 | class="mr-3" | 392 | class="mr-3" |
394 | @click="editItem(props.item)" | 393 | @click="editItem(props.item)" |
395 | src="/static/icon/edit.png" | 394 | src="/static/icon/edit.png" |
396 | /> | 395 | /> |
397 | <span>Edit</span> | 396 | <span>Edit</span> |
398 | </v-tooltip> | 397 | </v-tooltip> |
399 | <v-tooltip top> | 398 | <v-tooltip top> |
400 | <img | 399 | <img |
401 | slot="activator" | 400 | slot="activator" |
402 | style="cursor:pointer; width:20px; height:20px; " | 401 | style="cursor:pointer; width:20px; height:20px; " |
403 | @click="deleteSchedule(props.item)" | 402 | @click="deleteSchedule(props.item)" |
404 | src="/static/icon/delete.png" | 403 | src="/static/icon/delete.png" |
405 | /> | 404 | /> |
406 | <span>Delete</span> | 405 | <span>Delete</span> |
407 | </v-tooltip> | 406 | </v-tooltip> |
408 | </span> | 407 | </span> |
409 | </td> | 408 | </td> |
410 | </tr> | 409 | </tr> |
411 | </template> | 410 | </template> |
412 | <v-alert | 411 | <v-alert |
413 | slot="no-results" | 412 | slot="no-results" |
414 | :value="true" | 413 | :value="true" |
415 | color="error" | 414 | color="error" |
416 | icon="warning" | 415 | icon="warning" |
417 | >Your search for "{{ search }}" found no results.</v-alert> | 416 | >Your search for "{{ search }}" found no results.</v-alert> |
418 | </v-data-table> | 417 | </v-data-table> |
419 | 418 | ||
420 | <!-- ****** ADD Exam Schedule ****** --> | 419 | <!-- ****** ADD Exam Schedule ****** --> |
421 | <v-dialog v-model="addExamScheduleDialog" max-width="600"> | 420 | <v-dialog v-model="addExamScheduleDialog" max-width="600"> |
422 | <v-card flat class="card-style pa-2" dark> | 421 | <v-card flat class="card-style pa-2" dark> |
423 | <v-layout> | 422 | <v-layout> |
424 | <v-flex xs12> | 423 | <v-flex xs12> |
425 | <label class="title text-xs-center">Add Exam</label> | 424 | <label class="title text-xs-center">Add Exam</label> |
426 | <v-icon size="24" class="right" @click="addExamScheduleDialog = false">cancel</v-icon> | 425 | <v-icon size="24" class="right" @click="addExamScheduleDialog = false">cancel</v-icon> |
427 | </v-flex> | 426 | </v-flex> |
428 | </v-layout> | 427 | </v-layout> |
429 | <v-form ref="form" v-model="valid" lazy-validation> | 428 | <v-form ref="form" v-model="valid" lazy-validation> |
430 | <v-container fluid> | 429 | <v-container fluid> |
431 | <v-flex xs12> | 430 | <v-flex xs12> |
432 | <v-layout> | 431 | <v-layout> |
433 | <v-flex xs5 class="pt-4 subheading"> | 432 | <v-flex xs5 class="pt-4 subheading"> |
434 | <label class="right">Exam Name:</label> | 433 | <label class="right">Exam Name:</label> |
435 | </v-flex> | 434 | </v-flex> |
436 | <v-flex xs7 sm7 md6 class="ml-3"> | 435 | <v-flex xs7 sm7 md6 class="ml-3"> |
437 | <v-select | 436 | <v-select |
438 | label="Select your Exam Name" | 437 | label="Select your Exam Name" |
439 | :rules="examRules" | 438 | :rules="examRules" |
440 | :items="examList" | 439 | :items="examList" |
441 | v-model="addSchedule.examId" | 440 | v-model="addSchedule.examId" |
442 | item-text="examName" | 441 | item-text="examName" |
443 | item-value="_id" | 442 | item-value="_id" |
444 | ></v-select> | 443 | ></v-select> |
445 | </v-flex> | 444 | </v-flex> |
446 | </v-layout> | 445 | </v-layout> |
447 | </v-flex> | 446 | </v-flex> |
448 | <v-flex xs12> | 447 | <v-flex xs12> |
449 | <v-layout> | 448 | <v-layout> |
450 | <v-flex xs5 class="pt-4 subheading"> | 449 | <v-flex xs5 class="pt-4 subheading"> |
451 | <label class="right">Class:</label> | 450 | <label class="right">Class:</label> |
452 | </v-flex> | 451 | </v-flex> |
453 | <v-flex xs7 sm7 md6 class="ml-3"> | 452 | <v-flex xs7 sm7 md6 class="ml-3"> |
454 | <v-select | 453 | <v-select |
455 | v-model="addSchedule.classId" | 454 | v-model="addSchedule.classId" |
456 | label="Select your class" | 455 | label="Select your class" |
457 | type="text" | 456 | type="text" |
458 | :items="classList" | 457 | :items="classList" |
459 | item-text="classNum" | 458 | item-text="classNum" |
460 | item-value="_id" | 459 | item-value="_id" |
461 | :rules="classRules" | 460 | :rules="classRules" |
462 | @change="getSections(addSchedule.classId)" | 461 | @change="getSections(addSchedule.classId)" |
463 | required | 462 | required |
464 | ></v-select> | 463 | ></v-select> |
465 | </v-flex> | 464 | </v-flex> |
466 | </v-layout> | 465 | </v-layout> |
467 | </v-flex> | 466 | </v-flex> |
468 | <v-flex xs12> | 467 | <v-flex xs12> |
469 | <v-layout> | 468 | <v-layout> |
470 | <v-flex xs5 class="pt-4 subheading"> | 469 | <v-flex xs5 class="pt-4 subheading"> |
471 | <label class="right">Section:</label> | 470 | <label class="right">Section:</label> |
472 | </v-flex> | 471 | </v-flex> |
473 | <v-flex xs7 sm7 md6 class="ml-3"> | 472 | <v-flex xs7 sm7 md6 class="ml-3"> |
474 | <v-select | 473 | <v-select |
475 | :items="addSection" | 474 | :items="addSection" |
476 | label="Select Section" | 475 | label="Select Section" |
477 | v-model="addSchedule.sectionId" | 476 | v-model="addSchedule.sectionId" |
478 | item-text="name" | 477 | item-text="name" |
479 | item-value="_id" | 478 | item-value="_id" |
480 | name="Select Section" | 479 | name="Select Section" |
481 | :rules="sectionRules" | 480 | :rules="sectionRules" |
482 | required | 481 | required |
483 | ></v-select> | 482 | ></v-select> |
484 | </v-flex> | 483 | </v-flex> |
485 | </v-layout> | 484 | </v-layout> |
486 | </v-flex> | 485 | </v-flex> |
487 | <v-flex xs12> | 486 | <v-flex xs12> |
488 | <v-layout> | 487 | <v-layout> |
489 | <v-flex xs5 class="pt-4 subheading"> | 488 | <v-flex xs5 class="pt-4 subheading"> |
490 | <label class="right">Subject Name:</label> | 489 | <label class="right">Subject Name:</label> |
491 | </v-flex> | 490 | </v-flex> |
492 | <v-flex xs7 sm7 md6 class="ml-3"> | 491 | <v-flex xs7 sm7 md6 class="ml-3"> |
493 | <v-select | 492 | <v-select |
494 | :items="subjects" | 493 | :items="subjects" |
495 | label="Select Subject" | 494 | label="Select Subject" |
496 | v-model="addSchedule.subjectName" | 495 | v-model="addSchedule.subjectName" |
497 | item-text="subjectName" | 496 | item-text="subjectName" |
498 | item-value="subjectName" | 497 | item-value="subjectName" |
499 | name="Select Section" | 498 | name="Select Section" |
500 | :rules="subjectRules" | 499 | :rules="subjectRules" |
501 | required | 500 | required |
502 | ></v-select> | 501 | ></v-select> |
503 | </v-flex> | 502 | </v-flex> |
504 | </v-layout> | 503 | </v-layout> |
505 | </v-flex> | 504 | </v-flex> |
506 | <v-flex xs12> | 505 | <v-flex xs12> |
507 | <v-layout> | 506 | <v-layout> |
508 | <v-flex xs5 class="pt-4 subheading"> | 507 | <v-flex xs5 class="pt-4 subheading"> |
509 | <label class="right">Date:</label> | 508 | <label class="right">Date:</label> |
510 | </v-flex> | 509 | </v-flex> |
511 | <v-flex xs7 sm7 md6 class="ml-3"> | 510 | <v-flex xs7 sm7 md6 class="ml-3"> |
512 | <v-menu | 511 | <v-menu |
513 | ref="menu2" | 512 | ref="menu2" |
514 | :close-on-content-click="false" | 513 | :close-on-content-click="false" |
515 | v-model="menu2" | 514 | v-model="menu2" |
516 | :nudge-right="40" | 515 | :nudge-right="40" |
517 | :return-value.sync="addSchedule.date" | 516 | :return-value.sync="addSchedule.date" |
518 | lazy | 517 | lazy |
519 | transition="scale-transition" | 518 | transition="scale-transition" |
520 | offset-y | 519 | offset-y |
521 | full-width | 520 | full-width |
522 | min-width="290px" | 521 | min-width="290px" |
523 | > | 522 | > |
524 | <v-text-field | 523 | <v-text-field |
525 | slot="activator" | 524 | slot="activator" |
526 | v-model="addSchedule.date" | 525 | v-model="addSchedule.date" |
527 | :rules="examScheduleDateRules" | 526 | :rules="examScheduleDateRules" |
528 | label="Select Date" | 527 | label="Select Date" |
529 | append-icon="event" | 528 | append-icon="event" |
530 | readonly | 529 | readonly |
531 | ></v-text-field> | 530 | ></v-text-field> |
532 | <v-date-picker | 531 | <v-date-picker |
533 | v-model="addSchedule.date" | 532 | v-model="addSchedule.date" |
534 | @input="$refs.menu2.save(addSchedule.date)" | 533 | @input="$refs.menu2.save(addSchedule.date)" |
535 | ></v-date-picker> | 534 | ></v-date-picker> |
536 | </v-menu> | 535 | </v-menu> |
537 | </v-flex> | 536 | </v-flex> |
538 | </v-layout> | 537 | </v-layout> |
539 | </v-flex> | 538 | </v-flex> |
540 | <v-flex xs12> | 539 | <v-flex xs12> |
541 | <v-layout> | 540 | <v-layout> |
542 | <v-flex xs5 class="pt-4 subheading"> | 541 | <v-flex xs5 class="pt-4 subheading"> |
543 | <label class="right">Time From:</label> | 542 | <label class="right">Time From:</label> |
544 | </v-flex> | 543 | </v-flex> |
545 | <v-flex xs7 sm7 md6 class="ml-3"> | 544 | <v-flex xs7 sm7 md6 class="ml-3"> |
546 | <v-menu | 545 | <v-menu |
547 | ref="menuA" | 546 | ref="menuA" |
548 | :close-on-content-click="false" | 547 | :close-on-content-click="false" |
549 | v-model="menuB" | 548 | v-model="menuB" |
550 | :nudge-right="40" | 549 | :nudge-right="40" |
551 | :return-value.sync="addSchedule.timeFrom" | 550 | :return-value.sync="addSchedule.timeFrom" |
552 | lazy | 551 | lazy |
553 | transition="scale-transition" | 552 | transition="scale-transition" |
554 | offset-y | 553 | offset-y |
555 | full-width | 554 | full-width |
556 | max-width="290px" | 555 | max-width="290px" |
557 | min-width="290px" | 556 | min-width="290px" |
558 | > | 557 | > |
559 | <v-text-field | 558 | <v-text-field |
560 | slot="activator" | 559 | slot="activator" |
561 | v-model="addSchedule.timeIn" | 560 | v-model="addSchedule.timeIn" |
562 | label="Select your time From" | 561 | label="Select your time From" |
563 | append-icon="access_time" | 562 | append-icon="access_time" |
564 | :rules="timeInRules" | 563 | :rules="timeInRules" |
565 | readonly | 564 | readonly |
566 | ></v-text-field> | 565 | ></v-text-field> |
567 | <v-time-picker | 566 | <v-time-picker |
568 | v-model="addSchedule.timeIn" | 567 | v-model="addSchedule.timeIn" |
569 | @change="$refs.menuA.save(addSchedule.timeIn)" | 568 | @change="$refs.menuA.save(addSchedule.timeIn)" |
570 | ></v-time-picker> | 569 | ></v-time-picker> |
571 | </v-menu> | 570 | </v-menu> |
572 | </v-flex> | 571 | </v-flex> |
573 | </v-layout> | 572 | </v-layout> |
574 | </v-flex> | 573 | </v-flex> |
575 | <v-flex xs12> | 574 | <v-flex xs12> |
576 | <v-layout> | 575 | <v-layout> |
577 | <v-flex xs5 class="pt-4 subheading"> | 576 | <v-flex xs5 class="pt-4 subheading"> |
578 | <label class="right">Time To:</label> | 577 | <label class="right">Time To:</label> |
579 | </v-flex> | 578 | </v-flex> |
580 | <v-flex xs7 sm7 md6 class="ml-3"> | 579 | <v-flex xs7 sm7 md6 class="ml-3"> |
581 | <v-menu | 580 | <v-menu |
582 | ref="menu" | 581 | ref="menu" |
583 | :close-on-content-click="false" | 582 | :close-on-content-click="false" |
584 | v-model="menu1" | 583 | v-model="menu1" |
585 | :nudge-right="40" | 584 | :nudge-right="40" |
586 | :return-value.sync="addSchedule.timeTo" | 585 | :return-value.sync="addSchedule.timeTo" |
587 | lazy | 586 | lazy |
588 | transition="scale-transition" | 587 | transition="scale-transition" |
589 | offset-y | 588 | offset-y |
590 | full-width | 589 | full-width |
591 | max-width="290px" | 590 | max-width="290px" |
592 | min-width="290px" | 591 | min-width="290px" |
593 | > | 592 | > |
594 | <v-text-field | 593 | <v-text-field |
595 | slot="activator" | 594 | slot="activator" |
596 | v-model="addSchedule.timeTo" | 595 | v-model="addSchedule.timeTo" |
597 | label="Select your Time To" | 596 | label="Select your Time To" |
598 | append-icon="access_time" | 597 | append-icon="access_time" |
599 | :rules="timeOutRules" | 598 | :rules="timeOutRules" |
600 | readonly | 599 | readonly |
601 | ></v-text-field> | 600 | ></v-text-field> |
602 | <v-time-picker | 601 | <v-time-picker |
603 | v-model="addSchedule.timeTo" | 602 | v-model="addSchedule.timeTo" |
604 | @change="$refs.menu.save(addSchedule.timeTo)" | 603 | @change="$refs.menu.save(addSchedule.timeTo)" |
605 | ></v-time-picker> | 604 | ></v-time-picker> |
606 | </v-menu> | 605 | </v-menu> |
607 | </v-flex> | 606 | </v-flex> |
608 | </v-layout> | 607 | </v-layout> |
609 | </v-flex> | 608 | </v-flex> |
610 | <v-flex xs12> | 609 | <v-flex xs12> |
611 | <v-layout> | 610 | <v-layout> |
612 | <v-flex xs5 class="pt-4 subheading"> | 611 | <v-flex xs5 class="pt-4 subheading"> |
613 | <label class="right">Room:</label> | 612 | <label class="right">Room:</label> |
614 | </v-flex> | 613 | </v-flex> |
615 | <v-flex xs7 sm7 md6 class="ml-3"> | 614 | <v-flex xs7 sm7 md6 class="ml-3"> |
616 | <v-text-field | 615 | <v-text-field |
617 | placeholder="fill your room" | 616 | placeholder="fill your room" |
618 | :rules="roomRules" | 617 | :rules="roomRules" |
619 | v-model="addSchedule.room" | 618 | v-model="addSchedule.room" |
620 | @keyup.enter="submit" | 619 | @keyup.enter="submit" |
621 | ></v-text-field> | 620 | ></v-text-field> |
622 | </v-flex> | 621 | </v-flex> |
623 | </v-layout> | 622 | </v-layout> |
624 | </v-flex> | 623 | </v-flex> |
625 | <v-layout> | 624 | <v-layout> |
626 | <v-flex xs12> | 625 | <v-flex xs12> |
627 | <v-card-actions> | 626 | <v-card-actions> |
628 | <v-spacer class="hidden-xs-only"></v-spacer> | 627 | <v-spacer class="hidden-xs-only"></v-spacer> |
629 | <v-btn @click="clear" round dark class="clear-button">clear</v-btn> | 628 | <v-btn @click="clear" round dark class="clear-button">clear</v-btn> |
630 | <v-btn @click="submit" round dark :loading="loading" class="add-button">Add</v-btn> | 629 | <v-btn @click="submit" round dark :loading="loading" class="add-button">Add</v-btn> |
631 | </v-card-actions> | 630 | </v-card-actions> |
632 | </v-flex> | 631 | </v-flex> |
633 | </v-layout> | 632 | </v-layout> |
634 | </v-container> | 633 | </v-container> |
635 | </v-form> | 634 | </v-form> |
636 | </v-card> | 635 | </v-card> |
637 | </v-dialog> | 636 | </v-dialog> |
638 | <v-snackbar | 637 | <v-snackbar |
639 | :timeout="timeout" | 638 | :timeout="timeout" |
640 | :top="y === 'top'" | 639 | :top="y === 'top'" |
641 | :right="x === 'right'" | 640 | :right="x === 'right'" |
642 | :vertical="mode === 'vertical'" | 641 | :vertical="mode === 'vertical'" |
643 | v-model="snackbar" | 642 | v-model="snackbar" |
644 | :color="color" | 643 | :color="color" |
645 | >{{ text }}</v-snackbar> | 644 | >{{ text }}</v-snackbar> |
646 | <div class="loader" v-if="showLoader"> | 645 | <div class="loader" v-if="showLoader"> |
647 | <v-progress-circular indeterminate color="white"></v-progress-circular> | 646 | <v-progress-circular indeterminate color="white"></v-progress-circular> |
648 | </div> | 647 | </div> |
649 | </v-container> | 648 | </v-container> |
650 | </template> | 649 | </template> |
651 | 650 | ||
652 | <script> | 651 | <script> |
653 | import http from "@/Services/http.js"; | 652 | import http from "@/Services/http.js"; |
654 | import moment from "moment"; | 653 | import moment from "moment"; |
655 | 654 | ||
656 | export default { | 655 | export default { |
657 | data: () => ({ | 656 | data: () => ({ |
658 | snackbar: false, | 657 | snackbar: false, |
659 | date: null, | 658 | date: null, |
660 | editDate: false, | 659 | editDate: false, |
661 | menu1: false, | 660 | menu1: false, |
662 | menuB: false, | 661 | menuB: false, |
663 | menu2: false, | 662 | menu2: false, |
664 | menuEdit: false, | 663 | menuEdit: false, |
665 | timeToEdit: false, | 664 | timeToEdit: false, |
666 | show: true, | 665 | show: true, |
667 | showSearch: false, | 666 | showSearch: false, |
668 | addExamScheduleDialog: false, | 667 | addExamScheduleDialog: false, |
669 | color: "", | 668 | color: "", |
670 | y: "top", | 669 | y: "top", |
671 | x: "right", | 670 | x: "right", |
672 | mode: "", | 671 | mode: "", |
673 | timeout: 10000, | 672 | timeout: 10000, |
674 | text: "", | 673 | text: "", |
675 | loading: false, | 674 | loading: false, |
676 | date: null, | 675 | date: null, |
677 | search: "", | 676 | search: "", |
678 | showLoader: false, | 677 | showLoader: false, |
679 | editExamScheduleDialog: false, | 678 | editExamScheduleDialog: false, |
680 | profileExamScheduleDialog: false, | 679 | profileExamScheduleDialog: false, |
681 | valid: true, | 680 | valid: true, |
682 | addSection: [], | 681 | addSection: [], |
683 | pagination: { | 682 | pagination: { |
684 | rowsPerPage: 10 | 683 | rowsPerPage: 10 |
685 | }, | 684 | }, |
686 | examRules: [v => !!v || "Exam Name is required"], | 685 | examRules: [v => !!v || "Exam Name is required"], |
687 | classRules: [v => !!v || "Class Name is required"], | 686 | classRules: [v => !!v || "Class Name is required"], |
688 | sectionRules: [v => !!v || "section is required"], | 687 | sectionRules: [v => !!v || "section is required"], |
689 | subjectRules: [v => !!v || "Subject is required"], | 688 | subjectRules: [v => !!v || "Subject is required"], |
690 | timeInRules: [v => !!v || "Time In is required"], | 689 | timeInRules: [v => !!v || "Time In is required"], |
691 | timeOutRules: [v => !!v || "time Out s is required"], | 690 | timeOutRules: [v => !!v || "time Out s is required"], |
692 | roomRules: [v => !!v || "Room is required"], | 691 | roomRules: [v => !!v || "Room is required"], |
693 | examScheduleDateRules: [v => !!v || "Date is required"], | 692 | examScheduleDateRules: [v => !!v || "Date is required"], |
694 | headers: [ | 693 | headers: [ |
695 | { | 694 | { |
696 | align: "", | 695 | align: "", |
697 | text: "No", | 696 | text: "No", |
698 | sortable: false, | 697 | sortable: false, |
699 | value: "No" | 698 | value: "No" |
700 | }, | 699 | }, |
701 | { | 700 | { |
702 | text: "Exam Name", | 701 | text: "Exam Name", |
703 | vaue: "examId.examName", | 702 | vaue: "examId.examName", |
704 | sortable: false, | 703 | sortable: false, |
705 | align: "center" | 704 | align: "center" |
706 | }, | 705 | }, |
707 | { | 706 | { |
708 | text: "Class", | 707 | text: "Class", |
709 | value: "classId.classNum", | 708 | value: "classId.classNum", |
710 | sortable: false, | 709 | sortable: false, |
711 | align: "center" | 710 | align: "center" |
712 | }, | 711 | }, |
713 | { | 712 | // { |
714 | text: "Section", | 713 | // text: "Section", |
715 | value: "sectionId.name", | 714 | // value: "sectionId.name", |
716 | sortable: false, | 715 | // sortable: false, |
717 | align: "center" | 716 | // align: "center" |
718 | }, | 717 | // }, |
719 | { | 718 | { |
720 | text: "Subject Name", | 719 | text: "Subject Name", |
721 | value: "subjectName", | 720 | value: "subjectName", |
722 | sortable: false, | 721 | sortable: false, |
723 | align: "center" | 722 | align: "center" |
724 | }, | 723 | }, |
725 | { | 724 | { |
726 | text: "Date", | 725 | text: "Date", |
727 | value: "date", | 726 | value: "date", |
728 | sortable: false, | 727 | sortable: false, |
729 | align: "center" | 728 | align: "center" |
730 | }, | 729 | }, |
731 | { | 730 | { |
732 | text: "Time", | 731 | text: "Time", |
733 | value: "timeFrom", | 732 | value: "timeFrom", |
734 | sortable: false, | 733 | sortable: false, |
735 | align: "center" | 734 | align: "center" |
736 | }, | 735 | }, |
737 | { | 736 | { |
738 | text: "Room", | 737 | text: "Room", |
739 | value: "room", | 738 | value: "room", |
740 | sortable: false, | 739 | sortable: false, |
741 | align: "center" | 740 | align: "center" |
742 | }, | 741 | }, |
743 | { text: "Action", value: "", sortable: false, align: "center" } | 742 | { text: "Action", value: "", sortable: false, align: "center" } |
744 | ], | 743 | ], |
745 | classList: [], | 744 | classList: [], |
746 | examList: [], | 745 | examList: [], |
747 | subjects: [], | 746 | subjects: [], |
748 | addSchedule: {}, | 747 | addSchedule: {}, |
749 | editedItem: {}, | 748 | editedItem: { |
749 | sectionId: { | ||
750 | name: "" | ||
751 | } | ||
752 | }, | ||
750 | getScheduleData: {}, | 753 | getScheduleData: {}, |
751 | ScheduleData: [], | 754 | ScheduleData: [], |
752 | token: "" | 755 | token: "" |
753 | }), | 756 | }), |
754 | methods: { | 757 | methods: { |
755 | dates: function(date) { | 758 | dates: function(date) { |
756 | return moment(date).format("MMMM DD, YYYY"); | 759 | return moment(date).format("MMMM DD, YYYY"); |
757 | }, | 760 | }, |
758 | pickFile() { | 761 | pickFile() { |
759 | this.$refs.image.click(); | 762 | this.$refs.image.click(); |
760 | }, | 763 | }, |
761 | getSchedulesList() { | 764 | getSchedulesList() { |
762 | this.showLoader = true; | 765 | this.showLoader = true; |
763 | http() | 766 | http() |
764 | .get("/getSchedulesList", { | 767 | .get("/getSchedulesList", { |
765 | params: { classId: this.getScheduleData.classId }, | 768 | params: { classId: this.getScheduleData.classId }, |
766 | headers: { Authorization: "Bearer " + this.token } | 769 | headers: { Authorization: "Bearer " + this.token } |
767 | }) | 770 | }) |
768 | .then(response => { | 771 | .then(response => { |
769 | this.ScheduleData = response.data.data; | 772 | this.ScheduleData = response.data.data; |
770 | // console.log("this.ScheduleData", this.ScheduleData); | 773 | // console.log("this.ScheduleData", this.ScheduleData); |
771 | this.showLoader = false; | 774 | this.showLoader = false; |
772 | }) | 775 | }) |
773 | .catch(error => { | 776 | .catch(error => { |
774 | // console.log("err====>", err); | 777 | // console.log("err====>", err); |
775 | this.showLoader = false; | 778 | this.showLoader = false; |
776 | this.loadingSearch = false; | 779 | this.loadingSearch = false; |
777 | this.snackbar = true; | 780 | this.snackbar = true; |
778 | this.text = error.response.data.message; | 781 | this.text = error.response.data.message; |
779 | if (error.response.status === 401) { | 782 | if (error.response.status === 401) { |
780 | this.$router.replace({ path: "/" }); | 783 | this.$router.replace({ path: "/" }); |
781 | this.$store.dispatch("setToken", null); | 784 | this.$store.dispatch("setToken", null); |
782 | this.$store.dispatch("Id", null); | 785 | this.$store.dispatch("Id", null); |
783 | } | 786 | } |
784 | }); | 787 | }); |
785 | }, | 788 | }, |
786 | editItem(item) { | 789 | editItem(item) { |
787 | // console.log("item", item); | 790 | // console.log("item", item); |
788 | this.editedIndex = this.ScheduleData.indexOf(item); | 791 | this.editedIndex = this.ScheduleData.indexOf(item); |
789 | this.editedItem = Object.assign({}, item); | 792 | this.editedItem = Object.assign({}, item); |
790 | this.editedItem.examId = this.editedItem.examId._id; | 793 | this.editedItem.examId = this.editedItem.examId._id; |
791 | this.editedItem.classId = this.editedItem.classId._id; | 794 | this.editedItem.classId = this.editedItem.classId._id; |
792 | this.editedItem.sectionId = this.editedItem.sectionId._id; | 795 | this.editedItem.sectionId = this.editedItem.sectionId._id; |
793 | this.editedItem.date = | 796 | this.editedItem.date = |
794 | this.editedItem.date != undefined | 797 | this.editedItem.date != undefined |
795 | ? (this.editedItem.date = this.editedItem.date.substring(0, 10)) | 798 | ? (this.editedItem.date = this.editedItem.date.substring(0, 10)) |
796 | : (this.editedItem.date = ""); | 799 | : (this.editedItem.date = ""); |
797 | this.editExamScheduleDialog = true; | 800 | this.editExamScheduleDialog = true; |
798 | }, | 801 | }, |
799 | profile(item) { | 802 | profile(item) { |
800 | this.editedIndex = this.ScheduleData.indexOf(item); | 803 | this.editedIndex = this.ScheduleData.indexOf(item); |
801 | this.editedItem = Object.assign({}, item); | 804 | this.editedItem = Object.assign({}, item); |
802 | this.editedItem.examId = this.editedItem.examId.examName; | 805 | this.editedItem.examId = this.editedItem.examId.examName; |
803 | this.editedItem.classId = this.editedItem.classId.classNum; | 806 | this.editedItem.classId = this.editedItem.classId.classNum; |
804 | this.editedItem.sectionId = this.editedItem.sectionId.name; | 807 | this.editedItem.sectionId = this.editedItem.sectionId.name; |
805 | this.profileExamScheduleDialog = true; | 808 | this.profileExamScheduleDialog = true; |
806 | }, | 809 | }, |
807 | deleteSchedule(item) { | 810 | deleteSchedule(item) { |
808 | let deleteSchedule = { | 811 | let deleteSchedule = { |
809 | scheduleId: item._id | 812 | scheduleId: item._id |
810 | }; | 813 | }; |
811 | http() | 814 | http() |
812 | .delete( | 815 | .delete( |
813 | "/deleteSchedule", | 816 | "/deleteSchedule", |
814 | confirm("Are you sure you want to Delete this?") && { | 817 | confirm("Are you sure you want to Delete this?") && { |
815 | params: deleteSchedule | 818 | params: deleteSchedule |
816 | } | 819 | } |
817 | ) | 820 | ) |
818 | .then(response => { | 821 | .then(response => { |
819 | this.snackbar = true; | 822 | this.snackbar = true; |
820 | this.text = response.data.message; | 823 | this.text = response.data.message; |
821 | this.color = "green"; | 824 | this.color = "green"; |
822 | this.getSchedulesList(); | 825 | this.getSchedulesList(); |
823 | }) | 826 | }) |
824 | .catch(error => { | 827 | .catch(error => { |
825 | this.snackbar = true; | 828 | this.snackbar = true; |
826 | this.color = "error"; | 829 | this.color = "error"; |
827 | this.text = error.response.data.message; | 830 | this.text = error.response.data.message; |
828 | }); | 831 | }); |
829 | }, | 832 | }, |
830 | close() { | 833 | close() { |
831 | this.dialog = false; | 834 | this.dialog = false; |
832 | }, | 835 | }, |
833 | submit() { | 836 | submit() { |
834 | if (this.$refs.form.validate()) { | 837 | if (this.$refs.form.validate()) { |
835 | this.loading = true; | 838 | this.loading = true; |
836 | http() | 839 | http() |
837 | .post("/createSchedule", this.addSchedule) | 840 | .post("/createSchedule", this.addSchedule) |
838 | .then(response => { | 841 | .then(response => { |
839 | this.snackbar = true; | 842 | this.snackbar = true; |
840 | this.text = response.data.message; | 843 | this.text = response.data.message; |
841 | this.addExamScheduleDialog = false; | 844 | this.addExamScheduleDialog = false; |
842 | this.color = "green"; | 845 | this.color = "green"; |
843 | this.loading = false; | 846 | this.loading = false; |
844 | this.clear(); | 847 | this.clear(); |
845 | }) | 848 | }) |
846 | .catch(error => { | 849 | .catch(error => { |
847 | this.snackbar = true; | 850 | this.snackbar = true; |
848 | this.text = error.response.data.message; | 851 | this.text = error.response.data.message; |
849 | this.color = "red"; | 852 | this.color = "red"; |
850 | this.loading = false; | 853 | this.loading = false; |
851 | }); | 854 | }); |
852 | } | 855 | } |
853 | }, | 856 | }, |
854 | clear() { | 857 | clear() { |
855 | this.$refs.form.reset(); | 858 | this.$refs.form.reset(); |
856 | this.disable = false; | 859 | this.disable = false; |
857 | this.loading = false; | 860 | this.loading = false; |
858 | }, | 861 | }, |
859 | save() { | 862 | save() { |
860 | this.editedItem.scheduleId = this.editedItem._id; | 863 | this.editedItem.scheduleId = this.editedItem._id; |
861 | http() | 864 | http() |
862 | .put("/updateSchedule", this.editedItem) | 865 | .put("/updateSchedule", this.editedItem) |
863 | .then(response => { | 866 | .then(response => { |
864 | this.snackbar = true; | 867 | this.snackbar = true; |
865 | this.text = "Successfully Edit Exam Schedule"; | 868 | this.text = "Successfully Edit Exam Schedule"; |
866 | this.color = "green"; | 869 | this.color = "green"; |
867 | this.getSchedulesList(); | 870 | this.getSchedulesList(); |
868 | this.close(); | 871 | this.close(); |
869 | }) | 872 | }) |
870 | .catch(error => { | 873 | .catch(error => { |
871 | this.snackbar = true; | 874 | this.snackbar = true; |
872 | this.text = error.response.data.message; | 875 | this.text = error.response.data.message; |
873 | this.color = "red"; | 876 | this.color = "red"; |
874 | }); | 877 | }); |
875 | }, | 878 | }, |
876 | getClass() { | 879 | getClass() { |
877 | http() | 880 | http() |
878 | .get("/getClassesList", { | 881 | .get("/getClassesList", { |
879 | headers: { Authorization: "Bearer " + this.token } | 882 | headers: { Authorization: "Bearer " + this.token } |
880 | }) | 883 | }) |
881 | .then(response => { | 884 | .then(response => { |
882 | this.classList = response.data.data; | 885 | this.classList = response.data.data; |
883 | }) | 886 | }) |
884 | .catch(err => { | 887 | .catch(err => { |
885 | // console.log("err====>", err); | 888 | // console.log("err====>", err); |
886 | }); | 889 | }); |
887 | }, | 890 | }, |
888 | getSections(_id) { | 891 | getSections(_id) { |
889 | for (let i = 0; i < this.classList.length; i++) { | 892 | for (let i = 0; i < this.classList.length; i++) { |
890 | if (_id == this.classList[i]._id) { | 893 | if (_id == this.classList[i]._id) { |
891 | this.subjects = this.classList[i].subjects; | 894 | this.subjects = this.classList[i].subjects; |
892 | } | 895 | } |
893 | } | 896 | } |
894 | http() | 897 | http() |
895 | .get( | 898 | .get( |
896 | "/getSectionsList", | 899 | "/getSectionsList", |
897 | { params: { classId: _id } }, | 900 | { params: { classId: _id } }, |
898 | { | 901 | { |
899 | headers: { Authorization: "Bearer " + this.token } | 902 | headers: { Authorization: "Bearer " + this.token } |
900 | } | 903 | } |
901 | ) | 904 | ) |
902 | .then(response => { | 905 | .then(response => { |
903 | this.addSection = response.data.data; | 906 | this.addSection = response.data.data; |
904 | }) | 907 | }) |
905 | .catch(err => { | 908 | .catch(err => { |
906 | }); | 909 | }); |
907 | }, | 910 | }, |
908 | getExamList() { | 911 | getExamList() { |
909 | this.showLoader = true; | 912 | this.showLoader = true; |
910 | this.loadingSearch = true; | 913 | this.loadingSearch = true; |
911 | http() | 914 | http() |
912 | .get("/getExamsList", { | 915 | .get("/getExamsList", { |
913 | headers: { Authorization: "Bearer " + this.token } | 916 | headers: { Authorization: "Bearer " + this.token } |
914 | }) | 917 | }) |
915 | .then(response => { | 918 | .then(response => { |
916 | this.examList = response.data.data; | 919 | this.examList = response.data.data; |
917 | this.showLoader = false; | 920 | this.showLoader = false; |
918 | this.loadingSearch = false; | 921 | this.loadingSearch = false; |
919 | }) | 922 | }) |
920 | .catch(error => { | 923 | .catch(error => { |
921 | this.showLoader = false; | 924 | this.showLoader = false; |
922 | this.loadingSearch = false; | 925 | this.loadingSearch = false; |
923 | this.snackbar = true; | 926 | this.snackbar = true; |
924 | this.text = error.response.data.message; | 927 | this.text = error.response.data.message; |
925 | if (error.response.status === 401) { | 928 | if (error.response.status === 401) { |
926 | this.$router.replace({ path: "/" }); | 929 | this.$router.replace({ path: "/" }); |
927 | this.$store.dispatch("setToken", null); | 930 | this.$store.dispatch("setToken", null); |
928 | this.$store.dispatch("Id", null); | 931 | this.$store.dispatch("Id", null); |
929 | } | 932 | } |
930 | }); | 933 | }); |
931 | }, | 934 | }, |
932 | displaySearch() { | 935 | displaySearch() { |
933 | (this.show = false), (this.showSearch = true); | 936 | (this.show = false), (this.showSearch = true); |
934 | }, | 937 | }, |
935 | closeSearch() { | 938 | closeSearch() { |
936 | this.showSearch = false; | 939 | this.showSearch = false; |
937 | this.show = true; | 940 | this.show = true; |
938 | this.search = ""; | 941 | this.search = ""; |
939 | } | 942 | } |
940 | }, | 943 | }, |
941 | mounted() { | 944 | mounted() { |
942 | this.token = this.$store.state.token; | 945 | this.token = this.$store.state.token; |
943 | this.getClass(); | 946 | this.getClass(); |
944 | this.getExamList(); | 947 | this.getExamList(); |
945 | } | 948 | } |
946 | }; | 949 | }; |