2 Revīzijas

Autors SHA1 Ziņojums Datums
  Lene 0e50526ad0 Merge branch 'master' of http://provision-sa.co.za:3000/Provision/UnivateProperties 4 gadus atpakaļ
  Lene 578648fe22 Edit timeshare weeks 4 gadus atpakaļ

+ 58
- 33
src/components/admin/status/editTimeShareAdminPage.vue Parādīt failu

20
               <div class="form-row">
20
               <div class="form-row">
21
                 <div class="form-group col-md-6">
21
                 <div class="form-group col-md-6">
22
                   <div class="input-group">
22
                   <div class="input-group">
23
-                    <label v-if="!selectedRegion" class="uniSelectLabel" for="weekInfoRegionSelect"
24
-                      >REGION</label
25
-                    >
23
+                    <label
24
+                      v-if="!selectedRegion"
25
+                      class="uniSelectLabel"
26
+                      for="weekInfoRegionSelect"
27
+                    >REGION</label>
26
                   </div>
28
                   </div>
27
                   <float-label label="REGION" fixed>
29
                   <float-label label="REGION" fixed>
28
                     <select
30
                     <select
30
                       v-model="selectedRegion"
32
                       v-model="selectedRegion"
31
                       style="font-size: 15px"
33
                       style="font-size: 15px"
32
                     >
34
                     >
33
-                      <option v-for="(region, r) in regions" :key="r" :value="region.regionCode">{{
35
+                      <option v-for="(region, r) in regions" :key="r" :value="region.regionCode">
36
+                        {{
34
                         region.regionName
37
                         region.regionName
35
-                      }}</option>
38
+                        }}
39
+                      </option>
36
                     </select>
40
                     </select>
37
                   </float-label>
41
                   </float-label>
38
 
42
 
49
                           v-for="(resort, r) in filteredResort"
53
                           v-for="(resort, r) in filteredResort"
50
                           :key="r"
54
                           :key="r"
51
                           :value="resort.resortCode"
55
                           :value="resort.resortCode"
52
-                          >{{ resort.resortName }}</option
53
-                        >
56
+                        >{{ resort.resortName }}</option>
54
                       </select>
57
                       </select>
55
                     </float-label>
58
                     </float-label>
56
 
59
 
72
                 </div>
75
                 </div>
73
                 <div class="form-group col-md-6">
76
                 <div class="form-group col-md-6">
74
                   <div v-if="weekParam.otherResort">
77
                   <div v-if="weekParam.otherResort">
75
-                    <label v-if="!weekParam.region" class="uniSelectLabel" for="region"
76
-                      >REGION</label
77
-                    >
78
+                    <label v-if="!weekParam.region" class="uniSelectLabel" for="region">REGION</label>
78
                   </div>
79
                   </div>
79
                   <float-label>
80
                   <float-label>
80
                     <select
81
                     <select
84
                       id="region"
85
                       id="region"
85
                       v-model="weekParam.region"
86
                       v-model="weekParam.region"
86
                     >
87
                     >
87
-                      <option v-for="(region, r) in regions" :key="r">{{
88
+                      <option v-for="(region, r) in regions" :key="r">
89
+                        {{
88
                         region.regionName
90
                         region.regionName
89
-                      }}</option>
91
+                        }}
92
+                      </option>
90
                     </select>
93
                     </select>
91
                   </float-label>
94
                   </float-label>
92
                 </div>
95
                 </div>
243
                     id="customSwitch2"
246
                     id="customSwitch2"
244
                     :checked="sellItem.currentYearBanked"
247
                     :checked="sellItem.currentYearBanked"
245
                   />
248
                   />
246
-                  <label class="custom-control-label" for="customSwitch2">
247
-                    {{ sellItem.currentYearBanked ? "Yes" : "No" }}
248
-                  </label>
249
+                  <label
250
+                    class="custom-control-label"
251
+                    for="customSwitch2"
252
+                  >{{ sellItem.currentYearBanked ? "Yes" : "No" }}</label>
249
                   <div
253
                   <div
250
                     class="spacebanked1"
254
                     class="spacebanked1"
251
                     :class="{ 'spacebanked1--clicked': sellItem.currentYearBanked }"
255
                     :class="{ 'spacebanked1--clicked': sellItem.currentYearBanked }"
254
                       <label
258
                       <label
255
                         for="If yes, please confirm with whom"
259
                         for="If yes, please confirm with whom"
256
                         v-if="sellItem.currentYearBanked"
260
                         v-if="sellItem.currentYearBanked"
257
-                        >Please confirm with whom</label
258
-                      >
261
+                      >Please confirm with whom</label>
259
                     </div>
262
                     </div>
260
                     <div class="validation"></div>
263
                     <div class="validation"></div>
261
                   </div>
264
                   </div>
362
                       placeholder="Cell Number"
365
                       placeholder="Cell Number"
363
                       data-rule="minlen:4"
366
                       data-rule="minlen:4"
364
                       data-msg="Please enter your cell number"
367
                       data-msg="Please enter your cell number"
365
-                      v-model="week.owner.cellNumner"
368
+                      v-model="week.owner.cellNumber"
366
                     />
369
                     />
367
                   </float-label>
370
                   </float-label>
368
 
371
 
391
             <div class="form">
394
             <div class="form">
392
               <div class="row">
395
               <div class="row">
393
                 <div class="form-group col-md-6">
396
                 <div class="form-group col-md-6">
394
-                  <label v-if="!weekParam.weekStatus" class="uniSelectLabel" for="status"
395
-                    >STATUS</label
396
-                  >
397
+                  <label v-if="!weekParam.weekStatus" class="uniSelectLabel" for="status">STATUS</label>
397
                   <float-label label="STATUS" fixed>
398
                   <float-label label="STATUS" fixed>
398
                     <select
399
                     <select
399
                       class="form-control uniSelect"
400
                       class="form-control uniSelect"
407
                   </float-label>
408
                   </float-label>
408
                 </div>
409
                 </div>
409
                 <div class="form-group col-md-6">
410
                 <div class="form-group col-md-6">
410
-                  <label v-if="!weekParam.publish" class="uniSelectLabel" for="publish"
411
-                    >Publish</label
412
-                  >
411
+                  <label v-if="!weekParam.publish" class="uniSelectLabel" for="publish">Publish</label>
413
                   <float-label label="Publish" fixed>
412
                   <float-label label="Publish" fixed>
414
                     <select
413
                     <select
415
                       class="form-control uniSelect"
414
                       class="form-control uniSelect"
519
     this.selectedWeekType = this.weekParam.weekType;
518
     this.selectedWeekType = this.weekParam.weekType;
520
     this.selectedStatus = this.weekParam.status;
519
     this.selectedStatus = this.weekParam.status;
521
     this.selectedPublish = this.weekParam.publish;
520
     this.selectedPublish = this.weekParam.publish;
522
-    var date = new Date(this.weekParam.arrivalDate).toISOString().substring(0, 10);
521
+    var date = new Date(this.weekParam.arrivalDate)
522
+      .toISOString()
523
+      .substring(0, 10);
523
     this.dateParam = date;
524
     this.dateParam = date;
524
-    var depDate = new Date(this.weekParam.departureDate).toISOString().substring(0, 10);
525
+    var depDate = new Date(this.weekParam.departureDate)
526
+      .toISOString()
527
+      .substring(0, 10);
525
     this.depDateParam = depDate;
528
     this.depDateParam = depDate;
526
-    var datePub = new Date(this.weekParam.publish).toISOString().substring(0, 10);
529
+    var datePub = new Date(this.weekParam.publish)
530
+      .toISOString()
531
+      .substring(0, 10);
527
     this.pubDateParam = datePub;
532
     this.pubDateParam = datePub;
528
   },
533
   },
529
   created() {
534
   created() {
557
     },
562
     },
558
     filteredResort() {
563
     filteredResort() {
559
       let list = [];
564
       let list = [];
560
-      if (this.sellItem && this.sellItem.region && this.sellItem.region.regionCode) {
565
+      if (
566
+        this.sellItem &&
567
+        this.sellItem.region &&
568
+        this.sellItem.region.regionCode
569
+      ) {
561
         const item = this.detailedRegion.find(
570
         const item = this.detailedRegion.find(
562
           region => region.region.regionCode === this.sellItem.region.regionCode
571
           region => region.region.regionCode === this.sellItem.region.regionCode
563
         );
572
         );
575
   },
584
   },
576
   methods: {
585
   methods: {
577
     ...mapActions("individual", ["getIndividual"]),
586
     ...mapActions("individual", ["getIndividual"]),
578
-    ...mapActions("timeshare", ["initTimeshare", "onResortChange", "saveWeek", "getBlankWeek"]),
587
+    ...mapActions("timeshare", [
588
+      "initTimeshare",
589
+      "onResortChange",
590
+      "saveWeek",
591
+      "getBlankWeek"
592
+    ]),
579
     ...mapActions("payment", ["addPayment"]),
593
     ...mapActions("payment", ["addPayment"]),
580
     ...mapActions("bank", ["getBanks"]),
594
     ...mapActions("bank", ["getBanks"]),
581
     ...mapActions("myWeeks", ["getItems", "getWeek", "editSave"]),
595
     ...mapActions("myWeeks", ["getItems", "getWeek", "editSave"]),
609
           this.weekParam.maxSleep = sleepMax;
623
           this.weekParam.maxSleep = sleepMax;
610
         }
624
         }
611
       });
625
       });
612
-      this.weekParam.arrivalDate = new Date(this.dateParam).toISOString().substring(0, 10);
613
-      this.weekParam.departureDate = new Date(this.depDateParam).toISOString().substring(0, 10);
614
-      this.weekParam.publishedDate = new Date(this.pubDateParam).toISOString().substring(0, 10);
626
+      if (this.week.owner.cellNumber === "") {
627
+        this.week.owner.cellNumber = "0000000000";
628
+      }
629
+      this.weekParam.arrivalDate = new Date(this.dateParam)
630
+        .toISOString()
631
+        .substring(0, 10);
632
+      this.weekParam.departureDate = new Date(this.depDateParam)
633
+        .toISOString()
634
+        .substring(0, 10);
635
+      this.weekParam.publishedDate = new Date(this.pubDateParam)
636
+        .toISOString()
637
+        .substring(0, 10);
615
       this.weekParam.regionId = this.weekParam.region.id;
638
       this.weekParam.regionId = this.weekParam.region.id;
616
       this.weekParam.agentId = this.week.agentId;
639
       this.weekParam.agentId = this.week.agentId;
617
       this.weekParam.bankedWith = this.week.bankedWith;
640
       this.weekParam.bankedWith = this.week.bankedWith;
623
       delete this.weekParam.agency;
646
       delete this.weekParam.agency;
624
       delete this.weekParam.agent;
647
       delete this.weekParam.agent;
625
       delete this.status;
648
       delete this.status;
626
-      console.log(this.weekParam);
649
+      delete this.weekParam.owner.howMarried;
650
+      delete this.weekParam.cellNumber;
651
+      console.log(JSON.stringify(this.weekParam));
627
       this.editSave(this.weekParam);
652
       this.editSave(this.weekParam);
628
     },
653
     },
629
     resortChange() {
654
     resortChange() {

+ 1
- 1
src/store/modules/timeshare/myWeeks.js Parādīt failu

71
       axios
71
       axios
72
         .put(`/api/timeshareweek`, week)
72
         .put(`/api/timeshareweek`, week)
73
         .then(r => {
73
         .then(r => {
74
-          commit("updateItem", r.data);
74
+          commit("setItem", r.data);
75
         })
75
         })
76
         .catch(console.error);
76
         .catch(console.error);
77
     }
77
     }

Notiek ielāde…
Atcelt
Saglabāt