geer-builder 1.2.946 → 1.2.947
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/components/GProduct.vue +22 -1
- package/package.json +1 -1
package/components/GProduct.vue
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<tbody>
|
|
5
5
|
<tr v-for="(field, i) in fields" :key="i">
|
|
6
6
|
<td class="product-name">
|
|
7
|
-
<q-select outlined @input="emitFields()" v-model="field.product" :option-label="(item) => item.hasOwnProperty('sku') ? `${item.sku} (${item.product_name})` : `[ Select Item ]` " option-value="id" :options="
|
|
7
|
+
<q-select outlined @input="emitFields()" v-model="field.product" :option-label="(item) => item.hasOwnProperty('sku') ? `${item.sku} (${item.product_name})` : `[ Select Item ]` " option-value="id" :options="filtered_product_list" dense use-input input-debounce="0" @filter="filterProducts"></q-select>
|
|
8
8
|
</td>
|
|
9
9
|
<td class="product-qty" width="150px" v-show="!hide_button">
|
|
10
10
|
<q-input outlined @input="emitFields()" v-model="field.quantity" dense></q-input>
|
|
@@ -32,6 +32,7 @@ export default
|
|
|
32
32
|
({
|
|
33
33
|
db_product: new DB_PRODUCT(),
|
|
34
34
|
product_list: [],
|
|
35
|
+
filtered_product_list: [],
|
|
35
36
|
fields:
|
|
36
37
|
[
|
|
37
38
|
{
|
|
@@ -64,6 +65,7 @@ export default
|
|
|
64
65
|
this.product_list.splice(ctr, 1);
|
|
65
66
|
}
|
|
66
67
|
}
|
|
68
|
+
this.filtered_product_list = this.product_list.slice();
|
|
67
69
|
}
|
|
68
70
|
},
|
|
69
71
|
methods:
|
|
@@ -88,6 +90,25 @@ export default
|
|
|
88
90
|
this.fields.splice(i, 1);
|
|
89
91
|
this.emitFields();
|
|
90
92
|
},
|
|
93
|
+
filterProducts(val, update)
|
|
94
|
+
{
|
|
95
|
+
update(function()
|
|
96
|
+
{
|
|
97
|
+
if (!val)
|
|
98
|
+
{
|
|
99
|
+
this.filtered_product_list = this.product_list;
|
|
100
|
+
}
|
|
101
|
+
else
|
|
102
|
+
{
|
|
103
|
+
var needle = val.toUpperCase();
|
|
104
|
+
this.filtered_product_list = this.product_list.filter(function(p)
|
|
105
|
+
{
|
|
106
|
+
return (p.sku && p.sku.toUpperCase().indexOf(needle) > -1) ||
|
|
107
|
+
(p.product_name && p.product_name.toUpperCase().indexOf(needle) > -1);
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}.bind(this));
|
|
111
|
+
},
|
|
91
112
|
async getProductList()
|
|
92
113
|
{
|
|
93
114
|
let product_query;
|