From b159a70832ec5f678a11a3df1f49c27ffa93b75d Mon Sep 17 00:00:00 2001
From: cuiqian2004 <cuiqian2004@163.com>
Date: 星期五, 27 十二月 2024 15:46:16 +0800
Subject: [PATCH] mobox23037 3018 扫码自动跳到下一个输入框

---
 pages/modal/3018_2.vue |   62 ++++++++++++++++++++++++++++++
 1 files changed, 61 insertions(+), 1 deletions(-)

diff --git a/pages/modal/3018_2.vue b/pages/modal/3018_2.vue
index 230a47d..4c59b99 100644
--- a/pages/modal/3018_2.vue
+++ b/pages/modal/3018_2.vue
@@ -695,6 +695,66 @@
 						}
 						this.DataObjRunCustomEvent(info, '');
 					}
+					if (item.value) { //绗竴涓緭鍏ユ涓嶄负绌�+						//鍒濆鍖栵紝涓嬩釜杈撳叆妗唂ocus灞炴�
+						var findd = false
+						for (let i in $this.head_styledef.form.items) {
+							const ele = $this.head_styledef.form.items[i]
+
+							if (ele.name != "Layout") {
+								if (ele.name == 'Input' || ele.name == 'InputNumber') {
+									if (attr == ele.fieldId) {
+										findd = true
+									} else {
+										if (findd) {
+											$this.setData({
+												focusFieldId: ele.fieldId
+											})
+											break
+										}
+
+									}
+
+								}
+							} else {
+								if (findd) {
+									let curIndex = ele.setting.colList.findIndex((col, index2, arr) => {
+										return (col.name == 'Input' || col.name == 'InputNumber');
+									})
+									if (curIndex > -1) {
+										$this.setData({
+											focusFieldId: ele.setting.colList[curIndex]
+												.fieldId
+										})
+										break
+									}
+
+								} else {
+									let curIndex = ele.setting.colList.findIndex((col, index2, arr) => {
+										return attr == col.fieldId;
+									})
+									if (curIndex > -1) {
+										findd = true
+										let curIndex2 = ele.setting.colList.findIndex((col, index2, arr) => {
+											return (col.name == 'Input' || col.name ==
+													'InputNumber') &&
+												index2 >
+												curIndex;
+										})
+										if (curIndex2 > -1) {
+											$this.setData({
+												focusFieldId: ele.setting.colList[curIndex]
+													.fieldId
+											})
+											break
+										}
+									}
+								}
+
+							}
+						}
+					}
+
 				}
 			},
 			onClick(item) {
@@ -734,7 +794,7 @@
 
 			},
 			onchange(item) {
-				// console.log("onchange",item);
+				console.log("onchange", item);
 				if (item.oldvalue != item.value && item.value.trim() != "") {
 					item.oldvalue = item.value;
 					var attr = item.fieldId;

--
Gitblit v1.9.1