@burh/nuxt-core 1.0.367 → 1.0.368
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.
|
@@ -45,22 +45,13 @@
|
|
|
45
45
|
/>
|
|
46
46
|
</validation-provider>
|
|
47
47
|
|
|
48
|
-
<
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
v-
|
|
53
|
-
|
|
54
|
-
|
|
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>
|
|
48
|
+
<label for="description">Descrição</label>
|
|
49
|
+
<base-input
|
|
50
|
+
type="text"
|
|
51
|
+
id="description"
|
|
52
|
+
v-model="description"
|
|
53
|
+
placeholder="Descrição"
|
|
54
|
+
/>
|
|
64
55
|
|
|
65
56
|
<validation-provider
|
|
66
57
|
tag="div"
|
|
@@ -175,6 +166,7 @@
|
|
|
175
166
|
<script>
|
|
176
167
|
import { Dialog, Select, Option } from 'element-ui';
|
|
177
168
|
import { mask } from 'vue-the-mask';
|
|
169
|
+
import swal from 'sweetalert2';
|
|
178
170
|
|
|
179
171
|
export default {
|
|
180
172
|
name: 'add-customer-modal',
|
|
@@ -199,6 +191,11 @@ export default {
|
|
|
199
191
|
if (to.length > 3) {
|
|
200
192
|
this.permissions = true;
|
|
201
193
|
}
|
|
194
|
+
},
|
|
195
|
+
isActive(to) {
|
|
196
|
+
if (!to) {
|
|
197
|
+
this.resetFields();
|
|
198
|
+
}
|
|
202
199
|
}
|
|
203
200
|
},
|
|
204
201
|
data() {
|
|
@@ -234,6 +231,30 @@ export default {
|
|
|
234
231
|
};
|
|
235
232
|
},
|
|
236
233
|
methods: {
|
|
234
|
+
resetFields() {
|
|
235
|
+
this.name = '';
|
|
236
|
+
this.social = '';
|
|
237
|
+
this.description = '';
|
|
238
|
+
this.cnpj = '';
|
|
239
|
+
this.cep = '';
|
|
240
|
+
this.address = '';
|
|
241
|
+
this.city = '';
|
|
242
|
+
|
|
243
|
+
this.$refs.sendRole.reset();
|
|
244
|
+
},
|
|
245
|
+
async showMessage(message, type = 'success') {
|
|
246
|
+
const Toast = swal.mixin({
|
|
247
|
+
toast: true,
|
|
248
|
+
position: 'top-end',
|
|
249
|
+
showConfirmButton: false,
|
|
250
|
+
timer: 30000,
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
Toast.fire({
|
|
254
|
+
type: type,
|
|
255
|
+
title: message,
|
|
256
|
+
});
|
|
257
|
+
},
|
|
237
258
|
async getCityList() {
|
|
238
259
|
let cityList = await fetch('https://raw.githubusercontent.com/Skuth/cidades-com-estados-brasil/main/cidades.json')
|
|
239
260
|
.then(res => res.json())
|
|
@@ -267,7 +288,7 @@ export default {
|
|
|
267
288
|
const pass = await this.$refs.sendRole.validate();
|
|
268
289
|
|
|
269
290
|
if (!pass) {
|
|
270
|
-
return;
|
|
291
|
+
return this.showMessage('Preencha todos os campos obrigatórios!', 'error');
|
|
271
292
|
}
|
|
272
293
|
|
|
273
294
|
await this.checkZipcode();
|
|
@@ -292,6 +313,12 @@ export default {
|
|
|
292
313
|
};
|
|
293
314
|
</script>
|
|
294
315
|
|
|
316
|
+
<style lang="scss">
|
|
317
|
+
body.swal2-toast-shown .swal2-container.swal2-top-end, body.swal2-toast-shown .swal2-container.swal2-top-right {
|
|
318
|
+
z-index: 10000!important;
|
|
319
|
+
}
|
|
320
|
+
</style>
|
|
321
|
+
|
|
295
322
|
<style lang="scss" scoped>
|
|
296
323
|
@import '@burh/nuxt-core/assets/sass/burh-ds/variables/_colors.scss';
|
|
297
324
|
|