mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-08-10 20:39:48 +08:00
search for the conversion date by the current date (#866)
* search for the conversion date by the current date * search product * remove console.log Co-authored-by: elsiosanchez <elsiossanches@gmail.com>
This commit is contained in:
parent
3476523568
commit
70022f0f61
@ -53,7 +53,6 @@ export default [
|
|||||||
columnName: 'TenderType',
|
columnName: 'TenderType',
|
||||||
isFromDictionary: true,
|
isFromDictionary: true,
|
||||||
overwriteDefinition: {
|
overwriteDefinition: {
|
||||||
defaultValue: 'X',
|
|
||||||
handleActionKeyPerformed: true,
|
handleActionKeyPerformed: true,
|
||||||
handleContentSelection: true,
|
handleContentSelection: true,
|
||||||
handleActionPerformed: true,
|
handleActionPerformed: true,
|
||||||
|
@ -215,7 +215,7 @@ import posMixin from '@/components/ADempiere/Form/VPOS/posMixin.js'
|
|||||||
import fieldsListCollection from './fieldsListCollection.js'
|
import fieldsListCollection from './fieldsListCollection.js'
|
||||||
import typeCollection from '@/components/ADempiere/Form/VPOS/Collection/typeCollection'
|
import typeCollection from '@/components/ADempiere/Form/VPOS/Collection/typeCollection'
|
||||||
import convertAmount from '@/components/ADempiere/Form/VPOS/Collection/convertAmount/index'
|
import convertAmount from '@/components/ADempiere/Form/VPOS/Collection/convertAmount/index'
|
||||||
import { formatDate, formatPrice } from '@/utils/ADempiere/valueFormat.js'
|
import { formatPrice } from '@/utils/ADempiere/valueFormat.js'
|
||||||
import { processOrder } from '@/api/ADempiere/form/point-of-sales.js'
|
import { processOrder } from '@/api/ADempiere/form/point-of-sales.js'
|
||||||
import { FIELDS_DECIMALS } from '@/utils/ADempiere/references'
|
import { FIELDS_DECIMALS } from '@/utils/ADempiere/references'
|
||||||
|
|
||||||
@ -500,6 +500,7 @@ export default {
|
|||||||
this.$store.dispatch('conversionDivideRate', {
|
this.$store.dispatch('conversionDivideRate', {
|
||||||
conversionTypeUuid: this.currentPointOfSales.conversionTypeUuid,
|
conversionTypeUuid: this.currentPointOfSales.conversionTypeUuid,
|
||||||
currencyFromUuid: this.pointOfSalesCurrency.uuid,
|
currencyFromUuid: this.pointOfSalesCurrency.uuid,
|
||||||
|
conversionDate: this.formatDate(new Date()),
|
||||||
currencyToUuid: value
|
currencyToUuid: value
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -541,7 +542,6 @@ export default {
|
|||||||
this.defaultValueCurrency()
|
this.defaultValueCurrency()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
formatDate,
|
|
||||||
formatNumber({ displayType, number }) {
|
formatNumber({ displayType, number }) {
|
||||||
let fixed = 0
|
let fixed = 0
|
||||||
// Amount, Costs+Prices, Number
|
// Amount, Costs+Prices, Number
|
||||||
@ -813,6 +813,18 @@ export default {
|
|||||||
this.$store.dispatch('updatePaymentPos', false)
|
this.$store.dispatch('updatePaymentPos', false)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
formatDate(date) {
|
||||||
|
let month = '' + (date.getMonth() + 1)
|
||||||
|
let day = '' + date.getDate()
|
||||||
|
const year = date.getFullYear()
|
||||||
|
if (month.length < 2) {
|
||||||
|
month = '0' + month
|
||||||
|
}
|
||||||
|
if (day.length < 2) {
|
||||||
|
day = '0' + day
|
||||||
|
}
|
||||||
|
return [year, month, day].join('-')
|
||||||
|
},
|
||||||
subscribeChanges() {
|
subscribeChanges() {
|
||||||
return this.$store.subscribe((mutation, state) => {
|
return this.$store.subscribe((mutation, state) => {
|
||||||
if (mutation.type === 'updateValueOfField') {
|
if (mutation.type === 'updateValueOfField') {
|
||||||
|
@ -173,15 +173,13 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let results = this.listWithPrice
|
let results = this.listWithPrice
|
||||||
if (stringToMatch) {
|
if (!this.isEmptyValue(stringToMatch)) {
|
||||||
const parsedValue = stringToMatch.toLowerCase().trim()
|
const parsedValue = stringToMatch.toLowerCase().trim()
|
||||||
|
|
||||||
results = results.filter(rowProduct => {
|
results = results.filter(rowProduct => {
|
||||||
const productAttributes = rowProduct.product
|
const productAttributes = rowProduct.product
|
||||||
|
|
||||||
for (const columnProductPrice in productAttributes) {
|
for (const columnProductPrice in productAttributes) {
|
||||||
const valueToCompare = String(productAttributes[columnProductPrice]).toLowerCase()
|
const valueToCompare = String(productAttributes[columnProductPrice]).toLowerCase()
|
||||||
|
|
||||||
if (valueToCompare.includes(parsedValue)) {
|
if (valueToCompare.includes(parsedValue)) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
@ -147,18 +147,6 @@ export default {
|
|||||||
return (!isLoaded || isReload) // && this.isShowProductsPriceList
|
return (!isLoaded || isReload) // && this.isShowProductsPriceList
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
|
||||||
isReadyFromGetData(isToLoad) {
|
|
||||||
if (isToLoad) {
|
|
||||||
this.loadProductsPricesList()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// currentPointOfSales(value) {
|
|
||||||
// if (!this.isEmptyValue(value)) {
|
|
||||||
// this.loadProductsPricesList()
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
},
|
|
||||||
created() {
|
created() {
|
||||||
this.unsubscribe = this.subscribeChanges()
|
this.unsubscribe = this.subscribeChanges()
|
||||||
this.$store.commit('setListProductPrice', {
|
this.$store.commit('setListProductPrice', {
|
||||||
|
@ -67,7 +67,7 @@ export default {
|
|||||||
* Search Product
|
* Search Product
|
||||||
*/
|
*/
|
||||||
getProductPrice: (state) => {
|
getProductPrice: (state) => {
|
||||||
if (isEmptyValue(state.productPrice) || !state.productPrice.isLoaded) {
|
if (isEmptyValue(state.productPrice)) {
|
||||||
return {
|
return {
|
||||||
...withoutResponse,
|
...withoutResponse,
|
||||||
productPricesList: []
|
productPricesList: []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user