н¨Îļþ¼Ð/PDA/pages/stash/outboundorderDetail.vue
@@ -46,15 +46,31 @@
            pageNo: 1,
            scrollTop: 0,
            outTask: false,
            warehouseId: ""
            warehouseId: "",
            hasDataLoaded: false,  // æ•°æ®æ˜¯å¦å·²åŠ è½½è¿‡
            shouldRefreshFromC: false,  //  å…³é”®ï¼šä»ŽC页面返回时需要刷新的标志
         }
      },
      onLoad(res) {
      // ç›‘听来自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.allReceivingOrders = res.detail;
         this.page = this.page + "orderNo=" + this.orderNo + "&warehouseId=" + this.warehouseId + "&locationCode=";
         // this.getData();
      },
      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();
@@ -158,36 +183,33 @@
  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) {
            // ç›´æŽ¥è¿”回A页面,不需要提示
            if (this.allReceivingOrders.length === 0 && this.pageNo === 1) {
          setTimeout(() => {
            uni.navigateBack({
              delta: 1
               delta: 1  // è¿”回A页面
            });
          }, 300);
            }, 300); // ç¨å¾®å»¶è¿Ÿä¸€ä¸‹ï¼Œè®©ç”¨æˆ·çœ‹åˆ°"没有数据"的状态
        }
      }
    }