Ver código fonte

Timeshareweek user update

master
30117125 4 anos atrás
pai
commit
a2de943855

+ 64
- 22
src/components/admin/status/editTimeShareAdminPage.vue Ver arquivo

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

+ 3
- 2
src/components/admin/status/timeshareAdminList.vue Ver arquivo

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

+ 2
- 2
src/components/timeshare/sell/contentSection.vue Ver arquivo

@@ -165,7 +165,7 @@
165 165
               <div class="form-group col-md-6 mt-2">
166 166
                 <float-label>
167 167
                   <input
168
-                    type="number"
168
+                    type="text"
169 169
                     class="form-control"
170 170
                     name="week"
171 171
                     id="week"
@@ -632,7 +632,7 @@
632 632
             <div class="form-row">
633 633
               <div
634 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 637
                 <p style="text-align: left; margin:auto; padding:10px">
638 638
                   1. With respect to my timeshare module/week, I confirm that:

+ 3
- 1
src/store/index.js Ver arquivo

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

+ 27
- 0
src/store/modules/user/nonRegIndividual.js Ver arquivo

@@ -0,0 +1,27 @@
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
+};

Carregando…
Cancelar
Salvar