Browse Source

Update Change of ownership for timeshare

master
30117125 4 years ago
parent
commit
957d7e2a7a
1 changed files with 45 additions and 3 deletions
  1. 45
    3
      src/components/admin/status/editTimeShareAdminPage.vue

+ 45
- 3
src/components/admin/status/editTimeShareAdminPage.vue View File

289
             <div class="section-header" style="margin-top:50px">
289
             <div class="section-header" style="margin-top:50px">
290
               <h2>Detailed Individual Information</h2>
290
               <h2>Detailed Individual Information</h2>
291
             </div>
291
             </div>
292
+
292
             <div class="form">
293
             <div class="form">
294
+              <div v-if="ROLE === 'Super Admin'" class="row mb-4">
295
+                <div class="col">
296
+                  <float-label label="SELECT OWNER" fixed>
297
+                    <select
298
+                      v-model="weekParam.ownerId"
299
+                      class="form-control uniSelect mt-3"
300
+                      @change="updateCurrentUser()"
301
+                    >
302
+                      <option v-for="indiv in individuals" :key="indiv.id" :value="indiv.id">{{
303
+                        indiv.fullName
304
+                      }}</option>
305
+                    </select>
306
+                  </float-label>
307
+                </div>
308
+              </div>
293
               <div class="row">
309
               <div class="row">
294
                 <div class="form-group col-md-6">
310
                 <div class="form-group col-md-6">
295
                   <float-label>
311
                   <float-label>
296
                     <input
312
                     <input
297
                       type="text"
313
                       type="text"
298
                       name="name"
314
                       name="name"
315
+                      disabled
299
                       class="form-control"
316
                       class="form-control"
300
                       id="name"
317
                       id="name"
301
                       placeholder="Name"
318
                       placeholder="Name"
311
                   <float-label>
328
                   <float-label>
312
                     <input
329
                     <input
313
                       type="text"
330
                       type="text"
331
+                      disabled
314
                       class="form-control"
332
                       class="form-control"
315
                       name="surname"
333
                       name="surname"
316
                       id="surname"
334
                       id="surname"
328
                   <float-label>
346
                   <float-label>
329
                     <input
347
                     <input
330
                       type="text"
348
                       type="text"
349
+                      disabled
331
                       name="idnum"
350
                       name="idnum"
332
                       class="form-control"
351
                       class="form-control"
333
                       id="idnum"
352
                       id="idnum"
344
                   <float-label>
363
                   <float-label>
345
                     <input
364
                     <input
346
                       type="text"
365
                       type="text"
366
+                      disabled
347
                       class="form-control"
367
                       class="form-control"
348
                       name="company"
368
                       name="company"
349
                       id="company"
369
                       id="company"
362
                   <float-label>
382
                   <float-label>
363
                     <input
383
                     <input
364
                       type="text"
384
                       type="text"
385
+                      disabled
365
                       class="form-control"
386
                       class="form-control"
366
                       name="email"
387
                       name="email"
367
                       id="email"
388
                       id="email"
379
                   <float-label>
400
                   <float-label>
380
                     <input
401
                     <input
381
                       type="text"
402
                       type="text"
403
+                      disabled
382
                       name="cell"
404
                       name="cell"
383
                       class="form-control"
405
                       class="form-control"
384
                       id="cell"
406
                       id="cell"
395
                   <float-label>
417
                   <float-label>
396
                     <input
418
                     <input
397
                       type="text"
419
                       type="text"
420
+                      disabled
398
                       class="form-control"
421
                       class="form-control"
399
                       name="landline"
422
                       name="landline"
400
                       id="landline"
423
                       id="landline"
513
       dateParam: {},
536
       dateParam: {},
514
       depDateParam: {},
537
       depDateParam: {},
515
       pubDateParam: {},
538
       pubDateParam: {},
516
-      boolAwaitingPayment: false
539
+      boolAwaitingPayment: false,
540
+      selectedUser: ""
517
     };
541
     };
518
   },
542
   },
519
   components: {
543
   components: {
560
   },
584
   },
561
   created() {
585
   created() {
562
     this.initTimeshare(this.weekId);
586
     this.initTimeshare(this.weekId);
587
+    this.getIndividuals();
563
   },
588
   },
564
   computed: {
589
   computed: {
565
     ...mapState("timeshare", [
590
     ...mapState("timeshare", [
585
       person: "authentication/getPerson"
610
       person: "authentication/getPerson"
586
     }),
611
     }),
587
     ...mapState("bank", ["banks"]),
612
     ...mapState("bank", ["banks"]),
613
+    ...mapState("register", ["individuals", "removeIndividual"]),
588
     ...mapGetters("fees", ["getListingFee"]),
614
     ...mapGetters("fees", ["getListingFee"]),
589
     refAgent() {
615
     refAgent() {
590
       return this.sellItem && this.sellItem.referedByAgent;
616
       return this.sellItem && this.sellItem.referedByAgent;
618
     ...mapActions("bank", ["getBanks"]),
644
     ...mapActions("bank", ["getBanks"]),
619
     ...mapActions("myWeeks", ["getItems", "getWeek", "editSave"]),
645
     ...mapActions("myWeeks", ["getItems", "getWeek", "editSave"]),
620
     ...mapActions("status", ["getStatusList"]),
646
     ...mapActions("status", ["getStatusList"]),
647
+    ...mapActions("register", ["getIndividuals", "deleteIndividual"]),
621
     newSale() {
648
     newSale() {
622
       this.weekId = 0;
649
       this.weekId = 0;
623
       this.getBlankWeek();
650
       this.getBlankWeek();
624
     },
651
     },
652
+    updateCurrentUser() {
653
+      this.individuals.forEach(indiv => {
654
+        if (this.weekParam.ownerId === indiv.id) {
655
+          console.log(indiv);
656
+          this.week.owner.name = indiv.name;
657
+          this.week.owner.surname = indiv.surname;
658
+          this.week.owner.idNumer = indiv.idNumber;
659
+          this.week.owner.companyRegNumber = indiv.companyRegNumber;
660
+          this.week.owner.emailAddress = indiv.email;
661
+          this.week.owner.cellNumber = indiv.cellNumber;
662
+          this.week.owner.landlineNumber = indiv.telephone;
663
+          console.log(this.week.owner);
664
+        }
665
+      });
666
+    },
625
     saveEdit() {
667
     saveEdit() {
626
       this.regions.forEach(region => {
668
       this.regions.forEach(region => {
627
         if (region.regionCode === this.selectedRegion) {
669
         if (region.regionCode === this.selectedRegion) {
651
         }
693
         }
652
       });
694
       });
653
       if (this.week.owner.cellNumber === "") {
695
       if (this.week.owner.cellNumber === "") {
654
-        this.week.owner.cellNumber = "0000000000";
696
+        delete this.week.owner.cellNumber;
655
       }
697
       }
656
       if (this.week.owner.telephone === "") {
698
       if (this.week.owner.telephone === "") {
657
-        this.week.owner.telephone = "0000000000";
699
+        delete this.week.owner.telephone;
658
       }
700
       }
659
       this.weekParam.arrivalDate = new Date(this.dateParam).toISOString().substring(0, 10);
701
       this.weekParam.arrivalDate = new Date(this.dateParam).toISOString().substring(0, 10);
660
       this.weekParam.departureDate = new Date(this.depDateParam).toISOString().substring(0, 10);
702
       this.weekParam.departureDate = new Date(this.depDateParam).toISOString().substring(0, 10);

Loading…
Cancel
Save