|
@@ -5,14 +5,82 @@
|
5
|
5
|
<h1>Property Admin</h1>
|
6
|
6
|
</div>
|
7
|
7
|
<div class="row">
|
8
|
|
- <div class="col-lg-6 offset-3">
|
9
|
|
- <input class="form-control uniSelect" type="text" placeholder="SEARCH" v-model="filter" />
|
|
8
|
+ <div class="col-lg-4"></div>
|
|
9
|
+ <div class="col-lg-4">
|
|
10
|
+ <input
|
|
11
|
+ @input="updateLazyFilter"
|
|
12
|
+ class="form-control uniSelect"
|
|
13
|
+ type="text"
|
|
14
|
+ placeholder="SEARCH"
|
|
15
|
+ v-model="filter"
|
|
16
|
+ />
|
|
17
|
+ </div>
|
|
18
|
+ <div class="col-lg-4">
|
|
19
|
+ <select
|
|
20
|
+ @change="downloadExcelSheet"
|
|
21
|
+ name="downloadType"
|
|
22
|
+ class="form-control uniSelect"
|
|
23
|
+ v-model="selectedExcelDownload"
|
|
24
|
+ id=""
|
|
25
|
+ >
|
|
26
|
+ <option value="">Select Download Option</option>
|
|
27
|
+ <option value="displayItems">
|
|
28
|
+ <download-excel
|
|
29
|
+ ref="dlDisplay"
|
|
30
|
+ :data="DisplayItems"
|
|
31
|
+ :fields="excelFields"
|
|
32
|
+ worksheet="Timeshare Listings"
|
|
33
|
+ name="Uni-Vate Timeshare.xls"
|
|
34
|
+ >
|
|
35
|
+ Download Display Items
|
|
36
|
+ </download-excel>
|
|
37
|
+ </option>
|
|
38
|
+ <option value="allPublished">
|
|
39
|
+ <download-excel
|
|
40
|
+ ref="dlPublished"
|
|
41
|
+ :data="OnlyPublished"
|
|
42
|
+ :fields="excelFields"
|
|
43
|
+ worksheet="Timeshare Listings"
|
|
44
|
+ name="Uni-Vate Timeshare.xls"
|
|
45
|
+ >
|
|
46
|
+ Download Published Items
|
|
47
|
+ </download-excel>
|
|
48
|
+ </option>
|
|
49
|
+ <option value="allItems">
|
|
50
|
+ <download-excel
|
|
51
|
+ ref="dlAll"
|
|
52
|
+ :data="AllListingsSortedById"
|
|
53
|
+ :fields="excelFields"
|
|
54
|
+ worksheet="Timeshare Listings"
|
|
55
|
+ name="Uni-Vate Timeshare.xls"
|
|
56
|
+ >
|
|
57
|
+ Download All
|
|
58
|
+ </download-excel>
|
|
59
|
+ </option>
|
|
60
|
+ </select>
|
10
|
61
|
</div>
|
11
|
62
|
</div>
|
12
|
63
|
<div class="row">
|
13
|
64
|
<br />
|
14
|
65
|
</div>
|
15
|
66
|
</div>
|
|
67
|
+ <!-- <div class="row">
|
|
68
|
+ <div class="col">
|
|
69
|
+ {{ DisplayItems[0] }}
|
|
70
|
+ </div>
|
|
71
|
+ </div>
|
|
72
|
+ <div class="row">
|
|
73
|
+ <div class="col">
|
|
74
|
+ <download-excel
|
|
75
|
+ :data="DisplayItems"
|
|
76
|
+ :fields="excelFields"
|
|
77
|
+ worksheet="Timeshare Listings"
|
|
78
|
+ name="Uni-Vate Timeshare.xls"
|
|
79
|
+ >
|
|
80
|
+ Download Excel
|
|
81
|
+ </download-excel>
|
|
82
|
+ </div>
|
|
83
|
+ </div> -->
|
16
|
84
|
<div class="container-fluid">
|
17
|
85
|
<div class="row justify-content-center">
|
18
|
86
|
<div class="col-auto">
|
|
@@ -163,6 +231,50 @@ export default {
|
163
|
231
|
currentPage: 1,
|
164
|
232
|
reverse: true,
|
165
|
233
|
sortKey: "id",
|
|
234
|
+ selectedExcelDownload: "",
|
|
235
|
+ excelFields: {
|
|
236
|
+ Ref: "id",
|
|
237
|
+ Owner: "owner",
|
|
238
|
+ agent: "Agent",
|
|
239
|
+ Resort: "resort.resortName",
|
|
240
|
+ Module: "module",
|
|
241
|
+ Unit: "unitNumber",
|
|
242
|
+ Beds: "bedrooms",
|
|
243
|
+ MaxSleep: "maxSleep",
|
|
244
|
+ Season: "season",
|
|
245
|
+ Region: "region.regionName",
|
|
246
|
+ Amount: {
|
|
247
|
+ field: "sellPrice",
|
|
248
|
+ callback: value => {
|
|
249
|
+ return "R " + value;
|
|
250
|
+ }
|
|
251
|
+ },
|
|
252
|
+ Levy: {
|
|
253
|
+ field: "levyAmount",
|
|
254
|
+ callback: value => {
|
|
255
|
+ return "R " + value;
|
|
256
|
+ }
|
|
257
|
+ },
|
|
258
|
+ ArrivalDate: {
|
|
259
|
+ field: "arrivalDate",
|
|
260
|
+ callback: value => {
|
|
261
|
+ return value.substring(0, 10);
|
|
262
|
+ }
|
|
263
|
+ },
|
|
264
|
+ DepartureDate: {
|
|
265
|
+ field: "departureDate",
|
|
266
|
+ callback: value => {
|
|
267
|
+ return value.substring(0, 10);
|
|
268
|
+ }
|
|
269
|
+ },
|
|
270
|
+ Submitted: {
|
|
271
|
+ field: "pulbishedDate",
|
|
272
|
+ callback: value => {
|
|
273
|
+ return value.substring(0, 10);
|
|
274
|
+ }
|
|
275
|
+ },
|
|
276
|
+ Status: "status.description"
|
|
277
|
+ },
|
166
|
278
|
displayColumns: [
|
167
|
279
|
"Ref",
|
168
|
280
|
"Owner",
|
|
@@ -194,6 +306,7 @@ export default {
|
194
|
306
|
},
|
195
|
307
|
methods: {
|
196
|
308
|
...mapActions("myWeeks", ["getAllItems"]),
|
|
309
|
+ ...mapActions("timeshare", ["updateFilter"]),
|
197
|
310
|
...mapActions("myWeeks", [
|
198
|
311
|
"getItems",
|
199
|
312
|
"verifyWeek",
|
|
@@ -202,6 +315,21 @@ export default {
|
202
|
315
|
"unpublishWeek",
|
203
|
316
|
"deleteListing"
|
204
|
317
|
]),
|
|
318
|
+ updateLazyFilter() {
|
|
319
|
+ this.updateFilter(this.filter);
|
|
320
|
+ },
|
|
321
|
+ downloadExcelSheet() {
|
|
322
|
+ if (this.selectedExcelDownload == "displayItems") {
|
|
323
|
+ const elem = this.$refs.dlDisplay;
|
|
324
|
+ elem.$el.click();
|
|
325
|
+ } else if (this.selectedExcelDownload == "allPublished") {
|
|
326
|
+ const elem = this.$refs.dlPublished;
|
|
327
|
+ elem.$el.click();
|
|
328
|
+ } else if (this.selectedExcelDownload == "allItems") {
|
|
329
|
+ const elem = this.$refs.dlAll;
|
|
330
|
+ elem.$el.click();
|
|
331
|
+ }
|
|
332
|
+ },
|
205
|
333
|
Publish(item) {
|
206
|
334
|
var today = new Date();
|
207
|
335
|
var dd = String(today.getDate()).padStart(2, "0");
|
|
@@ -250,15 +378,16 @@ export default {
|
250
|
378
|
},
|
251
|
379
|
computed: {
|
252
|
380
|
...mapState("propertyList", ["properties"]),
|
|
381
|
+ ...mapState("timeshare", ["timeshareFilter"]),
|
253
|
382
|
...mapGetters({ getNeedsVerify: "myWeeks/getNeedsVerify" }),
|
254
|
383
|
FilteredListings() {
|
255
|
|
- if (this.filter) {
|
|
384
|
+ if (this.timeshareFilter) {
|
256
|
385
|
const list = _.filter(this.getNeedsVerify, item =>
|
257
|
386
|
Object.values(item).some(
|
258
|
387
|
i =>
|
259
|
388
|
JSON.stringify(i)
|
260
|
389
|
.toLowerCase()
|
261
|
|
- .indexOf(this.filter.toLowerCase()) > -1
|
|
390
|
+ .indexOf(this.timeshareFilter.toLowerCase()) > -1
|
262
|
391
|
)
|
263
|
392
|
);
|
264
|
393
|
return _.orderBy(list, this.sortKey, this.SortDirection);
|
|
@@ -266,6 +395,18 @@ export default {
|
266
|
395
|
return _.orderBy(this.getNeedsVerify, this.sortKey, this.SortDirection);
|
267
|
396
|
}
|
268
|
397
|
},
|
|
398
|
+ AllListingsSortedById() {
|
|
399
|
+ return _.orderBy(this.getNeedsVerify, "id", "desc");
|
|
400
|
+ },
|
|
401
|
+ OnlyPublished() {
|
|
402
|
+ var list = [];
|
|
403
|
+ this.FilteredListings.forEach(listing => {
|
|
404
|
+ if (listing.publish) {
|
|
405
|
+ list.push(listing);
|
|
406
|
+ }
|
|
407
|
+ });
|
|
408
|
+ return list;
|
|
409
|
+ },
|
269
|
410
|
PageCount() {
|
270
|
411
|
return this.visibleItemsPerPageCount !== 0
|
271
|
412
|
? Math.ceil(this.FilteredListings.length / this.visibleItemsPerPageCount)
|
|
@@ -290,6 +431,9 @@ export default {
|
290
|
431
|
});
|
291
|
432
|
},
|
292
|
433
|
mounted() {
|
|
434
|
+ if (this.timeshareFilter !== "") {
|
|
435
|
+ this.filter = this.timeshareFilter;
|
|
436
|
+ }
|
293
|
437
|
// this.getAdminProperties(this.userId).then(fulfuilled => {
|
294
|
438
|
// this.wait = false;
|
295
|
439
|
// if (this.itemsPerPageList && this.itemsPerPageList.length > 0) {
|