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/outboundorderDetail.vue |  152 +++++++++++++++++++++++++++++---------------------
 1 files changed, 88 insertions(+), 64 deletions(-)

diff --git "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/PDA/pages/stash/outboundorderDetail.vue" "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/PDA/pages/stash/outboundorderDetail.vue"
index 90cc3c7..7888976 100644
--- "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/PDA/pages/stash/outboundorderDetail.vue"
+++ "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/PDA/pages/stash/outboundorderDetail.vue"
@@ -11,10 +11,15 @@
 				v-for="item in allReceivingOrders" :key="item.locationCode">
 				<template v-slot:body>
 					<uni-group margin-top="20">
-						<view> 鍗曟嵁缂栧彿:{{orderNo}} </view>
-						<view> 鎵瑰彿:{{item.batchNo}} </view>
+						<view> 鐗╂枡鍚嶇О:{{item.materielName}} </view>
+						<view> 鍝佸悕/閫氱敤鍚�:{{item.item || ''}} </view>
 						<view> 鐗╂枡缂栧彿:{{item.materielCode}} </view>
-						<!-- <view> 鐗╂枡鍚嶇О:{{item.materielName}} </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>
@@ -52,9 +57,19 @@
 			// this.getData();
 		},
 		onReachBottom() {
+	// 鍙湁鍦ㄨ繕鏈夋洿澶氭暟鎹椂鎵嶅姞杞戒笅涓�椤�
+		if (this.status === 'more') {
 			this.pageNo += 1;
 			this.getData();
+  }
 		},
+		  // 娣诲姞杩欎釜鐢熷懡鍛ㄦ湡
+  onHide() {
+    // 椤甸潰闅愯棌鏃朵笉鍋氫换浣曟搷浣�
+  },
+
+
+
 		onShow() {
 			// this.outTask = uni.getStorageSync('outTask');
 			// if (this.outTask) {
@@ -69,6 +84,13 @@
 			this.scrollTop = e.scrollTop;
 		},
 		methods: {
+			 // 娣诲姞鍒锋柊鏂规硶渚涘叾浠栭〉闈㈣皟鐢�
+			refreshData() {
+				console.log('鏀跺埌鍒锋柊璇锋眰');
+				this.pageNo = 1;
+				this.allReceivingOrders = [];
+				this.getData();
+			},
 			search(res) {
 				this.pageNo = 1;
 				this.getData();
@@ -76,6 +98,7 @@
 			groupClick() {
 
 			},
+
 			// getData() {
 			// 	var postData = {
 			// 		MainData: {
@@ -87,7 +110,7 @@
 			// 		},
 			// 	}
 			// 	if (this.pageNo == 1) this.allReceivingOrders = [];
-			// 	this.$u.post('/api/DeliveryOrder/GetCheckOutTasks',postData).then((
+			// 	this.$u.post('/api/DeliveryOrder/CheckOutTasks',postData).then((
 			// 		res) => {
 			// 			if (res.status) {
 			// 				if (res.data.length > 0) {
@@ -115,68 +138,69 @@
 			// 			}
 			// 		})
 			// }
-			getData() {
-				var postData = {
-					MainData: {
-						warehouseId: this.warehouseId,
-						locationCode: this.searchValue,
-						orderNo: this.orderNo,
-						pageNo: this.pageNo,
-						isCheck: false,
-					},
-				}
-				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) => {
-							// 			if (res.confirm) {
-											// uni.getStorageSync('isout',true)
-							// 				// 鐢ㄦ埛鐐瑰嚮纭畾
-											setTimeout(() => {
-												uni.navigateBack({
-													delta: 1
-												});
-											}, 300);
-							// 			} else {
-							// 				// 鐢ㄦ埛鐐瑰嚮鍙栨秷锛屽彲浠ュ仠鐣欏湪褰撳墠椤甸潰
-							// 				// 鎴栬�呮墽琛屽叾浠栨搷浣�
-							// 			}
-							// 		}
-							// 	});
-							}
-						}
-					}
-				})
-			}
+getData() {
+  var postData = {
+    MainData: {
+      warehouseId: this.warehouseId,
+      locationCode: this.searchValue,
+      orderNo: this.orderNo,
+      pageNo: this.pageNo,
+      isCheck: false,
+    },
+  }
+  
+  // 濡傛灉鏄涓�椤垫垨鎼滅储锛屾竻绌烘暟鎹�
+  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>
+</script> 
+
+
 
 <style lang="scss">
 	@import '@/common/uni-ui.scss';

--
Gitblit v1.9.3