@nixweb/nixloc-ui 0.0.124 → 0.0.127
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/docs/src/component/template/ViewTemplateReportPreview.drawio +210 -0
- package/package.json +3 -1
- package/src/component/forms/Button.vue +7 -6
- package/src/component/forms/CheckboxGroup.vue +7 -4
- package/src/component/forms/CheckboxSimple.vue +17 -2
- package/src/component/forms/DateTime.vue +15 -29
- package/src/component/forms/EditorHtml.vue +8 -5
- package/src/component/forms/FileUpload.vue +7 -11
- package/src/component/forms/ImageUpload.vue +222 -0
- package/src/component/forms/InputDecimal.vue +10 -9
- package/src/component/forms/InputNumber.vue +20 -15
- package/src/component/forms/InputPassword.vue +1 -1
- package/src/component/forms/InputText.vue +3 -3
- package/src/component/forms/Modal.vue +9 -4
- package/src/component/forms/Select.vue +12 -9
- package/src/component/forms/SelectStatic.vue +8 -1
- package/src/component/layout/Menu.vue +4 -3
- package/src/component/layout/Panel.vue +0 -2
- package/src/component/layout/{Scrollbar.vue → ScrollBar.vue} +4 -5
- package/src/component/layout/Tag.vue +3 -3
- package/src/component/layout/Wizard.vue +11 -13
- package/src/component/shared/BodyReport.vue +186 -0
- package/src/component/shared/Confirmation.vue +2 -2
- package/src/component/shared/DocumentEditor.vue +1 -1
- package/src/component/shared/ExportExcel.vue +1 -8
- package/src/component/shared/{HeaderPrint.vue → HeaderReport.vue} +3 -3
- package/src/component/shared/HorizontalFilter.vue +1 -1
- package/src/component/shared/Loading.vue +1 -1
- package/src/component/shared/Messages.vue +2 -4
- package/src/component/shared/Pagination.vue +4 -5
- package/src/component/shared/{LegendaParametro.vue → ParameterLegend.vue} +25 -29
- package/src/component/shared/ProgressBar.vue +2 -1
- package/src/component/shared/SaveCancel.vue +20 -4
- package/src/component/shared/Search.vue +16 -16
- package/src/component/shared/SelectOption.vue +137 -0
- package/src/component/shared/Table.vue +33 -22
- package/src/component/shared/TableButton.vue +3 -3
- package/src/component/shared/TableTotalRecords.vue +9 -10
- package/src/component/shared/Toast.vue +2 -2
- package/src/component/shared/VerticalFilter.vue +2 -50
- package/src/component/shared/query-builder/AddRule.vue +49 -55
- package/src/component/shared/query-builder/ConvertToOdata.js +39 -42
- package/src/component/shared/query-builder/DynamicComponent.vue +16 -15
- package/src/component/shared/query-builder/DynamicComponentList.vue +62 -0
- package/src/component/shared/query-builder/Fields.vue +32 -66
- package/src/component/shared/query-builder/QueryBuilder.vue +12 -12
- package/src/component/shared/query-builder/Rules.vue +2 -14
- package/src/component/shared/query-builder/SelectRule.vue +15 -15
- package/src/component/shared/query-builder/Tags.vue +24 -8
- package/src/component/template/{ListViewWithHandlerData.vue → ListViewWithDataHandler.vue} +30 -23
- package/src/component/template/{AddEditReport.vue → ReportCreateUpdate.vue} +31 -20
- package/src/component/template/ViewTemplateConfiguration.vue +6 -12
- package/src/component/template/ViewTemplateDocumentView.vue +21 -25
- package/src/component/template/ViewTemplateReportList.vue +39 -57
- package/src/component/template/ViewTemplateReportPreview.vue +238 -354
- package/src/component/template/ViewTemplateReportPreviewCOPIASEGURANCA.vue +497 -0
- package/src/component/template/ViewTemplateSelectOption.vue +60 -0
- package/src/component/template/ViewTemplateWithTable.vue +21 -14
- package/src/component/template/model/Report.js +2 -2
- package/src/component/value-objects/Address.js +11 -0
- package/src/component/value-objects/{Endereco.vue → Address.vue} +39 -40
- package/src/component/value-objects/{DadosContato.js → Contact.js} +2 -2
- package/src/component/value-objects/{DadosContato.vue → Contact.vue} +17 -17
- package/src/component/value-objects/Person.js +10 -0
- package/src/component/value-objects/{DadosPessoa.vue → Person.vue} +35 -35
- package/src/store/modules/generic.js +17 -11
- package/src/store/modules/report.js +124 -113
- package/src/store/modules/user.js +3 -0
- package/docs/src/component/template/ModeloRelatorioView.drawio +0 -160
- package/src/component/shared/query-builder/ListDynamicComponent.vue +0 -42
- package/src/component/value-objects/DadosPessoa.js +0 -10
- package/src/component/value-objects/Endereco.js +0 -11
|
@@ -4,50 +4,50 @@
|
|
|
4
4
|
<b-col xs="12" sm="12" md="12" lg="3" xl="3">
|
|
5
5
|
<InputText
|
|
6
6
|
title="CEP"
|
|
7
|
-
field="
|
|
7
|
+
field="zipCode"
|
|
8
8
|
:formName="formName"
|
|
9
9
|
:mask="'#####-###'"
|
|
10
10
|
:maxLength="9"
|
|
11
11
|
:required="required"
|
|
12
|
-
v-model="
|
|
12
|
+
v-model="address.zipCode"
|
|
13
13
|
>
|
|
14
14
|
<div class="glyphicon margin-button">
|
|
15
15
|
<Button
|
|
16
|
-
|
|
16
|
+
_key="searchZipCode"
|
|
17
17
|
type="success"
|
|
18
18
|
classIcon="fas fa-search"
|
|
19
19
|
size="small"
|
|
20
|
-
:disabled="
|
|
21
|
-
:clicked="
|
|
20
|
+
:disabled="address.zipCode.length < 9"
|
|
21
|
+
:clicked="searchZipCode"
|
|
22
22
|
/></div
|
|
23
23
|
></InputText>
|
|
24
24
|
</b-col>
|
|
25
25
|
<b-col xs="12" sm="12" md="12" lg="5" xl="5">
|
|
26
26
|
<InputText
|
|
27
27
|
title="Endereço"
|
|
28
|
-
field="
|
|
28
|
+
field="street"
|
|
29
29
|
:formName="formName"
|
|
30
30
|
:maxLength="150"
|
|
31
31
|
:required="required"
|
|
32
|
-
v-model="
|
|
32
|
+
v-model="address.street"
|
|
33
33
|
/>
|
|
34
34
|
</b-col>
|
|
35
35
|
<b-col xs="12" sm="12" md="12" lg="2" xl="2">
|
|
36
36
|
<InputText
|
|
37
37
|
title="Número"
|
|
38
|
-
field="
|
|
38
|
+
field="number"
|
|
39
39
|
:formName="formName"
|
|
40
40
|
:maxLength="20"
|
|
41
|
-
v-model="
|
|
41
|
+
v-model="address.number"
|
|
42
42
|
/>
|
|
43
43
|
</b-col>
|
|
44
44
|
<b-col xs="12" sm="12" md="12" lg="2" xl="2">
|
|
45
45
|
<InputText
|
|
46
46
|
title="Complemento"
|
|
47
|
-
field="
|
|
47
|
+
field="complement"
|
|
48
48
|
:formName="formName"
|
|
49
49
|
:maxLength="50"
|
|
50
|
-
v-model="
|
|
50
|
+
v-model="address.complement"
|
|
51
51
|
/>
|
|
52
52
|
</b-col>
|
|
53
53
|
<br />
|
|
@@ -56,20 +56,20 @@
|
|
|
56
56
|
<b-col xs="12" sm="12" md="12" lg="5" xl="5">
|
|
57
57
|
<InputText
|
|
58
58
|
title="Bairro"
|
|
59
|
-
field="
|
|
59
|
+
field="province"
|
|
60
60
|
:formName="formName"
|
|
61
61
|
:maxLength="100"
|
|
62
62
|
:required="required"
|
|
63
|
-
v-model="
|
|
63
|
+
v-model="address.province"
|
|
64
64
|
/> </b-col
|
|
65
65
|
><b-col xs="12" sm="12" md="12" lg="5" xl="5">
|
|
66
66
|
<InputText
|
|
67
67
|
title="Cidade"
|
|
68
|
-
field="
|
|
68
|
+
field="city"
|
|
69
69
|
:formName="formName"
|
|
70
70
|
:maxLength="100"
|
|
71
71
|
:required="required"
|
|
72
|
-
v-model="
|
|
72
|
+
v-model="address.city"
|
|
73
73
|
/>
|
|
74
74
|
</b-col>
|
|
75
75
|
<b-col xs="12" sm="12" md="12" lg="2" xl="2">
|
|
@@ -77,8 +77,8 @@
|
|
|
77
77
|
title="UF"
|
|
78
78
|
fieldTarget="uf"
|
|
79
79
|
:required="required"
|
|
80
|
-
v-model="
|
|
81
|
-
:data="
|
|
80
|
+
v-model="address.state"
|
|
81
|
+
:data="states"
|
|
82
82
|
/> </b-col
|
|
83
83
|
></b-row>
|
|
84
84
|
</div>
|
|
@@ -89,12 +89,12 @@ import Button from "@nixweb/nixloc-ui/src/component/forms/Button";
|
|
|
89
89
|
import InputText from "@nixweb/nixloc-ui/src/component/forms/InputText";
|
|
90
90
|
import SelectStatic from "@nixweb/nixloc-ui/src/component/forms/SelectStatic";
|
|
91
91
|
|
|
92
|
-
import
|
|
92
|
+
import Address from "@nixweb/nixloc-ui/src/component/value-objects/Address.js";
|
|
93
93
|
|
|
94
94
|
import { mapGetters, mapMutations } from "vuex";
|
|
95
95
|
|
|
96
96
|
export default {
|
|
97
|
-
name: "
|
|
97
|
+
name: "Address",
|
|
98
98
|
props: {
|
|
99
99
|
formName: String,
|
|
100
100
|
required: {
|
|
@@ -107,8 +107,8 @@ export default {
|
|
|
107
107
|
|
|
108
108
|
data() {
|
|
109
109
|
return {
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
address: new Address(),
|
|
111
|
+
states: [
|
|
112
112
|
{ content: "AC", id: "AC" },
|
|
113
113
|
{ content: "AL", id: "AL" },
|
|
114
114
|
{ content: "AP", id: "AP" },
|
|
@@ -140,51 +140,50 @@ export default {
|
|
|
140
140
|
};
|
|
141
141
|
},
|
|
142
142
|
mounted() {
|
|
143
|
-
if (this.value.
|
|
143
|
+
if (this.value.zipCode != undefined) this.address = this.value;
|
|
144
144
|
},
|
|
145
145
|
computed: {
|
|
146
146
|
...mapGetters("generic", ["event"]),
|
|
147
147
|
},
|
|
148
148
|
methods: {
|
|
149
149
|
...mapMutations("generic", ["addEvent", "addNotifications", "removeLoading"]),
|
|
150
|
-
|
|
151
|
-
let
|
|
152
|
-
let url = `https://viacep.com.br/ws/${
|
|
150
|
+
searchZipCode() {
|
|
151
|
+
let zipCode = this.address.zipCode.replace(/\.|\-/g, "");
|
|
152
|
+
let url = `https://viacep.com.br/ws/${zipCode}/json/`;
|
|
153
153
|
this.$http.get(url).then((response) => {
|
|
154
154
|
let self = this;
|
|
155
155
|
setTimeout(function () {
|
|
156
|
-
self.
|
|
157
|
-
self.removeLoading(["
|
|
156
|
+
self.loadData(response.data);
|
|
157
|
+
self.removeLoading(["searchZipCode"]);
|
|
158
158
|
}, 300);
|
|
159
159
|
});
|
|
160
160
|
},
|
|
161
|
-
|
|
162
|
-
this.
|
|
163
|
-
this.
|
|
164
|
-
this.
|
|
165
|
-
this.
|
|
166
|
-
this.
|
|
167
|
-
|
|
168
|
-
this.endereco.estado = { id: data.uf, content: data.uf };
|
|
161
|
+
loadData(data) {
|
|
162
|
+
this.address.zipCode = data.cep;
|
|
163
|
+
this.address.street = data.logradouro;
|
|
164
|
+
this.address.number = data.complemento;
|
|
165
|
+
this.address.province = data.bairro;
|
|
166
|
+
this.address.city = data.localidade == undefined ? data.municipio : data.localidade;
|
|
167
|
+
this.address.state = { id: data.uf, content: data.uf };
|
|
169
168
|
},
|
|
170
169
|
},
|
|
171
170
|
watch: {
|
|
172
171
|
value: {
|
|
173
172
|
handler() {
|
|
174
|
-
this.
|
|
173
|
+
this.address = this.value;
|
|
175
174
|
},
|
|
176
175
|
deep: true,
|
|
177
176
|
},
|
|
178
|
-
|
|
177
|
+
address: {
|
|
179
178
|
handler() {
|
|
180
|
-
this.$emit("input", this.
|
|
179
|
+
this.$emit("input", this.address);
|
|
181
180
|
},
|
|
182
181
|
deep: true,
|
|
183
182
|
},
|
|
184
183
|
event: {
|
|
185
184
|
handler(event) {
|
|
186
|
-
if (event.
|
|
187
|
-
this.
|
|
185
|
+
if (event.name == "searchDocumentFederalRecipe") {
|
|
186
|
+
this.loadData(event.data);
|
|
188
187
|
}
|
|
189
188
|
},
|
|
190
189
|
deep: true,
|
|
@@ -4,23 +4,23 @@
|
|
|
4
4
|
<b-col xs="12" sm="12" md="12" lg="4" xl="4">
|
|
5
5
|
<InputText
|
|
6
6
|
title="Telefone"
|
|
7
|
-
field="
|
|
7
|
+
field="phone"
|
|
8
8
|
:formName="formName"
|
|
9
9
|
:mask="['(##) ####-####', '(##) #####-####']"
|
|
10
10
|
:maxLength="20"
|
|
11
11
|
:required="required"
|
|
12
|
-
v-model="
|
|
12
|
+
v-model="contact.phone"
|
|
13
13
|
/>
|
|
14
14
|
</b-col>
|
|
15
15
|
<b-col xs="12" sm="12" md="12" lg="4" xl="4">
|
|
16
16
|
<InputText
|
|
17
17
|
title="Site"
|
|
18
|
-
field="
|
|
18
|
+
field="webSite"
|
|
19
19
|
:formName="formName"
|
|
20
20
|
mask=""
|
|
21
21
|
:maxLength="100"
|
|
22
22
|
:required="required"
|
|
23
|
-
v-model="
|
|
23
|
+
v-model="contact.webSite"
|
|
24
24
|
/>
|
|
25
25
|
</b-col>
|
|
26
26
|
<b-col xs="12" sm="12" md="12" lg="4" xl="4">
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
mask=""
|
|
32
32
|
:maxLength="100"
|
|
33
33
|
:required="required"
|
|
34
|
-
v-model="
|
|
34
|
+
v-model="contact.email"
|
|
35
35
|
/>
|
|
36
36
|
</b-col>
|
|
37
37
|
</b-row>
|
|
@@ -41,12 +41,12 @@
|
|
|
41
41
|
<script>
|
|
42
42
|
import Button from "@nixweb/nixloc-ui/src/component/forms/Button";
|
|
43
43
|
import InputText from "@nixweb/nixloc-ui/src/component/forms/InputText";
|
|
44
|
-
import
|
|
44
|
+
import Contact from "@nixweb/nixloc-ui/src/component/value-objects/Contact.js";
|
|
45
45
|
|
|
46
46
|
import { mapGetters } from "vuex";
|
|
47
47
|
|
|
48
48
|
export default {
|
|
49
|
-
name: "
|
|
49
|
+
name: "Contact",
|
|
50
50
|
props: {
|
|
51
51
|
formName: String,
|
|
52
52
|
required: {
|
|
@@ -58,16 +58,16 @@ export default {
|
|
|
58
58
|
components: { InputText, Button },
|
|
59
59
|
data() {
|
|
60
60
|
return {
|
|
61
|
-
|
|
61
|
+
contact: new Contact(),
|
|
62
62
|
};
|
|
63
63
|
},
|
|
64
64
|
mounted() {
|
|
65
|
-
if (this.value.
|
|
65
|
+
if (this.value.phone != undefined) this.contact = this.value;
|
|
66
66
|
},
|
|
67
67
|
methods: {
|
|
68
|
-
|
|
69
|
-
this.
|
|
70
|
-
this.
|
|
68
|
+
loadData(data) {
|
|
69
|
+
this.contact.phone = data.phone;
|
|
70
|
+
this.contact.email = data.email;
|
|
71
71
|
},
|
|
72
72
|
},
|
|
73
73
|
computed: {
|
|
@@ -76,20 +76,20 @@ export default {
|
|
|
76
76
|
watch: {
|
|
77
77
|
value: {
|
|
78
78
|
handler() {
|
|
79
|
-
this.
|
|
79
|
+
this.contact = this.value;
|
|
80
80
|
},
|
|
81
81
|
deep: true,
|
|
82
82
|
},
|
|
83
|
-
|
|
83
|
+
contact: {
|
|
84
84
|
handler() {
|
|
85
|
-
this.$emit("input", this.
|
|
85
|
+
this.$emit("input", this.contact);
|
|
86
86
|
},
|
|
87
87
|
deep: true,
|
|
88
88
|
},
|
|
89
89
|
event: {
|
|
90
90
|
handler(event) {
|
|
91
|
-
if (event.
|
|
92
|
-
this.
|
|
91
|
+
if (event.name == "searchDocumentFederalRecipe") {
|
|
92
|
+
this.loadData(event.data);
|
|
93
93
|
}
|
|
94
94
|
},
|
|
95
95
|
deep: true,
|
|
@@ -3,80 +3,80 @@
|
|
|
3
3
|
<b-row>
|
|
4
4
|
<b-col xs="12" sm="12" md="12" lg="4" xl="4">
|
|
5
5
|
<RadioGroup
|
|
6
|
-
field="
|
|
6
|
+
field="typePerson"
|
|
7
7
|
:formName="formName"
|
|
8
8
|
:options="[
|
|
9
9
|
{ text: 'Física', value: 1 },
|
|
10
10
|
{ text: 'Jurídica', value: 2 },
|
|
11
11
|
]"
|
|
12
|
-
v-model="
|
|
12
|
+
v-model="person.typePerson"
|
|
13
13
|
/>
|
|
14
14
|
</b-col>
|
|
15
15
|
</b-row>
|
|
16
16
|
<b-row>
|
|
17
17
|
<b-col xs="12" sm="12" md="12" lg="4" xl="4">
|
|
18
18
|
<InputText
|
|
19
|
-
:title="
|
|
20
|
-
field="
|
|
19
|
+
:title="person.typePerson == 2 ? 'CNPJ' : 'CPF'"
|
|
20
|
+
field="document"
|
|
21
21
|
:formName="formName"
|
|
22
22
|
:mask="['##.###.###/####-##', '###.###.###-##']"
|
|
23
23
|
:maxLength="30"
|
|
24
24
|
:required="required"
|
|
25
|
-
v-model="
|
|
25
|
+
v-model="person.document"
|
|
26
26
|
><div class="glyphicon margin-button">
|
|
27
27
|
<Button
|
|
28
|
-
v-if="
|
|
29
|
-
|
|
28
|
+
v-if="person.typePerson == 2"
|
|
29
|
+
_key="searchDocumentFederalRecipe"
|
|
30
30
|
type="success"
|
|
31
31
|
classIcon="fas fa-search"
|
|
32
|
-
:disabled="
|
|
32
|
+
:disabled="person.document.length < 18"
|
|
33
33
|
size="small"
|
|
34
|
-
:clicked="
|
|
34
|
+
:clicked="searchDocumentFederalRecipe"
|
|
35
35
|
/></div
|
|
36
36
|
></InputText>
|
|
37
37
|
</b-col>
|
|
38
38
|
<b-col xs="12" sm="12" md="12" lg="4" xl="4">
|
|
39
39
|
<InputText
|
|
40
|
-
:title="
|
|
41
|
-
field="
|
|
40
|
+
:title="person.typePerson == 2 ? 'Inscrição Estadual' : 'RG'"
|
|
41
|
+
field="stateInscription"
|
|
42
42
|
:formName="formName"
|
|
43
43
|
:maxLength="50"
|
|
44
44
|
:required="required"
|
|
45
|
-
v-model="
|
|
45
|
+
v-model="person.stateInscription"
|
|
46
46
|
/>
|
|
47
47
|
</b-col>
|
|
48
48
|
<b-col xs="12" sm="12" md="12" lg="4" xl="4">
|
|
49
49
|
<InputText
|
|
50
|
-
v-if="
|
|
50
|
+
v-if="person.typePerson == 2"
|
|
51
51
|
title="Inscrição Municipal"
|
|
52
|
-
field="
|
|
52
|
+
field="municipalInscription"
|
|
53
53
|
:formName="formName"
|
|
54
54
|
:maxLength="50"
|
|
55
55
|
:required="required"
|
|
56
|
-
v-model="
|
|
56
|
+
v-model="person.municipalInscription"
|
|
57
57
|
/>
|
|
58
58
|
</b-col>
|
|
59
59
|
</b-row>
|
|
60
|
-
<br v-if="
|
|
60
|
+
<br v-if="person.typePerson == 2" />
|
|
61
61
|
<b-row>
|
|
62
62
|
<b-col xs="12" sm="12" md="12" lg="8" xl="8">
|
|
63
63
|
<InputText
|
|
64
|
-
:title="
|
|
65
|
-
field="
|
|
64
|
+
:title="person.typePerson == 2 ? 'Razão Social' : 'Nome'"
|
|
65
|
+
field="companyName"
|
|
66
66
|
:formName="formName"
|
|
67
67
|
:required="true"
|
|
68
68
|
:maxLength="100"
|
|
69
|
-
v-model="
|
|
69
|
+
v-model="person.companyName"
|
|
70
70
|
/>
|
|
71
71
|
</b-col>
|
|
72
72
|
<b-col xs="12" sm="12" md="12" lg="4" xl="4">
|
|
73
73
|
<InputText
|
|
74
|
-
:title="
|
|
75
|
-
field="
|
|
74
|
+
:title="person.typePerson == 2 ? 'Fantasia' : 'Apelido'"
|
|
75
|
+
field="tradeName"
|
|
76
76
|
:formName="formName"
|
|
77
77
|
:required="true"
|
|
78
78
|
:maxLength="100"
|
|
79
|
-
v-model="
|
|
79
|
+
v-model="person.tradeName"
|
|
80
80
|
/>
|
|
81
81
|
</b-col>
|
|
82
82
|
</b-row>
|
|
@@ -87,12 +87,12 @@
|
|
|
87
87
|
import Button from "@nixweb/nixloc-ui/src/component/forms/Button";
|
|
88
88
|
import InputText from "@nixweb/nixloc-ui/src/component/forms/InputText";
|
|
89
89
|
import RadioGroup from "@nixweb/nixloc-ui/src/component/forms/RadioGroup";
|
|
90
|
-
import
|
|
90
|
+
import Person from "@nixweb/nixloc-ui/src/component/value-objects/Person.js";
|
|
91
91
|
|
|
92
92
|
import { mapMutations } from "vuex";
|
|
93
93
|
|
|
94
94
|
export default {
|
|
95
|
-
name: "
|
|
95
|
+
name: "Person",
|
|
96
96
|
props: {
|
|
97
97
|
formName: String,
|
|
98
98
|
required: {
|
|
@@ -104,41 +104,41 @@ export default {
|
|
|
104
104
|
components: { RadioGroup, InputText, Button },
|
|
105
105
|
data() {
|
|
106
106
|
return {
|
|
107
|
-
|
|
107
|
+
person: new Person(),
|
|
108
108
|
};
|
|
109
109
|
},
|
|
110
110
|
mounted() {
|
|
111
|
-
if (this.value.
|
|
111
|
+
if (this.value.companyName != undefined) this.person = this.value;
|
|
112
112
|
},
|
|
113
113
|
methods: {
|
|
114
114
|
...mapMutations("generic", ["addEvent", "addNotifications", "removeLoading"]),
|
|
115
|
-
|
|
116
|
-
let url = `https://ws.hubdodesenvolvedor.com.br/v2/cnpj/?cnpj=${this.
|
|
115
|
+
searchDocumentFederalRecipe() {
|
|
116
|
+
let url = `https://ws.hubdodesenvolvedor.com.br/v2/cnpj/?cnpj=${this.person.document}&token=94473735FzLqpNKajP170569464`;
|
|
117
117
|
this.$http.post(url, {}, {}).then((response) => {
|
|
118
118
|
if (response.data.return == "OK") {
|
|
119
119
|
this.addEvent({
|
|
120
|
-
|
|
120
|
+
name: "searchDocumentFederalRecipe",
|
|
121
121
|
data: response.data.result,
|
|
122
122
|
});
|
|
123
|
-
this.
|
|
124
|
-
this.
|
|
123
|
+
this.person.companyName = response.data.result.nome;
|
|
124
|
+
this.person.tradeName = response.data.result.fantasia;
|
|
125
125
|
} else {
|
|
126
126
|
this.addNotifications([{ message: "CNPJ inválido ou não encontrado." }]);
|
|
127
127
|
}
|
|
128
|
-
this.removeLoading(["
|
|
128
|
+
this.removeLoading(["searchDocumentFederalRecipe"]);
|
|
129
129
|
});
|
|
130
130
|
},
|
|
131
131
|
},
|
|
132
132
|
watch: {
|
|
133
133
|
value: {
|
|
134
134
|
handler() {
|
|
135
|
-
this.
|
|
135
|
+
this.person = this.value;
|
|
136
136
|
},
|
|
137
137
|
deep: true,
|
|
138
138
|
},
|
|
139
|
-
|
|
139
|
+
person: {
|
|
140
140
|
handler() {
|
|
141
|
-
this.$emit("input", this.
|
|
141
|
+
this.$emit("input", this.person);
|
|
142
142
|
},
|
|
143
143
|
deep: true,
|
|
144
144
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import axios from "@/config/axios";
|
|
2
|
-
import
|
|
2
|
+
import Tips from "@/config/tips";
|
|
3
3
|
import Token from "@nixweb/nixloc-ui/src/config/token";
|
|
4
4
|
|
|
5
5
|
export default {
|
|
@@ -27,14 +27,23 @@ export default {
|
|
|
27
27
|
type: undefined,
|
|
28
28
|
},
|
|
29
29
|
ids: undefined,
|
|
30
|
-
search: { content: "", filter: {
|
|
30
|
+
search: { content: "", filter: { content: "Contém", id: "contains" } },
|
|
31
31
|
documentHtml: "",
|
|
32
|
-
selectStatic: { dateTime: undefined,
|
|
32
|
+
selectStatic: { dateTime: undefined, fieldTarget: undefined, value: undefined },
|
|
33
33
|
executedSearch: false,
|
|
34
34
|
clearedSearch: false,
|
|
35
35
|
methodExecutedApi: undefined,
|
|
36
36
|
},
|
|
37
37
|
getters: {
|
|
38
|
+
tip: (state) => (tipId) => {
|
|
39
|
+
var tips = new Tips();
|
|
40
|
+
let message = "";
|
|
41
|
+
tips.help.find(value => {
|
|
42
|
+
if (value.tipId == tipId)
|
|
43
|
+
message = value.message;
|
|
44
|
+
})
|
|
45
|
+
return message;
|
|
46
|
+
},
|
|
38
47
|
showModal: (state) => (name) => {
|
|
39
48
|
if (name == state.modal.name) return true;
|
|
40
49
|
return false;
|
|
@@ -55,12 +64,6 @@ export default {
|
|
|
55
64
|
return obj.key === key
|
|
56
65
|
})
|
|
57
66
|
},
|
|
58
|
-
tip: (state) => (obj) => {
|
|
59
|
-
return tips.find(value => {
|
|
60
|
-
if (value.formName == obj.formName && value.field == obj.field)
|
|
61
|
-
return value
|
|
62
|
-
})
|
|
63
|
-
},
|
|
64
67
|
event: (state) => {
|
|
65
68
|
return state.event;
|
|
66
69
|
},
|
|
@@ -241,10 +244,9 @@ export default {
|
|
|
241
244
|
},
|
|
242
245
|
addFilter: (state, obj) => {
|
|
243
246
|
state.selectStatic.dateTime = new Date();
|
|
244
|
-
state.selectStatic.
|
|
247
|
+
state.selectStatic.fieldTarget = obj.fieldTarget;
|
|
245
248
|
state.selectStatic.value = obj.value;
|
|
246
249
|
},
|
|
247
|
-
|
|
248
250
|
},
|
|
249
251
|
actions: {
|
|
250
252
|
postApi: async function (context, params) {
|
|
@@ -253,6 +255,7 @@ export default {
|
|
|
253
255
|
headers: new Token().tokenHeaders(),
|
|
254
256
|
})
|
|
255
257
|
.then((response) => {
|
|
258
|
+
|
|
256
259
|
if (response.data.success) {
|
|
257
260
|
context.commit('addMethodExecutedApi', 'postApi');
|
|
258
261
|
|
|
@@ -269,6 +272,9 @@ export default {
|
|
|
269
272
|
return response.data;
|
|
270
273
|
}
|
|
271
274
|
}, (err) => {
|
|
275
|
+
|
|
276
|
+
console.log(err);
|
|
277
|
+
|
|
272
278
|
if (err.response)
|
|
273
279
|
if (err.response.status === 403)
|
|
274
280
|
context.commit('addNotifications', [{ message: "Usuário sem permissão para adicionar!" }])
|