|
@@ -52,9 +52,7 @@
|
52
|
52
|
>
|
53
|
53
|
<option value="0">Please select type *</option>
|
54
|
54
|
<option v-for="item in propertyTypes" :value="item.id" :key="item.id">
|
55
|
|
- {{
|
56
|
|
- item.description
|
57
|
|
- }}
|
|
55
|
+ {{ item.description }}
|
58
|
56
|
</option>
|
59
|
57
|
</select>
|
60
|
58
|
</div>
|
|
@@ -91,14 +89,15 @@
|
91
|
89
|
for="price"
|
92
|
90
|
class="uniSelectLabel"
|
93
|
91
|
style="text-transform:uppercase; margin-left:17px; background-color:white"
|
94
|
|
- >{{ salesType }} Price</label>
|
|
92
|
+ >{{ salesType }} Price</label
|
|
93
|
+ >
|
95
|
94
|
</div>
|
96
|
95
|
<float-label label="price">
|
97
|
96
|
<currency-input
|
98
|
97
|
onclick="this.setSelectionRange(0, this.value.length)"
|
99
|
98
|
name="price"
|
100
|
|
- :value="value"
|
101
|
|
- @input="value = $event"
|
|
99
|
+ :value="property.price"
|
|
100
|
+ @input="property.price = $event"
|
102
|
101
|
v-model="property.price"
|
103
|
102
|
id="price"
|
104
|
103
|
class="form-control uniInput"
|
|
@@ -140,7 +139,7 @@
|
140
|
139
|
class="form-control uniInput"
|
141
|
140
|
type="text"
|
142
|
141
|
name="streetNumber"
|
143
|
|
- id="unit"
|
|
142
|
+ id="streetNumber"
|
144
|
143
|
v-model="property.streetNumber"
|
145
|
144
|
/>
|
146
|
145
|
</div>
|
|
@@ -154,7 +153,7 @@
|
154
|
153
|
class="form-control uniInput"
|
155
|
154
|
type="text"
|
156
|
155
|
name="streetName"
|
157
|
|
- id="unit"
|
|
156
|
+ id="streetName"
|
158
|
157
|
v-model="property.streetName"
|
159
|
158
|
/>
|
160
|
159
|
</div>
|
|
@@ -168,7 +167,7 @@
|
168
|
167
|
class="form-control uniInput"
|
169
|
168
|
type="text"
|
170
|
169
|
name="suburb"
|
171
|
|
- id="unit"
|
|
170
|
+ id="suburb"
|
172
|
171
|
v-model="property.suburb"
|
173
|
172
|
/>
|
174
|
173
|
</div>
|
|
@@ -182,7 +181,7 @@
|
182
|
181
|
class="form-control uniInput"
|
183
|
182
|
type="text"
|
184
|
183
|
name="city"
|
185
|
|
- id="unit"
|
|
184
|
+ id="city"
|
186
|
185
|
v-model="property.city"
|
187
|
186
|
/>
|
188
|
187
|
</div>
|
|
@@ -196,7 +195,7 @@
|
196
|
195
|
class="form-control uniInput"
|
197
|
196
|
type="text"
|
198
|
197
|
name="province"
|
199
|
|
- id="unit"
|
|
198
|
+ id="province"
|
200
|
199
|
v-model="property.province"
|
201
|
200
|
/>
|
202
|
201
|
</div>
|
|
@@ -210,7 +209,7 @@
|
210
|
209
|
class="form-control uniInput"
|
211
|
210
|
type="text"
|
212
|
211
|
name="postalCode"
|
213
|
|
- id="unit"
|
|
212
|
+ id="postalCode"
|
214
|
213
|
v-model="property.postalCode"
|
215
|
214
|
/>
|
216
|
215
|
</div>
|
|
@@ -224,14 +223,16 @@
|
224
|
223
|
class="form-control uniInput"
|
225
|
224
|
type="text"
|
226
|
225
|
name="country"
|
227
|
|
- id="unit"
|
|
226
|
+ id="country"
|
228
|
227
|
v-model="property.country"
|
229
|
228
|
/>
|
230
|
229
|
</div>
|
231
|
230
|
</div>
|
232
|
231
|
<div class="row my-3">
|
233
|
232
|
<div class="col-md-12">
|
234
|
|
- <button type="button" @click="clearAddress()" class="btn-solid-blue">Clear Address</button>
|
|
233
|
+ <button type="button" @click="clearAddress()" class="btn-solid-blue">
|
|
234
|
+ Clear Address
|
|
235
|
+ </button>
|
235
|
236
|
</div>
|
236
|
237
|
</div>
|
237
|
238
|
</div>
|
|
@@ -253,13 +254,14 @@
|
253
|
254
|
<div v-for="item in propertyFields" :key="item.id">
|
254
|
255
|
<div v-if="item.name === 'Commercial Fields'">
|
255
|
256
|
<UserField
|
256
|
|
- :fields="item.fields"
|
|
257
|
+ :fields="sortFields"
|
257
|
258
|
:id="item.name"
|
258
|
259
|
@UpdateUserDefinedFields="UpdateUserDefinedFields"
|
259
|
260
|
:fieldValues="item.fields"
|
260
|
261
|
/>
|
261
|
262
|
</div>
|
262
|
263
|
</div>
|
|
264
|
+
|
263
|
265
|
<div class="row">
|
264
|
266
|
<div class="col-sm-12">
|
265
|
267
|
<div class="section-header">
|
|
@@ -313,9 +315,13 @@
|
313
|
315
|
:savedImages="propertyImages"
|
314
|
316
|
@DefaultImage="UpdateDefaultImage"
|
315
|
317
|
/>
|
316
|
|
- <button v-if="!wait" type="button" @click="SubmitData()" class="btn-solid-blue">Save</button>
|
|
318
|
+ <button v-if="!wait" type="button" @click="SubmitData()" class="btn-solid-blue">
|
|
319
|
+ Save
|
|
320
|
+ </button>
|
317
|
321
|
<div v-if="showPropertyTypeError">
|
318
|
|
- <p class="alert myError">Missing fields. Please fill in all required fields. Marked with *</p>
|
|
322
|
+ <p class="alert myError">
|
|
323
|
+ Missing fields. Please fill in all required fields. Marked with *
|
|
324
|
+ </p>
|
319
|
325
|
</div>
|
320
|
326
|
<div v-if="wait" id="preloader"></div>
|
321
|
327
|
</div>
|
|
@@ -340,7 +346,7 @@ export default {
|
340
|
346
|
ImageLoad,
|
341
|
347
|
VueEditor,
|
342
|
348
|
carouselSection,
|
343
|
|
- mapSection,
|
|
349
|
+ mapSection
|
344
|
350
|
},
|
345
|
351
|
data() {
|
346
|
352
|
return {
|
|
@@ -353,22 +359,17 @@ export default {
|
353
|
359
|
customToolbar: [
|
354
|
360
|
[{ header: [false, 1, 2, 3, 4, 5, 6] }],
|
355
|
361
|
["bold", "italic", "underline", "strike"],
|
356
|
|
- [
|
357
|
|
- { align: "" },
|
358
|
|
- { align: "center" },
|
359
|
|
- { align: "right" },
|
360
|
|
- { align: "justify" },
|
361
|
|
- ],
|
|
362
|
+ [{ align: "" }, { align: "center" }, { align: "right" }, { align: "justify" }],
|
362
|
363
|
[{ list: "ordered" }, { list: "bullet" }, { list: "check" }],
|
363
|
364
|
[{ script: "sub" }, { script: "super" }],
|
364
|
|
- [{ indent: "-1" }, { indent: "+1" }],
|
|
365
|
+ [{ indent: "-1" }, { indent: "+1" }]
|
365
|
366
|
],
|
366
|
367
|
error: "",
|
367
|
368
|
addressSet: false,
|
368
|
369
|
showPropertyTypeError: false,
|
369
|
370
|
showDateError: false,
|
370
|
371
|
user: Log.getUser(),
|
371
|
|
- mayEdit: Log.isLoggedIn(),
|
|
372
|
+ mayEdit: Log.isLoggedIn()
|
372
|
373
|
};
|
373
|
374
|
},
|
374
|
375
|
methods: {
|
|
@@ -383,7 +384,7 @@ export default {
|
383
|
384
|
"getPropertyEditDisplay",
|
384
|
385
|
"getPropertySavedOverviewFields",
|
385
|
386
|
"getPropertySavedFields",
|
386
|
|
- "getSavedPropertyData",
|
|
387
|
+ "getSavedPropertyData"
|
387
|
388
|
]),
|
388
|
389
|
updateLocation(place) {
|
389
|
390
|
this.addressSet = true;
|
|
@@ -400,15 +401,13 @@ export default {
|
400
|
401
|
TypeChanged() {
|
401
|
402
|
this.property.propertyUsageType = this.propertyType;
|
402
|
403
|
},
|
|
404
|
+
|
403
|
405
|
SubmitData() {
|
404
|
406
|
if (this.property.propertyTypeId === 0) {
|
405
|
407
|
this.showPropertyTypeError = true;
|
406
|
408
|
}
|
407
|
409
|
|
408
|
|
- if (
|
409
|
|
- this.salesType === "Rental" &&
|
410
|
|
- this.property.dateAvailable === "undef"
|
411
|
|
- ) {
|
|
410
|
+ if (this.salesType === "Rental" && this.property.dateAvailable === "undef") {
|
412
|
411
|
this.showDateError = true;
|
413
|
412
|
}
|
414
|
413
|
|
|
@@ -432,7 +431,7 @@ export default {
|
432
|
431
|
}
|
433
|
432
|
this.property.propertyImages.push({
|
434
|
433
|
image: this.images[i],
|
435
|
|
- isDefault: setAsDefault,
|
|
434
|
+ isDefault: setAsDefault
|
436
|
435
|
});
|
437
|
436
|
}
|
438
|
437
|
this.property.propertyUserFields = this.propertyFieldValues;
|
|
@@ -441,7 +440,7 @@ export default {
|
441
|
440
|
this.property.userId = this.user.id;
|
442
|
441
|
}
|
443
|
442
|
|
444
|
|
- this.property.propertyUserFields.forEach((item) => {
|
|
443
|
+ this.property.propertyUserFields.forEach(item => {
|
445
|
444
|
if (item.value === true) {
|
446
|
445
|
item.value = "yes";
|
447
|
446
|
} else if (item.value === false) {
|
|
@@ -452,12 +451,10 @@ export default {
|
452
|
451
|
console.log(this.property);
|
453
|
452
|
|
454
|
453
|
this.saveProperty(this.property)
|
455
|
|
- .then((fulfilled) => {
|
456
|
|
- this.$router.push(
|
457
|
|
- `/property/commercial/property/${fulfilled.data.id}`
|
458
|
|
- );
|
|
454
|
+ .then(fulfilled => {
|
|
455
|
+ this.$router.push(`/property/commercial/property/${fulfilled.data.id}`);
|
459
|
456
|
})
|
460
|
|
- .catch((error) => {
|
|
457
|
+ .catch(error => {
|
461
|
458
|
console.log(error.message);
|
462
|
459
|
});
|
463
|
460
|
},
|
|
@@ -479,7 +476,7 @@ export default {
|
479
|
476
|
},
|
480
|
477
|
UpdateUserDefinedFields(item) {
|
481
|
478
|
let update = false;
|
482
|
|
- this.propertyFieldValues.forEach((element) => {
|
|
479
|
+ this.propertyFieldValues.forEach(element => {
|
483
|
480
|
if (element.userDefinedFieldId === item.userDefinedFieldId) {
|
484
|
481
|
element.value = item.value;
|
485
|
482
|
update = true;
|
|
@@ -503,7 +500,7 @@ export default {
|
503
|
500
|
this.property.postalCode = undefined;
|
504
|
501
|
this.property.addressUrl = undefined;
|
505
|
502
|
this.property.propertCoords = undefined;
|
506
|
|
- },
|
|
503
|
+ }
|
507
|
504
|
},
|
508
|
505
|
mounted() {
|
509
|
506
|
this.wait = false;
|
|
@@ -536,10 +533,18 @@ export default {
|
536
|
533
|
"propertyOverviewFields",
|
537
|
534
|
"propertyFields",
|
538
|
535
|
"property",
|
539
|
|
- "propertyImages",
|
|
536
|
+ "propertyImages"
|
540
|
537
|
]),
|
541
|
538
|
...mapState("authentication", ["user"]),
|
542
|
539
|
...mapGetters("fees", ["getListingFee"]),
|
|
540
|
+ sortFields() {
|
|
541
|
+ var display = [];
|
|
542
|
+
|
|
543
|
+ display = this.propertyFields[0].fields.sort((a, b) => (a.rank > b.rank ? 1 : -1));
|
|
544
|
+ console.log(display);
|
|
545
|
+
|
|
546
|
+ return display;
|
|
547
|
+ },
|
543
|
548
|
SalesTypeChanged() {
|
544
|
549
|
// eslint-disable-next-line vue/no-side-effects-in-computed-properties
|
545
|
550
|
// this.propertyType = this.$route.params.propType;
|
|
@@ -557,13 +562,13 @@ export default {
|
557
|
562
|
this.getPropertyTypes(this.propertyType);
|
558
|
563
|
|
559
|
564
|
return this.propertyType;
|
560
|
|
- },
|
|
565
|
+ }
|
561
|
566
|
},
|
562
|
567
|
watch: {
|
563
|
568
|
SalesTypeChanged() {
|
564
|
569
|
return null;
|
565
|
|
- },
|
566
|
|
- },
|
|
570
|
+ }
|
|
571
|
+ }
|
567
|
572
|
};
|
568
|
573
|
</script>
|
569
|
574
|
|