@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.
Files changed (51) hide show
  1. package/package.json +18 -0
  2. package/src/components/common/Filters.vue +141 -0
  3. package/src/components/expense/FormExpense.vue +309 -0
  4. package/src/components/expense/TableExpenses.vue +305 -0
  5. package/src/components/invoice/client/ClientInvoiceDetails.vue +213 -0
  6. package/src/components/invoice/client/InvoiceSearching.vue +383 -0
  7. package/src/components/invoice/client/details/InvoiceInvoice.vue +249 -0
  8. package/src/components/invoice/client/details/InvoiceOrders.vue +328 -0
  9. package/src/components/invoice/expense/CreateExpense.vue +539 -0
  10. package/src/components/invoice/expense/DetailExpense.vue +393 -0
  11. package/src/components/invoice/pay/InvoiceDetails.vue +210 -0
  12. package/src/components/invoice/pay/InvoiceSearching.vue +388 -0
  13. package/src/components/invoice/pay/details/InvoiceInvoice.vue +47 -0
  14. package/src/components/invoice/pay/details/InvoiceOrders.vue +342 -0
  15. package/src/components/invoice/receive/InvoiceDetails.vue +281 -0
  16. package/src/components/invoice/receive/InvoiceSearching.vue +359 -0
  17. package/src/components/invoice/receive/details/InvoiceInvoice.vue +371 -0
  18. package/src/components/invoice/receive/details/InvoiceInvoiceBkp.vue +260 -0
  19. package/src/components/invoice/receive/details/InvoiceOrders.vue +370 -0
  20. package/src/i18n/en-us/index.js +8 -0
  21. package/src/i18n/index.js +5 -0
  22. package/src/i18n/pt-br/index.js +30 -0
  23. package/src/pages/Invoice/Client/Details.vue +23 -0
  24. package/src/pages/Invoice/Client/Index.vue +27 -0
  25. package/src/pages/Invoice/Pay/Details.vue +23 -0
  26. package/src/pages/Invoice/Pay/Index.vue +53 -0
  27. package/src/pages/Invoice/Receive/Details.vue +23 -0
  28. package/src/pages/Invoice/Receive/Index.vue +27 -0
  29. package/src/router/routes.js +32 -0
  30. package/src/store/modules/invoice/comission/actions.js +66 -0
  31. package/src/store/modules/invoice/comission/getters.js +7 -0
  32. package/src/store/modules/invoice/comission/index.js +19 -0
  33. package/src/store/modules/invoice/comission/mutation_types.js +8 -0
  34. package/src/store/modules/invoice/comission/mutations.js +42 -0
  35. package/src/store/modules/invoice/expense/actions.js +98 -0
  36. package/src/store/modules/invoice/expense/getters.js +1 -0
  37. package/src/store/modules/invoice/expense/index.js +12 -0
  38. package/src/store/modules/invoice/expense/mutations.js +3 -0
  39. package/src/store/modules/invoice/expense/state.js +5 -0
  40. package/src/store/modules/invoice/pay/actions.js +114 -0
  41. package/src/store/modules/invoice/pay/getters.js +7 -0
  42. package/src/store/modules/invoice/pay/index.js +19 -0
  43. package/src/store/modules/invoice/pay/mutation_types.js +8 -0
  44. package/src/store/modules/invoice/pay/mutations.js +42 -0
  45. package/src/store/modules/invoice/receive/actions.js +152 -0
  46. package/src/store/modules/invoice/receive/actionsBkp.js +77 -0
  47. package/src/store/modules/invoice/receive/getters.js +7 -0
  48. package/src/store/modules/invoice/receive/index.js +19 -0
  49. package/src/store/modules/invoice/receive/mutation_types.js +8 -0
  50. package/src/store/modules/invoice/receive/mutations.js +42 -0
  51. package/src/store/store-flag.d.ts +9 -0
@@ -0,0 +1,328 @@
1
+ <template>
2
+ <q-table :loading="isLoading" :data="data" :columns="settings.columns" :pagination.sync="pagination"
3
+ @request="onRequest" row-key="id" :visible-columns="settings.visibleColumns" style="min-height: 90vh;">
4
+ <template v-slot:body="props">
5
+ <q-tr :props="props">
6
+ <q-td key="id" :props="props">
7
+ <q-btn outline dense :to="{ name: 'ClientOrderDetails', params: { id: props.row.id } }"
8
+ :label="`#${props.row.id}`" :style="{ color: props.row.color_status }" class="full-width" />
9
+ </q-td>
10
+ <q-td key="notaFiscal" :props="props">{{ props.row.notaFiscal }}</q-td>
11
+ <q-td key="dataPedido" :props="props">{{ props.cols[2].value }}</q-td>
12
+ <q-td key="ultimaModificacao" :props="props">{{ props.cols[3].value }}</q-td>
13
+ <q-td key="status" :props="props" :style="{ color: props.row.color_status }">
14
+ {{ $t(`order.statuses.${props.row.status}`) }}
15
+ </q-td>
16
+ <q-td key="coleta" :props="props">
17
+ {{ props.row.localColeta }}<br />{{ props.row.coleta }}
18
+ </q-td>
19
+ <q-td key="entrega" :props="props">
20
+ {{ props.row.localEntrega }}<br />{{ props.row.entrega }}
21
+ </q-td>
22
+ <q-td key="transportadora" :props="props">
23
+ {{ props.row.transportadora }}
24
+ </q-td>
25
+ <q-td key="preco" :props="props">{{ props.cols[8].value }}</q-td>
26
+ </q-tr>
27
+ </template>
28
+ </q-table>
29
+ </template>
30
+
31
+ <script>
32
+ import { mapActions, mapGetters } from 'vuex';
33
+ import { date } from 'quasar';
34
+ import { formatMoney } from '@freteclick/quasar-common-ui/src/utils/formatter';
35
+
36
+ const SETTINGS = {
37
+ visibleColumns: [
38
+ 'id',
39
+ 'notaFiscal',
40
+ 'dataPedido',
41
+ 'ultimaModificacao',
42
+ 'status',
43
+ 'coleta',
44
+ 'entrega',
45
+ 'transportadora',
46
+ 'preco',
47
+ ],
48
+ columns: [
49
+ {
50
+ name: 'id',
51
+ field: 'id',
52
+ align: 'left',
53
+ label: 'ID'
54
+ },
55
+ {
56
+ name: 'notaFiscal',
57
+ field: 'notaFiscal',
58
+ align: 'left',
59
+ label: 'Nota Fiscal',
60
+ format: (val, row) => {
61
+ return val ? '#' + val : ''
62
+ },
63
+ },
64
+ {
65
+ name: 'dataPedido',
66
+ field: 'dataPedido',
67
+ align: 'left',
68
+ format: (val, row) => {
69
+ return date.formatDate(val, 'DD/MM/YYYY')
70
+ },
71
+ label: 'Data do pedido'
72
+ },
73
+ {
74
+ name: 'ultimaModificacao',
75
+ field: 'ultimaModificacao',
76
+ align: 'left',
77
+ format: (val, row) => {
78
+ return date.formatDate(val, 'DD/MM/YYYY HH:mm:ss')
79
+ },
80
+ label: 'Ultima alteração'
81
+ },
82
+ {
83
+ name: 'status',
84
+ field: 'status',
85
+ align: 'left',
86
+ label: 'Status'
87
+ },
88
+ {
89
+ name: 'coleta',
90
+ field: 'coleta',
91
+ align: 'left',
92
+ label: 'Coleta'
93
+ },
94
+ {
95
+ name: 'localColeta',
96
+ field: 'localColeta',
97
+ align: 'left',
98
+ label: 'Local de coleta'
99
+ },
100
+ {
101
+ name: 'entrega',
102
+ field: 'entrega',
103
+ align: 'left',
104
+ label: 'Entrega'
105
+ },
106
+ {
107
+ name: 'localEntrega',
108
+ field: 'localEntrega',
109
+ align: 'left',
110
+ label: 'Local de entrega'
111
+ },
112
+ {
113
+ name: 'transportadora',
114
+ field: 'transportadora',
115
+ align: 'left',
116
+ label: 'Transportadora'
117
+ },
118
+ {
119
+ name: 'preco',
120
+ field: 'preco',
121
+ align: 'left',
122
+ format: (val, row) => {
123
+ return formatMoney(val, 'BRL', 'pt-br');
124
+ },
125
+ label: 'Preço'
126
+ },
127
+ ],
128
+ };
129
+
130
+ Object.freeze(SETTINGS);
131
+
132
+ export default {
133
+ props: {
134
+ search: {
135
+ type: Boolean,
136
+ required: false,
137
+ default: true,
138
+ },
139
+ invoiceId: {
140
+ type: String,
141
+ required: false,
142
+ default: null,
143
+ },
144
+ },
145
+
146
+ created() {
147
+ if (this.myCompany !== null) {
148
+ this.filters.company = this.myCompany;
149
+ this.onRequest({
150
+ pagination: this.pagination,
151
+ filter: this.filters,
152
+ });
153
+ }
154
+ this.requestStatuses();
155
+ },
156
+
157
+ beforeDestroy() {
158
+ this.reset();
159
+ },
160
+
161
+ data() {
162
+ let statuses = [
163
+ { 'label': 'Todos', 'value': -1 },
164
+ ];
165
+
166
+ return {
167
+ settings: SETTINGS,
168
+ data: [],
169
+ statuses: statuses,
170
+ filters: {
171
+ text: null,
172
+ status: statuses[0],
173
+ company: null,
174
+ },
175
+ pagination: {
176
+ sortBy: 'ultimaModificacao',
177
+ descending: false,
178
+ page: 1,
179
+ rowsPerPage: 10,
180
+ rowsNumber: 10,
181
+ },
182
+ loadingStatuses: false,
183
+ }
184
+ },
185
+
186
+ computed: {
187
+ ...mapGetters({
188
+ isLoading: 'purchasingOrder/isLoading',
189
+ error: 'purchasingOrder/error',
190
+ violations: 'purchasingOrder/violations',
191
+ items: 'purchasingOrder/items',
192
+ totalItems: 'purchasingOrder/totalItems',
193
+ myCompany: 'people/currentCompany',
194
+ }),
195
+ },
196
+
197
+ watch: {
198
+ myCompany(company) {
199
+ if (company !== null) {
200
+ this.filters.company = company;
201
+ this.onRequest({
202
+ pagination: this.pagination,
203
+ filter: this.filters,
204
+ });
205
+ }
206
+ },
207
+
208
+ totalItems(val) {
209
+ this.pagination.rowsNumber = val;
210
+ },
211
+
212
+ items(items) {
213
+ if (!items)
214
+ return;
215
+
216
+ let data = [];
217
+
218
+ for (let index in items) {
219
+ let item = items[index];
220
+
221
+ data.push({
222
+ '@id': item['@id'],
223
+ 'id': item['@id'].match(/^\/purchasing\/orders\/([a-z0-9-]*)$/)[1],
224
+ 'notaFiscal': item.invoiceTax.length > 0 ? '#' + item.invoiceTax[0].invoiceTax.invoiceNumber : '',
225
+ 'dataPedido': item.orderDate,
226
+ 'ultimaModificacao': item.alterDate,
227
+ 'status': item.status.status,
228
+ 'color_status': item.status.color,
229
+ 'fornecedor': item.client.alias,
230
+ 'coleta': item.retrievePeople !== null ? item.retrievePeople.name : '',
231
+ 'localColeta': item.quote !== null ? `${item.quote.cityOrigin.city} / ${item.quote.cityOrigin.state.uf}` : '',
232
+ 'entrega': item.deliveryPeople !== null ? item.deliveryPeople.name : '',
233
+ 'localEntrega': item.quote !== null ? `${item.quote.cityDestination.city} / ${item.quote.cityDestination.state.uf}` : '',
234
+ 'transportadora': item.quote !== null ? item.quote.carrier.name : '',
235
+ 'preco': item.price,
236
+ });
237
+ }
238
+
239
+ this.data = data;
240
+ },
241
+
242
+ 'filters.text'() {
243
+ this.onRequest({
244
+ pagination: this.pagination,
245
+ filter: this.filters,
246
+ });
247
+ },
248
+
249
+ 'filters.status'() {
250
+ this.onRequest({
251
+ pagination: this.pagination,
252
+ filter: this.filters,
253
+ });
254
+ },
255
+ },
256
+
257
+ methods: {
258
+ ...mapActions({
259
+ getItems: 'purchasingOrder/getItems',
260
+ reset: 'purchasingOrder/reset',
261
+ getStatuses: 'purchasingOrder/getStatuses',
262
+ }),
263
+
264
+ requestStatuses() {
265
+ this.loadingStatuses = true;
266
+ this.getStatuses({
267
+ visibility: 'public',
268
+ realStatus: ['open', 'pending', 'closed'],
269
+ context: order
270
+ })
271
+ .then(statuses => {
272
+ if (statuses.length) {
273
+ let data = [];
274
+ for (let index in statuses) {
275
+ let item = statuses[index];
276
+ this.statuses.push({
277
+ 'label': this.$t(`order.statuses.${item.status}`),
278
+ 'value': item['@id'].match(/^\/statuses\/([a-z0-9-]*)$/)[1],
279
+ });
280
+ }
281
+ }
282
+ this.loadingStatuses = false;
283
+ });
284
+ },
285
+
286
+ onRequest(props) {
287
+ let {
288
+ page,
289
+ rowsPerPage,
290
+ rowsNumber,
291
+ sortBy,
292
+ descending
293
+ } = props.pagination;
294
+ let filter = props.filter;
295
+ let params = { itemsPerPage: rowsPerPage, page };
296
+
297
+ if (this.filters.text != null && this.filters.text.length > 0) {
298
+ if (this.filters.text.length < 2)
299
+ return;
300
+
301
+ params['searchBy'] = this.filters.text;
302
+ }
303
+
304
+ if (this.filters.status != null && this.filters.status.value != -1) {
305
+ params['status'] = this.filters.status.value;
306
+ }
307
+
308
+ if (this.filters.company != null) {
309
+ params['myCompany'] = this.filters.company.id;
310
+ }
311
+
312
+ if (this.invoiceId !== null) {
313
+ params['invoice.invoice'] = this.invoiceId;
314
+ }
315
+
316
+ params['order[alterDate]'] = 'desc';
317
+
318
+ this.getItems(params)
319
+ .then(() => {
320
+ this.pagination.page = page;
321
+ this.pagination.rowsPerPage = rowsPerPage;
322
+ this.pagination.sortBy = sortBy;
323
+ this.pagination.descending = descending;
324
+ });
325
+ },
326
+ },
327
+ };
328
+ </script>