Browse Source

Timeshareweek user update

master
30117125 4 years ago
parent
commit
a2de943855

+ 64
- 22
src/components/admin/status/editTimeShareAdminPage.vue View File

55
 
55
 
56
                     <div class="validation"></div>
56
                     <div class="validation"></div>
57
                   </div>
57
                   </div>
58
+                  <!-- <div v-else class="input-group">
59
+                    <float-label label="RESORT NAME" style="width:100%" fixed>
60
+                      <select class="form-control uniSelect" v-model="selectedResort">
61
+                        <option value="Other">{{ week.otherResortName }}</option>
62
+                        <option
63
+                          v-for="(resort, r) in filteredResort"
64
+                          :key="r"
65
+                          :value="resort.resortCode"
66
+                          >{{ resort.resortName }}</option
67
+                        >
68
+                      </select>
69
+                    </float-label>
70
+
71
+                    <div class="validation"></div>
72
+                  </div> -->
58
                   <div class="validation"></div>
73
                   <div class="validation"></div>
59
                 </div>
74
                 </div>
60
                 <div class="form-group col-md-6">
75
                 <div class="form-group col-md-6">
65
                       placeholder="NAME OF RESORT (* IF OTHER)"
80
                       placeholder="NAME OF RESORT (* IF OTHER)"
66
                       type="text"
81
                       type="text"
67
                       name="other"
82
                       name="other"
68
-                      v-model="weekParam.otherResortName"
83
+                      v-model="week.otherResortName"
69
                     />
84
                     />
70
                   </float-label>
85
                   </float-label>
71
                 </div>
86
                 </div>
289
             <div class="section-header" style="margin-top:50px">
304
             <div class="section-header" style="margin-top:50px">
290
               <h2>Detailed Individual Information</h2>
305
               <h2>Detailed Individual Information</h2>
291
             </div>
306
             </div>
292
-
293
             <div class="form">
307
             <div class="form">
308
+              <div v-if="ROLE === 'Super Admin'" class="row mb-4">
309
+                <div class="col">
310
+                  <float-label label="OWNER TYPE" fixed>
311
+                    <select v-model="weekParam.customOwner" class="form-control uniSelect mt-3">
312
+                      <option v-bind:value="true">Custom Owner</option>
313
+                      <option v-bind:value="false">Registered User</option>
314
+                    </select>
315
+                  </float-label>
316
+                </div>
317
+              </div>
294
               <div v-if="ROLE === 'Super Admin'" class="row mb-4">
318
               <div v-if="ROLE === 'Super Admin'" class="row mb-4">
295
                 <div class="col">
319
                 <div class="col">
296
                   <float-label label="SELECT OWNER" fixed>
320
                   <float-label label="SELECT OWNER" fixed>
297
                     <select
321
                     <select
322
+                      :disabled="weekParam.customOwner"
298
                       v-model="weekParam.ownerId"
323
                       v-model="weekParam.ownerId"
299
                       class="form-control uniSelect mt-3"
324
                       class="form-control uniSelect mt-3"
300
                       @change="updateCurrentUser()"
325
                       @change="updateCurrentUser()"
312
                     <input
337
                     <input
313
                       type="text"
338
                       type="text"
314
                       name="name"
339
                       name="name"
315
-                      disabled
340
+                      :disabled="!weekParam.customOwner"
316
                       class="form-control"
341
                       class="form-control"
317
                       id="name"
342
                       id="name"
318
                       placeholder="Name"
343
                       placeholder="Name"
328
                   <float-label>
353
                   <float-label>
329
                     <input
354
                     <input
330
                       type="text"
355
                       type="text"
331
-                      disabled
356
+                      :disabled="!weekParam.customOwner"
332
                       class="form-control"
357
                       class="form-control"
333
                       name="surname"
358
                       name="surname"
334
                       id="surname"
359
                       id="surname"
346
                   <float-label>
371
                   <float-label>
347
                     <input
372
                     <input
348
                       type="text"
373
                       type="text"
349
-                      disabled
374
+                      :disabled="!weekParam.customOwner"
350
                       name="idnum"
375
                       name="idnum"
351
                       class="form-control"
376
                       class="form-control"
352
                       id="idnum"
377
                       id="idnum"
363
                   <float-label>
388
                   <float-label>
364
                     <input
389
                     <input
365
                       type="text"
390
                       type="text"
366
-                      disabled
391
+                      :disabled="!weekParam.customOwner"
367
                       class="form-control"
392
                       class="form-control"
368
                       name="company"
393
                       name="company"
369
                       id="company"
394
                       id="company"
382
                   <float-label>
407
                   <float-label>
383
                     <input
408
                     <input
384
                       type="text"
409
                       type="text"
385
-                      disabled
410
+                      :disabled="!weekParam.customOwner"
386
                       class="form-control"
411
                       class="form-control"
387
                       name="email"
412
                       name="email"
388
                       id="email"
413
                       id="email"
389
                       placeholder="Email Address"
414
                       placeholder="Email Address"
390
                       data-msg="Please enter your email address"
415
                       data-msg="Please enter your email address"
391
-                      v-model="week.owner.emailAddress"
416
+                      v-model="week.owner.email"
392
                     />
417
                     />
393
                   </float-label>
418
                   </float-label>
394
 
419
 
400
                   <float-label>
425
                   <float-label>
401
                     <input
426
                     <input
402
                       type="text"
427
                       type="text"
403
-                      disabled
428
+                      :disabled="!weekParam.customOwner"
404
                       name="cell"
429
                       name="cell"
405
                       class="form-control"
430
                       class="form-control"
406
                       id="cell"
431
                       id="cell"
417
                   <float-label>
442
                   <float-label>
418
                     <input
443
                     <input
419
                       type="text"
444
                       type="text"
420
-                      disabled
445
+                      :disabled="!weekParam.customOwner"
421
                       class="form-control"
446
                       class="form-control"
422
                       name="landline"
447
                       name="landline"
423
                       id="landline"
448
                       id="landline"
431
                 </div>
456
                 </div>
432
               </div>
457
               </div>
433
             </div>
458
             </div>
459
+            <div class="section-header" style="margin-top:50px">
460
+              <h2>Week Agent</h2>
461
+            </div>
434
             <div v-if="!boolAwaitingPayment">
462
             <div v-if="!boolAwaitingPayment">
435
               <div class="section-header">
463
               <div class="section-header">
436
                 <h2>Publish Timeshare Week</h2>
464
                 <h2>Publish Timeshare Week</h2>
545
     Alert
573
     Alert
546
   },
574
   },
547
   async mounted() {
575
   async mounted() {
548
-    this.getStatusList();
549
-    this.getWeek(this.weekParam.id).then(() => {
550
-      this.wait = false;
551
-    });
552
     if (this.sellItem.id) {
576
     if (this.sellItem.id) {
553
       this.newSale();
577
       this.newSale();
554
     }
578
     }
561
     this.getIndividual(Log.getUser().id);
585
     this.getIndividual(Log.getUser().id);
562
     this.getBanks();
586
     this.getBanks();
563
     //this.getWeek(this.weekParam.id);
587
     //this.getWeek(this.weekParam.id);
564
-    console.log(this.regions);
565
-    console.log(this.weekParam.region.regionCode);
588
+    // console.log(this.regions);
589
+    // console.log(this.weekParam.region.regionCode);
566
     this.selectedRegion = this.weekParam.region.regionCode;
590
     this.selectedRegion = this.weekParam.region.regionCode;
567
     this.selectedResort = this.weekParam.resort.resortCode;
591
     this.selectedResort = this.weekParam.resort.resortCode;
568
     this.selectedBedrooms = this.weekParam.bedrooms;
592
     this.selectedBedrooms = this.weekParam.bedrooms;
581
         this.boolAwaitingPayment = true;
605
         this.boolAwaitingPayment = true;
582
       }
606
       }
583
     }
607
     }
584
-    console.log(this.individuals);
608
+    //console.log(this.individuals);
585
   },
609
   },
586
   created() {
610
   created() {
587
     this.initTimeshare(this.weekId);
611
     this.initTimeshare(this.weekId);
588
     this.getIndividuals();
612
     this.getIndividuals();
613
+    this.getStatusList();
614
+    this.getWeek(this.weekParam.id).then(() => {
615
+      if (this.weekParam.customOwner) {
616
+        this.retrieveNonRegIndiv(this.weekParam.id).then(() => {
617
+          this.week.owner.name = this.getIndiv[0].name;
618
+          this.week.owner.surname = this.getIndiv[0].surname;
619
+          this.week.owner.idNumber = this.getIndiv[0].idNumber;
620
+          this.week.owner.companyRegNumber = this.getIndiv[0].companyRegNumber;
621
+          this.week.owner.email = this.getIndiv[0].emailAddress;
622
+          this.week.owner.cellNumber = this.getIndiv[0].cellNumber;
623
+          this.week.owner.telephone = this.getIndiv[0].telephoneNumber;
624
+          this.wait = false;
625
+        });
626
+      } else {
627
+        this.wait = false;
628
+      }
629
+    });
589
   },
630
   },
590
   computed: {
631
   computed: {
591
     ...mapState("timeshare", [
632
     ...mapState("timeshare", [
602
       "agents",
643
       "agents",
603
       "getTemplate"
644
       "getTemplate"
604
     ]),
645
     ]),
646
+    ...mapGetters("nonRegIndividual", ["getIndiv"]),
605
     ...mapState("individual", ["indiv"]),
647
     ...mapState("individual", ["indiv"]),
606
     ...mapState("authentication", ["isLoggedIn"]),
648
     ...mapState("authentication", ["isLoggedIn"]),
607
     ...mapState("myWeeks", ["items", "week"]),
649
     ...mapState("myWeeks", ["items", "week"]),
640
   },
682
   },
641
   methods: {
683
   methods: {
642
     ...mapActions("individual", ["getIndividual"]),
684
     ...mapActions("individual", ["getIndividual"]),
685
+    ...mapActions("nonRegIndividual", ["retrieveNonRegIndiv"]),
643
     ...mapActions("timeshare", ["initTimeshare", "onResortChange", "saveWeek", "getBlankWeek"]),
686
     ...mapActions("timeshare", ["initTimeshare", "onResortChange", "saveWeek", "getBlankWeek"]),
644
     ...mapActions("payment", ["addPayment"]),
687
     ...mapActions("payment", ["addPayment"]),
645
     ...mapActions("bank", ["getBanks"]),
688
     ...mapActions("bank", ["getBanks"]),
653
     updateCurrentUser() {
696
     updateCurrentUser() {
654
       this.individuals.forEach(indiv => {
697
       this.individuals.forEach(indiv => {
655
         if (this.weekParam.ownerId === indiv.id) {
698
         if (this.weekParam.ownerId === indiv.id) {
656
-          console.log(indiv);
657
           this.week.owner.name = indiv.name;
699
           this.week.owner.name = indiv.name;
658
           this.week.owner.surname = indiv.surname;
700
           this.week.owner.surname = indiv.surname;
659
           this.week.owner.idNumer = indiv.idNumber;
701
           this.week.owner.idNumer = indiv.idNumber;
660
           this.week.owner.companyRegNumber = indiv.companyRegNumber;
702
           this.week.owner.companyRegNumber = indiv.companyRegNumber;
661
-          this.week.owner.emailAddress = indiv.email;
703
+          this.week.owner.email = indiv.emailAddress;
662
           this.week.owner.cellNumber = indiv.cellNumber;
704
           this.week.owner.cellNumber = indiv.cellNumber;
663
           this.week.owner.landlineNumber = indiv.telephone;
705
           this.week.owner.landlineNumber = indiv.telephone;
664
-          console.log(this.week.owner);
706
+          //console.log(this.week.owner);
665
         }
707
         }
666
       });
708
       });
667
     },
709
     },
701
       }
743
       }
702
       this.weekParam.arrivalDate = new Date(this.dateParam).toISOString().substring(0, 10);
744
       this.weekParam.arrivalDate = new Date(this.dateParam).toISOString().substring(0, 10);
703
       this.weekParam.departureDate = new Date(this.depDateParam).toISOString().substring(0, 10);
745
       this.weekParam.departureDate = new Date(this.depDateParam).toISOString().substring(0, 10);
704
-      console.log(this.pubDateParam);
746
+      //console.log(this.pubDateParam);
705
       if (this.pubDateParam) {
747
       if (this.pubDateParam) {
706
         this.weekParam.pulbishedDate = new Date(this.pubDateParam).toISOString().substring(0, 19);
748
         this.weekParam.pulbishedDate = new Date(this.pubDateParam).toISOString().substring(0, 19);
707
       }
749
       }
722
       delete this.weekParam.owner.howMarried;
764
       delete this.weekParam.owner.howMarried;
723
       delete this.weekParam.cellNumber;
765
       delete this.weekParam.cellNumber;
724
       //console.log(JSON.stringify(this.weekParam));
766
       //console.log(JSON.stringify(this.weekParam));
725
-      console.log(this.weekParam);
767
+      //console.log(this.weekParam);
726
       this.editSave(this.weekParam).then(() => {
768
       this.editSave(this.weekParam).then(() => {
727
         this.backToListView();
769
         this.backToListView();
728
       });
770
       });

+ 3
- 2
src/components/admin/status/timeshareAdminList.vue View File

50
                 <th scope="col">Delete</th>
50
                 <th scope="col">Delete</th>
51
               </tr>
51
               </tr>
52
             </thead>
52
             </thead>
53
+
53
             <tbody>
54
             <tbody>
54
               <tr v-for="(item, i) in DisplayItems" :key="i">
55
               <tr v-for="(item, i) in DisplayItems" :key="i">
55
                 <td>{{ item.owner }}</td>
56
                 <td>{{ item.owner }}</td>
56
                 <td>{{ item.agent }}</td>
57
                 <td>{{ item.agent }}</td>
57
                 <td>{{ item.resort.resortName }}</td>
58
                 <td>{{ item.resort.resortName }}</td>
58
-                <td>{{ item.weekNumber }}</td>
59
+                <td>{{ item.module }}</td>
59
                 <td>{{ item.unitNumber }}</td>
60
                 <td>{{ item.unitNumber }}</td>
60
                 <td>{{ item.bedrooms }}</td>
61
                 <td>{{ item.bedrooms }}</td>
61
                 <td>{{ item.season }}</td>
62
                 <td>{{ item.season }}</td>
174
         "owner",
175
         "owner",
175
         "agent",
176
         "agent",
176
         "resort",
177
         "resort",
177
-        "weekNumber",
178
+        "module",
178
         "unitNumber",
179
         "unitNumber",
179
         "bedrooms",
180
         "bedrooms",
180
         "season",
181
         "season",

+ 2
- 2
src/components/timeshare/sell/contentSection.vue View File

165
               <div class="form-group col-md-6 mt-2">
165
               <div class="form-group col-md-6 mt-2">
166
                 <float-label>
166
                 <float-label>
167
                   <input
167
                   <input
168
-                    type="number"
168
+                    type="text"
169
                     class="form-control"
169
                     class="form-control"
170
                     name="week"
170
                     name="week"
171
                     id="week"
171
                     id="week"
632
             <div class="form-row">
632
             <div class="form-row">
633
               <div
633
               <div
634
                 class="form-group col-md-12"
634
                 class="form-group col-md-12"
635
-                style="border:solid;border-width:2px; border-color:rgb(27, 117, 187); border-radius: 3px"
635
+                style="border:solid;border-width:2px; border-color:rgb(27, 117, 187);border-radius: 3px"
636
               >
636
               >
637
                 <p style="text-align: left; margin:auto; padding:10px">
637
                 <p style="text-align: left; margin:auto; padding:10px">
638
                   1. With respect to my timeshare module/week, I confirm that:
638
                   1. With respect to my timeshare module/week, I confirm that:

+ 3
- 1
src/store/index.js View File

36
 import Fees from "./modules/financial/fees";
36
 import Fees from "./modules/financial/fees";
37
 import TermsConditions from "./modules/misc/termsConditions";
37
 import TermsConditions from "./modules/misc/termsConditions";
38
 import Roles from './modules/user/role'
38
 import Roles from './modules/user/role'
39
+import NonRegIndividuals from './modules/user/nonRegIndividual'
39
 
40
 
40
 Vue.use(Vuex);
41
 Vue.use(Vuex);
41
 /* eslint no-param-reassign: ["error", { "props": false }] */
42
 /* eslint no-param-reassign: ["error", { "props": false }] */
74
     fees: Fees,
75
     fees: Fees,
75
     termsConditions: TermsConditions,
76
     termsConditions: TermsConditions,
76
     bank: bank,
77
     bank: bank,
77
-    role: Roles
78
+    role: Roles,
79
+    nonRegIndividual: NonRegIndividuals
78
   }
80
   }
79
 });
81
 });

+ 27
- 0
src/store/modules/user/nonRegIndividual.js View File

1
+/* eslint-disable */
2
+import axios from 'axios';
3
+
4
+export default {
5
+  namespaced: true,
6
+  state: {
7
+    nonRegIndiv: [],
8
+  },
9
+  mutations: {
10
+    getIndiv(state, indiv) {
11
+      state.nonRegIndiv = indiv;
12
+    },
13
+  },
14
+  getters: {
15
+    getIndiv: (state) => state.nonRegIndiv
16
+  },
17
+  actions: {
18
+    async retrieveNonRegIndiv({commit}, id){
19
+        console.log('twas here');
20
+        await axios.get('/api/nonRegIndividual/' + id)
21
+        .then((result) => {
22
+            commit('getIndiv', result.data)
23
+        })
24
+        .catch((e) => console.log(e))
25
+    }
26
+  },
27
+};

Loading…
Cancel
Save