diff --git a/jshERP-web/src/utils/util.js b/jshERP-web/src/utils/util.js index d1c7d753..f2e816d9 100644 --- a/jshERP-web/src/utils/util.js +++ b/jshERP-web/src/utils/util.js @@ -684,4 +684,29 @@ export function handleIntroJs(module, cur_version) { //点击结束按钮后, 执行的事件 Vue.ls.set('intro_cache_' + module, cur_version, 100 * 24 * 60 * 60 * 1000); }).start() +} + +/** + * 回车后自动跳到下一个input + */ +export function autoJumpNextInput(domInfo) { + let domIndex = 0 + let inputs = document.getElementById(domInfo).getElementsByTagName('input') + inputs[domIndex].focus() + document.getElementById(domInfo).addEventListener('keydown',function(e){ + if(e.keyCode === 13){ + domIndex++ + if(domIndex === inputs.length) { + domIndex = 0 + } + inputs[domIndex].focus() + } + }) + for(let i=0; i - { + autoJumpNextInput('purchaseInModal') + }) //复制新增单据-初始化单号和日期 if(this.action === 'copyAdd') { this.model.id = '' diff --git a/jshERP-web/src/views/material/modules/MaterialModal.vue b/jshERP-web/src/views/material/modules/MaterialModal.vue index 88378f98..7f1cd91a 100644 --- a/jshERP-web/src/views/material/modules/MaterialModal.vue +++ b/jshERP-web/src/views/material/modules/MaterialModal.vue @@ -18,7 +18,7 @@ - + @@ -167,7 +167,7 @@ -
+
{ this.form.setFieldsValue(pick(this.model, 'name', 'standard', 'unit', 'unitId', 'model', 'color', 'categoryId','enableSerialNumber','enableBatchNumber','expiryNum','safetyStock','remark','mfrs','otherField1','otherField2','otherField3')) + autoJumpNextInput('materialHeadModal') + autoJumpNextInput('materialDetailModal') }); this.initMaterialAttribute() // 加载子表数据 diff --git a/jshERP-web/src/views/system/modules/AccountModal.vue b/jshERP-web/src/views/system/modules/AccountModal.vue index e0e7926b..ff193e62 100644 --- a/jshERP-web/src/views/system/modules/AccountModal.vue +++ b/jshERP-web/src/views/system/modules/AccountModal.vue @@ -15,7 +15,7 @@ - + @@ -38,6 +38,7 @@ \ No newline at end of file diff --git a/jshERP-web/src/views/system/modules/PersonModal.vue b/jshERP-web/src/views/system/modules/PersonModal.vue index ee6fcc35..7341ec5b 100644 --- a/jshERP-web/src/views/system/modules/PersonModal.vue +++ b/jshERP-web/src/views/system/modules/PersonModal.vue @@ -15,7 +15,7 @@ - + @@ -33,6 +33,7 @@