Browse Source

Multiple Updates

master
30117125 4 years ago
parent
commit
a5769a0ad1

+ 43
- 102
src/components/admin/status/editTimeShareAdminPage.vue View File

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

+ 5
- 3
src/components/admin/status/timeshareAdminList.vue View File

12
       <div class="row">
12
       <div class="row">
13
         <br />
13
         <br />
14
       </div>
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
             <thead>
20
             <thead>
19
               <tr>
21
               <tr>
20
                 <th scope="col" v-for="(col, c) in displayColumns" :key="c">
22
                 <th scope="col" v-for="(col, c) in displayColumns" :key="c">

+ 2
- 0
src/components/admin/status/timeshareAdminPage.vue View File

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

+ 210
- 0
src/components/communication/editEmailTemplate.vue View File

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 View File

39
             <select v-model="recipient.recipientUsage" class="form-control uniSelect">
39
             <select v-model="recipient.recipientUsage" class="form-control uniSelect">
40
               <option value="ContactUs">Contact Us</option>
40
               <option value="ContactUs">Contact Us</option>
41
               <option value="EnquireNow">Enquire Now</option>
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
             </select>
46
             </select>
43
           </float-label>
47
           </float-label>
44
         </div>
48
         </div>

+ 4
- 0
src/components/communication/emailRecipientNew.vue View File

39
             <select v-model="recipient.recipientUsage" class="form-control uniSelect">
39
             <select v-model="recipient.recipientUsage" class="form-control uniSelect">
40
               <option value="ContactUs">Contact Us</option>
40
               <option value="ContactUs">Contact Us</option>
41
               <option value="EnquireNow">Enquire Now</option>
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
             </select>
46
             </select>
43
           </float-label>
47
           </float-label>
44
         </div>
48
         </div>

+ 67
- 0
src/components/communication/emailTemplatesNew.vue View File

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 View File

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 View File

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

+ 1
- 1
src/components/property/enquireNow/contentSection.vue View File

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

+ 5
- 5
src/components/shared/navBar.vue View File

221
                           :class="submenu1Class"
221
                           :class="submenu1Class"
222
                         >
222
                         >
223
                           <li v-if="ROLE === 'Super Admin'">
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
                           </li>
227
                           </li>
228
                           <li v-if="ROLE === 'Super Admin'">
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
                           </li>
232
                           </li>
233
                         </ul>
233
                         </ul>
248
                             <router-link to="/termsConditions">Edit Terms & Conditions</router-link>
248
                             <router-link to="/termsConditions">Edit Terms & Conditions</router-link>
249
                           </li>
249
                           </li>
250
                           <li>
250
                           <li>
251
-                            <router-link to="/communication/template">Email Templates</router-link>
251
+                            <router-link to="/emailTemplates">Email Templates</router-link>
252
                           </li>
252
                           </li>
253
                           <li>
253
                           <li>
254
                             <router-link to="/emailRecipient">Email Recipients</router-link>
254
                             <router-link to="/emailRecipient">Email Recipients</router-link>

+ 14
- 23
src/components/timeshare/buy/weekListComponent.vue View File

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

+ 18
- 0
src/router/index.js View File

80
 import EmailRecipient from '../components/communication/emailRecipients.vue'
80
 import EmailRecipient from '../components/communication/emailRecipients.vue'
81
 import EmailRecipientNew from '../components/communication/emailRecipientNew.vue'
81
 import EmailRecipientNew from '../components/communication/emailRecipientNew.vue'
82
 import EmailRecipientEdit from '../components/communication/emailRecipientEdit.vue'
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
 import CommercialSearchResults from "../components/property/commercial/commercialSearchResults.vue";
87
 import CommercialSearchResults from "../components/property/commercial/commercialSearchResults.vue";
85
 import ResidentialSearchResults from "../components/property/residential/residentialSearchResults.vue";
88
 import ResidentialSearchResults from "../components/property/residential/residentialSearchResults.vue";
513
       name: "ForgotPasswordReset",
516
       name: "ForgotPasswordReset",
514
       component: ForgotPasswordReset,
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
       path: "/emailRecipient",
535
       path: "/emailRecipient",
518
       name: "emailRecipient",
536
       name: "emailRecipient",

+ 24
- 1
src/store/modules/communication/template.js View File

6
   namespaced: true,
6
   namespaced: true,
7
   state: {
7
   state: {
8
     list: [],
8
     list: [],
9
+    singleTemp: {},
9
     item: {},
10
     item: {},
10
     message: undefined,
11
     message: undefined,
11
     recipients: [],
12
     recipients: [],
15
     setList(state, list) {
16
     setList(state, list) {
16
       state.list = list;
17
       state.list = list;
17
     },
18
     },
19
+    setSingle(state, template){
20
+      state.singleTemp = template
21
+    },
18
     setRecipients(state, recips){
22
     setRecipients(state, recips){
19
       state.recipients = recips
23
       state.recipients = recips
20
     },
24
     },
24
     removeRecipient(state, id){
28
     removeRecipient(state, id){
25
       var index = state.recipients.findIndex((recip) => recip.id == id)
29
       var index = state.recipients.findIndex((recip) => recip.id == id)
26
       state.recipients.splice(index, 1)
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
   actions: {
39
   actions: {
31
     getList({
40
     getList({
32
       commit,
41
       commit,
36
         .then(result => commit('setList', result.data))
45
         .then(result => commit('setList', result.data))
37
         .catch(console.error);
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
     addItem({
53
     addItem({
40
       dispatch,
54
       dispatch,
41
     }, item) {
55
     }, item) {
52
         .then(() => dispatch('getList'))
66
         .then(() => dispatch('getList'))
53
         .catch(console.error);
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
     async getMailRecipients({commit}){
78
     async getMailRecipients({commit}){
56
       await axios.get('/api/mail/mailrecipients')
79
       await axios.get('/api/mail/mailrecipients')
57
       .then((result) => {
80
       .then((result) => {

Loading…
Cancel
Save