Commit 945cc2d12909a8d8191f02ef0dff16e33e20fa8a
1 parent
5f2dd99ed8
Exists in
master
and in
3 other branches
somrthing changes & set session logout expire token
Showing
4 changed files
with
16 additions
and
61 deletions
Show diff stats
src/event.js
1 | export default [ | 1 | export default [ |
2 | { | 2 | { |
3 | name: 'APP_LOGIN_SUCCESS', | 3 | name: 'APP_LOGIN_SUCCESS', |
4 | callback: function (e) { | 4 | callback: function (e) { |
5 | this.$router.push({ path: 'dashboard' }); | 5 | this.$router.push({ path: 'dashboard' }); |
6 | } | 6 | } |
7 | }, | 7 | }, |
8 | { | 8 | { |
9 | name: 'APP_LOGOUT', | 9 | name: 'APP_LOGOUT', |
10 | callback: function (e) { | 10 | callback: function (e) { |
11 | this.snackbar = { | 11 | this.snackbar = { |
12 | show: true, | 12 | show: true, |
13 | color: 'green', | 13 | color: 'green', |
14 | text: 'Logout successfully.' | 14 | text: 'Logout successfully.' |
15 | }; | 15 | }; |
16 | this.$store.dispatch('setToken', null) | 16 | this.$store.dispatch('setToken', null) |
17 | this.$store.dispatch('setName', null) | 17 | this.$store.dispatch('setName', null) |
18 | |||
19 | this.$router.replace({ path: '/' }); | 18 | this.$router.replace({ path: '/' }); |
20 | } | 19 | } |
21 | }, | 20 | }, |
22 | { | 21 | { |
23 | name: 'APP_CHANGE', | 22 | name: 'APP_CHANGE', |
24 | callback: function (e) { | 23 | callback: function (e) { |
25 | this.snackbar = { | 24 | this.snackbar = { |
26 | show: true, | 25 | show: true, |
27 | color: 'green', | 26 | color: 'green', |
28 | text: 'Logout successfully.' | 27 | text: 'Logout successfully.' |
29 | }; | 28 | }; |
30 | this.$router.replace({ | 29 | this.$router.replace({ |
31 | path: '/' | 30 | path: '/' |
32 | }); | 31 | }); |
33 | } | 32 | } |
34 | }, | 33 | }, |
35 | { | 34 | { |
36 | name: 'APP_PAGE_LOADED', | 35 | name: 'APP_PAGE_LOADED', |
37 | callback: function (e) { | 36 | callback: function (e) { |
38 | } | 37 | } |
39 | }, | 38 | }, |
40 | { | 39 | { |
41 | name: 'APP_AUTH_FAILED', | 40 | name: 'APP_AUTH_FAILED', |
42 | callback: function (e) { | 41 | callback: function (e) { |
43 | this.$router.push('/login'); | 42 | this.$router.push('/login'); |
44 | this.$message.error('Token has expired'); | 43 | this.$message.error('Token has expired'); |
45 | } | 44 | } |
46 | }, | 45 | }, |
47 | { | 46 | { |
48 | name: 'APP_BAD_REQUEST', | 47 | name: 'APP_BAD_REQUEST', |
49 | // @error api response data | 48 | // @error api response data |
50 | callback: function (msg) { | 49 | callback: function (msg) { |
51 | this.$message.error(msg); | 50 | this.$message.error(msg); |
52 | } | 51 | } |
53 | }, | 52 | }, |
54 | { | 53 | { |
55 | name: 'APP_ACCESS_DENIED', | 54 | name: 'APP_ACCESS_DENIED', |
56 | // @error api response data | 55 | // @error api response data |
57 | callback: function (msg) { | 56 | callback: function (msg) { |
58 | this.$message.error(msg); | 57 | this.$message.error(msg); |
59 | this.$router.push('/forbidden'); | 58 | this.$router.push('/forbidden'); |
60 | } | 59 | } |
61 | }, | 60 | }, |
62 | { | 61 | { |
63 | name: 'APP_RESOURCE_DELETED', | 62 | name: 'APP_RESOURCE_DELETED', |
64 | // @error api response data | 63 | // @error api response data |
65 | callback: function (msg) { | 64 | callback: function (msg) { |
66 | this.$message.success(msg); | 65 | this.$message.success(msg); |
67 | } | 66 | } |
68 | }, | 67 | }, |
69 | { | 68 | { |
70 | name: 'APP_RESOURCE_UPDATED', | 69 | name: 'APP_RESOURCE_UPDATED', |
71 | // @error api response data | 70 | // @error api response data |
72 | callback: function (msg) { | 71 | callback: function (msg) { |
73 | this.$message.success(msg); | 72 | this.$message.success(msg); |
74 | } | 73 | } |
75 | }, | 74 | }, |
76 | 75 | ||
77 | ]; | 76 | ]; |
78 | 77 |
src/pages/Dashboard.vue
1 | <template> | 1 | <template> |
2 | <v-app id="pages-dasboard"> | 2 | <v-app id="pages-dasboard"> |
3 | <v-toolbar | 3 | <v-toolbar |
4 | color="grey" | 4 | color="grey" |
5 | fixed | 5 | fixed |
6 | app | 6 | app |
7 | > | 7 | > |
8 | <v-toolbar-title class="ml-0 pl-3"> | 8 | <v-toolbar-title class="ml-0 pl-3"> |
9 | <v-toolbar-side-icon @click.stop="handleDrawerToggle" class="hide"></v-toolbar-side-icon> | 9 | <v-toolbar-side-icon @click.stop="handleDrawerToggle" class="hide"></v-toolbar-side-icon> |
10 | </v-toolbar-title> | 10 | </v-toolbar-title> |
11 | <!-- SEARCH ALL EXISTING USERS --> | 11 | <!-- ****** SEARCH ALL EXISTING USERS ****** --> |
12 | <v-flex xs7 sm3 class="userSearch"> | 12 | <v-flex xs7 sm3 class="userSearch"> |
13 | <v-text-field | 13 | <v-text-field |
14 | flat | 14 | flat |
15 | prepend-icon="search" | 15 | prepend-icon="search" |
16 | label="Find your user" | 16 | label="Find your user" |
17 | v-model="term" | 17 | v-model="term" |
18 | color="black" | 18 | color="black" |
19 | @change="getPatientList" | 19 | @change="getPatientList" |
20 | > | 20 | > |
21 | </v-text-field> | 21 | </v-text-field> |
22 | </v-flex> | 22 | </v-flex> |
23 | <v-spacer></v-spacer> | 23 | <v-spacer></v-spacer> |
24 | <h5 class="white--text name"> {{ userName }} </h5> | 24 | <h5 class="white--text name"> {{ userName }} </h5> |
25 | <v-menu offset-y origin="center center" :nudge-bottom="10" transition="scale-transition"> | 25 | <v-menu offset-y origin="center center" :nudge-bottom="10" transition="scale-transition"> |
26 | <v-btn icon large flat slot="activator"> | 26 | <v-btn icon large flat slot="activator"> |
27 | <v-avatar size="40px"> | 27 | <v-avatar size="40px"> |
28 | <img src="/static/icon/user.png"/> | 28 | <img src="/static/icon/user.png"/> |
29 | </v-avatar> | 29 | </v-avatar> |
30 | </v-btn> | 30 | </v-btn> |
31 | <v-list class="pa-0"> | 31 | <v-list class="pa-0"> |
32 | <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"> | 32 | <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"> |
33 | <v-list-tile-action v-if="item.icon"> | 33 | <v-list-tile-action v-if="item.icon"> |
34 | <v-icon>{{ item.icon }}</v-icon> | 34 | <v-icon>{{ item.icon }}</v-icon> |
35 | </v-list-tile-action> | 35 | </v-list-tile-action> |
36 | <v-list-tile-content> | 36 | <v-list-tile-content> |
37 | <v-list-tile-title>{{ item.title }}</v-list-tile-title> | 37 | <v-list-tile-title>{{ item.title }}</v-list-tile-title> |
38 | </v-list-tile-content> | 38 | </v-list-tile-content> |
39 | </v-list-tile> | 39 | </v-list-tile> |
40 | </v-list> | 40 | </v-list> |
41 | </v-menu> | 41 | </v-menu> |
42 | </v-toolbar> | 42 | </v-toolbar> |
43 | <v-tabs grow slider-color="black"> | 43 | <v-tabs grow slider-color="black"> |
44 | <v-tab | 44 | <v-tab |
45 | ripple | 45 | ripple |
46 | @click="activeTab('existing')" | 46 | @click="activeTab('existing')" |
47 | v-bind:class="{ active: isActive }" | 47 | v-bind:class="{ active: isActive }" |
48 | id="tab" | 48 | id="tab" |
49 | class="subheading" | 49 | class="subheading" |
50 | >Existing User</v-tab> | 50 | >Existing User</v-tab> |
51 | <v-tab | 51 | <v-tab |
52 | ripple | 52 | ripple |
53 | @click="activeTab('new')" | 53 | @click="activeTab('new')" |
54 | v-bind:class="{ active: newActive }" | 54 | v-bind:class="{ active: newActive }" |
55 | id="tab1" | 55 | id="tab1" |
56 | class="subheading" | 56 | class="subheading" |
57 | >Add New Users</v-tab> | 57 | >Add New Users</v-tab> |
58 | <!-- EDIT USERS Patient Dtails--> | 58 | <!-- ****** EDIT USERS Patient Dtails ****** --> |
59 | <v-tab-item> | 59 | <v-tab-item> |
60 | <v-snackbar | 60 | <v-snackbar |
61 | :timeout="timeout" | 61 | :timeout="timeout" |
62 | :top="y === 'top'" | 62 | :top="y === 'top'" |
63 | :right="x === 'right'" | 63 | :right="x === 'right'" |
64 | :vertical="mode === 'vertical'" | 64 | :vertical="mode === 'vertical'" |
65 | v-model="snackbar" | 65 | v-model="snackbar" |
66 | color="success" | 66 | color="success" |
67 | >{{ text }}</v-snackbar> | 67 | >{{ text }}</v-snackbar> |
68 | <v-dialog v-model="dialog" max-width="500px"> | 68 | <v-dialog v-model="dialog" max-width="500px"> |
69 | <v-toolbar color="white"> | 69 | <v-toolbar color="white"> |
70 | <v-spacer></v-spacer> | 70 | <v-spacer></v-spacer> |
71 | <v-toolbar-title>Edit Profile</v-toolbar-title> | 71 | <v-toolbar-title>Edit Profile</v-toolbar-title> |
72 | <v-spacer></v-spacer> | 72 | <v-spacer></v-spacer> |
73 | </v-toolbar> | 73 | </v-toolbar> |
74 | <v-card> | 74 | <v-card> |
75 | <v-flex align-center justify-center layout text-xs-center> | 75 | <v-flex align-center justify-center layout text-xs-center> |
76 | <v-avatar size="50px" style="position:absolute; top:10px; "> | 76 | <v-avatar size="50px" style="position:absolute; top:10px; "> |
77 | <img src="/static/icon/user.png"> | 77 | <img src="/static/icon/user.png"> |
78 | </v-avatar> | 78 | </v-avatar> |
79 | </v-flex> | 79 | </v-flex> |
80 | <v-card-text> | 80 | <v-card-text> |
81 | <v-container> | 81 | <v-container> |
82 | <v-layout wrap justify-center> | 82 | <v-layout wrap justify-center> |
83 | <v-flex xs12 sm9> | 83 | <v-flex xs12 sm9> |
84 | <v-form ref="form" v-model="valid" lazy-validation> | 84 | <v-form ref="form" v-model="valid" lazy-validation> |
85 | <v-layout style="position:relative; top:15px;"> | 85 | <v-layout style="position:relative; top:15px;"> |
86 | <v-flex xs4 class="pt-4 subheading"> | 86 | <v-flex xs4 class="pt-4 subheading"> |
87 | <label>Full Name:</label> | 87 | <label>Full Name:</label> |
88 | </v-flex> | 88 | </v-flex> |
89 | <v-flex xs8> | 89 | <v-flex xs8> |
90 | <v-text-field | 90 | <v-text-field |
91 | v-model="editedItem.name" | 91 | v-model="editedItem.name" |
92 | v-validate="'required'" | 92 | v-validate="'required'" |
93 | :rules="nameRules" | 93 | :rules="nameRules" |
94 | data-vv-name="Name" | 94 | data-vv-name="Name" |
95 | required | 95 | required |
96 | ></v-text-field> | 96 | ></v-text-field> |
97 | </v-flex> | 97 | </v-flex> |
98 | </v-layout> | 98 | </v-layout> |
99 | <!-- <v-layout> | ||
100 | <v-flex xs4 class="pt-4 subheading"> | ||
101 | <label>Last Name:</label> | ||
102 | </v-flex> | ||
103 | <v-flex xs8> | ||
104 | <v-text-field | ||
105 | v-model="editedItem.lastname" | ||
106 | v-validate="'required'" | ||
107 | :rules="lastnameRules" | ||
108 | data-vv-name="Name" | ||
109 | required | ||
110 | ></v-text-field> | ||
111 | </v-flex> | ||
112 | </v-layout> --> | ||
113 | <v-layout> | 99 | <v-layout> |
114 | <v-flex xs4 class="pt-4 subheading"> | 100 | <v-flex xs4 class="pt-4 subheading"> |
115 | <label>Email ID:</label> | 101 | <label>Email ID:</label> |
116 | </v-flex> | 102 | </v-flex> |
117 | <v-flex xs8> | 103 | <v-flex xs8> |
118 | <v-text-field | 104 | <v-text-field |
119 | v-model="editedItem.email" | 105 | v-model="editedItem.email" |
120 | v-validate="'required|email'" | 106 | v-validate="'required|email'" |
121 | :rules="emailRules" | 107 | :rules="emailRules" |
122 | data-vv-name="E-mail" | 108 | data-vv-name="E-mail" |
123 | required | 109 | required |
124 | ></v-text-field> | 110 | ></v-text-field> |
125 | </v-flex> | 111 | </v-flex> |
126 | </v-layout> | 112 | </v-layout> |
127 | <v-layout> | 113 | <v-layout> |
128 | <v-flex xs4 class="pt-4 subheading"> | 114 | <v-flex xs4 class="pt-4 subheading"> |
129 | <label>Date of Birth:</label> | 115 | <label>Date of Birth:</label> |
130 | </v-flex> | 116 | </v-flex> |
131 | <v-flex xs8> | 117 | <v-flex xs8> |
132 | <v-menu | 118 | <v-menu |
133 | ref="menu1" | 119 | ref="menu1" |
134 | :close-on-content-click="false" | 120 | :close-on-content-click="false" |
135 | v-model="menu1" | 121 | v-model="menu1" |
136 | :nudge-right="40" | 122 | :nudge-right="40" |
137 | lazy | 123 | lazy |
138 | transition="scale-transition" | 124 | transition="scale-transition" |
139 | offset-y | 125 | offset-y |
140 | full-width | 126 | full-width |
141 | min-width="290px" | 127 | min-width="290px" |
142 | > | 128 | > |
143 | <v-text-field | 129 | <v-text-field |
144 | slot="activator" | 130 | slot="activator" |
145 | v-model="editedItem.dob" | 131 | v-model="editedItem.dob" |
146 | placeholder="Select date" | 132 | placeholder="Select date" |
147 | ></v-text-field> | 133 | ></v-text-field> |
148 | <v-date-picker | 134 | <v-date-picker |
149 | ref="picker" | 135 | ref="picker" |
150 | v-model="editedItem.dob" | 136 | v-model="editedItem.dob" |
151 | :max="new Date().toISOString().substr(0, 10)" | 137 | :max="new Date().toISOString().substr(0, 10)" |
152 | min="1950-01-01" | 138 | min="1950-01-01" |
153 | @input="menu1 = false" | 139 | @input="menu1 = false" |
154 | ></v-date-picker> | 140 | ></v-date-picker> |
155 | </v-menu> | 141 | </v-menu> |
156 | </v-flex> | 142 | </v-flex> |
157 | </v-layout> | 143 | </v-layout> |
158 | <v-card-actions> | 144 | <v-card-actions> |
159 | <v-btn round dark @click.native="close">Cancel</v-btn> | 145 | <v-btn round dark @click.native="close">Cancel</v-btn> |
160 | <v-spacer></v-spacer> | 146 | <v-spacer></v-spacer> |
161 | <v-btn round dark @click="save">Save</v-btn> | 147 | <v-btn round dark @click="save">Save</v-btn> |
162 | </v-card-actions> | 148 | </v-card-actions> |
163 | </v-form> | 149 | </v-form> |
164 | </v-flex> | 150 | </v-flex> |
165 | </v-layout> | 151 | </v-layout> |
166 | </v-container> | 152 | </v-container> |
167 | </v-card-text> | 153 | </v-card-text> |
168 | </v-card> | 154 | </v-card> |
169 | </v-dialog> | 155 | </v-dialog> |
170 | <!-- PROFILE VIEW pateints Details--> | 156 | <!-- ****** PROFILE VIEW pateints Details ****** --> |
171 | <v-dialog v-model="dialog1" max-width="600px"> | 157 | <v-dialog v-model="dialog1" max-width="600px"> |
172 | <v-toolbar color="white"> | 158 | <v-toolbar color="white"> |
173 | <v-spacer></v-spacer> | 159 | <v-spacer></v-spacer> |
174 | <v-toolbar-title>Profile</v-toolbar-title> | 160 | <v-toolbar-title>Profile</v-toolbar-title> |
175 | <v-spacer></v-spacer> | 161 | <v-spacer></v-spacer> |
176 | <v-icon @click="close1">close</v-icon> | 162 | <v-icon @click="close1">close</v-icon> |
177 | </v-toolbar> | 163 | </v-toolbar> |
178 | <v-card> | 164 | <v-card> |
179 | <v-flex align-center justify-center layout text-xs-center> | 165 | <v-flex align-center justify-center layout text-xs-center> |
180 | <v-avatar size="50px" style="position:absolute; top:20px;"> | 166 | <v-avatar size="50px" style="position:absolute; top:20px;"> |
181 | <img src="/static/icon/user.png"> | 167 | <img src="/static/icon/user.png"> |
182 | </v-avatar> | 168 | </v-avatar> |
183 | </v-flex> | 169 | </v-flex> |
184 | <v-card-text> | 170 | <v-card-text> |
185 | <v-container grid-list-md> | 171 | <v-container grid-list-md> |
186 | <v-layout wrap> | 172 | <v-layout wrap> |
187 | <v-flex><br><br> | 173 | <v-flex><br><br> |
188 | <v-layout> | 174 | <v-layout> |
189 | <v-flex xs5 sm6> | 175 | <v-flex xs5 sm6> |
190 | <h5 class="right">Full Name:</h5> | 176 | <h5 class="right">Full Name:</h5> |
191 | </v-flex> | 177 | </v-flex> |
192 | <v-flex sm6 xs8> | 178 | <v-flex sm6 xs8> |
193 | <h5>{{ editedItem.name }}</h5> | 179 | <h5>{{ editedItem.name }}</h5> |
194 | </v-flex> | 180 | </v-flex> |
195 | </v-layout> | 181 | </v-layout> |
196 | <!-- <v-layout> | ||
197 | <v-flex xs5 sm6> | ||
198 | <h5 class="right my-3">Last Name:</h5> | ||
199 | </v-flex> | ||
200 | <v-flex sm5 xs8> | ||
201 | <h5 class="my-3">{{ editedItem.name }}</h5> | ||
202 | </v-flex> | ||
203 | </v-layout> --> | ||
204 | <v-layout> | 182 | <v-layout> |
205 | <v-flex xs5 sm6> | 183 | <v-flex xs5 sm6> |
206 | <h5 class="right">Email:</h5> | 184 | <h5 class="right">Email:</h5> |
207 | </v-flex> | 185 | </v-flex> |
208 | <v-flex sm6 xs8> | 186 | <v-flex sm6 xs8> |
209 | <h5>{{ editedItem.email }}</h5> | 187 | <h5>{{ editedItem.email }}</h5> |
210 | </v-flex> | 188 | </v-flex> |
211 | </v-layout> | 189 | </v-layout> |
212 | <v-layout> | 190 | <v-layout> |
213 | <v-flex xs6 sm6 > | 191 | <v-flex xs6 sm6 > |
214 | <h5 class="right my-3">Date Of Birth:</h5> | 192 | <h5 class="right my-3">Date Of Birth:</h5> |
215 | </v-flex> | 193 | </v-flex> |
216 | <v-flex sm6 xs8> | 194 | <v-flex sm6 xs8> |
217 | <h5 class="my-3">{{ editedItem.dob }}</h5> | 195 | <h5 class="my-3">{{ editedItem.dob }}</h5> |
218 | </v-flex> | 196 | </v-flex> |
219 | </v-layout> | 197 | </v-layout> |
220 | </v-flex> | 198 | </v-flex> |
221 | </v-layout> | 199 | </v-layout> |
222 | </v-container> | 200 | </v-container> |
223 | </v-card-text> | 201 | </v-card-text> |
224 | </v-card> | 202 | </v-card> |
225 | </v-dialog> | 203 | </v-dialog> |
226 | 204 | ||
227 | <v-dialog v-model="dialog2" width="700px"> | 205 | <v-dialog v-model="dialog2" width="700px"> |
228 | <v-card> | 206 | <v-card> |
229 | <div id="dialog"> | 207 | <div id="dialog"> |
230 | <h4> | 208 | <h4> |
231 | <b>Report</b> | 209 | <b>Report</b> |
232 | </h4> | 210 | </h4> |
233 | <h5 id="name"> | 211 | <h5 id="name"> |
234 | <b>Patient Name:</b> | 212 | <b>Patient Name:</b> |
235 | {{ editedItem.name }} | 213 | {{ editedItem.name }} |
236 | </h5> | 214 | </h5> |
237 | <h5 id="m">Select Month:</h5> | 215 | <h5 id="m">Select Month:</h5> |
238 | <v-btn color="grey darken-3" id="G" v-on:click="component='report-generate'">Generate</v-btn> | 216 | <v-btn color="grey darken-3" id="G" v-on:click="component='report-generate'">Generate</v-btn> |
239 | <v-spacer></v-spacer> | 217 | <v-spacer></v-spacer> |
240 | <v-icon id="icon" @click="close2">close</v-icon> | 218 | <v-icon id="icon" @click="close2">close</v-icon> |
241 | 219 | ||
242 | <span id="bt"> | 220 | <span id="bt"> |
243 | <v-btn | 221 | <v-btn |
244 | color="grey darken-2" | 222 | color="grey darken-2" |
245 | v-on:click="component='one-month' , activebtn('existing')" | 223 | v-on:click="component='one-month' , activebtn('existing')" |
246 | v-bind:class="{ activebtn: isActivebtn }" | 224 | v-bind:class="{ activebtn: isActivebtn }" |
247 | flat | 225 | flat |
248 | >1 month</v-btn> | 226 | >1 month</v-btn> |
249 | <v-btn | 227 | <v-btn |
250 | color="grey darken-2" | 228 | color="grey darken-2" |
251 | v-on:click="component='three-month' , activebtn('new')" | 229 | v-on:click="component='three-month' , activebtn('new')" |
252 | v-bind:class="{ activebtn: Activebtn1 }" | 230 | v-bind:class="{ activebtn: Activebtn1 }" |
253 | flat | 231 | flat |
254 | >3 Month</v-btn> | 232 | >3 Month</v-btn> |
255 | <v-btn | 233 | <v-btn |
256 | color="grey darken-2" | 234 | color="grey darken-2" |
257 | v-on:click="component='six-month' , activebtn('new1')" | 235 | v-on:click="component='six-month' , activebtn('new1')" |
258 | v-bind:class="{ activebtn: Activebtn2 }" | 236 | v-bind:class="{ activebtn: Activebtn2 }" |
259 | flat | 237 | flat |
260 | >6 Month</v-btn> | 238 | >6 Month</v-btn> |
261 | <v-btn | 239 | <v-btn |
262 | color="grey darken-2" | 240 | color="grey darken-2" |
263 | v-on:click="component='nine-month' , activebtn('new2')" | 241 | v-on:click="component='nine-month' , activebtn('new2')" |
264 | v-bind:class="{ activebtn: Activebtn3 }" | 242 | v-bind:class="{ activebtn: Activebtn3 }" |
265 | flat | 243 | flat |
266 | >9 Month</v-btn> | 244 | >9 Month</v-btn> |
267 | <img id="e" @click="mail" src="/static/icon/email1.png"> | 245 | <img id="e" @click="mail" src="/static/icon/email1.png"> |
268 | <img id="d" @click="download" src="/static/icon/download1.png"> | 246 | <img id="d" @click="download" src="/static/icon/download1.png"> |
269 | </span> | 247 | </span> |
270 | <component v-bind:is="component"></component> | 248 | <component v-bind:is="component"></component> |
271 | </div> | 249 | </div> |
272 | </v-card> | 250 | </v-card> |
273 | </v-dialog> | 251 | </v-dialog> |
274 | <v-snackbar | 252 | <v-snackbar |
275 | :timeout="timeout" | 253 | :timeout="timeout" |
276 | :top="y === 'top'" | 254 | :top="y === 'top'" |
277 | :right="x === 'right'" | 255 | :right="x === 'right'" |
278 | :vertical="mode === 'vertical'" | 256 | :vertical="mode === 'vertical'" |
279 | v-model="snackbar" | 257 | v-model="snackbar" |
280 | color="success" | 258 | color="success" |
281 | >{{ text }}</v-snackbar> | 259 | >{{ text }}</v-snackbar> |
282 | <!-- EXISTING-USERS PatientList--> | 260 | <!-- ****** EXISTING-USERS PatientList Table ****** --> |
283 | <v-data-table | 261 | <v-data-table |
284 | :headers="headers" | 262 | :headers="headers" |
285 | :items="desserts" | 263 | :items="desserts" |
286 | :pagination.sync="pagination" | 264 | :pagination.sync="pagination" |
287 | > | 265 | > <!-- </v-content> |
266 | <v-footer class="pa-4" color="grey darken-2"> | ||
267 | |||
268 | </v-footer> --> | ||
288 | <template slot="items" slot-scope="props"> | 269 | <template slot="items" slot-scope="props"> |
289 | <td id="td" class="text-xs-center">{{ props.index}}</td> | 270 | <td id="td" class="text-xs-center">{{ props.index}}</td> |
290 | <td id="td" class="text-xs-center">{{ props.item.name}}</td> | 271 | <td id="td" class="text-xs-center">{{ props.item.name}}</td> |
291 | <td id="td" class="text-xs-center">{{ props.item.email }}</td> | 272 | <td id="td" class="text-xs-center">{{ props.item.email }}</td> |
292 | 273 | ||
293 | <td class="text-xs-center"> | 274 | <td class="text-xs-center"> |
294 | <span> | 275 | <span> |
295 | <img | 276 | <img |
296 | style="cursor:pointer; height:20px; " | 277 | style="cursor:pointer; height:20px; " |
297 | class="mr-5" | 278 | class="mr-5" |
298 | @click="report(props.item)" | 279 | @click="report(props.item)" |
299 | src="/static/icon/List1.png" | 280 | src="/static/icon/List1.png" |
300 | > | 281 | > |
301 | <img | 282 | <img |
302 | style="cursor:pointer; width:25px; height:18px; " | 283 | style="cursor:pointer; width:25px; height:18px; " |
303 | class="mr-5" | 284 | class="mr-5" |
304 | @click="profile(props.item)" | 285 | @click="profile(props.item)" |
305 | src="/static/icon/eye1.png" | 286 | src="/static/icon/eye1.png" |
306 | > | 287 | > |
307 | <img | 288 | <img |
308 | style="cursor:pointer; width:20px; height:18px; " | 289 | style="cursor:pointer; width:20px; height:18px; " |
309 | class="mr-5" | 290 | class="mr-5" |
310 | @click="editItem(props.item)" | 291 | @click="editItem(props.item)" |
311 | src="/static/icon/edit1.png" | 292 | src="/static/icon/edit1.png" |
312 | > | 293 | > |
313 | <img | 294 | <img |
314 | style="cursor:pointer; height:20px; " | 295 | style="cursor:pointer; height:20px; " |
315 | class="mr-5" | 296 | class="mr-5" |
316 | @click="deleteItem(props.item)" | 297 | @click="deleteItem(props.item)" |
317 | src="/static/icon/delete1.png" | 298 | src="/static/icon/delete1.png" |
318 | > | 299 | > |
319 | </span> | 300 | </span> |
320 | </td> | 301 | </td> |
321 | </template> | 302 | </template> |
322 | <v-alert | 303 | <v-alert |
323 | slot="no-results" | 304 | slot="no-results" |
324 | :value="true" | 305 | :value="true" |
325 | color="error" | 306 | color="error" |
326 | icon="warning" | 307 | icon="warning" |
327 | >Your search for "{{ term }}" found no results.</v-alert> | 308 | >Your search for "{{ term }}" found no results.</v-alert> |
328 | </v-data-table> | 309 | </v-data-table> |
329 | </v-tab-item> | 310 | </v-tab-item> |
330 | <!-- ADD USER PATIENT --> | 311 | <!-- ****** ADD USER PATIENT ****** --> |
331 | <v-tab-item> | 312 | <v-tab-item> |
332 | <v-container> | 313 | <v-container> |
333 | <v-snackbar | 314 | <v-snackbar |
334 | :timeout="timeout" | 315 | :timeout="timeout" |
335 | :top="y === 'top'" | 316 | :top="y === 'top'" |
336 | :right="x === 'right'" | 317 | :right="x === 'right'" |
337 | :vertical="mode === 'vertical'" | 318 | :vertical="mode === 'vertical'" |
338 | v-model="snackbar" | 319 | v-model="snackbar" |
339 | color="success" | 320 | color="success" |
340 | >{{ text }}</v-snackbar> | 321 | >{{ text }}</v-snackbar> |
341 | <v-flex xs12 sm8 offset-sm2 class="top"> | 322 | <v-flex xs12 sm8 offset-sm2 class="top"> |
342 | <v-card flat> | 323 | <v-card flat> |
343 | <v-container fluid fill-height> | 324 | <v-container fluid fill-height> |
344 | <v-layout align-center> | 325 | <v-layout align-center> |
345 | <v-flex xs12> | 326 | <v-flex xs12> |
346 | <v-flex offset-xs5> | 327 | <v-flex offset-xs5> |
347 | <v-avatar size="55px"> | 328 | <v-avatar size="55px"> |
348 | <img src="/static/icon/user.png"> | 329 | <img src="/static/icon/user.png"> |
349 | </v-avatar> | 330 | </v-avatar> |
350 | </v-flex> | 331 | </v-flex> |
351 | <v-form ref="form" v-model="valid" lazy-validation> | 332 | <v-form ref="form" v-model="valid" lazy-validation> |
352 | <v-layout> | 333 | <v-layout> |
353 | <v-flex xs4 class="pt-4 subheading"> | 334 | <v-flex xs4 class="pt-4 subheading"> |
354 | <label class="right">Full Name:</label> | 335 | <label class="right">Full Name:</label> |
355 | </v-flex> | 336 | </v-flex> |
356 | <v-flex xs6 class="ml-3"> | 337 | <v-flex xs6 class="ml-3"> |
357 | <v-text-field | 338 | <v-text-field |
358 | v-model="editedItem.name" | 339 | v-model="editedItem.name" |
359 | placeholder="fill your full Name" | 340 | placeholder="fill your full Name" |
360 | name="name" | 341 | name="name" |
361 | type="text" | 342 | type="text" |
362 | :rules="nameRules" | 343 | :rules="nameRules" |
363 | required | 344 | required |
364 | ></v-text-field> | 345 | ></v-text-field> |
365 | </v-flex> | 346 | </v-flex> |
366 | </v-layout> | 347 | </v-layout> |
367 | <!-- <v-layout> | ||
368 | <v-flex xs4 class="pt-4 subheading"> | ||
369 | <label class="right">Last Name:</label> | ||
370 | </v-flex> | ||
371 | <v-flex xs6 class="ml-3"> | ||
372 | <v-text-field | ||
373 | placeholder="fill your last Name" | ||
374 | :rules="lastnameRules" | ||
375 | v-model="editedItem.lastname" | ||
376 | type="text" | ||
377 | name="lastname" | ||
378 | required | ||
379 | ></v-text-field> | ||
380 | </v-flex> | ||
381 | </v-layout> --> | ||
382 | <v-layout> | 348 | <v-layout> |
383 | <v-flex xs4 class="pt-4 subheading"> | 349 | <v-flex xs4 class="pt-4 subheading"> |
384 | <label class="right">Country:</label> | 350 | <label class="right">Country:</label> |
385 | </v-flex> | 351 | </v-flex> |
386 | <v-flex xs6 class="ml-3"> | 352 | <v-flex xs6 class="ml-3"> |
387 | <!-- <v-text-field | ||
388 | placeholder="fill your country Name" | ||
389 | :rules="countryRules" | ||
390 | v-model="editedItem.country" | ||
391 | type="text" | ||
392 | name="country" | ||
393 | required | ||
394 | ></v-text-field> --> | ||
395 | <v-select | 353 | <v-select |
396 | v-model="editedItem.country" | 354 | v-model="editedItem.country" |
397 | :items="countries" | 355 | :items="countries" |
398 | label="Select Country" | 356 | label="Select Country" |
399 | single-line | 357 | single-line |
400 | ></v-select> | 358 | ></v-select> |
401 | </v-flex> | 359 | </v-flex> |
402 | </v-layout> | 360 | </v-layout> |
403 | <v-layout> | 361 | <v-layout> |
404 | <v-flex xs4 class="pt-4 subheading"> | 362 | <v-flex xs4 class="pt-4 subheading"> |
405 | <label class="right">Email ID:</label> | 363 | <label class="right">Email ID:</label> |
406 | </v-flex> | 364 | </v-flex> |
407 | <v-flex xs6 class="ml-3"> | 365 | <v-flex xs6 class="ml-3"> |
408 | <v-text-field | 366 | <v-text-field |
409 | placeholder="fill your email" | 367 | placeholder="fill your email" |
410 | :rules="emailRules" | 368 | :rules="emailRules" |
411 | v-model="editedItem.email" | 369 | v-model="editedItem.email" |
412 | type="text" | 370 | type="text" |
413 | name="email" | 371 | name="email" |
414 | required | 372 | required |
415 | ></v-text-field> | 373 | ></v-text-field> |
416 | </v-flex> | 374 | </v-flex> |
417 | </v-layout> | 375 | </v-layout> |
418 | <v-layout> | 376 | <v-layout> |
419 | <v-flex xs4 class="pt-4 subheading"> | 377 | <v-flex xs4 class="pt-4 subheading"> |
420 | <label class="right">Date of Birth:</label> | 378 | <label class="right">Date of Birth:</label> |
421 | </v-flex> | 379 | </v-flex> |
422 | <v-flex xs6 class="ml-3"> | 380 | <v-flex xs6 class="ml-3"> |
423 | <v-menu | 381 | <v-menu |
424 | ref="menu" | 382 | ref="menu" |
425 | :close-on-content-click="false" | 383 | :close-on-content-click="false" |
426 | v-model="menu" | 384 | v-model="menu" |
427 | :nudge-right="40" | 385 | :nudge-right="40" |
428 | lazy | 386 | lazy |
429 | transition="scale-transition" | 387 | transition="scale-transition" |
430 | offset-y | 388 | offset-y |
431 | full-width | 389 | full-width |
432 | min-width="290px" | 390 | min-width="290px" |
433 | > | 391 | > |
434 | <v-text-field | 392 | <v-text-field |
435 | slot="activator" | 393 | slot="activator" |
436 | v-model="editedItem.date" | 394 | v-model="editedItem.date" |
437 | placeholder="Select date" | 395 | placeholder="Select date" |
438 | ></v-text-field> | 396 | ></v-text-field> |
439 | <v-date-picker | 397 | <v-date-picker |
440 | ref="picker" | 398 | ref="picker" |
441 | v-model="editedItem.date" | 399 | v-model="editedItem.date" |
442 | :max="new Date().toISOString().substr(0, 10)" | 400 | :max="new Date().toISOString().substr(0, 10)" |
443 | min="1950-01-01" | 401 | min="1950-01-01" |
444 | @input="menu = false" | 402 | @input="menu = false" |
445 | ></v-date-picker> | 403 | ></v-date-picker> |
446 | </v-menu> | 404 | </v-menu> |
447 | </v-flex> | 405 | </v-flex> |
448 | </v-layout> | 406 | </v-layout> |
449 | <v-layout> | 407 | <v-layout> |
450 | <v-flex xs12 sm9 offset-sm2> | 408 | <v-flex xs12 sm9 offset-sm2> |
451 | <v-card-actions> | 409 | <v-card-actions> |
452 | <v-btn @click="clear" round dark>clear</v-btn> | 410 | <v-btn @click="clear" round dark>clear</v-btn> |
453 | <v-spacer></v-spacer> | 411 | <v-spacer></v-spacer> |
454 | <v-btn @click="submit" round dark :loading="loading">Add</v-btn> | 412 | <v-btn @click="submit" round dark :loading="loading">Add</v-btn> |
455 | </v-card-actions> | 413 | </v-card-actions> |
456 | </v-flex> | 414 | </v-flex> |
457 | </v-layout> | 415 | </v-layout> |
458 | </v-form> | 416 | </v-form> |
459 | </v-flex> | 417 | </v-flex> |
460 | </v-layout> | 418 | </v-layout> |
461 | </v-container> | 419 | </v-container> |
462 | </v-card> | 420 | </v-card> |
463 | </v-flex> | 421 | </v-flex> |
464 | </v-container> | 422 | </v-container> |
465 | </v-tab-item> | 423 | </v-tab-item> |
466 | </v-tabs> | 424 | </v-tabs> |
467 | </v-app> | 425 | </v-app> |
468 | </template> | 426 | </template> |
469 | 427 | ||
470 | <script> | 428 | <script> |
471 | // import AppToolbar from '@/components/AppToolbar'; | 429 | // import AppToolbar from '@/components/AppToolbar'; |
472 | import onemonth from "@/components/report/onemonth.vue"; | 430 | import onemonth from "@/components/report/onemonth.vue"; |
473 | import threemonth from "@/components/report/threemonth.vue"; | 431 | import threemonth from "@/components/report/threemonth.vue"; |
474 | import sixmonth from "@/components/report/sixmonth.vue"; | 432 | import sixmonth from "@/components/report/sixmonth.vue"; |
475 | import ninemonth from "@/components/report/ninemonth.vue"; | 433 | import ninemonth from "@/components/report/ninemonth.vue"; |
476 | import generatereport from "@/components/report/generatereport.vue"; | 434 | import generatereport from "@/components/report/generatereport.vue"; |
477 | import http from "@/Services/http.js"; | 435 | import http from "@/Services/http.js"; |
478 | import NotificationList from "@/components/widgets/list/NotificationList"; | 436 | import NotificationList from "@/components/widgets/list/NotificationList"; |
479 | import Util from "@/util"; | 437 | import Util from "@/util"; |
480 | 438 | ||
481 | export default { | 439 | export default { |
482 | components: { | 440 | components: { |
483 | "one-month": onemonth, | 441 | "one-month": onemonth, |
484 | "three-month": threemonth, | 442 | "three-month": threemonth, |
485 | "six-month": sixmonth, | 443 | "six-month": sixmonth, |
486 | "nine-month": ninemonth, | 444 | "nine-month": ninemonth, |
487 | "report-generate": generatereport, | 445 | "report-generate": generatereport, |
488 | }, | 446 | }, |
489 | data: () => ({ | 447 | data: () => ({ |
490 | component: "report-generate", | 448 | component: "report-generate", |
491 | snackbar: false, | 449 | snackbar: false, |
492 | y: "top", | 450 | y: "top", |
493 | x: "right", | 451 | x: "right", |
494 | mode: "", | 452 | mode: "", |
495 | timeout: 3000, | 453 | timeout: 3000, |
496 | text: "", | 454 | text: "", |
497 | loading: false, | 455 | loading: false, |
498 | date:null, | 456 | date:null, |
499 | term: "", | 457 | term: "", |
500 | modal: false, | 458 | modal: false, |
501 | modaledit:false, | 459 | modaledit:false, |
502 | menu: false, | 460 | menu: false, |
503 | menu1:false, | 461 | menu1:false, |
504 | dialog: false, | 462 | dialog: false, |
505 | dialog1: false, | 463 | dialog1: false, |
506 | dialog2: false, | 464 | dialog2: false, |
507 | valid: true, | 465 | valid: true, |
508 | isActive: true, | 466 | isActive: true, |
509 | newActive: false, | 467 | newActive: false, |
510 | isActivebtn: false, | 468 | isActivebtn: false, |
511 | Activebtn1: false, | 469 | Activebtn1: false, |
512 | Activebtn2: false, | 470 | Activebtn2: false, |
513 | Activebtn3: false, | 471 | Activebtn3: false, |
514 | loader: null, | 472 | loader: null, |
515 | loading: false, | 473 | loading: false, |
516 | loading2: false, | 474 | loading2: false, |
517 | loading3: false, | 475 | loading3: false, |
518 | loading4: false, | 476 | loading4: false, |
519 | details: [], | 477 | details: [], |
520 | countries:['US','Canada'], | 478 | countries:['US','Canada'], |
521 | AddUsercredentials: {}, | 479 | AddUsercredentials: {}, |
522 | pagination: { | 480 | pagination: { |
523 | rowsPerPage: 15 | 481 | rowsPerPage: 15 |
524 | }, | 482 | }, |
525 | rules: { | 483 | rules: { |
526 | required: value => !!value || "Date of Birth is Required.", | 484 | required: value => !!value || "Date of Birth is Required.", |
527 | min: v => | 485 | min: v => |
528 | (/^(0?[1-9]|[12][0-9]|3[01])[\/\-](0?[1-9]|1[012])[\/\-]\d{4}$/.test( | 486 | (/^(0?[1-9]|[12][0-9]|3[01])[\/\-](0?[1-9]|1[012])[\/\-]\d{4}$/.test( |
529 | v | 487 | v |
530 | ) && | 488 | ) && |
531 | v.length > 0) || | 489 | v.length > 0) || |
532 | "Please enter a date in the format dd/mm/yyyy" | 490 | "Please enter a date in the format dd/mm/yyyy" |
533 | }, | 491 | }, |
534 | nameRules: [v => !!v || " Full Name is required"], | 492 | nameRules: [v => !!v || " Full Name is required"], |
535 | emailRules: [ | 493 | emailRules: [ |
536 | v => !!v || "E-mail is required", | 494 | v => !!v || "E-mail is required", |
537 | v => /.+@.+/.test(v) || "E-mail must be valid" | 495 | v => /.+@.+/.test(v) || "E-mail must be valid" |
538 | ], | 496 | ], |
539 | countryRules: [v => !!v || " Country Name is required"], | 497 | countryRules: [v => !!v || " Country Name is required"], |
540 | headers: [ | 498 | headers: [ |
541 | { | 499 | { |
542 | text: "No", | 500 | text: "No", |
543 | align: "center", | 501 | align: "center", |
544 | sortable: false, | 502 | sortable: false, |
545 | value: "No" | 503 | value: "No" |
546 | }, | 504 | }, |
547 | { text: "Name", value: "name", sortable: false, align: "center" }, | 505 | { text: "Name", value: "name", sortable: false, align: "center" }, |
548 | { text: "Email", value: "email", sortable: false, align: "center" }, | 506 | { text: "Email", value: "email", sortable: false, align: "center" }, |
549 | { text: "", value: "", sortable: false, align: "center" } | 507 | { text: "", value: "", sortable: false, align: "center" } |
550 | ], | 508 | ], |
551 | desserts: [], | 509 | desserts: [], |
552 | editedIndex: -1, | 510 | editedIndex: -1, |
553 | editedItem: { | 511 | editedItem: { |
554 | No: "", | 512 | No: "", |
555 | name: "", | 513 | name: "", |
556 | email: "", | 514 | email: "", |
557 | date: null, | 515 | date: null, |
558 | country: "" | 516 | country: "" |
559 | }, | 517 | }, |
560 | defaultItem: { | 518 | defaultItem: { |
561 | No: "", | 519 | No: "", |
562 | name: "", | 520 | name: "", |
563 | email: "", | 521 | email: "", |
564 | date: null, | 522 | date: null, |
565 | dob: "" | 523 | dob: "" |
566 | }, | 524 | }, |
567 | userName:'', | 525 | userName:'', |
568 | items: [ | 526 | items: [ |
569 | { | 527 | { |
570 | href: "/changepassword", | 528 | href: "/changepassword", |
571 | title: "Change Password", | 529 | title: "Change Password", |
572 | click: e => { | 530 | click: e => { |
573 | console.log(e); | 531 | console.log(e); |
574 | } | 532 | } |
575 | }, | 533 | }, |
576 | { | 534 | { |
577 | href: "#", | 535 | href: "#", |
578 | title: "Logout", | 536 | title: "Logout", |
579 | click: e => { | 537 | click: e => { |
580 | window.getApp.$emit("APP_LOGOUT"); | 538 | window.getApp.$emit("APP_LOGOUT"); |
581 | } | 539 | } |
582 | } | 540 | } |
583 | ] | 541 | ] |
584 | }), | 542 | }), |
585 | watch: { | 543 | watch: { |
586 | menu (val) { | 544 | menu (val) { |
587 | val && this.$nextTick(() => (this.$refs.picker.activePicker = 'YEAR')) | 545 | val && this.$nextTick(() => (this.$refs.picker.activePicker = 'YEAR')) |
588 | }, | 546 | }, |
589 | menu1 (val) { | 547 | menu1 (val) { |
590 | val && this.$nextTick(() => (this.$refs.picker.activePicker = 'YEAR')) | 548 | val && this.$nextTick(() => (this.$refs.picker.activePicker = 'YEAR')) |
591 | } | 549 | } |
592 | }, | 550 | }, |
593 | methods: { | 551 | methods: { |
594 | save (date) { | 552 | save (date) { |
595 | this.$refs.menu.save(date) | 553 | this.$refs.menu.save(date) |
596 | }, | 554 | }, |
597 | getPatientList() { | 555 | getPatientList() { |
598 | var token = this.$store.state.token; | 556 | var token = this.$store.state.token; |
599 | http() | 557 | http() |
600 | .get("/patientList?term=" + this.term, { | 558 | .get("/patientList?term=" + this.term, { |
601 | headers: { Authorization: "Bearer " + token } | 559 | headers: { Authorization: "Bearer " + token } |
602 | }) | 560 | }) |
603 | .then(response => { | 561 | .then(response => { |
604 | this.desserts = response.data.data.existingUser; | 562 | this.desserts = response.data.data.existingUser; |
605 | }) | 563 | }) |
606 | .catch(err => { | 564 | .catch(err => { |
607 | console.log("err====>", err); | 565 | console.log("err====>", err); |
566 | this.$router.replace({ path: '/' }); | ||
608 | }); | 567 | }); |
609 | }, | 568 | }, |
610 | editItem(item) { | 569 | editItem(item) { |
611 | this.editedIndex = this.desserts.indexOf(item); | 570 | this.editedIndex = this.desserts.indexOf(item); |
612 | this.editedItem = Object.assign({}, item); | 571 | this.editedItem = Object.assign({}, item); |
613 | this.dialog = true; | 572 | this.dialog = true; |
614 | }, | 573 | }, |
615 | profile(item) { | 574 | profile(item) { |
616 | this.editedIndex = this.desserts.indexOf(item); | 575 | this.editedIndex = this.desserts.indexOf(item); |
617 | this.editedItem = Object.assign({}, item); | 576 | this.editedItem = Object.assign({}, item); |
618 | this.dialog1 = true; | 577 | this.dialog1 = true; |
619 | }, | 578 | }, |
620 | report(item) { | 579 | report(item) { |
621 | this.editedIndex = this.desserts.indexOf(item); | 580 | this.editedIndex = this.desserts.indexOf(item); |
622 | this.editedItem = Object.assign({}, item); | 581 | this.editedItem = Object.assign({}, item); |
623 | this.dialog2 = true; | 582 | this.dialog2 = true; |
624 | }, | 583 | }, |
625 | 584 | ||
626 | deleteItem(item) { | 585 | deleteItem(item) { |
627 | let addUsers = { | 586 | let addUsers = { |
628 | userId: item.userId | 587 | userId: item.userId |
629 | }; | 588 | }; |
630 | http() | 589 | http() |
631 | .post("/deletePatient", confirm('Are you sure you want to delete this?') && addUsers) | 590 | .post("/deletePatient", confirm('Are you sure you want to delete this?') && addUsers) |
632 | .then(response => { | 591 | .then(response => { |
633 | if ((this.snackbar = true)) { | 592 | if ((this.snackbar = true)) { |
634 | this.text = "Successfully delete Existing User"; | 593 | this.text = "Successfully delete Existing User"; |
635 | } | 594 | } |
636 | this.getPatientList(); | 595 | this.getPatientList(); |
637 | }) | 596 | }) |
638 | .catch(error => { | 597 | .catch(error => { |
639 | console.log(error); | 598 | console.log(error); |
640 | }); | 599 | }); |
641 | }, | 600 | }, |
642 | activeTab(type) { | 601 | activeTab(type) { |
643 | switch (type) { | 602 | switch (type) { |
644 | case "existing": | 603 | case "existing": |
645 | this.newActive = false; | 604 | this.newActive = false; |
646 | this.isActive = true; | 605 | this.isActive = true; |
647 | break; | 606 | break; |
648 | 607 | ||
649 | default: | 608 | default: |
650 | this.newActive = true; | 609 | this.newActive = true; |
651 | this.isActive = false; | 610 | this.isActive = false; |
652 | break; | 611 | break; |
653 | } | 612 | } |
654 | }, | 613 | }, |
655 | activebtn(type) { | 614 | activebtn(type) { |
656 | switch (type) { | 615 | switch (type) { |
657 | case "existing": | 616 | case "existing": |
658 | this.Activebtn3 = false; | 617 | this.Activebtn3 = false; |
659 | this.Activebtn2 = false; | 618 | this.Activebtn2 = false; |
660 | this.Activebtn1 = false; | 619 | this.Activebtn1 = false; |
661 | this.isActivebtn = true; | 620 | this.isActivebtn = true; |
662 | break; | 621 | break; |
663 | case "new": | 622 | case "new": |
664 | this.Activebtn3 = false; | 623 | this.Activebtn3 = false; |
665 | this.Activebtn2 = false; | 624 | this.Activebtn2 = false; |
666 | this.Activebtn1 = true; | 625 | this.Activebtn1 = true; |
667 | this.isActivebtn = false; | 626 | this.isActivebtn = false; |
668 | break; | 627 | break; |
669 | case "new1": | 628 | case "new1": |
670 | this.Activebtn3 = false; | 629 | this.Activebtn3 = false; |
671 | this.Activebtn2 = true; | 630 | this.Activebtn2 = true; |
672 | this.Activebtn1 = false; | 631 | this.Activebtn1 = false; |
673 | this.isActivebtn = false; | 632 | this.isActivebtn = false; |
674 | break; | 633 | break; |
675 | default: | 634 | default: |
676 | this.Activebtn3 = true; | 635 | this.Activebtn3 = true; |
677 | this.Activebtn2 = false; | 636 | this.Activebtn2 = false; |
678 | this.Activebtn1 = false; | 637 | this.Activebtn1 = false; |
679 | this.isActivebtn = false; | 638 | this.isActivebtn = false; |
680 | break; | 639 | break; |
681 | } | 640 | } |
682 | }, | 641 | }, |
683 | close() { | 642 | close() { |
684 | this.dialog = false; | 643 | this.dialog = false; |
685 | setTimeout(() => { | 644 | setTimeout(() => { |
686 | this.editedItem = Object.assign({}, this.defaultItem); | 645 | this.editedItem = Object.assign({}, this.defaultItem); |
687 | this.editedIndex = -1; | 646 | this.editedIndex = -1; |
688 | }, 300); | 647 | }, 300); |
689 | }, | 648 | }, |
690 | close1() { | 649 | close1() { |
691 | this.dialog1 = false; | 650 | this.dialog1 = false; |
692 | }, | 651 | }, |
693 | close2() { | 652 | close2() { |
694 | this.dialog2 = false; | 653 | this.dialog2 = false; |
695 | }, | 654 | }, |
696 | submit() { | 655 | submit() { |
697 | if (this.$refs.form.validate()) { | 656 | if (this.$refs.form.validate()) { |
698 | let addUsers = { | 657 | let addUsers = { |
699 | name: this.editedItem.name, | 658 | name: this.editedItem.name, |
700 | dob: this.editedItem.date, | 659 | dob: this.editedItem.date, |
701 | email: this.editedItem.email, | 660 | email: this.editedItem.email, |
702 | country: this.editedItem.country | 661 | country: this.editedItem.country |
703 | }; | 662 | }; |
704 | // console.log(addUsers) | 663 | // console.log(addUsers) |
705 | http() | 664 | http() |
706 | .post("/patient", addUsers) | 665 | .post("/patient", addUsers) |
707 | .then(response => { | 666 | .then(response => { |
708 | this.getPatientList(); | 667 | this.getPatientList(); |
709 | if (this.snackbar = true) { | 668 | if (this.snackbar = true) { |
710 | this.text = "Successfully Add New User"; | 669 | this.text = "New user added successfully"; |
711 | } | 670 | } |
712 | 671 | ||
713 | this.clear(); | 672 | this.clear(); |
714 | }) | 673 | }) |
715 | .catch(error => { | 674 | .catch(error => { |
716 | console.log(error); | 675 | console.log(error); |
717 | if (this.snackbar = true) { | 676 | if (this.snackbar = true) { |
718 | this.text = error.response.data.message; | 677 | this.text = error.response.data.message; |
719 | } | 678 | } |
720 | }); | 679 | }); |
721 | } | 680 | } |
722 | }, | 681 | }, |
723 | mail() { | 682 | mail() { |
724 | }, | 683 | }, |
725 | download() { | 684 | download() { |
726 | }, | 685 | }, |
727 | clear() { | 686 | clear() { |
728 | this.$refs.form.reset(); | 687 | this.$refs.form.reset(); |
729 | }, | 688 | }, |
730 | save() { | 689 | save() { |
731 | let editUsers = { | 690 | let editUsers = { |
732 | name: this.editedItem.name, | 691 | name: this.editedItem.name, |
733 | dob: this.editedItem.dob, | 692 | dob: this.editedItem.dob, |
734 | email: this.editedItem.email, | 693 | email: this.editedItem.email, |
735 | userId: this.editedItem.userId | 694 | userId: this.editedItem.userId |
736 | }; | 695 | }; |
737 | http() | 696 | http() |
738 | .post("/patientDetail", editUsers) | 697 | .post("/patientDetail", editUsers) |
739 | .then(response => { | 698 | .then(response => { |
740 | if ((this.snackbar = true)) { | 699 | if ((this.snackbar = true)) { |
741 | this.text = "Successfully Edit Existing User"; | 700 | this.text = "Successfully Edit Existing User"; |
742 | } | 701 | } |
743 | this.getPatientList(); | 702 | this.getPatientList(); |
744 | }) | 703 | }) |
745 | .catch(error => { | 704 | .catch(error => { |
746 | console.log(error); | 705 | console.log(error); |
747 | }); | 706 | }); |
748 | this.close(); | 707 | this.close(); |
749 | }, | 708 | }, |
750 | handleDrawerToggle() { | 709 | handleDrawerToggle() { |
751 | window.getApp.$emit("APP_DRAWER_TOGGLED"); | 710 | window.getApp.$emit("APP_DRAWER_TOGGLED"); |
752 | }, | 711 | }, |
753 | handleFullScreen() { | 712 | handleFullScreen() { |
754 | Util.toggleFullScreen(); | 713 | Util.toggleFullScreen(); |
755 | } | 714 | } |
756 | }, | 715 | }, |
757 | mounted() { | 716 | mounted() { |
758 | this.getPatientList(); | 717 | this.getPatientList(); |
759 | this.userName = this.$store.state.name; | 718 | this.userName = this.$store.state.name; |
760 | }, | 719 | }, |
761 | computed:{ | 720 | computed:{ |
762 | toolbarColor() { | 721 | toolbarColor() { |
763 | return this.$vuetify.options.extra.mainNav; | 722 | return this.$vuetify.options.extra.mainNav; |
764 | } | 723 | } |
765 | } | 724 | } |
766 | }; | 725 | }; |
767 | </script> | 726 | </script> |
768 | <style scoped> | 727 | <style scoped> |
769 | .v-tabs__div { | 728 | .v-tabs__div { |
770 | text-transform: none; | 729 | text-transform: none; |
771 | } | 730 | } |
772 | .v-input__prepend-outer { | 731 | .v-input__prepend-outer { |
773 | margin-right: 0px !important; | 732 | margin-right: 0px !important; |
774 | } | 733 | } |
775 | .v-card__actions .v-btn { | 734 | .v-card__actions .v-btn { |
776 | margin: 0 15px; | 735 | margin: 0 15px; |
777 | min-width: 120px; | 736 | min-width: 120px; |
778 | } | 737 | } |
779 | .primary { | 738 | .primary { |
780 | background-color: #aaa !important; | 739 | background-color: #aaa !important; |
781 | border-color: #aaa !important; | 740 | border-color: #aaa !important; |
782 | } | 741 | } |
783 | h4 { | 742 | h4 { |
784 | background-repeat: no-repeat; | 743 | background-repeat: no-repeat; |
785 | padding: 8px; | 744 | padding: 8px; |
786 | margin: auto; | 745 | margin: auto; |
787 | font-size: 25px; | 746 | font-size: 25px; |
788 | } | 747 | } |
789 | #name { | 748 | #name { |
790 | position: absolute; | 749 | position: absolute; |
791 | left: 100px; | 750 | left: 100px; |
792 | top: 17px; | 751 | top: 17px; |
793 | } | 752 | } |
794 | #icon { | 753 | #icon { |
795 | position: absolute; | 754 | position: absolute; |
796 | right: 8px; | 755 | right: 8px; |
797 | top: 8px; | 756 | top: 8px; |
798 | } | 757 | } |
799 | #m { | 758 | #m { |
800 | position: relative; | 759 | position: relative; |
801 | left: 135px; | 760 | left: 135px; |
802 | top: -15px; | 761 | top: -15px; |
803 | } | 762 | } |
804 | #G { | 763 | #G { |
805 | position: absolute; | 764 | position: absolute; |
806 | top: 38px; | 765 | top: 38px; |
807 | color: white; | 766 | color: white; |
808 | } | 767 | } |
809 | #bt { | 768 | #bt { |
810 | position: relative; | 769 | position: relative; |
811 | top: -20px; | 770 | top: -20px; |
812 | left: 115px; | 771 | left: 115px; |
813 | } | 772 | } |
814 | #e { | 773 | #e { |
815 | position: relative; | 774 | position: relative; |
816 | top: 5px; | 775 | top: 5px; |
817 | right: -30px; | 776 | right: -30px; |
818 | height: 17px; | 777 | height: 17px; |
819 | cursor: pointer; | 778 | cursor: pointer; |
820 | } | 779 | } |
821 | #d { | 780 | #d { |
822 | position: relative; | 781 | position: relative; |
823 | top: 5px; | 782 | top: 5px; |
824 | right: -70px; | 783 | right: -70px; |
825 | height: 17px; | 784 | height: 17px; |
826 | cursor: pointer; | 785 | cursor: pointer; |
827 | } | 786 | } |
828 | #td { | 787 | #td { |
829 | border: 1px solid #dddddd; | 788 | border: 1px solid #dddddd; |
830 | text-align: left; | 789 | text-align: left; |
831 | padding: 8px; | 790 | padding: 8px; |
832 | } | 791 | } |
833 | #dialog { | 792 | #dialog { |
834 | height: 550px; | 793 | height: 550px; |
835 | } | 794 | } |
836 | .active { | 795 | .active { |
837 | background-color: black; | 796 | background-color: black; |
838 | color: white !important; | 797 | color: white !important; |
839 | } | 798 | } |
840 | .activebtn { | 799 | .activebtn { |
841 | color: black !important; | 800 | color: black !important; |
842 | } | 801 | } |
843 | #flex { | 802 | #flex { |
844 | height: 300px; | 803 | height: 300px; |
845 | } | 804 | } |
846 | .top{ | 805 | .top{ |
847 | margin-top:100px; | 806 | margin-top:100px; |
848 | } | 807 | } |
849 | .v-tabs__item a{ | 808 | .v-tabs__item a{ |
850 | font-size:16px !important; | 809 | font-size:16px !important; |
851 | } | 810 | } |
852 | @media screen and (max-width: 769px){ | 811 | @media screen and (max-width: 769px){ |
853 | .top{ | 812 | .top{ |
854 | margin-top:0 !important; | 813 | margin-top:0 !important; |
855 | } | 814 | } |
856 | .userSearch .v-icon { | 815 | .userSearch .v-icon { |
857 | font-size: 20px !important; | 816 | font-size: 20px !important; |
858 | margin-left: 20px ; | 817 | margin-left: 20px ; |
859 | } | 818 | } |
860 | } | 819 | } |
861 | @media screen and (max-width: 380px) { | 820 | @media screen and (max-width: 380px) { |
862 | .right { | 821 | .right { |
863 | float: none !important; | 822 | float: none !important; |
864 | } | 823 | } |
865 | .subheading { | 824 | .subheading { |
866 | font-size: 14px !important; | 825 | font-size: 14px !important; |
867 | } | 826 | } |
868 | .v-card__actions .v-btn{ | 827 | .v-card__actions .v-btn{ |
869 | margin: 0 0px; | 828 | margin: 0 0px; |
870 | min-width: 100px; | 829 | min-width: 100px; |
871 | } | 830 | } |
872 | /* .searchIcon .v-icon { | 831 | /* .searchIcon .v-icon { |
873 | font-size: 20px; | 832 | font-size: 20px; |
874 | margin-left: 20px; | 833 | margin-left: 20px; |
875 | } */ | 834 | } */ |
876 | .subheading { | 835 | .subheading { |
877 | font-size: 12px !important; | 836 | font-size: 12px !important; |
878 | } | 837 | } |
879 | h5 { | 838 | h5 { |
880 | font-size: 13px; | 839 | font-size: 13px; |
881 | } | 840 | } |
882 | } | 841 | } |
883 | .v-icon{ | 842 | .v-icon{ |
884 | font-size:30px; | 843 | font-size:30px; |
885 | } | 844 | } |
886 | @media screen and (min-width: 1270px){ | 845 | @media screen and (min-width: 1270px){ |
887 | .hide{ | 846 | .hide{ |
888 | display: none; | 847 | display: none; |
889 | } | 848 | } |
890 | /* } | 849 | /* } |
891 | @media screen and (max-width: 962px) { | 850 | @media screen and (max-width: 962px) { |
892 | .imglogo{ | 851 | .imglogo{ |
893 | position: absolute; | 852 | position: absolute; |
894 | top: 13px; | 853 | top: 13px; |
895 | left: 13px !important; | 854 | left: 13px !important; |
896 | width: 70px; | 855 | width: 70px; |
897 | height: 24px; | 856 | height: 24px; |
898 | } */ | 857 | } */ |
899 | } | 858 | } |
900 | @media screen and (max-width: 420px){ | 859 | @media screen and (max-width: 420px){ |
901 | .userSearch .v-text-field .v-label{ | 860 | .userSearch .v-text-field .v-label{ |
902 | line-height: 24px !important; | 861 | line-height: 24px !important; |
903 | } | 862 | } |
904 | .userSearch .v-label{ | 863 | .userSearch .v-label{ |
905 | font-size: 13px !important; | 864 | font-size: 13px !important; |
906 | } | 865 | } |
907 | .v-list__tile { | 866 | .v-list__tile { |
908 | font-size:14px; | 867 | font-size:14px; |
909 | padding: 0 10px; | 868 | padding: 0 10px; |
910 | } | 869 | } |
911 | .name{ | 870 | .name{ |
src/pages/Provider.vue
1 | <template> | 1 | <template> |
2 | <v-flex xs12> | 2 | <v-flex xs12> |
3 | <app-toolbar class="app--toolbar"></app-toolbar> | 3 | <app-toolbar class="app--toolbar"></app-toolbar> |
4 | <v-card> | 4 | <v-card> |
5 | <v-card-title> | 5 | <v-card-title> |
6 | <v-flex xs12 lg2 md3 sm4> | 6 | <v-flex xs12 lg2 md3 sm4> |
7 | <h4 class="text-xs-center font-weight-medium">Healthcare Providers</h4> | 7 | <h4 class="text-xs-center font-weight-medium">Healthcare Providers</h4> |
8 | </v-flex> | 8 | </v-flex> |
9 | <v-spacer></v-spacer> | 9 | <v-spacer></v-spacer> |
10 | <!-- SEARCH ALL HEALTH PROVIDER --> | 10 | <!-- ****** SEARCH ALL HEALTH PROVIDER ****** --> |
11 | <v-flex xs12 sm4 lg3 class="top"> | 11 | <v-flex xs12 sm4 lg3 class="top"> |
12 | <v-text-field | 12 | <v-text-field |
13 | justify-right | 13 | justify-right |
14 | prepend-icon="search" | 14 | prepend-icon="search" |
15 | v-model="term" | 15 | v-model="term" |
16 | label="Find Yours Users" | 16 | label="Find Yours Users" |
17 | color="black" | 17 | color="black" |
18 | @change="getProviderList" | 18 | @change="getProviderList" |
19 | ></v-text-field> | 19 | ></v-text-field> |
20 | </v-flex> | 20 | </v-flex> |
21 | </v-card-title> | 21 | </v-card-title> |
22 | <!-- EDIT HEALTH PROVIDER --> | 22 | <!-- ****** EDIT HEALTH PROVIDER ****** --> |
23 | <v-snackbar | 23 | <v-snackbar |
24 | :timeout="timeout" | 24 | :timeout="timeout" |
25 | :top="y === 'top'" | 25 | :top="y === 'top'" |
26 | :right="x === 'right'" | 26 | :right="x === 'right'" |
27 | :vertical="mode === 'vertical'" | 27 | :vertical="mode === 'vertical'" |
28 | v-model="snackbar" | 28 | v-model="snackbar" |
29 | color="success" | 29 | color="success" |
30 | >{{ text }}</v-snackbar> | 30 | >{{ text }}</v-snackbar> |
31 | <v-dialog v-model="dialog" max-width="500px"> | 31 | <v-dialog v-model="dialog" max-width="500px"> |
32 | <v-toolbar color="white"> | 32 | <v-toolbar color="white"> |
33 | <v-spacer></v-spacer> | 33 | <v-spacer></v-spacer> |
34 | <v-toolbar-title>Edit Profile</v-toolbar-title> | 34 | <v-toolbar-title>Edit Profile</v-toolbar-title> |
35 | <v-spacer></v-spacer> | 35 | <v-spacer></v-spacer> |
36 | </v-toolbar> | 36 | </v-toolbar> |
37 | <v-card> | 37 | <v-card> |
38 | <v-flex align-center justify-center layout text-xs-center> | 38 | <v-flex align-center justify-center layout text-xs-center> |
39 | <v-avatar size="50px" style="position:absolute; top:10px; "> | 39 | <v-avatar size="50px" style="position:absolute; top:10px; "> |
40 | <img src="/static/icon/user.png"> | 40 | <img src="/static/icon/user.png"> |
41 | </v-avatar> | 41 | </v-avatar> |
42 | </v-flex> | 42 | </v-flex> |
43 | <v-card-text> | 43 | <v-card-text> |
44 | <v-container grid-list-md> | 44 | <v-container grid-list-md> |
45 | <v-layout wrap justify-center> | 45 | <v-layout wrap justify-center> |
46 | <v-flex xs12 sm9> | 46 | <v-flex xs12 sm9> |
47 | <v-form ref="form" v-model="valid" lazy-validation> | 47 | <v-form ref="form" v-model="valid" lazy-validation> |
48 | <v-layout style="position:relative; top:15px; "> | 48 | <v-layout style="position:relative; top:15px; "> |
49 | <v-flex xs4 class="pt-4 subheading"> | 49 | <v-flex xs4 class="pt-4 subheading"> |
50 | <label>First Name:</label> | 50 | <label>First Name:</label> |
51 | </v-flex> | 51 | </v-flex> |
52 | <v-flex xs8> | 52 | <v-flex xs8> |
53 | <v-text-field v-model="editedItem.name" :rules="nameRules" required></v-text-field> | 53 | <v-text-field v-model="editedItem.name" :rules="nameRules" required></v-text-field> |
54 | </v-flex> | 54 | </v-flex> |
55 | </v-layout> | 55 | </v-layout> |
56 | <v-layout> | 56 | <v-layout> |
57 | <v-flex xs4 class="pt-4 subheading"> | 57 | <v-flex xs4 class="pt-4 subheading"> |
58 | <label>Last Name:</label> | 58 | <label>Last Name:</label> |
59 | </v-flex> | 59 | </v-flex> |
60 | <v-flex xs8> | 60 | <v-flex xs8> |
61 | <v-text-field v-model="editedItem.lastname" required></v-text-field> | 61 | <v-text-field v-model="editedItem.lastname" required></v-text-field> |
62 | </v-flex> | 62 | </v-flex> |
63 | </v-layout> | 63 | </v-layout> |
64 | <v-layout> | 64 | <v-layout> |
65 | <v-flex xs4 class="pt-4 subheading"> | 65 | <v-flex xs4 class="pt-4 subheading"> |
66 | <label>Email ID:</label> | 66 | <label>Email ID:</label> |
67 | </v-flex> | 67 | </v-flex> |
68 | <v-flex xs8> | 68 | <v-flex xs8> |
69 | <v-text-field | 69 | <v-text-field |
70 | v-model="editedItem.email" | 70 | v-model="editedItem.email" |
71 | :rules="emailRules" | 71 | :rules="emailRules" |
72 | data-vv-name="E-mail" | 72 | data-vv-name="E-mail" |
73 | required | 73 | required |
74 | ></v-text-field> | 74 | ></v-text-field> |
75 | </v-flex> | 75 | </v-flex> |
76 | </v-layout> | 76 | </v-layout> |
77 | <v-card-actions> | 77 | <v-card-actions> |
78 | <v-btn round dark @click.native="close">Cancel</v-btn> | 78 | <v-btn round dark @click.native="close">Cancel</v-btn> |
79 | <v-spacer></v-spacer> | 79 | <v-spacer></v-spacer> |
80 | <v-btn round dark @click.native="save">Save</v-btn> | 80 | <v-btn round dark @click.native="save">Save</v-btn> |
81 | </v-card-actions> | 81 | </v-card-actions> |
82 | </v-form> | 82 | </v-form> |
83 | </v-flex> | 83 | </v-flex> |
84 | </v-layout> | 84 | </v-layout> |
85 | </v-container> | 85 | </v-container> |
86 | </v-card-text> | 86 | </v-card-text> |
87 | </v-card> | 87 | </v-card> |
88 | </v-dialog> | 88 | </v-dialog> |
89 | <!-- VIEW PROFILE OF PRVIDE LIST --> | 89 | <!-- *****VIEW PROFILE OF PRVIDE LIST ****** --> |
90 | <v-dialog v-model="dialog1" max-width="700px"> | 90 | <v-dialog v-model="dialog1" max-width="700px"> |
91 | <v-toolbar color="white"> | 91 | <v-toolbar color="white"> |
92 | <v-spacer></v-spacer> | 92 | <v-spacer></v-spacer> |
93 | <v-toolbar-title>Profile</v-toolbar-title> | 93 | <v-toolbar-title>Profile</v-toolbar-title> |
94 | <v-spacer></v-spacer> | 94 | <v-spacer></v-spacer> |
95 | <v-icon @click="close1">close</v-icon> | 95 | <v-icon @click="close1">close</v-icon> |
96 | </v-toolbar> | 96 | </v-toolbar> |
97 | <v-card> | 97 | <v-card> |
98 | <v-flex align-center justify-center layout text-xs-center> | 98 | <v-flex align-center justify-center layout text-xs-center> |
99 | <v-avatar size="60px" style="position:absolute; top:10px;"> | 99 | <v-avatar size="60px" style="position:absolute; top:10px;"> |
100 | <img src="/static/icon/user.png"> | 100 | <img src="/static/icon/user.png"> |
101 | </v-avatar> | 101 | </v-avatar> |
102 | </v-flex> | 102 | </v-flex> |
103 | <v-card-text> | 103 | <v-card-text> |
104 | <v-container grid-list-md> | 104 | <v-container grid-list-md> |
105 | <v-layout wrap justify-center> | 105 | <v-layout wrap justify-center> |
106 | <v-flex sm12 offset-sm3> | 106 | <v-flex sm12 offset-sm3> |
107 | <br> | 107 | <br> |
108 | <br> | 108 | <br> |
109 | <v-layout> | 109 | <v-layout> |
110 | <v-flex xs4> | 110 | <v-flex xs4> |
111 | <h5 class="right">First Name:</h5> | 111 | <h5 class="right">First Name:</h5> |
112 | </v-flex> | 112 | </v-flex> |
113 | <v-flex xs8> | 113 | <v-flex xs8> |
114 | <h5 class="left">{{ editedItem.name }}</h5> | 114 | <h5 class="left">{{ editedItem.name }}</h5> |
115 | </v-flex> | 115 | </v-flex> |
116 | </v-layout> | 116 | </v-layout> |
117 | <v-layout> | 117 | <v-layout> |
118 | <v-flex xs4> | 118 | <v-flex xs4> |
119 | <h5 class="right my-3">Last Name:</h5> | 119 | <h5 class="right my-3">Last Name:</h5> |
120 | </v-flex> | 120 | </v-flex> |
121 | <v-flex xs8> | 121 | <v-flex xs8> |
122 | <h5 class="my-3 left">{{ editedItem.name }}</h5> | 122 | <h5 class="my-3 left">{{ editedItem.name }}</h5> |
123 | </v-flex> | 123 | </v-flex> |
124 | </v-layout> | 124 | </v-layout> |
125 | <v-layout> | 125 | <v-layout> |
126 | <v-flex xs4> | 126 | <v-flex xs4> |
127 | <h5 class="right">Email:</h5> | 127 | <h5 class="right">Email:</h5> |
128 | </v-flex> | 128 | </v-flex> |
129 | <v-flex xs8> | 129 | <v-flex xs8> |
130 | <h5 class="left">{{ editedItem.email }}</h5> | 130 | <h5 class="left">{{ editedItem.email }}</h5> |
131 | </v-flex> | 131 | </v-flex> |
132 | </v-layout> | 132 | </v-layout> |
133 | </v-flex> | 133 | </v-flex> |
134 | </v-layout> | 134 | </v-layout> |
135 | </v-container> | 135 | </v-container> |
136 | </v-card-text> | 136 | </v-card-text> |
137 | </v-card> | 137 | </v-card> |
138 | <!-- PROVIDER DATA TABLE OF PROVIDER DEATILS --> | 138 | <!-- ****** PROVIDER DATA TABLE OF PROVIDER DEATILS ****** --> |
139 | </v-dialog> | 139 | </v-dialog> |
140 | <v-data-table | 140 | <v-data-table |
141 | :headers="headers" | 141 | :headers="headers" |
142 | :items="desserts" | 142 | :items="desserts" |
143 | class="elevation-1" | 143 | class="elevation-1" |
144 | :pagination.sync="pagination" | 144 | :pagination.sync="pagination" |
145 | > | 145 | > |
146 | <template slot="items" slot-scope="props"> | 146 | <template slot="items" slot-scope="props"> |
147 | <v-snackbar | 147 | <v-snackbar |
148 | :timeout="timeout" | 148 | :timeout="timeout" |
149 | :top="y === 'top'" | 149 | :top="y === 'top'" |
150 | :right="x === 'right'" | 150 | :right="x === 'right'" |
151 | :vertical="mode === 'vertical'" | 151 | :vertical="mode === 'vertical'" |
152 | v-model="statussnackbar" | 152 | v-model="statussnackbar" |
153 | color="success" | 153 | color="success" |
154 | >{{ text }}</v-snackbar> | 154 | >{{ text }}</v-snackbar> |
155 | <td id="td" class="text-xs-center">{{ props.index }}</td> | 155 | <td id="td" class="text-xs-center">{{ props.index }}</td> |
156 | <td id="td" class="text-xs-center">{{ props.item.name}}</td> | 156 | <td id="td" class="text-xs-center">{{ props.item.name}}</td> |
157 | <td id="td" class="text-xs-center">{{ props.item.email }}</td> | 157 | <td id="td" class="text-xs-center">{{ props.item.email }}</td> |
158 | <td id="td" class="text-xs-center"> | 158 | <td id="td" class="text-xs-center"> |
159 | <v-flex xs12 sm12> | 159 | <v-flex xs12 sm12> |
160 | <v-select | 160 | <v-select |
161 | :items="statusList" | 161 | :items="statusList" |
162 | @change="changeswitch(props.item)" | 162 | @change="changeswitch(props.item)" |
163 | v-model="props.item.e1" | 163 | v-model="props.item.e1" |
164 | menu-props="auto" | 164 | menu-props="auto" |
165 | :label="props.item.verified" | 165 | :label="props.item.verified" |
166 | hide-details | 166 | hide-details |
167 | single-line | 167 | single-line |
168 | ></v-select> | 168 | ></v-select> |
169 | </v-flex> | 169 | </v-flex> |
170 | </td> | 170 | </td> |
171 | <td class="text-xs-center"> | 171 | <td class="text-xs-center"> |
172 | <span> | 172 | <span> |
173 | <img | 173 | <img |
174 | style="cursor:pointer; width:25px; height:18px; " | 174 | style="cursor:pointer; width:25px; height:18px; " |
175 | class="mr-5" | 175 | class="mr-5" |
176 | @click="profile(props.item)" | 176 | @click="profile(props.item)" |
177 | src="/static/icon/eye1.png" | 177 | src="/static/icon/eye1.png" |
178 | > | 178 | > |
179 | <img | 179 | <img |
180 | style="cursor:pointer; width:20px; height:18px; " | 180 | style="cursor:pointer; width:20px; height:18px; " |
181 | class="mr-5" | 181 | class="mr-5" |
182 | @click="editItem(props.item)" | 182 | @click="editItem(props.item)" |
183 | src="/static/icon/edit1.png" | 183 | src="/static/icon/edit1.png" |
184 | > | 184 | > |
185 | <img | 185 | <img |
186 | style="cursor:pointer; height:20px; " | 186 | style="cursor:pointer; height:20px; " |
187 | class="mr-5" | 187 | class="mr-5" |
188 | @click="deleteItem(props.item)" | 188 | @click="deleteItem(props.item)" |
189 | src="/static/icon/delete1.png" | 189 | src="/static/icon/delete1.png" |
190 | > | 190 | > |
191 | </span> | 191 | </span> |
192 | </td> | 192 | </td> |
193 | </template> | 193 | </template> |
194 | <v-alert | 194 | <v-alert |
195 | slot="no-results" | 195 | slot="no-results" |
196 | :value="true" | 196 | :value="true" |
197 | color="error" | 197 | color="error" |
198 | icon="warning" | 198 | icon="warning" |
199 | >Your search for "{{ term }}" found no results.</v-alert> | 199 | >Your search for "{{ term }}" found no results.</v-alert> |
200 | </v-data-table> | 200 | </v-data-table> |
201 | </v-card> | 201 | </v-card> |
202 | </v-flex> | 202 | </v-flex> |
203 | </template> | 203 | </template> |
204 | <script> | 204 | <script> |
205 | import http from "@/Services/http.js"; | 205 | import http from "@/Services/http.js"; |
206 | import AppToolbar from '@/components/AppToolbar'; | 206 | import AppToolbar from '@/components/AppToolbar'; |
207 | 207 | ||
208 | 208 | ||
209 | export default { | 209 | export default { |
210 | components: { | 210 | components: { |
211 | AppToolbar, | 211 | AppToolbar, |
212 | }, | 212 | }, |
213 | data: () => ({ | 213 | data: () => ({ |
214 | snackbar: false, | 214 | snackbar: false, |
215 | statussnackbar: false, | 215 | statussnackbar: false, |
216 | y: "top", | 216 | y: "top", |
217 | x: "right", | 217 | x: "right", |
218 | mode: "", | 218 | mode: "", |
219 | timeout: 3000, | 219 | timeout: 3000, |
220 | text: "", | 220 | text: "", |
221 | valid: "", | 221 | valid: "", |
222 | modaledit: false, | 222 | modaledit: false, |
223 | dialog: false, | 223 | dialog: false, |
224 | dialog1: false, | 224 | dialog1: false, |
225 | statusList: ["APPROVED", "DECLINED"], | 225 | statusList: ["APPROVED", "DECLINED"], |
226 | term:'', | 226 | term:'', |
227 | e1: "", | 227 | e1: "", |
228 | rules: { | 228 | rules: { |
229 | required: value => !!value || "This field is Required.", | 229 | required: value => !!value || "This field is Required.", |
230 | min: v => | 230 | min: v => |
231 | (/^(0?[1-9]|[12][0-9]|3[01])[\/\-](0?[1-9]|1[012])[\/\-]\d{4}$/.test( | 231 | (/^(0?[1-9]|[12][0-9]|3[01])[\/\-](0?[1-9]|1[012])[\/\-]\d{4}$/.test( |
232 | v | 232 | v |
233 | ) && | 233 | ) && |
234 | v.length > 0) || | 234 | v.length > 0) || |
235 | "Please enter a date in the format dd/mm/yyyy" | 235 | "Please enter a date in the format dd/mm/yyyy" |
236 | }, | 236 | }, |
237 | nameRules: [v => !!v || " First Name is required"], | 237 | nameRules: [v => !!v || " First Name is required"], |
238 | // lnameRules: [v => !!v || ' Last Name is required'], | 238 | // lnameRules: [v => !!v || ' Last Name is required'], |
239 | emailRules: [ | 239 | emailRules: [ |
240 | v => !!v || "E-mail is required", | 240 | v => !!v || "E-mail is required", |
241 | v => /.+@.+/.test(v) || "E-mail must be valid" | 241 | v => /.+@.+/.test(v) || "E-mail must be valid" |
242 | ], | 242 | ], |
243 | pagination: { | 243 | pagination: { |
244 | rowsPerPage: 13 | 244 | rowsPerPage: 13 |
245 | }, | 245 | }, |
246 | headers: [ | 246 | headers: [ |
247 | { | 247 | { |
248 | text: "No", | 248 | text: "No", |
249 | align: "center", | 249 | align: "center", |
250 | sortable: false, | 250 | sortable: false, |
251 | value: "no" | 251 | value: "no" |
252 | }, | 252 | }, |
253 | { text: "Name", value: "name", sortable: false, align: "center" }, | 253 | { text: "Name", value: "name", sortable: false, align: "center" }, |
254 | { text: "Email", value: "email", sortable: false, align: "center" }, | 254 | { text: "Email", value: "email", sortable: false, align: "center" }, |
255 | { text: "Status", value: "verified", sortable: false, align: "center" }, | 255 | { text: "Status", value: "verified", sortable: false, align: "center" }, |
256 | { text: "", value: "", sortable: false } | 256 | { text: "", value: "", sortable: false } |
257 | ], | 257 | ], |
258 | desserts: [], | 258 | desserts: [], |
259 | editedIndex: -1, | 259 | editedIndex: -1, |
260 | editedItem: { | 260 | editedItem: { |
261 | No: "", | 261 | No: "", |
262 | Name: "", | 262 | Name: "", |
263 | lastname: "", | 263 | lastname: "", |
264 | Email: "", | 264 | Email: "", |
265 | dob: "" | 265 | dob: "" |
266 | }, | 266 | }, |
267 | defaultItem: { | 267 | defaultItem: { |
268 | No: "", | 268 | No: "", |
269 | Name: "", | 269 | Name: "", |
270 | lastname: "", | 270 | lastname: "", |
271 | Email: "", | 271 | Email: "", |
272 | dob: "" | 272 | dob: "" |
273 | } | 273 | } |
274 | }), | 274 | }), |
275 | watch: { | 275 | watch: { |
276 | dialog(val) { | 276 | dialog(val) { |
277 | val || this.close(); | 277 | val || this.close(); |
278 | } | 278 | } |
279 | }, | 279 | }, |
280 | 280 | ||
281 | created() { | 281 | created() { |
282 | this.initialize(); | 282 | this.initialize(); |
283 | }, | 283 | }, |
284 | mounted() { | 284 | mounted() { |
285 | this.getProviderList(); | 285 | this.getProviderList(); |
286 | }, | 286 | }, |
287 | methods: { | 287 | methods: { |
288 | getProviderList() { | 288 | getProviderList() { |
289 | var token = this.$store.state.token; | 289 | var token = this.$store.state.token; |
290 | http() | 290 | http() |
291 | .get("/provider-list?term=" + this.term, { | 291 | .get("/provider-list?term=" + this.term, { |
292 | headers: { Authorization: "Bearer " + token } | 292 | headers: { Authorization: "Bearer " + token } |
293 | }) | 293 | }) |
294 | .then(response => { | 294 | .then(response => { |
295 | this.desserts = response.data.data.providerList; | 295 | this.desserts = response.data.data.providerList; |
296 | }) | 296 | }) |
297 | .catch(err => { | 297 | .catch(err => { |
298 | console.log("err====>", err); | 298 | console.log("err====>", err); |
299 | this.$router.replace({ path: '/' }); | ||
299 | }); | 300 | }); |
300 | }, | 301 | }, |
301 | initialize() { | 302 | initialize() { |
302 | this.desserts = []; | 303 | this.desserts = []; |
303 | }, | 304 | }, |
304 | 305 | ||
305 | editItem(item) { | 306 | editItem(item) { |
306 | this.editedIndex = this.desserts.indexOf(item); | 307 | this.editedIndex = this.desserts.indexOf(item); |
307 | this.editedItem = Object.assign({}, item); | 308 | this.editedItem = Object.assign({}, item); |
308 | this.dialog = true; | 309 | this.dialog = true; |
309 | }, | 310 | }, |
310 | profile(item) { | 311 | profile(item) { |
311 | this.editedIndex = this.desserts.indexOf(item); | 312 | this.editedIndex = this.desserts.indexOf(item); |
312 | this.editedItem = Object.assign({}, item); | 313 | this.editedItem = Object.assign({}, item); |
313 | this.dialog1 = true; | 314 | this.dialog1 = true; |
314 | }, | 315 | }, |
315 | changeswitch(item) { | 316 | changeswitch(item) { |
316 | let addStatus = { | 317 | let addStatus = { |
317 | userId: item.userId, | 318 | userId: item.userId, |
318 | status: item.e1 | 319 | status: item.e1 |
319 | }; | 320 | }; |
320 | http() | 321 | http() |
321 | .post("/approve-decline", addStatus) | 322 | .post("/approve-decline", addStatus) |
322 | .then(response => { | 323 | .then(response => { |
323 | if ((this.statussnackbar = true)) { | 324 | if ((this.statussnackbar = true)) { |
324 | this.text = "Successfully change your status is" + " " + item.e1; | 325 | this.text = "Successfully change your status is" + " " + item.e1; |
325 | } | 326 | } |
326 | this.getProviderList(); | 327 | this.getProviderList(); |
327 | }) | 328 | }) |
328 | .catch(error => { | 329 | .catch(error => { |
329 | console.log(error); | 330 | console.log(error); |
330 | }); | 331 | }); |
331 | }, | 332 | }, |
332 | deleteItem(item) { | 333 | deleteItem(item) { |
333 | let addUsers = { | 334 | let addUsers = { |
334 | userId: item.userId | 335 | userId: item.userId |
335 | }; | 336 | }; |
336 | http() | 337 | http() |
337 | .post("/deleteProvider", confirm('Are you sure you want to delete this?') && addUsers) | 338 | .post("/deleteProvider", confirm('Are you sure you want to delete this?') && addUsers) |
338 | .then(response => { | 339 | .then(response => { |
339 | if ((this.snackbar = true)) { | 340 | if ((this.snackbar = true)) { |
340 | this.text = "Successfully delete Health Care Priovider"; | 341 | this.text = "Successfully delete Health Care Priovider"; |
341 | } | 342 | } |
342 | this.getProviderList(); | 343 | this.getProviderList(); |
343 | }) | 344 | }) |
344 | .catch(error => { | 345 | .catch(error => { |
345 | console.log(error); | 346 | console.log(error); |
346 | }); | 347 | }); |
347 | }, | 348 | }, |
348 | 349 | ||
349 | close() { | 350 | close() { |
350 | this.dialog = false; | 351 | this.dialog = false; |
351 | setTimeout(() => { | 352 | setTimeout(() => { |
352 | this.editedItem = Object.assign({}, this.defaultItem); | 353 | this.editedItem = Object.assign({}, this.defaultItem); |
353 | this.editedIndex = -1; | 354 | this.editedIndex = -1; |
354 | }, 300); | 355 | }, 300); |
355 | }, | 356 | }, |
356 | close1() { | 357 | close1() { |
357 | this.dialog1 = false; | 358 | this.dialog1 = false; |
358 | }, | 359 | }, |
359 | 360 | ||
360 | save() { | 361 | save() { |
361 | let editUsers = { | 362 | let editUsers = { |
362 | name: this.editedItem.name + " " + this.editedItem.lastname, | 363 | name: this.editedItem.name + " " + this.editedItem.lastname, |
363 | dob: this.editedItem.dob, | 364 | dob: this.editedItem.dob, |
364 | email: this.editedItem.email, | 365 | email: this.editedItem.email, |
365 | userId: this.editedItem.userId | 366 | userId: this.editedItem.userId |
366 | }; | 367 | }; |
367 | http() | 368 | http() |
368 | .post("/provider-detail", editUsers) | 369 | .post("/provider-detail", editUsers) |
369 | .then(response => { | 370 | .then(response => { |
370 | if ((this.snackbar = true)) { | 371 | if ((this.snackbar = true)) { |
371 | this.text = "Successfully Edit Health Care Priovider"; | 372 | this.text = "Successfully Edit Health Care Priovider"; |
372 | } | 373 | } |
373 | this.getProviderList(); | 374 | this.getProviderList(); |
374 | }) | 375 | }) |
375 | .catch(error => { | 376 | .catch(error => { |
376 | console.log(error); | 377 | console.log(error); |
377 | }); | 378 | }); |
378 | this.close(); | 379 | this.close(); |
379 | } | 380 | } |
380 | } | 381 | } |
381 | }; | 382 | }; |
382 | </script> | 383 | </script> |
383 | <style scoped> | 384 | <style scoped> |
384 | .v-card__actions .v-btn { | 385 | .v-card__actions .v-btn { |
385 | margin: 0px; | 386 | margin: 0px; |
386 | min-width: 120px; | 387 | min-width: 120px; |
387 | } | 388 | } |
388 | #td { | 389 | #td { |
389 | border: 1px solid #dddddd; | 390 | border: 1px solid #dddddd; |
390 | padding: 8px; | 391 | padding: 8px; |
391 | } | 392 | } |
392 | #flex { | 393 | #flex { |
393 | height: 300px; | 394 | height: 300px; |
394 | } | 395 | } |
395 | .v-select_selctions.v-select_slot.v-select_selection { | 396 | .v-select_selctions.v-select_slot.v-select_selection { |
396 | color: black !important; | 397 | color: black !important; |
397 | } | 398 | } |
398 | @media screen and (max-width: 769px){ | 399 | @media screen and (max-width: 769px){ |
399 | .top{ | 400 | .top{ |
400 | margin-top:30px; | 401 | margin-top:30px; |
401 | } | 402 | } |
402 | 403 | ||
403 | } | 404 | } |
404 | @media screen and (max-width: 476px) { | 405 | @media screen and (max-width: 476px) { |
405 | .flex.xs4 { | 406 | .flex.xs4 { |
406 | flex-basis: 55.666667%; | 407 | flex-basis: 55.666667%; |
407 | max-width: 71.666667%; | 408 | max-width: 71.666667%; |
408 | } | 409 | } |
409 | } | 410 | } |
410 | @media screen and (max-width: 402px) { | 411 | @media screen and (max-width: 402px) { |
411 | h5 { | 412 | h5 { |
412 | font-size: 13px; | 413 | font-size: 13px; |
413 | } | 414 | } |
414 | /* .right{ | 415 | /* .right{ |
415 | float:none !important; | 416 | float:none !important; |
416 | } */ | 417 | } */ |
417 | .left { | 418 | .left { |
418 | float: none !important; | 419 | float: none !important; |
419 | } | 420 | } |
420 | } | 421 | } |
421 | </style> | 422 | </style> |
422 | 423 | ||
423 | 424 | ||
424 | 425 | ||
425 | 426 |
src/pages/changepassword.vue
1 | <template> | 1 | <template> |
2 | <v-app id="login"> | 2 | <v-app id="login"> |
3 | <!-- <v-toolbar color="grey lighten"> | 3 | <!-- <v-toolbar color="grey lighten"> |
4 | <v-toolbar-items> | 4 | <v-toolbar-items> |
5 | <img src="/static/ana@2x.png" height="36" alt="ana"> | 5 | <img src="/static/ana@2x.png" height="36" alt="ana"> |
6 | </v-toolbar-items> | 6 | </v-toolbar-items> |
7 | </v-toolbar> --> | 7 | </v-toolbar> --> |
8 | <!-- <v-content> --> | 8 | <!-- <v-content> --> |
9 | <app-toolbar class="app--toolbar"></app-toolbar> | 9 | <app-toolbar class="app--toolbar"></app-toolbar> |
10 | <v-container fluid fill-height> | 10 | <v-container fluid fill-height> |
11 | <v-layout> | 11 | <v-layout> |
12 | <v-flex xs12 sm8 md8 lg5 offset-sm2 offset-lg3> | 12 | <v-flex xs12 sm8 md8 lg5 offset-sm2 offset-lg3> |
13 | <v-toolbar color="black" dark> | 13 | <v-toolbar color="black" dark> |
14 | <v-spacer></v-spacer> | 14 | <v-spacer></v-spacer> |
15 | <v-toolbar-title>Change Password</v-toolbar-title> | 15 | <v-toolbar-title>Change Password</v-toolbar-title> |
16 | <v-spacer></v-spacer> | 16 | <v-spacer></v-spacer> |
17 | 17 | ||
18 | </v-toolbar> | 18 | </v-toolbar> |
19 | <v-card class="elevation-1 pa-3" id="form"> | 19 | <v-card class="elevation-1 pa-3" id="form"> |
20 | <v-card-text> | 20 | <v-card-text> |
21 | <v-flex xs12 sm8 md8 lg8 offset-sm2> | 21 | <v-flex xs12 sm8 md8 lg8 offset-sm2> |
22 | <v-form class="mt-3" > | 22 | <v-form class="mt-3" > |
23 | <v-text-field | 23 | <v-text-field |
24 | :rules="[rules.required, rules.min]" | 24 | :rules="[rules.required, rules.min]" |
25 | 25 | ||
26 | v-model="adminChangePasswordcredentials.currentPassword" | 26 | v-model="adminChangePasswordcredentials.currentPassword" |
27 | label="Current Password"> | 27 | label="Current Password"> |
28 | </v-text-field> | 28 | </v-text-field> |
29 | <v-text-field | 29 | <v-text-field |
30 | v-model="adminChangePasswordcredentials.newPassword" | 30 | v-model="adminChangePasswordcredentials.newPassword" |
31 | :rules="[rules.required, rules.min]" | 31 | :rules="[rules.required, rules.min]" |
32 | 32 | ||
33 | label="New Password" | 33 | label="New Password" |
34 | ></v-text-field> | 34 | ></v-text-field> |
35 | <v-text-field | 35 | <v-text-field |
36 | v-model="adminChangePasswordcredentials.confirmPassword" | 36 | v-model="adminChangePasswordcredentials.confirmPassword" |
37 | :rules="[rules.required, rules.min]" | 37 | :rules="[rules.required, rules.min]" |
38 | label="Confirm Password" | 38 | label="Confirm Password" |
39 | ></v-text-field> | 39 | ></v-text-field> |
40 | </v-form></v-flex> | 40 | </v-form></v-flex> |
41 | </v-card-text> | 41 | </v-card-text> |
42 | <v-card-actions> | 42 | <v-card-actions> |
43 | 43 | ||
44 | <v-flex text-xs-center> | 44 | <v-flex text-xs-center> |
45 | <v-btn class="mt-3" | 45 | <v-btn class="mt-3" |
46 | round | 46 | round |
47 | color="black" | 47 | color="black" |
48 | dark large | 48 | dark large |
49 | :loading="loading" | 49 | :loading="loading" |
50 | @click="reset">Reset Password</v-btn></v-flex> | 50 | @click="reset">Reset Password</v-btn></v-flex> |
51 | </v-card-actions> | 51 | </v-card-actions> |
52 | <v-snackbar | 52 | <v-snackbar |
53 | :timeout="timeout" | 53 | :timeout="timeout" |
54 | :top="y === 'top'" | 54 | :top="y === 'top'" |
55 | :right="x === 'right'" | 55 | :right="x === 'right'" |
56 | :vertical="mode === 'vertical'" | 56 | :vertical="mode === 'vertical'" |
57 | v-model="snackbar" | 57 | v-model="snackbar" |
58 | :color= color | 58 | :color= color |
59 | > | 59 | > |
60 | {{ text }} | 60 | {{ text }} |
61 | </v-snackbar> | 61 | </v-snackbar> |
62 | </v-card> | 62 | </v-card> |
63 | </v-flex> | 63 | </v-flex> |
64 | </v-layout> | 64 | </v-layout> |
65 | </v-container> | 65 | </v-container> |
66 | <!-- </v-content> | ||
67 | <v-footer class="pa-4" color="grey darken-2"> | ||
68 | |||
69 | </v-footer> --> | ||
70 | </v-app> | 66 | </v-app> |
71 | </template> | 67 | </template> |
72 | <script> | 68 | <script> |
73 | import http from '@/Services/http.js'; | 69 | import http from '@/Services/http.js'; |
74 | import AppToolbar from '@/components/AppToolbar'; | 70 | import AppToolbar from '@/components/AppToolbar'; |
75 | 71 | ||
76 | export default { | 72 | export default { |
77 | components: { | 73 | components: { |
78 | AppToolbar, | 74 | AppToolbar, |
79 | }, | 75 | }, |
80 | data () { | 76 | data () { |
81 | return { | 77 | return { |
82 | snackbar: false, | 78 | snackbar: false, |
83 | y: 'top', | 79 | y: 'top', |
84 | x: 'right', | 80 | x: 'right', |
85 | mode: '', | 81 | mode: '', |
86 | timeout: 4000, | 82 | timeout: 4000, |
87 | text: '', | 83 | text: '', |
88 | adminChangePasswordcredentials: {}, | 84 | adminChangePasswordcredentials: {}, |
89 | e1: true, | 85 | e1: true, |
90 | e2: true, | 86 | e2: true, |
91 | e3: true, | 87 | e3: true, |
92 | loading: false, | 88 | loading: false, |
93 | valid: false, | 89 | valid: false, |
94 | text: 'Password Changed', | 90 | text: 'Password Changed', |
95 | currentPassword: '', | 91 | currentPassword: '', |
96 | newPassword: '', | 92 | newPassword: '', |
97 | confirmPassword: '', | 93 | confirmPassword: '', |
98 | rules: { | 94 | rules: { |
99 | required: value => !!value || 'This password field is Required.', | 95 | required: value => !!value || 'This password field is Required.', |
100 | min: v => (/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#$%^&*])(?=.{8,})/).test(v) && v.length >= 8 || 'Min 8 characters upper case lower case symbol required' | 96 | min: v => (/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#$%^&*])(?=.{8,})/).test(v) && v.length >= 8 || 'Min 8 characters upper case lower case symbol required' |
101 | }, | 97 | }, |
102 | }; | 98 | }; |
103 | }, | 99 | }, |
104 | methods: { | 100 | methods: { |
105 | reset () { | 101 | reset () { |
106 | var token = this.$store.state.token; | 102 | var token = this.$store.state.token; |
107 | var userdata = { | 103 | var userdata = { |
108 | "currentPassword":this.adminChangePasswordcredentials.currentPassword, | 104 | "currentPassword":this.adminChangePasswordcredentials.currentPassword, |
109 | "newPassword":this.adminChangePasswordcredentials.newPassword, | 105 | "newPassword":this.adminChangePasswordcredentials.newPassword, |
110 | "confirmPassword":this.adminChangePasswordcredentials.confirmPassword | 106 | "confirmPassword":this.adminChangePasswordcredentials.confirmPassword |
111 | } | 107 | } |
112 | http().post('/adminChangePassword',userdata,{headers: {Authorization: 'Bearer '+token}}) | 108 | http().post('/adminChangePassword',userdata,{headers: {Authorization: 'Bearer '+token}}) |
113 | .then(response => { | 109 | .then(response => { |
114 | this.loading = true; | 110 | this.loading = true; |
115 | if(this.snackbar=true){ | 111 | if(this.snackbar=true){ |
116 | this.text= "Successfully changed password !!" | 112 | this.text= "Successfully changed password !!" |
117 | console.log("snackbar",response.data.message) | 113 | console.log("snackbar",response.data.message) |
118 | } | 114 | } |
119 | setTimeout(() => { | 115 | setTimeout(() => { |
120 | this.$router.push('/dashboard'); | 116 | this.$router.push('/dashboard'); |
121 | }, 2000); | 117 | }, 2000); |
122 | }).catch(err => { | 118 | }).catch(err => { |
123 | // console.log("err====>",err); | 119 | // console.log("err====>",err); |
124 | this.text="User Not Found or Incorrect currentPassword" | 120 | this.text="User Not Found or Incorrect currentPassword" |
125 | this.snackbar= true; | 121 | this.snackbar= true; |
126 | this.loading = false; | 122 | this.loading = false; |
127 | }) | 123 | }) |
128 | } | 124 | } |
129 | }, | 125 | }, |
130 | computed:{ | 126 | computed:{ |
131 | color(){ | 127 | color(){ |
132 | return this.loading ? 'success' : 'error' | 128 | return this.loading ? 'success' : 'error' |
133 | } | 129 | } |
134 | } | 130 | } |
135 | }; | 131 | }; |
136 | </script> | 132 | </script> |
137 | <style scoped> | 133 | <style scoped> |
138 | img{ | 134 | img{ |
139 | position:absolute; | 135 | position:absolute; |
140 | top:13px; | 136 | top:13px; |
141 | left:50px; | 137 | left:50px; |
142 | } | 138 | } |
143 | .v-btn--large { | 139 | .v-btn--large { |
144 | padding: 0px 74px; | 140 | padding: 0px 74px; |
145 | } | 141 | } |
146 | @media screen and (max-width: 769px){ | 142 | @media screen and (max-width: 769px){ |
147 | .v-btn--large { | 143 | .v-btn--large { |
148 | font-size: 14px; | 144 | font-size: 14px; |
149 | height: 44px; | 145 | height: 44px; |
150 | padding: 0 32px; | 146 | padding: 0 32px; |
151 | 147 | ||
152 | } | 148 | } |
153 | } | 149 | } |
154 | </style> | 150 | </style> |
155 | 151 |