yanjinhui
2025-12-01 2b49f7643d15b74889d190f216630559006ed93a
н¨Îļþ¼Ð/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>
@@ -44,6 +56,11 @@
            warehouseId: ""
         }
      },
        // æ·»åŠ è¿™ä¸ªç”Ÿå‘½å‘¨æœŸ
  onHide() {
    // é¡µé¢éšè—æ—¶ä¸åšä»»ä½•操作
  },
      onLoad(res) {
         this.warehouseId = res.warehouseId;
         this.orderNo = res.orderNo;
@@ -52,8 +69,11 @@
         // this.getData();
      },
      onReachBottom() {
         // åªæœ‰åœ¨è¿˜æœ‰æ›´å¤šæ•°æ®æ—¶æ‰åŠ è½½ä¸‹ä¸€é¡µ
  if (this.status === 'more') {
         this.pageNo += 1;
         this.getData();
  }
      },
      onShow() {
         // this.checkTask = uni.getStorageSync('checkTask');
@@ -69,6 +89,13 @@
         this.scrollTop = e.scrollTop;
      },
      methods: {
         // æ·»åŠ åˆ·æ–°æ–¹æ³•ä¾›å…¶ä»–é¡µé¢è°ƒç”¨
         refreshData() {
            console.log('收到盘点刷新请求');
            this.pageNo = 1;
            this.allReceivingOrders = [];
            this.getData();
         },
         search(res) {
            this.pageNo = 1;
            this.getData();
@@ -76,6 +103,8 @@
         groupClick() {
         },
         getData() {
            var postData = {
               MainData: {
@@ -86,53 +115,52 @@
                  isCheck: true,
               },
            }
            if (this.pageNo == 1) this.allReceivingOrders = [];
            this.$u.post('/api/DeliveryOrder/GetCheckOutTasks', postData).then((
               res) => {
  // å¦‚果是第一页或搜索,清空数据
  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.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 {
      if (res.data && res.data.length > 0) {
        // è¿½åŠ æ•°æ®è€Œä¸æ˜¯æ›¿æ¢
        this.allReceivingOrders = [...this.allReceivingOrders, ...res.data];
        // å¦‚果返回的数据少于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 = [];
        }
        // ç›˜ç‚¹å®Œæˆæç¤ºé€»è¾‘
                     if (this.allReceivingOrders.length < 1) {
                        // uni.showModal({
                        //    title: '提示',
                        //    content: '盘点已完成,是否返回首页?',
                        //    success: (res) => {
                              // uni.getStorageSync('ischeck',true)
                        //       if (res.confirm) {
                        //          // ç”¨æˆ·ç‚¹å‡»ç¡®å®š
                                 setTimeout(() => {
                                    uni.navigateBack({
                                       delta: 1
                                    });
                                 }, 300);
                        //       } else {
                        //          // ç”¨æˆ·ç‚¹å‡»å–消,可以停留在当前页面
                        //          // æˆ–者执行其他操作
                        //       }
                        //    }
                        // });
                     }
                  }
               }
  }).catch(err => {
    console.error('请求失败:', err);
    this.status = 'noMore';
            })
         }
      }