Просмотр исходного кода

Force direct to EFT Page

master
30117125 4 лет назад
Родитель
Сommit
26eadc0cc6

+ 1
- 4
src/components/admin/status/agentsUserManagementPage.vue Просмотреть файл

@@ -100,10 +100,7 @@ export default {
100 100
       this.$router.push(goTo);
101 101
     },
102 102
     Edit(item) {
103
-      this.$router.push({
104
-        path: "/user/updateProfileInfo",
105
-        query: { id: item.id }
106
-      });
103
+      this.$router.push({ name: "UpdateAgentProfile", params: { agent: item } });
107 104
     },
108 105
     Delete(item) {
109 106
       this.deleteAgent(item.id);

+ 23
- 1
src/components/admin/status/userManagementPage.vue Просмотреть файл

@@ -22,6 +22,26 @@
22 22
               AGENTS
23 23
             </button>
24 24
           </div>
25
+          <div class="col-md-2 offset-2">
26
+            <button
27
+              type="button"
28
+              class="btn-solid-blue"
29
+              data-toggle="modal"
30
+              :data-target="'#myNewUserModal'"
31
+            >
32
+              NEW USER
33
+            </button>
34
+            <div :id="'myNewUserModal'" class="modal fade" role="dialog">
35
+              <div class="modal-dialog modal-lg">
36
+                <div class="modal-content">
37
+                  <div class="modal-header">
38
+                    <button type="button" class="close" data-dismiss="modal">&times;</button>
39
+                  </div>
40
+                  <Register />
41
+                </div>
42
+              </div>
43
+            </div>
44
+          </div>
25 45
         </div>
26 46
         <div class="row">
27 47
           <ListView
@@ -53,13 +73,15 @@ import { mapState, mapActions, mapGetters } from "vuex";
53 73
 
54 74
 import Log from "../../../assets/Log";
55 75
 import alert from "../../shared/alert.vue";
76
+import Register from "../../user/registerIndividual";
56 77
 import ListView from "../../shared/listView.vue";
57 78
 
58 79
 export default {
59 80
   name: "userManagementPage",
60 81
   components: {
61 82
     ListView,
62
-    alert
83
+    alert,
84
+    Register
63 85
   },
64 86
   data() {
65 87
     return {

+ 11
- 1
src/components/timeshare/sell/contentSection.vue Просмотреть файл

@@ -859,6 +859,7 @@ export default {
859 859
     this.initTimeshare(0);
860 860
     this.getIndividual(Log.getUser().id);
861 861
     this.getBanks();
862
+    this.getStatusList();
862 863
   },
863 864
   created() {
864 865
     this.initTimeshare(this.weekId);
@@ -880,6 +881,7 @@ export default {
880 881
     ]),
881 882
     ...mapState("individual", ["indiv"]),
882 883
     ...mapState("authentication", ["isLoggedIn"]),
884
+    ...mapState("status", ["statusList"]),
883 885
     ...mapGetters({
884 886
       user: "authentication/getUser",
885 887
       person: "authentication/getPerson"
@@ -932,6 +934,7 @@ export default {
932 934
     ...mapActions("timeshare", ["initTimeshare", "onResortChange", "saveWeek", "getBlankWeek"]),
933 935
     ...mapActions("payment", ["addPayment"]),
934 936
     ...mapActions("bank", ["getBanks"]),
937
+    ...mapActions("status", ["getStatusList"]),
935 938
     newSale() {
936 939
       this.weekId = 0;
937 940
       this.getBlankWeek();
@@ -940,10 +943,17 @@ export default {
940 943
       if (this.userLoggedIn) {
941 944
         this.sellItem.ownerObject = this.indiv;
942 945
         this.sellItem.weekStatus = "For Sale";
946
+        //Sets the status of the week to waiting for EFT Payment
947
+        this.statusList.forEach(status => {
948
+          if (status.code === "APEFT") {
949
+            this.sellItem.statusId = status.id;
950
+          }
951
+        });
943 952
         this.saveWeek(this.sellItem)
944 953
           .then(fulfilled => {
945 954
             console.log(fulfilled);
946
-            this.$router.push({ name: "PaymentOption", params: { week: fulfilled } });
955
+            // this.$router.push({ name: "PaymentOption", params: { week: fulfilled } });
956
+            this.$router.push({ name: "EFTPage", params: { week: fulfilled } });
947 957
             //this.paygateRedirect();
948 958
           })
949 959
           .catch(ex => {

+ 182
- 0
src/components/user/updateAgentProfile.vue Просмотреть файл

@@ -0,0 +1,182 @@
1
+<template>
2
+  <main id="main">
3
+    <section id="contact2">
4
+      <div class="container">
5
+        <div class="row">
6
+          <div class="section-header">
7
+            <h2>Update Agent Info</h2>
8
+          </div>
9
+        </div>
10
+        <div class="row">
11
+          <div class="col">
12
+            <float-label>
13
+              <input
14
+                type="text"
15
+                name="name"
16
+                class="form-control uniInput"
17
+                id="name"
18
+                placeholder="USERNAME"
19
+                data-rule="minlen:4"
20
+                data-msg="Please enter your name"
21
+                v-model="agent.user.username"
22
+              />
23
+            </float-label>
24
+          </div>
25
+          <div class="col">
26
+            <float-label>
27
+              <input
28
+                type="text"
29
+                name="name"
30
+                class="form-control uniInput"
31
+                id="name"
32
+                placeholder="NAME"
33
+                data-rule="minlen:4"
34
+                data-msg="Please enter your name"
35
+                v-model="agent.name"
36
+              />
37
+            </float-label>
38
+          </div>
39
+        </div>
40
+        <div class="row mt-4">
41
+          <div class="col-md-6">
42
+            <float-label>
43
+              <input
44
+                type="text"
45
+                class="form-control uniInput"
46
+                name="surname"
47
+                id="surname"
48
+                placeholder="SURNAME"
49
+                data-msg="Please enter your surname"
50
+                v-model="agent.surname"
51
+              />
52
+            </float-label>
53
+          </div>
54
+          <div class="col">
55
+            <float-label>
56
+              <input
57
+                type="text"
58
+                class="form-control uniInput"
59
+                name="email"
60
+                id="email"
61
+                placeholder="EMAIL ADDRESS"
62
+                data-msg="Please enter your email address"
63
+                v-model="agent.email"
64
+              />
65
+            </float-label>
66
+          </div>
67
+          <!-- <div class="col">
68
+            <float-label>
69
+              <input
70
+                type="text"
71
+                name="idnum"
72
+                class="form-control uniInput"
73
+                id="idnum"
74
+                placeholder="ID NUMBER"
75
+                data-rule="minlen:4"
76
+                data-msg="Please enter your ID number"
77
+              />
78
+            </float-label>
79
+          </div> -->
80
+        </div>
81
+        <!-- <div class="row mt-4">
82
+          <div class="col-md-6">
83
+            <float-label>
84
+              <input
85
+                type="text"
86
+                class="form-control uniInput"
87
+                name="company"
88
+                id="company"
89
+                placeholder="COMPANY REG NUMBER"
90
+                data-rule="minlen:4"
91
+                data-msg="Please enter your company reg number"
92
+              />
93
+            </float-label>
94
+          </div>
95
+        </div> -->
96
+        <div class="row mt-4">
97
+          <div class="col">
98
+            <float-label>
99
+              <input
100
+                type="text"
101
+                name="cell"
102
+                class="form-control uniInput"
103
+                id="cell"
104
+                placeholder="CELL NUMBER"
105
+                data-rule="minlen:4"
106
+                data-msg="Please enter your cell number"
107
+                v-model="agent.cellNumber"
108
+              />
109
+            </float-label>
110
+          </div>
111
+          <div class="col">
112
+            <float-label>
113
+              <input
114
+                type="text"
115
+                class="form-control uniInput"
116
+                name="landline"
117
+                id="landline"
118
+                placeholder="LANDLINE NUMBER"
119
+                data-msg="Please enter your landline number"
120
+                v-model="agent.telephone"
121
+              />
122
+            </float-label>
123
+          </div>
124
+        </div>
125
+        <div class="row mt-4">
126
+          <div class="col">
127
+            <float-label fixed label="AGENCY">
128
+              <select v-model="agent.agencyId" class="form-control uniSelect" name="" id="">
129
+                <option v-for="agency in agencies" :key="agency.id" :value="agency.id">{{
130
+                  agency.agencyName
131
+                }}</option>
132
+              </select>
133
+            </float-label>
134
+          </div>
135
+        </div>
136
+        <div class="row mt-5 mb-5">
137
+          <div class="col">
138
+            <button class="btn-solid-blue" @click="sendToApi()">SAVE</button>
139
+          </div>
140
+          <div class="col">
141
+            <button class="btn-solid-blue" @click="$router.go(-1)">CLOSE</button>
142
+          </div>
143
+        </div>
144
+      </div>
145
+    </section>
146
+  </main>
147
+</template>
148
+
149
+<script>
150
+/* eslint-disable */
151
+import { mapState, mapActions, mapGetters } from "vuex";
152
+
153
+export default {
154
+  props: {
155
+    agent: {}
156
+  },
157
+  created() {
158
+    this.getAgencies();
159
+  },
160
+  computed: {
161
+    ...mapState("timeshare", ["agencies"])
162
+  },
163
+  methods: {
164
+    ...mapActions("timeshare", ["getAgencies", "updateAgent"]),
165
+    sendToApi() {
166
+      this.agent.fullName = this.agent.name + " " + this.agent.surname;
167
+      if (this.agent.telephone === "") {
168
+        delete this.agent.telephone;
169
+      }
170
+      if (this.agent.cellNumber === "") {
171
+        delete this.agent.cellNumber;
172
+      }
173
+      console.log(this.agent);
174
+      this.updateAgent(this.agent).then(() => {
175
+        this.$router.go(-1);
176
+      });
177
+    }
178
+  }
179
+};
180
+</script>
181
+
182
+<style lang="scss" scoped></style>

+ 9
- 0
src/router/index.js Просмотреть файл

@@ -55,6 +55,7 @@ import UnitConfiguration from "../components/admin/unitConfiguration/unitConfigu
55 55
 import agentManagementPage from "../components/admin/status/agentsUserManagementPage.vue";
56 56
 import Fees from "../components/admin/fees/feesPage.vue";
57 57
 import PasswordOnLogin from "../components/user/firstLoginPasswordUpdate.vue";
58
+import UpdateAgentProfile from '../components/user/updateAgentProfile.vue'
58 59
 
59 60
 import ResortPage from "../components/timeshare/resort/resortPageNew.vue";
60 61
 import UnitPage from "../components/timeshare/resort/unit/unitPageNew.vue";
@@ -552,5 +553,13 @@ export default new Router({
552 553
       }),
553 554
       component: EFTPage,
554 555
     },
556
+    {
557
+      path: "/user/agent/update",
558
+      name: "UpdateAgentProfile",
559
+      props: route => ({
560
+        ...route.params
561
+      }),
562
+      component: UpdateAgentProfile,
563
+    },
555 564
   ]
556 565
 });

+ 20
- 0
src/store/modules/timeshare/timeshare.js Просмотреть файл

@@ -101,6 +101,17 @@ export default {
101 101
     },
102 102
     setWeekDetail(state, week) {
103 103
       state.sellItem = week;
104
+    },
105
+    agentUpdate(state, agent) {
106
+      var index
107
+      var count = 0
108
+      state.agents.forEach((item) => {
109
+        if (item.id === agent.id) {
110
+          index = count
111
+        }
112
+        count++
113
+      })
114
+      Object.assign(state.agents[index], agent)
104 115
     }
105 116
   },
106 117
   getters: {
@@ -224,6 +235,15 @@ export default {
224 235
         .get("/api/timeshareweek/gettemplate")
225 236
         .then(result => commit("setWeekDetail", result.data))
226 237
         .catch(console.error);
238
+    },
239
+    async updateAgent({commit}, agent){
240
+      await axios.put("/api/agent", agent)
241
+      .then((result) => {
242
+        commit("agentUpdate", result.data)
243
+      })
244
+      .catch((ex) => {
245
+        console.log(ex);
246
+      })
227 247
     }
228 248
   }
229 249
 };

Загрузка…
Отмена
Сохранить