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/AGVYBPakin.vue |   94 +++++++++++++++++++++++++++++++----------------
 1 files changed, 62 insertions(+), 32 deletions(-)

diff --git a/pages/AGV/AGVYBPakin.vue b/pages/AGV/AGVYBPakin.vue
index 57459f6..a077eb1 100644
--- a/pages/AGV/AGVYBPakin.vue
+++ b/pages/AGV/AGVYBPakin.vue
@@ -1,28 +1,29 @@
 <template>
 	<view>
 		<view class="code">
-			<view class="item">
-				<view class="code-decs">绔欑偣鍙�:</view>
-				<input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="rsta" :focus="rstaFocus" @input="rstaInput()">
-			</view>
+			
 			<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="rsta" :focus="rstaFocus" @input="rstaInput()">
+			</view>
+			<view class="item">
 				<view class="code-decs">楠屽竷鐮�:</view>
-				<input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="batchCode" :focus="batchFocus" @input="findMat()">
+				<input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="ybm" :focus="ybmFocus" @input="findMat()">
 				<!-- <view class="item-right">
 					<button></button>
 					<text style="text-align: right;color: #409EFF;" @click="selectMat()">鎻愬彇+</text>
 					<uni-icons type="right" color="#c1c1c1"></uni-icons>
 				</view> -->
 			</view>
-			<view class="item">
+			<!-- <view class="item">
 				<view class="code-decs">浠撳簱:</view>
 				<uni-combox :candidates="floorList" placeholder="璇烽�夋嫨浠撳簱" v-model="floor"></uni-combox>
-			</view>
+			</view> -->
 			<view class="item">
 				<view class="code-decs" style="width: 25vw;">澶у皬鎵樼洏:</view>
 				<radio-group @change="isFullPlt">
@@ -43,28 +44,26 @@
 				<view class="list-left">
 					<view class="list-left-item">
 						<view class="desc">No锛�</view>
-						<view class="left-item">{{i + 1}}</view>
+						<view class="left-item">{{dataList.length-i}}</view>
 					</view>
 					<view class="list-left-item">
 						<view class="desc">鏂欏彿锛�</view>
 						<view class="left-item">
-							<uni-tag :text="item.matnr" type="primary"></uni-tag>
+							<uni-tag :text="item.matnr" type="primary" style="color: black; font-weight: 600; font-size: 20px;"></uni-tag>
 						</view>
 					</view>
-					<view class="list-left-item">
+					<!-- <view class="list-left-item">
 						<view class="desc">鍝佸悕锛�</view>
 						<view class="left-item">{{item.maktx}}</view>
-					</view>
-					<view class="list-left-item">
+					</view> -->
+					<!-- <view class="list-left-item">
 						<view class="desc">瑙勬牸锛�</view>
 						<view class="left-item">{{item.specs}}</view>
-					</view>
+					</view>-->
 					<view class="list-left-item">
 						<view class="desc">鎵瑰彿锛�</view>
-						<view class="left-item">
-							<uni-tag :text="item.batch" type="warning"></uni-tag>
-						</view>
-					</view>
+						<view class="left-item">{{item.batch}}</view>
+					</view> 
 					<!-- <view class="list-left-item">
 						<view class="desc">閲嶉噺锛�</view>
 						<view class="left-item">
@@ -72,7 +71,7 @@
 						</view>
 					</view> -->
 					<view class="list-left-item">
-						<view class="desc">鏁伴噺锛�</view>
+						<view class="desc">鍑�闀匡細</view>
 						<view class="left-item">{{item.anfme}}</view>
 					</view>
 				</view>
@@ -193,6 +192,8 @@
 				ck: '',
 				floorList: [],
 				floor: '',
+				ybm:'',
+				ybmFocus:false,
 			}
 		},
 		onLoad() {
@@ -275,25 +276,27 @@
 			// 鎵樼洏鐮佹湁璇噸缃�
 			barcodeFocuss() {
 				let that = this;
-				that.barcodeFocus = false;
+				that.rstaFocus = false;
 				setTimeout(() => {
-					that.barcode = '';
-					that.barcodeFocus = true;
+					that.ybm = '';
+					that.ybmFocus = true;
 				}, 100);
 			},
 			// 鍟嗗搧鍏夋爣娓呯┖閲嶇疆
 			focuss() {
 				this.focus = false;
+				this.barcodeFocus =false;
+				this.rstaFocus =false;
 				setTimeout(() => {
-					this.matnr = '';
-					this.matFocus = true;
+					this.rsta = '';
+					this.rstaFocus = true;
 				}, 100);
 			},
 			// 鎼滅储鐗╂枡
 			findMat() {
 				let that = this
 				uni.request({
-					url: that.baseUrl + '/mobile/mat/tiaoma/auth?barcode=' + that.batchCode,
+					url: that.baseUrl + '/mobile/mat/tiaoma/auth?barcode=' + that.ybm,
 
 					header: {
 						'token': uni.getStorageSync('token')
@@ -301,8 +304,23 @@
 					success(result) {
 						result = result.data
 						if (result.code === 200 && result.data) {
+							// 妫�鏌ユ壒鍙锋槸鍚﹂噸澶�
+							        const newBatchNumber = result.data.batch; // 璇锋浛鎹负瀹為檯鐨勬壒鍙峰睘鎬у悕
+							        
+							        // 鍦╠ataList涓煡鎵炬槸鍚﹀凡瀛樺湪鐩稿悓鎵瑰彿
+							        const isDuplicate = that.dataList.some(item => item.batch === newBatchNumber); // 璇锋浛鎹负瀹為檯鐨勬壒鍙峰睘鎬у悕
+							        
+							        if (isDuplicate) {
+										that.ybm = '';
+							            uni.showToast({
+							                title: '鎵瑰彿閲嶅锛屾棤娉曟坊鍔�',
+							                icon: "none",
+							                position: 'top'
+							            })
+							            return; // 鍋滄鎵ц锛屼笉娣诲姞鏁版嵁
+							        }
 							that.dataList.unshift(result.data)
-							that.focuss()
+							that.ybm = '';
 						} else if (result.code == 403) {
 							uni.showToast({
 								title: result.msg,
@@ -456,11 +474,6 @@
 					this.messageToggle('error')
 					return;
 				}
-				if (that.floor === '') {
-					this.messageText = "浠撳簱涓嶈兘涓虹┖"
-					this.messageToggle('error')
-					return;
-				}
 				for (var i = 0; i < that.dataList.length; i++) {
 					if (that.dataList[i].anfme == 0 || that.dataList[i].anfme == '') {
 						this.messageText = that.dataList[i].matnr + '缁勬墭鏁伴噺涓嶈兘涓�0'
@@ -474,10 +487,11 @@
 						beBatch: 0,
 						barcodeSize: '0',
 						rsta: that.rsta,
+						type: true,
 						barcode: that.barcode,
 						combMats: that.dataList,
 						ck: that.floor,
-						type: true,
+						
 					}),
 					method: 'POST',
 					header: {
@@ -648,4 +662,20 @@
 		text-align: center;
 		box-shadow: 0px 0px 30px 0px rgba(0, 0, 0, 0.5);
 	}
-</style>
\ No newline at end of file
+
+	.list {
+		font-size: 20px;
+		font-weight: 600;
+	}
+
+	.list-left-item .desc,
+	.list-left-item .left-item {
+		font-size: 20px;
+		font-weight: 600;
+	}
+
+	.list-left-item uni-tag {
+		font-size: 20px;
+		font-weight: 600;
+	}
+</style>

--
Gitblit v1.9.1