Browse Source

Fix to Merge

master
George Williams 4 years ago
parent
commit
dd54dabe0a

+ 49
- 37
src/components/property/residential/createProperty/residentialCreateNew.vue View File

51
               @change="PropertyTypeSelected"
51
               @change="PropertyTypeSelected"
52
             >
52
             >
53
               <option value="0">Please select type *</option>
53
               <option value="0">Please select type *</option>
54
-              <option v-for="item in propertyTypes" :value="item.id" :key="item.id">
55
-                {{ item.description }}
56
-              </option>
54
+              <option
55
+                v-for="item in propertyTypes"
56
+                :value="item.id"
57
+                :key="item.id"
58
+              >{{ item.description }}</option>
57
             </select>
59
             </select>
58
           </div>
60
           </div>
59
         </div>
61
         </div>
75
                     for="price"
77
                     for="price"
76
                     class="uniSelectLabel"
78
                     class="uniSelectLabel"
77
                     style="text-transform:uppercase; margin-left:17px; background-color:white"
79
                     style="text-transform:uppercase; margin-left:17px; background-color:white"
78
-                    >{{ salesType }} Price</label
79
-                  >
80
+                  >{{ salesType }} Price</label>
80
                 </div>
81
                 </div>
81
                 <float-label label="Price">
82
                 <float-label label="Price">
82
-                  <currency-input <<<<<<< HEAD ======= onclick="this.setSelectionRange(0,
83
-                  this.value.length)" >>>>>>> 6bbfd86e089da859d019dcbda5cc0fe053af8db2 name="price"
84
-                  :value="property.price" @input="property.price = $event" v-model="property.price"
85
-                  id="price" class="form-control uniInput" />
83
+                  <currency-input
84
+                    onclick="this.setSelectionRange(0, this.value.length)"
85
+                    name="price"
86
+                    :value="property.price"
87
+                    @input="property.price = $event"
88
+                    v-model="property.price"
89
+                    id="price"
90
+                    class="form-control uniInput"
91
+                  />
86
                 </float-label>
92
                 </float-label>
87
               </div>
93
               </div>
88
               <div v-if="salesType === 'Rental'" class="col-md-6">
94
               <div v-if="salesType === 'Rental'" class="col-md-6">
211
             </div>
217
             </div>
212
             <div class="row my-3">
218
             <div class="row my-3">
213
               <div class="col-md-12">
219
               <div class="col-md-12">
214
-                <button type="button" @click="clearAddress()" class="btn-solid-blue">
215
-                  Clear Address
216
-                </button>
220
+                <button type="button" @click="clearAddress()" class="btn-solid-blue">Clear Address</button>
217
               </div>
221
               </div>
218
             </div>
222
             </div>
219
           </div>
223
           </div>
249
           :fields="propertyOverviewFields[0].fields"
253
           :fields="propertyOverviewFields[0].fields"
250
           @UpdateUserDefinedFields="UpdateUserDefinedFields"
254
           @UpdateUserDefinedFields="UpdateUserDefinedFields"
251
           :id="1"
255
           :id="1"
252
-        ></UserField> -->
256
+        ></UserField>-->
253
         <!-- <div class="row">
257
         <!-- <div class="row">
254
           <div class="col-md-12">
258
           <div class="col-md-12">
255
             <div v-for="item in propertyFields" :key="item.id">
259
             <div v-for="item in propertyFields" :key="item.id">
322
           :savedImages="propertyImages"
326
           :savedImages="propertyImages"
323
           @DefaultImage="UpdateDefaultImage"
327
           @DefaultImage="UpdateDefaultImage"
324
         />
328
         />
325
-        <button v-if="!wait" type="button" @click="SubmitData()" class="btn-solid-blue">
326
-          Save
327
-        </button>
329
+        <button v-if="!wait" type="button" @click="SubmitData()" class="btn-solid-blue">Save</button>
328
         <div v-if="showPropertyTypeError">
330
         <div v-if="showPropertyTypeError">
329
-          <p class="alert myError">
330
-            Missing fields. Please fill in all required fields. Marked with *
331
-          </p>
331
+          <p class="alert myError">Missing fields. Please fill in all required fields. Marked with *</p>
332
         </div>
332
         </div>
333
         <div v-if="wait" id="preloader"></div>
333
         <div v-if="wait" id="preloader"></div>
334
       </div>
334
       </div>
353
     ImageLoad,
353
     ImageLoad,
354
     VueEditor,
354
     VueEditor,
355
     carouselSection,
355
     carouselSection,
356
-    mapSection
356
+    mapSection,
357
   },
357
   },
358
   data() {
358
   data() {
359
     return {
359
     return {
366
       customToolbar: [
366
       customToolbar: [
367
         [{ header: [false, 1, 2, 3, 4, 5, 6] }],
367
         [{ header: [false, 1, 2, 3, 4, 5, 6] }],
368
         ["bold", "italic", "underline", "strike"],
368
         ["bold", "italic", "underline", "strike"],
369
-        [{ align: "" }, { align: "center" }, { align: "right" }, { align: "justify" }],
369
+        [
370
+          { align: "" },
371
+          { align: "center" },
372
+          { align: "right" },
373
+          { align: "justify" },
374
+        ],
370
         [{ list: "ordered" }, { list: "bullet" }, { list: "check" }],
375
         [{ list: "ordered" }, { list: "bullet" }, { list: "check" }],
371
         [{ script: "sub" }, { script: "super" }],
376
         [{ script: "sub" }, { script: "super" }],
372
-        [{ indent: "-1" }, { indent: "+1" }]
377
+        [{ indent: "-1" }, { indent: "+1" }],
373
       ],
378
       ],
374
       error: "",
379
       error: "",
375
       addressSet: false,
380
       addressSet: false,
376
       showPropertyTypeError: false,
381
       showPropertyTypeError: false,
377
       showDateError: false,
382
       showDateError: false,
378
       user: Log.getUser(),
383
       user: Log.getUser(),
379
-      mayEdit: Log.isLoggedIn()
384
+      mayEdit: Log.isLoggedIn(),
380
     };
385
     };
381
   },
386
   },
382
   methods: {
387
   methods: {
391
       "getPropertyEditDisplay",
396
       "getPropertyEditDisplay",
392
       "getPropertySavedOverviewFields",
397
       "getPropertySavedOverviewFields",
393
       "getPropertySavedFields",
398
       "getPropertySavedFields",
394
-      "getSavedPropertyData"
399
+      "getSavedPropertyData",
395
     ]),
400
     ]),
396
     updateLocation(place) {
401
     updateLocation(place) {
397
       this.addressSet = true;
402
       this.addressSet = true;
413
         this.showPropertyTypeError = true;
418
         this.showPropertyTypeError = true;
414
       }
419
       }
415
 
420
 
416
-      if (this.salesType === "Rental" && this.property.dateAvailable === "undef") {
421
+      if (
422
+        this.salesType === "Rental" &&
423
+        this.property.dateAvailable === "undef"
424
+      ) {
417
         this.showDateError = true;
425
         this.showDateError = true;
418
       }
426
       }
419
 
427
 
437
         }
445
         }
438
         this.property.propertyImages.push({
446
         this.property.propertyImages.push({
439
           image: this.images[i],
447
           image: this.images[i],
440
-          isDefault: setAsDefault
448
+          isDefault: setAsDefault,
441
         });
449
         });
442
       }
450
       }
443
       this.property.propertyUserFields = this.propertyFieldValues;
451
       this.property.propertyUserFields = this.propertyFieldValues;
445
       if (this.user) {
453
       if (this.user) {
446
         this.property.userId = this.user.id;
454
         this.property.userId = this.user.id;
447
       }
455
       }
448
-      this.property.propertyUserFields.forEach(item => {
456
+      this.property.propertyUserFields.forEach((item) => {
449
         if (item.value === true) {
457
         if (item.value === true) {
450
           item.value = "yes";
458
           item.value = "yes";
451
         } else if (item.value === false) {
459
         } else if (item.value === false) {
454
       });
462
       });
455
 
463
 
456
       this.saveProperty(this.property)
464
       this.saveProperty(this.property)
457
-        .then(fulfilled => {
458
-          this.$router.push(`/property/residential/property/${fulfilled.data.id}`);
465
+        .then((fulfilled) => {
466
+          this.$router.push(
467
+            `/property/residential/property/${fulfilled.data.id}`
468
+          );
459
         })
469
         })
460
-        .catch(error => {
470
+        .catch((error) => {
461
           console.log(error.message);
471
           console.log(error.message);
462
         });
472
         });
463
     },
473
     },
479
     },
489
     },
480
     UpdateUserDefinedFields(item) {
490
     UpdateUserDefinedFields(item) {
481
       let update = false;
491
       let update = false;
482
-      this.propertyFieldValues.forEach(element => {
492
+      this.propertyFieldValues.forEach((element) => {
483
         console.log(element);
493
         console.log(element);
484
 
494
 
485
         if (element.userDefinedFieldId === item.userDefinedFieldId) {
495
         if (element.userDefinedFieldId === item.userDefinedFieldId) {
515
         fields.push(arr.slice(i, (i += len)));
525
         fields.push(arr.slice(i, (i += len)));
516
       }
526
       }
517
       return fields;
527
       return fields;
518
-    }
528
+    },
519
   },
529
   },
520
   mounted() {
530
   mounted() {
521
     console.log(this.propertyFields);
531
     console.log(this.propertyFields);
552
       "propertyOverviewFields",
562
       "propertyOverviewFields",
553
       "propertyFields",
563
       "propertyFields",
554
       "property",
564
       "property",
555
-      "propertyImages"
565
+      "propertyImages",
556
     ]),
566
     ]),
557
     ...mapState("authentication", ["user"]),
567
     ...mapState("authentication", ["user"]),
558
     ...mapGetters("fees", ["getListingFee"]),
568
     ...mapGetters("fees", ["getListingFee"]),
559
     sortFields() {
569
     sortFields() {
560
-      return this.propertyFields[0].fields.sort((a, b) => (a.rank > b.rank ? 1 : -1));
570
+      return this.propertyFields[0].fields.sort((a, b) =>
571
+        a.rank > b.rank ? 1 : -1
572
+      );
561
     },
573
     },
562
     SalesTypeChanged() {
574
     SalesTypeChanged() {
563
       // eslint-disable-next-line vue/no-side-effects-in-computed-properties
575
       // eslint-disable-next-line vue/no-side-effects-in-computed-properties
577
     },
589
     },
578
     userFieldsArr() {
590
     userFieldsArr() {
579
       return this.userFieldsArrFunc(this.propertyFields, 4);
591
       return this.userFieldsArrFunc(this.propertyFields, 4);
580
-    }
592
+    },
581
   },
593
   },
582
   watch: {
594
   watch: {
583
     SalesTypeChanged() {
595
     SalesTypeChanged() {
584
       return null;
596
       return null;
585
-    }
586
-  }
597
+    },
598
+  },
587
 };
599
 };
588
 </script>
600
 </script>
589
 
601
 

+ 22
- 22
src/components/timeshare/sell/contentSection.vue View File

843
   name: "TimeshareToSell",
843
   name: "TimeshareToSell",
844
   props: {
844
   props: {
845
     weekId: {
845
     weekId: {
846
-      default: 0
847
-    }
846
+      default: 0,
847
+    },
848
   },
848
   },
849
   data() {
849
   data() {
850
     return {
850
     return {
851
       wait: false,
851
       wait: false,
852
-      userLoggedIn: Log.isLoggedIn()
852
+      userLoggedIn: Log.isLoggedIn(),
853
     };
853
     };
854
   },
854
   },
855
   components: {
855
   components: {
856
     addressAutoComplete,
856
     addressAutoComplete,
857
-    Alert
857
+    Alert,
858
   },
858
   },
859
   mounted() {
859
   mounted() {
860
     if (this.sellItem.id) {
860
     if (this.sellItem.id) {
880
       "sellItem",
880
       "sellItem",
881
       "agencies",
881
       "agencies",
882
       "agents",
882
       "agents",
883
-      "getTemplate"
883
+      "getTemplate",
884
     ]),
884
     ]),
885
     ...mapState("individual", ["indiv"]),
885
     ...mapState("individual", ["indiv"]),
886
     ...mapState("authentication", ["isLoggedIn"]),
886
     ...mapState("authentication", ["isLoggedIn"]),
887
     ...mapGetters({
887
     ...mapGetters({
888
       user: "authentication/getUser",
888
       user: "authentication/getUser",
889
-      person: "authentication/getPerson"
889
+      person: "authentication/getPerson",
890
     }),
890
     }),
891
     ...mapState("bank", ["banks"]),
891
     ...mapState("bank", ["banks"]),
892
     refAgent() {
892
     refAgent() {
901
         this.sellItem.region.regionCode
901
         this.sellItem.region.regionCode
902
       ) {
902
       ) {
903
         const item = this.detailedRegion.find(
903
         const item = this.detailedRegion.find(
904
-          region => region.region.regionCode === this.sellItem.region.regionCode
904
+          (region) =>
905
+            region.region.regionCode === this.sellItem.region.regionCode
905
         );
906
         );
906
         if (item) {
907
         if (item) {
907
           list = item.children;
908
           list = item.children;
909
       } else {
910
       } else {
910
         list = this.resorts;
911
         list = this.resorts;
911
       }
912
       }
912
-      return _.sortBy(list, x => x.resortName);
913
+      return _.sortBy(list, (x) => x.resortName);
913
     },
914
     },
914
     isLoggedIn() {
915
     isLoggedIn() {
915
       return this.user && this.person;
916
       return this.user && this.person;
916
     },
917
     },
917
     displayNotDeletedAgents() {
918
     displayNotDeletedAgents() {
918
       var notDeletedArr = [];
919
       var notDeletedArr = [];
919
-      this.agents.forEach(agent => {
920
+      this.agents.forEach((agent) => {
920
         if (!agent.isDeleted) {
921
         if (!agent.isDeleted) {
921
           if (agent.agencyId === this.sellItem.agencyId) {
922
           if (agent.agencyId === this.sellItem.agencyId) {
922
             notDeletedArr.push(agent);
923
             notDeletedArr.push(agent);
937
         return false;
938
         return false;
938
       }
939
       }
939
       return true;
940
       return true;
940
-    }
941
+    },
941
   },
942
   },
942
   methods: {
943
   methods: {
943
     ...mapActions("individual", ["getIndividual"]),
944
     ...mapActions("individual", ["getIndividual"]),
945
       "initTimeshare",
946
       "initTimeshare",
946
       "onResortChange",
947
       "onResortChange",
947
       "saveWeek",
948
       "saveWeek",
948
-      "getBlankWeek"
949
+      "getBlankWeek",
949
     ]),
950
     ]),
950
     ...mapActions("payment", ["addPayment"]),
951
     ...mapActions("payment", ["addPayment"]),
951
     ...mapActions("bank", ["getBanks"]),
952
     ...mapActions("bank", ["getBanks"]),
957
       if (this.userLoggedIn) {
958
       if (this.userLoggedIn) {
958
         this.sellItem.ownerObject = this.indiv;
959
         this.sellItem.ownerObject = this.indiv;
959
         this.sellItem.status = undefined;
960
         this.sellItem.status = undefined;
960
-        console.log(this.sellItem);
961
-        //   this.saveWeek(this.sellItem).then(fulfilled => {
962
-        //     this.paygateRedirect();
963
-        //   });
961
+        this.saveWeek(this.sellItem).then((fulfilled) => {
962
+          this.paygateRedirect();
963
+        });
964
       }
964
       }
965
     },
965
     },
966
     paygateRedirect() {
966
     paygateRedirect() {
971
         creatydById: Log.getUser().id, //Log.getUser().id,
971
         creatydById: Log.getUser().id, //Log.getUser().id,
972
         amount: amount,
972
         amount: amount,
973
         paymentStatus: "",
973
         paymentStatus: "",
974
-        paymentToken: ""
974
+        paymentToken: "",
975
       };
975
       };
976
 
976
 
977
-      this.addPayment(paymentObj).then(res => {
977
+      this.addPayment(paymentObj).then((res) => {
978
         this.$router.push({
978
         this.$router.push({
979
           name: "PaymentGateway",
979
           name: "PaymentGateway",
980
           params: {
980
           params: {
981
             paymentReqId: res.PAY_REQUEST_ID,
981
             paymentReqId: res.PAY_REQUEST_ID,
982
-            checksum: res.CHECKSUM
983
-          }
982
+            checksum: res.CHECKSUM,
983
+          },
984
         });
984
         });
985
       });
985
       });
986
     },
986
     },
1005
     resortChange() {
1005
     resortChange() {
1006
       this.onResortChange({
1006
       this.onResortChange({
1007
         resortName: this.sellItem.resort.resortName,
1007
         resortName: this.sellItem.resort.resortName,
1008
-        resortCode: this.sellItem.resort.resortCode
1008
+        resortCode: this.sellItem.resort.resortCode,
1009
       });
1009
       });
1010
 
1010
 
1011
       if (this.sellItem && this.sellItem.resort === "Other") {
1011
       if (this.sellItem && this.sellItem.resort === "Other") {
1035
       } else {
1035
       } else {
1036
         this.sellItem.mandateDate = undefined;
1036
         this.sellItem.mandateDate = undefined;
1037
       }
1037
       }
1038
-    }
1039
-  }
1038
+    },
1039
+  },
1040
 };
1040
 };
1041
 </script>
1041
 </script>
1042
 
1042
 

Loading…
Cancel
Save