30117125 4 lat temu
rodzic
commit
79123394fa

+ 9
- 7
src/App.vue Wyświetl plik

20
   name: "app",
20
   name: "app",
21
   data() {
21
   data() {
22
     return {
22
     return {
23
-      isLandingPage: false
23
+      isLandingPage: false,
24
     };
24
     };
25
   },
25
   },
26
   components: {
26
   components: {
27
     NavBar,
27
     NavBar,
28
-    FooterSection
28
+    FooterSection,
29
   },
29
   },
30
 
30
 
31
   methods: {
31
   methods: {
34
     },
34
     },
35
     setLandingPage(item) {
35
     setLandingPage(item) {
36
       this.isLandingPage = item;
36
       this.isLandingPage = item;
37
-    }
38
-  }
37
+    },
38
+  },
39
 };
39
 };
40
 </script>
40
 </script>
41
 
41
 
123
   width: 100px;
123
   width: 100px;
124
 }
124
 }
125
 .top-left {
125
 .top-left {
126
-  position: absolute;
127
-  top: 8px;
128
-  width: 350px;
126
+  position: centre;
127
+  top: 5px;
128
+  width: 380px;
129
   color: white;
129
   color: white;
130
 }
130
 }
131
 .normalText {
131
 .normalText {
132
   background-color: #60cbeb;
132
   background-color: #60cbeb;
133
+  color: white;
133
 }
134
 }
134
 .pendingOffer {
135
 .pendingOffer {
135
   background-color: #ff8344;
136
   background-color: #ff8344;
137
+  color: white;
136
 }
138
 }
137
 .noWeeks {
139
 .noWeeks {
138
   background-color: #ff4444;
140
   background-color: #ff4444;

+ 11
- 5
src/components/admin/status/editTimeShareAdminPage.vue Wyświetl plik

72
                   <select
72
                   <select
73
                     id="weekInfoRegionSelect"
73
                     id="weekInfoRegionSelect"
74
                     class="form-control uniSelect"
74
                     class="form-control uniSelect"
75
-                    v-model="sellItem.region"
76
-                    @change="regionChange()"
75
+                    v-model="week.region"
77
                     style="font-size: 15px"
76
                     style="font-size: 15px"
78
                   >
77
                   >
79
                     <option v-for="(region, r) in regions" :key="r" :value="region">{{
78
                     <option v-for="(region, r) in regions" :key="r" :value="region">{{
504
               </div>
503
               </div>
505
             </div>
504
             </div>
506
             <div class="text-center col-12" v-if="CanSave">
505
             <div class="text-center col-12" v-if="CanSave">
507
-              <button class="btn-solid-blue" v-if="!sellItem.id" @click="submitSale()">
506
+              <button class="btn-solid-blue">
508
                 Save
507
                 Save
509
               </button>
508
               </button>
510
             </div>
509
             </div>
511
             <div class="text-center col-12">
510
             <div class="text-center col-12">
512
-              <button class="btn-solid-blue" @click="paygateRedirect()">Back</button>
511
+              <button class="btn-solid-blue" v-on:click="backToListView()">Back</button>
513
             </div>
512
             </div>
514
             <br />
513
             <br />
515
             <br />
514
             <br />
544
     return {
543
     return {
545
       wait: false,
544
       wait: false,
546
       userLoggedIn: Log.isLoggedIn(),
545
       userLoggedIn: Log.isLoggedIn(),
547
-      listedWeekId: this.$route.params.id
546
+      listedWeekId: this.$route.params.id,
547
+      selectedItems: [],
548
     };
548
     };
549
   },
549
   },
550
   components: {
550
   components: {
558
     this.initTimeshare(0);
558
     this.initTimeshare(0);
559
     this.getIndividual(Log.getUser().id);
559
     this.getIndividual(Log.getUser().id);
560
     this.getBanks();
560
     this.getBanks();
561
+    this.getWeek(this.$route.params.id)
561
   },
562
   },
562
   created() {
563
   created() {
563
     this.initTimeshare(this.weekId);
564
     this.initTimeshare(this.weekId);
579
     ]),
580
     ]),
580
     ...mapState("individual", ["indiv"]),
581
     ...mapState("individual", ["indiv"]),
581
     ...mapState("authentication", ["isLoggedIn"]),
582
     ...mapState("authentication", ["isLoggedIn"]),
583
+    ...mapState("myWeeks", ["items", "week"]),
582
     ...mapGetters({
584
     ...mapGetters({
583
       user: "authentication/getUser",
585
       user: "authentication/getUser",
584
       person: "authentication/getPerson"
586
       person: "authentication/getPerson"
630
     ...mapActions("timeshare", ["initTimeshare", "onResortChange", "saveWeek", "getBlankWeek"]),
632
     ...mapActions("timeshare", ["initTimeshare", "onResortChange", "saveWeek", "getBlankWeek"]),
631
     ...mapActions("payment", ["addPayment"]),
633
     ...mapActions("payment", ["addPayment"]),
632
     ...mapActions("bank", ["getBanks"]),
634
     ...mapActions("bank", ["getBanks"]),
635
+    ...mapActions("myWeeks", ["getItems", "getWeek"]),
633
     newSale() {
636
     newSale() {
634
       this.weekId = 0;
637
       this.weekId = 0;
635
       this.getBlankWeek();
638
       this.getBlankWeek();
712
       } else {
715
       } else {
713
         this.sellItem.mandateDate = undefined;
716
         this.sellItem.mandateDate = undefined;
714
       }
717
       }
718
+    },
719
+    backToListView() {
720
+      this.$router.push("/status/timeshareAdmin");
715
     }
721
     }
716
   }
722
   }
717
 };
723
 };

+ 7
- 9
src/components/property/commercial/latestListings.vue Wyświetl plik

12
         <div class="row">
12
         <div class="row">
13
           <div class="col">
13
           <div class="col">
14
             <propertyCard
14
             <propertyCard
15
-              v-if="properties.length > 0"
15
+              v-if="latestProperties.length > 0"
16
               name="propertyholder"
16
               name="propertyholder"
17
-              :properties="properties"
17
+              :properties="latestProperties"
18
               :showSort="false"
18
               :showSort="false"
19
             />
19
             />
20
           </div>
20
           </div>
30
 import propertyCard from "../propertyCard";
30
 import propertyCard from "../propertyCard";
31
 export default {
31
 export default {
32
   components: {
32
   components: {
33
-    propertyCard
33
+    propertyCard,
34
   },
34
   },
35
   methods: {
35
   methods: {
36
-    ...mapActions("propertySearch", ["searchProperties"])
36
+    ...mapActions("propertySearch", ["searchLatestPropertiesType"]),
37
   },
37
   },
38
   mounted() {
38
   mounted() {
39
-    this.propertySearch.propertyUsageType = "Commercial";
40
-
41
-    this.searchProperties(this.propertySearch);
39
+    this.searchLatestPropertiesType("Commercial");
42
   },
40
   },
43
   computed: {
41
   computed: {
44
-    ...mapState("propertySearch", ["properties", "propertySearch"])
45
-  }
42
+    ...mapState("propertySearch", ["latestProperties"]),
43
+  },
46
 };
44
 };
47
 </script>
45
 </script>
48
 
46
 

+ 85
- 8
src/components/property/editProperty/editProperty.vue Wyświetl plik

14
                     class="form-control uniSelect"
14
                     class="form-control uniSelect"
15
                     v-model="property.propertyUsageType"
15
                     v-model="property.propertyUsageType"
16
                     @change="UpdateUsageType"
16
                     @change="UpdateUsageType"
17
+                    :disabled="!canEdit"
17
                   >
18
                   >
18
                     <option>Commercial</option>
19
                     <option>Commercial</option>
19
                     <option>Residential</option>
20
                     <option>Residential</option>
20
                   </select>
21
                   </select>
21
                 </div>
22
                 </div>
22
                 <div class="col-md-6">
23
                 <div class="col-md-6">
23
-                  <select class="form-control uniSelect" v-model="property.statusString">
24
+                  <select
25
+                    class="form-control uniSelect"
26
+                    v-model="property.statusString"
27
+                    @change="StatusChanged"
28
+                  >
24
                     <option v-for="(item, i) in statuses" :key="i">{{ item }}</option>
29
                     <option v-for="(item, i) in statuses" :key="i">{{ item }}</option>
25
                   </select>
30
                   </select>
26
                 </div>
31
                 </div>
35
                     type="text"
40
                     type="text"
36
                     name="propertyName"
41
                     name="propertyName"
37
                     v-model="property.propertyName"
42
                     v-model="property.propertyName"
43
+                    :disabled="!canEdit"
38
                   />
44
                   />
39
                 </div>
45
                 </div>
40
                 <div class="col-md-6">
46
                 <div class="col-md-6">
46
                     type="text"
52
                     type="text"
47
                     name="propertyRef"
53
                     name="propertyRef"
48
                     v-model="property.propertyRef"
54
                     v-model="property.propertyRef"
55
+                    :disabled="!canEdit"
49
                   />
56
                   />
50
                 </div>
57
                 </div>
51
               </div>
58
               </div>
56
                     name="propertyType"
63
                     name="propertyType"
57
                     id="propertyType"
64
                     id="propertyType"
58
                     v-model="property.propertyTypeId"
65
                     v-model="property.propertyTypeId"
66
+                    :disabled="!canEdit"
59
                   >
67
                   >
60
                     <option value="0">Please select type *</option>
68
                     <option value="0">Please select type *</option>
61
                     <option
69
                     <option
75
                     name="unit"
83
                     name="unit"
76
                     id="unit"
84
                     id="unit"
77
                     v-model="property.unit"
85
                     v-model="property.unit"
86
+                    :disabled="!canEdit"
78
                   />
87
                   />
79
                 </div>
88
                 </div>
80
               </div>
89
               </div>
83
                   <mapSection
92
                   <mapSection
84
                     v-on:map-location="updateLocation"
93
                     v-on:map-location="updateLocation"
85
                     :savedCoords="property.propertCoords"
94
                     :savedCoords="property.propertCoords"
95
+                    :canEdit="canEdit"
86
                   />
96
                   />
87
                   <input
97
                   <input
88
                     type="checkbox"
98
                     type="checkbox"
89
                     v-model="property.showAddress"
99
                     v-model="property.showAddress"
90
                     style="margin-right: 10px; margin-top: 10px;"
100
                     style="margin-right: 10px; margin-top: 10px;"
101
+                    :disabled="!canEdit"
91
                   />
102
                   />
92
                   <label>Show address on listing</label>
103
                   <label>Show address on listing</label>
93
                 </div>
104
                 </div>
107
                         name="price"
118
                         name="price"
108
                         id="price"
119
                         id="price"
109
                         v-model="property.price"
120
                         v-model="property.price"
121
+                        :disabled="!canEdit"
110
                       />
122
                       />
111
                     </div>
123
                     </div>
112
-                    <div v-if="property.salesTypeString === 'Rental'" class="col-md-6">
124
+                    <div v-if="!property.isSale" class="col-md-6">
113
                       <select
125
                       <select
114
                         class="form-control uniSelect"
126
                         class="form-control uniSelect"
115
                         name="propertyType"
127
                         name="propertyType"
116
                         id="propertyType"
128
                         id="propertyType"
117
                         v-model="property.pricePer"
129
                         v-model="property.pricePer"
130
+                        :disabled="!canEdit"
118
                       >
131
                       >
119
                         <option value>Please select</option>
132
                         <option value>Please select</option>
120
                         <option value="Month">Month</option>
133
                         <option value="Month">Month</option>
128
                         type="date"
141
                         type="date"
129
                         class="form-control uniInput"
142
                         class="form-control uniInput"
130
                         name="date"
143
                         name="date"
131
-                        v-model="property.dateAvailable"
144
+                        v-model="property.dateAvailableString"
145
+                        :disabled="!canEdit"
132
                       />
146
                       />
133
                     </div>
147
                     </div>
134
                   </div>
148
                   </div>
254
               <div class="row">
268
               <div class="row">
255
                 <div class="col-md-12">
269
                 <div class="col-md-12">
256
                   <label for="Property Description" style="font-family:'muli'">Description:</label>
270
                   <label for="Property Description" style="font-family:'muli'">Description:</label>
257
-                  <vue-editor v-model="property.description" :editor-toolbar="customToolbar" />
271
+                  <vue-editor
272
+                    v-model="property.description"
273
+                    :editor-toolbar="customToolbar"
274
+                    :disabled="!canEdit"
275
+                  />
258
                   <br />
276
                   <br />
259
                   <p>
277
                   <p>
260
                     * A listing fee of R380 including VAT is payable to list your Property on the
278
                     * A listing fee of R380 including VAT is payable to list your Property on the
274
                         type="number"
292
                         type="number"
275
                         class="form-control uniInput"
293
                         class="form-control uniInput"
276
                         v-model="field.value"
294
                         v-model="field.value"
295
+                        :disabled="!canEdit"
277
                       />
296
                       />
278
                     </div>
297
                     </div>
279
                     <div v-else class="display:none"></div>
298
                     <div v-else class="display:none"></div>
280
                     <div v-if="field.type === 'yesno'">
299
                     <div v-if="field.type === 'yesno'">
281
                       {{ field.name }}
300
                       {{ field.name }}
282
-                      <input type="checkbox" v-model="field.value" />
301
+                      <input
302
+                        type="checkbox"
303
+                        v-model="field.value"
304
+                        :disabled="!canEdit"
305
+                      />
283
                     </div>
306
                     </div>
284
                   </div>
307
                   </div>
285
                 </div>
308
                 </div>
301
                       name="vtlink"
324
                       name="vtlink"
302
                       id="vtlink"
325
                       id="vtlink"
303
                       v-model="property.virtualTour"
326
                       v-model="property.virtualTour"
327
+                      :disabled="!canEdit"
304
                     />
328
                     />
305
                   </div>
329
                   </div>
306
                 </div>
330
                 </div>
315
                       name="vlink"
339
                       name="vlink"
316
                       id="vlink"
340
                       id="vlink"
317
                       v-model="property.video"
341
                       v-model="property.video"
342
+                      :disabled="!canEdit"
318
                     />
343
                     />
319
                   </div>
344
                   </div>
320
                 </div>
345
                 </div>
329
                 </div>
354
                 </div>
330
               </div>
355
               </div>
331
               <ImageLoad
356
               <ImageLoad
332
-                :savedImaged="propertyImages"
357
+                :savedImages="propertyImages"
333
                 :loadedImages="loadedImages"
358
                 :loadedImages="loadedImages"
334
                 @DefaultImage="UpdateDefaultImage"
359
                 @DefaultImage="UpdateDefaultImage"
360
+                @DeleteImage="DeleteImage"
361
+                :mayEdit="canEdit"
335
               />
362
               />
336
               <button v-if="!wait" type="button" @click="SubmitData()" class="btn-solid-blue">Save</button>
363
               <button v-if="!wait" type="button" @click="SubmitData()" class="btn-solid-blue">Save</button>
337
               <button v-if="!wait" type="button" @click="Close()" class="btn-solid-blue">Close</button>
364
               <button v-if="!wait" type="button" @click="Close()" class="btn-solid-blue">Close</button>
360
 import _ from "lodash";
387
 import _ from "lodash";
361
 
388
 
362
 export default {
389
 export default {
390
+  name: "PropertyEditPage",
363
   components: {
391
   components: {
364
     mapSection,
392
     mapSection,
365
     ImageLoad,
393
     ImageLoad,
370
       defaultImage: 0,
398
       defaultImage: 0,
371
       images: [],
399
       images: [],
372
       wait: false,
400
       wait: false,
401
+      canEdit: true,
373
     };
402
     };
374
   },
403
   },
375
   methods: {
404
   methods: {
379
       "getPropertyFields",
408
       "getPropertyFields",
380
       "updateProperty",
409
       "updateProperty",
381
     ]),
410
     ]),
411
+    StatusChanged(item) {
412
+      if (
413
+        item.target.value === "Offer Pending" ||
414
+        item.target.value === "Sold" ||
415
+        item.target.value === "Rented Out"
416
+      ) {
417
+        this.canEdit = false;
418
+      } else {
419
+        this.canEdit = true;
420
+      }
421
+      if (item.target.value === "For Rent") {
422
+        this.property.isSale = false;
423
+      }
424
+      if (item.target.value === "For Sale") {
425
+        this.property.isSale = true;
426
+      }
427
+    },
382
     clearAddress() {
428
     clearAddress() {
383
       this.addressSet = false;
429
       this.addressSet = false;
384
       this.property.streetNumber = undefined;
430
       this.property.streetNumber = undefined;
397
     },
443
     },
398
     UpdateDefaultImage(item) {
444
     UpdateDefaultImage(item) {
399
       this.defaultImage = item;
445
       this.defaultImage = item;
446
+      for (let i = 0; i < this.propertyImages.length; i++) {
447
+        if (i === item) {
448
+          this.propertyImages[i].isDefault = true;
449
+        } else {
450
+          this.propertyImages[i].isDefault = false;
451
+        }
452
+      }
400
     },
453
     },
401
     loadedImages(values) {
454
     loadedImages(values) {
402
       this.images = values;
455
       this.images = values;
420
         });
473
         });
421
       }
474
       }
422
 
475
 
476
+      this.property.propertyImages = this.propertyImages;
477
+
478
+      //console.log(JSON.stringify(this.property));
479
+
423
       this.updateProperty(this.property).then((fulfilled) => {
480
       this.updateProperty(this.property).then((fulfilled) => {
424
         this.$router.push("/PropertyAdmin");
481
         this.$router.push("/PropertyAdmin");
425
       });
482
       });
439
       this.property.addressUrl = place.url;
496
       this.property.addressUrl = place.url;
440
       this.property.propertCoords = place.coords;
497
       this.property.propertCoords = place.coords;
441
     },
498
     },
499
+    DeleteImage(item) {
500
+      this.propertyImages[item].isDeleted = true;
501
+    },
442
   },
502
   },
443
   mounted() {
503
   mounted() {
444
-    this.wait = false;
445
-    this.getProperty(this.$route.params.id);
504
+    this.getProperty(this.$route.params.id).then((fulfilled) => {
505
+      this.wait = false;
506
+      if (
507
+        this.property.statusString === "Offer Pending" ||
508
+        this.property.statusString === "Sold" ||
509
+        this.property.statusString === "Rented Out"
510
+      ) {
511
+        this.canEdit = false;
512
+      } else {
513
+        this.canEdit = true;
514
+      }
515
+    });
446
   },
516
   },
447
   computed: {
517
   computed: {
448
     ...mapState("property", [
518
     ...mapState("property", [
452
       "propertyFields",
522
       "propertyFields",
453
       "statuses",
523
       "statuses",
454
     ]),
524
     ]),
525
+    savedImages() {
526
+      const list = [];
527
+      for (let i = 0; i < this.propertyImages.length; i++) {
528
+        list.push(this.proeprtyImages[i].image);
529
+      }
530
+      return list;
531
+    },
455
   },
532
   },
456
 };
533
 };
457
 </script>
534
 </script>

+ 25
- 14
src/components/property/mapSection.vue Wyświetl plik

1
 <template>
1
 <template>
2
   <div>
2
   <div>
3
-    <gmap-autocomplete class="form-control mb-3 uniInput" @place_changed="setPlace"
4
-      >*</gmap-autocomplete
5
-    >
3
+    <gmap-autocomplete
4
+      class="form-control mb-3 uniInput"
5
+      @place_changed="setPlace"
6
+      :disabled="!canEdit"
7
+    >*</gmap-autocomplete>
6
     <GmapMap
8
     <GmapMap
7
       :center="mapCenter"
9
       :center="mapCenter"
8
       :zoom="mapZoom"
10
       :zoom="mapZoom"
10
       style="width: 100%; height: 500px"
12
       style="width: 100%; height: 500px"
11
       ref="map"
13
       ref="map"
12
     >
14
     >
13
-      <GmapMarker v-if="this.place" :position="mapCenter" :clickable="true" :draggable="false" />
15
+      <GmapMarker
16
+        v-if="this.place"
17
+        :position="mapCenter"
18
+        :clickable="true"
19
+        :draggable="false"
20
+        :disabled="!canEdit"
21
+      />
14
     </GmapMap>
22
     </GmapMap>
15
   </div>
23
   </div>
16
 </template>
24
 </template>
20
 import { gmapApi } from "vue2-google-maps";
28
 import { gmapApi } from "vue2-google-maps";
21
 export default {
29
 export default {
22
   computed: {
30
   computed: {
23
-    google: gmapApi
31
+    google: gmapApi,
24
   },
32
   },
25
   props: {
33
   props: {
26
-    savedCoords: { default: "" }
34
+    savedCoords: { default: "" },
35
+    canEdit: { default: true },
27
   },
36
   },
28
   data() {
37
   data() {
29
     return {
38
     return {
38
       country: "",
47
       country: "",
39
       postalCode: "",
48
       postalCode: "",
40
       url: "",
49
       url: "",
41
-      coords: {}
50
+      coords: {},
42
     };
51
     };
43
   },
52
   },
44
 
53
 
70
         if (place.address_components[i].types[0] === "locality") {
79
         if (place.address_components[i].types[0] === "locality") {
71
           this.city = place.address_components[i].long_name;
80
           this.city = place.address_components[i].long_name;
72
         }
81
         }
73
-        if (place.address_components[i].types[0] === "administrative_area_level_1") {
82
+        if (
83
+          place.address_components[i].types[0] === "administrative_area_level_1"
84
+        ) {
74
           this.province = place.address_components[i].long_name;
85
           this.province = place.address_components[i].long_name;
75
         }
86
         }
76
         if (place.address_components[i].types[0] === "country") {
87
         if (place.address_components[i].types[0] === "country") {
90
         province: this.province,
101
         province: this.province,
91
         country: this.country,
102
         country: this.country,
92
         postalCode: this.postalCode,
103
         postalCode: this.postalCode,
93
-        url: this.url
104
+        url: this.url,
94
       });
105
       });
95
-    }
106
+    },
96
   },
107
   },
97
   watch: {
108
   watch: {
98
     savedCoords: {
109
     savedCoords: {
102
           var array = val.split(",");
113
           var array = val.split(",");
103
           this.mapCenter = {
114
           this.mapCenter = {
104
             lat: Number(array[0]),
115
             lat: Number(array[0]),
105
-            lng: Number(array[1])
116
+            lng: Number(array[1]),
106
           };
117
           };
107
           this.mapZoom = 17;
118
           this.mapZoom = 17;
108
         }
119
         }
109
-      }
110
-    }
111
-  }
120
+      },
121
+    },
122
+  },
112
 };
123
 };
113
 </script>
124
 </script>
114
 
125
 

+ 25
- 7
src/components/property/propertyCard.vue Wyświetl plik

15
                   <img
15
                   <img
16
                     style="max-height:165px; object-fit: cover;"
16
                     style="max-height:165px; object-fit: cover;"
17
                     :src="currentProperty.displayImage"
17
                     :src="currentProperty.displayImage"
18
-                    alt=""
18
+                    alt
19
                   />
19
                   />
20
                 </div>
20
                 </div>
21
                 <h1>{{ currentProperty.suburb }}</h1>
21
                 <h1>{{ currentProperty.suburb }}</h1>
22
-                <p><strong>Property Reference</strong> #{{ currentProperty.id }}</p>
22
+                <p>
23
+                  <strong>Property Reference</strong>
24
+                  {{ currentProperty.propertyReference }}
25
+                </p>
26
+                <p
27
+                  v-if="!currentProperty.isSale"
28
+                  :class="[currentProperty.hasPendingOffer ? 'pendingOffer' : 'normalText']"
29
+                >
30
+                  <strong>{{ currentProperty.available }}</strong>
31
+                </p>
32
+                <p
33
+                  v-if="currentProperty.isSale  && currentProperty.hasPendingOffer"
34
+                  class="pendingOffer"
35
+                >
36
+                  <strong>{{ currentProperty.available }}</strong>
37
+                </p>
23
               </div>
38
               </div>
24
             </router-link>
39
             </router-link>
25
           </div>
40
           </div>
31
                   <img
46
                   <img
32
                     style="max-height:165px; object-fit: cover;"
47
                     style="max-height:165px; object-fit: cover;"
33
                     :src="currentProperty.displayImage"
48
                     :src="currentProperty.displayImage"
34
-                    alt=""
49
+                    alt
35
                   />
50
                   />
36
                 </div>
51
                 </div>
37
                 <h1>{{ currentProperty.suburb }}</h1>
52
                 <h1>{{ currentProperty.suburb }}</h1>
38
-                <p><strong>Property Reference</strong> #{{ currentProperty.id }}</p>
53
+                <p>
54
+                  <strong>Property Reference</strong>
55
+                  {{ currentProperty.propertyReference }}
56
+                </p>
39
               </div>
57
               </div>
40
             </router-link>
58
             </router-link>
41
           </div>
59
           </div>
53
   props: {
71
   props: {
54
     properties: { type: Array, default: () => [] },
72
     properties: { type: Array, default: () => [] },
55
     showSort: { type: Boolean, default: true },
73
     showSort: { type: Boolean, default: true },
56
-    salesType: { type: String, default: "Rent" }
74
+    salesType: { type: String, default: "Rent" },
57
   },
75
   },
58
   methods: {
76
   methods: {
59
     sortHighPrice() {
77
     sortHighPrice() {
91
       }
109
       }
92
 
110
 
93
       return this.properties.sort(compare);
111
       return this.properties.sort(compare);
94
-    }
95
-  }
112
+    },
113
+  },
96
 };
114
 };
97
 </script>
115
 </script>
98
 
116
 

+ 17
- 4
src/components/property/propertyImage.vue Wyświetl plik

24
           id="checkbox"
24
           id="checkbox"
25
           v-model="imagesDefault[i]"
25
           v-model="imagesDefault[i]"
26
           @change="updateList(i)"
26
           @change="updateList(i)"
27
+          :disabled="!mayEdit"
27
         />
28
         />
28
         <label v-if="allowMultiple" for="checkbox" style="margin: 10px;">Main Image</label>
29
         <label v-if="allowMultiple" for="checkbox" style="margin: 10px;">Main Image</label>
29
         <img :src="img" style="height:200px; width:150px; object-fit: cover;" />
30
         <img :src="img" style="height:200px; width:150px; object-fit: cover;" />
31
         <!-- <span class="input-group-text" align="center" style="width:150px" @click="removeImage(key)">
32
         <!-- <span class="input-group-text" align="center" style="width:150px" @click="removeImage(key)">
32
           <eva-icon name="trash-2-outline" fill="#60CBEB"></eva-icon>Delete
33
           <eva-icon name="trash-2-outline" fill="#60CBEB"></eva-icon>Delete
33
         </span>-->
34
         </span>-->
34
-        <button align="center" class="imageDeleteButton" @click="removeImage(i)">
35
+        <button v-if="mayEdit" class="imageDeleteButton" @click="removeImage(i)">
35
           <i class="fa fa-trash"></i>
36
           <i class="fa fa-trash"></i>
36
         </button>
37
         </button>
37
       </div>
38
       </div>
46
     loadedImages: Function,
47
     loadedImages: Function,
47
     mayEdit: { type: Boolean, default: () => true },
48
     mayEdit: { type: Boolean, default: () => true },
48
     allowMultiple: { type: Boolean, default: () => true },
49
     allowMultiple: { type: Boolean, default: () => true },
49
-    savedImaged: { type: Array, default: () => [] },
50
+    savedImages: { type: Array, default: () => [] },
50
   },
51
   },
51
   data() {
52
   data() {
52
     return {
53
     return {
53
       images: {},
54
       images: {},
54
       image: [],
55
       image: [],
55
       imagesDefault: [],
56
       imagesDefault: [],
57
+      maxSavedIndex: 0,
56
     };
58
     };
57
   },
59
   },
58
   // Commented out for now.
60
   // Commented out for now.
93
     },
95
     },
94
 
96
 
95
     removeImage(key) {
97
     removeImage(key) {
98
+      this.$emit("DeleteImage", key);
96
       this.image.splice(key, 1);
99
       this.image.splice(key, 1);
97
       this.images.splice(key, 1);
100
       this.images.splice(key, 1);
98
 
101
 
99
       if (!this.image.length) {
102
       if (!this.image.length) {
100
         this.$refs.im.value = "";
103
         this.$refs.im.value = "";
101
       }
104
       }
105
+
106
+      // if (key <= this.maxSavedIndex) {
107
+      //   this.$emit("DeleteImage", key);
108
+      // }
102
     },
109
     },
103
 
110
 
104
     updateList(index) {
111
     updateList(index) {
113
     },
120
     },
114
   },
121
   },
115
   watch: {
122
   watch: {
116
-    savedImaged: {
123
+    savedImages: {
117
       immediate: true,
124
       immediate: true,
118
       handler(val, oldVal) {
125
       handler(val, oldVal) {
119
         if (val) {
126
         if (val) {
120
-          this.image = val;
127
+          this.image = [];
128
+          this.imagesDefault = [];
129
+          for (let i = 0; i < val.length; i++) {
130
+            this.image.push(val[i].image);
131
+            this.imagesDefault.push(val[i].isDefault);
132
+            this.maxSavedIndex = i;
133
+          }
121
         }
134
         }
122
       },
135
       },
123
     },
136
     },

+ 7
- 8
src/components/property/residential/latestListings.vue Wyświetl plik

13
           <div class="row">
13
           <div class="row">
14
             <div class="col">
14
             <div class="col">
15
               <propertyCard
15
               <propertyCard
16
-                v-if="properties.length > 0"
16
+                v-if="latestProperties.length > 0"
17
                 name="propertyholder"
17
                 name="propertyholder"
18
-                :properties="properties"
18
+                :properties="latestProperties"
19
                 :showSort="false"
19
                 :showSort="false"
20
               />
20
               />
21
             </div>
21
             </div>
32
 import propertyCard from "../propertyCard";
32
 import propertyCard from "../propertyCard";
33
 export default {
33
 export default {
34
   components: {
34
   components: {
35
-    propertyCard
35
+    propertyCard,
36
   },
36
   },
37
   methods: {
37
   methods: {
38
-    ...mapActions("propertySearch", ["searchProperties"])
38
+    ...mapActions("propertySearch", ["searchLatestPropertiesType"]),
39
   },
39
   },
40
   async mounted() {
40
   async mounted() {
41
-    this.propertySearch.propertyUsageType = "Residential";
42
-    await this.searchProperties(this.propertySearch);
41
+    await this.searchLatestPropertiesType("Residential");
43
   },
42
   },
44
   computed: {
43
   computed: {
45
-    ...mapState("propertySearch", ["properties", "propertySearch"])
46
-  }
44
+    ...mapState("propertySearch", ["latestProperties"]),
45
+  },
47
 };
46
 };
48
 </script>
47
 </script>
49
 
48
 

+ 1
- 1
src/components/shared/navBar.vue Wyświetl plik

199
                         <router-link to="/property/list">List My Property</router-link>
199
                         <router-link to="/property/list">List My Property</router-link>
200
                       </li>
200
                       </li>
201
 
201
 
202
-                      <li>
202
+                      <li v-if="ROLE === 'Super Admin'">
203
                         <router-link to="/status/timeshareAdmin">Timeshare Week Admin</router-link>
203
                         <router-link to="/status/timeshareAdmin">Timeshare Week Admin</router-link>
204
                       </li>
204
                       </li>
205
                       <li v-if="ROLE === 'Super Admin'">
205
                       <li v-if="ROLE === 'Super Admin'">

+ 0
- 1
src/components/timeshare/myWeeksPage.vue Wyświetl plik

32
       <div class="offset-1 col-md-10">
32
       <div class="offset-1 col-md-10">
33
         <ListView
33
         <ListView
34
           :items="items"
34
           :items="items"
35
-          :editable="true"
36
           @onNew="onNew"
35
           @onNew="onNew"
37
           @onRowClick="onRowClick"
36
           @onRowClick="onRowClick"
38
           @onClearSelected="onClearSelected"
37
           @onClearSelected="onClearSelected"

+ 11
- 1
src/store/modules/property/property.js Wyświetl plik

21
     },
21
     },
22
     setPropertyImages(state, images) {
22
     setPropertyImages(state, images) {
23
       state.propertyImages = images;
23
       state.propertyImages = images;
24
+      state.propertyImageList = [];
25
+      for (let i = 0; i < images.length; i++) {
26
+        state.propertyImageList.push(images[i].image);
27
+      }
24
     },
28
     },
25
     setPropertyTypes(state, types) {
29
     setPropertyTypes(state, types) {
26
       state.propertyTypes = types;
30
       state.propertyTypes = types;
63
           .then(result => {
67
           .then(result => {
64
             commit("setProperty", result.data);
68
             commit("setProperty", result.data);
65
             dispatch("getPropertyTypes", result.data.propertyUsageType);
69
             dispatch("getPropertyTypes", result.data.propertyUsageType);
66
-            dispatch("getPropertyImages", result.data.id);
70
+            dispatch("getSavedPropertyImages", result.data.id);
67
             dispatch("getSavedPropertyFields", result.data.id);
71
             dispatch("getSavedPropertyFields", result.data.id);
68
             dispatch("getStatuses");
72
             dispatch("getStatuses");
69
             resolve();
73
             resolve();
77
         .then(result => commit("setPropertyImages", result.data))
81
         .then(result => commit("setPropertyImages", result.data))
78
         .catch(console.error);
82
         .catch(console.error);
79
     },
83
     },
84
+    getSavedPropertyImages({ commit }, id) {
85
+      axios
86
+        .get(`/api/PropertyImage/GetProperySavedImages/${id}`)
87
+        .then(result => commit("setPropertyImages", result.data))
88
+        .catch(console.error);
89
+    },
80
     getPropertyTypes({ commit }, propertyType) {
90
     getPropertyTypes({ commit }, propertyType) {
81
       axios
91
       axios
82
         .get(`/api/PropertyType/type/${propertyType}`)
92
         .get(`/api/PropertyType/type/${propertyType}`)

+ 6
- 0
src/store/modules/property/propertySearch.js Wyświetl plik

114
         .then(response => commit("setLatestProperties", response.data))
114
         .then(response => commit("setLatestProperties", response.data))
115
         .catch(console.error);
115
         .catch(console.error);
116
     },
116
     },
117
+    searchLatestPropertiesType({ commit }, type) {
118
+      axios
119
+        .get(`/api/property/latestProperties/${type}`)
120
+        .then(response => commit("setLatestProperties", response.data))
121
+        .catch(console.error);
122
+    },
117
     applyFilter({ commit }, value) {
123
     applyFilter({ commit }, value) {
118
       commit("setFilter", { value });
124
       commit("setFilter", { value });
119
     },
125
     },

+ 12
- 0
src/store/modules/timeshare/myWeeks.js Wyświetl plik

11
     setItems(state, list) {
11
     setItems(state, list) {
12
       state.items = list;
12
       state.items = list;
13
     },
13
     },
14
+    setItem(state, item) {
15
+      state.week = item;
16
+    }
14
   },
17
   },
15
   getters: {
18
   getters: {
16
     getNeedsVerify(state) {
19
     getNeedsVerify(state) {
47
     //   .then(result => commit('removeListing', id))
50
     //   .then(result => commit('removeListing', id))
48
     //   .catch(console.error);
51
     //   .catch(console.error);
49
     // }
52
     // }
53
+    getWeek({ commit }, id) {
54
+      axios
55
+      .get(`/api/timeshareweek/${id}`)
56
+      .then(r => {
57
+        console.log(JSON.stringify(r));
58
+        commit('setItem', r.data);
59
+      })
60
+      .catch(console.error);
61
+    },
50
   },
62
   },
51
 };
63
 };

Ładowanie…
Anuluj
Zapisz