mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-08-12 22:29:59 +08:00
Add Mnemonic Command (#570)
* add comand memo tecnic to table * add product just by clicking on the code * minimal changue * Update fieldsListCollection.js * change columname * remove comment code
This commit is contained in:
parent
c4f3e500d7
commit
b733878474
@ -4,6 +4,7 @@ export default [
|
|||||||
// Amont
|
// Amont
|
||||||
{
|
{
|
||||||
tableName,
|
tableName,
|
||||||
|
elementColumnName: 'PayAmt',
|
||||||
columnName: 'PayAmt',
|
columnName: 'PayAmt',
|
||||||
isFromDictionary: true,
|
isFromDictionary: true,
|
||||||
overwriteDefinition: {
|
overwriteDefinition: {
|
||||||
@ -17,6 +18,7 @@ export default [
|
|||||||
// TenderType
|
// TenderType
|
||||||
{
|
{
|
||||||
tableName,
|
tableName,
|
||||||
|
elementColumnName: 'TenderType',
|
||||||
columnName: 'TenderType',
|
columnName: 'TenderType',
|
||||||
isFromDictionary: true,
|
isFromDictionary: true,
|
||||||
overwriteDefinition: {
|
overwriteDefinition: {
|
||||||
@ -32,6 +34,7 @@ export default [
|
|||||||
// Bank
|
// Bank
|
||||||
{
|
{
|
||||||
tableName,
|
tableName,
|
||||||
|
elementColumnName: 'C_Bank_ID',
|
||||||
columnName: 'C_Bank_ID',
|
columnName: 'C_Bank_ID',
|
||||||
isFromDictionary: true,
|
isFromDictionary: true,
|
||||||
overwriteDefinition: {
|
overwriteDefinition: {
|
||||||
@ -79,6 +82,7 @@ export default [
|
|||||||
// ReferenceNo
|
// ReferenceNo
|
||||||
{
|
{
|
||||||
tableName: 'HR_Attribute',
|
tableName: 'HR_Attribute',
|
||||||
|
elementColumnName: 'ReferenceNo',
|
||||||
columnName: 'ReferenceNo',
|
columnName: 'ReferenceNo',
|
||||||
isFromDictionary: true,
|
isFromDictionary: true,
|
||||||
overwriteDefinition: {
|
overwriteDefinition: {
|
||||||
@ -94,7 +98,8 @@ export default [
|
|||||||
// type credit card
|
// type credit card
|
||||||
{
|
{
|
||||||
tableName,
|
tableName,
|
||||||
columnName: 'creditcardtype',
|
elementColumnName: 'CreditCardType',
|
||||||
|
columnName: 'CreditCardType',
|
||||||
isFromDictionary: true,
|
isFromDictionary: true,
|
||||||
overwriteDefinition: {
|
overwriteDefinition: {
|
||||||
defaultValue: 'M',
|
defaultValue: 'M',
|
||||||
@ -110,7 +115,8 @@ export default [
|
|||||||
// number credit card
|
// number credit card
|
||||||
{
|
{
|
||||||
tableName,
|
tableName,
|
||||||
columnName: 'creditcardnumber',
|
elementColumnName: 'CreditCardNumber',
|
||||||
|
columnName: 'CreditCardNumber',
|
||||||
isFromDictionary: true,
|
isFromDictionary: true,
|
||||||
overwriteDefinition: {
|
overwriteDefinition: {
|
||||||
handleActionKeyPerformed: true,
|
handleActionKeyPerformed: true,
|
||||||
@ -125,7 +131,8 @@ export default [
|
|||||||
// accountno
|
// accountno
|
||||||
{
|
{
|
||||||
tableName,
|
tableName,
|
||||||
columnName: 'accountno',
|
elementColumnName: 'AccountNo',
|
||||||
|
columnName: 'AccountNo',
|
||||||
isFromDictionary: true,
|
isFromDictionary: true,
|
||||||
overwriteDefinition: {
|
overwriteDefinition: {
|
||||||
handleActionKeyPerformed: true,
|
handleActionKeyPerformed: true,
|
||||||
|
@ -7,6 +7,7 @@ export default [
|
|||||||
overwriteDefinition: {
|
overwriteDefinition: {
|
||||||
size: 24,
|
size: 24,
|
||||||
sequence: 10,
|
sequence: 10,
|
||||||
|
handleActionPerformed: true,
|
||||||
handleActionKeyPerformed: true
|
handleActionKeyPerformed: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -50,12 +50,14 @@
|
|||||||
<el-main style="padding-top: 0px; padding-right: 10px; padding-bottom: 0px; padding-left: 10px;">
|
<el-main style="padding-top: 0px; padding-right: 10px; padding-bottom: 0px; padding-left: 10px;">
|
||||||
<el-table
|
<el-table
|
||||||
ref="linesTable"
|
ref="linesTable"
|
||||||
|
v-shortkey="shortsKey"
|
||||||
:data="allOrderLines"
|
:data="allOrderLines"
|
||||||
border
|
border
|
||||||
style="width: 100%; max-width: 100%; background-color: #FFFFFF; font-size: 14px; overflow: auto; color: #606266;"
|
style="width: 100%; max-width: 100%; background-color: #FFFFFF; font-size: 14px; overflow: auto; color: #606266;"
|
||||||
highlight-current-row
|
highlight-current-row
|
||||||
fit
|
fit
|
||||||
@current-change="handleCurrentLineChange"
|
@current-change="handleCurrentLineChange"
|
||||||
|
@shortkey.native="shortcutKeyMethod"
|
||||||
>
|
>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-for="(valueOrder, item, key) in orderLineDefinition"
|
v-for="(valueOrder, item, key) in orderLineDefinition"
|
||||||
@ -240,19 +242,19 @@
|
|||||||
</b>
|
</b>
|
||||||
<b style="float: right;">
|
<b style="float: right;">
|
||||||
<el-popover
|
<el-popover
|
||||||
|
:v-model="seeConversion"
|
||||||
placement="top-start"
|
placement="top-start"
|
||||||
trigger="click"
|
|
||||||
>
|
>
|
||||||
<convert-amount
|
<convert-amount
|
||||||
|
v-show="seeConversion"
|
||||||
:convert="multiplyRate"
|
:convert="multiplyRate"
|
||||||
:amount="order.grandTotal"
|
:amount="order.grandTotal"
|
||||||
:currency="currencyPoint"
|
:currency="currencyPoint"
|
||||||
/>
|
/>
|
||||||
<el-button slot="reference" type="text" style="color: #000000;font-weight: 604!important;font-size: 100%;">
|
<el-button slot="reference" type="text" style="color: #000000;font-weight: 604!important;font-size: 100%;" @click="seeConversion = !seeConversion">
|
||||||
{{ formatPrice(order.grandTotal, currencyPoint.iSOCode) }}
|
{{ formatPrice(order.grandTotal, currencyPoint.iSOCode) }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
<!-- {{ formatPrice(order.grandTotal, currencyPoint.iSOCode) }} -->
|
|
||||||
</b>
|
</b>
|
||||||
</p>
|
</p>
|
||||||
</span>
|
</span>
|
||||||
@ -324,10 +326,16 @@ export default {
|
|||||||
],
|
],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
fieldsList: fieldsListOrder
|
fieldsList: fieldsListOrder,
|
||||||
|
seeConversion: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
shortsKey() {
|
||||||
|
return {
|
||||||
|
popoverConvet: ['ctrl', 'x']
|
||||||
|
}
|
||||||
|
},
|
||||||
isShowedPOSKeyLayout: {
|
isShowedPOSKeyLayout: {
|
||||||
get() {
|
get() {
|
||||||
return this.$store.getters.getShowPOSKeyLayout
|
return this.$store.getters.getShowPOSKeyLayout
|
||||||
@ -484,6 +492,11 @@ export default {
|
|||||||
|
|
||||||
this.$store.dispatch('listOrderLine', [])
|
this.$store.dispatch('listOrderLine', [])
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
open() {
|
||||||
|
if (!this.seeConversion) {
|
||||||
|
this.seeConversion = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -637,4 +650,11 @@ export default {
|
|||||||
float: right;
|
float: right;
|
||||||
padding-left: 9px;
|
padding-left: 9px;
|
||||||
}
|
}
|
||||||
|
.transition-box {
|
||||||
|
z-index: 1;
|
||||||
|
width: auto;
|
||||||
|
position: fixed;
|
||||||
|
bottom: 5%;
|
||||||
|
right: 5%;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -6,7 +6,8 @@ export default [
|
|||||||
isFromDictionary: true,
|
isFromDictionary: true,
|
||||||
overwriteDefinition: {
|
overwriteDefinition: {
|
||||||
size: 24,
|
size: 24,
|
||||||
sequence: 10
|
sequence: 10,
|
||||||
|
handleActionKeyPerformed: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
style="width: 100%;"
|
style="width: 100%;"
|
||||||
popper-class="custom-field-prodcut-info"
|
popper-class="custom-field-prodcut-info"
|
||||||
:fetch-suggestions="localSearch"
|
:fetch-suggestions="localSearch"
|
||||||
|
:select-when-unmatched="true"
|
||||||
@shortkey.native="shortcutKeyMethod"
|
@shortkey.native="shortcutKeyMethod"
|
||||||
@select="handleSelect"
|
@select="handleSelect"
|
||||||
>
|
>
|
||||||
@ -216,7 +217,7 @@ export default {
|
|||||||
callBack(results)
|
callBack(results)
|
||||||
},
|
},
|
||||||
handleSelect(elementSelected) {
|
handleSelect(elementSelected) {
|
||||||
const valueProduct = elementSelected.product.value
|
const valueProduct = this.isEmptyValue(elementSelected.product) ? elementSelected.value : elementSelected.product.value
|
||||||
this.$store.dispatch('notifyActionKeyPerformed', {
|
this.$store.dispatch('notifyActionKeyPerformed', {
|
||||||
containerUuid: 'POS',
|
containerUuid: 'POS',
|
||||||
columnName: 'ProductValue',
|
columnName: 'ProductValue',
|
||||||
|
@ -2,7 +2,8 @@ import {
|
|||||||
findProduct,
|
findProduct,
|
||||||
requestCreateOrder,
|
requestCreateOrder,
|
||||||
requestGetOrder,
|
requestGetOrder,
|
||||||
requestUpdateOrder
|
requestUpdateOrder,
|
||||||
|
requestUpdateOrderLine
|
||||||
} from '@/api/ADempiere/form/point-of-sales.js'
|
} from '@/api/ADempiere/form/point-of-sales.js'
|
||||||
import {
|
import {
|
||||||
formatDate,
|
formatDate,
|
||||||
@ -440,6 +441,64 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
mas() {
|
||||||
|
this.$refs.linesTable.setCurrentRow(this.listOrderLine[1])
|
||||||
|
},
|
||||||
|
menos() {
|
||||||
|
this.$refs.linesTable.setCurrentRow(this.listOrderLine[0])
|
||||||
|
},
|
||||||
|
shortcutKeyMethod(event) {
|
||||||
|
console.log(event.srcKey)
|
||||||
|
switch (event.srcKey) {
|
||||||
|
// case 'options':
|
||||||
|
case 'up':
|
||||||
|
this.arrowTop()
|
||||||
|
break
|
||||||
|
case 'popoverConvet':
|
||||||
|
this.seeConversion = !this.seeConversion
|
||||||
|
break
|
||||||
|
case 'down':
|
||||||
|
this.arrowBottom()
|
||||||
|
break
|
||||||
|
case 'plus':
|
||||||
|
requestUpdateOrderLine({
|
||||||
|
orderLineUuid: this.currentOrderLine.uuid,
|
||||||
|
quantity: this.listOrderLine[this.currentTable].quantity + 1
|
||||||
|
})
|
||||||
|
.then(response => {
|
||||||
|
this.fillOrderLine(response)
|
||||||
|
this.reloadOrder(true)
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error(error.message)
|
||||||
|
this.$message({
|
||||||
|
type: 'error',
|
||||||
|
message: error.message,
|
||||||
|
showClose: true
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
break
|
||||||
|
case 'minus':
|
||||||
|
requestUpdateOrderLine({
|
||||||
|
orderLineUuid: this.currentOrderLine.uuid,
|
||||||
|
quantity: this.listOrderLine[this.currentTable].quantity - 1
|
||||||
|
})
|
||||||
|
.then(response => {
|
||||||
|
this.fillOrderLine(response)
|
||||||
|
this.reloadOrder(true)
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error(error.message)
|
||||||
|
this.$message({
|
||||||
|
type: 'error',
|
||||||
|
message: error.message,
|
||||||
|
showClose: true
|
||||||
|
})
|
||||||
|
})
|
||||||
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user