From c69b2a0ccd8ed4fe8f11b7bad34bc00b0aa2aaf7 Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期一, 08 七月 2024 15:39:38 +0800
Subject: [PATCH] #

---
 pages/AGV/AGVPakinBing.vue |   33 ++++++++++++++++++++++++++++++---
 1 files changed, 30 insertions(+), 3 deletions(-)

diff --git a/pages/AGV/AGVPakinBing.vue b/pages/AGV/AGVPakinBing.vue
index 88b9c10..7f1848f 100644
--- a/pages/AGV/AGVPakinBing.vue
+++ b/pages/AGV/AGVPakinBing.vue
@@ -8,7 +8,8 @@
 			</view>
 			<view class="item">
 				<view class="code-decs">鏆傚瓨浣�:</view>
-				<input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="stationCode" :focus="matFocus">
+				<input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="stationCode" :focus="stationCodeFocus"
+					@input="stationCodeInput()">
 				<view class="item-right">
 					<button></button>
 					<!-- <text style="text-align: right;color: #409EFF;" @click="selectMat()">鎻愬彇+</text> -->
@@ -142,6 +143,7 @@
 				token: '',
 				barcode: '',
 				stationCode: '',
+				stationCodeFocus: false,
 				dataList: [],
 				count: 0,
 				rowNum: '',
@@ -171,12 +173,28 @@
 				this.msgType1 = type
 				this.$refs.message.open()
 			},
+			stationCodeInput() {
+				setTimeout(() => {
+					var len = this.stationCode.length
+					if (len != 15) {
+						this.stationCode = ''
+						this.stationCodeFocus = true
+						uni.showToast({
+							title: '鏆傚瓨鐮佹湁璇閲嶈瘯',
+							icon: "none",
+							position: 'top'
+						});
+						return;
+					}
+					this.focuss()
+				}, 200)
+			},
 			// barcode input 浜嬩欢
 			barcodeInput() {
 				// 涓嶈缃畾鏃跺櫒 浼氬嚭鐜版壂鍏ョ殑瀛楃涓蹭笉鍏�
 				setTimeout(() => {
 					var len = this.barcode.length
-					if (len != 8) {
+					if (len != 10) {
 						uni.showToast({
 							title: '鎵樼洏鐮佹湁璇閲嶈瘯',
 							icon: "none",
@@ -185,8 +203,16 @@
 						this.barcodeFocuss()
 						return;
 					}
-					this.focuss()
+					this.stationCodeFocuss()
 				}, 200)
+			},
+			// 鏆傚瓨浣嶆湁璇噸缃�
+			stationCodeFocuss() {
+				let that = this;
+				that.stationCodeFocus = false;
+				setTimeout(() => {
+					that.stationCodeFocus = true;
+				}, 100);
 			},
 			// 鎵樼洏鐮佹湁璇噸缃�
 			barcodeFocuss() {
@@ -420,6 +446,7 @@
 			// 纭閲嶇疆
 			resetConfirm() {
 				this.dataList = []
+				this.barcode = ''
 				this.stationCode = ''
 				this.messageText = "閲嶇疆瀹屾垚"
 				this.messageToggle('success')

--
Gitblit v1.9.1