From 7437dd7b944aaeb64e98a1e0a5943ec88db4afab Mon Sep 17 00:00:00 2001
From: lty <876263681@qq.com>
Date: 星期二, 03 二月 2026 15:37:00 +0800
Subject: [PATCH] #新增扫内部码入库和换码功能

---
 pages/basics/order.vue |  119 ++++++++++++++++++++++++++++++-----------------------------
 1 files changed, 60 insertions(+), 59 deletions(-)

diff --git a/pages/basics/order.vue b/pages/basics/order.vue
index 23f66d3..c0edf88 100644
--- a/pages/basics/order.vue
+++ b/pages/basics/order.vue
@@ -4,11 +4,11 @@
 			<view class="square-2">
 				<view class="square-title">
 					<view class="title-sign"><view class="sign"></view></view>
-					<view class="title-text"><text>鎵樼洏鏉$爜</text></view>
+					<view class="title-text"><text>Pallet Barcode</text></view>
 				</view>
 				<view class="square-content">
 					<view class="content-input">
-						<input  v-model="barcode" type="text" placeholder="鎵爜 / 杈撳叆" maxlength="10"
+						<input  v-model="barcode" type="text" placeholder="Scan / Input" maxlength="10"
 						:focus="barcodeFocus" @input="barcodeInput" placeholder-style="line-height:  85rpx;">
 						<uni-icons type="closeempty" size="20" color="#dadada" @click="removeBarcode()"></uni-icons>
 					</view>
@@ -16,32 +16,33 @@
 			</view>
 			
 			<view class="square-3">
-			  <!-- 鏍囬閮ㄥ垎 -->
+			  <!-- Title Section -->
 			  <view class="square-title">
 				<view class="title-sign"><view class="sign"></view></view>
-				<view class="title-text"><text>鍗曟嵁缂栧彿</text></view>
+				<view class="title-text"><text>Order Number</text></view>
 			  </view>
 
-			  <!-- 鍐呭鍖哄煙 -->
+			  <!-- Content Area -->
 			  <view class="square-content" style="display: flex; align-items: center;">
-				<!-- 涓嬫媺杈撳叆妗� -->
+				<!-- Dropdown Input -->
 				<view class="content-input" style="flex: 1;">
 				  <uni-combox
 					v-model="orderNo"
 					:candidates="orderNoList"
-					placeholder="璇疯緭鍏� / 閫夋嫨璁㈠崟鍙�"
+					placeholder="Enter / Select Order No."
 					placeholderStyle="line-height: 60rpx; font-size: 30rpx; color: #999;"
-					
+					emptyTips="No matching items"
 					@change="onOrderSelect"
 				  />
 				</view>
 
-				<!-- 妫�绱㈡寜閽� -->
+				<!-- Search Button -->
 				<view style="width: 80px; display: flex; align-items: center; justify-content: center; margin-left: 10rpx;">
-				  <button size="mini" type="primary" @click="getOrderDetlByOrderNo()">妫�绱�</button>
+				  <button size="mini" type="primary" @click="getOrderDetlByOrderNo()">Search</button>
 				</view>
 			  </view>
 			</view>
+
 
 
 
@@ -49,13 +50,13 @@
 			<view class="square-1">
 				<view class="square-title">
 					<view class="title-sign"><view class="sign"></view></view>
-					<view class="title-text"  style="width: 200rpx;"><text>鍟嗗搧鍒楄〃</text></view>
+					<view class="title-text"  style="width: 200rpx;"><text>Item List</text></view>
 					<view v-show="matList.length != 0" class="lable">
 						<label class="label-btn" style="width: 170rpx;line-height: 95rpx;"  >
 							<checkbox :checked="check" @click="allChecked()">{{checkText}}</checkbox>
 						</label>
 						<label class="label-btn"  >
-							<text  @click="reChecked()">鍙嶉��</text>
+							<text  @click="reChecked()">Invert</text>
 						</label>
 						<label >
 							<uni-icons type="trash" size="25" color="#a5a5a5" @click="remove()"></uni-icons>
@@ -65,7 +66,7 @@
 				
 			</view>
 			<view class="square-none" v-show="matList.length === 0">
-				<view class="v-show">鏆傛棤鏇村鏁版嵁...</view>
+				<view class="v-show">No more data...</view>
 			</view>
 			
 			<checkbox-group @change="checkbox">
@@ -74,51 +75,51 @@
 						<checkbox :value="item.id+''" :checked="item.checked" style="display: block;" />
 					</label>
 					<view class="data-list-left">
-						<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 class="matnr"><text style="width: 500rpx;">Code: {{item.matnr}}</text>
+						<text style="margin-left: 100rpx;">Name: {{item.maktx}}</text></view>
+						<view><text style="width: 500rpx;">Customer 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;">PO Number: {{item.boxType3}}</text>
+						<text style="margin-left: 100rpx;">Quantity: {{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>
-						<!-- list涓垹闄ら敭 -->
+						<!-- Delete button in list -->
 						<!-- <label><uni-icons type="trash" size="25" color="#a5a5a5" @click="remove(item,index)"></uni-icons></label> -->
 					</view>
 				</view>
 			</checkbox-group>
 		</scroll-view>
 		
-		<!-- 搴曢儴鎸夐挳 -->
+		<!-- Bottom Buttons -->
 		<view class="footer flex justify-around">
-			<!-- 搴曢儴鍏ㄩ�� 鍙嶉�夋寜閽� -->
+			<!-- Bottom Select All / Invert Buttons -->
 			<!-- <label class="label-btn" style="width: 170rpx;">
 				<checkbox :checked="check" @click="allChecked()">{{checkText}}</checkbox>
 			</label>
 			<label class="label-btn" style="width: 100rpx;">
-				<text  @click="reChecked()">鍙嶉��</text>
+				<text  @click="reChecked()">Invert</text>
 			</label> -->
 			
 			<label class="label-btn flex justify-center align-center">
-				<button class="cu-btn" @click="resst()">閲嶇疆</button>
+				<button class="cu-btn" @click="resst()">Reset</button>
 			</label>
 			<label class="label-btn flex justify-center align-center">
-				<button class="cu-btn bg-blue " @click="comb()">缁勬墭</button>
+				<button class="cu-btn bg-blue " @click="comb()">Combine</button>
 			</label>
 		</view>
 		
 		<view>
-			<!-- 淇敼鏁伴噺 -->
+			<!-- Modify Quantity -->
 			<uni-popup ref="revise" background-color="#fff" @change="change">
 				<view class="revise-box">
 					<view class="revise-box-top">
 						<view class="color-block-blue"></view>
-						<text class="title">缁勬墭鏁伴噺</text>
+						<text class="title">Combine Quantity</text>
 					</view>
 					<view class="text-box">
-						<text>鍙粍鏁伴噺锛歿{enableQty}}</text>
+						<text>Available Qty: {{enableQty}}</text>
 					</view>
 					<view class="changeBox flex justify-around">
 						<view class="num-box">
@@ -128,7 +129,7 @@
 					</view>
 					<view class="revise-box-buttom">
 						<view>
-							<button class="cu-btn bg-blue" @click="confirm()">纭</button>
+							<button class="cu-btn bg-blue" @click="confirm()">Confirm</button>
 						</view>
 					</view>
 					
@@ -159,7 +160,7 @@
 				rowNum:'',
 				enableQty:'',
 				check:false,
-				checkText:'鍏ㄩ��',
+				checkText:'Select All',
 				checkedData:[],
 				orderNo: '',
 				orderNoList: [], 
@@ -194,12 +195,12 @@
 
 		  onOrderSelect(order) {
 			this.orderNo = order;
-			// 鍙�夛細鑷姩瑙﹀彂鏌ヨ
+			// Optional: Auto trigger search
 			// this.getOrderDetlByOrderNo();
 		  },
 		getOrderDetlByOrderNo() {
 		  if (!this.orderNo) {
-			uni.showToast({ title: '璇烽�夋嫨璁㈠崟', icon: 'none' });
+			uni.showToast({ title: 'please enter orderNo', icon: 'none' });
 			return;
 		  }
 		  let that = this;
@@ -246,15 +247,15 @@
 			  this.orderSuggestions = []
 			  this.showDropdown = false
 			},
-			// 鑾峰彇url
+			// Get URL
 			getUrl() {
 				this.commonUrl = this.baseHttp + this.baseIP + ':' +this.basePORT + "/" +this.baseUrl
 			},
-			// barcode input 浜嬩欢
+			// Barcode input event
 			barcodeInput() {
 				var len = this.barcode.length
 				if (len != 6) {
-					uni.showToast({title: '鎵樼洏鐮佹湁璇閲嶈瘯', icon: "none", position: 'top'});
+					uni.showToast({title: 'Invalid pallet barcode', icon: "none", position: 'top'});
 					this.barcodeFocuss()
 					return;
 				}
@@ -262,7 +263,7 @@
 					this.focuss()
 				}
 			},
-			// 鎵樼洏鐮佹湁璇噸缃�
+			// Reset invalid pallet barcode
 			barcodeFocuss() {
 				// #ifdef APP
 				let that = this;
@@ -309,7 +310,7 @@
 			},
 			eject(type) {
 				this.type = type
-				// open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦� uni-popup 缁勪欢涓婄粦瀹� type灞炴��
+				// The parameter passed to open method is equivalent to binding type attribute on uni-popup component
 				this.$refs.revise.open(type)
 			},
 			initAnfme() {
@@ -351,7 +352,7 @@
 				this.checkList();
 				uni.vibrateShort();
 			},
-			// 鍒楄〃涓垹闄�
+			// Remove from list
 			// remove(item,index) {
 			// 	this.matList.splice(index,1)
 			// 	uni.vibrateShort();
@@ -365,27 +366,27 @@
 				let that = this;
 
 				if (that.barcode === '') {
-					uni.showToast({ title: '璇锋壂鎻忔墭鐩樻潯鐮�', icon: "none", position: 'top' });
+					uni.showToast({ title: 'Please scan pallet barcode', icon: "none", position: 'top' });
 					return;
 				}
 				if (that.barcode.length !== 6) {
-					uni.showToast({ title: '鎵樼洏鐮佸繀椤讳负6浣�', icon: "none", position: 'top' });
+					uni.showToast({ title: 'Pallet barcode must be 6 digits', icon: "none", position: 'top' });
 					return;
 				}
 				if (that.matList.length === 0) {
-					uni.showToast({ title: '璇锋坊鍔犲晢鍝佸垪琛�', icon: "none", position: 'top' });
+					uni.showToast({ title: 'Please add item list', icon: "none", position: 'top' });
 					return;
 				}
 
-				// 杩囨护鍑烘暟閲忓ぇ浜�0鐨勫晢鍝�
+				// Filter items with quantity > 0
 				const validMats = that.matList.filter(item => item.anfme > 0);
 
 				if (validMats.length === 0) {
-					uni.showToast({ title: '鎵�鏈夊晢鍝佺粍鎵樻暟閲忎负0锛屾棤娉曠粍鎵�', icon: "none", position: 'top' });
+					uni.showToast({ title: 'All items quantity is 0, cannot combine', icon: "none", position: 'top' });
 					return;
 				}
 
-				// 鍒犻櫎鏁伴噺涓�0鐨勫晢鍝�
+				// Remove items with quantity 0
 				that.matList = validMats;
 
 				uni.showLoading();
@@ -459,34 +460,34 @@
 				});
 			},
 			change(e) {
-				// console.log('褰撳墠妯″紡锛�' + e.type + ',鐘舵�侊細' + e.show);
+				// console.log('Current mode: ' + e.type + ', Status: ' + e.show);
 			},
 			toggle(type) {
 				this.type = type
-				// open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦� uni-popup 缁勪欢涓婄粦瀹� type灞炴��
+				// The parameter passed to open method is equivalent to binding type attribute on uni-popup component
 				this.$refs.goodsSearch.open(type)
 			},
-			// 鍒楄〃閫夋嫨
+			// List selection
 			checkbox(e) {
 				const values = e.detail.value;
 				this.matList.forEach(item => {
-					// 纭繚 item.id 鏄瓧绗︿覆
+					// Ensure item.id is a string
 					const itemId = item.id + '';
 					item.checked = values.includes(itemId);
 				});
 
 				if (values.length === this.matList.length) {
 					this.check = true;
-					this.checkText = "鍙栨秷鍏ㄩ��";
+					this.checkText = "Unselect All";
 				} else {
 					this.check = false;
-					this.checkText = "鍏ㄩ��";
+					this.checkText = "Select All";
 				}
 
 				uni.vibrateShort();
 			},
 
-			// 鍒楄〃鍙嶉��
+			// Invert selection
 			reChecked() { 
 				if (this.matList.length == 0) {
 					return;
@@ -504,35 +505,35 @@
 				}
 				if (checkArr.length == this.matList.length) {
 					this.check = true
-					this.checkText = "鍙栨秷鍏ㄩ��"
+					this.checkText = "Unselect All"
 				} else {
 					this.check = false
-					this.checkText = "鍏ㄩ��"
+					this.checkText = "Select All"
 				}
 				uni.vibrateShort();
 			},
-			// 鍒楄〃鍏ㄩ��
+			// Select all
 			allChecked(e){ 
 				if (this.check == true) {
 					for (var i = 0; i < this.matList.length;i++) {
 						this.$set(this.matList[i],'checked',false)
 					}
 					this.check = false
-					this.checkText = "鍏ㄩ��"
+					this.checkText = "Select All"
 				} else {
 					for (var i = 0; i < this.matList.length;i++) {
 						this.$set(this.matList[i],'checked',true)
 					}
 					this.check = true
-					this.checkText = "鍙栨秷鍏ㄩ��"
+					this.checkText = "Unselect All"
 				}
 				uni.vibrateShort();
 			},
-			// 妫�楠屽垪琛ㄩ暱搴� 绛変簬0 鏄剧ず鍏ㄩ��  
+			// Check list length, if 0 show Select All
 			checkList() {
 				if (this.matList.length == 0) {
 					this.check = false
-					this.checkText = "鍏ㄩ��"
+					this.checkText = "Select All"
 					return;
 				}
 			}

--
Gitblit v1.9.1