LeneS 5 年前
父节点
当前提交
475b585de7

+ 5
- 0
package-lock.json 查看文件

@@ -7793,6 +7793,11 @@
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 7801
     "move-concurrently": {
7797 7802
       "version": "1.0.1",
7798 7803
       "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz",

+ 1
- 0
package.json 查看文件

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

+ 83
- 0
src/components/admin/logs/SearchLogs.vue 查看文件

@@ -0,0 +1,83 @@
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 查看文件

@@ -21,7 +21,7 @@
21 21
         <div class="form-group row">
22 22
           <div class="col-md-6 col-lg-5 section-md-t3">
23 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 25
             </div>
26 26
           </div>
27 27
         </div>

+ 9
- 2
src/components/property/propertyList.vue 查看文件

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

+ 29
- 56
src/components/property/propertySearchPage.vue 查看文件

@@ -47,7 +47,12 @@
47 47
         </div>
48 48
         <div class="col-md-4">
49 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 56
           </p>
52 57
         </div>
53 58
       </div>
@@ -130,7 +135,6 @@
130 135
   </div>
131 136
 </template>
132 137
 <script>
133
-import { mkdir } from 'fs';
134 138
 import { mapState, mapActions } from 'vuex';
135 139
 import propertyCard from './propertyCard.vue';
136 140
 
@@ -179,64 +183,33 @@ export default {
179 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 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 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 213
       return null;
241 214
     },
242 215
   },

+ 6
- 6
src/components/property/propertyeditPage.vue 查看文件

@@ -355,12 +355,12 @@ export default {
355 355
 
356 356
       setTimeout(
357 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 364
         3000,
365 365
       );
366 366
     },

+ 8
- 8
src/components/shared/lightBoxGallery.vue 查看文件

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

+ 5
- 1
src/components/shared/navBar.vue 查看文件

@@ -177,6 +177,11 @@
177 177
                   class="dropdown-item cursor-pointer"
178 178
                   @click="routerGoTo('/propertyTypes/list')"
179 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 185
               </div>
181 186
             </li>
182 187
             <li class="nav-item dropdown">
@@ -245,7 +250,6 @@ export default {
245 250
     ...mapActions('authentication', ['logout']),
246 251
 
247 252
     routerGoTo(goTo) {
248
-      console.log(goTo);
249 253
       this.$emit('routerGoTo', goTo);
250 254
     },
251 255
   },

+ 2
- 2
src/components/shared/searchTab.vue 查看文件

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

+ 6
- 28
src/components/timeshare/buy/weekListComponent.vue 查看文件

@@ -29,30 +29,7 @@
29 29
             <!-- <td>{{item.status ? item.status.description : ''}}</td> -->
30 30
             <td>
31 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 33
               </div>
57 34
             </td>
58 35
           </tr>
@@ -71,15 +48,12 @@
71 48
 </template>
72 49
 <script>
73 50
 import { mapState, mapActions, mapGetters } from 'vuex';
74
-import makeOffer from '../../processFlow/makeOffer.vue';
75 51
 
76 52
 export default {
77 53
   props: {
78 54
     resortCode: undefined,
79 55
   },
80
-  components: {
81
-    makeOffer,
82
-  },
56
+  components: {},
83 57
   computed: {
84 58
     ...mapState('weekList', ['weeks']),
85 59
     ...mapGetters({
@@ -93,6 +67,10 @@ export default {
93 67
     this.getWeeks();
94 68
   },
95 69
   methods: {
70
+    View(item) {
71
+      console.log(item);
72
+      this.$router.push(`/resort/${item.resort.resortCode}/${item.id}`);
73
+    },
96 74
     ...mapActions('weekList', ['getWeeks', 'applyResortFilter']),
97 75
   },
98 76
 };

+ 0
- 1
src/components/timeshare/resort/resortPage.vue 查看文件

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

+ 26
- 56
src/components/timeshare/resort/unitPage.vue 查看文件

@@ -8,7 +8,10 @@
8 8
     <div class="row">
9 9
       <div class="col-md-12 col-lg-8">
10 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 15
         </div>
13 16
         <br />
14 17
       </div>
@@ -41,7 +44,7 @@
41 44
             </ul>
42 45
           </div>
43 46
         </div>
44
-        <div class="col-md-6">
47
+        <div class="col-md-6" v-if="week">
45 48
           <form
46 49
             id="mainForm"
47 50
             method="POST"
@@ -66,7 +69,7 @@
66 69
                     type="text"
67 70
                     id="resort"
68 71
                     name="resortunit"
69
-                    :value="week.unit"
72
+                    :value="week ? week.unitNumber : ''"
70 73
                     disabled
71 74
                   />
72 75
                 </div>
@@ -84,7 +87,7 @@
84 87
                     type="text"
85 88
                     id="week"
86 89
                     name="resortWeek"
87
-                    :value="week.module"
90
+                    :value="week ? week.weekNumber : ''"
88 91
                     disabled
89 92
                   />
90 93
                 </div>
@@ -103,7 +106,7 @@
103 106
                     type="text"
104 107
                     id="levy"
105 108
                     name="levy"
106
-                    :value="formatPrice(week.currentLevy)"
109
+                    :value="formatPrice(week ? week.levyAmount : 0)"
107 110
                     disabled
108 111
                   />
109 112
                 </div>
@@ -115,7 +118,7 @@
115 118
                   <div style="width: 260px; height: 70px; border-style: solid; color: #60CBEB;">
116 119
                     <!-- <div class="card-title-c align-self-center"> -->
117 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 122
                     </a>
120 123
                     <!-- </div> -->
121 124
                   </div>
@@ -124,44 +127,9 @@
124 127
               </div>
125 128
             </div>
126 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 130
           </form>
161 131
           <br />
162 132
 
163
-          <button class="btn btn-b-c even-width mr-auto" type="submit">Enquire Now</button>
164
-
165 133
           <!-- <a
166 134
               class="btn btn-b-n even-width mr-auto"
167 135
               href="/share-transfer-initiation-for-purchaser/"
@@ -172,20 +140,22 @@
172 140
             data-toggle="modal"
173 141
             data-target="#myModal"
174 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 159
                 </div>
190 160
               </div>
191 161
             </div>
@@ -223,7 +193,7 @@ export default {
223 193
       'image2',
224 194
       'image3',
225 195
     ]),
226
-    ...mapState('week', ['week', 'contactDetails']),
196
+    ...mapState('week', ['week']),
227 197
   },
228 198
   methods: {
229 199
     ...mapActions('resort', ['initResort']),

+ 36
- 17
src/components/timeshare/sell/sellPage.vue 查看文件

@@ -95,6 +95,23 @@
95 95
           <div class="container">
96 96
             <div class="col-md-12" style="text-align:left">
97 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 115
                 <div class="col-md-6">
99 116
                   <label for="Resort Name">Resort Name *</label>
100 117
                   <div class="input-group mb-3">
@@ -250,19 +267,6 @@
250 267
                   </div>
251 268
                 </div>
252 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 271
               <div class="form-group row">
268 272
                 <div class="col-md-6">
@@ -476,7 +480,7 @@
476 480
                   type="number"
477 481
                   step="any"
478 482
                   name="sellingPrice"
479
-                  v-model="sellItem.sellingPrice"
483
+                  v-model="sellItem.sellPrice"
480 484
                 />
481 485
               </div>
482 486
             </div>
@@ -516,9 +520,10 @@
516 520
             </div>
517 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 525
           <hr />
521
-          {{sellItem}}
526
+          <h1>{{result}}</h1>
522 527
           <hr />
523 528
 
524 529
           <p>* A listing fee of R380 including VAT is payable to list your timeshare week/module on the Uni-Vate website</p>
@@ -551,6 +556,7 @@ export default {
551 556
       'regions',
552 557
       'detailedRegion',
553 558
       'seasons',
559
+      'result',
554 560
       'resortBedrooms',
555 561
       'maxSleep',
556 562
       'bankedEntities',
@@ -563,6 +569,9 @@ export default {
563 569
     },
564 570
   },
565 571
   methods: {
572
+    submitSale() {
573
+      this.saveWeek(this.sellItem);
574
+    },
566 575
     previewFiles(event) {
567 576
       console.log(event.target.files);
568 577
     },
@@ -582,6 +591,11 @@ export default {
582 591
       this.sellItem.currentYearBanked = !this.sellItem.currentYearBanked;
583 592
     },
584 593
     resortChange() {
594
+      this.onResortChange({
595
+        resortName: this.sellItem.resort.resortName,
596
+        resortCode: this.sellItem.resort.resortCode,
597
+      });
598
+
585 599
       if (this.sellItem && this.sellItem.resort === 'Other') {
586 600
         this.sellItem.otherResortName = undefined;
587 601
         this.sellItem.otherResort = true;
@@ -590,7 +604,12 @@ export default {
590 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 615
 </script>

+ 1
- 9
src/main.js 查看文件

@@ -38,15 +38,7 @@ Vue.filter('toCurrency', (value) => {
38 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 43
 new Vue({
52 44
   render: h => h(App),

+ 12
- 3
src/router/index.js 查看文件

@@ -40,13 +40,17 @@ import PrivacyPolicy from '../components/misc/privacyPolicyPage.vue';
40 40
 
41 41
 import MakeOffer from '../components/processFlow/makeOffer.vue';
42 42
 import Offer from '../components/processFlow/offers.vue';
43
+import searchLog from '../components/admin/logs/SearchLogs.vue';
43 44
 // import store from '../store';
44 45
 
45 46
 Vue.use(Router);
46 47
 
47 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 55
   routes: [{
52 56
     path: '/',
@@ -99,7 +103,7 @@ export default new Router({
99 103
     component: PropertyPage,
100 104
   },
101 105
   {
102
-    path: '/property/:propertyType/search',
106
+    path: '/property/:propertyUsageType/search',
103 107
     name: 'PropertySearch',
104 108
     component: PropertySearch,
105 109
   },
@@ -220,5 +224,10 @@ export default new Router({
220 224
     name: 'TimeshareSearch',
221 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 查看文件

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

+ 24
- 0
src/store/modules/logs/searchLog.js 查看文件

@@ -0,0 +1,24 @@
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 查看文件

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

+ 1
- 1
src/store/modules/property/propertyLists.js 查看文件

@@ -14,7 +14,7 @@ export default {
14 14
   actions: {
15 15
     getProperties({ commit }, item) {
16 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 18
         .then(result => commit('setProperties', result.data))
19 19
         .catch(console.error);
20 20
     },

+ 7
- 2
src/store/modules/property/propertySearch.js 查看文件

@@ -39,7 +39,7 @@ export default {
39 39
     getPropertySearchObject({ commit }) {
40 40
       const search = {
41 41
         userID: 0,
42
-        keyword: '',
42
+        keyword: 'All',
43 43
         salesType: 'Sale',
44 44
         propertyUsageType: 'All',
45 45
         propertyType: 'All',
@@ -50,8 +50,13 @@ export default {
50 50
       commit('setPropertySearch', search);
51 51
     },
52 52
     searchProperties({ commit }, item) {
53
+      if (item.keyword === '') {
54
+        item.keyword = 'All';
55
+      }
53 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 60
         .then(result => commit('updateSearch', result.data))
56 61
         .catch(console.error);
57 62
     },

+ 25
- 5
src/store/modules/timeshare/timeshare.js 查看文件

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

+ 7
- 22
src/store/modules/timeshare/week.js 查看文件

@@ -1,3 +1,4 @@
1
+/* eslint-disable prefer-destructuring */
1 2
 /* eslint-disable no-restricted-syntax */
2 3
 /* eslint-disable guard-for-in */
3 4
 import axios from 'axios';
@@ -5,23 +6,13 @@ import axios from 'axios';
5 6
 export default {
6 7
   namespaced: true,
7 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 11
   mutations: {
23 12
     setWeek(state, week) {
24
-      state.week = week;
13
+      if (week.length > 0) {
14
+        state.week = week[0];
15
+      }
25 16
     },
26 17
   },
27 18
   getters: {},
@@ -29,14 +20,8 @@ export default {
29 20
     initWeek({
30 21
       commit,
31 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
 };

正在加载...
取消
保存