Sfoglia il codice sorgente

Various Fixes

master
30117125 4 anni fa
parent
commit
904cf4f4e4

+ 3
- 3
package-lock.json Vedi File

12412
       "integrity": "sha512-AeYn51cG/iSZbRAOnDrmzdv+Q8bBtElB3R0U37eM3NRKkcFsf6CLBw5lip1sSbichdn1ANfzjM+N1gki3GvMqw=="
12412
       "integrity": "sha512-AeYn51cG/iSZbRAOnDrmzdv+Q8bBtElB3R0U37eM3NRKkcFsf6CLBw5lip1sSbichdn1ANfzjM+N1gki3GvMqw=="
12413
     },
12413
     },
12414
     "vue-json-excel": {
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
       "requires": {
12418
       "requires": {
12419
         "downloadjs": "^1.4.7"
12419
         "downloadjs": "^1.4.7"
12420
       }
12420
       }

+ 1
- 1
package.json Vedi File

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

+ 148
- 4
src/components/admin/status/timeshareAdminList.vue Vedi File

5
         <h1>Property Admin</h1>
5
         <h1>Property Admin</h1>
6
       </div>
6
       </div>
7
       <div class="row">
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
         </div>
61
         </div>
11
       </div>
62
       </div>
12
       <div class="row">
63
       <div class="row">
13
         <br />
64
         <br />
14
       </div>
65
       </div>
15
     </div>
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
     <div class="container-fluid">
84
     <div class="container-fluid">
17
       <div class="row justify-content-center">
85
       <div class="row justify-content-center">
18
         <div class="col-auto">
86
         <div class="col-auto">
163
       currentPage: 1,
231
       currentPage: 1,
164
       reverse: true,
232
       reverse: true,
165
       sortKey: "id",
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
       displayColumns: [
278
       displayColumns: [
167
         "Ref",
279
         "Ref",
168
         "Owner",
280
         "Owner",
194
   },
306
   },
195
   methods: {
307
   methods: {
196
     ...mapActions("myWeeks", ["getAllItems"]),
308
     ...mapActions("myWeeks", ["getAllItems"]),
309
+    ...mapActions("timeshare", ["updateFilter"]),
197
     ...mapActions("myWeeks", [
310
     ...mapActions("myWeeks", [
198
       "getItems",
311
       "getItems",
199
       "verifyWeek",
312
       "verifyWeek",
202
       "unpublishWeek",
315
       "unpublishWeek",
203
       "deleteListing"
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
     Publish(item) {
333
     Publish(item) {
206
       var today = new Date();
334
       var today = new Date();
207
       var dd = String(today.getDate()).padStart(2, "0");
335
       var dd = String(today.getDate()).padStart(2, "0");
250
   },
378
   },
251
   computed: {
379
   computed: {
252
     ...mapState("propertyList", ["properties"]),
380
     ...mapState("propertyList", ["properties"]),
381
+    ...mapState("timeshare", ["timeshareFilter"]),
253
     ...mapGetters({ getNeedsVerify: "myWeeks/getNeedsVerify" }),
382
     ...mapGetters({ getNeedsVerify: "myWeeks/getNeedsVerify" }),
254
     FilteredListings() {
383
     FilteredListings() {
255
-      if (this.filter) {
384
+      if (this.timeshareFilter) {
256
         const list = _.filter(this.getNeedsVerify, item =>
385
         const list = _.filter(this.getNeedsVerify, item =>
257
           Object.values(item).some(
386
           Object.values(item).some(
258
             i =>
387
             i =>
259
               JSON.stringify(i)
388
               JSON.stringify(i)
260
                 .toLowerCase()
389
                 .toLowerCase()
261
-                .indexOf(this.filter.toLowerCase()) > -1
390
+                .indexOf(this.timeshareFilter.toLowerCase()) > -1
262
           )
391
           )
263
         );
392
         );
264
         return _.orderBy(list, this.sortKey, this.SortDirection);
393
         return _.orderBy(list, this.sortKey, this.SortDirection);
266
         return _.orderBy(this.getNeedsVerify, this.sortKey, this.SortDirection);
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
     PageCount() {
410
     PageCount() {
270
       return this.visibleItemsPerPageCount !== 0
411
       return this.visibleItemsPerPageCount !== 0
271
         ? Math.ceil(this.FilteredListings.length / this.visibleItemsPerPageCount)
412
         ? Math.ceil(this.FilteredListings.length / this.visibleItemsPerPageCount)
290
     });
431
     });
291
   },
432
   },
292
   mounted() {
433
   mounted() {
434
+    if (this.timeshareFilter !== "") {
435
+      this.filter = this.timeshareFilter;
436
+    }
293
     // this.getAdminProperties(this.userId).then(fulfuilled => {
437
     // this.getAdminProperties(this.userId).then(fulfuilled => {
294
     //   this.wait = false;
438
     //   this.wait = false;
295
     //   if (this.itemsPerPageList && this.itemsPerPageList.length > 0) {
439
     //   if (this.itemsPerPageList && this.itemsPerPageList.length > 0) {

+ 14
- 0
src/components/communication/newEmailTemplate.vue Vedi File

70
                       <option value="[MODULE]">Module</option>
70
                       <option value="[MODULE]">Module</option>
71
                       <option value="[RESORTPRICE]">Resort Price</option>
71
                       <option value="[RESORTPRICE]">Resort Price</option>
72
                       <option value="[RESORTSEASON]">Resort Season</option>
72
                       <option value="[RESORTSEASON]">Resort Season</option>
73
+                      <option value="[RESORTREGION]">Resort Region</option>
73
                       <option value="[RESORTLEVY]">Resort Levy</option>
74
                       <option value="[RESORTLEVY]">Resort Levy</option>
74
                       <option value="[OFFERMADE]">Offer Made</option>
75
                       <option value="[OFFERMADE]">Offer Made</option>
75
                       <option value="[OWNER]">OWNER</option>
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
                     </optgroup>
90
                     </optgroup>
77
                     <optgroup label="Property Fields">
91
                     <optgroup label="Property Fields">
78
                       <option value="[PROPERTYREF]">Property Ref</option>
92
                       <option value="[PROPERTYREF]">Property Ref</option>

+ 33
- 6
src/components/timeshare/buy/carouselSection.vue Vedi File

122
   },
122
   },
123
   methods: {
123
   methods: {
124
     ...mapActions("timeshare", ["initTimeshare", "onResortChange", "saveWeek"]),
124
     ...mapActions("timeshare", ["initTimeshare", "onResortChange", "saveWeek"]),
125
+    ...mapActions("resort", ["getResortWithListings"]),
125
     regionChange(item) {
126
     regionChange(item) {
126
       let reg = this.regions.find(r => r.regionName === item.target.value);
127
       let reg = this.regions.find(r => r.regionName === item.target.value);
127
       this.regionObj = reg;
128
       this.regionObj = reg;
149
   computed: {
150
   computed: {
150
     ...mapState("timeshare", ["resorts", "regions", "detailedRegion"]),
151
     ...mapState("timeshare", ["resorts", "regions", "detailedRegion"]),
151
     ...mapState("weekList", ["searchParams", "filter"]),
152
     ...mapState("weekList", ["searchParams", "filter"]),
153
+    ...mapState("resort", ["resortsWithListings"]),
152
     filteredResort() {
154
     filteredResort() {
153
       let list = [];
155
       let list = [];
156
+      var itemList = [];
154
       if (this.searchParams.region && this.searchParams.region !== "") {
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
       } else {
173
       } else {
162
-        list = this.resorts;
174
+        list = this.resortsWithListings;
163
       }
175
       }
164
       return _.sortBy(list, x => x.resortName);
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
   created() {
193
   created() {
168
     this.initTimeshare(this.weekId);
194
     this.initTimeshare(this.weekId);
195
+    this.getResortWithListings();
169
   },
196
   },
170
   mounted() {
197
   mounted() {
171
     this.searchParams.region = null;
198
     this.searchParams.region = null;

+ 2
- 0
src/main.js Vedi File

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

+ 10
- 1
src/store/modules/timeshare/resort.js Vedi File

11
     images: [],
11
     images: [],
12
     layout: "",
12
     layout: "",
13
     description: "",
13
     description: "",
14
-    resortMedia: undefined
14
+    resortMedia: undefined,
15
+    resortsWithListings: []
15
   },
16
   },
16
   mutations: {
17
   mutations: {
17
     setResort(state, resort) {
18
     setResort(state, resort) {
36
     },
37
     },
37
     setResortMedia(state, media) {
38
     setResortMedia(state, media) {
38
       state.resortMedia = media;
39
       state.resortMedia = media;
40
+    },
41
+    setResortsWithListings(state, data){
42
+      state.resortsWithListings = data
39
     }
43
     }
40
   },
44
   },
41
   getters: {},
45
   getters: {},
156
           commit("setResort", result.data);
160
           commit("setResort", result.data);
157
         })
161
         })
158
         .catch(error => console.log(new Error(error.message)));
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 Vedi File

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

Loading…
Annulla
Salva