|
@@ -1,12 +1,18 @@
|
1
|
1
|
<template>
|
2
|
2
|
<div>
|
3
|
|
- <main id="main" style="margin-top:-20px">
|
|
3
|
+ <main id="main" style="margin-top: -20px">
|
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="resSaleType">Sale Type</label>
|
|
7
|
+ <label v-if="!salesType" class="uniSelectLabel" for="resSaleType"
|
|
8
|
+ >Sale Type</label
|
|
9
|
+ >
|
8
|
10
|
<float-label label="Sale Type">
|
9
|
|
- <select class="form-control uniSelect mb-3" name="resSaleType" v-model="salesType">
|
|
11
|
+ <select
|
|
12
|
+ class="form-control uniSelect mb-3"
|
|
13
|
+ name="resSaleType"
|
|
14
|
+ v-model="salesType"
|
|
15
|
+ >
|
10
|
16
|
<option value="Sale">To Sell</option>
|
11
|
17
|
<option value="Rental">To Rent</option>
|
12
|
18
|
</select>
|
|
@@ -16,7 +22,9 @@
|
16
|
22
|
<div class="row mt-2">
|
17
|
23
|
<div class="col-md-6">
|
18
|
24
|
<div v-if="!property.propertyName">
|
19
|
|
- <label for="propertyName" class="uniSelectLabel">PROPERTY NAME</label>
|
|
25
|
+ <label for="propertyName" class="uniSelectLabel"
|
|
26
|
+ >PROPERTY NAME</label
|
|
27
|
+ >
|
20
|
28
|
</div>
|
21
|
29
|
<float-label label="PROPERTY NAME">
|
22
|
30
|
<input
|
|
@@ -29,7 +37,9 @@
|
29
|
37
|
</div>
|
30
|
38
|
<div class="col-md-6">
|
31
|
39
|
<div v-if="!property.propertyRef">
|
32
|
|
- <label for="propertyName" class="uniSelectLabel">PROPERTY REFERENCE</label>
|
|
40
|
+ <label for="propertyName" class="uniSelectLabel"
|
|
41
|
+ >PROPERTY REFERENCE</label
|
|
42
|
+ >
|
33
|
43
|
</div>
|
34
|
44
|
<float-label label="PROPERTY REFERENCE">
|
35
|
45
|
<input
|
|
@@ -51,9 +61,13 @@
|
51
|
61
|
@change="PropertyTypeSelected"
|
52
|
62
|
>
|
53
|
63
|
<option value="0">Please select type *</option>
|
54
|
|
- <option v-for="item in propertyTypes" :value="item.id" :key="item.id">{{
|
55
|
|
- item.description
|
56
|
|
- }}</option>
|
|
64
|
+ <option
|
|
65
|
+ v-for="item in propertyTypesRes"
|
|
66
|
+ :value="item.id"
|
|
67
|
+ :key="item.id"
|
|
68
|
+ >
|
|
69
|
+ {{ item.description }}
|
|
70
|
+ </option>
|
57
|
71
|
</select>
|
58
|
72
|
</div>
|
59
|
73
|
</div>
|
|
@@ -63,7 +77,7 @@
|
63
|
77
|
<input
|
64
|
78
|
type="checkbox"
|
65
|
79
|
v-model="property.showAddress"
|
66
|
|
- style="margin-right: 10px; margin-top: 10px;"
|
|
80
|
+ style="margin-right: 10px; margin-top: 10px"
|
67
|
81
|
/>
|
68
|
82
|
<label>Show address on listing</label>
|
69
|
83
|
</div>
|
|
@@ -74,13 +88,16 @@
|
74
|
88
|
<label
|
75
|
89
|
for="resPrice"
|
76
|
90
|
class="uniSelectLabel"
|
77
|
|
- style="text-transform:uppercase; margin-left:17px; background-color:white"
|
|
91
|
+ style="
|
|
92
|
+ text-transform: uppercase;
|
|
93
|
+ margin-left: 17px;
|
|
94
|
+ background-color: white;
|
|
95
|
+ "
|
78
|
96
|
>{{ salesType }} Price</label
|
79
|
97
|
>
|
80
|
98
|
</div>
|
81
|
99
|
<float-label label="Price">
|
82
|
100
|
<currency-input
|
83
|
|
- onclick="this.setSelectionRange(0, this.value.length)"
|
84
|
101
|
name="resPrice"
|
85
|
102
|
:value="property.price"
|
86
|
103
|
@input="property.price = $event"
|
|
@@ -119,7 +136,9 @@
|
119
|
136
|
<div class="row my-3">
|
120
|
137
|
<div class="col-md-12">
|
121
|
138
|
<div v-if="!property.streetNumber">
|
122
|
|
- <label for="resStreetNumber" class="uniSelectLabel">STREET NUMBER</label>
|
|
139
|
+ <label for="resStreetNumber" class="uniSelectLabel"
|
|
140
|
+ >STREET NUMBER</label
|
|
141
|
+ >
|
123
|
142
|
</div>
|
124
|
143
|
<input
|
125
|
144
|
class="form-control uniInput"
|
|
@@ -133,7 +152,9 @@
|
133
|
152
|
<div class="row my-3">
|
134
|
153
|
<div class="col-md-12">
|
135
|
154
|
<div v-if="!property.streetName">
|
136
|
|
- <label for="resStreetName" class="uniSelectLabel">STREET NAME</label>
|
|
155
|
+ <label for="resStreetName" class="uniSelectLabel"
|
|
156
|
+ >STREET NAME</label
|
|
157
|
+ >
|
137
|
158
|
</div>
|
138
|
159
|
<input
|
139
|
160
|
class="form-control uniInput"
|
|
@@ -175,7 +196,9 @@
|
175
|
196
|
<div class="row my-3">
|
176
|
197
|
<div class="col-md-12">
|
177
|
198
|
<div v-if="!property.province">
|
178
|
|
- <label for="resProvince" class="uniSelectLabel">PROVINCE</label>
|
|
199
|
+ <label for="resProvince" class="uniSelectLabel"
|
|
200
|
+ >PROVINCE</label
|
|
201
|
+ >
|
179
|
202
|
</div>
|
180
|
203
|
<input
|
181
|
204
|
class="form-control uniInput"
|
|
@@ -189,7 +212,9 @@
|
189
|
212
|
<div class="row my-3">
|
190
|
213
|
<div class="col-md-12">
|
191
|
214
|
<div v-if="!property.postalCode">
|
192
|
|
- <label for="resPostalCode" class="uniSelectLabel">POSTAL CODE</label>
|
|
215
|
+ <label for="resPostalCode" class="uniSelectLabel"
|
|
216
|
+ >POSTAL CODE</label
|
|
217
|
+ >
|
193
|
218
|
</div>
|
194
|
219
|
<input
|
195
|
220
|
class="form-control uniInput"
|
|
@@ -216,7 +241,11 @@
|
216
|
241
|
</div>
|
217
|
242
|
<div class="row my-3">
|
218
|
243
|
<div class="col-md-12">
|
219
|
|
- <button type="button" @click="clearAddress()" class="btn-solid-blue">
|
|
244
|
+ <button
|
|
245
|
+ type="button"
|
|
246
|
+ @click="clearAddress()"
|
|
247
|
+ class="btn-solid-blue"
|
|
248
|
+ >
|
220
|
249
|
Clear Address
|
221
|
250
|
</button>
|
222
|
251
|
</div>
|
|
@@ -225,12 +254,17 @@
|
225
|
254
|
</div>
|
226
|
255
|
<div class="row">
|
227
|
256
|
<div class="col-md-12">
|
228
|
|
- <label for="Property Description" style="font-family:'muli'">Description:</label>
|
229
|
|
- <vue-editor v-model="property.description" :editor-toolbar="customToolbar" />
|
|
257
|
+ <label for="Property Description" style="font-family: 'muli'"
|
|
258
|
+ >Description:</label
|
|
259
|
+ >
|
|
260
|
+ <vue-editor
|
|
261
|
+ v-model="property.description"
|
|
262
|
+ :editor-toolbar="customToolbar"
|
|
263
|
+ />
|
230
|
264
|
<br />
|
231
|
265
|
<p>
|
232
|
|
- * A listing fee of R{{ getListingFee.amount }} including VAT is payable to list your
|
233
|
|
- Property on the Uni-Vate website
|
|
266
|
+ * A listing fee of R{{ getListingFee.amount }} including VAT is
|
|
267
|
+ payable to list your Property on the Uni-Vate website
|
234
|
268
|
</p>
|
235
|
269
|
</div>
|
236
|
270
|
</div>
|
|
@@ -251,9 +285,11 @@
|
251
|
285
|
</div>
|
252
|
286
|
<div class="form-group row">
|
253
|
287
|
<div class="col-md-12 mt-2">
|
254
|
|
- <label v-if="!property.virtualTour" class="uniSelectLabel">Virtual Tour (URL)</label>
|
|
288
|
+ <label v-if="!property.virtualTour" class="uniSelectLabel"
|
|
289
|
+ >Virtual Tour (URL)</label
|
|
290
|
+ >
|
255
|
291
|
<div class="input-group-prepend">
|
256
|
|
- <float-label label="Virtual Tour (URL)" style="width:100%">
|
|
292
|
+ <float-label label="Virtual Tour (URL)" style="width: 100%">
|
257
|
293
|
<input
|
258
|
294
|
class="form-control uniInput"
|
259
|
295
|
type="link"
|
|
@@ -267,9 +303,11 @@
|
267
|
303
|
</div>
|
268
|
304
|
<div class="row">
|
269
|
305
|
<div class="col-md-12 mt-2">
|
270
|
|
- <label v-if="!property.video" class="uniSelectLabel">Video (URL)</label>
|
|
306
|
+ <label v-if="!property.video" class="uniSelectLabel"
|
|
307
|
+ >Video (URL)</label
|
|
308
|
+ >
|
271
|
309
|
<div class="input-group-prepend">
|
272
|
|
- <float-label label="Video (URL)" style="width:100%">
|
|
310
|
+ <float-label label="Video (URL)" style="width: 100%">
|
273
|
311
|
<input
|
274
|
312
|
class="form-control uniInput"
|
275
|
313
|
type="link"
|
|
@@ -295,7 +333,12 @@
|
295
|
333
|
:savedImages="propertyImages"
|
296
|
334
|
@DefaultImage="UpdateDefaultImage"
|
297
|
335
|
/>
|
298
|
|
- <button v-if="!wait" type="button" @click="SubmitData()" class="btn-solid-blue">
|
|
336
|
+ <button
|
|
337
|
+ v-if="!wait"
|
|
338
|
+ type="button"
|
|
339
|
+ @click="SubmitData()"
|
|
340
|
+ class="btn-solid-blue"
|
|
341
|
+ >
|
299
|
342
|
Save
|
300
|
343
|
</button>
|
301
|
344
|
<div v-if="showPropertyTypeError">
|
|
@@ -326,10 +369,10 @@ export default {
|
326
|
369
|
ImageLoad,
|
327
|
370
|
VueEditor,
|
328
|
371
|
carouselSection,
|
329
|
|
- mapSection
|
|
372
|
+ mapSection,
|
330
|
373
|
},
|
331
|
374
|
props: {
|
332
|
|
- propFields: {}
|
|
375
|
+ propFields: {},
|
333
|
376
|
},
|
334
|
377
|
data() {
|
335
|
378
|
return {
|
|
@@ -342,22 +385,28 @@ export default {
|
342
|
385
|
customToolbar: [
|
343
|
386
|
[{ header: [false, 1, 2, 3, 4, 5, 6] }],
|
344
|
387
|
["bold", "italic", "underline", "strike"],
|
345
|
|
- [{ align: "" }, { align: "center" }, { align: "right" }, { align: "justify" }],
|
|
388
|
+ [
|
|
389
|
+ { align: "" },
|
|
390
|
+ { align: "center" },
|
|
391
|
+ { align: "right" },
|
|
392
|
+ { align: "justify" },
|
|
393
|
+ ],
|
346
|
394
|
[{ list: "ordered" }, { list: "bullet" }, { list: "check" }],
|
347
|
395
|
[{ script: "sub" }, { script: "super" }],
|
348
|
|
- [{ indent: "-1" }, { indent: "+1" }]
|
|
396
|
+ [{ indent: "-1" }, { indent: "+1" }],
|
349
|
397
|
],
|
350
|
398
|
error: "",
|
351
|
399
|
addressSet: false,
|
352
|
400
|
showPropertyTypeError: false,
|
353
|
401
|
showDateError: false,
|
354
|
402
|
user: Log.getUser(),
|
355
|
|
- mayEdit: Log.isLoggedIn()
|
|
403
|
+ mayEdit: Log.isLoggedIn(),
|
|
404
|
+ myprice: "0",
|
356
|
405
|
};
|
357
|
406
|
},
|
358
|
407
|
methods: {
|
359
|
408
|
...mapActions("property", [
|
360
|
|
- "getPropertyTypes",
|
|
409
|
+ "getPropertyTypesRes",
|
361
|
410
|
"getPropertyOverviewFields",
|
362
|
411
|
"getPropertyFields",
|
363
|
412
|
"saveProperty",
|
|
@@ -367,7 +416,7 @@ export default {
|
367
|
416
|
"getPropertyEditDisplay",
|
368
|
417
|
"getPropertySavedOverviewFields",
|
369
|
418
|
"getPropertySavedFields",
|
370
|
|
- "getSavedPropertyData"
|
|
419
|
+ "getSavedPropertyData",
|
371
|
420
|
]),
|
372
|
421
|
...mapActions("register", ["getAgentById"]),
|
373
|
422
|
updateLocation(place) {
|
|
@@ -390,7 +439,10 @@ export default {
|
390
|
439
|
this.showPropertyTypeError = true;
|
391
|
440
|
}
|
392
|
441
|
|
393
|
|
- if (this.salesType === "Rental" && this.property.dateAvailable === "undef") {
|
|
442
|
+ if (
|
|
443
|
+ this.salesType === "Rental" &&
|
|
444
|
+ this.property.dateAvailable === "undef"
|
|
445
|
+ ) {
|
394
|
446
|
this.showDateError = true;
|
395
|
447
|
}
|
396
|
448
|
|
|
@@ -414,7 +466,7 @@ export default {
|
414
|
466
|
}
|
415
|
467
|
this.property.propertyImages.push({
|
416
|
468
|
image: this.images[i],
|
417
|
|
- isDefault: setAsDefault
|
|
469
|
+ isDefault: setAsDefault,
|
418
|
470
|
});
|
419
|
471
|
}
|
420
|
472
|
this.property.propertyUserFields = this.propertyFieldValues;
|
|
@@ -437,10 +489,12 @@ export default {
|
437
|
489
|
}
|
438
|
490
|
//console.log(this.property);
|
439
|
491
|
this.saveProperty(this.property)
|
440
|
|
- .then(fulfilled => {
|
441
|
|
- this.$router.push(`/property/residential/property/${fulfilled.data.id}`);
|
|
492
|
+ .then((fulfilled) => {
|
|
493
|
+ this.$router.push(
|
|
494
|
+ `/property/residential/property/${fulfilled.data.id}`
|
|
495
|
+ );
|
442
|
496
|
})
|
443
|
|
- .catch(error => {
|
|
497
|
+ .catch((error) => {
|
444
|
498
|
console.log(error.message);
|
445
|
499
|
});
|
446
|
500
|
},
|
|
@@ -465,7 +519,7 @@ export default {
|
465
|
519
|
},
|
466
|
520
|
UpdateUserResidentialFields(item) {
|
467
|
521
|
let update = false;
|
468
|
|
- this.propertyFieldValues.forEach(element => {
|
|
522
|
+ this.propertyFieldValues.forEach((element) => {
|
469
|
523
|
if (element.userDefinedFieldId === item.userDefinedFieldId) {
|
470
|
524
|
element.value = item.value;
|
471
|
525
|
update = true;
|
|
@@ -499,7 +553,7 @@ export default {
|
499
|
553
|
fields.push(arr.slice(i, (i += len)));
|
500
|
554
|
}
|
501
|
555
|
return fields;
|
502
|
|
- }
|
|
556
|
+ },
|
503
|
557
|
},
|
504
|
558
|
mounted() {
|
505
|
559
|
this.wait = false;
|
|
@@ -523,24 +577,26 @@ export default {
|
523
|
577
|
}
|
524
|
578
|
this.salesType = this.$route.params.saleType;
|
525
|
579
|
|
526
|
|
- this.getPropertyTypes(this.propertyType);
|
|
580
|
+ this.getPropertyTypesRes();
|
527
|
581
|
|
528
|
582
|
this.getPropertyOverviewFields();
|
529
|
583
|
//this.getPropertyFields(this.propertyType);
|
530
|
584
|
},
|
531
|
585
|
computed: {
|
532
|
586
|
...mapState("property", [
|
533
|
|
- "propertyTypes",
|
|
587
|
+ "propertyTypesRes",
|
534
|
588
|
"propertyOverviewFields",
|
535
|
589
|
"propertyFields",
|
536
|
590
|
"property",
|
537
|
|
- "propertyImages"
|
|
591
|
+ "propertyImages",
|
538
|
592
|
]),
|
539
|
593
|
...mapState("authentication", ["user"]),
|
540
|
594
|
...mapGetters("fees", ["getListingFee"]),
|
541
|
595
|
...mapState("register", ["agent"]),
|
542
|
596
|
sortFields() {
|
543
|
|
- return this.propertyFields[0].fields.sort((a, b) => (a.rank > b.rank ? 1 : -1));
|
|
597
|
+ return this.propertyFields[0].fields.sort((a, b) =>
|
|
598
|
+ a.rank > b.rank ? 1 : -1
|
|
599
|
+ );
|
544
|
600
|
},
|
545
|
601
|
SalesTypeChanged() {
|
546
|
602
|
// eslint-disable-next-line vue/no-side-effects-in-computed-properties
|
|
@@ -560,13 +616,13 @@ export default {
|
560
|
616
|
},
|
561
|
617
|
userFieldsArr() {
|
562
|
618
|
return this.userFieldsArrFunc(this.propertyFields, 4);
|
563
|
|
- }
|
|
619
|
+ },
|
564
|
620
|
},
|
565
|
621
|
watch: {
|
566
|
622
|
SalesTypeChanged() {
|
567
|
623
|
return null;
|
568
|
|
- }
|
569
|
|
- }
|
|
624
|
+ },
|
|
625
|
+ },
|
570
|
626
|
};
|
571
|
627
|
</script>
|
572
|
628
|
|