LeneS 5 years ago
parent
commit
475b585de7

+ 5
- 0
package-lock.json View File

7793
         }
7793
         }
7794
       }
7794
       }
7795
     },
7795
     },
7796
+    "moment": {
7797
+      "version": "2.24.0",
7798
+      "resolved": "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz",
7799
+      "integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg=="
7800
+    },
7796
     "move-concurrently": {
7801
     "move-concurrently": {
7797
       "version": "1.0.1",
7802
       "version": "1.0.1",
7798
       "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz",
7803
       "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz",

+ 1
- 0
package.json View File

17
     "jquery": "^3.4.1",
17
     "jquery": "^3.4.1",
18
     "lodash": "^4.17.15",
18
     "lodash": "^4.17.15",
19
     "material-design-icons-iconfont": "^3.0.3",
19
     "material-design-icons-iconfont": "^3.0.3",
20
+    "moment": "^2.24.0",
20
     "node-sass": "^4.12.0",
21
     "node-sass": "^4.12.0",
21
     "roboto-fontface": "*",
22
     "roboto-fontface": "*",
22
     "sass-loader": "^7.3.1",
23
     "sass-loader": "^7.3.1",

+ 83
- 0
src/components/admin/logs/SearchLogs.vue View File

1
+<template>
2
+  <!-- eslint-disable max-len -->
3
+  <div>
4
+    <div class="container">
5
+      <!-- <section class="intro-single"> -->
6
+      <div class="container">
7
+        <br />
8
+        <br />
9
+        <br />
10
+        <br />
11
+        <div class="row">
12
+          <div class="col-md-12 col-lg-8">
13
+            <div class="title-box-d">
14
+              <h1 class="title-d" style="text-align:left; font-size: 250%">Search Log</h1>
15
+            </div>
16
+          </div>
17
+        </div>
18
+      </div>
19
+      <!-- </section> -->
20
+    </div>
21
+    <div class="container">
22
+      <table class="table table-bordered">
23
+        <thead>
24
+          <tr>
25
+            <th>Date</th>
26
+            <th>Time</th>
27
+            <th>User</th>
28
+            <th>Keyword</th>
29
+            <th>Sales Type</th>
30
+            <th>Property Usage Type</th>
31
+            <th>Property Type</th>
32
+            <th>Province</th>
33
+            <th>City</th>
34
+            <th>Suburb</th>
35
+          </tr>
36
+        </thead>
37
+        <tbody>
38
+          <tr v-for="(item, i) in propertySearch" :key="i">
39
+            <td>{{ formatDate(item.date) }}</td>
40
+            <td>{{ formatTime(item.date) }}</td>
41
+            <td v-if="item.user">{{ item.user }}</td>
42
+            <td v-else>No User</td>
43
+            <td>{{ item.keyword === 'All' ? '' : item.keyword }}</td>
44
+            <td>{{ item.salesType === 'All' ? '' : item.salesType }}</td>
45
+            <td>{{ item.propertyUsageType === 'All' ? '' : item.propertyUsageType }}</td>
46
+            <td>{{ item.propertyType === 'All' ? '' : item.propertyType }}</td>
47
+            <td>{{ item.province === 'All' ? '' : item.province }}</td>
48
+            <td>{{ item.city === 'All' ? '' : item.city }}</td>
49
+            <td>{{ item.suburb === 'All' ? '' : item.suburb }}</td>
50
+          </tr>
51
+        </tbody>
52
+      </table>
53
+    </div>
54
+    <br />
55
+  </div>
56
+</template>
57
+
58
+<script>
59
+import { mapState, mapActions } from 'vuex';
60
+import moment from 'moment';
61
+
62
+export default {
63
+  name: 'searchLog',
64
+  data() {
65
+    return {};
66
+  },
67
+  methods: {
68
+    ...mapActions('searchLog', ['getPropertySearchLogs']),
69
+    formatDate(value) {
70
+      return moment(String(value)).format('YYYY/MM/DD');
71
+    },
72
+    formatTime(value) {
73
+      return moment(String(value)).format('hh:mm');
74
+    },
75
+  },
76
+  mounted() {
77
+    this.getPropertySearchLogs();
78
+  },
79
+  computed: {
80
+    ...mapState('searchLog', ['propertySearch']),
81
+  },
82
+};
83
+</script>

+ 1
- 1
src/components/processFlow/makeOffer.vue View File

21
         <div class="form-group row">
21
         <div class="form-group row">
22
           <div class="col-md-6 col-lg-5 section-md-t3">
22
           <div class="col-md-6 col-lg-5 section-md-t3">
23
             <div class="title-box-d">
23
             <div class="title-box-d">
24
-              <h3 class="title-d">{{ item.resort.resortName }}</h3>
24
+              <h3 class="title-d">{{ item ? item.resortName : '' }}</h3>
25
             </div>
25
             </div>
26
           </div>
26
           </div>
27
         </div>
27
         </div>

+ 9
- 2
src/components/property/propertyList.vue View File

49
             <td v-html="item.size" />
49
             <td v-html="item.size" />
50
             <td>{{ item.price }}</td>
50
             <td>{{ item.price }}</td>
51
             <td>{{ item.type }}</td>
51
             <td>{{ item.type }}</td>
52
-            <td>{{ item.publish }}</td>
52
+            <!-- <td>{{ item.publish }}</td> -->
53
+            <td></td>
53
             <td>{{ item.status }}</td>
54
             <td>{{ item.status }}</td>
54
             <td>
55
             <td>
55
               <button
56
               <button
57
                 @click="Edit(item)"
58
                 @click="Edit(item)"
58
                 class="btn btn-b-n"
59
                 class="btn btn-b-n"
59
                 style="width: 85px; height:40px;"
60
                 style="width: 85px; height:40px;"
61
+                disabled
60
               >Edit</button>
62
               >Edit</button>
61
             </td>
63
             </td>
62
             <td>
64
             <td>
63
-              <button type="button" class="btn btn-b-n" style="width: 85px; height:40px;">Delete</button>
65
+              <button
66
+                type="button"
67
+                class="btn btn-b-n"
68
+                style="width: 85px; height:40px;"
69
+                disabled
70
+              >Delete</button>
64
             </td>
71
             </td>
65
           </tr>
72
           </tr>
66
         </tbody>
73
         </tbody>

+ 29
- 56
src/components/property/propertySearchPage.vue View File

47
         </div>
47
         </div>
48
         <div class="col-md-4">
48
         <div class="col-md-4">
49
           <p>
49
           <p>
50
-            <img class="img-fluid" src="./../../../public/img/residential.jpg" alt="About Resale" style="border-radius:10px"/>
50
+            <img
51
+              class="img-fluid"
52
+              src="./../../../public/img/residential.jpg"
53
+              alt="About Resale"
54
+              style="border-radius:10px"
55
+            />
51
           </p>
56
           </p>
52
         </div>
57
         </div>
53
       </div>
58
       </div>
130
   </div>
135
   </div>
131
 </template>
136
 </template>
132
 <script>
137
 <script>
133
-import { mkdir } from 'fs';
134
 import { mapState, mapActions } from 'vuex';
138
 import { mapState, mapActions } from 'vuex';
135
 import propertyCard from './propertyCard.vue';
139
 import propertyCard from './propertyCard.vue';
136
 
140
 
179
         suburb: 'All',
183
         suburb: 'All',
180
       };
184
       };
181
 
185
 
182
-      if (typeof this.$route.params.propertyType === 'undefined') {
183
-        // eslint-disable-next-line vue/no-side-effects-in-computed-properties
184
-        this.propertySearch = this.$route.query;
185
-      } else {
186
+      if (Object.keys(this.$route.params).length > 0) {
187
+        if (this.$route.params.propertyUsageType) {
188
+          // eslint-disable-next-line vue/no-side-effects-in-computed-properties
189
+          this.propertySearch.propertyUsageType = this.$route.params.propertyUsageType;
190
+        }
191
+      }
192
+      if (Object.keys(this.$route.query).length > 0) {
193
+        if (Object.keys(this.$route.query).length > 2) {
194
+          // eslint-disable-next-line vue/no-side-effects-in-computed-properties
195
+          this.propertySearch = this.$route.query;
196
+        } else {
197
+          if (this.$route.query.salesType) {
198
+            // eslint-disable-next-line vue/no-side-effects-in-computed-properties
199
+            this.propertySearch.salesType = this.$route.query.salesType;
200
+          }
201
+          if (this.$route.query.propertyUsageType) {
202
+            // eslint-disable-next-line vue/no-side-effects-in-computed-properties
203
+            this.propertySearch.propertyUsageType = this.$route.query.propertyUsageType;
204
+          }
205
+        }
206
+      }
207
+      if (this.propertySearch.keyword === '') {
186
         // eslint-disable-next-line vue/no-side-effects-in-computed-properties
208
         // eslint-disable-next-line vue/no-side-effects-in-computed-properties
187
-        this.propertySearch.propertyUsageType = this.$route.params.propertyType;
209
+        this.propertySearch.keyword = 'All';
188
       }
210
       }
189
 
211
 
190
-      console.log('PropertySearch = ' + JSON.stringify(this.propertySearch));
191
-
192
       this.searchProperties(this.propertySearch);
212
       this.searchProperties(this.propertySearch);
193
-      // this.type = this.$route.query.type;
194
-      // this.propertyType = this.$route.query.propertyType;
195
-      // this.province = this.$route.query.province;
196
-      // this.city = this.$route.query.city;
197
-      // this.suburb = this.$route.query.suburb;
198
-      // this.proptype = this.$route.query.propType;
199
-      // this.keyword = this.$route.query.keyword;
200
-      // if (typeof this.propertyType === 'undefined') {
201
-      //   this.propertyType = this.propertyTypeparam;
202
-      // }
203
-      // if (this.type === '') {
204
-      //   this.type = 'undefined';
205
-      // }
206
-      // if (this.propertyType === '') {
207
-      //   this.propertyType = 'undefined';
208
-      // }
209
-      // if (this.province === '') {
210
-      //   this.province = 'undefined';
211
-      // }
212
-      // if (this.city === '') {
213
-      //   this.city = 'undefined';
214
-      // }
215
-      // if (this.suburb === '') {
216
-      //   this.suburb = 'undefined';
217
-      // }
218
-      // if (this.proptype === '') {
219
-      //   this.propType = 'undefined';
220
-      // }
221
-      // if (typeof this.keyword === 'undefined' || this.keyword === '') {
222
-      //   this.searchPropertiesParams(
223
-      //     Object.assign(
224
-      //       {},
225
-      //       {
226
-      //         type: this.type,
227
-      //         propertyType: this.propertyType,
228
-      //         province: this.province,
229
-      //         city: this.city,
230
-      //         suburb: this.suburb,
231
-      //         propType: this.proptype,
232
-      //       },
233
-      //     ),
234
-      //   );
235
-      // } else {
236
-      //   this.searchPropertiesKeyword(
237
-      //     Object.assign({}, { keyword: this.keyword }),
238
-      //   );
239
-      // }
240
       return null;
213
       return null;
241
     },
214
     },
242
   },
215
   },

+ 6
- 6
src/components/property/propertyeditPage.vue View File

355
 
355
 
356
       setTimeout(
356
       setTimeout(
357
         () => this.$router.push({
357
         () => this.$router.push({
358
-            path: '/property/search',
359
-            query: {
360
-              salesType: this.salesType,
361
-              propertyUsageType: this.propertyType,
362
-            },
363
-          }),
358
+          path: '/property/search',
359
+          query: {
360
+            salesType: this.salesType,
361
+            propertyUsageType: this.propertyType,
362
+          },
363
+        }),
364
         3000,
364
         3000,
365
       );
365
       );
366
     },
366
     },

+ 8
- 8
src/components/shared/lightBoxGallery.vue View File

45
     return {
45
     return {
46
       bg: false,
46
       bg: false,
47
       currentImage: 0,
47
       currentImage: 0,
48
-      count: true
48
+      count: true,
49
     };
49
     };
50
   },
50
   },
51
   props: {
51
   props: {
52
     thumbnails: {
52
     thumbnails: {
53
       type: Array,
53
       type: Array,
54
-      default: () => []
54
+      default: () => [],
55
     },
55
     },
56
     largeImages: {
56
     largeImages: {
57
       type: Array,
57
       type: Array,
58
-      default: () => []
58
+      default: () => [],
59
     },
59
     },
60
     captions: {
60
     captions: {
61
       type: Array,
61
       type: Array,
62
-      default: () => []
62
+      default: () => [],
63
     },
63
     },
64
     thumbnailsPath: {
64
     thumbnailsPath: {
65
       type: String,
65
       type: String,
66
-      default: ""
66
+      default: '',
67
     },
67
     },
68
     largePath: {
68
     largePath: {
69
       type: String,
69
       type: String,
70
-      default: ""
70
+      default: '',
71
     },
71
     },
72
     caption: true
72
     caption: true
73
   },
73
   },
91
       } else {
91
       } else {
92
         this.currentImage = this.largeImages.length - 1;
92
         this.currentImage = this.largeImages.length - 1;
93
       }
93
       }
94
-    }
95
-  }
94
+    },
95
+  },
96
 };
96
 };
97
 </script>
97
 </script>
98
 
98
 

+ 5
- 1
src/components/shared/navBar.vue View File

177
                   class="dropdown-item cursor-pointer"
177
                   class="dropdown-item cursor-pointer"
178
                   @click="routerGoTo('/propertyTypes/list')"
178
                   @click="routerGoTo('/propertyTypes/list')"
179
                 >Property Types</a>
179
                 >Property Types</a>
180
+                <a
181
+                  class="dropdown-item cursor-pointer"
182
+                  @click="routerGoTo('/searchLog')"
183
+                >Search Logs</a>
184
+                <a class="dropdown-item cursor-pointer" @click="routerGoTo('/Offers')">Offers</a>
180
               </div>
185
               </div>
181
             </li>
186
             </li>
182
             <li class="nav-item dropdown">
187
             <li class="nav-item dropdown">
245
     ...mapActions('authentication', ['logout']),
250
     ...mapActions('authentication', ['logout']),
246
 
251
 
247
     routerGoTo(goTo) {
252
     routerGoTo(goTo) {
248
-      console.log(goTo);
249
       this.$emit('routerGoTo', goTo);
253
       this.$emit('routerGoTo', goTo);
250
     },
254
     },
251
   },
255
   },

+ 2
- 2
src/components/shared/searchTab.vue View File

8
     <div class="box-collapse-wrap">
8
     <div class="box-collapse-wrap">
9
       <form class="form-a">
9
       <form class="form-a">
10
         <div class="row">
10
         <div class="row">
11
-          <div class="col-md-12 mb-2">
11
+          <div class="col-md-12">
12
             <div class="form-group" style="text-align:left">
12
             <div class="form-group" style="text-align:left">
13
               <label for="Type">Keyword</label>
13
               <label for="Type">Keyword</label>
14
               <input
14
               <input
15
                 type="text"
15
                 type="text"
16
-                class="form-control form-control-lg form-control-a"
16
+                class="form-control form-control-a"
17
                 placeholder="Keyword"
17
                 placeholder="Keyword"
18
                 v-model="keyword"
18
                 v-model="keyword"
19
               />
19
               />

+ 6
- 28
src/components/timeshare/buy/weekListComponent.vue View File

29
             <!-- <td>{{item.status ? item.status.description : ''}}</td> -->
29
             <!-- <td>{{item.status ? item.status.description : ''}}</td> -->
30
             <td>
30
             <td>
31
               <div class="col-md-12">
31
               <div class="col-md-12">
32
-                <button
33
-                  type="button"
34
-                  class="btn btn-b-n"
35
-                  data-toggle="modal"
36
-                  data-target="#myModal"
37
-                >Make an Offer</button>
38
-                <div id="myModal" class="modal fade" role="dialog">
39
-                  <div class="modal-dialog modal-lg">
40
-                    <!-- Modal content-->
41
-                    <div class="modal-content">
42
-                      <div class="modal-header">
43
-                        <button type="button" class="close" data-dismiss="modal">&times;</button>
44
-                      </div>
45
-                      <div padding-left="20px">
46
-                        <makeOffer
47
-                          name="MakeOffer"
48
-                          :isMakeOffer="true"
49
-                          :isProperty="false"
50
-                          :item="item"
51
-                        />
52
-                      </div>
53
-                    </div>
54
-                  </div>
55
-                </div>
32
+                <button type="button" class="btn btn-b-n" @click="View(item)">View</button>
56
               </div>
33
               </div>
57
             </td>
34
             </td>
58
           </tr>
35
           </tr>
71
 </template>
48
 </template>
72
 <script>
49
 <script>
73
 import { mapState, mapActions, mapGetters } from 'vuex';
50
 import { mapState, mapActions, mapGetters } from 'vuex';
74
-import makeOffer from '../../processFlow/makeOffer.vue';
75
 
51
 
76
 export default {
52
 export default {
77
   props: {
53
   props: {
78
     resortCode: undefined,
54
     resortCode: undefined,
79
   },
55
   },
80
-  components: {
81
-    makeOffer,
82
-  },
56
+  components: {},
83
   computed: {
57
   computed: {
84
     ...mapState('weekList', ['weeks']),
58
     ...mapState('weekList', ['weeks']),
85
     ...mapGetters({
59
     ...mapGetters({
93
     this.getWeeks();
67
     this.getWeeks();
94
   },
68
   },
95
   methods: {
69
   methods: {
70
+    View(item) {
71
+      console.log(item);
72
+      this.$router.push(`/resort/${item.resort.resortCode}/${item.id}`);
73
+    },
96
     ...mapActions('weekList', ['getWeeks', 'applyResortFilter']),
74
     ...mapActions('weekList', ['getWeeks', 'applyResortFilter']),
97
   },
75
   },
98
 };
76
 };

+ 0
- 1
src/components/timeshare/resort/resortPage.vue View File

40
           </div>
40
           </div>
41
           {{description}}
41
           {{description}}
42
           <hr />
42
           <hr />
43
-
44
           <div class="row">
43
           <div class="row">
45
             <div class="col-md-10 mb-4">
44
             <div class="col-md-10 mb-4">
46
               <ul class="nav nav-tabs" id="myTab" role="tablist">
45
               <ul class="nav nav-tabs" id="myTab" role="tablist">

+ 26
- 56
src/components/timeshare/resort/unitPage.vue View File

8
     <div class="row">
8
     <div class="row">
9
       <div class="col-md-12 col-lg-8">
9
       <div class="col-md-12 col-lg-8">
10
         <div class="title-box-d">
10
         <div class="title-box-d">
11
-          <h1 class="title-d" style="text-align:left; font-size: 250%">{{resort.prName}}</h1>
11
+          <h1
12
+            class="title-d"
13
+            style="text-align:left; font-size: 250%"
14
+          >{{week ? week.resortName : ''}}</h1>
12
         </div>
15
         </div>
13
         <br />
16
         <br />
14
       </div>
17
       </div>
41
             </ul>
44
             </ul>
42
           </div>
45
           </div>
43
         </div>
46
         </div>
44
-        <div class="col-md-6">
47
+        <div class="col-md-6" v-if="week">
45
           <form
48
           <form
46
             id="mainForm"
49
             id="mainForm"
47
             method="POST"
50
             method="POST"
66
                     type="text"
69
                     type="text"
67
                     id="resort"
70
                     id="resort"
68
                     name="resortunit"
71
                     name="resortunit"
69
-                    :value="week.unit"
72
+                    :value="week ? week.unitNumber : ''"
70
                     disabled
73
                     disabled
71
                   />
74
                   />
72
                 </div>
75
                 </div>
84
                     type="text"
87
                     type="text"
85
                     id="week"
88
                     id="week"
86
                     name="resortWeek"
89
                     name="resortWeek"
87
-                    :value="week.module"
90
+                    :value="week ? week.weekNumber : ''"
88
                     disabled
91
                     disabled
89
                   />
92
                   />
90
                 </div>
93
                 </div>
103
                     type="text"
106
                     type="text"
104
                     id="levy"
107
                     id="levy"
105
                     name="levy"
108
                     name="levy"
106
-                    :value="formatPrice(week.currentLevy)"
109
+                    :value="formatPrice(week ? week.levyAmount : 0)"
107
                     disabled
110
                     disabled
108
                   />
111
                   />
109
                 </div>
112
                 </div>
115
                   <div style="width: 260px; height: 70px; border-style: solid; color: #60CBEB;">
118
                   <div style="width: 260px; height: 70px; border-style: solid; color: #60CBEB;">
116
                     <!-- <div class="card-title-c align-self-center"> -->
119
                     <!-- <div class="card-title-c align-self-center"> -->
117
                     <a class="justify-content-center" style="color: black; font-size: 250%">
120
                     <a class="justify-content-center" style="color: black; font-size: 250%">
118
-                      <b>R{{ formatPrice(week.price) }}</b>
121
+                      <b>R{{ formatPrice(week ? week.sellPrice : 0) }}</b>
119
                     </a>
122
                     </a>
120
                     <!-- </div> -->
123
                     <!-- </div> -->
121
                   </div>
124
                   </div>
124
               </div>
127
               </div>
125
             </div>
128
             </div>
126
             <br />
129
             <br />
127
-            <div class="form-row">
128
-              <div>
129
-                <div class="input-group mb-3">
130
-                  <div class="input-group-prepend">
131
-                    <span class="input-group-text">
132
-                      <eva-icon name="person-outline" fill="#60CBEB"></eva-icon>
133
-                    </span>
134
-                    <input class="form-control" type="text" name="name" placeholder="Name" />
135
-                  </div>
136
-                </div>
137
-                <div class="input-group mb-3">
138
-                  <div class="input-group-prepend">
139
-                    <span class="input-group-text">
140
-                      <eva-icon name="phone-outline" fill="#60CBEB"></eva-icon>
141
-                    </span>
142
-                    <input
143
-                      class="form-control"
144
-                      type="number"
145
-                      name="mobile"
146
-                      placeholder="Contact Number"
147
-                    />
148
-                  </div>
149
-                </div>
150
-                <div class="input-group mb-3">
151
-                  <div class="input-group-prepend">
152
-                    <span class="input-group-text">
153
-                      <eva-icon name="email-outline" fill="#60CBEB"></eva-icon>
154
-                    </span>
155
-                    <input class="form-control" type="email" name="email" placeholder="Email" />
156
-                  </div>
157
-                </div>
158
-              </div>
159
-            </div>
160
           </form>
130
           </form>
161
           <br />
131
           <br />
162
 
132
 
163
-          <button class="btn btn-b-c even-width mr-auto" type="submit">Enquire Now</button>
164
-
165
           <!-- <a
133
           <!-- <a
166
               class="btn btn-b-n even-width mr-auto"
134
               class="btn btn-b-n even-width mr-auto"
167
               href="/share-transfer-initiation-for-purchaser/"
135
               href="/share-transfer-initiation-for-purchaser/"
172
             data-toggle="modal"
140
             data-toggle="modal"
173
             data-target="#myModal"
141
             data-target="#myModal"
174
           >Make an Offer</button>
142
           >Make an Offer</button>
175
-          <div id="myModal" class="modal fade" role="dialog">
176
-            <div class="modal-dialog modal-lg">
177
-              <!-- Modal content-->
178
-              <div class="modal-content">
179
-                <div class="modal-header">
180
-                  <button type="button" class="close" data-dismiss="modal">&times;</button>
181
-                </div>
182
-                <div padding-left="20px">
183
-                  <makeOffer
184
-                    name="MakeOffer"
185
-                    :isMakeOffer="true"
186
-                    :isProperty="false"
187
-                    :item="{resort: resort.prName, unit: week.unit, week: week.week, module: week.module, price: week.price}"
188
-                  />
143
+          <div class="col-md-12">
144
+            <div id="myModal" class="modal fade" role="dialog">
145
+              <div class="modal-dialog modal-lg">
146
+                <!-- Modal content-->
147
+                <div class="modal-content">
148
+                  <div class="modal-header">
149
+                    <button type="button" class="close" data-dismiss="modal">&times;</button>
150
+                  </div>
151
+                  <div padding-left="20px">
152
+                    <makeOffer
153
+                      name="MakeOffer"
154
+                      :isMakeOffer="true"
155
+                      :isProperty="false"
156
+                      :item="week"
157
+                    />
158
+                  </div>
189
                 </div>
159
                 </div>
190
               </div>
160
               </div>
191
             </div>
161
             </div>
223
       'image2',
193
       'image2',
224
       'image3',
194
       'image3',
225
     ]),
195
     ]),
226
-    ...mapState('week', ['week', 'contactDetails']),
196
+    ...mapState('week', ['week']),
227
   },
197
   },
228
   methods: {
198
   methods: {
229
     ...mapActions('resort', ['initResort']),
199
     ...mapActions('resort', ['initResort']),

+ 36
- 17
src/components/timeshare/sell/sellPage.vue View File

95
           <div class="container">
95
           <div class="container">
96
             <div class="col-md-12" style="text-align:left">
96
             <div class="col-md-12" style="text-align:left">
97
               <div class="form-group row">
97
               <div class="form-group row">
98
+                <div class="col-md-6">
99
+                  <label>Region *</label>
100
+                  <div class="input-group mb-3">
101
+                    <div class="input-group-prepend">
102
+                      <span class="input-group-text" style="color: #60CBEB">
103
+                        <b>R</b>
104
+                      </span>
105
+                    </div>
106
+                    <select class="form-control" v-model="sellItem.region" @change="regionChange()">
107
+                      <option
108
+                        v-for="(region, r) in regions"
109
+                        :key="r"
110
+                        :value="region"
111
+                      >{{region.regionName}}</option>
112
+                    </select>
113
+                  </div>
114
+                </div>
98
                 <div class="col-md-6">
115
                 <div class="col-md-6">
99
                   <label for="Resort Name">Resort Name *</label>
116
                   <label for="Resort Name">Resort Name *</label>
100
                   <div class="input-group mb-3">
117
                   <div class="input-group mb-3">
250
                   </div>
267
                   </div>
251
                 </div>
268
                 </div>
252
               </div>
269
               </div>
253
-              <div class="form-group row">
254
-                <div class="col-md-12">
255
-                  <label for="Owner">Owner *</label>
256
-                  <div class="input-group mb-3">
257
-                    <div class="input-group-prepend">
258
-                      <span class="input-group-text" style="color: #60CBEB">
259
-                        <b>O</b>
260
-                      </span>
261
-                    </div>
262
-                    <input class="form-control" type="text" name="owner" v-model="sellItem.owner" />
263
-                  </div>
264
-                </div>
265
-              </div>
266
 
270
 
267
               <div class="form-group row">
271
               <div class="form-group row">
268
                 <div class="col-md-6">
272
                 <div class="col-md-6">
476
                   type="number"
480
                   type="number"
477
                   step="any"
481
                   step="any"
478
                   name="sellingPrice"
482
                   name="sellingPrice"
479
-                  v-model="sellItem.sellingPrice"
483
+                  v-model="sellItem.sellPrice"
480
                 />
484
                 />
481
               </div>
485
               </div>
482
             </div>
486
             </div>
516
             </div>
520
             </div>
517
           </div>
521
           </div>
518
 
522
 
519
-          <button type="submit" class="btn btn-b-n btn-lg">Submit</button>
523
+          <div class="btn btn-b-n btn-lg" @click="submitSale()">Submit</div>
524
+
520
           <hr />
525
           <hr />
521
-          {{sellItem}}
526
+          <h1>{{result}}</h1>
522
           <hr />
527
           <hr />
523
 
528
 
524
           <p>* A listing fee of R380 including VAT is payable to list your timeshare week/module on the Uni-Vate website</p>
529
           <p>* A listing fee of R380 including VAT is payable to list your timeshare week/module on the Uni-Vate website</p>
551
       'regions',
556
       'regions',
552
       'detailedRegion',
557
       'detailedRegion',
553
       'seasons',
558
       'seasons',
559
+      'result',
554
       'resortBedrooms',
560
       'resortBedrooms',
555
       'maxSleep',
561
       'maxSleep',
556
       'bankedEntities',
562
       'bankedEntities',
563
     },
569
     },
564
   },
570
   },
565
   methods: {
571
   methods: {
572
+    submitSale() {
573
+      this.saveWeek(this.sellItem);
574
+    },
566
     previewFiles(event) {
575
     previewFiles(event) {
567
       console.log(event.target.files);
576
       console.log(event.target.files);
568
     },
577
     },
582
       this.sellItem.currentYearBanked = !this.sellItem.currentYearBanked;
591
       this.sellItem.currentYearBanked = !this.sellItem.currentYearBanked;
583
     },
592
     },
584
     resortChange() {
593
     resortChange() {
594
+      this.onResortChange({
595
+        resortName: this.sellItem.resort.resortName,
596
+        resortCode: this.sellItem.resort.resortCode,
597
+      });
598
+
585
       if (this.sellItem && this.sellItem.resort === 'Other') {
599
       if (this.sellItem && this.sellItem.resort === 'Other') {
586
         this.sellItem.otherResortName = undefined;
600
         this.sellItem.otherResortName = undefined;
587
         this.sellItem.otherResort = true;
601
         this.sellItem.otherResort = true;
590
         this.sellItem.otherResort = false;
604
         this.sellItem.otherResort = false;
591
       }
605
       }
592
     },
606
     },
593
-    ...mapActions('timeshare', ['initTimeshare']),
607
+    regionChange() {
608
+      this.sellItem.regionId = this.sellItem.region
609
+        ? this.sellItem.region.id
610
+        : 1;
611
+    },
612
+    ...mapActions('timeshare', ['initTimeshare', 'onResortChange', 'saveWeek']),
594
   },
613
   },
595
 };
614
 };
596
 </script>
615
 </script>

+ 1
- 9
src/main.js View File

38
   return `R ${formatter.format(value)}`;
38
   return `R ${formatter.format(value)}`;
39
 });
39
 });
40
 
40
 
41
-const myPad = function (value, pattern) {
42
-  const val = '' + value;
43
-  return pattern.substring(0, pattern.length - val.length) + val;
44
-};
45
-
46
-Vue.filter('toDate', (value) => {
47
-  const date = new Date(value);
48
-  return `${date.getFullYear()}/${myPad(date.getMonth(), '00')}/${myPad(date.getDay(), '00')}`;
49
-});
41
+Vue.filter('toDate', value => value.substring(0, value.length > 9 ? 10 : value.length));
50
 
42
 
51
 new Vue({
43
 new Vue({
52
   render: h => h(App),
44
   render: h => h(App),

+ 12
- 3
src/router/index.js View File

40
 
40
 
41
 import MakeOffer from '../components/processFlow/makeOffer.vue';
41
 import MakeOffer from '../components/processFlow/makeOffer.vue';
42
 import Offer from '../components/processFlow/offers.vue';
42
 import Offer from '../components/processFlow/offers.vue';
43
+import searchLog from '../components/admin/logs/SearchLogs.vue';
43
 // import store from '../store';
44
 // import store from '../store';
44
 
45
 
45
 Vue.use(Router);
46
 Vue.use(Router);
46
 
47
 
47
 export default new Router({
48
 export default new Router({
48
-  scrollBehavior (to, from, savedPosition) {
49
-    return { x: 0, y: 0 }
49
+  scrollBehavior(to, from, savedPosition) {
50
+    return {
51
+      x: 0,
52
+      y: 0,
53
+    };
50
   },
54
   },
51
   routes: [{
55
   routes: [{
52
     path: '/',
56
     path: '/',
99
     component: PropertyPage,
103
     component: PropertyPage,
100
   },
104
   },
101
   {
105
   {
102
-    path: '/property/:propertyType/search',
106
+    path: '/property/:propertyUsageType/search',
103
     name: 'PropertySearch',
107
     name: 'PropertySearch',
104
     component: PropertySearch,
108
     component: PropertySearch,
105
   },
109
   },
220
     name: 'TimeshareSearch',
224
     name: 'TimeshareSearch',
221
     component: TimeshareSearch,
225
     component: TimeshareSearch,
222
   },
226
   },
227
+  {
228
+    path: '/searchLog',
229
+    name: 'SearchLog',
230
+    component: searchLog,
231
+  },
223
   ],
232
   ],
224
 });
233
 });

+ 2
- 0
src/store/index.js View File

18
 import Bid from './modules/processFlow/bid';
18
 import Bid from './modules/processFlow/bid';
19
 import Authentication from './modules/user/authentication';
19
 import Authentication from './modules/user/authentication';
20
 import PropertySearch from './modules/property/propertySearch';
20
 import PropertySearch from './modules/property/propertySearch';
21
+import SearchLog from './modules/logs/searchLog';
21
 
22
 
22
 Vue.use(Vuex);
23
 Vue.use(Vuex);
23
 /* eslint no-param-reassign: ["error", { "props": false }] */
24
 /* eslint no-param-reassign: ["error", { "props": false }] */
41
     bid: Bid,
42
     bid: Bid,
42
     authentication: Authentication,
43
     authentication: Authentication,
43
     propertySearch: PropertySearch,
44
     propertySearch: PropertySearch,
45
+    searchLog: SearchLog,
44
   },
46
   },
45
 });
47
 });

+ 24
- 0
src/store/modules/logs/searchLog.js View File

1
+// api/searchLog/property
2
+import axios from 'axios';
3
+
4
+export default {
5
+  namespaced: true,
6
+  state: {
7
+    propertySearch: {},
8
+  },
9
+  mutations: {
10
+    updateSearch(state, data) {
11
+      state.propertySearch = [];
12
+      state.propertySearch = data;
13
+    },
14
+  },
15
+  getters: {},
16
+  actions: {
17
+    getPropertySearchLogs({ commit }) {
18
+      axios
19
+        .get('/api/searchLog/property')
20
+        .then(result => commit('updateSearch', result.data))
21
+        .catch(console.error);
22
+    },
23
+  },
24
+};

+ 3
- 1
src/store/modules/property/property.js View File

55
       state.propertyFields = fields;
55
       state.propertyFields = fields;
56
     },
56
     },
57
     updateCurrentProperty(state, property) {
57
     updateCurrentProperty(state, property) {
58
-      state.properties.push(property);
58
+      if (state.properties) {
59
+        state.properties.push(property);
60
+      }
59
     },
61
     },
60
     clearProperty(state) {
62
     clearProperty(state) {
61
       state.property = {
63
       state.property = {

+ 1
- 1
src/store/modules/property/propertyLists.js View File

14
   actions: {
14
   actions: {
15
     getProperties({ commit }, item) {
15
     getProperties({ commit }, item) {
16
       axios
16
       axios
17
-        .get(`/api/property/${item.propertyType}/${item.user}`)
17
+        .get(`/api/property/${item.propertyType}/All`) // .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
     },

+ 7
- 2
src/store/modules/property/propertySearch.js View File

39
     getPropertySearchObject({ commit }) {
39
     getPropertySearchObject({ commit }) {
40
       const search = {
40
       const search = {
41
         userID: 0,
41
         userID: 0,
42
-        keyword: '',
42
+        keyword: 'All',
43
         salesType: 'Sale',
43
         salesType: 'Sale',
44
         propertyUsageType: 'All',
44
         propertyUsageType: 'All',
45
         propertyType: 'All',
45
         propertyType: 'All',
50
       commit('setPropertySearch', search);
50
       commit('setPropertySearch', search);
51
     },
51
     },
52
     searchProperties({ commit }, item) {
52
     searchProperties({ commit }, item) {
53
+      if (item.keyword === '') {
54
+        item.keyword = 'All';
55
+      }
53
       axios
56
       axios
54
-        .post('/api/Property/Search', item)
57
+        .get(
58
+          `/api/Property/Search/${item.userID}/${item.keyword}/${item.salesType}/${item.propertyUsageType}/${item.propertyType}/${item.province}/${item.city}/${item.suburb}`,
59
+        )
55
         .then(result => commit('updateSearch', result.data))
60
         .then(result => commit('updateSearch', result.data))
56
         .catch(console.error);
61
         .catch(console.error);
57
     },
62
     },

+ 25
- 5
src/store/modules/timeshare/timeshare.js View File

1
 /* eslint-disable guard-for-in */
1
 /* eslint-disable guard-for-in */
2
 /* eslint-disable no-restricted-syntax */
2
 /* eslint-disable no-restricted-syntax */
3
 import axios from 'axios';
3
 import axios from 'axios';
4
+import _ from 'lodash';
4
 import MyData from '../../../assets/myData';
5
 import MyData from '../../../assets/myData';
5
 import MaritalStatus from '../../../assets/staticData/maritalStatus';
6
 import MaritalStatus from '../../../assets/staticData/maritalStatus';
6
 
7
 
17
     agencies: [],
18
     agencies: [],
18
     agents: [],
19
     agents: [],
19
     maritalStatus: MaritalStatus,
20
     maritalStatus: MaritalStatus,
21
+    result: undefined,
20
     sellItem: {
22
     sellItem: {
21
       referedByAgent: false,
23
       referedByAgent: false,
22
       agentId: undefined,
24
       agentId: undefined,
24
       otherResort: false,
26
       otherResort: false,
25
       otherResortName: undefined,
27
       otherResortName: undefined,
26
       resort: undefined,
28
       resort: undefined,
29
+      resortCode: undefined,
30
+      resortName: undefined,
27
       regionId: undefined,
31
       regionId: undefined,
28
       season: undefined,
32
       season: undefined,
29
       module: undefined,
33
       module: undefined,
40
       originalPurchaseDate: undefined,
44
       originalPurchaseDate: undefined,
41
       arrivalDate: undefined,
45
       arrivalDate: undefined,
42
       departureDate: undefined,
46
       departureDate: undefined,
43
-      sellingPrice: undefined,
47
+      sellPrice: undefined,
44
       agentCommission: undefined,
48
       agentCommission: undefined,
45
       mandate: undefined,
49
       mandate: undefined,
46
       status: undefined,
50
       status: undefined,
100
     addDetailedRegion(state, detailedRegion) {
104
     addDetailedRegion(state, detailedRegion) {
101
       state.detailedRegion.push(detailedRegion);
105
       state.detailedRegion.push(detailedRegion);
102
     },
106
     },
107
+    changeResort(state, resort) {
108
+      for (const reg in state.detailedRegion) {
109
+        const region = state.detailedRegion[reg];
110
+        if (_.find(region.children, x => x.resortCode === resort.resortCode)) {
111
+          state.regionId = reg;
112
+          break;
113
+        }
114
+      }
115
+      state.sellItem.resortCode = resort.resortCode;
116
+      state.sellItem.resortName = resort.resortName;
117
+    },
118
+    displayResult(state) {
119
+      state.result = 'Week has been added ^-^';
120
+    },
103
   },
121
   },
104
   getters: {
122
   getters: {
105
 
123
 
129
     getAgencies({
147
     getAgencies({
130
       commit,
148
       commit,
131
     }) {
149
     }) {
132
-      console.log(123);
133
       axios
150
       axios
134
         .get('/api/agency')
151
         .get('/api/agency')
135
         .then(result => commit('setAgency', result.data))
152
         .then(result => commit('setAgency', result.data))
185
         }
202
         }
186
       }
203
       }
187
     },
204
     },
205
+    onResortChange({
206
+      commit,
207
+    }, resort) {
208
+      commit('changeResort', resort);
209
+    },
188
     saveWeek({
210
     saveWeek({
189
       commit,
211
       commit,
190
     }, week) {
212
     }, week) {
191
       axios
213
       axios
192
         .post('/api/timeshareweek', week)
214
         .post('/api/timeshareweek', week)
193
-        .then(result => commit('addDetailedRegion', {
194
-          week,
195
-        }))
215
+        .then(result => commit('displayResult'))
196
         .catch(console.error);
216
         .catch(console.error);
197
     },
217
     },
198
   },
218
   },

+ 7
- 22
src/store/modules/timeshare/week.js View File

1
+/* eslint-disable prefer-destructuring */
1
 /* eslint-disable no-restricted-syntax */
2
 /* eslint-disable no-restricted-syntax */
2
 /* eslint-disable guard-for-in */
3
 /* eslint-disable guard-for-in */
3
 import axios from 'axios';
4
 import axios from 'axios';
5
 export default {
6
 export default {
6
   namespaced: true,
7
   namespaced: true,
7
   state: {
8
   state: {
8
-    week: {
9
-      id: '',
10
-      unit: '',
11
-      week: '',
12
-      module: '',
13
-      price: '',
14
-      currentLevy: '',
15
-    },
16
-    contactDetails: {
17
-      name: '',
18
-      number: '',
19
-      email: '',
20
-    },
9
+    week: undefined,
21
   },
10
   },
22
   mutations: {
11
   mutations: {
23
     setWeek(state, week) {
12
     setWeek(state, week) {
24
-      state.week = week;
13
+      if (week.length > 0) {
14
+        state.week = week[0];
15
+      }
25
     },
16
     },
26
   },
17
   },
27
   getters: {},
18
   getters: {},
29
     initWeek({
20
     initWeek({
30
       commit,
21
       commit,
31
     }, weekId) {
22
     }, weekId) {
32
-      commit('setWeek', {
33
-        id: weekId,
34
-        unit: '359',
35
-        week: 'N18',
36
-        module: '359/N18 River View',
37
-        price: 85000,
38
-        currentLevy: 5455,
39
-      });
23
+      axios.get(`/api/timeshareweek/${weekId}`).then(r => commit('setWeek', r.data)).catch(console
24
+        .error);
40
     },
25
     },
41
   },
26
   },
42
 };
27
 };

Loading…
Cancel
Save