From f62410d5ff3124f13612235eea6583088fadffcf Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期三, 30 十月 2024 15:51:07 +0800
Subject: [PATCH] #

---
 pages/pakin/leftovers.vue |  122 ++++++++++++++++++++++++++++++----------
 1 files changed, 91 insertions(+), 31 deletions(-)

diff --git a/pages/pakin/leftovers.vue b/pages/pakin/leftovers.vue
index cc572fd..4744ca8 100644
--- a/pages/pakin/leftovers.vue
+++ b/pages/pakin/leftovers.vue
@@ -7,9 +7,10 @@
 					@input="barcodeInput()">
 			</view>
 			<view class="item">
-				<view class="code-decs">妤煎眰:</view>
-				<uni-combox :candidates="floorList" placeholder="璇烽�夋嫨鍑哄簱绔欑偣" v-model="floor"></uni-combox>
-			</view>
+				<view class="code-decs">鎷f枡绠�:</view>
+				<input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="barcode2" :focus="barcodeFocus2"
+					@input="barcodeInput2()">
+			</view>	
 			<!-- <view class="item">
 				<view class="code-decs">婊℃墭:</view>
 				<radio-group @change="isFrozen">
@@ -23,7 +24,7 @@
 			</view> -->
 		</view>
 		
-		<!-- <scroll-view>
+		<scroll-view>
 			<view class="list" v-for="(item,i) in dataList" :key="i">
 				<view class="list-left">
 					<view class="list-left-item">
@@ -56,7 +57,7 @@
 							<uni-tag :text="item.weight" type="warning"></uni-tag>
 						</view>
 					</view> -->
-					<!-- <view class="list-left-item">
+					<view class="list-left-item">
 						<view class="desc">鏁伴噺锛�</view>
 						<view class="left-item">{{item.anfme}}</view>
 					</view>
@@ -66,13 +67,13 @@
 					<uni-icons type="trash" color="#f58a8a" size="24" @click="remove(item,i,'warn')"></uni-icons>
 				</view>
 			</view>
-		</scroll-view> -->
+		</scroll-view>
 		<!-- 搴曢儴鎿嶄綔鎸夐挳 -->
 		<view class="buttom">
 			<button size="mini" @click="reset('warn')">閲嶇疆</button>
 			<button size="mini" type="primary" @click="combConfirm('warn')">纭畾</button>
 		</view>
-		<!-- 寮圭獥 -->
+		<!-- 寮圭獥
 		<!-- 淇敼鏁伴噺 -->
 		<view>
 			<uni-popup ref="revise" type="dialog">
@@ -145,6 +146,7 @@
 				baseUrl: '',
 				token: '',
 				barcode: '',
+				barcode2:'',
 				dataList: [],
 				count: 0,
 				rowNum: '',
@@ -157,6 +159,7 @@
 				title: '',
 				content: '',
 				barcodeFocus: true,
+				barcodeFocus2: true,
 				matFocus: false,
 				matData: '',
 				removeNum: 0,
@@ -197,8 +200,67 @@
 						this.barcodeFocuss()
 						return;
 					}
-					this.focuss()
+					this.selectPakinDetlList()
+					// this.focuss()
 				}, 200)
+			},
+			barcodeInput2() {
+				// 涓嶈缃畾鏃跺櫒 浼氬嚭鐜版壂鍏ョ殑瀛楃涓蹭笉鍏�
+				setTimeout(() => {
+					var len = this.barcode2.length
+					if (len != 8) {
+						uni.showToast({
+							title: '鎵樼洏鐮佹湁璇閲嶈瘯',
+							icon: "none",
+							position: 'top'
+						});
+						this.barcodeFocuss()
+						return;
+					}
+					// this.selectPakinDetlList()
+					// this.focuss()
+				}, 200)
+			},
+			selectPakinDetlList(){
+				let that = this;
+				uni.request({
+					url: that.baseUrl + '/mobile/select/workDetl/barcode',
+					data: JSON.stringify({
+						barcode: that.barcode
+					}),
+					method: 'POST',
+					header: {
+						'token': uni.getStorageSync('token')
+					},
+					success(result) {
+						result = result.data
+						if (result.code === 200 && result.data) {
+							for(var i =0;i<result.data.length;i++){
+								console.log(result.data[i])
+								that.dataList.push(result.data[i])
+							}
+							
+						} 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'
+							})
+						}
+				
+					}
+				});
 			},
 			// 鎵樼洏鐮佹湁璇噸缃�
 			barcodeFocuss() {
@@ -207,6 +269,14 @@
 				setTimeout(() => {
 					that.barcode = '';
 					that.barcodeFocus = true;
+				}, 100);
+			},
+			barcodeFocuss2() {
+				let that = this;
+				that.barcodeFocus2 = false;
+				setTimeout(() => {
+					that.barcode2 = '';
+					that.barcodeFocus2 = true;
 				}, 100);
 			},
 			// 鍟嗗搧鍏夋爣娓呯┖閲嶇疆
@@ -231,25 +301,10 @@
 					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()
-									},
-								},
-							});
+							for(var i =0;i<result.data.length;i++){
+								that.dataList.unshift(result.data[i])
+							}
+							
 						} else if (result.code == 403) {
 							uni.showToast({
 								title: result.msg,
@@ -389,16 +444,21 @@
 					this.messageToggle('error')
 					return;
 				}
-				if (that.floor === 0 || that.floor === '') {
-					this.messageText = "璇烽�夋嫨妤煎眰"
+				if (that.barcode2 === '') {
+					this.messageText = "璇锋壂鎻忔嫞鏂欑鏉$爜"
 					this.messageToggle('error')
 					return;
-				}				
+				}
+				if (that.dataList.length === 0) {
+					this.messageText = "鎷f枡鍒楄〃涓虹┖"
+					this.messageToggle('error')
+					return;
+				}
 				uni.request({
 					url: that.baseUrl + '/mobile/leftovers/out',
 					data: JSON.stringify({
 						barcode: that.barcode,						
-						floor: that.floor
+						barcode2: that.barcode2
 					}),
 					method: 'POST',
 					header: {

--
Gitblit v1.9.1