Browse Source

Merge Issues.

master
George Williams 5 years ago
parent
commit
f515343be6

+ 42
- 18
README.md View File

@@ -36,24 +36,48 @@ See [Configuration Reference](https://cli.vuejs.org/config/).
36 36
 
37 37
 ### Structure
38 38
 
39
-├── index.html
40
-├── main.js
41
-├── assets
42
-│ └── staticData
43
-│ ├── alertTypes.js
44
-│ ├── itemsPerPage.js
45
-│ ├── maritalStatus.js
46
-│  
47
-├── components
48
-│ ├── App.vue
49
-│ └── ...
50
-└── store
51
-├── index.js # where we assemble modules and export the store
52
-├── actions.js # root actions
53
-├── mutations.js # root mutations
54
-└── modules
55
-├── cart.js # cart module
56
-└── products.js # products module
39
+#### To Get All Classes
40
+
41
+http://localhost:57260/api/info/getAllClasses
42
+
43
+#### To Get Property from Class
44
+
45
+http://localhost:57260/api/info/UnivateProperties_API.Model.Users.User
46
+
47
+#### To Add Template
48
+
49
+http://localhost:57260/api/template
50
+{
51
+"Name": "WeekAuthorized",
52
+"Subject": "[Resort][unit] [Module]",
53
+"Body": "<h4>Dear [Username]</h4><p>Your week information has been confirmed.</p><p>Please log on to the Uni-Vate Website and publish your week.</p><p>This will allow all websites users to view your Week.</p><h4>Thank you</h4><h4><b>Uni-Vate Properties</b></h4>",
54
+"PlaceHolders": [
55
+{
56
+"Name": "[Resort]",
57
+"BoundTo": "ResortName",
58
+"BoundToClass": "UnivateProperties_API.Model.Timeshare.TimeshareWeek",
59
+"BoundToClassDisplay": "TimeshareWeek",
60
+},
61
+{
62
+"Name": "[Unit]",
63
+"BoundTo": "UnitNumber",
64
+"BoundToClass": "UnivateProperties_API.Model.Timeshare.TimeshareWeek",
65
+"BoundToClassDisplay": "TimeshareWeek",
66
+},
67
+{
68
+"Name": "[Module]",
69
+"BoundTo": "Module",
70
+"BoundToClass": "UnivateProperties_API.Model.Timeshare.TimeshareWeek",
71
+"BoundToClassDisplay": "TimeshareWeek",
72
+},
73
+{
74
+"Name": "[Username]",
75
+"BoundTo": "Username",
76
+"BoundToClass": "UnivateProperties_API.Model.Users.User",
77
+"BoundToClassDisplay": "User",
78
+}
79
+]
80
+}
57 81
 
58 82
 ### Tender Weeks
59 83
 

BIN
public/img/kloader.gif View File


BIN
public/img/loading.gif View File


+ 4
- 4
src/components/admin/property/propertyTypeList.vue View File

@@ -44,16 +44,16 @@
44 44
               <button
45 45
                 type="button"
46 46
                 @click="Edit(item.id)"
47
-                class="btn btn-b-n"
48
-                style="width: 85px; height:40px;"
47
+                class="btn"
48
+                style="margin:2px; color: #60CBEB"
49 49
               >Edit</button>
50 50
             </td>
51 51
             <td>
52 52
               <button
53 53
                 type="button"
54 54
                 @click="Delete(item.id)"
55
-                class="btn btn-b-n"
56
-                style="width: 85px; height:40px;"
55
+                class="btn"
56
+                style="margin:2px; color: #60CBEB"
57 57
               >Delete</button>
58 58
             </td>
59 59
           </tr>

+ 4
- 4
src/components/admin/property/userDefinedGroupPage.vue View File

@@ -120,16 +120,16 @@
120 120
                 <button
121 121
                   type="button"
122 122
                   @click="Edit(item)"
123
-                  class="btn btn-b-n"
124
-                  style="width: 85px; height:40px;"
123
+                  class="btn"
124
+                  style="margin:2px; color: #60CBEB"
125 125
                 >Edit</button>
126 126
               </td>
127 127
               <td>
128 128
                 <button
129 129
                   type="button"
130 130
                   @click="Delete(item)"
131
-                  class="btn btn-b-n"
132
-                  style="width: 85px; height:40px;"
131
+                  class="btn"
132
+                  style="margin:2px; color: #60CBEB"
133 133
                 >Delete</button>
134 134
               </td>
135 135
             </tr>

+ 4
- 4
src/components/admin/property/userDefinedGroupsPage.vue View File

@@ -43,16 +43,16 @@
43 43
               <button
44 44
                 type="button"
45 45
                 @click="Edit(item.id)"
46
-                class="btn btn-b-n"
47
-                style="width: 85px; height:40px;"
46
+                class="btn"
47
+                style="margin:2px; color: #60CBEB"
48 48
               >Edit</button>
49 49
             </td>
50 50
             <td>
51 51
               <button
52 52
                 type="button"
53 53
                 @click="Delete(item)"
54
-                class="btn btn-b-n"
55
-                style="width: 85px; height:40px;"
54
+                class="btn"
55
+                style="margin:2px; color: #60CBEB"
56 56
               >Delete</button>
57 57
             </td>
58 58
           </tr>

+ 241
- 0
src/components/admin/status/agentsUserManagementPage.vue View File

@@ -0,0 +1,241 @@
1
+<template>
2
+  <!-- eslint-disable max-len -->
3
+  <div class="container">
4
+    <br />
5
+    <br />
6
+    <div class="row">
7
+      <div class="col-md-12 col-lg-8">
8
+        <div class="title-box-d">
9
+          <h1 class="title-d" style="text-align:left; font-size: 250%">Agent Management</h1>
10
+        </div>
11
+      </div>
12
+    </div>
13
+    <div class="row">
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>
20
+      </div>
21
+      <div class="col-md-2 offset-2">
22
+        <button type="button" class="btn btn-b-n">Agents</button>
23
+      </div>
24
+      <div class="col-md-2 offset-2">
25
+        <button type="button" class="btn btn-b-n">New Agent</button>
26
+      </div>
27
+    </div>
28
+    <div class="container">
29
+      <div class="d-flex justify-content-between">
30
+        <div class="p-2">
31
+          <input v-model="searchItem" class="form-control" placeholder="Search ..." />
32
+        </div>
33
+      </div>
34
+      <br />
35
+      <table class="table table-bordered">
36
+        <thead>
37
+          <tr>
38
+            <td colspan="10">
39
+              <div class="myWell">
40
+                <h4>Agents</h4>
41
+              </div>
42
+            </td>
43
+          </tr>
44
+          <tr>
45
+            <th>
46
+              <b>ID</b>
47
+            </th>
48
+            <th>
49
+              <b>Name</b>
50
+            </th>
51
+            <th>
52
+              <b>Surname</b>
53
+            </th>
54
+            <th>
55
+              <b>Cell Number</b>
56
+            </th>
57
+            <th>
58
+              <b>Telephone Number</b>
59
+            </th>
60
+            <th>
61
+              <b>Email</b>
62
+            </th>
63
+            <th>
64
+              <b>Role</b>
65
+            </th>
66
+            <th>
67
+              <b>Reset Password</b>
68
+            </th>
69
+            <th>
70
+              <b>Modify</b>
71
+            </th>
72
+            <th>
73
+              <b>Remove</b>
74
+            </th>
75
+          </tr>
76
+        </thead>
77
+        <tbody>
78
+          <tr v-for="(item, i) in DisplayItems" :key="i">
79
+            <td>{{ item.id }}</td>
80
+            <td>{{ item.name }}</td>
81
+            <td>{{ item.surname }}</td>
82
+            <td>{{ item.cellNumber }}</td>
83
+            <td>{{ item.telephone }}</td>
84
+            <td>{{ item.email }}</td>
85
+            <td v-if="item.user">{{ item.user.role }}</td>
86
+            <td v-else></td>
87
+            <td>
88
+              <button type="button" class="btn" style="margin:2px; color: #60CBEB">Reset</button>
89
+            </td>
90
+            <td>
91
+              <button
92
+                type="button"
93
+                data-toggle="modal"
94
+                :data-target="'#myModal' + i"
95
+                class="btn"
96
+                style="margin:2px; color: #60CBEB"
97
+              >Edit</button>
98
+              <div :id="'myModal' + i" class="modal fade" role="dialog">
99
+                <div class="modal-dialog modal-lg">
100
+                  <div class="modal-content">
101
+                    <div class="modal-header">
102
+                      <button type="button" class="close" data-dismiss="modal">&times;</button>
103
+                    </div>
104
+                    <Agency name="Agency" :isAddAgent="false" :item="item" />
105
+                  </div>
106
+                </div>
107
+              </div>
108
+            </td>
109
+            <td>
110
+              <button
111
+                type="button"
112
+                class="btn"
113
+                style="width: 85px; height:40px; color:#60CBEB"
114
+              >Delete</button>
115
+            </td>
116
+          </tr>
117
+        </tbody>
118
+      </table>
119
+      <div class="d-flex justify-content-between">
120
+        <div class="p-1">{{ currentPage + ' / ' + PageCount }}</div>
121
+        <div class="p-1">
122
+          <BasePagination
123
+            :currentPage="currentPage"
124
+            :pageCount="PageCount"
125
+            @nextPage="pageChangeHandle('next')"
126
+            @previousPage="pageChangeHandle('previous')"
127
+            @loadPage="pageChangeHandle"
128
+          />
129
+        </div>
130
+      </div>
131
+    </div>
132
+    <br />
133
+  </div>
134
+</template>
135
+
136
+<script>
137
+import { mapState, mapActions } from 'vuex';
138
+import axios from 'axios';
139
+import _ from 'lodash';
140
+import ItemsPerPageList from '../../../assets/staticData/itemsPerPage';
141
+import BasePagination from '../../shared/basePagination.vue';
142
+import Agency from '../../user/registerAgencySection.vue';
143
+
144
+export default {
145
+  name: 'agentManagementPage',
146
+  components: {
147
+    BasePagination,
148
+    Agency,
149
+  },
150
+  data() {
151
+    return {
152
+      sortKey: '',
153
+      reverse: false,
154
+      searchItem: '',
155
+      itemsPerPageList: ItemsPerPageList,
156
+      visibleItemsPerPageCount: 0,
157
+      currentPage: 1,
158
+      item: {},
159
+    };
160
+  },
161
+  methods: {
162
+    ...mapActions('register', ['getAgents']),
163
+    addNewAgent({ commit }) {
164
+      axios
165
+        .post('/api/agent')
166
+        .then(result => commit('saveAgent', result.data))
167
+        .catch(console.error);
168
+    },
169
+    routerGoTo(goTo) {
170
+      this.$router.push(goTo);
171
+    },
172
+    sortBy(sortKey) {
173
+      this.reverse = this.sortKey === sortKey ? !this.reverse : false;
174
+      this.sortKey = sortKey;
175
+    },
176
+    async pageChangeHandle(value) {
177
+      console.log(value);
178
+      switch (value) {
179
+        case 'next':
180
+          this.currentPage += 1;
181
+          break;
182
+        case 'previous':
183
+          this.currentPage -= 1;
184
+          break;
185
+        default:
186
+          this.currentPage = value;
187
+      }
188
+    },
189
+    onChangeItemsPerPage() {
190
+      if (this.currentPage !== 1) {
191
+        this.currentPage = 1;
192
+      }
193
+    },
194
+  },
195
+  mounted() {
196
+    this.getAgents();
197
+    try {
198
+      // to assign initial value to itemsPerPage
199
+      if (this.itemsPerPageList && this.itemsPerPageList.length > 0) {
200
+        const [startItem] = this.itemsPerPageList;
201
+        this.visibleItemsPerPageCount = startItem;
202
+      }
203
+    } catch (error) {
204
+      throw error;
205
+    }
206
+  },
207
+  computed: {
208
+    ...mapState('register', ['agents']),
209
+
210
+    SortDirection() {
211
+      return this.reverse ? 'desc' : 'asc';
212
+    },
213
+    PageCount() {
214
+      return this.visibleItemsPerPageCount !== 0
215
+        ? Math.ceil(this.FilteredItems.length / this.visibleItemsPerPageCount)
216
+        : 1;
217
+    },
218
+    FilteredItems() {
219
+      const list = _.filter(this.agents, item => Object.values(item).some(
220
+          i => JSON.stringify(i)
221
+              .toLowerCase()
222
+              .indexOf(this.searchItem) > -1,
223
+        ),);
224
+      return _.orderBy(list, this.sortKey, this.SortDirection);
225
+    },
226
+    DisplayItems() {
227
+      const list = this.FilteredItems;
228
+      const startSlice = (this.currentPage - 1) * this.visibleItemsPerPageCount;
229
+      let endSlice = this.currentPage * this.visibleItemsPerPageCount;
230
+      if (endSlice > list.length) {
231
+        endSlice = list.length;
232
+      }
233
+      return list.slice(startSlice, endSlice);
234
+    },
235
+  },
236
+};
237
+</script>
238
+
239
+
240
+<style>
241
+</style>

+ 166
- 63
src/components/admin/status/userManagementPage.vue View File

@@ -1,8 +1,6 @@
1 1
 <template>
2 2
   <!-- eslint-disable max-len -->
3 3
   <div class="container">
4
-    <br />
5
-    <br />
6 4
     <br />
7 5
     <br />
8 6
     <div class="row">
@@ -10,62 +8,71 @@
10 8
         <div class="title-box-d">
11 9
           <h1 class="title-d" style="text-align:left; font-size: 250%">User Management</h1>
12 10
         </div>
13
-        <br />
14 11
       </div>
15 12
     </div>
16
-    <button @click="addNewAgent" type="button" class="btn btn-b-n">Add New Agent</button>
17
-    <br />
18
-    <br />
13
+    <div class="row">
14
+      <div class="col-md-2 offset-1">
15
+        <button type="button" class="btn btn-b-n">Private Users</button>
16
+      </div>
17
+      <div class="col-md-2 offset-2">
18
+        <button
19
+          @click="routerGoTo('/status/agentUserManagementPage')"
20
+          type="button"
21
+          class="btn btn-b-n"
22
+        >Agents</button>
23
+      </div>
24
+    </div>
19 25
     <div class="container">
26
+      <div class="d-flex justify-content-between">
27
+        <div class="p-2">
28
+          <input v-model="searchItem" class="form-control" placeholder="Search ..." />
29
+        </div>
30
+      </div>
31
+      <br />
20 32
       <table class="table table-bordered">
21 33
         <thead>
22
-          <tr>
23
-            <th>ID</th>
24
-            <th>Name</th>
25
-            <th>Surname</th>
26
-            <th>Cell Number</th>
27
-            <th>Telephone Number</th>
28
-            <th>Email</th>
29
-            <th>Role</th>
30
-            <th>Reset Password</th>
31
-            <th></th>
32
-            <th></th>
33
-          </tr>
34
-        </thead>
35
-        <tbody>
36 34
           <tr>
37 35
             <td colspan="10">
38
-              <h5>Private Users</h5>
39
-            </td>
40
-          </tr>
41
-          <tr v-for="(item, i) in individuals" :key="i">
42
-            <td>{{ item.id }}</td>
43
-            <td>{{ item.name }}</td>
44
-            <td>{{ item.surname }}</td>
45
-            <td>{{ item.cellNumber }}</td>
46
-            <td>{{ item.telephone }}</td>
47
-            <td>{{ item.email }}</td>
48
-            <td v-if="item.user">{{ item.user.role }}</td>
49
-            <td v-else></td>
50
-            <td></td>
51
-            <td>
52
-              <button
53
-                type="button"
54
-                @click="Edit(item)"
55
-                class="btn btn-b-n"
56
-                style="width: 85px; height:40px;"
57
-              >Edit</button>
58
-            </td>
59
-            <td>
60
-              <button type="button" class="btn btn-b-n" style="width: 85px; height:40px">Delete</button>
36
+              <div class="myWell">
37
+                <h4>Private Users</h4>
38
+              </div>
61 39
             </td>
62 40
           </tr>
63 41
           <tr>
64
-            <td colspan="10">
65
-              <h5>Agents</h5>
66
-            </td>
42
+            <th>
43
+              <b>ID</b>
44
+            </th>
45
+            <th>
46
+              <b>Name</b>
47
+            </th>
48
+            <th>
49
+              <b>Surname</b>
50
+            </th>
51
+            <th>
52
+              <b>Cell Number</b>
53
+            </th>
54
+            <th>
55
+              <b>Telephone Number</b>
56
+            </th>
57
+            <th>
58
+              <b>Email</b>
59
+            </th>
60
+            <th>
61
+              <b>Role</b>
62
+            </th>
63
+            <th>
64
+              <b>Reset Password</b>
65
+            </th>
66
+            <th>
67
+              <b>Modify</b>
68
+            </th>
69
+            <th>
70
+              <b>Remove</b>
71
+            </th>
67 72
           </tr>
68
-          <tr v-for="(item, i) in agents" :key="i">
73
+        </thead>
74
+        <tbody>
75
+          <tr v-for="(item, i) in DisplayItems" :key="i">
69 76
             <td>{{ item.id }}</td>
70 77
             <td>{{ item.name }}</td>
71 78
             <td>{{ item.surname }}</td>
@@ -74,49 +81,145 @@
74 81
             <td>{{ item.email }}</td>
75 82
             <td v-if="item.user">{{ item.user.role }}</td>
76 83
             <td v-else></td>
77
-            <td></td>
84
+            <td>
85
+              <button type="button" class="btn" style="margin:2px; color: #60CBEB">Reset</button>
86
+            </td>
78 87
             <td>
79 88
               <button
80 89
                 type="button"
81
-                @click="Edit(item)"
82
-                class="btn btn-b-n"
83
-                style="width: 85px; height:40px;"
90
+                data-toggle="modal"
91
+                :data-target="'#myModal' + i"
92
+                class="btn"
93
+                style="margin:2px; color: #60CBEB"
84 94
               >Edit</button>
95
+              <div :id="'myModal' + i" class="modal fade" role="dialog">
96
+                <div class="modal-dialog modal-lg">
97
+                  <div class="modal-content">
98
+                    <div class="modal-header">
99
+                      <button type="button" class="close" data-dismiss="modal">&times;</button>
100
+                    </div>
101
+                    <div padding-left="20px">
102
+                      <Individual name="PrivateIndividual" :isAddIndividual="false" :item="item" />
103
+                    </div>
104
+                  </div>
105
+                </div>
106
+              </div>
85 107
             </td>
86 108
             <td>
87
-              <button type="button" class="btn btn-b-n" style="width: 85px; height:40px">Delete</button>
109
+              <button type="button" class="btn" style="margin:2px; color: #60CBEB">Delete</button>
88 110
             </td>
89 111
           </tr>
90 112
         </tbody>
91 113
       </table>
114
+      <div class="d-flex justify-content-between">
115
+        <div class="p-1">{{ currentPage + ' / ' + PageCount }}</div>
116
+        <div class="p-1">
117
+          <BasePagination
118
+            :currentPage="currentPage"
119
+            :pageCount="PageCount"
120
+            @nextPage="pageChangeHandle('next')"
121
+            @previousPage="pageChangeHandle('previous')"
122
+            @loadPage="pageChangeHandle"
123
+          />
124
+        </div>
125
+      </div>
126
+      <br />
92 127
     </div>
93
-    <br />
94 128
   </div>
95 129
 </template>
130
+
96 131
 <script>
97 132
 import { mapState, mapActions } from 'vuex';
98
-import axios from 'axios';
133
+import _ from 'lodash';
134
+import ItemsPerPageList from '../../../assets/staticData/itemsPerPage';
135
+import BasePagination from '../../shared/basePagination.vue';
136
+import Individual from '../../user/registerPage.vue';
99 137
 
100 138
 export default {
101 139
   name: 'userManagementPage',
140
+  components: {
141
+    BasePagination,
142
+    Individual,
143
+  },
102 144
   data() {
103
-    return {};
145
+    return {
146
+      sortKey: '',
147
+      reverse: false,
148
+      searchItem: '',
149
+      itemsPerPageList: ItemsPerPageList,
150
+      visibleItemsPerPageCount: 0,
151
+      currentPage: 1,
152
+      item: {},
153
+    };
104 154
   },
105 155
   methods: {
106
-    ...mapActions('registerIndividual', ['getIndividuals', 'getAgents']),
107
-    addNewAgent({ commit }) {
108
-      axios
109
-        .post('/api/agent')
110
-        .then(result => commit('saveAgent', result.data))
111
-        .catch(console.error);
156
+    ...mapActions('register', ['getIndividuals']),
157
+    routerGoTo(goTo) {
158
+      this.$router.push(goTo);
159
+    },
160
+    sortBy(sortKey) {
161
+      this.reverse = this.sortKey === sortKey ? !this.reverse : false;
162
+      this.sortKey = sortKey;
163
+    },
164
+    async pageChangeHandle(value) {
165
+      console.log(value);
166
+      switch (value) {
167
+        case 'next':
168
+          this.currentPage += 1;
169
+          break;
170
+        case 'previous':
171
+          this.currentPage -= 1;
172
+          break;
173
+        default:
174
+          this.currentPage = value;
175
+      }
176
+    },
177
+    onChangeItemsPerPage() {
178
+      if (this.currentPage !== 1) {
179
+        this.currentPage = 1;
180
+      }
112 181
     },
113 182
   },
114 183
   mounted() {
115 184
     this.getIndividuals();
116
-    this.getAgents();
185
+    try {
186
+      // to assign initial value to itemsPerPage
187
+      if (this.itemsPerPageList && this.itemsPerPageList.length > 0) {
188
+        const [startItem] = this.itemsPerPageList;
189
+        this.visibleItemsPerPageCount = startItem;
190
+      }
191
+    } catch (error) {
192
+      throw error;
193
+    }
117 194
   },
118 195
   computed: {
119
-    ...mapState('registerIndividual', ['individuals', 'agents']),
196
+    ...mapState('register', ['individuals']),
197
+
198
+    SortDirection() {
199
+      return this.reverse ? 'desc' : 'asc';
200
+    },
201
+    PageCount() {
202
+      return this.visibleItemsPerPageCount !== 0
203
+        ? Math.ceil(this.FilteredItems.length / this.visibleItemsPerPageCount)
204
+        : 1;
205
+    },
206
+    FilteredItems() {
207
+      const list = _.filter(this.individuals, item => Object.values(item).some(
208
+          i => JSON.stringify(i)
209
+              .toLowerCase()
210
+              .indexOf(this.searchItem) > -1,
211
+        ),);
212
+      return _.orderBy(list, this.sortKey, this.SortDirection);
213
+    },
214
+    DisplayItems() {
215
+      const list = this.FilteredItems;
216
+      const startSlice = (this.currentPage - 1) * this.visibleItemsPerPageCount;
217
+      let endSlice = this.currentPage * this.visibleItemsPerPageCount;
218
+      if (endSlice > list.length) {
219
+        endSlice = list.length;
220
+      }
221
+      return list.slice(startSlice, endSlice);
222
+    },
120 223
   },
121 224
 };
122 225
 </script>

+ 15
- 10
src/components/processFlow/offers.vue View File

@@ -1,19 +1,24 @@
1 1
 <template>
2
-  <!-- eslint-disable max-len -->
3 2
   <div>
3
+    <!-- <section class="intro-single"> -->
4 4
     <div class="container">
5
-      <section class="intro-single">
6
-        <div class="container">
7
-          <div class="row">
8
-            <div class="col-md-12 col-lg-8">
9
-              <div class="title-single-box">
10
-                <h1 class="title-single">Bid Offers</h1>
11
-              </div>
12
-            </div>
5
+      <br />
6
+      <br />
7
+      <br />
8
+      <br />
9
+      <div class="row">
10
+        <div class="col-md-12 col-lg-8">
11
+          <!-- <div class="title-single-box"> -->
12
+          <!-- <h2 class="title-single">Status List</h2> -->
13
+          <!-- </div> -->
14
+          <div class="title-box-d">
15
+            <h1 class="title-d" style="text-align:left; font-size: 250%">Bid Offers</h1>
13 16
           </div>
17
+          <br />
14 18
         </div>
15
-      </section>
19
+      </div>
16 20
     </div>
21
+    <!-- </section> -->
17 22
     <div class="container">
18 23
       <table class="table table-bordered">
19 24
         <thead>

+ 2
- 2
src/components/property/propertyList.vue View File

@@ -56,8 +56,8 @@
56 56
               <button
57 57
                 type="button"
58 58
                 @click="Edit(item)"
59
-                class="btn btn-b-n"
60
-                style="width: 85px; height:40px;"
59
+                class="btn"
60
+                style="margin:2px; color: #60CBEB"
61 61
               >Edit</button>
62 62
             </td>
63 63
             <td>

+ 4
- 1
src/components/shared/alert.vue View File

@@ -11,7 +11,7 @@
11 11
     </div>
12 12
     <div class="alert alert-warning" v-if="type === 'WARNING'">
13 13
       <eva-icon name="alert-circle-outline"></eva-icon>
14
-      <strong>{{ text }}</strong>
14
+      <strong class="color-black">{{ text }}</strong>
15 15
     </div>
16 16
     <div class="alert alert-danger" v-if="type === 'ERROR'">
17 17
       <eva-icon name="slash-outline"></eva-icon>
@@ -41,4 +41,7 @@ export default {
41 41
 </script>
42 42
 
43 43
 <style>
44
+.color-black {
45
+  color: black;
46
+}
44 47
 </style>

+ 1
- 13
src/components/shared/navBar.vue View File

@@ -166,17 +166,6 @@
166 166
                 <a class="dropdown-item cursor-pointer" @click="routerGoTo('/Offers')">Offers</a>
167 167
               </div>
168 168
             </li>
169
-            <li v-if="isLoggedIn">
170
-              <a
171
-                class="nav-link"
172
-                @click="routerGoTo('/user/updateProfileInfo')"
173
-                id="navbarDropdown"
174
-                role="button"
175
-                data-toggle="dropdown"
176
-                aria-haspopup="true"
177
-                aria-expanded="false"
178
-              >Update Profile</a>
179
-            </li>
180 169
             <li class="nav-item dropdown" v-if="!isLoggedIn">
181 170
               <a
182 171
                 class="nav-link"
@@ -192,11 +181,10 @@
192 181
               <span>
193 182
                 <a class="nav-link" @click="logout(routerGoTo('/user/login'))">Logout</a>
194 183
               </span>
195
-              <!-- <span v-else></span> -->
196 184
             </li>
197 185
             <li>
198 186
               <span v-if="isLoggedIn">
199
-                <a>
187
+                <a @click="routerGoTo('/user/updateProfileInfo')">
200 188
                   Welcome!
201 189
                   <br />
202 190
                   {{ NAME }}

+ 15
- 5
src/components/timeshare/buy/weekListComponent.vue View File

@@ -38,10 +38,20 @@
38 38
     </div>
39 39
     <div v-else>
40 40
       <div class="row">
41
-        <div class="col-md-12">
42
-          <hr />No Results Found
43
-          <hr />
41
+        <hr />
42
+        <div class="col-md-12" v-if="status !== '' && status !== undefined">
43
+          <b>{{status}}</b>
44 44
         </div>
45
+        <div class="col-md-12" v-if="status !== '' && status !== undefined">
46
+          <img
47
+            class="img-fluid"
48
+            src="/img/kloader.gif"
49
+            alt="UVProp logo"
50
+            style="width:128px;height:128px;"
51
+          />
52
+        </div>
53
+        <div v-else>No Results Found</div>
54
+        <hr />
45 55
       </div>
46 56
     </div>
47 57
   </div>
@@ -55,9 +65,10 @@ export default {
55 65
   },
56 66
   components: {},
57 67
   computed: {
58
-    ...mapState('weekList', ['weeks']),
68
+    ...mapState('weekList', ['weeks', 'status']),
59 69
     ...mapGetters({
60 70
       filteredWeeks: 'weekList/filteredWeeks',
71
+      getRegions: 'weekList/getRegions',
61 72
     }),
62 73
   },
63 74
   mounted() {
@@ -68,7 +79,6 @@ export default {
68 79
   },
69 80
   methods: {
70 81
     View(item) {
71
-      console.log(item);
72 82
       this.$router.push(`/resort/${item.resort.resortCode}/${item.id}`);
73 83
     },
74 84
     ...mapActions('weekList', ['getWeeks', 'applyResortFilter']),

+ 38
- 5
src/components/timeshare/sell/sellPage.vue View File

@@ -16,9 +16,15 @@
16 16
             <div style="float: right;" class="btn btn-link color-b"></div>
17 17
           </div>
18 18
           <br />
19
-          <br />
20
-          <p>* You need to be logged in to submit your listing. Please register and log in if you have not done so already.</p>
19
+          <div v-if="!isLoggedIn">
20
+            <hr />
21
+            <Alert
22
+              :text="'* You need to be logged in to submit your listing. Please register and log in if you have not done so already.'"
23
+              :type="'WARNING'"
24
+            />
25
+          </div>
21 26
           <hr />
27
+          <br />
22 28
           <div class="form-group row">
23 29
             <div class="col-md-4">
24 30
               <div class="form-group">
@@ -118,7 +124,7 @@
118 124
                     >
119 125
                       <option value="Other">Other</option>
120 126
                       <option
121
-                        v-for="(resort, r) in resorts"
127
+                        v-for="(resort, r) in filteredResort"
122 128
                         :key="r"
123 129
                         :value="resort"
124 130
                       >{{resort.resortName}}</option>
@@ -507,10 +513,16 @@ import { mapState, mapActions } from 'vuex';
507 513
 import DetailIndividual from '../../user/timeshareIndividual.vue';
508 514
 import BankDetails from '../../shared/bankAccount.vue';
509 515
 import Address from '../../misc/address.vue';
516
+import Alert from '../../shared/alert.vue';
510 517
 
511 518
 export default {
512 519
   name: 'TimeshareToSell',
513
-  components: { DetailIndividual, BankDetails, Address },
520
+  components: {
521
+    DetailIndividual,
522
+    BankDetails,
523
+    Address,
524
+    Alert,
525
+  },
514 526
   created() {
515 527
     this.initTimeshare();
516 528
   },
@@ -528,13 +540,34 @@ export default {
528 540
       'agencies',
529 541
       'agents',
530 542
     ]),
543
+    ...mapState('authentication', ['isLoggedIn']),
531 544
     refAgent() {
532 545
       return this.sellItem && this.sellItem.referedByAgent;
533 546
     },
547
+    filteredResort() {
548
+      let list = [];
549
+      if (
550
+        this.sellItem
551
+        && this.sellItem.region
552
+        && this.sellItem.region.regionCode
553
+      ) {
554
+        const item = this.detailedRegion.find(
555
+          region => region.region.regionCode === this.sellItem.region.regionCode,
556
+        );
557
+        if (item) {
558
+          list = item.children;
559
+        }
560
+      } else {
561
+        list = this.resorts;
562
+      }
563
+      return _.sortBy(list, x => x.resortName);
564
+    },
534 565
   },
535 566
   methods: {
536 567
     submitSale() {
537
-      this.saveWeek(this.sellItem);
568
+      if (this.isLoggedIn) {
569
+        this.saveWeek(this.sellItem);
570
+      } else this.$router.push('/user/login');
538 571
     },
539 572
     previewFiles(event) {
540 573
       console.log(event.target.files);

+ 9
- 10
src/components/user/registerAgencySection.vue View File

@@ -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,
@@ -238,10 +237,10 @@ export default {
238 237
     };
239 238
   },
240 239
   computed: {
241
-    ...mapState('registerAgency', ['registerAgency']),
240
+    ...mapState('register', ['registerAgency']),
242 241
   },
243 242
   methods: {
244
-    ...mapActions('registerAgency', [
243
+    ...mapActions('register', [
245 244
       'getAgency',
246 245
       'saveAgency',
247 246
       'updateAgency',

+ 9
- 4
src/components/user/registerPage.vue View File

@@ -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>
@@ -176,7 +181,7 @@ export default {
176 181
     };
177 182
   },
178 183
   computed: {
179
-    ...mapState('registerIndividual', ['registerIndividual']),
184
+    ...mapState('register', ['registerIndividual']),
180 185
 
181 186
     Header() {
182 187
       return this.RegisterHeader
@@ -185,7 +190,7 @@ export default {
185 190
     },
186 191
   },
187 192
   methods: {
188
-    ...mapActions('registerIndividual', [
193
+    ...mapActions('register', [
189 194
       'getIndividual',
190 195
       'saveIndividual',
191 196
       'updateIndividual',

+ 25
- 7
src/components/user/updateProfileInfo.vue View File

@@ -36,10 +36,23 @@
36 36
             <td>
37 37
               <button
38 38
                 type="button"
39
-                @click="Edit(item)"
40
-                class="btn btn-b-n"
41
-                style="width: 85px; height:40px;"
39
+                data-toggle="modal"
40
+                :data-target="'#myModal' + i"
41
+                class="btn"
42
+                style="margin:2px; color: #60CBEB"
42 43
               >Edit</button>
44
+              <div :id="'myModal' + i" class="modal fade" role="dialog">
45
+                <div class="modal-dialog modal-lg">
46
+                  <div class="modal-content">
47
+                    <div class="modal-header">
48
+                      <button type="button" class="close" data-dismiss="modal">&times;</button>
49
+                    </div>
50
+                    <div padding-left="20px">
51
+                      <Individual name="PrivateIndividual" :isAddIndividual="false" :item="item" />
52
+                    </div>
53
+                  </div>
54
+                </div>
55
+              </div>
43 56
             </td>
44 57
           </tr>
45 58
         </tbody>
@@ -51,21 +64,26 @@
51 64
 
52 65
 <script>
53 66
 import { mapState, mapActions } from 'vuex';
54
-// import axios from 'axios';
67
+import Individual from './registerPage.vue';
55 68
 
56 69
 export default {
57 70
   name: 'UpdateInfo',
71
+  components: {
72
+    Individual,
73
+  },
58 74
   data() {
59
-    return {};
75
+    return {
76
+      item: {},
77
+    };
60 78
   },
61 79
   methods: {
62
-    ...mapActions('registerIndividual', ['getIndividuals']),
80
+    ...mapActions('register', ['getIndividuals']),
63 81
   },
64 82
   mounted() {
65 83
     this.getIndividuals();
66 84
   },
67 85
   computed: {
68
-    ...mapState('registerIndividual', ['individuals']),
86
+    ...mapState('register', ['individuals']),
69 87
   },
70 88
 };
71 89
 </script>

+ 11
- 0
src/router/index.js View File

@@ -34,6 +34,7 @@ import tenderWeekAdminPage from '../components/admin/status/tenderWeekAdminPage.
34 34
 import userManagementPage from '../components/admin/status/userManagementPage.vue';
35 35
 import changeLogPage from '../components/admin/status/changeLogPage.vue';
36 36
 import UnitConfiguration from '../components/admin/unitConfiguration/unitConfigurationPage.vue';
37
+import agentManagementPage from '../components/admin/status/agentsUserManagementPage.vue';
37 38
 
38 39
 import ResortPage from '../components/timeshare/resort/resortPage.vue';
39 40
 import UnitPage from '../components/timeshare/resort/unitPage.vue';
@@ -104,6 +105,11 @@ export default new Router({
104 105
       name: 'Login',
105 106
       component: Login,
106 107
     },
108
+    {
109
+      path: '/user/updateProfileInfo',
110
+      name: 'UpdateInfo',
111
+      component: UpdateInfo,
112
+    },
107 113
     {
108 114
       path: '/user/register',
109 115
       name: 'PrivateIndividual',
@@ -199,6 +205,11 @@ export default new Router({
199 205
       name: 'userManagementPage',
200 206
       component: userManagementPage,
201 207
     },
208
+    {
209
+      path: '/status/agentUserManagementPage',
210
+      name: 'agentManagementPage',
211
+      component: agentManagementPage,
212
+    },
202 213
     {
203 214
       path: '/status/changeLogPage',
204 215
       name: 'changeLogPage',

+ 1
- 2
src/store/index.js View File

@@ -40,8 +40,7 @@ export default new Vuex.Store({
40 40
     propertyAdmin: PropertyAdminModule,
41 41
     propertyList: PropertyList,
42 42
     propertyTypes: PropertyTypes,
43
-    registerIndividual: Register,
44
-    registerAgency: Register,
43
+    register: Register,
45 44
     weekList: WeekList,
46 45
     bid: Bid,
47 46
     authentication: Authentication,

+ 18
- 1
src/store/modules/timeshare/timeshare.js View File

@@ -120,7 +120,24 @@ export default {
120 120
     },
121 121
   },
122 122
   getters: {
123
-
123
+    getRegionCode(state) {
124
+      return (value) => {
125
+        const reg = state.detailedRegion.find(region => region.children.some(resort => resort
126
+          .resortCode === value));
127
+        if (reg && reg.region) {
128
+          return reg.region.regionCode;
129
+        }
130
+        return '';
131
+      };
132
+    },
133
+    getResortName(state) {
134
+      return (value) => {
135
+        const res = state.resorts.find(resort => resort.resortCode === value);
136
+        if (res) {
137
+          return res.resortName;
138
+        }
139
+      };
140
+    },
124 141
   },
125 142
   actions: {
126 143
     initTimeshare({

+ 56
- 15
src/store/modules/timeshare/weekList.js View File

@@ -1,3 +1,4 @@
1
+/* eslint-disable no-unused-expressions */
1 2
 /* eslint-disable eqeqeq */
2 3
 /* eslint-disable no-restricted-syntax */
3 4
 /* eslint-disable guard-for-in */
@@ -8,7 +9,9 @@ export default {
8 9
   namespaced: true,
9 10
   state: {
10 11
     weeks: [],
12
+    status: undefined,
11 13
     filter: {
14
+      status: undefined,
12 15
       region: undefined,
13 16
       resort: undefined,
14 17
       bedrooms: undefined,
@@ -21,11 +24,18 @@ export default {
21 24
     difFilter: undefined,
22 25
   },
23 26
   mutations: {
27
+    onLoading(state) {
28
+      state.status = 'Loading...';
29
+    },
30
+    onError(state) {
31
+      state.status = 'Error occurred getting data.';
32
+    },
24 33
     onClearFilter(state, filter) {
25 34
       state.filter[filter] = undefined;
26 35
     },
27 36
     setWeeks(state, weeks) {
28 37
       state.weeks = weeks;
38
+      state.status = '';
29 39
     },
30 40
     addWeek(state, week) {
31 41
       state.weeks.push(week);
@@ -41,7 +51,6 @@ export default {
41 51
       const {
42 52
         filter,
43 53
       } = state;
44
-      // console.log(JSON.stringify(weekList));
45 54
       if (filter) {
46 55
         if (filter.keyword) {
47 56
           const list = [];
@@ -49,8 +58,12 @@ export default {
49 58
             const item = weekList[i];
50 59
             for (const r in item) {
51 60
               const innerItem = item[r];
52
-              if (innerItem && JSON.stringify(innerItem).toLowerCase().includes(filter.keyword
53
-                .toLowerCase())) {
61
+              if (
62
+                innerItem
63
+                && JSON.stringify(innerItem)
64
+                  .toLowerCase()
65
+                  .includes(filter.keyword.toLowerCase())
66
+              ) {
54 67
                 list.push(item);
55 68
                 break;
56 69
               }
@@ -59,12 +72,16 @@ export default {
59 72
           weekList = list;
60 73
         }
61 74
         if (filter.region) {
62
-          weekList = _.filter(weekList, x => x.region && x.region.regionCode === filter.region
63
-            .regionCode);
75
+          weekList = _.filter(
76
+            weekList,
77
+            x => x.region && x.region.regionCode === filter.region.regionCode,
78
+          );
64 79
         }
65 80
         if (filter.resort) {
66
-          weekList = _.filter(weekList, x => x.resort.resortCode
67
-            && x.resort.resortCode === filter.resort.resortCode);
81
+          weekList = _.filter(
82
+            weekList,
83
+            x => x.resort.resortCode && x.resort.resortCode === filter.resort.resortCode,
84
+          );
68 85
         }
69 86
         if (filter.bedrooms) {
70 87
           weekList = _.filter(weekList, x => x.bedrooms && x.bedrooms == filter.bedrooms);
@@ -74,21 +91,25 @@ export default {
74 91
           minDate.setDate(minDate.getDate() - 7);
75 92
           const maxDate = new Date(filter.date);
76 93
           maxDate.setDate(maxDate.getDate() + 7);
77
-          weekList = _.filter(weekList, x => new Date(x.arrivalDate)
94
+          weekList = _.filter(
95
+            weekList,
96
+            x => new Date(x.arrivalDate)
78 97
             && new Date(x.departureDate)
79 98
             && new Date(x.arrivalDate) >= minDate
80
-            && new Date(x.arrivalDate) <= maxDate);
99
+            && new Date(x.arrivalDate) <= maxDate,
100
+          );
81 101
         }
82 102
         if (filter.minPrice && filter.minPrice !== 0) {
83
-          weekList = _.filter(weekList, x => x.sellPrice
84
-            && x.sellPrice >= filter.minPrice);
103
+          weekList = _.filter(weekList, x => x.sellPrice && x.sellPrice >= filter.minPrice);
85 104
         }
86 105
         if (filter.maxPrice && filter.maxPrice !== 0) {
87
-          weekList = _.filter(weekList, x => x.sellPrice
88
-            && x.sellPrice <= filter.maxPrice);
106
+          weekList = _.filter(weekList, x => x.sellPrice && x.sellPrice <= filter.maxPrice);
89 107
         }
90 108
       }
91
-      return weekList;
109
+      return _.sortBy((_.sortBy(weekList, 'arrivalDate')), 'resort.resortName');
110
+    },
111
+    getRegions(state, getters, rootState, rootGetters) {
112
+      return rootGetters['timeshare/getRegionCode']('KK');
92 113
     },
93 114
   },
94 115
   actions: {
@@ -101,10 +122,30 @@ export default {
101 122
     },
102 123
     getWeeks({
103 124
       commit,
125
+      rootGetters,
104 126
     }) {
127
+      commit('onLoading');
105 128
       axios
106 129
         .get('/api/timeshareweek')
107
-        .then(result => commit('setWeeks', result.data))
130
+        .then((result) => {
131
+          const arr2 = result.data.filter(x => x.region !== null);
132
+          const arr3 = result.data.filter(x => x.region === null);
133
+          for (const item in arr3) {
134
+            const myItem = arr3[item];
135
+            if (myItem !== undefined) {
136
+              const code = myItem.resort.resortCode;
137
+              myItem.region = {
138
+                regionName: rootGetters['timeshare/getRegionCode'](code),
139
+              };
140
+              myItem.resort = {
141
+                resortName: rootGetters['timeshare/getResortName'](code),
142
+                resortCode: code,
143
+              };
144
+              arr2.push(myItem);
145
+            }
146
+          }
147
+          commit('setWeeks', arr2);
148
+        })
108 149
         .catch(console.error);
109 150
     },
110 151
     clearFilter({

+ 4
- 0
vue.config.js View File

@@ -5,6 +5,10 @@ module.exports = {
5 5
         target: 'http://192.168.6.188:5000',
6 6
         changeOrigin: true,
7 7
       },
8
+      '/nph-srep': {
9
+        target: 'http://www.unipoint-consoft.co.za',
10
+        changeOrigin: true,
11
+      },
8 12
     },
9 13
   },
10 14
 };

Loading…
Cancel
Save