From 087b9f6cea5b4d2eb1c9fa3959ac0dc5b09cf254 Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期五, 08 八月 2025 17:03:59 +0800
Subject: [PATCH] no message

---
 pages/pakin/pakin.vue |  144 ++++++++++++++++++++++++++++++++++++------------
 1 files changed, 108 insertions(+), 36 deletions(-)

diff --git a/pages/pakin/pakin.vue b/pages/pakin/pakin.vue
index 0090ff2..b6f4150 100644
--- a/pages/pakin/pakin.vue
+++ b/pages/pakin/pakin.vue
@@ -14,19 +14,25 @@
 					<text style="text-align: right;color: #409EFF;" @click="findMat()">鎻愬彇+</text>
 					<uni-icons type="right" color="#c1c1c1"></uni-icons>
 				</view>
-			</view>
+			</view>
+			<uni-section title="鍟嗗搧鍒楄〃" type="line" class="mat-list-title"></uni-section>
 		</view>
-		<view class="mat-list-title">
-			<div>鍟嗗搧鍒楄〃</div>
+		<view class="list-view">
 			<scroll-view>
 				<view class="list" v-for="(item,i) in dataList" :key="i">
 					<view class="list-left">
 						<view class="list-left-item">
 							<view class="desc">No锛�</view>
 							<view class="left-item">{{i + 1}}</view>
+						</view>
+						<view class="list-left-item">
+							<view class="desc">璁㈠崟鍙凤細</view>
+							<view class="left-item">
+								<uni-tag :text="item.orderNo" type="normal"></uni-tag>
+							</view>
 						</view>
 						<view class="list-left-item">
-							<view class="desc">缂栫爜锛�</view>
+							<view class="desc">鐗╂枡鐮侊細</view>
 							<view class="left-item">
 								<uni-tag :text="item.matnr" type="primary"></uni-tag>
 							</view>
@@ -120,6 +126,12 @@
 				<uni-popup-dialog :type="msgType" cancelText="鍙栨秷" confirmText="纭" :title="title" :content="content"
 					@confirm="resetConfirm" @close="resetClose"></uni-popup-dialog>
 			</uni-popup>
+		</view>
+		<!-- 骞冲簱搴撲綅鎺ㄨ崘 -->
+		<view>
+			<uni-popup ref="recommend" type="dialog">
+				<uni-popup-dialog :type="msgType"  mode="base"  :cancelText="null"  confirmText="纭" title="鎺ㄨ崘搴撲綅" :content="recomLoc"></uni-popup-dialog>
+			</uni-popup>
 		</view>
 	</view>
 </template>
@@ -137,7 +149,8 @@
 				msgType1: 'success',
 				msgType: 'success',
 				messageText: '',
-				title: '',
+				title: '',
+				recomLoc: '',
 				content: '',
 				barcodeFocus: true,
 				matFocus: false,
@@ -169,15 +182,15 @@
 				// 涓嶈缃畾鏃跺櫒 浼氬嚭鐜版壂鍏ョ殑瀛楃涓蹭笉鍏�
 				setTimeout(() => {
 					var len = this.barcode.length
-					if (len != 8) {
-						uni.showToast({
-							title: '鎵樼洏鐮佹湁璇閲嶈瘯',
-							icon: "none",
-							position: 'top'
-						});
-						// this.barcodeFocuss()
-						return;
-					}
+					// if (len != 8) {
+					// 	uni.showToast({
+					// 		title: '鎵樼洏鐮佹湁璇閲嶈瘯',
+					// 		icon: "none",
+					// 		position: 'top'
+					// 	});
+					// 	// this.barcodeFocuss()
+					// 	return;
+					// }
 					// this.focuss()
 				}, 200)
 			},
@@ -201,21 +214,27 @@
 			// 鎼滅储鐗╂枡
 			findMat() {
 				let that = this
-				if (that.matnr == null && that.matnr == '') {
+				if (that.matnr == null || that.matnr == '') {
 					uni.showToast({
-						title: "鐗╂枡鐮佷笉鑳戒负绌猴紒锛�",
+						title: "璁㈠崟鍙蜂笉鑳戒负绌猴紒锛�",
 						icon: "none",
 						position: "top"
 					})
 					return;
-				} else {
+				}
 					uni.navigateTo({
 						url: "../pakin/pakinSelector?barcode=" + that.matnr,
+						success:function(res){
+							let matnrs = that.dataList.map(data => data.matnr);
+							console.log(matnrs);
+							res.eventChannel.emit('acceptOpenPager', matnrs)
+						}
 					});
-				}
+
 			},
 		
-			checkMat(mat) {
+			checkMat(mat) {
+				console.log(mat)
 				var len = this.dataList.length
 				var add = true ,sameItem = false
 				for (var i = 0; i < len; i++) {
@@ -224,7 +243,8 @@
 							if (mat.batch == this.dataList[j].batch) {
 								sameItem = true
 							}
-						}
+						}
+						
 						// 鐩稿悓鐗╂枡 涓嶅悓鎵瑰彿  鏂板姞鍒楄〃
 						if (mat.batch != this.dataList[i].batch) {
 							this.$forceUpdate() // 寮哄埗鍒锋柊
@@ -234,11 +254,17 @@
 								add = true
 							}
 							
-						} else {
-							// 鐩稿悓鐗╂枡鐩稿悓鎵瑰彿 鏁伴噺绱姞
-							this.dataList[i].mergeNum += mat.mergeNum
-							this.$forceUpdate() // 寮哄埗鍒锋柊
-							add = false
+						} else {
+							// 鐩稿悓鐗╂枡锛岀浉鍚屾壒鍙凤紝涓嶅悓璁㈠崟鍙�
+							if (mat.orderNo != this.dataList[i].orderNo) {
+								this.$forceUpdate() 
+								add = true
+							} else {
+								// 鐩稿悓鐗╂枡鐩稿悓鎵瑰彿 鏁伴噺绱姞
+								this.dataList[i].mergeNum += mat.mergeNum
+								this.$forceUpdate() // 寮哄埗鍒锋柊
+								add = false
+							}
 						}
 					}
 				}
@@ -326,7 +352,8 @@
 						this.messageToggle('error')
 						return;
 					}
-				}
+				}
+	
 				uni.request({
 					url: that.baseUrl + '/pda/comb/auth',
 					data: JSON.stringify({
@@ -341,12 +368,15 @@
 					success(result) {
 						var res = result.data
 						if (res.code === 200) {
-							that.resst();
 							that.messageText = "缁勬墭鎴愬姛"
 							that.messageToggle('success')
 							const innerAudioContext = uni.createInnerAudioContext();
 							innerAudioContext.src = '/static/music/pakinOk.mp3';
-							innerAudioContext.play()
+							innerAudioContext.play()
+							if (that.barcode.indexOf('PK') >= 0) {
+								that.recommendLocs(that)
+							}
+							that.resst();
 						} else if (res.code == 403) {
 							that.messageText = res.msg
 							that.messageToggle('error')
@@ -361,7 +391,38 @@
 						}
 					}
 				});
-			},
+			},
+			
+			recommendLocs(that) {
+				uni.request({
+					url: that.baseUrl + '/pda/recommend/locs',
+					method: 'GET',
+					header: {
+						'token': uni.getStorageSync('token')
+					},
+					success(result) {
+						var res = result.data
+						if (res.code === 200) {
+							if (res.data != null && res.data != undefined ) {
+								that.recomLoc = '绯荤粺鎺ㄨ崘灏嗚揣鐗╂斁鑷�:' + res.data.locNo
+								that.$refs.recommend.open()
+							}
+						} else if (res.code == 403) {
+							that.messageText = res.msg
+							that.messageToggle('error')
+							setTimeout(() => {
+								uni.reLaunch({
+									url: '../login/login'
+								});
+							}, 1000);
+						} else {
+							that.messageText = res.msg
+							that.messageToggle('error')
+						}
+					}
+				});
+			},
+			
 			reset(type) {
 				this.msgType = type
 				this.title = '璀﹀憡'
@@ -382,6 +443,7 @@
 			resst() {
 				this.dataList = []
 				this.barcode = ''
+				this.matnr = ''
 				this.barcodeFocuss()
 			},
 		}
@@ -389,17 +451,30 @@
 </script>
 
 <style>
-	@import url('../../static/css/wms.css/wms.css');
+	@import url('../../static/css/wms.css/wms.css');
+	
+	.uni-section {
+		margin-top: 0rpx;
+
+		.uni-section__content-title {
+			font-size: 16px !important;
+		}
+	}
 
 	.list {
 		border-radius: unset;
 		margin: auto;
 		margin-top: 20rpx;
 		padding: 10rpx;
+	}
+	
+	.list-view {
+		width: 100%;
+		position: relative;
 	}
 
 	.list:first-child {
-		margin-top: 20rpx;
+		margin-top: 320rpx;
 	}
 	.code {
 		width: 100%;
@@ -443,11 +518,8 @@
 		line-height: 80rpx;
 		width: 100%;
 		background-color: white;
-		position: fixed;
-		margin-top: 200rpx;
+		position: relative;
+		font-weight: 500;
 		z-index: 9;
-		/* border-top: 1px solid #DCDFE6; */
-		text-align: center;
-		/* box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.2); */
 	}
 </style>

--
Gitblit v1.9.1