1
wankeda
2026-01-22 eaf097eeef67ebaaf46777269128e65f820e31fc
¼ª°²PDA/pages/stash/CPinboundorder.vue
@@ -5,6 +5,14 @@
            <uni-search-bar @confirm="search" v-model="searchValue"></uni-search-bar>
         </view>
      </u-sticky>
      <!-- å°†é¡µé¢å†…容包装在 scroll-view ä¸­ -->
      <scroll-view
         scroll-y
         :style="{height: 'calc(100vh - 100px)'}"
         @scrolltolower="onReachBottom"
         ref="scrollView"
      >
      <uni-list :border="true">
         <uni-list-item direction="column" clickable @click="groupClick(item.orderNo)" link :to="page+item.orderNo"
            v-for="item in allReceivingOrders" :key="item.orderNo">
@@ -48,6 +56,7 @@
      <uni-load-more :status="status" v-if="loadVisible"></uni-load-more>
      <u-back-top :scroll-top="scrollTop" top="400"></u-back-top>
      </scroll-view>
   </view>
</template>
@@ -66,7 +75,9 @@
            pageNo: 1,
            scrollTop: 0,
            warehouseId: "",
            isLoaded: false
            isLoaded: false,
            // æ·»åŠ ä¸€ä¸ªå˜é‡è®°å½•æ˜¯å¦æ­£åœ¨åŠ è½½
            isLoadingMore: false
         }
      },
      onLoad(res) {
@@ -74,11 +85,7 @@
         this.page = this.page + "warehouseId=" + this.warehouseId + "&orderNo=";
         this.getData();
      },
      onReachBottom() {
         this.pageNo += 1;
         this.getData();
         this.isLoaded = true;
      },
      // ç§»é™¤åŽŸæ¥çš„ onReachBottom,使用 scroll-view çš„ @scrolltolower
      onShow() {
         if (this.isLoaded) {
            // ä»Žå…¶ä»–页面返回时刷新
@@ -95,6 +102,16 @@
         groupClick() {
         },
         // scroll-view æ»šåŠ¨åˆ°åº•éƒ¨æ—¶è§¦å‘
         onReachBottom() {
            if (this.isLoadingMore || this.status === 'noMore') return;
            this.isLoadingMore = true;
            this.pageNo += 1;
            this.status = "loading";
            this.getData();
         },
         getData() {
            var postData = {
               MainData: {
@@ -106,48 +123,48 @@
            this.$u.post('/api/InboundOrder/GetInboundOrders', postData).then((res) => {
               if (res.status) {
                  if (res.data.length > 0) {
                     const newData = res.data.map(i => ({
                        ...i,
                        InboundOrderStatus: InboundOrderStatus.find(item => item.value == i
                           .orderStatus).label,
                        SumQty: i.details.map(item => item.orderQuantity).reduce((prev,
                           next) => prev + next, 0),
                        OverQty: i.details.map(item => item.overInQuantity).reduce((prev,
                           next) => prev + next, 0),
                        RecQty: i.details.map(item => item.receiptQuantity).reduce((prev,
                           next) => prev + next, 0)
                     }));
                     if (this.searchValue == '') {
                        this.allReceivingOrders = res.data.map(i => ({
                           ...i,
                           InboundOrderStatus: InboundOrderStatus.find(item => item.value == i
                              .orderStatus).label,
                           SumQty: i.details.map(item => item.orderQuantity).reduce((prev,
                              next) => prev + next, 0),
                           OverQty: i.details.map(item => item.overInQuantity).reduce((prev,
                              next) => prev + next, 0),
                           RecQty: i.details.map(item => item.receiptQuantity).reduce((prev,
                              next) => prev + next, 0)
                        }));
                        // this.allReceivingOrders = res.data;
                        // è¿½åŠ æ•°æ®è€Œä¸æ˜¯æ›¿æ¢
                        this.allReceivingOrders = [...this.allReceivingOrders, ...newData];
                        if (this.allReceivingOrders.length > 3) {
                           this.loadVisible = true;
                        } else {
                           this.loadVisible = false;
                        }
                     } else {
                        this.allReceivingOrders = res.data.map(i => ({
                           ...i,
                           InboundOrderStatus: InboundOrderStatus.find(item => item.value == i
                              .orderStatus).label,
                           SumQty: i.details.map(item => item.orderQuantity).reduce((prev,
                              next) => prev + next, 0),
                           OverQty: i.details.map(item => item.overInQuantity).reduce((prev,
                              next) => prev + next, 0),
                           RecQty: i.details.map(item => item.receiptQuantity).reduce((prev,
                              next) => prev + next, 0)
                        }));
                        // æœç´¢æ—¶æ›¿æ¢æ•°æ®
                        this.allReceivingOrders = newData;
                        if (this.allReceivingOrders.length > 3) {
                           this.loadVisible = true;
                        } else {
                           this.loadVisible = false;
                        }
                     }
                     // å¦‚果没有更多数据
                     if (res.data.length < 10) { // å‡è®¾æ¯é¡µ10条数据
                        this.status = 'noMore';
                     } else {
                        this.status = 'more';
                     }
                  } else {
                     this.status = 'noMore';
                     //this.allReceivingOrders = [];
                     this.loadVisible = true;
                  }
               }
               this.isLoadingMore = false;
            })
         }
      }
@@ -163,7 +180,12 @@
      box-sizing: border-box;
      background-color: #efeff4;
      min-height: 100%;
      height: auto;
      height: 100vh;
   }
   /* ç¡®ä¿ scroll-view å æ®æ•´ä¸ªé¡µé¢ç©ºé—´ */
   scroll-view {
      height: calc(100vh - 100px);
   }
   .tips {