@freteclick/quasar-financial-ui 1.0.90 → 1.0.91

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@freteclick/quasar-financial-ui",
3
- "version": "1.0.90",
3
+ "version": "1.0.91",
4
4
  "author": "FreteClick",
5
5
  "description": "FreteClick financial Quasar UI Component",
6
6
  "license": "MIT",
@@ -1,39 +1,41 @@
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 :indeterminate="isLoading"
5
- size="sm"
6
- color="primary"
7
- class="q-ma-md"
4
+ <q-circular-progress
5
+ :indeterminate="isLoading"
6
+ size="sm"
7
+ color="primary"
8
+ class="q-ma-md"
8
9
  />
9
10
  Carregando...
10
11
  </div>
11
12
 
12
- <!-- BILLET VIEWER SICRED -->
13
+ <div :class="showInfoBox ? 'full-width q-pa-lg' : 'hidden'">
14
+ <div class="q-pa-md q-gutter-sm">
15
+ <q-banner inline-actions rounded class="bg-primary text-white text-center">
16
+ <h6>Este boleto não pode ser gerado agora, pois a fatura está em aberto.</h6>
17
+ </q-banner>
18
+ </div>
19
+ </div>
13
20
 
21
+ <!-- BILLET VIEWER SICRED -->
14
22
  <div :class="showBilletSicred ? 'full-width q-pa-lg' : 'hidden'">
15
-
16
23
  <div class="col-12 q-pt-lg" v-if=" paymentInstitution === 'sicred'">
17
- <div class="row justify-center items-center">
18
- <q-btn
19
- icon="money"
20
- size="lg"
21
- color="primary"
22
- label="Abrir Boleto Pix"
23
- :loading="isLoadingDownload"
24
- @click="clickDownloadBilletSicred()"
25
- :disable="isPaid"
26
- />
27
-
28
-
29
-
24
+ <div class="row justify-center items-center">
25
+ <q-btn
26
+ icon="money"
27
+ size="lg"
28
+ color="primary"
29
+ label="Abrir Boleto Pix"
30
+ :loading="isLoadingDownload"
31
+ @click="clickDownloadBilletSicred()"
32
+ :disable="isPaid"
33
+ />
34
+ </div>
30
35
  </div>
31
36
  </div>
32
37
 
33
- </div>
34
-
35
38
  <!-- BILLET VIEWER INTER -->
36
-
37
39
  <div :class="showBilletInter ? 'full-width q-pa-lg' : 'hidden'">
38
40
  <div style="height: 1200px">
39
41
  <iframe
@@ -45,7 +47,6 @@
45
47
  </div>
46
48
 
47
49
  <!-- BILLET VIEWER ITAU -->
48
-
49
50
  <div :class="showBillet ? 'full-width q-pa-lg' : 'hidden'">
50
51
  <q-form
51
52
  ref="myForm"
@@ -56,7 +57,6 @@
56
57
  >
57
58
  <input type="hidden" name="DC" :value="itauHash"/>
58
59
  </q-form>
59
-
60
60
  <div style="height: 1200px">
61
61
  <iframe name="BILLET" width="100%" height="100%" frameBorder="0">
62
62
  <p>This browser does not support IFrame.</p>
@@ -65,7 +65,6 @@
65
65
  </div>
66
66
 
67
67
  <!-- BILLET GENERATOR TRIGGER -->
68
-
69
68
  <div class="col-12 q-pt-lg" v-if="paymentIsPending && billetMustBeCreated && paymentInstitution === 'itau'">
70
69
  <div style="min-height: 80vh;" class="row justify-center items-center">
71
70
  <q-btn
@@ -99,7 +98,6 @@
99
98
  </div>
100
99
 
101
100
  <!-- PAID MESSAGE -->
102
-
103
101
  <div class="col-12" v-if="payment !== null && isPaid">
104
102
  <div class="row items-center justify-center" style="min-height: 90vh;">
105
103
  <q-banner class="text-white bg-positive text-center text-h3" rounded>
@@ -118,9 +116,6 @@ import {mapActions, mapGetters} from 'vuex';
118
116
  import axios from 'axios';
119
117
  import {ENTRYPOINT} from '../../../../../../../../src/config/entrypoint';
120
118
 
121
-
122
-
123
-
124
119
  export default {
125
120
  props: {
126
121
  invoiceId: {
@@ -133,9 +128,7 @@ export default {
133
128
  },
134
129
  },
135
130
 
136
- components: {
137
-
138
- },
131
+ components: {},
139
132
 
140
133
  mounted() {
141
134
  window.addEventListener('focus', this.loadItauDataOnFocus);
@@ -155,6 +148,7 @@ export default {
155
148
  invoiceUrlSicred: null,
156
149
  showBilletInter: null,
157
150
  showBilletSicred: null,
151
+ showInfoBox: null,
158
152
  isLoadingDownload: false,
159
153
  isLoading: false,
160
154
  payment: null,
@@ -163,7 +157,7 @@ export default {
163
157
  showBillet: false,
164
158
  loadOnFocus: false,
165
159
  retrievingHash: false,
166
- paymentInstitution: null // 'itau','inter'
160
+ paymentInstitution: null
167
161
  };
168
162
  },
169
163
 
@@ -198,9 +192,16 @@ export default {
198
192
 
199
193
  this.isPaid = data.paymentStatus === 'paid';
200
194
 
195
+ if(this.payment.paymentStatus === 'open')
196
+ {
197
+ this.showInfoBox = true;
198
+ }
199
+
201
200
  if (data.paymentType == 'billet') {
202
201
 
203
- // if (data.paymentStatus == 'created' && this.isPaid === false) {
202
+ if (data.paymentStatus !== 'open') {
203
+
204
+ this.showInfoBox = false;
204
205
 
205
206
  if (this.paymentInstitution === 'itau') {
206
207
  this.getItauHash().then(hash => {
@@ -227,12 +228,7 @@ export default {
227
228
  this.showBilletSicred = true;
228
229
 
229
230
  }
230
- // } else {
231
- // this.showBillet = false;
232
- // if (this.paymentInstitution === 'sicred') {
233
- // this.isPaid = data.status === 'paid';
234
- // }
235
- // }
231
+ }
236
232
 
237
233
  }
238
234
 
@@ -360,7 +356,7 @@ export default {
360
356
 
361
357
  return this.getBank().then(data2 => {
362
358
 
363
- if (this.paymentInstitution === 'itau') { // ------------------------------ Banco 'itau'
359
+ if (this.paymentInstitution === 'itau') {
364
360
 
365
361
  this.getItauData({
366
362
  invoiceId: this.invoiceId,
@@ -378,7 +374,7 @@ export default {
378
374
  // this.isLoading = false;
379
375
  });
380
376
 
381
- } else if(this.paymentInstitution === 'inter'){ // ------------------------------ Banco 'inter'
377
+ } else if(this.paymentInstitution === 'inter'){
382
378
 
383
379
  this.getInterData({
384
380
  invoiceId: this.invoiceId,
@@ -411,7 +407,7 @@ export default {
411
407
  });
412
408
 
413
409
  }
414
- else { // ------------------------------ Banco 'Sicred'
410
+ else {
415
411
 
416
412
  this.getSicredData({
417
413
  invoiceId: this.invoiceId,
@@ -1,39 +1,41 @@
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 :indeterminate="isLoading"
5
- size="sm"
6
- color="primary"
7
- class="q-ma-md"
4
+ <q-circular-progress
5
+ :indeterminate="isLoading"
6
+ size="sm"
7
+ color="primary"
8
+ class="q-ma-md"
8
9
  />
9
10
  Carregando...
10
11
  </div>
11
12
 
12
- <!-- BILLET VIEWER SICRED -->
13
+ <div :class="showInfoBox ? 'full-width q-pa-lg' : 'hidden'">
14
+ <div class="q-pa-md q-gutter-sm">
15
+ <q-banner inline-actions rounded class="bg-primary text-white text-center">
16
+ <h6>Este boleto não pode ser gerado agora, pois a fatura está em aberto.</h6>
17
+ </q-banner>
18
+ </div>
19
+ </div>
13
20
 
21
+ <!-- BILLET VIEWER SICRED -->
14
22
  <div :class="showBilletSicred ? 'full-width q-pa-lg' : 'hidden'">
15
-
16
23
  <div class="col-12 q-pt-lg" v-if=" paymentInstitution === 'sicred'">
17
- <div class="row justify-center items-center">
18
- <q-btn
19
- icon="money"
20
- size="lg"
21
- color="primary"
22
- label="Abrir Boleto Pix"
23
- :loading="isLoadingDownload"
24
- @click="clickDownloadBilletSicred()"
25
- :disable="isPaid"
26
- />
27
-
28
-
29
-
24
+ <div class="row justify-center items-center">
25
+ <q-btn
26
+ icon="money"
27
+ size="lg"
28
+ color="primary"
29
+ label="Abrir Boleto Pix"
30
+ :loading="isLoadingDownload"
31
+ @click="clickDownloadBilletSicred()"
32
+ :disable="isPaid"
33
+ />
34
+ </div>
30
35
  </div>
31
36
  </div>
32
37
 
33
- </div>
34
-
35
38
  <!-- BILLET VIEWER INTER -->
36
-
37
39
  <div :class="showBilletInter ? 'full-width q-pa-lg' : 'hidden'">
38
40
  <div style="height: 1200px">
39
41
  <iframe
@@ -45,7 +47,6 @@
45
47
  </div>
46
48
 
47
49
  <!-- BILLET VIEWER ITAU -->
48
-
49
50
  <div :class="showBillet ? 'full-width q-pa-lg' : 'hidden'">
50
51
  <q-form
51
52
  ref="myForm"
@@ -56,7 +57,6 @@
56
57
  >
57
58
  <input type="hidden" name="DC" :value="itauHash"/>
58
59
  </q-form>
59
-
60
60
  <div style="height: 1200px">
61
61
  <iframe name="BILLET" width="100%" height="100%" frameBorder="0">
62
62
  <p>This browser does not support IFrame.</p>
@@ -65,7 +65,6 @@
65
65
  </div>
66
66
 
67
67
  <!-- BILLET GENERATOR TRIGGER -->
68
-
69
68
  <div class="col-12 q-pt-lg" v-if="paymentIsPending && billetMustBeCreated && paymentInstitution === 'itau'">
70
69
  <div style="min-height: 80vh;" class="row justify-center items-center">
71
70
  <q-btn
@@ -99,7 +98,6 @@
99
98
  </div>
100
99
 
101
100
  <!-- PAID MESSAGE -->
102
-
103
101
  <div class="col-12" v-if="payment !== null && isPaid">
104
102
  <div class="row items-center justify-center" style="min-height: 90vh;">
105
103
  <q-banner class="text-white bg-positive text-center text-h3" rounded>
@@ -118,9 +116,6 @@ import {mapActions, mapGetters} from 'vuex';
118
116
  import axios from 'axios';
119
117
  import {ENTRYPOINT} from '../../../../../../../../src/config/entrypoint';
120
118
 
121
-
122
-
123
-
124
119
  export default {
125
120
  props: {
126
121
  invoiceId: {
@@ -133,9 +128,7 @@ export default {
133
128
  },
134
129
  },
135
130
 
136
- components: {
137
-
138
- },
131
+ components: {},
139
132
 
140
133
  mounted() {
141
134
  window.addEventListener('focus', this.loadItauDataOnFocus);
@@ -155,6 +148,7 @@ export default {
155
148
  invoiceUrlSicred: null,
156
149
  showBilletInter: null,
157
150
  showBilletSicred: null,
151
+ showInfoBox: null,
158
152
  isLoadingDownload: false,
159
153
  isLoading: false,
160
154
  payment: null,
@@ -163,7 +157,7 @@ export default {
163
157
  showBillet: false,
164
158
  loadOnFocus: false,
165
159
  retrievingHash: false,
166
- paymentInstitution: null // 'itau','inter'
160
+ paymentInstitution: null
167
161
  };
168
162
  },
169
163
 
@@ -198,9 +192,16 @@ export default {
198
192
 
199
193
  this.isPaid = data.paymentStatus === 'paid';
200
194
 
195
+ if(this.payment.paymentStatus === 'open')
196
+ {
197
+ this.showInfoBox = true;
198
+ }
199
+
201
200
  if (data.paymentType == 'billet') {
202
201
 
203
- // if (data.paymentStatus == 'created' && this.isPaid === false) {
202
+ if (data.paymentStatus !== 'open') {
203
+
204
+ this.showInfoBox = false;
204
205
 
205
206
  if (this.paymentInstitution === 'itau') {
206
207
  this.getItauHash().then(hash => {
@@ -227,12 +228,7 @@ export default {
227
228
  this.showBilletSicred = true;
228
229
 
229
230
  }
230
- // } else {
231
- // this.showBillet = false;
232
- // if (this.paymentInstitution === 'sicred') {
233
- // this.isPaid = data.status === 'paid';
234
- // }
235
- // }
231
+ }
236
232
 
237
233
  }
238
234
 
@@ -360,7 +356,7 @@ export default {
360
356
 
361
357
  return this.getBank().then(data2 => {
362
358
 
363
- if (this.paymentInstitution === 'itau') { // ------------------------------ Banco 'itau'
359
+ if (this.paymentInstitution === 'itau') {
364
360
 
365
361
  this.getItauData({
366
362
  invoiceId: this.invoiceId,
@@ -378,7 +374,7 @@ export default {
378
374
  // this.isLoading = false;
379
375
  });
380
376
 
381
- } else if(this.paymentInstitution === 'inter'){ // ------------------------------ Banco 'inter'
377
+ } else if(this.paymentInstitution === 'inter'){
382
378
 
383
379
  this.getInterData({
384
380
  invoiceId: this.invoiceId,
@@ -411,7 +407,7 @@ export default {
411
407
  });
412
408
 
413
409
  }
414
- else { // ------------------------------ Banco 'Sicred'
410
+ else {
415
411
 
416
412
  this.getSicredData({
417
413
  invoiceId: this.invoiceId,