diff --git a/src/components/ADempiere/Form/PriceChecking/index.vue b/src/components/ADempiere/Form/PriceChecking/index.vue index fd50ff8962a..ce433af34a1 100644 --- a/src/components/ADempiere/Form/PriceChecking/index.vue +++ b/src/components/ADempiere/Form/PriceChecking/index.vue @@ -38,6 +38,7 @@ > {} } }, @@ -133,63 +133,38 @@ export default { defaultImage() { return require('@/image/ADempiere/priceChecking/no-image.jpg') }, - backgroundForm() { - if (this.isEmptyValue(this.organizationImagePath)) { - return this.defaultImage - } - if (this.isEmptyValue(this.currentImageOfProduct)) { - return this.organizationBackground - } - return this.currentImageOfProduct - }, currentPoint() { return this.$store.getters.posAttributes.currentPointOfSales } }, created() { - this.$store.dispatch('listPointOfSalesFromServer') this.unsubscribe = this.subscribeChanges() }, mounted() { - this.getImage() + this.backgroundForm = this.defaultImage + this.getImageFromSource(this.organizationImagePath) + this.$store.dispatch('listPointOfSalesFromServer') }, beforeDestroy() { this.unsubscribe() }, methods: { - async getImage(imageName = '') { - let isSetOrg = false - if (this.isEmptyValue(imageName)) { - if (!this.isEmptyValue(this.organizationBackground)) { - return this.organizationBackground - } - isSetOrg = true - imageName = this.organizationImagePath - } - // the name of the image plus the height and width of the container is sent - const imageBuffer = await requestImage({ - file: imageName, - width: 750, - height: 380 - }).then(responseImage => { - const arrayBufferAsImage = buildImageFromArrayBuffer({ - arrayBuffer: responseImage - }) - if (isSetOrg) { - this.organizationBackground = arrayBufferAsImage - return arrayBufferAsImage - } - - this.currentImageOfProduct = arrayBufferAsImage - return arrayBufferAsImage - }) - return imageBuffer - }, focusProductValue() { if (!this.isEmptyValue(this.$refs.ProductValue[0])) { this.$refs.ProductValue[0].$children[0].$children[0].$children[1].$children[0].focus() } }, + getImageFromSource(fileName) { + if (this.isEmptyValue(fileName)) { + return this.defaultImage + } + const image = getImagePath({ + file: fileName, + width: 250, + height: 280 + }) + this.backgroundForm = image.uri + }, formatPercent, formatPrice, subscribeChanges() { @@ -247,7 +222,7 @@ export default { this.search = '' this.currentImageOfProduct = '' if (this.isEmptyValue(this.productPrice.image)) { - this.getImage(this.productPrice.image) + this.getImageFromSource(this.productPrice.image) } }) } @@ -302,7 +277,7 @@ export default { this.search = '' this.currentImageOfProduct = '' if (this.isEmptyValue(this.productPrice.image)) { - this.getImage(this.productPrice.image) + this.getImageFromSource(this.productPrice.image) } }) }, 500) @@ -338,6 +313,7 @@ export default { width: 100%; height: 100%; float: inherit; + background: white; // color: white; // opacity: 0.5; } diff --git a/src/components/ADempiere/Form/VPOS/Order/index.vue b/src/components/ADempiere/Form/VPOS/Order/index.vue index dc4ef798829..35670864d81 100644 --- a/src/components/ADempiere/Form/VPOS/Order/index.vue +++ b/src/components/ADempiere/Form/VPOS/Order/index.vue @@ -112,7 +112,7 @@