@freteclick/quasar-financial-ui 1.0.100 → 1.0.102
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/components/invoice/client/InvoiceSearching.vue +17 -7
- package/src/components/invoice/client/details/InvoiceOrders.vue +11 -1
- package/src/components/invoice/receive/InvoiceDetails.vue +18 -14
- package/src/components/invoice/receive/details/InvoiceInvoice.vue +106 -325
package/package.json
CHANGED
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
<q-btn outline dense
|
|
48
48
|
:to ="{ name: 'ClientInvoiceDetails', params: { id: props.row.id } }"
|
|
49
49
|
:label="props.cols[0].value"
|
|
50
|
-
:style="{color:props.row.color_status}"
|
|
50
|
+
:style="{color:props.row.color_status}"
|
|
51
51
|
class ="full-width"
|
|
52
52
|
/>
|
|
53
53
|
</q-td>
|
|
@@ -353,11 +353,21 @@ export default {
|
|
|
353
353
|
params['searchBy'] = this.filters.text;
|
|
354
354
|
}
|
|
355
355
|
|
|
356
|
-
if (this.filters.status != null && this.filters.status.value != -1) {
|
|
357
|
-
|
|
358
|
-
}
|
|
359
|
-
else {
|
|
360
|
-
|
|
356
|
+
// if (this.filters.status != null && this.filters.status.value != -1) {
|
|
357
|
+
// params['status'] = this.filters.status.value;
|
|
358
|
+
// }
|
|
359
|
+
// else {
|
|
360
|
+
// params['status.realStatus'] = ['open', 'pending'];
|
|
361
|
+
// }
|
|
362
|
+
|
|
363
|
+
if (this.filters.status != null) {
|
|
364
|
+
if (this.filters.status.value > 0) {
|
|
365
|
+
params["status"] = this.filters.status.value;
|
|
366
|
+
} else {
|
|
367
|
+
if (this.filters.status.value == -1) {
|
|
368
|
+
params["status.realStatus"] = ["open", "pending", "pay"];
|
|
369
|
+
}
|
|
370
|
+
}
|
|
361
371
|
}
|
|
362
372
|
|
|
363
373
|
if (this.filters.company != null) {
|
|
@@ -380,4 +390,4 @@ export default {
|
|
|
380
390
|
},
|
|
381
391
|
},
|
|
382
392
|
};
|
|
383
|
-
</script>
|
|
393
|
+
</script>
|
|
@@ -248,7 +248,7 @@ export default {
|
|
|
248
248
|
'localEntrega': item.quote !== null ? `${item.quote.cityDestination.city} / ${item.quote.cityDestination.state.uf}` : '',
|
|
249
249
|
'transportadora': item.quote !== null ? item.quote.carrier.name : '',
|
|
250
250
|
'preco': item.price,
|
|
251
|
-
'precoReal': item.realPrice == null || item.realPrice == 0 ? "-----" :
|
|
251
|
+
'precoReal': this.getRealPrice(item), //item.realPrice == null || item.realPrice == 0 ? "-----" :
|
|
252
252
|
});
|
|
253
253
|
}
|
|
254
254
|
|
|
@@ -277,6 +277,16 @@ export default {
|
|
|
277
277
|
getStatuses: 'purchasingOrder/getStatuses',
|
|
278
278
|
}),
|
|
279
279
|
|
|
280
|
+
getRealPrice(invoice) {
|
|
281
|
+
let price = 0;
|
|
282
|
+
invoice.invoice.forEach((element) => {
|
|
283
|
+
if (element.invoice.id == this.invoiceId) {
|
|
284
|
+
price = element.realPrice;
|
|
285
|
+
}
|
|
286
|
+
});
|
|
287
|
+
return price == invoice.price || price == 0 ? "-----" : price;
|
|
288
|
+
},
|
|
289
|
+
|
|
280
290
|
requestStatuses() {
|
|
281
291
|
this.loadingStatuses = true;
|
|
282
292
|
this.getStatuses({
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<span class="q-ml-sm">Deseja gerar um novo número de fatura?</span>
|
|
8
8
|
</q-card-section>
|
|
9
9
|
|
|
10
|
-
<q-card-actions align="right">
|
|
10
|
+
<q-card-actions :align="'right'">
|
|
11
11
|
<q-btn flat label="Cancelar" color="primary" v-close-popup />
|
|
12
12
|
<q-btn flat label="Alterar" color="primary" @click="renew(invoice)" v-close-popup />
|
|
13
13
|
</q-card-actions>
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
|
|
72
72
|
<div v-else>
|
|
73
73
|
<EditInvoiceDiscount :discount="discount" :invoiceId="invoice['@id'] || ''"
|
|
74
|
-
|
|
74
|
+
@saved="requestInvoice(invoiceId)" />
|
|
75
75
|
</div>
|
|
76
76
|
|
|
77
77
|
</td>
|
|
@@ -87,6 +87,15 @@
|
|
|
87
87
|
</td>
|
|
88
88
|
</tr>
|
|
89
89
|
|
|
90
|
+
<tr>
|
|
91
|
+
<td class="text-left text-bold">Forma de Pagamento</td>
|
|
92
|
+
<td class="text-left">
|
|
93
|
+
<q-badge color="green" class="q-py-xs q-px-md uppercase">
|
|
94
|
+
{{ this.invoice.paymentType ? this.invoice.paymentType : 'Não informado' }}
|
|
95
|
+
</q-badge>
|
|
96
|
+
</td>
|
|
97
|
+
</tr>
|
|
98
|
+
|
|
90
99
|
</tbody>
|
|
91
100
|
</q-markup-table>
|
|
92
101
|
</div>
|
|
@@ -106,14 +115,14 @@
|
|
|
106
115
|
this.invoice = newInvoice;
|
|
107
116
|
this.$refs.invoiceBillet.refresh();
|
|
108
117
|
}
|
|
109
|
-
|
|
118
|
+
" />
|
|
110
119
|
</div>
|
|
111
120
|
</div>
|
|
112
121
|
</div>
|
|
113
122
|
|
|
114
123
|
<div v-if="invoice !== null" class="row" key="order_tabs">
|
|
115
124
|
<div class="col-12">
|
|
116
|
-
<q-tabs :horizontal="$q.screen.gt.xs" align="justify" v-model="currentTab" class="bg-white text-primary">
|
|
125
|
+
<q-tabs :horizontal="$q.screen.gt.xs" :align="'justify'" v-model="currentTab" class="bg-white text-primary">
|
|
117
126
|
<q-tab name="invoice" label="Boleto" />
|
|
118
127
|
<q-tab name="orders" label="Pedidos" />
|
|
119
128
|
</q-tabs>
|
|
@@ -122,10 +131,7 @@
|
|
|
122
131
|
|
|
123
132
|
<q-tab-panels v-model="currentTab">
|
|
124
133
|
<q-tab-panel name="invoice" class="q-pa-none">
|
|
125
|
-
<InvoiceInvoice ref="invoiceBillet" :invoiceId="invoiceId" :orderId="orderId"
|
|
126
|
-
this.editDueDate = status.hasBillet === false;
|
|
127
|
-
}
|
|
128
|
-
" />
|
|
134
|
+
<InvoiceInvoice ref="invoiceBillet" :invoiceId="invoiceId" :orderId="orderId" :invoice="invoice" />
|
|
129
135
|
</q-tab-panel>
|
|
130
136
|
|
|
131
137
|
<q-tab-panel name="orders" class="q-pa-none">
|
|
@@ -315,11 +321,9 @@ export default {
|
|
|
315
321
|
|
|
316
322
|
// consulta descontos para esta fatura
|
|
317
323
|
requestInvoiceDiscount(invoiceId) {
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
this.isLoading = true;
|
|
324
|
+
this.isLoading = true;
|
|
321
325
|
|
|
322
|
-
|
|
326
|
+
this.getInvoiceDiscount({ invoiceId })
|
|
323
327
|
.then((data) => {
|
|
324
328
|
|
|
325
329
|
this.isLoading = false;
|
|
@@ -330,8 +334,8 @@ export default {
|
|
|
330
334
|
|
|
331
335
|
})
|
|
332
336
|
.catch((error) => {
|
|
333
|
-
|
|
334
|
-
|
|
337
|
+
this.isLoading = false;
|
|
338
|
+
this.discount = null;
|
|
335
339
|
})
|
|
336
340
|
},
|
|
337
341
|
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="row items-center justify-center">
|
|
3
3
|
<div class="flex flex-center" v-if="isLoading">
|
|
4
|
-
<q-circular-progress
|
|
5
|
-
:indeterminate="isLoading"
|
|
6
|
-
size="sm"
|
|
7
|
-
color="primary"
|
|
8
|
-
class="q-ma-md"
|
|
9
|
-
/>
|
|
4
|
+
<q-circular-progress :indeterminate="isLoading" size="sm" color="primary" class="q-ma-md" />
|
|
10
5
|
Carregando...
|
|
11
6
|
</div>
|
|
12
7
|
|
|
@@ -18,99 +13,38 @@
|
|
|
18
13
|
</div>
|
|
19
14
|
</div>
|
|
20
15
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
/>
|
|
34
|
-
</div> -->
|
|
35
|
-
|
|
36
|
-
<div style="height: 1200px">
|
|
37
|
-
<iframe
|
|
38
|
-
:src="invoiceUrlSicred"
|
|
39
|
-
name="BILLETINTER" id="billet_sicred" width="100%" height="100%" frameBorder="0">
|
|
40
|
-
<p>This browser does not support IFrame.</p>
|
|
41
|
-
</iframe>
|
|
42
|
-
</div>
|
|
43
|
-
</div>
|
|
44
|
-
</div>
|
|
16
|
+
<div class="col-12 q-pt-lg">
|
|
17
|
+
<div class="row justify-center items-center gutter-2">
|
|
18
|
+
<div class="q-pa-sm">
|
|
19
|
+
<q-btn icon="money" size="lg" color="primary"
|
|
20
|
+
:label="invoiceBankId === null ? 'Gerar Boleto' : 'Boleto gerado'" :loading="isLoading"
|
|
21
|
+
@click="generateSicredBillet()" :disable="isPaid || invoiceBankId !== null" />
|
|
22
|
+
</div>
|
|
23
|
+
<div class="q-pa-sm">
|
|
24
|
+
<q-btn icon="visibility" size="lg" color="primary" label="Ver Boleto" :loading="isLoadingDownload"
|
|
25
|
+
@click="clickDownloadBilletSicred()" :disable="paymentType === null" />
|
|
26
|
+
</div>
|
|
27
|
+
|
|
45
28
|
|
|
46
|
-
<!-- BILLET VIEWER INTER -->
|
|
47
|
-
<div :class="showBilletInter ? 'full-width q-pa-lg' : 'hidden'">
|
|
48
|
-
<div style="height: 1200px">
|
|
49
|
-
<iframe
|
|
50
|
-
:src="invoiceUrlInter"
|
|
51
|
-
name="BILLETINTER" id="billet_inter" width="100%" height="100%" frameBorder="0">
|
|
52
|
-
<p>This browser does not support IFrame.</p>
|
|
53
|
-
</iframe>
|
|
54
29
|
</div>
|
|
55
30
|
</div>
|
|
56
31
|
|
|
57
|
-
<!-- BILLET VIEWER
|
|
58
|
-
<div :class="
|
|
59
|
-
<q-form
|
|
60
|
-
ref="myForm"
|
|
61
|
-
:action="payment !== null ? payment.invoiceUrl : ''"
|
|
62
|
-
method="post"
|
|
63
|
-
class="q-mt-sm row justify-center items-center"
|
|
64
|
-
target="BILLET"
|
|
65
|
-
>
|
|
66
|
-
<input type="hidden" name="DC" :value="itauHash"/>
|
|
67
|
-
</q-form>
|
|
32
|
+
<!-- BILLET VIEWER SICRED -->
|
|
33
|
+
<div :class="showBilletSicred ? 'full-width q-pa-lg' : 'hidden'">
|
|
68
34
|
<div style="height: 1200px">
|
|
69
|
-
<iframe name="
|
|
35
|
+
<iframe :src="invoiceUrlSicred" name="BILLETINTER" id="billet_sicred" width="100%" height="100%"
|
|
36
|
+
frameBorder="0">
|
|
70
37
|
<p>This browser does not support IFrame.</p>
|
|
71
38
|
</iframe>
|
|
72
39
|
</div>
|
|
73
40
|
</div>
|
|
74
41
|
|
|
75
|
-
<!-- BILLET GENERATOR TRIGGER -->
|
|
76
|
-
<div class="col-12 q-pt-lg" v-if="paymentIsPending && billetMustBeCreated && paymentInstitution === 'itau'">
|
|
77
|
-
<div style="min-height: 80vh;" class="row justify-center items-center">
|
|
78
|
-
<q-btn
|
|
79
|
-
icon="money"
|
|
80
|
-
size="lg"
|
|
81
|
-
color="primary"
|
|
82
|
-
label="Gerar boleto"
|
|
83
|
-
:loading="retrievingHash"
|
|
84
|
-
@click="() => {
|
|
85
|
-
this.retrievingHash = true;
|
|
86
|
-
this.getItauHash().then(hash => {
|
|
87
|
-
if (hash !== null) {
|
|
88
|
-
this.loadOnFocus = true;
|
|
89
|
-
this.$refs.billetForm.$el.submit();
|
|
90
|
-
}
|
|
91
|
-
}).finally(() => {
|
|
92
|
-
this.retrievingHash = false;
|
|
93
|
-
});
|
|
94
|
-
}"
|
|
95
|
-
:disable="isPaid"
|
|
96
|
-
/>
|
|
97
|
-
<q-form
|
|
98
|
-
ref="billetForm"
|
|
99
|
-
:action="payment ? payment.invoiceUrl : ''"
|
|
100
|
-
method="post"
|
|
101
|
-
target="_blank"
|
|
102
|
-
>
|
|
103
|
-
<input type="hidden" name="DC" :value="itauHash"/>
|
|
104
|
-
</q-form>
|
|
105
|
-
</div>
|
|
106
|
-
</div>
|
|
107
|
-
|
|
108
42
|
<!-- PAID MESSAGE -->
|
|
109
|
-
<div class="col-12" v-if="
|
|
110
|
-
<div class="row items-center justify-center
|
|
43
|
+
<div class="col-12" v-if="isPaid">
|
|
44
|
+
<div class="row items-center justify-center q-pt-lg">
|
|
111
45
|
<q-banner class="text-white bg-positive text-center text-h3" rounded>
|
|
112
46
|
<template v-slot:avatar>
|
|
113
|
-
<q-icon name="thumb_up" color="white"/>
|
|
47
|
+
<q-icon name="thumb_up" color="white" />
|
|
114
48
|
</template>
|
|
115
49
|
O boleto foi pago
|
|
116
50
|
</q-banner>
|
|
@@ -120,9 +54,9 @@
|
|
|
120
54
|
</template>
|
|
121
55
|
|
|
122
56
|
<script>
|
|
123
|
-
import {mapActions, mapGetters} from 'vuex';
|
|
57
|
+
import { mapActions, mapGetters } from 'vuex';
|
|
124
58
|
import axios from 'axios';
|
|
125
|
-
import {ENTRYPOINT} from '@freteclick/../../src/config/entrypoint';
|
|
59
|
+
import { ENTRYPOINT } from '@freteclick/../../src/config/entrypoint';
|
|
126
60
|
|
|
127
61
|
export default {
|
|
128
62
|
props: {
|
|
@@ -134,38 +68,58 @@ export default {
|
|
|
134
68
|
type: String,
|
|
135
69
|
required: true,
|
|
136
70
|
},
|
|
71
|
+
invoice: {
|
|
72
|
+
type: Object,
|
|
73
|
+
required: true,
|
|
74
|
+
},
|
|
137
75
|
},
|
|
138
76
|
|
|
139
77
|
components: {},
|
|
140
78
|
|
|
141
79
|
mounted() {
|
|
142
|
-
window.addEventListener('focus', this.loadItauDataOnFocus);
|
|
143
|
-
},
|
|
144
|
-
|
|
145
|
-
beforeDestroy() {
|
|
146
|
-
window.removeEventListener('focus', this.loadItauDataOnFocus);
|
|
147
80
|
},
|
|
148
81
|
|
|
149
82
|
created() {
|
|
150
|
-
this.
|
|
83
|
+
this.getBank();
|
|
84
|
+
|
|
85
|
+
if (this.invoice.status.status === 'paid') {
|
|
86
|
+
this.isPaid = true;
|
|
87
|
+
this.showBilletSicred = true;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if (this.invoice.paymentType === 'boleto' || this.invoice.invoiceBankId !== null) {
|
|
91
|
+
this.paymentType = 'boleto';
|
|
92
|
+
this.showBilletSicred = true;
|
|
93
|
+
this.invoiceBankId = this.invoice.invoiceBankId;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if (this.invoice.paymentType === null) {
|
|
97
|
+
this.paymentType = null;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
console.log(this.invoice);
|
|
101
|
+
console.log(this.invoice.invoiceBankId);
|
|
102
|
+
|
|
103
|
+
console.log('Dados de pagamento: ', this.payment);
|
|
104
|
+
|
|
151
105
|
},
|
|
152
106
|
|
|
153
107
|
data() {
|
|
154
108
|
return {
|
|
155
|
-
invoiceUrlInter: null,
|
|
156
109
|
invoiceUrlSicred: null,
|
|
157
|
-
|
|
158
|
-
showBilletSicred: null,
|
|
110
|
+
showBilletSicred: false,
|
|
159
111
|
showInfoBox: null,
|
|
160
112
|
isLoadingDownload: false,
|
|
161
113
|
isLoading: false,
|
|
162
|
-
payment: null,
|
|
163
|
-
isPaid: false,
|
|
164
|
-
itauHash: null,
|
|
114
|
+
payment: null, // Recebe dados de pagamento
|
|
115
|
+
isPaid: false, // Indica se a fatura foi paga
|
|
165
116
|
showBillet: false,
|
|
166
117
|
loadOnFocus: false,
|
|
167
118
|
retrievingHash: false,
|
|
168
|
-
paymentInstitution: null
|
|
119
|
+
paymentInstitution: null,
|
|
120
|
+
paymentStatus: null,
|
|
121
|
+
paymentType: null,
|
|
122
|
+
invoiceBankId: null
|
|
169
123
|
};
|
|
170
124
|
},
|
|
171
125
|
|
|
@@ -179,11 +133,12 @@ export default {
|
|
|
179
133
|
|
|
180
134
|
return this.payment.invoiceRealStatus === 'pending';
|
|
181
135
|
},
|
|
136
|
+
// O Boleto deve ser Criado
|
|
182
137
|
billetMustBeCreated() {
|
|
183
138
|
if (this.payment === null)
|
|
184
139
|
return false;
|
|
185
140
|
|
|
186
|
-
return this.payment.paymentType === '
|
|
141
|
+
return this.payment.paymentType === 'boleto' || this.payment.paymentStatus !== 'paid';
|
|
187
142
|
},
|
|
188
143
|
},
|
|
189
144
|
|
|
@@ -194,162 +149,46 @@ export default {
|
|
|
194
149
|
}
|
|
195
150
|
},
|
|
196
151
|
|
|
197
|
-
payment(data) {
|
|
198
|
-
if (!data)
|
|
199
|
-
return;
|
|
200
|
-
|
|
201
|
-
this.isPaid = data.paymentStatus === 'paid';
|
|
202
|
-
|
|
203
|
-
if(this.payment.paymentStatus === 'open')
|
|
204
|
-
{
|
|
205
|
-
this.showInfoBox = true;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
if (data.paymentType == 'billet') {
|
|
209
|
-
|
|
210
|
-
if (data.paymentStatus !== 'open') {
|
|
211
|
-
|
|
212
|
-
this.showInfoBox = false;
|
|
213
|
-
|
|
214
|
-
if (this.paymentInstitution === 'itau') {
|
|
215
|
-
this.getItauHash().then(hash => {
|
|
216
|
-
if (hash !== null) {
|
|
217
|
-
this.showBillet = true;
|
|
218
|
-
}
|
|
219
|
-
});
|
|
220
|
-
|
|
221
|
-
} else if(this.paymentInstitution === 'inter') {
|
|
222
|
-
|
|
223
|
-
this.showBillet = false;
|
|
224
|
-
let urlTmp = ENTRYPOINT + `/vendor/pdf.js/web/viewer.html?file=/finance/${this.invoiceId}/download?timestamp${new Date().getTime()}`;
|
|
225
|
-
this.invoiceUrlInter = urlTmp;
|
|
226
|
-
this.isLoading = false;
|
|
227
|
-
this.showBilletInter = true;
|
|
228
|
-
|
|
229
|
-
}
|
|
230
|
-
else {
|
|
231
|
-
|
|
232
|
-
this.showBillet = false;
|
|
233
|
-
let urlTmp = ENTRYPOINT + `/vendor/pdf.js/web/viewer.html?file=/finance/${this.invoiceId}/bank/sicred/download?timestamp${new Date().getTime()}`;
|
|
234
|
-
// let urlTmp = ENTRYPOINT + `/download?invoiceUrl=${this.payment.invoiceUrl}`;
|
|
235
|
-
this.invoiceUrlSicred = urlTmp;
|
|
236
|
-
this.isLoading = false;
|
|
237
|
-
this.showBilletSicred = true;
|
|
238
|
-
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
this.$emit(
|
|
245
|
-
'billetStatus',
|
|
246
|
-
{
|
|
247
|
-
hasBillet: data.paymentType === 'billet' && data.paymentStatus === 'created',
|
|
248
|
-
isPaid: data.paymentStatus === 'paid'
|
|
249
|
-
}
|
|
250
|
-
);
|
|
251
|
-
|
|
252
|
-
},
|
|
253
|
-
|
|
254
|
-
showBillet(show) {
|
|
255
|
-
if (show == true) {
|
|
256
|
-
this.$refs.myForm.$el.submit();
|
|
257
|
-
}
|
|
258
|
-
},
|
|
259
152
|
},
|
|
260
153
|
|
|
261
154
|
methods: {
|
|
262
155
|
...mapActions({
|
|
263
|
-
getItauData: 'receiveInvoice/bankItau',
|
|
264
|
-
getInterData: 'receiveInvoice/bankInter',
|
|
265
156
|
getSicredData: 'receiveInvoice/bankSicred',
|
|
157
|
+
getInvoice: 'receiveInvoice/getInvoice',
|
|
266
158
|
getBankPerInvoiceId: 'receiveInvoice/getBankPerInvoiceId',
|
|
267
159
|
}),
|
|
268
160
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
responseType: 'blob'
|
|
275
|
-
}).then((response) => {
|
|
276
|
-
let blob = new Blob([response.data], {type: 'application/pdf'}), url = window.URL.createObjectURL(blob);
|
|
277
|
-
return url;
|
|
278
|
-
});
|
|
279
|
-
},
|
|
280
|
-
|
|
281
|
-
clickDownloadBilletInter() {
|
|
282
|
-
let urlTmp = ENTRYPOINT + `/vendor/pdf.js/web/viewer.html?file=/finance/${this.invoiceId}/download?timestamp${new Date().getTime()}`;
|
|
283
|
-
window.open(urlTmp);
|
|
284
|
-
},
|
|
285
|
-
|
|
286
|
-
mountInvoiceUrlSicred() {
|
|
287
|
-
let invoiceUrl = encodeURIComponent(this.payment.invoiceUrl);
|
|
288
|
-
return axios({
|
|
289
|
-
url: ENTRYPOINT + `/download?invoiceUrl=${invoiceUrl}×tamp=${new Date().getTime()}`,
|
|
290
|
-
method: 'get',
|
|
291
|
-
responseType: 'blob'
|
|
292
|
-
}).then((response) => {
|
|
293
|
-
let blob = new Blob([response.data], {type: 'application/pdf'}), url = window.URL.createObjectURL(blob);
|
|
161
|
+
// Ver boleto ou baixar
|
|
162
|
+
clickDownloadBilletSicred() {
|
|
163
|
+
if (this.isLoadingDownload) {
|
|
164
|
+
return null;
|
|
165
|
+
}
|
|
294
166
|
|
|
295
|
-
|
|
167
|
+
this.isLoadingDownload = true;
|
|
296
168
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
169
|
+
const viewerUrl = ENTRYPOINT + `/vendor/pdf.js/web/viewer.html?file=/finance/${this.invoiceId}/bank/sicred/download?timestamp=${new Date().getTime()}`;
|
|
170
|
+
this.invoiceUrlSicred = viewerUrl;
|
|
171
|
+
this.showBilletSicred = true;
|
|
300
172
|
|
|
301
|
-
|
|
302
|
-
let urlTmp = ENTRYPOINT + `/download?invoiceUrl=${this.payment.invoiceUrl}`;
|
|
303
|
-
window.open(urlTmp);
|
|
173
|
+
this.isLoadingDownload = false;
|
|
304
174
|
},
|
|
305
175
|
|
|
176
|
+
// Consulta informações do banco
|
|
306
177
|
getBank() {
|
|
307
|
-
return this.getBankPerInvoiceId({
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
return
|
|
314
|
-
}
|
|
315
|
-
return null;
|
|
316
|
-
}).catch(error => {
|
|
317
|
-
});
|
|
318
|
-
},
|
|
319
|
-
|
|
320
|
-
refresh() {
|
|
321
|
-
this.getPaymentStatus();
|
|
322
|
-
},
|
|
178
|
+
return this.getBankPerInvoiceId({ invoiceId: this.invoiceId })
|
|
179
|
+
.then(data => {
|
|
180
|
+
if (data !== null) {
|
|
181
|
+
this.paymentInstitution = data.config_value;
|
|
182
|
+
return data;
|
|
183
|
+
}
|
|
184
|
+
return null;
|
|
323
185
|
|
|
324
|
-
|
|
325
|
-
if (this.loadOnFocus) {
|
|
326
|
-
this.getPaymentStatus().then(data => {
|
|
327
|
-
this.loadOnFocus = false;
|
|
186
|
+
}).catch(error => {
|
|
328
187
|
});
|
|
329
|
-
}
|
|
330
188
|
},
|
|
331
189
|
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
if (this.myCompany !== null)
|
|
336
|
-
params['myCompany'] = this.myCompany.id;
|
|
337
|
-
|
|
338
|
-
return this.getItauData({
|
|
339
|
-
invoiceId: this.invoiceId,
|
|
340
|
-
operation: 'itauhash',
|
|
341
|
-
params: params
|
|
342
|
-
}).then(data => {
|
|
343
|
-
if (data !== null) {
|
|
344
|
-
return this.itauHash = data;
|
|
345
|
-
}
|
|
346
|
-
return null;
|
|
347
|
-
}).catch(error => {
|
|
348
|
-
|
|
349
|
-
});
|
|
350
|
-
},
|
|
351
|
-
|
|
352
|
-
getPaymentStatus() {
|
|
190
|
+
// Gera o boleto
|
|
191
|
+
generateSicredBillet() {
|
|
353
192
|
|
|
354
193
|
if (this.isLoading) {
|
|
355
194
|
return null;
|
|
@@ -363,94 +202,36 @@ export default {
|
|
|
363
202
|
params['myCompany'] = this.myCompany.id;
|
|
364
203
|
}
|
|
365
204
|
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
this.
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
} else
|
|
387
|
-
|
|
388
|
-
this.getInterData({
|
|
389
|
-
invoiceId: this.invoiceId,
|
|
390
|
-
operation: 'payment',
|
|
391
|
-
params: params
|
|
392
|
-
}).then(data => {
|
|
393
|
-
if (data !== null) {
|
|
394
|
-
if (!data.response.success) {
|
|
395
|
-
let msgErro = data.response.error;
|
|
396
|
-
this.$q.notify({
|
|
397
|
-
message: msgErro,
|
|
398
|
-
html: true,
|
|
399
|
-
group: false,
|
|
400
|
-
multiLine: true,
|
|
401
|
-
position: 'bottom',
|
|
402
|
-
type: 'negative',
|
|
403
|
-
});
|
|
404
|
-
return this.payment = null;
|
|
405
|
-
} else {
|
|
406
|
-
return this.payment = data.response.data;
|
|
407
|
-
}
|
|
408
|
-
} else {
|
|
409
|
-
return this.payment = null;
|
|
410
|
-
}
|
|
411
|
-
return null;
|
|
412
|
-
}).catch(error => {
|
|
413
|
-
console.table(error);
|
|
414
|
-
}).finally(() => {
|
|
415
|
-
this.isLoading = false;
|
|
416
|
-
});
|
|
417
|
-
|
|
418
|
-
}
|
|
419
|
-
else {
|
|
420
|
-
|
|
421
|
-
this.getSicredData({
|
|
422
|
-
invoiceId: this.invoiceId,
|
|
423
|
-
operation: 'payment',
|
|
424
|
-
params: params
|
|
425
|
-
}).then(data => {
|
|
426
|
-
if (data !== null) {
|
|
427
|
-
if (!data.response.success) {
|
|
428
|
-
let msgErro = data.response.error;
|
|
429
|
-
this.$q.notify({
|
|
430
|
-
message: msgErro,
|
|
431
|
-
html: true,
|
|
432
|
-
group: false,
|
|
433
|
-
multiLine: true,
|
|
434
|
-
position: 'bottom',
|
|
435
|
-
type: 'negative',
|
|
436
|
-
});
|
|
437
|
-
return this.payment = null;
|
|
438
|
-
} else {
|
|
439
|
-
return this.payment = data.response.data;
|
|
440
|
-
}
|
|
441
|
-
} else {
|
|
442
|
-
return this.payment = null;
|
|
443
|
-
}
|
|
444
|
-
return null;
|
|
445
|
-
}).catch(error => {
|
|
446
|
-
console.table(error);
|
|
447
|
-
}).finally(() => {
|
|
448
|
-
this.isLoading = false;
|
|
449
|
-
});
|
|
450
|
-
|
|
205
|
+
this.getSicredData({
|
|
206
|
+
invoiceId: this.invoiceId,
|
|
207
|
+
operation: 'payment',
|
|
208
|
+
params: params
|
|
209
|
+
}).then(data => {
|
|
210
|
+
if (data !== null) {
|
|
211
|
+
if (!data.response.success) {
|
|
212
|
+
let msgErro = data.response.error;
|
|
213
|
+
this.$q.notify({
|
|
214
|
+
message: msgErro,
|
|
215
|
+
html: true,
|
|
216
|
+
group: false,
|
|
217
|
+
multiLine: true,
|
|
218
|
+
position: 'bottom',
|
|
219
|
+
type: 'negative',
|
|
220
|
+
});
|
|
221
|
+
return this.payment = null;
|
|
222
|
+
} else {
|
|
223
|
+
return this.payment = data.response.data;
|
|
224
|
+
}
|
|
225
|
+
} else {
|
|
226
|
+
return this.payment = null;
|
|
451
227
|
}
|
|
452
228
|
|
|
229
|
+
}).catch(error => {
|
|
230
|
+
console.table(error);
|
|
231
|
+
}).finally(() => {
|
|
232
|
+
this.isLoading = false;
|
|
453
233
|
});
|
|
234
|
+
|
|
454
235
|
},
|
|
455
236
|
},
|
|
456
237
|
};
|