Kaynağa Gözat

Merge Conflicts

master
Lene Scholtz 5 yıl önce
ebeveyn
işleme
b4becc221b
34 değiştirilmiş dosya ile 1187 ekleme ve 504 silme
  1. 28
    8
      src/App.vue
  2. 4
    1
      src/assets/Log.js
  3. 1
    0
      src/components/admin/misc/carousel.vue
  4. 98
    0
      src/components/admin/misc/carouselList.vue
  5. 6
    3
      src/components/communication/templateDetail.vue
  6. 13
    7
      src/components/communication/templatePage.vue
  7. 13
    1
      src/components/home/carouselSection.vue
  8. 1
    1
      src/components/processFlow/makeOffer.vue
  9. 2
    9
      src/components/property/propertyCreate.vue
  10. 35
    17
      src/components/property/propertyFieldEditor.vue
  11. 5
    1
      src/components/property/propertyImage.vue
  12. 0
    7
      src/components/property/propertyUserField.vue
  13. 342
    125
      src/components/property/propertyeditPage.vue
  14. 11
    11
      src/components/shared/alert.vue
  15. 43
    8
      src/components/shared/listView.vue
  16. 2
    1
      src/components/shared/navBar.vue
  17. 1
    1
      src/components/shared/searchTab.vue
  18. 2
    3
      src/components/timeshare/buy/buyPage.vue
  19. 2
    1
      src/components/timeshare/buy/weekListComponent.vue
  20. 25
    10
      src/components/timeshare/myWeeksPage.vue
  21. 19
    6
      src/components/timeshare/resort/unitPage.vue
  22. 7
    1
      src/components/timeshare/sell/sellPage.vue
  23. 6
    0
      src/components/user/loginPage.vue
  24. 220
    203
      src/router/index.js
  25. 6
    2
      src/store/index.js
  26. 31
    0
      src/store/modules/misc/carousel.js
  27. 3
    3
      src/store/modules/property/property.js
  28. 143
    0
      src/store/modules/property/propertyEdit.js
  29. 16
    0
      src/store/modules/searchTab.js
  30. 17
    2
      src/store/modules/timeshare/myWeeks.js
  31. 48
    42
      src/store/modules/timeshare/region.js
  32. 20
    22
      src/store/modules/timeshare/timeshare.js
  33. 6
    7
      src/store/modules/timeshare/week.js
  34. 11
    1
      src/store/modules/timeshare/weekList.js

+ 28
- 8
src/App.vue Dosyayı Görüntüle

@@ -36,6 +36,10 @@ export default {
36 36
 hr {
37 37
   background-color: #60cbeb;
38 38
 }
39
+.my-btn {
40
+  margin: 2px;
41
+  color: #60cbeb;
42
+}
39 43
 .title-img {
40 44
   width: 800px;
41 45
   height: 400px;
@@ -54,6 +58,22 @@ hr {
54 58
   fill: #60cbeb;
55 59
   color: #60cbeb;
56 60
 }
61
+.mySuccess {
62
+  border-color: rgba(2, 184, 117, 0.5);
63
+  background-color: rgba(2, 184, 117, 0.5);
64
+}
65
+.myInfo {
66
+  border-color: rgba(23, 162, 184, 0.5);
67
+  background-color: rgba(23, 162, 184, 0.5);
68
+}
69
+.myWarning {
70
+  border-color: rgba(240, 173, 78, 0.5);
71
+  background-color: rgba(240, 173, 78, 0.5);
72
+}
73
+.myError {
74
+  border-color: rgba(217, 83, 79, 0.5);
75
+  background-color: rgba(217, 83, 79, 0.5);
76
+}
57 77
 a {
58 78
   cursor: pointer;
59 79
 }
@@ -70,14 +90,14 @@ a:hover {
70 90
 .cursor-pointer {
71 91
   cursor: pointer;
72 92
 }
73
-    body,
74
-    html {
75
-        font-size: 13.7px !important;
76
-        color: #666;
77
-        font-family: "Roboto", sans-serif;
78
-        height: 100%;
79
-        margin: 0;
80
-    }
93
+body,
94
+html {
95
+  font-size: 13.7px !important;
96
+  color: #666;
97
+  font-family: "Roboto", sans-serif;
98
+  height: 100%;
99
+  margin: 0;
100
+}
81 101
 </style>
82 102
 
83 103
 <style scoped>

+ 4
- 1
src/assets/Log.js Dosyayı Görüntüle

@@ -48,7 +48,10 @@ const items = {
48 48
     return localStorage.getItem('token') !== undefined && localStorage.getItem('token') !== null;
49 49
   },
50 50
   getUser() {
51
-    return localStorage.getItem('user');
51
+    return localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {};
52
+  },
53
+  getPerson() {
54
+    return localStorage.getItem('person') ? JSON.parse(localStorage.getItem('person')) : {};
52 55
   },
53 56
 };
54 57
 export default items;

+ 1
- 0
src/components/admin/misc/carousel.vue Dosyayı Görüntüle

@@ -0,0 +1 @@
1
+<!-- Work in Progress -->

+ 98
- 0
src/components/admin/misc/carouselList.vue Dosyayı Görüntüle

@@ -0,0 +1,98 @@
1
+<template>
2
+  <!-- eslint-disable max-len -->
3
+  <div>
4
+    <div class="container">
5
+      <!-- <section class="intro-single"> -->
6
+      <div class="container">
7
+        <br />
8
+        <br />
9
+        <div class="row">
10
+          <div class="col-md-12 col-lg-8">
11
+            <!-- <div class="title-single-box"> -->
12
+            <!-- <h1 class="title-single">Property Types</h1> -->
13
+            <!-- </div> -->
14
+            <div class="title-box-d">
15
+              <h1 class="title-d" style="text-align:left; font-size: 250%">Carousel Items</h1>
16
+            </div>
17
+            <br />
18
+          </div>
19
+        </div>
20
+      </div>
21
+      <!-- </section> -->
22
+    </div>
23
+    <div class="container">
24
+      <button type="button" @click="New()" class="btn btn-b-n" style="width: 85px; height:40px;">New</button>
25
+    </div>
26
+    <div class="container">
27
+      <table class="table table-bordered">
28
+        <thead>
29
+          <tr>
30
+            <th>Image</th>
31
+            <th>Header</th>
32
+            <th>Type</th>
33
+            <th></th>
34
+            <th></th>
35
+          </tr>
36
+        </thead>
37
+        <tbody>
38
+          <tr v-for="(item, i) in carouselList" :key="i">
39
+            <td>
40
+              <img :src="item.image" style="height:100px; width:100px; object-fit: cover;" />
41
+            </td>
42
+            <td>{{ item.header }}</td>
43
+            <td v-if="item.propertyId">Property</td>
44
+            <td v-else>Timeshare Week</td>
45
+            <td>
46
+              <button
47
+                type="button"
48
+                @click="Edit(item.id)"
49
+                class="btn"
50
+                style="margin:2px; color: #60CBEB"
51
+              >Edit</button>
52
+            </td>
53
+            <td>
54
+              <button
55
+                type="button"
56
+                @click="Delete(item.id)"
57
+                class="btn"
58
+                style="margin:2px; color: #60CBEB"
59
+              >Delete</button>
60
+            </td>
61
+          </tr>
62
+        </tbody>
63
+      </table>
64
+    </div>
65
+    <br />
66
+  </div>
67
+</template>
68
+
69
+<script>
70
+import { mapState, mapActions } from 'vuex';
71
+
72
+export default {
73
+  name: 'CarouselList',
74
+  data() {
75
+    return {};
76
+  },
77
+  methods: {
78
+    ...mapActions('carousel', ['getCarouselList', 'deleteCarousel']),
79
+    New() {
80
+      this.$router.push('/carousel/details/0');
81
+    },
82
+    Edit(itemID) {
83
+      this.$router.push({
84
+        path: `/carousel/details/${itemID}`,
85
+      });
86
+    },
87
+    Delete(id) {
88
+      this.deleteCarousel(id);
89
+    },
90
+  },
91
+  mounted() {
92
+    this.getCarouselList();
93
+  },
94
+  computed: {
95
+    ...mapState('carousel', ['carouselList']),
96
+  },
97
+};
98
+</script>

+ 6
- 3
src/components/communication/templateDetail.vue Dosyayı Görüntüle

@@ -1,6 +1,9 @@
1 1
 <template>
2 2
   <div style="padding:10px;">
3
-    <div class="container" style="background-color:rgba(215,215,215,0.75);padding:20px;">
3
+    <div
4
+      class="container"
5
+      style="border:silver solid thin;border-radius:10px;background-color:rgba(235,235,235,0.75);padding:20px;"
6
+    >
4 7
       <div class="row">
5 8
         <div class="col-md-12">
6 9
           <div class="d-flex">
@@ -85,7 +88,7 @@
85 88
           <div
86 89
             class="tab-content"
87 90
             id="myTabContent"
88
-            style="background-color:rgba(255,255,255,0.75);padding:10px;"
91
+            style="background-color:rgba(255,255,255,0.75);padding:10px;border:silver solid thin;border-radius:10px;"
89 92
           >
90 93
             <div
91 94
               class="tab-pane fade show active"
@@ -139,7 +142,7 @@
139 142
         <div
140 143
           class="col-md-12"
141 144
           v-if="showNew"
142
-          style="background-color:rgba(255,255,255,1); border-radius:5px;padding:10px;"
145
+          style="background-color:rgba(255,255,255,0.75); border:silver solid thin;border-radius:10px;padding:10px;padding:10px 30px;"
143 146
         >
144 147
           <TemplateInnerItem />
145 148
         </div>

+ 13
- 7
src/components/communication/templatePage.vue Dosyayı Görüntüle

@@ -1,11 +1,16 @@
1 1
 <template>
2
-  <div>
3
-    <br />
4
-    <hr />
5
-    <hr />
6
-    <hr />
7
-    <hr />
8
-    <hr />
2
+  <div class="container-fluid" style="margin-top:25px;">
3
+    <div class="row">
4
+      <div class="col-md-1"></div>
5
+      <div class="col-md-10">
6
+        <div class>
7
+          <h3 class="sinse-title">Email Templates</h3>
8
+        </div>
9
+      </div>
10
+      <div class="col-md-12">
11
+        <hr />
12
+      </div>
13
+    </div>
9 14
     <div class="row">
10 15
       <div :class="listClass">
11 16
         <ListView :items="list" @onRowClick="onRowClick" />
@@ -14,6 +19,7 @@
14 19
         <DetailView :item="detailItem" />
15 20
       </div>
16 21
     </div>
22
+
17 23
     <hr />
18 24
   </div>
19 25
 </template>

+ 13
- 1
src/components/home/carouselSection.vue Dosyayı Görüntüle

@@ -98,5 +98,17 @@
98 98
   </div>
99 99
 </template>
100 100
 <script>
101
-export default {};
101
+import { mapState, mapActions } from 'vuex';
102
+
103
+export default {
104
+  methods: {
105
+    ...mapActions('carousel', ['getCarouselList']),
106
+  },
107
+  mounted() {
108
+    this.getCarouselList();
109
+  },
110
+  computed: {
111
+    ...mapState('carousel', ['carouselList']),
112
+  },
113
+};
102 114
 </script>

+ 1
- 1
src/components/processFlow/makeOffer.vue Dosyayı Görüntüle

@@ -21,7 +21,7 @@
21 21
         <div class="form-group row">
22 22
           <div class="col-md-6 col-lg-5 section-md-t3">
23 23
             <div class="title-box-d">
24
-              <h3 class="title-d">{{ item ? item.resortName : '' }}</h3>
24
+              <h3 class="title-d">{{ item ? item.resort.resortName : '' }}</h3>
25 25
             </div>
26 26
           </div>
27 27
         </div>

+ 2
- 9
src/components/property/propertyCreate.vue Dosyayı Görüntüle

@@ -21,7 +21,7 @@
21 21
           />
22 22
         </div>
23 23
         <div class="sinse-box" style="opacity:0.7; border: white solid 3px; border-radius: 15px">
24
-          <h3 class="sinse-title">List {{ propertyType }} {{ salesType }} Property CREATE PAGE</h3>
24
+          <h3 class="sinse-title">List {{ propertyType }} {{ salesType }} Property</h3>
25 25
         </div>
26 26
       </div>
27 27
       <br />
@@ -349,13 +349,6 @@
349 349
               class="btn btn-b-n"
350 350
               style="width: 85px; height:40px;"
351 351
             >Save</button>
352
-            <button
353
-              v-if="isEdit"
354
-              type="button"
355
-              @click="Close()"
356
-              class="btn btn-b-n"
357
-              style="width: 85px; height:40px;"
358
-            >Close</button>
359 352
             <div v-if="wait" id="preloader"></div>
360 353
           </form>
361 354
         </div>
@@ -372,7 +365,7 @@ import UserField from './propertyUserField.vue';
372 365
 import ImageLoad from './propertyImage.vue';
373 366
 
374 367
 export default {
375
-  name: 'PropertyEdit',
368
+  name: 'PropertyCreate',
376 369
   components: {
377 370
     UserField,
378 371
     ImageLoad,

+ 35
- 17
src/components/property/propertyFieldEditor.vue Dosyayı Görüntüle

@@ -1,4 +1,5 @@
1 1
 <template>
2
+  <!-- eslint-disable max-len -->
2 3
   <div>
3 4
     <div>
4 5
       <div v-if="!edit" class="input-group-prepend">
@@ -10,7 +11,7 @@
10 11
           v-model="display"
11 12
           disabled
12 13
         />
13
-        <span @click="EditClick()" class="input-group-text" style="color: #60CBEB">
14
+        <span v-if="mayEdit" @click="EditClick()" class="input-group-text" style="color: #60CBEB">
14 15
           <eva-icon name="edit-outline" fill="#60CBEB"></eva-icon>
15 16
         </span>
16 17
       </div>
@@ -22,7 +23,7 @@
22 23
           type="text"
23 24
           name="currentField.name"
24 25
           id="currentField.id"
25
-          v-model="display"
26
+          v-model="updatedDisplay"
26 27
         />
27 28
         <!-- Number -->
28 29
         <input
@@ -31,7 +32,7 @@
31 32
           type="number"
32 33
           name="currentField.name"
33 34
           id="currentField.id"
34
-          v-model="display"
35
+          v-model="updatedDisplay"
35 36
         />
36 37
         <!-- Selector -->
37 38
         <select
@@ -40,7 +41,7 @@
40 41
           v-model="selectorSelection"
41 42
           @change="SelectorSelected"
42 43
         >
43
-          <option value="0">Please select type</option>
44
+          <option value="0"></option>
44 45
           <option v-for="item in arrayObject" :value="item.id" :key="item.id">{{ item.description }}</option>
45 46
         </select>
46 47
         <!-- yesno -->
@@ -49,7 +50,7 @@
49 50
           <option value="yes">Yes</option>
50 51
           <option value="no">No</option>
51 52
         </select>
52
-        <span @click="Save()" class="input-group-text" style="color: #60CBEB">
53
+        <span @click="UpdateValue()" class="input-group-text" style="color: #60CBEB">
53 54
           <eva-icon name="checkmark-outline" fill="#60CBEB"></eva-icon>
54 55
         </span>
55 56
         <span @click="Close()" class="input-group-text" style="color: #60CBEB">
@@ -65,46 +66,63 @@ export default {
65 66
   name: 'propertyFieldEdit',
66 67
   props: {
67 68
     display: String,
68
-    arrayObject: [],
69
+    arrayObject: { type: Array, default: () => [] },
69 70
     canEdit: Boolean,
70 71
     editType: String,
72
+    propertyName: String,
73
+    propertyId: Number,
74
+    userDefinedId: Number,
75
+    isUDF: Boolean,
76
+    isPropOverview: Boolean,
77
+    arrayIndex: Number,
78
+    arrayItemIndex: Number,
79
+    mayEdit: Boolean,
71 80
   },
72 81
   data() {
73 82
     return {
74 83
       edit: false,
75 84
       selectorSelection: Object,
85
+      updatedDisplay: '',
76 86
     };
77 87
   },
78 88
   methods: {
79 89
     EditClick() {
80 90
       this.edit = true;
81 91
     },
82
-    Save() {
83
-      this.edit = false;
84
-
85
-      // Need to emit the parent controller
86
-    },
87 92
     Close() {
88 93
       this.edit = false;
89 94
     },
90 95
     SelectorSelected(item) {
91 96
       if (item.target.options.selectedIndex > 0) {
92
-        this.display = this.arrayObject[
97
+        this.updatedDisplay = this.arrayObject[
93 98
           item.target.options.selectedIndex - 1
94 99
         ].description;
95
-        console.log(
96
-          this.arrayObject[item.target.options.selectedIndex - 1].description,
97
-        );
98 100
       }
99 101
     },
100 102
     YesNoSelected(item) {
101 103
       if (item.target.options.selectedIndex === 1) {
102
-        this.display = 'Yes';
104
+        this.updatedDisplay = 'Yes';
103 105
       }
104 106
       if (item.target.options.selectedIndex === 2) {
105
-        this.display = 'No';
107
+        this.updatedDisplay = 'No';
106 108
       }
107 109
     },
110
+    UpdateValue() {
111
+      this.edit = false;
112
+      this.$emit('UpdateValue', {
113
+        fieldName: this.propertyName,
114
+        value: this.updatedDisplay,
115
+        propertyId: this.propertyId,
116
+        userDefinedId: this.userDefinedId,
117
+        isUDF: this.isUDF,
118
+        isPropOverview: this.isPropOverview,
119
+        arrayIndex: this.arrayIndex,
120
+        arrayItemIndex: this.arrayItemIndex,
121
+      });
122
+    },
123
+  },
124
+  mounted() {
125
+    this.updatedDisplay = this.display;
108 126
   },
109 127
 };
110 128
 </script>

+ 5
- 1
src/components/property/propertyImage.vue Dosyayı Görüntüle

@@ -11,6 +11,7 @@
11 11
           name="images[]"
12 12
           @change="imagesAdd"
13 13
           multiple
14
+          :disabled="!mayEdit"
14 15
         />
15 16
       </label>
16 17
     </div>
@@ -21,7 +22,9 @@
21 22
         <label for="checkbox" style="margin: 10px;">Main Image</label>
22 23
         <img :src="img" style="height:200px; width:150px; object-fit: cover;" />
23 24
         <br />
24
-        <a class="fa fa-times del" @click="removeImage(key)" />
25
+        <span class="input-group-text" align="center" @click="removeImage(key)">
26
+          <eva-icon name="trash-2-outline" fill="#60CBEB"></eva-icon>Delete
27
+        </span>
25 28
       </div>
26 29
       <br />
27 30
     </div>
@@ -32,6 +35,7 @@
32 35
 export default {
33 36
   props: {
34 37
     loadedImages: Function,
38
+    mayEdit: { type: Boolean, default: () => true },
35 39
   },
36 40
   data() {
37 41
     return {

+ 0
- 7
src/components/property/propertyUserField.vue Dosyayı Görüntüle

@@ -65,12 +65,5 @@ export default {
65 65
       return '';
66 66
     },
67 67
   },
68
-  // Testing editing
69
-  // created() {
70
-  //   this.setFields = [];
71
-  //   for (let i = 0; i < this.fields.length; i++) {
72
-  //     this.setFields[i] = this.fields[i].value;
73
-  //   }
74
-  // },
75 68
 };
76 69
 </script>

+ 342
- 125
src/components/property/propertyeditPage.vue Dosyayı Görüntüle

@@ -53,49 +53,117 @@
53 53
                 </div>
54 54
               </div>
55 55
             </div>
56
+            <div class="form-group row">
57
+              <div class="col-md-4">
58
+                <label>Sale Type</label>
59
+                <propField
60
+                  :display="property.isSale ? 'Sale' : 'Rental'"
61
+                  :editType="'selector'"
62
+                  :arrayObject="salesTypeArr"
63
+                  :propertyName="'isSale'"
64
+                  :mayEdit="mayEdit"
65
+                  @UpdateValue="UpdateValue"
66
+                />
67
+              </div>
68
+            </div>
56 69
             <div class="form-group row">
57 70
               <div class="col-md-4">
58 71
                 <label>Property Type</label>
59 72
                 <propField
60
-                  :display="property.propertyType.description"
61
-                  :editType="'Selector'"
73
+                  :display="property.propertyType ? property.propertyType.description : ''"
74
+                  :editType="'selector'"
62 75
                   :arrayObject="propertyTypes"
76
+                  :propertyName="'propertyType'"
77
+                  :mayEdit="mayEdit"
78
+                  @UpdateValue="UpdateValue"
63 79
                 />
64 80
               </div>
65 81
               <div v-if="propertyType === 'Commercial'" class="col-md-4">
66 82
                 <label>Property Name</label>
67
-                <propField :display="property.proeprtyName" :editType="'text'" />
83
+                <propField
84
+                  :display="property.propertyName"
85
+                  :editType="'text'"
86
+                  :propertyName="'propertyName'"
87
+                  :mayEdit="mayEdit"
88
+                  @UpdateValue="UpdateValue"
89
+                />
68 90
               </div>
69 91
               <div v-if="propertyType === 'Commercial'" class="col-md-4">
70 92
                 <label>Unit</label>
71
-                <propField :label="'Property Type'" :display="property.unit" :editType="'text'" />
93
+                <propField
94
+                  :label="'Property Type'"
95
+                  :display="property.unit"
96
+                  :editType="'text'"
97
+                  :propertyName="'unit'"
98
+                  :mayEdit="mayEdit"
99
+                  @UpdateValue="UpdateValue"
100
+                />
72 101
               </div>
73 102
             </div>
74 103
             <div class="form-group row">
75 104
               <div class="col-md-6" style="margin-bottom: 1em">
76 105
                 <label>Street Number</label>
77
-                <propField :display="property.addressLine1" :editType="'text'" />
106
+                <propField
107
+                  :display="property.addressLine1"
108
+                  :editType="'text'"
109
+                  :propertyName="'addressLine1'"
110
+                  :mayEdit="mayEdit"
111
+                  @UpdateValue="UpdateValue"
112
+                />
78 113
               </div>
79 114
               <div class="col-md-6" style="margin-bottom: 1em">
80 115
                 <label>Street Name</label>
81
-                <propField :display="property.addressLine2" :editType="'text'" />
116
+                <propField
117
+                  :display="property.addressLine2"
118
+                  :editType="'text'"
119
+                  :propertyName="'addressLine2'"
120
+                  :mayEdit="mayEdit"
121
+                  @UpdateValue="UpdateValue"
122
+                />
82 123
               </div>
83 124
               <div class="col-md-6" style="margin-bottom: 1em">
84 125
                 <label>Province</label>
85
-                <propField :display="property.province.description" :editType="'selector'" />
126
+                <propField
127
+                  :display="property.province ? property.province.description : ''"
128
+                  :editType="'selector'"
129
+                  :arrayObject="provinces"
130
+                  :propertyName="'province'"
131
+                  :mayEdit="mayEdit"
132
+                  @UpdateValue="UpdateValue"
133
+                />
86 134
               </div>
87 135
 
88 136
               <div class="col-md-6" style="margin-bottom: 1em">
89 137
                 <label>City</label>
90
-                <propField :display="property.city.description" :editType="'selector'" />
138
+                <propField
139
+                  :display="property.city ? property.city.description : ''"
140
+                  :editType="'selector'"
141
+                  :arrayObject="cities"
142
+                  :propertyName="'city'"
143
+                  :mayEdit="mayEdit"
144
+                  @UpdateValue="UpdateValue"
145
+                />
91 146
               </div>
92 147
               <div class="col-md-6" style="margin-bottom: 1em">
93 148
                 <label>Suburb</label>
94
-                <propField :display="property.suburb.description" :editType="'selector'" />
149
+                <propField
150
+                  :display="property.suburb ? property.suburb.description : ''"
151
+                  :editType="'selector'"
152
+                  :arrayObject="suburbs"
153
+                  :propertyName="'suburb'"
154
+                  :mayEdit="mayEdit"
155
+                  @UpdateValue="UpdateValue"
156
+                />
95 157
               </div>
96 158
               <div class="col-md-6" style="margin-bottom: 1em">
97 159
                 <label>Postal Code</label>
98
-                <propField :display="property.addressLine3" :editType="'text'" />
160
+                <propField
161
+                  :display="property.addressLine3"
162
+                  :editType="'text'"
163
+                  :propertyName="'addressLine3'"
164
+                  :mayEdit="mayEdit"
165
+                  @UpdateValue="UpdateValue"
166
+                />
99 167
               </div>
100 168
             </div>
101 169
 
@@ -103,11 +171,24 @@
103 171
               <div class="col-md-6">
104 172
                 <label v-if="salesType === 'Rental'">Rental Price</label>
105 173
                 <label v-if="salesType !== 'Rental'">Sales Price</label>
106
-                <propField :display="property.price" :editType="'number'" />
174
+                <propField
175
+                  :display="String(property.price)"
176
+                  :editType="'number'"
177
+                  :propertyName="'price'"
178
+                  :mayEdit="mayEdit"
179
+                  @UpdateValue="UpdateValue"
180
+                />
107 181
               </div>
108 182
               <div class="col-md-6" v-if="salesType === 'Rental'">
109 183
                 <label>Per</label>
110
-                <propField :display="property.pricePer" :editType="'text'" />
184
+                <propField
185
+                  :display="property.pricePer"
186
+                  :editType="'selector'"
187
+                  :propertyName="'pricePer'"
188
+                  :arrayObject="pricePerArr"
189
+                  :mayEdit="mayEdit"
190
+                  @UpdateValue="UpdateValue"
191
+                />
111 192
               </div>
112 193
             </div>
113 194
             <div class="form-group row">
@@ -123,14 +204,24 @@
123 204
               class="col-md-6"
124 205
               v-if="propertyType === 'Residential' & propertyOverviewFields.length > 0"
125 206
             >
126
-              <div v-for="item in propertyOverviewFields[0].fields" :key="item.id">
207
+              <div v-for="(item, i) in propertyOverviewFields[0].fields" :key="item.id">
127 208
                 <label>{{ item.name }}</label>
128
-                <propField :display="item.value" :editType="item.type" />
209
+                <propField
210
+                  :display="item.value"
211
+                  :editType="item.type"
212
+                  :propertyId="item.itemID"
213
+                  :userDefinedId="item.id"
214
+                  :isUDF="Boolean('true')"
215
+                  :isPropOverview="Boolean('true')"
216
+                  :mayEdit="mayEdit"
217
+                  :arrayIndex="i"
218
+                  @UpdateValue="UpdateValue"
219
+                />
129 220
               </div>
130 221
             </div>
131 222
 
132 223
             <div class="form-group row" />
133
-            <div v-for="group in propertyFields" :key="group.id">
224
+            <div v-for="(group, i) in propertyFields" :key="group.id">
134 225
               <div class="row">
135 226
                 <div class="col-sm-12">
136 227
                   <div class="title-box-d">
@@ -138,16 +229,20 @@
138 229
                   </div>
139 230
                 </div>
140 231
               </div>
141
-              <div v-for="field in group.fields" :key="field.id">
232
+              <div v-for="(field, ii) in group.fields" :key="field.id">
142 233
                 <label>{{ field.name }}</label>
143
-                <propField :display="field.value" :editType="field.type" />
234
+                <propField
235
+                  :display="field.value"
236
+                  :editType="field.type"
237
+                  :propertyId="field.itemID"
238
+                  :userDefinedId="field.id"
239
+                  :isUDF="Boolean('true')"
240
+                  :arrayIndex="i"
241
+                  :arrayItemIndex="ii"
242
+                  :mayEdit="mayEdit"
243
+                  @UpdateValue="UpdateValue"
244
+                />
144 245
               </div>
145
-              <!-- <UserField
146
-                :fields="item.fields"
147
-                :id="item.name"
148
-                @UpdateUserDefinedFields="UpdateUserDefinedFields"
149
-                :fieldValues="item.fields"
150
-              />-->
151 246
             </div>
152 247
             <div class="form-group row" />
153 248
             <div class="row">
@@ -160,13 +255,25 @@
160 255
             <div class="form-group row">
161 256
               <div class="col-md-12">
162 257
                 <label>Virtual Tour (URL)</label>
163
-                <propField :display="property.virtualTour" :editType="'text'" />
258
+                <propField
259
+                  :display="property.virtualTour"
260
+                  :editType="'text'"
261
+                  :propertyName="'virtualTour'"
262
+                  :mayEdit="mayEdit"
263
+                  @UpdateValue="UpdateValue"
264
+                />
164 265
               </div>
165 266
             </div>
166 267
             <div class="form-group row">
167 268
               <div class="col-md-12">
168 269
                 <label>Video (URL)</label>
169
-                <propField :display="property.video" :editType="'text'" />
270
+                <propField
271
+                  :display="property.video"
272
+                  :editType="'text'"
273
+                  :propertyName="'video'"
274
+                  :mayEdit="mayEdit"
275
+                  @UpdateValue="UpdateValue"
276
+                />
170 277
               </div>
171 278
             </div>
172 279
             <div class="form-group row">
@@ -176,20 +283,46 @@
176 283
               </div>
177 284
             </div>
178 285
             <div class="form-group row">
179
-              <div class="col-md-6" v-for="(img, i) in propertyImages" :key="i">
180
-                <img :src="img" style="height:200px; width:150px; object-fit: cover;" />
286
+              <div class="col-md-2" v-for="(img, i) in propertyImages" :key="i">
287
+                <input
288
+                  v-if="mayEdit"
289
+                  type="checkbox"
290
+                  id="checkbox"
291
+                  v-model="img.isDefault"
292
+                  :disabled="img.isDeleted"
293
+                />
294
+                <label v-if="mayEdit" for="checkbox" style="margin: 10px;">Main Image</label>
295
+                <br />
296
+                <img
297
+                  :src="img.image"
298
+                  style="height:200px; width:150px; object-fit: cover;"
299
+                  :class="[img.isDeleted ? 'opacity' : '']"
300
+                />
301
+                <span
302
+                  v-if="!img.isDeleted && mayEdit"
303
+                  class="input-group-text"
304
+                  align="center"
305
+                  @click="DeleteImage(img)"
306
+                >
307
+                  <eva-icon name="trash-2-outline" fill="#60CBEB"></eva-icon>Delete
308
+                </span>
181 309
               </div>
182 310
             </div>
183
-            <ImageLoad :loadedImages="loadedImages" @DefaultImage="UpdateDefaultImage" />
311
+
312
+            <ImageLoad
313
+              :loadedImages="loadedImages"
314
+              @DefaultImage="UpdateDefaultImage"
315
+              :mayEdit="mayEdit"
316
+            />
184 317
             <button
185 318
               v-if="!wait"
186 319
               type="button"
187 320
               @click="SubmitData()"
188 321
               class="btn btn-b-n"
189 322
               style="width: 85px; height:40px;"
323
+              :disabled="!mayEdit"
190 324
             >Save</button>
191 325
             <button
192
-              v-if="isEdit"
193 326
               type="button"
194 327
               @click="Close()"
195 328
               class="btn btn-b-n"
@@ -221,8 +354,6 @@ export default {
221 354
     return {
222 355
       propertyType: 'Residential',
223 356
       salesType: 'Rental',
224
-      selectedProvince: '',
225
-      selectedCity: '',
226 357
       images: [],
227 358
       propertyFieldValues: [],
228 359
       defaultImage: 0,
@@ -240,115 +371,198 @@ export default {
240 371
         [{ script: 'sub' }, { script: 'super' }],
241 372
         [{ indent: '-1' }, { indent: '+1' }],
242 373
       ],
243
-      isEdit: false,
374
+      salesTypeArr: [
375
+        { id: 1, description: 'Sale' },
376
+        { id: 2, description: 'Rental' },
377
+      ],
378
+      pricePerArr: [
379
+        { id: 'Month', description: 'Month' },
380
+        { id: 'Day', description: 'Day' },
381
+      ],
244 382
     };
245 383
   },
246 384
   methods: {
247
-    ...mapActions('searchTab', ['getProvince', 'getCities', 'getSuburbs']),
248
-    ...mapActions('property', [
249
-      'getPropertyTypes',
250
-      'getPropertyOverviewFields',
251
-      'getPropertyFields',
252
-      'saveProperty',
253
-      'getProperty',
254
-      'getPropertyImages',
255
-      'clearProperty',
256
-      'clearPropertyImages',
257
-      'getPropertyEditDisplay',
258
-      'getPropertySavedOverviewFields',
259
-      'getPropertySavedFields',
385
+    ...mapActions('searchTab', [
386
+      'getProvince',
387
+      'getCities',
388
+      'getSuburbs',
389
+      'getListsForPropertyEdit',
390
+    ]),
391
+    ...mapActions('property', ['getPropertyTypes']),
392
+    ...mapActions('propertyEdit', [
260 393
       'getSavedPropertyData',
394
+      'updateProperty',
395
+      'mayEditProperty',
261 396
     ]),
397
+    UpdateValue(item) {
398
+      if (item.isUDF) {
399
+        if (item.isPropOverview) {
400
+          this.propertyOverviewFields[0].fields[item.arrayIndex].value =            item.value;
401
+        } else if (item.isPropOverview === false) {
402
+          this.propertyFields[item.arrayIndex].fields[
403
+            item.arrayItemIndex
404
+          ].value = item.value;
405
+        }
406
+      } else if (!item.isUDF) {
407
+        if (item.fieldName) {
408
+          if (item.fieldName === 'isSale') {
409
+            let isSaleValue = false;
410
+            if (item.value === 'Sale') {
411
+              isSaleValue = true;
412
+            } else isSaleValue = false;
413
+            this.property.isSale = isSaleValue;
414
+          }
415
+          if (item.fieldName === 'propertyType') {
416
+            this.property.propertyType = this.propertyTypes.find(
417
+              pt => pt.description === item.value,
418
+            );
419
+            this.property.propertyTypeId = this.property.propertyType.id;
420
+          }
421
+          if (item.fieldName === 'propertyName') {
422
+            this.property.propertyName = item.value;
423
+          }
424
+          if (item.fieldName === 'unit') {
425
+            this.property.unit = item.value;
426
+          }
427
+          if (item.fieldName === 'addressLine1') {
428
+            this.property.addressLine1 = item.value;
429
+          }
430
+          if (item.fieldName === 'addressLine2') {
431
+            this.property.addressLine2 = item.value;
432
+          }
433
+          if (item.fieldName === 'addressLine3') {
434
+            this.property.addressLine3 = item.value;
435
+          }
436
+          if (item.fieldName === 'province') {
437
+            if (item.value !== '') {
438
+              this.property.province = this.provinces.find(
439
+                p => p.description === item.value,
440
+              );
441
+              this.property.provinceId = this.property.province.id;
442
+              this.getCities(Object.assign({}, { province: item.value }));
443
+              this.property.city = null;
444
+              this.property.suburb = null;
445
+              this.property.addressLine3 = '';
446
+            } else {
447
+              this.property.province = null;
448
+              this.property.city = null;
449
+              this.property.suburb = null;
450
+              this.property.addressLine3 = '';
451
+              this.cities = [];
452
+              this.suburbs = [];
453
+            }
454
+          }
455
+          if (item.fieldName === 'city') {
456
+            if (item.value !== '') {
457
+              const newCity = this.cities.find(
458
+                p => p.description === item.value,
459
+              );
460
+              this.property.city = newCity;
461
+              this.property.cityId = newCity.id;
462
+              this.getSuburbs(
463
+                Object.assign(
464
+                  {},
465
+                  {
466
+                    province: this.property.province.description,
467
+                    city: item.value,
468
+                  },
469
+                ),
470
+              );
471
+              this.property.suburb = null;
472
+              this.property.addressLine3 = '';
473
+            } else {
474
+              this.property.city = null;
475
+              this.property.suburb = null;
476
+              this.property.addressLine3 = '';
477
+              this.suburbs = [];
478
+            }
479
+          }
480
+          if (item.fieldName === 'suburb') {
481
+            if (item.value !== '') {
482
+              const newSuburb = this.suburbs.find(
483
+                p => p.description === item.value,
484
+              );
485
+              this.property.suburb = newSuburb;
486
+              this.property.suburbId = newSuburb.id;
487
+              this.property.addressLine3 = this.property.suburb.postalCode;
488
+            } else {
489
+              this.property.suburb = null;
490
+              this.property.addressLine3 = '';
491
+            }
492
+          }
493
+          if (item.fieldName === 'price') {
494
+            this.property.price = item.value;
495
+          }
496
+          if (item.fieldName === 'pricePer') {
497
+            this.property.pricePer = item.value;
498
+          }
499
+          if (item.fieldName === 'virtualTour') {
500
+            this.property.virtualTour = item.value;
501
+          }
502
+          if (item.fieldName === 'video') {
503
+            this.property.video = item.value;
504
+          }
505
+        }
506
+      }
507
+    },
262 508
     TypeChanged() {
263 509
       this.propertyType = this.property.propertyUsageType;
264 510
     },
265 511
     SubmitData() {
266 512
       this.wait = true;
267
-      if (this.salesType === 'Sale') {
268
-        this.property.isSale = true;
269
-      }
513
+
514
+      this.newPropertyImages.propertyId = this.property.id;
515
+      this.newPropertyImages.Images = [];
270 516
       // eslint-disable-next-line no-plusplus
271 517
       for (let i = 0; i < this.images.length; i++) {
272 518
         let setAsDefault = false;
273 519
         if (i === this.defaultImage) {
274 520
           setAsDefault = true;
275 521
         }
276
-        this.property.propertyImages.push({
522
+        this.newPropertyImages.images.push({
277 523
           image: this.images[i],
278 524
           isDefault: setAsDefault,
279 525
         });
280 526
       }
281
-      this.property.propertyUserFields = this.propertyFieldValues;
282 527
 
283
-      if (this.property.id === 0) {
284
-        this.property.userId = this.user.id;
285
-        this.saveProperty(this.property);
286
-        setTimeout(
287
-          () => this.$router.push({
288
-              path: '/property/Search',
289
-              query: {
290
-                salesType: this.salesType,
291
-                propertyUsageType: this.propertyType,
292
-              },
293
-            }),
294
-          3000,
295
-        );
296
-      } else {
297
-        setTimeout(() => this.$router.push('/property/admin/list/my'), 3000);
528
+      this.property.propertyImages = this.propertyImages;
529
+      // eslint-disable-next-line no-plusplus
530
+      for (let i = 0; i < this.property.propertyImages.length; i++) {
531
+        this.property.propertyImages[i].image = '';
298 532
       }
533
+      this.property.propertyOverviewFields = this.propertyOverviewFields;
534
+      this.property.propertyFields = this.propertyFields;
535
+      this.updateProperty({
536
+        property: this.property,
537
+        images: this.newPropertyImages,
538
+      });
539
+
540
+      // console.log(JSON.stringify(this.newPropertyImages));
541
+
542
+      // Need to change to promis.
543
+      setTimeout(
544
+        () => this.$router.push({
545
+            path: '/property/admin/list/my',
546
+          }),
547
+        5000,
548
+      );
299 549
     },
300 550
     Close() {
301 551
       this.$router.push('/property/admin/list/my');
302 552
     },
303
-    ProvinceSelected(item) {
304
-      if (item.target.options.selectedIndex > 0) {
305
-        this.selectedProvince = this.provinces[
306
-          item.target.options.selectedIndex - 1
307
-        ].description;
308
-        this.getCities(Object.assign({}, { province: this.selectedProvince }));
309
-      }
310
-    },
311
-    CitySelected(item) {
312
-      if (item.target.options.selectedIndex > 0) {
313
-        this.selectedCity = this.cities[
314
-          item.target.options.selectedIndex - 1
315
-        ].description;
316
-        this.getSuburbs(
317
-          Object.assign(
318
-            {},
319
-            { province: this.selectedProvince, city: this.selectedCity },
320
-          ),
321
-        );
322
-      }
323
-    },
324
-    getPostalCode(item) {
325
-      this.property.addressLine3 = this.suburbs[
326
-        item.target.options.selectedIndex - 1
327
-      ].postalCode;
328
-    },
329 553
     loadedImages(values) {
330 554
       this.images = values;
331 555
     },
332
-    UpdateUserDefinedFields(item) {
333
-      let update = false;
334
-      this.propertyFieldValues.forEach((element) => {
335
-        if (element.userDefinedFieldId === item.userDefinedFieldId) {
336
-          element.value = item.value;
337
-          update = true;
338
-        }
339
-      });
340
-      if (!update) {
341
-        this.propertyFieldValues.push(item);
342
-      }
343
-    },
344 556
     UpdateDefaultImage(item) {
345 557
       this.defaultImage = item;
346 558
     },
559
+    DeleteImage(image) {
560
+      this.propertyImages.find(item => item.id === image.id).isDeleted = true;
561
+    },
347 562
   },
348 563
   mounted() {
564
+    // Need to check this can remove unused code
349 565
     this.wait = false;
350
-    this.clearProperty();
351
-    this.clearPropertyImages();
352 566
     this.images = [];
353 567
     this.defaultImage = 0;
354 568
 
@@ -369,39 +583,32 @@ export default {
369 583
 
370 584
     this.getPropertyTypes(this.propertyType);
371 585
 
372
-    this.getProvince();
373
-    if (this.$route.query.id) {
374
-      this.getSavedPropertyData(
375
-        Object.assign({}, { id: this.$route.query.id, type: this.propertyType }),
376
-      );
377
-      this.isEdit = true;
378
-    } else {
379
-      this.getPropertyOverviewFields();
380
-      this.getPropertyFields(this.propertyType);
381
-    }
586
+    this.getListsForPropertyEdit(this.$route.query.id);
587
+
588
+    this.getSavedPropertyData(
589
+      Object.assign({}, { id: this.$route.query.id, type: this.propertyType }),
590
+    );
591
+
592
+    this.mayEditProperty(this.$route.query.id);
382 593
   },
383 594
   computed: {
384 595
     ...mapState('searchTab', ['provinces', 'cities', 'suburbs']),
385
-    ...mapState('property', [
386
-      'propertyTypes',
596
+    ...mapState('property', ['propertyTypes']),
597
+    ...mapState('propertyEdit', [
387 598
       'propertyOverviewFields',
388 599
       'propertyFields',
389 600
       'property',
390 601
       'propertyImages',
602
+      'mayEdit',
603
+      'newPropertyImages',
391 604
     ]),
392 605
     ...mapState('authentication', ['user']),
393 606
     SalesTypeChanged() {
394
-      // eslint-disable-next-line vue/no-side-effects-in-computed-properties
395
-      // this.propertyType = this.$route.params.propType;
396
-      // eslint-disable-next-line vue/no-side-effects-in-computed-properties
397
-      this.salesType = this.$route.params.saleType;
398 607
       if (this.property && this.property.propertyUsageType) {
399 608
         // eslint-disable-next-line vue/no-side-effects-in-computed-properties
400 609
         this.propertyType = this.property.propertyUsageType;
401
-      }
402
-
403
-      if (!this.$route.query.id) {
404
-        this.getPropertyFields(this.propertyType);
610
+        // eslint-disable-next-line vue/no-side-effects-in-computed-properties
611
+        this.salesType = this.property.isSale ? 'Sale' : 'Rental';
405 612
       }
406 613
 
407 614
       this.getPropertyTypes(this.propertyType);
@@ -416,3 +623,13 @@ export default {
416 623
   },
417 624
 };
418 625
 </script>
626
+
627
+<style>
628
+span {
629
+  cursor: pointer;
630
+}
631
+.opacity {
632
+  opacity: 0.5;
633
+  filter: alpha(opacity=50);
634
+}
635
+</style>

+ 11
- 11
src/components/shared/alert.vue Dosyayı Görüntüle

@@ -1,21 +1,21 @@
1 1
 <template>
2 2
   <div class="container">
3 3
     <!-- eslint-disable max-len -->
4
-    <div class="alert alert-success" v-if="type === 'SUCCESS'">
5
-      <eva-icon name="checkmark-outline"></eva-icon>
6
-      <strong>{{ text }}</strong>
4
+    <div class="alert mySuccess" v-if="type === 'SUCCESS'">
5
+      <eva-icon name="checkmark-outline" style="margin: 0px 20px"></eva-icon>
6
+      <strong class="color-black">{{ text }}</strong>
7 7
     </div>
8
-    <div class="alert alert-info" v-if="type === 'INFO'">
9
-      <eva-icon name="info-outline"></eva-icon>
10
-      <strong>{{ text }}</strong>
8
+    <div class="alert myInfo" v-if="type === 'INFO'">
9
+      <eva-icon name="info-outline" style="margin: 0px 20px"></eva-icon>
10
+      <strong class="color-black">{{ text }}</strong>
11 11
     </div>
12
-    <div class="alert alert-warning" v-if="type === 'WARNING'">
13
-      <eva-icon name="alert-circle-outline"></eva-icon>
12
+    <div class="alert myWarning" v-if="type === 'WARNING'">
13
+      <eva-icon name="alert-circle-outline" style="margin: 0px 20px"></eva-icon>
14 14
       <strong class="color-black">{{ text }}</strong>
15 15
     </div>
16
-    <div class="alert alert-danger" v-if="type === 'ERROR'">
17
-      <eva-icon name="slash-outline"></eva-icon>
18
-      <strong>{{ text }}</strong>
16
+    <div class="alert myError" v-if="type === 'ERROR'">
17
+      <eva-icon name="slash-outline" style="margin: 0px 20px"></eva-icon>
18
+      <strong class="color-black">{{ text }}</strong>
19 19
     </div>
20 20
   </div>
21 21
 </template>

+ 43
- 8
src/components/shared/listView.vue Dosyayı Görüntüle

@@ -2,11 +2,9 @@
2 2
 /* eslint-disable guard-for-in */
3 3
 <template>
4 4
   <div>
5
-    <div class="container">
6
-      <div class="d-flex justify-content-between" v-if="!hideSearch">
7
-        <div class="p-2">
8
-          <input v-model="searchItem" class="form-control" placeholder="Search ..." />
9
-        </div>
5
+    <div class="d-flex justify-content-between" v-if="!hideSearch">
6
+      <div class="p-2">
7
+        <input v-model="searchItem" class="form-control" placeholder="Search ..." />
10 8
       </div>
11 9
     </div>
12 10
     <table id="table" class="table table-bordered table-hover">
@@ -15,6 +13,8 @@
15 13
           <th v-for="(column, c) in Columns" :key="c">
16 14
             <div @click="sortBy(column)">{{ column }}</div>
17 15
           </th>
16
+          <th v-if="editable"></th>
17
+          <th v-if="deleteable"></th>
18 18
         </tr>
19 19
       </thead>
20 20
       <tbody>
@@ -24,7 +24,16 @@
24 24
           class="text-left dnd-moved"
25 25
           @click="onRowClick(item)"
26 26
         >
27
-          <td v-for="(column, c) in Columns" :key="c">{{ item[column] }}</td>
27
+          <td
28
+            v-for="(column, c) in Columns"
29
+            :key="c"
30
+          >{{ isObject(item[column]) ? item[column].display : item[column] }}</td>
31
+          <td v-if="editable" class="my-width">
32
+            <button type="button" class="btn my-btn" @click="onEdit(item)">Edit</button>
33
+          </td>
34
+          <td v-if="deleteable" class="my-width">
35
+            <button type="button" class="btn my-btn" @click="onDelete(item)">Delete</button>
36
+          </td>
28 37
         </tr>
29 38
       </tbody>
30 39
     </table>
@@ -81,6 +90,15 @@ export default {
81 90
       default: false,
82 91
     },
83 92
     items: undefined,
93
+    editable: {
94
+      default: false,
95
+    },
96
+    deleteable: {
97
+      default: false,
98
+    },
99
+    columnsCount: {
100
+      default: 6,
101
+    },
84 102
   },
85 103
   data() {
86 104
     return {
@@ -94,6 +112,15 @@ export default {
94 112
     };
95 113
   },
96 114
   methods: {
115
+    isObject(item) {
116
+      return !!item && item.constructor === Object;
117
+    },
118
+    onEdit(item) {
119
+      this.$emit('onEdit', item);
120
+    },
121
+    onDelete(item) {
122
+      this.$emit('onDelete', item);
123
+    },
97 124
     onRowClick(item) {
98 125
       this.$emit('onRowClick', item);
99 126
     },
@@ -158,7 +185,9 @@ export default {
158 185
               !list.includes(Object.keys(item)[o])
159 186
               && !Array.isArray(Object.values(item)[o])
160 187
             ) {
161
-              list.push(Object.keys(item)[o]);
188
+              if (list.length < this.columnsCount) {
189
+                list.push(Object.keys(item)[o]);
190
+              }
162 191
             }
163 192
           }
164 193
         }
@@ -169,7 +198,7 @@ export default {
169 198
       const list = _.filter(this.items, item => Object.values(item).some(
170 199
           i => JSON.stringify(i)
171 200
               .toLowerCase()
172
-              .indexOf(this.searchItem) > -1,
201
+              .indexOf(this.searchItem.toLowerCase()) > -1,
173 202
         ),);
174 203
       return _.orderBy(list, this.sortKey, this.SortDirection);
175 204
     },
@@ -196,6 +225,12 @@ th[draggable] a {
196 225
   text-decoration: none;
197 226
   color: #333333;
198 227
 }
228
+.table > tbody > tr > td {
229
+  vertical-align: middle;
230
+}
231
+.my-width {
232
+  width: 20px;
233
+}
199 234
 .drag {
200 235
   background-color: rgba(0, 255, 0, 0.35);
201 236
   opacity: 0.25;

+ 2
- 1
src/components/shared/navBar.vue Dosyayı Görüntüle

@@ -63,7 +63,7 @@
63 63
                   <a
64 64
                     v-if="isLoggedIn"
65 65
                     class="dropdown-item cursor-pointer"
66
-                    @click="routerGoTo('/timeshare/sell')"
66
+                    @click="routerGoTo('/timeshare/myWeeks')"
67 67
                   >My Timeshare Weeks</a>
68 68
                 </div>
69 69
               </div>
@@ -165,6 +165,7 @@
165 165
                   @click="routerGoTo('/searchLog')"
166 166
                 >Search Logs</a>
167 167
                 <a class="dropdown-item cursor-pointer" @click="routerGoTo('/Offers')">Offers</a>
168
+                <a class="dropdown-item cursor-pointer" @click="routerGoTo('/Carousel')">Carousel</a>
168 169
               </div>
169 170
             </li>
170 171
             <li class="nav-item dropdown" v-if="!isLoggedIn">

+ 1
- 1
src/components/shared/searchTab.vue Dosyayı Görüntüle

@@ -143,7 +143,7 @@ export default {
143 143
     },
144 144
     Search() {
145 145
       if (this.selectedPropertyType === 'timeshare') {
146
-        this.$router.push('/timeshare/search/');
146
+        this.$router.push('/timesharesearch');
147 147
       } else {
148 148
         // this.$router.push('/property/search');
149 149
         this.$router.push({

+ 2
- 3
src/components/timeshare/buy/buyPage.vue Dosyayı Görüntüle

@@ -120,11 +120,10 @@ export default {
120 120
     };
121 121
   },
122 122
   mounted() {
123
-    console.log(4);
124 123
     this.init();
125 124
   },
126 125
   computed: {
127
-    ...mapState('timeshareBuy', ['detailedRegion', 'resort', 'availRegion']),
126
+    ...mapState('region', ['detailedRegion', 'resort', 'availRegion']),
128 127
     mapUrl() {
129 128
       return `http://maps.google.com/maps?q=${this.myMap}&z=${this.myZoom}&output=embed`;
130 129
     },
@@ -133,7 +132,7 @@ export default {
133 132
     },
134 133
   },
135 134
   methods: {
136
-    ...mapActions('timeshareBuy', [
135
+    ...mapActions('region', [
137 136
       'init',
138 137
       'getAvail',
139 138
       'getRegions',

+ 2
- 1
src/components/timeshare/buy/weekListComponent.vue Dosyayı Görüntüle

@@ -62,6 +62,7 @@ import { mapState, mapActions, mapGetters } from 'vuex';
62 62
 export default {
63 63
   props: {
64 64
     resortCode: undefined,
65
+    userId: undefined,
65 66
   },
66 67
   components: {},
67 68
   computed: {
@@ -79,7 +80,7 @@ export default {
79 80
   },
80 81
   methods: {
81 82
     View(item) {
82
-      this.$router.push(`/resort/${item.resort.resortCode}/${item.id}`);
83
+      this.$router.push(`/resort/${item.resort.resortCode}/${item.unitNumber}`);
83 84
     },
84 85
     ...mapActions('weekList', ['getWeeks', 'applyResortFilter']),
85 86
   },

+ 25
- 10
src/components/timeshare/myWeeksPage.vue Dosyayı Görüntüle

@@ -4,24 +4,39 @@
4 4
     <br />
5 5
     <br />
6 6
     <br />
7
-    <img
8
-      src="http://www.provision-sa.com:3000/Provision/UnivateProperties/src/branch/master/public/img/logos/UVProp.png"
9
-      height="200"
10
-      width="200"
11
-    />
12
-    {{getUser}}
13 7
     <br />
8
+    <div class="row">
9
+      <div class="offset-1 col-md-10">
10
+        <ListView :items="items" :editable="true" @onEdit="onEdit" />
11
+      </div>
12
+    </div>
14 13
   </div>
15 14
 </template>
16 15
 <script>
17
-import { mapState } from 'vuex';
16
+import { mapState, mapActions } from 'vuex';
18 17
 import log from '../../assets/Log';
18
+import ListView from '../shared/listView.vue';
19 19
 
20 20
 export default {
21
+  components: {
22
+    ListView,
23
+  },
24
+  data() {
25
+    return {
26
+      user: JSON.parse(log.getUser()),
27
+    };
28
+  },
29
+  mounted() {
30
+    console.log(this.user.id);
31
+    this.getItems(this.user.id);
32
+  },
21 33
   computed: {
22
-    ...mapState('myWeeks', ['test']),
23
-    getUser() {
24
-      return log.getUser();
34
+    ...mapState('myWeeks', ['items']),
35
+  },
36
+  methods: {
37
+    ...mapActions('myWeeks', ['getItems']),
38
+    onEdit(item) {
39
+      this.$router.push(`/timeshare/${item.id}`);
25 40
     },
26 41
   },
27 42
 };

+ 19
- 6
src/components/timeshare/resort/unitPage.vue Dosyayı Görüntüle

@@ -1,10 +1,12 @@
1 1
 <template>
2 2
   <!-- eslint-disable max-len -->
3 3
   <div class="my-container my-top">
4
+    <br />
5
+    <br />
4 6
     <div class="row">
5 7
       <div class="col-md-12 col-lg-8">
6 8
         <div class="title-box-d">
7
-          <h1 class="title-d my-title">{{week ? week.resortName : ''}}</h1>
9
+          <h1 class="title-d my-title">{{week ? week.resort.resortName : ''}}</h1>
8 10
         </div>
9 11
         <br />
10 12
       </div>
@@ -158,7 +160,7 @@
158 160
 </template>
159 161
 
160 162
 <script>
161
-import { mapState, mapActions } from 'vuex';
163
+import { mapState, mapActions, mapGetters } from 'vuex';
162 164
 import makeOffer from '../../processFlow/makeOffer.vue';
163 165
 import ResortImages from './resortImage.vue';
164 166
 
@@ -170,19 +172,30 @@ export default {
170 172
   },
171 173
   props: {
172 174
     resortCode: {},
173
-    weekId: {},
175
+    unitNumber: {},
174 176
   },
175 177
   mounted() {
176 178
     this.initResort(this.resortCode);
177
-    this.initWeek(this.weekId);
179
+    if (this.resortCode) {
180
+      this.applyResortFilter(this.resortCode);
181
+    }
182
+    this.getWeeks();
178 183
   },
179 184
   computed: {
180 185
     ...mapState('resort', ['resort', 'description', 'images']),
181
-    ...mapState('week', ['week']),
186
+
187
+    ...mapGetters({
188
+      weekById: 'weekList/weekById',
189
+    }),
190
+    week() {
191
+      return this.weekById(this.resortCode, this.unitNumber);
192
+    },
193
+    // ...mapState('week', ['currentWeek']),
182 194
   },
183 195
   methods: {
196
+    ...mapActions('weekList', ['getWeeks', 'applyResortFilter']),
184 197
     ...mapActions('resort', ['initResort']),
185
-    ...mapActions('week', ['initWeek']),
198
+    // ...mapActions('week', ['initWeek']),
186 199
     formatPrice(value) {
187 200
       if (value) {
188 201
         const val = (value / 1).toFixed(2);

+ 7
- 1
src/components/timeshare/sell/sellPage.vue Dosyayı Görüntüle

@@ -517,6 +517,11 @@ import Alert from '../../shared/alert.vue';
517 517
 
518 518
 export default {
519 519
   name: 'TimeshareToSell',
520
+  props: {
521
+    weekId: {
522
+      default: 0,
523
+    },
524
+  },
520 525
   components: {
521 526
     DetailIndividual,
522 527
     BankDetails,
@@ -524,7 +529,8 @@ export default {
524 529
     Alert,
525 530
   },
526 531
   created() {
527
-    this.initTimeshare();
532
+    console.log(46);
533
+    this.initTimeshare(this.weekId);
528 534
   },
529 535
   computed: {
530 536
     ...mapState('timeshare', [

+ 6
- 0
src/components/user/loginPage.vue Dosyayı Görüntüle

@@ -129,7 +129,13 @@ export default {
129 129
       } else this.troubleToggle = true;
130 130
     },
131 131
     Login() {
132
+      console.log(this.$store.state.authentication);
133
+
132 134
       this.login().then(() => {
135
+        console.log('this');
136
+        console.log(this);
137
+        console.log(this.$store.state.authentication.status);
138
+
133 139
         if (this.$store.state.authentication.status === 'error') {
134 140
           this.$router.push('/user/login');
135 141
         } else {

+ 220
- 203
src/router/index.js Dosyayı Görüntüle

@@ -48,6 +48,8 @@ import searchLog from '../components/admin/logs/SearchLogs.vue';
48 48
 // import store from '../store';
49 49
 
50 50
 import TemplatePage from '../components/communication/templatePage.vue';
51
+import CarouselList from '../components/admin/misc/carouselList.vue';
52
+import CarouselDetail from '../components/admin/misc/carousel.vue';
51 53
 
52 54
 Vue.use(Router);
53 55
 
@@ -59,208 +61,223 @@ export default new Router({
59 61
       y: 0,
60 62
     };
61 63
   },
62
-  routes: [
63
-    {
64
-      path: '/',
65
-      name: 'Home',
66
-      component: HomePage,
67
-    },
68
-    {
69
-      path: '/about/us',
70
-      name: 'aboutus',
71
-      component: AboutUs,
72
-    },
73
-    {
74
-      path: '/about/timeshare',
75
-      name: 'abouttimeshare',
76
-      component: AboutTimeshare,
77
-    },
78
-    {
79
-      path: '/communication/template',
80
-      name: 'template',
81
-      component: TemplatePage,
82
-    },
83
-    {
84
-      path: '/timeshare/sell',
85
-      name: 'TimeshareSell',
86
-      component: TimeshareSell,
87
-    },
88
-    {
89
-      path: '/timeshare/buy',
90
-      name: 'TimeshareBuy',
91
-      component: TimeshareBuy,
92
-    },
93
-    {
94
-      path: '/timeshare/faq',
95
-      name: 'TimeshareFAQ',
96
-      component: TimeshareFAQ,
97
-    },
98
-    {
99
-      path: '/timeshare/myWeeks',
100
-      name: 'MyWeeks',
101
-      component: MyWeeksPage,
102
-    },
103
-    {
104
-      path: '/user/login',
105
-      name: 'Login',
106
-      component: Login,
107
-    },
108
-    {
109
-      path: '/user/updateProfileInfo',
110
-      name: 'UpdateInfo',
111
-      component: UpdateInfo,
112
-    },
113
-    {
114
-      path: '/user/register',
115
-      name: 'PrivateIndividual',
116
-      component: PrivateIndividual,
117
-    },
118
-    {
119
-      path: '/user/registeragency',
120
-      name: 'Agency',
121
-      component: Agency,
122
-    },
123
-    {
124
-      path: '/property/property/:id',
125
-      name: 'PropertyPage',
126
-      component: PropertyPage,
127
-    },
128
-    {
129
-      path: '/property/:propertyUsageType/search',
130
-      name: 'PropertySearch',
131
-      component: PropertySearch,
132
-    },
133
-    {
134
-      path: '/property/search',
135
-      name: 'PropertySearchTab',
136
-      component: PropertySearch,
137
-    },
138
-    {
139
-      path: '/property/new/:saleType',
140
-      name: 'PropertyNew',
141
-      component: PropertyCreate,
142
-    },
143
-    {
144
-      path: '/property/new/:propertyUsageType/:saleType',
145
-      name: 'PropertyNewFromSearch',
146
-      component: PropertyCreate,
147
-    },
148
-    {
149
-      path: '/property/edit',
150
-      name: 'PropertyEdit',
151
-      component: PropertyEdit,
152
-    },
153
-    {
154
-      path: '/property/admin/list/:by',
155
-      name: 'PropertyListAdmin',
156
-      component: PropertyList,
157
-    },
158
-    {
159
-      path: '/propertyTypes/list',
160
-      name: 'PropertyTypeList',
161
-      component: PropertyTypeList,
162
-    },
163
-    {
164
-      path: '/propertyType/new',
165
-      name: 'PropertyTypeNew',
166
-      component: PropertyType,
167
-    },
168
-    {
169
-      path: '/propertyType/:id',
170
-      name: 'PropertyTypeEdit',
171
-      component: PropertyType,
172
-    },
173
-    {
174
-      path: '/userDefinedGroups/list',
175
-      name: 'UserDefinedGroupsList',
176
-      component: UserDefinedGroups,
177
-    },
178
-    {
179
-      path: '/userDefinedGroups/userDefinedGroup/:id',
180
-      name: 'UserDefinedGroupEdit',
181
-      component: UserDefinedGroup,
182
-    },
183
-    {
184
-      path: '/userDefinedGroups/userDefinedGroup',
185
-      name: 'UserDefinedGroupNew',
186
-      component: UserDefinedGroup,
187
-    },
188
-    {
189
-      path: '/status/list',
190
-      name: 'StatusList',
191
-      component: Status,
192
-    },
193
-    {
194
-      path: '/status/timeshareAdmin',
195
-      name: 'TimeshareAdmin',
196
-      component: timeshareAdminPage,
197
-    },
198
-    {
199
-      path: '/status/tenderWeekAdmin',
200
-      name: 'TenderWeekAdmin',
201
-      component: tenderWeekAdminPage,
202
-    },
203
-    {
204
-      path: '/status/userManagementPage',
205
-      name: 'userManagementPage',
206
-      component: userManagementPage,
207
-    },
208
-    {
209
-      path: '/status/agentUserManagementPage',
210
-      name: 'agentManagementPage',
211
-      component: agentManagementPage,
212
-    },
213
-    {
214
-      path: '/status/changeLogPage',
215
-      name: 'changeLogPage',
216
-      component: changeLogPage,
217
-    },
218
-    {
219
-      path: '/unitConfiguration/list',
220
-      name: 'UnitConfiguration',
221
-      component: UnitConfiguration,
222
-    },
223
-    {
224
-      path: '/contactus',
225
-      name: 'ContactUs',
226
-      component: ContactUs,
227
-    },
228
-    {
229
-      path: '/privacypolicy',
230
-      name: 'PrivacyPolicy',
231
-      component: PrivacyPolicy,
232
-    },
233
-    {
234
-      path: '/resort/:resortCode',
235
-      name: 'ResortPage',
236
-      component: ResortPage,
237
-      props: true,
238
-    },
239
-    {
240
-      path: '/resort/:resortCode/:weekId',
241
-      name: 'UnitPage',
242
-      component: UnitPage,
243
-      props: true,
244
-    },
245
-    {
246
-      path: '/MakeOffer',
247
-      name: 'MakeOffer',
248
-      component: MakeOffer,
249
-    },
250
-    {
251
-      path: '/Offers',
252
-      name: 'Offers',
253
-      component: Offer,
254
-    },
255
-    {
256
-      path: '/timeshare/search',
257
-      name: 'TimeshareSearch',
258
-      component: TimeshareSearch,
259
-    },
260
-    {
261
-      path: '/searchLog',
262
-      name: 'SearchLog',
263
-      component: searchLog,
264
-    },
64
+  routes: [{
65
+    path: '/',
66
+    name: 'Home',
67
+    component: HomePage,
68
+  },
69
+  {
70
+    path: '/about/us',
71
+    name: 'aboutus',
72
+    component: AboutUs,
73
+  },
74
+  {
75
+    path: '/about/timeshare',
76
+    name: 'abouttimeshare',
77
+    component: AboutTimeshare,
78
+  },
79
+  {
80
+    path: '/communication/template',
81
+    name: 'template',
82
+    component: TemplatePage,
83
+  },
84
+  {
85
+    path: '/timeshare/sell',
86
+    name: 'TimeshareSell',
87
+    component: TimeshareSell,
88
+  },
89
+  {
90
+    path: '/timeshare/buy',
91
+    name: 'TimeshareBuy',
92
+    component: TimeshareBuy,
93
+  },
94
+  {
95
+    path: '/timeshare/faq',
96
+    name: 'TimeshareFAQ',
97
+    component: TimeshareFAQ,
98
+  },
99
+  {
100
+    path: '/timeshare/myWeeks',
101
+    name: 'MyWeeks',
102
+    component: MyWeeksPage,
103
+  },
104
+  {
105
+    path: '/user/login',
106
+    name: 'Login',
107
+    component: Login,
108
+  },
109
+  {
110
+    path: '/user/updateProfileInfo',
111
+    name: 'UpdateInfo',
112
+    component: UpdateInfo,
113
+  },
114
+  {
115
+    path: '/user/register',
116
+    name: 'PrivateIndividual',
117
+    component: PrivateIndividual,
118
+  },
119
+  {
120
+    path: '/user/registeragency',
121
+    name: 'Agency',
122
+    component: Agency,
123
+  },
124
+  {
125
+    path: '/property/property/:id',
126
+    name: 'PropertyPage',
127
+    component: PropertyPage,
128
+  },
129
+  {
130
+    path: '/property/:propertyUsageType/search',
131
+    name: 'PropertySearch',
132
+    component: PropertySearch,
133
+  },
134
+  {
135
+    path: '/property/search',
136
+    name: 'PropertySearchTab',
137
+    component: PropertySearch,
138
+  },
139
+  {
140
+    path: '/property/new/:saleType',
141
+    name: 'PropertyNew',
142
+    component: PropertyCreate,
143
+  },
144
+  {
145
+    path: '/property/new/:propertyUsageType/:saleType',
146
+    name: 'PropertyNewFromSearch',
147
+    component: PropertyCreate,
148
+  },
149
+  {
150
+    path: '/property/edit',
151
+    name: 'PropertyEdit',
152
+    component: PropertyEdit,
153
+  },
154
+  {
155
+    path: '/property/admin/list/:by',
156
+    name: 'PropertyListAdmin',
157
+    component: PropertyList,
158
+  },
159
+  {
160
+    path: '/propertyTypes/list',
161
+    name: 'PropertyTypeList',
162
+    component: PropertyTypeList,
163
+  },
164
+  {
165
+    path: '/propertyType/new',
166
+    name: 'PropertyTypeNew',
167
+    component: PropertyType,
168
+  },
169
+  {
170
+    path: '/propertyType/:id',
171
+    name: 'PropertyTypeEdit',
172
+    component: PropertyType,
173
+  },
174
+  {
175
+    path: '/userDefinedGroups/list',
176
+    name: 'UserDefinedGroupsList',
177
+    component: UserDefinedGroups,
178
+  },
179
+  {
180
+    path: '/userDefinedGroups/userDefinedGroup/:id',
181
+    name: 'UserDefinedGroupEdit',
182
+    component: UserDefinedGroup,
183
+  },
184
+  {
185
+    path: '/userDefinedGroups/userDefinedGroup',
186
+    name: 'UserDefinedGroupNew',
187
+    component: UserDefinedGroup,
188
+  },
189
+  {
190
+    path: '/status/list',
191
+    name: 'StatusList',
192
+    component: Status,
193
+  },
194
+  {
195
+    path: '/status/timeshareAdmin',
196
+    name: 'TimeshareAdmin',
197
+    component: timeshareAdminPage,
198
+  },
199
+  {
200
+    path: '/status/tenderWeekAdmin',
201
+    name: 'TenderWeekAdmin',
202
+    component: tenderWeekAdminPage,
203
+  },
204
+  {
205
+    path: '/status/userManagementPage',
206
+    name: 'userManagementPage',
207
+    component: userManagementPage,
208
+  },
209
+  {
210
+    path: '/status/agentUserManagementPage',
211
+    name: 'agentManagementPage',
212
+    component: agentManagementPage,
213
+  },
214
+  {
215
+    path: '/status/changeLogPage',
216
+    name: 'changeLogPage',
217
+    component: changeLogPage,
218
+  },
219
+  {
220
+    path: '/unitConfiguration/list',
221
+    name: 'UnitConfiguration',
222
+    component: UnitConfiguration,
223
+  },
224
+  {
225
+    path: '/contactus',
226
+    name: 'ContactUs',
227
+    component: ContactUs,
228
+  },
229
+  {
230
+    path: '/privacypolicy',
231
+    name: 'PrivacyPolicy',
232
+    component: PrivacyPolicy,
233
+  },
234
+  {
235
+    path: '/resort/:resortCode',
236
+    name: 'ResortPage',
237
+    component: ResortPage,
238
+    props: true,
239
+  },
240
+  {
241
+    path: '/resort/:resortCode/:unitNumber',
242
+    name: 'UnitPage',
243
+    component: UnitPage,
244
+    props: true,
245
+  },
246
+  {
247
+    path: '/timeshare/:weekId',
248
+    name: 'TimeshareSell',
249
+    component: TimeshareSell,
250
+    props: true,
251
+  },
252
+  {
253
+    path: '/MakeOffer',
254
+    name: 'MakeOffer',
255
+    component: MakeOffer,
256
+  },
257
+  {
258
+    path: '/Offers',
259
+    name: 'Offers',
260
+    component: Offer,
261
+  },
262
+  {
263
+    path: '/timesharesearch',
264
+    name: 'TimeshareSearch',
265
+    component: TimeshareSearch,
266
+  },
267
+  {
268
+    path: '/searchLog',
269
+    name: 'SearchLog',
270
+    component: searchLog,
271
+  },
272
+  {
273
+    path: '/carousel',
274
+    name: 'carousel',
275
+    component: CarouselList,
276
+  },
277
+  {
278
+    path: '/carousel/details/:id',
279
+    name: 'CarouselDetails',
280
+    component: CarouselDetail,
281
+  },
265 282
   ],
266 283
 });

+ 6
- 2
src/store/index.js Dosyayı Görüntüle

@@ -5,7 +5,7 @@ import TimeshareModule from './modules/timeshare/timeshare';
5 5
 import UsersModule from './modules/users';
6 6
 import StatusModule from './modules/timeshare/status';
7 7
 import UnitConfigurationModule from './modules/timeshare/unitConfiguration';
8
-import TimeshareBuyModule from './modules/timeshare/buyPage';
8
+import RegionModule from './modules/timeshare/region';
9 9
 import SearchTabModule from './modules/searchTab';
10 10
 import ResortModule from './modules/timeshare/resort';
11 11
 import PropertyModule from './modules/property/property';
@@ -22,6 +22,8 @@ import PropertySearch from './modules/property/propertySearch';
22 22
 import SearchLog from './modules/logs/searchLog';
23 23
 import Template from './modules/communication/template';
24 24
 import Info from './modules/communication/info';
25
+import PropertyEdit from './modules/property/propertyEdit';
26
+import Carousel from './modules/misc/carousel';
25 27
 
26 28
 Vue.use(Vuex);
27 29
 /* eslint no-param-reassign: ["error", { "props": false }] */
@@ -32,7 +34,7 @@ export default new Vuex.Store({
32 34
     users: UsersModule,
33 35
     status: StatusModule,
34 36
     unitConfiguration: UnitConfigurationModule,
35
-    timeshareBuy: TimeshareBuyModule,
37
+    region: RegionModule,
36 38
     searchTab: SearchTabModule,
37 39
     resort: ResortModule,
38 40
     property: PropertyModule,
@@ -48,5 +50,7 @@ export default new Vuex.Store({
48 50
     searchLog: SearchLog,
49 51
     template: Template,
50 52
     info: Info,
53
+    propertyEdit: PropertyEdit,
54
+    carousel: Carousel,
51 55
   },
52 56
 });

+ 31
- 0
src/store/modules/misc/carousel.js Dosyayı Görüntüle

@@ -0,0 +1,31 @@
1
+import axios from 'axios';
2
+
3
+export default {
4
+  namespaced: true,
5
+  state: {
6
+    carouselList: [],
7
+  },
8
+  mutations: {
9
+    setCarouselList(state, items) {
10
+      state.carouselList = items;
11
+    },
12
+    removeCarousel(state, id) {
13
+      state.carouselList.pop(state.carouselList.find(p => p.id === id));
14
+    },
15
+  },
16
+  getters: {},
17
+  actions: {
18
+    getCarouselList({ commit }) {
19
+      axios
20
+        .get('/api/Carousel')
21
+        .then(result => commit('setCarouselList', result.data))
22
+        .catch(console.error);
23
+    },
24
+    deleteCarousel({ commit }, id) {
25
+      axios
26
+        .delete(`/api/Carousel/${id}`)
27
+        .then(commit('removeCarousel', id))
28
+        .catch(console.error);
29
+    },
30
+  },
31
+};

+ 3
- 3
src/store/modules/property/property.js Dosyayı Görüntüle

@@ -103,7 +103,7 @@ export default {
103 103
     },
104 104
     getPropertyImages({ commit }, id) {
105 105
       axios
106
-        .get(`/api/PropertyImage/getPropertyImages/${id}`)
106
+        .get(`/api/PropertyImage/GetImagesByProperty/${id}`)
107 107
         .then(result => commit('setPropertyImages', result.data))
108 108
         .catch(console.error);
109 109
     },
@@ -164,12 +164,12 @@ export default {
164 164
       commit('clearPropertyImages');
165 165
 
166 166
       axios
167
-        .get(`/api/Property/getproperty/${item.id}`)
167
+        .get(`/api/Property/getProperty/${item.id}`)
168 168
         .then(result => commit('setProperty', result.data))
169 169
         .catch(console.error);
170 170
 
171 171
       axios
172
-        .get(`/api/PropertyImage/getPropertyImages/${item.id}`)
172
+        .get(`/api/PropertyImage/GetProperySavedImages/${item.id}`)
173 173
         .then(result => commit('setPropertyImages', result.data))
174 174
         .catch(console.error);
175 175
 

+ 143
- 0
src/store/modules/property/propertyEdit.js Dosyayı Görüntüle

@@ -0,0 +1,143 @@
1
+import axios from 'axios';
2
+
3
+export default {
4
+  namespaced: true,
5
+  state: {
6
+    property: {
7
+      createdBy: '',
8
+      propertyTypeId: 0,
9
+      propertyName: '',
10
+      unit: '',
11
+      operationalCosts: 0.0,
12
+      price: 0,
13
+      pricePer: '',
14
+      isSale: false,
15
+      description: '',
16
+      shortDescription: '',
17
+      addressLine1: '',
18
+      addressLine2: '',
19
+      addressLine3: '',
20
+      suburbId: 0,
21
+      cityId: 0,
22
+      provinceId: 0,
23
+      published: false,
24
+      propertyUserFields: [],
25
+      propertyImages: [],
26
+      newImages: [],
27
+      id: 0,
28
+      virtualTour: '',
29
+      video: '',
30
+      userId: 0,
31
+    },
32
+    propertyImages: [],
33
+    propertyTypes: [],
34
+    propertyTypesRes: [],
35
+    propertyTypesCom: [],
36
+    propertyOverviewFields: [],
37
+    propertyFields: [],
38
+    mayEdit: false,
39
+    newPropertyImages: {
40
+      propertyId: 0,
41
+      images: [],
42
+    },
43
+  },
44
+  mutations: {
45
+    setProperty(state, property) {
46
+      state.property = property;
47
+    },
48
+    setPropertyImages(state, images) {
49
+      state.propertyImages = images;
50
+    },
51
+    setPropertyOverviewFields(state, fields) {
52
+      state.propertyOverviewFields = fields;
53
+    },
54
+    setPropertyFields(state, fields) {
55
+      state.propertyFields = fields;
56
+    },
57
+    setMayEdit(state, data) {
58
+      state.mayEdit = data;
59
+    },
60
+    clearProperty(state) {
61
+      state.property = {
62
+        createdBy: '',
63
+        propertyTypeId: 0,
64
+        propertyName: '',
65
+        unit: '',
66
+        operationalCosts: 0.0,
67
+        price: 0,
68
+        pricePer: '',
69
+        isSale: false,
70
+        description: '',
71
+        shortDescription: '',
72
+        addressLine1: '',
73
+        addressLine2: '',
74
+        addressLine3: '',
75
+        suburbId: 0,
76
+        cityId: 0,
77
+        provinceId: 0,
78
+        published: false,
79
+        propertyOverviewFields: [],
80
+        propertyFields: [],
81
+        propertyImages: [],
82
+        newImages: [],
83
+        id: 0,
84
+        virtualTour: '',
85
+        video: '',
86
+        userId: 0,
87
+      };
88
+    },
89
+    clearPropertyImages(state) {
90
+      state.propertyImages = [];
91
+    },
92
+    ClearNewImages(state) {
93
+      state.newPropertyImages = {
94
+        propertyId: 0,
95
+        images: [],
96
+      };
97
+    },
98
+  },
99
+  getters: {},
100
+  actions: {
101
+    getSavedPropertyData({ commit }, item) {
102
+      commit('clearProperty');
103
+      commit('clearPropertyImages');
104
+
105
+      axios
106
+        .get(`/api/Property/getProperty/${item.id}`)
107
+        .then(result => commit('setProperty', result.data))
108
+        .catch(console.error);
109
+
110
+      axios
111
+        .get(`/api/PropertyImage/GetProperySavedImages/${item.id}`)
112
+        .then(result => commit('setPropertyImages', result.data))
113
+        .catch(console.error);
114
+
115
+      axios
116
+        .get(`/api/PropertyFields/GetSavedValues/Residential/Property Overview/${item.id}`)
117
+        .then(response => commit('setPropertyOverviewFields', response.data))
118
+        .catch(console.error);
119
+
120
+      axios
121
+        .get(`/api/PropertyFields/GetSavedValues/${item.type}/All/${item.id}`)
122
+        .then(response => commit('setPropertyFields', response.data))
123
+        .catch(console.error);
124
+    },
125
+    updateProperty({ commit }, item) {
126
+      axios
127
+        .post('/api/PropertyImage', item.images)
128
+        .then(commit('ClearNewImages'))
129
+        .catch(console.error);
130
+
131
+      axios
132
+        .put('/api/Property', item.property)
133
+        .then(commit('setProperty', item.property))
134
+        .catch(console.error);
135
+    },
136
+    mayEditProperty({ commit }, id) {
137
+      axios
138
+        .get(`/api/property/MayEditProperty/${id}`)
139
+        .then(response => commit('setMayEdit', response.data))
140
+        .catch(console.error);
141
+    },
142
+  },
143
+};

+ 16
- 0
src/store/modules/searchTab.js Dosyayı Görüntüle

@@ -36,5 +36,21 @@ export default {
36 36
         .get(`/api/Suburb/${item.province}/${item.city}`)
37 37
         .then(result => commit('setSuburbs', result.data));
38 38
     },
39
+    getListsForPropertyEdit({ commit }, propertyId) {
40
+      axios
41
+        .get('/api/province')
42
+        .then(result => commit('setProvince', result.data))
43
+        .catch(console.error);
44
+
45
+      axios
46
+        .get(`/api/City/GetByProperty/${propertyId}`)
47
+        .then(result => commit('setCities', result.data))
48
+        .catch(console.error);
49
+
50
+      axios
51
+        .get(`/api/Suburb/GetByProperty/${propertyId}`)
52
+        .then(result => commit('setSuburbs', result.data))
53
+        .catch(console.error);
54
+    },
39 55
   },
40 56
 };

+ 17
- 2
src/store/modules/timeshare/myWeeks.js Dosyayı Görüntüle

@@ -1,10 +1,25 @@
1
+import axios from 'axios';
2
+
1 3
 export default {
2 4
   namespaced: true,
3 5
   state: {
4 6
     test: 'kobus',
5 7
     items: [],
6 8
   },
7
-  mutations: {},
9
+  mutations: {
10
+    setItems(state, list) {
11
+      state.items = list;
12
+    },
13
+  },
8 14
   getters: {},
9
-  actions: {},
15
+  actions: {
16
+    getItems({
17
+      commit,
18
+    }, id) {
19
+      axios.get(`/api/timeshareweek/getMyWeek/${id}`).then(r => commit('setItems', r.data)).catch(
20
+        console
21
+          .error,
22
+      );
23
+    },
24
+  },
10 25
 };

src/store/modules/timeshare/buyPage.js → src/store/modules/timeshare/region.js Dosyayı Görüntüle

@@ -1,8 +1,6 @@
1 1
 /* eslint-disable no-restricted-syntax */
2 2
 /* eslint-disable guard-for-in */
3 3
 import axios from 'axios';
4
-import _ from 'lodash';
5
-import resort from './resort';
6 4
 
7 5
 export default {
8 6
   namespaced: true,
@@ -10,37 +8,45 @@ export default {
10 8
     regions: [],
11 9
     detailedRegion: [],
12 10
     availRegion: [],
13
-    resort: {},
11
+    initFlag: false,
14 12
   },
15 13
   mutations: {
16
-    clearAvail(state, avail) {
17
-      state.availRegion = [];
14
+    addItem(state, item) {
15
+      state[item.name].push(item.value);
18 16
     },
19
-    addAvail(state, avail) {
20
-      state.availRegion.push(avail);
21
-    },
22
-    setRegions(state, regions) {
23
-      state.regions = regions;
24
-    },
25
-    clearDetailed(state) {
26
-      state.detailedRegion = [];
27
-    },
28
-    addDetailed(state, detailed) {
29
-      state.detailedRegion.push(detailed);
30
-    },
31
-    setResort(state, resort) {
32
-      state.resort = resort;
17
+    setItem(state, item) {
18
+      state[item.name] = item.value;
33 19
     },
34 20
   },
35 21
   getters: {},
36 22
   actions: {
37 23
     init({
24
+      state,
25
+      commit,
26
+      dispatch,
27
+    }) {
28
+      if (!state.initFlag) {
29
+        commit('setItem', {
30
+          name: 'availRegion',
31
+          value: [],
32
+        });
33
+        dispatch('getAvail');
34
+        dispatch('getRegions');
35
+        commit('setItem', {
36
+          name: 'initFlag',
37
+          value: true,
38
+        });
39
+      }
40
+    },
41
+    forceInit({
38 42
       commit,
39 43
       dispatch,
40 44
     }) {
41
-      commit('clearAvail');
42
-      dispatch('getAvail');
43
-      dispatch('getRegions');
45
+      commit('setItem', {
46
+        name: 'initFlag',
47
+        value: false,
48
+      });
49
+      dispatch('init');
44 50
     },
45 51
     getAvail({
46 52
       commit,
@@ -75,7 +81,10 @@ export default {
75 81
             }
76 82
             newRegion.resorts.push(newResort);
77 83
           }
78
-          commit('addAvail', newRegion);
84
+          commit('addItem', {
85
+            name: 'availRegion',
86
+            value: newRegion,
87
+          });
79 88
         }
80 89
       }).catch(
81 90
         console
@@ -86,12 +95,18 @@ export default {
86 95
       commit,
87 96
       dispatch,
88 97
     }) {
89
-      commit('clearDetailed');
98
+      commit('setItem', {
99
+        name: 'detailedRegion',
100
+        value: [],
101
+      });
90 102
       axios.get(
91 103
         'https://www.tradeunipoint.com/unibackend/seam/resource/rest/products/regions/list/ZA/',
92 104
       )
93 105
         .then((result) => {
94
-          commit('setRegions', result.data);
106
+          commit('setItem', {
107
+            name: 'regions',
108
+            value: result.data,
109
+          });
95 110
           if (result.data) {
96 111
             for (const i in result.data) {
97 112
               const region = result.data[i];
@@ -101,18 +116,6 @@ export default {
101 116
         })
102 117
         .catch(console.error);
103 118
     },
104
-    getResort({
105
-      commit,
106
-    }, resortCode) {
107
-      axios.get(
108
-        `https://www.tradeunipoint.com/unibackend/seam/resource/rest/products/TRESORT/${
109
-          resortCode}`,
110
-      )
111
-        .then((result) => {
112
-          commit('setResort', result.data);
113
-        })
114
-        .catch(console.error);
115
-    },
116 119
     getDetailedRegion({
117 120
       commit,
118 121
     }, region) {
@@ -120,11 +123,14 @@ export default {
120 123
         axios
121 124
           .get(`https://www.tradeunipoint.com/unibackend/seam/resource/rest/products/resorts/${
122 125
             region.regionCode}/`)
123
-          .then(result => commit('addDetailed', {
124
-            id: region.id,
125
-            regionCode: region.regionCode,
126
-            regionName: region.regionName,
127
-            resorts: result.data,
126
+          .then(result => commit('addItem', {
127
+            name: 'detailedRegion',
128
+            value: {
129
+              id: region.id,
130
+              regionCode: region.regionCode,
131
+              regionName: region.regionName,
132
+              resorts: result.data,
133
+            },
128 134
           }))
129 135
           .catch(console.error);
130 136
       }

+ 20
- 22
src/store/modules/timeshare/timeshare.js Dosyayı Görüntüle

@@ -49,27 +49,8 @@ export default {
49 49
       mandate: undefined,
50 50
       status: undefined,
51 51
       owner: {
52
-        name: undefined,
53
-        surname: undefined,
54
-        idNumber: undefined,
55
-        companyRegNumber: undefined,
56
-        maritalStatus: undefined,
57
-        emailAddress: undefined,
58
-        cellNumber: undefined,
59
-        landlineNumber: undefined,
60
-        address: {
61
-          streetNumber: undefined,
62
-          streetName: undefined,
63
-          suburb: undefined,
64
-          city: undefined,
65
-          province: undefined,
66
-          postalCode: undefined,
67
-        },
68
-        bankingDetails: {
69
-          bank: undefined,
70
-          accountNumber: undefined,
71
-          accountHolder: undefined,
72
-        },
52
+        address: {},
53
+        bankingDetails: {},
73 54
       },
74 55
     },
75 56
   },
@@ -118,6 +99,9 @@ export default {
118 99
     displayResult(state) {
119 100
       state.result = 'Week has been added ^-^';
120 101
     },
102
+    setWeekDetail(state, week) {
103
+      state.sellItem = week;
104
+    },
121 105
   },
122 106
   getters: {
123 107
     getRegionCode(state) {
@@ -143,7 +127,7 @@ export default {
143 127
     initTimeshare({
144 128
       commit,
145 129
       dispatch,
146
-    }) {
130
+    }, timeshareId) {
147 131
       commit('setResortBedrooms', MyData.resortBedrooms);
148 132
       commit('setMaxSleep', MyData.maxBedrooms);
149 133
       commit('setBankedEntities', MyData.bankedEntities);
@@ -152,6 +136,20 @@ export default {
152 136
       dispatch('getAgencies');
153 137
       dispatch('getResorts');
154 138
       dispatch('getRegions');
139
+      if (timeshareId && timeshareId !== 0) {
140
+        dispatch('getWeekDetail', timeshareId);
141
+      }
142
+    },
143
+    getWeekDetail({
144
+      commit,
145
+    }, timeshareId) {
146
+      axios
147
+        .get(`api/timeshareweek/${timeshareId}`)
148
+        .then((result) => {
149
+          console.log(result.data);
150
+          commit('setWeekDetail', result.data);
151
+        })
152
+        .catch(console.error);
155 153
     },
156 154
     getSeasons({
157 155
       commit,

+ 6
- 7
src/store/modules/timeshare/week.js Dosyayı Görüntüle

@@ -6,22 +6,21 @@ import axios from 'axios';
6 6
 export default {
7 7
   namespaced: true,
8 8
   state: {
9
-    week: undefined,
9
+    currentWeek: undefined,
10 10
   },
11 11
   mutations: {
12 12
     setWeek(state, week) {
13
-      if (week.length > 0) {
14
-        state.week = week[0];
15
-      }
13
+      state.currentWeek = week;
16 14
     },
17 15
   },
18 16
   getters: {},
19 17
   actions: {
20 18
     initWeek({
21 19
       commit,
22
-    }, weekId) {
23
-      axios.get(`/api/timeshareweek/${weekId}`).then(r => commit('setWeek', r.data)).catch(console
24
-        .error);
20
+    }, week) {
21
+      commit('setWeek', week);
22
+      // axios.get(`/api/timeshareweek/${weekId}`).then(r => commit('setWeek', r.data)).catch(console
23
+      //  .error);
25 24
     },
26 25
   },
27 26
 };

+ 11
- 1
src/store/modules/timeshare/weekList.js Dosyayı Görüntüle

@@ -46,7 +46,6 @@ export default {
46 46
   },
47 47
   getters: {
48 48
     filteredWeeks: (state) => {
49
-      console.log(JSON.stringify(state.filter));
50 49
       let weekList = state.weeks;
51 50
       const {
52 51
         filter,
@@ -111,6 +110,17 @@ export default {
111 110
     getRegions(state, getters, rootState, rootGetters) {
112 111
       return rootGetters['timeshare/getRegionCode']('KK');
113 112
     },
113
+    weekById(state) {
114
+      return (resortCode, unitNumber) => {
115
+        const w = state.weeks.find(week => week.resort !== undefined && week.resort.resortCode
116
+          === resortCode && week.unitNumber === unitNumber);
117
+        console.log(resortCode, unitNumber);
118
+
119
+        if (w) {
120
+          return w;
121
+        }
122
+      };
123
+    },
114 124
   },
115 125
   actions: {
116 126
     applyResortFilter({

Loading…
İptal
Kaydet