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 | 172 ++++++++++++++++++++++++++++++++-------------------------
1 files changed, 97 insertions(+), 75 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 7888976..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"
@@ -46,15 +46,31 @@
pageNo: 1,
scrollTop: 0,
outTask: false,
- warehouseId: ""
+ warehouseId: "",
+ hasDataLoaded: false, // 鏁版嵁鏄惁宸插姞杞借繃
+ shouldRefreshFromC: false, // 鍏抽敭锛氫粠C椤甸潰杩斿洖鏃堕渶瑕佸埛鏂扮殑鏍囧織
}
},
onLoad(res) {
- this.warehouseId = res.warehouseId;
- this.orderNo = res.orderNo;
+ // 鐩戝惉鏉ヨ嚜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.page = this.page + "orderNo=" + this.orderNo + "&warehouseId=" + this.warehouseId + "&locationCode=";
- // this.getData();
+ }
+ this.warehouseId = res.warehouseId;
+ this.orderNo = res.orderNo;
+ this.page = this.page + "orderNo=" + this.orderNo + "&warehouseId=" + this.warehouseId + "&locationCode=";
},
onReachBottom() {
// 鍙湁鍦ㄨ繕鏈夋洿澶氭暟鎹椂鎵嶅姞杞戒笅涓�椤�
@@ -71,26 +87,35 @@
onShow() {
- // this.outTask = uni.getStorageSync('outTask');
- // if (this.outTask) {
- // uni.removeStorageSync('outTask');
+ // 妫�鏌ユ槸鍚﹂渶瑕佸埛鏂�
+ 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();
- },
+ // refreshData() {
+ // console.log('鏀跺埌鍒锋柊璇锋眰');
+ // this.pageNo = 1;
+ // this.allReceivingOrders = [];
+ // this.getData();
+ // },
search(res) {
this.pageNo = 1;
this.getData();
@@ -138,64 +163,61 @@
// }
// })
// }
-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';
- })
-}
+ 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>
--
Gitblit v1.9.3