@burh/nuxt-core 1.0.365 → 1.0.367

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.
@@ -118,6 +118,10 @@ export default {
118
118
  this.mountUserReport(data.data);
119
119
  },
120
120
 
121
+ openArchive(item) {
122
+ window.open(item.annex_url, '_blank');
123
+ },
124
+
121
125
  mountUserReport(userData) {
122
126
  const annex = userData.annex[0] || undefined;
123
127
  const comment = userData.comments[0] || undefined;
@@ -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
- :error="errors[0]"
26
- :valid="errors.length ? true : false"
27
- />
28
- <label for="name">Razão Social</label>
29
- <base-input
30
- type="text"
31
- id="name"
32
- v-model="name"
33
- :error="errors[0]"
34
- :valid="errors.length ? true : false"
35
- />
36
- <label for="name">CNPJ</label>
37
- <base-input
38
- type="text"
39
- id="name"
40
- v-model="name"
41
- :error="errors[0]"
42
- :valid="errors.length ? true : false"
43
- />
44
- <label for="name">CEP</label>
45
- <base-input
46
- type="text"
47
- id="name"
48
- v-model="name"
49
- :error="errors[0]"
50
- :valid="errors.length ? true : false"
51
- />
52
- <label for="name">Endereço</label>
53
- <base-input
54
- type="text"
55
- id="name"
56
- v-model="name"
57
- :error="errors[0]"
58
- :valid="errors.length ? true : false"
59
- />
60
- <label for="name">Cidade</label>
61
- <base-input
62
- type="text"
63
- id="name"
64
- v-model="name"
65
- :error="errors[0]"
66
- :valid="errors.length ? true : false"
67
- />
68
- </validation-provider>
69
- </validation-observer>
70
- <button
71
- type="button"
72
- :class="{'invalid-form': name === '' && !permissions}"
73
- :disabled="name === '' && !permissions"
74
- @click="sendRequest"
75
- class="btn ml-auto d-block btn-primary btn-md"
76
- >
77
- Enviar
78
- </button>
79
- </section>
80
- </div>
81
-
82
- <span class="tool tool-close" @click="$emit('close')">
83
- Fechar
84
- <font-awesome-icon
85
- :icon="['fas', 'times']"
86
- class="text-white ml-1"
87
- />
88
- </span>
89
- </template>
90
- </el-dialog>
91
- </template>
92
-
93
- <script>
94
- import { Dialog, Select, Option } from 'element-ui';
95
-
96
- export default {
97
- name: 'add-customer-modal',
98
- components: {
99
- [Dialog.name]: Dialog,
100
- [Select.name]: Select,
101
- [Option.name]: Option,
102
- },
103
- props: {
104
- isActive: {
105
- type: Boolean,
106
- default: false,
107
- description: 'Modal open verification'
108
- },
109
- },
110
- data() {
111
- return {
112
- name: '',
113
- permissions: null,
114
- permessionsData: [
115
- {
116
- id: 22845207,
117
- name: 'Administrador'
118
- },
119
- {
120
- id: 22890835,
121
- name: 'Usuário Empresas'
122
- },
123
- {
124
- id: 22913699,
125
- name: 'Portal do RH'
126
- },
127
- {
128
- id: 22959227,
129
- name: 'Universidade Corporativa'
130
- },
131
- ]
132
- };
133
- },
134
- methods: {
135
- async sendRequest() {
136
- const pass = await this.$refs.sendRole.validate();
137
- if (!pass) {
138
- return;
139
- }
140
-
141
- let payload = {
142
- level: this.name,
143
- permission_id: this.permissions
144
- };
145
-
146
- this.$emit('add-role', payload);
147
- }
148
- }
149
- };
150
- </script>
151
-
152
- <style lang="scss" scoped>
153
- @import '@burh/nuxt-core/assets/sass/burh-ds/variables/_colors.scss';
154
-
155
- /deep/ .el-dialog__body {
156
- padding: 0;
157
- }
158
-
159
- /deep/ .el-dialog__header {
160
- display: none;
161
- }
162
-
163
- /deep/ .el-dialog {
164
- overflow: hidden;
165
- border-radius: 10px;
166
- max-width: 47.5rem;
167
- }
168
-
169
- .role {
170
- padding: 2rem 3rem;
171
-
172
- section {
173
- margin-top: 2rem;
174
-
175
- .invalid-form {
176
- opacity: 0.3;
177
- }
178
- }
179
- }
180
-
181
- .tool {
182
- position: absolute;
183
- top: 1rem;
184
- z-index: 10;
185
- color: $primary;
186
- cursor: pointer;
187
-
188
- &-close {
189
- position: absolute;
190
- width: 88px;
191
- height: 27px;
192
- right: 7px;
193
- top: 7px;
194
- display: flex;
195
- justify-content: center;
196
- align-items: center;
197
-
198
- font-size: 11px;
199
-
200
- font-weight: 500;
201
- background: rgba(0, 0, 0, 0.2);
202
- border-radius: 17.5px;
203
- color: #fff;
204
- }
205
- }
206
- </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>
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>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burh/nuxt-core",
3
- "version": "1.0.365",
3
+ "version": "1.0.367",
4
4
  "description": "Design System and Components.",
5
5
  "author": "Burh",
6
6
  "scripts": {