From ffece4dfd172247c1f61fe7154619bf72a43e219 Mon Sep 17 00:00:00 2001
From: zhou zhou <3272660260@qq.com>
Date: 星期二, 02 十二月 2025 15:46:10 +0800
Subject: [PATCH] #

---
 pages/basics/order.vue |  106 ++++++++++++++++++++++++++++-------------------------
 1 files changed, 56 insertions(+), 50 deletions(-)

diff --git a/pages/basics/order.vue b/pages/basics/order.vue
index e04b1fe..23f66d3 100644
--- a/pages/basics/order.vue
+++ b/pages/basics/order.vue
@@ -31,7 +31,7 @@
 					:candidates="orderNoList"
 					placeholder="璇疯緭鍏� / 閫夋嫨璁㈠崟鍙�"
 					placeholderStyle="line-height: 60rpx; font-size: 30rpx; color: #999;"
-					@input="getOrderDet"
+					
 					@change="onOrderSelect"
 				  />
 				</view>
@@ -74,12 +74,13 @@
 						<checkbox :value="item.id+''" :checked="item.checked" style="display: block;" />
 					</label>
 					<view class="data-list-left">
-						<view class="matnr"><text style="width: 700rpx;">缂栫爜锛歿{item.matnr}}</text></view>
-						<view><text style="width: 700rpx;">鍝佸悕锛歿{item.maktx}}</text></view>
-						<view><text style="width: 700rpx;">瑙勬牸锛歿{item.specs}}</text></view>
-						<view>
-							<text style="width: 700rpx;">鏁伴噺锛歿{item.anfme}}</text>
-						</view>
+						<view class="matnr"><text style="width: 500rpx;">缂栫爜锛歿{item.matnr}}</text>
+						<text style="margin-left: 100rpx;">鍚嶇О锛歿{item.maktx}}</text></view>
+						<view><text style="width: 500rpx;">PO锛歿{item.standby1}}</text>
+						<text style="margin-left: 100rpx;">SKU锛歿{item.standby3}}</text></view>
+						<view><text style="width: 500rpx;">UPC锛歿{item.standby2}}</text></view>
+						<view><text style="width: 500rpx;">閲囪喘鍗曪細{{item.boxType3}}</text>
+						<text style="margin-left: 100rpx;">鏁伴噺锛歿{item.anfme}}</text></view>
 					</view>
 					<view class="data-list-right">
 						<label><uni-icons type="compose" size="20" color="#a5a5a5" @click="revise(item,index)"></uni-icons></label>
@@ -100,10 +101,10 @@
 				<text  @click="reChecked()">鍙嶉��</text>
 			</label> -->
 			
-			<label class="label-btn" style="width: 150rpx;">
+			<label class="label-btn flex justify-center align-center">
 				<button class="cu-btn" @click="resst()">閲嶇疆</button>
 			</label>
-			<label class="label-btn">
+			<label class="label-btn flex justify-center align-center">
 				<button class="cu-btn bg-blue " @click="comb()">缁勬墭</button>
 			</label>
 		</view>
@@ -252,12 +253,12 @@
 			// barcode input 浜嬩欢
 			barcodeInput() {
 				var len = this.barcode.length
-				if (len != 8) {
+				if (len != 6) {
 					uni.showToast({title: '鎵樼洏鐮佹湁璇閲嶈瘯', icon: "none", position: 'top'});
 					this.barcodeFocuss()
 					return;
 				}
-				if (len == 8) {
+				if (len == 6) {
 					this.focuss()
 				}
 			},
@@ -362,60 +363,67 @@
 			comb() {
 				uni.vibrateShort();
 				let that = this;
+
 				if (that.barcode === '') {
-					uni.showToast({title: '璇锋壂鎻忔墭鐩樻潯鐮�', icon: "none", position: 'top'});
+					uni.showToast({ title: '璇锋壂鎻忔墭鐩樻潯鐮�', icon: "none", position: 'top' });
 					return;
 				}
-				if (that.barcode.length !== 8) {
-					uni.showToast({title: '鎵樼洏鐮佸繀椤讳负8浣�', icon: "none", position: 'top'});
+				if (that.barcode.length !== 6) {
+					uni.showToast({ title: '鎵樼洏鐮佸繀椤讳负6浣�', icon: "none", position: 'top' });
 					return;
 				}
 				if (that.matList.length === 0) {
-					uni.showToast({title: '璇锋坊鍔犲晢鍝佸垪琛�', icon: "none", position: 'top'});
+					uni.showToast({ title: '璇锋坊鍔犲晢鍝佸垪琛�', icon: "none", position: 'top' });
 					return;
 				}
-				for (var i = 0; i < that.matList.length; i++) {
-					if (that.matList[i].anfme === 0) {
-						uni.showToast({title: '鍟嗗搧缁勬墭鏁伴噺涓�0涓嶈兘缁勬墭', icon: "none", position: 'top'});
-						return;
-					}
+
+				// 杩囨护鍑烘暟閲忓ぇ浜�0鐨勫晢鍝�
+				const validMats = that.matList.filter(item => item.anfme > 0);
+
+				if (validMats.length === 0) {
+					uni.showToast({ title: '鎵�鏈夊晢鍝佺粍鎵樻暟閲忎负0锛屾棤娉曠粍鎵�', icon: "none", position: 'top' });
+					return;
 				}
+
+				// 鍒犻櫎鏁伴噺涓�0鐨勫晢鍝�
+				that.matList = validMats;
+
 				uni.showLoading();
+
 				uni.request({
-				    url: that.commonUrl + '/mobile/comb/auth',
-				    data: JSON.stringify({
+					url: that.commonUrl + '/mobile/comb/auth',
+					data: JSON.stringify({
 						billNo: that.orderNo,
 						orderNo: that.orderNo,
 						barcode: that.barcode,
-						combMats: that.matList
+						combMats: validMats
 					}),
 					method: 'POST',
-				    header: {
-						'token':uni.getStorageSync('token'),
-				    },
+					header: {
+						'token': uni.getStorageSync('token'),
+					},
 					success(result) {
 						uni.showLoading();
-						var res = result.data
+						var res = result.data;
 						if (res.code === 200) {
 							uni.showToast({
 								title: res.msg,
 								position: 'top',
 								duration: 1000
 							});
-							that.resst()
+							that.resst();
 						} else if (res.code == 403) {
-							uni.showToast({title: res.msg, icon: "none", position: 'top'})
+							uni.showToast({ title: res.msg, icon: "none", position: 'top' });
 							setTimeout(() => {
-								uni.reLaunch({
-									url: '../login/login'
-								});
+								uni.reLaunch({ url: '../login/login' });
 							}, 1000);
 						} else {
-							uni.showToast({title: res.msg, icon: "none",position: 'top'})
+							uni.showToast({ title: res.msg, icon: "none", position: 'top' });
 						}
 					}
 				});
 			},
+
 			findOrder() {
 				let that = this
 				uni.request({
@@ -459,27 +467,25 @@
 				this.$refs.goodsSearch.open(type)
 			},
 			// 鍒楄〃閫夋嫨
-			checkbox: function (e) {
-				var items = this.matList,
-					values = e.detail.value;
-				for (var i = 0, lenI = items.length; i < lenI; ++i) {
-					const item = items[i]
-					item.id = item.id + ''
-					if(values.indexOf(item.id) >= 0){
-						this.$set(item,'checked',true)
-					}else{
-						this.$set(item,'checked',false)
-					}
-				}
-				if (values.length == items.length) {
-					this.check = true
-					this.checkText = "鍙栨秷鍏ㄩ��"
+			checkbox(e) {
+				const values = e.detail.value;
+				this.matList.forEach(item => {
+					// 纭繚 item.id 鏄瓧绗︿覆
+					const itemId = item.id + '';
+					item.checked = values.includes(itemId);
+				});
+
+				if (values.length === this.matList.length) {
+					this.check = true;
+					this.checkText = "鍙栨秷鍏ㄩ��";
 				} else {
-					this.check = false
-					this.checkText = "鍏ㄩ��"
+					this.check = false;
+					this.checkText = "鍏ㄩ��";
 				}
+
 				uni.vibrateShort();
 			},
+
 			// 鍒楄〃鍙嶉��
 			reChecked() { 
 				if (this.matList.length == 0) {

--
Gitblit v1.9.1