|
@@ -12,22 +12,17 @@
|
12
|
12
|
</div>
|
13
|
13
|
<div class="row">
|
14
|
14
|
<div class="col-md-2 offset-1">
|
15
|
|
- <button
|
16
|
|
- @click="routerGoTo('/status/userManagementPage')"
|
17
|
|
- type="button"
|
18
|
|
- class="btn btn-b-n"
|
19
|
|
- >Private Users</button>
|
|
15
|
+ <button @click="routerGoTo('/status/userManagementPage')" type="button" class="btn btn-b-n">
|
|
16
|
+ Private Users
|
|
17
|
+ </button>
|
20
|
18
|
</div>
|
21
|
19
|
<div class="col-md-2 offset-2">
|
22
|
20
|
<button type="button" class="btn btn-b-n">Agents</button>
|
23
|
21
|
</div>
|
24
|
22
|
<div class="col-md-2 offset-2">
|
25
|
|
- <button
|
26
|
|
- type="button"
|
27
|
|
- class="btn btn-b-n"
|
28
|
|
- data-toggle="modal"
|
29
|
|
- :data-target="'#myModal' + i"
|
30
|
|
- >New Agent</button>
|
|
23
|
+ <button type="button" class="btn btn-b-n" data-toggle="modal" :data-target="'#myModal' + i">
|
|
24
|
+ New Agent
|
|
25
|
+ </button>
|
31
|
26
|
<div :id="'myModal' + i" class="modal fade" role="dialog">
|
32
|
27
|
<div class="modal-dialog modal-lg">
|
33
|
28
|
<div class="modal-content">
|
|
@@ -61,43 +56,35 @@
|
61
|
56
|
</template>
|
62
|
57
|
|
63
|
58
|
<script>
|
64
|
|
-import { mapState, mapActions } from 'vuex';
|
65
|
|
-import axios from 'axios';
|
66
|
|
-import Agency from '../../user/registerAgencySection.vue';
|
|
59
|
+import { mapState, mapActions } from "vuex";
|
|
60
|
+import axios from "axios";
|
|
61
|
+import Agency from "../../user/registerAgencySection.vue";
|
67
|
62
|
// import alert from '../../shared/alert.vue';
|
68
|
|
-import ListView from '../../shared/listView.vue';
|
|
63
|
+import ListView from "../../shared/listView.vue";
|
69
|
64
|
|
70
|
65
|
export default {
|
71
|
|
- name: 'agentManagementPage',
|
|
66
|
+ name: "agentManagementPage",
|
72
|
67
|
components: {
|
73
|
68
|
ListView,
|
74
|
|
- Agency,
|
|
69
|
+ Agency
|
75
|
70
|
// alert,
|
76
|
71
|
},
|
77
|
72
|
props: {
|
78
|
|
- delete: Boolean,
|
|
73
|
+ delete: Boolean
|
79
|
74
|
},
|
80
|
75
|
data() {
|
81
|
76
|
return {
|
82
|
|
- columns: [
|
83
|
|
- 'id',
|
84
|
|
- 'name',
|
85
|
|
- 'surname',
|
86
|
|
- 'cellNumber',
|
87
|
|
- 'telephone',
|
88
|
|
- 'email',
|
89
|
|
- 'isDeleted',
|
90
|
|
- ],
|
91
|
|
- headers: ['', '', '', '', '', '', '', 'ResetPwd', 'Modify', 'Remove'],
|
92
|
|
- item: {},
|
|
77
|
+ columns: ["id", "name", "surname", "cellNumber", "telephone", "email", "isDeleted"],
|
|
78
|
+ headers: ["", "", "", "", "", "", "", "ResetPwd", "Modify", "Remove"],
|
|
79
|
+ item: {}
|
93
|
80
|
};
|
94
|
81
|
},
|
95
|
82
|
methods: {
|
96
|
|
- ...mapActions('register', ['getAgents', 'deleteAgent']),
|
|
83
|
+ ...mapActions("register", ["getAgents", "deleteAgent"]),
|
97
|
84
|
addNewAgent({ commit }) {
|
98
|
85
|
axios
|
99
|
|
- .post('/api/agent')
|
100
|
|
- .then(result => commit('saveAgent', result.data))
|
|
86
|
+ .post("/api/agent")
|
|
87
|
+ .then(result => commit("saveAgent", result.data))
|
101
|
88
|
.catch(console.error);
|
102
|
89
|
},
|
103
|
90
|
routerGoTo(goTo) {
|
|
@@ -105,20 +92,20 @@ export default {
|
105
|
92
|
},
|
106
|
93
|
Edit(item) {
|
107
|
94
|
this.$router.push({
|
108
|
|
- path: '/user/updateProfileInfo',
|
109
|
|
- query: { id: item.id },
|
|
95
|
+ path: "/user/updateProfileInfo",
|
|
96
|
+ query: { id: item.id }
|
110
|
97
|
});
|
111
|
98
|
},
|
112
|
99
|
Delete(item) {
|
113
|
100
|
this.deleteAgent(item.id);
|
114
|
|
- },
|
|
101
|
+ }
|
115
|
102
|
},
|
116
|
103
|
mounted() {
|
117
|
104
|
this.getAgents();
|
118
|
105
|
},
|
119
|
106
|
computed: {
|
120
|
|
- ...mapState('register', ['agents', 'removeAgent']),
|
121
|
|
- },
|
|
107
|
+ ...mapState("register", ["agents", "removeAgent"])
|
|
108
|
+ }
|
122
|
109
|
};
|
123
|
110
|
</script>
|
124
|
111
|
|