@nixweb/nixloc-ui 0.0.125 → 0.0.128
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 +79 -77
- package/src/App.vue +13 -13
- package/src/component/forms/Button.vue +170 -169
- package/src/component/forms/CheckboxGroup.vue +72 -63
- package/src/component/forms/CheckboxSimple.vue +46 -27
- package/src/component/forms/Color.vue +38 -38
- package/src/component/forms/DateTime.vue +167 -177
- package/src/component/forms/Dropdown.vue +218 -224
- package/src/component/forms/EditorHtml.vue +126 -123
- package/src/component/forms/FileUpload.vue +185 -189
- package/src/component/forms/ImageUpload.vue +230 -0
- package/src/component/forms/IncrementDecrement.vue +101 -0
- package/src/component/forms/InputDecimal.vue +142 -137
- package/src/component/forms/InputNumber.vue +154 -149
- package/src/component/forms/InputPassword.vue +135 -135
- package/src/component/forms/InputText.vue +162 -157
- package/src/component/forms/Modal.vue +65 -60
- package/src/component/forms/RadioGroup.vue +50 -50
- package/src/component/forms/Select.vue +349 -337
- package/src/component/forms/SelectStatic.vue +127 -120
- package/src/component/forms/Slider.vue +18 -18
- package/src/component/forms/TextArea.vue +126 -126
- package/src/component/layout/Alert.vue +92 -92
- package/src/component/layout/Badge.vue +103 -103
- package/src/component/layout/FixedBar.vue +100 -68
- package/src/component/layout/Header.vue +38 -35
- package/src/component/layout/LoadingFullPage.vue +27 -27
- package/src/component/layout/Menu.vue +210 -214
- package/src/component/layout/Molded.vue +28 -27
- package/src/component/layout/Panel.vue +140 -142
- package/src/component/layout/Popover.vue +126 -126
- package/src/component/layout/ScrollBar.vue +42 -43
- package/src/component/layout/Tab.vue +135 -0
- package/src/component/layout/Tag.vue +3 -3
- package/src/component/layout/Wizard.vue +211 -213
- package/src/component/rental/DisplayPeriodRent.vue +81 -0
- package/src/component/rental/DisplayTotalization.vue +47 -0
- package/src/component/shared/Collapse.vue +131 -131
- package/src/component/shared/Confirmation.vue +2 -2
- package/src/component/shared/DocumentEditor.vue +1 -1
- package/src/component/shared/DocumentPreview.vue +1 -1
- package/src/component/shared/DocumentPublic.vue +34 -0
- package/src/component/shared/ExportExcel.vue +1 -8
- package/src/component/shared/ExportPDF.vue +116 -116
- package/src/component/shared/{HeaderPrint.vue → HeaderReport.vue} +4 -4
- package/src/component/shared/HorizontalFilter.vue +59 -59
- package/src/component/shared/Loading.vue +107 -107
- package/src/component/shared/LoadingMoreButton.vue +23 -23
- package/src/component/shared/Messages.vue +81 -83
- package/src/component/shared/PDFViewer.vue +22 -22
- package/src/component/shared/Pagination.vue +52 -53
- package/src/component/shared/{LegendaParametro.vue → ParameterLegend.vue} +22 -26
- package/src/component/shared/ProgressBar.vue +22 -21
- package/src/component/shared/QueryButton.vue +66 -66
- package/src/component/shared/Report.vue +187 -0
- package/src/component/shared/SaveCancel.vue +26 -5
- package/src/component/shared/Search.vue +154 -154
- package/src/component/shared/SelectOption.vue +146 -0
- package/src/component/shared/Table.vue +163 -243
- package/src/component/shared/TableButton.vue +36 -36
- package/src/component/shared/TableDraggable.vue +127 -0
- package/src/component/shared/TableItem.vue +177 -0
- package/src/component/shared/TableTotalRecords.vue +9 -10
- package/src/component/shared/TableTotalization.vue +47 -47
- package/src/component/shared/Tip.vue +42 -42
- package/src/component/shared/Toast.vue +54 -54
- package/src/component/shared/TotalizationReport.vue +59 -0
- package/src/component/shared/VerticalFilter.vue +97 -145
- package/src/component/shared/query-builder/AddRule.vue +181 -187
- package/src/component/shared/query-builder/ConvertToOdata.js +34 -43
- package/src/component/shared/query-builder/DynamicComponent.vue +21 -16
- package/src/component/shared/query-builder/DynamicComponentList.vue +73 -0
- package/src/component/shared/query-builder/Fields.vue +29 -63
- package/src/component/shared/query-builder/QueryBuilder.vue +69 -69
- 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/shared/query-builder/utilities.js +21 -21
- package/src/component/template/{ListViewWithHandlerData.vue → ListViewWithDataHandler.vue} +260 -231
- package/src/component/template/{AddEditReport.vue → ReportCreateUpdate.vue} +40 -22
- package/src/component/template/ViewTemplateConfiguration.vue +64 -69
- package/src/component/template/ViewTemplateDocumentView.vue +22 -25
- package/src/component/template/ViewTemplateReportList.vue +39 -57
- package/src/component/template/ViewTemplateReportPreview.vue +270 -341
- package/src/component/template/ViewTemplateReportPreviewCOPIASEGURANCA.vue +497 -0
- package/src/component/template/ViewTemplateSelectOption.vue +60 -0
- package/src/component/template/ViewTemplateWithSalveCancel.vue +32 -32
- package/src/component/template/ViewTemplateWithTable.vue +56 -49
- 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} +24 -17
- package/src/component/value-objects/Person.js +10 -0
- package/src/component/value-objects/{DadosPessoa.vue → Person.vue} +50 -35
- package/src/config/axios.js +9 -9
- package/src/config/dicas.js +14 -14
- package/src/config/router.js +13 -13
- package/src/config/token.js +14 -14
- package/src/main.js +23 -23
- package/src/store/modules/generic.js +512 -488
- package/src/store/modules/report.js +156 -127
- package/src/store/modules/user.js +6 -0
- package/src/store/modules/validation.js +38 -38
- package/src/store/store.js +13 -13
- package/docs/src/component/template/ModeloRelatorioView.drawio +0 -160
- package/src/component/shared/query-builder/ListDynamicComponent.vue +0 -42
- package/src/component/shared/query-builder/Totalization.vue +0 -38
- package/src/component/value-objects/DadosPessoa.js +0 -10
- package/src/component/value-objects/Endereco.js +0 -11
|
@@ -1,49 +1,56 @@
|
|
|
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-filter-vertical">
|
|
11
|
-
<slot name="content-filter-vertical"></slot>
|
|
12
|
-
</div>
|
|
13
|
-
<div slot="content-buttons">
|
|
14
|
-
<slot name="content-buttons"></slot>
|
|
15
|
-
</div>
|
|
16
|
-
<div slot="content-main">
|
|
17
|
-
<
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
<slot
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
<slot
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
</
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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-filter-vertical">
|
|
11
|
+
<slot name="content-filter-vertical"></slot>
|
|
12
|
+
</div>
|
|
13
|
+
<div slot="content-buttons">
|
|
14
|
+
<slot name="content-buttons"></slot>
|
|
15
|
+
</div>
|
|
16
|
+
<div slot="content-main">
|
|
17
|
+
<Molded>
|
|
18
|
+
<ListViewWithDataHandler
|
|
19
|
+
:templateList="templateList"
|
|
20
|
+
:buttonRemove="buttonRemove"
|
|
21
|
+
>
|
|
22
|
+
<div slot="content-buttons-table-header">
|
|
23
|
+
<slot name="content-buttons-table-header"></slot>
|
|
24
|
+
</div>
|
|
25
|
+
<div slot="content-filter-horizontal">
|
|
26
|
+
<slot name="content-filter-horizontal"></slot>
|
|
27
|
+
</div>
|
|
28
|
+
<div slot="content-buttons-table">
|
|
29
|
+
<slot name="content-buttons-table"></slot>
|
|
30
|
+
</div>
|
|
31
|
+
</ListViewWithDataHandler>
|
|
32
|
+
</Molded>
|
|
33
|
+
</div>
|
|
34
|
+
</Panel>
|
|
35
|
+
</div>
|
|
36
|
+
</template>
|
|
37
|
+
|
|
38
|
+
<script>
|
|
39
|
+
import Panel from "@nixweb/nixloc-ui/src/component/layout/Panel.vue";
|
|
40
|
+
import Molded from "@nixweb/nixloc-ui/src/component/layout/Molded";
|
|
41
|
+
|
|
42
|
+
import ListViewWithDataHandler from "@nixweb/nixloc-ui/src/component/template/ListViewWithDataHandler.vue";
|
|
43
|
+
|
|
44
|
+
export default {
|
|
45
|
+
name: "TemplateView",
|
|
46
|
+
components: { Panel, Molded, ListViewWithDataHandler },
|
|
47
|
+
props: {
|
|
48
|
+
panel: Object,
|
|
49
|
+
templateList: Object,
|
|
50
|
+
buttonRemove: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: true,
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
</script>
|
|
@@ -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,25 @@
|
|
|
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
|
+
:markFormDirty="markFormDirty"
|
|
13
14
|
/>
|
|
14
15
|
</b-col>
|
|
15
16
|
<b-col xs="12" sm="12" md="12" lg="4" xl="4">
|
|
16
17
|
<InputText
|
|
17
18
|
title="Site"
|
|
18
|
-
field="
|
|
19
|
+
field="webSite"
|
|
19
20
|
:formName="formName"
|
|
20
21
|
mask=""
|
|
21
22
|
:maxLength="100"
|
|
22
23
|
:required="required"
|
|
23
|
-
v-model="
|
|
24
|
+
v-model="contact.webSite"
|
|
25
|
+
:markFormDirty="markFormDirty"
|
|
24
26
|
/>
|
|
25
27
|
</b-col>
|
|
26
28
|
<b-col xs="12" sm="12" md="12" lg="4" xl="4">
|
|
@@ -31,7 +33,8 @@
|
|
|
31
33
|
mask=""
|
|
32
34
|
:maxLength="100"
|
|
33
35
|
:required="required"
|
|
34
|
-
v-model="
|
|
36
|
+
v-model="contact.email"
|
|
37
|
+
:markFormDirty="markFormDirty"
|
|
35
38
|
/>
|
|
36
39
|
</b-col>
|
|
37
40
|
</b-row>
|
|
@@ -41,33 +44,37 @@
|
|
|
41
44
|
<script>
|
|
42
45
|
import Button from "@nixweb/nixloc-ui/src/component/forms/Button";
|
|
43
46
|
import InputText from "@nixweb/nixloc-ui/src/component/forms/InputText";
|
|
44
|
-
import
|
|
47
|
+
import Contact from "@nixweb/nixloc-ui/src/component/value-objects/Contact.js";
|
|
45
48
|
|
|
46
49
|
import { mapGetters } from "vuex";
|
|
47
50
|
|
|
48
51
|
export default {
|
|
49
|
-
name: "
|
|
52
|
+
name: "Contact",
|
|
50
53
|
props: {
|
|
51
54
|
formName: String,
|
|
52
55
|
required: {
|
|
53
56
|
type: Boolean,
|
|
54
57
|
default: false,
|
|
55
58
|
},
|
|
59
|
+
markFormDirty: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
default: true,
|
|
62
|
+
},
|
|
56
63
|
value: Object,
|
|
57
64
|
},
|
|
58
65
|
components: { InputText, Button },
|
|
59
66
|
data() {
|
|
60
67
|
return {
|
|
61
|
-
|
|
68
|
+
contact: new Contact(),
|
|
62
69
|
};
|
|
63
70
|
},
|
|
64
71
|
mounted() {
|
|
65
|
-
if (this.value.
|
|
72
|
+
if (this.value.phone != undefined) this.contact = this.value;
|
|
66
73
|
},
|
|
67
74
|
methods: {
|
|
68
|
-
|
|
69
|
-
this.
|
|
70
|
-
this.
|
|
75
|
+
loadData(data) {
|
|
76
|
+
this.contact.phone = data.phone;
|
|
77
|
+
this.contact.email = data.email;
|
|
71
78
|
},
|
|
72
79
|
},
|
|
73
80
|
computed: {
|
|
@@ -76,20 +83,20 @@ export default {
|
|
|
76
83
|
watch: {
|
|
77
84
|
value: {
|
|
78
85
|
handler() {
|
|
79
|
-
this.
|
|
86
|
+
this.contact = this.value;
|
|
80
87
|
},
|
|
81
88
|
deep: true,
|
|
82
89
|
},
|
|
83
|
-
|
|
90
|
+
contact: {
|
|
84
91
|
handler() {
|
|
85
|
-
this.$emit("input", this.
|
|
92
|
+
this.$emit("input", this.contact);
|
|
86
93
|
},
|
|
87
94
|
deep: true,
|
|
88
95
|
},
|
|
89
96
|
event: {
|
|
90
97
|
handler(event) {
|
|
91
|
-
if (event.
|
|
92
|
-
this.
|
|
98
|
+
if (event.name == "searchDocumentFederalRecipe") {
|
|
99
|
+
this.loadData(event.data);
|
|
93
100
|
}
|
|
94
101
|
},
|
|
95
102
|
deep: true,
|
|
@@ -3,80 +3,87 @@
|
|
|
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
|
+
v-show="showTypePerson"
|
|
8
9
|
:options="[
|
|
9
10
|
{ text: 'Física', value: 1 },
|
|
10
11
|
{ text: 'Jurídica', value: 2 },
|
|
11
12
|
]"
|
|
12
|
-
v-model="
|
|
13
|
+
v-model="person.typePerson"
|
|
14
|
+
:markFormDirty="markFormDirty"
|
|
13
15
|
/>
|
|
14
16
|
</b-col>
|
|
15
17
|
</b-row>
|
|
16
18
|
<b-row>
|
|
17
19
|
<b-col xs="12" sm="12" md="12" lg="4" xl="4">
|
|
18
20
|
<InputText
|
|
19
|
-
:title="
|
|
20
|
-
field="
|
|
21
|
+
:title="person.typePerson == 2 ? 'CNPJ' : 'CPF'"
|
|
22
|
+
field="document"
|
|
21
23
|
:formName="formName"
|
|
22
24
|
:mask="['##.###.###/####-##', '###.###.###-##']"
|
|
23
25
|
:maxLength="30"
|
|
24
26
|
:required="required"
|
|
25
|
-
v-model="
|
|
27
|
+
v-model="person.document"
|
|
28
|
+
:markFormDirty="markFormDirty"
|
|
26
29
|
><div class="glyphicon margin-button">
|
|
27
30
|
<Button
|
|
28
|
-
v-if="
|
|
29
|
-
|
|
31
|
+
v-if="person.typePerson == 2"
|
|
32
|
+
_key="searchDocumentFederalRecipe"
|
|
30
33
|
type="success"
|
|
31
34
|
classIcon="fas fa-search"
|
|
32
|
-
:disabled="
|
|
35
|
+
:disabled="person.document.length < 18"
|
|
33
36
|
size="small"
|
|
34
|
-
:clicked="
|
|
37
|
+
:clicked="searchDocumentFederalRecipe"
|
|
35
38
|
/></div
|
|
36
39
|
></InputText>
|
|
37
40
|
</b-col>
|
|
38
41
|
<b-col xs="12" sm="12" md="12" lg="4" xl="4">
|
|
39
42
|
<InputText
|
|
40
|
-
:title="
|
|
41
|
-
field="
|
|
43
|
+
:title="person.typePerson == 2 ? 'Inscrição Estadual' : 'RG'"
|
|
44
|
+
field="stateInscription"
|
|
42
45
|
:formName="formName"
|
|
43
46
|
:maxLength="50"
|
|
44
47
|
:required="required"
|
|
45
|
-
v-model="
|
|
48
|
+
v-model="person.stateInscription"
|
|
49
|
+
:markFormDirty="markFormDirty"
|
|
46
50
|
/>
|
|
47
51
|
</b-col>
|
|
48
52
|
<b-col xs="12" sm="12" md="12" lg="4" xl="4">
|
|
49
53
|
<InputText
|
|
50
|
-
v-if="
|
|
54
|
+
v-if="person.typePerson == 2"
|
|
51
55
|
title="Inscrição Municipal"
|
|
52
|
-
field="
|
|
56
|
+
field="municipalInscription"
|
|
53
57
|
:formName="formName"
|
|
54
58
|
:maxLength="50"
|
|
55
59
|
:required="required"
|
|
56
|
-
v-model="
|
|
60
|
+
v-model="person.municipalInscription"
|
|
61
|
+
:markFormDirty="markFormDirty"
|
|
57
62
|
/>
|
|
58
63
|
</b-col>
|
|
59
64
|
</b-row>
|
|
60
|
-
<br v-if="
|
|
65
|
+
<br v-if="person.typePerson == 2" />
|
|
61
66
|
<b-row>
|
|
62
67
|
<b-col xs="12" sm="12" md="12" lg="8" xl="8">
|
|
63
68
|
<InputText
|
|
64
|
-
:title="
|
|
65
|
-
field="
|
|
69
|
+
:title="person.typePerson == 2 ? 'Razão Social' : 'Nome'"
|
|
70
|
+
field="companyName"
|
|
66
71
|
:formName="formName"
|
|
67
72
|
:required="true"
|
|
68
73
|
:maxLength="100"
|
|
69
|
-
v-model="
|
|
74
|
+
v-model="person.companyName"
|
|
75
|
+
:markFormDirty="markFormDirty"
|
|
70
76
|
/>
|
|
71
77
|
</b-col>
|
|
72
78
|
<b-col xs="12" sm="12" md="12" lg="4" xl="4">
|
|
73
79
|
<InputText
|
|
74
|
-
:title="
|
|
75
|
-
field="
|
|
80
|
+
:title="person.typePerson == 2 ? 'Fantasia' : 'Apelido'"
|
|
81
|
+
field="tradeName"
|
|
76
82
|
:formName="formName"
|
|
77
83
|
:required="true"
|
|
78
84
|
:maxLength="100"
|
|
79
|
-
v-model="
|
|
85
|
+
v-model="person.tradeName"
|
|
86
|
+
:markFormDirty="markFormDirty"
|
|
80
87
|
/>
|
|
81
88
|
</b-col>
|
|
82
89
|
</b-row>
|
|
@@ -87,58 +94,66 @@
|
|
|
87
94
|
import Button from "@nixweb/nixloc-ui/src/component/forms/Button";
|
|
88
95
|
import InputText from "@nixweb/nixloc-ui/src/component/forms/InputText";
|
|
89
96
|
import RadioGroup from "@nixweb/nixloc-ui/src/component/forms/RadioGroup";
|
|
90
|
-
import
|
|
97
|
+
import Person from "@nixweb/nixloc-ui/src/component/value-objects/Person.js";
|
|
91
98
|
|
|
92
99
|
import { mapMutations } from "vuex";
|
|
93
100
|
|
|
94
101
|
export default {
|
|
95
|
-
name: "
|
|
102
|
+
name: "Person",
|
|
96
103
|
props: {
|
|
97
104
|
formName: String,
|
|
98
105
|
required: {
|
|
99
106
|
type: Boolean,
|
|
100
107
|
default: false,
|
|
101
108
|
},
|
|
109
|
+
showTypePerson: {
|
|
110
|
+
type: Boolean,
|
|
111
|
+
default: true,
|
|
112
|
+
},
|
|
113
|
+
markFormDirty: {
|
|
114
|
+
type: Boolean,
|
|
115
|
+
default: true,
|
|
116
|
+
},
|
|
102
117
|
value: Object,
|
|
103
118
|
},
|
|
104
119
|
components: { RadioGroup, InputText, Button },
|
|
105
120
|
data() {
|
|
106
121
|
return {
|
|
107
|
-
|
|
122
|
+
person: new Person(),
|
|
108
123
|
};
|
|
109
124
|
},
|
|
110
125
|
mounted() {
|
|
111
|
-
if (this.value.
|
|
126
|
+
if (this.value.companyName != undefined) this.person = this.value;
|
|
112
127
|
},
|
|
113
128
|
methods: {
|
|
114
129
|
...mapMutations("generic", ["addEvent", "addNotifications", "removeLoading"]),
|
|
115
|
-
|
|
116
|
-
let url = `https://ws.hubdodesenvolvedor.com.br/v2/cnpj/?cnpj=${this.
|
|
130
|
+
searchDocumentFederalRecipe() {
|
|
131
|
+
let url = `https://ws.hubdodesenvolvedor.com.br/v2/cnpj/?cnpj=${this.person.document}&token=94473735FzLqpNKajP170569464`;
|
|
117
132
|
this.$http.post(url, {}, {}).then((response) => {
|
|
118
133
|
if (response.data.return == "OK") {
|
|
119
134
|
this.addEvent({
|
|
120
|
-
|
|
135
|
+
name: "searchDocumentFederalRecipe",
|
|
121
136
|
data: response.data.result,
|
|
122
137
|
});
|
|
123
|
-
this.
|
|
124
|
-
this.
|
|
138
|
+
this.person.companyName = response.data.result.nome;
|
|
139
|
+
this.person.tradeName = response.data.result.fantasia;
|
|
125
140
|
} else {
|
|
126
141
|
this.addNotifications([{ message: "CNPJ inválido ou não encontrado." }]);
|
|
127
142
|
}
|
|
128
|
-
this.removeLoading(["
|
|
143
|
+
this.removeLoading(["searchDocumentFederalRecipe"]);
|
|
129
144
|
});
|
|
130
145
|
},
|
|
131
146
|
},
|
|
132
147
|
watch: {
|
|
133
148
|
value: {
|
|
134
149
|
handler() {
|
|
135
|
-
this.
|
|
150
|
+
this.person = this.value;
|
|
136
151
|
},
|
|
137
152
|
deep: true,
|
|
138
153
|
},
|
|
139
|
-
|
|
154
|
+
person: {
|
|
140
155
|
handler() {
|
|
141
|
-
this.$emit("input", this.
|
|
156
|
+
this.$emit("input", this.person);
|
|
142
157
|
},
|
|
143
158
|
deep: true,
|
|
144
159
|
},
|
package/src/config/axios.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import axios from "axios";
|
|
2
|
-
|
|
3
|
-
const BASE_URL = process.env.VUE_APP_API_URL;
|
|
4
|
-
|
|
5
|
-
const api = axios.create({
|
|
6
|
-
baseURL: BASE_URL,
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
export default api;
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
|
|
3
|
+
const BASE_URL = process.env.VUE_APP_API_URL;
|
|
4
|
+
|
|
5
|
+
const api = axios.create({
|
|
6
|
+
baseURL: BASE_URL,
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export default api;
|