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

This commit is contained in:
jishenghua
2024-11-13 00:14:00 +08:00
parent c415f0265f
commit 92a2023bc3
7 changed files with 27 additions and 6 deletions

View File

@@ -46,12 +46,27 @@ export const FinancialModalMixin = {
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) {