yanjinhui
2025-12-01 2b49f7643d15b74889d190f216630559006ed93a
н¨Îļþ¼Ð/PDA/pages/stash/outboundorder.vue
@@ -55,7 +55,7 @@
            pageNo: 1,
            scrollTop: 0,
            warehouseId: "",
            isout:false
            isout:false,
         }
      },
      onLoad(res) {
@@ -64,9 +64,11 @@
         // this.getData();
      },
      onReachBottom() {
         if (this.status === 'more') {
         this.pageNo += 1;
         this.getData();
         this.isout=true;
         }
      },
      onShow() {
         // this.isout = uni.getStorageSync('isout');
@@ -83,6 +85,7 @@
      },
      methods: {
         search(res) {
            this.pageNo = 1; // æœç´¢æ—¶é‡ç½®ä¸ºç¬¬ä¸€é¡µ
            this.getData();
         },
         groupClick() {
@@ -96,41 +99,49 @@
                  pageNo: this.pageNo
               },
            }
      // å¦‚果是第一页或搜索,清空数据
      if (this.pageNo === 1 || this.searchValue !== '') {
         this.allReceivingOrders = [];
         this.status = "more";
      }
            this.$u.post('/api/DeliveryOrder/GetDeliveryOrders', 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';
            })
         }
      }