Browse Source

Bid, prop publish & Pay

master
George Williams 5 years ago
parent
commit
1bf9b88aab

+ 1879
- 1451
package-lock.json
File diff suppressed because it is too large
View File


+ 18
- 18
package.json View File

9
     "lint": "vue-cli-service lint"
9
     "lint": "vue-cli-service lint"
10
   },
10
   },
11
   "dependencies": {
11
   "dependencies": {
12
-    "@nuxtjs/axios": "^5.6.0",
12
+    "@nuxtjs/axios": "^5.9.3",
13
     "animate.css": "^3.7.2",
13
     "animate.css": "^3.7.2",
14
-    "axios": "^0.19.0",
15
-    "core-js": "^2.6.5",
16
-    "datatables.net": "^1.10.19",
14
+    "axios": "^0.19.2",
15
+    "core-js": "^2.6.11",
16
+    "datatables.net": "^1.10.20",
17
     "jquery": "^3.4.1",
17
     "jquery": "^3.4.1",
18
     "lodash": "^4.17.15",
18
     "lodash": "^4.17.15",
19
     "material-design-icons-iconfont": "^3.0.3",
19
     "material-design-icons-iconfont": "^3.0.3",
20
     "moment": "^2.24.0",
20
     "moment": "^2.24.0",
21
-    "node-sass": "^4.12.0",
21
+    "node-sass": "^4.13.1",
22
     "roboto-fontface": "*",
22
     "roboto-fontface": "*",
23
     "sass-loader": "^7.3.1",
23
     "sass-loader": "^7.3.1",
24
     "stylus-loader": "^3.0.2",
24
     "stylus-loader": "^3.0.2",
25
     "v-file-upload": "^3.1.7",
25
     "v-file-upload": "^3.1.7",
26
-    "vue": "^2.6.10",
26
+    "vue": "^2.6.11",
27
     "vue-carousel": "^0.18.0",
27
     "vue-carousel": "^0.18.0",
28
     "vue-eva-icons": "^1.1.1",
28
     "vue-eva-icons": "^1.1.1",
29
     "vue-json-excel": "^0.2.98",
29
     "vue-json-excel": "^0.2.98",
30
-    "vue-router": "^3.0.7",
31
-    "vue-trix": "^1.0.0",
30
+    "vue-router": "^3.1.5",
31
+    "vue-trix": "^1.1.7",
32
     "vue2-editor": "^2.10.2",
32
     "vue2-editor": "^2.10.2",
33
-    "vuetify": "^1.5.5",
34
-    "vuex": "^3.1.1"
33
+    "vuetify": "^1.5.22",
34
+    "vuex": "^3.1.2"
35
   },
35
   },
36
   "devDependencies": {
36
   "devDependencies": {
37
-    "@fortawesome/fontawesome-free": "^5.11.2",
38
-    "@vue/cli-plugin-babel": "^3.8.0",
39
-    "@vue/cli-plugin-eslint": "^3.8.0",
40
-    "@vue/cli-service": "^3.8.0",
41
-    "@vue/eslint-config-airbnb": "^4.0.0",
42
-    "babel-eslint": "^10.0.1",
37
+    "@fortawesome/fontawesome-free": "^5.12.0",
38
+    "@vue/cli-plugin-babel": "^3.12.1",
39
+    "@vue/cli-plugin-eslint": "^3.12.1",
40
+    "@vue/cli-service": "^3.12.1",
41
+    "@vue/eslint-config-airbnb": "^4.0.1",
42
+    "babel-eslint": "^10.0.3",
43
     "eslint": "^5.16.0",
43
     "eslint": "^5.16.0",
44
-    "eslint-plugin-vue": "^5.0.0",
44
+    "eslint-plugin-vue": "^5.2.3",
45
     "vue-cli-plugin-vuetify": "^0.5.0",
45
     "vue-cli-plugin-vuetify": "^0.5.0",
46
-    "vue-template-compiler": "^2.6.10"
46
+    "vue-template-compiler": "^2.6.11"
47
   }
47
   }
48
 }
48
 }

+ 6
- 22
src/components/admin/misc/carouselSearch.vue View File

18
               :showNew="false"
18
               :showNew="false"
19
               @onRowClick="onRowClick"
19
               @onRowClick="onRowClick"
20
             />
20
             />
21
-            <ListView2 v-else :items="properties" :showNew="false" @onRowClick="onRowClick" />
21
+            <ListView2 v-else :items="propertiesLive" :showNew="false" @onRowClick="onRowClick" />
22
           </div>
22
           </div>
23
         </div>
23
         </div>
24
       </div>
24
       </div>
50
     if (this.name === "Timeshare") {
50
     if (this.name === "Timeshare") {
51
       this.getItems(this.user.id);
51
       this.getItems(this.user.id);
52
     } else {
52
     } else {
53
-      this.getProperties(
54
-        Object.assign(
55
-          {},
56
-          {
57
-            propertyType: "Admin",
58
-            user: this.user.id
59
-          }
60
-        )
61
-      );
53
+      this.getLiveProperties();
62
     }
54
     }
63
   },
55
   },
64
   computed: {
56
   computed: {
65
     ...mapState("myWeeks", ["items"]),
57
     ...mapState("myWeeks", ["items"]),
66
-    ...mapState("propertyList", ["properties"]),
58
+    ...mapState("propertyList", ["propertiesLive"]),
67
     // eslint-disable-next-line vue/return-in-computed-property
59
     // eslint-disable-next-line vue/return-in-computed-property
68
     nameChanged() {
60
     nameChanged() {
69
       if (this.name === "Timeshare") {
61
       if (this.name === "Timeshare") {
70
         this.getItems(this.user.id);
62
         this.getItems(this.user.id);
71
       } else {
63
       } else {
72
-        this.getProperties(
73
-          Object.assign(
74
-            {},
75
-            {
76
-              propertyType: "Admin",
77
-              user: this.user.id
78
-            }
79
-          )
80
-        );
64
+        this.getLiveProperties();
81
       }
65
       }
82
     }
66
     }
83
   },
67
   },
84
   methods: {
68
   methods: {
85
     ...mapActions("myWeeks", ["getItems"]),
69
     ...mapActions("myWeeks", ["getItems"]),
86
-    ...mapActions("propertyList", ["getProperties"]),
70
+    ...mapActions("propertyList", ["getLiveProperties"]),
87
     onRowClick(item) {
71
     onRowClick(item) {
88
       if (this.name === "Timeshare") {
72
       if (this.name === "Timeshare") {
89
         const week = this.items[item];
73
         const week = this.items[item];
90
         this.$emit("onSelected", week);
74
         this.$emit("onSelected", week);
91
       } else {
75
       } else {
92
-        const prop = this.properties[item];
76
+        const prop = this.propertiesLive[item];
93
         this.$emit("onSelected", prop);
77
         this.$emit("onSelected", prop);
94
       }
78
       }
95
     }
79
     }

+ 3
- 0
src/components/financial/makePayment.vue View File

1
+<template>
2
+  <h1>Payment Page</h1>
3
+</template>

+ 60
- 0
src/components/financial/payments.vue View File

1
+<template>
2
+  <!-- eslint-disable max-len -->
3
+  <div>
4
+    <div class="container">
5
+      <div class="container">
6
+        <br />
7
+        <br />
8
+        <div class="row">
9
+          <div class="col-md-12 col-lg-8">
10
+            <div class="title-box-d">
11
+              <h1 class="title-d" style="text-align:left; font-size: 250%">Payments</h1>
12
+            </div>
13
+          </div>
14
+        </div>
15
+      </div>
16
+    </div>
17
+    <div class="container">
18
+      <listView
19
+        :items="payments"
20
+        :showNew="false"
21
+        :editable="true"
22
+        :deleteable="true"
23
+        @onEdit="Edit"
24
+        @onDelete="Delete"
25
+      />
26
+    </div>
27
+    <br />
28
+  </div>
29
+</template>
30
+
31
+<script>
32
+import { mapState, mapActions } from "vuex";
33
+import listView from "../shared/listView.vue";
34
+import Log from "../../assets/Log";
35
+
36
+export default {
37
+  name: "PaymentList",
38
+  components: {
39
+    listView
40
+  },
41
+  data() {
42
+    return {
43
+      userId: Log.getUser().Id
44
+    };
45
+  },
46
+  methods: {
47
+    ...mapActions("Payment", ["getPayments"])
48
+  },
49
+  mounted() {
50
+    this.getProperties(Object.assign(this.user.id));
51
+  },
52
+  computed: {
53
+    ...mapState("Payment", ["payments"]),
54
+    UserChanged() {
55
+      this.getProperties(Object.assign(this.user.id));
56
+      return this.user;
57
+    }
58
+  }
59
+};
60
+</script>

+ 149
- 132
src/components/processFlow/makeOffer.vue View File

1
 <template>
1
 <template>
2
   <!-- eslint-disable max-len -->
2
   <!-- eslint-disable max-len -->
3
   <div style="padding-left:50px; padding-right:50px; padding-bottom:50px;">
3
   <div style="padding-left:50px; padding-right:50px; padding-bottom:50px;">
4
-    <div v-if="!isSaved">
5
-      <br />
6
-      <div v-if="isProperty">
7
-        <div class="form-group row">
8
-          <div style="text-align:left">
9
-            <div class="title-box-d">
10
-              <h3 class="title-d">{{ item.shortDescription }}</h3>
4
+    <div v-if="!isLoggedIn">
5
+      <div class="container col-md-10">
6
+        <p class="alert myError">Please Login to add a property</p>
7
+      </div>
8
+      <button
9
+        type="button"
10
+        class="btn btn-b-n"
11
+        style="width: 150px; height:40px;"
12
+        data-dismiss="modal"
13
+      >
14
+        OK
15
+      </button>
16
+    </div>
17
+    <div v-else>
18
+      <div v-if="!isSaved">
19
+        <br />
20
+        <div v-if="isProperty">
21
+          <div class="form-group row">
22
+            <div style="text-align:left">
23
+              <div class="title-box-d">
24
+                <h3 class="title-d">{{ item.shortDescription }}</h3>
25
+              </div>
11
             </div>
26
             </div>
12
           </div>
27
           </div>
13
-        </div>
14
-        <div class="form-group row">
15
-          <div class="col-md-12" style="text-align:left">
16
-            <div v-html="item.description"></div>
28
+          <div class="form-group row">
29
+            <div class="col-md-12" style="text-align:left">
30
+              <div v-html="item.description"></div>
31
+            </div>
17
           </div>
32
           </div>
18
         </div>
33
         </div>
19
-      </div>
20
-      <div v-if="!isProperty">
21
-        <div class="form-group row">
22
-          <div style="text-align:left">
23
-            <div class="title-box-d">
24
-              <h3 class="title-d">
25
-                {{ item.resort.resortName ? item.resort.resortName : item.resort }}
26
-              </h3>
34
+        <div v-if="!isProperty">
35
+          <div class="form-group row">
36
+            <div style="text-align:left">
37
+              <div class="title-box-d">
38
+                <h3 class="title-d">
39
+                  {{ item.resort.resortName ? item.resort.resortName : item.resort }}
40
+                </h3>
41
+              </div>
42
+            </div>
43
+          </div>
44
+          <div class="form-group row">
45
+            <div class="col-md-6">
46
+              <label for="resortunit">Unit</label>
47
+              <div class="input-group mb-3">
48
+                <div class="input-group-prepend">
49
+                  <span class="input-group-text" style="color: #60CBEB">
50
+                    <b>U#</b>
51
+                  </span>
52
+                </div>
53
+                <input
54
+                  class="form-control"
55
+                  type="text"
56
+                  id="resort"
57
+                  name="resortunit"
58
+                  disabled
59
+                  v-model="item.unitNumber"
60
+                />
61
+              </div>
62
+            </div>
63
+            <div class="col-md-6">
64
+              <label for="resortWeek">Module / Week Number</label>
65
+              <div class="input-group mb-3">
66
+                <div class="input-group-prepend">
67
+                  <span class="input-group-text" style="color: #60CBEB">
68
+                    <b>M</b>
69
+                  </span>
70
+                </div>
71
+                <input
72
+                  class="form-control"
73
+                  type="text"
74
+                  id="week"
75
+                  name="resortWeek"
76
+                  disabled
77
+                  v-model="item.weekNumber"
78
+                />
79
+              </div>
27
             </div>
80
             </div>
28
           </div>
81
           </div>
29
         </div>
82
         </div>
30
         <div class="form-group row">
83
         <div class="form-group row">
31
           <div class="col-md-6">
84
           <div class="col-md-6">
32
-            <label for="resortunit">Unit</label>
85
+            <label>Current Price</label>
33
             <div class="input-group mb-3">
86
             <div class="input-group mb-3">
34
               <div class="input-group-prepend">
87
               <div class="input-group-prepend">
35
                 <span class="input-group-text" style="color: #60CBEB">
88
                 <span class="input-group-text" style="color: #60CBEB">
36
-                  <b>U#</b>
89
+                  <b>R</b>
37
                 </span>
90
                 </span>
38
               </div>
91
               </div>
39
               <input
92
               <input
93
+                v-if="isProperty"
40
                 class="form-control"
94
                 class="form-control"
41
-                type="text"
42
-                id="resort"
43
-                name="resortunit"
95
+                type="number"
96
+                v-model="item.price"
44
                 disabled
97
                 disabled
45
-                v-model="item.unitNumber"
46
               />
98
               />
99
+              <input v-else class="form-control" type="number" v-model="item.sellPrice" disabled />
47
             </div>
100
             </div>
48
           </div>
101
           </div>
49
           <div class="col-md-6">
102
           <div class="col-md-6">
50
-            <label for="resortWeek">Module / Week Number</label>
103
+            <label>Offer</label>
51
             <div class="input-group mb-3">
104
             <div class="input-group mb-3">
52
               <div class="input-group-prepend">
105
               <div class="input-group-prepend">
53
                 <span class="input-group-text" style="color: #60CBEB">
106
                 <span class="input-group-text" style="color: #60CBEB">
54
-                  <b>M</b>
107
+                  <b>R</b>
55
                 </span>
108
                 </span>
56
               </div>
109
               </div>
57
               <input
110
               <input
58
                 class="form-control"
111
                 class="form-control"
59
-                type="text"
60
-                id="week"
61
-                name="resortWeek"
62
-                disabled
63
-                v-model="item.weekNumber"
112
+                type="number"
113
+                step="any"
114
+                id="minPrice"
115
+                name="minPrice"
116
+                v-model="item.offer"
117
+                :disabled="!isMakeOffer"
64
               />
118
               />
65
             </div>
119
             </div>
66
           </div>
120
           </div>
67
         </div>
121
         </div>
68
-      </div>
69
-      <div class="form-group row">
70
-        <div class="col-md-6">
71
-          <label>Current Price</label>
72
-          <div class="input-group mb-3">
73
-            <div class="input-group-prepend">
74
-              <span class="input-group-text" style="color: #60CBEB">
75
-                <b>R</b>
76
-              </span>
77
-            </div>
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 />
86
-          </div>
87
-        </div>
88
-        <div class="col-md-6">
89
-          <label>Offer</label>
90
-          <div class="input-group mb-3">
91
-            <div class="input-group-prepend">
92
-              <span class="input-group-text" style="color: #60CBEB">
93
-                <b>R</b>
94
-              </span>
95
-            </div>
96
-            <input
97
-              class="form-control"
98
-              type="number"
99
-              step="any"
100
-              id="minPrice"
101
-              name="minPrice"
102
-              v-model="item.offer"
122
+        <div class="form-group row">
123
+          <div class="col-md-12">
124
+            <label>Comments</label>
125
+            <textarea
126
+              class="form-control editor form-control-lg form-control-a"
127
+              name="description"
128
+              v-model="item.comment"
103
               :disabled="!isMakeOffer"
129
               :disabled="!isMakeOffer"
104
-            />
130
+            ></textarea>
105
           </div>
131
           </div>
106
         </div>
132
         </div>
107
       </div>
133
       </div>
108
-      <div class="form-group row">
134
+      <div v-if="!isSaved" class="container">
135
+        <button
136
+          v-if="isMakeOffer"
137
+          type="button"
138
+          @click="SendOffer()"
139
+          class="btn btn-b-n"
140
+          style="width: 150px; height:40px;"
141
+        >
142
+          Send Offer
143
+        </button>
144
+        <button
145
+          v-if="!isMakeOffer && !isDecline && canEdit"
146
+          type="submit"
147
+          @click="Accept()"
148
+          class="btn btn-b-n"
149
+          style="width: 150px; height:40px;"
150
+        >
151
+          Accept
152
+        </button>
153
+        <button
154
+          v-if="!isMakeOffer && !isDecline && canEdit"
155
+          type="button"
156
+          @click="Decline()"
157
+          class="btn btn-b-n"
158
+          style="width: 150px; height:40px;"
159
+        >
160
+          Decline
161
+        </button>
162
+      </div>
163
+      <div v-if="isDecline || item.statusCode === 'E3'" class="form-group row">
109
         <div class="col-md-12">
164
         <div class="col-md-12">
110
-          <label>Comments</label>
165
+          <br />
166
+          <label>Decline Reason</label>
111
           <textarea
167
           <textarea
112
             class="form-control editor form-control-lg form-control-a"
168
             class="form-control editor form-control-lg form-control-a"
113
             name="description"
169
             name="description"
114
-            v-model="item.comment"
115
-            :disabled="!isMakeOffer"
170
+            v-model="item.declineReason"
171
+            :disabled="item.statusCode === 'E3'"
116
           ></textarea>
172
           ></textarea>
117
         </div>
173
         </div>
118
       </div>
174
       </div>
119
-    </div>
120
-    <div v-if="!isSaved" class="container">
121
       <button
175
       <button
122
-        v-if="isMakeOffer"
176
+        v-if="isDecline"
123
         type="button"
177
         type="button"
124
-        @click="SendOffer()"
125
-        class="btn btn-b-n"
126
-        style="width: 150px; height:40px;"
127
-      >
128
-        Send Offer
129
-      </button>
130
-      <button
131
-        v-if="!isMakeOffer && !isDecline && canEdit"
132
-        type="submit"
133
-        @click="Accept()"
178
+        @click="Complete()"
134
         class="btn btn-b-n"
179
         class="btn btn-b-n"
135
         style="width: 150px; height:40px;"
180
         style="width: 150px; height:40px;"
136
       >
181
       >
137
-        Accept
182
+        Complete
138
       </button>
183
       </button>
139
-      <button
140
-        v-if="!isMakeOffer && !isDecline && canEdit"
141
-        type="button"
142
-        @click="Decline()"
143
-        class="btn btn-b-n"
144
-        style="width: 150px; height:40px;"
145
-      >
146
-        Decline
147
-      </button>
148
-    </div>
149
-    <div v-if="isDecline || item.statusCode === 'E3'" class="form-group row">
150
-      <div class="col-md-12">
151
-        <br />
152
-        <label>Decline Reason</label>
153
-        <textarea
154
-          class="form-control editor form-control-lg form-control-a"
155
-          name="description"
156
-          v-model="item.declineReason"
157
-          :disabled="item.statusCode === 'E3'"
158
-        ></textarea>
159
-      </div>
160
-    </div>
161
-    <button
162
-      v-if="isDecline"
163
-      type="button"
164
-      @click="Complete()"
165
-      class="btn btn-b-n"
166
-      style="width: 150px; height:40px;"
167
-    >
168
-      Complete
169
-    </button>
170
-    <div v-if="isSaved">
171
-      <div class="form-group row">
172
-        <br />
173
-        <div class="container col-md-10">
174
-          <p :class="[isInfo ? 'alert myInfo' : 'alert myWarning']">{{ message }}</p>
184
+      <div v-if="isSaved">
185
+        <div class="form-group row">
186
+          <br />
187
+          <div class="container col-md-10">
188
+            <p :class="[isInfo ? 'alert myInfo' : 'alert myWarning']">{{ message }}</p>
189
+          </div>
175
         </div>
190
         </div>
191
+        <button
192
+          v-if="isSaved"
193
+          type="button"
194
+          class="btn btn-b-n"
195
+          style="width: 150px; height:40px;"
196
+          data-dismiss="modal"
197
+        >
198
+          OK
199
+        </button>
176
       </div>
200
       </div>
177
-      <button
178
-        v-if="isSaved"
179
-        type="button"
180
-        class="btn btn-b-n"
181
-        style="width: 150px; height:40px;"
182
-        data-dismiss="modal"
183
-      >
184
-        OK
185
-      </button>
186
     </div>
201
     </div>
187
   </div>
202
   </div>
188
 </template>
203
 </template>
189
 
204
 
190
 <script>
205
 <script>
191
 import { mapState, mapActions } from "vuex";
206
 import { mapState, mapActions } from "vuex";
207
+import Log from "../../assets/Log";
192
 
208
 
193
 export default {
209
 export default {
194
   name: "MakeOffer",
210
   name: "MakeOffer",
198
     canEdit: Boolean,
214
     canEdit: Boolean,
199
     item: Object,
215
     item: Object,
200
     bidId: Number,
216
     bidId: Number,
201
-    updateItem: Function
217
+    updateItem: Function,
218
+    isLoggedIn: Log.isLoggedIn()
202
   },
219
   },
203
   data() {
220
   data() {
204
     return {
221
     return {

+ 29
- 39
src/components/property/propertyCreate.vue View File

29
         <div class="container col-md-10">
29
         <div class="container col-md-10">
30
           <p class="alert myError">Please Login to add a property</p>
30
           <p class="alert myError">Please Login to add a property</p>
31
         </div>
31
         </div>
32
+        <div class="container col-md-10">
33
+          <button
34
+            type="button"
35
+            class="btn btn-b-n"
36
+            style="width: 150px; height:40px;"
37
+            @click="Login"
38
+          >
39
+            Login
40
+          </button>
41
+        </div>
32
       </div>
42
       </div>
33
       <div class="row" v-if="mayEdit">
43
       <div class="row" v-if="mayEdit">
34
         <div class="container col-md-10">
44
         <div class="container col-md-10">
77
                   >
87
                   >
78
                     <option value="0">Please select type</option>
88
                     <option value="0">Please select type</option>
79
                     <option v-for="item in propertyTypes" :value="item.id" :key="item.id">
89
                     <option v-for="item in propertyTypes" :value="item.id" :key="item.id">
80
-                      {{
81
-                      item.description
82
-                      }}
90
+                      {{ item.description }}
83
                     </option>
91
                     </option>
84
                   </select>
92
                   </select>
85
                 </div>
93
                 </div>
163
                   >
171
                   >
164
                     <option value="0">Please select province</option>
172
                     <option value="0">Please select province</option>
165
                     <option v-for="province in provinces" :value="province.id" :key="province.id">
173
                     <option v-for="province in provinces" :value="province.id" :key="province.id">
166
-                      {{
167
-                      province.description
168
-                      }}
174
+                      {{ province.description }}
169
                     </option>
175
                     </option>
170
                   </select>
176
                   </select>
171
                 </div>
177
                 </div>
189
                   >
195
                   >
190
                     <option value="0">Please select city</option>
196
                     <option value="0">Please select city</option>
191
                     <option v-for="city in cities" :value="city.id" :key="city.id">
197
                     <option v-for="city in cities" :value="city.id" :key="city.id">
192
-                      {{
193
-                      city.description
194
-                      }}
198
+                      {{ city.description }}
195
                     </option>
199
                     </option>
196
                   </select>
200
                   </select>
197
                 </div>
201
                 </div>
214
                   >
218
                   >
215
                     <option value="0">Please select suburb</option>
219
                     <option value="0">Please select suburb</option>
216
                     <option v-for="suburb in suburbs" :value="suburb.id" :key="suburb.id">
220
                     <option v-for="suburb in suburbs" :value="suburb.id" :key="suburb.id">
217
-                      {{
218
-                      suburb.description
219
-                      }}
221
+                      {{ suburb.description }}
220
                     </option>
222
                     </option>
221
                   </select>
223
                   </select>
222
                 </div>
224
                 </div>
380
               @click="SubmitData()"
382
               @click="SubmitData()"
381
               class="btn btn-b-n"
383
               class="btn btn-b-n"
382
               style="width: 85px; height:40px;"
384
               style="width: 85px; height:40px;"
383
-            >Save</button>
385
+            >
386
+              Save
387
+            </button>
384
             <div
388
             <div
385
               v-if="showPropertyTypeError || showProvinceError || showCityError || showSuburbError"
389
               v-if="showPropertyTypeError || showProvinceError || showCityError || showSuburbError"
386
             >
390
             >
387
-              <p
388
-                class="alert myError"
389
-              >Missing fields. Please fill in all required fields. Marked with *</p>
391
+              <p class="alert myError">
392
+                Missing fields. Please fill in all required fields. Marked with *
393
+              </p>
390
             </div>
394
             </div>
391
             <div v-if="wait" id="preloader"></div>
395
             <div v-if="wait" id="preloader"></div>
392
           </form>
396
           </form>
423
       customToolbar: [
427
       customToolbar: [
424
         [{ header: [false, 1, 2, 3, 4, 5, 6] }],
428
         [{ header: [false, 1, 2, 3, 4, 5, 6] }],
425
         ["bold", "italic", "underline", "strike"],
429
         ["bold", "italic", "underline", "strike"],
426
-        [
427
-          { align: "" },
428
-          { align: "center" },
429
-          { align: "right" },
430
-          { align: "justify" }
431
-        ],
430
+        [{ align: "" }, { align: "center" }, { align: "right" }, { align: "justify" }],
432
         [{ list: "ordered" }, { list: "bullet" }, { list: "check" }],
431
         [{ list: "ordered" }, { list: "bullet" }, { list: "check" }],
433
         [{ script: "sub" }, { script: "super" }],
432
         [{ script: "sub" }, { script: "super" }],
434
         [{ indent: "-1" }, { indent: "+1" }]
433
         [{ indent: "-1" }, { indent: "+1" }]
476
         this.showSuburbError = true;
475
         this.showSuburbError = true;
477
       }
476
       }
478
 
477
 
479
-      if (
480
-        this.salesType === "Rental" &&
481
-        this.property.dateAvailable === "undef"
482
-      ) {
478
+      if (this.salesType === "Rental" && this.property.dateAvailable === "undef") {
483
         this.showDateError = true;
479
         this.showDateError = true;
484
       }
480
       }
485
 
481
 
526
     Close() {
522
     Close() {
527
       this.$router.push("/property/admin/list/my");
523
       this.$router.push("/property/admin/list/my");
528
     },
524
     },
525
+    Login() {
526
+      this.$router.push("/user/login");
527
+    },
529
     PropertyTypeSelected(item) {
528
     PropertyTypeSelected(item) {
530
       if (item.target.options.selectedIndex > 0) {
529
       if (item.target.options.selectedIndex > 0) {
531
         this.showPropertyTypeError = false;
530
         this.showPropertyTypeError = false;
535
     },
534
     },
536
     ProvinceSelected(item) {
535
     ProvinceSelected(item) {
537
       if (item.target.options.selectedIndex > 0) {
536
       if (item.target.options.selectedIndex > 0) {
538
-        this.selectedProvince = this.provinces[
539
-          item.target.options.selectedIndex - 1
540
-        ].description;
537
+        this.selectedProvince = this.provinces[item.target.options.selectedIndex - 1].description;
541
         this.getCities(Object.assign({}, { province: this.selectedProvince }));
538
         this.getCities(Object.assign({}, { province: this.selectedProvince }));
542
         this.showProvinceError = false;
539
         this.showProvinceError = false;
543
       } else {
540
       } else {
546
     },
543
     },
547
     CitySelected(item) {
544
     CitySelected(item) {
548
       if (item.target.options.selectedIndex > 0) {
545
       if (item.target.options.selectedIndex > 0) {
549
-        this.selectedCity = this.cities[
550
-          item.target.options.selectedIndex - 1
551
-        ].description;
546
+        this.selectedCity = this.cities[item.target.options.selectedIndex - 1].description;
552
         this.getSuburbs(
547
         this.getSuburbs(
553
-          Object.assign(
554
-            {},
555
-            { province: this.selectedProvince, city: this.selectedCity }
556
-          )
548
+          Object.assign({}, { province: this.selectedProvince, city: this.selectedCity })
557
         );
549
         );
558
         this.showCityError = false;
550
         this.showCityError = false;
559
       } else {
551
       } else {
561
       }
553
       }
562
     },
554
     },
563
     getPostalCode(item) {
555
     getPostalCode(item) {
564
-      this.property.addressLine3 = this.suburbs[
565
-        item.target.options.selectedIndex - 1
566
-      ].postalCode;
556
+      this.property.addressLine3 = this.suburbs[item.target.options.selectedIndex - 1].postalCode;
567
       if (item.target.options.selectedIndex > 0) {
557
       if (item.target.options.selectedIndex > 0) {
568
         this.showSuburbError = false;
558
         this.showSuburbError = false;
569
       } else {
559
       } else {

+ 27
- 30
src/components/property/propertyList.vue View File

20
         :showNew="false"
20
         :showNew="false"
21
         :editable="true"
21
         :editable="true"
22
         :deleteable="true"
22
         :deleteable="true"
23
+        :showCustomAction="true"
24
+        :CustomActionHeading="'Publish'"
25
+        :displayColumns="columns"
26
+        :displayFormats="formats"
27
+        :displayHeaders="headers"
23
         @onEdit="Edit"
28
         @onEdit="Edit"
24
         @onDelete="Delete"
29
         @onDelete="Delete"
30
+        @onCustomClick="Publish"
25
       />
31
       />
26
     </div>
32
     </div>
27
     <br />
33
     <br />
42
     return {
48
     return {
43
       propertyType: "",
49
       propertyType: "",
44
       role: "MY",
50
       role: "MY",
45
-      user: Log.getUser()
51
+      user: Log.getUser(),
52
+      columns: [
53
+        "name",
54
+        "id",
55
+        "dateAvailable",
56
+        "size",
57
+        "price",
58
+        "usageType",
59
+        "type",
60
+        "saleType",
61
+        "publish",
62
+        "status"
63
+      ],
64
+      formats: ["text", "text", "date", "text", "money", "text", "text", "text", "text", "text"],
65
+      headers: ["", "", "Available From", "", "", "", "Property Type", "", "", ""]
46
     };
66
     };
47
   },
67
   },
48
   methods: {
68
   methods: {
49
-    ...mapActions("propertyList", ["getProperties", "deleteProperty"]),
69
+    ...mapActions("propertyList", ["getProperties", "deleteProperty", "publishProperty"]),
50
     Edit(item) {
70
     Edit(item) {
51
       const salesType = item.isSale ? "Sale" : "Rental";
71
       const salesType = item.isSale ? "Sale" : "Rental";
52
       this.$router.push({
72
       this.$router.push({
56
     },
76
     },
57
     Delete(item) {
77
     Delete(item) {
58
       this.deleteProperty(item.id);
78
       this.deleteProperty(item.id);
79
+    },
80
+    Publish(item) {
81
+      this.publishProperty(item);
59
     }
82
     }
60
   },
83
   },
61
   mounted() {
84
   mounted() {
62
-    if (this.user.role === "Super Admin") {
63
-      this.role = "SUPERADMIN";
64
-    }
65
-    if (this.user.role === "Agency") {
66
-      this.role = "ADMIN";
67
-    }
68
-
69
-    this.getProperties(
70
-      Object.assign({
71
-        propertyType: this.role,
72
-        user: this.user.id
73
-      })
74
-    );
85
+    this.getProperties(Object.assign(this.user.id));
75
   },
86
   },
76
   computed: {
87
   computed: {
77
     ...mapState("propertyList", ["properties"]),
88
     ...mapState("propertyList", ["properties"]),
78
     UserChanged() {
89
     UserChanged() {
79
-      if (this.user.role === "Super Admin") {
80
-        // eslint-disable-next-line vue/no-side-effects-in-computed-properties
81
-        this.role = "SUPERADMIN";
82
-      }
83
-      if (this.user.role === "Agency") {
84
-        // eslint-disable-next-line vue/no-side-effects-in-computed-properties
85
-        this.role = "ADMIN";
86
-      }
87
-
88
-      this.getProperties(
89
-        Object.assign({
90
-          propertyType: this.role,
91
-          user: this.user.id
92
-        })
93
-      );
90
+      this.getProperties(Object.assign(this.user.id));
94
       return this.user;
91
       return this.user;
95
     }
92
     }
96
   },
93
   },

+ 21
- 2
src/components/shared/listView.vue View File

89
                 </div>
89
                 </div>
90
               </div>
90
               </div>
91
             </th>
91
             </th>
92
+            <th v-if="showCustomAction"></th>
92
             <th v-if="editable"></th>
93
             <th v-if="editable"></th>
93
             <th v-if="deleteable"></th>
94
             <th v-if="deleteable"></th>
94
           </tr>
95
           </tr>
105
                 {{ isObject(item[column]) ? item[column].display : item[column] }}
106
                 {{ isObject(item[column]) ? item[column].display : item[column] }}
106
               </div>
107
               </div>
107
               <div v-else-if="displayFormats.length > 0 && displayFormats[c] === 'date'">
108
               <div v-else-if="displayFormats.length > 0 && displayFormats[c] === 'date'">
108
-                {{ isObject(item[column]) ? item[column].display : item[column] | toDate }}
109
+                <div v-if="item[column] !== '0001-01-01T00:00:00'">
110
+                  {{ isObject(item[column]) ? item[column].display : item[column] | toDate }}
111
+                </div>
109
               </div>
112
               </div>
110
               <div v-else-if="displayFormats.length > 0 && displayFormats[c] === 'money'">
113
               <div v-else-if="displayFormats.length > 0 && displayFormats[c] === 'money'">
111
                 {{ isObject(item[column]) ? item[column].display : item[column] | toCurrency }}
114
                 {{ isObject(item[column]) ? item[column].display : item[column] | toCurrency }}
117
                 {{ isObject(item[column]) ? item[column].display : item[column] }}
120
                 {{ isObject(item[column]) ? item[column].display : item[column] }}
118
               </div>
121
               </div>
119
             </td>
122
             </td>
123
+            <td v-if="showCustomAction" class="my-width">
124
+              <button type="button" class="btn my-btn" @click="onCustomClick(item)">
125
+                {{ CustomActionHeading }}
126
+              </button>
127
+            </td>
120
             <td v-if="editable" class="my-width">
128
             <td v-if="editable" class="my-width">
121
               <button type="button" class="btn my-btn" @click="onEdit(item)">Edit</button>
129
               <button type="button" class="btn my-btn" @click="onEdit(item)">Edit</button>
122
             </td>
130
             </td>
228
     hideItemCount: {
236
     hideItemCount: {
229
       default: false
237
       default: false
230
     },
238
     },
231
-
232
     currentPage: {
239
     currentPage: {
233
       default: 1
240
       default: 1
234
     },
241
     },
249
     },
256
     },
250
     displayHeaders: {
257
     displayHeaders: {
251
       default: []
258
       default: []
259
+    },
260
+    showCustomAction: {
261
+      default: false
262
+    },
263
+    CustomActionHeading: {
264
+      default: ""
265
+    },
266
+    CustomActionCondition: {
267
+      default: ""
252
     }
268
     }
253
   },
269
   },
254
   data() {
270
   data() {
334
     onDelete(item) {
350
     onDelete(item) {
335
       this.$emit("onDelete", item);
351
       this.$emit("onDelete", item);
336
     },
352
     },
353
+    onCustomClick(item) {
354
+      this.$emit("onCustomClick", item);
355
+    },
337
     onRowClick(item, i) {
356
     onRowClick(item, i) {
338
       const ind = this.getActualIndex(i);
357
       const ind = this.getActualIndex(i);
339
       if (_.some(this.selectedItems, x => x === ind)) {
358
       if (_.some(this.selectedItems, x => x === ind)) {

+ 14
- 13
src/components/shared/navBar.vue View File

176
                   class="dropdown-item cursor-pointer"
176
                   class="dropdown-item cursor-pointer"
177
                   @click="routerGoTo('/user/updateProfileInfo')"
177
                   @click="routerGoTo('/user/updateProfileInfo')"
178
                 >Update Info</a>
178
                 >Update Info</a>
179
+                <a class="dropdown-item cursor-pointer" @click="routerGoTo('/payments')">Payments</a>
179
               </div>
180
               </div>
180
             </li>
181
             </li>
181
             <li class="nav-item dropdown" v-if="!isLoggedIn">
182
             <li class="nav-item dropdown" v-if="!isLoggedIn">
213
 </template>
214
 </template>
214
 
215
 
215
 <script>
216
 <script>
216
-import { mapState, mapActions } from 'vuex';
217
-import Log from '../../assets/Log';
217
+import { mapState, mapActions } from "vuex";
218
+import Log from "../../assets/Log";
218
 
219
 
219
 export default {
220
 export default {
220
   computed: {
221
   computed: {
221
-    ...mapState('authentication', [
222
-      'user',
223
-      'flag',
224
-      'status',
225
-      'person',
226
-      'token',
222
+    ...mapState("authentication", [
223
+      "user",
224
+      "flag",
225
+      "status",
226
+      "person",
227
+      "token"
227
     ]),
228
     ]),
228
     isLoggedIn() {
229
     isLoggedIn() {
229
       console.log(Log.isLoggedIn());
230
       console.log(Log.isLoggedIn());
235
     // eslint-disable-next-line vue/return-in-computed-property
236
     // eslint-disable-next-line vue/return-in-computed-property
236
     Logout() {
237
     Logout() {
237
       return this.logout();
238
       return this.logout();
238
-    },
239
+    }
239
   },
240
   },
240
   methods: {
241
   methods: {
241
-    ...mapActions('authentication', ['logout']),
242
+    ...mapActions("authentication", ["logout"]),
242
 
243
 
243
     routerGoTo(goTo) {
244
     routerGoTo(goTo) {
244
-      this.$emit('routerGoTo', goTo);
245
-    },
246
-  },
245
+      this.$emit("routerGoTo", goTo);
246
+    }
247
+  }
247
 };
248
 };
248
 </script>
249
 </script>
249
 <style scoped>
250
 <style scoped>

+ 6
- 0
src/router/index.js View File

52
 import CarouselDetail from "../components/admin/misc/carousel.vue";
52
 import CarouselDetail from "../components/admin/misc/carousel.vue";
53
 import AlertPage from "../components/shared/alertPage.vue";
53
 import AlertPage from "../components/shared/alertPage.vue";
54
 import PropertySearchResults from "../components/property/propertySearchResults.vue";
54
 import PropertySearchResults from "../components/property/propertySearchResults.vue";
55
+import Payments from "../components/financial/payments.vue";
55
 
56
 
56
 Vue.use(Router);
57
 Vue.use(Router);
57
 
58
 
291
       path: "/property/propertySearch/results",
292
       path: "/property/propertySearch/results",
292
       name: "PropertySearchResults",
293
       name: "PropertySearchResults",
293
       component: PropertySearchResults
294
       component: PropertySearchResults
295
+    },
296
+    {
297
+      path: "/payments",
298
+      name: "Payments",
299
+      component: Payments
294
     }
300
     }
295
   ]
301
   ]
296
 });
302
 });

+ 32
- 30
src/store/index.js View File

1
-import Vue from 'vue';
2
-import Vuex from 'vuex';
1
+import Vue from "vue";
2
+import Vuex from "vuex";
3
 
3
 
4
-import TimeshareModule from './modules/timeshare/timeshare';
5
-import UsersModule from './modules/users';
6
-import StatusModule from './modules/timeshare/status';
7
-import UnitConfigurationModule from './modules/timeshare/unitConfiguration';
8
-import RegionModule from './modules/timeshare/region';
9
-import SearchTabModule from './modules/searchTab';
10
-import ResortModule from './modules/timeshare/resort';
11
-import PropertyModule from './modules/property/property';
12
-import WeekModule from './modules/timeshare/week';
13
-import PropertyAdminModule from './modules/property/propertyAdmin';
14
-import PropertyList from './modules/property/propertyLists';
15
-import PropertyTypes from './modules/property/propertyTypes';
16
-import Register from './modules/user/register';
17
-import WeekList from './modules/timeshare/weekList';
18
-import MyWeeks from './modules/timeshare/myWeeks';
19
-import Bid from './modules/processFlow/bid';
20
-import Authentication from './modules/user/authentication';
21
-import PropertySearch from './modules/property/propertySearch';
22
-import SearchLog from './modules/logs/searchLog';
23
-import Template from './modules/communication/template';
24
-import Info from './modules/communication/info';
25
-import PropertyEdit from './modules/property/propertyEdit';
26
-import Carousel from './modules/misc/carousel';
27
-import Individual from './modules/user/individual';
28
-import Alert from './modules/misc/alert';
29
-import TenderWeek from './modules/timeshare/tenderWeeks';
4
+import TimeshareModule from "./modules/timeshare/timeshare";
5
+import UsersModule from "./modules/users";
6
+import StatusModule from "./modules/timeshare/status";
7
+import UnitConfigurationModule from "./modules/timeshare/unitConfiguration";
8
+import RegionModule from "./modules/timeshare/region";
9
+import SearchTabModule from "./modules/searchTab";
10
+import ResortModule from "./modules/timeshare/resort";
11
+import PropertyModule from "./modules/property/property";
12
+import WeekModule from "./modules/timeshare/week";
13
+import PropertyAdminModule from "./modules/property/propertyAdmin";
14
+import PropertyList from "./modules/property/propertyLists";
15
+import PropertyTypes from "./modules/property/propertyTypes";
16
+import Register from "./modules/user/register";
17
+import WeekList from "./modules/timeshare/weekList";
18
+import MyWeeks from "./modules/timeshare/myWeeks";
19
+import Bid from "./modules/processFlow/bid";
20
+import Authentication from "./modules/user/authentication";
21
+import PropertySearch from "./modules/property/propertySearch";
22
+import SearchLog from "./modules/logs/searchLog";
23
+import Template from "./modules/communication/template";
24
+import Info from "./modules/communication/info";
25
+import PropertyEdit from "./modules/property/propertyEdit";
26
+import Carousel from "./modules/misc/carousel";
27
+import Individual from "./modules/user/individual";
28
+import Alert from "./modules/misc/alert";
29
+import TenderWeek from "./modules/timeshare/tenderWeeks";
30
+import PaymentModule from "./modules/financial/payment";
30
 
31
 
31
 Vue.use(Vuex);
32
 Vue.use(Vuex);
32
 /* eslint no-param-reassign: ["error", { "props": false }] */
33
 /* eslint no-param-reassign: ["error", { "props": false }] */
57
     carousel: Carousel,
58
     carousel: Carousel,
58
     individual: Individual,
59
     individual: Individual,
59
     alert: Alert,
60
     alert: Alert,
60
-    tenderWeek: TenderWeek
61
-  },
61
+    tenderWeek: TenderWeek,
62
+    payment: PaymentModule
63
+  }
62
 });
64
 });

+ 32
- 0
src/store/modules/financial/payment.js View File

1
+import axios from "axios";
2
+
3
+export default {
4
+  amespaced: true,
5
+  state: {
6
+    payments: [],
7
+    payment: {}
8
+  },
9
+  mutations: {
10
+    setPayment(state, item) {
11
+      state.payment = item;
12
+    },
13
+    setPayments(state, items) {
14
+      state.payments = items;
15
+    }
16
+  },
17
+  getters: {},
18
+  actions: {
19
+    getPayment({ commit }, id) {
20
+      axios
21
+        .get(`/api/payment/${id}`)
22
+        .then(result => commit("setPayment", result.data))
23
+        .catch(console.error);
24
+    },
25
+    getPayments({ commit }) {
26
+      axios
27
+        .get("/api/payment")
28
+        .then(result => commit("setPayments", result.data))
29
+        .catch(console.error);
30
+    }
31
+  }
32
+};

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

1
-import axios from 'axios';
1
+import axios from "axios";
2
 
2
 
3
 export default {
3
 export default {
4
   namespaced: true,
4
   namespaced: true,
5
   state: {
5
   state: {
6
     properties: [],
6
     properties: [],
7
+    propertiesLive: []
7
   },
8
   },
8
   mutations: {
9
   mutations: {
9
     setProperties(state, properties) {
10
     setProperties(state, properties) {
12
     removeProperties(state, id) {
13
     removeProperties(state, id) {
13
       state.properties.pop(state.properties.find(item => item.id === id));
14
       state.properties.pop(state.properties.find(item => item.id === id));
14
     },
15
     },
16
+    updatePropertyPublish(state, curItem) {
17
+      state.properties.find(item => item.id === curItem.id).publish = "Yes";
18
+    },
19
+    updatePropertyUnpublish(state, curItem) {
20
+      state.properties.find(item => item.id === curItem.id).publish = "No";
21
+    },
22
+    setLiveProperties(state, items) {
23
+      state.propertiesLive = items;
24
+    }
15
   },
25
   },
16
   getters: {},
26
   getters: {},
17
   actions: {
27
   actions: {
18
     getProperties({ commit }, item) {
28
     getProperties({ commit }, item) {
19
-      console.log(`/api/property/${item.propertyType}/${item.user}`);
29
+      console.log(`/api/property/GetPropertyList/${item}`);
30
+      axios
31
+        .get(`/api/property/GetPropertyList/${item}`) // .get(`/api/property/${item.propertyType}/${item.user}`)
32
+        .then(result => commit("setProperties", result.data))
33
+        .catch(console.error);
34
+    },
35
+    getLiveProperties({ commit }) {
20
       axios
36
       axios
21
-        .get(`/api/property/${item.propertyType}/${item.user}`) // .get(`/api/property/${item.propertyType}/${item.user}`)
22
-        .then(result => commit('setProperties', result.data))
37
+        .get("/api/property/GetLivePropertyList") // .get(`/api/property/${item.propertyType}/${item.user}`)
38
+        .then(result => commit("setLiveProperties", result.data))
23
         .catch(console.error);
39
         .catch(console.error);
24
     },
40
     },
25
     deleteProperty({ commit }, id) {
41
     deleteProperty({ commit }, id) {
26
       axios
42
       axios
27
         .delete(`/api/property/${id}`)
43
         .delete(`/api/property/${id}`)
28
-        .then(commit('removeProperties', id))
44
+        .then(commit("removeProperties", id))
29
         .catch(console.error);
45
         .catch(console.error);
30
     },
46
     },
31
-  },
47
+    publishProperty({ commit }, item) {
48
+      axios
49
+        .put("/api/property/publishproperty", item)
50
+        .then(result => commit("updatePropertyPublish", item))
51
+        .catch(console.error);
52
+    },
53
+    unpublishProperty({ commit }, item) {
54
+      axios
55
+        .put("/api/property/unpublishproperty", item)
56
+        .then(result => commit("updatePropertyUnpublish", item))
57
+        .catch(console.error);
58
+    }
59
+  }
32
 };
60
 };

Loading…
Cancel
Save