From a3ffaec9c9a81626c34989c7026988cc07b3c3d3 Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期二, 16 九月 2025 13:54:24 +0800
Subject: [PATCH] #

---
 pages/order/orderPakin2.vue |  184 +++++++++++++++++++++++++++-------------------
 1 files changed, 108 insertions(+), 76 deletions(-)

diff --git a/pages/order/orderPakin2.vue b/pages/order/orderPakin2.vue
index 938edcf..2c5705e 100644
--- a/pages/order/orderPakin2.vue
+++ b/pages/order/orderPakin2.vue
@@ -6,9 +6,7 @@
 				<view style="flex: 1;">
 					<input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="orderNo" :focus="orderNoFocus">
 				</view>
-				<view style="height:100%;line-height:2;width:40rpx;margin-right: 20rpx;">
-					<uni-icons type="clear" color="#c1c1c1" @click="clearOrderNo()"></uni-icons>
-				</view>
+				
 			</view>
 			<view class="item">
 				<view class="code-decs">鎵樼洏鐮�:</view>
@@ -18,11 +16,11 @@
 			<view class="item">
 				<view class="code-decs">鐗╂枡鐮�:</view>
 				<input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="matnr" :focus="matFocus" @input="findMat()">
-				<view class="item-right">
+				<!-- <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>
 		</view>
 		<view class="mat-list-title">
@@ -65,6 +63,10 @@
 						<view class="desc">鏁伴噺锛�</view>
 						<view class="left-item">{{item.anfme}}</view>
 					</view>
+					<view class="list-left-item">
+						<view class="desc">鐘舵�侊細</view>
+						<view class="left-item">{{item.review}}</view>
+					</view>
 				</view>
 				<view class="list-right">
 					<uni-icons type="compose" color="#9add8b" size="24" @click="revise(item,i)"></uni-icons>
@@ -75,7 +77,7 @@
 		<!-- 搴曢儴鎿嶄綔鎸夐挳 -->
 		<view class="buttom">
 			<button size="mini" @click="reset('warn')">閲嶇疆</button>
-			<button size="mini" type="primary" @click="combConfirm('warn')">缁勬墭</button>
+			<button size="mini" type="primary" @click="combConfirm('warn')" :disabled="isDisabled">缁勬墭</button>
 		</view>
 		<!-- 寮圭獥 -->
 		<!-- 淇敼鏁伴噺 -->
@@ -102,7 +104,7 @@
 					<view class="popup-item">
 						<view class="popup-item-left">鏁伴噺:</view>
 						<view class="popup-item-right" style="border: none;justify-content: center;">
-							<uni-number-box :value="count" :step='0.01' :max="9999999" color="#747474" @change="changeValue" />
+							<uni-number-box :value="count" :step='0.001' :max="9999999" color="#747474" @change="changeValue" />
 						</view>
 					</view>
 					<view class="btn">
@@ -162,15 +164,22 @@
 				messageText: '',
 				title: '',
 				content: '',
-				orderNoFocus: true,
-				barcodeFocus: false,
+				orderNoFocus: false,
+				barcodeFocus: true,
 				matFocus: false,
 				matData: '',
 				removeNum: 0,
+				isDisabled:false
 			}
 		},
 		onLoad() {
-
+			let that = this
+			const eventChannel = this.getOpenerEventChannel();
+			
+			eventChannel.on('orderItem', function(data) {				
+				that.orderNo = data.item.orderNo
+				that.checkMat(data.item)
+			});
 		},
 		onShow() {
 			this.baseUrl = uni.getStorageSync('baseUrl');
@@ -201,16 +210,7 @@
 			barcodeInput() {
 				// 涓嶈缃畾鏃跺櫒 浼氬嚭鐜版壂鍏ョ殑瀛楃涓蹭笉鍏�
 				setTimeout(() => {
-					var len = this.barcode.length
-					if (len != 8) {
-						uni.showToast({
-							title: '鎵樼洏鐮佹湁璇閲嶈瘯',
-							icon: "none",
-							position: 'top'
-						});
-						this.barcodeFocuss()
-						return;
-					}
+					var len = this.barcode.length					
 					this.focuss()
 				}, 200)
 			},
@@ -234,57 +234,68 @@
 			// 鎼滅储鐗╂枡
 			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 (result.code == 403) {
-							uni.showToast({
-								title: result.msg,
-								icon: "none",
-								position: 'top'
-							})
-							setTimeout(() => {
-								uni.reLaunch({
-									url: '../login/login'
-								});
-							}, 1000);
-						} else {
-							uni.showToast({
-								title: result.msg,
-								icon: "none",
-								position: 'top'
-							})
-						}
-
+				let m = that.matnr.split(";")
+				let matnr1 = m[0].slice(3)
+				for(var i = 0;i<that.dataList.length;i++){
+					if(that.dataList[i].matnr === matnr1){
+						that.dataList[i].review = "宸插鏍�"
 					}
-				});
+					 
+				}
+				setTimeout(() => {
+					this.matnr = '';					
+				}, 100);
+				// uni.request({
+				// 	url: that.baseUrl + '/mat/auth',
+				// 	data: {
+				// 		matnr: matnr1
+				// 	},
+				// 	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 (result.code == 403) {
+				// 			uni.showToast({
+				// 				title: result.msg,
+				// 				icon: "none",
+				// 				position: 'top'
+				// 			})
+				// 			setTimeout(() => {
+				// 				uni.reLaunch({
+				// 					url: '../login/login'
+				// 				});
+				// 			}, 1000);
+				// 		} else {
+				// 			uni.showToast({
+				// 				title: result.msg,
+				// 				icon: "none",
+				// 				position: 'top'
+				// 			})
+				// 		}
+
+				// 	}
+				// });
 
 			},
 			selectMat() {
@@ -310,6 +321,8 @@
 				that.matnr = ''
 			},
 			checkMat(mat) {
+				mat.review = "鏈鏍�"
+				mat.anfme = mat.enableQty
 				var len = this.dataList.length
 				var add = true ,sameItem = false
 				for (var i = 0; i < len; i++) {
@@ -395,9 +408,9 @@
 			combClose() {
 				this.$refs.combConfirm.close()
 			},
-			comb() {
-				uni.vibrateShort();
+			comb() {				
 				let that = this;
+				that.isDisabled = true
 				if (that.orderNo === '') {
 					this.messageText = "璇疯緭鍏ヨ鍗曟潯鐮�"
 					this.messageToggle('error')
@@ -414,11 +427,17 @@
 					return;
 				}
 				for (var i = 0; i < that.dataList.length; i++) {
+					if (that.dataList[i].review !== "宸插鏍�" ) {
+						this.messageText = that.dataList[i].matnr + '鏈鏍�'
+						this.messageToggle('error')
+						return;
+					}
 					if (that.dataList[i].anfme == 0 || that.dataList[i].anfme == '') {
 						this.messageText = that.dataList[i].matnr + '缁勬墭鏁伴噺涓嶈兘涓�0'
 						this.messageToggle('error')
 						return;
-					}
+					}				
+					
 				}
 				uni.request({
 					url: that.baseUrl + '/mobile/comb/auth',
@@ -452,6 +471,13 @@
 							that.messageText = res.msg
 							that.messageToggle('error')
 						}
+					},
+					fail: () => {
+						that.messageText = "鎺ュ彛瓒呮椂"
+						that.messageToggle('error')
+					},
+					complete: () => {
+						that.isDisabled = false
 					}
 				});
 			},
@@ -493,7 +519,7 @@
 	.code {
 		width: 100%;
 		position: fixed;
-		min-height: 210rpx;
+		min-height: 200rpx;
 		background-color: #FFF;
 		z-index: 10;
 	}
@@ -501,7 +527,7 @@
 	.item {
 		display: flex;
 		align-items: center;
-		height: 70rpx;
+		height: 100rpx;
 		margin-left: 20rpx;
 		border-bottom: 1px solid #DCDFE6;
 	}
@@ -533,10 +559,16 @@
 		width: 100%;
 		background-color: white;
 		position: fixed;
-		margin-top: 200rpx;
+		margin-top: 300rpx;
 		z-index: 9;
 		/* border-top: 1px solid #DCDFE6; */
 		text-align: center;
 		box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.2);
 	}
+	.list:first-child {
+		margin-top: 420rpx;
+	}
+	.list:last-child {
+		margin-bottom: 120rpx;
+	}
 </style>

--
Gitblit v1.9.1