Bläddra i källkod

Bid, prop publish & Pay

master
George Williams 5 år sedan
förälder
incheckning
1bf9b88aab

+ 1879
- 1451
package-lock.json
Filskillnaden har hållits tillbaka eftersom den är för stor
Visa fil


+ 18
- 18
package.json Visa fil

@@ -9,40 +9,40 @@
9 9
     "lint": "vue-cli-service lint"
10 10
   },
11 11
   "dependencies": {
12
-    "@nuxtjs/axios": "^5.6.0",
12
+    "@nuxtjs/axios": "^5.9.3",
13 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 17
     "jquery": "^3.4.1",
18 18
     "lodash": "^4.17.15",
19 19
     "material-design-icons-iconfont": "^3.0.3",
20 20
     "moment": "^2.24.0",
21
-    "node-sass": "^4.12.0",
21
+    "node-sass": "^4.13.1",
22 22
     "roboto-fontface": "*",
23 23
     "sass-loader": "^7.3.1",
24 24
     "stylus-loader": "^3.0.2",
25 25
     "v-file-upload": "^3.1.7",
26
-    "vue": "^2.6.10",
26
+    "vue": "^2.6.11",
27 27
     "vue-carousel": "^0.18.0",
28 28
     "vue-eva-icons": "^1.1.1",
29 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 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 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 43
     "eslint": "^5.16.0",
44
-    "eslint-plugin-vue": "^5.0.0",
44
+    "eslint-plugin-vue": "^5.2.3",
45 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 Visa fil

@@ -18,7 +18,7 @@
18 18
               :showNew="false"
19 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 22
           </div>
23 23
         </div>
24 24
       </div>
@@ -50,46 +50,30 @@ export default {
50 50
     if (this.name === "Timeshare") {
51 51
       this.getItems(this.user.id);
52 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 56
   computed: {
65 57
     ...mapState("myWeeks", ["items"]),
66
-    ...mapState("propertyList", ["properties"]),
58
+    ...mapState("propertyList", ["propertiesLive"]),
67 59
     // eslint-disable-next-line vue/return-in-computed-property
68 60
     nameChanged() {
69 61
       if (this.name === "Timeshare") {
70 62
         this.getItems(this.user.id);
71 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 68
   methods: {
85 69
     ...mapActions("myWeeks", ["getItems"]),
86
-    ...mapActions("propertyList", ["getProperties"]),
70
+    ...mapActions("propertyList", ["getLiveProperties"]),
87 71
     onRowClick(item) {
88 72
       if (this.name === "Timeshare") {
89 73
         const week = this.items[item];
90 74
         this.$emit("onSelected", week);
91 75
       } else {
92
-        const prop = this.properties[item];
76
+        const prop = this.propertiesLive[item];
93 77
         this.$emit("onSelected", prop);
94 78
       }
95 79
     }

+ 3
- 0
src/components/financial/makePayment.vue Visa fil

@@ -0,0 +1,3 @@
1
+<template>
2
+  <h1>Payment Page</h1>
3
+</template>

+ 60
- 0
src/components/financial/payments.vue Visa fil

@@ -0,0 +1,60 @@
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 Visa fil

@@ -1,194 +1,210 @@
1 1
 <template>
2 2
   <!-- eslint-disable max-len -->
3 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 26
             </div>
12 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 32
           </div>
18 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 80
             </div>
28 81
           </div>
29 82
         </div>
30 83
         <div class="form-group row">
31 84
           <div class="col-md-6">
32
-            <label for="resortunit">Unit</label>
85
+            <label>Current Price</label>
33 86
             <div class="input-group mb-3">
34 87
               <div class="input-group-prepend">
35 88
                 <span class="input-group-text" style="color: #60CBEB">
36
-                  <b>U#</b>
89
+                  <b>R</b>
37 90
                 </span>
38 91
               </div>
39 92
               <input
93
+                v-if="isProperty"
40 94
                 class="form-control"
41
-                type="text"
42
-                id="resort"
43
-                name="resortunit"
95
+                type="number"
96
+                v-model="item.price"
44 97
                 disabled
45
-                v-model="item.unitNumber"
46 98
               />
99
+              <input v-else class="form-control" type="number" v-model="item.sellPrice" disabled />
47 100
             </div>
48 101
           </div>
49 102
           <div class="col-md-6">
50
-            <label for="resortWeek">Module / Week Number</label>
103
+            <label>Offer</label>
51 104
             <div class="input-group mb-3">
52 105
               <div class="input-group-prepend">
53 106
                 <span class="input-group-text" style="color: #60CBEB">
54
-                  <b>M</b>
107
+                  <b>R</b>
55 108
                 </span>
56 109
               </div>
57 110
               <input
58 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 119
             </div>
66 120
           </div>
67 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 129
               :disabled="!isMakeOffer"
104
-            />
130
+            ></textarea>
105 131
           </div>
106 132
         </div>
107 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 164
         <div class="col-md-12">
110
-          <label>Comments</label>
165
+          <br />
166
+          <label>Decline Reason</label>
111 167
           <textarea
112 168
             class="form-control editor form-control-lg form-control-a"
113 169
             name="description"
114
-            v-model="item.comment"
115
-            :disabled="!isMakeOffer"
170
+            v-model="item.declineReason"
171
+            :disabled="item.statusCode === 'E3'"
116 172
           ></textarea>
117 173
         </div>
118 174
       </div>
119
-    </div>
120
-    <div v-if="!isSaved" class="container">
121 175
       <button
122
-        v-if="isMakeOffer"
176
+        v-if="isDecline"
123 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 179
         class="btn btn-b-n"
135 180
         style="width: 150px; height:40px;"
136 181
       >
137
-        Accept
182
+        Complete
138 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 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 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 201
     </div>
187 202
   </div>
188 203
 </template>
189 204
 
190 205
 <script>
191 206
 import { mapState, mapActions } from "vuex";
207
+import Log from "../../assets/Log";
192 208
 
193 209
 export default {
194 210
   name: "MakeOffer",
@@ -198,7 +214,8 @@ export default {
198 214
     canEdit: Boolean,
199 215
     item: Object,
200 216
     bidId: Number,
201
-    updateItem: Function
217
+    updateItem: Function,
218
+    isLoggedIn: Log.isLoggedIn()
202 219
   },
203 220
   data() {
204 221
     return {

+ 29
- 39
src/components/property/propertyCreate.vue Visa fil

@@ -29,6 +29,16 @@
29 29
         <div class="container col-md-10">
30 30
           <p class="alert myError">Please Login to add a property</p>
31 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 42
       </div>
33 43
       <div class="row" v-if="mayEdit">
34 44
         <div class="container col-md-10">
@@ -77,9 +87,7 @@
77 87
                   >
78 88
                     <option value="0">Please select type</option>
79 89
                     <option v-for="item in propertyTypes" :value="item.id" :key="item.id">
80
-                      {{
81
-                      item.description
82
-                      }}
90
+                      {{ item.description }}
83 91
                     </option>
84 92
                   </select>
85 93
                 </div>
@@ -163,9 +171,7 @@
163 171
                   >
164 172
                     <option value="0">Please select province</option>
165 173
                     <option v-for="province in provinces" :value="province.id" :key="province.id">
166
-                      {{
167
-                      province.description
168
-                      }}
174
+                      {{ province.description }}
169 175
                     </option>
170 176
                   </select>
171 177
                 </div>
@@ -189,9 +195,7 @@
189 195
                   >
190 196
                     <option value="0">Please select city</option>
191 197
                     <option v-for="city in cities" :value="city.id" :key="city.id">
192
-                      {{
193
-                      city.description
194
-                      }}
198
+                      {{ city.description }}
195 199
                     </option>
196 200
                   </select>
197 201
                 </div>
@@ -214,9 +218,7 @@
214 218
                   >
215 219
                     <option value="0">Please select suburb</option>
216 220
                     <option v-for="suburb in suburbs" :value="suburb.id" :key="suburb.id">
217
-                      {{
218
-                      suburb.description
219
-                      }}
221
+                      {{ suburb.description }}
220 222
                     </option>
221 223
                   </select>
222 224
                 </div>
@@ -380,13 +382,15 @@
380 382
               @click="SubmitData()"
381 383
               class="btn btn-b-n"
382 384
               style="width: 85px; height:40px;"
383
-            >Save</button>
385
+            >
386
+              Save
387
+            </button>
384 388
             <div
385 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 394
             </div>
391 395
             <div v-if="wait" id="preloader"></div>
392 396
           </form>
@@ -423,12 +427,7 @@ export default {
423 427
       customToolbar: [
424 428
         [{ header: [false, 1, 2, 3, 4, 5, 6] }],
425 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 431
         [{ list: "ordered" }, { list: "bullet" }, { list: "check" }],
433 432
         [{ script: "sub" }, { script: "super" }],
434 433
         [{ indent: "-1" }, { indent: "+1" }]
@@ -476,10 +475,7 @@ export default {
476 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 479
         this.showDateError = true;
484 480
       }
485 481
 
@@ -526,6 +522,9 @@ export default {
526 522
     Close() {
527 523
       this.$router.push("/property/admin/list/my");
528 524
     },
525
+    Login() {
526
+      this.$router.push("/user/login");
527
+    },
529 528
     PropertyTypeSelected(item) {
530 529
       if (item.target.options.selectedIndex > 0) {
531 530
         this.showPropertyTypeError = false;
@@ -535,9 +534,7 @@ export default {
535 534
     },
536 535
     ProvinceSelected(item) {
537 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 538
         this.getCities(Object.assign({}, { province: this.selectedProvince }));
542 539
         this.showProvinceError = false;
543 540
       } else {
@@ -546,14 +543,9 @@ export default {
546 543
     },
547 544
     CitySelected(item) {
548 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 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 550
         this.showCityError = false;
559 551
       } else {
@@ -561,9 +553,7 @@ export default {
561 553
       }
562 554
     },
563 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 557
       if (item.target.options.selectedIndex > 0) {
568 558
         this.showSuburbError = false;
569 559
       } else {

+ 27
- 30
src/components/property/propertyList.vue Visa fil

@@ -20,8 +20,14 @@
20 20
         :showNew="false"
21 21
         :editable="true"
22 22
         :deleteable="true"
23
+        :showCustomAction="true"
24
+        :CustomActionHeading="'Publish'"
25
+        :displayColumns="columns"
26
+        :displayFormats="formats"
27
+        :displayHeaders="headers"
23 28
         @onEdit="Edit"
24 29
         @onDelete="Delete"
30
+        @onCustomClick="Publish"
25 31
       />
26 32
     </div>
27 33
     <br />
@@ -42,11 +48,25 @@ export default {
42 48
     return {
43 49
       propertyType: "",
44 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 68
   methods: {
49
-    ...mapActions("propertyList", ["getProperties", "deleteProperty"]),
69
+    ...mapActions("propertyList", ["getProperties", "deleteProperty", "publishProperty"]),
50 70
     Edit(item) {
51 71
       const salesType = item.isSale ? "Sale" : "Rental";
52 72
       this.$router.push({
@@ -56,41 +76,18 @@ export default {
56 76
     },
57 77
     Delete(item) {
58 78
       this.deleteProperty(item.id);
79
+    },
80
+    Publish(item) {
81
+      this.publishProperty(item);
59 82
     }
60 83
   },
61 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 87
   computed: {
77 88
     ...mapState("propertyList", ["properties"]),
78 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 91
       return this.user;
95 92
     }
96 93
   },

+ 21
- 2
src/components/shared/listView.vue Visa fil

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

+ 14
- 13
src/components/shared/navBar.vue Visa fil

@@ -176,6 +176,7 @@
176 176
                   class="dropdown-item cursor-pointer"
177 177
                   @click="routerGoTo('/user/updateProfileInfo')"
178 178
                 >Update Info</a>
179
+                <a class="dropdown-item cursor-pointer" @click="routerGoTo('/payments')">Payments</a>
179 180
               </div>
180 181
             </li>
181 182
             <li class="nav-item dropdown" v-if="!isLoggedIn">
@@ -213,17 +214,17 @@
213 214
 </template>
214 215
 
215 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 220
 export default {
220 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 229
     isLoggedIn() {
229 230
       console.log(Log.isLoggedIn());
@@ -235,15 +236,15 @@ export default {
235 236
     // eslint-disable-next-line vue/return-in-computed-property
236 237
     Logout() {
237 238
       return this.logout();
238
-    },
239
+    }
239 240
   },
240 241
   methods: {
241
-    ...mapActions('authentication', ['logout']),
242
+    ...mapActions("authentication", ["logout"]),
242 243
 
243 244
     routerGoTo(goTo) {
244
-      this.$emit('routerGoTo', goTo);
245
-    },
246
-  },
245
+      this.$emit("routerGoTo", goTo);
246
+    }
247
+  }
247 248
 };
248 249
 </script>
249 250
 <style scoped>

+ 6
- 0
src/router/index.js Visa fil

@@ -52,6 +52,7 @@ import CarouselList from "../components/admin/misc/carouselList.vue";
52 52
 import CarouselDetail from "../components/admin/misc/carousel.vue";
53 53
 import AlertPage from "../components/shared/alertPage.vue";
54 54
 import PropertySearchResults from "../components/property/propertySearchResults.vue";
55
+import Payments from "../components/financial/payments.vue";
55 56
 
56 57
 Vue.use(Router);
57 58
 
@@ -291,6 +292,11 @@ export default new Router({
291 292
       path: "/property/propertySearch/results",
292 293
       name: "PropertySearchResults",
293 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 Visa fil

@@ -1,32 +1,33 @@
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 32
 Vue.use(Vuex);
32 33
 /* eslint no-param-reassign: ["error", { "props": false }] */
@@ -57,6 +58,7 @@ export default new Vuex.Store({
57 58
     carousel: Carousel,
58 59
     individual: Individual,
59 60
     alert: Alert,
60
-    tenderWeek: TenderWeek
61
-  },
61
+    tenderWeek: TenderWeek,
62
+    payment: PaymentModule
63
+  }
62 64
 });

+ 32
- 0
src/store/modules/financial/payment.js Visa fil

@@ -0,0 +1,32 @@
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 Visa fil

@@ -1,9 +1,10 @@
1
-import axios from 'axios';
1
+import axios from "axios";
2 2
 
3 3
 export default {
4 4
   namespaced: true,
5 5
   state: {
6 6
     properties: [],
7
+    propertiesLive: []
7 8
   },
8 9
   mutations: {
9 10
     setProperties(state, properties) {
@@ -12,21 +13,48 @@ export default {
12 13
     removeProperties(state, id) {
13 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 26
   getters: {},
17 27
   actions: {
18 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 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 39
         .catch(console.error);
24 40
     },
25 41
     deleteProperty({ commit }, id) {
26 42
       axios
27 43
         .delete(`/api/property/${id}`)
28
-        .then(commit('removeProperties', id))
44
+        .then(commit("removeProperties", id))
29 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
 };

Laddar…
Avbryt
Spara