@freteclick/quasar-financial-ui 1.0.85
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 +18 -0
- package/src/components/common/Filters.vue +141 -0
- package/src/components/expense/FormExpense.vue +309 -0
- package/src/components/expense/TableExpenses.vue +305 -0
- package/src/components/invoice/client/ClientInvoiceDetails.vue +213 -0
- package/src/components/invoice/client/InvoiceSearching.vue +383 -0
- package/src/components/invoice/client/details/InvoiceInvoice.vue +249 -0
- package/src/components/invoice/client/details/InvoiceOrders.vue +328 -0
- package/src/components/invoice/expense/CreateExpense.vue +539 -0
- package/src/components/invoice/expense/DetailExpense.vue +393 -0
- package/src/components/invoice/pay/InvoiceDetails.vue +210 -0
- package/src/components/invoice/pay/InvoiceSearching.vue +388 -0
- package/src/components/invoice/pay/details/InvoiceInvoice.vue +47 -0
- package/src/components/invoice/pay/details/InvoiceOrders.vue +342 -0
- package/src/components/invoice/receive/InvoiceDetails.vue +281 -0
- package/src/components/invoice/receive/InvoiceSearching.vue +359 -0
- package/src/components/invoice/receive/details/InvoiceInvoice.vue +371 -0
- package/src/components/invoice/receive/details/InvoiceInvoiceBkp.vue +260 -0
- package/src/components/invoice/receive/details/InvoiceOrders.vue +370 -0
- package/src/i18n/en-us/index.js +8 -0
- package/src/i18n/index.js +5 -0
- package/src/i18n/pt-br/index.js +30 -0
- package/src/pages/Invoice/Client/Details.vue +23 -0
- package/src/pages/Invoice/Client/Index.vue +27 -0
- package/src/pages/Invoice/Pay/Details.vue +23 -0
- package/src/pages/Invoice/Pay/Index.vue +53 -0
- package/src/pages/Invoice/Receive/Details.vue +23 -0
- package/src/pages/Invoice/Receive/Index.vue +27 -0
- package/src/router/routes.js +32 -0
- package/src/store/modules/invoice/comission/actions.js +66 -0
- package/src/store/modules/invoice/comission/getters.js +7 -0
- package/src/store/modules/invoice/comission/index.js +19 -0
- package/src/store/modules/invoice/comission/mutation_types.js +8 -0
- package/src/store/modules/invoice/comission/mutations.js +42 -0
- package/src/store/modules/invoice/expense/actions.js +98 -0
- package/src/store/modules/invoice/expense/getters.js +1 -0
- package/src/store/modules/invoice/expense/index.js +12 -0
- package/src/store/modules/invoice/expense/mutations.js +3 -0
- package/src/store/modules/invoice/expense/state.js +5 -0
- package/src/store/modules/invoice/pay/actions.js +114 -0
- package/src/store/modules/invoice/pay/getters.js +7 -0
- package/src/store/modules/invoice/pay/index.js +19 -0
- package/src/store/modules/invoice/pay/mutation_types.js +8 -0
- package/src/store/modules/invoice/pay/mutations.js +42 -0
- package/src/store/modules/invoice/receive/actions.js +152 -0
- package/src/store/modules/invoice/receive/actionsBkp.js +77 -0
- package/src/store/modules/invoice/receive/getters.js +7 -0
- package/src/store/modules/invoice/receive/index.js +19 -0
- package/src/store/modules/invoice/receive/mutation_types.js +8 -0
- package/src/store/modules/invoice/receive/mutations.js +42 -0
- package/src/store/store-flag.d.ts +9 -0
package/package.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@freteclick/quasar-financial-ui",
|
|
3
|
+
"version": "1.0.85",
|
|
4
|
+
"author": "FreteClick",
|
|
5
|
+
"description": "FreteClick financial Quasar UI Component",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"main": "src/index.js",
|
|
8
|
+
"scripts": {},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://github.com/Frete-Click/fclick-quasar-ui"
|
|
12
|
+
},
|
|
13
|
+
"bugs": "",
|
|
14
|
+
"homepage": "https://www.freteclick.com/devs/plugins",
|
|
15
|
+
"browserslist": [
|
|
16
|
+
"last 1 version, not dead, ie >= 11"
|
|
17
|
+
]
|
|
18
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<q-card class="row q-pa-md">
|
|
3
|
+
<div class="col-xs-12 q-pb-md text-h6">Faturas</div>
|
|
4
|
+
<div class="col-sm-6 col-xs-12 q-pa-md">
|
|
5
|
+
<q-input stack-label label="Buscar por" debounce="1000" v-model="filters.text" class="full-width" />
|
|
6
|
+
</div>
|
|
7
|
+
<div class="col-sm-6 col-xs-12 q-pa-md">
|
|
8
|
+
<q-select stack-label label="Status da fatura" v-model="filters.status" :options="statuses" class="full-width"
|
|
9
|
+
:loading="loadingStatuses">
|
|
10
|
+
<template v-slot:no-option>
|
|
11
|
+
<q-item>
|
|
12
|
+
<q-item-section class="text-grey"> Sem resultados </q-item-section>
|
|
13
|
+
</q-item>
|
|
14
|
+
</template>
|
|
15
|
+
</q-select>
|
|
16
|
+
</div>
|
|
17
|
+
<div class="col-6">
|
|
18
|
+
<q-select stack-label label="Tipo de Fatura" v-model="filters.orderType" :options="orderType" class="full-width"
|
|
19
|
+
:loading="loadingOrderType">
|
|
20
|
+
<template v-slot:no-option>
|
|
21
|
+
<q-item>
|
|
22
|
+
<q-item-section class="text-grey"> Sem resultados </q-item-section>
|
|
23
|
+
</q-item>
|
|
24
|
+
</template>
|
|
25
|
+
</q-select>
|
|
26
|
+
</div>
|
|
27
|
+
<div class="col-6">
|
|
28
|
+
<DataFilter :fromDate="filters.date.from" :toDate="filters.date.to" :showButton="false"
|
|
29
|
+
@dateChanged="dateChanged" />
|
|
30
|
+
</div>
|
|
31
|
+
</q-card>
|
|
32
|
+
</template>
|
|
33
|
+
<script>
|
|
34
|
+
import { mapActions, mapGetters } from "vuex";
|
|
35
|
+
import {
|
|
36
|
+
formatMoney,
|
|
37
|
+
formatDateYmdTodmY,
|
|
38
|
+
} from "@freteclick/quasar-common-ui/src/utils/formatter";
|
|
39
|
+
import DataFilter from "@freteclick/quasar-common-ui/src/components/common/DataFilter.vue";
|
|
40
|
+
import { date } from "quasar";
|
|
41
|
+
|
|
42
|
+
export default {
|
|
43
|
+
components: {
|
|
44
|
+
DataFilter,
|
|
45
|
+
},
|
|
46
|
+
props: {
|
|
47
|
+
filters: {
|
|
48
|
+
type: Object,
|
|
49
|
+
required: true,
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
created() {
|
|
54
|
+
this.requestStatuses();
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
data() {
|
|
58
|
+
let statuses = [{ label: "Selecione um status", value: -1 }];
|
|
59
|
+
|
|
60
|
+
return {
|
|
61
|
+
statuses: statuses,
|
|
62
|
+
loadingStatuses: false,
|
|
63
|
+
loadingOrderType: false,
|
|
64
|
+
orderType: [
|
|
65
|
+
{
|
|
66
|
+
label: "Todos",
|
|
67
|
+
value: null,
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
label: "Comissão",
|
|
71
|
+
value: "comission",
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
label: "Compra",
|
|
75
|
+
value: "purchase",
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
label: "Royalties",
|
|
79
|
+
value: "royalties",
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
label: "Venda",
|
|
83
|
+
value: "sale",
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
};
|
|
87
|
+
},
|
|
88
|
+
|
|
89
|
+
computed: {},
|
|
90
|
+
|
|
91
|
+
watch: {
|
|
92
|
+
"filters.text"() {
|
|
93
|
+
this.$emit("onRequest");
|
|
94
|
+
},
|
|
95
|
+
"filters.orderType"() {
|
|
96
|
+
this.$emit("onRequest");
|
|
97
|
+
},
|
|
98
|
+
"filters.status"() {
|
|
99
|
+
this.$emit("onRequest");
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
|
|
103
|
+
methods: {
|
|
104
|
+
...mapActions({
|
|
105
|
+
getStatuses: "receiveInvoice/getStatuses",
|
|
106
|
+
}),
|
|
107
|
+
|
|
108
|
+
requestStatuses() {
|
|
109
|
+
this.loadingStatuses = true;
|
|
110
|
+
this.getStatuses({
|
|
111
|
+
visibility: "public",
|
|
112
|
+
context: "invoice",
|
|
113
|
+
realStatus: ["open", "pending", "canceled", "closed"],
|
|
114
|
+
}).then((statuses) => {
|
|
115
|
+
if (statuses.length) {
|
|
116
|
+
let data = [];
|
|
117
|
+
|
|
118
|
+
data.push({
|
|
119
|
+
label: "Todos",
|
|
120
|
+
value: null,
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
for (let index in statuses) {
|
|
124
|
+
data.push({
|
|
125
|
+
label: this.$t(`invoice.statuses.${statuses[index].status}`),
|
|
126
|
+
value: statuses[index]["@id"].replace(/[^0-9]/g, ""),
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
this.statuses = data;
|
|
131
|
+
}
|
|
132
|
+
this.loadingStatuses = false;
|
|
133
|
+
});
|
|
134
|
+
},
|
|
135
|
+
dateChanged(item) {
|
|
136
|
+
this.filters.date = item;
|
|
137
|
+
this.$emit("onRequest");
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
};
|
|
141
|
+
</script>
|
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<q-form @submit="onSubmit">
|
|
3
|
+
<div class="row items-center q-mb-md">
|
|
4
|
+
<div class="text-h6">
|
|
5
|
+
{{ item.id === null ? $t('Nova despesa') : $t('Edição despesa') }}
|
|
6
|
+
</div>
|
|
7
|
+
</div>
|
|
8
|
+
<div class="row">
|
|
9
|
+
<div class="col-xs-12 q-mb-md">
|
|
10
|
+
<q-select stack-label emit-value map-options lazy-rules
|
|
11
|
+
v-model ="item.category"
|
|
12
|
+
:label ="$t('Categoria da despesa')"
|
|
13
|
+
:options="categories"
|
|
14
|
+
:rules ="[val => val !== null || 'Selecione uma categoria']"
|
|
15
|
+
/>
|
|
16
|
+
</div>
|
|
17
|
+
<div class="col-xs-12 q-mb-md">
|
|
18
|
+
<q-input lazy-rules stack-label
|
|
19
|
+
v-model="item.description"
|
|
20
|
+
type ="text"
|
|
21
|
+
:label ="$t('Descrição da despesa')"
|
|
22
|
+
class ="q-mt-md"
|
|
23
|
+
:rules ="[isInvalid()]"
|
|
24
|
+
/>
|
|
25
|
+
</div>
|
|
26
|
+
<div class="col-xs-12 q-mb-md">
|
|
27
|
+
<PeopleAutocomplete
|
|
28
|
+
:source="searchPeople"
|
|
29
|
+
:isLoading="isSearching"
|
|
30
|
+
label="Definir o fornecedor"
|
|
31
|
+
@selected="onSelectClient"
|
|
32
|
+
placeholder="Pesquisar..."
|
|
33
|
+
/>
|
|
34
|
+
</div>
|
|
35
|
+
<div class="col-xs-12 q-mb-md">
|
|
36
|
+
<q-input lazy-rules stack-label reverse-fill-mask
|
|
37
|
+
v-model ="item.amount"
|
|
38
|
+
prefix ="R$"
|
|
39
|
+
type ="text"
|
|
40
|
+
:label ="$t('Valor')"
|
|
41
|
+
class ="q-mt-md"
|
|
42
|
+
:rules ="[isInvalid()]"
|
|
43
|
+
mask ="#,##"
|
|
44
|
+
fill-mask="0"
|
|
45
|
+
/>
|
|
46
|
+
</div>
|
|
47
|
+
<div class="col-xs-12 q-mb-md text-center">
|
|
48
|
+
<q-radio v-model="item.recurrence" val="single" :label="$t('Pagamento único')" />
|
|
49
|
+
<q-radio v-model="item.recurrence" val="monthly" :label="$t('Pagamento recorrente')" />
|
|
50
|
+
</div>
|
|
51
|
+
<div v-if="item.recurrence == 'single'"
|
|
52
|
+
class="col-xs-12 q-mb-md"
|
|
53
|
+
>
|
|
54
|
+
<q-select stack-label emit-value map-options lazy-rules
|
|
55
|
+
v-model ="item.parcels"
|
|
56
|
+
:label ="$t('Número de parcelas')"
|
|
57
|
+
:options="parcels"
|
|
58
|
+
class ="q-mb-sm"
|
|
59
|
+
:rules ="[val => val !== null || 'Selecione um número']"
|
|
60
|
+
/>
|
|
61
|
+
</div>
|
|
62
|
+
<div class="col-xs-12 q-mb-md">
|
|
63
|
+
<q-input stack-label
|
|
64
|
+
v-model="item.dueDate"
|
|
65
|
+
:label ="$t('Data primeiro vencimento')"
|
|
66
|
+
mask ="##/##/####"
|
|
67
|
+
class ="q-mb-sm"
|
|
68
|
+
:rules ="[isInvalid('date')]"
|
|
69
|
+
>
|
|
70
|
+
<template v-slot:append>
|
|
71
|
+
<q-icon name="event" class="cursor-pointer">
|
|
72
|
+
<q-popup-proxy ref="qDateProxy1" transition-show="scale" transition-hide="scale">
|
|
73
|
+
<q-date
|
|
74
|
+
v-model ="item.dueDate"
|
|
75
|
+
mask ="DD/MM/YYYY"
|
|
76
|
+
@input ="() => $refs.qDateProxy1.hide()"
|
|
77
|
+
/>
|
|
78
|
+
</q-popup-proxy>
|
|
79
|
+
</q-icon>
|
|
80
|
+
</template>
|
|
81
|
+
</q-input>
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
84
|
+
<div class="row justify-end">
|
|
85
|
+
<q-btn
|
|
86
|
+
:loading="saving"
|
|
87
|
+
icon ="save"
|
|
88
|
+
type ="submit"
|
|
89
|
+
:label ="$t('Salvar')"
|
|
90
|
+
size ="md"
|
|
91
|
+
color ="primary"
|
|
92
|
+
class ="q-mt-md"
|
|
93
|
+
/>
|
|
94
|
+
</div>
|
|
95
|
+
</q-form>
|
|
96
|
+
</template>
|
|
97
|
+
|
|
98
|
+
<script>
|
|
99
|
+
import { mapActions, mapGetters } from 'vuex';
|
|
100
|
+
import { formatDateYmdTodmY } from '@freteclick/quasar-common-ui/src/utils/formatter';
|
|
101
|
+
import Api from '@freteclick/quasar-common-ui/src/utils/api';
|
|
102
|
+
|
|
103
|
+
export default {
|
|
104
|
+
props: {
|
|
105
|
+
id : {
|
|
106
|
+
required: false,
|
|
107
|
+
default : null
|
|
108
|
+
},
|
|
109
|
+
api: {
|
|
110
|
+
type : Api,
|
|
111
|
+
required: true
|
|
112
|
+
},
|
|
113
|
+
context:{
|
|
114
|
+
type: String,
|
|
115
|
+
required: true
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
|
|
119
|
+
created() {
|
|
120
|
+
this.loadSelectableOptions();
|
|
121
|
+
|
|
122
|
+
if (this.id !== null) {
|
|
123
|
+
this.getItem(this.id)
|
|
124
|
+
.then(item => {
|
|
125
|
+
this.item.category = item.category['@id'];
|
|
126
|
+
this.item.description = item.description;
|
|
127
|
+
this.item.provider = item.provider['@id'];
|
|
128
|
+
this.item.amount = (parseFloat(item.amount) + 0.001).toFixed(2);
|
|
129
|
+
this.item.parcels = item.parcels;
|
|
130
|
+
this.item.dueDate = formatDateYmdTodmY(item.dueDate);
|
|
131
|
+
this.item.recurrence = item.parcels == null ? 'monthly' : 'single';
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
|
|
136
|
+
data() {
|
|
137
|
+
return {
|
|
138
|
+
saving: false,
|
|
139
|
+
item : {
|
|
140
|
+
"id" : this.id,
|
|
141
|
+
"category" : null,
|
|
142
|
+
"description": null,
|
|
143
|
+
"provider" : null,
|
|
144
|
+
"amount" : null,
|
|
145
|
+
"parcels" : null,
|
|
146
|
+
"dueDate" : null,
|
|
147
|
+
"recurrence" : 'single',
|
|
148
|
+
},
|
|
149
|
+
categories: [],
|
|
150
|
+
providers : [],
|
|
151
|
+
parcels : [],
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
|
|
155
|
+
computed: {
|
|
156
|
+
...mapGetters({
|
|
157
|
+
myCompany: 'people/currentCompany',
|
|
158
|
+
}),
|
|
159
|
+
},
|
|
160
|
+
|
|
161
|
+
methods: {
|
|
162
|
+
...mapActions({
|
|
163
|
+
getStatuses : 'payInvoice/getStatuses',
|
|
164
|
+
getCategories : 'categories/getCategories',
|
|
165
|
+
getProviders : 'expense/getProviders',
|
|
166
|
+
}),
|
|
167
|
+
|
|
168
|
+
// store method
|
|
169
|
+
getItem(id) {
|
|
170
|
+
return this.api.private(`company_expenses/${id}`)
|
|
171
|
+
.then(response => response.json())
|
|
172
|
+
.then(response => {
|
|
173
|
+
return response;
|
|
174
|
+
});
|
|
175
|
+
},
|
|
176
|
+
|
|
177
|
+
// store method
|
|
178
|
+
save(values, params = {}) {
|
|
179
|
+
let options = {
|
|
180
|
+
method : this.id === null ? 'POST' : 'PUT',
|
|
181
|
+
headers: new Headers({ 'Content-Type': 'application/ld+json' }),
|
|
182
|
+
body : JSON.stringify(values),
|
|
183
|
+
params : params,
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
let endpoint = this.id === null ?
|
|
187
|
+
'company_expenses' : `company_expenses/${this.id}`;
|
|
188
|
+
|
|
189
|
+
return this.api.private(endpoint, options)
|
|
190
|
+
.then(response => response.json())
|
|
191
|
+
.then(data => {
|
|
192
|
+
this.$q.notify({
|
|
193
|
+
message : this.$t('Dados salvos com sucesso!'),
|
|
194
|
+
position: 'bottom',
|
|
195
|
+
type : 'positive',
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
return data;
|
|
199
|
+
})
|
|
200
|
+
.catch(error => {
|
|
201
|
+
this.$q.notify({
|
|
202
|
+
message : this.$t(error.message),
|
|
203
|
+
position: 'bottom',
|
|
204
|
+
type : 'negative',
|
|
205
|
+
});
|
|
206
|
+
});
|
|
207
|
+
},
|
|
208
|
+
|
|
209
|
+
loadProviders() {
|
|
210
|
+
this.getProviders({
|
|
211
|
+
params: {
|
|
212
|
+
'myCompany': this.myCompany.id
|
|
213
|
+
}
|
|
214
|
+
}).then(members => {
|
|
215
|
+
if (members.length) {
|
|
216
|
+
let items = [];
|
|
217
|
+
members.forEach((item, i) => {
|
|
218
|
+
items.push({
|
|
219
|
+
label: item.name,
|
|
220
|
+
value: item['@id']
|
|
221
|
+
});
|
|
222
|
+
});
|
|
223
|
+
this.providers = items;
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
},
|
|
227
|
+
|
|
228
|
+
loadSelectableOptions() {
|
|
229
|
+
// load parcels
|
|
230
|
+
for (let num = 1; num <= 12; num++) {
|
|
231
|
+
this.parcels.push({
|
|
232
|
+
label: `${num}x`,
|
|
233
|
+
value: num,
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
this.item.parcels = this.parcels[0].value;
|
|
237
|
+
|
|
238
|
+
// load categories
|
|
239
|
+
this.loadCategories();
|
|
240
|
+
|
|
241
|
+
// load providers
|
|
242
|
+
this.loadProviders();
|
|
243
|
+
},
|
|
244
|
+
|
|
245
|
+
loadCategories() {
|
|
246
|
+
this.getCategories({
|
|
247
|
+
params: {
|
|
248
|
+
'context': this.context,
|
|
249
|
+
'company': this.myCompany.id,
|
|
250
|
+
}
|
|
251
|
+
}).then(members => {
|
|
252
|
+
if (members.length) {
|
|
253
|
+
let items = [];
|
|
254
|
+
|
|
255
|
+
items.push({
|
|
256
|
+
label: null,
|
|
257
|
+
value: null
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
members.forEach((item, i) => {
|
|
261
|
+
items.push({
|
|
262
|
+
label: item.name,
|
|
263
|
+
value: item['@id']
|
|
264
|
+
});
|
|
265
|
+
});
|
|
266
|
+
this.categories = items;
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
},
|
|
270
|
+
|
|
271
|
+
onSubmit() {
|
|
272
|
+
this.saving = true;
|
|
273
|
+
|
|
274
|
+
this.save(
|
|
275
|
+
{
|
|
276
|
+
"company" : `/people/${this.myCompany.id}`,
|
|
277
|
+
"category" : this.item.category,
|
|
278
|
+
"description": this.item.description,
|
|
279
|
+
"provider" : this.item.provider,
|
|
280
|
+
"amount" : parseFloat(this.item.amount.replace(',', '.')),
|
|
281
|
+
"parcels" : this.item.recurrence == 'monthly' ? null : this.item.parcels,
|
|
282
|
+
"dueDate" : this.item.dueDate ? this.item.dueDate.replace(/^(\d{2})\/(\d{2})\/(\d{4})$/g, "\$3\-\$2\-\$1") : null,
|
|
283
|
+
"paymentDay" : parseInt(this.item.dueDate.replace(/^(\d{2})\/(\d{2})\/(\d{4})$/g, "\$1")),
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
"myCompany" : this.myCompany.id
|
|
287
|
+
}
|
|
288
|
+
)
|
|
289
|
+
.finally(() => {
|
|
290
|
+
this.saving = false;
|
|
291
|
+
});
|
|
292
|
+
},
|
|
293
|
+
|
|
294
|
+
isInvalid(field) {
|
|
295
|
+
return val => {
|
|
296
|
+
if (field == 'date') {
|
|
297
|
+
if (!/^\d{2}\/\d{2}\/\d{4}$/g.test(val))
|
|
298
|
+
return this.$t('A data não é válida');
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
if (!(val && val.length > 0))
|
|
302
|
+
return this.$t('Este campo é obrigatório');
|
|
303
|
+
|
|
304
|
+
return true;
|
|
305
|
+
};
|
|
306
|
+
},
|
|
307
|
+
},
|
|
308
|
+
};
|
|
309
|
+
</script>
|