瀏覽代碼

TimeshareWeekAdminUpdate

master
30117125 4 年之前
父節點
當前提交
b33c4b2213

+ 104
- 100
src/components/admin/status/editTimeShareAdminPage.vue 查看文件

20
               <div class="form-row">
20
               <div class="form-row">
21
                 <div class="form-group col-md-6">
21
                 <div class="form-group col-md-6">
22
                   <div class="input-group">
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
                   </div>
26
                   </div>
29
                   <float-label label="REGION" fixed>
27
                   <float-label label="REGION" fixed>
30
                     <select
28
                     <select
33
                       style="font-size: 15px"
31
                       style="font-size: 15px"
34
                     >
32
                     >
35
                       <option v-for="(region, r) in regions" :key="r" :value="region.regionCode">
33
                       <option v-for="(region, r) in regions" :key="r" :value="region.regionCode">
36
-                        {{
37
-                        region.regionName
38
-                        }}
34
+                        {{ region.regionName }}
39
                       </option>
35
                       </option>
40
                     </select>
36
                     </select>
41
                   </float-label>
37
                   </float-label>
53
                           v-for="(resort, r) in filteredResort"
49
                           v-for="(resort, r) in filteredResort"
54
                           :key="r"
50
                           :key="r"
55
                           :value="resort.resortCode"
51
                           :value="resort.resortCode"
56
-                        >{{ resort.resortName }}</option>
52
+                          >{{ resort.resortName }}</option
53
+                        >
57
                       </select>
54
                       </select>
58
                     </float-label>
55
                     </float-label>
59
 
56
 
75
                 </div>
72
                 </div>
76
                 <div class="form-group col-md-6">
73
                 <div class="form-group col-md-6">
77
                   <div v-if="weekParam.otherResort">
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
                   </div>
78
                   </div>
80
                   <float-label>
79
                   <float-label>
81
                     <select
80
                     <select
86
                       v-model="weekParam.region"
85
                       v-model="weekParam.region"
87
                     >
86
                     >
88
                       <option v-for="(region, r) in regions" :key="r">
87
                       <option v-for="(region, r) in regions" :key="r">
89
-                        {{
90
-                        region.regionName
91
-                        }}
88
+                        {{ region.regionName }}
92
                       </option>
89
                       </option>
93
                     </select>
90
                     </select>
94
                   </float-label>
91
                   </float-label>
195
                     </select>
192
                     </select>
196
                   </float-label>
193
                   </float-label>
197
                 </div>
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
                 </div>
250
                 </div>
237
               </div>
251
               </div>
238
             </div>
252
             </div>
244
                     type="checkbox"
258
                     type="checkbox"
245
                     class="custom-control-input"
259
                     class="custom-control-input"
246
                     id="customSwitch2"
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
                   <div
267
                   <div
254
                     class="spacebanked1"
268
                     class="spacebanked1"
255
-                    :class="{ 'spacebanked1--clicked': sellItem.currentYearBanked }"
269
+                    :class="{ 'spacebanked1--clicked': weekParam.currentYearBanked }"
256
                   >
270
                   >
257
                     <div class="col-md-6">
271
                     <div class="col-md-6">
258
                       <label
272
                       <label
259
                         for="If yes, please confirm with whom"
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
                     </div>
287
                     </div>
263
-                    <div class="validation"></div>
264
                   </div>
288
                   </div>
265
                 </div>
289
                 </div>
266
               </div>
290
               </div>
394
             <div class="form">
418
             <div class="form">
395
               <div class="row">
419
               <div class="row">
396
                 <div class="form-group col-md-6">
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
                   <float-label label="STATUS" fixed>
424
                   <float-label label="STATUS" fixed>
399
                     <select
425
                     <select
400
                       class="form-control uniSelect"
426
                       class="form-control uniSelect"
408
                   </float-label>
434
                   </float-label>
409
                 </div>
435
                 </div>
410
                 <div class="form-group col-md-6">
436
                 <div class="form-group col-md-6">
411
-                  <label v-if="!weekParam.publish" class="uniSelectLabel" for="publish">Publish</label>
412
                   <float-label label="Publish" fixed>
437
                   <float-label label="Publish" fixed>
413
                     <select
438
                     <select
414
                       class="form-control uniSelect"
439
                       class="form-control uniSelect"
435
                 </div>
460
                 </div>
436
               </div>
461
               </div>
437
             </div>
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
                 <button class="btn-solid-blue" v-on:click="saveEdit()">Save</button>
465
                 <button class="btn-solid-blue" v-on:click="saveEdit()">Save</button>
443
               </div>
466
               </div>
444
-              <div class="text-center col-12">
467
+              <div class="text-center col-6">
445
                 <button class="btn-solid-blue" v-on:click="backToListView()">Back</button>
468
                 <button class="btn-solid-blue" v-on:click="backToListView()">Back</button>
446
               </div>
469
               </div>
447
-              <br />
448
-              <br />
449
             </div>
470
             </div>
450
           </div>
471
           </div>
451
-          <br />
452
-          <br />
453
         </div>
472
         </div>
454
       </div>
473
       </div>
455
     </section>
474
     </section>
518
     this.selectedWeekType = this.weekParam.weekType;
537
     this.selectedWeekType = this.weekParam.weekType;
519
     this.selectedStatus = this.weekParam.status;
538
     this.selectedStatus = this.weekParam.status;
520
     this.selectedPublish = this.weekParam.publish;
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
     this.dateParam = date;
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
     this.depDateParam = depDate;
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
     this.pubDateParam = datePub;
545
     this.pubDateParam = datePub;
533
   },
546
   },
534
   created() {
547
   created() {
562
     },
575
     },
563
     filteredResort() {
576
     filteredResort() {
564
       let list = [];
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
         const item = this.detailedRegion.find(
579
         const item = this.detailedRegion.find(
571
           region => region.region.regionCode === this.sellItem.region.regionCode
580
           region => region.region.regionCode === this.sellItem.region.regionCode
572
         );
581
         );
584
   },
593
   },
585
   methods: {
594
   methods: {
586
     ...mapActions("individual", ["getIndividual"]),
595
     ...mapActions("individual", ["getIndividual"]),
587
-    ...mapActions("timeshare", [
588
-      "initTimeshare",
589
-      "onResortChange",
590
-      "saveWeek",
591
-      "getBlankWeek"
592
-    ]),
596
+    ...mapActions("timeshare", ["initTimeshare", "onResortChange", "saveWeek", "getBlankWeek"]),
593
     ...mapActions("payment", ["addPayment"]),
597
     ...mapActions("payment", ["addPayment"]),
594
     ...mapActions("bank", ["getBanks"]),
598
     ...mapActions("bank", ["getBanks"]),
595
     ...mapActions("myWeeks", ["getItems", "getWeek", "editSave"]),
599
     ...mapActions("myWeeks", ["getItems", "getWeek", "editSave"]),
626
       if (this.week.owner.cellNumber === "") {
630
       if (this.week.owner.cellNumber === "") {
627
         this.week.owner.cellNumber = "0000000000";
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
       this.weekParam.regionId = this.weekParam.region.id;
636
       this.weekParam.regionId = this.weekParam.region.id;
639
       this.weekParam.agentId = this.week.agentId;
637
       this.weekParam.agentId = this.week.agentId;
640
-      this.weekParam.bankedWith = this.week.bankedWith;
638
+      //this.weekParam.bankedWith = this.week.bankedWith;
641
       this.weekParam.owner = this.week.owner;
639
       this.weekParam.owner = this.week.owner;
642
       parseFloat(this.weekParam.sellPrice);
640
       parseFloat(this.weekParam.sellPrice);
643
       parseFloat(this.weekParam.levyAmount);
641
       parseFloat(this.weekParam.levyAmount);
649
       delete this.weekParam.owner.howMarried;
647
       delete this.weekParam.owner.howMarried;
650
       delete this.weekParam.cellNumber;
648
       delete this.weekParam.cellNumber;
651
       console.log(JSON.stringify(this.weekParam));
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
     resortChange() {
654
     resortChange() {
655
       this.onResortChange({
655
       this.onResortChange({
665
         this.week.otherResort = false;
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
     backToListView() {
672
     backToListView() {
669
       this.$router.push("/status/timeshareAdmin");
673
       this.$router.push("/status/timeshareAdmin");
670
     }
674
     }

+ 342
- 0
src/components/admin/status/timeshareAdminList.vue 查看文件

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 查看文件

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

+ 7
- 7
src/components/property/commercial/createProperty/commercialCreateNew.vue 查看文件

438
         this.property.userId = this.user.id;
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
       console.log(this.property);
449
       console.log(this.property);
450
 
450
 

+ 4
- 1
src/components/property/commercial/singleView/contentSection.vue 查看文件

89
           <div v-if="property.displayData.length > 0">
89
           <div v-if="property.displayData.length > 0">
90
             <div v-for="(data, i) in property.displayData" :key="i" class="row my-3">
90
             <div v-for="(data, i) in property.displayData" :key="i" class="row my-3">
91
               <div v-for="(field, j) in data.values" :key="j" class="col-md-6">
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
                   <i class="fa fa-check-circle"></i>
96
                   <i class="fa fa-check-circle"></i>
94
                   {{ field.value }} {{ field.name }}
97
                   {{ field.value }} {{ field.name }}
95
                 </div>
98
                 </div>

+ 38
- 42
src/components/property/editProperty/editProperty.vue 查看文件

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

+ 7
- 7
src/components/property/residential/createProperty/residentialCreateNew.vue 查看文件

421
       if (this.user) {
421
       if (this.user) {
422
         this.property.userId = this.user.id;
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
       this.saveProperty(this.property)
432
       this.saveProperty(this.property)
433
         .then(fulfilled => {
433
         .then(fulfilled => {

+ 6
- 1
src/components/property/residential/singleView/contentSection.vue 查看文件

98
               <div class="col-md-8">
98
               <div class="col-md-8">
99
                 <div v-for="(data, i) in property.displayData" :key="i" class="row my-3">
99
                 <div v-for="(data, i) in property.displayData" :key="i" class="row my-3">
100
                   <div v-for="(field, j) in data.values" :key="j" class="col-md-6">
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
                       <i class="fa fa-check-circle"></i>
107
                       <i class="fa fa-check-circle"></i>
103
                       {{ field.value }} {{ field.name }}
108
                       {{ field.value }} {{ field.name }}
104
                     </div>
109
                     </div>

+ 62
- 88
src/components/timeshare/sell/contentSection.vue 查看文件

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

+ 16
- 5
src/store/modules/timeshare/myWeeks.js 查看文件

36
     // },
36
     // },
37
   },
37
   },
38
   actions: {
38
   actions: {
39
-    getItems({ commit }, id) {
40
-      axios
39
+    async getItems({ commit }, id) {
40
+      await axios
41
         .get(`/api/timeshareweek/getMyWeek/${id}`)
41
         .get(`/api/timeshareweek/getMyWeek/${id}`)
42
         .then(r => commit("setItems", r.data))
42
         .then(r => commit("setItems", r.data))
43
         .catch(console.error);
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
     verifyWeek({ commit }, id) {
54
     verifyWeek({ commit }, id) {
46
       try {
55
       try {
47
         axios.post(`/api/timeshareweek/verifyweek/${id}`).catch(console.error);
56
         axios.post(`/api/timeshareweek/verifyweek/${id}`).catch(console.error);
67
         })
76
         })
68
         .catch(console.error);
77
         .catch(console.error);
69
     },
78
     },
70
-    editSave({ commit }, week) {
71
-      axios
79
+    async editSave({ commit }, week) {
80
+      await axios
72
         .put(`/api/timeshareweek`, week)
81
         .put(`/api/timeshareweek`, week)
73
         .then(r => {
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
         .catch(console.error);
87
         .catch(console.error);
77
     }
88
     }

Loading…
取消
儲存