diff --git a/src/api/ADempiere/persistence.js b/src/api/ADempiere/persistence.js index d97a911a..f6ee98be 100644 --- a/src/api/ADempiere/persistence.js +++ b/src/api/ADempiere/persistence.js @@ -271,6 +271,7 @@ export function requestResource({ resourceUuid }, callBack = { /** * Get image with uri request * @author EdwinBetanc0urt + * @author Elsio15 * @param {string} file * @param {number} width * @param {number} height @@ -279,8 +280,8 @@ export function requestResource({ resourceUuid }, callBack = { */ export function requestImage({ file, - width = 300, - height = 300, + width, + height, operation = 'fit' }) { const { getImagePath } = require('@/utils/ADempiere/resource.js') diff --git a/src/components/ADempiere/Form/PriceChecking/fieldsList.js b/src/components/ADempiere/Form/PriceChecking/fieldsList.js index e138bb17..12fc03e5 100644 --- a/src/components/ADempiere/Form/PriceChecking/fieldsList.js +++ b/src/components/ADempiere/Form/PriceChecking/fieldsList.js @@ -8,7 +8,11 @@ export default [ sequence: 10, cssClassName: 'price-inquiry', inputSize: 'large', - handleActionKeyPerformed: true + handleFocusGained: true, + handleFocusLost: true, + handleActionKeyPerformed: true, + isDisplayed: true, + isReadOnly: false } } ] diff --git a/src/components/ADempiere/Form/PriceChecking/index.vue b/src/components/ADempiere/Form/PriceChecking/index.vue index 92a7cbf8..cec51640 100644 --- a/src/components/ADempiere/Form/PriceChecking/index.vue +++ b/src/components/ADempiere/Form/PriceChecking/index.vue @@ -2,7 +2,6 @@
{} } }, @@ -127,13 +127,15 @@ export default { 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 + file: imageName, + width: 750, + height: 380 }).then(responseImage => { const arrayBufferAsImage = buildImageFromArrayBuffer({ arrayBuffer: responseImage }) - if (isSetOrg) { this.organizationBackground = arrayBufferAsImage return arrayBufferAsImage @@ -151,52 +153,56 @@ export default { formatPrice, subscribeChanges() { return this.$store.subscribe((mutation, state) => { - if (mutation.type === 'addActionKeyPerformed' && mutation.payload.columnName === 'ProductValue') { + // console.log(mutation.type.length) + if ((mutation.type === 'updateValueOfField' || mutation.type === 'addFocusGained') && mutation.payload.columnName === 'ProductValue') { // cleans all values except column name 'ProductValue' - requestGetProductPrice({ - searchValue: mutation.payload.value - }) - .then(productPrice => { - const { product, taxRate, priceStandard: priceBase } = productPrice - const { rate } = taxRate - const { imageURL: image } = product + this.search = mutation.payload.value + if (this.search.length >= 6) { + requestGetProductPrice({ + searchValue: mutation.payload.value + }) + .then(productPrice => { + const { product, taxRate, priceStandard: priceBase } = productPrice + const { rate } = taxRate + const { imageURL: image } = product - this.productPrice = { - productName: product.name, - productDescription: product.description, - priceBase, - priceStandard: productPrice.priceStandard, - priceList: productPrice.priceList, - priceLimit: productPrice.priceLimit, - taxRate: rate, - image, - taxName: taxRate.name, - taxIndicator: taxRate.taxIndicator, - taxAmt: this.getTaxAmount(priceBase, rate), - grandTotal: this.getGrandTotal(priceBase, rate), - currency: productPrice.currency - } - }) - .catch(error => { - this.$message({ - type: 'info', - message: error.message, - showClose: true + this.productPrice = { + productName: product.name, + productDescription: product.description, + priceBase, + priceStandard: productPrice.priceStandard, + priceList: productPrice.priceList, + priceLimit: productPrice.priceLimit, + taxRate: rate, + image, + taxName: taxRate.name, + taxIndicator: taxRate.taxIndicator, + taxAmt: this.getTaxAmount(priceBase, rate), + grandTotal: this.getGrandTotal(priceBase, rate), + currency: productPrice.currency + } }) - this.productPrice = {} - }) - .finally(() => { - this.$store.commit('updateValueOfField', { - containerUuid: this.containerUuid, - columnName: 'ProductValue', - value: '' + .catch(error => { + this.$message({ + type: 'info', + message: error.message, + showClose: true + }) + this.productPrice = {} }) - - this.currentImageOfProduct = '' - if (this.isEmptyValue(this.productPrice.image)) { - this.getImage(this.productPrice.image) - } - }) + .finally(() => { + this.$store.commit('updateValueOfField', { + containerUuid: this.containerUuid, + columnName: 'ProductValue', + value: '' + }) + this.search = '' + this.currentImageOfProduct = '' + if (this.isEmptyValue(this.productPrice.image)) { + this.getImage(this.productPrice.image) + } + }) + } } }) }, @@ -227,12 +233,12 @@ export default { .product-description { color: #32363a; - font-size: 25px; + font-size: 30px; float: right; padding-bottom: 0px; } .product-price-base, .product-tax { - font-size: 35px; + font-size: 30px; float: right; } .product-price { @@ -250,7 +256,7 @@ export default { } .inquiry-product { position: absolute; - right: 5%; + right: 20%; width: 100%; top: 33%; .amount { diff --git a/src/components/ADempiere/Form/VPOS/KeyLayout/index.vue b/src/components/ADempiere/Form/VPOS/KeyLayout/index.vue index e84af0aa..7804e80e 100644 --- a/src/components/ADempiere/Form/VPOS/KeyLayout/index.vue +++ b/src/components/ADempiere/Form/VPOS/KeyLayout/index.vue @@ -202,8 +202,11 @@ export default { isLoaded: false }) } + // the name of the image plus the height and width of the container is sent requestImage({ - file: fileName + file: fileName, + width: 300, + height: 300 }).then(responseImage => { const arrayBufferAsImage = buildImageFromArrayBuffer({ arrayBuffer: responseImage, diff --git a/src/components/Screenfull/index.vue b/src/components/Screenfull/index.vue index 260c90de..75d41b7a 100644 --- a/src/components/Screenfull/index.vue +++ b/src/components/Screenfull/index.vue @@ -5,43 +5,42 @@