geer-builder 1.2.643 → 1.2.644

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/GPayBills.vue ADDED
@@ -0,0 +1,756 @@
1
+ <template>
2
+ <div class="pay-bills">
3
+ <div class="message-output q-mb-lg" v-if="!(this.user_info.hasOwnProperty('verified') && this.user_info.verified === true)">
4
+ <div class="verification-required">
5
+ <div class="title">Verification Required</div>
6
+ <div class="desc">You need to <b>GET VERIFIED</b> to transact with this module. Please click the <b>"GET VERIFIED"</b> button.</div>
7
+ </div>
8
+ <q-btn class="q-mt-lg" @click="is_g_user_verification_dialog_open = true" label="Get Verified"/>
9
+ </div>
10
+ <div class="wallet-grid" style="display:block;grid-template-columns:1fr 1fr" v-if="this.user_info.hasOwnProperty('verified') && this.user_info.verified === true">
11
+ <div class="section-holder" style="margin-bottom:50px;">
12
+ <div class="value" v-if="current_slot_info && current_slot_info.wallet >= 0"> Php {{ $_formatNumber(current_slot_info.wallet, { decimal: 2 }) }}</div>
13
+ <div class="label">Wallet Balance</div>
14
+ </div>
15
+ </div>
16
+ <q-form @submit="onSubmit">
17
+ <div class="details-primary row-grid">
18
+ <q-input filled dense required v-model="form.details.first_name" placeholder="Enter your First Name" label="First Name" />
19
+ <q-input filled dense v-model="form.details.middle_name" placeholder="Enter your Middle Name" label="Middle Name" />
20
+ <q-input filled dense required v-model="form.details.last_name" placeholder="Enter your Last Name" label="Last Name" />
21
+ <q-input filled dense required type="number" v-model="form.details.contact_number" placeholder="Enter your Number" label="Mobile Number ( Must be 11 digits )" />
22
+ </div>
23
+
24
+ <!-- OPTIONS -->
25
+ <div class="required-fields row-grid">
26
+ <q-select dense filled v-model="method_type" option_label="label" option_id="id" :options="method_options" label="Select a type of method" />
27
+ <q-select v-if="pay_to_collect" dense filled v-model="selected_hub" option-label="full_name" option-value="active_slot" :options="hub_options" label="Select preferred hub" />
28
+ <q-select dense filled @input="selected_category_option=null; selected_options_field=null" v-model="bills_category" option_label="label" option_id="id" :options="bills_options" label="Select a type of billing" />
29
+ <q-select dense filled @input="selected_options_field=selected_category_option.field" v-model="selected_category_option" option_label="label" option_id="id" :options="category_options" label="Options" />
30
+ <q-input filled dense required v-model="form.amount_to_pay" label="Amount to Pay" />
31
+ </div>
32
+
33
+ <div class="details-primary" style="padding-top:50px;">
34
+ *Necessary Details
35
+ </div>
36
+ <div v-if="selected_category_option">
37
+ <div v-for="(fields, i) in selected_options_field" :key="i">
38
+ <div class="details-needed" style="padding-top:20px;">
39
+ <div class="details-primary" v-if="fields.is_multiple == false">
40
+ <q-input :required="fields.is_required" filled dense v-model="selected_options_field[i].value" :label="fields.is_required == false ? fields.field_name + ' (Optional)' : fields.field_name+'' " autocomplete="off" />
41
+ </div>
42
+ <div class="details-primary" v-if="fields.is_multiple == true">
43
+
44
+ <q-select :required="fields.is_required" dense filled v-model="selected_options_field[i].value" option-label="field_name" option-value="field_name" :options="fields.field_choices" :label="fields.field_name" />
45
+ </div>
46
+ </div>
47
+ </div>
48
+ </div>
49
+ <div v-else>
50
+ <div class="details-primary" style="padding-top:30px;">
51
+ <b>Choose a billing type and options first.</b>
52
+ </div>
53
+ </div>
54
+
55
+ <!-- <div class="details q-mt-lg">
56
+ <div class="label q-mb-sm">*Necessary Details <span>( You must include necessary details on this section. )</span></div>
57
+ <q-input filled v-model="form.bills_details" type="textarea" label="Please input necessary details" required />
58
+ </div> -->
59
+
60
+ <div class="q-mt-lg" align="left" style="padding-top:50px;" v-if="this.user_info.hasOwnProperty('verified') && this.user_info.verified === true">
61
+ <q-btn type="submit" :loading="submit_loading" label="Submit" color="primary" :disable="selected_category_option ? false : true"></q-btn>
62
+ </div>
63
+ </q-form>
64
+ <div align="right" class="q-mb-md q-mt-xl filters" style="padding-top:50px;">
65
+ <q-input style="width: 300px;" label="Search Here" outlined="" v-model="filterr" />
66
+ <q-select outlined style="min-width: 200px; width: fit-content" v-model="filter_method" option-label="label" option-value="id" :options="filter_method_options" label="Filter Payment Method" />
67
+ <q-select outlined style="min-width: 200px; width: fit-content" v-model="filter" :options="['All', 'Pending', 'For Collection', 'Rejected', 'Collected', 'For Processing', 'Processed']" label="Filter" />
68
+ </div>
69
+
70
+ <q-table
71
+ :title="table_title"
72
+ :loading="table_loading"
73
+ @row-click="viewBillDetails"
74
+ separator="cell"
75
+ bordered
76
+ flat
77
+ :filter="filterr"
78
+ :data="!table_loading ? bills_payment_data : []"
79
+ :columns="table_column"
80
+ :pagination.sync="pagination"
81
+ >
82
+ </q-table>
83
+
84
+ <!-- CREATE DIALOG -->
85
+ <q-dialog v-model="is_view_bill_details_dialog">
86
+ <bill-details-dialog :row="row" @closePopup="is_view_bill_details_dialog = false"></bill-details-dialog>
87
+ </q-dialog>
88
+
89
+ <q-dialog v-model="is_open_paybills_form">
90
+ <q-card class="paybills-page-dialog">
91
+ <q-card-section>
92
+ <div class="page-title text-center">Pay Bills</div>
93
+ <div class="wallet-grid">
94
+ <div class="section-holder" style="margin-bottom:50px;">
95
+ <div class="label">Wallet : </div>
96
+ <div class="value" v-if="current_slot_info && current_slot_info.wallet >= 0"> {{ $_formatNumber(current_slot_info.wallet, { decimal: 2 }) }}</div>
97
+ </div>
98
+ </div>
99
+ <q-form @submit="onSubmit">
100
+ <div class="details-primary first-child">
101
+ <q-input filled dense required v-model="form.details.first_name" placeholder="Enter your First Name" label="First Name" />
102
+ <q-input filled dense v-model="form.details.middle_name" placeholder="Enter your Middle Name" label="Middle Name" />
103
+ <q-input filled dense required v-model="form.details.last_name" placeholder="Enter your Last Name" label="Last Name" />
104
+ <q-input filled dense required type="number" v-model="form.details.contact_number" placeholder="Enter your Number" label="Mobile Number ( Must be 11 digits )" />
105
+ </div>
106
+
107
+ <!-- OPTIONS -->
108
+ <div class="primary-details-wrap-container">
109
+ <q-select dense filled @input="selected_category_option=null; selected_options_field=null" v-model="bills_category" option_label="label" option_id="id" :options="bills_options" label="Select a type of billing" />
110
+ <q-select dense filled @input="selected_options_field=selected_category_option.field" v-model="selected_category_option" option_label="label" option_id="id" :options="category_options" label="Options" />
111
+ <q-input filled dense required v-model="form.amount_to_pay" label="Amount to Pay" />
112
+ </div>
113
+
114
+ <div class="details-primary" style="padding-top:50px;">
115
+ *Necessary Details
116
+ </div>
117
+ <div v-if="selected_category_option" class="details-input-wrapper">
118
+ <div v-for="(fields, i) in selected_options_field" :key="i">
119
+ <div class="details-needed" style="padding-top:20px;">
120
+ <div class="details-primary" v-if="fields.is_multiple == false">
121
+ <q-input :required="fields.is_required" filled dense v-model="selected_options_field[i].value" :label="fields.is_required == false ? fields.field_name + ' (Optional)' : fields.field_name+'' " autocomplete="off" />
122
+ </div>
123
+ <div class="details-primary" v-if="fields.is_multiple == true">
124
+
125
+ <q-select :required="fields.is_required" dense filled v-model="selected_options_field[i].value" option-label="field_name" option-value="field_name" :options="fields.field_choices" :label="fields.field_name" />
126
+ </div>
127
+ </div>
128
+ </div>
129
+ </div>
130
+ <div v-else>
131
+ <div class="details-primary" style="padding-top:30px;">
132
+ <b>Choose a billing type and options first.</b>
133
+ </div>
134
+ </div>
135
+
136
+ <!-- <div class="details q-mt-lg">
137
+ <div class="label q-mb-sm">*Necessary Details <span>( You must include necessary details on this section. )</span></div>
138
+ <q-input filled v-model="form.bills_details" type="textarea" label="Please input necessary details" required />
139
+ </div> -->
140
+
141
+ <div class="q-mt-lg" align="right" style="padding-top:50px;">
142
+ <q-btn type="submit" :loading="submit_loading" label="Submit" color="primary" :disable="selected_category_option ? false : true"></q-btn>
143
+ </div>
144
+ </q-form>
145
+ </q-card-section>
146
+ </q-card>
147
+ </q-dialog>
148
+ <q-dialog persistent v-model="is_g_user_verification_dialog_open" :maximized="true" transition-show="slide-up" transition-hide="slide-down">
149
+ <div class="user-verification-dialog-holder">
150
+ <g-user-verification class="full-width"/>
151
+ </div>
152
+ </q-dialog>
153
+ </div>
154
+ </template>
155
+
156
+ <script>
157
+ import GlobalMixins from './mixins/global_mixins.js';
158
+ import DB_BILLS_PAYMENT from './models/DB_BILLS_PAYMENT';
159
+ import DB_USER from './models/DB_USER';
160
+ import DB_USER_SHIPPING_ADDRESS from './models/DB_USER_SHIPPING_ADDRESS';
161
+ import BillDetailsDialog from "./dialogs/BillDetailsDialog";
162
+ import GUserVerification from './GUserVerification';
163
+ import {formatDate} from './utilities/DateUtils';
164
+ import {formatNumber} from './utilities/NumberUtils';
165
+ import { log } from 'console';
166
+ export default
167
+ {
168
+ components: { BillDetailsDialog, GUserVerification },
169
+ filters: { },
170
+ data:() =>(
171
+ {
172
+ is_open_paybills_form: false,
173
+ public_settings:{},
174
+ table_data: [],
175
+ bill_credits_field:{},
176
+ category_list: [{"label": "Electricity", "id": "electricity",}, {"label": "Water Utilities", "id": "water_utilities"}, {"label": "Cable/Internet","id": "cable_w_internet"}, {"label": "Telecoms","id": "telecoms"}, {"label": "Credit Cards","id": "credit_card"}, {"label": "Loans","id": "loans"}, {"label": "Government","id": "government"}, {"label": "Insurance","id": "insurance"}, {"label": "Transportation","id": "transportation"}, {"label": "Real State","id": "real_state"}, {"label": "Healthcare","id": "healthcare"},{"label": "School","id": "school"}],
177
+ bills_options: [],
178
+ filterr:'',
179
+ bills_category:null,
180
+ selected_category_option:null,
181
+ selected_options_field:null,
182
+ submit_loading:false,
183
+ is_g_user_verification_dialog_open: false,
184
+ method_type: null,
185
+ pay_to_collect: false,
186
+ filter_method: { label: 'All', id: 'all' },
187
+ filter_method_options: [
188
+ {
189
+ label: 'All',
190
+ id: 'all'
191
+ },
192
+ {
193
+ label: 'Use Wallet',
194
+ id: 'MO-001'
195
+ },
196
+ {
197
+ label: 'Pay via Cash',
198
+ id: 'MO-002'
199
+ }
200
+ ],
201
+ selected_hub: null,
202
+ form: {
203
+ details :
204
+ {
205
+ first_name : null,
206
+ middle_name : null,
207
+ last_name : null,
208
+ contact_number: null,
209
+ },
210
+ bills :
211
+ {
212
+ category_id : null,
213
+ category_label : null,
214
+ option_label : null,
215
+ option_id : null,
216
+ fields : {},
217
+ },
218
+ address: {
219
+ street: null,
220
+ barangay: null,
221
+ city: null,
222
+ province: null,
223
+ region: null,
224
+ postal_code: null,
225
+ },
226
+ amount_to_pay : null,
227
+ method_type: null,
228
+ selected_hub: null,
229
+ },
230
+ method_options: [
231
+ {
232
+ label: 'Use Wallet',
233
+ id: 'MO-001'
234
+ },
235
+ {
236
+ label: 'Pay via Cash',
237
+ id: 'MO-002'
238
+ }
239
+ ],
240
+ is_view_bill_details_dialog: false,
241
+ dialog_bills_payment: false,
242
+ bills_payment_data: [],
243
+ filter: "All",
244
+ row : {},
245
+ table_title: 'All Request',
246
+ table_loading: false,
247
+ pagination : { rowsPerPage: 5},
248
+ table_column:
249
+ [
250
+ {
251
+ name : 'status',
252
+ label : 'Status',
253
+ field : row => row.status,
254
+ format: val => `${val}`,
255
+ align : 'left',
256
+ },
257
+ {
258
+ name : 'full_name',
259
+ label : 'Full Name',
260
+ field : row => row.details.full_name,
261
+ align : 'left',
262
+ format: val => `${val}`,
263
+ sortable: true,
264
+ },
265
+ {
266
+ name : 'slot_code',
267
+ label : 'SLOT CODE',
268
+ field : row => row.slot_code,
269
+ align : 'left',
270
+ format: val => `${val}`,
271
+ sortable: true,
272
+ },
273
+ {
274
+ name : 'bills_type',
275
+ label : 'Bills Type',
276
+ field : row => row.bills.category_label,
277
+ align : 'left',
278
+ format: val => `${val}`,
279
+ sortable: true,
280
+ },
281
+ {
282
+ name : '_address_combined',
283
+ label : 'Address',
284
+ field : row => row._address_combined,
285
+ align : 'left',
286
+ format: val => `${val}`,
287
+ sortable: true,
288
+ },
289
+ {
290
+ name : 'contact_number',
291
+ label : 'Contact Number',
292
+ field : row => row.details.contact_number,
293
+ align : 'left',
294
+ format: val => `${val}`,
295
+ sortable: true,
296
+ },
297
+ {
298
+ name : 'created_date',
299
+ label : 'Requested Date & Time',
300
+ field : row => formatDate(row.created_date, 'MM/DD/YY (hh:mm A)'),
301
+ format: val => `${val}`,
302
+ align : 'left',
303
+ },
304
+ {
305
+ name : 'amount_to_pay',
306
+ label : 'Paid amount',
307
+ field : row => `Php${formatNumber(row.amount_to_pay, { decimal: 2 })}`,
308
+ format: val => `${val}`,
309
+ align : 'left',
310
+ },
311
+ {
312
+ name : 'payment_method',
313
+ label : 'Payment Method',
314
+ field : row => row.method_type.label,
315
+ format : val => `${val ? val:'-----'}`,
316
+ align : 'left',
317
+ },
318
+ {
319
+ name : 'gcash_ref_number',
320
+ label : 'Reference Number',
321
+ field : row => row.gcash_ref_number,
322
+ format : val => `${val ? val:'-----'}`,
323
+ align : 'left',
324
+ },
325
+ {
326
+ name : 'response_message',
327
+ label : 'Response Message',
328
+ field : row => row.response_message,
329
+ format : val => `${val ? val:'-----'}`,
330
+ align : 'left',
331
+ }
332
+ ],
333
+ hub_options: [],
334
+ user_default_address: null,
335
+ }),
336
+ watch:
337
+ {
338
+ filter()
339
+ {
340
+ this.getAllGcashRequest();
341
+ },
342
+ method_type()
343
+ {
344
+ if (this.method_type.id == 'MO-002') this.pay_to_collect = true;
345
+ else
346
+ {
347
+ this.pay_to_collect = false
348
+ this.selected_hub = null;
349
+ }
350
+ this.form.method_type = this.method_type;
351
+ },
352
+ selected_hub()
353
+ {
354
+ if (this.selected_hub != null) this.form.selected_hub = this.selected_hub.active_slot;
355
+ else this.form.selected_hub = null;
356
+ },
357
+ filter_method()
358
+ {
359
+ this.getAllGcashRequest();
360
+ }
361
+ },
362
+ async mounted()
363
+ {
364
+ this.$q.loading.show();
365
+ if(this.user_info.active_slot)
366
+ {
367
+ this.bill_credits_field = await this.$_getData('bill_credits_field');
368
+ this.public_settings = await this.$_getData('public_settings');
369
+ if(this.bill_credits_field) this.bills_options = this.bill_credits_field;
370
+ await this.$_getSlotInfo();
371
+ }
372
+ await this.getAllGcashRequest();
373
+ await this.getAddress();
374
+ await this.getHubOptions();
375
+ await this.getUserInfo();
376
+ this.$q.loading.hide();
377
+ },
378
+ methods:
379
+ {
380
+ async getCollectorsLocations()
381
+ {
382
+ let collector = await new DB_USER().collection().where('hubs_slot', '==', this.form.selected_hub).where('collector', '==', true).get().then(res => res.docs.map(doc => Object.assign({}, doc.data(), { id: doc.id })));
383
+ let collector_location = null;
384
+ if (!(collector && collector.hasOwnProperty('length') && collector.length > 0)) return {response: false};
385
+ else
386
+ {
387
+ for (let i = 0; i < collector.length; i++) {
388
+ const element = collector[i];
389
+ let tag_location = element.tag_location;
390
+ if(tag_location.hasOwnProperty('length') && tag_location.length > 0)
391
+ {
392
+ for (let i = 0; i < tag_location.length; i++) {
393
+ const ins_element = tag_location[i];
394
+ if (ins_element.brgy_code === this.user_default_address.barangay.brgy_code) collector_location = {location_code: ins_element.brgy_code, has_collector: true};
395
+ }
396
+ }
397
+ }
398
+ return collector_location;
399
+ }
400
+ },
401
+ async onSubmit()
402
+ {
403
+ let is_undefined = false;
404
+ let is_required = false;
405
+ this.form.bills.category_id = this.bills_category.id;
406
+ this.form.bills.category_label = this.bills_category.label;
407
+ this.form.bills.option_id = this.selected_category_option.id;
408
+ this.form.bills.option_label = this.selected_category_option.label;
409
+ this.form.bills.fields = this.selected_options_field;
410
+ this.form.bills.fields.forEach((d, i) =>
411
+ {
412
+ if(d.value == undefined)
413
+ {
414
+ is_undefined = true;
415
+ }
416
+
417
+ if(typeof d.value == "object")
418
+ {
419
+ this.form.bills.fields[i].value = this.form.bills.fields[i].value.field_name;
420
+ }
421
+ });
422
+
423
+ this.submit_loading = true;
424
+ this.$q.loading.show();
425
+ if (this.form.amount_to_pay < 1)
426
+ {
427
+ this.$q.dialog({title:'Invalid Input', message: `The amount you've entered is invalid.`});
428
+ }
429
+ else if (!(this.form.method_type))
430
+ {
431
+ this.$q.dialog({title:'Incomplete Form Request', message: 'Please fill up the form.'});
432
+ }
433
+ else if (is_undefined == true)
434
+ {
435
+ this.$q.dialog({title:'Incomplete Form Request', message: 'Please fill up the form.'});
436
+ }
437
+ else if (!(this.form.bills.category_id))
438
+ {
439
+ this.$q.dialog({title:'Incomplete Form Request', message: 'Kindly select a type of billing to pay.'});
440
+ }
441
+ else if (!(this.form.bills.option_id))
442
+ {
443
+ this.$q.dialog({title:'Incomplete Form Request', message: 'Kindly select a billing option to pay.'});
444
+ }
445
+ else if (!(this.form.details.contact_number && this.form.details.contact_number.length === 11))
446
+ {
447
+ this.$q.dialog({title:'Invalid number', message: 'Kindly input your number properly.'});
448
+ }
449
+ else if (!this.current_slot_info)
450
+ {
451
+ this.$q.dialog({ title: `Something's not quite right`, message: "No slot available" });
452
+ }
453
+ else
454
+ {
455
+ try
456
+ {
457
+ if (this.form.method_type.id === "MO-002")
458
+ {
459
+ if (!(this.form.selected_hub))
460
+ {
461
+ this.$q.dialog({title:'Field is Required', message: 'Please select your preferred hub. Thank your.'});
462
+ this.submit_loading = false;
463
+ return this.$q.loading.hide();
464
+ }
465
+ let collector = await this.getCollectorsLocations();
466
+ if (!(collector && collector.hasOwnProperty('has_collector') && collector.has_collector === true))
467
+ {
468
+ this.$q.dialog({message: 'No collectors found in your location. Sorry for inconvenience.'});
469
+ this.submit_loading = false;
470
+ return this.$q.loading.hide();
471
+ }
472
+ else this.form.location_code = collector.location_code;
473
+ }
474
+ this.form.slot_code = this.current_slot_info.slot_code;
475
+ let res = await this.$_fbCall('memberBillsPayment', this.form);
476
+ this.$q.dialog({ title: `Success!`, message: 'Bills Payment has been succesfully submitted.', html: true });
477
+
478
+ this.form.details.first_name = null;
479
+ this.form.details.middle_name = null;
480
+ this.form.details.last_name = null;
481
+ this.form.details.contact_number = null;
482
+ this.form.amount_to_pay = null;
483
+ this.form.bills.category_id = null;
484
+ this.form.bills.category_label = null;
485
+ this.form.bills.option_id = null;
486
+ this.form.bills.option_label = null;
487
+ this.form.bills.fields = {};
488
+ this.bills_category = null;
489
+ this.selected_category_option = null;
490
+ this.selected_options_field = null;
491
+ }
492
+ catch (error)
493
+ {
494
+ this.submit_loading = false;
495
+
496
+ this.$q.dialog({ title: `Something's not quite right`, message: error.message });
497
+ }
498
+ }
499
+ this.$q.loading.hide();
500
+ this.submit_loading = false;
501
+ },
502
+ async getAddress()
503
+ {
504
+ if (this.user_info && this.user_info.hasOwnProperty('verified') && this.user_info.verified === true) {
505
+ let address = await new DB_USER_SHIPPING_ADDRESS(this.user_info.uid).collection().where('default', '==', true).get();
506
+ this.user_default_address = address.docs[0].data();
507
+ }
508
+ },
509
+ async getUserInfo()
510
+ {
511
+ if (this.user_info)
512
+ {
513
+ this.form.details.contact_number = this.user_info.contact_number
514
+ if (this.user_default_address) {
515
+ this.form.details.first_name = this.user_default_address.first_name;
516
+ if (this.user_default_address.hasOwnProperty('middle_name')) this.form.details.middle_name = this.user_default_address.middle_name;
517
+ this.form.details.last_name = this.user_default_address.last_name
518
+ this.form.address.street= this.user_default_address.street;
519
+ this.form.address.barangay= this.user_default_address.barangay.name;
520
+ this.form.address.city= this.user_default_address.city.name;
521
+ this.form.address.province= this.user_default_address.province.name;
522
+ this.form.address.region= this.user_default_address.region.name;
523
+ this.form.address.postal_code= this.user_default_address.postal_code;
524
+ }
525
+ }
526
+ },
527
+ async getAllGcashRequest()
528
+ {
529
+ this.$q.loading.show();
530
+ this.table_loading = true;
531
+ this.table_title = `${this.filter} Request`;
532
+
533
+ let filter_method = this.filter_method.id
534
+
535
+ let filter = '';
536
+ if(this.filter === 'For Collection') filter = 'for_collection';
537
+ else if(this.filter === 'For Processing') filter = 'for_processing';
538
+ else filter = this.filter.toLowerCase();
539
+
540
+ if (filter === 'all' && filter_method === 'all') await this.$bind('bills_payment_data', new DB_BILLS_PAYMENT().collection()
541
+ .where('members_uid', '==', `${this.user_info.uid}`).orderBy('created_date', 'desc'));
542
+ else if (filter === 'all' && filter_method != 'all') await this.$bind('bills_payment_data', new DB_BILLS_PAYMENT().collection()
543
+ .where('members_uid', '==', `${this.user_info.uid}`).where('method_type_id', '==', filter_method).orderBy('created_date', 'desc'));
544
+ else if (filter != 'all' && filter != 'collected' && filter_method === 'all') await this.$bind('bills_payment_data', new DB_BILLS_PAYMENT().collection()
545
+ .where('members_uid', '==', `${this.user_info.uid}`).where('status', '==', `${filter}`).orderBy('created_date', 'desc'));
546
+ else if (filter === 'collected' && filter_method === 'all') await this.$bind('bills_payment_data', new DB_BILLS_PAYMENT().collection()
547
+ .where('members_uid', '==', `${this.user_info.uid}`).where('collected', '==', true).orderBy('created_date', 'desc'));
548
+ else if (filter === 'collected' && filter_method != 'all') await this.$bind('bills_payment_data', new DB_BILLS_PAYMENT().collection()
549
+ .where('members_uid', '==', `${this.user_info.uid}`).where('method_type_id', '==', filter_method).where('collected', '==', true).orderBy('created_date', 'desc'));
550
+ else await this.$bind('bills_payment_data', new DB_BILLS_PAYMENT().collection()
551
+ .where('members_uid', '==', `${this.user_info.uid}`).where('status', '==', `${filter}`)
552
+ .where('method_type_id', '==', `${filter_method}`).orderBy('created_date', 'desc'));
553
+
554
+ if(filter == 'collected')
555
+ {
556
+ let new_data = [];
557
+ this.bills_payment_data.forEach(element => {
558
+ if (element.collected === true)
559
+ {
560
+ element.status = 'collected';
561
+ }
562
+ new_data.push(element)
563
+ });
564
+
565
+ this.bills_payment_data = new_data;
566
+ }
567
+
568
+ this.table_loading = false;
569
+ this.$q.loading.hide();
570
+ },
571
+ viewBillDetails(evt, data)
572
+ {
573
+ this.row = data;
574
+ this.is_view_bill_details_dialog = true;
575
+ },
576
+ async getAllHubs()
577
+ {
578
+ await this.$bind('table_data', new DB_USER().collection().where('hub', '==', true));
579
+ let new_table_data = [];
580
+ if (this.table_data && this.table_data.hasOwnProperty('length') && this.table_data.length > 0)
581
+ {
582
+ for (let i = 0; i < this.table_data.length; i++) {
583
+ const element = this.table_data[i];
584
+ if(this.user_default_address.city.mun_code === element.address.city.mun_code) new_table_data.push(element);
585
+ }
586
+ return new_table_data;
587
+ }
588
+ },
589
+ async getHubOptions()
590
+ {
591
+ this.hub_options = await this.getAllHubs();
592
+ },
593
+ },
594
+ computed:
595
+ {
596
+ category_options()
597
+ {
598
+ return this.bills_category ? (this.bills_category.hasOwnProperty("options") ? this.bills_category.options : null ) : null;
599
+ }
600
+ }
601
+ }
602
+ </script>
603
+ <style lang="scss">
604
+ .rc-holder
605
+ {
606
+ width: 100%;
607
+ }
608
+
609
+ .wallet-grid{
610
+ // display: grid;
611
+ // grid-template-columns: 1fr;
612
+ text-align: right;
613
+ @media (max-width: 780px) {
614
+ grid-template-columns: 1fr !important;
615
+ }
616
+ .value
617
+ {
618
+ font-size: 20px;
619
+ font-weight: bold;
620
+ }
621
+ }
622
+
623
+ .pay-bills
624
+ {
625
+ // display: grid;
626
+ row-gap: 10px;
627
+ .btn-wrapper
628
+ {
629
+ display: flex;
630
+ justify-content: space-between;
631
+ .q-btn
632
+ {
633
+ background-color: #3887d1;
634
+ color: white;
635
+ }
636
+ }
637
+ .row-grid
638
+ {
639
+ margin-bottom: 20px;
640
+ display: grid;
641
+ grid-template-columns: repeat(3, 1fr);
642
+ grid-gap: 15px;
643
+ }
644
+ .filters
645
+ {
646
+ display: flex;
647
+ grid-gap: 10px;
648
+ justify-content: flex-end;
649
+ }
650
+ .message-output
651
+ {
652
+ display: flex;
653
+ justify-content: space-between;
654
+ align-items: center;
655
+ padding: 10px 20px;
656
+ background-color: white;
657
+ border-left: 3px solid red;
658
+ .verification-required
659
+ {
660
+ text-align: start;
661
+ .title
662
+ {
663
+ font-size: 20px;
664
+ font-weight: bold;
665
+ }
666
+ .desc
667
+ {
668
+ color: gray;
669
+ }
670
+ }
671
+ }
672
+ }
673
+ .q-dialog
674
+ {
675
+ .paybills-page-dialog
676
+ {
677
+ .primary-details-wrap-container
678
+ {
679
+ margin-top: 50px;
680
+ display: grid;
681
+ grid-template-columns: repeat(3, 1fr);
682
+ grid-gap: 10px;
683
+ }
684
+ .wallet-grid
685
+ {
686
+ .section-holder
687
+ {
688
+ display: flex;
689
+ grid-gap: 10px;
690
+ .value
691
+ {
692
+ font-weight: 500;
693
+ &::before
694
+ {
695
+ // content: '';
696
+ }
697
+ }
698
+ }
699
+ }
700
+ .page-title
701
+ {
702
+ display: grid;
703
+ justify-content: center;
704
+ color: #3887d1;
705
+ font-size: 20px;
706
+ width: 100%;
707
+ font-weight: 500;
708
+ }
709
+ .details
710
+ {
711
+ &-primary.first-child
712
+ {
713
+ display: grid;
714
+ grid-gap: 15px;
715
+ grid-template-columns: repeat(3, 1fr);
716
+ }
717
+ &-input-wrapper
718
+ {
719
+ display: grid;
720
+ grid-template-columns: repeat(3, 1fr);
721
+ grid-gap: 10px;
722
+ }
723
+ .label
724
+ {
725
+ width: 100%;
726
+ display: flex;
727
+ column-gap: 5px;
728
+ justify-content: flex-start;
729
+ font-weight: 500;
730
+ }
731
+ }
732
+ .filters
733
+ {
734
+ display: flex;
735
+ grid-gap: 10px;
736
+ justify-content: flex-end;
737
+ }
738
+ .action
739
+ {
740
+ display: grid;
741
+ justify-content: flex-end;
742
+ .q-btn
743
+ {
744
+ width: fit-content;
745
+ }
746
+ }
747
+ .required-fields
748
+ {
749
+ margin-top: 50px;
750
+ display: grid;
751
+ grid-gap: 15px;
752
+ grid-template-columns: repeat(3, 1fr);
753
+ }
754
+ }
755
+ }
756
+ </style>