给业务单据的保存增加快捷键

This commit is contained in:
jishenghua
2024-11-13 00:03:53 +08:00
parent d80d3b0fc4
commit c38bb01dfb
16 changed files with 47 additions and 16 deletions

View File

@@ -78,12 +78,27 @@ export const BillModalMixin = {
this.width = realScreenWidth<1500?'1200px':'1550px'
this.minWidth = realScreenWidth<1500?1150:1500
},
mounted() {
document.getElementById(this.prefixNo).addEventListener('keydown', this.handleOkKey)
},
beforeDestroy() {
document.getElementById(this.prefixNo).removeEventListener('keydown', this.handleOkKey)
},
computed: {
readOnly: function() {
return this.action !== "add" && this.action !== "edit";
}
},
methods: {
// 快捷键
handleOkKey(e) {
const key = window.event.keyCode ? window.event.keyCode : window.event.which
if (key === 83 && e.ctrlKey) {
//保存 CTRL+S
this.handleOk()
e.preventDefault()
}
},
addInit(amountNum) {
getAction('/sequence/buildNumber').then((res) => {
if (res && res.code === 200) {