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 | 203 +++++++++++++++++++++++++++++++-------------------
1 files changed, 125 insertions(+), 78 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 72f2be3..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"
@@ -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>
@@ -41,33 +46,76 @@
pageNo: 1,
scrollTop: 0,
outTask: false,
- warehouseId: ""
+ 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 + "&locationCode=";
- this.getData();
- },
- onReachBottom() {
- this.pageNo += 1;
- this.getData();
- },
- onShow() {
- this.outTask = uni.getStorageSync('outTask');
- if (this.outTask) {
- uni.removeStorageSync('outTask');
+ // 鐩戝惉鏉ヨ嚜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();
@@ -75,6 +123,7 @@
groupClick() {
},
+
// getData() {
// var postData = {
// MainData: {
@@ -86,7 +135,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) {
@@ -114,68 +163,66 @@
// }
// })
// }
- getData() {
- var postData = {
- MainData: {
- warehouseId: this.warehouseId,
- locationCode: this.searchValue,
- orderNo: this.orderNo,
- pageNo: this.pageNo,
- isCheck: false,
- },
+ 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';
}
- 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('isLoaded',true)
- // 鐢ㄦ埛鐐瑰嚮纭畾
- setTimeout(() => {
- uni.navigateBack({
- delta: 1
- });
- }, 500);
- } else {
- // 鐢ㄦ埛鐐瑰嚮鍙栨秷锛屽彲浠ュ仠鐣欏湪褰撳墠椤甸潰
- // 鎴栬�呮墽琛屽叾浠栨搷浣�
- }
- }
- });
- }
- }
- }
- })
+
+ 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