Kobus 5 anos atrás
pai
commit
913cb3fbd0

+ 0
- 1
src/components/admin/property/propertyTypeEdit.vue Ver arquivo

36
                 >
36
                 >
37
                   <option value="0">Residential</option>
37
                   <option value="0">Residential</option>
38
                   <option value="1">Commercial</option>
38
                   <option value="1">Commercial</option>
39
-                  <option value="2">Both</option>
40
                 </select>
39
                 </select>
41
               </div>
40
               </div>
42
             </div>
41
             </div>

+ 4
- 3
src/components/admin/property/propertyTypeList.vue Ver arquivo

24
             <th>Description</th>
24
             <th>Description</th>
25
             <th>Property Type</th>
25
             <th>Property Type</th>
26
             <th></th>
26
             <th></th>
27
+            <th></th>
27
           </tr>
28
           </tr>
28
         </thead>
29
         </thead>
29
         <tbody>
30
         <tbody>
30
           <tr v-for="(item, i) in propertyTypes" :key="i">
31
           <tr v-for="(item, i) in propertyTypes" :key="i">
31
             <td>{{ item.description }}</td>
32
             <td>{{ item.description }}</td>
32
             <td v-if="item.usageType === 0">Residential</td>
33
             <td v-if="item.usageType === 0">Residential</td>
33
-            <td v-else-if="item.usageType === 1">Commercial</td>
34
-            <td v-else>Both</td>
34
+            <td v-else>Commercial</td>
35
             <td>
35
             <td>
36
               <button
36
               <button
37
                 type="button"
37
                 type="button"
39
                 class="btn btn-b-n"
39
                 class="btn btn-b-n"
40
                 style="width: 85px; height:40px;"
40
                 style="width: 85px; height:40px;"
41
               >Edit</button>
41
               >Edit</button>
42
-              |
42
+            </td>
43
+            <td>
43
               <button
44
               <button
44
                 type="button"
45
                 type="button"
45
                 @click="Delete(item.id)"
46
                 @click="Delete(item.id)"

src/components/admin/property/userDefinedFieldPage.vue → src/components/admin/property/userDefinedField.vue Ver arquivo

66
 <script>
66
 <script>
67
 export default {
67
 export default {
68
   name: 'UserField',
68
   name: 'UserField',
69
+  props: {
70
+    field: {},
71
+  },
69
   data() {
72
   data() {
70
     return {
73
     return {
71
-      userField: {
72
-        fieldName: '',
73
-        fieldType: '',
74
-        rank: 0,
75
-      },
74
+      userField: {},
76
     };
75
     };
77
   },
76
   },
78
   mounted() {
77
   mounted() {
79
-    this.userField = this.$route.query.field;
78
+    if (this.field) {
79
+      this.userField = this.field;
80
+    }
80
   },
81
   },
81
   methods: {
82
   methods: {
82
     SubmitData() {
83
     SubmitData() {
83
-      //this.$emit();
84
+      this.$emit('UpdateUserField', this.userField);
84
     },
85
     },
85
   },
86
   },
86
 };
87
 };

+ 210
- 136
src/components/admin/property/userDefinedGroupPage.vue Ver arquivo

1
 <template>
1
 <template>
2
+  <!-- eslint-disable max-len -->
2
   <div>
3
   <div>
3
-    <section class="intro-single">
4
-      <div class="container">
5
-        <div class="row">
6
-          <div class="col-md-12 col-lg-8">
7
-            <div class="title-single-box">
8
-              <h2 class="title-single">User Defined Group</h2>
4
+    <div v-if="showField === false">
5
+      <section class="intro-single">
6
+        <div class="container">
7
+          <div class="row">
8
+            <div class="col-md-12 col-lg-8">
9
+              <div class="title-single-box">
10
+                <h2 class="title-single">User Defined Group</h2>
11
+              </div>
9
             </div>
12
             </div>
10
           </div>
13
           </div>
11
         </div>
14
         </div>
12
-      </div>
13
-    </section>
14
-    <div class="container">
15
-      <div class="row mb-3">
16
-        <div class="col-md-12">
17
-          <form id="mainForm">
18
-            <div v-if="userDefinedGroup" class="form-group row">
19
-              <div class="col-md-4">
20
-                <label>Description</label>
21
-                <input
22
-                  class="form-control"
23
-                  type="text"
24
-                  name="description"
25
-                  id="description"
26
-                  v-model="userDefinedGroup.description"
27
-                />
28
-              </div>
29
-              <div class="col-md-4">
30
-                <label>Property Type</label>
31
-                <select
32
-                  class="form-control"
33
-                  name="UsageType"
34
-                  id="UsageType"
35
-                  v-model="userDefinedGroup.usageType"
36
-                >
37
-                  <option value="0">Residential</option>
38
-                  <option value="1">Commercial</option>
39
-                  <option value="2">Both</option>
40
-                </select>
41
-              </div>
42
-              <div class="col-md-4">
43
-                <label>Order</label>
44
-                <input
45
-                  class="form-control"
46
-                  type="number"
47
-                  name="rank"
48
-                  id="rank"
49
-                  v-model="userDefinedGroup.rank"
50
-                />
51
-              </div>
52
-            </div>
53
-            <div v-if="!userDefinedGroup" class="form-group row">
54
-              <div class="col-md-4">
55
-                <label>Description</label>
56
-                <input
57
-                  class="form-control"
58
-                  type="text"
59
-                  name="description"
60
-                  id="description"
61
-                  v-model="group.description"
62
-                />
63
-              </div>
64
-              <div class="col-md-4">
65
-                <label>Property Type</label>
66
-                <select
67
-                  class="form-control"
68
-                  name="UsageType"
69
-                  id="UsageType"
70
-                  v-model="group.usageType"
71
-                >
72
-                  <option value="0">Residential</option>
73
-                  <option value="1">Commercial</option>
74
-                  <option value="2">Both</option>
75
-                </select>
15
+      </section>
16
+      <div class="container">
17
+        <div class="row mb-3">
18
+          <div class="col-md-12">
19
+            <form id="mainForm">
20
+              <div v-if="userDefinedGroup" class="form-group row">
21
+                <div class="col-md-4">
22
+                  <label>Description</label>
23
+                  <input
24
+                    class="form-control"
25
+                    type="text"
26
+                    name="description"
27
+                    id="description"
28
+                    v-model="userDefinedGroup.description"
29
+                  />
30
+                </div>
31
+                <div class="col-md-4">
32
+                  <label>Property Type</label>
33
+                  <select
34
+                    class="form-control"
35
+                    name="UsageType"
36
+                    id="UsageType"
37
+                    v-model="userDefinedGroup.usageType"
38
+                  >
39
+                    <option value="0">Residential</option>
40
+                    <option value="1">Commercial</option>
41
+                    <option value="2">Both</option>
42
+                  </select>
43
+                </div>
44
+                <div class="col-md-4">
45
+                  <label>Order</label>
46
+                  <input
47
+                    class="form-control"
48
+                    type="number"
49
+                    name="rank"
50
+                    id="rank"
51
+                    v-model="userDefinedGroup.rank"
52
+                  />
53
+                </div>
76
               </div>
54
               </div>
77
-              <div class="col-md-4">
78
-                <label>Order</label>
79
-                <input
80
-                  class="form-control"
81
-                  type="number"
82
-                  name="rank"
83
-                  id="rank"
84
-                  v-model="group.rank"
85
-                />
55
+              <div v-if="!userDefinedGroup" class="form-group row">
56
+                <div class="col-md-4">
57
+                  <label>Description</label>
58
+                  <input
59
+                    class="form-control"
60
+                    type="text"
61
+                    name="description"
62
+                    id="description"
63
+                    v-model="group.description"
64
+                  />
65
+                </div>
66
+                <div class="col-md-4">
67
+                  <label>Property Type</label>
68
+                  <select
69
+                    class="form-control"
70
+                    name="UsageType"
71
+                    id="UsageType"
72
+                    v-model="group.usageType"
73
+                  >
74
+                    <option value="0">Residential</option>
75
+                    <option value="1">Commercial</option>
76
+                    <option value="2">Both</option>
77
+                  </select>
78
+                </div>
79
+                <div class="col-md-4">
80
+                  <label>Order</label>
81
+                  <input
82
+                    class="form-control"
83
+                    type="number"
84
+                    name="rank"
85
+                    id="rank"
86
+                    v-model="group.rank"
87
+                  />
88
+                </div>
86
               </div>
89
               </div>
87
-            </div>
88
-          </form>
90
+            </form>
91
+          </div>
89
         </div>
92
         </div>
90
       </div>
93
       </div>
91
-    </div>
92
-    <div class="container">
94
+      <div class="container">
95
+        <button
96
+          type="button"
97
+          @click="newItem()"
98
+          class="btn btn-b-n"
99
+          style="width: 85px; height:40px;"
100
+        >New</button>
101
+        <br />
102
+        <table class="table table-bordered">
103
+          <thead>
104
+            <tr>
105
+              <th>Field Name</th>
106
+              <th>Field Type</th>
107
+              <th>Order</th>
108
+              <th></th>
109
+              <th></th>
110
+            </tr>
111
+          </thead>
112
+          <tbody>
113
+            <tr v-for="(item, i) in userFields" :key="i">
114
+              <td>{{item.fieldName}}</td>
115
+              <td v-if="item.fieldType === 'text'">Text</td>
116
+              <td v-else-if="item.fieldType === 'number'">Number</td>
117
+              <td v-else>Yes / No</td>
118
+              <td>{{item.rank}}</td>
119
+              <td>
120
+                <button
121
+                  type="button"
122
+                  @click="Edit(item)"
123
+                  class="btn btn-b-n"
124
+                  style="width: 85px; height:40px;"
125
+                >Edit</button>
126
+              </td>
127
+              <td>
128
+                <button
129
+                  type="button"
130
+                  @click="Delete(item)"
131
+                  class="btn btn-b-n"
132
+                  style="width: 85px; height:40px;"
133
+                >Delete</button>
134
+              </td>
135
+            </tr>
136
+          </tbody>
137
+        </table>
138
+      </div>
139
+      <button
140
+        type="button"
141
+        @click="SubmitData()"
142
+        class="btn btn-b-n"
143
+        style="width: 85px; height:40px;"
144
+      >Save</button>
93
       <button
145
       <button
94
         type="button"
146
         type="button"
95
-        @click="newItem()"
147
+        @click="Close()"
96
         class="btn btn-b-n"
148
         class="btn btn-b-n"
97
         style="width: 85px; height:40px;"
149
         style="width: 85px; height:40px;"
98
-      >New</button>
99
-      <br />
100
-      <table class="table table-bordered">
101
-        <thead>
102
-          <tr>
103
-            <th>Field Name</th>
104
-            <th>Field Type</th>
105
-            <th>Order</th>
106
-            <th></th>
107
-          </tr>
108
-        </thead>
109
-        <tbody>
110
-          <tr v-for="(item, i) in userFields" :key="i">
111
-            <td>{{item.fieldName}}</td>
112
-            <td>{{item.fieldType}}</td>
113
-            <td>{{item.rank}}</td>
114
-            <td>
115
-              <router-link :to="{ name: 'UserDefinedField', query: { field: item }}">Edit</router-link>
116
-              <!-- <router-link :to="`/userField`">Edit</router-link>| Delete -->
117
-            </td>
118
-          </tr>
119
-        </tbody>
120
-      </table>
150
+      >Close</button>
151
+    </div>
152
+    <div v-else>
153
+      <userFields @UpdateUserField="UpdateUserField" :field="item" />
121
     </div>
154
     </div>
122
-    <button
123
-      type="button"
124
-      @click="SubmitData()"
125
-      class="btn btn-b-n"
126
-      style="width: 85px; height:40px;"
127
-    >Save</button>
128
   </div>
155
   </div>
129
 </template>
156
 </template>
130
 
157
 
131
 <script>
158
 <script>
132
 import { mapState, mapActions } from 'vuex';
159
 import { mapState, mapActions } from 'vuex';
160
+import userFields from './userDefinedField.vue';
133
 
161
 
134
 export default {
162
 export default {
135
   name: 'UserDefinedGroup',
163
   name: 'UserDefinedGroup',
164
+  components: {
165
+    userFields,
166
+  },
136
   data() {
167
   data() {
137
     return {
168
     return {
138
-      group: {
139
-        description: '',
140
-        usageType: 0,
141
-        rank: 0,
142
-      },
169
+      item: {},
170
+      showField: false,
143
     };
171
     };
144
   },
172
   },
145
   mounted() {
173
   mounted() {
174
+    this.clearUserFields();
175
+    this.clearUserGroup();
176
+
146
     if (this.$route.params.id > 0) {
177
     if (this.$route.params.id > 0) {
147
-      this.getUserDefinedGroup(
148
-        Object.assign({}, { id: this.$route.params.id }),
149
-      );
150
-      this.getUserFields(Object.assign({}, { groupId: this.$route.params.id }));
178
+      this.getUserDefinedGroup(this.$route.params.id);
179
+      this.getUserFields(this.$route.params.id);
151
     }
180
     }
152
   },
181
   },
153
   computed: {
182
   computed: {
154
-    ...mapState('propertyAdmin', ['userDefinedGroup', 'userFields']),
183
+    ...mapState('propertyAdmin', [
184
+      'userDefinedGroup',
185
+      'userFields',
186
+      'userField',
187
+    ]),
155
   },
188
   },
156
   methods: {
189
   methods: {
157
     ...mapActions('propertyAdmin', [
190
     ...mapActions('propertyAdmin', [
159
       'getUserFields',
192
       'getUserFields',
160
       'saveUserDefinedGroup',
193
       'saveUserDefinedGroup',
161
       'updateUserDefinedGroup',
194
       'updateUserDefinedGroup',
195
+      'clearUserGroup',
196
+      'clearUserFields',
197
+      'clearUserField',
198
+      'saveUserField',
199
+      'updateUserField',
200
+      'deleteUserField',
162
     ]),
201
     ]),
163
     SubmitData() {
202
     SubmitData() {
203
+      this.userDefinedGroup.fields = [];
204
+      let reload = false;
164
       if (this.$route.params.id > 0) {
205
       if (this.$route.params.id > 0) {
165
-        this.updateUserDefinedGroup(
166
-          Object.assign({}, { group: this.userDefinedGroup }),
167
-        );
206
+        this.updateUserDefinedGroup(this.userDefinedGroup);
207
+        this.userFields.forEach((fieldData) => {
208
+          if (fieldData.id === 0) {
209
+            fieldData.groupId = this.userDefinedGroup.id;
210
+            this.saveUserField(fieldData);
211
+          } else {
212
+            this.updateUserField(fieldData);
213
+          }
214
+        });
168
       } else {
215
       } else {
169
-        this.saveUserDefinedGroup(Object.assign({}, { group: this.group }));
216
+        reload = true;
217
+        this.userFields.forEach((fieldData) => {
218
+          this.userDefinedGroup.fields.push({
219
+            fieldName: fieldData.fieldName,
220
+            fieldType: fieldData.fieldType,
221
+            rank: fieldData.rank,
222
+          });
223
+        });
224
+        this.saveUserDefinedGroup(this.userDefinedGroup);
170
       }
225
       }
171
       this.$router.push('/userDefinedGroups/list');
226
       this.$router.push('/userDefinedGroups/list');
227
+      // this.$router.push({
228
+      //   path: '/userDefinedGroups/list',
229
+      //   query: { reload },
230
+      // });
172
     },
231
     },
173
     newItem() {
232
     newItem() {
174
-      const newField = {
175
-        fieldName: '',
176
-        fieldType: 'Text',
177
-        rank: 0,
178
-      };
179
-      this.$router.push({
180
-        path: '/userField',
181
-        query: { field: newField },
182
-      });
233
+      this.clearUserField();
234
+      this.item = this.userField;
235
+      this.item.groupId = this.userDefinedGroup.id;
236
+      this.showField = true;
237
+    },
238
+    Edit(item) {
239
+      this.item = item;
240
+      this.showField = true;
241
+    },
242
+    Close() {
243
+      this.$router.push('/userDefinedGroups/list');
244
+    },
245
+    UpdateUserField(item) {
246
+      if (item.id === 0) {
247
+        this.userFields.push(item);
248
+      }
249
+      this.showField = false;
250
+    },
251
+    Delete(item) {
252
+      if (item.id === 0) {
253
+        this.userFields.pop(this.userFields.find(p => p.id === item.id));
254
+      } else {
255
+        this.deleteUserField(item.id);
256
+      }
183
     },
257
     },
184
   },
258
   },
185
 };
259
 };

+ 31
- 7
src/components/admin/property/userDefinedGroupsPage.vue Ver arquivo

1
 <template>
1
 <template>
2
+  <!-- eslint-disable max-len -->
2
   <div>
3
   <div>
3
     <section class="intro-single">
4
     <section class="intro-single">
4
       <div class="container">
5
       <div class="container">
12
       </div>
13
       </div>
13
     </section>
14
     </section>
14
     <div class="container">
15
     <div class="container">
15
-      <router-link :to="`/userDefinedGroups/userDefinedGroup`">New</router-link>
16
+      <button type="button" @click="New()" class="btn btn-b-n" style="width: 85px; height:40px;">New</button>
16
       <table class="table table-bordered">
17
       <table class="table table-bordered">
17
         <thead>
18
         <thead>
18
           <tr>
19
           <tr>
31
             <td v-else>Both</td>
32
             <td v-else>Both</td>
32
             <td>{{item.rank}}</td>
33
             <td>{{item.rank}}</td>
33
             <td>
34
             <td>
34
-              <router-link :to="`/userDefinedGroups/userDefinedGroup/${item.id}`">Edit</router-link>
35
+              <button
36
+                type="button"
37
+                @click="Edit(item.id)"
38
+                class="btn btn-b-n"
39
+                style="width: 85px; height:40px;"
40
+              >Edit</button>
35
             </td>
41
             </td>
36
             <td>
42
             <td>
37
-              <button>Delete</button>
43
+              <button
44
+                type="button"
45
+                @click="Delete(item)"
46
+                class="btn btn-b-n"
47
+                style="width: 85px; height:40px;"
48
+              >Delete</button>
38
             </td>
49
             </td>
39
           </tr>
50
           </tr>
40
         </tbody>
51
         </tbody>
47
 
58
 
48
 export default {
59
 export default {
49
   name: 'UserDefinedGroup',
60
   name: 'UserDefinedGroup',
50
-  created() {
61
+  mounted() {
51
     this.getUserDefinedGroups();
62
     this.getUserDefinedGroups();
52
   },
63
   },
53
   computed: {
64
   computed: {
54
     ...mapState('propertyAdmin', ['userDefinedGroups']),
65
     ...mapState('propertyAdmin', ['userDefinedGroups']),
55
   },
66
   },
56
   methods: {
67
   methods: {
57
-    ...mapActions('propertyAdmin', ['getUserDefinedGroups']),
68
+    ...mapActions('propertyAdmin', [
69
+      'getUserDefinedGroups',
70
+      'deleteUserDefinedGroup',
71
+    ]),
72
+    New() {
73
+      this.$router.push('/userDefinedGroups/userDefinedGroup');
74
+    },
75
+    Edit(id) {
76
+      this.$router.push(`/userDefinedGroups/userDefinedGroup/${id}`);
77
+    },
78
+    Delete(item) {
79
+      if (item.id === 0) {
80
+        this.userDefinedGroups.pop(item);
81
+      }
82
+      this.deleteUserDefinedGroup(item.id);
83
+    },
58
   },
84
   },
59
 };
85
 };
60
 </script>
86
 </script>
61
-<style>
62
-</style>

+ 1
- 0
src/components/home/propertySection.vue Ver arquivo

15
           v-if="latestProperties.length > 0"
15
           v-if="latestProperties.length > 0"
16
           name="propertyholder"
16
           name="propertyholder"
17
           :properties="latestProperties"
17
           :properties="latestProperties"
18
+          :showSort="false"
18
         />
19
         />
19
       </div>
20
       </div>
20
     </section>
21
     </section>

+ 116
- 63
src/components/property/propertyCard.vue Ver arquivo

1
 <template>
1
 <template>
2
-  <div class="form-group row">
3
-    <div class="col-md-4" v-for="currentProperty in properties" :key="currentProperty.id">
4
-      <div class="card-box-a card-shadow">
5
-        <div class="img-box-a">
6
-          <img
7
-            :src="currentProperty.displayImage"
8
-            alt
9
-            class="img-a img-fluid"
10
-            style="height:466px; width:350px; object-fit: cover;"
11
-          />
12
-        </div>
13
-        <div class="card-overlay">
14
-          <div class="card-overlay-a-content">
15
-            <div class="card-header-a">
16
-              <h4 class="card-title-a">
17
-                <router-link
18
-                  :to="`/property/property/${currentProperty.id}`"
19
-                  class="link-a"
20
-                >{{ currentProperty.shortDescription }}</router-link>
21
-              </h4>
22
-              <h4 class="card-title-c">
2
+  <div>
3
+    <div class="form-group row" v-if="showSort">
4
+      <button
5
+        type="button"
6
+        class="btn btn-link font-weight-bold color-b"
7
+        style="width: 150px; height:40px;"
8
+        @click="sortNewest()"
9
+      >Newest</button>
10
+      <button
11
+        type="button"
12
+        class="btn btn-link font-weight-bold color-b"
13
+        style="width: 150px; height:40px;"
14
+        @click="sortLowPrice()"
15
+      >Lowest Price</button>
16
+      <button
17
+        type="button"
18
+        class="btn btn-link font-weight-bold color-b"
19
+        style="width: 150px; height:40px;"
20
+        @click="sortHighPrice()"
21
+      >Highest Price</button>
22
+      <hr />
23
+    </div>
24
+    <div class="form-group row">
25
+      <div class="col-md-4" v-for="currentProperty in properties" :key="currentProperty.id">
26
+        <div class="card-box-a card-shadow">
27
+          <div class="img-box-a">
28
+            <img
29
+              :src="currentProperty.displayImage"
30
+              alt
31
+              class="img-a img-fluid"
32
+              style="height:466px; width:350px; object-fit: cover;"
33
+            />
34
+          </div>
35
+          <div class="card-overlay">
36
+            <div class="card-overlay-a-content">
37
+              <div class="card-header-a">
38
+                <h4 class="card-title-a">
39
+                  <router-link
40
+                    :to="`/property/property/${currentProperty.id}`"
41
+                    class="link-a"
42
+                  >{{ currentProperty.shortDescription }}</router-link>
43
+                </h4>
44
+                <h4 class="card-title-c">
45
+                  <router-link :to="`/property/property/${currentProperty.id}`" class="link-a">
46
+                    {{ currentProperty.province }}
47
+                    <br />
48
+                    {{ currentProperty.city }}
49
+                    <br />
50
+                    {{ currentProperty.suburb }}
51
+                  </router-link>
52
+                </h4>
53
+              </div>
54
+              <div class="card-body-a">
55
+                <div class="price-box d-flex">
56
+                  <span
57
+                    v-if="currentProperty.isSale"
58
+                    class="price-a"
59
+                  >sale | {{ currentProperty.displayPrice }}</span>
60
+                  <span
61
+                    v-if="!currentProperty.isSale"
62
+                    class="price-a"
63
+                  >rent | {{ currentProperty.displayPrice }}</span>
64
+                </div>
23
                 <router-link :to="`/property/property/${currentProperty.id}`" class="link-a">
65
                 <router-link :to="`/property/property/${currentProperty.id}`" class="link-a">
24
-                  {{ currentProperty.province }}
25
-                  <br />
26
-                  {{ currentProperty.city }}
27
-                  <br />
28
-                  {{ currentProperty.suburb }}
66
+                  Click here to view
67
+                  <span class="ion-ios-arrow-forward"></span>
29
                 </router-link>
68
                 </router-link>
30
-              </h4>
31
-            </div>
32
-            <div class="card-body-a">
33
-              <div class="price-box d-flex">
34
-                <span
35
-                  v-if="currentProperty.isSale"
36
-                  class="price-a"
37
-                >sale | {{ currentProperty.displayPrice }}</span>
38
-                <span
39
-                  v-if="!currentProperty.isSale"
40
-                  class="price-a"
41
-                >rent | {{ currentProperty.displayPrice }}</span>
42
               </div>
69
               </div>
43
-              <router-link :to="`/property/property/${currentProperty.id}`" class="link-a">
44
-                Click here to view
45
-                <span class="ion-ios-arrow-forward"></span>
46
-              </router-link>
47
-            </div>
48
-            <div class="card-footer-a" v-if="currentProperty.showFooter">
49
-              <ul class="card-info d-flex justify-content-around">
50
-                <li v-if="currentProperty.area !== null">
51
-                  <h4 class="card-info-title">Area</h4>
52
-                  <span v-html="currentProperty.area"></span>
53
-                </li>
54
-                <li v-if="currentProperty.beds !== null">
55
-                  <h4 class="card-info-title">Beds</h4>
56
-                  <span>{{ currentProperty.beds }}</span>
57
-                </li>
58
-                <li v-if="currentProperty.baths !== null">
59
-                  <h4 class="card-info-title">Baths</h4>
60
-                  <span>{{ currentProperty.baths }}</span>
61
-                </li>
62
-                <li v-if="currentProperty.garages !== null">
63
-                  <h4 class="card-info-title">Garages</h4>
64
-                  <span>{{ currentProperty.garages }}</span>
65
-                </li>
66
-              </ul>
70
+              <div class="card-footer-a" v-if="currentProperty.showFooter">
71
+                <ul class="card-info d-flex justify-content-around">
72
+                  <li v-if="currentProperty.area !== null">
73
+                    <h4 class="card-info-title">Area</h4>
74
+                    <span v-html="currentProperty.area"></span>
75
+                  </li>
76
+                  <li v-if="currentProperty.beds !== null">
77
+                    <h4 class="card-info-title">Beds</h4>
78
+                    <span>{{ currentProperty.beds }}</span>
79
+                  </li>
80
+                  <li v-if="currentProperty.baths !== null">
81
+                    <h4 class="card-info-title">Baths</h4>
82
+                    <span>{{ currentProperty.baths }}</span>
83
+                  </li>
84
+                  <li v-if="currentProperty.garages !== null">
85
+                    <h4 class="card-info-title">Garages</h4>
86
+                    <span>{{ currentProperty.garages }}</span>
87
+                  </li>
88
+                </ul>
89
+              </div>
67
             </div>
90
             </div>
68
           </div>
91
           </div>
69
         </div>
92
         </div>
93
+        <br />
70
       </div>
94
       </div>
71
-      <br />
72
     </div>
95
     </div>
73
   </div>
96
   </div>
74
 </template>
97
 </template>
77
 export default {
100
 export default {
78
   props: {
101
   props: {
79
     properties: { type: Array, default: () => [] },
102
     properties: { type: Array, default: () => [] },
103
+    showSort: { type: Boolean, default: true },
104
+  },
105
+  methods: {
106
+    sortHighPrice() {
107
+      function compare(a, b) {
108
+        if (a.price < b.price) return 1;
109
+        if (a.price > b.price) return -1;
110
+        return 0;
111
+      }
112
+
113
+      return this.properties.sort(compare);
114
+    },
115
+    sortLowPrice() {
116
+      function compare(a, b) {
117
+        if (a.price < b.price) return -1;
118
+        if (a.price > b.price) return 1;
119
+        return 0;
120
+      }
121
+
122
+      return this.properties.sort(compare);
123
+    },
124
+    sortNewest() {
125
+      function compare(a, b) {
126
+        if (a.dateCreated < b.dateCreated) return 1;
127
+        if (a.dateCreated > b.dateCreated) return -1;
128
+        return 0;
129
+      }
130
+
131
+      return this.properties.sort(compare);
132
+    },
80
   },
133
   },
81
 };
134
 };
82
 </script>
135
 </script>

+ 22
- 7
src/components/property/propertyImage.vue Ver arquivo

16
     <br />
16
     <br />
17
     <div class="form-group row">
17
     <div class="form-group row">
18
       <div v-for="(img, i) in image" class="col-md-2" :key="i">
18
       <div v-for="(img, i) in image" class="col-md-2" :key="i">
19
+        <input type="checkbox" id="checkbox" v-model="imagesDefault[i]" @change="updateList(i)" />
20
+        <label for="checkbox" style="margin: 10px;">Main Image</label>
19
         <img :src="img" style="height:200px; width:150px; object-fit: cover;" />
21
         <img :src="img" style="height:200px; width:150px; object-fit: cover;" />
20
         <br />
22
         <br />
21
         <a class="fa fa-times del" @click="removeImage(key)" />
23
         <a class="fa fa-times del" @click="removeImage(key)" />
29
 export default {
31
 export default {
30
   props: {
32
   props: {
31
     loadedImages: Function,
33
     loadedImages: Function,
32
-    savedImages: { type: Array, default: () => [] },
33
   },
34
   },
34
   data() {
35
   data() {
35
     return {
36
     return {
36
       images: {},
37
       images: {},
37
       image: [],
38
       image: [],
39
+      imagesDefault: [],
38
     };
40
     };
39
   },
41
   },
40
-  mounted() {
41
-    if (this.savedImages.length > 0) {
42
-      this.image = this.savedImages;
43
-    }
44
-  },
42
+  // Commented out for now.
43
+  // created() {
44
+  //   if (this.savedImages && this.savedImages.length > 0) {
45
+  //     this.savedImages.forEach((element) => {
46
+  //       this.images.push(element);
47
+  //     });
48
+  //   }
49
+  // },
45
   methods: {
50
   methods: {
46
     imagesAdd(e) {
51
     imagesAdd(e) {
47
       const files = e.target.files || e.dataTransfer.files;
52
       const files = e.target.files || e.dataTransfer.files;
61
 
66
 
62
         reader.onload = (e) => {
67
         reader.onload = (e) => {
63
           vm.image.push(e.target.result);
68
           vm.image.push(e.target.result);
64
-          console.log(vm.image);
65
         };
69
         };
66
         reader.readAsDataURL(file[i]);
70
         reader.readAsDataURL(file[i]);
67
       }
71
       }
75
         this.$refs.im.value = '';
79
         this.$refs.im.value = '';
76
       }
80
       }
77
     },
81
     },
82
+
83
+    updateList(index) {
84
+      if (this.imagesDefault) {
85
+        for (let i = 0; i < this.imagesDefault.length; i++) {
86
+          if (i !== index) {
87
+            this.imagesDefault[i] = false;
88
+          }
89
+        }
90
+        this.$emit('DefaultImage', index);
91
+      }
92
+    },
78
   },
93
   },
79
 };
94
 };
80
 </script>
95
 </script>

+ 29
- 12
src/components/property/propertyList.vue Ver arquivo

26
             <th>Type</th>
26
             <th>Type</th>
27
             <th>Publish</th>
27
             <th>Publish</th>
28
             <th>Status</th>
28
             <th>Status</th>
29
-            <th>Edit</th>
30
-            <th>Delete</th>
29
+            <th></th>
30
+            <th></th>
31
           </tr>
31
           </tr>
32
         </thead>
32
         </thead>
33
         <tbody>
33
         <tbody>
34
           <tr v-for="(item, i) in properties" :key="i">
34
           <tr v-for="(item, i) in properties" :key="i">
35
-            <td v-if="item.propertyType.usageType === 1">{{item.propertyName}}</td>
36
-            <td v-else>{{ item.shortDescription }}</td>
37
-            <td>{{item.id}}</td>
38
-            <td></td>
35
+            <td>{{ item.name }}</td>
36
+            <td>{{ item.id }}</td>
37
+            <td v-html="item.size" />
39
             <td>{{ item.price }}</td>
38
             <td>{{ item.price }}</td>
40
-            <td>{{ item.propertyType.description }}</td>
39
+            <td>{{ item.type }}</td>
41
             <td>{{ item.publish }}</td>
40
             <td>{{ item.publish }}</td>
42
-            <td>Publish</td>
41
+            <td>{{ item.status }}</td>
43
             <td>
42
             <td>
44
-              <router-link :to="`/property/${item.id}`">Edit</router-link>
43
+              <button
44
+                type="button"
45
+                @click="Edit(item)"
46
+                class="btn btn-b-n"
47
+                style="width: 85px; height:40px;"
48
+              >Edit</button>
49
+            </td>
50
+            <td>
51
+              <button type="button" class="btn btn-b-n" style="width: 85px; height:40px;">Delete</button>
45
             </td>
52
             </td>
46
-            <td>Delete</td>
47
           </tr>
53
           </tr>
48
         </tbody>
54
         </tbody>
49
       </table>
55
       </table>
64
   },
70
   },
65
   methods: {
71
   methods: {
66
     ...mapActions('propertyList', ['getProperties']),
72
     ...mapActions('propertyList', ['getProperties']),
73
+    Edit(item) {
74
+      const salesType = item.isSale ? 'Sale' : 'Rental';
75
+      this.$router.push({
76
+        path: `/property/${this.propertyType}/${salesType}`,
77
+        query: { id: item.id },
78
+      });
79
+    },
67
   },
80
   },
68
   mounted() {
81
   mounted() {
69
     this.propertyType = this.$route.params.propertyType;
82
     this.propertyType = this.$route.params.propertyType;
70
     this.user = this.$route.params.user;
83
     this.user = this.$route.params.user;
71
 
84
 
85
+    if (this.user === 'MyListings') {
86
+      this.user = 'GeorgeW';
87
+    }
88
+
72
     this.getProperties(
89
     this.getProperties(
73
       Object.assign(
90
       Object.assign(
74
         {},
91
         {},
75
         {
92
         {
76
-          propertyType: this.$route.params.propertyType,
77
-          user: this.$route.params.user,
93
+          propertyType: this.propertyType,
94
+          user: this.user,
78
         },
95
         },
79
       ),
96
       ),
80
     );
97
     );

+ 10
- 2
src/components/property/propertyPage.vue Ver arquivo

36
                     </div>
36
                     </div>
37
                   </div>
37
                   </div>
38
                 </div>
38
                 </div>
39
-                <div class="property-description" v-html="property ? property.description : ''" />
39
+                <div class="property-description" v-html="property.description" />
40
                 <div v-for="display in property.displayData" :key="display.id">
40
                 <div v-for="display in property.displayData" :key="display.id">
41
                   <div class="row section-t3">
41
                   <div class="row section-t3">
42
                     <div class="col-sm-12">
42
                     <div class="col-sm-12">
63
                     </div>
63
                     </div>
64
                     <div class="card-title-c align-self-center">
64
                     <div class="card-title-c align-self-center">
65
                       <h5 class="title-c">{{ formatPrice(property.price) }}</h5>
65
                       <h5 class="title-c">{{ formatPrice(property.price) }}</h5>
66
+                      <h6 v-if="property.pricePer">Per {{property.pricePer}}</h6>
66
                     </div>
67
                     </div>
67
                   </div>
68
                   </div>
68
                 </div>
69
                 </div>
245
     ...mapState('property', ['property', 'propertyImages']),
246
     ...mapState('property', ['property', 'propertyImages']),
246
   },
247
   },
247
   methods: {
248
   methods: {
248
-    ...mapActions('property', ['getProperty', 'getPropertyImages']),
249
+    ...mapActions('property', [
250
+      'getProperty',
251
+      'getPropertyImages',
252
+      'clearPropertyImages',
253
+    ]),
249
     formatPrice(value) {
254
     formatPrice(value) {
250
       const val = (value / 1).toFixed(2);
255
       const val = (value / 1).toFixed(2);
251
       return val.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ' ');
256
       return val.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ' ');
257
       return '';
262
       return '';
258
     },
263
     },
259
   },
264
   },
265
+  beforeDestroy() {
266
+    this.clearPropertyImages();
267
+  },
260
 };
268
 };
261
 </script>
269
 </script>
262
 
270
 

+ 6
- 6
src/components/property/propertySearchPage.vue Ver arquivo

1
 <template>
1
 <template>
2
   <!-- eslint-disable max-len -->
2
   <!-- eslint-disable max-len -->
3
   <div class="container">
3
   <div class="container">
4
-    <div class="container col-md-10" v-if="propertyType === 'Residential'">
4
+    <div class="container col-md-12" v-if="propertyType === 'Residential'">
5
       <div class="col-sm-12">
5
       <div class="col-sm-12">
6
         <div class="about-img-box">
6
         <div class="about-img-box">
7
           <img
7
           <img
23
         <div class="col-md-12">
23
         <div class="col-md-12">
24
           <h1 class="my-4">About Residential Properties</h1>
24
           <h1 class="my-4">About Residential Properties</h1>
25
         </div>
25
         </div>
26
-        <div class="col-md-8 text-left">
26
+        <div class="container col-md-6 text-left">
27
           <p>
27
           <p>
28
             Uni-Vate Properties understands the necessity in property-seekers
28
             Uni-Vate Properties understands the necessity in property-seekers
29
             to find that perfect fit;
29
             to find that perfect fit;
48
             <router-link to="/property/Residential/Sale">Click Here</router-link>
48
             <router-link to="/property/Residential/Sale">Click Here</router-link>
49
           </p>
49
           </p>
50
         </div>
50
         </div>
51
-        <div class="col-md-4 text-center">
51
+        <div class="col-md-4">
52
           <p>
52
           <p>
53
             <img class="img-fluid" src="./../../../public/img/residential.jpg" alt="About Resale" />
53
             <img class="img-fluid" src="./../../../public/img/residential.jpg" alt="About Resale" />
54
           </p>
54
           </p>
71
       <br />
71
       <br />
72
     </div>
72
     </div>
73
 
73
 
74
-    <div class="container col-md-10" v-if="propertyType === 'Commercial'">
74
+    <div class="container col-md-12" v-if="propertyType === 'Commercial'">
75
       <div class="col-sm-12">
75
       <div class="col-sm-12">
76
         <div class="about-img-box">
76
         <div class="about-img-box">
77
           <img
77
           <img
93
         <div class="col-md-12">
93
         <div class="col-md-12">
94
           <h1 class="my-4">About Commercial Properties</h1>
94
           <h1 class="my-4">About Commercial Properties</h1>
95
         </div>
95
         </div>
96
-        <div class="col-md-8 text-left">
96
+        <div class="container col-md-6 text-left">
97
           <p>
97
           <p>
98
             Commercial properties are characteristically any larger properties that
98
             Commercial properties are characteristically any larger properties that
99
             generate profit through leasing or rental activities. These properties
99
             generate profit through leasing or rental activities. These properties
116
             <router-link to="/property/Commercial/Sale">Click Here</router-link>
116
             <router-link to="/property/Commercial/Sale">Click Here</router-link>
117
           </p>
117
           </p>
118
         </div>
118
         </div>
119
-        <div class="col-md-4 text-center">
119
+        <div class="col-md-4">
120
           <p>
120
           <p>
121
             <img class="img-fluid" src="./../../../public/img/commercial.jpg" alt="About Resale" />
121
             <img class="img-fluid" src="./../../../public/img/commercial.jpg" alt="About Resale" />
122
           </p>
122
           </p>

+ 0
- 1
src/components/property/propertyUserField.vue Ver arquivo

40
   name: 'UserDefinedField',
40
   name: 'UserDefinedField',
41
   props: {
41
   props: {
42
     fields: { type: Array, default: () => [] },
42
     fields: { type: Array, default: () => [] },
43
-    SetFieldValue: Function,
44
   },
43
   },
45
   data() {
44
   data() {
46
     return {
45
     return {

+ 111
- 49
src/components/property/propertyeditPage.vue Ver arquivo

38
                   id="propertyType"
38
                   id="propertyType"
39
                   v-model="property.propertyTypeId"
39
                   v-model="property.propertyTypeId"
40
                 >
40
                 >
41
-                  <option value="0">Please Select</option>
41
+                  <option value="0">Please select type</option>
42
                   <option
42
                   <option
43
                     v-for="item in propertyTypes"
43
                     v-for="item in propertyTypes"
44
                     :value="item.id"
44
                     :value="item.id"
74
                   class="form-control"
74
                   class="form-control"
75
                   type="text"
75
                   type="text"
76
                   name="address1"
76
                   name="address1"
77
+                  placeholder="Apartment, suite, unit, building, floor, Po Box etc."
78
+                  style="font-size: 50%"
77
                   id="address1"
79
                   id="address1"
78
                   v-model="property.addressLine1"
80
                   v-model="property.addressLine1"
79
                 />
81
                 />
84
                   class="form-control"
86
                   class="form-control"
85
                   type="text"
87
                   type="text"
86
                   name="address2"
88
                   name="address2"
89
+                  placeholder="Complex, estate, company name, etc."
90
+                  style="font-size: 50%"
87
                   id="address2"
91
                   id="address2"
88
                   v-model="property.addressLine2"
92
                   v-model="property.addressLine2"
89
                 />
93
                 />
90
               </div>
94
               </div>
91
               <div class="col-md-4">
95
               <div class="col-md-4">
92
-                <label>Address Line 3</label>
96
+                <label>Street</label>
93
                 <input
97
                 <input
94
                   class="form-control"
98
                   class="form-control"
95
                   type="text"
99
                   type="text"
96
                   name="address3"
100
                   name="address3"
101
+                  placeholder="Street or c/o name"
102
+                  style="font-size: 50%"
97
                   id="address3"
103
                   id="address3"
98
                   v-model="property.addressLine3"
104
                   v-model="property.addressLine3"
99
                 />
105
                 />
109
                   @change="ProvinceSelected"
115
                   @change="ProvinceSelected"
110
                   v-model="property.provinceId"
116
                   v-model="property.provinceId"
111
                 >
117
                 >
112
-                  <option value="0">Please select</option>
118
+                  <option value="0">Please select province</option>
113
                   <option
119
                   <option
114
                     v-for="province in provinces"
120
                     v-for="province in provinces"
115
                     :value="province.id"
121
                     :value="province.id"
126
                   @change="CitySelected"
132
                   @change="CitySelected"
127
                   v-model="property.cityId"
133
                   v-model="property.cityId"
128
                 >
134
                 >
129
-                  <option value="0">Please Select</option>
135
+                  <option value="0">Please select city</option>
130
                   <option
136
                   <option
131
                     v-for="city in cities"
137
                     v-for="city in cities"
132
                     :value="city.id"
138
                     :value="city.id"
142
                   id="suburbselector"
148
                   id="suburbselector"
143
                   v-model="property.suburbId"
149
                   v-model="property.suburbId"
144
                 >
150
                 >
145
-                  <option value="0">Please Select</option>
151
+                  <option value="0">Please select suburb</option>
146
                   <option
152
                   <option
147
                     v-for="suburb in suburbs"
153
                     v-for="suburb in suburbs"
148
                     :value="suburb.id"
154
                     :value="suburb.id"
155
               <div class="col-md-4">
161
               <div class="col-md-4">
156
                 <label v-if="salesType === 'Rental'">Rental Price</label>
162
                 <label v-if="salesType === 'Rental'">Rental Price</label>
157
                 <label v-if="salesType !== 'Rental'">Sales Price</label>
163
                 <label v-if="salesType !== 'Rental'">Sales Price</label>
158
-                <input
159
-                  class="form-control"
160
-                  type="number"
161
-                  name="price"
162
-                  id="price"
163
-                  placeholder="R"
164
-                  v-model="property.price"
165
-                />
164
+                <div class="input-group-prepend">
165
+                  <span class="input-group-text" style="color: #60CBEB">
166
+                    <b>R</b>
167
+                  </span>
168
+                  <input
169
+                    class="form-control"
170
+                    type="number"
171
+                    name="price"
172
+                    id="price"
173
+                    placeholder="R"
174
+                    v-model="property.price"
175
+                  />
176
+                </div>
166
               </div>
177
               </div>
167
               <div class="col-md-4" v-if="salesType === 'Rental'">
178
               <div class="col-md-4" v-if="salesType === 'Rental'">
168
                 <label>Per</label>
179
                 <label>Per</label>
170
                   class="form-control"
181
                   class="form-control"
171
                   name="propertyType"
182
                   name="propertyType"
172
                   id="propertyType"
183
                   id="propertyType"
173
-                  v-model="property.per"
184
+                  v-model="property.pricePer"
174
                 >
185
                 >
175
                   <option value>Please select</option>
186
                   <option value>Please select</option>
176
-                  <option value="month">Month</option>
177
-                  <option value="day">Day</option>
187
+                  <option value="Month">Month</option>
188
+                  <option value="Day">Day</option>
178
                 </select>
189
                 </select>
179
               </div>
190
               </div>
180
             </div>
191
             </div>
196
               v-if="propertyType === 'Residential' & propertyOverviewFields.length > 0"
207
               v-if="propertyType === 'Residential' & propertyOverviewFields.length > 0"
197
               :fields="propertyOverviewFields[0].fields"
208
               :fields="propertyOverviewFields[0].fields"
198
               @UpdateUserDefinedFields="UpdateUserDefinedFields"
209
               @UpdateUserDefinedFields="UpdateUserDefinedFields"
210
+              :id="1"
199
             ></UserField>
211
             ></UserField>
200
             <div class="form-group row" />
212
             <div class="form-group row" />
201
-            <div v-for="item in propertyFields" :key="item.id">
213
+            <div v-for="(item, i) in propertyFields" :key="item.id">
202
               <div class="row">
214
               <div class="row">
203
                 <div class="col-sm-12">
215
                 <div class="col-sm-12">
204
                   <div class="title-box-d">
216
                   <div class="title-box-d">
208
               </div>
220
               </div>
209
               <UserField
221
               <UserField
210
                 :fields="item.fields"
222
                 :fields="item.fields"
211
-                :id="item.id"
223
+                :id="item.name"
212
                 @UpdateUserDefinedFields="UpdateUserDefinedFields"
224
                 @UpdateUserDefinedFields="UpdateUserDefinedFields"
213
               />
225
               />
214
             </div>
226
             </div>
222
             </div>
234
             </div>
223
             <ImageLoad :loadedImages="loadedImages" :savedImages="propertyImages" />
235
             <ImageLoad :loadedImages="loadedImages" :savedImages="propertyImages" />
224
             <button
236
             <button
237
+              v-if="!wait"
225
               type="button"
238
               type="button"
226
               @click="SubmitData()"
239
               @click="SubmitData()"
227
               class="btn btn-b-n"
240
               class="btn btn-b-n"
228
               style="width: 85px; height:40px;"
241
               style="width: 85px; height:40px;"
229
-            >Save</button>
242
+            >
243
+              <!-- <span class="spinner-border" role="status" aria-hidden="true"></span>
244
+              <span class="sr-only">Loading...</span>-->
245
+              Save
246
+            </button>
247
+            <label v-if="wait">Please wait...</label>
230
           </form>
248
           </form>
231
         </div>
249
         </div>
232
       </div>
250
       </div>
255
       selectedCity: '',
273
       selectedCity: '',
256
       images: [],
274
       images: [],
257
       propertyFieldValues: [],
275
       propertyFieldValues: [],
276
+      defaultImage: 0,
277
+      wait: false,
258
     };
278
     };
259
   },
279
   },
260
   methods: {
280
   methods: {
266
       'saveProperty',
286
       'saveProperty',
267
       'getProperty',
287
       'getProperty',
268
       'getPropertyImages',
288
       'getPropertyImages',
289
+      'clearProperty',
290
+      'clearPropertyImages',
291
+      'getPropertyEditDisplay',
292
+      'getPropertySavedOverviewFields',
293
+      'getPropertySavedFields',
294
+      'getSavedPropertyData',
269
     ]),
295
     ]),
270
     SubmitData() {
296
     SubmitData() {
271
-      let isDefault = true;
272
-      this.images.forEach((imagedata) => {
297
+      this.wait = true;
298
+      for (let i = 0; i < this.images.length; i++) {
299
+        let setAsDefault = false;
300
+        if (i === this.defaultImage) {
301
+          setAsDefault = true;
302
+        }
273
         this.property.propertyImages.push({
303
         this.property.propertyImages.push({
274
-          image: imagedata,
275
-          isDefault,
304
+          image: this.images[i],
305
+          isDefault: setAsDefault,
276
         });
306
         });
277
-        isDefault = false;
278
-      });
279
-      this.property.propertyUserFields = this.propertyFieldValues;
307
+      }
308
+      this.property.createdBy = 'GeorgeW';
280
 
309
 
281
       this.saveProperty(this.property);
310
       this.saveProperty(this.property);
282
 
311
 
283
-      this.$router.push({
284
-        path: '/property/search',
285
-        query: { type: this.salesType, propertyType: this.propertyType },
286
-      });
312
+      setTimeout(
313
+        () => this.$router.push({
314
+            path: '/property/search',
315
+            query: { type: this.salesType, propertyType: this.propertyType },
316
+          }),
317
+        3000,
318
+      );
287
     },
319
     },
288
     ProvinceSelected(item) {
320
     ProvinceSelected(item) {
289
       if (item.target.options.selectedIndex > 0) {
321
       if (item.target.options.selectedIndex > 0) {
321
         this.propertyFieldValues.push(item);
353
         this.propertyFieldValues.push(item);
322
       }
354
       }
323
     },
355
     },
356
+    UpdateDefaultImage(item) {
357
+      this.defaultImage = item;
358
+    },
324
   },
359
   },
325
   mounted() {
360
   mounted() {
361
+    this.wait = false;
362
+    this.clearProperty();
363
+    this.clearPropertyImages();
364
+    this.images = [];
365
+    this.defaultImage = 0;
366
+
367
+    if (this.propertyOverviewFields.length > 0) {
368
+      this.propertyOverviewFields = [];
369
+    }
370
+    if (this.propertyFields.length > 0) {
371
+      this.propertyFields = [];
372
+    }
373
+
326
     this.propertyType = this.$route.params.propType;
374
     this.propertyType = this.$route.params.propType;
327
     this.salesType = this.$route.params.saleType;
375
     this.salesType = this.$route.params.saleType;
328
 
376
 
329
-    this.getProvince();
330
     this.getPropertyTypes(this.$route.params.propType);
377
     this.getPropertyTypes(this.$route.params.propType);
331
-    this.getPropertyOverviewFields();
332
-    this.getPropertyFields(this.$route.params.propType);
333
 
378
 
379
+    this.getProvince();
380
+    if (this.$route.query.id) {
381
+      // this.getCities(Object.assign({}, { province: this.selectedProvince }));
382
+      this.getSavedPropertyData(
383
+        Object.assign({}, { id: this.$route.query.id, type: this.propertyType }),
384
+      );
385
+    } else {
386
+      this.getPropertyOverviewFields();
387
+      this.getPropertyFields(this.$route.params.propType);
388
+    }
334
     // if (this.$route.params.id) {
389
     // if (this.$route.params.id) {
390
+    //   this.getPropertyEditDisplay(4); // (this.$route.params.id);
391
+    //   this.propertyType = 'Residential'; // this.propertyEditDisplay.propertyType;
392
+    //   this.salesType = 'Rental'; // this.propertyEditDisplay.saleType;
393
+
394
+    //   this.getProvince();
395
+    //   this.getPropertyTypes('Residential');
396
+    //   this.getPropertySavedOverviewFields(4);
397
+    //   this.getPropertySavedFields(
398
+    //     Object.assign(
399
+    //       {},
400
+    //       {
401
+    //         type: 'Residential',
402
+    //         id: 4,
403
+    //       },
404
+    //     ),
405
+    //   );
406
+
335
     //   this.getProperty(this.$route.params.id);
407
     //   this.getProperty(this.$route.params.id);
336
-    //   this.getPropertyImages(this.$route.params.id);
408
+    // } else {
409
+
337
     // }
410
     // }
338
-    /*
339
-    if (this.$route.params.id) {
340
-      this.getProperty(this.$route.params.id);
341
-      this.getPropertyImages(this.$route.params.id);
342
-      if (this.property.propertyType.usageType === 0) {
343
-        this.propertyType = 'Residential';
344
-      } else {
345
-        this.propertyType = 'Commercial';
346
-      }
347
-      this.salesType = this.property.isSale ? 'Sale' : 'Rental';
348
-    } */
349
   },
411
   },
350
   computed: {
412
   computed: {
351
     ...mapState('searchTab', ['provinces', 'cities', 'suburbs']),
413
     ...mapState('searchTab', ['provinces', 'cities', 'suburbs']),
361
       this.propertyType = this.$route.params.propType;
423
       this.propertyType = this.$route.params.propType;
362
       // eslint-disable-next-line vue/no-side-effects-in-computed-properties
424
       // eslint-disable-next-line vue/no-side-effects-in-computed-properties
363
       this.salesType = this.$route.params.saleType;
425
       this.salesType = this.$route.params.saleType;
364
-
365
-      this.getPropertyTypes(this.$route.params.propType);
366
-
367
-      this.getPropertyFields(this.$route.params.propType);
426
+      if (!this.$route.query.id) {
427
+        this.getPropertyTypes(this.$route.params.propType);
428
+        this.getPropertyFields(this.$route.params.propType);
429
+      }
368
 
430
 
369
       return this.propertyType;
431
       return this.propertyType;
370
     },
432
     },

+ 2
- 2
src/components/shared/navBar.vue Ver arquivo

96
               >To Sell</div>
96
               >To Sell</div>
97
               <div
97
               <div
98
                 class="dropdown-item cursor-pointer"
98
                 class="dropdown-item cursor-pointer"
99
-                @click="routerGoTo('/property/list/Residential/GeorgeW')"
99
+                @click="routerGoTo('/property/list/Residential/MyListings')"
100
               >My Residential Properties</div>
100
               >My Residential Properties</div>
101
               <div
101
               <div
102
                 class="dropdown-item cursor-pointer"
102
                 class="dropdown-item cursor-pointer"
129
               >To Sell</a>
129
               >To Sell</a>
130
               <a
130
               <a
131
                 class="dropdown-item cursor-pointer"
131
                 class="dropdown-item cursor-pointer"
132
-                @click="routerGoTo('/property/list/Commercial/GeorgeW')"
132
+                @click="routerGoTo('/property/list/Commercial/MyListings')"
133
               >My Commercial Properties</a>
133
               >My Commercial Properties</a>
134
               <a
134
               <a
135
                 class="dropdown-item cursor-pointer"
135
                 class="dropdown-item cursor-pointer"

+ 19
- 36
src/components/timeshare/sell/sellPage.vue Ver arquivo

129
           <div class="form-group row">
129
           <div class="form-group row">
130
             <div class="col-md-6">
130
             <div class="col-md-6">
131
               <label for="Module">Module</label>
131
               <label for="Module">Module</label>
132
-              <input
133
-                class="form-control"
134
-                placeholder="Module"
135
-                type="text"
136
-                name="module"
137
-                v-model="sellItem.module"
138
-              />
132
+              <input class="form-control" type="text" name="module" v-model="sellItem.module" />
139
             </div>
133
             </div>
140
             <div class="col-md-6">
134
             <div class="col-md-6">
141
               <label for="Week number">Week Number</label>
135
               <label for="Week number">Week Number</label>
142
-              <input
143
-                class="form-control"
144
-                placeholder="Week Number"
145
-                type="text"
146
-                name="week"
147
-                v-model="sellItem.weekNumber"
148
-              />
136
+              <input class="form-control" type="text" name="week" v-model="sellItem.weekNumber" />
149
             </div>
137
             </div>
150
           </div>
138
           </div>
151
           <div class="form-group row">
139
           <div class="form-group row">
165
           <div class="form-group row">
153
           <div class="form-group row">
166
             <div class="col-md-6">
154
             <div class="col-md-6">
167
               <label for="Unit number">Unit Number</label>
155
               <label for="Unit number">Unit Number</label>
168
-              <input
169
-                class="form-control"
170
-                placeholder="Unit Number"
171
-                type="text"
172
-                name="unit"
173
-                v-model="sellItem.unitNumber"
174
-              />
156
+              <input class="form-control" type="text" name="unit" v-model="sellItem.unitNumber" />
175
             </div>
157
             </div>
176
             <div class="col-md-6">
158
             <div class="col-md-6">
177
               <label for="Owner">Owner</label>
159
               <label for="Owner">Owner</label>
178
-              <input
179
-                class="form-control"
180
-                placeholder="Owner"
181
-                type="text"
182
-                name="owner"
183
-                v-model="sellItem.owner"
184
-              />
160
+              <input class="form-control" type="text" name="owner" v-model="sellItem.owner" />
185
             </div>
161
             </div>
186
           </div>
162
           </div>
187
           <div class="form-group row">
163
           <div class="form-group row">
189
               <label for="Levy">Levy Amount</label>
165
               <label for="Levy">Levy Amount</label>
190
               <input
166
               <input
191
                 class="form-control"
167
                 class="form-control"
192
-                placeholder="Levy"
193
                 type="number"
168
                 type="number"
194
                 step="any"
169
                 step="any"
195
                 name="levy"
170
                 name="levy"
238
               >
213
               >
239
                 <option v-for="(item, i) in bankedEntities" :key="i">{{item}}</option>
214
                 <option v-for="(item, i) in bankedEntities" :key="i">{{item}}</option>
240
               </select>
215
               </select>
216
+              <br />
217
+              <br />
218
+              <br />
219
+              <DetailIndividual />
241
             </div>
220
             </div>
242
           </div>
221
           </div>
243
-          <br />
244
           <hr />
222
           <hr />
245
           <br />
223
           <br />
246
           <h3>Share transfer information</h3>
224
           <h3>Share transfer information</h3>
344
             <div class="col-md-4">
322
             <div class="col-md-4">
345
               <div class="input-group mb-3">
323
               <div class="input-group mb-3">
346
                 <div class="input-group-prepend">
324
                 <div class="input-group-prepend">
347
-                  <span class="input-group-text">R</span>
325
+                  <span class="input-group-text" style="color: #60CBEB">
326
+                    <b>R</b>
327
+                  </span>
348
                 </div>
328
                 </div>
349
                 <input
329
                 <input
350
                   class="form-control"
330
                   class="form-control"
351
                   type="number"
331
                   type="number"
352
                   step="any"
332
                   step="any"
353
                   name="purchasePrice"
333
                   name="purchasePrice"
354
-                  placeholder="R"
355
                   v-model="sellItem.originalPurchasePrice"
334
                   v-model="sellItem.originalPurchasePrice"
356
                 />
335
                 />
357
               </div>
336
               </div>
395
             <div class="col-md-4">
374
             <div class="col-md-4">
396
               <div class="input-group mb-3">
375
               <div class="input-group mb-3">
397
                 <div class="input-group-prepend">
376
                 <div class="input-group-prepend">
398
-                  <span class="input-group-text">R</span>
377
+                  <span class="input-group-text" style="color: #60CBEB">
378
+                    <b>R</b>
379
+                  </span>
399
                 </div>
380
                 </div>
400
                 <input
381
                 <input
401
                   class="form-control"
382
                   class="form-control"
402
                   type="number"
383
                   type="number"
403
                   step="any"
384
                   step="any"
404
                   name="sellingPrice"
385
                   name="sellingPrice"
405
-                  placeholder="R"
406
                   v-model="sellItem.sellingPrice"
386
                   v-model="sellItem.sellingPrice"
407
                 />
387
                 />
408
               </div>
388
               </div>
420
             <div class="col-md-4">
400
             <div class="col-md-4">
421
               <div class="input-group mb-3">
401
               <div class="input-group mb-3">
422
                 <div class="input-group-prepend">
402
                 <div class="input-group-prepend">
423
-                  <span class="input-group-text">R</span>
403
+                  <span class="input-group-text" style="color: #60CBEB">
404
+                    <b>R</b>
405
+                  </span>
424
                 </div>
406
                 </div>
425
                 <input
407
                 <input
426
                   class="form-control"
408
                   class="form-control"
427
                   type="number"
409
                   type="number"
428
                   step="any"
410
                   step="any"
429
                   name="commission"
411
                   name="commission"
430
-                  placeholder="R"
431
                   v-model="sellItem.agentCommission"
412
                   v-model="sellItem.agentCommission"
432
                 />
413
                 />
433
               </div>
414
               </div>
465
 </template>
446
 </template>
466
 <script>
447
 <script>
467
 import { mapState, mapActions } from 'vuex';
448
 import { mapState, mapActions } from 'vuex';
449
+import DetailIndividual from '../../user/timeshareIndividual.vue';
468
 
450
 
469
 export default {
451
 export default {
470
   name: 'TimeshareToSell',
452
   name: 'TimeshareToSell',
453
+  components: { DetailIndividual },
471
   created() {
454
   created() {
472
     this.initTimeshare();
455
     this.initTimeshare();
473
   },
456
   },

+ 3
- 11
src/components/user/loginPage.vue Ver arquivo

102
   },
102
   },
103
   methods: {
103
   methods: {
104
     Login() {
104
     Login() {
105
-      console.log(this.username + this.password);
106
       axios
105
       axios
107
-        .post('http://localhost:57260/api/register/authenticate', {
106
+        .post('/api/register/authenticate', {
108
           username: this.username,
107
           username: this.username,
109
           password: this.password,
108
           password: this.password,
110
         })
109
         })
111
-        .then(response => console.log(response.data));
110
+        .then(response => console.log(response.data))
111
+        .catch(error => console.log(error.push));
112
       this.$router.push('/');
112
       this.$router.push('/');
113
     },
113
     },
114
     togglePassword() {
114
     togglePassword() {
119
       this.showPassword = false;
119
       this.showPassword = false;
120
       this.isPasswordShown = 'password';
120
       this.isPasswordShown = 'password';
121
     },
121
     },
122
-    authHeader() {
123
-      const user = JSON.parse(localStorage.getItem('user'));
124
-
125
-      if (user && user.token) {
126
-        return { Authoriztion: `Bearer ${user.token}` };
127
-      }
128
-      return {};
129
-    },
130
     SendMail() {},
122
     SendMail() {},
131
   },
123
   },
132
 };
124
 };

+ 2
- 0
src/components/user/registerAgencySection.vue Ver arquivo

5
       <div class="reg-page">
5
       <div class="reg-page">
6
         <div class="regform" style="text-align:left">
6
         <div class="regform" style="text-align:left">
7
           <h4>Agency Details</h4>
7
           <h4>Agency Details</h4>
8
+          <div class="row">
8
           <div class="row" style="text-align:left">
9
           <div class="row" style="text-align:left">
9
             <div class="col-md-8" style="margin-bottom: 1em">
10
             <div class="col-md-8" style="margin-bottom: 1em">
10
               <div class="input-group-prepend">
11
               <div class="input-group-prepend">
49
               </div>
50
               </div>
50
             </div>
51
             </div>
51
           </div>
52
           </div>
53
+          </div>
52
           <hr />
54
           <hr />
53
           <div class="col-md-10" style="text-align:left">
55
           <div class="col-md-10" style="text-align:left">
54
             <h5 style="margin-bottom: 1em">Agency Administrator</h5>
56
             <h5 style="margin-bottom: 1em">Agency Administrator</h5>

+ 88
- 102
src/components/user/registerPage.vue Ver arquivo

5
       <div class="regform">
5
       <div class="regform">
6
         <div class="col-md-10" style="text-align:left">
6
         <div class="col-md-10" style="text-align:left">
7
           <h4>Private Individual</h4>
7
           <h4>Private Individual</h4>
8
+          <div class="form-group row"></div>
8
           <div class="row" style="text-align:left">
9
           <div class="row" style="text-align:left">
9
             <div class="col-md-8" style="margin-bottom: 1em">
10
             <div class="col-md-8" style="margin-bottom: 1em">
10
               <div class="input-group-prepend">
11
               <div class="input-group-prepend">
11
                 <span class="input-group-text">
12
                 <span class="input-group-text">
12
-                  <eva-icon name="people" fill="#60CBEB"></eva-icon>
13
+                  <eva-icon name="person-outline" fill="#60CBEB"></eva-icon>
13
                 </span>
14
                 </span>
14
                 <input
15
                 <input
15
                   class="form-control"
16
                   class="form-control"
23
             <div class="col-md-8" style="margin-bottom: 1em">
24
             <div class="col-md-8" style="margin-bottom: 1em">
24
               <div class="input-group-prepend">
25
               <div class="input-group-prepend">
25
                 <span class="input-group-text">
26
                 <span class="input-group-text">
26
-                  <eva-icon name="book" fill="#60CBEB"></eva-icon>
27
+                  <eva-icon name="book-outline" fill="#60CBEB"></eva-icon>
27
                 </span>
28
                 </span>
28
                 <input
29
                 <input
29
                   class="form-control"
30
                   class="form-control"
34
                 />
35
                 />
35
               </div>
36
               </div>
36
             </div>
37
             </div>
37
-          </div>
38
-
39
-          <div class="row" style="text-align:left">
40
-            <div class="col-md-7" style="text-align:left">
41
-              <div class="input-group mb-3">
42
-                <div class="input-group-prepend">
43
-                  <span class="input-group-text">
44
-                    <eva-icon name="email" fill="#60CBEB"></eva-icon>
45
-                  </span>
46
-                  <input
47
-                    class="form-control"
48
-                    type="text"
49
-                    name="email"
50
-                    placeholder="Email Address"
51
-                    v-model="registerIndividual.email"
52
-                  />
53
-                  <div class="form-group row"></div>
54
-                </div>
38
+            <div class="col-md-8" style="margin-bottom: 1em">
39
+              <div class="input-group-prepend">
40
+                <span class="input-group-text">
41
+                  <eva-icon name="email-outline" fill="#60CBEB"></eva-icon>
42
+                </span>
43
+                <input
44
+                  class="form-control"
45
+                  type="text"
46
+                  name="email"
47
+                  placeholder="Email Address"
48
+                  v-model="registerIndividual.email"
49
+                />
55
               </div>
50
               </div>
56
             </div>
51
             </div>
57
-
58
-            <div class="col-md-8" style="text-align:left">
59
-              <div class="input-group mb-3">
60
-                <div class="input-group-prepend">
61
-                  <span class="input-group-text">
62
-                    <eva-icon name="smartphone" fill="#60CBEB"></eva-icon>
63
-                  </span>
64
-                  <input
65
-                    class="form-control"
66
-                    type="number"
67
-                    name="cellnumber"
68
-                    placeholder="Cellphone Number"
69
-                    v-model="registerIndividual.cellNumber"
70
-                  />
71
-                </div>
52
+            <div class="col-md-8" style="margin-bottom: 1em">
53
+              <div class="input-group-prepend">
54
+                <span class="input-group-text">
55
+                  <eva-icon name="smartphone-outline" fill="#60CBEB"></eva-icon>
56
+                </span>
57
+                <input
58
+                  class="form-control"
59
+                  type="text"
60
+                  name="cellnumber"
61
+                  placeholder="Cellphone Number"
62
+                  v-model="registerIndividual.cellNumber"
63
+                />
72
               </div>
64
               </div>
73
-              <div class="input-group mb-3">
74
-                <div class="input-group-prepend">
75
-                  <span class="input-group-text">
76
-                    <eva-icon name="phone-outline" fill="#60CBEB"></eva-icon>
77
-                  </span>
78
-                  <input
79
-                    class="form-control"
80
-                    type="number"
81
-                    name="landline"
82
-                    placeholder="Landline Number"
83
-                    v-model="registerIndividual.telephone"
84
-                  />
85
-                </div>
65
+            </div>
66
+            <div class="col-md-8" style="margin-bottom: 1em">
67
+              <div class="input-group-prepend">
68
+                <span class="input-group-text">
69
+                  <eva-icon name="phone-outline" fill="#60CBEB"></eva-icon>
70
+                </span>
71
+                <input
72
+                  class="form-control"
73
+                  type="text"
74
+                  name="landline"
75
+                  placeholder="Landline Number"
76
+                  v-model="registerIndividual.telephone"
77
+                />
86
               </div>
78
               </div>
87
             </div>
79
             </div>
88
           </div>
80
           </div>
89
           <hr />
81
           <hr />
90
           <div class="row">
82
           <div class="row">
91
             <div class="col-md-8" style="margin-bottom: 1em">
83
             <div class="col-md-8" style="margin-bottom: 1em">
92
-              <div class="input-group mb-3">
93
-                <div class="input-group-prepend">
94
-                  <span class="input-group-text">
95
-                    <eva-icon name="person" fill="#60CBEB"></eva-icon>
96
-                  </span>
97
-                  <input
98
-                    class="form-control"
99
-                    type="text"
100
-                    name="username"
101
-                    placeholder="Username"
102
-                    v-model="registerIndividual.username"
103
-                  />
104
-                </div>
84
+              <div class="input-group-prepend">
85
+                <span class="input-group-text">
86
+                  <eva-icon name="person" fill="#60CBEB"></eva-icon>
87
+                </span>
88
+                <input
89
+                  class="form-control"
90
+                  type="text"
91
+                  name="username"
92
+                  placeholder="Username"
93
+                  v-model="registerIndividual.username"
94
+                />
105
               </div>
95
               </div>
106
             </div>
96
             </div>
107
             <div class="col-md-8" style="margin-bottom: 1em">
97
             <div class="col-md-8" style="margin-bottom: 1em">
108
-              <div class="input-group mb-3">
109
-                <div class="input-group-prepend">
110
-                  <span class="input-group-text">
111
-                    <eva-icon name="lock" fill="#60CBEB"></eva-icon>
112
-                  </span>
113
-                  <input
114
-                    class="form-control"
115
-                    :type="isPasswordShown"
116
-                    v-model="registerIndividual.password"
117
-                    id="password"
118
-                    placeholder="Password"
119
-                    name="password"
120
-                    value
121
-                  />
122
-                </div>
98
+              <div class="input-group-prepend">
99
+                <span class="input-group-text">
100
+                  <eva-icon name="lock" fill="#60CBEB"></eva-icon>
101
+                </span>
102
+                <input
103
+                  class="form-control"
104
+                  :type="isPasswordShown"
105
+                  v-model="registerIndividual.password"
106
+                  id="password"
107
+                  placeholder="Password"
108
+                  name="password"
109
+                  value
110
+                />
123
               </div>
111
               </div>
124
             </div>
112
             </div>
125
             <div class="col-md-8" style="margin-bottom: 1em">
113
             <div class="col-md-8" style="margin-bottom: 1em">
126
-              <div class="input-group mb-3">
127
-                <div class="input-group-prepend">
128
-                  <span class="input-group-text">
129
-                    <eva-icon name="lock" fill="#60CBEB"></eva-icon>
130
-                  </span>
131
-                  <input
132
-                    class="form-control"
133
-                    :type="isPasswordShown"
134
-                    v-model="registerIndividual.password"
135
-                    id="password"
136
-                    placeholder="Confirm Password"
137
-                    name="confirmpassword"
138
-                    value
139
-                  />
140
-                  <div>
141
-                    <div class="input-group-append">
142
-                      <span class="input-group-text">
143
-                        <eva-icon
144
-                          v-if="!showPassword"
145
-                          name="eye-off"
146
-                          fill="#60CBEB"
147
-                          @click="togglePassword()"
148
-                        ></eva-icon>
149
-                        <eva-icon v-else name="eye" fill="#60CBEB" @click="passwordToggled()"></eva-icon>
150
-                      </span>
151
-                    </div>
114
+              <div class="input-group-prepend">
115
+                <span class="input-group-text">
116
+                  <eva-icon name="lock" fill="#60CBEB"></eva-icon>
117
+                </span>
118
+                <input
119
+                  class="form-control"
120
+                  :type="isPasswordShown"
121
+                  v-model="registerIndividual.password"
122
+                  id="password"
123
+                  placeholder="Confirm Password"
124
+                  name="confirmpassword"
125
+                  value
126
+                />
127
+                <div>
128
+                  <div class="input-group-append">
129
+                    <span class="input-group-text">
130
+                      <eva-icon
131
+                        v-if="!showPassword"
132
+                        name="eye-off"
133
+                        fill="#60CBEB"
134
+                        @click="togglePassword()"
135
+                      ></eva-icon>
136
+                      <eva-icon v-else name="eye" fill="#60CBEB" @click="passwordToggled()"></eva-icon>
137
+                    </span>
152
                   </div>
138
                   </div>
153
                 </div>
139
                 </div>
154
               </div>
140
               </div>

+ 194
- 0
src/components/user/timeshareIndividual.vue Ver arquivo

1
+<template>
2
+  <!-- eslint-disable max-len -->
3
+  <div class="reg-page">
4
+    <hr />
5
+    <div class="form-group row"></div>
6
+    <div class="col-md-12" style="text-align:left">
7
+      <h4>Detailed Individual Information</h4>
8
+      <div class="form-group row"></div>
9
+      <div class="row" style="text-align:left">
10
+        <div class="col-md-6">
11
+          <div class="input-group-prepend">
12
+            <span class="input-group-text">
13
+              <eva-icon name="person" fill="#60CBEB"></eva-icon>
14
+            </span>
15
+            <input
16
+              class="form-control"
17
+              type="text"
18
+              name="name"
19
+              placeholder="Name"
20
+              v-model="registerIndividual.name"
21
+            />
22
+          </div>
23
+        </div>
24
+        <div class="col-md-6" style="margin-bottom: 1em">
25
+          <div class="input-group-prepend">
26
+            <span class="input-group-text">
27
+              <eva-icon name="book" fill="#60CBEB"></eva-icon>
28
+            </span>
29
+            <input
30
+              class="form-control"
31
+              type="text"
32
+              name="surname"
33
+              placeholder="Surname"
34
+              v-model="registerIndividual.surname"
35
+            />
36
+          </div>
37
+        </div>
38
+        <div class="col-md-6" style="margin-bottom: 1em">
39
+          <div class="input-group-prepend">
40
+            <span class="input-group-text">
41
+              <eva-icon name="archive" fill="#60CBEB"></eva-icon>
42
+            </span>
43
+            <input class="form-control" type="text" name="idnumber" placeholder="ID Number" />
44
+          </div>
45
+        </div>
46
+        <div class="col-md-6" style="margin-bottom: 1em">
47
+          <div class="input-group-prepend">
48
+            <span class="input-group-text">
49
+              <eva-icon name="npm" fill="#60CBEB"></eva-icon>
50
+            </span>
51
+            <input
52
+              class="form-control"
53
+              type="text"
54
+              name="companyregnumber"
55
+              placeholder="Company Reg Number"
56
+            />
57
+          </div>
58
+        </div>
59
+        <div class="col-md-6" style="margin-bottom: 1em">
60
+          <div class="input-group-prepend">
61
+            <span class="input-group-text">
62
+              <eva-icon name="people" fill="#60CBEB"></eva-icon>
63
+            </span>
64
+            <input
65
+              class="form-control"
66
+              type="text"
67
+              name="maritalstatus"
68
+              placeholder="Marital Status"
69
+            />
70
+          </div>
71
+        </div>
72
+        <div class="col-md-6" style="margin-bottom: 1em">
73
+          <div class="input-group-prepend">
74
+            <span class="input-group-text">
75
+              <eva-icon name="email" fill="#60CBEB"></eva-icon>
76
+            </span>
77
+            <input
78
+              class="form-control"
79
+              type="text"
80
+              name="email"
81
+              placeholder="Email Address"
82
+              v-model="registerIndividual.email"
83
+            />
84
+          </div>
85
+        </div>
86
+        <div class="col-md-6" style="margin-bottom: 1em">
87
+          <div class="input-group-prepend">
88
+            <span class="input-group-text">
89
+              <eva-icon name="smartphone" fill="#60CBEB"></eva-icon>
90
+            </span>
91
+            <input
92
+              class="form-control"
93
+              type="text"
94
+              name="cellnumber"
95
+              placeholder="Cellphone Number"
96
+              v-model="registerIndividual.cellNumber"
97
+            />
98
+          </div>
99
+        </div>
100
+        <div class="col-md-6" style="margin-bottom: 1em">
101
+          <div class="input-group-prepend">
102
+            <span class="input-group-text">
103
+              <eva-icon name="phone" fill="#60CBEB"></eva-icon>
104
+            </span>
105
+            <input
106
+              class="form-control"
107
+              type="text"
108
+              name="landline"
109
+              placeholder="Landline Number"
110
+              v-model="registerIndividual.telephone"
111
+            />
112
+          </div>
113
+        </div>
114
+        <div class="col-md-6" style="margin-bottom: 1em">
115
+          <div class="input-group-prepend">
116
+            <span class="input-group-text">
117
+              <eva-icon name="home" fill="#60CBEB"></eva-icon>
118
+            </span>
119
+            <input
120
+              class="form-control"
121
+              type="text"
122
+              name="address"
123
+              placeholder="Address"
124
+              v-model="registerIndividual.telephone"
125
+            />
126
+          </div>
127
+        </div>
128
+      </div>
129
+    </div>
130
+  </div>
131
+</template>
132
+
133
+<script>
134
+import { mapState, mapActions } from 'vuex';
135
+
136
+export default {
137
+  props: {
138
+    RegisterHeader: { type: String, default: undefined },
139
+  },
140
+  name: 'PrivateIndividual',
141
+  data() {
142
+    return {
143
+      user: null,
144
+      isPasswordShown: 'password',
145
+      selectItems: [{ text: 'password', value: 0 }],
146
+      selectErrors: 'Some error with the field',
147
+      select: null,
148
+      textErrors: 'Some error with the field',
149
+      text: '',
150
+      showPassword: false,
151
+    };
152
+  },
153
+  computed: {
154
+    ...mapState('registerIndividual', ['registerIndividual']),
155
+
156
+    Header() {
157
+      return this.RegisterHeader
158
+        ? 'Agency Administrator Details'
159
+        : 'Private Individual';
160
+    },
161
+  },
162
+  methods: {
163
+    ...mapActions('registerIndividual', [
164
+      'getIndividual',
165
+      'saveIndividual',
166
+      'updateIndividual',
167
+      'clearIndividual',
168
+    ]),
169
+
170
+    togglePassword() {
171
+      this.showPassword = true;
172
+      this.isPasswordShown = 'text';
173
+    },
174
+    passwordToggled() {
175
+      this.showPassword = false;
176
+      this.isPasswordShown = 'password';
177
+    },
178
+    SubmitData() {
179
+      this.saveIndividual(this.registerIndividual);
180
+
181
+      this.$router.push('/registerIndividual/');
182
+    },
183
+    Close() {
184
+      this.$router.push('/registerIndividual/');
185
+    },
186
+  },
187
+};
188
+</script>
189
+
190
+<style>
191
+.goDown {
192
+  margin-top: 150px;
193
+}
194
+</style>

+ 158
- 163
src/router/index.js Ver arquivo

19
 import PropertyType from '../components/admin/property/propertyTypeEdit.vue';
19
 import PropertyType from '../components/admin/property/propertyTypeEdit.vue';
20
 import UserDefinedGroups from '../components/admin/property/userDefinedGroupsPage.vue';
20
 import UserDefinedGroups from '../components/admin/property/userDefinedGroupsPage.vue';
21
 import UserDefinedGroup from '../components/admin/property/userDefinedGroupPage.vue';
21
 import UserDefinedGroup from '../components/admin/property/userDefinedGroupPage.vue';
22
-import UserField from '../components/admin/property/userDefinedFieldPage.vue';
23
 
22
 
24
 import AboutUs from '../components/about/aboutUsPage.vue';
23
 import AboutUs from '../components/about/aboutUsPage.vue';
25
 import AboutTimeshare from '../components/about/aboutTimeshare.vue';
24
 import AboutTimeshare from '../components/about/aboutTimeshare.vue';
40
 Vue.use(Router);
39
 Vue.use(Router);
41
 
40
 
42
 export default new Router({
41
 export default new Router({
43
-  routes: [{
44
-    path: '/',
45
-    name: 'Home',
46
-    component: HomePage,
47
-  },
48
-  {
49
-    path: '/about/us',
50
-    name: 'aboutus',
51
-    component: AboutUs,
52
-  },
53
-  {
54
-    path: '/about/timeshare',
55
-    name: 'abouttimeshare',
56
-    component: AboutTimeshare,
57
-  },
58
-  {
59
-    path: '/timeshare/sell',
60
-    name: 'TimeshareSell',
61
-    component: TimeshareSell,
62
-  },
63
-  {
64
-    path: '/timeshare/buy',
65
-    name: 'TimeshareBuy',
66
-    component: TimeshareBuy,
67
-  },
68
-  {
69
-    path: '/timeshare/faq',
70
-    name: 'TimeshareFAQ',
71
-    component: TimeshareFAQ,
72
-  },
73
-  {
74
-    path: '/user/login',
75
-    name: 'Login',
76
-    component: Login,
77
-  },
78
-  {
79
-    path: '/user/register',
80
-    name: 'PrivateIndividual',
81
-    component: PrivateIndividual,
82
-  },
83
-  {
84
-    path: '/user/registeragency',
85
-    name: 'Agency',
86
-    component: Agency,
87
-  },
88
-  {
89
-    path: '/property/property/:id',
90
-    name: 'PropertyPage',
91
-    component: PropertyPage,
92
-  },
93
-  {
94
-    path: '/property/:propertyType/search',
95
-    name: 'PropertySearch',
96
-    component: PropertySearch,
97
-  },
98
-  {
99
-    path: '/property/search',
100
-    name: 'PropertySearchTab',
101
-    component: PropertySearch,
102
-  },
103
-  {
104
-    path: '/property/:propType/:saleType',
105
-    name: 'PropertyNew',
106
-    component: PropertyEdit,
107
-  },
108
-  {
109
-    path: '/property/:id',
110
-    name: 'PropertyEdit',
111
-    component: PropertyEdit,
112
-  },
113
-  {
114
-    path: '/property/list/:propertyType/:user',
115
-    name: 'PropertyList',
116
-    component: PropertyList,
117
-  },
118
-  {
119
-    path: '/propertyTypes/list',
120
-    name: 'PropertyTypeList',
121
-    component: PropertyTypeList,
122
-  },
123
-  {
124
-    path: '/propertyType/new',
125
-    name: 'PropertyTypeNew',
126
-    component: PropertyType,
127
-  },
128
-  {
129
-    path: '/propertyType/:id',
130
-    name: 'PropertyTypeEdit',
131
-    component: PropertyType,
132
-  },
133
-  {
134
-    path: '/userDefinedGroups/list',
135
-    name: 'UserDefinedGroupsList',
136
-    component: UserDefinedGroups,
137
-  },
138
-  {
139
-    path: '/userDefinedGroups/userDefinedGroup/:id',
140
-    name: 'UserDefinedGroupEdit',
141
-    component: UserDefinedGroup,
142
-  },
143
-  {
144
-    path: '/userDefinedGroups/userDefinedGroup',
145
-    name: 'UserDefinedGroupNew',
146
-    component: UserDefinedGroup,
147
-  },
148
-  {
149
-    path: '/userField',
150
-    name: 'UserDefinedField',
151
-    component: UserField,
152
-  },
153
-  {
154
-    path: '/status/list',
155
-    name: 'StatusList',
156
-    component: Status,
157
-  },
158
-  {
159
-    path: '/status/timeshareAdmin',
160
-    name: 'TimeshareAdmin',
161
-    component: timeshareAdminPage,
162
-  },
163
-  {
164
-    path: '/status/tenderWeekAdmin',
165
-    name: 'TenderWeekAdmin',
166
-    component: tenderWeekAdminPage,
167
-  },
168
-  {
169
-    path: '/status/userManagementPage',
170
-    name: 'userManagementPage',
171
-    component: userManagementPage,
172
-  },
173
-  {
174
-    path: '/status/changeLogPage',
175
-    name: 'changeLogPage',
176
-    component: changeLogPage,
177
-  },
178
-  {
179
-    path: '/unitConfiguration/list',
180
-    name: 'UnitConfiguration',
181
-    component: UnitConfiguration,
182
-  },
183
-  {
184
-    path: '/contactus',
185
-    name: 'ContactUs',
186
-    component: ContactUs,
187
-  },
188
-  {
189
-    path: '/privacypolicy',
190
-    name: 'PrivacyPolicy',
191
-    component: PrivacyPolicy,
192
-  },
193
-  {
194
-    path: '/resort/:resortCode',
195
-    name: 'ResortPage',
196
-    component: ResortPage,
197
-    props: true,
198
-  },
199
-  {
200
-    path: '/resort/:resortCode/:weekId',
201
-    name: 'UnitPage',
202
-    component: UnitPage,
203
-    props: true,
204
-  },
42
+  routes: [
43
+    {
44
+      path: '/',
45
+      name: 'Home',
46
+      component: HomePage,
47
+    },
48
+    {
49
+      path: '/about/us',
50
+      name: 'aboutus',
51
+      component: AboutUs,
52
+    },
53
+    {
54
+      path: '/about/timeshare',
55
+      name: 'abouttimeshare',
56
+      component: AboutTimeshare,
57
+    },
58
+    {
59
+      path: '/timeshare/sell',
60
+      name: 'TimeshareSell',
61
+      component: TimeshareSell,
62
+    },
63
+    {
64
+      path: '/timeshare/buy',
65
+      name: 'TimeshareBuy',
66
+      component: TimeshareBuy,
67
+    },
68
+    {
69
+      path: '/timeshare/faq',
70
+      name: 'TimeshareFAQ',
71
+      component: TimeshareFAQ,
72
+    },
73
+    {
74
+      path: '/user/login',
75
+      name: 'Login',
76
+      component: Login,
77
+    },
78
+    {
79
+      path: '/user/register',
80
+      name: 'PrivateIndividual',
81
+      component: PrivateIndividual,
82
+    },
83
+    {
84
+      path: '/user/registeragency',
85
+      name: 'Agency',
86
+      component: Agency,
87
+    },
88
+    {
89
+      path: '/property/property/:id',
90
+      name: 'PropertyPage',
91
+      component: PropertyPage,
92
+    },
93
+    {
94
+      path: '/property/:propertyType/search',
95
+      name: 'PropertySearch',
96
+      component: PropertySearch,
97
+    },
98
+    {
99
+      path: '/property/search',
100
+      name: 'PropertySearchTab',
101
+      component: PropertySearch,
102
+    },
103
+    {
104
+      path: '/property/:propType/:saleType',
105
+      name: 'PropertyNew',
106
+      component: PropertyEdit,
107
+    },
108
+    {
109
+      path: '/property/edit/:id/:propType/:saleType',
110
+      name: 'PropertyEdit',
111
+      component: PropertyEdit,
112
+    },
113
+    {
114
+      path: '/property/list/:propertyType/:user',
115
+      name: 'PropertyList',
116
+      component: PropertyList,
117
+    },
118
+    {
119
+      path: '/propertyTypes/list',
120
+      name: 'PropertyTypeList',
121
+      component: PropertyTypeList,
122
+    },
123
+    {
124
+      path: '/propertyType/new',
125
+      name: 'PropertyTypeNew',
126
+      component: PropertyType,
127
+    },
128
+    {
129
+      path: '/propertyType/:id',
130
+      name: 'PropertyTypeEdit',
131
+      component: PropertyType,
132
+    },
133
+    {
134
+      path: '/userDefinedGroups/list',
135
+      name: 'UserDefinedGroupsList',
136
+      component: UserDefinedGroups,
137
+    },
138
+    {
139
+      path: '/userDefinedGroups/userDefinedGroup/:id',
140
+      name: 'UserDefinedGroupEdit',
141
+      component: UserDefinedGroup,
142
+    },
143
+    {
144
+      path: '/userDefinedGroups/userDefinedGroup',
145
+      name: 'UserDefinedGroupNew',
146
+      component: UserDefinedGroup,
147
+    },
148
+    {
149
+      path: '/status/list',
150
+      name: 'StatusList',
151
+      component: Status,
152
+    },
153
+    {
154
+      path: '/status/timeshareAdmin',
155
+      name: 'TimeshareAdmin',
156
+      component: timeshareAdminPage,
157
+    },
158
+    {
159
+      path: '/status/tenderWeekAdmin',
160
+      name: 'TenderWeekAdmin',
161
+      component: tenderWeekAdminPage,
162
+    },
163
+    {
164
+      path: '/status/userManagementPage',
165
+      name: 'userManagementPage',
166
+      component: userManagementPage,
167
+    },
168
+    {
169
+      path: '/status/changeLogPage',
170
+      name: 'changeLogPage',
171
+      component: changeLogPage,
172
+    },
173
+    {
174
+      path: '/unitConfiguration/list',
175
+      name: 'UnitConfiguration',
176
+      component: UnitConfiguration,
177
+    },
178
+    {
179
+      path: '/contactus',
180
+      name: 'ContactUs',
181
+      component: ContactUs,
182
+    },
183
+    {
184
+      path: '/privacypolicy',
185
+      name: 'PrivacyPolicy',
186
+      component: PrivacyPolicy,
187
+    },
188
+    {
189
+      path: '/resort/:resortCode',
190
+      name: 'ResortPage',
191
+      component: ResortPage,
192
+      props: true,
193
+    },
194
+    {
195
+      path: '/resort/:resortCode/:weekId',
196
+      name: 'UnitPage',
197
+      component: UnitPage,
198
+      props: true,
199
+    },
205
   ],
200
   ],
206
 });
201
 });

+ 92
- 17
src/store/modules/property/property.js Ver arquivo

4
   namespaced: true,
4
   namespaced: true,
5
   state: {
5
   state: {
6
     property: {
6
     property: {
7
-      id: 0,
7
+      createdBy: '',
8
       propertyTypeId: 0,
8
       propertyTypeId: 0,
9
       propertyName: '',
9
       propertyName: '',
10
       unit: '',
10
       unit: '',
11
+      operationalCosts: 0.0,
12
+      price: 0,
13
+      pricePer: '',
14
+      isSale: false,
15
+      description: '',
16
+      shortDescription: '',
11
       addressLine1: '',
17
       addressLine1: '',
12
       addressLine2: '',
18
       addressLine2: '',
13
       addressLine3: '',
19
       addressLine3: '',
14
       suburbId: 0,
20
       suburbId: 0,
15
       cityId: 0,
21
       cityId: 0,
16
       provinceId: 0,
22
       provinceId: 0,
17
-      price: '',
18
-      per: '',
19
-      description: '',
20
-      isSale: false,
23
+      published: false,
21
       propertyUserFields: [],
24
       propertyUserFields: [],
22
       propertyImages: [],
25
       propertyImages: [],
26
+      id: 0,
23
     },
27
     },
24
     propertyImages: [],
28
     propertyImages: [],
25
     propertyTypes: [],
29
     propertyTypes: [],
61
     setLatestProperties(state, properties) {
65
     setLatestProperties(state, properties) {
62
       state.latestProperties = properties;
66
       state.latestProperties = properties;
63
     },
67
     },
68
+    clearProperty(state) {
69
+      state.property = {
70
+        createdBy: '',
71
+        propertyTypeId: 0,
72
+        propertyName: '',
73
+        unit: '',
74
+        operationalCosts: 0.0,
75
+        price: 0,
76
+        pricePer: '',
77
+        isSale: false,
78
+        description: '',
79
+        shortDescription: '',
80
+        addressLine1: '',
81
+        addressLine2: '',
82
+        addressLine3: '',
83
+        suburbId: 0,
84
+        cityId: 0,
85
+        provinceId: 0,
86
+        published: false,
87
+        propertyUserFields: [],
88
+        propertyImages: [],
89
+        id: 0,
90
+      };
91
+    },
92
+    clearPropertyImages(state) {
93
+      state.propertyImages = [];
94
+    },
95
+    setProperties(state, properties) {
96
+      state.properties = properties;
97
+    },
64
   },
98
   },
65
   getters: {},
99
   getters: {},
66
   actions: {
100
   actions: {
67
     getProperty({ commit }, id) {
101
     getProperty({ commit }, id) {
68
-      console.log(id);
69
       axios
102
       axios
70
-        .get(`http://localhost:57260/Property/Property/${id}`)
103
+        .get(`/api/Property/${id}`)
71
         .then(result => commit('setProperty', result.data))
104
         .then(result => commit('setProperty', result.data))
72
         .catch(console.error);
105
         .catch(console.error);
73
     },
106
     },
74
     getPropertyImages({ commit }, id) {
107
     getPropertyImages({ commit }, id) {
75
       axios
108
       axios
76
-        .get(`http://localhost:57260/property/PropertyImage/getpropertyimages/${id}`)
109
+        .get(`/api/PropertyImage/getPropertyImages/${id}`)
77
         .then(result => commit('setPropertyImages', result.data))
110
         .then(result => commit('setPropertyImages', result.data))
78
         .catch(console.error);
111
         .catch(console.error);
79
     },
112
     },
80
     getPropertyTypes({ commit }, propertyType) {
113
     getPropertyTypes({ commit }, propertyType) {
81
       axios
114
       axios
82
-        .get(`http://localhost:57260/Property/PropertyType/type/${propertyType}`)
115
+        .get(`/api/PropertyType/type/${propertyType}`)
83
         .then(result => commit('setPropertyTypes', result.data))
116
         .then(result => commit('setPropertyTypes', result.data))
84
         .catch(console.error);
117
         .catch(console.error);
85
     },
118
     },
86
     getPropertyTypesRes({ commit }) {
119
     getPropertyTypesRes({ commit }) {
87
       axios
120
       axios
88
-        .get('http://localhost:57260/Property/PropertyType/type/Residential')
121
+        .get('/api/PropertyType/type/Residential')
89
         .then(result => commit('setPropertyTypesRes', result.data))
122
         .then(result => commit('setPropertyTypesRes', result.data))
90
         .catch(console.error);
123
         .catch(console.error);
91
     },
124
     },
92
     getPropertyTypesCom({ commit }) {
125
     getPropertyTypesCom({ commit }) {
93
       axios
126
       axios
94
-        .get('http://localhost:57260/Property/PropertyType/type/Commercial')
127
+        .get('/api/PropertyType/type/Commercial')
95
         .then(result => commit('setPropertyTypesCom', result.data))
128
         .then(result => commit('setPropertyTypesCom', result.data))
96
         .catch(console.error);
129
         .catch(console.error);
97
     },
130
     },
98
     getPropertyOverviewFields({ commit }) {
131
     getPropertyOverviewFields({ commit }) {
99
       axios
132
       axios
100
-        .get('http://localhost:57260/Property/PropertyFields/Property Overview')
133
+        .get('/api/PropertyFields/Property Overview')
101
         .then(response => commit('setPropertyOverviewFields', response.data));
134
         .then(response => commit('setPropertyOverviewFields', response.data));
102
     },
135
     },
103
     getPropertyFields({ commit }, propertyType) {
136
     getPropertyFields({ commit }, propertyType) {
104
       axios
137
       axios
105
-        .get(`http://localhost:57260/property/propertyfields/Propertytype/${propertyType}`)
138
+        .get(`/api/propertyFields/PropertyType/${propertyType}`)
106
         .then(response => commit('setPropertyFields', response.data));
139
         .then(response => commit('setPropertyFields', response.data));
107
     },
140
     },
141
+    getPropertySavedOverviewFields({ commit }, id) {
142
+      axios
143
+        .get(`/api/PropertyFields/GetSavedValues/Residential/Property Overview/${id}`)
144
+        .then(response => commit('setPropertyOverviewFields', response.data))
145
+        .catch(console.error);
146
+    },
147
+    getPropertySavedFields({ commit }, item) {
148
+      axios
149
+        .get(`/api/PropertyFields/GetSavedValues/${item.type}/All/${item.id}`)
150
+        .then(response => commit('setPropertyFields', response.data))
151
+        .catch(console.error);
152
+    },
108
     saveProperty({ commit }, item) {
153
     saveProperty({ commit }, item) {
109
       axios
154
       axios
110
-        .post('http://localhost:57260/Property/Property', item)
155
+        .post('/api/Property', item)
111
         .then(result => commit('updateCurrentProperty', result.data))
156
         .then(result => commit('updateCurrentProperty', result.data))
112
         .catch(console.error);
157
         .catch(console.error);
113
     },
158
     },
114
     searchPropertiesParams({ commit }, item) {
159
     searchPropertiesParams({ commit }, item) {
115
       axios
160
       axios
116
         .get(
161
         .get(
117
-          `http://localhost:57260/Property/Property/Search/${item.type}/${item.propertyType}/${item.province}/${item.city}/${item.suburb}/${item.propType}`,
162
+          `/api/property/search/${item.type}/${item.propertyType}/${item.province}/${item.city}/${item.suburb}/${item.propType}`,
118
         )
163
         )
119
         .then(response => commit('updateSearch', response.data))
164
         .then(response => commit('updateSearch', response.data))
120
         .catch(console.error);
165
         .catch(console.error);
121
     },
166
     },
122
     searchPropertiesKeyword({ commit }, item) {
167
     searchPropertiesKeyword({ commit }, item) {
123
       axios
168
       axios
124
-        .get(`http://localhost:57260/Property/Property/Search/${item.keyword}`)
169
+        .get(`/api/Property/Search/${item.keyword}`)
125
         .then(response => commit('updateSearch', response.data))
170
         .then(response => commit('updateSearch', response.data))
126
         .catch(console.error);
171
         .catch(console.error);
127
     },
172
     },
128
     searchLatestProperties({ commit }) {
173
     searchLatestProperties({ commit }) {
129
       axios
174
       axios
130
-        .get('http://localhost:57260/property/property/latestProperties')
175
+        .get('/api/property/latestProperties')
131
         .then(response => commit('setLatestProperties', response.data))
176
         .then(response => commit('setLatestProperties', response.data))
132
         .catch(console.error);
177
         .catch(console.error);
133
     },
178
     },
179
+    clearProperty({ commit }) {
180
+      commit('clearProperty');
181
+    },
182
+    clearPropertyImages({ commit }) {
183
+      commit('clearPropertyImages');
184
+    },
185
+    getSavedPropertyData({ commit }, item) {
186
+      commit('clearProperty');
187
+      commit('clearPropertyImages');
188
+
189
+      axios
190
+        .get(`/api/Property/${item.id}`)
191
+        .then(result => commit('setProperty', result.data))
192
+        .catch(console.error);
193
+
194
+      axios
195
+        .get(`/api/PropertyImage/getPropertyImages/${item.id}`)
196
+        .then(result => commit('setPropertyImages', result.data))
197
+        .catch(console.error);
198
+
199
+      axios
200
+        .get(`/api/PropertyFields/GetSavedValues/Residential/Property Overview/${item.id}`)
201
+        .then(response => commit('setPropertyOverviewFields', response.data))
202
+        .catch(console.error);
203
+
204
+      axios
205
+        .get(`/api/PropertyFields/GetSavedValues/${item.type}/All/${item.id}`)
206
+        .then(response => commit('setPropertyFields', response.data))
207
+        .catch(console.error);
208
+    },
134
   },
209
   },
135
 };
210
 };

+ 96
- 19
src/store/modules/property/propertyAdmin.js Ver arquivo

4
   namespaced: true,
4
   namespaced: true,
5
   state: {
5
   state: {
6
     userDefinedGroups: [],
6
     userDefinedGroups: [],
7
-    userDefinedGroup: null,
7
+    userDefinedGroup: {
8
+      id: 0,
9
+      description: '',
10
+      usageType: 0,
11
+      rank: 0,
12
+      fields: [],
13
+    },
8
     userFields: [],
14
     userFields: [],
9
-    userField: null,
15
+    userField: {
16
+      id: 0,
17
+      groupId: 0,
18
+      fieldName: '',
19
+      fieldType: '',
20
+      rank: 0,
21
+    },
10
   },
22
   },
11
   mutations: {
23
   mutations: {
12
     setUserDefinedGroups(state, groups) {
24
     setUserDefinedGroups(state, groups) {
21
     setUserField(state, field) {
33
     setUserField(state, field) {
22
       state.userField = field;
34
       state.userField = field;
23
     },
35
     },
24
-    updateUserDefinedGroups(state, field) {
36
+    addUserDefinedGroups(state, field) {
25
       state.userDefinedGroups.push(field);
37
       state.userDefinedGroups.push(field);
26
     },
38
     },
39
+    updateUserDefinedGroups(state, field) {
40
+      state.userDefinedGroups.find(item => item.id === field.id).description = field.description;
41
+      state.userDefinedGroups.find(item => item.id === field.id).usageType = field.usageType;
42
+      state.userDefinedGroups.find(item => item.id === field.id).rank = field.rank;
43
+    },
44
+    addUserField(state, field) {
45
+      state.userFields.push(field);
46
+    },
47
+    updateUserFields(state, field) {
48
+      state.userFields.find(item => item.id === field.id).fieldName = field.fieldName;
49
+      state.userFields.find(item => item.id === field.id).fieldType = field.fieldType;
50
+      state.userFields.find(item => item.id === field.id).rank = field.rank;
51
+    },
52
+    removeUserDefinedGroup(state, id) {
53
+      state.userDefinedGroups.pop(state.userDefinedGroups.find(p => p.id === id));
54
+    },
55
+    removeUserField(state, id) {
56
+      state.userFields.pop(state.userFields.find(p => p.id === id));
57
+    },
58
+    clearUserGroup(state) {
59
+      state.userDefinedGroup = {
60
+        id: 0,
61
+        description: '',
62
+        usageType: 0,
63
+        rank: 0,
64
+      };
65
+    },
66
+    clearUserField(state) {
67
+      state.userField = {
68
+        id: 0,
69
+        fieldName: '',
70
+        fieldType: '',
71
+        rank: 0,
72
+      };
73
+    },
74
+    clearUserFields(state) {
75
+      state.userFields = [];
76
+    },
27
   },
77
   },
28
   getters: {},
78
   getters: {},
29
   actions: {
79
   actions: {
30
     getUserDefinedGroups({ commit }) {
80
     getUserDefinedGroups({ commit }) {
31
       axios
81
       axios
32
-        .get('http://localhost:57260/Property/UserDefinedGroup')
82
+        .get('/api/UserDefinedGroup')
33
         .then(result => commit('setUserDefinedGroups', result.data))
83
         .then(result => commit('setUserDefinedGroups', result.data))
34
         .catch(console.error);
84
         .catch(console.error);
35
     },
85
     },
36
-    getUserDefinedGroup({ commit }, item) {
86
+    getUserDefinedGroup({ commit }, id) {
37
       axios
87
       axios
38
-        .get(`http://localhost:57260/Property/UserDefinedGroup/${item.id}`)
88
+        .get(`/api/UserDefinedGroup/${id}`)
39
         .then(result => commit('setUserDefinedGroup', result.data))
89
         .then(result => commit('setUserDefinedGroup', result.data))
40
         .catch(console.error);
90
         .catch(console.error);
41
     },
91
     },
42
-    getUserFields({ commit }, item) {
92
+    getUserFields({ commit }, groupId) {
43
       axios
93
       axios
44
-        .get(`http://localhost:57260/Property/UserDefinedField/group/${item.groupId}`)
94
+        .get(`/api/UserDefinedField/group/${groupId}`)
45
         .then(result => commit('setUserFields', result.data))
95
         .then(result => commit('setUserFields', result.data))
46
         .catch(console.error);
96
         .catch(console.error);
47
     },
97
     },
48
-    getUserField({ commit }, item) {
98
+    getUserField({ commit }, id) {
49
       axios
99
       axios
50
-        .get(`http://localhost:57260/Property/UserDefinedField/${item.id}`)
100
+        .get(`/api/UserDefinedField/${id}`)
51
         .then(result => commit('setUserField', result.data))
101
         .then(result => commit('setUserField', result.data))
52
         .catch(console.error);
102
         .catch(console.error);
53
     },
103
     },
54
     saveUserDefinedGroup({ commit }, item) {
104
     saveUserDefinedGroup({ commit }, item) {
55
       axios
105
       axios
56
-        .post('http://localhost:57260/Property/UserDefinedGroup', item.group)
57
-        .then(response => commit('updateUserDefinedGroups', response.data))
106
+        .post('/api/UserDefinedGroup', item)
107
+        .then(response => commit('addUserDefinedGroups', response.data))
58
         .catch(console.error);
108
         .catch(console.error);
59
     },
109
     },
60
     updateUserDefinedGroup({ commit }, item) {
110
     updateUserDefinedGroup({ commit }, item) {
61
       axios
111
       axios
62
-        .put('http://localhost:57260/Property/UserDefinedGroup', item.group)
112
+        .put('/api/UserDefinedGroup', item)
63
         .then(response => commit('updateUserDefinedGroups', response.data))
113
         .then(response => commit('updateUserDefinedGroups', response.data))
64
         .catch(console.error);
114
         .catch(console.error);
65
     },
115
     },
66
-    // deleteUserDefinedGroup(item) {
67
-    //   axios
68
-    //     .delete(`http://localhost:57260/Property/UserDefinedField/${item.id}`)
69
-    //     .then((response) => {})
70
-    //     .catch(console.error);
71
-    // },
116
+    saveUserField({ commit }, item) {
117
+      axios
118
+        .post('/api/UserDefinedField', item)
119
+        .then(response => commit('addUserField', response.data))
120
+        .catch(console.error);
121
+    },
122
+    updateUserField({ commit }, item) {
123
+      axios
124
+        .put('/api/UserDefinedField', item)
125
+        .then(response => commit('updateUserFields', response.data))
126
+        .catch(console.error);
127
+    },
128
+    deleteUserDefinedGroup({ commit }, id) {
129
+      axios
130
+        .delete(`/api/UserDefinedGroup/${id}`)
131
+        .then(result => commit('removeUserDefinedGroup', id))
132
+        .catch(console.error);
133
+    },
134
+    deleteUserField({ commit }, id) {
135
+      axios
136
+        .delete(`/api/UserDefinedField/${id}`)
137
+        .then(result => commit('removeUserField', id))
138
+        .catch(console.error);
139
+    },
140
+    clearUserGroup({ commit }) {
141
+      commit('clearUserGroup');
142
+    },
143
+    clearUserField({ commit }) {
144
+      commit('clearUserField');
145
+    },
146
+    clearUserFields({ commit }) {
147
+      commit('clearUserFields');
148
+    },
72
   },
149
   },
73
 };
150
 };

+ 1
- 1
src/store/modules/property/propertyLists.js Ver arquivo

14
   actions: {
14
   actions: {
15
     getProperties({ commit }, item) {
15
     getProperties({ commit }, item) {
16
       axios
16
       axios
17
-        .get(`http://localhost:57260/Property/property/${item.propertyType}/${item.user}`)
17
+        .get(`/api/property/${item.propertyType}/${item.user}`)
18
         .then(result => commit('setProperties', result.data))
18
         .then(result => commit('setProperties', result.data))
19
         .catch(console.error);
19
         .catch(console.error);
20
     },
20
     },

+ 5
- 5
src/store/modules/property/propertyTypes.js Ver arquivo

37
   actions: {
37
   actions: {
38
     getPropertyTypes({ commit }) {
38
     getPropertyTypes({ commit }) {
39
       axios
39
       axios
40
-        .get('http://localhost:57260/Property/PropertyType')
40
+        .get('/api/PropertyType')
41
         .then(result => commit('setPropertyTypes', result.data))
41
         .then(result => commit('setPropertyTypes', result.data))
42
         .catch(console.error);
42
         .catch(console.error);
43
     },
43
     },
44
     getPropertyType({ commit }, id) {
44
     getPropertyType({ commit }, id) {
45
       axios
45
       axios
46
-        .get(`http://localhost:57260/Property/PropertyType/${id}`)
46
+        .get(`/api/PropertyType/${id}`)
47
         .then(result => commit('setPropertyType', result.data))
47
         .then(result => commit('setPropertyType', result.data))
48
         .catch(console.error);
48
         .catch(console.error);
49
     },
49
     },
50
     savePropertyType({ commit }, item) {
50
     savePropertyType({ commit }, item) {
51
       axios
51
       axios
52
-        .post('http://localhost:57260/Property/PropertyType', item)
52
+        .post('/api/PropertyType', item)
53
         .then(result => commit('addToPropertyTypes', result.data))
53
         .then(result => commit('addToPropertyTypes', result.data))
54
         .catch(console.error);
54
         .catch(console.error);
55
     },
55
     },
56
     updatePropertyType({ commit }, item) {
56
     updatePropertyType({ commit }, item) {
57
       axios
57
       axios
58
-        .put('http://localhost:57260/Property/PropertyType', item)
58
+        .put('/api/PropertyType', item)
59
         .then(result => commit('updatePropertyTypes', item))
59
         .then(result => commit('updatePropertyTypes', item))
60
         .catch(console.error);
60
         .catch(console.error);
61
     },
61
     },
64
     },
64
     },
65
     deletePropertyType({ commit }, id) {
65
     deletePropertyType({ commit }, id) {
66
       axios
66
       axios
67
-        .delete(`http://localhost:57260/Property/PropertyType/${id}`)
67
+        .delete(`/api/PropertyType/${id}`)
68
         .then(result => commit('removePropertyType', id))
68
         .then(result => commit('removePropertyType', id))
69
         .catch(console.error);
69
         .catch(console.error);
70
     },
70
     },

+ 3
- 3
src/store/modules/searchTab.js Ver arquivo

22
   actions: {
22
   actions: {
23
     getProvince({ commit }) {
23
     getProvince({ commit }) {
24
       axios
24
       axios
25
-        .get('http://localhost:57260/region/province')
25
+        .get('/api/province')
26
         .then(result => commit('setProvince', result.data))
26
         .then(result => commit('setProvince', result.data))
27
         .catch(console.error);
27
         .catch(console.error);
28
     },
28
     },
29
     getCities({ commit }, item) {
29
     getCities({ commit }, item) {
30
       axios
30
       axios
31
-        .get(`http://localhost:57260/region/city/getby/${item.province}`)
31
+        .get(`/api/city/getBy/${item.province}`)
32
         .then(result => commit('setCities', result.data));
32
         .then(result => commit('setCities', result.data));
33
     },
33
     },
34
     getSuburbs({ commit }, item) {
34
     getSuburbs({ commit }, item) {
35
       axios
35
       axios
36
-        .get(`http://localhost:57260/region/Suburb/${item.province}/${item.city}`)
36
+        .get(`/api/Suburb/${item.province}/${item.city}`)
37
         .then(result => commit('setSuburbs', result.data));
37
         .then(result => commit('setSuburbs', result.data));
38
     },
38
     },
39
   },
39
   },

+ 8
- 8
src/store/modules/user/register.js Ver arquivo

86
     //   commit,
86
     //   commit,
87
     // }, id) {
87
     // }, id) {
88
     //   axios
88
     //   axios
89
-    //     .get(`http://localhost:57260/api/user/${id}`)
89
+    //     .get(`http://192.168.6.188:5000/api/user/${id}`)
90
     //     .then(result => commit('setIndividual', result.data))
90
     //     .then(result => commit('setIndividual', result.data))
91
     //     .catch(console.error);
91
     //     .catch(console.error);
92
     // },
92
     // },
94
     //   commit,
94
     //   commit,
95
     // }, id) {
95
     // }, id) {
96
     //   axios
96
     //   axios
97
-    //     .get(`http://localhost:57260/api/agency/${id}`)
97
+    //     .get(`http://192.168.6.188:5000/api/agency/${id}`)
98
     //     .then(result => commit('setAgency', result.data))
98
     //     .then(result => commit('setAgency', result.data))
99
     //     .catch(console.error);
99
     //     .catch(console.error);
100
     // },
100
     // },
103
       commit,
103
       commit,
104
     }, item) {
104
     }, item) {
105
       axios
105
       axios
106
-        .post('http://localhost:57260/api/register/register', item)
106
+        .post('http://192.168.6.188:5000/api/register/register', item)
107
         .then(result => commit('addIndividual', result.data))
107
         .then(result => commit('addIndividual', result.data))
108
         .catch(console.error);
108
         .catch(console.error);
109
     },
109
     },
111
       commit,
111
       commit,
112
     }, item) {
112
     }, item) {
113
       axios
113
       axios
114
-        .post('http://localhost:57260/api/register/registeragency', item)
114
+        .post('http://192.168.6.188:5000/api/register/registeragency', item)
115
         .then(result => commit('addAgency', result.data))
115
         .then(result => commit('addAgency', result.data))
116
         .catch(console.error);
116
         .catch(console.error);
117
     },
117
     },
119
     //   commit,
119
     //   commit,
120
     // }, item) {
120
     // }, item) {
121
     //   axios
121
     //   axios
122
-    //     .put('http://localhost:57260/api/individual', item)
122
+    //     .put('http://192.168.6.188:5000/api/individual', item)
123
     //     .then(result => commit('updateIndividual', item))
123
     //     .then(result => commit('updateIndividual', item))
124
     //     .catch(console.error);
124
     //     .catch(console.error);
125
     // },
125
     // },
127
     //   commit,
127
     //   commit,
128
     // }, item) {
128
     // }, item) {
129
     //   axios
129
     //   axios
130
-    //     .put('http://localhost:57260/api/agency', item)
130
+    //     .put('http://192.168.6.188:5000/api/agency', item)
131
     //     .then(result => commit('updateAgency', item))
131
     //     .then(result => commit('updateAgency', item))
132
     //     .catch(console.error);
132
     //     .catch(console.error);
133
     // },
133
     // },
145
     //   commit,
145
     //   commit,
146
     // }, id) {
146
     // }, id) {
147
     //   axios
147
     //   axios
148
-    //     .delete(`http://localhost:57260/api/individual/${id}`)
148
+    //     .delete(`http://192.168.6.188:5000/api/individual/${id}`)
149
     //     .then(result => commit('removeIndividual', id))
149
     //     .then(result => commit('removeIndividual', id))
150
     //     .catch(console.error);
150
     //     .catch(console.error);
151
     // },
151
     // },
153
     //   commit,
153
     //   commit,
154
     // }, id) {
154
     // }, id) {
155
     //   axios
155
     //   axios
156
-    //     .delete(`http://localhost:57260/api/agency/${id}`)
156
+    //     .delete(`http://192.168.6.188:5000/api/agency/${id}`)
157
     //     .then(result => commit('removeAgency', id))
157
     //     .then(result => commit('removeAgency', id))
158
     //     .catch(console.error);
158
     //     .catch(console.error);
159
     // },
159
     // },

Carregando…
Cancelar
Salvar