Explorar el Código

Fix to publish Timeshare

master
GJWilliams87 hace 4 años
padre
commit
29fcb0b3cd

+ 131
- 61
src/components/admin/status/editTimeShareAdminPage.vue Ver fichero

@@ -19,7 +19,10 @@
19 19
               <div class="form-row">
20 20
                 <div class="form-group col-md-6">
21 21
                   <div class="input-group">
22
-                    <label v-if="!selectedRegion" class="uniSelectLabel" for="weekInfoRegionSelect"
22
+                    <label
23
+                      v-if="!selectedRegion"
24
+                      class="uniSelectLabel"
25
+                      for="weekInfoRegionSelect"
23 26
                       >REGION</label
24 27
                     >
25 28
                   </div>
@@ -29,7 +32,11 @@
29 32
                       v-model="selectedRegion"
30 33
                       style="font-size: 15px"
31 34
                     >
32
-                      <option v-for="(region, r) in regions" :key="r" :value="region.regionCode">
35
+                      <option
36
+                        v-for="(region, r) in regions"
37
+                        :key="r"
38
+                        :value="region.regionCode"
39
+                      >
33 40
                         {{ region.regionName }}
34 41
                       </option>
35 42
                     </select>
@@ -41,15 +48,19 @@
41 48
                 </div>
42 49
                 <div class="form-group col-md-6">
43 50
                   <div class="input-group">
44
-                    <float-label label="RESORT NAME" style="width:100%" fixed>
45
-                      <select class="form-control uniSelect" v-model="selectedResort">
51
+                    <float-label label="RESORT NAME" style="width: 100%" fixed>
52
+                      <select
53
+                        class="form-control uniSelect"
54
+                        v-model="selectedResort"
55
+                      >
46 56
                         <option value="Other">Other</option>
47 57
                         <option
48 58
                           v-for="(resort, r) in filteredResort"
49 59
                           :key="r"
50 60
                           :value="resort.resortCode"
51
-                          >{{ resort.resortName }}</option
52 61
                         >
62
+                          {{ resort.resortName }}
63
+                        </option>
53 64
                       </select>
54 65
                     </float-label>
55 66
 
@@ -86,7 +97,10 @@
86 97
                 </div>
87 98
                 <div class="form-group col-md-6">
88 99
                   <div v-if="weekParam.otherResort">
89
-                    <label v-if="!weekParam.region" class="uniSelectLabel" for="region"
100
+                    <label
101
+                      v-if="!weekParam.region"
102
+                      class="uniSelectLabel"
103
+                      for="region"
90 104
                       >REGION</label
91 105
                     >
92 106
                   </div>
@@ -107,7 +121,7 @@
107 121
                 <div class="form-group col-md-6">
108 122
                   <float-label>
109 123
                     <input
110
-                      type="number"
124
+                      type="text"
111 125
                       class="form-control"
112 126
                       name="unitNumber"
113 127
                       id="unitNumber"
@@ -142,9 +156,13 @@
142 156
                       id="season"
143 157
                       v-model="selectedSeason"
144 158
                     >
145
-                      <option :value="season.name" v-for="(season, r) in seasons" :key="r">{{
146
-                        season.name
147
-                      }}</option>
159
+                      <option
160
+                        :value="season.name"
161
+                        v-for="(season, r) in seasons"
162
+                        :key="r"
163
+                      >
164
+                        {{ season.name }}
165
+                      </option>
148 166
                     </select>
149 167
                   </float-label>
150 168
 
@@ -158,7 +176,9 @@
158 176
                       id="region"
159 177
                       v-model="selectedBedrooms"
160 178
                     >
161
-                      <option v-for="(item, i) in resortBedrooms" :key="i">{{ item }}</option>
179
+                      <option v-for="(item, i) in resortBedrooms" :key="i">
180
+                        {{ item }}
181
+                      </option>
162 182
                     </select>
163 183
                   </float-label>
164 184
 
@@ -172,7 +192,9 @@
172 192
                       id="region"
173 193
                       v-model="selectedMaxSleep"
174 194
                     >
175
-                      <option v-for="(item, i) in maxSleep" :key="i">{{ item }}</option>
195
+                      <option v-for="(item, i) in maxSleep" :key="i">
196
+                        {{ item }}
197
+                      </option>
176 198
                     </select>
177 199
                   </float-label>
178 200
 
@@ -266,7 +288,9 @@
266 288
             <div align="left" class="custom-control custom-switch mb-2">
267 289
               <div class="row">
268 290
                 <div align="center" class="col">
269
-                  <label class="mr-5">Has your week been spacebanked for the current year?</label>
291
+                  <label class="mr-5"
292
+                    >Has your week been spacebanked for the current year?</label
293
+                  >
270 294
                   <input
271 295
                     type="checkbox"
272 296
                     class="custom-control-input"
@@ -279,7 +303,9 @@
279 303
                   </label>
280 304
                   <div
281 305
                     class="spacebanked1"
282
-                    :class="{ 'spacebanked1--clicked': weekParam.currentYearBanked }"
306
+                    :class="{
307
+                      'spacebanked1--clicked': weekParam.currentYearBanked,
308
+                    }"
283 309
                   >
284 310
                     <div class="col-md-6">
285 311
                       <label
@@ -293,9 +319,13 @@
293 319
                         v-if="weekParam.currentYearBanked"
294 320
                         v-model="weekParam.bankedWith"
295 321
                       >
296
-                        <option v-for="(item, i) in bankedEntities" :key="i" :value="item">{{
297
-                          item
298
-                        }}</option>
322
+                        <option
323
+                          v-for="(item, i) in bankedEntities"
324
+                          :key="i"
325
+                          :value="item"
326
+                        >
327
+                          {{ item }}
328
+                        </option>
299 329
                       </select>
300 330
                     </div>
301 331
                   </div>
@@ -303,14 +333,17 @@
303 333
               </div>
304 334
             </div>
305 335
 
306
-            <div class="section-header" style="margin-top:50px">
336
+            <div class="section-header" style="margin-top: 50px">
307 337
               <h2>Detailed Individual Information</h2>
308 338
             </div>
309 339
             <div class="form">
310 340
               <div v-if="ROLE === 'Super Admin'" class="row mb-4">
311 341
                 <div class="col">
312 342
                   <float-label label="OWNER TYPE" fixed>
313
-                    <select v-model="weekParam.customOwner" class="form-control uniSelect mt-3">
343
+                    <select
344
+                      v-model="weekParam.customOwner"
345
+                      class="form-control uniSelect mt-3"
346
+                    >
314 347
                       <option v-bind:value="true">Custom Owner</option>
315 348
                       <option v-bind:value="false">Registered User</option>
316 349
                     </select>
@@ -326,9 +359,13 @@
326 359
                       class="form-control uniSelect mt-3"
327 360
                       @change="updateCurrentUser()"
328 361
                     >
329
-                      <option v-for="indiv in individuals" :key="indiv.id" :value="indiv.id">{{
330
-                        indiv.fullName
331
-                      }}</option>
362
+                      <option
363
+                        v-for="indiv in individuals"
364
+                        :key="indiv.id"
365
+                        :value="indiv.id"
366
+                      >
367
+                        {{ indiv.fullName }}
368
+                      </option>
332 369
                     </select>
333 370
                   </float-label>
334 371
                 </div>
@@ -458,7 +495,7 @@
458 495
                 </div>
459 496
               </div>
460 497
             </div>
461
-            <div class="section-header" style="margin-top:50px">
498
+            <div class="section-header" style="margin-top: 50px">
462 499
               <h2>Week Agent</h2>
463 500
             </div>
464 501
             <div class="row">
@@ -470,9 +507,13 @@
470 507
                   name="agency"
471 508
                   v-model="weekParam.agencyId"
472 509
                 >
473
-                  <option v-for="(item, i) in agencies" :key="i" :value="item.id">{{
474
-                    item.agencyName
475
-                  }}</option>
510
+                  <option
511
+                    v-for="(item, i) in agencies"
512
+                    :key="i"
513
+                    :value="item.id"
514
+                  >
515
+                    {{ item.agencyName }}
516
+                  </option>
476 517
                 </select>
477 518
               </div>
478 519
               <div class="col-md-6">
@@ -484,7 +525,11 @@
484 525
                   v-model="weekParam.agentId"
485 526
                   :disabled="!weekParam.agencyId"
486 527
                 >
487
-                  <option v-for="(item, i) in displayNotDeletedAgents" :key="i" :value="item.id">
528
+                  <option
529
+                    v-for="(item, i) in displayNotDeletedAgents"
530
+                    :key="i"
531
+                    :value="item.id"
532
+                  >
488 533
                     <div>{{ item.name + " " + item.surname }}</div>
489 534
                   </option>
490 535
                 </select>
@@ -504,9 +549,13 @@
504 549
                         id="status"
505 550
                         v-model="weekParam.status.id"
506 551
                       >
507
-                        <option :key="status.id" :value="status.id" v-for="status in statusList">{{
508
-                          status.description
509
-                        }}</option>
552
+                        <option
553
+                          :key="status.id"
554
+                          :value="status.id"
555
+                          v-for="status in statusList"
556
+                        >
557
+                          {{ status.description }}
558
+                        </option>
510 559
                       </select>
511 560
                     </float-label>
512 561
                   </div>
@@ -539,10 +588,14 @@
539 588
               </div>
540 589
               <div class="row">
541 590
                 <div class="text-center col-6">
542
-                  <button class="btn-solid-blue" v-on:click="saveEdit()">SAVE</button>
591
+                  <button class="btn-solid-blue" v-on:click="saveEdit()">
592
+                    SAVE
593
+                  </button>
543 594
                 </div>
544 595
                 <div class="text-center col-6">
545
-                  <button class="btn-solid-blue" v-on:click="backToListView()">BACK</button>
596
+                  <button class="btn-solid-blue" v-on:click="backToListView()">
597
+                    BACK
598
+                  </button>
546 599
                 </div>
547 600
               </div>
548 601
             </div>
@@ -575,8 +628,8 @@ export default {
575 628
   props: {
576 629
     weekParam: {},
577 630
     weekId: {
578
-      default: 0
579
-    }
631
+      default: 0,
632
+    },
580 633
   },
581 634
   data() {
582 635
     return {
@@ -596,12 +649,12 @@ export default {
596 649
       depDateParam: {},
597 650
       pubDateParam: {},
598 651
       boolAwaitingPayment: false,
599
-      selectedUser: ""
652
+      selectedUser: "",
600 653
     };
601 654
   },
602 655
   components: {
603 656
     addressAutoComplete,
604
-    Alert
657
+    Alert,
605 658
   },
606 659
   async mounted() {
607 660
     if (this.sellItem.id) {
@@ -625,11 +678,17 @@ export default {
625 678
     this.selectedWeekType = this.weekParam.weekType;
626 679
     this.selectedStatus = this.weekParam.status;
627 680
     this.selectedPublish = this.weekParam.publish;
628
-    var date = new Date(this.weekParam.arrivalDate).toISOString().substring(0, 10);
681
+    var date = new Date(this.weekParam.arrivalDate)
682
+      .toISOString()
683
+      .substring(0, 10);
629 684
     this.dateParam = date;
630
-    var depDate = new Date(this.weekParam.departureDate).toISOString().substring(0, 10);
685
+    var depDate = new Date(this.weekParam.departureDate)
686
+      .toISOString()
687
+      .substring(0, 10);
631 688
     this.depDateParam = depDate;
632
-    var datePub = new Date(this.weekParam.pulbishedDate).toISOString().substring(0, 10);
689
+    var datePub = new Date(this.weekParam.pulbishedDate)
690
+      .toISOString()
691
+      .substring(0, 10);
633 692
     this.pubDateParam = datePub;
634 693
     if (this.weekParam.status.description === "Awaiting Payment") {
635 694
       if (this.ROLE !== "Super Admin") {
@@ -672,7 +731,7 @@ export default {
672 731
       "sellItem",
673 732
       "agencies",
674 733
       "agents",
675
-      "getTemplate"
734
+      "getTemplate",
676 735
     ]),
677 736
     ...mapGetters("nonRegIndividual", ["getIndiv"]),
678 737
     ...mapState("individual", ["indiv"]),
@@ -681,7 +740,7 @@ export default {
681 740
     ...mapState("status", ["statusList"]),
682 741
     ...mapGetters({
683 742
       user: "authentication/getUser",
684
-      person: "authentication/getPerson"
743
+      person: "authentication/getPerson",
685 744
     }),
686 745
     ...mapState("bank", ["banks"]),
687 746
     ...mapState("register", ["individuals", "removeIndividual"]),
@@ -697,7 +756,7 @@ export default {
697 756
       let list = [];
698 757
       if (this.week && this.week.region && this.selectedRegion) {
699 758
         const item = this.detailedRegion.find(
700
-          region => region.region.regionCode === this.selectedRegion
759
+          (region) => region.region.regionCode === this.selectedRegion
701 760
         );
702 761
         if (item) {
703 762
           list = item.children;
@@ -705,14 +764,14 @@ export default {
705 764
       } else {
706 765
         list = this.resorts;
707 766
       }
708
-      return _.sortBy(list, x => x.resortName);
767
+      return _.sortBy(list, (x) => x.resortName);
709 768
     },
710 769
     isLoggedIn() {
711 770
       return this.user && this.person;
712 771
     },
713 772
     displayNotDeletedAgents() {
714 773
       var notDeletedArr = [];
715
-      this.agents.forEach(agent => {
774
+      this.agents.forEach((agent) => {
716 775
         if (!agent.isDeleted) {
717 776
           if (agent.agencyId === this.weekParam.agencyId) {
718 777
             notDeletedArr.push(agent);
@@ -720,12 +779,17 @@ export default {
720 779
         }
721 780
       });
722 781
       return notDeletedArr;
723
-    }
782
+    },
724 783
   },
725 784
   methods: {
726 785
     ...mapActions("individual", ["getIndividual"]),
727 786
     ...mapActions("nonRegIndividual", ["retrieveNonRegIndiv"]),
728
-    ...mapActions("timeshare", ["initTimeshare", "onResortChange", "saveWeek", "getBlankWeek"]),
787
+    ...mapActions("timeshare", [
788
+      "initTimeshare",
789
+      "onResortChange",
790
+      "saveWeek",
791
+      "getBlankWeek",
792
+    ]),
729 793
     ...mapActions("payment", ["addPayment"]),
730 794
     ...mapActions("bank", ["getBanks"]),
731 795
     ...mapActions("myWeeks", ["getItems", "getWeek", "editSave"]),
@@ -736,7 +800,7 @@ export default {
736 800
       this.getBlankWeek();
737 801
     },
738 802
     updateCurrentUser() {
739
-      this.individuals.forEach(indiv => {
803
+      this.individuals.forEach((indiv) => {
740 804
         if (this.weekParam.ownerId === indiv.id) {
741 805
           this.week.owner.name = indiv.name;
742 806
           this.week.owner.surname = indiv.surname;
@@ -750,13 +814,13 @@ export default {
750 814
       });
751 815
     },
752 816
     saveEdit() {
753
-      this.regions.forEach(region => {
817
+      this.regions.forEach((region) => {
754 818
         if (region.regionCode === this.selectedRegion) {
755 819
           //console.log(region);
756 820
           this.weekParam.regionId = region.id;
757 821
         }
758 822
       });
759
-      this.resorts.forEach(resort => {
823
+      this.resorts.forEach((resort) => {
760 824
         if (resort.resortCode === this.selectedResort) {
761 825
           this.weekParam.resortCode = resort.resortCode;
762 826
           this.weekParam.resortName = resort.resortName;
@@ -765,12 +829,12 @@ export default {
765 829
       console.log(this.selectedSeason);
766 830
       this.weekParam.season = this.selectedSeason;
767 831
 
768
-      this.resortBedrooms.forEach(bedroom => {
832
+      this.resortBedrooms.forEach((bedroom) => {
769 833
         if (bedroom === this.selectedBedrooms) {
770 834
           this.weekParam.bedroom = bedroom;
771 835
         }
772 836
       });
773
-      this.maxSleep.forEach(sleepMax => {
837
+      this.maxSleep.forEach((sleepMax) => {
774 838
         if (sleepMax === this.selectedMaxSleep) {
775 839
           this.weekParam.maxSleep = sleepMax;
776 840
         }
@@ -781,11 +845,17 @@ export default {
781 845
       if (this.week.owner.telephone === "") {
782 846
         delete this.week.owner.telephone;
783 847
       }
784
-      this.weekParam.arrivalDate = new Date(this.dateParam).toISOString().substring(0, 10);
785
-      this.weekParam.departureDate = new Date(this.depDateParam).toISOString().substring(0, 10);
848
+      this.weekParam.arrivalDate = new Date(this.dateParam)
849
+        .toISOString()
850
+        .substring(0, 10);
851
+      this.weekParam.departureDate = new Date(this.depDateParam)
852
+        .toISOString()
853
+        .substring(0, 10);
786 854
       //console.log(this.pubDateParam);
787 855
       if (this.pubDateParam) {
788
-        this.weekParam.pulbishedDate = new Date(this.pubDateParam).toISOString().substring(0, 19);
856
+        this.weekParam.pulbishedDate = new Date(this.pubDateParam)
857
+          .toISOString()
858
+          .substring(0, 19);
789 859
       }
790 860
       this.weekParam.owner = this.week.owner;
791 861
       this.weekParam.askingPrice = this.week.askingPrice;
@@ -808,7 +878,7 @@ export default {
808 878
     resortChange() {
809 879
       this.onResortChange({
810 880
         resortName: this.week.resort.resortName,
811
-        resortCode: this.week.resort.resortCode
881
+        resortCode: this.week.resort.resortCode,
812 882
       });
813 883
 
814 884
       if (this.week && this.week.resort === "Other") {
@@ -834,20 +904,20 @@ export default {
834 904
         creatydById: Log.getUser().id, //Log.getUser().id,
835 905
         amount: amount,
836 906
         paymentStatus: "",
837
-        paymentToken: ""
907
+        paymentToken: "",
838 908
       };
839 909
 
840
-      this.addPayment(paymentObj).then(res => {
910
+      this.addPayment(paymentObj).then((res) => {
841 911
         this.$router.push({
842 912
           name: "PaymentGateway",
843 913
           params: {
844 914
             paymentReqId: res.PAY_REQUEST_ID,
845
-            checksum: res.CHECKSUM
846
-          }
915
+            checksum: res.CHECKSUM,
916
+          },
847 917
         });
848 918
       });
849
-    }
850
-  }
919
+    },
920
+  },
851 921
 };
852 922
 </script>
853 923
 

+ 71
- 37
src/components/admin/status/timeshareAdminList.vue Ver fichero

@@ -6,7 +6,12 @@
6 6
       </div>
7 7
       <div class="row">
8 8
         <div class="col-lg-6 offset-3">
9
-          <input class="form-control uniSelect" type="text" placeholder="SEARCH" v-model="filter" />
9
+          <input
10
+            class="form-control uniSelect"
11
+            type="text"
12
+            placeholder="SEARCH"
13
+            v-model="filter"
14
+          />
10 15
         </div>
11 16
       </div>
12 17
       <div class="row">
@@ -18,7 +23,7 @@
18 23
             <thead>
19 24
               <tr>
20 25
                 <th scope="col" v-for="(col, c) in displayColumns" :key="c">
21
-                  <div @click="sortBy(columns[c])" style="cursor: pointer;">
26
+                  <div @click="sortBy(columns[c])" style="cursor: pointer">
22 27
                     <div class="d-flex bd-highlight">
23 28
                       <div class="w-100 bd-highlight">{{ col }}</div>
24 29
                       <div class="flex-shrink-1 bd-highlight">
@@ -66,7 +71,11 @@
66 71
                 <td>{{ item.status.description }}</td>
67 72
                 <td v-if="!item.publish">
68 73
                   <a v-on:click="Publish(item)">
69
-                    <img src="../../../../public/img/icons/Upload.png" height="25" width="25" />
74
+                    <img
75
+                      src="../../../../public/img/icons/Upload.png"
76
+                      height="25"
77
+                      width="25"
78
+                    />
70 79
                   </a>
71 80
                 </td>
72 81
                 <td v-else>
@@ -80,12 +89,20 @@
80 89
                 </td>
81 90
                 <td>
82 91
                   <a v-on:click="Edit(item)">
83
-                    <img src="../../../../public/img/icons/Edit.png" height="25" width="25" />
92
+                    <img
93
+                      src="../../../../public/img/icons/Edit.png"
94
+                      height="25"
95
+                      width="25"
96
+                    />
84 97
                   </a>
85 98
                 </td>
86 99
                 <td>
87 100
                   <a v-on:click="Delete(item)">
88
-                    <img src="../../../../public/img/icons/delete.png" height="25" width="25" />
101
+                    <img
102
+                      src="../../../../public/img/icons/delete.png"
103
+                      height="25"
104
+                      width="25"
105
+                    />
89 106
                   </a>
90 107
                 </td>
91 108
               </tr>
@@ -93,7 +110,12 @@
93 110
           </table>
94 111
           <div class="d-flex justify-content-between" v-if="showPager">
95 112
             <div class="p-1">
96
-              {{ currentPage + " / " + PageCount + (" - (" + FilteredListings.length + " items)") }}
113
+              {{
114
+                currentPage +
115
+                " / " +
116
+                PageCount +
117
+                (" - (" + FilteredListings.length + " items)")
118
+              }}
97 119
             </div>
98 120
             <div class="p-1">
99 121
               <BasePagination
@@ -112,7 +134,9 @@
112 134
                     v-model="visibleItemsPerPageCount"
113 135
                     @change="onChangeItemsPerPage()"
114 136
                   >
115
-                    <option v-for="(item, i) in itemsPerPageList" :key="i">{{ item }}</option>
137
+                    <option v-for="(item, i) in itemsPerPageList" :key="i">
138
+                      {{ item }}
139
+                    </option>
116 140
                   </select>
117 141
                 </div>
118 142
               </div>
@@ -121,7 +145,11 @@
121 145
           <div class="p-2">
122 146
             <div class="d-flex flex-row">
123 147
               <div>
124
-                <button v-if="sortKey !== 'id'" class="btn-solid-blue" @click="ClearSort">
148
+                <button
149
+                  v-if="sortKey !== 'id'"
150
+                  class="btn-solid-blue"
151
+                  @click="ClearSort"
152
+                >
125 153
                   Clear Sort
126 154
                 </button>
127 155
               </div>
@@ -144,7 +172,7 @@ import _ from "lodash";
144 172
 
145 173
 export default {
146 174
   components: {
147
-    BasePagination
175
+    BasePagination,
148 176
   },
149 177
   data() {
150 178
     return {
@@ -169,7 +197,7 @@ export default {
169 197
         "Region",
170 198
         "Amount",
171 199
         "Submitted",
172
-        "Status"
200
+        "Status",
173 201
       ],
174 202
       columns: [
175 203
         "owner",
@@ -181,32 +209,36 @@ export default {
181 209
         "season",
182 210
         "region",
183 211
         "sellPrice",
184
-        "weekStatus"
185
-      ]
212
+        "weekStatus",
213
+      ],
186 214
     };
187 215
   },
188 216
   methods: {
189 217
     ...mapActions("myWeeks", ["getAllItems"]),
190
-    ...mapActions("myWeeks", ["getItems", "verifyWeek", "editSave", "publishOnly"]),
218
+    ...mapActions("myWeeks", [
219
+      "getItems",
220
+      "verifyWeek",
221
+      "editSave",
222
+      "publishWeek",
223
+      "unpublishWeek",
224
+    ]),
191 225
     Publish(item) {
192
-      var today = new Date();
193
-      var dd = String(today.getDate()).padStart(2, "0");
194
-      var mm = String(today.getMonth() + 1).padStart(2, "0"); //January is 0!
195
-      var yyyy = today.getFullYear();
196
-      item.pulbishedDate = today.toISOString().substring(0, 19);
197
-      item.publish = true;
198
-      item.status.id = 26;
199
-      item.status.code = "FS";
200
-      item.status.description = "For Sale";
201
-      item.status.statusType = true;
202
-      console.log(JSON.stringify(item));
203
-      this.publishOnly(item);
226
+      // var today = new Date();
227
+      // var dd = String(today.getDate()).padStart(2, "0");
228
+      // var mm = String(today.getMonth() + 1).padStart(2, "0"); //January is 0!
229
+      // var yyyy = today.getFullYear();
230
+      // item.pulbishedDate = today.toISOString().substring(0, 19);
231
+      // item.publish = true;
232
+      // item.status.id = 26;
233
+      // item.status.code = "FS";
234
+      // item.status.description = "For Sale";
235
+      // item.status.statusType = true;
236
+      // console.log(JSON.stringify(item));
237
+      // this.publishOnly(item);
238
+      this.publishWeek(item);
204 239
     },
205 240
     Unpublish(item) {
206
-      item.publish = false;
207
-
208
-      console.log(item);
209
-      this.publishOnly(item);
241
+      this.unpublishWeek(item);
210 242
     },
211 243
     Edit(item) {
212 244
       this.$router.push({ name: "EditTimeshare", params: { weekParam: item } });
@@ -234,16 +266,16 @@ export default {
234 266
     ClearSort() {
235 267
       this.reverse = true;
236 268
       this.sortKey = "id";
237
-    }
269
+    },
238 270
   },
239 271
   computed: {
240 272
     ...mapState("propertyList", ["properties"]),
241 273
     ...mapGetters({ getNeedsVerify: "myWeeks/getNeedsVerify" }),
242 274
     FilteredListings() {
243 275
       if (this.filter) {
244
-        const list = _.filter(this.getNeedsVerify, item =>
276
+        const list = _.filter(this.getNeedsVerify, (item) =>
245 277
           Object.values(item).some(
246
-            i =>
278
+            (i) =>
247 279
               JSON.stringify(i)
248 280
                 .toLowerCase()
249 281
                 .indexOf(this.filter.toLowerCase()) > -1
@@ -256,7 +288,9 @@ export default {
256 288
     },
257 289
     PageCount() {
258 290
       return this.visibleItemsPerPageCount !== 0
259
-        ? Math.ceil(this.FilteredListings.length / this.visibleItemsPerPageCount)
291
+        ? Math.ceil(
292
+            this.FilteredListings.length / this.visibleItemsPerPageCount
293
+          )
260 294
         : 1;
261 295
     },
262 296
     DisplayItems() {
@@ -270,7 +304,7 @@ export default {
270 304
     },
271 305
     SortDirection() {
272 306
       return this.reverse ? "desc" : "asc";
273
-    }
307
+    },
274 308
   },
275 309
   created() {
276 310
     this.getItems(this.userId).then(() => {
@@ -293,9 +327,9 @@ export default {
293 327
         if (val != oldVal) {
294 328
           this.currentPage = 1;
295 329
         }
296
-      }
297
-    }
298
-  }
330
+      },
331
+    },
332
+  },
299 333
 };
300 334
 </script>
301 335
 

+ 194
- 75
src/components/timeshare/sell/contentSection.vue Ver fichero

@@ -20,7 +20,10 @@
20 20
                 <label class="custom-control-label" for="customSwitch1">
21 21
                   {{ refAgent ? "Yes" : "No" }}
22 22
                 </label>
23
-                <div class="refbyAgent" :class="{ 'refbyAgent--clicked': refAgent }">
23
+                <div
24
+                  class="refbyAgent"
25
+                  :class="{ 'refbyAgent--clicked': refAgent }"
26
+                >
24 27
                   <div class="col-md-6" v-if="refAgent">
25 28
                     <label for="Name of Agency">Agency</label>
26 29
                     <select
@@ -29,9 +32,13 @@
29 32
                       name="agency"
30 33
                       v-model="sellItem.agencyId"
31 34
                     >
32
-                      <option v-for="(item, i) in agencies" :key="i" :value="item.id">{{
33
-                        item.agencyName
34
-                      }}</option>
35
+                      <option
36
+                        v-for="(item, i) in agencies"
37
+                        :key="i"
38
+                        :value="item.id"
39
+                      >
40
+                        {{ item.agencyName }}
41
+                      </option>
35 42
                     </select>
36 43
                   </div>
37 44
                   <div class="col-md-6" v-if="refAgent">
@@ -63,10 +70,13 @@
63 70
             <div class="form-row">
64 71
               <div class="form-group col-md-6 mt-2">
65 72
                 <div class="input-group">
66
-                  <label v-if="!sellItem.region" class="uniSelectLabel" for="weekInfoRegionSelect"
73
+                  <label
74
+                    v-if="!sellItem.region"
75
+                    class="uniSelectLabel"
76
+                    for="weekInfoRegionSelect"
67 77
                     >REGION</label
68 78
                   >
69
-                  <float-label label="REGION" style="width:100%">
79
+                  <float-label label="REGION" style="width: 100%">
70 80
                     <select
71 81
                       id="weekInfoRegionSelect"
72 82
                       class="form-control uniSelect"
@@ -74,7 +84,11 @@
74 84
                       @change="regionChange()"
75 85
                       style="font-size: 15px"
76 86
                     >
77
-                      <option v-for="(region, r) in regions" :key="r" :value="region">
87
+                      <option
88
+                        v-for="(region, r) in regions"
89
+                        :key="r"
90
+                        :value="region"
91
+                      >
78 92
                         {{ region.regionName }}
79 93
                       </option>
80 94
                     </select>
@@ -94,10 +108,13 @@
94 108
               </div>
95 109
               <div class="form-group col-md-6 mt-2">
96 110
                 <div class="input-group">
97
-                  <label v-if="!sellItem.resort" class="uniSelectLabel" for="weekInfoResortSelect"
111
+                  <label
112
+                    v-if="!sellItem.resort"
113
+                    class="uniSelectLabel"
114
+                    for="weekInfoResortSelect"
98 115
                     >RESORT NAME</label
99 116
                   >
100
-                  <float-label label="RESORT NAME" style="width:100%">
117
+                  <float-label label="RESORT NAME" style="width: 100%">
101 118
                     <select
102 119
                       id="weekInfoResortSelect"
103 120
                       class="form-control uniSelect"
@@ -105,7 +122,11 @@
105 122
                       @change="resortChange()"
106 123
                     >
107 124
                       <option value="Other">Other</option>
108
-                      <option v-for="(resort, r) in filteredResort" :key="r" :value="resort">
125
+                      <option
126
+                        v-for="(resort, r) in filteredResort"
127
+                        :key="r"
128
+                        :value="resort"
129
+                      >
109 130
                         {{ resort.resortName }}
110 131
                       </option>
111 132
                     </select>
@@ -134,7 +155,12 @@
134 155
               </div>
135 156
               <div class="form-group col-md-6 mt-2">
136 157
                 <div v-if="sellItem.otherResort">
137
-                  <label v-if="!sellItem.region" class="uniSelectLabel" for="region">REGION</label>
158
+                  <label
159
+                    v-if="!sellItem.region"
160
+                    class="uniSelectLabel"
161
+                    for="region"
162
+                    >REGION</label
163
+                  >
138 164
                 </div>
139 165
 
140 166
                 <select
@@ -144,13 +170,15 @@
144 170
                   id="region"
145 171
                   v-model="sellItem.region"
146 172
                 >
147
-                  <option v-for="(region, r) in regions" :key="r">{{ region.regionName }}</option>
173
+                  <option v-for="(region, r) in regions" :key="r">
174
+                    {{ region.regionName }}
175
+                  </option>
148 176
                 </select>
149 177
               </div>
150 178
               <div class="form-group col-md-6 mt-2">
151 179
                 <float-label>
152 180
                   <input
153
-                    type="number"
181
+                    type="text"
154 182
                     class="form-control"
155 183
                     name="unitNumber"
156 184
                     id="unitNumber"
@@ -178,7 +206,12 @@
178 206
                 <div class="validation"></div>
179 207
               </div>
180 208
               <div class="form-group col-md-6 mt-2">
181
-                <label v-if="!sellItem.season" class="uniSelectLabel" for="region">SEASON</label>
209
+                <label
210
+                  v-if="!sellItem.season"
211
+                  class="uniSelectLabel"
212
+                  for="region"
213
+                  >SEASON</label
214
+                >
182 215
                 <float-label label="SEASON">
183 216
                   <select
184 217
                     class="form-control uniSelect"
@@ -186,14 +219,19 @@
186 219
                     id="region"
187 220
                     v-model="sellItem.season"
188 221
                   >
189
-                    <option v-for="(season, r) in seasons" :key="r">{{ season.name }}</option>
222
+                    <option v-for="(season, r) in seasons" :key="r">
223
+                      {{ season.name }}
224
+                    </option>
190 225
                   </select>
191 226
                 </float-label>
192 227
 
193 228
                 <div class="validation"></div>
194 229
               </div>
195 230
               <div class="form-group col-md-6 mt-2">
196
-                <label v-if="!sellItem.bedrooms" class="uniSelectLabel" for="region"
231
+                <label
232
+                  v-if="!sellItem.bedrooms"
233
+                  class="uniSelectLabel"
234
+                  for="region"
197 235
                   >BEDROOM/S</label
198 236
                 >
199 237
                 <float-label label="BEDROOM/S">
@@ -203,14 +241,19 @@
203 241
                     id="region"
204 242
                     v-model="sellItem.bedrooms"
205 243
                   >
206
-                    <option v-for="(item, i) in resortBedrooms" :key="i">{{ item }}</option>
244
+                    <option v-for="(item, i) in resortBedrooms" :key="i">
245
+                      {{ item }}
246
+                    </option>
207 247
                   </select>
208 248
                 </float-label>
209 249
 
210 250
                 <div class="validation"></div>
211 251
               </div>
212 252
               <div class="form-group col-md-6 mt-2">
213
-                <label v-if="!sellItem.maxSleep" class="uniSelectLabel" for="region"
253
+                <label
254
+                  v-if="!sellItem.maxSleep"
255
+                  class="uniSelectLabel"
256
+                  for="region"
214 257
                   >SLEEP MAX</label
215 258
                 >
216 259
                 <float-label label="SLEEP MAX">
@@ -220,7 +263,9 @@
220 263
                     id="region"
221 264
                     v-model="sellItem.maxSleep"
222 265
                   >
223
-                    <option v-for="(item, i) in maxSleep" :key="i">{{ item }}</option>
266
+                    <option v-for="(item, i) in maxSleep" :key="i">
267
+                      {{ item }}
268
+                    </option>
224 269
                   </select>
225 270
                 </float-label>
226 271
 
@@ -242,7 +287,10 @@
242 287
                 <div class="validation"></div>
243 288
               </div>
244 289
               <div class="form-group col-md-6 mt-2">
245
-                <label v-if="!sellItem.weekType" class="uniSelectLabel" for="region"
290
+                <label
291
+                  v-if="!sellItem.weekType"
292
+                  class="uniSelectLabel"
293
+                  for="region"
246 294
                   >WEEK TYPE</label
247 295
                 >
248 296
                 <float-label label="WEEK TYPE">
@@ -264,7 +312,9 @@
264 312
           <div align="left" class="custom-control custom-switch mb-2">
265 313
             <div class="row">
266 314
               <div align="center" class="col">
267
-                <label class="mr-5">Has your week been spacebanked for the current year?</label>
315
+                <label class="mr-5"
316
+                  >Has your week been spacebanked for the current year?</label
317
+                >
268 318
                 <input
269 319
                   type="checkbox"
270 320
                   class="custom-control-input"
@@ -277,10 +327,14 @@
277 327
                 </label>
278 328
                 <div
279 329
                   class="spacebanked1"
280
-                  :class="{ 'spacebanked1--clicked': sellItem.currentYearBanked }"
330
+                  :class="{
331
+                    'spacebanked1--clicked': sellItem.currentYearBanked,
332
+                  }"
281 333
                 >
282 334
                   <div class="col-md-6">
283
-                    <label for="If yes, please confirm with whom" v-if="sellItem.currentYearBanked"
335
+                    <label
336
+                      for="If yes, please confirm with whom"
337
+                      v-if="sellItem.currentYearBanked"
284 338
                       >Please confirm with whom</label
285 339
                     >
286 340
                     <select
@@ -289,7 +343,9 @@
289 343
                       v-if="sellItem.currentYearBanked"
290 344
                       v-model="sellItem.bankedWith"
291 345
                     >
292
-                      <option v-for="(item, i) in bankedEntities" :key="i">{{ item }}</option>
346
+                      <option v-for="(item, i) in bankedEntities" :key="i">
347
+                        {{ item }}
348
+                      </option>
293 349
                     </select>
294 350
                   </div>
295 351
                 </div>
@@ -372,28 +428,37 @@
372 428
               <div class="form-group col-md-6">
373 429
                 <div class="input-group">
374 430
                   <span v-if="!indiv.howMarried">
375
-                    <label v-if="indiv.howMarried === 'N/A'" for="howMarried" class="uniSelectLabel"
431
+                    <label
432
+                      v-if="indiv.howMarried === 'N/A'"
433
+                      for="howMarried"
434
+                      class="uniSelectLabel"
376 435
                       >Marital Status</label
377 436
                     >
378 437
                   </span>
379 438
 
380
-                  <float-label label="Marital Status" style="width:100%">
439
+                  <float-label label="Marital Status" style="width: 100%">
381 440
                     <select
382 441
                       class="form-control uniSelect"
383 442
                       id="howMarried"
384 443
                       v-model="indiv.howMarried"
385 444
                     >
386 445
                       <option value="N/A">N/A</option>
387
-                      <option value="In Community Of Property">In Community Of Property</option>
388
-                      <option value="Out of Community Of Property"
389
-                        >Out of Community Of Property</option
390
-                      >
446
+                      <option value="In Community Of Property">
447
+                        In Community Of Property
448
+                      </option>
449
+                      <option value="Out of Community Of Property">
450
+                        Out of Community Of Property
451
+                      </option>
391 452
                       <option value="Other">Other</option>
392
-                      <option value="Traditional Wedding">Traditional Wedding</option>
453
+                      <option value="Traditional Wedding">
454
+                        Traditional Wedding
455
+                      </option>
393 456
                       <option value="Single">Single</option>
394 457
                       <option value="Divorced">Divorced</option>
395 458
                       <option value="Widow">Widow</option>
396
-                      <option value="Committed Relationship">Committed Relationship</option>
459
+                      <option value="Committed Relationship">
460
+                        Committed Relationship
461
+                      </option>
397 462
                       <option value="Partner">Partner</option>
398 463
                     </select>
399 464
                   </float-label>
@@ -450,10 +515,16 @@
450 515
               </div>
451 516
             </div>
452 517
           </div>
453
-          <div v-if="indiv.howMarried === 'In Community Of Property'" class="section-header">
518
+          <div
519
+            v-if="indiv.howMarried === 'In Community Of Property'"
520
+            class="section-header"
521
+          >
454 522
             <h2>Spouse Details</h2>
455 523
           </div>
456
-          <div v-if="indiv.howMarried === 'In Community Of Property'" class="form">
524
+          <div
525
+            v-if="indiv.howMarried === 'In Community Of Property'"
526
+            class="form"
527
+          >
457 528
             <div class="form-row mb-2">
458 529
               <div class="form-group col-md-6 mt-2">
459 530
                 <float-label>
@@ -632,9 +703,14 @@
632 703
             <div class="form-row">
633 704
               <div
634 705
                 class="form-group col-md-12"
635
-                style="border:solid;border-width:2px; border-color:rgb(27, 117, 187);border-radius: 3px"
706
+                style="
707
+                  border: solid;
708
+                  border-width: 2px;
709
+                  border-color: rgb(27, 117, 187);
710
+                  border-radius: 3px;
711
+                "
636 712
               >
637
-                <p style="text-align: left; margin:auto; padding:10px">
713
+                <p style="text-align: left; margin: auto; padding: 10px">
638 714
                   1. With respect to my timeshare module/week, I confirm that:
639 715
                 </p>
640 716
                 <div class="validation"></div>
@@ -643,7 +719,10 @@
643 719
 
644 720
             <div class="form-row">
645 721
               <div class="col-md-8">
646
-                <p>1.1. All levy amounts for the current cycle have been paid in full</p>
722
+                <p>
723
+                  1.1. All levy amounts for the current cycle have been paid in
724
+                  full
725
+                </p>
647 726
               </div>
648 727
               <div class="form-group col-md-2">
649 728
                 <div class="custom-control custom-switch">
@@ -685,7 +764,10 @@
685 764
 
686 765
             <div class="form-row">
687 766
               <div class="col-md-8">
688
-                <p>1.3. I / We bought the timeshare module/week on the following date:</p>
767
+                <p>
768
+                  1.3. I / We bought the timeshare module/week on the following
769
+                  date:
770
+                </p>
689 771
               </div>
690 772
               <div class="form-group col-md-2">
691 773
                 <input
@@ -700,7 +782,10 @@
700 782
 
701 783
             <div class="form-row">
702 784
               <div class="col-md-8">
703
-                <p>1.4. The purchase price for which I / we bought timeshare module / week was:</p>
785
+                <p>
786
+                  1.4. The purchase price for which I / we bought timeshare
787
+                  module / week was:
788
+                </p>
704 789
               </div>
705 790
               <div class="form-group col-md-2">
706 791
                 <input
@@ -718,8 +803,8 @@
718 803
             <div class="form-row">
719 804
               <div class="col-md-8">
720 805
                 <p>
721
-                  1.5. I / We bought the timeshare module / week for the following dates for the
722
-                  current year:
806
+                  1.5. I / We bought the timeshare module / week for the
807
+                  following dates for the current year:
723 808
                 </p>
724 809
               </div>
725 810
               <div class="form-group col-md-2">
@@ -747,8 +832,8 @@
747 832
             <div class="form-row">
748 833
               <div class="col-md-8">
749 834
                 <p>
750
-                  1.6. The selling price for the timeshare module / week for which I / we want to
751
-                  sell is: (Incl. Vat)
835
+                  1.6. The selling price for the timeshare module / week for
836
+                  which I / we want to sell is: (Incl. Vat)
752 837
                 </p>
753 838
               </div>
754 839
               <div class="form-group col-md-2">
@@ -766,7 +851,9 @@
766 851
 
767 852
             <div class="form-row">
768 853
               <div class="col-md-8">
769
-                <p>1.7. Estate agent's commission agreed to (state Rand value)</p>
854
+                <p>
855
+                  1.7. Estate agent's commission agreed to (state Rand value)
856
+                </p>
770 857
               </div>
771 858
               <div class="form-group col-md-2">
772 859
                 <input
@@ -784,31 +871,44 @@
784 871
             <div class="form-row">
785 872
               <div class="col-md-8">
786 873
                 <p>
787
-                  1.8. I hereby Mandate Uni-Vate properties to sell the timeshare listed above on my
788
-                  behalf
874
+                  1.8. I hereby Mandate Uni-Vate properties to sell the
875
+                  timeshare listed above on my behalf
789 876
                 </p>
790 877
               </div>
791 878
               <div class="form-group col-md-4">
792
-                <input type="checkbox" @change="SetMandateDate" v-model="sellItem.mandate" />
879
+                <input
880
+                  type="checkbox"
881
+                  @change="SetMandateDate"
882
+                  v-model="sellItem.mandate"
883
+                />
793 884
               </div>
794 885
             </div>
795 886
             <div class="form-row" v-if="!CanSave">
796 887
               <div class="col-md-12">
797
-                <p class="alert myError">Please ensure that you add spouse details.</p>
888
+                <p class="alert myError">
889
+                  Please ensure that you add spouse details.
890
+                </p>
798 891
               </div>
799 892
             </div>
800 893
             <div class="form-row" v-if="profileEmailError">
801 894
               <div class="col-md-12">
802 895
                 <p class="alert myError">
803
-                  Please ensure that your email is correct before adding a timeshare week.
896
+                  Please ensure that your email is correct before adding a
897
+                  timeshare week.
804 898
                 </p>
805 899
               </div>
806 900
             </div>
807 901
             <div class="text-center col-12" v-if="CanSave">
808
-              <button class="btn-solid-blue" v-if="!sellItem.id" @click="submitSale()">
902
+              <button
903
+                class="btn-solid-blue"
904
+                v-if="!sellItem.id"
905
+                @click="submitSale()"
906
+              >
809 907
                 SUBMIT
810 908
               </button>
811
-              <button class="btn-solid-blue" v-else @click="newSale()">NEW WEEK</button>
909
+              <button class="btn-solid-blue" v-else @click="newSale()">
910
+                NEW WEEK
911
+              </button>
812 912
             </div>
813 913
             <!-- <div class="text-center col-12">
814 914
               <button class="btn-solid-blue" @click="paygateRedirect()">PayGate</button>
@@ -838,19 +938,19 @@ export default {
838 938
   name: "TimeshareToSell",
839 939
   props: {
840 940
     weekId: {
841
-      default: 0
842
-    }
941
+      default: 0,
942
+    },
843 943
   },
844 944
   data() {
845 945
     return {
846 946
       wait: false,
847 947
       userLoggedIn: Log.isLoggedIn(),
848
-      profileEmailError: false
948
+      profileEmailError: false,
849 949
     };
850 950
   },
851 951
   components: {
852 952
     addressAutoComplete,
853
-    Alert
953
+    Alert,
854 954
   },
855 955
   mounted() {
856 956
     if (this.sellItem.id) {
@@ -876,13 +976,13 @@ export default {
876 976
       "sellItem",
877 977
       "agencies",
878 978
       "agents",
879
-      "getTemplate"
979
+      "getTemplate",
880 980
     ]),
881 981
     ...mapState("individual", ["indiv"]),
882 982
     ...mapState("authentication", ["isLoggedIn"]),
883 983
     ...mapGetters({
884 984
       user: "authentication/getUser",
885
-      person: "authentication/getPerson"
985
+      person: "authentication/getPerson",
886 986
     }),
887 987
     ...mapState("bank", ["banks"]),
888 988
     refAgent() {
@@ -891,9 +991,14 @@ export default {
891 991
     ...mapGetters("fees", ["getListingFee"]),
892 992
     filteredResort() {
893 993
       let list = [];
894
-      if (this.sellItem && this.sellItem.region && this.sellItem.region.regionCode) {
994
+      if (
995
+        this.sellItem &&
996
+        this.sellItem.region &&
997
+        this.sellItem.region.regionCode
998
+      ) {
895 999
         const item = this.detailedRegion.find(
896
-          region => region.region.regionCode === this.sellItem.region.regionCode
1000
+          (region) =>
1001
+            region.region.regionCode === this.sellItem.region.regionCode
897 1002
         );
898 1003
         if (item) {
899 1004
           list = item.children;
@@ -901,14 +1006,14 @@ export default {
901 1006
       } else {
902 1007
         list = this.resorts;
903 1008
       }
904
-      return _.sortBy(list, x => x.resortName);
1009
+      return _.sortBy(list, (x) => x.resortName);
905 1010
     },
906 1011
     isLoggedIn() {
907 1012
       return this.user && this.person;
908 1013
     },
909 1014
     displayNotDeletedAgents() {
910 1015
       var notDeletedArr = [];
911
-      this.agents.forEach(agent => {
1016
+      this.agents.forEach((agent) => {
912 1017
         if (!agent.isDeleted) {
913 1018
           if (agent.agencyId === this.sellItem.agencyId) {
914 1019
             notDeletedArr.push(agent);
@@ -919,17 +1024,26 @@ export default {
919 1024
     },
920 1025
     CanSave() {
921 1026
       if (this.indiv.howMarried === "In Community Of Property") {
922
-        if (this.indiv.spouseName || this.indiv.spouseSurname || this.spouseEmail) {
1027
+        if (
1028
+          this.indiv.spouseName ||
1029
+          this.indiv.spouseSurname ||
1030
+          this.spouseEmail
1031
+        ) {
923 1032
           return true;
924 1033
         }
925 1034
         return false;
926 1035
       }
927 1036
       return true;
928
-    }
1037
+    },
929 1038
   },
930 1039
   methods: {
931 1040
     ...mapActions("individual", ["getIndividual"]),
932
-    ...mapActions("timeshare", ["initTimeshare", "onResortChange", "saveWeek", "getBlankWeek"]),
1041
+    ...mapActions("timeshare", [
1042
+      "initTimeshare",
1043
+      "onResortChange",
1044
+      "saveWeek",
1045
+      "getBlankWeek",
1046
+    ]),
933 1047
     ...mapActions("payment", ["addPayment"]),
934 1048
     ...mapActions("bank", ["getBanks"]),
935 1049
     newSale() {
@@ -941,12 +1055,15 @@ export default {
941 1055
         this.sellItem.ownerObject = this.indiv;
942 1056
         this.sellItem.weekStatus = "For Sale";
943 1057
         this.saveWeek(this.sellItem)
944
-          .then(fulfilled => {
1058
+          .then((fulfilled) => {
945 1059
             console.log(fulfilled);
946
-            this.$router.push({ name: "PaymentOption", params: { week: fulfilled } });
1060
+            this.$router.push({
1061
+              name: "PaymentOption",
1062
+              params: { week: fulfilled },
1063
+            });
947 1064
             //this.paygateRedirect();
948 1065
           })
949
-          .catch(ex => {
1066
+          .catch((ex) => {
950 1067
             this.profileEmailError = true;
951 1068
           });
952 1069
       } else {
@@ -961,16 +1078,16 @@ export default {
961 1078
         creatydById: Log.getUser().id, //Log.getUser().id,
962 1079
         amount: amount,
963 1080
         paymentStatus: "",
964
-        paymentToken: ""
1081
+        paymentToken: "",
965 1082
       };
966 1083
 
967
-      this.addPayment(paymentObj).then(res => {
1084
+      this.addPayment(paymentObj).then((res) => {
968 1085
         this.$router.push({
969 1086
           name: "PaymentGateway",
970 1087
           params: {
971 1088
             paymentReqId: res.PAY_REQUEST_ID,
972
-            checksum: res.CHECKSUM
973
-          }
1089
+            checksum: res.CHECKSUM,
1090
+          },
974 1091
         });
975 1092
       });
976 1093
     },
@@ -995,7 +1112,7 @@ export default {
995 1112
     resortChange() {
996 1113
       this.onResortChange({
997 1114
         resortName: this.sellItem.resort.resortName,
998
-        resortCode: this.sellItem.resort.resortCode
1115
+        resortCode: this.sellItem.resort.resortCode,
999 1116
       });
1000 1117
 
1001 1118
       if (this.sellItem && this.sellItem.resort === "Other") {
@@ -1007,7 +1124,9 @@ export default {
1007 1124
       }
1008 1125
     },
1009 1126
     regionChange() {
1010
-      this.sellItem.regionId = this.sellItem.region ? this.sellItem.region.id : 1;
1127
+      this.sellItem.regionId = this.sellItem.region
1128
+        ? this.sellItem.region.id
1129
+        : 1;
1011 1130
     },
1012 1131
     UpdateAddress(address) {
1013 1132
       this.indiv.address.streetNumber = address.streetNumber;
@@ -1023,8 +1142,8 @@ export default {
1023 1142
       } else {
1024 1143
         this.sellItem.mandateDate = undefined;
1025 1144
       }
1026
-    }
1027
-  }
1145
+    },
1146
+  },
1028 1147
 };
1029 1148
 </script>
1030 1149
 

+ 18
- 3
src/store/modules/timeshare/myWeeks.js Ver fichero

@@ -25,11 +25,17 @@ export default {
25 25
       });
26 26
 
27 27
       Object.assign(state.items[index], item);
28
+    },
29
+    updatePublished(state, item) {
30
+      state.items.find(week => week.id === item.id).publish = true;
31
+    },
32
+    updateUnpublished(state, item) {
33
+      state.items.find(week => week.id === item.id).publish = false;
28 34
     }
29 35
   },
30 36
   getters: {
31 37
     getNeedsVerify(state) {
32
-      return state.items
38
+      return state.items;
33 39
     }
34 40
     // removeListing(state, id) {
35 41
     //   state.myWeeks.pop(state.myWeeks.find(w => w.id === id));
@@ -58,8 +64,17 @@ export default {
58 64
         console.log(err);
59 65
       }
60 66
     },
61
-    publishWeek(id) {
62
-      axios.post(`/api/timeshareweek/publishweek/${id}`).catch(console.error);
67
+    publishWeek({ commit }, item) {
68
+      axios
69
+        .post(`/api/timeshareweek/publishweek/${item.id}`)
70
+        .then(result => commit("updatePublished", item))
71
+        .catch(console.error);
72
+    },
73
+    unpublishWeek({ commit }, item) {
74
+      axios
75
+        .post(`/api/timeshareweek/UnpublishWeek/${item.id}`)
76
+        .then(result => commit("updateUnpublished", item))
77
+        .catch(console.error);
63 78
     },
64 79
     // deleteListing({ commit }, id) {
65 80
     //   axios

Loading…
Cancelar
Guardar