Kaynağa Gözat

Timeshare sell edit & error fix

master
30117125 4 yıl önce
ebeveyn
işleme
e9bab33e68

BIN
dist.zip Dosyayı Görüntüle


+ 6
- 3
src/components/admin/property/propertyList.vue Dosyayı Görüntüle

@@ -18,8 +18,12 @@
18 18
       <div class="row">
19 19
         <br />
20 20
       </div>
21
-      <div class="row">
22
-        <div class="col-lg-12">
21
+
22
+      <div v-if="wait" id="preloader"></div>
23
+    </div>
24
+    <div class="container-fluid">
25
+      <div class="row justify-content-center">
26
+        <div class="col-auto">
23 27
           <table class="table table-striped table-responsive">
24 28
             <thead>
25 29
               <tr>
@@ -136,7 +140,6 @@
136 140
           </div>
137 141
         </div>
138 142
       </div>
139
-      <div v-if="wait" id="preloader"></div>
140 143
     </div>
141 144
   </section>
142 145
 </template>

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

@@ -235,7 +235,6 @@
235 235
                       v-model="depDateParam"
236 236
                     />
237 237
                   </float-label>
238
-
239 238
                   <div class="validation"></div>
240 239
                 </div>
241 240
                 <div class="form-group col-md-6 mt-2">

+ 6
- 6
src/components/admin/status/timeshareAdminList.vue Dosyayı Görüntüle

@@ -203,12 +203,12 @@ export default {
203 203
       "deleteListing"
204 204
     ]),
205 205
     Publish(item) {
206
-      // var today = new Date();
207
-      // var dd = String(today.getDate()).padStart(2, "0");
208
-      // var mm = String(today.getMonth() + 1).padStart(2, "0"); //January is 0!
209
-      // var yyyy = today.getFullYear();
210
-      // item.pulbishedDate = today.toISOString().substring(0, 19);
211
-      // item.publish = true;
206
+      var today = new Date();
207
+      var dd = String(today.getDate()).padStart(2, "0");
208
+      var mm = String(today.getMonth() + 1).padStart(2, "0"); //January is 0!
209
+      var yyyy = today.getFullYear();
210
+      item.pulbishedDate = today.toISOString().substring(0, 19);
211
+      item.publish = true;
212 212
       // item.status.id = 26;
213 213
       // item.status.code = "FS";
214 214
       // item.status.description = "For Sale";

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

@@ -6,7 +6,7 @@
6 6
     <div>
7 7
       <header id="header" style="width: 100%; position: fixed; top:0px; z-index: 50;">
8 8
         <div class="container">
9
-          <div class="row">
9
+          <div class="row justify-content-center">
10 10
             <div id="logo" class="col-md-3 col-xs-4 pull-left">
11 11
               <a href="/">
12 12
                 <img
@@ -111,7 +111,7 @@
111 111
                       <li>
112 112
                         <router-link to="/timeshare/faq">FAQ</router-link>
113 113
                       </li>
114
-                      <li v-if="weekCount > 0">
114
+                      <li>
115 115
                         <hr />
116 116
                         <router-link to="/timeshare/myWeeks">My Timeshare Weeks</router-link>
117 117
                       </li>

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

@@ -160,7 +160,7 @@
160 160
 </template>
161 161
 <script>
162 162
 /* eslint-disable */
163
-import { mapState, mapActions } from "vuex";
163
+import { mapState, mapActions, mapGetters } from "vuex";
164 164
 import Log from "../../assets/Log";
165 165
 import ListView from "../shared/listView.vue";
166 166
 import BasePagination from "../shared/basePagination";
@@ -211,14 +211,18 @@ export default {
211 211
       ]
212 212
     };
213 213
   },
214
-  mounted() {
215
-    this.getItems(Log.getUser().id);
214
+  created() {
215
+    this.getItems(Log.getUser().id).then(() => {
216
+      this.wait = false;
217
+    });
216 218
   },
219
+  mounted() {},
217 220
   computed: {
221
+    ...mapGetters({ getNeedsVerify: "myWeeks/getNeedsVerify" }),
218 222
     ...mapState("myWeeks", ["items"]),
219 223
     FilteredListings() {
220 224
       if (this.filter) {
221
-        const list = _.filter(this.items, item =>
225
+        const list = _.filter(this.getNeedsVerify, item =>
222 226
           Object.values(item).some(
223 227
             i =>
224 228
               JSON.stringify(i)
@@ -228,7 +232,7 @@ export default {
228 232
         );
229 233
         return _.orderBy(list, this.sortKey, this.SortDirection);
230 234
       } else {
231
-        return _.orderBy(this.items, this.sortKey, this.SortDirection);
235
+        return _.orderBy(this.getNeedsVerify, this.sortKey, this.SortDirection);
232 236
       }
233 237
     },
234 238
     PageCount() {

+ 4
- 2
src/components/timeshare/sell/contentSection.vue Dosyayı Görüntüle

@@ -809,7 +809,7 @@
809 809
                   type="number"
810 810
                   step="any"
811 811
                   name="commission"
812
-                  v-model="sellItem.agentCommission"
812
+                  v-model="sellItem.agentCommision"
813 813
                   placeholder="R"
814 814
                 />
815 815
                 <div class="validation"></div>
@@ -1050,7 +1050,8 @@ export default {
1050 1050
         this.sellItem.ownerObject = this.indiv;
1051 1051
         //console.log(this.sellItem.ownerObject);
1052 1052
         console.log(this.sellItem);
1053
-        if (!this.boolError)
1053
+        console.log(JSON.stringify(this.sellItem));
1054
+        if (!this.boolError) {
1054 1055
           this.saveWeek(this.sellItem)
1055 1056
             .then(fulfilled => {
1056 1057
               // this.$router.push({ name: "PaymentOption", params: { week: fulfilled } });
@@ -1061,6 +1062,7 @@ export default {
1061 1062
               this.errorOccurred = "ERRORHTML";
1062 1063
               this.errorMessage = ex;
1063 1064
             });
1065
+        }
1064 1066
       } else {
1065 1067
         this.$router.push("/user/login");
1066 1068
       }

+ 29
- 27
src/components/timeshare/sell/contentSectionPF.vue Dosyayı Görüntüle

@@ -29,6 +29,7 @@
29 29
                       name="agency"
30 30
                       v-model="sellItem.agencyId"
31 31
                     >
32
+                      <option value=""></option>
32 33
                       <option v-for="(item, i) in agencies" :key="i" :value="item.id">
33 34
                         {{ item.agencyName }}
34 35
                       </option>
@@ -43,6 +44,7 @@
43 44
                       v-model="sellItem.agentId"
44 45
                       :disabled="!sellItem.agencyId"
45 46
                     >
47
+                      <option value=""></option>
46 48
                       <option
47 49
                         v-for="(item, i) in displayNotDeletedAgents"
48 50
                         :key="i"
@@ -313,6 +315,16 @@
313 315
             <h2>Detailed Individual Information</h2>
314 316
           </div>
315 317
           <div class="form">
318
+            <div class="row mb-4">
319
+              <div class="col-md-12">
320
+                <float-label label="OWNER TYPE" fixed>
321
+                  <select class="form-control uniSelect" name="" id="" v-model="selectedUserType">
322
+                    <option value="myself">MYSELF</option>
323
+                    <option value="custom">CUSTOM USER</option>
324
+                  </select>
325
+                </float-label>
326
+              </div>
327
+            </div>
316 328
             <div class="row mb-2">
317 329
               <div class="form-group col-md-6">
318 330
                 <float-label>
@@ -389,30 +401,22 @@
389 401
                     >
390 402
                   </span>
391 403
 
392
-                  <float-label label="Marital Status" style="width: 100%">
404
+                  <float-label fixed label="Marital Status" style="width: 100%">
393 405
                     <select
394 406
                       class="form-control uniSelect"
395 407
                       id="howMarried"
396 408
                       v-model="indiv.howMarried"
397 409
                     >
398
-                      <option value="N/A">N/A</option>
399
-                      <option value="In Community Of Property">
400
-                        In Community Of Property
401
-                      </option>
402
-                      <option value="Out of Community Of Property">
403
-                        Out of Community Of Property
404
-                      </option>
405
-                      <option value="Other">Other</option>
406
-                      <option value="Traditional Wedding">
407
-                        Traditional Wedding
408
-                      </option>
409
-                      <option value="Single">Single</option>
410
-                      <option value="Divorced">Divorced</option>
411
-                      <option value="Widow">Widow</option>
412
-                      <option value="Committed Relationship">
413
-                        Committed Relationship
414
-                      </option>
415
-                      <option value="Partner">Partner</option>
410
+                      <option v-bind:value="0">N/A</option>
411
+                      <option v-bind:value="1">In Community Of Property</option>
412
+                      <option v-bind:value="2">Out of Community Of Property</option>
413
+                      <option v-bind:value="3">Other</option>
414
+                      <option v-bind:value="4">Traditional Wedding</option>
415
+                      <option v-bind:value="5">Single</option>
416
+                      <option v-bind:value="6">Divorced</option>
417
+                      <option v-bind:value="7">Widow</option>
418
+                      <option v-bind:value="8">Committed Relationship</option>
419
+                      <option v-bind:value="9">Partner</option>
416 420
                     </select>
417 421
                   </float-label>
418 422
                 </div>
@@ -445,7 +449,7 @@
445 449
                     placeholder="Cell Number"
446 450
                     data-rule="minlen:4"
447 451
                     data-msg="Please enter your cell number"
448
-                    v-model="indiv.cellNumner"
452
+                    v-model="indiv.cellNumber"
449 453
                   />
450 454
                 </float-label>
451 455
 
@@ -468,10 +472,10 @@
468 472
               </div>
469 473
             </div>
470 474
           </div>
471
-          <div v-if="indiv.howMarried === 'In Community Of Property'" class="section-header">
475
+          <div v-if="indiv.howMarried === 1" class="section-header">
472 476
             <h2>Spouse Details</h2>
473 477
           </div>
474
-          <div v-if="indiv.howMarried === 'In Community Of Property'" class="form">
478
+          <div v-if="indiv.howMarried === 1" class="form">
475 479
             <div class="form-row mb-2">
476 480
               <div class="form-group col-md-6 mt-2">
477 481
                 <float-label>
@@ -805,7 +809,7 @@
805 809
                   type="number"
806 810
                   step="any"
807 811
                   name="commission"
808
-                  v-model="sellItem.agentCommission"
812
+                  v-model="sellItem.agentCommision"
809 813
                   placeholder="R"
810 814
                 />
811 815
                 <div class="validation"></div>
@@ -830,11 +834,9 @@
830 834
                 </p>
831 835
               </div>
832 836
             </div>
833
-            <div class="form-row" v-if="profileEmailError">
837
+            <div class="form-row">
834 838
               <div class="col-md-12">
835
-                <p class="alert myError">
836
-                  Please ensure that your email is correct before adding a timeshare week.
837
-                </p>
839
+                <alert :text="errorMessage" :type="errorOccurred" />
838 840
               </div>
839 841
             </div>
840 842
             <div class="text-center col-12" v-if="CanSave">

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

@@ -9,12 +9,9 @@
9 9
                 <div class="card card-signin my-5">
10 10
                   <div class="card-body">
11 11
                     <h3 class="card-title text-center">Login</h3>
12
-                    <div v-if="error">
13
-                      <alert
14
-                        :text="'User doesn\'t exist or Username and Password is incorrect'"
15
-                        :type="'ERROR'"
16
-                      />
17
-                    </div>
12
+
13
+                    <alert :text="errorMessage" :type="errorOccurred" />
14
+
18 15
                     <div v-if="page">
19 16
                       <alert :text="page.text" :type="'INFO'" />
20 17
                     </div>
@@ -100,6 +97,8 @@ export default {
100 97
     return {
101 98
       username: "",
102 99
       password: "",
100
+      errorOccurred: "",
101
+      errorMessage: "",
103 102
       isPasswordShown: "password",
104 103
       selectItems: [{ text: "password", value: 0 }],
105 104
       selectErrors: "Some error with the field",
@@ -129,6 +128,7 @@ export default {
129 128
       this.login({ username: this.username, password: this.password })
130 129
         .then(() => {
131 130
           // console.log(Log.getUser());
131
+
132 132
           if (!this.page) {
133 133
             if (!Log.getUser().loginPasswordChange) {
134 134
               this.$router.push("/");
@@ -140,7 +140,11 @@ export default {
140 140
           }
141 141
         })
142 142
         .catch(err => {
143
-          this.error = true;
143
+          console.log(err.status);
144
+          if (err.status === 401) {
145
+            this.errorOccurred = "ERROR";
146
+            this.errorMessage = err.data.message;
147
+          }
144 148
         });
145 149
     },
146 150
     checkUserStatus() {

+ 3
- 3
src/components/user/registerAgencySection.vue Dosyayı Görüntüle

@@ -144,8 +144,6 @@
144 144
       </div>
145 145
     </div>
146 146
     <button
147
-      :data-target="'#myModalAgency'"
148
-      data-toggle="modal"
149 147
       v-if="registerAgency.user.acceptedTerms"
150 148
       v-on:click="SubmitData()"
151 149
       class="btn-solid-blue"
@@ -163,6 +161,7 @@
163 161
     >
164 162
       Cancel
165 163
     </button>
164
+    <button hidden :data-target="'#myModalAgency'" data-toggle="modal" ref="dataToggle"></button>
166 165
   </div>
167 166
 </template>
168 167
 
@@ -220,9 +219,10 @@ export default {
220 219
           if (Log.getUser().role !== "Super Admin") {
221 220
             this.$router.push("/user/login");
222 221
           } else {
222
+            this.$refs.dataToggle.click();
223 223
             this.$router.go();
224 224
           }
225
-        }, 2500);
225
+        }, 500);
226 226
       });
227 227
       //this.$router.push("/user/login");
228 228
     },

+ 3
- 3
src/components/user/registerIndividual.vue Dosyayı Görüntüle

@@ -111,8 +111,6 @@
111 111
         </div>
112 112
       </div>
113 113
       <button
114
-        :data-target="'#myNewUserModal'"
115
-        data-toggle="modal"
116 114
         :disabled="isDisabled"
117 115
         v-on:click="SubmitData()"
118 116
         :class="isDisabled ? 'btn-disabled' : 'btn-solid-blue'"
@@ -130,6 +128,7 @@
130 128
       >
131 129
         Cancel
132 130
       </button>
131
+      <button hidden :data-target="'#myModalAgency'" data-toggle="modal" ref="dataToggle"></button>
133 132
     </div>
134 133
   </main>
135 134
 </template>
@@ -203,9 +202,10 @@ export default {
203 202
             if (Log.getUser().role !== "Super Admin") {
204 203
               this.$router.push("/user/login");
205 204
             } else {
205
+              this.$refs.dataToggle.click();
206 206
               this.$router.go();
207 207
             }
208
-          }, 2500);
208
+          }, 500);
209 209
         })
210 210
         .catch(err => {
211 211
           this.boolUserExists = true;

+ 47
- 3
src/components/user/updateProfileInfo.vue Dosyayı Görüntüle

@@ -105,6 +105,7 @@
105 105
           <div class="validation"></div>
106 106
         </div>
107 107
       </div>
108
+
108 109
       <div v-if="!isAgent()" class="row mb-2">
109 110
         <div class="form-group col-md-6">
110 111
           <div class="input-group">
@@ -422,6 +423,7 @@ import DetailIndividual from "./timeshareIndividual.vue";
422 423
 import addressAutoComplete from "../shared/addressAutoComplete";
423 424
 import Log from "../../assets/Log";
424 425
 import Alert from "../shared/alert";
426
+import logOutVue from "./logOut.vue";
425 427
 
426 428
 export default {
427 429
   name: "UpdateInfo",
@@ -459,6 +461,9 @@ export default {
459 461
         }
460 462
       } else {
461 463
         this.individual = this.indiv;
464
+        this.individual.telephone = this.indiv.landlineNumber;
465
+        this.individual.email = this.indiv.emailAddress;
466
+        console.log(this.indiv);
462 467
         this.individual.user = Log.getUser();
463 468
       }
464 469
       this.getAgencies();
@@ -527,7 +532,6 @@ export default {
527 532
     sendToApi() {
528 533
       this.boolError = false;
529 534
       this.individual.emailAddress = this.individual.email;
530
-
531 535
       if (this.individual.telephone !== "") {
532 536
         if (this.individual.telephone !== null) {
533 537
           if (!this.validPhoneNumber(this.individual.telephone)) {
@@ -583,9 +587,30 @@ export default {
583 587
           this.saveAgent(this.individual)
584 588
             .then(() => {
585 589
               if (Log.getUser().role === "Super Admin") {
590
+                // console.log(this.individual);
591
+                // console.log(JSON.parse(localStorage.getItem("person")));
592
+                if (this.individual.id === JSON.parse(localStorage.getItem("person"))) {
593
+                  var newPerson = {
594
+                    id: JSON.parse(localStorage.getItem("person")).id,
595
+                    email: this.individual.email,
596
+                    fullname: this.individual.name + " " + this.individual.surname,
597
+                    name: this.individual.name,
598
+                    surname: this.individual.surname
599
+                  };
600
+                  this.$router.go();
601
+                  localStorage.setItem("person", JSON.stringify(newPerson));
602
+                }
586 603
                 this.$router.push("/status/userManagementPage");
587 604
               } else {
588
-                this.$router.push("/");
605
+                var newPerson = {
606
+                  id: JSON.parse(localStorage.getItem("person")).id,
607
+                  email: this.individual.email,
608
+                  fullname: this.individual.name + " " + this.individual.surname,
609
+                  name: this.individual.name,
610
+                  surname: this.individual.surname
611
+                };
612
+                localStorage.setItem("person", JSON.stringify(newPerson));
613
+                this.$router.go();
589 614
               }
590 615
             })
591 616
             .catch(ex => {
@@ -596,9 +621,28 @@ export default {
596 621
         } else {
597 622
           this.updateIndividual(this.individual).then(() => {
598 623
             if (Log.getUser().role === "Super Admin") {
624
+              if (this.individual.id === JSON.parse(localStorage.getItem("person")).id) {
625
+                var newPerson = {
626
+                  id: JSON.parse(localStorage.getItem("person")).id,
627
+                  email: this.individual.email,
628
+                  fullname: this.individual.name + " " + this.individual.surname,
629
+                  name: this.individual.name,
630
+                  surname: this.individual.surname
631
+                };
632
+                this.$router.go();
633
+                localStorage.setItem("person", JSON.stringify(newPerson));
634
+              }
599 635
               this.$router.push("/status/userManagementPage");
600 636
             } else {
601
-              this.$router.push("/");
637
+              var newPerson = {
638
+                id: JSON.parse(localStorage.getItem("person")).id,
639
+                email: this.individual.email,
640
+                fullname: this.individual.name + " " + this.individual.surname,
641
+                name: this.individual.name,
642
+                surname: this.individual.surname
643
+              };
644
+              localStorage.setItem("person", JSON.stringify(newPerson));
645
+              this.$router.go();
602 646
             }
603 647
           });
604 648
         }

+ 2
- 2
src/main.js Dosyayı Görüntüle

@@ -33,8 +33,8 @@ Vue.use(VueGoogleMaps, {
33 33
 });
34 34
 Vue.config.productionTip = false;
35 35
 //axios.defaults.baseURL = "http://localhost:57260";
36
-axios.defaults.baseURL = "https://www.pvsl.co.za:86/";
37
-//axios.defaults.baseURL = "http://training.provision-sa.com:82/";
36
+//axios.defaults.baseURL = "https://www.pvsl.co.za:86/";
37
+axios.defaults.baseURL = "http://training.provision-sa.com:82/";
38 38
 //axios.defaults.baseURL = "http://localhost:8080/";
39 39
 
40 40
 Vue.prototype.$axios = axios;

+ 9
- 8
src/store/modules/user/authentication.js Dosyayı Görüntüle

@@ -66,25 +66,26 @@ export default {
66 66
       });
67 67
     },
68 68
     async login({ commit }, user) {
69
-      const response = await axios({
69
+      await axios({
70 70
         url: "/api/register/authenticate",
71 71
         data: {
72 72
           username: user.username,
73 73
           password: user.password
74 74
         },
75 75
         method: "POST"
76
-      });
77
-      if (response.status === 200) {
76
+      }).then((resp) => {
78 77
         log.clearValues();
79
-        log.setValues(response.data);
80
-        commit("auth_success", response.data);
78
+        log.setValues(resp.data);
79
+        commit("auth_success", resp.data);
81 80
         return Promise.resolve();
82
-      } else {
81
+      })
82
+      .catch((ex) => {        
83 83
         commit("auth_error");
84 84
         log.clearValues();
85 85
         commit("auth_error", "error occurred");
86
-        return Promise.reject();
87
-      }
86
+        return Promise.reject(ex.response);
87
+      })
88
+      
88 89
     },
89 90
     logout({ commit }) {
90 91
       return new Promise(() => {

+ 15
- 7
src/store/modules/user/register.js Dosyayı Görüntüle

@@ -107,12 +107,19 @@ export default {
107 107
   getters: {},
108 108
   actions: {
109 109
     async forgotPasswordCheck({commit}, mail){
110
-      const response = await axios.post('api/register/forgotPassword/'+ mail)
111
-      if(response.status === 200){
112
-        return Promise.resolve()
113
-      }else{
114
-        return Promise.reject()
115
-      }
110
+      await axios.post('api/register/forgotPassword/'+ mail).then((resp) => {
111
+        return Promise.resolve(resp.data)
112
+      })
113
+      .catch((ex) => {
114
+        console.log(ex.response);
115
+        return Promise.reject(ex.response)
116
+      })
117
+      // if(response.status === 200){
118
+      //   return Promise.resolve()
119
+      // }else{
120
+      //   console.log(response.response);
121
+      //   return Promise.reject()
122
+      // }
116 123
     },
117 124
     getIndividuals({ commit }) {
118 125
       axios
@@ -155,7 +162,8 @@ export default {
155 162
           return promise.resolve()
156 163
         })
157 164
         .catch((ex) => {
158
-          return promise.reject(ex)
165
+          console.log(ex.response);
166
+          return promise.reject(ex.response)
159 167
           //console.error;
160 168
         });
161 169
     },

+ 2
- 2
vue.config.js Dosyayı Görüntüle

@@ -3,8 +3,8 @@ module.exports = {
3 3
     proxy: {
4 4
       "/api": {
5 5
         //target: "http://localhost:57260/",
6
-        //target: "http://training.provision-sa.com:82/",
7
-        target: "https://www.pvsl.co.za:86/",
6
+        target: "http://training.provision-sa.com:82/",
7
+        //target: "https://www.pvsl.co.za:86/",
8 8
         changeOrigin: true
9 9
       },
10 10
       "/nph-srep": {

Loading…
İptal
Kaydet