30117125 4 anni fa
parent
commit
78017d3f18

+ 131
- 61
src/components/admin/status/editTimeShareAdminPage.vue Vedi 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 Vedi 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
 

+ 62
- 27
src/components/timeshare/sell/contentSection.vue Vedi File

29
                       name="agency"
29
                       name="agency"
30
                       v-model="sellItem.agencyId"
30
                       v-model="sellItem.agencyId"
31
                     >
31
                     >
32
-                      <option v-for="(item, i) in agencies" :key="i" :value="item.id">{{
33
-                        item.agencyName
34
-                      }}</option>
32
+                      <option v-for="(item, i) in agencies" :key="i" :value="item.id">
33
+                        {{ item.agencyName }}
34
+                      </option>
35
                     </select>
35
                     </select>
36
                   </div>
36
                   </div>
37
                   <div class="col-md-6" v-if="refAgent">
37
                   <div class="col-md-6" v-if="refAgent">
66
                   <label v-if="!sellItem.region" class="uniSelectLabel" for="weekInfoRegionSelect"
66
                   <label v-if="!sellItem.region" class="uniSelectLabel" for="weekInfoRegionSelect"
67
                     >REGION</label
67
                     >REGION</label
68
                   >
68
                   >
69
-                  <float-label label="REGION" style="width:100%">
69
+                  <float-label label="REGION" style="width: 100%">
70
                     <select
70
                     <select
71
                       id="weekInfoRegionSelect"
71
                       id="weekInfoRegionSelect"
72
                       class="form-control uniSelect"
72
                       class="form-control uniSelect"
97
                   <label v-if="!sellItem.resort" class="uniSelectLabel" for="weekInfoResortSelect"
97
                   <label v-if="!sellItem.resort" class="uniSelectLabel" for="weekInfoResortSelect"
98
                     >RESORT NAME</label
98
                     >RESORT NAME</label
99
                   >
99
                   >
100
-                  <float-label label="RESORT NAME" style="width:100%">
100
+                  <float-label label="RESORT NAME" style="width: 100%">
101
                     <select
101
                     <select
102
                       id="weekInfoResortSelect"
102
                       id="weekInfoResortSelect"
103
                       class="form-control uniSelect"
103
                       class="form-control uniSelect"
144
                   id="region"
144
                   id="region"
145
                   v-model="sellItem.region"
145
                   v-model="sellItem.region"
146
                 >
146
                 >
147
-                  <option v-for="(region, r) in regions" :key="r">{{ region.regionName }}</option>
147
+                  <option v-for="(region, r) in regions" :key="r">
148
+                    {{ region.regionName }}
149
+                  </option>
148
                 </select>
150
                 </select>
149
               </div>
151
               </div>
150
               <div class="form-group col-md-6 mt-2">
152
               <div class="form-group col-md-6 mt-2">
151
                 <float-label>
153
                 <float-label>
152
                   <input
154
                   <input
153
-                    type="number"
155
+                    type="text"
154
                     class="form-control"
156
                     class="form-control"
155
                     name="unitNumber"
157
                     name="unitNumber"
156
                     id="unitNumber"
158
                     id="unitNumber"
186
                     id="region"
188
                     id="region"
187
                     v-model="sellItem.season"
189
                     v-model="sellItem.season"
188
                   >
190
                   >
189
-                    <option v-for="(season, r) in seasons" :key="r">{{ season.name }}</option>
191
+                    <option v-for="(season, r) in seasons" :key="r">
192
+                      {{ season.name }}
193
+                    </option>
190
                   </select>
194
                   </select>
191
                 </float-label>
195
                 </float-label>
192
 
196
 
203
                     id="region"
207
                     id="region"
204
                     v-model="sellItem.bedrooms"
208
                     v-model="sellItem.bedrooms"
205
                   >
209
                   >
206
-                    <option v-for="(item, i) in resortBedrooms" :key="i">{{ item }}</option>
210
+                    <option v-for="(item, i) in resortBedrooms" :key="i">
211
+                      {{ item }}
212
+                    </option>
207
                   </select>
213
                   </select>
208
                 </float-label>
214
                 </float-label>
209
 
215
 
220
                     id="region"
226
                     id="region"
221
                     v-model="sellItem.maxSleep"
227
                     v-model="sellItem.maxSleep"
222
                   >
228
                   >
223
-                    <option v-for="(item, i) in maxSleep" :key="i">{{ item }}</option>
229
+                    <option v-for="(item, i) in maxSleep" :key="i">
230
+                      {{ item }}
231
+                    </option>
224
                   </select>
232
                   </select>
225
                 </float-label>
233
                 </float-label>
226
 
234
 
277
                 </label>
285
                 </label>
278
                 <div
286
                 <div
279
                   class="spacebanked1"
287
                   class="spacebanked1"
280
-                  :class="{ 'spacebanked1--clicked': sellItem.currentYearBanked }"
288
+                  :class="{
289
+                    'spacebanked1--clicked': sellItem.currentYearBanked
290
+                  }"
281
                 >
291
                 >
282
                   <div class="col-md-6">
292
                   <div class="col-md-6">
283
                     <label for="If yes, please confirm with whom" v-if="sellItem.currentYearBanked"
293
                     <label for="If yes, please confirm with whom" v-if="sellItem.currentYearBanked"
289
                       v-if="sellItem.currentYearBanked"
299
                       v-if="sellItem.currentYearBanked"
290
                       v-model="sellItem.bankedWith"
300
                       v-model="sellItem.bankedWith"
291
                     >
301
                     >
292
-                      <option v-for="(item, i) in bankedEntities" :key="i">{{ item }}</option>
302
+                      <option v-for="(item, i) in bankedEntities" :key="i">
303
+                        {{ item }}
304
+                      </option>
293
                     </select>
305
                     </select>
294
                   </div>
306
                   </div>
295
                 </div>
307
                 </div>
377
                     >
389
                     >
378
                   </span>
390
                   </span>
379
 
391
 
380
-                  <float-label label="Marital Status" style="width:100%">
392
+                  <float-label label="Marital Status" style="width: 100%">
381
                     <select
393
                     <select
382
                       class="form-control uniSelect"
394
                       class="form-control uniSelect"
383
                       id="howMarried"
395
                       id="howMarried"
384
                       v-model="indiv.howMarried"
396
                       v-model="indiv.howMarried"
385
                     >
397
                     >
386
                       <option value="N/A">N/A</option>
398
                       <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
-                      >
399
+                      <option value="In Community Of Property">
400
+                        In Community Of Property
401
+                      </option>
402
+                      <option value="Out of Community Of Property">
403
+                        Out of Community Of Property
404
+                      </option>
391
                       <option value="Other">Other</option>
405
                       <option value="Other">Other</option>
392
-                      <option value="Traditional Wedding">Traditional Wedding</option>
406
+                      <option value="Traditional Wedding">
407
+                        Traditional Wedding
408
+                      </option>
393
                       <option value="Single">Single</option>
409
                       <option value="Single">Single</option>
394
                       <option value="Divorced">Divorced</option>
410
                       <option value="Divorced">Divorced</option>
395
                       <option value="Widow">Widow</option>
411
                       <option value="Widow">Widow</option>
396
-                      <option value="Committed Relationship">Committed Relationship</option>
412
+                      <option value="Committed Relationship">
413
+                        Committed Relationship
414
+                      </option>
397
                       <option value="Partner">Partner</option>
415
                       <option value="Partner">Partner</option>
398
                     </select>
416
                     </select>
399
                   </float-label>
417
                   </float-label>
632
             <div class="form-row">
650
             <div class="form-row">
633
               <div
651
               <div
634
                 class="form-group col-md-12"
652
                 class="form-group col-md-12"
635
-                style="border:solid;border-width:2px; border-color:rgb(27, 117, 187);border-radius: 3px"
653
+                style="
654
+                  border: solid;
655
+                  border-width: 2px;
656
+                  border-color: rgb(27, 117, 187);
657
+                  border-radius: 3px;
658
+                "
636
               >
659
               >
637
-                <p style="text-align: left; margin:auto; padding:10px">
660
+                <p style="text-align: left; margin: auto; padding: 10px">
638
                   1. With respect to my timeshare module/week, I confirm that:
661
                   1. With respect to my timeshare module/week, I confirm that:
639
                 </p>
662
                 </p>
640
                 <div class="validation"></div>
663
                 <div class="validation"></div>
643
 
666
 
644
             <div class="form-row">
667
             <div class="form-row">
645
               <div class="col-md-8">
668
               <div class="col-md-8">
646
-                <p>1.1. All levy amounts for the current cycle have been paid in full</p>
669
+                <p>
670
+                  1.1. All levy amounts for the current cycle have been paid in full
671
+                </p>
647
               </div>
672
               </div>
648
               <div class="form-group col-md-2">
673
               <div class="form-group col-md-2">
649
                 <div class="custom-control custom-switch">
674
                 <div class="custom-control custom-switch">
685
 
710
 
686
             <div class="form-row">
711
             <div class="form-row">
687
               <div class="col-md-8">
712
               <div class="col-md-8">
688
-                <p>1.3. I / We bought the timeshare module/week on the following date:</p>
713
+                <p>
714
+                  1.3. I / We bought the timeshare module/week on the following date:
715
+                </p>
689
               </div>
716
               </div>
690
               <div class="form-group col-md-2">
717
               <div class="form-group col-md-2">
691
                 <input
718
                 <input
700
 
727
 
701
             <div class="form-row">
728
             <div class="form-row">
702
               <div class="col-md-8">
729
               <div class="col-md-8">
703
-                <p>1.4. The purchase price for which I / we bought timeshare module / week was:</p>
730
+                <p>
731
+                  1.4. The purchase price for which I / we bought timeshare module / week was:
732
+                </p>
704
               </div>
733
               </div>
705
               <div class="form-group col-md-2">
734
               <div class="form-group col-md-2">
706
                 <input
735
                 <input
766
 
795
 
767
             <div class="form-row">
796
             <div class="form-row">
768
               <div class="col-md-8">
797
               <div class="col-md-8">
769
-                <p>1.7. Estate agent's commission agreed to (state Rand value)</p>
798
+                <p>
799
+                  1.7. Estate agent's commission agreed to (state Rand value)
800
+                </p>
770
               </div>
801
               </div>
771
               <div class="form-group col-md-2">
802
               <div class="form-group col-md-2">
772
                 <input
803
                 <input
794
             </div>
825
             </div>
795
             <div class="form-row" v-if="!CanSave">
826
             <div class="form-row" v-if="!CanSave">
796
               <div class="col-md-12">
827
               <div class="col-md-12">
797
-                <p class="alert myError">Please ensure that you add spouse details.</p>
828
+                <p class="alert myError">
829
+                  Please ensure that you add spouse details.
830
+                </p>
798
               </div>
831
               </div>
799
             </div>
832
             </div>
800
             <div class="form-row" v-if="profileEmailError">
833
             <div class="form-row" v-if="profileEmailError">
808
               <button class="btn-solid-blue" v-if="!sellItem.id" @click="submitSale()">
841
               <button class="btn-solid-blue" v-if="!sellItem.id" @click="submitSale()">
809
                 SUBMIT
842
                 SUBMIT
810
               </button>
843
               </button>
811
-              <button class="btn-solid-blue" v-else @click="newSale()">NEW WEEK</button>
844
+              <button class="btn-solid-blue" v-else @click="newSale()">
845
+                NEW WEEK
846
+              </button>
812
             </div>
847
             </div>
813
             <!-- <div class="text-center col-12">
848
             <!-- <div class="text-center col-12">
814
               <button class="btn-solid-blue" @click="paygateRedirect()">PayGate</button>
849
               <button class="btn-solid-blue" @click="paygateRedirect()">PayGate</button>

+ 18
- 3
src/store/modules/timeshare/myWeeks.js Vedi 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…
Annulla
Salva