@burh/nuxt-core 1.0.393 → 1.0.395
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/burh-ds/Curriculum/UserCurriculum/UserCvLeftSide.vue +4 -4
- package/components/burh-ds/Curriculum/UserCurriculum/UserCvMiddle.vue +5 -4
- package/components/burh-ds/Curriculum/UserCurriculum/UserCvRightSide.vue +8 -47
- package/components/burh-ds/Modals/InviteToRole.vue +120 -66
- package/components/burh-ds/Modals/SendCourse.vue +364 -339
- package/package.json +1 -1
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
|
|
44
44
|
<span
|
|
45
45
|
v-if="
|
|
46
|
-
userData.user_complementary_information.wage_pretension > 1
|
|
46
|
+
userData && userData.user_complementary_information && userData.user_complementary_information.wage_pretension && userData.user_complementary_information.wage_pretension > 1
|
|
47
47
|
"
|
|
48
48
|
>Pretensão salarial:
|
|
49
49
|
{{
|
|
@@ -160,7 +160,7 @@
|
|
|
160
160
|
/>
|
|
161
161
|
</a>
|
|
162
162
|
<a
|
|
163
|
-
v-
|
|
163
|
+
v-if="userData && userData.user_complementary_information && userData.user_complementary_information.facebook_url || false"
|
|
164
164
|
:href="userData.user_complementary_information.facebook_url"
|
|
165
165
|
target="_blank"
|
|
166
166
|
class="ml-2"
|
|
@@ -173,7 +173,7 @@
|
|
|
173
173
|
/>
|
|
174
174
|
</a>
|
|
175
175
|
<a
|
|
176
|
-
v-
|
|
176
|
+
v-if="userData && userData.user_complementary_information && userData.user_complementary_information.linkedin_url || false"
|
|
177
177
|
:href="userData.user_complementary_information.linkedin_url"
|
|
178
178
|
target="_blank"
|
|
179
179
|
class="ml-2"
|
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
/>
|
|
187
187
|
</a>
|
|
188
188
|
<a
|
|
189
|
-
v-
|
|
189
|
+
v-if="userData && userData.user_complementary_information && userData.user_complementary_information.website || false"
|
|
190
190
|
:href="userData.user_complementary_information.website"
|
|
191
191
|
class="text-center ml-2"
|
|
192
192
|
target="_blank"
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
<div class="about content-block mt-5 ml-3 mr-3">
|
|
27
27
|
<h5 class="font-weight-bold">Sobre</h5>
|
|
28
28
|
<p
|
|
29
|
+
v-if="userData && userData.user_complementary_information && userData.user_complementary_information.about || false"
|
|
29
30
|
id="USER_ABOUT"
|
|
30
31
|
class="mb-0"
|
|
31
32
|
:class="
|
|
@@ -43,17 +44,17 @@
|
|
|
43
44
|
<a
|
|
44
45
|
href="#"
|
|
45
46
|
aria-label="expandir conteudo"
|
|
46
|
-
v-
|
|
47
|
-
userData.user_complementary_information.about &&
|
|
47
|
+
v-if="
|
|
48
|
+
userData && userData.user_complementary_information && userData.user_complementary_information.about &&
|
|
48
49
|
!wordIsLesserThan(
|
|
49
50
|
userData.user_complementary_information.about
|
|
50
|
-
)
|
|
51
|
+
) || false
|
|
51
52
|
"
|
|
52
53
|
@click.prevent.stop="toggleReadMore($event, 'USER_ABOUT')"
|
|
53
54
|
>Ler mais</a
|
|
54
55
|
>
|
|
55
56
|
|
|
56
|
-
<p v-
|
|
57
|
+
<p v-if="userData && userData.user_complementary_information && userData.user_complementary_information.about || false" class="">
|
|
57
58
|
Nenhuma informação adicionada
|
|
58
59
|
</p>
|
|
59
60
|
</div>
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
<upgrade-plan @send-contact="sendContact" v-show="isLocked" />
|
|
16
16
|
<p class="notes-title mb-0">Histórico com sua empresa</p>
|
|
17
17
|
<div class="line mb-3"></div>
|
|
18
|
+
|
|
18
19
|
<div
|
|
19
20
|
class="mt-3"
|
|
20
21
|
v-for="(item, index) in orderByDate(companyHistory())"
|
|
@@ -232,35 +233,13 @@
|
|
|
232
233
|
<p class="mt-3">{{ userReportData.comment.comment }}</p>
|
|
233
234
|
</div>
|
|
234
235
|
<div
|
|
235
|
-
class="d-flex justify-content-
|
|
236
|
+
class="d-flex justify-content-end align-items-center mr-3"
|
|
236
237
|
>
|
|
237
|
-
<p @click.prevent="hasCommentRemove = !hasCommentRemove" class="notes-date remove-baloon">
|
|
238
|
-
Excluir
|
|
239
|
-
</p>
|
|
240
238
|
<p class="notes-date">
|
|
241
239
|
{{ userReportData.comment.created_at | convertDate }}
|
|
242
240
|
</p>
|
|
243
241
|
</div>
|
|
244
242
|
</div>
|
|
245
|
-
<div v-if="hasCommentRemove" class="archive-remove">
|
|
246
|
-
<p>Você tem certeza que deseja apagar este comentário?</p>
|
|
247
|
-
<div class="d-flex">
|
|
248
|
-
<base-button
|
|
249
|
-
@click="removeComment(userReportData.comment.id)"
|
|
250
|
-
size="sm"
|
|
251
|
-
class="btn-outline-primary col-6 p-1"
|
|
252
|
-
>
|
|
253
|
-
Apagar
|
|
254
|
-
</base-button>
|
|
255
|
-
<base-button
|
|
256
|
-
@click="hasCommentRemove = false"
|
|
257
|
-
size="sm"
|
|
258
|
-
class="btn-outline-danger col-6 p-1"
|
|
259
|
-
>
|
|
260
|
-
Cancelar
|
|
261
|
-
</base-button>
|
|
262
|
-
</div>
|
|
263
|
-
</div>
|
|
264
243
|
<div class="notes-owner d-flex mt-2">
|
|
265
244
|
<img
|
|
266
245
|
v-if="userReportData.comment.user.urlAvatar"
|
|
@@ -372,7 +351,6 @@ export default {
|
|
|
372
351
|
},
|
|
373
352
|
userReportData: [],
|
|
374
353
|
hasReportRemove: false,
|
|
375
|
-
hasCommentRemove: false,
|
|
376
354
|
isLocked: !this.companyHasProduct(
|
|
377
355
|
this.$store.state.loja && this.$store.state.loja.showableProducts && this.$store.state.loja.showableProducts['HISTORICO_USUARIO'] || false
|
|
378
356
|
),
|
|
@@ -398,11 +376,6 @@ export default {
|
|
|
398
376
|
this.getUserFolderData();
|
|
399
377
|
},
|
|
400
378
|
methods: {
|
|
401
|
-
removeComment(item){
|
|
402
|
-
this.userReportData.comment = undefined;
|
|
403
|
-
this.$emit('remove-comment', item);
|
|
404
|
-
this.hasCommentRemove = false;
|
|
405
|
-
},
|
|
406
379
|
handleNewReportNoteSubmit() {
|
|
407
380
|
if (this.newReportNote.length > 3) {
|
|
408
381
|
this.$emit('new-report-note', this.newReportNote, this.userFolderId, this.userData.id);
|
|
@@ -491,10 +464,10 @@ export default {
|
|
|
491
464
|
this.newNote = '';
|
|
492
465
|
},
|
|
493
466
|
companyHistory() {
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
467
|
+
let sms = this.userData.company_sms.map(x => ({
|
|
468
|
+
date: x.created_at,
|
|
469
|
+
text: 'Recebeu um SMS'
|
|
470
|
+
}));
|
|
498
471
|
let tests = this.userData.tests.map(x => {
|
|
499
472
|
if (x.finished_at) {
|
|
500
473
|
return {
|
|
@@ -509,22 +482,12 @@ export default {
|
|
|
509
482
|
}
|
|
510
483
|
|
|
511
484
|
});
|
|
512
|
-
|
|
513
|
-
let courses = this.userData.courses_user.map(x => {
|
|
514
|
-
if (x.finished_at) {
|
|
515
|
-
return{
|
|
516
|
-
date: x.finished_at,
|
|
517
|
-
text: `Finalizou o curso ${x.course.name.toUpperCase()}`
|
|
518
|
-
}
|
|
519
|
-
}
|
|
520
|
-
});
|
|
521
|
-
|
|
522
485
|
let discs = this.userData.solides.map(x => ({
|
|
523
486
|
date: x.end,
|
|
524
487
|
text: 'Realizou um teste DISC'
|
|
525
488
|
}));
|
|
526
489
|
|
|
527
|
-
return
|
|
490
|
+
return sms.concat(tests, discs);
|
|
528
491
|
},
|
|
529
492
|
orderByDate(data) {
|
|
530
493
|
let sortedArray = data.sort((a, b) => {
|
|
@@ -570,9 +533,7 @@ export default {
|
|
|
570
533
|
.el-tabs__nav-wrap.is-top::after {
|
|
571
534
|
background: #fff !important;
|
|
572
535
|
}
|
|
573
|
-
|
|
574
|
-
cursor: pointer;
|
|
575
|
-
}
|
|
536
|
+
|
|
576
537
|
.el-tabs__active-bar.is-top {
|
|
577
538
|
width: 30px !important;
|
|
578
539
|
height: 4px !important;
|
|
@@ -1,30 +1,18 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<modal :show="isModalOpen" v-on:close="closeModal"
|
|
3
|
-
|
|
2
|
+
<modal :show="isModalOpen" v-on:close="closeModal" class="modal">
|
|
3
|
+
|
|
4
4
|
<template slot="header">
|
|
5
5
|
<h2 class="display-4 pb-3">
|
|
6
6
|
Insira os e-mails que deseja convidar a empresa
|
|
7
7
|
</h2>
|
|
8
8
|
</template>
|
|
9
9
|
|
|
10
|
-
<div class="row px-4">
|
|
11
|
-
<div class="col-4">
|
|
12
|
-
<label for="name">Nome Completo</label>
|
|
13
|
-
</div>
|
|
14
|
-
<div class="col-4">
|
|
15
|
-
<label for="email">E-mail</label>
|
|
16
|
-
</div>
|
|
17
|
-
<div class="col-4">
|
|
18
|
-
<label for="email">Cargo</label>
|
|
19
|
-
</div>
|
|
20
|
-
</div>
|
|
21
|
-
|
|
22
10
|
<validation-observer ref="inviteUser">
|
|
23
|
-
<div class="
|
|
11
|
+
<div class="column p-4 member__container" v-for="(slot, idx) in slots" :key="idx">
|
|
24
12
|
|
|
25
13
|
<validation-provider
|
|
26
14
|
tag="div"
|
|
27
|
-
class="col-
|
|
15
|
+
class="col-12"
|
|
28
16
|
:vid="`send-name-${idx}`"
|
|
29
17
|
name="Nome"
|
|
30
18
|
rules="required|regex:\w+\s+\w+"
|
|
@@ -32,6 +20,8 @@
|
|
|
32
20
|
>
|
|
33
21
|
<base-input
|
|
34
22
|
v-model="slot.name"
|
|
23
|
+
label="Nome Completo"
|
|
24
|
+
placeholder="Nome Completo"
|
|
35
25
|
:error="errors[0]"
|
|
36
26
|
:valid="errors.length ? true : false"
|
|
37
27
|
/>
|
|
@@ -39,7 +29,7 @@
|
|
|
39
29
|
|
|
40
30
|
<validation-provider
|
|
41
31
|
tag="div"
|
|
42
|
-
class="col-
|
|
32
|
+
class="col-12"
|
|
43
33
|
:vid="`send-email-${idx}`"
|
|
44
34
|
name="Email"
|
|
45
35
|
rules="required|email"
|
|
@@ -47,42 +37,82 @@
|
|
|
47
37
|
>
|
|
48
38
|
<base-input
|
|
49
39
|
v-model="slot.email"
|
|
40
|
+
label="Email"
|
|
41
|
+
placeholder="Email"
|
|
50
42
|
:error="errors[0]"
|
|
51
43
|
:valid="errors.length ? true : false"
|
|
52
44
|
/>
|
|
53
45
|
</validation-provider>
|
|
54
46
|
|
|
55
|
-
<div
|
|
56
|
-
<
|
|
57
|
-
class="
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
:value="role.level"
|
|
47
|
+
<div class="select__container px-3">
|
|
48
|
+
<div name="role">
|
|
49
|
+
<label for="select" class="form-control-label">Setor</label>
|
|
50
|
+
|
|
51
|
+
<el-select
|
|
52
|
+
class="select-danger"
|
|
53
|
+
id="select"
|
|
54
|
+
placeholder="Setor"
|
|
55
|
+
v-model="slot.role"
|
|
56
|
+
clearable
|
|
66
57
|
>
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
58
|
+
<div class="text-center" slot="empty">
|
|
59
|
+
<p class="small text-muted mx-2 mb-2 mt-2">
|
|
60
|
+
Nenhum setor encontrado
|
|
61
|
+
</p>
|
|
62
|
+
</div>
|
|
70
63
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
64
|
+
<el-option
|
|
65
|
+
v-for="role in corporativeRole"
|
|
66
|
+
:key="role.id"
|
|
67
|
+
:label="role.level"
|
|
68
|
+
:value="role.level"
|
|
69
|
+
>
|
|
70
|
+
</el-option>
|
|
71
|
+
</el-select>
|
|
72
|
+
</div>
|
|
73
|
+
|
|
74
|
+
<div name="role">
|
|
75
|
+
<label for="buffer" class="form-control-label">Vincular ao buffer</label>
|
|
76
|
+
|
|
77
|
+
<el-select
|
|
78
|
+
class="select-danger"
|
|
79
|
+
id="buffer"
|
|
80
|
+
placeholder="Buffer"
|
|
81
|
+
v-model="slot.buffer"
|
|
82
|
+
clearable
|
|
83
|
+
>
|
|
84
|
+
<div class="text-center" slot="empty">
|
|
85
|
+
<p class="small text-muted mx-2 mb-2 mt-2">
|
|
86
|
+
Nenhum buffer encontrado
|
|
87
|
+
</p>
|
|
88
|
+
</div>
|
|
89
|
+
|
|
90
|
+
<el-option
|
|
91
|
+
v-for="buffer in bufferList"
|
|
92
|
+
:key="buffer.id"
|
|
93
|
+
:label="buffer.name"
|
|
94
|
+
:value="buffer.main_folder_id"
|
|
95
|
+
>
|
|
96
|
+
</el-option>
|
|
97
|
+
</el-select>
|
|
98
|
+
</div>
|
|
99
|
+
|
|
100
|
+
<div class="icon__position pt-2 d-flex align-items-center justify-content-center">
|
|
101
|
+
<i
|
|
102
|
+
v-if="idx !== slots.length - 1"
|
|
103
|
+
class="fa fa-trash pointer"
|
|
104
|
+
@click="removeSlot(idx)"
|
|
105
|
+
></i>
|
|
106
|
+
<i v-else class="fa fa-plus pointer" @click="addSlot"></i>
|
|
107
|
+
</div>
|
|
78
108
|
</div>
|
|
79
109
|
|
|
80
110
|
</div>
|
|
81
111
|
</validation-observer>
|
|
82
112
|
|
|
83
|
-
<div class="row">
|
|
113
|
+
<div class="row col-12">
|
|
84
114
|
<base-button
|
|
85
|
-
class="
|
|
115
|
+
class="ml-auto"
|
|
86
116
|
type="primary"
|
|
87
117
|
@click="inviteUser"
|
|
88
118
|
:disabled="isLoading"
|
|
@@ -108,14 +138,29 @@ export default {
|
|
|
108
138
|
type: Boolean,
|
|
109
139
|
default: false
|
|
110
140
|
},
|
|
111
|
-
corporativeRole:
|
|
141
|
+
corporativeRole: {
|
|
142
|
+
type: Array,
|
|
143
|
+
default: () => []
|
|
144
|
+
},
|
|
112
145
|
isLoading: {
|
|
113
146
|
type: Boolean,
|
|
114
147
|
default: false,
|
|
115
148
|
description: 'Loading for request'
|
|
116
149
|
}
|
|
117
150
|
},
|
|
151
|
+
watch: {
|
|
152
|
+
isModalOpen(to) {
|
|
153
|
+
if (to) {
|
|
154
|
+
this.resetSlots();
|
|
155
|
+
this.getBufferList();
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
},
|
|
118
159
|
methods: {
|
|
160
|
+
async getBufferList() {
|
|
161
|
+
const { data } = await this.$services.buffer.search();
|
|
162
|
+
this.bufferList = data || [];
|
|
163
|
+
},
|
|
119
164
|
closeModal(e) {
|
|
120
165
|
this.$emit('closemodal', e);
|
|
121
166
|
},
|
|
@@ -125,12 +170,7 @@ export default {
|
|
|
125
170
|
},
|
|
126
171
|
|
|
127
172
|
addSlot() {
|
|
128
|
-
const newSlot =
|
|
129
|
-
idx: '',
|
|
130
|
-
name: '',
|
|
131
|
-
email: '',
|
|
132
|
-
role: ''
|
|
133
|
-
};
|
|
173
|
+
const newSlot = this.getSlot();
|
|
134
174
|
|
|
135
175
|
this.slots = [...this.slots, newSlot];
|
|
136
176
|
},
|
|
@@ -152,45 +192,46 @@ export default {
|
|
|
152
192
|
name: slot.name.substring(slot.name.indexOf(' '), 0),
|
|
153
193
|
last_name: slot.name.substring(slot.name.indexOf(' ') + 1),
|
|
154
194
|
email: slot.email,
|
|
155
|
-
access_level: slot.role
|
|
195
|
+
access_level: slot.role,
|
|
196
|
+
company_buffer_folder_id: slot.buffer
|
|
156
197
|
}));
|
|
157
198
|
|
|
158
199
|
return [
|
|
159
200
|
...formattedSlots
|
|
160
201
|
];
|
|
161
202
|
};
|
|
162
|
-
|
|
203
|
+
|
|
163
204
|
let params = {
|
|
164
205
|
users: formatRequest()
|
|
165
206
|
};
|
|
166
207
|
|
|
167
|
-
this.resetSlots();
|
|
168
208
|
this.$emit('invite-user', params);
|
|
169
209
|
},
|
|
170
210
|
|
|
211
|
+
getSlot() {
|
|
212
|
+
return {
|
|
213
|
+
idx: '',
|
|
214
|
+
name: '',
|
|
215
|
+
email: '',
|
|
216
|
+
role: '',
|
|
217
|
+
buffer: ''
|
|
218
|
+
};
|
|
219
|
+
},
|
|
171
220
|
resetSlots() {
|
|
172
|
-
this.
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
name: '',
|
|
176
|
-
email: '',
|
|
177
|
-
role: ''
|
|
178
|
-
}
|
|
179
|
-
];
|
|
221
|
+
this.$refs.inviteUser.reset();
|
|
222
|
+
this.slots = [];
|
|
223
|
+
this.slots.push(this.getSlot());
|
|
180
224
|
}
|
|
181
225
|
},
|
|
182
226
|
data() {
|
|
183
227
|
return {
|
|
184
|
-
slots: [
|
|
185
|
-
|
|
186
|
-
idx: '',
|
|
187
|
-
name: '',
|
|
188
|
-
email: '',
|
|
189
|
-
role: ''
|
|
190
|
-
}
|
|
191
|
-
],
|
|
228
|
+
slots: [],
|
|
229
|
+
bufferList: []
|
|
192
230
|
};
|
|
193
231
|
},
|
|
232
|
+
mounted() {
|
|
233
|
+
this.resetSlots();
|
|
234
|
+
}
|
|
194
235
|
};
|
|
195
236
|
</script>
|
|
196
237
|
<style lang="scss" scoped>
|
|
@@ -214,4 +255,17 @@ export default {
|
|
|
214
255
|
.is-loading {
|
|
215
256
|
opacity: 0.3;
|
|
216
257
|
}
|
|
258
|
+
.member__container {
|
|
259
|
+
&:not(:nth-child(1)) {
|
|
260
|
+
border: 1px solid #e9e9e9;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
.select__container {
|
|
264
|
+
display: grid;
|
|
265
|
+
grid-template-columns: 1fr 1fr 10px;
|
|
266
|
+
gap: 20px;
|
|
267
|
+
}
|
|
268
|
+
.icon__position {
|
|
269
|
+
margin-top: 23px;
|
|
270
|
+
}
|
|
217
271
|
</style>
|
|
@@ -1,339 +1,364 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<modal :show="isModalOpen" v-on:close="closeModal" size="xl" class="modal">
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
</
|
|
170
|
-
|
|
171
|
-
<
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
},
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
};
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<modal :show="isModalOpen" v-on:close="closeModal" size="xl" class="modal">
|
|
3
|
+
<basics :isLoading="isLoading" v-if="isLoading"/>
|
|
4
|
+
<template slot="header">
|
|
5
|
+
|
|
6
|
+
<h2 class="display-4 px-2">
|
|
7
|
+
Insira os e-mail que deseja enviar o treinamento <br>
|
|
8
|
+
|
|
9
|
+
</h2>
|
|
10
|
+
</template>
|
|
11
|
+
<div class="switch-position">
|
|
12
|
+
<el-switch
|
|
13
|
+
v-model="switchSingle"
|
|
14
|
+
active-color="#5865F2"
|
|
15
|
+
inactive-text="Enviar para novos usuários"
|
|
16
|
+
active-text="Enviar por setor">
|
|
17
|
+
</el-switch>
|
|
18
|
+
|
|
19
|
+
</div>
|
|
20
|
+
<div v-if="switchSingle === false" style="min-height:100px">
|
|
21
|
+
<div class="row px-4">
|
|
22
|
+
<div class="col-4">
|
|
23
|
+
<label for="name">Nome Completo</label>
|
|
24
|
+
</div>
|
|
25
|
+
<div class="col-4">
|
|
26
|
+
<label for="email">E-mail</label>
|
|
27
|
+
</div>
|
|
28
|
+
<div class="col-4">
|
|
29
|
+
<label for="email">Setor</label>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
<validation-observer ref="sendCourse">
|
|
33
|
+
<div class="row px-4" v-for="(slot, idx) in payload.users" :key="idx">
|
|
34
|
+
|
|
35
|
+
<validation-provider
|
|
36
|
+
tag="div"
|
|
37
|
+
class="col-4"
|
|
38
|
+
style="height: 50px"
|
|
39
|
+
:vid="`send-name-${idx}`"
|
|
40
|
+
name="Nome"
|
|
41
|
+
rules="required|regex:\w+\s+\w+"
|
|
42
|
+
v-slot="{ errors }"
|
|
43
|
+
:disabled="payload.all_users ? true : false"
|
|
44
|
+
>
|
|
45
|
+
<base-input
|
|
46
|
+
:disabled="payload.all_users ? true : false"
|
|
47
|
+
v-model="slot.name"
|
|
48
|
+
:error="errors[0]"
|
|
49
|
+
:valid="errors.length ? true : false"
|
|
50
|
+
placeholder="Nome Completo"
|
|
51
|
+
/>
|
|
52
|
+
</validation-provider>
|
|
53
|
+
|
|
54
|
+
<validation-provider
|
|
55
|
+
tag="div"
|
|
56
|
+
class="col-4"
|
|
57
|
+
style="height: 50px"
|
|
58
|
+
:vid="`send-email-${idx}`"
|
|
59
|
+
name="Email"
|
|
60
|
+
rules="required|email"
|
|
61
|
+
v-slot="{ errors }"
|
|
62
|
+
:disabled="payload.all_users ? true : false"
|
|
63
|
+
>
|
|
64
|
+
<base-input
|
|
65
|
+
:disabled="payload.all_users ? true : false"
|
|
66
|
+
v-model="slot.email"
|
|
67
|
+
:error="errors[0]"
|
|
68
|
+
:valid="errors.length ? true : false"
|
|
69
|
+
placeholder="E-mail"
|
|
70
|
+
/>
|
|
71
|
+
</validation-provider>
|
|
72
|
+
|
|
73
|
+
<div tag="div" class="col-3" name="role">
|
|
74
|
+
<el-select
|
|
75
|
+
filterable
|
|
76
|
+
no-match-text="Nenhum cargo encontrado"
|
|
77
|
+
no-data-text="Nenhum cargo encontrado"
|
|
78
|
+
class="select-danger"
|
|
79
|
+
v-model="slot.access_level_id"
|
|
80
|
+
style="height: 50px"
|
|
81
|
+
placeholder="Escolha o setor"
|
|
82
|
+
:disabled="payload.all_users ? true : false"
|
|
83
|
+
>
|
|
84
|
+
<el-option
|
|
85
|
+
v-for="role in corporativeRole"
|
|
86
|
+
:key="role.id"
|
|
87
|
+
:label="role.level"
|
|
88
|
+
:value="role.id"
|
|
89
|
+
>
|
|
90
|
+
</el-option>
|
|
91
|
+
</el-select>
|
|
92
|
+
</div>
|
|
93
|
+
|
|
94
|
+
<div class="col-1">
|
|
95
|
+
<i
|
|
96
|
+
v-if="idx !== payload.users.length - 1"
|
|
97
|
+
class="fa fa-trash pointer"
|
|
98
|
+
@click="removeSlot(idx)"
|
|
99
|
+
></i>
|
|
100
|
+
<i v-else class="fa fa-plus pointer" @click="addSlot"></i>
|
|
101
|
+
</div>
|
|
102
|
+
|
|
103
|
+
</div>
|
|
104
|
+
|
|
105
|
+
</validation-observer>
|
|
106
|
+
</div>
|
|
107
|
+
<!-- envio em massa -->
|
|
108
|
+
<div v-else style="height:100px">
|
|
109
|
+
<div class="px-4">
|
|
110
|
+
<label for="email">Setor</label>
|
|
111
|
+
</div>
|
|
112
|
+
<validation-observer ref="sendCourse">
|
|
113
|
+
<div class="row px-4" v-for="(slot, idx) in payload.users" :key="idx">
|
|
114
|
+
<div tag="div" class="col-12" name="role">
|
|
115
|
+
<el-select
|
|
116
|
+
filterable
|
|
117
|
+
no-match-text="Nenhum cargo encontrado"
|
|
118
|
+
no-data-text="Nenhum cargo encontrado"
|
|
119
|
+
class="select-danger"
|
|
120
|
+
multiple
|
|
121
|
+
style="width: 100%;"
|
|
122
|
+
v-model="selectedRole"
|
|
123
|
+
placeholder="Escolha o setor"
|
|
124
|
+
:disabled="payload.all_users ? true : false"
|
|
125
|
+
>
|
|
126
|
+
<el-option
|
|
127
|
+
v-for="role in corporativeRole"
|
|
128
|
+
:key="role.id"
|
|
129
|
+
:label="role.level"
|
|
130
|
+
:value="role.id"
|
|
131
|
+
>
|
|
132
|
+
</el-option>
|
|
133
|
+
</el-select>
|
|
134
|
+
</div>
|
|
135
|
+
</div>
|
|
136
|
+
</validation-observer>
|
|
137
|
+
</div>
|
|
138
|
+
|
|
139
|
+
<el-checkbox
|
|
140
|
+
class="checkbox-user"
|
|
141
|
+
v-model="payload.all_users"
|
|
142
|
+
> Enviar para todos usúarios
|
|
143
|
+
</el-checkbox>
|
|
144
|
+
<hr />
|
|
145
|
+
|
|
146
|
+
<div class="row px-4">
|
|
147
|
+
<div class="col-12">
|
|
148
|
+
<label for="courses">Acesso aos Treinamentos</label>
|
|
149
|
+
</div>
|
|
150
|
+
</div>
|
|
151
|
+
<div class="row px-4">
|
|
152
|
+
<div class="col-12">
|
|
153
|
+
<el-select
|
|
154
|
+
v-model="coursesToSend"
|
|
155
|
+
multiple
|
|
156
|
+
style="width: 100%;"
|
|
157
|
+
placeholder="Treinamentos"
|
|
158
|
+
name="courses"
|
|
159
|
+
>
|
|
160
|
+
<el-option
|
|
161
|
+
v-for="item in courses"
|
|
162
|
+
:key="item.id"
|
|
163
|
+
:label="item.name"
|
|
164
|
+
:value="item.id"
|
|
165
|
+
>
|
|
166
|
+
</el-option>
|
|
167
|
+
</el-select>
|
|
168
|
+
</div>
|
|
169
|
+
</div>
|
|
170
|
+
|
|
171
|
+
<div class="row">
|
|
172
|
+
<base-button
|
|
173
|
+
class="mx-auto"
|
|
174
|
+
type="primary"
|
|
175
|
+
@click="sendTest"
|
|
176
|
+
:disabled="isLoading"
|
|
177
|
+
:class="{'is-loading': isLoading}"
|
|
178
|
+
>
|
|
179
|
+
{{ isLoading ? 'Enviando' : 'Enviar' }}
|
|
180
|
+
</base-button>
|
|
181
|
+
</div>
|
|
182
|
+
</modal>
|
|
183
|
+
</template>
|
|
184
|
+
|
|
185
|
+
<script>
|
|
186
|
+
import { Select, Option, Switch, Checkbox } from 'element-ui';
|
|
187
|
+
import Basics from '../Loadings/Basics';
|
|
188
|
+
|
|
189
|
+
export default {
|
|
190
|
+
name: 'send-course',
|
|
191
|
+
components: {
|
|
192
|
+
[Select.name]: Select,
|
|
193
|
+
[Option.name]: Option,
|
|
194
|
+
[Switch.name]: Switch,
|
|
195
|
+
[Checkbox.name]: Checkbox,
|
|
196
|
+
Basics,
|
|
197
|
+
},
|
|
198
|
+
props: {
|
|
199
|
+
isModalOpen: {
|
|
200
|
+
type: Boolean,
|
|
201
|
+
default: false
|
|
202
|
+
},
|
|
203
|
+
selectedCourse: Number,
|
|
204
|
+
corporativeRole: null,
|
|
205
|
+
courses: Array,
|
|
206
|
+
isLoading: {
|
|
207
|
+
type: Boolean,
|
|
208
|
+
default: false,
|
|
209
|
+
description: 'Loading to send course'
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
watch: {
|
|
213
|
+
selectedCourse(newValue) {
|
|
214
|
+
this.coursesToSend = newValue ? [newValue] : [];
|
|
215
|
+
},
|
|
216
|
+
switchSingle(){
|
|
217
|
+
this.resetSlots();
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
data() {
|
|
221
|
+
return {
|
|
222
|
+
payload: {
|
|
223
|
+
users: [
|
|
224
|
+
{
|
|
225
|
+
idx: '',
|
|
226
|
+
name: '',
|
|
227
|
+
email: '',
|
|
228
|
+
access_level_id: this.selectedRole
|
|
229
|
+
}
|
|
230
|
+
],
|
|
231
|
+
courses: [{ id: '' }],
|
|
232
|
+
access_levels:[{ id: '' }],
|
|
233
|
+
all_users : false
|
|
234
|
+
},
|
|
235
|
+
selectedRole: '',
|
|
236
|
+
switchSingle: false,
|
|
237
|
+
coursesToSend: [],
|
|
238
|
+
};
|
|
239
|
+
},
|
|
240
|
+
methods: {
|
|
241
|
+
closeModal(e) {
|
|
242
|
+
this.$emit('closemodal', e);
|
|
243
|
+
},
|
|
244
|
+
|
|
245
|
+
removeSlot(idx) {
|
|
246
|
+
this.payload.users.splice(idx, 1);
|
|
247
|
+
},
|
|
248
|
+
|
|
249
|
+
addSlot() {
|
|
250
|
+
const newSlot = {
|
|
251
|
+
idx: '',
|
|
252
|
+
name: '',
|
|
253
|
+
email: '',
|
|
254
|
+
access_level_id: this.selectedRole,
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
this.payload.users = [...this.payload.users, newSlot];
|
|
258
|
+
},
|
|
259
|
+
|
|
260
|
+
async sendTest() {
|
|
261
|
+
const pass = await this.$refs.sendCourse.validate();
|
|
262
|
+
|
|
263
|
+
if (!pass) {
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
const filterUsers = user => user.email !== '';
|
|
268
|
+
let formattedCourses = this.coursesToSend.map(id => ({
|
|
269
|
+
id
|
|
270
|
+
}));
|
|
271
|
+
let allUsers = this.payload.all_users;
|
|
272
|
+
|
|
273
|
+
if(this.switchSingle === false) {
|
|
274
|
+
const formatRequest = () => {
|
|
275
|
+
let formattedSlots = this.payload.users
|
|
276
|
+
.filter(filterUsers)
|
|
277
|
+
.map(user => ({
|
|
278
|
+
name: user.name.substring(user.name.indexOf(' '), 0),
|
|
279
|
+
last_name: user.name.substring(
|
|
280
|
+
user.name.indexOf(' ') + 1
|
|
281
|
+
),
|
|
282
|
+
email: user.email,
|
|
283
|
+
access_level_id: user.access_level_id
|
|
284
|
+
}));
|
|
285
|
+
|
|
286
|
+
return {
|
|
287
|
+
...formattedSlots
|
|
288
|
+
|
|
289
|
+
};
|
|
290
|
+
};
|
|
291
|
+
|
|
292
|
+
let params = {
|
|
293
|
+
users: formatRequest(),
|
|
294
|
+
courses: formattedCourses,
|
|
295
|
+
all_users: allUsers
|
|
296
|
+
};
|
|
297
|
+
this.resetSlots();
|
|
298
|
+
this.$emit('send-course', params);
|
|
299
|
+
} else {
|
|
300
|
+
let params = {
|
|
301
|
+
courses: formattedCourses,
|
|
302
|
+
access_levels: this.selectedRole.map(id => {
|
|
303
|
+
return { id };
|
|
304
|
+
}),
|
|
305
|
+
all_users: allUsers
|
|
306
|
+
|
|
307
|
+
};
|
|
308
|
+
this.resetSlots();
|
|
309
|
+
this.$emit('send-course', params);
|
|
310
|
+
}
|
|
311
|
+
},
|
|
312
|
+
resetSlots() {
|
|
313
|
+
this.payload.users = [
|
|
314
|
+
{
|
|
315
|
+
idx: '',
|
|
316
|
+
name: '',
|
|
317
|
+
email: '',
|
|
318
|
+
access_level_id: ''
|
|
319
|
+
},
|
|
320
|
+
];
|
|
321
|
+
// this.payload.all_users = false;
|
|
322
|
+
}
|
|
323
|
+
},
|
|
324
|
+
|
|
325
|
+
};
|
|
326
|
+
</script>
|
|
327
|
+
<style lang="scss" scoped>
|
|
328
|
+
.send-test-modal {
|
|
329
|
+
position: fixed;
|
|
330
|
+
overflow-y: scroll;
|
|
331
|
+
overflow-x: hidden;
|
|
332
|
+
width: 60%;
|
|
333
|
+
height: 50%;
|
|
334
|
+
background-color: #ffffff;
|
|
335
|
+
z-index: 999 !important;
|
|
336
|
+
top: 20% !important;
|
|
337
|
+
left: 20% !important;
|
|
338
|
+
box-sizing: border-box;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.pointer {
|
|
342
|
+
cursor: pointer;
|
|
343
|
+
}
|
|
344
|
+
.switch-position{
|
|
345
|
+
padding: 16px 0;
|
|
346
|
+
margin-bottom: 16px;
|
|
347
|
+
display: flex;
|
|
348
|
+
align-items: center;
|
|
349
|
+
justify-content: center;
|
|
350
|
+
}
|
|
351
|
+
/deep/ .el-switch__label{
|
|
352
|
+
/* height: 13.5px !important; */
|
|
353
|
+
&.is-active{
|
|
354
|
+
color: #5865F2 !important;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
.is-loading {
|
|
359
|
+
opacity: 0.3;
|
|
360
|
+
}
|
|
361
|
+
.checkbox-user{
|
|
362
|
+
margin-left: 24px;
|
|
363
|
+
}
|
|
364
|
+
</style>
|