浏览代码

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,10 +79,14 @@ export default {
79 79
         termsConditions: this.termsInput,
80 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 91
     async populateTerms() {
88 92
       await this.retrieveTerms();

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

@@ -27,11 +27,11 @@
27 27
             type="button"
28 28
             class="btn-solid-blue"
29 29
             data-toggle="modal"
30
-            :data-target="'#myModal' + i"
30
+            :data-target="'#myModalAgency'"
31 31
           >
32 32
             NEW AGENT
33 33
           </button>
34
-          <div :id="'myModal' + i" class="modal fade" role="dialog">
34
+          <div :id="'myModalAgency'" class="modal fade" role="dialog">
35 35
             <div class="modal-dialog modal-lg">
36 36
               <div class="modal-content">
37 37
                 <div class="modal-header">
@@ -45,6 +45,18 @@
45 45
       </div>
46 46
       <div class="container">
47 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 60
           :items="agents"
49 61
           :showNew="false"
50 62
           :editable="true"
@@ -57,7 +69,7 @@
57 69
           @onEdit="Edit"
58 70
           @onDelete="Delete"
59 71
           @onResetPassword="PasswordReset"
60
-        />
72
+        /> -->
61 73
       </div>
62 74
     </div>
63 75
   </main>
@@ -83,8 +95,8 @@ export default {
83 95
   },
84 96
   data() {
85 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 100
       item: {}
89 101
     };
90 102
   },
@@ -103,6 +115,7 @@ export default {
103 115
       this.$router.push({ name: "UpdateAgentProfile", params: { agent: item } });
104 116
     },
105 117
     Delete(item) {
118
+      console.log(item.id);
106 119
       this.deleteAgent(item.id);
107 120
     }
108 121
   },

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

@@ -513,7 +513,7 @@
513 513
                         id="status"
514 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 517
                           {{ status.description }}
518 518
                         </option>
519 519
                       </select>
@@ -546,6 +546,11 @@
546 546
                   </div>
547 547
                 </div>
548 548
               </div>
549
+              <div class="form-row">
550
+                <div class="col-md-12">
551
+                  <alert :text="errorMessage" :type="errorOccurred" />
552
+                </div>
553
+              </div>
549 554
               <div class="row">
550 555
                 <div class="text-center col-6">
551 556
                   <button class="btn-solid-blue" v-on:click="saveEdit()">
@@ -560,13 +565,20 @@
560 565
               </div>
561 566
             </div>
562 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 577
                   <button class="btn-solid-blue" v-on:click="paygateRedirect()">
566 578
                     MAKE PAYMENT
567 579
                   </button>
568 580
                 </div>
569
-              </div>
581
+              </div> -->
570 582
             </div>
571 583
           </div>
572 584
         </div>
@@ -609,7 +621,9 @@ export default {
609 621
       depDateParam: {},
610 622
       pubDateParam: {},
611 623
       boolAwaitingPayment: false,
612
-      selectedUser: ""
624
+      selectedUser: "",
625
+      errorOccurred: "",
626
+      errorMessage: ""
613 627
     };
614 628
   },
615 629
   components: {
@@ -638,13 +652,11 @@ export default {
638 652
     this.selectedWeekType = this.weekParam.weekType;
639 653
     this.selectedStatus = this.weekParam.status;
640 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 660
       if (this.ROLE !== "Super Admin") {
649 661
         this.boolAwaitingPayment = true;
650 662
       }
@@ -706,6 +718,21 @@ export default {
706 718
       var userObj = JSON.parse(localStorage.getItem("user"));
707 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 736
     filteredResort() {
710 737
       let list = [];
711 738
       if (this.week && this.week.region && this.selectedRegion) {
@@ -748,6 +775,17 @@ export default {
748 775
       this.weekId = 0;
749 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 789
     updateCurrentUser() {
752 790
       this.individuals.forEach(indiv => {
753 791
         if (this.weekParam.ownerId === indiv.id) {
@@ -794,6 +832,12 @@ export default {
794 832
       if (this.week.owner.telephone === "") {
795 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 841
       this.weekParam.arrivalDate = new Date(this.dateParam).toISOString().substring(0, 10);
798 842
       this.weekParam.departureDate = new Date(this.depDateParam).toISOString().substring(0, 10);
799 843
       //console.log(this.pubDateParam);
@@ -812,16 +856,24 @@ export default {
812 856
       //delete this.status;
813 857
       delete this.weekParam.owner.howMarried;
814 858
       delete this.weekParam.cellNumber;
859
+      console.log(this.week.owner);
815 860
       this.week.owner.name =
816 861
         this.week.owner.name.charAt(0).toUpperCase() + this.week.owner.name.slice(1);
817 862
       this.week.owner.surname =
818 863
         this.week.owner.surname.charAt(0).toUpperCase() + this.week.owner.surname.slice(1);
819 864
       this.weekParam.statusId = this.selectedStatus.id;
865
+      //console.log(this.weekParam);
820 866
       //console.log(JSON.stringify(this.weekParam));
821 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 878
     resortChange() {
827 879
       this.onResortChange({

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

@@ -43,8 +43,20 @@
43 43
             </div>
44 44
           </div>
45 45
         </div>
46
-        <div class="row">
46
+        <div class="container">
47 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 60
             :items="individuals"
49 61
             :showNew="false"
50 62
             :editable="true"
@@ -57,7 +69,7 @@
57 69
             @onEdit="Edit"
58 70
             @onDelete="Delete"
59 71
             @onResetPassword="PasswordReset"
60
-          />
72
+          /> -->
61 73
         </div>
62 74
       </div>
63 75
       <div v-else>
@@ -85,7 +97,7 @@ export default {
85 97
   },
86 98
   data() {
87 99
     return {
88
-      columns: ["id", "name", "surname", "cellNumber", "telephone", "email", "isDeleted"],
100
+      columns: ["id", "name", "surname", "cellNumber", "telephone", "email"],
89 101
       headers: ["", "", "", "", "", "", ""],
90 102
       item: {}
91 103
     };

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

@@ -164,7 +164,9 @@ export default {
164 164
   methods: {
165 165
     ...mapActions("template", ["getSingleTemplate", "editItem"]),
166 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 171
     onItemAdd() {
170 172
       var placeHolder = this.selectedProperty;

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

@@ -4,15 +4,9 @@
4 4
       <div class="container pb-5">
5 5
         <div class="row">
6 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 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 10
                 <option value="Sale">To Sell</option>
17 11
                 <option value="Rental">To Rent</option>
18 12
               </select>
@@ -22,9 +16,7 @@
22 16
         <div class="row mt-2">
23 17
           <div class="col-md-6">
24 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 20
             </div>
29 21
             <float-label label="PROPERTY NAME">
30 22
               <input
@@ -37,9 +29,7 @@
37 29
           </div>
38 30
           <div class="col-md-6">
39 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 33
             </div>
44 34
             <float-label label="PROPERTY REFERENCE">
45 35
               <input
@@ -61,11 +51,7 @@
61 51
               @change="PropertyTypeSelected"
62 52
             >
63 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 55
                 {{ item.description }}
70 56
               </option>
71 57
             </select>
@@ -152,9 +138,7 @@
152 138
             <div class="row my-3">
153 139
               <div class="col-md-12">
154 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 142
                 </div>
159 143
                 <input
160 144
                   class="form-control uniInput"
@@ -168,9 +152,7 @@
168 152
             <div class="row my-3">
169 153
               <div class="col-md-12">
170 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 156
                 </div>
175 157
                 <input
176 158
                   class="form-control uniInput"
@@ -226,9 +208,7 @@
226 208
             <div class="row my-3">
227 209
               <div class="col-md-12">
228 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 212
                 </div>
233 213
                 <input
234 214
                   class="form-control uniInput"
@@ -255,11 +235,7 @@
255 235
             </div>
256 236
             <div class="row my-3">
257 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 239
                   Clear Address
264 240
                 </button>
265 241
               </div>
@@ -268,17 +244,12 @@
268 244
         </div>
269 245
         <div class="row">
270 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 249
             <br />
279 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 253
             </p>
283 254
           </div>
284 255
         </div>
@@ -290,10 +261,7 @@
290 261
             
291 262
           </div>
292 263
         </div> -->
293
-        <UserField
294
-          :fields="propFields"
295
-          @UpdateUserDefinedFields="UpdateUserDefinedFields"
296
-        />
264
+        <UserField :fields="propFields" @UpdateUserDefinedFields="UpdateUserDefinedFields" />
297 265
         <div class="row">
298 266
           <div class="col-sm-12">
299 267
             <div class="section-header">
@@ -303,9 +271,7 @@
303 271
         </div>
304 272
         <div class="form-group row">
305 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 275
             <div class="input-group-prepend">
310 276
               <float-label label="Virtual Tour (URL)" style="width: 100%">
311 277
                 <input
@@ -321,9 +287,7 @@
321 287
         </div>
322 288
         <div class="row">
323 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 291
             <div class="input-group-prepend">
328 292
               <float-label label="video " style="width: 100%">
329 293
                 <input
@@ -351,12 +315,7 @@
351 315
           :savedImages="propertyImages"
352 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 319
           Save
361 320
         </button>
362 321
         <div v-if="showPropertyTypeError">
@@ -387,10 +346,10 @@ export default {
387 346
     ImageLoad,
388 347
     VueEditor,
389 348
     carouselSection,
390
-    mapSection,
349
+    mapSection
391 350
   },
392 351
   props: {
393
-    propFields: {},
352
+    propFields: {}
394 353
   },
395 354
   data() {
396 355
     return {
@@ -403,22 +362,17 @@ export default {
403 362
       customToolbar: [
404 363
         [{ header: [false, 1, 2, 3, 4, 5, 6] }],
405 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 366
         [{ list: "ordered" }, { list: "bullet" }, { list: "check" }],
413 367
         [{ script: "sub" }, { script: "super" }],
414
-        [{ indent: "-1" }, { indent: "+1" }],
368
+        [{ indent: "-1" }, { indent: "+1" }]
415 369
       ],
416 370
       error: "",
417 371
       addressSet: false,
418 372
       showPropertyTypeError: false,
419 373
       showDateError: false,
420 374
       user: Log.getUser(),
421
-      mayEdit: Log.isLoggedIn(),
375
+      mayEdit: Log.isLoggedIn()
422 376
     };
423 377
   },
424 378
   methods: {
@@ -433,7 +387,7 @@ export default {
433 387
       "getPropertyEditDisplay",
434 388
       "getPropertySavedOverviewFields",
435 389
       "getPropertySavedFields",
436
-      "getSavedPropertyData",
390
+      "getSavedPropertyData"
437 391
     ]),
438 392
     updateLocation(place) {
439 393
       this.addressSet = true;
@@ -456,10 +410,7 @@ export default {
456 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 414
         this.showDateError = true;
464 415
       }
465 416
 
@@ -483,7 +434,7 @@ export default {
483 434
         }
484 435
         this.property.propertyImages.push({
485 436
           image: this.images[i],
486
-          isDefault: setAsDefault,
437
+          isDefault: setAsDefault
487 438
         });
488 439
       }
489 440
       this.property.propertyUserFields = this.propertyFieldValues;
@@ -505,16 +456,13 @@ export default {
505 456
           this.property.agencyId = this.agent[0].agencyId;
506 457
         });
507 458
       }
508
-      console.log(this.property);
509 459
 
510 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 468
     Close() {
@@ -535,7 +483,7 @@ export default {
535 483
     },
536 484
     UpdateUserDefinedFields(item) {
537 485
       let update = false;
538
-      this.propertyFieldValues.forEach((element) => {
486
+      this.propertyFieldValues.forEach(element => {
539 487
         if (element.userDefinedFieldId === item.userDefinedFieldId) {
540 488
           element.value = item.value;
541 489
           update = true;
@@ -559,7 +507,7 @@ export default {
559 507
       this.property.postalCode = undefined;
560 508
       this.property.addressUrl = undefined;
561 509
       this.property.propertCoords = undefined;
562
-    },
510
+    }
563 511
   },
564 512
   mounted() {
565 513
     this.wait = false;
@@ -592,15 +540,13 @@ export default {
592 540
       "propertyOverviewFields",
593 541
       "propertyFields",
594 542
       "property",
595
-      "propertyImages",
543
+      "propertyImages"
596 544
     ]),
597 545
     ...mapState("authentication", ["user"]),
598 546
     ...mapGetters("fees", ["getListingFee"]),
599 547
     sortFields() {
600 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 550
       return display;
605 551
     },
606 552
     SalesTypeChanged() {
@@ -620,13 +566,13 @@ export default {
620 566
       this.getPropertyTypes(this.propertyType);
621 567
 
622 568
       return this.propertyType;
623
-    },
569
+    }
624 570
   },
625 571
   watch: {
626 572
     SalesTypeChanged() {
627 573
       return null;
628
-    },
629
-  },
574
+    }
575
+  }
630 576
 };
631 577
 </script>
632 578
 

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

@@ -111,12 +111,14 @@
111 111
           </div>
112 112
 
113 113
           <div class="mt-5" v-html="property.description"></div>
114
-          <router-link
114
+          <button
115 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 123
           <h4 v-if="property.virtualTour !== null" style="margin-top:150px">Virtual Tour</h4>
122 124
           <iframe
@@ -151,6 +153,7 @@
151 153
 <script>
152 154
 /* eslint-disable */
153 155
 import gallery from "../../../shared/gallerySlideShow";
156
+import { mapState, mapActions } from "vuex";
154 157
 export default {
155 158
   components: {
156 159
     gallery
@@ -166,6 +169,7 @@ export default {
166 169
     };
167 170
   },
168 171
   computed: {
172
+    ...mapState("status", ["singleStatus"]),
169 173
     Images() {
170 174
       const list = [];
171 175
       if (this.propertyImages) {
@@ -176,7 +180,24 @@ export default {
176 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 201
   mounted() {
181 202
     if (this.property.video === "") {
182 203
       this.property.video = null;
@@ -190,6 +211,27 @@ export default {
190 211
 </script>
191 212
 
192 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 235
 .images {
194 236
   padding-top: 100px;
195 237
 }

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

@@ -35,9 +35,7 @@
35 35
               <div class="row my-3">
36 36
                 <div class="col-md-6">
37 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 39
                   </div>
42 40
                   <input
43 41
                     class="form-control uniInput"
@@ -49,9 +47,7 @@
49 47
                 </div>
50 48
                 <div class="col-md-6">
51 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 51
                   </div>
56 52
                   <input
57 53
                     class="form-control uniInput"
@@ -72,19 +68,12 @@
72 68
                     :disabled="!canEdit"
73 69
                   >
74 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 72
                       {{ item.description }}
81 73
                     </option>
82 74
                   </select>
83 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 77
                   <div v-if="!property.unit">
89 78
                     <label for="unit" class="uniSelectLabel">UNIT</label>
90 79
                   </div>
@@ -166,8 +155,7 @@
166 155
                   <div
167 156
                     class="row my-3"
168 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 161
                     <div class="col-md-12">
@@ -187,9 +175,7 @@
187 175
                   <div class="row my-3">
188 176
                     <div class="col-md-12">
189 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 179
                       </div>
194 180
                       <input
195 181
                         class="form-control uniInput"
@@ -204,9 +190,7 @@
204 190
                   <div class="row my-3">
205 191
                     <div class="col-md-12">
206 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 194
                       </div>
211 195
                       <input
212 196
                         class="form-control uniInput"
@@ -221,9 +205,7 @@
221 205
                   <div class="row my-3">
222 206
                     <div class="col-md-12">
223 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 209
                       </div>
228 210
                       <input
229 211
                         class="form-control uniInput"
@@ -253,9 +235,7 @@
253 235
                   <div class="row my-3">
254 236
                     <div class="col-md-12">
255 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 239
                       </div>
260 240
                       <input
261 241
                         class="form-control uniInput"
@@ -270,9 +250,7 @@
270 250
                   <div class="row my-3">
271 251
                     <div class="col-md-12">
272 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 254
                       </div>
277 255
                       <input
278 256
                         class="form-control uniInput"
@@ -287,9 +265,7 @@
287 265
                   <div class="row my-3">
288 266
                     <div class="col-md-12">
289 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 269
                       </div>
294 270
                       <input
295 271
                         class="form-control uniInput"
@@ -303,11 +279,7 @@
303 279
                   </div>
304 280
                   <div class="row my-3">
305 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 283
                         Clear Address
312 284
                       </button>
313 285
                     </div>
@@ -316,13 +288,8 @@
316 288
               </div>
317 289
               <div class="row">
318 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 293
                   <br />
327 294
                 </div>
328 295
               </div>
@@ -330,16 +297,8 @@
330 297
                 <div class="section-header">
331 298
                   <h2>Property Information</h2>
332 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 302
                     <div v-if="field.type === 'number'">
344 303
                       {{ field.name }}
345 304
                       <input
@@ -360,11 +319,7 @@
360 319
                     </div>
361 320
                     <div v-else-if="field.type === 'yesno'">
362 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 323
                     </div>
369 324
                     <div v-else class="display:none"></div>
370 325
                   </div>
@@ -396,9 +351,7 @@
396 351
               </div>
397 352
               <div class="row mt-3">
398 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 355
                   <float-label label="Video (URL)">
403 356
                     <input
404 357
                       class="form-control uniInput"
@@ -427,20 +380,10 @@
427 380
                 @DeleteImage="DeleteImage"
428 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 384
                 Save
437 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 387
                 Close
445 388
               </button>
446 389
               <div v-if="!addressSet">
@@ -468,7 +411,7 @@ export default {
468 411
   components: {
469 412
     mapSection,
470 413
     ImageLoad,
471
-    VueEditor,
414
+    VueEditor
472 415
   },
473 416
   data() {
474 417
     return {
@@ -480,16 +423,11 @@ export default {
480 423
       customToolbar: [
481 424
         [{ header: [false, 1, 2, 3, 4, 5, 6] }],
482 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 427
         [{ list: "ordered" }, { list: "bullet" }, { list: "check" }],
490 428
         [{ script: "sub" }, { script: "super" }],
491
-        [{ indent: "-1" }, { indent: "+1" }],
492
-      ],
429
+        [{ indent: "-1" }, { indent: "+1" }]
430
+      ]
493 431
     };
494 432
   },
495 433
   methods: {
@@ -497,7 +435,7 @@ export default {
497 435
       "getProperty",
498 436
       "getPropertyTypes",
499 437
       "getPropertyFields",
500
-      "updateProperty",
438
+      "updateProperty"
501 439
     ]),
502 440
     StatusChanged(item) {
503 441
       if (
@@ -560,7 +498,7 @@ export default {
560 498
         }
561 499
         this.property.newImages.push({
562 500
           image: this.images[i],
563
-          isDefault: setAsDefault,
501
+          isDefault: setAsDefault
564 502
         });
565 503
       }
566 504
 
@@ -568,9 +506,13 @@ export default {
568 506
 
569 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 517
     Close() {
576 518
       this.property = {};
@@ -591,10 +533,10 @@ export default {
591 533
     },
592 534
     DeleteImage(item) {
593 535
       this.propertyImages[item].isDeleted = true;
594
-    },
536
+    }
595 537
   },
596 538
   mounted() {
597
-    this.getProperty(this.$route.params.id).then((fulfilled) => {
539
+    this.getProperty(this.$route.params.id).then(fulfilled => {
598 540
       this.wait = false;
599 541
       if (
600 542
         this.property.statusString === "Offer Pending" ||
@@ -613,7 +555,7 @@ export default {
613 555
       "propertyTypes",
614 556
       "propertyImages",
615 557
       "propertyFields",
616
-      "statuses",
558
+      "statuses"
617 559
     ]),
618 560
     savedImages() {
619 561
       const list = [];
@@ -633,8 +575,8 @@ export default {
633 575
         }
634 576
       }
635 577
       return list;
636
-    },
637
-  },
578
+    }
579
+  }
638 580
 };
639 581
 </script>
640 582
 

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

@@ -4,15 +4,9 @@
4 4
       <div class="container pb-5">
5 5
         <div class="row">
6 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 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 10
                 <option value="Sale">To Sell</option>
17 11
                 <option value="Rental">To Rent</option>
18 12
               </select>
@@ -22,9 +16,7 @@
22 16
         <div class="row mt-2">
23 17
           <div class="col-md-6">
24 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 20
             </div>
29 21
             <float-label label="PROPERTY NAME">
30 22
               <input
@@ -37,9 +29,7 @@
37 29
           </div>
38 30
           <div class="col-md-6">
39 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 33
             </div>
44 34
             <float-label label="PROPERTY REFERENCE">
45 35
               <input
@@ -61,11 +51,7 @@
61 51
               @change="PropertyTypeSelected"
62 52
             >
63 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 55
                 {{ item.description }}
70 56
               </option>
71 57
             </select>
@@ -136,9 +122,7 @@
136 122
             <div class="row my-3">
137 123
               <div class="col-md-12">
138 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 126
                 </div>
143 127
                 <input
144 128
                   class="form-control uniInput"
@@ -152,9 +136,7 @@
152 136
             <div class="row my-3">
153 137
               <div class="col-md-12">
154 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 140
                 </div>
159 141
                 <input
160 142
                   class="form-control uniInput"
@@ -196,9 +178,7 @@
196 178
             <div class="row my-3">
197 179
               <div class="col-md-12">
198 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 182
                 </div>
203 183
                 <input
204 184
                   class="form-control uniInput"
@@ -212,9 +192,7 @@
212 192
             <div class="row my-3">
213 193
               <div class="col-md-12">
214 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 196
                 </div>
219 197
                 <input
220 198
                   class="form-control uniInput"
@@ -241,11 +219,7 @@
241 219
             </div>
242 220
             <div class="row my-3">
243 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 223
                   Clear Address
250 224
                 </button>
251 225
               </div>
@@ -254,17 +228,12 @@
254 228
         </div>
255 229
         <div class="row">
256 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 233
             <br />
265 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 237
             </p>
269 238
           </div>
270 239
         </div>
@@ -285,9 +254,7 @@
285 254
         </div>
286 255
         <div class="form-group row">
287 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 258
             <div class="input-group-prepend">
292 259
               <float-label label="Virtual Tour (URL)" style="width: 100%">
293 260
                 <input
@@ -303,9 +270,7 @@
303 270
         </div>
304 271
         <div class="row">
305 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 274
             <div class="input-group-prepend">
310 275
               <float-label label="Video (URL)" style="width: 100%">
311 276
                 <input
@@ -333,12 +298,7 @@
333 298
           :savedImages="propertyImages"
334 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 302
           Save
343 303
         </button>
344 304
         <div v-if="showPropertyTypeError">
@@ -369,10 +329,10 @@ export default {
369 329
     ImageLoad,
370 330
     VueEditor,
371 331
     carouselSection,
372
-    mapSection,
332
+    mapSection
373 333
   },
374 334
   props: {
375
-    propFields: {},
335
+    propFields: {}
376 336
   },
377 337
   data() {
378 338
     return {
@@ -385,15 +345,10 @@ export default {
385 345
       customToolbar: [
386 346
         [{ header: [false, 1, 2, 3, 4, 5, 6] }],
387 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 349
         [{ list: "ordered" }, { list: "bullet" }, { list: "check" }],
395 350
         [{ script: "sub" }, { script: "super" }],
396
-        [{ indent: "-1" }, { indent: "+1" }],
351
+        [{ indent: "-1" }, { indent: "+1" }]
397 352
       ],
398 353
       error: "",
399 354
       addressSet: false,
@@ -401,7 +356,7 @@ export default {
401 356
       showDateError: false,
402 357
       user: Log.getUser(),
403 358
       mayEdit: Log.isLoggedIn(),
404
-      myprice: "0",
359
+      myprice: "0"
405 360
     };
406 361
   },
407 362
   methods: {
@@ -416,7 +371,7 @@ export default {
416 371
       "getPropertyEditDisplay",
417 372
       "getPropertySavedOverviewFields",
418 373
       "getPropertySavedFields",
419
-      "getSavedPropertyData",
374
+      "getSavedPropertyData"
420 375
     ]),
421 376
     ...mapActions("register", ["getAgentById"]),
422 377
     updateLocation(place) {
@@ -439,10 +394,7 @@ export default {
439 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 398
         this.showDateError = true;
447 399
       }
448 400
 
@@ -466,7 +418,7 @@ export default {
466 418
         }
467 419
         this.property.propertyImages.push({
468 420
           image: this.images[i],
469
-          isDefault: setAsDefault,
421
+          isDefault: setAsDefault
470 422
         });
471 423
       }
472 424
       this.property.propertyUserFields = this.propertyFieldValues;
@@ -489,13 +441,11 @@ export default {
489 441
       }
490 442
       //console.log(this.property);
491 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 451
     async retrieveAgency() {
@@ -519,7 +469,7 @@ export default {
519 469
     },
520 470
     UpdateUserResidentialFields(item) {
521 471
       let update = false;
522
-      this.propertyFieldValues.forEach((element) => {
472
+      this.propertyFieldValues.forEach(element => {
523 473
         if (element.userDefinedFieldId === item.userDefinedFieldId) {
524 474
           element.value = item.value;
525 475
           update = true;
@@ -553,7 +503,7 @@ export default {
553 503
         fields.push(arr.slice(i, (i += len)));
554 504
       }
555 505
       return fields;
556
-    },
506
+    }
557 507
   },
558 508
   mounted() {
559 509
     this.wait = false;
@@ -588,15 +538,13 @@ export default {
588 538
       "propertyOverviewFields",
589 539
       "propertyFields",
590 540
       "property",
591
-      "propertyImages",
541
+      "propertyImages"
592 542
     ]),
593 543
     ...mapState("authentication", ["user"]),
594 544
     ...mapGetters("fees", ["getListingFee"]),
595 545
     ...mapState("register", ["agent"]),
596 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 549
     SalesTypeChanged() {
602 550
       // eslint-disable-next-line vue/no-side-effects-in-computed-properties
@@ -616,13 +564,13 @@ export default {
616 564
     },
617 565
     userFieldsArr() {
618 566
       return this.userFieldsArrFunc(this.propertyFields, 4);
619
-    },
567
+    }
620 568
   },
621 569
   watch: {
622 570
     SalesTypeChanged() {
623 571
       return null;
624
-    },
625
-  },
572
+    }
573
+  }
626 574
 };
627 575
 </script>
628 576
 

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

@@ -31,6 +31,7 @@
31 31
           </div>
32 32
           <div class="panel-left p-5" style="margin-top:130px">
33 33
             <h2>Property Detial</h2>
34
+
34 35
             <!-- TODO: Make it dynamic -->
35 36
 
36 37
             <h4 style="color:white" v-if="property.statusString === 'For Sale'">
@@ -85,7 +86,6 @@
85 86
             {{ property.streetNumber }} {{ property.streetName }}
86 87
           </h2>
87 88
           <h2 v-else>{{ property.propertyName }}</h2>
88
-
89 89
           <div class="container">
90 90
             <div class="row">
91 91
               <div class="col">
@@ -118,13 +118,16 @@
118 118
                   </div>
119 119
                 </div>
120 120
               </div>
121
+
121 122
               <div class="col-md-4">
122
-                <router-link
123
+                <button
123 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 131
               </div>
129 132
             </div>
130 133
           </div>
@@ -187,11 +190,7 @@ export default {
187 190
     property: {},
188 191
     propertyImages: {}
189 192
   },
190
-  created() {
191
-    //this.getListsForPropertyEdit(this.property.id);
192
-  },
193 193
   async mounted() {
194
-    console.log(this.property);
195 194
     await this.checkForVideos;
196 195
     this.currentUrl = window.location.origin + this.$route.fullPath;
197 196
   },
@@ -204,6 +203,7 @@ export default {
204 203
   },
205 204
   methods: {
206 205
     //...mapActions("searchTab", ["getListsForPropertyEdit"])
206
+    ...mapActions("status", ["getSingleStatus"]),
207 207
     checkForVideos() {
208 208
       if (this.property.video === "") {
209 209
         this.property.video = null;
@@ -211,10 +211,26 @@ export default {
211 211
       if (this.property.virtualTour === "") {
212 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 231
   computed: {
217 232
     //...mapState("searchTab", ["provinces", "cities", "suburbs"]),
233
+    ...mapState("status", ["singleStatus"]),
218 234
     propertyMap() {
219 235
       if (this.property.propertCoords) {
220 236
         var lat = this.property.propertCoords.split(",")[0];
@@ -250,6 +266,27 @@ export default {
250 266
 </script>
251 267
 
252 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 290
 /* Extra small devices (phones, 600px and down) */
254 291
 @media only screen and (max-width: 575px) {
255 292
   .resPortfolioSection {

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

@@ -17,26 +17,91 @@
17 17
       <eva-icon name="slash-outline" style="margin: 0px 20px"></eva-icon>
18 18
       <strong class="color-black">{{ text }}</strong>
19 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 68
   </div>
21 69
 </template>
22 70
 
23 71
 <script>
72
+/* eslint-disable */
24 73
 export default {
25
-  name: 'Alert',
74
+  name: "Alert",
26 75
   data() {
27 76
     return {
28 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 86
   props: {
37 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 106
 </script>
42 107
 

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

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

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

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
   <div>
3 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 5
         <thead>
6 6
           <tr>
7 7
             <th scope="col">Ref</th>
@@ -50,7 +50,14 @@
50 50
             <!-- <td>{{item.status ? item.status.description : ''}}</td> -->
51 51
 
52 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 61
             </td>
55 62
             <!-- <div class="col-md-12">
56 63
                 <button type="button" class="btn btn-b-n" >View</button>
@@ -188,9 +195,38 @@ export default {
188 195
         default:
189 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 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,8 +10,126 @@
10 10
         </div>
11 11
       </div>
12 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 133
       <div class="offset-1 col-md-3">
16 134
         {{ items[selectedItems] }}
17 135
         <button
@@ -37,30 +155,99 @@
37 155
           @onClearSelected="onClearSelected"
38 156
         />
39 157
       </div>
40
-    </div>
158
+    </div> -->
41 159
   </main>
42 160
 </template>
43 161
 <script>
162
+/* eslint-disable */
44 163
 import { mapState, mapActions } from "vuex";
45 164
 import Log from "../../assets/Log";
46 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 170
 export default {
49 171
   components: {
50
-    ListView
172
+    ListView,
173
+    BasePagination
51 174
   },
52 175
   data() {
53 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 214
   mounted() {
59
-    console.log(this.user.id);
60
-    this.getItems(this.user.id);
215
+    this.getItems(Log.getUser().id);
61 216
   },
62 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 252
   methods: {
66 253
     ...mapActions("myWeeks", ["getItems"]),
@@ -75,6 +262,33 @@ export default {
75 262
     },
76 263
     onClearSelected() {
77 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,7 +9,7 @@
9 9
               <gallerySection :images="resort.images" />
10 10
               <FilterComponent :hideTop="true" />
11 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 13
               <h2>{{ resort.prName }}</h2>
14 14
               <WeekList :resortCode="resortCode" />
15 15
               <p v-if="resort.description && resort.description !== ''">{{ resort.description }}</p>

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

@@ -315,6 +315,16 @@
315 315
             <h2>Detailed Individual Information</h2>
316 316
           </div>
317 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 328
             <div class="row mb-2">
319 329
               <div class="form-group col-md-6">
320 330
                 <float-label>
@@ -391,30 +401,22 @@
391 401
                     >
392 402
                   </span>
393 403
 
394
-                  <float-label label="Marital Status" style="width: 100%">
404
+                  <float-label fixed label="Marital Status" style="width: 100%">
395 405
                     <select
396 406
                       class="form-control uniSelect"
397 407
                       id="howMarried"
398 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 420
                     </select>
419 421
                   </float-label>
420 422
                 </div>
@@ -447,7 +449,7 @@
447 449
                     placeholder="Cell Number"
448 450
                     data-rule="minlen:4"
449 451
                     data-msg="Please enter your cell number"
450
-                    v-model="indiv.cellNumner"
452
+                    v-model="indiv.cellNumber"
451 453
                   />
452 454
                 </float-label>
453 455
 
@@ -470,10 +472,10 @@
470 472
               </div>
471 473
             </div>
472 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 476
             <h2>Spouse Details</h2>
475 477
           </div>
476
-          <div v-if="indiv.howMarried === 'In Community Of Property'" class="form">
478
+          <div v-if="indiv.howMarried === 1" class="form">
477 479
             <div class="form-row mb-2">
478 480
               <div class="form-group col-md-6 mt-2">
479 481
                 <float-label>
@@ -832,11 +834,9 @@
832 834
                 </p>
833 835
               </div>
834 836
             </div>
835
-            <div class="form-row" v-if="profileEmailError">
837
+            <div class="form-row">
836 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 840
               </div>
841 841
             </div>
842 842
             <div class="text-center col-12" v-if="CanSave">
@@ -881,8 +881,12 @@ export default {
881 881
   data() {
882 882
     return {
883 883
       wait: false,
884
+      errorOccurred: "",
885
+      errorMessage: "",
886
+      boolError: false,
884 887
       userLoggedIn: Log.isLoggedIn(),
885
-      profileEmailError: false
888
+      profileEmailError: false,
889
+      selectedUserType: "myself"
886 890
     };
887 891
   },
888 892
   components: {
@@ -976,9 +980,19 @@ export default {
976 980
       this.weekId = 0;
977 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 991
     submitSale() {
992
+      this.boolError = false;
980 993
       if (this.userLoggedIn) {
981
-        this.sellItem.ownerObject = this.indiv;
994
+        this.capitalizeFirstLetter();
995
+
982 996
         this.sellItem.weekStatus = "For Sale";
983 997
         //Sets the status of the week to waiting for EFT Payment
984 998
         this.statusList.forEach(status => {
@@ -986,16 +1000,67 @@ export default {
986 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 1064
       } else {
1000 1065
         this.$router.push("/user/login");
1001 1066
       }

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

@@ -144,6 +144,8 @@
144 144
       </div>
145 145
     </div>
146 146
     <button
147
+      :data-target="'#myModalAgency'"
148
+      data-toggle="modal"
147 149
       v-if="registerAgency.user.acceptedTerms"
148 150
       v-on:click="SubmitData()"
149 151
       class="btn-solid-blue"
@@ -151,9 +153,16 @@
151 153
     >
152 154
       SUBMIT
153 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 164
       Cancel
156
-    </router-link>
165
+    </button>
157 166
   </div>
158 167
 </template>
159 168
 
@@ -161,6 +170,7 @@
161 170
 /* eslint-disable */
162 171
 import { mapState, mapActions } from "vuex";
163 172
 import carousel from "vue-owl-carousel";
173
+import Log from "../../assets/Log";
164 174
 export default {
165 175
   components: {
166 176
     carousel
@@ -186,7 +196,11 @@ export default {
186 196
   },
187 197
   methods: {
188 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 204
     routerGoTo(goTo) {
191 205
       this.$emit("routerGoTo", goTo);
192 206
     },
@@ -200,8 +214,17 @@ export default {
200 214
       this.isPasswordShown = "password";
201 215
     },
202 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 229
     Close() {
207 230
       this.$router.push("/user/login");

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

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

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

@@ -65,6 +65,7 @@
65 65
 import { mapState, mapActions } from "vuex";
66 66
 import RegisterIndividual from "./registerIndividual";
67 67
 import RegisterAgency from "./registerAgencySection";
68
+import Log from "../../assets/Log";
68 69
 export default {
69 70
   components: {
70 71
     RegisterIndividual,
@@ -118,7 +119,11 @@ export default {
118 119
         });
119 120
     },
120 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,8 +115,8 @@
115 115
                 class="form-control uniInput"
116 116
                 name="landline"
117 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 120
                 v-model="agent.telephone"
121 121
               />
122 122
             </float-label>
@@ -133,6 +133,40 @@
133 133
             </float-label>
134 134
           </div>
135 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 170
         <div class="row mt-5 mb-5">
137 171
           <div class="col">
138 172
             <button class="btn-solid-blue" @click="sendToApi()">SAVE</button>
@@ -149,31 +183,91 @@
149 183
 <script>
150 184
 /* eslint-disable */
151 185
 import { mapState, mapActions, mapGetters } from "vuex";
186
+import Log from "../../assets/Log";
187
+import Alert from "../shared/alert";
152 188
 
153 189
 export default {
154 190
   props: {
155 191
     agent: {}
156 192
   },
193
+  components: {
194
+    Alert
195
+  },
196
+  data() {
197
+    return {
198
+      errorOccurred: "",
199
+      errorMessage: "",
200
+      boolError: false
201
+    };
202
+  },
157 203
   created() {
204
+    this.retrieveUserRoles();
158 205
     this.getAgencies();
159 206
   },
160 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 214
   methods: {
215
+    ...mapActions("role", ["retrieveUserRoles"]),
164 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 222
     sendToApi() {
223
+      this.boolError = false;
166 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,13 +8,20 @@
8 8
           <h2>Update Profile Info</h2>
9 9
         </div>
10 10
       </div>
11
-      <div class="row mb-4">
11
+      <div v-if="!isAgent()" class="row mb-4">
12 12
         <div class="col">
13 13
           <div class="section-header">
14 14
             <h2>Detailed Individual Information</h2>
15 15
           </div>
16 16
         </div>
17 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 25
       <!-- <DetailIndividual :currentUser="user" :showBank="true" :showAddress="true" /> -->
19 26
       <div class="row mb-4">
20 27
         <div class="col-md-6">
@@ -66,7 +73,7 @@
66 73
         </div>
67 74
       </div>
68 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 77
           <float-label>
71 78
             <input
72 79
               type="text"
@@ -87,43 +94,36 @@
87 94
             <input
88 95
               type="text"
89 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 103
           </float-label>
98 104
 
99 105
           <div class="validation"></div>
100 106
         </div>
101 107
       </div>
102
-      <div class="row mb-2">
108
+      <div v-if="!isAgent()" class="row mb-2">
103 109
         <div class="form-group col-md-6">
104 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 111
             <float-label label="Marital Status" style="width:100%">
112 112
               <select
113 113
                 class="form-control uniSelect"
114 114
                 id="howMarried"
115 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 127
               </select>
128 128
             </float-label>
129 129
           </div>
@@ -134,11 +134,12 @@
134 134
             <input
135 135
               type="text"
136 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 144
           </float-label>
144 145
 
@@ -169,9 +170,9 @@
169 170
               class="form-control uniInput"
170 171
               name="landline"
171 172
               id="landline"
172
-              placeholder="LANDLINE NUMBER"
173
+              placeholder="TELEPHONE NUMBER"
173 174
               data-msg="Please enter your landline number"
174
-              v-model="individual.landlineNumber"
175
+              v-model="individual.telephone"
175 176
             />
176 177
           </float-label>
177 178
 
@@ -179,16 +180,16 @@
179 180
         </div>
180 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 184
         <h2>Spouse Details</h2>
184 185
       </div>
185
-      <div v-if="individual.howMarried === 'In Community Of Property'" class="form">
186
+      <div v-if="individual.howMarried === 1" class="form">
186 187
         <div class="form-row mb-2">
187 188
           <div class="form-group col-md-6 mt-2">
188 189
             <float-label>
189 190
               <input
190 191
                 type="text"
191
-                class="form-control"
192
+                class="form-control uniInput"
192 193
                 placeholder="SPOUSE NAME"
193 194
                 data-msg="Please enter your spouse's name"
194 195
                 v-model="individual.spouseName"
@@ -201,7 +202,7 @@
201 202
             <float-label>
202 203
               <input
203 204
                 type="text"
204
-                class="form-control"
205
+                class="form-control uniInput"
205 206
                 placeholder="SPOUSE SURNAME"
206 207
                 data-msg="Please enter your spouse's surname"
207 208
                 v-model="individual.spouseSurname"
@@ -214,7 +215,7 @@
214 215
             <float-label>
215 216
               <input
216 217
                 type="text"
217
-                class="form-control"
218
+                class="form-control uniInput"
218 219
                 placeholder="SPOUSE EMAIL"
219 220
                 data-rule="minlen:4"
220 221
                 data-msg="Please enter your spouse's email"
@@ -228,7 +229,7 @@
228 229
             <float-label>
229 230
               <input
230 231
                 type="text"
231
-                class="form-control"
232
+                class="form-control uniInput"
232 233
                 placeholder="SPOUSE TELEPHONE"
233 234
                 data-rule="minlen:4"
234 235
                 data-msg="Please enter your spouse's telephone number"
@@ -242,7 +243,7 @@
242 243
             <float-label>
243 244
               <input
244 245
                 type="text"
245
-                class="form-control"
246
+                class="form-control uniInput"
246 247
                 placeholder="SPOUSE CELL NUMBER"
247 248
                 data-rule="minlen:4"
248 249
                 data-msg="Please enter your spouse's cellphone number"
@@ -254,19 +255,19 @@
254 255
           </div>
255 256
         </div>
256 257
       </div>
257
-      <div class="row">
258
+      <div v-if="!isAgent()" class="row">
258 259
         <div class="col">
259 260
           <div class="section-header">
260 261
             <h2>Address</h2>
261 262
           </div>
262 263
         </div>
263 264
       </div>
264
-      <div class="row">
265
+      <div v-if="!isAgent()" class="row">
265 266
         <div class="form-group col-md-12">
266 267
           <addressAutoComplete @GoogleAddress="UpdateAddress" />
267 268
         </div>
268 269
       </div>
269
-      <div class="form-row">
270
+      <div v-if="!isAgent()" class="form-row">
270 271
         <div class="form-group col-md-6">
271 272
           <input
272 273
             type="text"
@@ -379,14 +380,7 @@
379 380
             <label for="changePass">Change Password on Next Login</label>
380 381
           </div>
381 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 384
           <div class="col-md-6">
391 385
             <float-label fixed label="AGENCY" style="width:100%">
392 386
               <select class="form-control uniSelect" v-model="individual.agencyId">
@@ -399,6 +393,11 @@
399 393
           </div>
400 394
         </div>
401 395
       </div>
396
+      <div class="row">
397
+        <div class="col">
398
+          <Alert :text="errorMessage" :type="errorOccurred" />
399
+        </div>
400
+      </div>
402 401
       <div class="row mt-5">
403 402
         <div class="col">
404 403
           <button class="btn-solid-blue" @click="sendToApi()">UPDATE</button>
@@ -422,16 +421,24 @@ import { mapState, mapActions, mapGetters } from "vuex";
422 421
 import DetailIndividual from "./timeshareIndividual.vue";
423 422
 import addressAutoComplete from "../shared/addressAutoComplete";
424 423
 import Log from "../../assets/Log";
424
+import Alert from "../shared/alert";
425 425
 
426 426
 export default {
427 427
   name: "UpdateInfo",
428 428
   data() {
429
-    return { selectedItem: {}, individual: {} };
429
+    return {
430
+      selectedItem: {},
431
+      individual: {},
432
+      errorOccurred: "",
433
+      errorMessage: "",
434
+      boolError: false
435
+    };
430 436
   },
431 437
   props: {},
432 438
   components: {
433 439
     DetailIndividual,
434
-    addressAutoComplete
440
+    addressAutoComplete,
441
+    Alert
435 442
   },
436 443
   mounted() {
437 444
     this.selectedItem = this.currentUser;
@@ -451,7 +458,6 @@ export default {
451 458
           this.individual.agencyId = this.agent[0].agencyId;
452 459
         }
453 460
       } else {
454
-        console.log(this.indiv);
455 461
         this.individual = this.indiv;
456 462
         this.individual.user = Log.getUser();
457 463
       }
@@ -495,6 +501,17 @@ export default {
495 501
     onSelectedItemItemChange(item) {
496 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 515
     UpdateAddress(address) {
499 516
       this.individual.address.streetNumber = address.streetNumber;
500 517
       this.individual.address.street = address.streetName;
@@ -503,22 +520,88 @@ export default {
503 520
       this.individual.address.suburb = address.suburb;
504 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 527
     sendToApi() {
528
+      this.boolError = false;
507 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 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,6 +34,7 @@ Vue.use(VueGoogleMaps, {
34 34
 Vue.config.productionTip = false;
35 35
 //axios.defaults.baseURL = "http://localhost:57260";
36 36
 axios.defaults.baseURL = "https://www.pvsl.co.za:86/";
37
+//axios.defaults.baseURL = "http://training.provision-sa.com:82/";
37 38
 //axios.defaults.baseURL = "http://localhost:8080/";
38 39
 
39 40
 Vue.prototype.$axios = axios;

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

@@ -32,7 +32,7 @@ export default {
32 32
       axios
33 33
         .get('api/info/getAllClasses')
34 34
         .then(result => commit('setClasses', result.data))
35
-        .catch(console.error);
35
+        .catch(ex => console.log(ex.response));
36 36
     },
37 37
     getProperties({
38 38
       commit,
@@ -40,7 +40,7 @@ export default {
40 40
       axios
41 41
         .get(`api/info/${obj.fullName}`)
42 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,12 +43,12 @@ export default {
43 43
       axios
44 44
         .get('/api/template/getSimple')
45 45
         .then(result => commit('setList', result.data))
46
-        .catch(console.error);
46
+        .catch(ex => console.log(ex.response));
47 47
     },
48 48
     async getSingleTemplate({commit}, id){
49 49
       await axios.get('/api/template/' + id)
50 50
       .then(result => commit('setSingle', result.data[0]))
51
-      .catch(ex => console.log(ex))
51
+      .catch(ex => console.log(ex.response))
52 52
     },
53 53
     addItem({
54 54
       dispatch,
@@ -56,7 +56,9 @@ export default {
56 56
       axios
57 57
         .post('/api/template', item)
58 58
         .then(() => dispatch('getList'))
59
-        .catch(console.error);
59
+        .catch((ex) => {
60
+          return Promise.reject(ex.response)
61
+        });
60 62
     },
61 63
     editItem({
62 64
       dispatch,
@@ -64,7 +66,9 @@ export default {
64 66
       axios
65 67
         .put(`/api/template/${item.id}`, item)
66 68
         .then(() => dispatch('getList'))
67
-        .catch(console.error);
69
+        .catch((ex) => {
70
+          return Promise.reject(ex.response)
71
+        });
68 72
     },
69 73
     async deleteMailTemplate({commit}, id){
70 74
       await axios.delete('/api/template/'+ id)
@@ -72,7 +76,7 @@ export default {
72 76
         commit("deleteTemplate", id)
73 77
       })
74 78
       .catch((ex) => {
75
-        console.log(ex);
79
+        return Promise.reject(ex.response)
76 80
       })
77 81
     },
78 82
     async getMailRecipients({commit}){
@@ -81,7 +85,7 @@ export default {
81 85
         commit("setRecipients", result.data)
82 86
       })
83 87
       .catch((e) => {
84
-        console.log(e);
88
+        console.log(e.response);
85 89
       })
86 90
     },
87 91
     async getMailRecipientById({commit}, id){
@@ -90,7 +94,7 @@ export default {
90 94
         commit("setRecipient", result.data)
91 95
       })
92 96
       .catch((e) => {
93
-        console.log(e);
97
+        console.log(e.response);
94 98
       })
95 99
     },
96 100
     async addMailRecipient({commit}, rec){
@@ -99,7 +103,7 @@ export default {
99 103
         console.log(result);
100 104
       })
101 105
       .catch((e) => {
102
-        console.log(e);
106
+        console.log(e.response);
103 107
       })
104 108
     },
105 109
     async updateMailRecipient({commit}, rec){
@@ -108,7 +112,7 @@ export default {
108 112
         console.log(result);
109 113
       })
110 114
       .catch((e) => {
111
-        console.log(e);
115
+        console.log(e.response);
112 116
       })
113 117
     },
114 118
     async deleteMailRecipient({commit}, id){
@@ -117,7 +121,7 @@ export default {
117 121
         commit("removeRecipient", id)
118 122
       })
119 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,12 +17,12 @@ export default {
17 17
     async retrieveListingFee({ commit }) {
18 18
       await axios.get("api/fees/listingFee").then(res => {
19 19
         commit("getListingFee", res.data);
20
-      });
20
+      }).catch(ex => console.log(ex.response))
21 21
     },
22 22
     async setListingFee({ commit }, fee) {
23 23
       await axios.post("api/fees/listingFee", fee).then(res => {
24 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,13 +21,13 @@ export default {
21 21
       axios
22 22
         .get(`/api/payment/${id}`)
23 23
         .then(result => commit("setPayment", result.data))
24
-        .catch(console.error);
24
+        .catch(ex => console.log(ex.response));
25 25
     },
26 26
     getPayments({ commit }) {
27 27
       axios
28 28
         .get("/api/payment")
29 29
         .then(result => commit("setPayments", result.data))
30
-        .catch(console.error);
30
+        .catch(ex => console.log(ex.response));
31 31
     },
32 32
     async addPayment({ commit }, payment) {
33 33
       const response = await axios.post("/api/payment", payment);

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

@@ -20,13 +20,15 @@ export default {
20 20
       });
21 21
     },
22 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 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,19 +25,20 @@ export default {
25 25
   getters: {},
26 26
   actions: {
27 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 31
     getBid({ commit }, id) {
31 32
       axios
32 33
         .get(`/api/bid/${id}`)
33 34
         .then(result => commit("addToBids", result.data))
34
-        .catch(console.error);
35
+        .catch(ex => console.log(ex.response));
35 36
     },
36 37
     getBids({ commit }, username) {
37 38
       axios
38 39
         .get(`/api/bid/GetBids/${username}`)
39 40
         .then(result => commit("setBids", result.data))
40
-        .catch(console.error);
41
+        .catch(ex => console.log(ex.response));
41 42
     },
42 43
     saveBid({ commit }, item) {
43 44
       if (log.isLoggedIn()) {
@@ -47,25 +48,25 @@ export default {
47 48
       axios
48 49
         .post("/api/bid", item)
49 50
         .then(result => commit("setBid", result.data))
50
-        .catch(console.error);
51
+        .catch(ex => console.log(ex.response));
51 52
     },
52 53
     updateBid({ commit }, item) {
53 54
       axios
54 55
         .put("/api/bid", item)
55 56
         .then(result => commit("setBid", item))
56
-        .catch(console.error);
57
+        .catch(ex => console.log(ex.response));
57 58
     },
58 59
     acceptBid({ commit }, id) {
59 60
       axios
60 61
         .put(`/api/bid/AcceptBid/${id}`)
61 62
         .then(result => commit("updateBidList", result.data))
62
-        .catch(console.error);
63
+        .catch(ex => console.log(ex.response));
63 64
     },
64 65
     declineBid({ commit }, item) {
65 66
       axios
66 67
         .put("/api/bid/DeclineBid", item)
67 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,7 +60,8 @@ export default {
60 60
     getStatuses({ commit }) {
61 61
       axios
62 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 66
     getProperty({ commit, dispatch }, id) {
66 67
       return new Promise((resolve, reject) => {
@@ -93,58 +94,61 @@ export default {
93 94
       axios
94 95
         .get(`/api/PropertyImage/GetImagesByProperty/${id}`)
95 96
         .then(result => commit("setPropertyImages", result.data))
96
-        .catch(console.error);
97
+        .catch(ex => console.log(ex.response));
97 98
     },
98 99
     getSavedPropertyImages({ commit }, id) {
99 100
       axios
100 101
         .get(`/api/PropertyImage/GetProperySavedImages/${id}`)
101 102
         .then(result => commit("setPropertyImages", result.data))
102
-        .catch(console.error);
103
+        .catch(ex => console.log(ex.response));
103 104
     },
104 105
     getPropertyTypes({ commit }, propertyType) {
105 106
       axios
106 107
         .get(`/api/PropertyType/type/${propertyType}`)
107 108
         .then(result => commit("setPropertyTypes", result.data))
108
-        .catch(console.error);
109
+        .catch(ex => console.log(ex.response));
109 110
     },
110 111
     getPropertyTypesRes({ commit }) {
111 112
       axios
112 113
         .get("/api/PropertyType/type/Residential")
113 114
         .then(result => commit("setPropertyTypesRes", result.data))
114
-        .catch(console.error);
115
+        .catch(ex => console.log(ex.response));
115 116
     },
116 117
     getPropertyTypesCom({ commit }) {
117 118
       axios
118 119
         .get("/api/PropertyType/type/Commercial")
119 120
         .then(result => commit("setPropertyTypesCom", result.data))
120
-        .catch(console.error);
121
+        .catch(ex => console.log(ex.response));
121 122
     },
122 123
     getPropertyOverviewFields({ commit }) {
123 124
       axios
124 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 129
     getPropertyFields({ commit }, propertyType) {
128 130
       return axios.get(`/api/propertyFields/PropertyType/${propertyType}`).then(response => {
129 131
         commit("setPropertyFields", response.data);
130
-      });
132
+      })
133
+      .catch(ex => console.log(ex.response));
131 134
     },
132 135
     getSavedPropertyFields({ commit }, id) {
133 136
       axios
134 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 141
     getPropertySavedOverviewFields({ commit }, id) {
138 142
       axios
139 143
         .get(`/api/PropertyFields/GetSavedValues/Residential/Property Overview/${id}`)
140 144
         .then(response => commit("setPropertyOverviewFields", response.data))
141
-        .catch(console.error);
145
+        .catch(ex => console.log(ex.response));
142 146
     },
143 147
     getPropertySavedFields({ commit }, item) {
144 148
       axios
145 149
         .get(`/api/PropertyFields/GetSavedValues/${item.type}/All/${item.id}`)
146 150
         .then(response => commit("setPropertyFields", response.data))
147
-        .catch(console.error);
151
+        .catch(ex => console.log(ex.response));
148 152
     },
149 153
     saveProperty({ commit }, item) {
150 154
       return new Promise((resolve, reject) => {
@@ -154,8 +158,8 @@ export default {
154 158
             commit("updateCurrentProperty", resp);
155 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,7 +170,7 @@ export default {
166 170
           alert(JSON.stringify(result.data));
167 171
           commit("setProperty", result.data);
168 172
         })
169
-        .catch(console.error);
173
+        .catch(ex => console.log(ex.response));
170 174
     },
171 175
     clearPropertyImages({ commit }) {
172 176
       commit("clearPropertyImages");
@@ -178,28 +182,28 @@ export default {
178 182
       axios
179 183
         .get(`/api/Property/getProperty/${item.id}`)
180 184
         .then(result => commit("setProperty", result.data))
181
-        .catch(console.error);
185
+        .catch(ex => console.log(ex.response));
182 186
 
183 187
       axios
184 188
         .get(`/api/PropertyImage/GetProperySavedImages/${item.id}`)
185 189
         .then(result => commit("setPropertyImages", result.data))
186
-        .catch(console.error);
190
+        .catch(ex => console.log(ex.response));
187 191
 
188 192
       axios
189 193
         .get(`/api/PropertyFields/GetSavedValues/Residential/Property Overview/${item.id}`)
190 194
         .then(response => commit("setPropertyOverviewFields", response.data))
191
-        .catch(console.error);
195
+        .catch(ex => console.log(ex.response));
192 196
 
193 197
       axios
194 198
         .get(`/api/PropertyFields/GetSavedValues/${item.type}/All/${item.id}`)
195 199
         .then(response => commit("setPropertyFields", response.data))
196
-        .catch(console.error);
200
+        .catch(ex => console.log(ex.response));
197 201
     },
198 202
     getSavedPropertyImages({ commit }, id) {
199 203
       axios
200 204
         .get(`/api/PropertyImage/GetProperySavedImages/${id}`)
201 205
         .then(result => commit("setPropertyImages", result.data))
202
-        .catch(console.error);
206
+        .catch(ex => console.log(ex.response));
203 207
     },
204 208
     updateProperty({ commit }, property) {
205 209
       return new Promise((resolve, reject) => {
@@ -208,8 +212,8 @@ export default {
208 212
           .then(response => {
209 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,7 +5,8 @@ import axios from "axios";
5 5
 export default {
6 6
   namespaced: true,
7 7
   state: {
8
-    items: []
8
+    items: [],
9
+    weekCount: {}
9 10
   },
10 11
   mutations: {
11 12
     setItems(state, list) {
@@ -14,6 +15,9 @@ export default {
14 15
     setItem(state, item) {
15 16
       state.week = item;
16 17
     },
18
+    setWeekCount(state, item){
19
+      state.weekCount = item
20
+    },
17 21
     updateItem(state, item) {
18 22
       var index;
19 23
       var count = 0;
@@ -59,6 +63,16 @@ export default {
59 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 76
     verifyWeek({ commit }, id) {
63 77
       try {
64 78
         axios.post(`/api/timeshareweek/verifyweek/${id}`).catch(console.error);
@@ -106,10 +120,15 @@ export default {
106 120
         .put(`/api/timeshareweek`, week)
107 121
         .then(r => {
108 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 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,7 +36,7 @@ export default {
36 36
         commit("setSingleStatus", result.data[0])
37 37
       })
38 38
       .catch((e) => {
39
-        console.log(e);
39
+        console.log(e.response);
40 40
       })
41 41
     },
42 42
     async createNewStatus({commit}, status){

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

@@ -1,5 +1,6 @@
1 1
 /* eslint-disable guard-for-in */
2 2
 /* eslint-disable no-restricted-syntax */
3
+/* eslint-disable */
3 4
 import axios from "axios";
4 5
 import _ from "lodash";
5 6
 import MyData from "../../../assets/myData";
@@ -232,7 +233,11 @@ export default {
232 233
             commit("setWeekDetail", result.data);
233 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 243
       // axios

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

@@ -100,7 +100,8 @@ export default {
100 100
       state.registerAgency.pop(state.registerAgency.find(a => a.id === id));
101 101
     },
102 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 107
   getters: {},
@@ -162,13 +163,18 @@ export default {
162 163
       axios
163 164
         .post("/api/register/registeragency", item)
164 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 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 179
     async updateIndividual({ commit }, userParam) {
174 180
       await axios
@@ -204,7 +210,7 @@ export default {
204 210
       axios
205 211
         .delete(`/api/agent/${id}`)
206 212
         .then(result => commit("removeAgent", id))
207
-        .catch(console.error);
213
+        .catch(ex => console.log(ex.response));
208 214
     }
209 215
     // deleteAgency({
210 216
     //   commit,

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

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

正在加载...
取消
保存