Przeglądaj źródła

Janneke testing feedback

master
George Williams 5 lat temu
rodzic
commit
93f642c59b

+ 1
- 1
.eslintrc.js Wyświetl plik

5
   },
5
   },
6
   extends: ["plugin:vue/essential", "@vue/airbnb"],
6
   extends: ["plugin:vue/essential", "@vue/airbnb"],
7
   rules: {
7
   rules: {
8
-    'no-param-reassign': 0,
8
+    "no-param-reassign": 0,
9
     "linebreak-style": 0,
9
     "linebreak-style": 0,
10
     "no-console": process.env.NODE_ENV === "production" ? "error" : "off",
10
     "no-console": process.env.NODE_ENV === "production" ? "error" : "off",
11
     "no-debugger": process.env.NODE_ENV === "production" ? "error" : "off"
11
     "no-debugger": process.env.NODE_ENV === "production" ? "error" : "off"

+ 13
- 13
package-lock.json Wyświetl plik

2419
       "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=",
2419
       "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=",
2420
       "dev": true
2420
       "dev": true
2421
     },
2421
     },
2422
-    "browser-downloads": {
2423
-      "version": "0.2.0",
2424
-      "resolved": "https://registry.npmjs.org/browser-downloads/-/browser-downloads-0.2.0.tgz",
2425
-      "integrity": "sha512-0tQntpixIPo8ZuOufMjPbZIp2jZMvCUz00rCiaf/T3LzLxcbt6j0r6Ef8Ao3lNP3bYh/ibLoWVoLCJ7SCvxrSA=="
2426
-    },
2427
     "browserify-aes": {
2422
     "browserify-aes": {
2428
       "version": "1.2.0",
2423
       "version": "1.2.0",
2429
       "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz",
2424
       "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz",
4023
       "integrity": "sha512-YXQl1DSa4/PQyRfgrv6aoNjhasp/p4qs9FjJ4q4cQk+8m4r6k4ZSiEyytKG8f8W9gi8WsQtIObNmKd+tMzNTmA==",
4018
       "integrity": "sha512-YXQl1DSa4/PQyRfgrv6aoNjhasp/p4qs9FjJ4q4cQk+8m4r6k4ZSiEyytKG8f8W9gi8WsQtIObNmKd+tMzNTmA==",
4024
       "dev": true
4019
       "dev": true
4025
     },
4020
     },
4021
+    "downloadjs": {
4022
+      "version": "1.4.7",
4023
+      "resolved": "https://registry.npmjs.org/downloadjs/-/downloadjs-1.4.7.tgz",
4024
+      "integrity": "sha1-9p+W+UDg0FU9rCkROYZaPNAQHjw="
4025
+    },
4026
     "duplexer": {
4026
     "duplexer": {
4027
       "version": "0.1.1",
4027
       "version": "0.1.1",
4028
       "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz",
4028
       "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz",
11914
         "vue": "^2.5.17"
11914
         "vue": "^2.5.17"
11915
       }
11915
       }
11916
     },
11916
     },
11917
-    "vue-excel-export": {
11918
-      "version": "0.1.3",
11919
-      "resolved": "https://registry.npmjs.org/vue-excel-export/-/vue-excel-export-0.1.3.tgz",
11920
-      "integrity": "sha512-vjCKrVocZ9Q4Y1BJsuDiLR9E9x97vHY+ew7oSigxg7WDh6AsTbH5v4TFpCD65WwYy2jt1tQU6fsAIpKjVOXibw==",
11921
-      "requires": {
11922
-        "browser-downloads": "^0.2.0"
11923
-      }
11924
-    },
11925
     "vue-hot-reload-api": {
11917
     "vue-hot-reload-api": {
11926
       "version": "2.3.3",
11918
       "version": "2.3.3",
11927
       "resolved": "https://registry.npmjs.org/vue-hot-reload-api/-/vue-hot-reload-api-2.3.3.tgz",
11919
       "resolved": "https://registry.npmjs.org/vue-hot-reload-api/-/vue-hot-reload-api-2.3.3.tgz",
11928
       "integrity": "sha512-KmvZVtmM26BQOMK1rwUZsrqxEGeKiYSZGA7SNWE6uExx8UX/cj9hq2MRV/wWC3Cq6AoeDGk57rL9YMFRel/q+g==",
11920
       "integrity": "sha512-KmvZVtmM26BQOMK1rwUZsrqxEGeKiYSZGA7SNWE6uExx8UX/cj9hq2MRV/wWC3Cq6AoeDGk57rL9YMFRel/q+g==",
11929
       "dev": true
11921
       "dev": true
11930
     },
11922
     },
11923
+    "vue-json-excel": {
11924
+      "version": "0.2.98",
11925
+      "resolved": "https://registry.npmjs.org/vue-json-excel/-/vue-json-excel-0.2.98.tgz",
11926
+      "integrity": "sha512-hPA3/cOe5nGbEZiJyfpdBIdqBExxF6EhMhpX6vC654PYbTVzdzp7O9ZsC1AgqbgRDR8VjzAaPaEeHg2vGS88FQ==",
11927
+      "requires": {
11928
+        "downloadjs": "^1.4.7"
11929
+      }
11930
+    },
11931
     "vue-loader": {
11931
     "vue-loader": {
11932
       "version": "15.7.0",
11932
       "version": "15.7.0",
11933
       "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.7.0.tgz",
11933
       "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.7.0.tgz",

+ 1
- 1
package.json Wyświetl plik

26
     "vue": "^2.6.10",
26
     "vue": "^2.6.10",
27
     "vue-carousel": "^0.18.0",
27
     "vue-carousel": "^0.18.0",
28
     "vue-eva-icons": "^1.1.1",
28
     "vue-eva-icons": "^1.1.1",
29
-    "vue-excel-export": "^0.1.3",
29
+    "vue-json-excel": "^0.2.98",
30
     "vue-router": "^3.0.7",
30
     "vue-router": "^3.0.7",
31
     "vue-trix": "^1.0.0",
31
     "vue-trix": "^1.0.0",
32
     "vue2-editor": "^2.10.2",
32
     "vue2-editor": "^2.10.2",

+ 42
- 60
src/components/admin/logs/SearchLogs.vue Wyświetl plik

2
   <!-- eslint-disable max-len -->
2
   <!-- eslint-disable max-len -->
3
   <div>
3
   <div>
4
     <div class="container">
4
     <div class="container">
5
-      <div class="container">
6
-        <br />
7
-        <br />
8
-        <br />
9
-        <br />
10
-        <div class="row">
11
-          <div class="col-md-12 col-lg-8">
12
-            <div class="title-box-d">
13
-              <h1 class="title-d" style="text-align:left; font-size: 250%">Search Log</h1>
14
-            </div>
5
+      <br />
6
+      <div class="row">
7
+        <div class="col-md-12 col-lg-8">
8
+          <div class="title-box-d">
9
+            <h1 class="title-d" style="text-align:left; font-size: 250%">Search Log</h1>
15
           </div>
10
           </div>
16
         </div>
11
         </div>
17
       </div>
12
       </div>
23
         </div>
18
         </div>
24
         <div class="col-md-3">
19
         <div class="col-md-3">
25
           <select class="form-control" name="fields" id="fields" v-model="filter.by">
20
           <select class="form-control" name="fields" id="fields" v-model="filter.by">
26
-            <option v-for="(item, i) in fields" :key="i">{{item}}</option>
21
+            <option v-for="(item, i) in fields" :key="i">{{ item }}</option>
27
           </select>
22
           </select>
28
         </div>
23
         </div>
29
         <div class="col-md-8 text-left">
24
         <div class="col-md-8 text-left">
38
         </div>
33
         </div>
39
       </div>
34
       </div>
40
     </div>
35
     </div>
36
+    <div class="container">
37
+      <listView
38
+        :items="list"
39
+        :showNew="false"
40
+        :editable="false"
41
+        :deleteable="false"
42
+        :showColumnChooser="false"
43
+        :hideSearch="true"
44
+        :sortKey="'date'"
45
+      />
46
+    </div>
41
     <div class="container">
47
     <div class="container">
42
       <div class="form-group row">
48
       <div class="form-group row">
43
         <div class="col-md-12" align="right">
49
         <div class="col-md-12" align="right">
44
-          <export-excel
50
+          <JsonExcel
45
             class="btn btn-b-n"
51
             class="btn btn-b-n"
46
             :data="list"
52
             :data="list"
47
             :fields="exportFields"
53
             :fields="exportFields"
48
-            type="csv"
49
-            worksheet="My Worksheet"
50
-            name="SearchLog.csv"
54
+            type="xls"
55
+            worksheet="Log"
56
+            name="SearchLog.xls"
51
           >
57
           >
52
             Download
58
             Download
53
             <eva-icon name="download"></eva-icon>
59
             <eva-icon name="download"></eva-icon>
54
-          </export-excel>
60
+          </JsonExcel>
55
         </div>
61
         </div>
56
       </div>
62
       </div>
57
     </div>
63
     </div>
58
-    <div class="container">
59
-      <table class="table table-bordered">
60
-        <thead>
61
-          <tr>
62
-            <th>Date</th>
63
-            <th>Time</th>
64
-            <th>User</th>
65
-            <th>Type</th>
66
-            <th>Field</th>
67
-            <th>Value</th>
68
-          </tr>
69
-        </thead>
70
-        <tbody>
71
-          <tr v-for="(item, i) in list" :key="i">
72
-            <td>{{ formatDate(item.date) }}</td>
73
-            <td>{{ formatTime(item.date) }}</td>
74
-            <td>{{ item.userName }}</td>
75
-            <td>{{ item.type }}</td>
76
-            <td>{{ item.property }}</td>
77
-            <td>{{ item.value }}</td>
78
-          </tr>
79
-        </tbody>
80
-      </table>
81
-    </div>
82
     <br />
64
     <br />
83
   </div>
65
   </div>
84
 </template>
66
 </template>
85
 
67
 
86
 <script>
68
 <script>
87
-import { mapState, mapActions, mapGetters } from 'vuex';
88
-import moment from 'moment';
69
+import { mapState, mapActions, mapGetters } from "vuex";
70
+import JsonExcel from "vue-json-excel";
71
+import listView from "../../shared/listView.vue";
89
 
72
 
90
 export default {
73
 export default {
91
-  name: 'searchLog',
74
+  name: "searchLog",
75
+  components: {
76
+    listView,
77
+    JsonExcel
78
+  },
92
   data() {
79
   data() {
93
     return {
80
     return {
94
       exportFields: {
81
       exportFields: {
95
-        Date: 'date',
96
-        User: 'userName',
97
-        Type: 'type',
98
-        Field: 'property',
99
-        Value: 'value',
100
-      },
82
+        Date: "date",
83
+        Time: "time",
84
+        User: "userName",
85
+        Type: "type",
86
+        Field: "property",
87
+        Value: "value"
88
+      }
101
     };
89
     };
102
   },
90
   },
103
   methods: {
91
   methods: {
104
-    ...mapActions('searchLog', ['getPropertySearchLogs', 'clearFilter']),
105
-    formatDate(value) {
106
-      return moment(String(value)).format('YYYY/MM/DD');
107
-    },
108
-    formatTime(value) {
109
-      return moment(String(value)).format('hh:mm');
110
-    },
92
+    ...mapActions("searchLog", ["getPropertySearchLogs", "clearFilter"])
111
   },
93
   },
112
   mounted() {
94
   mounted() {
113
     this.getPropertySearchLogs();
95
     this.getPropertySearchLogs();
114
   },
96
   },
115
   computed: {
97
   computed: {
116
-    ...mapState('searchLog', ['list', 'fields', 'filter']),
98
+    ...mapState("searchLog", ["list", "fields", "filter"]),
117
     ...mapGetters({
99
     ...mapGetters({
118
-      list: 'searchLog/filterList',
119
-    }),
120
-  },
100
+      list: "searchLog/filterList"
101
+    })
102
+  }
121
 };
103
 };
122
 </script>
104
 </script>

+ 27
- 44
src/components/admin/misc/carouselList.vue Wyświetl plik

9
               <br />
9
               <br />
10
               <h1 class="title-d" style="text-align:left; font-size: 250%">Carousel Items</h1>
10
               <h1 class="title-d" style="text-align:left; font-size: 250%">Carousel Items</h1>
11
             </div>
11
             </div>
12
-            <br />
13
           </div>
12
           </div>
14
         </div>
13
         </div>
15
       </div>
14
       </div>
16
     </div>
15
     </div>
17
     <div class="container">
16
     <div class="container">
18
-      <button type="button" @click="New()" class="btn btn-b-n" style="width: 85px; height:40px;">New</button>
17
+      <listView
18
+        :items="carouselList"
19
+        :showNew="true"
20
+        :deleteable="true"
21
+        :displayColumns="columns"
22
+        :displayFormats="formats"
23
+        @onNew="New"
24
+        @onDelete="Delete"
25
+      />
19
     </div>
26
     </div>
20
-    <div class="container">
21
-      <table class="table table-bordered">
22
-        <thead>
23
-          <tr>
24
-            <th>Image</th>
25
-            <th>Header</th>
26
-            <th>Type</th>
27
-            <th></th>
28
-          </tr>
29
-        </thead>
30
-        <tbody>
31
-          <tr v-for="(item, i) in carouselList" :key="i">
32
-            <td>
33
-              <img :src="item.image" style="height:100px; width:100px; object-fit: cover;" />
34
-            </td>
35
-            <td>{{ item.header }}</td>
36
-            <td v-if="item.propertyId">Property</td>
37
-            <td v-else>Timeshare Week</td>
38
-            <td>
39
-              <button
40
-                type="button"
41
-                @click="Delete(item.id)"
42
-                class="btn"
43
-                style="margin:2px; color: #60CBEB"
44
-              >Delete</button>
45
-            </td>
46
-          </tr>
47
-        </tbody>
48
-      </table>
49
-    </div>
50
-    <br />
51
   </div>
27
   </div>
52
 </template>
28
 </template>
53
 
29
 
54
 <script>
30
 <script>
55
-import { mapState, mapActions } from 'vuex';
31
+import { mapState, mapActions } from "vuex";
32
+import listView from "../../shared/listView.vue";
56
 
33
 
57
 export default {
34
 export default {
58
-  name: 'CarouselList',
35
+  name: "CarouselList",
36
+  components: {
37
+    listView
38
+  },
59
   data() {
39
   data() {
60
-    return {};
40
+    return {
41
+      columns: ["id", "header", "image"],
42
+      formats: ["", "", "image"]
43
+    };
61
   },
44
   },
62
   methods: {
45
   methods: {
63
-    ...mapActions('carousel', ['getCarouselList', 'deleteCarousel']),
46
+    ...mapActions("carousel", ["getCarouselList", "deleteCarousel"]),
64
     New() {
47
     New() {
65
-      this.$router.push('/carousel/details/0');
48
+      this.$router.push("/carousel/details/0");
66
     },
49
     },
67
     Edit(itemID) {
50
     Edit(itemID) {
68
       this.$router.push({
51
       this.$router.push({
69
-        path: `/carousel/details/${itemID}`,
52
+        path: `/carousel/details/${itemID}`
70
       });
53
       });
71
     },
54
     },
72
-    Delete(id) {
73
-      this.deleteCarousel(id);
74
-    },
55
+    Delete(item) {
56
+      this.deleteCarousel(item.id);
57
+    }
75
   },
58
   },
76
   mounted() {
59
   mounted() {
77
     this.getCarouselList();
60
     this.getCarouselList();
78
   },
61
   },
79
   computed: {
62
   computed: {
80
-    ...mapState('carousel', ['carouselList']),
81
-  },
63
+    ...mapState("carousel", ["carouselList"])
64
+  }
82
 };
65
 };
83
 </script>
66
 </script>

+ 30
- 28
src/components/admin/misc/carouselSearch.vue Wyświetl plik

18
               :showNew="false"
18
               :showNew="false"
19
               @onRowClick="onRowClick"
19
               @onRowClick="onRowClick"
20
             />
20
             />
21
-            <ListView v-else :items="properties" :showNew="false" @onRowClick="onRowClick" />
21
+            <ListView2 v-else :items="properties" :showNew="false" @onRowClick="onRowClick" />
22
           </div>
22
           </div>
23
         </div>
23
         </div>
24
       </div>
24
       </div>
27
 </template>
27
 </template>
28
 
28
 
29
 <script>
29
 <script>
30
-import { mapState, mapActions } from 'vuex';
31
-import ListView from '../../shared/listView.vue';
32
-import Log from '../../../assets/Log';
30
+import { mapState, mapActions } from "vuex";
31
+import ListView from "../../shared/listView.vue";
32
+import ListView2 from "../../shared/listView.vue";
33
+import Log from "../../../assets/Log";
33
 
34
 
34
 export default {
35
 export default {
35
-  name: 'CarouselSearch',
36
+  name: "CarouselSearch",
36
   props: {
37
   props: {
37
-    name: String,
38
+    name: String
38
   },
39
   },
39
   components: {
40
   components: {
40
     ListView,
41
     ListView,
42
+    ListView2
41
   },
43
   },
42
   data() {
44
   data() {
43
     return {
45
     return {
44
-      user: Log.getUser(),
46
+      user: Log.getUser()
45
     };
47
     };
46
   },
48
   },
47
   mounted() {
49
   mounted() {
48
-    if (this.name === 'Timeshare') {
50
+    if (this.name === "Timeshare") {
49
       this.getItems(this.user.id);
51
       this.getItems(this.user.id);
50
     } else {
52
     } else {
51
       this.getProperties(
53
       this.getProperties(
52
         Object.assign(
54
         Object.assign(
53
           {},
55
           {},
54
           {
56
           {
55
-            propertyType: 'Admin',
56
-            user: this.user.id,
57
-          },
58
-        ),
57
+            propertyType: "Admin",
58
+            user: this.user.id
59
+          }
60
+        )
59
       );
61
       );
60
     }
62
     }
61
   },
63
   },
62
   computed: {
64
   computed: {
63
-    ...mapState('myWeeks', ['items']),
64
-    ...mapState('propertyList', ['properties']),
65
+    ...mapState("myWeeks", ["items"]),
66
+    ...mapState("propertyList", ["properties"]),
65
     // eslint-disable-next-line vue/return-in-computed-property
67
     // eslint-disable-next-line vue/return-in-computed-property
66
     nameChanged() {
68
     nameChanged() {
67
-      if (this.name === 'Timeshare') {
69
+      if (this.name === "Timeshare") {
68
         this.getItems(this.user.id);
70
         this.getItems(this.user.id);
69
       } else {
71
       } else {
70
         this.getProperties(
72
         this.getProperties(
71
           Object.assign(
73
           Object.assign(
72
             {},
74
             {},
73
             {
75
             {
74
-              propertyType: 'Admin',
75
-              user: this.user.id,
76
-            },
77
-          ),
76
+              propertyType: "Admin",
77
+              user: this.user.id
78
+            }
79
+          )
78
         );
80
         );
79
       }
81
       }
80
-    },
82
+    }
81
   },
83
   },
82
   methods: {
84
   methods: {
83
-    ...mapActions('myWeeks', ['getItems']),
84
-    ...mapActions('propertyList', ['getProperties']),
85
+    ...mapActions("myWeeks", ["getItems"]),
86
+    ...mapActions("propertyList", ["getProperties"]),
85
     onRowClick(item) {
87
     onRowClick(item) {
86
-      if (this.name === 'Timeshare') {
88
+      if (this.name === "Timeshare") {
87
         const week = this.items[item];
89
         const week = this.items[item];
88
-        this.$emit('onSelected', week);
90
+        this.$emit("onSelected", week);
89
       } else {
91
       } else {
90
         const prop = this.properties[item];
92
         const prop = this.properties[item];
91
-        this.$emit('onSelected', prop);
93
+        this.$emit("onSelected", prop);
92
       }
94
       }
93
-    },
95
+    }
94
   },
96
   },
95
   watch: {
97
   watch: {
96
     nameChanged() {
98
     nameChanged() {
97
       return null;
99
       return null;
98
-    },
99
-  },
100
+    }
101
+  }
100
 };
102
 };
101
 </script>
103
 </script>

+ 29
- 28
src/components/admin/property/propertyTypeEdit.vue Wyświetl plik

1
 <template>
1
 <template>
2
   <div>
2
   <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">Property Type</h2>
9
-            </div>
3
+    <div class="container">
4
+      <br />
5
+      <div class="row">
6
+        <div class="col-md-12 col-lg-8">
7
+          <div class="title-box-d">
8
+            <h1 class="title-d" style="text-align:left; font-size: 250%">
9
+              Property Type
10
+            </h1>
10
           </div>
11
           </div>
11
         </div>
12
         </div>
12
       </div>
13
       </div>
13
-    </section>
14
+    </div>
14
     <div class="container">
15
     <div class="container">
15
       <div class="row mb-3">
16
       <div class="row mb-3">
16
         <div class="col-md-12">
17
         <div class="col-md-12">
27
                 />
28
                 />
28
               </div>
29
               </div>
29
               <div class="col-md-4">
30
               <div class="col-md-4">
30
-                <label>Property Type</label>
31
+                <label>Property Usage Type</label>
31
                 <select
32
                 <select
32
                   class="form-control"
33
                   class="form-control"
33
                   name="UsageType"
34
                   name="UsageType"
48
       @click="SubmitData()"
49
       @click="SubmitData()"
49
       class="btn btn-b-n"
50
       class="btn btn-b-n"
50
       style="width: 85px; height:40px;"
51
       style="width: 85px; height:40px;"
51
-    >Save</button> |
52
-    <button
53
-      type="button"
54
-      @click="Close()"
55
-      class="btn btn-b-n"
56
-      style="width: 85px; height:40px;"
57
-    >Close</button>
52
+    >
53
+      Save
54
+    </button>
55
+    |
56
+    <button type="button" @click="Close()" class="btn btn-b-n" style="width: 85px; height:40px;">
57
+      Close
58
+    </button>
58
   </div>
59
   </div>
59
 </template>
60
 </template>
60
 
61
 
61
 <script>
62
 <script>
62
-import { mapState, mapActions } from 'vuex';
63
+import { mapState, mapActions } from "vuex";
63
 
64
 
64
 export default {
65
 export default {
65
-  name: 'PropertyType',
66
+  name: "PropertyType",
66
   data() {
67
   data() {
67
     return {};
68
     return {};
68
   },
69
   },
73
     }
74
     }
74
   },
75
   },
75
   computed: {
76
   computed: {
76
-    ...mapState('propertyTypes', ['propertyType']),
77
+    ...mapState("propertyTypes", ["propertyType"])
77
   },
78
   },
78
   methods: {
79
   methods: {
79
-    ...mapActions('propertyTypes', [
80
-      'getPropertyType',
81
-      'savePropertyType',
82
-      'updatePropertyType',
83
-      'clearPropertyType',
80
+    ...mapActions("propertyTypes", [
81
+      "getPropertyType",
82
+      "savePropertyType",
83
+      "updatePropertyType",
84
+      "clearPropertyType"
84
     ]),
85
     ]),
85
     SubmitData() {
86
     SubmitData() {
86
       if (this.propertyType.id > 0) {
87
       if (this.propertyType.id > 0) {
88
       } else {
89
       } else {
89
         this.savePropertyType(this.propertyType);
90
         this.savePropertyType(this.propertyType);
90
       }
91
       }
91
-      this.$router.push('/propertyTypes/list');
92
+      this.$router.push("/propertyTypes/list");
92
     },
93
     },
93
     Close() {
94
     Close() {
94
-      this.$router.push('/propertyTypes/list');
95
-    },
96
-  },
95
+      this.$router.push("/propertyTypes/list");
96
+    }
97
+  }
97
 };
98
 };
98
 </script>
99
 </script>

+ 34
- 64
src/components/admin/property/propertyTypeList.vue Wyświetl plik

2
   <!-- eslint-disable max-len -->
2
   <!-- eslint-disable max-len -->
3
   <div>
3
   <div>
4
     <div class="container">
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-single-box"> -->
14
-            <!-- <h1 class="title-single">Property Types</h1> -->
15
-            <!-- </div> -->
16
-            <div class="title-box-d">
17
-              <h1 class="title-d" style="text-align:left; font-size: 250%">Property Types</h1>
18
-            </div>
19
-            <br />
5
+      <br />
6
+      <div class="row">
7
+        <div class="col-md-12 col-lg-8">
8
+          <div class="title-box-d">
9
+            <h1 class="title-d" style="text-align:left; font-size: 250%">Property Types</h1>
20
           </div>
10
           </div>
21
         </div>
11
         </div>
22
       </div>
12
       </div>
23
-      <!-- </section> -->
24
     </div>
13
     </div>
25
     <div class="container">
14
     <div class="container">
26
-      <button type="button" @click="New()" class="btn btn-b-n" style="width: 85px; height:40px;">New</button>
27
-    </div>
28
-    <div class="container">
29
-      <table class="table table-bordered">
30
-        <thead>
31
-          <tr>
32
-            <th>Description</th>
33
-            <th>Property Type</th>
34
-            <th></th>
35
-            <th></th>
36
-          </tr>
37
-        </thead>
38
-        <tbody>
39
-          <tr v-for="(item, i) in propertyTypes" :key="i">
40
-            <td>{{ item.description }}</td>
41
-            <td v-if="item.usageType === 0">Residential</td>
42
-            <td v-else>Commercial</td>
43
-            <td>
44
-              <button
45
-                type="button"
46
-                @click="Edit(item.id)"
47
-                class="btn"
48
-                style="margin:2px; color: #60CBEB"
49
-              >Edit</button>
50
-            </td>
51
-            <td>
52
-              <button
53
-                type="button"
54
-                @click="Delete(item.id)"
55
-                class="btn"
56
-                style="margin:2px; color: #60CBEB"
57
-              >Delete</button>
58
-            </td>
59
-          </tr>
60
-        </tbody>
61
-      </table>
15
+      <listView
16
+        :items="propertyTypes"
17
+        :showNew="true"
18
+        :editable="true"
19
+        :deleteable="true"
20
+        :displayColumns="columns"
21
+        :sortKey="'description'"
22
+        @onEdit="Edit"
23
+        @onDelete="Delete"
24
+        @onNew="New"
25
+      />
62
     </div>
26
     </div>
63
     <br />
27
     <br />
64
   </div>
28
   </div>
65
 </template>
29
 </template>
66
 
30
 
67
 <script>
31
 <script>
68
-import { mapState, mapActions } from 'vuex';
32
+import { mapState, mapActions } from "vuex";
33
+import listView from "../../shared/listView.vue";
69
 
34
 
70
 export default {
35
 export default {
71
-  name: 'PropertyTypeList',
36
+  name: "PropertyTypeList",
37
+  components: {
38
+    listView
39
+  },
72
   data() {
40
   data() {
73
-    return {};
41
+    return {
42
+      columns: ["propertyUsageType", "description"]
43
+    };
74
   },
44
   },
75
   methods: {
45
   methods: {
76
-    ...mapActions('propertyTypes', ['getPropertyTypes', 'deletePropertyType']),
46
+    ...mapActions("propertyTypes", ["getPropertyTypes", "deletePropertyType"]),
77
     New() {
47
     New() {
78
-      this.$router.push('/propertyType/new');
48
+      this.$router.push("/propertyType/new");
79
     },
49
     },
80
-    Edit(itemID) {
50
+    Edit(item) {
81
       this.$router.push({
51
       this.$router.push({
82
-        path: `/propertyType/${itemID}`,
52
+        path: `/propertyType/${item.id}`
83
       });
53
       });
84
     },
54
     },
85
-    Delete(id) {
86
-      this.deletePropertyType(id);
87
-    },
55
+    Delete(item) {
56
+      this.deletePropertyType(item.id);
57
+    }
88
   },
58
   },
89
   mounted() {
59
   mounted() {
90
     this.getPropertyTypes();
60
     this.getPropertyTypes();
91
   },
61
   },
92
   computed: {
62
   computed: {
93
-    ...mapState('propertyTypes', ['propertyTypes']),
94
-  },
63
+    ...mapState("propertyTypes", ["propertyTypes"])
64
+  }
95
 };
65
 };
96
 </script>
66
 </script>

+ 18
- 15
src/components/admin/property/userDefinedField.vue Wyświetl plik

1
 <template>
1
 <template>
2
   <div>
2
   <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 Field</h2>
9
-            </div>
3
+    <div class="container">
4
+      <br />
5
+      <div class="row">
6
+        <div class="col-md-12 col-lg-8">
7
+          <div class="title-box-d">
8
+            <h1 class="title-d" style="text-align:left; font-size: 250%">
9
+              User Defined Field
10
+            </h1>
10
           </div>
11
           </div>
11
         </div>
12
         </div>
12
       </div>
13
       </div>
13
-    </section>
14
+    </div>
14
     <div class="container">
15
     <div class="container">
15
       <div class="row mb-3">
16
       <div class="row mb-3">
16
         <div class="col-md-12">
17
         <div class="col-md-12">
59
       @click="SubmitData()"
60
       @click="SubmitData()"
60
       class="btn btn-b-n"
61
       class="btn btn-b-n"
61
       style="width: 85px; height:40px;"
62
       style="width: 85px; height:40px;"
62
-    >Save</button>
63
+    >
64
+      Save
65
+    </button>
63
   </div>
66
   </div>
64
 </template>
67
 </template>
65
 
68
 
66
 <script>
69
 <script>
67
 export default {
70
 export default {
68
-  name: 'UserField',
71
+  name: "UserField",
69
   props: {
72
   props: {
70
-    field: {},
73
+    field: {}
71
   },
74
   },
72
   data() {
75
   data() {
73
     return {
76
     return {
74
-      userField: {},
77
+      userField: {}
75
     };
78
     };
76
   },
79
   },
77
   mounted() {
80
   mounted() {
81
   },
84
   },
82
   methods: {
85
   methods: {
83
     SubmitData() {
86
     SubmitData() {
84
-      this.$emit('UpdateUserField', this.userField);
85
-    },
86
-  },
87
+      this.$emit("UpdateUserField", this.userField);
88
+    }
89
+  }
87
 };
90
 };
88
 </script>
91
 </script>

+ 53
- 86
src/components/admin/property/userDefinedGroupPage.vue Wyświetl plik

2
   <!-- eslint-disable max-len -->
2
   <!-- eslint-disable max-len -->
3
   <div>
3
   <div>
4
     <div v-if="showField === false">
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>
5
+      <div class="container">
6
+        <br />
7
+        <div class="row">
8
+          <div class="col-md-12 col-lg-8">
9
+            <div class="title-box-d">
10
+              <h1 class="title-d" style="text-align:left; font-size: 250%">
11
+                Property User Defined Group
12
+              </h1>
12
             </div>
13
             </div>
13
           </div>
14
           </div>
14
         </div>
15
         </div>
15
-      </section>
16
+      </div>
16
       <div class="container">
17
       <div class="container">
17
         <div class="row mb-3">
18
         <div class="row mb-3">
18
           <div class="col-md-12">
19
           <div class="col-md-12">
29
                   />
30
                   />
30
                 </div>
31
                 </div>
31
                 <div class="col-md-4">
32
                 <div class="col-md-4">
32
-                  <label>Property Type</label>
33
+                  <label>Property Usage Type</label>
33
                   <select
34
                   <select
34
                     class="form-control"
35
                     class="form-control"
35
                     name="UsageType"
36
                     name="UsageType"
64
                   />
65
                   />
65
                 </div>
66
                 </div>
66
                 <div class="col-md-4">
67
                 <div class="col-md-4">
67
-                  <label>Property Type</label>
68
+                  <label>Property Usage Type</label>
68
                   <select
69
                   <select
69
                     class="form-control"
70
                     class="form-control"
70
                     name="UsageType"
71
                     name="UsageType"
92
         </div>
93
         </div>
93
       </div>
94
       </div>
94
       <div class="container">
95
       <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"
124
-                  style="margin:2px; color: #60CBEB"
125
-                >Edit</button>
126
-              </td>
127
-              <td>
128
-                <button
129
-                  type="button"
130
-                  @click="Delete(item)"
131
-                  class="btn"
132
-                  style="margin:2px; color: #60CBEB"
133
-                >Delete</button>
134
-              </td>
135
-            </tr>
136
-          </tbody>
137
-        </table>
96
+        <listView
97
+          :items="userFields"
98
+          :showNew="true"
99
+          :editable="true"
100
+          :deleteable="true"
101
+          :displayColumns="columns"
102
+          :sortKey="'rank'"
103
+          @onEdit="Edit"
104
+          @onDelete="Delete"
105
+          @onNew="newItem"
106
+        />
138
       </div>
107
       </div>
139
       <button
108
       <button
140
         type="button"
109
         type="button"
141
         @click="SubmitData()"
110
         @click="SubmitData()"
142
         class="btn btn-b-n"
111
         class="btn btn-b-n"
143
         style="width: 85px; height:40px;"
112
         style="width: 85px; height:40px;"
144
-      >Save</button>
145
-      <button
146
-        type="button"
147
-        @click="Close()"
148
-        class="btn btn-b-n"
149
-        style="width: 85px; height:40px;"
150
-      >Close</button>
113
+      >
114
+        Save
115
+      </button>
116
+      <button type="button" @click="Close()" class="btn btn-b-n" style="width: 85px; height:40px;">
117
+        Close
118
+      </button>
151
     </div>
119
     </div>
152
     <div v-else>
120
     <div v-else>
153
       <userFields @UpdateUserField="UpdateUserField" :field="item" />
121
       <userFields @UpdateUserField="UpdateUserField" :field="item" />
156
 </template>
124
 </template>
157
 
125
 
158
 <script>
126
 <script>
159
-import { mapState, mapActions } from 'vuex';
160
-import userFields from './userDefinedField.vue';
127
+import { mapState, mapActions } from "vuex";
128
+import userFields from "./userDefinedField.vue";
129
+import listView from "../../shared/listView.vue";
161
 
130
 
162
 export default {
131
 export default {
163
-  name: 'UserDefinedGroup',
132
+  name: "UserDefinedGroup",
164
   components: {
133
   components: {
165
     userFields,
134
     userFields,
135
+    listView
166
   },
136
   },
167
   data() {
137
   data() {
168
     return {
138
     return {
169
       item: {},
139
       item: {},
170
       showField: false,
140
       showField: false,
141
+      columns: ["fieldName", "fieldType", "rank"]
171
     };
142
     };
172
   },
143
   },
173
   mounted() {
144
   mounted() {
180
     }
151
     }
181
   },
152
   },
182
   computed: {
153
   computed: {
183
-    ...mapState('propertyAdmin', [
184
-      'userDefinedGroup',
185
-      'userFields',
186
-      'userField',
187
-    ]),
154
+    ...mapState("propertyAdmin", ["userDefinedGroup", "userFields", "userField"])
188
   },
155
   },
189
   methods: {
156
   methods: {
190
-    ...mapActions('propertyAdmin', [
191
-      'getUserDefinedGroup',
192
-      'getUserFields',
193
-      'saveUserDefinedGroup',
194
-      'updateUserDefinedGroup',
195
-      'clearUserGroup',
196
-      'clearUserFields',
197
-      'clearUserField',
198
-      'saveUserField',
199
-      'updateUserField',
200
-      'deleteUserField',
157
+    ...mapActions("propertyAdmin", [
158
+      "getUserDefinedGroup",
159
+      "getUserFields",
160
+      "saveUserDefinedGroup",
161
+      "updateUserDefinedGroup",
162
+      "clearUserGroup",
163
+      "clearUserFields",
164
+      "clearUserField",
165
+      "saveUserField",
166
+      "updateUserField",
167
+      "deleteUserField"
201
     ]),
168
     ]),
202
     SubmitData() {
169
     SubmitData() {
203
       this.userDefinedGroup.fields = [];
170
       this.userDefinedGroup.fields = [];
204
       let reload = false;
171
       let reload = false;
205
       if (this.$route.params.id > 0) {
172
       if (this.$route.params.id > 0) {
206
         this.updateUserDefinedGroup(this.userDefinedGroup);
173
         this.updateUserDefinedGroup(this.userDefinedGroup);
207
-        this.userFields.forEach((fieldData) => {
174
+        this.userFields.forEach(fieldData => {
208
           if (fieldData.id === 0) {
175
           if (fieldData.id === 0) {
209
             fieldData.groupId = this.userDefinedGroup.id;
176
             fieldData.groupId = this.userDefinedGroup.id;
210
             this.saveUserField(fieldData);
177
             this.saveUserField(fieldData);
214
         });
181
         });
215
       } else {
182
       } else {
216
         reload = true;
183
         reload = true;
217
-        this.userFields.forEach((fieldData) => {
184
+        this.userFields.forEach(fieldData => {
218
           this.userDefinedGroup.fields.push({
185
           this.userDefinedGroup.fields.push({
219
             fieldName: fieldData.fieldName,
186
             fieldName: fieldData.fieldName,
220
             fieldType: fieldData.fieldType,
187
             fieldType: fieldData.fieldType,
221
-            rank: fieldData.rank,
188
+            rank: fieldData.rank
222
           });
189
           });
223
         });
190
         });
224
         this.saveUserDefinedGroup(this.userDefinedGroup);
191
         this.saveUserDefinedGroup(this.userDefinedGroup);
225
       }
192
       }
226
-      this.$router.push('/userDefinedGroups/list');
193
+      this.$router.push("/userDefinedGroups/list");
227
       // this.$router.push({
194
       // this.$router.push({
228
       //   path: '/userDefinedGroups/list',
195
       //   path: '/userDefinedGroups/list',
229
       //   query: { reload },
196
       //   query: { reload },
240
       this.showField = true;
207
       this.showField = true;
241
     },
208
     },
242
     Close() {
209
     Close() {
243
-      this.$router.push('/userDefinedGroups/list');
210
+      this.$router.push("/userDefinedGroups/list");
244
     },
211
     },
245
     UpdateUserField(item) {
212
     UpdateUserField(item) {
246
       if (item.id === 0) {
213
       if (item.id === 0) {
254
       } else {
221
       } else {
255
         this.deleteUserField(item.id);
222
         this.deleteUserField(item.id);
256
       }
223
       }
257
-    },
258
-  },
224
+    }
225
+  }
259
 };
226
 };
260
 </script>
227
 </script>

+ 34
- 59
src/components/admin/property/userDefinedGroupsPage.vue Wyświetl plik

1
 <template>
1
 <template>
2
   <!-- eslint-disable max-len -->
2
   <!-- eslint-disable max-len -->
3
   <div>
3
   <div>
4
-    <!-- <section class="intro-single"> -->
5
     <div class="container">
4
     <div class="container">
6
-      <br />
7
-      <br />
8
-      <br />
9
       <br />
5
       <br />
10
       <div class="row">
6
       <div class="row">
11
         <div class="col-md-12 col-lg-8">
7
         <div class="col-md-12 col-lg-8">
12
-          <!-- <div class="title-single-box"> -->
13
-          <!-- <h2 class="title-single">User Defined Groups List</h2> -->
14
-          <!-- </div> -->
15
           <div class="title-box-d">
8
           <div class="title-box-d">
16
-            <h1 class="title-d" style="text-align:left; font-size: 250%">User Defined Groups List</h1>
9
+            <h1 class="title-d" style="text-align:left; font-size: 250%">
10
+              Property User Defined Groups
11
+            </h1>
17
           </div>
12
           </div>
18
-          <br />
19
         </div>
13
         </div>
20
       </div>
14
       </div>
21
     </div>
15
     </div>
22
-    <!-- </section> -->
23
     <div class="container">
16
     <div class="container">
24
-      <button type="button" @click="New()" class="btn btn-b-n" style="width: 85px; height:40px;">New</button>
25
-      <table class="table table-bordered">
26
-        <thead>
27
-          <tr>
28
-            <th>Description</th>
29
-            <th>Property Type</th>
30
-            <th>Order</th>
31
-            <th></th>
32
-            <th></th>
33
-          </tr>
34
-        </thead>
35
-        <tbody>
36
-          <tr v-for="(item, i) in userDefinedGroups" :key="i">
37
-            <td>{{item.description}}</td>
38
-            <td v-if="item.usageType === 0">Residential</td>
39
-            <td v-else-if="item.usageType === 1">Commercial</td>
40
-            <td v-else>Both</td>
41
-            <td>{{item.rank}}</td>
42
-            <td>
43
-              <button
44
-                type="button"
45
-                @click="Edit(item.id)"
46
-                class="btn"
47
-                style="margin:2px; color: #60CBEB"
48
-              >Edit</button>
49
-            </td>
50
-            <td>
51
-              <button
52
-                type="button"
53
-                @click="Delete(item)"
54
-                class="btn"
55
-                style="margin:2px; color: #60CBEB"
56
-              >Delete</button>
57
-            </td>
58
-          </tr>
59
-        </tbody>
60
-      </table>
17
+      <div class="container">
18
+        <listView
19
+          :items="userDefinedGroups"
20
+          :showNew="true"
21
+          :editable="true"
22
+          :deleteable="true"
23
+          :displayColumns="columns"
24
+          :sortKey="'rank'"
25
+          @onEdit="Edit"
26
+          @onDelete="Delete"
27
+          @onNew="New"
28
+        />
29
+      </div>
61
     </div>
30
     </div>
62
     <br />
31
     <br />
63
   </div>
32
   </div>
64
 </template>
33
 </template>
65
 <script>
34
 <script>
66
-import { mapState, mapActions } from 'vuex';
35
+import { mapState, mapActions } from "vuex";
36
+import listView from "../../shared/listView.vue";
67
 
37
 
68
 export default {
38
 export default {
69
-  name: 'UserDefinedGroup',
39
+  name: "UserDefinedGroup",
40
+  components: {
41
+    listView
42
+  },
43
+  data() {
44
+    return {
45
+      columns: ["description", "propertyUsageType", "rank"]
46
+    };
47
+  },
70
   mounted() {
48
   mounted() {
71
     this.getUserDefinedGroups();
49
     this.getUserDefinedGroups();
72
   },
50
   },
73
   computed: {
51
   computed: {
74
-    ...mapState('propertyAdmin', ['userDefinedGroups']),
52
+    ...mapState("propertyAdmin", ["userDefinedGroups"])
75
   },
53
   },
76
   methods: {
54
   methods: {
77
-    ...mapActions('propertyAdmin', [
78
-      'getUserDefinedGroups',
79
-      'deleteUserDefinedGroup',
80
-    ]),
55
+    ...mapActions("propertyAdmin", ["getUserDefinedGroups", "deleteUserDefinedGroup"]),
81
     New() {
56
     New() {
82
-      this.$router.push('/userDefinedGroups/userDefinedGroup');
57
+      this.$router.push("/userDefinedGroups/userDefinedGroup");
83
     },
58
     },
84
-    Edit(id) {
85
-      this.$router.push(`/userDefinedGroups/userDefinedGroup/${id}`);
59
+    Edit(item) {
60
+      this.$router.push(`/userDefinedGroups/userDefinedGroup/${item.id}`);
86
     },
61
     },
87
     Delete(item) {
62
     Delete(item) {
88
       if (item.id === 0) {
63
       if (item.id === 0) {
89
         this.userDefinedGroups.pop(item);
64
         this.userDefinedGroups.pop(item);
90
       }
65
       }
91
       this.deleteUserDefinedGroup(item.id);
66
       this.deleteUserDefinedGroup(item.id);
92
-    },
93
-  },
67
+    }
68
+  }
94
 };
69
 };
95
 </script>
70
 </script>

+ 2
- 2
src/components/home/serviceSection.vue Wyświetl plik

54
                 </p>
54
                 </p>
55
               </div>
55
               </div>
56
               <div class="card-footer-c">
56
               <div class="card-footer-c">
57
-                <router-link to="/property/Residential/Search">
57
+                <router-link to="property/Search/Residential">
58
                   Read more
58
                   Read more
59
                   <span class="ion-ios-arrow-forward" style="color:#60CBEB"></span>
59
                   <span class="ion-ios-arrow-forward" style="color:#60CBEB"></span>
60
                 </router-link>
60
                 </router-link>
78
                 </p>
78
                 </p>
79
               </div>
79
               </div>
80
               <div class="card-footer-c">
80
               <div class="card-footer-c">
81
-                <router-link to="/property/Commercial/Search">
81
+                <router-link to="property/Search/Commercial">
82
                   Read more
82
                   Read more
83
                   <span class="ion-ios-arrow-forward" style="color:#60CBEB"></span>
83
                   <span class="ion-ios-arrow-forward" style="color:#60CBEB"></span>
84
                 </router-link>
84
                 </router-link>

+ 52
- 25
src/components/processFlow/makeOffer.vue Wyświetl plik

5
       <br />
5
       <br />
6
       <div v-if="isProperty">
6
       <div v-if="isProperty">
7
         <div class="form-group row">
7
         <div class="form-group row">
8
-          <div class="col-md-6">
8
+          <div style="text-align:left">
9
             <div class="title-box-d">
9
             <div class="title-box-d">
10
               <h3 class="title-d">{{ item.shortDescription }}</h3>
10
               <h3 class="title-d">{{ item.shortDescription }}</h3>
11
             </div>
11
             </div>
19
       </div>
19
       </div>
20
       <div v-if="!isProperty">
20
       <div v-if="!isProperty">
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 style="text-align:left">
23
             <div class="title-box-d">
23
             <div class="title-box-d">
24
-              <h3 class="title-d">{{ item ? item.resort.resortName : '' }}</h3>
24
+              <h3 class="title-d">
25
+                {{ item.resort.resortName ? item.resort.resortName : item.resort }}
26
+              </h3>
25
             </div>
27
             </div>
26
           </div>
28
           </div>
27
         </div>
29
         </div>
73
                 <b>R</b>
75
                 <b>R</b>
74
               </span>
76
               </span>
75
             </div>
77
             </div>
76
-            <input class="form-control" type="number" v-model="item.sellPrice" disabled />
78
+            <input
79
+              v-if="isProperty"
80
+              class="form-control"
81
+              type="number"
82
+              v-model="item.price"
83
+              disabled
84
+            />
85
+            <input v-else class="form-control" type="number" v-model="item.sellPrice" disabled />
77
           </div>
86
           </div>
78
         </div>
87
         </div>
79
         <div class="col-md-6">
88
         <div class="col-md-6">
115
         @click="SendOffer()"
124
         @click="SendOffer()"
116
         class="btn btn-b-n"
125
         class="btn btn-b-n"
117
         style="width: 150px; height:40px;"
126
         style="width: 150px; height:40px;"
118
-      >Send Offer</button>
127
+      >
128
+        Send Offer
129
+      </button>
119
       <button
130
       <button
120
         v-if="!isMakeOffer && !isDecline && canEdit"
131
         v-if="!isMakeOffer && !isDecline && canEdit"
121
         type="submit"
132
         type="submit"
122
         @click="Accept()"
133
         @click="Accept()"
123
         class="btn btn-b-n"
134
         class="btn btn-b-n"
124
         style="width: 150px; height:40px;"
135
         style="width: 150px; height:40px;"
125
-      >Accept</button>
136
+      >
137
+        Accept
138
+      </button>
126
       <button
139
       <button
127
         v-if="!isMakeOffer && !isDecline && canEdit"
140
         v-if="!isMakeOffer && !isDecline && canEdit"
128
         type="button"
141
         type="button"
129
         @click="Decline()"
142
         @click="Decline()"
130
         class="btn btn-b-n"
143
         class="btn btn-b-n"
131
         style="width: 150px; height:40px;"
144
         style="width: 150px; height:40px;"
132
-      >Decline</button>
145
+      >
146
+        Decline
147
+      </button>
133
     </div>
148
     </div>
134
     <div v-if="isDecline || item.statusCode === 'E3'" class="form-group row">
149
     <div v-if="isDecline || item.statusCode === 'E3'" class="form-group row">
135
       <div class="col-md-12">
150
       <div class="col-md-12">
149
       @click="Complete()"
164
       @click="Complete()"
150
       class="btn btn-b-n"
165
       class="btn btn-b-n"
151
       style="width: 150px; height:40px;"
166
       style="width: 150px; height:40px;"
152
-    >Complete</button>
167
+    >
168
+      Complete
169
+    </button>
153
     <div v-if="isSaved">
170
     <div v-if="isSaved">
154
       <div class="form-group row">
171
       <div class="form-group row">
155
         <br />
172
         <br />
156
-        <label>{{ message }}</label>
173
+        <div class="container col-md-10">
174
+          <p :class="[isInfo ? 'alert myInfo' : 'alert myWarning']">{{ message }}</p>
175
+        </div>
157
       </div>
176
       </div>
158
       <button
177
       <button
159
         v-if="isSaved"
178
         v-if="isSaved"
161
         class="btn btn-b-n"
180
         class="btn btn-b-n"
162
         style="width: 150px; height:40px;"
181
         style="width: 150px; height:40px;"
163
         data-dismiss="modal"
182
         data-dismiss="modal"
164
-      >OK</button>
183
+      >
184
+        OK
185
+      </button>
165
     </div>
186
     </div>
166
   </div>
187
   </div>
167
 </template>
188
 </template>
168
 
189
 
169
 <script>
190
 <script>
170
-import { mapState, mapActions } from 'vuex';
191
+import { mapState, mapActions } from "vuex";
171
 
192
 
172
 export default {
193
 export default {
173
-  name: 'MakeOffer',
194
+  name: "MakeOffer",
174
   props: {
195
   props: {
175
     isMakeOffer: Boolean,
196
     isMakeOffer: Boolean,
176
     isProperty: Boolean,
197
     isProperty: Boolean,
177
     canEdit: Boolean,
198
     canEdit: Boolean,
178
     item: Object,
199
     item: Object,
179
     bidId: Number,
200
     bidId: Number,
180
-    updateItem: Function,
201
+    updateItem: Function
181
   },
202
   },
182
   data() {
203
   data() {
183
     return {
204
     return {
184
       isDecline: false,
205
       isDecline: false,
185
       isSaved: false,
206
       isSaved: false,
186
-      message: '',
207
+      message: "",
208
+      isInfo: true
187
     };
209
     };
188
   },
210
   },
189
   methods: {
211
   methods: {
190
-    ...mapActions('bid', ['getBid', 'saveBid', 'acceptBid', 'declineBid']),
212
+    ...mapActions("bid", ["getBid", "saveBid", "acceptBid", "declineBid"]),
191
     SendOffer() {
213
     SendOffer() {
192
       this.getBid(0);
214
       this.getBid(0);
193
       this.bidItem.id = 0;
215
       this.bidItem.id = 0;
196
       if (this.isProperty) {
218
       if (this.isProperty) {
197
         this.bidItem.propertyId = this.item.id;
219
         this.bidItem.propertyId = this.item.id;
198
       } else {
220
       } else {
199
-        this.bidItem.timeshareWeek = this.item;
200
-        this.bidItem.timeshareWeek.id = this.item.resort.id;
201
-        this.bidItem.timeshareWeek.resortCode = this.item.resort.resortCode;
202
-        this.bidItem.timeshareWeek.resortName = this.item.resort.resortName;
203
         this.bidItem.timeshareWeekId = this.item.id;
221
         this.bidItem.timeshareWeekId = this.item.id;
204
       }
222
       }
205
       this.saveBid(this.bidItem);
223
       this.saveBid(this.bidItem);
206
 
224
 
207
       this.item = [];
225
       this.item = [];
208
       this.isSaved = true;
226
       this.isSaved = true;
209
-      this.message = 'Offer was submitted.';
227
+      this.message = "Offer was submitted.";
228
+      this.isInfo = true;
210
     },
229
     },
211
     Accept() {
230
     Accept() {
212
       this.acceptBid(this.item.id);
231
       this.acceptBid(this.item.id);
213
       this.isSaved = true;
232
       this.isSaved = true;
214
-      this.message = 'Offer Accepted.';
233
+      this.message = "Offer Accepted.";
234
+      this.isInfo = true;
215
     },
235
     },
216
     Decline() {
236
     Decline() {
217
       this.isDecline = true;
237
       this.isDecline = true;
221
 
241
 
222
       const decline = {
242
       const decline = {
223
         id: this.item.id,
243
         id: this.item.id,
224
-        comment: this.item.declineReason,
244
+        comment: this.item.declineReason
225
       };
245
       };
226
 
246
 
227
       this.declineBid(decline);
247
       this.declineBid(decline);
228
       this.isSaved = true;
248
       this.isSaved = true;
229
-      this.message = 'Offer Declined.';
230
-    },
249
+      this.message = "Offer Declined.";
250
+      this.isInfo = false;
251
+    }
231
   },
252
   },
232
   computed: {
253
   computed: {
233
-    ...mapState('bid', ['bidItem']),
254
+    ...mapState("bid", ["bidIt,em"])
234
   },
255
   },
256
+  watch: {
257
+    item() {
258
+      this.isSaved = false;
259
+      this.canEdit = this.item.statusCode === "E1";
260
+    }
261
+  }
235
 };
262
 };
236
 </script>
263
 </script>

+ 49
- 77
src/components/processFlow/offers.vue Wyświetl plik

1
 <template>
1
 <template>
2
   <div>
2
   <div>
3
-    <!-- <section class="intro-single"> -->
4
     <div class="container">
3
     <div class="container">
5
-      <br />
6
-      <br />
7
-      <br />
8
       <br />
4
       <br />
9
       <div class="row">
5
       <div class="row">
10
         <div class="col-md-12 col-lg-8">
6
         <div class="col-md-12 col-lg-8">
11
-          <!-- <div class="title-single-box"> -->
12
-          <!-- <h2 class="title-single">Status List</h2> -->
13
-          <!-- </div> -->
14
           <div class="title-box-d">
7
           <div class="title-box-d">
15
             <h1 class="title-d" style="text-align:left; font-size: 250%">Bid Offers</h1>
8
             <h1 class="title-d" style="text-align:left; font-size: 250%">Bid Offers</h1>
16
           </div>
9
           </div>
17
-          <br />
18
         </div>
10
         </div>
19
       </div>
11
       </div>
20
-    </div>
21
-    <!-- </section> -->
22
-    <div class="container">
23
-      <table class="table table-bordered">
24
-        <thead>
25
-          <tr>
26
-            <th>Type</th>
27
-            <th>Description</th>
28
-            <th>Status</th>
29
-            <th>Price</th>
30
-            <th>Offered Price</th>
31
-            <th>Offer By</th>
32
-            <th></th>
33
-          </tr>
34
-        </thead>
35
-        <tbody>
36
-          <tr v-for="(item, i) in bidItems" :key="i">
37
-            <td>{{ item.type }}</td>
38
-            <td>{{ item.shortDescription }}</td>
39
-            <td>{{ item.status }}</td>
40
-            <td>R {{ formatPrice(item.price) }}</td>
41
-            <td>R {{ formatPrice(item.offer) }}</td>
42
-            <td>{{ item.madeBy }}</td>
43
-            <td>
44
-              <button
45
-                type="button"
46
-                class="btn btn-b-n"
47
-                data-toggle="modal"
48
-                :data-target="'#myModal' + i"
49
-              >View</button>
50
-              <div :id="'myModal' + i" class="modal fade" role="dialog">
51
-                <div class="modal-dialog modal-lg">
52
-                  <!-- Modal content-->
53
-                  <div class="modal-content">
54
-                    <div class="modal-header">
55
-                      <button type="button" class="close" data-dismiss="modal">&times;</button>
56
-                    </div>
57
-                    <div padding-left="20px">
58
-                      <makeOffer
59
-                        name="MakeOffer"
60
-                        :isMakeOffer="false"
61
-                        :isProperty="item.type === 'Property'"
62
-                        :canEdit="item.statusCode === 'E1'"
63
-                        :item="item"
64
-                      />
65
-                    </div>
66
-                  </div>
67
-                </div>
68
-              </div>
69
-            </td>
70
-          </tr>
71
-        </tbody>
72
-      </table>
12
+      <div class="container">
13
+        <listView
14
+          :items="bidItems"
15
+          :showNew="false"
16
+          :editable="true"
17
+          :deleteable="false"
18
+          :displayColumns="columns"
19
+          :displayFormats="formats"
20
+          :displayHeaders="columnHeaders"
21
+          :sortKey="'date'"
22
+          @onEdit="Edit"
23
+        />
24
+      </div>
25
+      <div :id="'myModalOffer'" class="modal fade" role="dialog" :ref="'MyModalForm'">
26
+        <div class="modal-dialog modal-lg">
27
+          <!-- Modal content-->
28
+          <div class="modal-content">
29
+            <div class="modal-header">
30
+              <button type="button" class="close" data-dismiss="modal">&times;</button>
31
+            </div>
32
+            <div padding-left="20px">
33
+              <makeOffer
34
+                name="MakeOffer"
35
+                :isMakeOffer="false"
36
+                :isProperty="item.type === 'Property'"
37
+                :canEdit="item.statusCode === 'E1'"
38
+                :item="item"
39
+              />
40
+            </div>
41
+          </div>
42
+        </div>
43
+      </div>
73
     </div>
44
     </div>
74
   </div>
45
   </div>
75
 </template>
46
 </template>
76
 
47
 
77
 <script>
48
 <script>
78
-import { mapState, mapActions } from 'vuex';
79
-import makeOffer from './makeOffer.vue';
49
+import { mapState, mapActions } from "vuex";
50
+import makeOffer from "./makeOffer.vue";
51
+import listView from "../shared/listView.vue";
80
 
52
 
81
 export default {
53
 export default {
82
-  name: 'offers',
83
-  components: { makeOffer },
54
+  name: "offers",
55
+  components: { makeOffer, listView },
84
   data() {
56
   data() {
85
     return {
57
     return {
86
       item: {},
58
       item: {},
59
+      columns: ["date", "type", "shortDescription", "status", "price", "offer", "madeBy"],
60
+      formats: ["date", "text", "text", "text", "money", "money", "text"],
61
+      columnHeaders: ["", "", "description", "", "", "offerPrice", "offerBy"]
87
     };
62
     };
88
   },
63
   },
89
   methods: {
64
   methods: {
90
-    ...mapActions('bid', ['getBids']),
91
-    // SetItem(data) {
92
-    //   this.item = data;
93
-    //   const element = this.$refs.modal.$el;
94
-    //   $(element).modal('show');
95
-    // },
96
-    formatPrice(value) {
97
-      const val = (value / 1).toFixed(2);
98
-      return val.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ' ');
99
-    },
65
+    ...mapActions("bid", ["getBids"]),
66
+    Edit(item) {
67
+      this.item = item;
68
+
69
+      const element = this.$refs.MyModalForm;
70
+      $(element).modal("show");
71
+    }
100
   },
72
   },
101
   computed: {
73
   computed: {
102
-    ...mapState('bid', ['bidItems']),
74
+    ...mapState("bid", ["bidItems"])
103
   },
75
   },
104
   mounted() {
76
   mounted() {
105
     this.getBids();
77
     this.getBids();
106
-  },
78
+  }
107
 };
79
 };
108
 </script>
80
 </script>

+ 73
- 65
src/components/property/propertyCreate.vue Wyświetl plik

25
         </div>
25
         </div>
26
       </div>
26
       </div>
27
       <br />
27
       <br />
28
-      <div class="row">
28
+      <div class="row" v-if="!mayEdit">
29
+        <div class="container col-md-10">
30
+          <p class="alert myError">Please Login to add a property</p>
31
+        </div>
32
+      </div>
33
+      <div class="row" v-if="mayEdit">
29
         <div class="container col-md-10">
34
         <div class="container col-md-10">
30
           <div class="title-box-d">
35
           <div class="title-box-d">
31
             <h5 class="title-d" style="text-align:left">Property Overview</h5>
36
             <h5 class="title-d" style="text-align:left">Property Overview</h5>
32
           </div>
37
           </div>
33
         </div>
38
         </div>
34
       </div>
39
       </div>
35
-      <div class="row mb-3">
40
+      <div class="row mb-3" v-if="mayEdit">
36
         <div class="container col-md-10" style="text-align:left">
41
         <div class="container col-md-10" style="text-align:left">
37
           <form id="mainForm">
42
           <form id="mainForm">
38
             <div class="form-goup row">
43
             <div class="form-goup row">
392
 </template>
397
 </template>
393
 
398
 
394
 <script>
399
 <script>
395
-import { mapState, mapActions } from 'vuex';
396
-import { VueEditor } from 'vue2-editor';
397
-import UserField from './propertyUserField.vue';
398
-import ImageLoad from './propertyImage.vue';
400
+import { mapState, mapActions } from "vuex";
401
+import { VueEditor } from "vue2-editor";
402
+import UserField from "./propertyUserField.vue";
403
+import ImageLoad from "./propertyImage.vue";
404
+import Log from "../../assets/Log";
399
 
405
 
400
 export default {
406
 export default {
401
-  name: 'PropertyCreate',
407
+  name: "PropertyCreate",
402
   components: {
408
   components: {
403
     UserField,
409
     UserField,
404
     ImageLoad,
410
     ImageLoad,
405
-    VueEditor,
411
+    VueEditor
406
   },
412
   },
407
   data() {
413
   data() {
408
     return {
414
     return {
409
-      propertyType: 'Residential',
410
-      salesType: 'Rental',
411
-      selectedProvince: '',
412
-      selectedCity: '',
415
+      propertyType: "Residential",
416
+      salesType: "Rental",
417
+      selectedProvince: "",
418
+      selectedCity: "",
413
       images: [],
419
       images: [],
414
       propertyFieldValues: [],
420
       propertyFieldValues: [],
415
       defaultImage: 0,
421
       defaultImage: 0,
416
       wait: false,
422
       wait: false,
417
       customToolbar: [
423
       customToolbar: [
418
         [{ header: [false, 1, 2, 3, 4, 5, 6] }],
424
         [{ header: [false, 1, 2, 3, 4, 5, 6] }],
419
-        ['bold', 'italic', 'underline', 'strike'],
425
+        ["bold", "italic", "underline", "strike"],
420
         [
426
         [
421
-          { align: '' },
422
-          { align: 'center' },
423
-          { align: 'right' },
424
-          { align: 'justify' },
427
+          { align: "" },
428
+          { align: "center" },
429
+          { align: "right" },
430
+          { align: "justify" }
425
         ],
431
         ],
426
-        [{ list: 'ordered' }, { list: 'bullet' }, { list: 'check' }],
427
-        [{ script: 'sub' }, { script: 'super' }],
428
-        [{ indent: '-1' }, { indent: '+1' }],
432
+        [{ list: "ordered" }, { list: "bullet" }, { list: "check" }],
433
+        [{ script: "sub" }, { script: "super" }],
434
+        [{ indent: "-1" }, { indent: "+1" }]
429
       ],
435
       ],
430
-      error: '',
436
+      error: "",
431
       showPropertyTypeError: false,
437
       showPropertyTypeError: false,
432
       showProvinceError: false,
438
       showProvinceError: false,
433
       showCityError: false,
439
       showCityError: false,
434
       showSuburbError: false,
440
       showSuburbError: false,
435
       showDateError: false,
441
       showDateError: false,
442
+      user: Log.getUser(),
443
+      mayEdit: Log.isLoggedIn()
436
     };
444
     };
437
   },
445
   },
438
   methods: {
446
   methods: {
439
-    ...mapActions('searchTab', ['getProvince', 'getCities', 'getSuburbs']),
440
-    ...mapActions('property', [
441
-      'getPropertyTypes',
442
-      'getPropertyOverviewFields',
443
-      'getPropertyFields',
444
-      'saveProperty',
445
-      'getProperty',
446
-      'getPropertyImages',
447
-      'clearProperty',
448
-      'clearPropertyImages',
449
-      'getPropertyEditDisplay',
450
-      'getPropertySavedOverviewFields',
451
-      'getPropertySavedFields',
452
-      'getSavedPropertyData',
447
+    ...mapActions("searchTab", ["getProvince", "getCities", "getSuburbs"]),
448
+    ...mapActions("property", [
449
+      "getPropertyTypes",
450
+      "getPropertyOverviewFields",
451
+      "getPropertyFields",
452
+      "saveProperty",
453
+      "getProperty",
454
+      "getPropertyImages",
455
+      "clearProperty",
456
+      "clearPropertyImages",
457
+      "getPropertyEditDisplay",
458
+      "getPropertySavedOverviewFields",
459
+      "getPropertySavedFields",
460
+      "getSavedPropertyData"
453
     ]),
461
     ]),
454
     TypeChanged() {
462
     TypeChanged() {
455
-      this.propertyType = this.property.propertyUsageType;
463
+      this.property.propertyUsageType = this.propertyType;
456
     },
464
     },
457
     SubmitData() {
465
     SubmitData() {
458
       if (this.property.propertyTypeId === 0) {
466
       if (this.property.propertyTypeId === 0) {
469
       }
477
       }
470
 
478
 
471
       if (
479
       if (
472
-        this.salesType === 'Rental'
473
-        && this.property.dateAvailable === 'undef'
480
+        this.salesType === "Rental" &&
481
+        this.property.dateAvailable === "undef"
474
       ) {
482
       ) {
475
         this.showDateError = true;
483
         this.showDateError = true;
476
       }
484
       }
477
 
485
 
478
       if (
486
       if (
479
-        this.showPropertyTypeError
480
-        || this.showProvinceError
481
-        || this.showCityError
482
-        || this.showSuburbError
483
-        || this.showDateError
487
+        this.showPropertyTypeError ||
488
+        this.showProvinceError ||
489
+        this.showCityError ||
490
+        this.showSuburbError ||
491
+        this.showDateError
484
       ) {
492
       ) {
485
         return;
493
         return;
486
       }
494
       }
487
 
495
 
488
       this.wait = true;
496
       this.wait = true;
489
-      if (this.salesType === 'Sale') {
497
+      if (this.salesType === "Sale") {
490
         this.property.isSale = true;
498
         this.property.isSale = true;
491
         this.property.dateAvailable = new Date();
499
         this.property.dateAvailable = new Date();
492
       }
500
       }
498
         }
506
         }
499
         this.property.propertyImages.push({
507
         this.property.propertyImages.push({
500
           image: this.images[i],
508
           image: this.images[i],
501
-          isDefault: setAsDefault,
509
+          isDefault: setAsDefault
502
         });
510
         });
503
       }
511
       }
504
       this.property.propertyUserFields = this.propertyFieldValues;
512
       this.property.propertyUserFields = this.propertyFieldValues;
508
       }
516
       }
509
 
517
 
510
       this.saveProperty(this.property)
518
       this.saveProperty(this.property)
511
-        .then((fulfilled) => {
519
+        .then(fulfilled => {
512
           this.$router.push(`/property/property/${fulfilled.data.id}`);
520
           this.$router.push(`/property/property/${fulfilled.data.id}`);
513
         })
521
         })
514
-        .catch((error) => {
522
+        .catch(error => {
515
           console.log(error.message);
523
           console.log(error.message);
516
         });
524
         });
517
     },
525
     },
518
     Close() {
526
     Close() {
519
-      this.$router.push('/property/admin/list/my');
527
+      this.$router.push("/property/admin/list/my");
520
     },
528
     },
521
     PropertyTypeSelected(item) {
529
     PropertyTypeSelected(item) {
522
       if (item.target.options.selectedIndex > 0) {
530
       if (item.target.options.selectedIndex > 0) {
544
         this.getSuburbs(
552
         this.getSuburbs(
545
           Object.assign(
553
           Object.assign(
546
             {},
554
             {},
547
-            { province: this.selectedProvince, city: this.selectedCity },
548
-          ),
555
+            { province: this.selectedProvince, city: this.selectedCity }
556
+          )
549
         );
557
         );
550
         this.showCityError = false;
558
         this.showCityError = false;
551
       } else {
559
       } else {
567
     },
575
     },
568
     UpdateUserDefinedFields(item) {
576
     UpdateUserDefinedFields(item) {
569
       let update = false;
577
       let update = false;
570
-      this.propertyFieldValues.forEach((element) => {
578
+      this.propertyFieldValues.forEach(element => {
571
         if (element.userDefinedFieldId === item.userDefinedFieldId) {
579
         if (element.userDefinedFieldId === item.userDefinedFieldId) {
572
           element.value = item.value;
580
           element.value = item.value;
573
           update = true;
581
           update = true;
579
     },
587
     },
580
     UpdateDefaultImage(item) {
588
     UpdateDefaultImage(item) {
581
       this.defaultImage = item;
589
       this.defaultImage = item;
582
-    },
590
+    }
583
   },
591
   },
584
   mounted() {
592
   mounted() {
585
     this.wait = false;
593
     this.wait = false;
594
     if (this.propertyFields.length > 0) {
602
     if (this.propertyFields.length > 0) {
595
       this.propertyFields = [];
603
       this.propertyFields = [];
596
     }
604
     }
597
-    if (this.property.description !== '') {
598
-      this.property.description = '';
605
+    if (this.property.description !== "") {
606
+      this.property.description = "";
599
     }
607
     }
600
 
608
 
601
     if (this.$route.params.propertyUsageType) {
609
     if (this.$route.params.propertyUsageType) {
610
     this.getPropertyFields(this.propertyType);
618
     this.getPropertyFields(this.propertyType);
611
   },
619
   },
612
   computed: {
620
   computed: {
613
-    ...mapState('searchTab', ['provinces', 'cities', 'suburbs']),
614
-    ...mapState('property', [
615
-      'propertyTypes',
616
-      'propertyOverviewFields',
617
-      'propertyFields',
618
-      'property',
619
-      'propertyImages',
621
+    ...mapState("searchTab", ["provinces", "cities", "suburbs"]),
622
+    ...mapState("property", [
623
+      "propertyTypes",
624
+      "propertyOverviewFields",
625
+      "propertyFields",
626
+      "property",
627
+      "propertyImages"
620
     ]),
628
     ]),
621
-    ...mapState('authentication', ['user']),
629
+    ...mapState("authentication", ["user"]),
622
     SalesTypeChanged() {
630
     SalesTypeChanged() {
623
       // eslint-disable-next-line vue/no-side-effects-in-computed-properties
631
       // eslint-disable-next-line vue/no-side-effects-in-computed-properties
624
       // this.propertyType = this.$route.params.propType;
632
       // this.propertyType = this.$route.params.propType;
636
       this.getPropertyTypes(this.propertyType);
644
       this.getPropertyTypes(this.propertyType);
637
 
645
 
638
       return this.propertyType;
646
       return this.propertyType;
639
-    },
647
+    }
640
   },
648
   },
641
   watch: {
649
   watch: {
642
     SalesTypeChanged() {
650
     SalesTypeChanged() {
643
       return null;
651
       return null;
644
-    },
645
-  },
652
+    }
653
+  }
646
 };
654
 };
647
 </script>
655
 </script>

+ 29
- 28
src/components/property/propertyList.vue Wyświetl plik

29
 </template>
29
 </template>
30
 
30
 
31
 <script>
31
 <script>
32
-import { mapState, mapActions } from 'vuex';
33
-import listView from '../shared/listView.vue';
32
+import { mapState, mapActions } from "vuex";
33
+import listView from "../shared/listView.vue";
34
+import Log from "../../assets/Log";
34
 
35
 
35
 export default {
36
 export default {
36
-  name: 'PropertyList',
37
+  name: "PropertyList",
37
   components: {
38
   components: {
38
-    listView,
39
+    listView
39
   },
40
   },
40
   data() {
41
   data() {
41
     return {
42
     return {
42
-      propertyType: '',
43
-      role: 'MY',
43
+      propertyType: "",
44
+      role: "MY",
45
+      user: Log.getUser()
44
     };
46
     };
45
   },
47
   },
46
   methods: {
48
   methods: {
47
-    ...mapActions('propertyList', ['getProperties', 'deleteProperty']),
49
+    ...mapActions("propertyList", ["getProperties", "deleteProperty"]),
48
     Edit(item) {
50
     Edit(item) {
49
-      const salesType = item.isSale ? 'Sale' : 'Rental';
51
+      const salesType = item.isSale ? "Sale" : "Rental";
50
       this.$router.push({
52
       this.$router.push({
51
-        path: '/property/edit',
52
-        query: { id: item.id },
53
+        path: "/property/edit",
54
+        query: { id: item.id }
53
       });
55
       });
54
     },
56
     },
55
     Delete(item) {
57
     Delete(item) {
56
       this.deleteProperty(item.id);
58
       this.deleteProperty(item.id);
57
-    },
59
+    }
58
   },
60
   },
59
   mounted() {
61
   mounted() {
60
-    if (this.user.role === 'Super Admin') {
61
-      this.role = 'SUPERADMIN';
62
+    if (this.user.role === "Super Admin") {
63
+      this.role = "SUPERADMIN";
62
     }
64
     }
63
-    if (this.user.role === 'Agency') {
64
-      this.user.role = 'ADMIN';
65
+    if (this.user.role === "Agency") {
66
+      this.role = "ADMIN";
65
     }
67
     }
66
 
68
 
67
     this.getProperties(
69
     this.getProperties(
68
       Object.assign({
70
       Object.assign({
69
         propertyType: this.role,
71
         propertyType: this.role,
70
-        user: this.user.id,
71
-      }),
72
+        user: this.user.id
73
+      })
72
     );
74
     );
73
   },
75
   },
74
   computed: {
76
   computed: {
75
-    ...mapState('propertyList', ['properties']),
76
-    ...mapState('authentication', ['user']),
77
+    ...mapState("propertyList", ["properties"]),
77
     UserChanged() {
78
     UserChanged() {
78
-      if (this.user.role === 'Super Admin') {
79
+      if (this.user.role === "Super Admin") {
79
         // eslint-disable-next-line vue/no-side-effects-in-computed-properties
80
         // eslint-disable-next-line vue/no-side-effects-in-computed-properties
80
-        this.role = 'SUPERADMIN';
81
+        this.role = "SUPERADMIN";
81
       }
82
       }
82
-      if (this.user.role === 'Agency') {
83
+      if (this.user.role === "Agency") {
83
         // eslint-disable-next-line vue/no-side-effects-in-computed-properties
84
         // eslint-disable-next-line vue/no-side-effects-in-computed-properties
84
-        this.user.role = 'ADMIN';
85
+        this.role = "ADMIN";
85
       }
86
       }
86
 
87
 
87
       this.getProperties(
88
       this.getProperties(
88
         Object.assign({
89
         Object.assign({
89
           propertyType: this.role,
90
           propertyType: this.role,
90
-          user: this.user.id,
91
-        }),
91
+          user: this.user.id
92
+        })
92
       );
93
       );
93
       return this.user;
94
       return this.user;
94
-    },
95
+    }
95
   },
96
   },
96
   watch: {
97
   watch: {
97
     UserChanged() {
98
     UserChanged() {
98
       console.log(this.user);
99
       console.log(this.user);
99
-    },
100
-  },
100
+    }
101
+  }
101
 };
102
 };
102
 </script>
103
 </script>

+ 19
- 19
src/components/property/propertyPage.vue Wyświetl plik

149
                               id: property.id,
149
                               id: property.id,
150
                               shortDescription: property.shortDescription,
150
                               shortDescription: property.shortDescription,
151
                               description: property.description,
151
                               description: property.description,
152
-                              sellPrice: property.price
152
+                              price: property.price
153
                             }"
153
                             }"
154
                           />
154
                           />
155
                         </div>
155
                         </div>
283
 </template>
283
 </template>
284
 
284
 
285
 <script>
285
 <script>
286
-import { mapState, mapActions } from 'vuex';
287
-import makeOffer from '../processFlow/makeOffer.vue';
288
-import gallery from '../shared/gallerySlideShow.vue';
286
+import { mapState, mapActions } from "vuex";
287
+import makeOffer from "../processFlow/makeOffer.vue";
288
+import gallery from "../shared/gallerySlideShow.vue";
289
 
289
 
290
 export default {
290
 export default {
291
-  name: 'property',
291
+  name: "property",
292
   components: {
292
   components: {
293
     makeOffer,
293
     makeOffer,
294
-    gallery,
294
+    gallery
295
   },
295
   },
296
   data() {
296
   data() {
297
     return {
297
     return {
298
       index: null,
298
       index: null,
299
-      date: new Date(),
299
+      date: new Date()
300
     };
300
     };
301
   },
301
   },
302
   mounted() {
302
   mounted() {
305
     this.mayEditProperty(this.$route.params.id);
305
     this.mayEditProperty(this.$route.params.id);
306
   },
306
   },
307
   computed: {
307
   computed: {
308
-    ...mapState('property', ['property', 'propertyImages']),
309
-    ...mapState('propertyEdit', ['mayEdit']),
308
+    ...mapState("property", ["property", "propertyImages"]),
309
+    ...mapState("propertyEdit", ["mayEdit"])
310
   },
310
   },
311
   methods: {
311
   methods: {
312
-    ...mapActions('property', [
313
-      'getProperty',
314
-      'getPropertyImages',
315
-      'clearPropertyImages',
312
+    ...mapActions("property", [
313
+      "getProperty",
314
+      "getPropertyImages",
315
+      "clearPropertyImages"
316
     ]),
316
     ]),
317
-    ...mapActions('propertyEdit', ['mayEditProperty']),
317
+    ...mapActions("propertyEdit", ["mayEditProperty"]),
318
     formatPrice(value) {
318
     formatPrice(value) {
319
       const val = (value / 1).toFixed(2);
319
       const val = (value / 1).toFixed(2);
320
-      return val.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ' ');
320
+      return val.toString().replace(/\B(?=(\d{3})+(?!\d))/g, " ");
321
     },
321
     },
322
     formatAddress(value) {
322
     formatAddress(value) {
323
-      if (value !== '') {
323
+      if (value !== "") {
324
         return `${value}<br/>`;
324
         return `${value}<br/>`;
325
       }
325
       }
326
-      return '';
327
-    },
326
+      return "";
327
+    }
328
   },
328
   },
329
   beforeDestroy() {
329
   beforeDestroy() {
330
     this.clearPropertyImages();
330
     this.clearPropertyImages();
331
-  },
331
+  }
332
 };
332
 };
333
 </script>
333
 </script>
334
 
334
 

+ 20
- 12
src/components/property/propertySearchPage.vue Wyświetl plik

150
   </div>
150
   </div>
151
 </template>
151
 </template>
152
 <script>
152
 <script>
153
-import { mapState, mapActions } from 'vuex';
154
-import autoComplete from '../shared/autoComplete.vue';
153
+import { mapState, mapActions } from "vuex";
154
+import autoComplete from "../shared/autoComplete.vue";
155
 
155
 
156
 export default {
156
 export default {
157
-  name: 'propertysearch',
157
+  name: "propertysearch",
158
   components: {
158
   components: {
159
-    autoComplete,
159
+    autoComplete
160
   },
160
   },
161
   data() {
161
   data() {
162
     return {
162
     return {
163
-      propertyUsageType: 'Residential',
164
-      salesType: 'Sale',
165
-      searchText: '',
163
+      propertyUsageType: "Residential",
164
+      salesType: "Sale",
165
+      searchText: ""
166
     };
166
     };
167
   },
167
   },
168
   computed: {
168
   computed: {
169
-    ...mapState('propertySearch', ['suburbs', 'suburbList', 'propertySearch']),
169
+    ...mapState("propertySearch", ["suburbs", "suburbList", "propertySearch"])
170
   },
170
   },
171
   methods: {
171
   methods: {
172
-    ...mapActions('propertySearch', ['getSuburbs', 'applyFilter']),
172
+    ...mapActions("propertySearch", ["getSuburbs", "applyFilter"]),
173
     SetType(item) {
173
     SetType(item) {
174
       this.propertyUsageType = item;
174
       this.propertyUsageType = item;
175
+      localStorage.propertySearchUsageType = item;
175
     },
176
     },
176
     SearchClick() {
177
     SearchClick() {
177
       const item = this.suburbs.find(s => s.display === this.searchText);
178
       const item = this.suburbs.find(s => s.display === this.searchText);
181
       this.propertySearch.propertyUsageType = this.propertyUsageType;
182
       this.propertySearch.propertyUsageType = this.propertyUsageType;
182
       this.propertySearch.salesType = this.salesType;
183
       this.propertySearch.salesType = this.salesType;
183
 
184
 
184
-      this.$router.push('/property/propertySearch/results');
185
+      this.$router.push("/property/propertySearch/results");
185
     },
186
     },
186
     Filter() {
187
     Filter() {
187
       this.applyFilter(this.searchText);
188
       this.applyFilter(this.searchText);
191
     },
192
     },
192
     SelectedFilter(item) {
193
     SelectedFilter(item) {
193
       this.searchText = item;
194
       this.searchText = item;
194
-    },
195
+    }
195
   },
196
   },
196
   mounted() {
197
   mounted() {
197
     this.getSuburbs();
198
     this.getSuburbs();
198
-  },
199
+    if (this.$route.params.propertyUsageType) {
200
+      this.propertyUsageType = this.$route.params.propertyUsageType;
201
+    } else if (localStorage.propertySearchUsageType) {
202
+      this.propertyUsageType = localStorage.propertySearchUsageType;
203
+    } else {
204
+      this.propertyUsageType = "Residential";
205
+    }
206
+  }
199
 };
207
 };
200
 </script>
208
 </script>

+ 23
- 27
src/components/property/propertySearchResults.vue Wyświetl plik

57
   </div>
57
   </div>
58
 </template>
58
 </template>
59
 <script>
59
 <script>
60
-import { mapState, mapActions } from 'vuex';
61
-import propertyCard from './propertyCard.vue';
60
+import { mapState, mapActions } from "vuex";
61
+import propertyCard from "./propertyCard.vue";
62
 
62
 
63
 export default {
63
 export default {
64
-  name: 'propertysearch',
64
+  name: "propertysearch",
65
   components: {
65
   components: {
66
-    propertyCard,
66
+    propertyCard
67
   },
67
   },
68
   data() {
68
   data() {
69
     return {};
69
     return {};
70
   },
70
   },
71
   mounted() {
71
   mounted() {
72
-    if (typeof this.propertySearch.propertyUsageType === 'undefined') {
73
-      this.propertySearch.propertyUsageType = 'Residential';
72
+    if (typeof this.propertySearch.propertyUsageType === "undefined") {
73
+      this.propertySearch.propertyUsageType = "Residential";
74
     }
74
     }
75
     if (this.user) {
75
     if (this.user) {
76
       this.propertySearch.userName = this.user.username;
76
       this.propertySearch.userName = this.user.username;
77
     }
77
     }
78
+
78
     this.searchProperties(this.propertySearch);
79
     this.searchProperties(this.propertySearch);
79
   },
80
   },
80
   methods: {
81
   methods: {
81
-    ...mapActions('propertySearch', [
82
-      'searchProperties',
83
-      'clearProperties',
84
-      'updateResultsShowing',
82
+    ...mapActions("propertySearch", [
83
+      "searchProperties",
84
+      "clearProperties",
85
+      "updateResultsShowing"
85
     ]),
86
     ]),
86
     SetType(item) {
87
     SetType(item) {
87
       this.propertySearch.propertyUsageType = item;
88
       this.propertySearch.propertyUsageType = item;
88
     },
89
     },
89
     SearchPage() {
90
     SearchPage() {
90
       this.clearProperties();
91
       this.clearProperties();
91
-      this.$router.push('/property/search');
92
-    },
92
+      this.$router.push("/property/search");
93
+    }
93
   },
94
   },
94
   computed: {
95
   computed: {
95
-    ...mapState('propertySearch', [
96
-      'properties',
97
-      'propertySearch',
98
-      'resultsShowing',
99
-    ]),
100
-    ...mapState('authentication', ['user']),
96
+    ...mapState("propertySearch", ["properties", "propertySearch", "resultsShowing"]),
97
+    ...mapState("authentication", ["user"]),
101
     ParamsChanged() {
98
     ParamsChanged() {
102
-      if (this.resultsShowing) {
103
-        if (typeof this.propertySearch.propertyUsageType === 'undefined') {
104
-          // eslint-disable-next-line vue/no-side-effects-in-computed-properties
105
-          this.propertySearch.propertyUsageType = 'Residential';
106
-        }
107
-        this.searchProperties(this.propertySearch);
99
+      console.log(JSON.stringify(this.propertySearch));
100
+      if (typeof this.propertySearch.propertyUsageType === "undefined") {
101
+        // eslint-disable-next-line vue/no-side-effects-in-computed-properties
102
+        this.propertySearch.propertyUsageType = "Residential";
108
       }
103
       }
104
+      this.searchProperties(this.propertySearch);
109
       return null;
105
       return null;
110
-    },
106
+    }
111
   },
107
   },
112
   watch: {
108
   watch: {
113
     ParamsChanged() {
109
     ParamsChanged() {
114
       return null;
110
       return null;
115
-    },
116
-  },
111
+    }
112
+  }
117
 };
113
 };
118
 </script>
114
 </script>

+ 89
- 25
src/components/shared/listView.vue Wyświetl plik

1
-/* eslint-disable no-restricted-syntax */
2
-/* eslint-disable guard-for-in */
1
+/* eslint-disable no-restricted-syntax */ /* eslint-disable guard-for-in */
3
 <template>
2
 <template>
4
   <div>
3
   <div>
5
     <div style="height:5px"></div>
4
     <div style="height:5px"></div>
8
         <input v-model="searchItem" class="form-control" placeholder="Search...." />
7
         <input v-model="searchItem" class="form-control" placeholder="Search...." />
9
       </div>
8
       </div>
10
       <div class="p-2" v-if="title">
9
       <div class="p-2" v-if="title">
11
-        <h2>{{title}}</h2>
10
+        <h2>{{ title }}</h2>
12
       </div>
11
       </div>
13
       <div class="p-2">
12
       <div class="p-2">
14
         <div class="d-flex flex-row">
13
         <div class="d-flex flex-row">
17
               class="btn btn-primary myBackground btn-width cursor-pointer"
16
               class="btn btn-primary myBackground btn-width cursor-pointer"
18
               data-toggle="modal"
17
               data-toggle="modal"
19
               data-target="#myModal"
18
               data-target="#myModal"
20
-            >Column Chooser</div>
19
+            >
20
+              Column Chooser
21
+            </div>
21
             <div class="col-md-12">
22
             <div class="col-md-12">
22
               <div id="myModal" class="modal fade" role="dialog">
23
               <div id="myModal" class="modal fade" role="dialog">
23
                 <div class="modal-dialog modal-lg">
24
                 <div class="modal-dialog modal-lg">
39
             <div
40
             <div
40
               class="btn btn-primary myBackground btn-width cursor-pointer"
41
               class="btn btn-primary myBackground btn-width cursor-pointer"
41
               @click="onClearSelected()"
42
               @click="onClearSelected()"
42
-            >Clear Selected</div>
43
+            >
44
+              Clear Selected
45
+            </div>
43
           </div>
46
           </div>
44
           <div class="p2" v-if="showNew">
47
           <div class="p2" v-if="showNew">
45
-            <div class="btn btn-primary myBackground btn-width cursor-pointer" @click="onNew()">New</div>
48
+            <div class="btn btn-primary myBackground btn-width cursor-pointer" @click="onNew()">
49
+              New
50
+            </div>
46
           </div>
51
           </div>
47
         </div>
52
         </div>
48
       </div>
53
       </div>
51
     <div v-if="items && items.length > 0" class="table-responsive">
56
     <div v-if="items && items.length > 0" class="table-responsive">
52
       <table
57
       <table
53
         id="table"
58
         id="table"
54
-        :class="{'table table-hover': (1 === 1), 'table-sm': compact, 'table-bordered': bordered}"
59
+        :class="{ 'table table-hover': 1 === 1, 'table-sm': compact, 'table-bordered': bordered }"
55
       >
60
       >
56
         <thead>
61
         <thead>
57
           <tr class="dnd-moved">
62
           <tr class="dnd-moved">
63
                 :class="{ active: hover === c }"
68
                 :class="{ active: hover === c }"
64
               >
69
               >
65
                 <div class="d-flex bd-highlight">
70
                 <div class="d-flex bd-highlight">
66
-                  <div class="p-2 w-100 bd-highlight">{{ column | toProper }}</div>
71
+                  <div v-if="displayHeaders.length === 0" class="p-2 w-100 bd-highlight">
72
+                    {{ column | toProper }}
73
+                  </div>
74
+                  <div v-else class="p-2 w-100 bd-highlight">
75
+                    {{ displayHeaders[c] !== "" ? displayHeaders[c] : column | toProper }}
76
+                  </div>
67
                   <div class="p-2 flex-shrink-1 bd-highlight">
77
                   <div class="p-2 flex-shrink-1 bd-highlight">
68
                     <img
78
                     <img
69
                       src="../../../public/img/sort-up.png"
79
                       src="../../../public/img/sort-up.png"
88
             v-for="(item, i) in DisplayItems"
98
             v-for="(item, i) in DisplayItems"
89
             :key="i"
99
             :key="i"
90
             @click="onRowClick(item, i)"
100
             @click="onRowClick(item, i)"
91
-            :class="{'selected': isSelected(i), 'cursor-pointer': allowSelect}"
101
+            :class="{ selected: isSelected(i), 'cursor-pointer': allowSelect }"
92
           >
102
           >
93
-            <td
94
-              v-for="(column, c) in Columns"
95
-              :key="c"
96
-            >{{ isObject(item[column]) ? item[column].display : item[column] }}</td>
103
+            <td v-for="(column, c) in Columns" :key="c">
104
+              <div v-if="displayFormats.length === 0">
105
+                {{ isObject(item[column]) ? item[column].display : item[column] }}
106
+              </div>
107
+              <div v-else-if="displayFormats.length > 0 && displayFormats[c] === 'date'">
108
+                {{ isObject(item[column]) ? item[column].display : item[column] | toDate }}
109
+              </div>
110
+              <div v-else-if="displayFormats.length > 0 && displayFormats[c] === 'money'">
111
+                {{ isObject(item[column]) ? item[column].display : item[column] | toCurrency }}
112
+              </div>
113
+              <div v-else-if="displayFormats.length > 0 && displayFormats[c] === 'image'">
114
+                <img :src="item[column]" style="height:100px; width:100px; object-fit: cover;" />
115
+              </div>
116
+              <div v-else>
117
+                {{ isObject(item[column]) ? item[column].display : item[column] }}
118
+              </div>
119
+            </td>
97
             <td v-if="editable" class="my-width">
120
             <td v-if="editable" class="my-width">
98
               <button type="button" class="btn my-btn" @click="onEdit(item)">Edit</button>
121
               <button type="button" class="btn my-btn" @click="onEdit(item)">Edit</button>
99
             </td>
122
             </td>
104
         </tbody>
127
         </tbody>
105
       </table>
128
       </table>
106
       <div class="d-flex justify-content-between" v-if="showPager">
129
       <div class="d-flex justify-content-between" v-if="showPager">
107
-        <div
108
-          class="p-1"
109
-        >{{ currentPage + ' / ' + PageCount + (!hideItemCount ? ' - (' + items.length + ' items)' : '')}}</div>
130
+        <div class="p-1">
131
+          {{
132
+            currentPage +
133
+              " / " +
134
+              PageCount +
135
+              (!hideItemCount ? " - (" + items.length + " items)" : "")
136
+          }}
137
+        </div>
110
         <div class="p-1">
138
         <div class="p-1">
111
           <BasePagination
139
           <BasePagination
112
             :currentPage="currentPage"
140
             :currentPage="currentPage"
212
     },
240
     },
213
     showColumnChooser: {
241
     showColumnChooser: {
214
       default: true
242
       default: true
243
+    },
244
+    displayColumns: {
245
+      default: []
246
+    },
247
+    displayFormats: {
248
+      default: []
249
+    },
250
+    displayHeaders: {
251
+      default: []
215
     }
252
     }
216
   },
253
   },
217
   data() {
254
   data() {
247
         for (const i in Object.keys(this.items)) {
284
         for (const i in Object.keys(this.items)) {
248
           const item = this.items[i];
285
           const item = this.items[i];
249
           for (const o in Object.keys(item)) {
286
           for (const o in Object.keys(item)) {
250
-            if (
251
-              !listAll.includes(Object.keys(item)[o]) &&
252
-              !Array.isArray(Object.values(item)[o])
253
-            ) {
287
+            if (!listAll.includes(Object.keys(item)[o]) && !Array.isArray(Object.values(item)[o])) {
254
               const columnName = Object.keys(item)[o];
288
               const columnName = Object.keys(item)[o];
255
               if (!listAll.some(x => x.column === columnName))
289
               if (!listAll.some(x => x.column === columnName))
256
                 listAll.push({
290
                 listAll.push({
277
     isObject(item) {
311
     isObject(item) {
278
       return !!item && item.constructor === Object;
312
       return !!item && item.constructor === Object;
279
     },
313
     },
314
+    isDate(item) {
315
+      return !!item && item.constructor === Date;
316
+    },
317
+    isDecimal(item) {
318
+      if (!!item && item.constructor === Number && item.indexOf(".") > 0) {
319
+        return true;
320
+      }
321
+      return false;
322
+    },
323
+    isImage(item) {
324
+      return (
325
+        !!item &&
326
+        item.constructor === String &&
327
+        item.length > 9 &&
328
+        item.substring(0, 9) === "data:image"
329
+      );
330
+    },
280
     onEdit(item) {
331
     onEdit(item) {
281
       this.$emit("onEdit", item);
332
       this.$emit("onEdit", item);
282
     },
333
     },
332
       if (this.currentPage !== 1) {
383
       if (this.currentPage !== 1) {
333
         this.currentPage = 1;
384
         this.currentPage = 1;
334
       }
385
       }
386
+    },
387
+    inArray: function(array, value) {
388
+      var lenght = array.length;
389
+      for (var i = 0; i < lenght; i++) {
390
+        if (array[i] === value) return true;
391
+      }
392
+      return false;
335
     }
393
     }
336
   },
394
   },
337
   computed: {
395
   computed: {
354
       if (!this.allColumn || this.allColumn.length === 0) {
412
       if (!this.allColumn || this.allColumn.length === 0) {
355
         this.getInitColumn();
413
         this.getInitColumn();
356
       }
414
       }
357
-      const list = _.filter(this.allColumn, x => x.show);
358
-      for (const i in list) {
359
-        const item = list[i];
360
-        if (item) {
361
-          listColumns.push(item.column);
415
+      if (this.displayColumns.length > 0) {
416
+        for (let i = 0; i < this.displayColumns.length; i++) {
417
+          listColumns.push(this.displayColumns[i]);
418
+        }
419
+      } else {
420
+        const list = _.filter(this.allColumn, x => x.show);
421
+        for (const i in list) {
422
+          const item = list[i];
423
+          if (item) {
424
+            listColumns.push(item.column);
425
+          }
362
         }
426
         }
363
       }
427
       }
364
       return listColumns;
428
       return listColumns;

+ 47
- 20
src/components/shared/searchTab.vue Wyświetl plik

17
                     <i class="fa fa-search"></i>
17
                     <i class="fa fa-search"></i>
18
                   </span>
18
                   </span>
19
                 </div>
19
                 </div>
20
-                <input type="text" class="form-control" placeholder="Keyword" v-model="keyword" />
21
-                <div class="input-group-append" @click="clearFilter('resort')">
20
+                <input
21
+                  type="text"
22
+                  class="form-control"
23
+                  placeholder="Keyword"
24
+                  v-model="keyword"
25
+                  @change="keywordChanged"
26
+                />
27
+                <div class="input-group-append" @click="clearKeyword()">
22
                   <span class="input-group-text cursor-pointer myFill">
28
                   <span class="input-group-text cursor-pointer myFill">
23
                     <b>X</b>
29
                     <b>X</b>
24
                   </span>
30
                   </span>
29
           <div class="col-md-2">
35
           <div class="col-md-2">
30
             <button
36
             <button
31
               type="button"
37
               type="button"
32
-              :class="[selectedPropertyType === 'Timeshare' ? 'tabButton isSelected' : 'tabButton isUnSelected']"
38
+              :class="[
39
+                selectedPropertyType === 'Timeshare'
40
+                  ? 'tabButton isSelected'
41
+                  : 'tabButton isUnSelected'
42
+              ]"
33
               @click="setTypeTimeshare"
43
               @click="setTypeTimeshare"
34
             >
44
             >
35
               <b>Timeshare</b>
45
               <b>Timeshare</b>
38
           <div class="col-md-2">
48
           <div class="col-md-2">
39
             <button
49
             <button
40
               type="button"
50
               type="button"
41
-              :class="[selectedPropertyType === 'Residential' ? 'tabButton isSelected' : 'tabButton isUnSelected']"
51
+              :class="[
52
+                selectedPropertyType === 'Residential'
53
+                  ? 'tabButton isSelected'
54
+                  : 'tabButton isUnSelected'
55
+              ]"
42
               @click="setTypeResidential"
56
               @click="setTypeResidential"
43
             >
57
             >
44
               <b>Residential</b>
58
               <b>Residential</b>
47
           <div class="col-md-2">
61
           <div class="col-md-2">
48
             <button
62
             <button
49
               type="button"
63
               type="button"
50
-              :class="[selectedPropertyType === 'Commercial' ? 'tabButton isSelected' : 'tabButton isUnSelected']"
64
+              :class="[
65
+                selectedPropertyType === 'Commercial'
66
+                  ? 'tabButton isSelected'
67
+                  : 'tabButton isUnSelected'
68
+              ]"
51
               @click="setTypeCommercial"
69
               @click="setTypeCommercial"
52
             >
70
             >
53
               <b>Commercial</b>
71
               <b>Commercial</b>
69
 </template>
87
 </template>
70
 
88
 
71
 <script>
89
 <script>
72
-import { mapState } from 'vuex';
73
-import propertySearch from '../property/propertySearchFields.vue';
74
-import timeshareSearch from '../timeshare/searchTimeshare.vue';
90
+import { mapState } from "vuex";
91
+import propertySearch from "../property/propertySearchFields.vue";
92
+import timeshareSearch from "../timeshare/searchTimeshare.vue";
75
 
93
 
76
 export default {
94
 export default {
77
   components: {
95
   components: {
78
     propertySearch,
96
     propertySearch,
79
-    timeshareSearch,
97
+    timeshareSearch
80
   },
98
   },
81
   data() {
99
   data() {
82
     return {
100
     return {
83
-      selectedPropertyType: 'Timeshare',
84
-      keyword: '',
101
+      selectedPropertyType: "Timeshare",
102
+      keyword: ""
85
     };
103
     };
86
   },
104
   },
87
   computed: {
105
   computed: {
88
-    ...mapState('weekList', ['filter']),
89
-    ...mapState('propertySearch', ['propertySearch']),
106
+    ...mapState("weekList", ["filter"]),
107
+    ...mapState("propertySearch", ["propertySearch"])
90
   },
108
   },
91
   methods: {
109
   methods: {
92
     updateType(item) {
110
     updateType(item) {
93
       this.selectedPropertyType = item;
111
       this.selectedPropertyType = item;
94
     },
112
     },
95
     Search() {
113
     Search() {
96
-      if (this.selectedPropertyType === 'Timeshare') {
97
-        this.$router.push('/timesharesearch');
114
+      if (this.selectedPropertyType === "Timeshare") {
115
+        this.$router.push("/timesharesearch");
98
       } else {
116
       } else {
99
-        this.$router.push('/property/propertySearch/results');
117
+        this.propertySearch.keyword = this.keyword;
118
+        this.$router.push("/property/propertySearch/results");
100
       }
119
       }
101
     },
120
     },
102
     setTypeTimeshare() {
121
     setTypeTimeshare() {
103
-      this.selectedPropertyType = 'Timeshare';
122
+      this.selectedPropertyType = "Timeshare";
104
     },
123
     },
105
     setTypeResidential() {
124
     setTypeResidential() {
106
-      this.selectedPropertyType = 'Residential';
125
+      this.selectedPropertyType = "Residential";
107
     },
126
     },
108
     setTypeCommercial() {
127
     setTypeCommercial() {
109
-      this.selectedPropertyType = 'Commercial';
128
+      this.selectedPropertyType = "Commercial";
110
     },
129
     },
111
-  },
130
+    clearKeyword() {
131
+      this.keyword = "";
132
+    },
133
+    keywordChanged() {
134
+      if (this.selectedPropertyType !== "Timeshare") {
135
+        this.propertySearch.keyword = this.keyword;
136
+      }
137
+    }
138
+  }
112
 };
139
 };
113
 </script>
140
 </script>

+ 22
- 18
src/main.js Wyświetl plik

1
 /* eslint-disable prefer-template */
1
 /* eslint-disable prefer-template */
2
-import Vue from 'vue';
3
-import EvaIcons from 'vue-eva-icons';
4
-import axios from 'axios';
5
-import App from './App.vue';
6
-import router from './router';
7
-import store from './store';
2
+import Vue from "vue";
3
+import EvaIcons from "vue-eva-icons";
4
+import axios from "axios";
5
+import App from "./App.vue";
6
+import router from "./router";
7
+import store from "./store";
8
+import moment from "moment";
8
 
9
 
9
 Vue.use(EvaIcons);
10
 Vue.use(EvaIcons);
10
 
11
 
11
 Vue.config.productionTip = false;
12
 Vue.config.productionTip = false;
12
 
13
 
13
 Vue.prototype.$http = axios;
14
 Vue.prototype.$http = axios;
14
-const token = localStorage.getItem('token');
15
+const token = localStorage.getItem("token");
15
 if (token) {
16
 if (token) {
16
   Vue.prototype.$http.defaults.headers.common.Authorization = token;
17
   Vue.prototype.$http.defaults.headers.common.Authorization = token;
17
 }
18
 }
22
       next();
23
       next();
23
       return;
24
       return;
24
     }
25
     }
25
-    next('/users/login');
26
+    next("/users/login");
26
   } else {
27
   } else {
27
     next();
28
     next();
28
   }
29
   }
29
 });
30
 });
30
 
31
 
31
-Vue.filter('toCurrency', (value) => {
32
-  if (typeof value !== 'number') {
32
+Vue.filter("toCurrency", value => {
33
+  if (typeof value !== "number") {
33
     return value;
34
     return value;
34
   }
35
   }
35
-  const formatter = new Intl.NumberFormat('en-US', {
36
-    minimumFractionDigits: 2,
36
+  const formatter = new Intl.NumberFormat("en-US", {
37
+    minimumFractionDigits: 2
37
   });
38
   });
38
   return `R ${formatter.format(value)}`;
39
   return `R ${formatter.format(value)}`;
39
 });
40
 });
40
 
41
 
41
-Vue.filter('toProper', (value) => {
42
-  if (typeof value !== 'string') {
42
+Vue.filter("toProper", value => {
43
+  if (typeof value !== "string") {
43
     console.log(typeof value);
44
     console.log(typeof value);
44
     return value;
45
     return value;
45
   }
46
   }
46
-  value = value.replace(/([a-z])([A-Z])/g, '$1 $2');
47
+  value = value.replace(/([a-z])([A-Z])/g, "$1 $2");
47
   return value.charAt(0).toUpperCase() + value.slice(1);
48
   return value.charAt(0).toUpperCase() + value.slice(1);
48
 });
49
 });
49
 
50
 
51
+Vue.filter("toDate", value => value.substring(0, value.length > 9 ? 10 : value.length));
50
 
52
 
51
-Vue.filter('toDate', value => value.substring(0, value.length > 9 ? 10 : value.length));
53
+Vue.filter("toTime", value => {
54
+  return moment(String(value)).format("hh:mm");
55
+});
52
 
56
 
53
 new Vue({
57
 new Vue({
54
   render: h => h(App),
58
   render: h => h(App),
55
   router,
59
   router,
56
-  store,
57
-}).$mount('#app');
60
+  store
61
+}).$mount("#app");

+ 182
- 177
src/router/index.js Wyświetl plik

1
 /* eslint-disable import/prefer-default-export */
1
 /* eslint-disable import/prefer-default-export */
2
-import Vue from 'vue';
3
-import Router from 'vue-router';
2
+import Vue from "vue";
3
+import Router from "vue-router";
4
 
4
 
5
-import HomePage from '../components/home/homePage.vue';
5
+import HomePage from "../components/home/homePage.vue";
6
 
6
 
7
-import TimeshareBuy from '../components/timeshare/buy/buyPage.vue';
8
-import TimeshareSell from '../components/timeshare/sell/sellPage.vue';
9
-import TimeshareFAQ from '../components/timeshare/faqPage.vue';
10
-import TimeshareSearch from '../components/timeshare/buy/weekListPage.vue';
11
-import MyWeeksPage from '../components/timeshare/myWeeksPage.vue';
7
+import TimeshareBuy from "../components/timeshare/buy/buyPage.vue";
8
+import TimeshareSell from "../components/timeshare/sell/sellPage.vue";
9
+import TimeshareFAQ from "../components/timeshare/faqPage.vue";
10
+import TimeshareSearch from "../components/timeshare/buy/weekListPage.vue";
11
+import MyWeeksPage from "../components/timeshare/myWeeksPage.vue";
12
 
12
 
13
-import Login from '../components/user/loginPage.vue';
14
-import PrivateIndividual from '../components/user/registerPage.vue';
15
-import Agency from '../components/user/registerAgencySection.vue';
16
-import UpdateInfo from '../components/user/updateProfileInfo.vue';
13
+import Login from "../components/user/loginPage.vue";
14
+import PrivateIndividual from "../components/user/registerPage.vue";
15
+import Agency from "../components/user/registerAgencySection.vue";
16
+import UpdateInfo from "../components/user/updateProfileInfo.vue";
17
 
17
 
18
-import PropertySearch from '../components/property/propertySearchPage.vue';
19
-import PropertyPage from '../components/property/propertyPage.vue';
20
-import PropertyEdit from '../components/property/propertyeditPage.vue';
21
-import PropertyCreate from '../components/property/propertyCreate.vue';
22
-import PropertyList from '../components/property/propertyList.vue';
23
-import PropertyTypeList from '../components/admin/property/propertyTypeList.vue';
24
-import PropertyType from '../components/admin/property/propertyTypeEdit.vue';
25
-import UserDefinedGroups from '../components/admin/property/userDefinedGroupsPage.vue';
26
-import UserDefinedGroup from '../components/admin/property/userDefinedGroupPage.vue';
18
+import PropertySearch from "../components/property/propertySearchPage.vue";
19
+import PropertyPage from "../components/property/propertyPage.vue";
20
+import PropertyEdit from "../components/property/propertyeditPage.vue";
21
+import PropertyCreate from "../components/property/propertyCreate.vue";
22
+import PropertyList from "../components/property/propertyList.vue";
23
+import PropertyTypeList from "../components/admin/property/propertyTypeList.vue";
24
+import PropertyType from "../components/admin/property/propertyTypeEdit.vue";
25
+import UserDefinedGroups from "../components/admin/property/userDefinedGroupsPage.vue";
26
+import UserDefinedGroup from "../components/admin/property/userDefinedGroupPage.vue";
27
 
27
 
28
-import AboutUs from '../components/about/aboutUsPage.vue';
29
-import AboutTimeshare from '../components/about/aboutTimeshare.vue';
28
+import AboutUs from "../components/about/aboutUsPage.vue";
29
+import AboutTimeshare from "../components/about/aboutTimeshare.vue";
30
 
30
 
31
-import Status from '../components/admin/status/statusPage.vue';
32
-import timeshareAdminPage from '../components/admin/status/timeshareAdminPage.vue';
33
-import tenderWeekAdminPage from '../components/admin/status/tenderWeekAdminPage.vue';
34
-import userManagementPage from '../components/admin/status/userManagementPage.vue';
35
-import changeLogPage from '../components/admin/status/changeLogPage.vue';
36
-import UnitConfiguration from '../components/admin/unitConfiguration/unitConfigurationPage.vue';
37
-import agentManagementPage from '../components/admin/status/agentsUserManagementPage.vue';
31
+import Status from "../components/admin/status/statusPage.vue";
32
+import timeshareAdminPage from "../components/admin/status/timeshareAdminPage.vue";
33
+import tenderWeekAdminPage from "../components/admin/status/tenderWeekAdminPage.vue";
34
+import userManagementPage from "../components/admin/status/userManagementPage.vue";
35
+import changeLogPage from "../components/admin/status/changeLogPage.vue";
36
+import UnitConfiguration from "../components/admin/unitConfiguration/unitConfigurationPage.vue";
37
+import agentManagementPage from "../components/admin/status/agentsUserManagementPage.vue";
38
 
38
 
39
-import ResortPage from '../components/timeshare/resort/resortPage.vue';
40
-import UnitPage from '../components/timeshare/resort/unitPage.vue';
39
+import ResortPage from "../components/timeshare/resort/resortPage.vue";
40
+import UnitPage from "../components/timeshare/resort/unitPage.vue";
41
 
41
 
42
-import ContactUs from '../components/misc/contactUs.vue';
43
-import PrivacyPolicy from '../components/misc/privacyPolicyPage.vue';
42
+import ContactUs from "../components/misc/contactUs.vue";
43
+import PrivacyPolicy from "../components/misc/privacyPolicyPage.vue";
44
 
44
 
45
-import MakeOffer from '../components/processFlow/makeOffer.vue';
46
-import Offer from '../components/processFlow/offers.vue';
47
-import searchLog from '../components/admin/logs/SearchLogs.vue';
45
+import MakeOffer from "../components/processFlow/makeOffer.vue";
46
+import Offer from "../components/processFlow/offers.vue";
47
+import searchLog from "../components/admin/logs/SearchLogs.vue";
48
 // import store from '../store';
48
 // import store from '../store';
49
 
49
 
50
-import TemplatePage from '../components/communication/templatePage.vue';
51
-import CarouselList from '../components/admin/misc/carouselList.vue';
52
-import CarouselDetail from '../components/admin/misc/carousel.vue';
53
-import AlertPage from '../components/shared/alertPage.vue';
54
-import PropertySearchResults from '../components/property/propertySearchResults.vue';
50
+import TemplatePage from "../components/communication/templatePage.vue";
51
+import CarouselList from "../components/admin/misc/carouselList.vue";
52
+import CarouselDetail from "../components/admin/misc/carousel.vue";
53
+import AlertPage from "../components/shared/alertPage.vue";
54
+import PropertySearchResults from "../components/property/propertySearchResults.vue";
55
 
55
 
56
 Vue.use(Router);
56
 Vue.use(Router);
57
 
57
 
60
   scrollBehavior(to, from, savedPosition) {
60
   scrollBehavior(to, from, savedPosition) {
61
     return {
61
     return {
62
       x: 0,
62
       x: 0,
63
-      y: 0,
63
+      y: 0
64
     };
64
     };
65
   },
65
   },
66
   routes: [
66
   routes: [
67
     {
67
     {
68
-      path: '/',
69
-      name: 'Home',
70
-      component: HomePage,
68
+      path: "/",
69
+      name: "Home",
70
+      component: HomePage
71
     },
71
     },
72
     {
72
     {
73
-      path: '/shared/alert',
74
-      name: 'AlertPage',
75
-      component: AlertPage,
73
+      path: "/shared/alert",
74
+      name: "AlertPage",
75
+      component: AlertPage
76
     },
76
     },
77
     {
77
     {
78
-      path: '/about/us',
79
-      name: 'aboutus',
80
-      component: AboutUs,
78
+      path: "/about/us",
79
+      name: "aboutus",
80
+      component: AboutUs
81
     },
81
     },
82
     {
82
     {
83
-      path: '/about/timeshare',
84
-      name: 'abouttimeshare',
85
-      component: AboutTimeshare,
83
+      path: "/about/timeshare",
84
+      name: "abouttimeshare",
85
+      component: AboutTimeshare
86
     },
86
     },
87
     {
87
     {
88
-      path: '/communication/template',
89
-      name: 'template',
90
-      component: TemplatePage,
88
+      path: "/communication/template",
89
+      name: "template",
90
+      component: TemplatePage
91
     },
91
     },
92
     {
92
     {
93
-      path: '/timeshare/sell',
94
-      name: 'TimeshareSell',
95
-      component: TimeshareSell,
93
+      path: "/timeshare/sell",
94
+      name: "TimeshareSell",
95
+      component: TimeshareSell
96
+    },
97
+    {
98
+      path: "/timeshare/buy",
99
+      name: "TimeshareBuy",
100
+      component: TimeshareBuy
96
     },
101
     },
97
     {
102
     {
98
-      path: '/timeshare/buy',
99
-      name: 'TimeshareBuy',
100
-      component: TimeshareBuy,
103
+      path: "/timeshare/faq",
104
+      name: "TimeshareFAQ",
105
+      component: TimeshareFAQ
101
     },
106
     },
102
     {
107
     {
103
-      path: '/timeshare/faq',
104
-      name: 'TimeshareFAQ',
105
-      component: TimeshareFAQ,
108
+      path: "/timeshare/myWeeks",
109
+      name: "MyWeeks",
110
+      component: MyWeeksPage
106
     },
111
     },
107
     {
112
     {
108
-      path: '/timeshare/myWeeks',
109
-      name: 'MyWeeks',
110
-      component: MyWeeksPage,
113
+      path: "/user/login",
114
+      name: "Login",
115
+      component: Login
111
     },
116
     },
112
     {
117
     {
113
-      path: '/user/login',
114
-      name: 'Login',
115
-      component: Login,
118
+      path: "/user/updateProfileInfo",
119
+      name: "UpdateInfo",
120
+      component: UpdateInfo
116
     },
121
     },
117
     {
122
     {
118
-      path: '/user/updateProfileInfo',
119
-      name: 'UpdateInfo',
120
-      component: UpdateInfo,
123
+      path: "/user/register",
124
+      name: "PrivateIndividual",
125
+      component: PrivateIndividual
121
     },
126
     },
122
     {
127
     {
123
-      path: '/user/register',
124
-      name: 'PrivateIndividual',
125
-      component: PrivateIndividual,
128
+      path: "/user/registeragency",
129
+      name: "Agency",
130
+      component: Agency
126
     },
131
     },
127
     {
132
     {
128
-      path: '/user/registeragency',
129
-      name: 'Agency',
130
-      component: Agency,
133
+      path: "/property/property/:id",
134
+      name: "PropertyPage",
135
+      component: PropertyPage
131
     },
136
     },
132
     {
137
     {
133
-      path: '/property/property/:id',
134
-      name: 'PropertyPage',
135
-      component: PropertyPage,
138
+      path: "/property/search",
139
+      name: "PropertySearchTab",
140
+      component: PropertySearch
136
     },
141
     },
137
     {
142
     {
138
-      path: '/property/search',
139
-      name: 'PropertySearchTab',
140
-      component: PropertySearch,
143
+      path: "/property/search/:propertyUsageType",
144
+      name: "PropertySearchTabType",
145
+      component: PropertySearch
141
     },
146
     },
142
     {
147
     {
143
-      path: '/property/new/:saleType',
144
-      name: 'PropertyNew',
145
-      component: PropertyCreate,
148
+      path: "/property/new/:saleType",
149
+      name: "PropertyNew",
150
+      component: PropertyCreate
146
     },
151
     },
147
     {
152
     {
148
-      path: '/property/new/:propertyUsageType/:saleType',
149
-      name: 'PropertyNewFromSearch',
150
-      component: PropertyCreate,
153
+      path: "/property/new/:propertyUsageType/:saleType",
154
+      name: "PropertyNewFromSearch",
155
+      component: PropertyCreate
151
     },
156
     },
152
     {
157
     {
153
-      path: '/property/edit',
154
-      name: 'PropertyEdit',
155
-      component: PropertyEdit,
158
+      path: "/property/edit",
159
+      name: "PropertyEdit",
160
+      component: PropertyEdit
156
     },
161
     },
157
     {
162
     {
158
-      path: '/properties',
159
-      name: 'PropertyListAdmin',
160
-      component: PropertyList,
163
+      path: "/properties",
164
+      name: "PropertyListAdmin",
165
+      component: PropertyList
161
     },
166
     },
162
     {
167
     {
163
-      path: '/propertyTypes/list',
164
-      name: 'PropertyTypeList',
165
-      component: PropertyTypeList,
168
+      path: "/propertyTypes/list",
169
+      name: "PropertyTypeList",
170
+      component: PropertyTypeList
166
     },
171
     },
167
     {
172
     {
168
-      path: '/propertyType/new',
169
-      name: 'PropertyTypeNew',
170
-      component: PropertyType,
173
+      path: "/propertyType/new",
174
+      name: "PropertyTypeNew",
175
+      component: PropertyType
171
     },
176
     },
172
     {
177
     {
173
-      path: '/propertyType/:id',
174
-      name: 'PropertyTypeEdit',
175
-      component: PropertyType,
178
+      path: "/propertyType/:id",
179
+      name: "PropertyTypeEdit",
180
+      component: PropertyType
176
     },
181
     },
177
     {
182
     {
178
-      path: '/userDefinedGroups/list',
179
-      name: 'UserDefinedGroupsList',
180
-      component: UserDefinedGroups,
183
+      path: "/userDefinedGroups/list",
184
+      name: "UserDefinedGroupsList",
185
+      component: UserDefinedGroups
181
     },
186
     },
182
     {
187
     {
183
-      path: '/userDefinedGroups/userDefinedGroup/:id',
184
-      name: 'UserDefinedGroupEdit',
185
-      component: UserDefinedGroup,
188
+      path: "/userDefinedGroups/userDefinedGroup/:id",
189
+      name: "UserDefinedGroupEdit",
190
+      component: UserDefinedGroup
186
     },
191
     },
187
     {
192
     {
188
-      path: '/userDefinedGroups/userDefinedGroup',
189
-      name: 'UserDefinedGroupNew',
190
-      component: UserDefinedGroup,
193
+      path: "/userDefinedGroups/userDefinedGroup",
194
+      name: "UserDefinedGroupNew",
195
+      component: UserDefinedGroup
191
     },
196
     },
192
     {
197
     {
193
-      path: '/status/list',
194
-      name: 'StatusList',
195
-      component: Status,
198
+      path: "/status/list",
199
+      name: "StatusList",
200
+      component: Status
196
     },
201
     },
197
     {
202
     {
198
-      path: '/status/timeshareAdmin',
199
-      name: 'TimeshareAdmin',
200
-      component: timeshareAdminPage,
203
+      path: "/status/timeshareAdmin",
204
+      name: "TimeshareAdmin",
205
+      component: timeshareAdminPage
201
     },
206
     },
202
     {
207
     {
203
-      path: '/status/tenderWeekAdmin',
204
-      name: 'TenderWeekAdmin',
205
-      component: tenderWeekAdminPage,
208
+      path: "/status/tenderWeekAdmin",
209
+      name: "TenderWeekAdmin",
210
+      component: tenderWeekAdminPage
206
     },
211
     },
207
     {
212
     {
208
-      path: '/status/userManagementPage',
209
-      name: 'userManagementPage',
210
-      component: userManagementPage,
213
+      path: "/status/userManagementPage",
214
+      name: "userManagementPage",
215
+      component: userManagementPage
211
     },
216
     },
212
     {
217
     {
213
-      path: '/status/agentUserManagementPage',
214
-      name: 'agentManagementPage',
215
-      component: agentManagementPage,
218
+      path: "/status/agentUserManagementPage",
219
+      name: "agentManagementPage",
220
+      component: agentManagementPage
216
     },
221
     },
217
     {
222
     {
218
-      path: '/status/changeLogPage',
219
-      name: 'changeLogPage',
220
-      component: changeLogPage,
223
+      path: "/status/changeLogPage",
224
+      name: "changeLogPage",
225
+      component: changeLogPage
221
     },
226
     },
222
     {
227
     {
223
-      path: '/unitConfiguration/list',
224
-      name: 'UnitConfiguration',
225
-      component: UnitConfiguration,
228
+      path: "/unitConfiguration/list",
229
+      name: "UnitConfiguration",
230
+      component: UnitConfiguration
226
     },
231
     },
227
     {
232
     {
228
-      path: '/contactus',
229
-      name: 'ContactUs',
230
-      component: ContactUs,
233
+      path: "/contactus",
234
+      name: "ContactUs",
235
+      component: ContactUs
231
     },
236
     },
232
     {
237
     {
233
-      path: '/privacypolicy',
234
-      name: 'PrivacyPolicy',
235
-      component: PrivacyPolicy,
238
+      path: "/privacypolicy",
239
+      name: "PrivacyPolicy",
240
+      component: PrivacyPolicy
236
     },
241
     },
237
     {
242
     {
238
-      path: '/resort/:resortCode',
239
-      name: 'ResortPage',
243
+      path: "/resort/:resortCode",
244
+      name: "ResortPage",
240
       component: ResortPage,
245
       component: ResortPage,
241
-      props: true,
246
+      props: true
242
     },
247
     },
243
     {
248
     {
244
-      path: '/resort/:resortCode/:unitNumber',
245
-      name: 'UnitPage',
249
+      path: "/resort/:resortCode/:unitNumber",
250
+      name: "UnitPage",
246
       component: UnitPage,
251
       component: UnitPage,
247
-      props: true,
252
+      props: true
248
     },
253
     },
249
     {
254
     {
250
-      path: '/timeshare/:weekId',
251
-      name: 'TimeshareSellEdit',
255
+      path: "/timeshare/:weekId",
256
+      name: "TimeshareSellEdit",
252
       component: TimeshareSell,
257
       component: TimeshareSell,
253
-      props: true,
258
+      props: true
254
     },
259
     },
255
     {
260
     {
256
-      path: '/MakeOffer',
257
-      name: 'MakeOffer',
258
-      component: MakeOffer,
261
+      path: "/MakeOffer",
262
+      name: "MakeOffer",
263
+      component: MakeOffer
259
     },
264
     },
260
     {
265
     {
261
-      path: '/Offers',
262
-      name: 'Offers',
263
-      component: Offer,
266
+      path: "/Offers",
267
+      name: "Offers",
268
+      component: Offer
264
     },
269
     },
265
     {
270
     {
266
-      path: '/timesharesearch',
267
-      name: 'TimeshareSearch',
268
-      component: TimeshareSearch,
271
+      path: "/timesharesearch",
272
+      name: "TimeshareSearch",
273
+      component: TimeshareSearch
269
     },
274
     },
270
     {
275
     {
271
-      path: '/searchLog',
272
-      name: 'SearchLog',
273
-      component: searchLog,
276
+      path: "/searchLog",
277
+      name: "SearchLog",
278
+      component: searchLog
274
     },
279
     },
275
     {
280
     {
276
-      path: '/carousel',
277
-      name: 'carousel',
278
-      component: CarouselList,
281
+      path: "/carousel",
282
+      name: "carousel",
283
+      component: CarouselList
279
     },
284
     },
280
     {
285
     {
281
-      path: '/carousel/details/:id',
282
-      name: 'CarouselDetails',
283
-      component: CarouselDetail,
286
+      path: "/carousel/details/:id",
287
+      name: "CarouselDetails",
288
+      component: CarouselDetail
284
     },
289
     },
285
     {
290
     {
286
-      path: '/property/propertySearch/results',
287
-      name: 'PropertySearchResults',
288
-      component: PropertySearchResults,
289
-    },
290
-  ],
291
+      path: "/property/propertySearch/results",
292
+      name: "PropertySearchResults",
293
+      component: PropertySearchResults
294
+    }
295
+  ]
291
 });
296
 });

+ 35
- 20
src/store/modules/logs/searchLog.js Wyświetl plik

1
-import axios from 'axios';
2
-import _ from 'lodash';
1
+import axios from "axios";
2
+import _ from "lodash";
3
 
3
 
4
 export default {
4
 export default {
5
   namespaced: true,
5
   namespaced: true,
8
     fields: [],
8
     fields: [],
9
     filter: {
9
     filter: {
10
       by: undefined,
10
       by: undefined,
11
-      value: undefined,
12
-    },
11
+      value: undefined
12
+    }
13
   },
13
   },
14
   mutations: {
14
   mutations: {
15
     updateSearch(state, data) {
15
     updateSearch(state, data) {
16
       state.list = [];
16
       state.list = [];
17
       state.fields = [];
17
       state.fields = [];
18
       state.list = data;
18
       state.list = data;
19
-      data.forEach((item) => {
19
+      data.forEach(item => {
20
         state.fields.push(item.property);
20
         state.fields.push(item.property);
21
       });
21
       });
22
+      state.fields.push("UserName");
23
+      state.fields.push("Type");
24
+      state.fields.push("Date");
25
+      state.fields.push("Time");
22
       state.fields = state.fields.filter((x, i, a) => a.indexOf(x) === i);
26
       state.fields = state.fields.filter((x, i, a) => a.indexOf(x) === i);
23
     },
27
     },
24
     onClearFilter(state) {
28
     onClearFilter(state) {
25
       state.filter = {
29
       state.filter = {
26
         by: undefined,
30
         by: undefined,
27
-        value: undefined,
31
+        value: undefined
28
       };
32
       };
29
-    },
33
+    }
30
   },
34
   },
31
   getters: {
35
   getters: {
32
-    filterList: (state) => {
36
+    filterList: state => {
33
       let lst = state.list;
37
       let lst = state.list;
34
       const { filter } = state;
38
       const { filter } = state;
35
       if (filter) {
39
       if (filter) {
36
         if (filter.by) {
40
         if (filter.by) {
37
-          lst = _.filter(lst, x => x.property === filter.by);
38
-          if (filter.value) {
39
-            lst = _.filter(lst, x => x.value.toUpperCase().includes(filter.value.toUpperCase()));
41
+          if (filter.by === "UserName") {
42
+            lst = _.filter(lst, x => x.userName.toUpperCase().includes(filter.value.toUpperCase()));
43
+          } else if (filter.by === "Type") {
44
+            lst = _.filter(lst, x => x.type.toUpperCase().includes(filter.value.toUpperCase()));
45
+          } else if (filter.by === "Date") {
46
+            lst = _.filter(lst, x => x.date.toUpperCase().includes(filter.value.toUpperCase()));
47
+          } else if (filter.by === "Time") {
48
+            lst = _.filter(lst, x => x.time.toUpperCase().includes(filter.value.toUpperCase()));
49
+          } else {
50
+            lst = _.filter(lst, x => x.property === filter.by);
51
+            if (filter.value) {
52
+              lst = _.filter(lst, x => x.value.toUpperCase().includes(filter.value.toUpperCase()));
53
+            }
40
           }
54
           }
41
         } else if (filter.value) {
55
         } else if (filter.value) {
42
           lst = _.filter(
56
           lst = _.filter(
43
             lst,
57
             lst,
44
-            x => x.value.toUpperCase().includes(filter.value.toUpperCase())
45
-              || x.userName.toUpperCase().includes(filter.value.toUpperCase())
46
-              || x.type.toUpperCase().includes(filter.value.toUpperCase()),
58
+            x =>
59
+              x.value.toUpperCase().includes(filter.value.toUpperCase()) ||
60
+              x.userName.toUpperCase().includes(filter.value.toUpperCase()) ||
61
+              x.type.toUpperCase().includes(filter.value.toUpperCase())
47
           );
62
           );
48
         }
63
         }
49
       }
64
       }
50
       return lst;
65
       return lst;
51
-    },
66
+    }
52
   },
67
   },
53
   actions: {
68
   actions: {
54
     getPropertySearchLogs({ commit }) {
69
     getPropertySearchLogs({ commit }) {
55
       axios
70
       axios
56
-        .get('/api/searchLog')
57
-        .then(result => commit('updateSearch', result.data))
71
+        .get("/api/searchLog")
72
+        .then(result => commit("updateSearch", result.data))
58
         .catch(console.error);
73
         .catch(console.error);
59
     },
74
     },
60
     clearFilter({ commit }) {
75
     clearFilter({ commit }) {
61
-      commit('onClearFilter');
62
-    },
63
-  },
76
+      commit("onClearFilter");
77
+    }
78
+  }
64
 };
79
 };

+ 13
- 13
src/store/modules/misc/carousel.js Wyświetl plik

1
-import axios from 'axios';
1
+import axios from "axios";
2
 
2
 
3
 export default {
3
 export default {
4
   namespaced: true,
4
   namespaced: true,
8
       id: 0,
8
       id: 0,
9
       propertyID: 0,
9
       propertyID: 0,
10
       timeshareID: 0,
10
       timeshareID: 0,
11
-      header: '',
12
-      image: '',
13
-    },
11
+      header: "",
12
+      image: ""
13
+    }
14
   },
14
   },
15
   mutations: {
15
   mutations: {
16
     setCarouselItem(state, item) {
16
     setCarouselItem(state, item) {
24
     },
24
     },
25
     removeCarousel(state, id) {
25
     removeCarousel(state, id) {
26
       state.carouselList.pop(state.carouselList.find(p => p.id === id));
26
       state.carouselList.pop(state.carouselList.find(p => p.id === id));
27
-    },
27
+    }
28
   },
28
   },
29
   getters: {},
29
   getters: {},
30
   actions: {
30
   actions: {
31
     getCarouselItem({ commit }, id) {
31
     getCarouselItem({ commit }, id) {
32
       axios
32
       axios
33
         .get(`/api/Carousel/${id}`)
33
         .get(`/api/Carousel/${id}`)
34
-        .then(result => commit('setCarouselItem', result.data))
34
+        .then(result => commit("setCarouselItem", result.data))
35
         .catch(console.error);
35
         .catch(console.error);
36
     },
36
     },
37
     getCarouselList({ commit }) {
37
     getCarouselList({ commit }) {
38
       axios
38
       axios
39
-        .get('/api/Carousel')
40
-        .then(result => commit('setCarouselList', result.data))
39
+        .get("/api/Carousel")
40
+        .then(result => commit("setCarouselList", result.data))
41
         .catch(console.error);
41
         .catch(console.error);
42
     },
42
     },
43
     saveCarouselItem({ commit }, item) {
43
     saveCarouselItem({ commit }, item) {
44
       axios
44
       axios
45
-        .post('/api/Carousel', item)
46
-        .then(result => commit('addToCarouselList', result.data))
45
+        .post("/api/Carousel", item)
46
+        .then(result => commit("addToCarouselList", result.data))
47
         .catch(console.error);
47
         .catch(console.error);
48
     },
48
     },
49
     deleteCarousel({ commit }, id) {
49
     deleteCarousel({ commit }, id) {
50
       axios
50
       axios
51
         .delete(`/api/Carousel/${id}`)
51
         .delete(`/api/Carousel/${id}`)
52
-        .then(commit('removeCarousel', id))
52
+        .then(commit("removeCarousel", id))
53
         .catch(console.error);
53
         .catch(console.error);
54
-    },
55
-  },
54
+    }
55
+  }
56
 };
56
 };

+ 20
- 15
src/store/modules/processFlow/bid.js Wyświetl plik

1
-import axios from 'axios';
1
+import axios from "axios";
2
+import log from "../../../assets/Log";
2
 
3
 
3
 export default {
4
 export default {
4
   namespaced: true,
5
   namespaced: true,
5
   state: {
6
   state: {
6
     bidItem: {},
7
     bidItem: {},
7
-    bidItems: [],
8
+    bidItems: []
8
   },
9
   },
9
   mutations: {
10
   mutations: {
10
     setBid(state, bid) {
11
     setBid(state, bid) {
19
     updateBidList(state, bid) {
20
     updateBidList(state, bid) {
20
       state.bidItems.find(item => item.id === bid.id).status = bid.status;
21
       state.bidItems.find(item => item.id === bid.id).status = bid.status;
21
       console.log(JSON.stringify(bid));
22
       console.log(JSON.stringify(bid));
22
-    },
23
+    }
23
   },
24
   },
24
   getters: {},
25
   getters: {},
25
   actions: {
26
   actions: {
26
     getBid({ commit }, id) {
27
     getBid({ commit }, id) {
27
       axios
28
       axios
28
         .get(`/api/bid/${id}`)
29
         .get(`/api/bid/${id}`)
29
-        .then(result => commit('addToBids', result.data))
30
+        .then(result => commit("addToBids", result.data))
30
         .catch(console.error);
31
         .catch(console.error);
31
     },
32
     },
32
     getBids({ commit }) {
33
     getBids({ commit }) {
33
       axios
34
       axios
34
-        .get('/api/bid/GetBids/hjsdhj')
35
-        .then(result => commit('setBids', result.data))
35
+        .get("/api/bid/GetBids/All")
36
+        .then(result => commit("setBids", result.data))
36
         .catch(console.error);
37
         .catch(console.error);
37
     },
38
     },
38
     saveBid({ commit }, item) {
39
     saveBid({ commit }, item) {
40
+      if (log.isLoggedIn()) {
41
+        item.userId = log.getUser().id;
42
+      }
43
+      console.log(JSON.stringify(item));
39
       axios
44
       axios
40
-        .post('/api/bid', item)
41
-        .then(result => commit('setBid', result.data))
45
+        .post("/api/bid", item)
46
+        .then(result => commit("setBid", result.data))
42
         .catch(console.error);
47
         .catch(console.error);
43
     },
48
     },
44
     updateBid({ commit }, item) {
49
     updateBid({ commit }, item) {
45
       axios
50
       axios
46
-        .put('/api/bid', item)
47
-        .then(result => commit('setBid', item))
51
+        .put("/api/bid", item)
52
+        .then(result => commit("setBid", item))
48
         .catch(console.error);
53
         .catch(console.error);
49
     },
54
     },
50
     acceptBid({ commit }, id) {
55
     acceptBid({ commit }, id) {
51
       axios
56
       axios
52
         .put(`/api/bid/AcceptBid/${id}`)
57
         .put(`/api/bid/AcceptBid/${id}`)
53
-        .then(result => commit('updateBidList', result.data))
58
+        .then(result => commit("updateBidList", result.data))
54
         .catch(console.error);
59
         .catch(console.error);
55
     },
60
     },
56
     declineBid({ commit }, item) {
61
     declineBid({ commit }, item) {
57
       axios
62
       axios
58
-        .put('/api/bid/DeclineBid', item)
59
-        .then(result => commit('updateBidList', result.data))
63
+        .put("/api/bid/DeclineBid", item)
64
+        .then(result => commit("updateBidList", result.data))
60
         .catch(console.error);
65
         .catch(console.error);
61
-    },
62
-  },
66
+    }
67
+  }
63
 };
68
 };

+ 41
- 38
src/store/modules/property/propertySearch.js Wyświetl plik

1
 /* eslint-disable valid-typeof */
1
 /* eslint-disable valid-typeof */
2
 /* eslint-disable max-len */
2
 /* eslint-disable max-len */
3
 /* eslint-disable indent */
3
 /* eslint-disable indent */
4
-import axios from 'axios';
5
-import _ from 'lodash';
4
+import axios from "axios";
5
+import _ from "lodash";
6
+import log from "../../../assets/Log";
6
 
7
 
7
 export default {
8
 export default {
8
   namespaced: true,
9
   namespaced: true,
9
   state: {
10
   state: {
10
     propertySearch: {
11
     propertySearch: {
11
-      userName: '',
12
-      salesType: 'Sale',
13
-      propertyUsageType: 'All',
14
-      propertyType: 'All',
15
-      province: 'All',
16
-      city: 'All',
17
-      suburb: 'All',
12
+      userName: "",
13
+      salesType: "Sale",
14
+      propertyUsageType: "All",
15
+      propertyType: "All",
16
+      province: "All",
17
+      city: "All",
18
+      suburb: "All",
18
       minPrice: 0,
19
       minPrice: 0,
19
       maxPrice: 0,
20
       maxPrice: 0,
20
       availableFrom: undefined,
21
       availableFrom: undefined,
21
-      propertyId: 0,
22
+      propertyId: 0
22
     },
23
     },
23
     properties: [],
24
     properties: [],
24
     latestProperties: [],
25
     latestProperties: [],
25
     suburbs: [],
26
     suburbs: [],
26
-    searchText: '',
27
+    searchText: "",
27
     suburbList: [],
28
     suburbList: [],
28
-    resultsShowing: false,
29
+    resultsShowing: false
29
   },
30
   },
30
   mutations: {
31
   mutations: {
31
     updateSearch(state, propertySearch) {
32
     updateSearch(state, propertySearch) {
39
       state.propertySearch = search;
40
       state.propertySearch = search;
40
     },
41
     },
41
     onClearFilter(state, filter) {
42
     onClearFilter(state, filter) {
42
-      if (filter === 'availableFrom') {
43
+      if (filter === "availableFrom") {
43
         state.propertySearch[filter] = undefined;
44
         state.propertySearch[filter] = undefined;
44
       } else {
45
       } else {
45
-        state.propertySearch[filter] = 'All';
46
+        state.propertySearch[filter] = "All";
46
       }
47
       }
47
     },
48
     },
48
     setSuburbs(state, items) {
49
     setSuburbs(state, items) {
58
     },
59
     },
59
     setResultsShowing(state, value) {
60
     setResultsShowing(state, value) {
60
       state.resultsShowing = value;
61
       state.resultsShowing = value;
61
-    },
62
+    }
62
   },
63
   },
63
   getters: {
64
   getters: {
64
-    filterSuburbs: (state) => {
65
+    filterSuburbs: state => {
65
       let subs = state.suburbs;
66
       let subs = state.suburbs;
66
       if (state.searchText) {
67
       if (state.searchText) {
67
         subs = _.filter(subs, s => s.display.contains(state.searchText));
68
         subs = _.filter(subs, s => s.display.contains(state.searchText));
68
       }
69
       }
69
       return subs;
70
       return subs;
70
-    },
71
+    }
71
   },
72
   },
72
   actions: {
73
   actions: {
73
     clearFilter({ commit }, filter) {
74
     clearFilter({ commit }, filter) {
74
-      commit('onClearFilter', filter);
75
+      commit("onClearFilter", filter);
75
     },
76
     },
76
     searchProperties({ commit }, item) {
77
     searchProperties({ commit }, item) {
77
-      if (item.keyword === '') {
78
-        item.keyword = 'All';
78
+      if (item.keyword === "") {
79
+        item.keyword = "All";
79
       }
80
       }
80
-      if (item.userName === '') {
81
-        item.userName = 'Unknown';
81
+      if (log.isLoggedIn()) {
82
+        item.userName = log.getUser().username;
83
+      } else if (item.userName === "") {
84
+        item.userName = "Unknown";
82
       }
85
       }
83
-      if (item.suburb === '') {
84
-        item.suburb = 'All';
86
+      if (item.suburb === "") {
87
+        item.suburb = "All";
85
       }
88
       }
86
-      if (item.city === '') {
87
-        item.city = 'All';
89
+      if (item.city === "") {
90
+        item.city = "All";
88
       }
91
       }
89
-      if (item.province === '') {
90
-        item.province = 'All';
92
+      if (item.province === "") {
93
+        item.province = "All";
91
       }
94
       }
92
       axios
95
       axios
93
         .get(
96
         .get(
94
-          `/api/Property/Search/${item.userName}/${item.keyword}/${item.salesType}/${item.propertyUsageType}/${item.propertyType}/${item.province}/${item.city}/${item.suburb}/${item.minPrice}/${item.maxPrice}/${item.availableFrom}/${item.propertyId}`,
97
+          `/api/Property/Search/${item.userName}/${item.keyword}/${item.salesType}/${item.propertyUsageType}/${item.propertyType}/${item.province}/${item.city}/${item.suburb}/${item.minPrice}/${item.maxPrice}/${item.availableFrom}/${item.propertyId}`
95
         )
98
         )
96
-        .then(result => commit('updateSearch', result.data))
99
+        .then(result => commit("updateSearch", result.data))
97
         .catch(console.error);
100
         .catch(console.error);
98
     },
101
     },
99
     searchLatestProperties({ commit }) {
102
     searchLatestProperties({ commit }) {
100
       axios
103
       axios
101
-        .get('/api/property/latestProperties')
102
-        .then(response => commit('setLatestProperties', response.data))
104
+        .get("/api/property/latestProperties")
105
+        .then(response => commit("setLatestProperties", response.data))
103
         .catch(console.error);
106
         .catch(console.error);
104
     },
107
     },
105
     getSuburbs({ commit }) {
108
     getSuburbs({ commit }) {
106
       axios
109
       axios
107
-        .get('/api/suburb/GetSearchList')
108
-        .then(response => commit('setSuburbs', response.data))
110
+        .get("/api/suburb/GetSearchList")
111
+        .then(response => commit("setSuburbs", response.data))
109
         .catch(console.error);
112
         .catch(console.error);
110
     },
113
     },
111
     applyFilter({ commit }, value) {
114
     applyFilter({ commit }, value) {
112
-      commit('setFilter', { value });
115
+      commit("setFilter", { value });
113
     },
116
     },
114
     updateResultsShowing({ commit }, value) {
117
     updateResultsShowing({ commit }, value) {
115
-      commit('setResultsShowing', value);
116
-    },
117
-  },
118
+      commit("setResultsShowing", value);
119
+    }
120
+  }
118
 };
121
 };

Ładowanie…
Anuluj
Zapisz