瀏覽代碼

Multiple Updates and fixes

master
30117125 4 年之前
父節點
當前提交
6dc5c03ab4
共有 34 個文件被更改,包括 1172 次插入521 次删除
  1. 8
    4
      src/components/admin/misc/termsConditions.vue
  2. 18
    5
      src/components/admin/status/agentsUserManagementPage.vue
  3. 67
    15
      src/components/admin/status/editTimeShareAdminPage.vue
  4. 15
    3
      src/components/admin/status/userManagementPage.vue
  5. 3
    1
      src/components/communication/editEmailTemplate.vue
  6. 36
    90
      src/components/property/commercial/createProperty/commercialCreateNew.vue
  7. 47
    5
      src/components/property/commercial/singleView/contentSection.vue
  8. 38
    96
      src/components/property/editProperty/editProperty.vue
  9. 36
    88
      src/components/property/residential/createProperty/residentialCreateNew.vue
  10. 46
    9
      src/components/property/residential/singleView/contentSection.vue
  11. 72
    7
      src/components/shared/alert.vue
  12. 7
    1
      src/components/shared/navBar.vue
  13. 39
    3
      src/components/timeshare/buy/weekListComponent.vue
  14. 222
    8
      src/components/timeshare/myWeeksPage.vue
  15. 1
    1
      src/components/timeshare/resort/resortPageNew.vue
  16. 103
    38
      src/components/timeshare/sell/contentSection.vue
  17. 28
    5
      src/components/user/registerAgencySection.vue
  18. 22
    3
      src/components/user/registerIndividual.vue
  19. 6
    1
      src/components/user/registerPage.vue
  20. 105
    11
      src/components/user/updateAgentProfile.vue
  21. 148
    65
      src/components/user/updateProfileInfo.vue
  22. 1
    0
      src/main.js
  23. 2
    2
      src/store/modules/communication/info.js
  24. 14
    10
      src/store/modules/communication/template.js
  25. 2
    2
      src/store/modules/financial/fees.js
  26. 2
    2
      src/store/modules/financial/payment.js
  27. 8
    6
      src/store/modules/misc/termsConditions.js
  28. 8
    7
      src/store/modules/processFlow/bid.js
  29. 25
    21
      src/store/modules/property/property.js
  30. 22
    3
      src/store/modules/timeshare/myWeeks.js
  31. 1
    1
      src/store/modules/timeshare/status.js
  32. 6
    1
      src/store/modules/timeshare/timeshare.js
  33. 13
    7
      src/store/modules/user/register.js
  34. 1
    0
      vue.config.js

+ 8
- 4
src/components/admin/misc/termsConditions.vue 查看文件

79
         termsConditions: this.termsInput,
79
         termsConditions: this.termsInput,
80
         version: this.version
80
         version: this.version
81
       };
81
       };
82
-      this.setTerms(termsObj).then(() => {
83
-        this.updated = true;
84
-        this.$router.go();
85
-      });
82
+      this.setTerms(termsObj)
83
+        .then(() => {
84
+          this.updated = true;
85
+          this.$router.go();
86
+        })
87
+        .catch(ex => {
88
+          console.log(ex);
89
+        });
86
     },
90
     },
87
     async populateTerms() {
91
     async populateTerms() {
88
       await this.retrieveTerms();
92
       await this.retrieveTerms();

+ 18
- 5
src/components/admin/status/agentsUserManagementPage.vue 查看文件

27
             type="button"
27
             type="button"
28
             class="btn-solid-blue"
28
             class="btn-solid-blue"
29
             data-toggle="modal"
29
             data-toggle="modal"
30
-            :data-target="'#myModal' + i"
30
+            :data-target="'#myModalAgency'"
31
           >
31
           >
32
             NEW AGENT
32
             NEW AGENT
33
           </button>
33
           </button>
34
-          <div :id="'myModal' + i" class="modal fade" role="dialog">
34
+          <div :id="'myModalAgency'" class="modal fade" role="dialog">
35
             <div class="modal-dialog modal-lg">
35
             <div class="modal-dialog modal-lg">
36
               <div class="modal-content">
36
               <div class="modal-content">
37
                 <div class="modal-header">
37
                 <div class="modal-header">
45
       </div>
45
       </div>
46
       <div class="container">
46
       <div class="container">
47
         <ListView
47
         <ListView
48
+          :items="agents"
49
+          :showNew="false"
50
+          :editable="true"
51
+          :deleteable="true"
52
+          :showCustomAction="true"
53
+          :showColumnChooser="false"
54
+          :displayColumns="columns"
55
+          :displayHeaders="headers"
56
+          @onEdit="Edit"
57
+          @onDelete="Delete"
58
+        />
59
+        <!-- <ListView
48
           :items="agents"
60
           :items="agents"
49
           :showNew="false"
61
           :showNew="false"
50
           :editable="true"
62
           :editable="true"
57
           @onEdit="Edit"
69
           @onEdit="Edit"
58
           @onDelete="Delete"
70
           @onDelete="Delete"
59
           @onResetPassword="PasswordReset"
71
           @onResetPassword="PasswordReset"
60
-        />
72
+        /> -->
61
       </div>
73
       </div>
62
     </div>
74
     </div>
63
   </main>
75
   </main>
83
   },
95
   },
84
   data() {
96
   data() {
85
     return {
97
     return {
86
-      columns: ["id", "name", "surname", "cellNumber", "telephone", "email", "isDeleted"],
87
-      headers: ["", "", "", "", "", "", "", "ResetPwd", "Modify", "Remove"],
98
+      columns: ["id", "name", "surname", "cellNumber", "telephone", "email"],
99
+      headers: ["", "", "", "", "", "", ""],
88
       item: {}
100
       item: {}
89
     };
101
     };
90
   },
102
   },
103
       this.$router.push({ name: "UpdateAgentProfile", params: { agent: item } });
115
       this.$router.push({ name: "UpdateAgentProfile", params: { agent: item } });
104
     },
116
     },
105
     Delete(item) {
117
     Delete(item) {
118
+      console.log(item.id);
106
       this.deleteAgent(item.id);
119
       this.deleteAgent(item.id);
107
     }
120
     }
108
   },
121
   },

+ 67
- 15
src/components/admin/status/editTimeShareAdminPage.vue 查看文件

513
                         id="status"
513
                         id="status"
514
                         v-model="weekParam.status.id"
514
                         v-model="weekParam.status.id"
515
                       >
515
                       >
516
-                        <option :key="status.id" :value="status.id" v-for="status in statusList">
516
+                        <option :key="status.id" :value="status.id" v-for="status in statusPerRole">
517
                           {{ status.description }}
517
                           {{ status.description }}
518
                         </option>
518
                         </option>
519
                       </select>
519
                       </select>
546
                   </div>
546
                   </div>
547
                 </div>
547
                 </div>
548
               </div>
548
               </div>
549
+              <div class="form-row">
550
+                <div class="col-md-12">
551
+                  <alert :text="errorMessage" :type="errorOccurred" />
552
+                </div>
553
+              </div>
549
               <div class="row">
554
               <div class="row">
550
                 <div class="text-center col-6">
555
                 <div class="text-center col-6">
551
                   <button class="btn-solid-blue" v-on:click="saveEdit()">
556
                   <button class="btn-solid-blue" v-on:click="saveEdit()">
560
               </div>
565
               </div>
561
             </div>
566
             </div>
562
             <div v-else>
567
             <div v-else>
563
-              <div class="row">
564
-                <div class="text-center col-6">
568
+              <div class="row mt-5">
569
+                <div class="col">
570
+                  <p>
571
+                    Payment for this timeshare week has not been confirmed yet.
572
+                  </p>
573
+                </div>
574
+              </div>
575
+              <!-- <div class="row ">
576
+                <div class="col-6">
565
                   <button class="btn-solid-blue" v-on:click="paygateRedirect()">
577
                   <button class="btn-solid-blue" v-on:click="paygateRedirect()">
566
                     MAKE PAYMENT
578
                     MAKE PAYMENT
567
                   </button>
579
                   </button>
568
                 </div>
580
                 </div>
569
-              </div>
581
+              </div> -->
570
             </div>
582
             </div>
571
           </div>
583
           </div>
572
         </div>
584
         </div>
609
       depDateParam: {},
621
       depDateParam: {},
610
       pubDateParam: {},
622
       pubDateParam: {},
611
       boolAwaitingPayment: false,
623
       boolAwaitingPayment: false,
612
-      selectedUser: ""
624
+      selectedUser: "",
625
+      errorOccurred: "",
626
+      errorMessage: ""
613
     };
627
     };
614
   },
628
   },
615
   components: {
629
   components: {
638
     this.selectedWeekType = this.weekParam.weekType;
652
     this.selectedWeekType = this.weekParam.weekType;
639
     this.selectedStatus = this.weekParam.status;
653
     this.selectedStatus = this.weekParam.status;
640
     this.selectedPublish = this.weekParam.publish;
654
     this.selectedPublish = this.weekParam.publish;
641
-    var date = new Date(this.weekParam.arrivalDate).toISOString().substring(0, 10);
642
-    this.dateParam = date;
643
-    var depDate = new Date(this.weekParam.departureDate).toISOString().substring(0, 10);
644
-    this.depDateParam = depDate;
645
-    var datePub = new Date(this.weekParam.pulbishedDate).toISOString().substring(0, 10);
646
-    this.pubDateParam = datePub;
647
-    if (this.weekParam.status.description === "Awaiting Payment") {
655
+    this.fixDates();
656
+    if (
657
+      this.weekParam.status.description === "Awaiting Payment" ||
658
+      this.weekParam.status.description === "Awaiting EFT Payment"
659
+    ) {
648
       if (this.ROLE !== "Super Admin") {
660
       if (this.ROLE !== "Super Admin") {
649
         this.boolAwaitingPayment = true;
661
         this.boolAwaitingPayment = true;
650
       }
662
       }
706
       var userObj = JSON.parse(localStorage.getItem("user"));
718
       var userObj = JSON.parse(localStorage.getItem("user"));
707
       return userObj.role;
719
       return userObj.role;
708
     },
720
     },
721
+    statusPerRole() {
722
+      var list = [];
723
+      this.statusList.forEach(status => {
724
+        if (this.ROLE !== "Super Admin") {
725
+          if (status.code !== "AP") {
726
+            if (status.code !== "APEFT") {
727
+              list.push(status);
728
+            }
729
+          }
730
+        } else {
731
+          list.push(status);
732
+        }
733
+      });
734
+      return list;
735
+    },
709
     filteredResort() {
736
     filteredResort() {
710
       let list = [];
737
       let list = [];
711
       if (this.week && this.week.region && this.selectedRegion) {
738
       if (this.week && this.week.region && this.selectedRegion) {
748
       this.weekId = 0;
775
       this.weekId = 0;
749
       this.getBlankWeek();
776
       this.getBlankWeek();
750
     },
777
     },
778
+    fixDates() {
779
+      var date = new Date(this.weekParam.arrivalDate).setHours(+4);
780
+      var finDate = new Date(date).toISOString().substring(0, 10);
781
+      this.dateParam = finDate;
782
+      var depDate = new Date(this.weekParam.departureDate).setHours(+4);
783
+      var finDepDate = new Date(depDate).toISOString().substring(0, 10);
784
+      this.depDateParam = finDepDate;
785
+      var datePub = new Date(this.weekParam.pulbishedDate).setHours(+4);
786
+      var finDatePub = new Date(datePub).toISOString().substring(0, 10);
787
+      this.pubDateParam = finDatePub;
788
+    },
751
     updateCurrentUser() {
789
     updateCurrentUser() {
752
       this.individuals.forEach(indiv => {
790
       this.individuals.forEach(indiv => {
753
         if (this.weekParam.ownerId === indiv.id) {
791
         if (this.weekParam.ownerId === indiv.id) {
794
       if (this.week.owner.telephone === "") {
832
       if (this.week.owner.telephone === "") {
795
         delete this.week.owner.telephone;
833
         delete this.week.owner.telephone;
796
       }
834
       }
835
+      if (this.week.owner.spouseTelephone === "") {
836
+        this.week.owner.spouseTelephone = null;
837
+      }
838
+      if (this.week.owner.spouseCellnumber === "") {
839
+        this.week.owner.spouseCellnumber = null;
840
+      }
797
       this.weekParam.arrivalDate = new Date(this.dateParam).toISOString().substring(0, 10);
841
       this.weekParam.arrivalDate = new Date(this.dateParam).toISOString().substring(0, 10);
798
       this.weekParam.departureDate = new Date(this.depDateParam).toISOString().substring(0, 10);
842
       this.weekParam.departureDate = new Date(this.depDateParam).toISOString().substring(0, 10);
799
       //console.log(this.pubDateParam);
843
       //console.log(this.pubDateParam);
812
       //delete this.status;
856
       //delete this.status;
813
       delete this.weekParam.owner.howMarried;
857
       delete this.weekParam.owner.howMarried;
814
       delete this.weekParam.cellNumber;
858
       delete this.weekParam.cellNumber;
859
+      console.log(this.week.owner);
815
       this.week.owner.name =
860
       this.week.owner.name =
816
         this.week.owner.name.charAt(0).toUpperCase() + this.week.owner.name.slice(1);
861
         this.week.owner.name.charAt(0).toUpperCase() + this.week.owner.name.slice(1);
817
       this.week.owner.surname =
862
       this.week.owner.surname =
818
         this.week.owner.surname.charAt(0).toUpperCase() + this.week.owner.surname.slice(1);
863
         this.week.owner.surname.charAt(0).toUpperCase() + this.week.owner.surname.slice(1);
819
       this.weekParam.statusId = this.selectedStatus.id;
864
       this.weekParam.statusId = this.selectedStatus.id;
865
+      //console.log(this.weekParam);
820
       //console.log(JSON.stringify(this.weekParam));
866
       //console.log(JSON.stringify(this.weekParam));
821
       //console.log(this.weekParam);
867
       //console.log(this.weekParam);
822
-      this.editSave(this.weekParam).then(() => {
823
-        this.backToListView();
824
-      });
868
+      this.editSave(this.weekParam)
869
+        .then(e => {
870
+          this.backToListView();
871
+        })
872
+        .catch(ex => {
873
+          //console.log(ex);
874
+          this.errorOccurred = "ERRORHTML";
875
+          this.errorMessage = ex;
876
+        });
825
     },
877
     },
826
     resortChange() {
878
     resortChange() {
827
       this.onResortChange({
879
       this.onResortChange({

+ 15
- 3
src/components/admin/status/userManagementPage.vue 查看文件

43
             </div>
43
             </div>
44
           </div>
44
           </div>
45
         </div>
45
         </div>
46
-        <div class="row">
46
+        <div class="container">
47
           <ListView
47
           <ListView
48
+            :items="individuals"
49
+            :showNew="false"
50
+            :editable="true"
51
+            :deleteable="true"
52
+            :showCustomAction="true"
53
+            :showColumnChooser="false"
54
+            :displayColumns="columns"
55
+            :displayHeaders="headers"
56
+            @onEdit="Edit"
57
+            @onDelete="Delete"
58
+          />
59
+          <!-- <ListView
48
             :items="individuals"
60
             :items="individuals"
49
             :showNew="false"
61
             :showNew="false"
50
             :editable="true"
62
             :editable="true"
57
             @onEdit="Edit"
69
             @onEdit="Edit"
58
             @onDelete="Delete"
70
             @onDelete="Delete"
59
             @onResetPassword="PasswordReset"
71
             @onResetPassword="PasswordReset"
60
-          />
72
+          /> -->
61
         </div>
73
         </div>
62
       </div>
74
       </div>
63
       <div v-else>
75
       <div v-else>
85
   },
97
   },
86
   data() {
98
   data() {
87
     return {
99
     return {
88
-      columns: ["id", "name", "surname", "cellNumber", "telephone", "email", "isDeleted"],
100
+      columns: ["id", "name", "surname", "cellNumber", "telephone", "email"],
89
       headers: ["", "", "", "", "", "", ""],
101
       headers: ["", "", "", "", "", "", ""],
90
       item: {}
102
       item: {}
91
     };
103
     };

+ 3
- 1
src/components/communication/editEmailTemplate.vue 查看文件

164
   methods: {
164
   methods: {
165
     ...mapActions("template", ["getSingleTemplate", "editItem"]),
165
     ...mapActions("template", ["getSingleTemplate", "editItem"]),
166
     sendToApi() {
166
     sendToApi() {
167
-      this.editItem(this.singleTemp).then(() => this.$router.go(-1));
167
+      this.editItem(this.singleTemp)
168
+        .then(() => this.$router.go(-1))
169
+        .catch(ex => console.log(ex));
168
     },
170
     },
169
     onItemAdd() {
171
     onItemAdd() {
170
       var placeHolder = this.selectedProperty;
172
       var placeHolder = this.selectedProperty;

+ 36
- 90
src/components/property/commercial/createProperty/commercialCreateNew.vue 查看文件

4
       <div class="container pb-5">
4
       <div class="container pb-5">
5
         <div class="row">
5
         <div class="row">
6
           <div class="col">
6
           <div class="col">
7
-            <label v-if="!salesType" class="uniSelectLabel" for="saleType"
8
-              >Sale Type</label
9
-            >
7
+            <label v-if="!salesType" class="uniSelectLabel" for="saleType">Sale Type</label>
10
             <float-label label="Sale Type">
8
             <float-label label="Sale Type">
11
-              <select
12
-                class="form-control uniSelect mb-3"
13
-                name="saleType"
14
-                v-model="salesType"
15
-              >
9
+              <select class="form-control uniSelect mb-3" name="saleType" v-model="salesType">
16
                 <option value="Sale">To Sell</option>
10
                 <option value="Sale">To Sell</option>
17
                 <option value="Rental">To Rent</option>
11
                 <option value="Rental">To Rent</option>
18
               </select>
12
               </select>
22
         <div class="row mt-2">
16
         <div class="row mt-2">
23
           <div class="col-md-6">
17
           <div class="col-md-6">
24
             <div v-if="!property.propertyName">
18
             <div v-if="!property.propertyName">
25
-              <label for="propertyName" class="uniSelectLabel"
26
-                >PROPERTY NAME</label
27
-              >
19
+              <label for="propertyName" class="uniSelectLabel">PROPERTY NAME</label>
28
             </div>
20
             </div>
29
             <float-label label="PROPERTY NAME">
21
             <float-label label="PROPERTY NAME">
30
               <input
22
               <input
37
           </div>
29
           </div>
38
           <div class="col-md-6">
30
           <div class="col-md-6">
39
             <div v-if="!property.propertyRef">
31
             <div v-if="!property.propertyRef">
40
-              <label for="propertyName" class="uniSelectLabel"
41
-                >PROPERTY REFERENCE</label
42
-              >
32
+              <label for="propertyName" class="uniSelectLabel">PROPERTY REFERENCE</label>
43
             </div>
33
             </div>
44
             <float-label label="PROPERTY REFERENCE">
34
             <float-label label="PROPERTY REFERENCE">
45
               <input
35
               <input
61
               @change="PropertyTypeSelected"
51
               @change="PropertyTypeSelected"
62
             >
52
             >
63
               <option value="0">Please select type *</option>
53
               <option value="0">Please select type *</option>
64
-              <option
65
-                v-for="item in propertyTypes"
66
-                :value="item.id"
67
-                :key="item.id"
68
-              >
54
+              <option v-for="item in propertyTypes" :value="item.id" :key="item.id">
69
                 {{ item.description }}
55
                 {{ item.description }}
70
               </option>
56
               </option>
71
             </select>
57
             </select>
152
             <div class="row my-3">
138
             <div class="row my-3">
153
               <div class="col-md-12">
139
               <div class="col-md-12">
154
                 <div v-if="!property.streetNumber">
140
                 <div v-if="!property.streetNumber">
155
-                  <label for="streetNumber" class="uniSelectLabel"
156
-                    >STREET NUMBER</label
157
-                  >
141
+                  <label for="streetNumber" class="uniSelectLabel">STREET NUMBER</label>
158
                 </div>
142
                 </div>
159
                 <input
143
                 <input
160
                   class="form-control uniInput"
144
                   class="form-control uniInput"
168
             <div class="row my-3">
152
             <div class="row my-3">
169
               <div class="col-md-12">
153
               <div class="col-md-12">
170
                 <div v-if="!property.streetName">
154
                 <div v-if="!property.streetName">
171
-                  <label for="streetName" class="uniSelectLabel"
172
-                    >STREET NAME</label
173
-                  >
155
+                  <label for="streetName" class="uniSelectLabel">STREET NAME</label>
174
                 </div>
156
                 </div>
175
                 <input
157
                 <input
176
                   class="form-control uniInput"
158
                   class="form-control uniInput"
226
             <div class="row my-3">
208
             <div class="row my-3">
227
               <div class="col-md-12">
209
               <div class="col-md-12">
228
                 <div v-if="!property.postalCode">
210
                 <div v-if="!property.postalCode">
229
-                  <label for="postalCode" class="uniSelectLabel"
230
-                    >POSTAL CODE</label
231
-                  >
211
+                  <label for="postalCode" class="uniSelectLabel">POSTAL CODE</label>
232
                 </div>
212
                 </div>
233
                 <input
213
                 <input
234
                   class="form-control uniInput"
214
                   class="form-control uniInput"
255
             </div>
235
             </div>
256
             <div class="row my-3">
236
             <div class="row my-3">
257
               <div class="col-md-12">
237
               <div class="col-md-12">
258
-                <button
259
-                  type="button"
260
-                  @click="clearAddress()"
261
-                  class="btn-solid-blue"
262
-                >
238
+                <button type="button" @click="clearAddress()" class="btn-solid-blue">
263
                   Clear Address
239
                   Clear Address
264
                 </button>
240
                 </button>
265
               </div>
241
               </div>
268
         </div>
244
         </div>
269
         <div class="row">
245
         <div class="row">
270
           <div class="col-md-12">
246
           <div class="col-md-12">
271
-            <label for="Property Description" style="font-family: 'muli'"
272
-              >Description:</label
273
-            >
274
-            <vue-editor
275
-              v-model="property.description"
276
-              :editor-toolbar="customToolbar"
277
-            />
247
+            <label for="Property Description" style="font-family: 'muli'">Description:</label>
248
+            <vue-editor v-model="property.description" :editor-toolbar="customToolbar" />
278
             <br />
249
             <br />
279
             <p>
250
             <p>
280
-              * A listing fee of R{{ getListingFee.amount }} including VAT is
281
-              payable to list your Property on the Uni-Vate website
251
+              * A listing fee of R{{ getListingFee.amount }} including VAT is payable to list your
252
+              Property on the Uni-Vate website
282
             </p>
253
             </p>
283
           </div>
254
           </div>
284
         </div>
255
         </div>
290
             
261
             
291
           </div>
262
           </div>
292
         </div> -->
263
         </div> -->
293
-        <UserField
294
-          :fields="propFields"
295
-          @UpdateUserDefinedFields="UpdateUserDefinedFields"
296
-        />
264
+        <UserField :fields="propFields" @UpdateUserDefinedFields="UpdateUserDefinedFields" />
297
         <div class="row">
265
         <div class="row">
298
           <div class="col-sm-12">
266
           <div class="col-sm-12">
299
             <div class="section-header">
267
             <div class="section-header">
303
         </div>
271
         </div>
304
         <div class="form-group row">
272
         <div class="form-group row">
305
           <div class="col-md-12">
273
           <div class="col-md-12">
306
-            <label v-if="!property.virtualTour" class="uniSelectLabel"
307
-              >Virtual Tour (URL)</label
308
-            >
274
+            <label v-if="!property.virtualTour" class="uniSelectLabel">Virtual Tour (URL)</label>
309
             <div class="input-group-prepend">
275
             <div class="input-group-prepend">
310
               <float-label label="Virtual Tour (URL)" style="width: 100%">
276
               <float-label label="Virtual Tour (URL)" style="width: 100%">
311
                 <input
277
                 <input
321
         </div>
287
         </div>
322
         <div class="row">
288
         <div class="row">
323
           <div class="col-md-12 mt-2">
289
           <div class="col-md-12 mt-2">
324
-            <label v-if="!property.video" class="uniSelectLabel"
325
-              >Video (URL)</label
326
-            >
290
+            <label v-if="!property.video" class="uniSelectLabel">Video (URL)</label>
327
             <div class="input-group-prepend">
291
             <div class="input-group-prepend">
328
               <float-label label="video " style="width: 100%">
292
               <float-label label="video " style="width: 100%">
329
                 <input
293
                 <input
351
           :savedImages="propertyImages"
315
           :savedImages="propertyImages"
352
           @DefaultImage="UpdateDefaultImage"
316
           @DefaultImage="UpdateDefaultImage"
353
         />
317
         />
354
-        <button
355
-          v-if="!wait"
356
-          type="button"
357
-          @click="SubmitData()"
358
-          class="btn-solid-blue"
359
-        >
318
+        <button v-if="!wait" type="button" @click="SubmitData()" class="btn-solid-blue">
360
           Save
319
           Save
361
         </button>
320
         </button>
362
         <div v-if="showPropertyTypeError">
321
         <div v-if="showPropertyTypeError">
387
     ImageLoad,
346
     ImageLoad,
388
     VueEditor,
347
     VueEditor,
389
     carouselSection,
348
     carouselSection,
390
-    mapSection,
349
+    mapSection
391
   },
350
   },
392
   props: {
351
   props: {
393
-    propFields: {},
352
+    propFields: {}
394
   },
353
   },
395
   data() {
354
   data() {
396
     return {
355
     return {
403
       customToolbar: [
362
       customToolbar: [
404
         [{ header: [false, 1, 2, 3, 4, 5, 6] }],
363
         [{ header: [false, 1, 2, 3, 4, 5, 6] }],
405
         ["bold", "italic", "underline", "strike"],
364
         ["bold", "italic", "underline", "strike"],
406
-        [
407
-          { align: "" },
408
-          { align: "center" },
409
-          { align: "right" },
410
-          { align: "justify" },
411
-        ],
365
+        [{ align: "" }, { align: "center" }, { align: "right" }, { align: "justify" }],
412
         [{ list: "ordered" }, { list: "bullet" }, { list: "check" }],
366
         [{ list: "ordered" }, { list: "bullet" }, { list: "check" }],
413
         [{ script: "sub" }, { script: "super" }],
367
         [{ script: "sub" }, { script: "super" }],
414
-        [{ indent: "-1" }, { indent: "+1" }],
368
+        [{ indent: "-1" }, { indent: "+1" }]
415
       ],
369
       ],
416
       error: "",
370
       error: "",
417
       addressSet: false,
371
       addressSet: false,
418
       showPropertyTypeError: false,
372
       showPropertyTypeError: false,
419
       showDateError: false,
373
       showDateError: false,
420
       user: Log.getUser(),
374
       user: Log.getUser(),
421
-      mayEdit: Log.isLoggedIn(),
375
+      mayEdit: Log.isLoggedIn()
422
     };
376
     };
423
   },
377
   },
424
   methods: {
378
   methods: {
433
       "getPropertyEditDisplay",
387
       "getPropertyEditDisplay",
434
       "getPropertySavedOverviewFields",
388
       "getPropertySavedOverviewFields",
435
       "getPropertySavedFields",
389
       "getPropertySavedFields",
436
-      "getSavedPropertyData",
390
+      "getSavedPropertyData"
437
     ]),
391
     ]),
438
     updateLocation(place) {
392
     updateLocation(place) {
439
       this.addressSet = true;
393
       this.addressSet = true;
456
         this.showPropertyTypeError = true;
410
         this.showPropertyTypeError = true;
457
       }
411
       }
458
 
412
 
459
-      if (
460
-        this.salesType === "Rental" &&
461
-        this.property.dateAvailable === "undef"
462
-      ) {
413
+      if (this.salesType === "Rental" && this.property.dateAvailable === "undef") {
463
         this.showDateError = true;
414
         this.showDateError = true;
464
       }
415
       }
465
 
416
 
483
         }
434
         }
484
         this.property.propertyImages.push({
435
         this.property.propertyImages.push({
485
           image: this.images[i],
436
           image: this.images[i],
486
-          isDefault: setAsDefault,
437
+          isDefault: setAsDefault
487
         });
438
         });
488
       }
439
       }
489
       this.property.propertyUserFields = this.propertyFieldValues;
440
       this.property.propertyUserFields = this.propertyFieldValues;
505
           this.property.agencyId = this.agent[0].agencyId;
456
           this.property.agencyId = this.agent[0].agencyId;
506
         });
457
         });
507
       }
458
       }
508
-      console.log(this.property);
509
 
459
 
510
       this.saveProperty(this.property)
460
       this.saveProperty(this.property)
511
-        .then((fulfilled) => {
512
-          this.$router.push(
513
-            `/property/commercial/property/${fulfilled.data.id}`
514
-          );
461
+        .then(fulfilled => {
462
+          this.$router.push(`/property/commercial/property/${fulfilled.data.id}`);
515
         })
463
         })
516
-        .catch((error) => {
517
-          console.log(error.message);
464
+        .catch(error => {
465
+          console.log(error);
518
         });
466
         });
519
     },
467
     },
520
     Close() {
468
     Close() {
535
     },
483
     },
536
     UpdateUserDefinedFields(item) {
484
     UpdateUserDefinedFields(item) {
537
       let update = false;
485
       let update = false;
538
-      this.propertyFieldValues.forEach((element) => {
486
+      this.propertyFieldValues.forEach(element => {
539
         if (element.userDefinedFieldId === item.userDefinedFieldId) {
487
         if (element.userDefinedFieldId === item.userDefinedFieldId) {
540
           element.value = item.value;
488
           element.value = item.value;
541
           update = true;
489
           update = true;
559
       this.property.postalCode = undefined;
507
       this.property.postalCode = undefined;
560
       this.property.addressUrl = undefined;
508
       this.property.addressUrl = undefined;
561
       this.property.propertCoords = undefined;
509
       this.property.propertCoords = undefined;
562
-    },
510
+    }
563
   },
511
   },
564
   mounted() {
512
   mounted() {
565
     this.wait = false;
513
     this.wait = false;
592
       "propertyOverviewFields",
540
       "propertyOverviewFields",
593
       "propertyFields",
541
       "propertyFields",
594
       "property",
542
       "property",
595
-      "propertyImages",
543
+      "propertyImages"
596
     ]),
544
     ]),
597
     ...mapState("authentication", ["user"]),
545
     ...mapState("authentication", ["user"]),
598
     ...mapGetters("fees", ["getListingFee"]),
546
     ...mapGetters("fees", ["getListingFee"]),
599
     sortFields() {
547
     sortFields() {
600
       var display = [];
548
       var display = [];
601
-      display = this.propertyFields[0].fields.sort((a, b) =>
602
-        a.rank > b.rank ? 1 : -1
603
-      );
549
+      display = this.propertyFields[0].fields.sort((a, b) => (a.rank > b.rank ? 1 : -1));
604
       return display;
550
       return display;
605
     },
551
     },
606
     SalesTypeChanged() {
552
     SalesTypeChanged() {
620
       this.getPropertyTypes(this.propertyType);
566
       this.getPropertyTypes(this.propertyType);
621
 
567
 
622
       return this.propertyType;
568
       return this.propertyType;
623
-    },
569
+    }
624
   },
570
   },
625
   watch: {
571
   watch: {
626
     SalesTypeChanged() {
572
     SalesTypeChanged() {
627
       return null;
573
       return null;
628
-    },
629
-  },
574
+    }
575
+  }
630
 };
576
 };
631
 </script>
577
 </script>
632
 
578
 

+ 47
- 5
src/components/property/commercial/singleView/contentSection.vue 查看文件

111
           </div>
111
           </div>
112
 
112
 
113
           <div class="mt-5" v-html="property.description"></div>
113
           <div class="mt-5" v-html="property.description"></div>
114
-          <router-link
114
+          <button
115
             style="float:right; white-space: nowrap;"
115
             style="float:right; white-space: nowrap;"
116
-            class="btn-solid-blue mt-3"
117
-            :to="{ name: 'EnquireNow', params: { id: $route.params.id } }"
118
-            >ENQUIRE NOW</router-link
116
+            :class="checkStatus() ? 'btn-disabled mt-3' : 'btn-solid-blue mt-3'"
117
+            :disabled="checkStatus()"
118
+            @click="goToSingle()"
119
           >
119
           >
120
+            ENQUIRE NOW
121
+          </button>
120
 
122
 
121
           <h4 v-if="property.virtualTour !== null" style="margin-top:150px">Virtual Tour</h4>
123
           <h4 v-if="property.virtualTour !== null" style="margin-top:150px">Virtual Tour</h4>
122
           <iframe
124
           <iframe
151
 <script>
153
 <script>
152
 /* eslint-disable */
154
 /* eslint-disable */
153
 import gallery from "../../../shared/gallerySlideShow";
155
 import gallery from "../../../shared/gallerySlideShow";
156
+import { mapState, mapActions } from "vuex";
154
 export default {
157
 export default {
155
   components: {
158
   components: {
156
     gallery
159
     gallery
166
     };
169
     };
167
   },
170
   },
168
   computed: {
171
   computed: {
172
+    ...mapState("status", ["singleStatus"]),
169
     Images() {
173
     Images() {
170
       const list = [];
174
       const list = [];
171
       if (this.propertyImages) {
175
       if (this.propertyImages) {
176
       return list;
180
       return list;
177
     }
181
     }
178
   },
182
   },
179
-  created() {},
183
+  methods: {
184
+    ...mapActions("status", ["getSingleStatus"]),
185
+    goToSingle() {
186
+      this.$router.push({ name: "EnquireNow", params: { id: this.$route.params.id } });
187
+    },
188
+    checkStatus() {
189
+      this.getSingleStatus(this.property.statusId);
190
+      if (
191
+        this.singleStatus.code === "CIP" ||
192
+        this.singleStatus.code === "S" ||
193
+        this.singleStatus.code === "P"
194
+      ) {
195
+        return true;
196
+      } else {
197
+        return false;
198
+      }
199
+    }
200
+  },
180
   mounted() {
201
   mounted() {
181
     if (this.property.video === "") {
202
     if (this.property.video === "") {
182
       this.property.video = null;
203
       this.property.video = null;
190
 </script>
211
 </script>
191
 
212
 
192
 <style lang="scss" scoped>
213
 <style lang="scss" scoped>
214
+.btn-disabled {
215
+  font-family: "Muli";
216
+  font-size: 15px;
217
+  letter-spacing: 1px;
218
+  display: inline-block;
219
+  padding: 10px 32px;
220
+  border-radius: 2px;
221
+  transition: 0.5s;
222
+  margin: 10px;
223
+  color: #fff;
224
+  background: grey;
225
+  border-color: black;
226
+  color: black;
227
+  cursor: not-allowed;
228
+}
229
+.btn-disabled :hover {
230
+  background: grey;
231
+  border-color: black;
232
+  color: black;
233
+  cursor: not-allowed;
234
+}
193
 .images {
235
 .images {
194
   padding-top: 100px;
236
   padding-top: 100px;
195
 }
237
 }

+ 38
- 96
src/components/property/editProperty/editProperty.vue 查看文件

35
               <div class="row my-3">
35
               <div class="row my-3">
36
                 <div class="col-md-6">
36
                 <div class="col-md-6">
37
                   <div v-if="!property.propertyName">
37
                   <div v-if="!property.propertyName">
38
-                    <label for="propertyName" class="uniSelectLabel"
39
-                      >PROPERTY NAME</label
40
-                    >
38
+                    <label for="propertyName" class="uniSelectLabel">PROPERTY NAME</label>
41
                   </div>
39
                   </div>
42
                   <input
40
                   <input
43
                     class="form-control uniInput"
41
                     class="form-control uniInput"
49
                 </div>
47
                 </div>
50
                 <div class="col-md-6">
48
                 <div class="col-md-6">
51
                   <div v-if="!property.propertyRef">
49
                   <div v-if="!property.propertyRef">
52
-                    <label for="propertyName" class="uniSelectLabel"
53
-                      >PROPERTY REFERENCE</label
54
-                    >
50
+                    <label for="propertyName" class="uniSelectLabel">PROPERTY REFERENCE</label>
55
                   </div>
51
                   </div>
56
                   <input
52
                   <input
57
                     class="form-control uniInput"
53
                     class="form-control uniInput"
72
                     :disabled="!canEdit"
68
                     :disabled="!canEdit"
73
                   >
69
                   >
74
                     <option value="0">Please select type *</option>
70
                     <option value="0">Please select type *</option>
75
-                    <option
76
-                      v-for="item in propertyTypes"
77
-                      :value="item.id"
78
-                      :key="item.id"
79
-                    >
71
+                    <option v-for="item in propertyTypes" :value="item.id" :key="item.id">
80
                       {{ item.description }}
72
                       {{ item.description }}
81
                     </option>
73
                     </option>
82
                   </select>
74
                   </select>
83
                 </div>
75
                 </div>
84
-                <div
85
-                  v-if="property.propertyUsageType === 'Commercial'"
86
-                  class="col-md-2"
87
-                >
76
+                <div v-if="property.propertyUsageType === 'Commercial'" class="col-md-2">
88
                   <div v-if="!property.unit">
77
                   <div v-if="!property.unit">
89
                     <label for="unit" class="uniSelectLabel">UNIT</label>
78
                     <label for="unit" class="uniSelectLabel">UNIT</label>
90
                   </div>
79
                   </div>
166
                   <div
155
                   <div
167
                     class="row my-3"
156
                     class="row my-3"
168
                     v-if="
157
                     v-if="
169
-                      property.statusString === 'Sold' ||
170
-                      property.statusString === 'Rented Out'
158
+                      property.statusString === 'Sold' || property.statusString === 'Rented Out'
171
                     "
159
                     "
172
                   >
160
                   >
173
                     <div class="col-md-12">
161
                     <div class="col-md-12">
187
                   <div class="row my-3">
175
                   <div class="row my-3">
188
                     <div class="col-md-12">
176
                     <div class="col-md-12">
189
                       <div v-if="!property.streetNumber">
177
                       <div v-if="!property.streetNumber">
190
-                        <label for="streetNumber" class="uniSelectLabel"
191
-                          >STREET NUMBER</label
192
-                        >
178
+                        <label for="streetNumber" class="uniSelectLabel">STREET NUMBER</label>
193
                       </div>
179
                       </div>
194
                       <input
180
                       <input
195
                         class="form-control uniInput"
181
                         class="form-control uniInput"
204
                   <div class="row my-3">
190
                   <div class="row my-3">
205
                     <div class="col-md-12">
191
                     <div class="col-md-12">
206
                       <div v-if="!property.streetName">
192
                       <div v-if="!property.streetName">
207
-                        <label for="streetName" class="uniSelectLabel"
208
-                          >STREET NAME</label
209
-                        >
193
+                        <label for="streetName" class="uniSelectLabel">STREET NAME</label>
210
                       </div>
194
                       </div>
211
                       <input
195
                       <input
212
                         class="form-control uniInput"
196
                         class="form-control uniInput"
221
                   <div class="row my-3">
205
                   <div class="row my-3">
222
                     <div class="col-md-12">
206
                     <div class="col-md-12">
223
                       <div v-if="!property.suburb">
207
                       <div v-if="!property.suburb">
224
-                        <label for="suburb" class="uniSelectLabel"
225
-                          >SUBURB</label
226
-                        >
208
+                        <label for="suburb" class="uniSelectLabel">SUBURB</label>
227
                       </div>
209
                       </div>
228
                       <input
210
                       <input
229
                         class="form-control uniInput"
211
                         class="form-control uniInput"
253
                   <div class="row my-3">
235
                   <div class="row my-3">
254
                     <div class="col-md-12">
236
                     <div class="col-md-12">
255
                       <div v-if="!property.province">
237
                       <div v-if="!property.province">
256
-                        <label for="province" class="uniSelectLabel"
257
-                          >PROVINCE</label
258
-                        >
238
+                        <label for="province" class="uniSelectLabel">PROVINCE</label>
259
                       </div>
239
                       </div>
260
                       <input
240
                       <input
261
                         class="form-control uniInput"
241
                         class="form-control uniInput"
270
                   <div class="row my-3">
250
                   <div class="row my-3">
271
                     <div class="col-md-12">
251
                     <div class="col-md-12">
272
                       <div v-if="!property.postalCode">
252
                       <div v-if="!property.postalCode">
273
-                        <label for="postalCode" class="uniSelectLabel"
274
-                          >POSTAL CODE</label
275
-                        >
253
+                        <label for="postalCode" class="uniSelectLabel">POSTAL CODE</label>
276
                       </div>
254
                       </div>
277
                       <input
255
                       <input
278
                         class="form-control uniInput"
256
                         class="form-control uniInput"
287
                   <div class="row my-3">
265
                   <div class="row my-3">
288
                     <div class="col-md-12">
266
                     <div class="col-md-12">
289
                       <div v-if="!property.country">
267
                       <div v-if="!property.country">
290
-                        <label for="country" class="uniSelectLabel"
291
-                          >COUNTRY</label
292
-                        >
268
+                        <label for="country" class="uniSelectLabel">COUNTRY</label>
293
                       </div>
269
                       </div>
294
                       <input
270
                       <input
295
                         class="form-control uniInput"
271
                         class="form-control uniInput"
303
                   </div>
279
                   </div>
304
                   <div class="row my-3">
280
                   <div class="row my-3">
305
                     <div class="col-md-12">
281
                     <div class="col-md-12">
306
-                      <button
307
-                        type="button"
308
-                        @click="clearAddress()"
309
-                        class="btn-solid-blue"
310
-                      >
282
+                      <button type="button" @click="clearAddress()" class="btn-solid-blue">
311
                         Clear Address
283
                         Clear Address
312
                       </button>
284
                       </button>
313
                     </div>
285
                     </div>
316
               </div>
288
               </div>
317
               <div class="row">
289
               <div class="row">
318
                 <div class="col-md-12">
290
                 <div class="col-md-12">
319
-                  <label for="Property Description" style="font-family: 'muli'"
320
-                    >Description:</label
321
-                  >
322
-                  <vue-editor
323
-                    v-model="property.description"
324
-                    :editor-toolbar="customToolbar"
325
-                  />
291
+                  <label for="Property Description" style="font-family: 'muli'">Description:</label>
292
+                  <vue-editor v-model="property.description" :editor-toolbar="customToolbar" />
326
                   <br />
293
                   <br />
327
                 </div>
294
                 </div>
328
               </div>
295
               </div>
330
                 <div class="section-header">
297
                 <div class="section-header">
331
                   <h2>Property Information</h2>
298
                   <h2>Property Information</h2>
332
                 </div>
299
                 </div>
333
-                <div
334
-                  class="row mb-3"
335
-                  v-for="item in propertyFields"
336
-                  :key="item.id"
337
-                >
338
-                  <div
339
-                    class="col-md-6"
340
-                    v-for="field in item.fields"
341
-                    :key="field.id"
342
-                  >
300
+                <div class="row mb-3" v-for="item in propertyFields" :key="item.id">
301
+                  <div class="col-md-6" v-for="field in item.fields" :key="field.id">
343
                     <div v-if="field.type === 'number'">
302
                     <div v-if="field.type === 'number'">
344
                       {{ field.name }}
303
                       {{ field.name }}
345
                       <input
304
                       <input
360
                     </div>
319
                     </div>
361
                     <div v-else-if="field.type === 'yesno'">
320
                     <div v-else-if="field.type === 'yesno'">
362
                       {{ field.name }}
321
                       {{ field.name }}
363
-                      <input
364
-                        type="checkbox"
365
-                        v-model="field.value"
366
-                        :disabled="!canEdit"
367
-                      />
322
+                      <input type="checkbox" v-model="field.value" :disabled="!canEdit" />
368
                     </div>
323
                     </div>
369
                     <div v-else class="display:none"></div>
324
                     <div v-else class="display:none"></div>
370
                   </div>
325
                   </div>
396
               </div>
351
               </div>
397
               <div class="row mt-3">
352
               <div class="row mt-3">
398
                 <div class="col-md-12 mt-2">
353
                 <div class="col-md-12 mt-2">
399
-                  <label v-if="!property.video" class="uniSelectLabel"
400
-                    >Video (URL)</label
401
-                  >
354
+                  <label v-if="!property.video" class="uniSelectLabel">Video (URL)</label>
402
                   <float-label label="Video (URL)">
355
                   <float-label label="Video (URL)">
403
                     <input
356
                     <input
404
                       class="form-control uniInput"
357
                       class="form-control uniInput"
427
                 @DeleteImage="DeleteImage"
380
                 @DeleteImage="DeleteImage"
428
                 :mayEdit="canEdit"
381
                 :mayEdit="canEdit"
429
               />
382
               />
430
-              <button
431
-                v-if="!wait"
432
-                type="button"
433
-                @click="SubmitData()"
434
-                class="btn-solid-blue"
435
-              >
383
+              <button v-if="!wait" type="button" @click="SubmitData()" class="btn-solid-blue">
436
                 Save
384
                 Save
437
               </button>
385
               </button>
438
-              <button
439
-                v-if="!wait"
440
-                type="button"
441
-                @click="Close()"
442
-                class="btn-solid-blue"
443
-              >
386
+              <button v-if="!wait" type="button" @click="Close()" class="btn-solid-blue">
444
                 Close
387
                 Close
445
               </button>
388
               </button>
446
               <div v-if="!addressSet">
389
               <div v-if="!addressSet">
468
   components: {
411
   components: {
469
     mapSection,
412
     mapSection,
470
     ImageLoad,
413
     ImageLoad,
471
-    VueEditor,
414
+    VueEditor
472
   },
415
   },
473
   data() {
416
   data() {
474
     return {
417
     return {
480
       customToolbar: [
423
       customToolbar: [
481
         [{ header: [false, 1, 2, 3, 4, 5, 6] }],
424
         [{ header: [false, 1, 2, 3, 4, 5, 6] }],
482
         ["bold", "italic", "underline", "strike"],
425
         ["bold", "italic", "underline", "strike"],
483
-        [
484
-          { align: "" },
485
-          { align: "center" },
486
-          { align: "right" },
487
-          { align: "justify" },
488
-        ],
426
+        [{ align: "" }, { align: "center" }, { align: "right" }, { align: "justify" }],
489
         [{ list: "ordered" }, { list: "bullet" }, { list: "check" }],
427
         [{ list: "ordered" }, { list: "bullet" }, { list: "check" }],
490
         [{ script: "sub" }, { script: "super" }],
428
         [{ script: "sub" }, { script: "super" }],
491
-        [{ indent: "-1" }, { indent: "+1" }],
492
-      ],
429
+        [{ indent: "-1" }, { indent: "+1" }]
430
+      ]
493
     };
431
     };
494
   },
432
   },
495
   methods: {
433
   methods: {
497
       "getProperty",
435
       "getProperty",
498
       "getPropertyTypes",
436
       "getPropertyTypes",
499
       "getPropertyFields",
437
       "getPropertyFields",
500
-      "updateProperty",
438
+      "updateProperty"
501
     ]),
439
     ]),
502
     StatusChanged(item) {
440
     StatusChanged(item) {
503
       if (
441
       if (
560
         }
498
         }
561
         this.property.newImages.push({
499
         this.property.newImages.push({
562
           image: this.images[i],
500
           image: this.images[i],
563
-          isDefault: setAsDefault,
501
+          isDefault: setAsDefault
564
         });
502
         });
565
       }
503
       }
566
 
504
 
568
 
506
 
569
       //console.log(JSON.stringify(this.property));
507
       //console.log(JSON.stringify(this.property));
570
 
508
 
571
-      this.updateProperty(this.property).then((fulfilled) => {
572
-        this.$router.push("/PropertyAdmin");
573
-      });
509
+      this.updateProperty(this.property)
510
+        .then(fulfilled => {
511
+          this.$router.push("/PropertyAdmin");
512
+        })
513
+        .catch(ex => {
514
+          console.log(ex);
515
+        });
574
     },
516
     },
575
     Close() {
517
     Close() {
576
       this.property = {};
518
       this.property = {};
591
     },
533
     },
592
     DeleteImage(item) {
534
     DeleteImage(item) {
593
       this.propertyImages[item].isDeleted = true;
535
       this.propertyImages[item].isDeleted = true;
594
-    },
536
+    }
595
   },
537
   },
596
   mounted() {
538
   mounted() {
597
-    this.getProperty(this.$route.params.id).then((fulfilled) => {
539
+    this.getProperty(this.$route.params.id).then(fulfilled => {
598
       this.wait = false;
540
       this.wait = false;
599
       if (
541
       if (
600
         this.property.statusString === "Offer Pending" ||
542
         this.property.statusString === "Offer Pending" ||
613
       "propertyTypes",
555
       "propertyTypes",
614
       "propertyImages",
556
       "propertyImages",
615
       "propertyFields",
557
       "propertyFields",
616
-      "statuses",
558
+      "statuses"
617
     ]),
559
     ]),
618
     savedImages() {
560
     savedImages() {
619
       const list = [];
561
       const list = [];
633
         }
575
         }
634
       }
576
       }
635
       return list;
577
       return list;
636
-    },
637
-  },
578
+    }
579
+  }
638
 };
580
 };
639
 </script>
581
 </script>
640
 
582
 

+ 36
- 88
src/components/property/residential/createProperty/residentialCreateNew.vue 查看文件

4
       <div class="container pb-5">
4
       <div class="container pb-5">
5
         <div class="row">
5
         <div class="row">
6
           <div class="col">
6
           <div class="col">
7
-            <label v-if="!salesType" class="uniSelectLabel" for="resSaleType"
8
-              >Sale Type</label
9
-            >
7
+            <label v-if="!salesType" class="uniSelectLabel" for="resSaleType">Sale Type</label>
10
             <float-label label="Sale Type">
8
             <float-label label="Sale Type">
11
-              <select
12
-                class="form-control uniSelect mb-3"
13
-                name="resSaleType"
14
-                v-model="salesType"
15
-              >
9
+              <select class="form-control uniSelect mb-3" name="resSaleType" v-model="salesType">
16
                 <option value="Sale">To Sell</option>
10
                 <option value="Sale">To Sell</option>
17
                 <option value="Rental">To Rent</option>
11
                 <option value="Rental">To Rent</option>
18
               </select>
12
               </select>
22
         <div class="row mt-2">
16
         <div class="row mt-2">
23
           <div class="col-md-6">
17
           <div class="col-md-6">
24
             <div v-if="!property.propertyName">
18
             <div v-if="!property.propertyName">
25
-              <label for="propertyName" class="uniSelectLabel"
26
-                >PROPERTY NAME</label
27
-              >
19
+              <label for="propertyName" class="uniSelectLabel">PROPERTY NAME</label>
28
             </div>
20
             </div>
29
             <float-label label="PROPERTY NAME">
21
             <float-label label="PROPERTY NAME">
30
               <input
22
               <input
37
           </div>
29
           </div>
38
           <div class="col-md-6">
30
           <div class="col-md-6">
39
             <div v-if="!property.propertyRef">
31
             <div v-if="!property.propertyRef">
40
-              <label for="propertyName" class="uniSelectLabel"
41
-                >PROPERTY REFERENCE</label
42
-              >
32
+              <label for="propertyName" class="uniSelectLabel">PROPERTY REFERENCE</label>
43
             </div>
33
             </div>
44
             <float-label label="PROPERTY REFERENCE">
34
             <float-label label="PROPERTY REFERENCE">
45
               <input
35
               <input
61
               @change="PropertyTypeSelected"
51
               @change="PropertyTypeSelected"
62
             >
52
             >
63
               <option value="0">Please select type *</option>
53
               <option value="0">Please select type *</option>
64
-              <option
65
-                v-for="item in propertyTypesRes"
66
-                :value="item.id"
67
-                :key="item.id"
68
-              >
54
+              <option v-for="item in propertyTypesRes" :value="item.id" :key="item.id">
69
                 {{ item.description }}
55
                 {{ item.description }}
70
               </option>
56
               </option>
71
             </select>
57
             </select>
136
             <div class="row my-3">
122
             <div class="row my-3">
137
               <div class="col-md-12">
123
               <div class="col-md-12">
138
                 <div v-if="!property.streetNumber">
124
                 <div v-if="!property.streetNumber">
139
-                  <label for="resStreetNumber" class="uniSelectLabel"
140
-                    >STREET NUMBER</label
141
-                  >
125
+                  <label for="resStreetNumber" class="uniSelectLabel">STREET NUMBER</label>
142
                 </div>
126
                 </div>
143
                 <input
127
                 <input
144
                   class="form-control uniInput"
128
                   class="form-control uniInput"
152
             <div class="row my-3">
136
             <div class="row my-3">
153
               <div class="col-md-12">
137
               <div class="col-md-12">
154
                 <div v-if="!property.streetName">
138
                 <div v-if="!property.streetName">
155
-                  <label for="resStreetName" class="uniSelectLabel"
156
-                    >STREET NAME</label
157
-                  >
139
+                  <label for="resStreetName" class="uniSelectLabel">STREET NAME</label>
158
                 </div>
140
                 </div>
159
                 <input
141
                 <input
160
                   class="form-control uniInput"
142
                   class="form-control uniInput"
196
             <div class="row my-3">
178
             <div class="row my-3">
197
               <div class="col-md-12">
179
               <div class="col-md-12">
198
                 <div v-if="!property.province">
180
                 <div v-if="!property.province">
199
-                  <label for="resProvince" class="uniSelectLabel"
200
-                    >PROVINCE</label
201
-                  >
181
+                  <label for="resProvince" class="uniSelectLabel">PROVINCE</label>
202
                 </div>
182
                 </div>
203
                 <input
183
                 <input
204
                   class="form-control uniInput"
184
                   class="form-control uniInput"
212
             <div class="row my-3">
192
             <div class="row my-3">
213
               <div class="col-md-12">
193
               <div class="col-md-12">
214
                 <div v-if="!property.postalCode">
194
                 <div v-if="!property.postalCode">
215
-                  <label for="resPostalCode" class="uniSelectLabel"
216
-                    >POSTAL CODE</label
217
-                  >
195
+                  <label for="resPostalCode" class="uniSelectLabel">POSTAL CODE</label>
218
                 </div>
196
                 </div>
219
                 <input
197
                 <input
220
                   class="form-control uniInput"
198
                   class="form-control uniInput"
241
             </div>
219
             </div>
242
             <div class="row my-3">
220
             <div class="row my-3">
243
               <div class="col-md-12">
221
               <div class="col-md-12">
244
-                <button
245
-                  type="button"
246
-                  @click="clearAddress()"
247
-                  class="btn-solid-blue"
248
-                >
222
+                <button type="button" @click="clearAddress()" class="btn-solid-blue">
249
                   Clear Address
223
                   Clear Address
250
                 </button>
224
                 </button>
251
               </div>
225
               </div>
254
         </div>
228
         </div>
255
         <div class="row">
229
         <div class="row">
256
           <div class="col-md-12">
230
           <div class="col-md-12">
257
-            <label for="Property Description" style="font-family: 'muli'"
258
-              >Description:</label
259
-            >
260
-            <vue-editor
261
-              v-model="property.description"
262
-              :editor-toolbar="customToolbar"
263
-            />
231
+            <label for="Property Description" style="font-family: 'muli'">Description:</label>
232
+            <vue-editor v-model="property.description" :editor-toolbar="customToolbar" />
264
             <br />
233
             <br />
265
             <p>
234
             <p>
266
-              * A listing fee of R{{ getListingFee.amount }} including VAT is
267
-              payable to list your Property on the Uni-Vate website
235
+              * A listing fee of R{{ getListingFee.amount }} including VAT is payable to list your
236
+              Property on the Uni-Vate website
268
             </p>
237
             </p>
269
           </div>
238
           </div>
270
         </div>
239
         </div>
285
         </div>
254
         </div>
286
         <div class="form-group row">
255
         <div class="form-group row">
287
           <div class="col-md-12 mt-2">
256
           <div class="col-md-12 mt-2">
288
-            <label v-if="!property.virtualTour" class="uniSelectLabel"
289
-              >Virtual Tour (URL)</label
290
-            >
257
+            <label v-if="!property.virtualTour" class="uniSelectLabel">Virtual Tour (URL)</label>
291
             <div class="input-group-prepend">
258
             <div class="input-group-prepend">
292
               <float-label label="Virtual Tour (URL)" style="width: 100%">
259
               <float-label label="Virtual Tour (URL)" style="width: 100%">
293
                 <input
260
                 <input
303
         </div>
270
         </div>
304
         <div class="row">
271
         <div class="row">
305
           <div class="col-md-12 mt-2">
272
           <div class="col-md-12 mt-2">
306
-            <label v-if="!property.video" class="uniSelectLabel"
307
-              >Video (URL)</label
308
-            >
273
+            <label v-if="!property.video" class="uniSelectLabel">Video (URL)</label>
309
             <div class="input-group-prepend">
274
             <div class="input-group-prepend">
310
               <float-label label="Video (URL)" style="width: 100%">
275
               <float-label label="Video (URL)" style="width: 100%">
311
                 <input
276
                 <input
333
           :savedImages="propertyImages"
298
           :savedImages="propertyImages"
334
           @DefaultImage="UpdateDefaultImage"
299
           @DefaultImage="UpdateDefaultImage"
335
         />
300
         />
336
-        <button
337
-          v-if="!wait"
338
-          type="button"
339
-          @click="SubmitData()"
340
-          class="btn-solid-blue"
341
-        >
301
+        <button v-if="!wait" type="button" @click="SubmitData()" class="btn-solid-blue">
342
           Save
302
           Save
343
         </button>
303
         </button>
344
         <div v-if="showPropertyTypeError">
304
         <div v-if="showPropertyTypeError">
369
     ImageLoad,
329
     ImageLoad,
370
     VueEditor,
330
     VueEditor,
371
     carouselSection,
331
     carouselSection,
372
-    mapSection,
332
+    mapSection
373
   },
333
   },
374
   props: {
334
   props: {
375
-    propFields: {},
335
+    propFields: {}
376
   },
336
   },
377
   data() {
337
   data() {
378
     return {
338
     return {
385
       customToolbar: [
345
       customToolbar: [
386
         [{ header: [false, 1, 2, 3, 4, 5, 6] }],
346
         [{ header: [false, 1, 2, 3, 4, 5, 6] }],
387
         ["bold", "italic", "underline", "strike"],
347
         ["bold", "italic", "underline", "strike"],
388
-        [
389
-          { align: "" },
390
-          { align: "center" },
391
-          { align: "right" },
392
-          { align: "justify" },
393
-        ],
348
+        [{ align: "" }, { align: "center" }, { align: "right" }, { align: "justify" }],
394
         [{ list: "ordered" }, { list: "bullet" }, { list: "check" }],
349
         [{ list: "ordered" }, { list: "bullet" }, { list: "check" }],
395
         [{ script: "sub" }, { script: "super" }],
350
         [{ script: "sub" }, { script: "super" }],
396
-        [{ indent: "-1" }, { indent: "+1" }],
351
+        [{ indent: "-1" }, { indent: "+1" }]
397
       ],
352
       ],
398
       error: "",
353
       error: "",
399
       addressSet: false,
354
       addressSet: false,
401
       showDateError: false,
356
       showDateError: false,
402
       user: Log.getUser(),
357
       user: Log.getUser(),
403
       mayEdit: Log.isLoggedIn(),
358
       mayEdit: Log.isLoggedIn(),
404
-      myprice: "0",
359
+      myprice: "0"
405
     };
360
     };
406
   },
361
   },
407
   methods: {
362
   methods: {
416
       "getPropertyEditDisplay",
371
       "getPropertyEditDisplay",
417
       "getPropertySavedOverviewFields",
372
       "getPropertySavedOverviewFields",
418
       "getPropertySavedFields",
373
       "getPropertySavedFields",
419
-      "getSavedPropertyData",
374
+      "getSavedPropertyData"
420
     ]),
375
     ]),
421
     ...mapActions("register", ["getAgentById"]),
376
     ...mapActions("register", ["getAgentById"]),
422
     updateLocation(place) {
377
     updateLocation(place) {
439
         this.showPropertyTypeError = true;
394
         this.showPropertyTypeError = true;
440
       }
395
       }
441
 
396
 
442
-      if (
443
-        this.salesType === "Rental" &&
444
-        this.property.dateAvailable === "undef"
445
-      ) {
397
+      if (this.salesType === "Rental" && this.property.dateAvailable === "undef") {
446
         this.showDateError = true;
398
         this.showDateError = true;
447
       }
399
       }
448
 
400
 
466
         }
418
         }
467
         this.property.propertyImages.push({
419
         this.property.propertyImages.push({
468
           image: this.images[i],
420
           image: this.images[i],
469
-          isDefault: setAsDefault,
421
+          isDefault: setAsDefault
470
         });
422
         });
471
       }
423
       }
472
       this.property.propertyUserFields = this.propertyFieldValues;
424
       this.property.propertyUserFields = this.propertyFieldValues;
489
       }
441
       }
490
       //console.log(this.property);
442
       //console.log(this.property);
491
       this.saveProperty(this.property)
443
       this.saveProperty(this.property)
492
-        .then((fulfilled) => {
493
-          this.$router.push(
494
-            `/property/residential/property/${fulfilled.data.id}`
495
-          );
444
+        .then(fulfilled => {
445
+          this.$router.push(`/property/residential/property/${fulfilled.data.id}`);
496
         })
446
         })
497
-        .catch((error) => {
498
-          console.log(error.message);
447
+        .catch(error => {
448
+          console.log(error);
499
         });
449
         });
500
     },
450
     },
501
     async retrieveAgency() {
451
     async retrieveAgency() {
519
     },
469
     },
520
     UpdateUserResidentialFields(item) {
470
     UpdateUserResidentialFields(item) {
521
       let update = false;
471
       let update = false;
522
-      this.propertyFieldValues.forEach((element) => {
472
+      this.propertyFieldValues.forEach(element => {
523
         if (element.userDefinedFieldId === item.userDefinedFieldId) {
473
         if (element.userDefinedFieldId === item.userDefinedFieldId) {
524
           element.value = item.value;
474
           element.value = item.value;
525
           update = true;
475
           update = true;
553
         fields.push(arr.slice(i, (i += len)));
503
         fields.push(arr.slice(i, (i += len)));
554
       }
504
       }
555
       return fields;
505
       return fields;
556
-    },
506
+    }
557
   },
507
   },
558
   mounted() {
508
   mounted() {
559
     this.wait = false;
509
     this.wait = false;
588
       "propertyOverviewFields",
538
       "propertyOverviewFields",
589
       "propertyFields",
539
       "propertyFields",
590
       "property",
540
       "property",
591
-      "propertyImages",
541
+      "propertyImages"
592
     ]),
542
     ]),
593
     ...mapState("authentication", ["user"]),
543
     ...mapState("authentication", ["user"]),
594
     ...mapGetters("fees", ["getListingFee"]),
544
     ...mapGetters("fees", ["getListingFee"]),
595
     ...mapState("register", ["agent"]),
545
     ...mapState("register", ["agent"]),
596
     sortFields() {
546
     sortFields() {
597
-      return this.propertyFields[0].fields.sort((a, b) =>
598
-        a.rank > b.rank ? 1 : -1
599
-      );
547
+      return this.propertyFields[0].fields.sort((a, b) => (a.rank > b.rank ? 1 : -1));
600
     },
548
     },
601
     SalesTypeChanged() {
549
     SalesTypeChanged() {
602
       // eslint-disable-next-line vue/no-side-effects-in-computed-properties
550
       // eslint-disable-next-line vue/no-side-effects-in-computed-properties
616
     },
564
     },
617
     userFieldsArr() {
565
     userFieldsArr() {
618
       return this.userFieldsArrFunc(this.propertyFields, 4);
566
       return this.userFieldsArrFunc(this.propertyFields, 4);
619
-    },
567
+    }
620
   },
568
   },
621
   watch: {
569
   watch: {
622
     SalesTypeChanged() {
570
     SalesTypeChanged() {
623
       return null;
571
       return null;
624
-    },
625
-  },
572
+    }
573
+  }
626
 };
574
 };
627
 </script>
575
 </script>
628
 
576
 

+ 46
- 9
src/components/property/residential/singleView/contentSection.vue 查看文件

31
           </div>
31
           </div>
32
           <div class="panel-left p-5" style="margin-top:130px">
32
           <div class="panel-left p-5" style="margin-top:130px">
33
             <h2>Property Detial</h2>
33
             <h2>Property Detial</h2>
34
+
34
             <!-- TODO: Make it dynamic -->
35
             <!-- TODO: Make it dynamic -->
35
 
36
 
36
             <h4 style="color:white" v-if="property.statusString === 'For Sale'">
37
             <h4 style="color:white" v-if="property.statusString === 'For Sale'">
85
             {{ property.streetNumber }} {{ property.streetName }}
86
             {{ property.streetNumber }} {{ property.streetName }}
86
           </h2>
87
           </h2>
87
           <h2 v-else>{{ property.propertyName }}</h2>
88
           <h2 v-else>{{ property.propertyName }}</h2>
88
-
89
           <div class="container">
89
           <div class="container">
90
             <div class="row">
90
             <div class="row">
91
               <div class="col">
91
               <div class="col">
118
                   </div>
118
                   </div>
119
                 </div>
119
                 </div>
120
               </div>
120
               </div>
121
+
121
               <div class="col-md-4">
122
               <div class="col-md-4">
122
-                <router-link
123
+                <button
123
                   style="float:right; white-space: nowrap;"
124
                   style="float:right; white-space: nowrap;"
124
-                  class="btn-solid-blue mt-3"
125
-                  :to="{ name: 'EnquireNow', params: { id: $route.params.id } }"
126
-                  >ENQUIRE NOW</router-link
125
+                  :class="checkStatus() ? 'btn-disabled mt-3' : 'btn-solid-blue mt-3'"
126
+                  :disabled="checkStatus()"
127
+                  @click="goToSingle()"
127
                 >
128
                 >
129
+                  ENQUIRE NOW
130
+                </button>
128
               </div>
131
               </div>
129
             </div>
132
             </div>
130
           </div>
133
           </div>
187
     property: {},
190
     property: {},
188
     propertyImages: {}
191
     propertyImages: {}
189
   },
192
   },
190
-  created() {
191
-    //this.getListsForPropertyEdit(this.property.id);
192
-  },
193
   async mounted() {
193
   async mounted() {
194
-    console.log(this.property);
195
     await this.checkForVideos;
194
     await this.checkForVideos;
196
     this.currentUrl = window.location.origin + this.$route.fullPath;
195
     this.currentUrl = window.location.origin + this.$route.fullPath;
197
   },
196
   },
204
   },
203
   },
205
   methods: {
204
   methods: {
206
     //...mapActions("searchTab", ["getListsForPropertyEdit"])
205
     //...mapActions("searchTab", ["getListsForPropertyEdit"])
206
+    ...mapActions("status", ["getSingleStatus"]),
207
     checkForVideos() {
207
     checkForVideos() {
208
       if (this.property.video === "") {
208
       if (this.property.video === "") {
209
         this.property.video = null;
209
         this.property.video = null;
211
       if (this.property.virtualTour === "") {
211
       if (this.property.virtualTour === "") {
212
         this.property.virtualTour = null;
212
         this.property.virtualTour = null;
213
       }
213
       }
214
+    },
215
+    goToSingle() {
216
+      this.$router.push({ name: "EnquireNow", params: { id: this.$route.params.id } });
217
+    },
218
+    checkStatus() {
219
+      this.getSingleStatus(this.property.statusId);
220
+      if (
221
+        this.singleStatus.code === "CIP" ||
222
+        this.singleStatus.code === "S" ||
223
+        this.singleStatus.code === "P"
224
+      ) {
225
+        return true;
226
+      } else {
227
+        return false;
228
+      }
214
     }
229
     }
215
   },
230
   },
216
   computed: {
231
   computed: {
217
     //...mapState("searchTab", ["provinces", "cities", "suburbs"]),
232
     //...mapState("searchTab", ["provinces", "cities", "suburbs"]),
233
+    ...mapState("status", ["singleStatus"]),
218
     propertyMap() {
234
     propertyMap() {
219
       if (this.property.propertCoords) {
235
       if (this.property.propertCoords) {
220
         var lat = this.property.propertCoords.split(",")[0];
236
         var lat = this.property.propertCoords.split(",")[0];
250
 </script>
266
 </script>
251
 
267
 
252
 <style lang="scss" scoped>
268
 <style lang="scss" scoped>
269
+.btn-disabled {
270
+  font-family: "Muli";
271
+  font-size: 15px;
272
+  letter-spacing: 1px;
273
+  display: inline-block;
274
+  padding: 10px 32px;
275
+  border-radius: 2px;
276
+  transition: 0.5s;
277
+  margin: 10px;
278
+  color: #fff;
279
+  background: grey;
280
+  border-color: black;
281
+  color: black;
282
+  cursor: not-allowed;
283
+}
284
+.btn-disabled :hover {
285
+  background: grey;
286
+  border-color: black;
287
+  color: black;
288
+  cursor: not-allowed;
289
+}
253
 /* Extra small devices (phones, 600px and down) */
290
 /* Extra small devices (phones, 600px and down) */
254
 @media only screen and (max-width: 575px) {
291
 @media only screen and (max-width: 575px) {
255
   .resPortfolioSection {
292
   .resPortfolioSection {

+ 72
- 7
src/components/shared/alert.vue 查看文件

17
       <eva-icon name="slash-outline" style="margin: 0px 20px"></eva-icon>
17
       <eva-icon name="slash-outline" style="margin: 0px 20px"></eva-icon>
18
       <strong class="color-black">{{ text }}</strong>
18
       <strong class="color-black">{{ text }}</strong>
19
     </div>
19
     </div>
20
+    <div class="alert myError" v-if="type === 'ERRORHTML'">
21
+      <div class="container">
22
+        <div class="row">
23
+          <div class="col-md-1">
24
+            <eva-icon name="slash-outline" style="margin: 0px 20px"></eva-icon>
25
+          </div>
26
+          <div class="col-md-11">
27
+            <p v-if="text.status === 500">
28
+              <strong>Please ensure that all the details have been entered correctly.</strong>
29
+              <br>
30
+              <br>
31
+              <strong>
32
+                Status: 
33
+              </strong>
34
+              {{text.status}} ({{text.statusText}});
35
+              <br>
36
+              <strong>
37
+                Error:
38
+              </strong>
39
+              {{text.data.Message}}
40
+              <br>
41
+              <strong>
42
+                More Detail:
43
+              </strong>
44
+              <br>
45
+              {{text.data.StackTraceString}}
46
+            </p>
47
+            <p v-else>
48
+              <strong>
49
+                Status:
50
+              </strong>
51
+              {{ text.status }} ({{ text.statusText }});
52
+              <br />
53
+              <strong>
54
+                Error:
55
+              </strong>
56
+              {{ text.data.title }};
57
+              <br />
58
+              <strong>
59
+                More Detail:
60
+              </strong>
61
+              <br>
62
+              <p v-html="getMoreInfo()"></p>
63
+            </p>
64
+          </div>
65
+        </div>
66
+      </div>
67
+    </div>
20
   </div>
68
   </div>
21
 </template>
69
 </template>
22
 
70
 
23
 <script>
71
 <script>
72
+/* eslint-disable */
24
 export default {
73
 export default {
25
-  name: 'Alert',
74
+  name: "Alert",
26
   data() {
75
   data() {
27
     return {
76
     return {
28
       alertTypes: {
77
       alertTypes: {
29
-        SUCCESS: 'Success',
30
-        INFO: 'Info',
31
-        WARNING: 'Warning',
32
-        ERROR: 'Error',
33
-      },
78
+        SUCCESS: "Success",
79
+        INFO: "Info",
80
+        WARNING: "Warning",
81
+        ERROR: "Error",
82
+        ERRORHTML: "Errorhtml"
83
+      }
34
     };
84
     };
35
   },
85
   },
36
   props: {
86
   props: {
37
     text: null,
87
     text: null,
38
-    type: null,
88
+    type: null
39
   },
89
   },
90
+  methods:{
91
+    getMoreInfo(){
92
+      var errorList = "<ul>";
93
+      for (var prop in this.text.data.errors) {
94
+
95
+        if (Object.prototype.hasOwnProperty.call(this.text.data.errors, prop)) {
96
+
97
+          errorList += "<li><strong>" + prop + ":</strong> " + this.text.data.errors[prop] + "</li>";
98
+        }
99
+      }
100
+      errorList += "</ul>";
101
+
102
+      return errorList;
103
+    }
104
+  }
40
 };
105
 };
41
 </script>
106
 </script>
42
 
107
 

+ 7
- 1
src/components/shared/navBar.vue 查看文件

111
                       <li>
111
                       <li>
112
                         <router-link to="/timeshare/faq">FAQ</router-link>
112
                         <router-link to="/timeshare/faq">FAQ</router-link>
113
                       </li>
113
                       </li>
114
-                      <li v-if="isLoggedIn">
114
+                      <li v-if="weekCount > 0">
115
                         <hr />
115
                         <hr />
116
                         <router-link to="/timeshare/myWeeks">My Timeshare Weeks</router-link>
116
                         <router-link to="/timeshare/myWeeks">My Timeshare Weeks</router-link>
117
                       </li>
117
                       </li>
411
   methods: {
411
   methods: {
412
     ...mapActions("authentication", ["logout"]),
412
     ...mapActions("authentication", ["logout"]),
413
     ...mapActions("fees", ["retrieveListingFee"]),
413
     ...mapActions("fees", ["retrieveListingFee"]),
414
+    ...mapActions("myWeeks", ["getWeekCount"]),
414
     showDropDown() {
415
     showDropDown() {
415
       if (!this.hover) {
416
       if (!this.hover) {
416
         this.timeShareClass = "ts-display";
417
         this.timeShareClass = "ts-display";
422
   },
423
   },
423
   mounted() {
424
   mounted() {
424
     this.retrieveListingFee();
425
     this.retrieveListingFee();
426
+    console.log(localStorage.getItem("user"));
427
+    if (localStorage.getItem("user") !== null) {
428
+      this.getWeekCount(JSON.parse(localStorage.getItem("user")).id);
429
+    }
425
   },
430
   },
426
   computed: {
431
   computed: {
427
     ...mapState("authentication", ["user", "flag", "status", "person", "token"]),
432
     ...mapState("authentication", ["user", "flag", "status", "person", "token"]),
433
+    ...mapState("myWeeks", ["weekCount"]),
428
     isLoggedIn() {
434
     isLoggedIn() {
429
       return Log.isLoggedIn();
435
       return Log.isLoggedIn();
430
     },
436
     },

+ 39
- 3
src/components/timeshare/buy/weekListComponent.vue 查看文件

1
 <template>
1
 <template>
2
   <div>
2
   <div>
3
     <div v-if="filteredWeeks.length > 0">
3
     <div v-if="filteredWeeks.length > 0">
4
-      <table class="table table-striped table-responsive">
4
+      <table class="table table-striped table-responsive text-nowrap">
5
         <thead>
5
         <thead>
6
           <tr>
6
           <tr>
7
             <th scope="col">Ref</th>
7
             <th scope="col">Ref</th>
50
             <!-- <td>{{item.status ? item.status.description : ''}}</td> -->
50
             <!-- <td>{{item.status ? item.status.description : ''}}</td> -->
51
 
51
 
52
             <td>
52
             <td>
53
-              <a v-on:click="View(item)" class="btn-solid-blue" style="color: white">YES</a>
53
+              <button
54
+                :disabled="checkStatus(item)"
55
+                v-on:click="View(item)"
56
+                :class="checkStatus(item) ? 'btn-disabled' : 'btn-solid-blue'"
57
+                style="color: white"
58
+              >
59
+                Yes
60
+              </button>
54
             </td>
61
             </td>
55
             <!-- <div class="col-md-12">
62
             <!-- <div class="col-md-12">
56
                 <button type="button" class="btn btn-b-n" >View</button>
63
                 <button type="button" class="btn btn-b-n" >View</button>
188
         default:
195
         default:
189
           this.currentPage = value;
196
           this.currentPage = value;
190
       }
197
       }
198
+    },
199
+    checkStatus(item) {
200
+      if (item.status.code === "CIP" || item.status.code === "S" || item.status.code === "P") {
201
+        return true;
202
+      } else {
203
+        return false;
204
+      }
191
     }
205
     }
192
   }
206
   }
193
 };
207
 };
194
 </script>
208
 </script>
195
 
209
 
196
-<style lang="scss" scoped></style>
210
+<style lang="scss" scoped>
211
+.btn-disabled {
212
+  font-family: "Muli";
213
+  font-size: 15px;
214
+  letter-spacing: 1px;
215
+  display: inline-block;
216
+  padding: 10px 32px;
217
+  border-radius: 2px;
218
+  transition: 0.5s;
219
+  margin: 10px;
220
+  color: #fff;
221
+  background: grey;
222
+  border-color: black;
223
+  color: black;
224
+  cursor: not-allowed;
225
+}
226
+.btn-disabled :hover {
227
+  background: grey;
228
+  border-color: black;
229
+  color: black;
230
+  cursor: not-allowed;
231
+}
232
+</style>

+ 222
- 8
src/components/timeshare/myWeeksPage.vue 查看文件

10
         </div>
10
         </div>
11
       </div>
11
       </div>
12
     </div>
12
     </div>
13
+    <div class="container-fluid">
14
+      <div class="row justify-content-center">
15
+        <div class="col-auto">
16
+          <table class="table table-striped table-responsive" style="max-width:1920px">
17
+            <thead>
18
+              <tr>
19
+                <th scope="col" v-for="(col, c) in displayColumns" :key="c">
20
+                  <div @click="sortBy(columns[c])" style="cursor: pointer">
21
+                    <div class="d-flex bd-highlight">
22
+                      <div class="w-100 bd-highlight">{{ col }}</div>
23
+                      <div class="flex-shrink-1 bd-highlight">
24
+                        <img
25
+                          src="../../../public/img/sort-up.png"
26
+                          height="8px;"
27
+                          v-if="sortKey === columns[c] && reverse"
28
+                        />
29
+                        <img
30
+                          src="../../../public/img/sort-down.png"
31
+                          height="8px;"
32
+                          v-if="sortKey === columns[c] && !reverse"
33
+                        />
34
+                      </div>
35
+                    </div>
36
+                  </div>
37
+                </th>
38
+                <!-- <th scope="col">Property</th>
39
+                <th scope="col">Unit</th>
40
+                <th scope="col">Size</th>
41
+                <th scope="col">Price Ex VAT</th>
42
+                <th scope="col">Region</th>
43
+                <th scope="col">Town</th>
44
+                <th scope="col">Suburb</th>
45
+                <th scope="col">Status</th>
46
+                <th scope="col">Type</th>-->
47
+                <th scope="col">Edit</th>
48
+                <th scope="col">Delete</th>
49
+              </tr>
50
+            </thead>
13
 
51
 
14
-    <div class="row">
52
+            <tbody>
53
+              <tr v-for="(item, i) in DisplayItems" :key="i">
54
+                <td>#{{ item.id }}</td>
55
+                <td>{{ item.owner }}</td>
56
+                <td>{{ item.agent }}</td>
57
+                <td>{{ item.resort.resortName }}</td>
58
+                <td>{{ item.module }}</td>
59
+                <td>{{ item.unitNumber }}</td>
60
+                <td>{{ item.bedrooms }}</td>
61
+                <td>{{ item.season }}</td>
62
+                <td>{{ item.region.regionName }}</td>
63
+                <td>{{ item.sellPrice | toCurrency }}</td>
64
+                <td>{{ item.pulbishedDate | toDate }}</td>
65
+                <td>{{ item.status.description }}</td>
66
+                <!-- <td v-if="!item.publish">
67
+                  <a v-on:click="Publish(item)">
68
+                    <img src="../../../public/img/icons/Upload.png" height="25" width="25" />
69
+                  </a>
70
+                </td>
71
+                <td v-else>
72
+                  <a v-on:click="Unpublish(item)">
73
+                    <img src="../../../public/img/icons/Download-grey.png" height="25" width="25" />
74
+                  </a>
75
+                </td> -->
76
+                <td>
77
+                  <a v-on:click="Edit(item)">
78
+                    <img src="../../../public/img/icons/Edit.png" height="25" width="25" />
79
+                  </a>
80
+                </td>
81
+                <td>
82
+                  <a v-on:click="Delete(item)">
83
+                    <img src="../../../public/img/icons/delete.png" height="25" width="25" />
84
+                  </a>
85
+                </td>
86
+              </tr>
87
+            </tbody>
88
+          </table>
89
+          <div class="d-flex justify-content-between" v-if="showPager">
90
+            <div class="p-1">
91
+              {{ currentPage + " / " + PageCount + (" - (" + FilteredListings.length + " items)") }}
92
+            </div>
93
+            <div class="p-1">
94
+              <BasePagination
95
+                :currentPage="currentPage"
96
+                :pageCount="PageCount"
97
+                @nextPage="pageChangeHandle('next')"
98
+                @previousPage="pageChangeHandle('previous')"
99
+                @loadPage="pageChangeHandle"
100
+              />
101
+            </div>
102
+            <div class="p-2">
103
+              <div class="d-flex flex-row">
104
+                <div>
105
+                  <select
106
+                    class="form-control uniSelect"
107
+                    v-model="visibleItemsPerPageCount"
108
+                    @change="onChangeItemsPerPage()"
109
+                  >
110
+                    <option v-for="(item, i) in itemsPerPageList" :key="i">
111
+                      {{ item }}
112
+                    </option>
113
+                  </select>
114
+                </div>
115
+              </div>
116
+            </div>
117
+          </div>
118
+          <div class="p-2">
119
+            <div class="d-flex flex-row">
120
+              <div>
121
+                <button v-if="sortKey !== 'id'" class="btn-solid-blue" @click="ClearSort">
122
+                  Clear Sort
123
+                </button>
124
+              </div>
125
+            </div>
126
+          </div>
127
+        </div>
128
+      </div>
129
+      <div v-if="wait" id="preloader"></div>
130
+    </div>
131
+
132
+    <!-- <div class="row">
15
       <div class="offset-1 col-md-3">
133
       <div class="offset-1 col-md-3">
16
         {{ items[selectedItems] }}
134
         {{ items[selectedItems] }}
17
         <button
135
         <button
37
           @onClearSelected="onClearSelected"
155
           @onClearSelected="onClearSelected"
38
         />
156
         />
39
       </div>
157
       </div>
40
-    </div>
158
+    </div> -->
41
   </main>
159
   </main>
42
 </template>
160
 </template>
43
 <script>
161
 <script>
162
+/* eslint-disable */
44
 import { mapState, mapActions } from "vuex";
163
 import { mapState, mapActions } from "vuex";
45
 import Log from "../../assets/Log";
164
 import Log from "../../assets/Log";
46
 import ListView from "../shared/listView.vue";
165
 import ListView from "../shared/listView.vue";
166
+import BasePagination from "../shared/basePagination";
167
+import ItemsPerPageList from "../../assets/staticData/itemsPerPageFive";
168
+import _ from "lodash";
47
 
169
 
48
 export default {
170
 export default {
49
   components: {
171
   components: {
50
-    ListView
172
+    ListView,
173
+    BasePagination
51
   },
174
   },
52
   data() {
175
   data() {
53
     return {
176
     return {
54
-      user: Log.getUser(),
55
-      selectedItems: []
177
+      filter: undefined,
178
+      wait: true,
179
+      showPager: true,
180
+      visibleItemsPerPageCount: 10,
181
+      itemsPerPageList: ItemsPerPageList,
182
+      reverse: true,
183
+      currentPage: 1,
184
+      sortKey: "id",
185
+      displayColumns: [
186
+        "Ref",
187
+        "Owner",
188
+        "Agent",
189
+        "Resort",
190
+        "Week Module",
191
+        "Unit",
192
+        "Beds",
193
+        "Season",
194
+        "Region",
195
+        "Amount",
196
+        "Submitted",
197
+        "Status"
198
+      ],
199
+      columns: [
200
+        "id",
201
+        "owner",
202
+        "agent",
203
+        "resort",
204
+        "module",
205
+        "unitNumber",
206
+        "bedrooms",
207
+        "season",
208
+        "region",
209
+        "sellPrice",
210
+        "weekStatus"
211
+      ]
56
     };
212
     };
57
   },
213
   },
58
   mounted() {
214
   mounted() {
59
-    console.log(this.user.id);
60
-    this.getItems(this.user.id);
215
+    this.getItems(Log.getUser().id);
61
   },
216
   },
62
   computed: {
217
   computed: {
63
-    ...mapState("myWeeks", ["items"])
218
+    ...mapState("myWeeks", ["items"]),
219
+    FilteredListings() {
220
+      if (this.filter) {
221
+        const list = _.filter(this.items, item =>
222
+          Object.values(item).some(
223
+            i =>
224
+              JSON.stringify(i)
225
+                .toLowerCase()
226
+                .indexOf(this.filter.toLowerCase()) > -1
227
+          )
228
+        );
229
+        return _.orderBy(list, this.sortKey, this.SortDirection);
230
+      } else {
231
+        return _.orderBy(this.items, this.sortKey, this.SortDirection);
232
+      }
233
+    },
234
+    PageCount() {
235
+      return this.visibleItemsPerPageCount !== 0
236
+        ? Math.ceil(this.items.length / this.visibleItemsPerPageCount)
237
+        : 1;
238
+    },
239
+    DisplayItems() {
240
+      const list = this.FilteredListings;
241
+      const startSlice = (this.currentPage - 1) * this.visibleItemsPerPageCount;
242
+      let endSlice = this.currentPage * this.visibleItemsPerPageCount;
243
+      if (endSlice > list.length) {
244
+        endSlice = list.length;
245
+      }
246
+      return list.slice(startSlice, endSlice);
247
+    },
248
+    SortDirection() {
249
+      return this.reverse ? "desc" : "asc";
250
+    }
64
   },
251
   },
65
   methods: {
252
   methods: {
66
     ...mapActions("myWeeks", ["getItems"]),
253
     ...mapActions("myWeeks", ["getItems"]),
75
     },
262
     },
76
     onClearSelected() {
263
     onClearSelected() {
77
       this.selectedItems = [];
264
       this.selectedItems = [];
265
+    },
266
+    Edit(item) {
267
+      this.$router.push({ name: "EditTimeshare", params: { weekParam: item } });
268
+      // this.$router.push(`/editTimeShare/${item.id}`);
269
+    },
270
+    Delete(item) {
271
+      this.deleteListing(item.id);
272
+    },
273
+    async pageChangeHandle(value) {
274
+      switch (value) {
275
+        case "next":
276
+          this.currentPage += 1;
277
+          break;
278
+        case "previous":
279
+          this.currentPage -= 1;
280
+          break;
281
+        default:
282
+          this.currentPage = value;
283
+      }
284
+    },
285
+    sortBy(sortKey) {
286
+      this.reverse = this.sortKey === sortKey ? !this.reverse : false;
287
+      this.sortKey = sortKey;
288
+    },
289
+    ClearSort() {
290
+      this.reverse = true;
291
+      this.sortKey = "id";
78
     }
292
     }
79
   }
293
   }
80
 };
294
 };

+ 1
- 1
src/components/timeshare/resort/resortPageNew.vue 查看文件

9
               <gallerySection :images="resort.images" />
9
               <gallerySection :images="resort.images" />
10
               <FilterComponent :hideTop="true" />
10
               <FilterComponent :hideTop="true" />
11
             </div>
11
             </div>
12
-            <div class="col resort-profile" style="margin-top:15px; margin-bottom:15px;">
12
+            <div class="col-md-9 resort-profile" style="margin-top:15px; margin-bottom:15px;">
13
               <h2>{{ resort.prName }}</h2>
13
               <h2>{{ resort.prName }}</h2>
14
               <WeekList :resortCode="resortCode" />
14
               <WeekList :resortCode="resortCode" />
15
               <p v-if="resort.description && resort.description !== ''">{{ resort.description }}</p>
15
               <p v-if="resort.description && resort.description !== ''">{{ resort.description }}</p>

+ 103
- 38
src/components/timeshare/sell/contentSection.vue 查看文件

315
             <h2>Detailed Individual Information</h2>
315
             <h2>Detailed Individual Information</h2>
316
           </div>
316
           </div>
317
           <div class="form">
317
           <div class="form">
318
+            <div class="row mb-4">
319
+              <div class="col-md-12">
320
+                <float-label label="OWNER TYPE" fixed>
321
+                  <select class="form-control uniSelect" name="" id="" v-model="selectedUserType">
322
+                    <option value="myself">MYSELF</option>
323
+                    <option value="custom">CUSTOM USER</option>
324
+                  </select>
325
+                </float-label>
326
+              </div>
327
+            </div>
318
             <div class="row mb-2">
328
             <div class="row mb-2">
319
               <div class="form-group col-md-6">
329
               <div class="form-group col-md-6">
320
                 <float-label>
330
                 <float-label>
391
                     >
401
                     >
392
                   </span>
402
                   </span>
393
 
403
 
394
-                  <float-label label="Marital Status" style="width: 100%">
404
+                  <float-label fixed label="Marital Status" style="width: 100%">
395
                     <select
405
                     <select
396
                       class="form-control uniSelect"
406
                       class="form-control uniSelect"
397
                       id="howMarried"
407
                       id="howMarried"
398
                       v-model="indiv.howMarried"
408
                       v-model="indiv.howMarried"
399
                     >
409
                     >
400
-                      <option value="N/A">N/A</option>
401
-                      <option value="In Community Of Property">
402
-                        In Community Of Property
403
-                      </option>
404
-                      <option value="Out of Community Of Property">
405
-                        Out of Community Of Property
406
-                      </option>
407
-                      <option value="Other">Other</option>
408
-                      <option value="Traditional Wedding">
409
-                        Traditional Wedding
410
-                      </option>
411
-                      <option value="Single">Single</option>
412
-                      <option value="Divorced">Divorced</option>
413
-                      <option value="Widow">Widow</option>
414
-                      <option value="Committed Relationship">
415
-                        Committed Relationship
416
-                      </option>
417
-                      <option value="Partner">Partner</option>
410
+                      <option v-bind:value="0">N/A</option>
411
+                      <option v-bind:value="1">In Community Of Property</option>
412
+                      <option v-bind:value="2">Out of Community Of Property</option>
413
+                      <option v-bind:value="3">Other</option>
414
+                      <option v-bind:value="4">Traditional Wedding</option>
415
+                      <option v-bind:value="5">Single</option>
416
+                      <option v-bind:value="6">Divorced</option>
417
+                      <option v-bind:value="7">Widow</option>
418
+                      <option v-bind:value="8">Committed Relationship</option>
419
+                      <option v-bind:value="9">Partner</option>
418
                     </select>
420
                     </select>
419
                   </float-label>
421
                   </float-label>
420
                 </div>
422
                 </div>
447
                     placeholder="Cell Number"
449
                     placeholder="Cell Number"
448
                     data-rule="minlen:4"
450
                     data-rule="minlen:4"
449
                     data-msg="Please enter your cell number"
451
                     data-msg="Please enter your cell number"
450
-                    v-model="indiv.cellNumner"
452
+                    v-model="indiv.cellNumber"
451
                   />
453
                   />
452
                 </float-label>
454
                 </float-label>
453
 
455
 
470
               </div>
472
               </div>
471
             </div>
473
             </div>
472
           </div>
474
           </div>
473
-          <div v-if="indiv.howMarried === 'In Community Of Property'" class="section-header">
475
+          <div v-if="indiv.howMarried === 1" class="section-header">
474
             <h2>Spouse Details</h2>
476
             <h2>Spouse Details</h2>
475
           </div>
477
           </div>
476
-          <div v-if="indiv.howMarried === 'In Community Of Property'" class="form">
478
+          <div v-if="indiv.howMarried === 1" class="form">
477
             <div class="form-row mb-2">
479
             <div class="form-row mb-2">
478
               <div class="form-group col-md-6 mt-2">
480
               <div class="form-group col-md-6 mt-2">
479
                 <float-label>
481
                 <float-label>
832
                 </p>
834
                 </p>
833
               </div>
835
               </div>
834
             </div>
836
             </div>
835
-            <div class="form-row" v-if="profileEmailError">
837
+            <div class="form-row">
836
               <div class="col-md-12">
838
               <div class="col-md-12">
837
-                <p class="alert myError">
838
-                  Please ensure that your email is correct before adding a timeshare week.
839
-                </p>
839
+                <alert :text="errorMessage" :type="errorOccurred" />
840
               </div>
840
               </div>
841
             </div>
841
             </div>
842
             <div class="text-center col-12" v-if="CanSave">
842
             <div class="text-center col-12" v-if="CanSave">
881
   data() {
881
   data() {
882
     return {
882
     return {
883
       wait: false,
883
       wait: false,
884
+      errorOccurred: "",
885
+      errorMessage: "",
886
+      boolError: false,
884
       userLoggedIn: Log.isLoggedIn(),
887
       userLoggedIn: Log.isLoggedIn(),
885
-      profileEmailError: false
888
+      profileEmailError: false,
889
+      selectedUserType: "myself"
886
     };
890
     };
887
   },
891
   },
888
   components: {
892
   components: {
976
       this.weekId = 0;
980
       this.weekId = 0;
977
       this.getBlankWeek();
981
       this.getBlankWeek();
978
     },
982
     },
983
+    capitalizeFirstLetter() {
984
+      this.indiv.name = this.indiv.name.charAt(0).toUpperCase() + this.indiv.name.slice(1);
985
+      this.indiv.surname = this.indiv.surname.charAt(0).toUpperCase() + this.indiv.surname.slice(1);
986
+    },
987
+    validPhoneNumber(number) {
988
+      const rx = /^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}$/im;
989
+      return rx.test(String(number));
990
+    },
979
     submitSale() {
991
     submitSale() {
992
+      this.boolError = false;
980
       if (this.userLoggedIn) {
993
       if (this.userLoggedIn) {
981
-        this.sellItem.ownerObject = this.indiv;
994
+        this.capitalizeFirstLetter();
995
+
982
         this.sellItem.weekStatus = "For Sale";
996
         this.sellItem.weekStatus = "For Sale";
983
         //Sets the status of the week to waiting for EFT Payment
997
         //Sets the status of the week to waiting for EFT Payment
984
         this.statusList.forEach(status => {
998
         this.statusList.forEach(status => {
986
             this.sellItem.statusId = status.id;
1000
             this.sellItem.statusId = status.id;
987
           }
1001
           }
988
         });
1002
         });
989
-        this.saveWeek(this.sellItem)
990
-          .then(fulfilled => {
991
-            console.log(fulfilled);
992
-            // this.$router.push({ name: "PaymentOption", params: { week: fulfilled } });
993
-            this.$router.push({ name: "EFTPage", params: { week: fulfilled } });
994
-            //this.paygateRedirect();
995
-          })
996
-          .catch(ex => {
997
-            this.profileEmailError = true;
998
-          });
1003
+        if (this.selectedUserType === "custom") {
1004
+          this.sellItem.customOwner = true;
1005
+        }
1006
+        if (this.indiv.landlineNumber !== "") {
1007
+          if (this.indiv.landlineNumber !== null) {
1008
+            if (!this.validPhoneNumber(this.indiv.landlineNumber)) {
1009
+              this.boolError = true;
1010
+              this.errorOccurred = "ERROR";
1011
+              this.errorMessage = "The landline number is not in the correct format.";
1012
+            }
1013
+          }
1014
+        } else {
1015
+          this.indiv.telephone = null;
1016
+        }
1017
+        if (this.indiv.cellNumber !== "") {
1018
+          if (this.indiv.cellNumber !== null) {
1019
+            if (!this.validPhoneNumber(this.indiv.cellNumber)) {
1020
+              this.boolError = true;
1021
+              this.errorOccurred = "ERROR";
1022
+              this.errorMessage = "The cellphone number is not in the correct format.";
1023
+            }
1024
+          }
1025
+        } else {
1026
+          this.indiv.cellNumber = null;
1027
+        }
1028
+        if (this.indiv.spouseTelephone !== "") {
1029
+          if (this.indiv.spouseTelephone !== null) {
1030
+            if (!this.validPhoneNumber(this.indiv.spouseTelephone)) {
1031
+              this.boolError = true;
1032
+              this.errorOccurred = "ERROR";
1033
+              this.errorMessage = "Spouse Telephone number is not in the correct format.";
1034
+            }
1035
+          }
1036
+        } else {
1037
+          this.indiv.spouseTelephone = null;
1038
+        }
1039
+        if (this.indiv.spouseCellnumber !== "") {
1040
+          if (this.indiv.spouseCellnumber !== null) {
1041
+            if (!this.validPhoneNumber(this.indiv.spouseCellnumber)) {
1042
+              this.boolError = true;
1043
+              this.errorOccurred = "ERROR";
1044
+              this.errorMessage = "Spouse Cellphone number is not in the correct format.";
1045
+            }
1046
+          }
1047
+        } else {
1048
+          this.indiv.spouseCellnumber = null;
1049
+        }
1050
+        this.sellItem.ownerObject = this.indiv;
1051
+        //console.log(this.sellItem.ownerObject);
1052
+        console.log(this.sellItem);
1053
+        if (!this.boolError)
1054
+          this.saveWeek(this.sellItem)
1055
+            .then(fulfilled => {
1056
+              // this.$router.push({ name: "PaymentOption", params: { week: fulfilled } });
1057
+              this.$router.push({ name: "EFTPage", params: { week: fulfilled } });
1058
+              //this.paygateRedirect();
1059
+            })
1060
+            .catch(ex => {
1061
+              this.errorOccurred = "ERRORHTML";
1062
+              this.errorMessage = ex;
1063
+            });
999
       } else {
1064
       } else {
1000
         this.$router.push("/user/login");
1065
         this.$router.push("/user/login");
1001
       }
1066
       }

+ 28
- 5
src/components/user/registerAgencySection.vue 查看文件

144
       </div>
144
       </div>
145
     </div>
145
     </div>
146
     <button
146
     <button
147
+      :data-target="'#myModalAgency'"
148
+      data-toggle="modal"
147
       v-if="registerAgency.user.acceptedTerms"
149
       v-if="registerAgency.user.acceptedTerms"
148
       v-on:click="SubmitData()"
150
       v-on:click="SubmitData()"
149
       class="btn-solid-blue"
151
       class="btn-solid-blue"
151
     >
153
     >
152
       SUBMIT
154
       SUBMIT
153
     </button>
155
     </button>
154
-    <router-link to="/user/login" class="btn-white-border mb-5" style="float:right" type="submit">
156
+    <button
157
+      :data-target="'#myModalAgency'"
158
+      data-toggle="modal"
159
+      @click="navigate()"
160
+      class="btn-white-border mb-5"
161
+      style="float:right"
162
+      type="submit"
163
+    >
155
       Cancel
164
       Cancel
156
-    </router-link>
165
+    </button>
157
   </div>
166
   </div>
158
 </template>
167
 </template>
159
 
168
 
161
 /* eslint-disable */
170
 /* eslint-disable */
162
 import { mapState, mapActions } from "vuex";
171
 import { mapState, mapActions } from "vuex";
163
 import carousel from "vue-owl-carousel";
172
 import carousel from "vue-owl-carousel";
173
+import Log from "../../assets/Log";
164
 export default {
174
 export default {
165
   components: {
175
   components: {
166
     carousel
176
     carousel
186
   },
196
   },
187
   methods: {
197
   methods: {
188
     ...mapActions("register", ["getAgency", "saveAgency", "updateAgency", "clearAgency"]),
198
     ...mapActions("register", ["getAgency", "saveAgency", "updateAgency", "clearAgency"]),
189
-
199
+    navigate() {
200
+      if (Log.getUser().role !== "Super Admin") {
201
+        this.$router.push("/user/login");
202
+      }
203
+    },
190
     routerGoTo(goTo) {
204
     routerGoTo(goTo) {
191
       this.$emit("routerGoTo", goTo);
205
       this.$emit("routerGoTo", goTo);
192
     },
206
     },
200
       this.isPasswordShown = "password";
214
       this.isPasswordShown = "password";
201
     },
215
     },
202
     SubmitData() {
216
     SubmitData() {
203
-      this.saveAgency(this.registerAgency);
204
-      this.$router.push("/user/login");
217
+      this.saveAgency(this.registerAgency).then(() => {
218
+        console.log(Log.getUser().role);
219
+        setTimeout(() => {
220
+          if (Log.getUser().role !== "Super Admin") {
221
+            this.$router.push("/user/login");
222
+          } else {
223
+            this.$router.go();
224
+          }
225
+        }, 2500);
226
+      });
227
+      //this.$router.push("/user/login");
205
     },
228
     },
206
     Close() {
229
     Close() {
207
       this.$router.push("/user/login");
230
       this.$router.push("/user/login");

+ 22
- 3
src/components/user/registerIndividual.vue 查看文件

111
         </div>
111
         </div>
112
       </div>
112
       </div>
113
       <button
113
       <button
114
+        :data-target="'#myNewUserModal'"
115
+        data-toggle="modal"
114
         :disabled="isDisabled"
116
         :disabled="isDisabled"
115
         v-on:click="SubmitData()"
117
         v-on:click="SubmitData()"
116
         :class="isDisabled ? 'btn-disabled' : 'btn-solid-blue'"
118
         :class="isDisabled ? 'btn-disabled' : 'btn-solid-blue'"
118
       >
120
       >
119
         SUBMIT
121
         SUBMIT
120
       </button>
122
       </button>
121
-      <router-link to="/user/login" class="btn-white-border" style="float:right" type="submit">
123
+      <button
124
+        :data-target="'#myNewUserModal'"
125
+        data-toggle="modal"
126
+        @click="navigate()"
127
+        class="btn-white-border"
128
+        style="float:right"
129
+        type="submit"
130
+      >
122
         Cancel
131
         Cancel
123
-      </router-link>
132
+      </button>
124
     </div>
133
     </div>
125
   </main>
134
   </main>
126
 </template>
135
 </template>
130
 import { mapState, mapActions } from "vuex";
139
 import { mapState, mapActions } from "vuex";
131
 import carousel from "vue-owl-carousel";
140
 import carousel from "vue-owl-carousel";
132
 import alert from "../shared/alert";
141
 import alert from "../shared/alert";
142
+import Log from "../../assets/Log";
133
 export default {
143
 export default {
134
   components: {
144
   components: {
135
     carousel,
145
     carousel,
171
       "updateIndividual",
181
       "updateIndividual",
172
       "clearIndividual"
182
       "clearIndividual"
173
     ]),
183
     ]),
184
+    navigate() {
185
+      if (Log.getUser().role !== "Super Admin") {
186
+        this.$router.push("/user/login");
187
+      }
188
+    },
174
     togglePassword() {
189
     togglePassword() {
175
       this.showPassword = true;
190
       this.showPassword = true;
176
       this.isPasswordShown = "text";
191
       this.isPasswordShown = "text";
185
         .then(res => {
200
         .then(res => {
186
           this.boolMessage = true;
201
           this.boolMessage = true;
187
           setTimeout(() => {
202
           setTimeout(() => {
188
-            this.$router.push("/user/login");
203
+            if (Log.getUser().role !== "Super Admin") {
204
+              this.$router.push("/user/login");
205
+            } else {
206
+              this.$router.go();
207
+            }
189
           }, 2500);
208
           }, 2500);
190
         })
209
         })
191
         .catch(err => {
210
         .catch(err => {

+ 6
- 1
src/components/user/registerPage.vue 查看文件

65
 import { mapState, mapActions } from "vuex";
65
 import { mapState, mapActions } from "vuex";
66
 import RegisterIndividual from "./registerIndividual";
66
 import RegisterIndividual from "./registerIndividual";
67
 import RegisterAgency from "./registerAgencySection";
67
 import RegisterAgency from "./registerAgencySection";
68
+import Log from "../../assets/Log";
68
 export default {
69
 export default {
69
   components: {
70
   components: {
70
     RegisterIndividual,
71
     RegisterIndividual,
118
         });
119
         });
119
     },
120
     },
120
     Close() {
121
     Close() {
121
-      this.$router.push("/user/login");
122
+      if (Log.getUser().role !== "Super Admin") {
123
+        this.$router.push("/user/login");
124
+      } else {
125
+        this.$router.go(-1);
126
+      }
122
     }
127
     }
123
   }
128
   }
124
 };
129
 };

+ 105
- 11
src/components/user/updateAgentProfile.vue 查看文件

115
                 class="form-control uniInput"
115
                 class="form-control uniInput"
116
                 name="landline"
116
                 name="landline"
117
                 id="landline"
117
                 id="landline"
118
-                placeholder="LANDLINE NUMBER"
119
-                data-msg="Please enter your landline number"
118
+                placeholder="TELEPHONE NUMBER"
119
+                data-msg="Please enter your Telephone number"
120
                 v-model="agent.telephone"
120
                 v-model="agent.telephone"
121
               />
121
               />
122
             </float-label>
122
             </float-label>
133
             </float-label>
133
             </float-label>
134
           </div>
134
           </div>
135
         </div>
135
         </div>
136
+        <div v-if="pullUserRole === 'Super Admin'">
137
+          <div class="row">
138
+            <div class="col">
139
+              <div class="section-header">
140
+                <h2>Access Control</h2>
141
+              </div>
142
+            </div>
143
+          </div>
144
+          <div class="row">
145
+            <div class="col-md-6">
146
+              <float-label label="User Role" style="width:100%">
147
+                <select class="form-control uniSelect" id="howMarried" v-model="agent.user.role">
148
+                  <option v-for="role in getRoles" :key="role.id" :value="role.roleName">
149
+                    {{ role.roleName }}
150
+                  </option>
151
+                </select>
152
+              </float-label>
153
+            </div>
154
+            <div class="col-md-6">
155
+              <input
156
+                class="mr-2 mt-3"
157
+                name="changePass"
158
+                type="checkbox"
159
+                v-model="agent.user.loginPasswordChange"
160
+              />
161
+              <label for="changePass">Change Password on Next Login</label>
162
+            </div>
163
+          </div>
164
+        </div>
165
+        <div class="row">
166
+          <div class="col">
167
+            <Alert :text="errorMessage" :type="errorOccurred" />
168
+          </div>
169
+        </div>
136
         <div class="row mt-5 mb-5">
170
         <div class="row mt-5 mb-5">
137
           <div class="col">
171
           <div class="col">
138
             <button class="btn-solid-blue" @click="sendToApi()">SAVE</button>
172
             <button class="btn-solid-blue" @click="sendToApi()">SAVE</button>
149
 <script>
183
 <script>
150
 /* eslint-disable */
184
 /* eslint-disable */
151
 import { mapState, mapActions, mapGetters } from "vuex";
185
 import { mapState, mapActions, mapGetters } from "vuex";
186
+import Log from "../../assets/Log";
187
+import Alert from "../shared/alert";
152
 
188
 
153
 export default {
189
 export default {
154
   props: {
190
   props: {
155
     agent: {}
191
     agent: {}
156
   },
192
   },
193
+  components: {
194
+    Alert
195
+  },
196
+  data() {
197
+    return {
198
+      errorOccurred: "",
199
+      errorMessage: "",
200
+      boolError: false
201
+    };
202
+  },
157
   created() {
203
   created() {
204
+    this.retrieveUserRoles();
158
     this.getAgencies();
205
     this.getAgencies();
159
   },
206
   },
160
   computed: {
207
   computed: {
161
-    ...mapState("timeshare", ["agencies"])
208
+    ...mapGetters("role", ["getRoles"]),
209
+    ...mapState("timeshare", ["agencies"]),
210
+    pullUserRole() {
211
+      return Log.getUser().role;
212
+    }
162
   },
213
   },
163
   methods: {
214
   methods: {
215
+    ...mapActions("role", ["retrieveUserRoles"]),
164
     ...mapActions("timeshare", ["getAgencies", "updateAgent"]),
216
     ...mapActions("timeshare", ["getAgencies", "updateAgent"]),
217
+    ...mapActions("register", ["saveAgent"]),
218
+    validPhoneNumber(number) {
219
+      const rx = /^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}$/im;
220
+      return rx.test(String(number));
221
+    },
165
     sendToApi() {
222
     sendToApi() {
223
+      this.boolError = false;
166
       this.agent.fullName = this.agent.name + " " + this.agent.surname;
224
       this.agent.fullName = this.agent.name + " " + this.agent.surname;
167
-      if (this.agent.telephone === "") {
168
-        delete this.agent.telephone;
225
+      if (this.agent.telephone !== "") {
226
+        if (this.agent.telephone !== null) {
227
+          if (!this.validPhoneNumber(this.agent.telephone)) {
228
+            this.boolError = true;
229
+            this.errorOccurred = "ERROR";
230
+            this.errorMessage = "The telephone number is not in the correct format.";
231
+          }
232
+        }
233
+      } else {
234
+        this.agent.telephone = null;
235
+      }
236
+      if (this.agent.cellNumber !== "") {
237
+        if (this.agent.cellNumber !== null) {
238
+          if (!this.validPhoneNumber(this.agent.cellNumber)) {
239
+            this.boolError = true;
240
+            this.errorOccurred = "ERROR";
241
+            this.errorMessage = "The cellphone number is not in the correct format.";
242
+          }
243
+        }
244
+      } else {
245
+        this.agent.cellNumber = null;
169
       }
246
       }
170
-      if (this.agent.cellNumber === "") {
171
-        delete this.agent.cellNumber;
247
+
248
+      if (!this.boolError) {
249
+        if (
250
+          this.agent.user.role === "Agent" ||
251
+          this.agent.user.role === "Agency" ||
252
+          this.agent.user.role === "Managing Agent"
253
+        ) {
254
+          this.updateAgent(this.agent).then(() => {
255
+            this.$router.go(-1);
256
+          });
257
+        } else {
258
+          this.saveAgent(this.agent)
259
+            .then(() => {
260
+              if (Log.getUser().role === "Super Admin") {
261
+                this.$router.push("/status/userManagementPage");
262
+              } else {
263
+                this.$router.push("/");
264
+              }
265
+            })
266
+            .catch(ex => {
267
+              console.log(ex);
268
+            });
269
+        }
172
       }
270
       }
173
-      console.log(this.agent);
174
-      this.updateAgent(this.agent).then(() => {
175
-        this.$router.go(-1);
176
-      });
177
     }
271
     }
178
   }
272
   }
179
 };
273
 };

+ 148
- 65
src/components/user/updateProfileInfo.vue 查看文件

8
           <h2>Update Profile Info</h2>
8
           <h2>Update Profile Info</h2>
9
         </div>
9
         </div>
10
       </div>
10
       </div>
11
-      <div class="row mb-4">
11
+      <div v-if="!isAgent()" class="row mb-4">
12
         <div class="col">
12
         <div class="col">
13
           <div class="section-header">
13
           <div class="section-header">
14
             <h2>Detailed Individual Information</h2>
14
             <h2>Detailed Individual Information</h2>
15
           </div>
15
           </div>
16
         </div>
16
         </div>
17
       </div>
17
       </div>
18
+      <div v-else class="row mb-4">
19
+        <div class="col">
20
+          <div class="section-header">
21
+            <h2>Detailed Agent Information</h2>
22
+          </div>
23
+        </div>
24
+      </div>
18
       <!-- <DetailIndividual :currentUser="user" :showBank="true" :showAddress="true" /> -->
25
       <!-- <DetailIndividual :currentUser="user" :showBank="true" :showAddress="true" /> -->
19
       <div class="row mb-4">
26
       <div class="row mb-4">
20
         <div class="col-md-6">
27
         <div class="col-md-6">
66
         </div>
73
         </div>
67
       </div>
74
       </div>
68
       <div class="row mb-2">
75
       <div class="row mb-2">
69
-        <div class="form-group col-md-6">
76
+        <div v-if="!isAgent()" class="form-group col-md-6">
70
           <float-label>
77
           <float-label>
71
             <input
78
             <input
72
               type="text"
79
               type="text"
87
             <input
94
             <input
88
               type="text"
95
               type="text"
89
               class="form-control uniInput"
96
               class="form-control uniInput"
90
-              name="company"
91
-              id="company"
92
-              placeholder="Company Reg Number"
93
-              data-rule="minlen:4"
94
-              data-msg="Please enter your company reg number"
95
-              v-model="individual.companyRegNumber"
97
+              name="email"
98
+              id="email"
99
+              placeholder="EMAIL ADDRESS"
100
+              data-msg="Please enter your email address"
101
+              v-model="individual.email"
96
             />
102
             />
97
           </float-label>
103
           </float-label>
98
 
104
 
99
           <div class="validation"></div>
105
           <div class="validation"></div>
100
         </div>
106
         </div>
101
       </div>
107
       </div>
102
-      <div class="row mb-2">
108
+      <div v-if="!isAgent()" class="row mb-2">
103
         <div class="form-group col-md-6">
109
         <div class="form-group col-md-6">
104
           <div class="input-group">
110
           <div class="input-group">
105
-            <span v-if="!individual.howMarried">
106
-              <label v-if="!individual.howMarried" for="howMarried" class="uniSelectLabel"
107
-                >Marital Status</label
108
-              >
109
-            </span>
110
-
111
             <float-label label="Marital Status" style="width:100%">
111
             <float-label label="Marital Status" style="width:100%">
112
               <select
112
               <select
113
                 class="form-control uniSelect"
113
                 class="form-control uniSelect"
114
                 id="howMarried"
114
                 id="howMarried"
115
                 v-model="individual.howMarried"
115
                 v-model="individual.howMarried"
116
               >
116
               >
117
-                <option value="N/A">N/A</option>
118
-                <option value="In Community Of Property">In Community Of Property</option>
119
-                <option value="Out of Community Of Property">Out of Community Of Property</option>
120
-                <option value="Other">Other</option>
121
-                <option value="Traditional Wedding">Traditional Wedding</option>
122
-                <option value="Single">Single</option>
123
-                <option value="Divorced">Divorced</option>
124
-                <option value="Widow">Widow</option>
125
-                <option value="Committed Relationship">Committed Relationship</option>
126
-                <option value="Partner">Partner</option>
117
+                <option v-bind:value="0">N/A</option>
118
+                <option v-bind:value="1">In Community Of Property</option>
119
+                <option v-bind:value="2">Out of Community Of Property</option>
120
+                <option v-bind:value="3">Other</option>
121
+                <option v-bind:value="4">Traditional Wedding</option>
122
+                <option v-bind:value="5">Single</option>
123
+                <option v-bind:value="6">Divorced</option>
124
+                <option v-bind:value="7">Widow</option>
125
+                <option v-bind:value="8">Committed Relationship</option>
126
+                <option v-bind:value="9">Partner</option>
127
               </select>
127
               </select>
128
             </float-label>
128
             </float-label>
129
           </div>
129
           </div>
134
             <input
134
             <input
135
               type="text"
135
               type="text"
136
               class="form-control uniInput"
136
               class="form-control uniInput"
137
-              name="email"
138
-              id="email"
139
-              placeholder="EMAIL ADDRESS"
140
-              data-msg="Please enter your email address"
141
-              v-model="individual.email"
137
+              name="company"
138
+              id="company"
139
+              placeholder="Company Reg Number"
140
+              data-rule="minlen:4"
141
+              data-msg="Please enter your company reg number"
142
+              v-model="individual.companyRegNumber"
142
             />
143
             />
143
           </float-label>
144
           </float-label>
144
 
145
 
169
               class="form-control uniInput"
170
               class="form-control uniInput"
170
               name="landline"
171
               name="landline"
171
               id="landline"
172
               id="landline"
172
-              placeholder="LANDLINE NUMBER"
173
+              placeholder="TELEPHONE NUMBER"
173
               data-msg="Please enter your landline number"
174
               data-msg="Please enter your landline number"
174
-              v-model="individual.landlineNumber"
175
+              v-model="individual.telephone"
175
             />
176
             />
176
           </float-label>
177
           </float-label>
177
 
178
 
179
         </div>
180
         </div>
180
       </div>
181
       </div>
181
 
182
 
182
-      <div v-if="individual.howMarried === 'In Community Of Property'" class="section-header">
183
+      <div v-if="individual.howMarried === 1" class="section-header">
183
         <h2>Spouse Details</h2>
184
         <h2>Spouse Details</h2>
184
       </div>
185
       </div>
185
-      <div v-if="individual.howMarried === 'In Community Of Property'" class="form">
186
+      <div v-if="individual.howMarried === 1" class="form">
186
         <div class="form-row mb-2">
187
         <div class="form-row mb-2">
187
           <div class="form-group col-md-6 mt-2">
188
           <div class="form-group col-md-6 mt-2">
188
             <float-label>
189
             <float-label>
189
               <input
190
               <input
190
                 type="text"
191
                 type="text"
191
-                class="form-control"
192
+                class="form-control uniInput"
192
                 placeholder="SPOUSE NAME"
193
                 placeholder="SPOUSE NAME"
193
                 data-msg="Please enter your spouse's name"
194
                 data-msg="Please enter your spouse's name"
194
                 v-model="individual.spouseName"
195
                 v-model="individual.spouseName"
201
             <float-label>
202
             <float-label>
202
               <input
203
               <input
203
                 type="text"
204
                 type="text"
204
-                class="form-control"
205
+                class="form-control uniInput"
205
                 placeholder="SPOUSE SURNAME"
206
                 placeholder="SPOUSE SURNAME"
206
                 data-msg="Please enter your spouse's surname"
207
                 data-msg="Please enter your spouse's surname"
207
                 v-model="individual.spouseSurname"
208
                 v-model="individual.spouseSurname"
214
             <float-label>
215
             <float-label>
215
               <input
216
               <input
216
                 type="text"
217
                 type="text"
217
-                class="form-control"
218
+                class="form-control uniInput"
218
                 placeholder="SPOUSE EMAIL"
219
                 placeholder="SPOUSE EMAIL"
219
                 data-rule="minlen:4"
220
                 data-rule="minlen:4"
220
                 data-msg="Please enter your spouse's email"
221
                 data-msg="Please enter your spouse's email"
228
             <float-label>
229
             <float-label>
229
               <input
230
               <input
230
                 type="text"
231
                 type="text"
231
-                class="form-control"
232
+                class="form-control uniInput"
232
                 placeholder="SPOUSE TELEPHONE"
233
                 placeholder="SPOUSE TELEPHONE"
233
                 data-rule="minlen:4"
234
                 data-rule="minlen:4"
234
                 data-msg="Please enter your spouse's telephone number"
235
                 data-msg="Please enter your spouse's telephone number"
242
             <float-label>
243
             <float-label>
243
               <input
244
               <input
244
                 type="text"
245
                 type="text"
245
-                class="form-control"
246
+                class="form-control uniInput"
246
                 placeholder="SPOUSE CELL NUMBER"
247
                 placeholder="SPOUSE CELL NUMBER"
247
                 data-rule="minlen:4"
248
                 data-rule="minlen:4"
248
                 data-msg="Please enter your spouse's cellphone number"
249
                 data-msg="Please enter your spouse's cellphone number"
254
           </div>
255
           </div>
255
         </div>
256
         </div>
256
       </div>
257
       </div>
257
-      <div class="row">
258
+      <div v-if="!isAgent()" class="row">
258
         <div class="col">
259
         <div class="col">
259
           <div class="section-header">
260
           <div class="section-header">
260
             <h2>Address</h2>
261
             <h2>Address</h2>
261
           </div>
262
           </div>
262
         </div>
263
         </div>
263
       </div>
264
       </div>
264
-      <div class="row">
265
+      <div v-if="!isAgent()" class="row">
265
         <div class="form-group col-md-12">
266
         <div class="form-group col-md-12">
266
           <addressAutoComplete @GoogleAddress="UpdateAddress" />
267
           <addressAutoComplete @GoogleAddress="UpdateAddress" />
267
         </div>
268
         </div>
268
       </div>
269
       </div>
269
-      <div class="form-row">
270
+      <div v-if="!isAgent()" class="form-row">
270
         <div class="form-group col-md-6">
271
         <div class="form-group col-md-6">
271
           <input
272
           <input
272
             type="text"
273
             type="text"
379
             <label for="changePass">Change Password on Next Login</label>
380
             <label for="changePass">Change Password on Next Login</label>
380
           </div>
381
           </div>
381
         </div>
382
         </div>
382
-        <div
383
-          v-if="
384
-            individual.user.role.toUpperCase() === 'AGENCY' ||
385
-              individual.user.role.toUpperCase() === 'AGENT' ||
386
-              individual.user.role.toUpperCase() === 'MANAGING AGENT'
387
-          "
388
-          class="row mt-4"
389
-        >
383
+        <div class="row mt-4">
390
           <div class="col-md-6">
384
           <div class="col-md-6">
391
             <float-label fixed label="AGENCY" style="width:100%">
385
             <float-label fixed label="AGENCY" style="width:100%">
392
               <select class="form-control uniSelect" v-model="individual.agencyId">
386
               <select class="form-control uniSelect" v-model="individual.agencyId">
399
           </div>
393
           </div>
400
         </div>
394
         </div>
401
       </div>
395
       </div>
396
+      <div class="row">
397
+        <div class="col">
398
+          <Alert :text="errorMessage" :type="errorOccurred" />
399
+        </div>
400
+      </div>
402
       <div class="row mt-5">
401
       <div class="row mt-5">
403
         <div class="col">
402
         <div class="col">
404
           <button class="btn-solid-blue" @click="sendToApi()">UPDATE</button>
403
           <button class="btn-solid-blue" @click="sendToApi()">UPDATE</button>
422
 import DetailIndividual from "./timeshareIndividual.vue";
421
 import DetailIndividual from "./timeshareIndividual.vue";
423
 import addressAutoComplete from "../shared/addressAutoComplete";
422
 import addressAutoComplete from "../shared/addressAutoComplete";
424
 import Log from "../../assets/Log";
423
 import Log from "../../assets/Log";
424
+import Alert from "../shared/alert";
425
 
425
 
426
 export default {
426
 export default {
427
   name: "UpdateInfo",
427
   name: "UpdateInfo",
428
   data() {
428
   data() {
429
-    return { selectedItem: {}, individual: {} };
429
+    return {
430
+      selectedItem: {},
431
+      individual: {},
432
+      errorOccurred: "",
433
+      errorMessage: "",
434
+      boolError: false
435
+    };
430
   },
436
   },
431
   props: {},
437
   props: {},
432
   components: {
438
   components: {
433
     DetailIndividual,
439
     DetailIndividual,
434
-    addressAutoComplete
440
+    addressAutoComplete,
441
+    Alert
435
   },
442
   },
436
   mounted() {
443
   mounted() {
437
     this.selectedItem = this.currentUser;
444
     this.selectedItem = this.currentUser;
451
           this.individual.agencyId = this.agent[0].agencyId;
458
           this.individual.agencyId = this.agent[0].agencyId;
452
         }
459
         }
453
       } else {
460
       } else {
454
-        console.log(this.indiv);
455
         this.individual = this.indiv;
461
         this.individual = this.indiv;
456
         this.individual.user = Log.getUser();
462
         this.individual.user = Log.getUser();
457
       }
463
       }
495
     onSelectedItemItemChange(item) {
501
     onSelectedItemItemChange(item) {
496
       this.currentUser = item;
502
       this.currentUser = item;
497
     },
503
     },
504
+    isAgent() {
505
+      if (
506
+        this.individual.user.role.toUpperCase() === "AGENCY" ||
507
+        this.individual.user.role.toUpperCase() === "AGENT" ||
508
+        this.individual.user.role.toUpperCase() === "MANAGING AGENT"
509
+      ) {
510
+        return true;
511
+      } else {
512
+        return false;
513
+      }
514
+    },
498
     UpdateAddress(address) {
515
     UpdateAddress(address) {
499
       this.individual.address.streetNumber = address.streetNumber;
516
       this.individual.address.streetNumber = address.streetNumber;
500
       this.individual.address.street = address.streetName;
517
       this.individual.address.street = address.streetName;
503
       this.individual.address.suburb = address.suburb;
520
       this.individual.address.suburb = address.suburb;
504
       this.individual.address.postalCode = address.postalCode;
521
       this.individual.address.postalCode = address.postalCode;
505
     },
522
     },
523
+    validPhoneNumber(number) {
524
+      const rx = /^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}$/im;
525
+      return rx.test(String(number));
526
+    },
506
     sendToApi() {
527
     sendToApi() {
528
+      this.boolError = false;
507
       this.individual.emailAddress = this.individual.email;
529
       this.individual.emailAddress = this.individual.email;
508
-      if (
509
-        this.individual.user.role === "Agency" ||
510
-        this.individual.user.role === "Agent" ||
511
-        this.individual.user.role === "Managing Agent"
512
-      ) {
513
-        this.saveAgent(this.individual);
514
-      } else {
515
-        this.updateIndividual(this.individual).then(() => {
516
-          if (this.individual.user.role === "Super Admin") {
517
-            this.$router.push("/status/userManagementPage");
530
+
531
+      if (this.individual.telephone !== "") {
532
+        if (this.individual.telephone !== null) {
533
+          if (!this.validPhoneNumber(this.individual.telephone)) {
534
+            this.boolError = true;
535
+            this.errorOccurred = "ERROR";
536
+            this.errorMessage = "The telephone number is not in the correct format.";
518
           } else {
537
           } else {
519
-            this.$router.push("/");
538
+            this.individual.landlineNumber = this.individual.telephone;
520
           }
539
           }
521
-        });
540
+        }
541
+      } else {
542
+        this.individual.telephone = null;
543
+      }
544
+      if (this.individual.cellNumber !== "") {
545
+        if (this.individual.cellNumber !== null) {
546
+          if (!this.validPhoneNumber(this.individual.cellNumber)) {
547
+            this.boolError = true;
548
+            this.errorOccurred = "ERROR";
549
+            this.errorMessage = "The cellphone number is not in the correct format.";
550
+          }
551
+        }
552
+      } else {
553
+        this.individual.cellNumber = null;
554
+      }
555
+      if (this.individual.spouseTelephone !== "") {
556
+        if (this.individual.spouseTelephone !== null) {
557
+          if (!this.validPhoneNumber(this.individual.spouseTelephone)) {
558
+            this.boolError = true;
559
+            this.errorOccurred = "ERROR";
560
+            this.errorMessage = "Spouse Telephone number is not in the correct format.";
561
+          }
562
+        }
563
+      } else {
564
+        this.individual.spouseTelephone = null;
565
+      }
566
+      if (this.individual.spouseCellnumber !== "") {
567
+        if (this.individual.spouseCellnumber !== null) {
568
+          if (!this.validPhoneNumber(this.individual.spouseCellnumber)) {
569
+            this.boolError = true;
570
+            this.errorOccurred = "ERROR";
571
+            this.errorMessage = "Spouse Cellphone number is not in the correct format.";
572
+          }
573
+        }
574
+      } else {
575
+        this.individual.spouseCellnumber = null;
576
+      }
577
+      if (!this.boolError) {
578
+        if (
579
+          this.individual.user.role === "Agency" ||
580
+          this.individual.user.role === "Agent" ||
581
+          this.individual.user.role === "Managing Agent"
582
+        ) {
583
+          this.saveAgent(this.individual)
584
+            .then(() => {
585
+              if (Log.getUser().role === "Super Admin") {
586
+                this.$router.push("/status/userManagementPage");
587
+              } else {
588
+                this.$router.push("/");
589
+              }
590
+            })
591
+            .catch(ex => {
592
+              console.log(ex);
593
+              this.errorOccurred = "ERRORHTML";
594
+              this.errorMessage = ex;
595
+            });
596
+        } else {
597
+          this.updateIndividual(this.individual).then(() => {
598
+            if (Log.getUser().role === "Super Admin") {
599
+              this.$router.push("/status/userManagementPage");
600
+            } else {
601
+              this.$router.push("/");
602
+            }
603
+          });
604
+        }
522
       }
605
       }
523
     }
606
     }
524
   }
607
   }

+ 1
- 0
src/main.js 查看文件

34
 Vue.config.productionTip = false;
34
 Vue.config.productionTip = false;
35
 //axios.defaults.baseURL = "http://localhost:57260";
35
 //axios.defaults.baseURL = "http://localhost:57260";
36
 axios.defaults.baseURL = "https://www.pvsl.co.za:86/";
36
 axios.defaults.baseURL = "https://www.pvsl.co.za:86/";
37
+//axios.defaults.baseURL = "http://training.provision-sa.com:82/";
37
 //axios.defaults.baseURL = "http://localhost:8080/";
38
 //axios.defaults.baseURL = "http://localhost:8080/";
38
 
39
 
39
 Vue.prototype.$axios = axios;
40
 Vue.prototype.$axios = axios;

+ 2
- 2
src/store/modules/communication/info.js 查看文件

32
       axios
32
       axios
33
         .get('api/info/getAllClasses')
33
         .get('api/info/getAllClasses')
34
         .then(result => commit('setClasses', result.data))
34
         .then(result => commit('setClasses', result.data))
35
-        .catch(console.error);
35
+        .catch(ex => console.log(ex.response));
36
     },
36
     },
37
     getProperties({
37
     getProperties({
38
       commit,
38
       commit,
40
       axios
40
       axios
41
         .get(`api/info/${obj.fullName}`)
41
         .get(`api/info/${obj.fullName}`)
42
         .then(result => commit('setProperties', result.data))
42
         .then(result => commit('setProperties', result.data))
43
-        .catch(console.error);
43
+        .catch(ex => console.log(ex.response));
44
     },
44
     },
45
   },
45
   },
46
 };
46
 };

+ 14
- 10
src/store/modules/communication/template.js 查看文件

43
       axios
43
       axios
44
         .get('/api/template/getSimple')
44
         .get('/api/template/getSimple')
45
         .then(result => commit('setList', result.data))
45
         .then(result => commit('setList', result.data))
46
-        .catch(console.error);
46
+        .catch(ex => console.log(ex.response));
47
     },
47
     },
48
     async getSingleTemplate({commit}, id){
48
     async getSingleTemplate({commit}, id){
49
       await axios.get('/api/template/' + id)
49
       await axios.get('/api/template/' + id)
50
       .then(result => commit('setSingle', result.data[0]))
50
       .then(result => commit('setSingle', result.data[0]))
51
-      .catch(ex => console.log(ex))
51
+      .catch(ex => console.log(ex.response))
52
     },
52
     },
53
     addItem({
53
     addItem({
54
       dispatch,
54
       dispatch,
56
       axios
56
       axios
57
         .post('/api/template', item)
57
         .post('/api/template', item)
58
         .then(() => dispatch('getList'))
58
         .then(() => dispatch('getList'))
59
-        .catch(console.error);
59
+        .catch((ex) => {
60
+          return Promise.reject(ex.response)
61
+        });
60
     },
62
     },
61
     editItem({
63
     editItem({
62
       dispatch,
64
       dispatch,
64
       axios
66
       axios
65
         .put(`/api/template/${item.id}`, item)
67
         .put(`/api/template/${item.id}`, item)
66
         .then(() => dispatch('getList'))
68
         .then(() => dispatch('getList'))
67
-        .catch(console.error);
69
+        .catch((ex) => {
70
+          return Promise.reject(ex.response)
71
+        });
68
     },
72
     },
69
     async deleteMailTemplate({commit}, id){
73
     async deleteMailTemplate({commit}, id){
70
       await axios.delete('/api/template/'+ id)
74
       await axios.delete('/api/template/'+ id)
72
         commit("deleteTemplate", id)
76
         commit("deleteTemplate", id)
73
       })
77
       })
74
       .catch((ex) => {
78
       .catch((ex) => {
75
-        console.log(ex);
79
+        return Promise.reject(ex.response)
76
       })
80
       })
77
     },
81
     },
78
     async getMailRecipients({commit}){
82
     async getMailRecipients({commit}){
81
         commit("setRecipients", result.data)
85
         commit("setRecipients", result.data)
82
       })
86
       })
83
       .catch((e) => {
87
       .catch((e) => {
84
-        console.log(e);
88
+        console.log(e.response);
85
       })
89
       })
86
     },
90
     },
87
     async getMailRecipientById({commit}, id){
91
     async getMailRecipientById({commit}, id){
90
         commit("setRecipient", result.data)
94
         commit("setRecipient", result.data)
91
       })
95
       })
92
       .catch((e) => {
96
       .catch((e) => {
93
-        console.log(e);
97
+        console.log(e.response);
94
       })
98
       })
95
     },
99
     },
96
     async addMailRecipient({commit}, rec){
100
     async addMailRecipient({commit}, rec){
99
         console.log(result);
103
         console.log(result);
100
       })
104
       })
101
       .catch((e) => {
105
       .catch((e) => {
102
-        console.log(e);
106
+        console.log(e.response);
103
       })
107
       })
104
     },
108
     },
105
     async updateMailRecipient({commit}, rec){
109
     async updateMailRecipient({commit}, rec){
108
         console.log(result);
112
         console.log(result);
109
       })
113
       })
110
       .catch((e) => {
114
       .catch((e) => {
111
-        console.log(e);
115
+        console.log(e.response);
112
       })
116
       })
113
     },
117
     },
114
     async deleteMailRecipient({commit}, id){
118
     async deleteMailRecipient({commit}, id){
117
         commit("removeRecipient", id)
121
         commit("removeRecipient", id)
118
       })
122
       })
119
       .catch((e) => {
123
       .catch((e) => {
120
-        console.log(e);
124
+        console.log(e.response);
121
       })
125
       })
122
     }
126
     }
123
   },
127
   },

+ 2
- 2
src/store/modules/financial/fees.js 查看文件

17
     async retrieveListingFee({ commit }) {
17
     async retrieveListingFee({ commit }) {
18
       await axios.get("api/fees/listingFee").then(res => {
18
       await axios.get("api/fees/listingFee").then(res => {
19
         commit("getListingFee", res.data);
19
         commit("getListingFee", res.data);
20
-      });
20
+      }).catch(ex => console.log(ex.response))
21
     },
21
     },
22
     async setListingFee({ commit }, fee) {
22
     async setListingFee({ commit }, fee) {
23
       await axios.post("api/fees/listingFee", fee).then(res => {
23
       await axios.post("api/fees/listingFee", fee).then(res => {
24
         commit("newListingFee", res.data);
24
         commit("newListingFee", res.data);
25
-      });
25
+      }).catch(ex => console.log(ex.response))
26
     }
26
     }
27
   }
27
   }
28
 };
28
 };

+ 2
- 2
src/store/modules/financial/payment.js 查看文件

21
       axios
21
       axios
22
         .get(`/api/payment/${id}`)
22
         .get(`/api/payment/${id}`)
23
         .then(result => commit("setPayment", result.data))
23
         .then(result => commit("setPayment", result.data))
24
-        .catch(console.error);
24
+        .catch(ex => console.log(ex.response));
25
     },
25
     },
26
     getPayments({ commit }) {
26
     getPayments({ commit }) {
27
       axios
27
       axios
28
         .get("/api/payment")
28
         .get("/api/payment")
29
         .then(result => commit("setPayments", result.data))
29
         .then(result => commit("setPayments", result.data))
30
-        .catch(console.error);
30
+        .catch(ex => console.log(ex.response));
31
     },
31
     },
32
     async addPayment({ commit }, payment) {
32
     async addPayment({ commit }, payment) {
33
       const response = await axios.post("/api/payment", payment);
33
       const response = await axios.post("/api/payment", payment);

+ 8
- 6
src/store/modules/misc/termsConditions.js 查看文件

20
       });
20
       });
21
     },
21
     },
22
     async setTerms({ commit }, terms) {
22
     async setTerms({ commit }, terms) {
23
-      const response = await axios.post("api/tc/", terms);
24
-      if (response.status === 200) {
25
-        commit("newTermsAndConditions", response.data);
23
+      await axios.post("api/tc/", terms)
24
+      .then((resp) => {
25
+        commit("newTermsAndConditions", resp.data);
26
         return Promise.resolve();
26
         return Promise.resolve();
27
-      } else {
28
-        return Promise.reject();
29
-      }
27
+      })
28
+      .catch((ex) => {
29
+        return Promise.reject(ex.response);
30
+      })
31
+      
30
     }
32
     }
31
   }
33
   }
32
 };
34
 };

+ 8
- 7
src/store/modules/processFlow/bid.js 查看文件

25
   getters: {},
25
   getters: {},
26
   actions: {
26
   actions: {
27
     getTemplate({ commit }) {
27
     getTemplate({ commit }) {
28
-      axios.get("/api/bid/GetNewBidTemplate").then(result => commit("setBid", result.data));
28
+      axios.get("/api/bid/GetNewBidTemplate").then(result => commit("setBid", result.data))
29
+      .catch(ex => console.log(ex.response));
29
     },
30
     },
30
     getBid({ commit }, id) {
31
     getBid({ commit }, id) {
31
       axios
32
       axios
32
         .get(`/api/bid/${id}`)
33
         .get(`/api/bid/${id}`)
33
         .then(result => commit("addToBids", result.data))
34
         .then(result => commit("addToBids", result.data))
34
-        .catch(console.error);
35
+        .catch(ex => console.log(ex.response));
35
     },
36
     },
36
     getBids({ commit }, username) {
37
     getBids({ commit }, username) {
37
       axios
38
       axios
38
         .get(`/api/bid/GetBids/${username}`)
39
         .get(`/api/bid/GetBids/${username}`)
39
         .then(result => commit("setBids", result.data))
40
         .then(result => commit("setBids", result.data))
40
-        .catch(console.error);
41
+        .catch(ex => console.log(ex.response));
41
     },
42
     },
42
     saveBid({ commit }, item) {
43
     saveBid({ commit }, item) {
43
       if (log.isLoggedIn()) {
44
       if (log.isLoggedIn()) {
47
       axios
48
       axios
48
         .post("/api/bid", item)
49
         .post("/api/bid", item)
49
         .then(result => commit("setBid", result.data))
50
         .then(result => commit("setBid", result.data))
50
-        .catch(console.error);
51
+        .catch(ex => console.log(ex.response));
51
     },
52
     },
52
     updateBid({ commit }, item) {
53
     updateBid({ commit }, item) {
53
       axios
54
       axios
54
         .put("/api/bid", item)
55
         .put("/api/bid", item)
55
         .then(result => commit("setBid", item))
56
         .then(result => commit("setBid", item))
56
-        .catch(console.error);
57
+        .catch(ex => console.log(ex.response));
57
     },
58
     },
58
     acceptBid({ commit }, id) {
59
     acceptBid({ commit }, id) {
59
       axios
60
       axios
60
         .put(`/api/bid/AcceptBid/${id}`)
61
         .put(`/api/bid/AcceptBid/${id}`)
61
         .then(result => commit("updateBidList", result.data))
62
         .then(result => commit("updateBidList", result.data))
62
-        .catch(console.error);
63
+        .catch(ex => console.log(ex.response));
63
     },
64
     },
64
     declineBid({ commit }, item) {
65
     declineBid({ commit }, item) {
65
       axios
66
       axios
66
         .put("/api/bid/DeclineBid", item)
67
         .put("/api/bid/DeclineBid", item)
67
         .then(result => commit("updateBidList", result.data))
68
         .then(result => commit("updateBidList", result.data))
68
-        .catch(console.error);
69
+        .catch(ex => console.log(ex.response));
69
     }
70
     }
70
   }
71
   }
71
 };
72
 };

+ 25
- 21
src/store/modules/property/property.js 查看文件

60
     getStatuses({ commit }) {
60
     getStatuses({ commit }) {
61
       axios
61
       axios
62
         .get("/api/property/GetPropertyStatuses")
62
         .get("/api/property/GetPropertyStatuses")
63
-        .then(result => commit("setStatuses", result.data));
63
+        .then(result => commit("setStatuses", result.data))
64
+        .catch(ex => console.log(ex.response));
64
     },
65
     },
65
     getProperty({ commit, dispatch }, id) {
66
     getProperty({ commit, dispatch }, id) {
66
       return new Promise((resolve, reject) => {
67
       return new Promise((resolve, reject) => {
93
       axios
94
       axios
94
         .get(`/api/PropertyImage/GetImagesByProperty/${id}`)
95
         .get(`/api/PropertyImage/GetImagesByProperty/${id}`)
95
         .then(result => commit("setPropertyImages", result.data))
96
         .then(result => commit("setPropertyImages", result.data))
96
-        .catch(console.error);
97
+        .catch(ex => console.log(ex.response));
97
     },
98
     },
98
     getSavedPropertyImages({ commit }, id) {
99
     getSavedPropertyImages({ commit }, id) {
99
       axios
100
       axios
100
         .get(`/api/PropertyImage/GetProperySavedImages/${id}`)
101
         .get(`/api/PropertyImage/GetProperySavedImages/${id}`)
101
         .then(result => commit("setPropertyImages", result.data))
102
         .then(result => commit("setPropertyImages", result.data))
102
-        .catch(console.error);
103
+        .catch(ex => console.log(ex.response));
103
     },
104
     },
104
     getPropertyTypes({ commit }, propertyType) {
105
     getPropertyTypes({ commit }, propertyType) {
105
       axios
106
       axios
106
         .get(`/api/PropertyType/type/${propertyType}`)
107
         .get(`/api/PropertyType/type/${propertyType}`)
107
         .then(result => commit("setPropertyTypes", result.data))
108
         .then(result => commit("setPropertyTypes", result.data))
108
-        .catch(console.error);
109
+        .catch(ex => console.log(ex.response));
109
     },
110
     },
110
     getPropertyTypesRes({ commit }) {
111
     getPropertyTypesRes({ commit }) {
111
       axios
112
       axios
112
         .get("/api/PropertyType/type/Residential")
113
         .get("/api/PropertyType/type/Residential")
113
         .then(result => commit("setPropertyTypesRes", result.data))
114
         .then(result => commit("setPropertyTypesRes", result.data))
114
-        .catch(console.error);
115
+        .catch(ex => console.log(ex.response));
115
     },
116
     },
116
     getPropertyTypesCom({ commit }) {
117
     getPropertyTypesCom({ commit }) {
117
       axios
118
       axios
118
         .get("/api/PropertyType/type/Commercial")
119
         .get("/api/PropertyType/type/Commercial")
119
         .then(result => commit("setPropertyTypesCom", result.data))
120
         .then(result => commit("setPropertyTypesCom", result.data))
120
-        .catch(console.error);
121
+        .catch(ex => console.log(ex.response));
121
     },
122
     },
122
     getPropertyOverviewFields({ commit }) {
123
     getPropertyOverviewFields({ commit }) {
123
       axios
124
       axios
124
         .get("/api/PropertyFields/Property Overview")
125
         .get("/api/PropertyFields/Property Overview")
125
-        .then(response => commit("setPropertyOverviewFields", response.data));
126
+        .then(response => commit("setPropertyOverviewFields", response.data))
127
+        .catch(ex => console.log(ex.response));
126
     },
128
     },
127
     getPropertyFields({ commit }, propertyType) {
129
     getPropertyFields({ commit }, propertyType) {
128
       return axios.get(`/api/propertyFields/PropertyType/${propertyType}`).then(response => {
130
       return axios.get(`/api/propertyFields/PropertyType/${propertyType}`).then(response => {
129
         commit("setPropertyFields", response.data);
131
         commit("setPropertyFields", response.data);
130
-      });
132
+      })
133
+      .catch(ex => console.log(ex.response));
131
     },
134
     },
132
     getSavedPropertyFields({ commit }, id) {
135
     getSavedPropertyFields({ commit }, id) {
133
       axios
136
       axios
134
         .get(`/api/PropertyFields/GetSavedPropertyUserFields/${id}`)
137
         .get(`/api/PropertyFields/GetSavedPropertyUserFields/${id}`)
135
-        .then(result => commit("setPropertyFields", result.data));
138
+        .then(result => commit("setPropertyFields", result.data))
139
+        .catch(ex => console.log(ex.response));
136
     },
140
     },
137
     getPropertySavedOverviewFields({ commit }, id) {
141
     getPropertySavedOverviewFields({ commit }, id) {
138
       axios
142
       axios
139
         .get(`/api/PropertyFields/GetSavedValues/Residential/Property Overview/${id}`)
143
         .get(`/api/PropertyFields/GetSavedValues/Residential/Property Overview/${id}`)
140
         .then(response => commit("setPropertyOverviewFields", response.data))
144
         .then(response => commit("setPropertyOverviewFields", response.data))
141
-        .catch(console.error);
145
+        .catch(ex => console.log(ex.response));
142
     },
146
     },
143
     getPropertySavedFields({ commit }, item) {
147
     getPropertySavedFields({ commit }, item) {
144
       axios
148
       axios
145
         .get(`/api/PropertyFields/GetSavedValues/${item.type}/All/${item.id}`)
149
         .get(`/api/PropertyFields/GetSavedValues/${item.type}/All/${item.id}`)
146
         .then(response => commit("setPropertyFields", response.data))
150
         .then(response => commit("setPropertyFields", response.data))
147
-        .catch(console.error);
151
+        .catch(ex => console.log(ex.response));
148
     },
152
     },
149
     saveProperty({ commit }, item) {
153
     saveProperty({ commit }, item) {
150
       return new Promise((resolve, reject) => {
154
       return new Promise((resolve, reject) => {
154
             commit("updateCurrentProperty", resp);
158
             commit("updateCurrentProperty", resp);
155
             resolve(resp);
159
             resolve(resp);
156
           })
160
           })
157
-          .catch(() => {
158
-            reject(console.error);
161
+          .catch((ex) => {
162
+            reject(ex.response);
159
           });
163
           });
160
       });
164
       });
161
     },
165
     },
166
           alert(JSON.stringify(result.data));
170
           alert(JSON.stringify(result.data));
167
           commit("setProperty", result.data);
171
           commit("setProperty", result.data);
168
         })
172
         })
169
-        .catch(console.error);
173
+        .catch(ex => console.log(ex.response));
170
     },
174
     },
171
     clearPropertyImages({ commit }) {
175
     clearPropertyImages({ commit }) {
172
       commit("clearPropertyImages");
176
       commit("clearPropertyImages");
178
       axios
182
       axios
179
         .get(`/api/Property/getProperty/${item.id}`)
183
         .get(`/api/Property/getProperty/${item.id}`)
180
         .then(result => commit("setProperty", result.data))
184
         .then(result => commit("setProperty", result.data))
181
-        .catch(console.error);
185
+        .catch(ex => console.log(ex.response));
182
 
186
 
183
       axios
187
       axios
184
         .get(`/api/PropertyImage/GetProperySavedImages/${item.id}`)
188
         .get(`/api/PropertyImage/GetProperySavedImages/${item.id}`)
185
         .then(result => commit("setPropertyImages", result.data))
189
         .then(result => commit("setPropertyImages", result.data))
186
-        .catch(console.error);
190
+        .catch(ex => console.log(ex.response));
187
 
191
 
188
       axios
192
       axios
189
         .get(`/api/PropertyFields/GetSavedValues/Residential/Property Overview/${item.id}`)
193
         .get(`/api/PropertyFields/GetSavedValues/Residential/Property Overview/${item.id}`)
190
         .then(response => commit("setPropertyOverviewFields", response.data))
194
         .then(response => commit("setPropertyOverviewFields", response.data))
191
-        .catch(console.error);
195
+        .catch(ex => console.log(ex.response));
192
 
196
 
193
       axios
197
       axios
194
         .get(`/api/PropertyFields/GetSavedValues/${item.type}/All/${item.id}`)
198
         .get(`/api/PropertyFields/GetSavedValues/${item.type}/All/${item.id}`)
195
         .then(response => commit("setPropertyFields", response.data))
199
         .then(response => commit("setPropertyFields", response.data))
196
-        .catch(console.error);
200
+        .catch(ex => console.log(ex.response));
197
     },
201
     },
198
     getSavedPropertyImages({ commit }, id) {
202
     getSavedPropertyImages({ commit }, id) {
199
       axios
203
       axios
200
         .get(`/api/PropertyImage/GetProperySavedImages/${id}`)
204
         .get(`/api/PropertyImage/GetProperySavedImages/${id}`)
201
         .then(result => commit("setPropertyImages", result.data))
205
         .then(result => commit("setPropertyImages", result.data))
202
-        .catch(console.error);
206
+        .catch(ex => console.log(ex.response));
203
     },
207
     },
204
     updateProperty({ commit }, property) {
208
     updateProperty({ commit }, property) {
205
       return new Promise((resolve, reject) => {
209
       return new Promise((resolve, reject) => {
208
           .then(response => {
212
           .then(response => {
209
             resolve();
213
             resolve();
210
           })
214
           })
211
-          .catch(() => {
212
-            reject(console.error);
215
+          .catch((ex) => {
216
+            reject(ex.response);
213
           });
217
           });
214
       });
218
       });
215
     }
219
     }

+ 22
- 3
src/store/modules/timeshare/myWeeks.js 查看文件

5
 export default {
5
 export default {
6
   namespaced: true,
6
   namespaced: true,
7
   state: {
7
   state: {
8
-    items: []
8
+    items: [],
9
+    weekCount: {}
9
   },
10
   },
10
   mutations: {
11
   mutations: {
11
     setItems(state, list) {
12
     setItems(state, list) {
14
     setItem(state, item) {
15
     setItem(state, item) {
15
       state.week = item;
16
       state.week = item;
16
     },
17
     },
18
+    setWeekCount(state, item){
19
+      state.weekCount = item
20
+    },
17
     updateItem(state, item) {
21
     updateItem(state, item) {
18
       var index;
22
       var index;
19
       var count = 0;
23
       var count = 0;
59
         return Promise.reject();
63
         return Promise.reject();
60
       }
64
       }
61
     },
65
     },
66
+    async getWeekCount({commit}, id){
67
+      await axios.get("api/timeshareweek/indivWeekCount/"+ id)
68
+      .then((res) => {
69
+        commit("setWeekCount", res.data)
70
+        return Promise.resolve()
71
+      })
72
+      .catch((ex) => {
73
+        return Promise.reject(ex.response)
74
+      })
75
+    },
62
     verifyWeek({ commit }, id) {
76
     verifyWeek({ commit }, id) {
63
       try {
77
       try {
64
         axios.post(`/api/timeshareweek/verifyweek/${id}`).catch(console.error);
78
         axios.post(`/api/timeshareweek/verifyweek/${id}`).catch(console.error);
106
         .put(`/api/timeshareweek`, week)
120
         .put(`/api/timeshareweek`, week)
107
         .then(r => {
121
         .then(r => {
108
           week.owner = week.owner.name;
122
           week.owner = week.owner.name;
109
-          week.agent = week.agent.name;
123
+          if(week.agent !== undefined){
124
+            week.agent = week.agent.name;
125
+          }          
110
           commit("setItem", week);
126
           commit("setItem", week);
127
+          return Promise.resolve()
111
         })
128
         })
112
-        .catch(console.error);
129
+        .catch((ex) => {
130
+          return Promise.reject(ex.response)
131
+        });
113
     }
132
     }
114
   }
133
   }
115
 };
134
 };

+ 1
- 1
src/store/modules/timeshare/status.js 查看文件

36
         commit("setSingleStatus", result.data[0])
36
         commit("setSingleStatus", result.data[0])
37
       })
37
       })
38
       .catch((e) => {
38
       .catch((e) => {
39
-        console.log(e);
39
+        console.log(e.response);
40
       })
40
       })
41
     },
41
     },
42
     async createNewStatus({commit}, status){
42
     async createNewStatus({commit}, status){

+ 6
- 1
src/store/modules/timeshare/timeshare.js 查看文件

1
 /* eslint-disable guard-for-in */
1
 /* eslint-disable guard-for-in */
2
 /* eslint-disable no-restricted-syntax */
2
 /* eslint-disable no-restricted-syntax */
3
+/* eslint-disable */
3
 import axios from "axios";
4
 import axios from "axios";
4
 import _ from "lodash";
5
 import _ from "lodash";
5
 import MyData from "../../../assets/myData";
6
 import MyData from "../../../assets/myData";
232
             commit("setWeekDetail", result.data);
233
             commit("setWeekDetail", result.data);
233
             resolve(result.data);
234
             resolve(result.data);
234
           })
235
           })
235
-          .catch(error => reject(new Error(error.message)));
236
+          .catch(error => {
237
+            if(error.response){
238
+              reject(error.response)
239
+            }
240
+          });
236
       });
241
       });
237
 
242
 
238
       // axios
243
       // axios

+ 13
- 7
src/store/modules/user/register.js 查看文件

100
       state.registerAgency.pop(state.registerAgency.find(a => a.id === id));
100
       state.registerAgency.pop(state.registerAgency.find(a => a.id === id));
101
     },
101
     },
102
     removeAgent(state, id) {
102
     removeAgent(state, id) {
103
-      state.registerAgency.pop(state.registerAgency.find(a => a.id === id));
103
+      var index = state.agents.findIndex((agent) => agent.id === id)
104
+      state.agents.splice(index, 1)      
104
     }
105
     }
105
   },
106
   },
106
   getters: {},
107
   getters: {},
162
       axios
163
       axios
163
         .post("/api/register/registeragency", item)
164
         .post("/api/register/registeragency", item)
164
         .then(result => commit("addAgency", result.data))
165
         .then(result => commit("addAgency", result.data))
165
-        .catch(console.error);
166
+        .catch(ex => console.log(ex.response));
166
     },
167
     },
167
-    saveAgent({ commit }, item) {
168
-      axios
168
+    async saveAgent({ commit }, item) {
169
+      await axios
169
         .post("/api/agent/AgentFromUser", item)
170
         .post("/api/agent/AgentFromUser", item)
170
-        .then(result => commit("addAgent", result.data))
171
-        .catch(console.error);
171
+        .then((res) => {
172
+          commit("addAgent", res.data)
173
+          return Promise.resolve(res)
174
+        })
175
+        .catch((ex) => {
176
+          return Promise.reject(ex.response)
177
+        });
172
     },
178
     },
173
     async updateIndividual({ commit }, userParam) {
179
     async updateIndividual({ commit }, userParam) {
174
       await axios
180
       await axios
204
       axios
210
       axios
205
         .delete(`/api/agent/${id}`)
211
         .delete(`/api/agent/${id}`)
206
         .then(result => commit("removeAgent", id))
212
         .then(result => commit("removeAgent", id))
207
-        .catch(console.error);
213
+        .catch(ex => console.log(ex.response));
208
     }
214
     }
209
     // deleteAgency({
215
     // deleteAgency({
210
     //   commit,
216
     //   commit,

+ 1
- 0
vue.config.js 查看文件

3
     proxy: {
3
     proxy: {
4
       "/api": {
4
       "/api": {
5
         //target: "http://localhost:57260/",
5
         //target: "http://localhost:57260/",
6
+        //target: "http://training.provision-sa.com:82/",
6
         target: "https://www.pvsl.co.za:86/",
7
         target: "https://www.pvsl.co.za:86/",
7
         changeOrigin: true
8
         changeOrigin: true
8
       },
9
       },

Loading…
取消
儲存