Browse Source

User & Agent Management

master
Lene Scholtz 5 years ago
parent
commit
55fc46231b

+ 25
- 12
src/components/admin/status/agentsUserManagementPage.vue View File

25
         <button type="button" class="btn btn-b-n">New Agent</button>
25
         <button type="button" class="btn btn-b-n">New Agent</button>
26
       </div>
26
       </div>
27
     </div>
27
     </div>
28
-    <br />
29
-    <br />
30
     <div class="container">
28
     <div class="container">
31
       <div class="d-flex justify-content-between">
29
       <div class="d-flex justify-content-between">
32
         <div class="p-2">
30
         <div class="p-2">
33
           <input v-model="searchItem" class="form-control" placeholder="Search ..." />
31
           <input v-model="searchItem" class="form-control" placeholder="Search ..." />
34
         </div>
32
         </div>
35
       </div>
33
       </div>
34
+      <br />
36
       <table class="table table-bordered">
35
       <table class="table table-bordered">
37
         <thead>
36
         <thead>
37
+          <tr>
38
+            <td colspan="10">
39
+              <div class="myWell">
40
+                <h4>Agents</h4>
41
+              </div>
42
+            </td>
43
+          </tr>
38
           <tr>
44
           <tr>
39
             <th>
45
             <th>
40
               <b>ID</b>
46
               <b>ID</b>
65
           </tr>
71
           </tr>
66
         </thead>
72
         </thead>
67
         <tbody>
73
         <tbody>
68
-          <tr>
69
-            <td colspan="10">
70
-              <div class="myWell">
71
-                <h4>Agents</h4>
72
-              </div>
73
-            </td>
74
-          </tr>
75
-          <tr v-for="(item, i) in agents" :key="i">
74
+          <tr v-for="(item, i) in DisplayItems" :key="i">
76
             <td>{{ item.id }}</td>
75
             <td>{{ item.id }}</td>
77
             <td>{{ item.name }}</td>
76
             <td>{{ item.name }}</td>
78
             <td>{{ item.surname }}</td>
77
             <td>{{ item.surname }}</td>
85
             <td>
84
             <td>
86
               <button
85
               <button
87
                 type="button"
86
                 type="button"
88
-                @click="Edit(item)"
87
+                data-toggle="modal"
88
+                :data-target="'#myModal' + i"
89
                 class="btn"
89
                 class="btn"
90
                 style="margin:2px; color: #60CBEB"
90
                 style="margin:2px; color: #60CBEB"
91
               >Edit</button>
91
               >Edit</button>
92
+              <div :id="'myModal' + i" class="modal fade" role="dialog">
93
+                <div class="modal-dialog modal-lg">
94
+                  <div class="modal-content">
95
+                    <div class="modal-header">
96
+                      <button type="button" class="close" data-dismiss="modal">&times;</button>
97
+                    </div>
98
+                    <Agency name="Agency" :isAddAgent="false" :item="item" />
99
+                  </div>
100
+                </div>
101
+              </div>
92
             </td>
102
             </td>
93
             <td>
103
             <td>
94
               <button
104
               <button
123
 import _ from 'lodash';
133
 import _ from 'lodash';
124
 import ItemsPerPageList from '../../../assets/staticData/itemsPerPage';
134
 import ItemsPerPageList from '../../../assets/staticData/itemsPerPage';
125
 import BasePagination from '../../shared/basePagination.vue';
135
 import BasePagination from '../../shared/basePagination.vue';
136
+import Agency from '../../user/registerAgencySection.vue';
126
 
137
 
127
 export default {
138
 export default {
128
   name: 'agentManagementPage',
139
   name: 'agentManagementPage',
129
   components: {
140
   components: {
130
     BasePagination,
141
     BasePagination,
142
+    Agency,
131
   },
143
   },
132
   data() {
144
   data() {
133
     return {
145
     return {
137
       itemsPerPageList: ItemsPerPageList,
149
       itemsPerPageList: ItemsPerPageList,
138
       visibleItemsPerPageCount: 0,
150
       visibleItemsPerPageCount: 0,
139
       currentPage: 1,
151
       currentPage: 1,
152
+      item: {},
140
     };
153
     };
141
   },
154
   },
142
   methods: {
155
   methods: {
198
         : 1;
211
         : 1;
199
     },
212
     },
200
     FilteredItems() {
213
     FilteredItems() {
201
-      const list = _.filter(this.individuals, item => Object.values(item).some(
214
+      const list = _.filter(this.agents, item => Object.values(item).some(
202
           i => JSON.stringify(i)
215
           i => JSON.stringify(i)
203
               .toLowerCase()
216
               .toLowerCase()
204
               .indexOf(this.searchItem) > -1,
217
               .indexOf(this.searchItem) > -1,

+ 25
- 8
src/components/admin/status/userManagementPage.vue View File

28
           <input v-model="searchItem" class="form-control" placeholder="Search ..." />
28
           <input v-model="searchItem" class="form-control" placeholder="Search ..." />
29
         </div>
29
         </div>
30
       </div>
30
       </div>
31
+      <br />
31
       <table class="table table-bordered">
32
       <table class="table table-bordered">
32
         <thead>
33
         <thead>
34
+          <tr>
35
+            <td colspan="10">
36
+              <div class="myWell">
37
+                <h4>Private Users</h4>
38
+              </div>
39
+            </td>
40
+          </tr>
33
           <tr>
41
           <tr>
34
             <th>
42
             <th>
35
               <b>ID</b>
43
               <b>ID</b>
60
           </tr>
68
           </tr>
61
         </thead>
69
         </thead>
62
         <tbody>
70
         <tbody>
63
-          <tr>
64
-            <td colspan="10">
65
-              <div class="myWell">
66
-                <h4>Private Users</h4>
67
-              </div>
68
-            </td>
69
-          </tr>
70
           <tr v-for="(item, i) in DisplayItems" :key="i">
71
           <tr v-for="(item, i) in DisplayItems" :key="i">
71
             <td>{{ item.id }}</td>
72
             <td>{{ item.id }}</td>
72
             <td>{{ item.name }}</td>
73
             <td>{{ item.name }}</td>
80
             <td>
81
             <td>
81
               <button
82
               <button
82
                 type="button"
83
                 type="button"
83
-                @click="Edit(item)"
84
+                data-toggle="modal"
85
+                :data-target="'#myModal' + i"
84
                 class="btn"
86
                 class="btn"
85
                 style="margin:2px; color: #60CBEB"
87
                 style="margin:2px; color: #60CBEB"
86
               >Edit</button>
88
               >Edit</button>
89
+              <div :id="'myModal' + i" class="modal fade" role="dialog">
90
+                <div class="modal-dialog modal-lg">
91
+                  <div class="modal-content">
92
+                    <div class="modal-header">
93
+                      <button type="button" class="close" data-dismiss="modal">&times;</button>
94
+                    </div>
95
+                    <div padding-left="20px">
96
+                      <Individual name="PrivateIndividual" :isAddIndividual="false" :item="item" />
97
+                    </div>
98
+                  </div>
99
+                </div>
100
+              </div>
87
             </td>
101
             </td>
88
             <td>
102
             <td>
89
               <button type="button" class="btn" style="margin:2px; color: #60CBEB">Delete</button>
103
               <button type="button" class="btn" style="margin:2px; color: #60CBEB">Delete</button>
113
 import _ from 'lodash';
127
 import _ from 'lodash';
114
 import ItemsPerPageList from '../../../assets/staticData/itemsPerPage';
128
 import ItemsPerPageList from '../../../assets/staticData/itemsPerPage';
115
 import BasePagination from '../../shared/basePagination.vue';
129
 import BasePagination from '../../shared/basePagination.vue';
130
+import Individual from '../../user/registerPage.vue';
116
 
131
 
117
 export default {
132
 export default {
118
   name: 'userManagementPage',
133
   name: 'userManagementPage',
119
   components: {
134
   components: {
120
     BasePagination,
135
     BasePagination,
136
+    Individual,
121
   },
137
   },
122
   data() {
138
   data() {
123
     return {
139
     return {
127
       itemsPerPageList: ItemsPerPageList,
143
       itemsPerPageList: ItemsPerPageList,
128
       visibleItemsPerPageCount: 0,
144
       visibleItemsPerPageCount: 0,
129
       currentPage: 1,
145
       currentPage: 1,
146
+      item: {},
130
     };
147
     };
131
   },
148
   },
132
   methods: {
149
   methods: {

+ 7
- 8
src/components/user/registerAgencySection.vue View File

197
           <div class="form-group row"></div>
197
           <div class="form-group row"></div>
198
           <div class="row offset-md-1">
198
           <div class="row offset-md-1">
199
             <div class="col-md-2">
199
             <div class="col-md-2">
200
-              <button @click="SubmitData()" class="btn btn-b-n" type="button">Submit</button>
200
+              <button
201
+                @click="SubmitData()"
202
+                class="btn btn-b-n"
203
+                type="button"
204
+                data-dismiss="modal"
205
+              >Submit</button>
201
             </div>
206
             </div>
202
             <div class="col-md-2 offset-md-1">
207
             <div class="col-md-2 offset-md-1">
203
               <button
208
               <button
204
                 @click="Close(routerGoTo('/user/login'))"
209
                 @click="Close(routerGoTo('/user/login'))"
205
                 class="btn btn-b-n"
210
                 class="btn btn-b-n"
206
                 type="button"
211
                 type="button"
212
+                data-dismiss="modal"
207
               >Cancel</button>
213
               >Cancel</button>
208
             </div>
214
             </div>
209
           </div>
215
           </div>
215
 
221
 
216
 <script>
222
 <script>
217
 import { mapState, mapActions } from 'vuex';
223
 import { mapState, mapActions } from 'vuex';
218
-// import RegisterPage from './registerPage.vue';
219
 
224
 
220
 export default {
225
 export default {
221
-  // data() {
222
-  //   return {
223
-  //     RegisterHeader: 'Agency Administrator Details',
224
-  //   };
225
-  // },
226
   name: 'Agency',
226
   name: 'Agency',
227
-  // components: { RegisterPage },
228
   data() {
227
   data() {
229
     return {
228
     return {
230
       user: null,
229
       user: null,

+ 7
- 2
src/components/user/registerPage.vue View File

143
           <div class="form-group row"></div>
143
           <div class="form-group row"></div>
144
           <div class="row offset-md-1">
144
           <div class="row offset-md-1">
145
             <div class="col-md-2">
145
             <div class="col-md-2">
146
-              <button @click="SubmitData()" class="btn btn-b-n" type="submit">Submit</button>
146
+              <button
147
+                @click="SubmitData()"
148
+                class="btn btn-b-n"
149
+                type="submit"
150
+                data-dismiss="modal"
151
+              >Submit</button>
147
             </div>
152
             </div>
148
             <div class="col-md-2 offset-md-1">
153
             <div class="col-md-2 offset-md-1">
149
-              <button @click="Close()" class="btn btn-b-n" type="submit">Cancel</button>
154
+              <button @click="Close()" class="btn btn-b-n" type="submit" data-dismiss="modal">Cancel</button>
150
             </div>
155
             </div>
151
           </div>
156
           </div>
152
         </div>
157
         </div>

Loading…
Cancel
Save