From 1e40a94e41a811a30b49150b5feabe9b7797948a Mon Sep 17 00:00:00 2001 From: whycq <913841844@qq.com> Date: 星期二, 14 五月 2024 08:23:06 +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