mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-08-10 12:01:57 +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
|
||||
{
|
||||
tableName,
|
||||
elementColumnName: 'PayAmt',
|
||||
columnName: 'PayAmt',
|
||||
isFromDictionary: true,
|
||||
overwriteDefinition: {
|
||||
@ -17,6 +18,7 @@ export default [
|
||||
// TenderType
|
||||
{
|
||||
tableName,
|
||||
elementColumnName: 'TenderType',
|
||||
columnName: 'TenderType',
|
||||
isFromDictionary: true,
|
||||
overwriteDefinition: {
|
||||
@ -32,6 +34,7 @@ export default [
|
||||
// Bank
|
||||
{
|
||||
tableName,
|
||||
elementColumnName: 'C_Bank_ID',
|
||||
columnName: 'C_Bank_ID',
|
||||
isFromDictionary: true,
|
||||
overwriteDefinition: {
|
||||
@ -79,6 +82,7 @@ export default [
|
||||
// ReferenceNo
|
||||
{
|
||||
tableName: 'HR_Attribute',
|
||||
elementColumnName: 'ReferenceNo',
|
||||
columnName: 'ReferenceNo',
|
||||
isFromDictionary: true,
|
||||
overwriteDefinition: {
|
||||
@ -94,7 +98,8 @@ export default [
|
||||
// type credit card
|
||||
{
|
||||
tableName,
|
||||
columnName: 'creditcardtype',
|
||||
elementColumnName: 'CreditCardType',
|
||||
columnName: 'CreditCardType',
|
||||
isFromDictionary: true,
|
||||
overwriteDefinition: {
|
||||
defaultValue: 'M',
|
||||
@ -110,7 +115,8 @@ export default [
|
||||
// number credit card
|
||||
{
|
||||
tableName,
|
||||
columnName: 'creditcardnumber',
|
||||
elementColumnName: 'CreditCardNumber',
|
||||
columnName: 'CreditCardNumber',
|
||||
isFromDictionary: true,
|
||||
overwriteDefinition: {
|
||||
handleActionKeyPerformed: true,
|
||||
@ -125,7 +131,8 @@ export default [
|
||||
// accountno
|
||||
{
|
||||
tableName,
|
||||
columnName: 'accountno',
|
||||
elementColumnName: 'AccountNo',
|
||||
columnName: 'AccountNo',
|
||||
isFromDictionary: true,
|
||||
overwriteDefinition: {
|
||||
handleActionKeyPerformed: true,
|
||||
|
@ -7,6 +7,7 @@ export default [
|
||||
overwriteDefinition: {
|
||||
size: 24,
|
||||
sequence: 10,
|
||||
handleActionPerformed: true,
|
||||
handleActionKeyPerformed: true
|
||||
}
|
||||
},
|
||||
|
@ -50,12 +50,14 @@
|
||||
<el-main style="padding-top: 0px; padding-right: 10px; padding-bottom: 0px; padding-left: 10px;">
|
||||
<el-table
|
||||
ref="linesTable"
|
||||
v-shortkey="shortsKey"
|
||||
:data="allOrderLines"
|
||||
border
|
||||
style="width: 100%; max-width: 100%; background-color: #FFFFFF; font-size: 14px; overflow: auto; color: #606266;"
|
||||
highlight-current-row
|
||||
fit
|
||||
@current-change="handleCurrentLineChange"
|
||||
@shortkey.native="shortcutKeyMethod"
|
||||
>
|
||||
<el-table-column
|
||||
v-for="(valueOrder, item, key) in orderLineDefinition"
|
||||
@ -240,19 +242,19 @@
|
||||
</b>
|
||||
<b style="float: right;">
|
||||
<el-popover
|
||||
:v-model="seeConversion"
|
||||
placement="top-start"
|
||||
trigger="click"
|
||||
>
|
||||
<convert-amount
|
||||
v-show="seeConversion"
|
||||
:convert="multiplyRate"
|
||||
:amount="order.grandTotal"
|
||||
: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) }}
|
||||
</el-button>
|
||||
</el-popover>
|
||||
<!-- {{ formatPrice(order.grandTotal, currencyPoint.iSOCode) }} -->
|
||||
</b>
|
||||
</p>
|
||||
</span>
|
||||
@ -324,10 +326,16 @@ export default {
|
||||
],
|
||||
data() {
|
||||
return {
|
||||
fieldsList: fieldsListOrder
|
||||
fieldsList: fieldsListOrder,
|
||||
seeConversion: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
shortsKey() {
|
||||
return {
|
||||
popoverConvet: ['ctrl', 'x']
|
||||
}
|
||||
},
|
||||
isShowedPOSKeyLayout: {
|
||||
get() {
|
||||
return this.$store.getters.getShowPOSKeyLayout
|
||||
@ -484,6 +492,11 @@ export default {
|
||||
|
||||
this.$store.dispatch('listOrderLine', [])
|
||||
})
|
||||
},
|
||||
open() {
|
||||
if (!this.seeConversion) {
|
||||
this.seeConversion = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -637,4 +650,11 @@ export default {
|
||||
float: right;
|
||||
padding-left: 9px;
|
||||
}
|
||||
.transition-box {
|
||||
z-index: 1;
|
||||
width: auto;
|
||||
position: fixed;
|
||||
bottom: 5%;
|
||||
right: 5%;
|
||||
}
|
||||
</style>
|
||||
|
@ -6,7 +6,8 @@ export default [
|
||||
isFromDictionary: true,
|
||||
overwriteDefinition: {
|
||||
size: 24,
|
||||
sequence: 10
|
||||
sequence: 10,
|
||||
handleActionKeyPerformed: true
|
||||
}
|
||||
}
|
||||
]
|
||||
|
@ -28,6 +28,7 @@
|
||||
style="width: 100%;"
|
||||
popper-class="custom-field-prodcut-info"
|
||||
:fetch-suggestions="localSearch"
|
||||
:select-when-unmatched="true"
|
||||
@shortkey.native="shortcutKeyMethod"
|
||||
@select="handleSelect"
|
||||
>
|
||||
@ -216,7 +217,7 @@ export default {
|
||||
callBack(results)
|
||||
},
|
||||
handleSelect(elementSelected) {
|
||||
const valueProduct = elementSelected.product.value
|
||||
const valueProduct = this.isEmptyValue(elementSelected.product) ? elementSelected.value : elementSelected.product.value
|
||||
this.$store.dispatch('notifyActionKeyPerformed', {
|
||||
containerUuid: 'POS',
|
||||
columnName: 'ProductValue',
|
||||
|
@ -2,7 +2,8 @@ import {
|
||||
findProduct,
|
||||
requestCreateOrder,
|
||||
requestGetOrder,
|
||||
requestUpdateOrder
|
||||
requestUpdateOrder,
|
||||
requestUpdateOrderLine
|
||||
} from '@/api/ADempiere/form/point-of-sales.js'
|
||||
import {
|
||||
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