@burh/nuxt-core 1.0.396 → 1.0.400

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