From 8f30705c799489ea3c41a892cef2587094c5ddef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E5=9C=A3=E5=8D=8E?= <752718920@qq.com> Date: Fri, 29 Oct 2021 00:27:11 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=99=E6=96=87=E6=9C=AC=E6=A1=86=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=9B=9E=E8=BD=A6=E8=B7=B3=E8=BD=AC=E4=B8=8B=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E7=9A=84=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jshERP-web/src/utils/util.js | 25 ++ .../views/bill/modules/PurchaseInModal.vue | 7 +- .../views/material/modules/MaterialModal.vue | 8 +- .../src/views/system/modules/AccountModal.vue | 4 +- .../views/system/modules/CustomerModal.vue | 4 +- .../src/views/system/modules/DepotModal.vue | 4 +- .../views/system/modules/FunctionModal.vue | 4 +- .../views/system/modules/InOutItemModal.vue | 4 +- .../src/views/system/modules/MemberModal.vue | 4 +- .../system/modules/OrganizationModal.vue | 4 +- .../views/system/modules/PasswordModal.vue | 283 +++++++++--------- .../src/views/system/modules/PersonModal.vue | 4 +- .../src/views/system/modules/RoleModal.vue | 4 +- .../system/modules/SystemConfigModal.vue | 4 +- .../src/views/system/modules/UnitModal.vue | 4 +- .../src/views/system/modules/UserModal.vue | 4 +- .../src/views/system/modules/VendorModal.vue | 4 +- 17 files changed, 216 insertions(+), 159 deletions(-) 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 @@