geer-builder 1.2.962 → 1.2.963

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 (2) hide show
  1. package/GProcessSale.vue +35 -2
  2. package/package.json +1 -1
package/GProcessSale.vue CHANGED
@@ -34,6 +34,7 @@
34
34
  fill-input
35
35
  input-debounce="0"
36
36
  :options="options"
37
+ :loading="is_customer_loading"
37
38
  @filter="filterFn"
38
39
  @input-value="setModel"
39
40
  @filter-abort="abortFilterFn">
@@ -101,6 +102,7 @@
101
102
  hide-selected
102
103
  fill-input
103
104
  input-debounce="0"
105
+ :loading="is_customer_loading"
104
106
  :options="options"
105
107
  @filter="filterFn"
106
108
  @input-value="setModel"
@@ -122,6 +124,7 @@
122
124
  <label class="label">Sale Branch No.</label>
123
125
  <q-input readonly v-model="field.inventory_branch_log_number" class="input" dense outlined />
124
126
  <q-toggle
127
+ v-if="is_customer_stockist"
125
128
  v-model="refill"
126
129
  label="Refill Inventory"
127
130
  />
@@ -130,6 +133,7 @@
130
133
  <label class="label">Sale No.</label>
131
134
  <q-input readonly v-model="field.inventory_log_number" class="input" dense outlined />
132
135
  <q-toggle
136
+ v-if="is_customer_stockist"
133
137
  v-model="refill"
134
138
  label="Refill Inventory"
135
139
  />
@@ -316,10 +320,13 @@ export default
316
320
  is_inventory_dialog_open: false,
317
321
  is_allowed_payment_cd: false,
318
322
  is_special_binary_cd: false,
323
+ is_customer_loading:false,
324
+ is_customer_stockist:false,
319
325
  special_cd_pay:false,
320
326
  special_cd_pay_amount:0,
321
327
  special_cd_pay_amount_max:0,
322
328
  sale_id: 0,
329
+ current_email_checker:null,
323
330
  auto_activate: false,
324
331
  db_slot: new DB_SLOT(),
325
332
  db_counter: new DB_COUNTER(),
@@ -584,12 +591,36 @@ export default
584
591
  {
585
592
  console.log(val, 'asdasd');
586
593
  },
587
- setModel (val)
594
+ async setModel (val)
588
595
  {
589
596
  this.field.email = val;
590
- // let customer_info = await new DB_USER().collection().where("keywords", "array-contains", val).get()
597
+ if(!this.is_customer_loading && /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(this.field.email))
598
+ {
599
+ let customer_info = await new DB_USER().collection().where("email", "==", this.field.email).get();
600
+ if(!customer_info.empty)
601
+ {
602
+ customer_info = customer_info.docs[0].data();
603
+ if(customer_info && customer_info.stockist_info)
604
+ {
605
+ this.is_customer_stockist = true;
606
+ }
607
+ }
608
+
609
+ this.current_email_checker = this.field.email;
610
+ }
591
611
  },
592
612
  async filterFn (val, update, abort) {
613
+
614
+
615
+ if(this.field.email == this.current_email_checker && this.current_email_checker != null)
616
+ {
617
+ return false;
618
+ }
619
+
620
+ this.field.current_email_checker = null;
621
+ this.is_customer_loading = true;
622
+ this.is_customer_stockist = false;
623
+ this.refill = false;
593
624
  // call abort() at any time if you can't retrieve data somehow
594
625
  this.last_keyword = val;
595
626
  setTimeout( async () =>
@@ -631,6 +662,8 @@ export default
631
662
  new_option=[];
632
663
  this.stringOptions=[];
633
664
  }
665
+
666
+ this.is_customer_loading = false;
634
667
  // this.field.email=val;
635
668
  }
636
669
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geer-builder",
3
- "version": "1.2.962",
3
+ "version": "1.2.963",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {