Просмотр исходного кода

User & Agent Management

master
Lene Scholtz 5 лет назад
Родитель
Сommit
55fc46231b

+ 25
- 12
src/components/admin/status/agentsUserManagementPage.vue Просмотреть файл

@@ -25,16 +25,22 @@
25 25
         <button type="button" class="btn btn-b-n">New Agent</button>
26 26
       </div>
27 27
     </div>
28
-    <br />
29
-    <br />
30 28
     <div class="container">
31 29
       <div class="d-flex justify-content-between">
32 30
         <div class="p-2">
33 31
           <input v-model="searchItem" class="form-control" placeholder="Search ..." />
34 32
         </div>
35 33
       </div>
34
+      <br />
36 35
       <table class="table table-bordered">
37 36
         <thead>
37
+          <tr>
38
+            <td colspan="10">
39
+              <div class="myWell">
40
+                <h4>Agents</h4>
41
+              </div>
42
+            </td>
43
+          </tr>
38 44
           <tr>
39 45
             <th>
40 46
               <b>ID</b>
@@ -65,14 +71,7 @@
65 71
           </tr>
66 72
         </thead>
67 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 75
             <td>{{ item.id }}</td>
77 76
             <td>{{ item.name }}</td>
78 77
             <td>{{ item.surname }}</td>
@@ -85,10 +84,21 @@
85 84
             <td>
86 85
               <button
87 86
                 type="button"
88
-                @click="Edit(item)"
87
+                data-toggle="modal"
88
+                :data-target="'#myModal' + i"
89 89
                 class="btn"
90 90
                 style="margin:2px; color: #60CBEB"
91 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 102
             </td>
93 103
             <td>
94 104
               <button
@@ -123,11 +133,13 @@ import axios from 'axios';
123 133
 import _ from 'lodash';
124 134
 import ItemsPerPageList from '../../../assets/staticData/itemsPerPage';
125 135
 import BasePagination from '../../shared/basePagination.vue';
136
+import Agency from '../../user/registerAgencySection.vue';
126 137
 
127 138
 export default {
128 139
   name: 'agentManagementPage',
129 140
   components: {
130 141
     BasePagination,
142
+    Agency,
131 143
   },
132 144
   data() {
133 145
     return {
@@ -137,6 +149,7 @@ export default {
137 149
       itemsPerPageList: ItemsPerPageList,
138 150
       visibleItemsPerPageCount: 0,
139 151
       currentPage: 1,
152
+      item: {},
140 153
     };
141 154
   },
142 155
   methods: {
@@ -198,7 +211,7 @@ export default {
198 211
         : 1;
199 212
     },
200 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 215
           i => JSON.stringify(i)
203 216
               .toLowerCase()
204 217
               .indexOf(this.searchItem) > -1,

+ 25
- 8
src/components/admin/status/userManagementPage.vue Просмотреть файл

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

+ 7
- 8
src/components/user/registerAgencySection.vue Просмотреть файл

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

+ 7
- 2
src/components/user/registerPage.vue Просмотреть файл

@@ -143,10 +143,15 @@
143 143
           <div class="form-group row"></div>
144 144
           <div class="row offset-md-1">
145 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 152
             </div>
148 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 155
             </div>
151 156
           </div>
152 157
         </div>

Загрузка…
Отмена
Сохранить