mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-08-12 22:29:59 +08:00
price query search (#565)
This commit is contained in:
parent
986c206073
commit
4716f3d7f7
@ -171,7 +171,7 @@ export default {
|
|||||||
formatPrice,
|
formatPrice,
|
||||||
subscribeChanges() {
|
subscribeChanges() {
|
||||||
return this.$store.subscribe((mutation, state) => {
|
return this.$store.subscribe((mutation, state) => {
|
||||||
if ((mutation.type === 'updateValueOfField' || mutation.type === 'addActionKeyPerformed') && mutation.payload.columnName === 'ProductValue') {
|
if ((mutation.type === 'addActionKeyPerformed') && mutation.payload.columnName === 'ProductValue') {
|
||||||
// cleans all values except column name 'ProductValue'
|
// cleans all values except column name 'ProductValue'
|
||||||
this.search = mutation.payload.value
|
this.search = mutation.payload.value
|
||||||
if (!this.isEmptyValue(this.search) && this.search.length >= 4) {
|
if (!this.isEmptyValue(this.search) && this.search.length >= 4) {
|
||||||
@ -223,6 +223,57 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
} else if ((mutation.type === 'updateValueOfField') && (mutation.payload.columnName === 'ProductValue') && !this.isEmptyValue(mutation.payload.value)) {
|
||||||
|
clearTimeout(this.timeOut)
|
||||||
|
this.timeOut = setTimeout(() => {
|
||||||
|
requestGetProductPrice({
|
||||||
|
searchValue: mutation.payload.value
|
||||||
|
})
|
||||||
|
.then(productPrice => {
|
||||||
|
this.messageError = true
|
||||||
|
const { product, taxRate, priceStandard: priceBase } = productPrice
|
||||||
|
const { rate } = taxRate
|
||||||
|
const { imageURL: image } = product
|
||||||
|
|
||||||
|
this.productPrice = {
|
||||||
|
currency: productPrice.currency,
|
||||||
|
image,
|
||||||
|
grandTotal: this.getGrandTotal(priceBase, rate),
|
||||||
|
productName: product.name,
|
||||||
|
productDescription: product.description,
|
||||||
|
priceBase,
|
||||||
|
priceStandard: productPrice.priceStandard,
|
||||||
|
priceList: productPrice.priceList,
|
||||||
|
priceLimit: productPrice.priceLimit,
|
||||||
|
schemaCurrency: productPrice.schemaCurrency,
|
||||||
|
schemaGrandTotal: this.getGrandTotal(productPrice.schemaPriceStandard, rate),
|
||||||
|
schemaPriceStandard: productPrice.schemaPriceStandard,
|
||||||
|
schemaPriceList: productPrice.schemaPriceList,
|
||||||
|
schemaPriceLimit: productPrice.schemaPriceLimit,
|
||||||
|
taxRate: rate,
|
||||||
|
taxName: taxRate.name,
|
||||||
|
taxIndicator: taxRate.taxIndicator,
|
||||||
|
taxAmt: this.getTaxAmount(priceBase, rate)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.messageError = false
|
||||||
|
this.timeMessage()
|
||||||
|
this.productPrice = {}
|
||||||
|
})
|
||||||
|
.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)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}, 500)
|
||||||
}
|
}
|
||||||
if (mutation.type === 'changeFormAttribute') {
|
if (mutation.type === 'changeFormAttribute') {
|
||||||
this.focusProductValue()
|
this.focusProductValue()
|
||||||
|
@ -86,7 +86,7 @@
|
|||||||
<el-popover
|
<el-popover
|
||||||
placement="right"
|
placement="right"
|
||||||
trigger="click"
|
trigger="click"
|
||||||
:title="$t('form.pos.product.productInformation')"
|
:title="$t('form.productInfo.productInformation')"
|
||||||
>
|
>
|
||||||
<el-form
|
<el-form
|
||||||
label-position="top"
|
label-position="top"
|
||||||
@ -106,26 +106,26 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="10">
|
<el-col :span="10">
|
||||||
{{ $t('form.pos.product.code') }}: <b>{{ currentOrderLine.product.value }}</b><br>
|
{{ $t('form.productInfo.code') }}: <b>{{ currentOrderLine.product.value }}</b><br>
|
||||||
{{ $t('form.pos.product.name') }}: <b>{{ currentOrderLine.product.name }}</b><br>
|
{{ $t('form.productInfo.name') }}: <b>{{ currentOrderLine.product.name }}</b><br>
|
||||||
{{ $t('form.pos.product.description') }}: <b>{{ currentOrderLine.product.description }}</b><br>
|
{{ $t('form.productInfo.description') }}: <b>{{ currentOrderLine.product.description }}</b><br>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="10">
|
<el-col :span="10">
|
||||||
<div style="float: right">
|
<div style="float: right">
|
||||||
{{ $t('form.pos.product.price') }}:
|
{{ $t('form.productInfo.price') }}:
|
||||||
<b>{{ formatPrice(currentOrderLine.product.priceStandard, currencyPoint.iSOCode) }}</b>
|
<b>{{ formatPrice(currentOrderLine.product.priceStandard, currencyPoint.iSOCode) }}</b>
|
||||||
<br>
|
<br>
|
||||||
{{ $t('form.pos.product.taxRate') }}:
|
{{ $t('form.productInfo.taxAmount') }}:
|
||||||
<b>{{ currentOrderLine.taxIndicator }}</b>
|
<b>{{ currentOrderLine.taxIndicator }}</b>
|
||||||
<br>
|
<br>
|
||||||
{{ $t('form.pos.product.quantityAvailable') }}:
|
{{ $t('form.productInfo.quantityAvailable') }}:
|
||||||
<b>{{ formatQuantity(currentOrderLine.quantityOrdered) }}</b>
|
<b>{{ formatQuantity(currentOrderLine.quantityOrdered) }}</b>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-button slot="reference" type="text">
|
<el-button slot="reference" type="text">
|
||||||
{{ $t('form.pos.product.productInformation') }}
|
{{ $t('form.productInfo.productInformation') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
|
@ -17,7 +17,7 @@ export default {
|
|||||||
},
|
},
|
||||||
currentPrice: {
|
currentPrice: {
|
||||||
columnName: 'CurrentPrice',
|
columnName: 'CurrentPrice',
|
||||||
label: this.$t('form.pos.product.price'),
|
label: this.$t('form.productInfo.price'),
|
||||||
isNumeric: true
|
isNumeric: true
|
||||||
},
|
},
|
||||||
quantityOrdered: {
|
quantityOrdered: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user