@burh/nuxt-core 1.0.395 → 1.0.399
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.
|
@@ -1,429 +1,564 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<el-dialog
|
|
3
|
-
:visible.sync="isActive"
|
|
4
|
-
width="55%"
|
|
5
|
-
custom-class="position-relative"
|
|
6
|
-
@close="$emit('close')"
|
|
7
|
-
>
|
|
8
|
-
<template>
|
|
9
|
-
<div class="role">
|
|
10
|
-
<h3>{{ isEditing ? 'Editando Cliente' : 'Cadastrar Cliente' }}</h3>
|
|
11
|
-
|
|
12
|
-
<section>
|
|
13
|
-
<validation-observer ref="sendRole">
|
|
14
|
-
<validation-provider
|
|
15
|
-
tag="div"
|
|
16
|
-
name="Nome"
|
|
17
|
-
rules="required"
|
|
18
|
-
v-slot="{ errors }"
|
|
19
|
-
>
|
|
20
|
-
<label for="name">Nome da Empresa</label>
|
|
21
|
-
<base-input
|
|
22
|
-
type="text"
|
|
23
|
-
id="name"
|
|
24
|
-
v-model="name"
|
|
25
|
-
placeholder="Nome da Empresa"
|
|
26
|
-
:error="errors[0]"
|
|
27
|
-
:valid="errors.length ? true : false"
|
|
28
|
-
/>
|
|
29
|
-
</validation-provider>
|
|
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
|
-
this.
|
|
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
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
.
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
.
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<el-dialog
|
|
3
|
+
:visible.sync="isActive"
|
|
4
|
+
width="55%"
|
|
5
|
+
custom-class="position-relative"
|
|
6
|
+
@close="$emit('close')"
|
|
7
|
+
>
|
|
8
|
+
<template>
|
|
9
|
+
<div class="role">
|
|
10
|
+
<h3>{{ isEditing ? 'Editando Cliente' : 'Cadastrar Cliente' }}</h3>
|
|
11
|
+
|
|
12
|
+
<section>
|
|
13
|
+
<validation-observer ref="sendRole">
|
|
14
|
+
<validation-provider
|
|
15
|
+
tag="div"
|
|
16
|
+
name="Nome"
|
|
17
|
+
rules="required"
|
|
18
|
+
v-slot="{ errors }"
|
|
19
|
+
>
|
|
20
|
+
<label for="name">Nome da Empresa</label>
|
|
21
|
+
<base-input
|
|
22
|
+
type="text"
|
|
23
|
+
id="name"
|
|
24
|
+
v-model="name"
|
|
25
|
+
placeholder="Nome da Empresa"
|
|
26
|
+
:error="errors[0]"
|
|
27
|
+
:valid="errors.length ? true : false"
|
|
28
|
+
/>
|
|
29
|
+
</validation-provider>
|
|
30
|
+
<validation-provider
|
|
31
|
+
tag="div"
|
|
32
|
+
name="Descrição"
|
|
33
|
+
rules="required"
|
|
34
|
+
v-slot="{ errors }"
|
|
35
|
+
>
|
|
36
|
+
<label for="description">Descrição</label>
|
|
37
|
+
<base-input
|
|
38
|
+
type="text"
|
|
39
|
+
id="description"
|
|
40
|
+
v-model="description"
|
|
41
|
+
placeholder="Descrição"
|
|
42
|
+
:error="errors[0]"
|
|
43
|
+
:valid="errors.length ? true : false"
|
|
44
|
+
/>
|
|
45
|
+
</validation-provider>
|
|
46
|
+
<validation-provider
|
|
47
|
+
tag="div"
|
|
48
|
+
name="Razão Social"
|
|
49
|
+
rules="required"
|
|
50
|
+
v-slot="{ errors }"
|
|
51
|
+
>
|
|
52
|
+
<label for="social">Razão Social</label>
|
|
53
|
+
<base-input
|
|
54
|
+
type="text"
|
|
55
|
+
id="social"
|
|
56
|
+
v-model="social"
|
|
57
|
+
placeholder="Razão Social"
|
|
58
|
+
:error="errors[0]"
|
|
59
|
+
:valid="errors.length ? true : false"
|
|
60
|
+
/>
|
|
61
|
+
</validation-provider>
|
|
62
|
+
<validation-provider
|
|
63
|
+
tag="div"
|
|
64
|
+
name="CNPJ"
|
|
65
|
+
rules="required|min:14"
|
|
66
|
+
v-slot="{ errors }"
|
|
67
|
+
v-if="!isEditing"
|
|
68
|
+
>
|
|
69
|
+
<label for="cnpj">CNPJ</label>
|
|
70
|
+
<base-input
|
|
71
|
+
type="text"
|
|
72
|
+
id="cnpj"
|
|
73
|
+
v-model="cnpj"
|
|
74
|
+
placeholder="CNPJ"
|
|
75
|
+
:mask="['##.###.###/####-##']"
|
|
76
|
+
:error="errors[0]"
|
|
77
|
+
:valid="errors.length ? true : false"
|
|
78
|
+
/>
|
|
79
|
+
</validation-provider>
|
|
80
|
+
|
|
81
|
+
<validation-provider
|
|
82
|
+
tag="div"
|
|
83
|
+
name="CEP"
|
|
84
|
+
rules="required|min:9"
|
|
85
|
+
v-slot="{ errors }"
|
|
86
|
+
>
|
|
87
|
+
<label for="cep">CEP</label>
|
|
88
|
+
<base-input
|
|
89
|
+
type="text"
|
|
90
|
+
id="cep"
|
|
91
|
+
v-model="cep"
|
|
92
|
+
placeholder="CEP"
|
|
93
|
+
v-mask="['#####-###']"
|
|
94
|
+
:error="errors[0]"
|
|
95
|
+
:valid="errors.length ? true : false"
|
|
96
|
+
/>
|
|
97
|
+
</validation-provider>
|
|
98
|
+
|
|
99
|
+
<validation-provider
|
|
100
|
+
tag="div"
|
|
101
|
+
name="Cidade"
|
|
102
|
+
rules="required"
|
|
103
|
+
v-slot="{ errors }"
|
|
104
|
+
>
|
|
105
|
+
<label for="city" class="form-control-label">Cidade</label>
|
|
106
|
+
<div class="form-group">
|
|
107
|
+
<el-select
|
|
108
|
+
id="city"
|
|
109
|
+
v-model="city"
|
|
110
|
+
placeholder="Cidade"
|
|
111
|
+
filterable
|
|
112
|
+
remote
|
|
113
|
+
required
|
|
114
|
+
auto-complete="off"
|
|
115
|
+
:class="{'is-invalid': errors[0]}"
|
|
116
|
+
:remote-method="getCityListFiltered"
|
|
117
|
+
:loading="isSelectLoading"
|
|
118
|
+
|
|
119
|
+
>
|
|
120
|
+
<div class="text-center" slot="empty">
|
|
121
|
+
<p class="small mb-2 mt-3">Nenhuma cidade encontrada</p>
|
|
122
|
+
</div>
|
|
123
|
+
|
|
124
|
+
<el-option
|
|
125
|
+
v-for="city in cityListFiltered"
|
|
126
|
+
:key="city.value"
|
|
127
|
+
:value="city.value"
|
|
128
|
+
:label="city.value"
|
|
129
|
+
/>
|
|
130
|
+
</el-select>
|
|
131
|
+
<div
|
|
132
|
+
class="invalid-feedback"
|
|
133
|
+
style="display: block;">
|
|
134
|
+
{{ errors[0] }}
|
|
135
|
+
</div>
|
|
136
|
+
</div>
|
|
137
|
+
</validation-provider>
|
|
138
|
+
|
|
139
|
+
<validation-provider
|
|
140
|
+
tag="div"
|
|
141
|
+
name="Endereço"
|
|
142
|
+
rules="required"
|
|
143
|
+
v-slot="{ errors }"
|
|
144
|
+
>
|
|
145
|
+
<label for="address">Endereço</label>
|
|
146
|
+
<base-input
|
|
147
|
+
type="text"
|
|
148
|
+
id="address"
|
|
149
|
+
v-model="address"
|
|
150
|
+
placeholder="Endereço"
|
|
151
|
+
:error="errors[0]"
|
|
152
|
+
:valid="errors.length ? true : false"
|
|
153
|
+
/>
|
|
154
|
+
</validation-provider>
|
|
155
|
+
<h2>Contato</h2>
|
|
156
|
+
<div v-for="(contact, idx) in contacts" :key="idx">
|
|
157
|
+
<div class="border p-3 rounded">
|
|
158
|
+
<validation-provider
|
|
159
|
+
tag="div"
|
|
160
|
+
name="Responsável"
|
|
161
|
+
:vid="`send-responsible-${idx}`"
|
|
162
|
+
rules="required"
|
|
163
|
+
v-slot="{ errors }"
|
|
164
|
+
>
|
|
165
|
+
<label for="name">Responsável</label>
|
|
166
|
+
<base-input
|
|
167
|
+
type="text"
|
|
168
|
+
v-model="contact.name"
|
|
169
|
+
placeholder="Responsável"
|
|
170
|
+
:error="errors[0]"
|
|
171
|
+
:valid="errors.length ? true : false"
|
|
172
|
+
/>
|
|
173
|
+
</validation-provider>
|
|
174
|
+
|
|
175
|
+
<validation-provider
|
|
176
|
+
tag="div"
|
|
177
|
+
name="E-mail"
|
|
178
|
+
:vid="`send-email-${idx}`"
|
|
179
|
+
rules="required"
|
|
180
|
+
v-slot="{ errors }"
|
|
181
|
+
>
|
|
182
|
+
<label for="email">Email</label>
|
|
183
|
+
<base-input
|
|
184
|
+
type="email"
|
|
185
|
+
v-model="contact.email"
|
|
186
|
+
placeholder="Email"
|
|
187
|
+
:error="errors[0]"
|
|
188
|
+
:valid="errors.length ? true : false"
|
|
189
|
+
/>
|
|
190
|
+
</validation-provider>
|
|
191
|
+
|
|
192
|
+
<validation-provider
|
|
193
|
+
tag="div"
|
|
194
|
+
name="Telefone"
|
|
195
|
+
:vid="`send-phone-${idx}`"
|
|
196
|
+
rules="required"
|
|
197
|
+
v-slot="{ errors }"
|
|
198
|
+
>
|
|
199
|
+
<label for="phone">Telefone</label>
|
|
200
|
+
<base-input
|
|
201
|
+
type="text"
|
|
202
|
+
v-model="contact.phone"
|
|
203
|
+
:mask="['(##) ####-####']"
|
|
204
|
+
placeholder="Telefone com DDD"
|
|
205
|
+
:error="errors[0]"
|
|
206
|
+
:valid="errors.length ? true : false"
|
|
207
|
+
/>
|
|
208
|
+
</validation-provider>
|
|
209
|
+
|
|
210
|
+
<validation-provider
|
|
211
|
+
tag="div"
|
|
212
|
+
name="Celular"
|
|
213
|
+
:vid="`send-cellphone-${idx}`"
|
|
214
|
+
rules="required"
|
|
215
|
+
v-slot="{ errors }"
|
|
216
|
+
>
|
|
217
|
+
<label for="cellphone">Celular</label>
|
|
218
|
+
<base-input
|
|
219
|
+
type="text"
|
|
220
|
+
v-model="contact.cellphone"
|
|
221
|
+
:mask="['(##) #####-####']"
|
|
222
|
+
placeholder="Celular com DDD"
|
|
223
|
+
:error="errors[0]"
|
|
224
|
+
:valid="errors.length ? true : false"
|
|
225
|
+
/>
|
|
226
|
+
</validation-provider>
|
|
227
|
+
|
|
228
|
+
<validation-provider
|
|
229
|
+
tag="div"
|
|
230
|
+
name="Observações"
|
|
231
|
+
:vid="`send-note-${idx}`"
|
|
232
|
+
rules="required"
|
|
233
|
+
v-slot="{ errors }"
|
|
234
|
+
>
|
|
235
|
+
<label for="note">Observações</label>
|
|
236
|
+
<base-input
|
|
237
|
+
type="text"
|
|
238
|
+
v-model="contact.note"
|
|
239
|
+
placeholder="Observações"
|
|
240
|
+
:error="errors[0]"
|
|
241
|
+
:valid="errors.length ? true : false"
|
|
242
|
+
/>
|
|
243
|
+
</validation-provider>
|
|
244
|
+
<div class="col-1 pt-2">
|
|
245
|
+
<i
|
|
246
|
+
v-if="idx !== contacts.length - 1"
|
|
247
|
+
class="fa fa-trash pointer"
|
|
248
|
+
@click="removeSlot(idx)"
|
|
249
|
+
></i>
|
|
250
|
+
</div>
|
|
251
|
+
</div>
|
|
252
|
+
<div class="col-1 pt-2">
|
|
253
|
+
<i v-if="idx === contacts.length - 1" class="fa fa-plus pointer" @click="addSlot"></i>
|
|
254
|
+
</div>
|
|
255
|
+
</div>
|
|
256
|
+
</validation-observer>
|
|
257
|
+
<button
|
|
258
|
+
type="button"
|
|
259
|
+
:class="{'invalid-form': !permissions}"
|
|
260
|
+
:disabled="!permissions"
|
|
261
|
+
@click="sendRequest"
|
|
262
|
+
class="btn ml-auto d-block btn-primary btn-md"
|
|
263
|
+
>
|
|
264
|
+
{{ isEditing ? 'Salvar' : 'Enviar' }}
|
|
265
|
+
</button>
|
|
266
|
+
</section>
|
|
267
|
+
</div>
|
|
268
|
+
|
|
269
|
+
<span class="tool tool-close" @click="$emit('close')">
|
|
270
|
+
Fechar
|
|
271
|
+
<font-awesome-icon
|
|
272
|
+
:icon="['fas', 'times']"
|
|
273
|
+
class="text-white ml-1"
|
|
274
|
+
/>
|
|
275
|
+
</span>
|
|
276
|
+
</template>
|
|
277
|
+
</el-dialog>
|
|
278
|
+
</template>
|
|
279
|
+
|
|
280
|
+
<script>
|
|
281
|
+
import { Dialog, Select, Option } from 'element-ui';
|
|
282
|
+
import { mask } from 'vue-the-mask';
|
|
283
|
+
import swal from 'sweetalert2';
|
|
284
|
+
import removeAccents from 'remove-accents';
|
|
285
|
+
|
|
286
|
+
export default {
|
|
287
|
+
name: 'add-customer-modal',
|
|
288
|
+
directives:{
|
|
289
|
+
mask
|
|
290
|
+
},
|
|
291
|
+
components: {
|
|
292
|
+
[Dialog.name]: Dialog,
|
|
293
|
+
[Select.name]: Select,
|
|
294
|
+
[Option.name]: Option,
|
|
295
|
+
|
|
296
|
+
},
|
|
297
|
+
props: {
|
|
298
|
+
isActive: {
|
|
299
|
+
type: Boolean,
|
|
300
|
+
default: false,
|
|
301
|
+
description: 'Modal open verification'
|
|
302
|
+
},
|
|
303
|
+
userData: {
|
|
304
|
+
type: Object,
|
|
305
|
+
default: null
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
watch: {
|
|
309
|
+
name(to) {
|
|
310
|
+
if (to.length > 3) {
|
|
311
|
+
this.permissions = true;
|
|
312
|
+
}
|
|
313
|
+
},
|
|
314
|
+
isActive(to) {
|
|
315
|
+
if (!to) {
|
|
316
|
+
this.resetFields();
|
|
317
|
+
this.cityList = [];
|
|
318
|
+
}
|
|
319
|
+
if(!this.cityList.length && to){
|
|
320
|
+
this.getCityList();
|
|
321
|
+
}
|
|
322
|
+
},
|
|
323
|
+
userData(to) {
|
|
324
|
+
if (to !== null) {
|
|
325
|
+
this.id = to.id;
|
|
326
|
+
this.name = to.name;
|
|
327
|
+
this.social = to.razao_social;
|
|
328
|
+
this.description = to.description;
|
|
329
|
+
this.contacts = to.contact,
|
|
330
|
+
this.cnpj = to.cnpj;
|
|
331
|
+
this.cep = to.cep;
|
|
332
|
+
this.address = to.address;
|
|
333
|
+
this.city = to.city;
|
|
334
|
+
this.isEditing = true;
|
|
335
|
+
} else {
|
|
336
|
+
this.isEditing = false;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
},
|
|
340
|
+
data() {
|
|
341
|
+
return {
|
|
342
|
+
name: '',
|
|
343
|
+
social: '',
|
|
344
|
+
description: '',
|
|
345
|
+
cnpj: '',
|
|
346
|
+
contacts: [
|
|
347
|
+
{
|
|
348
|
+
name:'',
|
|
349
|
+
email:'',
|
|
350
|
+
phone:'',
|
|
351
|
+
cellphone:'',
|
|
352
|
+
note:'',
|
|
353
|
+
}
|
|
354
|
+
],
|
|
355
|
+
cep: '',
|
|
356
|
+
address: '',
|
|
357
|
+
city: '',
|
|
358
|
+
isEditing: false,
|
|
359
|
+
isSelectLoading: false,
|
|
360
|
+
cityList: [],
|
|
361
|
+
cityListFiltered: [],
|
|
362
|
+
permissions: false,
|
|
363
|
+
permessionsData: [
|
|
364
|
+
{
|
|
365
|
+
id: 22845207,
|
|
366
|
+
name: 'Administrador'
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
id: 22890835,
|
|
370
|
+
name: 'Usuário Empresas'
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
id: 22913699,
|
|
374
|
+
name: 'Portal do RH'
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
id: 22959227,
|
|
378
|
+
name: 'Universidade Corporativa'
|
|
379
|
+
},
|
|
380
|
+
]
|
|
381
|
+
};
|
|
382
|
+
},
|
|
383
|
+
methods: {
|
|
384
|
+
resetFields() {
|
|
385
|
+
this.name = '';
|
|
386
|
+
this.social = '';
|
|
387
|
+
this.description = '';
|
|
388
|
+
this.cnpj = '';
|
|
389
|
+
this.contacts = [
|
|
390
|
+
{
|
|
391
|
+
name:'',
|
|
392
|
+
email:'',
|
|
393
|
+
phone:'',
|
|
394
|
+
cellphone:'',
|
|
395
|
+
note:'',
|
|
396
|
+
}
|
|
397
|
+
],
|
|
398
|
+
this.cep = '';
|
|
399
|
+
this.address = '';
|
|
400
|
+
this.city = '';
|
|
401
|
+
|
|
402
|
+
this.$refs.sendRole.reset();
|
|
403
|
+
},
|
|
404
|
+
addSlot(){
|
|
405
|
+
const newContacts = {
|
|
406
|
+
name:'',
|
|
407
|
+
email:'',
|
|
408
|
+
phone:'',
|
|
409
|
+
cellphone:'',
|
|
410
|
+
note:'',
|
|
411
|
+
};
|
|
412
|
+
|
|
413
|
+
this.contacts = [...this.contacts, newContacts];
|
|
414
|
+
},
|
|
415
|
+
removeSlot(idx){
|
|
416
|
+
this.contacts.splice(idx, 1);
|
|
417
|
+
},
|
|
418
|
+
async showMessage(message, type = 'success') {
|
|
419
|
+
const Toast = swal.mixin({
|
|
420
|
+
toast: true,
|
|
421
|
+
position: 'top-end',
|
|
422
|
+
showConfirmButton: false,
|
|
423
|
+
timer: 3000,
|
|
424
|
+
});
|
|
425
|
+
|
|
426
|
+
Toast.fire({
|
|
427
|
+
type: type,
|
|
428
|
+
title: message,
|
|
429
|
+
});
|
|
430
|
+
},
|
|
431
|
+
async getCityList() {
|
|
432
|
+
this.cityList = await fetch('https://raw.githubusercontent.com/Skuth/cidades-com-estados-brasil/main/cidades.json')
|
|
433
|
+
.then(res => res.json())
|
|
434
|
+
.catch(() => {});
|
|
435
|
+
},
|
|
436
|
+
getCityListFiltered(query) {
|
|
437
|
+
if (query && query.length >= 2) {
|
|
438
|
+
this.cityListFiltered = this.cityList.filter(city => removeAccents(String(city.city)).toLowerCase().startsWith(removeAccents(query.toLowerCase())));
|
|
439
|
+
this.cityListFiltered = this.cityListFiltered.map(city => {
|
|
440
|
+
return {
|
|
441
|
+
value: `${city.city} / ${city.uf}`
|
|
442
|
+
};
|
|
443
|
+
});
|
|
444
|
+
} else {
|
|
445
|
+
this.cityListFiltered = [];
|
|
446
|
+
}
|
|
447
|
+
},
|
|
448
|
+
async checkZipcode() {
|
|
449
|
+
await this.$services.company
|
|
450
|
+
.checkZipCode(this.cep)
|
|
451
|
+
.then((response) => {
|
|
452
|
+
if (response.error || response.data.length == 0) {
|
|
453
|
+
response.error = true;
|
|
454
|
+
} else {
|
|
455
|
+
if (response.data) {
|
|
456
|
+
if (response.data.city_name && response.data.region_code) {
|
|
457
|
+
this.city = `${response.data.city_name} / ${response.data.region_code}`;
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
})
|
|
462
|
+
.catch(() => {});
|
|
463
|
+
},
|
|
464
|
+
async sendRequest() {
|
|
465
|
+
this.permissions = true;
|
|
466
|
+
|
|
467
|
+
const pass = await this.$refs.sendRole.validate();
|
|
468
|
+
|
|
469
|
+
if (!pass) {
|
|
470
|
+
return this.showMessage('Preencha todos os campos obrigatórios!', 'error');
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
await this.checkZipcode();
|
|
474
|
+
|
|
475
|
+
let payload = {
|
|
476
|
+
name: this.name,
|
|
477
|
+
razao_social: this.social,
|
|
478
|
+
description: this.description,
|
|
479
|
+
contact: this.contacts,
|
|
480
|
+
cnpj: this.cnpj,
|
|
481
|
+
cep: this.cep,
|
|
482
|
+
address: this.address,
|
|
483
|
+
city: this.city
|
|
484
|
+
};
|
|
485
|
+
|
|
486
|
+
const mode = this.isEditing ? 'update' : 'create';
|
|
487
|
+
|
|
488
|
+
this.$emit('customer-submit', payload, mode, this.id);
|
|
489
|
+
this.$emit('close');
|
|
490
|
+
}
|
|
491
|
+
},
|
|
492
|
+
mounted() {
|
|
493
|
+
this.getCityList();
|
|
494
|
+
}
|
|
495
|
+
};
|
|
496
|
+
</script>
|
|
497
|
+
|
|
498
|
+
<style lang="scss">
|
|
499
|
+
body.swal2-toast-shown .swal2-container.swal2-top-end, body.swal2-toast-shown .swal2-container.swal2-top-right {
|
|
500
|
+
z-index: 10000!important;
|
|
501
|
+
}
|
|
502
|
+
</style>
|
|
503
|
+
|
|
504
|
+
<style lang="scss" scoped>
|
|
505
|
+
@import '@burh/nuxt-core/assets/sass/burh-ds/variables/_colors.scss';
|
|
506
|
+
|
|
507
|
+
/deep/ .el-dialog__body {
|
|
508
|
+
padding: 0;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
/deep/ .el-dialog__header {
|
|
512
|
+
display: none;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
/deep/ .el-dialog {
|
|
516
|
+
overflow: hidden;
|
|
517
|
+
border-radius: 10px;
|
|
518
|
+
max-width: 47.5rem;
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
.role {
|
|
522
|
+
padding: 2rem 3rem;
|
|
523
|
+
|
|
524
|
+
section {
|
|
525
|
+
margin-top: 2rem;
|
|
526
|
+
|
|
527
|
+
.invalid-form {
|
|
528
|
+
opacity: 0.3;
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
.is-invalid {
|
|
534
|
+
/deep/ input {
|
|
535
|
+
border-color: #de214b!important;
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
.tool {
|
|
540
|
+
position: absolute;
|
|
541
|
+
top: 1rem;
|
|
542
|
+
z-index: 10;
|
|
543
|
+
color: $primary;
|
|
544
|
+
cursor: pointer;
|
|
545
|
+
|
|
546
|
+
&-close {
|
|
547
|
+
position: absolute;
|
|
548
|
+
width: 88px;
|
|
549
|
+
height: 27px;
|
|
550
|
+
right: 7px;
|
|
551
|
+
top: 7px;
|
|
552
|
+
display: flex;
|
|
553
|
+
justify-content: center;
|
|
554
|
+
align-items: center;
|
|
555
|
+
|
|
556
|
+
font-size: 11px;
|
|
557
|
+
|
|
558
|
+
font-weight: 500;
|
|
559
|
+
background: rgba(0, 0, 0, 0.2);
|
|
560
|
+
border-radius: 17.5px;
|
|
561
|
+
color: #fff;
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
</style>
|
|
@@ -17,130 +17,132 @@
|
|
|
17
17
|
</el-switch>
|
|
18
18
|
|
|
19
19
|
</div>
|
|
20
|
-
<div
|
|
21
|
-
<div
|
|
22
|
-
<div class="
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
<
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
<
|
|
20
|
+
<div class="content-1">
|
|
21
|
+
<div v-if="!switchSingle" style="min-height:100px">
|
|
22
|
+
<div class="row px-4">
|
|
23
|
+
<div class="col-4">
|
|
24
|
+
<label for="name">Nome Completo</label>
|
|
25
|
+
</div>
|
|
26
|
+
<div class="col-4">
|
|
27
|
+
<label for="email">E-mail</label>
|
|
28
|
+
</div>
|
|
29
|
+
<div class="col-4">
|
|
30
|
+
<label for="email">Setor</label>
|
|
31
|
+
</div>
|
|
30
32
|
</div>
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
<div class="row px-4" v-for="(slot, idx) in payload.users" :key="idx">
|
|
33
|
+
<validation-observer ref="sendCourse">
|
|
34
|
+
<div class="row px-4" v-for="(slot, idx) in payload.users" :key="idx">
|
|
34
35
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
|
36
|
+
<validation-provider
|
|
37
|
+
tag="div"
|
|
38
|
+
class="col-4"
|
|
39
|
+
style="height: 50px"
|
|
40
|
+
:vid="`send-name-${idx}`"
|
|
41
|
+
name="Nome"
|
|
42
|
+
rules="required|regex:\w+\s+\w+"
|
|
43
|
+
v-slot="{ errors }"
|
|
65
44
|
:disabled="payload.all_users ? true : false"
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
45
|
+
>
|
|
46
|
+
<base-input
|
|
47
|
+
:disabled="payload.all_users ? true : false"
|
|
48
|
+
v-model="slot.name"
|
|
49
|
+
:error="errors[0]"
|
|
50
|
+
:valid="errors.length ? true : false"
|
|
51
|
+
placeholder="Nome Completo"
|
|
52
|
+
/>
|
|
53
|
+
</validation-provider>
|
|
72
54
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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"
|
|
55
|
+
<validation-provider
|
|
56
|
+
tag="div"
|
|
57
|
+
class="col-4"
|
|
80
58
|
style="height: 50px"
|
|
81
|
-
|
|
59
|
+
:vid="`send-email-${idx}`"
|
|
60
|
+
name="Email"
|
|
61
|
+
rules="required|email"
|
|
62
|
+
v-slot="{ errors }"
|
|
82
63
|
:disabled="payload.all_users ? true : false"
|
|
83
64
|
>
|
|
84
|
-
<
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
:
|
|
88
|
-
:
|
|
65
|
+
<base-input
|
|
66
|
+
:disabled="payload.all_users ? true : false"
|
|
67
|
+
v-model="slot.email"
|
|
68
|
+
:error="errors[0]"
|
|
69
|
+
:valid="errors.length ? true : false"
|
|
70
|
+
placeholder="E-mail"
|
|
71
|
+
/>
|
|
72
|
+
</validation-provider>
|
|
73
|
+
|
|
74
|
+
<div tag="div" class="col-3" name="role">
|
|
75
|
+
<el-select
|
|
76
|
+
filterable
|
|
77
|
+
no-match-text="Nenhum cargo encontrado"
|
|
78
|
+
no-data-text="Nenhum cargo encontrado"
|
|
79
|
+
class="select-danger"
|
|
80
|
+
v-model="slot.access_level_id"
|
|
81
|
+
style="height: 50px"
|
|
82
|
+
placeholder="Escolha o setor"
|
|
83
|
+
:disabled="payload.all_users ? true : false"
|
|
89
84
|
>
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
85
|
+
<el-option
|
|
86
|
+
v-for="role in corporativeRole"
|
|
87
|
+
:key="role.id"
|
|
88
|
+
:label="role.level"
|
|
89
|
+
:value="role.id"
|
|
90
|
+
>
|
|
91
|
+
</el-option>
|
|
92
|
+
</el-select>
|
|
93
|
+
</div>
|
|
93
94
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
95
|
+
<div class="col-1">
|
|
96
|
+
<i
|
|
97
|
+
v-if="idx !== payload.users.length - 1"
|
|
98
|
+
class="fa fa-trash pointer"
|
|
99
|
+
@click="removeSlot(idx)"
|
|
100
|
+
></i>
|
|
101
|
+
<i v-else class="fa fa-plus pointer" @click="addSlot"></i>
|
|
102
|
+
</div>
|
|
102
103
|
|
|
103
|
-
|
|
104
|
+
</div>
|
|
104
105
|
|
|
105
|
-
|
|
106
|
-
</div>
|
|
107
|
-
<!-- envio em massa -->
|
|
108
|
-
<div v-else style="height:100px">
|
|
109
|
-
<div class="px-4">
|
|
110
|
-
<label for="email">Setor</label>
|
|
106
|
+
</validation-observer>
|
|
111
107
|
</div>
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
v-
|
|
128
|
-
|
|
129
|
-
:
|
|
130
|
-
:value="role.id"
|
|
108
|
+
<!-- envio em massa -->
|
|
109
|
+
<div v-else style="height:100px">
|
|
110
|
+
<div class="px-4">
|
|
111
|
+
<label for="email">Setor</label>
|
|
112
|
+
</div>
|
|
113
|
+
<validation-observer ref="sendCourse">
|
|
114
|
+
<div class="row px-4" v-for="(slot, idx) in payload.users" :key="idx">
|
|
115
|
+
<div tag="div" class="col-12" name="role">
|
|
116
|
+
<el-select
|
|
117
|
+
filterable
|
|
118
|
+
no-match-text="Nenhum cargo encontrado"
|
|
119
|
+
no-data-text="Nenhum cargo encontrado"
|
|
120
|
+
class="select-danger"
|
|
121
|
+
multiple
|
|
122
|
+
style="width: 100%;"
|
|
123
|
+
v-model="selectedRole"
|
|
124
|
+
placeholder="Escolha o setor"
|
|
125
|
+
:disabled="payload.all_users ? true : false"
|
|
131
126
|
>
|
|
132
|
-
|
|
133
|
-
|
|
127
|
+
<el-option
|
|
128
|
+
v-for="role in corporativeRole"
|
|
129
|
+
:key="role.id"
|
|
130
|
+
:label="role.level"
|
|
131
|
+
:value="role.id"
|
|
132
|
+
>
|
|
133
|
+
</el-option>
|
|
134
|
+
</el-select>
|
|
135
|
+
</div>
|
|
134
136
|
</div>
|
|
135
|
-
</
|
|
136
|
-
</
|
|
137
|
+
</validation-observer>
|
|
138
|
+
</div>
|
|
139
|
+
<el-checkbox
|
|
140
|
+
v-show="switchSingle"
|
|
141
|
+
class="checkbox-user"
|
|
142
|
+
v-model="payload.all_users"
|
|
143
|
+
> Enviar para todos
|
|
144
|
+
</el-checkbox>
|
|
137
145
|
</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
146
|
<hr />
|
|
145
147
|
|
|
146
148
|
<div class="row px-4">
|
|
@@ -318,13 +320,16 @@ export default {
|
|
|
318
320
|
access_level_id: ''
|
|
319
321
|
},
|
|
320
322
|
];
|
|
321
|
-
|
|
323
|
+
this.payload.all_users = false;
|
|
322
324
|
}
|
|
323
325
|
},
|
|
324
326
|
|
|
325
327
|
};
|
|
326
328
|
</script>
|
|
327
329
|
<style lang="scss" scoped>
|
|
330
|
+
.content-1{
|
|
331
|
+
min-height: 130px !important;
|
|
332
|
+
}
|
|
328
333
|
.send-test-modal {
|
|
329
334
|
position: fixed;
|
|
330
335
|
overflow-y: scroll;
|