Browse Source

Timeshare sell & Property Listing fix

master
30117125 3 years ago
parent
commit
e60db850f1

+ 18
- 2
src/components/admin/status/editTimeShareAdminPage.vue View File

648
     this.selectedResort = this.weekParam.resort.resortCode;
648
     this.selectedResort = this.weekParam.resort.resortCode;
649
     this.selectedBedrooms = this.weekParam.bedrooms;
649
     this.selectedBedrooms = this.weekParam.bedrooms;
650
     this.selectedMaxSleep = this.weekParam.maxSleep;
650
     this.selectedMaxSleep = this.weekParam.maxSleep;
651
-    this.selectedWeekType = this.weekParam.weekType;
651
+    var weekTypeEnum = "";
652
+    switch (this.weekParam.weekType.toUpperCase()) {
653
+      case "FLEXI":
654
+        weekTypeEnum = "0";
655
+        break;
656
+      case "FIXED":
657
+        weekTypeEnum = "1";
658
+        break;
659
+      case "MODULE":
660
+        weekTypeEnum = "2";
661
+        break;
662
+      case "SYNDICATE":
663
+        weekTypeEnum = "3";
664
+        break;
665
+    }
666
+    this.selectedWeekType = weekTypeEnum;
652
     this.selectedStatus = this.weekParam.status;
667
     this.selectedStatus = this.weekParam.status;
653
     this.selectedPublish = this.weekParam.publish;
668
     this.selectedPublish = this.weekParam.publish;
654
     this.fixDates();
669
     this.fixDates();
848
       this.weekParam.module = this.week.module;
863
       this.weekParam.module = this.week.module;
849
       parseFloat(this.weekParam.sellPrice);
864
       parseFloat(this.weekParam.sellPrice);
850
       parseFloat(this.weekParam.levyAmount);
865
       parseFloat(this.weekParam.levyAmount);
851
-      this.weekParam.weekType = this.selectedWeekType;
866
+      this.weekParam.weekType = parseInt(this.selectedWeekType);
852
       delete this.weekParam.Owner;
867
       delete this.weekParam.Owner;
853
       delete this.weekParam.agency;
868
       delete this.weekParam.agency;
854
       delete this.weekParam.agent;
869
       delete this.weekParam.agent;
855
       //delete this.status;
870
       //delete this.status;
856
       delete this.weekParam.owner.howMarried;
871
       delete this.weekParam.owner.howMarried;
857
       delete this.weekParam.cellNumber;
872
       delete this.weekParam.cellNumber;
873
+      console.log(this.weekParam);
858
       console.log(this.week.owner);
874
       console.log(this.week.owner);
859
       this.week.owner.name =
875
       this.week.owner.name =
860
         this.week.owner.name.charAt(0).toUpperCase() + this.week.owner.name.slice(1);
876
         this.week.owner.name.charAt(0).toUpperCase() + this.week.owner.name.slice(1);

+ 10
- 18
src/components/property/commercial/createProperty/commercialCreateNew.vue View File

371
       addressSet: false,
371
       addressSet: false,
372
       showPropertyTypeError: false,
372
       showPropertyTypeError: false,
373
       showDateError: false,
373
       showDateError: false,
374
-      user: Log.getUser(),
374
+      comUser: Log.getUser(),
375
       mayEdit: Log.isLoggedIn()
375
       mayEdit: Log.isLoggedIn()
376
     };
376
     };
377
   },
377
   },
438
         });
438
         });
439
       }
439
       }
440
       this.property.propertyUserFields = this.propertyFieldValues;
440
       this.property.propertyUserFields = this.propertyFieldValues;
441
-
442
-      if (this.user) {
443
-        this.property.userId = this.user.id;
441
+      this.property.propertyUserFields.forEach(field => {
442
+        if (field.type === "yesno") {
443
+          if (field.value) {
444
+            field.value = "true";
445
+          }
446
+        }
447
+      });
448
+      if (this.comUser) {
449
+        this.property.userId = this.comUser.id;
444
       }
450
       }
445
 
451
 
446
-      // this.property.propertyUserFields.forEach(item => {
447
-      //   if (item.value === true) {
448
-      //     item.value = "yes";
449
-      //   } else if (item.value === false) {
450
-      //     item.value = "no";
451
-      //   }
452
-      // });
453
       if (Log.getUser().role === "Agency" || Log.getUser().role === "Agent") {
452
       if (Log.getUser().role === "Agency" || Log.getUser().role === "Agent") {
454
         this.retrieveAgency().then(() => {
453
         this.retrieveAgency().then(() => {
455
           this.property.agentId = this.agent[0].id;
454
           this.property.agentId = this.agent[0].id;
550
       return display;
549
       return display;
551
     },
550
     },
552
     SalesTypeChanged() {
551
     SalesTypeChanged() {
553
-      // eslint-disable-next-line vue/no-side-effects-in-computed-properties
554
-      // this.propertyType = this.$route.params.propType;
555
-      // eslint-disable-next-line vue/no-side-effects-in-computed-properties
556
       this.salesType = this.$route.params.saleType;
552
       this.salesType = this.$route.params.saleType;
557
       if (this.property && this.property.propertyUsageType) {
553
       if (this.property && this.property.propertyUsageType) {
558
-        // eslint-disable-next-line vue/no-side-effects-in-computed-properties
559
         this.propertyType = this.property.propertyUsageType;
554
         this.propertyType = this.property.propertyUsageType;
560
       }
555
       }
561
-
562
       if (!this.$route.query.id) {
556
       if (!this.$route.query.id) {
563
         this.getPropertyFields(this.propertyType);
557
         this.getPropertyFields(this.propertyType);
564
       }
558
       }
565
-
566
       this.getPropertyTypes(this.propertyType);
559
       this.getPropertyTypes(this.propertyType);
567
-
568
       return this.propertyType;
560
       return this.propertyType;
569
     }
561
     }
570
   },
562
   },

+ 13
- 3
src/components/property/propertyUserField.vue View File

4
       <div v-if="!setFields[i] && currentField.type !== 'yesno'">
4
       <div v-if="!setFields[i] && currentField.type !== 'yesno'">
5
         <label class="uniSelectLabel" style="margin-top:10px;">{{ currentField.name }}</label>
5
         <label class="uniSelectLabel" style="margin-top:10px;">{{ currentField.name }}</label>
6
       </div>
6
       </div>
7
-      <float-label :label="currentField.name" style="width:100%;top:-1em !important;">
7
+      <float-label
8
+        v-if="currentField.type === 'number'"
9
+        :label="currentField.name"
10
+        style="width:100%;top:-1em !important;"
11
+      >
8
         <input
12
         <input
9
           v-if="currentField.type === 'number'"
13
           v-if="currentField.type === 'number'"
10
           class="form-control uniInput"
14
           class="form-control uniInput"
15
           v-model="setFields[i]"
19
           v-model="setFields[i]"
16
           @change="UpdateSetFields(currentField, i)"
20
           @change="UpdateSetFields(currentField, i)"
17
         />
21
         />
18
-
22
+      </float-label>
23
+      <float-label
24
+        v-if="currentField.type === 'text'"
25
+        :label="currentField.name"
26
+        style="width:100%;top:-1em !important;"
27
+      >
19
         <input
28
         <input
20
           v-if="currentField.type === 'text'"
29
           v-if="currentField.type === 'text'"
21
           class="form-control uniInput"
30
           class="form-control uniInput"
57
     UpdateSetFields(field, index) {
66
     UpdateSetFields(field, index) {
58
       const item = {
67
       const item = {
59
         userDefinedFieldId: field.id,
68
         userDefinedFieldId: field.id,
60
-        value: this.setFields[index]
69
+        value: this.setFields[index],
70
+        type: field.type
61
       };
71
       };
62
       if (item) {
72
       if (item) {
63
         this.$emit("UpdateUserDefinedFields", item);
73
         this.$emit("UpdateUserDefinedFields", item);

+ 8
- 10
src/components/property/residential/createProperty/residentialCreate.vue View File

440
         this.property.userId = this.user.id;
440
         this.property.userId = this.user.id;
441
       }
441
       }
442
       console.log(this.propertyFieldValues);
442
       console.log(this.propertyFieldValues);
443
-
444
-      // this.saveProperty(this.property)
445
-      //   .then((fulfilled) => {
446
-      //     this.$router.push(
447
-      //       `/property/residential/property/${fulfilled.data.id}`
448
-      //     );
449
-      //   })
450
-      //   .catch((error) => {
451
-      //     console.log(error.message);
452
-      //   });
443
+      console.log("It was here");
444
+      this.saveProperty(this.property)
445
+        .then(fulfilled => {
446
+          this.$router.push(`/property/residential/property/${fulfilled.data.id}`);
447
+        })
448
+        .catch(error => {
449
+          console.log(error.message);
450
+        });
453
     },
451
     },
454
     Close() {
452
     Close() {
455
       this.$router.push("/property/admin/list/my");
453
       this.$router.push("/property/admin/list/my");

+ 70
- 75
src/components/property/residential/createProperty/residentialCreateNew.vue View File

4
       <div class="container pb-5">
4
       <div class="container pb-5">
5
         <div class="row">
5
         <div class="row">
6
           <div class="col">
6
           <div class="col">
7
-            <label v-if="!salesType" class="uniSelectLabel" for="resSaleType">Sale Type</label>
7
+            <label v-if="!resSalesType" class="uniSelectLabel" for="resSaleType">Sale Type</label>
8
             <float-label label="Sale Type">
8
             <float-label label="Sale Type">
9
-              <select class="form-control uniSelect mb-3" name="resSaleType" v-model="salesType">
9
+              <select class="form-control uniSelect mb-3" name="resSaleType" v-model="resSalesType">
10
                 <option value="Sale">To Sell</option>
10
                 <option value="Sale">To Sell</option>
11
                 <option value="Rental">To Rent</option>
11
                 <option value="Rental">To Rent</option>
12
               </select>
12
               </select>
79
                       margin-left: 17px;
79
                       margin-left: 17px;
80
                       background-color: white;
80
                       background-color: white;
81
                     "
81
                     "
82
-                    >{{ salesType }} Price</label
82
+                    >{{ resSalesType }} Price</label
83
                   >
83
                   >
84
                 </div>
84
                 </div>
85
                 <float-label label="Price">
85
                 <float-label label="Price">
93
                   />
93
                   />
94
                 </float-label>
94
                 </float-label>
95
               </div>
95
               </div>
96
-              <div v-if="salesType === 'Rental'" class="col-md-6">
96
+              <div v-if="resSalesType === 'Rental'" class="col-md-6">
97
                 <select
97
                 <select
98
                   class="form-control uniSelect"
98
                   class="form-control uniSelect"
99
                   name="resPropertyType"
99
                   name="resPropertyType"
229
         <div class="row">
229
         <div class="row">
230
           <div class="col-md-12">
230
           <div class="col-md-12">
231
             <label for="Property Description" style="font-family: 'muli'">Description:</label>
231
             <label for="Property Description" style="font-family: 'muli'">Description:</label>
232
-            <vue-editor v-model="property.description" :editor-toolbar="customToolbar" />
232
+            <vue-editor v-model="property.description" :editor-toolbar="resCustomToolbar" />
233
             <br />
233
             <br />
234
             <p>
234
             <p>
235
               * A listing fee of R{{ getListingFee.amount }} including VAT is payable to list your
235
               * A listing fee of R{{ getListingFee.amount }} including VAT is payable to list your
298
           :savedImages="propertyImages"
298
           :savedImages="propertyImages"
299
           @DefaultImage="UpdateDefaultImage"
299
           @DefaultImage="UpdateDefaultImage"
300
         />
300
         />
301
-        <button v-if="!wait" type="button" @click="SubmitData()" class="btn-solid-blue">
301
+        <button v-if="!resWait" type="button" @click="SubmitData()" class="btn-solid-blue">
302
           Save
302
           Save
303
         </button>
303
         </button>
304
-        <div v-if="showPropertyTypeError">
304
+        <div v-if="resShowPropertyTypeError">
305
           <p class="alert myError">
305
           <p class="alert myError">
306
             Missing fields. Please fill in all required fields. Marked with *
306
             Missing fields. Please fill in all required fields. Marked with *
307
           </p>
307
           </p>
308
         </div>
308
         </div>
309
-        <div v-if="wait" id="preloader"></div>
309
+        <div v-if="resWait" id="preloader"></div>
310
       </div>
310
       </div>
311
     </main>
311
     </main>
312
   </div>
312
   </div>
336
   },
336
   },
337
   data() {
337
   data() {
338
     return {
338
     return {
339
-      propertyType: "Residential",
340
-      salesType: "Rental",
341
-      images: [],
342
-      propertyFieldValues: [],
343
-      defaultImage: 0,
344
-      wait: false,
345
-      customToolbar: [
339
+      resPropertyType: "Residential",
340
+      resSalesType: "Rental",
341
+      resImages: [],
342
+      resPropertyFieldValues: [],
343
+      resDefaultImage: 0,
344
+      resWait: false,
345
+      resCustomToolbar: [
346
         [{ header: [false, 1, 2, 3, 4, 5, 6] }],
346
         [{ header: [false, 1, 2, 3, 4, 5, 6] }],
347
         ["bold", "italic", "underline", "strike"],
347
         ["bold", "italic", "underline", "strike"],
348
         [{ align: "" }, { align: "center" }, { align: "right" }, { align: "justify" }],
348
         [{ align: "" }, { align: "center" }, { align: "right" }, { align: "justify" }],
350
         [{ script: "sub" }, { script: "super" }],
350
         [{ script: "sub" }, { script: "super" }],
351
         [{ indent: "-1" }, { indent: "+1" }]
351
         [{ indent: "-1" }, { indent: "+1" }]
352
       ],
352
       ],
353
-      error: "",
354
-      addressSet: false,
355
-      showPropertyTypeError: false,
356
-      showDateError: false,
357
-      user: Log.getUser(),
358
-      mayEdit: Log.isLoggedIn(),
359
-      myprice: "0"
353
+      resAddressSet: false,
354
+      resShowPropertyTypeError: false,
355
+      resShowDateError: false,
356
+      resUser: Log.getUser()
360
     };
357
     };
361
   },
358
   },
362
   methods: {
359
   methods: {
375
     ]),
372
     ]),
376
     ...mapActions("register", ["getAgentById"]),
373
     ...mapActions("register", ["getAgentById"]),
377
     updateLocation(place) {
374
     updateLocation(place) {
378
-      this.addressSet = true;
375
+      this.resAddressSet = true;
379
       this.property.streetNumber = place.streetNumber;
376
       this.property.streetNumber = place.streetNumber;
380
       this.property.streetName = place.streetName;
377
       this.property.streetName = place.streetName;
381
       this.property.suburb = place.suburb;
378
       this.property.suburb = place.suburb;
387
       this.property.propertCoords = place.coords;
384
       this.property.propertCoords = place.coords;
388
     },
385
     },
389
     TypeChanged() {
386
     TypeChanged() {
390
-      this.property.propertyUsageType = this.propertyType;
387
+      this.property.propertyUsageType = this.resPropertyType;
391
     },
388
     },
392
     SubmitData() {
389
     SubmitData() {
393
       if (this.property.propertyTypeId === 0) {
390
       if (this.property.propertyTypeId === 0) {
394
-        this.showPropertyTypeError = true;
391
+        this.resShowPropertyTypeError = true;
395
       }
392
       }
396
 
393
 
397
-      if (this.salesType === "Rental" && this.property.dateAvailable === "undef") {
398
-        this.showDateError = true;
394
+      if (this.resSalesType === "Rental" && this.property.dateAvailable === "undef") {
395
+        this.resShowDateError = true;
399
       }
396
       }
400
 
397
 
401
-      if (this.showPropertyTypeError || this.showDateError) {
398
+      if (this.resShowPropertyTypeError || this.resShowDateError) {
402
         return;
399
         return;
403
       }
400
       }
404
 
401
 
405
-      this.wait = true;
406
-      if (this.salesType === "Sale") {
402
+      this.resWait = true;
403
+      if (this.resSalesType === "Sale") {
407
         this.property.isSale = true;
404
         this.property.isSale = true;
408
         this.property.dateAvailable = new Date();
405
         this.property.dateAvailable = new Date();
409
       }
406
       }
410
-      if (this.images.length > 0) {
407
+      if (this.resImages.length > 0) {
411
         this.property.propertyImages = [];
408
         this.property.propertyImages = [];
412
       }
409
       }
413
       // eslint-disable-next-line no-plusplus
410
       // eslint-disable-next-line no-plusplus
414
-      for (let i = 0; i < this.images.length; i++) {
411
+      for (let i = 0; i < this.resImages.length; i++) {
415
         let setAsDefault = false;
412
         let setAsDefault = false;
416
-        if (i === this.defaultImage) {
413
+        if (i === this.resDefaultImage) {
417
           setAsDefault = true;
414
           setAsDefault = true;
418
         }
415
         }
419
         this.property.propertyImages.push({
416
         this.property.propertyImages.push({
420
-          image: this.images[i],
417
+          image: this.resImages[i],
421
           isDefault: setAsDefault
418
           isDefault: setAsDefault
422
         });
419
         });
423
       }
420
       }
424
-      this.property.propertyUserFields = this.propertyFieldValues;
425
-
426
-      if (this.user) {
427
-        this.property.userId = this.user.id;
421
+      this.property.propertyUserFields = this.resPropertyFieldValues;
422
+      this.property.propertyUserFields.forEach(field => {
423
+        if (field.type === "yesno") {
424
+          if (field.value) {
425
+            field.value = "true";
426
+          }
427
+        }
428
+      });
429
+      if (this.resUser) {
430
+        this.property.userId = this.resUser.id;
428
       }
431
       }
429
-      // this.property.propertyUserFields.forEach(item => {
430
-      //   if (item.value === true) {
431
-      //     item.value = "yes";
432
-      //   } else if (item.value === false) {
433
-      //     item.value = "no";
434
-      //   }
435
-      // });
432
+
436
       if (Log.getUser().role === "Agency" || Log.getUser().role === "Agent") {
433
       if (Log.getUser().role === "Agency" || Log.getUser().role === "Agent") {
437
         this.retrieveAgency().then(() => {
434
         this.retrieveAgency().then(() => {
438
           this.property.agentId = this.agent[0].id;
435
           this.property.agentId = this.agent[0].id;
440
         });
437
         });
441
       }
438
       }
442
       //console.log(this.property);
439
       //console.log(this.property);
440
+      //console.log(JSON.stringify(this.property));
443
       this.saveProperty(this.property)
441
       this.saveProperty(this.property)
444
         .then(fulfilled => {
442
         .then(fulfilled => {
445
           this.$router.push(`/property/residential/property/${fulfilled.data.id}`);
443
           this.$router.push(`/property/residential/property/${fulfilled.data.id}`);
459
     },
457
     },
460
     PropertyTypeSelected(item) {
458
     PropertyTypeSelected(item) {
461
       if (item.target.options.selectedIndex > 0) {
459
       if (item.target.options.selectedIndex > 0) {
462
-        this.showPropertyTypeError = false;
460
+        this.resShowPropertyTypeError = false;
463
       } else {
461
       } else {
464
-        this.showPropertyTypeError = true;
462
+        this.resShowPropertyTypeError = true;
465
       }
463
       }
466
     },
464
     },
467
     loadedImages(values) {
465
     loadedImages(values) {
468
-      this.images = values;
466
+      this.resImages = values;
469
     },
467
     },
470
     UpdateUserResidentialFields(item) {
468
     UpdateUserResidentialFields(item) {
471
       let update = false;
469
       let update = false;
472
-      this.propertyFieldValues.forEach(element => {
470
+
471
+      this.resPropertyFieldValues.forEach(element => {
473
         if (element.userDefinedFieldId === item.userDefinedFieldId) {
472
         if (element.userDefinedFieldId === item.userDefinedFieldId) {
474
-          element.value = item.value;
475
-          update = true;
473
+          if (item.type !== "yesno") {
474
+            element.value = item.value;
475
+            update = true;
476
+          } else {
477
+            if (item.value) {
478
+              element.value = "true";
479
+            } else {
480
+              element.value = "false";
481
+            }
482
+          }
476
         }
483
         }
477
       });
484
       });
478
       if (!update) {
485
       if (!update) {
479
-        this.propertyFieldValues.push(item);
486
+        this.resPropertyFieldValues.push(item);
480
       }
487
       }
481
     },
488
     },
482
     UpdateDefaultImage(item) {
489
     UpdateDefaultImage(item) {
483
-      this.defaultImage = item;
490
+      this.resDefaultImage = item;
484
     },
491
     },
485
     clearAddress() {
492
     clearAddress() {
486
-      this.addressSet = false;
493
+      this.resAddressSet = false;
487
       this.property.streetNumber = undefined;
494
       this.property.streetNumber = undefined;
488
       this.property.streetName = undefined;
495
       this.property.streetName = undefined;
489
       this.property.suburb = undefined;
496
       this.property.suburb = undefined;
506
     }
513
     }
507
   },
514
   },
508
   mounted() {
515
   mounted() {
509
-    this.wait = false;
516
+    this.resWait = false;
510
     this.getProperty(0);
517
     this.getProperty(0);
511
     this.clearPropertyImages();
518
     this.clearPropertyImages();
512
-    this.images = [];
513
-    this.defaultImage = 0;
519
+    this.resImages = [];
520
+    this.resDefaultImage = 0;
514
 
521
 
515
     if (this.propertyOverviewFields.length > 0) {
522
     if (this.propertyOverviewFields.length > 0) {
516
       this.propertyOverviewFields = [];
523
       this.propertyOverviewFields = [];
523
     }
530
     }
524
 
531
 
525
     if (this.$route.params.propertyUsageType) {
532
     if (this.$route.params.propertyUsageType) {
526
-      this.propertyType = this.$route.params.propertyUsageType;
533
+      this.resPropertyType = this.$route.params.propertyUsageType;
527
     }
534
     }
528
-    this.salesType = this.$route.params.saleType;
535
+    this.resSalesType = this.$route.params.saleType;
529
 
536
 
530
     this.getPropertyTypesRes();
537
     this.getPropertyTypesRes();
531
 
538
 
543
     ...mapState("authentication", ["user"]),
550
     ...mapState("authentication", ["user"]),
544
     ...mapGetters("fees", ["getListingFee"]),
551
     ...mapGetters("fees", ["getListingFee"]),
545
     ...mapState("register", ["agent"]),
552
     ...mapState("register", ["agent"]),
546
-    sortFields() {
547
-      return this.propertyFields[0].fields.sort((a, b) => (a.rank > b.rank ? 1 : -1));
548
-    },
549
     SalesTypeChanged() {
553
     SalesTypeChanged() {
550
-      // eslint-disable-next-line vue/no-side-effects-in-computed-properties
551
-      // this.propertyType = this.$route.params.propType;
552
-      // eslint-disable-next-line vue/no-side-effects-in-computed-properties
553
-      this.salesType = this.$route.params.saleType;
554
+      this.resSalesType = this.$route.params.saleType;
554
       if (this.property && this.property.propertyUsageType) {
555
       if (this.property && this.property.propertyUsageType) {
555
-        // eslint-disable-next-line vue/no-side-effects-in-computed-properties
556
-        this.propertyType = this.property.propertyUsageType;
556
+        this.resPropertyType = this.property.propertyUsageType;
557
       }
557
       }
558
-
559
       if (!this.$route.query.id) {
558
       if (!this.$route.query.id) {
560
-        this.getPropertyFields(this.propertyType);
559
+        this.getPropertyFields(this.resPropertyType);
561
       }
560
       }
562
-
563
-      return this.propertyType;
564
-    },
565
-    userFieldsArr() {
566
-      return this.userFieldsArrFunc(this.propertyFields, 4);
561
+      return this.resPropertyType;
567
     }
562
     }
568
   },
563
   },
569
   watch: {
564
   watch: {

+ 5
- 22
src/components/property/residential/singleView/contentSection.vue View File

122
               <div class="col-md-4">
122
               <div class="col-md-4">
123
                 <button
123
                 <button
124
                   style="float:right; white-space: nowrap;"
124
                   style="float:right; white-space: nowrap;"
125
-                  :class="checkStatus() ? 'btn-disabled mt-3' : 'btn-solid-blue mt-3'"
126
-                  :disabled="checkStatus()"
125
+                  :class="status ? 'btn-disabled mt-3' : 'btn-solid-blue mt-3'"
126
+                  :disabled="status"
127
                   @click="goToSingle()"
127
                   @click="goToSingle()"
128
                 >
128
                 >
129
                   ENQUIRE NOW
129
                   ENQUIRE NOW
188
   },
188
   },
189
   props: {
189
   props: {
190
     property: {},
190
     property: {},
191
-    propertyImages: {}
191
+    propertyImages: {},
192
+    status: {}
192
   },
193
   },
193
   async mounted() {
194
   async mounted() {
194
     await this.checkForVideos;
195
     await this.checkForVideos;
203
   },
204
   },
204
   methods: {
205
   methods: {
205
     //...mapActions("searchTab", ["getListsForPropertyEdit"])
206
     //...mapActions("searchTab", ["getListsForPropertyEdit"])
206
-    ...mapActions("status", ["getSingleStatus"]),
207
+
207
     checkForVideos() {
208
     checkForVideos() {
208
       if (this.property.video === "") {
209
       if (this.property.video === "") {
209
         this.property.video = null;
210
         this.property.video = null;
214
     },
215
     },
215
     goToSingle() {
216
     goToSingle() {
216
       this.$router.push({ name: "EnquireNow", params: { id: this.$route.params.id } });
217
       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
-      }
229
     }
218
     }
230
   },
219
   },
231
   computed: {
220
   computed: {
232
     //...mapState("searchTab", ["provinces", "cities", "suburbs"]),
221
     //...mapState("searchTab", ["provinces", "cities", "suburbs"]),
233
-    ...mapState("status", ["singleStatus"]),
234
     propertyMap() {
222
     propertyMap() {
235
       if (this.property.propertCoords) {
223
       if (this.property.propertCoords) {
236
         var lat = this.property.propertCoords.split(",")[0];
224
         var lat = this.property.propertCoords.split(",")[0];
246
       }
234
       }
247
       return "";
235
       return "";
248
     },
236
     },
249
-    propertyFeatures() {
250
-      this.property.displayData.forEach(data => {
251
-        console.log(data);
252
-      });
253
-    },
254
     Images() {
237
     Images() {
255
       const list = [];
238
       const list = [];
256
       for (let i = 0; i < this.propertyImages.length; i++) {
239
       for (let i = 0; i < this.propertyImages.length; i++) {

+ 16
- 24
src/components/property/residential/singleView/singleResidentialPage.vue View File

1
 <template>
1
 <template>
2
   <div>
2
   <div>
3
-    <!-- <carouselSection :propertyImages="propertyImages" @Loaded="CarouselDone" /> -->
4
     <main id="main" style="margin-top: 20px">
3
     <main id="main" style="margin-top: 20px">
5
-      <contentSection
6
-        :property="property"
7
-        :propertyImages="propertyImages"
8
-        @Loaded="ContentDone"
9
-      />
4
+      <contentSection :property="property" :propertyImages="propertyImages" :status="checkStatus" />
10
     </main>
5
     </main>
11
-    <div v-if="Wait" id="preloader"></div>
6
+    <div v-if="wait" id="preloader"></div>
12
   </div>
7
   </div>
13
 </template>
8
 </template>
14
 
9
 
24
   name: "property",
19
   name: "property",
25
   components: {
20
   components: {
26
     makeOffer,
21
     makeOffer,
27
-    contentSection,
22
+    contentSection
28
   },
23
   },
29
   data() {
24
   data() {
30
     return {
25
     return {
31
       index: null,
26
       index: null,
32
       date: new Date(),
27
       date: new Date(),
33
       boolLoaded: false,
28
       boolLoaded: false,
34
-      wait: false,
35
-      contentloaded: false,
29
+      wait: true
36
     };
30
     };
37
   },
31
   },
38
   mounted() {
32
   mounted() {
39
     this.clearPropertyImages();
33
     this.clearPropertyImages();
40
-    this.getDisplayProperty(this.$route.params.id).then((data) => {
34
+    this.getDisplayProperty(this.$route.params.id).then(data => {
41
       this.wait = false;
35
       this.wait = false;
42
     });
36
     });
43
   },
37
   },
44
   computed: {
38
   computed: {
45
     ...mapState("property", ["property", "propertyImages"]),
39
     ...mapState("property", ["property", "propertyImages"]),
46
-    Wait() {
47
-      if (this.wait && !this.contentloaded) {
40
+    checkStatus() {
41
+      if (
42
+        this.property.statusCode === "CIP" ||
43
+        this.property.statusCode === "S" ||
44
+        this.property.statusCode === "P"
45
+      ) {
48
         return true;
46
         return true;
47
+      } else {
48
+        return false;
49
       }
49
       }
50
-      return false;
51
-    },
50
+    }
52
   },
51
   },
53
   methods: {
52
   methods: {
54
     ...mapActions("property", ["getDisplayProperty", "clearPropertyImages"]),
53
     ...mapActions("property", ["getDisplayProperty", "clearPropertyImages"]),
55
     ...mapActions("propertyEdit", ["mayEditProperty"]),
54
     ...mapActions("propertyEdit", ["mayEditProperty"]),
56
-
57
     formatPrice(value) {
55
     formatPrice(value) {
58
       const val = (value / 1).toFixed(2);
56
       const val = (value / 1).toFixed(2);
59
       return val.toString().replace(/\B(?=(\d{3})+(?!\d))/g, " ");
57
       return val.toString().replace(/\B(?=(\d{3})+(?!\d))/g, " ");
63
         return `${value}<br/>`;
61
         return `${value}<br/>`;
64
       }
62
       }
65
       return "";
63
       return "";
66
-    },
67
-    CarouselDone() {
68
-      this.carouselLoaded = true;
69
-    },
70
-    ContentDone() {
71
-      this.contentloaded = true;
72
-    },
64
+    }
73
   },
65
   },
74
   beforeDestroy() {
66
   beforeDestroy() {
75
     this.clearPropertyImages();
67
     this.clearPropertyImages();
76
-  },
68
+  }
77
 };
69
 };
78
 </script>
70
 </script>
79
 
71
 

+ 15
- 0
src/components/timeshare/sell/contentSectionNew.vue View File

332
                     type="text"
332
                     type="text"
333
                     name="name"
333
                     name="name"
334
                     class="form-control"
334
                     class="form-control"
335
+                    :disabled="ChangeCustomUser"
335
                     id="name"
336
                     id="name"
336
                     placeholder="Name"
337
                     placeholder="Name"
337
                     data-rule="minlen:4"
338
                     data-rule="minlen:4"
347
                   <input
348
                   <input
348
                     type="text"
349
                     type="text"
349
                     class="form-control"
350
                     class="form-control"
351
+                    :disabled="ChangeCustomUser"
350
                     name="surname"
352
                     name="surname"
351
                     id="surname"
353
                     id="surname"
352
                     placeholder="Surname"
354
                     placeholder="Surname"
365
                     type="text"
367
                     type="text"
366
                     name="idnum"
368
                     name="idnum"
367
                     class="form-control"
369
                     class="form-control"
370
+                    :disabled="ChangeCustomUser"
368
                     id="idnum"
371
                     id="idnum"
369
                     placeholder="ID Number"
372
                     placeholder="ID Number"
370
                     data-rule="minlen:4"
373
                     data-rule="minlen:4"
380
                   <input
383
                   <input
381
                     type="text"
384
                     type="text"
382
                     class="form-control"
385
                     class="form-control"
386
+                    :disabled="ChangeCustomUser"
383
                     name="company"
387
                     name="company"
384
                     id="company"
388
                     id="company"
385
                     placeholder="Company Reg Number"
389
                     placeholder="Company Reg Number"
405
                     <select
409
                     <select
406
                       class="form-control uniSelect"
410
                       class="form-control uniSelect"
407
                       id="howMarried"
411
                       id="howMarried"
412
+                      :disabled="ChangeCustomUser"
408
                       v-model="indiv.howMarried"
413
                       v-model="indiv.howMarried"
409
                     >
414
                     >
410
                       <option v-bind:value="0">N/A</option>
415
                       <option v-bind:value="0">N/A</option>
428
                     type="text"
433
                     type="text"
429
                     class="form-control"
434
                     class="form-control"
430
                     name="email"
435
                     name="email"
436
+                    :disabled="ChangeCustomUser"
431
                     id="email"
437
                     id="email"
432
                     placeholder="Email Address"
438
                     placeholder="Email Address"
433
                     data-msg="Please enter your email address"
439
                     data-msg="Please enter your email address"
445
                     type="text"
451
                     type="text"
446
                     name="cell"
452
                     name="cell"
447
                     class="form-control"
453
                     class="form-control"
454
+                    :disabled="ChangeCustomUser"
448
                     id="cell"
455
                     id="cell"
449
                     placeholder="Cell Number"
456
                     placeholder="Cell Number"
450
                     data-rule="minlen:4"
457
                     data-rule="minlen:4"
460
                   <input
467
                   <input
461
                     type="text"
468
                     type="text"
462
                     class="form-control"
469
                     class="form-control"
470
+                    :disabled="ChangeCustomUser"
463
                     name="landline"
471
                     name="landline"
464
                     id="landline"
472
                     id="landline"
465
                     placeholder="Landline Number"
473
                     placeholder="Landline Number"
972
       });
980
       });
973
       return notDeletedArr;
981
       return notDeletedArr;
974
     },
982
     },
983
+    ChangeCustomUser() {
984
+      if (this.selectedUserType === "myself") {
985
+        return true;
986
+      } else {
987
+        return false;
988
+      }
989
+    },
975
     CanSave() {
990
     CanSave() {
976
       if (this.indiv.howMarried === "In Community Of Property") {
991
       if (this.indiv.howMarried === "In Community Of Property") {
977
         if (this.indiv.spouseName || this.indiv.spouseSurname || this.spouseEmail) {
992
         if (this.indiv.spouseName || this.indiv.spouseSurname || this.spouseEmail) {

+ 2
- 2
src/router/index.js View File

23
 import PropertyEdit from "../components/property/editProperty/editProperty.vue";
23
 import PropertyEdit from "../components/property/editProperty/editProperty.vue";
24
 
24
 
25
 import PropertyCreate from "../components/property/propertyCreate.vue";
25
 import PropertyCreate from "../components/property/propertyCreate.vue";
26
-import CommercialCreate from "../components/property/commercial/createProperty/commercialCreate.vue";
27
-import ResidentialCreate from "../components/property/residential/createProperty/residentialCreate.vue";
26
+import CommercialCreate from "../components/property/commercial/createProperty/commercialCreateNew.vue";
27
+import ResidentialCreate from "../components/property/residential/createProperty/residentialCreateNew.vue";
28
 import ListProperty from "../components/property/ListProperty/listPropertyPage.vue";
28
 import ListProperty from "../components/property/ListProperty/listPropertyPage.vue";
29
 
29
 
30
 import PropertyAdminList from "../components/admin/property/propertyAdmin.vue";
30
 import PropertyAdminList from "../components/admin/property/propertyAdmin.vue";

+ 1
- 0
src/store/modules/property/property.js View File

97
         .catch(ex => console.log(ex.response));
97
         .catch(ex => console.log(ex.response));
98
     },
98
     },
99
     getSavedPropertyImages({ commit }, id) {
99
     getSavedPropertyImages({ commit }, id) {
100
+      console.log(id);
100
       axios
101
       axios
101
         .get(`/api/PropertyImage/GetProperySavedImages/${id}`)
102
         .get(`/api/PropertyImage/GetProperySavedImages/${id}`)
102
         .then(result => commit("setPropertyImages", result.data))
103
         .then(result => commit("setPropertyImages", result.data))

Loading…
Cancel
Save