瀏覽代碼

Added Agent To edit timeshare

master
30117125 4 年之前
父節點
當前提交
1b6f2d220f
共有 1 個文件被更改,包括 47 次插入10 次删除
  1. 47
    10
      src/components/admin/status/editTimeShareAdminPage.vue

+ 47
- 10
src/components/admin/status/editTimeShareAdminPage.vue 查看文件

@@ -8,6 +8,7 @@
8 8
             <div class="section-header">
9 9
               <h2>Week Information</h2>
10 10
             </div>
11
+            {{ weekParam }}
11 12
             <div align="left" class="custom-control custom-switch mb-2">
12 13
               <div class="row">
13 14
                 <div align="center" class="col"></div>
@@ -142,7 +143,9 @@
142 143
                       id="season"
143 144
                       v-model="selectedSeason"
144 145
                     >
145
-                      <option v-for="(season, r) in seasons" :key="r">{{ season.name }}</option>
146
+                      <option :value="season.name" v-for="(season, r) in seasons" :key="r">{{
147
+                        season.name
148
+                      }}</option>
146 149
                     </select>
147 150
                   </float-label>
148 151
 
@@ -459,6 +462,35 @@
459 462
             <div class="section-header" style="margin-top:50px">
460 463
               <h2>Week Agent</h2>
461 464
             </div>
465
+            <div class="row">
466
+              <div class="col-md-6">
467
+                <label for="Name of Agency">Agency</label>
468
+                <select
469
+                  class="form-control uniSelect"
470
+                  id="Agency"
471
+                  name="agency"
472
+                  v-model="weekParam.agencyId"
473
+                >
474
+                  <option v-for="(item, i) in agencies" :key="i" :value="item.id">{{
475
+                    item.agencyName
476
+                  }}</option>
477
+                </select>
478
+              </div>
479
+              <div class="col-md-6">
480
+                <label for="Name of Agent">Agent</label>
481
+                <select
482
+                  class="form-control uniSelect"
483
+                  id="agent"
484
+                  name="agent"
485
+                  v-model="weekParam.agentId"
486
+                  :disabled="!weekParam.agencyId"
487
+                >
488
+                  <option v-for="(item, i) in displayNotDeletedAgents" :key="i" :value="item.id">
489
+                    <div>{{ item.name + " " + item.surname }}</div>
490
+                  </option>
491
+                </select>
492
+              </div>
493
+            </div>
462 494
             <div v-if="!boolAwaitingPayment">
463 495
               <div class="section-header">
464 496
                 <h2>Publish Timeshare Week</h2>
@@ -678,6 +710,17 @@ export default {
678 710
     },
679 711
     isLoggedIn() {
680 712
       return this.user && this.person;
713
+    },
714
+    displayNotDeletedAgents() {
715
+      var notDeletedArr = [];
716
+      this.agents.forEach(agent => {
717
+        if (!agent.isDeleted) {
718
+          if (agent.agencyId === this.weekParam.agencyId) {
719
+            notDeletedArr.push(agent);
720
+          }
721
+        }
722
+      });
723
+      return notDeletedArr;
681 724
     }
682 725
   },
683 726
   methods: {
@@ -720,11 +763,9 @@ export default {
720 763
           this.weekParam.resortName = resort.resortName;
721 764
         }
722 765
       });
723
-      this.seasons.forEach(season => {
724
-        if (season.name === this.selectedSeason.name) {
725
-          this.weekParam.season = season.name;
726
-        }
727
-      });
766
+      console.log(this.selectedSeason);
767
+      this.weekParam.season = this.selectedSeason;
768
+
728 769
       this.resortBedrooms.forEach(bedroom => {
729 770
         if (bedroom === this.selectedBedrooms) {
730 771
           this.weekParam.bedroom = bedroom;
@@ -747,10 +788,6 @@ export default {
747 788
       if (this.pubDateParam) {
748 789
         this.weekParam.pulbishedDate = new Date(this.pubDateParam).toISOString().substring(0, 19);
749 790
       }
750
-
751
-      //this.weekParam.regionId = this.weekParam.region.id;
752
-      this.weekParam.agentId = this.week.agentId;
753
-      //this.weekParam.bankedWith = this.week.bankedWith;
754 791
       this.weekParam.owner = this.week.owner;
755 792
       this.weekParam.askingPrice = this.week.askingPrice;
756 793
       this.weekParam.module = this.week.module;

Loading…
取消
儲存