|
|
@@ -11,92 +11,84 @@
|
|
11
|
11
|
<div class="row" style="text-align:left">
|
|
12
|
12
|
<div class="col-md-6">
|
|
13
|
13
|
<label>Name *</label>
|
|
14
|
|
- <div class="input-group-prepend">
|
|
15
|
|
- <span class="input-group-text">
|
|
16
|
|
- <eva-icon name="person-outline" fill="#60CBEB"></eva-icon>
|
|
17
|
|
- </span>
|
|
18
|
|
- <input class="form-control" type="text" name="name" v-model="currentUser.name" />
|
|
19
|
|
- </div>
|
|
|
14
|
+ <prop-field
|
|
|
15
|
+ :display="currentUser.name"
|
|
|
16
|
+ :editType="'text'"
|
|
|
17
|
+ :propertyName="'name'"
|
|
|
18
|
+ :mayEdit="true"
|
|
|
19
|
+ @UpdateValue="UpdateValue"
|
|
|
20
|
+ />
|
|
20
|
21
|
</div>
|
|
21
|
22
|
<div class="col-md-6" style="margin-bottom: 1em">
|
|
22
|
23
|
<label>Surname *</label>
|
|
23
|
|
- <div class="input-group-prepend">
|
|
24
|
|
- <span class="input-group-text">
|
|
25
|
|
- <eva-icon name="book-outline" fill="#60CBEB"></eva-icon>
|
|
26
|
|
- </span>
|
|
27
|
|
- <input class="form-control" type="text" name="surname" v-model="currentUser.surname" />
|
|
28
|
|
- </div>
|
|
|
24
|
+ <prop-field
|
|
|
25
|
+ :display="currentUser.surname"
|
|
|
26
|
+ :editType="'text'"
|
|
|
27
|
+ :propertyName="'surname'"
|
|
|
28
|
+ :mayEdit="true"
|
|
|
29
|
+ @UpdateValue="UpdateValue"
|
|
|
30
|
+ />
|
|
29
|
31
|
</div>
|
|
30
|
32
|
<div class="col-md-6" style="margin-bottom: 1em">
|
|
31
|
33
|
<label>ID Number *</label>
|
|
32
|
|
- <div class="input-group-prepend">
|
|
33
|
|
- <span class="input-group-text">
|
|
34
|
|
- <eva-icon name="archive" fill="#60CBEB"></eva-icon>
|
|
35
|
|
- </span>
|
|
36
|
|
- <input class="form-control" type="text" name="idnumber" v-model="currentUser.idNumber" />
|
|
37
|
|
- </div>
|
|
|
34
|
+ <prop-field
|
|
|
35
|
+ :display="currentUser.idNumber"
|
|
|
36
|
+ :editType="'text'"
|
|
|
37
|
+ :propertyName="'idNumber'"
|
|
|
38
|
+ :mayEdit="true"
|
|
|
39
|
+ @UpdateValue="UpdateValue"
|
|
|
40
|
+ />
|
|
38
|
41
|
</div>
|
|
39
|
42
|
<div class="col-md-6" style="margin-bottom: 1em">
|
|
40
|
43
|
<label>Company Reg Number *</label>
|
|
41
|
|
- <div class="input-group-prepend">
|
|
42
|
|
- <span class="input-group-text">
|
|
43
|
|
- <eva-icon name="npm-outline" fill="#60CBEB"></eva-icon>
|
|
44
|
|
- </span>
|
|
45
|
|
- <input
|
|
46
|
|
- class="form-control"
|
|
47
|
|
- type="text"
|
|
48
|
|
- name="companyregnumber"
|
|
49
|
|
- v-model="currentUser.companyRegNumber"
|
|
50
|
|
- />
|
|
51
|
|
- </div>
|
|
|
44
|
+ <prop-field
|
|
|
45
|
+ :display="currentUser.companyRegNumber"
|
|
|
46
|
+ :editType="'text'"
|
|
|
47
|
+ :propertyName="'companyRegNumber'"
|
|
|
48
|
+ :mayEdit="true"
|
|
|
49
|
+ @UpdateValue="UpdateValue"
|
|
|
50
|
+ />
|
|
52
|
51
|
</div>
|
|
53
|
52
|
<div class="col-md-6" style="margin-bottom: 1em">
|
|
54
|
53
|
<label>Marital Status *</label>
|
|
55
|
|
- <div class="input-group-prepend">
|
|
56
|
|
- <span class="input-group-text">
|
|
57
|
|
- <eva-icon name="people-outline" fill="#60CBEB"></eva-icon>
|
|
58
|
|
- </span>
|
|
59
|
|
- <select class="form-control" name="maritalstatus" v-model="currentUser.maritalStatus">
|
|
60
|
|
- <option v-for="(item, i) in maritalStatus" :key="i">{{item}}</option>
|
|
61
|
|
- </select>
|
|
62
|
|
- </div>
|
|
|
54
|
+ <prop-field
|
|
|
55
|
+ :display="currentUser.maritalStatus"
|
|
|
56
|
+ :arrayObject="maritalStatus"
|
|
|
57
|
+ :editType="'selector'"
|
|
|
58
|
+ :propertyName="'maritalStatus'"
|
|
|
59
|
+ :mayEdit="true"
|
|
|
60
|
+ @UpdateValue="UpdateValue"
|
|
|
61
|
+ />
|
|
63
|
62
|
</div>
|
|
64
|
63
|
<div class="col-md-6" style="margin-bottom: 1em">
|
|
65
|
64
|
<label>Email Address *</label>
|
|
66
|
|
- <div class="input-group-prepend">
|
|
67
|
|
- <span class="input-group-text">
|
|
68
|
|
- <eva-icon name="email-outline" fill="#60CBEB"></eva-icon>
|
|
69
|
|
- </span>
|
|
70
|
|
- <input class="form-control" type="text" name="email" v-model="currentUser.emailAddress" />
|
|
71
|
|
- </div>
|
|
|
65
|
+ <prop-field
|
|
|
66
|
+ :display="currentUser.emailAddress"
|
|
|
67
|
+ :editType="'text'"
|
|
|
68
|
+ :propertyName="'email'"
|
|
|
69
|
+ :mayEdit="true"
|
|
|
70
|
+ @UpdateValue="UpdateValue"
|
|
|
71
|
+ />
|
|
72
|
72
|
</div>
|
|
73
|
73
|
<div class="col-md-6" style="margin-bottom: 1em">
|
|
74
|
74
|
<label>Cell Number *</label>
|
|
75
|
|
- <div class="input-group-prepend">
|
|
76
|
|
- <span class="input-group-text">
|
|
77
|
|
- <eva-icon name="smartphone-outline" fill="#60CBEB"></eva-icon>
|
|
78
|
|
- </span>
|
|
79
|
|
- <input
|
|
80
|
|
- class="form-control"
|
|
81
|
|
- type="text"
|
|
82
|
|
- name="cellnumber"
|
|
83
|
|
- v-model="currentUser.cellNumber"
|
|
84
|
|
- />
|
|
85
|
|
- </div>
|
|
|
75
|
+ <prop-field
|
|
|
76
|
+ :display="currentUser.cellNumber"
|
|
|
77
|
+ :editType="'text'"
|
|
|
78
|
+ :propertyName="'cellNumber'"
|
|
|
79
|
+ :mayEdit="true"
|
|
|
80
|
+ @UpdateValue="UpdateValue"
|
|
|
81
|
+ />
|
|
86
|
82
|
</div>
|
|
87
|
83
|
<div class="col-md-6" style="margin-bottom: 1em">
|
|
88
|
84
|
<label>Landline Number *</label>
|
|
89
|
|
- <div class="input-group-prepend">
|
|
90
|
|
- <span class="input-group-text">
|
|
91
|
|
- <eva-icon name="phone-outline" fill="#60CBEB"></eva-icon>
|
|
92
|
|
- </span>
|
|
93
|
|
- <input
|
|
94
|
|
- class="form-control"
|
|
95
|
|
- type="text"
|
|
96
|
|
- name="landline"
|
|
97
|
|
- v-model="currentUser.landlineNumber"
|
|
98
|
|
- />
|
|
99
|
|
- </div>
|
|
|
85
|
+ <prop-field
|
|
|
86
|
+ :display="currentUser.landlineNumber"
|
|
|
87
|
+ :editType="'text'"
|
|
|
88
|
+ :propertyName="'landlineNumber'"
|
|
|
89
|
+ :mayEdit="true"
|
|
|
90
|
+ @UpdateValue="UpdateValue"
|
|
|
91
|
+ />
|
|
100
|
92
|
</div>
|
|
101
|
93
|
</div>
|
|
102
|
94
|
</div>
|
|
|
@@ -108,6 +100,14 @@
|
|
108
|
100
|
<hr />
|
|
109
|
101
|
<BankAccount :bank="currentUser ? currentUser.bankingDetails : {}" />
|
|
110
|
102
|
</div>
|
|
|
103
|
+ <div class="row">
|
|
|
104
|
+ <div class="col-md-2 offset-3">
|
|
|
105
|
+ <button @click="SubmitData()" type="button" class="btn btn-b-n">Save</button>
|
|
|
106
|
+ </div>
|
|
|
107
|
+ <div class="col-md-2 offset-3">
|
|
|
108
|
+ <button @click="Close()" type="button" class="btn btn-b-n">Close</button>
|
|
|
109
|
+ </div>
|
|
|
110
|
+ </div>
|
|
111
|
111
|
</div>
|
|
112
|
112
|
</template>
|
|
113
|
113
|
|
|
|
@@ -116,12 +116,15 @@ import { mapState, mapGetters, mapActions } from 'vuex';
|
|
116
|
116
|
import BankAccount from '../shared/bankAccount.vue';
|
|
117
|
117
|
import Address from '../misc/address.vue';
|
|
118
|
118
|
import SelectIndividual from './selectIndividual.vue';
|
|
|
119
|
+import propField from '../property/propertyFieldEditor.vue';
|
|
|
120
|
+import items from '../../assets/staticData/itemsPerPage';
|
|
119
|
121
|
|
|
120
|
122
|
export default {
|
|
121
|
123
|
components: {
|
|
122
|
124
|
BankAccount,
|
|
123
|
125
|
Address,
|
|
124
|
126
|
SelectIndividual,
|
|
|
127
|
+ propField,
|
|
125
|
128
|
},
|
|
126
|
129
|
data() {
|
|
127
|
130
|
return {
|
|
|
@@ -151,15 +154,144 @@ export default {
|
|
151
|
154
|
},
|
|
152
|
155
|
computed: {
|
|
153
|
156
|
...mapState('timeshare', ['maritalStatus']),
|
|
|
157
|
+ ...mapState('individual', ['indiv']),
|
|
|
158
|
+ ...mapState('searchTab', ['provinces', 'cities', 'suburbs']),
|
|
154
|
159
|
...mapGetters({
|
|
155
|
160
|
user: 'authentication/getUser',
|
|
156
|
161
|
}),
|
|
157
|
162
|
},
|
|
158
|
163
|
methods: {
|
|
159
|
|
- ...mapActions('individual', ['getIndividual']),
|
|
|
164
|
+ ...mapActions('individual', ['getIndividual', 'updateIndividual']),
|
|
|
165
|
+ ...mapActions('searchTab', ['getProvince', 'getCities', 'getSuburbs']),
|
|
160
|
166
|
onSelectedItemItemChange(item) {
|
|
161
|
167
|
this.currentUser = item;
|
|
162
|
168
|
},
|
|
|
169
|
+ ProvinceSelected(item) {
|
|
|
170
|
+ if (item.target.options.selectedIndex > 0) {
|
|
|
171
|
+ this.selectedProvince = this.provinces[
|
|
|
172
|
+ item.target.options.selectedIndex - 1
|
|
|
173
|
+ ].description;
|
|
|
174
|
+ this.getCities(Object.assign({}, { province: this.selectedProvince }));
|
|
|
175
|
+ }
|
|
|
176
|
+ },
|
|
|
177
|
+ CitySelected(item) {
|
|
|
178
|
+ if (item.target.options.selectedIndex > 0) {
|
|
|
179
|
+ this.selectedCity = this.cities[
|
|
|
180
|
+ item.target.options.selectedIndex - 1
|
|
|
181
|
+ ].description;
|
|
|
182
|
+ this.getSuburbs(
|
|
|
183
|
+ Object.assign(
|
|
|
184
|
+ {},
|
|
|
185
|
+ { province: this.selectedProvince, city: this.selectedCity },
|
|
|
186
|
+ ),
|
|
|
187
|
+ );
|
|
|
188
|
+ }
|
|
|
189
|
+ },
|
|
|
190
|
+ getPostalCode(item) {
|
|
|
191
|
+ this.address.postalCode = this.suburbs[
|
|
|
192
|
+ item.target.options.selectedIndex - 1
|
|
|
193
|
+ ].postalCode;
|
|
|
194
|
+ },
|
|
|
195
|
+ UpdateValue(item) {
|
|
|
196
|
+ if (item.fieldName) {
|
|
|
197
|
+ if (item.fieldName === 'name') {
|
|
|
198
|
+ this.currentUser.name = item.value;
|
|
|
199
|
+ }
|
|
|
200
|
+ if (item.fieldName === 'surname') {
|
|
|
201
|
+ this.currentUser.surname = item.value;
|
|
|
202
|
+ }
|
|
|
203
|
+ if (item.fieldName === 'idNumber') {
|
|
|
204
|
+ this.currentUser.idNumber = item.value;
|
|
|
205
|
+ }
|
|
|
206
|
+ if (item.fieldName === 'companyRegNumber') {
|
|
|
207
|
+ this.currentUser.companyRegNumber = item.value;
|
|
|
208
|
+ }
|
|
|
209
|
+ if (item.fieldName === 'maritalStatus') {
|
|
|
210
|
+ this.currentUser.maritalStatus = item.value;
|
|
|
211
|
+ }
|
|
|
212
|
+ if (item.fieldName === 'email') {
|
|
|
213
|
+ this.currentUser.emailAddress = item.value;
|
|
|
214
|
+ }
|
|
|
215
|
+ if (item.fieldName === 'cellNumber') {
|
|
|
216
|
+ this.currentUser.cellNumber = item.value;
|
|
|
217
|
+ }
|
|
|
218
|
+ if (item.fieldName === 'landlineNumber') {
|
|
|
219
|
+ this.currentUser.landlineNumber = item.value;
|
|
|
220
|
+ }
|
|
|
221
|
+ if (item.fieldName === 'streetNumber') {
|
|
|
222
|
+ this.currentUser.address.streetNumber = item.value;
|
|
|
223
|
+ }
|
|
|
224
|
+ if (item.fieldName === 'street') {
|
|
|
225
|
+ this.currentUser.address.street = item.value;
|
|
|
226
|
+ }
|
|
|
227
|
+ if (item.fieldName === 'province') {
|
|
|
228
|
+ if (item.value !== '') {
|
|
|
229
|
+ this.address.province = this.provinces.find(
|
|
|
230
|
+ p => p.description === item.value,
|
|
|
231
|
+ );
|
|
|
232
|
+ this.address.provinceId = this.address.province.id;
|
|
|
233
|
+ this.getCities(Object.assign({}, { province: item.value }));
|
|
|
234
|
+ this.address.city = null;
|
|
|
235
|
+ this.address.suburb = null;
|
|
|
236
|
+ this.address.postalCode = '';
|
|
|
237
|
+ } else {
|
|
|
238
|
+ this.address.province = null;
|
|
|
239
|
+ this.address.city = null;
|
|
|
240
|
+ this.address.suburb = null;
|
|
|
241
|
+ this.address.postalCode = '';
|
|
|
242
|
+ this.cities = [];
|
|
|
243
|
+ this.suburbs = [];
|
|
|
244
|
+ }
|
|
|
245
|
+ }
|
|
|
246
|
+ if (item.fieldName === 'city') {
|
|
|
247
|
+ if (item.value !== '') {
|
|
|
248
|
+ const newCity = this.cities.find(p => p.description === item.value);
|
|
|
249
|
+ this.address.city = newCity;
|
|
|
250
|
+ this.address.cityId = newCity.id;
|
|
|
251
|
+ this.getSuburbs(
|
|
|
252
|
+ Object.assign(
|
|
|
253
|
+ {},
|
|
|
254
|
+ {
|
|
|
255
|
+ province: this.address.province.description,
|
|
|
256
|
+ city: item.value,
|
|
|
257
|
+ },
|
|
|
258
|
+ ),
|
|
|
259
|
+ );
|
|
|
260
|
+ this.address.suburb = null;
|
|
|
261
|
+ this.address.postalCode = '';
|
|
|
262
|
+ } else {
|
|
|
263
|
+ this.address.city = null;
|
|
|
264
|
+ this.address.suburb = null;
|
|
|
265
|
+ this.address.postalCode = '';
|
|
|
266
|
+ this.suburbs = [];
|
|
|
267
|
+ }
|
|
|
268
|
+ }
|
|
|
269
|
+ if (item.fieldName === 'suburb') {
|
|
|
270
|
+ if (item.value !== '') {
|
|
|
271
|
+ const newSuburb = this.suburbs.find(
|
|
|
272
|
+ p => p.description === item.value,
|
|
|
273
|
+ );
|
|
|
274
|
+ this.address.suburb = newSuburb;
|
|
|
275
|
+ this.address.suburbId = newSuburb.id;
|
|
|
276
|
+ this.address.postalCode = this.address.suburb.postalCode;
|
|
|
277
|
+ } else {
|
|
|
278
|
+ this.address.suburb = null;
|
|
|
279
|
+ this.address.postalCode = '';
|
|
|
280
|
+ }
|
|
|
281
|
+ }
|
|
|
282
|
+ }
|
|
|
283
|
+ },
|
|
|
284
|
+ SubmitData() {
|
|
|
285
|
+ console.log(this.currentUser);
|
|
|
286
|
+ this.updateIndividual(this.currentUser);
|
|
|
287
|
+ this.$router.push('/status/userManagementPage');
|
|
|
288
|
+ },
|
|
|
289
|
+ Close() {
|
|
|
290
|
+ this.$router.push('/status/userManagementPage');
|
|
|
291
|
+ },
|
|
|
292
|
+ },
|
|
|
293
|
+ mounted() {
|
|
|
294
|
+ this.getProvince();
|
|
163
|
295
|
},
|
|
164
|
296
|
};
|
|
165
|
297
|
</script>
|