Blame view
src/pages/Provider.vue
10.3 KB
93a68cfa1
|
1 |
<template> |
03dcbf0c1
|
2 3 |
<!-- <v-container fluid> --> <v-flex xs12> |
93a68cfa1
|
4 5 |
<v-card> <v-card-title> |
03dcbf0c1
|
6 7 8 |
<v-flex xs12 lg2 md3 sm4> <h4 class="text-xs-center"> Healthcare Providers </h4> </v-flex> |
93a68cfa1
|
9 |
<v-spacer></v-spacer> |
03dcbf0c1
|
10 11 |
<!-- SEARCH ALL HEALTH PROVIDER --> <v-flex xs8 sm4 lg3> |
93a68cfa1
|
12 13 14 15 |
<v-text-field justify-right prepend-icon="search" v-model="search" label="Find Yours Users" |
4413a8d93
|
16 |
color="black" |
93a68cfa1
|
17 18 |
></v-text-field></v-flex> </v-card-title> |
03dcbf0c1
|
19 20 21 22 23 24 25 26 27 28 29 |
<!-- EDIT HEALTH PROVIDER --> <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"> |
93a68cfa1
|
30 31 32 33 |
<v-spacer></v-spacer> <v-toolbar-title>Edit Profile</v-toolbar-title> <v-spacer></v-spacer> </v-toolbar> |
250d1e021
|
34 35 36 37 38 |
<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> |
93a68cfa1
|
39 40 41 42 |
<v-card-text> <v-container grid-list-md> <v-layout wrap justify-center> <v-flex xs12 sm9> |
09f34e0c8
|
43 |
<v-form ref="form" v-model="valid" lazy-validation> |
250d1e021
|
44 |
<v-layout style="position:relative; top:15px; "> |
e2e46164f
|
45 46 47 48 49 |
<v-flex xs4 class="pt-4 subheading"> <label>First Name: </label> </v-flex> <v-flex xs8> <v-text-field |
03dcbf0c1
|
50 |
v-model="editedItem.name" |
e2e46164f
|
51 52 |
:rules="nameRules" required |
250d1e021
|
53 54 55 56 |
></v-text-field> </v-flex> </v-layout> <v-layout> |
e2e46164f
|
57 58 59 60 |
<v-flex xs4 class="pt-4 subheading"> <label>Last Name: </label> </v-flex> <v-flex xs8> |
93a68cfa1
|
61 |
<v-text-field |
03dcbf0c1
|
62 |
v-model="editedItem.lastname" |
e2e46164f
|
63 |
required |
250d1e021
|
64 65 66 |
></v-text-field> </v-flex> </v-layout> |
250d1e021
|
67 |
<v-layout> |
e2e46164f
|
68 69 70 71 72 |
<v-flex xs4 class="pt-4 subheading"> <label>Email ID: </label> </v-flex> <v-flex xs8> <v-text-field |
03dcbf0c1
|
73 |
v-model="editedItem.email" |
7e8044568
|
74 |
:rules="emailRules" |
e2e46164f
|
75 76 77 |
data-vv-name="E-mail" required ></v-text-field></v-flex></v-layout> |
e2e46164f
|
78 |
<v-card-actions> |
04e3fbc56
|
79 |
<v-btn round dark @click.native="close">Cancel</v-btn> |
93a68cfa1
|
80 |
<v-spacer></v-spacer> |
04e3fbc56
|
81 82 |
<v-btn round dark @click.native="save">Save</v-btn> |
93a68cfa1
|
83 84 85 86 87 88 |
</v-card-actions> </v-form> </v-flex> </v-layout> </v-container> </v-card-text> |
93a68cfa1
|
89 90 |
</v-card> </v-dialog> |
03dcbf0c1
|
91 92 |
<!-- VIEW PROFILE PRVIDE LIST --> <v-dialog v-model="dialog1" max-width="700px" > |
04e3fbc56
|
93 94 95 96 97 98 |
<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> |
04e3fbc56
|
99 100 |
<v-card> <v-flex align-center justify-center layout text-xs-center> |
03dcbf0c1
|
101 |
<v-avatar size="60px" style="position:absolute; top:10px;"> |
269061695
|
102 |
<img src="/static/icon/user.png"/> </v-avatar> |
04e3fbc56
|
103 104 |
</v-flex> <v-card-text> |
03dcbf0c1
|
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
<v-container grid-list-md> <v-layout wrap justify-center> <v-flex sm12 offset-sm3><br><br> <v-layout> <v-flex xs4> <h5 class="right">First Name:</h5> </v-flex> <v-flex xs8> <h5 class="left">{{ editedItem.name }}</h5> </v-flex> </v-layout> <v-layout> <v-flex xs4> <h5 class="right my-3">Last Name:</h5> </v-flex> <v-flex xs8> <h5 class="my-3 left" >{{ editedItem.name }}</h5> </v-flex> </v-layout> <v-layout> <v-flex xs4 > <h5 class="right">Email:</h5> </v-flex> <v-flex xs8> <h5 class="left">{{ editedItem.email }}</h5> </v-flex> </v-layout> </v-flex> </v-layout> </v-container> |
04e3fbc56
|
135 |
</v-card-text> |
250d1e021
|
136 |
</v-card> |
03dcbf0c1
|
137 |
<!-- PROVIDER DATA TABLE PROVIDER DEATILS --> |
04e3fbc56
|
138 |
</v-dialog> |
269061695
|
139 140 141 142 |
<v-data-table :headers="headers" :items="desserts" :search="search" |
8fc85e8ec
|
143 |
class="elevation-1" |
5ac5570a9
|
144 |
:pagination.sync="pagination" |
269061695
|
145 |
> |
03dcbf0c1
|
146 147 148 149 150 151 152 153 154 155 156 157 158 159 |
<template slot="items" slot-scope="props"> <v-snackbar :timeout="timeout" :top="y === 'top'" :right="x === 'right'" :vertical="mode === 'vertical'" v-model="statussnackbar" color="success" >{{ text }}</v-snackbar> <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> <td id="td" class="text-xs-center"> <v-flex xs12 sm12> |
c1fd43e24
|
160 |
<v-select |
03dcbf0c1
|
161 162 |
:items="statusList" @change="changeswitch(props.item)" |
c1fd43e24
|
163 164 |
v-model="props.item.e1" menu-props="auto" |
03dcbf0c1
|
165 |
:label="props.item.verified" |
c1fd43e24
|
166 167 168 169 170 |
hide-details single-line ></v-select> </v-flex> </td> |
4413a8d93
|
171 |
<td class="text-xs-center"> |
269061695
|
172 |
<span> |
4413a8d93
|
173 174 |
<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"/> |
03dcbf0c1
|
175 |
<img style="cursor:pointer; height:20px; " class="mr-5" @click="deleteItem(props.item)" src="/static/icon/delete1.png"/> |
269061695
|
176 177 178 179 180 |
</span> </td> </template> </v-data-table> |
04e3fbc56
|
181 182 183 |
</v-card> </v-flex> |
03dcbf0c1
|
184 |
<!-- </v-container> --> |
93a68cfa1
|
185 186 |
</template> <script> |
03dcbf0c1
|
187 |
import http from '@/Services/http.js'; |
93a68cfa1
|
188 189 |
export default { data: () => ({ |
03dcbf0c1
|
190 191 192 193 194 195 196 |
snackbar: false, statussnackbar:false, y: "top", x: "right", mode: "", timeout: 3000, text: "", |
09f34e0c8
|
197 |
valid: '', |
03dcbf0c1
|
198 |
modaledit:false, |
93a68cfa1
|
199 200 |
dialog: false, dialog1: false, |
03dcbf0c1
|
201 |
statusList: ["APPROVED","DECLINED"], |
93a68cfa1
|
202 |
search: '', |
04e3fbc56
|
203 |
e1: '', |
c35a8dafd
|
204 205 206 207 |
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' }, |
e2e46164f
|
208 |
nameRules: [v => !!v || ' First Name is required'], |
03dcbf0c1
|
209 |
// lnameRules: [v => !!v || ' Last Name is required'], |
e2e46164f
|
210 211 212 213 |
emailRules: [ v => !!v || 'E-mail is required', v => /.+@.+/.test(v) || 'E-mail must be valid' ], |
5ac5570a9
|
214 |
pagination: { |
03dcbf0c1
|
215 |
rowsPerPage: 13, |
5ac5570a9
|
216 217 |
}, |
93a68cfa1
|
218 |
headers: [ |
269061695
|
219 |
{ |
93a68cfa1
|
220 |
text: 'No', |
e2e46164f
|
221 |
align: 'center', |
93a68cfa1
|
222 |
sortable: false, |
07095d4d8
|
223 |
value: 'no' |
93a68cfa1
|
224 |
}, |
03dcbf0c1
|
225 226 227 |
{ text: 'Name', value: 'name', sortable: false, align: 'center' }, { text: 'Email', value: 'email', sortable: false, align: 'center' }, { text: 'Status', value: 'verified', sortable: false, align: 'center' }, |
93a68cfa1
|
228 229 230 231 232 233 234 |
{ text: '', value: '', sortable: false }, ], desserts: [], editedIndex: -1, editedItem: { No: '', |
c35a8dafd
|
235 |
Name: '', |
03dcbf0c1
|
236 |
lastname: '', |
93a68cfa1
|
237 |
Email: '', |
03dcbf0c1
|
238 |
dob:'' |
93a68cfa1
|
239 240 241 |
}, defaultItem: { No: '', |
c35a8dafd
|
242 |
Name: '', |
03dcbf0c1
|
243 |
lastname: '', |
93a68cfa1
|
244 |
Email: '', |
03dcbf0c1
|
245 |
dob:'' |
93a68cfa1
|
246 247 |
}, }), |
93a68cfa1
|
248 249 250 251 252 253 254 255 256 |
watch: { dialog (val) { val || this.close(); } }, created () { this.initialize(); }, |
e173bab21
|
257 258 259 |
mounted(){ this.getProviderList(); }, |
93a68cfa1
|
260 |
methods: { |
e173bab21
|
261 |
getProviderList(){ |
03dcbf0c1
|
262 263 |
var token = this.$store.state.token http().get('/provider-list',{headers: {Authorization: 'Bearer '+ token}}) |
e173bab21
|
264 |
.then(response => { |
03dcbf0c1
|
265 |
this.desserts = response.data.data.providerList; |
e173bab21
|
266 267 268 269 |
}).catch(err => { console.log("err====>",err); }) }, |
93a68cfa1
|
270 |
initialize () { |
03dcbf0c1
|
271 |
this.desserts = []; |
93a68cfa1
|
272 273 274 275 276 277 278 |
}, editItem (item) { this.editedIndex = this.desserts.indexOf(item); this.editedItem = Object.assign({}, item); this.dialog = true; }, |
a259e694f
|
279 280 281 |
profile (item) { this.editedIndex = this.desserts.indexOf(item); this.editedItem = Object.assign({}, item); |
04e3fbc56
|
282 283 |
this.dialog1 = true; }, |
03dcbf0c1
|
284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 |
changeswitch(item){ let addStatus = { userId:item.userId, status:item.e1 }; http().post("/approve-decline", addStatus) .then(response => { if ((this.statussnackbar = true)) { this.text = "Successfully change your status is" + " " + item.e1; } this.getProviderList(); }) .catch(error => { console.log(error); }); }, |
93a68cfa1
|
300 |
deleteItem (item) { |
03dcbf0c1
|
301 302 303 304 305 306 307 308 309 310 311 312 313 |
let addUsers = { userId:item.userId }; http().post("/deleteProvider", addUsers) .then(response => { if ((this.snackbar = true)) { this.text = "Successfully delete Health Care Priovider"; } this.getProviderList(); }) .catch(error => { console.log(error); }); |
93a68cfa1
|
314 315 316 317 318 319 320 321 322 |
}, close () { this.dialog = false; setTimeout(() => { this.editedItem = Object.assign({}, this.defaultItem); this.editedIndex = -1; }, 300); }, |
04e3fbc56
|
323 324 325 |
close1 () { this.dialog1 = false; }, |
93a68cfa1
|
326 327 |
save () { |
03dcbf0c1
|
328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 |
let editUsers = { name: this.editedItem.name +this.editedItem.lastname, dob: this.editedItem.dob, email: this.editedItem.email, userId: this.editedItem.userId }; http().post("/provider-detail", editUsers) .then(response => { if ((this.snackbar = true)) { this.text = "Successfully Edit Health Care Priovider"; } this.getProviderList(); }) .catch(error => { console.log(error); }); this.close(); |
93a68cfa1
|
345 346 347 |
} }, }; |
04e3fbc56
|
348 349 350 351 352 353 |
</script> <style scoped> .v-card__actions .v-btn { margin: 0px; min-width: 120px; } |
269061695
|
354 355 |
#td { border: 1px solid #dddddd; |
269061695
|
356 357 |
padding: 8px; } |
03dcbf0c1
|
358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 |
#flex{ height: 300px; } .v-select_selctions.v-select_slot.v-select_selection{ color: black !important; } @media screen and (max-width:476px){ .flex.xs4 { flex-basis: 55.666667%; max-width: 71.666667%; } } @media screen and (max-width: 402px) { h5 { font-size: 13px; } /* .right{ float:none !important; } */ .left{ float:none !important; } } </style> |
789f8298f
|
384 |