Kobus Botha 5 anni fa
parent
commit
afea08bfe5

+ 25
- 0
src/App.vue Vedi File

101
   height: 100%;
101
   height: 100%;
102
   margin: 0;
102
   margin: 0;
103
 }
103
 }
104
+.isSelected {
105
+  border-color: white white #60cbeb white;
106
+}
107
+.isUnSelected {
108
+  border-color: white white white white;
109
+}
110
+.tabButton {
111
+  display: block;
112
+  padding: 0.5rem 1rem;
113
+  background-color: white;
114
+  border-style: none none solid none;
115
+  width: 100px;
116
+}
117
+.top-left {
118
+  position: absolute;
119
+  top: 8px;
120
+  width: 350px;
121
+  color: white;
122
+}
123
+.normalText {
124
+  background-color: #60cbeb;
125
+}
126
+.pendingOffer {
127
+  background-color: #ff8344;
128
+}
104
 </style>
129
 </style>
105
 
130
 
106
 <style scoped>
131
 <style scoped>

+ 10
- 2
src/assets/staticData/maritalStatus.js Vedi File

1
-const items = ['ICOP (In Community of Property)', 'OCOP (Out of Community of Property)', 'Other',
2
-  'Traditional Wedding', 'Single', 'Divorced', 'Widow', 'Committed Relationship', 'Partner',
1
+const items = [
2
+  { id: 1, description: 'ICOP (In Community of Property)' },
3
+  { id: 2, description: 'OCOP (Out of Community of Property)' },
4
+  { id: 3, description: 'Other' },
5
+  { id: 4, description: 'Traditional Wedding' },
6
+  { id: 5, description: 'Single' },
7
+  { id: 6, description: 'Divorced' },
8
+  { id: 7, description: 'Widow' },
9
+  { id: 8, description: 'Committed Relationship' },
10
+  { id: 9, description: 'Partner' },
3
 ];
11
 ];
4
 export default items;
12
 export default items;

+ 5
- 2
src/components/admin/status/agentsUserManagementPage.vue Vedi File

53
       <table class="table table-bordered">
53
       <table class="table table-bordered">
54
         <thead>
54
         <thead>
55
           <tr>
55
           <tr>
56
-            <td colspan="10">
56
+            <td colspan="11">
57
               <div class="myWell">
57
               <div class="myWell">
58
                 <h4>Agents</h4>
58
                 <h4>Agents</h4>
59
               </div>
59
               </div>
90
             <th>
90
             <th>
91
               <b>Remove</b>
91
               <b>Remove</b>
92
             </th>
92
             </th>
93
+            <th>
94
+              <b>Soft Delete</b>
95
+            </th>
93
           </tr>
96
           </tr>
94
         </thead>
97
         </thead>
95
         <tbody>
98
         <tbody>
121
                 style="width: 85px; height:40px; color:#60CBEB"
124
                 style="width: 85px; height:40px; color:#60CBEB"
122
               >Delete</button>
125
               >Delete</button>
123
             </td>
126
             </td>
127
+            <td>{{ item.isDeleted}}</td>
124
           </tr>
128
           </tr>
125
         </tbody>
129
         </tbody>
126
       </table>
130
       </table>
169
       visibleItemsPerPageCount: 0,
173
       visibleItemsPerPageCount: 0,
170
       currentPage: 1,
174
       currentPage: 1,
171
       item: {},
175
       item: {},
172
-      delete: false,
173
     };
176
     };
174
   },
177
   },
175
   methods: {
178
   methods: {

+ 5
- 1
src/components/admin/status/userManagementPage.vue Vedi File

35
       <table class="table table-bordered">
35
       <table class="table table-bordered">
36
         <thead>
36
         <thead>
37
           <tr>
37
           <tr>
38
-            <td colspan="10">
38
+            <td colspan="11">
39
               <div class="myWell">
39
               <div class="myWell">
40
                 <h4>Private Users</h4>
40
                 <h4>Private Users</h4>
41
               </div>
41
               </div>
72
             <th>
72
             <th>
73
               <b>Remove</b>
73
               <b>Remove</b>
74
             </th>
74
             </th>
75
+            <th>
76
+              <b>Soft Delete</b>
77
+            </th>
75
           </tr>
78
           </tr>
76
         </thead>
79
         </thead>
77
         <tbody>
80
         <tbody>
103
                 style="margin:2px; color: #60CBEB"
106
                 style="margin:2px; color: #60CBEB"
104
               >Delete</button>
107
               >Delete</button>
105
             </td>
108
             </td>
109
+            <td>{{ item.isDeleted }}</td>
106
           </tr>
110
           </tr>
107
         </tbody>
111
         </tbody>
108
       </table>
112
       </table>

+ 113
- 80
src/components/misc/address.vue Vedi File

10
       <div class="row" style="text-align:left">
10
       <div class="row" style="text-align:left">
11
         <div class="col-md-6" style="margin-bottom: 1em">
11
         <div class="col-md-6" style="margin-bottom: 1em">
12
           <label>Street Number *</label>
12
           <label>Street Number *</label>
13
-          <div class="input-group-prepend">
14
-            <span class="input-group-text">
15
-              <eva-icon name="home-outline" fill="#60CBEB"></eva-icon>
16
-            </span>
17
-            <input
18
-              class="form-control"
19
-              type="text"
20
-              name="streetnumber"
21
-              v-model="address.streetNumber"
22
-            />
23
-          </div>
13
+          <prop-field
14
+            :display="address.streetNumber"
15
+            :editType="'text'"
16
+            :propertyName="'streetNumber'"
17
+            :mayEdit="true"
18
+            @UpdateValue="UpdateValue"
19
+          />
24
         </div>
20
         </div>
25
         <div class="col-md-6" style="margin-bottom: 1em">
21
         <div class="col-md-6" style="margin-bottom: 1em">
26
           <label>Street Name *</label>
22
           <label>Street Name *</label>
27
-          <div class="input-group-prepend">
28
-            <span class="input-group-text">
29
-              <eva-icon name="home-outline" fill="#60CBEB"></eva-icon>
30
-            </span>
31
-            <input class="form-control" type="text" name="streetname" v-model="address.streetName" />
32
-          </div>
23
+          <prop-field
24
+            :display="address.street"
25
+            :editType="'text'"
26
+            :propertyName="'street'"
27
+            :mayEdit="true"
28
+            @UpdateValue="UpdateValue"
29
+          />
33
         </div>
30
         </div>
34
         <div class="col-md-6" style="margin-bottom: 1em">
31
         <div class="col-md-6" style="margin-bottom: 1em">
35
           <label>Province *</label>
32
           <label>Province *</label>
36
-          <div class="input-group-prepend">
37
-            <span class="input-group-text">
38
-              <eva-icon name="home-outline" fill="#60CBEB"></eva-icon>
39
-            </span>
40
-            <select
41
-              class="form-control"
42
-              name="propertyType"
43
-              id="propertyType"
44
-              @change="ProvinceSelected"
45
-              v-model="address.province"
46
-            >
47
-              <option value="0">Please select province</option>
48
-              <option
49
-                v-for="province in provinces"
50
-                :value="province.id"
51
-                :key="province.description"
52
-              >{{ province.description }}</option>
53
-            </select>
54
-          </div>
33
+          <propField
34
+            :display="address.province"
35
+            :editType="'selector'"
36
+            :arrayObject="provinces"
37
+            :propertyName="'province'"
38
+            :mayEdit="true"
39
+            @UpdateValue="UpdateValue"
40
+          />
55
         </div>
41
         </div>
56
 
42
 
57
         <div class="col-md-6" style="margin-bottom: 1em">
43
         <div class="col-md-6" style="margin-bottom: 1em">
58
           <label>City *</label>
44
           <label>City *</label>
59
-          <div class="input-group-prepend">
60
-            <span class="input-group-text">
61
-              <eva-icon name="home-outline" fill="#60CBEB"></eva-icon>
62
-            </span>
63
-            <select
64
-              class="form-control"
65
-              name="propertyType"
66
-              id="propertyType"
67
-              @change="CitySelected"
68
-              v-model="address.city"
69
-            >
70
-              <option value="0">Please select city</option>
71
-              <option
72
-                v-for="city in cities"
73
-                :value="city.description"
74
-                :key="city.id"
75
-              >{{ city.description }}</option>
76
-            </select>
77
-          </div>
45
+          <propField
46
+            :display="address.city"
47
+            :editType="'selector'"
48
+            :arrayObject="cities"
49
+            :propertyName="'city'"
50
+            :mayEdit="true"
51
+            @UpdateValue="UpdateValue"
52
+          />
78
         </div>
53
         </div>
79
         <div class="col-md-6" style="margin-bottom: 1em">
54
         <div class="col-md-6" style="margin-bottom: 1em">
80
           <label>Suburb *</label>
55
           <label>Suburb *</label>
81
-          <div class="input-group-prepend">
82
-            <span class="input-group-text">
83
-              <eva-icon name="home-outline" fill="#60CBEB"></eva-icon>
84
-            </span>
85
-            <select
86
-              class="form-control"
87
-              name="propertyType"
88
-              id="suburbselector"
89
-              v-model="address.suburb"
90
-              @change="getPostalCode"
91
-            >
92
-              <option value="0">Please select suburb</option>
93
-              <option
94
-                v-for="suburb in suburbs"
95
-                :value="suburb.description"
96
-                :key="suburb.description"
97
-              >{{ suburb.description }}</option>
98
-            </select>
99
-          </div>
56
+          <propField
57
+            :display="address.suburb"
58
+            :editType="'selector'"
59
+            :arrayObject="suburbs"
60
+            :propertyName="'suburb'"
61
+            :mayEdit="true"
62
+            @UpdateValue="UpdateValue"
63
+          />
100
         </div>
64
         </div>
101
         <div class="col-md-6" style="margin-bottom: 1em">
65
         <div class="col-md-6" style="margin-bottom: 1em">
102
           <label>Postal Code *</label>
66
           <label>Postal Code *</label>
103
-          <div class="input-group-prepend">
104
-            <span class="input-group-text">
105
-              <eva-icon name="home-outline" fill="#60CBEB"></eva-icon>
106
-            </span>
107
-            <input class="form-control" type="text" name="postalcode" v-model="address.postalCode" />
108
-          </div>
67
+          <propField
68
+            :display="address.postalCode"
69
+            :editType="'text'"
70
+            :propertyName="'postalCode'"
71
+            :mayEdit="true"
72
+            @UpdateValue="UpdateValue"
73
+          />
109
         </div>
74
         </div>
110
       </div>
75
       </div>
111
     </div>
76
     </div>
114
 
79
 
115
 <script>
80
 <script>
116
 import { mapState, mapActions } from 'vuex';
81
 import { mapState, mapActions } from 'vuex';
82
+import propField from '../property/propertyFieldEditor.vue';
117
 
83
 
118
 export default {
84
 export default {
85
+  components: {
86
+    propField,
87
+  },
119
   data() {
88
   data() {
120
     return {
89
     return {
121
       propertyType: 'Residential',
90
       propertyType: 'Residential',
155
         item.target.options.selectedIndex - 1
124
         item.target.options.selectedIndex - 1
156
       ].postalCode;
125
       ].postalCode;
157
     },
126
     },
127
+    UpdateValue(item) {
128
+      if (item.fieldName) {
129
+        if (item.fieldName === 'streetNumber') {
130
+          this.address.streetNumber = item.value;
131
+        }
132
+        if (item.fieldName === 'street') {
133
+          this.address.street = item.value;
134
+        }
135
+        if (item.fieldName === 'province') {
136
+          if (item.value !== '') {
137
+            this.address.province = item.value;
138
+            this.getCities(Object.assign({}, { province: item.value }));
139
+            this.address.city = null;
140
+            this.address.suburb = null;
141
+            this.address.postalCode = '';
142
+          } else {
143
+            this.address.province = null;
144
+            this.address.city = null;
145
+            this.address.suburb = null;
146
+            this.address.postalCode = '';
147
+            this.cities = [];
148
+            this.suburbs = [];
149
+          }
150
+        }
151
+        if (item.fieldName === 'city') {
152
+          if (item.value !== '') {
153
+            this.address.city = item.value;
154
+            // this.address.city = newCity;
155
+            // this.address.cityId = newCity.id;
156
+            this.getSuburbs(
157
+              Object.assign(
158
+                {},
159
+                {
160
+                  province: item.value,
161
+                  city: item.value,
162
+                },
163
+              ),
164
+            );
165
+            this.address.suburb = null;
166
+            this.address.postalCode = '';
167
+          } else {
168
+            this.address.city = null;
169
+            this.address.suburb = null;
170
+            this.address.postalCode = '';
171
+            this.suburbs = [];
172
+          }
173
+        }
174
+        if (item.fieldName === 'suburb') {
175
+          if (item.value !== '') {
176
+            // const newSuburb = this.suburbs.find(
177
+            //   p => p.description === item.value,
178
+            // );
179
+            // this.address.suburb = newSuburb;
180
+            // this.address.suburbId = newSuburb.id;
181
+            console.log(item.value);
182
+            this.address.suburb = item.value;
183
+            this.address.postalCode = this.address.suburb.postalCode;
184
+          } else {
185
+            this.address.suburb = null;
186
+            this.address.postalCode = '';
187
+          }
188
+        }
189
+      }
190
+    },
158
   },
191
   },
159
   mounted() {
192
   mounted() {
160
     this.getProvince();
193
     this.getProvince();

+ 35
- 0
src/components/property/propertyCard.vue Vedi File

1
 <template>
1
 <template>
2
+  <!-- eslint-disable max-len -->
2
   <div>
3
   <div>
3
     <div class="form-group row" v-if="showSort">
4
     <div class="form-group row" v-if="showSort">
4
       <button
5
       <button
19
         style="width: 150px; height:40px;"
20
         style="width: 150px; height:40px;"
20
         @click="sortHighPrice()"
21
         @click="sortHighPrice()"
21
       >Highest Price</button>
22
       >Highest Price</button>
23
+      <button
24
+        v-if="salesType === 'Rent'"
25
+        type="button"
26
+        class="btn btn-link font-weight-bold color-b"
27
+        style="width: 150px; height:40px;"
28
+        @click="sortDateAvailable()"
29
+      >Date Available</button>
22
       <hr />
30
       <hr />
23
     </div>
31
     </div>
24
     <div class="form-group row">
32
     <div class="form-group row">
32
                 class="img-a img-fluid"
40
                 class="img-a img-fluid"
33
                 style="height:466px; width:350px; object-fit: cover;"
41
                 style="height:466px; width:350px; object-fit: cover;"
34
               />
42
               />
43
+              <p
44
+                v-if="!currentProperty.isSale"
45
+                :class="[currentProperty.hasPendingOffer ? 'top-left pendingOffer' : 'top-left normalText']"
46
+              >
47
+                <strong>{{ currentProperty.available }}</strong>
48
+              </p>
49
+              <p
50
+                v-if="currentProperty.isSale  && currentProperty.hasPendingOffer"
51
+                class="top-left pendingOffer"
52
+              >
53
+                <strong>{{ currentProperty.available }}</strong>
54
+              </p>
35
             </div>
55
             </div>
36
             <div class="card-overlay">
56
             <div class="card-overlay">
37
               <div class="card-overlay-a-content">
57
               <div class="card-overlay-a-content">
41
                       :to="`/property/property/${currentProperty.id}`"
61
                       :to="`/property/property/${currentProperty.id}`"
42
                       class="link-a"
62
                       class="link-a"
43
                     >{{ currentProperty.shortDescription }}</router-link>
63
                     >{{ currentProperty.shortDescription }}</router-link>
64
+                    <router-link
65
+                      v-if="!currentProperty.isSale"
66
+                      :to="`/property/property/${currentProperty.id}`"
67
+                      class="link-a"
68
+                    ></router-link>
44
                   </h4>
69
                   </h4>
45
                   <h4 class="card-title-c">
70
                   <h4 class="card-title-c">
46
                     <router-link :to="`/property/property/${currentProperty.id}`" class="link-a">
71
                     <router-link :to="`/property/property/${currentProperty.id}`" class="link-a">
113
   props: {
138
   props: {
114
     properties: { type: Array, default: () => [] },
139
     properties: { type: Array, default: () => [] },
115
     showSort: { type: Boolean, default: true },
140
     showSort: { type: Boolean, default: true },
141
+    salesType: { type: String, default: 'Rent' },
116
   },
142
   },
117
   methods: {
143
   methods: {
118
     sortHighPrice() {
144
     sortHighPrice() {
140
         return 0;
166
         return 0;
141
       }
167
       }
142
 
168
 
169
+      return this.properties.sort(compare);
170
+    },
171
+    sortDateAvailable() {
172
+      function compare(a, b) {
173
+        if (a.dateAvailable > b.dateAvailable) return 1;
174
+        if (a.dateAvailable < b.dateAvailable) return -1;
175
+        return 0;
176
+      }
177
+
143
       return this.properties.sort(compare);
178
       return this.properties.sort(compare);
144
     },
179
     },
145
   },
180
   },

+ 59
- 19
src/components/property/propertyCreate.vue Vedi File

71
                     @change="PropertyTypeSelected"
71
                     @change="PropertyTypeSelected"
72
                   >
72
                   >
73
                     <option value="0">Please select type</option>
73
                     <option value="0">Please select type</option>
74
-                    <option v-for="item in propertyTypes" :value="item.id" :key="item.id">{{
74
+                    <option v-for="item in propertyTypes" :value="item.id" :key="item.id">
75
+                      {{
75
                       item.description
76
                       item.description
76
-                    }}</option>
77
+                      }}
78
+                    </option>
77
                   </select>
79
                   </select>
78
                 </div>
80
                 </div>
79
                 <div v-if="showPropertyTypeError">
81
                 <div v-if="showPropertyTypeError">
155
                     v-model="property.provinceId"
157
                     v-model="property.provinceId"
156
                   >
158
                   >
157
                     <option value="0">Please select province</option>
159
                     <option value="0">Please select province</option>
158
-                    <option v-for="province in provinces" :value="province.id" :key="province.id">{{
160
+                    <option v-for="province in provinces" :value="province.id" :key="province.id">
161
+                      {{
159
                       province.description
162
                       province.description
160
-                    }}</option>
163
+                      }}
164
+                    </option>
161
                   </select>
165
                   </select>
162
                 </div>
166
                 </div>
163
                 <div v-if="showProvinceError">
167
                 <div v-if="showProvinceError">
179
                     v-model="property.cityId"
183
                     v-model="property.cityId"
180
                   >
184
                   >
181
                     <option value="0">Please select city</option>
185
                     <option value="0">Please select city</option>
182
-                    <option v-for="city in cities" :value="city.id" :key="city.id">{{
186
+                    <option v-for="city in cities" :value="city.id" :key="city.id">
187
+                      {{
183
                       city.description
188
                       city.description
184
-                    }}</option>
189
+                      }}
190
+                    </option>
185
                   </select>
191
                   </select>
186
                 </div>
192
                 </div>
187
                 <div v-if="showCityError">
193
                 <div v-if="showCityError">
202
                     @change="getPostalCode"
208
                     @change="getPostalCode"
203
                   >
209
                   >
204
                     <option value="0">Please select suburb</option>
210
                     <option value="0">Please select suburb</option>
205
-                    <option v-for="suburb in suburbs" :value="suburb.id" :key="suburb.id">{{
211
+                    <option v-for="suburb in suburbs" :value="suburb.id" :key="suburb.id">
212
+                      {{
206
                       suburb.description
213
                       suburb.description
207
-                    }}</option>
214
+                      }}
215
+                    </option>
208
                   </select>
216
                   </select>
209
                 </div>
217
                 </div>
210
                 <div v-if="showSuburbError">
218
                 <div v-if="showSuburbError">
264
                 </div>
272
                 </div>
265
               </div>
273
               </div>
266
             </div>
274
             </div>
275
+            <div class="form-group row" v-if="salesType === 'Rental'">
276
+              <div class="col-md-12">
277
+                <input
278
+                  type="date"
279
+                  class="form-control"
280
+                  name="date"
281
+                  v-model="property.dateAvailable"
282
+                />
283
+              </div>
284
+            </div>
267
             <div class="form-group row">
285
             <div class="form-group row">
268
               <div class="col-md-12">
286
               <div class="col-md-12">
269
                 <label for="Property Description">Description</label>
287
                 <label for="Property Description">Description</label>
357
               @click="SubmitData()"
375
               @click="SubmitData()"
358
               class="btn btn-b-n"
376
               class="btn btn-b-n"
359
               style="width: 85px; height:40px;"
377
               style="width: 85px; height:40px;"
360
-            >
361
-              Save
362
-            </button>
378
+            >Save</button>
363
             <div
379
             <div
364
               v-if="showPropertyTypeError || showProvinceError || showCityError || showSuburbError"
380
               v-if="showPropertyTypeError || showProvinceError || showCityError || showSuburbError"
365
             >
381
             >
366
-              <p class="alert myError">
367
-                Missing fields. Please fill in all required fields. Marked with *
368
-              </p>
382
+              <p
383
+                class="alert myError"
384
+              >Missing fields. Please fill in all required fields. Marked with *</p>
369
             </div>
385
             </div>
370
             <div v-if="wait" id="preloader"></div>
386
             <div v-if="wait" id="preloader"></div>
371
           </form>
387
           </form>
401
       customToolbar: [
417
       customToolbar: [
402
         [{ header: [false, 1, 2, 3, 4, 5, 6] }],
418
         [{ header: [false, 1, 2, 3, 4, 5, 6] }],
403
         ['bold', 'italic', 'underline', 'strike'],
419
         ['bold', 'italic', 'underline', 'strike'],
404
-        [{ align: '' }, { align: 'center' }, { align: 'right' }, { align: 'justify' }],
420
+        [
421
+          { align: '' },
422
+          { align: 'center' },
423
+          { align: 'right' },
424
+          { align: 'justify' },
425
+        ],
405
         [{ list: 'ordered' }, { list: 'bullet' }, { list: 'check' }],
426
         [{ list: 'ordered' }, { list: 'bullet' }, { list: 'check' }],
406
         [{ script: 'sub' }, { script: 'super' }],
427
         [{ script: 'sub' }, { script: 'super' }],
407
         [{ indent: '-1' }, { indent: '+1' }],
428
         [{ indent: '-1' }, { indent: '+1' }],
411
       showProvinceError: false,
432
       showProvinceError: false,
412
       showCityError: false,
433
       showCityError: false,
413
       showSuburbError: false,
434
       showSuburbError: false,
435
+      showDateError: false,
414
     };
436
     };
415
   },
437
   },
416
   methods: {
438
   methods: {
446
         this.showSuburbError = true;
468
         this.showSuburbError = true;
447
       }
469
       }
448
 
470
 
471
+      if (
472
+        this.salesType === 'Rental'
473
+        && this.property.dateAvailable === 'undef'
474
+      ) {
475
+        this.showDateError = true;
476
+      }
477
+
449
       if (
478
       if (
450
         this.showPropertyTypeError
479
         this.showPropertyTypeError
451
         || this.showProvinceError
480
         || this.showProvinceError
452
         || this.showCityError
481
         || this.showCityError
453
         || this.showSuburbError
482
         || this.showSuburbError
483
+        || this.showDateError
454
       ) {
484
       ) {
455
         return;
485
         return;
456
       }
486
       }
458
       this.wait = true;
488
       this.wait = true;
459
       if (this.salesType === 'Sale') {
489
       if (this.salesType === 'Sale') {
460
         this.property.isSale = true;
490
         this.property.isSale = true;
491
+        this.property.dateAvailable = new Date();
461
       }
492
       }
462
       // eslint-disable-next-line no-plusplus
493
       // eslint-disable-next-line no-plusplus
463
       for (let i = 0; i < this.images.length; i++) {
494
       for (let i = 0; i < this.images.length; i++) {
496
     },
527
     },
497
     ProvinceSelected(item) {
528
     ProvinceSelected(item) {
498
       if (item.target.options.selectedIndex > 0) {
529
       if (item.target.options.selectedIndex > 0) {
499
-        this.selectedProvince = this.provinces[item.target.options.selectedIndex - 1].description;
530
+        this.selectedProvince = this.provinces[
531
+          item.target.options.selectedIndex - 1
532
+        ].description;
500
         this.getCities(Object.assign({}, { province: this.selectedProvince }));
533
         this.getCities(Object.assign({}, { province: this.selectedProvince }));
501
         this.showProvinceError = false;
534
         this.showProvinceError = false;
502
       } else {
535
       } else {
505
     },
538
     },
506
     CitySelected(item) {
539
     CitySelected(item) {
507
       if (item.target.options.selectedIndex > 0) {
540
       if (item.target.options.selectedIndex > 0) {
508
-        this.selectedCity = this.cities[item.target.options.selectedIndex - 1].description;
541
+        this.selectedCity = this.cities[
542
+          item.target.options.selectedIndex - 1
543
+        ].description;
509
         this.getSuburbs(
544
         this.getSuburbs(
510
-          Object.assign({}, { province: this.selectedProvince, city: this.selectedCity }),
545
+          Object.assign(
546
+            {},
547
+            { province: this.selectedProvince, city: this.selectedCity },
548
+          ),
511
         );
549
         );
512
         this.showCityError = false;
550
         this.showCityError = false;
513
       } else {
551
       } else {
515
       }
553
       }
516
     },
554
     },
517
     getPostalCode(item) {
555
     getPostalCode(item) {
518
-      this.property.addressLine3 = this.suburbs[item.target.options.selectedIndex - 1].postalCode;
556
+      this.property.addressLine3 = this.suburbs[
557
+        item.target.options.selectedIndex - 1
558
+      ].postalCode;
519
       if (item.target.options.selectedIndex > 0) {
559
       if (item.target.options.selectedIndex > 0) {
520
         this.showSuburbError = false;
560
         this.showSuburbError = false;
521
       } else {
561
       } else {

+ 41
- 18
src/components/property/propertyPage.vue Vedi File

6
       <div class="row">
6
       <div class="row">
7
         <div class="col-md-12 col-lg-8">
7
         <div class="col-md-12 col-lg-8">
8
           <div class="title-box-d">
8
           <div class="title-box-d">
9
-            <h1 class="title-d" style="text-align:left; font-size: 250%">
10
-              {{ property.shortDescription }}
11
-            </h1>
9
+            <h1
10
+              class="title-d"
11
+              style="text-align:left; font-size: 250%"
12
+            >{{ property.shortDescription }}</h1>
12
           </div>
13
           </div>
13
         </div>
14
         </div>
14
       </div>
15
       </div>
90
                   </div>
91
                   </div>
91
                   <div class="summary-list">
92
                   <div class="summary-list">
92
                     <ul class="list">
93
                     <ul class="list">
94
+                      <li v-if="!property.isSale" class="d-flex justify-content-between">
95
+                        <strong>Available:</strong>
96
+                        <span
97
+                          v-if="property.dateAvailable < date"
98
+                        >{{ property.dateAvailable | toDate }}</span>
99
+                        <span v-else>Now</span>
100
+                      </li>
93
                       <li class="d-flex justify-content-between">
101
                       <li class="d-flex justify-content-between">
94
                         <strong>Property ID:</strong>
102
                         <strong>Property ID:</strong>
95
                         <span>{{ property.id }}</span>
103
                         <span>{{ property.id }}</span>
96
                       </li>
104
                       </li>
97
                       <li class="d-flex justify-content-between">
105
                       <li class="d-flex justify-content-between">
98
                         <strong>Status:</strong>
106
                         <strong>Status:</strong>
99
-                        <span v-if="property.status"
100
-                          >{{ property.status.code }} - {{ property.status.description }}</span
101
-                        >
107
+                        <span
108
+                          v-if="property.status"
109
+                        >{{ property.status.code }} - {{ property.status.description }}</span>
102
                       </li>
110
                       </li>
103
                       <li class="d-flex justify-content-between">
111
                       <li class="d-flex justify-content-between">
104
                         <strong>Address:</strong>
112
                         <strong>Address:</strong>
118
                     </ul>
126
                     </ul>
119
                   </div>
127
                   </div>
120
                 </div>
128
                 </div>
121
-                <div class="col-md-12">
129
+                <div class="col-md-12" v-if="mayEdit">
122
                   <button
130
                   <button
123
                     type="button"
131
                     type="button"
124
                     class="btn btn-b-n"
132
                     class="btn btn-b-n"
125
                     data-toggle="modal"
133
                     data-toggle="modal"
126
                     data-target="#myModal"
134
                     data-target="#myModal"
127
-                  >
128
-                    Make an Offer
129
-                  </button>
135
+                  >Make an Offer</button>
130
                   <div id="myModal" class="modal fade" role="dialog">
136
                   <div id="myModal" class="modal fade" role="dialog">
131
                     <div class="modal-dialog modal-lg">
137
                     <div class="modal-dialog modal-lg">
132
                       <!-- Modal content-->
138
                       <!-- Modal content-->
151
                     </div>
157
                     </div>
152
                   </div>
158
                   </div>
153
                 </div>
159
                 </div>
160
+                <div
161
+                  class="col-md-12"
162
+                  v-if="!mayEdit"
163
+                  style="background-color: #ff8344; color: white;"
164
+                >
165
+                  <p>
166
+                    <b>Offer Pending</b>
167
+                  </p>
168
+                </div>
154
                 <div class="col-md-12">
169
                 <div class="col-md-12">
155
                   <div class="row section-t3">
170
                   <div class="row section-t3">
156
                     <div class="col-sm-12">
171
                     <div class="col-sm-12">
216
         </div>
231
         </div>
217
         <!-- Tab Control -->
232
         <!-- Tab Control -->
218
         <div class="row">
233
         <div class="row">
219
-          <div class="col-sm-12">
234
+          <div class="col-md-12">
220
             <div v-if="property.virtualTour" class="row justify-content-between">
235
             <div v-if="property.virtualTour" class="row justify-content-between">
221
-              <div class="col-md-7 col-lg-7 section-md-t3">
236
+              <div class="col-md-12 col-lg-12 section-md-t3">
222
                 <div class="row">
237
                 <div class="row">
223
-                  <div class="col-sm-12">
238
+                  <div class="col-md-12">
224
                     <div class="title-box-d">
239
                     <div class="title-box-d">
225
                       <h3 class="title-d" style="text-align:left">Virtual Tour</h3>
240
                       <h3 class="title-d" style="text-align:left">Virtual Tour</h3>
226
                     </div>
241
                     </div>
229
                 <iframe
244
                 <iframe
230
                   :src="property.virtualTour"
245
                   :src="property.virtualTour"
231
                   width="100%"
246
                   width="100%"
232
-                  height="500"
247
+                  height="700"
233
                   frameborder="0"
248
                   frameborder="0"
234
                   webkitallowfullscreen
249
                   webkitallowfullscreen
235
                   mozallowfullscreen
250
                   mozallowfullscreen
241
               <br />
256
               <br />
242
             </div>
257
             </div>
243
             <div v-if="property.video" class="row justify-content-between">
258
             <div v-if="property.video" class="row justify-content-between">
244
-              <div class="col-md-7 col-lg-7 section-md-t3">
259
+              <div class="col-md-12 col-lg-12 section-md-t3">
245
                 <div class="row">
260
                 <div class="row">
246
-                  <div class="col-sm-12">
261
+                  <div class="col-md-12">
247
                     <div class="title-box-d">
262
                     <div class="title-box-d">
248
                       <h3 class="title-d" style="text-align:left">Video</h3>
263
                       <h3 class="title-d" style="text-align:left">Video</h3>
249
                     </div>
264
                     </div>
252
                 <iframe
267
                 <iframe
253
                   :src="`https://www.youtube.com/embed/${property.video}`"
268
                   :src="`https://www.youtube.com/embed/${property.video}`"
254
                   width="100%"
269
                   width="100%"
255
-                  height="500"
270
+                  height="700"
256
                   frameborder="0"
271
                   frameborder="0"
257
                   style="border:0"
272
                   style="border:0"
258
                   allowfullscreen
273
                   allowfullscreen
281
   data() {
296
   data() {
282
     return {
297
     return {
283
       index: null,
298
       index: null,
299
+      date: new Date(),
284
     };
300
     };
285
   },
301
   },
286
   mounted() {
302
   mounted() {
287
     this.getProperty(this.$route.params.id);
303
     this.getProperty(this.$route.params.id);
288
     this.getPropertyImages(this.$route.params.id);
304
     this.getPropertyImages(this.$route.params.id);
305
+    this.mayEditProperty(this.$route.params.id);
289
   },
306
   },
290
   computed: {
307
   computed: {
291
     ...mapState('property', ['property', 'propertyImages']),
308
     ...mapState('property', ['property', 'propertyImages']),
309
+    ...mapState('propertyEdit', ['mayEdit']),
292
   },
310
   },
293
   methods: {
311
   methods: {
294
-    ...mapActions('property', ['getProperty', 'getPropertyImages', 'clearPropertyImages']),
312
+    ...mapActions('property', [
313
+      'getProperty',
314
+      'getPropertyImages',
315
+      'clearPropertyImages',
316
+    ]),
317
+    ...mapActions('propertyEdit', ['mayEditProperty']),
295
     formatPrice(value) {
318
     formatPrice(value) {
296
       const val = (value / 1).toFixed(2);
319
       const val = (value / 1).toFixed(2);
297
       return val.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ' ');
320
       return val.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ' ');

+ 57
- 11
src/components/property/propertySearchFields.vue Vedi File

69
               <b>P</b>
69
               <b>P</b>
70
             </span>
70
             </span>
71
           </div>
71
           </div>
72
-          <select class="form-control" v-model="propertySearch.province">
72
+          <select class="form-control" v-model="propertySearch.province" @change="ProvinceSelected">
73
             <option>All</option>
73
             <option>All</option>
74
             <option v-for="(province, i) in provinces" :key="i">{{ province.description }}</option>
74
             <option v-for="(province, i) in provinces" :key="i">{{ province.description }}</option>
75
           </select>
75
           </select>
80
           </div>
80
           </div>
81
         </div>
81
         </div>
82
       </div>
82
       </div>
83
-    </div>
84
-    <div class="container text-left">
85
       <div class="form-group">
83
       <div class="form-group">
86
         <label for="city">City</label>
84
         <label for="city">City</label>
87
         <div class="input-group mb-3">
85
         <div class="input-group mb-3">
90
               <b>C</b>
88
               <b>C</b>
91
             </span>
89
             </span>
92
           </div>
90
           </div>
93
-          <select class="form-control" v-model="propertySearch.city">
91
+          <select class="form-control" v-model="propertySearch.city" @change="CitySelected">
94
             <option>All</option>
92
             <option>All</option>
95
             <option v-for="(city, i) in cities" :key="i">{{ city.description }}</option>
93
             <option v-for="(city, i) in cities" :key="i">{{ city.description }}</option>
96
           </select>
94
           </select>
101
           </div>
99
           </div>
102
         </div>
100
         </div>
103
       </div>
101
       </div>
104
-    </div>
105
-    <div class="container text-left">
106
       <div class="form-group">
102
       <div class="form-group">
107
         <label for="suburb">Suburb</label>
103
         <label for="suburb">Suburb</label>
108
         <div class="input-group mb-3">
104
         <div class="input-group mb-3">
122
           </div>
118
           </div>
123
         </div>
119
         </div>
124
       </div>
120
       </div>
125
-    </div>
126
-    <div class="container text-left">
127
       <div class="form-group">
121
       <div class="form-group">
128
         <div class="row">
122
         <div class="row">
129
           <div class="col-md-6 text-left">
123
           <div class="col-md-6 text-left">
170
           </div>
164
           </div>
171
         </div>
165
         </div>
172
       </div>
166
       </div>
167
+      <div class="form-group">
168
+        <div class="row">
169
+          <div class="col-md-12 text-left">
170
+            <label>Available From</label>
171
+            <div class="input-group mb-3">
172
+              <div class="input-group-prepend">
173
+                <span class="input-group-text" style="color: #60CBEB">
174
+                  <b>R</b>
175
+                </span>
176
+              </div>
177
+              <input
178
+                class="form-control"
179
+                type="date"
180
+                setp="any"
181
+                v-model="propertySearch.availableFrom"
182
+              />
183
+              <div class="input-group-append" @click="clearFilter('availableFrom')">
184
+                <span class="input-group-text cursor-pointer" style="color: #60CBEB">
185
+                  <b>X</b>
186
+                </span>
187
+              </div>
188
+            </div>
189
+          </div>
190
+        </div>
191
+      </div>
192
+      <div class="form-group">
193
+        <label for="propertytype">Property ID</label>
194
+        <div class="input-group mb-3">
195
+          <div class="input-group-prepend">
196
+            <span class="input-group-text" style="color: #60CBEB">
197
+              <b>T</b>
198
+            </span>
199
+          </div>
200
+          <input class="form-control" v-model="propertySearch.propertyId" type="number" />
201
+          <div class="input-group-append" @click="clearFilter('propertyId')">
202
+            <span class="input-group-text cursor-pointer" style="color: #60CBEB">
203
+              <b>X</b>
204
+            </span>
205
+          </div>
206
+        </div>
207
+      </div>
173
     </div>
208
     </div>
174
   </div>
209
   </div>
175
 </template>
210
 </template>
191
     this.getProvince();
226
     this.getProvince();
192
     this.getPropertyTypesRes();
227
     this.getPropertyTypesRes();
193
     this.getPropertyTypesCom();
228
     this.getPropertyTypesCom();
194
-    setTimeout(() => {
195
-      this.propertySearch.propertyUsageType = this.propertyType;
196
-    }, 100);
229
+    this.propertySearch.propertyUsageType = this.propertyType;
197
   },
230
   },
198
   computed: {
231
   computed: {
199
     ...mapState('searchTab', ['provinces', 'cities', 'suburbs']),
232
     ...mapState('searchTab', ['provinces', 'cities', 'suburbs']),
214
     },
247
     },
215
     PropertyTypeSelected(item) {
248
     PropertyTypeSelected(item) {
216
       this.propertySearch.propertyType = item.target.value;
249
       this.propertySearch.propertyType = item.target.value;
250
+      let typeitem = this.propertyTypesCom.find(
251
+        t => t.description === item.target.value,
252
+      );
253
+      if (typeof typeitem === 'undefined') {
254
+        typeitem = this.propertyTypesRes.find(
255
+          t => t.description === item.target.value,
256
+        );
257
+      }
258
+      if (typeitem.usageType === 1) {
259
+        this.propertySearch.propertyUsageType = 'Commercial';
260
+      } else {
261
+        this.propertySearch.propertyUsageType = 'Residential';
262
+      }
217
     },
263
     },
218
     ProvinceSelected(item) {
264
     ProvinceSelected(item) {
219
       if (item.target.value !== 'All') {
265
       if (item.target.value !== 'All') {

+ 6
- 17
src/components/property/propertySearchPage.vue Vedi File

27
       <br />
27
       <br />
28
       <div class="row">
28
       <div class="row">
29
         <div class="col-md-2 offset-4">
29
         <div class="col-md-2 offset-4">
30
-          <button type="button" @click="SetType('Residential')" class="btn btn-b-n">
31
-            Residential
32
-          </button>
30
+          <button type="button" @click="SetType('Residential')" class="btn btn-b-n">Residential</button>
33
         </div>
31
         </div>
34
         <div class="col-md-2">
32
         <div class="col-md-2">
35
-          <button type="button" @click="SetType('Commercial')" class="btn btn-b-n">
36
-            Commercial
37
-          </button>
33
+          <button type="button" @click="SetType('Commercial')" class="btn btn-b-n">Commercial</button>
38
         </div>
34
         </div>
39
       </div>
35
       </div>
40
       <br />
36
       <br />
50
               aria-controls="pills-video"
46
               aria-controls="pills-video"
51
               aria-selected="true"
47
               aria-selected="true"
52
               v-on:click="SetSalesType('Sale')"
48
               v-on:click="SetSalesType('Sale')"
53
-              >For Sale</a
54
-            >
49
+            >For Sale</a>
55
           </li>
50
           </li>
56
           <li class="nav-item">
51
           <li class="nav-item">
57
             <a
52
             <a
63
               aria-controls="pills-plans"
58
               aria-controls="pills-plans"
64
               aria-selected="false"
59
               aria-selected="false"
65
               v-on:click="SetSalesType('Rent')"
60
               v-on:click="SetSalesType('Rent')"
66
-              >To Rent</a
67
-            >
61
+            >To Rent</a>
68
           </li>
62
           </li>
69
         </ul>
63
         </ul>
70
       </div>
64
       </div>
80
             class="input-group-text fa fa-search"
74
             class="input-group-text fa fa-search"
81
             style="color: #60CBEB"
75
             style="color: #60CBEB"
82
             @click="SearchClick"
76
             @click="SearchClick"
83
-          >
84
-            Search
85
-          </button>
77
+          >Search</button>
86
         </div>
78
         </div>
87
       </div>
79
       </div>
88
       <div class="row">
80
       <div class="row">
89
         <div class="col-md-12">
81
         <div class="col-md-12">
90
-          <h1 class="my-4" v-if="propertyUsageType === 'Residential'">
91
-            About Residential Properties
92
-          </h1>
82
+          <h1 class="my-4" v-if="propertyUsageType === 'Residential'">About Residential Properties</h1>
93
           <h1 class="my-4" v-else>About Commercial Properties</h1>
83
           <h1 class="my-4" v-else>About Commercial Properties</h1>
94
         </div>
84
         </div>
95
         <div class="container col-md-6 text-left" v-if="propertyUsageType === 'Residential'">
85
         <div class="container col-md-6 text-left" v-if="propertyUsageType === 'Residential'">
185
     },
175
     },
186
     SearchClick() {
176
     SearchClick() {
187
       const item = this.suburbs.find(s => s.display === this.searchText);
177
       const item = this.suburbs.find(s => s.display === this.searchText);
188
-      console.log(JSON.stringify(item));
189
       this.propertySearch.province = item.province;
178
       this.propertySearch.province = item.province;
190
       this.propertySearch.city = item.city;
179
       this.propertySearch.city = item.city;
191
       this.propertySearch.suburb = item.suburb;
180
       this.propertySearch.suburb = item.suburb;

+ 43
- 8
src/components/property/propertySearchResults.vue Vedi File

26
       </div>
26
       </div>
27
       <br />
27
       <br />
28
       <div>
28
       <div>
29
-        <propertyCard v-if="properties.length > 0" name="propertyholder" :properties="properties" />
29
+        <propertyCard
30
+          v-if="properties.length > 0"
31
+          name="propertyholder"
32
+          :properties="properties"
33
+          :salesType="propertySearch.salesType"
34
+        />
35
+        <!-- <div v-if="loading">
36
+          <img
37
+            class="img-fluid"
38
+            src="/img/kloader.gif"
39
+            alt="UVProp logo"
40
+            style="width:128px;height:128px;"
41
+          />
42
+        </div>-->
30
         <div v-if="properties.length === 0">
43
         <div v-if="properties.length === 0">
31
           <img src="../../../public/img/no-homes.png" />
44
           <img src="../../../public/img/no-homes.png" />
32
           <br />
45
           <br />
35
         </div>
48
         </div>
36
       </div>
49
       </div>
37
       <br />
50
       <br />
51
+      <div class="row">
52
+        <div class="col-md-2 offset-5">
53
+          <button type="button" @click="SearchPage" class="btn btn-b-n">Back to Search</button>
54
+        </div>
55
+      </div>
38
     </div>
56
     </div>
39
   </div>
57
   </div>
40
 </template>
58
 </template>
54
     if (typeof this.propertySearch.propertyUsageType === 'undefined') {
72
     if (typeof this.propertySearch.propertyUsageType === 'undefined') {
55
       this.propertySearch.propertyUsageType = 'Residential';
73
       this.propertySearch.propertyUsageType = 'Residential';
56
     }
74
     }
75
+    if (this.user) {
76
+      this.propertySearch.userName = this.user.username;
77
+    }
57
     this.searchProperties(this.propertySearch);
78
     this.searchProperties(this.propertySearch);
58
   },
79
   },
59
   methods: {
80
   methods: {
60
-    ...mapActions('propertySearch', ['searchProperties']),
81
+    ...mapActions('propertySearch', [
82
+      'searchProperties',
83
+      'clearProperties',
84
+      'updateResultsShowing',
85
+    ]),
61
     SetType(item) {
86
     SetType(item) {
62
       this.propertySearch.propertyUsageType = item;
87
       this.propertySearch.propertyUsageType = item;
63
     },
88
     },
89
+    SearchPage() {
90
+      this.clearProperties();
91
+      this.$router.push('/property/search');
92
+    },
64
   },
93
   },
65
   computed: {
94
   computed: {
66
-    ...mapState('propertySearch', ['properties', 'propertySearch']),
67
-    ...mapState('authentication', ['username']),
95
+    ...mapState('propertySearch', [
96
+      'properties',
97
+      'propertySearch',
98
+      'resultsShowing',
99
+    ]),
100
+    ...mapState('authentication', ['user']),
68
     ParamsChanged() {
101
     ParamsChanged() {
69
-      if (typeof this.propertySearch.propertyUsageType === 'undefined') {
70
-        // eslint-disable-next-line vue/no-side-effects-in-computed-properties
71
-        this.propertySearch.propertyUsageType = 'Residential';
102
+      if (this.resultsShowing) {
103
+        if (typeof this.propertySearch.propertyUsageType === 'undefined') {
104
+          // eslint-disable-next-line vue/no-side-effects-in-computed-properties
105
+          this.propertySearch.propertyUsageType = 'Residential';
106
+        }
107
+        this.searchProperties(this.propertySearch);
72
       }
108
       }
73
-      this.searchProperties(this.propertySearch);
74
       return null;
109
       return null;
75
     },
110
     },
76
   },
111
   },

+ 31
- 55
src/components/property/propertyeditPage.vue Vedi File

35
       <div class="row mb-3">
35
       <div class="row mb-3">
36
         <div class="container col-md-10" style="text-align:left">
36
         <div class="container col-md-10" style="text-align:left">
37
           <form id="mainForm">
37
           <form id="mainForm">
38
-            <div class="form-goup row">
38
+            <!-- <div class="form-goup row">
39
               <div class="col-md-4">
39
               <div class="col-md-4">
40
                 <field :type="'datetime'" :mayEdit="true" />
40
                 <field :type="'datetime'" :mayEdit="true" />
41
               </div>
41
               </div>
42
-            </div>
42
+            </div>-->
43
             <div class="form-goup row">
43
             <div class="form-goup row">
44
               <div class="col-md-4">
44
               <div class="col-md-4">
45
                 <label>Usage Type</label>
45
                 <label>Usage Type</label>
104
               </div>
104
               </div>
105
               <div class="col-md-6" style="margin-bottom: 1em">
105
               <div class="col-md-6" style="margin-bottom: 1em">
106
                 <label>Province *</label>
106
                 <label>Province *</label>
107
-                <!-- <propField
108
-                  :display="property.province ? property.province.description : ''"
109
-                  :editType="'selector'"
110
-                  :arrayObject="provinces"
111
-                  :propertyName="'province'"
112
-                  :mayEdit="mayEdit"
113
-                  @UpdateValue="UpdateValue"
114
-                />-->
115
                 <field
107
                 <field
116
                   :type="'select'"
108
                   :type="'select'"
117
                   :selectOptions="provinces"
109
                   :selectOptions="provinces"
127
               </div>
119
               </div>
128
               <div class="col-md-6" style="margin-bottom: 1em">
120
               <div class="col-md-6" style="margin-bottom: 1em">
129
                 <label>City *</label>
121
                 <label>City *</label>
130
-                <!-- <propField
131
-                  :display="property.city ? property.city.description : ''"
132
-                  :editType="'selector'"
133
-                  :arrayObject="cities"
134
-                  :propertyName="'city'"
135
-                  :mayEdit="mayEdit"
136
-                  @UpdateValue="UpdateValue"
137
-                />-->
138
                 <field
122
                 <field
139
                   :type="'select'"
123
                   :type="'select'"
140
                   :selectOptions="cities"
124
                   :selectOptions="cities"
150
               </div>
134
               </div>
151
               <div class="col-md-6" style="margin-bottom: 1em">
135
               <div class="col-md-6" style="margin-bottom: 1em">
152
                 <label>Suburb *</label>
136
                 <label>Suburb *</label>
153
-                <!-- <propField
154
-                  :display="property.suburb ? property.suburb.description : ''"
155
-                  :editType="'selector'"
156
-                  :arrayObject="suburbs"
157
-                  :propertyName="'suburb'"
158
-                  :mayEdit="mayEdit"
159
-                  @UpdateValue="UpdateValue"
160
-                />-->
161
                 <field
137
                 <field
162
                   :type="'select'"
138
                   :type="'select'"
163
                   :selectOptions="suburbs"
139
                   :selectOptions="suburbs"
182
                 <label v-if="salesType === 'Rental'">Rental Price</label>
158
                 <label v-if="salesType === 'Rental'">Rental Price</label>
183
                 <label v-if="salesType !== 'Rental'">Sales Price</label>
159
                 <label v-if="salesType !== 'Rental'">Sales Price</label>
184
                 <field :type="'number'" v-model="property.price" :mayEdit="mayEdit" />
160
                 <field :type="'number'" v-model="property.price" :mayEdit="mayEdit" />
185
-                <!-- <propField
186
-                  :display="String(property.price)"
187
-                  :editType="'number'"
188
-                  :propertyName="'price'"
189
-                  :mayEdit="mayEdit"
190
-                  @UpdateValue="UpdateValue"
191
-                />-->
192
               </div>
161
               </div>
193
               <div class="col-md-6" v-if="salesType === 'Rental'">
162
               <div class="col-md-6" v-if="salesType === 'Rental'">
194
                 <label>Per</label>
163
                 <label>Per</label>
195
-                <!-- <propField
196
-                  :display="property.pricePer"
197
-                  :editType="'selector'"
198
-                  :propertyName="'pricePer'"
199
-                  :arrayObject="pricePerArr"
200
-                  :mayEdit="mayEdit"
201
-                  @UpdateValue="UpdateValue"
202
-                />-->
203
                 <field
164
                 <field
204
                   :type="'selectlist'"
165
                   :type="'selectlist'"
205
                   :selectOptions="pricePerArr"
166
                   :selectOptions="pricePerArr"
208
                 />
169
                 />
209
               </div>
170
               </div>
210
             </div>
171
             </div>
172
+            <div class="form-group row" v-if="salesType === 'Rental'">
173
+              <div class="col-md-6">
174
+                <label>Available From</label>
175
+                <field :type="'date'" :mayEdit="mayEdit" v-model="property.dateAvailable" />
176
+              </div>
177
+            </div>
211
             <div class="form-group row">
178
             <div class="form-group row">
212
               <div class="col-md-12">
179
               <div class="col-md-12">
213
                 <label for="Property Description">Description</label>
180
                 <label for="Property Description">Description</label>
331
               class="btn btn-b-n"
298
               class="btn btn-b-n"
332
               style="width: 85px; height:40px;"
299
               style="width: 85px; height:40px;"
333
               :disabled="!mayEdit"
300
               :disabled="!mayEdit"
334
-            >
335
-              Save
336
-            </button>
301
+            >Save</button>
337
             <button
302
             <button
338
               type="button"
303
               type="button"
339
               @click="Close()"
304
               @click="Close()"
342
               :disabled="
307
               :disabled="
343
                 showPropertyTypeError || showProvinceError || showCityError || showSuburbError
308
                 showPropertyTypeError || showProvinceError || showCityError || showSuburbError
344
               "
309
               "
345
-            >
346
-              Close
347
-            </button>
310
+            >Close</button>
348
             <div
311
             <div
349
               v-if="showPropertyTypeError || showProvinceError || showCityError || showSuburbError"
312
               v-if="showPropertyTypeError || showProvinceError || showCityError || showSuburbError"
350
             >
313
             >
351
-              <p class="alert myError">
352
-                Missing fields. Please fill in all required fields. Marked with *
353
-              </p>
314
+              <p
315
+                class="alert myError"
316
+              >Missing fields. Please fill in all required fields. Marked with *</p>
354
             </div>
317
             </div>
355
             <div v-if="wait" id="preloader"></div>
318
             <div v-if="wait" id="preloader"></div>
356
           </form>
319
           </form>
386
       customToolbar: [
349
       customToolbar: [
387
         [{ header: [false, 1, 2, 3, 4, 5, 6] }],
350
         [{ header: [false, 1, 2, 3, 4, 5, 6] }],
388
         ['bold', 'italic', 'underline', 'strike'],
351
         ['bold', 'italic', 'underline', 'strike'],
389
-        [{ align: '' }, { align: 'center' }, { align: 'right' }, { align: 'justify' }],
352
+        [
353
+          { align: '' },
354
+          { align: 'center' },
355
+          { align: 'right' },
356
+          { align: 'justify' },
357
+        ],
390
         [{ list: 'ordered' }, { list: 'bullet' }, { list: 'check' }],
358
         [{ list: 'ordered' }, { list: 'bullet' }, { list: 'check' }],
391
         [{ script: 'sub' }, { script: 'super' }],
359
         [{ script: 'sub' }, { script: 'super' }],
392
         [{ indent: '-1' }, { indent: '+1' }],
360
         [{ indent: '-1' }, { indent: '+1' }],
411
       'getListsForPropertyEdit',
379
       'getListsForPropertyEdit',
412
     ]),
380
     ]),
413
     ...mapActions('property', ['getPropertyTypes']),
381
     ...mapActions('property', ['getPropertyTypes']),
414
-    ...mapActions('propertyEdit', ['getSavedPropertyData', 'updateProperty', 'mayEditProperty']),
382
+    ...mapActions('propertyEdit', [
383
+      'getSavedPropertyData',
384
+      'updateProperty',
385
+      'mayEditProperty',
386
+    ]),
415
     provChanged(item) {
387
     provChanged(item) {
416
       this.getCities(Object.assign({}, { province: item.description }));
388
       this.getCities(Object.assign({}, { province: item.description }));
417
       this.property.city = null;
389
       this.property.city = null;
437
       this.showSuburbError = true;
409
       this.showSuburbError = true;
438
     },
410
     },
439
     suburbChanged(item) {
411
     suburbChanged(item) {
440
-      const newSuburb = this.suburbs.find(p => p.description === item.description);
412
+      const newSuburb = this.suburbs.find(
413
+        p => p.description === item.description,
414
+      );
441
       this.property.addressLine3 = newSuburb.postalCode;
415
       this.property.addressLine3 = newSuburb.postalCode;
442
       this.showSuburbError = false;
416
       this.showSuburbError = false;
443
     },
417
     },
447
     UpdateValue(item) {
421
     UpdateValue(item) {
448
       if (item.isUDF) {
422
       if (item.isUDF) {
449
         if (item.isPropOverview) {
423
         if (item.isPropOverview) {
450
-          this.propertyOverviewFields[0].fields[item.arrayIndex].value = item.value;
424
+          this.propertyOverviewFields[0].fields[item.arrayIndex].value =            item.value;
451
         } else if (item.isPropOverview === false) {
425
         } else if (item.isPropOverview === false) {
452
-          this.propertyFields[item.arrayIndex].fields[item.arrayItemIndex].value = item.value;
426
+          this.propertyFields[item.arrayIndex].fields[
427
+            item.arrayItemIndex
428
+          ].value = item.value;
453
         }
429
         }
454
       } else if (!item.isUDF) {
430
       } else if (!item.isUDF) {
455
         if (item.fieldName) {
431
         if (item.fieldName) {

+ 41
- 18
src/components/shared/bankAccount.vue Vedi File

10
       <div class="row" style="text-align:left">
10
       <div class="row" style="text-align:left">
11
         <div class="col-md-6" style="margin-bottom: 1em">
11
         <div class="col-md-6" style="margin-bottom: 1em">
12
           <label>Bank *</label>
12
           <label>Bank *</label>
13
-          <div class="input-group-prepend">
14
-            <span class="input-group-text">
15
-              <eva-icon name="behance-outline" fill="#60CBEB"></eva-icon>
16
-            </span>
17
-            <input class="form-control" type="text" name="bank" v-model="bank.bank" />
18
-          </div>
13
+          <prop-field
14
+            :display="bank.bank"
15
+            :editType="'text'"
16
+            :propertyName="'bankID'"
17
+            :mayEdit="true"
18
+            @UpdateValue="UpdateValue"
19
+          />
19
         </div>
20
         </div>
20
         <div class="col-md-6" style="margin-bottom: 1em">
21
         <div class="col-md-6" style="margin-bottom: 1em">
21
           <label>Account Number *</label>
22
           <label>Account Number *</label>
22
-          <div class="input-group-prepend">
23
-            <span class="input-group-text">
24
-              <eva-icon name="navigation-outline" fill="#60CBEB"></eva-icon>
25
-            </span>
26
-            <input class="form-control" type="text" name="accountnumber" v-model="bank.accNumber" />
27
-          </div>
23
+          <prop-field
24
+            :display="bank.accNumber"
25
+            :editType="'text'"
26
+            :propertyName="'accountNumber'"
27
+            :mayEdit="true"
28
+            @UpdateValue="UpdateValue"
29
+          />
28
         </div>
30
         </div>
29
         <div class="col-md-6" style="margin-bottom: 1em">
31
         <div class="col-md-6" style="margin-bottom: 1em">
30
           <label>Account Holder *</label>
32
           <label>Account Holder *</label>
31
-          <div class="input-group-prepend">
32
-            <span class="input-group-text">
33
-              <eva-icon name="person-done-outline" fill="#60CBEB"></eva-icon>
34
-            </span>
35
-            <input class="form-control" type="text" name="accountholder" v-model="bank.accHolder" />
36
-          </div>
33
+          <prop-field
34
+            :display="bank.accHolder"
35
+            :editType="'text'"
36
+            :propertyName="'accountHolder'"
37
+            :mayEdit="true"
38
+            @UpdateValue="UpdateValue"
39
+          />
37
         </div>
40
         </div>
38
       </div>
41
       </div>
39
     </div>
42
     </div>
41
 </template>
44
 </template>
42
 
45
 
43
 <script>
46
 <script>
47
+import propField from '../property/propertyFieldEditor.vue';
48
+
44
 export default {
49
 export default {
45
   name: 'BankAccount',
50
   name: 'BankAccount',
51
+  components: {
52
+    propField,
53
+  },
46
   props: {
54
   props: {
47
     bank: {
55
     bank: {
48
       bank: undefined,
56
       bank: undefined,
50
       accHolder: undefined,
58
       accHolder: undefined,
51
     },
59
     },
52
   },
60
   },
61
+  methods: {
62
+    UpdateValue(item) {
63
+      if (item.fieldName) {
64
+        if (item.fieldName === 'bank') {
65
+          this.bank.bank = item.value;
66
+        }
67
+        if (item.fieldName === 'accNumber') {
68
+          this.bank.accNumber = item.value;
69
+        }
70
+        if (item.fieldName === 'accHolder') {
71
+          this.bank.accHolder = item.value;
72
+        }
73
+      }
74
+    },
75
+  },
53
 };
76
 };
54
 </script>
77
 </script>
55
 
78
 

+ 25
- 8
src/components/shared/fieldEditor.vue Vedi File

14
     <div v-if="edit" class="input-group-prepend">
14
     <div v-if="edit" class="input-group-prepend">
15
       <input v-if="type === 'text'" class="form-control" v-model="value" />
15
       <input v-if="type === 'text'" class="form-control" v-model="value" />
16
       <input v-if="type === 'number'" type="number" class="form-control" v-model="value" />
16
       <input v-if="type === 'number'" type="number" class="form-control" v-model="value" />
17
+      <input v-if="type === 'date'" type="date" class="form-control" v-model="value" />
17
       <select v-if="type === 'select'" class="form-control" @change="selectionClick">
18
       <select v-if="type === 'select'" class="form-control" @change="selectionClick">
18
         <option>Please select</option>
19
         <option>Please select</option>
19
         <option
20
         <option
20
           v-for="option in selectOptions"
21
           v-for="option in selectOptions"
21
           :value="option[selectValue]"
22
           :value="option[selectValue]"
22
           :key="option[selectValue]"
23
           :key="option[selectValue]"
23
-          >{{ option[selectText] }}</option
24
-        >
24
+        >{{ option[selectText] }}</option>
25
       </select>
25
       </select>
26
       <select v-if="type === 'selectlist'" class="form-control" v-model="value">
26
       <select v-if="type === 'selectlist'" class="form-control" v-model="value">
27
         <option v-for="item in selectOptions" :value="item" :key="item">{{ item }}</option>
27
         <option v-for="item in selectOptions" :value="item" :key="item">{{ item }}</option>
44
 
44
 
45
 <script>
45
 <script>
46
 export default {
46
 export default {
47
-  props: ['value', 'type', 'mayEdit', 'selectOptions', 'selectValue', 'selectText', 'display'],
47
+  props: [
48
+    'value',
49
+    'type',
50
+    'mayEdit',
51
+    'selectOptions',
52
+    'selectValue',
53
+    'selectText',
54
+    'display',
55
+  ],
48
   data() {
56
   data() {
49
     return {
57
     return {
50
       edit: false,
58
       edit: false,
68
     selectionClick(item) {
76
     selectionClick(item) {
69
       if (item.target.options.selectedIndex > 0) {
77
       if (item.target.options.selectedIndex > 0) {
70
         if (!this.value) {
78
         if (!this.value) {
71
-          this.myDisplay = this.selectOptions[item.target.options.selectedIndex - 1][
72
-            this.selectText
73
-          ];
79
+          this.myDisplay = this.selectOptions[
80
+            item.target.options.selectedIndex - 1
81
+          ][this.selectText];
74
         }
82
         }
75
         if (this.selectOptions[item.target.options.selectedIndex - 1]) {
83
         if (this.selectOptions[item.target.options.selectedIndex - 1]) {
76
-          this.$emit('input', this.selectOptions[item.target.options.selectedIndex - 1]);
77
-          this.$emit('change', this.selectOptions[item.target.options.selectedIndex - 1]);
84
+          this.$emit(
85
+            'input',
86
+            this.selectOptions[item.target.options.selectedIndex - 1],
87
+          );
88
+          this.$emit(
89
+            'change',
90
+            this.selectOptions[item.target.options.selectedIndex - 1],
91
+          );
78
         }
92
         }
79
       }
93
       }
80
     },
94
     },
91
     if (this.display) {
105
     if (this.display) {
92
       this.myDisplay = this.display;
106
       this.myDisplay = this.display;
93
     }
107
     }
108
+    if (this.type === 'date') {
109
+      this.myDisplay = this.$options.filters.toDate(this.value);
110
+    }
94
   },
111
   },
95
   computed: {
112
   computed: {
96
     // eslint-disable-next-line vue/return-in-computed-property
113
     // eslint-disable-next-line vue/return-in-computed-property

+ 17
- 20
src/components/shared/gallerySlideShow.vue Vedi File

2
 <template>
2
 <template>
3
   <transition name="modal">
3
   <transition name="modal">
4
     <div v-if="imgIndex !== null" class="vgs" @click="close">
4
     <div v-if="imgIndex !== null" class="vgs" @click="close">
5
-      <button type="button" class="vgs__close" @click="close">
6
-        &times;
7
-      </button>
8
-      <button v-if="isMultiple" type="button" class="vgs__prev" @click.stop="onPrev">
9
-        &lsaquo;
10
-      </button>
5
+      <button type="button" class="vgs__close" @click="close">&times;</button>
6
+      <button v-if="isMultiple" type="button" class="vgs__prev" @click.stop="onPrev">&lsaquo;</button>
11
       <div v-if="images" class="vgs__container" @click.stop="onNext">
7
       <div v-if="images" class="vgs__container" @click.stop="onNext">
12
         <img class="vgs__container__img" :src="imageUrl" :alt="alt" @click.stop="onNext" />
8
         <img class="vgs__container__img" :src="imageUrl" :alt="alt" @click.stop="onNext" />
13
         <slot></slot>
9
         <slot></slot>
14
       </div>
10
       </div>
15
-      <button v-if="isMultiple" type="button" class="vgs__next" @click.stop="onNext">
16
-        &rsaquo;
17
-      </button>
11
+      <button v-if="isMultiple" type="button" class="vgs__next" @click.stop="onNext">&rsaquo;</button>
18
       <div v-if="isMultiple" ref="gallery" class="vgs__gallery">
12
       <div v-if="isMultiple" ref="gallery" class="vgs__gallery">
19
-        <div v-if="images" class="vgs__gallery__title">
20
-          {{ imgIndex + 1 }} / {{ images.length }}
21
-        </div>
13
+        <div v-if="images" class="vgs__gallery__title">{{ imgIndex + 1 }} / {{ images.length }}</div>
22
         <div
14
         <div
23
           v-if="images"
15
           v-if="images"
24
           class="vgs__gallery__container"
16
           class="vgs__gallery__container"
138
       const galleryWidth = this.$refs.gallery.clientWidth;
130
       const galleryWidth = this.$refs.gallery.clientWidth;
139
       const currThumbsWidth = this.imgIndex * this.thumbnailWidth;
131
       const currThumbsWidth = this.imgIndex * this.thumbnailWidth;
140
       const maxThumbsWidth = this.images.length * this.thumbnailWidth;
132
       const maxThumbsWidth = this.images.length * this.thumbnailWidth;
141
-      const centerPos = Math.floor(galleryWidth / (this.thumbnailWidth * 2)) * this.thumbnailWidth;
133
+      const centerPos =        Math.floor(galleryWidth / (this.thumbnailWidth * 2))
134
+        * this.thumbnailWidth;
142
 
135
 
143
       // Prevent scrolling of images if not needed
136
       // Prevent scrolling of images if not needed
144
       if (maxThumbsWidth < galleryWidth) {
137
       if (maxThumbsWidth < galleryWidth) {
151
         currThumbsWidth
144
         currThumbsWidth
152
         > this.images.length * this.thumbnailWidth - galleryWidth + centerPos
145
         > this.images.length * this.thumbnailWidth - galleryWidth + centerPos
153
       ) {
146
       ) {
154
-        this.galleryXPos = -(this.images.length * this.thumbnailWidth - galleryWidth - 20);
147
+        this.galleryXPos = -(
148
+          this.images.length * this.thumbnailWidth
149
+          - galleryWidth
150
+          - 20
151
+        );
155
       } else {
152
       } else {
156
         this.galleryXPos = -(this.imgIndex * this.thumbnailWidth) + centerPos;
153
         this.galleryXPos = -(this.imgIndex * this.thumbnailWidth) + centerPos;
157
       }
154
       }
258
     overflow: hidden;
255
     overflow: hidden;
259
     cursor: pointer;
256
     cursor: pointer;
260
     overflow: hidden;
257
     overflow: hidden;
261
-    max-width: 100vh;
262
-    margin: 0.5rem auto 0;
258
+    max-width: 180vh;
259
+    margin: 2rem auto 0;
263
     left: 0.5rem;
260
     left: 0.5rem;
264
     right: 0.5rem;
261
     right: 0.5rem;
265
-    height: 60vh;
262
+    height: 85vh;
266
     border-radius: $radius-large;
263
     border-radius: $radius-large;
267
     background-color: $black;
264
     background-color: $black;
268
     @include respond-to(xs) {
265
     @include respond-to(xs) {
304
   &__container {
301
   &__container {
305
     overflow: visible;
302
     overflow: visible;
306
     display: block;
303
     display: block;
307
-    height: 250px;
304
+    height: 50px;
308
     white-space: nowrap;
305
     white-space: nowrap;
309
     transition: all 200ms ease-in-out;
306
     transition: all 200ms ease-in-out;
310
     width: 100%;
307
     width: 100%;
311
     &__img {
308
     &__img {
312
-      width: 250px;
313
-      height: 250px;
309
+      width: 50px;
310
+      height: 50px;
314
       object-fit: cover;
311
       object-fit: cover;
315
       display: inline-block;
312
       display: inline-block;
316
       float: none;
313
       float: none;

+ 3
- 0
src/components/shared/listView.vue Vedi File

194
     title: {
194
     title: {
195
       default: undefined
195
       default: undefined
196
     },
196
     },
197
+    sortKey: {
198
+      default: "id"
199
+    },
197
     hideItemCount: {
200
     hideItemCount: {
198
       default: false
201
       default: false
199
     },
202
     },

+ 44
- 72
src/components/shared/searchTab.vue Vedi File

26
               </div>
26
               </div>
27
             </div>
27
             </div>
28
           </div>
28
           </div>
29
-          <div class="col-md-12">
30
-            <ul class="nav nav-pills-a nav-pills mb-3 section-t3" id="pills-tab" role="tablist">
31
-              <li class="nav-item">
32
-                <a
33
-                  class="nav-link active"
34
-                  id="pills-video-tab"
35
-                  data-toggle="pill"
36
-                  href="#pills-video"
37
-                  role="tab"
38
-                  aria-controls="pills-video"
39
-                  aria-selected="true"
40
-                  v-on:click="updateType('Timeshare')"
41
-                  >Timeshare</a
42
-                >
43
-              </li>
44
-              <li class="nav-item">
45
-                <a
46
-                  class="nav-link"
47
-                  id="pills-plans-tab"
48
-                  data-toggle="pill"
49
-                  href="#pills-plans"
50
-                  role="tab"
51
-                  aria-controls="pills-plans"
52
-                  aria-selected="false"
53
-                  v-on:click="updateType('Residential')"
54
-                  >Residential</a
55
-                >
56
-              </li>
57
-              <li class="nav-item">
58
-                <a
59
-                  class="nav-link"
60
-                  id="pills-map-tab"
61
-                  data-toggle="pill"
62
-                  href="#pills-map"
63
-                  role="tab"
64
-                  aria-controls="pills-map"
65
-                  aria-selected="false"
66
-                  v-on:click="updateType('Commercial')"
67
-                  >Commercial</a
68
-                >
69
-              </li>
70
-            </ul>
71
-            <div class="tab-content" id="pills-tabContent">
72
-              <div
73
-                class="tab-pane fade show active"
74
-                id="pills-video"
75
-                role="tabpanel"
76
-                aria-labelledby="pills-video-tab"
77
-              >
78
-                <timeshareSearch :keyword="keyword" />
79
-              </div>
80
-              <div
81
-                class="tab-pane fade"
82
-                id="pills-plans"
83
-                role="tabpanel"
84
-                aria-labelledby="pills-plans-tab"
85
-              >
86
-                <propertySearch propertyType="Residential" />
87
-              </div>
88
-              <div
89
-                class="tab-pane fade"
90
-                id="pills-map"
91
-                role="tabpanel"
92
-                aria-labelledby="pills-map-tab"
93
-              >
94
-                <propertySearch propertyType="Commercial" />
95
-              </div>
96
-            </div>
29
+          <div class="col-md-2">
30
+            <button
31
+              type="button"
32
+              :class="[selectedPropertyType === 'Timeshare' ? 'tabButton isSelected' : 'tabButton isUnSelected']"
33
+              @click="setTypeTimeshare"
34
+            >
35
+              <b>Timeshare</b>
36
+            </button>
37
+          </div>
38
+          <div class="col-md-2">
39
+            <button
40
+              type="button"
41
+              :class="[selectedPropertyType === 'Residential' ? 'tabButton isSelected' : 'tabButton isUnSelected']"
42
+              @click="setTypeResidential"
43
+            >
44
+              <b>Residential</b>
45
+            </button>
46
+          </div>
47
+          <div class="col-md-2">
48
+            <button
49
+              type="button"
50
+              :class="[selectedPropertyType === 'Commercial' ? 'tabButton isSelected' : 'tabButton isUnSelected']"
51
+              @click="setTypeCommercial"
52
+            >
53
+              <b>Commercial</b>
54
+            </button>
55
+          </div>
56
+          <div class="col-md-12" v-if="selectedPropertyType === 'Timeshare'">
57
+            <timeshareSearch :keyword="keyword" />
58
+          </div>
59
+          <div class="col-md-12" v-else>
60
+            <propertySearch :propertyType="selectedPropertyType" />
97
           </div>
61
           </div>
98
           <div class="col-md-12">
62
           <div class="col-md-12">
99
-            <button type="submit" class="btn btn-b-n" @click="Search">Search</button>
63
+            <button type="button" class="btn btn-b-n" @click="Search">Search</button>
100
           </div>
64
           </div>
101
         </div>
65
         </div>
102
       </form>
66
       </form>
116
   },
80
   },
117
   data() {
81
   data() {
118
     return {
82
     return {
119
-      selectedPropertyType: 'timeshare',
83
+      selectedPropertyType: 'Timeshare',
120
       keyword: '',
84
       keyword: '',
121
     };
85
     };
122
   },
86
   },
129
       this.selectedPropertyType = item;
93
       this.selectedPropertyType = item;
130
     },
94
     },
131
     Search() {
95
     Search() {
132
-      if (this.selectedPropertyType === 'timeshare') {
96
+      if (this.selectedPropertyType === 'Timeshare') {
133
         this.$router.push('/timesharesearch');
97
         this.$router.push('/timesharesearch');
134
       } else {
98
       } else {
135
-        this.propertySearch.propertyUsageType = this.selectedPropertyType;
136
         this.$router.push('/property/propertySearch/results');
99
         this.$router.push('/property/propertySearch/results');
137
       }
100
       }
138
     },
101
     },
102
+    setTypeTimeshare() {
103
+      this.selectedPropertyType = 'Timeshare';
104
+    },
105
+    setTypeResidential() {
106
+      this.selectedPropertyType = 'Residential';
107
+    },
108
+    setTypeCommercial() {
109
+      this.selectedPropertyType = 'Commercial';
110
+    },
139
   },
111
   },
140
 };
112
 };
141
 </script>
113
 </script>

+ 1
- 3
src/components/user/loginPage.vue Vedi File

33
                   <input
33
                   <input
34
                     class="form-control"
34
                     class="form-control"
35
                     type="text"
35
                     type="text"
36
-                    name="username"
37
                     placeholder="Username"
36
                     placeholder="Username"
38
                     v-model="username"
37
                     v-model="username"
39
                     value
38
                     value
51
                     v-model="password"
50
                     v-model="password"
52
                     id="password"
51
                     id="password"
53
                     placeholder="Password"
52
                     placeholder="Password"
54
-                    name="password"
55
                     value
53
                     value
56
                   />
54
                   />
57
                   <div class="input-group-append">
55
                   <div class="input-group-append">
136
           if (this.$store.state.authentication.status === 'error') {
134
           if (this.$store.state.authentication.status === 'error') {
137
             this.$router.push('/user/login');
135
             this.$router.push('/user/login');
138
           } else {
136
           } else {
139
-            this.$router.push('/about/us');
137
+            this.$router.push('/');
140
           }
138
           }
141
         },
139
         },
142
       );
140
       );

+ 198
- 66
src/components/user/timeshareIndividual.vue Vedi File

11
       <div class="row" style="text-align:left">
11
       <div class="row" style="text-align:left">
12
         <div class="col-md-6">
12
         <div class="col-md-6">
13
           <label>Name *</label>
13
           <label>Name *</label>
14
-          <div class="input-group-prepend">
15
-            <span class="input-group-text">
16
-              <eva-icon name="person-outline" fill="#60CBEB"></eva-icon>
17
-            </span>
18
-            <input class="form-control" type="text" name="name" v-model="currentUser.name" />
19
-          </div>
14
+          <prop-field
15
+            :display="currentUser.name"
16
+            :editType="'text'"
17
+            :propertyName="'name'"
18
+            :mayEdit="true"
19
+            @UpdateValue="UpdateValue"
20
+          />
20
         </div>
21
         </div>
21
         <div class="col-md-6" style="margin-bottom: 1em">
22
         <div class="col-md-6" style="margin-bottom: 1em">
22
           <label>Surname *</label>
23
           <label>Surname *</label>
23
-          <div class="input-group-prepend">
24
-            <span class="input-group-text">
25
-              <eva-icon name="book-outline" fill="#60CBEB"></eva-icon>
26
-            </span>
27
-            <input class="form-control" type="text" name="surname" v-model="currentUser.surname" />
28
-          </div>
24
+          <prop-field
25
+            :display="currentUser.surname"
26
+            :editType="'text'"
27
+            :propertyName="'surname'"
28
+            :mayEdit="true"
29
+            @UpdateValue="UpdateValue"
30
+          />
29
         </div>
31
         </div>
30
         <div class="col-md-6" style="margin-bottom: 1em">
32
         <div class="col-md-6" style="margin-bottom: 1em">
31
           <label>ID Number *</label>
33
           <label>ID Number *</label>
32
-          <div class="input-group-prepend">
33
-            <span class="input-group-text">
34
-              <eva-icon name="archive" fill="#60CBEB"></eva-icon>
35
-            </span>
36
-            <input class="form-control" type="text" name="idnumber" v-model="currentUser.idNumber" />
37
-          </div>
34
+          <prop-field
35
+            :display="currentUser.idNumber"
36
+            :editType="'text'"
37
+            :propertyName="'idNumber'"
38
+            :mayEdit="true"
39
+            @UpdateValue="UpdateValue"
40
+          />
38
         </div>
41
         </div>
39
         <div class="col-md-6" style="margin-bottom: 1em">
42
         <div class="col-md-6" style="margin-bottom: 1em">
40
           <label>Company Reg Number *</label>
43
           <label>Company Reg Number *</label>
41
-          <div class="input-group-prepend">
42
-            <span class="input-group-text">
43
-              <eva-icon name="npm-outline" fill="#60CBEB"></eva-icon>
44
-            </span>
45
-            <input
46
-              class="form-control"
47
-              type="text"
48
-              name="companyregnumber"
49
-              v-model="currentUser.companyRegNumber"
50
-            />
51
-          </div>
44
+          <prop-field
45
+            :display="currentUser.companyRegNumber"
46
+            :editType="'text'"
47
+            :propertyName="'companyRegNumber'"
48
+            :mayEdit="true"
49
+            @UpdateValue="UpdateValue"
50
+          />
52
         </div>
51
         </div>
53
         <div class="col-md-6" style="margin-bottom: 1em">
52
         <div class="col-md-6" style="margin-bottom: 1em">
54
           <label>Marital Status *</label>
53
           <label>Marital Status *</label>
55
-          <div class="input-group-prepend">
56
-            <span class="input-group-text">
57
-              <eva-icon name="people-outline" fill="#60CBEB"></eva-icon>
58
-            </span>
59
-            <select class="form-control" name="maritalstatus" v-model="currentUser.maritalStatus">
60
-              <option v-for="(item, i) in maritalStatus" :key="i">{{item}}</option>
61
-            </select>
62
-          </div>
54
+          <prop-field
55
+            :display="currentUser.maritalStatus"
56
+            :arrayObject="maritalStatus"
57
+            :editType="'selector'"
58
+            :propertyName="'maritalStatus'"
59
+            :mayEdit="true"
60
+            @UpdateValue="UpdateValue"
61
+          />
63
         </div>
62
         </div>
64
         <div class="col-md-6" style="margin-bottom: 1em">
63
         <div class="col-md-6" style="margin-bottom: 1em">
65
           <label>Email Address *</label>
64
           <label>Email Address *</label>
66
-          <div class="input-group-prepend">
67
-            <span class="input-group-text">
68
-              <eva-icon name="email-outline" fill="#60CBEB"></eva-icon>
69
-            </span>
70
-            <input class="form-control" type="text" name="email" v-model="currentUser.emailAddress" />
71
-          </div>
65
+          <prop-field
66
+            :display="currentUser.emailAddress"
67
+            :editType="'text'"
68
+            :propertyName="'email'"
69
+            :mayEdit="true"
70
+            @UpdateValue="UpdateValue"
71
+          />
72
         </div>
72
         </div>
73
         <div class="col-md-6" style="margin-bottom: 1em">
73
         <div class="col-md-6" style="margin-bottom: 1em">
74
           <label>Cell Number *</label>
74
           <label>Cell Number *</label>
75
-          <div class="input-group-prepend">
76
-            <span class="input-group-text">
77
-              <eva-icon name="smartphone-outline" fill="#60CBEB"></eva-icon>
78
-            </span>
79
-            <input
80
-              class="form-control"
81
-              type="text"
82
-              name="cellnumber"
83
-              v-model="currentUser.cellNumber"
84
-            />
85
-          </div>
75
+          <prop-field
76
+            :display="currentUser.cellNumber"
77
+            :editType="'text'"
78
+            :propertyName="'cellNumber'"
79
+            :mayEdit="true"
80
+            @UpdateValue="UpdateValue"
81
+          />
86
         </div>
82
         </div>
87
         <div class="col-md-6" style="margin-bottom: 1em">
83
         <div class="col-md-6" style="margin-bottom: 1em">
88
           <label>Landline Number *</label>
84
           <label>Landline Number *</label>
89
-          <div class="input-group-prepend">
90
-            <span class="input-group-text">
91
-              <eva-icon name="phone-outline" fill="#60CBEB"></eva-icon>
92
-            </span>
93
-            <input
94
-              class="form-control"
95
-              type="text"
96
-              name="landline"
97
-              v-model="currentUser.landlineNumber"
98
-            />
99
-          </div>
85
+          <prop-field
86
+            :display="currentUser.landlineNumber"
87
+            :editType="'text'"
88
+            :propertyName="'landlineNumber'"
89
+            :mayEdit="true"
90
+            @UpdateValue="UpdateValue"
91
+          />
100
         </div>
92
         </div>
101
       </div>
93
       </div>
102
     </div>
94
     </div>
108
       <hr />
100
       <hr />
109
       <BankAccount :bank="currentUser ? currentUser.bankingDetails : {}" />
101
       <BankAccount :bank="currentUser ? currentUser.bankingDetails : {}" />
110
     </div>
102
     </div>
103
+    <div class="row">
104
+      <div class="col-md-2 offset-3">
105
+        <button @click="SubmitData()" type="button" class="btn btn-b-n">Save</button>
106
+      </div>
107
+      <div class="col-md-2 offset-3">
108
+        <button @click="Close()" type="button" class="btn btn-b-n">Close</button>
109
+      </div>
110
+    </div>
111
   </div>
111
   </div>
112
 </template>
112
 </template>
113
 
113
 
116
 import BankAccount from '../shared/bankAccount.vue';
116
 import BankAccount from '../shared/bankAccount.vue';
117
 import Address from '../misc/address.vue';
117
 import Address from '../misc/address.vue';
118
 import SelectIndividual from './selectIndividual.vue';
118
 import SelectIndividual from './selectIndividual.vue';
119
+import propField from '../property/propertyFieldEditor.vue';
120
+import items from '../../assets/staticData/itemsPerPage';
119
 
121
 
120
 export default {
122
 export default {
121
   components: {
123
   components: {
122
     BankAccount,
124
     BankAccount,
123
     Address,
125
     Address,
124
     SelectIndividual,
126
     SelectIndividual,
127
+    propField,
125
   },
128
   },
126
   data() {
129
   data() {
127
     return {
130
     return {
151
   },
154
   },
152
   computed: {
155
   computed: {
153
     ...mapState('timeshare', ['maritalStatus']),
156
     ...mapState('timeshare', ['maritalStatus']),
157
+    ...mapState('individual', ['indiv']),
158
+    ...mapState('searchTab', ['provinces', 'cities', 'suburbs']),
154
     ...mapGetters({
159
     ...mapGetters({
155
       user: 'authentication/getUser',
160
       user: 'authentication/getUser',
156
     }),
161
     }),
157
   },
162
   },
158
   methods: {
163
   methods: {
159
-    ...mapActions('individual', ['getIndividual']),
164
+    ...mapActions('individual', ['getIndividual', 'updateIndividual']),
165
+    ...mapActions('searchTab', ['getProvince', 'getCities', 'getSuburbs']),
160
     onSelectedItemItemChange(item) {
166
     onSelectedItemItemChange(item) {
161
       this.currentUser = item;
167
       this.currentUser = item;
162
     },
168
     },
169
+    ProvinceSelected(item) {
170
+      if (item.target.options.selectedIndex > 0) {
171
+        this.selectedProvince = this.provinces[
172
+          item.target.options.selectedIndex - 1
173
+        ].description;
174
+        this.getCities(Object.assign({}, { province: this.selectedProvince }));
175
+      }
176
+    },
177
+    CitySelected(item) {
178
+      if (item.target.options.selectedIndex > 0) {
179
+        this.selectedCity = this.cities[
180
+          item.target.options.selectedIndex - 1
181
+        ].description;
182
+        this.getSuburbs(
183
+          Object.assign(
184
+            {},
185
+            { province: this.selectedProvince, city: this.selectedCity },
186
+          ),
187
+        );
188
+      }
189
+    },
190
+    getPostalCode(item) {
191
+      this.address.postalCode = this.suburbs[
192
+        item.target.options.selectedIndex - 1
193
+      ].postalCode;
194
+    },
195
+    UpdateValue(item) {
196
+      if (item.fieldName) {
197
+        if (item.fieldName === 'name') {
198
+          this.currentUser.name = item.value;
199
+        }
200
+        if (item.fieldName === 'surname') {
201
+          this.currentUser.surname = item.value;
202
+        }
203
+        if (item.fieldName === 'idNumber') {
204
+          this.currentUser.idNumber = item.value;
205
+        }
206
+        if (item.fieldName === 'companyRegNumber') {
207
+          this.currentUser.companyRegNumber = item.value;
208
+        }
209
+        if (item.fieldName === 'maritalStatus') {
210
+          this.currentUser.maritalStatus = item.value;
211
+        }
212
+        if (item.fieldName === 'email') {
213
+          this.currentUser.emailAddress = item.value;
214
+        }
215
+        if (item.fieldName === 'cellNumber') {
216
+          this.currentUser.cellNumber = item.value;
217
+        }
218
+        if (item.fieldName === 'landlineNumber') {
219
+          this.currentUser.landlineNumber = item.value;
220
+        }
221
+        if (item.fieldName === 'streetNumber') {
222
+          this.currentUser.address.streetNumber = item.value;
223
+        }
224
+        if (item.fieldName === 'street') {
225
+          this.currentUser.address.street = item.value;
226
+        }
227
+        if (item.fieldName === 'province') {
228
+          if (item.value !== '') {
229
+            this.address.province = this.provinces.find(
230
+              p => p.description === item.value,
231
+            );
232
+            this.address.provinceId = this.address.province.id;
233
+            this.getCities(Object.assign({}, { province: item.value }));
234
+            this.address.city = null;
235
+            this.address.suburb = null;
236
+            this.address.postalCode = '';
237
+          } else {
238
+            this.address.province = null;
239
+            this.address.city = null;
240
+            this.address.suburb = null;
241
+            this.address.postalCode = '';
242
+            this.cities = [];
243
+            this.suburbs = [];
244
+          }
245
+        }
246
+        if (item.fieldName === 'city') {
247
+          if (item.value !== '') {
248
+            const newCity = this.cities.find(p => p.description === item.value);
249
+            this.address.city = newCity;
250
+            this.address.cityId = newCity.id;
251
+            this.getSuburbs(
252
+              Object.assign(
253
+                {},
254
+                {
255
+                  province: this.address.province.description,
256
+                  city: item.value,
257
+                },
258
+              ),
259
+            );
260
+            this.address.suburb = null;
261
+            this.address.postalCode = '';
262
+          } else {
263
+            this.address.city = null;
264
+            this.address.suburb = null;
265
+            this.address.postalCode = '';
266
+            this.suburbs = [];
267
+          }
268
+        }
269
+        if (item.fieldName === 'suburb') {
270
+          if (item.value !== '') {
271
+            const newSuburb = this.suburbs.find(
272
+              p => p.description === item.value,
273
+            );
274
+            this.address.suburb = newSuburb;
275
+            this.address.suburbId = newSuburb.id;
276
+            this.address.postalCode = this.address.suburb.postalCode;
277
+          } else {
278
+            this.address.suburb = null;
279
+            this.address.postalCode = '';
280
+          }
281
+        }
282
+      }
283
+    },
284
+    SubmitData() {
285
+      console.log(this.currentUser);
286
+      this.updateIndividual(this.currentUser);
287
+      this.$router.push('/status/userManagementPage');
288
+    },
289
+    Close() {
290
+      this.$router.push('/status/userManagementPage');
291
+    },
292
+  },
293
+  mounted() {
294
+    this.getProvince();
163
   },
295
   },
164
 };
296
 };
165
 </script>
297
 </script>

+ 5
- 4
src/components/user/updateProfileInfo.vue Vedi File

15
           enctype="multipart/form-data"
15
           enctype="multipart/form-data"
16
         >
16
         >
17
           <div class="col-md-12" style="text-align:left"></div>
17
           <div class="col-md-12" style="text-align:left"></div>
18
-          <DetailIndividual :currentUser="sellItem.owner" :showBank="true" :showAddress="true" />
18
+          <DetailIndividual :currentUser="user" :showBank="true" :showAddress="true" />
19
+          <br />
19
         </form>
20
         </form>
20
       </div>
21
       </div>
21
     </div>
22
     </div>
29
 export default {
30
 export default {
30
   name: 'UpdateInfo',
31
   name: 'UpdateInfo',
31
   data() {
32
   data() {
32
-    return { selectedItem: {} };
33
+    return { selectedItem: {}, individual: {} };
33
   },
34
   },
34
   props: {},
35
   props: {},
35
   components: {
36
   components: {
53
       'agents',
54
       'agents',
54
     ]),
55
     ]),
55
     ...mapState('individual', ['indiv']),
56
     ...mapState('individual', ['indiv']),
56
-    ...mapState('authentication', ['isLoggedIn']),
57
+    ...mapState('authentication', ['isLoggedIn', 'user']),
57
     ...mapGetters({
58
     ...mapGetters({
58
       user: 'authentication/getUser',
59
       user: 'authentication/getUser',
59
       person: 'authentication/getPerson',
60
       person: 'authentication/getPerson',
63
     },
64
     },
64
   },
65
   },
65
   methods: {
66
   methods: {
66
-    ...mapActions('individual', ['getIndividual']),
67
+    ...mapActions('individual', ['getIndividual', 'updateIndividual']),
67
     onSelectedItemItemChange(item) {
68
     onSelectedItemItemChange(item) {
68
       this.currentUser = item;
69
       this.currentUser = item;
69
     },
70
     },

+ 0
- 5
src/router/index.js Vedi File

134
       name: 'PropertyPage',
134
       name: 'PropertyPage',
135
       component: PropertyPage,
135
       component: PropertyPage,
136
     },
136
     },
137
-    {
138
-      path: '/property/:propertyUsageType/search',
139
-      name: 'PropertySearch',
140
-      component: PropertySearch,
141
-    },
142
     {
137
     {
143
       path: '/property/search',
138
       path: '/property/search',
144
       name: 'PropertySearchTab',
139
       name: 'PropertySearchTab',

+ 3
- 0
src/store/modules/property/property.js Vedi File

1
 import axios from 'axios';
1
 import axios from 'axios';
2
+import { Date } from 'core-js';
2
 
3
 
3
 export default {
4
 export default {
4
   namespaced: true,
5
   namespaced: true,
27
       virtualTour: '',
28
       virtualTour: '',
28
       video: '',
29
       video: '',
29
       userId: 0,
30
       userId: 0,
31
+      dateAvailable: Date,
30
     },
32
     },
31
     propertyImages: [],
33
     propertyImages: [],
32
     propertyTypes: [],
34
     propertyTypes: [],
87
         virtualTour: '',
89
         virtualTour: '',
88
         video: '',
90
         video: '',
89
         userId: 0,
91
         userId: 0,
92
+        dateAvailable: Date,
90
       };
93
       };
91
     },
94
     },
92
     clearPropertyImages(state) {
95
     clearPropertyImages(state) {

+ 16
- 16
src/store/modules/property/propertySearch.js Vedi File

1
+/* eslint-disable valid-typeof */
1
 /* eslint-disable max-len */
2
 /* eslint-disable max-len */
2
 /* eslint-disable indent */
3
 /* eslint-disable indent */
3
 import axios from 'axios';
4
 import axios from 'axios';
16
       suburb: 'All',
17
       suburb: 'All',
17
       minPrice: 0,
18
       minPrice: 0,
18
       maxPrice: 0,
19
       maxPrice: 0,
20
+      availableFrom: undefined,
21
+      propertyId: 0,
19
     },
22
     },
20
     properties: [],
23
     properties: [],
21
     latestProperties: [],
24
     latestProperties: [],
22
     suburbs: [],
25
     suburbs: [],
23
     searchText: '',
26
     searchText: '',
24
     suburbList: [],
27
     suburbList: [],
28
+    resultsShowing: false,
25
   },
29
   },
26
   mutations: {
30
   mutations: {
27
     updateSearch(state, propertySearch) {
31
     updateSearch(state, propertySearch) {
35
       state.propertySearch = search;
39
       state.propertySearch = search;
36
     },
40
     },
37
     onClearFilter(state, filter) {
41
     onClearFilter(state, filter) {
38
-      state.propertySearch[filter] = 'All';
42
+      if (filter === 'availableFrom') {
43
+        state.propertySearch[filter] = undefined;
44
+      } else {
45
+        state.propertySearch[filter] = 'All';
46
+      }
39
     },
47
     },
40
     setSuburbs(state, items) {
48
     setSuburbs(state, items) {
41
       state.suburbList = [];
49
       state.suburbList = [];
48
     setFilter(state, value) {
56
     setFilter(state, value) {
49
       state.searchText = value;
57
       state.searchText = value;
50
     },
58
     },
59
+    setResultsShowing(state, value) {
60
+      state.resultsShowing = value;
61
+    },
51
   },
62
   },
52
   getters: {
63
   getters: {
53
     filterSuburbs: (state) => {
64
     filterSuburbs: (state) => {
62
     clearFilter({ commit }, filter) {
73
     clearFilter({ commit }, filter) {
63
       commit('onClearFilter', filter);
74
       commit('onClearFilter', filter);
64
     },
75
     },
65
-    getPropertySearchObject({ commit }) {
66
-      const search = {
67
-        userName: '',
68
-        salesType: 'Sale',
69
-        propertyUsageType: 'All',
70
-        propertyType: 'All',
71
-        province: 'All',
72
-        city: 'All',
73
-        suburb: 'All',
74
-        minPrice: 0,
75
-        maxPrice: 0,
76
-      };
77
-      commit('setPropertySearch', search);
78
-    },
79
     searchProperties({ commit }, item) {
76
     searchProperties({ commit }, item) {
80
       if (item.keyword === '') {
77
       if (item.keyword === '') {
81
         item.keyword = 'All';
78
         item.keyword = 'All';
94
       }
91
       }
95
       axios
92
       axios
96
         .get(
93
         .get(
97
-          `/api/Property/Search/${item.userName}/${item.keyword}/${item.salesType}/${item.propertyUsageType}/${item.propertyType}/${item.province}/${item.city}/${item.suburb}/${item.minPrice}/${item.maxPrice}`,
94
+          `/api/Property/Search/${item.userName}/${item.keyword}/${item.salesType}/${item.propertyUsageType}/${item.propertyType}/${item.province}/${item.city}/${item.suburb}/${item.minPrice}/${item.maxPrice}/${item.availableFrom}/${item.propertyId}`,
98
         )
95
         )
99
         .then(result => commit('updateSearch', result.data))
96
         .then(result => commit('updateSearch', result.data))
100
         .catch(console.error);
97
         .catch(console.error);
114
     applyFilter({ commit }, value) {
111
     applyFilter({ commit }, value) {
115
       commit('setFilter', { value });
112
       commit('setFilter', { value });
116
     },
113
     },
114
+    updateResultsShowing({ commit }, value) {
115
+      commit('setResultsShowing', value);
116
+    },
117
   },
117
   },
118
 };
118
 };

+ 15
- 4
src/store/modules/user/individual.js Vedi File

26
       } else id = userId;
26
       } else id = userId;
27
       axios
27
       axios
28
         .get(`/api/individual/getIndividual/${id}`)
28
         .get(`/api/individual/getIndividual/${id}`)
29
-        .then(r => commit('setItem', {
29
+        .then((r) => {
30
+          console.log(JSON.stringify(r));
31
+          commit('setItem', {
30
             name: 'indiv',
32
             name: 'indiv',
31
             value: r.data,
33
             value: r.data,
32
-          }),)
34
+          });
35
+        })
33
         .catch(console.error);
36
         .catch(console.error);
34
     },
37
     },
35
     getAllIndividuals({ commit }) {
38
     getAllIndividuals({ commit }) {
36
       axios
39
       axios
37
         .get('/api/individual/getAllIndividuals')
40
         .get('/api/individual/getAllIndividuals')
38
-        .then(x => commit('setItem', {
41
+        .then((x) => {
42
+          commit('setItem', {
39
             name: 'items',
43
             name: 'items',
40
             value: x.data,
44
             value: x.data,
41
-          }),)
45
+          });
46
+        })
47
+        .catch(console.error);
48
+    },
49
+    updateIndividual({ commit }, item) {
50
+      axios
51
+        .put('/api/individual', item)
52
+        .then(result => commit('setItem', item))
42
         .catch(console.error);
53
         .catch(console.error);
43
     },
54
     },
44
   },
55
   },

Loading…
Annulla
Salva