|
@@ -4,9 +4,9 @@
|
4
|
4
|
<div class="container pb-5">
|
5
|
5
|
<div class="row">
|
6
|
6
|
<div class="col">
|
7
|
|
- <label v-if="!salesType" class="uniSelectLabel" for="saleType">Sale Type</label>
|
|
7
|
+ <label v-if="!salesType" class="uniSelectLabel" for="resSaleType">Sale Type</label>
|
8
|
8
|
<float-label label="Sale Type">
|
9
|
|
- <select class="form-control uniSelect mb-3" name="saleType" v-model="salesType">
|
|
9
|
+ <select class="form-control uniSelect mb-3" name="resSaleType" v-model="salesType">
|
10
|
10
|
<option value="Sale">To Sell</option>
|
11
|
11
|
<option value="Rental">To Rent</option>
|
12
|
12
|
</select>
|
|
@@ -22,7 +22,7 @@
|
22
|
22
|
<input
|
23
|
23
|
class="form-control uniInput"
|
24
|
24
|
type="text"
|
25
|
|
- name="propertyName"
|
|
25
|
+ name="resPropertyName"
|
26
|
26
|
v-model="property.propertyName"
|
27
|
27
|
/>
|
28
|
28
|
</float-label>
|
|
@@ -35,7 +35,7 @@
|
35
|
35
|
<input
|
36
|
36
|
class="form-control uniInput"
|
37
|
37
|
type="text"
|
38
|
|
- name="propertyRef"
|
|
38
|
+ name="resPropertyRef"
|
39
|
39
|
v-model="property.propertyRef"
|
40
|
40
|
/>
|
41
|
41
|
</float-label>
|
|
@@ -45,17 +45,15 @@
|
45
|
45
|
<div class="col-md-6">
|
46
|
46
|
<select
|
47
|
47
|
class="form-control uniSelect"
|
48
|
|
- name="propertyType"
|
49
|
|
- id="propertyType"
|
|
48
|
+ name="resPropertyType"
|
|
49
|
+ id="resPropertyType"
|
50
|
50
|
v-model="property.propertyTypeId"
|
51
|
51
|
@change="PropertyTypeSelected"
|
52
|
52
|
>
|
53
|
53
|
<option value="0">Please select type *</option>
|
54
|
|
- <option
|
55
|
|
- v-for="item in propertyTypes"
|
56
|
|
- :value="item.id"
|
57
|
|
- :key="item.id"
|
58
|
|
- >{{ item.description }}</option>
|
|
54
|
+ <option v-for="item in propertyTypes" :value="item.id" :key="item.id">{{
|
|
55
|
+ item.description
|
|
56
|
+ }}</option>
|
59
|
57
|
</select>
|
60
|
58
|
</div>
|
61
|
59
|
</div>
|
|
@@ -74,19 +72,20 @@
|
74
|
72
|
<div class="col-md-6">
|
75
|
73
|
<div v-if="property.price < 1">
|
76
|
74
|
<label
|
77
|
|
- for="price"
|
|
75
|
+ for="resPrice"
|
78
|
76
|
class="uniSelectLabel"
|
79
|
77
|
style="text-transform:uppercase; margin-left:17px; background-color:white"
|
80
|
|
- >{{ salesType }} Price</label>
|
|
78
|
+ >{{ salesType }} Price</label
|
|
79
|
+ >
|
81
|
80
|
</div>
|
82
|
81
|
<float-label label="Price">
|
83
|
82
|
<currency-input
|
84
|
83
|
onclick="this.setSelectionRange(0, this.value.length)"
|
85
|
|
- name="price"
|
|
84
|
+ name="resPrice"
|
86
|
85
|
:value="property.price"
|
87
|
86
|
@input="property.price = $event"
|
88
|
87
|
v-model="property.price"
|
89
|
|
- id="price"
|
|
88
|
+ id="resPrice"
|
90
|
89
|
class="form-control uniInput"
|
91
|
90
|
/>
|
92
|
91
|
</float-label>
|
|
@@ -94,8 +93,8 @@
|
94
|
93
|
<div v-if="salesType === 'Rental'" class="col-md-6">
|
95
|
94
|
<select
|
96
|
95
|
class="form-control uniSelect"
|
97
|
|
- name="propertyType"
|
98
|
|
- id="propertyType"
|
|
96
|
+ name="resPropertyType"
|
|
97
|
+ id="resPropertyType"
|
99
|
98
|
v-model="property.pricePer"
|
100
|
99
|
>
|
101
|
100
|
<option value>Please select</option>
|
|
@@ -109,7 +108,7 @@
|
109
|
108
|
<input
|
110
|
109
|
type="date"
|
111
|
110
|
class="form-control uniInput"
|
112
|
|
- name="date"
|
|
111
|
+ name="resDate"
|
113
|
112
|
v-model="property.dateAvailable"
|
114
|
113
|
/>
|
115
|
114
|
</div>
|
|
@@ -120,13 +119,13 @@
|
120
|
119
|
<div class="row my-3">
|
121
|
120
|
<div class="col-md-12">
|
122
|
121
|
<div v-if="!property.streetNumber">
|
123
|
|
- <label for="streetNumber" class="uniSelectLabel">STREET NUMBER</label>
|
|
122
|
+ <label for="resStreetNumber" class="uniSelectLabel">STREET NUMBER</label>
|
124
|
123
|
</div>
|
125
|
124
|
<input
|
126
|
125
|
class="form-control uniInput"
|
127
|
126
|
type="text"
|
128
|
|
- name="streetNumber"
|
129
|
|
- id="streetNumber"
|
|
127
|
+ name="resStreetNumber"
|
|
128
|
+ id="resStreetNumber"
|
130
|
129
|
v-model="property.streetNumber"
|
131
|
130
|
/>
|
132
|
131
|
</div>
|
|
@@ -134,13 +133,13 @@
|
134
|
133
|
<div class="row my-3">
|
135
|
134
|
<div class="col-md-12">
|
136
|
135
|
<div v-if="!property.streetName">
|
137
|
|
- <label for="streetName" class="uniSelectLabel">STREET NAME</label>
|
|
136
|
+ <label for="resStreetName" class="uniSelectLabel">STREET NAME</label>
|
138
|
137
|
</div>
|
139
|
138
|
<input
|
140
|
139
|
class="form-control uniInput"
|
141
|
140
|
type="text"
|
142
|
|
- name="streetName"
|
143
|
|
- id="streetName"
|
|
141
|
+ name="resStreetName"
|
|
142
|
+ id="resStreetName"
|
144
|
143
|
v-model="property.streetName"
|
145
|
144
|
/>
|
146
|
145
|
</div>
|
|
@@ -148,13 +147,13 @@
|
148
|
147
|
<div class="row my-3">
|
149
|
148
|
<div class="col-md-12">
|
150
|
149
|
<div v-if="!property.suburb">
|
151
|
|
- <label for="suburb" class="uniSelectLabel">SUBURB</label>
|
|
150
|
+ <label for="resSuburb" class="uniSelectLabel">SUBURB</label>
|
152
|
151
|
</div>
|
153
|
152
|
<input
|
154
|
153
|
class="form-control uniInput"
|
155
|
154
|
type="text"
|
156
|
|
- name="suburb"
|
157
|
|
- id="suburb"
|
|
155
|
+ name="resSuburb"
|
|
156
|
+ id="resSuburb"
|
158
|
157
|
v-model="property.suburb"
|
159
|
158
|
/>
|
160
|
159
|
</div>
|
|
@@ -162,13 +161,13 @@
|
162
|
161
|
<div class="row my-3">
|
163
|
162
|
<div class="col-md-12">
|
164
|
163
|
<div v-if="!property.city">
|
165
|
|
- <label for="city" class="uniSelectLabel">CITY</label>
|
|
164
|
+ <label for="resCity" class="uniSelectLabel">CITY</label>
|
166
|
165
|
</div>
|
167
|
166
|
<input
|
168
|
167
|
class="form-control uniInput"
|
169
|
168
|
type="text"
|
170
|
|
- name="city"
|
171
|
|
- id="city"
|
|
169
|
+ name="resCity"
|
|
170
|
+ id="resCity"
|
172
|
171
|
v-model="property.city"
|
173
|
172
|
/>
|
174
|
173
|
</div>
|
|
@@ -176,13 +175,13 @@
|
176
|
175
|
<div class="row my-3">
|
177
|
176
|
<div class="col-md-12">
|
178
|
177
|
<div v-if="!property.province">
|
179
|
|
- <label for="province" class="uniSelectLabel">PROVINCE</label>
|
|
178
|
+ <label for="resProvince" class="uniSelectLabel">PROVINCE</label>
|
180
|
179
|
</div>
|
181
|
180
|
<input
|
182
|
181
|
class="form-control uniInput"
|
183
|
182
|
type="text"
|
184
|
|
- name="province"
|
185
|
|
- id="province"
|
|
183
|
+ name="resProvince"
|
|
184
|
+ id="resProvince"
|
186
|
185
|
v-model="property.province"
|
187
|
186
|
/>
|
188
|
187
|
</div>
|
|
@@ -190,13 +189,13 @@
|
190
|
189
|
<div class="row my-3">
|
191
|
190
|
<div class="col-md-12">
|
192
|
191
|
<div v-if="!property.postalCode">
|
193
|
|
- <label for="postalCode" class="uniSelectLabel">POSTAL CODE</label>
|
|
192
|
+ <label for="resPostalCode" class="uniSelectLabel">POSTAL CODE</label>
|
194
|
193
|
</div>
|
195
|
194
|
<input
|
196
|
195
|
class="form-control uniInput"
|
197
|
196
|
type="text"
|
198
|
|
- name="postalCode"
|
199
|
|
- id="postalCode"
|
|
197
|
+ name="resPostalCode"
|
|
198
|
+ id="resPostalCode"
|
200
|
199
|
v-model="property.postalCode"
|
201
|
200
|
/>
|
202
|
201
|
</div>
|
|
@@ -204,20 +203,22 @@
|
204
|
203
|
<div class="row my-3">
|
205
|
204
|
<div class="col-md-12">
|
206
|
205
|
<div v-if="!property.country">
|
207
|
|
- <label for="country" class="uniSelectLabel">COUNTRY</label>
|
|
206
|
+ <label for="resCountry" class="uniSelectLabel">COUNTRY</label>
|
208
|
207
|
</div>
|
209
|
208
|
<input
|
210
|
209
|
class="form-control uniInput"
|
211
|
210
|
type="text"
|
212
|
|
- name="country"
|
213
|
|
- id="country"
|
|
211
|
+ name="resCountry"
|
|
212
|
+ id="resCountry"
|
214
|
213
|
v-model="property.country"
|
215
|
214
|
/>
|
216
|
215
|
</div>
|
217
|
216
|
</div>
|
218
|
217
|
<div class="row my-3">
|
219
|
218
|
<div class="col-md-12">
|
220
|
|
- <button type="button" @click="clearAddress()" class="btn-solid-blue">Clear Address</button>
|
|
219
|
+ <button type="button" @click="clearAddress()" class="btn-solid-blue">
|
|
220
|
+ Clear Address
|
|
221
|
+ </button>
|
221
|
222
|
</div>
|
222
|
223
|
</div>
|
223
|
224
|
</div>
|
|
@@ -237,42 +238,10 @@
|
237
|
238
|
<div class="section-header">
|
238
|
239
|
<h2>Property Information</h2>
|
239
|
240
|
</div>
|
240
|
|
-
|
241
|
|
- <div v-for="item in propertyFields" :key="item.id">
|
242
|
|
- <div v-if="item.name === 'Residential Fields'">
|
243
|
|
- <UserField
|
244
|
|
- :fields="item.fields"
|
245
|
|
- :id="item.name"
|
246
|
|
- @UpdateUserDefinedFields="UpdateUserDefinedFields"
|
247
|
|
- :fieldValues="item.fields"
|
248
|
|
- />
|
249
|
|
- </div>
|
250
|
|
- </div>
|
251
|
|
- <!-- <UserField
|
252
|
|
- v-if="propertyOverviewFields.length > 0"
|
253
|
|
- :fields="propertyOverviewFields[0].fields"
|
254
|
|
- @UpdateUserDefinedFields="UpdateUserDefinedFields"
|
255
|
|
- :id="1"
|
256
|
|
- ></UserField>-->
|
257
|
|
- <!-- <div class="row">
|
258
|
|
- <div class="col-md-12">
|
259
|
|
- <div v-for="item in propertyFields" :key="item.id">
|
260
|
|
- <div class="row">
|
261
|
|
- <div class="col-sm-12">
|
262
|
|
- <div class="section-header">
|
263
|
|
- <h2>{{ item.name }}</h2>
|
264
|
|
- </div>
|
265
|
|
- </div>
|
266
|
|
- </div>
|
267
|
|
- <UserField
|
268
|
|
- :fields="item.fields"
|
269
|
|
- :id="item.name"
|
270
|
|
- @UpdateUserDefinedFields="UpdateUserDefinedFields"
|
271
|
|
- :fieldValues="item.fields"
|
272
|
|
- />
|
273
|
|
- </div>
|
274
|
|
- </div>
|
275
|
|
- </div>-->
|
|
241
|
+ <UserField
|
|
242
|
+ :fields="propFields"
|
|
243
|
+ @UpdateUserDefinedFields="UpdateUserResidentialFields"
|
|
244
|
+ ></UserField>
|
276
|
245
|
<div class="row">
|
277
|
246
|
<div class="col-sm-12">
|
278
|
247
|
<div class="section-header">
|
|
@@ -288,8 +257,8 @@
|
288
|
257
|
<input
|
289
|
258
|
class="form-control uniInput"
|
290
|
259
|
type="link"
|
291
|
|
- name="vtlink"
|
292
|
|
- id="vtlink"
|
|
260
|
+ name="resVtlink"
|
|
261
|
+ id="resVtlink"
|
293
|
262
|
v-model="property.virtualTour"
|
294
|
263
|
/>
|
295
|
264
|
</float-label>
|
|
@@ -304,8 +273,8 @@
|
304
|
273
|
<input
|
305
|
274
|
class="form-control uniInput"
|
306
|
275
|
type="link"
|
307
|
|
- name="vlink"
|
308
|
|
- id="vlink"
|
|
276
|
+ name="resVlink"
|
|
277
|
+ id="resVlink"
|
309
|
278
|
v-model="property.video"
|
310
|
279
|
/>
|
311
|
280
|
</float-label>
|
|
@@ -326,9 +295,13 @@
|
326
|
295
|
:savedImages="propertyImages"
|
327
|
296
|
@DefaultImage="UpdateDefaultImage"
|
328
|
297
|
/>
|
329
|
|
- <button v-if="!wait" type="button" @click="SubmitData()" class="btn-solid-blue">Save</button>
|
|
298
|
+ <button v-if="!wait" type="button" @click="SubmitData()" class="btn-solid-blue">
|
|
299
|
+ Save
|
|
300
|
+ </button>
|
330
|
301
|
<div v-if="showPropertyTypeError">
|
331
|
|
- <p class="alert myError">Missing fields. Please fill in all required fields. Marked with *</p>
|
|
302
|
+ <p class="alert myError">
|
|
303
|
+ Missing fields. Please fill in all required fields. Marked with *
|
|
304
|
+ </p>
|
332
|
305
|
</div>
|
333
|
306
|
<div v-if="wait" id="preloader"></div>
|
334
|
307
|
</div>
|
|
@@ -353,7 +326,10 @@ export default {
|
353
|
326
|
ImageLoad,
|
354
|
327
|
VueEditor,
|
355
|
328
|
carouselSection,
|
356
|
|
- mapSection,
|
|
329
|
+ mapSection
|
|
330
|
+ },
|
|
331
|
+ props: {
|
|
332
|
+ propFields: {}
|
357
|
333
|
},
|
358
|
334
|
data() {
|
359
|
335
|
return {
|
|
@@ -366,22 +342,17 @@ export default {
|
366
|
342
|
customToolbar: [
|
367
|
343
|
[{ header: [false, 1, 2, 3, 4, 5, 6] }],
|
368
|
344
|
["bold", "italic", "underline", "strike"],
|
369
|
|
- [
|
370
|
|
- { align: "" },
|
371
|
|
- { align: "center" },
|
372
|
|
- { align: "right" },
|
373
|
|
- { align: "justify" },
|
374
|
|
- ],
|
|
345
|
+ [{ align: "" }, { align: "center" }, { align: "right" }, { align: "justify" }],
|
375
|
346
|
[{ list: "ordered" }, { list: "bullet" }, { list: "check" }],
|
376
|
347
|
[{ script: "sub" }, { script: "super" }],
|
377
|
|
- [{ indent: "-1" }, { indent: "+1" }],
|
|
348
|
+ [{ indent: "-1" }, { indent: "+1" }]
|
378
|
349
|
],
|
379
|
350
|
error: "",
|
380
|
351
|
addressSet: false,
|
381
|
352
|
showPropertyTypeError: false,
|
382
|
353
|
showDateError: false,
|
383
|
354
|
user: Log.getUser(),
|
384
|
|
- mayEdit: Log.isLoggedIn(),
|
|
355
|
+ mayEdit: Log.isLoggedIn()
|
385
|
356
|
};
|
386
|
357
|
},
|
387
|
358
|
methods: {
|
|
@@ -396,7 +367,7 @@ export default {
|
396
|
367
|
"getPropertyEditDisplay",
|
397
|
368
|
"getPropertySavedOverviewFields",
|
398
|
369
|
"getPropertySavedFields",
|
399
|
|
- "getSavedPropertyData",
|
|
370
|
+ "getSavedPropertyData"
|
400
|
371
|
]),
|
401
|
372
|
updateLocation(place) {
|
402
|
373
|
this.addressSet = true;
|
|
@@ -418,10 +389,7 @@ export default {
|
418
|
389
|
this.showPropertyTypeError = true;
|
419
|
390
|
}
|
420
|
391
|
|
421
|
|
- if (
|
422
|
|
- this.salesType === "Rental" &&
|
423
|
|
- this.property.dateAvailable === "undef"
|
424
|
|
- ) {
|
|
392
|
+ if (this.salesType === "Rental" && this.property.dateAvailable === "undef") {
|
425
|
393
|
this.showDateError = true;
|
426
|
394
|
}
|
427
|
395
|
|
|
@@ -445,7 +413,7 @@ export default {
|
445
|
413
|
}
|
446
|
414
|
this.property.propertyImages.push({
|
447
|
415
|
image: this.images[i],
|
448
|
|
- isDefault: setAsDefault,
|
|
416
|
+ isDefault: setAsDefault
|
449
|
417
|
});
|
450
|
418
|
}
|
451
|
419
|
this.property.propertyUserFields = this.propertyFieldValues;
|
|
@@ -453,7 +421,7 @@ export default {
|
453
|
421
|
if (this.user) {
|
454
|
422
|
this.property.userId = this.user.id;
|
455
|
423
|
}
|
456
|
|
- this.property.propertyUserFields.forEach((item) => {
|
|
424
|
+ this.property.propertyUserFields.forEach(item => {
|
457
|
425
|
if (item.value === true) {
|
458
|
426
|
item.value = "yes";
|
459
|
427
|
} else if (item.value === false) {
|
|
@@ -462,12 +430,10 @@ export default {
|
462
|
430
|
});
|
463
|
431
|
|
464
|
432
|
this.saveProperty(this.property)
|
465
|
|
- .then((fulfilled) => {
|
466
|
|
- this.$router.push(
|
467
|
|
- `/property/residential/property/${fulfilled.data.id}`
|
468
|
|
- );
|
|
433
|
+ .then(fulfilled => {
|
|
434
|
+ this.$router.push(`/property/residential/property/${fulfilled.data.id}`);
|
469
|
435
|
})
|
470
|
|
- .catch((error) => {
|
|
436
|
+ .catch(error => {
|
471
|
437
|
console.log(error.message);
|
472
|
438
|
});
|
473
|
439
|
},
|
|
@@ -487,11 +453,9 @@ export default {
|
487
|
453
|
loadedImages(values) {
|
488
|
454
|
this.images = values;
|
489
|
455
|
},
|
490
|
|
- UpdateUserDefinedFields(item) {
|
|
456
|
+ UpdateUserResidentialFields(item) {
|
491
|
457
|
let update = false;
|
492
|
|
- this.propertyFieldValues.forEach((element) => {
|
493
|
|
- console.log(element);
|
494
|
|
-
|
|
458
|
+ this.propertyFieldValues.forEach(element => {
|
495
|
459
|
if (element.userDefinedFieldId === item.userDefinedFieldId) {
|
496
|
460
|
element.value = item.value;
|
497
|
461
|
update = true;
|
|
@@ -525,11 +489,9 @@ export default {
|
525
|
489
|
fields.push(arr.slice(i, (i += len)));
|
526
|
490
|
}
|
527
|
491
|
return fields;
|
528
|
|
- },
|
|
492
|
+ }
|
529
|
493
|
},
|
530
|
494
|
mounted() {
|
531
|
|
- console.log(this.propertyFields);
|
532
|
|
-
|
533
|
495
|
this.wait = false;
|
534
|
496
|
this.getProperty(0);
|
535
|
497
|
this.clearPropertyImages();
|
|
@@ -562,14 +524,12 @@ export default {
|
562
|
524
|
"propertyOverviewFields",
|
563
|
525
|
"propertyFields",
|
564
|
526
|
"property",
|
565
|
|
- "propertyImages",
|
|
527
|
+ "propertyImages"
|
566
|
528
|
]),
|
567
|
529
|
...mapState("authentication", ["user"]),
|
568
|
530
|
...mapGetters("fees", ["getListingFee"]),
|
569
|
531
|
sortFields() {
|
570
|
|
- return this.propertyFields[0].fields.sort((a, b) =>
|
571
|
|
- a.rank > b.rank ? 1 : -1
|
572
|
|
- );
|
|
532
|
+ return this.propertyFields[0].fields.sort((a, b) => (a.rank > b.rank ? 1 : -1));
|
573
|
533
|
},
|
574
|
534
|
SalesTypeChanged() {
|
575
|
535
|
// eslint-disable-next-line vue/no-side-effects-in-computed-properties
|
|
@@ -589,13 +549,13 @@ export default {
|
589
|
549
|
},
|
590
|
550
|
userFieldsArr() {
|
591
|
551
|
return this.userFieldsArrFunc(this.propertyFields, 4);
|
592
|
|
- },
|
|
552
|
+ }
|
593
|
553
|
},
|
594
|
554
|
watch: {
|
595
|
555
|
SalesTypeChanged() {
|
596
|
556
|
return null;
|
597
|
|
- },
|
598
|
|
- },
|
|
557
|
+ }
|
|
558
|
+ }
|
599
|
559
|
};
|
600
|
560
|
</script>
|
601
|
561
|
|