From 2b49f7643d15b74889d190f216630559006ed93a Mon Sep 17 00:00:00 2001
From: yanjinhui <3306209981@qq.com>
Date: 星期一, 01 十二月 2025 09:48:43 +0800
Subject: [PATCH] pad和后端的优化

---
 新建文件夹/PDA/pages/stash/CheckoutorderDetail.vue |  152 ++++++++++++++++++++++++++++++--------------------
 1 files changed, 90 insertions(+), 62 deletions(-)

diff --git "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/PDA/pages/stash/CheckoutorderDetail.vue" "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/PDA/pages/stash/CheckoutorderDetail.vue"
index 7ee0aed..993fad8 100644
--- "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/PDA/pages/stash/CheckoutorderDetail.vue"
+++ "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/PDA/pages/stash/CheckoutorderDetail.vue"
@@ -11,10 +11,22 @@
 				v-for="item in allReceivingOrders" :key="item.locationCode">
 				<template v-slot:body>
 					<uni-group margin-top="20">
-						<view> 鍗曟嵁缂栧彿:{{orderNo}} </view>
+						<!-- <view> 鍗曟嵁缂栧彿:{{orderNo}} </view>
 						<view> 鎵瑰彿:{{item.batchNo}} </view>
-						<view> 鐗╂枡缂栧彿:{{item.materielCode}} </view>
+						<view> 鐗╂枡缂栧彿:{{item.materielCode}} </view> -->
 						<!-- <view> 鐗╂枡鍚嶇О:{{item.materielName}} </view> -->
+						<!-- <view> 璐т綅缂栧彿:{{item.locationCode}} </view>
+						<view> 璐﹂潰鏁伴噺:{{item.stockQuantity}} </view> -->
+
+							<view> 鐗╂枡鍚嶇О:{{item.materielName}} </view>
+						<view> 鍝佸悕/閫氱敤鍚�:{{item.item || ''}} </view>
+						<view> 鐗╂枡缂栧彿:{{item.materielCode}} </view>
+						<view> 鐗╂枡瑙勬牸:{{item.materielSpec}} </view>
+						<view> 鐢熶骇鍘傚:{{item.factory || ''}} </view>
+						<view> 鍩烘湰鍗曚綅:{{item.materielUnit}} </view>
+						<view> 鏁堟湡:{{item.modifier || ''}} </view>
+						<view> 鎵瑰彿:{{item.batchNo}} </view>
+						<view> 鍗曟嵁缂栧彿:{{orderNo}} </view>
 						<view> 璐т綅缂栧彿:{{item.locationCode}} </view>
 						<view> 璐﹂潰鏁伴噺:{{item.stockQuantity}} </view>
 					</uni-group>
@@ -44,6 +56,11 @@
 				warehouseId: ""
 			}
 		},
+		  // 娣诲姞杩欎釜鐢熷懡鍛ㄦ湡
+  onHide() {
+    // 椤甸潰闅愯棌鏃朵笉鍋氫换浣曟搷浣�
+  },
+
 		onLoad(res) {
 			this.warehouseId = res.warehouseId;
 			this.orderNo = res.orderNo;
@@ -52,8 +69,11 @@
 			// this.getData();
 		},
 		onReachBottom() {
-			this.pageNo += 1;
-			this.getData();
+			// 鍙湁鍦ㄨ繕鏈夋洿澶氭暟鎹椂鎵嶅姞杞戒笅涓�椤�
+  if (this.status === 'more') {
+    this.pageNo += 1;
+    this.getData();
+  }
 		},
 		onShow() {
 			// this.checkTask = uni.getStorageSync('checkTask');
@@ -69,6 +89,13 @@
 			this.scrollTop = e.scrollTop;
 		},
 		methods: {
+			// 娣诲姞鍒锋柊鏂规硶渚涘叾浠栭〉闈㈣皟鐢�
+			refreshData() {
+				console.log('鏀跺埌鐩樼偣鍒锋柊璇锋眰');
+				this.pageNo = 1;
+				this.allReceivingOrders = [];
+				this.getData();
+			},
 			search(res) {
 				this.pageNo = 1;
 				this.getData();
@@ -76,65 +103,66 @@
 			groupClick() {
 
 			},
+			 
+  
 			getData() {
-				var postData = {
-					MainData: {
-						warehouseId: this.warehouseId,
-						locationCode: this.searchValue,
-						orderNo: this.orderNo,
-						pageNo: this.pageNo,
-						isCheck: true,
-					},
-				}
-				if (this.pageNo == 1) this.allReceivingOrders = [];
-				this.$u.post('/api/DeliveryOrder/GetCheckOutTasks', postData).then((
-					res) => {
-					if (res.status) {
-						if (res.data.length > 0) {
-							if (this.searchValue == '') {
-								this.allReceivingOrders = this.allReceivingOrders.concat(res.data);
-								// this.allReceivingOrders = res.data;
-								if (this.allReceivingOrders.length > 3) {
-									this.loadVisible = true;
-								} else {
-									this.loadVisible = false;
-								}
-							} else {
-								this.allReceivingOrders = res.data;
-								if (this.allReceivingOrders.length > 3) {
-									this.loadVisible = true;
-								} else {
-									this.loadVisible = false;
-								}
-							}
-						} else {
-							this.status = 'noMore';
-							//this.allReceivingOrders = [];
-							this.loadVisible = true;
-							if (this.allReceivingOrders.length < 1) {
-								// uni.showModal({
-								// 	title: '鎻愮ず',
-								// 	content: '鐩樼偣宸插畬鎴愶紝鏄惁杩斿洖棣栭〉锛�',
-								// 	success: (res) => {
-										// uni.getStorageSync('ischeck',true)
-								// 		if (res.confirm) {
-								// 			// 鐢ㄦ埛鐐瑰嚮纭畾
-											setTimeout(() => {
-												uni.navigateBack({
-													delta: 1
-												});
-											}, 300);
-								// 		} else {
-								// 			// 鐢ㄦ埛鐐瑰嚮鍙栨秷锛屽彲浠ュ仠鐣欏湪褰撳墠椤甸潰
-								// 			// 鎴栬�呮墽琛屽叾浠栨搷浣�
-								// 		}
-								// 	}
-								// });
-							}
-						}
-					}
-				})
-			}
+  var postData = {
+    MainData: {
+      warehouseId: this.warehouseId,
+      locationCode: this.searchValue,
+      orderNo: this.orderNo,
+      pageNo: this.pageNo,
+      isCheck: true,
+    },
+  }
+  
+  // 濡傛灉鏄涓�椤垫垨鎼滅储锛屾竻绌烘暟鎹�
+  if (this.pageNo === 1 || this.searchValue !== '') {
+    this.allReceivingOrders = [];
+    this.status = "more";
+  }
+  
+  this.$u.post('/api/DeliveryOrder/CheckOutTasks', postData).then((res) => {
+    if (res.status) {
+      if (res.data && res.data.length > 0) {
+        // 杩藉姞鏁版嵁鑰屼笉鏄浛鎹�
+        this.allReceivingOrders = [...this.allReceivingOrders, ...res.data];
+        
+        // 濡傛灉杩斿洖鐨勬暟鎹皯浜�5鏉★紝璇存槑娌℃湁鏇村鏁版嵁浜�
+        if (res.data.length < 5) {
+          this.status = 'noMore';
+        } else {
+          this.status = 'more';
+        }
+        
+        // 鎺у埗鍔犺浇鎻愮ず鏄剧ず
+        this.loadVisible = this.allReceivingOrders.length > 0;
+        
+      } else {
+        // 娌℃湁鏁版嵁
+        this.status = 'noMore';
+        this.loadVisible = this.allReceivingOrders.length > 0;
+        
+        // 濡傛灉鏄涓�椤典笖娌℃湁鏁版嵁锛屾樉绀虹┖鐘舵��
+        if (this.pageNo === 1) {
+          this.allReceivingOrders = [];
+        }
+        
+        // 鐩樼偣瀹屾垚鎻愮ず閫昏緫
+        if (this.allReceivingOrders.length < 1) {
+          setTimeout(() => {
+            uni.navigateBack({
+              delta: 1
+            });
+          }, 300);
+        }
+      }
+    }
+  }).catch(err => {
+    console.error('璇锋眰澶辫触:', err);
+    this.status = 'noMore';
+  })
+}
 		}
 	}
 </script>

--
Gitblit v1.9.3