Browse Source

TimeshareWeekAdminUpdate

master
30117125 4 years ago
parent
commit
b33c4b2213

+ 104
- 100
src/components/admin/status/editTimeShareAdminPage.vue View File

@@ -20,11 +20,9 @@
20 20
               <div class="form-row">
21 21
                 <div class="form-group col-md-6">
22 22
                   <div class="input-group">
23
-                    <label
24
-                      v-if="!selectedRegion"
25
-                      class="uniSelectLabel"
26
-                      for="weekInfoRegionSelect"
27
-                    >REGION</label>
23
+                    <label v-if="!selectedRegion" class="uniSelectLabel" for="weekInfoRegionSelect"
24
+                      >REGION</label
25
+                    >
28 26
                   </div>
29 27
                   <float-label label="REGION" fixed>
30 28
                     <select
@@ -33,9 +31,7 @@
33 31
                       style="font-size: 15px"
34 32
                     >
35 33
                       <option v-for="(region, r) in regions" :key="r" :value="region.regionCode">
36
-                        {{
37
-                        region.regionName
38
-                        }}
34
+                        {{ region.regionName }}
39 35
                       </option>
40 36
                     </select>
41 37
                   </float-label>
@@ -53,7 +49,8 @@
53 49
                           v-for="(resort, r) in filteredResort"
54 50
                           :key="r"
55 51
                           :value="resort.resortCode"
56
-                        >{{ resort.resortName }}</option>
52
+                          >{{ resort.resortName }}</option
53
+                        >
57 54
                       </select>
58 55
                     </float-label>
59 56
 
@@ -75,7 +72,9 @@
75 72
                 </div>
76 73
                 <div class="form-group col-md-6">
77 74
                   <div v-if="weekParam.otherResort">
78
-                    <label v-if="!weekParam.region" class="uniSelectLabel" for="region">REGION</label>
75
+                    <label v-if="!weekParam.region" class="uniSelectLabel" for="region"
76
+                      >REGION</label
77
+                    >
79 78
                   </div>
80 79
                   <float-label>
81 80
                     <select
@@ -86,9 +85,7 @@
86 85
                       v-model="weekParam.region"
87 86
                     >
88 87
                       <option v-for="(region, r) in regions" :key="r">
89
-                        {{
90
-                        region.regionName
91
-                        }}
88
+                        {{ region.regionName }}
92 89
                       </option>
93 90
                     </select>
94 91
                   </float-label>
@@ -195,44 +192,61 @@
195 192
                     </select>
196 193
                   </float-label>
197 194
                 </div>
198
-                <div class="form-row">
199
-                  <div class="form-group col-md-6 mt-2">
200
-                    <float-label label="ARRIVAL DATE" fixed>
201
-                      <input
202
-                        type="date"
203
-                        class="form-control"
204
-                        name="occupationDate1"
205
-                        v-model="dateParam"
206
-                      />
207
-                    </float-label>
195
+                <div class="form-group col-md-6 mt-2"></div>
196
+                <div class="form-group col-md-6 mt-4">
197
+                  <float-label label="ARRIVAL DATE" fixed>
198
+                    <input
199
+                      type="date"
200
+                      class="form-control"
201
+                      name="occupationDate1"
202
+                      v-model="dateParam"
203
+                    />
204
+                  </float-label>
208 205
 
209
-                    <div class="validation"></div>
210
-                  </div>
211
-                  <div class="form-group col-md-6 mt-2">
212
-                    <float-label label="DEPARTURE DATE" fixed>
213
-                      <input
214
-                        type="date"
215
-                        class="form-control"
216
-                        name="occupationDate2"
217
-                        v-model="depDateParam"
218
-                      />
219
-                    </float-label>
206
+                  <div class="validation"></div>
207
+                </div>
208
+                <div class="form-group col-md-6 mt-4">
209
+                  <float-label label="DEPARTURE DATE" fixed>
210
+                    <input
211
+                      type="date"
212
+                      class="form-control"
213
+                      name="occupationDate2"
214
+                      v-model="depDateParam"
215
+                    />
216
+                  </float-label>
220 217
 
221
-                    <div class="validation"></div>
222
-                  </div>
223
-                  <div class="form-group col-md-6 mt-2">
224
-                    <float-label label="PURCHASE PRICE">
225
-                      <input
226
-                        class="form-control"
227
-                        placeholder="R"
228
-                        type="number"
229
-                        step="any"
230
-                        name="purchasePrice"
231
-                        v-model="weekParam.sellPrice"
232
-                      />
233
-                    </float-label>
234
-                    <div class="validation"></div>
235
-                  </div>
218
+                  <div class="validation"></div>
219
+                </div>
220
+                <div class="form-group col-md-6 mt-2">
221
+                  <label v-if="!weekParam.askingPrice" for="tsaPrice" class="uniSelectLabel"
222
+                    >ASKING PRICE</label
223
+                  >
224
+                  <float-label label="ASKING PRICE">
225
+                    <currency-input
226
+                      onclick="this.setSelectionRange(0, this.value.length)"
227
+                      name="tsaPrice"
228
+                      :value="weekParam.askingPrice"
229
+                      @input="weekParam.askingPrice = $event"
230
+                      v-model="weekParam.askingPrice"
231
+                      id="resPrice"
232
+                      class="form-control uniInput"
233
+                    />
234
+                  </float-label>
235
+                  <div class="validation"></div>
236
+                </div>
237
+                <div class="form-group col-md-6 mt-2">
238
+                  <float-label label="FINAL PRICE">
239
+                    <currency-input
240
+                      onclick="this.setSelectionRange(0, this.value.length)"
241
+                      name="tsPrice"
242
+                      :value="weekParam.sellPrice"
243
+                      @input="weekParam.sellPrice = $event"
244
+                      v-model="weekParam.sellPrice"
245
+                      id="resPrice"
246
+                      class="form-control uniInput"
247
+                    />
248
+                  </float-label>
249
+                  <div class="validation"></div>
236 250
                 </div>
237 251
               </div>
238 252
             </div>
@@ -244,23 +258,33 @@
244 258
                     type="checkbox"
245 259
                     class="custom-control-input"
246 260
                     id="customSwitch2"
247
-                    :checked="sellItem.currentYearBanked"
261
+                    :checked="weekParam.currentYearBanked"
262
+                    @change="changeCurrentBanked"
248 263
                   />
249
-                  <label
250
-                    class="custom-control-label"
251
-                    for="customSwitch2"
252
-                  >{{ sellItem.currentYearBanked ? "Yes" : "No" }}</label>
264
+                  <label class="custom-control-label" for="customSwitch2">
265
+                    {{ weekParam.currentYearBanked ? "Yes" : "No" }}
266
+                  </label>
253 267
                   <div
254 268
                     class="spacebanked1"
255
-                    :class="{ 'spacebanked1--clicked': sellItem.currentYearBanked }"
269
+                    :class="{ 'spacebanked1--clicked': weekParam.currentYearBanked }"
256 270
                   >
257 271
                     <div class="col-md-6">
258 272
                       <label
259 273
                         for="If yes, please confirm with whom"
260
-                        v-if="sellItem.currentYearBanked"
261
-                      >Please confirm with whom</label>
274
+                        v-if="weekParam.currentYearBanked"
275
+                        >Please confirm with whom</label
276
+                      >
277
+                      <select
278
+                        class="form-control uniSelect"
279
+                        name="spacebankOwner"
280
+                        v-if="weekParam.currentYearBanked"
281
+                        v-model="weekParam.bankedWith"
282
+                      >
283
+                        <option v-for="(item, i) in bankedEntities" :key="i" :value="item">{{
284
+                          item
285
+                        }}</option>
286
+                      </select>
262 287
                     </div>
263
-                    <div class="validation"></div>
264 288
                   </div>
265 289
                 </div>
266 290
               </div>
@@ -394,7 +418,9 @@
394 418
             <div class="form">
395 419
               <div class="row">
396 420
                 <div class="form-group col-md-6">
397
-                  <label v-if="!weekParam.weekStatus" class="uniSelectLabel" for="status">STATUS</label>
421
+                  <label v-if="!weekParam.weekStatus" class="uniSelectLabel" for="status"
422
+                    >STATUS</label
423
+                  >
398 424
                   <float-label label="STATUS" fixed>
399 425
                     <select
400 426
                       class="form-control uniSelect"
@@ -408,7 +434,6 @@
408 434
                   </float-label>
409 435
                 </div>
410 436
                 <div class="form-group col-md-6">
411
-                  <label v-if="!weekParam.publish" class="uniSelectLabel" for="publish">Publish</label>
412 437
                   <float-label label="Publish" fixed>
413 438
                     <select
414 439
                       class="form-control uniSelect"
@@ -435,21 +460,15 @@
435 460
                 </div>
436 461
               </div>
437 462
             </div>
438
-            <div class="form">
439
-              <div id="sendmessage">Your details has been sent. Thank you!</div>
440
-              <div id="errormessage"></div>
441
-              <div class="text-center col-12">
463
+            <div class="row">
464
+              <div class="text-center col-6">
442 465
                 <button class="btn-solid-blue" v-on:click="saveEdit()">Save</button>
443 466
               </div>
444
-              <div class="text-center col-12">
467
+              <div class="text-center col-6">
445 468
                 <button class="btn-solid-blue" v-on:click="backToListView()">Back</button>
446 469
               </div>
447
-              <br />
448
-              <br />
449 470
             </div>
450 471
           </div>
451
-          <br />
452
-          <br />
453 472
         </div>
454 473
       </div>
455 474
     </section>
@@ -518,17 +537,11 @@ export default {
518 537
     this.selectedWeekType = this.weekParam.weekType;
519 538
     this.selectedStatus = this.weekParam.status;
520 539
     this.selectedPublish = this.weekParam.publish;
521
-    var date = new Date(this.weekParam.arrivalDate)
522
-      .toISOString()
523
-      .substring(0, 10);
540
+    var date = new Date(this.weekParam.arrivalDate).toISOString().substring(0, 10);
524 541
     this.dateParam = date;
525
-    var depDate = new Date(this.weekParam.departureDate)
526
-      .toISOString()
527
-      .substring(0, 10);
542
+    var depDate = new Date(this.weekParam.departureDate).toISOString().substring(0, 10);
528 543
     this.depDateParam = depDate;
529
-    var datePub = new Date(this.weekParam.publish)
530
-      .toISOString()
531
-      .substring(0, 10);
544
+    var datePub = new Date(this.weekParam.pulbishedDate).toISOString().substring(0, 10);
532 545
     this.pubDateParam = datePub;
533 546
   },
534 547
   created() {
@@ -562,11 +575,7 @@ export default {
562 575
     },
563 576
     filteredResort() {
564 577
       let list = [];
565
-      if (
566
-        this.sellItem &&
567
-        this.sellItem.region &&
568
-        this.sellItem.region.regionCode
569
-      ) {
578
+      if (this.sellItem && this.sellItem.region && this.sellItem.region.regionCode) {
570 579
         const item = this.detailedRegion.find(
571 580
           region => region.region.regionCode === this.sellItem.region.regionCode
572 581
         );
@@ -584,12 +593,7 @@ export default {
584 593
   },
585 594
   methods: {
586 595
     ...mapActions("individual", ["getIndividual"]),
587
-    ...mapActions("timeshare", [
588
-      "initTimeshare",
589
-      "onResortChange",
590
-      "saveWeek",
591
-      "getBlankWeek"
592
-    ]),
596
+    ...mapActions("timeshare", ["initTimeshare", "onResortChange", "saveWeek", "getBlankWeek"]),
593 597
     ...mapActions("payment", ["addPayment"]),
594 598
     ...mapActions("bank", ["getBanks"]),
595 599
     ...mapActions("myWeeks", ["getItems", "getWeek", "editSave"]),
@@ -626,18 +630,12 @@ export default {
626 630
       if (this.week.owner.cellNumber === "") {
627 631
         this.week.owner.cellNumber = "0000000000";
628 632
       }
629
-      this.weekParam.arrivalDate = new Date(this.dateParam)
630
-        .toISOString()
631
-        .substring(0, 10);
632
-      this.weekParam.departureDate = new Date(this.depDateParam)
633
-        .toISOString()
634
-        .substring(0, 10);
635
-      this.weekParam.publishedDate = new Date(this.pubDateParam)
636
-        .toISOString()
637
-        .substring(0, 10);
633
+      this.weekParam.arrivalDate = new Date(this.dateParam).toISOString().substring(0, 10);
634
+      this.weekParam.departureDate = new Date(this.depDateParam).toISOString().substring(0, 10);
635
+      this.weekParam.pulbishedDate = new Date(this.pubDateParam).toISOString().substring(0, 19);
638 636
       this.weekParam.regionId = this.weekParam.region.id;
639 637
       this.weekParam.agentId = this.week.agentId;
640
-      this.weekParam.bankedWith = this.week.bankedWith;
638
+      //this.weekParam.bankedWith = this.week.bankedWith;
641 639
       this.weekParam.owner = this.week.owner;
642 640
       parseFloat(this.weekParam.sellPrice);
643 641
       parseFloat(this.weekParam.levyAmount);
@@ -649,7 +647,9 @@ export default {
649 647
       delete this.weekParam.owner.howMarried;
650 648
       delete this.weekParam.cellNumber;
651 649
       console.log(JSON.stringify(this.weekParam));
652
-      this.editSave(this.weekParam);
650
+      // this.editSave(this.weekParam).then(() => {
651
+      //   this.backToListView();
652
+      // });
653 653
     },
654 654
     resortChange() {
655 655
       this.onResortChange({
@@ -665,6 +665,10 @@ export default {
665 665
         this.week.otherResort = false;
666 666
       }
667 667
     },
668
+    changeCurrentBanked() {
669
+      this.weekParam.bankedWith = undefined;
670
+      this.weekParam.currentYearBanked = !this.weekParam.currentYearBanked;
671
+    },
668 672
     backToListView() {
669 673
       this.$router.push("/status/timeshareAdmin");
670 674
     }

+ 342
- 0
src/components/admin/status/timeshareAdminList.vue View File

@@ -0,0 +1,342 @@
1
+<template>
2
+  <section id="contact2">
3
+    <div class="container">
4
+      <div class="section-header">
5
+        <h1>Property Admin</h1>
6
+      </div>
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" />
10
+        </div>
11
+      </div>
12
+      <div class="row">
13
+        <br />
14
+      </div>
15
+      <div class="row">
16
+        <div class="col-lg-12">
17
+          <table class="table table-striped table-responsive">
18
+            <thead>
19
+              <tr>
20
+                <th scope="col" v-for="(col, c) in displayColumns" :key="c">
21
+                  <div @click="sortBy(columns[c])" style="cursor: pointer;">
22
+                    <div class="d-flex bd-highlight">
23
+                      <div class="w-100 bd-highlight">{{ col }}</div>
24
+                      <div class="flex-shrink-1 bd-highlight">
25
+                        <img
26
+                          src="../../../../public/img/sort-up.png"
27
+                          height="8px;"
28
+                          v-if="sortKey === columns[c] && reverse"
29
+                        />
30
+                        <img
31
+                          src="../../../../public/img/sort-down.png"
32
+                          height="8px;"
33
+                          v-if="sortKey === columns[c] && !reverse"
34
+                        />
35
+                      </div>
36
+                    </div>
37
+                  </div>
38
+                </th>
39
+                <!-- <th scope="col">Property</th>
40
+                <th scope="col">Unit</th>
41
+                <th scope="col">Size</th>
42
+                <th scope="col">Price Ex VAT</th>
43
+                <th scope="col">Region</th>
44
+                <th scope="col">Town</th>
45
+                <th scope="col">Suburb</th>
46
+                <th scope="col">Status</th>
47
+                <th scope="col">Type</th>-->
48
+                <th scope="col">Publish</th>
49
+                <th scope="col">Edit</th>
50
+                <th scope="col">Delete</th>
51
+              </tr>
52
+            </thead>
53
+            <tbody>
54
+              <tr v-for="(item, i) in DisplayItems" :key="i">
55
+                <td>{{ item.owner }}</td>
56
+                <td>{{ item.agent }}</td>
57
+                <td>{{ item.resort.resortName }}</td>
58
+                <td>{{ item.weekNumber }}</td>
59
+                <td>{{ item.unitNumber }}</td>
60
+                <td>{{ item.bedrooms }}</td>
61
+                <td>{{ item.season }}</td>
62
+                <td>{{ item.region.regionName }}</td>
63
+                <td>{{ item.sellPrice | toCurrency }}</td>
64
+                <td>{{ item.pulbishedDate | toDate }}</td>
65
+                <td>{{ item.weekStatus }}</td>
66
+                <td v-if="!item.publish">
67
+                  <a v-on:click="Publish(item)">
68
+                    <img src="../../../../public/img/icons/Upload.png" height="25" width="25" />
69
+                  </a>
70
+                </td>
71
+                <td v-else>
72
+                  <a v-on:click="Unpublish(item)">
73
+                    <img
74
+                      src="../../../../public/img/icons/Download-grey.png"
75
+                      height="25"
76
+                      width="25"
77
+                    />
78
+                  </a>
79
+                </td>
80
+                <td>
81
+                  <a v-on:click="Edit(item)">
82
+                    <img src="../../../../public/img/icons/Edit.png" height="25" width="25" />
83
+                  </a>
84
+                </td>
85
+                <td>
86
+                  <a v-on:click="Delete(item)">
87
+                    <img src="../../../../public/img/icons/delete.png" height="25" width="25" />
88
+                  </a>
89
+                </td>
90
+              </tr>
91
+            </tbody>
92
+          </table>
93
+          <div class="d-flex justify-content-between" v-if="showPager">
94
+            <div class="p-1">
95
+              {{ currentPage + " / " + PageCount + (" - (" + FilteredListings.length + " items)") }}
96
+            </div>
97
+            <div class="p-1">
98
+              <BasePagination
99
+                :currentPage="currentPage"
100
+                :pageCount="PageCount"
101
+                @nextPage="pageChangeHandle('next')"
102
+                @previousPage="pageChangeHandle('previous')"
103
+                @loadPage="pageChangeHandle"
104
+              />
105
+            </div>
106
+            <div class="p-2">
107
+              <div class="d-flex flex-row">
108
+                <div>
109
+                  <select
110
+                    class="form-control uniSelect"
111
+                    v-model="visibleItemsPerPageCount"
112
+                    @change="onChangeItemsPerPage()"
113
+                  >
114
+                    <option v-for="(item, i) in itemsPerPageList" :key="i">{{ item }}</option>
115
+                  </select>
116
+                </div>
117
+              </div>
118
+            </div>
119
+          </div>
120
+          <div class="p-2">
121
+            <div class="d-flex flex-row">
122
+              <div>
123
+                <button v-if="sortKey !== 'id'" class="btn-solid-blue" @click="ClearSort">
124
+                  Clear Sort
125
+                </button>
126
+              </div>
127
+            </div>
128
+          </div>
129
+        </div>
130
+      </div>
131
+      <div v-if="wait" id="preloader"></div>
132
+    </div>
133
+  </section>
134
+</template>
135
+
136
+<script>
137
+/* eslint-disable */
138
+import { mapState, mapActions, mapGetters } from "vuex";
139
+import Log from "../../../assets/Log";
140
+import BasePagination from "../../shared/basePagination";
141
+import ItemsPerPageList from "../../../assets/staticData/itemsPerPageFive";
142
+import _ from "lodash";
143
+
144
+export default {
145
+  components: {
146
+    BasePagination
147
+  },
148
+  data() {
149
+    return {
150
+      hover: -1,
151
+      filter: undefined,
152
+      userId: Log.getUser().id,
153
+      wait: true,
154
+      showPager: true,
155
+      visibleItemsPerPageCount: 10,
156
+      itemsPerPageList: ItemsPerPageList,
157
+      currentPage: 1,
158
+      reverse: true,
159
+      sortKey: "id",
160
+      displayColumns: [
161
+        "Owner",
162
+        "Agent",
163
+        "Resort",
164
+        "Week Module",
165
+        "Unit",
166
+        "Beds",
167
+        "Season",
168
+        "Region",
169
+        "Amount",
170
+        "Submitted",
171
+        "Status"
172
+      ],
173
+      columns: [
174
+        "owner",
175
+        "agent",
176
+        "resort",
177
+        "weekNumber",
178
+        "unitNumber",
179
+        "bedrooms",
180
+        "season",
181
+        "region",
182
+        "sellPrice",
183
+        "weekStatus"
184
+      ]
185
+    };
186
+  },
187
+  methods: {
188
+    ...mapActions("myWeeks", ["getAllItems"]),
189
+    ...mapActions("myWeeks", ["getItems", "verifyWeek", "editSave"]),
190
+    Publish(item) {
191
+      var today = new Date();
192
+      var dd = String(today.getDate()).padStart(2, "0");
193
+      var mm = String(today.getMonth() + 1).padStart(2, "0"); //January is 0!
194
+      var yyyy = today.getFullYear();
195
+      item.pulbishedDate = today.toISOString().substring(0, 19);
196
+      item.publish = true;
197
+      item.owner = {
198
+        name: item.owner
199
+      };
200
+      item.agent = {
201
+        name: item.agent
202
+      };
203
+      console.log(JSON.stringify(item));
204
+      this.editSave(item);
205
+    },
206
+    Unpublish(item) {
207
+      item.publish = false;
208
+      item.owner = {
209
+        name: item.owner
210
+      };
211
+      item.agent = {
212
+        name: item.agent
213
+      };
214
+      console.log(item);
215
+      this.editSave(item);
216
+    },
217
+    Edit(item) {
218
+      this.$router.push({ name: "EditTimeshare", params: { weekParam: item } });
219
+      // this.$router.push(`/editTimeShare/${item.id}`);
220
+    },
221
+    Delete(item) {
222
+      this.deleteProperty(item.id);
223
+    },
224
+    async pageChangeHandle(value) {
225
+      switch (value) {
226
+        case "next":
227
+          this.currentPage += 1;
228
+          break;
229
+        case "previous":
230
+          this.currentPage -= 1;
231
+          break;
232
+        default:
233
+          this.currentPage = value;
234
+      }
235
+    },
236
+    sortBy(sortKey) {
237
+      this.reverse = this.sortKey === sortKey ? !this.reverse : false;
238
+      this.sortKey = sortKey;
239
+    },
240
+    ClearSort() {
241
+      this.reverse = true;
242
+      this.sortKey = "id";
243
+    }
244
+  },
245
+  computed: {
246
+    ...mapState("propertyList", ["properties"]),
247
+    ...mapGetters({ getNeedsVerify: "myWeeks/getNeedsVerify" }),
248
+    FilteredListings() {
249
+      if (this.filter) {
250
+        const list = _.filter(this.getNeedsVerify, item =>
251
+          Object.values(item).some(
252
+            i =>
253
+              JSON.stringify(i)
254
+                .toLowerCase()
255
+                .indexOf(this.filter.toLowerCase()) > -1
256
+          )
257
+        );
258
+        return _.orderBy(list, this.sortKey, this.SortDirection);
259
+      } else {
260
+        return _.orderBy(this.getNeedsVerify, this.sortKey, this.SortDirection);
261
+      }
262
+    },
263
+    PageCount() {
264
+      return this.visibleItemsPerPageCount !== 0
265
+        ? Math.ceil(this.FilteredListings.length / this.visibleItemsPerPageCount)
266
+        : 1;
267
+    },
268
+    DisplayItems() {
269
+      const list = this.FilteredListings;
270
+      const startSlice = (this.currentPage - 1) * this.visibleItemsPerPageCount;
271
+      let endSlice = this.currentPage * this.visibleItemsPerPageCount;
272
+      if (endSlice > list.length) {
273
+        endSlice = list.length;
274
+      }
275
+      return list.slice(startSlice, endSlice);
276
+    },
277
+    SortDirection() {
278
+      return this.reverse ? "desc" : "asc";
279
+    }
280
+  },
281
+  created() {
282
+    this.getItems(this.userId).then(() => {
283
+      this.wait = false;
284
+    });
285
+  },
286
+  mounted() {
287
+    // this.getAdminProperties(this.userId).then(fulfuilled => {
288
+    //   this.wait = false;
289
+    //   if (this.itemsPerPageList && this.itemsPerPageList.length > 0) {
290
+    //     const [startItem] = this.itemsPerPageList;
291
+    //     this.visibleItemsPerPageCount = startItem;
292
+    //   }
293
+    // });
294
+  },
295
+  watch: {
296
+    filter: {
297
+      immediate: true,
298
+      handler(val, oldVal) {
299
+        if (val != oldVal) {
300
+          this.currentPage = 1;
301
+        }
302
+      }
303
+    }
304
+  }
305
+};
306
+</script>
307
+
308
+<style lang="scss" scoped>
309
+.refbyAgent {
310
+  will-change: transform;
311
+  transition: height 500ms;
312
+  height: 0px;
313
+}
314
+
315
+.refbyAgent--clicked {
316
+  height: 150px;
317
+}
318
+
319
+.spacebanked1 {
320
+  will-change: transform;
321
+  transition: height 500ms;
322
+  height: 0px;
323
+}
324
+
325
+.spacebanked1--clicked {
326
+  height: 150px;
327
+}
328
+
329
+.custom-file-label {
330
+  border-width: 2px;
331
+  border-color: rgb(27, 117, 187);
332
+  margin-bottom: 20px;
333
+}
334
+
335
+.custom-file-label::after {
336
+  border-left: none;
337
+  border-bottom: solid;
338
+  border-width: 2px;
339
+  border-color: rgb(27, 117, 187);
340
+  font-family: "Muli";
341
+}
342
+</style>

+ 5
- 7
src/components/admin/status/timeshareAdminPage.vue View File

@@ -60,7 +60,8 @@
60 60
       </div>-->
61 61
       <div class="row">
62 62
         <div class="col-md-12">
63
-          <ListView
63
+          <timeshareList />
64
+          <!-- <ListView
64 65
             :items="getNeedsVerify"
65 66
             :editable="true"
66 67
             :deleteable="true"
@@ -73,7 +74,7 @@
73 74
             @onClearSelected="onClearSelected"
74 75
             @onEdit="onEdit"
75 76
             :showNew="false"
76
-          />
77
+          /> -->
77 78
         </div>
78 79
       </div>
79 80
       <!-- <div class="offset-1 col-md-6">
@@ -98,11 +99,12 @@
98 99
 import { mapState, mapActions, mapGetters } from "vuex";
99 100
 import Log from "../../../assets/Log";
100 101
 import ListView from "../../shared/listView.vue";
102
+import timeshareList from "./timeshareAdminList";
101 103
 
102 104
 export default {
103 105
   name: "TimeshareAdmin",
104 106
   components: {
105
-    ListView
107
+    timeshareList
106 108
   },
107 109
   data() {
108 110
     return {
@@ -124,10 +126,6 @@ export default {
124 126
       region: ""
125 127
     };
126 128
   },
127
-  mounted() {
128
-    this.getItems(this.user.id);
129
-    this.initTimeshare(0);
130
-  },
131 129
   computed: {
132 130
     ...mapState("timeshare", ["resorts", "regions", "seasons", "detailedRegion"]),
133 131
     ...mapState("individual", ["indiv"]),

+ 7
- 7
src/components/property/commercial/createProperty/commercialCreateNew.vue View File

@@ -438,13 +438,13 @@ export default {
438 438
         this.property.userId = this.user.id;
439 439
       }
440 440
 
441
-      this.property.propertyUserFields.forEach(item => {
442
-        if (item.value === true) {
443
-          item.value = "yes";
444
-        } else if (item.value === false) {
445
-          item.value = "no";
446
-        }
447
-      });
441
+      // this.property.propertyUserFields.forEach(item => {
442
+      //   if (item.value === true) {
443
+      //     item.value = "yes";
444
+      //   } else if (item.value === false) {
445
+      //     item.value = "no";
446
+      //   }
447
+      // });
448 448
 
449 449
       console.log(this.property);
450 450
 

+ 4
- 1
src/components/property/commercial/singleView/contentSection.vue View File

@@ -89,7 +89,10 @@
89 89
           <div v-if="property.displayData.length > 0">
90 90
             <div v-for="(data, i) in property.displayData" :key="i" class="row my-3">
91 91
               <div v-for="(field, j) in data.values" :key="j" class="col-md-6">
92
-                <div v-if="field.value.toUpperCase() != 'TRUE'">
92
+                <div
93
+                  :style="field.value.toUpperCase() === 'FALSE' ? 'display:none' : 'display:show'"
94
+                  v-if="field.value.toUpperCase() != 'TRUE'"
95
+                >
93 96
                   <i class="fa fa-check-circle"></i>
94 97
                   {{ field.value }} {{ field.name }}
95 98
                 </div>

+ 38
- 42
src/components/property/editProperty/editProperty.vue View File

@@ -67,9 +67,7 @@
67 67
                   >
68 68
                     <option value="0">Please select type *</option>
69 69
                     <option v-for="item in propertyTypes" :value="item.id" :key="item.id">
70
-                      {{
71
-                      item.description
72
-                      }}
70
+                      {{ item.description }}
73 71
                     </option>
74 72
                   </select>
75 73
                 </div>
@@ -110,7 +108,8 @@
110 108
                           for="price"
111 109
                           class="uniSelectLabel"
112 110
                           style="text-transform:uppercase; margin-left:17px; background-color:white"
113
-                        >{{ property.salesTypeString }} Price</label>
111
+                          >{{ property.salesTypeString }} Price</label
112
+                        >
114 113
                       </div>
115 114
                       <input
116 115
                         class="form-control uniInput"
@@ -149,7 +148,9 @@
149 148
                   </div>
150 149
                   <div
151 150
                     class="row my-3"
152
-                    v-if="property.statusString === 'Sold' || property.statusString ==='Rented Out'"
151
+                    v-if="
152
+                      property.statusString === 'Sold' || property.statusString === 'Rented Out'
153
+                    "
153 154
                   >
154 155
                     <div class="col-md-12">
155 156
                       Hide Property After
@@ -272,11 +273,9 @@
272 273
                   </div>
273 274
                   <div class="row my-3">
274 275
                     <div class="col-md-12">
275
-                      <button
276
-                        type="button"
277
-                        @click="clearAddress()"
278
-                        class="btn-solid-blue"
279
-                      >Clear Address</button>
276
+                      <button type="button" @click="clearAddress()" class="btn-solid-blue">
277
+                        Clear Address
278
+                      </button>
280 279
                     </div>
281 280
                   </div>
282 281
                 </div>
@@ -314,11 +313,7 @@
314 313
                     </div>
315 314
                     <div v-else-if="field.type === 'yesno'">
316 315
                       {{ field.name }}
317
-                      <input
318
-                        type="checkbox"
319
-                        v-model="field.value"
320
-                        :disabled="!canEdit"
321
-                      />
316
+                      <input type="checkbox" v-model="field.value" :disabled="!canEdit" />
322 317
                     </div>
323 318
                     <div v-else class="display:none"></div>
324 319
                   </div>
@@ -333,8 +328,10 @@
333 328
               </div>
334 329
               <div class="form-group row">
335 330
                 <div class="col-md-12">
336
-                  <label class="uniSelectLabel">Virtual Tour (URL)</label>
337
-                  <div class="input-group-prepend">
331
+                  <label v-if="!property.virtualTour" class="uniSelectLabel"
332
+                    >Virtual Tour (URL)</label
333
+                  >
334
+                  <float-label label="Virtual Tour (URL)">
338 335
                     <input
339 336
                       class="form-control uniInput"
340 337
                       type="link"
@@ -343,13 +340,13 @@
343 340
                       v-model="property.virtualTour"
344 341
                       :disabled="!canEdit"
345 342
                     />
346
-                  </div>
343
+                  </float-label>
347 344
                 </div>
348 345
               </div>
349
-              <div class="row">
350
-                <div class="col-md-12">
351
-                  <label class="uniSelectLabel">Video (URL)</label>
352
-                  <div class="input-group-prepend">
346
+              <div class="row mt-3">
347
+                <div class="col-md-12 mt-2">
348
+                  <label v-if="!property.video" class="uniSelectLabel">Video (URL)</label>
349
+                  <float-label label="Video (URL)">
353 350
                     <input
354 351
                       class="form-control uniInput"
355 352
                       type="link"
@@ -358,7 +355,7 @@
358 355
                       v-model="property.video"
359 356
                       :disabled="!canEdit"
360 357
                     />
361
-                  </div>
358
+                  </float-label>
362 359
                 </div>
363 360
               </div>
364 361
               <div class="row mt-3">
@@ -377,8 +374,12 @@
377 374
                 @DeleteImage="DeleteImage"
378 375
                 :mayEdit="canEdit"
379 376
               />
380
-              <button v-if="!wait" type="button" @click="SubmitData()" class="btn-solid-blue">Save</button>
381
-              <button v-if="!wait" type="button" @click="Close()" class="btn-solid-blue">Close</button>
377
+              <button v-if="!wait" type="button" @click="SubmitData()" class="btn-solid-blue">
378
+                Save
379
+              </button>
380
+              <button v-if="!wait" type="button" @click="Close()" class="btn-solid-blue">
381
+                Close
382
+              </button>
382 383
               <div v-if="!addressSet">
383 384
                 <p class="alert myError">Please enter an address.</p>
384 385
               </div>
@@ -404,7 +405,7 @@ export default {
404 405
   components: {
405 406
     mapSection,
406 407
     ImageLoad,
407
-    VueEditor,
408
+    VueEditor
408 409
   },
409 410
   data() {
410 411
     return {
@@ -416,16 +417,11 @@ export default {
416 417
       customToolbar: [
417 418
         [{ header: [false, 1, 2, 3, 4, 5, 6] }],
418 419
         ["bold", "italic", "underline", "strike"],
419
-        [
420
-          { align: "" },
421
-          { align: "center" },
422
-          { align: "right" },
423
-          { align: "justify" },
424
-        ],
420
+        [{ align: "" }, { align: "center" }, { align: "right" }, { align: "justify" }],
425 421
         [{ list: "ordered" }, { list: "bullet" }, { list: "check" }],
426 422
         [{ script: "sub" }, { script: "super" }],
427
-        [{ indent: "-1" }, { indent: "+1" }],
428
-      ],
423
+        [{ indent: "-1" }, { indent: "+1" }]
424
+      ]
429 425
     };
430 426
   },
431 427
   methods: {
@@ -433,7 +429,7 @@ export default {
433 429
       "getProperty",
434 430
       "getPropertyTypes",
435 431
       "getPropertyFields",
436
-      "updateProperty",
432
+      "updateProperty"
437 433
     ]),
438 434
     StatusChanged(item) {
439 435
       if (
@@ -496,7 +492,7 @@ export default {
496 492
         }
497 493
         this.property.newImages.push({
498 494
           image: this.images[i],
499
-          isDefault: setAsDefault,
495
+          isDefault: setAsDefault
500 496
         });
501 497
       }
502 498
 
@@ -504,7 +500,7 @@ export default {
504 500
 
505 501
       //console.log(JSON.stringify(this.property));
506 502
 
507
-      this.updateProperty(this.property).then((fulfilled) => {
503
+      this.updateProperty(this.property).then(fulfilled => {
508 504
         this.$router.push("/PropertyAdmin");
509 505
       });
510 506
     },
@@ -525,10 +521,10 @@ export default {
525 521
     },
526 522
     DeleteImage(item) {
527 523
       this.propertyImages[item].isDeleted = true;
528
-    },
524
+    }
529 525
   },
530 526
   mounted() {
531
-    this.getProperty(this.$route.params.id).then((fulfilled) => {
527
+    this.getProperty(this.$route.params.id).then(fulfilled => {
532 528
       this.wait = false;
533 529
       if (
534 530
         this.property.statusString === "Offer Pending" ||
@@ -547,7 +543,7 @@ export default {
547 543
       "propertyTypes",
548 544
       "propertyImages",
549 545
       "propertyFields",
550
-      "statuses",
546
+      "statuses"
551 547
     ]),
552 548
     savedImages() {
553 549
       const list = [];
@@ -567,8 +563,8 @@ export default {
567 563
         }
568 564
       }
569 565
       return list;
570
-    },
571
-  },
566
+    }
567
+  }
572 568
 };
573 569
 </script>
574 570
 

+ 7
- 7
src/components/property/residential/createProperty/residentialCreateNew.vue View File

@@ -421,13 +421,13 @@ export default {
421 421
       if (this.user) {
422 422
         this.property.userId = this.user.id;
423 423
       }
424
-      this.property.propertyUserFields.forEach(item => {
425
-        if (item.value === true) {
426
-          item.value = "yes";
427
-        } else if (item.value === false) {
428
-          item.value = "no";
429
-        }
430
-      });
424
+      // this.property.propertyUserFields.forEach(item => {
425
+      //   if (item.value === true) {
426
+      //     item.value = "yes";
427
+      //   } else if (item.value === false) {
428
+      //     item.value = "no";
429
+      //   }
430
+      // });
431 431
 
432 432
       this.saveProperty(this.property)
433 433
         .then(fulfilled => {

+ 6
- 1
src/components/property/residential/singleView/contentSection.vue View File

@@ -98,7 +98,12 @@
98 98
               <div class="col-md-8">
99 99
                 <div v-for="(data, i) in property.displayData" :key="i" class="row my-3">
100 100
                   <div v-for="(field, j) in data.values" :key="j" class="col-md-6">
101
-                    <div v-if="field.value !== 'yes'">
101
+                    <div
102
+                      :style="
103
+                        field.value.toUpperCase() === 'FALSE' ? 'display:none' : 'display:show'
104
+                      "
105
+                      v-if="field.value.toUpperCase() !== 'TRUE'"
106
+                    >
102 107
                       <i class="fa fa-check-circle"></i>
103 108
                       {{ field.value }} {{ field.name }}
104 109
                     </div>

+ 62
- 88
src/components/timeshare/sell/contentSection.vue View File

@@ -19,9 +19,7 @@
19 19
                   @change="changeRef"
20 20
                 />
21 21
                 <label class="custom-control-label" for="customSwitch1">
22
-                  {{
23
-                  refAgent ? "Yes" : "No"
24
-                  }}
22
+                  {{ refAgent ? "Yes" : "No" }}
25 23
                 </label>
26 24
                 <div class="refbyAgent" :class="{ 'refbyAgent--clicked': refAgent }">
27 25
                   <div class="col-md-6" v-if="refAgent">
@@ -32,11 +30,9 @@
32 30
                       name="agency"
33 31
                       v-model="sellItem.agencyId"
34 32
                     >
35
-                      <option
36
-                        v-for="(item, i) in agencies"
37
-                        :key="i"
38
-                        :value="item.id"
39
-                      >{{ item.agencyName }}</option>
33
+                      <option v-for="(item, i) in agencies" :key="i" :value="item.id">{{
34
+                        item.agencyName
35
+                      }}</option>
40 36
                     </select>
41 37
                   </div>
42 38
                   <div class="col-md-6" v-if="refAgent">
@@ -68,11 +64,9 @@
68 64
             <div class="form-row">
69 65
               <div class="form-group col-md-6 mt-2">
70 66
                 <div class="input-group">
71
-                  <label
72
-                    v-if="!sellItem.region"
73
-                    class="uniSelectLabel"
74
-                    for="weekInfoRegionSelect"
75
-                  >REGION</label>
67
+                  <label v-if="!sellItem.region" class="uniSelectLabel" for="weekInfoRegionSelect"
68
+                    >REGION</label
69
+                  >
76 70
                   <float-label label="REGION" style="width:100%">
77 71
                     <select
78 72
                       id="weekInfoRegionSelect"
@@ -82,9 +76,7 @@
82 76
                       style="font-size: 15px"
83 77
                     >
84 78
                       <option v-for="(region, r) in regions" :key="r" :value="region">
85
-                        {{
86
-                        region.regionName
87
-                        }}
79
+                        {{ region.regionName }}
88 80
                       </option>
89 81
                     </select>
90 82
                   </float-label>
@@ -103,11 +95,9 @@
103 95
               </div>
104 96
               <div class="form-group col-md-6 mt-2">
105 97
                 <div class="input-group">
106
-                  <label
107
-                    v-if="!sellItem.resort"
108
-                    class="uniSelectLabel"
109
-                    for="weekInfoResortSelect"
110
-                  >RESORT NAME</label>
98
+                  <label v-if="!sellItem.resort" class="uniSelectLabel" for="weekInfoResortSelect"
99
+                    >RESORT NAME</label
100
+                  >
111 101
                   <float-label label="RESORT NAME" style="width:100%">
112 102
                     <select
113 103
                       id="weekInfoResortSelect"
@@ -117,9 +107,7 @@
117 107
                     >
118 108
                       <option value="Other">Other</option>
119 109
                       <option v-for="(resort, r) in filteredResort" :key="r" :value="resort">
120
-                        {{
121
-                        resort.resortName
122
-                        }}
110
+                        {{ resort.resortName }}
123 111
                       </option>
124 112
                     </select>
125 113
                   </float-label>
@@ -206,7 +194,9 @@
206 194
                 <div class="validation"></div>
207 195
               </div>
208 196
               <div class="form-group col-md-6 mt-2">
209
-                <label v-if="!sellItem.bedrooms" class="uniSelectLabel" for="region">BEDROOM/S</label>
197
+                <label v-if="!sellItem.bedrooms" class="uniSelectLabel" for="region"
198
+                  >BEDROOM/S</label
199
+                >
210 200
                 <float-label label="BEDROOM/S">
211 201
                   <select
212 202
                     class="form-control uniSelect"
@@ -221,7 +211,9 @@
221 211
                 <div class="validation"></div>
222 212
               </div>
223 213
               <div class="form-group col-md-6 mt-2">
224
-                <label v-if="!sellItem.maxSleep" class="uniSelectLabel" for="region">SLEEP MAX</label>
214
+                <label v-if="!sellItem.maxSleep" class="uniSelectLabel" for="region"
215
+                  >SLEEP MAX</label
216
+                >
225 217
                 <float-label label="SLEEP MAX">
226 218
                   <select
227 219
                     class="form-control uniSelect"
@@ -251,7 +243,9 @@
251 243
                 <div class="validation"></div>
252 244
               </div>
253 245
               <div class="form-group col-md-6 mt-2">
254
-                <label v-if="!sellItem.weekType" class="uniSelectLabel" for="region">WEEK TYPE</label>
246
+                <label v-if="!sellItem.weekType" class="uniSelectLabel" for="region"
247
+                  >WEEK TYPE</label
248
+                >
255 249
                 <float-label label="WEEK TYPE">
256 250
                   <select
257 251
                     class="form-control uniSelect"
@@ -280,19 +274,16 @@
280 274
                   @change="changeCurrentBanked"
281 275
                 />
282 276
                 <label class="custom-control-label" for="customSwitch2">
283
-                  {{
284
-                  sellItem.currentYearBanked ? "Yes" : "No"
285
-                  }}
277
+                  {{ sellItem.currentYearBanked ? "Yes" : "No" }}
286 278
                 </label>
287 279
                 <div
288 280
                   class="spacebanked1"
289 281
                   :class="{ 'spacebanked1--clicked': sellItem.currentYearBanked }"
290 282
                 >
291 283
                   <div class="col-md-6">
292
-                    <label
293
-                      for="If yes, please confirm with whom"
294
-                      v-if="sellItem.currentYearBanked"
295
-                    >Please confirm with whom</label>
284
+                    <label for="If yes, please confirm with whom" v-if="sellItem.currentYearBanked"
285
+                      >Please confirm with whom</label
286
+                    >
296 287
                     <select
297 288
                       class="form-control uniSelect"
298 289
                       name="spacebankOwner"
@@ -382,11 +373,9 @@
382 373
               <div class="form-group col-md-6">
383 374
                 <div class="input-group">
384 375
                   <span v-if="!indiv.howMarried">
385
-                    <label
386
-                      v-if="indiv.howMarried === 'N/A'"
387
-                      for="howMarried"
388
-                      class="uniSelectLabel"
389
-                    >Marital Status</label>
376
+                    <label v-if="indiv.howMarried === 'N/A'" for="howMarried" class="uniSelectLabel"
377
+                      >Marital Status</label
378
+                    >
390 379
                   </span>
391 380
 
392 381
                   <float-label label="Marital Status" style="width:100%">
@@ -397,7 +386,9 @@
397 386
                     >
398 387
                       <option value="N/A">N/A</option>
399 388
                       <option value="In Community Of Property">In Community Of Property</option>
400
-                      <option value="Out of Community Of Property">Out of Community Of Property</option>
389
+                      <option value="Out of Community Of Property"
390
+                        >Out of Community Of Property</option
391
+                      >
401 392
                       <option value="Other">Other</option>
402 393
                       <option value="Traditional Wedding">Traditional Wedding</option>
403 394
                       <option value="Single">Single</option>
@@ -644,9 +635,9 @@
644 635
                 class="form-group col-md-12"
645 636
                 style="border:solid;border-width:2px; border-color:rgb(27, 117, 187); border-radius: 3px"
646 637
               >
647
-                <p
648
-                  style="text-align: left; margin:auto; padding:10px"
649
-                >1. With respect to my timeshare module/week, I confirm that:</p>
638
+                <p style="text-align: left; margin:auto; padding:10px">
639
+                  1. With respect to my timeshare module/week, I confirm that:
640
+                </p>
650 641
                 <div class="validation"></div>
651 642
               </div>
652 643
             </div>
@@ -665,9 +656,7 @@
665 656
                     @change="changeLeviesPaidInFull"
666 657
                   />
667 658
                   <label class="custom-control-label" for="customSwitch3">
668
-                    {{
669
-                    sellItem.leviesPaidInFull ? "Yes" : "No"
670
-                    }}
659
+                    {{ sellItem.leviesPaidInFull ? "Yes" : "No" }}
671 660
                   </label>
672 661
                 </div>
673 662
                 <div class="validation"></div>
@@ -688,9 +677,7 @@
688 677
                     @change="changeWeekPlacedForRental"
689 678
                   />
690 679
                   <label class="custom-control-label" for="customSwitch4">
691
-                    {{
692
-                    sellItem.weekPlacedForRental ? "Yes" : "No"
693
-                    }}
680
+                    {{ sellItem.weekPlacedForRental ? "Yes" : "No" }}
694 681
                   </label>
695 682
                 </div>
696 683
                 <div class="validation"></div>
@@ -812,7 +799,9 @@
812 799
               </div>
813 800
             </div>
814 801
             <div class="text-center col-12" v-if="CanSave">
815
-              <button class="btn-solid-blue" v-if="!sellItem.id" @click="submitSale()">SUBMIT</button>
802
+              <button class="btn-solid-blue" v-if="!sellItem.id" @click="submitSale()">
803
+                SUBMIT
804
+              </button>
816 805
               <button class="btn-solid-blue" v-else @click="newSale()">NEW WEEK</button>
817 806
             </div>
818 807
             <!-- <div class="text-center col-12">
@@ -843,18 +832,18 @@ export default {
843 832
   name: "TimeshareToSell",
844 833
   props: {
845 834
     weekId: {
846
-      default: 0,
847
-    },
835
+      default: 0
836
+    }
848 837
   },
849 838
   data() {
850 839
     return {
851 840
       wait: false,
852
-      userLoggedIn: Log.isLoggedIn(),
841
+      userLoggedIn: Log.isLoggedIn()
853 842
     };
854 843
   },
855 844
   components: {
856 845
     addressAutoComplete,
857
-    Alert,
846
+    Alert
858 847
   },
859 848
   mounted() {
860 849
     if (this.sellItem.id) {
@@ -880,13 +869,13 @@ export default {
880 869
       "sellItem",
881 870
       "agencies",
882 871
       "agents",
883
-      "getTemplate",
872
+      "getTemplate"
884 873
     ]),
885 874
     ...mapState("individual", ["indiv"]),
886 875
     ...mapState("authentication", ["isLoggedIn"]),
887 876
     ...mapGetters({
888 877
       user: "authentication/getUser",
889
-      person: "authentication/getPerson",
878
+      person: "authentication/getPerson"
890 879
     }),
891 880
     ...mapState("bank", ["banks"]),
892 881
     refAgent() {
@@ -895,14 +884,9 @@ export default {
895 884
     ...mapGetters("fees", ["getListingFee"]),
896 885
     filteredResort() {
897 886
       let list = [];
898
-      if (
899
-        this.sellItem &&
900
-        this.sellItem.region &&
901
-        this.sellItem.region.regionCode
902
-      ) {
887
+      if (this.sellItem && this.sellItem.region && this.sellItem.region.regionCode) {
903 888
         const item = this.detailedRegion.find(
904
-          (region) =>
905
-            region.region.regionCode === this.sellItem.region.regionCode
889
+          region => region.region.regionCode === this.sellItem.region.regionCode
906 890
         );
907 891
         if (item) {
908 892
           list = item.children;
@@ -910,14 +894,14 @@ export default {
910 894
       } else {
911 895
         list = this.resorts;
912 896
       }
913
-      return _.sortBy(list, (x) => x.resortName);
897
+      return _.sortBy(list, x => x.resortName);
914 898
     },
915 899
     isLoggedIn() {
916 900
       return this.user && this.person;
917 901
     },
918 902
     displayNotDeletedAgents() {
919 903
       var notDeletedArr = [];
920
-      this.agents.forEach((agent) => {
904
+      this.agents.forEach(agent => {
921 905
         if (!agent.isDeleted) {
922 906
           if (agent.agencyId === this.sellItem.agencyId) {
923 907
             notDeletedArr.push(agent);
@@ -928,26 +912,17 @@ export default {
928 912
     },
929 913
     CanSave() {
930 914
       if (this.indiv.howMarried === "In Community Of Property") {
931
-        if (
932
-          this.indiv.spouseName ||
933
-          this.indiv.spouseSurname ||
934
-          this.spouseEmail
935
-        ) {
915
+        if (this.indiv.spouseName || this.indiv.spouseSurname || this.spouseEmail) {
936 916
           return true;
937 917
         }
938 918
         return false;
939 919
       }
940 920
       return true;
941
-    },
921
+    }
942 922
   },
943 923
   methods: {
944 924
     ...mapActions("individual", ["getIndividual"]),
945
-    ...mapActions("timeshare", [
946
-      "initTimeshare",
947
-      "onResortChange",
948
-      "saveWeek",
949
-      "getBlankWeek",
950
-    ]),
925
+    ...mapActions("timeshare", ["initTimeshare", "onResortChange", "saveWeek", "getBlankWeek"]),
951 926
     ...mapActions("payment", ["addPayment"]),
952 927
     ...mapActions("bank", ["getBanks"]),
953 928
     newSale() {
@@ -958,7 +933,8 @@ export default {
958 933
       if (this.userLoggedIn) {
959 934
         this.sellItem.ownerObject = this.indiv;
960 935
         this.sellItem.status = undefined;
961
-        this.saveWeek(this.sellItem).then((fulfilled) => {
936
+        this.sellItem.weekStatus = "For Sale";
937
+        this.saveWeek(this.sellItem).then(fulfilled => {
962 938
           this.paygateRedirect();
963 939
         });
964 940
       }
@@ -971,16 +947,16 @@ export default {
971 947
         creatydById: Log.getUser().id, //Log.getUser().id,
972 948
         amount: amount,
973 949
         paymentStatus: "",
974
-        paymentToken: "",
950
+        paymentToken: ""
975 951
       };
976 952
 
977
-      this.addPayment(paymentObj).then((res) => {
953
+      this.addPayment(paymentObj).then(res => {
978 954
         this.$router.push({
979 955
           name: "PaymentGateway",
980 956
           params: {
981 957
             paymentReqId: res.PAY_REQUEST_ID,
982
-            checksum: res.CHECKSUM,
983
-          },
958
+            checksum: res.CHECKSUM
959
+          }
984 960
         });
985 961
       });
986 962
     },
@@ -1005,7 +981,7 @@ export default {
1005 981
     resortChange() {
1006 982
       this.onResortChange({
1007 983
         resortName: this.sellItem.resort.resortName,
1008
-        resortCode: this.sellItem.resort.resortCode,
984
+        resortCode: this.sellItem.resort.resortCode
1009 985
       });
1010 986
 
1011 987
       if (this.sellItem && this.sellItem.resort === "Other") {
@@ -1017,9 +993,7 @@ export default {
1017 993
       }
1018 994
     },
1019 995
     regionChange() {
1020
-      this.sellItem.regionId = this.sellItem.region
1021
-        ? this.sellItem.region.id
1022
-        : 1;
996
+      this.sellItem.regionId = this.sellItem.region ? this.sellItem.region.id : 1;
1023 997
     },
1024 998
     UpdateAddress(address) {
1025 999
       this.indiv.address.streetNumber = address.streetNumber;
@@ -1035,8 +1009,8 @@ export default {
1035 1009
       } else {
1036 1010
         this.sellItem.mandateDate = undefined;
1037 1011
       }
1038
-    },
1039
-  },
1012
+    }
1013
+  }
1040 1014
 };
1041 1015
 </script>
1042 1016
 

+ 16
- 5
src/store/modules/timeshare/myWeeks.js View File

@@ -36,12 +36,21 @@ export default {
36 36
     // },
37 37
   },
38 38
   actions: {
39
-    getItems({ commit }, id) {
40
-      axios
39
+    async getItems({ commit }, id) {
40
+      await axios
41 41
         .get(`/api/timeshareweek/getMyWeek/${id}`)
42 42
         .then(r => commit("setItems", r.data))
43 43
         .catch(console.error);
44 44
     },
45
+    async getAllItems({ commit }) {
46
+      const response = await axios.get("api/timeshareweek/");
47
+      if (response.status === 200) {
48
+        commit("setItems");
49
+        return Promise.resolve();
50
+      } else {
51
+        return Promise.reject();
52
+      }
53
+    },
45 54
     verifyWeek({ commit }, id) {
46 55
       try {
47 56
         axios.post(`/api/timeshareweek/verifyweek/${id}`).catch(console.error);
@@ -67,11 +76,13 @@ export default {
67 76
         })
68 77
         .catch(console.error);
69 78
     },
70
-    editSave({ commit }, week) {
71
-      axios
79
+    async editSave({ commit }, week) {
80
+      await axios
72 81
         .put(`/api/timeshareweek`, week)
73 82
         .then(r => {
74
-          commit("setItem", r.data);
83
+          week.owner = week.owner.name;
84
+          week.agent = week.agent.name;
85
+          commit("setItem", week);
75 86
         })
76 87
         .catch(console.error);
77 88
     }

Loading…
Cancel
Save