Skip to content

Commit

Permalink
Feat: Add Field Product Search (#2197)
Browse files Browse the repository at this point in the history
* Feat: Add Field Product Search

* refactory
  • Loading branch information
elsiosanchez committed May 6, 2024
1 parent 7a8715e commit 559ede1
Show file tree
Hide file tree
Showing 22 changed files with 1,701 additions and 521 deletions.
2 changes: 2 additions & 0 deletions src/api/ADempiere/field/search/product.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ export function requestListProducts({
product_group_id,
product_class_id,
product_category_id,
product_classification_id,
price_list_version_id,
warehouse_id,
attribute_set_id,
Expand Down Expand Up @@ -345,6 +346,7 @@ export function requestListProducts({
product_group_id,
product_class_id,
product_category_id,
product_classification_id,
price_list_version_id,
warehouse_id,
attribute_set_id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export default defineComponent({
const currentPageNumber = computed(() => {
if (!isEmptyValue(props.pageNumber)) {
return props.pageNumber
return Number(props.pageNumber)
}
return 1
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
>
<el-select
v-model="currentValue"
clearable
>
<!-- :disabled="isDisabled" -->
<el-option
Expand All @@ -43,7 +44,7 @@ import store from '@/store'
import { YES_NO_OPTIONS_LIST } from '@/utils/ADempiere/dictionary/field/yesNo'
// Utils and Helper Methods
// import { isEmptyValue } from '@/utils/ADempiere/valueUtils'
import { isEmptyValue } from '@/utils/ADempiere/valueUtils'
export default defineComponent({
name: 'IsStokedField',
Expand All @@ -58,7 +59,7 @@ export default defineComponent({
default: undefined
},
containerUuid: {
required: true,
required: false,
type: String
}
},
Expand All @@ -68,6 +69,7 @@ export default defineComponent({
const currentValue = computed({
set(newValue) {
if (isEmptyValue(newValue)) newValue = -1
store.commit('setProductSearchFieldQueryFilterByAttribute', {
containerUuid: props.uuidForm,
attributeKey: ATTRIBUTE_KEY,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<el-select
v-model="currentValue"
filterable
clearable
remote
:remote-method="remoteSearch"
@visible-change="loadPriceListVersions"
Expand Down Expand Up @@ -76,7 +77,7 @@ export default defineComponent({
default: undefined
},
containerUuid: {
required: true,
required: false,
type: String
}
},
Expand Down Expand Up @@ -131,6 +132,7 @@ export default defineComponent({
const currentValue = computed({
set(newValue) {
if (isEmptyValue(newValue)) newValue = -1
store.commit('setProductSearchFieldQueryFilterByAttribute', {
containerUuid: props.uuidForm,
attributeKey: ATTRIBUTE_KEY,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<el-select
v-model="currentValue"
filterable
clearable
remote
:remote-method="remoteSearch"
@visible-change="loadProductCategories"
Expand Down Expand Up @@ -51,6 +52,7 @@ import { requestListProductCategories } from '@/api/ADempiere/field/search/produ
// Components and Mixins
import EmptyOptionSelect from '@/components/ADempiere/FieldDefinition/FieldSelect/emptyOptionSelect.vue'
import { isEmptyValue } from '@/utils/ADempiere'
export default defineComponent({
name: 'ProductCategoryField',
Expand All @@ -69,7 +71,7 @@ export default defineComponent({
default: undefined
},
containerUuid: {
required: true,
required: false,
type: String
}
},
Expand All @@ -81,6 +83,7 @@ export default defineComponent({
const currentValue = computed({
set(newValue) {
if (isEmptyValue(newValue)) newValue = -1
store.commit('setProductSearchFieldQueryFilterByAttribute', {
containerUuid: props.uuidForm,
attributeKey: ATTRIBUTE_KEY,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<el-select
v-model="currentValue"
filterable
clearable
remote
:remote-method="remoteSearch"
@visible-change="loadProductClasses"
Expand Down Expand Up @@ -51,6 +52,7 @@ import { requestListProductClasess } from '@/api/ADempiere/field/search/product.
// Components and Mixins
import EmptyOptionSelect from '@/components/ADempiere/FieldDefinition/FieldSelect/emptyOptionSelect.vue'
import { isEmptyValue } from '@/utils/ADempiere'
export default defineComponent({
name: 'ProductClassField',
Expand All @@ -69,7 +71,7 @@ export default defineComponent({
default: undefined
},
containerUuid: {
required: true,
required: false,
type: String
}
},
Expand All @@ -81,6 +83,7 @@ export default defineComponent({
const currentValue = computed({
set(newValue) {
if (isEmptyValue(newValue)) newValue = -1
store.commit('setProductSearchFieldQueryFilterByAttribute', {
containerUuid: props.uuidForm,
attributeKey: ATTRIBUTE_KEY,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
v-model="currentValue"
filterable
remote
clearable
:remote-method="remoteSearch"
@visible-change="loadProductClassifications"
>
Expand Down Expand Up @@ -51,6 +52,7 @@ import { requestListProductClassifications } from '@/api/ADempiere/field/search/
// Components and Mixins
import EmptyOptionSelect from '@/components/ADempiere/FieldDefinition/FieldSelect/emptyOptionSelect.vue'
import { isEmptyValue } from '@/utils/ADempiere'
export default defineComponent({
name: 'ProductClassificationField',
Expand All @@ -69,7 +71,7 @@ export default defineComponent({
default: undefined
},
containerUuid: {
required: true,
required: false,
type: String
}
},
Expand All @@ -81,6 +83,7 @@ export default defineComponent({
const currentValue = computed({
set(newValue) {
if (isEmptyValue(newValue)) newValue = -1
store.commit('setProductSearchFieldQueryFilterByAttribute', {
containerUuid: props.uuidForm,
attributeKey: ATTRIBUTE_KEY,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<el-select
v-model="currentValue"
filterable
clearable
remote
:remote-method="remoteSearch"
@visible-change="loadProductGroups"
Expand Down Expand Up @@ -51,6 +52,7 @@ import { requestListProductGroups } from '@/api/ADempiere/field/search/product.t
// Components and Mixins
import EmptyOptionSelect from '@/components/ADempiere/FieldDefinition/FieldSelect/emptyOptionSelect.vue'
import { isEmptyValue } from '@/utils/ADempiere'
export default defineComponent({
name: 'ProductGroupField',
Expand All @@ -69,7 +71,7 @@ export default defineComponent({
default: undefined
},
containerUuid: {
required: true,
required: false,
type: String
}
},
Expand All @@ -81,6 +83,7 @@ export default defineComponent({
const currentValue = computed({
set(newValue) {
if (isEmptyValue(newValue)) newValue = -1
store.commit('setProductSearchFieldQueryFilterByAttribute', {
containerUuid: props.uuidForm,
attributeKey: ATTRIBUTE_KEY,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<el-select
v-model="currentValue"
filterable
clearable
remote
:remote-method="remoteSearch"
@visible-change="loadVendors"
Expand Down Expand Up @@ -51,6 +52,8 @@ import { requestListVendors } from '@/api/ADempiere/field/search/product.ts'
// Components and Mixins
import EmptyOptionSelect from '@/components/ADempiere/FieldDefinition/FieldSelect/emptyOptionSelect.vue'
// Utils and Helper Methods
import { isEmptyValue } from '@/utils/ADempiere/valueUtils'
export default defineComponent({
name: 'vendorField',
Expand All @@ -69,7 +72,7 @@ export default defineComponent({
default: undefined
},
containerUuid: {
required: true,
required: false,
type: String
}
},
Expand All @@ -81,6 +84,7 @@ export default defineComponent({
const currentValue = computed({
set(newValue) {
if (isEmptyValue(newValue)) newValue = -1
store.commit('setProductSearchFieldQueryFilterByAttribute', {
containerUuid: props.uuidForm,
attributeKey: ATTRIBUTE_KEY,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<el-select
v-model="currentValue"
filterable
clearable
remote
:remote-method="remoteSearch"
@visible-change="loadWarehouses"
Expand Down Expand Up @@ -51,6 +52,8 @@ import { requestListWarehouses } from '@/api/ADempiere/field/search/product.ts'
// Components and Mixins
import EmptyOptionSelect from '@/components/ADempiere/FieldDefinition/FieldSelect/emptyOptionSelect.vue'
// Utils and Helper Methods
import { isEmptyValue } from '@/utils/ADempiere/valueUtils'
export default defineComponent({
name: 'WarehouseField',
Expand All @@ -69,7 +72,7 @@ export default defineComponent({
default: undefined
},
containerUuid: {
required: true,
required: false,
type: String
}
},
Expand All @@ -81,6 +84,7 @@ export default defineComponent({
const currentValue = computed({
set(newValue) {
if (isEmptyValue(newValue)) newValue = -1
store.commit('setProductSearchFieldQueryFilterByAttribute', {
containerUuid: props.uuidForm,
attributeKey: ATTRIBUTE_KEY,
Expand Down
Loading

0 comments on commit 559ede1

Please sign in to comment.