Blame view

src/pages/Dashboard.vue 23.7 KB
93a68cfa1   Jatinder Singh   first commit
1
  <template>
03dcbf0c1   Neeraj Sharma   fix all api and r...
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
  <v-app id="pages-dasboard">
    <v-tabs grow slider-color="black">
      <v-tab
        ripple
        @click="activeTab('existing')"
        v-bind:class="{ active: isActive }"
        id="tab"
        class="subheading"
      >Existing user</v-tab>
      <v-tab
        ripple
        @click="activeTab('new')"
        v-bind:class="{ active: newActive }"
        id="tab1"
        class="subheading"
      >Add New Users</v-tab>
     <!-- EDIT USERS Patient Dtails-->
      <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
40
            <v-card-text>
03dcbf0c1   Neeraj Sharma   fix all api and r...
41
42
43
44
45
              <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...
46
                        <v-flex xs4 class="pt-4 subheading">
03dcbf0c1   Neeraj Sharma   fix all api and r...
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
                          <label>First Name:</label>
                        </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>
                      <v-layout>
                        <v-flex xs4 class="pt-4 subheading">
                          <label>Last Name:</label>
                        </v-flex>
                        <v-flex xs8>
                          <v-text-field
                            v-model="editedItem.lastname"
                            v-validate="'required'"
                            :rules="lastnameRules"
                            data-vv-name="Name"
                            required
                          ></v-text-field>
                        </v-flex>
                      </v-layout>
03dcbf0c1   Neeraj Sharma   fix all api and r...
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
                      <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>
                       <v-layout>
                         <v-flex xs4 class="pt-4 subheading">
                          <label>Date of Birth:</label>
                        </v-flex>
                        <v-flex xs8>
ac10393a4   Neeraj Sharma   add calender date...
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
                        <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...
116
117
118
119
120
121
122
123
124
125
126
127
128
129
                        </v-flex>
                      </v-layout>
                      <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>
03dcbf0c1   Neeraj Sharma   fix all api and r...
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
        <!-- PROFILE VIEW pateints Details-->
        <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>
                       <h5 class="right">First Name:</h5>
                      </v-flex>
                      <v-flex sm6 xs8>
                      <h5>{{ editedItem.name }}</h5>
                    </v-flex>
                   </v-layout>
                    <v-layout>
                       <v-flex xs5 sm6>
                       <h5 class="right my-3">Last Name:</h5>
                      </v-flex>
                      <v-flex sm5 xs8>
                       <h5 class="my-3">{{ editedItem.name }}</h5>
                    </v-flex>
                   </v-layout>
                    <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>
                    <v-layout>
                       <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>
                   </v-layout>
                  </v-flex>
                </v-layout>
              </v-container>
            </v-card-text>
          </v-card>
        </v-dialog>
f84ff8f5a   Jatinder Singh   report page changes
186

03dcbf0c1   Neeraj Sharma   fix all api and r...
187
188
189
190
191
192
193
194
195
196
197
198
199
200
        <v-dialog v-model="dialog2" width="700px">
          <v-card>
            <div id="dialog">
              <h4>
                <b>Report</b>
              </h4>
              <h5 id="name">
                <b>Patient Name:</b>
                {{ editedItem.name+' '+editedItem.lastName }}
              </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
201

03dcbf0c1   Neeraj Sharma   fix all api and r...
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
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
              <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>
        </v-dialog>
        <v-snackbar
          :timeout="timeout"
          :top="y === 'top'"
          :right="x === 'right'"
          :vertical="mode === 'vertical'"
          v-model="snackbar"
          color="success"
        >{{ text }}</v-snackbar>
        <!-- EXISTING-USERS PatientList-->
        <v-data-table 
        :headers="headers" 
        :items="desserts" 
        :pagination.sync="pagination"
c35a8dafd   Jatinder Singh   minor changes
247
248
        >
          <template slot="items" slot-scope="props">
03dcbf0c1   Neeraj Sharma   fix all api and r...
249
250
251
            <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
252
            <td class="text-xs-center">
03dcbf0c1   Neeraj Sharma   fix all api and r...
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
              <span>
                <img
                  style="cursor:pointer; height:20px; "
                  class="mr-5"
                  @click="report(props.item)"
                  src="/static/icon/List1.png"
                >
                <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
279
            </td>
c35a8dafd   Jatinder Singh   minor changes
280
281
          </template>
        </v-data-table>
03dcbf0c1   Neeraj Sharma   fix all api and r...
282
283
284
      </v-tab-item>
      <!-- ADD USER PATIENT -->
      <v-tab-item>
03dcbf0c1   Neeraj Sharma   fix all api and r...
285
        <v-container>
f42c1d9c9   Neeraj Sharma   something change ...
286
287
288
289
290
291
292
293
         <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...
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
        <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">
                        <label class="right">First Name:</label>
                      </v-flex>
                      <v-flex xs6 class="ml-3">
                        <v-text-field
                          v-model="editedItem.name"
f42c1d9c9   Neeraj Sharma   something change ...
312
                          placeholder="fill your first Name"
03dcbf0c1   Neeraj Sharma   fix all api and r...
313
                          name="name"
f42c1d9c9   Neeraj Sharma   something change ...
314
                          type="text"
03dcbf0c1   Neeraj Sharma   fix all api and r...
315
316
317
318
319
320
321
322
323
324
325
                          :rules="nameRules"
                          required
                        ></v-text-field>
                      </v-flex>
                    </v-layout>
                    <v-layout>
                      <v-flex xs4 class="pt-4 subheading">
                        <label class="right">Last Name:</label>
                      </v-flex>
                      <v-flex xs6  class="ml-3">
                        <v-text-field
f42c1d9c9   Neeraj Sharma   something change ...
326
                          placeholder="fill your last Name"                        
03dcbf0c1   Neeraj Sharma   fix all api and r...
327
328
                          :rules="lastnameRules"
                          v-model="editedItem.lastname"
f42c1d9c9   Neeraj Sharma   something change ...
329
                          type="text"
03dcbf0c1   Neeraj Sharma   fix all api and r...
330
331
332
333
334
335
336
                          name="lastname"
                          required
                        ></v-text-field>
                      </v-flex>
                    </v-layout>
                    <v-layout>
                      <v-flex xs4 class="pt-4 subheading">
0cefd6eff   Neeraj Sharma   add country input...
337
338
339
340
                        <label class="right">Country:</label>
                      </v-flex>
                      <v-flex xs6  class="ml-3">
                        <v-text-field
ac10393a4   Neeraj Sharma   add calender date...
341
342
                          placeholder="fill your country Name"   
                          :rules="countryRules"
0cefd6eff   Neeraj Sharma   add country input...
343
344
345
346
347
348
349
350
351
                          v-model="editedItem.country"
                          type="text"
                          name="country"
                          required
                        ></v-text-field>
                      </v-flex>
                    </v-layout>
                    <v-layout>
                      <v-flex xs4 class="pt-4 subheading">
03dcbf0c1   Neeraj Sharma   fix all api and r...
352
353
354
355
                        <label class="right">Email ID:</label>
                      </v-flex>
                      <v-flex xs6 class="ml-3">
                        <v-text-field
f42c1d9c9   Neeraj Sharma   something change ...
356
                          placeholder="fill your email"
03dcbf0c1   Neeraj Sharma   fix all api and r...
357
358
                          :rules="emailRules"
                          v-model="editedItem.email"
f42c1d9c9   Neeraj Sharma   something change ...
359
                          type="text"
03dcbf0c1   Neeraj Sharma   fix all api and r...
360
361
362
363
364
                          name="email"
                          required
                        ></v-text-field>
                      </v-flex>
                    </v-layout>
93a68cfa1   Jatinder Singh   first commit
365

03dcbf0c1   Neeraj Sharma   fix all api and r...
366
367
368
369
370
                    <v-layout>
                      <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...
371
372
373
374
375
376
377
                         <v-menu
                           ref="menu"
                           :close-on-content-click="false"
                           v-model="menu"
                           :nudge-right="40"
                           lazy
                           transition="scale-transition"
f42c1d9c9   Neeraj Sharma   something change ...
378
                           offset-y
ac10393a4   Neeraj Sharma   add calender date...
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
                           full-width
                           min-width="290px"
  
                          >
                         <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>
                       </v-layout>
03dcbf0c1   Neeraj Sharma   fix all api and r...
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
                    <v-layout>
                      <v-flex xs12 sm9 offset-sm2>
                    <v-card-actions>
                      <v-btn @click="clear" round dark>clear</v-btn>
                      <v-spacer></v-spacer>
                      <v-btn @click="submit" round dark :loading="loading">Add</v-btn>
                    </v-card-actions>
                     </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
417
418
419
  </template>
  
  <script>
03dcbf0c1   Neeraj Sharma   fix all api and r...
420
421
422
423
424
425
  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";
  import http from "@/Services/http.js";
93a68cfa1   Jatinder Singh   first commit
426
  export default {
f84ff8f5a   Jatinder Singh   report page changes
427
    components: {
03dcbf0c1   Neeraj Sharma   fix all api and r...
428
429
430
431
      "one-month": onemonth,
      "three-month": threemonth,
      "six-month": sixmonth,
      "nine-month": ninemonth,
0cefd6eff   Neeraj Sharma   add country input...
432
      "report-generate": generatereport,
f84ff8f5a   Jatinder Singh   report page changes
433
    },
93a68cfa1   Jatinder Singh   first commit
434
    data: () => ({
03dcbf0c1   Neeraj Sharma   fix all api and r...
435
436
437
438
439
440
441
442
      component: "report-generate",
      snackbar: false,
      y: "top",
      x: "right",
      mode: "",
      timeout: 3000,
      text: "",
      loading: false,
ac10393a4   Neeraj Sharma   add calender date...
443
      date:null,
03dcbf0c1   Neeraj Sharma   fix all api and r...
444
445
446
      search: "",
      modal: false,
      modaledit:false,
ac10393a4   Neeraj Sharma   add calender date...
447
448
      menu: false,
      menu1:false,
93a68cfa1   Jatinder Singh   first commit
449
      dialog: false,
c35a8dafd   Jatinder Singh   minor changes
450
451
452
      dialog1: false,
      dialog2: false,
      valid: true,
ee83012b3   Jatinder Singh   changes
453
454
      isActive: true,
      newActive: false,
ab72cb628   Jatinder Singh   report changes
455
456
457
458
      isActivebtn: false,
      Activebtn1: false,
      Activebtn2: false,
      Activebtn3: false,
defcc5da3   Jatinder Singh   report page
459
460
461
462
463
      loader: null,
      loading: false,
      loading2: false,
      loading3: false,
      loading4: false,
03dcbf0c1   Neeraj Sharma   fix all api and r...
464
      details: [],
b34ed827a   Jatinder Singh   changes
465
      AddUsercredentials: {},
5ac5570a9   Jatinder Singh   datatable changes
466
      pagination: {
03dcbf0c1   Neeraj Sharma   fix all api and r...
467
        rowsPerPage: 15
5ac5570a9   Jatinder Singh   datatable changes
468
      },
04e3fbc56   Jatinder Singh   minor fix
469
      rules: {
03dcbf0c1   Neeraj Sharma   fix all api and r...
470
        required: value => !!value || "Date of Birth is Required.",
ee83012b3   Jatinder Singh   changes
471
472
473
474
475
        min: v =>
          (/^(0?[1-9]|[12][0-9]|3[01])[\/\-](0?[1-9]|1[012])[\/\-]\d{4}$/.test(
            v
          ) &&
            v.length > 0) ||
03dcbf0c1   Neeraj Sharma   fix all api and r...
476
          "Please enter a date in the format dd/mm/yyyy"
04e3fbc56   Jatinder Singh   minor fix
477
      },
03dcbf0c1   Neeraj Sharma   fix all api and r...
478
      nameRules: [v => !!v || " First Name is required"],
c35a8dafd   Jatinder Singh   minor changes
479
      emailRules: [
03dcbf0c1   Neeraj Sharma   fix all api and r...
480
481
        v => !!v || "E-mail is required",
        v => /.+@.+/.test(v) || "E-mail must be valid"
c35a8dafd   Jatinder Singh   minor changes
482
      ],
03dcbf0c1   Neeraj Sharma   fix all api and r...
483
      lastnameRules: [v => !!v || " Last Name is required"],
0cefd6eff   Neeraj Sharma   add country input...
484
      countryRules: [v => !!v || "  Country Name is required"],
93a68cfa1   Jatinder Singh   first commit
485
486
      headers: [
        {
03dcbf0c1   Neeraj Sharma   fix all api and r...
487
488
          text: "No",
          align: "center",
93a68cfa1   Jatinder Singh   first commit
489
          sortable: false,
03dcbf0c1   Neeraj Sharma   fix all api and r...
490
          value: "No"
c35a8dafd   Jatinder Singh   minor changes
491
        },
03dcbf0c1   Neeraj Sharma   fix all api and r...
492
493
494
        { 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
495
      ],
03dcbf0c1   Neeraj Sharma   fix all api and r...
496
      desserts: [],
93a68cfa1   Jatinder Singh   first commit
497
498
      editedIndex: -1,
      editedItem: {
03dcbf0c1   Neeraj Sharma   fix all api and r...
499
500
501
502
        No: "",
        name: "",
        lastName: "",
        email: "",
ac10393a4   Neeraj Sharma   add calender date...
503
        date: null,
0cefd6eff   Neeraj Sharma   add country input...
504
        country: ""
93a68cfa1   Jatinder Singh   first commit
505
506
      },
      defaultItem: {
03dcbf0c1   Neeraj Sharma   fix all api and r...
507
508
509
510
511
        No: "",
        name: "",
        lastname: "",
        email: "",
        dob: ""
c35a8dafd   Jatinder Singh   minor changes
512
      }
93a68cfa1   Jatinder Singh   first commit
513
    }),
4413a8d93   Jatinder Singh   changes
514
515
516
517
518
519
520
521
    // computed: {
    //   pages () {
    //     if (this.pagination.rowsPerPage == null ||
    //       this.pagination.totalItems == null
    //     ) return 0;
    //     return Math.ceil(this.pagination.totalItems / this.pagination.rowsPerPage);
    //   }
    // },
ac10393a4   Neeraj Sharma   add calender date...
522
523
524
525
526
527
528
529
530
531
532
533
     watch: {
      menu (val) {
        val && this.$nextTick(() => (this.$refs.picker.activePicker = 'YEAR'))
      },
      menu1 (val) {
        val && this.$nextTick(() => (this.$refs.picker.activePicker = 'YEAR'))
      }
     },
     methods: {
      save (date) {
        this.$refs.menu.save(date)
      },
03dcbf0c1   Neeraj Sharma   fix all api and r...
534
535
536
537
538
539
      getPatientList() {
        var token = this.$store.state.token;
        http()
          .get("/patientList", { 
            headers: { Authorization: "Bearer " + token } 
           })
e173bab21   Jatinder Singh   api
540
          .then(response => {
03dcbf0c1   Neeraj Sharma   fix all api and r...
541
542
543
544
545
            this.desserts = response.data.data.existingUser;
          })
          .catch(err => {
            console.log("err====>", err);
          });
e173bab21   Jatinder Singh   api
546
      },
03dcbf0c1   Neeraj Sharma   fix all api and r...
547
      editItem(item) {
93a68cfa1   Jatinder Singh   first commit
548
549
550
551
        this.editedIndex = this.desserts.indexOf(item);
        this.editedItem = Object.assign({}, item);
        this.dialog = true;
      },
03dcbf0c1   Neeraj Sharma   fix all api and r...
552
      profile(item) {
c35a8dafd   Jatinder Singh   minor changes
553
554
555
556
        this.editedIndex = this.desserts.indexOf(item);
        this.editedItem = Object.assign({}, item);
        this.dialog1 = true;
      },
03dcbf0c1   Neeraj Sharma   fix all api and r...
557
      report(item) {
c35a8dafd   Jatinder Singh   minor changes
558
559
560
        this.editedIndex = this.desserts.indexOf(item);
        this.editedItem = Object.assign({}, item);
        this.dialog2 = true;
a259e694f   Jatinder Singh   minor change
561
      },
93a68cfa1   Jatinder Singh   first commit
562

03dcbf0c1   Neeraj Sharma   fix all api and r...
563
564
565
566
567
      deleteItem(item) {
        let addUsers = {
          userId: item.userId
        };
        http()
ac10393a4   Neeraj Sharma   add calender date...
568
          .post("/deletePatient", confirm('Are you sure you want to delete this?') && addUsers)
03dcbf0c1   Neeraj Sharma   fix all api and r...
569
570
571
572
573
574
575
576
577
          .then(response => {
            if ((this.snackbar = true)) {
              this.text = "Successfully delete Existing User";
          }
            this.getPatientList();
          })
          .catch(error => {
            console.log(error);
          });
93a68cfa1   Jatinder Singh   first commit
578
      },
03dcbf0c1   Neeraj Sharma   fix all api and r...
579
      activeTab(type) {
ee83012b3   Jatinder Singh   changes
580
        switch (type) {
03dcbf0c1   Neeraj Sharma   fix all api and r...
581
          case "existing":
ee83012b3   Jatinder Singh   changes
582
583
584
585
586
587
588
589
590
591
            this.newActive = false;
            this.isActive = true;
            break;
  
          default:
            this.newActive = true;
            this.isActive = false;
            break;
        }
      },
03dcbf0c1   Neeraj Sharma   fix all api and r...
592
      activebtn(type) {
ab72cb628   Jatinder Singh   report changes
593
        switch (type) {
03dcbf0c1   Neeraj Sharma   fix all api and r...
594
          case "existing":
ab72cb628   Jatinder Singh   report changes
595
596
597
598
599
            this.Activebtn3 = false;
            this.Activebtn2 = false;
            this.Activebtn1 = false;
            this.isActivebtn = true;
            break;
03dcbf0c1   Neeraj Sharma   fix all api and r...
600
          case "new":
ab72cb628   Jatinder Singh   report changes
601
602
603
604
605
            this.Activebtn3 = false;
            this.Activebtn2 = false;
            this.Activebtn1 = true;
            this.isActivebtn = false;
            break;
03dcbf0c1   Neeraj Sharma   fix all api and r...
606
          case "new1":
ab72cb628   Jatinder Singh   report changes
607
608
609
610
611
612
613
614
615
616
617
618
619
            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...
620
      close() {
93a68cfa1   Jatinder Singh   first commit
621
622
623
624
625
626
        this.dialog = false;
        setTimeout(() => {
          this.editedItem = Object.assign({}, this.defaultItem);
          this.editedIndex = -1;
        }, 300);
      },
03dcbf0c1   Neeraj Sharma   fix all api and r...
627
      close1() {
c35a8dafd   Jatinder Singh   minor changes
628
629
        this.dialog1 = false;
      },
03dcbf0c1   Neeraj Sharma   fix all api and r...
630
      close2() {
c35a8dafd   Jatinder Singh   minor changes
631
632
        this.dialog2 = false;
      },
03dcbf0c1   Neeraj Sharma   fix all api and r...
633
      submit() {
c35a8dafd   Jatinder Singh   minor changes
634
        if (this.$refs.form.validate()) {
03dcbf0c1   Neeraj Sharma   fix all api and r...
635
          let addUsers = {
ac10393a4   Neeraj Sharma   add calender date...
636
            name: this.editedItem.name + " " +this.editedItem.lastname,
03dcbf0c1   Neeraj Sharma   fix all api and r...
637
638
639
640
            dob: this.editedItem.dob,
            email: this.editedItem.email,
            country: this.editedItem.country
          };
c2842195b   Neeraj Sharma   testing success &...
641
          // console.log(addUsers)
03dcbf0c1   Neeraj Sharma   fix all api and r...
642
643
644
          http()
            .post("/patient", addUsers)
            .then(response => {
03dcbf0c1   Neeraj Sharma   fix all api and r...
645
              this.getPatientList();
f42c1d9c9   Neeraj Sharma   something change ...
646
              if (this.snackbar = true) {
03dcbf0c1   Neeraj Sharma   fix all api and r...
647
648
                this.text = "Successfully Add New User";
              }
f42c1d9c9   Neeraj Sharma   something change ...
649
650
              
            this.clear();
03dcbf0c1   Neeraj Sharma   fix all api and r...
651
652
653
            })
            .catch(error => {
              console.log(error);
f42c1d9c9   Neeraj Sharma   something change ...
654
655
656
              if (this.snackbar = true) {
              this.text = error.response.data.message;
            }
03dcbf0c1   Neeraj Sharma   fix all api and r...
657
            });
c35a8dafd   Jatinder Singh   minor changes
658
659
        }
      },
03dcbf0c1   Neeraj Sharma   fix all api and r...
660
      mail() {
4413a8d93   Jatinder Singh   changes
661
        // this.editedIndex = this.desserts.indexOf();
789f8298f   Jatinder Singh   change
662
      },
03dcbf0c1   Neeraj Sharma   fix all api and r...
663
      download() {
4413a8d93   Jatinder Singh   changes
664
        // this.editedIndex = this.desserts.indexOf();
789f8298f   Jatinder Singh   change
665
      },
03dcbf0c1   Neeraj Sharma   fix all api and r...
666
      clear() {
ee83012b3   Jatinder Singh   changes
667
668
        this.$refs.form.reset();
      },
03dcbf0c1   Neeraj Sharma   fix all api and r...
669
670
      save() {
        let editUsers = {
ac10393a4   Neeraj Sharma   add calender date...
671
          name: this.editedItem.name + " " + this.editedItem.lastname,
03dcbf0c1   Neeraj Sharma   fix all api and r...
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
          dob: this.editedItem.dob,
          email: this.editedItem.email,
          userId: this.editedItem.userId
        };
        http()
          .post("/patientDetail", editUsers)
          .then(response => {
            if ((this.snackbar = true)) {
              this.text = "Successfully Edit Existing User";
            }
              this.getPatientList();
          })
          .catch(error => {
             console.log(error);
          });
        this.close();
93a68cfa1   Jatinder Singh   first commit
688
      }
4413a8d93   Jatinder Singh   changes
689
    },
03dcbf0c1   Neeraj Sharma   fix all api and r...
690
    mounted() {
e173bab21   Jatinder Singh   api
691
692
      this.getPatientList();
    }
03dcbf0c1   Neeraj Sharma   fix all api and r...
693
694
695
696
697
    //computed:{
    //   color(){
    //     return this.loading ? 'success' : ''
    // }
    //}
93a68cfa1   Jatinder Singh   first commit
698
  };
93a68cfa1   Jatinder Singh   first commit
699
  </script>
04e3fbc56   Jatinder Singh   minor fix
700
  <style scoped>
ee83012b3   Jatinder Singh   changes
701
  .v-card__actions .v-btn {
04e3fbc56   Jatinder Singh   minor fix
702
703
704
    margin: 0 15px;
    min-width: 120px;
  }
ac10393a4   Neeraj Sharma   add calender date...
705
706
707
708
   .primary {
      background-color: #aaa !important;
      border-color: #aaa !important;
  }
ee83012b3   Jatinder Singh   changes
709
710
711
712
713
  h4 {
    background-repeat: no-repeat;
    padding: 8px;
    margin: auto;
    font-size: 25px;
269061695   Jatinder Singh   changes
714
  }
ee83012b3   Jatinder Singh   changes
715
716
717
718
  #name {
    position: absolute;
    left: 100px;
    top: 17px;
269061695   Jatinder Singh   changes
719
  }
ee83012b3   Jatinder Singh   changes
720
  #icon {
269061695   Jatinder Singh   changes
721
722
723
724
    position: absolute;
    right: 8px;
    top: 8px;
  }
ee83012b3   Jatinder Singh   changes
725
  #m {
269061695   Jatinder Singh   changes
726
727
    position: relative;
    left: 135px;
c1fd43e24   Jatinder Singh   changes
728
    top: -15px;
269061695   Jatinder Singh   changes
729
  }
ee83012b3   Jatinder Singh   changes
730
731
732
  #G {
    position: absolute;
    top: 38px;
f84ff8f5a   Jatinder Singh   report page changes
733
    color: white;
269061695   Jatinder Singh   changes
734
  }
ee83012b3   Jatinder Singh   changes
735
  #bt {
269061695   Jatinder Singh   changes
736
    position: relative;
ee83012b3   Jatinder Singh   changes
737
738
    top: -20px;
    left: 115px;
269061695   Jatinder Singh   changes
739
  }
ee83012b3   Jatinder Singh   changes
740
741
  #e {
    position: relative;
defcc5da3   Jatinder Singh   report page
742
743
    top: 5px;
    right: -30px;
269061695   Jatinder Singh   changes
744
745
746
    height: 17px;
    cursor: pointer;
  }
ee83012b3   Jatinder Singh   changes
747
748
  #d {
    position: relative;
defcc5da3   Jatinder Singh   report page
749
750
    top: 5px;
    right: -70px;
ee83012b3   Jatinder Singh   changes
751
752
    height: 17px;
    cursor: pointer;
269061695   Jatinder Singh   changes
753
754
  }
  #td {
ee83012b3   Jatinder Singh   changes
755
756
757
    border: 1px solid #dddddd;
    text-align: left;
    padding: 8px;
269061695   Jatinder Singh   changes
758
  }
ee83012b3   Jatinder Singh   changes
759
760
761
762
763
764
  #dialog {
    height: 550px;
  }
  .active {
    background-color: black;
    color: white !important;
269061695   Jatinder Singh   changes
765
  }
ab72cb628   Jatinder Singh   report changes
766
767
768
  .activebtn {
    color: black !important;
  }
03dcbf0c1   Neeraj Sharma   fix all api and r...
769
770
771
772
773
774
775
776
777
  #flex {
    height: 300px;
  }
  .top{
    margin-top:100px;
  }
  .v-tabs__item a{
    font-size:16px !important; 
  }
659b42db7   Neeraj Sharma   changes something...
778
779
780
781
782
783
  @media screen and (max-width: 769px){
    .top{
      margin-top:0 !important;
    }
    
  }
03dcbf0c1   Neeraj Sharma   fix all api and r...
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
  @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;
  }
  }
  @media screen and (max-width: 380px) {
  .subheading {
      font-size: 12px !important;
  }  
  h5 {
      font-size: 13px;
  }
e2e46164f   Jatinder Singh   edit profile changes
803
  }
04e3fbc56   Jatinder Singh   minor fix
804
  </style>