From b5390b1f1254d1a286a78c3d22da0366b3a27096 Mon Sep 17 00:00:00 2001
From: zwl <1051256694@qq.com>
Date: 星期一, 08 十二月 2025 10:12:07 +0800
Subject: [PATCH] #

---
 pages/AGV/AGVStart-return.vue |  187 ++++------------------------------------------
 1 files changed, 19 insertions(+), 168 deletions(-)

diff --git a/pages/AGV/AGVStart-return.vue b/pages/AGV/AGVStart-return.vue
index a91d933..65080ee 100644
--- a/pages/AGV/AGVStart-return.vue
+++ b/pages/AGV/AGVStart-return.vue
@@ -1,13 +1,14 @@
 <template>
 	<view>
-		<view class="code">			
+		<view class="code">		
+			<view class="item">
+				<view class="code-decs">鎵樼洏鐮�:</view>
+				<input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="barcode" :focus="barcodeFocus"
+				@input="barcodeInput()">
+			</view>
 			<view class="item">
 				<view class="code-decs">婧愮珯鐐�:</view>
 				<input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="stationCode" :focus="stationCodeFocus">
-			</view>
-			<view class="item">
-				<view class="code-decs">鎵樼洏鐮�:</view>
-				<input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="sta" :focus="stationCodeFocus">
 			</view>
 		</view>
 		
@@ -107,7 +108,7 @@
 				token: '',
 				barcode: '',
 				stationCode: '',
-				stationCodeFocus: true,
+				stationCodeFocus: false,
 				dataList: [],
 				count: 0,
 				rowNum: '',
@@ -238,165 +239,12 @@
 			// 鍟嗗搧鍏夋爣娓呯┖閲嶇疆
 			focuss() {
 				this.focus = false;
+				this.stationCodeFocus = false;
+				this.barcodeFocus =false;
 				setTimeout(() => {
-					this.matnr = '';
-					this.matFocus = true;
+					this.sta = '';
+					this.stationCodeFocus = true;
 				}, 100);
-			},
-			// 鎼滅储鐗╂枡
-			findMat() {
-				let that = this
-				uni.request({
-					url: that.baseUrl + '/mat/auth',
-					data: {
-						matnr: that.matnr
-					},
-					header: {
-						'token': uni.getStorageSync('token')
-					},
-					success(result) {
-						result = result.data
-						if (result.code === 200 && result.data) {
-							that.matData = result.data
-							that.matnr = ''
-							that.matData['batch'] = ''
-							uni.navigateTo({
-								url: "../mat/matSelected",
-								// 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�
-								success: function(res) {
-									res.eventChannel.emit('mat', {
-										data: result.data
-									})
-								},
-								// 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹�
-								events: {
-									matList: function(data) {
-										that.checkMat(data.data)
-										that.focuss()
-									},
-								},
-							});
-						} else if (res.code == 403) {
-							uni.showToast({
-								title: res.msg,
-								icon: "none",
-								position: 'top'
-							})
-							setTimeout(() => {
-								uni.reLaunch({
-									url: '../login/login'
-								});
-							}, 1000);
-						} else {
-							uni.showToast({
-								title: res.msg,
-								icon: "none",
-								position: 'top'
-							})
-						}
-
-					}
-				});
-
-			},
-			selectMat() {
-				let that = this
-				uni.navigateTo({
-					url: "../mat/matQuery",
-					success: function(res) {
-						// 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�   鍚戝彟澶栦竴涓〉闈紶閫掑�肩殑
-						res.eventChannel.emit('commonUrl', {
-							commonUrl: ''
-						})
-					},
-					events: {
-						// 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹�  鍙﹀涓�涓〉闈紶杩囨潵鐨�
-						acceptDataFromOpenedPage: function(data) {
-							that.matnr = data.data
-							that.findMat(that.matnr)
-						},
-					},
-
-
-				});
-				that.matnr = ''
-			},
-			checkMat(mat) {
-				var len = this.dataList.length
-				var add = true ,sameItem = false
-				for (var i = 0; i < len; i++) {
-					if (mat.matnr == this.dataList[i].matnr) {
-						for (var j = 0; j < len; j++) {
-							if (mat.batch == this.dataList[j].batch) {
-								sameItem = true
-							}
-						}
-						// 鐩稿悓鐗╂枡 涓嶅悓鎵瑰彿  鏂板姞鍒楄〃
-						if (mat.batch != this.dataList[i].batch) {
-							this.$forceUpdate() // 寮哄埗鍒锋柊
-							if (sameItem) {
-								add = false
-							} else {
-								add = true
-							}
-							
-						} else {
-							// 鐩稿悓鐗╂枡鐩稿悓鎵瑰彿 鏁伴噺绱姞
-							this.dataList[i].anfme += mat.anfme
-							this.$forceUpdate() // 寮哄埗鍒锋柊
-							add = false
-						}
-					}
-				}
-				if (add) {
-					this.dataList.unshift(mat)
-				}
-			},
-			// 淇敼鎵瑰彿
-			revise(item, i) {
-				this.matnr = this.dataList[i].matnr
-				this.count = this.dataList[i].anfme
-				this.batch = this.dataList[i].batch
-				this.weight = this.dataList[i].weight
-				this.rowNum = i
-				this.eject()
-			},
-			eject(type) {
-				this.type = type
-				this.$refs.revise.open(type)
-			},
-			// 鍒楄〃绉婚櫎鎸夐挳
-			remove(item, i, type) {
-				this.removeNum  = i
-				this.msgType = type
-				this.title = '璀﹀憡'
-				this.content = '鏄惁绉婚櫎褰撳墠鍟嗗搧!'
-				this.$refs.alertDialog.open(i)
-			},
-			// 纭绉婚櫎
-			removeConfirm() {
-				this.messageText = "绉婚櫎鎴愬姛"
-				this.messageToggle('success')
-				this.dataList.splice(this.removeNum, 1)
-			},
-			// 鍙栨秷绉婚櫎
-			removeClose() {
-				this.$refs.alertDialog.close()
-			},
-			reviseConfirm() {
-				this.dataList[this.rowNum].anfme = this.count
-				this.dataList[this.rowNum].batch = this.batch
-				this.dataList[this.rowNum].weight = this.weight
-				this.matnr = ''
-				this.messageText = "淇敼鎴愬姛"
-				this.messageToggle('success')
-				this.$refs.revise.close()
-			},
-			reviseClose() {
-				this.$refs.revise.close()
-			},
-			changeValue(value) {
-				this.count = value
 			},
 			combConfirm(type) {
 				this.msgType = type
@@ -409,15 +257,13 @@
 			},
 			comb() {				
 				let that = this;
-				if (that.stationCode === '') {
+				if (that.barcode === '') {
 					this.messageText = "璇锋壂鎻忔殏瀛樹綅鏉$爜"
 					this.messageToggle('error')
 					return;
 				}
-				let newSta =  that.sta.split("-")
-				
 				uni.request({
-					url: that.baseUrl + '/mobile/AGVStartReturn?sourceStaNo='+that.stationCode+'&staNo='+newSta[0],					
+					url: that.baseUrl + '/mobile/AGVStartReturn?sourceStaNo='+that.stationCode+'&staNo='+that.barcode,					
 					header: {
 						'token': uni.getStorageSync('token')
 					},
@@ -452,6 +298,9 @@
 			resetConfirm() {
 				this.dataList = []
 				this.stationCode = ''
+				this.barcode = ''
+				this.stationCodeFocus =false
+				this.barcodeFocus =true
 				this.floor = ''
 				this.messageText = "閲嶇疆瀹屾垚"
 				this.messageToggle('success')
@@ -465,8 +314,10 @@
 				this.staList = []
 				this.sta = ''
 				this.stationCode = ''
+				this.barcode = ''
+				this.stationCodeFocus =false
+				this.barcodeFocus =true
 				this.floor = ''
-				this.barcodeFocuss()
 			},
 		}
 	}

--
Gitblit v1.9.1