|
@@ -35,13 +35,15 @@
|
35
|
35
|
<div class="row mb-3">
|
36
|
36
|
<div class="container col-md-10" style="text-align:left">
|
37
|
37
|
<form id="mainForm">
|
|
38
|
+ <div class="form-goup row">
|
|
39
|
+ <div class="col-md-4">
|
|
40
|
+ <field :type="'datetime'" :mayEdit="true" />
|
|
41
|
+ </div>
|
|
42
|
+ </div>
|
38
|
43
|
<div class="form-goup row">
|
39
|
44
|
<div class="col-md-4">
|
40
|
45
|
<label>Usage Type</label>
|
41
|
46
|
<div class="input-group-prepend">
|
42
|
|
- <!-- <span class="input-group-text" style="color: #60CBEB">
|
43
|
|
- <b>U</b>
|
44
|
|
- </span>-->
|
45
|
47
|
<input
|
46
|
48
|
class="form-control"
|
47
|
49
|
type="text"
|
|
@@ -53,6 +55,7 @@
|
53
|
55
|
</div>
|
54
|
56
|
</div>
|
55
|
57
|
</div>
|
|
58
|
+ <br />
|
56
|
59
|
<div class="form-group row">
|
57
|
60
|
<div class="col-md-4">
|
58
|
61
|
<label>Sale Type</label>
|
|
@@ -64,106 +67,113 @@
|
64
|
67
|
:mayEdit="mayEdit"
|
65
|
68
|
@UpdateValue="UpdateValue"
|
66
|
69
|
/>
|
|
70
|
+ <div v-if="showPropertyTypeError">
|
|
71
|
+ <p class="alert myError">Please select a Sales Type</p>
|
|
72
|
+ </div>
|
67
|
73
|
</div>
|
68
|
74
|
</div>
|
69
|
75
|
<div class="form-group row">
|
70
|
76
|
<div class="col-md-4">
|
71
|
|
- <label>Property Type</label>
|
72
|
|
- <propField
|
73
|
|
- :display="property.propertyType ? property.propertyType.description : ''"
|
74
|
|
- :editType="'selector'"
|
75
|
|
- :arrayObject="propertyTypes"
|
76
|
|
- :propertyName="'propertyType'"
|
|
77
|
+ <label>Property Type *</label>
|
|
78
|
+ <field
|
|
79
|
+ :type="'select'"
|
|
80
|
+ :selectOptions="propertyTypes"
|
|
81
|
+ :selectValue="'id'"
|
|
82
|
+ :selectText="'description'"
|
|
83
|
+ v-model="property.propertyType"
|
77
|
84
|
:mayEdit="mayEdit"
|
78
|
|
- @UpdateValue="UpdateValue"
|
79
|
85
|
/>
|
80
|
86
|
</div>
|
81
|
87
|
<div v-if="propertyType === 'Commercial'" class="col-md-4">
|
82
|
88
|
<label>Property Name</label>
|
83
|
|
- <propField
|
84
|
|
- :display="property.propertyName"
|
85
|
|
- :editType="'text'"
|
86
|
|
- :propertyName="'propertyName'"
|
87
|
|
- :mayEdit="mayEdit"
|
88
|
|
- @UpdateValue="UpdateValue"
|
89
|
|
- />
|
|
89
|
+ <field :type="'text'" v-model="property.propertyName" :mayEdit="mayEdit" />
|
90
|
90
|
</div>
|
91
|
91
|
<div v-if="propertyType === 'Commercial'" class="col-md-4">
|
92
|
92
|
<label>Unit</label>
|
93
|
|
- <propField
|
94
|
|
- :label="'Property Type'"
|
95
|
|
- :display="property.unit"
|
96
|
|
- :editType="'text'"
|
97
|
|
- :propertyName="'unit'"
|
98
|
|
- :mayEdit="mayEdit"
|
99
|
|
- @UpdateValue="UpdateValue"
|
100
|
|
- />
|
|
93
|
+ <field :type="'text'" v-model="property.unit" :mayEdit="mayEdit" />
|
101
|
94
|
</div>
|
102
|
95
|
</div>
|
103
|
96
|
<div class="form-group row">
|
104
|
97
|
<div class="col-md-6" style="margin-bottom: 1em">
|
105
|
98
|
<label>Street Number</label>
|
106
|
|
- <propField
|
107
|
|
- :display="property.addressLine1"
|
108
|
|
- :editType="'text'"
|
109
|
|
- :propertyName="'addressLine1'"
|
110
|
|
- :mayEdit="mayEdit"
|
111
|
|
- @UpdateValue="UpdateValue"
|
112
|
|
- />
|
|
99
|
+ <field :type="'text'" v-model="property.addressLine1" :mayEdit="mayEdit" />
|
113
|
100
|
</div>
|
114
|
101
|
<div class="col-md-6" style="margin-bottom: 1em">
|
115
|
102
|
<label>Street Name</label>
|
116
|
|
- <propField
|
117
|
|
- :display="property.addressLine2"
|
118
|
|
- :editType="'text'"
|
119
|
|
- :propertyName="'addressLine2'"
|
120
|
|
- :mayEdit="mayEdit"
|
121
|
|
- @UpdateValue="UpdateValue"
|
122
|
|
- />
|
|
103
|
+ <field :type="'text'" v-model="property.addressLine2" :mayEdit="mayEdit" />
|
123
|
104
|
</div>
|
124
|
105
|
<div class="col-md-6" style="margin-bottom: 1em">
|
125
|
|
- <label>Province</label>
|
126
|
|
- <propField
|
|
106
|
+ <label>Province *</label>
|
|
107
|
+ <!-- <propField
|
127
|
108
|
:display="property.province ? property.province.description : ''"
|
128
|
109
|
:editType="'selector'"
|
129
|
110
|
:arrayObject="provinces"
|
130
|
111
|
:propertyName="'province'"
|
131
|
112
|
:mayEdit="mayEdit"
|
132
|
113
|
@UpdateValue="UpdateValue"
|
|
114
|
+ />-->
|
|
115
|
+ <field
|
|
116
|
+ :type="'select'"
|
|
117
|
+ :selectOptions="provinces"
|
|
118
|
+ :selectValue="'id'"
|
|
119
|
+ :selectText="'description'"
|
|
120
|
+ v-model="property.province"
|
|
121
|
+ :mayEdit="mayEdit"
|
|
122
|
+ @change="provChanged"
|
133
|
123
|
/>
|
|
124
|
+ <div v-if="showProvinceError">
|
|
125
|
+ <p class="alert myError">Please select a Province</p>
|
|
126
|
+ </div>
|
134
|
127
|
</div>
|
135
|
|
-
|
136
|
128
|
<div class="col-md-6" style="margin-bottom: 1em">
|
137
|
|
- <label>City</label>
|
138
|
|
- <propField
|
|
129
|
+ <label>City *</label>
|
|
130
|
+ <!-- <propField
|
139
|
131
|
:display="property.city ? property.city.description : ''"
|
140
|
132
|
:editType="'selector'"
|
141
|
133
|
:arrayObject="cities"
|
142
|
134
|
:propertyName="'city'"
|
143
|
135
|
:mayEdit="mayEdit"
|
144
|
136
|
@UpdateValue="UpdateValue"
|
|
137
|
+ />-->
|
|
138
|
+ <field
|
|
139
|
+ :type="'select'"
|
|
140
|
+ :selectOptions="cities"
|
|
141
|
+ :selectValue="'id'"
|
|
142
|
+ :selectText="'description'"
|
|
143
|
+ v-model="property.city"
|
|
144
|
+ :mayEdit="mayEdit"
|
|
145
|
+ @change="cityChanged"
|
145
|
146
|
/>
|
|
147
|
+ <div v-if="showCityError">
|
|
148
|
+ <p class="alert myError">Please select a City</p>
|
|
149
|
+ </div>
|
146
|
150
|
</div>
|
147
|
151
|
<div class="col-md-6" style="margin-bottom: 1em">
|
148
|
|
- <label>Suburb</label>
|
149
|
|
- <propField
|
|
152
|
+ <label>Suburb *</label>
|
|
153
|
+ <!-- <propField
|
150
|
154
|
:display="property.suburb ? property.suburb.description : ''"
|
151
|
155
|
:editType="'selector'"
|
152
|
156
|
:arrayObject="suburbs"
|
153
|
157
|
:propertyName="'suburb'"
|
154
|
158
|
:mayEdit="mayEdit"
|
155
|
159
|
@UpdateValue="UpdateValue"
|
|
160
|
+ />-->
|
|
161
|
+ <field
|
|
162
|
+ :type="'select'"
|
|
163
|
+ :selectOptions="suburbs"
|
|
164
|
+ :selectValue="'id'"
|
|
165
|
+ :selectText="'description'"
|
|
166
|
+ v-model="property.suburb"
|
|
167
|
+ :mayEdit="mayEdit"
|
|
168
|
+ @change="suburbChanged"
|
156
|
169
|
/>
|
|
170
|
+ <div v-if="showSuburbError">
|
|
171
|
+ <p class="alert myError">Please select a suburb</p>
|
|
172
|
+ </div>
|
157
|
173
|
</div>
|
158
|
174
|
<div class="col-md-6" style="margin-bottom: 1em">
|
159
|
175
|
<label>Postal Code</label>
|
160
|
|
- <propField
|
161
|
|
- :display="property.addressLine3"
|
162
|
|
- :editType="'text'"
|
163
|
|
- :propertyName="'addressLine3'"
|
164
|
|
- :mayEdit="mayEdit"
|
165
|
|
- @UpdateValue="UpdateValue"
|
166
|
|
- />
|
|
176
|
+ <field :type="'text'" v-model="property.addressLine3" :mayEdit="mayEdit" />
|
167
|
177
|
</div>
|
168
|
178
|
</div>
|
169
|
179
|
|
|
@@ -171,23 +181,30 @@
|
171
|
181
|
<div class="col-md-6">
|
172
|
182
|
<label v-if="salesType === 'Rental'">Rental Price</label>
|
173
|
183
|
<label v-if="salesType !== 'Rental'">Sales Price</label>
|
174
|
|
- <propField
|
|
184
|
+ <field :type="'number'" v-model="property.price" :mayEdit="mayEdit" />
|
|
185
|
+ <!-- <propField
|
175
|
186
|
:display="String(property.price)"
|
176
|
187
|
:editType="'number'"
|
177
|
188
|
:propertyName="'price'"
|
178
|
189
|
:mayEdit="mayEdit"
|
179
|
190
|
@UpdateValue="UpdateValue"
|
180
|
|
- />
|
|
191
|
+ />-->
|
181
|
192
|
</div>
|
182
|
193
|
<div class="col-md-6" v-if="salesType === 'Rental'">
|
183
|
194
|
<label>Per</label>
|
184
|
|
- <propField
|
|
195
|
+ <!-- <propField
|
185
|
196
|
:display="property.pricePer"
|
186
|
197
|
:editType="'selector'"
|
187
|
198
|
:propertyName="'pricePer'"
|
188
|
199
|
:arrayObject="pricePerArr"
|
189
|
200
|
:mayEdit="mayEdit"
|
190
|
201
|
@UpdateValue="UpdateValue"
|
|
202
|
+ />-->
|
|
203
|
+ <field
|
|
204
|
+ :type="'selectlist'"
|
|
205
|
+ :selectOptions="pricePerArr"
|
|
206
|
+ v-model="property.pricePer"
|
|
207
|
+ :mayEdit="mayEdit"
|
191
|
208
|
/>
|
192
|
209
|
</div>
|
193
|
210
|
</div>
|
|
@@ -196,13 +213,16 @@
|
196
|
213
|
<label for="Property Description">Description</label>
|
197
|
214
|
<vue-editor v-model="property.description" :editor-toolbar="customToolbar" />
|
198
|
215
|
<br />
|
199
|
|
- <p>* A listing fee of R380 including VAT is payable to list your Property on the Uni-Vate website</p>
|
|
216
|
+ <p>
|
|
217
|
+ * A listing fee of R380 including VAT is payable to list your Property on the
|
|
218
|
+ Uni-Vate website
|
|
219
|
+ </p>
|
200
|
220
|
</div>
|
201
|
221
|
</div>
|
202
|
222
|
<div class="form-group row" />
|
203
|
223
|
<div
|
204
|
224
|
class="col-md-6"
|
205
|
|
- v-if="propertyType === 'Residential' & propertyOverviewFields.length > 0"
|
|
225
|
+ v-if="(propertyType === 'Residential') & (propertyOverviewFields.length > 0)"
|
206
|
226
|
>
|
207
|
227
|
<div v-for="(item, i) in propertyOverviewFields[0].fields" :key="item.id">
|
208
|
228
|
<label>{{ item.name }}</label>
|
|
@@ -243,6 +263,7 @@
|
243
|
263
|
@UpdateValue="UpdateValue"
|
244
|
264
|
/>
|
245
|
265
|
</div>
|
|
266
|
+ <br />
|
246
|
267
|
</div>
|
247
|
268
|
<div class="form-group row" />
|
248
|
269
|
<div class="row">
|
|
@@ -255,25 +276,13 @@
|
255
|
276
|
<div class="form-group row">
|
256
|
277
|
<div class="col-md-12">
|
257
|
278
|
<label>Virtual Tour (URL)</label>
|
258
|
|
- <propField
|
259
|
|
- :display="property.virtualTour"
|
260
|
|
- :editType="'text'"
|
261
|
|
- :propertyName="'virtualTour'"
|
262
|
|
- :mayEdit="mayEdit"
|
263
|
|
- @UpdateValue="UpdateValue"
|
264
|
|
- />
|
|
279
|
+ <field :type="'text'" v-model="property.virtualTour" :mayEdit="mayEdit" />
|
265
|
280
|
</div>
|
266
|
281
|
</div>
|
267
|
282
|
<div class="form-group row">
|
268
|
283
|
<div class="col-md-12">
|
269
|
284
|
<label>Video (URL)</label>
|
270
|
|
- <propField
|
271
|
|
- :display="property.video"
|
272
|
|
- :editType="'text'"
|
273
|
|
- :propertyName="'video'"
|
274
|
|
- :mayEdit="mayEdit"
|
275
|
|
- @UpdateValue="UpdateValue"
|
276
|
|
- />
|
|
285
|
+ <field :type="'text'" v-model="property.video" :mayEdit="mayEdit" />
|
277
|
286
|
</div>
|
278
|
287
|
</div>
|
279
|
288
|
<div class="form-group row">
|
|
@@ -303,6 +312,7 @@
|
303
|
312
|
class="input-group-text spanCursor"
|
304
|
313
|
align="center"
|
305
|
314
|
@click="DeleteImage(img)"
|
|
315
|
+ style="width:150px"
|
306
|
316
|
>
|
307
|
317
|
<eva-icon name="trash-2-outline" fill="#60CBEB"></eva-icon>Delete
|
308
|
318
|
</span>
|
|
@@ -321,13 +331,27 @@
|
321
|
331
|
class="btn btn-b-n"
|
322
|
332
|
style="width: 85px; height:40px;"
|
323
|
333
|
:disabled="!mayEdit"
|
324
|
|
- >Save</button>
|
|
334
|
+ >
|
|
335
|
+ Save
|
|
336
|
+ </button>
|
325
|
337
|
<button
|
326
|
338
|
type="button"
|
327
|
339
|
@click="Close()"
|
328
|
340
|
class="btn btn-b-n"
|
329
|
341
|
style="width: 85px; height:40px;"
|
330
|
|
- >Close</button>
|
|
342
|
+ :disabled="
|
|
343
|
+ showPropertyTypeError || showProvinceError || showCityError || showSuburbError
|
|
344
|
+ "
|
|
345
|
+ >
|
|
346
|
+ Close
|
|
347
|
+ </button>
|
|
348
|
+ <div
|
|
349
|
+ v-if="showPropertyTypeError || showProvinceError || showCityError || showSuburbError"
|
|
350
|
+ >
|
|
351
|
+ <p class="alert myError">
|
|
352
|
+ Missing fields. Please fill in all required fields. Marked with *
|
|
353
|
+ </p>
|
|
354
|
+ </div>
|
331
|
355
|
<div v-if="wait" id="preloader"></div>
|
332
|
356
|
</form>
|
333
|
357
|
</div>
|
|
@@ -339,9 +363,9 @@
|
339
|
363
|
<script>
|
340
|
364
|
import { mapState, mapActions } from 'vuex';
|
341
|
365
|
import { VueEditor } from 'vue2-editor';
|
342
|
|
-import { setTimeout } from 'timers';
|
343
|
366
|
import ImageLoad from './propertyImage.vue';
|
344
|
367
|
import propField from './propertyFieldEditor.vue';
|
|
368
|
+import field from '../shared/fieldEditor.vue';
|
345
|
369
|
|
346
|
370
|
export default {
|
347
|
371
|
name: 'PropertyEdit',
|
|
@@ -349,6 +373,7 @@ export default {
|
349
|
373
|
ImageLoad,
|
350
|
374
|
VueEditor,
|
351
|
375
|
propField,
|
|
376
|
+ field,
|
352
|
377
|
},
|
353
|
378
|
data() {
|
354
|
379
|
return {
|
|
@@ -361,12 +386,7 @@ export default {
|
361
|
386
|
customToolbar: [
|
362
|
387
|
[{ header: [false, 1, 2, 3, 4, 5, 6] }],
|
363
|
388
|
['bold', 'italic', 'underline', 'strike'],
|
364
|
|
- [
|
365
|
|
- { align: '' },
|
366
|
|
- { align: 'center' },
|
367
|
|
- { align: 'right' },
|
368
|
|
- { align: 'justify' },
|
369
|
|
- ],
|
|
389
|
+ [{ align: '' }, { align: 'center' }, { align: 'right' }, { align: 'justify' }],
|
370
|
390
|
[{ list: 'ordered' }, { list: 'bullet' }, { list: 'check' }],
|
371
|
391
|
[{ script: 'sub' }, { script: 'super' }],
|
372
|
392
|
[{ indent: '-1' }, { indent: '+1' }],
|
|
@@ -375,10 +395,12 @@ export default {
|
375
|
395
|
{ id: 1, description: 'Sale' },
|
376
|
396
|
{ id: 2, description: 'Rental' },
|
377
|
397
|
],
|
378
|
|
- pricePerArr: [
|
379
|
|
- { id: 'Month', description: 'Month' },
|
380
|
|
- { id: 'Day', description: 'Day' },
|
381
|
|
- ],
|
|
398
|
+ pricePerArr: ['Month', 'Day'],
|
|
399
|
+ yesno: ['Yes', 'No'],
|
|
400
|
+ showPropertyTypeError: false,
|
|
401
|
+ showProvinceError: false,
|
|
402
|
+ showCityError: false,
|
|
403
|
+ showSuburbError: false,
|
382
|
404
|
};
|
383
|
405
|
},
|
384
|
406
|
methods: {
|
|
@@ -389,19 +411,45 @@ export default {
|
389
|
411
|
'getListsForPropertyEdit',
|
390
|
412
|
]),
|
391
|
413
|
...mapActions('property', ['getPropertyTypes']),
|
392
|
|
- ...mapActions('propertyEdit', [
|
393
|
|
- 'getSavedPropertyData',
|
394
|
|
- 'updateProperty',
|
395
|
|
- 'mayEditProperty',
|
396
|
|
- ]),
|
|
414
|
+ ...mapActions('propertyEdit', ['getSavedPropertyData', 'updateProperty', 'mayEditProperty']),
|
|
415
|
+ provChanged(item) {
|
|
416
|
+ this.getCities(Object.assign({}, { province: item.description }));
|
|
417
|
+ this.property.city = null;
|
|
418
|
+ this.property.suburb = null;
|
|
419
|
+ this.property.addressLine3 = '';
|
|
420
|
+ this.showProvinceError = false;
|
|
421
|
+ this.showCityError = true;
|
|
422
|
+ this.showSuburbError = true;
|
|
423
|
+ },
|
|
424
|
+ cityChanged(item) {
|
|
425
|
+ this.getSuburbs(
|
|
426
|
+ Object.assign(
|
|
427
|
+ {},
|
|
428
|
+ {
|
|
429
|
+ province: this.property.province.description,
|
|
430
|
+ city: item.description,
|
|
431
|
+ },
|
|
432
|
+ ),
|
|
433
|
+ );
|
|
434
|
+ this.property.suburb = null;
|
|
435
|
+ this.property.addressLine3 = '';
|
|
436
|
+ this.showCityError = false;
|
|
437
|
+ this.showSuburbError = true;
|
|
438
|
+ },
|
|
439
|
+ suburbChanged(item) {
|
|
440
|
+ const newSuburb = this.suburbs.find(p => p.description === item.description);
|
|
441
|
+ this.property.addressLine3 = newSuburb.postalCode;
|
|
442
|
+ this.showSuburbError = false;
|
|
443
|
+ },
|
|
444
|
+ salesTypeChanged(item) {
|
|
445
|
+ console.log(item);
|
|
446
|
+ },
|
397
|
447
|
UpdateValue(item) {
|
398
|
448
|
if (item.isUDF) {
|
399
|
449
|
if (item.isPropOverview) {
|
400
|
|
- this.propertyOverviewFields[0].fields[item.arrayIndex].value = item.value;
|
|
450
|
+ this.propertyOverviewFields[0].fields[item.arrayIndex].value = item.value;
|
401
|
451
|
} else if (item.isPropOverview === false) {
|
402
|
|
- this.propertyFields[item.arrayIndex].fields[
|
403
|
|
- item.arrayItemIndex
|
404
|
|
- ].value = item.value;
|
|
452
|
+ this.propertyFields[item.arrayIndex].fields[item.arrayItemIndex].value = item.value;
|
405
|
453
|
}
|
406
|
454
|
} else if (!item.isUDF) {
|
407
|
455
|
if (item.fieldName) {
|
|
@@ -412,96 +460,6 @@ export default {
|
412
|
460
|
} else isSaleValue = false;
|
413
|
461
|
this.property.isSale = isSaleValue;
|
414
|
462
|
}
|
415
|
|
- if (item.fieldName === 'propertyType') {
|
416
|
|
- this.property.propertyType = this.propertyTypes.find(
|
417
|
|
- pt => pt.description === item.value,
|
418
|
|
- );
|
419
|
|
- this.property.propertyTypeId = this.property.propertyType.id;
|
420
|
|
- }
|
421
|
|
- if (item.fieldName === 'propertyName') {
|
422
|
|
- this.property.propertyName = item.value;
|
423
|
|
- }
|
424
|
|
- if (item.fieldName === 'unit') {
|
425
|
|
- this.property.unit = item.value;
|
426
|
|
- }
|
427
|
|
- if (item.fieldName === 'addressLine1') {
|
428
|
|
- this.property.addressLine1 = item.value;
|
429
|
|
- }
|
430
|
|
- if (item.fieldName === 'addressLine2') {
|
431
|
|
- this.property.addressLine2 = item.value;
|
432
|
|
- }
|
433
|
|
- if (item.fieldName === 'addressLine3') {
|
434
|
|
- this.property.addressLine3 = item.value;
|
435
|
|
- }
|
436
|
|
- if (item.fieldName === 'province') {
|
437
|
|
- if (item.value !== '') {
|
438
|
|
- this.property.province = this.provinces.find(
|
439
|
|
- p => p.description === item.value,
|
440
|
|
- );
|
441
|
|
- this.property.provinceId = this.property.province.id;
|
442
|
|
- this.getCities(Object.assign({}, { province: item.value }));
|
443
|
|
- this.property.city = null;
|
444
|
|
- this.property.suburb = null;
|
445
|
|
- this.property.addressLine3 = '';
|
446
|
|
- } else {
|
447
|
|
- this.property.province = null;
|
448
|
|
- this.property.city = null;
|
449
|
|
- this.property.suburb = null;
|
450
|
|
- this.property.addressLine3 = '';
|
451
|
|
- this.cities = [];
|
452
|
|
- this.suburbs = [];
|
453
|
|
- }
|
454
|
|
- }
|
455
|
|
- if (item.fieldName === 'city') {
|
456
|
|
- if (item.value !== '') {
|
457
|
|
- const newCity = this.cities.find(
|
458
|
|
- p => p.description === item.value,
|
459
|
|
- );
|
460
|
|
- this.property.city = newCity;
|
461
|
|
- this.property.cityId = newCity.id;
|
462
|
|
- this.getSuburbs(
|
463
|
|
- Object.assign(
|
464
|
|
- {},
|
465
|
|
- {
|
466
|
|
- province: this.property.province.description,
|
467
|
|
- city: item.value,
|
468
|
|
- },
|
469
|
|
- ),
|
470
|
|
- );
|
471
|
|
- this.property.suburb = null;
|
472
|
|
- this.property.addressLine3 = '';
|
473
|
|
- } else {
|
474
|
|
- this.property.city = null;
|
475
|
|
- this.property.suburb = null;
|
476
|
|
- this.property.addressLine3 = '';
|
477
|
|
- this.suburbs = [];
|
478
|
|
- }
|
479
|
|
- }
|
480
|
|
- if (item.fieldName === 'suburb') {
|
481
|
|
- if (item.value !== '') {
|
482
|
|
- const newSuburb = this.suburbs.find(
|
483
|
|
- p => p.description === item.value,
|
484
|
|
- );
|
485
|
|
- this.property.suburb = newSuburb;
|
486
|
|
- this.property.suburbId = newSuburb.id;
|
487
|
|
- this.property.addressLine3 = this.property.suburb.postalCode;
|
488
|
|
- } else {
|
489
|
|
- this.property.suburb = null;
|
490
|
|
- this.property.addressLine3 = '';
|
491
|
|
- }
|
492
|
|
- }
|
493
|
|
- if (item.fieldName === 'price') {
|
494
|
|
- this.property.price = item.value;
|
495
|
|
- }
|
496
|
|
- if (item.fieldName === 'pricePer') {
|
497
|
|
- this.property.pricePer = item.value;
|
498
|
|
- }
|
499
|
|
- if (item.fieldName === 'virtualTour') {
|
500
|
|
- this.property.virtualTour = item.value;
|
501
|
|
- }
|
502
|
|
- if (item.fieldName === 'video') {
|
503
|
|
- this.property.video = item.value;
|
504
|
|
- }
|
505
|
463
|
}
|
506
|
464
|
}
|
507
|
465
|
},
|
|
@@ -509,8 +467,28 @@ export default {
|
509
|
467
|
this.propertyType = this.property.propertyUsageType;
|
510
|
468
|
},
|
511
|
469
|
SubmitData() {
|
512
|
|
- this.wait = true;
|
|
470
|
+ if (this.property.propertyTypeId === 0) {
|
|
471
|
+ this.showPropertyTypeError = true;
|
|
472
|
+ }
|
|
473
|
+ if (this.property.province === null) {
|
|
474
|
+ this.showProvinceError = true;
|
|
475
|
+ }
|
|
476
|
+ if (this.property.city === null) {
|
|
477
|
+ this.showCityError = true;
|
|
478
|
+ }
|
|
479
|
+ if (this.property.suburb === null) {
|
|
480
|
+ this.showSuburbError = true;
|
|
481
|
+ }
|
513
|
482
|
|
|
483
|
+ if (
|
|
484
|
+ this.showPropertyTypeError
|
|
485
|
+ || this.showProvinceError
|
|
486
|
+ || this.showCityError
|
|
487
|
+ || this.showSuburbError
|
|
488
|
+ ) {
|
|
489
|
+ return;
|
|
490
|
+ }
|
|
491
|
+ this.wait = true;
|
514
|
492
|
this.newPropertyImages.propertyId = this.property.id;
|
515
|
493
|
this.newPropertyImages.Images = [];
|
516
|
494
|
// eslint-disable-next-line no-plusplus
|
|
@@ -524,7 +502,6 @@ export default {
|
524
|
502
|
isDefault: setAsDefault,
|
525
|
503
|
});
|
526
|
504
|
}
|
527
|
|
-
|
528
|
505
|
this.property.propertyImages = this.propertyImages;
|
529
|
506
|
// eslint-disable-next-line no-plusplus
|
530
|
507
|
for (let i = 0; i < this.property.propertyImages.length; i++) {
|