From eaf097eeef67ebaaf46777269128e65f820e31fc Mon Sep 17 00:00:00 2001
From: wankeda <Administrator@DESKTOP-HAU3ST3>
Date: 星期四, 22 一月 2026 15:42:46 +0800
Subject: [PATCH] 1

---
 吉安PDA/pages/stash/Syncretism.vue |   33 ++++++++++++++++++++++-----------
 1 files changed, 22 insertions(+), 11 deletions(-)

diff --git "a/\345\220\211\345\256\211PDA/pages/stash/Syncretism.vue" "b/\345\220\211\345\256\211PDA/pages/stash/Syncretism.vue"
index 0424b2f..cf5f238 100644
--- "a/\345\220\211\345\256\211PDA/pages/stash/Syncretism.vue"
+++ "b/\345\220\211\345\256\211PDA/pages/stash/Syncretism.vue"
@@ -3,11 +3,11 @@
 		<view class="itemstyle">
 			<uni-forms label-width="180">
 				<uni-forms-item label="鍘熷鎵樼洏鏉$爜:">
-					<uni-easyinput type="text" placeholder="璇锋壂鎻忔墭鐩樻潯鐮�" ref='midInput' :focus="!focus"
+					<uni-easyinput type="text" placeholder="璇锋壂鎻忔墭鐩樻潯鐮�" ref='midInput' :focus="sourceFocus"
 						v-model="soussAddress" @input="barcodeInput" />
 				</uni-forms-item>
 				<uni-forms-item label="鐩爣鎵樼洏鏉$爜:">
-					<uni-easyinput type="text" placeholder="璇锋壂鎻忔墭鐩樻潯鐮�" ref='midInput' :focus="!focus"
+					<uni-easyinput type="text" placeholder="璇锋壂鎻忔墭鐩樻潯鐮�" ref='midInput' :focus="targetFocus"
 						v-model="targetAddress" @input="barcodeInput" />
 				</uni-forms-item>
 				<uni-forms-item>
@@ -20,28 +20,29 @@
 </template>
 
 <script>
-	const innerAudioContext = uni.createInnerAudioContext();
 	export default {
 		data() {
 			return {
-				focus: false,
+				sourceFocus: true, // 榛樿鍘熷鎵樼洏杈撳叆妗嗚幏寰楃劍鐐�
+				targetFocus: false, // 鐩爣鎵樼洏杈撳叆妗嗕笉鑾峰緱鐒︾偣
 				soussAddress: "",
 				targetAddress: "",
 				warehouseId: "",
 			}
 		},
-		onShow() {},
 		onLoad(res) {
-			this.focus = false;
 			this.warehouseId = res.warehouseId;
 		},
 		methods: {
-			barcodeInput() {
-				this.$nextTick(function(x) {
-					if (this.barcode.length > 0) {
-						this.focus = true;
+			barcodeInput(type) {
+				if (type != '') {
+					if (this.soussAddress == "") {
+						setTimeout(() => {
+							this.sourceFocus = false;
+							this.targetFocus = true;
+						}, 100);
 					}
-				})
+				}
 			},
 			AGVTasks() {
 				if (this.soussAddress == "") {
@@ -49,6 +50,8 @@
 						title: "璇锋壂鎻忓師濮嬫墭鐩樻潯鐮�",
 						type: 'error'
 					})
+					this.sourceFocus = true;
+					this.targetFocus = false;
 					return;
 				}
 				if (this.targetAddress == "") {
@@ -56,8 +59,11 @@
 						title: "璇锋壂鎻忕洰鏍囨墭鐩樻潯鐮�",
 						type: 'error'
 					})
+					this.sourceFocus = false;
+					this.targetFocus = true;
 					return;
 				}
+
 				var postDate = {
 					MainData: {
 						soussAddress: this.soussAddress,
@@ -74,11 +80,16 @@
 							})
 							this.soussAddress = "";
 							this.targetAddress = "";
+							this.sourceFocus = true;
+							this.targetFocus = false;
 						} else {
 							this.$refs.uToast.show({
 								title: res.message,
 								type: "error"
 							})
+							
+							this.sourceFocus = true;
+							this.targetFocus = false;
 						}
 					})
 			},

--
Gitblit v1.9.3