@nixweb/nixloc-ui 0.0.144 → 0.0.145
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.
- package/package.json +1 -1
- package/src/component/forms/FileUpload.vue +13 -4
- package/src/component/forms/Toggle.vue +11 -1
- package/src/component/shared/TableImport.vue +91 -0
- package/src/component/template/ViewTemplateImportFile.vue +173 -0
- package/src/component/value-objects/Contact.vue +1 -1
- package/src/component/value-objects/Person.vue +9 -3
- package/src/store/modules/generic.js +4 -4
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<div class="file" v-if="!value">
|
|
5
5
|
<button class="button small primary">
|
|
6
6
|
<span v-if="!loadingAdd">
|
|
7
|
-
<i class="
|
|
7
|
+
<i :class="classIcon"></i> {{ title }}</span
|
|
8
8
|
>
|
|
9
9
|
<vue-loading
|
|
10
10
|
v-if="loadingAdd"
|
|
@@ -22,10 +22,18 @@
|
|
|
22
22
|
/>
|
|
23
23
|
</div>
|
|
24
24
|
<div v-if="value">
|
|
25
|
-
<button
|
|
25
|
+
<button
|
|
26
|
+
class="button small success"
|
|
27
|
+
@click="download()"
|
|
28
|
+
v-if="!loadingAdd"
|
|
29
|
+
>
|
|
26
30
|
<i class="fas fa-cloud-download-alt"></i> Baixar
|
|
27
31
|
</button>
|
|
28
|
-
<button
|
|
32
|
+
<button
|
|
33
|
+
class="button small danger"
|
|
34
|
+
v-if="!loadingAdd"
|
|
35
|
+
@click="remove()"
|
|
36
|
+
>
|
|
29
37
|
<span v-if="!loadingRemove">Remover</span>
|
|
30
38
|
<vue-loading
|
|
31
39
|
v-if="loadingRemove"
|
|
@@ -46,6 +54,7 @@ export default {
|
|
|
46
54
|
name: "FileUpload",
|
|
47
55
|
props: {
|
|
48
56
|
title: String,
|
|
57
|
+
classIcon: String,
|
|
49
58
|
container: String,
|
|
50
59
|
allowed: String,
|
|
51
60
|
accepted: String,
|
|
@@ -163,7 +172,7 @@ export default {
|
|
|
163
172
|
}
|
|
164
173
|
|
|
165
174
|
.small {
|
|
166
|
-
padding:
|
|
175
|
+
padding: 3px 8px;
|
|
167
176
|
font-size: 13px;
|
|
168
177
|
}
|
|
169
178
|
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
<div class="main">
|
|
3
3
|
<b-row>
|
|
4
4
|
<b-col xs="6" sm="6" md="6" lg="6" xl="6">
|
|
5
|
-
<span class="title">
|
|
5
|
+
<span class="title">
|
|
6
|
+
<i class="toggle-icon" :class="classIcon"></i> {{ title }}
|
|
7
|
+
</span>
|
|
6
8
|
<br />
|
|
7
9
|
</b-col>
|
|
8
10
|
<b-col xs="6" sm="6" md="6" lg="4" xl="4">
|
|
@@ -33,6 +35,7 @@ export default {
|
|
|
33
35
|
props: {
|
|
34
36
|
title: String,
|
|
35
37
|
color: String,
|
|
38
|
+
classIcon: String,
|
|
36
39
|
disabled: {
|
|
37
40
|
type: Boolean,
|
|
38
41
|
default: false,
|
|
@@ -64,7 +67,14 @@ export default {
|
|
|
64
67
|
padding: 5px;
|
|
65
68
|
}
|
|
66
69
|
|
|
70
|
+
.toggle-icon {
|
|
71
|
+
font-size: 14px;
|
|
72
|
+
margin-right: 5px;
|
|
73
|
+
margin-bottom: 2px;
|
|
74
|
+
}
|
|
75
|
+
|
|
67
76
|
.title {
|
|
77
|
+
margin-left: -3px;
|
|
68
78
|
padding-right: 35px;
|
|
69
79
|
margin-bottom: 50px !important;
|
|
70
80
|
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<div class="div-main">
|
|
4
|
+
<br />
|
|
5
|
+
<table class="table table-responsive-xs">
|
|
6
|
+
<thead>
|
|
7
|
+
<tr>
|
|
8
|
+
<th
|
|
9
|
+
v-for="(obj, ind) in headerTable"
|
|
10
|
+
:key="ind"
|
|
11
|
+
class="title-header"
|
|
12
|
+
>
|
|
13
|
+
<div class="div-select">
|
|
14
|
+
<SelectStatic
|
|
15
|
+
:title="obj.title"
|
|
16
|
+
fieldTarget="timeZone"
|
|
17
|
+
:data="select"
|
|
18
|
+
:markFormDirty="false"
|
|
19
|
+
v-model="obj.target"
|
|
20
|
+
/>
|
|
21
|
+
</div>
|
|
22
|
+
</th>
|
|
23
|
+
</tr>
|
|
24
|
+
</thead>
|
|
25
|
+
<tbody>
|
|
26
|
+
<tr v-for="(row, index) in data" :key="index">
|
|
27
|
+
<td v-for="(obj, ind) in headerTable" :key="ind">
|
|
28
|
+
<div>{{ row[obj.field] }}</div>
|
|
29
|
+
</td>
|
|
30
|
+
</tr>
|
|
31
|
+
</tbody>
|
|
32
|
+
</table>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
</template>
|
|
36
|
+
|
|
37
|
+
<script>
|
|
38
|
+
import SelectStatic from "@nixweb/nixloc-ui/src/component/forms/SelectStatic";
|
|
39
|
+
|
|
40
|
+
export default {
|
|
41
|
+
components: {
|
|
42
|
+
SelectStatic,
|
|
43
|
+
},
|
|
44
|
+
props: {
|
|
45
|
+
select: Array,
|
|
46
|
+
headerTable: Array,
|
|
47
|
+
data: Array,
|
|
48
|
+
},
|
|
49
|
+
name: "TableImport",
|
|
50
|
+
data() {
|
|
51
|
+
return {};
|
|
52
|
+
},
|
|
53
|
+
methods: {},
|
|
54
|
+
};
|
|
55
|
+
</script>
|
|
56
|
+
<style scoped>
|
|
57
|
+
.div-main {
|
|
58
|
+
overflow: auto;
|
|
59
|
+
white-space: nowrap;
|
|
60
|
+
min-height: 450px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.table th,
|
|
64
|
+
.table td {
|
|
65
|
+
height: 10px !important;
|
|
66
|
+
padding-left: 5px !important;
|
|
67
|
+
padding-top: 7px !important;
|
|
68
|
+
padding-bottom: 5px !important;
|
|
69
|
+
padding-right: 5px !important;
|
|
70
|
+
padding-left: 10px !important;
|
|
71
|
+
border-bottom: 0px !important;
|
|
72
|
+
width: 200px !important;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.title-header {
|
|
76
|
+
font-size: 14px;
|
|
77
|
+
color: #757d8c;
|
|
78
|
+
font-weight: 400;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.tabela-description {
|
|
82
|
+
white-space: nowrap;
|
|
83
|
+
overflow: hidden;
|
|
84
|
+
text-overflow: ellipsis;
|
|
85
|
+
max-width: 200px;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.div-select {
|
|
89
|
+
width: 310px;
|
|
90
|
+
}
|
|
91
|
+
</style>
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<Panel
|
|
4
|
+
:module="panel.module"
|
|
5
|
+
:title="panel.title"
|
|
6
|
+
:showVerticalFilter="panel.showVerticalFilter"
|
|
7
|
+
:showSearch="panel.showSearch"
|
|
8
|
+
:showButtons="panel.showButtons"
|
|
9
|
+
>
|
|
10
|
+
<div slot="content-main">
|
|
11
|
+
<br />
|
|
12
|
+
<Molded>
|
|
13
|
+
<div v-show="!fileName">
|
|
14
|
+
<slot></slot>
|
|
15
|
+
<div class="import-icon">
|
|
16
|
+
<i class="fas fa-file-import"></i>
|
|
17
|
+
</div>
|
|
18
|
+
<span>
|
|
19
|
+
Selecione o arquivo no formato <b> .xlsx </b> baseado na planilha
|
|
20
|
+
modelo e aguarde até carregar os dados para conferência. </span
|
|
21
|
+
><br />
|
|
22
|
+
<span>
|
|
23
|
+
Até <b> 1000 </b> itens por planilha ou <b> 1MB </b> no arquivo.
|
|
24
|
+
</span>
|
|
25
|
+
<div class="div-file">
|
|
26
|
+
<FileUpload
|
|
27
|
+
title="Selecione o arquivo .xlsx"
|
|
28
|
+
classIcon="fa-solid fa-file-excel"
|
|
29
|
+
:container="container"
|
|
30
|
+
accepted=".xlsx"
|
|
31
|
+
allowed=".xlsx"
|
|
32
|
+
:disabled="true"
|
|
33
|
+
urlPost="/api/v1/adm/file-upload/upload"
|
|
34
|
+
urlRemove="/api/v1/adm/file-upload/delete"
|
|
35
|
+
:onLoad="successUploadFile"
|
|
36
|
+
:nameDataBase="fileName"
|
|
37
|
+
v-model="fileName"
|
|
38
|
+
/>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<div class="div-loading" v-show="loading">
|
|
43
|
+
<span
|
|
44
|
+
>Aguarde, estamos carregando os dados, isso pode levar alguns
|
|
45
|
+
minutos...</span
|
|
46
|
+
>
|
|
47
|
+
<Loading type="line" :center="false" />
|
|
48
|
+
</div>
|
|
49
|
+
<div v-show="fileName && !loading">
|
|
50
|
+
<div class="import-icon">
|
|
51
|
+
<i class="fas fa-file-import"></i>
|
|
52
|
+
</div>
|
|
53
|
+
<span>
|
|
54
|
+
Efetue o <b> mapeamento </b> dos campos e clique em iniciar
|
|
55
|
+
validação.</span
|
|
56
|
+
>
|
|
57
|
+
<br />
|
|
58
|
+
<div class="div-btn">
|
|
59
|
+
<Button
|
|
60
|
+
_key="btnBack"
|
|
61
|
+
type="info"
|
|
62
|
+
title="voltar"
|
|
63
|
+
classIcon="fa-solid fa-circle-arrow-left"
|
|
64
|
+
size="small"
|
|
65
|
+
:clicked="back"
|
|
66
|
+
/>
|
|
67
|
+
<Button
|
|
68
|
+
_key="print"
|
|
69
|
+
type="primary"
|
|
70
|
+
title="Iniciar Validação"
|
|
71
|
+
classIcon="fa-solid fa-arrow-right-arrow-left"
|
|
72
|
+
size="small"
|
|
73
|
+
:clicked="print"
|
|
74
|
+
/>
|
|
75
|
+
</div>
|
|
76
|
+
<TableImport
|
|
77
|
+
:select="select"
|
|
78
|
+
:headerTable="headerTable"
|
|
79
|
+
:data="data"
|
|
80
|
+
/>
|
|
81
|
+
</div>
|
|
82
|
+
</Molded>
|
|
83
|
+
</div>
|
|
84
|
+
</Panel>
|
|
85
|
+
</div>
|
|
86
|
+
</template>
|
|
87
|
+
|
|
88
|
+
<script>
|
|
89
|
+
import Panel from "@nixweb/nixloc-ui/src/component/layout/Panel.vue";
|
|
90
|
+
import Button from "@nixweb/nixloc-ui/src/component/forms/Button";
|
|
91
|
+
import Molded from "@nixweb/nixloc-ui/src/component/layout/Molded";
|
|
92
|
+
import FileUpload from "@nixweb/nixloc-ui/src/component/forms/FileUpload";
|
|
93
|
+
import Loading from "@nixweb/nixloc-ui/src/component/shared/Loading.vue";
|
|
94
|
+
import TableImport from "@nixweb/nixloc-ui/src/component/shared/TableImport.vue";
|
|
95
|
+
|
|
96
|
+
import { mapState, mapActions, mapMutations } from "vuex";
|
|
97
|
+
|
|
98
|
+
export default {
|
|
99
|
+
name: "ViewTemplateImportFileView",
|
|
100
|
+
components: { Panel, Button, Molded, FileUpload, Loading, TableImport },
|
|
101
|
+
props: {
|
|
102
|
+
panel: Object,
|
|
103
|
+
select: Array,
|
|
104
|
+
container: String,
|
|
105
|
+
typeImport: Number,
|
|
106
|
+
},
|
|
107
|
+
data() {
|
|
108
|
+
return {
|
|
109
|
+
fileName: "",
|
|
110
|
+
urlMapping: "/api/v1/stock/import-product/mapping",
|
|
111
|
+
loading: false,
|
|
112
|
+
headerTable: [],
|
|
113
|
+
data: [
|
|
114
|
+
{ cell1: "a", cell2: "c", cell3: "d" },
|
|
115
|
+
{ cell1: "a", cell2: "c", cell3: "d" },
|
|
116
|
+
],
|
|
117
|
+
};
|
|
118
|
+
},
|
|
119
|
+
methods: {
|
|
120
|
+
...mapActions("generic", ["postApi"]),
|
|
121
|
+
...mapMutations("generic", ["removeLoading"]),
|
|
122
|
+
successUploadFile() {
|
|
123
|
+
this.loading = true;
|
|
124
|
+
let self = this;
|
|
125
|
+
setTimeout(function () {
|
|
126
|
+
self.mapping(self.fileName);
|
|
127
|
+
}, 1000);
|
|
128
|
+
},
|
|
129
|
+
mapping(fileName) {
|
|
130
|
+
let params = {
|
|
131
|
+
url: this.urlMapping,
|
|
132
|
+
obj: {
|
|
133
|
+
fileName: fileName,
|
|
134
|
+
container: this.container,
|
|
135
|
+
typeImport: this.typeImport,
|
|
136
|
+
},
|
|
137
|
+
notNotifyToast: true,
|
|
138
|
+
};
|
|
139
|
+
this.postApi(params).then((response) => {
|
|
140
|
+
if (response.success) {
|
|
141
|
+
this.loading = false;
|
|
142
|
+
this.headerTable = response.content.headerTable;
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
},
|
|
146
|
+
back() {
|
|
147
|
+
this.fileName = "";
|
|
148
|
+
this.removeLoading(["btnBack"]);
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
};
|
|
152
|
+
</script>
|
|
153
|
+
|
|
154
|
+
<style scoped>
|
|
155
|
+
.import-icon {
|
|
156
|
+
font-size: 30px;
|
|
157
|
+
opacity: 0.2;
|
|
158
|
+
color: #577696;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.div-file {
|
|
162
|
+
margin-top: 10px;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.div-btn {
|
|
166
|
+
margin-top: 10px;
|
|
167
|
+
margin-left: -8px;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.div-loading {
|
|
171
|
+
margin-top: 10px;
|
|
172
|
+
}
|
|
173
|
+
</style>
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
field="municipalInscription"
|
|
57
57
|
:formName="formName"
|
|
58
58
|
:maxLength="50"
|
|
59
|
-
:required="
|
|
59
|
+
:required="false"
|
|
60
60
|
v-model="person.municipalInscription"
|
|
61
61
|
:markFormDirty="markFormDirty"
|
|
62
62
|
/>
|
|
@@ -126,7 +126,11 @@ export default {
|
|
|
126
126
|
if (this.value.companyName != undefined) this.person = this.value;
|
|
127
127
|
},
|
|
128
128
|
methods: {
|
|
129
|
-
...mapMutations("generic", [
|
|
129
|
+
...mapMutations("generic", [
|
|
130
|
+
"addEvent",
|
|
131
|
+
"addNotifications",
|
|
132
|
+
"removeLoading",
|
|
133
|
+
]),
|
|
130
134
|
searchDocumentFederalRecipe() {
|
|
131
135
|
let url = `https://ws.hubdodesenvolvedor.com.br/v2/cnpj/?cnpj=${this.person.document}&token=94473735FzLqpNKajP170569464`;
|
|
132
136
|
this.$http.post(url, {}, {}).then((response) => {
|
|
@@ -138,7 +142,9 @@ export default {
|
|
|
138
142
|
this.person.companyName = response.data.result.nome;
|
|
139
143
|
this.person.tradeName = response.data.result.fantasia;
|
|
140
144
|
} else {
|
|
141
|
-
this.addNotifications([
|
|
145
|
+
this.addNotifications([
|
|
146
|
+
{ message: "CNPJ inválido ou não encontrado." },
|
|
147
|
+
]);
|
|
142
148
|
}
|
|
143
149
|
this.removeLoading(["searchDocumentFederalRecipe"]);
|
|
144
150
|
});
|
|
@@ -321,7 +321,7 @@ export default {
|
|
|
321
321
|
|
|
322
322
|
if (err.response)
|
|
323
323
|
if (err.response.status === 403)
|
|
324
|
-
context.commit('addNotifications', [{ message: "Usuário sem permissão para
|
|
324
|
+
context.commit('addNotifications', [{ message: "Usuário sem permissão para executar esta ação!" }])
|
|
325
325
|
|
|
326
326
|
if (!err.response)
|
|
327
327
|
context.commit('addNotificationErrorApi');
|
|
@@ -351,7 +351,7 @@ export default {
|
|
|
351
351
|
}, (err) => {
|
|
352
352
|
if (err.response)
|
|
353
353
|
if (err.response.status === 403)
|
|
354
|
-
context.commit('addNotifications', [{ message: "Usuário sem permissão para
|
|
354
|
+
context.commit('addNotifications', [{ message: "Usuário sem permissão para executar esta ação!" }])
|
|
355
355
|
|
|
356
356
|
if (!err.response)
|
|
357
357
|
context.commit('addNotificationErrorApi');
|
|
@@ -429,7 +429,7 @@ export default {
|
|
|
429
429
|
}, (err) => {
|
|
430
430
|
if (err.response)
|
|
431
431
|
if (err.response.status === 403)
|
|
432
|
-
context.commit('addNotifications', [{ message: "Usuário sem permissão para
|
|
432
|
+
context.commit('addNotifications', [{ message: "Usuário sem permissão para executar esta ação!" }])
|
|
433
433
|
|
|
434
434
|
if (!err.response)
|
|
435
435
|
context.commit('addNotificationErrorApi');
|
|
@@ -459,7 +459,7 @@ export default {
|
|
|
459
459
|
}, (err) => {
|
|
460
460
|
if (err.response)
|
|
461
461
|
if (err.response.status === 403)
|
|
462
|
-
context.commit('addNotifications', [{ message: "Usuário sem permissão para
|
|
462
|
+
context.commit('addNotifications', [{ message: "Usuário sem permissão para executar esta ação!" }])
|
|
463
463
|
|
|
464
464
|
if (!err.response)
|
|
465
465
|
context.commit('addNotificationErrorApi');
|