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/CheckoutorderDetail.vue | 181 +++++++++++++++++++++++++++-----------------
1 files changed, 111 insertions(+), 70 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 28c0618..53f556f 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>
@@ -41,33 +53,62 @@
pageNo: 1,
scrollTop: 0,
checkTask: false,
- warehouseId: ""
+ warehouseId: "",
+ hasDataLoaded: false, // 鏁版嵁鏄惁宸插姞杞借繃
+ shouldRefreshFromC: false, // 浠嶤椤甸潰杩斿洖鏃堕渶瑕佸埛鏂扮殑鏍囧織
}
},
+ // 娣诲姞杩欎釜鐢熷懡鍛ㄦ湡
+ onHide() {
+ // 椤甸潰闅愯棌鏃朵笉鍋氫换浣曟搷浣�
+ },
+
onLoad(res) {
this.warehouseId = res.warehouseId;
this.orderNo = res.orderNo;
- this.allReceivingOrders = res.detail;
+ 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.getData();
},
onReachBottom() {
- this.pageNo += 1;
- this.getData();
+ // 鍙湁鍦ㄨ繕鏈夋洿澶氭暟鎹椂鎵嶅姞杞戒笅涓�椤�
+ if (this.status === 'more') {
+ this.pageNo += 1;
+ this.getData();
+ }
},
onShow() {
- this.checkTask = uni.getStorageSync('checkTask');
- if (this.checkTask) {
- uni.removeStorageSync('checkTask');
- this.pageNo = 1;
- // 浠庡叾浠栭〉闈㈣繑鍥炴椂鍒锋柊
- this.getData();
- }
+ // 妫�鏌ユ槸鍚﹂渶瑕佸埛鏂�
+ const needRefresh = uni.getStorageSync('needRefreshCheck');
+ if (needRefresh) {
+ uni.removeStorageSync('needRefreshCheck');
+ 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,64 +116,64 @@
groupClick() {
},
- getData() {
- var postData = {
- MainData: {
- warehouseId: this.warehouseId,
- locationCode: this.searchValue,
- orderNo: this.orderNo,
- pageNo: this.pageNo,
- isCheck: true,
- },
+ getData() {
+ 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';
}
- 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) {
- // 鐢ㄦ埛鐐瑰嚮纭畾
- setTimeout(() => {
- uni.navigateBack({
- delta: 2
- });
- }, 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>
--
Gitblit v1.9.3