LeneS 5 jaren geleden
bovenliggende
commit
d25ad48d30

+ 72
- 33
src/components/processFlow/makeOffer.vue Bestand weergeven

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
   <!-- eslint-disable max-len -->
3 3
   <div style="padding-left:50px; padding-right:50px; padding-bottom:50px;">
4
-    <div>
4
+    <div v-if="!isSaved">
5 5
       <br />
6 6
       <div v-if="isProperty">
7 7
         <div class="form-group row">
@@ -21,7 +21,7 @@
21 21
         <div class="form-group row">
22 22
           <div class="col-md-6 col-lg-5 section-md-t3">
23 23
             <div class="title-box-d">
24
-              <h3 class="title-d">{{ item.resort }}</h3>
24
+              <h3 class="title-d">{{ item.resort.resortName }}</h3>
25 25
             </div>
26 26
           </div>
27 27
         </div>
@@ -40,7 +40,7 @@
40 40
                 id="resort"
41 41
                 name="resortunit"
42 42
                 disabled
43
-                v-model="item.unit"
43
+                v-model="item.unitNumber"
44 44
               />
45 45
             </div>
46 46
           </div>
@@ -58,7 +58,7 @@
58 58
                 id="week"
59 59
                 name="resortWeek"
60 60
                 disabled
61
-                v-model="item.module"
61
+                v-model="item.weekNumber"
62 62
               />
63 63
             </div>
64 64
           </div>
@@ -73,7 +73,7 @@
73 73
                 <b>R</b>
74 74
               </span>
75 75
             </div>
76
-            <input class="form-control" type="number" v-model="item.price" disabled />
76
+            <input class="form-control" type="number" v-model="item.sellPrice" disabled />
77 77
           </div>
78 78
         </div>
79 79
         <div class="col-md-6">
@@ -102,92 +102,131 @@
102 102
           <textarea
103 103
             class="form-control editor form-control-lg form-control-a"
104 104
             name="description"
105
-            v-model="item.comments"
105
+            v-model="item.comment"
106 106
             :disabled="!isMakeOffer"
107 107
           ></textarea>
108 108
         </div>
109 109
       </div>
110 110
     </div>
111
-    <div class="container">
111
+    <div v-if="!isSaved" class="container">
112 112
       <button
113 113
         v-if="isMakeOffer"
114 114
         type="button"
115 115
         @click="SendOffer()"
116 116
         class="btn btn-b-n"
117 117
         style="width: 150px; height:40px;"
118
-        data-dismiss="modal"
119 118
       >Send Offer</button>
120 119
       <button
121
-        v-if="!isMakeOffer && !isDecline"
120
+        v-if="!isMakeOffer && !isDecline && canEdit"
122 121
         type="submit"
123 122
         @click="Accept()"
124 123
         class="btn btn-b-n"
125 124
         style="width: 150px; height:40px;"
126
-        data-dismiss="modal"
127 125
       >Accept</button>
128 126
       <button
129
-        v-if="!isMakeOffer && !isDecline"
127
+        v-if="!isMakeOffer && !isDecline && canEdit"
130 128
         type="button"
131 129
         @click="Decline()"
132 130
         class="btn btn-b-n"
133 131
         style="width: 150px; height:40px;"
134 132
       >Decline</button>
135
-      <div v-if="isDecline" class="form-group row">
136
-        <div class="col-md-12">
137
-          <br />
138
-          <label>Decline Reason</label>
139
-          <textarea class="form-control editor form-control-lg form-control-a" name="description"></textarea>
140
-        </div>
133
+    </div>
134
+    <div v-if="isDecline || item.statusCode === 'E3'" class="form-group row">
135
+      <div class="col-md-12">
136
+        <br />
137
+        <label>Decline Reason</label>
138
+        <textarea
139
+          class="form-control editor form-control-lg form-control-a"
140
+          name="description"
141
+          v-model="item.declineReason"
142
+          :disabled="item.statusCode === 'E3'"
143
+        ></textarea>
144
+      </div>
145
+    </div>
146
+    <button
147
+      v-if="isDecline"
148
+      type="button"
149
+      @click="Complete()"
150
+      class="btn btn-b-n"
151
+      style="width: 150px; height:40px;"
152
+    >Complete</button>
153
+    <div v-if="isSaved">
154
+      <div class="form-group row">
155
+        <br />
156
+        <label>{{ message }}</label>
141 157
       </div>
142 158
       <button
143
-        v-if="isDecline"
159
+        v-if="isSaved"
144 160
         type="button"
145
-        @click="Complete()"
146 161
         class="btn btn-b-n"
147 162
         style="width: 150px; height:40px;"
148 163
         data-dismiss="modal"
149
-      >Complete</button>
164
+      >OK</button>
150 165
     </div>
151 166
   </div>
152 167
 </template>
153 168
 
154 169
 <script>
170
+import { mapState, mapActions } from 'vuex';
171
+
155 172
 export default {
156 173
   name: 'MakeOffer',
157 174
   props: {
158 175
     isMakeOffer: Boolean,
159 176
     isProperty: Boolean,
177
+    canEdit: Boolean,
160 178
     item: Object,
179
+    bidId: Number,
180
+    updateItem: Function,
161 181
   },
162 182
   data() {
163 183
     return {
164 184
       isDecline: false,
185
+      isSaved: false,
186
+      message: '',
165 187
     };
166 188
   },
167 189
   methods: {
190
+    ...mapActions('bid', ['getBid', 'saveBid', 'acceptBid', 'declineBid']),
168 191
     SendOffer() {
169
-      // Save Offer data
192
+      this.getBid(0);
193
+      this.bidItem.id = 0;
194
+      this.bidItem.amount = this.item.offer;
195
+      this.bidItem.comment = this.item.comment;
196
+      if (this.isProperty) {
197
+        this.bidItem.propertyId = this.item.id;
198
+      } else {
199
+        this.bidItem.timeshareWeekId = this.item.id;
200
+      }
201
+      this.saveBid(this.bidItem);
202
+
203
+      this.item = [];
204
+      this.isSaved = true;
205
+      this.message = 'Offer was submitted.';
170 206
     },
171 207
     Accept() {
172
-      // Accept Offer
208
+      this.acceptBid(this.item.id);
209
+      this.isSaved = true;
210
+      this.message = 'Offer Accepted.';
173 211
     },
174 212
     Decline() {
175 213
       this.isDecline = true;
176 214
     },
177 215
     Complete() {
178 216
       this.isDecline = false;
217
+
218
+      const decline = {
219
+        id: this.item.id,
220
+        comment: this.item.declineReason,
221
+      };
222
+
223
+      this.declineBid(decline);
224
+      this.isSaved = true;
225
+      this.message = 'Offer Declined.';
179 226
     },
180
-    Close() {},
227
+  },
228
+  computed: {
229
+    ...mapState('bid', ['bidItem']),
181 230
   },
182 231
 };
183 232
 </script>
184
-
185
-<style scoped>
186
-.myWell {
187
-  width: 100%;
188
-  background-color: rgba(217, 217, 217, 0.85);
189
-  border-radius: 6px;
190
-  padding: 5px;
191
-  margin: 3px;
192
-}
193
-</style>

+ 32
- 38
src/components/processFlow/offers.vue Bestand weergeven

@@ -20,14 +20,21 @@
20 20
           <tr>
21 21
             <th>Type</th>
22 22
             <th>Description</th>
23
+            <th>Status</th>
24
+            <th>Price</th>
25
+            <th>Offered Price</th>
26
+            <th>Offer By</th>
23 27
             <th></th>
24 28
           </tr>
25 29
         </thead>
26 30
         <tbody>
27
-          <tr v-for="(item, i) in items" :key="i">
28
-            <td v-if="item.isProperty">Property</td>
29
-            <td v-else>Timeshare</td>
30
-            <td>{{ item.uid }}</td>
31
+          <tr v-for="(item, i) in bidItems" :key="i">
32
+            <td>{{ item.type }}</td>
33
+            <td>{{ item.shortDescription }}</td>
34
+            <td>{{ item.status }}</td>
35
+            <td>R {{ formatPrice(item.price) }}</td>
36
+            <td>R {{ formatPrice(item.offer) }}</td>
37
+            <td>{{ item.madeBy }}</td>
31 38
             <td>
32 39
               <button
33 40
                 type="button"
@@ -46,7 +53,8 @@
46 53
                       <makeOffer
47 54
                         name="MakeOffer"
48 55
                         :isMakeOffer="false"
49
-                        :isProperty="item.isProperty"
56
+                        :isProperty="item.type === 'Property'"
57
+                        :canEdit="item.statusCode === 'E1'"
50 58
                         :item="item"
51 59
                       />
52 60
                     </div>
@@ -62,6 +70,7 @@
62 70
 </template>
63 71
 
64 72
 <script>
73
+import { mapState, mapActions } from 'vuex';
65 74
 import makeOffer from './makeOffer.vue';
66 75
 
67 76
 export default {
@@ -70,40 +79,25 @@ export default {
70 79
   data() {
71 80
     return {
72 81
       item: {},
73
-      items: [
74
-        {
75
-          isProperty: true,
76
-          uid: '1 - 2 Bedroom House',
77
-          id: 1,
78
-          shortDescription: '2 Bedroom House',
79
-          description: '<div><i>Property Description</i></div>',
80
-          price: 1000,
81
-          offer: 1500,
82
-          comments: 'Bla Bla Bla',
83
-        },
84
-        {
85
-          isProperty: false,
86
-          uid: 'NL N18 359',
87
-          id: 2,
88
-          shortDescription: '',
89
-          description: '',
90
-          price: 85000,
91
-          offer: 90000,
92
-          comments: 'I want to go....',
93
-          resort: 'Ngwenya Lodge',
94
-          unit: '359',
95
-          week: 'N18',
96
-          module: '359/N18 River View',
97
-        },
98
-      ],
99 82
     };
100 83
   },
101
-  //   methods: {
102
-  //     SetItem(data) {
103
-  //       this.item = data;
104
-  //       const element = this.$refs.modal.$el;
105
-  //       $(element).modal('show');
106
-  //     },
107
-  //   },
84
+  methods: {
85
+    ...mapActions('bid', ['getBids']),
86
+    // SetItem(data) {
87
+    //   this.item = data;
88
+    //   const element = this.$refs.modal.$el;
89
+    //   $(element).modal('show');
90
+    // },
91
+    formatPrice(value) {
92
+      const val = (value / 1).toFixed(2);
93
+      return val.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ' ');
94
+    },
95
+  },
96
+  computed: {
97
+    ...mapState('bid', ['bidItems']),
98
+  },
99
+  mounted() {
100
+    this.getBids();
101
+  },
108 102
 };
109 103
 </script>

+ 33
- 21
src/components/property/propertyPage.vue Bestand weergeven

@@ -1,17 +1,22 @@
1 1
 <template>
2 2
   <!-- eslint-disable max-len -->
3 3
   <div v-if="property">
4
-    <section class="intro-single">
5
-      <div class="container">
6
-        <div class="row">
7
-          <div class="col-md-12 col-lg-8">
8
-            <div class="title-single-box">
9
-              <h1 class="title-single">{{ property.shortDescription }}</h1>
10
-            </div>
4
+    <div class="container">
5
+      <br />
6
+      <br />
7
+      <br />
8
+      <br />
9
+      <div class="row">
10
+        <div class="col-md-12 col-lg-8">
11
+          <div class="title-box-d">
12
+            <h1
13
+              class="title-d"
14
+              style="text-align:left; font-size: 250%"
15
+            >{{ property.shortDescription }}</h1>
11 16
           </div>
12 17
         </div>
13 18
       </div>
14
-    </section>
19
+    </div>
15 20
     <!--/ Intro Single End /-->
16 21
 
17 22
     <!--/ property Single Star /-->
@@ -32,13 +37,17 @@
32 37
                 <div class="row">
33 38
                   <div class="col-sm-12">
34 39
                     <div class="title-box-d">
35
-                      <h3 class="title-d">Property Description</h3>
40
+                      <h3 class="title-d" style="text-align:left">Property Description</h3>
36 41
                     </div>
37 42
                   </div>
38 43
                 </div>
39
-                <div class="property-description" v-html="property.description" />
44
+                <div
45
+                  class="property-description"
46
+                  style="text-align:left"
47
+                  v-html="property.description"
48
+                />
40 49
                 <div v-for="display in property.displayData" :key="display.id">
41
-                  <div class="row section-t3">
50
+                  <div class="row section-t3" style="text-align:left">
42 51
                     <div class="col-sm-12">
43 52
                       <div class="title-box-d">
44 53
                         <h3 class="title-d">{{ display.groupName }}</h3>
@@ -57,21 +66,22 @@
57 66
               </div>
58 67
               <div class="col-md-5 col-lg-4">
59 68
                 <div class="property-price d-flex justify-content-center foo">
60
-                  <div class="card-header-c d-flex">
61
-                    <div class="card-box-ico">
62
-                      <span class="ion-money">R</span>
63
-                    </div>
69
+                  <!-- <div class="card-header-c d-flex"> -->
70
+                  <div style="width: 300px; height: 80px; border-style: solid; color: #60CBEB;">
71
+                    <!-- <span class="ion-money">R</span> -->
72
+
64 73
                     <div class="card-title-c align-self-center">
65
-                      <h5 class="title-c">{{ formatPrice(property.price) }}</h5>
74
+                      <h5 class="title-c">R{{ formatPrice(property.price) }}</h5>
66 75
                       <h6 v-if="property.pricePer">Per {{property.pricePer}}</h6>
67 76
                     </div>
68 77
                   </div>
78
+                  <!-- </div> -->
69 79
                 </div>
70 80
                 <div class="property-summary">
71 81
                   <div class="row">
72 82
                     <div class="col-sm-12">
73 83
                       <div class="title-box-d section-t4">
74
-                        <h3 class="title-d">Summary</h3>
84
+                        <h3 class="title-d" style="text-align:left">Summary</h3>
75 85
                       </div>
76 86
                     </div>
77 87
                   </div>
@@ -83,8 +93,9 @@
83 93
                       </li>
84 94
                       <li class="d-flex justify-content-between">
85 95
                         <strong>Status:</strong>
86
-                        <span v-if="property.isSale">Sale</span>
87
-                        <span v-else>Rental</span>
96
+                        <span
97
+                          v-if="property.status"
98
+                        >{{ property.status.code }} - {{ property.status.description }}</span>
88 99
                       </li>
89 100
                       <li class="d-flex justify-content-between">
90 101
                         <strong>Address:</strong>
@@ -126,7 +137,7 @@
126 137
                   <div class="row section-t3">
127 138
                     <div class="col-sm-12">
128 139
                       <div class="title-box-d">
129
-                        <h3 class="title-d">Contact Agent</h3>
140
+                        <h3 class="title-d" style="text-align:left">Contact Agent</h3>
130 141
                       </div>
131 142
                     </div>
132 143
                   </div>
@@ -235,10 +246,11 @@
235 246
                               </div>
236 247
                             </div>
237 248
                             <div class="col-md-12">
238
-                              <button type="submit" class="btn btn-a">Send Message</button>
249
+                              <button type="submit" class="btn btn-b-n">Send Message</button>
239 250
                             </div>
240 251
                           </div>
241 252
                         </form>
253
+                        <br />
242 254
                       </div>
243 255
                     </div>
244 256
                   </div>

+ 1
- 6
src/components/property/propertySearchPage.vue Bestand weergeven

@@ -55,12 +55,7 @@
55 55
         </div>
56 56
       </div>
57 57
       <div>
58
-        <propertyCard
59
-          v-if="properties.length > 0"
60
-          name="propertyholder"
61
-          :properties="properties"
62
-          :key="propertysearch"
63
-        />
58
+        <propertyCard v-if="properties.length > 0" name="propertyholder" :properties="properties" />
64 59
         <div v-if="properties.length === 0">
65 60
           <img src="../../../public/img/no-homes.gif" />
66 61
           <br />

+ 3
- 7
src/components/property/propertyeditPage.vue Bestand weergeven

@@ -22,7 +22,7 @@
22 22
       <div class="row">
23 23
         <div class="container col-md-10">
24 24
           <div class="title-box-d">
25
-            <h5 class="title-d">Property Overview</h5>
25
+            <h5 class="title-d" style="text-align:left">Property Overview</h5>
26 26
           </div>
27 27
         </div>
28 28
       </div>
@@ -276,12 +276,8 @@
276 276
               @click="SubmitData()"
277 277
               class="btn btn-b-n"
278 278
               style="width: 85px; height:40px;"
279
-            >
280
-              <!-- <span class="spinner-border" role="status" aria-hidden="true"></span>
281
-              <span class="sr-only">Loading...</span>-->
282
-              Save
283
-            </button>
284
-            <label v-if="wait">Please wait...</label>
279
+            >Save</button>
280
+            <div v-if="wait" id="preloader"></div>
285 281
           </form>
286 282
         </div>
287 283
       </div>

+ 1
- 1
src/components/shared/searchTab.vue Bestand weergeven

@@ -101,7 +101,7 @@
101 101
           </div>
102 102
           {{selectedPropertyType}}
103 103
           <div class="col-md-12">
104
-            <button type="submit" class="btn btn-b" @click="Search">Search</button>
104
+            <button type="submit" class="btn btn-b-n" @click="Search">Search</button>
105 105
           </div>
106 106
         </div>
107 107
       </form>

+ 34
- 8
src/components/timeshare/buy/weekListComponent.vue Bestand weergeven

@@ -1,15 +1,12 @@
1 1
 <template>
2 2
   <div>
3
-    <button @click="addDummyWeek" class="btn btn-primary">Add Dummy</button>
4 3
     <table class="table table-bordered">
5 4
       <thead>
6 5
         <tr>
7 6
           <th>Resort</th>
8 7
           <th>Unit Number</th>
9 8
           <th>Week Number</th>
10
-          <th>Module</th>
11 9
           <th>Bedrooms</th>
12
-          <th>Season</th>
13 10
           <th>Price</th>
14 11
           <th>Status</th>
15 12
           <th>Interested</th>
@@ -20,12 +17,37 @@
20 17
           <td>{{item.resort.resortName}}</td>
21 18
           <td>{{item.unitNumber}}</td>
22 19
           <td>{{item.weekNumber}}</td>
23
-          <td>{{item.module}}</td>
24 20
           <td>{{item.bedrooms}}</td>
25
-          <td>{{item.season}}</td>
26
-          <td>{{item.sellPrice}}</td>
21
+          <td>{{item.sellPrice | toCurrency}}</td>
27 22
           <td>{{item.status ? item.status.description : ''}}</td>
28
-          <td></td>
23
+          <td>
24
+            <div class="col-md-12">
25
+              <button
26
+                type="button"
27
+                class="btn btn-b-n"
28
+                data-toggle="modal"
29
+                data-target="#myModal"
30
+              >Make an Offer</button>
31
+              <div id="myModal" class="modal fade" role="dialog">
32
+                <div class="modal-dialog modal-lg">
33
+                  <!-- Modal content-->
34
+                  <div class="modal-content">
35
+                    <div class="modal-header">
36
+                      <button type="button" class="close" data-dismiss="modal">&times;</button>
37
+                    </div>
38
+                    <div padding-left="20px">
39
+                      <makeOffer
40
+                        name="MakeOffer"
41
+                        :isMakeOffer="true"
42
+                        :isProperty="false"
43
+                        :item="item"
44
+                      />
45
+                    </div>
46
+                  </div>
47
+                </div>
48
+              </div>
49
+            </div>
50
+          </td>
29 51
         </tr>
30 52
       </tbody>
31 53
     </table>
@@ -33,8 +55,12 @@
33 55
 </template>
34 56
 <script>
35 57
 import { mapState, mapActions, mapGetters } from 'vuex';
58
+import makeOffer from '../../processFlow/makeOffer.vue';
36 59
 
37 60
 export default {
61
+  components: {
62
+    makeOffer,
63
+  },
38 64
   computed: {
39 65
     ...mapState('weekList', ['weeks']),
40 66
     ...mapGetters({
@@ -42,7 +68,7 @@ export default {
42 68
     }),
43 69
   },
44 70
   mounted() {
45
-    this.addDummyWeek();
71
+    this.getWeeks();
46 72
   },
47 73
   methods: {
48 74
     ...mapActions('weekList', ['getWeeks', 'addDummyWeek']),

+ 0
- 1
src/components/timeshare/buy/weekListPage.vue Bestand weergeven

@@ -7,7 +7,6 @@
7 7
     <br />
8 8
     <br />
9 9
     <br />
10
-    {{filter}}
11 10
     <WeekListComponent />
12 11
   </div>
13 12
 </template>

+ 8
- 4
src/components/timeshare/resort/resortPage.vue Bestand weergeven

@@ -1,11 +1,15 @@
1 1
 <template>
2 2
   <!-- eslint-disable max-len -->
3 3
   <section>
4
-    <div class="container intro-single">
4
+    <div class="container">
5
+      <br />
6
+      <br />
7
+      <br />
8
+      <br />
5 9
       <div class="row">
6 10
         <div class="col-md-12 col-lg-8">
7
-          <div class="title-single-box">
8
-            <h1 class="title-single" style="text-align:left;">{{resort.prName}}</h1>
11
+          <div class="title-box-d">
12
+            <h1 class="title-d" style="text-align:left; font-size: 250%">{{resort.prName}}</h1>
9 13
           </div>
10 14
           <br />
11 15
         </div>
@@ -25,7 +29,7 @@
25 29
     <div class="myMargin">
26 30
       <div class="row">
27 31
         <div class="col-md-3">
28
-          <h3>Filter Resort</h3>
32
+          <h4>Filter Resort</h4>
29 33
           <form
30 34
             id="mainForm"
31 35
             method="POST"

+ 10
- 10
src/components/timeshare/resort/unitPage.vue Bestand weergeven

@@ -5,11 +5,10 @@
5 5
     <br />
6 6
     <br />
7 7
     <br />
8
-    <br />
9 8
     <div class="row">
10 9
       <div class="col-md-12 col-lg-8">
11 10
         <div class="title-box-d">
12
-          <h1 class="title-d" style="text-align:left;">{{resort.prName}}</h1>
11
+          <h1 class="title-d" style="text-align:left; font-size: 250%">{{resort.prName}}</h1>
13 12
         </div>
14 13
         <br />
15 14
       </div>
@@ -111,15 +110,16 @@
111 110
               </div>
112 111
               <div class="col-md-6">
113 112
                 <label for="price">Price</label>
114
-                <div class="property-price d-flex justify-content-center foo">
115
-                  <div class="card-header-c d-flex">
116
-                    <div class="card-box-ico">
117
-                      <span class="ion-money">R</span>
118
-                    </div>
119
-                    <div class="card-title-c align-self-center">
120
-                      <h5 class="title-c">{{ formatPrice(week.price) }}</h5>
121
-                    </div>
113
+                <div class="property-price d-flex">
114
+                  <!-- <div class="card-header-c d-flex"> -->
115
+                  <div style="width: 260px; height: 70px; border-style: solid; color: #60CBEB;">
116
+                    <!-- <div class="card-title-c align-self-center"> -->
117
+                    <a class="justify-content-center" style="color: black; font-size: 250%">
118
+                      <b>R{{ formatPrice(week.price) }}</b>
119
+                    </a>
120
+                    <!-- </div> -->
122 121
                   </div>
122
+                  <!-- </div> -->
123 123
                 </div>
124 124
               </div>
125 125
             </div>

+ 76
- 18
src/components/timeshare/searchTimeshare.vue Bestand weergeven

@@ -7,29 +7,76 @@
7 7
       accept-charset="UTF-8"
8 8
       enctype="multipart/form-data"
9 9
     >
10
-      {{filter}}
11 10
       <div class="form-group text-left">
12
-        <label>Region</label>
13
-        <select class="form-control" name="region" id="region" v-model="filter.region">
14
-          <option v-for="(item, i) in regions" :key="i" :value="item">{{item.regionName}}</option>
15
-        </select>
11
+        <label>Province</label>
12
+        <div class="input-group mb-3">
13
+          <div class="input-group-prepend">
14
+            <span class="input-group-text" style="color: #60CBEB">
15
+              <b>P</b>
16
+            </span>
17
+          </div>
18
+          <select class="form-control" name="region" id="region" v-model="filter.region">
19
+            <option v-for="(item, i) in regions" :key="i" :value="item">{{item.regionName}}</option>
20
+          </select>
21
+          <div class="input-group-append" @click="clearFilter('region')">
22
+            <span class="input-group-text cursor-pointer" style="color: #60CBEB">
23
+              <b>X</b>
24
+            </span>
25
+          </div>
26
+        </div>
16 27
       </div>
17 28
       <div class="form-group text-left">
18 29
         <label>Resort Name</label>
19
-        <select class="form-control" name="resort" id="resort" v-model="filter.resort">
20
-          <option v-for="(item, i) in filteredResorts" :key="i" :value="item">{{item.resortName}}</option>
21
-        </select>
30
+        <div class="input-group mb-3">
31
+          <div class="input-group-prepend">
32
+            <span class="input-group-text" style="color: #60CBEB">
33
+              <b>RN</b>
34
+            </span>
35
+          </div>
36
+          <select class="form-control" name="resort" id="resort" v-model="filter.resort">
37
+            <option v-for="(item, i) in filteredResorts" :key="i" :value="item">{{item.resortName}}</option>
38
+          </select>
39
+          <div class="input-group-append" @click="clearFilter('resort')">
40
+            <span class="input-group-text cursor-pointer" style="color: #60CBEB">
41
+              <b>X</b>
42
+            </span>
43
+          </div>
44
+        </div>
22 45
       </div>
23 46
       <div class="form-group text-left">
24 47
         <label>Bedrooms</label>
25
-        <select class="form-control" name="bedrooms" v-model="filter.bedrooms">
26
-          <option v-for="(item, i) in resortBedrooms" :key="i">{{item}}</option>
27
-        </select>
48
+        <div class="input-group mb-3">
49
+          <div class="input-group-prepend">
50
+            <span class="input-group-text" style="color: #60CBEB">
51
+              <b>Bed</b>
52
+            </span>
53
+          </div>
54
+          <select class="form-control" name="bedrooms" v-model="filter.bedrooms">
55
+            <option v-for="(item, i) in resortBedrooms" :key="i">{{item}}</option>
56
+          </select>
57
+          <div class="input-group-append" @click="clearFilter('bedrooms')">
58
+            <span class="input-group-text cursor-pointer" style="color: #60CBEB">
59
+              <b>X</b>
60
+            </span>
61
+          </div>
62
+        </div>
28 63
       </div>
29 64
       <hr />
30 65
       <div class="form-group text-left">
31 66
         <label>Date</label>
32
-        <input type="date" class="form-control" name="arrivaldate" v-model="filter.date" />
67
+        <div class="input-group mb-3">
68
+          <div class="input-group-prepend">
69
+            <span class="input-group-text" style="color: #60CBEB">
70
+              <b>D</b>
71
+            </span>
72
+          </div>
73
+          <input type="date" class="form-control" name="arrivaldate" v-model="filter.date" />
74
+          <div class="input-group-append" @click="clearFilter('date')">
75
+            <span class="input-group-text cursor-pointer" style="color: #60CBEB">
76
+              <b>X</b>
77
+            </span>
78
+          </div>
79
+        </div>
33 80
       </div>
34 81
       <hr />
35 82
       <div class="form-group">
@@ -38,7 +85,9 @@
38 85
             <label>Minimum Price</label>
39 86
             <div class="input-group mb-3">
40 87
               <div class="input-group-prepend">
41
-                <span class="input-group-text">R</span>
88
+                <span class="input-group-text" style="color: #60CBEB">
89
+                  <b>R</b>
90
+                </span>
42 91
               </div>
43 92
               <input
44 93
                 class="form-control"
@@ -49,13 +98,20 @@
49 98
                 placeholder="Minimum Price"
50 99
                 v-model="filter.minPrice"
51 100
               />
101
+              <div class="input-group-append" @click="clearFilter('minPrice')">
102
+                <span class="input-group-text cursor-pointer" style="color: #60CBEB">
103
+                  <b>X</b>
104
+                </span>
105
+              </div>
52 106
             </div>
53 107
           </div>
54 108
           <div class="col-md-6 text-left">
55 109
             <label>Maximum Price</label>
56 110
             <div class="input-group mb-3">
57 111
               <div class="input-group-prepend">
58
-                <span class="input-group-text">R</span>
112
+                <span class="input-group-text" style="color: #60CBEB">
113
+                  <b>R</b>
114
+                </span>
59 115
               </div>
60 116
               <input
61 117
                 class="form-control"
@@ -66,11 +122,15 @@
66 122
                 placeholder="Maximum Price"
67 123
                 v-model="filter.maxPrice"
68 124
               />
125
+              <div class="input-group-append" @click="clearFilter('maxPrice')">
126
+                <span class="input-group-text cursor-pointer" style="color: #60CBEB">
127
+                  <b>X</b>
128
+                </span>
129
+              </div>
69 130
             </div>
70 131
           </div>
71 132
         </div>
72 133
       </div>
73
-      {{filter}}
74 134
     </form>
75 135
   </div>
76 136
 </template>
@@ -80,9 +140,6 @@ import { mapState, mapActions } from 'vuex';
80 140
 import _ from 'lodash';
81 141
 
82 142
 export default {
83
-  props: {
84
-    filter: undefined,
85
-  },
86 143
   created() {
87 144
     this.initTimeshare();
88 145
   },
@@ -108,6 +165,7 @@ export default {
108 165
   },
109 166
   methods: {
110 167
     ...mapActions('timeshare', ['initTimeshare']),
168
+    ...mapActions('weekList', ['clearFilter']),
111 169
   },
112 170
 };
113 171
 </script>

+ 10
- 0
src/main.js Bestand weergeven

@@ -8,6 +8,16 @@ Vue.use(EvaIcons);
8 8
 
9 9
 Vue.config.productionTip = false;
10 10
 
11
+Vue.filter('toCurrency', (value) => {
12
+  if (typeof value !== 'number') {
13
+    return value;
14
+  }
15
+  const formatter = new Intl.NumberFormat('en-US', {
16
+    minimumFractionDigits: 2,
17
+  });
18
+  return `R ${formatter.format(value)}`;
19
+});
20
+
11 21
 new Vue({
12 22
   render: h => h(App),
13 23
   router,

+ 2
- 0
src/store/index.js Bestand weergeven

@@ -15,6 +15,7 @@ import PropertyList from './modules/property/propertyLists';
15 15
 import PropertyTypes from './modules/property/propertyTypes';
16 16
 import Register from './modules/user/register';
17 17
 import WeekList from './modules/timeshare/weekList';
18
+import Bid from './modules/processFlow/bid';
18 19
 
19 20
 Vue.use(Vuex);
20 21
 /* eslint no-param-reassign: ["error", { "props": false }] */
@@ -35,5 +36,6 @@ export default new Vuex.Store({
35 36
     registerIndividual: Register,
36 37
     registerAgency: Register,
37 38
     weekList: WeekList,
39
+    bid: Bid,
38 40
   },
39 41
 });

+ 63
- 0
src/store/modules/processFlow/bid.js Bestand weergeven

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

+ 11
- 2
src/store/modules/timeshare/weekList.js Bestand weergeven

@@ -17,6 +17,9 @@ export default {
17 17
     },
18 18
   },
19 19
   mutations: {
20
+    onClearFilter(state, filter) {
21
+      state.filter[filter] = undefined;
22
+    },
20 23
     setWeeks(state, weeks) {
21 24
       state.weeks = weeks;
22 25
     },
@@ -30,13 +33,14 @@ export default {
30 33
       const {
31 34
         filter,
32 35
       } = state;
36
+      console.log(JSON.stringify(weekList));
33 37
       if (filter) {
34 38
         if (filter.region) {
35 39
           weekList = _.filter(weekList, x => x.region
36 40
             && x.region.regionCode === filter.region.regionCode);
37 41
         }
38 42
         if (filter.resort) {
39
-          weekList = _.filter(weekList, x => x.resort
43
+          weekList = _.filter(weekList, x => x.resort.resortCode
40 44
             && x.resort.resortCode === filter.resort.resortCode);
41 45
         }
42 46
         if (filter.bedrooms) {
@@ -72,9 +76,14 @@ export default {
72 76
     }) {
73 77
       axios
74 78
         .get('/api/timeshareweek')
75
-        .then(result => commit('setStatusList', result.data))
79
+        .then(result => commit('setWeeks', result.data))
76 80
         .catch(console.error);
77 81
     },
82
+    clearFilter({
83
+      commit,
84
+    }, filter) {
85
+      commit('onClearFilter', filter);
86
+    },
78 87
     addDummyWeek({
79 88
       commit,
80 89
     }) {

Laden…
Annuleren
Opslaan