30117125 4 роки тому
джерело
коміт
78017d3f18

+ 131
- 61
src/components/admin/status/editTimeShareAdminPage.vue Переглянути файл

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

+ 71
- 37
src/components/admin/status/timeshareAdminList.vue Переглянути файл

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

+ 62
- 27
src/components/timeshare/sell/contentSection.vue Переглянути файл

@@ -29,9 +29,9 @@
29 29
                       name="agency"
30 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 35
                     </select>
36 36
                   </div>
37 37
                   <div class="col-md-6" v-if="refAgent">
@@ -66,7 +66,7 @@
66 66
                   <label v-if="!sellItem.region" class="uniSelectLabel" for="weekInfoRegionSelect"
67 67
                     >REGION</label
68 68
                   >
69
-                  <float-label label="REGION" style="width:100%">
69
+                  <float-label label="REGION" style="width: 100%">
70 70
                     <select
71 71
                       id="weekInfoRegionSelect"
72 72
                       class="form-control uniSelect"
@@ -97,7 +97,7 @@
97 97
                   <label v-if="!sellItem.resort" class="uniSelectLabel" for="weekInfoResortSelect"
98 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 101
                     <select
102 102
                       id="weekInfoResortSelect"
103 103
                       class="form-control uniSelect"
@@ -144,13 +144,15 @@
144 144
                   id="region"
145 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 150
                 </select>
149 151
               </div>
150 152
               <div class="form-group col-md-6 mt-2">
151 153
                 <float-label>
152 154
                   <input
153
-                    type="number"
155
+                    type="text"
154 156
                     class="form-control"
155 157
                     name="unitNumber"
156 158
                     id="unitNumber"
@@ -186,7 +188,9 @@
186 188
                     id="region"
187 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 194
                   </select>
191 195
                 </float-label>
192 196
 
@@ -203,7 +207,9 @@
203 207
                     id="region"
204 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 213
                   </select>
208 214
                 </float-label>
209 215
 
@@ -220,7 +226,9 @@
220 226
                     id="region"
221 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 232
                   </select>
225 233
                 </float-label>
226 234
 
@@ -277,7 +285,9 @@
277 285
                 </label>
278 286
                 <div
279 287
                   class="spacebanked1"
280
-                  :class="{ 'spacebanked1--clicked': sellItem.currentYearBanked }"
288
+                  :class="{
289
+                    'spacebanked1--clicked': sellItem.currentYearBanked
290
+                  }"
281 291
                 >
282 292
                   <div class="col-md-6">
283 293
                     <label for="If yes, please confirm with whom" v-if="sellItem.currentYearBanked"
@@ -289,7 +299,9 @@
289 299
                       v-if="sellItem.currentYearBanked"
290 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 305
                     </select>
294 306
                   </div>
295 307
                 </div>
@@ -377,23 +389,29 @@
377 389
                     >
378 390
                   </span>
379 391
 
380
-                  <float-label label="Marital Status" style="width:100%">
392
+                  <float-label label="Marital Status" style="width: 100%">
381 393
                     <select
382 394
                       class="form-control uniSelect"
383 395
                       id="howMarried"
384 396
                       v-model="indiv.howMarried"
385 397
                     >
386 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 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 409
                       <option value="Single">Single</option>
394 410
                       <option value="Divorced">Divorced</option>
395 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 415
                       <option value="Partner">Partner</option>
398 416
                     </select>
399 417
                   </float-label>
@@ -632,9 +650,14 @@
632 650
             <div class="form-row">
633 651
               <div
634 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 661
                   1. With respect to my timeshare module/week, I confirm that:
639 662
                 </p>
640 663
                 <div class="validation"></div>
@@ -643,7 +666,9 @@
643 666
 
644 667
             <div class="form-row">
645 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 672
               </div>
648 673
               <div class="form-group col-md-2">
649 674
                 <div class="custom-control custom-switch">
@@ -685,7 +710,9 @@
685 710
 
686 711
             <div class="form-row">
687 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 716
               </div>
690 717
               <div class="form-group col-md-2">
691 718
                 <input
@@ -700,7 +727,9 @@
700 727
 
701 728
             <div class="form-row">
702 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 733
               </div>
705 734
               <div class="form-group col-md-2">
706 735
                 <input
@@ -766,7 +795,9 @@
766 795
 
767 796
             <div class="form-row">
768 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 801
               </div>
771 802
               <div class="form-group col-md-2">
772 803
                 <input
@@ -794,7 +825,9 @@
794 825
             </div>
795 826
             <div class="form-row" v-if="!CanSave">
796 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 831
               </div>
799 832
             </div>
800 833
             <div class="form-row" v-if="profileEmailError">
@@ -808,7 +841,9 @@
808 841
               <button class="btn-solid-blue" v-if="!sellItem.id" @click="submitSale()">
809 842
                 SUBMIT
810 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 847
             </div>
813 848
             <!-- <div class="text-center col-12">
814 849
               <button class="btn-solid-blue" @click="paygateRedirect()">PayGate</button>

+ 18
- 3
src/store/modules/timeshare/myWeeks.js Переглянути файл

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

Завантаження…
Відмінити
Зберегти