Explorar el Código

Various Fixes

master
30117125 hace 4 años
padre
commit
904cf4f4e4

+ 3
- 3
package-lock.json Ver fichero

@@ -12412,9 +12412,9 @@
12412 12412
       "integrity": "sha512-AeYn51cG/iSZbRAOnDrmzdv+Q8bBtElB3R0U37eM3NRKkcFsf6CLBw5lip1sSbichdn1ANfzjM+N1gki3GvMqw=="
12413 12413
     },
12414 12414
     "vue-json-excel": {
12415
-      "version": "0.2.98",
12416
-      "resolved": "https://registry.npmjs.org/vue-json-excel/-/vue-json-excel-0.2.98.tgz",
12417
-      "integrity": "sha512-hPA3/cOe5nGbEZiJyfpdBIdqBExxF6EhMhpX6vC654PYbTVzdzp7O9ZsC1AgqbgRDR8VjzAaPaEeHg2vGS88FQ==",
12415
+      "version": "0.2.99",
12416
+      "resolved": "https://registry.npmjs.org/vue-json-excel/-/vue-json-excel-0.2.99.tgz",
12417
+      "integrity": "sha512-Zu1uV/KUGjG8oGchF1kK/53eaTEXoKPC4pZknuF3n+/7fctxuuOuQ5bda9GRE0PukRCbyJtL1v3Y256GmnyOaQ==",
12418 12418
       "requires": {
12419 12419
         "downloadjs": "^1.4.7"
12420 12420
       }

+ 1
- 1
package.json Ver fichero

@@ -37,7 +37,7 @@
37 37
     "vue-eva-icons": "^1.1.1",
38 38
     "vue-float-label": "^1.6.1",
39 39
     "vue-js-modal": "^1.3.33",
40
-    "vue-json-excel": "^0.2.98",
40
+    "vue-json-excel": "^0.2.99",
41 41
     "vue-owl-carousel": "^2.0.3",
42 42
     "vue-router": "^3.1.5",
43 43
     "vue-social-sharing": "^3.0.0-beta.11",

+ 148
- 4
src/components/admin/status/timeshareAdminList.vue Ver fichero

@@ -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) {

+ 14
- 0
src/components/communication/newEmailTemplate.vue Ver fichero

@@ -70,9 +70,23 @@
70 70
                       <option value="[MODULE]">Module</option>
71 71
                       <option value="[RESORTPRICE]">Resort Price</option>
72 72
                       <option value="[RESORTSEASON]">Resort Season</option>
73
+                      <option value="[RESORTREGION]">Resort Region</option>
73 74
                       <option value="[RESORTLEVY]">Resort Levy</option>
74 75
                       <option value="[OFFERMADE]">Offer Made</option>
75 76
                       <option value="[OWNER]">OWNER</option>
77
+                      <option value="[SLEEPMAX]">Sleep Max</option>
78
+                      <option value="[WEEK]">Week</option>
79
+                      <option value="[BEDROOMS]">Bedrooms</option>
80
+                      <option value="[ASKINGPRICE]">Asking Price</option>
81
+                      <option value="[ARRIVALDATE]">Arrival Date</option>
82
+                      <option value="[DEPARTUREDATE]">Departure Date</option>
83
+                      <option value="[AGENTREFER]">Referred By Agent</option>
84
+                      <option value="[ALLLEVY]">Levies Paid</option>
85
+                      <option value="[WEEKPLACEDFORRENTAL]">Current year Rental</option>
86
+                      <option value="[ORIGINALPURCHASEDATE]">Original Purchase Date</option>
87
+                      <option value="[CUROCCUPATIONDATES]">Current Occupation Dates</option>
88
+                      <option value="[ORIGINALPURCHASEPRICE]">Original Purchase Price</option>
89
+                      <option value="[AGENTCOMM]">Agent Commission</option>
76 90
                     </optgroup>
77 91
                     <optgroup label="Property Fields">
78 92
                       <option value="[PROPERTYREF]">Property Ref</option>

+ 33
- 6
src/components/timeshare/buy/carouselSection.vue Ver fichero

@@ -122,6 +122,7 @@ export default {
122 122
   },
123 123
   methods: {
124 124
     ...mapActions("timeshare", ["initTimeshare", "onResortChange", "saveWeek"]),
125
+    ...mapActions("resort", ["getResortWithListings"]),
125 126
     regionChange(item) {
126 127
       let reg = this.regions.find(r => r.regionName === item.target.value);
127 128
       this.regionObj = reg;
@@ -149,23 +150,49 @@ export default {
149 150
   computed: {
150 151
     ...mapState("timeshare", ["resorts", "regions", "detailedRegion"]),
151 152
     ...mapState("weekList", ["searchParams", "filter"]),
153
+    ...mapState("resort", ["resortsWithListings"]),
152 154
     filteredResort() {
153 155
       let list = [];
156
+      var itemList = [];
154 157
       if (this.searchParams.region && this.searchParams.region !== "") {
155
-        const item = this.detailedRegion.find(
156
-          region => region.region.regionCode === this.regionObj.regionCode
157
-        );
158
-        if (item) {
159
-          list = item.children;
158
+        this.resortsWithListings.forEach(resortListing => {
159
+          if (
160
+            resortListing.resortRegion[0].code.toUpperCase() ===
161
+            this.regionObj.regionCode.toUpperCase()
162
+          ) {
163
+            itemList.push(resortListing);
164
+          }
165
+        });
166
+        if (itemList.length > 0) {
167
+          list = itemList;
168
+        } else {
169
+          list[0] = {
170
+            resortName: " - No Listings - "
171
+          };
160 172
         }
161 173
       } else {
162
-        list = this.resorts;
174
+        list = this.resortsWithListings;
163 175
       }
164 176
       return _.sortBy(list, x => x.resortName);
165 177
     }
178
+    // filteredResort() {
179
+    //   let list = [];
180
+    //   if (this.searchParams.region && this.searchParams.region !== "") {
181
+    //     const item = this.detailedRegion.find(
182
+    //       region => region.region.regionCode === this.regionObj.regionCode
183
+    //     );
184
+    //     if (item) {
185
+    //       list = item.children;
186
+    //     }
187
+    //   } else {
188
+    //     list = this.resorts;
189
+    //   }
190
+    //   return _.sortBy(list, x => x.resortName);
191
+    // }
166 192
   },
167 193
   created() {
168 194
     this.initTimeshare(this.weekId);
195
+    this.getResortWithListings();
169 196
   },
170 197
   mounted() {
171 198
     this.searchParams.region = null;

+ 2
- 0
src/main.js Ver fichero

@@ -13,12 +13,14 @@ import VueCurrencyInput from "vue-currency-input";
13 13
 import VueFloatLabel from "vue-float-label";
14 14
 import VueCryptojs from "vue-cryptojs";
15 15
 import VueAnalytics from 'vue-analytics';
16
+import JsonExcel from "vue-json-excel";
16 17
 
17 18
 Vue.use(VueSocialSharing);
18 19
 Vue.use(EvaIcons);
19 20
 Vue.use(Vuetify);
20 21
 Vue.use(VueFloatLabel);
21 22
 Vue.use(VueCryptojs);
23
+Vue.component("downloadExcel", JsonExcel);
22 24
 
23 25
 Vue.use(VueGoogleMaps, {
24 26
   load: {

+ 10
- 1
src/store/modules/timeshare/resort.js Ver fichero

@@ -11,7 +11,8 @@ export default {
11 11
     images: [],
12 12
     layout: "",
13 13
     description: "",
14
-    resortMedia: undefined
14
+    resortMedia: undefined,
15
+    resortsWithListings: []
15 16
   },
16 17
   mutations: {
17 18
     setResort(state, resort) {
@@ -36,6 +37,9 @@ export default {
36 37
     },
37 38
     setResortMedia(state, media) {
38 39
       state.resortMedia = media;
40
+    },
41
+    setResortsWithListings(state, data){
42
+      state.resortsWithListings = data
39 43
     }
40 44
   },
41 45
   getters: {},
@@ -156,6 +160,11 @@ export default {
156 160
           commit("setResort", result.data);
157 161
         })
158 162
         .catch(error => console.log(new Error(error.message)));
163
+    },
164
+    async getResortWithListings({commit}, resortCode){
165
+      await axios.get("/api/resort/GetPublishedResortsWithListings").then(result => {
166
+        commit("setResortsWithListings", result.data)
167
+      })
159 168
     }
160 169
   }
161 170
 };

+ 7
- 0
src/store/modules/timeshare/timeshare.js Ver fichero

@@ -18,6 +18,7 @@ export default {
18 18
     bankedEntities: [],
19 19
     agencies: [],
20 20
     agents: [],
21
+    timeshareFilter: "",
21 22
     maritalStatus: MaritalStatus,
22 23
     result: undefined,
23 24
     latestWeeks: [],
@@ -60,6 +61,9 @@ export default {
60 61
     setUnitConfigurationList(state, list) {
61 62
       state.unitConfigurationList = list;
62 63
     },
64
+    filterStore(state, input){
65
+      state.timeshareFilter = input
66
+    },
63 67
     setAgency(state, agencies) {
64 68
       state.agencies = agencies;
65 69
     },
@@ -155,6 +159,9 @@ export default {
155 159
         dispatch("getWeekDetail", timeshareId);
156 160
       }
157 161
     },
162
+    updateFilter({commit}, input){
163
+      commit('filterStore', input)
164
+    },
158 165
     getWeekDetail({ commit }, timeshareId) {
159 166
       axios
160 167
         .get(`api/timeshareweek/${timeshareId}`)

Loading…
Cancelar
Guardar