Blame view
src/pages/Provider.vue
6.99 KB
93a68cfa1
|
1 |
<template> |
269061695
|
2 |
<v-container grid-list-md> |
93a68cfa1
|
3 4 5 6 7 8 9 10 11 12 13 14 |
<v-flex> <v-card> <v-card-title> <b><h5> Healthcare Providers </h5></b> <v-spacer></v-spacer> <v-flex xs6 sm4> <v-text-field justify-right prepend-icon="search" v-model="search" label="Find Yours Users" ></v-text-field></v-flex> </v-card-title> |
04e3fbc56
|
15 |
|
93a68cfa1
|
16 |
<v-dialog v-model="dialog" max-width="500px"> |
04e3fbc56
|
17 |
<v-toolbar color="white"> |
93a68cfa1
|
18 19 20 21 22 23 |
<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> |
8fc85e8ec
|
24 |
<v-avatar size="50px" style="position:absolute; top:10px; "> |
269061695
|
25 |
<img src="/static/icon/user.png"/> </v-avatar> |
93a68cfa1
|
26 27 28 29 30 31 32 |
</v-flex> <v-card-text> <v-container grid-list-md> <v-layout wrap justify-center> <v-flex xs12 sm9> <v-form> <v-text-field |
04e3fbc56
|
33 |
v-model="editedItem.Name" |
8fc85e8ec
|
34 |
v-validate="'required'" |
93a68cfa1
|
35 |
:error-messages="errors.collect('Name')" |
a259e694f
|
36 |
label="First Name" |
93a68cfa1
|
37 38 39 40 |
data-vv-name="Name" required > </v-text-field> <v-text-field |
8fc85e8ec
|
41 |
v-validate="'required'" |
93a68cfa1
|
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
v-model="editedItem.LName" :error-messages="errors.collect('name')" label="Last Name" data-vv-name="name" required> </v-text-field> <v-text-field v-model="editedItem.Email" v-validate="'required|email'" :error-messages="errors.collect('email')" label="E-mail" data-vv-name="email" required> </v-text-field> <v-text-field v-model="editedItem.DOB" label="Date of Birth" |
c35a8dafd
|
59 60 |
:rules="[rules.required, rules.min]" > |
93a68cfa1
|
61 62 |
</v-text-field> <v-card-actions> |
04e3fbc56
|
63 64 |
<v-btn round dark @click.native="close">Cancel</v-btn> |
93a68cfa1
|
65 |
<v-spacer></v-spacer> |
04e3fbc56
|
66 67 |
<v-btn round dark @click.native="save">Save</v-btn> |
93a68cfa1
|
68 69 70 71 72 73 |
</v-card-actions> </v-form> </v-flex> </v-layout> </v-container> </v-card-text> |
93a68cfa1
|
74 75 |
</v-card> </v-dialog> |
04e3fbc56
|
76 77 78 79 80 81 82 83 |
<v-dialog v-model="dialog1" max-width="500px"> <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> |
a259e694f
|
84 |
|
04e3fbc56
|
85 86 87 |
<v-card> <v-flex align-center justify-center layout text-xs-center> |
8fc85e8ec
|
88 |
<v-avatar size="50px" style="position:absolute; top:10px;"> |
269061695
|
89 |
<img src="/static/icon/user.png"/> </v-avatar> |
04e3fbc56
|
90 91 92 93 |
</v-flex> <v-card-text> <v-container grid-list-md> <v-layout wrap justify-center> |
a259e694f
|
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
<v-flex offset-xs3> <br><br> <table> <th> <tr><h5><b>First Name:</b></h5></tr><br> <tr><h5><b>Last Name:</b></h5></tr><br> <tr><h5><b>Email:</b></h5></tr><br> <tr><h5><b>Date Of Birth:</b></h5></tr> </th> <th> <tr><td><h5><b>{{ editedItem.Name }}</b></h5></td></tr><br> <tr> <td><h5><b>{{ editedItem.LName }}</b></h5></td></tr><br> <tr><td><h5><b>{{ editedItem.Email }}</b></h5></td></tr><br> <tr><td><h5><b>{{ editedItem.DOB }}</b></h5></td></tr> </th> |
c35a8dafd
|
111 |
|
a259e694f
|
112 |
</table> |
04e3fbc56
|
113 114 115 116 |
</v-flex> </v-layout> </v-container> </v-card-text> |
93a68cfa1
|
117 |
</v-card> |
04e3fbc56
|
118 |
</v-dialog> |
269061695
|
119 120 121 122 |
<v-data-table :headers="headers" :items="desserts" :search="search" |
8fc85e8ec
|
123 |
class="elevation-1" |
269061695
|
124 125 126 127 128 129 |
> <template slot="items" slot-scope="props"> <td id="td">{{ props.item.No }}</td> <td id="td">{{ props.item.Name+' '+props.item.LName }}</td> <td id="td">{{ props.item.Email }}</td> |
8fc85e8ec
|
130 |
<td id="td"><v-flex xs6 sm5 > |
269061695
|
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
<v-select :items="status" v-model="props.item.e1" menu-props="auto" label="Select" hide-details single-line ></v-select> </v-flex></td> <td> <span> <img style="cursor:pointer; width:25px; height:18px; " class="mr-2" @click="profile(props.item)" src="/static/icon/eye1.png"/> <img style="cursor:pointer; width:20px; height:18px; " class="mr-2" @click="editItem(props.item)" src="/static/icon/edit1.png"/> <img style="cursor:pointer; height:20px; " class="mr-2" @click="deleteItem(props.item)" src="/static/icon/delete1.png"/> </span> </td> </template> </v-data-table> |
04e3fbc56
|
150 151 152 |
</v-card> </v-flex> |
93a68cfa1
|
153 154 155 156 157 |
</v-container> </template> <script> export default { data: () => ({ |
c35a8dafd
|
158 159 160 161 |
Name: '', LName: '', DOB: '', email: '', |
93a68cfa1
|
162 163 |
dialog: false, dialog1: false, |
04e3fbc56
|
164 |
status: ['Pending', 'Approved', 'Declined'], |
93a68cfa1
|
165 |
search: '', |
04e3fbc56
|
166 |
e1: '', |
c35a8dafd
|
167 168 169 170 |
rules: { required: value => !!value || 'This field is Required.', min: v => (/^(0?[1-9]|[12][0-9]|3[01])[\/\-](0?[1-9]|1[012])[\/\-]\d{4}$/).test(v) && v.length > 0 || 'Please enter a date in the format dd/mm/yyyy' }, |
93a68cfa1
|
171 |
headers: [ |
269061695
|
172 |
{ |
93a68cfa1
|
173 174 175 |
text: 'No', align: 'left', sortable: false, |
07095d4d8
|
176 |
value: 'no' |
93a68cfa1
|
177 178 179 180 181 182 183 184 185 186 187 |
}, { text: 'Name', value: 'Name', sortable: false }, { text: 'Email', value: 'Email', sortable: false }, { text: 'Status', value: 'Status', sortable: false }, { text: '', value: '', sortable: false }, ], desserts: [], editedIndex: -1, editedItem: { No: '', |
c35a8dafd
|
188 |
Name: '', |
93a68cfa1
|
189 190 191 192 193 |
LName: '', Email: '', }, defaultItem: { No: '', |
c35a8dafd
|
194 |
Name: '', |
93a68cfa1
|
195 196 197 198 |
LName: '', Email: '', }, }), |
93a68cfa1
|
199 200 201 202 203 204 205 206 207 208 209 210 211 212 |
watch: { dialog (val) { val || this.close(); } }, created () { this.initialize(); }, methods: { initialize () { this.desserts = [ { No: 1, |
07095d4d8
|
213 |
Name: 'Amit', |
93a68cfa1
|
214 215 216 217 218 219 |
LName: 'goyal', Email: 'jsi@gmail.com', DOB: '22/09/1996' }, { No: 2, |
07095d4d8
|
220 |
Name: 'Sumit', |
93a68cfa1
|
221 222 223 224 225 226 227 228 229 230 231 232 |
LName: 'kumar', Email: 'aasi@gmail.com', DOB: '16/09/1997' } ]; }, editItem (item) { this.editedIndex = this.desserts.indexOf(item); this.editedItem = Object.assign({}, item); this.dialog = true; }, |
a259e694f
|
233 234 235 |
profile (item) { this.editedIndex = this.desserts.indexOf(item); this.editedItem = Object.assign({}, item); |
04e3fbc56
|
236 237 |
this.dialog1 = true; }, |
93a68cfa1
|
238 239 240 241 242 243 244 245 246 247 248 249 250 251 |
deleteItem (item) { const index = this.desserts.indexOf(item); confirm('Are you sure you want to delete this item?') && this.desserts.splice(index, 1); }, close () { this.dialog = false; setTimeout(() => { this.editedItem = Object.assign({}, this.defaultItem); this.editedIndex = -1; }, 300); }, |
04e3fbc56
|
252 253 254 |
close1 () { this.dialog1 = false; }, |
93a68cfa1
|
255 256 257 258 259 260 261 262 263 264 265 |
save () { if (this.editedIndex > -1) { Object.assign(this.desserts[this.editedIndex], this.editedItem); } else { this.desserts.push(this.editedItem); } this.close(); } }, }; |
04e3fbc56
|
266 267 268 269 270 271 |
</script> <style scoped> .v-card__actions .v-btn { margin: 0px; min-width: 120px; } |
269061695
|
272 273 274 275 276 |
#td { border: 1px solid #dddddd; text-align: left; padding: 8px; } |
8fc85e8ec
|
277 278 279 |
tr{ background-color: #D0D3D4; } |
04e3fbc56
|
280 |
</style> |