@burh/nuxt-core 1.0.364 → 1.0.366
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.
|
@@ -377,7 +377,7 @@ export default {
|
|
|
377
377
|
},
|
|
378
378
|
methods: {
|
|
379
379
|
handleNewReportNoteSubmit() {
|
|
380
|
-
if (this.newReportNote.length >
|
|
380
|
+
if (this.newReportNote.length > 3) {
|
|
381
381
|
this.$emit('new-report-note', this.newReportNote, this.userFolderId, this.userData.id);
|
|
382
382
|
this.newReportNote = '';
|
|
383
383
|
}
|
|
@@ -1,206 +1,349 @@
|
|
|
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>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
|
-
|
|
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
|
-
|
|
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>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
|
+
>
|
|
71
|
+
<label for="cnpj">CNPJ</label>
|
|
72
|
+
<base-input
|
|
73
|
+
type="text"
|
|
74
|
+
id="cnpj"
|
|
75
|
+
v-model="cnpj"
|
|
76
|
+
placeholder="CNPJ"
|
|
77
|
+
:mask="['##.###.###/####-##']"
|
|
78
|
+
:error="errors[0]"
|
|
79
|
+
:valid="errors.length ? true : false"
|
|
80
|
+
/>
|
|
81
|
+
</validation-provider>
|
|
82
|
+
|
|
83
|
+
<validation-provider
|
|
84
|
+
tag="div"
|
|
85
|
+
name="CEP"
|
|
86
|
+
rules="required|min:9"
|
|
87
|
+
v-slot="{ errors }"
|
|
88
|
+
>
|
|
89
|
+
<label for="cep">CEP</label>
|
|
90
|
+
<base-input
|
|
91
|
+
type="text"
|
|
92
|
+
id="cep"
|
|
93
|
+
v-model="cep"
|
|
94
|
+
placeholder="CEP"
|
|
95
|
+
v-mask="['#####-###']"
|
|
96
|
+
:error="errors[0]"
|
|
97
|
+
:valid="errors.length ? true : false"
|
|
98
|
+
/>
|
|
99
|
+
</validation-provider>
|
|
100
|
+
|
|
101
|
+
<validation-provider
|
|
102
|
+
tag="div"
|
|
103
|
+
name="Cidade"
|
|
104
|
+
rules="required"
|
|
105
|
+
v-slot="{ errors }"
|
|
106
|
+
>
|
|
107
|
+
<label for="city">Cidade</label>
|
|
108
|
+
<div class="form-group">
|
|
109
|
+
<el-select
|
|
110
|
+
type="text"
|
|
111
|
+
id="city"
|
|
112
|
+
v-model="city"
|
|
113
|
+
placeholder="Cidade"
|
|
114
|
+
filterable
|
|
115
|
+
:auto-complete="`${city}-new`"
|
|
116
|
+
:error="errors[0]"
|
|
117
|
+
:valid="errors.length ? true : false"
|
|
118
|
+
>
|
|
119
|
+
<div class="text-center" slot="empty">
|
|
120
|
+
<p class="small mb-2 mt-3">Nenhuma cidade encontrada</p>
|
|
121
|
+
</div>
|
|
122
|
+
|
|
123
|
+
<el-option
|
|
124
|
+
v-for="city in cityList"
|
|
125
|
+
:key="city.value"
|
|
126
|
+
:value="city.value"
|
|
127
|
+
:label="city.value"
|
|
128
|
+
>
|
|
129
|
+
{{ city.value }}
|
|
130
|
+
</el-option>
|
|
131
|
+
</el-select>
|
|
132
|
+
</div>
|
|
133
|
+
</validation-provider>
|
|
134
|
+
|
|
135
|
+
<validation-provider
|
|
136
|
+
tag="div"
|
|
137
|
+
name="Endereço"
|
|
138
|
+
rules="required"
|
|
139
|
+
v-slot="{ errors }"
|
|
140
|
+
>
|
|
141
|
+
<label for="address">Endereço</label>
|
|
142
|
+
<base-input
|
|
143
|
+
type="text"
|
|
144
|
+
id="address"
|
|
145
|
+
v-model="address"
|
|
146
|
+
placeholder="Endereço"
|
|
147
|
+
:error="errors[0]"
|
|
148
|
+
:valid="errors.length ? true : false"
|
|
149
|
+
/>
|
|
150
|
+
</validation-provider>
|
|
151
|
+
</validation-observer>
|
|
152
|
+
<button
|
|
153
|
+
type="button"
|
|
154
|
+
:class="{'invalid-form': !permissions}"
|
|
155
|
+
:disabled="!permissions"
|
|
156
|
+
@click="sendRequest"
|
|
157
|
+
class="btn ml-auto d-block btn-primary btn-md"
|
|
158
|
+
>
|
|
159
|
+
Enviar
|
|
160
|
+
</button>
|
|
161
|
+
</section>
|
|
162
|
+
</div>
|
|
163
|
+
|
|
164
|
+
<span class="tool tool-close" @click="$emit('close')">
|
|
165
|
+
Fechar
|
|
166
|
+
<font-awesome-icon
|
|
167
|
+
:icon="['fas', 'times']"
|
|
168
|
+
class="text-white ml-1"
|
|
169
|
+
/>
|
|
170
|
+
</span>
|
|
171
|
+
</template>
|
|
172
|
+
</el-dialog>
|
|
173
|
+
</template>
|
|
174
|
+
|
|
175
|
+
<script>
|
|
176
|
+
import { Dialog, Select, Option } from 'element-ui';
|
|
177
|
+
import { mask } from 'vue-the-mask';
|
|
178
|
+
|
|
179
|
+
export default {
|
|
180
|
+
name: 'add-customer-modal',
|
|
181
|
+
directives:{
|
|
182
|
+
mask
|
|
183
|
+
},
|
|
184
|
+
components: {
|
|
185
|
+
[Dialog.name]: Dialog,
|
|
186
|
+
[Select.name]: Select,
|
|
187
|
+
[Option.name]: Option,
|
|
188
|
+
|
|
189
|
+
},
|
|
190
|
+
props: {
|
|
191
|
+
isActive: {
|
|
192
|
+
type: Boolean,
|
|
193
|
+
default: false,
|
|
194
|
+
description: 'Modal open verification'
|
|
195
|
+
},
|
|
196
|
+
},
|
|
197
|
+
watch: {
|
|
198
|
+
name(to) {
|
|
199
|
+
if (to.length > 3) {
|
|
200
|
+
this.permissions = true;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
data() {
|
|
205
|
+
return {
|
|
206
|
+
name: '',
|
|
207
|
+
social: '',
|
|
208
|
+
description: '',
|
|
209
|
+
cnpj: '',
|
|
210
|
+
cep: '',
|
|
211
|
+
address: '',
|
|
212
|
+
city: '',
|
|
213
|
+
|
|
214
|
+
cityList: [],
|
|
215
|
+
permissions: false,
|
|
216
|
+
permessionsData: [
|
|
217
|
+
{
|
|
218
|
+
id: 22845207,
|
|
219
|
+
name: 'Administrador'
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
id: 22890835,
|
|
223
|
+
name: 'Usuário Empresas'
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
id: 22913699,
|
|
227
|
+
name: 'Portal do RH'
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
id: 22959227,
|
|
231
|
+
name: 'Universidade Corporativa'
|
|
232
|
+
},
|
|
233
|
+
]
|
|
234
|
+
};
|
|
235
|
+
},
|
|
236
|
+
methods: {
|
|
237
|
+
async getCityList() {
|
|
238
|
+
let cityList = await fetch('https://raw.githubusercontent.com/Skuth/cidades-com-estados-brasil/main/cidades.json')
|
|
239
|
+
.then(res => res.json())
|
|
240
|
+
.catch(() => {});
|
|
241
|
+
|
|
242
|
+
this.cityList = cityList.map(city => {
|
|
243
|
+
return {
|
|
244
|
+
value: `${city.city} / ${city.uf}`
|
|
245
|
+
};
|
|
246
|
+
});
|
|
247
|
+
},
|
|
248
|
+
async checkZipcode() {
|
|
249
|
+
await this.$services.company
|
|
250
|
+
.checkZipCode(this.cep)
|
|
251
|
+
.then((response) => {
|
|
252
|
+
if (response.error || response.data.length == 0) {
|
|
253
|
+
response.error = true;
|
|
254
|
+
} else {
|
|
255
|
+
if (response.data) {
|
|
256
|
+
if (response.data.city_name && response.data.region_code) {
|
|
257
|
+
this.city = `${response.data.city_name}, ${response.data.region_code}`;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
})
|
|
262
|
+
.catch(() => {});
|
|
263
|
+
},
|
|
264
|
+
async sendRequest() {
|
|
265
|
+
this.permissions = true;
|
|
266
|
+
|
|
267
|
+
const pass = await this.$refs.sendRole.validate();
|
|
268
|
+
|
|
269
|
+
if (!pass) {
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
await this.checkZipcode();
|
|
274
|
+
|
|
275
|
+
let payload = {
|
|
276
|
+
name: this.name,
|
|
277
|
+
razao_social: this.social,
|
|
278
|
+
description: this.description,
|
|
279
|
+
cnpj: this.cnpj,
|
|
280
|
+
cep: this.cep,
|
|
281
|
+
address: this.address,
|
|
282
|
+
city: this.city
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
this.$emit('add-customer', payload);
|
|
286
|
+
this.$emit('close');
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
mounted() {
|
|
290
|
+
this.getCityList();
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
</script>
|
|
294
|
+
|
|
295
|
+
<style lang="scss" scoped>
|
|
296
|
+
@import '@burh/nuxt-core/assets/sass/burh-ds/variables/_colors.scss';
|
|
297
|
+
|
|
298
|
+
/deep/ .el-dialog__body {
|
|
299
|
+
padding: 0;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
/deep/ .el-dialog__header {
|
|
303
|
+
display: none;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/deep/ .el-dialog {
|
|
307
|
+
overflow: hidden;
|
|
308
|
+
border-radius: 10px;
|
|
309
|
+
max-width: 47.5rem;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.role {
|
|
313
|
+
padding: 2rem 3rem;
|
|
314
|
+
|
|
315
|
+
section {
|
|
316
|
+
margin-top: 2rem;
|
|
317
|
+
|
|
318
|
+
.invalid-form {
|
|
319
|
+
opacity: 0.3;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.tool {
|
|
325
|
+
position: absolute;
|
|
326
|
+
top: 1rem;
|
|
327
|
+
z-index: 10;
|
|
328
|
+
color: $primary;
|
|
329
|
+
cursor: pointer;
|
|
330
|
+
|
|
331
|
+
&-close {
|
|
332
|
+
position: absolute;
|
|
333
|
+
width: 88px;
|
|
334
|
+
height: 27px;
|
|
335
|
+
right: 7px;
|
|
336
|
+
top: 7px;
|
|
337
|
+
display: flex;
|
|
338
|
+
justify-content: center;
|
|
339
|
+
align-items: center;
|
|
340
|
+
|
|
341
|
+
font-size: 11px;
|
|
342
|
+
|
|
343
|
+
font-weight: 500;
|
|
344
|
+
background: rgba(0, 0, 0, 0.2);
|
|
345
|
+
border-radius: 17.5px;
|
|
346
|
+
color: #fff;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
</style>
|