Lene преди 4 години
родител
ревизия
dd63ca59ed

+ 24
- 21
src/components/property/commercial/createProperty/commercialCreateNew.vue Целия файл

51
               @change="PropertyTypeSelected"
51
               @change="PropertyTypeSelected"
52
             >
52
             >
53
               <option value="0">Please select type *</option>
53
               <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>
54
+              <option v-for="item in propertyTypes" :value="item.id" :key="item.id">
55
+                {{ item.description }}
56
+              </option>
57
             </select>
57
             </select>
58
           </div>
58
           </div>
59
           <div v-if="propertyType === 'Commercial'" class="col-md-2">
59
           <div v-if="propertyType === 'Commercial'" class="col-md-2">
94
                 </div>
94
                 </div>
95
                 <float-label label="price">
95
                 <float-label label="price">
96
                   <currency-input
96
                   <currency-input
97
-                    onClick="this.setSelectionRange(0, this.value.length)"
97
+                    onclick="this.setSelectionRange(0, this.value.length)"
98
                     name="price"
98
                     name="price"
99
-                    :value="value"
100
-                    @input="value = $event"
99
+                    :value="property.price"
100
+                    @input="property.price = $event"
101
                     v-model="property.price"
101
                     v-model="property.price"
102
                     id="price"
102
                     id="price"
103
                     class="form-control uniInput"
103
                     class="form-control uniInput"
139
                   class="form-control uniInput"
139
                   class="form-control uniInput"
140
                   type="text"
140
                   type="text"
141
                   name="streetNumber"
141
                   name="streetNumber"
142
-                  id="unit"
142
+                  id="streetNumber"
143
                   v-model="property.streetNumber"
143
                   v-model="property.streetNumber"
144
-                  disabled
145
                 />
144
                 />
146
               </div>
145
               </div>
147
             </div>
146
             </div>
154
                   class="form-control uniInput"
153
                   class="form-control uniInput"
155
                   type="text"
154
                   type="text"
156
                   name="streetName"
155
                   name="streetName"
157
-                  id="unit"
156
+                  id="streetName"
158
                   v-model="property.streetName"
157
                   v-model="property.streetName"
159
-                  disabled
160
                 />
158
                 />
161
               </div>
159
               </div>
162
             </div>
160
             </div>
169
                   class="form-control uniInput"
167
                   class="form-control uniInput"
170
                   type="text"
168
                   type="text"
171
                   name="suburb"
169
                   name="suburb"
172
-                  id="unit"
170
+                  id="suburb"
173
                   v-model="property.suburb"
171
                   v-model="property.suburb"
174
-                  disabled
175
                 />
172
                 />
176
               </div>
173
               </div>
177
             </div>
174
             </div>
184
                   class="form-control uniInput"
181
                   class="form-control uniInput"
185
                   type="text"
182
                   type="text"
186
                   name="city"
183
                   name="city"
187
-                  id="unit"
184
+                  id="city"
188
                   v-model="property.city"
185
                   v-model="property.city"
189
-                  disabled
190
                 />
186
                 />
191
               </div>
187
               </div>
192
             </div>
188
             </div>
199
                   class="form-control uniInput"
195
                   class="form-control uniInput"
200
                   type="text"
196
                   type="text"
201
                   name="province"
197
                   name="province"
202
-                  id="unit"
198
+                  id="province"
203
                   v-model="property.province"
199
                   v-model="property.province"
204
-                  disabled
205
                 />
200
                 />
206
               </div>
201
               </div>
207
             </div>
202
             </div>
214
                   class="form-control uniInput"
209
                   class="form-control uniInput"
215
                   type="text"
210
                   type="text"
216
                   name="postalCode"
211
                   name="postalCode"
217
-                  id="unit"
212
+                  id="postalCode"
218
                   v-model="property.postalCode"
213
                   v-model="property.postalCode"
219
-                  disabled
220
                 />
214
                 />
221
               </div>
215
               </div>
222
             </div>
216
             </div>
229
                   class="form-control uniInput"
223
                   class="form-control uniInput"
230
                   type="text"
224
                   type="text"
231
                   name="country"
225
                   name="country"
232
-                  id="unit"
226
+                  id="country"
233
                   v-model="property.country"
227
                   v-model="property.country"
234
-                  disabled
235
                 />
228
                 />
236
               </div>
229
               </div>
237
             </div>
230
             </div>
261
         <div v-for="item in propertyFields" :key="item.id">
254
         <div v-for="item in propertyFields" :key="item.id">
262
           <div v-if="item.name === 'Commercial Fields'">
255
           <div v-if="item.name === 'Commercial Fields'">
263
             <UserField
256
             <UserField
264
-              :fields="item.fields"
257
+              :fields="sortFields"
265
               :id="item.name"
258
               :id="item.name"
266
               @UpdateUserDefinedFields="UpdateUserDefinedFields"
259
               @UpdateUserDefinedFields="UpdateUserDefinedFields"
267
               :fieldValues="item.fields"
260
               :fieldValues="item.fields"
268
             />
261
             />
269
           </div>
262
           </div>
270
         </div>
263
         </div>
264
+
271
         <div class="row">
265
         <div class="row">
272
           <div class="col-sm-12">
266
           <div class="col-sm-12">
273
             <div class="section-header">
267
             <div class="section-header">
407
     TypeChanged() {
401
     TypeChanged() {
408
       this.property.propertyUsageType = this.propertyType;
402
       this.property.propertyUsageType = this.propertyType;
409
     },
403
     },
404
+
410
     SubmitData() {
405
     SubmitData() {
411
       if (this.property.propertyTypeId === 0) {
406
       if (this.property.propertyTypeId === 0) {
412
         this.showPropertyTypeError = true;
407
         this.showPropertyTypeError = true;
542
     ]),
537
     ]),
543
     ...mapState("authentication", ["user"]),
538
     ...mapState("authentication", ["user"]),
544
     ...mapGetters("fees", ["getListingFee"]),
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
+    },
545
     SalesTypeChanged() {
548
     SalesTypeChanged() {
546
       // eslint-disable-next-line vue/no-side-effects-in-computed-properties
549
       // eslint-disable-next-line vue/no-side-effects-in-computed-properties
547
       // this.propertyType = this.$route.params.propType;
550
       // this.propertyType = this.$route.params.propType;

+ 7
- 7
src/components/property/editProperty/editProperty.vue Целия файл

160
                         name="streetNumber"
160
                         name="streetNumber"
161
                         id="unit"
161
                         id="unit"
162
                         v-model="property.streetNumber"
162
                         v-model="property.streetNumber"
163
-                        disabled
163
+                        :disabled="!canEdit"
164
                       />
164
                       />
165
                     </div>
165
                     </div>
166
                   </div>
166
                   </div>
175
                         name="streetName"
175
                         name="streetName"
176
                         id="unit"
176
                         id="unit"
177
                         v-model="property.streetName"
177
                         v-model="property.streetName"
178
-                        disabled
178
+                        :disabled="!canEdit"
179
                       />
179
                       />
180
                     </div>
180
                     </div>
181
                   </div>
181
                   </div>
190
                         name="suburb"
190
                         name="suburb"
191
                         id="unit"
191
                         id="unit"
192
                         v-model="property.suburb"
192
                         v-model="property.suburb"
193
-                        disabled
193
+                        :disabled="!canEdit"
194
                       />
194
                       />
195
                     </div>
195
                     </div>
196
                   </div>
196
                   </div>
205
                         name="city"
205
                         name="city"
206
                         id="unit"
206
                         id="unit"
207
                         v-model="property.city"
207
                         v-model="property.city"
208
-                        disabled
208
+                        :disabled="!canEdit"
209
                       />
209
                       />
210
                     </div>
210
                     </div>
211
                   </div>
211
                   </div>
220
                         name="province"
220
                         name="province"
221
                         id="unit"
221
                         id="unit"
222
                         v-model="property.province"
222
                         v-model="property.province"
223
-                        disabled
223
+                        :disabled="!canEdit"
224
                       />
224
                       />
225
                     </div>
225
                     </div>
226
                   </div>
226
                   </div>
235
                         name="postalCode"
235
                         name="postalCode"
236
                         id="unit"
236
                         id="unit"
237
                         v-model="property.postalCode"
237
                         v-model="property.postalCode"
238
-                        disabled
238
+                        :disabled="!canEdit"
239
                       />
239
                       />
240
                     </div>
240
                     </div>
241
                   </div>
241
                   </div>
250
                         name="country"
250
                         name="country"
251
                         id="unit"
251
                         id="unit"
252
                         v-model="property.country"
252
                         v-model="property.country"
253
-                        disabled
253
+                        :disabled="!canEdit"
254
                       />
254
                       />
255
                     </div>
255
                     </div>
256
                   </div>
256
                   </div>

+ 20
- 29
src/components/property/residential/createProperty/residentialCreateNew.vue Целия файл

51
               @change="PropertyTypeSelected"
51
               @change="PropertyTypeSelected"
52
             >
52
             >
53
               <option value="0">Please select type *</option>
53
               <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>
54
+              <option v-for="item in propertyTypes" :value="item.id" :key="item.id">
55
+                {{ item.description }}
56
+              </option>
57
             </select>
57
             </select>
58
           </div>
58
           </div>
59
         </div>
59
         </div>
79
                   >
79
                   >
80
                 </div>
80
                 </div>
81
                 <float-label label="Price">
81
                 <float-label label="Price">
82
-                  <currency-input
83
-                    onClick="this.setSelectionRange(0, this.value.length)"
84
-                    name="price"
85
-                    :value="value"
86
-                    @input="value = $event"
87
-                    v-model="property.price"
88
-                    id="price"
89
-                    class="form-control uniInput"
90
-                  />
82
+                  <currency-input <<<<<<< HEAD ======= onclick="this.setSelectionRange(0,
83
+                  this.value.length)" >>>>>>> 6bbfd86e089da859d019dcbda5cc0fe053af8db2 name="price"
84
+                  :value="property.price" @input="property.price = $event" v-model="property.price"
85
+                  id="price" class="form-control uniInput" />
91
                 </float-label>
86
                 </float-label>
92
               </div>
87
               </div>
93
               <div v-if="salesType === 'Rental'" class="col-md-6">
88
               <div v-if="salesType === 'Rental'" class="col-md-6">
125
                   class="form-control uniInput"
120
                   class="form-control uniInput"
126
                   type="text"
121
                   type="text"
127
                   name="streetNumber"
122
                   name="streetNumber"
128
-                  id="unit"
123
+                  id="streetNumber"
129
                   v-model="property.streetNumber"
124
                   v-model="property.streetNumber"
130
-                  disabled
131
                 />
125
                 />
132
               </div>
126
               </div>
133
             </div>
127
             </div>
140
                   class="form-control uniInput"
134
                   class="form-control uniInput"
141
                   type="text"
135
                   type="text"
142
                   name="streetName"
136
                   name="streetName"
143
-                  id="unit"
137
+                  id="streetName"
144
                   v-model="property.streetName"
138
                   v-model="property.streetName"
145
-                  disabled
146
                 />
139
                 />
147
               </div>
140
               </div>
148
             </div>
141
             </div>
155
                   class="form-control uniInput"
148
                   class="form-control uniInput"
156
                   type="text"
149
                   type="text"
157
                   name="suburb"
150
                   name="suburb"
158
-                  id="unit"
151
+                  id="suburb"
159
                   v-model="property.suburb"
152
                   v-model="property.suburb"
160
-                  disabled
161
                 />
153
                 />
162
               </div>
154
               </div>
163
             </div>
155
             </div>
170
                   class="form-control uniInput"
162
                   class="form-control uniInput"
171
                   type="text"
163
                   type="text"
172
                   name="city"
164
                   name="city"
173
-                  id="unit"
165
+                  id="city"
174
                   v-model="property.city"
166
                   v-model="property.city"
175
-                  disabled
176
                 />
167
                 />
177
               </div>
168
               </div>
178
             </div>
169
             </div>
185
                   class="form-control uniInput"
176
                   class="form-control uniInput"
186
                   type="text"
177
                   type="text"
187
                   name="province"
178
                   name="province"
188
-                  id="unit"
179
+                  id="province"
189
                   v-model="property.province"
180
                   v-model="property.province"
190
-                  disabled
191
                 />
181
                 />
192
               </div>
182
               </div>
193
             </div>
183
             </div>
200
                   class="form-control uniInput"
190
                   class="form-control uniInput"
201
                   type="text"
191
                   type="text"
202
                   name="postalCode"
192
                   name="postalCode"
203
-                  id="unit"
193
+                  id="postalCode"
204
                   v-model="property.postalCode"
194
                   v-model="property.postalCode"
205
-                  disabled
206
                 />
195
                 />
207
               </div>
196
               </div>
208
             </div>
197
             </div>
215
                   class="form-control uniInput"
204
                   class="form-control uniInput"
216
                   type="text"
205
                   type="text"
217
                   name="country"
206
                   name="country"
218
-                  id="unit"
207
+                  id="country"
219
                   v-model="property.country"
208
                   v-model="property.country"
220
-                  disabled
221
                 />
209
                 />
222
               </div>
210
               </div>
223
             </div>
211
             </div>
261
           :fields="propertyOverviewFields[0].fields"
249
           :fields="propertyOverviewFields[0].fields"
262
           @UpdateUserDefinedFields="UpdateUserDefinedFields"
250
           @UpdateUserDefinedFields="UpdateUserDefinedFields"
263
           :id="1"
251
           :id="1"
264
-        ></UserField>
265
-        <div class="row">
252
+        ></UserField> -->
253
+        <!-- <div class="row">
266
           <div class="col-md-12">
254
           <div class="col-md-12">
267
             <div v-for="item in propertyFields" :key="item.id">
255
             <div v-for="item in propertyFields" :key="item.id">
268
               <div class="row">
256
               <div class="row">
280
               />
268
               />
281
             </div>
269
             </div>
282
           </div>
270
           </div>
283
-        </div> -->
271
+        </div>-->
284
         <div class="row">
272
         <div class="row">
285
           <div class="col-sm-12">
273
           <div class="col-sm-12">
286
             <div class="section-header">
274
             <div class="section-header">
568
     ]),
556
     ]),
569
     ...mapState("authentication", ["user"]),
557
     ...mapState("authentication", ["user"]),
570
     ...mapGetters("fees", ["getListingFee"]),
558
     ...mapGetters("fees", ["getListingFee"]),
559
+    sortFields() {
560
+      return this.propertyFields[0].fields.sort((a, b) => (a.rank > b.rank ? 1 : -1));
561
+    },
571
     SalesTypeChanged() {
562
     SalesTypeChanged() {
572
       // eslint-disable-next-line vue/no-side-effects-in-computed-properties
563
       // eslint-disable-next-line vue/no-side-effects-in-computed-properties
573
       // this.propertyType = this.$route.params.propType;
564
       // this.propertyType = this.$route.params.propType;

+ 78
- 69
src/components/shared/listView.vue Целия файл

2
 <template>
2
 <template>
3
   <div>
3
   <div>
4
     <div style="height:5px"></div>
4
     <div style="height:5px"></div>
5
-    <div class="d-flex justify-content-between ">
5
+    <div class="d-flex justify-content-between">
6
       <div class="p-2" v-if="!hideSearch">
6
       <div class="p-2" v-if="!hideSearch">
7
         <float-label label="SEARCH">
7
         <float-label label="SEARCH">
8
           <input v-model="searchItem" class="form-control uniInput mt-3" placeholder="Search..." />
8
           <input v-model="searchItem" class="form-control uniInput mt-3" placeholder="Search..." />
14
       <div class="p-2">
14
       <div class="p-2">
15
         <div class="d-flex flex-row">
15
         <div class="d-flex flex-row">
16
           <div class="p2" v-if="showColumnChooser">
16
           <div class="p2" v-if="showColumnChooser">
17
-            <div class="btn-solid-blue cursor-pointer" data-toggle="modal" data-target="#myModal">
18
-              Column Chooser
19
-            </div>
17
+            <div
18
+              class="btn-solid-blue cursor-pointer"
19
+              data-toggle="modal"
20
+              data-target="#myModal"
21
+            >Column Chooser</div>
20
             <div class="col-md-12">
22
             <div class="col-md-12">
21
               <div id="myModal" class="modal fade" role="dialog">
23
               <div id="myModal" class="modal fade" role="dialog">
22
                 <div class="modal-dialog modal-lg" style="width:500px">
24
                 <div class="modal-dialog modal-lg" style="width:500px">
35
             </div>
37
             </div>
36
           </div>
38
           </div>
37
           <div class="p2" v-if="selectedItems.length > 0">
39
           <div class="p2" v-if="selectedItems.length > 0">
38
-            <div class="btn-solid-blue cursor-pointer" @click="onClearSelected()">
39
-              Clear Selected
40
-            </div>
40
+            <div class="btn-solid-blue cursor-pointer" @click="onClearSelected()">Clear Selected</div>
41
           </div>
41
           </div>
42
           <div class="p2" v-if="showNew">
42
           <div class="p2" v-if="showNew">
43
-            <div class="btn-solid-blue cursor-pointer" @click="onNew()">
44
-              New
45
-            </div>
43
+            <div class="btn-solid-blue cursor-pointer" @click="onNew()">New</div>
46
           </div>
44
           </div>
47
         </div>
45
         </div>
48
       </div>
46
       </div>
64
                 :class="{ active: hover === c }"
62
                 :class="{ active: hover === c }"
65
               >
63
               >
66
                 <div class="d-flex bd-highlight">
64
                 <div class="d-flex bd-highlight">
67
-                  <div v-if="displayHeaders.length === 0" class="p-2 w-100 bd-highlight">
68
-                    {{ column | toProper }}
69
-                  </div>
70
-                  <div v-else class="p-2 w-100 bd-highlight">
71
-                    {{ displayHeaders[c] !== "" ? displayHeaders[c] : column | toProper }}
72
-                  </div>
65
+                  <div
66
+                    v-if="displayHeaders.length === 0"
67
+                    class="p-2 w-100 bd-highlight"
68
+                  >{{ column | toProper }}</div>
69
+                  <div
70
+                    v-else
71
+                    class="p-2 w-100 bd-highlight"
72
+                  >{{ displayHeaders[c] !== "" ? displayHeaders[c] : column | toProper }}</div>
73
                   <div class="p-2 flex-shrink-1 bd-highlight">
73
                   <div class="p-2 flex-shrink-1 bd-highlight">
74
                     <img
74
                     <img
75
                       src="../../../public/img/sort-up.png"
75
                       src="../../../public/img/sort-up.png"
98
             :class="{ selected: isSelected(i), 'cursor-pointer': allowSelect }"
98
             :class="{ selected: isSelected(i), 'cursor-pointer': allowSelect }"
99
           >
99
           >
100
             <td v-for="(column, c) in Columns" :key="c">
100
             <td v-for="(column, c) in Columns" :key="c">
101
-              <div v-if="displayFormats.length === 0">
102
-                {{ isObject(item[column]) ? item[column].display : item[column] }}
103
-              </div>
101
+              <div
102
+                v-if="displayFormats.length === 0"
103
+              >{{ isObject(item[column]) ? item[column].display : item[column] }}</div>
104
               <div v-else-if="displayFormats.length > 0 && displayFormats[c] === 'date'">
104
               <div v-else-if="displayFormats.length > 0 && displayFormats[c] === 'date'">
105
-                <div v-if="item[column] !== '0001-01-01T00:00:00'">
106
-                  {{ isObject(item[column]) ? item[column].display : item[column] | toDate }}
107
-                </div>
108
-              </div>
109
-              <div v-else-if="displayFormats.length > 0 && displayFormats[c] === 'money'">
110
-                {{ isObject(item[column]) ? item[column].display : item[column] | toCurrency }}
105
+                <div
106
+                  v-if="item[column] !== '0001-01-01T00:00:00'"
107
+                >{{ isObject(item[column]) ? item[column].display : item[column] | toDate }}</div>
111
               </div>
108
               </div>
109
+              <div
110
+                v-else-if="displayFormats.length > 0 && displayFormats[c] === 'money'"
111
+              >{{ isObject(item[column]) ? item[column].display : item[column] | toCurrency }}</div>
112
               <div v-else-if="displayFormats.length > 0 && displayFormats[c] === 'image'">
112
               <div v-else-if="displayFormats.length > 0 && displayFormats[c] === 'image'">
113
                 <img :src="item[column]" style="height:100px; width:100px; object-fit: cover;" />
113
                 <img :src="item[column]" style="height:100px; width:100px; object-fit: cover;" />
114
               </div>
114
               </div>
115
               <div v-else>{{ isObject(item[column]) ? item[column].display : item[column] }}</div>
115
               <div v-else>{{ isObject(item[column]) ? item[column].display : item[column] }}</div>
116
             </td>
116
             </td>
117
             <td v-if="showCustomAction" class="my-width">
117
             <td v-if="showCustomAction" class="my-width">
118
-              <button type="button" class="btn my-btn" @click="onCustomClick(item)">
119
-                {{ CustomActionHeading }}
120
-              </button>
118
+              <button
119
+                type="button"
120
+                class="btn my-btn"
121
+                @click="onCustomClick(item)"
122
+              >{{ CustomActionHeading }}</button>
121
             </td>
123
             </td>
122
             <td v-if="editable" class="my-width">
124
             <td v-if="editable" class="my-width">
123
               <a @click="onEdit(item)" class="p-3">
125
               <a @click="onEdit(item)" class="p-3">
137
       <div class="d-flex justify-content-between" v-if="showPager">
139
       <div class="d-flex justify-content-between" v-if="showPager">
138
         <div class="p-1">
140
         <div class="p-1">
139
           {{
141
           {{
140
-            currentPage +
141
-              " / " +
142
-              PageCount +
143
-              (!hideItemCount ? " - (" + FilteredItems.length + " items)" : "")
142
+          currentPage +
143
+          " / " +
144
+          PageCount +
145
+          (!hideItemCount ? " - (" + FilteredItems.length + " items)" : "")
144
           }}
146
           }}
145
         </div>
147
         </div>
146
         <div class="p-1">
148
         <div class="p-1">
185
   components: {
187
   components: {
186
     BasePagination,
188
     BasePagination,
187
     Alert,
189
     Alert,
188
-    ListViewControl
190
+    ListViewControl,
189
   },
191
   },
190
   mounted() {
192
   mounted() {
191
     try {
193
     try {
201
   },
203
   },
202
   props: {
204
   props: {
203
     compact: {
205
     compact: {
204
-      default: true
206
+      default: true,
205
     },
207
     },
206
     allowSelect: {
208
     allowSelect: {
207
-      default: true
209
+      default: true,
208
     },
210
     },
209
     allowMultipleSelect: {
211
     allowMultipleSelect: {
210
-      default: false
212
+      default: false,
211
     },
213
     },
212
     hideSearch: {
214
     hideSearch: {
213
-      default: false
215
+      default: false,
214
     },
216
     },
215
     showNew: {
217
     showNew: {
216
-      default: true
218
+      default: true,
217
     },
219
     },
218
     items: undefined,
220
     items: undefined,
219
     editable: {
221
     editable: {
220
-      default: false
222
+      default: false,
221
     },
223
     },
222
     deleteable: {
224
     deleteable: {
223
-      default: false
225
+      default: false,
224
     },
226
     },
225
     columnCount: {
227
     columnCount: {
226
-      default: 6
228
+      default: 6,
227
     },
229
     },
228
     showPager: {
230
     showPager: {
229
-      default: true
231
+      default: true,
230
     },
232
     },
231
     title: {
233
     title: {
232
-      default: undefined
234
+      default: undefined,
233
     },
235
     },
234
     sortKey: {
236
     sortKey: {
235
-      default: "id"
237
+      default: "id",
236
     },
238
     },
237
     hideItemCount: {
239
     hideItemCount: {
238
-      default: false
240
+      default: false,
239
     },
241
     },
240
     currentPage: {
242
     currentPage: {
241
-      default: 1
243
+      default: 1,
242
     },
244
     },
243
     bordered: {
245
     bordered: {
244
-      default: true
246
+      default: true,
245
     },
247
     },
246
     striped: {
248
     striped: {
247
-      default: true
249
+      default: true,
248
     },
250
     },
249
     showColumnChooser: {
251
     showColumnChooser: {
250
-      default: true
252
+      default: true,
251
     },
253
     },
252
     displayColumns: {
254
     displayColumns: {
253
-      default: []
255
+      type: Array,
256
+      default: () => [],
254
     },
257
     },
255
     displayFormats: {
258
     displayFormats: {
256
-      default: []
259
+      type: Array,
260
+      default: () => [],
257
     },
261
     },
258
     displayHeaders: {
262
     displayHeaders: {
259
-      default: []
263
+      type: Array,
264
+      default: () => [],
260
     },
265
     },
261
     showCustomAction: {
266
     showCustomAction: {
262
-      default: false
267
+      default: false,
263
     },
268
     },
264
     CustomActionHeading: {
269
     CustomActionHeading: {
265
-      default: ""
270
+      default: "",
266
     },
271
     },
267
     CustomActionCondition: {
272
     CustomActionCondition: {
268
-      default: ""
269
-    }
273
+      default: "",
274
+    },
270
   },
275
   },
271
   data() {
276
   data() {
272
     return {
277
     return {
279
       visibleItemsPerPageCount: 20,
284
       visibleItemsPerPageCount: 20,
280
       itemsPerPageList: ItemsPerPageList,
285
       itemsPerPageList: ItemsPerPageList,
281
       visibleColumn: [],
286
       visibleColumn: [],
282
-      allColumn: []
287
+      allColumn: [],
283
     };
288
     };
284
   },
289
   },
285
   methods: {
290
   methods: {
301
         for (const i in Object.keys(this.items)) {
306
         for (const i in Object.keys(this.items)) {
302
           const item = this.items[i];
307
           const item = this.items[i];
303
           for (const o in Object.keys(item)) {
308
           for (const o in Object.keys(item)) {
304
-            if (!listAll.includes(Object.keys(item)[o]) && !Array.isArray(Object.values(item)[o])) {
309
+            if (
310
+              !listAll.includes(Object.keys(item)[o]) &&
311
+              !Array.isArray(Object.values(item)[o])
312
+            ) {
305
               const columnName = Object.keys(item)[o];
313
               const columnName = Object.keys(item)[o];
306
-              if (!listAll.some(x => x.column === columnName)) {
314
+              if (!listAll.some((x) => x.column === columnName)) {
307
                 listAll.push({
315
                 listAll.push({
308
                   column: columnName,
316
                   column: columnName,
309
-                  show: _.filter(listAll, x => x.show).length < this.columnCount
317
+                  show:
318
+                    _.filter(listAll, (x) => x.show).length < this.columnCount,
310
                 });
319
                 });
311
               }
320
               }
312
             }
321
             }
321
     },
330
     },
322
     isSelected(i) {
331
     isSelected(i) {
323
       const ind = this.getActualIndex(i);
332
       const ind = this.getActualIndex(i);
324
-      return _.some(this.selectedItems, x => x === ind);
333
+      return _.some(this.selectedItems, (x) => x === ind);
325
     },
334
     },
326
     onNew() {
335
     onNew() {
327
       this.$emit("onNew");
336
       this.$emit("onNew");
357
     },
366
     },
358
     onRowClick(item, i) {
367
     onRowClick(item, i) {
359
       const ind = this.getActualIndex(i);
368
       const ind = this.getActualIndex(i);
360
-      if (_.some(this.selectedItems, x => x === ind)) {
361
-        this.selectedItems = this.selectedItems.filter(x => x !== ind);
369
+      if (_.some(this.selectedItems, (x) => x === ind)) {
370
+        this.selectedItems = this.selectedItems.filter((x) => x !== ind);
362
       } else {
371
       } else {
363
         if (!this.allowMultipleSelect) {
372
         if (!this.allowMultipleSelect) {
364
           this.selectedItems = [];
373
           this.selectedItems = [];
411
         if (array[i] === value) return true;
420
         if (array[i] === value) return true;
412
       }
421
       }
413
       return false;
422
       return false;
414
-    }
423
+    },
415
   },
424
   },
416
   computed: {
425
   computed: {
417
     ListWidth() {
426
     ListWidth() {
438
           listColumns.push(this.displayColumns[i]);
447
           listColumns.push(this.displayColumns[i]);
439
         }
448
         }
440
       } else {
449
       } else {
441
-        const list = _.filter(this.allColumn, x => x.show);
450
+        const list = _.filter(this.allColumn, (x) => x.show);
442
         for (const i in list) {
451
         for (const i in list) {
443
           const item = list[i];
452
           const item = list[i];
444
           if (item) {
453
           if (item) {
455
       return list;
464
       return list;
456
     },
465
     },
457
     FilteredItems() {
466
     FilteredItems() {
458
-      const list = _.filter(this.items, item =>
467
+      const list = _.filter(this.items, (item) =>
459
         Object.values(item).some(
468
         Object.values(item).some(
460
-          i =>
469
+          (i) =>
461
             JSON.stringify(i)
470
             JSON.stringify(i)
462
               .toLowerCase()
471
               .toLowerCase()
463
               .indexOf(this.searchItem.toLowerCase()) > -1
472
               .indexOf(this.searchItem.toLowerCase()) > -1
475
       return list.slice(startSlice, endSlice);
484
       return list.slice(startSlice, endSlice);
476
     },
485
     },
477
 
486
 
478
-    GetAllColumn() {}
479
-  }
487
+    GetAllColumn() {},
488
+  },
480
 };
489
 };
481
 </script>
490
 </script>
482
 <style scoped>
491
 <style scoped>

+ 5
- 5
src/components/timeshare/resort/contentSection.vue Целия файл

62
     ResortImages,
62
     ResortImages,
63
     gallerySection,
63
     gallerySection,
64
   },
64
   },
65
-  async mounted() {
66
-    await this.initResort(this.resortCode);
67
-    setTimeout(() => (this.boolLoaded = true), 2000);
68
-  },
65
+  // async mounted() {
66
+  //   await this.initResort(this.resortCode);
67
+  //   setTimeout(() => (this.boolLoaded = true), 2000);
68
+  // },
69
   data() {
69
   data() {
70
     return {
70
     return {
71
       index: null,
71
       index: null,
83
     },
83
     },
84
   },
84
   },
85
   methods: {
85
   methods: {
86
-    ...mapActions("resort", ["initResort"]),
86
+    ...mapActions("resort", ["GetResortData"]),
87
     routerGoTo(goto) {
87
     routerGoTo(goto) {
88
       this.$router.push(goto);
88
       this.$router.push(goto);
89
     },
89
     },

+ 6
- 5
src/components/timeshare/resort/resortPage.vue Целия файл

1
 <template>
1
 <template>
2
   <div>
2
   <div>
3
-    <carouselSection v-if="boolLoaded" :resortImages="images" />
3
+    <carouselSection v-if="boolLoaded" :resortImages="resort.images" />
4
     <main id="main" style="margin-top:-20px">
4
     <main id="main" style="margin-top:-20px">
5
       <contentSection :resortCode="resortCode" />
5
       <contentSection :resortCode="resortCode" />
6
     </main>
6
     </main>
26
     resortCode: {},
26
     resortCode: {},
27
   },
27
   },
28
   async created() {
28
   async created() {
29
-    this.initResort(this.resortCode).then(() => {
30
-      setTimeout(() => (this.boolLoaded = true), 2000);
31
-    });
29
+    this.getResortData(this.resortCode);
30
+    // .then(() => {
31
+    //   setTimeout(() => (this.boolLoaded = true), 2000);
32
+    // });
32
   },
33
   },
33
   computed: {
34
   computed: {
34
     ...mapState("resort", ["resort", "description", "images", "layout"]),
35
     ...mapState("resort", ["resort", "description", "images", "layout"]),
39
     },
40
     },
40
   },
41
   },
41
   methods: {
42
   methods: {
42
-    ...mapActions("resort", ["initResort"]),
43
+    ...mapActions("resort", ["getResortData"]),
43
     routerGoTo(goto) {
44
     routerGoTo(goto) {
44
       this.$router.push(goto);
45
       this.$router.push(goto);
45
     },
46
     },

+ 100
- 0
src/components/timeshare/resort/resortPageNew.vue Целия файл

1
+<template>
2
+  <div>
3
+    <carouselSection v-if="!wait" :resortImages="resort.images" />
4
+    <main id="main" style="margin-top:-20px">
5
+      <section>
6
+        <div class="container">
7
+          <div class="row" id="resort-profile">
8
+            <div class="col-md-3">
9
+              <img src="img/listings/property1/property1-gallery.jpg" class="img-fluid" alt />
10
+              <div class="row no-gutters">
11
+                <div class="col-6">
12
+                  <img src="img/listings/property1/property1-gallery.jpg" class="img-fluid" alt />
13
+                </div>
14
+                <div class="col-6">
15
+                  <img src="img/listings/property1/property1-gallery.jpg" class="img-fluid" alt />
16
+                </div>
17
+              </div>
18
+              <gallerySection :images="resort.images" />
19
+              <FilterComponent :hideTop="true" />
20
+            </div>
21
+            <div class="col-md-9 p-5 resort-profile">
22
+              <h2>{{ resort.prName }}</h2>
23
+              <WeekList :resortCode="resortCode" />
24
+              <p v-if="resort.description && resort.description !== ''">{{ resort.description }}</p>
25
+              <br v-if="resort.description && resort.description !== ''" />
26
+              <p>{{ resort.prNotes }}</p>
27
+              <div class="d-flex mt-3">
28
+                <iframe
29
+                  width="100%"
30
+                  height="200"
31
+                  id="gmap_canvas"
32
+                  :src="
33
+                'https://maps.google.com/maps?q=' +
34
+                  resort.prLatitude +
35
+                  ',' +
36
+                  resort.prLongitude +
37
+                  '&hl=en&z=14&amp;output=embed'
38
+              "
39
+                  frameborder="0"
40
+                  scrolling="no"
41
+                  marginheight="0"
42
+                  marginwidth="0"
43
+                ></iframe>
44
+              </div>
45
+            </div>
46
+          </div>
47
+        </div>
48
+      </section>
49
+    </main>
50
+    <div v-if="wait" id="preloader"></div>
51
+  </div>
52
+</template>
53
+
54
+<script>
55
+/* eslint-disable */
56
+import { mapState, mapActions } from "vuex";
57
+import WeekList from "../buy/weekListComponent.vue";
58
+import FilterComponent from "../searchTimeshare.vue";
59
+import ResortImages from "./resortImage.vue";
60
+import gallerySection from "./gallerySection";
61
+import carouselSection from "./carouselSection";
62
+
63
+export default {
64
+  components: {
65
+    carouselSection,
66
+    WeekList,
67
+    FilterComponent,
68
+    ResortImages,
69
+    gallerySection,
70
+  },
71
+  data() {
72
+    return {
73
+      wait: false,
74
+    };
75
+  },
76
+  props: {
77
+    resortCode: {},
78
+  },
79
+  methods: {
80
+    ...mapActions("resort", ["getResortData"]),
81
+    routerGoTo(goto) {
82
+      this.$router.push(goto);
83
+    },
84
+  },
85
+  computed: {
86
+    ...mapState("resort", ["resort"]),
87
+  },
88
+  mounted() {
89
+    this.wait = true;
90
+    this.getResortData(this.resortCode).then((fulfilled) => {
91
+      this.wait = false;
92
+    });
93
+    // .then(() => {
94
+    //   setTimeout(() => (this.boolLoaded = true), 2000);
95
+    // });
96
+  },
97
+};
98
+</script>
99
+
100
+<style lang="scss" scoped></style>

+ 1
- 1
src/components/timeshare/resort/unit/summarySection.vue Целия файл

9
     </div>
9
     </div>
10
     <div class="row mt-5">
10
     <div class="row mt-5">
11
       <div class="col-md-12 col-lg-4">
11
       <div class="col-md-12 col-lg-4">
12
-        <gallerySection :images="images" />
12
+        <gallerySection :images="resort.images" />
13
       </div>
13
       </div>
14
       <div class="col-md-12 col-lg-8 summarySection">
14
       <div class="col-md-12 col-lg-8 summarySection">
15
         <h4>
15
         <h4>

+ 124
- 0
src/components/timeshare/resort/unit/unitPageNew.vue Целия файл

1
+<template>
2
+  <main id="main" style="padding-bottom:50px">
3
+    <carouselSection v-if="!wait" :resortImages="resort.images" />
4
+    <summarySection :resortCode="resortCode" :unitNumber="unitNumber" />
5
+    <div class="container">
6
+      <div class="row mt-5">
7
+        <div class="col">
8
+          <tabSection
9
+            style="margin-bottom:100px"
10
+            :resortCode="resortCode"
11
+            :resortCoords="resort.prPostAdd1"
12
+            :layoutImages="layouts"
13
+            :resortName="resort.prName"
14
+          />
15
+        </div>
16
+      </div>
17
+    </div>
18
+    <div v-if="wait" id="preloader"></div>
19
+  </main>
20
+</template>
21
+
22
+<script>
23
+/* eslint-disable */
24
+import { mapState, mapActions, mapGetters } from "vuex";
25
+import gallerySection from "../gallerySection";
26
+import tabSection from "./tabSection";
27
+import summarySection from "./summarySection";
28
+import carouselSection from "./carouselSection";
29
+
30
+export default {
31
+  name: "unit",
32
+  components: {
33
+    gallerySection,
34
+    tabSection,
35
+    summarySection,
36
+    carouselSection,
37
+  },
38
+  props: {
39
+    resortCode: {},
40
+    unitNumber: {},
41
+  },
42
+  data() {
43
+    return {
44
+      wait: false,
45
+    };
46
+  },
47
+  mounted() {
48
+    // await this.initResort(this.resortCode);
49
+    // if (this.resortCode) {
50
+    //   this.applyResortFilter(this.resortCode);
51
+    // }
52
+    // await this.layouts.push(this.layout);
53
+    // await this.getWeeks();
54
+    // setTimeout(() => {
55
+    //   this.boolLoaded = true;
56
+    // }, 500);
57
+    this.wait = true;
58
+    this.getResortData(this.resortCode).then((fulfilled) => {
59
+      this.applyResortFilter(this.resortCode);
60
+      this.getWeeks();
61
+      this.wait = false;
62
+    });
63
+  },
64
+  computed: {
65
+    ...mapState("resort", ["resort"]),
66
+
67
+    ...mapGetters({
68
+      weekById: "weekList/weekById",
69
+    }),
70
+    week() {
71
+      return this.weekById(this.resortCode, this.unitNumber);
72
+    },
73
+    layouts() {
74
+      var layouts = [];
75
+      layouts.push(this.resort.layout);
76
+      return layouts;
77
+    },
78
+    // ...mapState('week', ['currentWeek']),
79
+  },
80
+  methods: {
81
+    ...mapActions("weekList", ["getWeeks", "applyResortFilter"]),
82
+    ...mapActions("resort", ["getResortData"]),
83
+    // ...mapActions('week', ['initWeek']),
84
+    formatPrice(value) {
85
+      if (value) {
86
+        const val = (value / 1).toFixed(2);
87
+        return val.toString().replace(/\B(?=(\d{3})+(?!\d))/g, " ");
88
+      }
89
+      return "";
90
+    },
91
+  },
92
+};
93
+</script>
94
+
95
+<style lang="scss" scoped>
96
+/* Extra small devices (phones, 600px and down) */
97
+@media only screen and (max-width: 600px) {
98
+  .summarySection {
99
+    margin-top: 1px;
100
+  }
101
+}
102
+
103
+/* Small devices (portrait tablets and large phones, 600px and up) */
104
+@media only screen and (min-width: 600px) {
105
+  .summarySection {
106
+    margin-top: 1px;
107
+  }
108
+}
109
+
110
+/* Medium devices (landscape tablets, 768px and up) */
111
+@media only screen and (min-width: 768px) {
112
+  .summarySection {
113
+    margin-top: -50px;
114
+  }
115
+}
116
+
117
+/* Large devices (laptops/desktops, 992px and up) */
118
+@media only screen and (min-width: 992px) {
119
+}
120
+
121
+/* Extra large devices (large laptops and desktops, 1200px and up) */
122
+@media only screen and (min-width: 1200px) {
123
+}
124
+</style>

+ 2
- 2
src/router/index.js Целия файл

50
 import agentManagementPage from "../components/admin/status/agentsUserManagementPage.vue";
50
 import agentManagementPage from "../components/admin/status/agentsUserManagementPage.vue";
51
 import Fees from "../components/admin/fees/feesPage.vue";
51
 import Fees from "../components/admin/fees/feesPage.vue";
52
 
52
 
53
-import ResortPage from "../components/timeshare/resort/resortPage.vue";
54
-import UnitPage from "../components/timeshare/resort/unit/unitPage.vue";
53
+import ResortPage from "../components/timeshare/resort/resortPageNew.vue";
54
+import UnitPage from "../components/timeshare/resort/unit/unitPageNew.vue";
55
 import ToBuySearch from "../components/timeshare/buy/toBuySearchResults.vue";
55
 import ToBuySearch from "../components/timeshare/buy/toBuySearchResults.vue";
56
 
56
 
57
 import ContactUs from "../components/misc/contactUs.vue";
57
 import ContactUs from "../components/misc/contactUs.vue";

+ 12
- 0
src/store/modules/timeshare/resort.js Целия файл

1
 /* eslint-disable no-restricted-syntax */
1
 /* eslint-disable no-restricted-syntax */
2
 /* eslint-disable guard-for-in */
2
 /* eslint-disable guard-for-in */
3
 import axios from "axios";
3
 import axios from "axios";
4
+import { reject } from "core-js/fn/promise";
4
 
5
 
5
 export default {
6
 export default {
6
   namespaced: true,
7
   namespaced: true,
134
           `https://www.tradeunipoint.com/unibackend/seam/resource/rest/products/social/${resortCode}`
135
           `https://www.tradeunipoint.com/unibackend/seam/resource/rest/products/social/${resortCode}`
135
         )
136
         )
136
         .then(result => commit("setResortMedia", result.data));
137
         .then(result => commit("setResortMedia", result.data));
138
+    },
139
+    getResortData({ commit }, resortCode) {
140
+      return new Promise((resolve, reject) => {
141
+        axios
142
+          .get(`/api/resort/GetResortData/${resortCode}`)
143
+          .then(result => {
144
+            commit("setResort", result.data);
145
+            resolve();
146
+          })
147
+          .catch(error => reject(new Error(error.message)));
148
+      });
137
     }
149
     }
138
   }
150
   }
139
 };
151
 };

+ 1
- 1
vue.config.js Целия файл

2
   devServer: {
2
   devServer: {
3
     proxy: {
3
     proxy: {
4
       "/api": {
4
       "/api": {
5
-        // target: "http://localhost:57260/",
5
+        //target: "http://localhost:57260/",
6
         target: "http://training.provision-sa.com:82",
6
         target: "http://training.provision-sa.com:82",
7
         changeOrigin: true
7
         changeOrigin: true
8
       },
8
       },

Loading…
Отказ
Запис