From de398f47dd12b3890c9ee545422da78e82b60fa9 Mon Sep 17 00:00:00 2001
From: yanjinhui <3306209981@qq.com>
Date: 星期一, 08 十二月 2025 09:22:06 +0800
Subject: [PATCH] 修改PDA出入库中出现undefined问题,修改job中因为上游调用频率过快导致job死掉,修改前端报警信息使用不同颜色

---
 新建文件夹/PDA/pages/stash/outboundorderDetail.vue |  225 +++++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 172 insertions(+), 53 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 afe6d22..db54b65 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"
@@ -1,21 +1,27 @@
 <template>
 	<view>
-		<!-- <u-sticky>
+		<u-sticky>
 			<view style="background-color: #ffffff;">
 				<uni-search-bar @confirm="search" v-model="searchValue"></uni-search-bar>
 			</view>
-		</u-sticky> -->
+		</u-sticky>
 		<uni-list :border="true">
-			<uni-list-item direction="column" clickable @click="groupClick(item.batch_num)" link
-				:to="page+item.batch_num+'&order_qty='+item.order_qty+'&order_Inqty='+item.order_Outqty+'&goods_no='+item.goods_no"
-				v-for="item in allReceivingOrders" :key="item.batch_num">
+			<uni-list-item direction="column" clickable @click="groupClick(item.locationCode)" link
+				:to="page+item.locationCode+'&stockQuantity='+item.stockQuantity+'&taskId='+item.taskId+'&materielCode='+item.materielCode+'&batchNo='+item.batchNo+'&materielName='+item.materielName"
+				v-for="item in allReceivingOrders" :key="item.locationCode">
 				<template v-slot:body>
 					<uni-group margin-top="20">
+						<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.batch_num}} </view>
-						<view> 鐗╂枡缂栧彿:{{item.goods_no}} </view>
-						<view> 鍗曟嵁鏁伴噺:{{item.order_qty}} </view>
-						<view> 鍑哄簱鏁伴噺:{{item.order_Outqty}} </view>
+						<view> 璐т綅缂栧彿:{{item.locationCode}} </view>
+						<view> 鏁伴噺:{{item.stockQuantity}} </view>
 					</uni-group>
 				</template>
 			</uni-list-item>
@@ -31,7 +37,7 @@
 	export default {
 		data() {
 			return {
-				page: "/pages/stash/Outorderboxing?",
+				page: "/pages/stash/outFinish?",
 				loadVisible: false,
 				searchValue: "",
 				status: "more",
@@ -39,24 +45,77 @@
 				orderNo: "",
 				pageNo: 1,
 				scrollTop: 0,
-				warehouseId: ""
+				outTask: false,
+				warehouseId: "",
+				hasDataLoaded: false,  // 鏁版嵁鏄惁宸插姞杞借繃
+				shouldRefreshFromC: false,  //  鍏抽敭锛氫粠C椤甸潰杩斿洖鏃堕渶瑕佸埛鏂扮殑鏍囧織
 			}
 		},
 		onLoad(res) {
-			this.warehouseId = res.warehouseId;
-			this.orderNo = res.orderNo;
-			this.allReceivingOrders=res.detail;
-			this.page = this.page + "orderNo=" + this.orderNo +"&warehouseId=" + this.warehouseId + "&batchNo=";
-			this.getData();
+		// 鐩戝惉鏉ヨ嚜C椤甸潰鐨勫埛鏂颁簨浠�
+		const eventChannel = this.getOpenerEventChannel();
+		if (eventChannel) {
+			eventChannel.on('refreshData', (data) => {
+			if (data.refresh) {
+				this.pageNo = 1;
+				this.allReceivingOrders = [];
+				this.getData();
+			}
+			});
+		}
+		
+		// 淇濆瓨浼犲叆鐨勫垵濮嬫暟鎹�
+		if (res.detail && res.detail.length > 0) {
+			this.allReceivingOrders = res.detail;
+		}
+		this.warehouseId = res.warehouseId;
+		this.orderNo = res.orderNo;
+		this.page = this.page + "orderNo=" + this.orderNo + "&warehouseId=" + this.warehouseId + "&locationCode=";
 		},
 		onReachBottom() {
+	// 鍙湁鍦ㄨ繕鏈夋洿澶氭暟鎹椂鎵嶅姞杞戒笅涓�椤�
+		if (this.status === 'more') {
 			this.pageNo += 1;
 			this.getData();
+  }
 		},
+		  // 娣诲姞杩欎釜鐢熷懡鍛ㄦ湡
+  onHide() {
+    // 椤甸潰闅愯棌鏃朵笉鍋氫换浣曟搷浣�
+  },
+
+
+
+		onShow() {
+  // 妫�鏌ユ槸鍚﹂渶瑕佸埛鏂�
+			const needRefresh = uni.getStorageSync('needRefreshOutbound');
+			if (needRefresh) {
+				uni.removeStorageSync('needRefreshOutbound');
+				this.pageNo = 1;
+				this.allReceivingOrders = [];
+				this.getData();
+				return;
+			}
+			
+			// 濡傛灉杩樻病鏈夊姞杞借繃鏁版嵁锛屽姞杞芥暟鎹�
+			if (!this.hasDataLoaded) {
+				this.pageNo = 1;
+				this.allReceivingOrders = [];
+				this.getData();
+				this.hasDataLoaded = true;
+			}
+			},
 		onPageScroll(e) {
 			this.scrollTop = e.scrollTop;
 		},
 		methods: {
+			 // 娣诲姞鍒锋柊鏂规硶渚涘叾浠栭〉闈㈣皟鐢�
+			// refreshData() {
+			// 	console.log('鏀跺埌鍒锋柊璇锋眰');
+			// 	this.pageNo = 1;
+			// 	this.allReceivingOrders = [];
+			// 	this.getData();
+			// },
 			search(res) {
 				this.pageNo = 1;
 				this.getData();
@@ -64,46 +123,106 @@
 			groupClick() {
 
 			},
-			getData() {
-				// var postData = {
-				// 	MainData: {
-				// 		warehouseId: this.warehouseId,
-				// 		orderNo: this.searchValue,
-				// 		pageNo: this.pageNo
-				// 	},
-				// }
-				if (this.pageNo == 1) this.allReceivingOrders = [];
-				this.$u.post('/api/DeliveryOrder/GetDeliveryOrderDetail?pageNo=' + this.warehouseId + '&orderNo=' + this.orderNo+'&isPick=false').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;
-							}
-						}
-					})
+
+			// 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/CheckOutTasks',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;
+			// 				}
+			// 			}
+			// 		})
+			// }
+		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];
+				
+				// 鍒嗛〉閫昏緫
+				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 = [];
+				}
+				
+				// 鐩存帴杩斿洖A椤甸潰锛屼笉闇�瑕佹彁绀�
+				if (this.allReceivingOrders.length === 0 && this.pageNo === 1) {
+				setTimeout(() => {
+					uni.navigateBack({
+					delta: 1  // 杩斿洖A椤甸潰
+					});
+				}, 300); // 绋嶅井寤惰繜涓�涓嬶紝璁╃敤鎴风湅鍒�"娌℃湁鏁版嵁"鐨勭姸鎬�
+				}
 			}
+			}
+		}).catch(err => {
+			console.error('璇锋眰澶辫触:', err);
+			this.status = 'noMore';
+		})
+		}
 		}
 	}
-</script>
+</script> 
+
+
 
 <style lang="scss">
 	@import '@/common/uni-ui.scss';

--
Gitblit v1.9.3