Переглянути джерело

Janneke testing feedback

master
George Williams 5 роки тому
джерело
коміт
93f642c59b

+ 1
- 1
.eslintrc.js Переглянути файл

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

+ 13
- 13
package-lock.json Переглянути файл

@@ -2419,11 +2419,6 @@
2419 2419
       "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=",
2420 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 2422
     "browserify-aes": {
2428 2423
       "version": "1.2.0",
2429 2424
       "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz",
@@ -4023,6 +4018,11 @@
4023 4018
       "integrity": "sha512-YXQl1DSa4/PQyRfgrv6aoNjhasp/p4qs9FjJ4q4cQk+8m4r6k4ZSiEyytKG8f8W9gi8WsQtIObNmKd+tMzNTmA==",
4024 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 4026
     "duplexer": {
4027 4027
       "version": "0.1.1",
4028 4028
       "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz",
@@ -11914,20 +11914,20 @@
11914 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 11917
     "vue-hot-reload-api": {
11926 11918
       "version": "2.3.3",
11927 11919
       "resolved": "https://registry.npmjs.org/vue-hot-reload-api/-/vue-hot-reload-api-2.3.3.tgz",
11928 11920
       "integrity": "sha512-KmvZVtmM26BQOMK1rwUZsrqxEGeKiYSZGA7SNWE6uExx8UX/cj9hq2MRV/wWC3Cq6AoeDGk57rL9YMFRel/q+g==",
11929 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 11931
     "vue-loader": {
11932 11932
       "version": "15.7.0",
11933 11933
       "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.7.0.tgz",

+ 1
- 1
package.json Переглянути файл

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

+ 42
- 60
src/components/admin/logs/SearchLogs.vue Переглянути файл

@@ -2,16 +2,11 @@
2 2
   <!-- eslint-disable max-len -->
3 3
   <div>
4 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 10
           </div>
16 11
         </div>
17 12
       </div>
@@ -23,7 +18,7 @@
23 18
         </div>
24 19
         <div class="col-md-3">
25 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 22
           </select>
28 23
         </div>
29 24
         <div class="col-md-8 text-left">
@@ -38,85 +33,72 @@
38 33
         </div>
39 34
       </div>
40 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 47
     <div class="container">
42 48
       <div class="form-group row">
43 49
         <div class="col-md-12" align="right">
44
-          <export-excel
50
+          <JsonExcel
45 51
             class="btn btn-b-n"
46 52
             :data="list"
47 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 58
             Download
53 59
             <eva-icon name="download"></eva-icon>
54
-          </export-excel>
60
+          </JsonExcel>
55 61
         </div>
56 62
       </div>
57 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 64
     <br />
83 65
   </div>
84 66
 </template>
85 67
 
86 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 73
 export default {
91
-  name: 'searchLog',
74
+  name: "searchLog",
75
+  components: {
76
+    listView,
77
+    JsonExcel
78
+  },
92 79
   data() {
93 80
     return {
94 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 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 94
   mounted() {
113 95
     this.getPropertySearchLogs();
114 96
   },
115 97
   computed: {
116
-    ...mapState('searchLog', ['list', 'fields', 'filter']),
98
+    ...mapState("searchLog", ["list", "fields", "filter"]),
117 99
     ...mapGetters({
118
-      list: 'searchLog/filterList',
119
-    }),
120
-  },
100
+      list: "searchLog/filterList"
101
+    })
102
+  }
121 103
 };
122 104
 </script>

+ 27
- 44
src/components/admin/misc/carouselList.vue Переглянути файл

@@ -9,75 +9,58 @@
9 9
               <br />
10 10
               <h1 class="title-d" style="text-align:left; font-size: 250%">Carousel Items</h1>
11 11
             </div>
12
-            <br />
13 12
           </div>
14 13
         </div>
15 14
       </div>
16 15
     </div>
17 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 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 27
   </div>
52 28
 </template>
53 29
 
54 30
 <script>
55
-import { mapState, mapActions } from 'vuex';
31
+import { mapState, mapActions } from "vuex";
32
+import listView from "../../shared/listView.vue";
56 33
 
57 34
 export default {
58
-  name: 'CarouselList',
35
+  name: "CarouselList",
36
+  components: {
37
+    listView
38
+  },
59 39
   data() {
60
-    return {};
40
+    return {
41
+      columns: ["id", "header", "image"],
42
+      formats: ["", "", "image"]
43
+    };
61 44
   },
62 45
   methods: {
63
-    ...mapActions('carousel', ['getCarouselList', 'deleteCarousel']),
46
+    ...mapActions("carousel", ["getCarouselList", "deleteCarousel"]),
64 47
     New() {
65
-      this.$router.push('/carousel/details/0');
48
+      this.$router.push("/carousel/details/0");
66 49
     },
67 50
     Edit(itemID) {
68 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 59
   mounted() {
77 60
     this.getCarouselList();
78 61
   },
79 62
   computed: {
80
-    ...mapState('carousel', ['carouselList']),
81
-  },
63
+    ...mapState("carousel", ["carouselList"])
64
+  }
82 65
 };
83 66
 </script>

+ 30
- 28
src/components/admin/misc/carouselSearch.vue Переглянути файл

@@ -18,7 +18,7 @@
18 18
               :showNew="false"
19 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 22
           </div>
23 23
         </div>
24 24
       </div>
@@ -27,75 +27,77 @@
27 27
 </template>
28 28
 
29 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 35
 export default {
35
-  name: 'CarouselSearch',
36
+  name: "CarouselSearch",
36 37
   props: {
37
-    name: String,
38
+    name: String
38 39
   },
39 40
   components: {
40 41
     ListView,
42
+    ListView2
41 43
   },
42 44
   data() {
43 45
     return {
44
-      user: Log.getUser(),
46
+      user: Log.getUser()
45 47
     };
46 48
   },
47 49
   mounted() {
48
-    if (this.name === 'Timeshare') {
50
+    if (this.name === "Timeshare") {
49 51
       this.getItems(this.user.id);
50 52
     } else {
51 53
       this.getProperties(
52 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 64
   computed: {
63
-    ...mapState('myWeeks', ['items']),
64
-    ...mapState('propertyList', ['properties']),
65
+    ...mapState("myWeeks", ["items"]),
66
+    ...mapState("propertyList", ["properties"]),
65 67
     // eslint-disable-next-line vue/return-in-computed-property
66 68
     nameChanged() {
67
-      if (this.name === 'Timeshare') {
69
+      if (this.name === "Timeshare") {
68 70
         this.getItems(this.user.id);
69 71
       } else {
70 72
         this.getProperties(
71 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 84
   methods: {
83
-    ...mapActions('myWeeks', ['getItems']),
84
-    ...mapActions('propertyList', ['getProperties']),
85
+    ...mapActions("myWeeks", ["getItems"]),
86
+    ...mapActions("propertyList", ["getProperties"]),
85 87
     onRowClick(item) {
86
-      if (this.name === 'Timeshare') {
88
+      if (this.name === "Timeshare") {
87 89
         const week = this.items[item];
88
-        this.$emit('onSelected', week);
90
+        this.$emit("onSelected", week);
89 91
       } else {
90 92
         const prop = this.properties[item];
91
-        this.$emit('onSelected', prop);
93
+        this.$emit("onSelected", prop);
92 94
       }
93
-    },
95
+    }
94 96
   },
95 97
   watch: {
96 98
     nameChanged() {
97 99
       return null;
98
-    },
99
-  },
100
+    }
101
+  }
100 102
 };
101 103
 </script>

+ 29
- 28
src/components/admin/property/propertyTypeEdit.vue Переглянути файл

@@ -1,16 +1,17 @@
1 1
 <template>
2 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 11
           </div>
11 12
         </div>
12 13
       </div>
13
-    </section>
14
+    </div>
14 15
     <div class="container">
15 16
       <div class="row mb-3">
16 17
         <div class="col-md-12">
@@ -27,7 +28,7 @@
27 28
                 />
28 29
               </div>
29 30
               <div class="col-md-4">
30
-                <label>Property Type</label>
31
+                <label>Property Usage Type</label>
31 32
                 <select
32 33
                   class="form-control"
33 34
                   name="UsageType"
@@ -48,21 +49,21 @@
48 49
       @click="SubmitData()"
49 50
       class="btn btn-b-n"
50 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 59
   </div>
59 60
 </template>
60 61
 
61 62
 <script>
62
-import { mapState, mapActions } from 'vuex';
63
+import { mapState, mapActions } from "vuex";
63 64
 
64 65
 export default {
65
-  name: 'PropertyType',
66
+  name: "PropertyType",
66 67
   data() {
67 68
     return {};
68 69
   },
@@ -73,14 +74,14 @@ export default {
73 74
     }
74 75
   },
75 76
   computed: {
76
-    ...mapState('propertyTypes', ['propertyType']),
77
+    ...mapState("propertyTypes", ["propertyType"])
77 78
   },
78 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 86
     SubmitData() {
86 87
       if (this.propertyType.id > 0) {
@@ -88,11 +89,11 @@ export default {
88 89
       } else {
89 90
         this.savePropertyType(this.propertyType);
90 91
       }
91
-      this.$router.push('/propertyTypes/list');
92
+      this.$router.push("/propertyTypes/list");
92 93
     },
93 94
     Close() {
94
-      this.$router.push('/propertyTypes/list');
95
-    },
96
-  },
95
+      this.$router.push("/propertyTypes/list");
96
+    }
97
+  }
97 98
 };
98 99
 </script>

+ 34
- 64
src/components/admin/property/propertyTypeList.vue Переглянути файл

@@ -2,95 +2,65 @@
2 2
   <!-- eslint-disable max-len -->
3 3
   <div>
4 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 10
           </div>
21 11
         </div>
22 12
       </div>
23
-      <!-- </section> -->
24 13
     </div>
25 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 26
     </div>
63 27
     <br />
64 28
   </div>
65 29
 </template>
66 30
 
67 31
 <script>
68
-import { mapState, mapActions } from 'vuex';
32
+import { mapState, mapActions } from "vuex";
33
+import listView from "../../shared/listView.vue";
69 34
 
70 35
 export default {
71
-  name: 'PropertyTypeList',
36
+  name: "PropertyTypeList",
37
+  components: {
38
+    listView
39
+  },
72 40
   data() {
73
-    return {};
41
+    return {
42
+      columns: ["propertyUsageType", "description"]
43
+    };
74 44
   },
75 45
   methods: {
76
-    ...mapActions('propertyTypes', ['getPropertyTypes', 'deletePropertyType']),
46
+    ...mapActions("propertyTypes", ["getPropertyTypes", "deletePropertyType"]),
77 47
     New() {
78
-      this.$router.push('/propertyType/new');
48
+      this.$router.push("/propertyType/new");
79 49
     },
80
-    Edit(itemID) {
50
+    Edit(item) {
81 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 59
   mounted() {
90 60
     this.getPropertyTypes();
91 61
   },
92 62
   computed: {
93
-    ...mapState('propertyTypes', ['propertyTypes']),
94
-  },
63
+    ...mapState("propertyTypes", ["propertyTypes"])
64
+  }
95 65
 };
96 66
 </script>

+ 18
- 15
src/components/admin/property/userDefinedField.vue Переглянути файл

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

+ 53
- 86
src/components/admin/property/userDefinedGroupPage.vue Переглянути файл

@@ -2,17 +2,18 @@
2 2
   <!-- eslint-disable max-len -->
3 3
   <div>
4 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 13
             </div>
13 14
           </div>
14 15
         </div>
15
-      </section>
16
+      </div>
16 17
       <div class="container">
17 18
         <div class="row mb-3">
18 19
           <div class="col-md-12">
@@ -29,7 +30,7 @@
29 30
                   />
30 31
                 </div>
31 32
                 <div class="col-md-4">
32
-                  <label>Property Type</label>
33
+                  <label>Property Usage Type</label>
33 34
                   <select
34 35
                     class="form-control"
35 36
                     name="UsageType"
@@ -64,7 +65,7 @@
64 65
                   />
65 66
                 </div>
66 67
                 <div class="col-md-4">
67
-                  <label>Property Type</label>
68
+                  <label>Property Usage Type</label>
68 69
                   <select
69 70
                     class="form-control"
70 71
                     name="UsageType"
@@ -92,62 +93,29 @@
92 93
         </div>
93 94
       </div>
94 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 107
       </div>
139 108
       <button
140 109
         type="button"
141 110
         @click="SubmitData()"
142 111
         class="btn btn-b-n"
143 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 119
     </div>
152 120
     <div v-else>
153 121
       <userFields @UpdateUserField="UpdateUserField" :field="item" />
@@ -156,18 +124,21 @@
156 124
 </template>
157 125
 
158 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 131
 export default {
163
-  name: 'UserDefinedGroup',
132
+  name: "UserDefinedGroup",
164 133
   components: {
165 134
     userFields,
135
+    listView
166 136
   },
167 137
   data() {
168 138
     return {
169 139
       item: {},
170 140
       showField: false,
141
+      columns: ["fieldName", "fieldType", "rank"]
171 142
     };
172 143
   },
173 144
   mounted() {
@@ -180,31 +151,27 @@ export default {
180 151
     }
181 152
   },
182 153
   computed: {
183
-    ...mapState('propertyAdmin', [
184
-      'userDefinedGroup',
185
-      'userFields',
186
-      'userField',
187
-    ]),
154
+    ...mapState("propertyAdmin", ["userDefinedGroup", "userFields", "userField"])
188 155
   },
189 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 169
     SubmitData() {
203 170
       this.userDefinedGroup.fields = [];
204 171
       let reload = false;
205 172
       if (this.$route.params.id > 0) {
206 173
         this.updateUserDefinedGroup(this.userDefinedGroup);
207
-        this.userFields.forEach((fieldData) => {
174
+        this.userFields.forEach(fieldData => {
208 175
           if (fieldData.id === 0) {
209 176
             fieldData.groupId = this.userDefinedGroup.id;
210 177
             this.saveUserField(fieldData);
@@ -214,16 +181,16 @@ export default {
214 181
         });
215 182
       } else {
216 183
         reload = true;
217
-        this.userFields.forEach((fieldData) => {
184
+        this.userFields.forEach(fieldData => {
218 185
           this.userDefinedGroup.fields.push({
219 186
             fieldName: fieldData.fieldName,
220 187
             fieldType: fieldData.fieldType,
221
-            rank: fieldData.rank,
188
+            rank: fieldData.rank
222 189
           });
223 190
         });
224 191
         this.saveUserDefinedGroup(this.userDefinedGroup);
225 192
       }
226
-      this.$router.push('/userDefinedGroups/list');
193
+      this.$router.push("/userDefinedGroups/list");
227 194
       // this.$router.push({
228 195
       //   path: '/userDefinedGroups/list',
229 196
       //   query: { reload },
@@ -240,7 +207,7 @@ export default {
240 207
       this.showField = true;
241 208
     },
242 209
     Close() {
243
-      this.$router.push('/userDefinedGroups/list');
210
+      this.$router.push("/userDefinedGroups/list");
244 211
     },
245 212
     UpdateUserField(item) {
246 213
       if (item.id === 0) {
@@ -254,7 +221,7 @@ export default {
254 221
       } else {
255 222
         this.deleteUserField(item.id);
256 223
       }
257
-    },
258
-  },
224
+    }
225
+  }
259 226
 };
260 227
 </script>

+ 34
- 59
src/components/admin/property/userDefinedGroupsPage.vue Переглянути файл

@@ -1,95 +1,70 @@
1 1
 <template>
2 2
   <!-- eslint-disable max-len -->
3 3
   <div>
4
-    <!-- <section class="intro-single"> -->
5 4
     <div class="container">
6
-      <br />
7
-      <br />
8
-      <br />
9 5
       <br />
10 6
       <div class="row">
11 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 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 12
           </div>
18
-          <br />
19 13
         </div>
20 14
       </div>
21 15
     </div>
22
-    <!-- </section> -->
23 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 30
     </div>
62 31
     <br />
63 32
   </div>
64 33
 </template>
65 34
 <script>
66
-import { mapState, mapActions } from 'vuex';
35
+import { mapState, mapActions } from "vuex";
36
+import listView from "../../shared/listView.vue";
67 37
 
68 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 48
   mounted() {
71 49
     this.getUserDefinedGroups();
72 50
   },
73 51
   computed: {
74
-    ...mapState('propertyAdmin', ['userDefinedGroups']),
52
+    ...mapState("propertyAdmin", ["userDefinedGroups"])
75 53
   },
76 54
   methods: {
77
-    ...mapActions('propertyAdmin', [
78
-      'getUserDefinedGroups',
79
-      'deleteUserDefinedGroup',
80
-    ]),
55
+    ...mapActions("propertyAdmin", ["getUserDefinedGroups", "deleteUserDefinedGroup"]),
81 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 62
     Delete(item) {
88 63
       if (item.id === 0) {
89 64
         this.userDefinedGroups.pop(item);
90 65
       }
91 66
       this.deleteUserDefinedGroup(item.id);
92
-    },
93
-  },
67
+    }
68
+  }
94 69
 };
95 70
 </script>

+ 2
- 2
src/components/home/serviceSection.vue Переглянути файл

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

+ 52
- 25
src/components/processFlow/makeOffer.vue Переглянути файл

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

+ 49
- 77
src/components/processFlow/offers.vue Переглянути файл

@@ -1,108 +1,80 @@
1 1
 <template>
2 2
   <div>
3
-    <!-- <section class="intro-single"> -->
4 3
     <div class="container">
5
-      <br />
6
-      <br />
7
-      <br />
8 4
       <br />
9 5
       <div class="row">
10 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 7
           <div class="title-box-d">
15 8
             <h1 class="title-d" style="text-align:left; font-size: 250%">Bid Offers</h1>
16 9
           </div>
17
-          <br />
18 10
         </div>
19 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 44
     </div>
74 45
   </div>
75 46
 </template>
76 47
 
77 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 53
 export default {
82
-  name: 'offers',
83
-  components: { makeOffer },
54
+  name: "offers",
55
+  components: { makeOffer, listView },
84 56
   data() {
85 57
     return {
86 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 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 73
   computed: {
102
-    ...mapState('bid', ['bidItems']),
74
+    ...mapState("bid", ["bidItems"])
103 75
   },
104 76
   mounted() {
105 77
     this.getBids();
106
-  },
78
+  }
107 79
 };
108 80
 </script>

+ 73
- 65
src/components/property/propertyCreate.vue Переглянути файл

@@ -25,14 +25,19 @@
25 25
         </div>
26 26
       </div>
27 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 34
         <div class="container col-md-10">
30 35
           <div class="title-box-d">
31 36
             <h5 class="title-d" style="text-align:left">Property Overview</h5>
32 37
           </div>
33 38
         </div>
34 39
       </div>
35
-      <div class="row mb-3">
40
+      <div class="row mb-3" v-if="mayEdit">
36 41
         <div class="container col-md-10" style="text-align:left">
37 42
           <form id="mainForm">
38 43
             <div class="form-goup row">
@@ -392,67 +397,70 @@
392 397
 </template>
393 398
 
394 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 406
 export default {
401
-  name: 'PropertyCreate',
407
+  name: "PropertyCreate",
402 408
   components: {
403 409
     UserField,
404 410
     ImageLoad,
405
-    VueEditor,
411
+    VueEditor
406 412
   },
407 413
   data() {
408 414
     return {
409
-      propertyType: 'Residential',
410
-      salesType: 'Rental',
411
-      selectedProvince: '',
412
-      selectedCity: '',
415
+      propertyType: "Residential",
416
+      salesType: "Rental",
417
+      selectedProvince: "",
418
+      selectedCity: "",
413 419
       images: [],
414 420
       propertyFieldValues: [],
415 421
       defaultImage: 0,
416 422
       wait: false,
417 423
       customToolbar: [
418 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 437
       showPropertyTypeError: false,
432 438
       showProvinceError: false,
433 439
       showCityError: false,
434 440
       showSuburbError: false,
435 441
       showDateError: false,
442
+      user: Log.getUser(),
443
+      mayEdit: Log.isLoggedIn()
436 444
     };
437 445
   },
438 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 462
     TypeChanged() {
455
-      this.propertyType = this.property.propertyUsageType;
463
+      this.property.propertyUsageType = this.propertyType;
456 464
     },
457 465
     SubmitData() {
458 466
       if (this.property.propertyTypeId === 0) {
@@ -469,24 +477,24 @@ export default {
469 477
       }
470 478
 
471 479
       if (
472
-        this.salesType === 'Rental'
473
-        && this.property.dateAvailable === 'undef'
480
+        this.salesType === "Rental" &&
481
+        this.property.dateAvailable === "undef"
474 482
       ) {
475 483
         this.showDateError = true;
476 484
       }
477 485
 
478 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 493
         return;
486 494
       }
487 495
 
488 496
       this.wait = true;
489
-      if (this.salesType === 'Sale') {
497
+      if (this.salesType === "Sale") {
490 498
         this.property.isSale = true;
491 499
         this.property.dateAvailable = new Date();
492 500
       }
@@ -498,7 +506,7 @@ export default {
498 506
         }
499 507
         this.property.propertyImages.push({
500 508
           image: this.images[i],
501
-          isDefault: setAsDefault,
509
+          isDefault: setAsDefault
502 510
         });
503 511
       }
504 512
       this.property.propertyUserFields = this.propertyFieldValues;
@@ -508,15 +516,15 @@ export default {
508 516
       }
509 517
 
510 518
       this.saveProperty(this.property)
511
-        .then((fulfilled) => {
519
+        .then(fulfilled => {
512 520
           this.$router.push(`/property/property/${fulfilled.data.id}`);
513 521
         })
514
-        .catch((error) => {
522
+        .catch(error => {
515 523
           console.log(error.message);
516 524
         });
517 525
     },
518 526
     Close() {
519
-      this.$router.push('/property/admin/list/my');
527
+      this.$router.push("/property/admin/list/my");
520 528
     },
521 529
     PropertyTypeSelected(item) {
522 530
       if (item.target.options.selectedIndex > 0) {
@@ -544,8 +552,8 @@ export default {
544 552
         this.getSuburbs(
545 553
           Object.assign(
546 554
             {},
547
-            { province: this.selectedProvince, city: this.selectedCity },
548
-          ),
555
+            { province: this.selectedProvince, city: this.selectedCity }
556
+          )
549 557
         );
550 558
         this.showCityError = false;
551 559
       } else {
@@ -567,7 +575,7 @@ export default {
567 575
     },
568 576
     UpdateUserDefinedFields(item) {
569 577
       let update = false;
570
-      this.propertyFieldValues.forEach((element) => {
578
+      this.propertyFieldValues.forEach(element => {
571 579
         if (element.userDefinedFieldId === item.userDefinedFieldId) {
572 580
           element.value = item.value;
573 581
           update = true;
@@ -579,7 +587,7 @@ export default {
579 587
     },
580 588
     UpdateDefaultImage(item) {
581 589
       this.defaultImage = item;
582
-    },
590
+    }
583 591
   },
584 592
   mounted() {
585 593
     this.wait = false;
@@ -594,8 +602,8 @@ export default {
594 602
     if (this.propertyFields.length > 0) {
595 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 609
     if (this.$route.params.propertyUsageType) {
@@ -610,15 +618,15 @@ export default {
610 618
     this.getPropertyFields(this.propertyType);
611 619
   },
612 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 630
     SalesTypeChanged() {
623 631
       // eslint-disable-next-line vue/no-side-effects-in-computed-properties
624 632
       // this.propertyType = this.$route.params.propType;
@@ -636,12 +644,12 @@ export default {
636 644
       this.getPropertyTypes(this.propertyType);
637 645
 
638 646
       return this.propertyType;
639
-    },
647
+    }
640 648
   },
641 649
   watch: {
642 650
     SalesTypeChanged() {
643 651
       return null;
644
-    },
645
-  },
652
+    }
653
+  }
646 654
 };
647 655
 </script>

+ 29
- 28
src/components/property/propertyList.vue Переглянути файл

@@ -29,74 +29,75 @@
29 29
 </template>
30 30
 
31 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 36
 export default {
36
-  name: 'PropertyList',
37
+  name: "PropertyList",
37 38
   components: {
38
-    listView,
39
+    listView
39 40
   },
40 41
   data() {
41 42
     return {
42
-      propertyType: '',
43
-      role: 'MY',
43
+      propertyType: "",
44
+      role: "MY",
45
+      user: Log.getUser()
44 46
     };
45 47
   },
46 48
   methods: {
47
-    ...mapActions('propertyList', ['getProperties', 'deleteProperty']),
49
+    ...mapActions("propertyList", ["getProperties", "deleteProperty"]),
48 50
     Edit(item) {
49
-      const salesType = item.isSale ? 'Sale' : 'Rental';
51
+      const salesType = item.isSale ? "Sale" : "Rental";
50 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 57
     Delete(item) {
56 58
       this.deleteProperty(item.id);
57
-    },
59
+    }
58 60
   },
59 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 69
     this.getProperties(
68 70
       Object.assign({
69 71
         propertyType: this.role,
70
-        user: this.user.id,
71
-      }),
72
+        user: this.user.id
73
+      })
72 74
     );
73 75
   },
74 76
   computed: {
75
-    ...mapState('propertyList', ['properties']),
76
-    ...mapState('authentication', ['user']),
77
+    ...mapState("propertyList", ["properties"]),
77 78
     UserChanged() {
78
-      if (this.user.role === 'Super Admin') {
79
+      if (this.user.role === "Super Admin") {
79 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 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 88
       this.getProperties(
88 89
         Object.assign({
89 90
           propertyType: this.role,
90
-          user: this.user.id,
91
-        }),
91
+          user: this.user.id
92
+        })
92 93
       );
93 94
       return this.user;
94
-    },
95
+    }
95 96
   },
96 97
   watch: {
97 98
     UserChanged() {
98 99
       console.log(this.user);
99
-    },
100
-  },
100
+    }
101
+  }
101 102
 };
102 103
 </script>

+ 19
- 19
src/components/property/propertyPage.vue Переглянути файл

@@ -149,7 +149,7 @@
149 149
                               id: property.id,
150 150
                               shortDescription: property.shortDescription,
151 151
                               description: property.description,
152
-                              sellPrice: property.price
152
+                              price: property.price
153 153
                             }"
154 154
                           />
155 155
                         </div>
@@ -283,20 +283,20 @@
283 283
 </template>
284 284
 
285 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 290
 export default {
291
-  name: 'property',
291
+  name: "property",
292 292
   components: {
293 293
     makeOffer,
294
-    gallery,
294
+    gallery
295 295
   },
296 296
   data() {
297 297
     return {
298 298
       index: null,
299
-      date: new Date(),
299
+      date: new Date()
300 300
     };
301 301
   },
302 302
   mounted() {
@@ -305,30 +305,30 @@ export default {
305 305
     this.mayEditProperty(this.$route.params.id);
306 306
   },
307 307
   computed: {
308
-    ...mapState('property', ['property', 'propertyImages']),
309
-    ...mapState('propertyEdit', ['mayEdit']),
308
+    ...mapState("property", ["property", "propertyImages"]),
309
+    ...mapState("propertyEdit", ["mayEdit"])
310 310
   },
311 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 318
     formatPrice(value) {
319 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 322
     formatAddress(value) {
323
-      if (value !== '') {
323
+      if (value !== "") {
324 324
         return `${value}<br/>`;
325 325
       }
326
-      return '';
327
-    },
326
+      return "";
327
+    }
328 328
   },
329 329
   beforeDestroy() {
330 330
     this.clearPropertyImages();
331
-  },
331
+  }
332 332
 };
333 333
 </script>
334 334
 

+ 20
- 12
src/components/property/propertySearchPage.vue Переглянути файл

@@ -150,28 +150,29 @@
150 150
   </div>
151 151
 </template>
152 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 156
 export default {
157
-  name: 'propertysearch',
157
+  name: "propertysearch",
158 158
   components: {
159
-    autoComplete,
159
+    autoComplete
160 160
   },
161 161
   data() {
162 162
     return {
163
-      propertyUsageType: 'Residential',
164
-      salesType: 'Sale',
165
-      searchText: '',
163
+      propertyUsageType: "Residential",
164
+      salesType: "Sale",
165
+      searchText: ""
166 166
     };
167 167
   },
168 168
   computed: {
169
-    ...mapState('propertySearch', ['suburbs', 'suburbList', 'propertySearch']),
169
+    ...mapState("propertySearch", ["suburbs", "suburbList", "propertySearch"])
170 170
   },
171 171
   methods: {
172
-    ...mapActions('propertySearch', ['getSuburbs', 'applyFilter']),
172
+    ...mapActions("propertySearch", ["getSuburbs", "applyFilter"]),
173 173
     SetType(item) {
174 174
       this.propertyUsageType = item;
175
+      localStorage.propertySearchUsageType = item;
175 176
     },
176 177
     SearchClick() {
177 178
       const item = this.suburbs.find(s => s.display === this.searchText);
@@ -181,7 +182,7 @@ export default {
181 182
       this.propertySearch.propertyUsageType = this.propertyUsageType;
182 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 187
     Filter() {
187 188
       this.applyFilter(this.searchText);
@@ -191,10 +192,17 @@ export default {
191 192
     },
192 193
     SelectedFilter(item) {
193 194
       this.searchText = item;
194
-    },
195
+    }
195 196
   },
196 197
   mounted() {
197 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 208
 </script>

+ 23
- 27
src/components/property/propertySearchResults.vue Переглянути файл

@@ -57,62 +57,58 @@
57 57
   </div>
58 58
 </template>
59 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 63
 export default {
64
-  name: 'propertysearch',
64
+  name: "propertysearch",
65 65
   components: {
66
-    propertyCard,
66
+    propertyCard
67 67
   },
68 68
   data() {
69 69
     return {};
70 70
   },
71 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 75
     if (this.user) {
76 76
       this.propertySearch.userName = this.user.username;
77 77
     }
78
+
78 79
     this.searchProperties(this.propertySearch);
79 80
   },
80 81
   methods: {
81
-    ...mapActions('propertySearch', [
82
-      'searchProperties',
83
-      'clearProperties',
84
-      'updateResultsShowing',
82
+    ...mapActions("propertySearch", [
83
+      "searchProperties",
84
+      "clearProperties",
85
+      "updateResultsShowing"
85 86
     ]),
86 87
     SetType(item) {
87 88
       this.propertySearch.propertyUsageType = item;
88 89
     },
89 90
     SearchPage() {
90 91
       this.clearProperties();
91
-      this.$router.push('/property/search');
92
-    },
92
+      this.$router.push("/property/search");
93
+    }
93 94
   },
94 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 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 105
       return null;
110
-    },
106
+    }
111 107
   },
112 108
   watch: {
113 109
     ParamsChanged() {
114 110
       return null;
115
-    },
116
-  },
111
+    }
112
+  }
117 113
 };
118 114
 </script>

+ 89
- 25
src/components/shared/listView.vue Переглянути файл

@@ -1,5 +1,4 @@
1
-/* eslint-disable no-restricted-syntax */
2
-/* eslint-disable guard-for-in */
1
+/* eslint-disable no-restricted-syntax */ /* eslint-disable guard-for-in */
3 2
 <template>
4 3
   <div>
5 4
     <div style="height:5px"></div>
@@ -8,7 +7,7 @@
8 7
         <input v-model="searchItem" class="form-control" placeholder="Search...." />
9 8
       </div>
10 9
       <div class="p-2" v-if="title">
11
-        <h2>{{title}}</h2>
10
+        <h2>{{ title }}</h2>
12 11
       </div>
13 12
       <div class="p-2">
14 13
         <div class="d-flex flex-row">
@@ -17,7 +16,9 @@
17 16
               class="btn btn-primary myBackground btn-width cursor-pointer"
18 17
               data-toggle="modal"
19 18
               data-target="#myModal"
20
-            >Column Chooser</div>
19
+            >
20
+              Column Chooser
21
+            </div>
21 22
             <div class="col-md-12">
22 23
               <div id="myModal" class="modal fade" role="dialog">
23 24
                 <div class="modal-dialog modal-lg">
@@ -39,10 +40,14 @@
39 40
             <div
40 41
               class="btn btn-primary myBackground btn-width cursor-pointer"
41 42
               @click="onClearSelected()"
42
-            >Clear Selected</div>
43
+            >
44
+              Clear Selected
45
+            </div>
43 46
           </div>
44 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 51
           </div>
47 52
         </div>
48 53
       </div>
@@ -51,7 +56,7 @@
51 56
     <div v-if="items && items.length > 0" class="table-responsive">
52 57
       <table
53 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 61
         <thead>
57 62
           <tr class="dnd-moved">
@@ -63,7 +68,12 @@
63 68
                 :class="{ active: hover === c }"
64 69
               >
65 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 77
                   <div class="p-2 flex-shrink-1 bd-highlight">
68 78
                     <img
69 79
                       src="../../../public/img/sort-up.png"
@@ -88,12 +98,25 @@
88 98
             v-for="(item, i) in DisplayItems"
89 99
             :key="i"
90 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 120
             <td v-if="editable" class="my-width">
98 121
               <button type="button" class="btn my-btn" @click="onEdit(item)">Edit</button>
99 122
             </td>
@@ -104,9 +127,14 @@
104 127
         </tbody>
105 128
       </table>
106 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 138
         <div class="p-1">
111 139
           <BasePagination
112 140
             :currentPage="currentPage"
@@ -212,6 +240,15 @@ export default {
212 240
     },
213 241
     showColumnChooser: {
214 242
       default: true
243
+    },
244
+    displayColumns: {
245
+      default: []
246
+    },
247
+    displayFormats: {
248
+      default: []
249
+    },
250
+    displayHeaders: {
251
+      default: []
215 252
     }
216 253
   },
217 254
   data() {
@@ -247,10 +284,7 @@ export default {
247 284
         for (const i in Object.keys(this.items)) {
248 285
           const item = this.items[i];
249 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 288
               const columnName = Object.keys(item)[o];
255 289
               if (!listAll.some(x => x.column === columnName))
256 290
                 listAll.push({
@@ -277,6 +311,23 @@ export default {
277 311
     isObject(item) {
278 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 331
     onEdit(item) {
281 332
       this.$emit("onEdit", item);
282 333
     },
@@ -332,6 +383,13 @@ export default {
332 383
       if (this.currentPage !== 1) {
333 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 395
   computed: {
@@ -354,11 +412,17 @@ export default {
354 412
       if (!this.allColumn || this.allColumn.length === 0) {
355 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 428
       return listColumns;

+ 47
- 20
src/components/shared/searchTab.vue Переглянути файл

@@ -17,8 +17,14 @@
17 17
                     <i class="fa fa-search"></i>
18 18
                   </span>
19 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 28
                   <span class="input-group-text cursor-pointer myFill">
23 29
                     <b>X</b>
24 30
                   </span>
@@ -29,7 +35,11 @@
29 35
           <div class="col-md-2">
30 36
             <button
31 37
               type="button"
32
-              :class="[selectedPropertyType === 'Timeshare' ? 'tabButton isSelected' : 'tabButton isUnSelected']"
38
+              :class="[
39
+                selectedPropertyType === 'Timeshare'
40
+                  ? 'tabButton isSelected'
41
+                  : 'tabButton isUnSelected'
42
+              ]"
33 43
               @click="setTypeTimeshare"
34 44
             >
35 45
               <b>Timeshare</b>
@@ -38,7 +48,11 @@
38 48
           <div class="col-md-2">
39 49
             <button
40 50
               type="button"
41
-              :class="[selectedPropertyType === 'Residential' ? 'tabButton isSelected' : 'tabButton isUnSelected']"
51
+              :class="[
52
+                selectedPropertyType === 'Residential'
53
+                  ? 'tabButton isSelected'
54
+                  : 'tabButton isUnSelected'
55
+              ]"
42 56
               @click="setTypeResidential"
43 57
             >
44 58
               <b>Residential</b>
@@ -47,7 +61,11 @@
47 61
           <div class="col-md-2">
48 62
             <button
49 63
               type="button"
50
-              :class="[selectedPropertyType === 'Commercial' ? 'tabButton isSelected' : 'tabButton isUnSelected']"
64
+              :class="[
65
+                selectedPropertyType === 'Commercial'
66
+                  ? 'tabButton isSelected'
67
+                  : 'tabButton isUnSelected'
68
+              ]"
51 69
               @click="setTypeCommercial"
52 70
             >
53 71
               <b>Commercial</b>
@@ -69,45 +87,54 @@
69 87
 </template>
70 88
 
71 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 94
 export default {
77 95
   components: {
78 96
     propertySearch,
79
-    timeshareSearch,
97
+    timeshareSearch
80 98
   },
81 99
   data() {
82 100
     return {
83
-      selectedPropertyType: 'Timeshare',
84
-      keyword: '',
101
+      selectedPropertyType: "Timeshare",
102
+      keyword: ""
85 103
     };
86 104
   },
87 105
   computed: {
88
-    ...mapState('weekList', ['filter']),
89
-    ...mapState('propertySearch', ['propertySearch']),
106
+    ...mapState("weekList", ["filter"]),
107
+    ...mapState("propertySearch", ["propertySearch"])
90 108
   },
91 109
   methods: {
92 110
     updateType(item) {
93 111
       this.selectedPropertyType = item;
94 112
     },
95 113
     Search() {
96
-      if (this.selectedPropertyType === 'Timeshare') {
97
-        this.$router.push('/timesharesearch');
114
+      if (this.selectedPropertyType === "Timeshare") {
115
+        this.$router.push("/timesharesearch");
98 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 121
     setTypeTimeshare() {
103
-      this.selectedPropertyType = 'Timeshare';
122
+      this.selectedPropertyType = "Timeshare";
104 123
     },
105 124
     setTypeResidential() {
106
-      this.selectedPropertyType = 'Residential';
125
+      this.selectedPropertyType = "Residential";
107 126
     },
108 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 140
 </script>

+ 22
- 18
src/main.js Переглянути файл

@@ -1,17 +1,18 @@
1 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 10
 Vue.use(EvaIcons);
10 11
 
11 12
 Vue.config.productionTip = false;
12 13
 
13 14
 Vue.prototype.$http = axios;
14
-const token = localStorage.getItem('token');
15
+const token = localStorage.getItem("token");
15 16
 if (token) {
16 17
   Vue.prototype.$http.defaults.headers.common.Authorization = token;
17 18
 }
@@ -22,36 +23,39 @@ router.beforeEach((to, from, next) => {
22 23
       next();
23 24
       return;
24 25
     }
25
-    next('/users/login');
26
+    next("/users/login");
26 27
   } else {
27 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 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 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 44
     console.log(typeof value);
44 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 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 57
 new Vue({
54 58
   render: h => h(App),
55 59
   router,
56
-  store,
57
-}).$mount('#app');
60
+  store
61
+}).$mount("#app");

+ 182
- 177
src/router/index.js Переглянути файл

@@ -1,57 +1,57 @@
1 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 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 56
 Vue.use(Router);
57 57
 
@@ -60,232 +60,237 @@ export default new Router({
60 60
   scrollBehavior(to, from, savedPosition) {
61 61
     return {
62 62
       x: 0,
63
-      y: 0,
63
+      y: 0
64 64
     };
65 65
   },
66 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 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 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 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 Переглянути файл

@@ -1,5 +1,5 @@
1
-import axios from 'axios';
2
-import _ from 'lodash';
1
+import axios from "axios";
2
+import _ from "lodash";
3 3
 
4 4
 export default {
5 5
   namespaced: true,
@@ -8,57 +8,72 @@ export default {
8 8
     fields: [],
9 9
     filter: {
10 10
       by: undefined,
11
-      value: undefined,
12
-    },
11
+      value: undefined
12
+    }
13 13
   },
14 14
   mutations: {
15 15
     updateSearch(state, data) {
16 16
       state.list = [];
17 17
       state.fields = [];
18 18
       state.list = data;
19
-      data.forEach((item) => {
19
+      data.forEach(item => {
20 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 26
       state.fields = state.fields.filter((x, i, a) => a.indexOf(x) === i);
23 27
     },
24 28
     onClearFilter(state) {
25 29
       state.filter = {
26 30
         by: undefined,
27
-        value: undefined,
31
+        value: undefined
28 32
       };
29
-    },
33
+    }
30 34
   },
31 35
   getters: {
32
-    filterList: (state) => {
36
+    filterList: state => {
33 37
       let lst = state.list;
34 38
       const { filter } = state;
35 39
       if (filter) {
36 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 55
         } else if (filter.value) {
42 56
           lst = _.filter(
43 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 65
       return lst;
51
-    },
66
+    }
52 67
   },
53 68
   actions: {
54 69
     getPropertySearchLogs({ commit }) {
55 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 73
         .catch(console.error);
59 74
     },
60 75
     clearFilter({ commit }) {
61
-      commit('onClearFilter');
62
-    },
63
-  },
76
+      commit("onClearFilter");
77
+    }
78
+  }
64 79
 };

+ 13
- 13
src/store/modules/misc/carousel.js Переглянути файл

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

+ 20
- 15
src/store/modules/processFlow/bid.js Переглянути файл

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

+ 41
- 38
src/store/modules/property/propertySearch.js Переглянути файл

@@ -1,31 +1,32 @@
1 1
 /* eslint-disable valid-typeof */
2 2
 /* eslint-disable max-len */
3 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 8
 export default {
8 9
   namespaced: true,
9 10
   state: {
10 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 19
       minPrice: 0,
19 20
       maxPrice: 0,
20 21
       availableFrom: undefined,
21
-      propertyId: 0,
22
+      propertyId: 0
22 23
     },
23 24
     properties: [],
24 25
     latestProperties: [],
25 26
     suburbs: [],
26
-    searchText: '',
27
+    searchText: "",
27 28
     suburbList: [],
28
-    resultsShowing: false,
29
+    resultsShowing: false
29 30
   },
30 31
   mutations: {
31 32
     updateSearch(state, propertySearch) {
@@ -39,10 +40,10 @@ export default {
39 40
       state.propertySearch = search;
40 41
     },
41 42
     onClearFilter(state, filter) {
42
-      if (filter === 'availableFrom') {
43
+      if (filter === "availableFrom") {
43 44
         state.propertySearch[filter] = undefined;
44 45
       } else {
45
-        state.propertySearch[filter] = 'All';
46
+        state.propertySearch[filter] = "All";
46 47
       }
47 48
     },
48 49
     setSuburbs(state, items) {
@@ -58,61 +59,63 @@ export default {
58 59
     },
59 60
     setResultsShowing(state, value) {
60 61
       state.resultsShowing = value;
61
-    },
62
+    }
62 63
   },
63 64
   getters: {
64
-    filterSuburbs: (state) => {
65
+    filterSuburbs: state => {
65 66
       let subs = state.suburbs;
66 67
       if (state.searchText) {
67 68
         subs = _.filter(subs, s => s.display.contains(state.searchText));
68 69
       }
69 70
       return subs;
70
-    },
71
+    }
71 72
   },
72 73
   actions: {
73 74
     clearFilter({ commit }, filter) {
74
-      commit('onClearFilter', filter);
75
+      commit("onClearFilter", filter);
75 76
     },
76 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 95
       axios
93 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 100
         .catch(console.error);
98 101
     },
99 102
     searchLatestProperties({ commit }) {
100 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 106
         .catch(console.error);
104 107
     },
105 108
     getSuburbs({ commit }) {
106 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 112
         .catch(console.error);
110 113
     },
111 114
     applyFilter({ commit }, value) {
112
-      commit('setFilter', { value });
115
+      commit("setFilter", { value });
113 116
     },
114 117
     updateResultsShowing({ commit }, value) {
115
-      commit('setResultsShowing', value);
116
-    },
117
-  },
118
+      commit("setResultsShowing", value);
119
+    }
120
+  }
118 121
 };

Завантаження…
Відмінити
Зберегти