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

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

@@ -19,10 +19,7 @@
19 19
               <div class="form-row">
20 20
                 <div class="form-group col-md-6">
21 21
                   <div class="input-group">
22
-                    <label
23
-                      v-if="!selectedRegion"
24
-                      class="uniSelectLabel"
25
-                      for="weekInfoRegionSelect"
22
+                    <label v-if="!selectedRegion" class="uniSelectLabel" for="weekInfoRegionSelect"
26 23
                       >REGION</label
27 24
                     >
28 25
                   </div>
@@ -32,11 +29,7 @@
32 29
                       v-model="selectedRegion"
33 30
                       style="font-size: 15px"
34 31
                     >
35
-                      <option
36
-                        v-for="(region, r) in regions"
37
-                        :key="r"
38
-                        :value="region.regionCode"
39
-                      >
32
+                      <option v-for="(region, r) in regions" :key="r" :value="region.regionCode">
40 33
                         {{ region.regionName }}
41 34
                       </option>
42 35
                     </select>
@@ -49,10 +42,7 @@
49 42
                 <div class="form-group col-md-6">
50 43
                   <div class="input-group">
51 44
                     <float-label label="RESORT NAME" style="width: 100%" fixed>
52
-                      <select
53
-                        class="form-control uniSelect"
54
-                        v-model="selectedResort"
55
-                      >
45
+                      <select class="form-control uniSelect" v-model="selectedResort">
56 46
                         <option value="Other">Other</option>
57 47
                         <option
58 48
                           v-for="(resort, r) in filteredResort"
@@ -97,10 +87,7 @@
97 87
                 </div>
98 88
                 <div class="form-group col-md-6">
99 89
                   <div v-if="weekParam.otherResort">
100
-                    <label
101
-                      v-if="!weekParam.region"
102
-                      class="uniSelectLabel"
103
-                      for="region"
90
+                    <label v-if="!weekParam.region" class="uniSelectLabel" for="region"
104 91
                       >REGION</label
105 92
                     >
106 93
                   </div>
@@ -156,11 +143,7 @@
156 143
                       id="season"
157 144
                       v-model="selectedSeason"
158 145
                     >
159
-                      <option
160
-                        :value="season.name"
161
-                        v-for="(season, r) in seasons"
162
-                        :key="r"
163
-                      >
146
+                      <option :value="season.name" v-for="(season, r) in seasons" :key="r">
164 147
                         {{ season.name }}
165 148
                       </option>
166 149
                     </select>
@@ -288,9 +271,7 @@
288 271
             <div align="left" class="custom-control custom-switch mb-2">
289 272
               <div class="row">
290 273
                 <div align="center" class="col">
291
-                  <label class="mr-5"
292
-                    >Has your week been spacebanked for the current year?</label
293
-                  >
274
+                  <label class="mr-5">Has your week been spacebanked for the current year?</label>
294 275
                   <input
295 276
                     type="checkbox"
296 277
                     class="custom-control-input"
@@ -304,7 +285,7 @@
304 285
                   <div
305 286
                     class="spacebanked1"
306 287
                     :class="{
307
-                      'spacebanked1--clicked': weekParam.currentYearBanked,
288
+                      'spacebanked1--clicked': weekParam.currentYearBanked
308 289
                     }"
309 290
                   >
310 291
                     <div class="col-md-6">
@@ -319,11 +300,7 @@
319 300
                         v-if="weekParam.currentYearBanked"
320 301
                         v-model="weekParam.bankedWith"
321 302
                       >
322
-                        <option
323
-                          v-for="(item, i) in bankedEntities"
324
-                          :key="i"
325
-                          :value="item"
326
-                        >
303
+                        <option v-for="(item, i) in bankedEntities" :key="i" :value="item">
327 304
                           {{ item }}
328 305
                         </option>
329 306
                       </select>
@@ -340,10 +317,7 @@
340 317
               <div v-if="ROLE === 'Super Admin'" class="row mb-4">
341 318
                 <div class="col">
342 319
                   <float-label label="OWNER TYPE" fixed>
343
-                    <select
344
-                      v-model="weekParam.customOwner"
345
-                      class="form-control uniSelect mt-3"
346
-                    >
320
+                    <select v-model="weekParam.customOwner" class="form-control uniSelect mt-3">
347 321
                       <option v-bind:value="true">Custom Owner</option>
348 322
                       <option v-bind:value="false">Registered User</option>
349 323
                     </select>
@@ -359,11 +333,7 @@
359 333
                       class="form-control uniSelect mt-3"
360 334
                       @change="updateCurrentUser()"
361 335
                     >
362
-                      <option
363
-                        v-for="indiv in individuals"
364
-                        :key="indiv.id"
365
-                        :value="indiv.id"
366
-                      >
336
+                      <option v-for="indiv in individuals" :key="indiv.id" :value="indiv.id">
367 337
                         {{ indiv.fullName }}
368 338
                       </option>
369 339
                     </select>
@@ -507,11 +477,7 @@
507 477
                   name="agency"
508 478
                   v-model="weekParam.agencyId"
509 479
                 >
510
-                  <option
511
-                    v-for="(item, i) in agencies"
512
-                    :key="i"
513
-                    :value="item.id"
514
-                  >
480
+                  <option v-for="(item, i) in agencies" :key="i" :value="item.id">
515 481
                     {{ item.agencyName }}
516 482
                   </option>
517 483
                 </select>
@@ -525,11 +491,7 @@
525 491
                   v-model="weekParam.agentId"
526 492
                   :disabled="!weekParam.agencyId"
527 493
                 >
528
-                  <option
529
-                    v-for="(item, i) in displayNotDeletedAgents"
530
-                    :key="i"
531
-                    :value="item.id"
532
-                  >
494
+                  <option v-for="(item, i) in displayNotDeletedAgents" :key="i" :value="item.id">
533 495
                     <div>{{ item.name + " " + item.surname }}</div>
534 496
                   </option>
535 497
                 </select>
@@ -549,11 +511,7 @@
549 511
                         id="status"
550 512
                         v-model="weekParam.status.id"
551 513
                       >
552
-                        <option
553
-                          :key="status.id"
554
-                          :value="status.id"
555
-                          v-for="status in statusList"
556
-                        >
514
+                        <option :key="status.id" :value="status.id" v-for="status in statusList">
557 515
                           {{ status.description }}
558 516
                         </option>
559 517
                       </select>
@@ -628,8 +586,8 @@ export default {
628 586
   props: {
629 587
     weekParam: {},
630 588
     weekId: {
631
-      default: 0,
632
-    },
589
+      default: 0
590
+    }
633 591
   },
634 592
   data() {
635 593
     return {
@@ -649,12 +607,12 @@ export default {
649 607
       depDateParam: {},
650 608
       pubDateParam: {},
651 609
       boolAwaitingPayment: false,
652
-      selectedUser: "",
610
+      selectedUser: ""
653 611
     };
654 612
   },
655 613
   components: {
656 614
     addressAutoComplete,
657
-    Alert,
615
+    Alert
658 616
   },
659 617
   async mounted() {
660 618
     if (this.sellItem.id) {
@@ -678,17 +636,11 @@ export default {
678 636
     this.selectedWeekType = this.weekParam.weekType;
679 637
     this.selectedStatus = this.weekParam.status;
680 638
     this.selectedPublish = this.weekParam.publish;
681
-    var date = new Date(this.weekParam.arrivalDate)
682
-      .toISOString()
683
-      .substring(0, 10);
639
+    var date = new Date(this.weekParam.arrivalDate).toISOString().substring(0, 10);
684 640
     this.dateParam = date;
685
-    var depDate = new Date(this.weekParam.departureDate)
686
-      .toISOString()
687
-      .substring(0, 10);
641
+    var depDate = new Date(this.weekParam.departureDate).toISOString().substring(0, 10);
688 642
     this.depDateParam = depDate;
689
-    var datePub = new Date(this.weekParam.pulbishedDate)
690
-      .toISOString()
691
-      .substring(0, 10);
643
+    var datePub = new Date(this.weekParam.pulbishedDate).toISOString().substring(0, 10);
692 644
     this.pubDateParam = datePub;
693 645
     if (this.weekParam.status.description === "Awaiting Payment") {
694 646
       if (this.ROLE !== "Super Admin") {
@@ -731,7 +683,7 @@ export default {
731 683
       "sellItem",
732 684
       "agencies",
733 685
       "agents",
734
-      "getTemplate",
686
+      "getTemplate"
735 687
     ]),
736 688
     ...mapGetters("nonRegIndividual", ["getIndiv"]),
737 689
     ...mapState("individual", ["indiv"]),
@@ -740,7 +692,7 @@ export default {
740 692
     ...mapState("status", ["statusList"]),
741 693
     ...mapGetters({
742 694
       user: "authentication/getUser",
743
-      person: "authentication/getPerson",
695
+      person: "authentication/getPerson"
744 696
     }),
745 697
     ...mapState("bank", ["banks"]),
746 698
     ...mapState("register", ["individuals", "removeIndividual"]),
@@ -756,7 +708,7 @@ export default {
756 708
       let list = [];
757 709
       if (this.week && this.week.region && this.selectedRegion) {
758 710
         const item = this.detailedRegion.find(
759
-          (region) => region.region.regionCode === this.selectedRegion
711
+          region => region.region.regionCode === this.selectedRegion
760 712
         );
761 713
         if (item) {
762 714
           list = item.children;
@@ -764,14 +716,14 @@ export default {
764 716
       } else {
765 717
         list = this.resorts;
766 718
       }
767
-      return _.sortBy(list, (x) => x.resortName);
719
+      return _.sortBy(list, x => x.resortName);
768 720
     },
769 721
     isLoggedIn() {
770 722
       return this.user && this.person;
771 723
     },
772 724
     displayNotDeletedAgents() {
773 725
       var notDeletedArr = [];
774
-      this.agents.forEach((agent) => {
726
+      this.agents.forEach(agent => {
775 727
         if (!agent.isDeleted) {
776 728
           if (agent.agencyId === this.weekParam.agencyId) {
777 729
             notDeletedArr.push(agent);
@@ -779,17 +731,12 @@ export default {
779 731
         }
780 732
       });
781 733
       return notDeletedArr;
782
-    },
734
+    }
783 735
   },
784 736
   methods: {
785 737
     ...mapActions("individual", ["getIndividual"]),
786 738
     ...mapActions("nonRegIndividual", ["retrieveNonRegIndiv"]),
787
-    ...mapActions("timeshare", [
788
-      "initTimeshare",
789
-      "onResortChange",
790
-      "saveWeek",
791
-      "getBlankWeek",
792
-    ]),
739
+    ...mapActions("timeshare", ["initTimeshare", "onResortChange", "saveWeek", "getBlankWeek"]),
793 740
     ...mapActions("payment", ["addPayment"]),
794 741
     ...mapActions("bank", ["getBanks"]),
795 742
     ...mapActions("myWeeks", ["getItems", "getWeek", "editSave"]),
@@ -800,7 +747,7 @@ export default {
800 747
       this.getBlankWeek();
801 748
     },
802 749
     updateCurrentUser() {
803
-      this.individuals.forEach((indiv) => {
750
+      this.individuals.forEach(indiv => {
804 751
         if (this.weekParam.ownerId === indiv.id) {
805 752
           this.week.owner.name = indiv.name;
806 753
           this.week.owner.surname = indiv.surname;
@@ -814,13 +761,13 @@ export default {
814 761
       });
815 762
     },
816 763
     saveEdit() {
817
-      this.regions.forEach((region) => {
764
+      this.regions.forEach(region => {
818 765
         if (region.regionCode === this.selectedRegion) {
819 766
           //console.log(region);
820 767
           this.weekParam.regionId = region.id;
821 768
         }
822 769
       });
823
-      this.resorts.forEach((resort) => {
770
+      this.resorts.forEach(resort => {
824 771
         if (resort.resortCode === this.selectedResort) {
825 772
           this.weekParam.resortCode = resort.resortCode;
826 773
           this.weekParam.resortName = resort.resortName;
@@ -829,12 +776,12 @@ export default {
829 776
       console.log(this.selectedSeason);
830 777
       this.weekParam.season = this.selectedSeason;
831 778
 
832
-      this.resortBedrooms.forEach((bedroom) => {
779
+      this.resortBedrooms.forEach(bedroom => {
833 780
         if (bedroom === this.selectedBedrooms) {
834 781
           this.weekParam.bedroom = bedroom;
835 782
         }
836 783
       });
837
-      this.maxSleep.forEach((sleepMax) => {
784
+      this.maxSleep.forEach(sleepMax => {
838 785
         if (sleepMax === this.selectedMaxSleep) {
839 786
           this.weekParam.maxSleep = sleepMax;
840 787
         }
@@ -845,24 +792,18 @@ export default {
845 792
       if (this.week.owner.telephone === "") {
846 793
         delete this.week.owner.telephone;
847 794
       }
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);
795
+      this.weekParam.arrivalDate = new Date(this.dateParam).toISOString().substring(0, 10);
796
+      this.weekParam.departureDate = new Date(this.depDateParam).toISOString().substring(0, 10);
854 797
       //console.log(this.pubDateParam);
855 798
       if (this.pubDateParam) {
856
-        this.weekParam.pulbishedDate = new Date(this.pubDateParam)
857
-          .toISOString()
858
-          .substring(0, 19);
799
+        this.weekParam.pulbishedDate = new Date(this.pubDateParam).toISOString().substring(0, 19);
859 800
       }
860 801
       this.weekParam.owner = this.week.owner;
861 802
       this.weekParam.askingPrice = this.week.askingPrice;
862 803
       this.weekParam.module = this.week.module;
863 804
       parseFloat(this.weekParam.sellPrice);
864 805
       parseFloat(this.weekParam.levyAmount);
865
-      delete this.weekParam.weekType;
806
+      this.weekParam.weekType = this.selectedWeekType;
866 807
       delete this.weekParam.Owner;
867 808
       delete this.weekParam.agency;
868 809
       delete this.weekParam.agent;
@@ -878,7 +819,7 @@ export default {
878 819
     resortChange() {
879 820
       this.onResortChange({
880 821
         resortName: this.week.resort.resortName,
881
-        resortCode: this.week.resort.resortCode,
822
+        resortCode: this.week.resort.resortCode
882 823
       });
883 824
 
884 825
       if (this.week && this.week.resort === "Other") {
@@ -904,20 +845,20 @@ export default {
904 845
         creatydById: Log.getUser().id, //Log.getUser().id,
905 846
         amount: amount,
906 847
         paymentStatus: "",
907
-        paymentToken: "",
848
+        paymentToken: ""
908 849
       };
909 850
 
910
-      this.addPayment(paymentObj).then((res) => {
851
+      this.addPayment(paymentObj).then(res => {
911 852
         this.$router.push({
912 853
           name: "PaymentGateway",
913 854
           params: {
914 855
             paymentReqId: res.PAY_REQUEST_ID,
915
-            checksum: res.CHECKSUM,
916
-          },
856
+            checksum: res.CHECKSUM
857
+          }
917 858
         });
918 859
       });
919
-    },
920
-  },
860
+    }
861
+  }
921 862
 };
922 863
 </script>
923 864
 

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

@@ -12,9 +12,11 @@
12 12
       <div class="row">
13 13
         <br />
14 14
       </div>
15
-      <div class="row">
16
-        <div class="col-lg-12">
17
-          <table class="table table-striped table-responsive">
15
+    </div>
16
+    <div class="container-fluid">
17
+      <div class="row justify-content-center">
18
+        <div class="col-auto">
19
+          <table class="table table-striped table-responsive" style="max-width:1920px">
18 20
             <thead>
19 21
               <tr>
20 22
                 <th scope="col" v-for="(col, c) in displayColumns" :key="c">

+ 2
- 0
src/components/admin/status/timeshareAdminPage.vue Переглянути файл

@@ -8,6 +8,8 @@
8 8
           </div>
9 9
         </div>
10 10
       </div>
11
+    </div>
12
+    <div class="container-fluid">
11 13
       <div v-if="checkAccess" class="row">
12 14
         <div class="col-md-12">
13 15
           <timeshareList />

+ 210
- 0
src/components/communication/editEmailTemplate.vue Переглянути файл

@@ -0,0 +1,210 @@
1
+<template>
2
+  <main id="main" style="margin-top:200px; padding-bottom:50px">
3
+    <div class="container">
4
+      <div class="row">
5
+        <div class="col">
6
+          <div class="section-header">
7
+            <h2>Edit Template</h2>
8
+          </div>
9
+        </div>
10
+      </div>
11
+      <div class="row">
12
+        <div class="col">
13
+          <float-label fixed label="USAGE">
14
+            <select v-model="singleTemp.name" class="form-control uniSelect" name="" id="">
15
+              <option value="WeekOfferMade-User">Timeshare Week Offer Made (User)</option>
16
+              <option value="WeekOfferMade-Owner">Timeshare Week Offer Made (Admin)</option>
17
+              <option value="WeekLoaded-Agent">Timeshare Week Listed (Agent)</option>
18
+              <option value="WeekLoaded-Owner">Timeshare Week Listed (Owner)</option>
19
+              <option value="ContactUs">Contact Us (Admin)</option>
20
+              <option value="EnquireNow">Enquire Now (Admin)</option>
21
+            </select>
22
+          </float-label>
23
+        </div>
24
+        <div class="col">
25
+          <float-label fixed label="SUBJECT">
26
+            <input type="text" class="form-control uniInput" v-model="singleTemp.subject" />
27
+          </float-label>
28
+        </div>
29
+      </div>
30
+      <div class="row mt-5">
31
+        <div class="col-md-12">
32
+          <ul class="nav nav-tabs nav-justified" id="myTab" role="tablist">
33
+            <li class="nav-item">
34
+              <a
35
+                class="nav-link active"
36
+                id="html-tab"
37
+                data-toggle="tab"
38
+                href="#html"
39
+                role="tab"
40
+                aria-controls="html"
41
+                aria-selected="false"
42
+                ><h2>
43
+                  html
44
+                </h2></a
45
+              >
46
+            </li>
47
+            <li class="nav-item">
48
+              <a
49
+                class="nav-link"
50
+                id="preview-tab"
51
+                data-toggle="tab"
52
+                href="#preview"
53
+                role="tab"
54
+                aria-controls="preview"
55
+                aria-selected="true"
56
+                ><h2>
57
+                  Preview
58
+                </h2></a
59
+              >
60
+            </li>
61
+          </ul>
62
+          <div class="tab-content" id="myTabContent">
63
+            <div class="row mt-5">
64
+              <div class="col-md-10 mt-3">
65
+                <float-label fixed label="DYNAMIC FIELD">
66
+                  <select v-model="selectedProperty" class="form-control uniSelect" name="" id="">
67
+                    <optgroup label="Resort Fields">
68
+                      <option value="[RESORTNAME]">Resort Name</option>
69
+                      <option value="[UNITNUMBER]">Unit Number</option>
70
+                      <option value="[MODULE]">Module</option>
71
+                      <option value="[RESORTPRICE]">Resort Price</option>
72
+                      <option value="[RESORTSEASON]">Resort Season</option>
73
+                      <option value="[RESORTLEVY]">Resort Levy</option>
74
+                      <option value="[OFFERMADE]">Offer Made</option>
75
+                      <option value="[OWNER]">OWNER</option>
76
+                    </optgroup>
77
+                    <optgroup label="Property Fields">
78
+                      <option value="[PROPERTYREF]">Property Ref</option>
79
+                      <option value="[PROPERTYNAME]">Property Name</option>
80
+                      <option value="[PROPERTYPRICE]">Property Price</option>
81
+                      <option value="[PROPERTYID]">Property ID</option>
82
+                    </optgroup>
83
+                    <optgroup label="User Fields">
84
+                      <option value="[FULLNAME]">Fullname</option>
85
+                      <option value="[USEREMAIL]">User Email</option>
86
+                      <option value="[USERCELLPHONE]">User Cellphone Number</option>
87
+                      <option value="[USERTELEPHONE]">User Telephone Number</option>
88
+                      <option value="[USERCOMMENT]">User Comment</option>
89
+                      <option value="[USERMESSAGE]">User Message</option>
90
+                    </optgroup>
91
+                  </select>
92
+                </float-label>
93
+              </div>
94
+              <div class="col">
95
+                <button class="btn-solid-blue" @click="onItemAdd">INSERT</button>
96
+              </div>
97
+            </div>
98
+            <div
99
+              class="tab-pane fade show active mt-4"
100
+              style="background-color:rgba(255,255,255,0.75);padding:10px;"
101
+              id="html"
102
+              role="tabpanel"
103
+              aria-labelledby="directions-tab"
104
+            >
105
+              <div class="text-left">
106
+                <div class="input-group mb-3">
107
+                  <textarea
108
+                    id="bodyInput"
109
+                    class="form-control"
110
+                    type="text"
111
+                    rows="40"
112
+                    step="any"
113
+                    name="levy"
114
+                    v-model="singleTemp.body"
115
+                  />
116
+                </div>
117
+              </div>
118
+            </div>
119
+            <div
120
+              class="tab-pane fade mt-4"
121
+              id="preview"
122
+              role="tabpanel"
123
+              aria-labelledby="resort-layout-tab"
124
+            >
125
+              <div class="no-style" v-html="singleTemp.body"></div>
126
+            </div>
127
+          </div>
128
+        </div>
129
+      </div>
130
+      <div class="row mt-4">
131
+        <div class="col">
132
+          <button class="btn-solid-blue" @click="sendToApi()">UPDATE</button>
133
+        </div>
134
+        <div class="col">
135
+          <button class="btn-solid-blue" @click="$router.go(-1)">CANCEL</button>
136
+        </div>
137
+      </div>
138
+    </div>
139
+  </main>
140
+</template>
141
+
142
+<script>
143
+/* eslint-disable */
144
+import { mapActions, mapState } from "vuex";
145
+
146
+import alert from "../shared/alert";
147
+export default {
148
+  data() {
149
+    return {
150
+      selectedProperty: ""
151
+    };
152
+  },
153
+  components: {
154
+    alert
155
+  },
156
+  created() {
157
+    this.getSingleTemplate(this.$route.params.id).then(() => {
158
+      console.log(this.recipient);
159
+    });
160
+  },
161
+  computed: {
162
+    ...mapState("template", ["singleTemp"])
163
+  },
164
+  methods: {
165
+    ...mapActions("template", ["getSingleTemplate", "editItem"]),
166
+    sendToApi() {
167
+      this.editItem(this.singleTemp).then(() => this.$router.go(-1));
168
+    },
169
+    onItemAdd() {
170
+      var placeHolder = this.selectedProperty;
171
+      // will give the current postion of the cursor
172
+      var curPos = document.getElementById("bodyInput").selectionStart;
173
+
174
+      // will get the value of the text area
175
+      let x = $("#bodyInput").val();
176
+
177
+      // will get the value of the input box
178
+      let text_to_insert = placeHolder;
179
+
180
+      // setting the updated value in the text area
181
+      $("#bodyInput").val(x.slice(0, curPos) + text_to_insert + x.slice(curPos));
182
+    }
183
+  }
184
+};
185
+</script>
186
+
187
+<style lang="scss" scoped>
188
+.nav-tabs li a {
189
+  border-top: none;
190
+  border-left: none;
191
+  border-right: none;
192
+  border-bottom-color: rgb(221, 221, 221);
193
+}
194
+
195
+.nav-tabs li :hover {
196
+  background-color: rgb(27, 117, 187);
197
+}
198
+
199
+.nav-tabs li a.active {
200
+  border-top: none;
201
+  border-left: none;
202
+  border-right: none;
203
+  border-bottom-color: rgb(221, 221, 221);
204
+}
205
+
206
+.nav-tabs li a :hover {
207
+  background-color: transparent;
208
+  color: white;
209
+}
210
+</style>

+ 4
- 0
src/components/communication/emailRecipientEdit.vue Переглянути файл

@@ -39,6 +39,10 @@
39 39
             <select v-model="recipient.recipientUsage" class="form-control uniSelect">
40 40
               <option value="ContactUs">Contact Us</option>
41 41
               <option value="EnquireNow">Enquire Now</option>
42
+              <option value="WeekOfferMade-User">Timeshare Week Offer Made (User)</option>
43
+              <option value="WeekOfferMade-Owner">Timeshare Week Offer Made (Admin)</option>
44
+              <option value="WeekLoaded-Agent">Timeshare Week Listed (Agent)</option>
45
+              <option value="WeekLoaded-Owner">Timeshare Week Listed (Owner)</option>
42 46
             </select>
43 47
           </float-label>
44 48
         </div>

+ 4
- 0
src/components/communication/emailRecipientNew.vue Переглянути файл

@@ -39,6 +39,10 @@
39 39
             <select v-model="recipient.recipientUsage" class="form-control uniSelect">
40 40
               <option value="ContactUs">Contact Us</option>
41 41
               <option value="EnquireNow">Enquire Now</option>
42
+              <option value="WeekOfferMade-User">Timeshare Week Offer Made (User)</option>
43
+              <option value="WeekOfferMade-Owner">Timeshare Week Offer Made (Admin)</option>
44
+              <option value="WeekLoaded-Agent">Timeshare Week Listed (Agent)</option>
45
+              <option value="WeekLoaded-Owner">Timeshare Week Listed (Owner)</option>
42 46
             </select>
43 47
           </float-label>
44 48
         </div>

+ 67
- 0
src/components/communication/emailTemplatesNew.vue Переглянути файл

@@ -0,0 +1,67 @@
1
+<template>
2
+  <main id="main" style="margin-top:200px; padding-bottom:50px">
3
+    <div class="container">
4
+      <div class="row">
5
+        <div class="col">
6
+          <div class="section-header">
7
+            <h2>Email Tempaltes</h2>
8
+          </div>
9
+        </div>
10
+      </div>
11
+      <div class="row">
12
+        <div class="col">
13
+          <listView
14
+            :items="list"
15
+            :showNew="true"
16
+            :editable="true"
17
+            :deleteable="true"
18
+            :hideSearch="true"
19
+            :showColumnChooser="false"
20
+            :displayColumns="columns"
21
+            :sortKey="'description'"
22
+            @onEdit="Edit"
23
+            @onDelete="Delete"
24
+            @onNew="New"
25
+          />
26
+        </div>
27
+      </div>
28
+    </div>
29
+  </main>
30
+</template>
31
+
32
+<script>
33
+/* eslint-disable */
34
+import { mapActions, mapState } from "vuex";
35
+import listView from "../shared/listView";
36
+export default {
37
+  name: "MailTempaltes",
38
+  components: {
39
+    listView
40
+  },
41
+  data() {
42
+    return {};
43
+  },
44
+  created() {
45
+    this.getList();
46
+  },
47
+  computed: {
48
+    ...mapState("template", ["list", "item"])
49
+  },
50
+  methods: {
51
+    ...mapActions("template", ["getList", "deleteMailTemplate"]),
52
+    New() {
53
+      this.$router.push("/emailTemplates/New/");
54
+    },
55
+    Edit(item) {
56
+      this.$router.push({
57
+        path: `/emailTemplates/Edit/${item.id}`
58
+      });
59
+    },
60
+    Delete(item) {
61
+      this.deleteMailTemplate(item.id);
62
+    }
63
+  }
64
+};
65
+</script>
66
+
67
+<style lang="scss" scoped></style>

+ 182
- 0
src/components/communication/newEmailTemplate.vue Переглянути файл

@@ -0,0 +1,182 @@
1
+<template>
2
+  <main id="main" style="margin-top:200px; padding-bottom:50px">
3
+    <div class="container">
4
+      <div class="row">
5
+        <div class="col">
6
+          <div class="section-header">
7
+            <h2>Edit Template</h2>
8
+          </div>
9
+        </div>
10
+      </div>
11
+      <div class="row">
12
+        <div class="col">
13
+          <float-label fixed label="USAGE">
14
+            <select v-model="singleTemp.name" class="form-control uniSelect" name="" id="">
15
+              <option value="WeekOfferMade-User">Timeshare Week Offer Made (User)</option>
16
+              <option value="WeekOfferMade-Owner">Timeshare Week Offer Made (Admin)</option>
17
+              <option value="WeekLoaded-Agent">Timeshare Week Listed (Agent)</option>
18
+              <option value="WeekLoaded-Owner">Timeshare Week Listed (Owner)</option>
19
+              <option value="ContactUs">Contact Us (Admin)</option>
20
+              <option value="EnquireNow">Enquire Now (Admin)</option>
21
+            </select>
22
+          </float-label>
23
+        </div>
24
+        <div class="col">
25
+          <float-label fixed label="SUBJECT">
26
+            <input type="text" class="form-control uniInput" v-model="singleTemp.subject" />
27
+          </float-label>
28
+        </div>
29
+      </div>
30
+      <div class="row mt-5">
31
+        <div class="col-md-12">
32
+          <ul class="nav nav-tabs nav-justified" id="myTab" role="tablist">
33
+            <li class="nav-item">
34
+              <a
35
+                class="nav-link active"
36
+                id="html-tab"
37
+                data-toggle="tab"
38
+                href="#html"
39
+                role="tab"
40
+                aria-controls="html"
41
+                aria-selected="false"
42
+                ><h2>
43
+                  html
44
+                </h2></a
45
+              >
46
+            </li>
47
+            <li class="nav-item">
48
+              <a
49
+                class="nav-link"
50
+                id="preview-tab"
51
+                data-toggle="tab"
52
+                href="#preview"
53
+                role="tab"
54
+                aria-controls="preview"
55
+                aria-selected="true"
56
+                ><h2>
57
+                  Preview
58
+                </h2></a
59
+              >
60
+            </li>
61
+          </ul>
62
+          <div class="tab-content" id="myTabContent">
63
+            <div class="row mt-5">
64
+              <div class="col-md-10 mt-3">
65
+                <float-label fixed label="DYNAMIC FIELD">
66
+                  <select v-model="selectedProperty" class="form-control uniSelect" name="" id="">
67
+                    <optgroup label="Resort Fields">
68
+                      <option value="[RESORTNAME]">Resort Name</option>
69
+                      <option value="[UNITNUMBER]">Unit Number</option>
70
+                      <option value="[MODULE]">Module</option>
71
+                      <option value="[RESORTPRICE]">Resort Price</option>
72
+                      <option value="[RESORTSEASON]">Resort Season</option>
73
+                      <option value="[RESORTLEVY]">Resort Levy</option>
74
+                      <option value="[OFFERMADE]">Offer Made</option>
75
+                      <option value="[OWNER]">OWNER</option>
76
+                    </optgroup>
77
+                    <optgroup label="Property Fields">
78
+                      <option value="[PROPERTYREF]">Property Ref</option>
79
+                      <option value="[PROPERTYNAME]">Property Name</option>
80
+                      <option value="[PROPERTYPRICE]">Property Price</option>
81
+                      <option value="[PROPERTYID]">Property ID</option>
82
+                    </optgroup>
83
+                    <optgroup label="User Fields">
84
+                      <option value="[FULLNAME]">Fullname</option>
85
+                      <option value="[USEREMAIL]">User Email</option>
86
+                      <option value="[USERCELLPHONE]">User Cellphone Number</option>
87
+                      <option value="[USERTELEPHONE]">User Telephone Number</option>
88
+                      <option value="[USERCOMMENT]">User Comment</option>
89
+                      <option value="[USERMESSAGE]">User Message</option>
90
+                    </optgroup>
91
+                  </select>
92
+                </float-label>
93
+              </div>
94
+              <div class="col">
95
+                <button class="btn-solid-blue" @click="onItemAdd">INSERT</button>
96
+              </div>
97
+            </div>
98
+            <div
99
+              class="tab-pane fade show active mt-4"
100
+              style="background-color:rgba(255,255,255,0.75);padding:10px;"
101
+              id="html"
102
+              role="tabpanel"
103
+              aria-labelledby="directions-tab"
104
+            >
105
+              <div class="text-left">
106
+                <div class="input-group mb-3">
107
+                  <textarea
108
+                    id="bodyInput"
109
+                    class="form-control"
110
+                    type="text"
111
+                    rows="40"
112
+                    step="any"
113
+                    name="levy"
114
+                    v-model="singleTemp.body"
115
+                  />
116
+                </div>
117
+              </div>
118
+            </div>
119
+            <div
120
+              class="tab-pane fade mt-4"
121
+              id="preview"
122
+              role="tabpanel"
123
+              aria-labelledby="resort-layout-tab"
124
+            >
125
+              <div class="no-style" v-html="singleTemp.body"></div>
126
+            </div>
127
+          </div>
128
+        </div>
129
+      </div>
130
+      <div class="row mt-4">
131
+        <div class="col">
132
+          <button class="btn-solid-blue" @click="sendToApi()">SAVE</button>
133
+        </div>
134
+        <div class="col">
135
+          <button class="btn-solid-blue" @click="$router.go(-1)">CANCEL</button>
136
+        </div>
137
+      </div>
138
+    </div>
139
+  </main>
140
+</template>
141
+
142
+<script>
143
+/* eslint-disable */
144
+import { mapActions, mapState } from "vuex";
145
+
146
+import alert from "../shared/alert";
147
+export default {
148
+  data() {
149
+    return {
150
+      selectedProperty: "",
151
+      singleTemp: {}
152
+    };
153
+  },
154
+  components: {
155
+    alert
156
+  },
157
+  methods: {
158
+    ...mapActions("template", ["addItem"]),
159
+    sendToApi() {
160
+      this.addItem(this.singleTemp).then(() => {
161
+        this.$router.go(-1);
162
+      });
163
+    },
164
+    onItemAdd() {
165
+      var placeHolder = this.selectedProperty;
166
+      // will give the current postion of the cursor
167
+      var curPos = document.getElementById("bodyInput").selectionStart;
168
+
169
+      // will get the value of the text area
170
+      let x = $("#bodyInput").val();
171
+
172
+      // will get the value of the input box
173
+      let text_to_insert = placeHolder;
174
+
175
+      // setting the updated value in the text area
176
+      $("#bodyInput").val(x.slice(0, curPos) + text_to_insert + x.slice(curPos));
177
+    }
178
+  }
179
+};
180
+</script>
181
+
182
+<style lang="scss" scoped></style>

+ 1
- 1
src/components/processFlow/makeOffer.vue Переглянути файл

@@ -187,7 +187,7 @@ export default {
187 187
     SendOffer() {
188 188
       //alert("Under Development");
189 189
       this.bidItem.id = 0;
190
-
190
+      this.bidItem.userId = this.item.userId;
191 191
       this.bidItem.amount = this.item.offer;
192 192
       this.bidItem.comment = this.item.comment;
193 193
       if (this.isProperty) {

+ 1
- 1
src/components/property/enquireNow/contentSection.vue Переглянути файл

@@ -197,7 +197,7 @@ export default {
197 197
     ...mapActions("individual", ["getIndividual"]),
198 198
     async sendMail() {
199 199
       var mailObj = {
200
-        toAddress: "jlouw365@gmail.com",
200
+        //toAddress: "jlouw365@gmail.com",
201 201
         fromAddress: "jlouw365@gmail.com",
202 202
         name: this.indiv.name,
203 203
         email: this.indiv.emailAddress,

+ 5
- 5
src/components/shared/navBar.vue Переглянути файл

@@ -221,13 +221,13 @@
221 221
                           :class="submenu1Class"
222 222
                         >
223 223
                           <li v-if="ROLE === 'Super Admin'">
224
-                            <router-link to="/status/tenderWeekAdmin"
225
-                              >Tender Week Management</router-link
224
+                            <router-link to="/status/timeshareAdmin"
225
+                              >Timeshare Week Admin</router-link
226 226
                             >
227 227
                           </li>
228 228
                           <li v-if="ROLE === 'Super Admin'">
229
-                            <router-link to="/status/timeshareAdmin"
230
-                              >Timeshare Week Admin</router-link
229
+                            <router-link to="/status/tenderWeekAdmin"
230
+                              >Tender Week Management</router-link
231 231
                             >
232 232
                           </li>
233 233
                         </ul>
@@ -248,7 +248,7 @@
248 248
                             <router-link to="/termsConditions">Edit Terms & Conditions</router-link>
249 249
                           </li>
250 250
                           <li>
251
-                            <router-link to="/communication/template">Email Templates</router-link>
251
+                            <router-link to="/emailTemplates">Email Templates</router-link>
252 252
                           </li>
253 253
                           <li>
254 254
                             <router-link to="/emailRecipient">Email Recipients</router-link>

+ 14
- 23
src/components/timeshare/buy/weekListComponent.vue Переглянути файл

@@ -21,18 +21,18 @@
21 21
           <tr v-for="(item, i) in DisplayItems" :key="i">
22 22
             <td>#{{ item.id }}</td>
23 23
             <td>{{ item.unitNumber }}</td>
24
-            <td>{{ item.weekNumber }}</td>
24
+            <td>{{ item.module }}</td>
25 25
             <td
26 26
               v-if="
27 27
                 item.arrivalDate === '0001-01-01T00:00:00' ||
28
-                item.arrivalDate === '1753-01-01T00:00:00'
28
+                  item.arrivalDate === '1753-01-01T00:00:00'
29 29
               "
30 30
             ></td>
31 31
             <td v-else>{{ item.arrivalDate | toDate }}</td>
32 32
             <td
33 33
               v-if="
34 34
                 item.departureDate === '0001-01-01T00:00:00' ||
35
-                item.departureDate === '1753-01-01T00:00:00'
35
+                  item.departureDate === '1753-01-01T00:00:00'
36 36
               "
37 37
             ></td>
38 38
             <td v-else>{{ item.departureDate | toDate }}</td>
@@ -50,12 +50,7 @@
50 50
             <!-- <td>{{item.status ? item.status.description : ''}}</td> -->
51 51
 
52 52
             <td>
53
-              <a
54
-                v-on:click="View(item)"
55
-                class="btn-solid-blue"
56
-                style="color: white"
57
-                >YES</a
58
-              >
53
+              <a v-on:click="View(item)" class="btn-solid-blue" style="color: white">YES</a>
59 54
             </td>
60 55
             <!-- <div class="col-md-12">
61 56
                 <button type="button" class="btn btn-b-n" >View</button>
@@ -120,27 +115,27 @@ export default {
120 115
     resortCode: undefined,
121 116
     userId: undefined,
122 117
     currentPage: {
123
-      default: 1,
124
-    },
118
+      default: 1
119
+    }
125 120
   },
126 121
   data() {
127 122
     return {
128 123
       visibleItemsPerPageCount: 8,
129
-      visibleItemSelector: [5, 8, 10, 20, 50, 100],
124
+      visibleItemSelector: [5, 8, 10, 20, 50, 100]
130 125
     };
131 126
   },
132 127
   components: {
133
-    BasePagination,
128
+    BasePagination
134 129
   },
135 130
   computed: {
136 131
     ...mapState("weekList", ["weeks", "status"]),
137 132
     ...mapGetters({
138 133
       filteredWeeks: "weekList/filteredWeeks",
139
-      getRegions: "weekList/getRegions",
134
+      getRegions: "weekList/getRegions"
140 135
     }),
141 136
     DisplayItems() {
142 137
       const list = [];
143
-      this.filteredWeeks.forEach((week) => {
138
+      this.filteredWeeks.forEach(week => {
144 139
         if (week.publish) {
145 140
           list.push(week);
146 141
         }
@@ -157,7 +152,7 @@ export default {
157 152
       return this.visibleItemsPerPageCount !== 0
158 153
         ? Math.ceil(this.filteredWeeks.length / this.visibleItemsPerPageCount)
159 154
         : 1;
160
-    },
155
+    }
161 156
   },
162 157
   mounted() {
163 158
     if (this.resortCode) {
@@ -167,11 +162,7 @@ export default {
167 162
     //this.getWeeks();
168 163
   },
169 164
   methods: {
170
-    ...mapActions("weekList", [
171
-      "getWeeks",
172
-      "applyResortFilter",
173
-      "getByResortCode",
174
-    ]),
165
+    ...mapActions("weekList", ["getWeeks", "applyResortFilter", "getByResortCode"]),
175 166
     View(item) {
176 167
       this.$router.push(`/resort/${item.resort.resortCode}/${item.unitNumber}`);
177 168
     },
@@ -191,8 +182,8 @@ export default {
191 182
         default:
192 183
           this.currentPage = value;
193 184
       }
194
-    },
195
-  },
185
+    }
186
+  }
196 187
 };
197 188
 </script>
198 189
 

+ 18
- 0
src/router/index.js Переглянути файл

@@ -80,6 +80,9 @@ import PropertySearchResults from "../components/property/propertySearchResults.
80 80
 import EmailRecipient from '../components/communication/emailRecipients.vue'
81 81
 import EmailRecipientNew from '../components/communication/emailRecipientNew.vue'
82 82
 import EmailRecipientEdit from '../components/communication/emailRecipientEdit.vue'
83
+import EmailTemplates from '../components/communication/emailTemplatesNew.vue'
84
+import EmailTemplateEdit from '../components/communication/editEmailTemplate.vue'
85
+import EmailTemplateNew from '../components/communication/newEmailTemplate.vue'
83 86
 
84 87
 import CommercialSearchResults from "../components/property/commercial/commercialSearchResults.vue";
85 88
 import ResidentialSearchResults from "../components/property/residential/residentialSearchResults.vue";
@@ -513,6 +516,21 @@ export default new Router({
513 516
       name: "ForgotPasswordReset",
514 517
       component: ForgotPasswordReset,
515 518
     },
519
+    {
520
+      path: "/emailTemplates",
521
+      name: "emailTemplates",
522
+      component: EmailTemplates,
523
+    },
524
+    {
525
+      path: "/emailTemplates/Edit/:id",
526
+      name: "emailTemplateEdit",
527
+      component: EmailTemplateEdit,
528
+    },
529
+    {
530
+      path: "/emailTemplates/New/",
531
+      name: "emailTemplateNew",
532
+      component: EmailTemplateNew,
533
+    },
516 534
     {
517 535
       path: "/emailRecipient",
518 536
       name: "emailRecipient",

+ 24
- 1
src/store/modules/communication/template.js Переглянути файл

@@ -6,6 +6,7 @@ export default {
6 6
   namespaced: true,
7 7
   state: {
8 8
     list: [],
9
+    singleTemp: {},
9 10
     item: {},
10 11
     message: undefined,
11 12
     recipients: [],
@@ -15,6 +16,9 @@ export default {
15 16
     setList(state, list) {
16 17
       state.list = list;
17 18
     },
19
+    setSingle(state, template){
20
+      state.singleTemp = template
21
+    },
18 22
     setRecipients(state, recips){
19 23
       state.recipients = recips
20 24
     },
@@ -24,9 +28,14 @@ export default {
24 28
     removeRecipient(state, id){
25 29
       var index = state.recipients.findIndex((recip) => recip.id == id)
26 30
       state.recipients.splice(index, 1)
31
+    },
32
+    deleteTemplate(state, id){
33
+      var index = state.list.findIndex((template) => template.id == id)
34
+      state.list.splice(index, 1)
27 35
     }
28 36
   },
29
-  getters: {},
37
+  getters: {
38
+  },
30 39
   actions: {
31 40
     getList({
32 41
       commit,
@@ -36,6 +45,11 @@ export default {
36 45
         .then(result => commit('setList', result.data))
37 46
         .catch(console.error);
38 47
     },
48
+    async getSingleTemplate({commit}, id){
49
+      await axios.get('/api/template/' + id)
50
+      .then(result => commit('setSingle', result.data[0]))
51
+      .catch(ex => console.log(ex))
52
+    },
39 53
     addItem({
40 54
       dispatch,
41 55
     }, item) {
@@ -52,6 +66,15 @@ export default {
52 66
         .then(() => dispatch('getList'))
53 67
         .catch(console.error);
54 68
     },
69
+    async deleteMailTemplate({commit}, id){
70
+      await axios.delete('/api/template/'+ id)
71
+      .then(() => {
72
+        commit("deleteTemplate", id)
73
+      })
74
+      .catch((ex) => {
75
+        console.log(ex);
76
+      })
77
+    },
55 78
     async getMailRecipients({commit}){
56 79
       await axios.get('/api/mail/mailrecipients')
57 80
       .then((result) => {

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