Blame view

src/pages/Dashboard.vue 24.6 KB
93a68cfa1   Jatinder Singh   first commit
1
  <template>
03dcbf0c1   Neeraj Sharma   fix all api and r...
2
  <v-app id="pages-dasboard">
dd4ecae1d   Neeraj Sharma   search very fast ...
3
   <v-toolbar
f7979ec1a   Neeraj Sharma   add seach in heal...
4
5
6
7
      color="grey"
      fixed
      app
    >
dd4ecae1d   Neeraj Sharma   search very fast ...
8
9
    <v-toolbar-title class="ml-0 pl-3">
     <v-toolbar-side-icon @click.stop="handleDrawerToggle" class="hide"></v-toolbar-side-icon>
f7979ec1a   Neeraj Sharma   add seach in heal...
10
      </v-toolbar-title>
e3e2a04c6   Neeraj Sharma   first commit
11
  <!-- ****** SEARCH ALL Teachers ****** -->
dd4ecae1d   Neeraj Sharma   search very fast ...
12
      <v-flex xs7 sm3 class="userSearch">
f7979ec1a   Neeraj Sharma   add seach in heal...
13
14
15
        <v-text-field
          flat
          prepend-icon="search"
e3e2a04c6   Neeraj Sharma   first commit
16
17
          label="Find your Teachers"
          v-model="search"
f7979ec1a   Neeraj Sharma   add seach in heal...
18
          color="black"
e3e2a04c6   Neeraj Sharma   first commit
19
          @change="getTeacherList"
f7979ec1a   Neeraj Sharma   add seach in heal...
20
21
22
23
        >
        </v-text-field>
      </v-flex>
        <v-spacer></v-spacer>
f7979ec1a   Neeraj Sharma   add seach in heal...
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
        <v-menu offset-y origin="center center" :nudge-bottom="10" transition="scale-transition">
       <v-btn icon large flat slot="activator">
            <v-avatar size="40px">
             <img src="/static/icon/user.png"/>
            </v-avatar>
        </v-btn>
          <v-list class="pa-0">
            <v-list-tile v-for="(item,index) in items" :to="!item.href ? { name: item.name } : null" :href="item.href" @click="item.click" ripple="ripple" :disabled="item.disabled" :target="item.target" rel="noopener" :key="index">
               <v-list-tile-action v-if="item.icon">
                <v-icon>{{ item.icon }}</v-icon>
              </v-list-tile-action>
              <v-list-tile-content>
                <v-list-tile-title>{{ item.title }}</v-list-tile-title>
              </v-list-tile-content>
            </v-list-tile>
          </v-list> 
        </v-menu>
    </v-toolbar>
03dcbf0c1   Neeraj Sharma   fix all api and r...
42
43
44
45
46
47
48
    <v-tabs grow slider-color="black">
      <v-tab
        ripple
        @click="activeTab('existing')"
        v-bind:class="{ active: isActive }"
        id="tab"
        class="subheading"
e3e2a04c6   Neeraj Sharma   first commit
49
      >Existing Teachers</v-tab>
03dcbf0c1   Neeraj Sharma   fix all api and r...
50
51
52
53
      <v-tab
        ripple
        @click="activeTab('new')"
        v-bind:class="{ active: newActive }"
e3e2a04c6   Neeraj Sharma   first commit
54
        id="tab1"User
03dcbf0c1   Neeraj Sharma   fix all api and r...
55
        class="subheading"
e3e2a04c6   Neeraj Sharma   first commit
56
57
      >Add New Teachers</v-tab>
  <!-- ****** EDIT Teachers Dtails ****** -->
03dcbf0c1   Neeraj Sharma   fix all api and r...
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
      <v-tab-item>
        <v-snackbar
          :timeout="timeout"
          :top="y === 'top'"
          :right="x === 'right'"
          :vertical="mode === 'vertical'"
          v-model="snackbar"
          color="success"
        >{{ text }}</v-snackbar>
        <v-dialog v-model="dialog" max-width="500px">
          <v-toolbar color="white">
            <v-spacer></v-spacer>
            <v-toolbar-title>Edit Profile</v-toolbar-title>
            <v-spacer></v-spacer>
          </v-toolbar>
          <v-card>
            <v-flex align-center justify-center layout text-xs-center>
              <v-avatar size="50px" style="position:absolute; top:10px; ">
                <img src="/static/icon/user.png">
              </v-avatar>
            </v-flex>
c35a8dafd   Jatinder Singh   minor changes
79
            <v-card-text>
03dcbf0c1   Neeraj Sharma   fix all api and r...
80
81
82
83
84
              <v-container>
                <v-layout wrap justify-center>
                  <v-flex xs12 sm9>
                    <v-form ref="form" v-model="valid" lazy-validation>
                      <v-layout style="position:relative; top:15px;">
0cefd6eff   Neeraj Sharma   add country input...
85
                        <v-flex xs4 class="pt-4 subheading">
5f2dd99ed   Neeraj Sharma   add full name in ...
86
                          <label>Full Name:</label>
03dcbf0c1   Neeraj Sharma   fix all api and r...
87
88
89
90
91
92
93
94
95
96
97
                        </v-flex>
                        <v-flex xs8>
                          <v-text-field
                            v-model="editedItem.name"
                            v-validate="'required'"
                            :rules="nameRules"
                            data-vv-name="Name"
                            required
                          ></v-text-field>
                        </v-flex>
                      </v-layout>
03dcbf0c1   Neeraj Sharma   fix all api and r...
98
99
100
101
102
103
104
105
106
107
108
109
110
111
                      <v-layout>
                        <v-flex xs4 class="pt-4 subheading">
                          <label>Email ID:</label>
                        </v-flex>
                        <v-flex xs8>
                          <v-text-field
                            v-model="editedItem.email"
                            v-validate="'required|email'"
                            :rules="emailRules"
                            data-vv-name="E-mail"
                            required
                          ></v-text-field>
                        </v-flex>
                      </v-layout>
e3e2a04c6   Neeraj Sharma   first commit
112
                       <!-- <v-layout>
03dcbf0c1   Neeraj Sharma   fix all api and r...
113
114
115
116
                         <v-flex xs4 class="pt-4 subheading">
                          <label>Date of Birth:</label>
                        </v-flex>
                        <v-flex xs8>
ac10393a4   Neeraj Sharma   add calender date...
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
                        <v-menu
                           ref="menu1"
                           :close-on-content-click="false"
                           v-model="menu1"
                           :nudge-right="40"
                           lazy
                           transition="scale-transition"
                           offset-y
                           full-width
                           min-width="290px"
                         >
                         <v-text-field
                          slot="activator"
                          v-model="editedItem.dob"
                          placeholder="Select date"
                         ></v-text-field>
                         <v-date-picker
                          ref="picker"
                          v-model="editedItem.dob"
                          :max="new Date().toISOString().substr(0, 10)"
                          min="1950-01-01"
                          @input="menu1 = false"
                          ></v-date-picker>
                          </v-menu>
03dcbf0c1   Neeraj Sharma   fix all api and r...
141
                        </v-flex>
e3e2a04c6   Neeraj Sharma   first commit
142
                      </v-layout> -->
03dcbf0c1   Neeraj Sharma   fix all api and r...
143
144
145
146
147
148
149
150
151
152
153
154
                      <v-card-actions>
                        <v-btn round dark @click.native="close">Cancel</v-btn>
                        <v-spacer></v-spacer>
                        <v-btn round dark @click="save">Save</v-btn>
                      </v-card-actions>
                    </v-form>
                  </v-flex>
                </v-layout>
              </v-container>
            </v-card-text>
          </v-card>
        </v-dialog>
e3e2a04c6   Neeraj Sharma   first commit
155
  <!-- ****** PROFILE VIEW Teachers Details ******  -->
03dcbf0c1   Neeraj Sharma   fix all api and r...
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
        <v-dialog v-model="dialog1" max-width="600px">
          <v-toolbar color="white">
            <v-spacer></v-spacer>
            <v-toolbar-title>Profile</v-toolbar-title>
            <v-spacer></v-spacer>
            <v-icon @click="close1">close</v-icon>
          </v-toolbar>
          <v-card>
            <v-flex align-center justify-center layout text-xs-center>
              <v-avatar size="50px" style="position:absolute; top:20px;">
                <img src="/static/icon/user.png">
              </v-avatar>
            </v-flex>
            <v-card-text>
              <v-container grid-list-md>
                <v-layout wrap>
                  <v-flex><br><br>
                     <v-layout>
                       <v-flex xs5 sm6>
5f2dd99ed   Neeraj Sharma   add full name in ...
175
                       <h5 class="right">Full Name:</h5>
03dcbf0c1   Neeraj Sharma   fix all api and r...
176
177
178
179
180
                      </v-flex>
                      <v-flex sm6 xs8>
                      <h5>{{ editedItem.name }}</h5>
                    </v-flex>
                   </v-layout>
03dcbf0c1   Neeraj Sharma   fix all api and r...
181
182
183
184
185
186
187
188
                    <v-layout>
                       <v-flex xs5 sm6>
                       <h5 class="right">Email:</h5>
                      </v-flex>
                      <v-flex  sm6 xs8>
                       <h5>{{ editedItem.email }}</h5>
                    </v-flex>
                   </v-layout>
e3e2a04c6   Neeraj Sharma   first commit
189
                    <!-- <v-layout>
03dcbf0c1   Neeraj Sharma   fix all api and r...
190
191
192
193
194
195
                       <v-flex xs6 sm6 >
                       <h5 class="right my-3">Date Of Birth:</h5>
                      </v-flex>
                      <v-flex sm6 xs8>
                      <h5 class="my-3">{{ editedItem.dob }}</h5>
                    </v-flex>
e3e2a04c6   Neeraj Sharma   first commit
196
                   </v-layout> -->
03dcbf0c1   Neeraj Sharma   fix all api and r...
197
198
199
200
201
202
                  </v-flex>
                </v-layout>
              </v-container>
            </v-card-text>
          </v-card>
        </v-dialog>
f84ff8f5a   Jatinder Singh   report page changes
203

e3e2a04c6   Neeraj Sharma   first commit
204
        <!-- <v-dialog v-model="dialog2" width="700px">
03dcbf0c1   Neeraj Sharma   fix all api and r...
205
206
207
208
209
210
211
          <v-card>
            <div id="dialog">
              <h4>
                <b>Report</b>
              </h4>
              <h5 id="name">
                <b>Patient Name:</b>
5f2dd99ed   Neeraj Sharma   add full name in ...
212
                {{ editedItem.name }}
03dcbf0c1   Neeraj Sharma   fix all api and r...
213
214
215
216
217
              </h5>
              <h5 id="m">Select Month:</h5>
              <v-btn color="grey darken-3" id="G" v-on:click="component='report-generate'">Generate</v-btn>
              <v-spacer></v-spacer>
              <v-icon id="icon" @click="close2">close</v-icon>
269061695   Jatinder Singh   changes
218

03dcbf0c1   Neeraj Sharma   fix all api and r...
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
              <span id="bt">
                <v-btn
                  color="grey darken-2"
                  v-on:click="component='one-month' , activebtn('existing')"
                  v-bind:class="{ activebtn: isActivebtn }"
                  flat
                >1 month</v-btn>
                <v-btn
                  color="grey darken-2"
                  v-on:click="component='three-month' , activebtn('new')"
                  v-bind:class="{ activebtn: Activebtn1 }"
                  flat
                >3 Month</v-btn>
                <v-btn
                  color="grey darken-2"
                  v-on:click="component='six-month' , activebtn('new1')"
                  v-bind:class="{ activebtn: Activebtn2 }"
                  flat
                >6 Month</v-btn>
                <v-btn
                  color="grey darken-2"
                  v-on:click="component='nine-month' , activebtn('new2')"
                  v-bind:class="{ activebtn: Activebtn3 }"
                  flat
                >9 Month</v-btn>
                <img id="e" @click="mail" src="/static/icon/email1.png">
                <img id="d" @click="download" src="/static/icon/download1.png">
              </span>
              <component v-bind:is="component"></component>
            </div>
          </v-card>
e3e2a04c6   Neeraj Sharma   first commit
250
        </v-dialog> -->
03dcbf0c1   Neeraj Sharma   fix all api and r...
251
252
253
254
255
256
257
258
        <v-snackbar
          :timeout="timeout"
          :top="y === 'top'"
          :right="x === 'right'"
          :vertical="mode === 'vertical'"
          v-model="snackbar"
          color="success"
        >{{ text }}</v-snackbar>
e3e2a04c6   Neeraj Sharma   first commit
259
260
  
  <!-- ****** EXISTING-Teachers Table Data****** -->
03dcbf0c1   Neeraj Sharma   fix all api and r...
261
262
263
264
        <v-data-table 
        :headers="headers" 
        :items="desserts" 
        :pagination.sync="pagination"
e3e2a04c6   Neeraj Sharma   first commit
265
        :search="search"
945cc2d12   Neeraj Sharma   somrthing changes...
266
267
268
269
        >    <!-- </v-content>
       <v-footer class="pa-4" color="grey darken-2">
    
    </v-footer> -->
c35a8dafd   Jatinder Singh   minor changes
270
          <template slot="items" slot-scope="props">
03dcbf0c1   Neeraj Sharma   fix all api and r...
271
272
273
            <td id="td" class="text-xs-center">{{ props.index}}</td>
            <td id="td" class="text-xs-center">{{ props.item.name}}</td>
            <td id="td" class="text-xs-center">{{ props.item.email }}</td>
4413a8d93   Jatinder Singh   changes
274
            <td class="text-xs-center">
03dcbf0c1   Neeraj Sharma   fix all api and r...
275
              <span>
e3e2a04c6   Neeraj Sharma   first commit
276
                <!-- <img
03dcbf0c1   Neeraj Sharma   fix all api and r...
277
278
279
280
                  style="cursor:pointer; height:20px; "
                  class="mr-5"
                  @click="report(props.item)"
                  src="/static/icon/List1.png"
e3e2a04c6   Neeraj Sharma   first commit
281
                > -->
03dcbf0c1   Neeraj Sharma   fix all api and r...
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
                <img
                  style="cursor:pointer; width:25px; height:18px; "
                  class="mr-5"
                  @click="profile(props.item)"
                  src="/static/icon/eye1.png"
                >
                <img
                  style="cursor:pointer; width:20px; height:18px; "
                  class="mr-5"
                  @click="editItem(props.item)"
                  src="/static/icon/edit1.png"
                >
                <img
                  style="cursor:pointer; height:20px; "
                  class="mr-5"
                  @click="deleteItem(props.item)"
                  src="/static/icon/delete1.png"
                >
              </span>
c35a8dafd   Jatinder Singh   minor changes
301
            </td>
c35a8dafd   Jatinder Singh   minor changes
302
          </template>
dd4ecae1d   Neeraj Sharma   search very fast ...
303
304
305
306
307
          <v-alert
            slot="no-results"
            :value="true"
            color="error"
            icon="warning"
e3e2a04c6   Neeraj Sharma   first commit
308
          >Your search for "{{ search }}" found no results.</v-alert>
c35a8dafd   Jatinder Singh   minor changes
309
        </v-data-table>
03dcbf0c1   Neeraj Sharma   fix all api and r...
310
      </v-tab-item>
e3e2a04c6   Neeraj Sharma   first commit
311
  <!-- ****** ADD Teachers  ****** -->
03dcbf0c1   Neeraj Sharma   fix all api and r...
312
      <v-tab-item>
03dcbf0c1   Neeraj Sharma   fix all api and r...
313
        <v-container>
f42c1d9c9   Neeraj Sharma   something change ...
314
315
316
317
318
319
320
321
         <v-snackbar
           :timeout="timeout"
           :top="y === 'top'"
           :right="x === 'right'"
           :vertical="mode === 'vertical'"
           v-model="snackbar"
           color="success"
          >{{ text }}</v-snackbar>
03dcbf0c1   Neeraj Sharma   fix all api and r...
322
323
324
325
326
327
328
329
330
331
332
333
334
        <v-flex xs12 sm8 offset-sm2 class="top">
          <v-card flat>
            <v-container fluid fill-height>
              <v-layout align-center>
                <v-flex xs12>
                  <v-flex offset-xs5>
                    <v-avatar size="55px">
                      <img src="/static/icon/user.png">
                    </v-avatar>
                  </v-flex>
                  <v-form ref="form" v-model="valid" lazy-validation>
                    <v-layout>
                      <v-flex xs4 class="pt-4 subheading">
5f2dd99ed   Neeraj Sharma   add full name in ...
335
                        <label class="right">Full Name:</label>
03dcbf0c1   Neeraj Sharma   fix all api and r...
336
337
338
339
                      </v-flex>
                      <v-flex xs6 class="ml-3">
                        <v-text-field
                          v-model="editedItem.name"
5f2dd99ed   Neeraj Sharma   add full name in ...
340
                          placeholder="fill your full Name"
03dcbf0c1   Neeraj Sharma   fix all api and r...
341
                          name="name"
f42c1d9c9   Neeraj Sharma   something change ...
342
                          type="text"
03dcbf0c1   Neeraj Sharma   fix all api and r...
343
344
345
346
347
                          :rules="nameRules"
                          required
                        ></v-text-field>
                      </v-flex>
                    </v-layout>
e3e2a04c6   Neeraj Sharma   first commit
348
                    <!-- <v-layout>
03dcbf0c1   Neeraj Sharma   fix all api and r...
349
                      <v-flex xs4 class="pt-4 subheading">
0cefd6eff   Neeraj Sharma   add country input...
350
351
352
                        <label class="right">Country:</label>
                      </v-flex>
                      <v-flex xs6  class="ml-3">
a95d2830c   Neeraj Sharma   add country selec...
353
354
355
                          <v-select
                           v-model="editedItem.country"
                           :items="countries"
43af283e0   Neeraj Sharma   fix solved issue ...
356
357
                           label="Select Country"
                           single-line
a95d2830c   Neeraj Sharma   add country selec...
358
                         ></v-select>
0cefd6eff   Neeraj Sharma   add country input...
359
                      </v-flex>
e3e2a04c6   Neeraj Sharma   first commit
360
                    </v-layout> -->
0cefd6eff   Neeraj Sharma   add country input...
361
362
                    <v-layout>
                      <v-flex xs4 class="pt-4 subheading">
03dcbf0c1   Neeraj Sharma   fix all api and r...
363
364
365
366
                        <label class="right">Email ID:</label>
                      </v-flex>
                      <v-flex xs6 class="ml-3">
                        <v-text-field
f42c1d9c9   Neeraj Sharma   something change ...
367
                          placeholder="fill your email"
03dcbf0c1   Neeraj Sharma   fix all api and r...
368
369
                          :rules="emailRules"
                          v-model="editedItem.email"
f42c1d9c9   Neeraj Sharma   something change ...
370
                          type="text"
03dcbf0c1   Neeraj Sharma   fix all api and r...
371
372
373
374
375
                          name="email"
                          required
                        ></v-text-field>
                      </v-flex>
                    </v-layout>
e3e2a04c6   Neeraj Sharma   first commit
376
                    <!-- <v-layout>
03dcbf0c1   Neeraj Sharma   fix all api and r...
377
378
379
380
                      <v-flex xs4 class="pt-4 subheading">
                        <label class="right">Date of Birth:</label>
                      </v-flex>
                      <v-flex xs6 class="ml-3">
ac10393a4   Neeraj Sharma   add calender date...
381
382
383
384
385
386
387
                         <v-menu
                           ref="menu"
                           :close-on-content-click="false"
                           v-model="menu"
                           :nudge-right="40"
                           lazy
                           transition="scale-transition"
f42c1d9c9   Neeraj Sharma   something change ...
388
                           offset-y
ac10393a4   Neeraj Sharma   add calender date...
389
390
                           full-width
                           min-width="290px"
ac10393a4   Neeraj Sharma   add calender date...
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
                          >
                         <v-text-field
                          slot="activator"
                          v-model="editedItem.date"
                          placeholder="Select date"
                         ></v-text-field>
                         <v-date-picker
                          ref="picker"
                          v-model="editedItem.date"
                          :max="new Date().toISOString().substr(0, 10)"
                          min="1950-01-01"
                          @input="menu = false"
                          ></v-date-picker>
                          </v-menu>
                         </v-flex>
e3e2a04c6   Neeraj Sharma   first commit
406
                       </v-layout> -->
dd4ecae1d   Neeraj Sharma   search very fast ...
407
408
409
                      <v-layout>
                        <v-flex xs12 sm9 offset-sm2>
                      <v-card-actions>
03dcbf0c1   Neeraj Sharma   fix all api and r...
410
411
412
                      <v-btn @click="clear" round dark>clear</v-btn>
                      <v-spacer></v-spacer>
                      <v-btn @click="submit" round dark :loading="loading">Add</v-btn>
dd4ecae1d   Neeraj Sharma   search very fast ...
413
                     </v-card-actions>
03dcbf0c1   Neeraj Sharma   fix all api and r...
414
415
416
417
418
419
420
421
422
423
424
425
                     </v-flex>
                    </v-layout>
                  </v-form>
                </v-flex>
              </v-layout>
            </v-container>
          </v-card>
        </v-flex>
       </v-container>
     </v-tab-item>
    </v-tabs>
  </v-app>
93a68cfa1   Jatinder Singh   first commit
426
427
428
  </template>
  
  <script>
f7979ec1a   Neeraj Sharma   add seach in heal...
429
  // import AppToolbar from '@/components/AppToolbar';
e3e2a04c6   Neeraj Sharma   first commit
430
431
432
433
434
  // import onemonth from "@/components/report/onemonth.vue";
  // import threemonth from "@/components/report/threemonth.vue";
  // import sixmonth from "@/components/report/sixmonth.vue";
  // import ninemonth from "@/components/report/ninemonth.vue";
  // import generatereport from "@/components/report/generatereport.vue";
03dcbf0c1   Neeraj Sharma   fix all api and r...
435
  import http from "@/Services/http.js";
f7979ec1a   Neeraj Sharma   add seach in heal...
436
437
  import NotificationList from "@/components/widgets/list/NotificationList";
  import Util from "@/util";
03dcbf0c1   Neeraj Sharma   fix all api and r...
438

93a68cfa1   Jatinder Singh   first commit
439
  export default {
f84ff8f5a   Jatinder Singh   report page changes
440
    components: {
e3e2a04c6   Neeraj Sharma   first commit
441
442
443
444
445
      // "one-month": onemonth,
      // "three-month": threemonth,
      // "six-month": sixmonth,
      // "nine-month": ninemonth,
      // "report-generate": generatereport,
f7979ec1a   Neeraj Sharma   add seach in heal...
446
   },
93a68cfa1   Jatinder Singh   first commit
447
    data: () => ({
03dcbf0c1   Neeraj Sharma   fix all api and r...
448
449
450
451
452
453
454
455
      component: "report-generate",
      snackbar: false,
      y: "top",
      x: "right",
      mode: "",
      timeout: 3000,
      text: "",
      loading: false,
ac10393a4   Neeraj Sharma   add calender date...
456
      date:null,
e3e2a04c6   Neeraj Sharma   first commit
457
      search: '',
03dcbf0c1   Neeraj Sharma   fix all api and r...
458
459
      modal: false,
      modaledit:false,
ac10393a4   Neeraj Sharma   add calender date...
460
461
      menu: false,
      menu1:false,
93a68cfa1   Jatinder Singh   first commit
462
      dialog: false,
c35a8dafd   Jatinder Singh   minor changes
463
464
465
      dialog1: false,
      dialog2: false,
      valid: true,
ee83012b3   Jatinder Singh   changes
466
467
      isActive: true,
      newActive: false,
ab72cb628   Jatinder Singh   report changes
468
469
470
471
      isActivebtn: false,
      Activebtn1: false,
      Activebtn2: false,
      Activebtn3: false,
defcc5da3   Jatinder Singh   report page
472
473
474
475
476
      loader: null,
      loading: false,
      loading2: false,
      loading3: false,
      loading4: false,
03dcbf0c1   Neeraj Sharma   fix all api and r...
477
      details: [],
5ac5570a9   Jatinder Singh   datatable changes
478
      pagination: {
03dcbf0c1   Neeraj Sharma   fix all api and r...
479
        rowsPerPage: 15
5ac5570a9   Jatinder Singh   datatable changes
480
      },
5f2dd99ed   Neeraj Sharma   add full name in ...
481
      nameRules: [v => !!v || " Full Name is required"],
c35a8dafd   Jatinder Singh   minor changes
482
      emailRules: [
03dcbf0c1   Neeraj Sharma   fix all api and r...
483
        v => !!v || "E-mail is required",
708aeb658   Neeraj Sharma   fix validation ad...
484
         v => /^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(v) || 'E-mail must be valid'
c35a8dafd   Jatinder Singh   minor changes
485
      ],
93a68cfa1   Jatinder Singh   first commit
486
487
      headers: [
        {
03dcbf0c1   Neeraj Sharma   fix all api and r...
488
489
          text: "No",
          align: "center",
93a68cfa1   Jatinder Singh   first commit
490
          sortable: false,
03dcbf0c1   Neeraj Sharma   fix all api and r...
491
          value: "No"
c35a8dafd   Jatinder Singh   minor changes
492
        },
03dcbf0c1   Neeraj Sharma   fix all api and r...
493
494
495
        { text: "Name", value: "name", sortable: false, align: "center" },
        { text: "Email", value: "email", sortable: false, align: "center" },
        { text: "", value: "", sortable: false, align: "center" }
93a68cfa1   Jatinder Singh   first commit
496
      ],
03dcbf0c1   Neeraj Sharma   fix all api and r...
497
      desserts: [],
93a68cfa1   Jatinder Singh   first commit
498
499
      editedIndex: -1,
      editedItem: {
e3e2a04c6   Neeraj Sharma   first commit
500
        role: "TEACHER",
03dcbf0c1   Neeraj Sharma   fix all api and r...
501
        name: "",
03dcbf0c1   Neeraj Sharma   fix all api and r...
502
        email: "",
93a68cfa1   Jatinder Singh   first commit
503
504
      },
      defaultItem: {
e3e2a04c6   Neeraj Sharma   first commit
505
        role: "TEACHER",
03dcbf0c1   Neeraj Sharma   fix all api and r...
506
        name: "",
03dcbf0c1   Neeraj Sharma   fix all api and r...
507
        email: "",
f7979ec1a   Neeraj Sharma   add seach in heal...
508
509
510
511
      },
      userName:'',
      items: [
        {
f7979ec1a   Neeraj Sharma   add seach in heal...
512
513
514
515
516
517
          href: "/changepassword",
          title: "Change Password",
          click: e => {
            console.log(e);
          }
        },
f7979ec1a   Neeraj Sharma   add seach in heal...
518
        {
f7979ec1a   Neeraj Sharma   add seach in heal...
519
520
521
522
          href: "#",
          title: "Logout",
          click: e => {
            window.getApp.$emit("APP_LOGOUT");
f7979ec1a   Neeraj Sharma   add seach in heal...
523
524
525
          }
        }
      ]
93a68cfa1   Jatinder Singh   first commit
526
    }),
ac10393a4   Neeraj Sharma   add calender date...
527
528
529
530
531
532
533
534
535
     watch: {
      menu (val) {
        val && this.$nextTick(() => (this.$refs.picker.activePicker = 'YEAR'))
      },
      menu1 (val) {
        val && this.$nextTick(() => (this.$refs.picker.activePicker = 'YEAR'))
      }
     },
     methods: {
e3e2a04c6   Neeraj Sharma   first commit
536
      getTeacherList() {
03dcbf0c1   Neeraj Sharma   fix all api and r...
537
        var token = this.$store.state.token;
e3e2a04c6   Neeraj Sharma   first commit
538
539
        http() 
          .get("/getTeachersList", { 
03dcbf0c1   Neeraj Sharma   fix all api and r...
540
541
            headers: { Authorization: "Bearer " + token } 
           })
e173bab21   Jatinder Singh   api
542
          .then(response => {
e3e2a04c6   Neeraj Sharma   first commit
543
544
            this.desserts = response.data.data;
            console.log("getTeacherList=====>",this.desserts)
03dcbf0c1   Neeraj Sharma   fix all api and r...
545
546
          })
          .catch(err => {
4d962bb59   Neeraj Sharma   fix name & email ...
547
            // console.log("err====>", err);
945cc2d12   Neeraj Sharma   somrthing changes...
548
            this.$router.replace({ path: '/' });
03dcbf0c1   Neeraj Sharma   fix all api and r...
549
          });
e173bab21   Jatinder Singh   api
550
      },
03dcbf0c1   Neeraj Sharma   fix all api and r...
551
      editItem(item) {
93a68cfa1   Jatinder Singh   first commit
552
553
554
555
        this.editedIndex = this.desserts.indexOf(item);
        this.editedItem = Object.assign({}, item);
        this.dialog = true;
      },
03dcbf0c1   Neeraj Sharma   fix all api and r...
556
      profile(item) {
c35a8dafd   Jatinder Singh   minor changes
557
558
559
560
        this.editedIndex = this.desserts.indexOf(item);
        this.editedItem = Object.assign({}, item);
        this.dialog1 = true;
      },
e3e2a04c6   Neeraj Sharma   first commit
561
562
563
564
565
      // report(item) {
      //   this.editedIndex = this.desserts.indexOf(item);
      //   this.editedItem = Object.assign({}, item);
          // this.dialog2 = true;
      // },
93a68cfa1   Jatinder Singh   first commit
566

03dcbf0c1   Neeraj Sharma   fix all api and r...
567
      deleteItem(item) {
e3e2a04c6   Neeraj Sharma   first commit
568
569
        let deleteTeachers = {
          teacherId: item._id
03dcbf0c1   Neeraj Sharma   fix all api and r...
570
        };
e3e2a04c6   Neeraj Sharma   first commit
571
         console.log("deleteUers",deleteTeachers)
03dcbf0c1   Neeraj Sharma   fix all api and r...
572
        http()
e3e2a04c6   Neeraj Sharma   first commit
573
          .delete("/deleteTeacher", confirm('Are you sure you want to delete this?') &&  { params: deleteTeachers })
03dcbf0c1   Neeraj Sharma   fix all api and r...
574
          .then(response => {
e3e2a04c6   Neeraj Sharma   first commit
575
            console.log("deleteUers",deleteTeachers)
03dcbf0c1   Neeraj Sharma   fix all api and r...
576
577
578
            if ((this.snackbar = true)) {
              this.text = "Successfully delete Existing User";
          }
e3e2a04c6   Neeraj Sharma   first commit
579
            this.getTeacherList();
03dcbf0c1   Neeraj Sharma   fix all api and r...
580
581
          })
          .catch(error => {
e3e2a04c6   Neeraj Sharma   first commit
582
            console.log(error);
03dcbf0c1   Neeraj Sharma   fix all api and r...
583
          });
93a68cfa1   Jatinder Singh   first commit
584
      },
03dcbf0c1   Neeraj Sharma   fix all api and r...
585
      activeTab(type) {
ee83012b3   Jatinder Singh   changes
586
        switch (type) {
03dcbf0c1   Neeraj Sharma   fix all api and r...
587
          case "existing":
ee83012b3   Jatinder Singh   changes
588
589
590
591
592
593
594
595
596
597
            this.newActive = false;
            this.isActive = true;
            break;
  
          default:
            this.newActive = true;
            this.isActive = false;
            break;
        }
      },
03dcbf0c1   Neeraj Sharma   fix all api and r...
598
      activebtn(type) {
ab72cb628   Jatinder Singh   report changes
599
        switch (type) {
03dcbf0c1   Neeraj Sharma   fix all api and r...
600
          case "existing":
ab72cb628   Jatinder Singh   report changes
601
602
603
604
605
            this.Activebtn3 = false;
            this.Activebtn2 = false;
            this.Activebtn1 = false;
            this.isActivebtn = true;
            break;
03dcbf0c1   Neeraj Sharma   fix all api and r...
606
          case "new":
ab72cb628   Jatinder Singh   report changes
607
608
609
610
611
            this.Activebtn3 = false;
            this.Activebtn2 = false;
            this.Activebtn1 = true;
            this.isActivebtn = false;
            break;
03dcbf0c1   Neeraj Sharma   fix all api and r...
612
          case "new1":
ab72cb628   Jatinder Singh   report changes
613
614
615
616
617
618
619
620
621
622
623
624
625
            this.Activebtn3 = false;
            this.Activebtn2 = true;
            this.Activebtn1 = false;
            this.isActivebtn = false;
            break;
          default:
            this.Activebtn3 = true;
            this.Activebtn2 = false;
            this.Activebtn1 = false;
            this.isActivebtn = false;
            break;
        }
      },
03dcbf0c1   Neeraj Sharma   fix all api and r...
626
      close() {
93a68cfa1   Jatinder Singh   first commit
627
628
629
630
631
632
        this.dialog = false;
        setTimeout(() => {
          this.editedItem = Object.assign({}, this.defaultItem);
          this.editedIndex = -1;
        }, 300);
      },
03dcbf0c1   Neeraj Sharma   fix all api and r...
633
      close1() {
c35a8dafd   Jatinder Singh   minor changes
634
635
        this.dialog1 = false;
      },
03dcbf0c1   Neeraj Sharma   fix all api and r...
636
      close2() {
c35a8dafd   Jatinder Singh   minor changes
637
638
        this.dialog2 = false;
      },
03dcbf0c1   Neeraj Sharma   fix all api and r...
639
      submit() {
c35a8dafd   Jatinder Singh   minor changes
640
        if (this.$refs.form.validate()) {
03dcbf0c1   Neeraj Sharma   fix all api and r...
641
          let addUsers = {
5f2dd99ed   Neeraj Sharma   add full name in ...
642
            name: this.editedItem.name,
03dcbf0c1   Neeraj Sharma   fix all api and r...
643
            email: this.editedItem.email,
e3e2a04c6   Neeraj Sharma   first commit
644
            role: this.editedItem.role
03dcbf0c1   Neeraj Sharma   fix all api and r...
645
          };
c2842195b   Neeraj Sharma   testing success &...
646
          // console.log(addUsers)
03dcbf0c1   Neeraj Sharma   fix all api and r...
647
          http()
e3e2a04c6   Neeraj Sharma   first commit
648
            .post("/createTeacher", addUsers)
03dcbf0c1   Neeraj Sharma   fix all api and r...
649
            .then(response => {
e3e2a04c6   Neeraj Sharma   first commit
650
              this.getTeacherList();
f42c1d9c9   Neeraj Sharma   something change ...
651
              if (this.snackbar = true) {
945cc2d12   Neeraj Sharma   somrthing changes...
652
                this.text = "New user added successfully";
03dcbf0c1   Neeraj Sharma   fix all api and r...
653
              }
f42c1d9c9   Neeraj Sharma   something change ...
654
655
              
            this.clear();
03dcbf0c1   Neeraj Sharma   fix all api and r...
656
657
            })
            .catch(error => {
4d962bb59   Neeraj Sharma   fix name & email ...
658
              // console.log(error);
f42c1d9c9   Neeraj Sharma   something change ...
659
660
661
              if (this.snackbar = true) {
              this.text = error.response.data.message;
            }
03dcbf0c1   Neeraj Sharma   fix all api and r...
662
            });
c35a8dafd   Jatinder Singh   minor changes
663
664
        }
      },
03dcbf0c1   Neeraj Sharma   fix all api and r...
665
      mail() {
789f8298f   Jatinder Singh   change
666
      },
03dcbf0c1   Neeraj Sharma   fix all api and r...
667
      download() {
789f8298f   Jatinder Singh   change
668
      },
03dcbf0c1   Neeraj Sharma   fix all api and r...
669
      clear() {
ee83012b3   Jatinder Singh   changes
670
671
        this.$refs.form.reset();
      },
03dcbf0c1   Neeraj Sharma   fix all api and r...
672
673
      save() {
        let editUsers = {
5f2dd99ed   Neeraj Sharma   add full name in ...
674
          name: this.editedItem.name,
03dcbf0c1   Neeraj Sharma   fix all api and r...
675
          email: this.editedItem.email,
e3e2a04c6   Neeraj Sharma   first commit
676
          teacherId: this.editedItem._id
03dcbf0c1   Neeraj Sharma   fix all api and r...
677
678
        };
        http()
e3e2a04c6   Neeraj Sharma   first commit
679
          .put("/updateTeacher", editUsers)
03dcbf0c1   Neeraj Sharma   fix all api and r...
680
          .then(response => {
e3e2a04c6   Neeraj Sharma   first commit
681
            console.log("editUsers",editUsers);
03dcbf0c1   Neeraj Sharma   fix all api and r...
682
683
684
            if ((this.snackbar = true)) {
              this.text = "Successfully Edit Existing User";
            }
e3e2a04c6   Neeraj Sharma   first commit
685
              this.getTeacherList();
03dcbf0c1   Neeraj Sharma   fix all api and r...
686
687
          })
          .catch(error => {
4d962bb59   Neeraj Sharma   fix name & email ...
688
             // console.log(error);
03dcbf0c1   Neeraj Sharma   fix all api and r...
689
690
          });
        this.close();
f7979ec1a   Neeraj Sharma   add seach in heal...
691
692
693
694
695
696
      },
      handleDrawerToggle() {
        window.getApp.$emit("APP_DRAWER_TOGGLED");
      },
      handleFullScreen() {
        Util.toggleFullScreen();
93a68cfa1   Jatinder Singh   first commit
697
      }
4413a8d93   Jatinder Singh   changes
698
    },
03dcbf0c1   Neeraj Sharma   fix all api and r...
699
    mounted() {
e3e2a04c6   Neeraj Sharma   first commit
700
701
702
      this.getTeacherList();
      // console.log("Id",this.$store.state.id)
      // console.log("token",this.$store.state.token) 
f7979ec1a   Neeraj Sharma   add seach in heal...
703
704
705
706
707
    },
    computed:{
      toolbarColor() {
        return this.$vuetify.options.extra.mainNav;
      }
e173bab21   Jatinder Singh   api
708
    }
93a68cfa1   Jatinder Singh   first commit
709
  };
93a68cfa1   Jatinder Singh   first commit
710
  </script>
04e3fbc56   Jatinder Singh   minor fix
711
  <style scoped>
9f9522c1d   Neeraj Sharma   fix button text a...
712
713
714
  .v-tabs__div {
      text-transform: none;
  }
dd4ecae1d   Neeraj Sharma   search very fast ...
715
716
717
  .v-input__prepend-outer {
      margin-right: 0px !important;
  }
ee83012b3   Jatinder Singh   changes
718
  .v-card__actions .v-btn {
04e3fbc56   Jatinder Singh   minor fix
719
720
721
    margin: 0 15px;
    min-width: 120px;
  }
ac10393a4   Neeraj Sharma   add calender date...
722
723
724
725
   .primary {
      background-color: #aaa !important;
      border-color: #aaa !important;
  }
ee83012b3   Jatinder Singh   changes
726
727
728
729
730
  h4 {
    background-repeat: no-repeat;
    padding: 8px;
    margin: auto;
    font-size: 25px;
269061695   Jatinder Singh   changes
731
  }
ee83012b3   Jatinder Singh   changes
732
733
734
735
  #name {
    position: absolute;
    left: 100px;
    top: 17px;
269061695   Jatinder Singh   changes
736
  }
ee83012b3   Jatinder Singh   changes
737
  #icon {
269061695   Jatinder Singh   changes
738
739
740
741
    position: absolute;
    right: 8px;
    top: 8px;
  }
ee83012b3   Jatinder Singh   changes
742
  #m {
269061695   Jatinder Singh   changes
743
744
    position: relative;
    left: 135px;
c1fd43e24   Jatinder Singh   changes
745
    top: -15px;
269061695   Jatinder Singh   changes
746
  }
ee83012b3   Jatinder Singh   changes
747
748
749
  #G {
    position: absolute;
    top: 38px;
f84ff8f5a   Jatinder Singh   report page changes
750
    color: white;
269061695   Jatinder Singh   changes
751
  }
ee83012b3   Jatinder Singh   changes
752
  #bt {
269061695   Jatinder Singh   changes
753
    position: relative;
ee83012b3   Jatinder Singh   changes
754
755
    top: -20px;
    left: 115px;
269061695   Jatinder Singh   changes
756
  }
ee83012b3   Jatinder Singh   changes
757
758
  #e {
    position: relative;
defcc5da3   Jatinder Singh   report page
759
760
    top: 5px;
    right: -30px;
269061695   Jatinder Singh   changes
761
762
763
    height: 17px;
    cursor: pointer;
  }
ee83012b3   Jatinder Singh   changes
764
765
  #d {
    position: relative;
defcc5da3   Jatinder Singh   report page
766
767
    top: 5px;
    right: -70px;
ee83012b3   Jatinder Singh   changes
768
769
    height: 17px;
    cursor: pointer;
269061695   Jatinder Singh   changes
770
771
  }
  #td {
ee83012b3   Jatinder Singh   changes
772
773
774
    border: 1px solid #dddddd;
    text-align: left;
    padding: 8px;
269061695   Jatinder Singh   changes
775
  }
ee83012b3   Jatinder Singh   changes
776
777
778
779
780
781
  #dialog {
    height: 550px;
  }
  .active {
    background-color: black;
    color: white !important;
269061695   Jatinder Singh   changes
782
  }
ab72cb628   Jatinder Singh   report changes
783
784
785
  .activebtn {
    color: black !important;
  }
03dcbf0c1   Neeraj Sharma   fix all api and r...
786
787
788
789
790
791
792
793
794
  #flex {
    height: 300px;
  }
  .top{
    margin-top:100px;
  }
  .v-tabs__item a{
    font-size:16px !important; 
  }
659b42db7   Neeraj Sharma   changes something...
795
796
797
  @media screen and (max-width: 769px){
    .top{
      margin-top:0 !important;
dd4ecae1d   Neeraj Sharma   search very fast ...
798
799
800
801
    } 
    .userSearch .v-icon {
      font-size: 20px !important;
      margin-left: 20px ;
659b42db7   Neeraj Sharma   changes something...
802
    }
659b42db7   Neeraj Sharma   changes something...
803
  }
03dcbf0c1   Neeraj Sharma   fix all api and r...
804
805
806
807
808
809
810
811
812
813
814
  @media screen and (max-width: 380px) {
  .right {
      float: none !important;
  }
  .subheading {
      font-size: 14px !important;
  }
  .v-card__actions .v-btn{
      margin: 0 0px;
      min-width: 100px;
  }
dd4ecae1d   Neeraj Sharma   search very fast ...
815
816
817
818
  /* .searchIcon .v-icon {
      font-size: 20px;
      margin-left: 20px;
  } */
03dcbf0c1   Neeraj Sharma   fix all api and r...
819
820
821
822
823
824
  .subheading {
      font-size: 12px !important;
  }  
  h5 {
      font-size: 13px;
  }
e2e46164f   Jatinder Singh   edit profile changes
825
  }
f7979ec1a   Neeraj Sharma   add seach in heal...
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
  .v-icon{
    font-size:30px;
  }
  @media screen and (min-width: 1270px){
  .hide{
    display: none;
  }
  /* }
  @media screen and (max-width: 962px) {
  .imglogo{
      position: absolute;
      top: 13px;
      left: 13px !important;
      width: 70px;
      height: 24px;
  } */
  }
  @media screen and (max-width: 420px){
dd4ecae1d   Neeraj Sharma   search very fast ...
844
845
846
847
848
849
  .userSearch .v-text-field .v-label{
    line-height: 24px !important;
  }
  .userSearch .v-label{
    font-size: 13px !important;
  }
f7979ec1a   Neeraj Sharma   add seach in heal...
850
851
852
853
854
855
856
857
  .v-list__tile {
    font-size:14px;
    padding: 0 10px;
  }
  .name{
    font-size:15px; 
  }
  }
04e3fbc56   Jatinder Singh   minor fix
858
  </style>