LeneS 5 yıl önce
ebeveyn
işleme
d25ad48d30

+ 72
- 33
src/components/processFlow/makeOffer.vue Dosyayı Görüntüle

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>
4
+    <div v-if="!isSaved">
5
       <br />
5
       <br />
6
       <div v-if="isProperty">
6
       <div v-if="isProperty">
7
         <div class="form-group row">
7
         <div class="form-group row">
21
         <div class="form-group row">
21
         <div class="form-group row">
22
           <div class="col-md-6 col-lg-5 section-md-t3">
22
           <div class="col-md-6 col-lg-5 section-md-t3">
23
             <div class="title-box-d">
23
             <div class="title-box-d">
24
-              <h3 class="title-d">{{ item.resort }}</h3>
24
+              <h3 class="title-d">{{ item.resort.resortName }}</h3>
25
             </div>
25
             </div>
26
           </div>
26
           </div>
27
         </div>
27
         </div>
40
                 id="resort"
40
                 id="resort"
41
                 name="resortunit"
41
                 name="resortunit"
42
                 disabled
42
                 disabled
43
-                v-model="item.unit"
43
+                v-model="item.unitNumber"
44
               />
44
               />
45
             </div>
45
             </div>
46
           </div>
46
           </div>
58
                 id="week"
58
                 id="week"
59
                 name="resortWeek"
59
                 name="resortWeek"
60
                 disabled
60
                 disabled
61
-                v-model="item.module"
61
+                v-model="item.weekNumber"
62
               />
62
               />
63
             </div>
63
             </div>
64
           </div>
64
           </div>
73
                 <b>R</b>
73
                 <b>R</b>
74
               </span>
74
               </span>
75
             </div>
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
           </div>
77
           </div>
78
         </div>
78
         </div>
79
         <div class="col-md-6">
79
         <div class="col-md-6">
102
           <textarea
102
           <textarea
103
             class="form-control editor form-control-lg form-control-a"
103
             class="form-control editor form-control-lg form-control-a"
104
             name="description"
104
             name="description"
105
-            v-model="item.comments"
105
+            v-model="item.comment"
106
             :disabled="!isMakeOffer"
106
             :disabled="!isMakeOffer"
107
           ></textarea>
107
           ></textarea>
108
         </div>
108
         </div>
109
       </div>
109
       </div>
110
     </div>
110
     </div>
111
-    <div class="container">
111
+    <div v-if="!isSaved" class="container">
112
       <button
112
       <button
113
         v-if="isMakeOffer"
113
         v-if="isMakeOffer"
114
         type="button"
114
         type="button"
115
         @click="SendOffer()"
115
         @click="SendOffer()"
116
         class="btn btn-b-n"
116
         class="btn btn-b-n"
117
         style="width: 150px; height:40px;"
117
         style="width: 150px; height:40px;"
118
-        data-dismiss="modal"
119
       >Send Offer</button>
118
       >Send Offer</button>
120
       <button
119
       <button
121
-        v-if="!isMakeOffer && !isDecline"
120
+        v-if="!isMakeOffer && !isDecline && canEdit"
122
         type="submit"
121
         type="submit"
123
         @click="Accept()"
122
         @click="Accept()"
124
         class="btn btn-b-n"
123
         class="btn btn-b-n"
125
         style="width: 150px; height:40px;"
124
         style="width: 150px; height:40px;"
126
-        data-dismiss="modal"
127
       >Accept</button>
125
       >Accept</button>
128
       <button
126
       <button
129
-        v-if="!isMakeOffer && !isDecline"
127
+        v-if="!isMakeOffer && !isDecline && canEdit"
130
         type="button"
128
         type="button"
131
         @click="Decline()"
129
         @click="Decline()"
132
         class="btn btn-b-n"
130
         class="btn btn-b-n"
133
         style="width: 150px; height:40px;"
131
         style="width: 150px; height:40px;"
134
       >Decline</button>
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
       </div>
157
       </div>
142
       <button
158
       <button
143
-        v-if="isDecline"
159
+        v-if="isSaved"
144
         type="button"
160
         type="button"
145
-        @click="Complete()"
146
         class="btn btn-b-n"
161
         class="btn btn-b-n"
147
         style="width: 150px; height:40px;"
162
         style="width: 150px; height:40px;"
148
         data-dismiss="modal"
163
         data-dismiss="modal"
149
-      >Complete</button>
164
+      >OK</button>
150
     </div>
165
     </div>
151
   </div>
166
   </div>
152
 </template>
167
 </template>
153
 
168
 
154
 <script>
169
 <script>
170
+import { mapState, mapActions } from 'vuex';
171
+
155
 export default {
172
 export default {
156
   name: 'MakeOffer',
173
   name: 'MakeOffer',
157
   props: {
174
   props: {
158
     isMakeOffer: Boolean,
175
     isMakeOffer: Boolean,
159
     isProperty: Boolean,
176
     isProperty: Boolean,
177
+    canEdit: Boolean,
160
     item: Object,
178
     item: Object,
179
+    bidId: Number,
180
+    updateItem: Function,
161
   },
181
   },
162
   data() {
182
   data() {
163
     return {
183
     return {
164
       isDecline: false,
184
       isDecline: false,
185
+      isSaved: false,
186
+      message: '',
165
     };
187
     };
166
   },
188
   },
167
   methods: {
189
   methods: {
190
+    ...mapActions('bid', ['getBid', 'saveBid', 'acceptBid', 'declineBid']),
168
     SendOffer() {
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
     Accept() {
207
     Accept() {
172
-      // Accept Offer
208
+      this.acceptBid(this.item.id);
209
+      this.isSaved = true;
210
+      this.message = 'Offer Accepted.';
173
     },
211
     },
174
     Decline() {
212
     Decline() {
175
       this.isDecline = true;
213
       this.isDecline = true;
176
     },
214
     },
177
     Complete() {
215
     Complete() {
178
       this.isDecline = false;
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
 </script>
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 Dosyayı Görüntüle

20
           <tr>
20
           <tr>
21
             <th>Type</th>
21
             <th>Type</th>
22
             <th>Description</th>
22
             <th>Description</th>
23
+            <th>Status</th>
24
+            <th>Price</th>
25
+            <th>Offered Price</th>
26
+            <th>Offer By</th>
23
             <th></th>
27
             <th></th>
24
           </tr>
28
           </tr>
25
         </thead>
29
         </thead>
26
         <tbody>
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
             <td>
38
             <td>
32
               <button
39
               <button
33
                 type="button"
40
                 type="button"
46
                       <makeOffer
53
                       <makeOffer
47
                         name="MakeOffer"
54
                         name="MakeOffer"
48
                         :isMakeOffer="false"
55
                         :isMakeOffer="false"
49
-                        :isProperty="item.isProperty"
56
+                        :isProperty="item.type === 'Property'"
57
+                        :canEdit="item.statusCode === 'E1'"
50
                         :item="item"
58
                         :item="item"
51
                       />
59
                       />
52
                     </div>
60
                     </div>
62
 </template>
70
 </template>
63
 
71
 
64
 <script>
72
 <script>
73
+import { mapState, mapActions } from 'vuex';
65
 import makeOffer from './makeOffer.vue';
74
 import makeOffer from './makeOffer.vue';
66
 
75
 
67
 export default {
76
 export default {
70
   data() {
79
   data() {
71
     return {
80
     return {
72
       item: {},
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
 </script>
103
 </script>

+ 33
- 21
src/components/property/propertyPage.vue Dosyayı Görüntüle

1
 <template>
1
 <template>
2
   <!-- eslint-disable max-len -->
2
   <!-- eslint-disable max-len -->
3
   <div v-if="property">
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
           </div>
16
           </div>
12
         </div>
17
         </div>
13
       </div>
18
       </div>
14
-    </section>
19
+    </div>
15
     <!--/ Intro Single End /-->
20
     <!--/ Intro Single End /-->
16
 
21
 
17
     <!--/ property Single Star /-->
22
     <!--/ property Single Star /-->
32
                 <div class="row">
37
                 <div class="row">
33
                   <div class="col-sm-12">
38
                   <div class="col-sm-12">
34
                     <div class="title-box-d">
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
                     </div>
41
                     </div>
37
                   </div>
42
                   </div>
38
                 </div>
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
                 <div v-for="display in property.displayData" :key="display.id">
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
                     <div class="col-sm-12">
51
                     <div class="col-sm-12">
43
                       <div class="title-box-d">
52
                       <div class="title-box-d">
44
                         <h3 class="title-d">{{ display.groupName }}</h3>
53
                         <h3 class="title-d">{{ display.groupName }}</h3>
57
               </div>
66
               </div>
58
               <div class="col-md-5 col-lg-4">
67
               <div class="col-md-5 col-lg-4">
59
                 <div class="property-price d-flex justify-content-center foo">
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
                     <div class="card-title-c align-self-center">
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
                       <h6 v-if="property.pricePer">Per {{property.pricePer}}</h6>
75
                       <h6 v-if="property.pricePer">Per {{property.pricePer}}</h6>
67
                     </div>
76
                     </div>
68
                   </div>
77
                   </div>
78
+                  <!-- </div> -->
69
                 </div>
79
                 </div>
70
                 <div class="property-summary">
80
                 <div class="property-summary">
71
                   <div class="row">
81
                   <div class="row">
72
                     <div class="col-sm-12">
82
                     <div class="col-sm-12">
73
                       <div class="title-box-d section-t4">
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
                       </div>
85
                       </div>
76
                     </div>
86
                     </div>
77
                   </div>
87
                   </div>
83
                       </li>
93
                       </li>
84
                       <li class="d-flex justify-content-between">
94
                       <li class="d-flex justify-content-between">
85
                         <strong>Status:</strong>
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
                       </li>
99
                       </li>
89
                       <li class="d-flex justify-content-between">
100
                       <li class="d-flex justify-content-between">
90
                         <strong>Address:</strong>
101
                         <strong>Address:</strong>
126
                   <div class="row section-t3">
137
                   <div class="row section-t3">
127
                     <div class="col-sm-12">
138
                     <div class="col-sm-12">
128
                       <div class="title-box-d">
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
                       </div>
141
                       </div>
131
                     </div>
142
                     </div>
132
                   </div>
143
                   </div>
235
                               </div>
246
                               </div>
236
                             </div>
247
                             </div>
237
                             <div class="col-md-12">
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
                             </div>
250
                             </div>
240
                           </div>
251
                           </div>
241
                         </form>
252
                         </form>
253
+                        <br />
242
                       </div>
254
                       </div>
243
                     </div>
255
                     </div>
244
                   </div>
256
                   </div>

+ 1
- 6
src/components/property/propertySearchPage.vue Dosyayı Görüntüle

55
         </div>
55
         </div>
56
       </div>
56
       </div>
57
       <div>
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
         <div v-if="properties.length === 0">
59
         <div v-if="properties.length === 0">
65
           <img src="../../../public/img/no-homes.gif" />
60
           <img src="../../../public/img/no-homes.gif" />
66
           <br />
61
           <br />

+ 3
- 7
src/components/property/propertyeditPage.vue Dosyayı Görüntüle

22
       <div class="row">
22
       <div class="row">
23
         <div class="container col-md-10">
23
         <div class="container col-md-10">
24
           <div class="title-box-d">
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
           </div>
26
           </div>
27
         </div>
27
         </div>
28
       </div>
28
       </div>
276
               @click="SubmitData()"
276
               @click="SubmitData()"
277
               class="btn btn-b-n"
277
               class="btn btn-b-n"
278
               style="width: 85px; height:40px;"
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
           </form>
281
           </form>
286
         </div>
282
         </div>
287
       </div>
283
       </div>

+ 1
- 1
src/components/shared/searchTab.vue Dosyayı Görüntüle

101
           </div>
101
           </div>
102
           {{selectedPropertyType}}
102
           {{selectedPropertyType}}
103
           <div class="col-md-12">
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
           </div>
105
           </div>
106
         </div>
106
         </div>
107
       </form>
107
       </form>

+ 34
- 8
src/components/timeshare/buy/weekListComponent.vue Dosyayı Görüntüle

1
 <template>
1
 <template>
2
   <div>
2
   <div>
3
-    <button @click="addDummyWeek" class="btn btn-primary">Add Dummy</button>
4
     <table class="table table-bordered">
3
     <table class="table table-bordered">
5
       <thead>
4
       <thead>
6
         <tr>
5
         <tr>
7
           <th>Resort</th>
6
           <th>Resort</th>
8
           <th>Unit Number</th>
7
           <th>Unit Number</th>
9
           <th>Week Number</th>
8
           <th>Week Number</th>
10
-          <th>Module</th>
11
           <th>Bedrooms</th>
9
           <th>Bedrooms</th>
12
-          <th>Season</th>
13
           <th>Price</th>
10
           <th>Price</th>
14
           <th>Status</th>
11
           <th>Status</th>
15
           <th>Interested</th>
12
           <th>Interested</th>
20
           <td>{{item.resort.resortName}}</td>
17
           <td>{{item.resort.resortName}}</td>
21
           <td>{{item.unitNumber}}</td>
18
           <td>{{item.unitNumber}}</td>
22
           <td>{{item.weekNumber}}</td>
19
           <td>{{item.weekNumber}}</td>
23
-          <td>{{item.module}}</td>
24
           <td>{{item.bedrooms}}</td>
20
           <td>{{item.bedrooms}}</td>
25
-          <td>{{item.season}}</td>
26
-          <td>{{item.sellPrice}}</td>
21
+          <td>{{item.sellPrice | toCurrency}}</td>
27
           <td>{{item.status ? item.status.description : ''}}</td>
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
         </tr>
51
         </tr>
30
       </tbody>
52
       </tbody>
31
     </table>
53
     </table>
33
 </template>
55
 </template>
34
 <script>
56
 <script>
35
 import { mapState, mapActions, mapGetters } from 'vuex';
57
 import { mapState, mapActions, mapGetters } from 'vuex';
58
+import makeOffer from '../../processFlow/makeOffer.vue';
36
 
59
 
37
 export default {
60
 export default {
61
+  components: {
62
+    makeOffer,
63
+  },
38
   computed: {
64
   computed: {
39
     ...mapState('weekList', ['weeks']),
65
     ...mapState('weekList', ['weeks']),
40
     ...mapGetters({
66
     ...mapGetters({
42
     }),
68
     }),
43
   },
69
   },
44
   mounted() {
70
   mounted() {
45
-    this.addDummyWeek();
71
+    this.getWeeks();
46
   },
72
   },
47
   methods: {
73
   methods: {
48
     ...mapActions('weekList', ['getWeeks', 'addDummyWeek']),
74
     ...mapActions('weekList', ['getWeeks', 'addDummyWeek']),

+ 0
- 1
src/components/timeshare/buy/weekListPage.vue Dosyayı Görüntüle

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

+ 8
- 4
src/components/timeshare/resort/resortPage.vue Dosyayı Görüntüle

1
 <template>
1
 <template>
2
   <!-- eslint-disable max-len -->
2
   <!-- eslint-disable max-len -->
3
   <section>
3
   <section>
4
-    <div class="container intro-single">
4
+    <div class="container">
5
+      <br />
6
+      <br />
7
+      <br />
8
+      <br />
5
       <div class="row">
9
       <div class="row">
6
         <div class="col-md-12 col-lg-8">
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
           </div>
13
           </div>
10
           <br />
14
           <br />
11
         </div>
15
         </div>
25
     <div class="myMargin">
29
     <div class="myMargin">
26
       <div class="row">
30
       <div class="row">
27
         <div class="col-md-3">
31
         <div class="col-md-3">
28
-          <h3>Filter Resort</h3>
32
+          <h4>Filter Resort</h4>
29
           <form
33
           <form
30
             id="mainForm"
34
             id="mainForm"
31
             method="POST"
35
             method="POST"

+ 10
- 10
src/components/timeshare/resort/unitPage.vue Dosyayı Görüntüle

5
     <br />
5
     <br />
6
     <br />
6
     <br />
7
     <br />
7
     <br />
8
-    <br />
9
     <div class="row">
8
     <div class="row">
10
       <div class="col-md-12 col-lg-8">
9
       <div class="col-md-12 col-lg-8">
11
         <div class="title-box-d">
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
         </div>
12
         </div>
14
         <br />
13
         <br />
15
       </div>
14
       </div>
111
               </div>
110
               </div>
112
               <div class="col-md-6">
111
               <div class="col-md-6">
113
                 <label for="price">Price</label>
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
                   </div>
121
                   </div>
122
+                  <!-- </div> -->
123
                 </div>
123
                 </div>
124
               </div>
124
               </div>
125
             </div>
125
             </div>

+ 76
- 18
src/components/timeshare/searchTimeshare.vue Dosyayı Görüntüle

7
       accept-charset="UTF-8"
7
       accept-charset="UTF-8"
8
       enctype="multipart/form-data"
8
       enctype="multipart/form-data"
9
     >
9
     >
10
-      {{filter}}
11
       <div class="form-group text-left">
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
       </div>
27
       </div>
17
       <div class="form-group text-left">
28
       <div class="form-group text-left">
18
         <label>Resort Name</label>
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
       </div>
45
       </div>
23
       <div class="form-group text-left">
46
       <div class="form-group text-left">
24
         <label>Bedrooms</label>
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
       </div>
63
       </div>
29
       <hr />
64
       <hr />
30
       <div class="form-group text-left">
65
       <div class="form-group text-left">
31
         <label>Date</label>
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
       </div>
80
       </div>
34
       <hr />
81
       <hr />
35
       <div class="form-group">
82
       <div class="form-group">
38
             <label>Minimum Price</label>
85
             <label>Minimum Price</label>
39
             <div class="input-group mb-3">
86
             <div class="input-group mb-3">
40
               <div class="input-group-prepend">
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
               </div>
91
               </div>
43
               <input
92
               <input
44
                 class="form-control"
93
                 class="form-control"
49
                 placeholder="Minimum Price"
98
                 placeholder="Minimum Price"
50
                 v-model="filter.minPrice"
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
             </div>
106
             </div>
53
           </div>
107
           </div>
54
           <div class="col-md-6 text-left">
108
           <div class="col-md-6 text-left">
55
             <label>Maximum Price</label>
109
             <label>Maximum Price</label>
56
             <div class="input-group mb-3">
110
             <div class="input-group mb-3">
57
               <div class="input-group-prepend">
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
               </div>
115
               </div>
60
               <input
116
               <input
61
                 class="form-control"
117
                 class="form-control"
66
                 placeholder="Maximum Price"
122
                 placeholder="Maximum Price"
67
                 v-model="filter.maxPrice"
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
             </div>
130
             </div>
70
           </div>
131
           </div>
71
         </div>
132
         </div>
72
       </div>
133
       </div>
73
-      {{filter}}
74
     </form>
134
     </form>
75
   </div>
135
   </div>
76
 </template>
136
 </template>
80
 import _ from 'lodash';
140
 import _ from 'lodash';
81
 
141
 
82
 export default {
142
 export default {
83
-  props: {
84
-    filter: undefined,
85
-  },
86
   created() {
143
   created() {
87
     this.initTimeshare();
144
     this.initTimeshare();
88
   },
145
   },
108
   },
165
   },
109
   methods: {
166
   methods: {
110
     ...mapActions('timeshare', ['initTimeshare']),
167
     ...mapActions('timeshare', ['initTimeshare']),
168
+    ...mapActions('weekList', ['clearFilter']),
111
   },
169
   },
112
 };
170
 };
113
 </script>
171
 </script>

+ 10
- 0
src/main.js Dosyayı Görüntüle

8
 
8
 
9
 Vue.config.productionTip = false;
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
 new Vue({
21
 new Vue({
12
   render: h => h(App),
22
   render: h => h(App),
13
   router,
23
   router,

+ 2
- 0
src/store/index.js Dosyayı Görüntüle

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

+ 63
- 0
src/store/modules/processFlow/bid.js Dosyayı Görüntüle

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 Dosyayı Görüntüle

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

Loading…
İptal
Kaydet