yanjinhui
2025-12-01 2b49f7643d15b74889d190f216630559006ed93a
н¨Îļþ¼Ð/PDA/pages/stash/Checkoutorder.vue
@@ -61,12 +61,15 @@
      onLoad(res) {
         this.warehouseId = res.warehouseId;
         this.page = this.page + "warehouseId=" + this.warehouseId + "&orderNo=";
         this.getData();
         // this.getData();
      },
      onReachBottom() {
           // åªæœ‰åœ¨è¿˜æœ‰æ›´å¤šæ•°æ®æ—¶æ‰åŠ è½½ä¸‹ä¸€é¡µ
         if (this.status === 'more') {
         this.pageNo += 1;
         this.getData();
         this.ischeck=true;
            }
      },
      onShow() {
         // this.ischeck = uni.getStorageSync('ischeck');
@@ -83,6 +86,7 @@
      },
      methods: {
         search(res) {
            this.pageNo = 1; // æœç´¢æ—¶é‡ç½®ä¸ºç¬¬ä¸€é¡µ
            this.getData();
         },
         groupClick() {
@@ -96,41 +100,50 @@
                  pageNo: this.pageNo
               },
            }
      // å¦‚果是第一页或搜索,清空数据
      if (this.pageNo === 1 || this.searchValue !== '') {
         this.allReceivingOrders = [];
         this.status = "more";
      }
            this.$u.post('/api/DeliveryOrder/GetCheckOrders', postData).then((res) => {
               if (res.status) {
                  if (res.data.length > 0) {
                     if (this.searchValue == '') {
                        this.allReceivingOrders = res.data.map(i => ({
         if (res.data && res.data.length > 0) {
            const newData = res.data.map(i => ({
                           ...i,
                           InboundOrderStatus: i.outStatus.label,
                           SumQty: i.details.map(item => item.order_qty).reduce((prev, next) => prev + next, 0),
                           OverQty: i.details.map(item => item.order_Outqty).reduce((prev, next) => prev + next, 0)
                        }));
                        // this.allReceivingOrders = res.data;
                        if (this.allReceivingOrders.length > 3) {
                           this.loadVisible = true;
                        } else {
                           this.loadVisible = false;
                        }
                     } else {
                        this.allReceivingOrders = res.data.map(i => ({
                           ...i,
                           InboundOrderStatus: i.outStatus.label,
                           SumQty: i.details.map(item => item.order_qty).reduce((prev, next) => prev + next, 0),
                           OverQty: i.details.map(item => item.order_Outqty).reduce((prev, next) => prev + next, 0)
                        }));
                        if (this.allReceivingOrders.length > 3) {
                           this.loadVisible = true;
                        } else {
                           this.loadVisible = false;
                        }
                     }
                  } else {
            // å…³é”®ä¿®æ”¹ï¼šè¿½åŠ æ•°æ®è€Œä¸æ˜¯æ›¿æ¢
            this.allReceivingOrders = [...this.allReceivingOrders, ...newData];
            // å¦‚果返回的数据少于5条,说明没有更多数据了
            if (res.data.length < 5) {
                     this.status = 'noMore';
                     //this.allReceivingOrders = [];
                     this.loadVisible = true;
            } 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 = [];
                  }
               }
         }
      }).catch(err => {
         console.error('请求失败:', err);
         this.status = 'noMore';
            })
         }
      }