Browse Source

Fix to publish Timeshare

master
GJWilliams87 4 years ago
parent
commit
29fcb0b3cd

+ 131
- 61
src/components/admin/status/editTimeShareAdminPage.vue View File

19
               <div class="form-row">
19
               <div class="form-row">
20
                 <div class="form-group col-md-6">
20
                 <div class="form-group col-md-6">
21
                   <div class="input-group">
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
                       >REGION</label
26
                       >REGION</label
24
                     >
27
                     >
25
                   </div>
28
                   </div>
29
                       v-model="selectedRegion"
32
                       v-model="selectedRegion"
30
                       style="font-size: 15px"
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
                         {{ region.regionName }}
40
                         {{ region.regionName }}
34
                       </option>
41
                       </option>
35
                     </select>
42
                     </select>
41
                 </div>
48
                 </div>
42
                 <div class="form-group col-md-6">
49
                 <div class="form-group col-md-6">
43
                   <div class="input-group">
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
                         <option value="Other">Other</option>
56
                         <option value="Other">Other</option>
47
                         <option
57
                         <option
48
                           v-for="(resort, r) in filteredResort"
58
                           v-for="(resort, r) in filteredResort"
49
                           :key="r"
59
                           :key="r"
50
                           :value="resort.resortCode"
60
                           :value="resort.resortCode"
51
-                          >{{ resort.resortName }}</option
52
                         >
61
                         >
62
+                          {{ resort.resortName }}
63
+                        </option>
53
                       </select>
64
                       </select>
54
                     </float-label>
65
                     </float-label>
55
 
66
 
86
                 </div>
97
                 </div>
87
                 <div class="form-group col-md-6">
98
                 <div class="form-group col-md-6">
88
                   <div v-if="weekParam.otherResort">
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
                       >REGION</label
104
                       >REGION</label
91
                     >
105
                     >
92
                   </div>
106
                   </div>
107
                 <div class="form-group col-md-6">
121
                 <div class="form-group col-md-6">
108
                   <float-label>
122
                   <float-label>
109
                     <input
123
                     <input
110
-                      type="number"
124
+                      type="text"
111
                       class="form-control"
125
                       class="form-control"
112
                       name="unitNumber"
126
                       name="unitNumber"
113
                       id="unitNumber"
127
                       id="unitNumber"
142
                       id="season"
156
                       id="season"
143
                       v-model="selectedSeason"
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
                     </select>
166
                     </select>
149
                   </float-label>
167
                   </float-label>
150
 
168
 
158
                       id="region"
176
                       id="region"
159
                       v-model="selectedBedrooms"
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
                     </select>
182
                     </select>
163
                   </float-label>
183
                   </float-label>
164
 
184
 
172
                       id="region"
192
                       id="region"
173
                       v-model="selectedMaxSleep"
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
                     </select>
198
                     </select>
177
                   </float-label>
199
                   </float-label>
178
 
200
 
266
             <div align="left" class="custom-control custom-switch mb-2">
288
             <div align="left" class="custom-control custom-switch mb-2">
267
               <div class="row">
289
               <div class="row">
268
                 <div align="center" class="col">
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
                   <input
294
                   <input
271
                     type="checkbox"
295
                     type="checkbox"
272
                     class="custom-control-input"
296
                     class="custom-control-input"
279
                   </label>
303
                   </label>
280
                   <div
304
                   <div
281
                     class="spacebanked1"
305
                     class="spacebanked1"
282
-                    :class="{ 'spacebanked1--clicked': weekParam.currentYearBanked }"
306
+                    :class="{
307
+                      'spacebanked1--clicked': weekParam.currentYearBanked,
308
+                    }"
283
                   >
309
                   >
284
                     <div class="col-md-6">
310
                     <div class="col-md-6">
285
                       <label
311
                       <label
293
                         v-if="weekParam.currentYearBanked"
319
                         v-if="weekParam.currentYearBanked"
294
                         v-model="weekParam.bankedWith"
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
                       </select>
329
                       </select>
300
                     </div>
330
                     </div>
301
                   </div>
331
                   </div>
303
               </div>
333
               </div>
304
             </div>
334
             </div>
305
 
335
 
306
-            <div class="section-header" style="margin-top:50px">
336
+            <div class="section-header" style="margin-top: 50px">
307
               <h2>Detailed Individual Information</h2>
337
               <h2>Detailed Individual Information</h2>
308
             </div>
338
             </div>
309
             <div class="form">
339
             <div class="form">
310
               <div v-if="ROLE === 'Super Admin'" class="row mb-4">
340
               <div v-if="ROLE === 'Super Admin'" class="row mb-4">
311
                 <div class="col">
341
                 <div class="col">
312
                   <float-label label="OWNER TYPE" fixed>
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
                       <option v-bind:value="true">Custom Owner</option>
347
                       <option v-bind:value="true">Custom Owner</option>
315
                       <option v-bind:value="false">Registered User</option>
348
                       <option v-bind:value="false">Registered User</option>
316
                     </select>
349
                     </select>
326
                       class="form-control uniSelect mt-3"
359
                       class="form-control uniSelect mt-3"
327
                       @change="updateCurrentUser()"
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
                     </select>
369
                     </select>
333
                   </float-label>
370
                   </float-label>
334
                 </div>
371
                 </div>
458
                 </div>
495
                 </div>
459
               </div>
496
               </div>
460
             </div>
497
             </div>
461
-            <div class="section-header" style="margin-top:50px">
498
+            <div class="section-header" style="margin-top: 50px">
462
               <h2>Week Agent</h2>
499
               <h2>Week Agent</h2>
463
             </div>
500
             </div>
464
             <div class="row">
501
             <div class="row">
470
                   name="agency"
507
                   name="agency"
471
                   v-model="weekParam.agencyId"
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
                 </select>
517
                 </select>
477
               </div>
518
               </div>
478
               <div class="col-md-6">
519
               <div class="col-md-6">
484
                   v-model="weekParam.agentId"
525
                   v-model="weekParam.agentId"
485
                   :disabled="!weekParam.agencyId"
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
                     <div>{{ item.name + " " + item.surname }}</div>
533
                     <div>{{ item.name + " " + item.surname }}</div>
489
                   </option>
534
                   </option>
490
                 </select>
535
                 </select>
504
                         id="status"
549
                         id="status"
505
                         v-model="weekParam.status.id"
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
                       </select>
559
                       </select>
511
                     </float-label>
560
                     </float-label>
512
                   </div>
561
                   </div>
539
               </div>
588
               </div>
540
               <div class="row">
589
               <div class="row">
541
                 <div class="text-center col-6">
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
                 </div>
594
                 </div>
544
                 <div class="text-center col-6">
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
                 </div>
599
                 </div>
547
               </div>
600
               </div>
548
             </div>
601
             </div>
575
   props: {
628
   props: {
576
     weekParam: {},
629
     weekParam: {},
577
     weekId: {
630
     weekId: {
578
-      default: 0
579
-    }
631
+      default: 0,
632
+    },
580
   },
633
   },
581
   data() {
634
   data() {
582
     return {
635
     return {
596
       depDateParam: {},
649
       depDateParam: {},
597
       pubDateParam: {},
650
       pubDateParam: {},
598
       boolAwaitingPayment: false,
651
       boolAwaitingPayment: false,
599
-      selectedUser: ""
652
+      selectedUser: "",
600
     };
653
     };
601
   },
654
   },
602
   components: {
655
   components: {
603
     addressAutoComplete,
656
     addressAutoComplete,
604
-    Alert
657
+    Alert,
605
   },
658
   },
606
   async mounted() {
659
   async mounted() {
607
     if (this.sellItem.id) {
660
     if (this.sellItem.id) {
625
     this.selectedWeekType = this.weekParam.weekType;
678
     this.selectedWeekType = this.weekParam.weekType;
626
     this.selectedStatus = this.weekParam.status;
679
     this.selectedStatus = this.weekParam.status;
627
     this.selectedPublish = this.weekParam.publish;
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
     this.dateParam = date;
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
     this.depDateParam = depDate;
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
     this.pubDateParam = datePub;
692
     this.pubDateParam = datePub;
634
     if (this.weekParam.status.description === "Awaiting Payment") {
693
     if (this.weekParam.status.description === "Awaiting Payment") {
635
       if (this.ROLE !== "Super Admin") {
694
       if (this.ROLE !== "Super Admin") {
672
       "sellItem",
731
       "sellItem",
673
       "agencies",
732
       "agencies",
674
       "agents",
733
       "agents",
675
-      "getTemplate"
734
+      "getTemplate",
676
     ]),
735
     ]),
677
     ...mapGetters("nonRegIndividual", ["getIndiv"]),
736
     ...mapGetters("nonRegIndividual", ["getIndiv"]),
678
     ...mapState("individual", ["indiv"]),
737
     ...mapState("individual", ["indiv"]),
681
     ...mapState("status", ["statusList"]),
740
     ...mapState("status", ["statusList"]),
682
     ...mapGetters({
741
     ...mapGetters({
683
       user: "authentication/getUser",
742
       user: "authentication/getUser",
684
-      person: "authentication/getPerson"
743
+      person: "authentication/getPerson",
685
     }),
744
     }),
686
     ...mapState("bank", ["banks"]),
745
     ...mapState("bank", ["banks"]),
687
     ...mapState("register", ["individuals", "removeIndividual"]),
746
     ...mapState("register", ["individuals", "removeIndividual"]),
697
       let list = [];
756
       let list = [];
698
       if (this.week && this.week.region && this.selectedRegion) {
757
       if (this.week && this.week.region && this.selectedRegion) {
699
         const item = this.detailedRegion.find(
758
         const item = this.detailedRegion.find(
700
-          region => region.region.regionCode === this.selectedRegion
759
+          (region) => region.region.regionCode === this.selectedRegion
701
         );
760
         );
702
         if (item) {
761
         if (item) {
703
           list = item.children;
762
           list = item.children;
705
       } else {
764
       } else {
706
         list = this.resorts;
765
         list = this.resorts;
707
       }
766
       }
708
-      return _.sortBy(list, x => x.resortName);
767
+      return _.sortBy(list, (x) => x.resortName);
709
     },
768
     },
710
     isLoggedIn() {
769
     isLoggedIn() {
711
       return this.user && this.person;
770
       return this.user && this.person;
712
     },
771
     },
713
     displayNotDeletedAgents() {
772
     displayNotDeletedAgents() {
714
       var notDeletedArr = [];
773
       var notDeletedArr = [];
715
-      this.agents.forEach(agent => {
774
+      this.agents.forEach((agent) => {
716
         if (!agent.isDeleted) {
775
         if (!agent.isDeleted) {
717
           if (agent.agencyId === this.weekParam.agencyId) {
776
           if (agent.agencyId === this.weekParam.agencyId) {
718
             notDeletedArr.push(agent);
777
             notDeletedArr.push(agent);
720
         }
779
         }
721
       });
780
       });
722
       return notDeletedArr;
781
       return notDeletedArr;
723
-    }
782
+    },
724
   },
783
   },
725
   methods: {
784
   methods: {
726
     ...mapActions("individual", ["getIndividual"]),
785
     ...mapActions("individual", ["getIndividual"]),
727
     ...mapActions("nonRegIndividual", ["retrieveNonRegIndiv"]),
786
     ...mapActions("nonRegIndividual", ["retrieveNonRegIndiv"]),
728
-    ...mapActions("timeshare", ["initTimeshare", "onResortChange", "saveWeek", "getBlankWeek"]),
787
+    ...mapActions("timeshare", [
788
+      "initTimeshare",
789
+      "onResortChange",
790
+      "saveWeek",
791
+      "getBlankWeek",
792
+    ]),
729
     ...mapActions("payment", ["addPayment"]),
793
     ...mapActions("payment", ["addPayment"]),
730
     ...mapActions("bank", ["getBanks"]),
794
     ...mapActions("bank", ["getBanks"]),
731
     ...mapActions("myWeeks", ["getItems", "getWeek", "editSave"]),
795
     ...mapActions("myWeeks", ["getItems", "getWeek", "editSave"]),
736
       this.getBlankWeek();
800
       this.getBlankWeek();
737
     },
801
     },
738
     updateCurrentUser() {
802
     updateCurrentUser() {
739
-      this.individuals.forEach(indiv => {
803
+      this.individuals.forEach((indiv) => {
740
         if (this.weekParam.ownerId === indiv.id) {
804
         if (this.weekParam.ownerId === indiv.id) {
741
           this.week.owner.name = indiv.name;
805
           this.week.owner.name = indiv.name;
742
           this.week.owner.surname = indiv.surname;
806
           this.week.owner.surname = indiv.surname;
750
       });
814
       });
751
     },
815
     },
752
     saveEdit() {
816
     saveEdit() {
753
-      this.regions.forEach(region => {
817
+      this.regions.forEach((region) => {
754
         if (region.regionCode === this.selectedRegion) {
818
         if (region.regionCode === this.selectedRegion) {
755
           //console.log(region);
819
           //console.log(region);
756
           this.weekParam.regionId = region.id;
820
           this.weekParam.regionId = region.id;
757
         }
821
         }
758
       });
822
       });
759
-      this.resorts.forEach(resort => {
823
+      this.resorts.forEach((resort) => {
760
         if (resort.resortCode === this.selectedResort) {
824
         if (resort.resortCode === this.selectedResort) {
761
           this.weekParam.resortCode = resort.resortCode;
825
           this.weekParam.resortCode = resort.resortCode;
762
           this.weekParam.resortName = resort.resortName;
826
           this.weekParam.resortName = resort.resortName;
765
       console.log(this.selectedSeason);
829
       console.log(this.selectedSeason);
766
       this.weekParam.season = this.selectedSeason;
830
       this.weekParam.season = this.selectedSeason;
767
 
831
 
768
-      this.resortBedrooms.forEach(bedroom => {
832
+      this.resortBedrooms.forEach((bedroom) => {
769
         if (bedroom === this.selectedBedrooms) {
833
         if (bedroom === this.selectedBedrooms) {
770
           this.weekParam.bedroom = bedroom;
834
           this.weekParam.bedroom = bedroom;
771
         }
835
         }
772
       });
836
       });
773
-      this.maxSleep.forEach(sleepMax => {
837
+      this.maxSleep.forEach((sleepMax) => {
774
         if (sleepMax === this.selectedMaxSleep) {
838
         if (sleepMax === this.selectedMaxSleep) {
775
           this.weekParam.maxSleep = sleepMax;
839
           this.weekParam.maxSleep = sleepMax;
776
         }
840
         }
781
       if (this.week.owner.telephone === "") {
845
       if (this.week.owner.telephone === "") {
782
         delete this.week.owner.telephone;
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
       //console.log(this.pubDateParam);
854
       //console.log(this.pubDateParam);
787
       if (this.pubDateParam) {
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
       this.weekParam.owner = this.week.owner;
860
       this.weekParam.owner = this.week.owner;
791
       this.weekParam.askingPrice = this.week.askingPrice;
861
       this.weekParam.askingPrice = this.week.askingPrice;
808
     resortChange() {
878
     resortChange() {
809
       this.onResortChange({
879
       this.onResortChange({
810
         resortName: this.week.resort.resortName,
880
         resortName: this.week.resort.resortName,
811
-        resortCode: this.week.resort.resortCode
881
+        resortCode: this.week.resort.resortCode,
812
       });
882
       });
813
 
883
 
814
       if (this.week && this.week.resort === "Other") {
884
       if (this.week && this.week.resort === "Other") {
834
         creatydById: Log.getUser().id, //Log.getUser().id,
904
         creatydById: Log.getUser().id, //Log.getUser().id,
835
         amount: amount,
905
         amount: amount,
836
         paymentStatus: "",
906
         paymentStatus: "",
837
-        paymentToken: ""
907
+        paymentToken: "",
838
       };
908
       };
839
 
909
 
840
-      this.addPayment(paymentObj).then(res => {
910
+      this.addPayment(paymentObj).then((res) => {
841
         this.$router.push({
911
         this.$router.push({
842
           name: "PaymentGateway",
912
           name: "PaymentGateway",
843
           params: {
913
           params: {
844
             paymentReqId: res.PAY_REQUEST_ID,
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
 </script>
922
 </script>
853
 
923
 

+ 71
- 37
src/components/admin/status/timeshareAdminList.vue View File

6
       </div>
6
       </div>
7
       <div class="row">
7
       <div class="row">
8
         <div class="col-lg-6 offset-3">
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
         </div>
15
         </div>
11
       </div>
16
       </div>
12
       <div class="row">
17
       <div class="row">
18
             <thead>
23
             <thead>
19
               <tr>
24
               <tr>
20
                 <th scope="col" v-for="(col, c) in displayColumns" :key="c">
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
                     <div class="d-flex bd-highlight">
27
                     <div class="d-flex bd-highlight">
23
                       <div class="w-100 bd-highlight">{{ col }}</div>
28
                       <div class="w-100 bd-highlight">{{ col }}</div>
24
                       <div class="flex-shrink-1 bd-highlight">
29
                       <div class="flex-shrink-1 bd-highlight">
66
                 <td>{{ item.status.description }}</td>
71
                 <td>{{ item.status.description }}</td>
67
                 <td v-if="!item.publish">
72
                 <td v-if="!item.publish">
68
                   <a v-on:click="Publish(item)">
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
                   </a>
79
                   </a>
71
                 </td>
80
                 </td>
72
                 <td v-else>
81
                 <td v-else>
80
                 </td>
89
                 </td>
81
                 <td>
90
                 <td>
82
                   <a v-on:click="Edit(item)">
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
                   </a>
97
                   </a>
85
                 </td>
98
                 </td>
86
                 <td>
99
                 <td>
87
                   <a v-on:click="Delete(item)">
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
                   </a>
106
                   </a>
90
                 </td>
107
                 </td>
91
               </tr>
108
               </tr>
93
           </table>
110
           </table>
94
           <div class="d-flex justify-content-between" v-if="showPager">
111
           <div class="d-flex justify-content-between" v-if="showPager">
95
             <div class="p-1">
112
             <div class="p-1">
96
-              {{ currentPage + " / " + PageCount + (" - (" + FilteredListings.length + " items)") }}
113
+              {{
114
+                currentPage +
115
+                " / " +
116
+                PageCount +
117
+                (" - (" + FilteredListings.length + " items)")
118
+              }}
97
             </div>
119
             </div>
98
             <div class="p-1">
120
             <div class="p-1">
99
               <BasePagination
121
               <BasePagination
112
                     v-model="visibleItemsPerPageCount"
134
                     v-model="visibleItemsPerPageCount"
113
                     @change="onChangeItemsPerPage()"
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
                   </select>
140
                   </select>
117
                 </div>
141
                 </div>
118
               </div>
142
               </div>
121
           <div class="p-2">
145
           <div class="p-2">
122
             <div class="d-flex flex-row">
146
             <div class="d-flex flex-row">
123
               <div>
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
                   Clear Sort
153
                   Clear Sort
126
                 </button>
154
                 </button>
127
               </div>
155
               </div>
144
 
172
 
145
 export default {
173
 export default {
146
   components: {
174
   components: {
147
-    BasePagination
175
+    BasePagination,
148
   },
176
   },
149
   data() {
177
   data() {
150
     return {
178
     return {
169
         "Region",
197
         "Region",
170
         "Amount",
198
         "Amount",
171
         "Submitted",
199
         "Submitted",
172
-        "Status"
200
+        "Status",
173
       ],
201
       ],
174
       columns: [
202
       columns: [
175
         "owner",
203
         "owner",
181
         "season",
209
         "season",
182
         "region",
210
         "region",
183
         "sellPrice",
211
         "sellPrice",
184
-        "weekStatus"
185
-      ]
212
+        "weekStatus",
213
+      ],
186
     };
214
     };
187
   },
215
   },
188
   methods: {
216
   methods: {
189
     ...mapActions("myWeeks", ["getAllItems"]),
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
     Publish(item) {
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
     Unpublish(item) {
240
     Unpublish(item) {
206
-      item.publish = false;
207
-
208
-      console.log(item);
209
-      this.publishOnly(item);
241
+      this.unpublishWeek(item);
210
     },
242
     },
211
     Edit(item) {
243
     Edit(item) {
212
       this.$router.push({ name: "EditTimeshare", params: { weekParam: item } });
244
       this.$router.push({ name: "EditTimeshare", params: { weekParam: item } });
234
     ClearSort() {
266
     ClearSort() {
235
       this.reverse = true;
267
       this.reverse = true;
236
       this.sortKey = "id";
268
       this.sortKey = "id";
237
-    }
269
+    },
238
   },
270
   },
239
   computed: {
271
   computed: {
240
     ...mapState("propertyList", ["properties"]),
272
     ...mapState("propertyList", ["properties"]),
241
     ...mapGetters({ getNeedsVerify: "myWeeks/getNeedsVerify" }),
273
     ...mapGetters({ getNeedsVerify: "myWeeks/getNeedsVerify" }),
242
     FilteredListings() {
274
     FilteredListings() {
243
       if (this.filter) {
275
       if (this.filter) {
244
-        const list = _.filter(this.getNeedsVerify, item =>
276
+        const list = _.filter(this.getNeedsVerify, (item) =>
245
           Object.values(item).some(
277
           Object.values(item).some(
246
-            i =>
278
+            (i) =>
247
               JSON.stringify(i)
279
               JSON.stringify(i)
248
                 .toLowerCase()
280
                 .toLowerCase()
249
                 .indexOf(this.filter.toLowerCase()) > -1
281
                 .indexOf(this.filter.toLowerCase()) > -1
256
     },
288
     },
257
     PageCount() {
289
     PageCount() {
258
       return this.visibleItemsPerPageCount !== 0
290
       return this.visibleItemsPerPageCount !== 0
259
-        ? Math.ceil(this.FilteredListings.length / this.visibleItemsPerPageCount)
291
+        ? Math.ceil(
292
+            this.FilteredListings.length / this.visibleItemsPerPageCount
293
+          )
260
         : 1;
294
         : 1;
261
     },
295
     },
262
     DisplayItems() {
296
     DisplayItems() {
270
     },
304
     },
271
     SortDirection() {
305
     SortDirection() {
272
       return this.reverse ? "desc" : "asc";
306
       return this.reverse ? "desc" : "asc";
273
-    }
307
+    },
274
   },
308
   },
275
   created() {
309
   created() {
276
     this.getItems(this.userId).then(() => {
310
     this.getItems(this.userId).then(() => {
293
         if (val != oldVal) {
327
         if (val != oldVal) {
294
           this.currentPage = 1;
328
           this.currentPage = 1;
295
         }
329
         }
296
-      }
297
-    }
298
-  }
330
+      },
331
+    },
332
+  },
299
 };
333
 };
300
 </script>
334
 </script>
301
 
335
 

+ 194
- 75
src/components/timeshare/sell/contentSection.vue View File

20
                 <label class="custom-control-label" for="customSwitch1">
20
                 <label class="custom-control-label" for="customSwitch1">
21
                   {{ refAgent ? "Yes" : "No" }}
21
                   {{ refAgent ? "Yes" : "No" }}
22
                 </label>
22
                 </label>
23
-                <div class="refbyAgent" :class="{ 'refbyAgent--clicked': refAgent }">
23
+                <div
24
+                  class="refbyAgent"
25
+                  :class="{ 'refbyAgent--clicked': refAgent }"
26
+                >
24
                   <div class="col-md-6" v-if="refAgent">
27
                   <div class="col-md-6" v-if="refAgent">
25
                     <label for="Name of Agency">Agency</label>
28
                     <label for="Name of Agency">Agency</label>
26
                     <select
29
                     <select
29
                       name="agency"
32
                       name="agency"
30
                       v-model="sellItem.agencyId"
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
                     </select>
42
                     </select>
36
                   </div>
43
                   </div>
37
                   <div class="col-md-6" v-if="refAgent">
44
                   <div class="col-md-6" v-if="refAgent">
63
             <div class="form-row">
70
             <div class="form-row">
64
               <div class="form-group col-md-6 mt-2">
71
               <div class="form-group col-md-6 mt-2">
65
                 <div class="input-group">
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
                     >REGION</label
77
                     >REGION</label
68
                   >
78
                   >
69
-                  <float-label label="REGION" style="width:100%">
79
+                  <float-label label="REGION" style="width: 100%">
70
                     <select
80
                     <select
71
                       id="weekInfoRegionSelect"
81
                       id="weekInfoRegionSelect"
72
                       class="form-control uniSelect"
82
                       class="form-control uniSelect"
74
                       @change="regionChange()"
84
                       @change="regionChange()"
75
                       style="font-size: 15px"
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
                         {{ region.regionName }}
92
                         {{ region.regionName }}
79
                       </option>
93
                       </option>
80
                     </select>
94
                     </select>
94
               </div>
108
               </div>
95
               <div class="form-group col-md-6 mt-2">
109
               <div class="form-group col-md-6 mt-2">
96
                 <div class="input-group">
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
                     >RESORT NAME</label
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
                     <select
118
                     <select
102
                       id="weekInfoResortSelect"
119
                       id="weekInfoResortSelect"
103
                       class="form-control uniSelect"
120
                       class="form-control uniSelect"
105
                       @change="resortChange()"
122
                       @change="resortChange()"
106
                     >
123
                     >
107
                       <option value="Other">Other</option>
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
                         {{ resort.resortName }}
130
                         {{ resort.resortName }}
110
                       </option>
131
                       </option>
111
                     </select>
132
                     </select>
134
               </div>
155
               </div>
135
               <div class="form-group col-md-6 mt-2">
156
               <div class="form-group col-md-6 mt-2">
136
                 <div v-if="sellItem.otherResort">
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
                 </div>
164
                 </div>
139
 
165
 
140
                 <select
166
                 <select
144
                   id="region"
170
                   id="region"
145
                   v-model="sellItem.region"
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
                 </select>
176
                 </select>
149
               </div>
177
               </div>
150
               <div class="form-group col-md-6 mt-2">
178
               <div class="form-group col-md-6 mt-2">
151
                 <float-label>
179
                 <float-label>
152
                   <input
180
                   <input
153
-                    type="number"
181
+                    type="text"
154
                     class="form-control"
182
                     class="form-control"
155
                     name="unitNumber"
183
                     name="unitNumber"
156
                     id="unitNumber"
184
                     id="unitNumber"
178
                 <div class="validation"></div>
206
                 <div class="validation"></div>
179
               </div>
207
               </div>
180
               <div class="form-group col-md-6 mt-2">
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
                 <float-label label="SEASON">
215
                 <float-label label="SEASON">
183
                   <select
216
                   <select
184
                     class="form-control uniSelect"
217
                     class="form-control uniSelect"
186
                     id="region"
219
                     id="region"
187
                     v-model="sellItem.season"
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
                   </select>
225
                   </select>
191
                 </float-label>
226
                 </float-label>
192
 
227
 
193
                 <div class="validation"></div>
228
                 <div class="validation"></div>
194
               </div>
229
               </div>
195
               <div class="form-group col-md-6 mt-2">
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
                   >BEDROOM/S</label
235
                   >BEDROOM/S</label
198
                 >
236
                 >
199
                 <float-label label="BEDROOM/S">
237
                 <float-label label="BEDROOM/S">
203
                     id="region"
241
                     id="region"
204
                     v-model="sellItem.bedrooms"
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
                   </select>
247
                   </select>
208
                 </float-label>
248
                 </float-label>
209
 
249
 
210
                 <div class="validation"></div>
250
                 <div class="validation"></div>
211
               </div>
251
               </div>
212
               <div class="form-group col-md-6 mt-2">
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
                   >SLEEP MAX</label
257
                   >SLEEP MAX</label
215
                 >
258
                 >
216
                 <float-label label="SLEEP MAX">
259
                 <float-label label="SLEEP MAX">
220
                     id="region"
263
                     id="region"
221
                     v-model="sellItem.maxSleep"
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
                   </select>
269
                   </select>
225
                 </float-label>
270
                 </float-label>
226
 
271
 
242
                 <div class="validation"></div>
287
                 <div class="validation"></div>
243
               </div>
288
               </div>
244
               <div class="form-group col-md-6 mt-2">
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
                   >WEEK TYPE</label
294
                   >WEEK TYPE</label
247
                 >
295
                 >
248
                 <float-label label="WEEK TYPE">
296
                 <float-label label="WEEK TYPE">
264
           <div align="left" class="custom-control custom-switch mb-2">
312
           <div align="left" class="custom-control custom-switch mb-2">
265
             <div class="row">
313
             <div class="row">
266
               <div align="center" class="col">
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
                 <input
318
                 <input
269
                   type="checkbox"
319
                   type="checkbox"
270
                   class="custom-control-input"
320
                   class="custom-control-input"
277
                 </label>
327
                 </label>
278
                 <div
328
                 <div
279
                   class="spacebanked1"
329
                   class="spacebanked1"
280
-                  :class="{ 'spacebanked1--clicked': sellItem.currentYearBanked }"
330
+                  :class="{
331
+                    'spacebanked1--clicked': sellItem.currentYearBanked,
332
+                  }"
281
                 >
333
                 >
282
                   <div class="col-md-6">
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
                       >Please confirm with whom</label
338
                       >Please confirm with whom</label
285
                     >
339
                     >
286
                     <select
340
                     <select
289
                       v-if="sellItem.currentYearBanked"
343
                       v-if="sellItem.currentYearBanked"
290
                       v-model="sellItem.bankedWith"
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
                     </select>
349
                     </select>
294
                   </div>
350
                   </div>
295
                 </div>
351
                 </div>
372
               <div class="form-group col-md-6">
428
               <div class="form-group col-md-6">
373
                 <div class="input-group">
429
                 <div class="input-group">
374
                   <span v-if="!indiv.howMarried">
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
                       >Marital Status</label
435
                       >Marital Status</label
377
                     >
436
                     >
378
                   </span>
437
                   </span>
379
 
438
 
380
-                  <float-label label="Marital Status" style="width:100%">
439
+                  <float-label label="Marital Status" style="width: 100%">
381
                     <select
440
                     <select
382
                       class="form-control uniSelect"
441
                       class="form-control uniSelect"
383
                       id="howMarried"
442
                       id="howMarried"
384
                       v-model="indiv.howMarried"
443
                       v-model="indiv.howMarried"
385
                     >
444
                     >
386
                       <option value="N/A">N/A</option>
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
                       <option value="Other">Other</option>
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
                       <option value="Single">Single</option>
456
                       <option value="Single">Single</option>
394
                       <option value="Divorced">Divorced</option>
457
                       <option value="Divorced">Divorced</option>
395
                       <option value="Widow">Widow</option>
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
                       <option value="Partner">Partner</option>
462
                       <option value="Partner">Partner</option>
398
                     </select>
463
                     </select>
399
                   </float-label>
464
                   </float-label>
450
               </div>
515
               </div>
451
             </div>
516
             </div>
452
           </div>
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
             <h2>Spouse Details</h2>
522
             <h2>Spouse Details</h2>
455
           </div>
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
             <div class="form-row mb-2">
528
             <div class="form-row mb-2">
458
               <div class="form-group col-md-6 mt-2">
529
               <div class="form-group col-md-6 mt-2">
459
                 <float-label>
530
                 <float-label>
632
             <div class="form-row">
703
             <div class="form-row">
633
               <div
704
               <div
634
                 class="form-group col-md-12"
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
                   1. With respect to my timeshare module/week, I confirm that:
714
                   1. With respect to my timeshare module/week, I confirm that:
639
                 </p>
715
                 </p>
640
                 <div class="validation"></div>
716
                 <div class="validation"></div>
643
 
719
 
644
             <div class="form-row">
720
             <div class="form-row">
645
               <div class="col-md-8">
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
               </div>
726
               </div>
648
               <div class="form-group col-md-2">
727
               <div class="form-group col-md-2">
649
                 <div class="custom-control custom-switch">
728
                 <div class="custom-control custom-switch">
685
 
764
 
686
             <div class="form-row">
765
             <div class="form-row">
687
               <div class="col-md-8">
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
               </div>
771
               </div>
690
               <div class="form-group col-md-2">
772
               <div class="form-group col-md-2">
691
                 <input
773
                 <input
700
 
782
 
701
             <div class="form-row">
783
             <div class="form-row">
702
               <div class="col-md-8">
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
               </div>
789
               </div>
705
               <div class="form-group col-md-2">
790
               <div class="form-group col-md-2">
706
                 <input
791
                 <input
718
             <div class="form-row">
803
             <div class="form-row">
719
               <div class="col-md-8">
804
               <div class="col-md-8">
720
                 <p>
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
                 </p>
808
                 </p>
724
               </div>
809
               </div>
725
               <div class="form-group col-md-2">
810
               <div class="form-group col-md-2">
747
             <div class="form-row">
832
             <div class="form-row">
748
               <div class="col-md-8">
833
               <div class="col-md-8">
749
                 <p>
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
                 </p>
837
                 </p>
753
               </div>
838
               </div>
754
               <div class="form-group col-md-2">
839
               <div class="form-group col-md-2">
766
 
851
 
767
             <div class="form-row">
852
             <div class="form-row">
768
               <div class="col-md-8">
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
               </div>
857
               </div>
771
               <div class="form-group col-md-2">
858
               <div class="form-group col-md-2">
772
                 <input
859
                 <input
784
             <div class="form-row">
871
             <div class="form-row">
785
               <div class="col-md-8">
872
               <div class="col-md-8">
786
                 <p>
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
                 </p>
876
                 </p>
790
               </div>
877
               </div>
791
               <div class="form-group col-md-4">
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
               </div>
884
               </div>
794
             </div>
885
             </div>
795
             <div class="form-row" v-if="!CanSave">
886
             <div class="form-row" v-if="!CanSave">
796
               <div class="col-md-12">
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
               </div>
891
               </div>
799
             </div>
892
             </div>
800
             <div class="form-row" v-if="profileEmailError">
893
             <div class="form-row" v-if="profileEmailError">
801
               <div class="col-md-12">
894
               <div class="col-md-12">
802
                 <p class="alert myError">
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
                 </p>
898
                 </p>
805
               </div>
899
               </div>
806
             </div>
900
             </div>
807
             <div class="text-center col-12" v-if="CanSave">
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
                 SUBMIT
907
                 SUBMIT
810
               </button>
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
             </div>
912
             </div>
813
             <!-- <div class="text-center col-12">
913
             <!-- <div class="text-center col-12">
814
               <button class="btn-solid-blue" @click="paygateRedirect()">PayGate</button>
914
               <button class="btn-solid-blue" @click="paygateRedirect()">PayGate</button>
838
   name: "TimeshareToSell",
938
   name: "TimeshareToSell",
839
   props: {
939
   props: {
840
     weekId: {
940
     weekId: {
841
-      default: 0
842
-    }
941
+      default: 0,
942
+    },
843
   },
943
   },
844
   data() {
944
   data() {
845
     return {
945
     return {
846
       wait: false,
946
       wait: false,
847
       userLoggedIn: Log.isLoggedIn(),
947
       userLoggedIn: Log.isLoggedIn(),
848
-      profileEmailError: false
948
+      profileEmailError: false,
849
     };
949
     };
850
   },
950
   },
851
   components: {
951
   components: {
852
     addressAutoComplete,
952
     addressAutoComplete,
853
-    Alert
953
+    Alert,
854
   },
954
   },
855
   mounted() {
955
   mounted() {
856
     if (this.sellItem.id) {
956
     if (this.sellItem.id) {
876
       "sellItem",
976
       "sellItem",
877
       "agencies",
977
       "agencies",
878
       "agents",
978
       "agents",
879
-      "getTemplate"
979
+      "getTemplate",
880
     ]),
980
     ]),
881
     ...mapState("individual", ["indiv"]),
981
     ...mapState("individual", ["indiv"]),
882
     ...mapState("authentication", ["isLoggedIn"]),
982
     ...mapState("authentication", ["isLoggedIn"]),
883
     ...mapGetters({
983
     ...mapGetters({
884
       user: "authentication/getUser",
984
       user: "authentication/getUser",
885
-      person: "authentication/getPerson"
985
+      person: "authentication/getPerson",
886
     }),
986
     }),
887
     ...mapState("bank", ["banks"]),
987
     ...mapState("bank", ["banks"]),
888
     refAgent() {
988
     refAgent() {
891
     ...mapGetters("fees", ["getListingFee"]),
991
     ...mapGetters("fees", ["getListingFee"]),
892
     filteredResort() {
992
     filteredResort() {
893
       let list = [];
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
         const item = this.detailedRegion.find(
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
         if (item) {
1003
         if (item) {
899
           list = item.children;
1004
           list = item.children;
901
       } else {
1006
       } else {
902
         list = this.resorts;
1007
         list = this.resorts;
903
       }
1008
       }
904
-      return _.sortBy(list, x => x.resortName);
1009
+      return _.sortBy(list, (x) => x.resortName);
905
     },
1010
     },
906
     isLoggedIn() {
1011
     isLoggedIn() {
907
       return this.user && this.person;
1012
       return this.user && this.person;
908
     },
1013
     },
909
     displayNotDeletedAgents() {
1014
     displayNotDeletedAgents() {
910
       var notDeletedArr = [];
1015
       var notDeletedArr = [];
911
-      this.agents.forEach(agent => {
1016
+      this.agents.forEach((agent) => {
912
         if (!agent.isDeleted) {
1017
         if (!agent.isDeleted) {
913
           if (agent.agencyId === this.sellItem.agencyId) {
1018
           if (agent.agencyId === this.sellItem.agencyId) {
914
             notDeletedArr.push(agent);
1019
             notDeletedArr.push(agent);
919
     },
1024
     },
920
     CanSave() {
1025
     CanSave() {
921
       if (this.indiv.howMarried === "In Community Of Property") {
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
           return true;
1032
           return true;
924
         }
1033
         }
925
         return false;
1034
         return false;
926
       }
1035
       }
927
       return true;
1036
       return true;
928
-    }
1037
+    },
929
   },
1038
   },
930
   methods: {
1039
   methods: {
931
     ...mapActions("individual", ["getIndividual"]),
1040
     ...mapActions("individual", ["getIndividual"]),
932
-    ...mapActions("timeshare", ["initTimeshare", "onResortChange", "saveWeek", "getBlankWeek"]),
1041
+    ...mapActions("timeshare", [
1042
+      "initTimeshare",
1043
+      "onResortChange",
1044
+      "saveWeek",
1045
+      "getBlankWeek",
1046
+    ]),
933
     ...mapActions("payment", ["addPayment"]),
1047
     ...mapActions("payment", ["addPayment"]),
934
     ...mapActions("bank", ["getBanks"]),
1048
     ...mapActions("bank", ["getBanks"]),
935
     newSale() {
1049
     newSale() {
941
         this.sellItem.ownerObject = this.indiv;
1055
         this.sellItem.ownerObject = this.indiv;
942
         this.sellItem.weekStatus = "For Sale";
1056
         this.sellItem.weekStatus = "For Sale";
943
         this.saveWeek(this.sellItem)
1057
         this.saveWeek(this.sellItem)
944
-          .then(fulfilled => {
1058
+          .then((fulfilled) => {
945
             console.log(fulfilled);
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
             //this.paygateRedirect();
1064
             //this.paygateRedirect();
948
           })
1065
           })
949
-          .catch(ex => {
1066
+          .catch((ex) => {
950
             this.profileEmailError = true;
1067
             this.profileEmailError = true;
951
           });
1068
           });
952
       } else {
1069
       } else {
961
         creatydById: Log.getUser().id, //Log.getUser().id,
1078
         creatydById: Log.getUser().id, //Log.getUser().id,
962
         amount: amount,
1079
         amount: amount,
963
         paymentStatus: "",
1080
         paymentStatus: "",
964
-        paymentToken: ""
1081
+        paymentToken: "",
965
       };
1082
       };
966
 
1083
 
967
-      this.addPayment(paymentObj).then(res => {
1084
+      this.addPayment(paymentObj).then((res) => {
968
         this.$router.push({
1085
         this.$router.push({
969
           name: "PaymentGateway",
1086
           name: "PaymentGateway",
970
           params: {
1087
           params: {
971
             paymentReqId: res.PAY_REQUEST_ID,
1088
             paymentReqId: res.PAY_REQUEST_ID,
972
-            checksum: res.CHECKSUM
973
-          }
1089
+            checksum: res.CHECKSUM,
1090
+          },
974
         });
1091
         });
975
       });
1092
       });
976
     },
1093
     },
995
     resortChange() {
1112
     resortChange() {
996
       this.onResortChange({
1113
       this.onResortChange({
997
         resortName: this.sellItem.resort.resortName,
1114
         resortName: this.sellItem.resort.resortName,
998
-        resortCode: this.sellItem.resort.resortCode
1115
+        resortCode: this.sellItem.resort.resortCode,
999
       });
1116
       });
1000
 
1117
 
1001
       if (this.sellItem && this.sellItem.resort === "Other") {
1118
       if (this.sellItem && this.sellItem.resort === "Other") {
1007
       }
1124
       }
1008
     },
1125
     },
1009
     regionChange() {
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
     UpdateAddress(address) {
1131
     UpdateAddress(address) {
1013
       this.indiv.address.streetNumber = address.streetNumber;
1132
       this.indiv.address.streetNumber = address.streetNumber;
1023
       } else {
1142
       } else {
1024
         this.sellItem.mandateDate = undefined;
1143
         this.sellItem.mandateDate = undefined;
1025
       }
1144
       }
1026
-    }
1027
-  }
1145
+    },
1146
+  },
1028
 };
1147
 };
1029
 </script>
1148
 </script>
1030
 
1149
 

+ 18
- 3
src/store/modules/timeshare/myWeeks.js View File

25
       });
25
       });
26
 
26
 
27
       Object.assign(state.items[index], item);
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
   getters: {
36
   getters: {
31
     getNeedsVerify(state) {
37
     getNeedsVerify(state) {
32
-      return state.items
38
+      return state.items;
33
     }
39
     }
34
     // removeListing(state, id) {
40
     // removeListing(state, id) {
35
     //   state.myWeeks.pop(state.myWeeks.find(w => w.id === id));
41
     //   state.myWeeks.pop(state.myWeeks.find(w => w.id === id));
58
         console.log(err);
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
     // deleteListing({ commit }, id) {
79
     // deleteListing({ commit }, id) {
65
     //   axios
80
     //   axios

Loading…
Cancel
Save